From 6a4d50ead058ecee954d2133dc8d30f8bbf78129 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 29 Jan 2008 09:45:06 +0000 Subject: [PATCH 0001/1707] 2008-01-29 Bean * conf/i386-pc.rmk (pkglib_MODULES): Add `png.mod'. (png_mod_SOURCES): New variable. (png_mod_CFLAGS): Likewise. (png_mod_LDFLAGS): Likewise. * video/readers/png.c: New file. --- ChangeLog | 9 + conf/i386-pc.mk | 54 ++- conf/i386-pc.rmk | 7 +- video/readers/png.c | 836 ++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 904 insertions(+), 2 deletions(-) create mode 100644 video/readers/png.c diff --git a/ChangeLog b/ChangeLog index ae4ba128f..ecc016a51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-01-29 Bean + + * conf/i386-pc.rmk (pkglib_MODULES): Add `png.mod'. + (png_mod_SOURCES): New variable. + (png_mod_CFLAGS): Likewise. + (png_mod_LDFLAGS): Likewise. + + * video/readers/png.c: New file. + 2008-01-28 Robert Millan * include/grub/i386/linuxbios/kernel.h (GRUB_MOD_GAP): New macro. diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index a6b192924..5b7ef8f21 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -953,7 +953,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod + ata.mod vga.mod memdisk.mod jpeg.mod png.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -2566,4 +2566,56 @@ fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c genfslist.sh jpeg_mod_CFLAGS = $(COMMON_CFLAGS) jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For png.mod. +png_mod_SOURCES = video/readers/png.c +CLEANFILES += png.mod mod-png.o mod-png.c pre-png.o png_mod-video_readers_png.o und-png.lst +ifneq ($(png_mod_EXPORTS),no) +CLEANFILES += def-png.lst +DEFSYMFILES += def-png.lst +endif +MOSTLYCLEANFILES += png_mod-video_readers_png.d +UNDSYMFILES += und-png.lst + +png.mod: pre-png.o mod-png.o + -rm -f $@ + $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-png.o: $(png_mod_DEPENDENCIES) png_mod-video_readers_png.o + -rm -f $@ + $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ png_mod-video_readers_png.o + +mod-png.o: mod-png.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -c -o $@ $< + +mod-png.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'png' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(png_mod_EXPORTS),no) +def-png.lst: pre-png.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 png/' > $@ +endif + +und-png.lst: pre-png.o + echo 'png' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +png_mod-video_readers_png.o: video/readers/png.c + $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -MD -c -o $@ $< +-include png_mod-video_readers_png.d + +CLEANFILES += cmd-png_mod-video_readers_png.lst fs-png_mod-video_readers_png.lst +COMMANDFILES += cmd-png_mod-video_readers_png.lst +FSFILES += fs-png_mod-video_readers_png.lst + +cmd-png_mod-video_readers_png.lst: video/readers/png.c gencmdlist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) + +fs-png_mod-video_readers_png.lst: video/readers/png.c genfslist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) + + +png_mod_CFLAGS = $(COMMON_CFLAGS) +png_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index ff0233248..c0a6e4372 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -154,7 +154,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod + ata.mod vga.mod memdisk.mod jpeg.mod png.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -292,4 +292,9 @@ jpeg_mod_SOURCES = video/readers/jpeg.c jpeg_mod_CFLAGS = $(COMMON_CFLAGS) jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For png.mod. +png_mod_SOURCES = video/readers/png.c +png_mod_CFLAGS = $(COMMON_CFLAGS) +png_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/video/readers/png.c b/video/readers/png.c new file mode 100644 index 000000000..fd97ca481 --- /dev/null +++ b/video/readers/png.c @@ -0,0 +1,836 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Uncomment following define to enable PNG debug. */ +//#define PNG_DEBUG + +#define PNG_COLOR_MASK_PALETTE 1 +#define PNG_COLOR_MASK_COLOR 2 +#define PNG_COLOR_MASK_ALPHA 4 + +#define PNG_COLOR_TYPE_GRAY 0 +#define PNG_COLOR_TYPE_PALETTE (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_PALETTE) +#define PNG_COLOR_TYPE_RGB (PNG_COLOR_MASK_COLOR) +#define PNG_COLOR_TYPE_RGBA (PNG_COLOR_MASK_COLOR | PNG_COLOR_MASK_ALPHA) +#define PNG_COLOR_TYPE_GRAYA (PNG_COLOR_MASK_ALPHA) + +#define PNG_COMPRESSION_BASE 0 + +#define PNG_INTERLACE_NONE 0 +#define PNG_INTERLACE_ADAM7 1 + +#define PNG_FILTER_TYPE_BASE 0 + +#define PNG_FILTER_VALUE_NONE 0 +#define PNG_FILTER_VALUE_SUB 1 +#define PNG_FILTER_VALUE_UP 2 +#define PNG_FILTER_VALUE_AVG 3 +#define PNG_FILTER_VALUE_PAETH 4 +#define PNG_FILTER_VALUE_LAST 5 + +#define PNG_CHUNK_IHDR 0x49484452 +#define PNG_CHUNK_IDAT 0x49444154 +#define PNG_CHUNK_IEND 0x49454e44 + +#define Z_DEFLATED 8 +#define Z_FLAG_DICT 32 + +#define INFLATE_STORED 0 +#define INFLATE_FIXED 1 +#define INFLATE_DYNAMIC 2 + +#define WSIZE 0x8000 + +#define DEFLATE_HCLEN_BASE 4 +#define DEFLATE_HCLEN_MAX 19 +#define DEFLATE_HLIT_BASE 257 +#define DEFLATE_HLIT_MAX 286 +#define DEFLATE_HDIST_BASE 1 +#define DEFLATE_HDIST_MAX 30 + +#define DEFLATE_HUFF_LEN 16 + +struct huff_table +{ + int *values, *maxval, *offset; + int num_values, max_length; +}; + +struct grub_png_data +{ + grub_file_t file; + struct grub_video_bitmap **bitmap; + + int bit_count, bit_save; + + grub_uint32_t next_offset; + + int image_width, image_height, bpp, raw_bytes; + + int inside_idat, idat_remain; + + int code_values[DEFLATE_HLIT_MAX]; + int code_maxval[DEFLATE_HUFF_LEN]; + int code_offset[DEFLATE_HUFF_LEN]; + + int dist_values[DEFLATE_HDIST_MAX]; + int dist_maxval[DEFLATE_HUFF_LEN]; + int dist_offset[DEFLATE_HUFF_LEN]; + + struct huff_table code_table; + struct huff_table dist_table; + + grub_uint8_t slide[WSIZE]; + int wp; + + grub_uint8_t *cur_rgb; + + int cur_colume, cur_filter, first_line; +}; + +static grub_uint32_t +grub_png_get_dword (struct grub_png_data *data) +{ + grub_uint32_t r; + + r = 0; + grub_file_read (data->file, (char *) &r, sizeof (grub_uint32_t)); + + return grub_be_to_cpu32 (r); +} + +static grub_uint8_t +grub_png_get_byte (struct grub_png_data *data) +{ + grub_uint8_t r; + + if ((data->inside_idat) && (data->idat_remain == 0)) + { + grub_uint32_t len, type; + + do + { + /* Skip crc checksum. */ + grub_png_get_dword (data); + + if (data->file->offset != data->next_offset) + { + grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: chunk size error"); + return 0; + } + + len = grub_png_get_dword (data); + type = grub_png_get_dword (data); + if (type != PNG_CHUNK_IDAT) + { + grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: unexpected end of data"); + return 0; + } + + data->next_offset = data->file->offset + len + 4; + } + while (len == 0); + data->idat_remain = len; + } + + r = 0; + grub_file_read (data->file, (char *) &r, 1); + + if (data->inside_idat) + data->idat_remain--; + + return r; +} + +static int +grub_png_get_bits (struct grub_png_data *data, int num) +{ + int code, shift; + + if (data->bit_count == 0) + { + data->bit_save = grub_png_get_byte (data); + data->bit_count = 8; + } + + code = 0; + shift = 0; + while (grub_errno == 0) + { + int n; + + n = data->bit_count; + if (n > num) + n = num; + + code += (int) (data->bit_save & ((1 << n) - 1)) << shift; + num -= n; + if (!num) + { + data->bit_count -= n; + data->bit_save >>= n; + break; + } + + shift += n; + + data->bit_save = grub_png_get_byte (data); + data->bit_count = 8; + } + + return code; +} + +static grub_err_t +grub_png_decode_image_header (struct grub_png_data *data) +{ + int color_type; + + data->image_width = grub_png_get_dword (data); + data->image_height = grub_png_get_dword (data); + + if ((!data->image_height) || (!data->image_width)) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: invalid image size"); + + if (grub_png_get_byte (data) != 8) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: bit depth must be 8"); + + color_type = grub_png_get_byte (data); + if (color_type == PNG_COLOR_TYPE_RGB) + { + if (grub_video_bitmap_create (data->bitmap, data->image_width, + data->image_height, + GRUB_VIDEO_BLIT_FORMAT_R8G8B8)) + return grub_errno; + data->bpp = 3; + } + else if (color_type == PNG_COLOR_TYPE_RGBA) + { + if (grub_video_bitmap_create (data->bitmap, data->image_width, + data->image_height, + GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8)) + return grub_errno; + data->bpp = 4; + } + else + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: color type not supported"); + + data->raw_bytes = data->image_height * (data->image_width + 1) * data->bpp; + + data->cur_rgb = (*data->bitmap)->data; + data->cur_colume = 0; + data->first_line = 1; + + if (grub_png_get_byte (data) != PNG_COMPRESSION_BASE) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: compression method not supported"); + + if (grub_png_get_byte (data) != PNG_FILTER_TYPE_BASE) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: filter method not supported"); + + if (grub_png_get_byte (data) != PNG_INTERLACE_NONE) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: interlace method not supported"); + + /* Skip crc checksum. */ + grub_png_get_dword (data); + + return grub_errno; +} + +/* Order of the bit length code lengths. */ +static const grub_uint8_t bitorder[] = { + 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 +}; + +/* Copy lengths for literal codes 257..285. */ +static const int cplens[] = { + 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, + 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 0, 0 +}; + +/* Extra bits for literal codes 257..285. */ +static const grub_uint8_t cplext[] = { + 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, + 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 99, 99 +}; /* 99==invalid */ + +/* Copy offsets for distance codes 0..29. */ +static const int cpdist[] = { + 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, + 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, + 8193, 12289, 16385, 24577 +}; + +/* Extra bits for distance codes. */ +static const grub_uint8_t cpdext[] = { + 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, + 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, + 12, 12, 13, 13 +}; + +static void +grub_png_init_huff_table (struct huff_table *ht, int cur_maxlen, + int *cur_values, int *cur_maxval, int *cur_offset) +{ + ht->values = cur_values; + ht->maxval = cur_maxval; + ht->offset = cur_offset; + ht->num_values = 0; + ht->max_length = cur_maxlen; + grub_memset (cur_maxval, 0, sizeof (int) * cur_maxlen); +} + +static void +grub_png_insert_huff_item (struct huff_table *ht, int code, int len) +{ + int i, n; + + if (len == 0) + return; + + if (len > ht->max_length) + { + grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: invalid code length"); + return; + } + + n = 0; + for (i = len; i < ht->max_length; i++) + n += ht->maxval[i]; + + for (i = 0; i < n; i++) + ht->values[ht->num_values - i] = ht->values[ht->num_values - i - 1]; + + ht->values[ht->num_values - n] = code; + ht->num_values++; + ht->maxval[len - 1]++; +} + +static void +grub_png_build_huff_table (struct huff_table *ht) +{ + int base, ofs, i; + + base = 0; + ofs = 0; + for (i = 0; i < ht->max_length; i++) + { + base += ht->maxval[i]; + ofs += ht->maxval[i]; + + ht->maxval[i] = base; + ht->offset[i] = ofs - base; + + base <<= 1; + } +} + +static int +grub_png_get_huff_code (struct grub_png_data *data, struct huff_table *ht) +{ + int code, i; + + code = 0; + for (i = 0; i < ht->max_length; i++) + { + code = (code << 1) + grub_png_get_bits (data, 1); + if (code < ht->maxval[i]) + return ht->values[code + ht->offset[i]]; + } + return 0; +} + +static grub_err_t +grub_png_init_dynamic_block (struct grub_png_data *data) +{ + int nl, nd, nb, i, prev; + struct huff_table cl; + int cl_values[sizeof (bitorder)]; + int cl_maxval[8]; + int cl_offset[8]; + grub_uint8_t lens[DEFLATE_HCLEN_MAX]; + + nl = DEFLATE_HLIT_BASE + grub_png_get_bits (data, 5); + nd = DEFLATE_HDIST_BASE + grub_png_get_bits (data, 5); + nb = DEFLATE_HCLEN_BASE + grub_png_get_bits (data, 4); + + if ((nl > DEFLATE_HLIT_MAX) || (nd > DEFLATE_HDIST_MAX) || + (nb > DEFLATE_HCLEN_MAX)) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: too much data"); + + grub_png_init_huff_table (&cl, 8, cl_values, cl_maxval, cl_offset); + + for (i = 0; i < nb; i++) + lens[bitorder[i]] = grub_png_get_bits (data, 3); + + for (; i < DEFLATE_HCLEN_MAX; i++) + lens[bitorder[i]] = 0; + + for (i = 0; i < DEFLATE_HCLEN_MAX; i++) + grub_png_insert_huff_item (&cl, i, lens[i]); + + grub_png_build_huff_table (&cl); + + grub_png_init_huff_table (&data->code_table, DEFLATE_HUFF_LEN, + data->code_values, data->code_maxval, + data->code_offset); + + grub_png_init_huff_table (&data->dist_table, DEFLATE_HUFF_LEN, + data->dist_values, data->dist_maxval, + data->dist_offset); + + prev = 0; + for (i = 0; i < nl + nd; i++) + { + int n, code; + struct huff_table *ht; + + if (grub_errno) + return grub_errno; + + if (i < nl) + { + ht = &data->code_table; + code = i; + } + else + { + ht = &data->dist_table; + code = i - nl; + } + + n = grub_png_get_huff_code (data, &cl); + if (n < 16) + { + grub_png_insert_huff_item (ht, code, n); + prev = n; + } + else if (n == 16) + { + int c; + + c = 3 + grub_png_get_bits (data, 2); + while (c > 0) + { + grub_png_insert_huff_item (ht, code++, prev); + i++; + c--; + } + i--; + } + else if (n == 17) + i += 3 + grub_png_get_bits (data, 3) - 1; + else + i += 11 + grub_png_get_bits (data, 7) - 1; + } + + grub_png_build_huff_table (&data->code_table); + grub_png_build_huff_table (&data->dist_table); + + return grub_errno; +} + +static grub_err_t +grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) +{ + int row_bytes; + + if (--data->raw_bytes < 0) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "image size overflown"); + + if (data->cur_colume == 0) + { + if (n >= PNG_FILTER_VALUE_LAST) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid filter value"); + + data->cur_filter = n; + } + else + *(data->cur_rgb++) = n; + + data->cur_colume++; + row_bytes = data->image_width * data->bpp; + if (data->cur_colume == row_bytes + 1) + { + grub_uint8_t *blank_line = NULL; + grub_uint8_t *cur = data->cur_rgb - row_bytes; + grub_uint8_t *left = cur; + grub_uint8_t *up; + + if (data->first_line) + { + blank_line = grub_malloc (row_bytes); + if (blank_line == NULL) + return grub_errno; + + grub_memset (blank_line, 0, row_bytes); + up = blank_line; + } + else + up = cur - row_bytes; + + switch (data->cur_filter) + { + case PNG_FILTER_VALUE_SUB: + { + int i; + + cur += data->bpp; + for (i = data->bpp; i < row_bytes; i++, cur++, left++) + *cur += *left; + + break; + } + case PNG_FILTER_VALUE_UP: + { + int i; + + for (i = 0; i < row_bytes; i++, cur++, up++) + *cur += *up; + + break; + } + case PNG_FILTER_VALUE_AVG: + { + int i; + + for (i = 0; i < data->bpp; i++, cur++, up++) + *cur += *up >> 1; + + for (; i < row_bytes; i++, cur++, up++, left++) + *cur += ((int) *up + (int) *left) >> 1; + + break; + } + case PNG_FILTER_VALUE_PAETH: + { + int i; + grub_uint8_t *upper_left = up; + + for (i = 0; i < data->bpp; i++, cur++, up++) + *cur += *up; + + for (; i < row_bytes; i++, cur++, up++, left++, upper_left++) + { + int a, b, c, pa, pb, pc; + + a = *left; + b = *up; + c = *upper_left; + + pa = b - c; + pb = a - c; + pc = pa + pb; + + if (pa < 0) + pa = -pa; + + if (pb < 0) + pb = -pb; + + if (pc < 0) + pc = -pc; + + *cur += ((pa <= pb) && (pa <= pc)) ? a : (pb <= pc) ? b : c; + } + } + } + + if (blank_line) + grub_free (blank_line); + + data->cur_colume = 0; + data->first_line = 0; + } + + return grub_errno; +} + +static grub_err_t +grub_png_read_dynamic_block (struct grub_png_data *data) +{ + while (grub_errno == 0) + { + int n; + + n = grub_png_get_huff_code (data, &data->code_table); + if (n < 256) + { + data->slide[data->wp] = n; + grub_png_output_byte (data, n); + + data->wp++; + if (data->wp >= WSIZE) + data->wp = 0; + } + else if (n == 256) + break; + else + { + int len, dist, pos; + + n -= 257; + len = cplens[n]; + if (cplext[n]) + len += grub_png_get_bits (data, cplext[n]); + + n = grub_png_get_huff_code (data, &data->dist_table); + dist = cpdist[n]; + if (cpdext[n]) + dist += grub_png_get_bits (data, cpdext[n]); + + pos = data->wp - dist; + if (pos < 0) + pos += WSIZE; + + while (len > 0) + { + data->slide[data->wp] = data->slide[pos]; + grub_png_output_byte (data, data->slide[data->wp]); + + data->wp++; + if (data->wp >= WSIZE) + data->wp = 0; + + pos++; + if (pos >= WSIZE) + pos = 0; + + len--; + } + } + } + + return grub_errno; +} + +static grub_err_t +grub_png_decode_image_data (struct grub_png_data *data) +{ + grub_uint8_t cmf, flg; + int final; + + cmf = grub_png_get_byte (data); + flg = grub_png_get_byte (data); + + if ((cmf & 0xF) != Z_DEFLATED) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: only support deflate compression method"); + + if (flg & Z_FLAG_DICT) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: dictionary not supported"); + + do + { + int block_type; + + final = grub_png_get_bits (data, 1); + block_type = grub_png_get_bits (data, 2); + + switch (block_type) + { + case INFLATE_STORED: + { + grub_uint16_t i, len; + + data->bit_count = 0; + len = grub_png_get_byte (data); + len += ((grub_uint16_t) grub_png_get_byte (data)) << 8; + + /* Skip NLEN field. */ + grub_png_get_byte (data); + grub_png_get_byte (data); + + for (i = 0; i < len; i++) + grub_png_output_byte (data, grub_png_get_byte (data)); + + break; + } + + case INFLATE_FIXED: + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: block type fixed not supported"); + + case INFLATE_DYNAMIC: + grub_png_init_dynamic_block (data); + grub_png_read_dynamic_block (data); + break; + + default: + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: unknown block type"); + } + } + while ((!final) && (grub_errno == 0)); + + /* Skip adler checksum. */ + grub_png_get_dword (data); + + /* Skip crc checksum. */ + grub_png_get_dword (data); + + return grub_errno; +} + +static const grub_uint8_t png_magic[8] = + { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0x0a }; + +static grub_err_t +grub_png_decode_png (struct grub_png_data *data) +{ + grub_uint8_t magic[8]; + + if (grub_file_read (data->file, (char *) &magic[0], 8) != 8) + return grub_errno; + + if (grub_memcmp (magic, png_magic, sizeof (png_magic))) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: not a png file"); + + while (1) + { + grub_uint32_t len, type; + + len = grub_png_get_dword (data); + type = grub_png_get_dword (data); + data->next_offset = data->file->offset + len + 4; + + switch (type) + { + case PNG_CHUNK_IHDR: + grub_png_decode_image_header (data); + break; + + case PNG_CHUNK_IDAT: + data->inside_idat = 1; + data->idat_remain = len; + data->bit_count = 0; + + grub_png_decode_image_data (data); + + data->inside_idat = 0; + break; + + case PNG_CHUNK_IEND: + return grub_errno; + + default: + grub_file_seek (data->file, data->file->offset + len + 4); + } + + if (grub_errno) + break; + + if (data->file->offset != data->next_offset) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: chunk size error"); + } + + return grub_errno; +} + +static grub_err_t +grub_video_reader_png (struct grub_video_bitmap **bitmap, + const char *filename) +{ + grub_file_t file; + struct grub_png_data *data; + + file = grub_file_open (filename); + if (!file) + return grub_errno; + + data = grub_malloc (sizeof (*data)); + if (data != NULL) + { + grub_memset (data, 0, sizeof (*data)); + data->file = file; + data->bitmap = bitmap; + + grub_png_decode_png (data); + + grub_free (data); + } + + if (grub_errno != GRUB_ERR_NONE) + { + grub_video_bitmap_destroy (*bitmap); + *bitmap = 0; + } + + grub_file_close (file); + return grub_errno; +} + +#if defined(PNG_DEBUG) +static grub_err_t +grub_cmd_pngtest (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + struct grub_video_bitmap *bitmap = 0; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + grub_video_reader_png (&bitmap, args[0]); + if (grub_errno != GRUB_ERR_NONE) + return grub_errno; + + grub_video_bitmap_destroy (bitmap); + + return GRUB_ERR_NONE; +} +#endif + +static struct grub_video_bitmap_reader png_reader = { + .extension = ".png", + .reader = grub_video_reader_png, + .next = 0 +}; + +GRUB_MOD_INIT (video_reader_png) +{ + grub_video_bitmap_reader_register (&png_reader); +#if defined(PNG_DEBUG) + grub_register_command ("pngtest", grub_cmd_pngtest, + GRUB_COMMAND_FLAG_BOTH, "pngtest FILE", + "Tests loading of PNG bitmap.", 0); +#endif +} + +GRUB_MOD_FINI (video_reader_png) +{ +#if defined(PNG_DEBUG) + grub_unregister_command ("pngtest"); +#endif + grub_video_bitmap_reader_unregister (&png_reader); +} From 70bc2ef25ce55dbe80574d7918c7fcb0ca42b881 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 29 Jan 2008 10:59:56 +0000 Subject: [PATCH 0002/1707] 2008-01-29 Bean * boot/i386/pc/lnxboot.S (data_start): Code cleanup. (real_code_2): Code cleanup and change comment style. (move_memory): Avoid using 32-bit address mode. --- ChangeLog | 6 ++ boot/i386/pc/lnxboot.S | 145 +++++++++++++++++++++-------------------- 2 files changed, 79 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index ecc016a51..8cd297bc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-01-29 Bean + + * boot/i386/pc/lnxboot.S (data_start): Code cleanup. + (real_code_2): Code cleanup and change comment style. + (move_memory): Avoid using 32-bit address mode. + 2008-01-29 Bean * conf/i386-pc.rmk (pkglib_MODULES): Add `png.mod'. diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index f1a4ded43..6a4de8dd5 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -1,7 +1,7 @@ /* -*-Asm-*- */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,6 +20,7 @@ #include #include #include +#include .file "lnxboot.S" @@ -36,22 +37,7 @@ .globl start, _start data_start: - pushw %cs - popw %ds - xorl %eax, %eax - xorl %ebx, %ebx - call data_next - -data_next: - popw %bx - movw %cs, %ax - shll $4, %eax - leal 0x200 + data_start - data_next(%ebx,%eax), %eax - movzbl setup_sects - data_next(%bx), %ecx - shll $9, %ecx - addl %ecx, %eax - movl %eax, code32_start - data_next(%bx) - + xorl %ebp, %ebp jmp linux_next . = data_start + 0x1F1 @@ -76,29 +62,29 @@ boot_flag: start: _start: - jmp linux_code + jmp linux_init - .ascii "HdrS" // Header signature - .word 0x0203 // Header version number + .ascii "HdrS" /* Header signature. */ + .word 0x0203 /* Header version number. */ realmode_swtch: - .word 0, 0 // default_switch, SETUPSEG + .word 0, 0 /* default_switch, SETUPSEG. */ start_sys_seg: - .word 0x1000 // obsolete + .word 0x1000 /* Obsolete. */ version_ptr: - .word 0 // version string ptr + .word 0 /* Version string ptr. */ type_of_loader: - .byte 0 // Filled in by boot loader + .byte 0 /* Filled in by boot loader. */ loadflags: - .byte 1 // Please load high + .byte 1 /* Please load high. */ setup_move_size: - .word 0 // Unused + .word 0 /* Unused. */ code32_start: - .long 0x100000 // 32-bit start address + .long 0x100000 /* 32-bit start address. */ ramdisk_image: - .long 0 // Loaded ramdisk image address + .long 0 /* Loaded ramdisk image address. */ ramdisk_size: - .long 0 // Size of loaded ramdisk + .long 0 /* Size of loaded ramdisk. */ bootsect_kludge: .word 0, 0 heap_end_ptr: @@ -106,27 +92,27 @@ heap_end_ptr: pad1: .word 0 cmd_line_ptr: - .long 0 // Command line + .long 0 /* Command line. */ ramdisk_max: - .long 0xffffffff // Highest allowed ramdisk address + .long 0xffffffff /* Highest allowed ramdisk address. */ gdt: - .long 0, 0, 0, 0 // Must be zero - .word 0xffff // 64 K segment size + .long 0, 0, 0, 0 /* Must be zero. */ + .word 0xffff /* 64 K segment size. */ gdt_src1: - .byte 0, 0 ,0 // Low 24 bits of source addy - .byte 0x93 // Access rights - .byte 0 // Extended access rights + .byte 0, 0 ,0 /* Low 24 bits of source address. */ + .byte 0x93 /* Access rights. */ + .byte 0 /* Extended access rights. */ gdt_src2: - .byte 0 // High 8 bits of source addy - .word 0xffff // 64 K segment size + .byte 0 /* High 8 bits of source address. */ + .word 0xffff /* 64 K segment size. */ gdt_dst1: - .byte 0, 0, 0 // Low 24 bits of target addy - .byte 0x93 // Access rights - .byte 0 // Extended access rights + .byte 0, 0, 0 /* Low 24 bits of target address. */ + .byte 0x93 /* Access rights. */ + .byte 0 /* Extended access rights. */ gdt_dst2: - .byte 0 // High 8 bits of source addy - .long 0, 0, 0, 0 // More space for the BIOS + .byte 0 /* High 8 bits of source address. */ + .long 0, 0, 0, 0 /* More space for the BIOS. */ reg_edx: .byte 0x80,0,0xFF,0xFF @@ -134,9 +120,10 @@ reg_edx: data_leng: .long 0 -linux_code: +linux_init: movw %cs:(reg_edx - start), %dx + movl %cs:(code32_start - start), %ebp linux_next: @@ -150,7 +137,7 @@ normalize: addw %bx, %ax pushw %ax pushw $(real_code - start) - lret // jump to real_code + lret /* Jump to real_code. */ real_code: subw $0x20, %ax @@ -158,16 +145,13 @@ real_code: movw (setup_sects - data_start), %cx shlw $7, %cx - // Setup stack + /* Setup stack. */ xorw %si, %si movw %si, %ss movw $(CODE_ADDR), %sp - pushl %esi - pushl %edi - - // Move itself to 0:CODE_ADDR + /* Move itself to 0:CODE_ADDR. */ cld movw %cs, %ax @@ -183,41 +167,55 @@ real_code: real_code_2: + xchgl %ebp, %esi + orl %esi, %esi + jnz 1f + movw %ds, %si + shll $4, %esi + addl %ebp, %esi +1: + pushw %es popw %ds - movl (ramdisk_image - start), %esi - or %esi, %esi - jnz 1f - movl (code32_start - start), %esi -1: - movl $0x200, %ecx addl %ecx, %esi movl $DATA_ADDR, %edi call move_memory + /* Check for multiboot signature. */ + cmpl $MULTIBOOT_MAGIC, %ss:(DATA_ADDR + 0x50) + jz 1f + + movl (ramdisk_image - start), %esi + movl (ramdisk_size - start), %ecx + movl $(DATA_ADDR - 0x200), %edi + jmp 2f + +1: + + movl %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE), %ecx + addl $(GRUB_KERNEL_MACHINE_RAW_SIZE - 0x200), %ecx + +2: + call move_memory + movsbl %dh, %eax movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART) movsbl (reg_edx + 2 - start), %eax movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART) - movl %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE), %ecx - addl $(GRUB_KERNEL_MACHINE_RAW_SIZE - 0x200), %ecx - - call move_memory - - popl %edi - popl %esi - ljmp $(DATA_ADDR >> 4), $0 -// Parameters: -// esi: source address -// edi: target address -// ecx: number of bytes +/* + * Parameters: + * esi: source address + * edi: target address + * ecx: number of bytes + */ + move_memory: incl %ecx andb $0xFE, %cl @@ -261,8 +259,8 @@ move_memory: 2: - leal (%esi, %eax), %esi - leal (%edi, %eax), %edi + addl %eax, %esi + addl %eax, %edi subl %eax, %ecx jnz 1b @@ -270,8 +268,11 @@ move_memory: popw %dx ret -// Parameters: -// si: message +/* + * Parameters: + * si: message + */ + fail: movb $0x0e, %ah xorw %bx, %bx From ae5a9cd7b2d70fc2ea50961d1484e9f87a327d6f Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 30 Jan 2008 14:42:09 +0000 Subject: [PATCH 0003/1707] 2008-01-30 Tristan Gingold * kern/rescue.c: Silently accept empty lines. --- ChangeLog | 4 ++++ kern/rescue.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8cd297bc6..455abb46f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-01-30 Tristan Gingold + + * kern/rescue.c: Silently accept empty lines. + 2008-01-29 Bean * boot/i386/pc/lnxboot.S (data_start): Code cleanup. diff --git a/kern/rescue.c b/kern/rescue.c index 9d7da10e7..bd5d579f9 100644 --- a/kern/rescue.c +++ b/kern/rescue.c @@ -659,6 +659,8 @@ grub_enter_rescue_mode (void) /* Get a command line. */ grub_rescue_get_command_line ("grub rescue> "); + if (line[0] == 0) + continue; if (grub_parser_split_cmdline (line, getline, &n, &args) || n < 0) continue; From ccaa8a5f5040dca15c92d8009e58c88e2051d17b Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 30 Jan 2008 15:32:56 +0000 Subject: [PATCH 0004/1707] 2008-01-30 Robert Millan * conf/i386-pc.rmk (sbin_UTILITIES): Remove `grub-probe'. (util/grub-probe.c_DEPENDENCIES, grub_probe_SOURCES): Moved from here ... * conf/common.rmk (util/grub-probe.c_DEPENDENCIES) (grub_probe_SOURCES): ... to here. * conf/i386-efi.rmk (sbin_UTILITIES): Remove `grub-probe'. (util/grub-probe.c_DEPENDENCIES, grub_probe_SOURCES): Remove. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. --- ChangeLog | 13 +++ conf/common.mk | 163 +++++++++++++++++++++++++++++++++++++ conf/common.rmk | 17 ++++ conf/i386-efi.mk | 164 +------------------------------------ conf/i386-efi.rmk | 18 +---- conf/i386-ieee1275.mk | 165 +------------------------------------- conf/i386-ieee1275.rmk | 19 +---- conf/i386-linuxbios.mk | 164 +------------------------------------ conf/i386-linuxbios.rmk | 18 +---- conf/i386-pc.mk | 164 +------------------------------------ conf/i386-pc.rmk | 18 +---- conf/powerpc-ieee1275.mk | 164 +------------------------------------ conf/powerpc-ieee1275.rmk | 18 +---- 13 files changed, 203 insertions(+), 902 deletions(-) diff --git a/ChangeLog b/ChangeLog index 455abb46f..fb75bccdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-01-30 Robert Millan + + * conf/i386-pc.rmk (sbin_UTILITIES): Remove `grub-probe'. + (util/grub-probe.c_DEPENDENCIES, grub_probe_SOURCES): Moved from here ... + * conf/common.rmk (util/grub-probe.c_DEPENDENCIES) + (grub_probe_SOURCES): ... to here. + + * conf/i386-efi.rmk (sbin_UTILITIES): Remove `grub-probe'. + (util/grub-probe.c_DEPENDENCIES, grub_probe_SOURCES): Remove. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-linuxbios.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + 2008-01-30 Tristan Gingold * kern/rescue.c: Silently accept empty lines. diff --git a/conf/common.mk b/conf/common.mk index c9701a62a..d2845a950 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1,5 +1,168 @@ # -*- makefile -*- +# For grub-probe. +sbin_UTILITIES += grub-probe +util/grub-probe.c_DEPENDENCIES = grub_probe_init.h +grub_probe_SOURCES = util/grub-probe.c \ + util/biosdisk.c util/misc.c util/getroot.c \ + kern/device.c kern/disk.c kern/err.c kern/misc.c \ + kern/parser.c kern/partition.c kern/file.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c \ + \ + partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/fs.c kern/env.c fs/fshelp.c \ + disk/lvm.c disk/raid.c grub_probe_init.c +CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d + +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) + +grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-util_grub_probe.d + +grub_probe-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-util_biosdisk.d + +grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-util_misc.d + +grub_probe-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-util_getroot.d + +grub_probe-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_device.d + +grub_probe-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_disk.d + +grub_probe-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_err.d + +grub_probe-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_misc.d + +grub_probe-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_parser.d + +grub_probe-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_partition.d + +grub_probe-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_file.d + +grub_probe-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_affs.d + +grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_cpio.d + +grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_ext2.d + +grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_fat.d + +grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_hfs.d + +grub_probe-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_hfsplus.d + +grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_iso9660.d + +grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_jfs.d + +grub_probe-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_minix.d + +grub_probe-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_ntfs.d + +grub_probe-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_ntfscomp.d + +grub_probe-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_reiserfs.d + +grub_probe-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_sfs.d + +grub_probe-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_ufs.d + +grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_xfs.d + +grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-partmap_pc.d + +grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-partmap_apple.d + +grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-partmap_gpt.d + +grub_probe-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_fs.d + +grub_probe-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-kern_env.d + +grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_fshelp.d + +grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-disk_lvm.d + +grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-disk_raid.d + +grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-grub_probe_init.d + + # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y diff --git a/conf/common.rmk b/conf/common.rmk index c1f367b76..39c9ec8e8 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -1,5 +1,22 @@ # -*- makefile -*- +# For grub-probe. +sbin_UTILITIES += grub-probe +util/grub-probe.c_DEPENDENCIES = grub_probe_init.h +grub_probe_SOURCES = util/grub-probe.c \ + util/biosdisk.c util/misc.c util/getroot.c \ + kern/device.c kern/disk.c kern/err.c kern/misc.c \ + kern/parser.c kern/partition.c kern/file.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c \ + \ + partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/fs.c kern/env.c fs/fshelp.c \ + disk/lvm.c disk/raid.c grub_probe_init.c + # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 0798e0c40..b6e82e822 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -6,7 +6,7 @@ COMMON_LDFLAGS = -melf_i386 -nostdlib # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap #ifeq ($(enable_grub_emu), yes) #sbin_UTILITIES += grub-emu #endif @@ -63,168 +63,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 -include grub_mkdevicemap-util_i386_get_disk_name.d -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - kern/fs.c kern/env.c fs/fshelp.c \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d - -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) - -grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_grub_probe.d - -grub_probe-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_biosdisk.d - -grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_misc.d - -grub_probe-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_getroot.d - -grub_probe-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_device.d - -grub_probe-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_disk.d - -grub_probe-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_err.d - -grub_probe-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_misc.d - -grub_probe-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_parser.d - -grub_probe-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_partition.d - -grub_probe-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_file.d - -grub_probe-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_fs.d - -grub_probe-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_env.d - -grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fshelp.d - -grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_pc.d - -grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_apple.d - -grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_gpt.d - -grub_probe-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_affs.d - -grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_cpio.d - -grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ext2.d - -grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fat.d - -grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfs.d - -grub_probe-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfsplus.d - -grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_iso9660.d - -grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_jfs.d - -grub_probe-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_minix.d - -grub_probe-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfs.d - -grub_probe-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfscomp.d - -grub_probe-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_reiserfs.d - -grub_probe-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_sfs.d - -grub_probe-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ufs.d - -grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_xfs.d - -grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_lvm.d - -grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_raid.d - -grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-grub_probe_init.d - - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 71a5883bd..2b340b4e7 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -6,7 +6,7 @@ COMMON_LDFLAGS = -melf_i386 -nostdlib # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap #ifeq ($(enable_grub_emu), yes) #sbin_UTILITIES += grub-emu #endif @@ -27,22 +27,6 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - kern/fs.c kern/env.c fs/fshelp.c \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - disk/lvm.c disk/raid.c grub_probe_init.c - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 5f77abcde..422665bd5 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -148,7 +148,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -198,169 +198,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 -include grub_mkdevicemap-util_i386_get_disk_name.d -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/file.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d - -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) - -grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_grub_probe.d - -grub_probe-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_biosdisk.d - -grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_misc.d - -grub_probe-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_getroot.d - -grub_probe-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_device.d - -grub_probe-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_disk.d - -grub_probe-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_err.d - -grub_probe-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_misc.d - -grub_probe-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_parser.d - -grub_probe-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_partition.d - -grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_pc.d - -grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_apple.d - -grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_gpt.d - -grub_probe-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_fs.d - -grub_probe-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_file.d - -grub_probe-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_affs.d - -grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_cpio.d - -grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ext2.d - -grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fat.d - -grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfs.d - -grub_probe-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfsplus.d - -grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_iso9660.d - -grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_jfs.d - -grub_probe-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_minix.d - -grub_probe-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfs.d - -grub_probe-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfscomp.d - -grub_probe-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_reiserfs.d - -grub_probe-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_sfs.d - -grub_probe-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ufs.d - -grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_xfs.d - -grub_probe-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_env.d - -grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fshelp.d - -grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_lvm.d - -grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_raid.d - -grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-grub_probe_init.d - - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index a5146abf0..ce8e0986b 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -38,7 +38,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -52,23 +52,6 @@ grub_mkimage_LDFLAGS = $(LIBLZO) grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/file.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 81f45370e..eccd4b097 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -135,7 +135,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -185,168 +185,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 -include grub_mkdevicemap-util_i386_get_disk_name.d -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d - -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) - -grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_grub_probe.d - -grub_probe-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_biosdisk.d - -grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_misc.d - -grub_probe-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_getroot.d - -grub_probe-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_device.d - -grub_probe-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_disk.d - -grub_probe-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_err.d - -grub_probe-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_misc.d - -grub_probe-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_parser.d - -grub_probe-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_partition.d - -grub_probe-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_file.d - -grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_pc.d - -grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_apple.d - -grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_gpt.d - -grub_probe-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_affs.d - -grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_cpio.d - -grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ext2.d - -grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fat.d - -grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfs.d - -grub_probe-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfsplus.d - -grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_iso9660.d - -grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_jfs.d - -grub_probe-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_minix.d - -grub_probe-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfs.d - -grub_probe-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfscomp.d - -grub_probe-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_reiserfs.d - -grub_probe-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_sfs.d - -grub_probe-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ufs.d - -grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_xfs.d - -grub_probe-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_fs.d - -grub_probe-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_env.d - -grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fshelp.d - -grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_lvm.d - -grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_raid.d - -grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-grub_probe_init.d - - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 66b1b8189..a551d44d8 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -37,7 +37,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -51,22 +51,6 @@ grub_mkimage_LDFLAGS = $(LIBLZO) grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 5b7ef8f21..729d48b10 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -198,7 +198,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-setup grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -406,168 +406,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 -include grub_mkdevicemap-util_i386_get_disk_name.d -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d - -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) - -grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_grub_probe.d - -grub_probe-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_biosdisk.d - -grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_misc.d - -grub_probe-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_getroot.d - -grub_probe-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_device.d - -grub_probe-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_disk.d - -grub_probe-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_err.d - -grub_probe-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_misc.d - -grub_probe-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_parser.d - -grub_probe-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_partition.d - -grub_probe-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_file.d - -grub_probe-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_affs.d - -grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_cpio.d - -grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ext2.d - -grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fat.d - -grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfs.d - -grub_probe-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfsplus.d - -grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_iso9660.d - -grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_jfs.d - -grub_probe-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_minix.d - -grub_probe-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfs.d - -grub_probe-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfscomp.d - -grub_probe-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_reiserfs.d - -grub_probe-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_sfs.d - -grub_probe-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ufs.d - -grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_xfs.d - -grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_pc.d - -grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_apple.d - -grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_gpt.d - -grub_probe-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_fs.d - -grub_probe-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_env.d - -grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fshelp.d - -grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_lvm.d - -grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_raid.d - -grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-grub_probe_init.d - - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index c0a6e4372..fb435bc79 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -57,7 +57,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genke # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-setup grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-setup grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -87,22 +87,6 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index ee8d11c12..4dd58e98b 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -26,7 +26,7 @@ pkglib_PROGRAMS = kernel.elf # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -75,168 +75,6 @@ grub_mkdevicemap-util_ieee1275_get_disk_name.o: util/ieee1275/get_disk_name.c $( -include grub_mkdevicemap-util_ieee1275_get_disk_name.d -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d - -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) - -grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_grub_probe.d - -grub_probe-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_biosdisk.d - -grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_misc.d - -grub_probe-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_getroot.d - -grub_probe-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_device.d - -grub_probe-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_disk.d - -grub_probe-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_err.d - -grub_probe-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_misc.d - -grub_probe-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_parser.d - -grub_probe-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_partition.d - -grub_probe-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_file.d - -grub_probe-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_affs.d - -grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_cpio.d - -grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ext2.d - -grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fat.d - -grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfs.d - -grub_probe-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfsplus.d - -grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_iso9660.d - -grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_jfs.d - -grub_probe-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_minix.d - -grub_probe-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfs.d - -grub_probe-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfscomp.d - -grub_probe-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_reiserfs.d - -grub_probe-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_sfs.d - -grub_probe-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ufs.d - -grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_xfs.d - -grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_pc.d - -grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_apple.d - -grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_gpt.d - -grub_probe-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_fs.d - -grub_probe-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_env.d - -grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fshelp.d - -grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_lvm.d - -grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_raid.d - -grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-grub_probe_init.d - - # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 4e875c80f..68da4228d 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -26,7 +26,7 @@ pkglib_PROGRAMS = kernel.elf # Utilities. bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap grub-probe +sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif @@ -39,22 +39,6 @@ grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/ieee1275/get_disk_name.c -# For grub-probe. -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c - # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h normal/execute.c_DEPENDENCIES = grub_script.tab.h From 078522ab28eca95249520427ef41bf5e16841542 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 31 Jan 2008 17:09:39 +0000 Subject: [PATCH 0005/1707] 2008-01-31 Pavel Roskin * util/powerpc/ieee1275/grub-mkrescue.in: New file. * conf/powerpc-ieee1275.rmk: Add grub-mkrescue support for PowerPC. * DISTLIST: Add util/powerpc/ieee1275/grub-mkrescue.in. --- ChangeLog | 7 ++ DISTLIST | 1 + conf/powerpc-ieee1275.mk | 10 +++ conf/powerpc-ieee1275.rmk | 4 + util/powerpc/ieee1275/grub-mkrescue.in | 116 +++++++++++++++++++++++++ 5 files changed, 138 insertions(+) create mode 100644 util/powerpc/ieee1275/grub-mkrescue.in diff --git a/ChangeLog b/ChangeLog index fb75bccdd..56fad7638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-01-31 Pavel Roskin + + * util/powerpc/ieee1275/grub-mkrescue.in: New file. + * conf/powerpc-ieee1275.rmk: Add grub-mkrescue support for + PowerPC. + * DISTLIST: Add util/powerpc/ieee1275/grub-mkrescue.in. + 2008-01-30 Robert Millan * conf/i386-pc.rmk (sbin_UTILITIES): Remove `grub-probe'. diff --git a/DISTLIST b/DISTLIST index 63882578f..6b527c73c 100644 --- a/DISTLIST +++ b/DISTLIST @@ -330,6 +330,7 @@ util/i386/pc/misc.c util/i386/pc/grub-mkrescue.in util/ieee1275/get_disk_name.c util/powerpc/ieee1275/grub-install.in +util/powerpc/ieee1275/grub-mkrescue.in util/powerpc/ieee1275/misc.c video/bitmap.c video/video.c diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 4dd58e98b..a37c53574 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -525,6 +525,7 @@ kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ # Scripts. sbin_SCRIPTS = grub-install +bin_SCRIPTS = grub-mkrescue # For grub-install. grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in @@ -535,6 +536,15 @@ grub-install: util/powerpc/ieee1275/grub-install.in config.status chmod +x $@ +# For grub-mkrescue. +grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in +CLEANFILES += grub-mkrescue + +grub-mkrescue: util/powerpc/ieee1275/grub-mkrescue.in config.status + ./config.status --file=grub-mkrescue:util/powerpc/ieee1275/grub-mkrescue.in + chmod +x $@ + + # Modules. pkglib_MODULES = halt.mod \ _linux.mod \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 68da4228d..4e4f31765 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -89,10 +89,14 @@ kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ # Scripts. sbin_SCRIPTS = grub-install +bin_SCRIPTS = grub-mkrescue # For grub-install. grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in +# For grub-mkrescue. +grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in + # Modules. pkglib_MODULES = halt.mod \ _linux.mod \ diff --git a/util/powerpc/ieee1275/grub-mkrescue.in b/util/powerpc/ieee1275/grub-mkrescue.in new file mode 100644 index 000000000..61495abcd --- /dev/null +++ b/util/powerpc/ieee1275/grub-mkrescue.in @@ -0,0 +1,116 @@ +#! /bin/sh -e + +# Make GRUB rescue image +# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +# Initialize some variables. +transform="@program_transform_name@" + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ +PACKAGE_NAME=@PACKAGE_NAME@ +PACKAGE_TARNAME=@PACKAGE_TARNAME@ +PACKAGE_VERSION=@PACKAGE_VERSION@ +target_cpu=@target_cpu@ +platform=@platform@ +pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` + +grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` + +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +input_dir=${pkglibdir} +grub_mkimage=grub-mkimage + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "grub-install (GNU GRUB ${PACKAGE_VERSION})" + exit 0 ;; + --modules=*) + modules=`echo "$option" | sed 's/--modules=//'` ;; + --pkglibdir=*) + input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;; + --grub-mkimage=*) + grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + *) + if test "x$output_image" != x; then + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + fi + output_image="${option}" ;; + esac +done + +if test "x$output_image" = x; then + usage + exit 1 +fi + +if [ "x${modules}" = "x" ] ; then + modules=`cd ${input_dir}/ && ls *.mod` +fi + +map_file=`mktemp` +cat >${map_file} < Date: Thu, 31 Jan 2008 20:12:16 +0000 Subject: [PATCH 0006/1707] Better describe the last change made to conf/powerpc-ieee1275.rmk --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56fad7638..2ab4f285e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,8 @@ 2008-01-31 Pavel Roskin * util/powerpc/ieee1275/grub-mkrescue.in: New file. - * conf/powerpc-ieee1275.rmk: Add grub-mkrescue support for - PowerPC. + * conf/powerpc-ieee1275.rmk (bin_SCRIPTS): New variable. + (grub_mkrescue_SOURCES): Likewise. * DISTLIST: Add util/powerpc/ieee1275/grub-mkrescue.in. 2008-01-30 Robert Millan From 60b6be74b99706f8a8ab817e38ed978a0f415df8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 1 Feb 2008 00:50:19 +0000 Subject: [PATCH 0007/1707] 2008-02-01 Robert Millan * kern/disk.c (grub_disk_read, grub_disk_write): Add grub_dprintf() call at beginning of function. --- ChangeLog | 5 +++++ kern/disk.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2ab4f285e..96122216f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-01 Robert Millan + + * kern/disk.c (grub_disk_read, grub_disk_write): Add grub_dprintf() + call at beginning of function. + 2008-01-31 Pavel Roskin * util/powerpc/ieee1275/grub-mkrescue.in: New file. diff --git a/kern/disk.c b/kern/disk.c index 08389b9d2..afbdbb05d 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -360,6 +360,8 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, { char *tmp_buf; unsigned real_offset; + + grub_dprintf ("disk", "Reading `%s'...\n", disk->name); /* First of all, check if the region is within the disk. */ if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE) @@ -498,6 +500,8 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, { unsigned real_offset; + grub_dprintf ("disk", "Writing `%s'...\n", disk->name); + if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE) return -1; From 7d31f41fc6c8db25216e600d93cfccb0411abcaf Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 1 Feb 2008 15:45:17 +0000 Subject: [PATCH 0008/1707] 2008-02-01 Robert Millan * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Move to the top. (normal/command.c_DEPENDENCIES): New variable. (grub-emu_DEPENDENCIES, normal_mod_DEPENDENCIES): Remove variables. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. (grub_emu_SOURCES): Add `fs/fshelp.c'. * genmk.rb: Add `$(#{src}_DEPENDENCIES)' in targets that require it. --- ChangeLog | 15 ++ conf/common.mk | 258 ++++++++++++++--------------- conf/i386-efi.mk | 273 +++++++++++++++---------------- conf/i386-efi.rmk | 7 +- conf/i386-ieee1275.mk | 203 +++++++++++------------ conf/i386-ieee1275.rmk | 7 +- conf/i386-linuxbios.mk | 209 ++++++++++++------------ conf/i386-linuxbios.rmk | 7 +- conf/i386-pc.mk | 331 +++++++++++++++++++------------------- conf/i386-pc.rmk | 3 - conf/powerpc-ieee1275.mk | 219 +++++++++++++------------ conf/powerpc-ieee1275.rmk | 9 +- conf/sparc64-ieee1275.mk | 315 ++++++++++++++++++------------------ conf/sparc64-ieee1275.rmk | 5 +- genmk.rb | 12 +- 15 files changed, 950 insertions(+), 923 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96122216f..09fb2a0bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-02-01 Robert Millan + + * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Move to the + top. + (normal/command.c_DEPENDENCIES): New variable. + (grub-emu_DEPENDENCIES, normal_mod_DEPENDENCIES): Remove variables. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-linuxbios.rmk: Likewise. + * conf/i386-pc.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + (grub_emu_SOURCES): Add `fs/fshelp.c'. + + * genmk.rb: Add `$(#{src}_DEPENDENCIES)' in targets that require it. + 2008-02-01 Robert Millan * kern/disk.c (grub_disk_read, grub_disk_write): Add grub_dprintf() diff --git a/conf/common.mk b/conf/common.mk index d2845a950..3e710d2d7 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -280,7 +280,7 @@ und-fshelp.lst: pre-fshelp.o echo 'fshelp' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -fshelp_mod-fs_fshelp.o: fs/fshelp.c +fshelp_mod-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -MD -c -o $@ $< -include fshelp_mod-fs_fshelp.d @@ -288,10 +288,10 @@ CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst FSFILES += fs-fshelp_mod-fs_fshelp.lst -cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c gencmdlist.sh +cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) -fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c genfslist.sh +fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) @@ -332,7 +332,7 @@ und-fat.lst: pre-fat.o echo 'fat' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -fat_mod-fs_fat.o: fs/fat.c +fat_mod-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -MD -c -o $@ $< -include fat_mod-fs_fat.d @@ -340,10 +340,10 @@ CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst COMMANDFILES += cmd-fat_mod-fs_fat.lst FSFILES += fs-fat_mod-fs_fat.lst -cmd-fat_mod-fs_fat.lst: fs/fat.c gencmdlist.sh +cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) -fs-fat_mod-fs_fat.lst: fs/fat.c genfslist.sh +fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) @@ -384,7 +384,7 @@ und-ufs.lst: pre-ufs.o echo 'ufs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ufs_mod-fs_ufs.o: fs/ufs.c +ufs_mod-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -MD -c -o $@ $< -include ufs_mod-fs_ufs.d @@ -392,10 +392,10 @@ CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst COMMANDFILES += cmd-ufs_mod-fs_ufs.lst FSFILES += fs-ufs_mod-fs_ufs.lst -cmd-ufs_mod-fs_ufs.lst: fs/ufs.c gencmdlist.sh +cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) -fs-ufs_mod-fs_ufs.lst: fs/ufs.c genfslist.sh +fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) @@ -436,7 +436,7 @@ und-ext2.lst: pre-ext2.o echo 'ext2' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ext2_mod-fs_ext2.o: fs/ext2.c +ext2_mod-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -MD -c -o $@ $< -include ext2_mod-fs_ext2.d @@ -444,10 +444,10 @@ CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst COMMANDFILES += cmd-ext2_mod-fs_ext2.lst FSFILES += fs-ext2_mod-fs_ext2.lst -cmd-ext2_mod-fs_ext2.lst: fs/ext2.c gencmdlist.sh +cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) -fs-ext2_mod-fs_ext2.lst: fs/ext2.c genfslist.sh +fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) @@ -488,7 +488,7 @@ und-ntfs.lst: pre-ntfs.o echo 'ntfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ntfs_mod-fs_ntfs.o: fs/ntfs.c +ntfs_mod-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -MD -c -o $@ $< -include ntfs_mod-fs_ntfs.d @@ -496,10 +496,10 @@ CLEANFILES += cmd-ntfs_mod-fs_ntfs.lst fs-ntfs_mod-fs_ntfs.lst COMMANDFILES += cmd-ntfs_mod-fs_ntfs.lst FSFILES += fs-ntfs_mod-fs_ntfs.lst -cmd-ntfs_mod-fs_ntfs.lst: fs/ntfs.c gencmdlist.sh +cmd-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfs > $@ || (rm -f $@; exit 1) -fs-ntfs_mod-fs_ntfs.lst: fs/ntfs.c genfslist.sh +fs-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfs > $@ || (rm -f $@; exit 1) @@ -540,7 +540,7 @@ und-ntfscomp.lst: pre-ntfscomp.o echo 'ntfscomp' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ntfscomp_mod-fs_ntfscomp.o: fs/ntfscomp.c +ntfscomp_mod-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -MD -c -o $@ $< -include ntfscomp_mod-fs_ntfscomp.d @@ -548,10 +548,10 @@ CLEANFILES += cmd-ntfscomp_mod-fs_ntfscomp.lst fs-ntfscomp_mod-fs_ntfscomp.lst COMMANDFILES += cmd-ntfscomp_mod-fs_ntfscomp.lst FSFILES += fs-ntfscomp_mod-fs_ntfscomp.lst -cmd-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c gencmdlist.sh +cmd-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfscomp > $@ || (rm -f $@; exit 1) -fs-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c genfslist.sh +fs-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfscomp > $@ || (rm -f $@; exit 1) @@ -592,7 +592,7 @@ und-minix.lst: pre-minix.o echo 'minix' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -minix_mod-fs_minix.o: fs/minix.c +minix_mod-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -MD -c -o $@ $< -include minix_mod-fs_minix.d @@ -600,10 +600,10 @@ CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst COMMANDFILES += cmd-minix_mod-fs_minix.lst FSFILES += fs-minix_mod-fs_minix.lst -cmd-minix_mod-fs_minix.lst: fs/minix.c gencmdlist.sh +cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) -fs-minix_mod-fs_minix.lst: fs/minix.c genfslist.sh +fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) @@ -644,7 +644,7 @@ und-hfs.lst: pre-hfs.o echo 'hfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -hfs_mod-fs_hfs.o: fs/hfs.c +hfs_mod-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -MD -c -o $@ $< -include hfs_mod-fs_hfs.d @@ -652,10 +652,10 @@ CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst COMMANDFILES += cmd-hfs_mod-fs_hfs.lst FSFILES += fs-hfs_mod-fs_hfs.lst -cmd-hfs_mod-fs_hfs.lst: fs/hfs.c gencmdlist.sh +cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) -fs-hfs_mod-fs_hfs.lst: fs/hfs.c genfslist.sh +fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) @@ -696,7 +696,7 @@ und-jfs.lst: pre-jfs.o echo 'jfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -jfs_mod-fs_jfs.o: fs/jfs.c +jfs_mod-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -MD -c -o $@ $< -include jfs_mod-fs_jfs.d @@ -704,10 +704,10 @@ CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst COMMANDFILES += cmd-jfs_mod-fs_jfs.lst FSFILES += fs-jfs_mod-fs_jfs.lst -cmd-jfs_mod-fs_jfs.lst: fs/jfs.c gencmdlist.sh +cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) -fs-jfs_mod-fs_jfs.lst: fs/jfs.c genfslist.sh +fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) @@ -748,7 +748,7 @@ und-iso9660.lst: pre-iso9660.o echo 'iso9660' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -iso9660_mod-fs_iso9660.o: fs/iso9660.c +iso9660_mod-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -MD -c -o $@ $< -include iso9660_mod-fs_iso9660.d @@ -756,10 +756,10 @@ CLEANFILES += cmd-iso9660_mod-fs_iso9660.lst fs-iso9660_mod-fs_iso9660.lst COMMANDFILES += cmd-iso9660_mod-fs_iso9660.lst FSFILES += fs-iso9660_mod-fs_iso9660.lst -cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c gencmdlist.sh +cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1) -fs-iso9660_mod-fs_iso9660.lst: fs/iso9660.c genfslist.sh +fs-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1) @@ -800,7 +800,7 @@ und-xfs.lst: pre-xfs.o echo 'xfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -xfs_mod-fs_xfs.o: fs/xfs.c +xfs_mod-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -MD -c -o $@ $< -include xfs_mod-fs_xfs.d @@ -808,10 +808,10 @@ CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst COMMANDFILES += cmd-xfs_mod-fs_xfs.lst FSFILES += fs-xfs_mod-fs_xfs.lst -cmd-xfs_mod-fs_xfs.lst: fs/xfs.c gencmdlist.sh +cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) -fs-xfs_mod-fs_xfs.lst: fs/xfs.c genfslist.sh +fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) @@ -852,7 +852,7 @@ und-affs.lst: pre-affs.o echo 'affs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -affs_mod-fs_affs.o: fs/affs.c +affs_mod-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -MD -c -o $@ $< -include affs_mod-fs_affs.d @@ -860,10 +860,10 @@ CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst COMMANDFILES += cmd-affs_mod-fs_affs.lst FSFILES += fs-affs_mod-fs_affs.lst -cmd-affs_mod-fs_affs.lst: fs/affs.c gencmdlist.sh +cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) -fs-affs_mod-fs_affs.lst: fs/affs.c genfslist.sh +fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) @@ -904,7 +904,7 @@ und-sfs.lst: pre-sfs.o echo 'sfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -sfs_mod-fs_sfs.o: fs/sfs.c +sfs_mod-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -MD -c -o $@ $< -include sfs_mod-fs_sfs.d @@ -912,10 +912,10 @@ CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst COMMANDFILES += cmd-sfs_mod-fs_sfs.lst FSFILES += fs-sfs_mod-fs_sfs.lst -cmd-sfs_mod-fs_sfs.lst: fs/sfs.c gencmdlist.sh +cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) -fs-sfs_mod-fs_sfs.lst: fs/sfs.c genfslist.sh +fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) @@ -956,7 +956,7 @@ und-hfsplus.lst: pre-hfsplus.o echo 'hfsplus' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -hfsplus_mod-fs_hfsplus.o: fs/hfsplus.c +hfsplus_mod-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -MD -c -o $@ $< -include hfsplus_mod-fs_hfsplus.d @@ -964,10 +964,10 @@ CLEANFILES += cmd-hfsplus_mod-fs_hfsplus.lst fs-hfsplus_mod-fs_hfsplus.lst COMMANDFILES += cmd-hfsplus_mod-fs_hfsplus.lst FSFILES += fs-hfsplus_mod-fs_hfsplus.lst -cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c gencmdlist.sh +cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1) -fs-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c genfslist.sh +fs-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1) @@ -1008,7 +1008,7 @@ und-reiserfs.lst: pre-reiserfs.o echo 'reiserfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reiserfs_mod-fs_reiserfs.o: fs/reiserfs.c +reiserfs_mod-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -MD -c -o $@ $< -include reiserfs_mod-fs_reiserfs.d @@ -1016,10 +1016,10 @@ CLEANFILES += cmd-reiserfs_mod-fs_reiserfs.lst fs-reiserfs_mod-fs_reiserfs.lst COMMANDFILES += cmd-reiserfs_mod-fs_reiserfs.lst FSFILES += fs-reiserfs_mod-fs_reiserfs.lst -cmd-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c gencmdlist.sh +cmd-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reiserfs > $@ || (rm -f $@; exit 1) -fs-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c genfslist.sh +fs-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reiserfs > $@ || (rm -f $@; exit 1) @@ -1060,7 +1060,7 @@ und-cpio.lst: pre-cpio.o echo 'cpio' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cpio_mod-fs_cpio.o: fs/cpio.c +cpio_mod-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -MD -c -o $@ $< -include cpio_mod-fs_cpio.d @@ -1068,10 +1068,10 @@ CLEANFILES += cmd-cpio_mod-fs_cpio.lst fs-cpio_mod-fs_cpio.lst COMMANDFILES += cmd-cpio_mod-fs_cpio.lst FSFILES += fs-cpio_mod-fs_cpio.lst -cmd-cpio_mod-fs_cpio.lst: fs/cpio.c gencmdlist.sh +cmd-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpio > $@ || (rm -f $@; exit 1) -fs-cpio_mod-fs_cpio.lst: fs/cpio.c genfslist.sh +fs-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpio > $@ || (rm -f $@; exit 1) @@ -1115,7 +1115,7 @@ und-amiga.lst: pre-amiga.o echo 'amiga' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -amiga_mod-partmap_amiga.o: partmap/amiga.c +amiga_mod-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -MD -c -o $@ $< -include amiga_mod-partmap_amiga.d @@ -1123,10 +1123,10 @@ CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst FSFILES += fs-amiga_mod-partmap_amiga.lst -cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c gencmdlist.sh +cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) -fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c genfslist.sh +fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) @@ -1167,7 +1167,7 @@ und-apple.lst: pre-apple.o echo 'apple' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -apple_mod-partmap_apple.o: partmap/apple.c +apple_mod-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -MD -c -o $@ $< -include apple_mod-partmap_apple.d @@ -1175,10 +1175,10 @@ CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst COMMANDFILES += cmd-apple_mod-partmap_apple.lst FSFILES += fs-apple_mod-partmap_apple.lst -cmd-apple_mod-partmap_apple.lst: partmap/apple.c gencmdlist.sh +cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) -fs-apple_mod-partmap_apple.lst: partmap/apple.c genfslist.sh +fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) @@ -1219,7 +1219,7 @@ und-pc.lst: pre-pc.o echo 'pc' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -pc_mod-partmap_pc.o: partmap/pc.c +pc_mod-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -MD -c -o $@ $< -include pc_mod-partmap_pc.d @@ -1227,10 +1227,10 @@ CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst COMMANDFILES += cmd-pc_mod-partmap_pc.lst FSFILES += fs-pc_mod-partmap_pc.lst -cmd-pc_mod-partmap_pc.lst: partmap/pc.c gencmdlist.sh +cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) -fs-pc_mod-partmap_pc.lst: partmap/pc.c genfslist.sh +fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) @@ -1271,7 +1271,7 @@ und-sun.lst: pre-sun.o echo 'sun' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -sun_mod-partmap_sun.o: partmap/sun.c +sun_mod-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -MD -c -o $@ $< -include sun_mod-partmap_sun.d @@ -1279,10 +1279,10 @@ CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst COMMANDFILES += cmd-sun_mod-partmap_sun.lst FSFILES += fs-sun_mod-partmap_sun.lst -cmd-sun_mod-partmap_sun.lst: partmap/sun.c gencmdlist.sh +cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) -fs-sun_mod-partmap_sun.lst: partmap/sun.c genfslist.sh +fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) @@ -1323,7 +1323,7 @@ und-acorn.lst: pre-acorn.o echo 'acorn' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -acorn_mod-partmap_acorn.o: partmap/acorn.c +acorn_mod-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -MD -c -o $@ $< -include acorn_mod-partmap_acorn.d @@ -1331,10 +1331,10 @@ CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst FSFILES += fs-acorn_mod-partmap_acorn.lst -cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c gencmdlist.sh +cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) -fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c genfslist.sh +fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) @@ -1375,7 +1375,7 @@ und-gpt.lst: pre-gpt.o echo 'gpt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -gpt_mod-partmap_gpt.o: partmap/gpt.c +gpt_mod-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -MD -c -o $@ $< -include gpt_mod-partmap_gpt.d @@ -1383,10 +1383,10 @@ CLEANFILES += cmd-gpt_mod-partmap_gpt.lst fs-gpt_mod-partmap_gpt.lst COMMANDFILES += cmd-gpt_mod-partmap_gpt.lst FSFILES += fs-gpt_mod-partmap_gpt.lst -cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c gencmdlist.sh +cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1) -fs-gpt_mod-partmap_gpt.lst: partmap/gpt.c genfslist.sh +fs-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1) @@ -1431,7 +1431,7 @@ und-raid.lst: pre-raid.o echo 'raid' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -raid_mod-disk_raid.o: disk/raid.c +raid_mod-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -MD -c -o $@ $< -include raid_mod-disk_raid.d @@ -1439,10 +1439,10 @@ CLEANFILES += cmd-raid_mod-disk_raid.lst fs-raid_mod-disk_raid.lst COMMANDFILES += cmd-raid_mod-disk_raid.lst FSFILES += fs-raid_mod-disk_raid.lst -cmd-raid_mod-disk_raid.lst: disk/raid.c gencmdlist.sh +cmd-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid > $@ || (rm -f $@; exit 1) -fs-raid_mod-disk_raid.lst: disk/raid.c genfslist.sh +fs-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid > $@ || (rm -f $@; exit 1) @@ -1483,7 +1483,7 @@ und-lvm.lst: pre-lvm.o echo 'lvm' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -lvm_mod-disk_lvm.o: disk/lvm.c +lvm_mod-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -MD -c -o $@ $< -include lvm_mod-disk_lvm.d @@ -1491,10 +1491,10 @@ CLEANFILES += cmd-lvm_mod-disk_lvm.lst fs-lvm_mod-disk_lvm.lst COMMANDFILES += cmd-lvm_mod-disk_lvm.lst FSFILES += fs-lvm_mod-disk_lvm.lst -cmd-lvm_mod-disk_lvm.lst: disk/lvm.c gencmdlist.sh +cmd-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lvm > $@ || (rm -f $@; exit 1) -fs-lvm_mod-disk_lvm.lst: disk/lvm.c genfslist.sh +fs-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lvm > $@ || (rm -f $@; exit 1) @@ -1541,7 +1541,7 @@ und-hello.lst: pre-hello.o echo 'hello' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -hello_mod-hello_hello.o: hello/hello.c +hello_mod-hello_hello.o: hello/hello.c $(hello/hello.c_DEPENDENCIES) $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -MD -c -o $@ $< -include hello_mod-hello_hello.d @@ -1549,10 +1549,10 @@ CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst COMMANDFILES += cmd-hello_mod-hello_hello.lst FSFILES += fs-hello_mod-hello_hello.lst -cmd-hello_mod-hello_hello.lst: hello/hello.c gencmdlist.sh +cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) -fs-hello_mod-hello_hello.lst: hello/hello.c genfslist.sh +fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) @@ -1593,7 +1593,7 @@ und-boot.lst: pre-boot.o echo 'boot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -boot_mod-commands_boot.o: commands/boot.c +boot_mod-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -MD -c -o $@ $< -include boot_mod-commands_boot.d @@ -1601,10 +1601,10 @@ CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst COMMANDFILES += cmd-boot_mod-commands_boot.lst FSFILES += fs-boot_mod-commands_boot.lst -cmd-boot_mod-commands_boot.lst: commands/boot.c gencmdlist.sh +cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) -fs-boot_mod-commands_boot.lst: commands/boot.c genfslist.sh +fs-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) @@ -1645,7 +1645,7 @@ und-terminal.lst: pre-terminal.o echo 'terminal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -terminal_mod-commands_terminal.o: commands/terminal.c +terminal_mod-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -MD -c -o $@ $< -include terminal_mod-commands_terminal.d @@ -1653,10 +1653,10 @@ CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_te COMMANDFILES += cmd-terminal_mod-commands_terminal.lst FSFILES += fs-terminal_mod-commands_terminal.lst -cmd-terminal_mod-commands_terminal.lst: commands/terminal.c gencmdlist.sh +cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) -fs-terminal_mod-commands_terminal.lst: commands/terminal.c genfslist.sh +fs-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) @@ -1697,7 +1697,7 @@ und-ls.lst: pre-ls.o echo 'ls' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ls_mod-commands_ls.o: commands/ls.c +ls_mod-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -MD -c -o $@ $< -include ls_mod-commands_ls.d @@ -1705,10 +1705,10 @@ CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst COMMANDFILES += cmd-ls_mod-commands_ls.lst FSFILES += fs-ls_mod-commands_ls.lst -cmd-ls_mod-commands_ls.lst: commands/ls.c gencmdlist.sh +cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) -fs-ls_mod-commands_ls.lst: commands/ls.c genfslist.sh +fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) @@ -1749,7 +1749,7 @@ und-cmp.lst: pre-cmp.o echo 'cmp' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cmp_mod-commands_cmp.o: commands/cmp.c +cmp_mod-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -MD -c -o $@ $< -include cmp_mod-commands_cmp.d @@ -1757,10 +1757,10 @@ CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst COMMANDFILES += cmd-cmp_mod-commands_cmp.lst FSFILES += fs-cmp_mod-commands_cmp.lst -cmd-cmp_mod-commands_cmp.lst: commands/cmp.c gencmdlist.sh +cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) -fs-cmp_mod-commands_cmp.lst: commands/cmp.c genfslist.sh +fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) @@ -1801,7 +1801,7 @@ und-cat.lst: pre-cat.o echo 'cat' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cat_mod-commands_cat.o: commands/cat.c +cat_mod-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -MD -c -o $@ $< -include cat_mod-commands_cat.d @@ -1809,10 +1809,10 @@ CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst COMMANDFILES += cmd-cat_mod-commands_cat.lst FSFILES += fs-cat_mod-commands_cat.lst -cmd-cat_mod-commands_cat.lst: commands/cat.c gencmdlist.sh +cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) -fs-cat_mod-commands_cat.lst: commands/cat.c genfslist.sh +fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) @@ -1853,7 +1853,7 @@ und-echo.lst: pre-echo.o echo 'echo' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -echo_mod-commands_echo.o: commands/echo.c +echo_mod-commands_echo.o: commands/echo.c $(commands/echo.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -MD -c -o $@ $< -include echo_mod-commands_echo.d @@ -1861,10 +1861,10 @@ CLEANFILES += cmd-echo_mod-commands_echo.lst fs-echo_mod-commands_echo.lst COMMANDFILES += cmd-echo_mod-commands_echo.lst FSFILES += fs-echo_mod-commands_echo.lst -cmd-echo_mod-commands_echo.lst: commands/echo.c gencmdlist.sh +cmd-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh echo > $@ || (rm -f $@; exit 1) -fs-echo_mod-commands_echo.lst: commands/echo.c genfslist.sh +fs-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh echo > $@ || (rm -f $@; exit 1) @@ -1905,7 +1905,7 @@ und-help.lst: pre-help.o echo 'help' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -help_mod-commands_help.o: commands/help.c +help_mod-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -MD -c -o $@ $< -include help_mod-commands_help.d @@ -1913,10 +1913,10 @@ CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst COMMANDFILES += cmd-help_mod-commands_help.lst FSFILES += fs-help_mod-commands_help.lst -cmd-help_mod-commands_help.lst: commands/help.c gencmdlist.sh +cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) -fs-help_mod-commands_help.lst: commands/help.c genfslist.sh +fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) @@ -1957,7 +1957,7 @@ und-font.lst: pre-font.o echo 'font' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -font_mod-font_manager.o: font/manager.c +font_mod-font_manager.o: font/manager.c $(font/manager.c_DEPENDENCIES) $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< -include font_mod-font_manager.d @@ -1965,10 +1965,10 @@ CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst COMMANDFILES += cmd-font_mod-font_manager.lst FSFILES += fs-font_mod-font_manager.lst -cmd-font_mod-font_manager.lst: font/manager.c gencmdlist.sh +cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) -fs-font_mod-font_manager.lst: font/manager.c genfslist.sh +fs-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) @@ -2009,7 +2009,7 @@ und-search.lst: pre-search.o echo 'search' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -search_mod-commands_search.o: commands/search.c +search_mod-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -MD -c -o $@ $< -include search_mod-commands_search.d @@ -2017,10 +2017,10 @@ CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.l COMMANDFILES += cmd-search_mod-commands_search.lst FSFILES += fs-search_mod-commands_search.lst -cmd-search_mod-commands_search.lst: commands/search.c gencmdlist.sh +cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) -fs-search_mod-commands_search.lst: commands/search.c genfslist.sh +fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) @@ -2061,7 +2061,7 @@ und-test.lst: pre-test.o echo 'test' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -test_mod-commands_test.o: commands/test.c +test_mod-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -MD -c -o $@ $< -include test_mod-commands_test.d @@ -2069,10 +2069,10 @@ CLEANFILES += cmd-test_mod-commands_test.lst fs-test_mod-commands_test.lst COMMANDFILES += cmd-test_mod-commands_test.lst FSFILES += fs-test_mod-commands_test.lst -cmd-test_mod-commands_test.lst: commands/test.c gencmdlist.sh +cmd-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1) -fs-test_mod-commands_test.lst: commands/test.c genfslist.sh +fs-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1) @@ -2113,7 +2113,7 @@ und-loopback.lst: pre-loopback.o echo 'loopback' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -loopback_mod-disk_loopback.o: disk/loopback.c +loopback_mod-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -MD -c -o $@ $< -include loopback_mod-disk_loopback.d @@ -2121,10 +2121,10 @@ CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.l COMMANDFILES += cmd-loopback_mod-disk_loopback.lst FSFILES += fs-loopback_mod-disk_loopback.lst -cmd-loopback_mod-disk_loopback.lst: disk/loopback.c gencmdlist.sh +cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) -fs-loopback_mod-disk_loopback.lst: disk/loopback.c genfslist.sh +fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) @@ -2165,7 +2165,7 @@ und-configfile.lst: pre-configfile.o echo 'configfile' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -configfile_mod-commands_configfile.o: commands/configfile.c +configfile_mod-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -MD -c -o $@ $< -include configfile_mod-commands_configfile.d @@ -2173,10 +2173,10 @@ CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-comma COMMANDFILES += cmd-configfile_mod-commands_configfile.lst FSFILES += fs-configfile_mod-commands_configfile.lst -cmd-configfile_mod-commands_configfile.lst: commands/configfile.c gencmdlist.sh +cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) -fs-configfile_mod-commands_configfile.lst: commands/configfile.c genfslist.sh +fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) @@ -2217,7 +2217,7 @@ und-terminfo.lst: pre-terminfo.o echo 'terminfo' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -terminfo_mod-term_terminfo.o: term/terminfo.c +terminfo_mod-term_terminfo.o: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -MD -c -o $@ $< -include terminfo_mod-term_terminfo.d @@ -2225,14 +2225,14 @@ CLEANFILES += cmd-terminfo_mod-term_terminfo.lst fs-terminfo_mod-term_terminfo.l COMMANDFILES += cmd-terminfo_mod-term_terminfo.lst FSFILES += fs-terminfo_mod-term_terminfo.lst -cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c gencmdlist.sh +cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) -fs-terminfo_mod-term_terminfo.lst: term/terminfo.c genfslist.sh +fs-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) -terminfo_mod-term_tparm.o: term/tparm.c +terminfo_mod-term_tparm.o: term/tparm.c $(term/tparm.c_DEPENDENCIES) $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -MD -c -o $@ $< -include terminfo_mod-term_tparm.d @@ -2240,10 +2240,10 @@ CLEANFILES += cmd-terminfo_mod-term_tparm.lst fs-terminfo_mod-term_tparm.lst COMMANDFILES += cmd-terminfo_mod-term_tparm.lst FSFILES += fs-terminfo_mod-term_tparm.lst -cmd-terminfo_mod-term_tparm.lst: term/tparm.c gencmdlist.sh +cmd-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) -fs-terminfo_mod-term_tparm.lst: term/tparm.c genfslist.sh +fs-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) @@ -2284,7 +2284,7 @@ und-blocklist.lst: pre-blocklist.o echo 'blocklist' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -blocklist_mod-commands_blocklist.o: commands/blocklist.c +blocklist_mod-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -MD -c -o $@ $< -include blocklist_mod-commands_blocklist.d @@ -2292,10 +2292,10 @@ CLEANFILES += cmd-blocklist_mod-commands_blocklist.lst fs-blocklist_mod-commands COMMANDFILES += cmd-blocklist_mod-commands_blocklist.lst FSFILES += fs-blocklist_mod-commands_blocklist.lst -cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c gencmdlist.sh +cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1) -fs-blocklist_mod-commands_blocklist.lst: commands/blocklist.c genfslist.sh +fs-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1) @@ -2336,7 +2336,7 @@ und-hexdump.lst: pre-hexdump.o echo 'hexdump' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -hexdump_mod-commands_hexdump.o: commands/hexdump.c +hexdump_mod-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -MD -c -o $@ $< -include hexdump_mod-commands_hexdump.d @@ -2344,10 +2344,10 @@ CLEANFILES += cmd-hexdump_mod-commands_hexdump.lst fs-hexdump_mod-commands_hexdu COMMANDFILES += cmd-hexdump_mod-commands_hexdump.lst FSFILES += fs-hexdump_mod-commands_hexdump.lst -cmd-hexdump_mod-commands_hexdump.lst: commands/hexdump.c gencmdlist.sh +cmd-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) -fs-hexdump_mod-commands_hexdump.lst: commands/hexdump.c genfslist.sh +fs-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) @@ -2391,7 +2391,7 @@ und-elf.lst: pre-elf.o echo 'elf' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -elf_mod-kern_elf.o: kern/elf.c +elf_mod-kern_elf.o: kern/elf.c $(kern/elf.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -MD -c -o $@ $< -include elf_mod-kern_elf.d @@ -2399,10 +2399,10 @@ CLEANFILES += cmd-elf_mod-kern_elf.lst fs-elf_mod-kern_elf.lst COMMANDFILES += cmd-elf_mod-kern_elf.lst FSFILES += fs-elf_mod-kern_elf.lst -cmd-elf_mod-kern_elf.lst: kern/elf.c gencmdlist.sh +cmd-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh elf > $@ || (rm -f $@; exit 1) -fs-elf_mod-kern_elf.lst: kern/elf.c genfslist.sh +fs-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh elf > $@ || (rm -f $@; exit 1) @@ -2443,7 +2443,7 @@ und-gzio.lst: pre-gzio.o echo 'gzio' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -gzio_mod-io_gzio.o: io/gzio.c +gzio_mod-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -MD -c -o $@ $< -include gzio_mod-io_gzio.d @@ -2451,10 +2451,10 @@ CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst COMMANDFILES += cmd-gzio_mod-io_gzio.lst FSFILES += fs-gzio_mod-io_gzio.lst -cmd-gzio_mod-io_gzio.lst: io/gzio.c gencmdlist.sh +cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) -fs-gzio_mod-io_gzio.lst: io/gzio.c genfslist.sh +fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index b6e82e822..0faf76598 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -4,6 +4,10 @@ COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386 -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Utilities. bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap @@ -65,8 +69,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -105,7 +107,7 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/i386/efi/grub-install.in CLEANFILES += grub-install -grub-install: util/i386/efi/grub-install.in config.status +grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPENDENCIES) config.status ./config.status --file=grub-install:util/i386/efi/grub-install.in chmod +x $@ @@ -154,7 +156,7 @@ und-kernel.lst: pre-kernel.o echo 'kernel' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -kernel_mod-kern_i386_efi_startup.o: kern/i386/efi/startup.S +kernel_mod-kern_i386_efi_startup.o: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_efi_startup.d @@ -162,14 +164,14 @@ CLEANFILES += cmd-kernel_mod-kern_i386_efi_startup.lst fs-kernel_mod-kern_i386_e COMMANDFILES += cmd-kernel_mod-kern_i386_efi_startup.lst FSFILES += fs-kernel_mod-kern_i386_efi_startup.lst -cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S gencmdlist.sh +cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S genfslist.sh +fs-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_main.o: kern/main.c +kernel_mod-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_main.d @@ -177,14 +179,14 @@ CLEANFILES += cmd-kernel_mod-kern_main.lst fs-kernel_mod-kern_main.lst COMMANDFILES += cmd-kernel_mod-kern_main.lst FSFILES += fs-kernel_mod-kern_main.lst -cmd-kernel_mod-kern_main.lst: kern/main.c gencmdlist.sh +cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_main.lst: kern/main.c genfslist.sh +fs-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_device.o: kern/device.c +kernel_mod-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_device.d @@ -192,14 +194,14 @@ CLEANFILES += cmd-kernel_mod-kern_device.lst fs-kernel_mod-kern_device.lst COMMANDFILES += cmd-kernel_mod-kern_device.lst FSFILES += fs-kernel_mod-kern_device.lst -cmd-kernel_mod-kern_device.lst: kern/device.c gencmdlist.sh +cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_device.lst: kern/device.c genfslist.sh +fs-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_disk.o: kern/disk.c +kernel_mod-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_disk.d @@ -207,14 +209,14 @@ CLEANFILES += cmd-kernel_mod-kern_disk.lst fs-kernel_mod-kern_disk.lst COMMANDFILES += cmd-kernel_mod-kern_disk.lst FSFILES += fs-kernel_mod-kern_disk.lst -cmd-kernel_mod-kern_disk.lst: kern/disk.c gencmdlist.sh +cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_disk.lst: kern/disk.c genfslist.sh +fs-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_dl.o: kern/dl.c +kernel_mod-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_dl.d @@ -222,14 +224,14 @@ CLEANFILES += cmd-kernel_mod-kern_dl.lst fs-kernel_mod-kern_dl.lst COMMANDFILES += cmd-kernel_mod-kern_dl.lst FSFILES += fs-kernel_mod-kern_dl.lst -cmd-kernel_mod-kern_dl.lst: kern/dl.c gencmdlist.sh +cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_dl.lst: kern/dl.c genfslist.sh +fs-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_file.o: kern/file.c +kernel_mod-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_file.d @@ -237,14 +239,14 @@ CLEANFILES += cmd-kernel_mod-kern_file.lst fs-kernel_mod-kern_file.lst COMMANDFILES += cmd-kernel_mod-kern_file.lst FSFILES += fs-kernel_mod-kern_file.lst -cmd-kernel_mod-kern_file.lst: kern/file.c gencmdlist.sh +cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_file.lst: kern/file.c genfslist.sh +fs-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_fs.o: kern/fs.c +kernel_mod-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_fs.d @@ -252,14 +254,14 @@ CLEANFILES += cmd-kernel_mod-kern_fs.lst fs-kernel_mod-kern_fs.lst COMMANDFILES += cmd-kernel_mod-kern_fs.lst FSFILES += fs-kernel_mod-kern_fs.lst -cmd-kernel_mod-kern_fs.lst: kern/fs.c gencmdlist.sh +cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_fs.lst: kern/fs.c genfslist.sh +fs-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_err.o: kern/err.c +kernel_mod-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_err.d @@ -267,14 +269,14 @@ CLEANFILES += cmd-kernel_mod-kern_err.lst fs-kernel_mod-kern_err.lst COMMANDFILES += cmd-kernel_mod-kern_err.lst FSFILES += fs-kernel_mod-kern_err.lst -cmd-kernel_mod-kern_err.lst: kern/err.c gencmdlist.sh +cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_err.lst: kern/err.c genfslist.sh +fs-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_misc.o: kern/misc.c +kernel_mod-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_misc.d @@ -282,14 +284,14 @@ CLEANFILES += cmd-kernel_mod-kern_misc.lst fs-kernel_mod-kern_misc.lst COMMANDFILES += cmd-kernel_mod-kern_misc.lst FSFILES += fs-kernel_mod-kern_misc.lst -cmd-kernel_mod-kern_misc.lst: kern/misc.c gencmdlist.sh +cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_misc.lst: kern/misc.c genfslist.sh +fs-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_mm.o: kern/mm.c +kernel_mod-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_mm.d @@ -297,14 +299,14 @@ CLEANFILES += cmd-kernel_mod-kern_mm.lst fs-kernel_mod-kern_mm.lst COMMANDFILES += cmd-kernel_mod-kern_mm.lst FSFILES += fs-kernel_mod-kern_mm.lst -cmd-kernel_mod-kern_mm.lst: kern/mm.c gencmdlist.sh +cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_mm.lst: kern/mm.c genfslist.sh +fs-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_loader.o: kern/loader.c +kernel_mod-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_loader.d @@ -312,14 +314,14 @@ CLEANFILES += cmd-kernel_mod-kern_loader.lst fs-kernel_mod-kern_loader.lst COMMANDFILES += cmd-kernel_mod-kern_loader.lst FSFILES += fs-kernel_mod-kern_loader.lst -cmd-kernel_mod-kern_loader.lst: kern/loader.c gencmdlist.sh +cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_loader.lst: kern/loader.c genfslist.sh +fs-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_rescue.o: kern/rescue.c +kernel_mod-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_rescue.d @@ -327,14 +329,14 @@ CLEANFILES += cmd-kernel_mod-kern_rescue.lst fs-kernel_mod-kern_rescue.lst COMMANDFILES += cmd-kernel_mod-kern_rescue.lst FSFILES += fs-kernel_mod-kern_rescue.lst -cmd-kernel_mod-kern_rescue.lst: kern/rescue.c gencmdlist.sh +cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_rescue.lst: kern/rescue.c genfslist.sh +fs-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_term.o: kern/term.c +kernel_mod-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_term.d @@ -342,14 +344,14 @@ CLEANFILES += cmd-kernel_mod-kern_term.lst fs-kernel_mod-kern_term.lst COMMANDFILES += cmd-kernel_mod-kern_term.lst FSFILES += fs-kernel_mod-kern_term.lst -cmd-kernel_mod-kern_term.lst: kern/term.c gencmdlist.sh +cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_term.lst: kern/term.c genfslist.sh +fs-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_i386_dl.o: kern/i386/dl.c +kernel_mod-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_dl.d @@ -357,14 +359,14 @@ CLEANFILES += cmd-kernel_mod-kern_i386_dl.lst fs-kernel_mod-kern_i386_dl.lst COMMANDFILES += cmd-kernel_mod-kern_i386_dl.lst FSFILES += fs-kernel_mod-kern_i386_dl.lst -cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c gencmdlist.sh +cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c genfslist.sh +fs-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c +kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_efi_init.d @@ -372,14 +374,14 @@ CLEANFILES += cmd-kernel_mod-kern_i386_efi_init.lst fs-kernel_mod-kern_i386_efi_ COMMANDFILES += cmd-kernel_mod-kern_i386_efi_init.lst FSFILES += fs-kernel_mod-kern_i386_efi_init.lst -cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c gencmdlist.sh +cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c genfslist.sh +fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_parser.o: kern/parser.c +kernel_mod-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_parser.d @@ -387,14 +389,14 @@ CLEANFILES += cmd-kernel_mod-kern_parser.lst fs-kernel_mod-kern_parser.lst COMMANDFILES += cmd-kernel_mod-kern_parser.lst FSFILES += fs-kernel_mod-kern_parser.lst -cmd-kernel_mod-kern_parser.lst: kern/parser.c gencmdlist.sh +cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_parser.lst: kern/parser.c genfslist.sh +fs-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_partition.o: kern/partition.c +kernel_mod-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_partition.d @@ -402,14 +404,14 @@ CLEANFILES += cmd-kernel_mod-kern_partition.lst fs-kernel_mod-kern_partition.lst COMMANDFILES += cmd-kernel_mod-kern_partition.lst FSFILES += fs-kernel_mod-kern_partition.lst -cmd-kernel_mod-kern_partition.lst: kern/partition.c gencmdlist.sh +cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_partition.lst: kern/partition.c genfslist.sh +fs-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_env.o: kern/env.c +kernel_mod-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_env.d @@ -417,14 +419,14 @@ CLEANFILES += cmd-kernel_mod-kern_env.lst fs-kernel_mod-kern_env.lst COMMANDFILES += cmd-kernel_mod-kern_env.lst FSFILES += fs-kernel_mod-kern_env.lst -cmd-kernel_mod-kern_env.lst: kern/env.c gencmdlist.sh +cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_env.lst: kern/env.c genfslist.sh +fs-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-symlist.o: symlist.c +kernel_mod-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-symlist.d @@ -432,14 +434,14 @@ CLEANFILES += cmd-kernel_mod-symlist.lst fs-kernel_mod-symlist.lst COMMANDFILES += cmd-kernel_mod-symlist.lst FSFILES += fs-kernel_mod-symlist.lst -cmd-kernel_mod-symlist.lst: symlist.c gencmdlist.sh +cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-symlist.lst: symlist.c genfslist.sh +fs-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_efi_efi.o: kern/efi/efi.c +kernel_mod-kern_efi_efi.o: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_efi_efi.d @@ -447,14 +449,14 @@ CLEANFILES += cmd-kernel_mod-kern_efi_efi.lst fs-kernel_mod-kern_efi_efi.lst COMMANDFILES += cmd-kernel_mod-kern_efi_efi.lst FSFILES += fs-kernel_mod-kern_efi_efi.lst -cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c gencmdlist.sh +cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c genfslist.sh +fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_efi_init.o: kern/efi/init.c +kernel_mod-kern_efi_init.o: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_efi_init.d @@ -462,14 +464,14 @@ CLEANFILES += cmd-kernel_mod-kern_efi_init.lst fs-kernel_mod-kern_efi_init.lst COMMANDFILES += cmd-kernel_mod-kern_efi_init.lst FSFILES += fs-kernel_mod-kern_efi_init.lst -cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c gencmdlist.sh +cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c genfslist.sh +fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-kern_efi_mm.o: kern/efi/mm.c +kernel_mod-kern_efi_mm.o: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_efi_mm.d @@ -477,14 +479,14 @@ CLEANFILES += cmd-kernel_mod-kern_efi_mm.lst fs-kernel_mod-kern_efi_mm.lst COMMANDFILES += cmd-kernel_mod-kern_efi_mm.lst FSFILES += fs-kernel_mod-kern_efi_mm.lst -cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c gencmdlist.sh +cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c genfslist.sh +fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-term_efi_console.o: term/efi/console.c +kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-term_efi_console.d @@ -492,14 +494,14 @@ CLEANFILES += cmd-kernel_mod-term_efi_console.lst fs-kernel_mod-term_efi_console COMMANDFILES += cmd-kernel_mod-term_efi_console.lst FSFILES += fs-kernel_mod-term_efi_console.lst -cmd-kernel_mod-term_efi_console.lst: term/efi/console.c gencmdlist.sh +cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-term_efi_console.lst: term/efi/console.c genfslist.sh +fs-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c +kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-disk_efi_efidisk.d @@ -507,10 +509,10 @@ CLEANFILES += cmd-kernel_mod-disk_efi_efidisk.lst fs-kernel_mod-disk_efi_efidisk COMMANDFILES += cmd-kernel_mod-disk_efi_efidisk.lst FSFILES += fs-kernel_mod-disk_efi_efidisk.lst -cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c gencmdlist.sh +cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) -fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c genfslist.sh +fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) @@ -533,7 +535,6 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -571,7 +572,7 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c +normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d @@ -579,14 +580,14 @@ CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst -cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh +cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh +fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_cmdline.o: normal/cmdline.c +normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -594,14 +595,14 @@ CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh +cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh +fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_command.o: normal/command.c +normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d @@ -609,14 +610,14 @@ CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst -cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh +cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh +fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_completion.o: normal/completion.c +normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d @@ -624,14 +625,14 @@ CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completi COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst -cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh +cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh +fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_execute.o: normal/execute.c +normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -639,14 +640,14 @@ CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst -cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh +cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh +fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_function.o: normal/function.c +normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d @@ -654,14 +655,14 @@ CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.l COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst -cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh +cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh +fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_lexer.o: normal/lexer.c +normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d @@ -669,14 +670,14 @@ CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst -cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh +cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh +fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_main.o: normal/main.c +normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d @@ -684,14 +685,14 @@ CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst -cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh +cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh +fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu.o: normal/menu.c +normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d @@ -699,14 +700,14 @@ CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst -cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh +cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh +fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu_entry.o: normal/menu_entry.c +normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -714,14 +715,14 @@ CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_ent COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh +cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh +fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_misc.o: normal/misc.c +normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d @@ -729,14 +730,14 @@ CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst -cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh +cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh +fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-grub_script_tab.o: grub_script.tab.c +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d @@ -744,14 +745,14 @@ CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.l COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_script.o: normal/script.c +normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d @@ -759,14 +760,14 @@ CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst -cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh +cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh +fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S +normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d @@ -774,14 +775,14 @@ CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_se COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh +cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh +fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d @@ -789,10 +790,10 @@ CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst -cmd-normal_mod-normal_color.lst: normal/color.c gencmdlist.sh +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_color.lst: normal/color.c genfslist.sh +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) @@ -834,7 +835,7 @@ und-_chain.lst: pre-_chain.o echo '_chain' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c +_chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< -include _chain_mod-loader_efi_chainloader.d @@ -842,10 +843,10 @@ CLEANFILES += cmd-_chain_mod-loader_efi_chainloader.lst fs-_chain_mod-loader_efi COMMANDFILES += cmd-_chain_mod-loader_efi_chainloader.lst FSFILES += fs-_chain_mod-loader_efi_chainloader.lst -cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c gencmdlist.sh +cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) -fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c genfslist.sh +fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) @@ -886,7 +887,7 @@ und-chain.lst: pre-chain.o echo 'chain' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c +chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< -include chain_mod-loader_efi_chainloader_normal.d @@ -894,10 +895,10 @@ CLEANFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst fs-chain_mod-loade COMMANDFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst FSFILES += fs-chain_mod-loader_efi_chainloader_normal.lst -cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c gencmdlist.sh +cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) -fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c genfslist.sh +fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) @@ -938,7 +939,7 @@ und-_linux.lst: pre-_linux.o echo '_linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c +_linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_i386_efi_linux.d @@ -946,10 +947,10 @@ CLEANFILES += cmd-_linux_mod-loader_i386_efi_linux.lst fs-_linux_mod-loader_i386 COMMANDFILES += cmd-_linux_mod-loader_i386_efi_linux.lst FSFILES += fs-_linux_mod-loader_i386_efi_linux.lst -cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c gencmdlist.sh +cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) -fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c genfslist.sh +fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) @@ -990,7 +991,7 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c +linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_i386_efi_linux_normal.d @@ -998,10 +999,10 @@ CLEANFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst fs-linux_mod-loader COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst FSFILES += fs-linux_mod-loader_i386_efi_linux_normal.lst -cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c gencmdlist.sh +cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c genfslist.sh +fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) @@ -1042,7 +1043,7 @@ und-cpuid.lst: pre-cpuid.o echo 'cpuid' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c +cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d @@ -1050,10 +1051,10 @@ CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_c COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c gencmdlist.sh +cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c genfslist.sh +fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 2b340b4e7..3d47181bd 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -4,6 +4,10 @@ COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386 -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Utilities. bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap @@ -29,8 +33,6 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -99,7 +101,6 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 422665bd5..deb2a9905 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -4,6 +4,10 @@ COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. pkglib_PROGRAMS = kernel.elf @@ -26,107 +30,107 @@ MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386 kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) -kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S +kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_ieee1275_startup.d -kernel_elf-kern_i386_ieee1275_init.o: kern/i386/ieee1275/init.c +kernel_elf-kern_i386_ieee1275_init.o: kern/i386/ieee1275/init.c $(kern/i386/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_ieee1275_init.d -kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c +kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c $(kern/powerpc/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_init.d -kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c +kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c $(kern/powerpc/ieee1275/cmain.c_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_cmain.d -kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c +kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c $(kern/powerpc/ieee1275/openfw.c_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_openfw.d -kernel_elf-kern_main.o: kern/main.c +kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_main.d -kernel_elf-kern_device.o: kern/device.c +kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_device.d -kernel_elf-kern_disk.o: kern/disk.c +kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_disk.d -kernel_elf-kern_dl.o: kern/dl.c +kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_dl.d -kernel_elf-kern_file.o: kern/file.c +kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_file.d -kernel_elf-kern_fs.o: kern/fs.c +kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_fs.d -kernel_elf-kern_err.o: kern/err.c +kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_err.d -kernel_elf-kern_misc.o: kern/misc.c +kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_misc.d -kernel_elf-kern_mm.o: kern/mm.c +kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_mm.d -kernel_elf-kern_loader.o: kern/loader.c +kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_loader.d -kernel_elf-kern_rescue.o: kern/rescue.c +kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_rescue.d -kernel_elf-kern_term.o: kern/term.c +kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_term.d -kernel_elf-kern_i386_dl.o: kern/i386/dl.c +kernel_elf-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_dl.d -kernel_elf-kern_parser.o: kern/parser.c +kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_parser.d -kernel_elf-kern_partition.o: kern/partition.c +kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_partition.d -kernel_elf-kern_env.o: kern/env.c +kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d -kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c +kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_ieee1275.d -kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c +kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_ieee1275_ofconsole.d -kernel_elf-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c +kernel_elf-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_i386_pc_at_keyboard.d -kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c +kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-disk_ieee1275_ofdisk.d -kernel_elf-symlist.o: symlist.c +kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d @@ -200,8 +204,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -561,7 +563,6 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod serial.mod # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -599,7 +600,7 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c +normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d @@ -607,14 +608,14 @@ CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst -cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh +cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh +fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_cmdline.o: normal/cmdline.c +normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -622,14 +623,14 @@ CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh +cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh +fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_command.o: normal/command.c +normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d @@ -637,14 +638,14 @@ CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst -cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh +cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh +fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_completion.o: normal/completion.c +normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d @@ -652,14 +653,14 @@ CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completi COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst -cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh +cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh +fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_execute.o: normal/execute.c +normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -667,14 +668,14 @@ CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst -cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh +cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh +fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_function.o: normal/function.c +normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d @@ -682,14 +683,14 @@ CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.l COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst -cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh +cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh +fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_lexer.o: normal/lexer.c +normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d @@ -697,14 +698,14 @@ CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst -cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh +cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh +fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_main.o: normal/main.c +normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d @@ -712,14 +713,14 @@ CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst -cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh +cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh +fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu.o: normal/menu.c +normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d @@ -727,14 +728,14 @@ CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst -cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh +cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh +fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu_entry.o: normal/menu_entry.c +normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -742,14 +743,14 @@ CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_ent COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh +cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh +fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_misc.o: normal/misc.c +normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d @@ -757,14 +758,14 @@ CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst -cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh +cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh +fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-grub_script_tab.o: grub_script.tab.c +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d @@ -772,14 +773,14 @@ CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.l COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_script.o: normal/script.c +normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d @@ -787,14 +788,14 @@ CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst -cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh +cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh +fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S +normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d @@ -802,14 +803,14 @@ CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_se COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh +cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh +fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d @@ -817,10 +818,10 @@ CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst -cmd-normal_mod-normal_color.lst: normal/color.c gencmdlist.sh +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_color.lst: normal/color.c genfslist.sh +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) @@ -864,7 +865,7 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_powerpc_ieee1275_multiboot2.o: loader/powerpc/ieee1275/multiboot2.c +_multiboot_mod-loader_powerpc_ieee1275_multiboot2.o: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_powerpc_ieee1275_multiboot2.d @@ -872,14 +873,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst fs-_mult COMMANDFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst -cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c +_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d @@ -887,14 +888,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_ COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c +_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d @@ -902,10 +903,10 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-l COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c genfslist.sh +fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -946,7 +947,7 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c +multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d @@ -954,10 +955,10 @@ CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_ COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c gencmdlist.sh +cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c genfslist.sh +fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -998,7 +999,7 @@ und-suspend.lst: pre-suspend.o echo 'suspend' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c +suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< -include suspend_mod-commands_ieee1275_suspend.d @@ -1006,10 +1007,10 @@ CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-comma COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst -cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c gencmdlist.sh +cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) -fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c genfslist.sh +fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) @@ -1050,7 +1051,7 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c +reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_ieee1275_reboot.d @@ -1058,10 +1059,10 @@ CLEANFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst fs-reboot_mod-commands COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst -cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c gencmdlist.sh +cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c genfslist.sh +fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1102,7 +1103,7 @@ und-halt.lst: pre-halt.o echo 'halt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c +halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_ieee1275_halt.d @@ -1110,10 +1111,10 @@ CLEANFILES += cmd-halt_mod-commands_ieee1275_halt.lst fs-halt_mod-commands_ieee1 COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst FSFILES += fs-halt_mod-commands_ieee1275_halt.lst -cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c gencmdlist.sh +cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) -fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c genfslist.sh +fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) @@ -1154,7 +1155,7 @@ und-cpuid.lst: pre-cpuid.o echo 'cpuid' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c +cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d @@ -1162,10 +1163,10 @@ CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_c COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c gencmdlist.sh +cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c genfslist.sh +fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) @@ -1206,7 +1207,7 @@ und-serial.lst: pre-serial.o echo 'serial' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c +serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< -include serial_mod-term_i386_pc_serial.d @@ -1214,10 +1215,10 @@ CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_ COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst FSFILES += fs-serial_mod-term_i386_pc_serial.lst -cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c gencmdlist.sh +cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) -fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c genfslist.sh +fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index ce8e0986b..de0b1b7b0 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -4,6 +4,10 @@ COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. pkglib_PROGRAMS = kernel.elf @@ -54,8 +58,6 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -93,7 +95,6 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod serial.mod # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index eccd4b097..8e3484253 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -4,6 +4,10 @@ COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. pkglib_PROGRAMS = kernel.elf @@ -24,95 +28,95 @@ MOSTLYCLEANFILES += kernel_elf-kern_i386_linuxbios_startup.d kernel_elf-kern_i38 kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_CC) -o $@ kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) -kernel_elf-kern_i386_linuxbios_startup.o: kern/i386/linuxbios/startup.S +kernel_elf-kern_i386_linuxbios_startup.o: kern/i386/linuxbios/startup.S $(kern/i386/linuxbios/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_linuxbios_startup.d -kernel_elf-kern_i386_linuxbios_init.o: kern/i386/linuxbios/init.c +kernel_elf-kern_i386_linuxbios_init.o: kern/i386/linuxbios/init.c $(kern/i386/linuxbios/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_linuxbios_init.d -kernel_elf-kern_i386_linuxbios_table.o: kern/i386/linuxbios/table.c +kernel_elf-kern_i386_linuxbios_table.o: kern/i386/linuxbios/table.c $(kern/i386/linuxbios/table.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_linuxbios_table.d -kernel_elf-kern_main.o: kern/main.c +kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_main.d -kernel_elf-kern_device.o: kern/device.c +kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_device.d -kernel_elf-kern_disk.o: kern/disk.c +kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_disk.d -kernel_elf-kern_dl.o: kern/dl.c +kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_dl.d -kernel_elf-kern_file.o: kern/file.c +kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_file.d -kernel_elf-kern_fs.o: kern/fs.c +kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_fs.d -kernel_elf-kern_err.o: kern/err.c +kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_err.d -kernel_elf-kern_misc.o: kern/misc.c +kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_misc.d -kernel_elf-kern_mm.o: kern/mm.c +kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_mm.d -kernel_elf-kern_loader.o: kern/loader.c +kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_loader.d -kernel_elf-kern_rescue.o: kern/rescue.c +kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_rescue.d -kernel_elf-kern_term.o: kern/term.c +kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_term.d -kernel_elf-kern_i386_dl.o: kern/i386/dl.c +kernel_elf-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_dl.d -kernel_elf-kern_parser.o: kern/parser.c +kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_parser.d -kernel_elf-kern_partition.o: kern/partition.c +kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_partition.d -kernel_elf-kern_env.o: kern/env.c +kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d -kernel_elf-term_i386_pc_console.o: term/i386/pc/console.c +kernel_elf-term_i386_pc_console.o: term/i386/pc/console.c $(term/i386/pc/console.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_i386_pc_console.d -kernel_elf-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c +kernel_elf-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_i386_pc_at_keyboard.d -kernel_elf-term_i386_pc_vga_text.o: term/i386/pc/vga_text.c +kernel_elf-term_i386_pc_vga_text.o: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_i386_pc_vga_text.d -kernel_elf-symlist.o: symlist.c +kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d @@ -187,8 +191,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -582,7 +584,7 @@ und-_linux.lst: pre-_linux.o echo '_linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c +_linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_i386_pc_linux.d @@ -590,10 +592,10 @@ CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_ COMMANDFILES += cmd-_linux_mod-loader_i386_pc_linux.lst FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst -cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c gencmdlist.sh +cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) -fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c genfslist.sh +fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) @@ -634,7 +636,7 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c +linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_i386_pc_linux_normal.d @@ -642,10 +644,10 @@ CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_ COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst -cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c gencmdlist.sh +cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c genfslist.sh +fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) @@ -653,7 +655,6 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -691,7 +692,7 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c +normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d @@ -699,14 +700,14 @@ CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst -cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh +cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh +fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_cmdline.o: normal/cmdline.c +normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -714,14 +715,14 @@ CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh +cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh +fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_command.o: normal/command.c +normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d @@ -729,14 +730,14 @@ CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst -cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh +cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh +fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_completion.o: normal/completion.c +normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d @@ -744,14 +745,14 @@ CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completi COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst -cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh +cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh +fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_execute.o: normal/execute.c +normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -759,14 +760,14 @@ CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst -cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh +cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh +fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_function.o: normal/function.c +normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d @@ -774,14 +775,14 @@ CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.l COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst -cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh +cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh +fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_lexer.o: normal/lexer.c +normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d @@ -789,14 +790,14 @@ CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst -cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh +cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh +fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_main.o: normal/main.c +normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d @@ -804,14 +805,14 @@ CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst -cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh +cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh +fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu.o: normal/menu.c +normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d @@ -819,14 +820,14 @@ CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst -cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh +cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh +fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu_entry.o: normal/menu_entry.c +normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -834,14 +835,14 @@ CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_ent COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh +cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh +fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_misc.o: normal/misc.c +normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d @@ -849,14 +850,14 @@ CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst -cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh +cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh +fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-grub_script_tab.o: grub_script.tab.c +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d @@ -864,14 +865,14 @@ CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.l COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_script.o: normal/script.c +normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d @@ -879,14 +880,14 @@ CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst -cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh +cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh +fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S +normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d @@ -894,14 +895,14 @@ CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_se COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh +cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh +fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d @@ -909,10 +910,10 @@ CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst -cmd-normal_mod-normal_color.lst: normal/color.c gencmdlist.sh +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_color.lst: normal/color.c genfslist.sh +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) @@ -954,7 +955,7 @@ und-serial.lst: pre-serial.o echo 'serial' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c +serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< -include serial_mod-term_i386_pc_serial.d @@ -962,10 +963,10 @@ CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_ COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst FSFILES += fs-serial_mod-term_i386_pc_serial.lst -cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c gencmdlist.sh +cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) -fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c genfslist.sh +fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) @@ -1009,7 +1010,7 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c +_multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot.d @@ -1017,14 +1018,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod- COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst -cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c gencmdlist.sh +cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c genfslist.sh +fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c +_multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot2.d @@ -1032,14 +1033,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot2.lst -cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c +_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d @@ -1047,14 +1048,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_ COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c +_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d @@ -1062,10 +1063,10 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-l COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c genfslist.sh +fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1106,7 +1107,7 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c +multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d @@ -1114,10 +1115,10 @@ CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_ COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c gencmdlist.sh +cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c genfslist.sh +fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -1158,7 +1159,7 @@ und-play.lst: pre-play.o echo 'play' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c +play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -MD -c -o $@ $< -include play_mod-commands_i386_pc_play.d @@ -1166,10 +1167,10 @@ CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_p COMMANDFILES += cmd-play_mod-commands_i386_pc_play.lst FSFILES += fs-play_mod-commands_i386_pc_play.lst -cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c gencmdlist.sh +cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) -fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c genfslist.sh +fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) @@ -1210,7 +1211,7 @@ und-cpuid.lst: pre-cpuid.o echo 'cpuid' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c +cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d @@ -1218,10 +1219,10 @@ CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_c COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c gencmdlist.sh +cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c genfslist.sh +fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) @@ -1262,7 +1263,7 @@ und-ata.lst: pre-ata.o echo 'ata' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ata_mod-disk_ata.o: disk/ata.c +ata_mod-disk_ata.o: disk/ata.c $(disk/ata.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $< -include ata_mod-disk_ata.d @@ -1270,10 +1271,10 @@ CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst COMMANDFILES += cmd-ata_mod-disk_ata.lst FSFILES += fs-ata_mod-disk_ata.lst -cmd-ata_mod-disk_ata.lst: disk/ata.c gencmdlist.sh +cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) -fs-ata_mod-disk_ata.lst: disk/ata.c genfslist.sh +fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index a551d44d8..218352a3e 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -4,6 +4,10 @@ COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. pkglib_PROGRAMS = kernel.elf @@ -53,8 +57,6 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -103,7 +105,6 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 729d48b10..9f6dce142 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -20,7 +20,7 @@ boot.img: boot.exec boot.exec: boot_img-boot_i386_pc_boot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS) -boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S +boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S $(boot/i386/pc/boot.S_DEPENDENCIES) $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_ASFLAGS) -MD -c -o $@ $< -include boot_img-boot_i386_pc_boot.d @@ -38,7 +38,7 @@ pxeboot.img: pxeboot.exec pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS) -pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S +pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S $(boot/i386/pc/pxeboot.S_DEPENDENCIES) $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(pxeboot_img_ASFLAGS) -MD -c -o $@ $< -include pxeboot_img-boot_i386_pc_pxeboot.d @@ -56,7 +56,7 @@ diskboot.img: diskboot.exec diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS) -diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S +diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S $(boot/i386/pc/diskboot.S_DEPENDENCIES) $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_ASFLAGS) -MD -c -o $@ $< -include diskboot_img-boot_i386_pc_diskboot.d @@ -74,7 +74,7 @@ lnxboot.img: lnxboot.exec lnxboot.exec: lnxboot_img-boot_i386_pc_lnxboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(lnxboot_img_LDFLAGS) -lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S +lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S $(boot/i386/pc/lnxboot.S_DEPENDENCIES) $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(lnxboot_img_ASFLAGS) -MD -c -o $@ $< -include lnxboot_img-boot_i386_pc_lnxboot.d @@ -98,83 +98,83 @@ kernel.img: kernel.exec kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) -kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S +kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_img_ASFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_pc_startup.d -kernel_img-kern_main.o: kern/main.c +kernel_img-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_main.d -kernel_img-kern_device.o: kern/device.c +kernel_img-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_device.d -kernel_img-kern_disk.o: kern/disk.c +kernel_img-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_disk.d -kernel_img-kern_dl.o: kern/dl.c +kernel_img-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_dl.d -kernel_img-kern_file.o: kern/file.c +kernel_img-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_file.d -kernel_img-kern_fs.o: kern/fs.c +kernel_img-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_fs.d -kernel_img-kern_err.o: kern/err.c +kernel_img-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_err.d -kernel_img-kern_misc.o: kern/misc.c +kernel_img-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_misc.d -kernel_img-kern_mm.o: kern/mm.c +kernel_img-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_mm.d -kernel_img-kern_loader.o: kern/loader.c +kernel_img-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_loader.d -kernel_img-kern_rescue.o: kern/rescue.c +kernel_img-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_rescue.d -kernel_img-kern_term.o: kern/term.c +kernel_img-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_term.d -kernel_img-kern_i386_dl.o: kern/i386/dl.c +kernel_img-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_dl.d -kernel_img-kern_i386_pc_init.o: kern/i386/pc/init.c +kernel_img-kern_i386_pc_init.o: kern/i386/pc/init.c $(kern/i386/pc/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_pc_init.d -kernel_img-kern_parser.o: kern/parser.c +kernel_img-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_parser.d -kernel_img-kern_partition.o: kern/partition.c +kernel_img-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_partition.d -kernel_img-kern_env.o: kern/env.c +kernel_img-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_env.d -kernel_img-term_i386_pc_console.o: term/i386/pc/console.c +kernel_img-term_i386_pc_console.o: term/i386/pc/console.c $(term/i386/pc/console.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-term_i386_pc_console.d -kernel_img-symlist.o: symlist.c +kernel_img-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-symlist.d @@ -408,8 +408,6 @@ grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i38 # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -772,7 +770,7 @@ bin_SCRIPTS = grub-mkrescue grub_install_SOURCES = util/i386/pc/grub-install.in CLEANFILES += grub-install -grub-install: util/i386/pc/grub-install.in config.status +grub-install: util/i386/pc/grub-install.in $(util/i386/pc/grub-install.in_DEPENDENCIES) config.status ./config.status --file=grub-install:util/i386/pc/grub-install.in chmod +x $@ @@ -781,7 +779,7 @@ grub-install: util/i386/pc/grub-install.in config.status grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in CLEANFILES += grub-mkrescue -grub-mkrescue: util/i386/pc/grub-mkrescue.in config.status +grub-mkrescue: util/i386/pc/grub-mkrescue.in $(util/i386/pc/grub-mkrescue.in_DEPENDENCIES) config.status ./config.status --file=grub-mkrescue:util/i386/pc/grub-mkrescue.in chmod +x $@ @@ -827,7 +825,7 @@ und-biosdisk.lst: pre-biosdisk.o echo 'biosdisk' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -biosdisk_mod-disk_i386_pc_biosdisk.o: disk/i386/pc/biosdisk.c +biosdisk_mod-disk_i386_pc_biosdisk.o: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -MD -c -o $@ $< -include biosdisk_mod-disk_i386_pc_biosdisk.d @@ -835,10 +833,10 @@ CLEANFILES += cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst fs-biosdisk_mod-disk_i3 COMMANDFILES += cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst FSFILES += fs-biosdisk_mod-disk_i386_pc_biosdisk.lst -cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c gencmdlist.sh +cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh biosdisk > $@ || (rm -f $@; exit 1) -fs-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c genfslist.sh +fs-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh biosdisk > $@ || (rm -f $@; exit 1) @@ -879,7 +877,7 @@ und-_chain.lst: pre-_chain.o echo '_chain' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c +_chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< -include _chain_mod-loader_i386_pc_chainloader.d @@ -887,10 +885,10 @@ CLEANFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst fs-_chain_mod-loader COMMANDFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst FSFILES += fs-_chain_mod-loader_i386_pc_chainloader.lst -cmd-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c gencmdlist.sh +cmd-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) -fs-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c genfslist.sh +fs-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) @@ -931,7 +929,7 @@ und-chain.lst: pre-chain.o echo 'chain' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -chain_mod-loader_i386_pc_chainloader_normal.o: loader/i386/pc/chainloader_normal.c +chain_mod-loader_i386_pc_chainloader_normal.o: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< -include chain_mod-loader_i386_pc_chainloader_normal.d @@ -939,10 +937,10 @@ CLEANFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst fs-chain_mod-l COMMANDFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst FSFILES += fs-chain_mod-loader_i386_pc_chainloader_normal.lst -cmd-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c gencmdlist.sh +cmd-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) -fs-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c genfslist.sh +fs-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) @@ -983,7 +981,7 @@ und-_linux.lst: pre-_linux.o echo '_linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c +_linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_i386_pc_linux.d @@ -991,10 +989,10 @@ CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_ COMMANDFILES += cmd-_linux_mod-loader_i386_pc_linux.lst FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst -cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c gencmdlist.sh +cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) -fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c genfslist.sh +fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) @@ -1035,7 +1033,7 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c +linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_i386_pc_linux_normal.d @@ -1043,10 +1041,10 @@ CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_ COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst -cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c gencmdlist.sh +cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c genfslist.sh +fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) @@ -1054,7 +1052,6 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -1093,7 +1090,7 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c +normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d @@ -1101,14 +1098,14 @@ CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst -cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh +cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh +fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_cmdline.o: normal/cmdline.c +normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -1116,14 +1113,14 @@ CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh +cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh +fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_command.o: normal/command.c +normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d @@ -1131,14 +1128,14 @@ CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst -cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh +cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh +fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_completion.o: normal/completion.c +normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d @@ -1146,14 +1143,14 @@ CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completi COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst -cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh +cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh +fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_execute.o: normal/execute.c +normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -1161,14 +1158,14 @@ CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst -cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh +cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh +fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_function.o: normal/function.c +normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d @@ -1176,14 +1173,14 @@ CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.l COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst -cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh +cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh +fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_lexer.o: normal/lexer.c +normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d @@ -1191,14 +1188,14 @@ CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst -cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh +cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh +fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_main.o: normal/main.c +normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d @@ -1206,14 +1203,14 @@ CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst -cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh +cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh +fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu.o: normal/menu.c +normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d @@ -1221,14 +1218,14 @@ CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst -cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh +cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh +fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d @@ -1236,14 +1233,14 @@ CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst -cmd-normal_mod-normal_color.lst: normal/color.c gencmdlist.sh +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_color.lst: normal/color.c genfslist.sh +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu_entry.o: normal/menu_entry.c +normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -1251,14 +1248,14 @@ CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_ent COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh +cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh +fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_misc.o: normal/misc.c +normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d @@ -1266,14 +1263,14 @@ CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst -cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh +cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh +fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-grub_script_tab.o: grub_script.tab.c +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d @@ -1281,14 +1278,14 @@ CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.l COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_script.o: normal/script.c +normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d @@ -1296,14 +1293,14 @@ CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst -cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh +cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh +fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S +normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d @@ -1311,10 +1308,10 @@ CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_se COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S gencmdlist.sh +cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S genfslist.sh +fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) @@ -1356,7 +1353,7 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c +reboot_mod-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_i386_pc_reboot.d @@ -1364,10 +1361,10 @@ CLEANFILES += cmd-reboot_mod-commands_i386_pc_reboot.lst fs-reboot_mod-commands_ COMMANDFILES += cmd-reboot_mod-commands_i386_pc_reboot.lst FSFILES += fs-reboot_mod-commands_i386_pc_reboot.lst -cmd-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c gencmdlist.sh +cmd-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c genfslist.sh +fs-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1408,7 +1405,7 @@ und-halt.lst: pre-halt.o echo 'halt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -halt_mod-commands_i386_pc_halt.o: commands/i386/pc/halt.c +halt_mod-commands_i386_pc_halt.o: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_i386_pc_halt.d @@ -1416,10 +1413,10 @@ CLEANFILES += cmd-halt_mod-commands_i386_pc_halt.lst fs-halt_mod-commands_i386_p COMMANDFILES += cmd-halt_mod-commands_i386_pc_halt.lst FSFILES += fs-halt_mod-commands_i386_pc_halt.lst -cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c gencmdlist.sh +cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) -fs-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c genfslist.sh +fs-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) @@ -1460,7 +1457,7 @@ und-serial.lst: pre-serial.o echo 'serial' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c +serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< -include serial_mod-term_i386_pc_serial.d @@ -1468,10 +1465,10 @@ CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_ COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst FSFILES += fs-serial_mod-term_i386_pc_serial.lst -cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c gencmdlist.sh +cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) -fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c genfslist.sh +fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) @@ -1515,7 +1512,7 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c +_multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot.d @@ -1523,14 +1520,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod- COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst -cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c gencmdlist.sh +cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c genfslist.sh +fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c +_multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot2.d @@ -1538,14 +1535,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot2.lst -cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c +_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d @@ -1553,14 +1550,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_ COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c +_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d @@ -1568,10 +1565,10 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-l COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c genfslist.sh +fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1612,7 +1609,7 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c +multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d @@ -1620,10 +1617,10 @@ CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_ COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c gencmdlist.sh +cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c genfslist.sh +fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -1665,7 +1662,7 @@ und-vbe.lst: pre-vbe.o echo 'vbe' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -vbe_mod-video_i386_pc_vbe.o: video/i386/pc/vbe.c +vbe_mod-video_i386_pc_vbe.o: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbe.d @@ -1673,14 +1670,14 @@ CLEANFILES += cmd-vbe_mod-video_i386_pc_vbe.lst fs-vbe_mod-video_i386_pc_vbe.lst COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbe.lst FSFILES += fs-vbe_mod-video_i386_pc_vbe.lst -cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c gencmdlist.sh +cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) -fs-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c genfslist.sh +fs-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) -vbe_mod-video_i386_pc_vbeblit.o: video/i386/pc/vbeblit.c +vbe_mod-video_i386_pc_vbeblit.o: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbeblit.d @@ -1688,14 +1685,14 @@ CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst fs-vbe_mod-video_i386_pc_vbe COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst FSFILES += fs-vbe_mod-video_i386_pc_vbeblit.lst -cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c gencmdlist.sh +cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) -fs-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c genfslist.sh +fs-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) -vbe_mod-video_i386_pc_vbefill.o: video/i386/pc/vbefill.c +vbe_mod-video_i386_pc_vbefill.o: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbefill.d @@ -1703,14 +1700,14 @@ CLEANFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst fs-vbe_mod-video_i386_pc_vbe COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst FSFILES += fs-vbe_mod-video_i386_pc_vbefill.lst -cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c gencmdlist.sh +cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) -fs-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c genfslist.sh +fs-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) -vbe_mod-video_i386_pc_vbeutil.o: video/i386/pc/vbeutil.c +vbe_mod-video_i386_pc_vbeutil.o: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbeutil.d @@ -1718,10 +1715,10 @@ CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeutil.lst fs-vbe_mod-video_i386_pc_vbe COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeutil.lst FSFILES += fs-vbe_mod-video_i386_pc_vbeutil.lst -cmd-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c gencmdlist.sh +cmd-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) -fs-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c genfslist.sh +fs-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) @@ -1762,7 +1759,7 @@ und-vbeinfo.lst: pre-vbeinfo.o echo 'vbeinfo' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -vbeinfo_mod-commands_i386_pc_vbeinfo.o: commands/i386/pc/vbeinfo.c +vbeinfo_mod-commands_i386_pc_vbeinfo.o: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -MD -c -o $@ $< -include vbeinfo_mod-commands_i386_pc_vbeinfo.d @@ -1770,10 +1767,10 @@ CLEANFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst fs-vbeinfo_mod-comman COMMANDFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst FSFILES += fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst -cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c gencmdlist.sh +cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1) -fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c genfslist.sh +fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1) @@ -1814,7 +1811,7 @@ und-vbetest.lst: pre-vbetest.o echo 'vbetest' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -vbetest_mod-commands_i386_pc_vbetest.o: commands/i386/pc/vbetest.c +vbetest_mod-commands_i386_pc_vbetest.o: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -MD -c -o $@ $< -include vbetest_mod-commands_i386_pc_vbetest.d @@ -1822,10 +1819,10 @@ CLEANFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst fs-vbetest_mod-comman COMMANDFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst FSFILES += fs-vbetest_mod-commands_i386_pc_vbetest.lst -cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c gencmdlist.sh +cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1) -fs-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c genfslist.sh +fs-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1) @@ -1866,7 +1863,7 @@ und-play.lst: pre-play.o echo 'play' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c +play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -MD -c -o $@ $< -include play_mod-commands_i386_pc_play.d @@ -1874,10 +1871,10 @@ CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_p COMMANDFILES += cmd-play_mod-commands_i386_pc_play.lst FSFILES += fs-play_mod-commands_i386_pc_play.lst -cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c gencmdlist.sh +cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) -fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c genfslist.sh +fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) @@ -1918,7 +1915,7 @@ und-video.lst: pre-video.o echo 'video' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -video_mod-video_video.o: video/video.c +video_mod-video_video.o: video/video.c $(video/video.c_DEPENDENCIES) $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -MD -c -o $@ $< -include video_mod-video_video.d @@ -1926,10 +1923,10 @@ CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst COMMANDFILES += cmd-video_mod-video_video.lst FSFILES += fs-video_mod-video_video.lst -cmd-video_mod-video_video.lst: video/video.c gencmdlist.sh +cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) -fs-video_mod-video_video.lst: video/video.c genfslist.sh +fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) @@ -1970,7 +1967,7 @@ und-gfxterm.lst: pre-gfxterm.o echo 'gfxterm' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -gfxterm_mod-term_gfxterm.o: term/gfxterm.c +gfxterm_mod-term_gfxterm.o: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -MD -c -o $@ $< -include gfxterm_mod-term_gfxterm.d @@ -1978,10 +1975,10 @@ CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst FSFILES += fs-gfxterm_mod-term_gfxterm.lst -cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c gencmdlist.sh +cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) -fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c genfslist.sh +fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) @@ -2022,7 +2019,7 @@ und-videotest.lst: pre-videotest.o echo 'videotest' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -videotest_mod-commands_videotest.o: commands/videotest.c +videotest_mod-commands_videotest.o: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -MD -c -o $@ $< -include videotest_mod-commands_videotest.d @@ -2030,10 +2027,10 @@ CLEANFILES += cmd-videotest_mod-commands_videotest.lst fs-videotest_mod-commands COMMANDFILES += cmd-videotest_mod-commands_videotest.lst FSFILES += fs-videotest_mod-commands_videotest.lst -cmd-videotest_mod-commands_videotest.lst: commands/videotest.c gencmdlist.sh +cmd-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1) -fs-videotest_mod-commands_videotest.lst: commands/videotest.c genfslist.sh +fs-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1) @@ -2074,7 +2071,7 @@ und-bitmap.lst: pre-bitmap.o echo 'bitmap' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -bitmap_mod-video_bitmap.o: video/bitmap.c +bitmap_mod-video_bitmap.o: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -MD -c -o $@ $< -include bitmap_mod-video_bitmap.d @@ -2082,10 +2079,10 @@ CLEANFILES += cmd-bitmap_mod-video_bitmap.lst fs-bitmap_mod-video_bitmap.lst COMMANDFILES += cmd-bitmap_mod-video_bitmap.lst FSFILES += fs-bitmap_mod-video_bitmap.lst -cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c gencmdlist.sh +cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bitmap > $@ || (rm -f $@; exit 1) -fs-bitmap_mod-video_bitmap.lst: video/bitmap.c genfslist.sh +fs-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bitmap > $@ || (rm -f $@; exit 1) @@ -2126,7 +2123,7 @@ und-tga.lst: pre-tga.o echo 'tga' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -tga_mod-video_readers_tga.o: video/readers/tga.c +tga_mod-video_readers_tga.o: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -MD -c -o $@ $< -include tga_mod-video_readers_tga.d @@ -2134,10 +2131,10 @@ CLEANFILES += cmd-tga_mod-video_readers_tga.lst fs-tga_mod-video_readers_tga.lst COMMANDFILES += cmd-tga_mod-video_readers_tga.lst FSFILES += fs-tga_mod-video_readers_tga.lst -cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c gencmdlist.sh +cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tga > $@ || (rm -f $@; exit 1) -fs-tga_mod-video_readers_tga.lst: video/readers/tga.c genfslist.sh +fs-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tga > $@ || (rm -f $@; exit 1) @@ -2178,7 +2175,7 @@ und-cpuid.lst: pre-cpuid.o echo 'cpuid' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c +cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d @@ -2186,10 +2183,10 @@ CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_c COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c gencmdlist.sh +cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c genfslist.sh +fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) @@ -2230,7 +2227,7 @@ und-ata.lst: pre-ata.o echo 'ata' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ata_mod-disk_ata.o: disk/ata.c +ata_mod-disk_ata.o: disk/ata.c $(disk/ata.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $< -include ata_mod-disk_ata.d @@ -2238,10 +2235,10 @@ CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst COMMANDFILES += cmd-ata_mod-disk_ata.lst FSFILES += fs-ata_mod-disk_ata.lst -cmd-ata_mod-disk_ata.lst: disk/ata.c gencmdlist.sh +cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) -fs-ata_mod-disk_ata.lst: disk/ata.c genfslist.sh +fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) @@ -2282,7 +2279,7 @@ und-vga.lst: pre-vga.o echo 'vga' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -vga_mod-term_i386_pc_vga.o: term/i386/pc/vga.c +vga_mod-term_i386_pc_vga.o: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -MD -c -o $@ $< -include vga_mod-term_i386_pc_vga.d @@ -2290,10 +2287,10 @@ CLEANFILES += cmd-vga_mod-term_i386_pc_vga.lst fs-vga_mod-term_i386_pc_vga.lst COMMANDFILES += cmd-vga_mod-term_i386_pc_vga.lst FSFILES += fs-vga_mod-term_i386_pc_vga.lst -cmd-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c gencmdlist.sh +cmd-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga > $@ || (rm -f $@; exit 1) -fs-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c genfslist.sh +fs-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga > $@ || (rm -f $@; exit 1) @@ -2334,7 +2331,7 @@ und-memdisk.lst: pre-memdisk.o echo 'memdisk' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -memdisk_mod-disk_memdisk.o: disk/memdisk.c +memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< -include memdisk_mod-disk_memdisk.d @@ -2342,10 +2339,10 @@ CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst FSFILES += fs-memdisk_mod-disk_memdisk.lst -cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c gencmdlist.sh +cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) -fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c genfslist.sh +fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) @@ -2386,7 +2383,7 @@ und-jpeg.lst: pre-jpeg.o echo 'jpeg' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -jpeg_mod-video_readers_jpeg.o: video/readers/jpeg.c +jpeg_mod-video_readers_jpeg.o: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -MD -c -o $@ $< -include jpeg_mod-video_readers_jpeg.d @@ -2394,10 +2391,10 @@ CLEANFILES += cmd-jpeg_mod-video_readers_jpeg.lst fs-jpeg_mod-video_readers_jpeg COMMANDFILES += cmd-jpeg_mod-video_readers_jpeg.lst FSFILES += fs-jpeg_mod-video_readers_jpeg.lst -cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c gencmdlist.sh +cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jpeg > $@ || (rm -f $@; exit 1) -fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c genfslist.sh +fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jpeg > $@ || (rm -f $@; exit 1) @@ -2438,7 +2435,7 @@ und-png.lst: pre-png.o echo 'png' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -png_mod-video_readers_png.o: video/readers/png.c +png_mod-video_readers_png.o: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -MD -c -o $@ $< -include png_mod-video_readers_png.d @@ -2446,10 +2443,10 @@ CLEANFILES += cmd-png_mod-video_readers_png.lst fs-png_mod-video_readers_png.lst COMMANDFILES += cmd-png_mod-video_readers_png.lst FSFILES += fs-png_mod-video_readers_png.lst -cmd-png_mod-video_readers_png.lst: video/readers/png.c gencmdlist.sh +cmd-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) -fs-png_mod-video_readers_png.lst: video/readers/png.c genfslist.sh +fs-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index fb435bc79..f4d7a08e8 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -89,8 +89,6 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ @@ -166,7 +164,6 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index a37c53574..b7b262f4f 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -5,6 +5,10 @@ COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__ COMMON_CFLAGS = -ffreestanding -msoft-float COMMON_LDFLAGS += -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst @@ -77,8 +81,6 @@ grub_mkdevicemap-util_ieee1275_get_disk_name.o: util/ieee1275/get_disk_name.c $( # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ @@ -95,7 +97,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ - kern/term.c \ + kern/term.c fs/fshelp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -106,11 +108,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/biosdisk.c util/getroot.c \ util/powerpc/ieee1275/misc.c grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -292,6 +294,10 @@ grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_term.d +grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_fshelp.d + grub_emu-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_arg.d @@ -417,103 +423,103 @@ MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_powe kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) -kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S +kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S $(kern/powerpc/ieee1275/crt0.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_crt0.d -kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c +kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c $(kern/powerpc/ieee1275/cmain.c_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_cmain.d -kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c +kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_ieee1275.d -kernel_elf-kern_main.o: kern/main.c +kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_main.d -kernel_elf-kern_device.o: kern/device.c +kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_device.d -kernel_elf-kern_disk.o: kern/disk.c +kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_disk.d -kernel_elf-kern_dl.o: kern/dl.c +kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_dl.d -kernel_elf-kern_err.o: kern/err.c +kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_err.d -kernel_elf-kern_file.o: kern/file.c +kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_file.d -kernel_elf-kern_fs.o: kern/fs.c +kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_fs.d -kernel_elf-kern_misc.o: kern/misc.c +kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_misc.d -kernel_elf-kern_mm.o: kern/mm.c +kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_mm.d -kernel_elf-kern_loader.o: kern/loader.c +kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_loader.d -kernel_elf-kern_rescue.o: kern/rescue.c +kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_rescue.d -kernel_elf-kern_term.o: kern/term.c +kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_term.d -kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c +kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c $(kern/powerpc/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_init.d -kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c +kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_ieee1275_ofconsole.d -kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c +kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c $(kern/powerpc/ieee1275/openfw.c_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_openfw.d -kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c +kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-disk_ieee1275_ofdisk.d -kernel_elf-kern_parser.o: kern/parser.c +kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_parser.d -kernel_elf-kern_partition.o: kern/partition.c +kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_partition.d -kernel_elf-kern_env.o: kern/env.c +kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d -kernel_elf-kern_powerpc_dl.o: kern/powerpc/dl.c +kernel_elf-kern_powerpc_dl.o: kern/powerpc/dl.c $(kern/powerpc/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_dl.d -kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c +kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c $(kernel_elf_symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kernel_elf_symlist.d -kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S +kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S $(kern/powerpc/cache.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_cache.d @@ -531,7 +537,7 @@ bin_SCRIPTS = grub-mkrescue grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in CLEANFILES += grub-install -grub-install: util/powerpc/ieee1275/grub-install.in config.status +grub-install: util/powerpc/ieee1275/grub-install.in $(util/powerpc/ieee1275/grub-install.in_DEPENDENCIES) config.status ./config.status --file=grub-install:util/powerpc/ieee1275/grub-install.in chmod +x $@ @@ -540,7 +546,7 @@ grub-install: util/powerpc/ieee1275/grub-install.in config.status grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in CLEANFILES += grub-mkrescue -grub-mkrescue: util/powerpc/ieee1275/grub-mkrescue.in config.status +grub-mkrescue: util/powerpc/ieee1275/grub-mkrescue.in $(util/powerpc/ieee1275/grub-mkrescue.in_DEPENDENCIES) config.status ./config.status --file=grub-mkrescue:util/powerpc/ieee1275/grub-mkrescue.in chmod +x $@ @@ -589,7 +595,7 @@ und-_linux.lst: pre-_linux.o echo '_linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c +_linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_powerpc_ieee1275_linux.d @@ -597,10 +603,10 @@ CLEANFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst fs-_linux_mod-loa COMMANDFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst FSFILES += fs-_linux_mod-loader_powerpc_ieee1275_linux.lst -cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c gencmdlist.sh +cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) -fs-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c genfslist.sh +fs-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) @@ -641,7 +647,7 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_powerpc_ieee1275_linux_normal.o: loader/powerpc/ieee1275/linux_normal.c +linux_mod-loader_powerpc_ieee1275_linux_normal.o: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_powerpc_ieee1275_linux_normal.d @@ -649,10 +655,10 @@ CLEANFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst fs-linux_mo COMMANDFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst -cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c gencmdlist.sh +cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c genfslist.sh +fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) @@ -660,7 +666,6 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -698,7 +703,7 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c +normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d @@ -706,14 +711,14 @@ CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst -cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh +cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh +fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_cmdline.o: normal/cmdline.c +normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -721,14 +726,14 @@ CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh +cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh +fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_command.o: normal/command.c +normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d @@ -736,14 +741,14 @@ CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst -cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh +cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh +fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_completion.o: normal/completion.c +normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d @@ -751,14 +756,14 @@ CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completi COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst -cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh +cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh +fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_execute.o: normal/execute.c +normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -766,14 +771,14 @@ CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst -cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh +cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh +fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_function.o: normal/function.c +normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d @@ -781,14 +786,14 @@ CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.l COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst -cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh +cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh +fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_lexer.o: normal/lexer.c +normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d @@ -796,14 +801,14 @@ CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst -cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh +cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh +fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_main.o: normal/main.c +normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d @@ -811,14 +816,14 @@ CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst -cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh +cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh +fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu.o: normal/menu.c +normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d @@ -826,14 +831,14 @@ CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst -cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh +cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh +fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu_entry.o: normal/menu_entry.c +normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -841,14 +846,14 @@ CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_ent COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh +cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh +fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_misc.o: normal/misc.c +normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d @@ -856,14 +861,14 @@ CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst -cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh +cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh +fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-grub_script_tab.o: grub_script.tab.c +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d @@ -871,14 +876,14 @@ CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.l COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_script.o: normal/script.c +normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d @@ -886,14 +891,14 @@ CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst -cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh +cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh +fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S +normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_powerpc_setjmp.d @@ -901,14 +906,14 @@ CLEANFILES += cmd-normal_mod-normal_powerpc_setjmp.lst fs-normal_mod-normal_powe COMMANDFILES += cmd-normal_mod-normal_powerpc_setjmp.lst FSFILES += fs-normal_mod-normal_powerpc_setjmp.lst -cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S gencmdlist.sh +cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S genfslist.sh +fs-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d @@ -916,10 +921,10 @@ CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst -cmd-normal_mod-normal_color.lst: normal/color.c gencmdlist.sh +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_color.lst: normal/color.c genfslist.sh +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) @@ -961,7 +966,7 @@ und-suspend.lst: pre-suspend.o echo 'suspend' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c +suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< -include suspend_mod-commands_ieee1275_suspend.d @@ -969,10 +974,10 @@ CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-comma COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst -cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c gencmdlist.sh +cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) -fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c genfslist.sh +fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) @@ -1013,7 +1018,7 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c +reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_ieee1275_reboot.d @@ -1021,10 +1026,10 @@ CLEANFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst fs-reboot_mod-commands COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst -cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c gencmdlist.sh +cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c genfslist.sh +fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1065,7 +1070,7 @@ und-halt.lst: pre-halt.o echo 'halt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c +halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_ieee1275_halt.d @@ -1073,10 +1078,10 @@ CLEANFILES += cmd-halt_mod-commands_ieee1275_halt.lst fs-halt_mod-commands_ieee1 COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst FSFILES += fs-halt_mod-commands_ieee1275_halt.lst -cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c gencmdlist.sh +cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) -fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c genfslist.sh +fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) @@ -1119,7 +1124,7 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_powerpc_ieee1275_multiboot2.o: loader/powerpc/ieee1275/multiboot2.c +_multiboot_mod-loader_powerpc_ieee1275_multiboot2.o: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_powerpc_ieee1275_multiboot2.d @@ -1127,14 +1132,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst fs-_mult COMMANDFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst -cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c +_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d @@ -1142,14 +1147,14 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_ COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c genfslist.sh +fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c +_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d @@ -1157,10 +1162,10 @@ CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-l COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c gencmdlist.sh +cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c genfslist.sh +fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1201,7 +1206,7 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c +multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d @@ -1209,10 +1214,10 @@ CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_ COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c gencmdlist.sh +cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c genfslist.sh +fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 4e4f31765..f742267f8 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -5,6 +5,10 @@ COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__ COMMON_CFLAGS = -ffreestanding -msoft-float COMMON_LDFLAGS += -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst @@ -41,8 +45,6 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -normal/execute.c_DEPENDENCIES = grub_script.tab.h -grub-emu_DEPENDENCIES = grub_script.tab.c grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ @@ -59,7 +61,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ - kern/term.c \ + kern/term.c fs/fshelp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -118,7 +120,6 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 3fae6e567..430260ab0 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -5,6 +5,10 @@ COMMON_ASFLAGS = -nostdinc COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst @@ -77,95 +81,95 @@ MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o $(TARGET_CC) -o $@ kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) -kernel_elf-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c +kernel_elf-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c $(kern/sparc64/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_sparc64_ieee1275_init.d -kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c +kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_ieee1275.d -kernel_elf-kern_main.o: kern/main.c +kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_main.d -kernel_elf-kern_device.o: kern/device.c +kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_device.d -kernel_elf-kern_disk.o: kern/disk.c +kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_disk.d -kernel_elf-kern_dl.o: kern/dl.c +kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_dl.d -kernel_elf-kern_file.o: kern/file.c +kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_file.d -kernel_elf-kern_fs.o: kern/fs.c +kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_fs.d -kernel_elf-kern_err.o: kern/err.c +kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_err.d -kernel_elf-kern_misc.o: kern/misc.c +kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_misc.d -kernel_elf-kern_mm.o: kern/mm.c +kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_mm.d -kernel_elf-kern_loader.o: kern/loader.c +kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_loader.d -kernel_elf-kern_rescue.o: kern/rescue.c +kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_rescue.d -kernel_elf-kern_term.o: kern/term.c +kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_term.d -kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c +kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_ieee1275_ofconsole.d -kernel_elf-kern_sparc64_ieee1275_openfw.o: kern/sparc64/ieee1275/openfw.c +kernel_elf-kern_sparc64_ieee1275_openfw.o: kern/sparc64/ieee1275/openfw.c $(kern/sparc64/ieee1275/openfw.c_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_sparc64_ieee1275_openfw.d -kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c +kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-disk_ieee1275_ofdisk.d -kernel_elf-kern_partition.o: kern/partition.c +kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_partition.d -kernel_elf-kern_env.o: kern/env.c +kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d -kernel_elf-kern_sparc64_dl.o: kern/sparc64/dl.c +kernel_elf-kern_sparc64_dl.o: kern/sparc64/dl.c $(kern/sparc64/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_sparc64_dl.d -kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c +kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c $(kernel_elf_symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kernel_elf_symlist.d -kernel_elf-kern_sparc64_cache.o: kern/sparc64/cache.S +kernel_elf-kern_sparc64_cache.o: kern/sparc64/cache.S $(kern/sparc64/cache.S_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_sparc64_cache.d -kernel_elf-kern_parser.o: kern/parser.c +kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_parser.d @@ -217,7 +221,7 @@ und-fshelp.lst: pre-fshelp.o echo 'fshelp' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -fshelp_mod-fs_fshelp.o: fs/fshelp.c +fshelp_mod-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -MD -c -o $@ $< -include fshelp_mod-fs_fshelp.d @@ -225,10 +229,10 @@ CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst FSFILES += fs-fshelp_mod-fs_fshelp.lst -cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c gencmdlist.sh +cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) -fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c genfslist.sh +fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) @@ -269,7 +273,7 @@ und-fat.lst: pre-fat.o echo 'fat' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -fat_mod-fs_fat.o: fs/fat.c +fat_mod-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -MD -c -o $@ $< -include fat_mod-fs_fat.d @@ -277,10 +281,10 @@ CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst COMMANDFILES += cmd-fat_mod-fs_fat.lst FSFILES += fs-fat_mod-fs_fat.lst -cmd-fat_mod-fs_fat.lst: fs/fat.c gencmdlist.sh +cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) -fs-fat_mod-fs_fat.lst: fs/fat.c genfslist.sh +fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) @@ -321,7 +325,7 @@ und-ext2.lst: pre-ext2.o echo 'ext2' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ext2_mod-fs_ext2.o: fs/ext2.c +ext2_mod-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -MD -c -o $@ $< -include ext2_mod-fs_ext2.d @@ -329,10 +333,10 @@ CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst COMMANDFILES += cmd-ext2_mod-fs_ext2.lst FSFILES += fs-ext2_mod-fs_ext2.lst -cmd-ext2_mod-fs_ext2.lst: fs/ext2.c gencmdlist.sh +cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) -fs-ext2_mod-fs_ext2.lst: fs/ext2.c genfslist.sh +fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) @@ -373,7 +377,7 @@ und-ufs.lst: pre-ufs.o echo 'ufs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ufs_mod-fs_ufs.o: fs/ufs.c +ufs_mod-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -MD -c -o $@ $< -include ufs_mod-fs_ufs.d @@ -381,10 +385,10 @@ CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst COMMANDFILES += cmd-ufs_mod-fs_ufs.lst FSFILES += fs-ufs_mod-fs_ufs.lst -cmd-ufs_mod-fs_ufs.lst: fs/ufs.c gencmdlist.sh +cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) -fs-ufs_mod-fs_ufs.lst: fs/ufs.c genfslist.sh +fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) @@ -425,7 +429,7 @@ und-minix.lst: pre-minix.o echo 'minix' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -minix_mod-fs_minix.o: fs/minix.c +minix_mod-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -MD -c -o $@ $< -include minix_mod-fs_minix.d @@ -433,10 +437,10 @@ CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst COMMANDFILES += cmd-minix_mod-fs_minix.lst FSFILES += fs-minix_mod-fs_minix.lst -cmd-minix_mod-fs_minix.lst: fs/minix.c gencmdlist.sh +cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) -fs-minix_mod-fs_minix.lst: fs/minix.c genfslist.sh +fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) @@ -477,7 +481,7 @@ und-hfs.lst: pre-hfs.o echo 'hfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -hfs_mod-fs_hfs.o: fs/hfs.c +hfs_mod-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -MD -c -o $@ $< -include hfs_mod-fs_hfs.d @@ -485,10 +489,10 @@ CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst COMMANDFILES += cmd-hfs_mod-fs_hfs.lst FSFILES += fs-hfs_mod-fs_hfs.lst -cmd-hfs_mod-fs_hfs.lst: fs/hfs.c gencmdlist.sh +cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) -fs-hfs_mod-fs_hfs.lst: fs/hfs.c genfslist.sh +fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) @@ -529,7 +533,7 @@ und-jfs.lst: pre-jfs.o echo 'jfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -jfs_mod-fs_jfs.o: fs/jfs.c +jfs_mod-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -MD -c -o $@ $< -include jfs_mod-fs_jfs.d @@ -537,10 +541,10 @@ CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst COMMANDFILES += cmd-jfs_mod-fs_jfs.lst FSFILES += fs-jfs_mod-fs_jfs.lst -cmd-jfs_mod-fs_jfs.lst: fs/jfs.c gencmdlist.sh +cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) -fs-jfs_mod-fs_jfs.lst: fs/jfs.c genfslist.sh +fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) @@ -586,7 +590,7 @@ und-xfs.lst: pre-xfs.o echo 'xfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -xfs_mod-fs_xfs.o: fs/xfs.c +xfs_mod-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -MD -c -o $@ $< -include xfs_mod-fs_xfs.d @@ -594,10 +598,10 @@ CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst COMMANDFILES += cmd-xfs_mod-fs_xfs.lst FSFILES += fs-xfs_mod-fs_xfs.lst -cmd-xfs_mod-fs_xfs.lst: fs/xfs.c gencmdlist.sh +cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) -fs-xfs_mod-fs_xfs.lst: fs/xfs.c genfslist.sh +fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) @@ -638,7 +642,7 @@ und-affs.lst: pre-affs.o echo 'affs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -affs_mod-fs_affs.o: fs/affs.c +affs_mod-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -MD -c -o $@ $< -include affs_mod-fs_affs.d @@ -646,10 +650,10 @@ CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst COMMANDFILES += cmd-affs_mod-fs_affs.lst FSFILES += fs-affs_mod-fs_affs.lst -cmd-affs_mod-fs_affs.lst: fs/affs.c gencmdlist.sh +cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) -fs-affs_mod-fs_affs.lst: fs/affs.c genfslist.sh +fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) @@ -690,7 +694,7 @@ und-sfs.lst: pre-sfs.o echo 'sfs' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -sfs_mod-fs_sfs.o: fs/sfs.c +sfs_mod-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -MD -c -o $@ $< -include sfs_mod-fs_sfs.d @@ -698,10 +702,10 @@ CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst COMMANDFILES += cmd-sfs_mod-fs_sfs.lst FSFILES += fs-sfs_mod-fs_sfs.lst -cmd-sfs_mod-fs_sfs.lst: fs/sfs.c gencmdlist.sh +cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) -fs-sfs_mod-fs_sfs.lst: fs/sfs.c genfslist.sh +fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) @@ -719,7 +723,6 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) #linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -758,7 +761,7 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c +normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d @@ -766,14 +769,14 @@ CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst -cmd-normal_mod-normal_arg.lst: normal/arg.c gencmdlist.sh +cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_arg.lst: normal/arg.c genfslist.sh +fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_cmdline.o: normal/cmdline.c +normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -781,14 +784,14 @@ CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c gencmdlist.sh +cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c genfslist.sh +fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_command.o: normal/command.c +normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d @@ -796,14 +799,14 @@ CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst -cmd-normal_mod-normal_command.lst: normal/command.c gencmdlist.sh +cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_command.lst: normal/command.c genfslist.sh +fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_completion.o: normal/completion.c +normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d @@ -811,14 +814,14 @@ CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completi COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst -cmd-normal_mod-normal_completion.lst: normal/completion.c gencmdlist.sh +cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_completion.lst: normal/completion.c genfslist.sh +fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_execute.o: normal/execute.c +normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -826,14 +829,14 @@ CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst -cmd-normal_mod-normal_execute.lst: normal/execute.c gencmdlist.sh +cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_execute.lst: normal/execute.c genfslist.sh +fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_function.o: normal/function.c +normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d @@ -841,14 +844,14 @@ CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.l COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst -cmd-normal_mod-normal_function.lst: normal/function.c gencmdlist.sh +cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_function.lst: normal/function.c genfslist.sh +fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_lexer.o: normal/lexer.c +normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d @@ -856,14 +859,14 @@ CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst -cmd-normal_mod-normal_lexer.lst: normal/lexer.c gencmdlist.sh +cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_lexer.lst: normal/lexer.c genfslist.sh +fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_main.o: normal/main.c +normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d @@ -871,14 +874,14 @@ CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst -cmd-normal_mod-normal_main.lst: normal/main.c gencmdlist.sh +cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_main.lst: normal/main.c genfslist.sh +fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu.o: normal/menu.c +normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d @@ -886,14 +889,14 @@ CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst -cmd-normal_mod-normal_menu.lst: normal/menu.c gencmdlist.sh +cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu.lst: normal/menu.c genfslist.sh +fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_menu_entry.o: normal/menu_entry.c +normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -901,14 +904,14 @@ CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_ent COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c gencmdlist.sh +cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c genfslist.sh +fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_misc.o: normal/misc.c +normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d @@ -916,14 +919,14 @@ CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst -cmd-normal_mod-normal_misc.lst: normal/misc.c gencmdlist.sh +cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_misc.lst: normal/misc.c genfslist.sh +fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_script.o: normal/script.c +normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d @@ -931,14 +934,14 @@ CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst -cmd-normal_mod-normal_script.lst: normal/script.c gencmdlist.sh +cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_script.lst: normal/script.c genfslist.sh +fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_sparc64_setjmp.o: normal/sparc64/setjmp.S +normal_mod-normal_sparc64_setjmp.o: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_sparc64_setjmp.d @@ -946,14 +949,14 @@ CLEANFILES += cmd-normal_mod-normal_sparc64_setjmp.lst fs-normal_mod-normal_spar COMMANDFILES += cmd-normal_mod-normal_sparc64_setjmp.lst FSFILES += fs-normal_mod-normal_sparc64_setjmp.lst -cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S gencmdlist.sh +cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S genfslist.sh +fs-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-grub_script_tab.o: grub_script.tab.c +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d @@ -961,10 +964,10 @@ CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.l COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c gencmdlist.sh +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c genfslist.sh +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) @@ -1006,7 +1009,7 @@ und-hello.lst: pre-hello.o echo 'hello' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -hello_mod-hello_hello.o: hello/hello.c +hello_mod-hello_hello.o: hello/hello.c $(hello/hello.c_DEPENDENCIES) $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -MD -c -o $@ $< -include hello_mod-hello_hello.d @@ -1014,10 +1017,10 @@ CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst COMMANDFILES += cmd-hello_mod-hello_hello.lst FSFILES += fs-hello_mod-hello_hello.lst -cmd-hello_mod-hello_hello.lst: hello/hello.c gencmdlist.sh +cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) -fs-hello_mod-hello_hello.lst: hello/hello.c genfslist.sh +fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) @@ -1058,7 +1061,7 @@ und-boot.lst: pre-boot.o echo 'boot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -boot_mod-commands_boot.o: commands/boot.c +boot_mod-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -MD -c -o $@ $< -include boot_mod-commands_boot.d @@ -1066,10 +1069,10 @@ CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst COMMANDFILES += cmd-boot_mod-commands_boot.lst FSFILES += fs-boot_mod-commands_boot.lst -cmd-boot_mod-commands_boot.lst: commands/boot.c gencmdlist.sh +cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) -fs-boot_mod-commands_boot.lst: commands/boot.c genfslist.sh +fs-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) @@ -1110,7 +1113,7 @@ und-terminal.lst: pre-terminal.o echo 'terminal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -terminal_mod-commands_terminal.o: commands/terminal.c +terminal_mod-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -MD -c -o $@ $< -include terminal_mod-commands_terminal.d @@ -1118,10 +1121,10 @@ CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_te COMMANDFILES += cmd-terminal_mod-commands_terminal.lst FSFILES += fs-terminal_mod-commands_terminal.lst -cmd-terminal_mod-commands_terminal.lst: commands/terminal.c gencmdlist.sh +cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) -fs-terminal_mod-commands_terminal.lst: commands/terminal.c genfslist.sh +fs-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) @@ -1162,7 +1165,7 @@ und-ls.lst: pre-ls.o echo 'ls' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -ls_mod-commands_ls.o: commands/ls.c +ls_mod-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -MD -c -o $@ $< -include ls_mod-commands_ls.d @@ -1170,10 +1173,10 @@ CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst COMMANDFILES += cmd-ls_mod-commands_ls.lst FSFILES += fs-ls_mod-commands_ls.lst -cmd-ls_mod-commands_ls.lst: commands/ls.c gencmdlist.sh +cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) -fs-ls_mod-commands_ls.lst: commands/ls.c genfslist.sh +fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) @@ -1214,7 +1217,7 @@ und-cmp.lst: pre-cmp.o echo 'cmp' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cmp_mod-commands_cmp.o: commands/cmp.c +cmp_mod-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -MD -c -o $@ $< -include cmp_mod-commands_cmp.d @@ -1222,10 +1225,10 @@ CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst COMMANDFILES += cmd-cmp_mod-commands_cmp.lst FSFILES += fs-cmp_mod-commands_cmp.lst -cmd-cmp_mod-commands_cmp.lst: commands/cmp.c gencmdlist.sh +cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) -fs-cmp_mod-commands_cmp.lst: commands/cmp.c genfslist.sh +fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) @@ -1266,7 +1269,7 @@ und-cat.lst: pre-cat.o echo 'cat' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -cat_mod-commands_cat.o: commands/cat.c +cat_mod-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -MD -c -o $@ $< -include cat_mod-commands_cat.d @@ -1274,10 +1277,10 @@ CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst COMMANDFILES += cmd-cat_mod-commands_cat.lst FSFILES += fs-cat_mod-commands_cat.lst -cmd-cat_mod-commands_cat.lst: commands/cat.c gencmdlist.sh +cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) -fs-cat_mod-commands_cat.lst: commands/cat.c genfslist.sh +fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) @@ -1318,7 +1321,7 @@ und-font.lst: pre-font.o echo 'font' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -font_mod-font_manager.o: font/manager.c +font_mod-font_manager.o: font/manager.c $(font/manager.c_DEPENDENCIES) $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< -include font_mod-font_manager.d @@ -1326,10 +1329,10 @@ CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst COMMANDFILES += cmd-font_mod-font_manager.lst FSFILES += fs-font_mod-font_manager.lst -cmd-font_mod-font_manager.lst: font/manager.c gencmdlist.sh +cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) -fs-font_mod-font_manager.lst: font/manager.c genfslist.sh +fs-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) @@ -1370,7 +1373,7 @@ und-amiga.lst: pre-amiga.o echo 'amiga' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -amiga_mod-partmap_amiga.o: partmap/amiga.c +amiga_mod-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -MD -c -o $@ $< -include amiga_mod-partmap_amiga.d @@ -1378,10 +1381,10 @@ CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst FSFILES += fs-amiga_mod-partmap_amiga.lst -cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c gencmdlist.sh +cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) -fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c genfslist.sh +fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) @@ -1422,7 +1425,7 @@ und-apple.lst: pre-apple.o echo 'apple' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -apple_mod-partmap_apple.o: partmap/apple.c +apple_mod-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -MD -c -o $@ $< -include apple_mod-partmap_apple.d @@ -1430,10 +1433,10 @@ CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst COMMANDFILES += cmd-apple_mod-partmap_apple.lst FSFILES += fs-apple_mod-partmap_apple.lst -cmd-apple_mod-partmap_apple.lst: partmap/apple.c gencmdlist.sh +cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) -fs-apple_mod-partmap_apple.lst: partmap/apple.c genfslist.sh +fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) @@ -1474,7 +1477,7 @@ und-pc.lst: pre-pc.o echo 'pc' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -pc_mod-partmap_pc.o: partmap/pc.c +pc_mod-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -MD -c -o $@ $< -include pc_mod-partmap_pc.d @@ -1482,10 +1485,10 @@ CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst COMMANDFILES += cmd-pc_mod-partmap_pc.lst FSFILES += fs-pc_mod-partmap_pc.lst -cmd-pc_mod-partmap_pc.lst: partmap/pc.c gencmdlist.sh +cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) -fs-pc_mod-partmap_pc.lst: partmap/pc.c genfslist.sh +fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) @@ -1526,7 +1529,7 @@ und-sun.lst: pre-sun.o echo 'sun' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -sun_mod-partmap_sun.o: partmap/sun.c +sun_mod-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -MD -c -o $@ $< -include sun_mod-partmap_sun.d @@ -1534,10 +1537,10 @@ CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst COMMANDFILES += cmd-sun_mod-partmap_sun.lst FSFILES += fs-sun_mod-partmap_sun.lst -cmd-sun_mod-partmap_sun.lst: partmap/sun.c gencmdlist.sh +cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) -fs-sun_mod-partmap_sun.lst: partmap/sun.c genfslist.sh +fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) @@ -1578,7 +1581,7 @@ und-acorn.lst: pre-acorn.o echo 'acorn' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -acorn_mod-partmap_acorn.o: partmap/acorn.c +acorn_mod-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -MD -c -o $@ $< -include acorn_mod-partmap_acorn.d @@ -1586,10 +1589,10 @@ CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst FSFILES += fs-acorn_mod-partmap_acorn.lst -cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c gencmdlist.sh +cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) -fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c genfslist.sh +fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) @@ -1629,7 +1632,7 @@ und-loopback.lst: pre-loopback.o echo 'loopback' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -loopback_mod-disk_loopback.o: disk/loopback.c +loopback_mod-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -MD -c -o $@ $< -include loopback_mod-disk_loopback.d @@ -1637,10 +1640,10 @@ CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.l COMMANDFILES += cmd-loopback_mod-disk_loopback.lst FSFILES += fs-loopback_mod-disk_loopback.lst -cmd-loopback_mod-disk_loopback.lst: disk/loopback.c gencmdlist.sh +cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) -fs-loopback_mod-disk_loopback.lst: disk/loopback.c genfslist.sh +fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) @@ -1681,7 +1684,7 @@ und-suspend.lst: pre-suspend.o echo 'suspend' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c +suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< -include suspend_mod-commands_ieee1275_suspend.d @@ -1689,10 +1692,10 @@ CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-comma COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst -cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c gencmdlist.sh +cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) -fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c genfslist.sh +fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) @@ -1733,7 +1736,7 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c +reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_ieee1275_reboot.d @@ -1741,10 +1744,10 @@ CLEANFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst fs-reboot_mod-commands COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst -cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c gencmdlist.sh +cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c genfslist.sh +fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1785,7 +1788,7 @@ und-halt.lst: pre-halt.o echo 'halt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c +halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_ieee1275_halt.d @@ -1793,10 +1796,10 @@ CLEANFILES += cmd-halt_mod-commands_ieee1275_halt.lst fs-halt_mod-commands_ieee1 COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst FSFILES += fs-halt_mod-commands_ieee1275_halt.lst -cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c gencmdlist.sh +cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) -fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c genfslist.sh +fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) @@ -1837,7 +1840,7 @@ und-help.lst: pre-help.o echo 'help' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -help_mod-commands_help.o: commands/help.c +help_mod-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -MD -c -o $@ $< -include help_mod-commands_help.d @@ -1845,10 +1848,10 @@ CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst COMMANDFILES += cmd-help_mod-commands_help.lst FSFILES += fs-help_mod-commands_help.lst -cmd-help_mod-commands_help.lst: commands/help.c gencmdlist.sh +cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) -fs-help_mod-commands_help.lst: commands/help.c genfslist.sh +fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) @@ -1899,7 +1902,7 @@ und-configfile.lst: pre-configfile.o echo 'configfile' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -configfile_mod-commands_configfile.o: commands/configfile.c +configfile_mod-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -MD -c -o $@ $< -include configfile_mod-commands_configfile.d @@ -1907,10 +1910,10 @@ CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-comma COMMANDFILES += cmd-configfile_mod-commands_configfile.lst FSFILES += fs-configfile_mod-commands_configfile.lst -cmd-configfile_mod-commands_configfile.lst: commands/configfile.c gencmdlist.sh +cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) -fs-configfile_mod-commands_configfile.lst: commands/configfile.c genfslist.sh +fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) @@ -1951,7 +1954,7 @@ und-search.lst: pre-search.o echo 'search' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -search_mod-commands_search.o: commands/search.c +search_mod-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -MD -c -o $@ $< -include search_mod-commands_search.d @@ -1959,10 +1962,10 @@ CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.l COMMANDFILES += cmd-search_mod-commands_search.lst FSFILES += fs-search_mod-commands_search.lst -cmd-search_mod-commands_search.lst: commands/search.c gencmdlist.sh +cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) -fs-search_mod-commands_search.lst: commands/search.c genfslist.sh +fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) @@ -2003,7 +2006,7 @@ und-gzio.lst: pre-gzio.o echo 'gzio' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -gzio_mod-io_gzio.o: io/gzio.c +gzio_mod-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -MD -c -o $@ $< -include gzio_mod-io_gzio.d @@ -2011,10 +2014,10 @@ CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst COMMANDFILES += cmd-gzio_mod-io_gzio.lst FSFILES += fs-gzio_mod-io_gzio.lst -cmd-gzio_mod-io_gzio.lst: io/gzio.c gencmdlist.sh +cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) -fs-gzio_mod-io_gzio.lst: io/gzio.c genfslist.sh +fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 7845de925..58ae9b4a8 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -5,6 +5,10 @@ COMMON_ASFLAGS = -nostdinc COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst @@ -151,7 +155,6 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) #linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. -normal_mod_DEPENDENCIES = grub_script.tab.c grub_script.tab.h normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ diff --git a/genmk.rb b/genmk.rb index 43dbeacf5..d43244dea 100644 --- a/genmk.rb +++ b/genmk.rb @@ -70,7 +70,7 @@ MOSTLYCLEANFILES += #{deps_str} extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end dir = File.dirname(src) - "#{obj}: #{src} + "#{obj}: #{src} $(#{src}_DEPENDENCIES) $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} @@ -146,7 +146,7 @@ endif extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end dir = File.dirname(src) - "#{obj}: #{src} + "#{obj}: #{src} $(#{src}_DEPENDENCIES) $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} @@ -154,12 +154,12 @@ CLEANFILES += #{command} #{fs} COMMANDFILES += #{command} FSFILES += #{fs} -#{command}: #{src} gencmdlist.sh +#{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh set -e; \ $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/gencmdlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) -#{fs}: #{src} genfslist.sh +#{fs}: #{src} $(#{src}_DEPENDENCIES) genfslist.sh set -e; \ $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) @@ -237,7 +237,7 @@ MOSTLYCLEANFILES += #{deps_str} dep = deps[i] dir = File.dirname(src) - "#{obj}: #{src} + "#{obj}: #{src} $(#{src}_DEPENDENCIES) $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -MD -c -o $@ $< -include #{dep} @@ -264,7 +264,7 @@ class Script "CLEANFILES += #{@name} -#{@name}: #{src} config.status +#{@name}: #{src} $(#{src}_DEPENDENCIES) config.status ./config.status --file=#{name}:#{src} chmod +x $@ From f95562bf521b9d0c11c6260222f476074b974638 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 1 Feb 2008 18:54:52 +0000 Subject: [PATCH 0009/1707] 2008-02-01 Robert Millan Correct a mistake in previous commit. * conf/i386-pc.rmk (normal/execute.c_DEPENDENCIES): Move to the top. (normal/command.c_DEPENDENCIES): New variable. --- ChangeLog | 8 ++++++++ conf/i386-pc.mk | 4 ++++ conf/i386-pc.rmk | 4 ++++ 3 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 09fb2a0bd..e386be57a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-01 Robert Millan + + Correct a mistake in previous commit. + + * conf/i386-pc.rmk (normal/execute.c_DEPENDENCIES): Move to the + top. + (normal/command.c_DEPENDENCIES): New variable. + 2008-02-01 Robert Millan * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Move to the diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 9f6dce142..9c5b90f7f 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -6,6 +6,10 @@ COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index f4d7a08e8..747b7935c 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -6,6 +6,10 @@ COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h + # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img From c004e1b477aa917a3f8a4dcf138c851793040acd Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 2 Feb 2008 14:15:31 +0000 Subject: [PATCH 0010/1707] 2008-02-02 Bean * fs/ufs.c (INODE_BLKSZ): Fix incorrect value. (grub_ufs_get_file_block): Fix indirect block calculation problem. * fs/xfs.c (grub_xfs_sblock): New member log2_dirblk. (grub_xfs_btree_node): New structure. (grub_xfs_btree_root): New structure. (grub_xfs_inode): New members nblocks, extsize, nextents and btree. (GRUB_XFS_EXTENT_OFFSET): Use exts instead of inode->data.extents. (GRUB_XFS_EXTENT_BLOCK): Likewise. (GRUB_XFS_EXTENT_SIZE): Likewise. (grub_xfs_read_block): Support btree format type. (grub_xfs_iterate_dir): Use NESTED_FUNC_ATTR in call_hook. Use directory block as basic unit. * fs/fshelp.c (grub_fshelp_read_file): Bug fix for sparse block. * aclocal.m4 (grub_i386_CHECK_REGPARM_BUG): Define NESTED_FUNC_ATTR as __attribute__ ((__regparm__ (1))). --- ChangeLog | 21 +++++++ aclocal.m4 | 4 +- configure | 4 +- fs/fshelp.c | 2 +- fs/ufs.c | 22 +++++--- fs/xfs.c | 156 ++++++++++++++++++++++++++++++++++++++++------------ 6 files changed, 160 insertions(+), 49 deletions(-) diff --git a/ChangeLog b/ChangeLog index e386be57a..6e4177f0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2008-02-02 Bean + + * fs/ufs.c (INODE_BLKSZ): Fix incorrect value. + (grub_ufs_get_file_block): Fix indirect block calculation problem. + + * fs/xfs.c (grub_xfs_sblock): New member log2_dirblk. + (grub_xfs_btree_node): New structure. + (grub_xfs_btree_root): New structure. + (grub_xfs_inode): New members nblocks, extsize, nextents and btree. + (GRUB_XFS_EXTENT_OFFSET): Use exts instead of inode->data.extents. + (GRUB_XFS_EXTENT_BLOCK): Likewise. + (GRUB_XFS_EXTENT_SIZE): Likewise. + (grub_xfs_read_block): Support btree format type. + (grub_xfs_iterate_dir): Use NESTED_FUNC_ATTR in call_hook. + Use directory block as basic unit. + + * fs/fshelp.c (grub_fshelp_read_file): Bug fix for sparse block. + + * aclocal.m4 (grub_i386_CHECK_REGPARM_BUG): Define NESTED_FUNC_ATTR as + __attribute__ ((__regparm__ (1))). + 2008-02-01 Robert Millan Correct a mistake in previous commit. diff --git a/aclocal.m4 b/aclocal.m4 index 803d57b91..a634253bb 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -333,13 +333,13 @@ AC_MSG_RESULT([$grub_cv_i386_check_nested_functions]) if test "x$grub_cv_i386_check_nested_functions" = xyes; then AC_DEFINE([NESTED_FUNC_ATTR], - [__attribute__ ((__regparm__ (2)))], + [__attribute__ ((__regparm__ (1)))], [Catch gcc bug]) else dnl Unfortunately, the above test does not detect a bug in gcc-4.0. dnl So use regparm 2 until a better test is found. AC_DEFINE([NESTED_FUNC_ATTR], - [__attribute__ ((__regparm__ (2)))], + [__attribute__ ((__regparm__ (1)))], [Catch gcc bug]) fi ]) diff --git a/configure b/configure index d272ea682..24b2f43ea 100644 --- a/configure +++ b/configure @@ -7512,13 +7512,13 @@ echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } if test "x$grub_cv_i386_check_nested_functions" = xyes; then cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2))) +#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1))) _ACEOF else cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (2))) +#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1))) _ACEOF fi diff --git a/fs/fshelp.c b/fs/fshelp.c index ba97a2fdb..bbb58ac9f 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -282,7 +282,7 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, return -1; } else - grub_memset (buf, blocksize - skipfirst, 0); + grub_memset (buf, 0, blockend); buf += blocksize - skipfirst; } diff --git a/fs/ufs.c b/fs/ufs.c index 25cd1fa34..ebb719878 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -52,7 +52,7 @@ grub_le_to_cpu##bits2 (data->inode2.field)) #define INODE_SIZE(data) INODE_ENDIAN (data,size,32,64) #define INODE_MODE(data) INODE_ENDIAN (data,mode,16,16) -#define INODE_BLKSZ(data) (data->ufs_type == UFS1 ? 32 : 64) +#define INODE_BLKSZ(data) (data->ufs_type == UFS1 ? 4 : 8) #define INODE_DIRBLOCKS(data,blk) INODE_ENDIAN \ (data,blocks.dir_blocks[blk],32,64) #define INODE_INDIRBLOCKS(data,blk) INODE_ENDIAN \ @@ -205,35 +205,41 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) { struct grub_ufs_sblock *sblock = &data->sblock; unsigned int indirsz; + int log2_blksz; /* Direct. */ if (blk < GRUB_UFS_DIRBLKS) return INODE_DIRBLOCKS (data, blk); + log2_blksz = grub_le_to_cpu32 (data->sblock.log2_blksz); + blk -= GRUB_UFS_DIRBLKS; indirsz = UFS_BLKSZ (sblock) / INODE_BLKSZ (data); /* Single indirect block. */ if (blk < indirsz) { - grub_uint32_t indir[UFS_BLKSZ (sblock)]; - grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 0), + grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; + grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 0) << log2_blksz, 0, sizeof (indir), (char *) indir); - return indir[blk]; + return (data->ufs_type == UFS1) ? indir[blk] : indir[blk << 1]; } blk -= indirsz; /* Double indirect block. */ if (blk < UFS_BLKSZ (sblock) / indirsz) { - grub_uint32_t indir[UFS_BLKSZ (sblock)]; + grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; - grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 1), + grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 1) << log2_blksz, 0, sizeof (indir), (char *) indir); - grub_disk_read (data->disk, indir[blk / indirsz], + grub_disk_read (data->disk, + (data->ufs_type == UFS1) ? + indir[blk / indirsz] : indir [(blk / indirsz) << 1], 0, sizeof (indir), (char *) indir); - return indir[blk % indirsz]; + return (data->ufs_type == UFS1) ? + indir[blk % indirsz] : indir[(blk % indirsz) << 1]; } diff --git a/fs/xfs.c b/fs/xfs.c index b3154c7ce..88d22be6d 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -47,6 +47,8 @@ struct grub_xfs_sblock grub_uint8_t unused4[2]; grub_uint8_t log2_inop; grub_uint8_t log2_agblk; + grub_uint8_t unused5[67]; + grub_uint8_t log2_dirblk; } __attribute__ ((packed)); struct grub_xfs_dir_header @@ -72,6 +74,23 @@ struct grub_xfs_dir2_entry typedef grub_uint32_t grub_xfs_extent[4]; +struct grub_xfs_btree_node +{ + grub_uint8_t magic[4]; + grub_uint16_t level; + grub_uint16_t numrecs; + grub_uint64_t left; + grub_uint64_t right; + grub_uint64_t keys[1]; +} __attribute__ ((packed)); + +struct grub_xfs_btree_root +{ + grub_uint16_t level; + grub_uint16_t numrecs; + grub_uint64_t keys[1]; +} __attribute__ ((packed)); + struct grub_xfs_inode { grub_uint8_t magic[2]; @@ -80,7 +99,10 @@ struct grub_xfs_inode grub_uint8_t format; grub_uint8_t unused2[50]; grub_uint64_t size; - grub_uint8_t unused3[36]; + grub_uint64_t nblocks; + grub_uint32_t extsize; + grub_uint32_t nextents; + grub_uint8_t unused3[20]; union { char raw[156]; @@ -90,6 +112,7 @@ struct grub_xfs_inode struct grub_xfs_dir_entry direntry[1]; } dir; grub_xfs_extent extents[XFS_INODE_EXTENTS]; + struct grub_xfs_btree_root btree; } data __attribute__ ((packed)); } __attribute__ ((packed)); @@ -138,18 +161,18 @@ static grub_dl_t my_mod; #define GRUB_XFS_INO_AG(data,ino) \ (grub_be_to_cpu64 (ino) >> GRUB_XFS_INO_AGBITS (data)) -#define GRUB_XFS_EXTENT_OFFSET(inode,ex) \ - ((grub_be_to_cpu32 ((inode)->data.extents[ex][0]) & ~(1 << 31)) << 23 \ - | grub_be_to_cpu32 ((inode)->data.extents[ex][1]) >> 9) +#define GRUB_XFS_EXTENT_OFFSET(exts,ex) \ + ((grub_be_to_cpu32 (exts[ex][0]) & ~(1 << 31)) << 23 \ + | grub_be_to_cpu32 (exts[ex][1]) >> 9) -#define GRUB_XFS_EXTENT_BLOCK(inode,ex) \ - ((grub_uint64_t) (grub_be_to_cpu32 ((inode)->data.extents[ex][1]) \ - & (~255)) << 43 \ - | (grub_uint64_t) grub_be_to_cpu32 ((inode)->data.extents[ex][2]) << 11 \ - | grub_be_to_cpu32 ((inode)->data.extents[ex][3]) >> 21) +#define GRUB_XFS_EXTENT_BLOCK(exts,ex) \ + ((grub_uint64_t) (grub_be_to_cpu32 (exts[ex][1]) \ + & (0x1ff)) << 43 \ + | (grub_uint64_t) grub_be_to_cpu32 (exts[ex][2]) << 11 \ + | grub_be_to_cpu32 (exts[ex][3]) >> 21) -#define GRUB_XFS_EXTENT_SIZE(inode,ex) \ - (grub_be_to_cpu32 ((inode)->data.extents[ex][3]) & ((1 << 20) - 1)) +#define GRUB_XFS_EXTENT_SIZE(exts,ex) \ + (grub_be_to_cpu32 (exts[ex][3]) & ((1 << 20) - 1)) #define GRUB_XFS_ROUND_TO_DIRENT(pos) ((((pos) + 8 - 1) / 8) * 8) #define GRUB_XFS_NEXT_DIRENT(pos,len) \ @@ -200,9 +223,63 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, static int grub_xfs_read_block (grub_fshelp_node_t node, int fileblock) { - int ex; + struct grub_xfs_btree_node *leaf = 0; + int ex, nrec; + grub_xfs_extent *exts; + grub_uint64_t ret = 0; - if (node->inode.format != XFS_INODE_FORMAT_EXT) + if (node->inode.format == XFS_INODE_FORMAT_BTREE) + { + grub_uint64_t *keys; + + leaf = grub_malloc (node->data->sblock.bsize); + if (leaf == 0) + return 0; + + nrec = grub_be_to_cpu16 (node->inode.data.btree.numrecs); + keys = &node->inode.data.btree.keys[0]; + do + { + int i; + + for (i = 0; i < nrec; i++) + { + if ((grub_uint64_t) fileblock < grub_be_to_cpu64 (keys[i])) + break; + } + + /* Sparse block. */ + if (i == 0) + { + grub_free (leaf); + return 0; + } + + if (grub_disk_read (node->data->disk, + grub_be_to_cpu64 (keys[i - 1 + XFS_INODE_EXTENTS]) + << (node->data->sblock.log2_bsize + - GRUB_DISK_SECTOR_BITS), + 0, node->data->sblock.bsize, (char *) leaf)) + return 0; + + if (grub_strncmp ((char *) leaf->magic, "BMAP", 4)) + { + grub_free (leaf); + grub_error (GRUB_ERR_BAD_FS, "not a correct XFS BMAP node.\n"); + return 0; + } + + nrec = grub_be_to_cpu16 (leaf->numrecs); + keys = &leaf->keys[0]; + } while (leaf->level); + exts = (grub_xfs_extent *) keys; + } + else if (node->inode.format == XFS_INODE_FORMAT_EXT) + { + nrec = grub_be_to_cpu32 (node->inode.nextents); + exts = &node->inode.data.extents[0]; + } + else { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "xfs does not support inode format %d yet", @@ -212,23 +289,26 @@ grub_xfs_read_block (grub_fshelp_node_t node, int fileblock) /* Iterate over each extent to figure out which extent has the block we are looking for. */ - for (ex = 0; ex < XFS_INODE_EXTENTS; ex++) + for (ex = 0; ex < nrec; ex++) { - grub_uint64_t start = GRUB_XFS_EXTENT_BLOCK (&node->inode, ex); - int offset = GRUB_XFS_EXTENT_OFFSET (&node->inode, ex); - int size = GRUB_XFS_EXTENT_SIZE (&node->inode, ex); + grub_uint64_t start = GRUB_XFS_EXTENT_BLOCK (exts, ex); + int offset = GRUB_XFS_EXTENT_OFFSET (exts, ex); + int size = GRUB_XFS_EXTENT_SIZE (exts, ex); - unsigned int ag = start >> node->data->sblock.log2_agblk; - unsigned int block = start & ((1 << node->data->sblock.log2_agblk) - 1); - - if (fileblock < offset + size) - return (fileblock - offset + block) + ag * node->data->agsize; + /* Sparse block. */ + if (fileblock < offset) + break; + else if (fileblock < offset + size) + { + ret = (fileblock - offset + start); + break; + } } - grub_error (GRUB_ERR_FILE_READ_ERROR, - "xfs block %d for inode %d is not in an extent.\n", - fileblock, grub_be_to_cpu64 (node->ino)); - return 0; + if (leaf) + grub_free (leaf); + + return ret; } @@ -306,9 +386,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, grub_fshelp_node_t node)) { struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; - auto int call_hook (grub_uint64_t ino, char *filename); + auto int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename); - int call_hook (grub_uint64_t ino, char *filename) + int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename) { struct grub_fshelp_node *fdiro; @@ -393,38 +473,43 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, grub_ssize_t numread; char *dirblock; grub_uint64_t blk; + int dirblk_size, dirblk_log2; - dirblock = grub_malloc (dir->data->bsize); + dirblk_log2 = (dir->data->sblock.log2_bsize + + dir->data->sblock.log2_dirblk); + dirblk_size = 1 << dirblk_log2; + + dirblock = grub_malloc (dirblk_size); if (! dirblock) return 0; /* Iterate over every block the directory has. */ for (blk = 0; blk < (grub_be_to_cpu64 (dir->inode.size) - >> dir->data->sblock.log2_bsize); + >> dirblk_log2); blk++) { /* The header is skipped, the first direntry is stored from byte 16. */ int pos = 16; int entries; - int tail_start = (dir->data->bsize + int tail_start = (dirblk_size - sizeof (struct grub_xfs_dirblock_tail)); struct grub_xfs_dirblock_tail *tail; tail = (struct grub_xfs_dirblock_tail *) &dirblock[tail_start]; numread = grub_xfs_read_file (dir, 0, - blk << dir->data->sblock.log2_bsize, - dir->data->bsize, dirblock); - if (numread != dir->data->bsize) + blk << dirblk_log2, + dirblk_size, dirblock); + if (numread != dirblk_size) return 0; entries = (grub_be_to_cpu32 (tail->leaf_count) - grub_be_to_cpu32 (tail->leaf_stale)); /* Iterate over all entries within this block. */ - while (pos < (dir->data->bsize + while (pos < (dirblk_size - (int) sizeof (struct grub_xfs_dir2_entry))) { struct grub_xfs_dir2_entry *direntry; @@ -703,4 +788,3 @@ GRUB_MOD_FINI(xfs) { grub_fs_unregister (&grub_xfs_fs); } - From 58c6922006416788153864a30c36cbc5d7759d8e Mon Sep 17 00:00:00 2001 From: marco_g Date: Sat, 2 Feb 2008 15:33:05 +0000 Subject: [PATCH 0011/1707] 2008-02-02 Marco Gerards * bus/pci.c: New file. * include/grub/pci.h: Likewise. * include/grub/i386/pc/pci.h: Likewise. * commands/lspci.c: Likewise. * conf/i386-pc.rmk (pkglib_MODULES): Add `pci.mod' and `lspci.mod'. (pci_mod_SOURCES): New variable. (pci_mod_CFLAGS): Likewise. (pci_mod_LDFLAGS): Likewise. (lspci_mod_SOURCES): Likewise. (lspci_mod_CFLAGS): Likewise. (lspci_mod_LDFLAGS): Likewise. --- ChangeLog | 19 +++++ bus/pci.c | 56 +++++++++++++ commands/lspci.c | 163 +++++++++++++++++++++++++++++++++++++ conf/i386-pc.mk | 106 +++++++++++++++++++++++- conf/i386-pc.rmk | 12 ++- include/grub/i386/pc/pci.h | 35 ++++++++ include/grub/pci.h | 37 +++++++++ 7 files changed, 426 insertions(+), 2 deletions(-) create mode 100644 bus/pci.c create mode 100644 commands/lspci.c create mode 100644 include/grub/i386/pc/pci.h create mode 100644 include/grub/pci.h diff --git a/ChangeLog b/ChangeLog index 6e4177f0a..7be624ced 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2008-02-02 Marco Gerards + + * bus/pci.c: New file. + + * include/grub/pci.h: Likewise. + + * include/grub/i386/pc/pci.h: Likewise. + + * commands/lspci.c: Likewise. + + * conf/i386-pc.rmk (pkglib_MODULES): Add `pci.mod' and + `lspci.mod'. + (pci_mod_SOURCES): New variable. + (pci_mod_CFLAGS): Likewise. + (pci_mod_LDFLAGS): Likewise. + (lspci_mod_SOURCES): Likewise. + (lspci_mod_CFLAGS): Likewise. + (lspci_mod_LDFLAGS): Likewise. + 2008-02-02 Bean * fs/ufs.c (INODE_BLKSZ): Fix incorrect value. diff --git a/bus/pci.c b/bus/pci.c new file mode 100644 index 000000000..a091f4982 --- /dev/null +++ b/bus/pci.c @@ -0,0 +1,56 @@ +/* pci.c - Generic PCI interfaces. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +grub_pci_address_t +grub_pci_make_address (int bus, int device, int function, int reg) +{ + return (1 << 31) | (bus << 16) | (device << 11) | (function << 8) | (reg << 2); +} + +void +grub_pci_iterate (grub_pci_iteratefunc_t hook) +{ + int bus; + int dev; + int func; + grub_pci_address_t addr; + grub_pci_id_t id; + + for (bus = 0; bus < 256; bus++) + { + for (dev = 0; dev < 32; dev++) + { + for (func = 0; func < 3; func++) + { + addr = grub_pci_make_address (bus, dev, func, 0); + id = grub_pci_read (addr); + + /* Check if there is a device present. */ + if (id >> 16 == 0xFFFF) + continue; + + if (hook (bus, dev, func, id)) + return; + } + } + } +} diff --git a/commands/lspci.c b/commands/lspci.c new file mode 100644 index 000000000..d7d27834a --- /dev/null +++ b/commands/lspci.c @@ -0,0 +1,163 @@ +/* lspci.c - List PCI devices. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +struct grub_pci_classname +{ + int class; + int subclass; + char *desc; +}; + +static const struct grub_pci_classname grub_pci_classes[] = + { + { 0, 0, "" }, + { 1, 0, "SCSCI Controller" }, + { 1, 1, "IDE Controller" }, + { 1, 2, "Floppy Controller" }, + { 1, 3, "IPI Controller" }, + { 1, 4, "RAID Controller" }, + { 1, 0x80, "Mass storage Controller" }, + { 2, 0, "Ethernet Controller" }, + { 2, 1, "Token Ring Controller" }, + { 2, 2, "FDDI Controller" }, + { 2, 3, "ATM Controller" }, + { 2, 4, "ISDN Controller" }, + { 2, 0x80, "Network controller" }, + { 3, 0, "VGA Controller" }, + { 3, 1, "XGA Controller" }, + { 3, 2, "3D Controller" }, + { 3, 0x80, "Display Controller" }, + { 4, 0, "Multimedia Video Device" }, + { 4, 1, "Multimedia Audio Device" }, + { 4, 2, "Multimedia Telephony Device" }, + { 4, 0x80, "Multimedia device" }, + { 5, 0, "RAM Controller" }, + { 5, 1, "Flash Memory Controller" }, + { 5, 0x80, "Memory Controller" }, + { 6, 0, "Host Bridge" }, + { 6, 1, "ISA Bridge" }, + { 6, 2, "EISA Bride" }, + { 6, 3, "MCA Bridge" }, + { 6, 4, "PCI-PCI Bridge" }, + { 6, 5, "PCMCIA Bridge" }, + { 6, 6, "NuBus Bridge" }, + { 6, 7, "CardBus Bridge" }, + { 6, 8, "Raceway Bridge" }, + { 6, 0x80, "Unknown Bridge" }, + { 7, 0x80, "Communication controller" }, + { 8, 0x80, "System hardware" }, + { 9, 0, "Keyboard Controller" }, + { 9, 1, "Digitizer" }, + { 9, 2, "Mouse Controller" }, + { 9, 3, "Scanner Controller" }, + { 9, 4, "Gameport Controller" }, + { 9, 0x80, "Unknown Input Device" }, + { 10, 0, "Generic Docking Station" }, + { 10, 0x80, "Unkown Docking Station" }, + { 11, 0, "80386 Processor" }, + { 11, 1, "80486 Processor" }, + { 11, 2, "Pentium Processor" }, + { 11, 0x10, "Alpha Processor" }, + { 11, 0x20, "PowerPC Processor" }, + { 11, 0x30, "MIPS Processor" }, + { 11, 0x40, "Co-Processor" }, + { 11, 0x80, "Unkown Processor" }, + { 12, 0x80, "Serial Bus Controller" }, + { 13, 0x80, "Wireless Controller" }, + { 14, 0, "I2O" }, + { 15, 0, "iRDA Controller" }, + { 15, 1, "Consumer IR" }, + { 15, 0x10, "RF-Controller" }, + { 15, 0x80, "Satellite Communication Controller" }, + { 16, 0, "Network Decryption" }, + { 16, 1, "Entertainment Decryption" }, + { 16, 0x80, "Unkown Decryption Controller" }, + { 17, 0, "Digital IO Module" }, + { 17, 0x80, "Unkown Data Input System" }, + { 0, 0, 0 }, + }; + +static const char * +grub_pci_get_class (int class, int subclass) +{ + const struct grub_pci_classname *curr = grub_pci_classes; + + while (curr->desc) + { + if (curr->class == class && curr->subclass == subclass) + return curr->desc; + curr++; + } + + return 0; +} + +static int +grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) +{ + grub_uint32_t class; + const char *sclass; + grub_pci_address_t addr; + + grub_printf ("%02x:%02x.%x %04x:%04x.%d", 0, dev, func, pciid >> 16, pciid & 0xFFFF, func); + addr = grub_pci_make_address (bus, dev, func, 2); + class = grub_pci_read (addr); + + /* Lookup the class name, if there isn't a specific one, + retry with 0x80 to get the generic class name. */ + sclass = grub_pci_get_class (class >> 24, (class >> 16) & 0xFF); + if (! sclass) + sclass = grub_pci_get_class (class >> 24, 0x80); + if (! sclass) + sclass = ""; + + grub_printf (" %s\n", sclass); + + return 0; +} + +static grub_err_t +grub_cmd_lspci (struct grub_arg_list *state __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) +{ + grub_pci_iterate (grub_lspci_iter); + return GRUB_ERR_NONE; +} + + + + +GRUB_MOD_INIT(pci) +{ + (void) mod; /* To stop warning. */ + grub_register_command ("lspci", grub_cmd_lspci, GRUB_COMMAND_FLAG_BOTH, + "lspci", "List PCI devices", 0); +} + + +GRUB_MOD_FINI(pci) +{ + grub_unregister_command ("lspci"); +} diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 9c5b90f7f..215cba003 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -793,7 +793,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod png.mod + ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -2457,4 +2457,108 @@ fs-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPE png_mod_CFLAGS = $(COMMON_CFLAGS) png_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst +ifneq ($(pci_mod_EXPORTS),no) +CLEANFILES += def-pci.lst +DEFSYMFILES += def-pci.lst +endif +MOSTLYCLEANFILES += pci_mod-bus_pci.d +UNDSYMFILES += und-pci.lst + +pci.mod: pre-pci.o mod-pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o + +mod-pci.o: mod-pci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< + +mod-pci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pci_mod_EXPORTS),no) +def-pci.lst: pre-pci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ +endif + +und-pci.lst: pre-pci.o + echo 'pci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) + $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< +-include pci_mod-bus_pci.d + +CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst +COMMANDFILES += cmd-pci_mod-bus_pci.lst +FSFILES += fs-pci_mod-bus_pci.lst + +cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + +fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + + +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst +ifneq ($(lspci_mod_EXPORTS),no) +CLEANFILES += def-lspci.lst +DEFSYMFILES += def-lspci.lst +endif +MOSTLYCLEANFILES += lspci_mod-commands_lspci.d +UNDSYMFILES += und-lspci.lst + +lspci.mod: pre-lspci.o mod-lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o + +mod-lspci.o: mod-lspci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< + +mod-lspci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lspci_mod_EXPORTS),no) +def-lspci.lst: pre-lspci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ +endif + +und-lspci.lst: pre-lspci.o + echo 'lspci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< +-include lspci_mod-commands_lspci.d + +CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst +COMMANDFILES += cmd-lspci_mod-commands_lspci.lst +FSFILES += fs-lspci_mod-commands_lspci.lst + +cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + +fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + + +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 747b7935c..6b1f991c1 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -140,7 +140,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod png.mod + ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -282,4 +282,14 @@ png_mod_SOURCES = video/readers/png.c png_mod_CFLAGS = $(COMMON_CFLAGS) png_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/include/grub/i386/pc/pci.h b/include/grub/i386/pc/pci.h new file mode 100644 index 000000000..f4f08ab11 --- /dev/null +++ b/include/grub/i386/pc/pci.h @@ -0,0 +1,35 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CPU_PCI_H +#define GRUB_CPU_PCI_H 1 + +#include +#include + +#define GRUB_PCI_ADDR_REG 0xcf8 +#define GRUB_PCI_DATA_REG 0xcfc + +static inline grub_uint32_t +grub_pci_read (grub_pci_address_t addr) +{ + grub_outl (addr, GRUB_PCI_ADDR_REG); + return grub_inl (GRUB_PCI_DATA_REG); +} + +#endif /* GRUB_CPU_PCI_H */ diff --git a/include/grub/pci.h b/include/grub/pci.h new file mode 100644 index 000000000..71088867b --- /dev/null +++ b/include/grub/pci.h @@ -0,0 +1,37 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_PCI_H +#define GRUB_PCI_H 1 + +#include +#include + +typedef grub_uint32_t grub_pci_id_t; +typedef int (*grub_pci_iteratefunc_t) (int bus, int device, int func, + grub_pci_id_t pciid); +typedef grub_uint32_t grub_pci_address_t; + +grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device, + int function, int reg); + +void EXPORT_FUNC(grub_pci_iterate) (grub_pci_iteratefunc_t hook); + +#include + +#endif /* GRUB_PCI_H */ From e03a11328eee624734a80769ed01d9e4bfa123dc Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 Feb 2008 16:48:52 +0000 Subject: [PATCH 0012/1707] 2008-02-02 Robert Millan * normal/main.c (grub_normal_execute): Check for `menu->size' when determining whether menu has to be displayed. --- ChangeLog | 5 +++++ normal/main.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7be624ced..d345ad8a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-02 Robert Millan + + * normal/main.c (grub_normal_execute): Check for `menu->size' when + determining whether menu has to be displayed. + 2008-02-02 Marco Gerards * bus/pci.c: New file. diff --git a/normal/main.c b/normal/main.c index 5fb3fa007..e5458fc98 100644 --- a/normal/main.c +++ b/normal/main.c @@ -474,7 +474,7 @@ grub_normal_execute (const char *config, int nested) grub_errno = GRUB_ERR_NONE; } - if (menu) + if (menu && menu->size) { grub_menu_run (menu, nested); if (nested) From 4020aa53c079ca00c30ea8665e132de51aeeb359 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 Feb 2008 20:35:08 +0000 Subject: [PATCH 0013/1707] 2008-02-02 Robert Millan * commands/read.c: New file. * conf/common.rmk (pkglib_MODULES): Add `commands/read.c'. (read_mod_SOURCES): New variable. (read_mod_CFLAGS): Likewise. (read_mod_LDFLAGS): Likewise. --- ChangeLog | 8 +++++ DISTLIST | 1 + commands/read.c | 81 +++++++++++++++++++++++++++++++++++++++++++++++++ conf/common.mk | 52 ++++++++++++++++++++++++++++++- conf/common.rmk | 9 ++++-- 5 files changed, 147 insertions(+), 4 deletions(-) create mode 100644 commands/read.c diff --git a/ChangeLog b/ChangeLog index d345ad8a7..4af8855b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-02 Robert Millan + + * commands/read.c: New file. + * conf/common.rmk (pkglib_MODULES): Add `commands/read.c'. + (read_mod_SOURCES): New variable. + (read_mod_CFLAGS): Likewise. + (read_mod_LDFLAGS): Likewise. + 2008-02-02 Robert Millan * normal/main.c (grub_normal_execute): Check for `menu->size' when diff --git a/DISTLIST b/DISTLIST index 6b527c73c..7bf60bc3c 100644 --- a/DISTLIST +++ b/DISTLIST @@ -41,6 +41,7 @@ commands/echo.c commands/help.c commands/hexdump.c commands/ls.c +commands/read.c commands/search.c commands/terminal.c commands/test.c diff --git a/commands/read.c b/commands/read.c new file mode 100644 index 000000000..19959183d --- /dev/null +++ b/commands/read.c @@ -0,0 +1,81 @@ +/* read.c - Command to read variables from user. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static char * +grub_getline (void) +{ + int i; + char *line; + char *tmp; + + i = 0; + line = grub_malloc (1 + i + sizeof('\0')); + if (! line) + return NULL; + + while ((line[i - 1] != '\n') && (line[i - 1] != '\r')) + { + line[i] = grub_getkey (); + if (grub_isprint (line[i])) + grub_putchar (line[i]); + i++; + tmp = grub_realloc (line, 1 + i + sizeof('\0')); + if (! tmp) + { + grub_free (line); + return NULL; + } + line = tmp; + } + line[i] = '\0'; + + return line; +} + +static grub_err_t +grub_cmd_read (struct grub_arg_list *state UNUSED, int argc, char **args) +{ + char *line = grub_getline (); + if (! line) + return grub_errno; + if (argc > 0) + grub_env_set (args[0], line); + + grub_free (line); + return 0; +} + + +GRUB_MOD_INIT(read) +{ + grub_register_command ("read", grub_cmd_read, GRUB_COMMAND_FLAG_CMDLINE, + "read [ENVVAR]", "Set variable with user input", 0); +} + +GRUB_MOD_FINI(read) +{ + grub_unregister_command ("read"); +} diff --git a/conf/common.mk b/conf/common.mk index 3e710d2d7..9ca36112d 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1505,7 +1505,8 @@ lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod configfile.mod echo.mod \ - terminfo.mod test.mod blocklist.mod hexdump.mod + terminfo.mod test.mod blocklist.mod hexdump.mod \ + read.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -2461,5 +2462,54 @@ fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For read.mod. +read_mod_SOURCES = commands/read.c +CLEANFILES += read.mod mod-read.o mod-read.c pre-read.o read_mod-commands_read.o und-read.lst +ifneq ($(read_mod_EXPORTS),no) +CLEANFILES += def-read.lst +DEFSYMFILES += def-read.lst +endif +MOSTLYCLEANFILES += read_mod-commands_read.d +UNDSYMFILES += und-read.lst + +read.mod: pre-read.o mod-read.o + -rm -f $@ + $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-read.o: $(read_mod_DEPENDENCIES) read_mod-commands_read.o + -rm -f $@ + $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ read_mod-commands_read.o + +mod-read.o: mod-read.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -c -o $@ $< + +mod-read.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'read' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(read_mod_EXPORTS),no) +def-read.lst: pre-read.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 read/' > $@ +endif + +und-read.lst: pre-read.o + echo 'read' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +read_mod-commands_read.o: commands/read.c $(commands/read.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -MD -c -o $@ $< +-include read_mod-commands_read.d + +CLEANFILES += cmd-read_mod-commands_read.lst fs-read_mod-commands_read.lst +COMMANDFILES += cmd-read_mod-commands_read.lst +FSFILES += fs-read_mod-commands_read.lst + +cmd-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh read > $@ || (rm -f $@; exit 1) + +fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh read > $@ || (rm -f $@; exit 1) +read_mod_CFLAGS = $(COMMON_CFLAGS) +read_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/common.rmk b/conf/common.rmk index 39c9ec8e8..4722ac12f 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -231,7 +231,8 @@ lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod configfile.mod echo.mod \ - terminfo.mod test.mod blocklist.mod hexdump.mod + terminfo.mod test.mod blocklist.mod hexdump.mod \ + read.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -326,5 +327,7 @@ gzio_mod_SOURCES = io/gzio.c gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) - - +# For read.mod. +read_mod_SOURCES = commands/read.c +read_mod_CFLAGS = $(COMMON_CFLAGS) +read_mod_LDFLAGS = $(COMMON_LDFLAGS) From 9be665dd111df759a03c5f8d8ac57f8c3639f1a0 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 3 Feb 2008 08:27:15 +0000 Subject: [PATCH 0014/1707] 2008-01-31 Bean * conf/i386-pc.rmk (pkglib_IMAGES): Add cdboot.img. (cdboot_img_SOURCES): New variable. (cdboot_img_ASFLAGS): New variable. (cdboot_img_LDFLAGS): New variable. * boot/i386/pc/cdboot.S: New file. * disk/i386/pc/biosdisk.c (cd_start): New variable. (cd_count): Likewise. (grub_biosdisk_get_drive): Add support for cd device. (grub_biosdisk_call_hook): Likewise. (grub_biosdisk_iterate): Likewise. (grub_biosdisk_open): Likewise. (GRUB_BIOSDISK_CDROM_RETRY_COUNT): New macro. (grub_biosdisk_rw): Support reading from cd device. (GRUB_MOD_INIT): Iterate cd devices. * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_FLAG_CDROM): New macro. (GRUB_BIOSDISK_MACHINE_CDROM_START): Likewise. (GRUB_BIOSDISK_MACHINE_CDROM_END): Likewise. * kern/i386/pc/init.c (make_install_device): Check for cd device. --- ChangeLog | 25 +++++ boot/i386/pc/cdboot.S | 171 ++++++++++++++++++++++++++++++++ conf/i386-pc.mk | 21 +++- conf/i386-pc.rmk | 8 +- disk/i386/pc/biosdisk.c | 103 +++++++++++++++---- include/grub/i386/pc/biosdisk.h | 4 + kern/i386/pc/init.c | 11 +- 7 files changed, 317 insertions(+), 26 deletions(-) create mode 100644 boot/i386/pc/cdboot.S diff --git a/ChangeLog b/ChangeLog index 4af8855b0..490e832ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2008-01-31 Bean + + * conf/i386-pc.rmk (pkglib_IMAGES): Add cdboot.img. + (cdboot_img_SOURCES): New variable. + (cdboot_img_ASFLAGS): New variable. + (cdboot_img_LDFLAGS): New variable. + + * boot/i386/pc/cdboot.S: New file. + + * disk/i386/pc/biosdisk.c (cd_start): New variable. + (cd_count): Likewise. + (grub_biosdisk_get_drive): Add support for cd device. + (grub_biosdisk_call_hook): Likewise. + (grub_biosdisk_iterate): Likewise. + (grub_biosdisk_open): Likewise. + (GRUB_BIOSDISK_CDROM_RETRY_COUNT): New macro. + (grub_biosdisk_rw): Support reading from cd device. + (GRUB_MOD_INIT): Iterate cd devices. + + * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_FLAG_CDROM): New macro. + (GRUB_BIOSDISK_MACHINE_CDROM_START): Likewise. + (GRUB_BIOSDISK_MACHINE_CDROM_END): Likewise. + + * kern/i386/pc/init.c (make_install_device): Check for cd device. + 2008-02-02 Robert Millan * commands/read.c: New file. diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S new file mode 100644 index 000000000..61ef84ee9 --- /dev/null +++ b/boot/i386/pc/cdboot.S @@ -0,0 +1,171 @@ +/* -*-Asm-*- */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + + .file "cdboot.S" + +#define CODE_ADDR 0x6000 +#define DATA_ADDR ((GRUB_BOOT_MACHINE_KERNEL_ADDR) + 0x200) + +#define CDSEC_SHIFT 11 +#define CDBLK_LENG 16 + + .text + + .code16 + + .globl start, _start + +start: + call next + +next: + jmp 1f + + . = start + 8 + +bi_pvd: + .long 0 /* LBA of primary volume descript. */ +bi_file: + .long 0 /* LBA of boot file. */ +bi_length: + .long 0 /* Length of boot file. */ +bi_csum: + .long 0 /* Checksum of boot file */ +bi_reserved: + .space (10*4) /* Reserved */ + +1: + popw %bx + + /* Boot from CDROM. */ + + xorw %ax, %ax + movw %ax, %ss + movw $(CODE_ADDR), %sp + movw %ax, %ds + movw %ax, %es + + movw $(0x7C00 + err_noboot_msg - start), %si + movl %cs: bi_length - next(%bx), %ecx + orl %ecx, %ecx + jz fail + + addl $((1 << CDSEC_SHIFT) - 1), %ecx + shrl $CDSEC_SHIFT, %ecx + + movl %cs: bi_file - next(%bx), %esi + + call read_cdrom + + ljmp $(DATA_ADDR >> 4), $0 + +/* + * Parameters: + * esi: start sector + * ecx: number of sectors + */ +read_cdrom: + xorl %eax, %eax + + /* Number of blocks to read. */ + pushw $CDBLK_LENG + + /* Block number. */ + pushl %eax + pushl %esi + + /* Buffer address. */ + pushw $((DATA_ADDR - 0x400)>> 4) + pushl %eax + pushw $0x10 + + xorl %edi, %edi + movw %sp, %si + +1: + movw 0x10(%si), %di + cmpl %ecx, %edi + jbe 2f + movl %ecx, %edi + +2: + mov %di, 2(%si) + + pushl %ecx + + movb $0x42, %ah + int $0x13 + + jnc 3f + + movb $0x42, %ah /* Try again. */ + int $0x13 + + jnc 3f + +2: + shrw $1, %di /* Reduce transfer size. */ + jz cdrom_fail + movw %di, 0x10(%si) + movw %di, 2(%si) + movb $0x42, %ah + int $0x13 + jc 2b + +3: + + movw %di, %ax + shlw $(CDSEC_SHIFT - 4), %ax + addw %ax, 6(%si) + addl %edi, 8(%si) + + popl %ecx + subl %edi, %ecx + jnz 1b + + addw $0x12, %sp + ret + +cdrom_fail: + movw $(0x7C00 + err_cdfail_msg - start), %si + +fail: + movb $0x0e, %ah + xorw %bx, %bx +1: + lodsb (%si), %al + int $0x10 + cmpb $0, %al + jne 1b +1: jmp 1b + +err_noboot_msg: + .ascii "no boot info\0" + +err_cdfail_msg: + .ascii "cdrom read fails\0" + + . = start + 0x1FF + + .byte 0 diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 215cba003..0d9285358 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -11,7 +11,8 @@ normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h # Images. -pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img +pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ + cdboot.img # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S @@ -85,6 +86,24 @@ lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S $(boot/i386/pc/lnxboo lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,6000 +# For cdboot.img. +cdboot_img_SOURCES = boot/i386/pc/cdboot.S +CLEANFILES += cdboot.img cdboot.exec cdboot_img-boot_i386_pc_cdboot.o +MOSTLYCLEANFILES += cdboot_img-boot_i386_pc_cdboot.d + +cdboot.img: cdboot.exec + $(OBJCOPY) -O binary -R .note -R .comment $< $@ + +cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o + $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS) + +cdboot_img-boot_i386_pc_cdboot.o: boot/i386/pc/cdboot.S $(boot/i386/pc/cdboot.S_DEPENDENCIES) + $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(cdboot_img_ASFLAGS) -MD -c -o $@ $< +-include cdboot_img-boot_i386_pc_cdboot.d + +cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) +cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 + # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 6b1f991c1..78e4f0005 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -11,7 +11,8 @@ normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h # Images. -pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img +pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ + cdboot.img # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S @@ -33,6 +34,11 @@ lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,6000 +# For cdboot.img. +cdboot_img_SOURCES = boot/i386/pc/cdboot.S +cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) +cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 + # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index eb22e6d05..ddcc6663b 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -26,12 +26,15 @@ #include #include +static int cd_start = GRUB_BIOSDISK_MACHINE_CDROM_START; +static int cd_count = 0; + static int grub_biosdisk_get_drive (const char *name) { unsigned long drive; - if ((name[0] != 'f' && name[0] != 'h') || name[1] != 'd') + if ((name[0] != 'f' && name[0] != 'h' && name[0] != 'c') || name[1] != 'd') goto fail; drive = grub_strtoul (name + 2, 0, 10); @@ -40,6 +43,8 @@ grub_biosdisk_get_drive (const char *name) if (name[0] == 'h') drive += 0x80; + else if (name[0] == 'c') + drive += cd_start; return (int) drive ; @@ -53,7 +58,10 @@ grub_biosdisk_call_hook (int (*hook) (const char *name), int drive) { char name[10]; - grub_sprintf (name, (drive & 0x80) ? "hd%d" : "fd%d", drive & (~0x80)); + if (drive >= cd_start) + grub_sprintf (name, "cd%d", drive - cd_start); + else + grub_sprintf (name, (drive & 0x80) ? "hd%d" : "fd%d", drive & (~0x80)); return hook (name); } @@ -82,7 +90,11 @@ grub_biosdisk_iterate (int (*hook) (const char *name)) if (grub_biosdisk_call_hook (hook, drive)) return 1; } - + + for (drive = cd_start; drive < cd_start + cd_count; drive++) + if (grub_biosdisk_call_hook (hook, drive)) + return 1; + return 0; } @@ -97,7 +109,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) if (drive < 0) return grub_errno; - disk->has_partitions = (drive & 0x80); + disk->has_partitions = ((drive & 0x80) && (drive < cd_start)); disk->id = drive; data = (struct grub_biosdisk_data *) grub_malloc (sizeof (*data)); @@ -106,8 +118,14 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) data->drive = drive; data->flags = 0; - - if (drive & 0x80) + + if (drive >= cd_start) + { + data->flags = GRUB_BIOSDISK_FLAG_LBA | GRUB_BIOSDISK_FLAG_CDROM; + data->sectors = 32; + total_sectors = 9000000; /* TODO: get the correct size. */ + } + else if (drive & 0x80) { /* HDD */ int version; @@ -136,17 +154,20 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) } } - if (grub_biosdisk_get_diskinfo_standard (drive, - &data->cylinders, - &data->heads, - &data->sectors) != 0) + if (drive < cd_start) { - grub_free (data); - return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get C/H/S values"); - } + if (grub_biosdisk_get_diskinfo_standard (drive, + &data->cylinders, + &data->heads, + &data->sectors) != 0) + { + grub_free (data); + return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get C/H/S values"); + } - if (! total_sectors) - total_sectors = data->cylinders * data->heads * data->sectors; + if (! total_sectors) + total_sectors = data->cylinders * data->heads * data->sectors; + } disk->total_sectors = total_sectors; disk->data = data; @@ -164,6 +185,8 @@ grub_biosdisk_close (grub_disk_t disk) #define GRUB_BIOSDISK_READ 0 #define GRUB_BIOSDISK_WRITE 1 +#define GRUB_BIOSDISK_CDROM_RETRY_COUNT 3 + static grub_err_t grub_biosdisk_rw (int cmd, grub_disk_t disk, grub_disk_addr_t sector, grub_size_t size, @@ -184,13 +207,31 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, dap->buffer = segment << 16; /* The format SEGMENT:ADDRESS. */ dap->block = sector; - if (grub_biosdisk_rw_int13_extensions (cmd + 0x42, data->drive, dap)) - { - /* Fall back to the CHS mode. */ - data->flags &= ~GRUB_BIOSDISK_FLAG_LBA; - disk->total_sectors = data->cylinders * data->heads * data->sectors; - return grub_biosdisk_rw (cmd, disk, sector, size, segment); + if (data->flags & GRUB_BIOSDISK_FLAG_CDROM) + { + int i; + + if (cmd) + return grub_error (GRUB_ERR_WRITE_ERROR, "can\'t write to cdrom"); + + dap->blocks = (dap->blocks + 3) >> 2; + dap->block >>= 2; + + for (i = 0; i < GRUB_BIOSDISK_CDROM_RETRY_COUNT; i++) + if (! grub_biosdisk_rw_int13_extensions (0x42, data->drive, dap)) + break; + + if (i == GRUB_BIOSDISK_CDROM_RETRY_COUNT) + return grub_error (GRUB_ERR_READ_ERROR, "cdrom read error"); } + else + if (grub_biosdisk_rw_int13_extensions (cmd + 0x42, data->drive, dap)) + { + /* Fall back to the CHS mode. */ + data->flags &= ~GRUB_BIOSDISK_FLAG_LBA; + disk->total_sectors = data->cylinders * data->heads * data->sectors; + return grub_biosdisk_rw (cmd, disk, sector, size, segment); + } } else { @@ -323,6 +364,8 @@ grub_disk_biosdisk_fini (void) GRUB_MOD_INIT(biosdisk) { + int drive, found = 0; + if (grub_disk_firmware_is_tainted) { grub_printf ("Firmware is marked as tainted, refusing to initialize.\n"); @@ -331,6 +374,24 @@ GRUB_MOD_INIT(biosdisk) grub_disk_firmware_fini = grub_disk_biosdisk_fini; grub_disk_dev_register (&grub_biosdisk_dev); + + for (drive = GRUB_BIOSDISK_MACHINE_CDROM_START; + drive < GRUB_BIOSDISK_MACHINE_CDROM_END; drive++) + { + if (grub_biosdisk_check_int13_extensions (drive)) + { + if (! found) + cd_start = drive; + found++; + } + else + { + if (found) + break; + } + } + + cd_count = found; } GRUB_MOD_FINI(biosdisk) diff --git a/include/grub/i386/pc/biosdisk.h b/include/grub/i386/pc/biosdisk.h index 3591c2b0b..770f94254 100644 --- a/include/grub/i386/pc/biosdisk.h +++ b/include/grub/i386/pc/biosdisk.h @@ -23,6 +23,10 @@ #include #define GRUB_BIOSDISK_FLAG_LBA 1 +#define GRUB_BIOSDISK_FLAG_CDROM 2 + +#define GRUB_BIOSDISK_MACHINE_CDROM_START 0xe0 +#define GRUB_BIOSDISK_MACHINE_CDROM_END 0xf0 struct grub_biosdisk_data { diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index acaf20b7e..908e2d791 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include #include @@ -71,9 +72,13 @@ make_install_device (void) } else if (grub_install_dos_part != -2) { - grub_sprintf (dev, "(%cd%u", - (grub_boot_drive & 0x80) ? 'h' : 'f', - grub_boot_drive & 0x7f); + if (grub_boot_drive >= GRUB_BIOSDISK_MACHINE_CDROM_START) + grub_sprintf (dev, "(cd%u", + grub_boot_drive - GRUB_BIOSDISK_MACHINE_CDROM_START); + else + grub_sprintf (dev, "(%cd%u", + (grub_boot_drive & 0x80) ? 'h' : 'f', + grub_boot_drive & 0x7f); if (grub_install_dos_part >= 0) grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1); From f2a76e1d19b60372f847fd7461d727341341b5a4 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 3 Feb 2008 13:57:54 +0000 Subject: [PATCH 0015/1707] 2008-02-03 Yoshinori K. Okuji * configure.ac (AC_INIT): Bumped to 1.96. * DISTLIST: Added boot/i386/pc/cdboot.S, bus/pci.c, commands/lspci.c,disk/memdisk.c, include/grub/pci.h, include/grub/i386/pc/pci.h, video/readers/jpeg.c, and video/readers/png.c. --- ChangeLog | 9 + DISTLIST | 8 + NEWS | 2 +- config.h.in | 4 +- configure | 7318 +++++++++++++++++++++++--------------------------- configure.ac | 2 +- 6 files changed, 3429 insertions(+), 3914 deletions(-) diff --git a/ChangeLog b/ChangeLog index 490e832ec..c92168b9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-02-03 Yoshinori K. Okuji + + * configure.ac (AC_INIT): Bumped to 1.96. + + * DISTLIST: Added boot/i386/pc/cdboot.S, bus/pci.c, + commands/lspci.c,disk/memdisk.c, include/grub/pci.h, + include/grub/i386/pc/pci.h, video/readers/jpeg.c, and + video/readers/png.c. + 2008-01-31 Bean * conf/i386-pc.rmk (pkglib_IMAGES): Add cdboot.img. diff --git a/DISTLIST b/DISTLIST index 7bf60bc3c..3c789d448 100644 --- a/DISTLIST +++ b/DISTLIST @@ -29,9 +29,11 @@ install-sh mkinstalldirs stamp-h.in boot/i386/pc/boot.S +boot/i386/pc/cdboot.S boot/i386/pc/diskboot.S boot/i386/pc/lnxboot.S boot/i386/pc/pxeboot.S +bus/pci.c commands/boot.c commands/blocklist.c commands/cat.c @@ -41,6 +43,7 @@ commands/echo.c commands/help.c commands/hexdump.c commands/ls.c +commands/lspci.c commands/read.c commands/search.c commands/terminal.c @@ -71,6 +74,7 @@ disk/ata.c disk/host.c disk/loopback.c disk/lvm.c +disk/memdisk.c disk/raid.c disk/efi/efidisk.c disk/i386/pc/biosdisk.c @@ -128,6 +132,7 @@ include/grub/ntfs.h include/grub/parser.h include/grub/partition.h include/grub/pc_partition.h +include/grub/pci.h include/grub/raid.h include/grub/rescue.h include/grub/script.h @@ -176,6 +181,7 @@ include/grub/i386/pc/kernel.h include/grub/i386/pc/loader.h include/grub/i386/pc/machine.h include/grub/i386/pc/memory.h +include/grub/i386/pc/pci.h include/grub/i386/pc/serial.h include/grub/i386/pc/time.h include/grub/i386/pc/vbe.h @@ -338,5 +344,7 @@ video/video.c video/i386/pc/vbe.c video/i386/pc/vbeblit.c video/i386/pc/vbefill.c +video/readers/jpeg.c video/readers/tga.c +video/readers/png.c video/i386/pc/vbeutil.c diff --git a/NEWS b/NEWS index dfc396844..f0edaada4 100644 --- a/NEWS +++ b/NEWS @@ -1,4 +1,4 @@ -New in 1.96: +New in 1.96 - 2008-02-03: * The license term is changed to GNU General Public License Version 3. diff --git a/config.h.in b/config.h.in index 1aef2123b..c22d5b12b 100644 --- a/config.h.in +++ b/config.h.in @@ -88,10 +88,10 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of `long', as computed by sizeof. */ +/* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of `void *', as computed by sizeof. */ +/* The size of a `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define it to either start or _start */ diff --git a/configure b/configure index 24b2f43ea..e5912e265 100644 --- a/configure +++ b/configure @@ -1,37 +1,83 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for GRUB 1.95. +# Generated by GNU Autoconf 2.59 for GRUB 1.96. # # Report bugs to . # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi -# PATH needs CR +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -52,466 +98,124 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done -IFS=$as_save_IFS - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + for as_base in sh bash ksh sh5; do + case $as_dir in /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || + chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -520,28 +224,7 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -550,164 +233,86 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH -exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +exec 6>&1 + # # Initializations. # ac_default_prefix=/usr/local -ac_clean_files= ac_config_libobj_dir=. -LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + # Identity of this package. PACKAGE_NAME='GRUB' PACKAGE_TARNAME='grub' -PACKAGE_VERSION='1.95' -PACKAGE_STRING='GRUB 1.95' +PACKAGE_VERSION='1.96' +PACKAGE_STRING='GRUB 1.96' PACKAGE_BUGREPORT='bug-grub@gnu.org' ac_unique_file="include/grub/dl.h" # Factoring default headers for most tests. ac_includes_default="\ #include -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H # include #endif -#ifdef STDC_HEADERS +#if STDC_HEADERS # include # include #else -# ifdef HAVE_STDLIB_H +# if HAVE_STDLIB_H # include # endif #endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H # include #endif -#ifdef HAVE_INTTYPES_H +#if HAVE_INTTYPES_H # include +#else +# if HAVE_STDINT_H +# include +# endif #endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -platform -CMP -YACC -UNIFONT_HEX -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -AWK -SET_MAKE -RUBY -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -GREP -EGREP -LIBLZO -TARGET_CC -ac_ct_TARGET_CC -OBJCOPY -STRIP -NM -TARGET_CFLAGS -TARGET_CPPFLAGS -TARGET_LDFLAGS -LIBCURSES -enable_grub_emu -LIBOBJS -LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu LIBOBJS LTLIBOBJS' ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - # Initialize some variables set by options. ac_init_help= @@ -734,48 +339,34 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' +datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' +infodir='${prefix}/info' +mandir='${prefix}/man' ac_prev= -ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option + eval "$ac_prev=\$ac_option" ac_prev= continue fi - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -797,45 +388,33 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad) + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) datadir=$ac_optarg ;; - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -862,12 +441,6 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -892,16 +465,13 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -966,16 +536,6 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -1028,20 +588,24 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -1072,7 +636,8 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) @@ -1092,19 +657,27 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - eval ac_val=\$$ac_var + eval ac_val=$`echo $ac_var` case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -1131,76 +704,74 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. + fi fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP # # Report the --help message. @@ -1209,7 +780,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures GRUB 1.95 to adapt to many kinds of systems. +\`configure' configures GRUB 1.96 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1229,6 +800,9 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] +_ACEOF + + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -1246,22 +820,15 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/grub] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF @@ -1280,7 +847,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of GRUB 1.95:";; + short | recursive ) echo "Configuration of GRUB 1.96:";; esac cat <<\_ACEOF @@ -1302,9 +869,8 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -1312,86 +878,120 @@ it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF -ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. + ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d $ac_dir || continue ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) +if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } + fi + cd $ac_popdir done fi -test -n "$ac_init_help" && exit $ac_status +test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF -GRUB configure 1.95 -generated by GNU Autoconf 2.61 +GRUB configure 1.96 +generated by GNU Autoconf 2.59 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit + exit 0 fi -cat >config.log <<_ACEOF +exec 5>config.log +cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by GRUB $as_me 1.95, which was -generated by GNU Autoconf 2.61. Invocation command line was +It was created by GRUB $as_me 1.96, which was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF -exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1410,7 +1010,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1424,7 +1024,6 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done -IFS=$as_save_IFS } >&5 @@ -1446,6 +1045,7 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= +ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1456,7 +1056,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *\'*) + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1478,7 +1078,9 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " ;; esac done @@ -1489,8 +1091,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1503,34 +1105,20 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done +{ (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; - esac | - sort -) + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} echo cat <<\_ASBOX @@ -1541,28 +1129,22 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## +## ------------- ## +## Output files. ## +## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1574,24 +1156,26 @@ _ASBOX ## ----------- ## _ASBOX echo - cat confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 + ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h # Predefined preprocessor variables. @@ -1622,17 +1206,14 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi -shift -for ac_site_file -do +for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1648,8 +1229,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; esac fi else @@ -1661,11 +1242,12 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1690,7 +1272,8 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1707,30 +1290,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi - - - - - - - - - - - - - - - - - - - - - - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1740,159 +1299,134 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_config_headers="$ac_config_headers config.h" + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h" # Checks for host and target systems. ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then +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" break - elif test -f "$ac_dir/install.sh"; then + elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f "$ac_dir/shtool"; then + elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } -fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } -fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. @@ -1904,17 +1438,17 @@ test -n "$target_alias" && # Program name transformations test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed +rm conftest.sed case "$host_cpu" in @@ -1934,11 +1468,11 @@ esac # Specify the platform (such as firmware). -# Check whether --with-platform was given. +# Check whether --with-platform or --without-platform was given. if test "${with_platform+set}" = set; then - withval=$with_platform; -fi + withval="$with_platform" +fi; # Guess the platform if not specified. if test "x$with_platform" = x; then @@ -1981,8 +1515,8 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1995,27 +1529,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CMP="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - { echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6; } + echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CMP" && break done @@ -2029,8 +1561,8 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2043,27 +1575,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$YACC" && break done @@ -2094,8 +1624,8 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2117,7 +1647,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2136,22 +1666,21 @@ case $as_dir/ in ;; esac done -IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the value is a relative name. + # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2165,8 +1694,8 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2179,57 +1708,54 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$AWK" && break done -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF -SHELL = /bin/sh all: - @echo '@@@%%%=$(MAKE)=@@@%%%' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi rm -f conftest.make fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SET_MAKE= else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi @@ -2237,8 +1763,8 @@ fi # This is not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RUBY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2253,27 +1779,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS ;; esac fi RUBY=$ac_cv_path_RUBY -if test -n "$RUBY"; then - { echo "$as_me:$LINENO: result: $RUBY" >&5 -echo "${ECHO_T}$RUBY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi +if test -n "$RUBY"; then + echo "$as_me:$LINENO: result: $RUBY" >&5 +echo "${ECHO_T}$RUBY" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi # @@ -2288,8 +1813,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2302,34 +1827,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2342,51 +1865,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2399,34 +1907,74 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2440,7 +1988,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2451,7 +1999,6 @@ do fi done done -IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2469,23 +2016,22 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2498,38 +2044,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2542,45 +2086,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC fi fi @@ -2593,35 +2121,21 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2646,77 +2160,47 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext break;; * ) break;; esac done -test "$ac_cv_exeext" = no && ac_cv_exeext= - else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2728,21 +2212,19 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 -# Check that the compiler produces executables we can run. If not, either +# Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2761,27 +2243,22 @@ See \`config.log' for more details." >&2;} fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either +# Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2792,8 +2269,9 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext break;; * ) break;; esac @@ -2807,14 +2285,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2834,20 +2312,14 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2865,12 +2337,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2893,49 +2365,50 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_compiler_gnu=no +ac_compiler_gnu=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2951,118 +2424,38 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +ac_cv_prog_cc_g=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3078,12 +2471,12 @@ else CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_c89=no + ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3117,17 +2510,12 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get + as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ + that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3142,57 +2530,205 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break +rm -f conftest.err conftest.$ac_objext done -rm -f conftest.$ac_ext +rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; esac +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3211,15 +2747,15 @@ _ACEOF -# Check whether --enable-largefile was given. +# Check whether --enable-largefile or --disable-largefile was given. if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi + enableval="$enable_largefile" +fi; if test "$enable_largefile" != no; then - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3227,8 +2763,8 @@ else if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3252,77 +2788,84 @@ main () return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +rm -f conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext +rm -f conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do + ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3347,31 +2890,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3397,53 +2943,54 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 +if test "$ac_cv_sys_file_offset_bits" != no; then + cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF -;; -esac + +fi rm -f conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do + ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3468,31 +3015,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3518,58 +3068,288 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 +if test "$ac_cv_sys_large_files" != no; then + cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF -;; -esac + +fi rm -f conftest* - fi fi # Identify characteristics of the host architecture. +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3603,22 +3383,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 @@ -3627,10 +3409,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3640,22 +3421,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else @@ -3666,7 +3449,6 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done @@ -3684,8 +3466,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3708,22 +3490,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 @@ -3732,10 +3516,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3745,22 +3528,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else @@ -3771,7 +3556,6 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done @@ -3794,170 +3578,23 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3981,31 +3618,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_stdc=no +ac_cv_header_stdc=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -4061,7 +3702,6 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -4081,27 +3721,18 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - return 2; - return 0; + exit(2); + exit (0); } _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4114,14 +3745,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4144,9 +3773,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4160,35 +3789,38 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" +eval "$as_ac_Header=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -4199,244 +3831,8 @@ fi done -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6 if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4447,57 +3843,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef void * ac__type_new_; int main () { -if ((ac__type_new_ *) 0) +if ((void * *) 0) return 0; -if (sizeof (ac__type_new_)) +if (sizeof (void *)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_void_p=no +ac_cv_type_void_p=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6 -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6 if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$ac_cv_type_void_p" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4507,11 +3907,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -4519,22 +3918,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4544,11 +3948,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4556,53 +3959,56 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -4610,22 +4016,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4635,11 +4046,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4647,48 +4057,50 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= +ac_lo= ac_hi= fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4699,11 +4111,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4711,44 +4122,51 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` +ac_lo=`expr '(' $ac_mid ')' + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi ;; + { (exit 1); exit 1; }; } ;; esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4757,9 +4175,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +long longval () { return (long) (sizeof (void *)); } +unsigned long ulongval () { return (long) (sizeof (void *)); } #include #include int @@ -4768,44 +4185,35 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + exit (1); + if (((long) (sizeof (void *))) < 0) { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + long i = longval (); + if (i != ((long) (sizeof (void *)))) + exit (1); fprintf (f, "%ld\n", i); } else { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + unsigned long i = ulongval (); + if (i != ((long) (sizeof (void *)))) + exit (1); fprintf (f, "%lu\n", i); } - return ferror (f) || fclose (f) != 0; + exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4816,32 +4224,29 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val +else + ac_cv_sizeof_void_p=0 fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } - - - +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4852,57 +4257,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef long ac__type_new_; int main () { -if ((ac__type_new_ *) 0) +if ((long *) 0) return 0; -if (sizeof (ac__type_new_)) +if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_long=no +ac_cv_type_long=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4912,11 +4321,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -4924,22 +4332,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4949,11 +4362,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4961,53 +4373,56 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -5015,22 +4430,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5040,11 +4460,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5052,48 +4471,50 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= +ac_lo= ac_hi= fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5104,11 +4525,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5116,44 +4536,51 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` +ac_lo=`expr '(' $ac_mid ')' + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi ;; + { (exit 1); exit 1; }; } ;; esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5162,9 +4589,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int @@ -5173,44 +4599,35 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + exit (1); + if (((long) (sizeof (long))) < 0) { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); fprintf (f, "%ld\n", i); } else { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); fprintf (f, "%lu\n", i); } - return ferror (f) || fclose (f) != 0; + exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5221,25 +4638,22 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val +else + ac_cv_sizeof_long=0 fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } - - - +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -5256,8 +4670,8 @@ fi if test "$target_cpu"-"$platform" = i386-pc; then # There are three possibilities. LZO version 2 installed with the name # liblzo2, with the name liblzo, and LZO version 1. - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6 if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5270,58 +4684,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -return __lzo_init_v2 (); +__lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_lzo2___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_lzo2___lzo_init_v2=no +ac_cv_lib_lzo2___lzo_init_v2=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6 if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then LIBLZO="-llzo2" else - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6 if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5334,58 +4751,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -return __lzo_init_v2 (); +__lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_lzo___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_lzo___lzo_init_v2=no +ac_cv_lib_lzo___lzo_init_v2=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6 if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then LIBLZO="-llzo" else - { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6 if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5398,53 +4818,56 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char __lzo_init2 (); int main () { -return __lzo_init2 (); +__lzo_init2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_lzo___lzo_init2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_lzo___lzo_init2=no +ac_cv_lib_lzo___lzo_init2=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6 if test $ac_cv_lib_lzo___lzo_init2 = yes; then LIBLZO="-llzo" else @@ -5459,8 +4882,8 @@ fi LIBS="$LIBS $LIBLZO" - { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6 if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5487,59 +4910,68 @@ cat >>conftest.$ac_ext <<_ACEOF #undef lzo1x_999_compress -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char lzo1x_999_compress (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined __stub_lzo1x_999_compress || defined __stub___lzo1x_999_compress +#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress) choke me +#else +char (*f) () = lzo1x_999_compress; +#endif +#ifdef __cplusplus +} #endif int main () { -return lzo1x_999_compress (); +return f != lzo1x_999_compress; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_lzo1x_999_compress=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_lzo1x_999_compress=no +ac_cv_func_lzo1x_999_compress=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6 if test $ac_cv_func_lzo1x_999_compress = yes; then : else @@ -5555,19 +4987,18 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5578,37 +5009,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5617,22 +5052,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -5640,10 +5077,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5667,24 +5103,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -5704,9 +5141,9 @@ fi for ac_func in posix_memalign memalign do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5732,60 +5169,68 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif int main () { -return $ac_func (); +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" +eval "$as_ac_var=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -5810,8 +5255,8 @@ if test "x$target" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5824,27 +5269,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6; } + echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +echo "${ECHO_T}$TARGET_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$TARGET_CC" && break done fi @@ -5854,8 +5297,8 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5868,54 +5311,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +echo "${ECHO_T}$ac_ct_TARGET_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_TARGET_CC" && break done - - if test "x$ac_ct_TARGET_CC" = x; then - TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 +test -n "$ac_ct_TARGET_CC" || ac_ct_TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - TARGET_CC=$ac_ct_TARGET_CC - fi + + TARGET_CC=$ac_ct_TARGET_CC fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5928,34 +5356,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5968,41 +5394,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi + OBJCOPY=$ac_ct_OBJCOPY else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -6010,8 +5421,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6024,34 +5435,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6064,41 +5473,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi + STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi @@ -6106,8 +5500,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6120,34 +5514,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6160,41 +5552,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi + NM=$ac_ct_NM else NM="$ac_cv_prog_NM" fi @@ -6208,8 +5585,8 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6222,34 +5599,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6262,41 +5637,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi + OBJCOPY=$ac_ct_OBJCOPY else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -6304,8 +5664,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6318,34 +5678,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6358,41 +5716,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi + STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi @@ -6400,8 +5743,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6414,34 +5757,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6454,41 +5795,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi + NM=$ac_ct_NM else NM="$ac_cv_prog_NM" fi @@ -6515,8 +5841,8 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6 if test "${size_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6538,35 +5864,39 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then size_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - size_flag=no +size_flag=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $size_flag" >&5 -echo "${ECHO_T}$size_flag" >&6; } +echo "$as_me:$LINENO: result: $size_flag" >&5 +echo "${ECHO_T}$size_flag" >&6 if test "x$size_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -6575,8 +5905,8 @@ echo "${ECHO_T}$size_flag" >&6; } # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6 if test "${falign_loop_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6598,35 +5928,39 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then falign_loop_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - falign_loop_flag=no +falign_loop_flag=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 -echo "${ECHO_T}$falign_loop_flag" >&6; } +echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 +echo "${ECHO_T}$falign_loop_flag" >&6 if test "x$falign_loop_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -6642,8 +5976,8 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -{ echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 -echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 +echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6 save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" cat >conftest.$ac_ext <<_ACEOF @@ -6662,35 +5996,38 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then build_id_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - build_id_flag=no +build_id_flag=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $build_id_flag" >&5 -echo "${ECHO_T}$build_id_flag" >&6; } +echo "$as_me:$LINENO: result: $build_id_flag" >&5 +echo "${ECHO_T}$build_id_flag" >&6 LDFLAGS="$save_LDFLAGS" if test "x$build_id_flag" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" @@ -6704,8 +6041,8 @@ fi # Smashing stack protector. ssp_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6 # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -6713,14 +6050,14 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Need that, because some distributions ship compilers that include @@ -6740,8 +6077,8 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6 if test "${grub_cv_prog_objcopy_absolute+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6802,8 +6139,8 @@ done rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6 if test "x$grub_cv_prog_objcopy_absolute" = xno; then { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 @@ -6812,8 +6149,8 @@ echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binu fi -{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6 if test "${grub_cv_asm_uscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6857,13 +6194,13 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +echo "${ECHO_T}$grub_cv_asm_uscore" >&6 if test "x$target_cpu" = xi386; then -{ echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 -echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 +echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6883,41 +6220,44 @@ asm ("incl start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_start_symbol=no +grub_cv_check_start_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_start_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_start_symbol" >&6 -{ echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 -echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 +echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6937,38 +6277,41 @@ asm ("incl _start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_start_symbol=no +grub_cv_check_uscore_start_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6 @@ -6990,8 +6333,8 @@ echo "$as_me: error: neither start nor _start is defined" >&2;} fi -{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7011,41 +6354,44 @@ asm ("incl __bss_start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_uscore_bss_start_symbol=no +grub_cv_check_uscore_uscore_bss_start_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6 -{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7065,41 +6411,44 @@ asm ("incl edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_edata_symbol=no +grub_cv_check_edata_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6 -{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7119,38 +6468,41 @@ asm ("incl _edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_edata_symbol=no +grub_cv_check_uscore_edata_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6 @@ -7177,8 +6529,8 @@ echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} fi -{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7198,41 +6550,44 @@ asm ("incl end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_end_symbol=no +grub_cv_check_end_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_end_symbol" >&6 -{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7252,38 +6607,41 @@ asm ("incl _end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_end_symbol=no +grub_cv_check_uscore_end_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6 @@ -7305,8 +6663,8 @@ echo "$as_me: error: neither end nor _end is defined" >&2;} fi -{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6 if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7349,12 +6707,12 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6 -{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6 if test "${grub_cv_i386_asm_addr32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7384,11 +6742,11 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6 -{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6 if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7422,11 +6780,11 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6 -{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6 if test "${grub_cv_i386_check_nested_functions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7471,22 +6829,13 @@ main (void) _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7499,15 +6848,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi fi -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6 if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -7543,25 +6890,25 @@ LIBS="$tmp_LIBS" # # Memory manager debugging. -# Check whether --enable-mm-debug was given. +# Check whether --enable-mm-debug or --disable-mm-debug was given. if test "${enable_mm_debug+set}" = set; then - enableval=$enable_mm_debug; + enableval="$enable_mm_debug" + cat >>confdefs.h <<\_ACEOF #define MM_DEBUG 1 _ACEOF -fi +fi; - -# Check whether --enable-grub-emu was given. +# Check whether --enable-grub-emu or --disable-grub-emu was given. if test "${enable_grub_emu+set}" = set; then - enableval=$enable_grub_emu; -fi + enableval="$enable_grub_emu" +fi; if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6 if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7574,58 +6921,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -return wgetch (); +wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_ncurses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ncurses_wgetch=no +ac_cv_lib_ncurses_wgetch=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6 if test $ac_cv_lib_ncurses_wgetch = yes; then LIBCURSES="-lncurses" else - { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6 if test "${ac_cv_lib_curses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7638,53 +6988,56 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -return wgetch (); +wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_curses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_curses_wgetch=no +ac_cv_lib_curses_wgetch=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6 if test $ac_cv_lib_curses_wgetch = yes; then LIBCURSES="-lcurses" else @@ -7702,19 +7055,18 @@ fi for ac_header in ncurses/curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7725,37 +7077,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7764,22 +7120,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7787,10 +7145,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7814,24 +7171,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7844,19 +7202,18 @@ else for ac_header in ncurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7867,37 +7224,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7906,22 +7267,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7929,10 +7292,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7956,24 +7318,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7986,19 +7349,18 @@ else for ac_header in curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8009,37 +7371,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8048,22 +7414,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -8071,10 +7439,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -8098,24 +7465,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -8143,11 +7511,11 @@ fi # Output files. -ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" + ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" -ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" + ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" -ac_config_files="$ac_config_files stamp-h" + ac_config_files="$ac_config_files stamp-h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8167,58 +7535,39 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - +{ (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( + ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) | + esac; +} | sed ' - /^ac_cv_env_/b end t clear - :clear + : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + echo "not updating unwritable cache $cache_file" fi fi rm -f confcache @@ -8227,18 +7576,32 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -8269,26 +7632,73 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi -# PATH needs CR +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -8309,198 +7719,126 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done -IFS=$as_save_IFS - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -8509,28 +7847,7 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -8539,14 +7856,31 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + exec 6>&1 -# Save the log message, to keep $[0] and so on meaningful, and to +# Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by GRUB $as_me 1.95, which was -generated by GNU Autoconf 2.61. Invocation command line was +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + +This file was extended by GRUB $as_me 1.96, which was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8554,20 +7888,30 @@ generated by GNU Autoconf 2.61. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_links="$ac_config_links" +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi -_ACEOF +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi cat >>$CONFIG_STATUS <<\_ACEOF + ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -8575,7 +7919,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit + -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -8594,21 +7938,19 @@ Configuration links: $config_links Report bugs to ." - _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ -GRUB config.status 1.95 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +GRUB config.status 1.96 +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' +srcdir=$srcdir +INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8619,24 +7961,39 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; - *) + -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; esac case $ac_option in # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -8646,24 +8003,18 @@ do $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; + *) ac_config_targets="$ac_config_targets $1" ;; esac shift @@ -8679,48 +8030,34 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF + + + cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. for ac_config_target in $ac_config_targets do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "include/grub/cpu") CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; - "include/grub/machine") CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gensymlist.sh") CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; - "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; - "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "gensymlist.sh" ) CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; + "genkernsyms.sh" ) CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; + "stamp-h" ) CONFIG_FILES="$CONFIG_FILES stamp-h" ;; + "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; + "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done - # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -8732,396 +8069,331 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, +# simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# Create a temporary directory, and hook for its removal unless debugging. $debug || { - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } + # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + # -# Set up the sed scripts for CONFIG_FILES section. +# CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@platform@,$platform,;t t +s,@CMP@,$CMP,;t t +s,@YACC@,$YACC,;t t +s,@UNIFONT_HEX@,$UNIFONT_HEX,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@RUBY@,$RUBY,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBLZO@,$LIBLZO,;t t +s,@TARGET_CC@,$TARGET_CC,;t t +s,@ac_ct_TARGET_CC@,$ac_ct_TARGET_CC,;t t +s,@OBJCOPY@,$OBJCOPY,;t t +s,@ac_ct_OBJCOPY@,$ac_ct_OBJCOPY,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@NM@,$NM,;t t +s,@ac_ct_NM@,$ac_ct_NM,;t t +s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t +s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t +s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t +s,@LIBCURSES@,$LIBCURSES,;t t +s,@enable_grub_emu@,$enable_grub_emu,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF _ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -platform!$platform$ac_delim -CMP!$CMP$ac_delim -YACC!$YACC$ac_delim -UNIFONT_HEX!$UNIFONT_HEX$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -RUBY!$RUBY$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LIBLZO!$LIBLZO$ac_delim -TARGET_CC!$TARGET_CC$ac_delim -ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim -OBJCOPY!$OBJCOPY$ac_delim -STRIP!$STRIP$ac_delim -NM!$NM$ac_delim -TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim -TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim -TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim -LIBCURSES!$LIBCURSES$ac_delim -enable_grub_emu!$enable_grub_emu$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 82; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - ac_dir=`$as_dirname -- "$ac_file" || + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } + ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) +if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case $ac_mode in - :F) - # - # CONFIG_FILE - # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -9129,168 +8401,394 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" + # Run the commands associated with the file. case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + stamp-h ) echo timestamp > stamp-h ;; esac - ;; - :H) - # - # CONFIG_HEADER - # +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + _ACEOF -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for +# This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines conftest.tail +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs -echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + rm -f $ac_file - mv "$tmp/config.h" $ac_file + mv $tmp/config.h $ac_file fi else - echo "/* $configure_input */" - cat "$ac_result" + cat $tmp/config.h + rm -f $tmp/config.h fi - rm -f "$tmp/out12" - ;; - :L) - # - # CONFIG_LINK - # +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} +# +# CONFIG_LINKS section. +# - if test ! -r "$srcdir/$ac_source"; then +for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5 +echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;} + + if test ! -r $srcdir/$ac_source; then { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi - rm -f "$ac_file" + rm -f $ac_dest + + # Make relative symlinks. + ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dest_dir" + else + as_dir="$ac_dest_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dest_dir" != .; then + ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dest_dir";; +*) + case "$ac_dest_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dest_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + - # Try a relative symlink, then a hard link, then a copy. case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || - cp -p "$srcdir/$ac_source" "$ac_file" || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} + + # Try a symlink, then a hard link, then a copy. + ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest 2>/dev/null || + cp -p $srcdir/$ac_source $ac_dest || + { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5 +echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;} { (exit 1); exit 1; }; } - ;; - - esac - - - case $ac_file$ac_mode in - "stamp-h":F) echo timestamp > stamp-h ;; - - esac -done # for ac_tag +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/configure.ac b/configure.ac index b3f73e0bd..1f9ca461f 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT(GRUB, 1.95, [bug-grub@gnu.org]) +AC_INIT(GRUB, 1.96, [bug-grub@gnu.org]) AC_PREREQ(2.53) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) From fa370ea61b4ac350472b24a5e28f9233d12d9d26 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 3 Feb 2008 18:04:36 +0000 Subject: [PATCH 0016/1707] 2008-02-03 Pavel Roskin * a/kern/i386/pc/startup.S (grub_chainloader_real_boot): Pop %edx and %esi from stack only after grub_gate_a20() is called. grub_gate_a20() clobbers %edx. --- ChangeLog | 6 ++++++ kern/i386/pc/startup.S | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c92168b9d..62ad8d941 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-03 Pavel Roskin + + * a/kern/i386/pc/startup.S (grub_chainloader_real_boot): Pop + %edx and %esi from stack only after grub_gate_a20() is called. + grub_gate_a20() clobbers %edx. + 2008-02-03 Yoshinori K. Okuji * configure.ac (AC_INIT): Bumped to 1.96. diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index e4101a655..0bfe2b37d 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -594,16 +594,16 @@ FUNCTION(grub_chainloader_real_boot) call EXT_C(grub_dl_unload_all) + /* Turn off Gate A20 */ + xorl %eax, %eax + call EXT_C(grub_gate_a20) + /* set up to pass boot drive */ popl %edx /* ESI must point to a partition table entry */ popl %esi - /* Turn off Gate A20 */ - xorl %eax, %eax - call EXT_C(grub_gate_a20) - call prot_to_real .code16 ljmp $0, $GRUB_MEMORY_MACHINE_BOOT_LOADER_ADDR From d42b36722fc95327d8e18aea5d4bf8335172599d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Feb 2008 18:26:00 +0000 Subject: [PATCH 0017/1707] 2008-02-03 Robert Millan * loader/multiboot_loader.c [GRUB_MACHINE_LINUXBIOS] (grub_rescue_cmd_multiboot_loader) (grub_rescue_cmd_module_loader): Enable multiboot1 calls. --- ChangeLog | 6 ++++++ loader/multiboot_loader.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62ad8d941..d48fdf477 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-03 Robert Millan + + * loader/multiboot_loader.c [GRUB_MACHINE_LINUXBIOS] + (grub_rescue_cmd_multiboot_loader) + (grub_rescue_cmd_module_loader): Enable multiboot1 calls. + 2008-02-03 Pavel Roskin * a/kern/i386/pc/startup.S (grub_chainloader_real_boot): Pop diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index 0e5191c80..d56b42c20 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -114,7 +114,7 @@ grub_rescue_cmd_multiboot_loader (int argc, char *argv[]) /* XXX Find a better way to identify this. This is for i386-pc */ -#ifdef GRUB_MACHINE_PCBIOS +#if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS) if (header_multi_ver_found == 1) { grub_dprintf ("multiboot_loader", @@ -144,7 +144,7 @@ void grub_rescue_cmd_module_loader (int argc, char *argv[]) { -#ifdef GRUB_MACHINE_PCBIOS +#if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS) if (module_version_status == 1) { grub_dprintf("multiboot_loader", From 3b3f6629053176e8eed41c205374e64391f29e36 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Feb 2008 18:27:41 +0000 Subject: [PATCH 0018/1707] 2008-02-03 Robert Millan * util/grub.d/00_header.in: Issue scripting commands for GRUB to only setup gfxterm when `font' command has succeeded. --- ChangeLog | 5 +++++ util/grub.d/00_header.in | 19 ++++++++++--------- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index d48fdf477..1d4c32c62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-03 Robert Millan + + * util/grub.d/00_header.in: Issue scripting commands for GRUB to + only setup gfxterm when `font' command has succeeded. + 2008-02-03 Robert Millan * loader/multiboot_loader.c [GRUB_MACHINE_LINUXBIOS] diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 01e92eda0..25c51627d 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -42,15 +42,14 @@ if [ "x${GRUB_DRIVE}" = "x" ] ; then : ; else echo "set root=${GRUB_DRIVE}" fi -if [ "x${GRUB_FONT_PATH}" = "x" ] ; then : ; else - echo "font ${GRUB_FONT_PATH}" -fi - case ${platform}:${GRUB_TERMINAL} in pc:gfxterm) cat << EOF -set gfxmode=640x480 -insmod gfxterm -insmod vbe +if font ${GRUB_FONT_PATH} ; then + set gfxmode=640x480 + insmod gfxterm + insmod vbe + terminal gfxterm +fi EOF ;; *:serial) @@ -59,7 +58,9 @@ EOF GRUB_SERIAL_COMMAND=serial fi echo "${GRUB_SERIAL_COMMAND}" + echo "terminal serial" + ;; + *:*) + echo "terminal ${GRUB_TERMINAL}" ;; esac - -echo "terminal ${GRUB_TERMINAL}" From e0ca067708799bed3c0401022fefdae514c6068d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Feb 2008 18:30:20 +0000 Subject: [PATCH 0019/1707] 2008-02-03 Robert Millan * util/i386/pc/grub-mkrescue.in: Rewrite most of image generation to use `cdboot.img' for cdrom images. --- ChangeLog | 5 +++ util/i386/pc/grub-mkrescue.in | 60 +++++++++++++++++++---------------- 2 files changed, 37 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d4c32c62..5450e7b57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-03 Robert Millan + + * util/i386/pc/grub-mkrescue.in: Rewrite most of image generation to + use `cdboot.img' for cdrom images. + 2008-02-03 Robert Millan * util/grub.d/00_header.in: Issue scripting commands for GRUB to diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 87b36b9c6..835f73189 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -1,7 +1,7 @@ #! /bin/sh -e # Make GRUB rescue image -# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. +# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -102,41 +102,45 @@ if test "x$output_image" = x; then exit 1 fi -if [ "x${image_type}" = "xfloppy" ] ; then - floppy_image=${output_image} -else - floppy_image=`mktemp` -fi +aux_dir=`mktemp -d` +mkdir -p ${aux_dir}/boot/grub -memdisk_dir=`mktemp -d` -mkdir -p ${memdisk_dir}/boot/grub cp ${input_dir}/*.mod \ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ - ${memdisk_dir}/boot/grub/ + ${aux_dir}/boot/grub/ if test "x$overlay" = x ; then : ; else - cp -dpR ${overlay}/* ${memdisk_dir}/ + cp -dpR ${overlay}/* ${aux_dir}/ fi -memdisk_img=`mktemp` -tar -C ${memdisk_dir} -cf ${memdisk_img} boot -rm -rf ${memdisk_dir} - -core_img=`mktemp` -${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio biosdisk ${modules} -rm -f ${memdisk_img} -cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > $floppy_image -rm -f ${core_img} - if [ "x${image_type}" = "xfloppy" ] ; then - exit 0 + # build memdisk + memdisk_img=`mktemp` + tar -C ${aux_dir} -cf ${memdisk_img} boot + rm -rf ${aux_dir} + + # build core.img + core_img=`mktemp` + ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio biosdisk ${modules} + rm -f ${memdisk_img} + + # build floppy image + cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > $output_image + rm -f ${core_img} +else + # build core.img + core_img=`mktemp` + ${grub_mkimage} -d ${input_dir}/ -o ${core_img} biosdisk iso9660 ${modules} + + # build grub_eltorito image + cat ${input_dir}/cdboot.img ${core_img} > ${aux_dir}/boot/grub/grub_eltorito + rm -f ${core_img} + + # build iso image + genisoimage -b boot/grub/grub_eltorito \ + -no-emul-boot -boot-load-size 4 -boot-info-table \ + -o ${output_image} -r ${aux_dir} + rm -rf ${aux_dir} fi -iso_dir=`mktemp -d` -cp $floppy_image ${iso_dir}/floppy.img -genisoimage -b floppy.img -o ${output_image} -r ${iso_dir} -rm -rf ${iso_dir} - -rm -f ${floppy_image} - exit 0 From 9be6b98b6f5f87e102041a686701d90bdd4efb08 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 3 Feb 2008 18:56:08 +0000 Subject: [PATCH 0020/1707] 2008-02-03 Yoshinori K. Okuji Add support for having a grub directory in a different drive. This is still only the data handling part. * kern/i386/pc/startup.S (multiboot_trampoline): Set %dh to 0xFF. (codestart): Save %dh in GRUB_ROOT_DRIVE. (grub_root_drive): New variable. * kern/i386/pc/init.c (make_install_device): Use GRUB_ROOT_DRIVE instead of GRUB_BOOT_DRIVE to construct a device name. Set GRUB_ROOT_DRIVE to GRUB_BOOT_DRIVE if it is 0xFF, otherwise use it as it was. * include/grub/i386/pc/kernel.h (grub_root_drive): New prototype. * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_ROOT_DRIVE): New macro. (GRUB_BOOT_MACHINE_DRIVE_CHECK): Set to 0x4f. * boot/i386/pc/pxeboot.S (_start): Set %dh to 0xFF. For now, this is bogus, because PXE booting does not specify any drive correctly. * boot/i386/pc/lnxboot.S (reg_edx): Set the second byte to 0xFF. I am not sure if this is really correct. * boot/i386/pc/cdboot.S: Set %dh to 0xFF, because the root drive is always identical to the boot drive when booting from a CD. * boot/i386/pc/boot.S (MOV_MEM_TO_AL): Removed. Not needed any longer. (root_drive): New variable. (real_start): Unconditionally set %dh to ROOT_DRIVE. (setup_sectors): Push %dx right after popping it, because %dh will be modified later. (copy_buffer): Restore %dx. --- ChangeLog | 38 +++++++++++++++++++++++++++++++++++ boot/i386/pc/boot.S | 11 ++++++---- boot/i386/pc/cdboot.S | 3 +++ boot/i386/pc/lnxboot.S | 2 +- boot/i386/pc/pxeboot.S | 5 ++++- include/grub/i386/pc/boot.h | 7 +++++-- include/grub/i386/pc/kernel.h | 5 ++++- kern/i386/pc/init.c | 13 ++++++++---- kern/i386/pc/startup.S | 9 +++++++-- 9 files changed, 78 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5450e7b57..c7075d681 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,41 @@ +2008-02-03 Yoshinori K. Okuji + + Add support for having a grub directory in a different drive. This + is still only the data handling part. + + * kern/i386/pc/startup.S (multiboot_trampoline): Set %dh to 0xFF. + (codestart): Save %dh in GRUB_ROOT_DRIVE. + (grub_root_drive): New variable. + + * kern/i386/pc/init.c (make_install_device): Use GRUB_ROOT_DRIVE + instead of GRUB_BOOT_DRIVE to construct a device name. Set + GRUB_ROOT_DRIVE to GRUB_BOOT_DRIVE if it is 0xFF, otherwise use it + as it was. + + * include/grub/i386/pc/kernel.h (grub_root_drive): New prototype. + + * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_ROOT_DRIVE): New + macro. + (GRUB_BOOT_MACHINE_DRIVE_CHECK): Set to 0x4f. + + * boot/i386/pc/pxeboot.S (_start): Set %dh to 0xFF. For now, this + is bogus, because PXE booting does not specify any drive + correctly. + + * boot/i386/pc/lnxboot.S (reg_edx): Set the second byte to 0xFF. I + am not sure if this is really correct. + + * boot/i386/pc/cdboot.S: Set %dh to 0xFF, because the root drive + is always identical to the boot drive when booting from a CD. + + * boot/i386/pc/boot.S (MOV_MEM_TO_AL): Removed. Not needed any + longer. + (root_drive): New variable. + (real_start): Unconditionally set %dh to ROOT_DRIVE. + (setup_sectors): Push %dx right after popping it, because %dh will + be modified later. + (copy_buffer): Restore %dx. + 2008-02-03 Robert Millan * util/i386/pc/grub-mkrescue.in: Rewrite most of image generation to diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 187b7d2d4..64d40c8fb 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -32,9 +32,6 @@ /* Print message string */ #define MSG(x) movw $ABS(x), %si; call message - /* XXX: binutils-2.9.1.0.x doesn't produce a short opcode for this. */ -#define MOV_MEM_TO_AL(x) .byte 0xa0; .word x - .file "boot.S" .text @@ -99,6 +96,8 @@ kernel_sector: boot_drive: .byte 0xff /* the disk to load kernel from */ /* 0xff means use the boot drive */ +root_drive: + .byte 0xff after_BPB: @@ -141,7 +140,9 @@ real_start: /* * Check if we have a forced disk reference here */ - MOV_MEM_TO_AL(ABS(boot_drive)) /* movb ABS(boot_drive), %al */ + /* assign root_drive at the same time */ + movw ABS(boot_drive), %ax + movb %ah, %dh cmpb $0xff, %al je 1f movb %al, %dl @@ -303,6 +304,7 @@ setup_sectors: /* restore %dl */ popw %dx + pushw %dx /* head start */ movb %al, %dh @@ -353,6 +355,7 @@ copy_buffer: popw %ds popa + popw %dx /* boot kernel */ jmp *(kernel_address) diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S index 61ef84ee9..1709b8c89 100644 --- a/boot/i386/pc/cdboot.S +++ b/boot/i386/pc/cdboot.S @@ -78,6 +78,9 @@ bi_reserved: call read_cdrom + /* Root drive will default to boot drive */ + movb $0xFF, %dh + ljmp $(DATA_ADDR >> 4), $0 /* diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index 6a4de8dd5..2a913ba9c 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -115,7 +115,7 @@ gdt_dst2: .long 0, 0, 0, 0 /* More space for the BIOS. */ reg_edx: - .byte 0x80,0,0xFF,0xFF + .byte 0x80, 0xFF, 0xFF, 0xFF data_leng: .long 0 diff --git a/boot/i386/pc/pxeboot.S b/boot/i386/pc/pxeboot.S index 8c547733a..7f2a14396 100644 --- a/boot/i386/pc/pxeboot.S +++ b/boot/i386/pc/pxeboot.S @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2000,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,9 @@ /* Let's go */ .globl _start; _start: + /* Root drive will default to boot drive */ + movb $0xFF, %dh + /* Jump to the real world */ ljmp $0, $0x8200 diff --git a/include/grub/i386/pc/boot.h b/include/grub/i386/pc/boot.h index fcc961b1a..386221414 100644 --- a/include/grub/i386/pc/boot.h +++ b/include/grub/i386/pc/boot.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2002,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2002,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,6 +34,9 @@ /* The offset of BOOT_DRIVE. */ #define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c +/* The offset of ROOT_DRIVE. */ +#define GRUB_BOOT_MACHINE_ROOT_DRIVE 0x4d + /* The offset of KERNEL_ADDRESS. */ #define GRUB_BOOT_MACHINE_KERNEL_ADDRESS 0x40 @@ -44,7 +47,7 @@ #define GRUB_BOOT_MACHINE_KERNEL_SEGMENT 0x42 /* The offset of BOOT_DRIVE_CHECK. */ -#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4e +#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4f /* The offset of a magic number used by Windows NT. */ #define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8 diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index ca16df788..848dad10d 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -73,6 +73,9 @@ extern char grub_prefix[]; /* The boot BIOS drive number. */ extern grub_int32_t grub_boot_drive; +/* The root BIOS drive number. */ +extern grub_int32_t grub_root_drive; + /* The end address of the kernel. */ extern grub_addr_t grub_end_addr; diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 908e2d791..72374929c 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -72,13 +72,18 @@ make_install_device (void) } else if (grub_install_dos_part != -2) { - if (grub_boot_drive >= GRUB_BIOSDISK_MACHINE_CDROM_START) + /* If the root drive is not set explicitly, assume that it is identical + to the boot drive. */ + if (grub_root_drive == 0xFF) + grub_root_drive = grub_boot_drive; + + if (grub_root_drive >= GRUB_BIOSDISK_MACHINE_CDROM_START) grub_sprintf (dev, "(cd%u", - grub_boot_drive - GRUB_BIOSDISK_MACHINE_CDROM_START); + grub_root_drive - GRUB_BIOSDISK_MACHINE_CDROM_START); else grub_sprintf (dev, "(%cd%u", - (grub_boot_drive & 0x80) ? 'h' : 'f', - grub_boot_drive & 0x7f); + (grub_root_drive & 0x80) ? 'h' : 'f', + grub_root_drive & 0x7f); if (grub_install_dos_part >= 0) grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1); diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 0bfe2b37d..0a38b994c 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -162,6 +162,7 @@ multiboot_trampoline: movl %ebx, EXT_C(grub_install_bsd_part) 2: shrl $24, %edx + movb $0xFF, %dh /* enter the usual booting */ call prot_to_real .code16 @@ -182,8 +183,9 @@ codestart: sti /* we're safe again */ - /* save boot drive reference */ + /* save boot and root drive references */ ADDR32 movb %dl, EXT_C(grub_boot_drive) + ADDR32 movb %dh, EXT_C(grub_root_drive) /* reset disk system (%ah = 0) */ int $0x13 @@ -255,6 +257,9 @@ codestart: VARIABLE(grub_boot_drive) .long 0 +VARIABLE(grub_root_drive) + .long 0 + VARIABLE(grub_start_addr) .long START_SYMBOL From bf567c5067ce1758c4c70954132f2e61f9dadc5f Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 3 Feb 2008 21:53:32 +0000 Subject: [PATCH 0021/1707] 2008-02-03 Yoshinori K. Okuji Make grub-setup handle a separate root device. * util/i386/pc/grub-setup.c (setup): Always open the root device, so that the root device can be compared with the destination device. When embedding the core image, if the root and destination devices are different, set ROOT_DRIVE to ROOT_DEV->DISK->ID. Otherwise, to 0xFF. When not embedding, set ROOT_DRIVE to 0xFF. --- ChangeLog | 12 ++++++++++++ util/i386/pc/grub-setup.c | 30 +++++++++++++++++++----------- 2 files changed, 31 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7075d681..c577d771b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-02-03 Yoshinori K. Okuji + + Make grub-setup handle a separate root device. + + * util/i386/pc/grub-setup.c (setup): Always open the root device, + so that the root device can be compared with the destination + device. + When embedding the core image, if the root and destination devices + are different, set ROOT_DRIVE to ROOT_DEV->DISK->ID. Otherwise, to + 0xFF. + When not embedding, set ROOT_DRIVE to 0xFF. + 2008-02-03 Yoshinori K. Okuji Add support for having a grub directory in a different drive. This diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 72ae25c22..a101bdbcc 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -92,7 +92,7 @@ setup (const char *prefix, const char *dir, size_t boot_size, core_size; grub_uint16_t core_sectors; grub_device_t root_dev, dest_dev; - grub_uint8_t *boot_drive; + grub_uint8_t *boot_drive, *root_drive; grub_disk_addr_t *kernel_sector; grub_uint16_t *boot_drive_check; struct boot_blocklist *first_block, *block; @@ -181,8 +181,9 @@ setup (const char *prefix, const char *dir, boot_img = grub_util_read_image (boot_path); free (boot_path); - /* Set the addresses of BOOT_DRIVE, KERNEL_SECTOR and BOOT_DRIVE_CHECK. */ + /* Set the addresses of variables in the boot image. */ boot_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_BOOT_DRIVE); + root_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_ROOT_DRIVE); kernel_sector = (grub_disk_addr_t *) (boot_img + GRUB_BOOT_MACHINE_KERNEL_SECTOR); boot_drive_check = (grub_uint16_t *) (boot_img @@ -213,12 +214,9 @@ setup (const char *prefix, const char *dir, + GRUB_KERNEL_MACHINE_PREFIX); /* Open the root device and the destination device. */ - if (!must_embed) - { - root_dev = grub_device_open (root); - if (! root_dev) - grub_util_error ("%s", grub_errmsg); - } + root_dev = grub_device_open (root); + if (! root_dev) + grub_util_error ("%s", grub_errmsg); dest_dev = grub_device_open (dest); if (! dest_dev) @@ -319,6 +317,13 @@ setup (const char *prefix, const char *dir, *boot_drive = 0xff; *kernel_sector = grub_cpu_to_le64 (1); + /* If the root device is different from the destination device, + it is necessary to embed the root drive explicitly. */ + if (root_dev->disk->id != dest_dev->disk->id) + *root_drive = (grub_uint8_t) root_dev->disk->id; + else + *root_drive = 0xFF; + /* Write the boot image onto the disk. */ if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, boot_img)) @@ -332,7 +337,7 @@ setup (const char *prefix, const char *dir, else able_to_embed = 0; - if (must_embed && !able_to_embed) + if (must_embed && ! able_to_embed) grub_util_error ("Can't embed the core image, but this is required when\n" "the root device is on a RAID array or LVM volume."); @@ -455,6 +460,10 @@ setup (const char *prefix, const char *dir, else *boot_drive = 0xFF; + /* When the core image is not embedded, the root device always follows + the boot device. */ + *root_drive = 0xFF; + /* Embed information about the installed location. */ if (root_dev->disk->partition) { @@ -510,8 +519,7 @@ setup (const char *prefix, const char *dir, free (core_img); free (boot_img); grub_device_close (dest_dev); - if (!must_embed) - grub_device_close (root_dev); + grub_device_close (root_dev); } static struct option options[] = From 99fadbaafdf47809fb69e8fc5e51be4bfe8d2426 Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 4 Feb 2008 08:45:07 +0000 Subject: [PATCH 0022/1707] 2008-02-04 Bean * Makefile.in (enable_grub_fstest): New variable. * conf/common.rmk (grub_fstest_init.lst): New rule. (grub_fstest_init.h): Likewise. (grub_fstest_init.c): Likewise. (util/grub-fstest.c_DEPENDENCIES): New variable. (grub_fstest_SOURCES): Likewise. * configure.ac (enable_grub_fstest): Check for --enable-grub-fstest. * util/grub-fstest.c: New file. --- ChangeLog | 14 ++ Makefile.in | 1 + conf/common.mk | 203 ++++++++++++++++++ conf/common.rmk | 33 +++ configure | 12 +- configure.ac | 5 + util/grub-fstest.c | 523 +++++++++++++++++++++++++++++++++++++++++++++ 7 files changed, 790 insertions(+), 1 deletion(-) create mode 100644 util/grub-fstest.c diff --git a/ChangeLog b/ChangeLog index c577d771b..8a7f2b259 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-02-04 Bean + + * Makefile.in (enable_grub_fstest): New variable. + + * conf/common.rmk (grub_fstest_init.lst): New rule. + (grub_fstest_init.h): Likewise. + (grub_fstest_init.c): Likewise. + (util/grub-fstest.c_DEPENDENCIES): New variable. + (grub_fstest_SOURCES): Likewise. + + * configure.ac (enable_grub_fstest): Check for --enable-grub-fstest. + + * util/grub-fstest.c: New file. + 2008-02-03 Yoshinori K. Okuji Make grub-setup handle a separate root device. diff --git a/Makefile.in b/Makefile.in index 84b4e9c7c..ba0757795 100644 --- a/Makefile.in +++ b/Makefile.in @@ -79,6 +79,7 @@ UNIFONT_HEX = @UNIFONT_HEX@ # Options. enable_grub_emu = @enable_grub_emu@ +enable_grub_fstest = @enable_grub_fstest@ ### General variables. diff --git a/conf/common.mk b/conf/common.mk index 9ca36112d..5693ca761 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -207,6 +207,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_set rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ DISTCLEANFILES += grub_setup_init.c +# For grub-fstest. +grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_fstest_init.lst + +grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_fstest_init.h + +grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_fstest_init.c + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< @@ -2513,3 +2526,193 @@ fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) g read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS) + +ifeq ($(enable_grub_fstest), yes) +bin_UTILITIES += grub-fstest +endif + +# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h +grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ + kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ + disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ + io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c \ + \ + kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + grub_fstest_init.c +CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d + +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) + +grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-util_grub_fstest.d + +grub_fstest-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-util_hostfs.d + +grub_fstest-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-util_misc.d + +grub_fstest-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_file.d + +grub_fstest-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_device.d + +grub_fstest-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_disk.d + +grub_fstest-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_err.d + +grub_fstest-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_misc.d + +grub_fstest-disk_host.o: disk/host.c $(disk/host.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_host.d + +grub_fstest-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_loopback.d + +grub_fstest-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-normal_arg.d + +grub_fstest-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-normal_misc.d + +grub_fstest-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) + $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-io_gzio.d + +grub_fstest-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-commands_hexdump.d + +grub_fstest-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-commands_blocklist.d + +grub_fstest-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-commands_ls.d + +grub_fstest-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_affs.d + +grub_fstest-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_cpio.d + +grub_fstest-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ext2.d + +grub_fstest-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_fat.d + +grub_fstest-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_hfs.d + +grub_fstest-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_hfsplus.d + +grub_fstest-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_iso9660.d + +grub_fstest-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_jfs.d + +grub_fstest-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_minix.d + +grub_fstest-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ntfs.d + +grub_fstest-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ntfscomp.d + +grub_fstest-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_reiserfs.d + +grub_fstest-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_sfs.d + +grub_fstest-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ufs.d + +grub_fstest-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_xfs.d + +grub_fstest-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_partition.d + +grub_fstest-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-partmap_pc.d + +grub_fstest-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-partmap_apple.d + +grub_fstest-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-partmap_gpt.d + +grub_fstest-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_fs.d + +grub_fstest-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_env.d + +grub_fstest-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_fshelp.d + +grub_fstest-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_lvm.d + +grub_fstest-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_raid.d + +grub_fstest-grub_fstest_init.o: grub_fstest_init.c $(grub_fstest_init.c_DEPENDENCIES) + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-grub_fstest_init.d + diff --git a/conf/common.rmk b/conf/common.rmk index 4722ac12f..ec4c663de 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -61,6 +61,19 @@ grub_setup_init.c: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_set rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ DISTCLEANFILES += grub_setup_init.c +# For grub-fstest. +grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) + rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ +DISTCLEANFILES += grub_fstest_init.lst + +grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh + rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ +DISTCLEANFILES += grub_fstest_init.h + +grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h + rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ +DISTCLEANFILES += grub_fstest_init.c + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< @@ -331,3 +344,23 @@ gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) read_mod_SOURCES = commands/read.c read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS) + +ifeq ($(enable_grub_fstest), yes) +bin_UTILITIES += grub-fstest +endif + +# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h +grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ + kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ + disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ + io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c \ + \ + kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + grub_fstest_init.c diff --git a/configure b/configure index e5912e265..eced23825 100644 --- a/configure +++ b/configure @@ -311,7 +311,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu enable_grub_fstest LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -857,6 +857,8 @@ Optional Features: --disable-largefile omit support for large files --enable-mm-debug include memory manager debugging --enable-grub-emu build and install the `grub-emu' debugging utility + --enable-grub-fstest build and install the `grub-fstest' debugging + utility Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -7510,6 +7512,13 @@ done fi +# Check whether --enable-grub-fstest or --disable-grub-fstest was given. +if test "${enable_grub_fstest+set}" = set; then + enableval="$enable_grub_fstest" + +fi; + + # Output files. ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" @@ -8182,6 +8191,7 @@ s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t s,@LIBCURSES@,$LIBCURSES,;t t s,@enable_grub_emu@,$enable_grub_emu,;t t +s,@enable_grub_fstest@,$enable_grub_fstest,;t t s,@LIBOBJS@,$LIBOBJS,;t t s,@LTLIBOBJS@,$LTLIBOBJS,;t t CEOF diff --git a/configure.ac b/configure.ac index 1f9ca461f..73f60875f 100644 --- a/configure.ac +++ b/configure.ac @@ -320,6 +320,11 @@ AC_ARG_ENABLE([grub-emu], [fi] AC_SUBST([enable_grub_emu]) +AC_ARG_ENABLE([grub-fstest], + [AS_HELP_STRING([--enable-grub-fstest], + [build and install the `grub-fstest' debugging utility])]) +AC_SUBST([enable_grub_fstest]) + # Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform]) diff --git a/util/grub-fstest.c b/util/grub-fstest.c new file mode 100644 index 000000000..c2c754370 --- /dev/null +++ b/util/grub-fstest.c @@ -0,0 +1,523 @@ +/* grub-fstest.c - debug tool for filesystem driver */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +void +grub_putchar (int c) +{ + putchar (c); +} + +int +grub_getkey (void) +{ + return -1; +} + +grub_term_t +grub_term_get_current (void) +{ + return 0; +} + +void +grub_refresh (void) +{ +} + +static struct grub_command cmd_loopback; +static struct grub_command cmd_blocklist; +static struct grub_command cmd_ls; + +grub_command_t +grub_register_command (const char *name, + grub_err_t (*func) (struct grub_arg_list * state, + int argc, char **args), + unsigned flags, + const char *summary __attribute__ ((unused)), + const char *description __attribute__ ((unused)), + const struct grub_arg_option *options) +{ + grub_command_t cmd = 0; + + if (!grub_strcmp (name, "loopback")) + cmd = &cmd_loopback; + else if (!grub_strcmp (name, "blocklist")) + cmd = &cmd_blocklist; + else if (!grub_strcmp (name, "ls")) + cmd = &cmd_ls; + + if (cmd) + { + cmd->func = func; + cmd->flags = flags; + cmd->options = options; + } + return NULL; +} + +grub_err_t +execute_command (grub_command_t cmd, int n, char **args) +{ + int maxargs = 0; + grub_err_t ret = 0; + struct grub_arg_list *state; + struct grub_arg_option *parser; + char **parsed_arglist; + int numargs; + + /* Count the amount of options the command has. */ + parser = (struct grub_arg_option *) cmd->options; + while (parser && (parser++)->doc) + maxargs++; + + /* Set up the option state. */ + state = grub_malloc (sizeof (struct grub_arg_list) * maxargs); + grub_memset (state, 0, sizeof (struct grub_arg_list) * maxargs); + + /* Start the command. */ + if (!(cmd->flags & GRUB_COMMAND_FLAG_NO_ARG_PARSE)) + { + if (grub_arg_parse (cmd, n, args, state, &parsed_arglist, &numargs)) + ret = (cmd->func) (state, numargs, parsed_arglist); + } + else + ret = (cmd->func) (state, n, args); + + grub_free (state); + + return ret; +} + +void +grub_unregister_command (const char *name __attribute__ ((unused))) +{ +} + +#define CMD_LS 1 +#define CMD_CP 2 +#define CMD_CMP 3 +#define CMD_HEX 4 +#define CMD_BLOCKLIST 5 + +#define BUF_SIZE 32256 + +static grub_off_t skip, leng; +static char *part; + +static void +read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len)) +{ + static char buf[BUF_SIZE]; + grub_file_t file; + grub_off_t ofs, len; + + file = grub_file_open (pathname); + if (!file) + { + grub_util_error ("cannot open file %s.\n", pathname); + return; + } + + if (skip > file->size) + { + grub_util_error ("invalid skip value %d.\n"); + return; + } + + ofs = skip; + len = file->size - skip; + if ((leng) && (leng < len)) + len = leng; + + file->offset = skip; + + while (len) + { + grub_ssize_t sz; + + sz = grub_file_read (file, buf, (len > BUF_SIZE) ? BUF_SIZE : len); + if (sz < 0) + { + grub_util_error ("read error at offset %llu.\n", ofs); + break; + } + + if ((sz == 0) || (hook (ofs, buf, sz))) + break; + + ofs += sz; + len -= sz; + } + + grub_file_close (file); +} + +static void +cmd_cp (char *src, char *dest) +{ + FILE *ff; + + auto int cp_hook (grub_off_t ofs, char *buf, int len); + int cp_hook (grub_off_t ofs, char *buf, int len) + { + (void) ofs; + + if ((int) fwrite (buf, 1, len, ff) != len) + { + grub_util_error ("write error.\n"); + return 1; + } + + return 0; + } + + ff = fopen (dest, "w"); + if (ff == NULL) + { + grub_util_error ("open error.\n"); + return; + } + read_file (src, cp_hook); + fclose (ff); +} + +static void +cmd_cmp (char *src, char *dest) +{ + FILE *ff; + static char buf_1[BUF_SIZE]; + + auto int cmp_hook (grub_off_t ofs, char *buf, int len); + int cmp_hook (grub_off_t ofs, char *buf, int len) + { + if ((int) fread (buf_1, 1, len, ff) != len) + { + grub_util_error ("read error at offset %llu.\n", ofs); + return 1; + } + + if (grub_memcmp (buf, buf_1, len)) + { + int i; + + for (i = 0; i < len; i++, ofs++) + if (buf_1[i] != buf[i]) + { + grub_util_error ("compare fail at offset %llu.\n", ofs); + return 1; + } + } + return 0; + } + + ff = fopen (dest, "r"); + if (ff == NULL) + { + grub_util_error ("open error.\n"); + return; + } + + if ((skip) && (fseek (ff, skip, SEEK_SET))) + grub_util_error ("fseek error.\n"); + + read_file (src, cmp_hook); + fclose (ff); +} + +static void +cmd_hex (char *pathname) +{ + auto int hex_hook (grub_off_t ofs, char *buf, int len); + int hex_hook (grub_off_t ofs, char *buf, int len) + { + hexdump (ofs, buf, len); + return 0; + } + + read_file (pathname, hex_hook); +} + +static void +fstest (char *image_path, int cmd, int n, char **args) +{ + char host_file[7 + grub_strlen (image_path) + 1]; + char device_name[(part) ? (6 + grub_strlen (part)) : 5]; + char *argv[3] = { "-p", "loop", host_file }; + + + grub_sprintf (host_file, "(host)/%s", image_path); + + if (execute_command (&cmd_loopback, 3, argv)) + { + grub_util_error ("loopback command fails.\n"); + goto fail; + } + + if (part) + grub_sprintf (device_name, "loop,%s", part); + else + grub_strcpy (device_name, "loop"); + + grub_env_set ("root", device_name); + + switch (cmd) + { + case CMD_LS: + execute_command (&cmd_ls, n, args); + break; + case CMD_CP: + cmd_cp (args[0], args[1]); + break; + case CMD_CMP: + cmd_cmp (args[0], args[1]); + break; + case CMD_HEX: + cmd_hex (args[0]); + break; + case CMD_BLOCKLIST: + execute_command (&cmd_blocklist, n, args); + grub_printf ("\n"); + } + +fail: + + argv[0] = "-d"; + + execute_command (&cmd_loopback, 2, argv); +} + +static struct option options[] = { + {"part", required_argument, 0, 'p'}, + {"skip", required_argument, 0, 's'}, + {"length", required_argument, 0, 'n'}, + {"debug", required_argument, 0, 'd'}, + {"raw", no_argument, 0, 'r'}, + {"long", no_argument, 0, 'l'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"verbose", no_argument, 0, 'v'}, + + {0, 0, 0, 0} +}; + +static void +usage (int status) +{ + if (status) + fprintf (stderr, "Try ``grub-fstest --help'' for more information.\n"); + else + printf ("\ +Usage: grub-fstest [OPTION]... IMAGE_PATH COMMANDS\n\ +\n\ +Debug tool for filesystem driver.\n\ +\nCommands:\n\ + ls PATH list files in PATH\n\ + cp SRC DEST copy file to local system\n\ + cmp SRC DEST compare files\n\ + hex FILE hex dump FILE\n\ + blocklist FILE display blocklist of FILE\n\ +\nOptions:\n\ + -p, --part=NUM select partition NUM\n\ + -s, --skip=N skip N bytes from output file\n\ + -n, --length=N handle N bytes in output file\n\ + -d, --debug=S Set debug environment variable\n\ + -r, --raw disable auto decompression\n\ + -l, --long show long directory list\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ +\n\ +Report bugs to <%s>.\n", PACKAGE_BUGREPORT); + + exit (status); +} + +int +main (int argc, char *argv[]) +{ + char *image_path, *debug_str = 0; + int cmd, is_raw = 0, is_long = 0; + + progname = "grub-fstest"; + + /* Check for options. */ + while (1) + { + int c = getopt_long (argc, argv, "p:s:n:d:rlhVv", options, 0); + + if (c == -1) + break; + else + switch (c) + { + case 'p': + part = optarg; + break; + + case 's': + skip = grub_strtoul (optarg, NULL, 0); + break; + + case 'n': + leng = grub_strtoul (optarg, NULL, 0); + break; + + case 'd': + debug_str = optarg; + break; + + case 'r': + is_raw = 1; + break; + + case 'l': + is_long = 1; + break; + + case 'h': + usage (0); + break; + + case 'V': + printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); + return 0; + + case 'v': + verbosity++; + break; + + default: + usage (1); + break; + } + } + + /* Obtain PATH. */ + if (optind >= argc) + { + fprintf (stderr, "No path is specified.\n"); + usage (1); + } + + image_path = argv[optind]; + + if (*image_path != '/') + { + fprintf (stderr, "Must use absolute path.\n"); + usage (1); + } + + optind++; + + cmd = 0; + if (optind < argc) + { + int nparm = 1; + + if (!grub_strcmp (argv[optind], "ls")) + { + cmd = CMD_LS; + if (is_long) + argv[optind--] = "-l"; + else + nparm = 0; + } + else if (!grub_strcmp (argv[optind], "cp")) + { + cmd = CMD_CP; + nparm = 2; + } + else if (!grub_strcmp (argv[optind], "cmp")) + { + cmd = CMD_CMP; + nparm = 2; + } + else if (!grub_strcmp (argv[optind], "hex")) + { + cmd = CMD_HEX; + } + else if (!grub_strcmp (argv[optind], "blocklist")) + { + cmd = CMD_BLOCKLIST; + } + else + { + fprintf (stderr, "Invalid command %s.\n", argv[optind]); + usage (1); + } + + if (optind + 1 + nparm > argc) + { + fprintf (stderr, "Invalid parameter for command %s.\n", + argv[optind]); + usage (1); + } + + optind++; + } + else + { + fprintf (stderr, "No command is specified.\n"); + usage (1); + } + + grub_hostfs_init (); + + /* Initialize all modules. */ + grub_init_all (); + + if (is_raw) + grub_env_set ("filehook", "0"); + + if (debug_str) + grub_env_set ("debug", debug_str); + + /* Do it. */ + fstest (image_path + 1, cmd, argc - optind, argv + optind); + + /* Free resources. */ + grub_fini_all (); + + grub_hostfs_fini (); + + return 0; +} From 409480b7a2b7fe71f5fcce3ca31b9693f8f84e32 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 5 Feb 2008 10:23:24 +0000 Subject: [PATCH 0023/1707] 2008-02-05 Robert Millan * include/grub/term.h (GRUB_TERM_LEFT, GRUB_TERM_RIGHT) (GRUB_TERM_UP, GRUB_TERM_DOWN, GRUB_TERM_HOME, GRUB_TERM_END) (GRUB_TERM_DC, GRUB_TERM_PPAGE, GRUB_TERM_NPAGE, GRUB_TERM_ESC) (GRUB_TERM_TAB, GRUB_TERM_BACKSPACE): New macros. * kern/i386/pc/startup.S: Include `'. (translation_table): Replace hardcoded values with macros provided by `'. * term/i386/pc/at_keyboard.c: Include `'. (keyboard_map): Correct/add a few values, with macros provided by `'. (keyboard_map_shift): Zero values that don't differ from their `keyboard_map' equivalents. (grub_console_checkkey): Optimize KEYBOARD_STATUS_CAPS_LOCK toggling. Discard the second scan code that is always sent by Caps lock. Only use `keyboard_map_shift' when it provides a non-zero value, otherwise fallback to `keyboard_map'. --- ChangeLog | 21 + config.h.in | 4 +- configure | 7303 +++++++++++++++++++----------------- include/grub/term.h | 20 +- kern/i386/pc/startup.S | 21 +- term/i386/pc/at_keyboard.c | 29 +- 6 files changed, 3969 insertions(+), 3429 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8a7f2b259..cb99444d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2008-02-05 Robert Millan + + * include/grub/term.h (GRUB_TERM_LEFT, GRUB_TERM_RIGHT) + (GRUB_TERM_UP, GRUB_TERM_DOWN, GRUB_TERM_HOME, GRUB_TERM_END) + (GRUB_TERM_DC, GRUB_TERM_PPAGE, GRUB_TERM_NPAGE, GRUB_TERM_ESC) + (GRUB_TERM_TAB, GRUB_TERM_BACKSPACE): New macros. + + * kern/i386/pc/startup.S: Include `'. + (translation_table): Replace hardcoded values with macros + provided by `'. + + * term/i386/pc/at_keyboard.c: Include `'. + (keyboard_map): Correct/add a few values, with macros provided + by `'. + (keyboard_map_shift): Zero values that don't differ from their + `keyboard_map' equivalents. + (grub_console_checkkey): Optimize KEYBOARD_STATUS_CAPS_LOCK toggling. + Discard the second scan code that is always sent by Caps lock. + Only use `keyboard_map_shift' when it provides a non-zero value, + otherwise fallback to `keyboard_map'. + 2008-02-04 Bean * Makefile.in (enable_grub_fstest): New variable. diff --git a/config.h.in b/config.h.in index c22d5b12b..1aef2123b 100644 --- a/config.h.in +++ b/config.h.in @@ -88,10 +88,10 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of a `long', as computed by sizeof. */ +/* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of a `void *', as computed by sizeof. */ +/* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define it to either start or _start */ diff --git a/configure b/configure index eced23825..99e2eede1 100644 --- a/configure +++ b/configure @@ -1,83 +1,37 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for GRUB 1.96. +# Generated by GNU Autoconf 2.61 for GRUB 1.96. # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset + setopt NO_GLOB_SUBST else - as_unset=false + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -98,124 +52,466 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -224,7 +520,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -233,39 +550,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='GRUB' PACKAGE_TARNAME='grub' @@ -277,42 +582,133 @@ ac_unique_file="include/grub/dl.h" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu enable_grub_fstest LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +platform +CMP +YACC +UNIFONT_HEX +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +AWK +SET_MAKE +RUBY +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +LIBLZO +TARGET_CC +ac_ct_TARGET_CC +OBJCOPY +STRIP +NM +TARGET_CFLAGS +TARGET_CPPFLAGS +TARGET_LDFLAGS +LIBCURSES +enable_grub_emu +enable_grub_fstest +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -339,34 +735,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -388,33 +798,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -441,6 +863,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -465,13 +893,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -536,6 +967,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -588,24 +1029,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -636,8 +1073,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -657,27 +1093,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -704,74 +1132,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -800,9 +1230,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -820,15 +1247,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/grub] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -871,8 +1305,9 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -880,120 +1315,86 @@ it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GRUB configure 1.96 -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1012,7 +1413,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1026,6 +1427,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1047,7 +1449,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1058,7 +1459,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1080,9 +1481,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1093,8 +1492,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1107,20 +1506,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1131,22 +1544,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1158,26 +1577,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1208,14 +1625,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1231,8 +1651,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1244,12 +1664,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1274,8 +1693,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1292,6 +1710,30 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1301,134 +1743,159 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - ac_config_headers="$ac_config_headers config.h" +ac_config_headers="$ac_config_headers config.h" # Checks for host and target systems. ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +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" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1440,17 +1907,17 @@ test -n "$target_alias" && # Program name transformations test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed case "$host_cpu" in @@ -1470,11 +1937,11 @@ esac # Specify the platform (such as firmware). -# Check whether --with-platform or --without-platform was given. +# Check whether --with-platform was given. if test "${with_platform+set}" = set; then - withval="$with_platform" + withval=$with_platform; +fi -fi; # Guess the platform if not specified. if test "x$with_platform" = x; then @@ -1517,8 +1984,8 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1531,25 +1998,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CMP="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6 + { echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CMP" && break done @@ -1563,8 +2032,8 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1577,25 +2046,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6 + { echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$YACC" && break done @@ -1626,8 +2097,8 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1649,7 +2120,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1668,21 +2139,22 @@ case $as_dir/ in ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1696,8 +2168,8 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1710,54 +2182,57 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1765,8 +2240,8 @@ fi # This is not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RUBY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1781,28 +2256,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi RUBY=$ac_cv_path_RUBY - if test -n "$RUBY"; then - echo "$as_me:$LINENO: result: $RUBY" >&5 -echo "${ECHO_T}$RUBY" >&6 + { echo "$as_me:$LINENO: result: $RUBY" >&5 +echo "${ECHO_T}$RUBY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + # # Checks for host programs. # @@ -1815,8 +2291,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1829,32 +2305,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1867,36 +2345,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1909,74 +2402,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1990,7 +2443,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2001,6 +2454,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2018,22 +2472,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2046,36 +2501,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2088,29 +2545,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -2123,21 +2596,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2162,47 +2649,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2214,19 +2731,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2245,22 +2764,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2271,9 +2795,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2287,14 +2810,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2314,14 +2837,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2339,12 +2868,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2367,50 +2896,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2426,38 +2954,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2473,12 +3081,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2512,12 +3120,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2532,205 +3145,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2749,15 +3214,15 @@ _ACEOF -# Check whether --enable-largefile or --disable-largefile was given. +# Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then - enableval="$enable_largefile" + enableval=$enable_largefile; +fi -fi; if test "$enable_largefile" != no; then - echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2765,8 +3230,8 @@ else if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2790,84 +3255,77 @@ main () return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do - ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2892,34 +3350,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2945,54 +3400,53 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -if test "$ac_cv_sys_file_offset_bits" != no; then - +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF - -fi +;; +esac rm -f conftest* - echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do - ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3017,34 +3471,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3070,288 +3521,58 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -if test "$ac_cv_sys_large_files" != no; then - +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - -fi +;; +esac rm -f conftest* + fi fi # Identify characteristics of the host architecture. -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3385,24 +3606,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3411,9 +3630,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3423,24 +3643,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3451,6 +3669,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3468,8 +3687,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3492,24 +3711,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3518,9 +3735,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3530,24 +3748,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3558,6 +3774,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3580,23 +3797,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3620,35 +3984,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -3704,6 +4064,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3723,18 +4084,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3747,12 +4117,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + fi fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3775,9 +4147,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3791,38 +4163,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3833,8 +4202,244 @@ fi done -echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3845,61 +4450,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef void * ac__type_new_; int main () { -if ((void * *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (void *)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_void_p=no + ac_cv_type_void_p=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6 -echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_void_p" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -3909,10 +4510,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -3920,27 +4522,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -3950,10 +4547,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -3961,56 +4559,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4018,27 +4613,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4048,10 +4638,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4059,50 +4650,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4113,10 +4702,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4124,51 +4714,44 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4177,8 +4760,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (void *)); } -unsigned long ulongval () { return (long) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4187,35 +4771,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (void *))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4226,29 +4819,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_void_p=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4259,61 +4855,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4323,10 +4915,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4334,27 +4927,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4364,10 +4952,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4375,56 +4964,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4432,27 +5018,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4462,10 +5043,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4473,50 +5055,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4527,10 +5107,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4538,51 +5119,44 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4591,8 +5165,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4601,35 +5176,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4640,22 +5224,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -4672,8 +5259,8 @@ fi if test "$target_cpu"-"$platform" = i386-pc; then # There are three possibilities. LZO version 2 installed with the name # liblzo2, with the name liblzo, and LZO version 1. - echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4686,61 +5273,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -__lzo_init_v2 (); +return __lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo2___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_lzo2___lzo_init_v2=no + ac_cv_lib_lzo2___lzo_init_v2=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then LIBLZO="-llzo2" else - echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4753,61 +5337,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -__lzo_init_v2 (); +return __lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_lzo___lzo_init_v2=no + ac_cv_lib_lzo___lzo_init_v2=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then LIBLZO="-llzo" else - echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4820,56 +5401,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __lzo_init2 (); int main () { -__lzo_init2 (); +return __lzo_init2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_lzo___lzo_init2=no + ac_cv_lib_lzo___lzo_init2=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } if test $ac_cv_lib_lzo___lzo_init2 = yes; then LIBLZO="-llzo" else @@ -4884,8 +5462,8 @@ fi LIBS="$LIBS $LIBLZO" - echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4912,68 +5490,59 @@ cat >>conftest.$ac_ext <<_ACEOF #undef lzo1x_999_compress -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char lzo1x_999_compress (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress) +#if defined __stub_lzo1x_999_compress || defined __stub___lzo1x_999_compress choke me -#else -char (*f) () = lzo1x_999_compress; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != lzo1x_999_compress; +return lzo1x_999_compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_lzo1x_999_compress=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_lzo1x_999_compress=no + ac_cv_func_lzo1x_999_compress=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } if test $ac_cv_func_lzo1x_999_compress = yes; then : else @@ -4989,18 +5558,19 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5011,41 +5581,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5054,24 +5620,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -5079,9 +5643,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5105,25 +5670,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -5143,9 +5707,9 @@ fi for ac_func in posix_memalign memalign do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5171,68 +5735,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -5257,8 +5813,8 @@ if test "x$target" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5271,25 +5827,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6 + { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +echo "${ECHO_T}$TARGET_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$TARGET_CC" && break done fi @@ -5299,8 +5857,8 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5313,39 +5871,54 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -echo "${ECHO_T}$ac_ct_TARGET_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_TARGET_CC" && break done -test -n "$ac_ct_TARGET_CC" || ac_ct_TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 + + if test "x$ac_ct_TARGET_CC" = x; then + TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" - - TARGET_CC=$ac_ct_TARGET_CC + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + TARGET_CC=$ac_ct_TARGET_CC + fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5358,32 +5931,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5396,26 +5971,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - OBJCOPY=$ac_ct_OBJCOPY + if test "x$ac_ct_OBJCOPY" = x; then + OBJCOPY="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + OBJCOPY=$ac_ct_OBJCOPY + fi else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -5423,8 +6013,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5437,32 +6027,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5475,26 +6067,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -5502,8 +6109,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5516,32 +6123,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5554,26 +6163,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - NM=$ac_ct_NM + if test "x$ac_ct_NM" = x; then + NM="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi else NM="$ac_cv_prog_NM" fi @@ -5587,8 +6211,8 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5601,32 +6225,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5639,26 +6265,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - OBJCOPY=$ac_ct_OBJCOPY + if test "x$ac_ct_OBJCOPY" = x; then + OBJCOPY="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + OBJCOPY=$ac_ct_OBJCOPY + fi else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -5666,8 +6307,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5680,32 +6321,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5718,26 +6361,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -5745,8 +6403,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5759,32 +6417,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5797,26 +6457,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - NM=$ac_ct_NM + if test "x$ac_ct_NM" = x; then + NM="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi else NM="$ac_cv_prog_NM" fi @@ -5843,8 +6518,8 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } if test "${size_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5866,39 +6541,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then size_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -size_flag=no + size_flag=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $size_flag" >&5 -echo "${ECHO_T}$size_flag" >&6 +{ echo "$as_me:$LINENO: result: $size_flag" >&5 +echo "${ECHO_T}$size_flag" >&6; } if test "x$size_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -5907,8 +6578,8 @@ echo "${ECHO_T}$size_flag" >&6 # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } if test "${falign_loop_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5930,39 +6601,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then falign_loop_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -falign_loop_flag=no + falign_loop_flag=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 -echo "${ECHO_T}$falign_loop_flag" >&6 +{ echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 +echo "${ECHO_T}$falign_loop_flag" >&6; } if test "x$falign_loop_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -5978,8 +6645,8 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 -echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 +echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6; } save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" cat >conftest.$ac_ext <<_ACEOF @@ -5998,38 +6665,35 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then build_id_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -build_id_flag=no + build_id_flag=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -echo "$as_me:$LINENO: result: $build_id_flag" >&5 -echo "${ECHO_T}$build_id_flag" >&6 +{ echo "$as_me:$LINENO: result: $build_id_flag" >&5 +echo "${ECHO_T}$build_id_flag" >&6; } LDFLAGS="$save_LDFLAGS" if test "x$build_id_flag" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" @@ -6043,8 +6707,8 @@ fi # Smashing stack protector. ssp_possible=yes -echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -6052,14 +6716,14 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Need that, because some distributions ship compilers that include @@ -6079,8 +6743,8 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } if test "${grub_cv_prog_objcopy_absolute+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6141,8 +6805,8 @@ done rm -f conftest* fi -echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } if test "x$grub_cv_prog_objcopy_absolute" = xno; then { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 @@ -6151,8 +6815,8 @@ echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binu fi -echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } if test "${grub_cv_asm_uscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6196,13 +6860,13 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -echo "${ECHO_T}$grub_cv_asm_uscore" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } if test "x$target_cpu" = xi386; then -echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 -echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 +echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6222,44 +6886,41 @@ asm ("incl start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_start_symbol=no + grub_cv_check_start_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_start_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_start_symbol" >&6; } -echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 -echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 +echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6279,41 +6940,38 @@ asm ("incl _start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_start_symbol=no + grub_cv_check_uscore_start_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6; } @@ -6335,8 +6993,8 @@ echo "$as_me: error: neither start nor _start is defined" >&2;} fi -echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6356,44 +7014,41 @@ asm ("incl __bss_start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_uscore_bss_start_symbol=no + grub_cv_check_uscore_uscore_bss_start_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } -echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6413,44 +7068,41 @@ asm ("incl edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_edata_symbol=no + grub_cv_check_edata_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } -echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6470,41 +7122,38 @@ asm ("incl _edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_edata_symbol=no + grub_cv_check_uscore_edata_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } @@ -6531,8 +7180,8 @@ echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} fi -echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6552,44 +7201,41 @@ asm ("incl end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_end_symbol=no + grub_cv_check_end_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_end_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } -echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6609,41 +7255,38 @@ asm ("incl _end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_end_symbol=no + grub_cv_check_uscore_end_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } @@ -6665,8 +7308,8 @@ echo "$as_me: error: neither end nor _end is defined" >&2;} fi -echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6709,12 +7352,12 @@ cat >>confdefs.h <<_ACEOF _ACEOF -echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } -echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_addr32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6744,11 +7387,11 @@ rm -f conftest* fi -echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } -echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6782,11 +7425,11 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } -echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } if test "${grub_cv_i386_check_nested_functions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6831,13 +7474,22 @@ main (void) _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6850,13 +7502,15 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6 +fi + + +{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -6892,25 +7546,25 @@ LIBS="$tmp_LIBS" # # Memory manager debugging. -# Check whether --enable-mm-debug or --disable-mm-debug was given. +# Check whether --enable-mm-debug was given. if test "${enable_mm_debug+set}" = set; then - enableval="$enable_mm_debug" - + enableval=$enable_mm_debug; cat >>confdefs.h <<\_ACEOF #define MM_DEBUG 1 _ACEOF -fi; +fi -# Check whether --enable-grub-emu or --disable-grub-emu was given. + +# Check whether --enable-grub-emu was given. if test "${enable_grub_emu+set}" = set; then - enableval="$enable_grub_emu" + enableval=$enable_grub_emu; +fi -fi; if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6923,61 +7577,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -wgetch (); +return wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ncurses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ncurses_wgetch=no + ac_cv_lib_ncurses_wgetch=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } if test $ac_cv_lib_ncurses_wgetch = yes; then LIBCURSES="-lncurses" else - echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } if test "${ac_cv_lib_curses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6990,56 +7641,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -wgetch (); +return wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_curses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_curses_wgetch=no + ac_cv_lib_curses_wgetch=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } if test $ac_cv_lib_curses_wgetch = yes; then LIBCURSES="-lcurses" else @@ -7057,18 +7705,19 @@ fi for ac_header in ncurses/curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7079,41 +7728,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7122,24 +7767,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7147,9 +7790,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7173,25 +7817,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7204,18 +7847,19 @@ else for ac_header in ncurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7226,41 +7870,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7269,24 +7909,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7294,9 +7932,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7320,25 +7959,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7351,18 +7989,19 @@ else for ac_header in curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7373,41 +8012,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7416,24 +8051,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7441,9 +8074,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7467,25 +8101,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7512,19 +8145,19 @@ done fi -# Check whether --enable-grub-fstest or --disable-grub-fstest was given. +# Check whether --enable-grub-fstest was given. if test "${enable_grub_fstest+set}" = set; then - enableval="$enable_grub_fstest" + enableval=$enable_grub_fstest; +fi -fi; # Output files. - ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" +ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" - ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" +ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" - ac_config_files="$ac_config_files stamp-h" +ac_config_files="$ac_config_files stamp-h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -7544,39 +8177,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7585,32 +8237,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -7641,73 +8279,26 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset + setopt NO_GLOB_SUBST else - as_unset=false + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -7728,126 +8319,198 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -7856,7 +8519,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -7865,31 +8549,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7897,30 +8564,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -7928,7 +8585,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -7947,19 +8604,21 @@ Configuration links: $config_links Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -7970,39 +8629,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -8012,18 +8656,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -8039,34 +8689,48 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gensymlist.sh" ) CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; - "genkernsyms.sh" ) CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; - "stamp-h" ) CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; - "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "include/grub/cpu") CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; + "include/grub/machine") CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "gensymlist.sh") CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; + "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; + "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -8078,332 +8742,397 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@platform@,$platform,;t t -s,@CMP@,$CMP,;t t -s,@YACC@,$YACC,;t t -s,@UNIFONT_HEX@,$UNIFONT_HEX,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@RUBY@,$RUBY,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@LIBLZO@,$LIBLZO,;t t -s,@TARGET_CC@,$TARGET_CC,;t t -s,@ac_ct_TARGET_CC@,$ac_ct_TARGET_CC,;t t -s,@OBJCOPY@,$OBJCOPY,;t t -s,@ac_ct_OBJCOPY@,$ac_ct_OBJCOPY,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@NM@,$NM,;t t -s,@ac_ct_NM@,$ac_ct_NM,;t t -s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t -s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t -s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t -s,@LIBCURSES@,$LIBCURSES,;t t -s,@enable_grub_emu@,$enable_grub_emu,;t t -s,@enable_grub_fstest@,$enable_grub_fstest,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +platform!$platform$ac_delim +CMP!$CMP$ac_delim +YACC!$YACC$ac_delim +UNIFONT_HEX!$UNIFONT_HEX$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +RUBY!$RUBY$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LIBLZO!$LIBLZO$ac_delim +TARGET_CC!$TARGET_CC$ac_delim +ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim +OBJCOPY!$OBJCOPY$ac_delim +STRIP!$STRIP$ac_delim +NM!$NM$ac_delim +TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim +TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim +TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim +LIBCURSES!$LIBCURSES$ac_delim +enable_grub_emu!$enable_grub_emu$ac_delim +enable_grub_fstest!$enable_grub_fstest$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } _ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -8411,394 +9140,168 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - # Run the commands associated with the file. +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - stamp-h ) echo timestamp > stamp-h ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac -done + ;; + :H) + # + # CONFIG_HEADER + # _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' +ac_dD=' ,' -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + rm -f "$tmp/out12" + ;; + :L) + # + # CONFIG_LINK + # -# -# CONFIG_LINKS section. -# + { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} -for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;} - - if test ! -r $srcdir/$ac_source; then + if test ! -r "$srcdir/$ac_source"; then { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi - rm -f $ac_dest - - # Make relative symlinks. - ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dest_dir" - else - as_dir="$ac_dest_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dest_dir" != .; then - ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dest_dir";; -*) - case "$ac_dest_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dest_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - + rm -f "$ac_file" + # Try a relative symlink, then a hard link, then a copy. case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || + cp -p "$srcdir/$ac_source" "$ac_file" || + { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + esac - # Try a symlink, then a hard link, then a copy. - ln -s $ac_rel_source $ac_dest 2>/dev/null || - ln $srcdir/$ac_source $ac_dest 2>/dev/null || - cp -p $srcdir/$ac_source $ac_dest || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;} - { (exit 1); exit 1; }; } -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + case $ac_file$ac_mode in + "stamp-h":F) echo timestamp > stamp-h ;; + + esac +done # for ac_tag + { (exit 0); exit 0; } _ACEOF diff --git a/include/grub/term.h b/include/grub/term.h index f9d4e93f5..3ffee425b 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,6 +19,22 @@ #ifndef GRUB_TERM_HEADER #define GRUB_TERM_HEADER 1 +/* Internal codes used by GRUB to represent terminal input. */ +#define GRUB_TERM_LEFT 2 +#define GRUB_TERM_RIGHT 6 +#define GRUB_TERM_UP 16 +#define GRUB_TERM_DOWN 14 +#define GRUB_TERM_HOME 1 +#define GRUB_TERM_END 5 +#define GRUB_TERM_DC 4 +#define GRUB_TERM_PPAGE 7 +#define GRUB_TERM_NPAGE 3 +#define GRUB_TERM_ESC '\e' +#define GRUB_TERM_TAB '\t' +#define GRUB_TERM_BACKSPACE '\b' + +#ifndef ASM_FILE + #include #include #include @@ -211,4 +227,6 @@ void EXPORT_FUNC(grub_set_more) (int onoff); /* For convenience. */ #define GRUB_TERM_ASCII_CHAR(c) ((c) & 0xff) +#endif /* ! ASM_FILE */ + #endif /* ! GRUB_TERM_HEADER */ diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 0a38b994c..bf3d4eee3 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -49,6 +49,7 @@ #include #include #include +#include #include #include @@ -1179,16 +1180,16 @@ FUNCTION(grub_console_real_putchar) /* this table is used in translate_keycode below */ translation_table: - .word GRUB_CONSOLE_KEY_LEFT, 2 - .word GRUB_CONSOLE_KEY_RIGHT, 6 - .word GRUB_CONSOLE_KEY_UP, 16 - .word GRUB_CONSOLE_KEY_DOWN, 14 - .word GRUB_CONSOLE_KEY_HOME, 1 - .word GRUB_CONSOLE_KEY_END, 5 - .word GRUB_CONSOLE_KEY_DC, 4 - .word GRUB_CONSOLE_KEY_BACKSPACE, 8 - .word GRUB_CONSOLE_KEY_PPAGE, 7 - .word GRUB_CONSOLE_KEY_NPAGE, 3 + .word GRUB_CONSOLE_KEY_LEFT, GRUB_TERM_LEFT + .word GRUB_CONSOLE_KEY_RIGHT, GRUB_TERM_RIGHT + .word GRUB_CONSOLE_KEY_UP, GRUB_TERM_UP + .word GRUB_CONSOLE_KEY_DOWN, GRUB_TERM_DOWN + .word GRUB_CONSOLE_KEY_HOME, GRUB_TERM_HOME + .word GRUB_CONSOLE_KEY_END, GRUB_TERM_END + .word GRUB_CONSOLE_KEY_DC, GRUB_TERM_DC + .word GRUB_CONSOLE_KEY_BACKSPACE, GRUB_TERM_BACKSPACE + .word GRUB_CONSOLE_KEY_PPAGE, GRUB_TERM_PPAGE + .word GRUB_CONSOLE_KEY_NPAGE, GRUB_TERM_NPAGE .word 0 /* diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index afb7a788b..51799e154 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -19,6 +19,7 @@ #include #include #include +#include #define SHIFT_L 0x2a #define SHIFT_R 0x36 @@ -52,32 +53,28 @@ static short at_keyboard_status = 0; static char keyboard_map[128] = { - '\0', '\0', '1', '2', '3', '4', '5', '6', - '7', '8', '9', '0', '-', '=', '\b', '\t', + '\0', GRUB_TERM_ESC, '1', '2', '3', '4', '5', '6', + '7', '8', '9', '0', '-', '=', GRUB_TERM_BACKSPACE, GRUB_TERM_TAB, 'q', 'w', 'e', 'r', 't', 'y', 'u', 'i', 'o', 'p', '[', ']', '\n', '\0', 'a', 's', 'd', 'f', 'g', 'h', 'j', 'k', 'l', ';', '\'', '`', '\0', '\\', 'z', 'x', 'c', 'v', 'b', 'n', 'm', ',', '.', '/', '\0', '*', '\0', ' ', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '7', - '8', '9', '-', '4', '5', '6', '+', '1', - '2', '3', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', GRUB_TERM_HOME, + GRUB_TERM_UP, GRUB_TERM_NPAGE, '-', GRUB_TERM_LEFT, '\0', GRUB_TERM_RIGHT, '+', GRUB_TERM_END, + GRUB_TERM_DOWN, GRUB_TERM_PPAGE, '\0', GRUB_TERM_DC }; static char keyboard_map_shift[128] = { '\0', '\0', '!', '@', '#', '$', '%', '^', - '&', '*', '(', ')', '_', '+', '\b', '\t', + '&', '*', '(', ')', '_', '+', '\0', '\0', 'Q', 'W', 'E', 'R', 'T', 'Y', 'U', 'I', 'O', 'P', '{', '}', '\n', '\0', 'A', 'S', 'D', 'F', 'G', 'H', 'J', 'K', 'L', ':', '\"', '~', '\0', '|', 'Z', 'X', 'C', 'V', - 'B', 'N', 'M', '<', '>', '?', '\0', '*', - '\0', ' ', '\0', '\0', '\0', '\0', '\0', '\0', - '\0', '\0', '\0', '\0', '\0', '\0', '\0', '7', - '8', '9', '-', '4', '5', '6', '+', '1', - '2', '3', + 'B', 'N', 'M', '<', '>', '?' }; static void @@ -180,17 +177,17 @@ grub_console_checkkey (void) switch (key) { case CAPS_LOCK: - if (at_keyboard_status & KEYBOARD_STATUS_CAPS_LOCK) - at_keyboard_status &= ~KEYBOARD_STATUS_CAPS_LOCK; - else - at_keyboard_status |= KEYBOARD_STATUS_CAPS_LOCK; + at_keyboard_status ^= KEYBOARD_STATUS_CAPS_LOCK; + /* Caps lock sends scan code twice. Get the second one and discard it. */ + while (grub_keyboard_getkey () == -1); #ifdef DEBUG_AT_KEYBOARD grub_dprintf ("atkeyb", "caps_lock = %d\n", !!(at_keyboard_status & KEYBOARD_STATUS_CAPS_LOCK)); #endif key = -1; break; default: - if (at_keyboard_status & (KEYBOARD_STATUS_SHIFT_L | KEYBOARD_STATUS_SHIFT_R)) + if ((at_keyboard_status & (KEYBOARD_STATUS_SHIFT_L | KEYBOARD_STATUS_SHIFT_R)) + && keyboard_map_shift[key]) key = keyboard_map_shift[key]; else key = keyboard_map[key]; From c32865bfcfc3a0b78cfd8bd95846868c306817e5 Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 6 Feb 2008 16:02:44 +0000 Subject: [PATCH 0024/1707] 2008-02-05 Bean * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Get physical address of entry. (grub_multiboot_load_elf64): Likewise. (grub_multiboot): Initialize mbi structure. * util/grub-fstest.c: Don't include unused header file script.h. * conf/common.rmk (grub-fstest.c_DEPENDENCIES): Move to the begginning of file. (grub_fstest_SOURCES): Likewise. --- ChangeLog | 13 ++ conf/common.mk | 380 ++++++++++++++++++------------------- conf/common.rmk | 40 ++-- loader/i386/pc/multiboot.c | 22 ++- util/grub-fstest.c | 1 - 5 files changed, 243 insertions(+), 213 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb99444d2..a6ff8faf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-02-05 Bean + + * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Get physical + address of entry. + (grub_multiboot_load_elf64): Likewise. + (grub_multiboot): Initialize mbi structure. + + * util/grub-fstest.c: Don't include unused header file script.h. + + * conf/common.rmk (grub-fstest.c_DEPENDENCIES): Move to the begginning + of file. + (grub_fstest_SOURCES): Likewise. + 2008-02-05 Robert Millan * include/grub/term.h (GRUB_TERM_LEFT, GRUB_TERM_RIGHT) diff --git a/conf/common.mk b/conf/common.mk index 5693ca761..b262ef577 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -163,6 +163,196 @@ grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES -include grub_probe-grub_probe_init.d +ifeq ($(enable_grub_fstest), yes) +bin_UTILITIES += grub-fstest +endif + +# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h +grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ + kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ + disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ + io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c \ + \ + kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + grub_fstest_init.c +CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d + +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) + +grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-util_grub_fstest.d + +grub_fstest-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-util_hostfs.d + +grub_fstest-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-util_misc.d + +grub_fstest-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_file.d + +grub_fstest-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_device.d + +grub_fstest-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_disk.d + +grub_fstest-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_err.d + +grub_fstest-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_misc.d + +grub_fstest-disk_host.o: disk/host.c $(disk/host.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_host.d + +grub_fstest-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_loopback.d + +grub_fstest-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-normal_arg.d + +grub_fstest-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-normal_misc.d + +grub_fstest-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) + $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-io_gzio.d + +grub_fstest-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-commands_hexdump.d + +grub_fstest-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-commands_blocklist.d + +grub_fstest-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-commands_ls.d + +grub_fstest-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_affs.d + +grub_fstest-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_cpio.d + +grub_fstest-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ext2.d + +grub_fstest-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_fat.d + +grub_fstest-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_hfs.d + +grub_fstest-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_hfsplus.d + +grub_fstest-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_iso9660.d + +grub_fstest-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_jfs.d + +grub_fstest-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_minix.d + +grub_fstest-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ntfs.d + +grub_fstest-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ntfscomp.d + +grub_fstest-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_reiserfs.d + +grub_fstest-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_sfs.d + +grub_fstest-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ufs.d + +grub_fstest-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_xfs.d + +grub_fstest-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_partition.d + +grub_fstest-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-partmap_pc.d + +grub_fstest-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-partmap_apple.d + +grub_fstest-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-partmap_gpt.d + +grub_fstest-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_fs.d + +grub_fstest-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_env.d + +grub_fstest-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_fshelp.d + +grub_fstest-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_lvm.d + +grub_fstest-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_raid.d + +grub_fstest-grub_fstest_init.o: grub_fstest_init.c $(grub_fstest_init.c_DEPENDENCIES) + $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-grub_fstest_init.d + + # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y @@ -2526,193 +2716,3 @@ fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) g read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS) - -ifeq ($(enable_grub_fstest), yes) -bin_UTILITIES += grub-fstest -endif - -# For grub-fstest. -util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h -grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ - kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ - disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ - io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ - grub_fstest_init.c -CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d - -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) - -grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-util_grub_fstest.d - -grub_fstest-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-util_hostfs.d - -grub_fstest-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-util_misc.d - -grub_fstest-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_file.d - -grub_fstest-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_device.d - -grub_fstest-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_disk.d - -grub_fstest-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_err.d - -grub_fstest-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_misc.d - -grub_fstest-disk_host.o: disk/host.c $(disk/host.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_host.d - -grub_fstest-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_loopback.d - -grub_fstest-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-normal_arg.d - -grub_fstest-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-normal_misc.d - -grub_fstest-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-io_gzio.d - -grub_fstest-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-commands_hexdump.d - -grub_fstest-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-commands_blocklist.d - -grub_fstest-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-commands_ls.d - -grub_fstest-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_affs.d - -grub_fstest-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_cpio.d - -grub_fstest-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ext2.d - -grub_fstest-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_fat.d - -grub_fstest-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_hfs.d - -grub_fstest-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_hfsplus.d - -grub_fstest-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_iso9660.d - -grub_fstest-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_jfs.d - -grub_fstest-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_minix.d - -grub_fstest-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ntfs.d - -grub_fstest-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ntfscomp.d - -grub_fstest-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_reiserfs.d - -grub_fstest-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_sfs.d - -grub_fstest-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ufs.d - -grub_fstest-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_xfs.d - -grub_fstest-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_partition.d - -grub_fstest-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-partmap_pc.d - -grub_fstest-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-partmap_apple.d - -grub_fstest-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-partmap_gpt.d - -grub_fstest-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_fs.d - -grub_fstest-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_env.d - -grub_fstest-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_fshelp.d - -grub_fstest-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_lvm.d - -grub_fstest-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_raid.d - -grub_fstest-grub_fstest_init.o: grub_fstest_init.c $(grub_fstest_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-grub_fstest_init.d - diff --git a/conf/common.rmk b/conf/common.rmk index ec4c663de..360da9b69 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -17,6 +17,26 @@ grub_probe_SOURCES = util/grub-probe.c \ kern/fs.c kern/env.c fs/fshelp.c \ disk/lvm.c disk/raid.c grub_probe_init.c +ifeq ($(enable_grub_fstest), yes) +bin_UTILITIES += grub-fstest +endif + +# For grub-fstest. +util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h +grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ + kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ + disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ + io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c \ + \ + kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + grub_fstest_init.c + # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y @@ -344,23 +364,3 @@ gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) read_mod_SOURCES = commands/read.c read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS) - -ifeq ($(enable_grub_fstest), yes) -bin_UTILITIES += grub-fstest -endif - -# For grub-fstest. -util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h -grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ - kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ - disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ - io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ - \ - kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ - grub_fstest_init.c diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index fa6346e59..011cc9aec 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -96,6 +96,7 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) { Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; Elf32_Phdr *phdr; + grub_addr_t physical_entry_addr = 0; int i; if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) @@ -144,9 +145,16 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) if (phdr->p_filesz < phdr->p_memsz) grub_memset ((char *) phdr->p_paddr + phdr->p_filesz, 0, phdr->p_memsz - phdr->p_filesz); + + if ((entry >= phdr->p_vaddr) && + (entry < phdr->p_vaddr + phdr->p_memsz)) + physical_entry_addr = entry + phdr->p_paddr - phdr->p_vaddr; } } - + + if (physical_entry_addr) + entry = physical_entry_addr; + return grub_errno; } @@ -164,6 +172,7 @@ grub_multiboot_load_elf64 (grub_file_t file, void *buffer) { Elf64_Ehdr *ehdr = (Elf64_Ehdr *) buffer; Elf64_Phdr *phdr; + grub_addr_t physical_entry_addr = 0; int i; if (ehdr->e_ident[EI_CLASS] != ELFCLASS64) @@ -226,9 +235,16 @@ grub_multiboot_load_elf64 (grub_file_t file, void *buffer) + phdr->p_filesz), 0, phdr->p_memsz - phdr->p_filesz); + + if ((entry >= phdr->p_vaddr) && + (entry < phdr->p_vaddr + phdr->p_memsz)) + physical_entry_addr = entry + phdr->p_paddr - phdr->p_vaddr; } } - + + if (physical_entry_addr) + entry = physical_entry_addr; + return grub_errno; } @@ -306,6 +322,8 @@ grub_multiboot (int argc, char *argv[]) if (! mbi) goto fail; + grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); + mbi->flags = MULTIBOOT_INFO_MEMORY; /* Convert from bytes to kilobytes. */ diff --git a/util/grub-fstest.c b/util/grub-fstest.c index c2c754370..126a2307a 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -29,7 +29,6 @@ #include #include #include -#include #include #include From b0dfd29ab2b04302ba1dc580ad29df1bb732a7c6 Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 6 Feb 2008 19:57:40 +0000 Subject: [PATCH 0025/1707] 2008-02-06 Christian Franke * fs/cpio.c (grub_cpio_find_file): Return GRUB_ERR_NONE (and set *ofs = 0) instead of GRUB_ERR_FILE_NOT_FOUND on last block of a cpio or tar stream. Check for "TRAILER!!!" instead of any empty data block to detect last block of a cpio stream. (grub_cpio_dir): Fix constness of variable np. (grub_cpio_open): Return GRUB_ERR_FILE_NOT_FOUND if cpio or tar trailer is detected. This fixes a crash on open of a non existing file. --- ChangeLog | 12 ++++++++++++ fs/cpio.c | 22 ++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6ff8faf0..e69d6332d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-02-06 Christian Franke + + * fs/cpio.c (grub_cpio_find_file): Return GRUB_ERR_NONE + (and set *ofs = 0) instead of GRUB_ERR_FILE_NOT_FOUND on + last block of a cpio or tar stream. + Check for "TRAILER!!!" instead of any empty data + block to detect last block of a cpio stream. + (grub_cpio_dir): Fix constness of variable np. + (grub_cpio_open): Return GRUB_ERR_FILE_NOT_FOUND if + cpio or tar trailer is detected. This fixes a crash + on open of a non existing file. + 2008-02-05 Bean * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Get physical diff --git a/fs/cpio.c b/fs/cpio.c index fcf614a41..ad9f2a85e 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -98,11 +98,6 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, return grub_error (GRUB_ERR_BAD_FS, "Invalid cpio archive"); data->size = (((grub_uint32_t) hd.filesize_1) << 16) + hd.filesize_2; - if (data->size == 0) - { - *ofs = 0; - return GRUB_ERR_FILE_NOT_FOUND; - } if (hd.namesize & 1) hd.namesize++; @@ -117,6 +112,13 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, return grub_errno; } + if (data->size == 0 && hd.mode == 0 && hd.namesize == 11 + 1 + && ! grub_memcmp(*name, "TRAILER!!!", 11)) + { + *ofs = 0; + return GRUB_ERR_NONE; + } + data->dofs = data->hofs + sizeof (hd) + hd.namesize; *ofs = data->dofs + data->size; if (data->size & 1) @@ -133,7 +135,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, if (!hd.name[0]) { *ofs = 0; - return GRUB_ERR_FILE_NOT_FOUND; + return GRUB_ERR_NONE; } if (grub_memcmp (hd.magic, MAGIC_USTAR, sizeof (MAGIC_USTAR) - 1)) @@ -188,7 +190,8 @@ grub_cpio_dir (grub_device_t device, const char *path, { struct grub_cpio_data *data; grub_uint32_t ofs; - char *prev, *name, *np; + char *prev, *name; + const char *np; int len; #ifndef GRUB_UTIL @@ -275,7 +278,10 @@ grub_cpio_open (grub_file_t file, const char *name) goto fail; if (!ofs) - break; + { + grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); + break; + } if (grub_strcmp (name + 1, fn) == 0) { From 9216e0e742ec8027ec82bd4203a3a24c53ba4f16 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 6 Feb 2008 21:06:34 +0000 Subject: [PATCH 0026/1707] 2008-02-06 Robert Millan * util/grub-probe.c (probe): Simplify partmap probing (with the assumption that the first word up to the underscore equals to the module name). --- ChangeLog | 6 ++++++ util/grub-probe.c | 26 ++++++++++++++------------ 2 files changed, 20 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e69d6332d..d826595ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-06 Robert Millan + + * util/grub-probe.c (probe): Simplify partmap probing (with the + assumption that the first word up to the underscore equals to + the module name). + 2008-02-06 Christian Franke * fs/cpio.c (grub_cpio_find_file): Return GRUB_ERR_NONE diff --git a/util/grub-probe.c b/util/grub-probe.c index 0681d9f59..062889ca9 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -133,21 +133,23 @@ probe (const char *path) if (print == PRINT_PARTMAP) { + char *name; + char *underscore; + if (dev->disk->partition == NULL) grub_util_error ("Cannot detect partition map for %s", drive_name); - if (strcmp (dev->disk->partition->partmap->name, "amiga_partition_map") == 0) - printf ("amiga\n"); - else if (strcmp (dev->disk->partition->partmap->name, "apple_partition_map") == 0) - printf ("apple\n"); - else if (strcmp (dev->disk->partition->partmap->name, "gpt_partition_map") == 0) - printf ("gpt\n"); - else if (strcmp (dev->disk->partition->partmap->name, "pc_partition_map") == 0) - printf ("pc\n"); - else if (strcmp (dev->disk->partition->partmap->name, "sun_partition_map") == 0) - printf ("sun\n"); - else - grub_util_error ("Unknown partition map %s", dev->disk->partition->partmap->name); + name = strdup (dev->disk->partition->partmap->name); + if (! name) + grub_util_error ("not enough memory"); + + underscore = strchr (name, '_'); + if (! underscore) + grub_util_error ("Invalid partition map %s", name); + + *underscore = '\0'; + printf ("%s\n", name); + free (name); goto end; } From f2156fda692afad79f34d5b54a20cfee4bc800bd Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 7 Feb 2008 12:46:45 +0000 Subject: [PATCH 0027/1707] 2008-02-07 Robert Millan Patch from Jeroen Dekkers. * disk/raid.c (grub_raid_scan_device): Reset `grub_errno' on disk failure, since succesfuly reading all array members might not be required. --- ChangeLog | 7 +++++++ disk/raid.c | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d826595ce..5904dd993 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-07 Robert Millan + + Patch from Jeroen Dekkers. + * disk/raid.c (grub_raid_scan_device): Reset `grub_errno' on disk + failure, since succesfuly reading all array members might not be + required. + 2008-02-06 Robert Millan * util/grub-probe.c (probe): Simplify partmap probing (with the diff --git a/disk/raid.c b/disk/raid.c index d5015e047..db7bb98d2 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -343,7 +343,10 @@ grub_raid_scan_device (const char *name) err = grub_disk_read (disk, sector, 0, GRUB_RAID_SB_BYTES, (char *) &sb); grub_disk_close (disk); if (err) - return 0; + { + grub_errno = GRUB_ERR_NONE; + return 0; + } /* Look whether there is a RAID superblock. */ if (sb.md_magic != GRUB_RAID_SB_MAGIC) From 1ec8425d1dac499e13c735d33d5fd9556a479890 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 7 Feb 2008 22:14:33 +0000 Subject: [PATCH 0028/1707] 2008-02-07 Christian Franke * util/hostfs.c (grub_hostfs_open): Use fseeko and ftello instead of fseek and ftell to support large files. (grub_hostfs_read): Likewise. --- ChangeLog | 6 ++++++ util/hostfs.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5904dd993..3ce2e2aa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-07 Christian Franke + + * util/hostfs.c (grub_hostfs_open): Use fseeko and ftello + instead of fseek and ftell to support large files. + (grub_hostfs_read): Likewise. + 2008-02-07 Robert Millan Patch from Jeroen Dekkers. diff --git a/util/hostfs.c b/util/hostfs.c index e8dc59695..2d9b7bed5 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -100,9 +100,9 @@ grub_hostfs_open (struct grub_file *file, const char *name) "can't open `%s'", name); file->data = f; - fseek (f, 0, SEEK_END); - file->size = ftell (f); - fseek (f, 0, SEEK_SET); + fseeko (f, 0, SEEK_END); + file->size = ftello (f); + fseeko (f, 0, SEEK_SET); return GRUB_ERR_NONE; } @@ -113,7 +113,7 @@ grub_hostfs_read (grub_file_t file, char *buf, grub_size_t len) FILE *f; f = (FILE *) file->data; - fseek (f, file->offset, SEEK_SET); + fseeko (f, file->offset, SEEK_SET); int s = fread (buf, 1, len, f); return s; From 554f01874450f3490d21481c8c2358a8a8382dae Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 8 Feb 2008 12:22:51 +0000 Subject: [PATCH 0029/1707] 2008-02-08 Robert Millan * disk/raid.c (grub_raid_open, grub_raid_scan_device): Add a few grub_dprintf() calls. * kern/disk.c (grub_disk_read): Include grub_errmsg in out of range error message. --- ChangeLog | 7 +++++++ disk/raid.c | 8 ++++++++ kern/disk.c | 4 ++-- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ce2e2aa6..6f29be1b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-08 Robert Millan + + * disk/raid.c (grub_raid_open, grub_raid_scan_device): Add a few + grub_dprintf() calls. + * kern/disk.c (grub_disk_read): Include grub_errmsg in out of range + error message. + 2008-02-07 Christian Franke * util/hostfs.c (grub_hostfs_open): Use fseeko and ftello diff --git a/disk/raid.c b/disk/raid.c index db7bb98d2..217742990 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -86,6 +86,8 @@ grub_raid_open (const char *name, grub_disk_t disk) disk->id = array->number; disk->data = array; + grub_dprintf ("raid", "%s: total_devs=%d, disk_size=%d\n", name, array->total_devs, array->disk_size); + switch (array->level) { case 0: @@ -101,6 +103,8 @@ grub_raid_open (const char *name, grub_disk_t disk) disk->total_sectors = (array->total_devs - 1) * array->disk_size; break; } + + grub_dprintf ("raid", "%s: level=%d, total_sectors=%d\n", name, array->level, disk->total_sectors); return 0; } @@ -332,6 +336,8 @@ grub_raid_scan_device (const char *name) struct grub_raid_super_09 sb; struct grub_raid_array *p, *array = NULL; + grub_dprintf ("raid", "Scanning for RAID devices\n"); + disk = grub_disk_open (name); if (!disk) return 0; @@ -488,6 +494,8 @@ grub_raid_scan_device (const char *name) grub_sprintf (array->name, "md%d", array->number); + grub_dprintf ("raid", "Found array: %s\n", array->name); + /* Add our new array to the list. */ array->next = array_list; array_list = array; diff --git a/kern/disk.c b/kern/disk.c index afbdbb05d..2529e8075 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -367,8 +367,8 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE) { grub_error_push (); - grub_dprintf ("disk", "Read out of range: sector 0x%llx.\n", - (unsigned long long) sector); + grub_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n", + (unsigned long long) sector, grub_errmsg); grub_error_pop (); return grub_errno; } From 5626aee18653b460aee4450367fa11273ed1508a Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 8 Feb 2008 12:32:25 +0000 Subject: [PATCH 0030/1707] 2008-02-08 Robert Millan * include/grub/raid.h (struct grub_raid_array): Change type of `device' to a grub_disk_t array. * disk/raid.c (grub_raid_read): Replace `device[x].disk' accesses with `device[x]'. (grub_raid_scan_device): Replace `device[x].name' accesses with `device[x]->name'. Simplify initialization of `array->device[x]'. --- ChangeLog | 9 +++++++++ disk/raid.c | 24 ++++++++++-------------- include/grub/raid.h | 6 +----- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f29be1b7..1b1519e28 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-02-08 Robert Millan + + * include/grub/raid.h (struct grub_raid_array): Change type of `device' + to a grub_disk_t array. + * disk/raid.c (grub_raid_read): Replace `device[x].disk' accesses with + `device[x]'. + (grub_raid_scan_device): Replace `device[x].name' accesses with + `device[x]->name'. Simplify initialization of `array->device[x]'. + 2008-02-08 Robert Millan * disk/raid.c (grub_raid_open, grub_raid_scan_device): Add a few diff --git a/disk/raid.c b/disk/raid.c index 217742990..552124735 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -150,7 +150,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, { grub_uint32_t i; - err = grub_disk_read (array->device[disknr].disk, read_sector, 0, + err = grub_disk_read (array->device[disknr], read_sector, 0, read_size << GRUB_DISK_SECTOR_BITS, buf); if (err) break; @@ -193,9 +193,9 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, for (i = 0; i < array->total_devs; i++) { - if (array->device[i].disk) + if (array->device[i]) { - err = grub_disk_read (array->device[i].disk, sector, 0, + err = grub_disk_read (array->device[i], sector, 0, size << GRUB_DISK_SECTOR_BITS, buf); if (!err) @@ -238,8 +238,8 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, { grub_uint32_t i; - if (array->device[disknr].disk) - err = grub_disk_read (array->device[disknr].disk, read_sector, 0, + if (array->device[disknr]) + err = grub_disk_read (array->device[disknr], read_sector, 0, read_size << GRUB_DISK_SECTOR_BITS, buf); /* If an error occurs when we already have an degraded @@ -247,7 +247,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, if (err && ((array->total_devs - 1) == array->nr_devs)) break; - if (err || ! array->device[disknr].disk) + if (err || ! array->device[disknr]) { /* Either an error occured or the disk is not available. We have to compute this block from the @@ -264,7 +264,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, if (j != (unsigned int) disknr) { - err = grub_disk_read (array->device[j].disk, read_sector, + err = grub_disk_read (array->device[j], read_sector, 0, buf_size, buf2); if (err) return err; @@ -419,7 +419,7 @@ grub_raid_scan_device (const char *name) return 0; } - if (array->device[sb.this_disk.number].name != 0) + if (array->device[sb.this_disk.number]->name != 0) { /* We found multiple devices with the same number. Again, this shouldn't happen.*/ @@ -502,14 +502,10 @@ grub_raid_scan_device (const char *name) } /* Add the device to the array. */ - array->device[sb.this_disk.number].name = grub_strdup (name); - array->device[sb.this_disk.number].disk = grub_disk_open (name); + array->device[sb.this_disk.number] = grub_disk_open (name); - if (! array->device[sb.this_disk.number].name - || ! array->device[sb.this_disk.number].disk) + if (! array->device[sb.this_disk.number]) { - grub_free (array->device[sb.this_disk.number].name); - /* Remove array from the list if we have just added it. */ if (array->nr_devs == 0) { diff --git a/include/grub/raid.h b/include/grub/raid.h index 0ecf5b3a4..8702b49f8 100644 --- a/include/grub/raid.h +++ b/include/grub/raid.h @@ -37,11 +37,7 @@ struct grub_raid_array char *name; /* That will be "md". */ grub_uint64_t disk_size; /* Size of an individual disk, in 512 byte sectors. */ - struct - { - char *name; /* Name of the device */ - grub_disk_t disk; /* The device itself. */ - } device[32]; /* Array of total_devs devices. */ + grub_disk_t device[32]; /* Array of total_devs devices. */ struct grub_raid_array *next; }; From b37a922267020688e9441e7b5c5c670945edf6af Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 8 Feb 2008 21:27:55 +0000 Subject: [PATCH 0031/1707] 2008-02-08 Robert Millan * disk/raid.c: Update copyright. * fs/cpio.c: Likewise. * include/grub/raid.h: Likewise. * loader/i386/pc/multiboot.c: Likewise. * util/hostfs.c: Likewise. --- ChangeLog | 8 ++++++++ disk/raid.c | 2 +- fs/cpio.c | 2 +- include/grub/raid.h | 2 +- loader/i386/pc/multiboot.c | 2 +- util/hostfs.c | 2 +- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b1519e28..55e0d905c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-08 Robert Millan + + * disk/raid.c: Update copyright. + * fs/cpio.c: Likewise. + * include/grub/raid.h: Likewise. + * loader/i386/pc/multiboot.c: Likewise. + * util/hostfs.c: Likewise. + 2008-02-08 Robert Millan * include/grub/raid.h (struct grub_raid_array): Change type of `device' diff --git a/disk/raid.c b/disk/raid.c index 552124735..d5da39709 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -1,7 +1,7 @@ /* raid.c - module to read RAID arrays. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006, 2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/cpio.c b/fs/cpio.c index ad9f2a85e..8c47506ac 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -1,7 +1,7 @@ /* cpio.c - cpio and tar filesystem. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. + * Copyright (C) 2007,2008 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/grub/raid.h b/include/grub/raid.h index 8702b49f8..4af97f1d7 100644 --- a/include/grub/raid.h +++ b/include/grub/raid.h @@ -1,7 +1,7 @@ /* raid.h - On disk structures for RAID. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 011cc9aec..893f11b87 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -1,7 +1,7 @@ /* multiboot.c - boot a multiboot OS image. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/util/hostfs.c b/util/hostfs.c index 2d9b7bed5..828fd9a3f 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -1,7 +1,7 @@ /* hostfs.c - Dummy filesystem to provide access to the hosts filesystem */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. + * Copyright (C) 2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From a96f9caa1d0c21cb4d34c3e98c93b98435effe82 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 8 Feb 2008 22:39:29 +0000 Subject: [PATCH 0032/1707] 2008-02-08 Robert Millan * disk/raid.c (grub_raid_scan_device): Check for `array->device[sb.this_disk.number]' rather than for `array->device[sb.this_disk.number]->name', since the latter is not garanteed to be accessible. --- ChangeLog | 7 +++++++ disk/raid.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 55e0d905c..2e66e76ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-08 Robert Millan + + * disk/raid.c (grub_raid_scan_device): Check for + `array->device[sb.this_disk.number]' rather than for + `array->device[sb.this_disk.number]->name', since the latter is not + garanteed to be accessible. + 2008-02-08 Robert Millan * disk/raid.c: Update copyright. diff --git a/disk/raid.c b/disk/raid.c index d5da39709..8b92b3477 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -419,7 +419,7 @@ grub_raid_scan_device (const char *name) return 0; } - if (array->device[sb.this_disk.number]->name != 0) + if (array->device[sb.this_disk.number] != NULL) { /* We found multiple devices with the same number. Again, this shouldn't happen.*/ From 91a4bf68ff82a80e448f2b8a57911acb600954e3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 9 Feb 2008 10:46:37 +0000 Subject: [PATCH 0033/1707] 2008-02-09 Robert Millan * util/grub-probe.c (main): When `verbosity > 1', set `debug' environment variable to 'all' in order to obtain debug output from non-util/ code. * util/i386/pc/grub-setup.c (main): Likewise. --- ChangeLog | 7 +++++++ util/grub-probe.c | 3 +++ util/i386/pc/grub-setup.c | 3 +++ 3 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2e66e76ab..6aec4618a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-09 Robert Millan + + * util/grub-probe.c (main): When `verbosity > 1', set `debug' + environment variable to 'all' in order to obtain debug output from + non-util/ code. + * util/i386/pc/grub-setup.c (main): Likewise. + 2008-02-08 Robert Millan * disk/raid.c (grub_raid_scan_device): Check for diff --git a/util/grub-probe.c b/util/grub-probe.c index 062889ca9..a0d38fba4 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -295,6 +295,9 @@ main (int argc, char *argv[]) } } + if (verbosity > 1) + grub_env_set ("debug", "all"); + /* Obtain PATH. */ if (optind >= argc) { diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index a101bdbcc..08404eba2 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -653,6 +653,9 @@ main (int argc, char *argv[]) } } + if (verbosity > 1) + grub_env_set ("debug", "all"); + /* Obtain DEST_DEV. */ if (optind >= argc) { From b92f0c18434aeef814af0c30298dbcc2e59ac680 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 9 Feb 2008 10:49:29 +0000 Subject: [PATCH 0034/1707] 2008-02-09 Robert Millan * disk/lvm.c [GRUB_UTIL] (grub_lvm_memberlist): New function. Construct and return a grub_diskmemberlist_t composed of LVM physical volumes. [GRUB_UTIL] (grub_lvm_dev): Add `memberlist' member. * disk/raid.c [GRUB_UTIL] (grub_raid_memberlist): New function. Construct and return a grub_diskmemberlist_t composed of physical array members. [GRUB_UTIL] (grub_raid_dev): Add `memberlist' member. * include/grub/disk.h [GRUB_UTIL] (grub_disk_memberlist): New struct prototype. [GRUB_UTIL] (struct grub_disk_dev): Add `memberlist' function pointer. [GRUB_UTIL] (struct grub_disk_memberlist): New struct declaration. [GRUB_UTIL] (grub_disk_memberlist_t): New typedef. * util/grub-probe.c (probe): Move partmap probing code from here ... (probe_partmap): ... to here. (probe): Use probe_partmap() once for the disk we're probing, and additionally, when such disk contains a memberlist() struct member, once for each disk that is contained in the structure returned by memberlist(). --- ChangeLog | 23 ++++++++++++++++++++ disk/lvm.c | 23 ++++++++++++++++++++ disk/raid.c | 23 ++++++++++++++++++++ include/grub/disk.h | 16 ++++++++++++++ util/grub-probe.c | 53 ++++++++++++++++++++++++++++++++------------- 5 files changed, 123 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6aec4618a..a68720fc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2008-02-09 Robert Millan + + * disk/lvm.c [GRUB_UTIL] (grub_lvm_memberlist): New function. Construct + and return a grub_diskmemberlist_t composed of LVM physical volumes. + [GRUB_UTIL] (grub_lvm_dev): Add `memberlist' member. + + * disk/raid.c [GRUB_UTIL] (grub_raid_memberlist): New function. Construct + and return a grub_diskmemberlist_t composed of physical array members. + [GRUB_UTIL] (grub_raid_dev): Add `memberlist' member. + + * include/grub/disk.h [GRUB_UTIL] (grub_disk_memberlist): New struct + prototype. + [GRUB_UTIL] (struct grub_disk_dev): Add `memberlist' function pointer. + [GRUB_UTIL] (struct grub_disk_memberlist): New struct declaration. + [GRUB_UTIL] (grub_disk_memberlist_t): New typedef. + + * util/grub-probe.c (probe): Move partmap probing code from here ... + (probe_partmap): ... to here. + (probe): Use probe_partmap() once for the disk we're probing, and + additionally, when such disk contains a memberlist() struct member, + once for each disk that is contained in the structure returned by + memberlist(). + 2008-02-09 Robert Millan * util/grub-probe.c (main): When `verbosity > 1', set `debug' diff --git a/disk/lvm.c b/disk/lvm.c index 43c5af8ba..eb5840624 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -52,6 +52,26 @@ grub_lvm_iterate (int (*hook) (const char *name)) return 0; } +#ifdef GRUB_UTIL +static grub_disk_memberlist_t +grub_lvm_memberlist (grub_disk_t disk) +{ + struct grub_lvm_lv *lv = disk->data; + grub_disk_memberlist_t list = NULL, tmp; + struct grub_lvm_pv *pv; + + for (pv = lv->vg->pvs; pv; pv = pv->next) + { + tmp = grub_malloc (sizeof (*tmp)); + tmp->disk = pv->disk; + tmp->next = list; + list = tmp; + } + + return list; +} +#endif + static grub_err_t grub_lvm_open (const char *name, grub_disk_t disk) { @@ -479,6 +499,9 @@ static struct grub_disk_dev grub_lvm_dev = .close = grub_lvm_close, .read = grub_lvm_read, .write = grub_lvm_write, +#ifdef GRUB_UTIL + .memberlist = grub_lvm_memberlist, +#endif .next = 0 }; diff --git a/disk/raid.c b/disk/raid.c index 8b92b3477..0d3177fd1 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -67,6 +67,26 @@ grub_raid_iterate (int (*hook) (const char *name)) return 0; } +#ifdef GRUB_UTIL +static grub_disk_memberlist_t +grub_raid_memberlist (grub_disk_t disk) +{ + struct grub_raid_array *array = disk->data; + grub_disk_memberlist_t list = NULL, tmp; + int i; + + for (i = 0; i < array->total_devs; i++) + { + tmp = grub_malloc (sizeof (*tmp)); + tmp->disk = array->device[i]; + tmp->next = list; + list = tmp; + } + + return list; +} +#endif + static grub_err_t grub_raid_open (const char *name, grub_disk_t disk) { @@ -531,6 +551,9 @@ static struct grub_disk_dev grub_raid_dev = .close = grub_raid_close, .read = grub_raid_read, .write = grub_raid_write, +#ifdef GRUB_UTIL + .memberlist = grub_raid_memberlist, +#endif .next = 0 }; diff --git a/include/grub/disk.h b/include/grub/disk.h index 9891a9cfc..2a79a0bff 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -40,6 +40,9 @@ enum grub_disk_dev_id }; struct grub_disk; +#ifdef GRUB_UTIL +struct grub_disk_memberlist; +#endif /* Disk device. */ struct grub_disk_dev @@ -67,6 +70,10 @@ struct grub_disk_dev grub_err_t (*write) (struct grub_disk *disk, grub_disk_addr_t sector, grub_size_t size, const char *buf); +#ifdef GRUB_UTIL + struct grub_disk_memberlist *(*memberlist) (struct grub_disk *disk); +#endif + /* The next disk device. */ struct grub_disk_dev *next; }; @@ -105,6 +112,15 @@ struct grub_disk }; typedef struct grub_disk *grub_disk_t; +#ifdef GRUB_UTIL +struct grub_disk_memberlist +{ + grub_disk_t disk; + struct grub_disk_memberlist *next; +}; +typedef struct grub_disk_memberlist *grub_disk_memberlist_t; +#endif + /* The sector size. */ #define GRUB_DISK_SECTOR_SIZE 0x200 #define GRUB_DISK_SECTOR_BITS 9 diff --git a/util/grub-probe.c b/util/grub-probe.c index a0d38fba4..3635d74a4 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -74,6 +74,31 @@ grub_refresh (void) { } +static void +probe_partmap (grub_disk_t disk) +{ + char *name; + char *underscore; + + if (disk->partition == NULL) + { + grub_util_info ("No partition map found for %s", disk->name); + return; + } + + name = strdup (disk->partition->partmap->name); + if (! name) + grub_util_error ("Not enough memory"); + + underscore = strchr (name, '_'); + if (! underscore) + grub_util_error ("Invalid partition map %s", name); + + *underscore = '\0'; + printf ("%s\n", name); + free (name); +} + static void probe (const char *path) { @@ -133,23 +158,21 @@ probe (const char *path) if (print == PRINT_PARTMAP) { - char *name; - char *underscore; - - if (dev->disk->partition == NULL) - grub_util_error ("Cannot detect partition map for %s", drive_name); + grub_disk_memberlist_t list = NULL, tmp; - name = strdup (dev->disk->partition->partmap->name); - if (! name) - grub_util_error ("not enough memory"); + /* Check if dev->disk itself is contained in a partmap. */ + probe_partmap (dev->disk); - underscore = strchr (name, '_'); - if (! underscore) - grub_util_error ("Invalid partition map %s", name); - - *underscore = '\0'; - printf ("%s\n", name); - free (name); + /* In case of LVM/RAID, check the member devices as well. */ + if (dev->disk->dev->memberlist) + list = dev->disk->dev->memberlist (dev->disk); + while (list) + { + probe_partmap (list->disk); + tmp = list->next; + free (list); + list = tmp; + } goto end; } From 7a634e08cb47e96a4f6259873b1ceaf7f0417e31 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 9 Feb 2008 10:54:44 +0000 Subject: [PATCH 0035/1707] 2008-02-09 Robert Millan * disk/raid.c (grub_raid_scan_device): Add a pair of sanity checks for situations in which we can deduce the RAID size and the superblock doesn't match it. --- ChangeLog | 6 ++++++ disk/raid.c | 21 +++++++++++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ChangeLog b/ChangeLog index a68720fc7..17b41d46c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-09 Robert Millan + + * disk/raid.c (grub_raid_scan_device): Add a pair of sanity checks for + situations in which we can deduce the RAID size and the superblock + doesn't match it. + 2008-02-09 Robert Millan * disk/lvm.c [GRUB_UTIL] (grub_lvm_memberlist): New function. Construct diff --git a/disk/raid.c b/disk/raid.c index 0d3177fd1..3c4290a51 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -523,6 +523,27 @@ grub_raid_scan_device (const char *name) /* Add the device to the array. */ array->device[sb.this_disk.number] = grub_disk_open (name); + + if (array->disk_size != array->device[sb.this_disk.number]->total_sectors) + { + if (array->total_devs == 1) + { + grub_dprintf ("raid", "Array contains only one disk, but its size (0x%llx) " + "doesn't match with size indicated by superblock (0x%llx). " + "Assuming superblock is wrong.\n", + array->device[sb.this_disk.number]->total_sectors, array->disk_size); + array->disk_size = array->device[sb.this_disk.number]->total_sectors; + } + else if (array->level == 1) + { + grub_dprintf ("raid", "Array is RAID level 1, but the size of disk %d (0x%llx) " + "doesn't match with size indicated by superblock (0x%llx). " + "Assuming superblock is wrong.\n", + sb.this_disk.number, + array->device[sb.this_disk.number]->total_sectors, array->disk_size); + array->disk_size = array->device[sb.this_disk.number]->total_sectors; + } + } if (! array->device[sb.this_disk.number]) { From 3dac2e3fdd8d48a1aea96ca62230bf9e906c8c27 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 9 Feb 2008 10:58:19 +0000 Subject: [PATCH 0036/1707] 2008-02-09 Robert Millan * commands/sleep.c: New file. * conf/common.rmk (pkglib_MODULES): Add `commands/sleep.c'. (sleep_mod_SOURCES): New variable. (sleep_mod_CFLAGS): Likewise. (sleep_mod_LDFLAGS): Likewise. --- ChangeLog | 8 ++++ DISTLIST | 1 + commands/sleep.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++ conf/common.mk | 54 ++++++++++++++++++++++- conf/common.rmk | 7 ++- 5 files changed, 178 insertions(+), 2 deletions(-) create mode 100644 commands/sleep.c diff --git a/ChangeLog b/ChangeLog index 17b41d46c..cb04bfeb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-02-09 Robert Millan + + * commands/sleep.c: New file. + * conf/common.rmk (pkglib_MODULES): Add `commands/sleep.c'. + (sleep_mod_SOURCES): New variable. + (sleep_mod_CFLAGS): Likewise. + (sleep_mod_LDFLAGS): Likewise. + 2008-02-09 Robert Millan * disk/raid.c (grub_raid_scan_device): Add a pair of sanity checks for diff --git a/DISTLIST b/DISTLIST index 3c789d448..8ed5c9e94 100644 --- a/DISTLIST +++ b/DISTLIST @@ -46,6 +46,7 @@ commands/ls.c commands/lspci.c commands/read.c commands/search.c +commands/sleep.c commands/terminal.c commands/test.c commands/videotest.c diff --git a/commands/sleep.c b/commands/sleep.c new file mode 100644 index 000000000..f4ee41b82 --- /dev/null +++ b/commands/sleep.c @@ -0,0 +1,110 @@ +/* sleep.c - Command to wait a specified number of seconds. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static const struct grub_arg_option options[] = + { + {"verbose", 'v', 0, "verbose countdown", 0, 0}, + {"interruptible", 'i', 0, "interruptible with ESC", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + +static grub_uint8_t x, y; + +static void +do_print (int n) +{ + grub_gotoxy (x, y); + /* NOTE: Do not remove the trailing space characters. + They are required to clear the line. */ + grub_printf ("%d ", n); +} + +/* Based on grub_millisleep() from kern/misc.c. */ +static int +grub_interruptible_millisleep (grub_uint32_t ms) +{ + grub_uint32_t end_at; + + end_at = grub_get_rtc () + grub_div_roundup (ms * GRUB_TICKS_PER_SECOND, 1000); + + while (grub_get_rtc () < end_at) + if (GRUB_TERM_ASCII_CHAR (grub_checkkey ()) == GRUB_TERM_ESC) + return 1; + + return 0; +} + +static grub_err_t +grub_cmd_sleep (struct grub_arg_list *state, int argc, char **args) +{ + grub_uint16_t xy; + int n; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing operand"); + + n = grub_strtoul (args[0], 0, 10); + + if (n == 0) + { + /* Either `0' or broken input. */ + return 0; + } + + xy = grub_getxy (); + x = xy >> 8; + y = xy & 0xff; + + for (; n; n--) + { + if (state[0].set) + do_print (n); + + if (state[1].set) + { + if (grub_interruptible_millisleep (1000)) + return 1; + } + else + grub_millisleep (1000); + } + if (state[0].set) + do_print (0); + + return 0; +} + + +GRUB_MOD_INIT(sleep) +{ + grub_register_command ("sleep", grub_cmd_sleep, GRUB_COMMAND_FLAG_BOTH, + "sleep NUMBER_OF_SECONDS", "Wait for a specified number of seconds", options); +} + +GRUB_MOD_FINI(sleep) +{ + grub_unregister_command ("sleep"); +} diff --git a/conf/common.mk b/conf/common.mk index b262ef577..c932b21fd 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1709,7 +1709,7 @@ pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod + read.mod sleep.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -2716,3 +2716,55 @@ fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) g read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For sleep.mod. +sleep_mod_SOURCES = commands/sleep.c +CLEANFILES += sleep.mod mod-sleep.o mod-sleep.c pre-sleep.o sleep_mod-commands_sleep.o und-sleep.lst +ifneq ($(sleep_mod_EXPORTS),no) +CLEANFILES += def-sleep.lst +DEFSYMFILES += def-sleep.lst +endif +MOSTLYCLEANFILES += sleep_mod-commands_sleep.d +UNDSYMFILES += und-sleep.lst + +sleep.mod: pre-sleep.o mod-sleep.o + -rm -f $@ + $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-sleep.o: $(sleep_mod_DEPENDENCIES) sleep_mod-commands_sleep.o + -rm -f $@ + $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sleep_mod-commands_sleep.o + +mod-sleep.o: mod-sleep.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -c -o $@ $< + +mod-sleep.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'sleep' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(sleep_mod_EXPORTS),no) +def-sleep.lst: pre-sleep.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sleep/' > $@ +endif + +und-sleep.lst: pre-sleep.o + echo 'sleep' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +sleep_mod-commands_sleep.o: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -MD -c -o $@ $< +-include sleep_mod-commands_sleep.d + +CLEANFILES += cmd-sleep_mod-commands_sleep.lst fs-sleep_mod-commands_sleep.lst +COMMANDFILES += cmd-sleep_mod-commands_sleep.lst +FSFILES += fs-sleep_mod-commands_sleep.lst + +cmd-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sleep > $@ || (rm -f $@; exit 1) + +fs-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sleep > $@ || (rm -f $@; exit 1) + + +sleep_mod_CFLAGS = $(COMMON_CFLAGS) +sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/common.rmk b/conf/common.rmk index 360da9b69..8c04a5bfc 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -265,7 +265,7 @@ pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod + read.mod sleep.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -364,3 +364,8 @@ gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) read_mod_SOURCES = commands/read.c read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For sleep.mod. +sleep_mod_SOURCES = commands/sleep.c +sleep_mod_CFLAGS = $(COMMON_CFLAGS) +sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) From c1962162934df7f1b0b399b380e4b5d109609238 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 9 Feb 2008 11:00:19 +0000 Subject: [PATCH 0037/1707] 2008-02-09 Robert Millan * normal/menu.c (run_menu): If timeout is set to zero, don't bother drawing the menu. --- ChangeLog | 5 +++++ normal/menu.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index cb04bfeb1..e0846ea4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-09 Robert Millan + + * normal/menu.c (run_menu): If timeout is set to zero, don't bother + drawing the menu. + 2008-02-09 Robert Millan * commands/sleep.c: New file. diff --git a/normal/menu.c b/normal/menu.c index 5d120b917..1d4d4ec73 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -339,6 +339,10 @@ run_menu (grub_menu_t menu, int nested) if (default_entry < 0 || default_entry >= menu->size) default_entry = 0; + /* If timeout is 0, drawing is pointless (and ugly). */ + if (get_timeout () == 0) + return default_entry; + offset = default_entry; if (offset > GRUB_TERM_NUM_ENTRIES - 1) { From 0d9ff7f075ebd7d644b011108c9563d5a6711190 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 9 Feb 2008 11:02:26 +0000 Subject: [PATCH 0038/1707] 2008-02-08 Christian Franke * commands/cat.c (grub_cmd_cat): Print '\r' as hex to avoid overwriting previous output. * kern/rescue.c (grub_rescue_cmd_cat): Likewise. --- ChangeLog | 6 ++++++ commands/cat.c | 2 +- kern/rescue.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0846ea4d..7e84a1ec8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-08 Christian Franke + + * commands/cat.c (grub_cmd_cat): Print '\r' as hex to + avoid overwriting previous output. + * kern/rescue.c (grub_rescue_cmd_cat): Likewise. + 2008-02-09 Robert Millan * normal/menu.c (run_menu): If timeout is set to zero, don't bother diff --git a/commands/cat.c b/commands/cat.c index 35b4c14a9..834fd063b 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -50,7 +50,7 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), { unsigned char c = buf[i]; - if (grub_isprint (c) || grub_isspace (c)) + if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') grub_putchar (c); else { diff --git a/kern/rescue.c b/kern/rescue.c index bd5d579f9..bb0c65087 100644 --- a/kern/rescue.c +++ b/kern/rescue.c @@ -151,7 +151,7 @@ grub_rescue_cmd_cat (int argc, char *argv[]) { unsigned char c = buf[i]; - if (grub_isprint (c) || grub_isspace (c)) + if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') grub_putchar (c); else { From 68807e5f37fef90fb353df6277a7eef28ee77d3f Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 9 Feb 2008 12:31:11 +0000 Subject: [PATCH 0039/1707] 2008-02-09 Robert Millan * configure.ac: Probe for `help2man'. * Makefile.in (builddir): New variable. (HELP2MAN): Likewise. Set to `true' when @HELP2MAN@ doesn't provide it, or otherwise add a few flags/options to it. (install-local): For every executable utility or script that is installed, invoke $(HELP2MAN) to install a manpage based on --help output. * util/i386/pc/grub-install.in: Move down `update-grub_lib' sourcing, so that it doesn't prevent --help from working in build tree. * util/i386/pc/grub-mkrescue.in (usage): Replace `grub-devel@gnu.org' with `bug-grub@gnu.org'. * util/powerpc/ieee1275/grub-mkrescue.in (usage): Likewise. * util/update-grub.in (usage): New function. Implement proper argument check, with support for --help and --version (as well as existing -y). --- ChangeLog | 22 +++++++++++- Makefile.in | 15 +++++++-- configure | 46 ++++++++++++++++++++++++-- configure.ac | 3 +- util/i386/pc/grub-install.in | 6 ++-- util/i386/pc/grub-mkrescue.in | 2 +- util/powerpc/ieee1275/grub-mkrescue.in | 2 +- util/update-grub.in | 39 +++++++++++++++++++--- 8 files changed, 120 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7e84a1ec8..6de01cff1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,24 @@ -2008-02-08 Christian Franke +2008-02-09 Robert Millan + + * configure.ac: Probe for `help2man'. + * Makefile.in (builddir): New variable. + (HELP2MAN): Likewise. Set to `true' when @HELP2MAN@ doesn't provide it, + or otherwise add a few flags/options to it. + (install-local): For every executable utility or script that is + installed, invoke $(HELP2MAN) to install a manpage based on --help + output. + + * util/i386/pc/grub-install.in: Move down `update-grub_lib' sourcing, so + that it doesn't prevent --help from working in build tree. + + * util/i386/pc/grub-mkrescue.in (usage): Replace `grub-devel@gnu.org' + with `bug-grub@gnu.org'. + * util/powerpc/ieee1275/grub-mkrescue.in (usage): Likewise. + * util/update-grub.in (usage): New function. + Implement proper argument check, with support for --help and --version + (as well as existing -y). + +2008-02-09 Christian Franke * commands/cat.c (grub_cmd_cat): Print '\r' as hex to avoid overwriting previous output. diff --git a/Makefile.in b/Makefile.in index ba0757795..c2f432ff3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -20,6 +20,7 @@ SHELL = /bin/sh transform = @program_transform_name@ srcdir = @srcdir@ +builddir = @builddir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ prefix = @prefix@ @@ -71,6 +72,12 @@ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ NM = @NM@ RUBY = @RUBY@ +HELP2MAN = @HELP2MAN@ +ifeq (, $(HELP2MAN)) +HELP2MAN = true +else +HELP2MAN := LANG=C $(HELP2MAN) --no-info --source=FSF +endif AWK = @AWK@ LIBCURSES = @LIBCURSES@ LIBLZO = @LIBLZO@ @@ -157,27 +164,31 @@ install-local: all dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \ done - $(mkinstalldirs) $(DESTDIR)$(bindir) + $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 @list='$(bin_UTILITIES)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ + $(HELP2MAN) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$dest.1; \ done - $(mkinstalldirs) $(DESTDIR)$(sbindir) + $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 @list='$(sbin_UTILITIES)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ + $(HELP2MAN) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \ done @list='$(bin_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ + $(HELP2MAN) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$dest.1; \ done @list='$(sbin_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ + $(HELP2MAN) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \ done $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d @list='$(update-grub_SCRIPTS)'; for file in $$list; do \ diff --git a/configure b/configure index 99e2eede1..9177d9c7d 100644 --- a/configure +++ b/configure @@ -674,6 +674,7 @@ INSTALL_DATA AWK SET_MAKE RUBY +HELP2MAN CC CFLAGS LDFLAGS @@ -2237,7 +2238,7 @@ echo "${ECHO_T}no" >&6; } fi -# This is not a "must". +# These are not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 { echo "$as_me:$LINENO: checking for $ac_word" >&5 @@ -2278,6 +2279,46 @@ echo "${ECHO_T}no" >&6; } fi +# Extract the first word of "help2man", so it can be a program name with args. +set dummy help2man; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_path_HELP2MAN+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $HELP2MAN in + [\\/]* | ?:[\\/]*) + ac_cv_path_HELP2MAN="$HELP2MAN" # Let the user override the test with a path. + ;; + *) + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + + ;; +esac +fi +HELP2MAN=$ac_cv_path_HELP2MAN +if test -n "$HELP2MAN"; then + { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 +echo "${ECHO_T}$HELP2MAN" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + # # Checks for host programs. @@ -8844,6 +8885,7 @@ INSTALL_DATA!$INSTALL_DATA$ac_delim AWK!$AWK$ac_delim SET_MAKE!$SET_MAKE$ac_delim RUBY!$RUBY$ac_delim +HELP2MAN!$HELP2MAN$ac_delim CC!$CC$ac_delim CFLAGS!$CFLAGS$ac_delim LDFLAGS!$LDFLAGS$ac_delim @@ -8870,7 +8912,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 83; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 73f60875f..38c957243 100644 --- a/configure.ac +++ b/configure.ac @@ -115,8 +115,9 @@ AC_PROG_INSTALL AC_PROG_AWK AC_PROG_MAKE_SET -# This is not a "must". +# These are not a "must". AC_PATH_PROG(RUBY, ruby) +AC_PATH_PROG(HELP2MAN, help2man) # # Checks for host programs. diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 4428816fa..34e98e9f4 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -45,9 +45,6 @@ force_lba= recheck=no debug=no -# for make_system_path_relative_to_its_root() -. ${libdir}/grub/update-grub_lib - # Usage: usage # Print the usage. usage () { @@ -120,6 +117,9 @@ for option in "$@"; do esac done +# for make_system_path_relative_to_its_root() +. ${libdir}/grub/update-grub_lib + if test "x$install_device" = x; then echo "install_device not specified." 1>&2 usage diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 835f73189..620c0f093 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -49,7 +49,7 @@ Make GRUB rescue image. grub-mkimage generates a bootable rescue image of the specified type. -Report bugs to . +Report bugs to . EOF } diff --git a/util/powerpc/ieee1275/grub-mkrescue.in b/util/powerpc/ieee1275/grub-mkrescue.in index 61495abcd..8e72eac8b 100644 --- a/util/powerpc/ieee1275/grub-mkrescue.in +++ b/util/powerpc/ieee1275/grub-mkrescue.in @@ -48,7 +48,7 @@ Make GRUB rescue image. grub-mkimage generates a bootable rescue CD image for PowerMac and CHRP. -Report bugs to . +Report bugs to . EOF } diff --git a/util/update-grub.in b/util/update-grub.in index ed8864529..b4bb6058d 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -31,6 +31,41 @@ platform=@platform@ grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "$0 (GNU GRUB ${PACKAGE_VERSION})" + exit 0 ;; + -y) + echo "$0: warning: Ignoring -y option (no longer needed)." >&2 + ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + esac +done + # for convert_system_path_to_grub_path(), font_path() . ${libdir}/grub/update-grub_lib @@ -43,10 +78,6 @@ if [ "$UID" != 0 ] ; then exit 1 fi -if [ "$1" = "-y" ] ; then - echo "$0: warning: Ignoring -y option (no longer needed)." >&2 -fi - set $grub_mkdevicemap dummy if test -f "$1"; then : From 78d5a08be1e2c1e7eb01838585a84bbb10dfde35 Mon Sep 17 00:00:00 2001 From: chaac Date: Sun, 10 Feb 2008 11:04:38 +0000 Subject: [PATCH 0040/1707] 2008-02-09 Vesa Jaaskelainen * font/manager.c (unknown_glyph): Added variable for unknown glyph. (fill_with_default_glyph): Changed to use unknown_glyph for fill pattern for unknown glyphs. --- ChangeLog | 6 ++++++ font/manager.c | 24 +++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6de01cff1..516282d02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-09 Vesa Jaaskelainen + + * font/manager.c (unknown_glyph): Added variable for unknown glyph. + (fill_with_default_glyph): Changed to use unknown_glyph for fill + pattern for unknown glyphs. + 2008-02-09 Robert Millan * configure.ac: Probe for `help2man'. diff --git a/font/manager.c b/font/manager.c index 8d5f0213b..80d8d07b5 100644 --- a/font/manager.c +++ b/font/manager.c @@ -40,6 +40,27 @@ struct font static struct font *font_list; +/* Fill unknown glyph's with rounded question mark. */ +static grub_uint8_t unknown_glyph[16] = +{ /* 76543210 */ + 0x7C, /* ooooo */ + 0x82, /* o o */ + 0xBA, /* o ooo o */ + 0xAA, /* o o o o */ + 0xAA, /* o o o o */ + 0x8A, /* o o o */ + 0x9A, /* o oo o */ + 0x92, /* o o o */ + 0x92, /* o o o */ + 0x92, /* o o o */ + 0x92, /* o o o */ + 0x82, /* o o */ + 0x92, /* o o o */ + 0x82, /* o o */ + 0x7C, /* ooooo */ + 0x00 /* */ +}; + static int add_font (const char *filename) { @@ -154,8 +175,9 @@ fill_with_default_glyph (grub_font_glyph_t glyph) { unsigned i; + /* Use pre-defined pattern to fill unknown glyphs. */ for (i = 0; i < 16; i++) - glyph->bitmap[i] = (i & 1) ? 0x55 : 0xaa; + glyph->bitmap[i] = unknown_glyph[i]; glyph->char_width = 1; glyph->width = glyph->char_width * 8; From 83abee317d863cf3ed68faf1d635b8f107453cfe Mon Sep 17 00:00:00 2001 From: boeglin Date: Sun, 10 Feb 2008 15:18:03 +0000 Subject: [PATCH 0041/1707] 2008-02-10 Alexandre Boeglin * normal/arg.c (grub_arg_parse): If one of the args is "--", call add_arg() on remaining N args, instead of "--" arg N times. --- ChangeLog | 5 +++++ normal/arg.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 516282d02..586cc1dc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-10 Alexandre Boeglin + + * normal/arg.c (grub_arg_parse): If one of the args is "--", call add_arg() + on remaining N args, instead of "--" arg N times. + 2008-02-09 Vesa Jaaskelainen * font/manager.c (unknown_glyph): Added variable for unknown glyph. diff --git a/normal/arg.c b/normal/arg.c index ab3613d7f..3aa6a0331 100644 --- a/normal/arg.c +++ b/normal/arg.c @@ -313,7 +313,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, if (grub_strlen (arg) == 2) { for (curarg++; curarg < argc; curarg++) - if (add_arg (arg) != 0) + if (add_arg (argv[curarg]) != 0) goto fail; break; } From b5db202af3b335f71ef0b48e6837ad7038c3d358 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 10 Feb 2008 17:05:10 +0000 Subject: [PATCH 0042/1707] 2008-02-10 Robert Millan * kern/main.c (grub_load_normal_mode): Do not reset `grub_errno'. Call grub_print_error() instead. This will let user know why we're entering rescue mode. Based on suggestions from Sam Morris. --- ChangeLog | 7 +++++++ kern/main.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 586cc1dc8..1288cfe1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-10 Robert Millan + + * kern/main.c (grub_load_normal_mode): Do not reset `grub_errno'. Call + grub_print_error() instead. This will let user know why we're entering + rescue mode. + Based on suggestions from Sam Morris. + 2008-02-10 Alexandre Boeglin * normal/arg.c (grub_arg_parse): If one of the args is "--", call add_arg() diff --git a/kern/main.c b/kern/main.c index 2ecccc21a..09de03ade 100644 --- a/kern/main.c +++ b/kern/main.c @@ -102,8 +102,8 @@ grub_load_normal_mode (void) /* Load the module. */ grub_dl_load ("normal"); - /* Ignore any error, because we have the rescue mode anyway. */ - grub_errno = GRUB_ERR_NONE; + /* Something went wrong. Print errors here to let user know why we're entering rescue mode. */ + grub_print_error (); } /* The main routine. */ From bf7486424d6f1827c2986e1b362df4d3e939cf1d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 10 Feb 2008 20:00:37 +0000 Subject: [PATCH 0043/1707] 2008-02-10 Robert Millan * conf/i386-efi.rmk (grub_emu_SOURCES): Add `disk/raid.c' and `disk/lvm.c'. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Move `disk/raid.c' and `disk/lvm.c' to the end of the list. * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. --- ChangeLog | 12 +++++++++ conf/i386-efi.mk | 7 +++-- conf/i386-efi.rmk | 7 +++-- conf/i386-ieee1275.mk | 33 +++++++++++++----------- conf/i386-ieee1275.rmk | 9 ++++--- conf/i386-linuxbios.mk | 33 +++++++++++++----------- conf/i386-linuxbios.rmk | 9 ++++--- conf/i386-pc.mk | 54 ++++++++++++++++++++++++--------------- conf/i386-pc.rmk | 14 +++++++--- conf/powerpc-ieee1275.mk | 23 ++++++++++++----- conf/powerpc-ieee1275.rmk | 7 +++-- 11 files changed, 136 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1288cfe1b..00490a183 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-02-10 Robert Millan + + * conf/i386-efi.rmk (grub_emu_SOURCES): Add `disk/raid.c' and + `disk/lvm.c'. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Move `disk/raid.c' and + `disk/lvm.c' to the end of the list. + * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + 2008-02-10 Robert Millan * kern/main.c (grub_load_normal_mode): Do not reset `grub_errno'. Call diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 0faf76598..bc8d87b39 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -95,8 +95,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 3d47181bd..8310e6b93 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -59,8 +59,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index deb2a9905..e9c0a386c 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -210,7 +210,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c disk/raid.c disk/lvm.c \ + disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ @@ -231,13 +231,16 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-grub_emu_init.d + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -307,14 +310,6 @@ grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_loopback.d -grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid.d - -grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_lvm.d - grub_emu-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_affs.d @@ -551,6 +546,14 @@ grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c $(util/i386/pc/misc.c_DEPENDEN $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_i386_pc_misc.d +grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid.d + +grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_lvm.d + grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-grub_emu_init.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index de0b1b7b0..98d78c191 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -64,7 +64,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/ieee1275/halt.c commands/ieee1275/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c disk/raid.c disk/lvm.c \ + disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ @@ -85,8 +85,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 8e3484253..aceb204dd 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -197,7 +197,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c disk/raid.c disk/lvm.c \ + disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ @@ -218,13 +218,16 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-grub_emu_init.d + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -294,14 +297,6 @@ grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_loopback.d -grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid.d - -grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_lvm.d - grub_emu-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_affs.d @@ -538,6 +533,14 @@ grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c $(util/i386/pc/misc.c_DEPENDEN $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_i386_pc_misc.d +grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid.d + +grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_lvm.d + grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-grub_emu_init.d diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 218352a3e..4a002a6c3 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -63,7 +63,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c disk/raid.c disk/lvm.c \ + disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ @@ -84,8 +84,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 0d9285358..2cb49cefd 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -263,12 +263,15 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ fs/ufs.c fs/xfs.c \ \ partmap/pc.c partmap/gpt.c \ - util/raid.c util/lvm.c grub_setup_init.c -CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d + \ + disk/raid.c disk/lvm.c \ + util/raid.c util/lvm.c \ + grub_setup_init.c +CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) +grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o + $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(util/i386/pc/grub-setup.c_DEPENDENCIES) $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< @@ -394,6 +397,14 @@ grub_setup-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-partmap_gpt.d +grub_setup-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< +-include grub_setup-disk_raid.d + +grub_setup-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< +-include grub_setup-disk_lvm.d + grub_setup-util_raid.o: util/raid.c $(util/raid.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-util_raid.d @@ -437,7 +448,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c disk/raid.c disk/lvm.c \ + disk/host.c disk/loopback.c \ fs/fshelp.c \ \ io/gzio.c \ @@ -458,13 +469,16 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/ufs.c fs/xfs.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-grub_emu_init.d + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -534,14 +548,6 @@ grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_loopback.d -grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid.d - -grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_lvm.d - grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d @@ -778,6 +784,14 @@ grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c $(util/i386/pc/misc.c_DEPENDEN $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_i386_pc_misc.d +grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid.d + +grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_lvm.d + grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-grub_emu_init.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 78e4f0005..06e9a7e57 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -91,7 +91,10 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ fs/ufs.c fs/xfs.c \ \ partmap/pc.c partmap/gpt.c \ - util/raid.c util/lvm.c grub_setup_init.c + \ + disk/raid.c disk/lvm.c \ + util/raid.c util/lvm.c \ + grub_setup_init.c # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ @@ -105,7 +108,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/i386/pc/halt.c commands/i386/pc/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c disk/raid.c disk/lvm.c \ + disk/host.c disk/loopback.c \ fs/fshelp.c \ \ io/gzio.c \ @@ -126,8 +129,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/ufs.c fs/xfs.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/i386/pc/misc.c grub_emu_init.c + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index b7b262f4f..cdfb8729e 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -106,13 +106,16 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/powerpc/ieee1275/misc.c grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d + util/biosdisk.c util/getroot.c \ + util/powerpc/ieee1275/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_script.tab.c grub_emu_init.c +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -398,6 +401,14 @@ grub_emu-util_powerpc_ieee1275_misc.o: util/powerpc/ieee1275/misc.c $(util/power $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_powerpc_ieee1275_misc.d +grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid.d + +grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_lvm.d + grub_emu-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-grub_script_tab.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index f742267f8..c6d93f0ee 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -70,8 +70,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ - util/powerpc/ieee1275/misc.c grub_script.tab.c grub_emu_init.c + util/biosdisk.c util/getroot.c \ + util/powerpc/ieee1275/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_script.tab.c grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) From d0db4b0454e6747d7fc133ef264119ae602a2048 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 11 Feb 2008 15:47:35 +0000 Subject: [PATCH 0044/1707] 2008-02-11 Robert Millan * util/biosdisk.c (grub_util_biosdisk_open, linux_find_partition) (grub_util_biosdisk_get_grub_dev): Check open() exit status by comparing it with -1, not 0. --- ChangeLog | 6 ++++++ util/biosdisk.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00490a183..95376ee36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-11 Robert Millan + + * util/biosdisk.c (grub_util_biosdisk_open, linux_find_partition) + (grub_util_biosdisk_get_grub_dev): Check open() exit status by + comparing it with -1, not 0. + 2008-02-10 Robert Millan * conf/i386-efi.rmk (grub_emu_SOURCES): Add `disk/raid.c' and diff --git a/util/biosdisk.c b/util/biosdisk.c index ee9041f3d..4dd46d6b1 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -167,7 +167,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) int fd; fd = open (map[drive], O_RDONLY); - if (! fd) + if (fd == -1) return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[drive]); if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) @@ -254,7 +254,7 @@ linux_find_partition (char *dev, unsigned long sector) sprintf (p, format, i); fd = open (real_dev, O_RDONLY); - if (! fd) + if (fd == -1) return 0; if (ioctl (fd, HDIO_GETGEO, &hdg)) @@ -773,7 +773,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return name; fd = open (os_dev, O_RDONLY); - if (! fd) + if (fd == -1) { grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", os_dev); free (name); From c74493e01f1c55ba53bb00c0694fae12c4587983 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 12 Feb 2008 22:45:58 +0000 Subject: [PATCH 0045/1707] 2008-02-12 Robert Millan * util/getroot.c (grub_guess_root_device): Inspect /dev/evms before /dev (like it is done for /dev/mapper). This doesn't provide support for EVMS, but at least it is now easy to identify the problem when it arises. --- ChangeLog | 7 +++++++ util/getroot.c | 9 +++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95376ee36..a78bb0961 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-02-12 Robert Millan + + * util/getroot.c (grub_guess_root_device): Inspect /dev/evms before + /dev (like it is done for /dev/mapper). This doesn't provide support + for EVMS, but at least it is now easy to identify the problem when it + arises. + 2008-02-11 Robert Millan * util/biosdisk.c (grub_util_biosdisk_open, linux_find_partition) diff --git a/util/getroot.c b/util/getroot.c index 74ee6d667..a591dc81f 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -228,9 +228,14 @@ grub_guess_root_device (const char *dir) #ifdef __linux__ /* We first try to find the device in the /dev/mapper directory. If we don't do this, we get useless device names like /dev/dm-0 for - LVM. */ + LVM. */ os_dev = find_root_device ("/dev/mapper", st.st_dev); - if (!os_dev) + + /* The same applies to /dev/evms directory (for EVMS volumes). */ + if (! os_dev) + os_dev = find_root_device ("/dev/evms", st.st_dev); + + if (! os_dev) #endif { /* This might be truly slow, but is there any better way? */ From f714229e342b5098fd01881f60158327e85440ad Mon Sep 17 00:00:00 2001 From: boeglin Date: Tue, 12 Feb 2008 23:47:07 +0000 Subject: [PATCH 0046/1707] 2008-02-12 Alexandre Boeglin * conf/i386-efi.rmk (grub_emu_SOURCES): Replace commands/i386/pc/halt.c and reboot.c by commands/halt.c and reboot.c. (grub_install_SOURCES): Add halt.mod and reboot.mod. (halt_mod_SOURCES): New variable. (halt_mod_CFLAGS): Likewise. (halt_mod_LDFLAGS): Likewise. (reboot_mod_SOURCES): Likewise. (reboot_mod_CFLAGS): Likewise. (reboot_mod_LDFLAGS): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace commands/ieee1275/halt.c and reboot.c by commands/halt.c and reboot.c. (halt_mod_SOURCES): Likewise. (reboot_mod_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Replace commands/i386/pc/reboot.c by commands/reboot.c. (reboot_mod_SOURCES): Likewise. * commands/i386/pc/reboot.c: merge this file ... * commands/ieee1275/reboot.c: ... and this file ... * commands/reboot.c: ... to this file. Add some precompiler directive to include the correct header for each machine. * commands/ieee1275/halt.c: move this file ... * commands/halt.c: ... to here. Add some precompiler directive to include the correct header for each machine. * include/grub/efi/efi.h (grub_reboot): New function declaration. (grub_halt): Likewise. * kern/efi/efi.c (grub_reboot): New function. (grub_halt): Likewise. --- ChangeLog | 41 ++++++++++++++++++++++++++++++ commands/{ieee1275 => }/halt.c | 13 +++++++--- commands/ieee1275/reboot.c | 45 --------------------------------- commands/{i386/pc => }/reboot.c | 14 +++++++--- conf/i386-efi.rmk | 14 ++++++++-- conf/i386-ieee1275.rmk | 6 ++--- conf/i386-pc.rmk | 4 +-- include/grub/efi/efi.h | 4 ++- kern/efi/efi.c | 18 ++++++++++++- 9 files changed, 97 insertions(+), 62 deletions(-) rename commands/{ieee1275 => }/halt.c (84%) delete mode 100644 commands/ieee1275/reboot.c rename commands/{i386/pc => }/reboot.c (82%) diff --git a/ChangeLog b/ChangeLog index a78bb0961..ede054640 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2008-02-12 Alexandre Boeglin + + * conf/i386-efi.rmk (grub_emu_SOURCES): Replace commands/i386/pc/halt.c and + reboot.c by commands/halt.c and reboot.c. + (grub_install_SOURCES): Add halt.mod and reboot.mod. + (halt_mod_SOURCES): New variable. + (halt_mod_CFLAGS): Likewise. + (halt_mod_LDFLAGS): Likewise. + (reboot_mod_SOURCES): Likewise. + (reboot_mod_CFLAGS): Likewise. + (reboot_mod_LDFLAGS): Likewise. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace commands/ieee1275/halt.c + and reboot.c by commands/halt.c and reboot.c. + (halt_mod_SOURCES): Likewise. + (reboot_mod_SOURCES): Likewise. + + * conf/i386-pc.rmk (grub_emu_SOURCES): Replace commands/i386/pc/reboot.c by + commands/reboot.c. + (reboot_mod_SOURCES): Likewise. + + * commands/i386/pc/reboot.c: merge this file ... + + * commands/ieee1275/reboot.c: ... and this file ... + + * commands/reboot.c: ... to this file. + Add some precompiler directive to include the correct header for each + machine. + + * commands/ieee1275/halt.c: move this file ... + + * commands/halt.c: ... to here. + Add some precompiler directive to include the correct header for each + machine. + + * include/grub/efi/efi.h (grub_reboot): New function declaration. + (grub_halt): Likewise. + + * kern/efi/efi.c (grub_reboot): New function. + (grub_halt): Likewise. + 2008-02-12 Robert Millan * util/getroot.c (grub_guess_root_device): Inspect /dev/evms before diff --git a/commands/ieee1275/halt.c b/commands/halt.c similarity index 84% rename from commands/ieee1275/halt.c rename to commands/halt.c index e6ec52c95..65da1ea0a 100644 --- a/commands/ieee1275/halt.c +++ b/commands/halt.c @@ -1,7 +1,7 @@ /* halt.c - command to halt the computer. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,8 +19,13 @@ #include #include -#include +#include + +#if defined(GRUB_MACHINE_IEEE1275) #include +#elif defined(GRUB_MACHINE_EFI) +#include +#endif static grub_err_t grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)), @@ -32,7 +37,7 @@ grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)), } -GRUB_MOD_INIT(ieee1275_halt) +GRUB_MOD_INIT(halt) { (void)mod; /* To stop warning. */ grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH, @@ -40,7 +45,7 @@ GRUB_MOD_INIT(ieee1275_halt) " work on all firmware.", 0); } -GRUB_MOD_FINI(ieee1275_halt) +GRUB_MOD_FINI(halt) { grub_unregister_command ("halt"); } diff --git a/commands/ieee1275/reboot.c b/commands/ieee1275/reboot.c deleted file mode 100644 index c0a3e9cce..000000000 --- a/commands/ieee1275/reboot.c +++ /dev/null @@ -1,45 +0,0 @@ -/* reboot.c - command to reboot the computer. */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static grub_err_t -grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char **args __attribute__ ((unused))) -{ - grub_reboot (); - return 0; -} - - -GRUB_MOD_INIT(ieee1275_reboot) -{ - (void)mod; /* To stop warning. */ - grub_register_command ("reboot", grub_cmd_reboot, GRUB_COMMAND_FLAG_BOTH, - "reboot", "Reboot the computer", 0); -} - -GRUB_MOD_FINI(ieee1275_reboot) -{ - grub_unregister_command ("reboot"); -} diff --git a/commands/i386/pc/reboot.c b/commands/reboot.c similarity index 82% rename from commands/i386/pc/reboot.c rename to commands/reboot.c index df691d557..c668b36bd 100644 --- a/commands/i386/pc/reboot.c +++ b/commands/reboot.c @@ -1,7 +1,7 @@ /* reboot.c - command to reboot the computer. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,20 +19,26 @@ #include #include -#include +#include + +#if defined(GRUB_MACHINE_IEEE1275) +#include +#elif defined(GRUB_MACHINE_EFI) +#include +#elif defined(GRUB_MACHINE_PCBIOS) #include +#endif + static grub_err_t grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) - { grub_reboot (); return 0; } - GRUB_MOD_INIT(reboot) { diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 8310e6b93..ffba6128d 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -37,7 +37,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ + commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/loopback.c \ \ @@ -75,7 +75,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod \ - _linux.mod linux.mod cpuid.mod + _linux.mod linux.mod cpuid.mod halt.mod reboot.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -138,4 +138,14 @@ cpuid_mod_SOURCES = commands/i386/cpuid.c cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For halt.mod. +halt_mod_SOURCES = commands/halt.c +halt_mod_CFLAGS = $(COMMON_CFLAGS) +halt_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For reboot.mod. +reboot_mod_SOURCES = commands/reboot.c +reboot_mod_CFLAGS = $(COMMON_CFLAGS) +reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 98d78c191..01e354879 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -62,7 +62,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/ieee1275/halt.c commands/ieee1275/reboot.c \ + commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ @@ -125,12 +125,12 @@ suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod -reboot_mod_SOURCES = commands/ieee1275/reboot.c +reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For halt.mod -halt_mod_SOURCES = commands/ieee1275/halt.c +halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 06e9a7e57..a03f721d6 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -106,7 +106,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ + commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ fs/fshelp.c \ @@ -191,7 +191,7 @@ normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod. -reboot_mod_SOURCES = commands/i386/pc/reboot.c +reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index fbc6be985..8c277c00f 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -1,7 +1,7 @@ /* efi.h - declare variables and functions for EFI support */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -54,6 +54,8 @@ char *EXPORT_FUNC(grub_efi_get_filename) (grub_efi_device_path_t *dp); grub_efi_device_path_t * EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle); int EXPORT_FUNC(grub_efi_exit_boot_services) (grub_efi_uintn_t map_key); +void EXPORT_FUNC (grub_reboot) (void); +void EXPORT_FUNC (grub_halt) (void); void grub_efi_mm_init (void); void grub_efi_mm_fini (void); diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 49128a239..11dac5891 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -1,7 +1,7 @@ /* efi.c - generic EFI support */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -162,6 +162,22 @@ grub_exit (void) 0, 0); } +void +grub_reboot (void) +{ + grub_efi_fini (); + grub_efi_system_table->runtime_services-> + reset_system (GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL); +} + +void +grub_halt (void) +{ + grub_efi_fini (); + grub_efi_system_table->runtime_services-> + reset_system (GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL); +} + int grub_efi_exit_boot_services (grub_efi_uintn_t map_key) { From c3db83643a8e6b08a38134744792c04757a8608f Mon Sep 17 00:00:00 2001 From: okuji Date: Wed, 13 Feb 2008 03:35:48 +0000 Subject: [PATCH 0047/1707] 2008-02-13 Yoshinori K. Okuji * configure.ac: Only a cosmetic change on the handling of -fno-stack-protector. --- ChangeLog | 27 +- conf/i386-efi.mk | 108 +- conf/i386-ieee1275.mk | 82 +- conf/i386-pc.mk | 46 +- config.h.in | 4 +- configure | 7339 +++++++++++++++++++---------------------- configure.ac | 8 +- 7 files changed, 3610 insertions(+), 4004 deletions(-) diff --git a/ChangeLog b/ChangeLog index ede054640..5b9b74968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ +2008-02-13 Yoshinori K. Okuji + + * configure.ac: Only a cosmetic change on the handling of + -fno-stack-protector. + 2008-02-12 Alexandre Boeglin - * conf/i386-efi.rmk (grub_emu_SOURCES): Replace commands/i386/pc/halt.c and - reboot.c by commands/halt.c and reboot.c. + * conf/i386-efi.rmk (grub_emu_SOURCES): Replace + commands/i386/pc/halt.c and reboot.c by commands/halt.c and + reboot.c. (grub_install_SOURCES): Add halt.mod and reboot.mod. (halt_mod_SOURCES): New variable. (halt_mod_CFLAGS): Likewise. @@ -10,13 +16,14 @@ (reboot_mod_CFLAGS): Likewise. (reboot_mod_LDFLAGS): Likewise. - * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace commands/ieee1275/halt.c - and reboot.c by commands/halt.c and reboot.c. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace + commands/ieee1275/halt.c and reboot.c by commands/halt.c and + reboot.c. (halt_mod_SOURCES): Likewise. (reboot_mod_SOURCES): Likewise. - * conf/i386-pc.rmk (grub_emu_SOURCES): Replace commands/i386/pc/reboot.c by - commands/reboot.c. + * conf/i386-pc.rmk (grub_emu_SOURCES): Replace + commands/i386/pc/reboot.c by commands/reboot.c. (reboot_mod_SOURCES): Likewise. * commands/i386/pc/reboot.c: merge this file ... @@ -24,14 +31,14 @@ * commands/ieee1275/reboot.c: ... and this file ... * commands/reboot.c: ... to this file. - Add some precompiler directive to include the correct header for each - machine. + Add some precompiler directive to include the correct header for + each machine. * commands/ieee1275/halt.c: move this file ... * commands/halt.c: ... to here. - Add some precompiler directive to include the correct header for each - machine. + Add some precompiler directive to include the correct header for + each machine. * include/grub/efi/efi.h (grub_reboot): New function declaration. (grub_halt): Likewise. diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index bc8d87b39..f4bdc69a2 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -73,7 +73,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ + commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/loopback.c \ \ @@ -117,7 +117,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod \ - _linux.mod linux.mod cpuid.mod + _linux.mod linux.mod cpuid.mod halt.mod reboot.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1064,4 +1064,108 @@ fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpui cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For halt.mod. +halt_mod_SOURCES = commands/halt.c +CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst +ifneq ($(halt_mod_EXPORTS),no) +CLEANFILES += def-halt.lst +DEFSYMFILES += def-halt.lst +endif +MOSTLYCLEANFILES += halt_mod-commands_halt.d +UNDSYMFILES += und-halt.lst + +halt.mod: pre-halt.o mod-halt.o + -rm -f $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o + -rm -f $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o + +mod-halt.o: mod-halt.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< + +mod-halt.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(halt_mod_EXPORTS),no) +def-halt.lst: pre-halt.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ +endif + +und-halt.lst: pre-halt.o + echo 'halt' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< +-include halt_mod-commands_halt.d + +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +COMMANDFILES += cmd-halt_mod-commands_halt.lst +FSFILES += fs-halt_mod-commands_halt.lst + +cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + +fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + + +halt_mod_CFLAGS = $(COMMON_CFLAGS) +halt_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For reboot.mod. +reboot_mod_SOURCES = commands/reboot.c +CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst +ifneq ($(reboot_mod_EXPORTS),no) +CLEANFILES += def-reboot.lst +DEFSYMFILES += def-reboot.lst +endif +MOSTLYCLEANFILES += reboot_mod-commands_reboot.d +UNDSYMFILES += und-reboot.lst + +reboot.mod: pre-reboot.o mod-reboot.o + -rm -f $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o + -rm -f $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o + +mod-reboot.o: mod-reboot.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< + +mod-reboot.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(reboot_mod_EXPORTS),no) +def-reboot.lst: pre-reboot.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ +endif + +und-reboot.lst: pre-reboot.o + echo 'reboot' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-commands_reboot.d + +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +COMMANDFILES += cmd-reboot_mod-commands_reboot.lst +FSFILES += fs-reboot_mod-commands_reboot.lst + +cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + +fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + + +reboot_mod_CFLAGS = $(COMMON_CFLAGS) +reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index e9c0a386c..712da9a97 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -208,7 +208,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/ieee1275/halt.c commands/ieee1275/reboot.c \ + commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ @@ -236,11 +236,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -290,13 +290,13 @@ grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_hexdump.d -grub_emu-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) - $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ieee1275_halt.d +grub_emu-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_halt.d -grub_emu-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) - $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ieee1275_reboot.d +grub_emu-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -1021,13 +1021,13 @@ suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod -reboot_mod_SOURCES = commands/ieee1275/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_ieee1275_reboot.o und-reboot.lst +reboot_mod_SOURCES = commands/reboot.c +CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst ifneq ($(reboot_mod_EXPORTS),no) CLEANFILES += def-reboot.lst DEFSYMFILES += def-reboot.lst endif -MOSTLYCLEANFILES += reboot_mod-commands_ieee1275_reboot.d +MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o @@ -1035,9 +1035,9 @@ reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_ieee1275_reboot.o +pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_ieee1275_reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< @@ -1054,32 +1054,32 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_ieee1275_reboot.d +reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst fs-reboot_mod-commands_ieee1275_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst -FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +COMMANDFILES += cmd-reboot_mod-commands_reboot.lst +FSFILES += fs-reboot_mod-commands_reboot.lst -cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) +cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For halt.mod -halt_mod_SOURCES = commands/ieee1275/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_ieee1275_halt.o und-halt.lst +halt_mod_SOURCES = commands/halt.c +CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst ifneq ($(halt_mod_EXPORTS),no) CLEANFILES += def-halt.lst DEFSYMFILES += def-halt.lst endif -MOSTLYCLEANFILES += halt_mod-commands_ieee1275_halt.d +MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o @@ -1087,9 +1087,9 @@ halt.mod: pre-halt.o mod-halt.o $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_ieee1275_halt.o +pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_ieee1275_halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< @@ -1106,19 +1106,19 @@ und-halt.lst: pre-halt.o echo 'halt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_ieee1275_halt.d +halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< +-include halt_mod-commands_halt.d -CLEANFILES += cmd-halt_mod-commands_ieee1275_halt.lst fs-halt_mod-commands_ieee1275_halt.lst -COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst -FSFILES += fs-halt_mod-commands_ieee1275_halt.lst +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +COMMANDFILES += cmd-halt_mod-commands_halt.lst +FSFILES += fs-halt_mod-commands_halt.lst -cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) +cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) -fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 2cb49cefd..d908095d1 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -446,7 +446,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ + commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ fs/fshelp.c \ @@ -474,11 +474,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -532,9 +532,9 @@ grub_emu-commands_i386_pc_halt.o: commands/i386/pc/halt.c $(commands/i386/pc/hal $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_i386_pc_halt.d -grub_emu-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) - $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_i386_pc_reboot.d +grub_emu-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -1357,13 +1357,13 @@ normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod. -reboot_mod_SOURCES = commands/i386/pc/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_i386_pc_reboot.o und-reboot.lst +reboot_mod_SOURCES = commands/reboot.c +CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst ifneq ($(reboot_mod_EXPORTS),no) CLEANFILES += def-reboot.lst DEFSYMFILES += def-reboot.lst endif -MOSTLYCLEANFILES += reboot_mod-commands_i386_pc_reboot.d +MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o @@ -1371,9 +1371,9 @@ reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_i386_pc_reboot.o +pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_i386_pc_reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< @@ -1390,19 +1390,19 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_i386_pc_reboot.d +reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_i386_pc_reboot.lst fs-reboot_mod-commands_i386_pc_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_i386_pc_reboot.lst -FSFILES += fs-reboot_mod-commands_i386_pc_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +COMMANDFILES += cmd-reboot_mod-commands_reboot.lst +FSFILES += fs-reboot_mod-commands_reboot.lst -cmd-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) +cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_i386_pc_reboot.lst: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/config.h.in b/config.h.in index 1aef2123b..c22d5b12b 100644 --- a/config.h.in +++ b/config.h.in @@ -88,10 +88,10 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of `long', as computed by sizeof. */ +/* The size of a `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of `void *', as computed by sizeof. */ +/* The size of a `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define it to either start or _start */ diff --git a/configure b/configure index 9177d9c7d..3a3baf888 100644 --- a/configure +++ b/configure @@ -1,37 +1,83 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for GRUB 1.96. +# Generated by GNU Autoconf 2.59 for GRUB 1.96. # # Report bugs to . # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# Copyright (C) 2003 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi -# PATH needs CR +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -52,466 +98,124 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done -IFS=$as_save_IFS - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= + if test ! -f "$as_myself"; then + { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - case $as_dir in + for as_base in sh bash ksh sh5; do + case $as_dir in /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac + if ("$as_dir/$as_base" -c ' + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || + chmod +x $as_me.lineno || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -520,28 +224,7 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -550,27 +233,39 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH -exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +exec 6>&1 + # # Initializations. # ac_default_prefix=/usr/local -ac_clean_files= ac_config_libobj_dir=. -LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} +# Maximum number of lines to put in a shell here document. +# This variable seems obsolete. It should probably be removed, and +# only ac_max_sed_lines should be used. +: ${ac_max_here_lines=38} + # Identity of this package. PACKAGE_NAME='GRUB' PACKAGE_TARNAME='grub' @@ -582,134 +277,42 @@ ac_unique_file="include/grub/dl.h" # Factoring default headers for most tests. ac_includes_default="\ #include -#ifdef HAVE_SYS_TYPES_H +#if HAVE_SYS_TYPES_H # include #endif -#ifdef HAVE_SYS_STAT_H +#if HAVE_SYS_STAT_H # include #endif -#ifdef STDC_HEADERS +#if STDC_HEADERS # include # include #else -# ifdef HAVE_STDLIB_H +# if HAVE_STDLIB_H # include # endif #endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H +#if HAVE_STRING_H +# if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif -#ifdef HAVE_STRINGS_H +#if HAVE_STRINGS_H # include #endif -#ifdef HAVE_INTTYPES_H +#if HAVE_INTTYPES_H # include +#else +# if HAVE_STDINT_H +# include +# endif #endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H +#if HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -platform -CMP -YACC -UNIFONT_HEX -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -AWK -SET_MAKE -RUBY -HELP2MAN -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -GREP -EGREP -LIBLZO -TARGET_CC -ac_ct_TARGET_CC -OBJCOPY -STRIP -NM -TARGET_CFLAGS -TARGET_CPPFLAGS -TARGET_LDFLAGS -LIBCURSES -enable_grub_emu -enable_grub_fstest -LIBOBJS -LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY HELP2MAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu enable_grub_fstest LIBOBJS LTLIBOBJS' ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - # Initialize some variables set by options. ac_init_help= @@ -736,48 +339,34 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' +datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' +libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' +infodir='${prefix}/info' +mandir='${prefix}/man' ac_prev= -ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option + eval "$ac_prev=\$ac_option" ac_prev= continue fi - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac + ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; + case $ac_option in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -799,45 +388,33 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad) + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) datadir=$ac_optarg ;; - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -864,12 +441,6 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -894,16 +465,13 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) + | --localstate | --localstat | --localsta | --localst \ + | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -968,16 +536,6 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -1030,20 +588,24 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_package=`echo $ac_package| sed 's/-/_/g'` + case $ac_option in + *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; + *) ac_optarg=yes ;; + esac + eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_package=`echo $ac_package | sed 's/-/_/g'` + eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. @@ -1074,7 +636,8 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg + ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` + eval "$ac_envvar='$ac_optarg'" export $ac_envvar ;; *) @@ -1094,19 +657,27 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir +# Be sure to have absolute paths. +for ac_var in exec_prefix prefix do - eval ac_val=\$$ac_var + eval ac_val=$`echo $ac_var` case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; + [\\/$]* | ?:[\\/]* | NONE | '' ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; + esac +done + +# Be sure to have absolute paths. +for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ + localstatedir libdir includedir oldincludedir infodir mandir +do + eval ac_val=$`echo $ac_var` + case $ac_val in + [\\/$]* | ?:[\\/]* ) ;; + *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; };; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -1133,76 +704,74 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || + # Try the directory containing this script, then its parent. + ac_confdir=`(dirname "$0") 2>/dev/null || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || + X"$0" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then + if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + else + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. + fi fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done +(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || + { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 + { (exit 1); exit 1; }; } +srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +ac_env_build_alias_set=${build_alias+set} +ac_env_build_alias_value=$build_alias +ac_cv_env_build_alias_set=${build_alias+set} +ac_cv_env_build_alias_value=$build_alias +ac_env_host_alias_set=${host_alias+set} +ac_env_host_alias_value=$host_alias +ac_cv_env_host_alias_set=${host_alias+set} +ac_cv_env_host_alias_value=$host_alias +ac_env_target_alias_set=${target_alias+set} +ac_env_target_alias_value=$target_alias +ac_cv_env_target_alias_set=${target_alias+set} +ac_cv_env_target_alias_value=$target_alias +ac_env_CC_set=${CC+set} +ac_env_CC_value=$CC +ac_cv_env_CC_set=${CC+set} +ac_cv_env_CC_value=$CC +ac_env_CFLAGS_set=${CFLAGS+set} +ac_env_CFLAGS_value=$CFLAGS +ac_cv_env_CFLAGS_set=${CFLAGS+set} +ac_cv_env_CFLAGS_value=$CFLAGS +ac_env_LDFLAGS_set=${LDFLAGS+set} +ac_env_LDFLAGS_value=$LDFLAGS +ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +ac_cv_env_LDFLAGS_value=$LDFLAGS +ac_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_env_CPPFLAGS_value=$CPPFLAGS +ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +ac_cv_env_CPPFLAGS_value=$CPPFLAGS +ac_env_CPP_set=${CPP+set} +ac_env_CPP_value=$CPP +ac_cv_env_CPP_set=${CPP+set} +ac_cv_env_CPP_value=$CPP # # Report the --help message. @@ -1231,6 +800,9 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] +_ACEOF + + cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -1248,22 +820,15 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] + --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/grub] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --infodir=DIR info documentation [PREFIX/info] + --mandir=DIR man documentation [PREFIX/man] _ACEOF cat <<\_ACEOF @@ -1306,9 +871,8 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory + CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have + headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -1316,86 +880,120 @@ it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF -ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. + ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d $ac_dir || continue ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) +if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + + cd $ac_dir + # Check for guested configure; otherwise get Cygnus style configure. + if test -f $ac_srcdir/configure.gnu; then + echo + $SHELL $ac_srcdir/configure.gnu --help=recursive + elif test -f $ac_srcdir/configure; then + echo + $SHELL $ac_srcdir/configure --help=recursive + elif test -f $ac_srcdir/configure.ac || + test -f $ac_srcdir/configure.in; then + echo + $ac_configure --help else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } + fi + cd $ac_popdir done fi -test -n "$ac_init_help" && exit $ac_status +test -n "$ac_init_help" && exit 0 if $ac_init_version; then cat <<\_ACEOF GRUB configure 1.96 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.59 -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit + exit 0 fi -cat >config.log <<_ACEOF +exec 5>config.log +cat >&5 <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was $ $0 $@ _ACEOF -exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1414,7 +1012,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` +hostinfo = `(hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1428,7 +1026,6 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done -IFS=$as_save_IFS } >&5 @@ -1450,6 +1047,7 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= +ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1460,7 +1058,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *\'*) + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1482,7 +1080,9 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args '$ac_arg'" + ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" + # Get rid of the leading space. + ac_sep=" " ;; esac done @@ -1493,8 +1093,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. +# WARNING: Be sure not to use single quotes in there, as some shells, +# such as our DU 5.0 friend, will then `close' the trap. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1507,34 +1107,20 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done +{ (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in + *ac_space=\ *) sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" ;; - esac | - sort -) + *) + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + ;; + esac; +} echo cat <<\_ASBOX @@ -1545,28 +1131,22 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## +## ------------- ## +## Output files. ## +## ------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" + eval ac_val=$`echo $ac_var` + echo "$ac_var='"'"'$ac_val'"'"'" done | sort echo fi @@ -1578,24 +1158,26 @@ _ASBOX ## ----------- ## _ASBOX echo - cat confdefs.h + sed "/^$/d" confdefs.h | sort echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core && + rm -rf conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status -' 0 + ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h +rm -rf conftest* confdefs.h +# AIX cpp loses on an empty file, so make sure it contains at least a newline. +echo >confdefs.h # Predefined preprocessor variables. @@ -1626,17 +1208,14 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" +if test -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then + CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" + else + CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" + fi fi -shift -for ac_site_file -do +for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1652,8 +1231,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; + [\\/]* | ?:[\\/]* ) . $cache_file;; + *) . ./$cache_file;; esac fi else @@ -1665,11 +1244,12 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do +for ac_var in `(set) 2>&1 | + sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value + eval ac_old_val="\$ac_cv_env_${ac_var}_value" + eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1694,7 +1274,8 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1711,30 +1292,6 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi - - - - - - - - - - - - - - - - - - - - - - - - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1744,159 +1301,134 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu -ac_config_headers="$ac_config_headers config.h" + + + + + + + + + + + + + + + + + + + + + + + + + + ac_config_headers="$ac_config_headers config.h" # Checks for host and target systems. ac_aux_dir= -for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do - if test -f "$ac_dir/install-sh"; then +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" break - elif test -f "$ac_dir/install.sh"; then + elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f "$ac_dir/shtool"; then + elif test -f $ac_dir/shtool; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 +echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - +ac_config_guess="$SHELL $ac_aux_dir/config.guess" +ac_config_sub="$SHELL $ac_aux_dir/config.sub" +ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} +$ac_config_sub sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 +echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && + ac_cv_build_alias=$build_alias +test -z "$ac_cv_build_alias" && + ac_cv_build_alias=`$ac_config_guess` +test -z "$ac_cv_build_alias" && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} +ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac +build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + ac_cv_host_alias=$host_alias +test -z "$ac_cv_host_alias" && + ac_cv_host_alias=$ac_cv_build_alias +ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } -fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac +host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + ac_cv_target_alias=$target_alias +test "x$ac_cv_target_alias" = "x" && + ac_cv_target_alias=$ac_cv_host_alias +ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || + { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 +echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } -fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac +echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac +target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` +target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` +target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. @@ -1908,17 +1440,17 @@ test -n "$target_alias" && # Program name transformations test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" + program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" + program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed +rm conftest.sed case "$host_cpu" in @@ -1938,11 +1470,11 @@ esac # Specify the platform (such as firmware). -# Check whether --with-platform was given. +# Check whether --with-platform or --without-platform was given. if test "${with_platform+set}" = set; then - withval=$with_platform; -fi + withval="$with_platform" +fi; # Guess the platform if not specified. if test "x$with_platform" = x; then @@ -1985,8 +1517,8 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1999,27 +1531,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CMP="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - { echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6; } + echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CMP" && break done @@ -2033,8 +1563,8 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2047,27 +1577,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } + echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$YACC" && break done @@ -2098,8 +1626,8 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2121,7 +1649,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -2140,22 +1668,21 @@ case $as_dir/ in ;; esac done -IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the value is a relative name. + # removed, or if the path is relative. INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2169,8 +1696,8 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2183,57 +1710,54 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$AWK" && break done -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 +set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` +if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF -SHELL = /bin/sh all: - @echo '@@@%%%=$(MAKE)=@@@%%%' + @echo 'ac_maketemp="$(MAKE)"' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac +eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` +if test -n "$ac_maketemp"; then + eval ac_cv_prog_make_${ac_make}_set=yes +else + eval ac_cv_prog_make_${ac_make}_set=no +fi rm -f conftest.make fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 SET_MAKE= else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi @@ -2241,8 +1765,8 @@ fi # These are not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_RUBY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2257,32 +1781,31 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS ;; esac fi RUBY=$ac_cv_path_RUBY -if test -n "$RUBY"; then - { echo "$as_me:$LINENO: result: $RUBY" >&5 -echo "${ECHO_T}$RUBY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi +if test -n "$RUBY"; then + echo "$as_me:$LINENO: result: $RUBY" >&5 +echo "${ECHO_T}$RUBY" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi # Extract the first word of "help2man", so it can be a program name with args. set dummy help2man; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_HELP2MAN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2297,27 +1820,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS ;; esac fi HELP2MAN=$ac_cv_path_HELP2MAN -if test -n "$HELP2MAN"; then - { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 -echo "${ECHO_T}$HELP2MAN" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi +if test -n "$HELP2MAN"; then + echo "$as_me:$LINENO: result: $HELP2MAN" >&5 +echo "${ECHO_T}$HELP2MAN" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi # @@ -2332,8 +1854,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2346,34 +1868,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2386,51 +1906,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2443,34 +1948,74 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - +fi +if test -z "$ac_cv_prog_CC"; then + ac_ct_CC=$CC + # Extract the first word of "cc", so it can be a program name with args. +set dummy cc; ac_word=$2 +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_CC"; then + ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + ac_cv_prog_ac_ct_CC="cc" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 fi +done +done + +fi +fi +ac_ct_CC=$ac_cv_prog_ac_ct_CC +if test -n "$ac_ct_CC"; then + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 +else + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + CC=$ac_ct_CC +else + CC="$ac_cv_prog_CC" +fi + fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2484,7 +2029,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2495,7 +2040,6 @@ do fi done done -IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2513,23 +2057,22 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2542,38 +2085,36 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl.exe + for ac_prog in cl do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2586,45 +2127,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_CC" && break done - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi + CC=$ac_ct_CC fi fi @@ -2637,35 +2162,21 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 +echo "$as_me:$LINENO:" \ + "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 + (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 + (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 +{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 + (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2690,77 +2201,47 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 + (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' + # Find the output, starting from the most likely. This scheme is +# not robust to junk in `.', hence go to wildcards (a.*) only as a last +# resort. + +# Be careful to initialize this variable, since it used to be cached. +# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +ac_cv_exeext= +# b.out is created by i960 compilers. +for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) + ;; + conftest.$ac_ext ) + # This is the source file. ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + # FIXME: I believe we export ac_cv_exeext for Libtool, + # but it would be cool to find out if it's true. Does anybody + # maintain Libtool? --akim. + export ac_cv_exeext break;; * ) break;; esac done -test "$ac_cv_exeext" = no && ac_cv_exeext= - else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2772,21 +2253,19 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext +echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6 -# Check that the compiler produces executables we can run. If not, either +# Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2805,27 +2284,22 @@ See \`config.log' for more details." >&2;} fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either +# Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6 -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2836,8 +2310,9 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + export ac_cv_exeext break;; * ) break;; esac @@ -2851,14 +2326,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2878,20 +2353,14 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; + for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2909,12 +2378,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2937,49 +2406,50 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_compiler_gnu=no +ac_compiler_gnu=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +CFLAGS="-g" +echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2995,118 +2465,38 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +ac_cv_prog_cc_g=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3122,12 +2512,12 @@ else CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then +echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_c89=no + ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3161,17 +2551,12 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get + as 'x'. The following induces an error, until -std1 is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ + that's true only with -std1. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -3186,57 +2571,205 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +# Don't try gcc -ansi; that turns off useful extensions and +# breaks some systems' header files. +# AIX -qlanglvl=ansi +# Ultrix and OSF/1 -std1 +# HP-UX 10.20 and later -Ae +# HP-UX older versions -Aa -D_HPUX_SOURCE +# SVR4 -Xc -D__EXTENSIONS__ +for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_prog_cc_stdc=$ac_arg +break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break +rm -f conftest.err conftest.$ac_objext done -rm -f conftest.$ac_ext +rm -f conftest.$ac_ext conftest.$ac_objext CC=$ac_save_CC fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + +case "x$ac_cv_prog_cc_stdc" in + x|xno) + echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6 ;; *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 + CC="$CC $ac_cv_prog_cc_stdc" ;; esac +# Some people use a C++ compiler to compile C. Since we use `exit', +# in C++ we need to declare it. In case someone uses the same compiler +# for both compiling C and C++ we need to have the C++ compiler decide +# the declaration of exit, since it's the most demanding environment. +cat >conftest.$ac_ext <<_ACEOF +#ifndef __cplusplus + choke me +#endif +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + for ac_declaration in \ + '' \ + 'extern "C" void std::exit (int) throw (); using std::exit;' \ + 'extern "C" void std::exit (int); using std::exit;' \ + 'extern "C" void exit (int) throw ();' \ + 'extern "C" void exit (int);' \ + 'void exit (int);' +do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +#include +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 +continue +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_declaration +int +main () +{ +exit (42); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +done +rm -f conftest* +if test -n "$ac_declaration"; then + echo '#ifdef __cplusplus' >>confdefs.h + echo $ac_declaration >>confdefs.h + echo '#endif' >>confdefs.h +fi + +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -3255,15 +2788,15 @@ _ACEOF -# Check whether --enable-largefile was given. +# Check whether --enable-largefile or --disable-largefile was given. if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi + enableval="$enable_largefile" +fi; if test "$enable_largefile" != no; then - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3271,8 +2804,8 @@ else if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3296,77 +2829,84 @@ main () return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +rm -f conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext +rm -f conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do + ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3391,31 +2931,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3441,53 +2984,54 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 +if test "$ac_cv_sys_file_offset_bits" != no; then + cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF -;; -esac + +fi rm -f conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do + ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3512,31 +3056,34 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3562,58 +3109,288 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext break done fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) +echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6 +if test "$ac_cv_sys_large_files" != no; then + cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF -;; -esac + +fi rm -f conftest* - fi fi # Identify characteristics of the host architecture. +echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_c_bigendian=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +# It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +int +main () +{ + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long l; + char c[sizeof (long)]; + } u; + u.l = 1; + exit (u.c[sizeof (long) - 1] == 1); +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6 +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3647,22 +3424,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 @@ -3671,10 +3450,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3684,22 +3462,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else @@ -3710,7 +3490,6 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done @@ -3728,8 +3507,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3752,22 +3531,24 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then : else echo "$as_me: failed program was:" >&5 @@ -3776,10 +3557,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi - rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether nonexistent headers + # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3789,22 +3569,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then # Broken: success on invalid input. continue else @@ -3815,7 +3597,6 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi - rm -f conftest.err conftest.$ac_ext done @@ -3838,170 +3619,23 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then +echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count + if echo a | (grep -E '(a|b)') >/dev/null 2>&1 + then ac_cv_prog_egrep='grep -E' + else ac_cv_prog_egrep='egrep' fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP fi +echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +echo "${ECHO_T}$ac_cv_prog_egrep" >&6 + EGREP=$ac_cv_prog_egrep -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4025,31 +3659,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_header_stdc=no +ac_cv_header_stdc=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -4105,7 +3743,6 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -4125,27 +3762,18 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - return 2; - return 0; + exit(2); + exit (0); } _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4158,14 +3786,12 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +fi +echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4188,9 +3814,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -4204,35 +3830,38 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_Header=no" +eval "$as_ac_Header=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -4243,244 +3872,8 @@ fi done -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6 if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4491,57 +3884,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef void * ac__type_new_; int main () { -if ((ac__type_new_ *) 0) +if ((void * *) 0) return 0; -if (sizeof (ac__type_new_)) +if (sizeof (void *)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_void_p=no +ac_cv_type_void_p=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6 -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6 if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$ac_cv_type_void_p" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4551,11 +3948,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -4563,22 +3959,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4588,11 +3989,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4600,53 +4000,56 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -4654,22 +4057,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4679,11 +4087,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4691,48 +4098,50 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= +ac_lo= ac_hi= fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4743,11 +4152,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4755,44 +4163,51 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` +ac_lo=`expr '(' $ac_mid ')' + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi ;; + { (exit 1); exit 1; }; } ;; esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4801,9 +4216,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +long longval () { return (long) (sizeof (void *)); } +unsigned long ulongval () { return (long) (sizeof (void *)); } #include #include int @@ -4812,44 +4226,35 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + exit (1); + if (((long) (sizeof (void *))) < 0) { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + long i = longval (); + if (i != ((long) (sizeof (void *)))) + exit (1); fprintf (f, "%ld\n", i); } else { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + unsigned long i = ulongval (); + if (i != ((long) (sizeof (void *)))) + exit (1); fprintf (f, "%lu\n", i); } - return ferror (f) || fclose (f) != 0; + exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4860,32 +4265,29 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val +else + ac_cv_sizeof_void_p=0 fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } - - - +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6 if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4896,57 +4298,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -typedef long ac__type_new_; int main () { -if ((ac__type_new_ *) 0) +if ((long *) 0) return 0; -if (sizeof (ac__type_new_)) +if (sizeof (long)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_type_long=no +ac_cv_type_long=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6 -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6 if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else + if test "$ac_cv_type_long" = yes; then + # The cast to unsigned long works around a bug in the HP C Compiler + # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects + # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. + # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4956,11 +4362,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -4968,22 +4373,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4993,11 +4403,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5005,53 +4414,56 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` +ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -5059,22 +4471,27 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -5084,11 +4501,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5096,48 +4512,50 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` +ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo= ac_hi= +ac_lo= ac_hi= fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -5148,11 +4566,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5160,44 +4577,51 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_lo=`expr '(' $ac_mid ')' + 1` +ac_lo=`expr '(' $ac_mid ')' + 1` fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi ;; + { (exit 1); exit 1; }; } ;; esac +else + if test "$cross_compiling" = yes; then + { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling +See \`config.log' for more details." >&5 +echo "$as_me: error: cannot run test program while cross compiling +See \`config.log' for more details." >&2;} + { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5206,9 +4630,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +long longval () { return (long) (sizeof (long)); } +unsigned long ulongval () { return (long) (sizeof (long)); } #include #include int @@ -5217,44 +4640,35 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + exit (1); + if (((long) (sizeof (long))) < 0) { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + long i = longval (); + if (i != ((long) (sizeof (long)))) + exit (1); fprintf (f, "%ld\n", i); } else { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; + unsigned long i = ulongval (); + if (i != ((long) (sizeof (long)))) + exit (1); fprintf (f, "%lu\n", i); } - return ferror (f) || fclose (f) != 0; + exit (ferror (f) || fclose (f) != 0); ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -5265,25 +4679,22 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) +{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long), 77 See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi + { (exit 1); exit 1; }; } +fi +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val +else + ac_cv_sizeof_long=0 fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } - - - +fi +echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6 cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -5300,8 +4711,8 @@ fi if test "$target_cpu"-"$platform" = i386-pc; then # There are three possibilities. LZO version 2 installed with the name # liblzo2, with the name liblzo, and LZO version 1. - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6 if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5314,58 +4725,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -return __lzo_init_v2 (); +__lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_lzo2___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_lzo2___lzo_init_v2=no +ac_cv_lib_lzo2___lzo_init_v2=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6 if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then LIBLZO="-llzo2" else - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6 if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5378,58 +4792,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -return __lzo_init_v2 (); +__lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_lzo___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_lzo___lzo_init_v2=no +ac_cv_lib_lzo___lzo_init_v2=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6 if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then LIBLZO="-llzo" else - { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6 if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5442,53 +4859,56 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char __lzo_init2 (); int main () { -return __lzo_init2 (); +__lzo_init2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_lzo___lzo_init2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_lzo___lzo_init2=no +ac_cv_lib_lzo___lzo_init2=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6 if test $ac_cv_lib_lzo___lzo_init2 = yes; then LIBLZO="-llzo" else @@ -5503,8 +4923,8 @@ fi LIBS="$LIBS $LIBLZO" - { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6 if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5531,59 +4951,68 @@ cat >>conftest.$ac_ext <<_ACEOF #undef lzo1x_999_compress -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char lzo1x_999_compress (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined __stub_lzo1x_999_compress || defined __stub___lzo1x_999_compress +#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress) choke me +#else +char (*f) () = lzo1x_999_compress; +#endif +#ifdef __cplusplus +} #endif int main () { -return lzo1x_999_compress (); +return f != lzo1x_999_compress; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_func_lzo1x_999_compress=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_func_lzo1x_999_compress=no +ac_cv_func_lzo1x_999_compress=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6 if test $ac_cv_func_lzo1x_999_compress = yes; then : else @@ -5599,19 +5028,18 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5622,37 +5050,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5661,22 +5093,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -5684,10 +5118,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5711,24 +5144,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -5748,9 +5182,9 @@ fi for ac_func in posix_memalign memalign do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5776,60 +5210,68 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" +{ #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func +#if defined (__stub_$ac_func) || defined (__stub___$ac_func) choke me +#else +char (*f) () = $ac_func; +#endif +#ifdef __cplusplus +} #endif int main () { -return $ac_func (); +return f != $ac_func; ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - eval "$as_ac_var=no" +eval "$as_ac_var=no" fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -5854,8 +5296,8 @@ if test "x$target" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5868,27 +5310,25 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6; } + echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +echo "${ECHO_T}$TARGET_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$TARGET_CC" && break done fi @@ -5898,8 +5338,8 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5912,54 +5352,39 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +echo "${ECHO_T}$ac_ct_TARGET_CC" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - test -n "$ac_ct_TARGET_CC" && break done - - if test "x$ac_ct_TARGET_CC" = x; then - TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 +test -n "$ac_ct_TARGET_CC" || ac_ct_TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - TARGET_CC=$ac_ct_TARGET_CC - fi + + TARGET_CC=$ac_ct_TARGET_CC fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5972,34 +5397,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6012,41 +5435,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi + OBJCOPY=$ac_ct_OBJCOPY else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -6054,8 +5462,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6068,34 +5476,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6108,41 +5514,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi + STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi @@ -6150,8 +5541,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6164,34 +5555,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6204,41 +5593,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi + NM=$ac_ct_NM else NM="$ac_cv_prog_NM" fi @@ -6252,8 +5626,8 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6266,34 +5640,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6306,41 +5678,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi + OBJCOPY=$ac_ct_OBJCOPY else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -6348,8 +5705,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6362,34 +5719,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6402,41 +5757,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi + STRIP=$ac_ct_STRIP else STRIP="$ac_cv_prog_STRIP" fi @@ -6444,8 +5784,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6458,34 +5798,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6498,41 +5836,26 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done -IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6 else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi + NM=$ac_ct_NM else NM="$ac_cv_prog_NM" fi @@ -6559,8 +5882,8 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6 if test "${size_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6582,35 +5905,39 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then size_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - size_flag=no +size_flag=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $size_flag" >&5 -echo "${ECHO_T}$size_flag" >&6; } +echo "$as_me:$LINENO: result: $size_flag" >&5 +echo "${ECHO_T}$size_flag" >&6 if test "x$size_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -6619,8 +5946,8 @@ echo "${ECHO_T}$size_flag" >&6; } # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6 if test "${falign_loop_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6642,35 +5969,39 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then falign_loop_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - falign_loop_flag=no +falign_loop_flag=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 -echo "${ECHO_T}$falign_loop_flag" >&6; } +echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 +echo "${ECHO_T}$falign_loop_flag" >&6 if test "x$falign_loop_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -6686,8 +6017,8 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -{ echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 -echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 +echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6 save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" cat >conftest.$ac_ext <<_ACEOF @@ -6706,35 +6037,38 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then build_id_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - build_id_flag=no +build_id_flag=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $build_id_flag" >&5 -echo "${ECHO_T}$build_id_flag" >&6; } +echo "$as_me:$LINENO: result: $build_id_flag" >&5 +echo "${ECHO_T}$build_id_flag" >&6 LDFLAGS="$save_LDFLAGS" if test "x$build_id_flag" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" @@ -6748,8 +6082,8 @@ fi # Smashing stack protector. ssp_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6 # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -6757,20 +6091,20 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6 # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6 fi # Need that, because some distributions ship compilers that include # `-fstack-protector' in the default specs. -if [ x"$ssp_possible" = xyes ]; then - TARGET_CFLAGS=$TARGET_CFLAGS\ -fno-stack-protector +if test "x$ssp_possible" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" fi @@ -6784,8 +6118,8 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6 if test "${grub_cv_prog_objcopy_absolute+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6846,8 +6180,8 @@ done rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6 if test "x$grub_cv_prog_objcopy_absolute" = xno; then { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 @@ -6856,8 +6190,8 @@ echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binu fi -{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6 if test "${grub_cv_asm_uscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6901,13 +6235,13 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +echo "${ECHO_T}$grub_cv_asm_uscore" >&6 if test "x$target_cpu" = xi386; then -{ echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 -echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 +echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6927,41 +6261,44 @@ asm ("incl start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_start_symbol=no +grub_cv_check_start_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_start_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_start_symbol" >&6 -{ echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 -echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 +echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6981,38 +6318,41 @@ asm ("incl _start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_start_symbol=no +grub_cv_check_uscore_start_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6 @@ -7034,8 +6374,8 @@ echo "$as_me: error: neither start nor _start is defined" >&2;} fi -{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7055,41 +6395,44 @@ asm ("incl __bss_start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_uscore_bss_start_symbol=no +grub_cv_check_uscore_uscore_bss_start_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6 -{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7109,41 +6452,44 @@ asm ("incl edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_edata_symbol=no +grub_cv_check_edata_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6 -{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7163,38 +6509,41 @@ asm ("incl _edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_edata_symbol=no +grub_cv_check_uscore_edata_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6 @@ -7221,8 +6570,8 @@ echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} fi -{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7242,41 +6591,44 @@ asm ("incl end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_end_symbol=no +grub_cv_check_end_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_end_symbol" >&6 -{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6 if test "${grub_cv_check_uscore_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7296,38 +6648,41 @@ asm ("incl _end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then grub_cv_check_uscore_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - grub_cv_check_uscore_end_symbol=no +grub_cv_check_uscore_end_symbol=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6 @@ -7349,8 +6704,8 @@ echo "$as_me: error: neither end nor _end is defined" >&2;} fi -{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6 if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7393,12 +6748,12 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6 -{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6 if test "${grub_cv_i386_asm_addr32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7428,11 +6783,11 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6 -{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6 if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7466,11 +6821,11 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6 -{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6 if test "${grub_cv_i386_check_nested_functions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7515,22 +6870,13 @@ main (void) _ACEOF rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -7543,15 +6889,13 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi fi -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } +echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6 if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -7587,25 +6931,25 @@ LIBS="$tmp_LIBS" # # Memory manager debugging. -# Check whether --enable-mm-debug was given. +# Check whether --enable-mm-debug or --disable-mm-debug was given. if test "${enable_mm_debug+set}" = set; then - enableval=$enable_mm_debug; + enableval="$enable_mm_debug" + cat >>confdefs.h <<\_ACEOF #define MM_DEBUG 1 _ACEOF -fi +fi; - -# Check whether --enable-grub-emu was given. +# Check whether --enable-grub-emu or --disable-grub-emu was given. if test "${enable_grub_emu+set}" = set; then - enableval=$enable_grub_emu; -fi + enableval="$enable_grub_emu" +fi; if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6 if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7618,58 +6962,61 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -return wgetch (); +wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_ncurses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_ncurses_wgetch=no +ac_cv_lib_ncurses_wgetch=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6 if test $ac_cv_lib_ncurses_wgetch = yes; then LIBCURSES="-lncurses" else - { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } + echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6 if test "${ac_cv_lib_curses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7682,53 +7029,56 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ +/* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -return wgetch (); +wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_cv_lib_curses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_cv_lib_curses_wgetch=no +ac_cv_lib_curses_wgetch=no fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ +rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } +echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6 if test $ac_cv_lib_curses_wgetch = yes; then LIBCURSES="-lcurses" else @@ -7746,19 +7096,18 @@ fi for ac_header in ncurses/curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7769,37 +7118,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7808,22 +7161,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7831,10 +7186,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7858,24 +7212,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7888,19 +7243,18 @@ else for ac_header in ncurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7911,37 +7265,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7950,22 +7308,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7973,10 +7333,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -8000,24 +7359,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -8030,19 +7390,18 @@ else for ac_header in curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8053,37 +7412,41 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then + (exit $ac_status); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - ac_header_compiler=no +ac_header_compiler=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6 # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8092,22 +7455,24 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 +if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + ac_cpp_err=$ac_cpp_err$ac_c_werror_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -8115,10 +7480,9 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi - rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6 # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -8142,24 +7506,25 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX + ( + cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 + ) | + sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then +echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -8186,19 +7551,19 @@ done fi -# Check whether --enable-grub-fstest was given. +# Check whether --enable-grub-fstest or --disable-grub-fstest was given. if test "${enable_grub_fstest+set}" = set; then - enableval=$enable_grub_fstest; -fi + enableval="$enable_grub_fstest" +fi; # Output files. -ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" + ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" -ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" + ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" -ac_config_files="$ac_config_files stamp-h" + ac_config_files="$ac_config_files stamp-h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -8218,58 +7583,39 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. +# So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - +{ (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) + case `(ac_space=' '; set | grep ac_space) 2>&1` in + *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( + ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" + sed -n \ + "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" ;; - esac | - sort -) | + esac; +} | sed ' - /^ac_cv_env_/b end t clear - :clear + : clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + : end' >>confcache +if diff $cache_file confcache >/dev/null 2>&1; then :; else + if test -w $cache_file; then + test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + echo "not updating unwritable cache $cache_file" fi fi rm -f confcache @@ -8278,18 +7624,32 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/; +s/:*\${srcdir}:*/:/; +s/:*@srcdir@:*/:/; +s/^\([^=]*=[ ]*\):*/\1/; +s/:*$//; +s/^[^=]*=[ ]*$//; +}' +fi + DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' + ac_i=`echo "$ac_i" | + sed 's/\$U\././;s/\.o$//;s/\.obj$//'` + # 2. Add them. + ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -8320,26 +7680,73 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh +# Be Bourne compatible if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac +elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then + set -o posix +fi +DUALCASE=1; export DUALCASE # for MKS sh +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false fi +# Work around bugs in pre-3.0 UWIN ksh. +$as_unset ENV MAIL MAILPATH +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1; then + as_expr=expr +else + as_expr=false +fi + +if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi -# PATH needs CR +# Name of the executable. +as_me=`$as_basename "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)$' \| \ + . : '\(.\)' 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } + /^X\/\(\/\/\)$/{ s//\1/; q; } + /^X\/\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + + +# PATH needs CR, and LINENO needs CR and PATH. # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -8360,198 +7767,126 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + as_lineno_1=$LINENO + as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x$as_lineno_3" = "x$as_lineno_2" || { + # Find who we are. Look in the path if we contain no path at all + # relative or not. + case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done -IFS=$as_save_IFS - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + ;; + esac + # We did not find ourselves, most probably we were run as `sh COMMAND' + # in which case we are not to be found in the path. + if test "x$as_myself" = x; then + as_myself=$0 fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - + if test ! -f "$as_myself"; then + { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} + { (exit 1); exit 1; }; } + fi + case $CONFIG_SHELL in + '') + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for as_base in sh bash ksh sh5; do + case $as_dir in + /*) + if ("$as_dir/$as_base" -c ' as_lineno_1=$LINENO as_lineno_2=$LINENO + as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { + test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then + $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } + $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } + CONFIG_SHELL=$as_dir/$as_base + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$0" ${1+"$@"} + fi;; + esac + done +done +;; + esac # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. + # line-number line before each line; the second 'sed' does the real + # work. The second script uses 'N' to pair each line-number line + # with the numbered line, and appends trailing '-' during + # substitution so that $LINENO is not a special case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | + # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) + sed '=' <$as_myself | sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ + s,$,-, + : loop + s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, t loop - s/-\n.*// + s,-$,, + s,^['$as_cr_digits']*\n,, ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + chmod +x $as_me.lineno || + { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" + # original and so on. Autoconf is especially sensible to this). + . ./$as_me.lineno # Exit status is that of the last command. exit } -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; +case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in + *c*,-n*) ECHO_N= ECHO_C=' +' ECHO_T=' ' ;; + *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; + *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then +if expr a : '\(a\)' >/dev/null 2>&1; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + # We could just check for DJGPP; but this test a) works b) is more generic + # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). + if test -f conf$$.exe; then + # Don't use ln at all; we don't have any links as_ln_s='cp -p' + else + as_ln_s='ln -s' + fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null +rm -f conf$$ conf$$.exe conf$$.file if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -8560,28 +7895,7 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_executable_p="test -f" # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -8590,14 +7904,31 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +# IFS +# We need space, tab and new line, in precisely that order. +as_nl=' +' +IFS=" $as_nl" + +# CDPATH. +$as_unset CDPATH + exec 6>&1 -# Save the log message, to keep $[0] and so on meaningful, and to +# Open the log real soon, to keep \$[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" +# values after options handling. Logging --version etc. is OK. +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX +} >&5 +cat >&5 <<_CSEOF + This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.59. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -8605,20 +7936,30 @@ generated by GNU Autoconf 2.61. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - +_CSEOF +echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +echo >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_links="$ac_config_links" +if test -n "$ac_config_files"; then + echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +fi -_ACEOF +if test -n "$ac_config_headers"; then + echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_links"; then + echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +fi + +if test -n "$ac_config_commands"; then + echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +fi cat >>$CONFIG_STATUS <<\_ACEOF + ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -8626,7 +7967,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit + -V, --version print version number, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -8645,21 +7986,19 @@ Configuration links: $config_links Report bugs to ." - _ACEOF + cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.59, + with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2003 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' +srcdir=$srcdir +INSTALL="$INSTALL" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8670,24 +8009,39 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` + ac_option=`expr "x$1" : 'x\([^=]*\)='` + ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` ac_shift=: ;; - *) + -*) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; + *) # This is not an option, so the user has probably given explicit + # arguments. + ac_option=$1 + ac_need_defaults=false;; esac case $ac_option in # Handling of the options. +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) + --version | --vers* | -V ) + echo "$ac_cs_version"; exit 0 ;; + --he | --h) + # Conflict between --help and --header + { { echo "$as_me:$LINENO: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2;} + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit 0 ;; + --debug | --d* | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -8697,24 +8051,18 @@ do $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 + -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&5 +echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2;} { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; + *) ac_config_targets="$ac_config_targets $1" ;; esac shift @@ -8730,48 +8078,34 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF + + + cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. for ac_config_target in $ac_config_targets do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "include/grub/cpu") CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; - "include/grub/machine") CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gensymlist.sh") CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; - "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; - "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - + case "$ac_config_target" in + # Handling of arguments. + "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "gensymlist.sh" ) CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; + "genkernsyms.sh" ) CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; + "stamp-h" ) CONFIG_FILES="$CONFIG_FILES stamp-h" ;; + "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; + "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; + "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done - # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -8783,398 +8117,333 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, +# simply because there is no reason to put it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. +# Create a temporary directory, and hook for its removal unless debugging. $debug || { - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 + trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } + # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") + tmp=./confstat$$-$RANDOM + (umask 077 && mkdir $tmp) } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } +_ACEOF + +cat >>$CONFIG_STATUS <<_ACEOF + # -# Set up the sed scripts for CONFIG_FILES section. +# CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then +if test -n "\$CONFIG_FILES"; then + # Protect against being on the right side of a sed subst in config.status. + sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; + s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +s,@SHELL@,$SHELL,;t t +s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +s,@exec_prefix@,$exec_prefix,;t t +s,@prefix@,$prefix,;t t +s,@program_transform_name@,$program_transform_name,;t t +s,@bindir@,$bindir,;t t +s,@sbindir@,$sbindir,;t t +s,@libexecdir@,$libexecdir,;t t +s,@datadir@,$datadir,;t t +s,@sysconfdir@,$sysconfdir,;t t +s,@sharedstatedir@,$sharedstatedir,;t t +s,@localstatedir@,$localstatedir,;t t +s,@libdir@,$libdir,;t t +s,@includedir@,$includedir,;t t +s,@oldincludedir@,$oldincludedir,;t t +s,@infodir@,$infodir,;t t +s,@mandir@,$mandir,;t t +s,@build_alias@,$build_alias,;t t +s,@host_alias@,$host_alias,;t t +s,@target_alias@,$target_alias,;t t +s,@DEFS@,$DEFS,;t t +s,@ECHO_C@,$ECHO_C,;t t +s,@ECHO_N@,$ECHO_N,;t t +s,@ECHO_T@,$ECHO_T,;t t +s,@LIBS@,$LIBS,;t t +s,@build@,$build,;t t +s,@build_cpu@,$build_cpu,;t t +s,@build_vendor@,$build_vendor,;t t +s,@build_os@,$build_os,;t t +s,@host@,$host,;t t +s,@host_cpu@,$host_cpu,;t t +s,@host_vendor@,$host_vendor,;t t +s,@host_os@,$host_os,;t t +s,@target@,$target,;t t +s,@target_cpu@,$target_cpu,;t t +s,@target_vendor@,$target_vendor,;t t +s,@target_os@,$target_os,;t t +s,@platform@,$platform,;t t +s,@CMP@,$CMP,;t t +s,@YACC@,$YACC,;t t +s,@UNIFONT_HEX@,$UNIFONT_HEX,;t t +s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +s,@INSTALL_DATA@,$INSTALL_DATA,;t t +s,@AWK@,$AWK,;t t +s,@SET_MAKE@,$SET_MAKE,;t t +s,@RUBY@,$RUBY,;t t +s,@HELP2MAN@,$HELP2MAN,;t t +s,@CC@,$CC,;t t +s,@CFLAGS@,$CFLAGS,;t t +s,@LDFLAGS@,$LDFLAGS,;t t +s,@CPPFLAGS@,$CPPFLAGS,;t t +s,@ac_ct_CC@,$ac_ct_CC,;t t +s,@EXEEXT@,$EXEEXT,;t t +s,@OBJEXT@,$OBJEXT,;t t +s,@CPP@,$CPP,;t t +s,@EGREP@,$EGREP,;t t +s,@LIBLZO@,$LIBLZO,;t t +s,@TARGET_CC@,$TARGET_CC,;t t +s,@ac_ct_TARGET_CC@,$ac_ct_TARGET_CC,;t t +s,@OBJCOPY@,$OBJCOPY,;t t +s,@ac_ct_OBJCOPY@,$ac_ct_OBJCOPY,;t t +s,@STRIP@,$STRIP,;t t +s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t +s,@NM@,$NM,;t t +s,@ac_ct_NM@,$ac_ct_NM,;t t +s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t +s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t +s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t +s,@LIBCURSES@,$LIBCURSES,;t t +s,@enable_grub_emu@,$enable_grub_emu,;t t +s,@enable_grub_fstest@,$enable_grub_fstest,;t t +s,@LIBOBJS@,$LIBOBJS,;t t +s,@LTLIBOBJS@,$LTLIBOBJS,;t t +CEOF _ACEOF - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -platform!$platform$ac_delim -CMP!$CMP$ac_delim -YACC!$YACC$ac_delim -UNIFONT_HEX!$UNIFONT_HEX$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -RUBY!$RUBY$ac_delim -HELP2MAN!$HELP2MAN$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LIBLZO!$LIBLZO$ac_delim -TARGET_CC!$TARGET_CC$ac_delim -ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim -OBJCOPY!$OBJCOPY$ac_delim -STRIP!$STRIP$ac_delim -NM!$NM$ac_delim -TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim -TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim -TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim -LIBCURSES!$LIBCURSES$ac_delim -enable_grub_emu!$enable_grub_emu$ac_delim -enable_grub_fstest!$enable_grub_fstest$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + cat >>$CONFIG_STATUS <<\_ACEOF + # Split the substitutions into bite-sized pieces for seds with + # small command number limits, like on Digital OSF/1 and HP-UX. + ac_max_sed_lines=48 + ac_sed_frag=1 # Number of current file. + ac_beg=1 # First line for current file. + ac_end=$ac_max_sed_lines # Line after last line for current file. + ac_more_lines=: + ac_sed_cmds= + while $ac_more_lines; do + if test $ac_beg -gt 1; then + sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + else + sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag + fi + if test ! -s $tmp/subs.frag; then + ac_more_lines=false + else + # The purpose of the label and of the branching condition is to + # speed up the sed processing (if there are no `@' at all, there + # is no need to browse any of the substitutions). + # These are the two extra sed commands mentioned above. + (echo ':t + /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed + if test -z "$ac_sed_cmds"; then + ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" + else + ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" + fi + ac_sed_frag=`expr $ac_sed_frag + 1` + ac_beg=$ac_end + ac_end=`expr $ac_end + $ac_max_sed_lines` + fi + done + if test -z "$ac_sed_cmds"; then + ac_sed_cmds=cat fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; esac - ac_dir=`$as_dirname -- "$ac_file" || + # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. + ac_dir=`(dirname "$ac_file") 2>/dev/null || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} { (exit 1); exit 1; }; }; } + ac_builddir=. -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) +if test "$ac_dir" != .; then ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi case $srcdir in - .) # We are building in place. + .) # No --srcdir option. We are building in place. ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dir";; +*) + case "$ac_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac - case $ac_mode in - :F) - # - # CONFIG_FILE - # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; + *) ac_INSTALL=$ac_top_builddir$INSTALL ;; esac -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= + if test x"$ac_file" != x-; then + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + rm -f "$ac_file" + fi + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + configure_input= + else + configure_input="$ac_file. " + fi + configure_input=$configure_input"Generated from `echo $ac_file_in | + sed 's,.*/,,'` by configure." -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -9182,168 +8451,394 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out +s,@configure_input@,$configure_input,;t t +s,@srcdir@,$ac_srcdir,;t t +s,@abs_srcdir@,$ac_abs_srcdir,;t t +s,@top_srcdir@,$ac_top_srcdir,;t t +s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +s,@builddir@,$ac_builddir,;t t +s,@abs_builddir@,$ac_abs_builddir,;t t +s,@top_builddir@,$ac_top_builddir,;t t +s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +s,@INSTALL@,$ac_INSTALL,;t t +" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out + rm -f $tmp/stdin + if test x"$ac_file" != x-; then + mv $tmp/out $ac_file + else + cat $tmp/out + rm -f $tmp/out + fi -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" + # Run the commands associated with the file. case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + stamp-h ) echo timestamp > stamp-h ;; esac - ;; - :H) - # - # CONFIG_HEADER - # +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF + +# +# CONFIG_HEADER section. +# + +# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +# NAME is the cpp macro being defined and VALUE is the value it is being given. +# +# ac_d sets the value in "#define NAME VALUE" lines. +ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +ac_dB='[ ].*$,\1#\2' +ac_dC=' ' +ac_dD=',;t' +# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +ac_uB='$,\1#\2define\3' +ac_uC=' ' +ac_uD=',;t' + +for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". + case $ac_file in + - | *:- | *:-:* ) # input from stdin + cat >$tmp/stdin + ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` + ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; + * ) ac_file_in=$ac_file.in ;; + esac + + test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + + # First look for the input files in the build tree, otherwise in the + # src tree. + ac_file_inputs=`IFS=: + for f in $ac_file_in; do + case $f in + -) echo $tmp/stdin ;; + [\\/$]*) + # Absolute (can't be DOS-style, as IFS=:) + test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + # Do quote $f, to prevent DOS paths from being IFS'd. + echo "$f";; + *) # Relative + if test -f "$f"; then + # Build tree + echo "$f" + elif test -f "$srcdir/$f"; then + # Source tree + echo "$srcdir/$f" + else + # /dev/null tree + { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +echo "$as_me: error: cannot find input file: $f" >&2;} + { (exit 1); exit 1; }; } + fi;; + esac + done` || { (exit 1); exit 1; } + # Remove the trailing spaces. + sed 's/[ ]*$//' $ac_file_inputs >$tmp/in + _ACEOF -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' +# Transform confdefs.h into two sed scripts, `conftest.defines' and +# `conftest.undefs', that substitutes the proper values into +# config.h.in to produce config.h. The first handles `#define' +# templates, and the second `#undef' templates. +# And first: Protect against being on the right side of a sed subst in +# config.status. Protect against being in an unquoted here document +# in config.status. +rm -f conftest.defines conftest.undefs +# Using a here document instead of a string reduces the quoting nightmare. +# Putting comments in sed scripts is not portable. +# +# `end' is used to avoid that the second main sed command (meant for +# 0-ary CPP macros) applies to n-ary macro definitions. +# See the Autoconf documentation for `clear'. +cat >confdef2sed.sed <<\_ACEOF +s/[\\&,]/\\&/g +s,[\\$`],\\&,g +t clear +: clear +s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +t end +s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +: end +_ACEOF +# If some macros were called several times there might be several times +# the same #defines, which is useless. Nevertheless, we may not want to +# sort them, since we want the *last* AC-DEFINE to be honored. +uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +rm -f confdef2sed.sed -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for +# This sed command replaces #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def +cat >>conftest.undefs <<\_ACEOF +s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, _ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + +# Break up conftest.defines because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +echo ' :' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.defines >/dev/null +do + # Write a limited-size here document to $tmp/defines.sed. + echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#define' lines. + echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break + sed -f $tmp/defines.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines conftest.tail +rm -f conftest.defines +echo ' fi # grep' >>$CONFIG_STATUS +echo >>$CONFIG_STATUS + +# Break up conftest.undefs because some shells have a limit on the size +# of here documents, and old seds have small limits too (100 cmds). +echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +rm -f conftest.tail +while grep . conftest.undefs >/dev/null +do + # Write a limited-size here document to $tmp/undefs.sed. + echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS + # Speed up: don't consider the non `#undef' + echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS + # Work around the forget-to-reset-the-flag bug. + echo 't clr' >>$CONFIG_STATUS + echo ': clr' >>$CONFIG_STATUS + sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS + echo 'CEOF + sed -f $tmp/undefs.sed $tmp/in >$tmp/out + rm -f $tmp/in + mv $tmp/out $tmp/in +' >>$CONFIG_STATUS + sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail + rm -f conftest.undefs + mv conftest.tail conftest.undefs +done +rm -f conftest.undefs -echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + if test x"$ac_file" = x-; then + echo "/* Generated by configure. */" >$tmp/config.h + else + echo "/* $ac_file. Generated by configure. */" >$tmp/config.h + fi + cat $tmp/in >>$tmp/config.h + rm -f $tmp/in if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + if diff $ac_file $tmp/config.h >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else + ac_dir=`(dirname "$ac_file") 2>/dev/null || +$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_file" : 'X\(//\)[^/]' \| \ + X"$ac_file" : 'X\(//\)$' \| \ + X"$ac_file" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_file" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dir" + else + as_dir="$ac_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + rm -f $ac_file - mv "$tmp/config.h" $ac_file + mv $tmp/config.h $ac_file fi else - echo "/* $configure_input */" - cat "$ac_result" + cat $tmp/config.h + rm -f $tmp/config.h fi - rm -f "$tmp/out12" - ;; - :L) - # - # CONFIG_LINK - # +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} +# +# CONFIG_LINKS section. +# - if test ! -r "$srcdir/$ac_source"; then +for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue + ac_dest=`echo "$ac_file" | sed 's,:.*,,'` + ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` + + { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5 +echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;} + + if test ! -r $srcdir/$ac_source; then { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi - rm -f "$ac_file" + rm -f $ac_dest + + # Make relative symlinks. + ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null || +$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$ac_dest" : 'X\(//\)[^/]' \| \ + X"$ac_dest" : 'X\(//\)$' \| \ + X"$ac_dest" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$ac_dest" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + { if $as_mkdir_p; then + mkdir -p "$ac_dest_dir" + else + as_dir="$ac_dest_dir" + as_dirs= + while test ! -d "$as_dir"; do + as_dirs="$as_dir $as_dirs" + as_dir=`(dirname "$as_dir") 2>/dev/null || +$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_dir" : 'X\(//\)[^/]' \| \ + X"$as_dir" : 'X\(//\)$' \| \ + X"$as_dir" : 'X\(/\)' \| \ + . : '\(.\)' 2>/dev/null || +echo X"$as_dir" | + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } + /^X\(\/\/\)[^/].*/{ s//\1/; q; } + /^X\(\/\/\)$/{ s//\1/; q; } + /^X\(\/\).*/{ s//\1/; q; } + s/.*/./; q'` + done + test ! -n "$as_dirs" || mkdir $as_dirs + fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5 +echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;} + { (exit 1); exit 1; }; }; } + + ac_builddir=. + +if test "$ac_dest_dir" != .; then + ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'` + # A "../" for each directory in $ac_dir_suffix. + ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +else + ac_dir_suffix= ac_top_builddir= +fi + +case $srcdir in + .) # No --srcdir option. We are building in place. + ac_srcdir=. + if test -z "$ac_top_builddir"; then + ac_top_srcdir=. + else + ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` + fi ;; + [\\/]* | ?:[\\/]* ) # Absolute path. + ac_srcdir=$srcdir$ac_dir_suffix; + ac_top_srcdir=$srcdir ;; + *) # Relative path. + ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_builddir$srcdir ;; +esac + +# Do not use `cd foo && pwd` to compute absolute paths, because +# the directories may not exist. +case `pwd` in +.) ac_abs_builddir="$ac_dest_dir";; +*) + case "$ac_dest_dir" in + .) ac_abs_builddir=`pwd`;; + [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";; + *) ac_abs_builddir=`pwd`/"$ac_dest_dir";; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_builddir=${ac_top_builddir}.;; +*) + case ${ac_top_builddir}. in + .) ac_abs_top_builddir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; + *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_srcdir=$ac_srcdir;; +*) + case $ac_srcdir in + .) ac_abs_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; + *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; + esac;; +esac +case $ac_abs_builddir in +.) ac_abs_top_srcdir=$ac_top_srcdir;; +*) + case $ac_top_srcdir in + .) ac_abs_top_srcdir=$ac_abs_builddir;; + [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; + *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; + esac;; +esac + - # Try a relative symlink, then a hard link, then a copy. case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || - cp -p "$srcdir/$ac_source" "$ac_file" || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} + + # Try a symlink, then a hard link, then a copy. + ln -s $ac_rel_source $ac_dest 2>/dev/null || + ln $srcdir/$ac_source $ac_dest 2>/dev/null || + cp -p $srcdir/$ac_source $ac_dest || + { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5 +echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;} { (exit 1); exit 1; }; } - ;; - - esac - - - case $ac_file$ac_mode in - "stamp-h":F) echo timestamp > stamp-h ;; - - esac -done # for ac_tag +done +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF { (exit 0); exit 0; } _ACEOF diff --git a/configure.ac b/configure.ac index 38c957243..3a737f47e 100644 --- a/configure.ac +++ b/configure.ac @@ -254,11 +254,11 @@ fi # Smashing stack protector. grub_CHECK_STACK_PROTECTOR -[# Need that, because some distributions ship compilers that include +# Need that, because some distributions ship compilers that include # `-fstack-protector' in the default specs. -if [ x"$ssp_possible" = xyes ]; then - TARGET_CFLAGS=$TARGET_CFLAGS\ -fno-stack-protector -fi] +if test "x$ssp_possible" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" +fi AC_SUBST(TARGET_CFLAGS) AC_SUBST(TARGET_CPPFLAGS) From 0de8be863baa6d9c5459667032f41b5ed3410524 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 13 Feb 2008 20:04:37 +0000 Subject: [PATCH 0048/1707] 2008-02-13 Robert Millan * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Remove `commands/i386/pc/halt.c' and `commands/i386/pc/reboot.c'. * kern/i386/linuxbios/init.c (grub_halt, grub_reboot): Remove stubs. --- ChangeLog | 6 + conf/i386-linuxbios.mk | 17 +- conf/i386-linuxbios.rmk | 1 - config.h.in | 4 +- configure | 7323 +++++++++++++++++++----------------- kern/i386/linuxbios/init.c | 14 - 6 files changed, 3926 insertions(+), 3439 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b9b74968..a658c59c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-13 Robert Millan + + * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Remove + `commands/i386/pc/halt.c' and `commands/i386/pc/reboot.c'. + * kern/i386/linuxbios/init.c (grub_halt, grub_reboot): Remove stubs. + 2008-02-13 Yoshinori K. Okuji * configure.ac: Only a cosmetic change on the handling of diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index aceb204dd..7c7493a20 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -195,7 +195,6 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ @@ -223,11 +222,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_i386_pc_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_i386_pc_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -277,14 +276,6 @@ grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_hexdump.d -grub_emu-commands_i386_pc_halt.o: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) - $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_i386_pc_halt.d - -grub_emu-commands_i386_pc_reboot.o: commands/i386/pc/reboot.c $(commands/i386/pc/reboot.c_DEPENDENCIES) - $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_i386_pc_reboot.d - grub_emu-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_i386_cpuid.d diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 4a002a6c3..5d40cb50e 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -61,7 +61,6 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/i386/pc/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ diff --git a/config.h.in b/config.h.in index c22d5b12b..1aef2123b 100644 --- a/config.h.in +++ b/config.h.in @@ -88,10 +88,10 @@ /* Define to the version of this package. */ #undef PACKAGE_VERSION -/* The size of a `long', as computed by sizeof. */ +/* The size of `long', as computed by sizeof. */ #undef SIZEOF_LONG -/* The size of a `void *', as computed by sizeof. */ +/* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P /* Define it to either start or _start */ diff --git a/configure b/configure index 3a3baf888..d4f9276a9 100644 --- a/configure +++ b/configure @@ -1,83 +1,37 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.59 for GRUB 1.96. +# Generated by GNU Autoconf 2.61 for GRUB 1.96. # # Report bugs to . # -# Copyright (C) 2003 Free Software Foundation, Inc. +# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset + setopt NO_GLOB_SUBST else - as_unset=false + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -98,124 +52,466 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var fi - if test ! -f "$as_myself"; then - { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + +if test "x$CONFIG_SHELL" = x; then + if (eval ":") 2>/dev/null; then + as_have_required=yes +else + as_have_required=no +fi + + if test $as_have_required = yes && (eval ": +(as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0) || { (exit 1); exit 1; } + +( + as_lineno_1=\$LINENO + as_lineno_2=\$LINENO + test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && + test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } +") 2> /dev/null; then + : +else + as_candidate_shells= as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in + case $as_dir in /*) - if ("$as_dir/$as_base" -c ' + for as_base in sh bash ksh sh5; do + as_candidate_shells="$as_candidate_shells $as_dir/$as_base" + done;; + esac +done +IFS=$as_save_IFS + + + for as_shell in $as_candidate_shells $SHELL; do + # Try only shells that exist, to save several forks. + if { test -f "$as_shell" || test -f "$as_shell.exe"; } && + { ("$as_shell") 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +_ASEOF +}; then + CONFIG_SHELL=$as_shell + as_have_required=yes + if { "$as_shell" 2> /dev/null <<\_ASEOF +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + +fi + + +: +(as_func_return () { + (exit $1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = "$1" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test $exitcode = 0) || { (exit 1); exit 1; } + +( as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } + +_ASEOF +}; then + break +fi + +fi + + done + + if test "x$CONFIG_SHELL" != x; then + for as_var in BASH_ENV ENV + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} +fi + + + if test $as_have_required = no; then + echo This script requires a shell more modern than all the + echo shells that I found on your system. Please install a + echo modern shell, or manually run the script under such a + echo shell if you do have one. + { (exit 1); exit 1; } +fi + + +fi + +fi + + + +(eval "as_func_return () { + (exit \$1) +} +as_func_success () { + as_func_return 0 +} +as_func_failure () { + as_func_return 1 +} +as_func_ret_success () { + return 0 +} +as_func_ret_failure () { + return 1 +} + +exitcode=0 +if as_func_success; then + : +else + exitcode=1 + echo as_func_success failed. +fi + +if as_func_failure; then + exitcode=1 + echo as_func_failure succeeded. +fi + +if as_func_ret_success; then + : +else + exitcode=1 + echo as_func_ret_success failed. +fi + +if as_func_ret_failure; then + exitcode=1 + echo as_func_ret_failure succeeded. +fi + +if ( set x; as_func_ret_success y && test x = \"\$1\" ); then + : +else + exitcode=1 + echo positional parameters were not saved. +fi + +test \$exitcode = 0") || { + echo No shell found that supports shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message +} + + + + as_lineno_1=$LINENO + as_lineno_2=$LINENO + test "x$as_lineno_1" != "x$as_lineno_2" && + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || + chmod +x "$as_me.lineno" || { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -224,7 +520,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -233,39 +550,27 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH +exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` -exec 6>&1 - # # Initializations. # ac_default_prefix=/usr/local +ac_clean_files= ac_config_libobj_dir=. +LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} -# Maximum number of lines to put in a shell here document. -# This variable seems obsolete. It should probably be removed, and -# only ac_max_sed_lines should be used. -: ${ac_max_here_lines=38} - # Identity of this package. PACKAGE_NAME='GRUB' PACKAGE_TARNAME='grub' @@ -277,42 +582,134 @@ ac_unique_file="include/grub/dl.h" # Factoring default headers for most tests. ac_includes_default="\ #include -#if HAVE_SYS_TYPES_H +#ifdef HAVE_SYS_TYPES_H # include #endif -#if HAVE_SYS_STAT_H +#ifdef HAVE_SYS_STAT_H # include #endif -#if STDC_HEADERS +#ifdef STDC_HEADERS # include # include #else -# if HAVE_STDLIB_H +# ifdef HAVE_STDLIB_H # include # endif #endif -#if HAVE_STRING_H -# if !STDC_HEADERS && HAVE_MEMORY_H +#ifdef HAVE_STRING_H +# if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif -#if HAVE_STRINGS_H +#ifdef HAVE_STRINGS_H # include #endif -#if HAVE_INTTYPES_H +#ifdef HAVE_INTTYPES_H # include -#else -# if HAVE_STDINT_H -# include -# endif #endif -#if HAVE_UNISTD_H +#ifdef HAVE_STDINT_H +# include +#endif +#ifdef HAVE_UNISTD_H # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os platform CMP YACC UNIFONT_HEX INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA AWK SET_MAKE RUBY HELP2MAN CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBLZO TARGET_CC ac_ct_TARGET_CC OBJCOPY ac_ct_OBJCOPY STRIP ac_ct_STRIP NM ac_ct_NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS LIBCURSES enable_grub_emu enable_grub_fstest LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL +PATH_SEPARATOR +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +platform +CMP +YACC +UNIFONT_HEX +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +AWK +SET_MAKE +RUBY +HELP2MAN +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +LIBLZO +TARGET_CC +ac_ct_TARGET_CC +OBJCOPY +STRIP +NM +TARGET_CFLAGS +TARGET_CPPFLAGS +TARGET_LDFLAGS +LIBCURSES +enable_grub_emu +enable_grub_fstest +LIBOBJS +LTLIBOBJS' ac_subst_files='' + ac_precious_vars='build_alias +host_alias +target_alias +CC +CFLAGS +LDFLAGS +LIBS +CPPFLAGS +CPP' + # Initialize some variables set by options. ac_init_help= @@ -339,34 +736,48 @@ x_libraries=NONE # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. +# (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' -datadir='${prefix}/share' +datarootdir='${prefix}/share' +datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' -libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' -infodir='${prefix}/info' -mandir='${prefix}/man' +docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' +infodir='${datarootdir}/info' +htmldir='${docdir}' +dvidir='${docdir}' +pdfdir='${docdir}' +psdir='${docdir}' +libdir='${exec_prefix}/lib' +localedir='${datarootdir}/locale' +mandir='${datarootdir}/man' ac_prev= +ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then - eval "$ac_prev=\$ac_option" + eval $ac_prev=\$ac_option ac_prev= continue fi - ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` + case $ac_option in + *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; + *) ac_optarg=yes ;; + esac # Accept the important Cygnus configure options, so we can diagnose typos. - case $ac_option in + case $ac_dashdash$ac_option in + --) + ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; @@ -388,33 +799,45 @@ do --config-cache | -C) cache_file=config.cache ;; - -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ - | --da=*) + -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; + -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ + | --dataroo | --dataro | --datar) + ac_prev=datarootdir ;; + -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ + | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) + datarootdir=$ac_optarg ;; + -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - eval "enable_$ac_feature=no" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; + + -docdir | --docdir | --docdi | --doc | --do) + ac_prev=docdir ;; + -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) + docdir=$ac_optarg ;; + + -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) + ac_prev=dvidir ;; + -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) + dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "enable_$ac_feature='$ac_optarg'" ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -441,6 +864,12 @@ do -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; + -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) + ac_prev=htmldir ;; + -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ + | --ht=*) + htmldir=$ac_optarg ;; + -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; @@ -465,13 +894,16 @@ do | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; + -localedir | --localedir | --localedi | --localed | --locale) + ac_prev=localedir ;; + -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) + localedir=$ac_optarg ;; + -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst \ - | --locals | --local | --loca | --loc | --lo) + | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* \ - | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) + | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) @@ -536,6 +968,16 @@ do | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; + -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) + ac_prev=pdfdir ;; + -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) + pdfdir=$ac_optarg ;; + + -psdir | --psdir | --psdi | --psd | --ps) + ac_prev=psdir ;; + -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) + psdir=$ac_optarg ;; + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; @@ -588,24 +1030,20 @@ do -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package| sed 's/-/_/g'` - case $ac_option in - *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; - *) ac_optarg=yes ;; - esac - eval "with_$ac_package='$ac_optarg'" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/-/_/g'` - eval "with_$ac_package=no" ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -636,8 +1074,7 @@ Try \`$0 --help' for more information." >&2 expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } - ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` - eval "$ac_envvar='$ac_optarg'" + eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) @@ -657,27 +1094,19 @@ if test -n "$ac_prev"; then { (exit 1); exit 1; }; } fi -# Be sure to have absolute paths. -for ac_var in exec_prefix prefix +# Be sure to have absolute directory names. +for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ + datadir sysconfdir sharedstatedir localstatedir includedir \ + oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ + libdir localedir mandir do - eval ac_val=$`echo $ac_var` + eval ac_val=\$$ac_var case $ac_val in - [\\/$]* | ?:[\\/]* | NONE | '' ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; - esac -done - -# Be sure to have absolute paths. -for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ - localstatedir libdir includedir oldincludedir infodir mandir -do - eval ac_val=$`echo $ac_var` - case $ac_val in - [\\/$]* | ?:[\\/]* ) ;; - *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; };; + [\\/$]* | ?:[\\/]* ) continue;; + NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { (exit 1); exit 1; }; } done # There might be people who depend on the old broken behavior: `$host' @@ -704,74 +1133,76 @@ test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null +ac_pwd=`pwd` && test -n "$ac_pwd" && +ac_ls_di=`ls -di .` && +ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || + { echo "$as_me: error: Working directory cannot be determined" >&2 + { (exit 1); exit 1; }; } +test "X$ac_ls_di" = "X$ac_pwd_ls_di" || + { echo "$as_me: error: pwd does not report name of working directory" >&2 + { (exit 1); exit 1; }; } + + # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes - # Try the directory containing this script, then its parent. - ac_confdir=`(dirname "$0") 2>/dev/null || + # Try the directory containing this script, then the parent directory. + ac_confdir=`$as_dirname -- "$0" || $as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$0" : 'X\(//\)[^/]' \| \ X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$0" : 'X\(/\)' \| . 2>/dev/null || echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` srcdir=$ac_confdir - if test ! -r $srcdir/$ac_unique_file; then + if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi -if test ! -r $srcdir/$ac_unique_file; then - if test "$ac_srcdir_defaulted" = yes; then - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +if test ! -r "$srcdir/$ac_unique_file"; then + test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } - else - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } - fi fi -(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || - { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" +ac_abs_confdir=`( + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } -srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` -ac_env_build_alias_set=${build_alias+set} -ac_env_build_alias_value=$build_alias -ac_cv_env_build_alias_set=${build_alias+set} -ac_cv_env_build_alias_value=$build_alias -ac_env_host_alias_set=${host_alias+set} -ac_env_host_alias_value=$host_alias -ac_cv_env_host_alias_set=${host_alias+set} -ac_cv_env_host_alias_value=$host_alias -ac_env_target_alias_set=${target_alias+set} -ac_env_target_alias_value=$target_alias -ac_cv_env_target_alias_set=${target_alias+set} -ac_cv_env_target_alias_value=$target_alias -ac_env_CC_set=${CC+set} -ac_env_CC_value=$CC -ac_cv_env_CC_set=${CC+set} -ac_cv_env_CC_value=$CC -ac_env_CFLAGS_set=${CFLAGS+set} -ac_env_CFLAGS_value=$CFLAGS -ac_cv_env_CFLAGS_set=${CFLAGS+set} -ac_cv_env_CFLAGS_value=$CFLAGS -ac_env_LDFLAGS_set=${LDFLAGS+set} -ac_env_LDFLAGS_value=$LDFLAGS -ac_cv_env_LDFLAGS_set=${LDFLAGS+set} -ac_cv_env_LDFLAGS_value=$LDFLAGS -ac_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_env_CPPFLAGS_value=$CPPFLAGS -ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} -ac_cv_env_CPPFLAGS_value=$CPPFLAGS -ac_env_CPP_set=${CPP+set} -ac_env_CPP_value=$CPP -ac_cv_env_CPP_set=${CPP+set} -ac_cv_env_CPP_value=$CPP + pwd)` +# When building in place, set srcdir=. +if test "$ac_abs_confdir" = "$ac_pwd"; then + srcdir=. +fi +# Remove unnecessary trailing slashes from srcdir. +# Double slashes in file names in object file debugging info +# mess up M-x gdb in Emacs. +case $srcdir in +*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; +esac +for ac_var in $ac_precious_vars; do + eval ac_env_${ac_var}_set=\${${ac_var}+set} + eval ac_env_${ac_var}_value=\$${ac_var} + eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} + eval ac_cv_env_${ac_var}_value=\$${ac_var} +done # # Report the --help message. @@ -800,9 +1231,6 @@ Configuration: -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] -_ACEOF - - cat <<_ACEOF Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] @@ -820,15 +1248,22 @@ Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] - --datadir=DIR read-only architecture-independent data [PREFIX/share] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] - --infodir=DIR info documentation [PREFIX/info] - --mandir=DIR man documentation [PREFIX/man] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/grub] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -871,8 +1306,9 @@ Some influential environment variables: CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory - CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have - headers in a nonstandard directory + LIBS libraries to pass to the linker, e.g. -l + CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if + you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help @@ -880,120 +1316,86 @@ it to find libraries and programs with nonstandard names/locations. Report bugs to . _ACEOF +ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. - ac_popdir=`pwd` for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d $ac_dir || continue + test -d "$ac_dir" || continue ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - - cd $ac_dir - # Check for guested configure; otherwise get Cygnus style configure. - if test -f $ac_srcdir/configure.gnu; then - echo - $SHELL $ac_srcdir/configure.gnu --help=recursive - elif test -f $ac_srcdir/configure; then - echo - $SHELL $ac_srcdir/configure --help=recursive - elif test -f $ac_srcdir/configure.ac || - test -f $ac_srcdir/configure.in; then - echo - $ac_configure --help + cd "$ac_dir" || { ac_status=$?; continue; } + # Check for guested configure. + if test -f "$ac_srcdir/configure.gnu"; then + echo && + $SHELL "$ac_srcdir/configure.gnu" --help=recursive + elif test -f "$ac_srcdir/configure"; then + echo && + $SHELL "$ac_srcdir/configure" --help=recursive else echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi - cd $ac_popdir + fi || ac_status=$? + cd "$ac_pwd" || { ac_status=$?; break; } done fi -test -n "$ac_init_help" && exit 0 +test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GRUB configure 1.96 -generated by GNU Autoconf 2.59 +generated by GNU Autoconf 2.61 -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF - exit 0 + exit fi -exec 5>config.log -cat >&5 <<_ACEOF +cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ _ACEOF +exec 5>>config.log { cat <<_ASUNAME ## --------- ## @@ -1012,7 +1414,7 @@ uname -v = `(uname -v) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` @@ -1026,6 +1428,7 @@ do test -z "$as_dir" && as_dir=. echo "PATH: $as_dir" done +IFS=$as_save_IFS } >&5 @@ -1047,7 +1450,6 @@ _ACEOF ac_configure_args= ac_configure_args0= ac_configure_args1= -ac_sep= ac_must_keep_next=false for ac_pass in 1 2 do @@ -1058,7 +1460,7 @@ do -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) + *\'*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in @@ -1080,9 +1482,7 @@ do -* ) ac_must_keep_next=true ;; esac fi - ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" - # Get rid of the leading space. - ac_sep=" " + ac_configure_args="$ac_configure_args '$ac_arg'" ;; esac done @@ -1093,8 +1493,8 @@ $as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_ # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. -# WARNING: Be sure not to use single quotes in there, as some shells, -# such as our DU 5.0 friend, will then `close' the trap. +# WARNING: Use '\'' to represent an apostrophe within the trap. +# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { @@ -1107,20 +1507,34 @@ trap 'exit_status=$? _ASBOX echo # The following way of writing the cache mishandles newlines in values, -{ +( + for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done (set) 2>&1 | - case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( + *${as_nl}ac_space=\ *) sed -n \ - "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" - ;; + "s/'\''/'\''\\\\'\'''\''/g; + s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" + ;; #( *) - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} + esac | + sort +) echo cat <<\_ASBOX @@ -1131,22 +1545,28 @@ _ASBOX echo for ac_var in $ac_subst_vars do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then cat <<\_ASBOX -## ------------- ## -## Output files. ## -## ------------- ## +## ------------------- ## +## File substitutions. ## +## ------------------- ## _ASBOX echo for ac_var in $ac_subst_files do - eval ac_val=$`echo $ac_var` - echo "$ac_var='"'"'$ac_val'"'"'" + eval ac_val=\$$ac_var + case $ac_val in + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + esac + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1158,26 +1578,24 @@ _ASBOX ## ----------- ## _ASBOX echo - sed "/^$/d" confdefs.h | sort + cat confdefs.h echo fi test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" echo "$as_me: exit $exit_status" } >&5 - rm -f core *.core && - rm -rf conftest* confdefs* conf$$* $ac_clean_files && + rm -f core *.core core.conftest.* && + rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status - ' 0 +' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -rf conftest* confdefs.h -# AIX cpp loses on an empty file, so make sure it contains at least a newline. -echo >confdefs.h +rm -f -r conftest* confdefs.h # Predefined preprocessor variables. @@ -1208,14 +1626,17 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer explicitly selected file to automatically selected ones. -if test -z "$CONFIG_SITE"; then - if test "x$prefix" != xNONE; then - CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" - else - CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" - fi +if test -n "$CONFIG_SITE"; then + set x "$CONFIG_SITE" +elif test "x$prefix" != xNONE; then + set x "$prefix/share/config.site" "$prefix/etc/config.site" +else + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in $CONFIG_SITE; do +shift +for ac_site_file +do if test -r "$ac_site_file"; then { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} @@ -1231,8 +1652,8 @@ if test -r "$cache_file"; then { echo "$as_me:$LINENO: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in - [\\/]* | ?:[\\/]* ) . $cache_file;; - *) . ./$cache_file;; + [\\/]* | ?:[\\/]* ) . "$cache_file";; + *) . "./$cache_file";; esac fi else @@ -1244,12 +1665,11 @@ fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false -for ac_var in `(set) 2>&1 | - sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val="\$ac_cv_env_${ac_var}_value" - eval ac_new_val="\$ac_env_${ac_var}_value" + eval ac_old_val=\$ac_cv_env_${ac_var}_value + eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 @@ -1274,8 +1694,7 @@ echo "$as_me: current value: $ac_new_val" >&2;} # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) - ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1292,6 +1711,30 @@ echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start ov { (exit 1); exit 1; }; } fi + + + + + + + + + + + + + + + + + + + + + + + + ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -1301,134 +1744,159 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - - - - - - - - - - - - - - - - - - - - - - - ac_config_headers="$ac_config_headers config.h" +ac_config_headers="$ac_config_headers config.h" # Checks for host and target systems. ac_aux_dir= -for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do - if test -f $ac_dir/install-sh; then +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" break - elif test -f $ac_dir/install.sh; then + elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break - elif test -f $ac_dir/shtool; then + elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 -echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi -ac_config_guess="$SHELL $ac_aux_dir/config.guess" -ac_config_sub="$SHELL $ac_aux_dir/config.sub" -ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. + +# These three variables are undocumented and unsupported, +# and are intended to be withdrawn in a future Autoconf release. +# They can cause serious problems if a builder's source tree is in a directory +# whose full name contains unusual characters. +ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. +ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. +ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + # Make sure we can run config.sub. -$ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $ac_config_sub" >&5 -echo "$as_me: error: cannot run $ac_config_sub" >&2;} +$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_build_alias=$build_alias -test -z "$ac_cv_build_alias" && - ac_cv_build_alias=`$ac_config_guess` -test -z "$ac_cv_build_alias" && + ac_build_alias=$build_alias +test "x$ac_build_alias" = x && + ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` +test "x$ac_build_alias" = x && { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } -ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_build_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed" >&2;} +ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } +case $ac_cv_build in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} + { (exit 1); exit 1; }; };; +esac build=$ac_cv_build -build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_build +shift +build_cpu=$1 +build_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +build_os=$* +IFS=$ac_save_IFS +case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_host_alias=$host_alias -test -z "$ac_cv_host_alias" && - ac_cv_host_alias=$ac_cv_build_alias -ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_host_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} + if test "x$host_alias" = x; then + ac_cv_host=$ac_cv_build +else + ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } +case $ac_cv_host in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} + { (exit 1); exit 1; }; };; +esac host=$ac_cv_host -host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_host +shift +host_cpu=$1 +host_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +host_os=$* +IFS=$ac_save_IFS +case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_target_alias=$target_alias -test "x$ac_cv_target_alias" = "x" && - ac_cv_target_alias=$ac_cv_host_alias -ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:$LINENO: error: $ac_config_sub $ac_cv_target_alias failed" >&5 -echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} + if test "x$target_alias" = x; then + ac_cv_target=$ac_cv_host +else + ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } +fi fi -echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } +case $ac_cv_target in +*-*-*) ;; +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} + { (exit 1); exit 1; }; };; +esac target=$ac_cv_target -target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` -target_vendor=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` -target_os=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` +ac_save_IFS=$IFS; IFS='-' +set x $ac_cv_target +shift +target_cpu=$1 +target_vendor=$2 +shift; shift +# Remember, the first character of IFS is used to create $*, +# except with old shells: +target_os=$* +IFS=$ac_save_IFS +case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac # The aliases save the names the user supplied, while $host etc. @@ -1440,17 +1908,17 @@ test -n "$target_alias" && # Program name transformations test "$program_prefix" != NONE && - program_transform_name="s,^,$program_prefix,;$program_transform_name" + program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && - program_transform_name="s,\$,$program_suffix,;$program_transform_name" + program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm conftest.sed +rm -f conftest.sed case "$host_cpu" in @@ -1470,11 +1938,11 @@ esac # Specify the platform (such as firmware). -# Check whether --with-platform or --without-platform was given. +# Check whether --with-platform was given. if test "${with_platform+set}" = set; then - withval="$with_platform" + withval=$with_platform; +fi -fi; # Guess the platform if not specified. if test "x$with_platform" = x; then @@ -1517,8 +1985,8 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CMP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1531,25 +1999,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CMP="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6 + { echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CMP" && break done @@ -1563,8 +2033,8 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_YACC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1577,25 +2047,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6 + { echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$YACC" && break done @@ -1626,8 +2098,8 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1649,7 +2121,7 @@ case $as_dir/ in # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then + if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -1668,21 +2140,22 @@ case $as_dir/ in ;; esac done +IFS=$as_save_IFS fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else - # As a last resort, use the slow shell script. We don't cache a - # path for INSTALL within a source directory, because that will + # As a last resort, use the slow shell script. Don't cache a + # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is - # removed, or if the path is relative. + # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi -echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6 +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -1696,8 +2169,8 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1710,54 +2183,57 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6 + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$AWK" && break done -echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6 -set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,:./+-,___p_,'` -if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF +SHELL = /bin/sh all: - @echo 'ac_maketemp="$(MAKE)"' + @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. -eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` -if test -n "$ac_maketemp"; then - eval ac_cv_prog_make_${ac_make}_set=yes -else - eval ac_cv_prog_make_${ac_make}_set=no -fi +case `${MAKE-make} -f conftest.make 2>/dev/null` in + *@@@%%%=?*=@@@%%%*) + eval ac_cv_prog_make_${ac_make}_set=yes;; + *) + eval ac_cv_prog_make_${ac_make}_set=no;; +esac rm -f conftest.make fi -if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -1765,8 +2241,8 @@ fi # These are not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RUBY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1781,31 +2257,32 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi RUBY=$ac_cv_path_RUBY - if test -n "$RUBY"; then - echo "$as_me:$LINENO: result: $RUBY" >&5 -echo "${ECHO_T}$RUBY" >&6 + { echo "$as_me:$LINENO: result: $RUBY" >&5 +echo "${ECHO_T}$RUBY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + # Extract the first word of "help2man", so it can be a program name with args. set dummy help2man; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_HELP2MAN+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1820,28 +2297,29 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS ;; esac fi HELP2MAN=$ac_cv_path_HELP2MAN - if test -n "$HELP2MAN"; then - echo "$as_me:$LINENO: result: $HELP2MAN" >&5 -echo "${ECHO_T}$HELP2MAN" >&6 + { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 +echo "${ECHO_T}$HELP2MAN" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + # # Checks for host programs. # @@ -1854,8 +2332,8 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1868,32 +2346,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1906,36 +2386,51 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -1948,74 +2443,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then - ac_cv_prog_ac_ct_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 + fi -done -done - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 -else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - - CC=$ac_ct_CC -else - CC="$ac_cv_prog_CC" -fi - fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2029,7 +2484,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2040,6 +2495,7 @@ do fi done done +IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. @@ -2057,22 +2513,23 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2085,36 +2542,38 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6 + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC - for ac_prog in cl + for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2127,29 +2586,45 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_CC" && break done - CC=$ac_ct_CC + if test "x$ac_ct_CC" = x; then + CC="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + CC=$ac_ct_CC + fi fi fi @@ -2162,21 +2637,35 @@ See \`config.log' for more details." >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO:" \ - "checking for C compiler version" >&5 +echo "$as_me:$LINENO: checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version &5\"") >&5 - (eval $ac_compiler --version &5) 2>&5 +{ (ac_try="$ac_compiler --version >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v &5\"") >&5 - (eval $ac_compiler -v &5) 2>&5 +{ (ac_try="$ac_compiler -v >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V &5\"") >&5 - (eval $ac_compiler -V &5) 2>&5 +{ (ac_try="$ac_compiler -V >&5" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } @@ -2201,47 +2690,77 @@ ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 - (eval $ac_link_default) 2>&5 +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. +ac_rmfiles= +for ac_file in $ac_files +do + case $ac_file in + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + * ) ac_rmfiles="$ac_rmfiles $ac_file";; + esac +done +rm -f $ac_rmfiles + +if { (ac_try="$ac_link_default" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link_default") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - # Find the output, starting from the most likely. This scheme is -# not robust to junk in `.', hence go to wildcards (a.*) only as a last -# resort. - -# Be careful to initialize this variable, since it used to be cached. -# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. -ac_cv_exeext= -# b.out is created by i960 compilers. -for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out + # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. +# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' +# in a Makefile. We should not override ac_cv_exeext if it was cached, +# so that the user can short-circuit this test for compilers unknown to +# Autoconf. +for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) - ;; - conftest.$ac_ext ) - # This is the source file. + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - # FIXME: I believe we export ac_cv_exeext for Libtool, - # but it would be cool to find out if it's true. Does anybody - # maintain Libtool? --akim. - export ac_cv_exeext + if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; + then :; else + ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` + fi + # We set ac_cv_exeext here because the later test for it is not + # safe: cross compilers may not add the suffix if given an `-o' + # argument, so we may need to know it at that point already. + # Even if this section looks crufty: it has the advantage of + # actually working. break;; * ) break;; esac done +test "$ac_cv_exeext" = no && ac_cv_exeext= + else + ac_file='' +fi + +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } +if test -z "$ac_file"; then echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -2253,19 +2772,21 @@ See \`config.log' for more details." >&2;} fi ac_exeext=$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6 -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -2284,22 +2805,27 @@ See \`config.log' for more details." >&2;} fi fi fi -echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save -# Check the compiler produces executables we can run. If not, either +# Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6 +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then @@ -2310,9 +2836,8 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - export ac_cv_exeext break;; * ) break;; esac @@ -2326,14 +2851,14 @@ See \`config.log' for more details." >&2;} fi rm -f conftest$ac_cv_exeext -echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2353,14 +2878,20 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then - for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do + for ac_file in conftest.o conftest.obj conftest.*; do + test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -2378,12 +2909,12 @@ fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2406,50 +2937,49 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_compiler_gnu=no + ac_compiler_gnu=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -CFLAGS="-g" -echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - cat >conftest.$ac_ext <<_ACEOF + ac_save_c_werror_flag=$ac_c_werror_flag + ac_c_werror_flag=yes + ac_cv_prog_cc_g=no + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext @@ -2465,38 +2995,118 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_prog_cc_g=no + CFLAGS="" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + : +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_c_werror_flag=$ac_save_c_werror_flag + CFLAGS="-g" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_g=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_c_werror_flag=$ac_save_c_werror_flag +fi +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -2512,12 +3122,12 @@ else CFLAGS= fi fi -echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 -echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 -if test "${ac_cv_prog_cc_stdc+set}" = set; then +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +if test "${ac_cv_prog_cc_c89+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_prog_cc_stdc=no + ac_cv_prog_cc_c89=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2551,12 +3161,17 @@ static char *f (char * (*g) (char **, int), char **p, ...) /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std1 is added to get + as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std1. */ + that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters + inside strings and character constants. */ +#define FOO(x) 'x' +int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; + int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; @@ -2571,205 +3186,57 @@ return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; return 0; } _ACEOF -# Don't try gcc -ansi; that turns off useful extensions and -# breaks some systems' header files. -# AIX -qlanglvl=ansi -# Ultrix and OSF/1 -std1 -# HP-UX 10.20 and later -Ae -# HP-UX older versions -Aa -D_HPUX_SOURCE -# SVR4 -Xc -D__EXTENSIONS__ -for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ + -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_prog_cc_stdc=$ac_arg -break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_prog_cc_c89=$ac_arg else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext + test "x$ac_cv_prog_cc_c89" != "xno" && break done -rm -f conftest.$ac_ext conftest.$ac_objext +rm -f conftest.$ac_ext CC=$ac_save_CC fi - -case "x$ac_cv_prog_cc_stdc" in - x|xno) - echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6 ;; +# AC_CACHE_VAL +case "x$ac_cv_prog_cc_c89" in + x) + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; + xno) + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) - echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 - CC="$CC $ac_cv_prog_cc_stdc" ;; + CC="$CC $ac_cv_prog_cc_c89" + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac -# Some people use a C++ compiler to compile C. Since we use `exit', -# in C++ we need to declare it. In case someone uses the same compiler -# for both compiling C and C++ we need to have the C++ compiler decide -# the declaration of exit, since it's the most demanding environment. -cat >conftest.$ac_ext <<_ACEOF -#ifndef __cplusplus - choke me -#endif -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - for ac_declaration in \ - '' \ - 'extern "C" void std::exit (int) throw (); using std::exit;' \ - 'extern "C" void std::exit (int); using std::exit;' \ - 'extern "C" void exit (int) throw ();' \ - 'extern "C" void exit (int);' \ - 'void exit (int);' -do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -#include -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 -continue -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_declaration -int -main () -{ -exit (42); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -done -rm -f conftest* -if test -n "$ac_declaration"; then - echo '#ifdef __cplusplus' >>confdefs.h - echo $ac_declaration >>confdefs.h - echo '#endif' >>confdefs.h -fi - -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -2788,15 +3255,15 @@ _ACEOF -# Check whether --enable-largefile or --disable-largefile was given. +# Check whether --enable-largefile was given. if test "${enable_largefile+set}" = set; then - enableval="$enable_largefile" + enableval=$enable_largefile; +fi -fi; if test "$enable_largefile" != no; then - echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2804,8 +3271,8 @@ else if test "$GCC" != yes; then ac_save_CC=$CC while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2829,84 +3296,77 @@ main () return 0; } _ACEOF - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_largefile_CC=' -n32'; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext + +rm -f core conftest.err conftest.$ac_objext break done CC=$ac_save_CC rm -f conftest.$ac_ext fi fi -echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do - ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2931,34 +3391,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -2984,54 +3441,53 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_file_offset_bits=64; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 -if test "$ac_cv_sys_file_offset_bits" != no; then - +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits _ACEOF - -fi +;; +esac rm -f conftest* - echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else while :; do - ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3056,34 +3512,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - break + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -3109,288 +3562,58 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_sys_large_files=1; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 + fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown break done fi -echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6 -if test "$ac_cv_sys_large_files" != no; then - +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) cat >>confdefs.h <<_ACEOF #define _LARGE_FILES $ac_cv_sys_large_files _ACEOF - -fi +;; +esac rm -f conftest* + fi fi # Identify characteristics of the host architecture. -echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6 -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -ac_cv_c_bigendian=no -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -# It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -int -main () -{ - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long l; - char c[sizeof (long)]; - } u; - u.l = 1; - exit (u.c[sizeof (long) - 1] == 1); -} -_ACEOF -rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6 -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -3424,24 +3647,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3450,9 +3671,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3462,24 +3684,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3490,6 +3710,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3507,8 +3728,8 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6 +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3531,24 +3752,22 @@ cat >>conftest.$ac_ext <<_ACEOF #endif Syntax error _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then : else echo "$as_me: failed program was:" >&5 @@ -3557,9 +3776,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. continue fi + rm -f conftest.err conftest.$ac_ext - # OK, works on sane cases. Now check whether non-existent headers + # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3569,24 +3789,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then # Broken: success on invalid input. continue else @@ -3597,6 +3815,7 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_preproc_ok=: break fi + rm -f conftest.err conftest.$ac_ext done @@ -3619,23 +3838,170 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6 -if test "${ac_cv_prog_egrep+set}" = set; then +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +if test "${ac_cv_path_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if echo a | (grep -E '(a|b)') >/dev/null 2>&1 - then ac_cv_prog_egrep='grep -E' - else ac_cv_prog_egrep='egrep' + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_GREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in grep ggrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. + # Check for GNU $ac_path_GREP +case `"$ac_path_GREP" --version 2>&1` in +*GNU*) + ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'GREP' >> "conftest.nl" + "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_GREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_GREP="$ac_path_GREP" + ac_path_GREP_max=$ac_count fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_GREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_GREP=$GREP fi -echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 -echo "${ECHO_T}$ac_cv_prog_egrep" >&6 - EGREP=$ac_cv_prog_egrep -echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } + GREP="$ac_cv_path_GREP" + + +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 + then ac_cv_path_EGREP="$GREP -E" + else + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_path_EGREP_found=false +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_prog in egrep; do + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. + # Check for GNU $ac_path_EGREP +case `"$ac_path_EGREP" --version 2>&1` in +*GNU*) + ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; +*) + ac_count=0 + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + while : + do + cat "conftest.in" "conftest.in" >"conftest.tmp" + mv "conftest.tmp" "conftest.in" + cp "conftest.in" "conftest.nl" + echo 'EGREP' >> "conftest.nl" + "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break + diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break + ac_count=`expr $ac_count + 1` + if test $ac_count -gt ${ac_path_EGREP_max-0}; then + # Best one so far, save it but keep looking for a better one + ac_cv_path_EGREP="$ac_path_EGREP" + ac_path_EGREP_max=$ac_count + fi + # 10*(2^10) chars as input seems more than enough + test $ac_count -gt 10 && break + done + rm -f conftest.in conftest.tmp conftest.nl conftest.out;; +esac + + + $ac_path_EGREP_found && break 3 + done +done + +done +IFS=$as_save_IFS + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + { (exit 1); exit 1; }; } +fi + +else + ac_cv_path_EGREP=$EGREP +fi + + + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } + EGREP="$ac_cv_path_EGREP" + + +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3659,35 +4025,31 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_header_stdc=no + ac_cv_header_stdc=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. @@ -3743,6 +4105,7 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include +#include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) @@ -3762,18 +4125,27 @@ main () for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) - exit(2); - exit (0); + return 2; + return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -3786,12 +4158,14 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + fi fi -fi -echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3814,9 +4188,9 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -3830,38 +4204,35 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_Header=no" + eval "$as_ac_Header=no" fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 @@ -3872,8 +4243,244 @@ fi done -echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to BIG_ENDIAN or not. +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +#include + +int +main () +{ +#if BYTE_ORDER != BIG_ENDIAN + not big endian +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_c_bigendian=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + # It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +int +main () +{ + _ascii (); _ebcdic (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then + ac_cv_c_bigendian=yes +fi +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi +fi +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +int +main () +{ + + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; + + ; + return 0; +} +_ACEOF +rm -f conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_c_bigendian=no +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +( exit $ac_status ) +ac_cv_c_bigendian=yes +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +case $ac_cv_c_bigendian in + yes) + +cat >>confdefs.h <<\_ACEOF +#define WORDS_BIGENDIAN 1 +_ACEOF + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + { (exit 1); exit 1; }; } ;; +esac + +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } if test "${ac_cv_type_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -3884,61 +4491,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef void * ac__type_new_; int main () { -if ((void * *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (void *)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_void_p=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_void_p=no + ac_cv_type_void_p=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6 -echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_void_p" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -3948,10 +4551,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -3959,27 +4563,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -3989,10 +4588,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4000,56 +4600,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4057,27 +4654,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4087,10 +4679,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4098,50 +4691,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4152,10 +4743,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4163,51 +4755,44 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +'') if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4216,8 +4801,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (void *)); } -unsigned long ulongval () { return (long) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4226,35 +4812,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (void *))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (void *)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4265,29 +4860,32 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (void *), 77 +if test "$ac_cv_type_void_p" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *), 77 +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_void_p=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_void_p=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_VOID_P $ac_cv_sizeof_void_p _ACEOF -echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } if test "${ac_cv_type_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4298,61 +4896,57 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default +typedef long ac__type_new_; int main () { -if ((long *) 0) +if ((ac__type_new_ *) 0) return 0; -if (sizeof (long)) +if (sizeof (ac__type_new_)) return 0; ; return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_cv_type_long=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_type_long=no + ac_cv_type_long=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -fi -echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6 -echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } + +# The cast to long int works around a bug in the HP C Compiler +# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects +# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. +# This bug is HP SR number 8606223364. +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test "$ac_cv_type_long" = yes; then - # The cast to unsigned long works around a bug in the HP C Compiler - # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects - # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. - # This bug is HP SR number 8606223364. if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF @@ -4362,10 +4956,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -4373,27 +4968,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4403,10 +4993,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4414,56 +5005,53 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` + ac_lo=`expr $ac_mid + 1` + if test $ac_lo -le $ac_mid; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -4471,27 +5059,22 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF @@ -4501,10 +5084,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4512,50 +5096,48 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` + ac_hi=`expr '(' $ac_mid ')' - 1` + if test $ac_mid -le $ac_hi; then + ac_lo= ac_hi= + break + fi + ac_mid=`expr 2 '*' $ac_mid` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo= ac_hi= + ac_lo= ac_hi= fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext # Binary search between lo and hi bounds. while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` @@ -4566,10 +5148,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4577,51 +5160,44 @@ test_array [0] = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_lo=`expr '(' $ac_mid ')' + 1` + ac_lo=`expr '(' $ac_mid ')' + 1` fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; -'') { { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +'') if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } ;; + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi ;; esac -else - if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4630,8 +5206,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -long longval () { return (long) (sizeof (long)); } -unsigned long ulongval () { return (long) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -4640,35 +5217,44 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) - exit (1); - if (((long) (sizeof (long))) < 0) + return 1; + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { - long i = longval (); - if (i != ((long) (sizeof (long)))) - exit (1); + long int i = longval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%ld\n", i); } else { - unsigned long i = ulongval (); - if (i != ((long) (sizeof (long)))) - exit (1); + unsigned long int i = ulongval (); + if (i != ((long int) (sizeof (ac__type_sizeof_)))) + return 1; fprintf (f, "%lu\n", i); } - exit (ferror (f) || fclose (f) != 0); + return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -4679,22 +5265,25 @@ echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) -{ { echo "$as_me:$LINENO: error: cannot compute sizeof (long), 77 +if test "$ac_cv_type_long" = yes; then + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long), 77 +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext + { (exit 77); exit 77; }; } + else + ac_cv_sizeof_long=0 + fi fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val -else - ac_cv_sizeof_long=0 fi -fi -echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } + + + cat >>confdefs.h <<_ACEOF #define SIZEOF_LONG $ac_cv_sizeof_long _ACEOF @@ -4711,8 +5300,8 @@ fi if test "$target_cpu"-"$platform" = i386-pc; then # There are three possibilities. LZO version 2 installed with the name # liblzo2, with the name liblzo, and LZO version 1. - echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4725,61 +5314,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -__lzo_init_v2 (); +return __lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo2___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_lzo2___lzo_init_v2=no + ac_cv_lib_lzo2___lzo_init_v2=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then LIBLZO="-llzo2" else - echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4792,61 +5378,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __lzo_init_v2 (); int main () { -__lzo_init_v2 (); +return __lzo_init_v2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init_v2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_lzo___lzo_init_v2=no + ac_cv_lib_lzo___lzo_init_v2=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then LIBLZO="-llzo" else - echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4859,56 +5442,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char __lzo_init2 (); int main () { -__lzo_init2 (); +return __lzo_init2 (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init2=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_lzo___lzo_init2=no + ac_cv_lib_lzo___lzo_init2=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } if test $ac_cv_lib_lzo___lzo_init2 = yes; then LIBLZO="-llzo" else @@ -4923,8 +5503,8 @@ fi LIBS="$LIBS $LIBLZO" - echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -4951,68 +5531,59 @@ cat >>conftest.$ac_ext <<_ACEOF #undef lzo1x_999_compress -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char lzo1x_999_compress (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_lzo1x_999_compress) || defined (__stub___lzo1x_999_compress) +#if defined __stub_lzo1x_999_compress || defined __stub___lzo1x_999_compress choke me -#else -char (*f) () = lzo1x_999_compress; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != lzo1x_999_compress; +return lzo1x_999_compress (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_lzo1x_999_compress=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_func_lzo1x_999_compress=no + ac_cv_func_lzo1x_999_compress=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } if test $ac_cv_func_lzo1x_999_compress = yes; then : else @@ -5028,18 +5599,19 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5050,41 +5622,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5093,24 +5661,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -5118,9 +5684,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -5144,25 +5711,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -5182,9 +5748,9 @@ fi for ac_func in posix_memalign memalign do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 -if eval "test \"\${$as_ac_var+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF @@ -5210,68 +5776,60 @@ cat >>conftest.$ac_ext <<_ACEOF #undef $ac_func -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" -{ #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char $ac_func (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ -#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +#if defined __stub_$ac_func || defined __stub___$ac_func choke me -#else -char (*f) () = $ac_func; -#endif -#ifdef __cplusplus -} #endif int main () { -return f != $ac_func; +return $ac_func (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -eval "$as_ac_var=no" + eval "$as_ac_var=no" fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 @@ -5296,8 +5854,8 @@ if test "x$target" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5310,25 +5868,27 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6 + { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +echo "${ECHO_T}$TARGET_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$TARGET_CC" && break done fi @@ -5338,8 +5898,8 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5352,39 +5912,54 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -echo "${ECHO_T}$ac_ct_TARGET_CC" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + test -n "$ac_ct_TARGET_CC" && break done -test -n "$ac_ct_TARGET_CC" || ac_ct_TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 + + if test "x$ac_ct_TARGET_CC" = x; then + TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" - - TARGET_CC=$ac_ct_TARGET_CC + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + TARGET_CC=$ac_ct_TARGET_CC + fi fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5397,32 +5972,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5435,26 +6012,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - OBJCOPY=$ac_ct_OBJCOPY + if test "x$ac_ct_OBJCOPY" = x; then + OBJCOPY="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + OBJCOPY=$ac_ct_OBJCOPY + fi else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -5462,8 +6054,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5476,32 +6068,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5514,26 +6108,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -5541,8 +6150,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5555,32 +6164,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5593,26 +6204,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - NM=$ac_ct_NM + if test "x$ac_ct_NM" = x; then + NM="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi else NM="$ac_cv_prog_NM" fi @@ -5626,8 +6252,8 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5640,32 +6266,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5678,26 +6306,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - OBJCOPY=$ac_ct_OBJCOPY + if test "x$ac_ct_OBJCOPY" = x; then + OBJCOPY="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + OBJCOPY=$ac_ct_OBJCOPY + fi else OBJCOPY="$ac_cv_prog_OBJCOPY" fi @@ -5705,8 +6348,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5719,32 +6362,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6 + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5757,26 +6402,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - STRIP=$ac_ct_STRIP + if test "x$ac_ct_STRIP" = x; then + STRIP="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + STRIP=$ac_ct_STRIP + fi else STRIP="$ac_cv_prog_STRIP" fi @@ -5784,8 +6444,8 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5798,32 +6458,34 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6 + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi + fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5836,26 +6498,41 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done +IFS=$as_save_IFS fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6 + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi - NM=$ac_ct_NM + if test "x$ac_ct_NM" = x; then + NM="" + else + case $cross_compiling:$ac_tool_warned in +yes:) +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} +ac_tool_warned=yes ;; +esac + NM=$ac_ct_NM + fi else NM="$ac_cv_prog_NM" fi @@ -5882,8 +6559,8 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } if test "${size_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5905,39 +6582,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then size_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -size_flag=no + size_flag=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $size_flag" >&5 -echo "${ECHO_T}$size_flag" >&6 +{ echo "$as_me:$LINENO: result: $size_flag" >&5 +echo "${ECHO_T}$size_flag" >&6; } if test "x$size_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -5946,8 +6619,8 @@ echo "${ECHO_T}$size_flag" >&6 # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } if test "${falign_loop_flag+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -5969,39 +6642,35 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then falign_loop_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -falign_loop_flag=no + falign_loop_flag=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 -echo "${ECHO_T}$falign_loop_flag" >&6 +{ echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 +echo "${ECHO_T}$falign_loop_flag" >&6; } if test "x$falign_loop_flag" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -6017,8 +6686,8 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 -echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 +echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6; } save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" cat >conftest.$ac_ext <<_ACEOF @@ -6037,38 +6706,35 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then build_id_flag=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -build_id_flag=no + build_id_flag=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext -echo "$as_me:$LINENO: result: $build_id_flag" >&5 -echo "${ECHO_T}$build_id_flag" >&6 +{ echo "$as_me:$LINENO: result: $build_id_flag" >&5 +echo "${ECHO_T}$build_id_flag" >&6; } LDFLAGS="$save_LDFLAGS" if test "x$build_id_flag" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" @@ -6082,8 +6748,8 @@ fi # Smashing stack protector. ssp_possible=yes -echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -6091,14 +6757,14 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Need that, because some distributions ship compilers that include @@ -6118,8 +6784,8 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } if test "${grub_cv_prog_objcopy_absolute+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6180,8 +6846,8 @@ done rm -f conftest* fi -echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } if test "x$grub_cv_prog_objcopy_absolute" = xno; then { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 @@ -6190,8 +6856,8 @@ echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binu fi -echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } if test "${grub_cv_asm_uscore+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6235,13 +6901,13 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -echo "${ECHO_T}$grub_cv_asm_uscore" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } if test "x$target_cpu" = xi386; then -echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 -echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 +echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6261,44 +6927,41 @@ asm ("incl start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_start_symbol=no + grub_cv_check_start_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_start_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_start_symbol" >&6; } -echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 -echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 +echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6318,41 +6981,38 @@ asm ("incl _start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_start_symbol=no + grub_cv_check_uscore_start_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6; } @@ -6374,8 +7034,8 @@ echo "$as_me: error: neither start nor _start is defined" >&2;} fi -echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6395,44 +7055,41 @@ asm ("incl __bss_start") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_uscore_bss_start_symbol=no + grub_cv_check_uscore_uscore_bss_start_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } -echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6452,44 +7109,41 @@ asm ("incl edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_edata_symbol=no + grub_cv_check_edata_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } -echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6509,41 +7163,38 @@ asm ("incl _edata") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_edata_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_edata_symbol=no + grub_cv_check_uscore_edata_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } @@ -6570,8 +7221,8 @@ echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} fi -echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6591,44 +7242,41 @@ asm ("incl end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_end_symbol=no + grub_cv_check_end_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_end_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } -echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_end_symbol+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6648,41 +7296,38 @@ asm ("incl _end") } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_end_symbol=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -grub_cv_check_uscore_end_symbol=no + grub_cv_check_uscore_end_symbol=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } @@ -6704,8 +7349,8 @@ echo "$as_me: error: neither end nor _end is defined" >&2;} fi -echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6748,12 +7393,12 @@ cat >>confdefs.h <<_ACEOF _ACEOF -echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } -echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_addr32+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6783,11 +7428,11 @@ rm -f conftest* fi -echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } -echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6821,11 +7466,11 @@ _ACEOF fi -echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6 +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } -echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } if test "${grub_cv_i386_check_nested_functions+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6870,13 +7515,22 @@ main (void) _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 + { (case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_try") 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then @@ -6889,13 +7543,15 @@ sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi -rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6 +fi + + +{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -6931,25 +7587,25 @@ LIBS="$tmp_LIBS" # # Memory manager debugging. -# Check whether --enable-mm-debug or --disable-mm-debug was given. +# Check whether --enable-mm-debug was given. if test "${enable_mm_debug+set}" = set; then - enableval="$enable_mm_debug" - + enableval=$enable_mm_debug; cat >>confdefs.h <<\_ACEOF #define MM_DEBUG 1 _ACEOF -fi; +fi -# Check whether --enable-grub-emu or --disable-grub-emu was given. + +# Check whether --enable-grub-emu was given. if test "${enable_grub_emu+set}" = set; then - enableval="$enable_grub_emu" + enableval=$enable_grub_emu; +fi -fi; if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6962,61 +7618,58 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -wgetch (); +return wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ncurses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_ncurses_wgetch=no + ac_cv_lib_ncurses_wgetch=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } if test $ac_cv_lib_ncurses_wgetch = yes; then LIBCURSES="-lncurses" else - echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6 + { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } if test "${ac_cv_lib_curses_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -7029,56 +7682,53 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -/* Override any gcc2 internal prototype to avoid an error. */ +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif -/* We use char because int might match the return type of a gcc2 - builtin and then its argument prototype would still apply. */ char wgetch (); int main () { -wgetch (); +return wgetch (); ; return 0; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 - (eval $ac_link) 2>conftest.er1 +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_curses_wgetch=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_cv_lib_curses_wgetch=no + ac_cv_lib_curses_wgetch=no fi -rm -f conftest.err conftest.$ac_objext \ + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6 +{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } if test $ac_cv_lib_curses_wgetch = yes; then LIBCURSES="-lcurses" else @@ -7096,18 +7746,19 @@ fi for ac_header in ncurses/curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7118,41 +7769,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7161,24 +7808,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7186,9 +7831,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7212,25 +7858,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7243,18 +7888,19 @@ else for ac_header in ncurses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7265,41 +7911,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7308,24 +7950,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7333,9 +7973,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7359,25 +8000,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7390,18 +8030,19 @@ else for ac_header in curses.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if eval "test \"\${$as_ac_Header+set}\" = set"; then - echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7412,41 +8053,37 @@ $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>conftest.er1 +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -z "$ac_c_werror_flag" - || test ! -s conftest.err' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then ac_header_compiler=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -ac_header_compiler=no + ac_header_compiler=no fi -rm -f conftest.err conftest.$ac_objext conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6 + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -7455,24 +8092,22 @@ cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include <$ac_header> _ACEOF -if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 - (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null; then - if test -s conftest.err; then - ac_cpp_err=$ac_c_preproc_warn_flag - ac_cpp_err=$ac_cpp_err$ac_c_werror_flag - else - ac_cpp_err= - fi -else - ac_cpp_err=yes -fi -if test -z "$ac_cpp_err"; then + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then ac_header_preproc=yes else echo "$as_me: failed program was:" >&5 @@ -7480,9 +8115,10 @@ sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi + rm -f conftest.err conftest.$ac_ext -echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6 +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in @@ -7506,25 +8142,24 @@ echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\ echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( - cat <<\_ASBOX + ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## ## ------------------------------- ## _ASBOX - ) | - sed "s/^/$as_me: WARNING: /" >&2 + ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 -if eval "test \"\${$as_ac_Header+set}\" = set"; then +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 -echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi if test `eval echo '${'$as_ac_Header'}'` = yes; then @@ -7551,19 +8186,19 @@ done fi -# Check whether --enable-grub-fstest or --disable-grub-fstest was given. +# Check whether --enable-grub-fstest was given. if test "${enable_grub_fstest+set}" = set; then - enableval="$enable_grub_fstest" + enableval=$enable_grub_fstest; +fi -fi; # Output files. - ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" +ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" - ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" +ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" - ac_config_files="$ac_config_files stamp-h" +ac_config_files="$ac_config_files stamp-h" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -7583,39 +8218,58 @@ _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. -# So, don't put newlines in cache variables' values. +# So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. -{ +( + for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do + eval ac_val=\$$ac_var + case $ac_val in #( + *${as_nl}*) + case $ac_var in #( + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + esac + case $ac_var in #( + _ | IFS | as_nl) ;; #( + *) $as_unset $ac_var ;; + esac ;; + esac + done + (set) 2>&1 | - case `(ac_space=' '; set | grep ac_space) 2>&1` in - *ac_space=\ *) + case $as_nl`(ac_space=' '; set) 2>&1` in #( + *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote # substitution turns \\\\ into \\, and sed turns \\ into \). sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; + ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n \ - "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" + sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; - esac; -} | + esac | + sort +) | sed ' + /^ac_cv_env_/b end t clear - : clear + :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end - /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - : end' >>confcache -if diff $cache_file confcache >/dev/null 2>&1; then :; else - if test -w $cache_file; then - test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" + s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ + :end' >>confcache +if diff "$cache_file" confcache >/dev/null 2>&1; then :; else + if test -w "$cache_file"; then + test "x$cache_file" != "x/dev/null" && + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - echo "not updating unwritable cache $cache_file" + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -7624,32 +8278,18 @@ test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/; -s/:*\${srcdir}:*/:/; -s/:*@srcdir@:*/:/; -s/^\([^=]*=[ ]*\):*/\1/; -s/:*$//; -s/^[^=]*=[ ]*$//; -}' -fi - DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. - ac_i=`echo "$ac_i" | - sed 's/\$U\././;s/\.o$//;s/\.obj$//'` - # 2. Add them. - ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' + ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' + ac_i=`echo "$ac_i" | sed "$ac_script"` + # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR + # will be set to the directory where LIBOBJS objects are built. + ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" + ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs @@ -7680,73 +8320,26 @@ cat >>$CONFIG_STATUS <<\_ACEOF ## M4sh Initialization. ## ## --------------------- ## -# Be Bourne compatible +# Be more Bourne compatible +DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' -elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then - set -o posix -fi -DUALCASE=1; export DUALCASE # for MKS sh - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset + setopt NO_GLOB_SUBST else - as_unset=false + case `(set -o) 2>/dev/null` in + *posix*) set -o posix ;; +esac + fi -# Work around bugs in pre-3.0 UWIN ksh. -$as_unset ENV MAIL MAILPATH -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1; then - as_expr=expr -else - as_expr=false -fi - -if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi -# Name of the executable. -as_me=`$as_basename "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)$' \| \ - . : '\(.\)' 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } - /^X\/\(\/\/\)$/{ s//\1/; q; } - /^X\/\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - - -# PATH needs CR, and LINENO needs CR and PATH. +# PATH needs CR # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' @@ -7767,126 +8360,198 @@ if test "${PATH_SEPARATOR+set}" != set; then rm -f conf$$.sh fi +# Support unset when possible. +if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then + as_unset=unset +else + as_unset=false +fi - as_lineno_1=$LINENO - as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" || { - # Find who we are. Look in the path if we contain no path at all - # relative or not. - case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + +# IFS +# We need space, tab and new line, in precisely that order. Quoting is +# there to prevent editors from complaining about space-tab. +# (If _AS_PATH_WALK were called with IFS unset, it would disable word +# splitting by setting IFS to empty value.) +as_nl=' +' +IFS=" "" $as_nl" + +# Find who we are. Look in the path if we contain no directory separator. +case $0 in + *[\\/]* ) as_myself=$0 ;; + *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done +IFS=$as_save_IFS - ;; - esac - # We did not find ourselves, most probably we were run as `sh COMMAND' - # in which case we are not to be found in the path. - if test "x$as_myself" = x; then - as_myself=$0 - fi - if test ! -f "$as_myself"; then - { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 -echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} - { (exit 1); exit 1; }; } - fi - case $CONFIG_SHELL in - '') - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH + ;; +esac +# We did not find ourselves, most probably we were run as `sh COMMAND' +# in which case we are not to be found in the path. +if test "x$as_myself" = x; then + as_myself=$0 +fi +if test ! -f "$as_myself"; then + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + { (exit 1); exit 1; } +fi + +# Work around bugs in pre-3.0 UWIN ksh. +for as_var in ENV MAIL MAILPATH +do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var +done +PS1='$ ' +PS2='> ' +PS4='+ ' + +# NLS nuisances. +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for as_base in sh bash ksh sh5; do - case $as_dir in - /*) - if ("$as_dir/$as_base" -c ' + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done + +# Required to use basename. +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then + as_expr=expr +else + as_expr=false +fi + +if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then + as_basename=basename +else + as_basename=false +fi + + +# Name of the executable. +as_me=`$as_basename -- "$0" || +$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X/"$0" | + sed '/^.*\/\([^/][^/]*\)\/*$/{ + s//\1/ + q + } + /^X\/\(\/\/\)$/{ + s//\1/ + q + } + /^X\/\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + +# CDPATH. +$as_unset CDPATH + + + as_lineno_1=$LINENO as_lineno_2=$LINENO - as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` test "x$as_lineno_1" != "x$as_lineno_2" && - test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then - $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } - $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } - CONFIG_SHELL=$as_dir/$as_base - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$0" ${1+"$@"} - fi;; - esac - done -done -;; - esac + test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { # Create $as_me.lineno as a copy of $as_myself, but with $LINENO # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line before each line; the second 'sed' does the real - # work. The second script uses 'N' to pair each line-number line - # with the numbered line, and appends trailing '-' during - # substitution so that $LINENO is not a special case at line end. + # line-number line after each line using $LINENO; the second 'sed' + # does the real work. The second script uses 'N' to pair each + # line-number line with the line containing $LINENO, and appends + # trailing '-' during substitution so that $LINENO is not a special + # case at line end. # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) - sed '=' <$as_myself | + # scripts with optimization help from Paolo Bonzini. Blame Lee + # E. McMahon (1931-1989) for sed's syntax. :-) + sed -n ' + p + /[$]LINENO/= + ' <$as_myself | sed ' + s/[$]LINENO.*/&-/ + t lineno + b + :lineno N - s,$,-, - : loop - s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, + :loop + s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop - s,-$,, - s,^['$as_cr_digits']*\n,, + s/-\n.*// ' >$as_me.lineno && - chmod +x $as_me.lineno || - { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 -echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} + chmod +x "$as_me.lineno" || + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensible to this). - . ./$as_me.lineno + # original and so on. Autoconf is especially sensitive to this). + . "./$as_me.lineno" # Exit status is that of the last command. exit } -case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in - *c*,-n*) ECHO_N= ECHO_C=' -' ECHO_T=' ' ;; - *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; - *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then + as_dirname=dirname +else + as_dirname=false +fi + +ECHO_C= ECHO_N= ECHO_T= +case `echo -n x` in +-n*) + case `echo 'x\c'` in + *c*) ECHO_T=' ';; # ECHO_T is single tab character. + *) ECHO_C='\c';; + esac;; +*) + ECHO_N='-n';; esac -if expr a : '\(a\)' >/dev/null 2>&1; then +if expr a : '\(a\)' >/dev/null 2>&1 && + test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi rm -f conf$$ conf$$.exe conf$$.file +if test -d conf$$.dir; then + rm -f conf$$.dir/conf$$.file +else + rm -f conf$$.dir + mkdir conf$$.dir +fi echo >conf$$.file if ln -s conf$$.file conf$$ 2>/dev/null; then - # We could just check for DJGPP; but this test a) works b) is more generic - # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). - if test -f conf$$.exe; then - # Don't use ln at all; we don't have any links + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - else - as_ln_s='ln -s' - fi elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -p' fi -rm -f conf$$ conf$$.exe conf$$.file +rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file +rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p=: @@ -7895,7 +8560,28 @@ else as_mkdir_p=false fi -as_executable_p="test -f" +if test -x / >/dev/null 2>&1; then + as_test_x='test -x' +else + if ls -dL / >/dev/null 2>&1; then + as_ls_L_option=L + else + as_ls_L_option= + fi + as_test_x=' + eval sh -c '\'' + if test -d "$1"; then + test -d "$1/."; + else + case $1 in + -*)set "./$1";; + esac; + case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in + ???[sx]*):;;*)false;;esac;fi + '\'' sh + ' +fi +as_executable_p=$as_test_x # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -7904,31 +8590,14 @@ as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" -# IFS -# We need space, tab and new line, in precisely that order. -as_nl=' -' -IFS=" $as_nl" - -# CDPATH. -$as_unset CDPATH - exec 6>&1 -# Open the log real soon, to keep \$[0] and so on meaningful, and to +# Save the log message, to keep $[0] and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. Logging --version etc. is OK. -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX -} >&5 -cat >&5 <<_CSEOF - +# values after options handling. +ac_log=" This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.59. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -7936,30 +8605,20 @@ generated by GNU Autoconf 2.59. Invocation command line was CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ -_CSEOF -echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 -echo >&5 +on `(hostname || uname -n) 2>/dev/null | sed 1q` +" + _ACEOF +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. -if test -n "$ac_config_files"; then - echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS -fi +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" -if test -n "$ac_config_headers"; then - echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_links"; then - echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS -fi - -if test -n "$ac_config_commands"; then - echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS -fi +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF - ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. @@ -7967,7 +8626,7 @@ current configuration. Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit - -V, --version print version number, then exit + -V, --version print version number and configuration settings, then exit -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions @@ -7986,19 +8645,21 @@ Configuration links: $config_links Report bugs to ." -_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.59, - with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2003 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." -srcdir=$srcdir -INSTALL="$INSTALL" + +ac_pwd='$ac_pwd' +srcdir='$srcdir' +INSTALL='$INSTALL' _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF @@ -8009,39 +8670,24 @@ while test $# != 0 do case $1 in --*=*) - ac_option=`expr "x$1" : 'x\([^=]*\)='` - ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` + ac_option=`expr "X$1" : 'X\([^=]*\)='` + ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; - -*) + *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; - *) # This is not an option, so the user has probably given explicit - # arguments. - ac_option=$1 - ac_need_defaults=false;; esac case $ac_option in # Handling of the options. -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; - --version | --vers* | -V ) - echo "$ac_cs_version"; exit 0 ;; - --he | --h) - # Conflict between --help and --header - { { echo "$as_me:$LINENO: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2;} - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit 0 ;; - --debug | --d* | -d ) + --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) + echo "$ac_cs_version"; exit ;; + --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift @@ -8051,18 +8697,24 @@ Try \`$0 --help' for more information." >&2;} $ac_shift CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; + --he | --h) + # Conflict between --help and --header + { echo "$as_me: error: ambiguous option: $1 +Try \`$0 --help' for more information." >&2 + { (exit 1); exit 1; }; };; + --help | --hel | -h ) + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&5 -echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2;} + -*) { echo "$as_me: error: unrecognized option: $1 +Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; - *) ac_config_targets="$ac_config_targets $1" ;; + *) ac_config_targets="$ac_config_targets $1" + ac_need_defaults=false ;; esac shift @@ -8078,34 +8730,48 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL + export CONFIG_SHELL + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF +exec 5>>config.log +{ + echo + sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +## Running $as_me. ## +_ASBOX + echo "$ac_log" +} >&5 - - - +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF +_ACEOF cat >>$CONFIG_STATUS <<\_ACEOF + +# Handling of arguments. for ac_config_target in $ac_config_targets do - case "$ac_config_target" in - # Handling of arguments. - "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gensymlist.sh" ) CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; - "genkernsyms.sh" ) CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; - "stamp-h" ) CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - "include/grub/cpu" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; - "include/grub/machine" ) CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; - "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + case $ac_config_target in + "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; + "include/grub/cpu") CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; + "include/grub/machine") CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; + "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; + "gensymlist.sh") CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; + "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; + "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done + # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely @@ -8117,333 +8783,398 @@ if $ac_need_defaults; then fi # Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason to put it here, and in addition, +# simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. -# Create a temporary directory, and hook for its removal unless debugging. +# Hook for its removal unless debugging. +# Note that there is a small window in which the directory will not be cleaned: +# after its creation but before its name has been assigned to `$tmp'. $debug || { - trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 + tmp= + trap 'exit_status=$? + { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status +' 0 trap '{ (exit 1); exit 1; }' 1 2 13 15 } - # Create a (secure) tmp directory for tmp files. { - tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && + tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" } || { - tmp=./confstat$$-$RANDOM - (umask 077 && mkdir $tmp) + tmp=./conf$$-$RANDOM + (umask 077 && mkdir "$tmp") } || { echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF - # -# CONFIG_FILES section. +# Set up the sed scripts for CONFIG_FILES section. # # No need to generate the scripts if there are no CONFIG_FILES. # This happens for instance when ./config.status config.h -if test -n "\$CONFIG_FILES"; then - # Protect against being on the right side of a sed subst in config.status. - sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; - s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF -s,@SHELL@,$SHELL,;t t -s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t -s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t -s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t -s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t -s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t -s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t -s,@exec_prefix@,$exec_prefix,;t t -s,@prefix@,$prefix,;t t -s,@program_transform_name@,$program_transform_name,;t t -s,@bindir@,$bindir,;t t -s,@sbindir@,$sbindir,;t t -s,@libexecdir@,$libexecdir,;t t -s,@datadir@,$datadir,;t t -s,@sysconfdir@,$sysconfdir,;t t -s,@sharedstatedir@,$sharedstatedir,;t t -s,@localstatedir@,$localstatedir,;t t -s,@libdir@,$libdir,;t t -s,@includedir@,$includedir,;t t -s,@oldincludedir@,$oldincludedir,;t t -s,@infodir@,$infodir,;t t -s,@mandir@,$mandir,;t t -s,@build_alias@,$build_alias,;t t -s,@host_alias@,$host_alias,;t t -s,@target_alias@,$target_alias,;t t -s,@DEFS@,$DEFS,;t t -s,@ECHO_C@,$ECHO_C,;t t -s,@ECHO_N@,$ECHO_N,;t t -s,@ECHO_T@,$ECHO_T,;t t -s,@LIBS@,$LIBS,;t t -s,@build@,$build,;t t -s,@build_cpu@,$build_cpu,;t t -s,@build_vendor@,$build_vendor,;t t -s,@build_os@,$build_os,;t t -s,@host@,$host,;t t -s,@host_cpu@,$host_cpu,;t t -s,@host_vendor@,$host_vendor,;t t -s,@host_os@,$host_os,;t t -s,@target@,$target,;t t -s,@target_cpu@,$target_cpu,;t t -s,@target_vendor@,$target_vendor,;t t -s,@target_os@,$target_os,;t t -s,@platform@,$platform,;t t -s,@CMP@,$CMP,;t t -s,@YACC@,$YACC,;t t -s,@UNIFONT_HEX@,$UNIFONT_HEX,;t t -s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t -s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t -s,@INSTALL_DATA@,$INSTALL_DATA,;t t -s,@AWK@,$AWK,;t t -s,@SET_MAKE@,$SET_MAKE,;t t -s,@RUBY@,$RUBY,;t t -s,@HELP2MAN@,$HELP2MAN,;t t -s,@CC@,$CC,;t t -s,@CFLAGS@,$CFLAGS,;t t -s,@LDFLAGS@,$LDFLAGS,;t t -s,@CPPFLAGS@,$CPPFLAGS,;t t -s,@ac_ct_CC@,$ac_ct_CC,;t t -s,@EXEEXT@,$EXEEXT,;t t -s,@OBJEXT@,$OBJEXT,;t t -s,@CPP@,$CPP,;t t -s,@EGREP@,$EGREP,;t t -s,@LIBLZO@,$LIBLZO,;t t -s,@TARGET_CC@,$TARGET_CC,;t t -s,@ac_ct_TARGET_CC@,$ac_ct_TARGET_CC,;t t -s,@OBJCOPY@,$OBJCOPY,;t t -s,@ac_ct_OBJCOPY@,$ac_ct_OBJCOPY,;t t -s,@STRIP@,$STRIP,;t t -s,@ac_ct_STRIP@,$ac_ct_STRIP,;t t -s,@NM@,$NM,;t t -s,@ac_ct_NM@,$ac_ct_NM,;t t -s,@TARGET_CFLAGS@,$TARGET_CFLAGS,;t t -s,@TARGET_CPPFLAGS@,$TARGET_CPPFLAGS,;t t -s,@TARGET_LDFLAGS@,$TARGET_LDFLAGS,;t t -s,@LIBCURSES@,$LIBCURSES,;t t -s,@enable_grub_emu@,$enable_grub_emu,;t t -s,@enable_grub_fstest@,$enable_grub_fstest,;t t -s,@LIBOBJS@,$LIBOBJS,;t t -s,@LTLIBOBJS@,$LTLIBOBJS,;t t -CEOF +if test -n "$CONFIG_FILES"; then _ACEOF - cat >>$CONFIG_STATUS <<\_ACEOF - # Split the substitutions into bite-sized pieces for seds with - # small command number limits, like on Digital OSF/1 and HP-UX. - ac_max_sed_lines=48 - ac_sed_frag=1 # Number of current file. - ac_beg=1 # First line for current file. - ac_end=$ac_max_sed_lines # Line after last line for current file. - ac_more_lines=: - ac_sed_cmds= - while $ac_more_lines; do - if test $ac_beg -gt 1; then - sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - else - sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag - fi - if test ! -s $tmp/subs.frag; then - ac_more_lines=false - else - # The purpose of the label and of the branching condition is to - # speed up the sed processing (if there are no `@' at all, there - # is no need to browse any of the substitutions). - # These are the two extra sed commands mentioned above. - (echo ':t - /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed - if test -z "$ac_sed_cmds"; then - ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" - else - ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" - fi - ac_sed_frag=`expr $ac_sed_frag + 1` - ac_beg=$ac_end - ac_end=`expr $ac_end + $ac_max_sed_lines` - fi - done - if test -z "$ac_sed_cmds"; then - ac_sed_cmds=cat + + +ac_delim='%!_!# ' +for ac_last_try in false false false false false :; do + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +platform!$platform$ac_delim +CMP!$CMP$ac_delim +YACC!$YACC$ac_delim +UNIFONT_HEX!$UNIFONT_HEX$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +RUBY!$RUBY$ac_delim +HELP2MAN!$HELP2MAN$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LIBLZO!$LIBLZO$ac_delim +TARGET_CC!$TARGET_CC$ac_delim +ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim +OBJCOPY!$OBJCOPY$ac_delim +STRIP!$STRIP$ac_delim +NM!$NM$ac_delim +TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim +TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim +TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim +LIBCURSES!$LIBCURSES$ac_delim +enable_grub_emu!$enable_grub_emu$ac_delim +enable_grub_fstest!$enable_grub_fstest$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF + + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then + break + elif $ac_last_try; then + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi +done + +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +_ACEOF +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +:end +s/|#_!!_#|//g +CEOF$ac_eof +_ACEOF + + +# VPATH may cause trouble with some makes, so we remove $(srcdir), +# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +# trailing colons and then remove the whole line if VPATH becomes empty +# (actually we leave an empty line to preserve line numbers). +if test "x$srcdir" = x.; then + ac_vpsub='/^[ ]*VPATH[ ]*=/{ +s/:*\$(srcdir):*/:/ +s/:*\${srcdir}:*/:/ +s/:*@srcdir@:*/:/ +s/^\([^=]*=[ ]*\):*/\1/ +s/:*$// +s/^[^=]*=[ ]*$// +}' +fi + +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; + +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS +do + case $ac_tag in + :[FHLC]) ac_mode=$ac_tag; continue;; + esac + case $ac_mode$ac_tag in + :[FHL]*:*);; + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} + { (exit 1); exit 1; }; };; + :[FH]-) ac_tag=-:-;; + :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; + esac + ac_save_IFS=$IFS + IFS=: + set x $ac_tag + IFS=$ac_save_IFS + shift + ac_file=$1 + shift + + case $ac_mode in + :L) ac_source=$1;; + :[FH]) + ac_file_inputs= + for ac_f + do + case $ac_f in + -) ac_f="$tmp/stdin";; + *) # Look for the file first in the build tree, then in the source tree + # (if the path is not absolute). The absolute path cannot be DOS-style, + # because $ac_f cannot contain `:'. + test -f "$ac_f" || + case $ac_f in + [\\/$]*) false;; + *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; + esac || + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { (exit 1); exit 1; }; };; + esac + ac_file_inputs="$ac_file_inputs $ac_f" + done + + # Let's still pretend it is `configure' which instantiates (i.e., don't + # use $as_me), people would be surprised to read: + # /* config.h. Generated by config.status. */ + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + if test x"$ac_file" != x-; then + configure_input="$ac_file. $configure_input" + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} + fi + + case $ac_tag in + *:-:* | *:-) cat >"$tmp/stdin";; + esac + ;; esac - # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. - ac_dir=`(dirname "$ac_file") 2>/dev/null || + ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + { as_dir="$ac_dir" + case $as_dir in #( + -*) as_dir=./$as_dir;; + esac + test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || + while :; do + case $as_dir in #( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *) as_qdir=$as_dir;; + esac + as_dirs="'$as_qdir' $as_dirs" + as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || + X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` + sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ + s//\1/ + q + } + /^X\(\/\/\)[^/].*/{ + s//\1/ + q + } + /^X\(\/\/\)$/{ + s//\1/ + q + } + /^X\(\/\).*/{ + s//\1/ + q + } + s/.*/./; q'` + test -d "$as_dir" && break done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} + test -z "$as_dirs" || eval "mkdir $as_dirs" + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } - ac_builddir=. -if test "$ac_dir" != .; then +case "$ac_dir" in +.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; +*) ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi + # A ".." for each directory in $ac_dir_suffix. + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + case $ac_top_builddir_sub in + "") ac_top_builddir_sub=. ac_top_build_prefix= ;; + *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; + esac ;; +esac +ac_abs_top_builddir=$ac_pwd +ac_abs_builddir=$ac_pwd$ac_dir_suffix +# for backward compatibility: +ac_top_builddir=$ac_top_build_prefix case $srcdir in - .) # No --srcdir option. We are building in place. + .) # We are building in place. ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. + ac_top_srcdir=$ac_top_builddir_sub + ac_abs_top_srcdir=$ac_pwd ;; + [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; + ac_top_srcdir=$srcdir + ac_abs_top_srcdir=$srcdir ;; + *) # Relative name. + ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix + ac_top_srcdir=$ac_top_build_prefix$srcdir + ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac +ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dir";; -*) - case "$ac_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac + case $ac_mode in + :F) + # + # CONFIG_FILE + # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_builddir$INSTALL ;; + *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac - - if test x"$ac_file" != x-; then - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - rm -f "$ac_file" - fi - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - configure_input= - else - configure_input="$ac_file. " - fi - configure_input=$configure_input"Generated from `echo $ac_file_in | - sed 's,.*/,,'` by configure." - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } _ACEOF + +cat >>$CONFIG_STATUS <<\_ACEOF +# If the template does not know about datarootdir, expand it. +# FIXME: This hack should be removed a few years after 2.60. +ac_datarootdir_hack=; ac_datarootdir_seen= + +case `sed -n '/datarootdir/ { + p + q +} +/@datadir@/p +/@docdir@/p +/@infodir@/p +/@localedir@/p +/@mandir@/p +' $ac_file_inputs` in +*datarootdir*) ac_datarootdir_seen=yes;; +*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} +_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF + ac_datarootdir_hack=' + s&@datadir@&$datadir&g + s&@docdir@&$docdir&g + s&@infodir@&$infodir&g + s&@localedir@&$localedir&g + s&@mandir@&$mandir&g + s&\\\${datarootdir}&$datarootdir&g' ;; +esac +_ACEOF + +# Neutralize VPATH when `$srcdir' = `.'. +# Shell code in configure.ac might set extrasub. +# FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF sed "$ac_vpsub $extrasub @@ -8451,394 +9182,168 @@ _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s,@configure_input@,$configure_input,;t t -s,@srcdir@,$ac_srcdir,;t t -s,@abs_srcdir@,$ac_abs_srcdir,;t t -s,@top_srcdir@,$ac_top_srcdir,;t t -s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t -s,@builddir@,$ac_builddir,;t t -s,@abs_builddir@,$ac_abs_builddir,;t t -s,@top_builddir@,$ac_top_builddir,;t t -s,@abs_top_builddir@,$ac_abs_top_builddir,;t t -s,@INSTALL@,$ac_INSTALL,;t t -" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out - rm -f $tmp/stdin - if test x"$ac_file" != x-; then - mv $tmp/out $ac_file - else - cat $tmp/out - rm -f $tmp/out - fi +s&@configure_input@&$configure_input&;t t +s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@srcdir@&$ac_srcdir&;t t +s&@abs_srcdir@&$ac_abs_srcdir&;t t +s&@top_srcdir@&$ac_top_srcdir&;t t +s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t +s&@builddir@&$ac_builddir&;t t +s&@abs_builddir@&$ac_abs_builddir&;t t +s&@abs_top_builddir@&$ac_abs_top_builddir&;t t +s&@INSTALL@&$ac_INSTALL&;t t +$ac_datarootdir_hack +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out - # Run the commands associated with the file. +test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && + { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && + { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&5 +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +which seems to be undefined. Please make sure it is defined." >&2;} + + rm -f "$tmp/stdin" case $ac_file in - stamp-h ) echo timestamp > stamp-h ;; + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; esac -done + ;; + :H) + # + # CONFIG_HEADER + # _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# -# CONFIG_HEADER section. -# - -# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where -# NAME is the cpp macro being defined and VALUE is the value it is being given. -# -# ac_d sets the value in "#define NAME VALUE" lines. -ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' -ac_dB='[ ].*$,\1#\2' +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' ac_dC=' ' -ac_dD=',;t' -# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". -ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' -ac_uB='$,\1#\2define\3' -ac_uC=' ' -ac_uD=',;t' +ac_dD=' ,' -for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue - # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". - case $ac_file in - - | *:- | *:-:* ) # input from stdin - cat >$tmp/stdin - ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` - ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; - * ) ac_file_in=$ac_file.in ;; - esac +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines - test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - - # First look for the input files in the build tree, otherwise in the - # src tree. - ac_file_inputs=`IFS=: - for f in $ac_file_in; do - case $f in - -) echo $tmp/stdin ;; - [\\/$]*) - # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - # Do quote $f, to prevent DOS paths from being IFS'd. - echo "$f";; - *) # Relative - if test -f "$f"; then - # Build tree - echo "$f" - elif test -f "$srcdir/$f"; then - # Source tree - echo "$srcdir/$f" - else - # /dev/null tree - { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 -echo "$as_me: error: cannot find input file: $f" >&2;} - { (exit 1); exit 1; }; } - fi;; - esac - done` || { (exit 1); exit 1; } - # Remove the trailing spaces. - sed 's/[ ]*$//' $ac_file_inputs >$tmp/in - -_ACEOF - -# Transform confdefs.h into two sed scripts, `conftest.defines' and -# `conftest.undefs', that substitutes the proper values into -# config.h.in to produce config.h. The first handles `#define' -# templates, and the second `#undef' templates. -# And first: Protect against being on the right side of a sed subst in -# config.status. Protect against being in an unquoted here document -# in config.status. -rm -f conftest.defines conftest.undefs -# Using a here document instead of a string reduces the quoting nightmare. -# Putting comments in sed scripts is not portable. -# -# `end' is used to avoid that the second main sed command (meant for -# 0-ary CPP macros) applies to n-ary macro definitions. -# See the Autoconf documentation for `clear'. -cat >confdef2sed.sed <<\_ACEOF -s/[\\&,]/\\&/g -s,[\\$`],\\&,g -t clear -: clear -s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp -t end -s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp -: end -_ACEOF -# If some macros were called several times there might be several times -# the same #defines, which is useless. Nevertheless, we may not want to -# sort them, since we want the *last* AC-DEFINE to be honored. -uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines -sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs -rm -f confdef2sed.sed - -# This sed command replaces #undef with comments. This is necessary, for +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for # example, in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. -cat >>conftest.undefs <<\_ACEOF -s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, -_ACEOF +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines -# Break up conftest.defines because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS -echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS -echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS -echo ' :' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.defines >/dev/null +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : do - # Write a limited-size here document to $tmp/defines.sed. - echo ' cat >$tmp/defines.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#define' lines. - echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS echo 'CEOF - sed -f $tmp/defines.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break rm -f conftest.defines mv conftest.tail conftest.defines done -rm -f conftest.defines -echo ' fi # grep' >>$CONFIG_STATUS -echo >>$CONFIG_STATUS - -# Break up conftest.undefs because some shells have a limit on the size -# of here documents, and old seds have small limits too (100 cmds). -echo ' # Handle all the #undef templates' >>$CONFIG_STATUS -rm -f conftest.tail -while grep . conftest.undefs >/dev/null -do - # Write a limited-size here document to $tmp/undefs.sed. - echo ' cat >$tmp/undefs.sed <>$CONFIG_STATUS - # Speed up: don't consider the non `#undef' - echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS - # Work around the forget-to-reset-the-flag bug. - echo 't clr' >>$CONFIG_STATUS - echo ': clr' >>$CONFIG_STATUS - sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS - echo 'CEOF - sed -f $tmp/undefs.sed $tmp/in >$tmp/out - rm -f $tmp/in - mv $tmp/out $tmp/in -' >>$CONFIG_STATUS - sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail - rm -f conftest.undefs - mv conftest.tail conftest.undefs -done -rm -f conftest.undefs +rm -f conftest.defines conftest.tail +echo "ac_result=$ac_in" >>$CONFIG_STATUS cat >>$CONFIG_STATUS <<\_ACEOF - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - if test x"$ac_file" = x-; then - echo "/* Generated by configure. */" >$tmp/config.h - else - echo "/* $ac_file. Generated by configure. */" >$tmp/config.h - fi - cat $tmp/in >>$tmp/config.h - rm -f $tmp/in if test x"$ac_file" != x-; then - if diff $ac_file $tmp/config.h >/dev/null 2>&1; then + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else - ac_dir=`(dirname "$ac_file") 2>/dev/null || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dir" - else - as_dir="$ac_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - rm -f $ac_file - mv $tmp/config.h $ac_file + mv "$tmp/config.h" $ac_file fi else - cat $tmp/config.h - rm -f $tmp/config.h + echo "/* $configure_input */" + cat "$ac_result" fi -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + rm -f "$tmp/out12" + ;; + :L) + # + # CONFIG_LINK + # -# -# CONFIG_LINKS section. -# + { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} -for ac_file in : $CONFIG_LINKS; do test "x$ac_file" = x: && continue - ac_dest=`echo "$ac_file" | sed 's,:.*,,'` - ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` - - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_dest" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_dest" >&6;} - - if test ! -r $srcdir/$ac_source; then + if test ! -r "$srcdir/$ac_source"; then { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi - rm -f $ac_dest - - # Make relative symlinks. - ac_dest_dir=`(dirname "$ac_dest") 2>/dev/null || -$as_expr X"$ac_dest" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_dest" : 'X\(//\)[^/]' \| \ - X"$ac_dest" : 'X\(//\)$' \| \ - X"$ac_dest" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$ac_dest" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - { if $as_mkdir_p; then - mkdir -p "$ac_dest_dir" - else - as_dir="$ac_dest_dir" - as_dirs= - while test ! -d "$as_dir"; do - as_dirs="$as_dir $as_dirs" - as_dir=`(dirname "$as_dir") 2>/dev/null || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| \ - . : '\(.\)' 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } - /^X\(\/\/\)[^/].*/{ s//\1/; q; } - /^X\(\/\/\)$/{ s//\1/; q; } - /^X\(\/\).*/{ s//\1/; q; } - s/.*/./; q'` - done - test ! -n "$as_dirs" || mkdir $as_dirs - fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dest_dir\"" >&5 -echo "$as_me: error: cannot create directory \"$ac_dest_dir\"" >&2;} - { (exit 1); exit 1; }; }; } - - ac_builddir=. - -if test "$ac_dest_dir" != .; then - ac_dir_suffix=/`echo "$ac_dest_dir" | sed 's,^\.[\\/],,'` - # A "../" for each directory in $ac_dir_suffix. - ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` -else - ac_dir_suffix= ac_top_builddir= -fi - -case $srcdir in - .) # No --srcdir option. We are building in place. - ac_srcdir=. - if test -z "$ac_top_builddir"; then - ac_top_srcdir=. - else - ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` - fi ;; - [\\/]* | ?:[\\/]* ) # Absolute path. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir ;; - *) # Relative path. - ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_builddir$srcdir ;; -esac - -# Do not use `cd foo && pwd` to compute absolute paths, because -# the directories may not exist. -case `pwd` in -.) ac_abs_builddir="$ac_dest_dir";; -*) - case "$ac_dest_dir" in - .) ac_abs_builddir=`pwd`;; - [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dest_dir";; - *) ac_abs_builddir=`pwd`/"$ac_dest_dir";; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_builddir=${ac_top_builddir}.;; -*) - case ${ac_top_builddir}. in - .) ac_abs_top_builddir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; - *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_srcdir=$ac_srcdir;; -*) - case $ac_srcdir in - .) ac_abs_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; - *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; - esac;; -esac -case $ac_abs_builddir in -.) ac_abs_top_srcdir=$ac_top_srcdir;; -*) - case $ac_top_srcdir in - .) ac_abs_top_srcdir=$ac_abs_builddir;; - [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; - *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; - esac;; -esac - + rm -f "$ac_file" + # Try a relative symlink, then a hard link, then a copy. case $srcdir in [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_builddir$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || + cp -p "$srcdir/$ac_source" "$ac_file" || + { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} + { (exit 1); exit 1; }; } + ;; + esac - # Try a symlink, then a hard link, then a copy. - ln -s $ac_rel_source $ac_dest 2>/dev/null || - ln $srcdir/$ac_source $ac_dest 2>/dev/null || - cp -p $srcdir/$ac_source $ac_dest || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_dest" >&2;} - { (exit 1); exit 1; }; } -done -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF + case $ac_file$ac_mode in + "stamp-h":F) echo timestamp > stamp-h ;; + + esac +done # for ac_tag + { (exit 0); exit 0; } _ACEOF diff --git a/kern/i386/linuxbios/init.c b/kern/i386/linuxbios/init.c index 2a2e2d1b0..9a8a40877 100644 --- a/kern/i386/linuxbios/init.c +++ b/kern/i386/linuxbios/init.c @@ -72,20 +72,6 @@ grub_exit (void) grub_stop (); } -void -grub_reboot (void) -{ - grub_printf ("grub_reboot() is not implemented.\n"); - grub_stop (); -} - -void -grub_halt (int no_apm __attribute__ ((unused))) -{ - grub_printf ("grub_halt() is not implemented.\n"); - grub_stop (); -} - void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) From aca6350297d3e1c09ff101b75c2b0c6d2177c276 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 16 Feb 2008 22:31:35 +0000 Subject: [PATCH 0049/1707] 2008-02-16 Robert Millan * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), do not assume partition map is PC/MSDOS before performing checks that are specific to that layout. --- ChangeLog | 6 ++++++ util/i386/pc/grub-setup.c | 20 ++++++++++++++------ 2 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a658c59c4..8e9a768cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-16 Robert Millan + + * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), + do not assume partition map is PC/MSDOS before performing checks that + are specific to that layout. + 2008-02-13 Robert Millan * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Remove diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 08404eba2..c77cd0991 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -120,13 +120,21 @@ setup (const char *prefix, const char *dir, int find_first_partition_start (grub_disk_t disk __attribute__ ((unused)), const grub_partition_t p) { - struct grub_pc_partition *pcdata = p->data; + if (! strcmp (p->partmap->name, "pc_partition_map")) + { + struct grub_pc_partition *pcdata = p->data; + + if (! grub_pc_partition_is_empty (pcdata->dos_type) + && ! grub_pc_partition_is_bsd (pcdata->dos_type) + && first_start > p->start) + first_start = p->start; + } + else + { + if (first_start > p->start) + first_start = p->start; + } - if (! grub_pc_partition_is_empty (pcdata->dos_type) - && ! grub_pc_partition_is_bsd (pcdata->dos_type) - && first_start > p->start) - first_start = p->start; - return 0; } From 32b0fc496be46e371e56128f74de23322bff08d8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 17 Feb 2008 10:32:02 +0000 Subject: [PATCH 0050/1707] 2008-02-17 Robert Millan * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), set `first_start' to 0 for non-PC/MSDOS partition maps. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 7 +++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e9a768cd..ab7f80274 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-17 Robert Millan + + * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), + set `first_start' to 0 for non-PC/MSDOS partition maps. + 2008-02-16 Robert Millan * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index c77cd0991..647d46e41 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -130,10 +130,9 @@ setup (const char *prefix, const char *dir, first_start = p->start; } else - { - if (first_start > p->start) - first_start = p->start; - } + /* In other partition maps, the region after MBR and before first + partition is not reserved (on GPT, it contains the primary header). */ + first_start = 0; return 0; } From b7202015a71e56d67dcdc1943d8d630648203f65 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 17 Feb 2008 13:52:18 +0000 Subject: [PATCH 0051/1707] 2008-02-17 Christian Franke * commands/cat.c (grub_cmd_cat): Add break on GRUB_TERM_ESC key. --- ChangeLog | 4 ++++ commands/cat.c | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index ab7f80274..b4ab4164c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-02-17 Christian Franke + + * commands/cat.c (grub_cmd_cat): Add break on GRUB_TERM_ESC key. + 2008-02-17 Robert Millan * util/i386/pc/grub-setup.c (setup): In find_first_partition_start(), diff --git a/commands/cat.c b/commands/cat.c index 834fd063b..3a0d1f8fb 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -59,6 +59,12 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); } } + + if (GRUB_TERM_ASCII_CHAR (grub_checkkey ()) == GRUB_TERM_ESC) + { + grub_getkey (); + break; + } } grub_putchar ('\n'); From 66cb40f6c18d64b230bef7bef0071fb3cf2bfbaf Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 19 Feb 2008 07:33:41 +0000 Subject: [PATCH 0052/1707] 2008-02-19 Robert Millan * DISTLIST: Replace `commands/ieee1275/halt.c' and `commands/ieee1275/reboot.c' with `commands/halt.c' and `commands/reboot.c'. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES, reboot_mod_SOURCES) (halt_mod_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES, reboot_mod_SOURCES) (halt_mod_SOURCES): Likewise. --- ChangeLog | 10 +++++ DISTLIST | 4 +- conf/powerpc-ieee1275.mk | 82 +++++++++++++++++++-------------------- conf/powerpc-ieee1275.rmk | 6 +-- conf/sparc64-ieee1275.mk | 62 ++++++++++++++--------------- conf/sparc64-ieee1275.rmk | 6 +-- 6 files changed, 90 insertions(+), 80 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4ab4164c..cf0919780 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-02-19 Robert Millan + + * DISTLIST: Replace `commands/ieee1275/halt.c' and + `commands/ieee1275/reboot.c' with `commands/halt.c' and + `commands/reboot.c'. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES, reboot_mod_SOURCES) + (halt_mod_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES, reboot_mod_SOURCES) + (halt_mod_SOURCES): Likewise. + 2008-02-17 Christian Franke * commands/cat.c (grub_cmd_cat): Add break on GRUB_TERM_ESC key. diff --git a/DISTLIST b/DISTLIST index 8ed5c9e94..398bb172d 100644 --- a/DISTLIST +++ b/DISTLIST @@ -40,11 +40,13 @@ commands/cat.c commands/cmp.c commands/configfile.c commands/echo.c +commands/halt.c commands/help.c commands/hexdump.c commands/ls.c commands/lspci.c commands/read.c +commands/reboot.c commands/search.c commands/sleep.c commands/terminal.c @@ -56,8 +58,6 @@ commands/i386/pc/play.c commands/i386/pc/reboot.c commands/i386/pc/vbeinfo.c commands/i386/pc/vbetest.c -commands/ieee1275/halt.c -commands/ieee1275/reboot.c commands/ieee1275/suspend.c conf/common.mk conf/common.rmk diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index cdfb8729e..e4459133c 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -85,7 +85,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ - commands/ieee1275/halt.c commands/ieee1275/reboot.c \ + commands/halt.c commands/reboot.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ @@ -111,11 +111,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_ieee1275_halt.d grub_emu-commands_ieee1275_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_ieee1275_halt.o grub_emu-commands_ieee1275_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -161,13 +161,13 @@ grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_hexdump.d -grub_emu-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) - $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ieee1275_halt.d +grub_emu-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_halt.d -grub_emu-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) - $(CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ieee1275_reboot.d +grub_emu-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_reboot.d grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -996,13 +996,13 @@ suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod -reboot_mod_SOURCES = commands/ieee1275/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_ieee1275_reboot.o und-reboot.lst +reboot_mod_SOURCES = commands/reboot.c +CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst ifneq ($(reboot_mod_EXPORTS),no) CLEANFILES += def-reboot.lst DEFSYMFILES += def-reboot.lst endif -MOSTLYCLEANFILES += reboot_mod-commands_ieee1275_reboot.d +MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o @@ -1010,9 +1010,9 @@ reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_ieee1275_reboot.o +pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_ieee1275_reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< @@ -1029,32 +1029,32 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_ieee1275_reboot.d +reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst fs-reboot_mod-commands_ieee1275_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst -FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +COMMANDFILES += cmd-reboot_mod-commands_reboot.lst +FSFILES += fs-reboot_mod-commands_reboot.lst -cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) +cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For halt.mod -halt_mod_SOURCES = commands/ieee1275/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_ieee1275_halt.o und-halt.lst +halt_mod_SOURCES = commands/halt.c +CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst ifneq ($(halt_mod_EXPORTS),no) CLEANFILES += def-halt.lst DEFSYMFILES += def-halt.lst endif -MOSTLYCLEANFILES += halt_mod-commands_ieee1275_halt.d +MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o @@ -1062,9 +1062,9 @@ halt.mod: pre-halt.o mod-halt.o $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_ieee1275_halt.o +pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_ieee1275_halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< @@ -1081,19 +1081,19 @@ und-halt.lst: pre-halt.o echo 'halt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_ieee1275_halt.d +halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< +-include halt_mod-commands_halt.d -CLEANFILES += cmd-halt_mod-commands_ieee1275_halt.lst fs-halt_mod-commands_ieee1275_halt.lst -COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst -FSFILES += fs-halt_mod-commands_ieee1275_halt.lst +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +COMMANDFILES += cmd-halt_mod-commands_halt.lst +FSFILES += fs-halt_mod-commands_halt.lst -cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) +cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) -fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index c6d93f0ee..f631c34a3 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -49,7 +49,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ - commands/ieee1275/halt.c commands/ieee1275/reboot.c \ + commands/halt.c commands/reboot.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ @@ -138,12 +138,12 @@ suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod -reboot_mod_SOURCES = commands/ieee1275/reboot.c +reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For halt.mod -halt_mod_SOURCES = commands/ieee1275/halt.c +halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 430260ab0..5198cb730 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -47,7 +47,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # commands/configfile.c commands/default.c commands/help.c \ # commands/search.c commands/terminal.c commands/ls.c \ # commands/timeout.c commands/test.c \ -# commands/ieee1275/halt.c commands/ieee1275/reboot.c \ +# commands/halt.c commands/reboot.c \ # disk/loopback.c \ # fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ # fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ @@ -1703,13 +1703,13 @@ suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod -reboot_mod_SOURCES = commands/ieee1275/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_ieee1275_reboot.o und-reboot.lst +reboot_mod_SOURCES = commands/reboot.c +CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst ifneq ($(reboot_mod_EXPORTS),no) CLEANFILES += def-reboot.lst DEFSYMFILES += def-reboot.lst endif -MOSTLYCLEANFILES += reboot_mod-commands_ieee1275_reboot.d +MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o @@ -1717,9 +1717,9 @@ reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_ieee1275_reboot.o +pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_ieee1275_reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< @@ -1736,32 +1736,32 @@ und-reboot.lst: pre-reboot.o echo 'reboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -reboot_mod-commands_ieee1275_reboot.o: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_ieee1275_reboot.d +reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst fs-reboot_mod-commands_ieee1275_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_ieee1275_reboot.lst -FSFILES += fs-reboot_mod-commands_ieee1275_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +COMMANDFILES += cmd-reboot_mod-commands_reboot.lst +FSFILES += fs-reboot_mod-commands_reboot.lst -cmd-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) +cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) -fs-reboot_mod-commands_ieee1275_reboot.lst: commands/ieee1275/reboot.c $(commands/ieee1275/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For halt.mod -halt_mod_SOURCES = commands/ieee1275/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_ieee1275_halt.o und-halt.lst +halt_mod_SOURCES = commands/halt.c +CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst ifneq ($(halt_mod_EXPORTS),no) CLEANFILES += def-halt.lst DEFSYMFILES += def-halt.lst endif -MOSTLYCLEANFILES += halt_mod-commands_ieee1275_halt.d +MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o @@ -1769,9 +1769,9 @@ halt.mod: pre-halt.o mod-halt.o $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_ieee1275_halt.o +pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_ieee1275_halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< @@ -1788,19 +1788,19 @@ und-halt.lst: pre-halt.o echo 'halt' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -halt_mod-commands_ieee1275_halt.o: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_ieee1275_halt.d +halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< +-include halt_mod-commands_halt.d -CLEANFILES += cmd-halt_mod-commands_ieee1275_halt.lst fs-halt_mod-commands_ieee1275_halt.lst -COMMANDFILES += cmd-halt_mod-commands_ieee1275_halt.lst -FSFILES += fs-halt_mod-commands_ieee1275_halt.lst +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +COMMANDFILES += cmd-halt_mod-commands_halt.lst +FSFILES += fs-halt_mod-commands_halt.lst -cmd-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) +cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) -fs-halt_mod-commands_ieee1275_halt.lst: commands/ieee1275/halt.c $(commands/ieee1275/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 58ae9b4a8..1c4d2e864 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -47,7 +47,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # commands/configfile.c commands/default.c commands/help.c \ # commands/search.c commands/terminal.c commands/ls.c \ # commands/timeout.c commands/test.c \ -# commands/ieee1275/halt.c commands/ieee1275/reboot.c \ +# commands/halt.c commands/reboot.c \ # disk/loopback.c \ # fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ # fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ @@ -235,12 +235,12 @@ suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) # For reboot.mod -reboot_mod_SOURCES = commands/ieee1275/reboot.c +reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For halt.mod -halt_mod_SOURCES = commands/ieee1275/halt.c +halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) From b93bdb0f6dbbd03c68fe80f0caebb1a4ed057177 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 19 Feb 2008 14:00:11 +0000 Subject: [PATCH 0053/1707] 2008-02-19 Robert Millan * partmap/gpt.c: Include `'. (grub_gpt_partition_type_empty): Redefine with macro from `'. (gpt_partition_map_iterate): Adjust partition type comparison. Export `entry' as partmap-specific `part.data' struct. (grub_gpt_header, grub_gpt_partentry): Move from here ... * include/grub/gpt_partition.h (grub_gpt_header) (grub_gpt_partentry): ... to here (new file). * util/i386/pc/grub-setup.c: Include `'. (grub_gpt_partition_type_bios_boot): New const variable, defined with macro from `'. (setup): Replace `first_start' with `embed_region', which keeps track of the embed region (and is partmap-agnostic). Replace find_first_partition_start() with find_usable_region(), which finds a usable region for embedding using partmap-specific knowledge (supports PC/MSDOS and GPT). Fix all assumptions that the embed region start at sector 1, using `embed_region.start' from now on. Similarly, use `embed_region.end' rather than `first_start' to calculate available size. In grub_util_info() message, replace "into after the MBR" with an indication of the specific sector our embed region starts at. --- ChangeLog | 32 +++++++++++++++++++++++ partmap/gpt.c | 36 ++++---------------------- util/i386/pc/grub-setup.c | 54 +++++++++++++++++++++++++-------------- 3 files changed, 72 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf0919780..5374621d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +2008-02-19 Robert Millan + + * partmap/gpt.c: Include `'. + (grub_gpt_partition_type_empty): Redefine with macro from + `'. + (gpt_partition_map_iterate): Adjust partition type comparison. + + Export `entry' as partmap-specific `part.data' struct. + (grub_gpt_header, grub_gpt_partentry): Move from here ... + + * include/grub/gpt_partition.h (grub_gpt_header) + (grub_gpt_partentry): ... to here (new file). + + * util/i386/pc/grub-setup.c: Include `'. + + (grub_gpt_partition_type_bios_boot): New const variable, defined + with macro from `'. + + (setup): Replace `first_start' with `embed_region', which keeps + track of the embed region (and is partmap-agnostic). + + Replace find_first_partition_start() with find_usable_region(), + which finds a usable region for embedding using partmap-specific + knowledge (supports PC/MSDOS and GPT). + + Fix all assumptions that the embed region start at sector 1, using + `embed_region.start' from now on. Similarly, use `embed_region.end' + rather than `first_start' to calculate available size. + + In grub_util_info() message, replace "into after the MBR" with an + indication of the specific sector our embed region starts at. + 2008-02-19 Robert Millan * DISTLIST: Replace `commands/ieee1275/halt.c' and diff --git a/partmap/gpt.c b/partmap/gpt.c index 0f38c7762..6bc87551d 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -1,7 +1,7 @@ /* gpt.c - Read GUID Partition Tables (GPT). */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,41 +23,14 @@ #include #include #include - -struct grub_gpt_header -{ - grub_uint8_t magic[8]; - grub_uint32_t version; - grub_uint32_t headersize; - grub_uint32_t crc32; - grub_uint32_t unused1; - grub_uint64_t primary; - grub_uint64_t backup; - grub_uint64_t start; - grub_uint64_t end; - grub_uint8_t guid[16]; - grub_uint64_t partitions; - grub_uint32_t maxpart; - grub_uint32_t partentry_size; - grub_uint32_t partentry_crc32; -} __attribute__ ((packed)); - -struct grub_gpt_partentry -{ - grub_uint8_t type[16]; - grub_uint8_t guid[16]; - grub_uint64_t start; - grub_uint64_t end; - grub_uint8_t attrib; - char name[72]; -} __attribute__ ((packed)); +#include static grub_uint8_t grub_gpt_magic[8] = { 45, 46, 49, 20, 50, 41, 52, 54 }; -static grub_uint8_t grub_gpt_partition_type_empty[16] = { 0 }; +static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; static struct grub_partition_map grub_gpt_partition_map; @@ -114,7 +87,7 @@ gpt_partition_map_iterate (grub_disk_t disk, sizeof (entry), (char *) &entry)) return grub_errno; - if (grub_memcmp (grub_gpt_partition_type_empty, entry.type, + if (grub_memcmp (&grub_gpt_partition_type_empty, &entry.type, sizeof (grub_gpt_partition_type_empty))) { /* Calculate the first block and the size of the partition. */ @@ -124,6 +97,7 @@ gpt_partition_map_iterate (grub_disk_t disk, part.offset = entries; part.index = partno; part.partmap = &grub_gpt_partition_map; + part.data = &entry; grub_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n", partno, part.start, part.len); diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 647d46e41..8fbe3e710 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -1,7 +1,7 @@ /* grub-setup.c - make GRUB usable */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include @@ -34,6 +35,8 @@ #include #include +static const grub_gpt_part_type_t grub_gpt_partition_type_bios_boot = GRUB_GPT_PARTITION_TYPE_BIOS_BOOT; + #include #include @@ -106,7 +109,8 @@ setup (const char *prefix, const char *dir, grub_uint16_t last_length = GRUB_DISK_SECTOR_SIZE; grub_file_t file; FILE *fp; - unsigned long first_start = ~0UL; + struct { grub_uint64_t start; grub_uint64_t end; } embed_region; + embed_region.start = embed_region.end = ~0UL; int able_to_embed = 1; auto void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset, @@ -114,25 +118,37 @@ setup (const char *prefix, const char *dir, auto void NESTED_FUNC_ATTR save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length); - auto int find_first_partition_start (grub_disk_t disk, - const grub_partition_t p); - - int find_first_partition_start (grub_disk_t disk __attribute__ ((unused)), - const grub_partition_t p) + auto int find_usable_region (grub_disk_t disk, + const grub_partition_t p); + int find_usable_region (grub_disk_t disk __attribute__ ((unused)), + const grub_partition_t p) { if (! strcmp (p->partmap->name, "pc_partition_map")) { struct grub_pc_partition *pcdata = p->data; + /* There's always an embed region, and it starts right after the MBR. */ + embed_region.start = 1; + + /* For its end offset, include as many dummy partitions as we can. */ if (! grub_pc_partition_is_empty (pcdata->dos_type) && ! grub_pc_partition_is_bsd (pcdata->dos_type) - && first_start > p->start) - first_start = p->start; + && embed_region.end > p->start) + embed_region.end = p->start; } else - /* In other partition maps, the region after MBR and before first - partition is not reserved (on GPT, it contains the primary header). */ - first_start = 0; + { + struct grub_gpt_partentry *gptdata = p->data; + + /* If there's an embed region, it is in a dedicated partition. */ + if (! memcmp (&gptdata->type, &grub_gpt_partition_type_bios_boot, 16)) + { + embed_region.start = p->start; + embed_region.end = p->start + p->len; + + return 1; + } + } return 0; } @@ -262,15 +278,15 @@ setup (const char *prefix, const char *dir, try to embed the core image into after the MBR. */ if (dest_dev->disk->has_partitions && ! dest_dev->disk->partition) { - grub_partition_iterate (dest_dev->disk, find_first_partition_start); + grub_partition_iterate (dest_dev->disk, find_usable_region); /* If there is enough space... */ - if ((unsigned long) core_sectors + 1 <= first_start) + if ((unsigned long) core_sectors <= embed_region.end - embed_region.start) { - grub_util_info ("will embed the core image into after the MBR"); - + grub_util_info ("will embed the core image at sector 0x%llx", embed_region.start); + /* The first blocklist contains the whole sectors. */ - first_block->start = grub_cpu_to_le64 (2); + first_block->start = grub_cpu_to_le64 (embed_region.start + 1); first_block->len = grub_cpu_to_le16 (core_sectors - 1); first_block->segment = grub_cpu_to_le16 (GRUB_BOOT_MACHINE_KERNEL_SEG @@ -316,13 +332,13 @@ setup (const char *prefix, const char *dir, strcpy (install_prefix, prefix); /* Write the core image onto the disk. */ - if (grub_disk_write (dest_dev->disk, 1, 0, core_size, core_img)) + if (grub_disk_write (dest_dev->disk, embed_region.start, 0, core_size, core_img)) grub_util_error ("%s", grub_errmsg); /* The boot image and the core image are on the same drive, so there is no need to specify the boot drive explicitly. */ *boot_drive = 0xff; - *kernel_sector = grub_cpu_to_le64 (1); + *kernel_sector = grub_cpu_to_le64 (embed_region.start); /* If the root device is different from the destination device, it is necessary to embed the root drive explicitly. */ From 865bede901c917ad23df4d6d696e5237110d29b8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 19 Feb 2008 14:16:29 +0000 Subject: [PATCH 0054/1707] forgot "cvs add" ... --- DISTLIST | 1 + include/grub/gpt_partition.h | 71 ++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) create mode 100644 include/grub/gpt_partition.h diff --git a/DISTLIST b/DISTLIST index 398bb172d..b6a723213 100644 --- a/DISTLIST +++ b/DISTLIST @@ -116,6 +116,7 @@ include/grub/file.h include/grub/font.h include/grub/fs.h include/grub/fshelp.h +include/grub/gpt_partition.h include/grub/gzio.h include/grub/hexdump.h include/grub/hfs.h diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h new file mode 100644 index 000000000..0244530f7 --- /dev/null +++ b/include/grub/gpt_partition.h @@ -0,0 +1,71 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_GPT_PARTITION_HEADER +#define GRUB_GPT_PARTITION_HEADER 1 + +#include + +struct grub_gpt_part_type +{ + grub_uint32_t data1; + grub_uint16_t data2; + grub_uint16_t data3; + grub_uint8_t data4[8]; +} __attribute__ ((aligned(8))); +typedef struct grub_gpt_part_type grub_gpt_part_type_t; + +#define GRUB_GPT_PARTITION_TYPE_EMPTY \ + { 0x0, 0x0, 0x0, \ + { 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0 } \ + } + +#define GRUB_GPT_PARTITION_TYPE_BIOS_BOOT \ + { grub_cpu_to_le32 (0x21686148), grub_cpu_to_le16 (0x6449), grub_cpu_to_le16 (0x6e6f), \ + { 0x74, 0x4e, 0x65, 0x65, 0x64, 0x45, 0x46, 0x49 } \ + } + +struct grub_gpt_header +{ + grub_uint8_t magic[8]; + grub_uint32_t version; + grub_uint32_t headersize; + grub_uint32_t crc32; + grub_uint32_t unused1; + grub_uint64_t primary; + grub_uint64_t backup; + grub_uint64_t start; + grub_uint64_t end; + grub_uint8_t guid[16]; + grub_uint64_t partitions; + grub_uint32_t maxpart; + grub_uint32_t partentry_size; + grub_uint32_t partentry_crc32; +} __attribute__ ((packed)); + +struct grub_gpt_partentry +{ + grub_gpt_part_type_t type; + grub_uint8_t guid[16]; + grub_uint64_t start; + grub_uint64_t end; + grub_uint8_t attrib; + char name[72]; +} __attribute__ ((packed)); + +#endif /* ! GRUB_GPT_PARTITION_HEADER */ From d38e24c285812b94ca317f856902750fcde5b524 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 19 Feb 2008 16:40:45 +0000 Subject: [PATCH 0055/1707] 2008-02-19 Bean * conf/i386-pc.rmk (pkglib_MODULES): Add aout.mod _bsd.mod and bsd.mod. (aout_mod_SOURCES): New variable. (aout_mod_CFLAGS): Likewise. (aout_mod_LDFLAGS): Likewise. (_bsd_mod_SOURCES): New variable. (_bsd_mod_CFLAGS): Likewise. (_bsd_mod_LDFLAGS): Likewise. (bsd_mod_SOURCES): New variable. (bsd_mod_CFLAGS): Likewise. (bsd_mod_LDFLAGS): Likewise. * include/grub/aout.h: New file. * include/grub/i386/loader.h (grub_unix_real_boot): New function. * include/grub/i386/bsd.h: New file. * include/grub/i386/pc/init.h (grub_get_mmap_entry): Use EXPORT_FUNC to make it public. * kern/elf.c (grub_elf32_load): Get the physical address after the hook function is called, so that it's possible to change it inside the hook. (grub_elf64_load): Likewise. (grub_elf_file): Don't close the file if elf header is not found. (grub_elf_close): Close the file if grub_elf_file fails (The new grub_elf_file won't close it). (grub_elf32_size): Use NESTED_FUNC_ATTR for nested function calcsize. (grub_elf64_size): Likewise. * kern/i386/loader.S (grub_unix_real_boot): New function. * loader/aout.c: New file. * loader/i386/bsd.c: New file. * loader/i386/bsd_normal.c: New file. * loader/i386/pc/multiboot.c (grub_multiboot): Handle a.out format. * loader/multiboot2.c (grub_multiboot2): Reset grub_errno so that it can test othe formats. --- ChangeLog | 44 ++ conf/i386-pc.mk | 159 +++++++- conf/i386-pc.rmk | 18 +- include/grub/aout.h | 91 +++++ include/grub/i386/bsd.h | 232 +++++++++++ include/grub/i386/loader.h | 7 +- include/grub/i386/pc/init.h | 2 +- kern/elf.c | 24 +- kern/i386/loader.S | 38 +- loader/aout.c | 61 +++ loader/i386/bsd.c | 771 ++++++++++++++++++++++++++++++++++++ loader/i386/bsd_normal.c | 101 +++++ loader/i386/pc/multiboot.c | 72 ++-- loader/multiboot2.c | 1 + 14 files changed, 1571 insertions(+), 50 deletions(-) create mode 100644 include/grub/aout.h create mode 100644 include/grub/i386/bsd.h create mode 100644 loader/aout.c create mode 100644 loader/i386/bsd.c create mode 100644 loader/i386/bsd_normal.c diff --git a/ChangeLog b/ChangeLog index 5374621d4..633e7ce37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,47 @@ +2008-02-19 Bean + + * conf/i386-pc.rmk (pkglib_MODULES): Add aout.mod _bsd.mod and bsd.mod. + (aout_mod_SOURCES): New variable. + (aout_mod_CFLAGS): Likewise. + (aout_mod_LDFLAGS): Likewise. + (_bsd_mod_SOURCES): New variable. + (_bsd_mod_CFLAGS): Likewise. + (_bsd_mod_LDFLAGS): Likewise. + (bsd_mod_SOURCES): New variable. + (bsd_mod_CFLAGS): Likewise. + (bsd_mod_LDFLAGS): Likewise. + + * include/grub/aout.h: New file. + + * include/grub/i386/loader.h (grub_unix_real_boot): New function. + + * include/grub/i386/bsd.h: New file. + + * include/grub/i386/pc/init.h (grub_get_mmap_entry): Use EXPORT_FUNC + to make it public. + + * kern/elf.c (grub_elf32_load): Get the physical address after the hook + function is called, so that it's possible to change it inside the hook. + (grub_elf64_load): Likewise. + (grub_elf_file): Don't close the file if elf header is not found. + (grub_elf_close): Close the file if grub_elf_file fails (The new + grub_elf_file won't close it). + (grub_elf32_size): Use NESTED_FUNC_ATTR for nested function calcsize. + (grub_elf64_size): Likewise. + + * kern/i386/loader.S (grub_unix_real_boot): New function. + + * loader/aout.c: New file. + + * loader/i386/bsd.c: New file. + + * loader/i386/bsd_normal.c: New file. + + * loader/i386/pc/multiboot.c (grub_multiboot): Handle a.out format. + + * loader/multiboot2.c (grub_multiboot2): Reset grub_errno so that it + can test othe formats. + 2008-02-19 Robert Millan * partmap/gpt.c: Include `'. diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index d908095d1..cec315446 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -826,7 +826,8 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod + ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ + aout.mod _bsd.mod bsd.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -2594,4 +2595,160 @@ fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIE lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For aout.mod +aout_mod_SOURCES = loader/aout.c +CLEANFILES += aout.mod mod-aout.o mod-aout.c pre-aout.o aout_mod-loader_aout.o und-aout.lst +ifneq ($(aout_mod_EXPORTS),no) +CLEANFILES += def-aout.lst +DEFSYMFILES += def-aout.lst +endif +MOSTLYCLEANFILES += aout_mod-loader_aout.d +UNDSYMFILES += und-aout.lst + +aout.mod: pre-aout.o mod-aout.o + -rm -f $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o + -rm -f $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ aout_mod-loader_aout.o + +mod-aout.o: mod-aout.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< + +mod-aout.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(aout_mod_EXPORTS),no) +def-aout.lst: pre-aout.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 aout/' > $@ +endif + +und-aout.lst: pre-aout.o + echo 'aout' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< +-include aout_mod-loader_aout.d + +CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst +COMMANDFILES += cmd-aout_mod-loader_aout.lst +FSFILES += fs-aout_mod-loader_aout.lst + +cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) + +fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) + + +aout_mod_CFLAGS = $(COMMON_CFLAGS) +aout_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For _bsd.mod +_bsd_mod_SOURCES = loader/i386/bsd.c +CLEANFILES += _bsd.mod mod-_bsd.o mod-_bsd.c pre-_bsd.o _bsd_mod-loader_i386_bsd.o und-_bsd.lst +ifneq ($(_bsd_mod_EXPORTS),no) +CLEANFILES += def-_bsd.lst +DEFSYMFILES += def-_bsd.lst +endif +MOSTLYCLEANFILES += _bsd_mod-loader_i386_bsd.d +UNDSYMFILES += und-_bsd.lst + +_bsd.mod: pre-_bsd.o mod-_bsd.o + -rm -f $@ + $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-_bsd.o: $(_bsd_mod_DEPENDENCIES) _bsd_mod-loader_i386_bsd.o + -rm -f $@ + $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _bsd_mod-loader_i386_bsd.o + +mod-_bsd.o: mod-_bsd.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -c -o $@ $< + +mod-_bsd.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh '_bsd' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(_bsd_mod_EXPORTS),no) +def-_bsd.lst: pre-_bsd.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _bsd/' > $@ +endif + +und-_bsd.lst: pre-_bsd.o + echo '_bsd' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +_bsd_mod-loader_i386_bsd.o: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -MD -c -o $@ $< +-include _bsd_mod-loader_i386_bsd.d + +CLEANFILES += cmd-_bsd_mod-loader_i386_bsd.lst fs-_bsd_mod-loader_i386_bsd.lst +COMMANDFILES += cmd-_bsd_mod-loader_i386_bsd.lst +FSFILES += fs-_bsd_mod-loader_i386_bsd.lst + +cmd-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _bsd > $@ || (rm -f $@; exit 1) + +fs-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _bsd > $@ || (rm -f $@; exit 1) + + +_bsd_mod_CFLAGS = $(COMMON_CFLAGS) +_bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For bsd.mod +bsd_mod_SOURCES = loader/i386/bsd_normal.c +CLEANFILES += bsd.mod mod-bsd.o mod-bsd.c pre-bsd.o bsd_mod-loader_i386_bsd_normal.o und-bsd.lst +ifneq ($(bsd_mod_EXPORTS),no) +CLEANFILES += def-bsd.lst +DEFSYMFILES += def-bsd.lst +endif +MOSTLYCLEANFILES += bsd_mod-loader_i386_bsd_normal.d +UNDSYMFILES += und-bsd.lst + +bsd.mod: pre-bsd.o mod-bsd.o + -rm -f $@ + $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-bsd.o: $(bsd_mod_DEPENDENCIES) bsd_mod-loader_i386_bsd_normal.o + -rm -f $@ + $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bsd_mod-loader_i386_bsd_normal.o + +mod-bsd.o: mod-bsd.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -c -o $@ $< + +mod-bsd.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'bsd' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(bsd_mod_EXPORTS),no) +def-bsd.lst: pre-bsd.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 bsd/' > $@ +endif + +und-bsd.lst: pre-bsd.o + echo 'bsd' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +bsd_mod-loader_i386_bsd_normal.o: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -MD -c -o $@ $< +-include bsd_mod-loader_i386_bsd_normal.d + +CLEANFILES += cmd-bsd_mod-loader_i386_bsd_normal.lst fs-bsd_mod-loader_i386_bsd_normal.lst +COMMANDFILES += cmd-bsd_mod-loader_i386_bsd_normal.lst +FSFILES += fs-bsd_mod-loader_i386_bsd_normal.lst + +cmd-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bsd > $@ || (rm -f $@; exit 1) + +fs-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bsd > $@ || (rm -f $@; exit 1) + + +bsd_mod_CFLAGS = $(COMMON_CFLAGS) +bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index a03f721d6..1a0e54b9d 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -152,7 +152,8 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod + ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ + aout.mod _bsd.mod bsd.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -304,4 +305,19 @@ lspci_mod_SOURCES = commands/lspci.c lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For aout.mod +aout_mod_SOURCES = loader/aout.c +aout_mod_CFLAGS = $(COMMON_CFLAGS) +aout_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For _bsd.mod +_bsd_mod_SOURCES = loader/i386/bsd.c +_bsd_mod_CFLAGS = $(COMMON_CFLAGS) +_bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For bsd.mod +bsd_mod_SOURCES = loader/i386/bsd_normal.c +bsd_mod_CFLAGS = $(COMMON_CFLAGS) +bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/include/grub/aout.h b/include/grub/aout.h new file mode 100644 index 000000000..3243b82ff --- /dev/null +++ b/include/grub/aout.h @@ -0,0 +1,91 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_AOUT_HEADER +#define GRUB_AOUT_HEADER 1 + +#include + +struct grub_aout32_header +{ + grub_uint32_t a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ + grub_uint32_t a_text; /* text segment size */ + grub_uint32_t a_data; /* initialized data size */ + grub_uint32_t a_bss; /* uninitialized data size */ + grub_uint32_t a_syms; /* symbol table size */ + grub_uint32_t a_entry; /* entry point */ + grub_uint32_t a_trsize; /* text relocation size */ + grub_uint32_t a_drsize; /* data relocation size */ +}; + +struct grub_aout64_header +{ + grub_uint32_t a_midmag; /* htonl(flags<<26 | mid<<16 | magic) */ + grub_uint64_t a_text; /* text segment size */ + grub_uint64_t a_data; /* initialized data size */ + grub_uint64_t a_bss; /* uninitialized data size */ + grub_uint64_t a_syms; /* symbol table size */ + grub_uint64_t a_entry; /* entry point */ + grub_uint64_t a_trsize; /* text relocation size */ + grub_uint64_t a_drsize; /* data relocation size */ +}; + +union grub_aout_header +{ + struct grub_aout32_header aout32; + struct grub_aout64_header aout64; +}; + +#define AOUT_TYPE_NONE 0 +#define AOUT_TYPE_AOUT32 1 +#define AOUT_TYPE_AOUT64 6 + +#define AOUT32_OMAGIC 0x107 /* 0407 old impure format */ +#define AOUT32_NMAGIC 0x108 /* 0410 read-only text */ +#define AOUT32_ZMAGIC 0x10b /* 0413 demand load format */ +#define AOUT32_QMAGIC 0xcc /* 0314 "compact" demand load format */ + +#define AOUT64_OMAGIC 0x1001 +#define AOUT64_ZMAGIC 0x1002 +#define AOUT64_NMAGIC 0x1003 + +#define AOUT_MID_ZERO 0 /* unknown - implementation dependent */ +#define AOUT_MID_SUN010 1 /* sun 68010/68020 binary */ +#define AOUT_MID_SUN020 2 /* sun 68020-only binary */ +#define AOUT_MID_I386 134 /* i386 BSD binary */ +#define AOUT_MID_SPARC 138 /* sparc */ +#define AOUT_MID_HP200 200 /* hp200 (68010) BSD binary */ +#define AOUT_MID_HP300 300 /* hp300 (68020+68881) BSD binary */ +#define AOUT_MID_HPUX 0x20C /* hp200/300 HP-UX binary */ +#define AOUT_MID_HPUX800 0x20B /* hp800 HP-UX binary */ + +#define AOUT_FLAG_PIC 0x10 /* contains position independant code */ +#define AOUT_FLAG_DYNAMIC 0x20 /* contains run-time link-edit info */ +#define AOUT_FLAG_DPMASK 0x30 /* mask for the above */ + +#define AOUT_GETMAGIC(header) ((header).a_midmag & 0xffff) +#define AOUT_GETMID(header) ((header).a_midmag >> 16) & 0x03ff) +#define AOUT_GETFLAG(header) ((header).a_midmag >> 26) & 0x3f) + +int EXPORT_FUNC(grub_aout_get_type) (union grub_aout_header *header); + +grub_err_t EXPORT_FUNC(grub_aout_load) (grub_file_t file, int offset, + grub_addr_t load_addr, int load_size, + grub_addr_t bss_end_addr); + +#endif /* ! GRUB_AOUT_HEADER */ diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h new file mode 100644 index 000000000..f88c69478 --- /dev/null +++ b/include/grub/i386/bsd.h @@ -0,0 +1,232 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_BSD_CPU_HEADER +#define GRUB_BSD_CPU_HEADER 1 + +#include + +#define KERNEL_TYPE_NONE 0 +#define KERNEL_TYPE_FREEBSD 1 +#define KERNEL_TYPE_OPENBSD 2 +#define KERNEL_TYPE_NETBSD 3 + +#define GRUB_BSD_TEMP_BUFFER 0x68000 + +#define FREEBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */ +#define FREEBSD_RB_SINGLE (1 << 1) /* reboot to single user only */ +#define FREEBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */ +#define FREEBSD_RB_HALT (1 << 3) /* don't reboot, just halt */ +#define FREEBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */ +#define FREEBSD_RB_DFLTROOT (1 << 5) /* use compiled-in rootdev */ +#define FREEBSD_RB_KDB (1 << 6) /* give control to kernel debugger */ +#define FREEBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */ +#define FREEBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */ +#define FREEBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */ +#define FREEBSD_RB_CONFIG (1 << 10) /* invoke user configuration routing */ +#define FREEBSD_RB_VERBOSE (1 << 11) /* print all potentially useful info */ +#define FREEBSD_RB_SERIAL (1 << 12) /* user serial port as console */ +#define FREEBSD_RB_CDROM (1 << 13) /* use cdrom as root */ +#define FREEBSD_RB_GDB (1 << 15) /* use GDB remote debugger instead of DDB */ +#define FREEBSD_RB_MUTE (1 << 16) /* Come up with the console muted */ +#define FREEBSD_RB_PAUSE (1 << 20) +#define FREEBSD_RB_QUIET (1 << 21) +#define FREEBSD_RB_NOINTR (1 << 28) +#define FREENSD_RB_MULTIPLE (1 << 29) /* Use multiple consoles */ +#define FREEBSD_RB_DUAL FREENSD_RB_MULTIPLE +#define FREEBSD_RB_BOOTINFO (1 << 31) /* have `struct bootinfo *' arg */ + +#define FREEBSD_B_DEVMAGIC 0xa0000000 +#define FREEBSD_B_SLICESHIFT 20 +#define FREEBSD_B_UNITSHIFT 16 +#define FREEBSD_B_PARTSHIFT 8 +#define FREEBSD_B_TYPESHIFT 0 + +#define FREEBSD_BOOTINFO_VERSION 1 +#define FREEBSD_N_BIOS_GEOM 8 + +#define FREEBSD_MODINFO_END 0x0000 /* End of list */ +#define FREEBSD_MODINFO_NAME 0x0001 /* Name of module (string) */ +#define FREEBSD_MODINFO_TYPE 0x0002 /* Type of module (string) */ +#define FREEBSD_MODINFO_ADDR 0x0003 /* Loaded address */ +#define FREEBSD_MODINFO_SIZE 0x0004 /* Size of module */ +#define FREEBSD_MODINFO_EMPTY 0x0005 /* Has been deleted */ +#define FREEBSD_MODINFO_ARGS 0x0006 /* Parameters string */ +#define FREEBSD_MODINFO_METADATA 0x8000 /* Module-specfic */ + +#define FREEBSD_MODINFOMD_AOUTEXEC 0x0001 /* a.out exec header */ +#define FREEBSD_MODINFOMD_ELFHDR 0x0002 /* ELF header */ +#define FREEBSD_MODINFOMD_SSYM 0x0003 /* start of symbols */ +#define FREEBSD_MODINFOMD_ESYM 0x0004 /* end of symbols */ +#define FREEBSD_MODINFOMD_DYNAMIC 0x0005 /* _DYNAMIC pointer */ +#define FREEBSD_MODINFOMD_ENVP 0x0006 /* envp[] */ +#define FREEBSD_MODINFOMD_HOWTO 0x0007 /* boothowto */ +#define FREEBSD_MODINFOMD_KERNEND 0x0008 /* kernend */ +#define FREEBSD_MODINFOMD_SHDR 0x0009 /* section header table */ +#define FREEBSD_MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */ + +#define FREEBSD_MODINFOMD_DEPLIST (0x4001 | FREEBSD_MODINFOMD_NOCOPY) /* depends on */ + +#define FREEBSD_MODTYPE_KERNEL "elf kernel" +#define FREEBSD_MODTYPE_MODULE "elf module" +#define FREEBSD_MODTYPE_RAW "raw" + +struct grub_freebsd_bootinfo +{ + grub_uint32_t bi_version; + grub_uint8_t *bi_kernelname; + struct nfs_diskless *bi_nfs_diskless; + grub_uint32_t bi_n_bios_used; + grub_uint32_t bi_bios_geom[FREEBSD_N_BIOS_GEOM]; + grub_uint32_t bi_size; + grub_uint8_t bi_memsizes_valid; + grub_uint8_t bi_bios_dev; + grub_uint8_t bi_pad[2]; + grub_uint32_t bi_basemem; + grub_uint32_t bi_extmem; + grub_uint32_t bi_symtab; + grub_uint32_t bi_esymtab; + grub_uint32_t bi_kernend; + grub_uint32_t bi_envp; + grub_uint32_t bi_modulep; +} __attribute__ ((packed)); + +#define OPENBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */ +#define OPENBSD_RB_SINGLE (1 << 1) /* reboot to single user only */ +#define OPENBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */ +#define OPENBSD_RB_HALT (1 << 3) /* don't reboot, just halt */ +#define OPENBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */ +#define OPENBSD_RB_DFLTROOT (1 << 5) /* use compiled-in rootdev */ +#define OPENBSD_RB_KDB (1 << 6) /* give control to kernel debugger */ +#define OPENBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */ +#define OPENBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */ +#define OPENBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */ +#define OPENBSD_RB_CONFIG (1 << 10) /* change configured devices */ +#define OPENBSD_RB_TIMEBAD (1 << 11) /* don't call resettodr() in boot() */ +#define OPENBSD_RB_POWERDOWN (1 << 12) /* attempt to power down machine */ +#define OPENBSD_RB_SERCONS (1 << 13) /* use serial console if available */ +#define OPENBSD_RB_USERREQ (1 << 14) /* boot() called at user request (e.g. ddb) */ + +#define OPENBSD_B_DEVMAGIC 0xa0000000 +#define OPENBSD_B_ADAPTORSHIFT 24 +#define OPENBSD_B_CTRLSHIFT 20 +#define OPENBSD_B_UNITSHIFT 16 +#define OPENBSD_B_PARTSHIFT 8 +#define OPENBSD_B_TYPESHIFT 0 + +#define OPENBSD_BOOTARG_APIVER (OPENBSD_BAPIV_VECTOR | \ + OPENBSD_BAPIV_ENV | \ + OPENBSD_BAPIV_BMEMMAP) + +#define OPENBSD_BAPIV_ANCIENT 0x0 /* MD old i386 bootblocks */ +#define OPENBSD_BAPIV_VARS 0x1 /* MD structure w/ add info passed */ +#define OPENBSD_BAPIV_VECTOR 0x2 /* MI vector of MD structures passed */ +#define OPENBSD_BAPIV_ENV 0x4 /* MI environment vars vector */ +#define OPENBSD_BAPIV_BMEMMAP 0x8 /* MI memory map passed is in bytes */ + +#define OPENBSD_BOOTARG_ENV 0x1000 +#define OPENBSD_BOOTARG_END -1 + +#define OPENBSD_BOOTARG_MMAP 0 + +struct grub_openbsd_bios_mmap +{ + grub_uint64_t addr; + grub_uint64_t len; + grub_uint32_t type; +} bios_memmap_t; + +struct grub_openbsd_bootargs +{ + int ba_type; + int ba_size; + struct grub_openbsd_bootargs *ba_next; +} __attribute__ ((packed)); + +#define NETBSD_RB_AUTOBOOT 0 /* flags for system auto-booting itself */ + +#define NETBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */ +#define NETBSD_RB_SINGLE (1 << 1) /* reboot to single user only */ +#define NETBSD_RB_NOSYNC (1 << 2) /* dont sync before reboot */ +#define NETBSD_RB_HALT (1 << 3) /* don't reboot, just halt */ +#define NETBSD_RB_INITNAME (1 << 4) /* name given for /etc/init (unused) */ +#define NETBSD_RB_UNUSED1 (1 << 5) /* was RB_DFLTROOT, obsolete */ +#define NETBSD_RB_KDB (1 << 6) /* give control to kernel debugger */ +#define NETBSD_RB_RDONLY (1 << 7) /* mount root fs read-only */ +#define NETBSD_RB_DUMP (1 << 8) /* dump kernel memory before reboot */ +#define NETBSD_RB_MINIROOT (1 << 9) /* mini-root present in memory at boot time */ +#define NETBSD_RB_STRING (1 << 10) /* use provided bootstr */ +#define NETBSD_RB_POWERDOWN ((1 << 11) | RB_HALT) /* turn power off (or at least halt) */ +#define NETBSD_RB_USERCONFIG (1 << 12) /* change configured devices */ + +#define NETBSD_AB_NORMAL 0 /* boot normally (default) */ + +#define NETBSD_AB_QUIET (1 << 16) /* boot quietly */ +#define NETBSD_AB_VERBOSE (1 << 17) /* boot verbosely */ +#define NETBSD_AB_SILENT (1 << 18) /* boot silently */ +#define NETBSD_AB_DEBUG (1 << 19) /* boot with debug messages */ + +struct grub_netbsd_bootinfo +{ + grub_uint32_t bi_count; + void *bi_data[1]; +}; + +#define NETBSD_BTINFO_BOOTPATH 0 +#define NETBSD_BTINFO_ROOTDEVICE 1 +#define NETBSD_BTINFO_BOOTDISK 3 + +struct grub_netbsd_btinfo_common +{ + int len; + int type; +}; + +struct grub_netbsd_btinfo_bootpath +{ + struct grub_netbsd_btinfo_common common; + char bootpath[80]; +}; + +struct grub_netbsd_btinfo_rootdevice +{ + struct grub_netbsd_btinfo_common common; + char devname[16]; +}; + +struct grub_netbsd_btinfo_bootdisk +{ + struct grub_netbsd_btinfo_common common; + int labelsector; /* label valid if != -1 */ + struct + { + grub_uint16_t type, checksum; + char packname[16]; + } label; + int biosdev; + int partition; +}; + +void grub_rescue_cmd_freebsd (int argc, char *argv[]); +void grub_rescue_cmd_openbsd (int argc, char *argv[]); +void grub_rescue_cmd_netbsd (int argc, char *argv[]); + +void grub_rescue_cmd_freebsd_loadenv (int argc, char *argv[]); +void grub_rescue_cmd_freebsd_module (int argc, char *argv[]); + +#endif /* ! GRUB_BSD_CPU_HEADER */ diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index 45a1652e2..5f912cd1c 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -33,12 +33,15 @@ extern grub_size_t EXPORT_VAR(grub_os_area_size); void EXPORT_FUNC(grub_linux_boot) (void) __attribute__ ((noreturn)); /* The asm part of the multiboot loader. */ -void EXPORT_FUNC(grub_multiboot_real_boot) (grub_addr_t entry, - struct grub_multiboot_info *mbi) +void EXPORT_FUNC(grub_multiboot_real_boot) (grub_addr_t entry, + struct grub_multiboot_info *mbi) __attribute__ ((noreturn)); void EXPORT_FUNC(grub_multiboot2_real_boot) (grub_addr_t entry, struct grub_multiboot_info *mbi) __attribute__ ((noreturn)); +void EXPORT_FUNC(grub_unix_real_boot) (grub_addr_t entry, ...) + __attribute__ ((cdecl,noreturn)); + /* It is necessary to export these functions, because normal mode commands reuse rescue mode commands. */ diff --git a/include/grub/i386/pc/init.h b/include/grub/i386/pc/init.h index 115deb426..0c6a12934 100644 --- a/include/grub/i386/pc/init.h +++ b/include/grub/i386/pc/init.h @@ -40,7 +40,7 @@ struct grub_machine_mmap_entry /* Get a memory map entry. Return next continuation value. Zero means the end. */ -grub_uint32_t grub_get_mmap_entry (struct grub_machine_mmap_entry *entry, +grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_machine_mmap_entry *entry, grub_uint32_t cont); /* Turn on/off Gate A20. */ diff --git a/kern/elf.c b/kern/elf.c index ca10b5bf6..cb8a72286 100644 --- a/kern/elf.c +++ b/kern/elf.c @@ -85,9 +85,8 @@ grub_elf_file (grub_file_t file) return elf; fail: - grub_error_push (); - grub_elf_close (elf); - grub_error_pop (); + grub_free (elf->phdrs); + grub_free (elf); return 0; } @@ -95,12 +94,17 @@ grub_elf_t grub_elf_open (const char *name) { grub_file_t file; + grub_elf_t elf; file = grub_gzfile_open (name, 1); if (! file) return 0; - return grub_elf_file (file); + elf = grub_elf_file (file); + if (! elf) + grub_file_close (file); + + return elf; } @@ -177,8 +181,8 @@ grub_elf32_size (grub_elf_t elf) /* Run through the program headers to calculate the total memory size we * should claim. */ - auto int calcsize (grub_elf_t _elf, Elf32_Phdr *phdr, void *_arg); - int calcsize (grub_elf_t UNUSED _elf, Elf32_Phdr *phdr, void UNUSED *_arg) + auto int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf, Elf32_Phdr *phdr, void *_arg); + int NESTED_FUNC_ATTR calcsize (grub_elf_t UNUSED _elf, Elf32_Phdr *phdr, void UNUSED *_arg) { /* Only consider loadable segments. */ if (phdr->p_type != PT_LOAD) @@ -228,9 +232,9 @@ grub_elf32_load (grub_elf_t _elf, grub_elf32_load_hook_t _load_hook, if (phdr->p_type != PT_LOAD) return 0; - load_addr = phdr->p_paddr; if (load_hook && load_hook (phdr, &load_addr)) return 1; + load_addr = phdr->p_paddr; if (load_addr < load_base) load_base = load_addr; @@ -355,8 +359,8 @@ grub_elf64_size (grub_elf_t elf) /* Run through the program headers to calculate the total memory size we * should claim. */ - auto int calcsize (grub_elf_t _elf, Elf64_Phdr *phdr, void *_arg); - int calcsize (grub_elf_t UNUSED _elf, Elf64_Phdr *phdr, void UNUSED *_arg) + auto int NESTED_FUNC_ATTR calcsize (grub_elf_t _elf, Elf64_Phdr *phdr, void *_arg); + int NESTED_FUNC_ATTR calcsize (grub_elf_t UNUSED _elf, Elf64_Phdr *phdr, void UNUSED *_arg) { /* Only consider loadable segments. */ if (phdr->p_type != PT_LOAD) @@ -407,9 +411,9 @@ grub_elf64_load (grub_elf_t _elf, grub_elf64_load_hook_t _load_hook, if (phdr->p_type != PT_LOAD) return 0; - load_addr = phdr->p_paddr; if (load_hook && load_hook (phdr, &load_addr)) return 1; + load_addr = phdr->p_paddr; if (load_addr < load_base) load_base = load_addr; diff --git a/kern/i386/loader.S b/kern/i386/loader.S index 266f4efea..39cf6a001 100644 --- a/kern/i386/loader.S +++ b/kern/i386/loader.S @@ -21,7 +21,7 @@ * Note: These functions defined in this file may be called from C. * Be careful of that you must not modify some registers. Quote * from gcc-2.95.2/gcc/config/i386/i386.h: - + 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any registers that can be used without being saved. @@ -46,7 +46,7 @@ */ .p2align 2 /* force 4-byte alignment */ - + /* * void grub_linux_boot_zimage (void) */ @@ -58,7 +58,7 @@ VARIABLE(grub_linux_real_addr) .long 0 VARIABLE(grub_linux_is_bzimage) .long 0 - + FUNCTION(grub_linux_boot) /* Must be done before zImage copy. */ call EXT_C(grub_dl_unload_all) @@ -118,7 +118,7 @@ linux_setup_seg: .word 0 .code32 - + /* * This starts the multiboot kernel. */ @@ -128,14 +128,14 @@ FUNCTION(grub_multiboot_real_boot) pushl %eax /* Move the address of the multiboot information structure to ebx. */ movl %edx,%ebx - + /* Unload all modules and stop the floppy driver. */ call EXT_C(grub_dl_unload_all) call EXT_C(grub_stop_floppy) /* Interrupts should be disabled. */ cli - + /* Move the magic value into eax and jump to the kernel. */ movl $MULTIBOOT_MAGIC2,%eax popl %ecx @@ -159,6 +159,30 @@ FUNCTION(grub_multiboot2_real_boot) cli /* Move the magic value into eax and jump to the kernel. */ - movl $MULTIBOOT2_BOOTLOADER_MAGIC,%eax + movl $MULTIBOOT2_BOOTLOADER_MAGIC,%eax popl %ecx jmp *%ecx + +/* + * Use cdecl calling convention for *BSD kernels. + */ + +FUNCTION(grub_unix_real_boot) + + call EXT_C(grub_dl_unload_all) + call EXT_C(grub_stop_floppy) + + /* Interrupts should be disabled. */ + cli + + /* Discard `grub_unix_real_boot' return address. */ + popl %eax + + /* Fetch `entry' address ... */ + popl %eax + + /* + * ... and put our return address in its place. The kernel will + * ignore it, but it expects %esp to point to it. + */ + call *%eax diff --git a/loader/aout.c b/loader/aout.c new file mode 100644 index 000000000..2c82b60e6 --- /dev/null +++ b/loader/aout.c @@ -0,0 +1,61 @@ +/* + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include +#include +#include +#include + +int +grub_aout_get_type (union grub_aout_header *header) +{ + int magic; + + magic = AOUT_GETMAGIC (header->aout32); + if ((magic == AOUT32_OMAGIC) || (magic == AOUT32_NMAGIC) || + (magic == AOUT32_ZMAGIC) || (magic == AOUT32_QMAGIC)) + return AOUT_TYPE_AOUT32; + else if ((magic == AOUT64_OMAGIC) || (magic == AOUT64_NMAGIC) || + (magic == AOUT64_ZMAGIC)) + return AOUT_TYPE_AOUT64; + else + return AOUT_TYPE_NONE; +} + +grub_err_t +grub_aout_load (grub_file_t file, int offset, + grub_addr_t load_addr, + int load_size, + grub_addr_t bss_end_addr) +{ + if ((grub_file_seek (file, offset)) == (grub_off_t) - 1) + return grub_errno; + + if (!load_size) + load_size = file->size - offset; + + grub_file_read (file, (char *) load_addr, load_size); + + if (grub_errno) + return grub_errno; + + if (bss_end_addr) + grub_memset (load_addr + load_size, 0, + bss_end_addr - load_addr - load_size); + + return GRUB_ERR_NONE; +} diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c new file mode 100644 index 000000000..4966afa86 --- /dev/null +++ b/loader/i386/bsd.c @@ -0,0 +1,771 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define ALIGN_DWORD(a) ALIGN_UP (a, 4) +#define ALIGN_PAGE(a) ALIGN_UP (a, 4096) + +#define MOD_BUF_ALLOC_UNIT 4096 + +static int kernel_type; +static grub_dl_t my_mod; +static grub_addr_t entry, kern_start, kern_end; +static grub_uint32_t bootflags; +static char *mod_buf; +static grub_uint32_t mod_buf_len, mod_buf_max; +static int is_elf_kernel; + +static const char freebsd_opts[] = "DhaCcdgmnpqrsv"; +static const grub_uint32_t freebsd_flags[] = +{ + FREEBSD_RB_DUAL, FREEBSD_RB_SERIAL, FREEBSD_RB_ASKNAME, + FREEBSD_RB_CDROM, FREEBSD_RB_CONFIG, FREEBSD_RB_KDB, + FREEBSD_RB_GDB, FREEBSD_RB_MUTE, FREEBSD_RB_NOINTR, + FREEBSD_RB_PAUSE, FREEBSD_RB_QUIET, FREEBSD_RB_DFLTROOT, + FREEBSD_RB_SINGLE, FREEBSD_RB_VERBOSE +}; + +static const char openbsd_opts[] = "abcsd"; +static const grub_uint32_t openbsd_flags[] = +{ + OPENBSD_RB_ASKNAME, OPENBSD_RB_HALT, OPENBSD_RB_CONFIG, + OPENBSD_RB_SINGLE, OPENBSD_RB_KDB +}; + +static const char netbsd_opts[] = "abcdmqsvxz"; +static const grub_uint32_t netbsd_flags[] = +{ + NETBSD_RB_ASKNAME, NETBSD_RB_HALT, NETBSD_RB_USERCONFIG, + NETBSD_RB_KDB, NETBSD_RB_MINIROOT, NETBSD_AB_QUIET, + NETBSD_RB_SINGLE, NETBSD_AB_VERBOSE, NETBSD_AB_DEBUG, + NETBSD_AB_SILENT +}; + +static void +grub_bsd_get_device (grub_uint32_t * biosdev, + grub_uint32_t * unit, + grub_uint32_t * slice, grub_uint32_t * part) +{ + char *p; + + *biosdev = *unit = *slice = *part = 0; + p = grub_env_get ("root"); + if ((p) && ((p[0] == 'h') || (p[0] == 'f')) && (p[1] == 'd') && + (p[2] >= '0') && (p[2] <= '9')) + { + if (p[0] == 'h') + *biosdev = 0x80; + + *unit = grub_strtoul (p + 2, &p, 0); + *biosdev += *unit; + + if ((p) && (p[0] == ',')) + { + if ((p[1] >= '0') && (p[1] <= '9')) + { + *slice = grub_strtoul (p + 1, &p, 0); + + if ((p) && (p[0] == ',')) + p++; + } + + if ((p[0] >= 'a') && (p[0] <= 'z')) + *part = p[0] - 'a'; + } + } +} + +static grub_err_t +grub_freebsd_add_meta (grub_uint32_t type, void *data, grub_uint32_t len) +{ + if (mod_buf_max < mod_buf_len + len + 8) + { + char *new_buf; + + do + { + mod_buf_max += MOD_BUF_ALLOC_UNIT; + } + while (mod_buf_max < mod_buf_len + len + 8); + + new_buf = grub_malloc (mod_buf_max); + if (!new_buf) + return grub_errno; + + grub_memcpy (new_buf, mod_buf, mod_buf_len); + grub_free (mod_buf); + + mod_buf = new_buf; + } + + *((grub_uint32_t *) (mod_buf + mod_buf_len)) = type; + *((grub_uint32_t *) (mod_buf + mod_buf_len + 4)) = len; + mod_buf_len += 8; + + if (len) + grub_memcpy (mod_buf + mod_buf_len, data, len); + + mod_buf_len = ALIGN_DWORD (mod_buf_len + len); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, + grub_addr_t addr, grub_uint32_t size) +{ + char *name, *type; + + name = grub_strrchr (argv[0], '/'); + if (name) + name++; + else + name = argv[0]; + + if (grub_freebsd_add_meta (FREEBSD_MODINFO_NAME, name, + grub_strlen (name) + 1)) + return grub_errno; + + argc--; + argv++; + + if ((argc) && (!grub_memcmp (argv[0], "type=", 5))) + { + type = &argv[0][5]; + argc--; + argv++; + } + else + type = (is_kern) ? FREEBSD_MODTYPE_KERNEL : FREEBSD_MODTYPE_RAW; + + if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, + grub_strlen (type) + 1)) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, sizeof (addr))) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, sizeof (size)))) + return grub_errno; + + if (argc) + { + int i, n; + + n = 0; + for (i = 0; i < argc; i++) + { + n += grub_strlen (argv[i]) + 1; + } + + if (n) + { + char cmdline[n], *p; + + p = cmdline; + for (i = 0; i < argc; i++) + { + grub_strcpy (p, argv[i]); + p += grub_strlen (argv[i]); + *(p++) = ' '; + } + *p = 0; + + if (grub_freebsd_add_meta (FREEBSD_MODINFO_ARGS, cmdline, n)) + return grub_errno; + } + } + + return GRUB_ERR_NONE; +} + +static void +grub_freebsd_list_modules (void) +{ + grub_uint32_t pos = 0; + + grub_printf (" %-18s %-18s%14s%14s\n", "name", "type", "addr", "size"); + while (pos < mod_buf_len) + { + grub_uint32_t type, size; + + type = *((grub_uint32_t *) (mod_buf + pos)); + size = *((grub_uint32_t *) (mod_buf + pos + 4)); + pos += 8; + switch (type) + { + case FREEBSD_MODINFO_NAME: + case FREEBSD_MODINFO_TYPE: + grub_printf (" %-18s", mod_buf + pos); + break; + case FREEBSD_MODINFO_ADDR: + { + grub_addr_t addr; + + addr = *((grub_addr_t *) (mod_buf + pos)); + grub_printf (" 0x%08x", addr); + break; + } + case FREEBSD_MODINFO_SIZE: + { + grub_uint32_t len; + + len = *((grub_uint32_t *) (mod_buf + pos)); + grub_printf (" 0x%08x\n", len); + } + } + + pos = ALIGN_DWORD (pos + size); + } +} + +static grub_err_t +grub_freebsd_boot (void) +{ + struct grub_freebsd_bootinfo bi; + char *p; + grub_uint32_t bootdev, biosdev, unit, slice, part; + + auto int iterate_env (struct grub_env_var *var); + int iterate_env (struct grub_env_var *var) + { + if ((!grub_memcmp (var->name, "FreeBSD.", 8)) && (var->name[8])) + { + grub_strcpy (p, &var->name[8]); + p += grub_strlen (p); + *(p++) = '='; + grub_strcpy (p, var->value); + p += grub_strlen (p) + 1; + } + + return 0; + } + + grub_memset (&bi, 0, sizeof (bi)); + bi.bi_version = FREEBSD_BOOTINFO_VERSION; + bi.bi_size = sizeof (bi); + + grub_bsd_get_device (&biosdev, &unit, &slice, &part); + bootdev = (FREEBSD_B_DEVMAGIC + ((slice + 1) << FREEBSD_B_SLICESHIFT) + + (unit << FREEBSD_B_UNITSHIFT) + (part << FREEBSD_B_PARTSHIFT)); + + bi.bi_bios_dev = biosdev; + + p = (char *) kern_end; + + grub_env_iterate (iterate_env); + + if (p != (char *) kern_end) + { + *(p++) = 0; + + bi.bi_envp = kern_end; + kern_end = ALIGN_PAGE ((grub_uint32_t) p); + } + + if (is_elf_kernel) + { + if (grub_freebsd_add_meta (FREEBSD_MODINFO_END, 0, 0)) + return grub_errno; + + grub_memcpy ((char *) kern_end, mod_buf, mod_buf_len); + bi.bi_modulep = kern_end; + + kern_end = ALIGN_PAGE (kern_end + mod_buf_len); + } + + bi.bi_kernend = kern_end; + + grub_unix_real_boot (entry, bootflags | FREEBSD_RB_BOOTINFO, bootdev, + 0, 0, 0, &bi, bi.bi_modulep, kern_end); + + /* Not reached. */ + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_openbsd_boot (void) +{ + char *buf = (char *) GRUB_BSD_TEMP_BUFFER; + struct grub_machine_mmap_entry mmap; + struct grub_openbsd_bios_mmap *pm; + struct grub_openbsd_bootargs *pa; + grub_uint32_t bootdev, biosdev, unit, slice, part, cont; + + pa = (struct grub_openbsd_bootargs *) buf; + + pa->ba_type = OPENBSD_BOOTARG_MMAP; + pm = (struct grub_openbsd_bios_mmap *) (pa + 1); + cont = grub_get_mmap_entry (&mmap, 0); + if (mmap.size) + do + { + pm->addr = mmap.addr; + pm->len = mmap.len; + pm->type = mmap.type; + pm++; + + if (!cont) + break; + + cont = grub_get_mmap_entry (&mmap, cont); + } + while (mmap.size); + + pa->ba_size = (char *) pm - (char *) pa; + pa->ba_next = (struct grub_openbsd_bootargs *) pm; + pa = pa->ba_next; + pa->ba_type = OPENBSD_BOOTARG_END; + pa++; + + grub_bsd_get_device (&biosdev, &unit, &slice, &part); + bootdev = (OPENBSD_B_DEVMAGIC + (unit << OPENBSD_B_UNITSHIFT) + + (part << OPENBSD_B_PARTSHIFT)); + + grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER, + 0, grub_upper_mem >> 10, grub_lower_mem >> 10, + (char *) pa - buf, buf); + + /* Not reached. */ + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_netbsd_boot (void) +{ + struct grub_netbsd_btinfo_rootdevice *rootdev; + struct grub_netbsd_bootinfo *bootinfo; + grub_uint32_t biosdev, unit, slice, part; + + grub_bsd_get_device (&biosdev, &unit, &slice, &part); + + rootdev = (struct grub_netbsd_btinfo_rootdevice *) GRUB_BSD_TEMP_BUFFER; + + rootdev->common.len = sizeof (struct grub_netbsd_btinfo_rootdevice); + rootdev->common.type = NETBSD_BTINFO_ROOTDEVICE; + grub_sprintf (rootdev->devname, "%cd%d%c", (biosdev & 0x80) ? 'w' : 'f', + unit, 'a' + part); + + bootinfo = (struct grub_netbsd_bootinfo *) (rootdev + 1); + bootinfo->bi_count = 1; + bootinfo->bi_data[0] = rootdev; + + grub_unix_real_boot (entry, bootflags, 0, bootinfo, + 0, grub_upper_mem >> 10, grub_lower_mem >> 10); + + /* Not reached. */ + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_bsd_unload (void) +{ + if (mod_buf) + { + grub_free (mod_buf); + mod_buf = 0; + mod_buf_max = 0; + } + + kernel_type = KERNEL_TYPE_NONE; + grub_dl_unref (my_mod); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_bsd_load_aout (grub_file_t file) +{ + grub_addr_t load_addr, bss_end_addr; + int ofs, align_page; + union grub_aout_header ah; + + if ((grub_file_seek (file, 0)) == (grub_off_t) - 1) + return grub_errno; + + if (grub_file_read (file, (char *) &ah, sizeof (ah)) != sizeof (ah)) + return grub_error (GRUB_ERR_READ_ERROR, "cannot read the a.out header"); + + if (grub_aout_get_type (&ah) != AOUT_TYPE_AOUT32) + return grub_error (GRUB_ERR_BAD_OS, "invalid a.out header"); + + entry = ah.aout32.a_entry & 0xFFFFFF; + + if (AOUT_GETMAGIC (ah.aout32) == AOUT32_ZMAGIC) + { + load_addr = entry; + ofs = 0x1000; + align_page = 0; + } + else + { + load_addr = entry & 0xF00000; + ofs = sizeof (struct grub_aout32_header); + align_page = 1; + } + + if (load_addr < 0x100000) + return grub_error (GRUB_ERR_BAD_OS, "load address below 1M"); + + kern_start = load_addr; + kern_end = load_addr + ah.aout32.a_text + ah.aout32.a_data; + if (align_page) + kern_end = ALIGN_PAGE (kern_end); + + if (ah.aout32.a_bss) + { + kern_end += ah.aout32.a_bss; + if (align_page) + kern_end = ALIGN_PAGE (kern_end); + + bss_end_addr = kern_end; + } + else + bss_end_addr = 0; + + return grub_aout_load (file, ofs, load_addr, + ah.aout32.a_text + ah.aout32.a_data, bss_end_addr); +} + +static grub_err_t +grub_bsd_elf32_hook (Elf32_Phdr * phdr, UNUSED grub_addr_t * addr) +{ + Elf32_Addr paddr; + + phdr->p_paddr &= 0xFFFFFF; + paddr = phdr->p_paddr; + + if ((paddr < grub_os_area_addr) + || (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size)) + return grub_error (GRUB_ERR_OUT_OF_RANGE, "Address 0x%x is out of range", + paddr); + + if ((!kern_start) || (paddr < kern_start)) + kern_start = paddr; + + if (paddr + phdr->p_memsz > kern_end) + kern_end = paddr + phdr->p_memsz; + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_bsd_load_elf (grub_elf_t elf) +{ + kern_start = kern_end = 0; + + if (grub_elf_is_elf32 (elf)) + { + entry = elf->ehdr.ehdr32.e_entry & 0xFFFFFF; + return grub_elf32_load (elf, grub_bsd_elf32_hook, 0, 0); + } + else + return grub_error (GRUB_ERR_BAD_OS, "invalid elf"); +} + +static grub_err_t +grub_bsd_load (int argc, char *argv[]) +{ + grub_file_t file; + grub_elf_t elf; + + grub_dl_ref (my_mod); + + grub_loader_unset (); + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); + goto fail; + } + + file = grub_gzfile_open (argv[0], 1); + if (!file) + goto fail; + + elf = grub_elf_file (file); + if (elf) + { + is_elf_kernel = 1; + grub_bsd_load_elf (elf); + grub_elf_close (elf); + } + else + { + is_elf_kernel = 0; + grub_errno = 0; + grub_bsd_load_aout (file); + grub_file_close (file); + } + +fail: + + if (grub_errno != GRUB_ERR_NONE) + grub_dl_unref (my_mod); + + return grub_errno; +} + +static grub_uint32_t +grub_bsd_parse_flags (char *str, const char *opts, + const grub_uint32_t * flags) +{ + grub_uint32_t result = 0; + + while (*str) + { + const char *po; + const grub_uint32_t *pf; + + po = opts; + pf = flags; + while (*po) + { + if (*str == *po) + { + result |= *pf; + break; + } + po++; + pf++; + } + str++; + } + + return result; +} + +void +grub_rescue_cmd_freebsd (int argc, char *argv[]) +{ + kernel_type = KERNEL_TYPE_FREEBSD; + bootflags = ((argc <= 1) ? 0 : + grub_bsd_parse_flags (argv[1], freebsd_opts, freebsd_flags)); + + if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) + { + kern_end = ALIGN_PAGE (kern_end); + if ((is_elf_kernel) && + (grub_freebsd_add_meta_module (1, argc, argv, kern_start, + kern_end - kern_start))) + return; + grub_loader_set (grub_freebsd_boot, grub_bsd_unload, 1); + } +} + +void +grub_rescue_cmd_openbsd (int argc, char *argv[]) +{ + kernel_type = KERNEL_TYPE_OPENBSD; + bootflags = ((argc <= 1) ? 0 : + grub_bsd_parse_flags (argv[1], openbsd_opts, openbsd_flags)); + + if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) + grub_loader_set (grub_openbsd_boot, grub_bsd_unload, 1); +} + +void +grub_rescue_cmd_netbsd (int argc, char *argv[]) +{ + kernel_type = KERNEL_TYPE_NETBSD; + bootflags = ((argc <= 1) ? 0 : + grub_bsd_parse_flags (argv[1], netbsd_opts, netbsd_flags)); + + if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) + grub_loader_set (grub_netbsd_boot, grub_bsd_unload, 1); +} + +void +grub_rescue_cmd_freebsd_loadenv (int argc, char *argv[]) +{ + grub_file_t file = 0; + char *buf = 0, *curr, *next; + int len; + + if (kernel_type != KERNEL_TYPE_FREEBSD) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "only freebsd support environment"); + return; + } + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no filename"); + goto fail; + } + + file = grub_gzfile_open (argv[0], 1); + if ((!file) || (!file->size)) + goto fail; + + len = file->size; + buf = grub_malloc (len + 1); + if (!buf) + goto fail; + + if (grub_file_read (file, buf, len) != len) + goto fail; + + buf[len] = 0; + + next = buf; + while (next) + { + char *p; + + curr = next; + next = grub_strchr (curr, '\n'); + if (next) + { + + p = next - 1; + while (p > curr) + { + if ((*p != '\r') && (*p != ' ') && (*p != '\t')) + break; + p--; + } + + if ((p > curr) && (*p == '"')) + p--; + + *(p + 1) = 0; + next++; + } + + if (*curr == '#') + continue; + + p = grub_strchr (curr, '='); + if (!p) + continue; + + *(p++) = 0; + + if (*curr) + { + char name[grub_strlen (curr) + 8 + 1]; + + if (*p == '"') + p++; + + grub_sprintf (name, "FreeBSD.%s", curr); + if (grub_env_set (name, p)) + goto fail; + } + } + +fail: + grub_free (buf); + + if (file) + grub_file_close (file); +} + +void +grub_rescue_cmd_freebsd_module (int argc, char *argv[]) +{ + grub_file_t file = 0; + + if (kernel_type != KERNEL_TYPE_FREEBSD) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "only freebsd support module"); + return; + } + + if (!is_elf_kernel) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "only elf kernel support module"); + return; + } + + /* List the current modules if no parameter. */ + if (!argc) + { + grub_freebsd_list_modules (); + return; + } + + file = grub_gzfile_open (argv[0], 1); + if ((!file) || (!file->size)) + goto fail; + + if (kern_end + file->size > grub_os_area_addr + grub_os_area_size) + { + grub_error (GRUB_ERR_OUT_OF_RANGE, "Not enough memory for the module"); + goto fail; + } + + grub_file_read (file, (char *) kern_end, file->size); + if ((!grub_errno) && + (!grub_freebsd_add_meta_module (0, argc, argv, kern_end, file->size))) + kern_end = ALIGN_PAGE (kern_end + file->size); + +fail: + if (file) + grub_file_close (file); +} + +GRUB_MOD_INIT (bsd) +{ + grub_rescue_register_command ("freebsd", + grub_rescue_cmd_freebsd, + "load freebsd kernel"); + grub_rescue_register_command ("openbsd", + grub_rescue_cmd_openbsd, + "load openbsd kernel"); + grub_rescue_register_command ("netbsd", + grub_rescue_cmd_netbsd, "load netbsd kernel"); + + grub_rescue_register_command ("freebsd_loadenv", + grub_rescue_cmd_freebsd_loadenv, + "load freebsd env"); + grub_rescue_register_command ("freebsd_module", + grub_rescue_cmd_freebsd_module, + "load freebsd module"); + + my_mod = mod; +} + +GRUB_MOD_FINI (bsd) +{ + grub_rescue_unregister_command ("freebsd"); + grub_rescue_unregister_command ("openbsd"); + grub_rescue_unregister_command ("netbsd"); + + grub_rescue_unregister_command ("freebsd_loadenv"); + grub_rescue_unregister_command ("freebsd_module"); + + if (mod_buf) + { + grub_free (mod_buf); + mod_buf = 0; + mod_buf_max = 0; + } +} diff --git a/loader/i386/bsd_normal.c b/loader/i386/bsd_normal.c new file mode 100644 index 000000000..f09cd577c --- /dev/null +++ b/loader/i386/bsd_normal.c @@ -0,0 +1,101 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_err_t +grub_normal_freebsd_command (struct grub_arg_list *state + __attribute__ ((unused)), int argc, char **args) +{ + grub_rescue_cmd_freebsd (argc, args); + return grub_errno; +} + +static grub_err_t +grub_normal_openbsd_command (struct grub_arg_list *state + __attribute__ ((unused)), int argc, char **args) +{ + grub_rescue_cmd_openbsd (argc, args); + return grub_errno; +} + +static grub_err_t +grub_normal_netbsd_command (struct grub_arg_list *state + __attribute__ ((unused)), int argc, char **args) +{ + grub_rescue_cmd_netbsd (argc, args); + return grub_errno; +} + +static grub_err_t +grub_normal_freebsd_loadenv_command (struct grub_arg_list *state + __attribute__ ((unused)), int argc, + char **args) +{ + grub_rescue_cmd_freebsd_loadenv (argc, args); + return grub_errno; +} + +static grub_err_t +grub_normal_freebsd_module_command (struct grub_arg_list *state + __attribute__ ((unused)), int argc, + char **args) +{ + grub_rescue_cmd_freebsd_module (argc, args); + return grub_errno; +} + +GRUB_MOD_INIT (bsd_normal) +{ + (void) mod; /* To stop warning. */ + grub_register_command ("freebsd", grub_normal_freebsd_command, + GRUB_COMMAND_FLAG_BOTH, + "freebsd FILE [OPTS] [ARGS...]", + "Load freebsd kernel.", 0); + grub_register_command ("openbsd", grub_normal_openbsd_command, + GRUB_COMMAND_FLAG_BOTH, + "openbsd FILE [OPTS]", "Load openbsd kernel.", 0); + grub_register_command ("netbsd", grub_normal_netbsd_command, + GRUB_COMMAND_FLAG_BOTH, + "netbsd FILE [OPTS]", "Load netbsd kernel.", 0); + + grub_register_command ("freebsd_loadenv", + grub_normal_freebsd_loadenv_command, + GRUB_COMMAND_FLAG_BOTH, + "freebsd_loadenv FILE", "Load freebsd env.", 0); + grub_register_command ("freebsd_module", + grub_normal_freebsd_module_command, + GRUB_COMMAND_FLAG_BOTH, + "freebsd_module [FILE [type=module_type] [ARGS...]]", + "Load freebsd module.", 0); +} + +GRUB_MOD_FINI (bsd_normal) +{ + grub_unregister_command ("freebsd"); + grub_unregister_command ("openbsd"); + grub_unregister_command ("netbsd"); + + grub_unregister_command ("freebsd_loadenv"); + grub_unregister_command ("freebsd_module"); +} diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 893f11b87..67959cfb2 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -17,7 +17,7 @@ * along with GRUB. If not, see . */ -/* +/* * FIXME: The following features from the Multiboot specification still * need to be implemented: * - VBE support @@ -36,6 +36,7 @@ #include #include #include +#include #include #include #include @@ -87,7 +88,7 @@ static int grub_multiboot_is_elf32 (void *buffer) { Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; - + return ehdr->e_ident[EI_CLASS] == ELFCLASS32; } @@ -101,19 +102,19 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF class"); - + if (grub_dl_check_header (ehdr, sizeof(Elf32_Ehdr))) return grub_error (GRUB_ERR_UNKNOWN_OS, "no valid ELF header found"); - + if (ehdr->e_type != ET_EXEC) return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF file type"); - + /* FIXME: Should we support program headers at strange locations? */ if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); - + entry = ehdr->e_entry; - + /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { @@ -136,7 +137,7 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) == (grub_off_t) -1) return grub_error (GRUB_ERR_BAD_OS, "invalid offset in program header"); - + if (grub_file_read (file, (void *) phdr->p_paddr, phdr->p_filesz) != (grub_ssize_t) phdr->p_filesz) return grub_error (GRUB_ERR_BAD_OS, @@ -163,7 +164,7 @@ static int grub_multiboot_is_elf64 (void *buffer) { Elf64_Ehdr *ehdr = (Elf64_Ehdr *) buffer; - + return ehdr->e_ident[EI_CLASS] == ELFCLASS64; } @@ -218,7 +219,7 @@ grub_multiboot_load_elf64 (grub_file_t file, void *buffer) "segment doesn't fit in memory reserved for the OS (0x%lx > 0x%lx)", phdr->p_paddr + phdr->p_memsz, (grub_uint64_t) grub_os_area_addr + (grub_uint64_t) grub_os_area_size); - + if (grub_file_seek (file, (grub_off_t) phdr->p_offset) == (grub_off_t) -1) return grub_error (GRUB_ERR_BAD_OS, @@ -229,7 +230,7 @@ grub_multiboot_load_elf64 (grub_file_t file, void *buffer) != (grub_ssize_t) phdr->p_filesz) return grub_error (GRUB_ERR_BAD_OS, "couldn't read segment from file"); - + if (phdr->p_filesz < phdr->p_memsz) grub_memset (((char *) ((grub_uint32_t) phdr->p_paddr) + phdr->p_filesz), @@ -256,7 +257,7 @@ grub_multiboot_load_elf (grub_file_t file, void *buffer) return grub_multiboot_load_elf32 (file, buffer); else if (grub_multiboot_is_elf64 (buffer)) return grub_multiboot_load_elf64 (file, buffer); - + return grub_error (GRUB_ERR_UNKNOWN_OS, "unknown ELF class"); } @@ -270,7 +271,7 @@ grub_multiboot (int argc, char *argv[]) int i; grub_loader_unset (); - + if (argc == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, "No kernel specified"); @@ -293,15 +294,15 @@ grub_multiboot (int argc, char *argv[]) /* Look for the multiboot header in the buffer. The header should be at least 12 bytes and aligned on a 4-byte boundary. */ - for (header = (struct grub_multiboot_header *) buffer; + for (header = (struct grub_multiboot_header *) buffer; ((char *) header <= buffer + len - 12) || (header = 0); header = (struct grub_multiboot_header *) ((char *) header + 4)) { - if (header->magic == MULTIBOOT_MAGIC + if (header->magic == MULTIBOOT_MAGIC && !(header->magic + header->flags + header->checksum)) break; } - + if (header == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, "No multiboot header found"); @@ -315,9 +316,24 @@ grub_multiboot (int argc, char *argv[]) goto fail; } - if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE) + if (header->flags & MULTIBOOT_AOUT_KLUDGE) + { + int ofs; + + ofs = (char *) header - buffer - + (header->header_addr - header->load_addr); + if ((grub_aout_load (file, ofs, header->load_addr, + ((header->load_end_addr == 0) ? 0 : + header->load_end_addr - header->load_addr), + header->bss_end_addr)) + !=GRUB_ERR_NONE) + goto fail; + + entry = header->entry_addr; + } + else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE) goto fail; - + mbi = grub_malloc (sizeof (struct grub_multiboot_info)); if (! mbi) goto fail; @@ -332,20 +348,20 @@ grub_multiboot (int argc, char *argv[]) for (i = 0, len = 0; i < argc; i++) len += grub_strlen (argv[i]) + 1; - + cmdline = p = grub_malloc (len); if (! cmdline) goto fail; - + for (i = 0; i < argc; i++) { p = grub_stpcpy (p, argv[i]); *(p++) = ' '; } - + /* Remove the space after the last word. */ *(--p) = '\0'; - + mbi->flags |= MULTIBOOT_INFO_CMDLINE; mbi->cmdline = (grub_uint32_t) cmdline; @@ -383,7 +399,7 @@ grub_module (int argc, char *argv[]) if (!mbi) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the multiboot kernel first"); goto fail; } @@ -402,20 +418,20 @@ grub_module (int argc, char *argv[]) grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); goto fail; } - + for (i = 0; i < argc; i++) len += grub_strlen (argv[i]) + 1; - + cmdline = p = grub_malloc (len); if (! cmdline) goto fail; - + for (i = 0; i < argc; i++) { p = grub_stpcpy (p, argv[i]); *(p++) = ' '; } - + /* Remove the space after the last word. */ *(--p) = '\0'; @@ -423,7 +439,7 @@ grub_module (int argc, char *argv[]) { struct grub_mod_list *modlist = (struct grub_mod_list *) mbi->mods_addr; - modlist = grub_realloc (modlist, (mbi->mods_count + 1) + modlist = grub_realloc (modlist, (mbi->mods_count + 1) * sizeof (struct grub_mod_list)); if (! modlist) goto fail; diff --git a/loader/multiboot2.c b/loader/multiboot2.c index 65fdea12f..42c6fadfe 100644 --- a/loader/multiboot2.c +++ b/loader/multiboot2.c @@ -371,6 +371,7 @@ grub_multiboot2 (int argc, char *argv[]) } else { + grub_errno = 0; grub_dprintf ("loader", "Loading non-ELF multiboot 2 file.\n"); if (header) From 79ff665f5e9b63c0cfa2cb583a3e1db833dda8e3 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 19 Feb 2008 19:52:42 +0000 Subject: [PATCH 0056/1707] 2008-02-19 Pavel Roskin * kern/rescue.c (grub_enter_rescue_mode): Improve initial message. --- ChangeLog | 5 +++++ kern/rescue.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 633e7ce37..936a1e98d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-02-19 Pavel Roskin + + * kern/rescue.c (grub_enter_rescue_mode): Improve initial + message. + 2008-02-19 Bean * conf/i386-pc.rmk (pkglib_MODULES): Add aout.mod _bsd.mod and bsd.mod. diff --git a/kern/rescue.c b/kern/rescue.c index bb0c65087..e333ab5f5 100644 --- a/kern/rescue.c +++ b/kern/rescue.c @@ -618,7 +618,7 @@ grub_enter_rescue_mode (void) /* First of all, attempt to execute the normal mode. */ attempt_normal_mode (); - grub_printf ("Entering into rescue mode...\n"); + grub_printf ("Entering rescue mode...\n"); grub_rescue_register_command ("boot", grub_rescue_cmd_boot, "boot an operating system"); From f6f4cfb01165eedcd0b18bcdadaa575b9359624b Mon Sep 17 00:00:00 2001 From: okuji Date: Thu, 21 Feb 2008 21:22:23 +0000 Subject: [PATCH 0057/1707] 2008-02-21 Yoshinori K. Okuji * include/grub/efi/time.h: Fix a wrong comment. --- ChangeLog | 4 ++++ include/grub/efi/time.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 936a1e98d..333383f37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-02-21 Yoshinori K. Okuji + + * include/grub/efi/time.h: Fix a wrong comment. + 2008-02-19 Pavel Roskin * kern/rescue.c (grub_enter_rescue_mode): Improve initial diff --git a/include/grub/efi/time.h b/include/grub/efi/time.h index ffd583287..540f6fc04 100644 --- a/include/grub/efi/time.h +++ b/include/grub/efi/time.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ #include -/* This is destined to overflow when one minute passes by. */ +/* This is destined to overflow when one hour passes by. */ #define GRUB_TICKS_PER_SECOND ((1UL << 31) / 60 / 60 * 2) /* Return the real time in ticks. */ From 2dc33c03b0e2f80a10edbdafa4452416d4b61af8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 23 Feb 2008 20:33:32 +0000 Subject: [PATCH 0058/1707] 2008-02-23 Robert Millan * partmap/gpt.c (grub_gpt_magic): Add `0x' qualifier to each member, since they were intended to be in hex. This didn't break previously because of a bug in gpt_partition_map_iterate() (see below). (gpt_partition_map_iterate): Replace `grub_memcmp' with `! grub_memcmp' when checking the validity of GPT header. Remove `partno', since it always provides the same information as `i'. --- ChangeLog | 10 ++++++++++ partmap/gpt.c | 10 ++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 333383f37..3f8c3b4c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-02-23 Robert Millan + + * partmap/gpt.c (grub_gpt_magic): Add `0x' qualifier to each member, + since they were intended to be in hex. This didn't break previously + because of a bug in gpt_partition_map_iterate() (see below). + + (gpt_partition_map_iterate): Replace `grub_memcmp' with `! grub_memcmp' + when checking the validity of GPT header. + Remove `partno', since it always provides the same information as `i'. + 2008-02-21 Yoshinori K. Okuji * include/grub/efi/time.h: Fix a wrong comment. diff --git a/partmap/gpt.c b/partmap/gpt.c index 6bc87551d..36eaef21c 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -27,7 +27,7 @@ static grub_uint8_t grub_gpt_magic[8] = { - 45, 46, 49, 20, 50, 41, 52, 54 + 0x45, 0x46, 0x49, 0x20, 0x50, 0x41, 0x52, 0x54 }; static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTITION_TYPE_EMPTY; @@ -51,7 +51,6 @@ gpt_partition_map_iterate (grub_disk_t disk, struct grub_disk raw; struct grub_pc_partition_mbr mbr; grub_uint64_t entries; - int partno = 0; unsigned int i; int last_offset = 0; @@ -75,7 +74,7 @@ gpt_partition_map_iterate (grub_disk_t disk, if (grub_disk_read (&raw, 1, 0, sizeof (gpt), (char *) &gpt)) return grub_errno; - if (! grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic))) + if (grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic))) return grub_error (GRUB_ERR_BAD_PART_TABLE, "no valid GPT header"); grub_dprintf ("gpt", "Read a valid GPT header\n"); @@ -95,18 +94,17 @@ gpt_partition_map_iterate (grub_disk_t disk, part.len = (grub_le_to_cpu64 (entry.end) - grub_le_to_cpu64 (entry.start) + 1); part.offset = entries; - part.index = partno; + part.index = i; part.partmap = &grub_gpt_partition_map; part.data = &entry; grub_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n", - partno, part.start, part.len); + i, part.start, part.len); if (hook (disk, &part)) return grub_errno; } - partno++; last_offset += grub_le_to_cpu32 (gpt.partentry_size); if (last_offset == GRUB_DISK_SECTOR_SIZE) { From 8a594a17c75a3ffe8b95cc17e82faee7be7064d0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 24 Feb 2008 15:06:30 +0000 Subject: [PATCH 0059/1707] 2008-02-24 Robert Millan * conf/i386-efi.rmk (normal/function.c_DEPENDENCIES) (normal/lexer.c_DEPENDENCIES): New variables. * conf/i386-ieee1275.rmk (normal/function.c_DEPENDENCIES) (normal/lexer.c_DEPENDENCIES): Likewise. * conf/i386-linuxbios.rmk (normal/function.c_DEPENDENCIES) (normal/lexer.c_DEPENDENCIES): Likewise. * conf/i386-pc.rmk (normal/function.c_DEPENDENCIES) (normal/lexer.c_DEPENDENCIES): Likewise. * conf/powerpc-ieee1275.rmk (normal/function.c_DEPENDENCIES) (normal/lexer.c_DEPENDENCIES): Likewise. * conf/sparc64-ieee1275.rmk (normal/function.c_DEPENDENCIES) (normal/lexer.c_DEPENDENCIES): Likewise. --- ChangeLog | 15 +++++++++++++++ conf/i386-efi.mk | 2 ++ conf/i386-efi.rmk | 2 ++ conf/i386-ieee1275.mk | 2 ++ conf/i386-ieee1275.rmk | 2 ++ conf/i386-linuxbios.mk | 2 ++ conf/i386-linuxbios.rmk | 2 ++ conf/i386-pc.mk | 2 ++ conf/i386-pc.rmk | 2 ++ conf/powerpc-ieee1275.mk | 2 ++ conf/powerpc-ieee1275.rmk | 2 ++ conf/sparc64-ieee1275.mk | 2 ++ conf/sparc64-ieee1275.rmk | 2 ++ 13 files changed, 39 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3f8c3b4c1..5ad4e1317 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-02-24 Robert Millan + + * conf/i386-efi.rmk (normal/function.c_DEPENDENCIES) + (normal/lexer.c_DEPENDENCIES): New variables. + * conf/i386-ieee1275.rmk (normal/function.c_DEPENDENCIES) + (normal/lexer.c_DEPENDENCIES): Likewise. + * conf/i386-linuxbios.rmk (normal/function.c_DEPENDENCIES) + (normal/lexer.c_DEPENDENCIES): Likewise. + * conf/i386-pc.rmk (normal/function.c_DEPENDENCIES) + (normal/lexer.c_DEPENDENCIES): Likewise. + * conf/powerpc-ieee1275.rmk (normal/function.c_DEPENDENCIES) + (normal/lexer.c_DEPENDENCIES): Likewise. + * conf/sparc64-ieee1275.rmk (normal/function.c_DEPENDENCIES) + (normal/lexer.c_DEPENDENCIES): Likewise. + 2008-02-23 Robert Millan * partmap/gpt.c (grub_gpt_magic): Add `0x' qualifier to each member, diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index f4bdc69a2..b660be2e0 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -7,6 +7,8 @@ COMMON_LDFLAGS = -melf_i386 -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index ffba6128d..4ca5ef24c 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -7,6 +7,8 @@ COMMON_LDFLAGS = -melf_i386 -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 712da9a97..b2ad54a6c 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -7,6 +7,8 @@ COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.elf diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 01e354879..46b2f44eb 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -7,6 +7,8 @@ COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.elf diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 7c7493a20..da0647268 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -7,6 +7,8 @@ COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.elf diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 5d40cb50e..67d05ec79 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -7,6 +7,8 @@ COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.elf diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index cec315446..4e9361dda 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -9,6 +9,8 @@ COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 1a0e54b9d..587df1bae 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -9,6 +9,8 @@ COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index e4459133c..7bdbac360 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -8,6 +8,8 @@ COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index f631c34a3..f9abb6ad5 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -8,6 +8,8 @@ COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 5198cb730..4ad18dc97 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -8,6 +8,8 @@ COMMON_LDFLAGS = -melf64_sparc -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 1c4d2e864..ff0f4e34e 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -8,6 +8,8 @@ COMMON_LDFLAGS = -melf64_sparc -nostdlib # Used by various components. These rules need to precede them. normal/execute.c_DEPENDENCIES = grub_script.tab.h normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. From 0d16e571f1caface4588bf6ab90c5e457a79ddf7 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 24 Feb 2008 15:34:15 +0000 Subject: [PATCH 0060/1707] 2008-02-24 Bean * fs/iso9660.c (GRUB_ISO9660_VOLDESC_BOOT): New macro. (GRUB_ISO9660_VOLDESC_PRIMARY): Likewise. (GRUB_ISO9660_VOLDESC_SUPP): Likewise. (GRUB_ISO9660_VOLDESC_PART): Likewise. (GRUB_ISO9660_VOLDESC_END): Likewise. (grub_iso9660_primary_voldesc): New member escape. (grub_iso9660_data): New member joliet. (grub_iso9660_convert_string): New function. (grub_iso9660_mount): Detect joliet extension. (grub_iso9660_iterate_dir): Convert filename when joliet is detected. (grub_iso9660_iso9660_label): Likewise. * conf/common.rmk (pkgdata_MODULES): Add udf.mod. (grub_setup_SOURCES): Add fs/udf.c. (grub_fstest_SOURCES): Likewise. (udf_mod_SOURCES): New variable. (udf_mod_CFLAGS): Likewise. (udf_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/udf.c. (grub_emu_SOURCES): Likewise. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * fs/udf.c: New file. --- ChangeLog | 34 ++ conf/common.mk | 82 +++- conf/common.rmk | 11 +- conf/i386-efi.mk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.mk | 14 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-linuxbios.mk | 14 +- conf/i386-linuxbios.rmk | 2 +- conf/i386-pc.mk | 28 +- conf/i386-pc.rmk | 4 +- conf/powerpc-ieee1275.mk | 14 +- conf/powerpc-ieee1275.rmk | 2 +- fs/iso9660.c | 119 +++-- fs/udf.c | 929 ++++++++++++++++++++++++++++++++++++++ 15 files changed, 1185 insertions(+), 74 deletions(-) create mode 100644 fs/udf.c diff --git a/ChangeLog b/ChangeLog index 5ad4e1317..16cc6ed2d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +2008-02-24 Bean + + * fs/iso9660.c (GRUB_ISO9660_VOLDESC_BOOT): New macro. + (GRUB_ISO9660_VOLDESC_PRIMARY): Likewise. + (GRUB_ISO9660_VOLDESC_SUPP): Likewise. + (GRUB_ISO9660_VOLDESC_PART): Likewise. + (GRUB_ISO9660_VOLDESC_END): Likewise. + (grub_iso9660_primary_voldesc): New member escape. + (grub_iso9660_data): New member joliet. + (grub_iso9660_convert_string): New function. + (grub_iso9660_mount): Detect joliet extension. + (grub_iso9660_iterate_dir): Convert filename when joliet is detected. + (grub_iso9660_iso9660_label): Likewise. + + * conf/common.rmk (pkgdata_MODULES): Add udf.mod. + (grub_setup_SOURCES): Add fs/udf.c. + (grub_fstest_SOURCES): Likewise. + (udf_mod_SOURCES): New variable. + (udf_mod_CFLAGS): Likewise. + (udf_mod_LDFLAGS): Likewise. + + * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/udf.c. + (grub_emu_SOURCES): Likewise. + + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + + * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + + * fs/udf.c: New file. + 2008-02-24 Robert Millan * conf/i386-efi.rmk (normal/function.c_DEPENDENCIES) diff --git a/conf/common.mk b/conf/common.mk index c932b21fd..d57ae6133 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -9,18 +9,18 @@ grub_probe_SOURCES = util/grub-probe.c \ kern/parser.c kern/partition.c kern/file.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d +CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -94,6 +94,10 @@ grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_iso9660.d +grub_probe-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_udf.d + grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_jfs.d @@ -175,18 +179,18 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ grub_fstest_init.c -CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -280,6 +284,10 @@ grub_fstest-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_iso9660.d +grub_fstest-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_udf.d + grub_fstest-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_jfs.d @@ -447,7 +455,7 @@ update-grub_DATA += util/grub.d/README # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ - affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod + affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -1281,6 +1289,58 @@ fs-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh cpio_mod_CFLAGS = $(COMMON_CFLAGS) cpio_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For udf.mod. +udf_mod_SOURCES = fs/udf.c +CLEANFILES += udf.mod mod-udf.o mod-udf.c pre-udf.o udf_mod-fs_udf.o und-udf.lst +ifneq ($(udf_mod_EXPORTS),no) +CLEANFILES += def-udf.lst +DEFSYMFILES += def-udf.lst +endif +MOSTLYCLEANFILES += udf_mod-fs_udf.d +UNDSYMFILES += und-udf.lst + +udf.mod: pre-udf.o mod-udf.o + -rm -f $@ + $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-udf.o: $(udf_mod_DEPENDENCIES) udf_mod-fs_udf.o + -rm -f $@ + $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ udf_mod-fs_udf.o + +mod-udf.o: mod-udf.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -c -o $@ $< + +mod-udf.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'udf' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(udf_mod_EXPORTS),no) +def-udf.lst: pre-udf.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 udf/' > $@ +endif + +und-udf.lst: pre-udf.o + echo 'udf' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +udf_mod-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -MD -c -o $@ $< +-include udf_mod-fs_udf.d + +CLEANFILES += cmd-udf_mod-fs_udf.lst fs-udf_mod-fs_udf.lst +COMMANDFILES += cmd-udf_mod-fs_udf.lst +FSFILES += fs-udf_mod-fs_udf.lst + +cmd-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh udf > $@ || (rm -f $@; exit 1) + +fs-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh udf > $@ || (rm -f $@; exit 1) + + +udf_mod_CFLAGS = $(COMMON_CFLAGS) +udf_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Partition maps. pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod diff --git a/conf/common.rmk b/conf/common.rmk index 8c04a5bfc..d99e0531a 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -9,7 +9,7 @@ grub_probe_SOURCES = util/grub-probe.c \ kern/parser.c kern/partition.c kern/file.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -29,7 +29,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -131,7 +131,7 @@ update-grub_DATA += util/grub.d/README # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ - affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod + affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -213,6 +213,11 @@ cpio_mod_SOURCES = fs/cpio.c cpio_mod_CFLAGS = $(COMMON_CFLAGS) cpio_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For udf.mod. +udf_mod_SOURCES = fs/udf.c +udf_mod_CFLAGS = $(COMMON_CFLAGS) +udf_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Partition maps. pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index b660be2e0..23f6cc69c 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -80,7 +80,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 4ca5ef24c..1a18affc8 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -44,7 +44,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index b2ad54a6c..48200f1ed 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -215,7 +215,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -238,11 +238,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -340,6 +340,10 @@ grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_iso9660.d +grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_udf.d + grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_jfs.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 46b2f44eb..f69ea7d77 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -69,7 +69,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index da0647268..1b80fe350 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -201,7 +201,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -224,11 +224,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -318,6 +318,10 @@ grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_iso9660.d +grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_udf.d + grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_jfs.d diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 67d05ec79..51beb9507 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -67,7 +67,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 4e9361dda..2969bf011 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -260,7 +260,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -269,11 +269,11 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ disk/raid.c disk/lvm.c \ util/raid.c util/lvm.c \ grub_setup_init.c -CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d +CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) +grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o + $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(util/i386/pc/grub-setup.c_DEPENDENCIES) $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< @@ -359,6 +359,10 @@ grub_setup-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-fs_iso9660.d +grub_setup-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< +-include grub_setup-fs_udf.d + grub_setup-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-fs_jfs.d @@ -466,7 +470,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/acorn.c partmap/gpt.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -476,11 +480,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -726,6 +730,10 @@ grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_iso9660.d +grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_udf.d + grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_jfs.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 587df1bae..316b05ff3 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -88,7 +88,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -126,7 +126,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/acorn.c partmap/gpt.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 7bdbac360..22d01a639 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -91,7 +91,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ @@ -113,11 +113,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -203,6 +203,10 @@ grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_iso9660.d +grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_udf.d + grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_jfs.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index f9abb6ad5..6432754f9 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -55,7 +55,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/jfs.c fs/minix.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c \ \ diff --git a/fs/iso9660.c b/fs/iso9660.c index 15ce51d26..143585ae7 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -38,6 +38,12 @@ #define GRUB_ISO9660_RR_DOT 2 #define GRUB_ISO9660_RR_DOTDOT 4 +#define GRUB_ISO9660_VOLDESC_BOOT 0 +#define GRUB_ISO9660_VOLDESC_PRIMARY 1 +#define GRUB_ISO9660_VOLDESC_SUPP 2 +#define GRUB_ISO9660_VOLDESC_PART 3 +#define GRUB_ISO9660_VOLDESC_END 255 + /* The head of a volume descriptor. */ struct grub_iso9660_voldesc { @@ -67,11 +73,13 @@ struct grub_iso9660_primary_voldesc struct grub_iso9660_voldesc voldesc; grub_uint8_t unused1[33]; grub_uint8_t volname[32]; - grub_uint8_t unused2[60]; + grub_uint8_t unused2[16]; + grub_uint8_t escape[32]; + grub_uint8_t unused3[12]; grub_uint32_t path_table_size; - grub_uint8_t unused3[4]; + grub_uint8_t unused4[4]; grub_uint32_t path_table; - grub_uint8_t unused4[12]; + grub_uint8_t unused5[12]; struct grub_iso9660_dir rootdir; } __attribute__ ((packed)); @@ -115,6 +123,7 @@ struct grub_iso9660_data unsigned int length; int rockridge; int susp_skip; + int joliet; }; struct grub_fshelp_node @@ -197,6 +206,23 @@ grub_iso9660_susp_iterate (struct grub_iso9660_data *data, return 0; } +static char * +grub_iso9660_convert_string (grub_uint16_t *us, int len) +{ + char *p; + int i; + + p = grub_malloc (len * 4 + 1); + if (! p) + return p; + + for (i=0; ivoldesc)) - { - grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem"); - goto fail; - } - - if (grub_strncmp ((char *) data->voldesc.voldesc.magic, "CD001", 5) != 0) - { - grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem"); - goto fail; - } - data->disk = disk; data->rockridge = 0; - + data->joliet = 0; + + block = 16; + do + { + int copy_voldesc = 0; + + /* Read the superblock. */ + if (grub_disk_read (disk, block << GRUB_ISO9660_LOG2_BLKSZ, 0, + sizeof (struct grub_iso9660_primary_voldesc), + (char *) &voldesc)) + { + grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem"); + goto fail; + } + + if (grub_strncmp ((char *) voldesc.voldesc.magic, "CD001", 5) != 0) + { + grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem"); + goto fail; + } + + if (voldesc.voldesc.type == GRUB_ISO9660_VOLDESC_PRIMARY) + copy_voldesc = 1; + else if ((voldesc.voldesc.type == GRUB_ISO9660_VOLDESC_SUPP) && + (voldesc.escape[0] == 0x25) && (voldesc.escape[1] == 0x2f) && + ((voldesc.escape[2] == 0x40) || /* UCS-2 Level 1. */ + (voldesc.escape[2] == 0x43) || /* UCS-2 Level 2. */ + (voldesc.escape[2] == 0x45))) /* UCS-2 Level 3. */ + { + copy_voldesc = 1; + data->joliet = 1; + } + + if (copy_voldesc) + grub_memcpy((char *) &data->voldesc, (char *) &voldesc, + sizeof (struct grub_iso9660_primary_voldesc)); + + block++; + } while (voldesc.voldesc.type != GRUB_ISO9660_VOLDESC_END); + /* Read the system use area and test it to see if SUSP is supported. */ if (grub_disk_read (disk, (grub_le_to_cpu32 (data->voldesc.rootdir.first_sector) @@ -254,14 +307,6 @@ grub_iso9660_mount (grub_disk_t disk) goto fail; } - if (grub_disk_read (disk, (grub_le_to_cpu32 (data->voldesc.rootdir.first_sector) - << GRUB_ISO9660_LOG2_BLKSZ), 0, - sizeof (rootdir), (char *) &rootdir)) - { - grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem"); - goto fail; - } - sua_pos = (sizeof (rootdir) + rootdir.namelen + (rootdir.namelen % 2) - 1); sua_size = rootdir.len - sua_pos; @@ -572,6 +617,20 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, filename = name; } + if (dir->data->joliet) + { + char *oldname; + + oldname = filename; + filename = grub_iso9660_convert_string + ((grub_uint16_t *) oldname, dirent.namelen >> 1); + + if (filename_alloc) + grub_free (oldname); + + filename_alloc = 1; + } + if (hook (filename, type, node)) { if (filename_alloc) @@ -740,7 +799,11 @@ grub_iso9660_label (grub_device_t device, char **label) if (data) { - *label = grub_strndup ((char *) data->voldesc.volname, 32); + if (data->joliet) + *label = grub_iso9660_convert_string + ((grub_uint16_t *) &data->voldesc.volname, 16); + else + *label = grub_strndup ((char *) data->voldesc.volname, 32); grub_free (data); } else diff --git a/fs/udf.c b/fs/udf.c new file mode 100644 index 000000000..e07d9624e --- /dev/null +++ b/fs/udf.c @@ -0,0 +1,929 @@ +/* udf.c - Universal Disk Format filesystem. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define GRUB_UDF_MAX_PDS 2 +#define GRUB_UDF_MAX_PMS 6 + +#define U16 grub_le_to_cpu16 +#define U32 grub_le_to_cpu32 +#define U64 grub_le_to_cpu64 + +#define GRUB_UDF_LOG2_BLKSZ 2 +#define GRUB_UDF_BLKSZ 2048 + +#define GRUB_UDF_TAG_IDENT_PVD 0x0001 +#define GRUB_UDF_TAG_IDENT_AVDP 0x0002 +#define GRUB_UDF_TAG_IDENT_VDP 0x0003 +#define GRUB_UDF_TAG_IDENT_IUVD 0x0004 +#define GRUB_UDF_TAG_IDENT_PD 0x0005 +#define GRUB_UDF_TAG_IDENT_LVD 0x0006 +#define GRUB_UDF_TAG_IDENT_USD 0x0007 +#define GRUB_UDF_TAG_IDENT_TD 0x0008 +#define GRUB_UDF_TAG_IDENT_LVID 0x0009 + +#define GRUB_UDF_TAG_IDENT_FSD 0x0100 +#define GRUB_UDF_TAG_IDENT_FID 0x0101 +#define GRUB_UDF_TAG_IDENT_AED 0x0102 +#define GRUB_UDF_TAG_IDENT_IE 0x0103 +#define GRUB_UDF_TAG_IDENT_TE 0x0104 +#define GRUB_UDF_TAG_IDENT_FE 0x0105 +#define GRUB_UDF_TAG_IDENT_EAHD 0x0106 +#define GRUB_UDF_TAG_IDENT_USE 0x0107 +#define GRUB_UDF_TAG_IDENT_SBD 0x0108 +#define GRUB_UDF_TAG_IDENT_PIE 0x0109 +#define GRUB_UDF_TAG_IDENT_EFE 0x010A + +#define GRUB_UDF_ICBTAG_TYPE_UNDEF 0x00 +#define GRUB_UDF_ICBTAG_TYPE_USE 0x01 +#define GRUB_UDF_ICBTAG_TYPE_PIE 0x02 +#define GRUB_UDF_ICBTAG_TYPE_IE 0x03 +#define GRUB_UDF_ICBTAG_TYPE_DIRECTORY 0x04 +#define GRUB_UDF_ICBTAG_TYPE_REGULAR 0x05 +#define GRUB_UDF_ICBTAG_TYPE_BLOCK 0x06 +#define GRUB_UDF_ICBTAG_TYPE_CHAR 0x07 +#define GRUB_UDF_ICBTAG_TYPE_EA 0x08 +#define GRUB_UDF_ICBTAG_TYPE_FIFO 0x09 +#define GRUB_UDF_ICBTAG_TYPE_SOCKET 0x0A +#define GRUB_UDF_ICBTAG_TYPE_TE 0x0B +#define GRUB_UDF_ICBTAG_TYPE_SYMLINK 0x0C +#define GRUB_UDF_ICBTAG_TYPE_STREAMDIR 0x0D + +#define GRUB_UDF_ICBTAG_FLAG_AD_MASK 0x0007 +#define GRUB_UDF_ICBTAG_FLAG_AD_SHORT 0x0000 +#define GRUB_UDF_ICBTAG_FLAG_AD_LONG 0x0001 +#define GRUB_UDF_ICBTAG_FLAG_AD_EXT 0x0002 +#define GRUB_UDF_ICBTAG_FLAG_AD_IN_ICB 0x0003 + +#define GRUB_UDF_EXT_NORMAL 0x00000000 +#define GRUB_UDF_EXT_NREC_ALLOC 0x40000000 +#define GRUB_UDF_EXT_NREC_NALLOC 0x80000000 +#define GRUB_UDF_EXT_MASK 0xC0000000 + +#define GRUB_UDF_FID_CHAR_HIDDEN 0x01 +#define GRUB_UDF_FID_CHAR_DIRECTORY 0x02 +#define GRUB_UDF_FID_CHAR_DELETED 0x04 +#define GRUB_UDF_FID_CHAR_PARENT 0x08 +#define GRUB_UDF_FID_CHAR_METADATA 0x10 + +#define GRUB_UDF_STD_IDENT_BEA01 "BEA01" +#define GRUB_UDF_STD_IDENT_BOOT2 "BOOT2" +#define GRUB_UDF_STD_IDENT_CD001 "CD001" +#define GRUB_UDF_STD_IDENT_CDW02 "CDW02" +#define GRUB_UDF_STD_IDENT_NSR02 "NSR02" +#define GRUB_UDF_STD_IDENT_NSR03 "NSR03" +#define GRUB_UDF_STD_IDENT_TEA01 "TEA01" + +#define GRUB_UDF_CHARSPEC_TYPE_CS0 0x00 +#define GRUB_UDF_CHARSPEC_TYPE_CS1 0x01 +#define GRUB_UDF_CHARSPEC_TYPE_CS2 0x02 +#define GRUB_UDF_CHARSPEC_TYPE_CS3 0x03 +#define GRUB_UDF_CHARSPEC_TYPE_CS4 0x04 +#define GRUB_UDF_CHARSPEC_TYPE_CS5 0x05 +#define GRUB_UDF_CHARSPEC_TYPE_CS6 0x06 +#define GRUB_UDF_CHARSPEC_TYPE_CS7 0x07 +#define GRUB_UDF_CHARSPEC_TYPE_CS8 0x08 + +#define GRUB_UDF_PARTMAP_TYPE_1 1 +#define GRUB_UDF_PARTMAP_TYPE_2 2 + +struct grub_udf_lb_addr +{ + grub_uint32_t block_num; + grub_uint16_t part_ref; +} __attribute__ ((packed)); + +struct grub_udf_short_ad +{ + grub_uint32_t length; + grub_uint32_t position; +} __attribute__ ((packed)); + +struct grub_udf_long_ad +{ + grub_uint32_t length; + struct grub_udf_lb_addr block; + grub_uint8_t imp_use[6]; +} __attribute__ ((packed)); + +struct grub_udf_extent_ad +{ + grub_uint32_t length; + grub_uint32_t start; +} __attribute__ ((packed)); + +struct grub_udf_charspec +{ + grub_uint8_t charset_type; + grub_uint8_t charset_info[63]; +} __attribute__ ((packed)); + +struct grub_udf_timestamp +{ + grub_uint16_t type_and_timezone; + grub_uint16_t year; + grub_uint8_t month; + grub_uint8_t day; + grub_uint8_t hour; + grub_uint8_t minute; + grub_uint8_t second; + grub_uint8_t centi_seconds; + grub_uint8_t hundreds_of_micro_seconds; + grub_uint8_t micro_seconds; +} __attribute__ ((packed)); + +struct grub_udf_regid +{ + grub_uint8_t flags; + grub_uint8_t ident[23]; + grub_uint8_t ident_suffix[8]; +} __attribute__ ((packed)); + +struct grub_udf_tag +{ + grub_uint16_t tag_ident; + grub_uint16_t desc_version; + grub_uint8_t tag_checksum; + grub_uint8_t reserved; + grub_uint16_t tag_serial_number; + grub_uint16_t desc_crc; + grub_uint16_t desc_crc_length; + grub_uint32_t tag_location; +} __attribute__ ((packed)); + +struct grub_udf_fileset +{ + struct grub_udf_tag tag; + struct grub_udf_timestamp datetime; + grub_uint16_t interchange_level; + grub_uint16_t max_interchange_level; + grub_uint32_t charset_list; + grub_uint32_t max_charset_list; + grub_uint32_t fileset_num; + grub_uint32_t fileset_desc_num; + struct grub_udf_charspec vol_charset; + grub_uint8_t vol_ident[128]; + struct grub_udf_charspec fileset_charset; + grub_uint8_t fileset_ident[32]; + grub_uint8_t copyright_file_ident[32]; + grub_uint8_t abstract_file_ident[32]; + struct grub_udf_long_ad root_icb; + struct grub_udf_regid domain_ident; + struct grub_udf_long_ad next_ext; + struct grub_udf_long_ad streamdir_icb; +} __attribute__ ((packed)); + +struct grub_udf_icbtag +{ + grub_uint32_t prior_recorded_num_direct_entries; + grub_uint16_t strategy_type; + grub_uint16_t strategy_parameter; + grub_uint16_t num_entries; + grub_uint8_t reserved; + grub_uint8_t file_type; + struct grub_udf_lb_addr parent_idb; + grub_uint16_t flags; +} __attribute__ ((packed)); + +struct grub_udf_file_ident +{ + struct grub_udf_tag tag; + grub_uint16_t version_num; + grub_uint8_t characteristics; + grub_uint8_t file_ident_length; + struct grub_udf_long_ad icb; + grub_uint16_t imp_use_length; +} __attribute__ ((packed)); + +struct grub_udf_file_entry +{ + struct grub_udf_tag tag; + struct grub_udf_icbtag icbtag; + grub_uint32_t uid; + grub_uint32_t gid; + grub_uint32_t permissions; + grub_uint16_t link_count; + grub_uint8_t record_format; + grub_uint8_t record_display_attr; + grub_uint32_t record_length; + grub_uint64_t file_size; + grub_uint64_t blocks_recorded; + struct grub_udf_timestamp access_time; + struct grub_udf_timestamp modification_time; + struct grub_udf_timestamp attr_time; + grub_uint32_t checkpoint; + struct grub_udf_long_ad extended_attr_idb; + struct grub_udf_regid imp_ident; + grub_uint64_t unique_id; + grub_uint32_t ext_attr_length; + grub_uint32_t alloc_descs_length; + grub_uint8_t ext_attr[1872]; +} __attribute__ ((packed)); + +struct grub_udf_extended_file_entry +{ + struct grub_udf_tag tag; + struct grub_udf_icbtag icbtag; + grub_uint32_t uid; + grub_uint32_t gid; + grub_uint32_t permissions; + grub_uint16_t link_count; + grub_uint8_t record_format; + grub_uint8_t record_display_attr; + grub_uint32_t record_length; + grub_uint64_t file_size; + grub_uint64_t object_size; + grub_uint64_t blocks_recorded; + struct grub_udf_timestamp access_time; + struct grub_udf_timestamp modification_time; + struct grub_udf_timestamp create_time; + struct grub_udf_timestamp attr_time; + grub_uint32_t checkpoint; + grub_uint32_t reserved; + struct grub_udf_long_ad extended_attr_icb; + struct grub_udf_long_ad streamdir_icb; + struct grub_udf_regid imp_ident; + grub_uint64_t unique_id; + grub_uint32_t ext_attr_length; + grub_uint32_t alloc_descs_length; + grub_uint8_t ext_attr[1832]; +} __attribute__ ((packed)); + +struct grub_udf_vrs +{ + grub_uint8_t type; + grub_uint8_t magic[5]; + grub_uint8_t version; +} __attribute__ ((packed)); + +struct grub_udf_avdp +{ + struct grub_udf_tag tag; + struct grub_udf_extent_ad vds; +} __attribute__ ((packed)); + +struct grub_udf_pd +{ + struct grub_udf_tag tag; + grub_uint32_t seq_num; + grub_uint16_t flags; + grub_uint16_t part_num; + struct grub_udf_regid contents; + grub_uint8_t contents_use[128]; + grub_uint32_t access_type; + grub_uint32_t start; + grub_uint32_t length; +} __attribute__ ((packed)); + +struct grub_udf_partmap +{ + grub_uint8_t type; + grub_uint8_t length; + union + { + struct + { + grub_uint16_t seq_num; + grub_uint16_t part_num; + } type1; + + struct + { + grub_uint8_t ident[62]; + } type2; + }; +}; + +struct grub_udf_lvd +{ + struct grub_udf_tag tag; + grub_uint32_t seq_num; + struct grub_udf_charspec charset; + grub_uint8_t ident[128]; + grub_uint32_t bsize; + struct grub_udf_regid domain_ident; + struct grub_udf_long_ad root_fileset; + grub_uint32_t map_table_length; + grub_uint32_t num_part_maps; + struct grub_udf_regid imp_ident; + grub_uint8_t imp_use[128]; + struct grub_udf_extent_ad integrity_seq_ext; + grub_uint8_t part_maps[1608]; +} __attribute__ ((packed)); + +struct grub_udf_data +{ + grub_disk_t disk; + struct grub_udf_lvd lvd; + struct grub_udf_pd pds[GRUB_UDF_MAX_PDS]; + struct grub_udf_partmap *pms[GRUB_UDF_MAX_PMS]; + struct grub_udf_long_ad root_icb; + int npd, npm; +}; + +struct grub_fshelp_node +{ + struct grub_udf_data *data; + union + { + struct grub_udf_file_entry fe; + struct grub_udf_extended_file_entry efe; + }; + int part_ref; +}; + +#ifndef GRUB_UTIL +static grub_dl_t my_mod; +#endif + +static grub_uint32_t +grub_udf_get_block (struct grub_udf_data *data, + grub_uint16_t part_ref, grub_uint32_t block) +{ + part_ref = U16 (part_ref); + + if (part_ref >= data->npm) + { + grub_error (GRUB_ERR_BAD_FS, "invalid part ref"); + return 0; + } + + return (U32 (data->pds[data->pms[part_ref]->type1.part_num].start) + + U32 (block)); +} + +static grub_err_t +grub_udf_read_icb (struct grub_udf_data *data, + struct grub_udf_long_ad *icb, + struct grub_fshelp_node *node) +{ + grub_uint32_t block; + + block = grub_udf_get_block (data, + icb->block.part_ref, + icb->block.block_num); + + if (grub_errno) + return grub_errno; + + if (grub_disk_read (data->disk, block << GRUB_UDF_LOG2_BLKSZ, 0, + sizeof (struct grub_udf_file_entry), + (char *) &node->fe)) + return grub_errno; + + if ((U16 (node->fe.tag.tag_ident) != GRUB_UDF_TAG_IDENT_FE) && + (U16 (node->fe.tag.tag_ident) != GRUB_UDF_TAG_IDENT_EFE)) + return grub_error (GRUB_ERR_BAD_FS, "invalid fe/efe descriptor"); + + node->part_ref = icb->block.part_ref; + node->data = data; + return 0; +} + +static int +grub_udf_read_block (grub_fshelp_node_t node, int fileblock) +{ + char *ptr; + int len; + + if (U16 (node->fe.tag.tag_ident) == GRUB_UDF_TAG_IDENT_FE) + { + ptr = (char *) &node->fe.ext_attr[0] + U32 (node->fe.ext_attr_length); + len = U32 (node->fe.alloc_descs_length); + } + else + { + ptr = (char *) &node->efe.ext_attr[0] + U32 (node->efe.ext_attr_length); + len = U32 (node->efe.alloc_descs_length); + } + + if ((U16 (node->fe.icbtag.flags) & GRUB_UDF_ICBTAG_FLAG_AD_MASK) + == GRUB_UDF_ICBTAG_FLAG_AD_SHORT) + { + struct grub_udf_short_ad *ad = (struct grub_udf_short_ad *) ptr; + + len /= sizeof (struct grub_udf_short_ad); + while (len > 0) + { + if (fileblock < (int) U32 (ad->length)) + return ((U32 (ad->position) & GRUB_UDF_EXT_MASK) ? 0 : + (grub_udf_get_block (node->data, + node->part_ref, + ad->position) + + fileblock)); + + fileblock -= U32 (ad->length); + ad++; + len--; + } + } + else + { + struct grub_udf_long_ad *ad = (struct grub_udf_long_ad *) ptr; + + len /= sizeof (struct grub_udf_long_ad); + while (len > 0) + { + if (fileblock < (int) U32 (ad->length)) + return ((U32 (ad->block.block_num) & GRUB_UDF_EXT_MASK) ? 0 : + (grub_udf_get_block (node->data, + ad->block.part_ref, + ad->block.block_num) + + fileblock)); + + fileblock -= U32 (ad->length); + ad++; + len--; + } + } + + return 0; +} + +static grub_ssize_t +grub_udf_read_file (grub_fshelp_node_t node, + void NESTED_FUNC_ATTR + (*read_hook) (grub_disk_addr_t sector, + unsigned offset, unsigned length), + int pos, grub_size_t len, char *buf) +{ + switch (U16 (node->fe.icbtag.flags) & GRUB_UDF_ICBTAG_FLAG_AD_MASK) + { + case GRUB_UDF_ICBTAG_FLAG_AD_IN_ICB: + { + char *ptr; + + ptr = ((U16 (node->fe.tag.tag_ident) == GRUB_UDF_TAG_IDENT_FE) ? + ((char *) &node->fe.ext_attr[0] + + U32 (node->fe.ext_attr_length)) : + ((char *) &node->efe.ext_attr[0] + + U32 (node->efe.ext_attr_length))); + + grub_memcpy (buf, ptr + pos, len); + + return len; + } + + case GRUB_UDF_ICBTAG_FLAG_AD_EXT: + grub_error (GRUB_ERR_BAD_FS, "invalid extent type"); + return 0; + } + + return grub_fshelp_read_file (node->data->disk, node, read_hook, + pos, len, buf, grub_udf_read_block, + U64 (node->fe.file_size), + GRUB_UDF_LOG2_BLKSZ); +} + +static int sblocklist[] = { 256, 512, 0 }; + +static struct grub_udf_data * +grub_udf_mount (grub_disk_t disk) +{ + struct grub_udf_data *data = 0; + struct grub_udf_fileset root_fs; + int *sblklist = sblocklist; + grub_uint32_t block; + int i; + + data = grub_malloc (sizeof (struct grub_udf_data)); + if (!data) + return 0; + + data->disk = disk; + + /* Search for Volume Recognition Sequence (VRS). */ + for (block = 16;; block++) + { + struct grub_udf_vrs vrs; + + if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, + sizeof (struct grub_udf_vrs), (char *) &vrs)) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + + if ((!grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_NSR03, 5)) || + (!grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_NSR02, 5))) + break; + + if ((grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_BEA01, 5)) && + (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_BOOT2, 5)) && + (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_CD001, 5)) && + (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_CDW02, 5)) && + (grub_memcmp (vrs.magic, GRUB_UDF_STD_IDENT_TEA01, 5))) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + } + + /* Search for Anchor Volume Descriptor Pointer (AVDP). */ + while (1) + { + struct grub_udf_avdp avdp; + + if (grub_disk_read (disk, *sblklist << GRUB_UDF_LOG2_BLKSZ, 0, + sizeof (struct grub_udf_avdp), (char *) &avdp)) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + + if (U16 (avdp.tag.tag_ident) == GRUB_UDF_TAG_IDENT_AVDP) + { + block = U32 (avdp.vds.start); + break; + } + + sblklist++; + if (*sblklist == 0) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + } + + data->npd = data->npm = 0; + /* Locate Partiton Descriptor (PD) and Logical Volume Descriptor (LVD). */ + while (1) + { + struct grub_udf_tag tag; + + if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, + sizeof (struct grub_udf_tag), (char *) &tag)) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + + tag.tag_ident = U16 (tag.tag_ident); + if (tag.tag_ident == GRUB_UDF_TAG_IDENT_PD) + { + if (data->npd >= GRUB_UDF_MAX_PDS) + { + grub_error (GRUB_ERR_BAD_FS, "too many PDs"); + goto fail; + } + + if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, + sizeof (struct grub_udf_pd), + (char *) &data->pds[data->npd])) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + + data->npd++; + } + else if (tag.tag_ident == GRUB_UDF_TAG_IDENT_LVD) + { + int i; + + struct grub_udf_partmap *ppm; + + if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, + sizeof (struct grub_udf_lvd), + (char *) &data->lvd)) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + + if (data->npm + U32 (data->lvd.num_part_maps) > GRUB_UDF_MAX_PMS) + { + grub_error (GRUB_ERR_BAD_FS, "too many partition maps"); + goto fail; + } + + ppm = (struct grub_udf_partmap *) &data->lvd.part_maps; + for (i = U32 (data->lvd.num_part_maps); i > 0; i--) + { + if (ppm->type != GRUB_UDF_PARTMAP_TYPE_1) + { + grub_error (GRUB_ERR_BAD_FS, "partmap type not supported"); + goto fail; + } + + data->pms[data->npm++] = ppm; + ppm = (struct grub_udf_partmap *) ((char *) ppm + + U32 (ppm->length)); + } + } + else if (tag.tag_ident > GRUB_UDF_TAG_IDENT_TD) + { + grub_error (GRUB_ERR_BAD_FS, "invalid tag ident"); + goto fail; + } + else if (tag.tag_ident == GRUB_UDF_TAG_IDENT_TD) + break; + + block++; + } + + for (i = 0; i < data->npm; i++) + { + int j; + + for (j = 0; j < data->npd; j++) + if (data->pms[i]->type1.part_num == data->pds[j].part_num) + { + data->pms[i]->type1.part_num = j; + break; + } + + if (j == data->npd) + { + grub_error (GRUB_ERR_BAD_FS, "can\'t find PD"); + goto fail; + } + } + + block = grub_udf_get_block (data, + data->lvd.root_fileset.block.part_ref, + data->lvd.root_fileset.block.block_num); + + if (grub_errno) + goto fail; + + if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, + sizeof (struct grub_udf_fileset), (char *) &root_fs)) + { + grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); + goto fail; + } + + if (U16 (root_fs.tag.tag_ident) != GRUB_UDF_TAG_IDENT_FSD) + { + grub_error (GRUB_ERR_BAD_FS, "invalid fileset descriptor"); + goto fail; + } + + data->root_icb = root_fs.root_icb; + + return data; + +fail: + grub_free (data); + return 0; +} + +static int +grub_udf_iterate_dir (grub_fshelp_node_t dir, + int NESTED_FUNC_ATTR + (*hook) (const char *filename, + enum grub_fshelp_filetype filetype, + grub_fshelp_node_t node)) +{ + grub_fshelp_node_t child; + struct grub_udf_file_ident dirent; + grub_uint32_t offset = 0; + + child = grub_malloc (sizeof (struct grub_fshelp_node)); + if (!child) + return 0; + + /* The current directory is not stored. */ + grub_memcpy ((char *) child, (char *) dir, + sizeof (struct grub_fshelp_node)); + + if (hook (".", GRUB_FSHELP_DIR, child)) + return 1; + + while (offset < U64 (dir->fe.file_size)) + { + if (grub_udf_read_file (dir, 0, offset, sizeof (dirent), + (char *) &dirent) != sizeof (dirent)) + return 0; + + if (U16 (dirent.tag.tag_ident) != GRUB_UDF_TAG_IDENT_FID) + { + grub_error (GRUB_ERR_BAD_FS, "invalid fid tag"); + return 0; + } + + child = grub_malloc (sizeof (struct grub_fshelp_node)); + if (!child) + return 0; + + if (grub_udf_read_icb (dir->data, &dirent.icb, child)) + return 0; + + offset += sizeof (dirent) + U16 (dirent.imp_use_length); + if (dirent.characteristics & GRUB_UDF_FID_CHAR_PARENT) + { + /* This is the parent directory. */ + if (hook ("..", GRUB_FSHELP_DIR, child)) + return 1; + } + else + { + enum grub_fshelp_filetype type; + char filename[dirent.file_ident_length + 1]; + + type = ((dirent.characteristics & GRUB_UDF_FID_CHAR_DIRECTORY) ? + (GRUB_FSHELP_DIR) : (GRUB_FSHELP_REG)); + + if ((grub_udf_read_file (dir, 0, offset, + dirent.file_ident_length, filename)) + != dirent.file_ident_length) + return 0; + + filename[dirent.file_ident_length] = 0; + if (hook (&filename[1], type, child)) + return 1; + } + + /* Align to dword boundary. */ + offset = (offset + dirent.file_ident_length + 3) & (~3); + } + + return 0; +} + +static grub_err_t +grub_udf_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, int dir)) +{ + struct grub_udf_data *data = 0; + struct grub_fshelp_node rootnode; + struct grub_fshelp_node *foundnode; + + auto int NESTED_FUNC_ATTR iterate (const char *filename, + enum grub_fshelp_filetype filetype, + grub_fshelp_node_t node); + + int NESTED_FUNC_ATTR iterate (const char *filename, + enum grub_fshelp_filetype filetype, + grub_fshelp_node_t node) + { + grub_free (node); + + if (filetype == GRUB_FSHELP_DIR) + return hook (filename, 1); + else + return hook (filename, 0); + + return 0; + } + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_udf_mount (device->disk); + if (!data) + goto fail; + + if (grub_udf_read_icb (data, &data->root_icb, &rootnode)) + goto fail; + + if (grub_fshelp_find_file (path, &rootnode, + &foundnode, + grub_udf_iterate_dir, 0, GRUB_FSHELP_DIR)) + goto fail; + + grub_udf_iterate_dir (foundnode, iterate); + + if (foundnode != &rootnode) + grub_free (foundnode); + +fail: + grub_free (data); + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + return grub_errno; +} + +static grub_err_t +grub_udf_open (struct grub_file *file, const char *name) +{ + struct grub_udf_data *data; + struct grub_fshelp_node rootnode; + struct grub_fshelp_node *foundnode; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_udf_mount (file->device->disk); + if (!data) + goto fail; + + if (grub_udf_read_icb (data, &data->root_icb, &rootnode)) + goto fail; + + if (grub_fshelp_find_file (name, &rootnode, + &foundnode, + grub_udf_iterate_dir, 0, GRUB_FSHELP_REG)) + goto fail; + + file->data = foundnode; + file->offset = 0; + file->size = U64 (foundnode->fe.file_size); + + return 0; + +fail: +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + +static grub_ssize_t +grub_udf_read (grub_file_t file, char *buf, grub_size_t len) +{ + struct grub_fshelp_node *node = (struct grub_fshelp_node *) file->data; + + return grub_udf_read_file (node, file->read_hook, file->offset, len, buf); +} + +static grub_err_t +grub_udf_close (grub_file_t file) +{ + if (file->data) + { + struct grub_fshelp_node *node = (struct grub_fshelp_node *) file->data; + + grub_free (node->data); + grub_free (node); + } + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_udf_label (grub_device_t device, char **label) +{ + struct grub_udf_data *data; + data = grub_udf_mount (device->disk); + + if (data) + { + *label = grub_strdup ((char *) &data->lvd.ident[1]); + grub_free (data); + } + else + *label = 0; + + return grub_errno; +} + +static struct grub_fs grub_udf_fs = { + .name = "udf", + .dir = grub_udf_dir, + .open = grub_udf_open, + .read = grub_udf_read, + .close = grub_udf_close, + .label = grub_udf_label, + .next = 0 +}; + +GRUB_MOD_INIT (udf) +{ + grub_fs_register (&grub_udf_fs); +#ifndef GRUB_UTIL + my_mod = mod; +#endif +} + +GRUB_MOD_FINI (udf) +{ + grub_fs_unregister (&grub_udf_fs); +} From 79ca2d78d4101857c62f69fc77f51da25c818cd2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 28 Feb 2008 10:11:06 +0000 Subject: [PATCH 0061/1707] 2008-02-28 Fabian Greffrath * include/grub/util/getroot.h (grub_util_check_block_device): Export new function. * util/getroot.c (grub_util_check_block_device): New function that returns the given argument if it is a block device and returns NULL else. * util/grub-probe.c (argument_is_device): New variable. (probe): Promote device_name from a variable to an argument. Receive device_name from grub_util_check_block_device() if path is NULL and from grub_guess_root_device() else. Do not free() device_name anymore. (options): Introduce new parameter '-d, --device'. (main): Add description of the new parameter to the help screen. Rename path variable to argument. Set argument_is_device if the '-d' option is given. Pass argument to probe() depending on argument_is_device. --- ChangeLog | 16 +++++++++++++++ include/grub/util/getroot.h | 1 + util/getroot.c | 14 +++++++++++++ util/grub-probe.c | 39 +++++++++++++++++++++++++------------ 4 files changed, 58 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 16cc6ed2d..f0dee54e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-02-28 Fabian Greffrath + + * include/grub/util/getroot.h (grub_util_check_block_device): Export new + function. + * util/getroot.c (grub_util_check_block_device): New function that + returns the given argument if it is a block device and returns NULL else. + * util/grub-probe.c (argument_is_device): New variable. + (probe): Promote device_name from a variable to an argument. Receive + device_name from grub_util_check_block_device() if path is NULL and from + grub_guess_root_device() else. Do not free() device_name anymore. + (options): Introduce new parameter '-d, --device'. + (main): Add description of the new parameter to the help screen. + Rename path variable to argument. Set argument_is_device if the '-d' + option is given. Pass argument to probe() depending on + argument_is_device. + 2008-02-24 Bean * fs/iso9660.c (GRUB_ISO9660_VOLDESC_BOOT): New macro. diff --git a/include/grub/util/getroot.h b/include/grub/util/getroot.h index 45b66880b..0d78538df 100644 --- a/include/grub/util/getroot.h +++ b/include/grub/util/getroot.h @@ -29,5 +29,6 @@ char *grub_guess_root_device (const char *dir); char *grub_get_prefix (const char *dir); int grub_util_get_dev_abstraction (const char *os_dev); char *grub_util_get_grub_dev (const char *os_dev); +char *grub_util_check_block_device (const char *blk_dev); #endif /* ! GRUB_UTIL_GETROOT_HEADER */ diff --git a/util/getroot.c b/util/getroot.c index a591dc81f..0c4b376e7 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -332,3 +332,17 @@ grub_util_get_grub_dev (const char *os_dev) return grub_dev; } + +char * +grub_util_check_block_device (const char *blk_dev) +{ + struct stat st; + + if (stat (blk_dev, &st) < 0) + grub_util_error ("Cannot stat `%s'", blk_dev); + + if (S_ISBLK (st.st_mode)) + return (blk_dev); + else + return 0; +} diff --git a/util/grub-probe.c b/util/grub-probe.c index 3635d74a4..dabd76822 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -50,6 +50,7 @@ enum { }; int print = PRINT_FS; +static unsigned int argument_is_device = 0; void grub_putchar (int c) @@ -100,16 +101,22 @@ probe_partmap (grub_disk_t disk) } static void -probe (const char *path) +probe (const char *path, char *device_name) { - char *device_name; char *drive_name = NULL; char *grub_path = NULL; char *filebuf_via_grub = NULL, *filebuf_via_sys = NULL; int abstraction_type; grub_device_t dev = NULL; - device_name = grub_guess_root_device (path); + if (path == NULL) + { + if (! grub_util_check_block_device (device_name)) + grub_util_error ("%s is not a block device.\n", device_name); + } + else + device_name = grub_guess_root_device (path); + if (! device_name) grub_util_error ("cannot find a device for %s.\n", path); @@ -220,12 +227,12 @@ probe (const char *path) free (grub_path); free (filebuf_via_grub); free (filebuf_via_sys); - free (device_name); free (drive_name); } static struct option options[] = { + {"device", no_argument, 0, 'd'}, {"device-map", required_argument, 0, 'm'}, {"target", required_argument, 0, 't'}, {"help", no_argument, 0, 'h'}, @@ -242,10 +249,11 @@ usage (int status) "Try ``grub-probe --help'' for more information.\n"); else printf ("\ -Usage: grub-probe [OPTION]... PATH\n\ +Usage: grub-probe [OPTION]... [PATH|DEVICE]\n\ \n\ -Probe device information for a given path.\n\ +Probe device information for a given path (or device, if the -d option is given).\n\ \n\ + -d, --device given argument is a system device, not a path\n\ -m, --device-map=FILE use FILE as the device map [default=%s]\n\ -t, --target=(fs|drive|device|partmap|abstraction)\n\ print filesystem module, GRUB drive, system device, partition map module or abstraction module [default=fs]\n\ @@ -264,20 +272,24 @@ int main (int argc, char *argv[]) { char *dev_map = 0; - char *path; + char *argument; progname = "grub-probe"; /* Check for options. */ while (1) { - int c = getopt_long (argc, argv, "m:t:hVv", options, 0); + int c = getopt_long (argc, argv, "dm:t:hVv", options, 0); if (c == -1) break; else switch (c) { + case 'd': + argument_is_device = 1; + break; + case 'm': if (dev_map) free (dev_map); @@ -321,10 +333,10 @@ main (int argc, char *argv[]) if (verbosity > 1) grub_env_set ("debug", "all"); - /* Obtain PATH. */ + /* Obtain ARGUMENT. */ if (optind >= argc) { - fprintf (stderr, "No path is specified.\n"); + fprintf (stderr, "No path or device is specified.\n"); usage (1); } @@ -334,7 +346,7 @@ main (int argc, char *argv[]) usage (1); } - path = argv[optind]; + argument = argv[optind]; /* Initialize the emulated biosdisk driver. */ grub_util_biosdisk_init (dev_map ? : DEFAULT_DEVICE_MAP); @@ -343,7 +355,10 @@ main (int argc, char *argv[]) grub_init_all (); /* Do it. */ - probe (path); + if (argument_is_device) + probe (NULL, argument); + else + probe (argument, NULL); /* Free resources. */ grub_fini_all (); From b00ab6967e89f3a59cdc1e76bcb315b7f92bbb46 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 28 Feb 2008 10:39:42 +0000 Subject: [PATCH 0062/1707] 2008-02-28 Robert Millan * util/update-grub.in: Reorganise terminal validity check. Accept `ieee1275:console' (OLPC) and `*:gfxterm' as valid too. Based on suggestion by Franklin PIAT. --- ChangeLog | 6 ++++++ util/update-grub.in | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0dee54e2..13da46b54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-02-28 Robert Millan + + * util/update-grub.in: Reorganise terminal validity check. Accept + `ieee1275:console' (OLPC) and `*:gfxterm' as valid too. + Based on suggestion by Franklin PIAT. + 2008-02-28 Fabian Greffrath * include/grub/util/getroot.h (grub_util_check_block_device): Export new diff --git a/util/update-grub.in b/util/update-grub.in index b4bb6058d..77c19a14d 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -124,10 +124,10 @@ fi # fallback to our default case ${platform}:${GRUB_TERMINAL} in pc:) GRUB_TERMINAL=gfxterm ;; - pc:console | pc:serial) ;; ieee1275:) GRUB_TERMINAL=ofconsole ;; - ieee1275:ofconsole) ;; *:) GRUB_TERMINAL=console ;; + pc:console | pc:serial | ieee1275:ofconsole | ieee1275:console | *:gfxterm) + ;; *:*) echo "Invalid terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;; esac From 7dc15d8e6a417027602a0852b5904cd138146878 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 28 Feb 2008 13:04:35 +0000 Subject: [PATCH 0063/1707] 2008-02-28 Robert Millan * conf/i386-linuxbios.rmk (pkglib_MODULES): Add aout.mod. (aout_mod_SOURCES): New variable. (aout_mod_CFLAGS): Likewise. (aout_mod_LDFLAGS): Likewise. * conf/i386-ieee1275.rmk: Likewise. --- ChangeLog | 9 +++++++ conf/i386-ieee1275.rmk | 7 +++++- conf/i386-linuxbios.mk | 55 ++++++++++++++++++++++++++++++++++++++++- conf/i386-linuxbios.rmk | 9 +++++-- 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13da46b54..ee39b6478 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-02-28 Robert Millan + + * conf/i386-linuxbios.rmk (pkglib_MODULES): Add aout.mod. + (aout_mod_SOURCES): New variable. + (aout_mod_CFLAGS): Likewise. + (aout_mod_LDFLAGS): Likewise. + + * conf/i386-ieee1275.rmk: Likewise. + 2008-02-28 Robert Millan * util/update-grub.in: Reorganise terminal validity check. Accept diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index f69ea7d77..80d2037b5 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -97,7 +97,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ - multiboot.mod _multiboot.mod serial.mod + multiboot.mod _multiboot.mod aout.mod serial.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -121,6 +121,11 @@ multiboot_mod_SOURCES = loader/multiboot_loader_normal.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For aout.mod. +aout_mod_SOURCES = loader/aout.c +aout_mod_CFLAGS = $(COMMON_CFLAGS) +aout_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For suspend.mod suspend_mod_SOURCES = commands/ieee1275/suspend.c suspend_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 1b80fe350..7be8f8cf5 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -548,7 +548,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod play.mod \ - cpuid.mod serial.mod ata.mod + cpuid.mod serial.mod ata.mod \ + aout.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -1125,6 +1126,58 @@ fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_nor multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For aout.mod +aout_mod_SOURCES = loader/aout.c +CLEANFILES += aout.mod mod-aout.o mod-aout.c pre-aout.o aout_mod-loader_aout.o und-aout.lst +ifneq ($(aout_mod_EXPORTS),no) +CLEANFILES += def-aout.lst +DEFSYMFILES += def-aout.lst +endif +MOSTLYCLEANFILES += aout_mod-loader_aout.d +UNDSYMFILES += und-aout.lst + +aout.mod: pre-aout.o mod-aout.o + -rm -f $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o + -rm -f $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ aout_mod-loader_aout.o + +mod-aout.o: mod-aout.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< + +mod-aout.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(aout_mod_EXPORTS),no) +def-aout.lst: pre-aout.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 aout/' > $@ +endif + +und-aout.lst: pre-aout.o + echo 'aout' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< +-include aout_mod-loader_aout.d + +CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst +COMMANDFILES += cmd-aout_mod-loader_aout.lst +FSFILES += fs-aout_mod-loader_aout.lst + +cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) + +fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) + + +aout_mod_CFLAGS = $(COMMON_CFLAGS) +aout_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For play.mod. play_mod_SOURCES = commands/i386/pc/play.c CLEANFILES += play.mod mod-play.o mod-play.c pre-play.o play_mod-commands_i386_pc_play.o und-play.lst diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 51beb9507..3eafe4dc8 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -95,8 +95,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ - _multiboot.mod multiboot.mod play.mod \ - cpuid.mod serial.mod ata.mod + _multiboot.mod multiboot.mod aout.mod \ + play.mod cpuid.mod serial.mod ata.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -136,6 +136,11 @@ multiboot_mod_SOURCES = loader/multiboot_loader_normal.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For aout.mod. +aout_mod_SOURCES = loader/aout.c +aout_mod_CFLAGS = $(COMMON_CFLAGS) +aout_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For play.mod. play_mod_SOURCES = commands/i386/pc/play.c play_mod_CFLAGS = $(COMMON_CFLAGS) From 87a95d1fb30a3cc528517ceeda14dfc39c958ee3 Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 1 Mar 2008 17:27:51 +0000 Subject: [PATCH 0064/1707] 2008-03-01 Yoshinori K. Okuji * DISTLIST: Added docs/fdl.texi, docs/grub.texi, docs/mdate-sh and texinfo.tex. * docs/grub.texi: New file. Copied from GRUB Legacy, and slightly modified. * docs/fdl.texi: New file. * docs/mdate-sh: New file. Copied from gnulib. * docs/texinfo.tex: Likewise. * config.guess: Updated from gnulib. * install-sh: Likewise. --- ChangeLog | 16 + DISTLIST | 4 + config.guess | 6 +- docs/fdl.texi | 452 +++ docs/grub.texi | 3967 ++++++++++++++++++++ docs/mdate-sh | 205 ++ docs/texinfo.tex | 8959 ++++++++++++++++++++++++++++++++++++++++++++++ install-sh | 383 +- 8 files changed, 13836 insertions(+), 156 deletions(-) create mode 100644 docs/fdl.texi create mode 100644 docs/grub.texi create mode 100644 docs/mdate-sh create mode 100644 docs/texinfo.tex diff --git a/ChangeLog b/ChangeLog index ee39b6478..5f96301ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-03-01 Yoshinori K. Okuji + + * DISTLIST: Added docs/fdl.texi, docs/grub.texi, docs/mdate-sh and + texinfo.tex. + + * docs/grub.texi: New file. Copied from GRUB Legacy, and slightly + modified. + + * docs/fdl.texi: New file. + + * docs/mdate-sh: New file. Copied from gnulib. + * docs/texinfo.tex: Likewise. + + * config.guess: Updated from gnulib. + * install-sh: Likewise. + 2008-02-28 Robert Millan * conf/i386-linuxbios.rmk (pkglib_MODULES): Add aout.mod. diff --git a/DISTLIST b/DISTLIST index b6a723213..a079142be 100644 --- a/DISTLIST +++ b/DISTLIST @@ -80,6 +80,10 @@ disk/raid.c disk/efi/efidisk.c disk/i386/pc/biosdisk.c disk/ieee1275/ofdisk.c +docs/fdl.texi +docs/grub.texi +docs/mdate-sh +docs/texinfo.tex font/manager.c fs/affs.c fs/cpio.c diff --git a/config.guess b/config.guess index 951383e35..278f9e9e0 100644 --- a/config.guess +++ b/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, # Inc. -timestamp='2007-05-17' +timestamp='2007-07-22' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -330,7 +330,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; - i86pc:SunOS:5.*:* | ix86xen:SunOS:5.*:*) + i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) @@ -793,7 +793,7 @@ EOF exit ;; *:Interix*:[3456]*) case ${UNAME_MACHINE} in - x86) + x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; EM64T | authenticamd) diff --git a/docs/fdl.texi b/docs/fdl.texi new file mode 100644 index 000000000..fe78df8d5 --- /dev/null +++ b/docs/fdl.texi @@ -0,0 +1,452 @@ + +@node GNU Free Documentation License +@appendixsec GNU Free Documentation License + +@cindex FDL, GNU Free Documentation License +@center Version 1.2, November 2002 + +@display +Copyright @copyright{} 2000,2001,2002 Free Software Foundation, Inc. +51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + +Everyone is permitted to copy and distribute verbatim copies +of this license document, but changing it is not allowed. +@end display + +@enumerate 0 +@item +PREAMBLE + +The purpose of this License is to make a manual, textbook, or other +functional and useful document @dfn{free} in the sense of freedom: to +assure everyone the effective freedom to copy and redistribute it, +with or without modifying it, either commercially or noncommercially. +Secondarily, this License preserves for the author and publisher a way +to get credit for their work, while not being considered responsible +for modifications made by others. + +This License is a kind of ``copyleft'', which means that derivative +works of the document must themselves be free in the same sense. It +complements the GNU General Public License, which is a copyleft +license designed for free software. + +We have designed this License in order to use it for manuals for free +software, because free software needs free documentation: a free +program should come with manuals providing the same freedoms that the +software does. But this License is not limited to software manuals; +it can be used for any textual work, regardless of subject matter or +whether it is published as a printed book. We recommend this License +principally for works whose purpose is instruction or reference. + +@item +APPLICABILITY AND DEFINITIONS + +This License applies to any manual or other work, in any medium, that +contains a notice placed by the copyright holder saying it can be +distributed under the terms of this License. Such a notice grants a +world-wide, royalty-free license, unlimited in duration, to use that +work under the conditions stated herein. The ``Document'', below, +refers to any such manual or work. Any member of the public is a +licensee, and is addressed as ``you''. You accept the license if you +copy, modify or distribute the work in a way requiring permission +under copyright law. + +A ``Modified Version'' of the Document means any work containing the +Document or a portion of it, either copied verbatim, or with +modifications and/or translated into another language. + +A ``Secondary Section'' is a named appendix or a front-matter section +of the Document that deals exclusively with the relationship of the +publishers or authors of the Document to the Document's overall +subject (or to related matters) and contains nothing that could fall +directly within that overall subject. (Thus, if the Document is in +part a textbook of mathematics, a Secondary Section may not explain +any mathematics.) The relationship could be a matter of historical +connection with the subject or with related matters, or of legal, +commercial, philosophical, ethical or political position regarding +them. + +The ``Invariant Sections'' are certain Secondary Sections whose titles +are designated, as being those of Invariant Sections, in the notice +that says that the Document is released under this License. If a +section does not fit the above definition of Secondary then it is not +allowed to be designated as Invariant. The Document may contain zero +Invariant Sections. If the Document does not identify any Invariant +Sections then there are none. + +The ``Cover Texts'' are certain short passages of text that are listed, +as Front-Cover Texts or Back-Cover Texts, in the notice that says that +the Document is released under this License. A Front-Cover Text may +be at most 5 words, and a Back-Cover Text may be at most 25 words. + +A ``Transparent'' copy of the Document means a machine-readable copy, +represented in a format whose specification is available to the +general public, that is suitable for revising the document +straightforwardly with generic text editors or (for images composed of +pixels) generic paint programs or (for drawings) some widely available +drawing editor, and that is suitable for input to text formatters or +for automatic translation to a variety of formats suitable for input +to text formatters. A copy made in an otherwise Transparent file +format whose markup, or absence of markup, has been arranged to thwart +or discourage subsequent modification by readers is not Transparent. +An image format is not Transparent if used for any substantial amount +of text. A copy that is not ``Transparent'' is called ``Opaque''. + +Examples of suitable formats for Transparent copies include plain +@sc{ascii} without markup, Texinfo input format, La@TeX{} input +format, @acronym{SGML} or @acronym{XML} using a publicly available +@acronym{DTD}, and standard-conforming simple @acronym{HTML}, +PostScript or @acronym{PDF} designed for human modification. Examples +of transparent image formats include @acronym{PNG}, @acronym{XCF} and +@acronym{JPG}. Opaque formats include proprietary formats that can be +read and edited only by proprietary word processors, @acronym{SGML} or +@acronym{XML} for which the @acronym{DTD} and/or processing tools are +not generally available, and the machine-generated @acronym{HTML}, +PostScript or @acronym{PDF} produced by some word processors for +output purposes only. + +The ``Title Page'' means, for a printed book, the title page itself, +plus such following pages as are needed to hold, legibly, the material +this License requires to appear in the title page. For works in +formats which do not have any title page as such, ``Title Page'' means +the text near the most prominent appearance of the work's title, +preceding the beginning of the body of the text. + +A section ``Entitled XYZ'' means a named subunit of the Document whose +title either is precisely XYZ or contains XYZ in parentheses following +text that translates XYZ in another language. (Here XYZ stands for a +specific section name mentioned below, such as ``Acknowledgements'', +``Dedications'', ``Endorsements'', or ``History''.) To ``Preserve the Title'' +of such a section when you modify the Document means that it remains a +section ``Entitled XYZ'' according to this definition. + +The Document may include Warranty Disclaimers next to the notice which +states that this License applies to the Document. These Warranty +Disclaimers are considered to be included by reference in this +License, but only as regards disclaiming warranties: any other +implication that these Warranty Disclaimers may have is void and has +no effect on the meaning of this License. + +@item +VERBATIM COPYING + +You may copy and distribute the Document in any medium, either +commercially or noncommercially, provided that this License, the +copyright notices, and the license notice saying this License applies +to the Document are reproduced in all copies, and that you add no other +conditions whatsoever to those of this License. You may not use +technical measures to obstruct or control the reading or further +copying of the copies you make or distribute. However, you may accept +compensation in exchange for copies. If you distribute a large enough +number of copies you must also follow the conditions in section 3. + +You may also lend copies, under the same conditions stated above, and +you may publicly display copies. + +@item +COPYING IN QUANTITY + +If you publish printed copies (or copies in media that commonly have +printed covers) of the Document, numbering more than 100, and the +Document's license notice requires Cover Texts, you must enclose the +copies in covers that carry, clearly and legibly, all these Cover +Texts: Front-Cover Texts on the front cover, and Back-Cover Texts on +the back cover. Both covers must also clearly and legibly identify +you as the publisher of these copies. The front cover must present +the full title with all words of the title equally prominent and +visible. You may add other material on the covers in addition. +Copying with changes limited to the covers, as long as they preserve +the title of the Document and satisfy these conditions, can be treated +as verbatim copying in other respects. + +If the required texts for either cover are too voluminous to fit +legibly, you should put the first ones listed (as many as fit +reasonably) on the actual cover, and continue the rest onto adjacent +pages. + +If you publish or distribute Opaque copies of the Document numbering +more than 100, you must either include a machine-readable Transparent +copy along with each Opaque copy, or state in or with each Opaque copy +a computer-network location from which the general network-using +public has access to download using public-standard network protocols +a complete Transparent copy of the Document, free of added material. +If you use the latter option, you must take reasonably prudent steps, +when you begin distribution of Opaque copies in quantity, to ensure +that this Transparent copy will remain thus accessible at the stated +location until at least one year after the last time you distribute an +Opaque copy (directly or through your agents or retailers) of that +edition to the public. + +It is requested, but not required, that you contact the authors of the +Document well before redistributing any large number of copies, to give +them a chance to provide you with an updated version of the Document. + +@item +MODIFICATIONS + +You may copy and distribute a Modified Version of the Document under +the conditions of sections 2 and 3 above, provided that you release +the Modified Version under precisely this License, with the Modified +Version filling the role of the Document, thus licensing distribution +and modification of the Modified Version to whoever possesses a copy +of it. In addition, you must do these things in the Modified Version: + +@enumerate A +@item +Use in the Title Page (and on the covers, if any) a title distinct +from that of the Document, and from those of previous versions +(which should, if there were any, be listed in the History section +of the Document). You may use the same title as a previous version +if the original publisher of that version gives permission. + +@item +List on the Title Page, as authors, one or more persons or entities +responsible for authorship of the modifications in the Modified +Version, together with at least five of the principal authors of the +Document (all of its principal authors, if it has fewer than five), +unless they release you from this requirement. + +@item +State on the Title page the name of the publisher of the +Modified Version, as the publisher. + +@item +Preserve all the copyright notices of the Document. + +@item +Add an appropriate copyright notice for your modifications +adjacent to the other copyright notices. + +@item +Include, immediately after the copyright notices, a license notice +giving the public permission to use the Modified Version under the +terms of this License, in the form shown in the Addendum below. + +@item +Preserve in that license notice the full lists of Invariant Sections +and required Cover Texts given in the Document's license notice. + +@item +Include an unaltered copy of this License. + +@item +Preserve the section Entitled ``History'', Preserve its Title, and add +to it an item stating at least the title, year, new authors, and +publisher of the Modified Version as given on the Title Page. If +there is no section Entitled ``History'' in the Document, create one +stating the title, year, authors, and publisher of the Document as +given on its Title Page, then add an item describing the Modified +Version as stated in the previous sentence. + +@item +Preserve the network location, if any, given in the Document for +public access to a Transparent copy of the Document, and likewise +the network locations given in the Document for previous versions +it was based on. These may be placed in the ``History'' section. +You may omit a network location for a work that was published at +least four years before the Document itself, or if the original +publisher of the version it refers to gives permission. + +@item +For any section Entitled ``Acknowledgements'' or ``Dedications'', Preserve +the Title of the section, and preserve in the section all the +substance and tone of each of the contributor acknowledgements and/or +dedications given therein. + +@item +Preserve all the Invariant Sections of the Document, +unaltered in their text and in their titles. Section numbers +or the equivalent are not considered part of the section titles. + +@item +Delete any section Entitled ``Endorsements''. Such a section +may not be included in the Modified Version. + +@item +Do not retitle any existing section to be Entitled ``Endorsements'' or +to conflict in title with any Invariant Section. + +@item +Preserve any Warranty Disclaimers. +@end enumerate + +If the Modified Version includes new front-matter sections or +appendices that qualify as Secondary Sections and contain no material +copied from the Document, you may at your option designate some or all +of these sections as invariant. To do this, add their titles to the +list of Invariant Sections in the Modified Version's license notice. +These titles must be distinct from any other section titles. + +You may add a section Entitled ``Endorsements'', provided it contains +nothing but endorsements of your Modified Version by various +parties---for example, statements of peer review or that the text has +been approved by an organization as the authoritative definition of a +standard. + +You may add a passage of up to five words as a Front-Cover Text, and a +passage of up to 25 words as a Back-Cover Text, to the end of the list +of Cover Texts in the Modified Version. Only one passage of +Front-Cover Text and one of Back-Cover Text may be added by (or +through arrangements made by) any one entity. If the Document already +includes a cover text for the same cover, previously added by you or +by arrangement made by the same entity you are acting on behalf of, +you may not add another; but you may replace the old one, on explicit +permission from the previous publisher that added the old one. + +The author(s) and publisher(s) of the Document do not by this License +give permission to use their names for publicity for or to assert or +imply endorsement of any Modified Version. + +@item +COMBINING DOCUMENTS + +You may combine the Document with other documents released under this +License, under the terms defined in section 4 above for modified +versions, provided that you include in the combination all of the +Invariant Sections of all of the original documents, unmodified, and +list them all as Invariant Sections of your combined work in its +license notice, and that you preserve all their Warranty Disclaimers. + +The combined work need only contain one copy of this License, and +multiple identical Invariant Sections may be replaced with a single +copy. If there are multiple Invariant Sections with the same name but +different contents, make the title of each such section unique by +adding at the end of it, in parentheses, the name of the original +author or publisher of that section if known, or else a unique number. +Make the same adjustment to the section titles in the list of +Invariant Sections in the license notice of the combined work. + +In the combination, you must combine any sections Entitled ``History'' +in the various original documents, forming one section Entitled +``History''; likewise combine any sections Entitled ``Acknowledgements'', +and any sections Entitled ``Dedications''. You must delete all +sections Entitled ``Endorsements.'' + +@item +COLLECTIONS OF DOCUMENTS + +You may make a collection consisting of the Document and other documents +released under this License, and replace the individual copies of this +License in the various documents with a single copy that is included in +the collection, provided that you follow the rules of this License for +verbatim copying of each of the documents in all other respects. + +You may extract a single document from such a collection, and distribute +it individually under this License, provided you insert a copy of this +License into the extracted document, and follow this License in all +other respects regarding verbatim copying of that document. + +@item +AGGREGATION WITH INDEPENDENT WORKS + +A compilation of the Document or its derivatives with other separate +and independent documents or works, in or on a volume of a storage or +distribution medium, is called an ``aggregate'' if the copyright +resulting from the compilation is not used to limit the legal rights +of the compilation's users beyond what the individual works permit. +When the Document is included in an aggregate, this License does not +apply to the other works in the aggregate which are not themselves +derivative works of the Document. + +If the Cover Text requirement of section 3 is applicable to these +copies of the Document, then if the Document is less than one half of +the entire aggregate, the Document's Cover Texts may be placed on +covers that bracket the Document within the aggregate, or the +electronic equivalent of covers if the Document is in electronic form. +Otherwise they must appear on printed covers that bracket the whole +aggregate. + +@item +TRANSLATION + +Translation is considered a kind of modification, so you may +distribute translations of the Document under the terms of section 4. +Replacing Invariant Sections with translations requires special +permission from their copyright holders, but you may include +translations of some or all Invariant Sections in addition to the +original versions of these Invariant Sections. You may include a +translation of this License, and all the license notices in the +Document, and any Warranty Disclaimers, provided that you also include +the original English version of this License and the original versions +of those notices and disclaimers. In case of a disagreement between +the translation and the original version of this License or a notice +or disclaimer, the original version will prevail. + +If a section in the Document is Entitled ``Acknowledgements'', +``Dedications'', or ``History'', the requirement (section 4) to Preserve +its Title (section 1) will typically require changing the actual +title. + +@item +TERMINATION + +You may not copy, modify, sublicense, or distribute the Document except +as expressly provided for under this License. Any other attempt to +copy, modify, sublicense or distribute the Document is void, and will +automatically terminate your rights under this License. However, +parties who have received copies, or rights, from you under this +License will not have their licenses terminated so long as such +parties remain in full compliance. + +@item +FUTURE REVISIONS OF THIS LICENSE + +The Free Software Foundation may publish new, revised versions +of the GNU Free Documentation License from time to time. Such new +versions will be similar in spirit to the present version, but may +differ in detail to address new problems or concerns. See +@uref{http://www.gnu.org/copyleft/}. + +Each version of the License is given a distinguishing version number. +If the Document specifies that a particular numbered version of this +License ``or any later version'' applies to it, you have the option of +following the terms and conditions either of that specified version or +of any later version that has been published (not as a draft) by the +Free Software Foundation. If the Document does not specify a version +number of this License, you may choose any version ever published (not +as a draft) by the Free Software Foundation. +@end enumerate + +@page +@appendixsubsec ADDENDUM: How to use this License for your documents + +To use this License in a document you have written, include a copy of +the License in the document and put the following copyright and +license notices just after the title page: + +@smallexample +@group + Copyright (C) @var{year} @var{your name}. + Permission is granted to copy, distribute and/or modify this document + under the terms of the GNU Free Documentation License, Version 1.2 + or any later version published by the Free Software Foundation; + with no Invariant Sections, no Front-Cover Texts, and no Back-Cover + Texts. A copy of the license is included in the section entitled ``GNU + Free Documentation License''. +@end group +@end smallexample + +If you have Invariant Sections, Front-Cover Texts and Back-Cover Texts, +replace the ``with...Texts.'' line with this: + +@smallexample +@group + with the Invariant Sections being @var{list their titles}, with + the Front-Cover Texts being @var{list}, and with the Back-Cover Texts + being @var{list}. +@end group +@end smallexample + +If you have Invariant Sections without Cover Texts, or some other +combination of the three, merge those two alternatives to suit the +situation. + +If your document contains nontrivial examples of program code, we +recommend releasing these examples in parallel under your choice of +free software license, such as the GNU General Public License, +to permit their use in free software. + +@c Local Variables: +@c ispell-local-pdict: "ispell-dict" +@c End: + diff --git a/docs/grub.texi b/docs/grub.texi new file mode 100644 index 000000000..b8f74a039 --- /dev/null +++ b/docs/grub.texi @@ -0,0 +1,3967 @@ +\input texinfo +@c -*-texinfo-*- +@c %**start of header +@setfilename grub.info +@include version.texi +@settitle GNU GRUB Manual @value{VERSION} +@c Unify all our little indices for now. +@syncodeindex fn cp +@syncodeindex vr cp +@syncodeindex ky cp +@syncodeindex pg cp +@syncodeindex tp cp +@c %**end of header + +@footnotestyle separate +@paragraphindent 3 +@finalout + +@copying +This manual is for GNU GRUB (version @value{VERSION}, +@value{UPDATED}). + +Copyright @copyright{} 1999,2000,2001,2002,2004,2006,2008 Free Software Foundation, Inc. + +@quotation +Permission is granted to copy, distribute and/or modify this document +under the terms of the GNU Free Documentation License, Version 1.2 or +any later version published by the Free Software Foundation; with no +Invariant Sections. +@end quotation +@end copying + +@dircategory Kernel +@direntry +* GRUB: (grub). The GRand Unified Bootloader +* grub-install: (grub)Invoking grub-install. Install GRUB on your drive +* grub-md5-crypt: (grub)Invoking grub-md5-crypt. Encrypt a password + in MD5 format +* grub-terminfo: (grub)Invoking grub-terminfo. Generate a terminfo + command from a + terminfo name +* grub-set-default: (grub)Invoking grub-set-default. Set a default boot + entry +* mbchk: (grub)Invoking mbchk. Check for the format of a Multiboot kernel +@end direntry + +@setchapternewpage odd + +@titlepage +@sp 10 +@title the GNU GRUB manual +@subtitle The GRand Unified Bootloader, version @value{VERSION}, @value{UPDATED}. +@author Gordon Matzigkeit +@author Yoshinori K. Okuji +@c The following two commands start the copyright page. +@page +@vskip 0pt plus 1filll +@insertcopying +@end titlepage + +@c Output the table of contents at the beginning. +@contents + +@finalout +@headings double + +@ifnottex +@node Top +@top GNU GRUB manual + +This is the documentation of GNU GRUB, the GRand Unified Bootloader, +a flexible and powerful boot loader program for a wide range of +architectures. + +This edition documents version @value{VERSION}. + +@insertcopying +@end ifnottex + +@menu +* Introduction:: Capturing the spirit of GRUB +* Naming convention:: Names of your drives in GRUB +* Installation:: Installing GRUB on your drive +* Booting:: How to boot different operating systems +* Configuration:: Writing your own configuration file +* Network:: Downloading OS images from a network +* Serial terminal:: Using GRUB via a serial line +* Preset Menu:: Embedding a configuration file into GRUB +* Security:: Improving the security +* Images:: GRUB image files +* Filesystem:: Filesystem syntax and semantics +* Interface:: The menu and the command-line +* Commands:: The list of available builtin commands +* Troubleshooting:: Error messages produced by GRUB +* Invoking the grub shell:: How to use the grub shell +* Invoking grub-install:: How to use the GRUB installer +* Invoking grub-md5-crypt:: How to generate a cryptic password +* Invoking grub-terminfo:: How to generate a terminfo command +* Invoking grub-set-default:: How to set a default boot entry +* Invoking mbchk:: How to use the Multiboot checker +* Obtaining and Building GRUB:: How to obtain and build GRUB +* Reporting bugs:: Where you should send a bug report +* Future:: Some future plans on GRUB +* Internals:: Hacking GRUB +* Copying This Manual:: Copying This Manual +* Index:: +@end menu + + +@node Introduction +@chapter Introduction to GRUB + +@menu +* Overview:: What exactly GRUB is and how to use it +* History:: From maggot to house fly +* Features:: GRUB features +* Role of a boot loader:: The role of a boot loader +@end menu + + +@node Overview +@section Overview + +Briefly, a @dfn{boot loader} is the first software program that runs when +a computer starts. It is responsible for loading and transferring +control to an operating system @dfn{kernel} software (such as Linux or +GNU Mach). The kernel, in turn, initializes the rest of the operating +system (e.g. a GNU system). + +GNU GRUB is a very powerful boot loader, which can load a wide variety +of free operating systems, as well as proprietary operating systems with +chain-loading@footnote{@dfn{chain-load} is the mechanism for loading +unsupported operating systems by loading another boot loader. It is +typically used for loading DOS or Windows.}. GRUB is designed to +address the complexity of booting a personal computer; both the +program and this manual are tightly bound to that computer platform, +although porting to other platforms may be addressed in the future. + +One of the important features in GRUB is flexibility; GRUB understands +filesystems and kernel executable formats, so you can load an arbitrary +operating system the way you like, without recording the physical +position of your kernel on the disk. Thus you can load the kernel +just by specifying its file name and the drive and partition where the +kernel resides. + +When booting with GRUB, you can use either a command-line interface +(@pxref{Command-line interface}), or a menu interface (@pxref{Menu +interface}). Using the command-line interface, you type the drive +specification and file name of the kernel manually. In the menu +interface, you just select an OS using the arrow keys. The menu is +based on a configuration file which you prepare beforehand +(@pxref{Configuration}). While in the menu, you can switch to the +command-line mode, and vice-versa. You can even edit menu entries +before using them. + +In the following chapters, you will learn how to specify a drive, a +partition, and a file name (@pxref{Naming convention}) to GRUB, how to +install GRUB on your drive (@pxref{Installation}), and how to boot your +OSes (@pxref{Booting}), step by step. + +Besides the GRUB boot loader itself, there is a @dfn{grub shell} +@command{grub} (@pxref{Invoking the grub shell}) which can be run when +you are in your operating system. It emulates the boot loader and can +be used for installing the boot loader. + + +@node History +@section History of GRUB + +GRUB originated in 1995 when Erich Boleyn was trying to boot the GNU +Hurd with the University of Utah's Mach 4 microkernel (now known as GNU +Mach). Erich and Brian Ford designed the Multiboot Specification +(@pxref{Top, Multiboot Specification, Motivation, multiboot, The Multiboot +Specification}), because they were determined not to add to the large +number of mutually-incompatible PC boot methods. + +Erich then began modifying the FreeBSD boot loader so that it would +understand Multiboot. He soon realized that it would be a lot easier +to write his own boot loader from scratch than to keep working on the +FreeBSD boot loader, and so GRUB was born. + +Erich added many features to GRUB, but other priorities prevented him +from keeping up with the demands of its quickly-expanding user base. In +1999, Gordon Matzigkeit and Yoshinori K. Okuji adopted GRUB as an +official GNU package, and opened its development by making the latest +sources available via anonymous CVS. @xref{Obtaining and Building +GRUB}, for more information. + + +@node Features +@section GRUB features + +The primary requirement for GRUB is that it be compliant with the +@dfn{Multiboot Specification}, which is described in @ref{Top, Multiboot +Specification, Motivation, multiboot, The Multiboot Specification}. + +The other goals, listed in approximate order of importance, are: + +@itemize @bullet{} +@item +Basic functions must be straightforward for end-users. + +@item +Rich functionality to support kernel experts and designers. + +@item +Backward compatibility for booting FreeBSD, NetBSD, OpenBSD, and +Linux. Proprietary kernels (such as DOS, Windows NT, and OS/2) are +supported via a chain-loading function. +@end itemize + +Except for specific compatibility modes (chain-loading and the Linux +@dfn{piggyback} format), all kernels will be started in much the same +state as in the Multiboot Specification. Only kernels loaded at 1 megabyte +or above are presently supported. Any attempt to load below that +boundary will simply result in immediate failure and an error message +reporting the problem. + +In addition to the requirements above, GRUB has the following features +(note that the Multiboot Specification doesn't require all the features +that GRUB supports): + +@table @asis +@item Recognize multiple executable formats +Support many of the @dfn{a.out} variants plus @dfn{ELF}. Symbol +tables are also loaded. + +@item Support non-Multiboot kernels +Support many of the various free 32-bit kernels that lack Multiboot +compliance (primarily FreeBSD, NetBSD, OpenBSD, and +Linux). Chain-loading of other boot loaders is also supported. + +@item Load multiples modules +Fully support the Multiboot feature of loading multiple modules. + +@item Load a configuration file +Support a human-readable text configuration file with preset boot +commands. You can also load another configuration file dynamically and +embed a preset configuration file in a GRUB image file. The list of +commands (@pxref{Commands}) are a superset of those supported on the +command-line. An example configuration file is provided in +@ref{Configuration}. + +@item Provide a menu interface +A menu interface listing preset boot commands, with a programmable +timeout, is available. There is no fixed limit on the number of boot +entries, and the current implementation has space for several hundred. + +@item Have a flexible command-line interface +A fairly flexible command-line interface, accessible from the menu, +is available to edit any preset commands, or write a new boot command +set from scratch. If no configuration file is present, GRUB drops to +the command-line. + +The list of commands (@pxref{Commands}) are a subset of those supported +for configuration files. Editing commands closely resembles the Bash +command-line (@pxref{Command Line Editing, Bash, Command Line Editing, +features, Bash Features}), with @key{TAB}-completion of commands, +devices, partitions, and files in a directory depending on context. + +@item Support multiple filesystem types +Support multiple filesystem types transparently, plus a useful explicit +blocklist notation. The currently supported filesystem types are +@dfn{BSD FFS}, @dfn{DOS FAT16 and FAT32}, @dfn{Minix fs}, @dfn{Linux +ext2fs}, @dfn{ReiserFS}, @dfn{JFS}, @dfn{XFS}, and @dfn{VSTa +fs}. @xref{Filesystem}, for more information. + +@item Support automatic decompression +Can decompress files which were compressed by @command{gzip}. This +function is both automatic and transparent to the user (i.e. all +functions operate upon the uncompressed contents of the specified +files). This greatly reduces a file size and loading time, a +particularly great benefit for floppies.@footnote{There are a few +pathological cases where loading a very badly organized ELF kernel might +take longer, but in practice this never happen.} + +It is conceivable that some kernel modules should be loaded in a +compressed state, so a different module-loading command can be specified +to avoid uncompressing the modules. + +@item Access data on any installed device +Support reading data from any or all floppies or hard disk(s) recognized +by the BIOS, independent of the setting of the root device. + +@item Be independent of drive geometry translations +Unlike many other boot loaders, GRUB makes the particular drive +translation irrelevant. A drive installed and running with one +translation may be converted to another translation without any adverse +effects or changes in GRUB's configuration. + +@item Detect all installed @sc{ram} +GRUB can generally find all the installed @sc{ram} on a PC-compatible +machine. It uses an advanced BIOS query technique for finding all +memory regions. As described on the Multiboot Specification (@pxref{Top, +Multiboot Specification, Motivation, multiboot, The Multiboot +Specification}), not all kernels make use of this information, but GRUB +provides it for those who do. + +@item Support Logical Block Address mode +In traditional disk calls (called @dfn{CHS mode}), there is a geometry +translation problem, that is, the BIOS cannot access over 1024 +cylinders, so the accessible space is limited to at least 508 MB and to +at most 8GB. GRUB can't universally solve this problem, as there is no +standard interface used in all machines. However, several newer machines +have the new interface, Logical Block Address (@dfn{LBA}) mode. GRUB +automatically detects if LBA mode is available and uses it if +available. In LBA mode, GRUB can access the entire disk. + +@item Support network booting +GRUB is basically a disk-based boot loader but also has network +support. You can load OS images from a network by using the @dfn{TFTP} +protocol. + +@item Support remote terminals +To support computers with no console, GRUB provides remote terminal +support, so that you can control GRUB from a remote host. Only serial +terminal support is implemented at the moment. +@end table + + +@node Role of a boot loader +@section The role of a boot loader + +The following is a quotation from Gordon Matzigkeit, a GRUB fanatic: + +@quotation +Some people like to acknowledge both the operating system and kernel when +they talk about their computers, so they might say they use +``GNU/Linux'' or ``GNU/Hurd''. Other people seem to think that the +kernel is the most important part of the system, so they like to call +their GNU operating systems ``Linux systems.'' + +I, personally, believe that this is a grave injustice, because the +@emph{boot loader} is the most important software of all. I used to +refer to the above systems as either ``LILO''@footnote{The LInux LOader, +a boot loader that everybody uses, but nobody likes.} or ``GRUB'' +systems. + +Unfortunately, nobody ever understood what I was talking about; now I +just use the word ``GNU'' as a pseudonym for GRUB. + +So, if you ever hear people talking about their alleged ``GNU'' systems, +remember that they are actually paying homage to the best boot loader +around@dots{} GRUB! +@end quotation + +We, the GRUB maintainers, do not (usually) encourage Gordon's level of +fanaticism, but it helps to remember that boot loaders deserve +recognition. We hope that you enjoy using GNU GRUB as much as we did +writing it. + + +@node Naming convention +@chapter Naming convention + +The device syntax used in GRUB is a wee bit different from what you may +have seen before in your operating system(s), and you need to know it so +that you can specify a drive/partition. + +Look at the following examples and explanations: + +@example +(fd0) +@end example + +First of all, GRUB requires that the device name be enclosed with +@samp{(} and @samp{)}. The @samp{fd} part means that it is a floppy +disk. The number @samp{0} is the drive number, which is counted from +@emph{zero}. This expression means that GRUB will use the whole floppy +disk. + +@example +(hd0,1) +@end example + +Here, @samp{hd} means it is a hard disk drive. The first integer +@samp{0} indicates the drive number, that is, the first hard disk, while +the second integer, @samp{1}, indicates the partition number (or the +@sc{pc} slice number in the BSD terminology). Once again, please note +that the partition numbers are counted from @emph{zero}, not from +one. This expression means the second partition of the first hard disk +drive. In this case, GRUB uses one partition of the disk, instead of the +whole disk. + +@example +(hd0,4) +@end example + +This specifies the first @dfn{extended partition} of the first hard disk +drive. Note that the partition numbers for extended partitions are +counted from @samp{4}, regardless of the actual number of primary +partitions on your hard disk. + +@example +(hd1,a) +@end example + +This means the BSD @samp{a} partition of the second hard disk. If you +need to specify which @sc{pc} slice number should be used, use something +like this: @samp{(hd1,0,a)}. If the @sc{pc} slice number is omitted, +GRUB searches for the first @sc{pc} slice which has a BSD @samp{a} +partition. + +Of course, to actually access the disks or partitions with GRUB, you +need to use the device specification in a command, like @samp{root +(fd0)} or @samp{unhide (hd0,2)}. To help you find out which number +specifies a partition you want, the GRUB command-line +(@pxref{Command-line interface}) options have argument +completion. This means that, for example, you only need to type + +@example +root ( +@end example + +followed by a @key{TAB}, and GRUB will display the list of drives, +partitions, or file names. So it should be quite easy to determine the +name of your target partition, even with minimal knowledge of the +syntax. + +Note that GRUB does @emph{not} distinguish IDE from SCSI - it simply +counts the drive numbers from zero, regardless of their type. Normally, +any IDE drive number is less than any SCSI drive number, although that +is not true if you change the boot sequence by swapping IDE and SCSI +drives in your BIOS. + +Now the question is, how to specify a file? Again, consider an +example: + +@example +(hd0,0)/vmlinuz +@end example + +This specifies the file named @samp{vmlinuz}, found on the first +partition of the first hard disk drive. Note that the argument +completion works with file names, too. + +That was easy, admit it. Now read the next chapter, to find out how to +actually install GRUB on your drive. + + +@node Installation +@chapter Installation + +In order to install GRUB as your boot loader, you need to first +install the GRUB system and utilities under your UNIX-like operating +system (@pxref{Obtaining and Building GRUB}). You can do this either +from the source tarball, or as a package for your OS. + +After you have done that, you need to install the boot loader on a +drive (floppy or hard disk). There are two ways of doing that - either +using the utility @command{grub-install} (@pxref{Invoking +grub-install}) on a UNIX-like OS, or by running GRUB itself from a +floppy. These are quite similar, however the utility might probe a +wrong BIOS drive, so you should be careful. + +Also, if you install GRUB on a UNIX-like OS, please make sure that you +have an emergency boot disk ready, so that you can rescue your computer +if, by any chance, your hard drive becomes unusable (unbootable). + +GRUB comes with boot images, which are normally put in the directory +@file{/usr/lib/grub/i386-pc}. If you do not use grub-install, then +you need to copy the files @file{stage1}, @file{stage2}, and +@file{*stage1_5} to the directory @file{/boot/grub}, and run the +@command{grub-set-default} (@pxref{Invoking grub-set-default}) if you +intend to use @samp{default saved} (@pxref{default}) in your +configuration file. Hereafter, the directory where GRUB images are +initially placed (normally @file{/usr/lib/grub/i386-pc}) will be +called the @dfn{image directory}, and the directory where the boot +loader needs to find them (usually @file{/boot/grub}) will be called +the @dfn{boot directory}. + +@menu +* Creating a GRUB boot floppy:: +* Installing GRUB natively:: +* Installing GRUB using grub-install:: +* Making a GRUB bootable CD-ROM:: +@end menu + + +@node Creating a GRUB boot floppy +@section Creating a GRUB boot floppy + +To create a GRUB boot floppy, you need to take the files @file{stage1} +and @file{stage2} from the image directory, and write them to the first +and the second block of the floppy disk, respectively. + +@strong{Caution:} This procedure will destroy any data currently stored +on the floppy. + +On a UNIX-like operating system, that is done with the following +commands: + +@example +@group +# @kbd{cd /usr/lib/grub/i386-pc} +# @kbd{dd if=stage1 of=/dev/fd0 bs=512 count=1} +1+0 records in +1+0 records out +# @kbd{dd if=stage2 of=/dev/fd0 bs=512 seek=1} +153+1 records in +153+1 records out +# +@end group +@end example + +The device file name may be different. Consult the manual for your OS. + + +@node Installing GRUB natively +@section Installing GRUB natively + +@strong{Caution:} Installing GRUB's stage1 in this manner will erase the +normal boot-sector used by an OS. + +GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD +directly, so using it on a boot sector (the first sector of a +partition) should be okay. But generally, it would be a good idea to +back up the first sector of the partition on which you are installing +GRUB's stage1. This isn't as important if you are installing GRUB on +the first sector of a hard disk, since it's easy to reinitialize it +(e.g. by running @samp{FDISK /MBR} from DOS). + +If you decide to install GRUB in the native environment, which is +definitely desirable, you'll need to create a GRUB boot disk, and +reboot your computer with it. Otherwise, see @ref{Installing GRUB using +grub-install}. + +Once started, GRUB will show the command-line interface +(@pxref{Command-line interface}). First, set the GRUB's @dfn{root +device}@footnote{Note that GRUB's root device doesn't necessarily mean +your OS's root partition; if you need to specify a root partition for +your OS, add the argument into the command @command{kernel}.} to the +partition containing the boot directory, like this: + +@example +grub> @kbd{root (hd0,0)} +@end example + +If you are not sure which partition actually holds this directory, use the +command @command{find} (@pxref{find}), like this: + +@example +grub> @kbd{find /boot/grub/stage1} +@end example + +This will search for the file name @file{/boot/grub/stage1} and show the +devices which contain the file. + +Once you've set the root device correctly, run the command +@command{setup} (@pxref{setup}): + +@example +grub> @kbd{setup (hd0)} +@end example + +This command will install the GRUB boot loader on the Master Boot +Record (MBR) of the first drive. If you want to put GRUB into the boot +sector of a partition instead of putting it in the MBR, specify the +partition into which you want to install GRUB: + +@example +grub> @kbd{setup (hd0,0)} +@end example + +If you install GRUB into a partition or a drive other than the first +one, you must chain-load GRUB from another boot loader. Refer to the +manual for the boot loader to know how to chain-load GRUB. + +After using the setup command, you will boot into GRUB without the +GRUB floppy. See the chapter @ref{Booting} to find out how to boot +your operating systems from GRUB. + + +@node Installing GRUB using grub-install +@section Installing GRUB using grub-install + +@strong{Caution:} This procedure is definitely less safe, because +there are several ways in which your computer can become +unbootable. For example, most operating systems don't tell GRUB how to +map BIOS drives to OS devices correctly---GRUB merely @dfn{guesses} +the mapping. This will succeed in most cases, but not +always. Therefore, GRUB provides you with a map file called the +@dfn{device map}, which you must fix if it is wrong. @xref{Device +map}, for more details. + +If you still do want to install GRUB under a UNIX-like OS (such +as @sc{gnu}), invoke the program @command{grub-install} (@pxref{Invoking +grub-install}) as the superuser (@dfn{root}). + +The usage is basically very simple. You only need to specify one +argument to the program, namely, where to install the boot loader. The +argument can be either a device file (like @samp{/dev/hda}) or a +partition specified in GRUB's notation. For example, under Linux the +following will install GRUB into the MBR of the first IDE disk: + +@example +# @kbd{grub-install /dev/hda} +@end example + +Likewise, under GNU/Hurd, this has the same effect: + +@example +# @kbd{grub-install /dev/hd0} +@end example + +If it is the first BIOS drive, this is the same as well: + +@example +# @kbd{grub-install '(hd0)'} +@end example + +Or you can omit the parentheses: + +@example +# @kbd{grub-install hd0} +@end example + +But all the above examples assume that GRUB should use images under +the root directory. If you want GRUB to use images under a directory +other than the root directory, you need to specify the option +@option{--root-directory}. The typical usage is that you create a GRUB +boot floppy with a filesystem. Here is an example: + +@example +@group +# @kbd{mke2fs /dev/fd0} +# @kbd{mount -t ext2 /dev/fd0 /mnt} +# @kbd{grub-install --root-directory=/mnt fd0} +# @kbd{umount /mnt} +@end group +@end example + +Another example is when you have a separate boot partition +which is mounted at @file{/boot}. Since GRUB is a boot loader, it +doesn't know anything about mountpoints at all. Thus, you need to run +@command{grub-install} like this: + +@example +# @kbd{grub-install --root-directory=/boot /dev/hda} +@end example + +By the way, as noted above, it is quite difficult to guess BIOS drives +correctly under a UNIX-like OS. Thus, @command{grub-install} will prompt +you to check if it could really guess the correct mappings, after the +installation. The format is defined in @ref{Device map}. Please be +quite careful. If the output is wrong, it is unlikely that your +computer will be able to boot with no problem. + +Note that @command{grub-install} is actually just a shell script and the +real task is done by the grub shell @command{grub} (@pxref{Invoking the +grub shell}). Therefore, you may run @command{grub} directly to install +GRUB, without using @command{grub-install}. Don't do that, however, +unless you are very familiar with the internals of GRUB. Installing a +boot loader on a running OS may be extremely dangerous. + + +@node Making a GRUB bootable CD-ROM +@section Making a GRUB bootable CD-ROM + +GRUB supports the @dfn{no emulation mode} in the El Torito +specification@footnote{El Torito is a specification for bootable CD +using BIOS functions.}. This means that you can use the whole CD-ROM +from GRUB and you don't have to make a floppy or hard disk image file, +which can cause compatibility problems. + +For booting from a CD-ROM, GRUB uses a special Stage 2 called +@file{stage2_eltorito}. The only GRUB files you need to have in your +bootable CD-ROM are this @file{stage2_eltorito} and optionally a config file +@file{menu.lst}. You don't need to use @file{stage1} or @file{stage2}, +because El Torito is quite different from the standard boot process. + +Here is an example of procedures to make a bootable CD-ROM +image. First, make a top directory for the bootable image, say, +@samp{iso}: + +@example +$ @kbd{mkdir iso} +@end example + +Make a directory for GRUB: + +@example +$ @kbd{mkdir -p iso/boot/grub} +@end example + +Copy the file @file{stage2_eltorito}: + +@example +$ @kbd{cp /usr/lib/grub/i386-pc/stage2_eltorito iso/boot/grub} +@end example + +If desired, make the config file @file{menu.lst} under @file{iso/boot/grub} +(@pxref{Configuration}), and copy any files and directories for the disc to the +directory @file{iso/}. + +Finally, make a ISO9660 image file like this: + +@example +$ @kbd{mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \ + -boot-load-size 4 -boot-info-table -o grub.iso iso} +@end example + +This produces a file named @file{grub.iso}, which then can be burned +into a CD (or a DVD). @kbd{mkisofs} has already set up the disc to boot +from the @kbd{boot/grub/stage2_eltorito} file, so there is no need to +setup GRUB on the disc. (Note that the @kbd{-boot-load-size 4} bit is +required for compatibility with the BIOS on many older machines.) + +You can use the device @samp{(cd)} to access a CD-ROM in your +config file. This is not required; GRUB automatically sets the root device +to @samp{(cd)} when booted from a CD-ROM. It is only necessary to refer to +@samp{(cd)} if you want to access other drives as well. + + +@node Booting +@chapter Booting + +GRUB can load Multiboot-compliant kernels in a consistent way, +but for some free operating systems you need to use some OS-specific +magic. + +@menu +* General boot methods:: How to boot OSes with GRUB generally +* OS-specific notes:: Notes on some operating systems +* Making your system robust:: How to make your system robust +@end menu + + +@node General boot methods +@section How to boot operating systems + +GRUB has two distinct boot methods. One of the two is to load an +operating system directly, and the other is to chain-load another boot +loader which then will load an operating system actually. Generally +speaking, the former is more desirable, because you don't need to +install or maintain other boot loaders and GRUB is flexible enough to +load an operating system from an arbitrary disk/partition. However, +the latter is sometimes required, since GRUB doesn't support all the +existing operating systems natively. + +@menu +* Loading an operating system directly:: +* Chain-loading:: +@end menu + + +@node Loading an operating system directly +@subsection How to boot an OS directly with GRUB + +Multiboot (@pxref{Top, Multiboot Specification, Motivation, multiboot, +The Multiboot Specification}) is the native format supported by GRUB. +For the sake of convenience, there is also support for Linux, FreeBSD, +NetBSD and OpenBSD. If you want to boot other operating systems, you +will have to chain-load them (@pxref{Chain-loading}). + +Generally, GRUB can boot any Multiboot-compliant OS in the following +steps: + +@enumerate +@item +Set GRUB's root device to the drive where the OS images are stored with +the command @command{root} (@pxref{root}). + +@item +Load the kernel image with the command @command{kernel} (@pxref{kernel}). + +@item +If you need modules, load them with the command @command{module} +(@pxref{module}) or @command{modulenounzip} (@pxref{modulenounzip}). + +@item +Run the command @command{boot} (@pxref{boot}). +@end enumerate + +Linux, FreeBSD, NetBSD and OpenBSD can be booted in a similar +manner. You load a kernel image with the command @command{kernel} and +then run the command @command{boot}. If the kernel requires some +parameters, just append the parameters to @command{kernel}, after the +file name of the kernel. Also, please refer to @ref{OS-specific notes}, +for information on your OS-specific issues. + + +@node Chain-loading +@subsection Load another boot loader to boot unsupported operating systems + +If you want to boot an unsupported operating system (e.g. Windows 95), +chain-load a boot loader for the operating system. Normally, the boot +loader is embedded in the @dfn{boot sector} of the partition on which +the operating system is installed. + +@enumerate +@item +Set GRUB's root device to the partition by the command +@command{rootnoverify} (@pxref{rootnoverify}): + +@example +grub> @kbd{rootnoverify (hd0,0)} +@end example + +@item +Set the @dfn{active} flag in the partition using the command +@command{makeactive}@footnote{This is not necessary for most of the +modern operating systems.} (@pxref{makeactive}): + +@example +grub> @kbd{makeactive} +@end example + +@item +Load the boot loader with the command @command{chainloader} +(@pxref{chainloader}): + +@example +grub> @kbd{chainloader +1} +@end example + +@samp{+1} indicates that GRUB should read one sector from the start of +the partition. The complete description about this syntax can be found +in @ref{Block list syntax}. + +@item +Run the command @command{boot} (@pxref{boot}). +@end enumerate + +However, DOS and Windows have some deficiencies, so you might have to +use more complicated instructions. @xref{DOS/Windows}, for more +information. + + +@node OS-specific notes +@section Some caveats on OS-specific issues + +Here, we describe some caveats on several operating systems. + +@menu +* GNU/Hurd:: +* GNU/Linux:: +* FreeBSD:: +* NetBSD:: +* OpenBSD:: +* DOS/Windows:: +* SCO UnixWare:: +* QNX:: +@end menu + + +@node GNU/Hurd +@subsection GNU/Hurd + +Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is +nothing special about it. But do not forget that you have to specify a +root partition to the kernel. + +@enumerate +@item +Set GRUB's root device to the same drive as GNU/Hurd's. Probably the +command @code{find /boot/gnumach} or similar can help you +(@pxref{find}). + +@item +Load the kernel and the module, like this: + +@example +@group +grub> @kbd{kernel /boot/gnumach root=hd0s1} +grub> @kbd{module /boot/serverboot} +@end group +@end example + +@item +Run the command @command{boot} (@pxref{boot}). +@end enumerate + + +@node GNU/Linux +@subsection GNU/Linux + +It is relatively easy to boot GNU/Linux from GRUB, because it somewhat +resembles to boot a Multiboot-compliant OS. + +@enumerate +@item +Set GRUB's root device to the same drive as GNU/Linux's. Probably the +command @code{find /vmlinuz} or similar can help you (@pxref{find}). + +@item +Load the kernel: + +@example +grub> @kbd{kernel /vmlinuz root=/dev/hda1} +@end example + +If you need to specify some kernel parameters, just append them to the +command. For example, to set @option{vga} to @samp{ext}, do this: + +@example +grub> @kbd{kernel /vmlinuz root=/dev/hda1 vga=ext} +@end example + +See the documentation in the Linux source tree for complete +information on the available options. + +@item +If you use an initrd, execute the command @command{initrd} +(@pxref{initrd}) after @command{kernel}: + +@example +grub> @kbd{initrd /initrd} +@end example + +@item +Finally, run the command @command{boot} (@pxref{boot}). +@end enumerate + +@strong{Caution:} If you use an initrd and specify the @samp{mem=} +option to the kernel to let it use less than actual memory size, you +will also have to specify the same memory size to GRUB. To let GRUB know +the size, run the command @command{uppermem} @emph{before} loading the +kernel. @xref{uppermem}, for more information. + + +@node FreeBSD +@subsection FreeBSD + +GRUB can load the kernel directly, either in ELF or a.out format. But +this is not recommended, since FreeBSD's bootstrap interface sometimes +changes heavily, so GRUB can't guarantee to pass kernel parameters +correctly. + +Thus, we'd recommend loading the very flexible loader +@file{/boot/loader} instead. See this example: + +@example +@group +grub> @kbd{root (hd0,a)} +grub> @kbd{kernel /boot/loader} +grub> @kbd{boot} +@end group +@end example + + +@node NetBSD +@subsection NetBSD + +GRUB can load NetBSD a.out and ELF directly, follow these steps: + +@enumerate +@item +Set GRUB's root device with @command{root} (@pxref{root}). + +@item +Load the kernel with @command{kernel} (@pxref{kernel}). You should +append the ugly option @option{--type=netbsd}, if you want to load an +ELF kernel, like this: + +@example +grub> @kbd{kernel --type=netbsd /netbsd-elf} +@end example + +@item +Run @command{boot} (@pxref{boot}). +@end enumerate + +For now, however, GRUB doesn't allow you to pass kernel parameters, so +it may be better to chain-load it instead. For more information, please +see @ref{Chain-loading}. + + +@node OpenBSD +@subsection OpenBSD + +The booting instruction is exactly the same as for NetBSD +(@pxref{NetBSD}). + + +@node DOS/Windows +@subsection DOS/Windows + +GRUB cannot boot DOS or Windows directly, so you must chain-load them +(@pxref{Chain-loading}). However, their boot loaders have some critical +deficiencies, so it may not work to just chain-load them. To overcome +the problems, GRUB provides you with two helper functions. + +If you have installed DOS (or Windows) on a non-first hard disk, you +have to use the disk swapping technique, because that OS cannot boot +from any disks but the first one. The workaround used in GRUB is the +command @command{map} (@pxref{map}), like this: + +@example +@group +grub> @kbd{map (hd0) (hd1)} +grub> @kbd{map (hd1) (hd0)} +@end group +@end example + +This performs a @dfn{virtual} swap between your first and second hard +drive. + +@strong{Caution:} This is effective only if DOS (or Windows) uses BIOS +to access the swapped disks. If that OS uses a special driver for the +disks, this probably won't work. + +Another problem arises if you installed more than one set of DOS/Windows +onto one disk, because they could be confused if there are more than one +primary partitions for DOS/Windows. Certainly you should avoid doing +this, but there is a solution if you do want to do so. Use the partition +hiding/unhiding technique. + +If GRUB @dfn{hide}s a DOS (or Windows) partition (@pxref{hide}), DOS (or +Windows) will ignore the partition. If GRUB @dfn{unhide}s a DOS (or +Windows) partition (@pxref{unhide}), DOS (or Windows) will detect the +partition. Thus, if you have installed DOS (or Windows) on the first +and the second partition of the first hard disk, and you want to boot +the copy on the first partition, do the following: + +@example +@group +grub> @kbd{unhide (hd0,0)} +grub> @kbd{hide (hd0,1)} +grub> @kbd{rootnoverify (hd0,0)} +grub> @kbd{chainloader +1} +grub> @kbd{makeactive} +grub> @kbd{boot} +@end group +@end example + + +@node SCO UnixWare +@subsection SCO UnixWare + +It is known that the signature in the boot loader for SCO UnixWare is +wrong, so you will have to specify the option @option{--force} to +@command{chainloader} (@pxref{chainloader}), like this: + +@example +@group +grub> @kbd{rootnoverify (hd1,0)} +grub> @kbd{chainloader --force +1} +grub> @kbd{makeactive} +grub> @kbd{boot} +@end group +@end example + + +@node QNX +@subsection QNX + +QNX seems to use a bigger boot loader, so you need to boot it up, like +this: + +@example +@group +grub> @kbd{rootnoverify (hd1,1)} +grub> @kbd{chainloader +4} +grub> @kbd{boot} +@end group +@end example + + +@node Making your system robust +@section How to make your system robust + +When you test a new kernel or a new OS, it is important to make sure +that your computer can boot even if the new system is unbootable. This +is crucial especially if you maintain servers or remote systems. To +accomplish this goal, you need to set up two things: + +@enumerate +@item +You must maintain a system which is always bootable. For instance, if +you test a new kernel, you need to keep a working kernel in a +different place. And, it would sometimes be very nice to even have a +complete copy of a working system in a different partition or disk. + +@item +You must direct GRUB to boot a working system when the new system +fails. This is possible with the @dfn{fallback} system in GRUB. +@end enumerate + +The former requirement is very specific to each OS, so this +documentation does not cover that topic. It is better to consult some +backup tools. + +So let's see the GRUB part. There are two possibilities: one of them +is quite simple but not very robust, and the other is a bit complex to +set up but probably the best solution to make sure that your system +can start as long as GRUB itself is bootable. + +@menu +* Booting once-only:: +* Booting fallback systems:: +@end menu + + +@node Booting once-only +@subsection Booting once-only + +You can teach GRUB to boot an entry only at next boot time. Suppose +that your have an old kernel @file{old_kernel} and a new kernel +@file{new_kernel}. You know that @file{old_kernel} can boot +your system correctly, and you want to test @file{new_kernel}. + +To ensure that your system will go back to the old kernel even if the +new kernel fails (e.g. it panics), you can specify that GRUB should +try the new kernel only once and boot the old kernel after that. + +First, modify your configuration file. Here is an example: + +@example +@group +default saved # This is important!!! +timeout 10 + +title the old kernel +root (hd0,0) +kernel /old_kernel +savedefault + +title the new kernel +root (hd0,0) +kernel /new_kernel +savedefault 0 # This is important!!! +@end group +@end example + +Note that this configuration file uses @samp{default saved} +(@pxref{default}) at the head and @samp{savedefault 0} +(@pxref{savedefault}) in the entry for the new kernel. This means +that GRUB boots a saved entry by default, and booting the entry for the +new kernel saves @samp{0} as the saved entry. + +With this configuration file, after all, GRUB always tries to boot the +old kernel after it booted the new one, because @samp{0} is the entry +of @code{the old kernel}. + +The next step is to tell GRUB to boot the new kernel at next boot +time. For this, execute @command{grub-set-default} (@pxref{Invoking +grub-set-default}): + +@example +# @kbd{grub-set-default 1} +@end example + +This command sets the saved entry to @samp{1}, that is, to the new +kernel. + +This method is useful, but still not very robust, because GRUB stops +booting, if there is any error in the boot entry, such that the new +kernel has an invalid executable format. Thus, it it even better to +use the @dfn{fallback} mechanism of GRUB. Look at next subsection for +this feature. + + +@node Booting fallback systems +@subsection Booting fallback systems + +GRUB supports a fallback mechanism of booting one or more other +entries if a default boot entry fails. You can specify multiple +fallback entries if you wish. + +Suppose that you have three systems, @samp{A}, @samp{B} and +@samp{C}. @samp{A} is a system which you want to boot by +default. @samp{B} is a backup system which is supposed to boot +safely. @samp{C} is another backup system which is used in case where +@samp{B} is broken. + +Then you may want GRUB to boot the first system which is bootable +among @samp{A}, @samp{B} and @samp{C}. A configuration file can be +written in this way: + +@example +@group +default saved # This is important!!! +timeout 10 +fallback 1 2 # This is important!!! + +title A +root (hd0,0) +kernel /kernel +savedefault fallback # This is important!!! + +title B +root (hd1,0) +kernel /kernel +savedefault fallback # This is important!!! + +title C +root (hd2,0) +kernel /kernel +savedefault +@end group +@end example + +Note that @samp{default saved} (@pxref{default}), @samp{fallback 1 2} +and @samp{savedefault fallback} are used. GRUB will boot a saved entry +by default and save a fallback entry as next boot entry with this +configuration. + +When GRUB tries to boot @samp{A}, GRUB saves @samp{1} as next boot +entry, because the command @command{fallback} specifies that @samp{1} +is the first fallback entry. The entry @samp{1} is @samp{B}, so GRUB +will try to boot @samp{B} at next boot time. + +Likewise, when GRUB tries to boot @samp{B}, GRUB saves @samp{2} as +next boot entry, because @command{fallback} specifies @samp{2} as next +fallback entry. This makes sure that GRUB will boot @samp{C} after +booting @samp{B}. + +It is noteworthy that GRUB uses fallback entries both when GRUB +itself fails in booting an entry and when @samp{A} or @samp{B} fails +in starting up your system. So this solution ensures that your system +is started even if GRUB cannot find your kernel or if your kernel +panics. + +However, you need to run @command{grub-set-default} (@pxref{Invoking +grub-set-default}) when @samp{A} starts correctly or you fix @samp{A} +after it crashes, since GRUB always sets next boot entry to a fallback +entry. You should run this command in a startup script such as +@file{rc.local} to boot @samp{A} by default: + +@example +# @kbd{grub-set-default 0} +@end example + +where @samp{0} is the number of the boot entry for the system +@samp{A}. + +If you want to see what is current default entry, you can look at the +file @file{/boot/grub/default} (or @file{/grub/default} in +some systems). Because this file is plain-text, you can just +@command{cat} this file. But it is strongly recommended @strong{not to +modify this file directly}, because GRUB may fail in saving a default +entry in this file, if you change this file in an unintended +manner. Therefore, you should use @command{grub-set-default} when you +need to change the default entry. + + +@node Configuration +@chapter Configuration + +You've probably noticed that you need to type several commands to boot your +OS. There's a solution to that - GRUB provides a menu interface +(@pxref{Menu interface}) from which you can select an item (using arrow +keys) that will do everything to boot an OS. + +To enable the menu, you need a configuration file, +@file{menu.lst} under the boot directory. We'll analyze an example +file. + +The file first contains some general settings, the menu interface +related options. You can put these commands (@pxref{Menu-specific +commands}) before any of the items (starting with @command{title} +(@pxref{title})). + +@example +@group +# +# Sample boot menu configuration file +# +@end group +@end example + +As you may have guessed, these lines are comments. Lines starting with a +hash character (@samp{#}), and blank lines, are ignored by GRUB. + +@example +@group +# By default, boot the first entry. +default 0 +@end group +@end example + +The first entry (here, counting starts with number zero, not one!) will +be the default choice. + +@example +@group +# Boot automatically after 30 secs. +timeout 30 +@end group +@end example + +As the comment says, GRUB will boot automatically in 30 seconds, unless +interrupted with a keypress. + +@example +@group +# Fallback to the second entry. +fallback 1 +@end group +@end example + +If, for any reason, the default entry doesn't work, fall back to the +second one (this is rarely used, for obvious reasons). + +Note that the complete descriptions of these commands, which are menu +interface specific, can be found in @ref{Menu-specific +commands}. Other descriptions can be found in @ref{Commands}. + +Now, on to the actual OS definitions. You will see that each entry +begins with a special command, @command{title} (@pxref{title}), and the +action is described after it. Note that there is no command +@command{boot} (@pxref{boot}) at the end of each item. That is because +GRUB automatically executes @command{boot} if it loads other commands +successfully. + +The argument for the command @command{title} is used to display a short +title/description of the entry in the menu. Since @command{title} +displays the argument as is, you can write basically anything there. + +@example +@group +# For booting GNU/Hurd +title GNU/Hurd +root (hd0,0) +kernel /boot/gnumach.gz root=hd0s1 +module /boot/serverboot.gz +@end group +@end example + +This boots GNU/Hurd from the first hard disk. + +@example +@group +# For booting GNU/Linux +title GNU/Linux +kernel (hd1,0)/vmlinuz root=/dev/hdb1 +@end group +@end example + +This boots GNU/Linux, but from the second hard disk. + +@example +@group +# For booting Mach (getting kernel from floppy) +title Utah Mach4 multiboot +root (hd0,2) +pause Insert the diskette now^G!! +kernel (fd0)/boot/kernel root=hd0s3 +module (fd0)/boot/bootstrap +@end group +@end example + +This boots Mach with a kernel on a floppy, but the root filesystem at +hd0s3. It also contains a @command{pause} line (@pxref{pause}), which +will cause GRUB to display a prompt and delay, before actually executing +the rest of the commands and booting. + +@example +@group +# For booting FreeBSD +title FreeBSD +root (hd0,2,a) +kernel /boot/loader +@end group +@end example + +This item will boot FreeBSD kernel loaded from the @samp{a} partition of +the third @sc{pc} slice of the first hard disk. + +@example +@group +# For booting OS/2 +title OS/2 +root (hd0,1) +makeactive +# chainload OS/2 bootloader from the first sector +chainloader +1 +# This is similar to "chainload", but loads a specific file +#chainloader /boot/chain.os2 +@end group +@end example + +This will boot OS/2, using a chain-loader (@pxref{Chain-loading}). + +@example +@group +# For booting Windows NT or Windows95 +title Windows NT / Windows 95 boot menu +root (hd0,0) +makeactive +chainloader +1 +# For loading DOS if Windows NT is installed +# chainload /bootsect.dos +@end group +@end example + +The same as the above, but for Windows. + +@example +@group +# For installing GRUB into the hard disk +title Install GRUB into the hard disk +root (hd0,0) +setup (hd0) +@end group +@end example + +This will just (re)install GRUB onto the hard disk. + +@example +# Change the colors. +title Change the colors +color light-green/brown blink-red/blue +@end example + +In the last entry, the command @command{color} is used (@pxref{color}), +to change the menu colors (try it!). This command is somewhat special, +because it can be used both in the command-line and in the menu. GRUB +has several such commands, see @ref{General commands}. + +We hope that you now understand how to use the basic features of +GRUB. To learn more about GRUB, see the following chapters. + + +@node Network +@chapter Downloading OS images from a network + +Although GRUB is a disk-based boot loader, it does provide network +support. To use the network support, you need to enable at least one +network driver in the GRUB build process. For more information please +see @file{netboot/README.netboot} in the source distribution. + +@menu +* General usage of network support:: +* Diskless:: +@end menu + + +@node General usage of network support +@section How to set up your network + +GRUB requires a file server and optionally a server that will assign an +IP address to the machine on which GRUB is running. For the former, only +TFTP is supported at the moment. The latter is either BOOTP, DHCP or a +RARP server@footnote{RARP is not advised, since it cannot serve much +information}. It is not necessary to run both the servers on one +computer. How to configure these servers is beyond the scope of this +document, so please refer to the manuals specific to those +protocols/servers. + +If you decided to use a server to assign an IP address, set up the +server and run @command{bootp} (@pxref{bootp}), @command{dhcp} +(@pxref{dhcp}) or @command{rarp} (@pxref{rarp}) for BOOTP, DHCP or RARP, +respectively. Each command will show an assigned IP address, a netmask, +an IP address for your TFTP server and a gateway. If any of the +addresses is wrong or it causes an error, probably the configuration of +your servers isn't set up properly. + +Otherwise, run @command{ifconfig}, like this: + +@example +grub> @kbd{ifconfig --address=192.168.110.23 --server=192.168.110.14} +@end example + +You can also use @command{ifconfig} in conjuction with @command{bootp}, +@command{dhcp} or @command{rarp} (e.g. to reassign the server address +manually). @xref{ifconfig}, for more details. + +Finally, download your OS images from your network. The network can be +accessed using the network drive @samp{(nd)}. Everything else is very +similar to the normal instructions (@pxref{Booting}). + +Here is an example: + +@example +@group +grub> @kbd{bootp} +Probing... [NE*000] +NE2000 base ... +Address: 192.168.110.23 Netmask: 255.255.255.0 +Server: 192.168.110.14 Gateway: 192.168.110.1 + +grub> @kbd{root (nd)} +grub> @kbd{kernel /tftproot/gnumach.gz root=sd0s1} +grub> @kbd{module /tftproot/serverboot.gz} +grub> @kbd{boot} +@end group +@end example + + +@node Diskless +@section Booting from a network + +It is sometimes very useful to boot from a network, especially when you +use a machine which has no local disk. In this case, you need to obtain +a kind of Net Boot @sc{rom}, such as a PXE @sc{rom} or a free software +package like Etherboot. Such a Boot @sc{rom} first boots the machine, +sets up the network card installed into the machine, and downloads a +second stage boot image from the network. Then, the second image will +try to boot an operating system actually from the network. + +GRUB provides two second stage images, @file{nbgrub} and +@file{pxegrub} (@pxref{Images}). These images are the same as the +normal Stage 2, except that they set up a network automatically, and try +to load a configuration file from the network, if specified. The usage +is very simple: If the machine has a PXE @sc{rom}, use +@file{pxegrub}. If the machine has an NBI loader such as Etherboot, use +@file{nbgrub}. There is no difference between them except their +formats. Since the way to load a second stage image you want to use +should be described in the manual on your Net Boot @sc{rom}, please +refer to the manual, for more information. + +However, there is one thing specific to GRUB. Namely, how to specify a +configuration file in a BOOTP/DHCP server. For now, GRUB uses the tag +@samp{150}, to get the name of a configuration file. The following is an +example with a BOOTP configuration: + +@example +@group +.allhost:hd=/tmp:bf=null:\ + :ds=145.71.35.1 145.71.32.1:\ + :sm=255.255.254.0:\ + :gw=145.71.35.1:\ + :sa=145.71.35.5: + +foo:ht=1:ha=63655d0334a7:ip=145.71.35.127:\ + :bf=/nbgrub:\ + :tc=.allhost:\ + :T150="(nd)/tftpboot/menu.lst.foo": +@end group +@end example + +Note that you should specify the drive name @code{(nd)} in the name of +the configuration file. This is because you might change the root drive +before downloading the configuration from the TFTP server when the +preset menu feature is used (@pxref{Preset Menu}). + +See the manual of your BOOTP/DHCP server for more information. The +exact syntax should differ a little from the example. + + +@node Serial terminal +@chapter Using GRUB via a serial line + +This chapter describes how to use the serial terminal support in GRUB. + +If you have many computers or computers with no display/keyboard, it +could be very useful to control the computers through serial +communications. To connect one computer with another via a serial line, +you need to prepare a null-modem (cross) serial cable, and you may need +to have multiport serial boards, if your computer doesn't have extra +serial ports. In addition, a terminal emulator is also required, such as +minicom. Refer to a manual of your operating system, for more +information. + +As for GRUB, the instruction to set up a serial terminal is quite +simple. First of all, make sure that you haven't specified the option +@option{--disable-serial} to the configure script when you built your +GRUB images. If you get them in binary form, probably they have serial +terminal support already. + +Then, initialize your serial terminal after GRUB starts up. Here is an +example: + +@example +@group +grub> @kbd{serial --unit=0 --speed=9600} +grub> @kbd{terminal serial} +@end group +@end example + +The command @command{serial} initializes the serial unit 0 with the +speed 9600bps. The serial unit 0 is usually called @samp{COM1}, so, if +you want to use COM2, you must specify @samp{--unit=1} instead. This +command accepts many other options, so please refer to @ref{serial}, +for more details. + +The command @command{terminal} (@pxref{terminal}) chooses which type of +terminal you want to use. In the case above, the terminal will be a +serial terminal, but you can also pass @code{console} to the command, +as @samp{terminal serial console}. In this case, a terminal in which +you press any key will be selected as a GRUB terminal. + +However, note that GRUB assumes that your terminal emulator is +compatible with VT100 by default. This is true for most terminal +emulators nowadays, but you should pass the option @option{--dumb} to +the command if your terminal emulator is not VT100-compatible or +implements few VT100 escape sequences. If you specify this option then +GRUB provides you with an alternative menu interface, because the normal +menu requires several fancy features of your terminal. + + +@node Preset Menu +@chapter Embedding a configuration file into GRUB + +GRUB supports a @dfn{preset menu} which is to be always loaded before +starting. The preset menu feature is useful, for example, when your +computer has no console but a serial cable. In this case, it is +critical to set up the serial terminal as soon as possible, since you +cannot see any message until the serial terminal begins to work. So it +is good to run the commands @command{serial} (@pxref{serial}) and +@command{terminal} (@pxref{terminal}) before anything else at the +start-up time. + +How the preset menu works is slightly complicated: + +@enumerate +@item +GRUB checks if the preset menu feature is used, and loads the preset +menu, if available. This includes running commands and reading boot +entries, like an ordinary configuration file. + +@item +GRUB checks if the configuration file is available. Note that this check +is performed @strong{regardless of the existence of the preset +menu}. The configuration file is loaded even if the preset menu was +loaded. + +@item +If the preset menu includes any boot entries, they are cleared when +the configuration file is loaded. It doesn't matter whether the +configuration file has any entries or no entry. The boot entries in the +preset menu are used only when GRUB fails in loading the configuration +file. +@end enumerate + +To enable the preset menu feature, you must rebuild GRUB specifying a +file to the configure script with the option +@option{--enable-preset-menu}. The file has the same semantics as +normal configuration files (@pxref{Configuration}). + +Another point you should take care is that the diskless support +(@pxref{Diskless}) diverts the preset menu. Diskless images embed a +preset menu to execute the command @command{bootp} (@pxref{bootp}) +automatically, unless you specify your own preset menu to the configure +script. This means that you must put commands to initialize a network in +the preset menu yourself, because diskless images don't set it up +implicitly, when you use the preset menu explicitly. + +Therefore, a typical preset menu used with diskless support would be +like this: + +@example +@group +# Set up the serial terminal, first of all. +serial --unit=0 --speed=19200 +terminal --timeout=0 serial + +# Initialize the network. +dhcp +@end group +@end example + + +@node Security +@chapter Protecting your computer from cracking + +You may be interested in how to prevent ordinary users from doing +whatever they like, if you share your computer with other people. So +this chapter describes how to improve the security of GRUB. + +One thing which could be a security hole is that the user can do too +many things with GRUB, because GRUB allows one to modify its configuration +and run arbitrary commands at run-time. For example, the user can even +read @file{/etc/passwd} in the command-line interface by the command +@command{cat} (@pxref{cat}). So it is necessary to disable all the +interactive operations. + +Thus, GRUB provides a @dfn{password} feature, so that only administrators +can start the interactive operations (i.e. editing menu entries and +entering the command-line interface). To use this feature, you need to +run the command @command{password} in your configuration file +(@pxref{password}), like this: + +@example +password --md5 PASSWORD +@end example + +If this is specified, GRUB disallows any interactive control, until you +press the key @key{p} and enter a correct password. The option +@option{--md5} tells GRUB that @samp{PASSWORD} is in MD5 format. If it +is omitted, GRUB assumes the @samp{PASSWORD} is in clear text. + +You can encrypt your password with the command @command{md5crypt} +(@pxref{md5crypt}). For example, run the grub shell (@pxref{Invoking the +grub shell}), and enter your password: + +@example +@group +grub> md5crypt +Password: ********** +Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb. +@end group +@end example + +Then, cut and paste the encrypted password to your configuration file. + +Also, you can specify an optional argument to @command{password}. See +this example: + +@example +password PASSWORD /boot/grub/menu-admin.lst +@end example + +In this case, GRUB will load @file{/boot/grub/menu-admin.lst} as a +configuration file when you enter the valid password. + +Another thing which may be dangerous is that any user can choose any +menu entry. Usually, this wouldn't be problematic, but you might want to +permit only administrators to run some of your menu entries, such as an +entry for booting an insecure OS like DOS. + +GRUB provides the command @command{lock} (@pxref{lock}). This command +always fails until you enter the valid password, so you can use it, like +this: + +@example +@group +title Boot DOS +lock +rootnoverify (hd0,1) +makeactive +chainload +1 +@end group +@end example + +You should insert @command{lock} right after @command{title}, because +any user can execute commands in an entry until GRUB encounters +@command{lock}. + +You can also use the command @command{password} instead of +@command{lock}. In this case the boot process will ask for the password +and stop if it was entered incorrectly. Since the @command{password} +takes its own @var{PASSWORD} argument this is useful if you want +different passwords for different entries. + + +@node Images +@chapter GRUB image files + +GRUB consists of several images: two essential stages, optional stages +called @dfn{Stage 1.5}, one image for bootable CD-ROM, and two network +boot images. Here is a short overview of them. @xref{Internals}, for +more details. + +@table @file +@item stage1 +This is an essential image used for booting up GRUB. Usually, this is +embedded in an MBR or the boot sector of a partition. Because a PC boot +sector is 512 bytes, the size of this image is exactly 512 bytes. + +All @file{stage1} must do is to load Stage 2 or Stage 1.5 from a local +disk. Because of the size restriction, @file{stage1} encodes the +location of Stage 2 (or Stage 1.5) in a block list format, so it never +understand any filesystem structure. + +@item stage2 +This is the core image of GRUB. It does everything but booting up +itself. Usually, this is put in a filesystem, but that is not required. + +@item e2fs_stage1_5 +@itemx fat_stage1_5 +@itemx ffs_stage1_5 +@itemx jfs_stage1_5 +@itemx minix_stage1_5 +@itemx reiserfs_stage1_5 +@itemx vstafs_stage1_5 +@itemx xfs_stage1_5 + +These are called @dfn{Stage 1.5}, because they serve as a bridge +between @file{stage1} and @file{stage2}, that is to say, Stage 1.5 is +loaded by Stage 1 and Stage 1.5 loads Stage 2. The difference between +@file{stage1} and @file{*_stage1_5} is that the former doesn't +understand any filesystem while the latter understands one filesystem +(e.g. @file{e2fs_stage1_5} understands ext2fs). So you can move the +Stage 2 image to another location safely, even after GRUB has been +installed. + +While Stage 2 cannot generally be embedded in a fixed area as the size +is so large, Stage 1.5 can be installed into the area right after an MBR, +or the boot loader area of a ReiserFS or a FFS. + +@item stage2_eltorito +This is a boot image for CD-ROMs using the @dfn{no emulation mode} in +El Torito specification. This is identical to Stage 2, except that +this boots up without Stage 1 and sets up a special drive @samp{(cd)}. + +@item nbgrub +This is a network boot image for the Network Image Proposal used by some +network boot loaders, such as Etherboot. This is mostly the same as +Stage 2, but it also sets up a network and loads a configuration file +from the network. + +@item pxegrub +This is another network boot image for the Preboot Execution Environment +used by several Netboot ROMs. This is identical to @file{nbgrub}, except +for the format. +@end table + + +@node Filesystem +@chapter Filesystem syntax and semantics + +GRUB uses a special syntax for specifying disk drives which can be +accessed by BIOS. Because of BIOS limitations, GRUB cannot distinguish +between IDE, ESDI, SCSI, or others. You must know yourself which BIOS +device is equivalent to which OS device. Normally, that will be clear if +you see the files in a device or use the command @command{find} +(@pxref{find}). + +@menu +* Device syntax:: How to specify devices +* File name syntax:: How to specify files +* Block list syntax:: How to specify block lists +@end menu + + +@node Device syntax +@section How to specify devices + +The device syntax is like this: + +@example +@code{(@var{device}[,@var{part-num}][,@var{bsd-subpart-letter}])} +@end example + +@samp{[]} means the parameter is optional. @var{device} should be +either @samp{fd} or @samp{hd} followed by a digit, like @samp{fd0}. +But you can also set @var{device} to a hexadecimal or a decimal number +which is a BIOS drive number, so the following are equivalent: + +@example +(hd0) +(0x80) +(128) +@end example + +@var{part-num} represents the partition number of @var{device}, starting +from zero for primary partitions and from four for extended partitions, +and @var{bsd-subpart-letter} represents the BSD disklabel subpartition, +such as @samp{a} or @samp{e}. + +A shortcut for specifying BSD subpartitions is +@code{(@var{device},@var{bsd-subpart-letter})}, in this case, GRUB +searches for the first PC partition containing a BSD disklabel, then +finds the subpartition @var{bsd-subpart-letter}. Here is an example: + +@example +(hd0,a) +@end example + +The syntax @samp{(hd0)} represents using the entire disk (or the +MBR when installing GRUB), while the syntax @samp{(hd0,0)} +represents using the first partition of the disk (or the boot sector +of the partition when installing GRUB). + +If you enabled the network support, the special drive, @samp{(nd)}, is +also available. Before using the network drive, you must initialize the +network. @xref{Network}, for more information. + +If you boot GRUB from a CD-ROM, @samp{(cd)} is available. @xref{Making +a GRUB bootable CD-ROM}, for details. + + +@node File name syntax +@section How to specify files + +There are two ways to specify files, by @dfn{absolute file name} and by +@dfn{block list}. + +An absolute file name resembles a Unix absolute file name, using +@samp{/} for the directory separator (not @samp{\} as in DOS). One +example is @samp{(hd0,0)/boot/grub/menu.lst}. This means the file +@file{/boot/grub/menu.lst} in the first partition of the first hard +disk. If you omit the device name in an absolute file name, GRUB uses +GRUB's @dfn{root device} implicitly. So if you set the root device to, +say, @samp{(hd1,0)} by the command @command{root} (@pxref{root}), then +@code{/boot/kernel} is the same as @code{(hd1,0)/boot/kernel}. + + +@node Block list syntax +@section How to specify block lists + +A block list is used for specifying a file that doesn't appear in the +filesystem, like a chainloader. The syntax is +@code{[@var{offset}]+@var{length}[,[@var{offset}]+@var{length}]@dots{}}. +Here is an example: + +@example +@code{0+100,200+1,300+300} +@end example + +This represents that GRUB should read blocks 0 through 99, block 200, +and blocks 300 through 599. If you omit an offset, then GRUB assumes +the offset is zero. + +Like the file name syntax (@pxref{File name syntax}), if a blocklist +does not contain a device name, then GRUB uses GRUB's @dfn{root +device}. So @code{(hd0,1)+1} is the same as @code{+1} when the root +device is @samp{(hd0,1)}. + + +@node Interface +@chapter GRUB's user interface + +GRUB has both a simple menu interface for choosing preset entries from a +configuration file, and a highly flexible command-line for performing +any desired combination of boot commands. + +GRUB looks for its configuration file as soon as it is loaded. If one +is found, then the full menu interface is activated using whatever +entries were found in the file. If you choose the @dfn{command-line} menu +option, or if the configuration file was not found, then GRUB drops to +the command-line interface. + +@menu +* Command-line interface:: The flexible command-line interface +* Menu interface:: The simple menu interface +* Menu entry editor:: Editing a menu entry +* Hidden menu interface:: The hidden menu interface +@end menu + + +@node Command-line interface +@section The flexible command-line interface + +The command-line interface provides a prompt and after it an editable +text area much like a command-line in Unix or DOS. Each command is +immediately executed after it is entered@footnote{However, this +behavior will be changed in the future version, in a user-invisible +way.}. The commands (@pxref{Command-line and menu entry commands}) are a +subset of those available in the configuration file, used with exactly +the same syntax. + +Cursor movement and editing of the text on the line can be done via a +subset of the functions available in the Bash shell: + +@table @key +@item C-f +@itemx PC right key +Move forward one character. + +@item C-b +@itemx PC left key +Move back one character. + +@item C-a +@itemx HOME +Move to the start of the line. + +@item C-e +@itemx END +Move the the end of the line. + +@item C-d +@itemx DEL +Delete the character underneath the cursor. + +@item C-h +@itemx BS +Delete the character to the left of the cursor. + +@item C-k +Kill the text from the current cursor position to the end of the line. + +@item C-u +Kill backward from the cursor to the beginning of the line. + +@item C-y +Yank the killed text back into the buffer at the cursor. + +@item C-p +@itemx PC up key +Move up through the history list. + +@item C-n +@itemx PC down key +Move down through the history list. +@end table + +When typing commands interactively, if the cursor is within or before +the first word in the command-line, pressing the @key{TAB} key (or +@key{C-i}) will display a listing of the available commands, and if the +cursor is after the first word, the @kbd{@key{TAB}} will provide a +completion listing of disks, partitions, and file names depending on the +context. Note that to obtain a list of drives, one must open a +parenthesis, as @command{root (}. + +Note that you cannot use the completion functionality in the TFTP +filesystem. This is because TFTP doesn't support file name listing for +the security. + + +@node Menu interface +@section The simple menu interface + +The menu interface is quite easy to use. Its commands are both +reasonably intuitive and described on screen. + +Basically, the menu interface provides a list of @dfn{boot entries} to +the user to choose from. Use the arrow keys to select the entry of +choice, then press @key{RET} to run it. An optional timeout is +available to boot the default entry (the first one if not set), which is +aborted by pressing any key. + +Commands are available to enter a bare command-line by pressing @key{c} +(which operates exactly like the non-config-file version of GRUB, but +allows one to return to the menu if desired by pressing @key{ESC}) or to +edit any of the @dfn{boot entries} by pressing @key{e}. + +If you protect the menu interface with a password (@pxref{Security}), +all you can do is choose an entry by pressing @key{RET}, or press +@key{p} to enter the password. + + +@node Menu entry editor +@section Editing a menu entry + +The menu entry editor looks much like the main menu interface, but the +lines in the menu are individual commands in the selected entry instead +of entry names. + +If an @key{ESC} is pressed in the editor, it aborts all the changes made +to the configuration entry and returns to the main menu interface. + +When a particular line is selected, the editor places the user in a +special version of the GRUB command-line to edit that line. When the +user hits @key{RET}, GRUB replaces the line in question in the boot +entry with the changes (unless it was aborted via @key{ESC}, +in which case the changes are thrown away). + +If you want to add a new line to the menu entry, press @key{o} if adding +a line after the current line or press @key{O} if before the current +line. + +To delete a line, hit the key @key{d}. Although GRUB unfortunately +does not support @dfn{undo}, you can do almost the same thing by just +returning to the main menu. + + +@node Hidden menu interface +@section The hidden menu interface + +When your terminal is dumb or you request GRUB to hide the menu +interface explicitly with the command @command{hiddenmenu} +(@pxref{hiddenmenu}), GRUB doesn't show the menu interface (@pxref{Menu +interface}) and automatically boots the default entry, unless +interrupted by pressing @key{ESC}. + +When you interrupt the timeout and your terminal is dumb, GRUB falls +back to the command-line interface (@pxref{Command-line interface}). + + +@node Commands +@chapter The list of available commands + +In this chapter, we list all commands that are available in GRUB. + +Commands belong to different groups. A few can only be used in +the global section of the configuration file (or ``menu''); most +of them can be entered on the command-line and can be used either +anywhere in the menu or specifically in the menu entries. + +@menu +* Menu-specific commands:: +* General commands:: +* Command-line and menu entry commands:: +@end menu + + +@node Menu-specific commands +@section The list of commands for the menu only + +The semantics used in parsing the configuration file are the following: + +@itemize @bullet +@item +The menu-specific commands have to be used before any others. + +@item +The files @emph{must} be in plain-text format. + +@item +@samp{#} at the beginning of a line in a configuration file means it is +only a comment. + +@item +Options are separated by spaces. + +@item +All numbers can be either decimal or hexadecimal. A hexadecimal number +must be preceded by @samp{0x}, and is case-insensitive. + +@item +Extra options or text at the end of the line are ignored unless otherwise +specified. + +@item +Unrecognized commands are added to the current entry, except before entries +start, where they are ignored. +@end itemize + +These commands can only be used in the menu: + +@menu +* default:: Set the default entry +* fallback:: Set the fallback entry +* hiddenmenu:: Hide the menu interface +* timeout:: Set the timeout +* title:: Start a menu entry +@end menu + + +@node default +@subsection default + +@deffn Command default num +Set the default entry to the entry number @var{num}. Numbering starts +from 0, and the entry number 0 is the default if the command is not +used. + +You can specify @samp{saved} instead of a number. In this case, the +default entry is the entry saved with the command +@command{savedefault}. @xref{savedefault}, for more information. +@end deffn + + +@node fallback +@subsection fallback + +@deffn Command fallback num... +Go into unattended boot mode: if the default boot entry has any errors, +instead of waiting for the user to do something, immediately start +over using the @var{num} entry (same numbering as the @code{default} +command (@pxref{default})). This obviously won't help if the machine was +rebooted by a kernel that GRUB loaded. You can specify multiple +fallback entry numbers. +@end deffn + + +@node hiddenmenu +@subsection hiddenmenu + +@deffn Command hiddenmenu +Don't display the menu. If the command is used, no menu will be +displayed on the control terminal, and the default entry will be +booted after the timeout expired. The user can still request the +menu to be displayed by pressing @key{ESC} before the timeout +expires. See also @ref{Hidden menu interface}. +@end deffn + + +@node timeout +@subsection timeout + +@deffn Command timeout sec +Set a timeout, in @var{sec} seconds, before automatically booting the +default entry (normally the first entry defined). +@end deffn + + +@node title +@subsection title + +@deffn Command title name @dots{} +Start a new boot entry, and set its name to the contents of the rest of +the line, starting with the first non-space character. +@end deffn + + +@node General commands +@section The list of general commands + +Commands usable anywhere in the menu and in the command-line. + +@menu +* bootp:: Initialize a network device via BOOTP +* color:: Color the menu interface +* device:: Specify a file as a drive +* dhcp:: Initialize a network device via DHCP +* hide:: Hide a partition +* ifconfig:: Configure a network device manually +* pager:: Change the state of the internal pager +* partnew:: Make a primary partition +* parttype:: Change the type of a partition +* password:: Set a password for the menu interface +* rarp:: Initialize a network device via RARP +* serial:: Set up a serial device +* setkey:: Configure the key map +* terminal:: Choose a terminal +* terminfo:: Define escape sequences for a terminal +* tftpserver:: Specify a TFTP server +* unhide:: Unhide a partition +@end menu + + +@node bootp +@subsection bootp + +@deffn Command bootp [@option{--with-configfile}] +Initialize a network device via the @dfn{BOOTP} protocol. This command +is only available if GRUB is compiled with netboot support. See also +@ref{Network}. + +If you specify @option{--with-configfile} to this command, GRUB will +fetch and load a configuration file specified by your BOOTP server +with the vendor tag @samp{150}. +@end deffn + + +@node color +@subsection color + +@deffn Command color normal [highlight] +Change the menu colors. The color @var{normal} is used for most +lines in the menu (@pxref{Menu interface}), and the color +@var{highlight} is used to highlight the line where the cursor +points. If you omit @var{highlight}, then the inverted color of +@var{normal} is used for the highlighted line. The format of a color is +@code{@var{foreground}/@var{background}}. @var{foreground} and +@var{background} are symbolic color names. A symbolic color name must be +one of these: + +@itemize @bullet +@item +black + +@item +blue + +@item +green + +@item +cyan + +@item +red + +@item +magenta + +@item +brown + +@item +light-gray + +@strong{These below can be specified only for the foreground.} + +@item +dark-gray + +@item +light-blue + +@item +light-green + +@item +light-cyan + +@item +light-red + +@item +light-magenta + +@item +yellow + +@item +white +@end itemize + +But only the first eight names can be used for @var{background}. You can +prefix @code{blink-} to @var{foreground} if you want a blinking +foreground color. + +This command can be used in the configuration file and on the command +line, so you may write something like this in your configuration file: + +@example +@group +# Set default colors. +color light-gray/blue black/light-gray + +# Change the colors. +title OS-BS like +color magenta/blue black/magenta +@end group +@end example +@end deffn + + +@node device +@subsection device + +@deffn Command device drive file +In the grub shell, specify the file @var{file} as the actual drive for a +@sc{bios} drive @var{drive}. You can use this command to create a disk +image, and/or to fix the drives guessed by GRUB when GRUB fails to +determine them correctly, like this: + +@example +@group +grub> @kbd{device (fd0) /floppy-image} +grub> @kbd{device (hd0) /dev/sd0} +@end group +@end example + +This command can be used only in the grub shell (@pxref{Invoking the +grub shell}). +@end deffn + + +@node dhcp +@subsection dhcp + +@deffn Command dhcp [--with-configfile] +Initialize a network device via the @dfn{DHCP} protocol. Currently, +this command is just an alias for @command{bootp}, since the two +protocols are very similar. This command is only available if GRUB is +compiled with netboot support. See also @ref{Network}. + +If you specify @option{--with-configfile} to this command, GRUB will +fetch and load a configuration file specified by your DHCP server +with the vendor tag @samp{150}. +@end deffn + + +@node hide +@subsection hide + +@deffn Command hide partition +Hide the partition @var{partition} by setting the @dfn{hidden} bit in +its partition type code. This is useful only when booting DOS or Windows +and multiple primary FAT partitions exist in one disk. See also +@ref{DOS/Windows}. +@end deffn + + +@node ifconfig +@subsection ifconfig + +@deffn Command ifconfig [@option{--server=server}] [@option{--gateway=gateway}] [@option{--mask=mask}] [@option{--address=address}] +Configure the IP address, the netmask, the gateway, and the server +address of a network device manually. The values must be in dotted +decimal format, like @samp{192.168.11.178}. The order of the options is +not important. This command shows current network configuration, if no +option is specified. See also @ref{Network}. +@end deffn + + +@node pager +@subsection pager + +@deffn Command pager [flag] +Toggle or set the state of the internal pager. If @var{flag} is +@samp{on}, the internal pager is enabled. If @var{flag} is @samp{off}, +it is disabled. If no argument is given, the state is toggled. +@end deffn + + +@node partnew +@subsection partnew + +@deffn Command partnew part type from len +Create a new primary partition. @var{part} is a partition specification +in GRUB syntax (@pxref{Naming convention}); @var{type} is the partition +type and must be a number in the range @code{0-0xff}; @var{from} is +the starting address and @var{len} is the length, both in sector units. +@end deffn + + +@node parttype +@subsection parttype + +@deffn Command parttype part type +Change the type of an existing partition. @var{part} is a partition +specification in GRUB syntax (@pxref{Naming convention}); @var{type} +is the new partition type and must be a number in the range 0-0xff. +@end deffn + + +@node password +@subsection password + +@deffn Command password [@option{--md5}] passwd [new-config-file] +If used in the first section of a menu file, disable all interactive +editing control (menu entry editor and command-line) and entries +protected by the command @command{lock}. If the password @var{passwd} is +entered, it loads the @var{new-config-file} as a new config file and +restarts the GRUB Stage 2, if @var{new-config-file} is +specified. Otherwise, GRUB will just unlock the privileged instructions. +You can also use this command in the script section, in which case it +will ask for the password, before continuing. The option +@option{--md5} tells GRUB that @var{passwd} is encrypted with +@command{md5crypt} (@pxref{md5crypt}). +@end deffn + + +@node rarp +@subsection rarp + +@deffn Command rarp +Initialize a network device via the @dfn{RARP} protocol. This command +is only available if GRUB is compiled with netboot support. See also +@ref{Network}. +@end deffn + + +@node serial +@subsection serial + +@deffn Command serial [@option{--unit=unit}] [@option{--port=port}] [@option{--speed=speed}] [@option{--word=word}] [@option{--parity=parity}] [@option{--stop=stop}] [@option{--device=dev}] +Initialize a serial device. @var{unit} is a number in the range 0-3 +specifying which serial port to use; default is 0, which corresponds to +the port often called COM1. @var{port} is the I/O port where the UART +is to be found; if specified it takes precedence over @var{unit}. +@var{speed} is the transmission speed; default is 9600. @var{word} and +@var{stop} are the number of data bits and stop bits. Data bits must +be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data +bits and one stop bit. @var{parity} is one of @samp{no}, @samp{odd}, +@samp{even} and defaults to @samp{no}. The option @option{--device} +can only be used in the grub shell and is used to specify the +tty device to be used in the host operating system (@pxref{Invoking the +grub shell}). + +The serial port is not used as a communication channel unless the +@command{terminal} command is used (@pxref{terminal}). + +This command is only available if GRUB is compiled with serial +support. See also @ref{Serial terminal}. +@end deffn + + +@node setkey +@subsection setkey + +@deffn Command setkey [to_key from_key] +Change the keyboard map. The key @var{from_key} is mapped to the key +@var{to_key}. If no argument is specified, reset key mappings. Note that +this command @emph{does not} exchange the keys. If you want to exchange +the keys, run this command again with the arguments exchanged, like this: + +@example +grub> @kbd{setkey capslock control} +grub> @kbd{setkey control capslock} +@end example + +A key must be an alphabet letter, a digit, or one of these symbols: +@samp{escape}, @samp{exclam}, @samp{at}, @samp{numbersign}, +@samp{dollar}, @samp{percent}, @samp{caret}, @samp{ampersand}, +@samp{asterisk}, @samp{parenleft}, @samp{parenright}, @samp{minus}, +@samp{underscore}, @samp{equal}, @samp{plus}, @samp{backspace}, +@samp{tab}, @samp{bracketleft}, @samp{braceleft}, @samp{bracketright}, +@samp{braceright}, @samp{enter}, @samp{control}, @samp{semicolon}, +@samp{colon}, @samp{quote}, @samp{doublequote}, @samp{backquote}, +@samp{tilde}, @samp{shift}, @samp{backslash}, @samp{bar}, @samp{comma}, +@samp{less}, @samp{period}, @samp{greater}, @samp{slash}, +@samp{question}, @samp{alt}, @samp{space}, @samp{capslock}, @samp{FX} +(@samp{X} is a digit), and @samp{delete}. This table describes to which +character each of the symbols corresponds: + +@table @samp +@item exclam +@samp{!} + +@item at +@samp{@@} + +@item numbersign +@samp{#} + +@item dollar +@samp{$} + +@item percent +@samp{%} + +@item caret +@samp{^} + +@item ampersand +@samp{&} + +@item asterisk +@samp{*} + +@item parenleft +@samp{(} + +@item parenright +@samp{)} + +@item minus +@samp{-} + +@item underscore +@samp{_} + +@item equal +@samp{=} + +@item plus +@samp{+} + +@item bracketleft +@samp{[} + +@item braceleft +@samp{@{} + +@item bracketright +@samp{]} + +@item braceright +@samp{@}} + +@item semicolon +@samp{;} + +@item colon +@samp{:} + +@item quote +@samp{'} + +@item doublequote +@samp{"} + +@item backquote +@samp{`} + +@item tilde +@samp{~} + +@item backslash +@samp{\} + +@item bar +@samp{|} + +@item comma +@samp{,} + +@item less +@samp{<} + +@item period +@samp{.} + +@item greater +@samp{>} + +@item slash +@samp{/} + +@item question +@samp{?} + +@item space +@samp{ } +@end table +@end deffn + + +@node terminal +@subsection terminal + +@deffn Command terminal [@option{--dumb}] [@option{--no-echo}] [@option{--no-edit}] [@option{--timeout=secs}] [@option{--lines=lines}] [@option{--silent}] [@option{console}] [@option{serial}] [@option{hercules}] +Select a terminal for user interaction. The terminal is assumed to be +VT100-compatible unless @option{--dumb} is specified. If both +@option{console} and @option{serial} are specified, then GRUB will use +the one where a key is entered first or the first when the timeout +expires. If neither are specified, the current setting is +reported. This command is only available if GRUB is compiled with serial +support. See also @ref{Serial terminal}. + +This may not make sense for most users, but GRUB supports Hercules +console as well. Hercules console is usable like the ordinary console, +and the usage is quite similar to that for serial terminals: specify +@option{hercules} as the argument. + +The option @option{--lines} defines the number of lines in your +terminal, and it is used for the internal pager function. If you don't +specify this option, the number is assumed as 24. + +The option @option{--silent} suppresses the message to prompt you to +hit any key. This might be useful if your system has no terminal +device. + +The option @option{--no-echo} has GRUB not to echo back input +characters. This implies the option @option{--no-edit}. + +The option @option{--no-edit} disables the BASH-like editing feature. +@end deffn + + +@node terminfo +@subsection terminfo + +@deffn Command terminfo @option{--name=name} @option{--cursor-address=seq} [@option{--clear-screen=seq}] [@option{--enter-standout-mode=seq}] [@option{--exit-standout-mode=seq}] +Define the capabilities of your terminal. Use this command to define +escape sequences, if it is not vt100-compatible. You may use @samp{\e} +for @key{ESC} and @samp{^X} for a control character. + +You can use the utility @command{grub-terminfo} to generate +appropriate arguments to this command. @xref{Invoking grub-terminfo}. + +If no option is specified, the current settings are printed. +@end deffn + + +@node tftpserver +@subsection tftpserver + +@deffn Command tftpserver ipaddr +@strong{Caution:} This command exists only for backward +compatibility. Use @command{ifconfig} (@pxref{ifconfig}) instead. + +Override a TFTP server address returned by a BOOTP/DHCP/RARP server. The +argument @var{ipaddr} must be in dotted decimal format, like +@samp{192.168.0.15}. This command is only available if GRUB is compiled +with netboot support. See also @ref{Network}. +@end deffn + + +@node unhide +@subsection unhide + +@deffn Command unhide partition +Unhide the partition @var{partition} by clearing the @dfn{hidden} bit in +its partition type code. This is useful only when booting DOS or Windows +and multiple primary partitions exist on one disk. See also +@ref{DOS/Windows}. +@end deffn + + +@node Command-line and menu entry commands +@section The list of command-line and menu entry commands + +These commands are usable in the command-line and in menu entries. If +you forget a command, you can run the command @command{help} +(@pxref{help}). + +@menu +* blocklist:: Get the block list notation of a file +* boot:: Start up your operating system +* cat:: Show the contents of a file +* chainloader:: Chain-load another boot loader +* cmp:: Compare two files +* configfile:: Load a configuration file +* debug:: Toggle the debug flag +* displayapm:: Display APM information +* displaymem:: Display memory configuration +* embed:: Embed Stage 1.5 +* find:: Find a file +* fstest:: Test a filesystem +* geometry:: Manipulate the geometry of a drive +* halt:: Shut down your computer +* help:: Show help messages +* impsprobe:: Probe SMP +* initrd:: Load an initrd +* install:: Install GRUB +* ioprobe:: Probe I/O ports used for a drive +* kernel:: Load a kernel +* lock:: Lock a menu entry +* makeactive:: Make a partition active +* map:: Map a drive to another +* md5crypt:: Encrypt a password in MD5 format +* module:: Load a module +* modulenounzip:: Load a module without decompression +* pause:: Wait for a key press +* quit:: Exit from the grub shell +* reboot:: Reboot your computer +* read:: Read data from memory +* root:: Set GRUB's root device +* rootnoverify:: Set GRUB's root device without mounting +* savedefault:: Save current entry as the default entry +* setup:: Set up GRUB's installation automatically +* testload:: Load a file for testing a filesystem +* testvbe:: Test VESA BIOS EXTENSION +* uppermem:: Set the upper memory size +* vbeprobe:: Probe VESA BIOS EXTENSION +@end menu + + +@node blocklist +@subsection blocklist + +@deffn Command blocklist file +Print the block list notation of the file @var{file}. @xref{Block list +syntax}. +@end deffn + + +@node boot +@subsection boot + +@deffn Command boot +Boot the OS or chain-loader which has been loaded. Only necessary if +running the fully interactive command-line (it is implicit at the end of +a menu entry). +@end deffn + + +@node cat +@subsection cat + +@deffn Command cat file +Display the contents of the file @var{file}. This command may be useful +to remind you of your OS's root partition: + +@example +grub> @kbd{cat /etc/fstab} +@end example +@end deffn + + +@node chainloader +@subsection chainloader + +@deffn Command chainloader [@option{--force}] file +Load @var{file} as a chain-loader. Like any other file loaded by the +filesystem code, it can use the blocklist notation to grab the first +sector of the current partition with @samp{+1}. If you specify the +option @option{--force}, then load @var{file} forcibly, whether it has a +correct signature or not. This is required when you want to load a +defective boot loader, such as SCO UnixWare 7.1 (@pxref{SCO UnixWare}). +@end deffn + + +@node cmp +@subsection cmp + +@deffn Command cmp file1 file2 +Compare the file @var{file1} with the file @var{file2}. If they differ +in size, print the sizes like this: + +@example +Differ in size: 0x1234 [foo], 0x4321 [bar] +@end example + +If the sizes are equal but the bytes at an offset differ, then print the +bytes like this: + +@example +Differ at the offset 777: 0xbe [foo], 0xef [bar] +@end example + +If they are completely identical, nothing will be printed. +@end deffn + + +@node configfile +@subsection configfile + +@deffn Command configfile file +Load @var{file} as a configuration file. +@end deffn + + +@node debug +@subsection debug + +@deffn Command debug +Toggle debug mode (by default it is off). When debug mode is on, some +extra messages are printed to show disk activity. This global debug flag +is mainly useful for GRUB developers when testing new code. +@end deffn + + +@node displayapm +@subsection displayapm + +@deffn Command displayapm +Display APM BIOS information. +@end deffn + + +@node displaymem +@subsection displaymem + +@deffn Command displaymem +Display what GRUB thinks the system address space map of the machine is, +including all regions of physical @sc{ram} installed. GRUB's +@dfn{upper/lower memory} display uses the standard BIOS interface for +the available memory in the first megabyte, or @dfn{lower memory}, and a +synthesized number from various BIOS interfaces of the memory starting +at 1MB and going up to the first chipset hole for @dfn{upper memory} +(the standard PC @dfn{upper memory} interface is limited to reporting a +maximum of 64MB). +@end deffn + + +@node embed +@subsection embed + +@deffn Command embed stage1_5 device +Embed the Stage 1.5 @var{stage1_5} in the sectors after the MBR if +@var{device} is a drive, or in the @dfn{boot loader} area if @var{device} +is a FFS partition or a ReiserFS partition.@footnote{The latter feature +has not been implemented yet.} Print the number of sectors which +@var{stage1_5} occupies, if successful. + +Usually, you don't need to run this command directly. @xref{setup}. +@end deffn + + +@node find +@subsection find + +@deffn Command find filename +Search for the file name @var{filename} in all mountable partitions +and print the list of the devices which contain the file. The file +name @var{filename} should be an absolute file name like +@code{/boot/grub/stage1}. +@end deffn + + +@node fstest +@subsection fstest + +@deffn Command fstest +Toggle filesystem test mode. +Filesystem test mode, when turned on, prints out data corresponding to +all the device reads and what values are being sent to the low-level +routines. The format is @samp{<@var{partition-offset-sector}, +@var{byte-offset}, @var{byte-length}>} for high-level reads inside a +partition, and @samp{[@var{disk-offset-sector}]} for low-level sector +requests from the disk. +Filesystem test mode is turned off by any use of the @command{install} +(@pxref{install}) or @command{testload} (@pxref{testload}) commands. +@end deffn + + +@node geometry +@subsection geometry + +@deffn Command geometry drive [cylinder head sector [total_sector]] +Print the information for the drive @var{drive}. In the grub shell, you +can set the geometry of the drive arbitrarily. The number of +cylinders, the number of heads, the number of sectors and the number of +total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR, +respectively. If you omit TOTAL_SECTOR, then it will be calculated +based on the C/H/S values automatically. +@end deffn + + +@node halt +@subsection halt + +@deffn Command halt @option{--no-apm} +The command halts the computer. If the @option{--no-apm} option +is specified, no APM BIOS call is performed. Otherwise, the computer +is shut down using APM. +@end deffn + + +@node help +@subsection help + +@deffn Command help @option{--all} [pattern @dots{}] +Display helpful information about builtin commands. If you do not +specify @var{pattern}, this command shows short descriptions of most of +available commands. If you specify the option @option{--all} to this +command, short descriptions of rarely used commands (such as +@ref{testload}) are displayed as well. + +If you specify any @var{patterns}, it displays longer information +about each of the commands which match those @var{patterns}. +@end deffn + + +@node impsprobe +@subsection impsprobe + +@deffn Command impsprobe +Probe the Intel Multiprocessor Specification 1.1 or 1.4 configuration +table and boot the various CPUs which are found into a tight loop. This +command can be used only in the Stage 2, but not in the grub shell. +@end deffn + + +@node initrd +@subsection initrd + +@deffn Command initrd file @dots{} +Load an initial ramdisk for a Linux format boot image and set the +appropriate parameters in the Linux setup area in memory. See also +@ref{GNU/Linux}. +@end deffn + + +@node install +@subsection install + +@deffn Command install [@option{--force-lba}] [@option{--stage2=os_stage2_file}] stage1_file [@option{d}] dest_dev stage2_file [addr] [@option{p}] [config_file] [real_config_file] +This command is fairly complex, and you should not use this command +unless you are familiar with GRUB. Use @command{setup} (@pxref{setup}) +instead. + +In short, it will perform a full install presuming the Stage 2 or Stage +1.5@footnote{They're loaded the same way, so we will refer to the Stage +1.5 as a Stage 2 from now on.} is in its final install location. + +In slightly more detail, it will load @var{stage1_file}, validate that +it is a GRUB Stage 1 of the right version number, install in it a +blocklist for loading @var{stage2_file} as a Stage 2. If the option +@option{d} is present, the Stage 1 will always look for the actual +disk @var{stage2_file} was installed on, rather than using the booting +drive. The Stage 2 will be loaded at address @var{addr}, which must be +@samp{0x8000} for a true Stage 2, and @samp{0x2000} for a Stage 1.5. If +@var{addr} is not present, GRUB will determine the address +automatically. It then writes the completed Stage 1 to the first block +of the device @var{dest_dev}. If the options @option{p} or +@var{config_file} are present, then it reads the first block of stage2, +modifies it with the values of the partition @var{stage2_file} was found +on (for @option{p}) or places the string @var{config_file} into the area +telling the stage2 where to look for a configuration file at boot +time. Likewise, if @var{real_config_file} is present and +@var{stage2_file} is a Stage 1.5, then the Stage 2 @var{config_file} is +patched with the configuration file name @var{real_config_file}. This +command preserves the DOS BPB (and for hard disks, the partition table) +of the sector the Stage 1 is to be installed into. + +@strong{Caution:} Several buggy BIOSes don't pass a booting drive +properly when booting from a hard disk drive. Therefore, you will +unfortunately have to specify the option @option{d}, whether your +Stage2 resides at the booting drive or not, if you have such a +BIOS. We know these are defective in this way: + +@table @asis +@item +Fujitsu LifeBook 400 BIOS version 31J0103A + +@item +HP Vectra XU 6/200 BIOS version GG.06.11 +@end table + +@strong{Caution2:} A number of BIOSes don't return a correct LBA support +bitmap even if they do have the support. So GRUB provides a solution to +ignore the wrong bitmap, that is, the option @option{--force-lba}. Don't +use this option if you know that your BIOS doesn't have LBA support. + +@strong{Caution3:} You must specify the option @option{--stage2} in the +grub shell, if you cannot unmount the filesystem where your stage2 file +resides. The argument should be the file name in your operating system. +@end deffn + + +@node ioprobe +@subsection ioprobe + +@deffn Command ioprobe drive +Probe I/O ports used for the drive @var{drive}. This command will list +the I/O ports on the screen. For technical information, +@xref{Internals}. +@end deffn + + +@node kernel +@subsection kernel + +@deffn Command kernel [@option{--type=type}] [@option{--no-mem-option}] file @dots{} +Attempt to load the primary boot image (Multiboot a.out or @sc{elf}, +Linux zImage or bzImage, FreeBSD a.out, NetBSD a.out, etc.) from +@var{file}. The rest of the line is passed verbatim as the @dfn{kernel +command-line}. Any modules must be reloaded after using this command. + +This command also accepts the option @option{--type} so that you can +specify the kernel type of @var{file} explicitly. The argument +@var{type} must be one of these: @samp{netbsd}, @samp{freebsd}, +@samp{openbsd}, @samp{linux}, @samp{biglinux}, and +@samp{multiboot}. However, you need to specify it only if you want to +load a NetBSD @sc{elf} kernel, because GRUB can automatically determine +a kernel type in the other cases, quite safely. + +The option @option{--no-mem-option} is effective only for Linux. If the +option is specified, GRUB doesn't pass the option @option{mem=} to the +kernel. This option is implied for Linux kernels 2.4.18 and newer. +@end deffn + + +@node lock +@subsection lock + +@deffn Command lock +Prevent normal users from executing arbitrary menu entries. You must use +the command @command{password} if you really want this command to be +useful (@pxref{password}). + +This command is used in a menu, as shown in this example: + +@example +@group +title This entry is too dangerous to be executed by normal users +lock +root (hd0,a) +kernel /no-security-os +@end group +@end example + +See also @ref{Security}. +@end deffn + + +@node makeactive +@subsection makeactive + +@deffn Command makeactive +Set the active partition on the root disk to GRUB's root device. +This command is limited to @emph{primary} PC partitions on a hard disk. +@end deffn + + +@node map +@subsection map + +@deffn Command map to_drive from_drive +Map the drive @var{from_drive} to the drive @var{to_drive}. This is +necessary when you chain-load some operating systems, such as DOS, if +such an OS resides at a non-first drive. Here is an example: + +@example +@group +grub> @kbd{map (hd0) (hd1)} +grub> @kbd{map (hd1) (hd0)} +@end group +@end example + +The example exchanges the order between the first hard disk and the +second hard disk. See also @ref{DOS/Windows}. +@end deffn + + +@node md5crypt +@subsection md5crypt + +@deffn Command md5crypt +Prompt to enter a password, and encrypt it in MD5 format. The encrypted +password can be used with the command @command{password} +(@pxref{password}). See also @ref{Security}. +@end deffn + + +@node module +@subsection module + +@deffn Command module file @dots{} +Load a boot module @var{file} for a Multiboot format boot image (no +interpretation of the file contents are made, so the user of this +command must know what the kernel in question expects). The rest of the +line is passed as the @dfn{module command-line}, like the +@command{kernel} command. You must load a Multiboot kernel image before +loading any module. See also @ref{modulenounzip}. +@end deffn + + +@node modulenounzip +@subsection modulenounzip + +@deffn Command modulenounzip file @dots{} +The same as @command{module} (@pxref{module}), except that automatic +decompression is disabled. +@end deffn + + +@node pause +@subsection pause + +@deffn Command pause message @dots{} +Print the @var{message}, then wait until a key is pressed. Note that +placing @key{^G} (ASCII code 7) in the message will cause the speaker to +emit the standard beep sound, which is useful when prompting the user to +change floppies. +@end deffn + + +@node quit +@subsection quit + +@deffn Command quit +Exit from the grub shell @command{grub} (@pxref{Invoking the grub +shell}). This command can be used only in the grub shell. +@end deffn + + +@node reboot +@subsection reboot + +@deffn Command reboot +Reboot the computer. +@end deffn + + +@node read +@subsection read + +@deffn Command read addr +Read a 32-bit value from memory at address @var{addr} and display it in +hex format. +@end deffn + + +@node root +@subsection root + +@deffn Command root device [hdbias] +Set the current @dfn{root device} to the device @var{device}, then +attempt to mount it to get the partition size (for passing the partition +descriptor in @code{ES:ESI}, used by some chain-loaded boot loaders), the +BSD drive-type (for booting BSD kernels using their native boot format), +and correctly determine the PC partition where a BSD sub-partition is +located. The optional @var{hdbias} parameter is a number to tell a BSD +kernel how many BIOS drive numbers are on controllers before the current +one. For example, if there is an IDE disk and a SCSI disk, and your +FreeBSD root partition is on the SCSI disk, then use a @samp{1} for +@var{hdbias}. + +See also @ref{rootnoverify}. +@end deffn + + +@node rootnoverify +@subsection rootnoverify + +@deffn Command rootnoverify device [hdbias] +Similar to @command{root} (@pxref{root}), but don't attempt to mount the +partition. This is useful for when an OS is outside of the area of the +disk that GRUB can read, but setting the correct root device is still +desired. Note that the items mentioned in @command{root} above which +derived from attempting the mount will @emph{not} work correctly. +@end deffn + + +@node savedefault +@subsection savedefault + +@deffn Command savedefault num +Save the current menu entry or @var{num} if specified as a default +entry. Here is an example: + +@example +@group +default saved +timeout 10 + +title GNU/Linux +root (hd0,0) +kernel /boot/vmlinuz root=/dev/sda1 vga=ext +initrd /boot/initrd +savedefault + +title FreeBSD +root (hd0,a) +kernel /boot/loader +savedefault +@end group +@end example + +With this configuration, GRUB will choose the entry booted previously as +the default entry. + +You can specify @samp{fallback} instead of a number. Then, next +fallback entry is saved. Next fallback entry is chosen from fallback +entries. Normally, this will be the first entry in fallback ones. + +See also @ref{default} and @ref{Invoking grub-set-default}. +@end deffn + + +@node setup +@subsection setup + +@deffn Command setup [@option{--force-lba}] [@option{--stage2=os_stage2_file}] [@option{--prefix=dir}] install_device [image_device] +Set up the installation of GRUB automatically. This command uses the +more flexible command @command{install} (@pxref{install}) in the backend +and installs GRUB into the device @var{install_device}. If +@var{image_device} is specified, then find the GRUB images +(@pxref{Images}) in the device @var{image_device}, otherwise use the +current @dfn{root device}, which can be set by the command +@command{root}. If @var{install_device} is a hard disk, then embed a +Stage 1.5 in the disk if possible. + +The option @option{--prefix} specifies the directory under which GRUB +images are put. If it is not specified, GRUB automatically searches them +in @file{/boot/grub} and @file{/grub}. + +The options @option{--force-lba} and @option{--stage2} are just passed +to @command{install} if specified. @xref{install}, for more +information. +@end deffn + + +@node testload +@subsection testload + +@deffn Command testload file +Read the entire contents of @var{file} in several different ways and +compare them, to test the filesystem code. The output is somewhat +cryptic, but if no errors are reported and the final @samp{i=@var{X}, +filepos=@var{Y}} reading has @var{X} and @var{Y} equal, then it is +definitely consistent, and very likely works correctly subject to a +consistent offset error. If this test succeeds, then a good next step is +to try loading a kernel. +@end deffn + + +@node testvbe +@subsection testvbe + +@deffn Command testvbe mode +Test the VESA BIOS EXTENSION mode @var{mode}. This command will switch +your video card to the graphics mode, and show an endless animation. Hit +any key to return. See also @ref{vbeprobe}. +@end deffn + + +@node uppermem +@subsection uppermem + +@deffn Command uppermem kbytes +Force GRUB to assume that only @var{kbytes} kilobytes of upper memory +are installed. Any system address range maps are discarded. + +@strong{Caution:} This should be used with great caution, and should +only be necessary on some old machines. GRUB's BIOS probe can pick up +all @sc{ram} on all new machines the author has ever heard of. It can +also be used for debugging purposes to lie to an OS. +@end deffn + + +@node vbeprobe +@subsection vbeprobe + +@deffn Command vbeprobe [mode] +Probe VESA BIOS EXTENSION information. If the mode @var{mode} is +specified, show only the information about @var{mode}. Otherwise, this +command lists up available VBE modes on the screen. See also +@ref{testvbe}. +@end deffn + + +@node Troubleshooting +@chapter Error messages reported by GRUB + +This chapter describes error messages reported by GRUB when you +encounter trouble. @xref{Invoking the grub shell}, if your problem is +specific to the grub shell. + +@menu +* Stage1 errors:: Errors reported by the Stage 1 +* Stage1.5 errors:: Errors reported by the Stage 1.5 +* Stage2 errors:: Errors reported by the Stage 2 +@end menu + + +@node Stage1 errors +@section Errors reported by the Stage 1 + +The general way that the Stage 1 handles errors is to print an error +string and then halt. Pressing @kbd{@key{CTRL}-@key{ALT}-@key{DEL}} will +reboot. + +The following is a comprehensive list of error messages for the Stage 1: + +@table @asis +@item Hard Disk Error +The stage2 or stage1.5 is being read from a hard disk, and the attempt +to determine the size and geometry of the hard disk failed. + +@item Floppy Error +The stage2 or stage1.5 is being read from a floppy disk, and the attempt +to determine the size and geometry of the floppy disk failed. It's listed +as a separate error since the probe sequence is different than for hard +disks. + +@item Read Error +A disk read error happened while trying to read the stage2 or stage1.5. + +@item Geom Error +The location of the stage2 or stage1.5 is not in the portion of the disk +supported directly by the BIOS read calls. This could occur because the +BIOS translated geometry has been changed by the user or the disk is +moved to another machine or controller after installation, or GRUB was +not installed using itself (if it was, the Stage 2 version of this error +would have been seen during that process and it would not have completed +the install). +@end table + + +@node Stage1.5 errors +@section Errors reported by the Stage 1.5 + +The general way that the Stage 1.5 handles errors is to print an error +number in the form @code{Error @var{num}} and then halt. Pressing +@kbd{@key{CTRL}-@key{ALT}-@key{DEL}} will reboot. + +The error numbers correspond to the errors reported by Stage +2. @xref{Stage2 errors}. + + +@node Stage2 errors +@section Errors reported by the Stage 2 + +The general way that the Stage 2 handles errors is to abort the +operation in question, print an error string, then (if possible) either +continue based on the fact that an error occurred or wait for the user to +deal with the error. + +The following is a comprehensive list of error messages for the Stage 2 +(error numbers for the Stage 1.5 are listed before the colon in each +description): + +@table @asis +@item 1 : Filename must be either an absolute filename or blocklist +This error is returned if a file name is requested which doesn't fit the +syntax/rules listed in the @ref{Filesystem}. + +@item 2 : Bad file or directory type +This error is returned if a file requested is not a regular file, but +something like a symbolic link, directory, or FIFO. + +@item 3 : Bad or corrupt data while decompressing file +This error is returned if the run-length decompression code gets an +internal error. This is usually from a corrupt file. + +@item 4 : Bad or incompatible header in compressed file +This error is returned if the file header for a supposedly compressed +file is bad. + +@item 5 : Partition table invalid or corrupt +This error is returned if the sanity checks on the integrity of the +partition table fail. This is a bad sign. + +@item 6 : Mismatched or corrupt version of stage1/stage2 +This error is returned if the install command points to incompatible +or corrupt versions of the stage1 or stage2. It can't detect corruption +in general, but this is a sanity check on the version numbers, which +should be correct. + +@item 7 : Loading below 1MB is not supported +This error is returned if the lowest address in a kernel is below the +1MB boundary. The Linux zImage format is a special case and can be +handled since it has a fixed loading address and maximum size. + +@item 8 : Kernel must be loaded before booting +This error is returned if GRUB is told to execute the boot sequence +without having a kernel to start. + +@item 9 : Unknown boot failure +This error is returned if the boot attempt did not succeed for reasons +which are unknown. + +@item 10 : Unsupported Multiboot features requested +This error is returned when the Multiboot features word in the Multiboot +header requires a feature that is not recognized. The point of this is +that the kernel requires special handling which GRUB is probably +unable to provide. + +@item 11 : Unrecognized device string +This error is returned if a device string was expected, and the string +encountered didn't fit the syntax/rules listed in the @ref{Filesystem}. + +@item 12 : Invalid device requested +This error is returned if a device string is recognizable but does not +fall under the other device errors. + +@item 13 : Invalid or unsupported executable format +This error is returned if the kernel image being loaded is not +recognized as Multiboot or one of the supported native formats (Linux +zImage or bzImage, FreeBSD, or NetBSD). + +@item 14 : Filesystem compatibility error, cannot read whole file +Some of the filesystem reading code in GRUB has limits on the length of +the files it can read. This error is returned when the user runs into +such a limit. + +@item 15 : File not found +This error is returned if the specified file name cannot be found, but +everything else (like the disk/partition info) is OK. + +@item 16 : Inconsistent filesystem structure +This error is returned by the filesystem code to denote an internal +error caused by the sanity checks of the filesystem structure on disk +not matching what it expects. This is usually caused by a corrupt +filesystem or bugs in the code handling it in GRUB. + +@item 17 : Cannot mount selected partition +This error is returned if the partition requested exists, but the +filesystem type cannot be recognized by GRUB. + +@item 18 : Selected cylinder exceeds maximum supported by BIOS +This error is returned when a read is attempted at a linear block +address beyond the end of the BIOS translated area. This generally +happens if your disk is larger than the BIOS can handle (512MB for +(E)IDE disks on older machines or larger than 8GB in general). + +@item 19 : Linux kernel must be loaded before initrd +This error is returned if the initrd command is used before loading a +Linux kernel. + +@item 20 : Multiboot kernel must be loaded before modules +This error is returned if the module load command is used before loading +a Multiboot kernel. It only makes sense in this case anyway, as GRUB has +no idea how to communicate the presence of such modules to a +non-Multiboot-aware kernel. + +@item 21 : Selected disk does not exist +This error is returned if the device part of a device- or full file name +refers to a disk or BIOS device that is not present or not recognized by +the BIOS in the system. + +@item 22 : No such partition +This error is returned if a partition is requested in the device part of +a device- or full file name which isn't on the selected disk. + +@item 23 : Error while parsing number +This error is returned if GRUB was expecting to read a number and +encountered bad data. + +@item 24 : Attempt to access block outside partition +This error is returned if a linear block address is outside of the disk +partition. This generally happens because of a corrupt filesystem on the +disk or a bug in the code handling it in GRUB (it's a great debugging +tool). + +@item 25 : Disk read error +This error is returned if there is a disk read error when trying to +probe or read data from a particular disk. + +@item 26 : Too many symbolic links +This error is returned if the link count is beyond the maximum +(currently 5), possibly the symbolic links are looped. + +@item 27 : Unrecognized command +This error is returned if an unrecognized command is entered on the +command-line or in a boot sequence section of a configuration file and +that entry is selected. + +@item 28 : Selected item cannot fit into memory +This error is returned if a kernel, module, or raw file load command is +either trying to load its data such that it won't fit into memory or it +is simply too big. + +@item 29 : Disk write error +This error is returned if there is a disk write error when trying to +write to a particular disk. This would generally only occur during an +install of set active partition command. + +@item 30 : Invalid argument +This error is returned if an argument specified to a command is invalid. + +@item 31 : File is not sector aligned +This error may occur only when you access a ReiserFS partition by +block-lists (e.g. the command @command{install}). In this case, you +should mount the partition with the @samp{-o notail} option. + +@item 32 : Must be authenticated +This error is returned if you try to run a locked entry. You should +enter a correct password before running such an entry. + +@item 33 : Serial device not configured +This error is returned if you try to change your terminal to a serial +one before initializing any serial device. + +@item 34 : No spare sectors on the disk +This error is returned if a disk doesn't have enough spare space. This +happens when you try to embed Stage 1.5 into the unused sectors after +the MBR, but the first partition starts right after the MBR or they are +used by EZ-BIOS. +@end table + + +@node Invoking the grub shell +@chapter Invoking the grub shell + +This chapter documents the grub shell @command{grub}. Note that the grub +shell is an emulator; it doesn't run under the native environment, so it +sometimes does something wrong. Therefore, you shouldn't trust it too +much. If there is anything wrong with it, don't hesitate to try the +native GRUB environment, especially when it guesses a wrong map between +BIOS drives and OS devices. + +@menu +* Basic usage:: How to use the grub shell +* Installation under UNIX:: How to install GRUB via @command{grub} +* Device map:: The map between BIOS drives and OS devices +@end menu + + +@node Basic usage +@section Introduction into the grub shell + +You can use the command @command{grub} for installing GRUB under your +operating systems and for a testbed when you add a new feature into GRUB +or when fixing a bug. @command{grub} is almost the same as the Stage 2, +and, in fact, it shares the source code with the Stage 2 and you can use +the same commands (@pxref{Commands}) in @command{grub}. It is emulated by +replacing BIOS calls with UNIX system calls and libc functions. + +The command @command{grub} accepts the following options: + +@table @option +@item --help +Print a summary of the command-line options and exit. + +@item --version +Print the version number of GRUB and exit. + +@item --verbose +Print some verbose messages for debugging purpose. + +@item --device-map=@var{file} +Use the device map file @var{file}. The format is described in +@ref{Device map}. + +@item --no-floppy +Do not probe any floppy drive. This option has no effect if the option +@option{--device-map} is specified (@pxref{Device map}). + +@item --probe-second-floppy +Probe the second floppy drive. If this option is not specified, the grub +shell does not probe it, as that sometimes takes a long time. If you +specify the device map file (@pxref{Device map}), the grub shell just +ignores this option. + +@item --config-file=@var{file} +Read the configuration file @var{file} instead of +@file{/boot/grub/menu.lst}. The format is the same as the normal GRUB +syntax. See @ref{Filesystem}, for more information. + +@item --boot-drive=@var{drive} +Set the stage2 @var{boot_drive} to @var{drive}. This argument should be +an integer (decimal, octal or hexadecimal). + +@item --install-partition=@var{par} +Set the stage2 @var{install_partition} to @var{par}. This argument +should be an integer (decimal, octal or hexadecimal). + +@item --no-config-file +Do not use the configuration file even if it can be read. + +@item --no-curses +Do not use the screen handling interface by the curses even if it is +available. + +@item --batch +This option has the same meaning as @samp{--no-config-file --no-curses}. + +@item --read-only +Disable writing to any disk. + +@item --hold +Wait until a debugger will attach. This option is useful when you want +to debug the startup code. +@end table + + +@node Installation under UNIX +@section How to install GRUB via @command{grub} + +The installation procedure is the same as under the @dfn{native} Stage +2. @xref{Installation}, for more information. The command +@command{grub}-specific information is described here. + +What you should be careful about is @dfn{buffer cache}. @command{grub} +makes use of raw devices instead of filesystems that your operating +systems serve, so there exists a potential problem that some cache +inconsistency may corrupt your filesystems. What we recommend is: + +@itemize @bullet +@item +If you can unmount drives to which GRUB may write any amount of data, +unmount them before running @command{grub}. + +@item +If a drive cannot be unmounted but can be mounted with the read-only +flag, mount it in read-only mode. That should be secure. + +@item +If a drive must be mounted with the read-write flag, make sure that no +activity is being done on it while the command @command{grub} is +running. + +@item +Reboot your operating system as soon as possible. This is probably not +required if you follow the rules above, but reboot is the most secure +way. +@end itemize + +In addition, enter the command @command{quit} when you finish the +installation. That is @emph{very important} because @command{quit} makes +the buffer cache consistent. Do not push @key{C-c}. + +If you want to install GRUB non-interactively, specify @samp{--batch} +option in the command-line. This is a simple example: + +@example +@group +#!/bin/sh + +# Use /usr/sbin/grub if you are on an older system. +/sbin/grub --batch </dev/null 2>/dev/null +root (hd0,0) +setup (hd0) +quit +EOT +@end group +@end example + + +@node Device map +@section The map between BIOS drives and OS devices + +When you specify the option @option{--device-map} (@pxref{Basic usage}), +the grub shell creates the @dfn{device map file} automatically unless it +already exists. The file name @file{/boot/grub/device.map} is preferred. + +If the device map file exists, the grub shell reads it to map BIOS +drives to OS devices. This file consists of lines like this: + +@example +@var{device} @var{file} +@end example + +@var{device} is a drive specified in the GRUB syntax (@pxref{Device +syntax}), and @var{file} is an OS file, which is normally a device +file. + +The reason why the grub shell gives you the device map file is that it +cannot guess the map between BIOS drives and OS devices correctly in +some environments. For example, if you exchange the boot sequence +between IDE and SCSI in your BIOS, it gets the order wrong. + +Thus, edit the file if the grub shell makes a mistake. You can put any +comments in the file if needed, as the grub shell assumes that a line is +just a comment if the first character is @samp{#}. + + +@node Invoking grub-install +@chapter Invoking grub-install + +The program @command{grub-install} installs GRUB on your drive using the +grub shell (@pxref{Invoking the grub shell}). You must specify the +device name on which you want to install GRUB, like this: + +@example +grub-install @var{install_device} +@end example + +The device name @var{install_device} is an OS device name or a GRUB +device name. + +@command{grub-install} accepts the following options: + +@table @option +@item --help +Print a summary of the command-line options and exit. + +@item --version +Print the version number of GRUB and exit. + +@item --force-lba +Force GRUB to use LBA mode even for a buggy BIOS. Use this option only +if your BIOS doesn't work properly in LBA mode even though it supports +LBA mode. + +@item --root-directory=@var{dir} +Install GRUB images under the directory @var{dir} instead of the root +directory. This option is useful when you want to install GRUB into a +separate partition or a removable disk. Here is an example in which +you have a separate @dfn{boot} partition which is mounted on +@file{/boot}: + +@example +@kbd{grub-install --root-directory=/boot hd0} +@end example + +@item --grub-shell=@var{file} +Use @var{file} as the grub shell. You can append arbitrary options to +@var{file} after the file name, like this: + +@example +@kbd{grub-install --grub-shell="grub --read-only" /dev/fd0} +@end example + +@item --recheck +Recheck the device map, even if @file{/boot/grub/device.map} already +exists. You should use this option whenever you add/remove a disk +into/from your computer. +@end table + + +@node Invoking grub-md5-crypt +@chapter Invoking grub-md5-crypt + +The program @command{grub-md5-crypt} encrypts a password in MD5 format. +This is just a frontend of the grub shell (@pxref{Invoking the grub +shell}). Passwords encrypted by this program can be used with the +command @command{password} (@pxref{password}). + +@command{grub-md5-crypt} accepts the following options: + +@table @option +@item --help +Print a summary of the command-line options and exit. + +@item --version +Print the version information and exit. + +@item --grub-shell=@var{file} +Use @var{file} as the grub shell. +@end table + + +@node Invoking grub-terminfo +@chapter Invoking grub-terminfo + +The program @command{grub-terminfo} generates a terminfo command from +a terminfo name (@pxref{terminfo}). The result can be used in the +configuration file, to define escape sequences. Because GRUB assumes +that your terminal is vt100-compatible by default, this would be +useful only if your terminal is uncommon (such as vt52). + +@command{grub-terminfo} accepts the following options: + +@table @option +@item --help +Print a summary of the command-line options and exit. + +@item --version +Print the version information and exit. +@end table + +You must specify one argument to this command. For example: + +@example +@kbd{grub-terminfo vt52} +@end example + + +@node Invoking grub-set-default +@chapter Invoking grub-set-default + +The program @command{grub-set-default} sets the default boot entry for +GRUB. This automatically creates a file named @file{default} under +your GRUB directory (i.e. @file{/boot/grub}), if it is not +present. This file is used to determine the default boot entry when +GRUB boots up your system when you use @samp{default saved} in your +configuration file (@pxref{default}), and to save next default boot +entry when you use @samp{savedefault} in a boot entry +(@pxref{savedefault}). + +@command{grub-set-default} accepts the following options: + +@table @option +@item --help +Print a summary of the command-line options and exit. + +@item --version +Print the version information and exit. + +@item --root-directory=@var{dir} +Use the directory @var{dir} instead of the root directory +(i.e. @file{/}) to define the location of the default file. This +is useful when you mount a disk which is used for another system. +@end table + +You must specify a single argument to @command{grub-set-default}. This +argument is normally the number of a default boot entry. For example, +if you have this configuration file: + +@example +@group +default saved +timeout 10 + +title GNU/Hurd +root (hd0,0) +... + +title GNU/Linux +root (hd0,1) +... +@end group +@end example + +and if you want to set the next default boot entry to GNU/Linux, you +may execute this command: + +@example +@kbd{grub-set-default 1} +@end example + +Because the entry for GNU/Linux is @samp{1}. Note that entries are +counted from zero. So, if you want to specify GNU/Hurd here, then you +should specify @samp{0}. + +This feature is very useful if you want to test a new kernel or to +make your system quite robust. @xref{Making your system robust}, for +more hints about how to set up a robust system. + + +@node Invoking mbchk +@chapter Invoking mbchk + +The program @command{mbchk} checks for the format of a Multiboot +kernel. We recommend using this program before booting your own kernel +by GRUB. + +@command{mbchk} accepts the following options: + +@table @option +@item --help +Print a summary of the command-line options and exit. + +@item --version +Print the version number of GRUB and exit. + +@item --quiet +Suppress all normal output. +@end table + + +@node Obtaining and Building GRUB +@appendix How to obtain and build GRUB + +@quotation +@strong{Caution:} GRUB requires binutils-2.9.1.0.23 or later because the +GNU assembler has been changed so that it can produce real 16bits +machine code between 2.9.1 and 2.9.1.0.x. See +@uref{http://sources.redhat.com/binutils/}, to obtain information on +how to get the latest version. +@end quotation + +GRUB is available from the GNU alpha archive site +@uref{ftp://alpha.gnu.org/gnu/grub} or any of its mirrors. The file +will be named grub-version.tar.gz. The current version is +@value{VERSION}, so the file you should grab is: + +@uref{ftp://alpha.gnu.org/gnu/grub/grub-@value{VERSION}.tar.gz} + +To unbundle GRUB use the instruction: + +@example +@kbd{zcat grub-@value{VERSION}.tar.gz | tar xvf -} +@end example + +which will create a directory called @file{grub-@value{VERSION}} with +all the sources. You can look at the file @file{INSTALL} for detailed +instructions on how to build and install GRUB, but you should be able to +just do: + +@example +@group +@kbd{cd grub-@value{VERSION}} +@kbd{./configure} +@kbd{make install} +@end group +@end example + +This will install the grub shell @file{grub} (@pxref{Invoking the grub +shell}), the Multiboot checker @file{mbchk} (@pxref{Invoking mbchk}), +and the GRUB images. This will also install the GRUB manual. + +Also, the latest version is available from the CVS. See +@uref{http://savannah.gnu.org/cvs/?group=grub} for more information. + + +@node Reporting bugs +@appendix Reporting bugs + +These are the guideline for how to report bugs. Take a look at this +list below before you submit bugs: + +@enumerate +@item +Before getting unsettled, read this manual through and through. Also, +see the @uref{http://www.gnu.org/software/grub/grub-faq.html, GNU GRUB FAQ}. + +@item +Always mention the information on your GRUB. The version number and the +configuration are quite important. If you build it yourself, write the +options specified to the configure script and your operating system, +including the versions of gcc and binutils. + +@item +If you have trouble with the installation, inform us of how you +installed GRUB. Don't omit error messages, if any. Just @samp{GRUB hangs +up when it boots} is not enough. + +The information on your hardware is also essential. These are especially +important: the geometries and the partition tables of your hard disk +drives and your BIOS. + +@item +If GRUB cannot boot your operating system, write down +@emph{everything} you see on the screen. Don't paraphrase them, like +@samp{The foo OS crashes with GRUB, even though it can boot with the +bar boot loader just fine}. Mention the commands you executed, the +messages printed by them, and information on your operating system +including the version number. + +@item +Explain what you wanted to do. It is very useful to know your purpose +and your wish, and how GRUB didn't satisfy you. + +@item +If you can investigate the problem yourself, please do. That will give +you and us much more information on the problem. Attaching a patch is +even better. + +When you attach a patch, make the patch in unified diff format, and +write ChangeLog entries. But, even when you make a patch, don't forget +to explain the problem, so that we can understand what your patch is +for. + +@item +Write down anything that you think might be related. Please understand +that we often need to reproduce the same problem you encounterred in our +environment. So your information should be sufficient for us to do the +same thing---Don't forget that we cannot see your computer directly. If +you are not sure whether to state a fact or leave it out, state it! +Reporting too many things is much better than omitting something +important. +@end enumerate + +If you follow the guideline above, submit a report to the +@uref{http://savannah.gnu.org/bugs/?group=grub, Bug Tracking System}. +Alternatively, you can submit a report via electronic mail to +@email{bug-grub@@gnu.org}, but we strongly recommend that you use the +Bug Tracking System, because e-mail can be passed over easily. + +Once we get your report, we will try to fix the bugs. + + +@node Future +@appendix Where GRUB will go + +We started the next generation of GRUB, GRUB 2. This will include +internationalization, dynamic module loading, real memory management, +multiple architecture support, a scripting language, and many other +nice feature. If you are interested in the development of GRUB 2, take +a look at @uref{http://www.gnu.org/software/grub/grub.html, the +homepage}. + + + +@node Copying This Manual +@appendix Copying This Manual + +@menu +* GNU Free Documentation License:: License for copying this manual. +@end menu + +@include fdl.texi + + +@node Index +@unnumbered Index + +@c Currently, we use only the Concept Index. +@printindex cp + + +@bye + +Some notes: + + This is an attempt to make a manual for GRUB 2. The contents are + copied from the GRUB manual in GRUB Legacy, so they are not always + appropriate yet for GRUB 2. diff --git a/docs/mdate-sh b/docs/mdate-sh new file mode 100644 index 000000000..22f2f8be9 --- /dev/null +++ b/docs/mdate-sh @@ -0,0 +1,205 @@ +#!/bin/sh +# Get modification time of a file or directory and pretty-print it. + +scriptversion=2007-03-30.02 + +# Copyright (C) 1995, 1996, 1997, 2003, 2004, 2005, 2007 Free Software +# Foundation, Inc. +# written by Ulrich Drepper , June 1995 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation, +# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# This file is maintained in Automake, please report +# bugs to or send patches to +# . + +case $1 in + '') + echo "$0: No file. Try \`$0 --help' for more information." 1>&2 + exit 1; + ;; + -h | --h*) + cat <<\EOF +Usage: mdate-sh [--help] [--version] FILE + +Pretty-print the modification time of FILE. + +Report bugs to . +EOF + exit $? + ;; + -v | --v*) + echo "mdate-sh $scriptversion" + exit $? + ;; +esac + +# Prevent date giving response in another language. +LANG=C +export LANG +LC_ALL=C +export LC_ALL +LC_TIME=C +export LC_TIME + +# GNU ls changes its time format in response to the TIME_STYLE +# variable. Since we cannot assume `unset' works, revert this +# variable to its documented default. +if test "${TIME_STYLE+set}" = set; then + TIME_STYLE=posix-long-iso + export TIME_STYLE +fi + +save_arg1=$1 + +# Find out how to get the extended ls output of a file or directory. +if ls -L /dev/null 1>/dev/null 2>&1; then + ls_command='ls -L -l -d' +else + ls_command='ls -l -d' +fi +# Avoid user/group names that might have spaces, when possible. +if ls -n /dev/null 1>/dev/null 2>&1; then + ls_command="$ls_command -n" +fi + +# A `ls -l' line looks as follows on OS/2. +# drwxrwx--- 0 Aug 11 2001 foo +# This differs from Unix, which adds ownership information. +# drwxrwx--- 2 root root 4096 Aug 11 2001 foo +# +# To find the date, we split the line on spaces and iterate on words +# until we find a month. This cannot work with files whose owner is a +# user named `Jan', or `Feb', etc. However, it's unlikely that `/' +# will be owned by a user whose name is a month. So we first look at +# the extended ls output of the root directory to decide how many +# words should be skipped to get the date. + +# On HPUX /bin/sh, "set" interprets "-rw-r--r--" as options, so the "x" below. +set x`$ls_command /` + +# Find which argument is the month. +month= +command= +until test $month +do + shift + # Add another shift to the command. + command="$command shift;" + case $1 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; + esac +done + +# Get the extended ls output of the file or directory. +set dummy x`eval "$ls_command \"\$save_arg1\""` + +# Remove all preceding arguments +eval $command + +# Because of the dummy argument above, month is in $2. +# +# On a POSIX system, we should have +# +# $# = 5 +# $1 = file size +# $2 = month +# $3 = day +# $4 = year or time +# $5 = filename +# +# On Darwin 7.7.0 and 7.6.0, we have +# +# $# = 4 +# $1 = day +# $2 = month +# $3 = year or time +# $4 = filename + +# Get the month. +case $2 in + Jan) month=January; nummonth=1;; + Feb) month=February; nummonth=2;; + Mar) month=March; nummonth=3;; + Apr) month=April; nummonth=4;; + May) month=May; nummonth=5;; + Jun) month=June; nummonth=6;; + Jul) month=July; nummonth=7;; + Aug) month=August; nummonth=8;; + Sep) month=September; nummonth=9;; + Oct) month=October; nummonth=10;; + Nov) month=November; nummonth=11;; + Dec) month=December; nummonth=12;; +esac + +case $3 in + ???*) day=$1;; + *) day=$3; shift;; +esac + +# Here we have to deal with the problem that the ls output gives either +# the time of day or the year. +case $3 in + *:*) set `date`; eval year=\$$# + case $2 in + Jan) nummonthtod=1;; + Feb) nummonthtod=2;; + Mar) nummonthtod=3;; + Apr) nummonthtod=4;; + May) nummonthtod=5;; + Jun) nummonthtod=6;; + Jul) nummonthtod=7;; + Aug) nummonthtod=8;; + Sep) nummonthtod=9;; + Oct) nummonthtod=10;; + Nov) nummonthtod=11;; + Dec) nummonthtod=12;; + esac + # For the first six month of the year the time notation can also + # be used for files modified in the last year. + if (expr $nummonth \> $nummonthtod) > /dev/null; + then + year=`expr $year - 1` + fi;; + *) year=$3;; +esac + +# The result. +echo $day $month $year + +# Local Variables: +# mode: shell-script +# sh-indentation: 2 +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff --git a/docs/texinfo.tex b/docs/texinfo.tex new file mode 100644 index 000000000..c49e670b0 --- /dev/null +++ b/docs/texinfo.tex @@ -0,0 +1,8959 @@ +% texinfo.tex -- TeX macros to handle Texinfo files. +% +% Load plain if necessary, i.e., if running under initex. +\expandafter\ifx\csname fmtname\endcsname\relax\input plain\fi +% +\def\texinfoversion{2007-09-03.05} +% +% Copyright (C) 1985, 1986, 1988, 1990, 1991, 1992, 1993, 1994, 1995, 2007, +% 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, +% 2007 Free Software Foundation, Inc. +% +% This texinfo.tex file is free software: you can redistribute it and/or +% modify it under the terms of the GNU General Public License as +% published by the Free Software Foundation, either version 3 of the +% License, or (at your option) any later version. +% +% This texinfo.tex file is distributed in the hope that it will be +% useful, but WITHOUT ANY WARRANTY; without even the implied warranty +% of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +% General Public License for more details. +% +% You should have received a copy of the GNU General Public License +% along with this program. If not, see . +% +% As a special exception, when this file is read by TeX when processing +% a Texinfo source document, you may use the result without +% restriction. (This has been our intent since Texinfo was invented.) +% +% Please try the latest version of texinfo.tex before submitting bug +% reports; you can get the latest version from: +% http://www.gnu.org/software/texinfo/ (the Texinfo home page), or +% ftp://tug.org/tex/texinfo.tex +% (and all CTAN mirrors, see http://www.ctan.org). +% The texinfo.tex in any given distribution could well be out +% of date, so if that's what you're using, please check. +% +% Send bug reports to bug-texinfo@gnu.org. Please include including a +% complete document in each bug report with which we can reproduce the +% problem. Patches are, of course, greatly appreciated. +% +% To process a Texinfo manual with TeX, it's most reliable to use the +% texi2dvi shell script that comes with the distribution. For a simple +% manual foo.texi, however, you can get away with this: +% tex foo.texi +% texindex foo.?? +% tex foo.texi +% tex foo.texi +% dvips foo.dvi -o # or whatever; this makes foo.ps. +% The extra TeX runs get the cross-reference information correct. +% Sometimes one run after texindex suffices, and sometimes you need more +% than two; texi2dvi does it as many times as necessary. +% +% It is possible to adapt texinfo.tex for other languages, to some +% extent. You can get the existing language-specific files from the +% full Texinfo distribution. +% +% The GNU Texinfo home page is http://www.gnu.org/software/texinfo. + + +\message{Loading texinfo [version \texinfoversion]:} + +% If in a .fmt file, print the version number +% and turn on active characters that we couldn't do earlier because +% they might have appeared in the input file name. +\everyjob{\message{[Texinfo version \texinfoversion]}% + \catcode`+=\active \catcode`\_=\active} + + +\chardef\other=12 + +% We never want plain's \outer definition of \+ in Texinfo. +% For @tex, we can use \tabalign. +\let\+ = \relax + +% Save some plain tex macros whose names we will redefine. +\let\ptexb=\b +\let\ptexbullet=\bullet +\let\ptexc=\c +\let\ptexcomma=\, +\let\ptexdot=\. +\let\ptexdots=\dots +\let\ptexend=\end +\let\ptexequiv=\equiv +\let\ptexexclam=\! +\let\ptexfootnote=\footnote +\let\ptexgtr=> +\let\ptexhat=^ +\let\ptexi=\i +\let\ptexindent=\indent +\let\ptexinsert=\insert +\let\ptexlbrace=\{ +\let\ptexless=< +\let\ptexnewwrite\newwrite +\let\ptexnoindent=\noindent +\let\ptexplus=+ +\let\ptexrbrace=\} +\let\ptexslash=\/ +\let\ptexstar=\* +\let\ptext=\t + +% If this character appears in an error message or help string, it +% starts a new line in the output. +\newlinechar = `^^J + +% Use TeX 3.0's \inputlineno to get the line number, for better error +% messages, but if we're using an old version of TeX, don't do anything. +% +\ifx\inputlineno\thisisundefined + \let\linenumber = \empty % Pre-3.0. +\else + \def\linenumber{l.\the\inputlineno:\space} +\fi + +% Set up fixed words for English if not already set. +\ifx\putwordAppendix\undefined \gdef\putwordAppendix{Appendix}\fi +\ifx\putwordChapter\undefined \gdef\putwordChapter{Chapter}\fi +\ifx\putwordfile\undefined \gdef\putwordfile{file}\fi +\ifx\putwordin\undefined \gdef\putwordin{in}\fi +\ifx\putwordIndexIsEmpty\undefined \gdef\putwordIndexIsEmpty{(Index is empty)}\fi +\ifx\putwordIndexNonexistent\undefined \gdef\putwordIndexNonexistent{(Index is nonexistent)}\fi +\ifx\putwordInfo\undefined \gdef\putwordInfo{Info}\fi +\ifx\putwordInstanceVariableof\undefined \gdef\putwordInstanceVariableof{Instance Variable of}\fi +\ifx\putwordMethodon\undefined \gdef\putwordMethodon{Method on}\fi +\ifx\putwordNoTitle\undefined \gdef\putwordNoTitle{No Title}\fi +\ifx\putwordof\undefined \gdef\putwordof{of}\fi +\ifx\putwordon\undefined \gdef\putwordon{on}\fi +\ifx\putwordpage\undefined \gdef\putwordpage{page}\fi +\ifx\putwordsection\undefined \gdef\putwordsection{section}\fi +\ifx\putwordSection\undefined \gdef\putwordSection{Section}\fi +\ifx\putwordsee\undefined \gdef\putwordsee{see}\fi +\ifx\putwordSee\undefined \gdef\putwordSee{See}\fi +\ifx\putwordShortTOC\undefined \gdef\putwordShortTOC{Short Contents}\fi +\ifx\putwordTOC\undefined \gdef\putwordTOC{Table of Contents}\fi +% +\ifx\putwordMJan\undefined \gdef\putwordMJan{January}\fi +\ifx\putwordMFeb\undefined \gdef\putwordMFeb{February}\fi +\ifx\putwordMMar\undefined \gdef\putwordMMar{March}\fi +\ifx\putwordMApr\undefined \gdef\putwordMApr{April}\fi +\ifx\putwordMMay\undefined \gdef\putwordMMay{May}\fi +\ifx\putwordMJun\undefined \gdef\putwordMJun{June}\fi +\ifx\putwordMJul\undefined \gdef\putwordMJul{July}\fi +\ifx\putwordMAug\undefined \gdef\putwordMAug{August}\fi +\ifx\putwordMSep\undefined \gdef\putwordMSep{September}\fi +\ifx\putwordMOct\undefined \gdef\putwordMOct{October}\fi +\ifx\putwordMNov\undefined \gdef\putwordMNov{November}\fi +\ifx\putwordMDec\undefined \gdef\putwordMDec{December}\fi +% +\ifx\putwordDefmac\undefined \gdef\putwordDefmac{Macro}\fi +\ifx\putwordDefspec\undefined \gdef\putwordDefspec{Special Form}\fi +\ifx\putwordDefvar\undefined \gdef\putwordDefvar{Variable}\fi +\ifx\putwordDefopt\undefined \gdef\putwordDefopt{User Option}\fi +\ifx\putwordDeffunc\undefined \gdef\putwordDeffunc{Function}\fi + +% Since the category of space is not known, we have to be careful. +\chardef\spacecat = 10 +\def\spaceisspace{\catcode`\ =\spacecat} + +% sometimes characters are active, so we need control sequences. +\chardef\colonChar = `\: +\chardef\commaChar = `\, +\chardef\dashChar = `\- +\chardef\dotChar = `\. +\chardef\exclamChar= `\! +\chardef\lquoteChar= `\` +\chardef\questChar = `\? +\chardef\rquoteChar= `\' +\chardef\semiChar = `\; +\chardef\underChar = `\_ + +% Ignore a token. +% +\def\gobble#1{} + +% The following is used inside several \edef's. +\def\makecsname#1{\expandafter\noexpand\csname#1\endcsname} + +% Hyphenation fixes. +\hyphenation{ + Flor-i-da Ghost-script Ghost-view Mac-OS Post-Script + ap-pen-dix bit-map bit-maps + data-base data-bases eshell fall-ing half-way long-est man-u-script + man-u-scripts mini-buf-fer mini-buf-fers over-view par-a-digm + par-a-digms rath-er rec-tan-gu-lar ro-bot-ics se-vere-ly set-up spa-ces + spell-ing spell-ings + stand-alone strong-est time-stamp time-stamps which-ever white-space + wide-spread wrap-around +} + +% Margin to add to right of even pages, to left of odd pages. +\newdimen\bindingoffset +\newdimen\normaloffset +\newdimen\pagewidth \newdimen\pageheight + +% For a final copy, take out the rectangles +% that mark overfull boxes (in case you have decided +% that the text looks ok even though it passes the margin). +% +\def\finalout{\overfullrule=0pt} + +% @| inserts a changebar to the left of the current line. It should +% surround any changed text. This approach does *not* work if the +% change spans more than two lines of output. To handle that, we would +% have adopt a much more difficult approach (putting marks into the main +% vertical list for the beginning and end of each change). +% +\def\|{% + % \vadjust can only be used in horizontal mode. + \leavevmode + % + % Append this vertical mode material after the current line in the output. + \vadjust{% + % We want to insert a rule with the height and depth of the current + % leading; that is exactly what \strutbox is supposed to record. + \vskip-\baselineskip + % + % \vadjust-items are inserted at the left edge of the type. So + % the \llap here moves out into the left-hand margin. + \llap{% + % + % For a thicker or thinner bar, change the `1pt'. + \vrule height\baselineskip width1pt + % + % This is the space between the bar and the text. + \hskip 12pt + }% + }% +} + +% Sometimes it is convenient to have everything in the transcript file +% and nothing on the terminal. We don't just call \tracingall here, +% since that produces some useless output on the terminal. We also make +% some effort to order the tracing commands to reduce output in the log +% file; cf. trace.sty in LaTeX. +% +\def\gloggingall{\begingroup \globaldefs = 1 \loggingall \endgroup}% +\def\loggingall{% + \tracingstats2 + \tracingpages1 + \tracinglostchars2 % 2 gives us more in etex + \tracingparagraphs1 + \tracingoutput1 + \tracingmacros2 + \tracingrestores1 + \showboxbreadth\maxdimen \showboxdepth\maxdimen + \ifx\eTeXversion\undefined\else % etex gives us more logging + \tracingscantokens1 + \tracingifs1 + \tracinggroups1 + \tracingnesting2 + \tracingassigns1 + \fi + \tracingcommands3 % 3 gives us more in etex + \errorcontextlines16 +}% + +% add check for \lastpenalty to plain's definitions. If the last thing +% we did was a \nobreak, we don't want to insert more space. +% +\def\smallbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\smallskipamount + \removelastskip\penalty-50\smallskip\fi\fi} +\def\medbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\medskipamount + \removelastskip\penalty-100\medskip\fi\fi} +\def\bigbreak{\ifnum\lastpenalty<10000\par\ifdim\lastskip<\bigskipamount + \removelastskip\penalty-200\bigskip\fi\fi} + +% For @cropmarks command. +% Do @cropmarks to get crop marks. +% +\newif\ifcropmarks +\let\cropmarks = \cropmarkstrue +% +% Dimensions to add cropmarks at corners. +% Added by P. A. MacKay, 12 Nov. 1986 +% +\newdimen\outerhsize \newdimen\outervsize % set by the paper size routines +\newdimen\cornerlong \cornerlong=1pc +\newdimen\cornerthick \cornerthick=.3pt +\newdimen\topandbottommargin \topandbottommargin=.75in + +% Output a mark which sets \thischapter, \thissection and \thiscolor. +% We dump everything together because we only have one kind of mark. +% This works because we only use \botmark / \topmark, not \firstmark. +% +% A mark contains a subexpression of the \ifcase ... \fi construct. +% \get*marks macros below extract the needed part using \ifcase. +% +% Another complication is to let the user choose whether \thischapter +% (\thissection) refers to the chapter (section) in effect at the top +% of a page, or that at the bottom of a page. The solution is +% described on page 260 of The TeXbook. It involves outputting two +% marks for the sectioning macros, one before the section break, and +% one after. I won't pretend I can describe this better than DEK... +\def\domark{% + \toks0=\expandafter{\lastchapterdefs}% + \toks2=\expandafter{\lastsectiondefs}% + \toks4=\expandafter{\prevchapterdefs}% + \toks6=\expandafter{\prevsectiondefs}% + \toks8=\expandafter{\lastcolordefs}% + \mark{% + \the\toks0 \the\toks2 + \noexpand\or \the\toks4 \the\toks6 + \noexpand\else \the\toks8 + }% +} +% \topmark doesn't work for the very first chapter (after the title +% page or the contents), so we use \firstmark there -- this gets us +% the mark with the chapter defs, unless the user sneaks in, e.g., +% @setcolor (or @url, or @link, etc.) between @contents and the very +% first @chapter. +\def\gettopheadingmarks{% + \ifcase0\topmark\fi + \ifx\thischapter\empty \ifcase0\firstmark\fi \fi +} +\def\getbottomheadingmarks{\ifcase1\botmark\fi} +\def\getcolormarks{\ifcase2\topmark\fi} + +% Avoid "undefined control sequence" errors. +\def\lastchapterdefs{} +\def\lastsectiondefs{} +\def\prevchapterdefs{} +\def\prevsectiondefs{} +\def\lastcolordefs{} + +% Main output routine. +\chardef\PAGE = 255 +\output = {\onepageout{\pagecontents\PAGE}} + +\newbox\headlinebox +\newbox\footlinebox + +% \onepageout takes a vbox as an argument. Note that \pagecontents +% does insertions, but you have to call it yourself. +\def\onepageout#1{% + \ifcropmarks \hoffset=0pt \else \hoffset=\normaloffset \fi + % + \ifodd\pageno \advance\hoffset by \bindingoffset + \else \advance\hoffset by -\bindingoffset\fi + % + % Do this outside of the \shipout so @code etc. will be expanded in + % the headline as they should be, not taken literally (outputting ''code). + \ifodd\pageno \getoddheadingmarks \else \getevenheadingmarks \fi + \setbox\headlinebox = \vbox{\let\hsize=\pagewidth \makeheadline}% + \ifodd\pageno \getoddfootingmarks \else \getevenfootingmarks \fi + \setbox\footlinebox = \vbox{\let\hsize=\pagewidth \makefootline}% + % + {% + % Have to do this stuff outside the \shipout because we want it to + % take effect in \write's, yet the group defined by the \vbox ends + % before the \shipout runs. + % + \indexdummies % don't expand commands in the output. + \normalturnoffactive % \ in index entries must not stay \, e.g., if + % the page break happens to be in the middle of an example. + % We don't want .vr (or whatever) entries like this: + % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} + % "\acronym" won't work when it's read back in; + % it needs to be + % {\code {{\tt \backslashcurfont }acronym} + \shipout\vbox{% + % Do this early so pdf references go to the beginning of the page. + \ifpdfmakepagedest \pdfdest name{\the\pageno} xyz\fi + % + \ifcropmarks \vbox to \outervsize\bgroup + \hsize = \outerhsize + \vskip-\topandbottommargin + \vtop to0pt{% + \line{\ewtop\hfil\ewtop}% + \nointerlineskip + \line{% + \vbox{\moveleft\cornerthick\nstop}% + \hfill + \vbox{\moveright\cornerthick\nstop}% + }% + \vss}% + \vskip\topandbottommargin + \line\bgroup + \hfil % center the page within the outer (page) hsize. + \ifodd\pageno\hskip\bindingoffset\fi + \vbox\bgroup + \fi + % + \unvbox\headlinebox + \pagebody{#1}% + \ifdim\ht\footlinebox > 0pt + % Only leave this space if the footline is nonempty. + % (We lessened \vsize for it in \oddfootingyyy.) + % The \baselineskip=24pt in plain's \makefootline has no effect. + \vskip 24pt + \unvbox\footlinebox + \fi + % + \ifcropmarks + \egroup % end of \vbox\bgroup + \hfil\egroup % end of (centering) \line\bgroup + \vskip\topandbottommargin plus1fill minus1fill + \boxmaxdepth = \cornerthick + \vbox to0pt{\vss + \line{% + \vbox{\moveleft\cornerthick\nsbot}% + \hfill + \vbox{\moveright\cornerthick\nsbot}% + }% + \nointerlineskip + \line{\ewbot\hfil\ewbot}% + }% + \egroup % \vbox from first cropmarks clause + \fi + }% end of \shipout\vbox + }% end of group with \indexdummies + \advancepageno + \ifnum\outputpenalty>-20000 \else\dosupereject\fi +} + +\newinsert\margin \dimen\margin=\maxdimen + +\def\pagebody#1{\vbox to\pageheight{\boxmaxdepth=\maxdepth #1}} +{\catcode`\@ =11 +\gdef\pagecontents#1{\ifvoid\topins\else\unvbox\topins\fi +% marginal hacks, juha@viisa.uucp (Juha Takala) +\ifvoid\margin\else % marginal info is present + \rlap{\kern\hsize\vbox to\z@{\kern1pt\box\margin \vss}}\fi +\dimen@=\dp#1\relax \unvbox#1\relax +\ifvoid\footins\else\vskip\skip\footins\footnoterule \unvbox\footins\fi +\ifr@ggedbottom \kern-\dimen@ \vfil \fi} +} + +% Here are the rules for the cropmarks. Note that they are +% offset so that the space between them is truly \outerhsize or \outervsize +% (P. A. MacKay, 12 November, 1986) +% +\def\ewtop{\vrule height\cornerthick depth0pt width\cornerlong} +\def\nstop{\vbox + {\hrule height\cornerthick depth\cornerlong width\cornerthick}} +\def\ewbot{\vrule height0pt depth\cornerthick width\cornerlong} +\def\nsbot{\vbox + {\hrule height\cornerlong depth\cornerthick width\cornerthick}} + +% Parse an argument, then pass it to #1. The argument is the rest of +% the input line (except we remove a trailing comment). #1 should be a +% macro which expects an ordinary undelimited TeX argument. +% +\def\parsearg{\parseargusing{}} +\def\parseargusing#1#2{% + \def\argtorun{#2}% + \begingroup + \obeylines + \spaceisspace + #1% + \parseargline\empty% Insert the \empty token, see \finishparsearg below. +} + +{\obeylines % + \gdef\parseargline#1^^M{% + \endgroup % End of the group started in \parsearg. + \argremovecomment #1\comment\ArgTerm% + }% +} + +% First remove any @comment, then any @c comment. +\def\argremovecomment#1\comment#2\ArgTerm{\argremovec #1\c\ArgTerm} +\def\argremovec#1\c#2\ArgTerm{\argcheckspaces#1\^^M\ArgTerm} + +% Each occurence of `\^^M' or `\^^M' is replaced by a single space. +% +% \argremovec might leave us with trailing space, e.g., +% @end itemize @c foo +% This space token undergoes the same procedure and is eventually removed +% by \finishparsearg. +% +\def\argcheckspaces#1\^^M{\argcheckspacesX#1\^^M \^^M} +\def\argcheckspacesX#1 \^^M{\argcheckspacesY#1\^^M} +\def\argcheckspacesY#1\^^M#2\^^M#3\ArgTerm{% + \def\temp{#3}% + \ifx\temp\empty + % Do not use \next, perhaps the caller of \parsearg uses it; reuse \temp: + \let\temp\finishparsearg + \else + \let\temp\argcheckspaces + \fi + % Put the space token in: + \temp#1 #3\ArgTerm +} + +% If a _delimited_ argument is enclosed in braces, they get stripped; so +% to get _exactly_ the rest of the line, we had to prevent such situation. +% We prepended an \empty token at the very beginning and we expand it now, +% just before passing the control to \argtorun. +% (Similarily, we have to think about #3 of \argcheckspacesY above: it is +% either the null string, or it ends with \^^M---thus there is no danger +% that a pair of braces would be stripped. +% +% But first, we have to remove the trailing space token. +% +\def\finishparsearg#1 \ArgTerm{\expandafter\argtorun\expandafter{#1}} + +% \parseargdef\foo{...} +% is roughly equivalent to +% \def\foo{\parsearg\Xfoo} +% \def\Xfoo#1{...} +% +% Actually, I use \csname\string\foo\endcsname, ie. \\foo, as it is my +% favourite TeX trick. --kasal, 16nov03 + +\def\parseargdef#1{% + \expandafter \doparseargdef \csname\string#1\endcsname #1% +} +\def\doparseargdef#1#2{% + \def#2{\parsearg#1}% + \def#1##1% +} + +% Several utility definitions with active space: +{ + \obeyspaces + \gdef\obeyedspace{ } + + % Make each space character in the input produce a normal interword + % space in the output. Don't allow a line break at this space, as this + % is used only in environments like @example, where each line of input + % should produce a line of output anyway. + % + \gdef\sepspaces{\obeyspaces\let =\tie} + + % If an index command is used in an @example environment, any spaces + % therein should become regular spaces in the raw index file, not the + % expansion of \tie (\leavevmode \penalty \@M \ ). + \gdef\unsepspaces{\let =\space} +} + + +\def\flushcr{\ifx\par\lisppar \def\next##1{}\else \let\next=\relax \fi \next} + +% Define the framework for environments in texinfo.tex. It's used like this: +% +% \envdef\foo{...} +% \def\Efoo{...} +% +% It's the responsibility of \envdef to insert \begingroup before the +% actual body; @end closes the group after calling \Efoo. \envdef also +% defines \thisenv, so the current environment is known; @end checks +% whether the environment name matches. The \checkenv macro can also be +% used to check whether the current environment is the one expected. +% +% Non-false conditionals (@iftex, @ifset) don't fit into this, so they +% are not treated as enviroments; they don't open a group. (The +% implementation of @end takes care not to call \endgroup in this +% special case.) + + +% At runtime, environments start with this: +\def\startenvironment#1{\begingroup\def\thisenv{#1}} +% initialize +\let\thisenv\empty + +% ... but they get defined via ``\envdef\foo{...}'': +\long\def\envdef#1#2{\def#1{\startenvironment#1#2}} +\def\envparseargdef#1#2{\parseargdef#1{\startenvironment#1#2}} + +% Check whether we're in the right environment: +\def\checkenv#1{% + \def\temp{#1}% + \ifx\thisenv\temp + \else + \badenverr + \fi +} + +% Evironment mismatch, #1 expected: +\def\badenverr{% + \errhelp = \EMsimple + \errmessage{This command can appear only \inenvironment\temp, + not \inenvironment\thisenv}% +} +\def\inenvironment#1{% + \ifx#1\empty + out of any environment% + \else + in environment \expandafter\string#1% + \fi +} + +% @end foo executes the definition of \Efoo. +% But first, it executes a specialized version of \checkenv +% +\parseargdef\end{% + \if 1\csname iscond.#1\endcsname + \else + % The general wording of \badenverr may not be ideal, but... --kasal, 06nov03 + \expandafter\checkenv\csname#1\endcsname + \csname E#1\endcsname + \endgroup + \fi +} + +\newhelp\EMsimple{Press RETURN to continue.} + + +%% Simple single-character @ commands + +% @@ prints an @ +% Kludge this until the fonts are right (grr). +\def\@{{\tt\char64}} + +% This is turned off because it was never documented +% and you can use @w{...} around a quote to suppress ligatures. +%% Define @` and @' to be the same as ` and ' +%% but suppressing ligatures. +%\def\`{{`}} +%\def\'{{'}} + +% Used to generate quoted braces. +\def\mylbrace {{\tt\char123}} +\def\myrbrace {{\tt\char125}} +\let\{=\mylbrace +\let\}=\myrbrace +\begingroup + % Definitions to produce \{ and \} commands for indices, + % and @{ and @} for the aux/toc files. + \catcode`\{ = \other \catcode`\} = \other + \catcode`\[ = 1 \catcode`\] = 2 + \catcode`\! = 0 \catcode`\\ = \other + !gdef!lbracecmd[\{]% + !gdef!rbracecmd[\}]% + !gdef!lbraceatcmd[@{]% + !gdef!rbraceatcmd[@}]% +!endgroup + +% @comma{} to avoid , parsing problems. +\let\comma = , + +% Accents: @, @dotaccent @ringaccent @ubaraccent @udotaccent +% Others are defined by plain TeX: @` @' @" @^ @~ @= @u @v @H. +\let\, = \c +\let\dotaccent = \. +\def\ringaccent#1{{\accent23 #1}} +\let\tieaccent = \t +\let\ubaraccent = \b +\let\udotaccent = \d + +% Other special characters: @questiondown @exclamdown @ordf @ordm +% Plain TeX defines: @AA @AE @O @OE @L (plus lowercase versions) @ss. +\def\questiondown{?`} +\def\exclamdown{!`} +\def\ordf{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{a}}} +\def\ordm{\leavevmode\raise1ex\hbox{\selectfonts\lllsize \underbar{o}}} + +% Dotless i and dotless j, used for accents. +\def\imacro{i} +\def\jmacro{j} +\def\dotless#1{% + \def\temp{#1}% + \ifx\temp\imacro \ptexi + \else\ifx\temp\jmacro \j + \else \errmessage{@dotless can be used only with i or j}% + \fi\fi +} + +% The \TeX{} logo, as in plain, but resetting the spacing so that a +% period following counts as ending a sentence. (Idea found in latex.) +% +\edef\TeX{\TeX \spacefactor=1000 } + +% @LaTeX{} logo. Not quite the same results as the definition in +% latex.ltx, since we use a different font for the raised A; it's most +% convenient for us to use an explicitly smaller font, rather than using +% the \scriptstyle font (since we don't reset \scriptstyle and +% \scriptscriptstyle). +% +\def\LaTeX{% + L\kern-.36em + {\setbox0=\hbox{T}% + \vbox to \ht0{\hbox{\selectfonts\lllsize A}\vss}}% + \kern-.15em + \TeX +} + +% Be sure we're in horizontal mode when doing a tie, since we make space +% equivalent to this in @example-like environments. Otherwise, a space +% at the beginning of a line will start with \penalty -- and +% since \penalty is valid in vertical mode, we'd end up putting the +% penalty on the vertical list instead of in the new paragraph. +{\catcode`@ = 11 + % Avoid using \@M directly, because that causes trouble + % if the definition is written into an index file. + \global\let\tiepenalty = \@M + \gdef\tie{\leavevmode\penalty\tiepenalty\ } +} + +% @: forces normal size whitespace following. +\def\:{\spacefactor=1000 } + +% @* forces a line break. +\def\*{\hfil\break\hbox{}\ignorespaces} + +% @/ allows a line break. +\let\/=\allowbreak + +% @. is an end-of-sentence period. +\def\.{.\spacefactor=\endofsentencespacefactor\space} + +% @! is an end-of-sentence bang. +\def\!{!\spacefactor=\endofsentencespacefactor\space} + +% @? is an end-of-sentence query. +\def\?{?\spacefactor=\endofsentencespacefactor\space} + +% @frenchspacing on|off says whether to put extra space after punctuation. +% +\def\onword{on} +\def\offword{off} +% +\parseargdef\frenchspacing{% + \def\temp{#1}% + \ifx\temp\onword \plainfrenchspacing + \else\ifx\temp\offword \plainnonfrenchspacing + \else + \errhelp = \EMsimple + \errmessage{Unknown @frenchspacing option `\temp', must be on/off}% + \fi\fi +} + +% @w prevents a word break. Without the \leavevmode, @w at the +% beginning of a paragraph, when TeX is still in vertical mode, would +% produce a whole line of output instead of starting the paragraph. +\def\w#1{\leavevmode\hbox{#1}} + +% @group ... @end group forces ... to be all on one page, by enclosing +% it in a TeX vbox. We use \vtop instead of \vbox to construct the box +% to keep its height that of a normal line. According to the rules for +% \topskip (p.114 of the TeXbook), the glue inserted is +% max (\topskip - \ht (first item), 0). If that height is large, +% therefore, no glue is inserted, and the space between the headline and +% the text is small, which looks bad. +% +% Another complication is that the group might be very large. This can +% cause the glue on the previous page to be unduly stretched, because it +% does not have much material. In this case, it's better to add an +% explicit \vfill so that the extra space is at the bottom. The +% threshold for doing this is if the group is more than \vfilllimit +% percent of a page (\vfilllimit can be changed inside of @tex). +% +\newbox\groupbox +\def\vfilllimit{0.7} +% +\envdef\group{% + \ifnum\catcode`\^^M=\active \else + \errhelp = \groupinvalidhelp + \errmessage{@group invalid in context where filling is enabled}% + \fi + \startsavinginserts + % + \setbox\groupbox = \vtop\bgroup + % Do @comment since we are called inside an environment such as + % @example, where each end-of-line in the input causes an + % end-of-line in the output. We don't want the end-of-line after + % the `@group' to put extra space in the output. Since @group + % should appear on a line by itself (according to the Texinfo + % manual), we don't worry about eating any user text. + \comment +} +% +% The \vtop produces a box with normal height and large depth; thus, TeX puts +% \baselineskip glue before it, and (when the next line of text is done) +% \lineskip glue after it. Thus, space below is not quite equal to space +% above. But it's pretty close. +\def\Egroup{% + % To get correct interline space between the last line of the group + % and the first line afterwards, we have to propagate \prevdepth. + \endgraf % Not \par, as it may have been set to \lisppar. + \global\dimen1 = \prevdepth + \egroup % End the \vtop. + % \dimen0 is the vertical size of the group's box. + \dimen0 = \ht\groupbox \advance\dimen0 by \dp\groupbox + % \dimen2 is how much space is left on the page (more or less). + \dimen2 = \pageheight \advance\dimen2 by -\pagetotal + % if the group doesn't fit on the current page, and it's a big big + % group, force a page break. + \ifdim \dimen0 > \dimen2 + \ifdim \pagetotal < \vfilllimit\pageheight + \page + \fi + \fi + \box\groupbox + \prevdepth = \dimen1 + \checkinserts +} +% +% TeX puts in an \escapechar (i.e., `@') at the beginning of the help +% message, so this ends up printing `@group can only ...'. +% +\newhelp\groupinvalidhelp{% +group can only be used in environments such as @example,^^J% +where each line of input produces a line of output.} + +% @need space-in-mils +% forces a page break if there is not space-in-mils remaining. + +\newdimen\mil \mil=0.001in + +% Old definition--didn't work. +%\parseargdef\need{\par % +%% This method tries to make TeX break the page naturally +%% if the depth of the box does not fit. +%{\baselineskip=0pt% +%\vtop to #1\mil{\vfil}\kern -#1\mil\nobreak +%\prevdepth=-1000pt +%}} + +\parseargdef\need{% + % Ensure vertical mode, so we don't make a big box in the middle of a + % paragraph. + \par + % + % If the @need value is less than one line space, it's useless. + \dimen0 = #1\mil + \dimen2 = \ht\strutbox + \advance\dimen2 by \dp\strutbox + \ifdim\dimen0 > \dimen2 + % + % Do a \strut just to make the height of this box be normal, so the + % normal leading is inserted relative to the preceding line. + % And a page break here is fine. + \vtop to #1\mil{\strut\vfil}% + % + % TeX does not even consider page breaks if a penalty added to the + % main vertical list is 10000 or more. But in order to see if the + % empty box we just added fits on the page, we must make it consider + % page breaks. On the other hand, we don't want to actually break the + % page after the empty box. So we use a penalty of 9999. + % + % There is an extremely small chance that TeX will actually break the + % page at this \penalty, if there are no other feasible breakpoints in + % sight. (If the user is using lots of big @group commands, which + % almost-but-not-quite fill up a page, TeX will have a hard time doing + % good page breaking, for example.) However, I could not construct an + % example where a page broke at this \penalty; if it happens in a real + % document, then we can reconsider our strategy. + \penalty9999 + % + % Back up by the size of the box, whether we did a page break or not. + \kern -#1\mil + % + % Do not allow a page break right after this kern. + \nobreak + \fi +} + +% @br forces paragraph break (and is undocumented). + +\let\br = \par + +% @page forces the start of a new page. +% +\def\page{\par\vfill\supereject} + +% @exdent text.... +% outputs text on separate line in roman font, starting at standard page margin + +% This records the amount of indent in the innermost environment. +% That's how much \exdent should take out. +\newskip\exdentamount + +% This defn is used inside fill environments such as @defun. +\parseargdef\exdent{\hfil\break\hbox{\kern -\exdentamount{\rm#1}}\hfil\break} + +% This defn is used inside nofill environments such as @example. +\parseargdef\nofillexdent{{\advance \leftskip by -\exdentamount + \leftline{\hskip\leftskip{\rm#1}}}} + +% @inmargin{WHICH}{TEXT} puts TEXT in the WHICH margin next to the current +% paragraph. For more general purposes, use the \margin insertion +% class. WHICH is `l' or `r'. +% +\newskip\inmarginspacing \inmarginspacing=1cm +\def\strutdepth{\dp\strutbox} +% +\def\doinmargin#1#2{\strut\vadjust{% + \nobreak + \kern-\strutdepth + \vtop to \strutdepth{% + \baselineskip=\strutdepth + \vss + % if you have multiple lines of stuff to put here, you'll need to + % make the vbox yourself of the appropriate size. + \ifx#1l% + \llap{\ignorespaces #2\hskip\inmarginspacing}% + \else + \rlap{\hskip\hsize \hskip\inmarginspacing \ignorespaces #2}% + \fi + \null + }% +}} +\def\inleftmargin{\doinmargin l} +\def\inrightmargin{\doinmargin r} +% +% @inmargin{TEXT [, RIGHT-TEXT]} +% (if RIGHT-TEXT is given, use TEXT for left page, RIGHT-TEXT for right; +% else use TEXT for both). +% +\def\inmargin#1{\parseinmargin #1,,\finish} +\def\parseinmargin#1,#2,#3\finish{% not perfect, but better than nothing. + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \def\lefttext{#1}% have both texts + \def\righttext{#2}% + \else + \def\lefttext{#1}% have only one text + \def\righttext{#1}% + \fi + % + \ifodd\pageno + \def\temp{\inrightmargin\righttext}% odd page -> outside is right margin + \else + \def\temp{\inleftmargin\lefttext}% + \fi + \temp +} + +% @include file insert text of that file as input. +% +\def\include{\parseargusing\filenamecatcodes\includezzz} +\def\includezzz#1{% + \pushthisfilestack + \def\thisfile{#1}% + {% + \makevalueexpandable + \def\temp{\input #1 }% + \expandafter + }\temp + \popthisfilestack +} +\def\filenamecatcodes{% + \catcode`\\=\other + \catcode`~=\other + \catcode`^=\other + \catcode`_=\other + \catcode`|=\other + \catcode`<=\other + \catcode`>=\other + \catcode`+=\other + \catcode`-=\other +} + +\def\pushthisfilestack{% + \expandafter\pushthisfilestackX\popthisfilestack\StackTerm +} +\def\pushthisfilestackX{% + \expandafter\pushthisfilestackY\thisfile\StackTerm +} +\def\pushthisfilestackY #1\StackTerm #2\StackTerm {% + \gdef\popthisfilestack{\gdef\thisfile{#1}\gdef\popthisfilestack{#2}}% +} + +\def\popthisfilestack{\errthisfilestackempty} +\def\errthisfilestackempty{\errmessage{Internal error: + the stack of filenames is empty.}} + +\def\thisfile{} + +% @center line +% outputs that line, centered. +% +\parseargdef\center{% + \ifhmode + \let\next\centerH + \else + \let\next\centerV + \fi + \next{\hfil \ignorespaces#1\unskip \hfil}% +} +\def\centerH#1{% + {% + \hfil\break + \advance\hsize by -\leftskip + \advance\hsize by -\rightskip + \line{#1}% + \break + }% +} +\def\centerV#1{\line{\kern\leftskip #1\kern\rightskip}} + +% @sp n outputs n lines of vertical space + +\parseargdef\sp{\vskip #1\baselineskip} + +% @comment ...line which is ignored... +% @c is the same as @comment +% @ignore ... @end ignore is another way to write a comment + +\def\comment{\begingroup \catcode`\^^M=\other% +\catcode`\@=\other \catcode`\{=\other \catcode`\}=\other% +\commentxxx} +{\catcode`\^^M=\other \gdef\commentxxx#1^^M{\endgroup}} + +\let\c=\comment + +% @paragraphindent NCHARS +% We'll use ems for NCHARS, close enough. +% NCHARS can also be the word `asis' or `none'. +% We cannot feasibly implement @paragraphindent asis, though. +% +\def\asisword{asis} % no translation, these are keywords +\def\noneword{none} +% +\parseargdef\paragraphindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \defaultparindent = 0pt + \else + \defaultparindent = #1em + \fi + \fi + \parindent = \defaultparindent +} + +% @exampleindent NCHARS +% We'll use ems for NCHARS like @paragraphindent. +% It seems @exampleindent asis isn't necessary, but +% I preserve it to make it similar to @paragraphindent. +\parseargdef\exampleindent{% + \def\temp{#1}% + \ifx\temp\asisword + \else + \ifx\temp\noneword + \lispnarrowing = 0pt + \else + \lispnarrowing = #1em + \fi + \fi +} + +% @firstparagraphindent WORD +% If WORD is `none', then suppress indentation of the first paragraph +% after a section heading. If WORD is `insert', then do indent at such +% paragraphs. +% +% The paragraph indentation is suppressed or not by calling +% \suppressfirstparagraphindent, which the sectioning commands do. +% We switch the definition of this back and forth according to WORD. +% By default, we suppress indentation. +% +\def\suppressfirstparagraphindent{\dosuppressfirstparagraphindent} +\def\insertword{insert} +% +\parseargdef\firstparagraphindent{% + \def\temp{#1}% + \ifx\temp\noneword + \let\suppressfirstparagraphindent = \dosuppressfirstparagraphindent + \else\ifx\temp\insertword + \let\suppressfirstparagraphindent = \relax + \else + \errhelp = \EMsimple + \errmessage{Unknown @firstparagraphindent option `\temp'}% + \fi\fi +} + +% Here is how we actually suppress indentation. Redefine \everypar to +% \kern backwards by \parindent, and then reset itself to empty. +% +% We also make \indent itself not actually do anything until the next +% paragraph. +% +\gdef\dosuppressfirstparagraphindent{% + \gdef\indent{% + \restorefirstparagraphindent + \indent + }% + \gdef\noindent{% + \restorefirstparagraphindent + \noindent + }% + \global\everypar = {% + \kern -\parindent + \restorefirstparagraphindent + }% +} + +\gdef\restorefirstparagraphindent{% + \global \let \indent = \ptexindent + \global \let \noindent = \ptexnoindent + \global \everypar = {}% +} + + +% @asis just yields its argument. Used with @table, for example. +% +\def\asis#1{#1} + +% @math outputs its argument in math mode. +% +% One complication: _ usually means subscripts, but it could also mean +% an actual _ character, as in @math{@var{some_variable} + 1}. So make +% _ active, and distinguish by seeing if the current family is \slfam, +% which is what @var uses. +{ + \catcode`\_ = \active + \gdef\mathunderscore{% + \catcode`\_=\active + \def_{\ifnum\fam=\slfam \_\else\sb\fi}% + } +} +% Another complication: we want \\ (and @\) to output a \ character. +% FYI, plain.tex uses \\ as a temporary control sequence (why?), but +% this is not advertised and we don't care. Texinfo does not +% otherwise define @\. +% +% The \mathchar is class=0=ordinary, family=7=ttfam, position=5C=\. +\def\mathbackslash{\ifnum\fam=\ttfam \mathchar"075C \else\backslash \fi} +% +\def\math{% + \tex + \mathunderscore + \let\\ = \mathbackslash + \mathactive + $\finishmath +} +\def\finishmath#1{#1$\endgroup} % Close the group opened by \tex. + +% Some active characters (such as <) are spaced differently in math. +% We have to reset their definitions in case the @math was an argument +% to a command which sets the catcodes (such as @item or @section). +% +{ + \catcode`^ = \active + \catcode`< = \active + \catcode`> = \active + \catcode`+ = \active + \gdef\mathactive{% + \let^ = \ptexhat + \let< = \ptexless + \let> = \ptexgtr + \let+ = \ptexplus + } +} + +% @bullet and @minus need the same treatment as @math, just above. +\def\bullet{$\ptexbullet$} +\def\minus{$-$} + +% @dots{} outputs an ellipsis using the current font. +% We do .5em per period so that it has the same spacing in the cm +% typewriter fonts as three actual period characters; on the other hand, +% in other typewriter fonts three periods are wider than 1.5em. So do +% whichever is larger. +% +\def\dots{% + \leavevmode + \setbox0=\hbox{...}% get width of three periods + \ifdim\wd0 > 1.5em + \dimen0 = \wd0 + \else + \dimen0 = 1.5em + \fi + \hbox to \dimen0{% + \hskip 0pt plus.25fil + .\hskip 0pt plus1fil + .\hskip 0pt plus1fil + .\hskip 0pt plus.5fil + }% +} + +% @enddots{} is an end-of-sentence ellipsis. +% +\def\enddots{% + \dots + \spacefactor=\endofsentencespacefactor +} + +% @comma{} is so commas can be inserted into text without messing up +% Texinfo's parsing. +% +\let\comma = , + +% @refill is a no-op. +\let\refill=\relax + +% If working on a large document in chapters, it is convenient to +% be able to disable indexing, cross-referencing, and contents, for test runs. +% This is done with @novalidate (before @setfilename). +% +\newif\iflinks \linkstrue % by default we want the aux files. +\let\novalidate = \linksfalse + +% @setfilename is done at the beginning of every texinfo file. +% So open here the files we need to have open while reading the input. +% This makes it possible to make a .fmt file for texinfo. +\def\setfilename{% + \fixbackslash % Turn off hack to swallow `\input texinfo'. + \iflinks + \tryauxfile + % Open the new aux file. TeX will close it automatically at exit. + \immediate\openout\auxfile=\jobname.aux + \fi % \openindices needs to do some work in any case. + \openindices + \let\setfilename=\comment % Ignore extra @setfilename cmds. + % + % If texinfo.cnf is present on the system, read it. + % Useful for site-wide @afourpaper, etc. + \openin 1 texinfo.cnf + \ifeof 1 \else \input texinfo.cnf \fi + \closein 1 + % + \comment % Ignore the actual filename. +} + +% Called from \setfilename. +% +\def\openindices{% + \newindex{cp}% + \newcodeindex{fn}% + \newcodeindex{vr}% + \newcodeindex{tp}% + \newcodeindex{ky}% + \newcodeindex{pg}% +} + +% @bye. +\outer\def\bye{\pagealignmacro\tracingstats=1\ptexend} + + +\message{pdf,} +% adobe `portable' document format +\newcount\tempnum +\newcount\lnkcount +\newtoks\filename +\newcount\filenamelength +\newcount\pgn +\newtoks\toksA +\newtoks\toksB +\newtoks\toksC +\newtoks\toksD +\newbox\boxA +\newcount\countA +\newif\ifpdf +\newif\ifpdfmakepagedest + +% when pdftex is run in dvi mode, \pdfoutput is defined (so \pdfoutput=1 +% can be set). So we test for \relax and 0 as well as \undefined, +% borrowed from ifpdf.sty. +\ifx\pdfoutput\undefined +\else + \ifx\pdfoutput\relax + \else + \ifcase\pdfoutput + \else + \pdftrue + \fi + \fi +\fi + +% PDF uses PostScript string constants for the names of xref targets, +% for display in the outlines, and in other places. Thus, we have to +% double any backslashes. Otherwise, a name like "\node" will be +% interpreted as a newline (\n), followed by o, d, e. Not good. +% http://www.ntg.nl/pipermail/ntg-pdftex/2004-July/000654.html +% (and related messages, the final outcome is that it is up to the TeX +% user to double the backslashes and otherwise make the string valid, so +% that's what we do). + +% double active backslashes. +% +{\catcode`\@=0 \catcode`\\=\active + @gdef@activebackslashdouble{% + @catcode`@\=@active + @let\=@doublebackslash} +} + +% To handle parens, we must adopt a different approach, since parens are +% not active characters. hyperref.dtx (which has the same problem as +% us) handles it with this amazing macro to replace tokens, with minor +% changes for Texinfo. It is included here under the GPL by permission +% from the author, Heiko Oberdiek. +% +% #1 is the tokens to replace. +% #2 is the replacement. +% #3 is the control sequence with the string. +% +\def\HyPsdSubst#1#2#3{% + \def\HyPsdReplace##1#1##2\END{% + ##1% + \ifx\\##2\\% + \else + #2% + \HyReturnAfterFi{% + \HyPsdReplace##2\END + }% + \fi + }% + \xdef#3{\expandafter\HyPsdReplace#3#1\END}% +} +\long\def\HyReturnAfterFi#1\fi{\fi#1} + +% #1 is a control sequence in which to do the replacements. +\def\backslashparens#1{% + \xdef#1{#1}% redefine it as its expansion; the definition is simply + % \lastnode when called from \setref -> \pdfmkdest. + \HyPsdSubst{(}{\realbackslash(}{#1}% + \HyPsdSubst{)}{\realbackslash)}{#1}% +} + +\newhelp\nopdfimagehelp{Texinfo supports .png, .jpg, .jpeg, and .pdf images +with PDF output, and none of those formats could be found. (.eps cannot +be supported due to the design of the PDF format; use regular TeX (DVI +output) for that.)} + +\ifpdf + % + % Color manipulation macros based on pdfcolor.tex. + \def\cmykDarkRed{0.28 1 1 0.35} + \def\cmykBlack{0 0 0 1} + % + \def\pdfsetcolor#1{\pdfliteral{#1 k}} + % Set color, and create a mark which defines \thiscolor accordingly, + % so that \makeheadline knows which color to restore. + \def\setcolor#1{% + \xdef\lastcolordefs{\gdef\noexpand\thiscolor{#1}}% + \domark + \pdfsetcolor{#1}% + } + % + \def\maincolor{\cmykBlack} + \pdfsetcolor{\maincolor} + \edef\thiscolor{\maincolor} + \def\lastcolordefs{} + % + \def\makefootline{% + \baselineskip24pt + \line{\pdfsetcolor{\maincolor}\the\footline}% + } + % + \def\makeheadline{% + \vbox to 0pt{% + \vskip-22.5pt + \line{% + \vbox to8.5pt{}% + % Extract \thiscolor definition from the marks. + \getcolormarks + % Typeset the headline with \maincolor, then restore the color. + \pdfsetcolor{\maincolor}\the\headline\pdfsetcolor{\thiscolor}% + }% + \vss + }% + \nointerlineskip + } + % + % + \pdfcatalog{/PageMode /UseOutlines} + % + % #1 is image name, #2 width (might be empty/whitespace), #3 height (ditto). + \def\dopdfimage#1#2#3{% + \def\imagewidth{#2}\setbox0 = \hbox{\ignorespaces #2}% + \def\imageheight{#3}\setbox2 = \hbox{\ignorespaces #3}% + % + % pdftex (and the PDF format) support .png, .jpg, .pdf (among + % others). Let's try in that order. + \let\pdfimgext=\empty + \begingroup + \openin 1 #1.png \ifeof 1 + \openin 1 #1.jpg \ifeof 1 + \openin 1 #1.jpeg \ifeof 1 + \openin 1 #1.JPG \ifeof 1 + \openin 1 #1.pdf \ifeof 1 + \errhelp = \nopdfimagehelp + \errmessage{Could not find image file #1 for pdf}% + \else \gdef\pdfimgext{pdf}% + \fi + \else \gdef\pdfimgext{JPG}% + \fi + \else \gdef\pdfimgext{jpeg}% + \fi + \else \gdef\pdfimgext{jpg}% + \fi + \else \gdef\pdfimgext{png}% + \fi + \closein 1 + \endgroup + % + % without \immediate, pdftex seg faults when the same image is + % included twice. (Version 3.14159-pre-1.0-unofficial-20010704.) + \ifnum\pdftexversion < 14 + \immediate\pdfimage + \else + \immediate\pdfximage + \fi + \ifdim \wd0 >0pt width \imagewidth \fi + \ifdim \wd2 >0pt height \imageheight \fi + \ifnum\pdftexversion<13 + #1.\pdfimgext + \else + {#1.\pdfimgext}% + \fi + \ifnum\pdftexversion < 14 \else + \pdfrefximage \pdflastximage + \fi} + % + \def\pdfmkdest#1{{% + % We have to set dummies so commands such as @code, and characters + % such as \, aren't expanded when present in a section title. + \indexnofonts + \turnoffactive + \activebackslashdouble + \makevalueexpandable + \def\pdfdestname{#1}% + \backslashparens\pdfdestname + \safewhatsit{\pdfdest name{\pdfdestname} xyz}% + }} + % + % used to mark target names; must be expandable. + \def\pdfmkpgn#1{#1} + % + % by default, use a color that is dark enough to print on paper as + % nearly black, but still distinguishable for online viewing. + \def\urlcolor{\cmykDarkRed} + \def\linkcolor{\cmykDarkRed} + \def\endlink{\setcolor{\maincolor}\pdfendlink} + % + % Adding outlines to PDF; macros for calculating structure of outlines + % come from Petr Olsak + \def\expnumber#1{\expandafter\ifx\csname#1\endcsname\relax 0% + \else \csname#1\endcsname \fi} + \def\advancenumber#1{\tempnum=\expnumber{#1}\relax + \advance\tempnum by 1 + \expandafter\xdef\csname#1\endcsname{\the\tempnum}} + % + % #1 is the section text, which is what will be displayed in the + % outline by the pdf viewer. #2 is the pdf expression for the number + % of subentries (or empty, for subsubsections). #3 is the node text, + % which might be empty if this toc entry had no corresponding node. + % #4 is the page number + % + \def\dopdfoutline#1#2#3#4{% + % Generate a link to the node text if that exists; else, use the + % page number. We could generate a destination for the section + % text in the case where a section has no node, but it doesn't + % seem worth the trouble, since most documents are normally structured. + \def\pdfoutlinedest{#3}% + \ifx\pdfoutlinedest\empty + \def\pdfoutlinedest{#4}% + \else + % Doubled backslashes in the name. + {\activebackslashdouble \xdef\pdfoutlinedest{#3}% + \backslashparens\pdfoutlinedest}% + \fi + % + % Also double the backslashes in the display string. + {\activebackslashdouble \xdef\pdfoutlinetext{#1}% + \backslashparens\pdfoutlinetext}% + % + \pdfoutline goto name{\pdfmkpgn{\pdfoutlinedest}}#2{\pdfoutlinetext}% + } + % + \def\pdfmakeoutlines{% + \begingroup + % Thanh's hack / proper braces in bookmarks + \edef\mylbrace{\iftrue \string{\else}\fi}\let\{=\mylbrace + \edef\myrbrace{\iffalse{\else\string}\fi}\let\}=\myrbrace + % + % Read toc silently, to get counts of subentries for \pdfoutline. + \def\numchapentry##1##2##3##4{% + \def\thischapnum{##2}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + }% + \def\numsecentry##1##2##3##4{% + \advancenumber{chap\thischapnum}% + \def\thissecnum{##2}% + \def\thissubsecnum{0}% + }% + \def\numsubsecentry##1##2##3##4{% + \advancenumber{sec\thissecnum}% + \def\thissubsecnum{##2}% + }% + \def\numsubsubsecentry##1##2##3##4{% + \advancenumber{subsec\thissubsecnum}% + }% + \def\thischapnum{0}% + \def\thissecnum{0}% + \def\thissubsecnum{0}% + % + % use \def rather than \let here because we redefine \chapentry et + % al. a second time, below. + \def\appentry{\numchapentry}% + \def\appsecentry{\numsecentry}% + \def\appsubsecentry{\numsubsecentry}% + \def\appsubsubsecentry{\numsubsubsecentry}% + \def\unnchapentry{\numchapentry}% + \def\unnsecentry{\numsecentry}% + \def\unnsubsecentry{\numsubsecentry}% + \def\unnsubsubsecentry{\numsubsubsecentry}% + \readdatafile{toc}% + % + % Read toc second time, this time actually producing the outlines. + % The `-' means take the \expnumber as the absolute number of + % subentries, which we calculated on our first read of the .toc above. + % + % We use the node names as the destinations. + \def\numchapentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{chap##2}}{##3}{##4}}% + \def\numsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{sec##2}}{##3}{##4}}% + \def\numsubsecentry##1##2##3##4{% + \dopdfoutline{##1}{count-\expnumber{subsec##2}}{##3}{##4}}% + \def\numsubsubsecentry##1##2##3##4{% count is always zero + \dopdfoutline{##1}{}{##3}{##4}}% + % + % PDF outlines are displayed using system fonts, instead of + % document fonts. Therefore we cannot use special characters, + % since the encoding is unknown. For example, the eogonek from + % Latin 2 (0xea) gets translated to a | character. Info from + % Staszek Wawrykiewicz, 19 Jan 2004 04:09:24 +0100. + % + % xx to do this right, we have to translate 8-bit characters to + % their "best" equivalent, based on the @documentencoding. Right + % now, I guess we'll just let the pdf reader have its way. + \indexnofonts + \setupdatafile + \catcode`\\=\active \otherbackslash + \input \tocreadfilename + \endgroup + } + % + \def\skipspaces#1{\def\PP{#1}\def\D{|}% + \ifx\PP\D\let\nextsp\relax + \else\let\nextsp\skipspaces + \ifx\p\space\else\addtokens{\filename}{\PP}% + \advance\filenamelength by 1 + \fi + \fi + \nextsp} + \def\getfilename#1{\filenamelength=0\expandafter\skipspaces#1|\relax} + \ifnum\pdftexversion < 14 + \let \startlink \pdfannotlink + \else + \let \startlink \pdfstartlink + \fi + % make a live url in pdf output. + \def\pdfurl#1{% + \begingroup + % it seems we really need yet another set of dummies; have not + % tried to figure out what each command should do in the context + % of @url. for now, just make @/ a no-op, that's the only one + % people have actually reported a problem with. + % + \normalturnoffactive + \def\@{@}% + \let\/=\empty + \makevalueexpandable + \leavevmode\setcolor{\urlcolor}% + \startlink attr{/Border [0 0 0]}% + user{/Subtype /Link /A << /S /URI /URI (#1) >>}% + \endgroup} + \def\pdfgettoks#1.{\setbox\boxA=\hbox{\toksA={#1.}\toksB={}\maketoks}} + \def\addtokens#1#2{\edef\addtoks{\noexpand#1={\the#1#2}}\addtoks} + \def\adn#1{\addtokens{\toksC}{#1}\global\countA=1\let\next=\maketoks} + \def\poptoks#1#2|ENDTOKS|{\let\first=#1\toksD={#1}\toksA={#2}} + \def\maketoks{% + \expandafter\poptoks\the\toksA|ENDTOKS|\relax + \ifx\first0\adn0 + \else\ifx\first1\adn1 \else\ifx\first2\adn2 \else\ifx\first3\adn3 + \else\ifx\first4\adn4 \else\ifx\first5\adn5 \else\ifx\first6\adn6 + \else\ifx\first7\adn7 \else\ifx\first8\adn8 \else\ifx\first9\adn9 + \else + \ifnum0=\countA\else\makelink\fi + \ifx\first.\let\next=\done\else + \let\next=\maketoks + \addtokens{\toksB}{\the\toksD} + \ifx\first,\addtokens{\toksB}{\space}\fi + \fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \next} + \def\makelink{\addtokens{\toksB}% + {\noexpand\pdflink{\the\toksC}}\toksC={}\global\countA=0} + \def\pdflink#1{% + \startlink attr{/Border [0 0 0]} goto name{\pdfmkpgn{#1}} + \setcolor{\linkcolor}#1\endlink} + \def\done{\edef\st{\global\noexpand\toksA={\the\toksB}}\st} +\else + \let\pdfmkdest = \gobble + \let\pdfurl = \gobble + \let\endlink = \relax + \let\setcolor = \gobble + \let\pdfsetcolor = \gobble + \let\pdfmakeoutlines = \relax +\fi % \ifx\pdfoutput + + +\message{fonts,} + +% Change the current font style to #1, remembering it in \curfontstyle. +% For now, we do not accumulate font styles: @b{@i{foo}} prints foo in +% italics, not bold italics. +% +\def\setfontstyle#1{% + \def\curfontstyle{#1}% not as a control sequence, because we are \edef'd. + \csname ten#1\endcsname % change the current font +} + +% Select #1 fonts with the current style. +% +\def\selectfonts#1{\csname #1fonts\endcsname \csname\curfontstyle\endcsname} + +\def\rm{\fam=0 \setfontstyle{rm}} +\def\it{\fam=\itfam \setfontstyle{it}} +\def\sl{\fam=\slfam \setfontstyle{sl}} +\def\bf{\fam=\bffam \setfontstyle{bf}}\def\bfstylename{bf} +\def\tt{\fam=\ttfam \setfontstyle{tt}} + +% Texinfo sort of supports the sans serif font style, which plain TeX does not. +% So we set up a \sf. +\newfam\sffam +\def\sf{\fam=\sffam \setfontstyle{sf}} +\let\li = \sf % Sometimes we call it \li, not \sf. + +% We don't need math for this font style. +\def\ttsl{\setfontstyle{ttsl}} + + +% Default leading. +\newdimen\textleading \textleading = 13.2pt + +% Set the baselineskip to #1, and the lineskip and strut size +% correspondingly. There is no deep meaning behind these magic numbers +% used as factors; they just match (closely enough) what Knuth defined. +% +\def\lineskipfactor{.08333} +\def\strutheightpercent{.70833} +\def\strutdepthpercent {.29167} +% +% can get a sort of poor man's double spacing by redefining this. +\def\baselinefactor{1} +% +\def\setleading#1{% + \dimen0 = #1\relax + \normalbaselineskip = \baselinefactor\dimen0 + \normallineskip = \lineskipfactor\normalbaselineskip + \normalbaselines + \setbox\strutbox =\hbox{% + \vrule width0pt height\strutheightpercent\baselineskip + depth \strutdepthpercent \baselineskip + }% +} + +% +% PDF CMaps. See also LaTeX's t1.cmap. +% +% \cmapOT1 +\ifpdf + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1-0) +%%Title: (TeX-OT1-0 TeX OT1 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1) +/Supplement 0 +>> def +/CMapName /TeX-OT1-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<23> <26> <0023> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +40 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1IT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1IT-0) +%%Title: (TeX-OT1IT-0 TeX OT1IT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1IT) +/Supplement 0 +>> def +/CMapName /TeX-OT1IT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +8 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<25> <26> <0025> +<28> <3B> <0028> +<3F> <5B> <003F> +<5D> <5E> <005D> +<61> <7A> <0061> +<7B> <7C> <2013> +endbfrange +42 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <00660066> +<0C> <00660069> +<0D> <0066006C> +<0E> <006600660069> +<0F> <00660066006C> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<21> <0021> +<22> <201D> +<23> <0023> +<24> <00A3> +<27> <2019> +<3C> <00A1> +<3D> <003D> +<3E> <00BF> +<5C> <201C> +<5F> <02D9> +<60> <2018> +<7D> <02DD> +<7E> <007E> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1IT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +% +% \cmapOT1TT + \begingroup + \catcode`\^^M=\active \def^^M{^^J}% Output line endings as the ^^J char. + \catcode`\%=12 \immediate\pdfobj stream {%!PS-Adobe-3.0 Resource-CMap +%%DocumentNeededResources: ProcSet (CIDInit) +%%IncludeResource: ProcSet (CIDInit) +%%BeginResource: CMap (TeX-OT1TT-0) +%%Title: (TeX-OT1TT-0 TeX OT1TT 0) +%%Version: 1.000 +%%EndComments +/CIDInit /ProcSet findresource begin +12 dict begin +begincmap +/CIDSystemInfo +<< /Registry (TeX) +/Ordering (OT1TT) +/Supplement 0 +>> def +/CMapName /TeX-OT1TT-0 def +/CMapType 2 def +1 begincodespacerange +<00> <7F> +endcodespacerange +5 beginbfrange +<00> <01> <0393> +<09> <0A> <03A8> +<21> <26> <0021> +<28> <5F> <0028> +<61> <7E> <0061> +endbfrange +32 beginbfchar +<02> <0398> +<03> <039B> +<04> <039E> +<05> <03A0> +<06> <03A3> +<07> <03D2> +<08> <03A6> +<0B> <2191> +<0C> <2193> +<0D> <0027> +<0E> <00A1> +<0F> <00BF> +<10> <0131> +<11> <0237> +<12> <0060> +<13> <00B4> +<14> <02C7> +<15> <02D8> +<16> <00AF> +<17> <02DA> +<18> <00B8> +<19> <00DF> +<1A> <00E6> +<1B> <0153> +<1C> <00F8> +<1D> <00C6> +<1E> <0152> +<1F> <00D8> +<20> <2423> +<27> <2019> +<60> <2018> +<7F> <00A8> +endbfchar +endcmap +CMapName currentdict /CMap defineresource pop +end +end +%%EndResource +%%EOF + }\endgroup + \expandafter\edef\csname cmapOT1TT\endcsname#1{% + \pdffontattr#1{/ToUnicode \the\pdflastobj\space 0 R}% + }% +\else + \expandafter\let\csname cmapOT1\endcsname\gobble + \expandafter\let\csname cmapOT1IT\endcsname\gobble + \expandafter\let\csname cmapOT1TT\endcsname\gobble +\fi + + +% Set the font macro #1 to the font named #2, adding on the +% specified font prefix (normally `cm'). +% #3 is the font's design size, #4 is a scale factor, #5 is the CMap +% encoding (currently only OT1, OT1IT and OT1TT are allowed, pass +% empty to omit). +\def\setfont#1#2#3#4#5{% + \font#1=\fontprefix#2#3 scaled #4 + \csname cmap#5\endcsname#1% +} +% This is what gets called when #5 of \setfont is empty. +\let\cmap\gobble + + +% Use cm as the default font prefix. +% To specify the font prefix, you must define \fontprefix +% before you read in texinfo.tex. +\ifx\fontprefix\undefined +\def\fontprefix{cm} +\fi +% Support font families that don't use the same naming scheme as CM. +\def\rmshape{r} +\def\rmbshape{bx} %where the normal face is bold +\def\bfshape{b} +\def\bxshape{bx} +\def\ttshape{tt} +\def\ttbshape{tt} +\def\ttslshape{sltt} +\def\itshape{ti} +\def\itbshape{bxti} +\def\slshape{sl} +\def\slbshape{bxsl} +\def\sfshape{ss} +\def\sfbshape{ss} +\def\scshape{csc} +\def\scbshape{csc} + +% Definitions for a main text size of 11pt. This is the default in +% Texinfo. +% +\def\definetextfontsizexi{% +% Text fonts (11.2pt, magstep1). +\def\textnominalsize{11pt} +\edef\mainmagstep{\magstephalf} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1095} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstep1}{OT1} +\setfont\deftt\ttshape{10}{\magstep1}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstep1}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} +\def\titleecsize{2074} + +% Chapter (and unnumbered) fonts (17.28pt). +\def\chapnominalsize{17pt} +\setfont\chaprm\rmbshape{12}{\magstep2}{OT1} +\setfont\chapit\itbshape{10}{\magstep3}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep3}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep2}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep3}{OT1TT} +\setfont\chapsf\sfbshape{17}{1000}{OT1} +\let\chapbf=\chaprm +\setfont\chapsc\scbshape{10}{\magstep3}{OT1} +\font\chapi=cmmi12 scaled \magstep2 +\font\chapsy=cmsy10 scaled \magstep3 +\def\chapecsize{1728} + +% Section fonts (14.4pt). +\def\secnominalsize{14pt} +\setfont\secrm\rmbshape{12}{\magstep1}{OT1} +\setfont\secit\itbshape{10}{\magstep2}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep2}{OT1} +\setfont\sectt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\secsf\sfbshape{12}{\magstep1}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep2}{OT1} +\font\seci=cmmi12 scaled \magstep1 +\font\secsy=cmsy10 scaled \magstep2 +\def\sececsize{1440} + +% Subsection fonts (13.15pt). +\def\ssecnominalsize{13pt} +\setfont\ssecrm\rmbshape{12}{\magstephalf}{OT1} +\setfont\ssecit\itbshape{10}{1315}{OT1IT} +\setfont\ssecsl\slbshape{10}{1315}{OT1} +\setfont\ssectt\ttbshape{12}{\magstephalf}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1315}{OT1TT} +\setfont\ssecsf\sfbshape{12}{\magstephalf}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1315}{OT1} +\font\sseci=cmmi12 scaled \magstephalf +\font\ssecsy=cmsy10 scaled 1315 +\def\ssececsize{1200} + +% Reduced fonts for @acro in text (10pt). +\def\reducednominalsize{10pt} +\setfont\reducedrm\rmshape{10}{1000}{OT1} +\setfont\reducedtt\ttshape{10}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{1000}{OT1} +\setfont\reducedit\itshape{10}{1000}{OT1IT} +\setfont\reducedsl\slshape{10}{1000}{OT1} +\setfont\reducedsf\sfshape{10}{1000}{OT1} +\setfont\reducedsc\scshape{10}{1000}{OT1} +\setfont\reducedttsl\ttslshape{10}{1000}{OT1TT} +\font\reducedi=cmmi10 +\font\reducedsy=cmsy10 +\def\reducedecsize{1000} + +% reset the current fonts +\textfonts +\rm +} % end of 11pt text font size definitions + + +% Definitions to make the main text be 10pt Computer Modern, with +% section, chapter, etc., sizes following suit. This is for the GNU +% Press printing of the Emacs 22 manual. Maybe other manuals in the +% future. Used with @smallbook, which sets the leading to 12pt. +% +\def\definetextfontsizex{% +% Text fonts (10pt). +\def\textnominalsize{10pt} +\edef\mainmagstep{1000} +\setfont\textrm\rmshape{10}{\mainmagstep}{OT1} +\setfont\texttt\ttshape{10}{\mainmagstep}{OT1TT} +\setfont\textbf\bfshape{10}{\mainmagstep}{OT1} +\setfont\textit\itshape{10}{\mainmagstep}{OT1IT} +\setfont\textsl\slshape{10}{\mainmagstep}{OT1} +\setfont\textsf\sfshape{10}{\mainmagstep}{OT1} +\setfont\textsc\scshape{10}{\mainmagstep}{OT1} +\setfont\textttsl\ttslshape{10}{\mainmagstep}{OT1TT} +\font\texti=cmmi10 scaled \mainmagstep +\font\textsy=cmsy10 scaled \mainmagstep +\def\textecsize{1000} + +% A few fonts for @defun names and args. +\setfont\defbf\bfshape{10}{\magstephalf}{OT1} +\setfont\deftt\ttshape{10}{\magstephalf}{OT1TT} +\setfont\defttsl\ttslshape{10}{\magstephalf}{OT1TT} +\def\df{\let\tentt=\deftt \let\tenbf = \defbf \let\tenttsl=\defttsl \bf} + +% Fonts for indices, footnotes, small examples (9pt). +\def\smallnominalsize{9pt} +\setfont\smallrm\rmshape{9}{1000}{OT1} +\setfont\smalltt\ttshape{9}{1000}{OT1TT} +\setfont\smallbf\bfshape{10}{900}{OT1} +\setfont\smallit\itshape{9}{1000}{OT1IT} +\setfont\smallsl\slshape{9}{1000}{OT1} +\setfont\smallsf\sfshape{9}{1000}{OT1} +\setfont\smallsc\scshape{10}{900}{OT1} +\setfont\smallttsl\ttslshape{10}{900}{OT1TT} +\font\smalli=cmmi9 +\font\smallsy=cmsy9 +\def\smallecsize{0900} + +% Fonts for small examples (8pt). +\def\smallernominalsize{8pt} +\setfont\smallerrm\rmshape{8}{1000}{OT1} +\setfont\smallertt\ttshape{8}{1000}{OT1TT} +\setfont\smallerbf\bfshape{10}{800}{OT1} +\setfont\smallerit\itshape{8}{1000}{OT1IT} +\setfont\smallersl\slshape{8}{1000}{OT1} +\setfont\smallersf\sfshape{8}{1000}{OT1} +\setfont\smallersc\scshape{10}{800}{OT1} +\setfont\smallerttsl\ttslshape{10}{800}{OT1TT} +\font\smalleri=cmmi8 +\font\smallersy=cmsy8 +\def\smallerecsize{0800} + +% Fonts for title page (20.4pt): +\def\titlenominalsize{20pt} +\setfont\titlerm\rmbshape{12}{\magstep3}{OT1} +\setfont\titleit\itbshape{10}{\magstep4}{OT1IT} +\setfont\titlesl\slbshape{10}{\magstep4}{OT1} +\setfont\titlett\ttbshape{12}{\magstep3}{OT1TT} +\setfont\titlettsl\ttslshape{10}{\magstep4}{OT1TT} +\setfont\titlesf\sfbshape{17}{\magstep1}{OT1} +\let\titlebf=\titlerm +\setfont\titlesc\scbshape{10}{\magstep4}{OT1} +\font\titlei=cmmi12 scaled \magstep3 +\font\titlesy=cmsy10 scaled \magstep4 +\def\authorrm{\secrm} +\def\authortt{\sectt} +\def\titleecsize{2074} + +% Chapter fonts (14.4pt). +\def\chapnominalsize{14pt} +\setfont\chaprm\rmbshape{12}{\magstep1}{OT1} +\setfont\chapit\itbshape{10}{\magstep2}{OT1IT} +\setfont\chapsl\slbshape{10}{\magstep2}{OT1} +\setfont\chaptt\ttbshape{12}{\magstep1}{OT1TT} +\setfont\chapttsl\ttslshape{10}{\magstep2}{OT1TT} +\setfont\chapsf\sfbshape{12}{\magstep1}{OT1} +\let\chapbf\chaprm +\setfont\chapsc\scbshape{10}{\magstep2}{OT1} +\font\chapi=cmmi12 scaled \magstep1 +\font\chapsy=cmsy10 scaled \magstep2 +\def\chapecsize{1440} + +% Section fonts (12pt). +\def\secnominalsize{12pt} +\setfont\secrm\rmbshape{12}{1000}{OT1} +\setfont\secit\itbshape{10}{\magstep1}{OT1IT} +\setfont\secsl\slbshape{10}{\magstep1}{OT1} +\setfont\sectt\ttbshape{12}{1000}{OT1TT} +\setfont\secttsl\ttslshape{10}{\magstep1}{OT1TT} +\setfont\secsf\sfbshape{12}{1000}{OT1} +\let\secbf\secrm +\setfont\secsc\scbshape{10}{\magstep1}{OT1} +\font\seci=cmmi12 +\font\secsy=cmsy10 scaled \magstep1 +\def\sececsize{1200} + +% Subsection fonts (10pt). +\def\ssecnominalsize{10pt} +\setfont\ssecrm\rmbshape{10}{1000}{OT1} +\setfont\ssecit\itbshape{10}{1000}{OT1IT} +\setfont\ssecsl\slbshape{10}{1000}{OT1} +\setfont\ssectt\ttbshape{10}{1000}{OT1TT} +\setfont\ssecttsl\ttslshape{10}{1000}{OT1TT} +\setfont\ssecsf\sfbshape{10}{1000}{OT1} +\let\ssecbf\ssecrm +\setfont\ssecsc\scbshape{10}{1000}{OT1} +\font\sseci=cmmi10 +\font\ssecsy=cmsy10 +\def\ssececsize{1000} + +% Reduced fonts for @acro in text (9pt). +\def\reducednominalsize{9pt} +\setfont\reducedrm\rmshape{9}{1000}{OT1} +\setfont\reducedtt\ttshape{9}{1000}{OT1TT} +\setfont\reducedbf\bfshape{10}{900}{OT1} +\setfont\reducedit\itshape{9}{1000}{OT1IT} +\setfont\reducedsl\slshape{9}{1000}{OT1} +\setfont\reducedsf\sfshape{9}{1000}{OT1} +\setfont\reducedsc\scshape{10}{900}{OT1} +\setfont\reducedttsl\ttslshape{10}{900}{OT1TT} +\font\reducedi=cmmi9 +\font\reducedsy=cmsy9 +\def\reducedecsize{0900} + +% reduce space between paragraphs +\divide\parskip by 2 + +% reset the current fonts +\textfonts +\rm +} % end of 10pt text font size definitions + + +% We provide the user-level command +% @fonttextsize 10 +% (or 11) to redefine the text font size. pt is assumed. +% +\def\xword{10} +\def\xiword{11} +% +\parseargdef\fonttextsize{% + \def\textsizearg{#1}% + \wlog{doing @fonttextsize \textsizearg}% + % + % Set \globaldefs so that documents can use this inside @tex, since + % makeinfo 4.8 does not support it, but we need it nonetheless. + % + \begingroup \globaldefs=1 + \ifx\textsizearg\xword \definetextfontsizex + \else \ifx\textsizearg\xiword \definetextfontsizexi + \else + \errhelp=\EMsimple + \errmessage{@fonttextsize only supports `10' or `11', not `\textsizearg'} + \fi\fi + \endgroup +} + + +% In order for the font changes to affect most math symbols and letters, +% we have to define the \textfont of the standard families. Since +% texinfo doesn't allow for producing subscripts and superscripts except +% in the main text, we don't bother to reset \scriptfont and +% \scriptscriptfont (which would also require loading a lot more fonts). +% +\def\resetmathfonts{% + \textfont0=\tenrm \textfont1=\teni \textfont2=\tensy + \textfont\itfam=\tenit \textfont\slfam=\tensl \textfont\bffam=\tenbf + \textfont\ttfam=\tentt \textfont\sffam=\tensf +} + +% The font-changing commands redefine the meanings of \tenSTYLE, instead +% of just \STYLE. We do this because \STYLE needs to also set the +% current \fam for math mode. Our \STYLE (e.g., \rm) commands hardwire +% \tenSTYLE to set the current font. +% +% Each font-changing command also sets the names \lsize (one size lower) +% and \lllsize (three sizes lower). These relative commands are used in +% the LaTeX logo and acronyms. +% +% This all needs generalizing, badly. +% +\def\textfonts{% + \let\tenrm=\textrm \let\tenit=\textit \let\tensl=\textsl + \let\tenbf=\textbf \let\tentt=\texttt \let\smallcaps=\textsc + \let\tensf=\textsf \let\teni=\texti \let\tensy=\textsy + \let\tenttsl=\textttsl + \def\curfontsize{text}% + \def\lsize{reduced}\def\lllsize{smaller}% + \resetmathfonts \setleading{\textleading}} +\def\titlefonts{% + \let\tenrm=\titlerm \let\tenit=\titleit \let\tensl=\titlesl + \let\tenbf=\titlebf \let\tentt=\titlett \let\smallcaps=\titlesc + \let\tensf=\titlesf \let\teni=\titlei \let\tensy=\titlesy + \let\tenttsl=\titlettsl + \def\curfontsize{title}% + \def\lsize{chap}\def\lllsize{subsec}% + \resetmathfonts \setleading{25pt}} +\def\titlefont#1{{\titlefonts\rm #1}} +\def\chapfonts{% + \let\tenrm=\chaprm \let\tenit=\chapit \let\tensl=\chapsl + \let\tenbf=\chapbf \let\tentt=\chaptt \let\smallcaps=\chapsc + \let\tensf=\chapsf \let\teni=\chapi \let\tensy=\chapsy + \let\tenttsl=\chapttsl + \def\curfontsize{chap}% + \def\lsize{sec}\def\lllsize{text}% + \resetmathfonts \setleading{19pt}} +\def\secfonts{% + \let\tenrm=\secrm \let\tenit=\secit \let\tensl=\secsl + \let\tenbf=\secbf \let\tentt=\sectt \let\smallcaps=\secsc + \let\tensf=\secsf \let\teni=\seci \let\tensy=\secsy + \let\tenttsl=\secttsl + \def\curfontsize{sec}% + \def\lsize{subsec}\def\lllsize{reduced}% + \resetmathfonts \setleading{16pt}} +\def\subsecfonts{% + \let\tenrm=\ssecrm \let\tenit=\ssecit \let\tensl=\ssecsl + \let\tenbf=\ssecbf \let\tentt=\ssectt \let\smallcaps=\ssecsc + \let\tensf=\ssecsf \let\teni=\sseci \let\tensy=\ssecsy + \let\tenttsl=\ssecttsl + \def\curfontsize{ssec}% + \def\lsize{text}\def\lllsize{small}% + \resetmathfonts \setleading{15pt}} +\let\subsubsecfonts = \subsecfonts +\def\reducedfonts{% + \let\tenrm=\reducedrm \let\tenit=\reducedit \let\tensl=\reducedsl + \let\tenbf=\reducedbf \let\tentt=\reducedtt \let\reducedcaps=\reducedsc + \let\tensf=\reducedsf \let\teni=\reducedi \let\tensy=\reducedsy + \let\tenttsl=\reducedttsl + \def\curfontsize{reduced}% + \def\lsize{small}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallfonts{% + \let\tenrm=\smallrm \let\tenit=\smallit \let\tensl=\smallsl + \let\tenbf=\smallbf \let\tentt=\smalltt \let\smallcaps=\smallsc + \let\tensf=\smallsf \let\teni=\smalli \let\tensy=\smallsy + \let\tenttsl=\smallttsl + \def\curfontsize{small}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{10.5pt}} +\def\smallerfonts{% + \let\tenrm=\smallerrm \let\tenit=\smallerit \let\tensl=\smallersl + \let\tenbf=\smallerbf \let\tentt=\smallertt \let\smallcaps=\smallersc + \let\tensf=\smallersf \let\teni=\smalleri \let\tensy=\smallersy + \let\tenttsl=\smallerttsl + \def\curfontsize{smaller}% + \def\lsize{smaller}\def\lllsize{smaller}% + \resetmathfonts \setleading{9.5pt}} + +% Set the fonts to use with the @small... environments. +\let\smallexamplefonts = \smallfonts + +% About \smallexamplefonts. If we use \smallfonts (9pt), @smallexample +% can fit this many characters: +% 8.5x11=86 smallbook=72 a4=90 a5=69 +% If we use \scriptfonts (8pt), then we can fit this many characters: +% 8.5x11=90+ smallbook=80 a4=90+ a5=77 +% For me, subjectively, the few extra characters that fit aren't worth +% the additional smallness of 8pt. So I'm making the default 9pt. +% +% By the way, for comparison, here's what fits with @example (10pt): +% 8.5x11=71 smallbook=60 a4=75 a5=58 +% +% I wish the USA used A4 paper. +% --karl, 24jan03. + + +% Set up the default fonts, so we can use them for creating boxes. +% +\definetextfontsizexi + +% Define these so they can be easily changed for other fonts. +\def\angleleft{$\langle$} +\def\angleright{$\rangle$} + +% Count depth in font-changes, for error checks +\newcount\fontdepth \fontdepth=0 + +% Fonts for short table of contents. +\setfont\shortcontrm\rmshape{12}{1000}{OT1} +\setfont\shortcontbf\bfshape{10}{\magstep1}{OT1} % no cmb12 +\setfont\shortcontsl\slshape{12}{1000}{OT1} +\setfont\shortconttt\ttshape{12}{1000}{OT1TT} + +%% Add scribe-like font environments, plus @l for inline lisp (usually sans +%% serif) and @ii for TeX italic + +% \smartitalic{ARG} outputs arg in italics, followed by an italic correction +% unless the following character is such as not to need one. +\def\smartitalicx{\ifx\next,\else\ifx\next-\else\ifx\next.\else + \ptexslash\fi\fi\fi} +\def\smartslanted#1{{\ifusingtt\ttsl\sl #1}\futurelet\next\smartitalicx} +\def\smartitalic#1{{\ifusingtt\ttsl\it #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally uses \ttsl. +% @var is set to this for defun arguments. +\def\ttslanted#1{{\ttsl #1}\futurelet\next\smartitalicx} + +% like \smartslanted except unconditionally use \sl. We never want +% ttsl for book titles, do we? +\def\cite#1{{\sl #1}\futurelet\next\smartitalicx} + +\let\i=\smartitalic +\let\slanted=\smartslanted +\let\var=\smartslanted +\let\dfn=\smartslanted +\let\emph=\smartitalic + +% @b, explicit bold. +\def\b#1{{\bf #1}} +\let\strong=\b + +% @sansserif, explicit sans. +\def\sansserif#1{{\sf #1}} + +% We can't just use \exhyphenpenalty, because that only has effect at +% the end of a paragraph. Restore normal hyphenation at the end of the +% group within which \nohyphenation is presumably called. +% +\def\nohyphenation{\hyphenchar\font = -1 \aftergroup\restorehyphenation} +\def\restorehyphenation{\hyphenchar\font = `- } + +% Set sfcode to normal for the chars that usually have another value. +% Can't use plain's \frenchspacing because it uses the `\x notation, and +% sometimes \x has an active definition that messes things up. +% +\catcode`@=11 + \def\plainfrenchspacing{% + \sfcode\dotChar =\@m \sfcode\questChar=\@m \sfcode\exclamChar=\@m + \sfcode\colonChar=\@m \sfcode\semiChar =\@m \sfcode\commaChar =\@m + \def\endofsentencespacefactor{1000}% for @. and friends + } + \def\plainnonfrenchspacing{% + \sfcode`\.3000\sfcode`\?3000\sfcode`\!3000 + \sfcode`\:2000\sfcode`\;1500\sfcode`\,1250 + \def\endofsentencespacefactor{3000}% for @. and friends + } +\catcode`@=\other +\def\endofsentencespacefactor{3000}% default + +\def\t#1{% + {\tt \rawbackslash \plainfrenchspacing #1}% + \null +} +\def\samp#1{`\tclose{#1}'\null} +\setfont\keyrm\rmshape{8}{1000}{OT1} +\font\keysy=cmsy9 +\def\key#1{{\keyrm\textfont2=\keysy \leavevmode\hbox{% + \raise0.4pt\hbox{\angleleft}\kern-.08em\vtop{% + \vbox{\hrule\kern-0.4pt + \hbox{\raise0.4pt\hbox{\vphantom{\angleleft}}#1}}% + \kern-0.4pt\hrule}% + \kern-.06em\raise0.4pt\hbox{\angleright}}}} +\def\key #1{{\nohyphenation \uppercase{#1}}\null} +% The old definition, with no lozenge: +%\def\key #1{{\ttsl \nohyphenation \uppercase{#1}}\null} +\def\ctrl #1{{\tt \rawbackslash \hat}#1} + +% @file, @option are the same as @samp. +\let\file=\samp +\let\option=\samp + +% @code is a modification of @t, +% which makes spaces the same size as normal in the surrounding text. +\def\tclose#1{% + {% + % Change normal interword space to be same as for the current font. + \spaceskip = \fontdimen2\font + % + % Switch to typewriter. + \tt + % + % But `\ ' produces the large typewriter interword space. + \def\ {{\spaceskip = 0pt{} }}% + % + % Turn off hyphenation. + \nohyphenation + % + \rawbackslash + \plainfrenchspacing + #1% + }% + \null +} + +% We *must* turn on hyphenation at `-' and `_' in @code. +% Otherwise, it is too hard to avoid overfull hboxes +% in the Emacs manual, the Library manual, etc. + +% Unfortunately, TeX uses one parameter (\hyphenchar) to control +% both hyphenation at - and hyphenation within words. +% We must therefore turn them both off (\tclose does that) +% and arrange explicitly to hyphenate at a dash. +% -- rms. +{ + \catcode`\-=\active \catcode`\_=\active + \catcode`\'=\active \catcode`\`=\active + % + \global\def\code{\begingroup + \catcode\rquoteChar=\active \catcode\lquoteChar=\active + \let'\codequoteright \let`\codequoteleft + % + \catcode\dashChar=\active \catcode\underChar=\active + \ifallowcodebreaks + \let-\codedash + \let_\codeunder + \else + \let-\realdash + \let_\realunder + \fi + \codex + } +} + +\def\realdash{-} +\def\codedash{-\discretionary{}{}{}} +\def\codeunder{% + % this is all so @math{@code{var_name}+1} can work. In math mode, _ + % is "active" (mathcode"8000) and \normalunderscore (or \char95, etc.) + % will therefore expand the active definition of _, which is us + % (inside @code that is), therefore an endless loop. + \ifusingtt{\ifmmode + \mathchar"075F % class 0=ordinary, family 7=ttfam, pos 0x5F=_. + \else\normalunderscore \fi + \discretionary{}{}{}}% + {\_}% +} +\def\codex #1{\tclose{#1}\endgroup} + +% An additional complication: the above will allow breaks after, e.g., +% each of the four underscores in __typeof__. This is undesirable in +% some manuals, especially if they don't have long identifiers in +% general. @allowcodebreaks provides a way to control this. +% +\newif\ifallowcodebreaks \allowcodebreakstrue + +\def\keywordtrue{true} +\def\keywordfalse{false} + +\parseargdef\allowcodebreaks{% + \def\txiarg{#1}% + \ifx\txiarg\keywordtrue + \allowcodebreakstrue + \else\ifx\txiarg\keywordfalse + \allowcodebreaksfalse + \else + \errhelp = \EMsimple + \errmessage{Unknown @allowcodebreaks option `\txiarg'}% + \fi\fi +} + +% @kbd is like @code, except that if the argument is just one @key command, +% then @kbd has no effect. + +% @kbdinputstyle -- arg is `distinct' (@kbd uses slanted tty font always), +% `example' (@kbd uses ttsl only inside of @example and friends), +% or `code' (@kbd uses normal tty font always). +\parseargdef\kbdinputstyle{% + \def\txiarg{#1}% + \ifx\txiarg\worddistinct + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\ttsl}% + \else\ifx\txiarg\wordexample + \gdef\kbdexamplefont{\ttsl}\gdef\kbdfont{\tt}% + \else\ifx\txiarg\wordcode + \gdef\kbdexamplefont{\tt}\gdef\kbdfont{\tt}% + \else + \errhelp = \EMsimple + \errmessage{Unknown @kbdinputstyle option `\txiarg'}% + \fi\fi\fi +} +\def\worddistinct{distinct} +\def\wordexample{example} +\def\wordcode{code} + +% Default is `distinct.' +\kbdinputstyle distinct + +\def\xkey{\key} +\def\kbdfoo#1#2#3\par{\def\one{#1}\def\three{#3}\def\threex{??}% +\ifx\one\xkey\ifx\threex\three \key{#2}% +\else{\tclose{\kbdfont\look}}\fi +\else{\tclose{\kbdfont\look}}\fi} + +% For @indicateurl, @env, @command quotes seem unnecessary, so use \code. +\let\indicateurl=\code +\let\env=\code +\let\command=\code + +% @uref (abbreviation for `urlref') takes an optional (comma-separated) +% second argument specifying the text to display and an optional third +% arg as text to display instead of (rather than in addition to) the url +% itself. First (mandatory) arg is the url. Perhaps eventually put in +% a hypertex \special here. +% +\def\uref#1{\douref #1,,,\finish} +\def\douref#1,#2,#3,#4\finish{\begingroup + \unsepspaces + \pdfurl{#1}% + \setbox0 = \hbox{\ignorespaces #3}% + \ifdim\wd0 > 0pt + \unhbox0 % third arg given, show only that + \else + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0 > 0pt + \ifpdf + \unhbox0 % PDF: 2nd arg given, show only it + \else + \unhbox0\ (\code{#1})% DVI: 2nd arg given, show both it and url + \fi + \else + \code{#1}% only url given, so show it + \fi + \fi + \endlink +\endgroup} + +% @url synonym for @uref, since that's how everyone uses it. +% +\let\url=\uref + +% rms does not like angle brackets --karl, 17may97. +% So now @email is just like @uref, unless we are pdf. +% +%\def\email#1{\angleleft{\tt #1}\angleright} +\ifpdf + \def\email#1{\doemail#1,,\finish} + \def\doemail#1,#2,#3\finish{\begingroup + \unsepspaces + \pdfurl{mailto:#1}% + \setbox0 = \hbox{\ignorespaces #2}% + \ifdim\wd0>0pt\unhbox0\else\code{#1}\fi + \endlink + \endgroup} +\else + \let\email=\uref +\fi + +% Check if we are currently using a typewriter font. Since all the +% Computer Modern typewriter fonts have zero interword stretch (and +% shrink), and it is reasonable to expect all typewriter fonts to have +% this property, we can check that font parameter. +% +\def\ifmonospace{\ifdim\fontdimen3\font=0pt } + +% Typeset a dimension, e.g., `in' or `pt'. The only reason for the +% argument is to make the input look right: @dmn{pt} instead of @dmn{}pt. +% +\def\dmn#1{\thinspace #1} + +\def\kbd#1{\def\look{#1}\expandafter\kbdfoo\look??\par} + +% @l was never documented to mean ``switch to the Lisp font'', +% and it is not used as such in any manual I can find. We need it for +% Polish suppressed-l. --karl, 22sep96. +%\def\l#1{{\li #1}\null} + +% Explicit font changes: @r, @sc, undocumented @ii. +\def\r#1{{\rm #1}} % roman font +\def\sc#1{{\smallcaps#1}} % smallcaps font +\def\ii#1{{\it #1}} % italic font + +% @acronym for "FBI", "NATO", and the like. +% We print this one point size smaller, since it's intended for +% all-uppercase. +% +\def\acronym#1{\doacronym #1,,\finish} +\def\doacronym#1,#2,#3\finish{% + {\selectfonts\lsize #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @abbr for "Comput. J." and the like. +% No font change, but don't do end-of-sentence spacing. +% +\def\abbr#1{\doabbr #1,,\finish} +\def\doabbr#1,#2,#3\finish{% + {\plainfrenchspacing #1}% + \def\temp{#2}% + \ifx\temp\empty \else + \space ({\unsepspaces \ignorespaces \temp \unskip})% + \fi +} + +% @pounds{} is a sterling sign, which Knuth put in the CM italic font. +% +\def\pounds{{\it\$}} + +% @euro{} comes from a separate font, depending on the current style. +% We use the free feym* fonts from the eurosym package by Henrik +% Theiling, which support regular, slanted, bold and bold slanted (and +% "outlined" (blackboard board, sort of) versions, which we don't need). +% It is available from http://www.ctan.org/tex-archive/fonts/eurosym. +% +% Although only regular is the truly official Euro symbol, we ignore +% that. The Euro is designed to be slightly taller than the regular +% font height. +% +% feymr - regular +% feymo - slanted +% feybr - bold +% feybo - bold slanted +% +% There is no good (free) typewriter version, to my knowledge. +% A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. +% Hmm. +% +% Also doesn't work in math. Do we need to do math with euro symbols? +% Hope not. +% +% +\def\euro{{\eurofont e}} +\def\eurofont{% + % We set the font at each command, rather than predefining it in + % \textfonts and the other font-switching commands, so that + % installations which never need the symbol don't have to have the + % font installed. + % + % There is only one designed size (nominal 10pt), so we always scale + % that to the current nominal size. + % + % By the way, simply using "at 1em" works for cmr10 and the like, but + % does not work for cmbx10 and other extended/shrunken fonts. + % + \def\eurosize{\csname\curfontsize nominalsize\endcsname}% + % + \ifx\curfontstyle\bfstylename + % bold: + \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize + \else + % regular: + \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize + \fi + \thiseurofont +} + +% Hacks for glyphs from the EC fonts similar to \euro. We don't +% use \let for the aliases, because sometimes we redefine the original +% macro, and the alias should reflect the redefinition. +\def\guillemetleft{{\ecfont \char"13}} +\def\guillemotleft{\guillemetleft} +\def\guillemetright{{\ecfont \char"14}} +\def\guillemotright{\guillemetright} +\def\guilsinglleft{{\ecfont \char"0E}} +\def\guilsinglright{{\ecfont \char"0F}} +\def\quotedblbase{{\ecfont \char"12}} +\def\quotesinglbase{{\ecfont \char"0D}} +% +\def\ecfont{% + % We can't distinguish serif/sanserif and italic/slanted, but this + % is used for crude hacks anyway (like adding French and German + % quotes to documents typeset with CM, where we lose kerning), so + % hopefully nobody will notice/care. + \edef\ecsize{\csname\curfontsize ecsize\endcsname}% + \edef\nominalsize{\csname\curfontsize nominalsize\endcsname}% + \ifx\curfontstyle\bfstylename + % bold: + \font\thisecfont = ecb\ifusingit{i}{x}\ecsize \space at \nominalsize + \else + % regular: + \font\thisecfont = ec\ifusingit{ti}{rm}\ecsize \space at \nominalsize + \fi + \thisecfont +} + +% @registeredsymbol - R in a circle. The font for the R should really +% be smaller yet, but lllsize is the best we can do for now. +% Adapted from the plain.tex definition of \copyright. +% +\def\registeredsymbol{% + $^{{\ooalign{\hfil\raise.07ex\hbox{\selectfonts\lllsize R}% + \hfil\crcr\Orb}}% + }$% +} + +% @textdegree - the normal degrees sign. +% +\def\textdegree{$^\circ$} + +% Laurent Siebenmann reports \Orb undefined with: +% Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 +% so we'll define it if necessary. +% +\ifx\Orb\undefined +\def\Orb{\mathhexbox20D} +\fi + +% Quotes. +\chardef\quotedblleft="5C +\chardef\quotedblright=`\" +\chardef\quoteleft=`\` +\chardef\quoteright=`\' + +\message{page headings,} + +\newskip\titlepagetopglue \titlepagetopglue = 1.5in +\newskip\titlepagebottomglue \titlepagebottomglue = 2pc + +% First the title page. Must do @settitle before @titlepage. +\newif\ifseenauthor +\newif\iffinishedtitlepage + +% Do an implicit @contents or @shortcontents after @end titlepage if the +% user says @setcontentsaftertitlepage or @setshortcontentsaftertitlepage. +% +\newif\ifsetcontentsaftertitlepage + \let\setcontentsaftertitlepage = \setcontentsaftertitlepagetrue +\newif\ifsetshortcontentsaftertitlepage + \let\setshortcontentsaftertitlepage = \setshortcontentsaftertitlepagetrue + +\parseargdef\shorttitlepage{\begingroup\hbox{}\vskip 1.5in \chaprm \centerline{#1}% + \endgroup\page\hbox{}\page} + +\envdef\titlepage{% + % Open one extra group, as we want to close it in the middle of \Etitlepage. + \begingroup + \parindent=0pt \textfonts + % Leave some space at the very top of the page. + \vglue\titlepagetopglue + % No rule at page bottom unless we print one at the top with @title. + \finishedtitlepagetrue + % + % Most title ``pages'' are actually two pages long, with space + % at the top of the second. We don't want the ragged left on the second. + \let\oldpage = \page + \def\page{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + \let\page = \oldpage + \page + \null + }% +} + +\def\Etitlepage{% + \iffinishedtitlepage\else + \finishtitlepage + \fi + % It is important to do the page break before ending the group, + % because the headline and footline are only empty inside the group. + % If we use the new definition of \page, we always get a blank page + % after the title page, which we certainly don't want. + \oldpage + \endgroup + % + % Need this before the \...aftertitlepage checks so that if they are + % in effect the toc pages will come out with page numbers. + \HEADINGSon + % + % If they want short, they certainly want long too. + \ifsetshortcontentsaftertitlepage + \shortcontents + \contents + \global\let\shortcontents = \relax + \global\let\contents = \relax + \fi + % + \ifsetcontentsaftertitlepage + \contents + \global\let\contents = \relax + \global\let\shortcontents = \relax + \fi +} + +\def\finishtitlepage{% + \vskip4pt \hrule height 2pt width \hsize + \vskip\titlepagebottomglue + \finishedtitlepagetrue +} + +%%% Macros to be used within @titlepage: + +\let\subtitlerm=\tenrm +\def\subtitlefont{\subtitlerm \normalbaselineskip = 13pt \normalbaselines} + +\def\authorfont{\authorrm \normalbaselineskip = 16pt \normalbaselines + \let\tt=\authortt} + +\parseargdef\title{% + \checkenv\titlepage + \leftline{\titlefonts\rm #1} + % print a rule at the page bottom also. + \finishedtitlepagefalse + \vskip4pt \hrule height 4pt width \hsize \vskip4pt +} + +\parseargdef\subtitle{% + \checkenv\titlepage + {\subtitlefont \rightline{#1}}% +} + +% @author should come last, but may come many times. +% It can also be used inside @quotation. +% +\parseargdef\author{% + \def\temp{\quotation}% + \ifx\thisenv\temp + \def\quotationauthor{#1}% printed in \Equotation. + \else + \checkenv\titlepage + \ifseenauthor\else \vskip 0pt plus 1filll \seenauthortrue \fi + {\authorfont \leftline{#1}}% + \fi +} + + +%%% Set up page headings and footings. + +\let\thispage=\folio + +\newtoks\evenheadline % headline on even pages +\newtoks\oddheadline % headline on odd pages +\newtoks\evenfootline % footline on even pages +\newtoks\oddfootline % footline on odd pages + +% Now make TeX use those variables +\headline={{\textfonts\rm \ifodd\pageno \the\oddheadline + \else \the\evenheadline \fi}} +\footline={{\textfonts\rm \ifodd\pageno \the\oddfootline + \else \the\evenfootline \fi}\HEADINGShook} +\let\HEADINGShook=\relax + +% Commands to set those variables. +% For example, this is what @headings on does +% @evenheading @thistitle|@thispage|@thischapter +% @oddheading @thischapter|@thispage|@thistitle +% @evenfooting @thisfile|| +% @oddfooting ||@thisfile + + +\def\evenheading{\parsearg\evenheadingxxx} +\def\evenheadingxxx #1{\evenheadingyyy #1\|\|\|\|\finish} +\def\evenheadingyyy #1\|#2\|#3\|#4\finish{% +\global\evenheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddheading{\parsearg\oddheadingxxx} +\def\oddheadingxxx #1{\oddheadingyyy #1\|\|\|\|\finish} +\def\oddheadingyyy #1\|#2\|#3\|#4\finish{% +\global\oddheadline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\parseargdef\everyheading{\oddheadingxxx{#1}\evenheadingxxx{#1}}% + +\def\evenfooting{\parsearg\evenfootingxxx} +\def\evenfootingxxx #1{\evenfootingyyy #1\|\|\|\|\finish} +\def\evenfootingyyy #1\|#2\|#3\|#4\finish{% +\global\evenfootline={\rlap{\centerline{#2}}\line{#1\hfil#3}}} + +\def\oddfooting{\parsearg\oddfootingxxx} +\def\oddfootingxxx #1{\oddfootingyyy #1\|\|\|\|\finish} +\def\oddfootingyyy #1\|#2\|#3\|#4\finish{% + \global\oddfootline = {\rlap{\centerline{#2}}\line{#1\hfil#3}}% + % + % Leave some space for the footline. Hopefully ok to assume + % @evenfooting will not be used by itself. + \global\advance\pageheight by -12pt + \global\advance\vsize by -12pt +} + +\parseargdef\everyfooting{\oddfootingxxx{#1}\evenfootingxxx{#1}} + +% @evenheadingmarks top \thischapter <- chapter at the top of a page +% @evenheadingmarks bottom \thischapter <- chapter at the bottom of a page +% +% The same set of arguments for: +% +% @oddheadingmarks +% @evenfootingmarks +% @oddfootingmarks +% @everyheadingmarks +% @everyfootingmarks + +\def\evenheadingmarks{\headingmarks{even}{heading}} +\def\oddheadingmarks{\headingmarks{odd}{heading}} +\def\evenfootingmarks{\headingmarks{even}{footing}} +\def\oddfootingmarks{\headingmarks{odd}{footing}} +\def\everyheadingmarks#1 {\headingmarks{even}{heading}{#1} + \headingmarks{odd}{heading}{#1} } +\def\everyfootingmarks#1 {\headingmarks{even}{footing}{#1} + \headingmarks{odd}{footing}{#1} } +% #1 = even/odd, #2 = heading/footing, #3 = top/bottom. +\def\headingmarks#1#2#3 {% + \expandafter\let\expandafter\temp \csname get#3headingmarks\endcsname + \global\expandafter\let\csname get#1#2marks\endcsname \temp +} + +\everyheadingmarks bottom +\everyfootingmarks bottom + +% @headings double turns headings on for double-sided printing. +% @headings single turns headings on for single-sided printing. +% @headings off turns them off. +% @headings on same as @headings double, retained for compatibility. +% @headings after turns on double-sided headings after this page. +% @headings doubleafter turns on double-sided headings after this page. +% @headings singleafter turns on single-sided headings after this page. +% By default, they are off at the start of a document, +% and turned `on' after @end titlepage. + +\def\headings #1 {\csname HEADINGS#1\endcsname} + +\def\HEADINGSoff{% +\global\evenheadline={\hfil} \global\evenfootline={\hfil} +\global\oddheadline={\hfil} \global\oddfootline={\hfil}} +\HEADINGSoff +% When we turn headings on, set the page number to 1. +% For double-sided printing, put current file name in lower left corner, +% chapter name on inside top of right hand pages, document +% title on inside top of left hand pages, and page numbers on outside top +% edge of all pages. +\def\HEADINGSdouble{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} +\let\contentsalignmacro = \chappager + +% For single-sided printing, chapter title goes across top left of page, +% page number on top right. +\def\HEADINGSsingle{% +\global\pageno=1 +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} +\def\HEADINGSon{\HEADINGSdouble} + +\def\HEADINGSafter{\let\HEADINGShook=\HEADINGSdoublex} +\let\HEADINGSdoubleafter=\HEADINGSafter +\def\HEADINGSdoublex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\folio\hfil\thistitle}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chapoddpage +} + +\def\HEADINGSsingleafter{\let\HEADINGShook=\HEADINGSsinglex} +\def\HEADINGSsinglex{% +\global\evenfootline={\hfil} +\global\oddfootline={\hfil} +\global\evenheadline={\line{\thischapter\hfil\folio}} +\global\oddheadline={\line{\thischapter\hfil\folio}} +\global\let\contentsalignmacro = \chappager +} + +% Subroutines used in generating headings +% This produces Day Month Year style of output. +% Only define if not already defined, in case a txi-??.tex file has set +% up a different format (e.g., txi-cs.tex does this). +\ifx\today\undefined +\def\today{% + \number\day\space + \ifcase\month + \or\putwordMJan\or\putwordMFeb\or\putwordMMar\or\putwordMApr + \or\putwordMMay\or\putwordMJun\or\putwordMJul\or\putwordMAug + \or\putwordMSep\or\putwordMOct\or\putwordMNov\or\putwordMDec + \fi + \space\number\year} +\fi + +% @settitle line... specifies the title of the document, for headings. +% It generates no output of its own. +\def\thistitle{\putwordNoTitle} +\def\settitle{\parsearg{\gdef\thistitle}} + + +\message{tables,} +% Tables -- @table, @ftable, @vtable, @item(x). + +% default indentation of table text +\newdimen\tableindent \tableindent=.8in +% default indentation of @itemize and @enumerate text +\newdimen\itemindent \itemindent=.3in +% margin between end of table item and start of table text. +\newdimen\itemmargin \itemmargin=.1in + +% used internally for \itemindent minus \itemmargin +\newdimen\itemmax + +% Note @table, @ftable, and @vtable define @item, @itemx, etc., with +% these defs. +% They also define \itemindex +% to index the item name in whatever manner is desired (perhaps none). + +\newif\ifitemxneedsnegativevskip + +\def\itemxpar{\par\ifitemxneedsnegativevskip\nobreak\vskip-\parskip\nobreak\fi} + +\def\internalBitem{\smallbreak \parsearg\itemzzz} +\def\internalBitemx{\itemxpar \parsearg\itemzzz} + +\def\itemzzz #1{\begingroup % + \advance\hsize by -\rightskip + \advance\hsize by -\tableindent + \setbox0=\hbox{\itemindicate{#1}}% + \itemindex{#1}% + \nobreak % This prevents a break before @itemx. + % + % If the item text does not fit in the space we have, put it on a line + % by itself, and do not allow a page break either before or after that + % line. We do not start a paragraph here because then if the next + % command is, e.g., @kindex, the whatsit would get put into the + % horizontal list on a line by itself, resulting in extra blank space. + \ifdim \wd0>\itemmax + % + % Make this a paragraph so we get the \parskip glue and wrapping, + % but leave it ragged-right. + \begingroup + \advance\leftskip by-\tableindent + \advance\hsize by\tableindent + \advance\rightskip by0pt plus1fil + \leavevmode\unhbox0\par + \endgroup + % + % We're going to be starting a paragraph, but we don't want the + % \parskip glue -- logically it's part of the @item we just started. + \nobreak \vskip-\parskip + % + % Stop a page break at the \parskip glue coming up. However, if + % what follows is an environment such as @example, there will be no + % \parskip glue; then the negative vskip we just inserted would + % cause the example and the item to crash together. So we use this + % bizarre value of 10001 as a signal to \aboveenvbreak to insert + % \parskip glue after all. Section titles are handled this way also. + % + \penalty 10001 + \endgroup + \itemxneedsnegativevskipfalse + \else + % The item text fits into the space. Start a paragraph, so that the + % following text (if any) will end up on the same line. + \noindent + % Do this with kerns and \unhbox so that if there is a footnote in + % the item text, it can migrate to the main vertical list and + % eventually be printed. + \nobreak\kern-\tableindent + \dimen0 = \itemmax \advance\dimen0 by \itemmargin \advance\dimen0 by -\wd0 + \unhbox0 + \nobreak\kern\dimen0 + \endgroup + \itemxneedsnegativevskiptrue + \fi +} + +\def\item{\errmessage{@item while not in a list environment}} +\def\itemx{\errmessage{@itemx while not in a list environment}} + +% @table, @ftable, @vtable. +\envdef\table{% + \let\itemindex\gobble + \tablecheck{table}% +} +\envdef\ftable{% + \def\itemindex ##1{\doind {fn}{\code{##1}}}% + \tablecheck{ftable}% +} +\envdef\vtable{% + \def\itemindex ##1{\doind {vr}{\code{##1}}}% + \tablecheck{vtable}% +} +\def\tablecheck#1{% + \ifnum \the\catcode`\^^M=\active + \endgroup + \errmessage{This command won't work in this context; perhaps the problem is + that we are \inenvironment\thisenv}% + \def\next{\doignore{#1}}% + \else + \let\next\tablex + \fi + \next +} +\def\tablex#1{% + \def\itemindicate{#1}% + \parsearg\tabley +} +\def\tabley#1{% + {% + \makevalueexpandable + \edef\temp{\noexpand\tablez #1\space\space\space}% + \expandafter + }\temp \endtablez +} +\def\tablez #1 #2 #3 #4\endtablez{% + \aboveenvbreak + \ifnum 0#1>0 \advance \leftskip by #1\mil \fi + \ifnum 0#2>0 \tableindent=#2\mil \fi + \ifnum 0#3>0 \advance \rightskip by #3\mil \fi + \itemmax=\tableindent + \advance \itemmax by -\itemmargin + \advance \leftskip by \tableindent + \exdentamount=\tableindent + \parindent = 0pt + \parskip = \smallskipamount + \ifdim \parskip=0pt \parskip=2pt \fi + \let\item = \internalBitem + \let\itemx = \internalBitemx +} +\def\Etable{\endgraf\afterenvbreak} +\let\Eftable\Etable +\let\Evtable\Etable +\let\Eitemize\Etable +\let\Eenumerate\Etable + +% This is the counter used by @enumerate, which is really @itemize + +\newcount \itemno + +\envdef\itemize{\parsearg\doitemize} + +\def\doitemize#1{% + \aboveenvbreak + \itemmax=\itemindent + \advance\itemmax by -\itemmargin + \advance\leftskip by \itemindent + \exdentamount=\itemindent + \parindent=0pt + \parskip=\smallskipamount + \ifdim\parskip=0pt \parskip=2pt \fi + \def\itemcontents{#1}% + % @itemize with no arg is equivalent to @itemize @bullet. + \ifx\itemcontents\empty\def\itemcontents{\bullet}\fi + \let\item=\itemizeitem +} + +% Definition of @item while inside @itemize and @enumerate. +% +\def\itemizeitem{% + \advance\itemno by 1 % for enumerations + {\let\par=\endgraf \smallbreak}% reasonable place to break + {% + % If the document has an @itemize directly after a section title, a + % \nobreak will be last on the list, and \sectionheading will have + % done a \vskip-\parskip. In that case, we don't want to zero + % parskip, or the item text will crash with the heading. On the + % other hand, when there is normal text preceding the item (as there + % usually is), we do want to zero parskip, or there would be too much + % space. In that case, we won't have a \nobreak before. At least + % that's the theory. + \ifnum\lastpenalty<10000 \parskip=0in \fi + \noindent + \hbox to 0pt{\hss \itemcontents \kern\itemmargin}% + \vadjust{\penalty 1200}}% not good to break after first line of item. + \flushcr +} + +% \splitoff TOKENS\endmark defines \first to be the first token in +% TOKENS, and \rest to be the remainder. +% +\def\splitoff#1#2\endmark{\def\first{#1}\def\rest{#2}}% + +% Allow an optional argument of an uppercase letter, lowercase letter, +% or number, to specify the first label in the enumerated list. No +% argument is the same as `1'. +% +\envparseargdef\enumerate{\enumeratey #1 \endenumeratey} +\def\enumeratey #1 #2\endenumeratey{% + % If we were given no argument, pretend we were given `1'. + \def\thearg{#1}% + \ifx\thearg\empty \def\thearg{1}\fi + % + % Detect if the argument is a single token. If so, it might be a + % letter. Otherwise, the only valid thing it can be is a number. + % (We will always have one token, because of the test we just made. + % This is a good thing, since \splitoff doesn't work given nothing at + % all -- the first parameter is undelimited.) + \expandafter\splitoff\thearg\endmark + \ifx\rest\empty + % Only one token in the argument. It could still be anything. + % A ``lowercase letter'' is one whose \lccode is nonzero. + % An ``uppercase letter'' is one whose \lccode is both nonzero, and + % not equal to itself. + % Otherwise, we assume it's a number. + % + % We need the \relax at the end of the \ifnum lines to stop TeX from + % continuing to look for a . + % + \ifnum\lccode\expandafter`\thearg=0\relax + \numericenumerate % a number (we hope) + \else + % It's a letter. + \ifnum\lccode\expandafter`\thearg=\expandafter`\thearg\relax + \lowercaseenumerate % lowercase letter + \else + \uppercaseenumerate % uppercase letter + \fi + \fi + \else + % Multiple tokens in the argument. We hope it's a number. + \numericenumerate + \fi +} + +% An @enumerate whose labels are integers. The starting integer is +% given in \thearg. +% +\def\numericenumerate{% + \itemno = \thearg + \startenumeration{\the\itemno}% +} + +% The starting (lowercase) letter is in \thearg. +\def\lowercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more lowercase letters in @enumerate; get a bigger + alphabet}% + \fi + \char\lccode\itemno + }% +} + +% The starting (uppercase) letter is in \thearg. +\def\uppercaseenumerate{% + \itemno = \expandafter`\thearg + \startenumeration{% + % Be sure we're not beyond the end of the alphabet. + \ifnum\itemno=0 + \errmessage{No more uppercase letters in @enumerate; get a bigger + alphabet} + \fi + \char\uccode\itemno + }% +} + +% Call \doitemize, adding a period to the first argument and supplying the +% common last two arguments. Also subtract one from the initial value in +% \itemno, since @item increments \itemno. +% +\def\startenumeration#1{% + \advance\itemno by -1 + \doitemize{#1.}\flushcr +} + +% @alphaenumerate and @capsenumerate are abbreviations for giving an arg +% to @enumerate. +% +\def\alphaenumerate{\enumerate{a}} +\def\capsenumerate{\enumerate{A}} +\def\Ealphaenumerate{\Eenumerate} +\def\Ecapsenumerate{\Eenumerate} + + +% @multitable macros +% Amy Hendrickson, 8/18/94, 3/6/96 +% +% @multitable ... @end multitable will make as many columns as desired. +% Contents of each column will wrap at width given in preamble. Width +% can be specified either with sample text given in a template line, +% or in percent of \hsize, the current width of text on page. + +% Table can continue over pages but will only break between lines. + +% To make preamble: +% +% Either define widths of columns in terms of percent of \hsize: +% @multitable @columnfractions .25 .3 .45 +% @item ... +% +% Numbers following @columnfractions are the percent of the total +% current hsize to be used for each column. You may use as many +% columns as desired. + + +% Or use a template: +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item ... +% using the widest term desired in each column. + +% Each new table line starts with @item, each subsequent new column +% starts with @tab. Empty columns may be produced by supplying @tab's +% with nothing between them for as many times as empty columns are needed, +% ie, @tab@tab@tab will produce two empty columns. + +% @item, @tab do not need to be on their own lines, but it will not hurt +% if they are. + +% Sample multitable: + +% @multitable {Column 1 template} {Column 2 template} {Column 3 template} +% @item first col stuff @tab second col stuff @tab third col +% @item +% first col stuff +% @tab +% second col stuff +% @tab +% third col +% @item first col stuff @tab second col stuff +% @tab Many paragraphs of text may be used in any column. +% +% They will wrap at the width determined by the template. +% @item@tab@tab This will be in third column. +% @end multitable + +% Default dimensions may be reset by user. +% @multitableparskip is vertical space between paragraphs in table. +% @multitableparindent is paragraph indent in table. +% @multitablecolmargin is horizontal space to be left between columns. +% @multitablelinespace is space to leave between table items, baseline +% to baseline. +% 0pt means it depends on current normal line spacing. +% +\newskip\multitableparskip +\newskip\multitableparindent +\newdimen\multitablecolspace +\newskip\multitablelinespace +\multitableparskip=0pt +\multitableparindent=6pt +\multitablecolspace=12pt +\multitablelinespace=0pt + +% Macros used to set up halign preamble: +% +\let\endsetuptable\relax +\def\xendsetuptable{\endsetuptable} +\let\columnfractions\relax +\def\xcolumnfractions{\columnfractions} +\newif\ifsetpercent + +% #1 is the @columnfraction, usually a decimal number like .5, but might +% be just 1. We just use it, whatever it is. +% +\def\pickupwholefraction#1 {% + \global\advance\colcount by 1 + \expandafter\xdef\csname col\the\colcount\endcsname{#1\hsize}% + \setuptable +} + +\newcount\colcount +\def\setuptable#1{% + \def\firstarg{#1}% + \ifx\firstarg\xendsetuptable + \let\go = \relax + \else + \ifx\firstarg\xcolumnfractions + \global\setpercenttrue + \else + \ifsetpercent + \let\go\pickupwholefraction + \else + \global\advance\colcount by 1 + \setbox0=\hbox{#1\unskip\space}% Add a normal word space as a + % separator; typically that is always in the input, anyway. + \expandafter\xdef\csname col\the\colcount\endcsname{\the\wd0}% + \fi + \fi + \ifx\go\pickupwholefraction + % Put the argument back for the \pickupwholefraction call, so + % we'll always have a period there to be parsed. + \def\go{\pickupwholefraction#1}% + \else + \let\go = \setuptable + \fi% + \fi + \go +} + +% multitable-only commands. +% +% @headitem starts a heading row, which we typeset in bold. +% Assignments have to be global since we are inside the implicit group +% of an alignment entry. Note that \everycr resets \everytab. +\def\headitem{\checkenv\multitable \crcr \global\everytab={\bf}\the\everytab}% +% +% A \tab used to include \hskip1sp. But then the space in a template +% line is not enough. That is bad. So let's go back to just `&' until +% we encounter the problem it was intended to solve again. +% --karl, nathan@acm.org, 20apr99. +\def\tab{\checkenv\multitable &\the\everytab}% + +% @multitable ... @end multitable definitions: +% +\newtoks\everytab % insert after every tab. +% +\envdef\multitable{% + \vskip\parskip + \startsavinginserts + % + % @item within a multitable starts a normal row. + % We use \def instead of \let so that if one of the multitable entries + % contains an @itemize, we don't choke on the \item (seen as \crcr aka + % \endtemplate) expanding \doitemize. + \def\item{\crcr}% + % + \tolerance=9500 + \hbadness=9500 + \setmultitablespacing + \parskip=\multitableparskip + \parindent=\multitableparindent + \overfullrule=0pt + \global\colcount=0 + % + \everycr = {% + \noalign{% + \global\everytab={}% + \global\colcount=0 % Reset the column counter. + % Check for saved footnotes, etc. + \checkinserts + % Keeps underfull box messages off when table breaks over pages. + %\filbreak + % Maybe so, but it also creates really weird page breaks when the + % table breaks over pages. Wouldn't \vfil be better? Wait until the + % problem manifests itself, so it can be fixed for real --karl. + }% + }% + % + \parsearg\domultitable +} +\def\domultitable#1{% + % To parse everything between @multitable and @item: + \setuptable#1 \endsetuptable + % + % This preamble sets up a generic column definition, which will + % be used as many times as user calls for columns. + % \vtop will set a single line and will also let text wrap and + % continue for many paragraphs if desired. + \halign\bgroup &% + \global\advance\colcount by 1 + \multistrut + \vtop{% + % Use the current \colcount to find the correct column width: + \hsize=\expandafter\csname col\the\colcount\endcsname + % + % In order to keep entries from bumping into each other + % we will add a \leftskip of \multitablecolspace to all columns after + % the first one. + % + % If a template has been used, we will add \multitablecolspace + % to the width of each template entry. + % + % If the user has set preamble in terms of percent of \hsize we will + % use that dimension as the width of the column, and the \leftskip + % will keep entries from bumping into each other. Table will start at + % left margin and final column will justify at right margin. + % + % Make sure we don't inherit \rightskip from the outer environment. + \rightskip=0pt + \ifnum\colcount=1 + % The first column will be indented with the surrounding text. + \advance\hsize by\leftskip + \else + \ifsetpercent \else + % If user has not set preamble in terms of percent of \hsize + % we will advance \hsize by \multitablecolspace. + \advance\hsize by \multitablecolspace + \fi + % In either case we will make \leftskip=\multitablecolspace: + \leftskip=\multitablecolspace + \fi + % Ignoring space at the beginning and end avoids an occasional spurious + % blank line, when TeX decides to break the line at the space before the + % box from the multistrut, so the strut ends up on a line by itself. + % For example: + % @multitable @columnfractions .11 .89 + % @item @code{#} + % @tab Legal holiday which is valid in major parts of the whole country. + % Is automatically provided with highlighting sequences respectively + % marking characters. + \noindent\ignorespaces##\unskip\multistrut + }\cr +} +\def\Emultitable{% + \crcr + \egroup % end the \halign + \global\setpercentfalse +} + +\def\setmultitablespacing{% + \def\multistrut{\strut}% just use the standard line spacing + % + % Compute \multitablelinespace (if not defined by user) for use in + % \multitableparskip calculation. We used define \multistrut based on + % this, but (ironically) that caused the spacing to be off. + % See bug-texinfo report from Werner Lemberg, 31 Oct 2004 12:52:20 +0100. +\ifdim\multitablelinespace=0pt +\setbox0=\vbox{X}\global\multitablelinespace=\the\baselineskip +\global\advance\multitablelinespace by-\ht0 +\fi +%% Test to see if parskip is larger than space between lines of +%% table. If not, do nothing. +%% If so, set to same dimension as multitablelinespace. +\ifdim\multitableparskip>\multitablelinespace +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi% +\ifdim\multitableparskip=0pt +\global\multitableparskip=\multitablelinespace +\global\advance\multitableparskip-7pt %% to keep parskip somewhat smaller + %% than skip between lines in the table. +\fi} + + +\message{conditionals,} + +% @iftex, @ifnotdocbook, @ifnothtml, @ifnotinfo, @ifnotplaintext, +% @ifnotxml always succeed. They currently do nothing; we don't +% attempt to check whether the conditionals are properly nested. But we +% have to remember that they are conditionals, so that @end doesn't +% attempt to close an environment group. +% +\def\makecond#1{% + \expandafter\let\csname #1\endcsname = \relax + \expandafter\let\csname iscond.#1\endcsname = 1 +} +\makecond{iftex} +\makecond{ifnotdocbook} +\makecond{ifnothtml} +\makecond{ifnotinfo} +\makecond{ifnotplaintext} +\makecond{ifnotxml} + +% Ignore @ignore, @ifhtml, @ifinfo, and the like. +% +\def\direntry{\doignore{direntry}} +\def\documentdescription{\doignore{documentdescription}} +\def\docbook{\doignore{docbook}} +\def\html{\doignore{html}} +\def\ifdocbook{\doignore{ifdocbook}} +\def\ifhtml{\doignore{ifhtml}} +\def\ifinfo{\doignore{ifinfo}} +\def\ifnottex{\doignore{ifnottex}} +\def\ifplaintext{\doignore{ifplaintext}} +\def\ifxml{\doignore{ifxml}} +\def\ignore{\doignore{ignore}} +\def\menu{\doignore{menu}} +\def\xml{\doignore{xml}} + +% Ignore text until a line `@end #1', keeping track of nested conditionals. +% +% A count to remember the depth of nesting. +\newcount\doignorecount + +\def\doignore#1{\begingroup + % Scan in ``verbatim'' mode: + \obeylines + \catcode`\@ = \other + \catcode`\{ = \other + \catcode`\} = \other + % + % Make sure that spaces turn into tokens that match what \doignoretext wants. + \spaceisspace + % + % Count number of #1's that we've seen. + \doignorecount = 0 + % + % Swallow text until we reach the matching `@end #1'. + \dodoignore{#1}% +} + +{ \catcode`_=11 % We want to use \_STOP_ which cannot appear in texinfo source. + \obeylines % + % + \gdef\dodoignore#1{% + % #1 contains the command name as a string, e.g., `ifinfo'. + % + % Define a command to find the next `@end #1'. + \long\def\doignoretext##1^^M@end #1{% + \doignoretextyyy##1^^M@#1\_STOP_}% + % + % And this command to find another #1 command, at the beginning of a + % line. (Otherwise, we would consider a line `@c @ifset', for + % example, to count as an @ifset for nesting.) + \long\def\doignoretextyyy##1^^M@#1##2\_STOP_{\doignoreyyy{##2}\_STOP_}% + % + % And now expand that command. + \doignoretext ^^M% + }% +} + +\def\doignoreyyy#1{% + \def\temp{#1}% + \ifx\temp\empty % Nothing found. + \let\next\doignoretextzzz + \else % Found a nested condition, ... + \advance\doignorecount by 1 + \let\next\doignoretextyyy % ..., look for another. + % If we're here, #1 ends with ^^M\ifinfo (for example). + \fi + \next #1% the token \_STOP_ is present just after this macro. +} + +% We have to swallow the remaining "\_STOP_". +% +\def\doignoretextzzz#1{% + \ifnum\doignorecount = 0 % We have just found the outermost @end. + \let\next\enddoignore + \else % Still inside a nested condition. + \advance\doignorecount by -1 + \let\next\doignoretext % Look for the next @end. + \fi + \next +} + +% Finish off ignored text. +{ \obeylines% + % Ignore anything after the last `@end #1'; this matters in verbatim + % environments, where otherwise the newline after an ignored conditional + % would result in a blank line in the output. + \gdef\enddoignore#1^^M{\endgroup\ignorespaces}% +} + + +% @set VAR sets the variable VAR to an empty value. +% @set VAR REST-OF-LINE sets VAR to the value REST-OF-LINE. +% +% Since we want to separate VAR from REST-OF-LINE (which might be +% empty), we can't just use \parsearg; we have to insert a space of our +% own to delimit the rest of the line, and then take it out again if we +% didn't need it. +% We rely on the fact that \parsearg sets \catcode`\ =10. +% +\parseargdef\set{\setyyy#1 \endsetyyy} +\def\setyyy#1 #2\endsetyyy{% + {% + \makevalueexpandable + \def\temp{#2}% + \edef\next{\gdef\makecsname{SET#1}}% + \ifx\temp\empty + \next{}% + \else + \setzzz#2\endsetzzz + \fi + }% +} +% Remove the trailing space \setxxx inserted. +\def\setzzz#1 \endsetzzz{\next{#1}} + +% @clear VAR clears (i.e., unsets) the variable VAR. +% +\parseargdef\clear{% + {% + \makevalueexpandable + \global\expandafter\let\csname SET#1\endcsname=\relax + }% +} + +% @value{foo} gets the text saved in variable foo. +\def\value{\begingroup\makevalueexpandable\valuexxx} +\def\valuexxx#1{\expandablevalue{#1}\endgroup} +{ + \catcode`\- = \active \catcode`\_ = \active + % + \gdef\makevalueexpandable{% + \let\value = \expandablevalue + % We don't want these characters active, ... + \catcode`\-=\other \catcode`\_=\other + % ..., but we might end up with active ones in the argument if + % we're called from @code, as @code{@value{foo-bar_}}, though. + % So \let them to their normal equivalents. + \let-\realdash \let_\normalunderscore + } +} + +% We have this subroutine so that we can handle at least some @value's +% properly in indexes (we call \makevalueexpandable in \indexdummies). +% The command has to be fully expandable (if the variable is set), since +% the result winds up in the index file. This means that if the +% variable's value contains other Texinfo commands, it's almost certain +% it will fail (although perhaps we could fix that with sufficient work +% to do a one-level expansion on the result, instead of complete). +% +\def\expandablevalue#1{% + \expandafter\ifx\csname SET#1\endcsname\relax + {[No value for ``#1'']}% + \message{Variable `#1', used in @value, is not set.}% + \else + \csname SET#1\endcsname + \fi +} + +% @ifset VAR ... @end ifset reads the `...' iff VAR has been defined +% with @set. +% +% To get special treatment of `@end ifset,' call \makeond and the redefine. +% +\makecond{ifset} +\def\ifset{\parsearg{\doifset{\let\next=\ifsetfail}}} +\def\doifset#1#2{% + {% + \makevalueexpandable + \let\next=\empty + \expandafter\ifx\csname SET#2\endcsname\relax + #1% If not set, redefine \next. + \fi + \expandafter + }\next +} +\def\ifsetfail{\doignore{ifset}} + +% @ifclear VAR ... @end ifclear reads the `...' iff VAR has never been +% defined with @set, or has been undefined with @clear. +% +% The `\else' inside the `\doifset' parameter is a trick to reuse the +% above code: if the variable is not set, do nothing, if it is set, +% then redefine \next to \ifclearfail. +% +\makecond{ifclear} +\def\ifclear{\parsearg{\doifset{\else \let\next=\ifclearfail}}} +\def\ifclearfail{\doignore{ifclear}} + +% @dircategory CATEGORY -- specify a category of the dir file +% which this file should belong to. Ignore this in TeX. +\let\dircategory=\comment + +% @defininfoenclose. +\let\definfoenclose=\comment + + +\message{indexing,} +% Index generation facilities + +% Define \newwrite to be identical to plain tex's \newwrite +% except not \outer, so it can be used within macros and \if's. +\edef\newwrite{\makecsname{ptexnewwrite}} + +% \newindex {foo} defines an index named foo. +% It automatically defines \fooindex such that +% \fooindex ...rest of line... puts an entry in the index foo. +% It also defines \fooindfile to be the number of the output channel for +% the file that accumulates this index. The file's extension is foo. +% The name of an index should be no more than 2 characters long +% for the sake of vms. +% +\def\newindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 % Open the file + \fi + \expandafter\xdef\csname#1index\endcsname{% % Define @#1index + \noexpand\doindex{#1}} +} + +% @defindex foo == \newindex{foo} +% +\def\defindex{\parsearg\newindex} + +% Define @defcodeindex, like @defindex except put all entries in @code. +% +\def\defcodeindex{\parsearg\newcodeindex} +% +\def\newcodeindex#1{% + \iflinks + \expandafter\newwrite \csname#1indfile\endcsname + \openout \csname#1indfile\endcsname \jobname.#1 + \fi + \expandafter\xdef\csname#1index\endcsname{% + \noexpand\docodeindex{#1}}% +} + + +% @synindex foo bar makes index foo feed into index bar. +% Do this instead of @defindex foo if you don't want it as a separate index. +% +% @syncodeindex foo bar similar, but put all entries made for index foo +% inside @code. +% +\def\synindex#1 #2 {\dosynindex\doindex{#1}{#2}} +\def\syncodeindex#1 #2 {\dosynindex\docodeindex{#1}{#2}} + +% #1 is \doindex or \docodeindex, #2 the index getting redefined (foo), +% #3 the target index (bar). +\def\dosynindex#1#2#3{% + % Only do \closeout if we haven't already done it, else we'll end up + % closing the target index. + \expandafter \ifx\csname donesynindex#2\endcsname \undefined + % The \closeout helps reduce unnecessary open files; the limit on the + % Acorn RISC OS is a mere 16 files. + \expandafter\closeout\csname#2indfile\endcsname + \expandafter\let\csname\donesynindex#2\endcsname = 1 + \fi + % redefine \fooindfile: + \expandafter\let\expandafter\temp\expandafter=\csname#3indfile\endcsname + \expandafter\let\csname#2indfile\endcsname=\temp + % redefine \fooindex: + \expandafter\xdef\csname#2index\endcsname{\noexpand#1{#3}}% +} + +% Define \doindex, the driver for all \fooindex macros. +% Argument #1 is generated by the calling \fooindex macro, +% and it is "foo", the name of the index. + +% \doindex just uses \parsearg; it calls \doind for the actual work. +% This is because \doind is more useful to call from other macros. + +% There is also \dosubind {index}{topic}{subtopic} +% which makes an entry in a two-level index such as the operation index. + +\def\doindex#1{\edef\indexname{#1}\parsearg\singleindexer} +\def\singleindexer #1{\doind{\indexname}{#1}} + +% like the previous two, but they put @code around the argument. +\def\docodeindex#1{\edef\indexname{#1}\parsearg\singlecodeindexer} +\def\singlecodeindexer #1{\doind{\indexname}{\code{#1}}} + +% Take care of Texinfo commands that can appear in an index entry. +% Since there are some commands we want to expand, and others we don't, +% we have to laboriously prevent expansion for those that we don't. +% +\def\indexdummies{% + \escapechar = `\\ % use backslash in output files. + \def\@{@}% change to @@ when we switch to @ as escape char in index files. + \def\ {\realbackslash\space }% + % + % Need these in case \tex is in effect and \{ is a \delimiter again. + % But can't use \lbracecmd and \rbracecmd because texindex assumes + % braces and backslashes are used only as delimiters. + \let\{ = \mylbrace + \let\} = \myrbrace + % + % I don't entirely understand this, but when an index entry is + % generated from a macro call, the \endinput which \scanmacro inserts + % causes processing to be prematurely terminated. This is, + % apparently, because \indexsorttmp is fully expanded, and \endinput + % is an expandable command. The redefinition below makes \endinput + % disappear altogether for that purpose -- although logging shows that + % processing continues to some further point. On the other hand, it + % seems \endinput does not hurt in the printed index arg, since that + % is still getting written without apparent harm. + % + % Sample source (mac-idx3.tex, reported by Graham Percival to + % help-texinfo, 22may06): + % @macro funindex {WORD} + % @findex xyz + % @end macro + % ... + % @funindex commtest + % + % The above is not enough to reproduce the bug, but it gives the flavor. + % + % Sample whatsit resulting: + % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} + % + % So: + \let\endinput = \empty + % + % Do the redefinitions. + \commondummies +} + +% For the aux and toc files, @ is the escape character. So we want to +% redefine everything using @ as the escape character (instead of +% \realbackslash, still used for index files). When everything uses @, +% this will be simpler. +% +\def\atdummies{% + \def\@{@@}% + \def\ {@ }% + \let\{ = \lbraceatcmd + \let\} = \rbraceatcmd + % + % Do the redefinitions. + \commondummies + \otherbackslash +} + +% Called from \indexdummies and \atdummies. +% +\def\commondummies{% + % + % \definedummyword defines \#1 as \string\#1\space, thus effectively + % preventing its expansion. This is used only for control% words, + % not control letters, because the \space would be incorrect for + % control characters, but is needed to separate the control word + % from whatever follows. + % + % For control letters, we have \definedummyletter, which omits the + % space. + % + % These can be used both for control words that take an argument and + % those that do not. If it is followed by {arg} in the input, then + % that will dutifully get written to the index (or wherever). + % + \def\definedummyword ##1{\def##1{\string##1\space}}% + \def\definedummyletter##1{\def##1{\string##1}}% + \let\definedummyaccent\definedummyletter + % + \commondummiesnofonts + % + \definedummyletter\_% + % + % Non-English letters. + \definedummyword\AA + \definedummyword\AE + \definedummyword\L + \definedummyword\OE + \definedummyword\O + \definedummyword\aa + \definedummyword\ae + \definedummyword\l + \definedummyword\oe + \definedummyword\o + \definedummyword\ss + \definedummyword\exclamdown + \definedummyword\questiondown + \definedummyword\ordf + \definedummyword\ordm + % + % Although these internal commands shouldn't show up, sometimes they do. + \definedummyword\bf + \definedummyword\gtr + \definedummyword\hat + \definedummyword\less + \definedummyword\sf + \definedummyword\sl + \definedummyword\tclose + \definedummyword\tt + % + \definedummyword\LaTeX + \definedummyword\TeX + % + % Assorted special characters. + \definedummyword\bullet + \definedummyword\comma + \definedummyword\copyright + \definedummyword\registeredsymbol + \definedummyword\dots + \definedummyword\enddots + \definedummyword\equiv + \definedummyword\error + \definedummyword\euro + \definedummyword\guillemetleft + \definedummyword\guillemetright + \definedummyword\guilsinglleft + \definedummyword\guilsinglright + \definedummyword\expansion + \definedummyword\minus + \definedummyword\pounds + \definedummyword\point + \definedummyword\print + \definedummyword\quotedblbase + \definedummyword\quotedblleft + \definedummyword\quotedblright + \definedummyword\quoteleft + \definedummyword\quoteright + \definedummyword\quotesinglbase + \definedummyword\result + \definedummyword\textdegree + % + % We want to disable all macros so that they are not expanded by \write. + \macrolist + % + \normalturnoffactive + % + % Handle some cases of @value -- where it does not contain any + % (non-fully-expandable) commands. + \makevalueexpandable +} + +% \commondummiesnofonts: common to \commondummies and \indexnofonts. +% +\def\commondummiesnofonts{% + % Control letters and accents. + \definedummyletter\!% + \definedummyaccent\"% + \definedummyaccent\'% + \definedummyletter\*% + \definedummyaccent\,% + \definedummyletter\.% + \definedummyletter\/% + \definedummyletter\:% + \definedummyaccent\=% + \definedummyletter\?% + \definedummyaccent\^% + \definedummyaccent\`% + \definedummyaccent\~% + \definedummyword\u + \definedummyword\v + \definedummyword\H + \definedummyword\dotaccent + \definedummyword\ringaccent + \definedummyword\tieaccent + \definedummyword\ubaraccent + \definedummyword\udotaccent + \definedummyword\dotless + % + % Texinfo font commands. + \definedummyword\b + \definedummyword\i + \definedummyword\r + \definedummyword\sc + \definedummyword\t + % + % Commands that take arguments. + \definedummyword\acronym + \definedummyword\cite + \definedummyword\code + \definedummyword\command + \definedummyword\dfn + \definedummyword\emph + \definedummyword\env + \definedummyword\file + \definedummyword\kbd + \definedummyword\key + \definedummyword\math + \definedummyword\option + \definedummyword\pxref + \definedummyword\ref + \definedummyword\samp + \definedummyword\strong + \definedummyword\tie + \definedummyword\uref + \definedummyword\url + \definedummyword\var + \definedummyword\verb + \definedummyword\w + \definedummyword\xref +} + +% \indexnofonts is used when outputting the strings to sort the index +% by, and when constructing control sequence names. It eliminates all +% control sequences and just writes whatever the best ASCII sort string +% would be for a given command (usually its argument). +% +\def\indexnofonts{% + % Accent commands should become @asis. + \def\definedummyaccent##1{\let##1\asis}% + % We can just ignore other control letters. + \def\definedummyletter##1{\let##1\empty}% + % Hopefully, all control words can become @asis. + \let\definedummyword\definedummyaccent + % + \commondummiesnofonts + % + % Don't no-op \tt, since it isn't a user-level command + % and is used in the definitions of the active chars like <, >, |, etc. + % Likewise with the other plain tex font commands. + %\let\tt=\asis + % + \def\ { }% + \def\@{@}% + % how to handle braces? + \def\_{\normalunderscore}% + % + % Non-English letters. + \def\AA{AA}% + \def\AE{AE}% + \def\L{L}% + \def\OE{OE}% + \def\O{O}% + \def\aa{aa}% + \def\ae{ae}% + \def\l{l}% + \def\oe{oe}% + \def\o{o}% + \def\ss{ss}% + \def\exclamdown{!}% + \def\questiondown{?}% + \def\ordf{a}% + \def\ordm{o}% + % + \def\LaTeX{LaTeX}% + \def\TeX{TeX}% + % + % Assorted special characters. + % (The following {} will end up in the sort string, but that's ok.) + \def\bullet{bullet}% + \def\comma{,}% + \def\copyright{copyright}% + \def\registeredsymbol{R}% + \def\dots{...}% + \def\enddots{...}% + \def\equiv{==}% + \def\error{error}% + \def\euro{euro}% + \def\guillemetleft{<<}% + \def\guillemetright{>>}% + \def\guilsinglleft{<}% + \def\guilsinglright{>}% + \def\expansion{==>}% + \def\minus{-}% + \def\pounds{pounds}% + \def\point{.}% + \def\print{-|}% + \def\quotedblbase{"}% + \def\quotedblleft{"}% + \def\quotedblright{"}% + \def\quoteleft{`}% + \def\quoteright{'}% + \def\quotesinglbase{,}% + \def\result{=>}% + \def\textdegree{degrees}% + % + % We need to get rid of all macros, leaving only the arguments (if present). + % Of course this is not nearly correct, but it is the best we can do for now. + % makeinfo does not expand macros in the argument to @deffn, which ends up + % writing an index entry, and texindex isn't prepared for an index sort entry + % that starts with \. + % + % Since macro invocations are followed by braces, we can just redefine them + % to take a single TeX argument. The case of a macro invocation that + % goes to end-of-line is not handled. + % + \macrolist +} + +\let\indexbackslash=0 %overridden during \printindex. +\let\SETmarginindex=\relax % put index entries in margin (undocumented)? + +% Most index entries go through here, but \dosubind is the general case. +% #1 is the index name, #2 is the entry text. +\def\doind#1#2{\dosubind{#1}{#2}{}} + +% Workhorse for all \fooindexes. +% #1 is name of index, #2 is stuff to put there, #3 is subentry -- +% empty if called from \doind, as we usually are (the main exception +% is with most defuns, which call us directly). +% +\def\dosubind#1#2#3{% + \iflinks + {% + % Store the main index entry text (including the third arg). + \toks0 = {#2}% + % If third arg is present, precede it with a space. + \def\thirdarg{#3}% + \ifx\thirdarg\empty \else + \toks0 = \expandafter{\the\toks0 \space #3}% + \fi + % + \edef\writeto{\csname#1indfile\endcsname}% + % + \safewhatsit\dosubindwrite + }% + \fi +} + +% Write the entry in \toks0 to the index file: +% +\def\dosubindwrite{% + % Put the index entry in the margin if desired. + \ifx\SETmarginindex\relax\else + \insert\margin{\hbox{\vrule height8pt depth3pt width0pt \the\toks0}}% + \fi + % + % Remember, we are within a group. + \indexdummies % Must do this here, since \bf, etc expand at this stage + \def\backslashcurfont{\indexbackslash}% \indexbackslash isn't defined now + % so it will be output as is; and it will print as backslash. + % + % Process the index entry with all font commands turned off, to + % get the string to sort by. + {\indexnofonts + \edef\temp{\the\toks0}% need full expansion + \xdef\indexsorttmp{\temp}% + }% + % + % Set up the complete index entry, with both the sort key and + % the original text, including any font commands. We write + % three arguments to \entry to the .?? file (four in the + % subentry case), texindex reduces to two when writing the .??s + % sorted result. + \edef\temp{% + \write\writeto{% + \string\entry{\indexsorttmp}{\noexpand\folio}{\the\toks0}}% + }% + \temp +} + +% Take care of unwanted page breaks/skips around a whatsit: +% +% If a skip is the last thing on the list now, preserve it +% by backing up by \lastskip, doing the \write, then inserting +% the skip again. Otherwise, the whatsit generated by the +% \write or \pdfdest will make \lastskip zero. The result is that +% sequences like this: +% @end defun +% @tindex whatever +% @defun ... +% will have extra space inserted, because the \medbreak in the +% start of the @defun won't see the skip inserted by the @end of +% the previous defun. +% +% But don't do any of this if we're not in vertical mode. We +% don't want to do a \vskip and prematurely end a paragraph. +% +% Avoid page breaks due to these extra skips, too. +% +% But wait, there is a catch there: +% We'll have to check whether \lastskip is zero skip. \ifdim is not +% sufficient for this purpose, as it ignores stretch and shrink parts +% of the skip. The only way seems to be to check the textual +% representation of the skip. +% +% The following is almost like \def\zeroskipmacro{0.0pt} except that +% the ``p'' and ``t'' characters have catcode \other, not 11 (letter). +% +\edef\zeroskipmacro{\expandafter\the\csname z@skip\endcsname} +% +\newskip\whatsitskip +\newcount\whatsitpenalty +% +% ..., ready, GO: +% +\def\safewhatsit#1{% +\ifhmode + #1% +\else + % \lastskip and \lastpenalty cannot both be nonzero simultaneously. + \whatsitskip = \lastskip + \edef\lastskipmacro{\the\lastskip}% + \whatsitpenalty = \lastpenalty + % + % If \lastskip is nonzero, that means the last item was a + % skip. And since a skip is discardable, that means this + % -\whatsitskip glue we're inserting is preceded by a + % non-discardable item, therefore it is not a potential + % breakpoint, therefore no \nobreak needed. + \ifx\lastskipmacro\zeroskipmacro + \else + \vskip-\whatsitskip + \fi + % + #1% + % + \ifx\lastskipmacro\zeroskipmacro + % If \lastskip was zero, perhaps the last item was a penalty, and + % perhaps it was >=10000, e.g., a \nobreak. In that case, we want + % to re-insert the same penalty (values >10000 are used for various + % signals); since we just inserted a non-discardable item, any + % following glue (such as a \parskip) would be a breakpoint. For example: + % + % @deffn deffn-whatever + % @vindex index-whatever + % Description. + % would allow a break between the index-whatever whatsit + % and the "Description." paragraph. + \ifnum\whatsitpenalty>9999 \penalty\whatsitpenalty \fi + \else + % On the other hand, if we had a nonzero \lastskip, + % this make-up glue would be preceded by a non-discardable item + % (the whatsit from the \write), so we must insert a \nobreak. + \nobreak\vskip\whatsitskip + \fi +\fi +} + +% The index entry written in the file actually looks like +% \entry {sortstring}{page}{topic} +% or +% \entry {sortstring}{page}{topic}{subtopic} +% The texindex program reads in these files and writes files +% containing these kinds of lines: +% \initial {c} +% before the first topic whose initial is c +% \entry {topic}{pagelist} +% for a topic that is used without subtopics +% \primary {topic} +% for the beginning of a topic that is used with subtopics +% \secondary {subtopic}{pagelist} +% for each subtopic. + +% Define the user-accessible indexing commands +% @findex, @vindex, @kindex, @cindex. + +\def\findex {\fnindex} +\def\kindex {\kyindex} +\def\cindex {\cpindex} +\def\vindex {\vrindex} +\def\tindex {\tpindex} +\def\pindex {\pgindex} + +\def\cindexsub {\begingroup\obeylines\cindexsub} +{\obeylines % +\gdef\cindexsub "#1" #2^^M{\endgroup % +\dosubind{cp}{#2}{#1}}} + +% Define the macros used in formatting output of the sorted index material. + +% @printindex causes a particular index (the ??s file) to get printed. +% It does not print any chapter heading (usually an @unnumbered). +% +\parseargdef\printindex{\begingroup + \dobreak \chapheadingskip{10000}% + % + \smallfonts \rm + \tolerance = 9500 + \plainfrenchspacing + \everypar = {}% don't want the \kern\-parindent from indentation suppression. + % + % See if the index file exists and is nonempty. + % Change catcode of @ here so that if the index file contains + % \initial {@} + % as its first line, TeX doesn't complain about mismatched braces + % (because it thinks @} is a control sequence). + \catcode`\@ = 11 + \openin 1 \jobname.#1s + \ifeof 1 + % \enddoublecolumns gets confused if there is no text in the index, + % and it loses the chapter title and the aux file entries for the + % index. The easiest way to prevent this problem is to make sure + % there is some text. + \putwordIndexNonexistent + \else + % + % If the index file exists but is empty, then \openin leaves \ifeof + % false. We have to make TeX try to read something from the file, so + % it can discover if there is anything in it. + \read 1 to \temp + \ifeof 1 + \putwordIndexIsEmpty + \else + % Index files are almost Texinfo source, but we use \ as the escape + % character. It would be better to use @, but that's too big a change + % to make right now. + \def\indexbackslash{\backslashcurfont}% + \catcode`\\ = 0 + \escapechar = `\\ + \begindoublecolumns + \input \jobname.#1s + \enddoublecolumns + \fi + \fi + \closein 1 +\endgroup} + +% These macros are used by the sorted index file itself. +% Change them to control the appearance of the index. + +\def\initial#1{{% + % Some minor font changes for the special characters. + \let\tentt=\sectt \let\tt=\sectt \let\sf=\sectt + % + % Remove any glue we may have, we'll be inserting our own. + \removelastskip + % + % We like breaks before the index initials, so insert a bonus. + \nobreak + \vskip 0pt plus 3\baselineskip + \penalty 0 + \vskip 0pt plus -3\baselineskip + % + % Typeset the initial. Making this add up to a whole number of + % baselineskips increases the chance of the dots lining up from column + % to column. It still won't often be perfect, because of the stretch + % we need before each entry, but it's better. + % + % No shrink because it confuses \balancecolumns. + \vskip 1.67\baselineskip plus .5\baselineskip + \leftline{\secbf #1}% + % Do our best not to break after the initial. + \nobreak + \vskip .33\baselineskip plus .1\baselineskip +}} + +% \entry typesets a paragraph consisting of the text (#1), dot leaders, and +% then page number (#2) flushed to the right margin. It is used for index +% and table of contents entries. The paragraph is indented by \leftskip. +% +% A straightforward implementation would start like this: +% \def\entry#1#2{... +% But this frozes the catcodes in the argument, and can cause problems to +% @code, which sets - active. This problem was fixed by a kludge--- +% ``-'' was active throughout whole index, but this isn't really right. +% +% The right solution is to prevent \entry from swallowing the whole text. +% --kasal, 21nov03 +\def\entry{% + \begingroup + % + % Start a new paragraph if necessary, so our assignments below can't + % affect previous text. + \par + % + % Do not fill out the last line with white space. + \parfillskip = 0in + % + % No extra space above this paragraph. + \parskip = 0in + % + % Do not prefer a separate line ending with a hyphen to fewer lines. + \finalhyphendemerits = 0 + % + % \hangindent is only relevant when the entry text and page number + % don't both fit on one line. In that case, bob suggests starting the + % dots pretty far over on the line. Unfortunately, a large + % indentation looks wrong when the entry text itself is broken across + % lines. So we use a small indentation and put up with long leaders. + % + % \hangafter is reset to 1 (which is the value we want) at the start + % of each paragraph, so we need not do anything with that. + \hangindent = 2em + % + % When the entry text needs to be broken, just fill out the first line + % with blank space. + \rightskip = 0pt plus1fil + % + % A bit of stretch before each entry for the benefit of balancing + % columns. + \vskip 0pt plus1pt + % + % Swallow the left brace of the text (first parameter): + \afterassignment\doentry + \let\temp = +} +\def\doentry{% + \bgroup % Instead of the swallowed brace. + \noindent + \aftergroup\finishentry + % And now comes the text of the entry. +} +\def\finishentry#1{% + % #1 is the page number. + % + % The following is kludged to not output a line of dots in the index if + % there are no page numbers. The next person who breaks this will be + % cursed by a Unix daemon. + \setbox\boxA = \hbox{#1}% + \ifdim\wd\boxA = 0pt + \ % + \else + % + % If we must, put the page number on a line of its own, and fill out + % this line with blank space. (The \hfil is overwhelmed with the + % fill leaders glue in \indexdotfill if the page number does fit.) + \hfil\penalty50 + \null\nobreak\indexdotfill % Have leaders before the page number. + % + % The `\ ' here is removed by the implicit \unskip that TeX does as + % part of (the primitive) \par. Without it, a spurious underfull + % \hbox ensues. + \ifpdf + \pdfgettoks#1.% + \ \the\toksA + \else + \ #1% + \fi + \fi + \par + \endgroup +} + +% Like plain.tex's \dotfill, except uses up at least 1 em. +\def\indexdotfill{\cleaders + \hbox{$\mathsurround=0pt \mkern1.5mu.\mkern1.5mu$}\hskip 1em plus 1fill} + +\def\primary #1{\line{#1\hfil}} + +\newskip\secondaryindent \secondaryindent=0.5cm +\def\secondary#1#2{{% + \parfillskip=0in + \parskip=0in + \hangindent=1in + \hangafter=1 + \noindent\hskip\secondaryindent\hbox{#1}\indexdotfill + \ifpdf + \pdfgettoks#2.\ \the\toksA % The page number ends the paragraph. + \else + #2 + \fi + \par +}} + +% Define two-column mode, which we use to typeset indexes. +% Adapted from the TeXbook, page 416, which is to say, +% the manmac.tex format used to print the TeXbook itself. +\catcode`\@=11 + +\newbox\partialpage +\newdimen\doublecolumnhsize + +\def\begindoublecolumns{\begingroup % ended by \enddoublecolumns + % Grab any single-column material above us. + \output = {% + % + % Here is a possibility not foreseen in manmac: if we accumulate a + % whole lot of material, we might end up calling this \output + % routine twice in a row (see the doublecol-lose test, which is + % essentially a couple of indexes with @setchapternewpage off). In + % that case we just ship out what is in \partialpage with the normal + % output routine. Generally, \partialpage will be empty when this + % runs and this will be a no-op. See the indexspread.tex test case. + \ifvoid\partialpage \else + \onepageout{\pagecontents\partialpage}% + \fi + % + \global\setbox\partialpage = \vbox{% + % Unvbox the main output page. + \unvbox\PAGE + \kern-\topskip \kern\baselineskip + }% + }% + \eject % run that output routine to set \partialpage + % + % Use the double-column output routine for subsequent pages. + \output = {\doublecolumnout}% + % + % Change the page size parameters. We could do this once outside this + % routine, in each of @smallbook, @afourpaper, and the default 8.5x11 + % format, but then we repeat the same computation. Repeating a couple + % of assignments once per index is clearly meaningless for the + % execution time, so we may as well do it in one place. + % + % First we halve the line length, less a little for the gutter between + % the columns. We compute the gutter based on the line length, so it + % changes automatically with the paper format. The magic constant + % below is chosen so that the gutter has the same value (well, +-<1pt) + % as it did when we hard-coded it. + % + % We put the result in a separate register, \doublecolumhsize, so we + % can restore it in \pagesofar, after \hsize itself has (potentially) + % been clobbered. + % + \doublecolumnhsize = \hsize + \advance\doublecolumnhsize by -.04154\hsize + \divide\doublecolumnhsize by 2 + \hsize = \doublecolumnhsize + % + % Double the \vsize as well. (We don't need a separate register here, + % since nobody clobbers \vsize.) + \vsize = 2\vsize +} + +% The double-column output routine for all double-column pages except +% the last. +% +\def\doublecolumnout{% + \splittopskip=\topskip \splitmaxdepth=\maxdepth + % Get the available space for the double columns -- the normal + % (undoubled) page height minus any material left over from the + % previous page. + \dimen@ = \vsize + \divide\dimen@ by 2 + \advance\dimen@ by -\ht\partialpage + % + % box0 will be the left-hand column, box2 the right. + \setbox0=\vsplit255 to\dimen@ \setbox2=\vsplit255 to\dimen@ + \onepageout\pagesofar + \unvbox255 + \penalty\outputpenalty +} +% +% Re-output the contents of the output page -- any previous material, +% followed by the two boxes we just split, in box0 and box2. +\def\pagesofar{% + \unvbox\partialpage + % + \hsize = \doublecolumnhsize + \wd0=\hsize \wd2=\hsize + \hbox to\pagewidth{\box0\hfil\box2}% +} +% +% All done with double columns. +\def\enddoublecolumns{% + % The following penalty ensures that the page builder is exercised + % _before_ we change the output routine. This is necessary in the + % following situation: + % + % The last section of the index consists only of a single entry. + % Before this section, \pagetotal is less than \pagegoal, so no + % break occurs before the last section starts. However, the last + % section, consisting of \initial and the single \entry, does not + % fit on the page and has to be broken off. Without the following + % penalty the page builder will not be exercised until \eject + % below, and by that time we'll already have changed the output + % routine to the \balancecolumns version, so the next-to-last + % double-column page will be processed with \balancecolumns, which + % is wrong: The two columns will go to the main vertical list, with + % the broken-off section in the recent contributions. As soon as + % the output routine finishes, TeX starts reconsidering the page + % break. The two columns and the broken-off section both fit on the + % page, because the two columns now take up only half of the page + % goal. When TeX sees \eject from below which follows the final + % section, it invokes the new output routine that we've set after + % \balancecolumns below; \onepageout will try to fit the two columns + % and the final section into the vbox of \pageheight (see + % \pagebody), causing an overfull box. + % + % Note that glue won't work here, because glue does not exercise the + % page builder, unlike penalties (see The TeXbook, pp. 280-281). + \penalty0 + % + \output = {% + % Split the last of the double-column material. Leave it on the + % current page, no automatic page break. + \balancecolumns + % + % If we end up splitting too much material for the current page, + % though, there will be another page break right after this \output + % invocation ends. Having called \balancecolumns once, we do not + % want to call it again. Therefore, reset \output to its normal + % definition right away. (We hope \balancecolumns will never be + % called on to balance too much material, but if it is, this makes + % the output somewhat more palatable.) + \global\output = {\onepageout{\pagecontents\PAGE}}% + }% + \eject + \endgroup % started in \begindoublecolumns + % + % \pagegoal was set to the doubled \vsize above, since we restarted + % the current page. We're now back to normal single-column + % typesetting, so reset \pagegoal to the normal \vsize (after the + % \endgroup where \vsize got restored). + \pagegoal = \vsize +} +% +% Called at the end of the double column material. +\def\balancecolumns{% + \setbox0 = \vbox{\unvbox255}% like \box255 but more efficient, see p.120. + \dimen@ = \ht0 + \advance\dimen@ by \topskip + \advance\dimen@ by-\baselineskip + \divide\dimen@ by 2 % target to split to + %debug\message{final 2-column material height=\the\ht0, target=\the\dimen@.}% + \splittopskip = \topskip + % Loop until we get a decent breakpoint. + {% + \vbadness = 10000 + \loop + \global\setbox3 = \copy0 + \global\setbox1 = \vsplit3 to \dimen@ + \ifdim\ht3>\dimen@ + \global\advance\dimen@ by 1pt + \repeat + }% + %debug\message{split to \the\dimen@, column heights: \the\ht1, \the\ht3.}% + \setbox0=\vbox to\dimen@{\unvbox1}% + \setbox2=\vbox to\dimen@{\unvbox3}% + % + \pagesofar +} +\catcode`\@ = \other + + +\message{sectioning,} +% Chapters, sections, etc. + +% \unnumberedno is an oxymoron, of course. But we count the unnumbered +% sections so that we can refer to them unambiguously in the pdf +% outlines by their "section number". We avoid collisions with chapter +% numbers by starting them at 10000. (If a document ever has 10000 +% chapters, we're in trouble anyway, I'm sure.) +\newcount\unnumberedno \unnumberedno = 10000 +\newcount\chapno +\newcount\secno \secno=0 +\newcount\subsecno \subsecno=0 +\newcount\subsubsecno \subsubsecno=0 + +% This counter is funny since it counts through charcodes of letters A, B, ... +\newcount\appendixno \appendixno = `\@ +% +% \def\appendixletter{\char\the\appendixno} +% We do the following ugly conditional instead of the above simple +% construct for the sake of pdftex, which needs the actual +% letter in the expansion, not just typeset. +% +\def\appendixletter{% + \ifnum\appendixno=`A A% + \else\ifnum\appendixno=`B B% + \else\ifnum\appendixno=`C C% + \else\ifnum\appendixno=`D D% + \else\ifnum\appendixno=`E E% + \else\ifnum\appendixno=`F F% + \else\ifnum\appendixno=`G G% + \else\ifnum\appendixno=`H H% + \else\ifnum\appendixno=`I I% + \else\ifnum\appendixno=`J J% + \else\ifnum\appendixno=`K K% + \else\ifnum\appendixno=`L L% + \else\ifnum\appendixno=`M M% + \else\ifnum\appendixno=`N N% + \else\ifnum\appendixno=`O O% + \else\ifnum\appendixno=`P P% + \else\ifnum\appendixno=`Q Q% + \else\ifnum\appendixno=`R R% + \else\ifnum\appendixno=`S S% + \else\ifnum\appendixno=`T T% + \else\ifnum\appendixno=`U U% + \else\ifnum\appendixno=`V V% + \else\ifnum\appendixno=`W W% + \else\ifnum\appendixno=`X X% + \else\ifnum\appendixno=`Y Y% + \else\ifnum\appendixno=`Z Z% + % The \the is necessary, despite appearances, because \appendixletter is + % expanded while writing the .toc file. \char\appendixno is not + % expandable, thus it is written literally, thus all appendixes come out + % with the same letter (or @) in the toc without it. + \else\char\the\appendixno + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi + \fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi\fi} + +% Each @chapter defines these (using marks) as the number+name, number +% and name of the chapter. Page headings and footings can use +% these. @section does likewise. +\def\thischapter{} +\def\thischapternum{} +\def\thischaptername{} +\def\thissection{} +\def\thissectionnum{} +\def\thissectionname{} + +\newcount\absseclevel % used to calculate proper heading level +\newcount\secbase\secbase=0 % @raisesections/@lowersections modify this count + +% @raisesections: treat @section as chapter, @subsection as section, etc. +\def\raisesections{\global\advance\secbase by -1} +\let\up=\raisesections % original BFox name + +% @lowersections: treat @chapter as section, @section as subsection, etc. +\def\lowersections{\global\advance\secbase by 1} +\let\down=\lowersections % original BFox name + +% we only have subsub. +\chardef\maxseclevel = 3 +% +% A numbered section within an unnumbered changes to unnumbered too. +% To achive this, remember the "biggest" unnum. sec. we are currently in: +\chardef\unmlevel = \maxseclevel +% +% Trace whether the current chapter is an appendix or not: +% \chapheadtype is "N" or "A", unnumbered chapters are ignored. +\def\chapheadtype{N} + +% Choose a heading macro +% #1 is heading type +% #2 is heading level +% #3 is text for heading +\def\genhead#1#2#3{% + % Compute the abs. sec. level: + \absseclevel=#2 + \advance\absseclevel by \secbase + % Make sure \absseclevel doesn't fall outside the range: + \ifnum \absseclevel < 0 + \absseclevel = 0 + \else + \ifnum \absseclevel > 3 + \absseclevel = 3 + \fi + \fi + % The heading type: + \def\headtype{#1}% + \if \headtype U% + \ifnum \absseclevel < \unmlevel + \chardef\unmlevel = \absseclevel + \fi + \else + % Check for appendix sections: + \ifnum \absseclevel = 0 + \edef\chapheadtype{\headtype}% + \else + \if \headtype A\if \chapheadtype N% + \errmessage{@appendix... within a non-appendix chapter}% + \fi\fi + \fi + % Check for numbered within unnumbered: + \ifnum \absseclevel > \unmlevel + \def\headtype{U}% + \else + \chardef\unmlevel = 3 + \fi + \fi + % Now print the heading: + \if \headtype U% + \ifcase\absseclevel + \unnumberedzzz{#3}% + \or \unnumberedseczzz{#3}% + \or \unnumberedsubseczzz{#3}% + \or \unnumberedsubsubseczzz{#3}% + \fi + \else + \if \headtype A% + \ifcase\absseclevel + \appendixzzz{#3}% + \or \appendixsectionzzz{#3}% + \or \appendixsubseczzz{#3}% + \or \appendixsubsubseczzz{#3}% + \fi + \else + \ifcase\absseclevel + \chapterzzz{#3}% + \or \seczzz{#3}% + \or \numberedsubseczzz{#3}% + \or \numberedsubsubseczzz{#3}% + \fi + \fi + \fi + \suppressfirstparagraphindent +} + +% an interface: +\def\numhead{\genhead N} +\def\apphead{\genhead A} +\def\unnmhead{\genhead U} + +% @chapter, @appendix, @unnumbered. Increment top-level counter, reset +% all lower-level sectioning counters to zero. +% +% Also set \chaplevelprefix, which we prepend to @float sequence numbers +% (e.g., figures), q.v. By default (before any chapter), that is empty. +\let\chaplevelprefix = \empty +% +\outer\parseargdef\chapter{\numhead0{#1}} % normally numhead0 calls chapterzzz +\def\chapterzzz#1{% + % section resetting is \global in case the chapter is in a group, such + % as an @include file. + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\chapno by 1 + % + % Used for \float. + \gdef\chaplevelprefix{\the\chapno.}% + \resetallfloatnos + % + \message{\putwordChapter\space \the\chapno}% + % + % Write the actual heading. + \chapmacro{#1}{Ynumbered}{\the\chapno}% + % + % So @section and the like are numbered underneath this chapter. + \global\let\section = \numberedsec + \global\let\subsection = \numberedsubsec + \global\let\subsubsection = \numberedsubsubsec +} + +\outer\parseargdef\appendix{\apphead0{#1}} % normally apphead0 calls appendixzzz +\def\appendixzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\appendixno by 1 + \gdef\chaplevelprefix{\appendixletter.}% + \resetallfloatnos + % + \def\appendixnum{\putwordAppendix\space \appendixletter}% + \message{\appendixnum}% + % + \chapmacro{#1}{Yappendix}{\appendixletter}% + % + \global\let\section = \appendixsec + \global\let\subsection = \appendixsubsec + \global\let\subsubsection = \appendixsubsubsec +} + +\outer\parseargdef\unnumbered{\unnmhead0{#1}} % normally unnmhead0 calls unnumberedzzz +\def\unnumberedzzz#1{% + \global\secno=0 \global\subsecno=0 \global\subsubsecno=0 + \global\advance\unnumberedno by 1 + % + % Since an unnumbered has no number, no prefix for figures. + \global\let\chaplevelprefix = \empty + \resetallfloatnos + % + % This used to be simply \message{#1}, but TeX fully expands the + % argument to \message. Therefore, if #1 contained @-commands, TeX + % expanded them. For example, in `@unnumbered The @cite{Book}', TeX + % expanded @cite (which turns out to cause errors because \cite is meant + % to be executed, not expanded). + % + % Anyway, we don't want the fully-expanded definition of @cite to appear + % as a result of the \message, we just want `@cite' itself. We use + % \the to achieve this: TeX expands \the only once, + % simply yielding the contents of . (We also do this for + % the toc entries.) + \toks0 = {#1}% + \message{(\the\toks0)}% + % + \chapmacro{#1}{Ynothing}{\the\unnumberedno}% + % + \global\let\section = \unnumberedsec + \global\let\subsection = \unnumberedsubsec + \global\let\subsubsection = \unnumberedsubsubsec +} + +% @centerchap is like @unnumbered, but the heading is centered. +\outer\parseargdef\centerchap{% + % Well, we could do the following in a group, but that would break + % an assumption that \chapmacro is called at the outermost level. + % Thus we are safer this way: --kasal, 24feb04 + \let\centerparametersmaybe = \centerparameters + \unnmhead0{#1}% + \let\centerparametersmaybe = \relax +} + +% @top is like @unnumbered. +\let\top\unnumbered + +% Sections. +\outer\parseargdef\numberedsec{\numhead1{#1}} % normally calls seczzz +\def\seczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynumbered}{\the\chapno.\the\secno}% +} + +\outer\parseargdef\appendixsection{\apphead1{#1}} % normally calls appendixsectionzzz +\def\appendixsectionzzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Yappendix}{\appendixletter.\the\secno}% +} +\let\appendixsec\appendixsection + +\outer\parseargdef\unnumberedsec{\unnmhead1{#1}} % normally calls unnumberedseczzz +\def\unnumberedseczzz#1{% + \global\subsecno=0 \global\subsubsecno=0 \global\advance\secno by 1 + \sectionheading{#1}{sec}{Ynothing}{\the\unnumberedno.\the\secno}% +} + +% Subsections. +\outer\parseargdef\numberedsubsec{\numhead2{#1}} % normally calls numberedsubseczzz +\def\numberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynumbered}{\the\chapno.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\appendixsubsec{\apphead2{#1}} % normally calls appendixsubseczzz +\def\appendixsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno}% +} + +\outer\parseargdef\unnumberedsubsec{\unnmhead2{#1}} %normally calls unnumberedsubseczzz +\def\unnumberedsubseczzz#1{% + \global\subsubsecno=0 \global\advance\subsecno by 1 + \sectionheading{#1}{subsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno}% +} + +% Subsubsections. +\outer\parseargdef\numberedsubsubsec{\numhead3{#1}} % normally numberedsubsubseczzz +\def\numberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynumbered}% + {\the\chapno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\appendixsubsubsec{\apphead3{#1}} % normally appendixsubsubseczzz +\def\appendixsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Yappendix}% + {\appendixletter.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +\outer\parseargdef\unnumberedsubsubsec{\unnmhead3{#1}} %normally unnumberedsubsubseczzz +\def\unnumberedsubsubseczzz#1{% + \global\advance\subsubsecno by 1 + \sectionheading{#1}{subsubsec}{Ynothing}% + {\the\unnumberedno.\the\secno.\the\subsecno.\the\subsubsecno}% +} + +% These macros control what the section commands do, according +% to what kind of chapter we are in (ordinary, appendix, or unnumbered). +% Define them by default for a numbered chapter. +\let\section = \numberedsec +\let\subsection = \numberedsubsec +\let\subsubsection = \numberedsubsubsec + +% Define @majorheading, @heading and @subheading + +% NOTE on use of \vbox for chapter headings, section headings, and such: +% 1) We use \vbox rather than the earlier \line to permit +% overlong headings to fold. +% 2) \hyphenpenalty is set to 10000 because hyphenation in a +% heading is obnoxious; this forbids it. +% 3) Likewise, headings look best if no \parindent is used, and +% if justification is not attempted. Hence \raggedright. + + +\def\majorheading{% + {\advance\chapheadingskip by 10pt \chapbreak }% + \parsearg\chapheadingzzz +} + +\def\chapheading{\chapbreak \parsearg\chapheadingzzz} +\def\chapheadingzzz#1{% + {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}% + \bigskip \par\penalty 200\relax + \suppressfirstparagraphindent +} + +% @heading, @subheading, @subsubheading. +\parseargdef\heading{\sectionheading{#1}{sec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subheading{\sectionheading{#1}{subsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} +\parseargdef\subsubheading{\sectionheading{#1}{subsubsec}{Yomitfromtoc}{} + \suppressfirstparagraphindent} + +% These macros generate a chapter, section, etc. heading only +% (including whitespace, linebreaking, etc. around it), +% given all the information in convenient, parsed form. + +%%% Args are the skip and penalty (usually negative) +\def\dobreak#1#2{\par\ifdim\lastskip<#1\removelastskip\penalty#2\vskip#1\fi} + +%%% Define plain chapter starts, and page on/off switching for it +% Parameter controlling skip before chapter headings (if needed) + +\newskip\chapheadingskip + +\def\chapbreak{\dobreak \chapheadingskip {-4000}} +\def\chappager{\par\vfill\supereject} +% Because \domark is called before \chapoddpage, the filler page will +% get the headings for the next chapter, which is wrong. But we don't +% care -- we just disable all headings on the filler page. +\def\chapoddpage{% + \chappager + \ifodd\pageno \else + \begingroup + \evenheadline={\hfil}\evenfootline={\hfil}% + \oddheadline={\hfil}\oddfootline={\hfil}% + \hbox to 0pt{}% + \chappager + \endgroup + \fi +} + +\def\setchapternewpage #1 {\csname CHAPPAG#1\endcsname} + +\def\CHAPPAGoff{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chapbreak +\global\let\pagealignmacro=\chappager} + +\def\CHAPPAGon{% +\global\let\contentsalignmacro = \chappager +\global\let\pchapsepmacro=\chappager +\global\let\pagealignmacro=\chappager +\global\def\HEADINGSon{\HEADINGSsingle}} + +\def\CHAPPAGodd{% +\global\let\contentsalignmacro = \chapoddpage +\global\let\pchapsepmacro=\chapoddpage +\global\let\pagealignmacro=\chapoddpage +\global\def\HEADINGSon{\HEADINGSdouble}} + +\CHAPPAGon + +% Chapter opening. +% +% #1 is the text, #2 is the section type (Ynumbered, Ynothing, +% Yappendix, Yomitfromtoc), #3 the chapter number. +% +% To test against our argument. +\def\Ynothingkeyword{Ynothing} +\def\Yomitfromtockeyword{Yomitfromtoc} +\def\Yappendixkeyword{Yappendix} +% +\def\chapmacro#1#2#3{% + % Insert the first mark before the heading break (see notes for \domark). + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \gdef\lastsectiondefs{\gdef\thissectionname{}\gdef\thissectionnum{}% + \gdef\thissection{}}% + % + \def\temptype{#2}% + \ifx\temptype\Ynothingkeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{\thischaptername}}% + \else\ifx\temptype\Yomitfromtockeyword + \gdef\lastchapterdefs{\gdef\thischaptername{#1}\gdef\thischapternum{}% + \gdef\thischapter{}}% + \else\ifx\temptype\Yappendixkeyword + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\appendixletter}% + \gdef\noexpand\thischapter{\putwordAppendix{} \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \else + \toks0={#1}% + \xdef\lastchapterdefs{% + \gdef\noexpand\thischaptername{\the\toks0}% + \gdef\noexpand\thischapternum{\the\chapno}% + \gdef\noexpand\thischapter{\putwordChapter{} \noexpand\thischapternum: + \noexpand\thischaptername}% + }% + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert the chapter heading break. + \pchapsepmacro + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevchapterdefs=\lastchapterdefs + \let\prevsectiondefs=\lastsectiondefs + \domark + % + {% + \chapfonts \rm + % + % Have to define \lastsection before calling \donoderef, because the + % xref code eventually uses it. On the other hand, it has to be called + % after \pchapsepmacro, or the headline will change too soon. + \gdef\lastsection{#1}% + % + % Only insert the separating space if we have a chapter/appendix + % number, and don't print the unnumbered ``number''. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unnchap}% + \else\ifx\temptype\Yomitfromtockeyword + \setbox0 = \hbox{}% contents like unnumbered, but no toc entry + \def\toctype{omit}% + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{\putwordAppendix{} #3\enspace}% + \def\toctype{app}% + \else + \setbox0 = \hbox{#3\enspace}% + \def\toctype{numchap}% + \fi\fi\fi + % + % Write the toc entry for this chapter. Must come before the + % \donoderef, because we include the current node name in the toc + % entry, and \donoderef resets it to empty. + \writetocentry{\toctype}{#1}{#3}% + % + % For pdftex, we have to write out the node definition (aka, make + % the pdfdest) after any page break, but before the actual text has + % been typeset. If the destination for the pdf outline is after the + % text, then jumping from the outline may wind up with the text not + % being visible, for instance under high magnification. + \donoderef{#2}% + % + % Typeset the actual heading. + \nobreak % Avoid page breaks at the interline glue. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent=\wd0 \centerparametersmaybe + \unhbox0 #1\par}% + }% + \nobreak\bigskip % no page break after a chapter title + \nobreak +} + +% @centerchap -- centered and unnumbered. +\let\centerparametersmaybe = \relax +\def\centerparameters{% + \advance\rightskip by 3\rightskip + \leftskip = \rightskip + \parfillskip = 0pt +} + + +% I don't think this chapter style is supported any more, so I'm not +% updating it with the new noderef stuff. We'll see. --karl, 11aug03. +% +\def\setchapterstyle #1 {\csname CHAPF#1\endcsname} +% +\def\unnchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt\raggedright + \rm #1\hfill}}\bigskip \par\nobreak +} +\def\chfopen #1#2{\chapoddpage {\chapfonts +\vbox to 3in{\vfil \hbox to\hsize{\hfil #2} \hbox to\hsize{\hfil #1} \vfil}}% +\par\penalty 5000 % +} +\def\centerchfopen #1{% +\chapoddpage {\chapfonts \vbox{\hyphenpenalty=10000\tolerance=5000 + \parindent=0pt + \hfill {\rm #1}\hfill}}\bigskip \par\nobreak +} +\def\CHAPFopen{% + \global\let\chapmacro=\chfopen + \global\let\centerchapmacro=\centerchfopen} + + +% Section titles. These macros combine the section number parts and +% call the generic \sectionheading to do the printing. +% +\newskip\secheadingskip +\def\secheadingbreak{\dobreak \secheadingskip{-1000}} + +% Subsection titles. +\newskip\subsecheadingskip +\def\subsecheadingbreak{\dobreak \subsecheadingskip{-500}} + +% Subsubsection titles. +\def\subsubsecheadingskip{\subsecheadingskip} +\def\subsubsecheadingbreak{\subsecheadingbreak} + + +% Print any size, any type, section title. +% +% #1 is the text, #2 is the section level (sec/subsec/subsubsec), #3 is +% the section type for xrefs (Ynumbered, Ynothing, Yappendix), #4 is the +% section number. +% +\def\seckeyword{sec} +% +\def\sectionheading#1#2#3#4{% + {% + % Switch to the right set of fonts. + \csname #2fonts\endcsname \rm + % + \def\sectionlevel{#2}% + \def\temptype{#3}% + % + % Insert first mark before the heading break (see notes for \domark). + \let\prevsectiondefs=\lastsectiondefs + \ifx\temptype\Ynothingkeyword + \ifx\sectionlevel\seckeyword + \gdef\lastsectiondefs{\gdef\thissectionname{#1}\gdef\thissectionnum{}% + \gdef\thissection{\thissectionname}}% + \fi + \else\ifx\temptype\Yomitfromtockeyword + % Don't redefine \thissection. + \else\ifx\temptype\Yappendixkeyword + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \else + \ifx\sectionlevel\seckeyword + \toks0={#1}% + \xdef\lastsectiondefs{% + \gdef\noexpand\thissectionname{\the\toks0}% + \gdef\noexpand\thissectionnum{#4}% + \gdef\noexpand\thissection{\putwordSection{} \noexpand\thissectionnum: + \noexpand\thissectionname}% + }% + \fi + \fi\fi\fi + % + % Output the mark. Pass it through \safewhatsit, to take care of + % the preceding space. + \safewhatsit\domark + % + % Insert space above the heading. + \csname #2headingbreak\endcsname + % + % Now the second mark, after the heading break. No break points + % between here and the heading. + \let\prevsectiondefs=\lastsectiondefs + \domark + % + % Only insert the space after the number if we have a section number. + \ifx\temptype\Ynothingkeyword + \setbox0 = \hbox{}% + \def\toctype{unn}% + \gdef\lastsection{#1}% + \else\ifx\temptype\Yomitfromtockeyword + % for @headings -- no section number, don't include in toc, + % and don't redefine \lastsection. + \setbox0 = \hbox{}% + \def\toctype{omit}% + \let\sectionlevel=\empty + \else\ifx\temptype\Yappendixkeyword + \setbox0 = \hbox{#4\enspace}% + \def\toctype{app}% + \gdef\lastsection{#1}% + \else + \setbox0 = \hbox{#4\enspace}% + \def\toctype{num}% + \gdef\lastsection{#1}% + \fi\fi\fi + % + % Write the toc entry (before \donoderef). See comments in \chapmacro. + \writetocentry{\toctype\sectionlevel}{#1}{#4}% + % + % Write the node reference (= pdf destination for pdftex). + % Again, see comments in \chapmacro. + \donoderef{#3}% + % + % Interline glue will be inserted when the vbox is completed. + % That glue will be a valid breakpoint for the page, since it'll be + % preceded by a whatsit (usually from the \donoderef, or from the + % \writetocentry if there was no node). We don't want to allow that + % break, since then the whatsits could end up on page n while the + % section is on page n+1, thus toc/etc. are wrong. Debian bug 276000. + \nobreak + % + % Output the actual section heading. + \vbox{\hyphenpenalty=10000 \tolerance=5000 \parindent=0pt \raggedright + \hangindent=\wd0 % zero if no section number + \unhbox0 #1}% + }% + % Add extra space after the heading -- half of whatever came above it. + % Don't allow stretch, though. + \kern .5 \csname #2headingskip\endcsname + % + % Do not let the kern be a potential breakpoint, as it would be if it + % was followed by glue. + \nobreak + % + % We'll almost certainly start a paragraph next, so don't let that + % glue accumulate. (Not a breakpoint because it's preceded by a + % discardable item.) + \vskip-\parskip + % + % This is purely so the last item on the list is a known \penalty > + % 10000. This is so \startdefun can avoid allowing breakpoints after + % section headings. Otherwise, it would insert a valid breakpoint between: + % + % @section sec-whatever + % @deffn def-whatever + \penalty 10001 +} + + +\message{toc,} +% Table of contents. +\newwrite\tocfile + +% Write an entry to the toc file, opening it if necessary. +% Called from @chapter, etc. +% +% Example usage: \writetocentry{sec}{Section Name}{\the\chapno.\the\secno} +% We append the current node name (if any) and page number as additional +% arguments for the \{chap,sec,...}entry macros which will eventually +% read this. The node name is used in the pdf outlines as the +% destination to jump to. +% +% We open the .toc file for writing here instead of at @setfilename (or +% any other fixed time) so that @contents can be anywhere in the document. +% But if #1 is `omit', then we don't do anything. This is used for the +% table of contents chapter openings themselves. +% +\newif\iftocfileopened +\def\omitkeyword{omit}% +% +\def\writetocentry#1#2#3{% + \edef\writetoctype{#1}% + \ifx\writetoctype\omitkeyword \else + \iftocfileopened\else + \immediate\openout\tocfile = \jobname.toc + \global\tocfileopenedtrue + \fi + % + \iflinks + {\atdummies + \edef\temp{% + \write\tocfile{@#1entry{#2}{#3}{\lastnode}{\noexpand\folio}}}% + \temp + }% + \fi + \fi + % + % Tell \shipout to create a pdf destination on each page, if we're + % writing pdf. These are used in the table of contents. We can't + % just write one on every page because the title pages are numbered + % 1 and 2 (the page numbers aren't printed), and so are the first + % two pages of the document. Thus, we'd have two destinations named + % `1', and two named `2'. + \ifpdf \global\pdfmakepagedesttrue \fi +} + + +% These characters do not print properly in the Computer Modern roman +% fonts, so we must take special care. This is more or less redundant +% with the Texinfo input format setup at the end of this file. +% +\def\activecatcodes{% + \catcode`\"=\active + \catcode`\$=\active + \catcode`\<=\active + \catcode`\>=\active + \catcode`\\=\active + \catcode`\^=\active + \catcode`\_=\active + \catcode`\|=\active + \catcode`\~=\active +} + + +% Read the toc file, which is essentially Texinfo input. +\def\readtocfile{% + \setupdatafile + \activecatcodes + \input \tocreadfilename +} + +\newskip\contentsrightmargin \contentsrightmargin=1in +\newcount\savepageno +\newcount\lastnegativepageno \lastnegativepageno = -1 + +% Prepare to read what we've written to \tocfile. +% +\def\startcontents#1{% + % If @setchapternewpage on, and @headings double, the contents should + % start on an odd page, unlike chapters. Thus, we maintain + % \contentsalignmacro in parallel with \pagealignmacro. + % From: Torbjorn Granlund + \contentsalignmacro + \immediate\closeout\tocfile + % + % Don't need to put `Contents' or `Short Contents' in the headline. + % It is abundantly clear what they are. + \chapmacro{#1}{Yomitfromtoc}{}% + % + \savepageno = \pageno + \begingroup % Set up to handle contents files properly. + \raggedbottom % Worry more about breakpoints than the bottom. + \advance\hsize by -\contentsrightmargin % Don't use the full line length. + % + % Roman numerals for page numbers. + \ifnum \pageno>0 \global\pageno = \lastnegativepageno \fi +} + +% redefined for the two-volume lispref. We always output on +% \jobname.toc even if this is redefined. +% +\def\tocreadfilename{\jobname.toc} + +% Normal (long) toc. +% +\def\contents{% + \startcontents{\putwordTOC}% + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \ifeof 1 \else + \pdfmakeoutlines + \fi + \closein 1 + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} + +% And just the chapters. +\def\summarycontents{% + \startcontents{\putwordShortTOC}% + % + \let\numchapentry = \shortchapentry + \let\appentry = \shortchapentry + \let\unnchapentry = \shortunnchapentry + % We want a true roman here for the page numbers. + \secfonts + \let\rm=\shortcontrm \let\bf=\shortcontbf + \let\sl=\shortcontsl \let\tt=\shortconttt + \rm + \hyphenpenalty = 10000 + \advance\baselineskip by 1pt % Open it up a little. + \def\numsecentry##1##2##3##4{} + \let\appsecentry = \numsecentry + \let\unnsecentry = \numsecentry + \let\numsubsecentry = \numsecentry + \let\appsubsecentry = \numsecentry + \let\unnsubsecentry = \numsecentry + \let\numsubsubsecentry = \numsecentry + \let\appsubsubsecentry = \numsecentry + \let\unnsubsubsecentry = \numsecentry + \openin 1 \tocreadfilename\space + \ifeof 1 \else + \readtocfile + \fi + \closein 1 + \vfill \eject + \contentsalignmacro % in case @setchapternewpage odd is in effect + \endgroup + \lastnegativepageno = \pageno + \global\pageno = \savepageno +} +\let\shortcontents = \summarycontents + +% Typeset the label for a chapter or appendix for the short contents. +% The arg is, e.g., `A' for an appendix, or `3' for a chapter. +% +\def\shortchaplabel#1{% + % This space should be enough, since a single number is .5em, and the + % widest letter (M) is 1em, at least in the Computer Modern fonts. + % But use \hss just in case. + % (This space doesn't include the extra space that gets added after + % the label; that gets put in by \shortchapentry above.) + % + % We'd like to right-justify chapter numbers, but that looks strange + % with appendix letters. And right-justifying numbers and + % left-justifying letters looks strange when there is less than 10 + % chapters. Have to read the whole toc once to know how many chapters + % there are before deciding ... + \hbox to 1em{#1\hss}% +} + +% These macros generate individual entries in the table of contents. +% The first argument is the chapter or section name. +% The last argument is the page number. +% The arguments in between are the chapter number, section number, ... + +% Chapters, in the main contents. +\def\numchapentry#1#2#3#4{\dochapentry{#2\labelspace#1}{#4}} +% +% Chapters, in the short toc. +% See comments in \dochapentry re vbox and related settings. +\def\shortchapentry#1#2#3#4{% + \tocentry{\shortchaplabel{#2}\labelspace #1}{\doshortpageno\bgroup#4\egroup}% +} + +% Appendices, in the main contents. +% Need the word Appendix, and a fixed-size box. +% +\def\appendixbox#1{% + % We use M since it's probably the widest letter. + \setbox0 = \hbox{\putwordAppendix{} M}% + \hbox to \wd0{\putwordAppendix{} #1\hss}} +% +\def\appentry#1#2#3#4{\dochapentry{\appendixbox{#2}\labelspace#1}{#4}} + +% Unnumbered chapters. +\def\unnchapentry#1#2#3#4{\dochapentry{#1}{#4}} +\def\shortunnchapentry#1#2#3#4{\tocentry{#1}{\doshortpageno\bgroup#4\egroup}} + +% Sections. +\def\numsecentry#1#2#3#4{\dosecentry{#2\labelspace#1}{#4}} +\let\appsecentry=\numsecentry +\def\unnsecentry#1#2#3#4{\dosecentry{#1}{#4}} + +% Subsections. +\def\numsubsecentry#1#2#3#4{\dosubsecentry{#2\labelspace#1}{#4}} +\let\appsubsecentry=\numsubsecentry +\def\unnsubsecentry#1#2#3#4{\dosubsecentry{#1}{#4}} + +% And subsubsections. +\def\numsubsubsecentry#1#2#3#4{\dosubsubsecentry{#2\labelspace#1}{#4}} +\let\appsubsubsecentry=\numsubsubsecentry +\def\unnsubsubsecentry#1#2#3#4{\dosubsubsecentry{#1}{#4}} + +% This parameter controls the indentation of the various levels. +% Same as \defaultparindent. +\newdimen\tocindent \tocindent = 15pt + +% Now for the actual typesetting. In all these, #1 is the text and #2 is the +% page number. +% +% If the toc has to be broken over pages, we want it to be at chapters +% if at all possible; hence the \penalty. +\def\dochapentry#1#2{% + \penalty-300 \vskip1\baselineskip plus.33\baselineskip minus.25\baselineskip + \begingroup + \chapentryfonts + \tocentry{#1}{\dopageno\bgroup#2\egroup}% + \endgroup + \nobreak\vskip .25\baselineskip plus.1\baselineskip +} + +\def\dosecentry#1#2{\begingroup + \secentryfonts \leftskip=\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsecentry#1#2{\begingroup + \subsecentryfonts \leftskip=2\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +\def\dosubsubsecentry#1#2{\begingroup + \subsubsecentryfonts \leftskip=3\tocindent + \tocentry{#1}{\dopageno\bgroup#2\egroup}% +\endgroup} + +% We use the same \entry macro as for the index entries. +\let\tocentry = \entry + +% Space between chapter (or whatever) number and the title. +\def\labelspace{\hskip1em \relax} + +\def\dopageno#1{{\rm #1}} +\def\doshortpageno#1{{\rm #1}} + +\def\chapentryfonts{\secfonts \rm} +\def\secentryfonts{\textfonts} +\def\subsecentryfonts{\textfonts} +\def\subsubsecentryfonts{\textfonts} + + +\message{environments,} +% @foo ... @end foo. + +% @point{}, @result{}, @expansion{}, @print{}, @equiv{}. +% +% Since these characters are used in examples, it should be an even number of +% \tt widths. Each \tt character is 1en, so two makes it 1em. +% +\def\point{$\star$} +\def\result{\leavevmode\raise.15ex\hbox to 1em{\hfil$\Rightarrow$\hfil}} +\def\expansion{\leavevmode\raise.1ex\hbox to 1em{\hfil$\mapsto$\hfil}} +\def\print{\leavevmode\lower.1ex\hbox to 1em{\hfil$\dashv$\hfil}} +\def\equiv{\leavevmode\lower.1ex\hbox to 1em{\hfil$\ptexequiv$\hfil}} + +% The @error{} command. +% Adapted from the TeXbook's \boxit. +% +\newbox\errorbox +% +{\tentt \global\dimen0 = 3em}% Width of the box. +\dimen2 = .55pt % Thickness of rules +% The text. (`r' is open on the right, `e' somewhat less so on the left.) +\setbox0 = \hbox{\kern-.75pt \reducedsf error\kern-1.5pt} +% +\setbox\errorbox=\hbox to \dimen0{\hfil + \hsize = \dimen0 \advance\hsize by -5.8pt % Space to left+right. + \advance\hsize by -2\dimen2 % Rules. + \vbox{% + \hrule height\dimen2 + \hbox{\vrule width\dimen2 \kern3pt % Space to left of text. + \vtop{\kern2.4pt \box0 \kern2.4pt}% Space above/below. + \kern3pt\vrule width\dimen2}% Space to right. + \hrule height\dimen2} + \hfil} +% +\def\error{\leavevmode\lower.7ex\copy\errorbox} + +% @tex ... @end tex escapes into raw Tex temporarily. +% One exception: @ is still an escape character, so that @end tex works. +% But \@ or @@ will get a plain tex @ character. + +\envdef\tex{% + \catcode `\\=0 \catcode `\{=1 \catcode `\}=2 + \catcode `\$=3 \catcode `\&=4 \catcode `\#=6 + \catcode `\^=7 \catcode `\_=8 \catcode `\~=\active \let~=\tie + \catcode `\%=14 + \catcode `\+=\other + \catcode `\"=\other + \catcode `\|=\other + \catcode `\<=\other + \catcode `\>=\other + \escapechar=`\\ + % + \let\b=\ptexb + \let\bullet=\ptexbullet + \let\c=\ptexc + \let\,=\ptexcomma + \let\.=\ptexdot + \let\dots=\ptexdots + \let\equiv=\ptexequiv + \let\!=\ptexexclam + \let\i=\ptexi + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \let\{=\ptexlbrace + \let\+=\tabalign + \let\}=\ptexrbrace + \let\/=\ptexslash + \let\*=\ptexstar + \let\t=\ptext + \let\frenchspacing=\plainfrenchspacing + % + \def\endldots{\mathinner{\ldots\ldots\ldots\ldots}}% + \def\enddots{\relax\ifmmode\endldots\else$\mathsurround=0pt \endldots\,$\fi}% + \def\@{@}% +} +% There is no need to define \Etex. + +% Define @lisp ... @end lisp. +% @lisp environment forms a group so it can rebind things, +% including the definition of @end lisp (which normally is erroneous). + +% Amount to narrow the margins by for @lisp. +\newskip\lispnarrowing \lispnarrowing=0.4in + +% This is the definition that ^^M gets inside @lisp, @example, and other +% such environments. \null is better than a space, since it doesn't +% have any width. +\def\lisppar{\null\endgraf} + +% This space is always present above and below environments. +\newskip\envskipamount \envskipamount = 0pt + +% Make spacing and below environment symmetrical. We use \parskip here +% to help in doing that, since in @example-like environments \parskip +% is reset to zero; thus the \afterenvbreak inserts no space -- but the +% start of the next paragraph will insert \parskip. +% +\def\aboveenvbreak{{% + % =10000 instead of <10000 because of a special case in \itemzzz and + % \sectionheading, q.v. + \ifnum \lastpenalty=10000 \else + \advance\envskipamount by \parskip + \endgraf + \ifdim\lastskip<\envskipamount + \removelastskip + % it's not a good place to break if the last penalty was \nobreak + % or better ... + \ifnum\lastpenalty<10000 \penalty-50 \fi + \vskip\envskipamount + \fi + \fi +}} + +\let\afterenvbreak = \aboveenvbreak + +% \nonarrowing is a flag. If "set", @lisp etc don't narrow margins; it will +% also clear it, so that its embedded environments do the narrowing again. +\let\nonarrowing=\relax + +% @cartouche ... @end cartouche: draw rectangle w/rounded corners around +% environment contents. +\font\circle=lcircle10 +\newdimen\circthick +\newdimen\cartouter\newdimen\cartinner +\newskip\normbskip\newskip\normpskip\newskip\normlskip +\circthick=\fontdimen8\circle +% +\def\ctl{{\circle\char'013\hskip -6pt}}% 6pt from pl file: 1/2charwidth +\def\ctr{{\hskip 6pt\circle\char'010}} +\def\cbl{{\circle\char'012\hskip -6pt}} +\def\cbr{{\hskip 6pt\circle\char'011}} +\def\carttop{\hbox to \cartouter{\hskip\lskip + \ctl\leaders\hrule height\circthick\hfil\ctr + \hskip\rskip}} +\def\cartbot{\hbox to \cartouter{\hskip\lskip + \cbl\leaders\hrule height\circthick\hfil\cbr + \hskip\rskip}} +% +\newskip\lskip\newskip\rskip + +\envdef\cartouche{% + \ifhmode\par\fi % can't be in the midst of a paragraph. + \startsavinginserts + \lskip=\leftskip \rskip=\rightskip + \leftskip=0pt\rightskip=0pt % we want these *outside*. + \cartinner=\hsize \advance\cartinner by-\lskip + \advance\cartinner by-\rskip + \cartouter=\hsize + \advance\cartouter by 18.4pt % allow for 3pt kerns on either + % side, and for 6pt waste from + % each corner char, and rule thickness + \normbskip=\baselineskip \normpskip=\parskip \normlskip=\lineskip + % Flag to tell @lisp, etc., not to narrow margin. + \let\nonarrowing = t% + \vbox\bgroup + \baselineskip=0pt\parskip=0pt\lineskip=0pt + \carttop + \hbox\bgroup + \hskip\lskip + \vrule\kern3pt + \vbox\bgroup + \kern3pt + \hsize=\cartinner + \baselineskip=\normbskip + \lineskip=\normlskip + \parskip=\normpskip + \vskip -\parskip + \comment % For explanation, see the end of \def\group. +} +\def\Ecartouche{% + \ifhmode\par\fi + \kern3pt + \egroup + \kern3pt\vrule + \hskip\rskip + \egroup + \cartbot + \egroup + \checkinserts +} + + +% This macro is called at the beginning of all the @example variants, +% inside a group. +\def\nonfillstart{% + \aboveenvbreak + \hfuzz = 12pt % Don't be fussy + \sepspaces % Make spaces be word-separators rather than space tokens. + \let\par = \lisppar % don't ignore blank lines + \obeylines % each line of input is a line of output + \parskip = 0pt + \parindent = 0pt + \emergencystretch = 0pt % don't try to avoid overfull boxes + \ifx\nonarrowing\relax + \advance \leftskip by \lispnarrowing + \exdentamount=\lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \let\exdent=\nofillexdent +} + +% If you want all examples etc. small: @set dispenvsize small. +% If you want even small examples the full size: @set dispenvsize nosmall. +% This affects the following displayed environments: +% @example, @display, @format, @lisp +% +\def\smallword{small} +\def\nosmallword{nosmall} +\let\SETdispenvsize\relax +\def\setnormaldispenv{% + \ifx\SETdispenvsize\smallword + % end paragraph for sake of leading, in case document has no blank + % line. This is redundant with what happens in \aboveenvbreak, but + % we need to do it before changing the fonts, and it's inconvenient + % to change the fonts afterward. + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} +\def\setsmalldispenv{% + \ifx\SETdispenvsize\nosmallword + \else + \ifnum \lastpenalty=10000 \else \endgraf \fi + \smallexamplefonts \rm + \fi +} + +% We often define two environments, @foo and @smallfoo. +% Let's do it by one command: +\def\makedispenv #1#2{ + \expandafter\envdef\csname#1\endcsname {\setnormaldispenv #2} + \expandafter\envdef\csname small#1\endcsname {\setsmalldispenv #2} + \expandafter\let\csname E#1\endcsname \afterenvbreak + \expandafter\let\csname Esmall#1\endcsname \afterenvbreak +} + +% Define two synonyms: +\def\maketwodispenvs #1#2#3{ + \makedispenv{#1}{#3} + \makedispenv{#2}{#3} +} + +% @lisp: indented, narrowed, typewriter font; @example: same as @lisp. +% +% @smallexample and @smalllisp: use smaller fonts. +% Originally contributed by Pavel@xerox. +% +\maketwodispenvs {lisp}{example}{% + \nonfillstart + \tt\quoteexpand + \let\kbdfont = \kbdexamplefont % Allow @kbd to do something special. + \gobble % eat return +} +% @display/@smalldisplay: same as @lisp except keep current font. +% +\makedispenv {display}{% + \nonfillstart + \gobble +} + +% @format/@smallformat: same as @display except don't narrow margins. +% +\makedispenv{format}{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} + +% @flushleft: same as @format, but doesn't obey \SETdispenvsize. +\envdef\flushleft{% + \let\nonarrowing = t% + \nonfillstart + \gobble +} +\let\Eflushleft = \afterenvbreak + +% @flushright. +% +\envdef\flushright{% + \let\nonarrowing = t% + \nonfillstart + \advance\leftskip by 0pt plus 1fill + \gobble +} +\let\Eflushright = \afterenvbreak + + +% @quotation does normal linebreaking (hence we can't use \nonfillstart) +% and narrows the margins. We keep \parskip nonzero in general, since +% we're doing normal filling. So, when using \aboveenvbreak and +% \afterenvbreak, temporarily make \parskip 0. +% +\envdef\quotation{% + {\parskip=0pt \aboveenvbreak}% because \aboveenvbreak inserts \parskip + \parindent=0pt + % + % @cartouche defines \nonarrowing to inhibit narrowing at next level down. + \ifx\nonarrowing\relax + \advance\leftskip by \lispnarrowing + \advance\rightskip by \lispnarrowing + \exdentamount = \lispnarrowing + \else + \let\nonarrowing = \relax + \fi + \parsearg\quotationlabel +} + +% We have retained a nonzero parskip for the environment, since we're +% doing normal filling. +% +\def\Equotation{% + \par + \ifx\quotationauthor\undefined\else + % indent a bit. + \leftline{\kern 2\leftskip \sl ---\quotationauthor}% + \fi + {\parskip=0pt \afterenvbreak}% +} + +% If we're given an argument, typeset it in bold with a colon after. +\def\quotationlabel#1{% + \def\temp{#1}% + \ifx\temp\empty \else + {\bf #1: }% + \fi +} + + +% LaTeX-like @verbatim...@end verbatim and @verb{...} +% If we want to allow any as delimiter, +% we need the curly braces so that makeinfo sees the @verb command, eg: +% `@verbx...x' would look like the '@verbx' command. --janneke@gnu.org +% +% [Knuth]: Donald Ervin Knuth, 1996. The TeXbook. +% +% [Knuth] p.344; only we need to do the other characters Texinfo sets +% active too. Otherwise, they get lost as the first character on a +% verbatim line. +\def\dospecials{% + \do\ \do\\\do\{\do\}\do\$\do\&% + \do\#\do\^\do\^^K\do\_\do\^^A\do\%\do\~% + \do\<\do\>\do\|\do\@\do+\do\"% +} +% +% [Knuth] p. 380 +\def\uncatcodespecials{% + \def\do##1{\catcode`##1=\other}\dospecials} +% +% [Knuth] pp. 380,381,391 +% Disable Spanish ligatures ?` and !` of \tt font +\begingroup + \catcode`\`=\active\gdef`{\relax\lq} +\endgroup +% +% Setup for the @verb command. +% +% Eight spaces for a tab +\begingroup + \catcode`\^^I=\active + \gdef\tabeightspaces{\catcode`\^^I=\active\def^^I{\ \ \ \ \ \ \ \ }} +\endgroup +% +\def\setupverb{% + \tt % easiest (and conventionally used) font for verbatim + \def\par{\leavevmode\endgraf}% + \catcode`\`=\active + \tabeightspaces + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces +} + +% Setup for the @verbatim environment +% +% Real tab expansion +\newdimen\tabw \setbox0=\hbox{\tt\space} \tabw=8\wd0 % tab amount +% +\def\starttabbox{\setbox0=\hbox\bgroup} + +% Allow an option to not replace quotes with a regular directed right +% quote/apostrophe (char 0x27), but instead use the undirected quote +% from cmtt (char 0x0d). The undirected quote is ugly, so don't make it +% the default, but it works for pasting with more pdf viewers (at least +% evince), the lilypond developers report. xpdf does work with the +% regular 0x27. +% +\def\codequoteright{% + \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax + \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax + '% + \else \char'15 \fi + \else \char'15 \fi +} +% +% and a similar option for the left quote char vs. a grave accent. +% Modern fonts display ASCII 0x60 as a grave accent, so some people like +% the code environments to do likewise. +% +\def\codequoteleft{% + \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax + \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax + `% + \else \char'22 \fi + \else \char'22 \fi +} +% +\begingroup + \catcode`\^^I=\active + \gdef\tabexpand{% + \catcode`\^^I=\active + \def^^I{\leavevmode\egroup + \dimen0=\wd0 % the width so far, or since the previous tab + \divide\dimen0 by\tabw + \multiply\dimen0 by\tabw % compute previous multiple of \tabw + \advance\dimen0 by\tabw % advance to next multiple of \tabw + \wd0=\dimen0 \box0 \starttabbox + }% + } + \catcode`\'=\active + \gdef\rquoteexpand{\catcode\rquoteChar=\active \def'{\codequoteright}}% + % + \catcode`\`=\active + \gdef\lquoteexpand{\catcode\lquoteChar=\active \def`{\codequoteleft}}% + % + \gdef\quoteexpand{\rquoteexpand \lquoteexpand}% +\endgroup + +% start the verbatim environment. +\def\setupverbatim{% + \let\nonarrowing = t% + \nonfillstart + % Easiest (and conventionally used) font for verbatim + \tt + \def\par{\leavevmode\egroup\box0\endgraf}% + \catcode`\`=\active + \tabexpand + \quoteexpand + % Respect line breaks, + % print special symbols as themselves, and + % make each space count + % must do in this order: + \obeylines \uncatcodespecials \sepspaces + \everypar{\starttabbox}% +} + +% Do the @verb magic: verbatim text is quoted by unique +% delimiter characters. Before first delimiter expect a +% right brace, after last delimiter expect closing brace: +% +% \def\doverb'{'#1'}'{#1} +% +% [Knuth] p. 382; only eat outer {} +\begingroup + \catcode`[=1\catcode`]=2\catcode`\{=\other\catcode`\}=\other + \gdef\doverb{#1[\def\next##1#1}[##1\endgroup]\next] +\endgroup +% +\def\verb{\begingroup\setupverb\doverb} +% +% +% Do the @verbatim magic: define the macro \doverbatim so that +% the (first) argument ends when '@end verbatim' is reached, ie: +% +% \def\doverbatim#1@end verbatim{#1} +% +% For Texinfo it's a lot easier than for LaTeX, +% because texinfo's \verbatim doesn't stop at '\end{verbatim}': +% we need not redefine '\', '{' and '}'. +% +% Inspired by LaTeX's verbatim command set [latex.ltx] +% +\begingroup + \catcode`\ =\active + \obeylines % + % ignore everything up to the first ^^M, that's the newline at the end + % of the @verbatim input line itself. Otherwise we get an extra blank + % line in the output. + \xdef\doverbatim#1^^M#2@end verbatim{#2\noexpand\end\gobble verbatim}% + % We really want {...\end verbatim} in the body of the macro, but + % without the active space; thus we have to use \xdef and \gobble. +\endgroup +% +\envdef\verbatim{% + \setupverbatim\doverbatim +} +\let\Everbatim = \afterenvbreak + + +% @verbatiminclude FILE - insert text of file in verbatim environment. +% +\def\verbatiminclude{\parseargusing\filenamecatcodes\doverbatiminclude} +% +\def\doverbatiminclude#1{% + {% + \makevalueexpandable + \setupverbatim + \input #1 + \afterenvbreak + }% +} + +% @copying ... @end copying. +% Save the text away for @insertcopying later. +% +% We save the uninterpreted tokens, rather than creating a box. +% Saving the text in a box would be much easier, but then all the +% typesetting commands (@smallbook, font changes, etc.) have to be done +% beforehand -- and a) we want @copying to be done first in the source +% file; b) letting users define the frontmatter in as flexible order as +% possible is very desirable. +% +\def\copying{\checkenv{}\begingroup\scanargctxt\docopying} +\def\docopying#1@end copying{\endgroup\def\copyingtext{#1}} +% +\def\insertcopying{% + \begingroup + \parindent = 0pt % paragraph indentation looks wrong on title page + \scanexp\copyingtext + \endgroup +} + + +\message{defuns,} +% @defun etc. + +\newskip\defbodyindent \defbodyindent=.4in +\newskip\defargsindent \defargsindent=50pt +\newskip\deflastargmargin \deflastargmargin=18pt +\newcount\defunpenalty + +% Start the processing of @deffn: +\def\startdefun{% + \ifnum\lastpenalty<10000 + \medbreak + \defunpenalty=10003 % Will keep this @deffn together with the + % following @def command, see below. + \else + % If there are two @def commands in a row, we'll have a \nobreak, + % which is there to keep the function description together with its + % header. But if there's nothing but headers, we need to allow a + % break somewhere. Check specifically for penalty 10002, inserted + % by \printdefunline, instead of 10000, since the sectioning + % commands also insert a nobreak penalty, and we don't want to allow + % a break between a section heading and a defun. + % + % As a minor refinement, we avoid "club" headers by signalling + % with penalty of 10003 after the very first @deffn in the + % sequence (see above), and penalty of 10002 after any following + % @def command. + \ifnum\lastpenalty=10002 \penalty2000 \else \defunpenalty=10002 \fi + % + % Similarly, after a section heading, do not allow a break. + % But do insert the glue. + \medskip % preceded by discardable penalty, so not a breakpoint + \fi + % + \parindent=0in + \advance\leftskip by \defbodyindent + \exdentamount=\defbodyindent +} + +\def\dodefunx#1{% + % First, check whether we are in the right environment: + \checkenv#1% + % + % As above, allow line break if we have multiple x headers in a row. + % It's not a great place, though. + \ifnum\lastpenalty=10002 \penalty3000 \else \defunpenalty=10002 \fi + % + % And now, it's time to reuse the body of the original defun: + \expandafter\gobbledefun#1% +} +\def\gobbledefun#1\startdefun{} + +% \printdefunline \deffnheader{text} +% +\def\printdefunline#1#2{% + \begingroup + % call \deffnheader: + #1#2 \endheader + % common ending: + \interlinepenalty = 10000 + \advance\rightskip by 0pt plus 1fil + \endgraf + \nobreak\vskip -\parskip + \penalty\defunpenalty % signal to \startdefun and \dodefunx + % Some of the @defun-type tags do not enable magic parentheses, + % rendering the following check redundant. But we don't optimize. + \checkparencounts + \endgroup +} + +\def\Edefun{\endgraf\medbreak} + +% \makedefun{deffn} creates \deffn, \deffnx and \Edeffn; +% the only thing remainnig is to define \deffnheader. +% +\def\makedefun#1{% + \expandafter\let\csname E#1\endcsname = \Edefun + \edef\temp{\noexpand\domakedefun + \makecsname{#1}\makecsname{#1x}\makecsname{#1header}}% + \temp +} + +% \domakedefun \deffn \deffnx \deffnheader +% +% Define \deffn and \deffnx, without parameters. +% \deffnheader has to be defined explicitly. +% +\def\domakedefun#1#2#3{% + \envdef#1{% + \startdefun + \parseargusing\activeparens{\printdefunline#3}% + }% + \def#2{\dodefunx#1}% + \def#3% +} + +%%% Untyped functions: + +% @deffn category name args +\makedefun{deffn}{\deffngeneral{}} + +% @deffn category class name args +\makedefun{defop}#1 {\defopon{#1\ \putwordon}} + +% \defopon {category on}class name args +\def\defopon#1#2 {\deffngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deffngeneral {subind}category name args +% +\def\deffngeneral#1#2 #3 #4\endheader{% + % Remember that \dosubind{fn}{foo}{} is equivalent to \doind{fn}{foo}. + \dosubind{fn}{\code{#3}}{#1}% + \defname{#2}{}{#3}\magicamp\defunargs{#4\unskip}% +} + +%%% Typed functions: + +% @deftypefn category type name args +\makedefun{deftypefn}{\deftypefngeneral{}} + +% @deftypeop category class type name args +\makedefun{deftypeop}#1 {\deftypeopon{#1\ \putwordon}} + +% \deftypeopon {category on}class type name args +\def\deftypeopon#1#2 {\deftypefngeneral{\putwordon\ \code{#2}}{#1\ \code{#2}} } + +% \deftypefngeneral {subind}category type name args +% +\def\deftypefngeneral#1#2 #3 #4 #5\endheader{% + \dosubind{fn}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Typed variables: + +% @deftypevr category type var args +\makedefun{deftypevr}{\deftypecvgeneral{}} + +% @deftypecv category class type var args +\makedefun{deftypecv}#1 {\deftypecvof{#1\ \putwordof}} + +% \deftypecvof {category of}class type var args +\def\deftypecvof#1#2 {\deftypecvgeneral{\putwordof\ \code{#2}}{#1\ \code{#2}} } + +% \deftypecvgeneral {subind}category type var args +% +\def\deftypecvgeneral#1#2 #3 #4 #5\endheader{% + \dosubind{vr}{\code{#4}}{#1}% + \defname{#2}{#3}{#4}\defunargs{#5\unskip}% +} + +%%% Untyped variables: + +% @defvr category var args +\makedefun{defvr}#1 {\deftypevrheader{#1} {} } + +% @defcv category class var args +\makedefun{defcv}#1 {\defcvof{#1\ \putwordof}} + +% \defcvof {category of}class var args +\def\defcvof#1#2 {\deftypecvof{#1}#2 {} } + +%%% Type: +% @deftp category name args +\makedefun{deftp}#1 #2 #3\endheader{% + \doind{tp}{\code{#2}}% + \defname{#1}{}{#2}\defunargs{#3\unskip}% +} + +% Remaining @defun-like shortcuts: +\makedefun{defun}{\deffnheader{\putwordDeffunc} } +\makedefun{defmac}{\deffnheader{\putwordDefmac} } +\makedefun{defspec}{\deffnheader{\putwordDefspec} } +\makedefun{deftypefun}{\deftypefnheader{\putwordDeffunc} } +\makedefun{defvar}{\defvrheader{\putwordDefvar} } +\makedefun{defopt}{\defvrheader{\putwordDefopt} } +\makedefun{deftypevar}{\deftypevrheader{\putwordDefvar} } +\makedefun{defmethod}{\defopon\putwordMethodon} +\makedefun{deftypemethod}{\deftypeopon\putwordMethodon} +\makedefun{defivar}{\defcvof\putwordInstanceVariableof} +\makedefun{deftypeivar}{\deftypecvof\putwordInstanceVariableof} + +% \defname, which formats the name of the @def (not the args). +% #1 is the category, such as "Function". +% #2 is the return type, if any. +% #3 is the function name. +% +% We are followed by (but not passed) the arguments, if any. +% +\def\defname#1#2#3{% + % Get the values of \leftskip and \rightskip as they were outside the @def... + \advance\leftskip by -\defbodyindent + % + % How we'll format the type name. Putting it in brackets helps + % distinguish it from the body text that may end up on the next line + % just below it. + \def\temp{#1}% + \setbox0=\hbox{\kern\deflastargmargin \ifx\temp\empty\else [\rm\temp]\fi} + % + % Figure out line sizes for the paragraph shape. + % The first line needs space for \box0; but if \rightskip is nonzero, + % we need only space for the part of \box0 which exceeds it: + \dimen0=\hsize \advance\dimen0 by -\wd0 \advance\dimen0 by \rightskip + % The continuations: + \dimen2=\hsize \advance\dimen2 by -\defargsindent + % (plain.tex says that \dimen1 should be used only as global.) + \parshape 2 0in \dimen0 \defargsindent \dimen2 + % + % Put the type name to the right margin. + \noindent + \hbox to 0pt{% + \hfil\box0 \kern-\hsize + % \hsize has to be shortened this way: + \kern\leftskip + % Intentionally do not respect \rightskip, since we need the space. + }% + % + % Allow all lines to be underfull without complaint: + \tolerance=10000 \hbadness=10000 + \exdentamount=\defbodyindent + {% + % defun fonts. We use typewriter by default (used to be bold) because: + % . we're printing identifiers, they should be in tt in principle. + % . in languages with many accents, such as Czech or French, it's + % common to leave accents off identifiers. The result looks ok in + % tt, but exceedingly strange in rm. + % . we don't want -- and --- to be treated as ligatures. + % . this still does not fix the ?` and !` ligatures, but so far no + % one has made identifiers using them :). + \df \tt + \def\temp{#2}% return value type + \ifx\temp\empty\else \tclose{\temp} \fi + #3% output function name + }% + {\rm\enskip}% hskip 0.5 em of \tenrm + % + \boldbrax + % arguments will be output next, if any. +} + +% Print arguments in slanted roman (not ttsl), inconsistently with using +% tt for the name. This is because literal text is sometimes needed in +% the argument list (groff manual), and ttsl and tt are not very +% distinguishable. Prevent hyphenation at `-' chars. +% +\def\defunargs#1{% + % use sl by default (not ttsl), + % tt for the names. + \df \sl \hyphenchar\font=0 + % + % On the other hand, if an argument has two dashes (for instance), we + % want a way to get ttsl. Let's try @var for that. + \let\var=\ttslanted + #1% + \sl\hyphenchar\font=45 +} + +% We want ()&[] to print specially on the defun line. +% +\def\activeparens{% + \catcode`\(=\active \catcode`\)=\active + \catcode`\[=\active \catcode`\]=\active + \catcode`\&=\active +} + +% Make control sequences which act like normal parenthesis chars. +\let\lparen = ( \let\rparen = ) + +% Be sure that we always have a definition for `(', etc. For example, +% if the fn name has parens in it, \boldbrax will not be in effect yet, +% so TeX would otherwise complain about undefined control sequence. +{ + \activeparens + \global\let(=\lparen \global\let)=\rparen + \global\let[=\lbrack \global\let]=\rbrack + \global\let& = \& + + \gdef\boldbrax{\let(=\opnr\let)=\clnr\let[=\lbrb\let]=\rbrb} + \gdef\magicamp{\let&=\amprm} +} + +\newcount\parencount + +% If we encounter &foo, then turn on ()-hacking afterwards +\newif\ifampseen +\def\amprm#1 {\ampseentrue{\bf\ }} + +\def\parenfont{% + \ifampseen + % At the first level, print parens in roman, + % otherwise use the default font. + \ifnum \parencount=1 \rm \fi + \else + % The \sf parens (in \boldbrax) actually are a little bolder than + % the contained text. This is especially needed for [ and ] . + \sf + \fi +} +\def\infirstlevel#1{% + \ifampseen + \ifnum\parencount=1 + #1% + \fi + \fi +} +\def\bfafterword#1 {#1 \bf} + +\def\opnr{% + \global\advance\parencount by 1 + {\parenfont(}% + \infirstlevel \bfafterword +} +\def\clnr{% + {\parenfont)}% + \infirstlevel \sl + \global\advance\parencount by -1 +} + +\newcount\brackcount +\def\lbrb{% + \global\advance\brackcount by 1 + {\bf[}% +} +\def\rbrb{% + {\bf]}% + \global\advance\brackcount by -1 +} + +\def\checkparencounts{% + \ifnum\parencount=0 \else \badparencount \fi + \ifnum\brackcount=0 \else \badbrackcount \fi +} +% these should not use \errmessage; the glibc manual, at least, actually +% has such constructs (when documenting function pointers). +\def\badparencount{% + \message{Warning: unbalanced parentheses in @def...}% + \global\parencount=0 +} +\def\badbrackcount{% + \message{Warning: unbalanced square brackets in @def...}% + \global\brackcount=0 +} + + +\message{macros,} +% @macro. + +% To do this right we need a feature of e-TeX, \scantokens, +% which we arrange to emulate with a temporary file in ordinary TeX. +\ifx\eTeXversion\undefined + \newwrite\macscribble + \def\scantokens#1{% + \toks0={#1}% + \immediate\openout\macscribble=\jobname.tmp + \immediate\write\macscribble{\the\toks0}% + \immediate\closeout\macscribble + \input \jobname.tmp + } +\fi + +\def\scanmacro#1{% + \begingroup + \newlinechar`\^^M + \let\xeatspaces\eatspaces + % Undo catcode changes of \startcontents and \doprintindex + % When called from @insertcopying or (short)caption, we need active + % backslash to get it printed correctly. Previously, we had + % \catcode`\\=\other instead. We'll see whether a problem appears + % with macro expansion. --kasal, 19aug04 + \catcode`\@=0 \catcode`\\=\active \escapechar=`\@ + % ... and \example + \spaceisspace + % + % Append \endinput to make sure that TeX does not see the ending newline. + % I've verified that it is necessary both for e-TeX and for ordinary TeX + % --kasal, 29nov03 + \scantokens{#1\endinput}% + \endgroup +} + +\def\scanexp#1{% + \edef\temp{\noexpand\scanmacro{#1}}% + \temp +} + +\newcount\paramno % Count of parameters +\newtoks\macname % Macro name +\newif\ifrecursive % Is it recursive? + +% List of all defined macros in the form +% \definedummyword\macro1\definedummyword\macro2... +% Currently is also contains all @aliases; the list can be split +% if there is a need. +\def\macrolist{} + +% Add the macro to \macrolist +\def\addtomacrolist#1{\expandafter \addtomacrolistxxx \csname#1\endcsname} +\def\addtomacrolistxxx#1{% + \toks0 = \expandafter{\macrolist\definedummyword#1}% + \xdef\macrolist{\the\toks0}% +} + +% Utility routines. +% This does \let #1 = #2, with \csnames; that is, +% \let \csname#1\endcsname = \csname#2\endcsname +% (except of course we have to play expansion games). +% +\def\cslet#1#2{% + \expandafter\let + \csname#1\expandafter\endcsname + \csname#2\endcsname +} + +% Trim leading and trailing spaces off a string. +% Concepts from aro-bend problem 15 (see CTAN). +{\catcode`\@=11 +\gdef\eatspaces #1{\expandafter\trim@\expandafter{#1 }} +\gdef\trim@ #1{\trim@@ @#1 @ #1 @ @@} +\gdef\trim@@ #1@ #2@ #3@@{\trim@@@\empty #2 @} +\def\unbrace#1{#1} +\unbrace{\gdef\trim@@@ #1 } #2@{#1} +} + +% Trim a single trailing ^^M off a string. +{\catcode`\^^M=\other \catcode`\Q=3% +\gdef\eatcr #1{\eatcra #1Q^^MQ}% +\gdef\eatcra#1^^MQ{\eatcrb#1Q}% +\gdef\eatcrb#1Q#2Q{#1}% +} + +% Macro bodies are absorbed as an argument in a context where +% all characters are catcode 10, 11 or 12, except \ which is active +% (as in normal texinfo). It is necessary to change the definition of \. + +% Non-ASCII encodings make 8-bit characters active, so un-activate +% them to avoid their expansion. Must do this non-globally, to +% confine the change to the current group. + +% It's necessary to have hard CRs when the macro is executed. This is +% done by making ^^M (\endlinechar) catcode 12 when reading the macro +% body, and then making it the \newlinechar in \scanmacro. + +\def\scanctxt{% + \catcode`\"=\other + \catcode`\+=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\@=\other + \catcode`\^=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\~=\other + \ifx\declaredencoding\ascii \else \setnonasciicharscatcodenonglobal\other \fi +} + +\def\scanargctxt{% + \scanctxt + \catcode`\\=\other + \catcode`\^^M=\other +} + +\def\macrobodyctxt{% + \scanctxt + \catcode`\{=\other + \catcode`\}=\other + \catcode`\^^M=\other + \usembodybackslash +} + +\def\macroargctxt{% + \scanctxt + \catcode`\\=\other +} + +% \mbodybackslash is the definition of \ in @macro bodies. +% It maps \foo\ => \csname macarg.foo\endcsname => #N +% where N is the macro parameter number. +% We define \csname macarg.\endcsname to be \realbackslash, so +% \\ in macro replacement text gets you a backslash. + +{\catcode`@=0 @catcode`@\=@active + @gdef@usembodybackslash{@let\=@mbodybackslash} + @gdef@mbodybackslash#1\{@csname macarg.#1@endcsname} +} +\expandafter\def\csname macarg.\endcsname{\realbackslash} + +\def\macro{\recursivefalse\parsearg\macroxxx} +\def\rmacro{\recursivetrue\parsearg\macroxxx} + +\def\macroxxx#1{% + \getargs{#1}% now \macname is the macname and \argl the arglist + \ifx\argl\empty % no arguments + \paramno=0% + \else + \expandafter\parsemargdef \argl;% + \fi + \if1\csname ismacro.\the\macname\endcsname + \message{Warning: redefining \the\macname}% + \else + \expandafter\ifx\csname \the\macname\endcsname \relax + \else \errmessage{Macro name \the\macname\space already defined}\fi + \global\cslet{macsave.\the\macname}{\the\macname}% + \global\expandafter\let\csname ismacro.\the\macname\endcsname=1% + \addtomacrolist{\the\macname}% + \fi + \begingroup \macrobodyctxt + \ifrecursive \expandafter\parsermacbody + \else \expandafter\parsemacbody + \fi} + +\parseargdef\unmacro{% + \if1\csname ismacro.#1\endcsname + \global\cslet{#1}{macsave.#1}% + \global\expandafter\let \csname ismacro.#1\endcsname=0% + % Remove the macro name from \macrolist: + \begingroup + \expandafter\let\csname#1\endcsname \relax + \let\definedummyword\unmacrodo + \xdef\macrolist{\macrolist}% + \endgroup + \else + \errmessage{Macro #1 not defined}% + \fi +} + +% Called by \do from \dounmacro on each macro. The idea is to omit any +% macro definitions that have been changed to \relax. +% +\def\unmacrodo#1{% + \ifx #1\relax + % remove this + \else + \noexpand\definedummyword \noexpand#1% + \fi +} + +% This makes use of the obscure feature that if the last token of a +% is #, then the preceding argument is delimited by +% an opening brace, and that opening brace is not consumed. +\def\getargs#1{\getargsxxx#1{}} +\def\getargsxxx#1#{\getmacname #1 \relax\getmacargs} +\def\getmacname #1 #2\relax{\macname={#1}} +\def\getmacargs#1{\def\argl{#1}} + +% Parse the optional {params} list. Set up \paramno and \paramlist +% so \defmacro knows what to do. Define \macarg.blah for each blah +% in the params list, to be ##N where N is the position in that list. +% That gets used by \mbodybackslash (above). + +% We need to get `macro parameter char #' into several definitions. +% The technique used is stolen from LaTeX: let \hash be something +% unexpandable, insert that wherever you need a #, and then redefine +% it to # just before using the token list produced. +% +% The same technique is used to protect \eatspaces till just before +% the macro is used. + +\def\parsemargdef#1;{\paramno=0\def\paramlist{}% + \let\hash\relax\let\xeatspaces\relax\parsemargdefxxx#1,;,} +\def\parsemargdefxxx#1,{% + \if#1;\let\next=\relax + \else \let\next=\parsemargdefxxx + \advance\paramno by 1% + \expandafter\edef\csname macarg.\eatspaces{#1}\endcsname + {\xeatspaces{\hash\the\paramno}}% + \edef\paramlist{\paramlist\hash\the\paramno,}% + \fi\next} + +% These two commands read recursive and nonrecursive macro bodies. +% (They're different since rec and nonrec macros end differently.) + +\long\def\parsemacbody#1@end macro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% +\long\def\parsermacbody#1@end rmacro% +{\xdef\temp{\eatcr{#1}}\endgroup\defmacro}% + +% This defines the macro itself. There are six cases: recursive and +% nonrecursive macros of zero, one, and many arguments. +% Much magic with \expandafter here. +% \xdef is used so that macro definitions will survive the file +% they're defined in; @include reads the file inside a group. +\def\defmacro{% + \let\hash=##% convert placeholders to macro parameter chars + \ifrecursive + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\scanmacro{\temp}}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup\noexpand\scanmacro{\temp}}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{\egroup\noexpand\scanmacro{\temp}}% + \fi + \else + \ifcase\paramno + % 0 + \expandafter\xdef\csname\the\macname\endcsname{% + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \or % 1 + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \noexpand\braceorline + \expandafter\noexpand\csname\the\macname xxx\endcsname}% + \expandafter\xdef\csname\the\macname xxx\endcsname##1{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \else % many + \expandafter\xdef\csname\the\macname\endcsname{% + \bgroup\noexpand\macroargctxt + \expandafter\noexpand\csname\the\macname xx\endcsname}% + \expandafter\xdef\csname\the\macname xx\endcsname##1{% + \expandafter\noexpand\csname\the\macname xxx\endcsname ##1,}% + \expandafter\expandafter + \expandafter\xdef + \expandafter\expandafter + \csname\the\macname xxx\endcsname + \paramlist{% + \egroup + \noexpand\norecurse{\the\macname}% + \noexpand\scanmacro{\temp}\egroup}% + \fi + \fi} + +\def\norecurse#1{\bgroup\cslet{#1}{macsave.#1}} + +% \braceorline decides whether the next nonwhitespace character is a +% {. If so it reads up to the closing }, if not, it reads the whole +% line. Whatever was read is then fed to the next control sequence +% as an argument (by \parsebrace or \parsearg) +\def\braceorline#1{\let\macnamexxx=#1\futurelet\nchar\braceorlinexxx} +\def\braceorlinexxx{% + \ifx\nchar\bgroup\else + \expandafter\parsearg + \fi \macnamexxx} + + +% @alias. +% We need some trickery to remove the optional spaces around the equal +% sign. Just make them active and then expand them all to nothing. +\def\alias{\parseargusing\obeyspaces\aliasxxx} +\def\aliasxxx #1{\aliasyyy#1\relax} +\def\aliasyyy #1=#2\relax{% + {% + \expandafter\let\obeyedspace=\empty + \addtomacrolist{#1}% + \xdef\next{\global\let\makecsname{#1}=\makecsname{#2}}% + }% + \next +} + + +\message{cross references,} + +\newwrite\auxfile +\newif\ifhavexrefs % True if xref values are known. +\newif\ifwarnedxrefs % True if we warned once that they aren't known. + +% @inforef is relatively simple. +\def\inforef #1{\inforefzzz #1,,,,**} +\def\inforefzzz #1,#2,#3,#4**{\putwordSee{} \putwordInfo{} \putwordfile{} \file{\ignorespaces #3{}}, + node \samp{\ignorespaces#1{}}} + +% @node's only job in TeX is to define \lastnode, which is used in +% cross-references. The @node line might or might not have commas, and +% might or might not have spaces before the first comma, like: +% @node foo , bar , ... +% We don't want such trailing spaces in the node name. +% +\parseargdef\node{\checkenv{}\donode #1 ,\finishnodeparse} +% +% also remove a trailing comma, in case of something like this: +% @node Help-Cross, , , Cross-refs +\def\donode#1 ,#2\finishnodeparse{\dodonode #1,\finishnodeparse} +\def\dodonode#1,#2\finishnodeparse{\gdef\lastnode{#1}} + +\let\nwnode=\node +\let\lastnode=\empty + +% Write a cross-reference definition for the current node. #1 is the +% type (Ynumbered, Yappendix, Ynothing). +% +\def\donoderef#1{% + \ifx\lastnode\empty\else + \setref{\lastnode}{#1}% + \global\let\lastnode=\empty + \fi +} + +% @anchor{NAME} -- define xref target at arbitrary point. +% +\newcount\savesfregister +% +\def\savesf{\relax \ifhmode \savesfregister=\spacefactor \fi} +\def\restoresf{\relax \ifhmode \spacefactor=\savesfregister \fi} +\def\anchor#1{\savesf \setref{#1}{Ynothing}\restoresf \ignorespaces} + +% \setref{NAME}{SNT} defines a cross-reference point NAME (a node or an +% anchor), which consists of three parts: +% 1) NAME-title - the current sectioning name taken from \lastsection, +% or the anchor name. +% 2) NAME-snt - section number and type, passed as the SNT arg, or +% empty for anchors. +% 3) NAME-pg - the page number. +% +% This is called from \donoderef, \anchor, and \dofloat. In the case of +% floats, there is an additional part, which is not written here: +% 4) NAME-lof - the text as it should appear in a @listoffloats. +% +\def\setref#1#2{% + \pdfmkdest{#1}% + \iflinks + {% + \atdummies % preserve commands, but don't expand them + \edef\writexrdef##1##2{% + \write\auxfile{@xrdef{#1-% #1 of \setref, expanded by the \edef + ##1}{##2}}% these are parameters of \writexrdef + }% + \toks0 = \expandafter{\lastsection}% + \immediate \writexrdef{title}{\the\toks0 }% + \immediate \writexrdef{snt}{\csname #2\endcsname}% \Ynumbered etc. + \safewhatsit{\writexrdef{pg}{\folio}}% will be written later, during \shipout + }% + \fi +} + +% @xref, @pxref, and @ref generate cross-references. For \xrefX, #1 is +% the node name, #2 the name of the Info cross-reference, #3 the printed +% node name, #4 the name of the Info file, #5 the name of the printed +% manual. All but the node name can be omitted. +% +\def\pxref#1{\putwordsee{} \xrefX[#1,,,,,,,]} +\def\xref#1{\putwordSee{} \xrefX[#1,,,,,,,]} +\def\ref#1{\xrefX[#1,,,,,,,]} +\def\xrefX[#1,#2,#3,#4,#5,#6]{\begingroup + \unsepspaces + \def\printedmanual{\ignorespaces #5}% + \def\printedrefname{\ignorespaces #3}% + \setbox1=\hbox{\printedmanual\unskip}% + \setbox0=\hbox{\printedrefname\unskip}% + \ifdim \wd0 = 0pt + % No printed node name was explicitly given. + \expandafter\ifx\csname SETxref-automatic-section-title\endcsname\relax + % Use the node name inside the square brackets. + \def\printedrefname{\ignorespaces #1}% + \else + % Use the actual chapter/section title appear inside + % the square brackets. Use the real section title if we have it. + \ifdim \wd1 > 0pt + % It is in another manual, so we don't have it. + \def\printedrefname{\ignorespaces #1}% + \else + \ifhavexrefs + % We know the real title if we have the xref values. + \def\printedrefname{\refx{#1-title}{}}% + \else + % Otherwise just copy the Info node name. + \def\printedrefname{\ignorespaces #1}% + \fi% + \fi + \fi + \fi + % + % Make link in pdf output. + \ifpdf + \leavevmode + \getfilename{#4}% + {\indexnofonts + \turnoffactive + % See comments at \activebackslashdouble. + {\activebackslashdouble \xdef\pdfxrefdest{#1}% + \backslashparens\pdfxrefdest}% + % + \ifnum\filenamelength>0 + \startlink attr{/Border [0 0 0]}% + goto file{\the\filename.pdf} name{\pdfxrefdest}% + \else + \startlink attr{/Border [0 0 0]}% + goto name{\pdfmkpgn{\pdfxrefdest}}% + \fi + }% + \setcolor{\linkcolor}% + \fi + % + % Float references are printed completely differently: "Figure 1.2" + % instead of "[somenode], p.3". We distinguish them by the + % LABEL-title being set to a magic string. + {% + % Have to otherify everything special to allow the \csname to + % include an _ in the xref name, etc. + \indexnofonts + \turnoffactive + \expandafter\global\expandafter\let\expandafter\Xthisreftitle + \csname XR#1-title\endcsname + }% + \iffloat\Xthisreftitle + % If the user specified the print name (third arg) to the ref, + % print it instead of our usual "Figure 1.2". + \ifdim\wd0 = 0pt + \refx{#1-snt}{}% + \else + \printedrefname + \fi + % + % if the user also gave the printed manual name (fifth arg), append + % "in MANUALNAME". + \ifdim \wd1 > 0pt + \space \putwordin{} \cite{\printedmanual}% + \fi + \else + % node/anchor (non-float) references. + % + % If we use \unhbox0 and \unhbox1 to print the node names, TeX does not + % insert empty discretionaries after hyphens, which means that it will + % not find a line break at a hyphen in a node names. Since some manuals + % are best written with fairly long node names, containing hyphens, this + % is a loss. Therefore, we give the text of the node name again, so it + % is as if TeX is seeing it for the first time. + \ifdim \wd1 > 0pt + \putwordSection{} ``\printedrefname'' \putwordin{} \cite{\printedmanual}% + \else + % _ (for example) has to be the character _ for the purposes of the + % control sequence corresponding to the node, but it has to expand + % into the usual \leavevmode...\vrule stuff for purposes of + % printing. So we \turnoffactive for the \refx-snt, back on for the + % printing, back off for the \refx-pg. + {\turnoffactive + % Only output a following space if the -snt ref is nonempty; for + % @unnumbered and @anchor, it won't be. + \setbox2 = \hbox{\ignorespaces \refx{#1-snt}{}}% + \ifdim \wd2 > 0pt \refx{#1-snt}\space\fi + }% + % output the `[mynode]' via a macro so it can be overridden. + \xrefprintnodename\printedrefname + % + % But we always want a comma and a space: + ,\space + % + % output the `page 3'. + \turnoffactive \putwordpage\tie\refx{#1-pg}{}% + \fi + \fi + \endlink +\endgroup} + +% This macro is called from \xrefX for the `[nodename]' part of xref +% output. It's a separate macro only so it can be changed more easily, +% since square brackets don't work well in some documents. Particularly +% one that Bob is working on :). +% +\def\xrefprintnodename#1{[#1]} + +% Things referred to by \setref. +% +\def\Ynothing{} +\def\Yomitfromtoc{} +\def\Ynumbered{% + \ifnum\secno=0 + \putwordChapter@tie \the\chapno + \else \ifnum\subsecno=0 + \putwordSection@tie \the\chapno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno + \else + \putwordSection@tie \the\chapno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} +\def\Yappendix{% + \ifnum\secno=0 + \putwordAppendix@tie @char\the\appendixno{}% + \else \ifnum\subsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno + \else \ifnum\subsubsecno=0 + \putwordSection@tie @char\the\appendixno.\the\secno.\the\subsecno + \else + \putwordSection@tie + @char\the\appendixno.\the\secno.\the\subsecno.\the\subsubsecno + \fi\fi\fi +} + +% Define \refx{NAME}{SUFFIX} to reference a cross-reference string named NAME. +% If its value is nonempty, SUFFIX is output afterward. +% +\def\refx#1#2{% + {% + \indexnofonts + \otherbackslash + \expandafter\global\expandafter\let\expandafter\thisrefX + \csname XR#1\endcsname + }% + \ifx\thisrefX\relax + % If not defined, say something at least. + \angleleft un\-de\-fined\angleright + \iflinks + \ifhavexrefs + \message{\linenumber Undefined cross reference `#1'.}% + \else + \ifwarnedxrefs\else + \global\warnedxrefstrue + \message{Cross reference values unknown; you must run TeX again.}% + \fi + \fi + \fi + \else + % It's defined, so just use it. + \thisrefX + \fi + #2% Output the suffix in any case. +} + +% This is the macro invoked by entries in the aux file. Usually it's +% just a \def (we prepend XR to the control sequence name to avoid +% collisions). But if this is a float type, we have more work to do. +% +\def\xrdef#1#2{% + {% The node name might contain 8-bit characters, which in our current + % implementation are changed to commands like @'e. Don't let these + % mess up the control sequence name. + \indexnofonts + \turnoffactive + \xdef\safexrefname{#1}% + }% + % + \expandafter\gdef\csname XR\safexrefname\endcsname{#2}% remember this xref + % + % Was that xref control sequence that we just defined for a float? + \expandafter\iffloat\csname XR\safexrefname\endcsname + % it was a float, and we have the (safe) float type in \iffloattype. + \expandafter\let\expandafter\floatlist + \csname floatlist\iffloattype\endcsname + % + % Is this the first time we've seen this float type? + \expandafter\ifx\floatlist\relax + \toks0 = {\do}% yes, so just \do + \else + % had it before, so preserve previous elements in list. + \toks0 = \expandafter{\floatlist\do}% + \fi + % + % Remember this xref in the control sequence \floatlistFLOATTYPE, + % for later use in \listoffloats. + \expandafter\xdef\csname floatlist\iffloattype\endcsname{\the\toks0 + {\safexrefname}}% + \fi +} + +% Read the last existing aux file, if any. No error if none exists. +% +\def\tryauxfile{% + \openin 1 \jobname.aux + \ifeof 1 \else + \readdatafile{aux}% + \global\havexrefstrue + \fi + \closein 1 +} + +\def\setupdatafile{% + \catcode`\^^@=\other + \catcode`\^^A=\other + \catcode`\^^B=\other + \catcode`\^^C=\other + \catcode`\^^D=\other + \catcode`\^^E=\other + \catcode`\^^F=\other + \catcode`\^^G=\other + \catcode`\^^H=\other + \catcode`\^^K=\other + \catcode`\^^L=\other + \catcode`\^^N=\other + \catcode`\^^P=\other + \catcode`\^^Q=\other + \catcode`\^^R=\other + \catcode`\^^S=\other + \catcode`\^^T=\other + \catcode`\^^U=\other + \catcode`\^^V=\other + \catcode`\^^W=\other + \catcode`\^^X=\other + \catcode`\^^Z=\other + \catcode`\^^[=\other + \catcode`\^^\=\other + \catcode`\^^]=\other + \catcode`\^^^=\other + \catcode`\^^_=\other + % It was suggested to set the catcode of ^ to 7, which would allow ^^e4 etc. + % in xref tags, i.e., node names. But since ^^e4 notation isn't + % supported in the main text, it doesn't seem desirable. Furthermore, + % that is not enough: for node names that actually contain a ^ + % character, we would end up writing a line like this: 'xrdef {'hat + % b-title}{'hat b} and \xrdef does a \csname...\endcsname on the first + % argument, and \hat is not an expandable control sequence. It could + % all be worked out, but why? Either we support ^^ or we don't. + % + % The other change necessary for this was to define \auxhat: + % \def\auxhat{\def^{'hat }}% extra space so ok if followed by letter + % and then to call \auxhat in \setq. + % + \catcode`\^=\other + % + % Special characters. Should be turned off anyway, but... + \catcode`\~=\other + \catcode`\[=\other + \catcode`\]=\other + \catcode`\"=\other + \catcode`\_=\other + \catcode`\|=\other + \catcode`\<=\other + \catcode`\>=\other + \catcode`\$=\other + \catcode`\#=\other + \catcode`\&=\other + \catcode`\%=\other + \catcode`+=\other % avoid \+ for paranoia even though we've turned it off + % + % This is to support \ in node names and titles, since the \ + % characters end up in a \csname. It's easier than + % leaving it active and making its active definition an actual \ + % character. What I don't understand is why it works in the *value* + % of the xrdef. Seems like it should be a catcode12 \, and that + % should not typeset properly. But it works, so I'm moving on for + % now. --karl, 15jan04. + \catcode`\\=\other + % + % Make the characters 128-255 be printing characters. + {% + \count1=128 + \def\loop{% + \catcode\count1=\other + \advance\count1 by 1 + \ifnum \count1<256 \loop \fi + }% + }% + % + % @ is our escape character in .aux files, and we need braces. + \catcode`\{=1 + \catcode`\}=2 + \catcode`\@=0 +} + +\def\readdatafile#1{% +\begingroup + \setupdatafile + \input\jobname.#1 +\endgroup} + + +\message{insertions,} +% including footnotes. + +\newcount \footnoteno + +% The trailing space in the following definition for supereject is +% vital for proper filling; pages come out unaligned when you do a +% pagealignmacro call if that space before the closing brace is +% removed. (Generally, numeric constants should always be followed by a +% space to prevent strange expansion errors.) +\def\supereject{\par\penalty -20000\footnoteno =0 } + +% @footnotestyle is meaningful for info output only. +\let\footnotestyle=\comment + +{\catcode `\@=11 +% +% Auto-number footnotes. Otherwise like plain. +\gdef\footnote{% + \let\indent=\ptexindent + \let\noindent=\ptexnoindent + \global\advance\footnoteno by \@ne + \edef\thisfootno{$^{\the\footnoteno}$}% + % + % In case the footnote comes at the end of a sentence, preserve the + % extra spacing after we do the footnote number. + \let\@sf\empty + \ifhmode\edef\@sf{\spacefactor\the\spacefactor}\ptexslash\fi + % + % Remove inadvertent blank space before typesetting the footnote number. + \unskip + \thisfootno\@sf + \dofootnote +}% + +% Don't bother with the trickery in plain.tex to not require the +% footnote text as a parameter. Our footnotes don't need to be so general. +% +% Oh yes, they do; otherwise, @ifset (and anything else that uses +% \parseargline) fails inside footnotes because the tokens are fixed when +% the footnote is read. --karl, 16nov96. +% +\gdef\dofootnote{% + \insert\footins\bgroup + % We want to typeset this text as a normal paragraph, even if the + % footnote reference occurs in (for example) a display environment. + % So reset some parameters. + \hsize=\pagewidth + \interlinepenalty\interfootnotelinepenalty + \splittopskip\ht\strutbox % top baseline for broken footnotes + \splitmaxdepth\dp\strutbox + \floatingpenalty\@MM + \leftskip\z@skip + \rightskip\z@skip + \spaceskip\z@skip + \xspaceskip\z@skip + \parindent\defaultparindent + % + \smallfonts \rm + % + % Because we use hanging indentation in footnotes, a @noindent appears + % to exdent this text, so make it be a no-op. makeinfo does not use + % hanging indentation so @noindent can still be needed within footnote + % text after an @example or the like (not that this is good style). + \let\noindent = \relax + % + % Hang the footnote text off the number. Use \everypar in case the + % footnote extends for more than one paragraph. + \everypar = {\hang}% + \textindent{\thisfootno}% + % + % Don't crash into the line above the footnote text. Since this + % expands into a box, it must come within the paragraph, lest it + % provide a place where TeX can split the footnote. + \footstrut + \futurelet\next\fo@t +} +}%end \catcode `\@=11 + +% In case a @footnote appears in a vbox, save the footnote text and create +% the real \insert just after the vbox finished. Otherwise, the insertion +% would be lost. +% Similarily, if a @footnote appears inside an alignment, save the footnote +% text to a box and make the \insert when a row of the table is finished. +% And the same can be done for other insert classes. --kasal, 16nov03. + +% Replace the \insert primitive by a cheating macro. +% Deeper inside, just make sure that the saved insertions are not spilled +% out prematurely. +% +\def\startsavinginserts{% + \ifx \insert\ptexinsert + \let\insert\saveinsert + \else + \let\checkinserts\relax + \fi +} + +% This \insert replacement works for both \insert\footins{foo} and +% \insert\footins\bgroup foo\egroup, but it doesn't work for \insert27{foo}. +% +\def\saveinsert#1{% + \edef\next{\noexpand\savetobox \makeSAVEname#1}% + \afterassignment\next + % swallow the left brace + \let\temp = +} +\def\makeSAVEname#1{\makecsname{SAVE\expandafter\gobble\string#1}} +\def\savetobox#1{\global\setbox#1 = \vbox\bgroup \unvbox#1} + +\def\checksaveins#1{\ifvoid#1\else \placesaveins#1\fi} + +\def\placesaveins#1{% + \ptexinsert \csname\expandafter\gobblesave\string#1\endcsname + {\box#1}% +} + +% eat @SAVE -- beware, all of them have catcode \other: +{ + \def\dospecials{\do S\do A\do V\do E} \uncatcodespecials % ;-) + \gdef\gobblesave @SAVE{} +} + +% initialization: +\def\newsaveins #1{% + \edef\next{\noexpand\newsaveinsX \makeSAVEname#1}% + \next +} +\def\newsaveinsX #1{% + \csname newbox\endcsname #1% + \expandafter\def\expandafter\checkinserts\expandafter{\checkinserts + \checksaveins #1}% +} + +% initialize: +\let\checkinserts\empty +\newsaveins\footins +\newsaveins\margin + + +% @image. We use the macros from epsf.tex to support this. +% If epsf.tex is not installed and @image is used, we complain. +% +% Check for and read epsf.tex up front. If we read it only at @image +% time, we might be inside a group, and then its definitions would get +% undone and the next image would fail. +\openin 1 = epsf.tex +\ifeof 1 \else + % Do not bother showing banner with epsf.tex v2.7k (available in + % doc/epsf.tex and on ctan). + \def\epsfannounce{\toks0 = }% + \input epsf.tex +\fi +\closein 1 +% +% We will only complain once about lack of epsf.tex. +\newif\ifwarnednoepsf +\newhelp\noepsfhelp{epsf.tex must be installed for images to + work. It is also included in the Texinfo distribution, or you can get + it from ftp://tug.org/tex/epsf.tex.} +% +\def\image#1{% + \ifx\epsfbox\undefined + \ifwarnednoepsf \else + \errhelp = \noepsfhelp + \errmessage{epsf.tex not found, images will be ignored}% + \global\warnednoepsftrue + \fi + \else + \imagexxx #1,,,,,\finish + \fi +} +% +% Arguments to @image: +% #1 is (mandatory) image filename; we tack on .eps extension. +% #2 is (optional) width, #3 is (optional) height. +% #4 is (ignored optional) html alt text. +% #5 is (ignored optional) extension. +% #6 is just the usual extra ignored arg for parsing this stuff. +\newif\ifimagevmode +\def\imagexxx#1,#2,#3,#4,#5,#6\finish{\begingroup + \catcode`\^^M = 5 % in case we're inside an example + \normalturnoffactive % allow _ et al. in names + % If the image is by itself, center it. + \ifvmode + \imagevmodetrue + \nobreak\bigskip + % Usually we'll have text after the image which will insert + % \parskip glue, so insert it here too to equalize the space + % above and below. + \nobreak\vskip\parskip + \nobreak + \line\bgroup + \fi + % + % Output the image. + \ifpdf + \dopdfimage{#1}{#2}{#3}% + \else + % \epsfbox itself resets \epsf?size at each figure. + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \epsfxsize=#2\relax \fi + \setbox0 = \hbox{\ignorespaces #3}\ifdim\wd0 > 0pt \epsfysize=#3\relax \fi + \epsfbox{#1.eps}% + \fi + % + \ifimagevmode \egroup \bigbreak \fi % space after the image +\endgroup} + + +% @float FLOATTYPE,LABEL,LOC ... @end float for displayed figures, tables, +% etc. We don't actually implement floating yet, we always include the +% float "here". But it seemed the best name for the future. +% +\envparseargdef\float{\eatcommaspace\eatcommaspace\dofloat#1, , ,\finish} + +% There may be a space before second and/or third parameter; delete it. +\def\eatcommaspace#1, {#1,} + +% #1 is the optional FLOATTYPE, the text label for this float, typically +% "Figure", "Table", "Example", etc. Can't contain commas. If omitted, +% this float will not be numbered and cannot be referred to. +% +% #2 is the optional xref label. Also must be present for the float to +% be referable. +% +% #3 is the optional positioning argument; for now, it is ignored. It +% will somehow specify the positions allowed to float to (here, top, bottom). +% +% We keep a separate counter for each FLOATTYPE, which we reset at each +% chapter-level command. +\let\resetallfloatnos=\empty +% +\def\dofloat#1,#2,#3,#4\finish{% + \let\thiscaption=\empty + \let\thisshortcaption=\empty + % + % don't lose footnotes inside @float. + % + % BEWARE: when the floats start float, we have to issue warning whenever an + % insert appears inside a float which could possibly float. --kasal, 26may04 + % + \startsavinginserts + % + % We can't be used inside a paragraph. + \par + % + \vtop\bgroup + \def\floattype{#1}% + \def\floatlabel{#2}% + \def\floatloc{#3}% we do nothing with this yet. + % + \ifx\floattype\empty + \let\safefloattype=\empty + \else + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + \fi + % + % If label is given but no type, we handle that as the empty type. + \ifx\floatlabel\empty \else + % We want each FLOATTYPE to be numbered separately (Figure 1, + % Table 1, Figure 2, ...). (And if no label, no number.) + % + \expandafter\getfloatno\csname\safefloattype floatno\endcsname + \global\advance\floatno by 1 + % + {% + % This magic value for \lastsection is output by \setref as the + % XREFLABEL-title value. \xrefX uses it to distinguish float + % labels (which have a completely different output format) from + % node and anchor labels. And \xrdef uses it to construct the + % lists of floats. + % + \edef\lastsection{\floatmagic=\safefloattype}% + \setref{\floatlabel}{Yfloat}% + }% + \fi + % + % start with \parskip glue, I guess. + \vskip\parskip + % + % Don't suppress indentation if a float happens to start a section. + \restorefirstparagraphindent +} + +% we have these possibilities: +% @float Foo,lbl & @caption{Cap}: Foo 1.1: Cap +% @float Foo,lbl & no caption: Foo 1.1 +% @float Foo & @caption{Cap}: Foo: Cap +% @float Foo & no caption: Foo +% @float ,lbl & Caption{Cap}: 1.1: Cap +% @float ,lbl & no caption: 1.1 +% @float & @caption{Cap}: Cap +% @float & no caption: +% +\def\Efloat{% + \let\floatident = \empty + % + % In all cases, if we have a float type, it comes first. + \ifx\floattype\empty \else \def\floatident{\floattype}\fi + % + % If we have an xref label, the number comes next. + \ifx\floatlabel\empty \else + \ifx\floattype\empty \else % if also had float type, need tie first. + \appendtomacro\floatident{\tie}% + \fi + % the number. + \appendtomacro\floatident{\chaplevelprefix\the\floatno}% + \fi + % + % Start the printed caption with what we've constructed in + % \floatident, but keep it separate; we need \floatident again. + \let\captionline = \floatident + % + \ifx\thiscaption\empty \else + \ifx\floatident\empty \else + \appendtomacro\captionline{: }% had ident, so need a colon between + \fi + % + % caption text. + \appendtomacro\captionline{\scanexp\thiscaption}% + \fi + % + % If we have anything to print, print it, with space before. + % Eventually this needs to become an \insert. + \ifx\captionline\empty \else + \vskip.5\parskip + \captionline + % + % Space below caption. + \vskip\parskip + \fi + % + % If have an xref label, write the list of floats info. Do this + % after the caption, to avoid chance of it being a breakpoint. + \ifx\floatlabel\empty \else + % Write the text that goes in the lof to the aux file as + % \floatlabel-lof. Besides \floatident, we include the short + % caption if specified, else the full caption if specified, else nothing. + {% + \atdummies + % + % since we read the caption text in the macro world, where ^^M + % is turned into a normal character, we have to scan it back, so + % we don't write the literal three characters "^^M" into the aux file. + \scanexp{% + \xdef\noexpand\gtemp{% + \ifx\thisshortcaption\empty + \thiscaption + \else + \thisshortcaption + \fi + }% + }% + \immediate\write\auxfile{@xrdef{\floatlabel-lof}{\floatident + \ifx\gtemp\empty \else : \gtemp \fi}}% + }% + \fi + \egroup % end of \vtop + % + % place the captured inserts + % + % BEWARE: when the floats start floating, we have to issue warning + % whenever an insert appears inside a float which could possibly + % float. --kasal, 26may04 + % + \checkinserts +} + +% Append the tokens #2 to the definition of macro #1, not expanding either. +% +\def\appendtomacro#1#2{% + \expandafter\def\expandafter#1\expandafter{#1#2}% +} + +% @caption, @shortcaption +% +\def\caption{\docaption\thiscaption} +\def\shortcaption{\docaption\thisshortcaption} +\def\docaption{\checkenv\float \bgroup\scanargctxt\defcaption} +\def\defcaption#1#2{\egroup \def#1{#2}} + +% The parameter is the control sequence identifying the counter we are +% going to use. Create it if it doesn't exist and assign it to \floatno. +\def\getfloatno#1{% + \ifx#1\relax + % Haven't seen this figure type before. + \csname newcount\endcsname #1% + % + % Remember to reset this floatno at the next chap. + \expandafter\gdef\expandafter\resetallfloatnos + \expandafter{\resetallfloatnos #1=0 }% + \fi + \let\floatno#1% +} + +% \setref calls this to get the XREFLABEL-snt value. We want an @xref +% to the FLOATLABEL to expand to "Figure 3.1". We call \setref when we +% first read the @float command. +% +\def\Yfloat{\floattype@tie \chaplevelprefix\the\floatno}% + +% Magic string used for the XREFLABEL-title value, so \xrefX can +% distinguish floats from other xref types. +\def\floatmagic{!!float!!} + +% #1 is the control sequence we are passed; we expand into a conditional +% which is true if #1 represents a float ref. That is, the magic +% \lastsection value which we \setref above. +% +\def\iffloat#1{\expandafter\doiffloat#1==\finish} +% +% #1 is (maybe) the \floatmagic string. If so, #2 will be the +% (safe) float type for this float. We set \iffloattype to #2. +% +\def\doiffloat#1=#2=#3\finish{% + \def\temp{#1}% + \def\iffloattype{#2}% + \ifx\temp\floatmagic +} + +% @listoffloats FLOATTYPE - print a list of floats like a table of contents. +% +\parseargdef\listoffloats{% + \def\floattype{#1}% floattype + {% + % the floattype might have accents or other special characters, + % but we need to use it in a control sequence name. + \indexnofonts + \turnoffactive + \xdef\safefloattype{\floattype}% + }% + % + % \xrdef saves the floats as a \do-list in \floatlistSAFEFLOATTYPE. + \expandafter\ifx\csname floatlist\safefloattype\endcsname \relax + \ifhavexrefs + % if the user said @listoffloats foo but never @float foo. + \message{\linenumber No `\safefloattype' floats to list.}% + \fi + \else + \begingroup + \leftskip=\tocindent % indent these entries like a toc + \let\do=\listoffloatsdo + \csname floatlist\safefloattype\endcsname + \endgroup + \fi +} + +% This is called on each entry in a list of floats. We're passed the +% xref label, in the form LABEL-title, which is how we save it in the +% aux file. We strip off the -title and look up \XRLABEL-lof, which +% has the text we're supposed to typeset here. +% +% Figures without xref labels will not be included in the list (since +% they won't appear in the aux file). +% +\def\listoffloatsdo#1{\listoffloatsdoentry#1\finish} +\def\listoffloatsdoentry#1-title\finish{{% + % Can't fully expand XR#1-lof because it can contain anything. Just + % pass the control sequence. On the other hand, XR#1-pg is just the + % page number, and we want to fully expand that so we can get a link + % in pdf output. + \toksA = \expandafter{\csname XR#1-lof\endcsname}% + % + % use the same \entry macro we use to generate the TOC and index. + \edef\writeentry{\noexpand\entry{\the\toksA}{\csname XR#1-pg\endcsname}}% + \writeentry +}} + + +\message{localization,} + +% @documentlanguage is usually given very early, just after +% @setfilename. If done too late, it may not override everything +% properly. Single argument is the language (de) or locale (de_DE) +% abbreviation. It would be nice if we could set up a hyphenation file. +% +{ + \catcode`\_ = \active + \globaldefs=1 +\parseargdef\documentlanguage{\begingroup + \let_=\normalunderscore % normal _ character for filenames + \tex % read txi-??.tex file in plain TeX. + % Read the file by the name they passed if it exists. + \openin 1 txi-#1.tex + \ifeof 1 + \documentlanguagetrywithoutunderscore{#1_\finish}% + \else + \input txi-#1.tex + \fi + \closein 1 + \endgroup +\endgroup} +} +% +% If they passed de_DE, and txi-de_DE.tex doesn't exist, +% try txi-de.tex. +% +\def\documentlanguagetrywithoutunderscore#1_#2\finish{% + \openin 1 txi-#1.tex + \ifeof 1 + \errhelp = \nolanghelp + \errmessage{Cannot read language file txi-#1.tex}% + \else + \input txi-#1.tex + \fi + \closein 1 +} +% +\newhelp\nolanghelp{The given language definition file cannot be found or +is empty. Maybe you need to install it? In the current directory +should work if nowhere else does.} + +% Set the catcode of characters 128 through 255 to the specified number. +% +\def\setnonasciicharscatcode#1{% + \count255=128 + \loop\ifnum\count255<256 + \global\catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +\def\setnonasciicharscatcodenonglobal#1{% + \count255=128 + \loop\ifnum\count255<256 + \catcode\count255=#1\relax + \advance\count255 by 1 + \repeat +} + +% @documentencoding sets the definition of non-ASCII characters +% according to the specified encoding. +% +\parseargdef\documentencoding{% + % Encoding being declared for the document. + \def\declaredencoding{\csname #1.enc\endcsname}% + % + % Supported encodings: names converted to tokens in order to be able + % to compare them with \ifx. + \def\ascii{\csname US-ASCII.enc\endcsname}% + \def\latnine{\csname ISO-8859-15.enc\endcsname}% + \def\latone{\csname ISO-8859-1.enc\endcsname}% + \def\lattwo{\csname ISO-8859-2.enc\endcsname}% + \def\utfeight{\csname UTF-8.enc\endcsname}% + % + \ifx \declaredencoding \ascii + \asciichardefs + % + \else \ifx \declaredencoding \lattwo + \setnonasciicharscatcode\active + \lattwochardefs + % + \else \ifx \declaredencoding \latone + \setnonasciicharscatcode\active + \latonechardefs + % + \else \ifx \declaredencoding \latnine + \setnonasciicharscatcode\active + \latninechardefs + % + \else \ifx \declaredencoding \utfeight + \setnonasciicharscatcode\active + \utfeightchardefs + % + \else + \message{Unknown document encoding #1, ignoring.}% + % + \fi % utfeight + \fi % latnine + \fi % latone + \fi % lattwo + \fi % ascii +} + +% A message to be logged when using a character that isn't available +% the default font encoding (OT1). +% +\def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} + +% Take account of \c (plain) vs. \, (Texinfo) difference. +\def\cedilla#1{\ifx\c\ptexc\c{#1}\else\,{#1}\fi} + +% First, make active non-ASCII characters in order for them to be +% correctly categorized when TeX reads the replacement text of +% macros containing the character definitions. +\setnonasciicharscatcode\active +% +% Latin1 (ISO-8859-1) character definitions. +\def\latonechardefs{% + \gdef^^a0{~} + \gdef^^a1{\exclamdown} + \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a3{{\pounds}} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\missingcharmsg{YEN SIGN}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} + \gdef^^aa{\ordf} + \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^ac{$\lnot$} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} + \gdef^^af{\={}} + % + \gdef^^b0{\textdegree} + \gdef^^b1{$\pm$} + \gdef^^b2{$^2$} + \gdef^^b3{$^3$} + \gdef^^b4{\'{}} + \gdef^^b5{$\mu$} + \gdef^^b6{\P} + % + \gdef^^b7{$^.$} + \gdef^^b8{\cedilla\ } + \gdef^^b9{$^1$} + \gdef^^ba{\ordm} + % + \gdef^^bb{\missingcharmsg{RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^bc{$1\over4$} + \gdef^^bd{$1\over2$} + \gdef^^be{$3\over4$} + \gdef^^bf{\questiondown} + % + \gdef^^c0{\`A} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\~A} + \gdef^^c4{\"A} + \gdef^^c5{\ringaccent A} + \gdef^^c6{\AE} + \gdef^^c7{\cedilla C} + \gdef^^c8{\`E} + \gdef^^c9{\'E} + \gdef^^ca{\^E} + \gdef^^cb{\"E} + \gdef^^cc{\`I} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\"I} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER ETH}} + \gdef^^d1{\~N} + \gdef^^d2{\`O} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\~O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\O} + \gdef^^d9{\`U} + \gdef^^da{\'U} + \gdef^^db{\^U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\missingcharmsg{LATIN CAPITAL LETTER THORN}} + \gdef^^df{\ss} + % + \gdef^^e0{\`a} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\~a} + \gdef^^e4{\"a} + \gdef^^e5{\ringaccent a} + \gdef^^e6{\ae} + \gdef^^e7{\cedilla c} + \gdef^^e8{\`e} + \gdef^^e9{\'e} + \gdef^^ea{\^e} + \gdef^^eb{\"e} + \gdef^^ec{\`{\dotless i}} + \gdef^^ed{\'{\dotless i}} + \gdef^^ee{\^{\dotless i}} + \gdef^^ef{\"{\dotless i}} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER ETH}} + \gdef^^f1{\~n} + \gdef^^f2{\`o} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\~o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\o} + \gdef^^f9{\`u} + \gdef^^fa{\'u} + \gdef^^fb{\^u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\missingcharmsg{LATIN SMALL LETTER THORN}} + \gdef^^ff{\"y} +} + +% Latin9 (ISO-8859-15) encoding character definitions. +\def\latninechardefs{% + % Encoding is almost identical to Latin1. + \latonechardefs + % + \gdef^^a4{\euro} + \gdef^^a6{\v S} + \gdef^^a8{\v s} + \gdef^^b4{\v Z} + \gdef^^b8{\v z} + \gdef^^bc{\OE} + \gdef^^bd{\oe} + \gdef^^be{\"Y} +} + +% Latin2 (ISO-8859-2) character definitions. +\def\lattwochardefs{% + \gdef^^a0{~} + \gdef^^a1{\missingcharmsg{LATIN CAPITAL LETTER A WITH OGONEK}} + \gdef^^a2{\u{}} + \gdef^^a3{\L} + \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} + \gdef^^a5{\v L} + \gdef^^a6{\'S} + \gdef^^a7{\S} + \gdef^^a8{\"{}} + \gdef^^a9{\v S} + \gdef^^aa{\cedilla S} + \gdef^^ab{\v T} + \gdef^^ac{\'Z} + \gdef^^ad{\-} + \gdef^^ae{\v Z} + \gdef^^af{\dotaccent Z} + % + \gdef^^b0{\textdegree} + \gdef^^b1{\missingcharmsg{LATIN SMALL LETTER A WITH OGONEK}} + \gdef^^b2{\missingcharmsg{OGONEK}} + \gdef^^b3{\l} + \gdef^^b4{\'{}} + \gdef^^b5{\v l} + \gdef^^b6{\'s} + \gdef^^b7{\v{}} + \gdef^^b8{\cedilla\ } + \gdef^^b9{\v s} + \gdef^^ba{\cedilla s} + \gdef^^bb{\v t} + \gdef^^bc{\'z} + \gdef^^bd{\H{}} + \gdef^^be{\v z} + \gdef^^bf{\dotaccent z} + % + \gdef^^c0{\'R} + \gdef^^c1{\'A} + \gdef^^c2{\^A} + \gdef^^c3{\u A} + \gdef^^c4{\"A} + \gdef^^c5{\'L} + \gdef^^c6{\'C} + \gdef^^c7{\cedilla C} + \gdef^^c8{\v C} + \gdef^^c9{\'E} + \gdef^^ca{\missingcharmsg{LATIN CAPITAL LETTER E WITH OGONEK}} + \gdef^^cb{\"E} + \gdef^^cc{\v E} + \gdef^^cd{\'I} + \gdef^^ce{\^I} + \gdef^^cf{\v D} + % + \gdef^^d0{\missingcharmsg{LATIN CAPITAL LETTER D WITH STROKE}} + \gdef^^d1{\'N} + \gdef^^d2{\v N} + \gdef^^d3{\'O} + \gdef^^d4{\^O} + \gdef^^d5{\H O} + \gdef^^d6{\"O} + \gdef^^d7{$\times$} + \gdef^^d8{\v R} + \gdef^^d9{\ringaccent U} + \gdef^^da{\'U} + \gdef^^db{\H U} + \gdef^^dc{\"U} + \gdef^^dd{\'Y} + \gdef^^de{\cedilla T} + \gdef^^df{\ss} + % + \gdef^^e0{\'r} + \gdef^^e1{\'a} + \gdef^^e2{\^a} + \gdef^^e3{\u a} + \gdef^^e4{\"a} + \gdef^^e5{\'l} + \gdef^^e6{\'c} + \gdef^^e7{\cedilla c} + \gdef^^e8{\v c} + \gdef^^e9{\'e} + \gdef^^ea{\missingcharmsg{LATIN SMALL LETTER E WITH OGONEK}} + \gdef^^eb{\"e} + \gdef^^ec{\v e} + \gdef^^ed{\'\i} + \gdef^^ee{\^\i} + \gdef^^ef{\v d} + % + \gdef^^f0{\missingcharmsg{LATIN SMALL LETTER D WITH STROKE}} + \gdef^^f1{\'n} + \gdef^^f2{\v n} + \gdef^^f3{\'o} + \gdef^^f4{\^o} + \gdef^^f5{\H o} + \gdef^^f6{\"o} + \gdef^^f7{$\div$} + \gdef^^f8{\v r} + \gdef^^f9{\ringaccent u} + \gdef^^fa{\'u} + \gdef^^fb{\H u} + \gdef^^fc{\"u} + \gdef^^fd{\'y} + \gdef^^fe{\cedilla t} + \gdef^^ff{\dotaccent{}} +} + +% UTF-8 character definitions. +% +% This code to support UTF-8 is based on LaTeX's utf8.def, with some +% changes for Texinfo conventions. It is included here under the GPL by +% permission from Frank Mittelbach and the LaTeX team. +% +\newcount\countUTFx +\newcount\countUTFy +\newcount\countUTFz + +\gdef\UTFviiiTwoOctets#1#2{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\endcsname} +% +\gdef\UTFviiiThreeOctets#1#2#3{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\endcsname} +% +\gdef\UTFviiiFourOctets#1#2#3#4{\expandafter + \UTFviiiDefined\csname u8:#1\string #2\string #3\string #4\endcsname} + +\gdef\UTFviiiDefined#1{% + \ifx #1\relax + \message{\linenumber Unicode char \string #1 not defined for Texinfo}% + \else + \expandafter #1% + \fi +} + +\begingroup + \catcode`\~13 + \catcode`\"12 + + \def\UTFviiiLoop{% + \global\catcode\countUTFx\active + \uccode`\~\countUTFx + \uppercase\expandafter{\UTFviiiTmp}% + \advance\countUTFx by 1 + \ifnum\countUTFx < \countUTFy + \expandafter\UTFviiiLoop + \fi} + + \countUTFx = "C2 + \countUTFy = "E0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiTwoOctets\string~}} + \UTFviiiLoop + + \countUTFx = "E0 + \countUTFy = "F0 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiThreeOctets\string~}} + \UTFviiiLoop + + \countUTFx = "F0 + \countUTFy = "F4 + \def\UTFviiiTmp{% + \xdef~{\noexpand\UTFviiiFourOctets\string~}} + \UTFviiiLoop +\endgroup + +\begingroup + \catcode`\"=12 + \catcode`\<=12 + \catcode`\.=12 + \catcode`\,=12 + \catcode`\;=12 + \catcode`\!=12 + \catcode`\~=13 + + \gdef\DeclareUnicodeCharacter#1#2{% + \countUTFz = "#1\relax + \wlog{\space\space defining Unicode char U+#1 (decimal \the\countUTFz)}% + \begingroup + \parseXMLCharref + \def\UTFviiiTwoOctets##1##2{% + \csname u8:##1\string ##2\endcsname}% + \def\UTFviiiThreeOctets##1##2##3{% + \csname u8:##1\string ##2\string ##3\endcsname}% + \def\UTFviiiFourOctets##1##2##3##4{% + \csname u8:##1\string ##2\string ##3\string ##4\endcsname}% + \expandafter\expandafter\expandafter\expandafter + \expandafter\expandafter\expandafter + \gdef\UTFviiiTmp{#2}% + \endgroup} + + \gdef\parseXMLCharref{% + \ifnum\countUTFz < "A0\relax + \errhelp = \EMsimple + \errmessage{Cannot define Unicode char value < 00A0}% + \else\ifnum\countUTFz < "800\relax + \parseUTFviiiA,% + \parseUTFviiiB C\UTFviiiTwoOctets.,% + \else\ifnum\countUTFz < "10000\relax + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiB E\UTFviiiThreeOctets.{,;}% + \else + \parseUTFviiiA;% + \parseUTFviiiA,% + \parseUTFviiiA!% + \parseUTFviiiB F\UTFviiiFourOctets.{!,;}% + \fi\fi\fi + } + + \gdef\parseUTFviiiA#1{% + \countUTFx = \countUTFz + \divide\countUTFz by 64 + \countUTFy = \countUTFz + \multiply\countUTFz by 64 + \advance\countUTFx by -\countUTFz + \advance\countUTFx by 128 + \uccode `#1\countUTFx + \countUTFz = \countUTFy} + + \gdef\parseUTFviiiB#1#2#3#4{% + \advance\countUTFz by "#10\relax + \uccode `#3\countUTFz + \uppercase{\gdef\UTFviiiTmp{#2#3#4}}} +\endgroup + +\def\utfeightchardefs{% + \DeclareUnicodeCharacter{00A0}{\tie} + \DeclareUnicodeCharacter{00A1}{\exclamdown} + \DeclareUnicodeCharacter{00A3}{\pounds} + \DeclareUnicodeCharacter{00A8}{\"{ }} + \DeclareUnicodeCharacter{00A9}{\copyright} + \DeclareUnicodeCharacter{00AA}{\ordf} + \DeclareUnicodeCharacter{00AB}{\guillemetleft} + \DeclareUnicodeCharacter{00AD}{\-} + \DeclareUnicodeCharacter{00AE}{\registeredsymbol} + \DeclareUnicodeCharacter{00AF}{\={ }} + + \DeclareUnicodeCharacter{00B0}{\ringaccent{ }} + \DeclareUnicodeCharacter{00B4}{\'{ }} + \DeclareUnicodeCharacter{00B8}{\cedilla{ }} + \DeclareUnicodeCharacter{00BA}{\ordm} + \DeclareUnicodeCharacter{00BB}{\guillemetright} + \DeclareUnicodeCharacter{00BF}{\questiondown} + + \DeclareUnicodeCharacter{00C0}{\`A} + \DeclareUnicodeCharacter{00C1}{\'A} + \DeclareUnicodeCharacter{00C2}{\^A} + \DeclareUnicodeCharacter{00C3}{\~A} + \DeclareUnicodeCharacter{00C4}{\"A} + \DeclareUnicodeCharacter{00C5}{\AA} + \DeclareUnicodeCharacter{00C6}{\AE} + \DeclareUnicodeCharacter{00C7}{\cedilla{C}} + \DeclareUnicodeCharacter{00C8}{\`E} + \DeclareUnicodeCharacter{00C9}{\'E} + \DeclareUnicodeCharacter{00CA}{\^E} + \DeclareUnicodeCharacter{00CB}{\"E} + \DeclareUnicodeCharacter{00CC}{\`I} + \DeclareUnicodeCharacter{00CD}{\'I} + \DeclareUnicodeCharacter{00CE}{\^I} + \DeclareUnicodeCharacter{00CF}{\"I} + + \DeclareUnicodeCharacter{00D1}{\~N} + \DeclareUnicodeCharacter{00D2}{\`O} + \DeclareUnicodeCharacter{00D3}{\'O} + \DeclareUnicodeCharacter{00D4}{\^O} + \DeclareUnicodeCharacter{00D5}{\~O} + \DeclareUnicodeCharacter{00D6}{\"O} + \DeclareUnicodeCharacter{00D8}{\O} + \DeclareUnicodeCharacter{00D9}{\`U} + \DeclareUnicodeCharacter{00DA}{\'U} + \DeclareUnicodeCharacter{00DB}{\^U} + \DeclareUnicodeCharacter{00DC}{\"U} + \DeclareUnicodeCharacter{00DD}{\'Y} + \DeclareUnicodeCharacter{00DF}{\ss} + + \DeclareUnicodeCharacter{00E0}{\`a} + \DeclareUnicodeCharacter{00E1}{\'a} + \DeclareUnicodeCharacter{00E2}{\^a} + \DeclareUnicodeCharacter{00E3}{\~a} + \DeclareUnicodeCharacter{00E4}{\"a} + \DeclareUnicodeCharacter{00E5}{\aa} + \DeclareUnicodeCharacter{00E6}{\ae} + \DeclareUnicodeCharacter{00E7}{\cedilla{c}} + \DeclareUnicodeCharacter{00E8}{\`e} + \DeclareUnicodeCharacter{00E9}{\'e} + \DeclareUnicodeCharacter{00EA}{\^e} + \DeclareUnicodeCharacter{00EB}{\"e} + \DeclareUnicodeCharacter{00EC}{\`{\dotless{i}}} + \DeclareUnicodeCharacter{00ED}{\'{\dotless{i}}} + \DeclareUnicodeCharacter{00EE}{\^{\dotless{i}}} + \DeclareUnicodeCharacter{00EF}{\"{\dotless{i}}} + + \DeclareUnicodeCharacter{00F1}{\~n} + \DeclareUnicodeCharacter{00F2}{\`o} + \DeclareUnicodeCharacter{00F3}{\'o} + \DeclareUnicodeCharacter{00F4}{\^o} + \DeclareUnicodeCharacter{00F5}{\~o} + \DeclareUnicodeCharacter{00F6}{\"o} + \DeclareUnicodeCharacter{00F8}{\o} + \DeclareUnicodeCharacter{00F9}{\`u} + \DeclareUnicodeCharacter{00FA}{\'u} + \DeclareUnicodeCharacter{00FB}{\^u} + \DeclareUnicodeCharacter{00FC}{\"u} + \DeclareUnicodeCharacter{00FD}{\'y} + \DeclareUnicodeCharacter{00FF}{\"y} + + \DeclareUnicodeCharacter{0100}{\=A} + \DeclareUnicodeCharacter{0101}{\=a} + \DeclareUnicodeCharacter{0102}{\u{A}} + \DeclareUnicodeCharacter{0103}{\u{a}} + \DeclareUnicodeCharacter{0106}{\'C} + \DeclareUnicodeCharacter{0107}{\'c} + \DeclareUnicodeCharacter{0108}{\^C} + \DeclareUnicodeCharacter{0109}{\^c} + \DeclareUnicodeCharacter{010A}{\dotaccent{C}} + \DeclareUnicodeCharacter{010B}{\dotaccent{c}} + \DeclareUnicodeCharacter{010C}{\v{C}} + \DeclareUnicodeCharacter{010D}{\v{c}} + \DeclareUnicodeCharacter{010E}{\v{D}} + + \DeclareUnicodeCharacter{0112}{\=E} + \DeclareUnicodeCharacter{0113}{\=e} + \DeclareUnicodeCharacter{0114}{\u{E}} + \DeclareUnicodeCharacter{0115}{\u{e}} + \DeclareUnicodeCharacter{0116}{\dotaccent{E}} + \DeclareUnicodeCharacter{0117}{\dotaccent{e}} + \DeclareUnicodeCharacter{011A}{\v{E}} + \DeclareUnicodeCharacter{011B}{\v{e}} + \DeclareUnicodeCharacter{011C}{\^G} + \DeclareUnicodeCharacter{011D}{\^g} + \DeclareUnicodeCharacter{011E}{\u{G}} + \DeclareUnicodeCharacter{011F}{\u{g}} + + \DeclareUnicodeCharacter{0120}{\dotaccent{G}} + \DeclareUnicodeCharacter{0121}{\dotaccent{g}} + \DeclareUnicodeCharacter{0124}{\^H} + \DeclareUnicodeCharacter{0125}{\^h} + \DeclareUnicodeCharacter{0128}{\~I} + \DeclareUnicodeCharacter{0129}{\~{\dotless{i}}} + \DeclareUnicodeCharacter{012A}{\=I} + \DeclareUnicodeCharacter{012B}{\={\dotless{i}}} + \DeclareUnicodeCharacter{012C}{\u{I}} + \DeclareUnicodeCharacter{012D}{\u{\dotless{i}}} + + \DeclareUnicodeCharacter{0130}{\dotaccent{I}} + \DeclareUnicodeCharacter{0131}{\dotless{i}} + \DeclareUnicodeCharacter{0132}{IJ} + \DeclareUnicodeCharacter{0133}{ij} + \DeclareUnicodeCharacter{0134}{\^J} + \DeclareUnicodeCharacter{0135}{\^{\dotless{j}}} + \DeclareUnicodeCharacter{0139}{\'L} + \DeclareUnicodeCharacter{013A}{\'l} + + \DeclareUnicodeCharacter{0141}{\L} + \DeclareUnicodeCharacter{0142}{\l} + \DeclareUnicodeCharacter{0143}{\'N} + \DeclareUnicodeCharacter{0144}{\'n} + \DeclareUnicodeCharacter{0147}{\v{N}} + \DeclareUnicodeCharacter{0148}{\v{n}} + \DeclareUnicodeCharacter{014C}{\=O} + \DeclareUnicodeCharacter{014D}{\=o} + \DeclareUnicodeCharacter{014E}{\u{O}} + \DeclareUnicodeCharacter{014F}{\u{o}} + + \DeclareUnicodeCharacter{0150}{\H{O}} + \DeclareUnicodeCharacter{0151}{\H{o}} + \DeclareUnicodeCharacter{0152}{\OE} + \DeclareUnicodeCharacter{0153}{\oe} + \DeclareUnicodeCharacter{0154}{\'R} + \DeclareUnicodeCharacter{0155}{\'r} + \DeclareUnicodeCharacter{0158}{\v{R}} + \DeclareUnicodeCharacter{0159}{\v{r}} + \DeclareUnicodeCharacter{015A}{\'S} + \DeclareUnicodeCharacter{015B}{\'s} + \DeclareUnicodeCharacter{015C}{\^S} + \DeclareUnicodeCharacter{015D}{\^s} + \DeclareUnicodeCharacter{015E}{\cedilla{S}} + \DeclareUnicodeCharacter{015F}{\cedilla{s}} + + \DeclareUnicodeCharacter{0160}{\v{S}} + \DeclareUnicodeCharacter{0161}{\v{s}} + \DeclareUnicodeCharacter{0162}{\cedilla{t}} + \DeclareUnicodeCharacter{0163}{\cedilla{T}} + \DeclareUnicodeCharacter{0164}{\v{T}} + + \DeclareUnicodeCharacter{0168}{\~U} + \DeclareUnicodeCharacter{0169}{\~u} + \DeclareUnicodeCharacter{016A}{\=U} + \DeclareUnicodeCharacter{016B}{\=u} + \DeclareUnicodeCharacter{016C}{\u{U}} + \DeclareUnicodeCharacter{016D}{\u{u}} + \DeclareUnicodeCharacter{016E}{\ringaccent{U}} + \DeclareUnicodeCharacter{016F}{\ringaccent{u}} + + \DeclareUnicodeCharacter{0170}{\H{U}} + \DeclareUnicodeCharacter{0171}{\H{u}} + \DeclareUnicodeCharacter{0174}{\^W} + \DeclareUnicodeCharacter{0175}{\^w} + \DeclareUnicodeCharacter{0176}{\^Y} + \DeclareUnicodeCharacter{0177}{\^y} + \DeclareUnicodeCharacter{0178}{\"Y} + \DeclareUnicodeCharacter{0179}{\'Z} + \DeclareUnicodeCharacter{017A}{\'z} + \DeclareUnicodeCharacter{017B}{\dotaccent{Z}} + \DeclareUnicodeCharacter{017C}{\dotaccent{z}} + \DeclareUnicodeCharacter{017D}{\v{Z}} + \DeclareUnicodeCharacter{017E}{\v{z}} + + \DeclareUnicodeCharacter{01C4}{D\v{Z}} + \DeclareUnicodeCharacter{01C5}{D\v{z}} + \DeclareUnicodeCharacter{01C6}{d\v{z}} + \DeclareUnicodeCharacter{01C7}{LJ} + \DeclareUnicodeCharacter{01C8}{Lj} + \DeclareUnicodeCharacter{01C9}{lj} + \DeclareUnicodeCharacter{01CA}{NJ} + \DeclareUnicodeCharacter{01CB}{Nj} + \DeclareUnicodeCharacter{01CC}{nj} + \DeclareUnicodeCharacter{01CD}{\v{A}} + \DeclareUnicodeCharacter{01CE}{\v{a}} + \DeclareUnicodeCharacter{01CF}{\v{I}} + + \DeclareUnicodeCharacter{01D0}{\v{\dotless{i}}} + \DeclareUnicodeCharacter{01D1}{\v{O}} + \DeclareUnicodeCharacter{01D2}{\v{o}} + \DeclareUnicodeCharacter{01D3}{\v{U}} + \DeclareUnicodeCharacter{01D4}{\v{u}} + + \DeclareUnicodeCharacter{01E2}{\={\AE}} + \DeclareUnicodeCharacter{01E3}{\={\ae}} + \DeclareUnicodeCharacter{01E6}{\v{G}} + \DeclareUnicodeCharacter{01E7}{\v{g}} + \DeclareUnicodeCharacter{01E8}{\v{K}} + \DeclareUnicodeCharacter{01E9}{\v{k}} + + \DeclareUnicodeCharacter{01F0}{\v{\dotless{j}}} + \DeclareUnicodeCharacter{01F1}{DZ} + \DeclareUnicodeCharacter{01F2}{Dz} + \DeclareUnicodeCharacter{01F3}{dz} + \DeclareUnicodeCharacter{01F4}{\'G} + \DeclareUnicodeCharacter{01F5}{\'g} + \DeclareUnicodeCharacter{01F8}{\`N} + \DeclareUnicodeCharacter{01F9}{\`n} + \DeclareUnicodeCharacter{01FC}{\'{\AE}} + \DeclareUnicodeCharacter{01FD}{\'{\ae}} + \DeclareUnicodeCharacter{01FE}{\'{\O}} + \DeclareUnicodeCharacter{01FF}{\'{\o}} + + \DeclareUnicodeCharacter{021E}{\v{H}} + \DeclareUnicodeCharacter{021F}{\v{h}} + + \DeclareUnicodeCharacter{0226}{\dotaccent{A}} + \DeclareUnicodeCharacter{0227}{\dotaccent{a}} + \DeclareUnicodeCharacter{0228}{\cedilla{E}} + \DeclareUnicodeCharacter{0229}{\cedilla{e}} + \DeclareUnicodeCharacter{022E}{\dotaccent{O}} + \DeclareUnicodeCharacter{022F}{\dotaccent{o}} + + \DeclareUnicodeCharacter{0232}{\=Y} + \DeclareUnicodeCharacter{0233}{\=y} + \DeclareUnicodeCharacter{0237}{\dotless{j}} + + \DeclareUnicodeCharacter{1E02}{\dotaccent{B}} + \DeclareUnicodeCharacter{1E03}{\dotaccent{b}} + \DeclareUnicodeCharacter{1E04}{\udotaccent{B}} + \DeclareUnicodeCharacter{1E05}{\udotaccent{b}} + \DeclareUnicodeCharacter{1E06}{\ubaraccent{B}} + \DeclareUnicodeCharacter{1E07}{\ubaraccent{b}} + \DeclareUnicodeCharacter{1E0A}{\dotaccent{D}} + \DeclareUnicodeCharacter{1E0B}{\dotaccent{d}} + \DeclareUnicodeCharacter{1E0C}{\udotaccent{D}} + \DeclareUnicodeCharacter{1E0D}{\udotaccent{d}} + \DeclareUnicodeCharacter{1E0E}{\ubaraccent{D}} + \DeclareUnicodeCharacter{1E0F}{\ubaraccent{d}} + + \DeclareUnicodeCharacter{1E1E}{\dotaccent{F}} + \DeclareUnicodeCharacter{1E1F}{\dotaccent{f}} + + \DeclareUnicodeCharacter{1E20}{\=G} + \DeclareUnicodeCharacter{1E21}{\=g} + \DeclareUnicodeCharacter{1E22}{\dotaccent{H}} + \DeclareUnicodeCharacter{1E23}{\dotaccent{h}} + \DeclareUnicodeCharacter{1E24}{\udotaccent{H}} + \DeclareUnicodeCharacter{1E25}{\udotaccent{h}} + \DeclareUnicodeCharacter{1E26}{\"H} + \DeclareUnicodeCharacter{1E27}{\"h} + + \DeclareUnicodeCharacter{1E30}{\'K} + \DeclareUnicodeCharacter{1E31}{\'k} + \DeclareUnicodeCharacter{1E32}{\udotaccent{K}} + \DeclareUnicodeCharacter{1E33}{\udotaccent{k}} + \DeclareUnicodeCharacter{1E34}{\ubaraccent{K}} + \DeclareUnicodeCharacter{1E35}{\ubaraccent{k}} + \DeclareUnicodeCharacter{1E36}{\udotaccent{L}} + \DeclareUnicodeCharacter{1E37}{\udotaccent{l}} + \DeclareUnicodeCharacter{1E3A}{\ubaraccent{L}} + \DeclareUnicodeCharacter{1E3B}{\ubaraccent{l}} + \DeclareUnicodeCharacter{1E3E}{\'M} + \DeclareUnicodeCharacter{1E3F}{\'m} + + \DeclareUnicodeCharacter{1E40}{\dotaccent{M}} + \DeclareUnicodeCharacter{1E41}{\dotaccent{m}} + \DeclareUnicodeCharacter{1E42}{\udotaccent{M}} + \DeclareUnicodeCharacter{1E43}{\udotaccent{m}} + \DeclareUnicodeCharacter{1E44}{\dotaccent{N}} + \DeclareUnicodeCharacter{1E45}{\dotaccent{n}} + \DeclareUnicodeCharacter{1E46}{\udotaccent{N}} + \DeclareUnicodeCharacter{1E47}{\udotaccent{n}} + \DeclareUnicodeCharacter{1E48}{\ubaraccent{N}} + \DeclareUnicodeCharacter{1E49}{\ubaraccent{n}} + + \DeclareUnicodeCharacter{1E54}{\'P} + \DeclareUnicodeCharacter{1E55}{\'p} + \DeclareUnicodeCharacter{1E56}{\dotaccent{P}} + \DeclareUnicodeCharacter{1E57}{\dotaccent{p}} + \DeclareUnicodeCharacter{1E58}{\dotaccent{R}} + \DeclareUnicodeCharacter{1E59}{\dotaccent{r}} + \DeclareUnicodeCharacter{1E5A}{\udotaccent{R}} + \DeclareUnicodeCharacter{1E5B}{\udotaccent{r}} + \DeclareUnicodeCharacter{1E5E}{\ubaraccent{R}} + \DeclareUnicodeCharacter{1E5F}{\ubaraccent{r}} + + \DeclareUnicodeCharacter{1E60}{\dotaccent{S}} + \DeclareUnicodeCharacter{1E61}{\dotaccent{s}} + \DeclareUnicodeCharacter{1E62}{\udotaccent{S}} + \DeclareUnicodeCharacter{1E63}{\udotaccent{s}} + \DeclareUnicodeCharacter{1E6A}{\dotaccent{T}} + \DeclareUnicodeCharacter{1E6B}{\dotaccent{t}} + \DeclareUnicodeCharacter{1E6C}{\udotaccent{T}} + \DeclareUnicodeCharacter{1E6D}{\udotaccent{t}} + \DeclareUnicodeCharacter{1E6E}{\ubaraccent{T}} + \DeclareUnicodeCharacter{1E6F}{\ubaraccent{t}} + + \DeclareUnicodeCharacter{1E7C}{\~V} + \DeclareUnicodeCharacter{1E7D}{\~v} + \DeclareUnicodeCharacter{1E7E}{\udotaccent{V}} + \DeclareUnicodeCharacter{1E7F}{\udotaccent{v}} + + \DeclareUnicodeCharacter{1E80}{\`W} + \DeclareUnicodeCharacter{1E81}{\`w} + \DeclareUnicodeCharacter{1E82}{\'W} + \DeclareUnicodeCharacter{1E83}{\'w} + \DeclareUnicodeCharacter{1E84}{\"W} + \DeclareUnicodeCharacter{1E85}{\"w} + \DeclareUnicodeCharacter{1E86}{\dotaccent{W}} + \DeclareUnicodeCharacter{1E87}{\dotaccent{w}} + \DeclareUnicodeCharacter{1E88}{\udotaccent{W}} + \DeclareUnicodeCharacter{1E89}{\udotaccent{w}} + \DeclareUnicodeCharacter{1E8A}{\dotaccent{X}} + \DeclareUnicodeCharacter{1E8B}{\dotaccent{x}} + \DeclareUnicodeCharacter{1E8C}{\"X} + \DeclareUnicodeCharacter{1E8D}{\"x} + \DeclareUnicodeCharacter{1E8E}{\dotaccent{Y}} + \DeclareUnicodeCharacter{1E8F}{\dotaccent{y}} + + \DeclareUnicodeCharacter{1E90}{\^Z} + \DeclareUnicodeCharacter{1E91}{\^z} + \DeclareUnicodeCharacter{1E92}{\udotaccent{Z}} + \DeclareUnicodeCharacter{1E93}{\udotaccent{z}} + \DeclareUnicodeCharacter{1E94}{\ubaraccent{Z}} + \DeclareUnicodeCharacter{1E95}{\ubaraccent{z}} + \DeclareUnicodeCharacter{1E96}{\ubaraccent{h}} + \DeclareUnicodeCharacter{1E97}{\"t} + \DeclareUnicodeCharacter{1E98}{\ringaccent{w}} + \DeclareUnicodeCharacter{1E99}{\ringaccent{y}} + + \DeclareUnicodeCharacter{1EA0}{\udotaccent{A}} + \DeclareUnicodeCharacter{1EA1}{\udotaccent{a}} + + \DeclareUnicodeCharacter{1EB8}{\udotaccent{E}} + \DeclareUnicodeCharacter{1EB9}{\udotaccent{e}} + \DeclareUnicodeCharacter{1EBC}{\~E} + \DeclareUnicodeCharacter{1EBD}{\~e} + + \DeclareUnicodeCharacter{1ECA}{\udotaccent{I}} + \DeclareUnicodeCharacter{1ECB}{\udotaccent{i}} + \DeclareUnicodeCharacter{1ECC}{\udotaccent{O}} + \DeclareUnicodeCharacter{1ECD}{\udotaccent{o}} + + \DeclareUnicodeCharacter{1EE4}{\udotaccent{U}} + \DeclareUnicodeCharacter{1EE5}{\udotaccent{u}} + + \DeclareUnicodeCharacter{1EF2}{\`Y} + \DeclareUnicodeCharacter{1EF3}{\`y} + \DeclareUnicodeCharacter{1EF4}{\udotaccent{Y}} + + \DeclareUnicodeCharacter{1EF8}{\~Y} + \DeclareUnicodeCharacter{1EF9}{\~y} + + \DeclareUnicodeCharacter{2013}{--} + \DeclareUnicodeCharacter{2014}{---} + \DeclareUnicodeCharacter{2018}{\quoteleft} + \DeclareUnicodeCharacter{2019}{\quoteright} + \DeclareUnicodeCharacter{201A}{\quotesinglbase} + \DeclareUnicodeCharacter{201C}{\quotedblleft} + \DeclareUnicodeCharacter{201D}{\quotedblright} + \DeclareUnicodeCharacter{201E}{\quotedblbase} + \DeclareUnicodeCharacter{2022}{\bullet} + \DeclareUnicodeCharacter{2026}{\dots} + \DeclareUnicodeCharacter{2039}{\guilsinglleft} + \DeclareUnicodeCharacter{203A}{\guilsinglright} + \DeclareUnicodeCharacter{20AC}{\euro} + + \DeclareUnicodeCharacter{2192}{\expansion} + \DeclareUnicodeCharacter{21D2}{\result} + + \DeclareUnicodeCharacter{2212}{\minus} + \DeclareUnicodeCharacter{2217}{\point} + \DeclareUnicodeCharacter{2261}{\equiv} +}% end of \utfeightchardefs + + +% US-ASCII character definitions. +\def\asciichardefs{% nothing need be done + \relax +} + +% Make non-ASCII characters printable again for compatibility with +% existing Texinfo documents that may use them, even without declaring a +% document encoding. +% +\setnonasciicharscatcode \other + + +\message{formatting,} + +\newdimen\defaultparindent \defaultparindent = 15pt + +\chapheadingskip = 15pt plus 4pt minus 2pt +\secheadingskip = 12pt plus 3pt minus 2pt +\subsecheadingskip = 9pt plus 2pt minus 2pt + +% Prevent underfull vbox error messages. +\vbadness = 10000 + +% Don't be so finicky about underfull hboxes, either. +\hbadness = 2000 + +% Following George Bush, get rid of widows and orphans. +\widowpenalty=10000 +\clubpenalty=10000 + +% Use TeX 3.0's \emergencystretch to help line breaking, but if we're +% using an old version of TeX, don't do anything. We want the amount of +% stretch added to depend on the line length, hence the dependence on +% \hsize. We call this whenever the paper size is set. +% +\def\setemergencystretch{% + \ifx\emergencystretch\thisisundefined + % Allow us to assign to \emergencystretch anyway. + \def\emergencystretch{\dimen0}% + \else + \emergencystretch = .15\hsize + \fi +} + +% Parameters in order: 1) textheight; 2) textwidth; +% 3) voffset; 4) hoffset; 5) binding offset; 6) topskip; +% 7) physical page height; 8) physical page width. +% +% We also call \setleading{\textleading}, so the caller should define +% \textleading. The caller should also set \parskip. +% +\def\internalpagesizes#1#2#3#4#5#6#7#8{% + \voffset = #3\relax + \topskip = #6\relax + \splittopskip = \topskip + % + \vsize = #1\relax + \advance\vsize by \topskip + \outervsize = \vsize + \advance\outervsize by 2\topandbottommargin + \pageheight = \vsize + % + \hsize = #2\relax + \outerhsize = \hsize + \advance\outerhsize by 0.5in + \pagewidth = \hsize + % + \normaloffset = #4\relax + \bindingoffset = #5\relax + % + \ifpdf + \pdfpageheight #7\relax + \pdfpagewidth #8\relax + % if we don't reset these, they will remain at "1 true in" of + % whatever layout pdftex was dumped with. + \pdfhorigin = 1 true in + \pdfvorigin = 1 true in + \fi + % + \setleading{\textleading} + % + \parindent = \defaultparindent + \setemergencystretch +} + +% @letterpaper (the default). +\def\letterpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % If page is nothing but text, make it come out even. + \internalpagesizes{607.2pt}{6in}% that's 46 lines + {\voffset}{.25in}% + {\bindingoffset}{36pt}% + {11in}{8.5in}% +}} + +% Use @smallbook to reset parameters for 7x9.25 trim size. +\def\smallbook{{\globaldefs = 1 + \parskip = 2pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.5in}{5in}% + {-.2in}{0in}% + {\bindingoffset}{16pt}% + {9.25in}{7in}% + % + \lispnarrowing = 0.3in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .5cm +}} + +% Use @smallerbook to reset parameters for 6x9 trim size. +% (Just testing, parameters still in flux.) +\def\smallerbook{{\globaldefs = 1 + \parskip = 1.5pt plus 1pt + \textleading = 12pt + % + \internalpagesizes{7.4in}{4.8in}% + {-.2in}{-.4in}% + {0pt}{14pt}% + {9in}{6in}% + % + \lispnarrowing = 0.25in + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = .4cm +}} + +% Use @afourpaper to print on European A4 paper. +\def\afourpaper{{\globaldefs = 1 + \parskip = 3pt plus 2pt minus 1pt + \textleading = 13.2pt + % + % Double-side printing via postscript on Laserjet 4050 + % prints double-sided nicely when \bindingoffset=10mm and \hoffset=-6mm. + % To change the settings for a different printer or situation, adjust + % \normaloffset until the front-side and back-side texts align. Then + % do the same for \bindingoffset. You can set these for testing in + % your texinfo source file like this: + % @tex + % \global\normaloffset = -6mm + % \global\bindingoffset = 10mm + % @end tex + \internalpagesizes{673.2pt}{160mm}% that's 51 lines + {\voffset}{\hoffset}% + {\bindingoffset}{44pt}% + {297mm}{210mm}% + % + \tolerance = 700 + \hfuzz = 1pt + \contentsrightmargin = 0pt + \defbodyindent = 5mm +}} + +% Use @afivepaper to print on European A5 paper. +% From romildo@urano.iceb.ufop.br, 2 July 2000. +% He also recommends making @example and @lisp be small. +\def\afivepaper{{\globaldefs = 1 + \parskip = 2pt plus 1pt minus 0.1pt + \textleading = 12.5pt + % + \internalpagesizes{160mm}{120mm}% + {\voffset}{\hoffset}% + {\bindingoffset}{8pt}% + {210mm}{148mm}% + % + \lispnarrowing = 0.2in + \tolerance = 800 + \hfuzz = 1.2pt + \contentsrightmargin = 0pt + \defbodyindent = 2mm + \tableindent = 12mm +}} + +% A specific text layout, 24x15cm overall, intended for A4 paper. +\def\afourlatex{{\globaldefs = 1 + \afourpaper + \internalpagesizes{237mm}{150mm}% + {\voffset}{4.6mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + % + % Must explicitly reset to 0 because we call \afourpaper. + \globaldefs = 0 +}} + +% Use @afourwide to print on A4 paper in landscape format. +\def\afourwide{{\globaldefs = 1 + \afourpaper + \internalpagesizes{241mm}{165mm}% + {\voffset}{-2.95mm}% + {\bindingoffset}{7mm}% + {297mm}{210mm}% + \globaldefs = 0 +}} + +% @pagesizes TEXTHEIGHT[,TEXTWIDTH] +% Perhaps we should allow setting the margins, \topskip, \parskip, +% and/or leading, also. Or perhaps we should compute them somehow. +% +\parseargdef\pagesizes{\pagesizesyyy #1,,\finish} +\def\pagesizesyyy#1,#2,#3\finish{{% + \setbox0 = \hbox{\ignorespaces #2}\ifdim\wd0 > 0pt \hsize=#2\relax \fi + \globaldefs = 1 + % + \parskip = 3pt plus 2pt minus 1pt + \setleading{\textleading}% + % + \dimen0 = #1\relax + \advance\dimen0 by \voffset + % + \dimen2 = \hsize + \advance\dimen2 by \normaloffset + % + \internalpagesizes{#1}{\hsize}% + {\voffset}{\normaloffset}% + {\bindingoffset}{44pt}% + {\dimen0}{\dimen2}% +}} + +% Set default to letter. +% +\letterpaper + + +\message{and turning on texinfo input format.} + +% Define macros to output various characters with catcode for normal text. +\catcode`\"=\other +\catcode`\~=\other +\catcode`\^=\other +\catcode`\_=\other +\catcode`\|=\other +\catcode`\<=\other +\catcode`\>=\other +\catcode`\+=\other +\catcode`\$=\other +\def\normaldoublequote{"} +\def\normaltilde{~} +\def\normalcaret{^} +\def\normalunderscore{_} +\def\normalverticalbar{|} +\def\normalless{<} +\def\normalgreater{>} +\def\normalplus{+} +\def\normaldollar{$}%$ font-lock fix + +% This macro is used to make a character print one way in \tt +% (where it can probably be output as-is), and another way in other fonts, +% where something hairier probably needs to be done. +% +% #1 is what to print if we are indeed using \tt; #2 is what to print +% otherwise. Since all the Computer Modern typewriter fonts have zero +% interword stretch (and shrink), and it is reasonable to expect all +% typewriter fonts to have this, we can check that font parameter. +% +\def\ifusingtt#1#2{\ifdim \fontdimen3\font=0pt #1\else #2\fi} + +% Same as above, but check for italic font. Actually this also catches +% non-italic slanted fonts since it is impossible to distinguish them from +% italic fonts. But since this is only used by $ and it uses \sl anyway +% this is not a problem. +\def\ifusingit#1#2{\ifdim \fontdimen1\font>0pt #1\else #2\fi} + +% Turn off all special characters except @ +% (and those which the user can use as if they were ordinary). +% Most of these we simply print from the \tt font, but for some, we can +% use math or other variants that look better in normal text. + +\catcode`\"=\active +\def\activedoublequote{{\tt\char34}} +\let"=\activedoublequote +\catcode`\~=\active +\def~{{\tt\char126}} +\chardef\hat=`\^ +\catcode`\^=\active +\def^{{\tt \hat}} + +\catcode`\_=\active +\def_{\ifusingtt\normalunderscore\_} +\let\realunder=_ +% Subroutine for the previous macro. +\def\_{\leavevmode \kern.07em \vbox{\hrule width.3em height.1ex}\kern .07em } + +\catcode`\|=\active +\def|{{\tt\char124}} +\chardef \less=`\< +\catcode`\<=\active +\def<{{\tt \less}} +\chardef \gtr=`\> +\catcode`\>=\active +\def>{{\tt \gtr}} +\catcode`\+=\active +\def+{{\tt \char 43}} +\catcode`\$=\active +\def${\ifusingit{{\sl\$}}\normaldollar}%$ font-lock fix + +% If a .fmt file is being used, characters that might appear in a file +% name cannot be active until we have parsed the command line. +% So turn them off again, and have \everyjob (or @setfilename) turn them on. +% \otherifyactive is called near the end of this file. +\def\otherifyactive{\catcode`+=\other \catcode`\_=\other} + +% Used sometimes to turn off (effectively) the active characters even after +% parsing them. +\def\turnoffactive{% + \normalturnoffactive + \otherbackslash +} + +\catcode`\@=0 + +% \backslashcurfont outputs one backslash character in current font, +% as in \char`\\. +\global\chardef\backslashcurfont=`\\ +\global\let\rawbackslashxx=\backslashcurfont % let existing .??s files work + +% \realbackslash is an actual character `\' with catcode other, and +% \doublebackslash is two of them (for the pdf outlines). +{\catcode`\\=\other @gdef@realbackslash{\} @gdef@doublebackslash{\\}} + +% In texinfo, backslash is an active character; it prints the backslash +% in fixed width font. +\catcode`\\=\active +@def@normalbackslash{{@tt@backslashcurfont}} +% On startup, @fixbackslash assigns: +% @let \ = @normalbackslash + +% \rawbackslash defines an active \ to do \backslashcurfont. +% \otherbackslash defines an active \ to be a literal `\' character with +% catcode other. +@gdef@rawbackslash{@let\=@backslashcurfont} +@gdef@otherbackslash{@let\=@realbackslash} + +% Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of +% the literal character `\'. +% +@def@normalturnoffactive{% + @let\=@normalbackslash + @let"=@normaldoublequote + @let~=@normaltilde + @let^=@normalcaret + @let_=@normalunderscore + @let|=@normalverticalbar + @let<=@normalless + @let>=@normalgreater + @let+=@normalplus + @let$=@normaldollar %$ font-lock fix + @unsepspaces +} + +% Make _ and + \other characters, temporarily. +% This is canceled by @fixbackslash. +@otherifyactive + +% If a .fmt file is being used, we don't want the `\input texinfo' to show up. +% That is what \eatinput is for; after that, the `\' should revert to printing +% a backslash. +% +@gdef@eatinput input texinfo{@fixbackslash} +@global@let\ = @eatinput + +% On the other hand, perhaps the file did not have a `\input texinfo'. Then +% the first `\' in the file would cause an error. This macro tries to fix +% that, assuming it is called before the first `\' could plausibly occur. +% Also turn back on active characters that might appear in the input +% file name, in case not using a pre-dumped format. +% +@gdef@fixbackslash{% + @ifx\@eatinput @let\ = @normalbackslash @fi + @catcode`+=@active + @catcode`@_=@active +} + +% Say @foo, not \foo, in error messages. +@escapechar = `@@ + +% These look ok in all fonts, so just make them not special. +@catcode`@& = @other +@catcode`@# = @other +@catcode`@% = @other + + +@c Local variables: +@c eval: (add-hook 'write-file-hooks 'time-stamp) +@c page-delimiter: "^\\\\message" +@c time-stamp-start: "def\\\\texinfoversion{" +@c time-stamp-format: "%:y-%02m-%02d.%02H" +@c time-stamp-end: "}" +@c End: + +@c vim:sw=2: + +@ignore + arch-tag: e1b36e32-c96e-4135-a41a-0b2efa2ea115 +@end ignore diff --git a/install-sh b/install-sh index f746d0f80..a5897de6e 100644 --- a/install-sh +++ b/install-sh @@ -1,7 +1,7 @@ #!/bin/sh # install - install a program, script, or datafile -scriptversion=2006-05-11.20 +scriptversion=2006-12-25.00 # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the @@ -39,8 +39,7 @@ scriptversion=2006-05-11.20 # when there is no Makefile. # # This script is compatible with the BSD install script, but was written -# from scratch. It can only install one file at a time, a restriction -# shared with many OS's install programs. +# from scratch. nl=' ' @@ -49,47 +48,59 @@ IFS=" "" $nl" # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. -doit="${DOITPROG-}" +doit=${DOITPROG-} +if test -z "$doit"; then + doit_exec=exec +else + doit_exec=$doit +fi # Put in absolute file names if you don't have them in your path; # or use environment vars. -mvprog="${MVPROG-mv}" -cpprog="${CPPROG-cp}" -chmodprog="${CHMODPROG-chmod}" -chownprog="${CHOWNPROG-chown}" -chgrpprog="${CHGRPPROG-chgrp}" -stripprog="${STRIPPROG-strip}" -rmprog="${RMPROG-rm}" -mkdirprog="${MKDIRPROG-mkdir}" +chgrpprog=${CHGRPPROG-chgrp} +chmodprog=${CHMODPROG-chmod} +chownprog=${CHOWNPROG-chown} +cmpprog=${CMPPROG-cmp} +cpprog=${CPPROG-cp} +mkdirprog=${MKDIRPROG-mkdir} +mvprog=${MVPROG-mv} +rmprog=${RMPROG-rm} +stripprog=${STRIPPROG-strip} + +posix_glob='?' +initialize_posix_glob=' + test "$posix_glob" != "?" || { + if (set -f) 2>/dev/null; then + posix_glob= + else + posix_glob=: + fi + } +' -posix_glob= posix_mkdir= -# Symbolic mode for testing mkdir with directories. -# It is the same as 755, but also tests that "u+" works. -test_mode=u=rwx,g=rx,o=rx,u+wx - # Desired mode of installed file. mode=0755 -# Desired mode of newly created intermediate directories. -# It is empty if not known yet. -intermediate_mode= - +chgrpcmd= chmodcmd=$chmodprog chowncmd= -chgrpcmd= -stripcmd= +mvcmd=$mvprog rmcmd="$rmprog -f" -mvcmd="$mvprog" +stripcmd= + src= dst= dir_arg= -dstarg= +dst_arg= + +copy_on_change=false no_target_directory= -usage="Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE +usage="\ +Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... @@ -99,59 +110,55 @@ In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --c (ignored) --d create directories instead of installing files. --g GROUP $chgrpprog installed files to GROUP. --m MODE $chmodprog installed files to MODE. --o USER $chownprog installed files to USER. --s $stripprog installed files. --t DIRECTORY install into DIRECTORY. --T report an error if DSTFILE is a directory. ---help display this help and exit. ---version display version info and exit. + --help display this help and exit. + --version display version info and exit. + + -c (ignored) + -C install only if different (preserve the last data modification time) + -d create directories instead of installing files. + -g GROUP $chgrpprog installed files to GROUP. + -m MODE $chmodprog installed files to MODE. + -o USER $chownprog installed files to USER. + -s $stripprog installed files. + -t DIRECTORY install into DIRECTORY. + -T report an error if DSTFILE is a directory. Environment variables override the default commands: - CHGRPPROG CHMODPROG CHOWNPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG + CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG + RMPROG STRIPPROG " while test $# -ne 0; do case $1 in - -c) shift - continue;; + -c) ;; - -d) dir_arg=true - shift - continue;; + -C) copy_on_change=true;; + + -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" - shift - shift - continue;; + shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 - shift - shift - continue;; + case $mode in + *' '* | *' '* | *' +'* | *'*'* | *'?'* | *'['*) + echo "$0: invalid mode: $mode" >&2 + exit 1;; + esac + shift;; -o) chowncmd="$chownprog $2" - shift - shift - continue;; + shift;; - -s) stripcmd=$stripprog - shift - continue;; + -s) stripcmd=$stripprog;; - -t) dstarg=$2 - shift - shift - continue;; + -t) dst_arg=$2 + shift;; - -T) no_target_directory=true - shift - continue;; + -T) no_target_directory=true;; --version) echo "$0 $scriptversion"; exit $?;; @@ -163,21 +170,22 @@ while test $# -ne 0; do *) break;; esac + shift done -if test $# -ne 0 && test -z "$dir_arg$dstarg"; then +if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do - if test -n "$dstarg"; then + if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. - set fnord "$@" "$dstarg" + set fnord "$@" "$dst_arg" shift # fnord fi shift # arg - dstarg=$arg + dst_arg=$arg done fi @@ -191,13 +199,38 @@ if test $# -eq 0; then exit 0 fi -test -n "$dir_arg" || trap '(exit $?); exit' 1 2 13 15 +if test -z "$dir_arg"; then + trap '(exit $?); exit' 1 2 13 15 + + # Set umask so as not to create temps with too-generous modes. + # However, 'strip' requires both read and write access to temps. + case $mode in + # Optimize common cases. + *644) cp_umask=133;; + *755) cp_umask=22;; + + *[0-7]) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw='% 200' + fi + cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; + *) + if test -z "$stripcmd"; then + u_plus_rw= + else + u_plus_rw=,u+rw + fi + cp_umask=$mode$u_plus_rw;; + esac +fi for src do # Protect names starting with `-'. case $src in - -*) src=./$src ;; + -*) src=./$src;; esac if test -n "$dir_arg"; then @@ -215,22 +248,22 @@ do exit 1 fi - if test -z "$dstarg"; then + if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi - dst=$dstarg + dst=$dst_arg # Protect names starting with `-'. case $dst in - -*) dst=./$dst ;; + -*) dst=./$dst;; esac # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test -n "$no_target_directory"; then - echo "$0: $dstarg: Is a directory" >&2 + echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst @@ -274,68 +307,96 @@ do if test $dstdir_status != 0; then case $posix_mkdir in '') - posix_mkdir=false - if $mkdirprog -m $test_mode -p -- / >/dev/null 2>&1; then - posix_mkdir=true + # Create intermediate dirs using mode 755 as modified by the umask. + # This is like FreeBSD 'install' as of 1997-10-28. + umask=`umask` + case $stripcmd.$umask in + # Optimize common cases. + *[2367][2367]) mkdir_umask=$umask;; + .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; + + *[0-7]) + mkdir_umask=`expr $umask + 22 \ + - $umask % 100 % 40 + $umask % 20 \ + - $umask % 10 % 4 + $umask % 2 + `;; + *) mkdir_umask=$umask,go-w;; + esac + + # With -d, create the new directory with the user-specified mode. + # Otherwise, rely on $mkdir_umask. + if test -n "$dir_arg"; then + mkdir_mode=-m$mode else - # Remove any dirs left behind by ancient mkdir implementations. - rmdir ./-m "$test_mode" ./-p ./-- 2>/dev/null - fi ;; + mkdir_mode= + fi + + posix_mkdir=false + case $umask in + *[123567][0-7][0-7]) + # POSIX mkdir -p sets u+wx bits regardless of umask, which + # is incompatible with FreeBSD 'install' when (umask & 300) != 0. + ;; + *) + tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ + trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 + + if (umask $mkdir_umask && + exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 + then + if test -z "$dir_arg" || { + # Check for POSIX incompatibilities with -m. + # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or + # other-writeable bit of parent directory when it shouldn't. + # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. + ls_ld_tmpdir=`ls -ld "$tmpdir"` + case $ls_ld_tmpdir in + d????-?r-*) different_mode=700;; + d????-?--*) different_mode=755;; + *) false;; + esac && + $mkdirprog -m$different_mode -p -- "$tmpdir" && { + ls_ld_tmpdir_1=`ls -ld "$tmpdir"` + test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" + } + } + then posix_mkdir=: + fi + rmdir "$tmpdir/d" "$tmpdir" + else + # Remove any dirs left behind by ancient mkdir implementations. + rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null + fi + trap '' 0;; + esac;; esac if - $posix_mkdir && { - - # With -d, create the new directory with the user-specified mode. - # Otherwise, create it using the same intermediate mode that - # mkdir -p would use when creating intermediate directories. - # POSIX says that this mode is "$(umask -S),u+wx", so use that - # if umask -S works. - - if test -n "$dir_arg"; then - mkdir_mode=$mode - else - case $intermediate_mode in - '') - if umask_S=`(umask -S) 2>/dev/null`; then - intermediate_mode=$umask_S,u+wx - else - intermediate_mode=$test_mode - fi ;; - esac - mkdir_mode=$intermediate_mode - fi - - $mkdirprog -m "$mkdir_mode" -p -- "$dstdir" - } + $posix_mkdir && ( + umask $mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" + ) then : else - # mkdir does not conform to POSIX, or it failed possibly due to - # a race condition. Create the directory the slow way, step by - # step, checking for races as we go. + # The umask is ridiculous, or mkdir does not conform to POSIX, + # or it failed possibly due to a race condition. Create the + # directory the slow way, step by step, checking for races as we go. case $dstdir in - /*) prefix=/ ;; - -*) prefix=./ ;; - *) prefix= ;; + /*) prefix='/';; + -*) prefix='./';; + *) prefix='';; esac - case $posix_glob in - '') - if (set -f) 2>/dev/null; then - posix_glob=true - else - posix_glob=false - fi ;; - esac + eval "$initialize_posix_glob" oIFS=$IFS IFS=/ - $posix_glob && set -f + $posix_glob set -f set fnord $dstdir shift - $posix_glob && set +f + $posix_glob set +f IFS=$oIFS prefixes= @@ -349,7 +410,8 @@ do prefixes= else if $posix_mkdir; then - $mkdirprog -m "$mkdir_mode" -p -- "$dstdir" && break + (umask=$mkdir_umask && + $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else @@ -365,7 +427,9 @@ do if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. - eval "\$mkdirprog $prefixes" || test -d "$dstdir" || exit 1 + (umask $mkdir_umask && + eval "\$doit_exec \$mkdirprog $prefixes") || + test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi @@ -375,7 +439,7 @@ do { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || - test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dst"; } || exit 1 + test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. @@ -386,7 +450,7 @@ do trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. - $doit $cpprog "$src" "$dsttmp" && + (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # @@ -394,41 +458,54 @@ do # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # - { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } \ - && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } \ - && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } \ - && { test -z "$chmodcmd" || $doit $chmodcmd "$mode" "$dsttmp"; } && + { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && + { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && + { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && + { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && - # Now rename the file to the real destination. - { $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null \ - || { - # The rename failed, perhaps because mv can't rename something else - # to itself, or perhaps because mv is so ancient that it does not - # support -f. + # If -C, don't bother to copy if it wouldn't change the file. + if $copy_on_change && + old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && + new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && - # Now remove or move aside any old file at destination location. - # We try this two ways since rm can't unlink itself on some - # systems and the destination file might be busy for other - # reasons. In this case, the final cleanup might fail but the new - # file should still install successfully. - { - if test -f "$dst"; then - $doit $rmcmd -f "$dst" 2>/dev/null \ - || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null \ - && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }; }\ - || { - echo "$0: cannot unlink or rename $dst" >&2 - (exit 1); exit 1 - } - else - : - fi - } && + eval "$initialize_posix_glob" && + $posix_glob set -f && + set X $old && old=:$2:$4:$5:$6 && + set X $new && new=:$2:$4:$5:$6 && + $posix_glob set +f && - # Now rename the file to the real destination. - $doit $mvcmd "$dsttmp" "$dst" - } - } || exit 1 + test "$old" = "$new" && + $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 + then + rm -f "$dsttmp" + else + # Rename the file to the real destination. + $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || + + # The rename failed, perhaps because mv can't rename something else + # to itself, or perhaps because mv is so ancient that it does not + # support -f. + { + # Now remove or move aside any old file at destination location. + # We try this two ways since rm can't unlink itself on some + # systems and the destination file might be busy for other + # reasons. In this case, the final cleanup might fail but the new + # file should still install successfully. + { + test ! -f "$dst" || + $doit $rmcmd -f "$dst" 2>/dev/null || + { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && + { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } + } || + { echo "$0: cannot unlink or rename $dst" >&2 + (exit 1); exit 1 + } + } && + + # Now rename the file to the real destination. + $doit $mvcmd "$dsttmp" "$dst" + } + fi || exit 1 trap '' 0 fi From 90fd32d1bd0973e06a5a106169c959e2d293ef19 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 1 Mar 2008 22:03:15 +0000 Subject: [PATCH 0065/1707] Fix wrong commit date. --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5f96301ff..c629b874a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -577,7 +577,7 @@ include/grub/i386/pc/pci.h, video/readers/jpeg.c, and video/readers/png.c. -2008-01-31 Bean +2008-02-03 Bean * conf/i386-pc.rmk (pkglib_IMAGES): Add cdboot.img. (cdboot_img_SOURCES): New variable. From 2b89344ec43c399056866fa3e5f924278faa20a8 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 2 Mar 2008 08:16:52 +0000 Subject: [PATCH 0066/1707] 2008-03-02 Bean * fs/reiserfs.c (grub_reiserfs_read_symlink): Add 0 at the end of symlink_buffer. --- ChangeLog | 5 +++++ fs/reiserfs.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c629b874a..07580f863 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-03-02 Bean + + * fs/reiserfs.c (grub_reiserfs_read_symlink): Add 0 at the end of + symlink_buffer. + 2008-03-01 Yoshinori K. Okuji * DISTLIST: Added docs/fdl.texi, docs/grub.texi, docs/mdate-sh and diff --git a/fs/reiserfs.c b/fs/reiserfs.c index a4c60ca8b..b536b21fd 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -659,7 +659,7 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) >> GRUB_DISK_SECTOR_BITS); offset = grub_le_to_cpu16 (found.header.item_location); - symlink_buffer = grub_malloc (len); + symlink_buffer = grub_malloc (len + 1); if (! symlink_buffer) goto fail; @@ -667,6 +667,7 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) if (grub_errno) goto fail; + symlink_buffer[len] = 0; return symlink_buffer; fail: From 38ad2cf5a52f886b6703a129f8f8034a8962205b Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 5 Mar 2008 05:09:35 +0000 Subject: [PATCH 0067/1707] 2008-03-05 Bean * loader/i386/pc/multiboot.c (grub_multiboot_get_bootdev): New function. (grub_multiboot): Set boot device. * boot/i386/pc/lnxboot.S (real_code_2): Set %dh to 0xFF. --- ChangeLog | 7 ++++++ boot/i386/pc/lnxboot.S | 4 +++- loader/i386/pc/multiboot.c | 49 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 07580f863..c50e59224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-03-05 Bean + + * loader/i386/pc/multiboot.c (grub_multiboot_get_bootdev): New function. + (grub_multiboot): Set boot device. + + * boot/i386/pc/lnxboot.S (real_code_2): Set %dh to 0xFF. + 2008-03-02 Bean * fs/reiserfs.c (grub_reiserfs_read_symlink): Add 0 at the end of diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index 2a913ba9c..955cc419d 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -115,7 +115,7 @@ gdt_dst2: .long 0, 0, 0, 0 /* More space for the BIOS. */ reg_edx: - .byte 0x80, 0xFF, 0xFF, 0xFF + .byte 0x80, 0, 0xFF, 0xFF data_leng: .long 0 @@ -207,6 +207,8 @@ real_code_2: movsbl (reg_edx + 2 - start), %eax movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART) + movb $0xFF, %dh + ljmp $(DATA_ADDR >> 4), $0 /* diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 67959cfb2..ac2cf2da8 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -44,6 +44,7 @@ #include #include #include +#include extern grub_dl_t my_mod; static struct grub_multiboot_info *mbi; @@ -261,6 +262,51 @@ grub_multiboot_load_elf (grub_file_t file, void *buffer) return grub_error (GRUB_ERR_UNKNOWN_OS, "unknown ELF class"); } +static int +grub_multiboot_get_bootdev (grub_uint32_t *bootdev) +{ + char *p; + + p = grub_env_get ("root"); + if ((p) && ((p[0] == 'h') || (p[0] == 'f')) && (p[1] == 'd') && + (p[2] >= '0') && (p[2] <= '9')) + { + grub_uint32_t bd; + + bd = (p[0] == 'h') ? 0x80 : 0; + bd += grub_strtoul (p + 2, &p, 0); + bd <<= 24; + + if ((p) && (p[0] == ',')) + { + if ((p[1] >= '0') && (p[1] <= '9')) + { + + bd += ((grub_strtoul (p + 1, &p, 0) - 1) & 0xFF) << 16; + + if ((p) && (p[0] == ',')) + p++; + } + else + bd += 0xFF0000; + + if ((p[0] >= 'a') && (p[0] <= 'z')) + bd += (p[0] - 'a') << 8; + else + bd += 0xFF00; + } + else + bd += 0xFFFF00; + + bd += 0xFF; + + *bootdev = bd; + return 1; + } + + return 0; +} + void grub_multiboot (int argc, char *argv[]) { @@ -368,6 +414,9 @@ grub_multiboot (int argc, char *argv[]) mbi->flags |= MULTIBOOT_INFO_BOOT_LOADER_NAME; mbi->boot_loader_name = (grub_uint32_t) grub_strdup (PACKAGE_STRING); + if (grub_multiboot_get_bootdev (&mbi->boot_device)) + mbi->flags |= MULTIBOOT_INFO_BOOTDEV; + grub_loader_set (grub_multiboot_boot, grub_multiboot_unload, 1); fail: From 68e7fc7aa887075fd4160f2db9532d4b30de3408 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 20 Mar 2008 21:00:15 +0000 Subject: [PATCH 0068/1707] 2008-03-20 Robert Millan Remove 2 TiB limit in ata.mod. * disk/ata.c (grub_ata_device): Promote `size' to grub_uint64_t. (grub_ata_dumpinfo): Print sector count with 0x%llx. (grub_ata_identify): Interpret `&info16[100]' as a pointer to grub_uint64_t instead of grub_uint32_t. --- ChangeLog | 8 ++++++++ disk/ata.c | 7 +++---- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c50e59224..5f411de40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-20 Robert Millan + + Remove 2 TiB limit in ata.mod. + * disk/ata.c (grub_ata_device): Promote `size' to grub_uint64_t. + (grub_ata_dumpinfo): Print sector count with 0x%llx. + (grub_ata_identify): Interpret `&info16[100]' as a pointer to + grub_uint64_t instead of grub_uint32_t. + 2008-03-05 Bean * loader/i386/pc/multiboot.c (grub_multiboot_get_bootdev): New function. diff --git a/disk/ata.c b/disk/ata.c index 30dea7918..90ed0e101 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -86,7 +86,7 @@ struct grub_ata_device grub_ata_addressing_t addr; /* Sector count. */ - grub_size_t size; + grub_uint64_t size; /* CHS maximums. */ grub_uint16_t cylinders; @@ -214,8 +214,7 @@ grub_ata_dumpinfo (struct grub_ata_device *dev, char *info) grub_printf ("Model: %s\n", text); grub_printf ("Addressing: %d\n", dev->addr); - grub_printf ("#sectors: %d\n", dev->size); - + grub_printf ("#sectors: 0x%llx\n", dev->size); } static grub_err_t @@ -315,7 +314,7 @@ grub_ata_identify (struct grub_ata_device *dev) if (dev->addr != GRUB_ATA_LBA48) dev->size = grub_le_to_cpu32(*((grub_uint32_t *) &info16[60])); else - dev->size = grub_le_to_cpu64(*((grub_uint32_t *) &info16[100])); + dev->size = grub_le_to_cpu64(*((grub_uint64_t *) &info16[100])); /* Read CHS information. */ dev->cylinders = info16[1]; From bf962df2daeb032fbeb5a15890523f28f015241f Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 24 Mar 2008 04:13:37 +0000 Subject: [PATCH 0069/1707] 2008-03-24 Bean * disk/i386/pc/biosdisk.c (cd_start): Removed. (cd_count): Removed. (cd_drive): New variable. (grub_biosdisk_get_drive): Don't check for (cdN) device. (grub_biosdisk_call_hook): Likewise. (grub_biosdisk_iterate): Change cdrom detection method. (grub_biosdisk_open): Replace cd_start with cd_drive. (GRUB_MOD_INIT): Use grub_biosdisk_get_cdinfo_int13_extension to detect cdrom device. * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_MACHINE_CDROM_START): Removed. (GRUB_BIOSDISK_MACHINE_CDROM_END): Removed. (GRUB_BIOSDISK_CDTYPE_NO_EMUL): New macro. (GRUB_BIOSDISK_CDTYPE_1_2_M): Likewise. (GRUB_BIOSDISK_CDTYPE_1_44_M): Likewise. (GRUB_BIOSDISK_CDTYPE_2_88_M): Likewise. (GRUB_BIOSDISK_CDTYPE_HARDDISK): Likewise. (GRUB_BIOSDISK_CDTYPE_MASK): Likewise. (grub_biosdisk_cdrp): New structure. (grub_biosdisk_get_cdinfo_int13_extensions): New function. * include/grub/i386/pc/kernel.h (grub_boot_drive): Export this variable. * kern/i386/pc/init.c (make_install_device): Don't use (cdN) as root device. * kern/i386/pc/startup.S (grub_biosdisk_get_cdinfo_int13_extensions): New function. --- ChangeLog | 32 ++++++++++++++++++++ disk/i386/pc/biosdisk.c | 52 +++++++++++++-------------------- include/grub/i386/pc/biosdisk.h | 28 ++++++++++++++++-- include/grub/i386/pc/kernel.h | 2 +- kern/i386/pc/init.c | 10 ++----- kern/i386/pc/startup.S | 15 +++++++++- 6 files changed, 95 insertions(+), 44 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5f411de40..620f68bf0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,35 @@ +2008-03-24 Bean + + * disk/i386/pc/biosdisk.c (cd_start): Removed. + (cd_count): Removed. + (cd_drive): New variable. + (grub_biosdisk_get_drive): Don't check for (cdN) device. + (grub_biosdisk_call_hook): Likewise. + (grub_biosdisk_iterate): Change cdrom detection method. + (grub_biosdisk_open): Replace cd_start with cd_drive. + (GRUB_MOD_INIT): Use grub_biosdisk_get_cdinfo_int13_extension to + detect cdrom device. + + * include/grub/i386/pc/biosdisk.h (GRUB_BIOSDISK_MACHINE_CDROM_START): + Removed. + (GRUB_BIOSDISK_MACHINE_CDROM_END): Removed. + (GRUB_BIOSDISK_CDTYPE_NO_EMUL): New macro. + (GRUB_BIOSDISK_CDTYPE_1_2_M): Likewise. + (GRUB_BIOSDISK_CDTYPE_1_44_M): Likewise. + (GRUB_BIOSDISK_CDTYPE_2_88_M): Likewise. + (GRUB_BIOSDISK_CDTYPE_HARDDISK): Likewise. + (GRUB_BIOSDISK_CDTYPE_MASK): Likewise. + (grub_biosdisk_cdrp): New structure. + (grub_biosdisk_get_cdinfo_int13_extensions): New function. + + * include/grub/i386/pc/kernel.h (grub_boot_drive): Export this variable. + + * kern/i386/pc/init.c (make_install_device): Don't use (cdN) as root + device. + + * kern/i386/pc/startup.S (grub_biosdisk_get_cdinfo_int13_extensions): + New function. + 2008-03-20 Robert Millan Remove 2 TiB limit in ata.mod. diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index ddcc6663b..793c11df7 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -18,6 +18,7 @@ #include #include +#include #include #include #include @@ -26,15 +27,14 @@ #include #include -static int cd_start = GRUB_BIOSDISK_MACHINE_CDROM_START; -static int cd_count = 0; +int cd_drive = 0; static int grub_biosdisk_get_drive (const char *name) { unsigned long drive; - if ((name[0] != 'f' && name[0] != 'h' && name[0] != 'c') || name[1] != 'd') + if ((name[0] != 'f' && name[0] != 'h') || name[1] != 'd') goto fail; drive = grub_strtoul (name + 2, 0, 10); @@ -43,8 +43,6 @@ grub_biosdisk_get_drive (const char *name) if (name[0] == 'h') drive += 0x80; - else if (name[0] == 'c') - drive += cd_start; return (int) drive ; @@ -58,9 +56,6 @@ grub_biosdisk_call_hook (int (*hook) (const char *name), int drive) { char name[10]; - if (drive >= cd_start) - grub_sprintf (name, "cd%d", drive - cd_start); - else grub_sprintf (name, (drive & 0x80) ? "hd%d" : "fd%d", drive & (~0x80)); return hook (name); } @@ -91,9 +86,11 @@ grub_biosdisk_iterate (int (*hook) (const char *name)) return 1; } - for (drive = cd_start; drive < cd_start + cd_count; drive++) - if (grub_biosdisk_call_hook (hook, drive)) + if (cd_drive) + { + if (grub_biosdisk_call_hook (hook, cd_drive)) return 1; + } return 0; } @@ -109,7 +106,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) if (drive < 0) return grub_errno; - disk->has_partitions = ((drive & 0x80) && (drive < cd_start)); + disk->has_partitions = ((drive & 0x80) && (drive != cd_drive)); disk->id = drive; data = (struct grub_biosdisk_data *) grub_malloc (sizeof (*data)); @@ -119,7 +116,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) data->drive = drive; data->flags = 0; - if (drive >= cd_start) + if ((cd_drive) && (drive == cd_drive)) { data->flags = GRUB_BIOSDISK_FLAG_LBA | GRUB_BIOSDISK_FLAG_CDROM; data->sectors = 32; @@ -154,7 +151,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) } } - if (drive < cd_start) + if (! (data->flags & GRUB_BIOSDISK_FLAG_CDROM)) { if (grub_biosdisk_get_diskinfo_standard (drive, &data->cylinders, @@ -364,7 +361,8 @@ grub_disk_biosdisk_fini (void) GRUB_MOD_INIT(biosdisk) { - int drive, found = 0; + struct grub_biosdisk_cdrp *cdrp + = (struct grub_biosdisk_cdrp *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; if (grub_disk_firmware_is_tainted) { @@ -373,25 +371,15 @@ GRUB_MOD_INIT(biosdisk) } grub_disk_firmware_fini = grub_disk_biosdisk_fini; + grub_memset (cdrp, 0, sizeof (*cdrp)); + cdrp->size = sizeof (*cdrp); + cdrp->media_type = 0xFF; + if ((! grub_biosdisk_get_cdinfo_int13_extensions (grub_boot_drive, cdrp)) && + ((cdrp->media_type & GRUB_BIOSDISK_CDTYPE_MASK) + == GRUB_BIOSDISK_CDTYPE_NO_EMUL)) + cd_drive = cdrp->drive_no; + grub_disk_dev_register (&grub_biosdisk_dev); - - for (drive = GRUB_BIOSDISK_MACHINE_CDROM_START; - drive < GRUB_BIOSDISK_MACHINE_CDROM_END; drive++) - { - if (grub_biosdisk_check_int13_extensions (drive)) - { - if (! found) - cd_start = drive; - found++; - } - else - { - if (found) - break; - } - } - - cd_count = found; } GRUB_MOD_FINI(biosdisk) diff --git a/include/grub/i386/pc/biosdisk.h b/include/grub/i386/pc/biosdisk.h index 770f94254..05d5dc571 100644 --- a/include/grub/i386/pc/biosdisk.h +++ b/include/grub/i386/pc/biosdisk.h @@ -25,8 +25,13 @@ #define GRUB_BIOSDISK_FLAG_LBA 1 #define GRUB_BIOSDISK_FLAG_CDROM 2 -#define GRUB_BIOSDISK_MACHINE_CDROM_START 0xe0 -#define GRUB_BIOSDISK_MACHINE_CDROM_END 0xf0 +#define GRUB_BIOSDISK_CDTYPE_NO_EMUL 0 +#define GRUB_BIOSDISK_CDTYPE_1_2_M 1 +#define GRUB_BIOSDISK_CDTYPE_1_44_M 2 +#define GRUB_BIOSDISK_CDTYPE_2_88_M 3 +#define GRUB_BIOSDISK_CDTYPE_HARDDISK 4 + +#define GRUB_BIOSDISK_CDTYPE_MASK 0xF struct grub_biosdisk_data { @@ -74,6 +79,23 @@ struct grub_biosdisk_drp grub_uint8_t dummy[16]; } __attribute__ ((packed)); +struct grub_biosdisk_cdrp +{ + grub_uint8_t size; + grub_uint8_t media_type; + grub_uint8_t drive_no; + grub_uint8_t controller_no; + grub_uint32_t image_lba; + grub_uint16_t device_spec; + grub_uint16_t cache_seg; + grub_uint16_t load_seg; + grub_uint16_t length_sec512; + grub_uint8_t cylinders; + grub_uint8_t sectors; + grub_uint8_t heads; + grub_uint8_t dummy[16]; +} __attribute__ ((packed)); + /* Disk Address Packet. */ struct grub_biosdisk_dap { @@ -90,6 +112,8 @@ int EXPORT_FUNC(grub_biosdisk_rw_standard) (int ah, int drive, int coff, int hof int EXPORT_FUNC(grub_biosdisk_check_int13_extensions) (int drive); int EXPORT_FUNC(grub_biosdisk_get_diskinfo_int13_extensions) (int drive, void *drp); +int EXPORT_FUNC(grub_biosdisk_get_cdinfo_int13_extensions) (int drive, + void *cdrp); int EXPORT_FUNC(grub_biosdisk_get_diskinfo_standard) (int drive, unsigned long *cylinders, unsigned long *heads, diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index 848dad10d..43a8d5b6e 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -71,7 +71,7 @@ extern grub_int32_t grub_memdisk_image_size; extern char grub_prefix[]; /* The boot BIOS drive number. */ -extern grub_int32_t grub_boot_drive; +extern grub_int32_t EXPORT_VAR(grub_boot_drive); /* The root BIOS drive number. */ extern grub_int32_t grub_root_drive; diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 72374929c..757f5d5c5 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include @@ -77,13 +76,8 @@ make_install_device (void) if (grub_root_drive == 0xFF) grub_root_drive = grub_boot_drive; - if (grub_root_drive >= GRUB_BIOSDISK_MACHINE_CDROM_START) - grub_sprintf (dev, "(cd%u", - grub_root_drive - GRUB_BIOSDISK_MACHINE_CDROM_START); - else - grub_sprintf (dev, "(%cd%u", - (grub_root_drive & 0x80) ? 'h' : 'f', - grub_root_drive & 0x7f); + grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f', + grub_root_drive & 0x7f); if (grub_install_dos_part >= 0) grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1); diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index bf3d4eee3..35b19fda7 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -779,6 +779,17 @@ FUNCTION(grub_biosdisk_check_int13_extensions) ret +/* + * int grub_biosdisk_get_cdinfo_int13_extensions (int drive, void *cdrp) + * + * Return the cdrom information of DRIVE in CDRP. If an error occurs, + * then return non-zero, otherwise zero. + */ + +FUNCTION(grub_biosdisk_get_cdinfo_int13_extensions) + movw $0x4B01, %cx + jmp 1f + /* * int grub_biosdisk_get_diskinfo_int13_extensions (int drive, void *drp) * @@ -787,6 +798,8 @@ FUNCTION(grub_biosdisk_check_int13_extensions) */ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions) + movb $0x48, %ch +1: pushl %ebp pushl %ebx pushl %esi @@ -802,7 +815,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions) call prot_to_real .code16 - movb $0x48, %ah + movw %cx, %ax movw %bx, %ds int $0x13 /* do the operation */ movb %ah, %bl /* save return value in %bl */ From a303c7835f9530057361f1406b91f513b6eb5196 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 25 Mar 2008 02:52:15 +0000 Subject: [PATCH 0070/1707] Regenerate --- conf/i386-ieee1275.mk | 54 +++++++++++++++++++++++++++++++++++++++++- conf/i386-linuxbios.mk | 7 +++--- 2 files changed, 56 insertions(+), 5 deletions(-) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 48200f1ed..4d19fb40f 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -569,7 +569,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ - multiboot.mod _multiboot.mod serial.mod + multiboot.mod _multiboot.mod aout.mod serial.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -974,6 +974,58 @@ fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_nor multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For aout.mod. +aout_mod_SOURCES = loader/aout.c +CLEANFILES += aout.mod mod-aout.o mod-aout.c pre-aout.o aout_mod-loader_aout.o und-aout.lst +ifneq ($(aout_mod_EXPORTS),no) +CLEANFILES += def-aout.lst +DEFSYMFILES += def-aout.lst +endif +MOSTLYCLEANFILES += aout_mod-loader_aout.d +UNDSYMFILES += und-aout.lst + +aout.mod: pre-aout.o mod-aout.o + -rm -f $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o + -rm -f $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ aout_mod-loader_aout.o + +mod-aout.o: mod-aout.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< + +mod-aout.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(aout_mod_EXPORTS),no) +def-aout.lst: pre-aout.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 aout/' > $@ +endif + +und-aout.lst: pre-aout.o + echo 'aout' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< +-include aout_mod-loader_aout.d + +CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst +COMMANDFILES += cmd-aout_mod-loader_aout.lst +FSFILES += fs-aout_mod-loader_aout.lst + +cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) + +fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) + + +aout_mod_CFLAGS = $(COMMON_CFLAGS) +aout_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For suspend.mod suspend_mod_SOURCES = commands/ieee1275/suspend.c CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o und-suspend.lst diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 7be8f8cf5..457102169 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -547,9 +547,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ - _multiboot.mod multiboot.mod play.mod \ - cpuid.mod serial.mod ata.mod \ - aout.mod + _multiboot.mod multiboot.mod aout.mod \ + play.mod cpuid.mod serial.mod ata.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -1126,7 +1125,7 @@ fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_nor multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For aout.mod +# For aout.mod. aout_mod_SOURCES = loader/aout.c CLEANFILES += aout.mod mod-aout.o mod-aout.c pre-aout.o aout_mod-loader_aout.o und-aout.lst ifneq ($(aout_mod_EXPORTS),no) From c5dfd43b5f94c42f3ec27337b35fd193400a8de8 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 26 Mar 2008 13:01:02 +0000 Subject: [PATCH 0071/1707] 2008-03-26 Pavel Roskin * normal/color.c (grub_parse_color_name_pair): Make `name' a const. * include/grub/normal.h: Add grub_parse_color_name_pair() declaration. --- ChangeLog | 7 +++++++ include/grub/normal.h | 1 + normal/color.c | 2 +- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 620f68bf0..8fbff3129 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-03-26 Pavel Roskin + + * normal/color.c (grub_parse_color_name_pair): Make `name' a + const. + * include/grub/normal.h: Add grub_parse_color_name_pair() + declaration. + 2008-03-24 Bean * disk/i386/pc/biosdisk.c (cd_start): Removed. diff --git a/include/grub/normal.h b/include/grub/normal.h index f69ea2b83..9ed47877c 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -157,6 +157,7 @@ grub_err_t grub_normal_menu_addentry (const char *title, const char *sourcecode); char *grub_env_write_color_normal (struct grub_env_var *var, const char *val); char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val); +void grub_parse_color_name_pair (grub_uint8_t *ret, const char *name); void grub_wait_after_message (void); #ifdef GRUB_UTIL diff --git a/normal/color.c b/normal/color.c index dc6d8aad4..340e43a02 100644 --- a/normal/color.c +++ b/normal/color.c @@ -56,7 +56,7 @@ parse_color_name (grub_uint8_t *ret, char *name) } void -grub_parse_color_name_pair (grub_uint8_t *ret, char *name) +grub_parse_color_name_pair (grub_uint8_t *ret, const char *name) { grub_uint8_t fg, bg; char *fg_name, *bg_name; From 77bcd272073b2f4dad88b58a2b869804b7655866 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 28 Mar 2008 17:06:29 +0000 Subject: [PATCH 0072/1707] 2008-03-28 Pavel Roskin * kern/i386/pc/startup.S (grub_biosdisk_get_diskinfo_int13_extensions): When converting data block address to the real mode, keep offset minimal. This works around a bug in AWARD BIOS on old Athlon systems, which makes CD detection hang. --- ChangeLog | 8 ++++++++ kern/i386/pc/startup.S | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8fbff3129..d94121968 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-28 Pavel Roskin + + * kern/i386/pc/startup.S + (grub_biosdisk_get_diskinfo_int13_extensions): When converting + data block address to the real mode, keep offset minimal. This + works around a bug in AWARD BIOS on old Athlon systems, which + makes CD detection hang. + 2008-03-26 Pavel Roskin * normal/color.c (grub_parse_color_name_pair): Make `name' a diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 35b19fda7..635630d94 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -806,7 +806,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions) /* compute the address of drive parameters */ movw %dx, %si - xorw %dx, %dx + andl $0xf, %esi shrl $4, %edx movw %dx, %bx /* save the segment into %bx */ /* drive */ From 80a3e68b59e2ce37912ebdc765dde4b0f8795ede Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 28 Mar 2008 17:16:46 +0000 Subject: [PATCH 0073/1707] 2008-03-28 Pavel Roskin * kern/i386/pc/startup.S: Assert that uncompressed functions don't spill beyond GRUB_KERNEL_MACHINE_RAW_SIZE. * kern/i386/pc/lzo1x.S: Remove all .align directives in the code, as they push parts of the code (error handlers) beyond GRUB_KERNEL_MACHINE_RAW_SIZE. Speed is not as important in this code as correctness and size. --- ChangeLog | 9 +++++++++ kern/i386/pc/lzo1x.S | 7 ------- kern/i386/pc/startup.S | 5 +++++ 3 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d94121968..e55acf9ce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-03-28 Pavel Roskin + + * kern/i386/pc/startup.S: Assert that uncompressed functions + don't spill beyond GRUB_KERNEL_MACHINE_RAW_SIZE. + * kern/i386/pc/lzo1x.S: Remove all .align directives in the + code, as they push parts of the code (error handlers) beyond + GRUB_KERNEL_MACHINE_RAW_SIZE. Speed is not as important in this + code as correctness and size. + 2008-03-28 Pavel Roskin * kern/i386/pc/startup.S diff --git a/kern/i386/pc/lzo1x.S b/kern/i386/pc/lzo1x.S index 22ec42590..e942e98d6 100644 --- a/kern/i386/pc/lzo1x.S +++ b/kern/i386/pc/lzo1x.S @@ -73,7 +73,6 @@ lzo1x_decompress: jmp 3f - .align 8 .L00: LODSB .L01: @@ -119,7 +118,6 @@ lzo1x_decompress: // M2 ************************************************************************/ - .align 8 .LMATCH: cmpb $64, %al jb .LM3MATCH @@ -156,7 +154,6 @@ lzo1x_decompress: jmp 3f - .align 8 .LM3MATCH: cmpb $32, %al jb .LM4MATCH @@ -180,7 +177,6 @@ lzo1x_decompress: // copy match ************************************************************************/ - .align 2 .LCOPYLONG: /* copy match using longwords */ leal -3(%edi,%ecx), %eax shrl $2, %ecx @@ -202,7 +198,6 @@ lzo1x_decompress: jmp .LMATCH - .align 8 .LCOPYBYTE: /* copy match using bytes */ xchgl %edx,%esi subl N_3,%ecx @@ -226,7 +221,6 @@ lzo1x_decompress: jmp 3f - .align 8 .LM4MATCH: cmpb $16, %al jb .LM1MATCH @@ -252,7 +246,6 @@ lzo1x_decompress: // M1 ************************************************************************/ - .align 8 .LM1MATCH: /* a M1 match */ shrl $2, %eax diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 635630d94..fa404a003 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -478,6 +478,11 @@ gate_a20_check_state: #include "lzo1x.S" +/* + * The code beyond this point is compressed. Assert that the uncompressed + * code fits GRUB_KERNEL_MACHINE_RAW_SIZE. + */ + . = EXT_C(start) + GRUB_KERNEL_MACHINE_RAW_SIZE /* * This call is special... it never returns... in fact it should simply From 17c74c21f0e0ecfc3754a04488b1f4f9b5159303 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 30 Mar 2008 04:13:47 +0000 Subject: [PATCH 0074/1707] 2008-03-30 Pavel Roskin * kern/i386/pc/startup.S (real_to_prot): Use %cs prefix to load GDT. This is more robust, as %ds can change. (grub_biosdisk_rw_int13_extensions): Don't clear %ds before calling real_to_prot(). (grub_biosdisk_get_diskinfo_int13_extensions): Likewise. --- ChangeLog | 8 ++++++++ kern/i386/pc/startup.S | 8 +------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e55acf9ce..b6753c10c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-03-30 Pavel Roskin + + * kern/i386/pc/startup.S (real_to_prot): Use %cs prefix to load + GDT. This is more robust, as %ds can change. + (grub_biosdisk_rw_int13_extensions): Don't clear %ds before + calling real_to_prot(). + (grub_biosdisk_get_diskinfo_int13_extensions): Likewise. + 2008-03-28 Pavel Roskin * kern/i386/pc/startup.S: Assert that uncompressed functions diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index fa404a003..5d4bbcb99 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -291,7 +291,7 @@ real_to_prot: cli /* load the GDT register */ - DATA32 ADDR32 lgdt gdtdesc + DATA32 ADDR32 lgdt %cs:gdtdesc /* turn on protected mode */ movl %cr0, %eax @@ -649,9 +649,6 @@ FUNCTION(grub_biosdisk_rw_int13_extensions) movw %cx, %ds int $0x13 /* do the operation */ movb %ah, %dl /* save return value */ - /* clear the data segment */ - xorw %ax, %ax - movw %ax, %ds /* back to protected mode */ DATA32 call real_to_prot .code32 @@ -824,9 +821,6 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions) movw %bx, %ds int $0x13 /* do the operation */ movb %ah, %bl /* save return value in %bl */ - /* clear the data segment */ - xorw %ax, %ax - movw %ax, %ds /* back to protected mode */ DATA32 call real_to_prot .code32 From 7cdacf9717810b1fa761bd1b1c0d84b60244209c Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 30 Mar 2008 05:05:01 +0000 Subject: [PATCH 0075/1707] 2008-03-30 Pavel Roskin * commands/i386/cpuid.c (has_longmode): Make static. * disk/i386/pc/biosdisk.c (cd_drive): Likewise. * include/grub/i386/bsd.h (bios_memmap_t): Remove, it's unused. --- ChangeLog | 4 ++++ commands/i386/cpuid.c | 2 +- disk/i386/pc/biosdisk.c | 2 +- include/grub/i386/bsd.h | 2 +- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b6753c10c..b96141de8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-03-30 Pavel Roskin + * commands/i386/cpuid.c (has_longmode): Make static. + * disk/i386/pc/biosdisk.c (cd_drive): Likewise. + * include/grub/i386/bsd.h (bios_memmap_t): Remove, it's unused. + * kern/i386/pc/startup.S (real_to_prot): Use %cs prefix to load GDT. This is more robust, as %ds can change. (grub_biosdisk_rw_int13_extensions): Don't clear %ds before diff --git a/commands/i386/cpuid.c b/commands/i386/cpuid.c index 62cf7f43b..87873d202 100644 --- a/commands/i386/cpuid.c +++ b/commands/i386/cpuid.c @@ -32,7 +32,7 @@ #define bit_LM (1 << 29) -unsigned char has_longmode = 0; +static unsigned char has_longmode = 0; static const struct grub_arg_option options[] = { diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index 793c11df7..93f0da91f 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -27,7 +27,7 @@ #include #include -int cd_drive = 0; +static int cd_drive = 0; static int grub_biosdisk_get_drive (const char *name) diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index f88c69478..00296c9c6 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -149,7 +149,7 @@ struct grub_openbsd_bios_mmap grub_uint64_t addr; grub_uint64_t len; grub_uint32_t type; -} bios_memmap_t; +}; struct grub_openbsd_bootargs { From 0bf6d401c1bdcff0184d1d8e751733ad9e363bf6 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 30 Mar 2008 06:13:45 +0000 Subject: [PATCH 0076/1707] 2008-03-30 Pavel Roskin * commands/sleep.c: Fix warning about implicit declaration. * disk/memdisk.c: Likewise. * loader/aout.c: Likewise. * loader/i386/bsd_normal.c: Likewise. * util/grub-probe.c: Likewise. --- ChangeLog | 6 ++++++ commands/sleep.c | 1 + disk/memdisk.c | 1 + loader/aout.c | 1 + loader/i386/bsd_normal.c | 1 + util/grub-probe.c | 1 + 6 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index b96141de8..600b2feef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-03-30 Pavel Roskin + * commands/sleep.c: Fix warning about implicit declaration. + * disk/memdisk.c: Likewise. + * loader/aout.c: Likewise. + * loader/i386/bsd_normal.c: Likewise. + * util/grub-probe.c: Likewise. + * commands/i386/cpuid.c (has_longmode): Make static. * disk/i386/pc/biosdisk.c (cd_drive): Likewise. * include/grub/i386/bsd.h (bios_memmap_t): Remove, it's unused. diff --git a/commands/sleep.c b/commands/sleep.c index f4ee41b82..b239ef973 100644 --- a/commands/sleep.c +++ b/commands/sleep.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include diff --git a/disk/memdisk.c b/disk/memdisk.c index ccc22adc5..c77eef174 100644 --- a/disk/memdisk.c +++ b/disk/memdisk.c @@ -23,6 +23,7 @@ #include #include #include +#include static grub_addr_t memdisk_addr; static grub_off_t memdisk_size = 0; diff --git a/loader/aout.c b/loader/aout.c index 2c82b60e6..2677e50e4 100644 --- a/loader/aout.c +++ b/loader/aout.c @@ -18,6 +18,7 @@ #include #include #include +#include #include int diff --git a/loader/i386/bsd_normal.c b/loader/i386/bsd_normal.c index f09cd577c..73b39a6bf 100644 --- a/loader/i386/bsd_normal.c +++ b/loader/i386/bsd_normal.c @@ -22,6 +22,7 @@ #include #include #include +#include static grub_err_t grub_normal_freebsd_command (struct grub_arg_list *state diff --git a/util/grub-probe.c b/util/grub-probe.c index dabd76822..07c6ca12c 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -29,6 +29,7 @@ #include #include #include +#include #include From 0ecef90d9b238802a6e40d4033720f00fdf85718 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 30 Mar 2008 06:22:31 +0000 Subject: [PATCH 0077/1707] 2008-03-30 Pavel Roskin * util/update-grub_lib.in: Define datarootdir, since Autoconf 2.60 and newer uses it to define datadir. --- ChangeLog | 3 +++ util/update-grub_lib.in | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 600b2feef..edf66e109 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-03-30 Pavel Roskin + * util/update-grub_lib.in: Define datarootdir, since Autoconf + 2.60 and newer uses it to define datadir. + * commands/sleep.c: Fix warning about implicit declaration. * disk/memdisk.c: Likewise. * loader/aout.c: Likewise. diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 8b20867b8..628714084 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -18,6 +18,7 @@ transform="@program_transform_name@" prefix=@prefix@ exec_prefix=@exec_prefix@ +datarootdir=@datarootdir@ datadir=@datadir@ sbindir=@sbindir@ pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` From 9a3f3296d5c8cd56114ffd6767f9b24a33ea6917 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 30 Mar 2008 16:17:17 +0000 Subject: [PATCH 0078/1707] 2008-03-30 Pavel Roskin * loader/i386/pc/multiboot2.c (grub_mb2_arch_elf64_hook): Add missing grub_error() call. --- ChangeLog | 3 +++ loader/i386/pc/multiboot2.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index edf66e109..3c8832827 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-03-30 Pavel Roskin + * loader/i386/pc/multiboot2.c (grub_mb2_arch_elf64_hook): Add + missing grub_error() call. + * util/update-grub_lib.in: Define datarootdir, since Autoconf 2.60 and newer uses it to define datadir. diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c index fdc9b24e3..58afa2399 100644 --- a/loader/i386/pc/multiboot2.c +++ b/loader/i386/pc/multiboot2.c @@ -44,8 +44,8 @@ grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, UNUSED grub_addr_t *addr) if ((paddr < grub_os_area_addr) || (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size)) - return (GRUB_ERR_OUT_OF_RANGE,"Address 0x%x is out of range", - paddr); + return grub_error (GRUB_ERR_OUT_OF_RANGE, "Address 0x%x is out of range", + paddr); return GRUB_ERR_NONE; } From 8790bb0466d031e7b6c8b17c6371c2911c4a851f Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 30 Mar 2008 18:04:40 +0000 Subject: [PATCH 0079/1707] 2008-03-30 Pavel Roskin * fs/udf.c (grub_udf_mount): Fix warning about a shadowing a variable. * include/grub/i386/loader.h: Change declaration of grub_linux_boot() to match what grub_loader_set() expects. * util/getroot.c (grub_guess_root_device): Return const char* to fix a warning. * util/grub-probe.c (probe): Fix a warning about uninitialized abstraction_name variable. * util/i386/get_disk_name.c (grub_util_get_disk_name): Mark second argument as unused to fix a warning. --- ChangeLog | 11 +++++++++++ fs/udf.c | 4 ++-- include/grub/i386/loader.h | 3 ++- include/grub/util/getroot.h | 2 +- util/getroot.c | 2 +- util/grub-probe.c | 6 +++--- util/i386/get_disk_name.c | 2 +- 7 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c8832827..f505f94e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-03-30 Pavel Roskin + * fs/udf.c (grub_udf_mount): Fix warning about a shadowing a + variable. + * include/grub/i386/loader.h: Change declaration of + grub_linux_boot() to match what grub_loader_set() expects. + * util/getroot.c (grub_guess_root_device): Return const char* to + fix a warning. + * util/grub-probe.c (probe): Fix a warning about uninitialized + abstraction_name variable. + * util/i386/get_disk_name.c (grub_util_get_disk_name): Mark + second argument as unused to fix a warning. + * loader/i386/pc/multiboot2.c (grub_mb2_arch_elf64_hook): Add missing grub_error() call. diff --git a/fs/udf.c b/fs/udf.c index e07d9624e..8f833eb3c 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -603,7 +603,7 @@ grub_udf_mount (grub_disk_t disk) } else if (tag.tag_ident == GRUB_UDF_TAG_IDENT_LVD) { - int i; + int k; struct grub_udf_partmap *ppm; @@ -622,7 +622,7 @@ grub_udf_mount (grub_disk_t disk) } ppm = (struct grub_udf_partmap *) &data->lvd.part_maps; - for (i = U32 (data->lvd.num_part_maps); i > 0; i--) + for (k = U32 (data->lvd.num_part_maps); k > 0; k--) { if (ppm->type != GRUB_UDF_PARTMAP_TYPE_1) { diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index 5f912cd1c..b120207a9 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -20,6 +20,7 @@ #define GRUB_LOADER_CPU_HEADER 1 #include +#include #include #include @@ -30,7 +31,7 @@ extern grub_int32_t EXPORT_VAR(grub_linux_is_bzimage); extern grub_addr_t EXPORT_VAR(grub_os_area_addr); extern grub_size_t EXPORT_VAR(grub_os_area_size); -void EXPORT_FUNC(grub_linux_boot) (void) __attribute__ ((noreturn)); +grub_err_t EXPORT_FUNC(grub_linux_boot) (void); /* The asm part of the multiboot loader. */ void EXPORT_FUNC(grub_multiboot_real_boot) (grub_addr_t entry, diff --git a/include/grub/util/getroot.h b/include/grub/util/getroot.h index 0d78538df..bf0c55ca4 100644 --- a/include/grub/util/getroot.h +++ b/include/grub/util/getroot.h @@ -29,6 +29,6 @@ char *grub_guess_root_device (const char *dir); char *grub_get_prefix (const char *dir); int grub_util_get_dev_abstraction (const char *os_dev); char *grub_util_get_grub_dev (const char *os_dev); -char *grub_util_check_block_device (const char *blk_dev); +const char *grub_util_check_block_device (const char *blk_dev); #endif /* ! GRUB_UTIL_GETROOT_HEADER */ diff --git a/util/getroot.c b/util/getroot.c index 0c4b376e7..5a9821883 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -333,7 +333,7 @@ grub_util_get_grub_dev (const char *os_dev) return grub_dev; } -char * +const char * grub_util_check_block_device (const char *blk_dev) { struct stat st; diff --git a/util/grub-probe.c b/util/grub-probe.c index 07c6ca12c..063b8f63d 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -135,15 +135,15 @@ probe (const char *path, char *device_name) char *abstraction_name; switch (abstraction_type) { - case GRUB_DEV_ABSTRACTION_NONE: - grub_util_info ("did not find LVM/RAID in %s, assuming raw device", device_name); - goto end; case GRUB_DEV_ABSTRACTION_LVM: abstraction_name = "lvm"; break; case GRUB_DEV_ABSTRACTION_RAID: abstraction_name = "raid"; break; + default: + grub_util_info ("did not find LVM/RAID in %s, assuming raw device", device_name); + goto end; } printf ("%s\n", abstraction_name); goto end; diff --git a/util/i386/get_disk_name.c b/util/i386/get_disk_name.c index d06b337ff..38195e248 100644 --- a/util/i386/get_disk_name.c +++ b/util/i386/get_disk_name.c @@ -20,7 +20,7 @@ #include char * -grub_util_get_disk_name (int disk, char *name) +grub_util_get_disk_name (int disk, char *name __attribute__ ((unused))) { char *p; From 4cb68e896bf9283db971d52b0d25e6f09ceb92fd Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 30 Mar 2008 18:32:15 +0000 Subject: [PATCH 0080/1707] 2008-03-30 Pavel Roskin * disk/host.c: Include grub/misc.h to fix a warning. * util/hostfs.c: Use GRUB_MOD_INIT and GRUB_MOD_FINI to fix warnings about implicit declarations. --- ChangeLog | 4 ++++ disk/host.c | 1 + util/hostfs.c | 7 +++---- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f505f94e2..404793544 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-03-30 Pavel Roskin + * disk/host.c: Include grub/misc.h to fix a warning. + * util/hostfs.c: Use GRUB_MOD_INIT and GRUB_MOD_FINI to fix + warnings about implicit declarations. + * fs/udf.c (grub_udf_mount): Fix warning about a shadowing a variable. * include/grub/i386/loader.h: Change declaration of diff --git a/disk/host.c b/disk/host.c index 6767f5a3c..ccd410169 100644 --- a/disk/host.c +++ b/disk/host.c @@ -22,6 +22,7 @@ #include #include +#include int grub_disk_host_i_want_a_reference; diff --git a/util/hostfs.c b/util/hostfs.c index 828fd9a3f..b74fbd3ca 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -151,14 +152,12 @@ static struct grub_fs grub_hostfs_fs = -void -grub_hostfs_init (void) +GRUB_MOD_INIT(hostfs) { grub_fs_register (&grub_hostfs_fs); } -void -grub_hostfs_fini (void) +GRUB_MOD_FINI(hostfs) { grub_fs_unregister (&grub_hostfs_fs); } From 86cb4f54b4b72f8022ff3b098ac56a29782e2c02 Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 31 Mar 2008 11:18:00 +0000 Subject: [PATCH 0081/1707] 2008-03-31 Bean * conf/common.rmk (pkgdata_MODULES): Add afs.mod. (grub_probe_SOURCES): Add fs/afs.c. (grub_fstest_SOURCES): Likewise. (afs_mod_SOURCES): New variable. (afs_mod_CFLAGS): Likewise. (afs_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/afs.c. (grub_emu_SOURCES): Likewise. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * fs/afs.c: New file. --- ChangeLog | 22 ++ conf/common.mk | 83 ++++- conf/common.rmk | 12 +- conf/i386-efi.mk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.mk | 14 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-linuxbios.mk | 14 +- conf/i386-linuxbios.rmk | 2 +- conf/i386-pc.mk | 28 +- conf/i386-pc.rmk | 4 +- conf/powerpc-ieee1275.mk | 14 +- conf/powerpc-ieee1275.rmk | 2 +- fs/afs.c | 636 ++++++++++++++++++++++++++++++++++++++ 14 files changed, 791 insertions(+), 46 deletions(-) create mode 100644 fs/afs.c diff --git a/ChangeLog b/ChangeLog index 404793544..f8e24de4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2008-03-31 Bean + + * conf/common.rmk (pkgdata_MODULES): Add afs.mod. + (grub_probe_SOURCES): Add fs/afs.c. + (grub_fstest_SOURCES): Likewise. + (afs_mod_SOURCES): New variable. + (afs_mod_CFLAGS): Likewise. + (afs_mod_LDFLAGS): Likewise. + + * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/afs.c. + (grub_emu_SOURCES): Likewise. + + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + + * conf/i386-linuxbios.rmk (grub_emu_SOURCES): Likewise. + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + + * fs/afs.c: New file. + 2008-03-30 Pavel Roskin * disk/host.c: Include grub/misc.h to fix a warning. diff --git a/conf/common.mk b/conf/common.mk index d57ae6133..a7fa89b83 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -11,16 +11,16 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d +CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -130,6 +130,10 @@ grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_xfs.d +grub_probe-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_afs.d + grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-partmap_pc.d @@ -181,16 +185,16 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ grub_fstest_init.c -CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -320,6 +324,10 @@ grub_fstest-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_xfs.d +grub_fstest-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_afs.d + grub_fstest-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-kern_partition.d @@ -455,7 +463,8 @@ update-grub_DATA += util/grub.d/README # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ - affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod + affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod \ + afs.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -1341,6 +1350,58 @@ fs-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genfslist.sh udf_mod_CFLAGS = $(COMMON_CFLAGS) udf_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For afs.mod. +afs_mod_SOURCES = fs/afs.c +CLEANFILES += afs.mod mod-afs.o mod-afs.c pre-afs.o afs_mod-fs_afs.o und-afs.lst +ifneq ($(afs_mod_EXPORTS),no) +CLEANFILES += def-afs.lst +DEFSYMFILES += def-afs.lst +endif +MOSTLYCLEANFILES += afs_mod-fs_afs.d +UNDSYMFILES += und-afs.lst + +afs.mod: pre-afs.o mod-afs.o + -rm -f $@ + $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-afs.o: $(afs_mod_DEPENDENCIES) afs_mod-fs_afs.o + -rm -f $@ + $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ afs_mod-fs_afs.o + +mod-afs.o: mod-afs.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -c -o $@ $< + +mod-afs.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'afs' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(afs_mod_EXPORTS),no) +def-afs.lst: pre-afs.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 afs/' > $@ +endif + +und-afs.lst: pre-afs.o + echo 'afs' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +afs_mod-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -MD -c -o $@ $< +-include afs_mod-fs_afs.d + +CLEANFILES += cmd-afs_mod-fs_afs.lst fs-afs_mod-fs_afs.lst +COMMANDFILES += cmd-afs_mod-fs_afs.lst +FSFILES += fs-afs_mod-fs_afs.lst + +cmd-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh afs > $@ || (rm -f $@; exit 1) + +fs-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh afs > $@ || (rm -f $@; exit 1) + + +afs_mod_CFLAGS = $(COMMON_CFLAGS) +afs_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Partition maps. pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod diff --git a/conf/common.rmk b/conf/common.rmk index d99e0531a..6e2d7aa3a 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -11,7 +11,7 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ @@ -31,7 +31,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ @@ -131,7 +131,8 @@ update-grub_DATA += util/grub.d/README # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ - affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod + affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod \ + afs.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -218,6 +219,11 @@ udf_mod_SOURCES = fs/udf.c udf_mod_CFLAGS = $(COMMON_CFLAGS) udf_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For afs.mod. +afs_mod_SOURCES = fs/afs.c +afs_mod_CFLAGS = $(COMMON_CFLAGS) +afs_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Partition maps. pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 23f6cc69c..10cd760b8 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -82,7 +82,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 1a18affc8..cc60d3d63 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -46,7 +46,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 4d19fb40f..279a04359 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -217,7 +217,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ fs/fshelp.c \ io/gzio.c \ @@ -238,11 +238,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -376,6 +376,10 @@ grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_xfs.d +grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_afs.d + grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 80d2037b5..5f37eb5ca 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -71,7 +71,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 457102169..210a2750b 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -203,7 +203,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ fs/fshelp.c \ io/gzio.c \ @@ -224,11 +224,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -354,6 +354,10 @@ grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_xfs.d +grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_afs.d + grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 3eafe4dc8..1721a1d14 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -69,7 +69,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 2969bf011..d06338157 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -262,18 +262,18 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ partmap/pc.c partmap/gpt.c \ \ disk/raid.c disk/lvm.c \ util/raid.c util/lvm.c \ grub_setup_init.c -CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d +CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) +grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o + $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(util/i386/pc/grub-setup.c_DEPENDENCIES) $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< @@ -395,6 +395,10 @@ grub_setup-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-fs_xfs.d +grub_setup-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< +-include grub_setup-fs_afs.d + grub_setup-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-partmap_pc.d @@ -472,7 +476,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/biosdisk.c util/getroot.c \ @@ -480,11 +484,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -766,6 +770,10 @@ grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_xfs.d +grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_afs.d + grub_emu-util_console.o: util/console.c $(util/console.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_console.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 316b05ff3..37a9f5bd9 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -90,7 +90,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ partmap/pc.c partmap/gpt.c \ \ @@ -128,7 +128,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/biosdisk.c util/getroot.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 22d01a639..fb31215db 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -93,7 +93,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ @@ -113,11 +113,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -239,6 +239,10 @@ grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_xfs.d +grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_afs.d + grub_emu-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-io_gzio.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 6432754f9..8c8aa55cf 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -57,7 +57,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/fs/afs.c b/fs/afs.c new file mode 100644 index 000000000..7c6167162 --- /dev/null +++ b/fs/afs.c @@ -0,0 +1,636 @@ +/* afs.c - The native AtheOS file-system. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define GRUB_AFS_DIRECT_BLOCK_COUNT 12 +#define GRUB_AFS_BLOCKS_PER_DI_RUN 4 + +#define GRUB_AFS_SBLOCK_MAGIC1 0x41465331 /* AFS1 */ +#define GRUB_AFS_SBLOCK_MAGIC2 0xdd121031 +#define GRUB_AFS_SBLOCK_MAGIC3 0x15b6830e + +#define GRUB_AFS_INODE_MAGIC 0x64358428 + +#define GRUB_AFS_BTREE_MAGIC 0x65768995 + +#define GRUB_AFS_BNODE_SIZE 1024 + +#define GRUB_AFS_S_IFMT 00170000 +#define GRUB_AFS_S_IFLNK 0120000 + +#define GRUB_AFS_S_IFREG 0100000 +#define GRUB_AFS_S_IFDIR 0040000 +#define GRUB_AFS_S_IFIFO 0010000 + +#define GRUB_AFS_NULL_VAL ((grub_afs_bvalue_t)-1) + +#define U16(sb, u) (((sb)->byte_order == GRUB_AFS_BO_LITTLE_ENDIAN) ? \ + grub_le_to_cpu16 (u) : grub_be_to_cpu16 (u)) + +#define U32(sb, u) (((sb)->byte_order == GRUB_AFS_BO_LITTLE_ENDIAN) ? \ + grub_le_to_cpu32 (u) : grub_be_to_cpu32 (u)) + +#define U64(sb, u) (((sb)->byte_order == GRUB_AFS_BO_LITTLE_ENDIAN) ? \ + grub_le_to_cpu64 (u) : grub_be_to_cpu64 (u)) + +#define B_KEY_INDEX_OFFSET(node) ((grub_uint16_t *) \ + ((char *) (node) + \ + sizeof (struct grub_afs_bnode) + \ + ((node->key_size + 3) & ~3))) + +#define B_KEY_VALUE_OFFSET(node) ((grub_afs_bvalue_t *) \ + ((char *) B_KEY_INDEX_OFFSET (node) + \ + node->key_count * 2)) + +enum +{ + GRUB_AFS_BO_LITTLE_ENDIAN, + GRUB_AFS_BO_BIG_ENDIAN +}; + +typedef grub_uint64_t grub_afs_off_t; +typedef grub_uint64_t grub_afs_bigtime; +typedef grub_uint64_t grub_afs_bvalue_t; + +struct grub_afs_blockrun +{ + grub_uint32_t group; + grub_uint16_t start; + grub_uint16_t len; +}; + +struct grub_afs_datastream +{ + struct grub_afs_blockrun direct[GRUB_AFS_DIRECT_BLOCK_COUNT]; + grub_afs_off_t max_direct_range; + struct grub_afs_blockrun indirect; + grub_afs_off_t max_indirect_range; + struct grub_afs_blockrun double_indirect; + grub_afs_off_t max_double_indirect_range; + grub_afs_off_t size; +}; + +struct grub_afs_bnode +{ + grub_afs_bvalue_t left; + grub_afs_bvalue_t right; + grub_afs_bvalue_t overflow; + grub_uint32_t key_count; + grub_uint32_t key_size; + char key_data[0]; +}; + +struct grub_afs_btree +{ + grub_uint32_t magic; + grub_afs_bvalue_t root; + grub_uint32_t tree_depth; + grub_afs_bvalue_t last_node; + grub_afs_bvalue_t first_free; +} ; + +struct grub_afs_sblock +{ + grub_uint8_t name[32]; + grub_uint32_t magic1; + grub_uint32_t byte_order; + grub_uint32_t block_size; + grub_uint32_t block_shift; + grub_afs_off_t num_blocks; + grub_afs_off_t used_blocks; + grub_uint32_t inode_size; + grub_uint32_t magic2; + grub_uint32_t block_per_group; // Number of blocks per allocation group (Max 65536) + grub_uint32_t alloc_group_shift; // Number of bits to shift a group number to get a byte address. + grub_uint32_t alloc_group_count; + grub_uint32_t flags; + struct grub_afs_blockrun log_block; + grub_afs_off_t log_start; + grub_uint32_t valid_log_blocks; + grub_uint32_t log_size; + grub_uint32_t magic3; + struct grub_afs_blockrun root_dir; // Root dir inode. + struct grub_afs_blockrun deleted_files; // Directory containing files scheduled for deletion. + struct grub_afs_blockrun index_dir; // Directory of index files. + grub_uint32_t boot_loader_size; + grub_uint32_t pad[7]; +}; + +struct grub_afs_inode +{ + grub_uint32_t magic1; + struct grub_afs_blockrun inode_num; + grub_uint32_t uid; + grub_uint32_t gid; + grub_uint32_t mode; + grub_uint32_t flags; + grub_uint32_t link_count; + grub_afs_bigtime create_time; + grub_afs_bigtime modified_time; + struct grub_afs_blockrun parent; + struct grub_afs_blockrun attrib_dir; + grub_uint32_t index_type; /* Key data-key only used for index files */ + grub_uint32_t inode_size; + void* vnode; + struct grub_afs_datastream stream; + grub_uint32_t pad[4]; + grub_uint32_t small_data[1]; +}; + +struct grub_fshelp_node +{ + struct grub_afs_data *data; + struct grub_afs_inode inode; +}; + +struct grub_afs_data +{ + grub_disk_t disk; + struct grub_afs_sblock sblock; + struct grub_afs_inode *inode; + struct grub_fshelp_node diropen; +}; + +#ifndef GRUB_UTIL +static grub_dl_t my_mod; +#endif + +static grub_afs_off_t +grub_afs_run_to_num (struct grub_afs_sblock *sb, + struct grub_afs_blockrun *run) +{ + return ((grub_afs_off_t) U32 (sb, run->group) * sb->block_per_group + + U16 (sb, run->start)); +} + +static grub_err_t +grub_afs_read_inode (struct grub_afs_data *data, + grub_uint32_t ino, struct grub_afs_inode *inode) +{ + return grub_disk_read (data->disk, + ino * + (data->sblock.block_size >> GRUB_DISK_SECTOR_BITS), + 0, sizeof (struct grub_afs_inode), + (char *) inode); +} + +static int +grub_afs_read_block (grub_fshelp_node_t node, int fileblock) +{ + struct grub_afs_sblock *sb = &node->data->sblock; + struct grub_afs_datastream *ds = &node->inode.stream; + + if ((grub_uint32_t) fileblock < U64 (sb, ds->max_direct_range)) + { + int i; + + for (i = 0; i < GRUB_AFS_DIRECT_BLOCK_COUNT; i++) + { + if (fileblock < U16 (sb, ds->direct[i].len)) + return grub_afs_run_to_num (sb, &ds->direct[i]) + fileblock; + fileblock -= U16 (sb, ds->direct[i].len); + } + } + else if ((grub_uint32_t) fileblock < U64 (sb, ds->max_indirect_range)) + { + int ptrs_per_blk = sb->block_size / sizeof (struct grub_afs_blockrun); + struct grub_afs_blockrun indir[ptrs_per_blk]; + grub_afs_off_t blk = grub_afs_run_to_num (sb, &ds->indirect); + int i; + + fileblock -= U64 (sb, ds->max_direct_range); + for (i = 0; i < ds->indirect.len; i++, blk++) + { + int j; + + if (grub_disk_read (node->data->disk, + blk * (sb->block_size >> GRUB_DISK_SECTOR_BITS), + 0, sizeof (indir), + (char *) indir)) + return 0; + + for (j = 0; j < ptrs_per_blk; j++) + { + if (fileblock < U16 (sb, indir[j].len)) + return grub_afs_run_to_num (sb, &indir[j]) + fileblock; + + fileblock -= U16 (sb, indir[j].len); + } + } + } + else + { + int ptrs_per_blk = sb->block_size / sizeof (struct grub_afs_blockrun); + struct grub_afs_blockrun indir[ptrs_per_blk]; + + /* ([idblk][idptr]) ([dblk][dptr]) [blk] */ + int cur_pos = fileblock - U64 (sb, ds->max_indirect_range); + + int dptr_size = GRUB_AFS_BLOCKS_PER_DI_RUN; + int dblk_size = dptr_size * ptrs_per_blk; + int idptr_size = dblk_size * GRUB_AFS_BLOCKS_PER_DI_RUN; + int idblk_size = idptr_size * ptrs_per_blk; + + int off = cur_pos % GRUB_AFS_BLOCKS_PER_DI_RUN; + int dptr = (cur_pos / dptr_size) % ptrs_per_blk; + int dblk = (cur_pos / dblk_size) % GRUB_AFS_BLOCKS_PER_DI_RUN; + int idptr = (cur_pos / idptr_size) % ptrs_per_blk; + int idblk = (cur_pos / idblk_size); + + if (grub_disk_read (node->data->disk, + (grub_afs_run_to_num (sb, &ds->double_indirect) + + idblk) * + (sb->block_size >> GRUB_DISK_SECTOR_BITS), + 0, sizeof (indir), + (char *) indir)) + return 0; + + if (grub_disk_read (node->data->disk, + (grub_afs_run_to_num (sb, &indir[idptr]) + dblk) * + (sb->block_size >> GRUB_DISK_SECTOR_BITS), + 0, sizeof (indir), + (char *) indir)) + return 0; + + return grub_afs_run_to_num (sb, &indir[dptr]) + off; + } + + return 0; +} + +static grub_ssize_t +grub_afs_read_file (grub_fshelp_node_t node, + void NESTED_FUNC_ATTR (*read_hook) (grub_disk_addr_t sector, + unsigned offset, unsigned length), + int pos, grub_size_t len, char *buf) +{ + return grub_fshelp_read_file (node->data->disk, node, read_hook, + pos, len, buf, grub_afs_read_block, + U64 (&node->data->sblock, + node->inode.stream.size), + node->data->sblock.block_shift + - GRUB_DISK_SECTOR_BITS); +} + +static int +grub_afs_iterate_dir (grub_fshelp_node_t dir, + int NESTED_FUNC_ATTR + (*hook) (const char *filename, + enum grub_fshelp_filetype filetype, + grub_fshelp_node_t node)) +{ + struct grub_afs_btree head; + char node_data [GRUB_AFS_BNODE_SIZE]; + struct grub_afs_bnode *node = (struct grub_afs_bnode *) node_data; + struct grub_afs_sblock *sb = &dir->data->sblock; + int i; + + if ((! dir->inode.stream.size) || + ((U32 (sb, dir->inode.mode) & GRUB_AFS_S_IFMT) != GRUB_AFS_S_IFDIR)) + return 0; + + grub_afs_read_file (dir, 0, 0, sizeof (head), (char *) &head); + if (grub_errno) + return 0; + + grub_afs_read_file (dir, 0, U64 (sb, head.root), + GRUB_AFS_BNODE_SIZE, (char *) node); + if (grub_errno) + return 0; + + for (i = 0; i < (int) U32 (sb, head.tree_depth) - 1; i++) + { + grub_afs_bvalue_t blk; + + blk = U64(sb, B_KEY_VALUE_OFFSET (node) [0]); + grub_afs_read_file (dir, 0, blk, GRUB_AFS_BNODE_SIZE, (char *) node); + if (grub_errno) + return 0; + } + + if (node->key_count) + { + grub_uint32_t cur_key = 0; + + while (1) + { + int key_start, key_size; + grub_uint16_t *index; + + index = B_KEY_INDEX_OFFSET (node); + + key_start = U16 (sb, (cur_key > 0) ? index[cur_key - 1] : 0); + key_size = U16 (sb, index[cur_key]) - key_start; + if (key_size) + { + char filename [key_size + 1]; + struct grub_fshelp_node *fdiro; + int mode, type; + + fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); + if (! fdiro) + return 0; + + fdiro->data = dir->data; + if (grub_afs_read_inode (dir->data, + U64 (sb, B_KEY_VALUE_OFFSET (node) [cur_key]), + &fdiro->inode)) + return 0; + + grub_memcpy (filename, &node->key_data[key_start], key_size); + filename [key_size] = 0; + + mode = (U32 (sb, fdiro->inode.mode) & GRUB_AFS_S_IFMT); + if (mode == GRUB_AFS_S_IFDIR) + type = GRUB_FSHELP_DIR; + else if (mode == GRUB_AFS_S_IFREG) + type = GRUB_FSHELP_REG; + else + type = GRUB_FSHELP_UNKNOWN; + + if (hook (filename, type, fdiro)) + return 1; + } + + cur_key++; + if (cur_key >= U32 (sb, node->key_count)) + { + if (node->right == GRUB_AFS_NULL_VAL) + break; + + grub_afs_read_file (dir, 0, U64 (sb, node->right), + GRUB_AFS_BNODE_SIZE, (char *) node); + if (grub_errno) + return 0; + + cur_key = 0; + } + } + } + + return 0; +} + +static int +grub_afs_validate_sblock (struct grub_afs_sblock *sb) +{ + if (grub_le_to_cpu32 (sb->magic1) == GRUB_AFS_SBLOCK_MAGIC1) + { + if (grub_le_to_cpu32 (sb->byte_order) != GRUB_AFS_BO_LITTLE_ENDIAN) + return 0; + + sb->byte_order = GRUB_AFS_BO_LITTLE_ENDIAN; + sb->magic2 = grub_le_to_cpu32 (sb->magic2); + sb->magic3 = grub_le_to_cpu32 (sb->magic3); + sb->block_shift = grub_le_to_cpu32 (sb->block_shift); + sb->block_size = grub_le_to_cpu32 (sb->block_size); + sb->used_blocks = grub_le_to_cpu64 (sb->used_blocks); + sb->num_blocks = grub_le_to_cpu64 (sb->num_blocks); + sb->inode_size = grub_le_to_cpu32 (sb->inode_size); + sb->alloc_group_count = grub_le_to_cpu32 (sb->alloc_group_count); + sb->alloc_group_shift = grub_le_to_cpu32 (sb->alloc_group_shift); + sb->block_per_group = grub_le_to_cpu32 (sb->block_per_group); + sb->alloc_group_count = grub_le_to_cpu32 (sb->alloc_group_count); + sb->log_size = grub_le_to_cpu32 (sb->log_size); + } + else if (grub_be_to_cpu32 (sb->magic1) == GRUB_AFS_SBLOCK_MAGIC1) + { + if (grub_be_to_cpu32 (sb->byte_order) != GRUB_AFS_BO_BIG_ENDIAN) + return 0; + + sb->byte_order = GRUB_AFS_BO_BIG_ENDIAN; + sb->magic2 = grub_be_to_cpu32 (sb->magic2); + sb->magic3 = grub_be_to_cpu32 (sb->magic3); + sb->block_shift = grub_be_to_cpu32 (sb->block_shift); + sb->block_size = grub_be_to_cpu32 (sb->block_size); + sb->used_blocks = grub_be_to_cpu64 (sb->used_blocks); + sb->num_blocks = grub_be_to_cpu64 (sb->num_blocks); + sb->inode_size = grub_be_to_cpu32 (sb->inode_size); + sb->alloc_group_count = grub_be_to_cpu32 (sb->alloc_group_count); + sb->alloc_group_shift = grub_be_to_cpu32 (sb->alloc_group_shift); + sb->block_per_group = grub_be_to_cpu32 (sb->block_per_group); + sb->alloc_group_count = grub_be_to_cpu32 (sb->alloc_group_count); + sb->log_size = grub_be_to_cpu32 (sb->log_size); + } + else + return 0; + + if ((sb->magic2 != GRUB_AFS_SBLOCK_MAGIC2) || + (sb->magic3 != GRUB_AFS_SBLOCK_MAGIC3)) + return 0; + + if (((grub_uint32_t) (1 << sb->block_shift) != sb->block_size) || + (sb->used_blocks > sb->num_blocks ) || + (sb->inode_size != sb->block_size) || + (0 == sb->block_size) || + ((grub_uint32_t) (1 << sb->alloc_group_shift) != + sb->block_per_group * sb->block_size) || + (sb->alloc_group_count * sb->block_per_group < sb->num_blocks) || + (U16 (sb, sb->log_block.len) != sb->log_size) || + (U32 (sb, sb->valid_log_blocks) > sb->log_size)) + return 0; + + return 1; +} + +static struct grub_afs_data * +grub_afs_mount (grub_disk_t disk) +{ + struct grub_afs_data *data = 0; + + data = grub_malloc (sizeof (struct grub_afs_data)); + if (!data) + return 0; + + /* Read the superblock. */ + if (grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_afs_sblock), + (char *) &data->sblock)) + goto fail; + + if (! grub_afs_validate_sblock (&data->sblock)) + { + if (grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_afs_sblock), + (char *) &data->sblock)) + goto fail; + + if (! grub_afs_validate_sblock (&data->sblock)) + goto fail; + } + + data->diropen.data = data; + data->inode = &data->diropen.inode; + data->disk = disk; + + if (grub_afs_read_inode (data, + grub_afs_run_to_num (&data->sblock, + &data->sblock.root_dir), + data->inode)) + goto fail; + + return data; + +fail: + grub_error (GRUB_ERR_BAD_FS, "not an afs filesystem"); + grub_free (data); + return 0; +} + +static grub_err_t +grub_afs_open (struct grub_file *file, const char *name) +{ + struct grub_afs_data *data; + struct grub_fshelp_node *fdiro = 0; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_afs_mount (file->device->disk); + if (! data) + goto fail; + + grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_afs_iterate_dir, + 0, GRUB_FSHELP_REG); + if (grub_errno) + goto fail; + + grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_afs_inode)); + grub_free (fdiro); + + file->size = U64 (&data->sblock, data->inode->stream.size); + file->data = data; + file->offset = 0; + + return 0; + +fail: + if (fdiro != &data->diropen) + grub_free (fdiro); + grub_free (data); + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + return grub_errno; +} + +static grub_ssize_t +grub_afs_read (grub_file_t file, char *buf, grub_size_t len) +{ + struct grub_afs_data *data = (struct grub_afs_data *) file->data; + + return grub_afs_read_file (&data->diropen, file->read_hook, + file->offset, len, buf); +} + +static grub_err_t +grub_afs_close (grub_file_t file) +{ + grub_free (file->data); + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_afs_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, int dir)) +{ + struct grub_afs_data *data = 0;; + struct grub_fshelp_node *fdiro = 0; + + auto int NESTED_FUNC_ATTR iterate (const char *filename, + enum grub_fshelp_filetype filetype, + grub_fshelp_node_t node); + + int NESTED_FUNC_ATTR iterate (const char *filename, + enum grub_fshelp_filetype filetype, + grub_fshelp_node_t node) + { + grub_free (node); + + if (filetype == GRUB_FSHELP_DIR) + return hook (filename, 1); + else + return hook (filename, 0); + + return 0; + } + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_afs_mount (device->disk); + if (! data) + goto fail; + + grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_afs_iterate_dir, + 0, GRUB_FSHELP_DIR); + if (grub_errno) + goto fail; + + grub_afs_iterate_dir (fdiro, iterate); + + fail: + if (fdiro != &data->diropen) + grub_free (fdiro); + grub_free (data); + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + return grub_errno; +} + +static struct grub_fs grub_afs_fs = { + .name = "afs", + .dir = grub_afs_dir, + .open = grub_afs_open, + .read = grub_afs_read, + .close = grub_afs_close, + .label = 0, + .next = 0 +}; + +GRUB_MOD_INIT (afs) +{ + grub_fs_register (&grub_afs_fs); +#ifndef GRUB_UTIL + my_mod = mod; +#endif +} + +GRUB_MOD_FINI (afs) +{ + grub_fs_unregister (&grub_afs_fs); +} From a33224e04b048aefef16428e70b128db50a0ee31 Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 31 Mar 2008 12:00:48 +0000 Subject: [PATCH 0082/1707] 2008-03-31 Bean * video/reader/png.c (grub_png_data): New member is_16bit and image_data. (grub_png_decode_image_header): Detect 16 bit png image. (grub_png_convert_image): New function to convert 16 bit image to 8 bit. (grub_png_decode_png): Call grub_png_convert_image for 16 bit image. (grub_video_reader_png): Release memory occupied by image_data. * fs/ntfs.c (find_attr): Handle non-resident attribute list larger than 4096 bytes. (grub_nfs_mount): Skip the test for sector per cluster. * include/grub/ntfs.h (MAX_SPC): Removed. --- ChangeLog | 15 ++++++++++++++ fs/ntfs.c | 17 +++++++--------- include/grub/ntfs.h | 1 - video/readers/png.c | 48 +++++++++++++++++++++++++++++++++++++++++---- 4 files changed, 66 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index f8e24de4b..cbe7f0cf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-03-31 Bean + + * video/reader/png.c (grub_png_data): New member is_16bit and + image_data. + (grub_png_decode_image_header): Detect 16 bit png image. + (grub_png_convert_image): New function to convert 16 bit image to 8 bit. + (grub_png_decode_png): Call grub_png_convert_image for 16 bit image. + (grub_video_reader_png): Release memory occupied by image_data. + + * fs/ntfs.c (find_attr): Handle non-resident attribute list larger than + 4096 bytes. + (grub_nfs_mount): Skip the test for sector per cluster. + + * include/grub/ntfs.h (MAX_SPC): Removed. + 2008-03-31 Bean * conf/common.rmk (pkgdata_MODULES): Add afs.mod. diff --git a/fs/ntfs.c b/fs/ntfs.c index 8247efb03..2922ade6e 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -176,17 +176,15 @@ find_attr (struct grub_ntfs_attr *at, unsigned char attr) pa = at->attr_end; if (pa[8]) { - if (u32at (pa, 0x28) > 4096) - { - grub_error (GRUB_ERR_BAD_FS, - "Non-resident attribute list too large"); - return NULL; - } + int n; + + n = ((u32at (pa, 0x30) + GRUB_DISK_SECTOR_SIZE - 1) + & (~(GRUB_DISK_SECTOR_SIZE - 1))); at->attr_cur = at->attr_end; - at->edat_buf = grub_malloc (u32at (pa, 0x28)); + at->edat_buf = grub_malloc (n); if (!at->edat_buf) return NULL; - if (read_data (at, pa, at->edat_buf, 0, u32at (pa, 0x28), 0, 0)) + if (read_data (at, pa, at->edat_buf, 0, n, 0, 0)) { grub_error (GRUB_ERR_BAD_FS, "Fail to read non-resident attribute list"); @@ -818,8 +816,7 @@ grub_ntfs_mount (grub_disk_t disk) data->mft_start = grub_le_to_cpu64 (bpb.mft_lcn) * data->spc; - if ((data->mft_size > MAX_MFT) || (data->idx_size > MAX_IDX) || - (data->spc > MAX_SPC) || (data->spc > data->idx_size)) + if ((data->mft_size > MAX_MFT) || (data->idx_size > MAX_IDX)) goto fail; data->mmft.data = data; diff --git a/include/grub/ntfs.h b/include/grub/ntfs.h index 2b0f21d35..e66e0c318 100644 --- a/include/grub/ntfs.h +++ b/include/grub/ntfs.h @@ -71,7 +71,6 @@ #define MAX_MFT (1024 >> BLK_SHR) #define MAX_IDX (16384 >> BLK_SHR) -#define MAX_SPC (4096 >> BLK_SHR) #define COM_LEN 4096 #define COM_SEC (COM_LEN >> BLK_SHR) diff --git a/video/readers/png.c b/video/readers/png.c index fd97ca481..608fa5e4a 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -89,7 +89,8 @@ struct grub_png_data grub_uint32_t next_offset; - int image_width, image_height, bpp, raw_bytes; + int image_width, image_height, bpp, is_16bit, raw_bytes; + grub_uint8_t *image_data; int inside_idat, idat_remain; @@ -211,6 +212,7 @@ static grub_err_t grub_png_decode_image_header (struct grub_png_data *data) { int color_type; + int color_bits; data->image_width = grub_png_get_dword (data); data->image_height = grub_png_get_dword (data); @@ -218,8 +220,11 @@ grub_png_decode_image_header (struct grub_png_data *data) if ((!data->image_height) || (!data->image_width)) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: invalid image size"); - if (grub_png_get_byte (data) != 8) - return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: bit depth must be 8"); + color_bits = grub_png_get_byte (data); + if ((color_bits != 8) && (color_bits != 16)) + return grub_error (GRUB_ERR_BAD_FILE_TYPE, + "png: bit depth must be 8 or 16"); + data->is_16bit = (color_bits == 16); color_type = grub_png_get_byte (data); if (color_type == PNG_COLOR_TYPE_RGB) @@ -242,9 +247,25 @@ grub_png_decode_image_header (struct grub_png_data *data) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "png: color type not supported"); + if (data->is_16bit) + { + data->bpp <<= 1; + + data->image_data = grub_malloc (data->image_height * + data->image_width * data->bpp); + if (grub_errno) + return grub_errno; + + data->cur_rgb = data->image_data; + } + else + { + data->image_data = 0; + data->cur_rgb = (*data->bitmap)->data; + } + data->raw_bytes = data->image_height * (data->image_width + 1) * data->bpp; - data->cur_rgb = (*data->bitmap)->data; data->cur_colume = 0; data->first_line = 1; @@ -705,6 +726,21 @@ grub_png_decode_image_data (struct grub_png_data *data) static const grub_uint8_t png_magic[8] = { 0x89, 0x50, 0x4e, 0x47, 0xd, 0xa, 0x1a, 0x0a }; +static void +grub_png_convert_image (struct grub_png_data *data) +{ + int i; + grub_uint8_t *d1, *d2; + + d1 = (*data->bitmap)->data; + d2 = data->image_data + 1; + + /* Only copy the upper 8 bit. */ + for (i = 0; i < (data->image_width * data->image_height * data->bpp >> 1); + i++, d1++, d2+=2) + *d1 = *d2; +} + static grub_err_t grub_png_decode_png (struct grub_png_data *data) { @@ -741,6 +777,9 @@ grub_png_decode_png (struct grub_png_data *data) break; case PNG_CHUNK_IEND: + if (data->is_16bit) + grub_png_convert_image (data); + return grub_errno; default: @@ -778,6 +817,7 @@ grub_video_reader_png (struct grub_video_bitmap **bitmap, grub_png_decode_png (data); + grub_free (data->image_data); grub_free (data); } From 0f582c6b88f8f8ddc419c7f9186195830ea88bec Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Apr 2008 01:27:09 +0000 Subject: [PATCH 0083/1707] 2008-04-01 Pavel Roskin * normal/arg.c (grub_arg_show_help): Fix spacing of the long options to align them with the short options, e.g. "echo -e". --- ChangeLog | 5 +++++ normal/arg.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cbe7f0cf4..ddfe4af23 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-01 Pavel Roskin + + * normal/arg.c (grub_arg_show_help): Fix spacing of the long + options to align them with the short options, e.g. "echo -e". + 2008-03-31 Bean * video/reader/png.c (grub_png_data): New member is_16bit and diff --git a/normal/arg.c b/normal/arg.c index 3aa6a0331..bf5522928 100644 --- a/normal/arg.c +++ b/normal/arg.c @@ -147,7 +147,7 @@ grub_arg_show_help (grub_command_t cmd) if (opt->longarg) { grub_printf ("--%s", opt->longarg); - spacing -= grub_strlen (opt->longarg); + spacing -= grub_strlen (opt->longarg) + 2; if (opt->arg) { From 2bb4fb47e8f7342e6d1d70603f4184560fbb83d4 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Apr 2008 01:31:11 +0000 Subject: [PATCH 0084/1707] 2008-04-01 Pavel Roskin * disk/loopback.c (options): Improve help for "--partitions". --- ChangeLog | 2 ++ disk/loopback.c | 3 +-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ddfe4af23..7a5b44bc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-04-01 Pavel Roskin + * disk/loopback.c (options): Improve help for "--partitions". + * normal/arg.c (grub_arg_show_help): Fix spacing of the long options to align them with the short options, e.g. "echo -e". diff --git a/disk/loopback.c b/disk/loopback.c index 31d811688..521c710f8 100644 --- a/disk/loopback.c +++ b/disk/loopback.c @@ -38,8 +38,7 @@ static struct grub_loopback *loopback_list; static const struct grub_arg_option options[] = { {"delete", 'd', 0, "delete the loopback device entry", 0, 0}, - {"partitions", 'p', 0, "set that the drive has partitions to" - " simulate a harddrive", 0, 0}, + {"partitions", 'p', 0, "simulate a hard drive with partitions", 0, 0}, {0, 0, 0, 0, 0, 0} }; From 828a27686eab031725ceeb2f4b13a1f9a47739c4 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Apr 2008 01:49:18 +0000 Subject: [PATCH 0085/1707] 2008-04-01 Pavel Roskin * util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The later is obsolete, potentially dangerous and sets a bad example. * util/i386/efi/grub-mkimage.c (make_header): Likewise. * util/misc.c (grub_util_get_image_size): Likewise. --- ChangeLog | 5 +++++ util/grub-fstest.c | 4 ++-- util/i386/efi/grub-mkimage.c | 2 +- util/misc.c | 6 +++--- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7a5b44bc6..04211e958 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-01 Pavel Roskin + * util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The + later is obsolete, potentially dangerous and sets a bad example. + * util/i386/efi/grub-mkimage.c (make_header): Likewise. + * util/misc.c (grub_util_get_image_size): Likewise. + * disk/loopback.c (options): Improve help for "--partitions". * normal/arg.c (grub_arg_show_help): Fix spacing of the long diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 126a2307a..39f409664 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -255,8 +255,8 @@ cmd_cmp (char *src, char *dest) return; } - if ((skip) && (fseek (ff, skip, SEEK_SET))) - grub_util_error ("fseek error.\n"); + if ((skip) && (fseeko (ff, skip, SEEK_SET))) + grub_util_error ("seek error.\n"); read_file (src, cmp_hook); fclose (ff); diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index d86bde370..57c1fc88d 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -829,7 +829,7 @@ make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address, | GRUB_PE32_SCN_MEM_READ); /* Write them out. */ - if (fseek (out, 0, SEEK_SET) < 0) + if (fseeko (out, 0, SEEK_SET) < 0) grub_util_error ("seek failed"); if (fwrite (&header, sizeof (header), 1, out) != 1 diff --git a/util/misc.c b/util/misc.c index 92eea95c5..f3b94c6c1 100644 --- a/util/misc.c +++ b/util/misc.c @@ -145,8 +145,8 @@ grub_util_get_image_size (const char *path) void grub_util_read_at (void *img, size_t size, off_t offset, FILE *fp) { - if (fseek (fp, offset, SEEK_SET) == -1) - grub_util_error ("fseek failed"); + if (fseeko (fp, offset, SEEK_SET) == -1) + grub_util_error ("seek failed"); if (fread (img, 1, size, fp) != size) grub_util_error ("read failed"); @@ -199,7 +199,7 @@ void grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out) { grub_util_info ("writing 0x%x bytes at offset 0x%x", size, offset); - if (fseek (out, offset, SEEK_SET) == -1) + if (fseeko (out, offset, SEEK_SET) == -1) grub_util_error ("seek failed"); if (fwrite (img, 1, size, out) != size) grub_util_error ("write failed"); From 4b6e1995beff3c4306111b0f6051a22fb9b64fc6 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Apr 2008 04:25:41 +0000 Subject: [PATCH 0086/1707] 2008-04-01 Pavel Roskin * disk/ata.c (grub_ata_open): Don't lose precision in disk->id. * disk/host.c (grub_host_open): Likewise. * disk/loopback.c (grub_loopback_open): Likewise. * disk/memdisk.c (grub_memdisk_open): Use a string pointer for disk->id as in disk/host.c, not a multi-character constant. --- ChangeLog | 6 ++++++ disk/ata.c | 2 +- disk/host.c | 2 +- disk/loopback.c | 2 +- disk/memdisk.c | 2 +- 5 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04211e958..99ec49b6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2008-04-01 Pavel Roskin + * disk/ata.c (grub_ata_open): Don't lose precision in disk->id. + * disk/host.c (grub_host_open): Likewise. + * disk/loopback.c (grub_loopback_open): Likewise. + * disk/memdisk.c (grub_memdisk_open): Use a string pointer for + disk->id as in disk/host.c, not a multi-character constant. + * util/grub-fstest.c (cmd_cmp): Use fseeko(), not fseek(). The later is obsolete, potentially dangerous and sets a bad example. * util/i386/efi/grub-mkimage.c (make_header): Likewise. diff --git a/disk/ata.c b/disk/ata.c index 90ed0e101..e75af9031 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -615,7 +615,7 @@ grub_ata_open (const char *name, grub_disk_t disk) else disk->total_sectors = dev->size; - disk->id = (int) dev; + disk->id = (unsigned long) dev; disk->has_partitions = !dev->atapi; disk->data = dev; diff --git a/disk/host.c b/disk/host.c index ccd410169..bb8828a6c 100644 --- a/disk/host.c +++ b/disk/host.c @@ -41,7 +41,7 @@ grub_host_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a host disk"); disk->total_sectors = 0; - disk->id = (int) "host"; + disk->id = (unsigned long) "host"; disk->has_partitions = 0; disk->data = 0; diff --git a/disk/loopback.c b/disk/loopback.c index 521c710f8..709c422df 100644 --- a/disk/loopback.c +++ b/disk/loopback.c @@ -177,7 +177,7 @@ grub_loopback_open (const char *name, grub_disk_t disk) /* Use the filesize for the disk size, round up to a complete sector. */ disk->total_sectors = ((file->size + GRUB_DISK_SECTOR_SIZE - 1) / GRUB_DISK_SECTOR_SIZE); - disk->id = (int) dev; + disk->id = (unsigned long) dev; disk->has_partitions = dev->has_partitions; disk->data = file; diff --git a/disk/memdisk.c b/disk/memdisk.c index c77eef174..840ef369c 100644 --- a/disk/memdisk.c +++ b/disk/memdisk.c @@ -41,7 +41,7 @@ grub_memdisk_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a memdisk"); disk->total_sectors = memdisk_size / GRUB_DISK_SECTOR_SIZE; - disk->id = (int) 'mdsk'; + disk->id = (unsigned long) "mdsk"; disk->has_partitions = 0; return GRUB_ERR_NONE; From ba7328dcba255b68f9b5ca678e29b6251a25000c Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Apr 2008 06:10:44 +0000 Subject: [PATCH 0087/1707] 2008-04-02 Pavel Roskin * disk/raid.c (grub_raid_memberlist): Fix a signedness warning. * fs/cpio.c (grub_cpio_read): Likewise. --- ChangeLog | 5 +++++ disk/raid.c | 2 +- fs/cpio.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 99ec49b6d..e48cc14bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-02 Pavel Roskin + + * disk/raid.c (grub_raid_memberlist): Fix a signedness warning. + * fs/cpio.c (grub_cpio_read): Likewise. + 2008-04-01 Pavel Roskin * disk/ata.c (grub_ata_open): Don't lose precision in disk->id. diff --git a/disk/raid.c b/disk/raid.c index 3c4290a51..c906edaf2 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -73,7 +73,7 @@ grub_raid_memberlist (grub_disk_t disk) { struct grub_raid_array *array = disk->data; grub_disk_memberlist_t list = NULL, tmp; - int i; + unsigned int i; for (i = 0; i < array->total_devs; i++) { diff --git a/fs/cpio.c b/fs/cpio.c index 8c47506ac..1692d6108 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -315,7 +315,7 @@ grub_cpio_read (grub_file_t file, char *buf, grub_size_t len) data = file->data; return (grub_disk_read (data->disk, 0, data->dofs + file->offset, - len, buf)) ? -1 : len; + len, buf)) ? -1 : (grub_ssize_t) len; } static grub_err_t From 26887f221a602b78c4cf1b7a6fadcd57aded22ad Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Apr 2008 07:29:59 +0000 Subject: [PATCH 0088/1707] 2008-04-02 Pavel Roskin * genkernsyms.sh.in: Use more robust assignments for CC and srcdir. Quote srcdir. * gensymlist.sh.in: Likewise. Assert at the compile time that the symbol table is not empty. --- ChangeLog | 5 +++++ genkernsyms.sh.in | 6 +++--- gensymlist.sh.in | 9 ++++++--- 3 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e48cc14bf..68e5327f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-04-02 Pavel Roskin + * genkernsyms.sh.in: Use more robust assignments for CC and + srcdir. Quote srcdir. + * gensymlist.sh.in: Likewise. Assert at the compile time that + the symbol table is not empty. + * disk/raid.c (grub_raid_memberlist): Fix a signedness warning. * fs/cpio.c (grub_cpio_read): Likewise. diff --git a/genkernsyms.sh.in b/genkernsyms.sh.in index 1a4e34441..a5e1271a5 100644 --- a/genkernsyms.sh.in +++ b/genkernsyms.sh.in @@ -13,10 +13,10 @@ ### The configure script will replace these variables. -srcdir=@srcdir@ -CC="@CC@" +: ${srcdir=@srcdir@} +: ${CC=@CC@} -$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I$srcdir/include $* \ +$CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \ | grep -v '^#' \ | sed -n \ -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' \ diff --git a/gensymlist.sh.in b/gensymlist.sh.in index c704d266a..d8b987157 100644 --- a/gensymlist.sh.in +++ b/gensymlist.sh.in @@ -13,8 +13,8 @@ ### The configure script will replace these variables. -srcdir=@srcdir@ -CC=@CC@ +: ${srcdir=@srcdir@} +: ${CC=@CC@} cat < sizeof (tab[0])); for (p = tab; p->name; p++) grub_dl_register_symbol (p->name, p->addr, 0); } From 070e49e4e8a12b3e66a911d2fa820495f56f3131 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 4 Apr 2008 06:45:07 +0000 Subject: [PATCH 0089/1707] 2008-04-04 Pavel Roskin * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Fix signedness warnings. * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Likewise. * util/ieee1275/get_disk_name.c: Include config.h so that _GNU_SOURCE is defined and getline() is declared. Mark an unused argument as such. Fix a signedness warning. --- ChangeLog | 10 ++++++++++ kern/powerpc/ieee1275/cmain.c | 2 +- kern/powerpc/ieee1275/openfw.c | 6 +++--- util/ieee1275/get_disk_name.c | 5 +++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68e5327f6..19d190a36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-04-04 Pavel Roskin + + * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): + Fix signedness warnings. + * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): + Likewise. + * util/ieee1275/get_disk_name.c: Include config.h so that + _GNU_SOURCE is defined and getline() is declared. Mark an + unused argument as such. Fix a signedness warning. + 2008-04-02 Pavel Roskin * genkernsyms.sh.in: Use more robust assignments for CC and diff --git a/kern/powerpc/ieee1275/cmain.c b/kern/powerpc/ieee1275/cmain.c index 0a3a2a5c7..31947ccb4 100644 --- a/kern/powerpc/ieee1275/cmain.c +++ b/kern/powerpc/ieee1275/cmain.c @@ -57,7 +57,7 @@ grub_ieee1275_find_options (void) grub_ieee1275_phandle_t openprom; grub_ieee1275_phandle_t bootrom; int rc; - int realmode = 0; + grub_uint32_t realmode = 0; char tmp[32]; int is_smartfirmware = 0; int is_olpc = 0; diff --git a/kern/powerpc/ieee1275/openfw.c b/kern/powerpc/ieee1275/openfw.c index 26ff3d5fa..69164a627 100644 --- a/kern/powerpc/ieee1275/openfw.c +++ b/kern/powerpc/ieee1275/openfw.c @@ -153,9 +153,9 @@ grub_err_t grub_available_iterate (int (*hook) (grub_uint64_t, grub_uint64_t)) grub_ieee1275_phandle_t memory; grub_uint32_t available[32]; grub_ssize_t available_size; - int address_cells = 1; - int size_cells = 1; - unsigned int i; + grub_uint32_t address_cells = 1; + grub_uint32_t size_cells = 1; + int i; /* Determine the format of each entry in `available'. */ grub_ieee1275_finddevice ("/", &root); diff --git a/util/ieee1275/get_disk_name.c b/util/ieee1275/get_disk_name.c index 6370fe6fd..30e965ab4 100644 --- a/util/ieee1275/get_disk_name.c +++ b/util/ieee1275/get_disk_name.c @@ -17,16 +17,17 @@ * along with GRUB. If not, see . */ +#include #include #include char * -grub_util_get_disk_name (int disk, char *name) +grub_util_get_disk_name (int disk __attribute__ ((unused)), char *name) { int p[2]; char *line = NULL; - int zero = 0; + size_t zero = 0; int len; pipe (p); From 4f657021a911bf5733918f927198a2898c631c0e Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 4 Apr 2008 08:07:07 +0000 Subject: [PATCH 0090/1707] 2008-04-04 Pavel Roskin * commands/lspci.c (grub_pci_classes): Fix typos. (grub_lspci_iter): Don't print func twice. Print vendor ID before device ID, as it's normally done. --- ChangeLog | 4 ++++ commands/lspci.c | 14 +++++++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19d190a36..80899c6a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-04-04 Pavel Roskin + * commands/lspci.c (grub_pci_classes): Fix typos. + (grub_lspci_iter): Don't print func twice. Print vendor ID + before device ID, as it's normally done. + * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Fix signedness warnings. * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): diff --git a/commands/lspci.c b/commands/lspci.c index d7d27834a..dbade83d7 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -32,7 +32,7 @@ struct grub_pci_classname static const struct grub_pci_classname grub_pci_classes[] = { { 0, 0, "" }, - { 1, 0, "SCSCI Controller" }, + { 1, 0, "SCSI Controller" }, { 1, 1, "IDE Controller" }, { 1, 2, "Floppy Controller" }, { 1, 3, "IPI Controller" }, @@ -74,7 +74,7 @@ static const struct grub_pci_classname grub_pci_classes[] = { 9, 4, "Gameport Controller" }, { 9, 0x80, "Unknown Input Device" }, { 10, 0, "Generic Docking Station" }, - { 10, 0x80, "Unkown Docking Station" }, + { 10, 0x80, "Unknown Docking Station" }, { 11, 0, "80386 Processor" }, { 11, 1, "80486 Processor" }, { 11, 2, "Pentium Processor" }, @@ -82,19 +82,19 @@ static const struct grub_pci_classname grub_pci_classes[] = { 11, 0x20, "PowerPC Processor" }, { 11, 0x30, "MIPS Processor" }, { 11, 0x40, "Co-Processor" }, - { 11, 0x80, "Unkown Processor" }, + { 11, 0x80, "Unknown Processor" }, { 12, 0x80, "Serial Bus Controller" }, { 13, 0x80, "Wireless Controller" }, { 14, 0, "I2O" }, - { 15, 0, "iRDA Controller" }, + { 15, 0, "IrDA Controller" }, { 15, 1, "Consumer IR" }, { 15, 0x10, "RF-Controller" }, { 15, 0x80, "Satellite Communication Controller" }, { 16, 0, "Network Decryption" }, { 16, 1, "Entertainment Decryption" }, - { 16, 0x80, "Unkown Decryption Controller" }, + { 16, 0x80, "Unknown Decryption Controller" }, { 17, 0, "Digital IO Module" }, - { 17, 0x80, "Unkown Data Input System" }, + { 17, 0x80, "Unknown Data Input System" }, { 0, 0, 0 }, }; @@ -120,7 +120,7 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) const char *sclass; grub_pci_address_t addr; - grub_printf ("%02x:%02x.%x %04x:%04x.%d", 0, dev, func, pciid >> 16, pciid & 0xFFFF, func); + grub_printf ("%02x:%02x.%x %04x:%04x", 0, dev, func, pciid & 0xFFFF, pciid >> 16); addr = grub_pci_make_address (bus, dev, func, 2); class = grub_pci_read (addr); From 8b088a4c48c86567c710217dfec78f185e983e70 Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 5 Apr 2008 02:07:11 +0000 Subject: [PATCH 0091/1707] 2008-04-04 Pavel Roskin * commands/lspci.c (grub_lspci_iter): Print the bus number correctly. --- ChangeLog | 3 +++ commands/lspci.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 80899c6a0..52e728f3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-04-04 Pavel Roskin + * commands/lspci.c (grub_lspci_iter): Print the bus number + correctly. + * commands/lspci.c (grub_pci_classes): Fix typos. (grub_lspci_iter): Don't print func twice. Print vendor ID before device ID, as it's normally done. diff --git a/commands/lspci.c b/commands/lspci.c index dbade83d7..0f52cf5df 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -120,7 +120,8 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) const char *sclass; grub_pci_address_t addr; - grub_printf ("%02x:%02x.%x %04x:%04x", 0, dev, func, pciid & 0xFFFF, pciid >> 16); + grub_printf ("%02x:%02x.%x %04x:%04x", bus, dev, func, pciid & 0xFFFF, + pciid >> 16); addr = grub_pci_make_address (bus, dev, func, 2); class = grub_pci_read (addr); From f6ce7629ade83481a827ee315d8fe1e0e3466f31 Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 5 Apr 2008 07:20:29 +0000 Subject: [PATCH 0092/1707] 2008-04-05 Pavel Roskin * bus/pci.c (grub_pci_iterate): For multifunction devices, probe all 8 functions. Otherwise, probe function 0 only. --- ChangeLog | 5 +++++ bus/pci.c | 12 +++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 52e728f3d..eb8bd7a44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-05 Pavel Roskin + + * bus/pci.c (grub_pci_iterate): For multifunction devices, probe + all 8 functions. Otherwise, probe function 0 only. + 2008-04-04 Pavel Roskin * commands/lspci.c (grub_lspci_iter): Print the bus number diff --git a/bus/pci.c b/bus/pci.c index a091f4982..2c29c03ab 100644 --- a/bus/pci.c +++ b/bus/pci.c @@ -34,12 +34,13 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook) int func; grub_pci_address_t addr; grub_pci_id_t id; + grub_uint32_t hdr; for (bus = 0; bus < 256; bus++) { for (dev = 0; dev < 32; dev++) { - for (func = 0; func < 3; func++) + for (func = 0; func < 8; func++) { addr = grub_pci_make_address (bus, dev, func, 0); id = grub_pci_read (addr); @@ -50,6 +51,15 @@ grub_pci_iterate (grub_pci_iteratefunc_t hook) if (hook (bus, dev, func, id)) return; + + /* Probe only func = 0 if the device if not multifunction */ + if (func == 0) + { + addr = grub_pci_make_address (bus, dev, func, 3); + hdr = grub_pci_read (addr); + if (!(hdr & 0x800000)) + break; + } } } } From 87a297bf55ec8743578466dee5f8efbfea69bd87 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 6 Apr 2008 17:16:39 +0000 Subject: [PATCH 0093/1707] 2008-04-06 Pavel Roskin * util/grub-emu.c (main): Remove calls to grub_hostfs_init() and grub_hostfs_fini(), as they are called from grub_init_all() and grub_fini_all() respectively. This fixes an infinite loop in grub-fstest due to double registration of hostfs. Reported by Christian Franke --- ChangeLog | 8 ++++++++ util/grub-emu.c | 4 ---- util/grub-fstest.c | 4 ---- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb8bd7a44..34393de1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-04-06 Pavel Roskin + + * util/grub-emu.c (main): Remove calls to grub_hostfs_init() and + grub_hostfs_fini(), as they are called from grub_init_all() and + grub_fini_all() respectively. This fixes an infinite loop in + grub-fstest due to double registration of hostfs. + Reported by Christian Franke + 2008-04-05 Pavel Roskin * bus/pci.c (grub_pci_iterate): For multifunction devices, probe diff --git a/util/grub-emu.c b/util/grub-emu.c index 3b562f760..00a2c49c9 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -186,8 +186,6 @@ main (int argc, char *argv[]) /* XXX: This is a bit unportable. */ grub_util_biosdisk_init (dev_map); - grub_hostfs_init (); - grub_init_all (); /* Make sure that there is a root device. */ @@ -217,8 +215,6 @@ main (int argc, char *argv[]) grub_fini_all (); - grub_hostfs_fini (); - grub_machine_fini (); return 0; diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 39f409664..241f23dd8 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -499,8 +499,6 @@ main (int argc, char *argv[]) usage (1); } - grub_hostfs_init (); - /* Initialize all modules. */ grub_init_all (); @@ -516,7 +514,5 @@ main (int argc, char *argv[]) /* Free resources. */ grub_fini_all (); - grub_hostfs_fini (); - return 0; } From 36747a62215bbb1bce677c8a467c51aad1b08af6 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 6 Apr 2008 17:51:56 +0000 Subject: [PATCH 0094/1707] 2008-04-06 Pavel Roskin * util/biosdisk.c: Include grub/util/biosdisk.h. * util/grub-fstest.c (execute_command): Make static. * util/grub-mkdevicemap.c (check_device): Likewise. * util/i386/pc/misc.c: Include grub/machine/init.h. * util/powerpc/ieee1275/misc.c: Likewise. * util/lvm.c: Include grub/util/lvm.h. * util/misc.c: Include grub/kernel.h, grub/misc.h and grub/cache.h. * util/raid.c: Include grub/util/raid.h. (grub_util_getdiskname): Make static. --- ChangeLog | 11 +++++++++++ util/biosdisk.c | 1 + util/grub-fstest.c | 2 +- util/grub-mkdevicemap.c | 2 +- util/i386/pc/misc.c | 1 + util/lvm.c | 1 + util/misc.c | 3 +++ util/powerpc/ieee1275/misc.c | 1 + util/raid.c | 3 ++- 9 files changed, 22 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34393de1f..02023f62d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-04-06 Pavel Roskin + * util/biosdisk.c: Include grub/util/biosdisk.h. + * util/grub-fstest.c (execute_command): Make static. + * util/grub-mkdevicemap.c (check_device): Likewise. + * util/i386/pc/misc.c: Include grub/machine/init.h. + * util/powerpc/ieee1275/misc.c: Likewise. + * util/lvm.c: Include grub/util/lvm.h. + * util/misc.c: Include grub/kernel.h, grub/misc.h and + grub/cache.h. + * util/raid.c: Include grub/util/raid.h. + (grub_util_getdiskname): Make static. + * util/grub-emu.c (main): Remove calls to grub_hostfs_init() and grub_hostfs_fini(), as they are called from grub_init_all() and grub_fini_all() respectively. This fixes an infinite loop in diff --git a/util/biosdisk.c b/util/biosdisk.c index 4dd46d6b1..2d3d6017b 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -23,6 +23,7 @@ #include #include #include +#include #include #include diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 241f23dd8..9e1d8863f 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -93,7 +93,7 @@ grub_register_command (const char *name, return NULL; } -grub_err_t +static grub_err_t execute_command (grub_command_t cmd, int n, char **args) { int maxargs = 0; diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index c071dab0d..5a33fdc78 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -277,7 +277,7 @@ get_i2o_disk_name (char *name, char unit) /* Check if DEVICE can be read. If an error occurs, return zero, otherwise return non-zero. */ -int +static int check_device (const char *device) { char buf[512]; diff --git a/util/i386/pc/misc.c b/util/i386/pc/misc.c index 8490fbf70..d289deddd 100644 --- a/util/i386/pc/misc.c +++ b/util/i386/pc/misc.c @@ -19,6 +19,7 @@ #include #include +#include void grub_reboot (void) diff --git a/util/lvm.c b/util/lvm.c index 2b08b3966..7f85ccbb7 100644 --- a/util/lvm.c +++ b/util/lvm.c @@ -21,6 +21,7 @@ #ifdef __linux__ #include +#include #include #include diff --git a/util/misc.c b/util/misc.c index f3b94c6c1..b285af378 100644 --- a/util/misc.c +++ b/util/misc.c @@ -27,6 +27,9 @@ #include #include +#include +#include +#include #include #include #include diff --git a/util/powerpc/ieee1275/misc.c b/util/powerpc/ieee1275/misc.c index b0ce83bd2..6f79612bb 100644 --- a/util/powerpc/ieee1275/misc.c +++ b/util/powerpc/ieee1275/misc.c @@ -19,6 +19,7 @@ #include #include +#include void grub_reboot (void) diff --git a/util/raid.c b/util/raid.c index e1ccff4ef..82ae413cf 100644 --- a/util/raid.c +++ b/util/raid.c @@ -20,6 +20,7 @@ /* We only support RAID on Linux. */ #ifdef __linux__ #include +#include #include #include @@ -31,7 +32,7 @@ #include #include -char * +static char * grub_util_getdiskname (int major, int minor) { char *name = xmalloc (15); From 3cbd2f98c6f0bdbdd9e5a678fa89931b754f3e06 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 7 Apr 2008 15:00:27 +0000 Subject: [PATCH 0095/1707] 2008-04-07 Robert Millan * util/biosdisk.c (read_device_map): Skip devices that don't exist (this prevents the presence of a bogus entry from ruining the whole thing). --- ChangeLog | 6 ++++++ util/biosdisk.c | 9 ++++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 02023f62d..30d973c6c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-07 Robert Millan + + * util/biosdisk.c (read_device_map): Skip devices that don't exist + (this prevents the presence of a bogus entry from ruining the whole + thing). + 2008-04-06 Pavel Roskin * util/biosdisk.c: Include grub/util/biosdisk.h. diff --git a/util/biosdisk.c b/util/biosdisk.c index 2d3d6017b..e6e7f51ed 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -486,8 +486,9 @@ read_device_map (const char *dev_map) FILE *fp; char buf[1024]; /* XXX */ int lineno = 0; - auto void show_error (const char *msg); + struct stat st; + auto void show_error (const char *msg); void show_error (const char *msg) { grub_util_error ("%s:%d: %s", dev_map, lineno, msg); @@ -543,6 +544,12 @@ read_device_map (const char *dev_map) if (map[drive]) show_error ("Duplicated entry found"); + if (stat (p, &st) == -1) + { + grub_util_info ("Cannot stat `%s', skipping", p); + continue; + } + #ifdef __linux__ /* On Linux, the devfs uses symbolic links horribly, and that confuses the interface very much, so use realpath to expand From 25c024b14ddcd5d5b784938007313cef99502db5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 7 Apr 2008 15:23:09 +0000 Subject: [PATCH 0096/1707] 2008-04-07 Robert Millan * util/grub-probe.c (probe): Improve error message. --- ChangeLog | 4 ++++ util/grub-probe.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 30d973c6c..060eef062 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-07 Robert Millan + + * util/grub-probe.c (probe): Improve error message. + 2008-04-07 Robert Millan * util/biosdisk.c (read_device_map): Skip devices that don't exist diff --git a/util/grub-probe.c b/util/grub-probe.c index 063b8f63d..986a4d733 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -151,7 +151,7 @@ probe (const char *path, char *device_name) drive_name = grub_util_get_grub_dev (device_name); if (! drive_name) - grub_util_error ("cannot find a GRUB drive for %s.\n", device_name); + grub_util_error ("Cannot find a GRUB drive for %s. Check your device.map.\n", device_name); if (print == PRINT_DRIVE) { From a02a73c5f8f8ae2d65281f6308951a249a4c03f6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 7 Apr 2008 17:18:13 +0000 Subject: [PATCH 0097/1707] 2008-04-07 Robert Millan Revert grub/machine/init.h addition by Pavel (since it breaks on i386-ieee1275 and others): * util/i386/pc/misc.c: Remove grub/machine/init.h. * util/powerpc/ieee1275/misc.c: Likewise. --- ChangeLog | 7 +++++++ util/i386/pc/misc.c | 1 - util/powerpc/ieee1275/misc.c | 1 - 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 060eef062..07241dd6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-07 Robert Millan + + Revert grub/machine/init.h addition by Pavel (since it breaks on + i386-ieee1275 and others): + * util/i386/pc/misc.c: Remove grub/machine/init.h. + * util/powerpc/ieee1275/misc.c: Likewise. + 2008-04-07 Robert Millan * util/grub-probe.c (probe): Improve error message. diff --git a/util/i386/pc/misc.c b/util/i386/pc/misc.c index d289deddd..8490fbf70 100644 --- a/util/i386/pc/misc.c +++ b/util/i386/pc/misc.c @@ -19,7 +19,6 @@ #include #include -#include void grub_reboot (void) diff --git a/util/powerpc/ieee1275/misc.c b/util/powerpc/ieee1275/misc.c index 6f79612bb..b0ce83bd2 100644 --- a/util/powerpc/ieee1275/misc.c +++ b/util/powerpc/ieee1275/misc.c @@ -19,7 +19,6 @@ #include #include -#include void grub_reboot (void) From 322562eae83f8dba0df5552527dd686574fd93d8 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 10 Apr 2008 22:26:50 +0000 Subject: [PATCH 0098/1707] 2008-04-10 Pavel Roskin * configure.ac: Always use "_cv_" in cache variables for compatibility with Autoconf 2.62. --- ChangeLog | 5 +++++ configure | 24 ++++++++++++------------ configure.ac | 12 ++++++------ 3 files changed, 23 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07241dd6d..1164b4084 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-10 Pavel Roskin + + * configure.ac: Always use "_cv_" in cache variables for + compatibility with Autoconf 2.62. + 2008-04-07 Robert Millan Revert grub/machine/init.h addition by Pavel (since it breaks on diff --git a/configure b/configure index d4f9276a9..2517a3c62 100644 --- a/configure +++ b/configure @@ -6561,7 +6561,7 @@ if test "x$TARGET_CFLAGS" = x; then # optimization flags. { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } -if test "${size_flag+set}" = set; then +if test "${grub_cv_cc_Os+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6598,20 +6598,20 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - size_flag=yes + grub_cv_cc_Os=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - size_flag=no + grub_cv_cc_Os=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $size_flag" >&5 -echo "${ECHO_T}$size_flag" >&6; } - if test "x$size_flag" = xyes; then +{ echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 +echo "${ECHO_T}$grub_cv_cc_Os" >&6; } + if test "x$grub_cv_cc_Os" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops" @@ -6621,7 +6621,7 @@ echo "${ECHO_T}$size_flag" >&6; } if test "x$target_cpu" = xi386; then { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } -if test "${falign_loop_flag+set}" = set; then +if test "${grub_cv_cc_falign_loop+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -6658,21 +6658,21 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - falign_loop_flag=yes + grub_cv_cc_falign_loop=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - falign_loop_flag=no + grub_cv_cc_falign_loop=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $falign_loop_flag" >&5 -echo "${ECHO_T}$falign_loop_flag" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 +echo "${ECHO_T}$grub_cv_cc_falign_loop" >&6; } - if test "x$falign_loop_flag" = xyes; then + if test "x$grub_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" else TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" diff --git a/configure.ac b/configure.ac index 3a737f47e..80cb54238 100644 --- a/configure.ac +++ b/configure.ac @@ -207,11 +207,11 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - AC_CACHE_CHECK([whether optimization for size works], size_flag, [ + AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [ CFLAGS=-Os - AC_TRY_COMPILE(, , size_flag=yes, size_flag=no) + AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no) ]) - if test "x$size_flag" = xyes; then + if test "x$grub_cv_cc_Os" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops" @@ -219,12 +219,12 @@ if test "x$TARGET_CFLAGS" = x; then # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [ + AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ CFLAGS="-falign-loops=1" - AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no]) + AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no]) ]) - if test "x$falign_loop_flag" = xyes; then + if test "x$grub_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" else TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" From a91627b40acf19b2ebbba3c12f6291d60054f9c0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 12 Apr 2008 21:09:36 +0000 Subject: [PATCH 0099/1707] 2008-04-12 Robert Millan * kern/powerpc/ieee1275/init.c: Move from here ... * kern/ieee1275/init.c: ... to here. Update all users. * kern/powerpc/ieee1275/cmain.c: Move from here ... * kern/ieee1275/cmain.c: ... to here. Update all users. * kern/powerpc/ieee1275/openfw.c: Move from here ... * kern/ieee1275/openfw.c: ... to here. Update all users. * loader/powerpc/ieee1275/multiboot2.c: Move from here ... * loader/ieee1275/multiboot2.c: ... to here. Update all users. --- ChangeLog | 14 +++++ DISTLIST | 11 ++-- conf/i386-ieee1275.mk | 60 ++++++++++----------- conf/i386-ieee1275.rmk | 6 +-- conf/powerpc-ieee1275.mk | 62 +++++++++++----------- conf/powerpc-ieee1275.rmk | 8 +-- kern/{powerpc => }/ieee1275/cmain.c | 0 kern/{powerpc => }/ieee1275/init.c | 0 kern/{powerpc => }/ieee1275/openfw.c | 0 loader/{powerpc => }/ieee1275/multiboot2.c | 0 10 files changed, 88 insertions(+), 73 deletions(-) rename kern/{powerpc => }/ieee1275/cmain.c (100%) rename kern/{powerpc => }/ieee1275/init.c (100%) rename kern/{powerpc => }/ieee1275/openfw.c (100%) rename loader/{powerpc => }/ieee1275/multiboot2.c (100%) diff --git a/ChangeLog b/ChangeLog index 1164b4084..e63a70bdd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-04-12 Robert Millan + + * kern/powerpc/ieee1275/init.c: Move from here ... + * kern/ieee1275/init.c: ... to here. Update all users. + + * kern/powerpc/ieee1275/cmain.c: Move from here ... + * kern/ieee1275/cmain.c: ... to here. Update all users. + + * kern/powerpc/ieee1275/openfw.c: Move from here ... + * kern/ieee1275/openfw.c: ... to here. Update all users. + + * loader/powerpc/ieee1275/multiboot2.c: Move from here ... + * loader/ieee1275/multiboot2.c: ... to here. Update all users. + 2008-04-10 Pavel Roskin * configure.ac: Always use "_cv_" in cache variables for diff --git a/DISTLIST b/DISTLIST index a079142be..291174e2b 100644 --- a/DISTLIST +++ b/DISTLIST @@ -255,13 +255,14 @@ kern/i386/pc/lzo1x.S kern/i386/pc/startup.S term/i386/pc/vga_text.c kern/i386/realmode.S -kern/ieee1275/ieee1275.c kern/powerpc/cache.S kern/powerpc/dl.c -kern/powerpc/ieee1275/cmain.c kern/powerpc/ieee1275/crt0.S -kern/powerpc/ieee1275/init.c -kern/powerpc/ieee1275/openfw.c +kern/ieee1275/ieee1275.c +kern/ieee1275/cmain.c +kern/ieee1275/init.c +kern/ieee1275/openfw.c +kern/ieee1275/ieee1275.c kern/sparc64/cache.S kern/sparc64/dl.c kern/sparc64/ieee1275/init.c @@ -282,7 +283,7 @@ loader/i386/pc/multiboot_normal.c loader/i386/pc/multiboot2.c loader/powerpc/ieee1275/linux.c loader/powerpc/ieee1275/linux_normal.c -loader/powerpc/ieee1275/multiboot2.c +loader/ieee1275/multiboot2.c normal/arg.c normal/color.c normal/cmdline.c diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 279a04359..772f38c32 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -15,8 +15,8 @@ pkglib_PROGRAMS = kernel.elf # For kernel.elf. kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ - kern/powerpc/ieee1275/init.c \ - kern/powerpc/ieee1275/cmain.c kern/powerpc/ieee1275/openfw.c \ + kern/ieee1275/init.c \ + kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ @@ -26,11 +26,11 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ term/ieee1275/ofconsole.c term/i386/pc/at_keyboard.c \ disk/ieee1275/ofdisk.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_powerpc_ieee1275_init.d kernel_elf-kern_powerpc_ieee1275_cmain.d kernel_elf-kern_powerpc_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -40,17 +40,17 @@ kernel_elf-kern_i386_ieee1275_init.o: kern/i386/ieee1275/init.c $(kern/i386/ieee $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_ieee1275_init.d -kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c $(kern/powerpc/ieee1275/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_init.d +kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_init.d -kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c $(kern/powerpc/ieee1275/cmain.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_cmain.d +kernel_elf-kern_ieee1275_cmain.o: kern/ieee1275/cmain.c $(kern/ieee1275/cmain.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_cmain.d -kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c $(kern/powerpc/ieee1275/openfw.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_openfw.d +kernel_elf-kern_ieee1275_openfw.o: kern/ieee1275/openfw.c $(kern/ieee1275/openfw.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -843,15 +843,15 @@ normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod. -_multiboot_mod_SOURCES = loader/powerpc/ieee1275/multiboot2.c \ +_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_powerpc_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst +CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst ifneq ($(_multiboot_mod_EXPORTS),no) CLEANFILES += def-_multiboot.lst DEFSYMFILES += def-_multiboot.lst endif -MOSTLYCLEANFILES += _multiboot_mod-loader_powerpc_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d +MOSTLYCLEANFILES += _multiboot_mod-loader_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o @@ -859,9 +859,9 @@ _multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_powerpc_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o +pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_powerpc_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< @@ -878,19 +878,19 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_powerpc_ieee1275_multiboot2.o: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_powerpc_ieee1275_multiboot2.d +_multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include _multiboot_mod-loader_ieee1275_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst +COMMANDFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst +FSFILES += fs-_multiboot_mod-loader_ieee1275_multiboot2.lst -cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) +cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +fs-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) _multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 5f37eb5ca..08ff66477 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -15,8 +15,8 @@ pkglib_PROGRAMS = kernel.elf # For kernel.elf. kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ - kern/powerpc/ieee1275/init.c \ - kern/powerpc/ieee1275/cmain.c kern/powerpc/ieee1275/openfw.c \ + kern/ieee1275/init.c \ + kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ @@ -110,7 +110,7 @@ normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod. -_multiboot_mod_SOURCES = loader/powerpc/ieee1275/multiboot2.c \ +_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index fb31215db..e3136d8dd 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -430,27 +430,27 @@ grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) grub_emu_LDFLAGS = $(LIBCURSES) -kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \ +kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \ - kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ + kern/ieee1275/init.c term/ieee1275/ofconsole.c \ + kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kernel_elf_symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_powerpc_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_powerpc_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_powerpc_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_powerpc_cache.d +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_powerpc_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_powerpc_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_powerpc_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S $(kern/powerpc/ieee1275/crt0.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_ieee1275_crt0.d -kernel_elf-kern_powerpc_ieee1275_cmain.o: kern/powerpc/ieee1275/cmain.c $(kern/powerpc/ieee1275/cmain.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_cmain.d +kernel_elf-kern_ieee1275_cmain.o: kern/ieee1275/cmain.c $(kern/ieee1275/cmain.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -504,17 +504,17 @@ kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_term.d -kernel_elf-kern_powerpc_ieee1275_init.o: kern/powerpc/ieee1275/init.c $(kern/powerpc/ieee1275/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_init.d +kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_ieee1275_ofconsole.d -kernel_elf-kern_powerpc_ieee1275_openfw.o: kern/powerpc/ieee1275/openfw.c $(kern/powerpc/ieee1275/openfw.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_openfw.d +kernel_elf-kern_ieee1275_openfw.o: kern/ieee1275/openfw.c $(kern/ieee1275/openfw.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -1110,15 +1110,15 @@ halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod -_multiboot_mod_SOURCES = loader/powerpc/ieee1275/multiboot2.c \ +_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_powerpc_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst +CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst ifneq ($(_multiboot_mod_EXPORTS),no) CLEANFILES += def-_multiboot.lst DEFSYMFILES += def-_multiboot.lst endif -MOSTLYCLEANFILES += _multiboot_mod-loader_powerpc_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d +MOSTLYCLEANFILES += _multiboot_mod-loader_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o @@ -1126,9 +1126,9 @@ _multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_powerpc_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o +pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_powerpc_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< @@ -1145,19 +1145,19 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_powerpc_ieee1275_multiboot2.o: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_powerpc_ieee1275_multiboot2.d +_multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include _multiboot_mod-loader_ieee1275_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst +COMMANDFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst +FSFILES += fs-_multiboot_mod-loader_ieee1275_multiboot2.lst -cmd-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) +cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_powerpc_ieee1275_multiboot2.lst: loader/powerpc/ieee1275/multiboot2.c $(loader/powerpc/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +fs-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) _multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 8c8aa55cf..b5ab18625 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -80,12 +80,12 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_emu_LDFLAGS = $(LIBCURSES) -kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/powerpc/ieee1275/cmain.c \ +kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/powerpc/ieee1275/init.c term/ieee1275/ofconsole.c \ - kern/powerpc/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ + kern/ieee1275/init.c term/ieee1275/ofconsole.c \ + kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kernel_elf_symlist.c kern/powerpc/cache.S kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h @@ -150,7 +150,7 @@ halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod -_multiboot_mod_SOURCES = loader/powerpc/ieee1275/multiboot2.c \ +_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/kern/powerpc/ieee1275/cmain.c b/kern/ieee1275/cmain.c similarity index 100% rename from kern/powerpc/ieee1275/cmain.c rename to kern/ieee1275/cmain.c diff --git a/kern/powerpc/ieee1275/init.c b/kern/ieee1275/init.c similarity index 100% rename from kern/powerpc/ieee1275/init.c rename to kern/ieee1275/init.c diff --git a/kern/powerpc/ieee1275/openfw.c b/kern/ieee1275/openfw.c similarity index 100% rename from kern/powerpc/ieee1275/openfw.c rename to kern/ieee1275/openfw.c diff --git a/loader/powerpc/ieee1275/multiboot2.c b/loader/ieee1275/multiboot2.c similarity index 100% rename from loader/powerpc/ieee1275/multiboot2.c rename to loader/ieee1275/multiboot2.c From 78b51059c3b2967f7ef9ef5a3cba3ba0601e783a Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 10:51:54 +0000 Subject: [PATCH 0100/1707] 2007-04-13 Fabian Greffrath * util/grub.d/30_os-prober.in: New script. Use `os-prober' and `linux-boot-prober' (if installed) to detect other operating systems which are installed on the computer and add them to the boot menu. * conf/common.rmk: Build and install 30_os-prober. --- ChangeLog | 8 ++++ DISTLIST | 1 + conf/common.mk | 6 +++ conf/common.rmk | 6 +++ util/grub.d/30_os-prober.in | 89 +++++++++++++++++++++++++++++++++++++ 5 files changed, 110 insertions(+) create mode 100644 util/grub.d/30_os-prober.in diff --git a/ChangeLog b/ChangeLog index e63a70bdd..88fcf7b86 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2007-04-13 Fabian Greffrath + + * util/grub.d/30_os-prober.in: New script. Use `os-prober' and + `linux-boot-prober' (if installed) to detect other operating + systems which are installed on the computer and add them to + the boot menu. + * conf/common.rmk: Build and install 30_os-prober. + 2008-04-12 Robert Millan * kern/powerpc/ieee1275/init.c: Move from here ... diff --git a/DISTLIST b/DISTLIST index 291174e2b..1afbca1f1 100644 --- a/DISTLIST +++ b/DISTLIST @@ -332,6 +332,7 @@ util/update-grub_lib.in util/grub.d/00_header.in util/grub.d/10_hurd.in util/grub.d/10_linux.in +util/grub.d/30_os-prober.in util/grub.d/README util/elf/grub-mkimage.c util/i386/efi/grub-install.in diff --git a/conf/common.mk b/conf/common.mk index a7fa89b83..75fb633ba 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -457,6 +457,12 @@ CLEANFILES += 10_linux update-grub_SCRIPTS += 10_hurd CLEANFILES += 10_hurd +30_os-prober: util/grub.d/30_os-prober.in config.status + ./config.status --file=$@:$< + chmod +x $@ +update-grub_SCRIPTS += 30_os-prober +CLEANFILES += 30_os-prober + update-grub_DATA += util/grub.d/README diff --git a/conf/common.rmk b/conf/common.rmk index 6e2d7aa3a..acbebc7b7 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -125,6 +125,12 @@ CLEANFILES += 10_linux update-grub_SCRIPTS += 10_hurd CLEANFILES += 10_hurd +30_os-prober: util/grub.d/30_os-prober.in config.status + ./config.status --file=$@:$< + chmod +x $@ +update-grub_SCRIPTS += 30_os-prober +CLEANFILES += 30_os-prober + update-grub_DATA += util/grub.d/README diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in new file mode 100644 index 000000000..56686e7b9 --- /dev/null +++ b/util/grub.d/30_os-prober.in @@ -0,0 +1,89 @@ +#! /bin/sh -e + +# update-grub helper script. +# Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then + # missing os-prober and/or linux-boot-prober + exit 0 +fi + +OSPROBED="`os-prober 2> /dev/null | tr ' ' '^' | paste -s -d ' '`" +if [ -z "${OSPROBED}" ] ; then + # empty os-prober output, nothing doing + exit 0 +fi + +for OS in ${OSPROBED} ; do + DEVICE="`echo ${OS} | cut -d ':' -f 1`" + LONGNAME="`echo ${OS} | cut -d ':' -f 2 | tr '^' ' '`" + LABEL="`echo ${OS} | cut -d ':' -f 3 | tr '^' ' '`" + BOOT="`echo ${OS} | cut -d ':' -f 4`" + + if [ -z "${LONGNAME}" ] ; then + LONGNAME="${LABEL}" + fi + + echo "Found ${LONGNAME} on ${DEVICE}" >&2 + + case ${BOOT} in + chain) + CHAINROOT="`grub-probe --target=drive --device ${DEVICE} 2> /dev/null`" + + cat << EOF +menuentry "${LONGNAME} (on ${DEVICE})" { + set root=${CHAINROOT} + chainloader +1 +} +EOF + ;; + linux) + LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`" + + for LINUX in ${LINUXPROBED} ; do + LROOT="`echo ${LINUX} | cut -d ':' -f 1`" + LBOOT="`echo ${LINUX} | cut -d ':' -f 2`" + LLABEL="`echo ${LINUX} | cut -d ':' -f 3 | tr '^' ' '`" + LKERNEL="`echo ${LINUX} | cut -d ':' -f 4`" + LINITRD="`echo ${LINUX} | cut -d ':' -f 5`" + LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`" + + LINUXROOT="`grub-probe --target=drive --device ${LBOOT} 2> /dev/null`" + + if [ -z "${LLABEL}" ] ; then + LLABEL="${LONGNAME}" + fi + + cat << EOF +menuentry "${LLABEL} (on ${DEVICE})" { + set root=${LINUXROOT} + linux ${LKERNEL} ${LPARAMS} +EOF + if [ -n "${LINITRD}" ] ; then + cat << EOF + initrd ${LINITRD} +EOF + fi + cat << EOF +} +EOF + done + ;; + hurd|*) + echo " ${LONGNAME} is not yet supported by update-grub." >&2 + ;; + esac +done From 58cd3d85e09fc2f6258d981d8cd0c0363e6b58d2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 10:55:19 +0000 Subject: [PATCH 0101/1707] 2008-04-13 Robert Millan * gendistlist.sh (EXTRA_DISTFILES): Add `genpartmaplist.sh'. * genmk.rb (partmap): New variable. (CLEANFILES, PARTMAPFILES): Add #{partmap}. (#{partmap}): New target rule. * genpartmaplist.sh: New file. * Makefile.in (pkglib_DATA): Add partmap.lst. (partmap.lst): New target rule. * util/i386/pc/grub-mkrescue.in: Generate grub.cfg that loads needed modules (including all partition maps), instead of preloading them. --- ChangeLog | 12 ++++++++++++ Makefile.in | 5 ++++- gendistlist.sh | 4 ++-- genmk.rb | 9 ++++++++- util/i386/pc/grub-mkrescue.in | 9 +++++++-- 5 files changed, 33 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 88fcf7b86..76fac8411 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-04-13 Robert Millan + + * gendistlist.sh (EXTRA_DISTFILES): Add `genpartmaplist.sh'. + * genmk.rb (partmap): New variable. + (CLEANFILES, PARTMAPFILES): Add #{partmap}. + (#{partmap}): New target rule. + * genpartmaplist.sh: New file. + * Makefile.in (pkglib_DATA): Add partmap.lst. + (partmap.lst): New target rule. + * util/i386/pc/grub-mkrescue.in: Generate grub.cfg that loads needed + modules (including all partition maps), instead of preloading them. + 2007-04-13 Fabian Greffrath * util/grub.d/30_os-prober.in: New script. Use `os-prober' and diff --git a/Makefile.in b/Makefile.in index c2f432ff3..afe53a3bc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -123,7 +123,7 @@ include $(srcdir)/conf/$(target_cpu)-$(platform).mk ### General targets. CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) -pkglib_DATA += moddep.lst command.lst fs.lst +pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk cat $(DEFSYMFILES) /dev/null \ | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \ @@ -135,6 +135,9 @@ command.lst: $(COMMANDFILES) fs.lst: $(FSFILES) cat $^ /dev/null | sort > $@ +partmap.lst: $(PARTMAPFILES) + cat $^ /dev/null | sort > $@ + ifeq (, $(UNIFONT_HEX)) else pkgdata_DATA += unicode.pff ascii.pff diff --git a/gendistlist.sh b/gendistlist.sh index f89365a1a..4c648aa90 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 2005, 2008 Free Software Foundation, Inc. # # This gendistlist.sh is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -16,7 +16,7 @@ EXTRA_DISTFILES="AUTHORS COPYING ChangeLog DISTLIST INSTALL NEWS README \ THANKS TODO Makefile.in aclocal.m4 autogen.sh config.guess \ config.h.in config.sub configure configure.ac gencmdlist.sh \ - gendistlist.sh genfslist.sh genkernsyms.sh genmk.rb \ + gendistlist.sh genfslist.sh genpartmaplist.sh genkernsyms.sh genmk.rb \ genmodsrc.sh gensymlist.sh install-sh mkinstalldirs stamp-h.in" DISTDIRS="boot commands conf disk font fs hello include io kern loader \ diff --git a/genmk.rb b/genmk.rb index d43244dea..9faea5aad 100644 --- a/genmk.rb +++ b/genmk.rb @@ -141,6 +141,7 @@ endif fake_obj = File.basename(src).suffix('o') command = 'cmd-' + obj.suffix('lst') fs = 'fs-' + obj.suffix('lst') + partmap = 'partmap-' + obj.suffix('lst') dep = deps[i] flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end @@ -150,9 +151,10 @@ endif $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} -CLEANFILES += #{command} #{fs} +CLEANFILES += #{command} #{fs} #{partmap} COMMANDFILES += #{command} FSFILES += #{fs} +PARTMAPFILES += #{partmap} #{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh set -e; \ @@ -164,6 +166,11 @@ FSFILES += #{fs} $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) +#{partmap}: #{src} $(#{src}_DEPENDENCIES) genpartmaplist.sh + set -e; \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + | sh $(srcdir)/genpartmaplist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) + " end.join('') diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 620c0f093..53bf8f652 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -109,6 +109,11 @@ cp ${input_dir}/*.mod \ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ ${aux_dir}/boot/grub/ +modules="biosdisk `cat ${input_dir}/partmap.lst` ${modules}" +for i in ${modules} ; do + echo "insmod $i" +done > ${aux_dir}/boot/grub/grub.cfg + if test "x$overlay" = x ; then : ; else cp -dpR ${overlay}/* ${aux_dir}/ fi @@ -121,7 +126,7 @@ if [ "x${image_type}" = "xfloppy" ] ; then # build core.img core_img=`mktemp` - ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio biosdisk ${modules} + ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio rm -f ${memdisk_img} # build floppy image @@ -130,7 +135,7 @@ if [ "x${image_type}" = "xfloppy" ] ; then else # build core.img core_img=`mktemp` - ${grub_mkimage} -d ${input_dir}/ -o ${core_img} biosdisk iso9660 ${modules} + ${grub_mkimage} -d ${input_dir}/ -o ${core_img} biosdisk iso9660 # build grub_eltorito image cat ${input_dir}/cdboot.img ${core_img} > ${aux_dir}/boot/grub/grub_eltorito From 5325687fc623661461de5fcf36f4cff8421ce110 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 10:58:23 +0000 Subject: [PATCH 0102/1707] forgot to add genpartmaplist.sh --- DISTLIST | 1 + genpartmaplist.sh | 21 +++++++++++++++++++++ 2 files changed, 22 insertions(+) create mode 100644 genpartmaplist.sh diff --git a/DISTLIST b/DISTLIST index 1afbca1f1..584561a89 100644 --- a/DISTLIST +++ b/DISTLIST @@ -24,6 +24,7 @@ genkernsyms.sh.in genmk.rb genmoddep.awk genmodsrc.sh +genpartmaplist.sh gensymlist.sh.in install-sh mkinstalldirs diff --git a/genpartmaplist.sh b/genpartmaplist.sh new file mode 100644 index 000000000..ba6504999 --- /dev/null +++ b/genpartmaplist.sh @@ -0,0 +1,21 @@ +#! /bin/sh +# +# Copyright (C) 2005, 2008 Free Software Foundation, Inc. +# +# This script is free software; the author +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Read source code from stdin and detect partmap names. + +module=$1 + +# For now, this emits only a module name, if the module registers a partition map. +if grep -v "^#" | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then + echo $module +fi From 7ceeee39d71e74bdf177e1b7f90eb6502a309094 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 12:22:22 +0000 Subject: [PATCH 0103/1707] 2008-04-13 Robert Millan Improve robustness when handling LVM. * disk/lvm.c (grub_lvm_getvalue): Return 0 when `*p' is NULL (and leave `*p' unmodified). (grub_lvm_iterate): Don't assume `vg->lvs != NULL' when iterating through it. (grub_lvm_memberlist): Don't assume `lv->vg->pvs != NULL' when iterating through it. (grub_lvm_open): Don't assume `vg->lvs != NULL' when iterating through it. (grub_lvm_scan_device): Check the return value (and fail gracefuly when due) on each grub_lvm_getvalue() or grub_strstr() call. Don't assume `vg->pvs != NULL' when iterating through it. --- ChangeLog | 16 +++ disk/lvm.c | 322 +++++++++++++++++++++++++++++++---------------------- 2 files changed, 206 insertions(+), 132 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76fac8411..1a4b09afb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-04-13 Robert Millan + + Improve robustness when handling LVM. + + * disk/lvm.c (grub_lvm_getvalue): Return 0 when `*p' is NULL + (and leave `*p' unmodified). + (grub_lvm_iterate): Don't assume `vg->lvs != NULL' when iterating + through it. + (grub_lvm_memberlist): Don't assume `lv->vg->pvs != NULL' when + iterating through it. + (grub_lvm_open): Don't assume `vg->lvs != NULL' when iterating + through it. + (grub_lvm_scan_device): Check the return value (and fail gracefuly + when due) on each grub_lvm_getvalue() or grub_strstr() call. + Don't assume `vg->pvs != NULL' when iterating through it. + 2008-04-13 Robert Millan * gendistlist.sh (EXTRA_DISTFILES): Add `genpartmaplist.sh'. diff --git a/disk/lvm.c b/disk/lvm.c index eb5840624..d215ca4d9 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -29,11 +29,15 @@ static int lv_count; /* Go the string STR and return the number after STR. *P will point - at the number. */ + at the number. In case STR is not found, *P will be NULL and the + return value will be 0. */ static int grub_lvm_getvalue (char **p, char *str) { - *p = grub_strstr (*p, str) + grub_strlen (str); + *p = grub_strstr (*p, str); + if (! *p) + return 0; + *p += grub_strlen (str); return grub_strtoul (*p, NULL, 10); } @@ -44,9 +48,10 @@ grub_lvm_iterate (int (*hook) (const char *name)) for (vg = vg_list; vg; vg = vg->next) { struct grub_lvm_lv *lv; - for (lv = vg->lvs; lv; lv = lv->next) - if (hook (lv->name)) - return 1; + if (vg->lvs) + for (lv = vg->lvs; lv; lv = lv->next) + if (hook (lv->name)) + return 1; } return 0; @@ -60,13 +65,14 @@ grub_lvm_memberlist (grub_disk_t disk) grub_disk_memberlist_t list = NULL, tmp; struct grub_lvm_pv *pv; - for (pv = lv->vg->pvs; pv; pv = pv->next) - { - tmp = grub_malloc (sizeof (*tmp)); - tmp->disk = pv->disk; - tmp->next = list; - list = tmp; - } + if (lv->vg->pvs) + for (pv = lv->vg->pvs; pv; pv = pv->next) + { + tmp = grub_malloc (sizeof (*tmp)); + tmp->disk = pv->disk; + tmp->next = list; + list = tmp; + } return list; } @@ -79,9 +85,10 @@ grub_lvm_open (const char *name, grub_disk_t disk) struct grub_lvm_lv *lv = NULL; for (vg = vg_list; vg; vg = vg->next) { - for (lv = vg->lvs; lv; lv = lv->next) - if (! grub_strcmp (lv->name, name)) - break; + if (vg->lvs) + for (lv = vg->lvs; lv; lv = lv->next) + if (! grub_strcmp (lv->name, name)) + break; if (lv) break; @@ -330,141 +337,191 @@ grub_lvm_scan_device (const char *name) grub_memcpy (vg->id, vg_id, GRUB_LVM_ID_STRLEN+1); vg->extent_size = grub_lvm_getvalue (&p, "extent_size = "); + if (p == NULL) + goto fail2; vg->lvs = NULL; vg->pvs = NULL; vg->next = vg_list; vg_list = vg; - p = grub_strstr (p, "physical_volumes {") - + sizeof ("physical_volumes {") - 1; - - /* Add all the pvs to the volume group. */ - while (1) + p = grub_strstr (p, "physical_volumes {"); + if (p) { - int s; - while (grub_isspace (*p)) - p++; + p += sizeof ("physical_volumes {") - 1; - if (*p == '}') - break; - - pv = grub_malloc (sizeof (*pv)); - q = p; - while (*q != ' ') - q++; - - s = q - p; - pv->name = grub_malloc (s + 1); - grub_memcpy (pv->name, p, s); - pv->name[s] = '\0'; - - p = grub_strstr (p, "id = \"") + sizeof("id = \"") - 1; - - grub_memcpy (pv->id, p, GRUB_LVM_ID_STRLEN); - pv->id[GRUB_LVM_ID_STRLEN] = '\0'; - - pv->start = grub_lvm_getvalue (&p, "pe_start = "); - pv->disk = NULL; - pv->next = vg->pvs; - vg->pvs = pv; - - p = grub_strchr (p, '}') + 1; + /* Add all the pvs to the volume group. */ + while (1) + { + int s; + while (grub_isspace (*p)) + p++; + + if (*p == '}') + break; + + pv = grub_malloc (sizeof (*pv)); + q = p; + while (*q != ' ') + q++; + + s = q - p; + pv->name = grub_malloc (s + 1); + grub_memcpy (pv->name, p, s); + pv->name[s] = '\0'; + + p = grub_strstr (p, "id = \"") + sizeof("id = \"") - 1; + if (p == NULL) + goto pvs_fail; + + grub_memcpy (pv->id, p, GRUB_LVM_ID_STRLEN); + pv->id[GRUB_LVM_ID_STRLEN] = '\0'; + + pv->start = grub_lvm_getvalue (&p, "pe_start = "); + if (p == NULL) + goto pvs_fail; + pv->disk = NULL; + pv->next = vg->pvs; + vg->pvs = pv; + + p = grub_strchr (p, '}') + 1; + + continue; + pvs_fail: + grub_free (pv->name); + grub_free (pv); + goto fail2; + } } p = grub_strstr (p, "logical_volumes"); - p += 18; - - /* And add all the lvs to the volume group. */ - while (1) + if (p) { - int s; - struct grub_lvm_lv *lv; - struct grub_lvm_segment *seg; + p += 18; - while (grub_isspace (*p)) - p++; - - if (*p == '}') - break; - - lv = grub_malloc (sizeof (*lv)); - - q = p; - while (*q != ' ') - q++; - - s = q - p; - lv->name = grub_malloc (vgname_len + 1 + s + 1); - grub_memcpy (lv->name, vgname, vgname_len); - lv->name[vgname_len] = '-'; - grub_memcpy (lv->name + vgname_len + 1, p, s); - lv->name[vgname_len + 1 + s] = '\0'; - - lv->size = 0; - - lv->segment_count = grub_lvm_getvalue (&p, "segment_count = "); - lv->segments = grub_malloc (sizeof (*seg) * lv->segment_count); - seg = lv->segments; - - for (i = 0; i < lv->segment_count; i++) + /* And add all the lvs to the volume group. */ + while (1) { - struct grub_lvm_stripe *stripe; - - p = grub_strstr (p, "segment"); - - seg->start_extent = grub_lvm_getvalue (&p, "start_extent = "); - seg->extent_count = grub_lvm_getvalue (&p, "extent_count = "); - seg->stripe_count = grub_lvm_getvalue (&p, "stripe_count = "); - - lv->size += seg->extent_count * vg->extent_size; + int s; + struct grub_lvm_lv *lv; + struct grub_lvm_segment *seg; - if (seg->stripe_count != 1) - seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = "); - - seg->stripes = grub_malloc (sizeof (*stripe) - * seg->stripe_count); - stripe = seg->stripes; + while (grub_isspace (*p)) + p++; - p = grub_strstr (p, "stripes = [") - + sizeof("stripes = [") - 1; + if (*p == '}') + break; - for (j = 0; j < seg->stripe_count; j++) + lv = grub_malloc (sizeof (*lv)); + + q = p; + while (*q != ' ') + q++; + + s = q - p; + lv->name = grub_malloc (vgname_len + 1 + s + 1); + grub_memcpy (lv->name, vgname, vgname_len); + lv->name[vgname_len] = '-'; + grub_memcpy (lv->name + vgname_len + 1, p, s); + lv->name[vgname_len + 1 + s] = '\0'; + + lv->size = 0; + + lv->segment_count = grub_lvm_getvalue (&p, "segment_count = "); + if (p == NULL) + goto lvs_fail; + lv->segments = grub_malloc (sizeof (*seg) * lv->segment_count); + seg = lv->segments; + + for (i = 0; i < lv->segment_count; i++) { - char pvname[10]; + struct grub_lvm_stripe *stripe; - q = p = grub_strchr (p, '"') + 1; - while (*q != '"') - q++; - - s = q - p; - grub_memcpy (pvname, p, s); - pvname[s] = '\0'; + p = grub_strstr (p, "segment"); + if (p == NULL) + goto lvs_segment_fail; - for (pv = vg->pvs; pv; pv = pv->next) + seg->start_extent = grub_lvm_getvalue (&p, "start_extent = "); + if (p == NULL) + goto lvs_segment_fail; + seg->extent_count = grub_lvm_getvalue (&p, "extent_count = "); + if (p == NULL) + goto lvs_segment_fail; + seg->stripe_count = grub_lvm_getvalue (&p, "stripe_count = "); + if (p == NULL) + goto lvs_segment_fail; + + lv->size += seg->extent_count * vg->extent_size; + + if (seg->stripe_count != 1) + seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = "); + + seg->stripes = grub_malloc (sizeof (*stripe) + * seg->stripe_count); + stripe = seg->stripes; + + p = grub_strstr (p, "stripes = ["); + if (p == NULL) + goto lvs_segment_fail2; + p += sizeof("stripes = [") - 1; + + for (j = 0; j < seg->stripe_count; j++) { - if (! grub_strcmp (pvname, pv->name)) - { - stripe->pv = pv; - break; - } - } + char pvname[10]; + + p = grub_strchr (p, '"'); + if (p == NULL) + continue; + q = ++p; + while (*q != '"') + q++; - p = grub_strchr (p, ',') + 1; - stripe->start = grub_strtoul (p, NULL, 10); + s = q - p; + grub_memcpy (pvname, p, s); + pvname[s] = '\0'; + + if (vg->pvs) + for (pv = vg->pvs; pv; pv = pv->next) + { + if (! grub_strcmp (pvname, pv->name)) + { + stripe->pv = pv; + break; + } + } + + stripe->start = grub_lvm_getvalue (&p, ","); + if (p == NULL) + continue; + + stripe++; + } - stripe++; + seg++; + + continue; + lvs_segment_fail2: + grub_free (seg->stripes); + lvs_segment_fail: + goto fail2; } - seg++; + lv->number = lv_count++; + lv->vg = vg; + lv->next = vg->lvs; + vg->lvs = lv; + + p = grub_strchr (p, '}'); + if (p == NULL) + goto lvs_fail; + p += 3; + + continue; + lvs_fail: + grub_free (lv->name); + grub_free (lv); + goto fail2; } - - lv->number = lv_count++; - lv->vg = vg; - lv->next = vg->lvs; - vg->lvs = lv; - - p = grub_strchr (p, '}') + 3; } } else @@ -474,14 +531,15 @@ grub_lvm_scan_device (const char *name) /* Match the device we are currently reading from with the right PV. */ - for (pv = vg->pvs; pv; pv = pv->next) - { - if (! grub_memcmp (pv->id, pv_id, GRUB_LVM_ID_STRLEN)) - { - pv->disk = grub_disk_open (name); - break; - } - } + if (vg->pvs) + for (pv = vg->pvs; pv; pv = pv->next) + { + if (! grub_memcmp (pv->id, pv_id, GRUB_LVM_ID_STRLEN)) + { + pv->disk = grub_disk_open (name); + break; + } + } fail2: grub_free (metadatabuf); From 9fe8603472540667252556a0396a84d681ec9412 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 14:58:42 +0000 Subject: [PATCH 0104/1707] 2008-04-13 Robert Millan * kern/misc.c (grub_strncat): Fix off-by-one error. Reported by Zhang Huan * kern/env.c (grub_env_context_close): Clear current context, not previous one. Patch from Zhang Huan * kern/misc.c (grub_strcat): Minor speed optimization (same code size). --- ChangeLog | 11 +++++++++++ kern/env.c | 2 +- kern/misc.c | 19 +++++++++++++------ 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a4b09afb..71400698d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-04-13 Robert Millan + + * kern/misc.c (grub_strncat): Fix off-by-one error. + Reported by Zhang Huan + + * kern/env.c (grub_env_context_close): Clear current context, not + previous one. + Patch from Zhang Huan + + * kern/misc.c (grub_strcat): Minor speed optimization (same code size). + 2008-04-13 Robert Millan Improve robustness when handling LVM. diff --git a/kern/env.c b/kern/env.c index 2b777826e..a13989837 100644 --- a/kern/env.c +++ b/kern/env.c @@ -124,7 +124,7 @@ grub_env_context_close (void) { struct grub_env_var *p, *q; - for (p = current_context->prev->vars[i]; p; p = q) + for (p = current_context->vars[i]; p; p = q) { q = p->next; grub_free (p); diff --git a/kern/misc.c b/kern/misc.c index e6d5c057f..1374e3b5f 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -94,8 +94,11 @@ grub_strcat (char *dest, const char *src) while (*p) p++; - while ((*p++ = *src++) != '\0') - ; + while ((*p = *src) != '\0') + { + p++; + src++; + } return dest; } @@ -108,10 +111,14 @@ grub_strncat (char *dest, const char *src, int c) while (*p) p++; - while ((*p++ = *src++) != '\0' && --c) - ; - *(--p) = '\0'; - + while ((*p = *src) != '\0' && c--) + { + p++; + src++; + } + + *p = '\0'; + return dest; } From e54a72f5cb3fd9214bd49114641416626c5f1be6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 15:13:49 +0000 Subject: [PATCH 0105/1707] 2008-04-13 Christian Franke * util/i386/pc/grub-mkrescue.in: Add --emulation=floppy to create a floppy emulation boot CD when non emulation mode does not work. Enable Joliet CD filesystem extension. --- ChangeLog | 7 +++++++ util/i386/pc/grub-mkrescue.in | 30 +++++++++++++++++++++++++++--- 2 files changed, 34 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71400698d..8ab8ba767 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-13 Christian Franke + + * util/i386/pc/grub-mkrescue.in: Add --emulation=floppy + to create a floppy emulation boot CD when non emulation mode + does not work. + Enable Joliet CD filesystem extension. + 2008-04-13 Robert Millan * kern/misc.c (grub_strncat): Fix off-by-one error. diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 53bf8f652..668f270f4 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -46,6 +46,8 @@ Make GRUB rescue image. --pkglibdir=DIR use images from directory DIR instead of ${pkglibdir} --grub-mkimage=FILE use FILE as grub-mkimage --image-type=TYPE select floppy or cdrom (default) + --emulation=TYPE select El Torito boot emulation type floppy + or none (default) (cdrom only) grub-mkimage generates a bootable rescue image of the specified type. @@ -56,6 +58,7 @@ EOF image_type=cdrom input_dir=${pkglibdir} grub_mkimage=grub-mkimage +emulation=none # Check the arguments. for option in "$@"; do @@ -82,6 +85,14 @@ for option in "$@"; do echo "Unknown image type \`$image_type'" 1>&2 exit 1 ;; esac ;; + --emulation=*) + emulation=`echo "$option" | sed 's/--emulation=//'` + case "$emulation" in + floppy|none) ;; + *) + echo "Unknown emulation type \`$emulation'" 1>&2 + exit 1 ;; + esac ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage @@ -118,7 +129,7 @@ if test "x$overlay" = x ; then : ; else cp -dpR ${overlay}/* ${aux_dir}/ fi -if [ "x${image_type}" = "xfloppy" ] ; then +if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then # build memdisk memdisk_img=`mktemp` tar -C ${aux_dir} -cf ${memdisk_img} boot @@ -130,8 +141,21 @@ if [ "x${image_type}" = "xfloppy" ] ; then rm -f ${memdisk_img} # build floppy image - cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > $output_image + if [ "x${image_type}" = xcdrom ] ; then + floppy_dir=`mktemp -d` + floppy_img=${floppy_dir}/grub_floppy.img + else + floppy_img=${output_image} + fi + cat ${input_dir}/boot.img ${core_img} /dev/zero | dd bs=1024 count=1440 > ${floppy_img} rm -f ${core_img} + + if [ "x${image_type}" = xcdrom ] ; then + # build iso image + genisoimage -b grub_floppy.img \ + -o ${output_image} -r -J ${floppy_dir} + rm -rf ${floppy_dir} + fi else # build core.img core_img=`mktemp` @@ -144,7 +168,7 @@ else # build iso image genisoimage -b boot/grub/grub_eltorito \ -no-emul-boot -boot-load-size 4 -boot-info-table \ - -o ${output_image} -r ${aux_dir} + -o ${output_image} -r -J ${aux_dir} rm -rf ${aux_dir} fi From 82ead3fe322a2c2869238f1cb7b0f9358bdce9b2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Apr 2008 18:40:25 +0000 Subject: [PATCH 0106/1707] 2008-04-13 Robert Millan * disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Fix CHS limit check, as per http://www.allensmith.net/Storage/HDDlimit/Int13h.htm --- ChangeLog | 5 +++++ disk/i386/pc/biosdisk.c | 14 ++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ab8ba767..79c1db86b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-13 Robert Millan + + * disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Fix CHS limit check, + as per http://www.allensmith.net/Storage/HDDlimit/Int13h.htm + 2008-04-13 Christian Franke * util/i386/pc/grub-mkrescue.in: Add --emulation=floppy diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index 93f0da91f..094bde0aa 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -234,15 +234,17 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, { unsigned coff, hoff, soff; unsigned head; - unsigned real_sector = (unsigned) sector; - /* It is impossible to reach over 2TB with the traditional - CHS access. */ - if (sector > ~0UL) + /* It is impossible to reach over 8064 MiB (a bit less than LBA24) with + the traditional CHS access. */ + if (sector > + 1024 /* cylinders */ * + 256 /* heads */ * + 63 /* spt */) return grub_error (GRUB_ERR_OUT_OF_RANGE, "out of disk"); - soff = real_sector % data->sectors + 1; - head = real_sector / data->sectors; + soff = ((grub_uint32_t) sector) % data->sectors + 1; + head = ((grub_uint32_t) sector) / data->sectors; hoff = head % data->heads; coff = head / data->heads; From 228ffeab3e8156385d5eeb6c8d053debca927afc Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 14 Apr 2008 00:58:23 +0000 Subject: [PATCH 0107/1707] Regenerate --- conf/common.mk | 282 ++++++++++++++++++++++++++++++------ conf/i386-efi.mk | 276 +++++++++++++++++++++++++++++------ conf/i386-ieee1275.mk | 150 +++++++++++++++---- conf/i386-linuxbios.mk | 162 +++++++++++++++++---- conf/i386-pc.mk | 306 ++++++++++++++++++++++++++++++++------- conf/powerpc-ieee1275.mk | 144 +++++++++++++++--- conf/sparc64-ieee1275.mk | 264 +++++++++++++++++++++++++++------ 7 files changed, 1320 insertions(+), 264 deletions(-) diff --git a/conf/common.mk b/conf/common.mk index 75fb633ba..0b8cacf66 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -510,9 +510,10 @@ fshelp_mod-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -MD -c -o $@ $< -include fshelp_mod-fs_fshelp.d -CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst +CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst partmap-fshelp_mod-fs_fshelp.lst COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst FSFILES += fs-fshelp_mod-fs_fshelp.lst +PARTMAPFILES += partmap-fshelp_mod-fs_fshelp.lst cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) @@ -520,6 +521,9 @@ cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) +partmap-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) + fshelp_mod_CFLAGS = $(COMMON_CFLAGS) fshelp_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -562,9 +566,10 @@ fat_mod-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -MD -c -o $@ $< -include fat_mod-fs_fat.d -CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst +CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst partmap-fat_mod-fs_fat.lst COMMANDFILES += cmd-fat_mod-fs_fat.lst FSFILES += fs-fat_mod-fs_fat.lst +PARTMAPFILES += partmap-fat_mod-fs_fat.lst cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) @@ -572,6 +577,9 @@ cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) +partmap-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) + fat_mod_CFLAGS = $(COMMON_CFLAGS) fat_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -614,9 +622,10 @@ ufs_mod-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -MD -c -o $@ $< -include ufs_mod-fs_ufs.d -CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst +CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst partmap-ufs_mod-fs_ufs.lst COMMANDFILES += cmd-ufs_mod-fs_ufs.lst FSFILES += fs-ufs_mod-fs_ufs.lst +PARTMAPFILES += partmap-ufs_mod-fs_ufs.lst cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) @@ -624,6 +633,9 @@ cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) +partmap-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) + ufs_mod_CFLAGS = $(COMMON_CFLAGS) ufs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -666,9 +678,10 @@ ext2_mod-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -MD -c -o $@ $< -include ext2_mod-fs_ext2.d -CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst +CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst partmap-ext2_mod-fs_ext2.lst COMMANDFILES += cmd-ext2_mod-fs_ext2.lst FSFILES += fs-ext2_mod-fs_ext2.lst +PARTMAPFILES += partmap-ext2_mod-fs_ext2.lst cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) @@ -676,6 +689,9 @@ cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) +partmap-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) + ext2_mod_CFLAGS = $(COMMON_CFLAGS) ext2_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -718,9 +734,10 @@ ntfs_mod-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -MD -c -o $@ $< -include ntfs_mod-fs_ntfs.d -CLEANFILES += cmd-ntfs_mod-fs_ntfs.lst fs-ntfs_mod-fs_ntfs.lst +CLEANFILES += cmd-ntfs_mod-fs_ntfs.lst fs-ntfs_mod-fs_ntfs.lst partmap-ntfs_mod-fs_ntfs.lst COMMANDFILES += cmd-ntfs_mod-fs_ntfs.lst FSFILES += fs-ntfs_mod-fs_ntfs.lst +PARTMAPFILES += partmap-ntfs_mod-fs_ntfs.lst cmd-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfs > $@ || (rm -f $@; exit 1) @@ -728,6 +745,9 @@ cmd-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) gencmdlist.sh fs-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfs > $@ || (rm -f $@; exit 1) +partmap-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfs > $@ || (rm -f $@; exit 1) + ntfs_mod_CFLAGS = $(COMMON_CFLAGS) ntfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -770,9 +790,10 @@ ntfscomp_mod-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -MD -c -o $@ $< -include ntfscomp_mod-fs_ntfscomp.d -CLEANFILES += cmd-ntfscomp_mod-fs_ntfscomp.lst fs-ntfscomp_mod-fs_ntfscomp.lst +CLEANFILES += cmd-ntfscomp_mod-fs_ntfscomp.lst fs-ntfscomp_mod-fs_ntfscomp.lst partmap-ntfscomp_mod-fs_ntfscomp.lst COMMANDFILES += cmd-ntfscomp_mod-fs_ntfscomp.lst FSFILES += fs-ntfscomp_mod-fs_ntfscomp.lst +PARTMAPFILES += partmap-ntfscomp_mod-fs_ntfscomp.lst cmd-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfscomp > $@ || (rm -f $@; exit 1) @@ -780,6 +801,9 @@ cmd-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) ge fs-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfscomp > $@ || (rm -f $@; exit 1) +partmap-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfscomp > $@ || (rm -f $@; exit 1) + ntfscomp_mod_CFLAGS = $(COMMON_CFLAGS) ntfscomp_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -822,9 +846,10 @@ minix_mod-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -MD -c -o $@ $< -include minix_mod-fs_minix.d -CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst +CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst partmap-minix_mod-fs_minix.lst COMMANDFILES += cmd-minix_mod-fs_minix.lst FSFILES += fs-minix_mod-fs_minix.lst +PARTMAPFILES += partmap-minix_mod-fs_minix.lst cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) @@ -832,6 +857,9 @@ cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) +partmap-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) + minix_mod_CFLAGS = $(COMMON_CFLAGS) minix_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -874,9 +902,10 @@ hfs_mod-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -MD -c -o $@ $< -include hfs_mod-fs_hfs.d -CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst +CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst partmap-hfs_mod-fs_hfs.lst COMMANDFILES += cmd-hfs_mod-fs_hfs.lst FSFILES += fs-hfs_mod-fs_hfs.lst +PARTMAPFILES += partmap-hfs_mod-fs_hfs.lst cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) @@ -884,6 +913,9 @@ cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) +partmap-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) + hfs_mod_CFLAGS = $(COMMON_CFLAGS) hfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -926,9 +958,10 @@ jfs_mod-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -MD -c -o $@ $< -include jfs_mod-fs_jfs.d -CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst +CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst partmap-jfs_mod-fs_jfs.lst COMMANDFILES += cmd-jfs_mod-fs_jfs.lst FSFILES += fs-jfs_mod-fs_jfs.lst +PARTMAPFILES += partmap-jfs_mod-fs_jfs.lst cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) @@ -936,6 +969,9 @@ cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) +partmap-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) + jfs_mod_CFLAGS = $(COMMON_CFLAGS) jfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -978,9 +1014,10 @@ iso9660_mod-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -MD -c -o $@ $< -include iso9660_mod-fs_iso9660.d -CLEANFILES += cmd-iso9660_mod-fs_iso9660.lst fs-iso9660_mod-fs_iso9660.lst +CLEANFILES += cmd-iso9660_mod-fs_iso9660.lst fs-iso9660_mod-fs_iso9660.lst partmap-iso9660_mod-fs_iso9660.lst COMMANDFILES += cmd-iso9660_mod-fs_iso9660.lst FSFILES += fs-iso9660_mod-fs_iso9660.lst +PARTMAPFILES += partmap-iso9660_mod-fs_iso9660.lst cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1) @@ -988,6 +1025,9 @@ cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) gencmd fs-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1) +partmap-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh iso9660 > $@ || (rm -f $@; exit 1) + iso9660_mod_CFLAGS = $(COMMON_CFLAGS) iso9660_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1030,9 +1070,10 @@ xfs_mod-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -MD -c -o $@ $< -include xfs_mod-fs_xfs.d -CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst +CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst partmap-xfs_mod-fs_xfs.lst COMMANDFILES += cmd-xfs_mod-fs_xfs.lst FSFILES += fs-xfs_mod-fs_xfs.lst +PARTMAPFILES += partmap-xfs_mod-fs_xfs.lst cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) @@ -1040,6 +1081,9 @@ cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) +partmap-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) + xfs_mod_CFLAGS = $(COMMON_CFLAGS) xfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1082,9 +1126,10 @@ affs_mod-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -MD -c -o $@ $< -include affs_mod-fs_affs.d -CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst +CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst partmap-affs_mod-fs_affs.lst COMMANDFILES += cmd-affs_mod-fs_affs.lst FSFILES += fs-affs_mod-fs_affs.lst +PARTMAPFILES += partmap-affs_mod-fs_affs.lst cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) @@ -1092,6 +1137,9 @@ cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) +partmap-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) + affs_mod_CFLAGS = $(COMMON_CFLAGS) affs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1134,9 +1182,10 @@ sfs_mod-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -MD -c -o $@ $< -include sfs_mod-fs_sfs.d -CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst +CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst partmap-sfs_mod-fs_sfs.lst COMMANDFILES += cmd-sfs_mod-fs_sfs.lst FSFILES += fs-sfs_mod-fs_sfs.lst +PARTMAPFILES += partmap-sfs_mod-fs_sfs.lst cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) @@ -1144,6 +1193,9 @@ cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) +partmap-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) + sfs_mod_CFLAGS = $(COMMON_CFLAGS) sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1186,9 +1238,10 @@ hfsplus_mod-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -MD -c -o $@ $< -include hfsplus_mod-fs_hfsplus.d -CLEANFILES += cmd-hfsplus_mod-fs_hfsplus.lst fs-hfsplus_mod-fs_hfsplus.lst +CLEANFILES += cmd-hfsplus_mod-fs_hfsplus.lst fs-hfsplus_mod-fs_hfsplus.lst partmap-hfsplus_mod-fs_hfsplus.lst COMMANDFILES += cmd-hfsplus_mod-fs_hfsplus.lst FSFILES += fs-hfsplus_mod-fs_hfsplus.lst +PARTMAPFILES += partmap-hfsplus_mod-fs_hfsplus.lst cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1) @@ -1196,6 +1249,9 @@ cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) gencmd fs-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1) +partmap-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfsplus > $@ || (rm -f $@; exit 1) + hfsplus_mod_CFLAGS = $(COMMON_CFLAGS) hfsplus_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1238,9 +1294,10 @@ reiserfs_mod-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -MD -c -o $@ $< -include reiserfs_mod-fs_reiserfs.d -CLEANFILES += cmd-reiserfs_mod-fs_reiserfs.lst fs-reiserfs_mod-fs_reiserfs.lst +CLEANFILES += cmd-reiserfs_mod-fs_reiserfs.lst fs-reiserfs_mod-fs_reiserfs.lst partmap-reiserfs_mod-fs_reiserfs.lst COMMANDFILES += cmd-reiserfs_mod-fs_reiserfs.lst FSFILES += fs-reiserfs_mod-fs_reiserfs.lst +PARTMAPFILES += partmap-reiserfs_mod-fs_reiserfs.lst cmd-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reiserfs > $@ || (rm -f $@; exit 1) @@ -1248,6 +1305,9 @@ cmd-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) ge fs-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reiserfs > $@ || (rm -f $@; exit 1) +partmap-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reiserfs > $@ || (rm -f $@; exit 1) + reiserfs_mod_CFLAGS = $(COMMON_CFLAGS) reiserfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1290,9 +1350,10 @@ cpio_mod-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -MD -c -o $@ $< -include cpio_mod-fs_cpio.d -CLEANFILES += cmd-cpio_mod-fs_cpio.lst fs-cpio_mod-fs_cpio.lst +CLEANFILES += cmd-cpio_mod-fs_cpio.lst fs-cpio_mod-fs_cpio.lst partmap-cpio_mod-fs_cpio.lst COMMANDFILES += cmd-cpio_mod-fs_cpio.lst FSFILES += fs-cpio_mod-fs_cpio.lst +PARTMAPFILES += partmap-cpio_mod-fs_cpio.lst cmd-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpio > $@ || (rm -f $@; exit 1) @@ -1300,6 +1361,9 @@ cmd-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh fs-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpio > $@ || (rm -f $@; exit 1) +partmap-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpio > $@ || (rm -f $@; exit 1) + cpio_mod_CFLAGS = $(COMMON_CFLAGS) cpio_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1342,9 +1406,10 @@ udf_mod-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -MD -c -o $@ $< -include udf_mod-fs_udf.d -CLEANFILES += cmd-udf_mod-fs_udf.lst fs-udf_mod-fs_udf.lst +CLEANFILES += cmd-udf_mod-fs_udf.lst fs-udf_mod-fs_udf.lst partmap-udf_mod-fs_udf.lst COMMANDFILES += cmd-udf_mod-fs_udf.lst FSFILES += fs-udf_mod-fs_udf.lst +PARTMAPFILES += partmap-udf_mod-fs_udf.lst cmd-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh udf > $@ || (rm -f $@; exit 1) @@ -1352,6 +1417,9 @@ cmd-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) gencmdlist.sh fs-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh udf > $@ || (rm -f $@; exit 1) +partmap-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh udf > $@ || (rm -f $@; exit 1) + udf_mod_CFLAGS = $(COMMON_CFLAGS) udf_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1394,9 +1462,10 @@ afs_mod-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -MD -c -o $@ $< -include afs_mod-fs_afs.d -CLEANFILES += cmd-afs_mod-fs_afs.lst fs-afs_mod-fs_afs.lst +CLEANFILES += cmd-afs_mod-fs_afs.lst fs-afs_mod-fs_afs.lst partmap-afs_mod-fs_afs.lst COMMANDFILES += cmd-afs_mod-fs_afs.lst FSFILES += fs-afs_mod-fs_afs.lst +PARTMAPFILES += partmap-afs_mod-fs_afs.lst cmd-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh afs > $@ || (rm -f $@; exit 1) @@ -1404,6 +1473,9 @@ cmd-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) gencmdlist.sh fs-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh afs > $@ || (rm -f $@; exit 1) +partmap-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh afs > $@ || (rm -f $@; exit 1) + afs_mod_CFLAGS = $(COMMON_CFLAGS) afs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1449,9 +1521,10 @@ amiga_mod-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -MD -c -o $@ $< -include amiga_mod-partmap_amiga.d -CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst +CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst partmap-amiga_mod-partmap_amiga.lst COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst FSFILES += fs-amiga_mod-partmap_amiga.lst +PARTMAPFILES += partmap-amiga_mod-partmap_amiga.lst cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) @@ -1459,6 +1532,9 @@ cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) +partmap-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) + amiga_mod_CFLAGS = $(COMMON_CFLAGS) amiga_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1501,9 +1577,10 @@ apple_mod-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -MD -c -o $@ $< -include apple_mod-partmap_apple.d -CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst +CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst partmap-apple_mod-partmap_apple.lst COMMANDFILES += cmd-apple_mod-partmap_apple.lst FSFILES += fs-apple_mod-partmap_apple.lst +PARTMAPFILES += partmap-apple_mod-partmap_apple.lst cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) @@ -1511,6 +1588,9 @@ cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) +partmap-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) + apple_mod_CFLAGS = $(COMMON_CFLAGS) apple_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1553,9 +1633,10 @@ pc_mod-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -MD -c -o $@ $< -include pc_mod-partmap_pc.d -CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst +CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst partmap-pc_mod-partmap_pc.lst COMMANDFILES += cmd-pc_mod-partmap_pc.lst FSFILES += fs-pc_mod-partmap_pc.lst +PARTMAPFILES += partmap-pc_mod-partmap_pc.lst cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) @@ -1563,6 +1644,9 @@ cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist. fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) +partmap-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) + pc_mod_CFLAGS = $(COMMON_CFLAGS) pc_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1605,9 +1689,10 @@ sun_mod-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -MD -c -o $@ $< -include sun_mod-partmap_sun.d -CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst +CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst partmap-sun_mod-partmap_sun.lst COMMANDFILES += cmd-sun_mod-partmap_sun.lst FSFILES += fs-sun_mod-partmap_sun.lst +PARTMAPFILES += partmap-sun_mod-partmap_sun.lst cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) @@ -1615,6 +1700,9 @@ cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdl fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) +partmap-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) + sun_mod_CFLAGS = $(COMMON_CFLAGS) sun_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1657,9 +1745,10 @@ acorn_mod-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -MD -c -o $@ $< -include acorn_mod-partmap_acorn.d -CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst +CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst partmap-acorn_mod-partmap_acorn.lst COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst FSFILES += fs-acorn_mod-partmap_acorn.lst +PARTMAPFILES += partmap-acorn_mod-partmap_acorn.lst cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) @@ -1667,6 +1756,9 @@ cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) +partmap-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) + acorn_mod_CFLAGS = $(COMMON_CFLAGS) acorn_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1709,9 +1801,10 @@ gpt_mod-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -MD -c -o $@ $< -include gpt_mod-partmap_gpt.d -CLEANFILES += cmd-gpt_mod-partmap_gpt.lst fs-gpt_mod-partmap_gpt.lst +CLEANFILES += cmd-gpt_mod-partmap_gpt.lst fs-gpt_mod-partmap_gpt.lst partmap-gpt_mod-partmap_gpt.lst COMMANDFILES += cmd-gpt_mod-partmap_gpt.lst FSFILES += fs-gpt_mod-partmap_gpt.lst +PARTMAPFILES += partmap-gpt_mod-partmap_gpt.lst cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1) @@ -1719,6 +1812,9 @@ cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) gencmdl fs-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1) +partmap-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gpt > $@ || (rm -f $@; exit 1) + gpt_mod_CFLAGS = $(COMMON_CFLAGS) gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1765,9 +1861,10 @@ raid_mod-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -MD -c -o $@ $< -include raid_mod-disk_raid.d -CLEANFILES += cmd-raid_mod-disk_raid.lst fs-raid_mod-disk_raid.lst +CLEANFILES += cmd-raid_mod-disk_raid.lst fs-raid_mod-disk_raid.lst partmap-raid_mod-disk_raid.lst COMMANDFILES += cmd-raid_mod-disk_raid.lst FSFILES += fs-raid_mod-disk_raid.lst +PARTMAPFILES += partmap-raid_mod-disk_raid.lst cmd-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid > $@ || (rm -f $@; exit 1) @@ -1775,6 +1872,9 @@ cmd-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) gencmdlist.s fs-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid > $@ || (rm -f $@; exit 1) +partmap-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid > $@ || (rm -f $@; exit 1) + raid_mod_CFLAGS = $(COMMON_CFLAGS) raid_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1817,9 +1917,10 @@ lvm_mod-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -MD -c -o $@ $< -include lvm_mod-disk_lvm.d -CLEANFILES += cmd-lvm_mod-disk_lvm.lst fs-lvm_mod-disk_lvm.lst +CLEANFILES += cmd-lvm_mod-disk_lvm.lst fs-lvm_mod-disk_lvm.lst partmap-lvm_mod-disk_lvm.lst COMMANDFILES += cmd-lvm_mod-disk_lvm.lst FSFILES += fs-lvm_mod-disk_lvm.lst +PARTMAPFILES += partmap-lvm_mod-disk_lvm.lst cmd-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lvm > $@ || (rm -f $@; exit 1) @@ -1827,6 +1928,9 @@ cmd-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) gencmdlist.sh fs-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lvm > $@ || (rm -f $@; exit 1) +partmap-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lvm > $@ || (rm -f $@; exit 1) + lvm_mod_CFLAGS = $(COMMON_CFLAGS) lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1876,9 +1980,10 @@ hello_mod-hello_hello.o: hello/hello.c $(hello/hello.c_DEPENDENCIES) $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -MD -c -o $@ $< -include hello_mod-hello_hello.d -CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst +CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst partmap-hello_mod-hello_hello.lst COMMANDFILES += cmd-hello_mod-hello_hello.lst FSFILES += fs-hello_mod-hello_hello.lst +PARTMAPFILES += partmap-hello_mod-hello_hello.lst cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) @@ -1886,6 +1991,9 @@ cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencm fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) +partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) + hello_mod_CFLAGS = $(COMMON_CFLAGS) hello_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1928,9 +2036,10 @@ boot_mod-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -MD -c -o $@ $< -include boot_mod-commands_boot.d -CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst +CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst partmap-boot_mod-commands_boot.lst COMMANDFILES += cmd-boot_mod-commands_boot.lst FSFILES += fs-boot_mod-commands_boot.lst +PARTMAPFILES += partmap-boot_mod-commands_boot.lst cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) @@ -1938,6 +2047,9 @@ cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) fs-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) +partmap-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh boot > $@ || (rm -f $@; exit 1) + boot_mod_CFLAGS = $(COMMON_CFLAGS) boot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1980,9 +2092,10 @@ terminal_mod-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPE $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -MD -c -o $@ $< -include terminal_mod-commands_terminal.d -CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_terminal.lst +CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_terminal.lst partmap-terminal_mod-commands_terminal.lst COMMANDFILES += cmd-terminal_mod-commands_terminal.lst FSFILES += fs-terminal_mod-commands_terminal.lst +PARTMAPFILES += partmap-terminal_mod-commands_terminal.lst cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) @@ -1990,6 +2103,9 @@ cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal. fs-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) +partmap-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminal > $@ || (rm -f $@; exit 1) + terminal_mod_CFLAGS = $(COMMON_CFLAGS) terminal_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2032,9 +2148,10 @@ ls_mod-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -MD -c -o $@ $< -include ls_mod-commands_ls.d -CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst +CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst partmap-ls_mod-commands_ls.lst COMMANDFILES += cmd-ls_mod-commands_ls.lst FSFILES += fs-ls_mod-commands_ls.lst +PARTMAPFILES += partmap-ls_mod-commands_ls.lst cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) @@ -2042,6 +2159,9 @@ cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdli fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) +partmap-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) + ls_mod_CFLAGS = $(COMMON_CFLAGS) ls_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2084,9 +2204,10 @@ cmp_mod-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -MD -c -o $@ $< -include cmp_mod-commands_cmp.d -CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst +CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst partmap-cmp_mod-commands_cmp.lst COMMANDFILES += cmd-cmp_mod-commands_cmp.lst FSFILES += fs-cmp_mod-commands_cmp.lst +PARTMAPFILES += partmap-cmp_mod-commands_cmp.lst cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) @@ -2094,6 +2215,9 @@ cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genc fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) +partmap-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) + cmp_mod_CFLAGS = $(COMMON_CFLAGS) cmp_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2136,9 +2260,10 @@ cat_mod-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -MD -c -o $@ $< -include cat_mod-commands_cat.d -CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst +CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst partmap-cat_mod-commands_cat.lst COMMANDFILES += cmd-cat_mod-commands_cat.lst FSFILES += fs-cat_mod-commands_cat.lst +PARTMAPFILES += partmap-cat_mod-commands_cat.lst cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) @@ -2146,6 +2271,9 @@ cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genc fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) +partmap-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) + cat_mod_CFLAGS = $(COMMON_CFLAGS) cat_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2188,9 +2316,10 @@ echo_mod-commands_echo.o: commands/echo.c $(commands/echo.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -MD -c -o $@ $< -include echo_mod-commands_echo.d -CLEANFILES += cmd-echo_mod-commands_echo.lst fs-echo_mod-commands_echo.lst +CLEANFILES += cmd-echo_mod-commands_echo.lst fs-echo_mod-commands_echo.lst partmap-echo_mod-commands_echo.lst COMMANDFILES += cmd-echo_mod-commands_echo.lst FSFILES += fs-echo_mod-commands_echo.lst +PARTMAPFILES += partmap-echo_mod-commands_echo.lst cmd-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh echo > $@ || (rm -f $@; exit 1) @@ -2198,6 +2327,9 @@ cmd-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) fs-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh echo > $@ || (rm -f $@; exit 1) +partmap-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh echo > $@ || (rm -f $@; exit 1) + echo_mod_CFLAGS = $(COMMON_CFLAGS) echo_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2240,9 +2372,10 @@ help_mod-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -MD -c -o $@ $< -include help_mod-commands_help.d -CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst +CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst partmap-help_mod-commands_help.lst COMMANDFILES += cmd-help_mod-commands_help.lst FSFILES += fs-help_mod-commands_help.lst +PARTMAPFILES += partmap-help_mod-commands_help.lst cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) @@ -2250,6 +2383,9 @@ cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) +partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) + help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2292,9 +2428,10 @@ font_mod-font_manager.o: font/manager.c $(font/manager.c_DEPENDENCIES) $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< -include font_mod-font_manager.d -CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst +CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst partmap-font_mod-font_manager.lst COMMANDFILES += cmd-font_mod-font_manager.lst FSFILES += fs-font_mod-font_manager.lst +PARTMAPFILES += partmap-font_mod-font_manager.lst cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) @@ -2302,6 +2439,9 @@ cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gen fs-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) +partmap-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + font_mod_CFLAGS = $(COMMON_CFLAGS) font_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2344,9 +2484,10 @@ search_mod-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -MD -c -o $@ $< -include search_mod-commands_search.d -CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.lst +CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.lst partmap-search_mod-commands_search.lst COMMANDFILES += cmd-search_mod-commands_search.lst FSFILES += fs-search_mod-commands_search.lst +PARTMAPFILES += partmap-search_mod-commands_search.lst cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) @@ -2354,6 +2495,9 @@ cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPEND fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) +partmap-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) + search_mod_CFLAGS = $(COMMON_CFLAGS) search_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2396,9 +2540,10 @@ test_mod-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -MD -c -o $@ $< -include test_mod-commands_test.d -CLEANFILES += cmd-test_mod-commands_test.lst fs-test_mod-commands_test.lst +CLEANFILES += cmd-test_mod-commands_test.lst fs-test_mod-commands_test.lst partmap-test_mod-commands_test.lst COMMANDFILES += cmd-test_mod-commands_test.lst FSFILES += fs-test_mod-commands_test.lst +PARTMAPFILES += partmap-test_mod-commands_test.lst cmd-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1) @@ -2406,6 +2551,9 @@ cmd-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) fs-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1) +partmap-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh test > $@ || (rm -f $@; exit 1) + test_mod_CFLAGS = $(COMMON_CFLAGS) test_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2448,9 +2596,10 @@ loopback_mod-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -MD -c -o $@ $< -include loopback_mod-disk_loopback.d -CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.lst +CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.lst partmap-loopback_mod-disk_loopback.lst COMMANDFILES += cmd-loopback_mod-disk_loopback.lst FSFILES += fs-loopback_mod-disk_loopback.lst +PARTMAPFILES += partmap-loopback_mod-disk_loopback.lst cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) @@ -2458,6 +2607,9 @@ cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCI fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) +partmap-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) + loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2500,9 +2652,10 @@ configfile_mod-commands_configfile.o: commands/configfile.c $(commands/configfil $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -MD -c -o $@ $< -include configfile_mod-commands_configfile.d -CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-commands_configfile.lst +CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-commands_configfile.lst partmap-configfile_mod-commands_configfile.lst COMMANDFILES += cmd-configfile_mod-commands_configfile.lst FSFILES += fs-configfile_mod-commands_configfile.lst +PARTMAPFILES += partmap-configfile_mod-commands_configfile.lst cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) @@ -2510,6 +2663,9 @@ cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/con fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) +partmap-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) + configfile_mod_CFLAGS = $(COMMON_CFLAGS) configfile_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2552,9 +2708,10 @@ terminfo_mod-term_terminfo.o: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -MD -c -o $@ $< -include terminfo_mod-term_terminfo.d -CLEANFILES += cmd-terminfo_mod-term_terminfo.lst fs-terminfo_mod-term_terminfo.lst +CLEANFILES += cmd-terminfo_mod-term_terminfo.lst fs-terminfo_mod-term_terminfo.lst partmap-terminfo_mod-term_terminfo.lst COMMANDFILES += cmd-terminfo_mod-term_terminfo.lst FSFILES += fs-terminfo_mod-term_terminfo.lst +PARTMAPFILES += partmap-terminfo_mod-term_terminfo.lst cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) @@ -2562,14 +2719,18 @@ cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCI fs-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) +partmap-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) + terminfo_mod-term_tparm.o: term/tparm.c $(term/tparm.c_DEPENDENCIES) $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -MD -c -o $@ $< -include terminfo_mod-term_tparm.d -CLEANFILES += cmd-terminfo_mod-term_tparm.lst fs-terminfo_mod-term_tparm.lst +CLEANFILES += cmd-terminfo_mod-term_tparm.lst fs-terminfo_mod-term_tparm.lst partmap-terminfo_mod-term_tparm.lst COMMANDFILES += cmd-terminfo_mod-term_tparm.lst FSFILES += fs-terminfo_mod-term_tparm.lst +PARTMAPFILES += partmap-terminfo_mod-term_tparm.lst cmd-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) @@ -2577,6 +2738,9 @@ cmd-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) gencm fs-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) +partmap-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) + terminfo_mod_CFLAGS = $(COMMON_CFLAGS) terminfo_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2619,9 +2783,10 @@ blocklist_mod-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_ $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -MD -c -o $@ $< -include blocklist_mod-commands_blocklist.d -CLEANFILES += cmd-blocklist_mod-commands_blocklist.lst fs-blocklist_mod-commands_blocklist.lst +CLEANFILES += cmd-blocklist_mod-commands_blocklist.lst fs-blocklist_mod-commands_blocklist.lst partmap-blocklist_mod-commands_blocklist.lst COMMANDFILES += cmd-blocklist_mod-commands_blocklist.lst FSFILES += fs-blocklist_mod-commands_blocklist.lst +PARTMAPFILES += partmap-blocklist_mod-commands_blocklist.lst cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1) @@ -2629,6 +2794,9 @@ cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blockl fs-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1) +partmap-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh blocklist > $@ || (rm -f $@; exit 1) + blocklist_mod_CFLAGS = $(COMMON_CFLAGS) blocklist_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2671,9 +2839,10 @@ hexdump_mod-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDEN $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -MD -c -o $@ $< -include hexdump_mod-commands_hexdump.d -CLEANFILES += cmd-hexdump_mod-commands_hexdump.lst fs-hexdump_mod-commands_hexdump.lst +CLEANFILES += cmd-hexdump_mod-commands_hexdump.lst fs-hexdump_mod-commands_hexdump.lst partmap-hexdump_mod-commands_hexdump.lst COMMANDFILES += cmd-hexdump_mod-commands_hexdump.lst FSFILES += fs-hexdump_mod-commands_hexdump.lst +PARTMAPFILES += partmap-hexdump_mod-commands_hexdump.lst cmd-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) @@ -2681,6 +2850,9 @@ cmd-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DE fs-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) +partmap-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) + hexdump_mod_CFLAGS = $(COMMON_CFLAGS) hexdump_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2726,9 +2898,10 @@ elf_mod-kern_elf.o: kern/elf.c $(kern/elf.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -MD -c -o $@ $< -include elf_mod-kern_elf.d -CLEANFILES += cmd-elf_mod-kern_elf.lst fs-elf_mod-kern_elf.lst +CLEANFILES += cmd-elf_mod-kern_elf.lst fs-elf_mod-kern_elf.lst partmap-elf_mod-kern_elf.lst COMMANDFILES += cmd-elf_mod-kern_elf.lst FSFILES += fs-elf_mod-kern_elf.lst +PARTMAPFILES += partmap-elf_mod-kern_elf.lst cmd-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh elf > $@ || (rm -f $@; exit 1) @@ -2736,6 +2909,9 @@ cmd-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) gencmdlist.sh fs-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh elf > $@ || (rm -f $@; exit 1) +partmap-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh elf > $@ || (rm -f $@; exit 1) + elf_mod_CFLAGS = $(COMMON_CFLAGS) elf_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2778,9 +2954,10 @@ gzio_mod-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -MD -c -o $@ $< -include gzio_mod-io_gzio.d -CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst +CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst partmap-gzio_mod-io_gzio.lst COMMANDFILES += cmd-gzio_mod-io_gzio.lst FSFILES += fs-gzio_mod-io_gzio.lst +PARTMAPFILES += partmap-gzio_mod-io_gzio.lst cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) @@ -2788,6 +2965,9 @@ cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) +partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) + gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2830,9 +3010,10 @@ read_mod-commands_read.o: commands/read.c $(commands/read.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -MD -c -o $@ $< -include read_mod-commands_read.d -CLEANFILES += cmd-read_mod-commands_read.lst fs-read_mod-commands_read.lst +CLEANFILES += cmd-read_mod-commands_read.lst fs-read_mod-commands_read.lst partmap-read_mod-commands_read.lst COMMANDFILES += cmd-read_mod-commands_read.lst FSFILES += fs-read_mod-commands_read.lst +PARTMAPFILES += partmap-read_mod-commands_read.lst cmd-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh read > $@ || (rm -f $@; exit 1) @@ -2840,6 +3021,9 @@ cmd-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh read > $@ || (rm -f $@; exit 1) +partmap-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh read > $@ || (rm -f $@; exit 1) + read_mod_CFLAGS = $(COMMON_CFLAGS) read_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2882,9 +3066,10 @@ sleep_mod-commands_sleep.o: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -MD -c -o $@ $< -include sleep_mod-commands_sleep.d -CLEANFILES += cmd-sleep_mod-commands_sleep.lst fs-sleep_mod-commands_sleep.lst +CLEANFILES += cmd-sleep_mod-commands_sleep.lst fs-sleep_mod-commands_sleep.lst partmap-sleep_mod-commands_sleep.lst COMMANDFILES += cmd-sleep_mod-commands_sleep.lst FSFILES += fs-sleep_mod-commands_sleep.lst +PARTMAPFILES += partmap-sleep_mod-commands_sleep.lst cmd-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sleep > $@ || (rm -f $@; exit 1) @@ -2892,6 +3077,9 @@ cmd-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCI fs-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sleep > $@ || (rm -f $@; exit 1) +partmap-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sleep > $@ || (rm -f $@; exit 1) + sleep_mod_CFLAGS = $(COMMON_CFLAGS) sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 10cd760b8..7343672b0 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -165,9 +165,10 @@ kernel_mod-kern_i386_efi_startup.o: kern/i386/efi/startup.S $(kern/i386/efi/star $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_efi_startup.d -CLEANFILES += cmd-kernel_mod-kern_i386_efi_startup.lst fs-kernel_mod-kern_i386_efi_startup.lst +CLEANFILES += cmd-kernel_mod-kern_i386_efi_startup.lst fs-kernel_mod-kern_i386_efi_startup.lst partmap-kernel_mod-kern_i386_efi_startup.lst COMMANDFILES += cmd-kernel_mod-kern_i386_efi_startup.lst FSFILES += fs-kernel_mod-kern_i386_efi_startup.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_startup.lst cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -175,14 +176,18 @@ cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/ef fs-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_main.d -CLEANFILES += cmd-kernel_mod-kern_main.lst fs-kernel_mod-kern_main.lst +CLEANFILES += cmd-kernel_mod-kern_main.lst fs-kernel_mod-kern_main.lst partmap-kernel_mod-kern_main.lst COMMANDFILES += cmd-kernel_mod-kern_main.lst FSFILES += fs-kernel_mod-kern_main.lst +PARTMAPFILES += partmap-kernel_mod-kern_main.lst cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -190,14 +195,18 @@ cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist fs-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_device.d -CLEANFILES += cmd-kernel_mod-kern_device.lst fs-kernel_mod-kern_device.lst +CLEANFILES += cmd-kernel_mod-kern_device.lst fs-kernel_mod-kern_device.lst partmap-kernel_mod-kern_device.lst COMMANDFILES += cmd-kernel_mod-kern_device.lst FSFILES += fs-kernel_mod-kern_device.lst +PARTMAPFILES += partmap-kernel_mod-kern_device.lst cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -205,14 +214,18 @@ cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genc fs-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_disk.d -CLEANFILES += cmd-kernel_mod-kern_disk.lst fs-kernel_mod-kern_disk.lst +CLEANFILES += cmd-kernel_mod-kern_disk.lst fs-kernel_mod-kern_disk.lst partmap-kernel_mod-kern_disk.lst COMMANDFILES += cmd-kernel_mod-kern_disk.lst FSFILES += fs-kernel_mod-kern_disk.lst +PARTMAPFILES += partmap-kernel_mod-kern_disk.lst cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -220,14 +233,18 @@ cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist fs-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_dl.d -CLEANFILES += cmd-kernel_mod-kern_dl.lst fs-kernel_mod-kern_dl.lst +CLEANFILES += cmd-kernel_mod-kern_dl.lst fs-kernel_mod-kern_dl.lst partmap-kernel_mod-kern_dl.lst COMMANDFILES += cmd-kernel_mod-kern_dl.lst FSFILES += fs-kernel_mod-kern_dl.lst +PARTMAPFILES += partmap-kernel_mod-kern_dl.lst cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -235,14 +252,18 @@ cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh fs-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_file.d -CLEANFILES += cmd-kernel_mod-kern_file.lst fs-kernel_mod-kern_file.lst +CLEANFILES += cmd-kernel_mod-kern_file.lst fs-kernel_mod-kern_file.lst partmap-kernel_mod-kern_file.lst COMMANDFILES += cmd-kernel_mod-kern_file.lst FSFILES += fs-kernel_mod-kern_file.lst +PARTMAPFILES += partmap-kernel_mod-kern_file.lst cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -250,14 +271,18 @@ cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist fs-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_fs.d -CLEANFILES += cmd-kernel_mod-kern_fs.lst fs-kernel_mod-kern_fs.lst +CLEANFILES += cmd-kernel_mod-kern_fs.lst fs-kernel_mod-kern_fs.lst partmap-kernel_mod-kern_fs.lst COMMANDFILES += cmd-kernel_mod-kern_fs.lst FSFILES += fs-kernel_mod-kern_fs.lst +PARTMAPFILES += partmap-kernel_mod-kern_fs.lst cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -265,14 +290,18 @@ cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh fs-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_err.d -CLEANFILES += cmd-kernel_mod-kern_err.lst fs-kernel_mod-kern_err.lst +CLEANFILES += cmd-kernel_mod-kern_err.lst fs-kernel_mod-kern_err.lst partmap-kernel_mod-kern_err.lst COMMANDFILES += cmd-kernel_mod-kern_err.lst FSFILES += fs-kernel_mod-kern_err.lst +PARTMAPFILES += partmap-kernel_mod-kern_err.lst cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -280,14 +309,18 @@ cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh fs-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_misc.d -CLEANFILES += cmd-kernel_mod-kern_misc.lst fs-kernel_mod-kern_misc.lst +CLEANFILES += cmd-kernel_mod-kern_misc.lst fs-kernel_mod-kern_misc.lst partmap-kernel_mod-kern_misc.lst COMMANDFILES += cmd-kernel_mod-kern_misc.lst FSFILES += fs-kernel_mod-kern_misc.lst +PARTMAPFILES += partmap-kernel_mod-kern_misc.lst cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -295,14 +328,18 @@ cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist fs-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_mm.d -CLEANFILES += cmd-kernel_mod-kern_mm.lst fs-kernel_mod-kern_mm.lst +CLEANFILES += cmd-kernel_mod-kern_mm.lst fs-kernel_mod-kern_mm.lst partmap-kernel_mod-kern_mm.lst COMMANDFILES += cmd-kernel_mod-kern_mm.lst FSFILES += fs-kernel_mod-kern_mm.lst +PARTMAPFILES += partmap-kernel_mod-kern_mm.lst cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -310,14 +347,18 @@ cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh fs-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_loader.d -CLEANFILES += cmd-kernel_mod-kern_loader.lst fs-kernel_mod-kern_loader.lst +CLEANFILES += cmd-kernel_mod-kern_loader.lst fs-kernel_mod-kern_loader.lst partmap-kernel_mod-kern_loader.lst COMMANDFILES += cmd-kernel_mod-kern_loader.lst FSFILES += fs-kernel_mod-kern_loader.lst +PARTMAPFILES += partmap-kernel_mod-kern_loader.lst cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -325,14 +366,18 @@ cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genc fs-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_rescue.d -CLEANFILES += cmd-kernel_mod-kern_rescue.lst fs-kernel_mod-kern_rescue.lst +CLEANFILES += cmd-kernel_mod-kern_rescue.lst fs-kernel_mod-kern_rescue.lst partmap-kernel_mod-kern_rescue.lst COMMANDFILES += cmd-kernel_mod-kern_rescue.lst FSFILES += fs-kernel_mod-kern_rescue.lst +PARTMAPFILES += partmap-kernel_mod-kern_rescue.lst cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -340,14 +385,18 @@ cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genc fs-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_term.d -CLEANFILES += cmd-kernel_mod-kern_term.lst fs-kernel_mod-kern_term.lst +CLEANFILES += cmd-kernel_mod-kern_term.lst fs-kernel_mod-kern_term.lst partmap-kernel_mod-kern_term.lst COMMANDFILES += cmd-kernel_mod-kern_term.lst FSFILES += fs-kernel_mod-kern_term.lst +PARTMAPFILES += partmap-kernel_mod-kern_term.lst cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -355,14 +404,18 @@ cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist fs-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_dl.d -CLEANFILES += cmd-kernel_mod-kern_i386_dl.lst fs-kernel_mod-kern_i386_dl.lst +CLEANFILES += cmd-kernel_mod-kern_i386_dl.lst fs-kernel_mod-kern_i386_dl.lst partmap-kernel_mod-kern_i386_dl.lst COMMANDFILES += cmd-kernel_mod-kern_i386_dl.lst FSFILES += fs-kernel_mod-kern_i386_dl.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_dl.lst cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -370,14 +423,18 @@ cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) g fs-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_efi_init.d -CLEANFILES += cmd-kernel_mod-kern_i386_efi_init.lst fs-kernel_mod-kern_i386_efi_init.lst +CLEANFILES += cmd-kernel_mod-kern_i386_efi_init.lst fs-kernel_mod-kern_i386_efi_init.lst partmap-kernel_mod-kern_i386_efi_init.lst COMMANDFILES += cmd-kernel_mod-kern_i386_efi_init.lst FSFILES += fs-kernel_mod-kern_i386_efi_init.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_init.lst cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -385,14 +442,18 @@ cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_parser.d -CLEANFILES += cmd-kernel_mod-kern_parser.lst fs-kernel_mod-kern_parser.lst +CLEANFILES += cmd-kernel_mod-kern_parser.lst fs-kernel_mod-kern_parser.lst partmap-kernel_mod-kern_parser.lst COMMANDFILES += cmd-kernel_mod-kern_parser.lst FSFILES += fs-kernel_mod-kern_parser.lst +PARTMAPFILES += partmap-kernel_mod-kern_parser.lst cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -400,14 +461,18 @@ cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genc fs-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_partition.d -CLEANFILES += cmd-kernel_mod-kern_partition.lst fs-kernel_mod-kern_partition.lst +CLEANFILES += cmd-kernel_mod-kern_partition.lst fs-kernel_mod-kern_partition.lst partmap-kernel_mod-kern_partition.lst COMMANDFILES += cmd-kernel_mod-kern_partition.lst FSFILES += fs-kernel_mod-kern_partition.lst +PARTMAPFILES += partmap-kernel_mod-kern_partition.lst cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -415,14 +480,18 @@ cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENC fs-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_env.d -CLEANFILES += cmd-kernel_mod-kern_env.lst fs-kernel_mod-kern_env.lst +CLEANFILES += cmd-kernel_mod-kern_env.lst fs-kernel_mod-kern_env.lst partmap-kernel_mod-kern_env.lst COMMANDFILES += cmd-kernel_mod-kern_env.lst FSFILES += fs-kernel_mod-kern_env.lst +PARTMAPFILES += partmap-kernel_mod-kern_env.lst cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -430,14 +499,18 @@ cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh fs-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-symlist.d -CLEANFILES += cmd-kernel_mod-symlist.lst fs-kernel_mod-symlist.lst +CLEANFILES += cmd-kernel_mod-symlist.lst fs-kernel_mod-symlist.lst partmap-kernel_mod-symlist.lst COMMANDFILES += cmd-kernel_mod-symlist.lst FSFILES += fs-kernel_mod-symlist.lst +PARTMAPFILES += partmap-kernel_mod-symlist.lst cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -445,14 +518,18 @@ cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh fs-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_efi_efi.o: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_efi_efi.d -CLEANFILES += cmd-kernel_mod-kern_efi_efi.lst fs-kernel_mod-kern_efi_efi.lst +CLEANFILES += cmd-kernel_mod-kern_efi_efi.lst fs-kernel_mod-kern_efi_efi.lst partmap-kernel_mod-kern_efi_efi.lst COMMANDFILES += cmd-kernel_mod-kern_efi_efi.lst FSFILES += fs-kernel_mod-kern_efi_efi.lst +PARTMAPFILES += partmap-kernel_mod-kern_efi_efi.lst cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -460,14 +537,18 @@ cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) g fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_efi_init.o: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_efi_init.d -CLEANFILES += cmd-kernel_mod-kern_efi_init.lst fs-kernel_mod-kern_efi_init.lst +CLEANFILES += cmd-kernel_mod-kern_efi_init.lst fs-kernel_mod-kern_efi_init.lst partmap-kernel_mod-kern_efi_init.lst COMMANDFILES += cmd-kernel_mod-kern_efi_init.lst FSFILES += fs-kernel_mod-kern_efi_init.lst +PARTMAPFILES += partmap-kernel_mod-kern_efi_init.lst cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -475,14 +556,18 @@ cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-kern_efi_mm.o: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_efi_mm.d -CLEANFILES += cmd-kernel_mod-kern_efi_mm.lst fs-kernel_mod-kern_efi_mm.lst +CLEANFILES += cmd-kernel_mod-kern_efi_mm.lst fs-kernel_mod-kern_efi_mm.lst partmap-kernel_mod-kern_efi_mm.lst COMMANDFILES += cmd-kernel_mod-kern_efi_mm.lst FSFILES += fs-kernel_mod-kern_efi_mm.lst +PARTMAPFILES += partmap-kernel_mod-kern_efi_mm.lst cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -490,14 +575,18 @@ cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genc fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-term_efi_console.d -CLEANFILES += cmd-kernel_mod-term_efi_console.lst fs-kernel_mod-term_efi_console.lst +CLEANFILES += cmd-kernel_mod-term_efi_console.lst fs-kernel_mod-term_efi_console.lst partmap-kernel_mod-term_efi_console.lst COMMANDFILES += cmd-kernel_mod-term_efi_console.lst FSFILES += fs-kernel_mod-term_efi_console.lst +PARTMAPFILES += partmap-kernel_mod-term_efi_console.lst cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -505,14 +594,18 @@ cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEP fs-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-disk_efi_efidisk.d -CLEANFILES += cmd-kernel_mod-disk_efi_efidisk.lst fs-kernel_mod-disk_efi_efidisk.lst +CLEANFILES += cmd-kernel_mod-disk_efi_efidisk.lst fs-kernel_mod-disk_efi_efidisk.lst partmap-kernel_mod-disk_efi_efidisk.lst COMMANDFILES += cmd-kernel_mod-disk_efi_efidisk.lst FSFILES += fs-kernel_mod-disk_efi_efidisk.lst +PARTMAPFILES += partmap-kernel_mod-disk_efi_efidisk.lst cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) @@ -520,6 +613,9 @@ cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEP fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) +partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ @@ -581,9 +677,10 @@ normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst +CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst +PARTMAPFILES += partmap-normal_mod-normal_arg.lst cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -591,14 +688,18 @@ cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdl fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst +CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst +PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -606,14 +707,18 @@ cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENC fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst +CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst +PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -621,14 +726,18 @@ cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENC fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst +CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst +PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -636,14 +745,18 @@ cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_ fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst +CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst +PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -651,14 +764,18 @@ cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENC fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst +CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst +PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -666,14 +783,18 @@ cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPEND fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst +CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst +PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -681,14 +802,18 @@ cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) g fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst +CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst +PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -696,14 +821,18 @@ cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genc fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst +CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst +PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -711,14 +840,18 @@ cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genc fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst +CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -726,14 +859,18 @@ cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_ fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst +CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst +PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -741,14 +878,18 @@ cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genc fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -756,14 +897,18 @@ cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPEND fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst +CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst +PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -771,14 +916,18 @@ cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst +CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst +PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -786,14 +935,18 @@ cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -801,6 +954,9 @@ cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) g fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) @@ -844,9 +1000,10 @@ _chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chain $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< -include _chain_mod-loader_efi_chainloader.d -CLEANFILES += cmd-_chain_mod-loader_efi_chainloader.lst fs-_chain_mod-loader_efi_chainloader.lst +CLEANFILES += cmd-_chain_mod-loader_efi_chainloader.lst fs-_chain_mod-loader_efi_chainloader.lst partmap-_chain_mod-loader_efi_chainloader.lst COMMANDFILES += cmd-_chain_mod-loader_efi_chainloader.lst FSFILES += fs-_chain_mod-loader_efi_chainloader.lst +PARTMAPFILES += partmap-_chain_mod-loader_efi_chainloader.lst cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) @@ -854,6 +1011,9 @@ cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) +partmap-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _chain > $@ || (rm -f $@; exit 1) + _chain_mod_CFLAGS = $(COMMON_CFLAGS) _chain_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -896,9 +1056,10 @@ chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c $(loa $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< -include chain_mod-loader_efi_chainloader_normal.d -CLEANFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst fs-chain_mod-loader_efi_chainloader_normal.lst +CLEANFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst fs-chain_mod-loader_efi_chainloader_normal.lst partmap-chain_mod-loader_efi_chainloader_normal.lst COMMANDFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst FSFILES += fs-chain_mod-loader_efi_chainloader_normal.lst +PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader_normal.lst cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) @@ -906,6 +1067,9 @@ cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) +partmap-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) + chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -948,9 +1112,10 @@ _linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/li $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_i386_efi_linux.d -CLEANFILES += cmd-_linux_mod-loader_i386_efi_linux.lst fs-_linux_mod-loader_i386_efi_linux.lst +CLEANFILES += cmd-_linux_mod-loader_i386_efi_linux.lst fs-_linux_mod-loader_i386_efi_linux.lst partmap-_linux_mod-loader_i386_efi_linux.lst COMMANDFILES += cmd-_linux_mod-loader_i386_efi_linux.lst FSFILES += fs-_linux_mod-loader_i386_efi_linux.lst +PARTMAPFILES += partmap-_linux_mod-loader_i386_efi_linux.lst cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) @@ -958,6 +1123,9 @@ cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/ fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) +partmap-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) + _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1000,9 +1168,10 @@ linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c $(loade $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_i386_efi_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst fs-linux_mod-loader_i386_efi_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst fs-linux_mod-loader_i386_efi_linux_normal.lst partmap-linux_mod-loader_i386_efi_linux_normal.lst COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst FSFILES += fs-linux_mod-loader_i386_efi_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux_normal.lst cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) @@ -1010,6 +1179,9 @@ cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $ fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1052,9 +1224,10 @@ cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_D $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst +CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst +PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) @@ -1062,6 +1235,9 @@ cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpu fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) +partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1104,9 +1280,10 @@ halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_halt.d -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst COMMANDFILES += cmd-halt_mod-commands_halt.lst FSFILES += fs-halt_mod-commands_halt.lst +PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) @@ -1114,6 +1291,9 @@ cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1156,9 +1336,10 @@ reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst COMMANDFILES += cmd-reboot_mod-commands_reboot.lst FSFILES += fs-reboot_mod-commands_reboot.lst +PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1166,6 +1347,9 @@ cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPEND fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 772f38c32..fbac507f7 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -617,9 +617,10 @@ normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst +CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst +PARTMAPFILES += partmap-normal_mod-normal_arg.lst cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -627,14 +628,18 @@ cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdl fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst +CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst +PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -642,14 +647,18 @@ cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENC fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst +CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst +PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -657,14 +666,18 @@ cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENC fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst +CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst +PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -672,14 +685,18 @@ cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_ fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst +CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst +PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -687,14 +704,18 @@ cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENC fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst +CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst +PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -702,14 +723,18 @@ cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPEND fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst +CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst +PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -717,14 +742,18 @@ cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) g fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst +CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst +PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -732,14 +761,18 @@ cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genc fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst +CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst +PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -747,14 +780,18 @@ cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genc fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst +CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -762,14 +799,18 @@ cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_ fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst +CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst +PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -777,14 +818,18 @@ cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genc fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -792,14 +837,18 @@ cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPEND fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst +CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst +PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -807,14 +856,18 @@ cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst +CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst +PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -822,14 +875,18 @@ cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -837,6 +894,9 @@ cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) g fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) @@ -882,9 +942,10 @@ _multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(load $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_ieee1275_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_ieee1275_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -892,14 +953,18 @@ cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c fs-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -907,14 +972,18 @@ cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -922,6 +991,9 @@ cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(load fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -964,9 +1036,10 @@ multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -974,6 +1047,9 @@ cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_no fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) +partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1016,9 +1092,10 @@ aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< -include aout_mod-loader_aout.d -CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst +CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst partmap-aout_mod-loader_aout.lst COMMANDFILES += cmd-aout_mod-loader_aout.lst FSFILES += fs-aout_mod-loader_aout.lst +PARTMAPFILES += partmap-aout_mod-loader_aout.lst cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) @@ -1026,6 +1103,9 @@ cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmd fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) +partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) + aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1068,9 +1148,10 @@ suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< -include suspend_mod-commands_ieee1275_suspend.d -CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst +CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst partmap-suspend_mod-commands_ieee1275_suspend.lst COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst +PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) @@ -1078,6 +1159,9 @@ cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(com fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) +partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) + suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1120,9 +1204,10 @@ reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst COMMANDFILES += cmd-reboot_mod-commands_reboot.lst FSFILES += fs-reboot_mod-commands_reboot.lst +PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1130,6 +1215,9 @@ cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPEND fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1172,9 +1260,10 @@ halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_halt.d -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst COMMANDFILES += cmd-halt_mod-commands_halt.lst FSFILES += fs-halt_mod-commands_halt.lst +PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) @@ -1182,6 +1271,9 @@ cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1224,9 +1316,10 @@ cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_D $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst +CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst +PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) @@ -1234,6 +1327,9 @@ cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpu fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) +partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1276,9 +1372,10 @@ serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_ $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< -include serial_mod-term_i386_pc_serial.d -CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst +CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst partmap-serial_mod-term_i386_pc_serial.lst COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst FSFILES += fs-serial_mod-term_i386_pc_serial.lst +PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) @@ -1286,6 +1383,9 @@ cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/ser fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) +partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) + serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 210a2750b..4bae9c617 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -592,9 +592,10 @@ _linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_i386_pc_linux.d -CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_pc_linux.lst +CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_pc_linux.lst partmap-_linux_mod-loader_i386_pc_linux.lst COMMANDFILES += cmd-_linux_mod-loader_i386_pc_linux.lst FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst +PARTMAPFILES += partmap-_linux_mod-loader_i386_pc_linux.lst cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) @@ -602,6 +603,9 @@ cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) +partmap-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) + _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -644,9 +648,10 @@ linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c $(loader/ $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_i386_pc_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_i386_pc_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_i386_pc_linux_normal.lst partmap-linux_mod-loader_i386_pc_linux_normal.lst COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_pc_linux_normal.lst cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) @@ -654,6 +659,9 @@ cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(l fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -700,9 +708,10 @@ normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst +CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst +PARTMAPFILES += partmap-normal_mod-normal_arg.lst cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -710,14 +719,18 @@ cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdl fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst +CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst +PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -725,14 +738,18 @@ cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENC fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst +CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst +PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -740,14 +757,18 @@ cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENC fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst +CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst +PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -755,14 +776,18 @@ cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_ fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst +CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst +PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -770,14 +795,18 @@ cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENC fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst +CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst +PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -785,14 +814,18 @@ cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPEND fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst +CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst +PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -800,14 +833,18 @@ cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) g fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst +CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst +PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -815,14 +852,18 @@ cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genc fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst +CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst +PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -830,14 +871,18 @@ cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genc fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst +CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -845,14 +890,18 @@ cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_ fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst +CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst +PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -860,14 +909,18 @@ cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genc fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -875,14 +928,18 @@ cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPEND fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst +CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst +PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -890,14 +947,18 @@ cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst +CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst +PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -905,14 +966,18 @@ cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -920,6 +985,9 @@ cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) g fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) @@ -963,9 +1031,10 @@ serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_ $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< -include serial_mod-term_i386_pc_serial.d -CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst +CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst partmap-serial_mod-term_i386_pc_serial.lst COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst FSFILES += fs-serial_mod-term_i386_pc_serial.lst +PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) @@ -973,6 +1042,9 @@ cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/ser fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) +partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) + serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1018,9 +1090,10 @@ _multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c $(loader/i $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot.d -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod-loader_i386_pc_multiboot.lst +CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod-loader_i386_pc_multiboot.lst partmap-_multiboot_mod-loader_i386_pc_multiboot.lst COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot.lst cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1028,14 +1101,18 @@ cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(lo fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod-loader_i386_pc_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod-loader_i386_pc_multiboot2.lst partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1043,14 +1120,18 @@ cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $( fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1058,14 +1139,18 @@ cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1073,6 +1158,9 @@ cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(load fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1115,9 +1203,10 @@ multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -1125,6 +1214,9 @@ cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_no fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) +partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1167,9 +1259,10 @@ aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< -include aout_mod-loader_aout.d -CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst +CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst partmap-aout_mod-loader_aout.lst COMMANDFILES += cmd-aout_mod-loader_aout.lst FSFILES += fs-aout_mod-loader_aout.lst +PARTMAPFILES += partmap-aout_mod-loader_aout.lst cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) @@ -1177,6 +1270,9 @@ cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmd fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) +partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) + aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1219,9 +1315,10 @@ play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c $(commands/i386/pc/pla $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -MD -c -o $@ $< -include play_mod-commands_i386_pc_play.d -CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_pc_play.lst +CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_pc_play.lst partmap-play_mod-commands_i386_pc_play.lst COMMANDFILES += cmd-play_mod-commands_i386_pc_play.lst FSFILES += fs-play_mod-commands_i386_pc_play.lst +PARTMAPFILES += partmap-play_mod-commands_i386_pc_play.lst cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) @@ -1229,6 +1326,9 @@ cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/ fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) +partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) + play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1271,9 +1371,10 @@ cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_D $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst +CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst +PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) @@ -1281,6 +1382,9 @@ cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpu fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) +partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1323,9 +1427,10 @@ ata_mod-disk_ata.o: disk/ata.c $(disk/ata.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $< -include ata_mod-disk_ata.d -CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst +CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst partmap-ata_mod-disk_ata.lst COMMANDFILES += cmd-ata_mod-disk_ata.lst FSFILES += fs-ata_mod-disk_ata.lst +PARTMAPFILES += partmap-ata_mod-disk_ata.lst cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) @@ -1333,6 +1438,9 @@ cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) +partmap-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) + ata_mod_CFLAGS = $(COMMON_CFLAGS) ata_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index d06338157..b0153a4ad 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -885,9 +885,10 @@ biosdisk_mod-disk_i386_pc_biosdisk.o: disk/i386/pc/biosdisk.c $(disk/i386/pc/bio $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -MD -c -o $@ $< -include biosdisk_mod-disk_i386_pc_biosdisk.d -CLEANFILES += cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst fs-biosdisk_mod-disk_i386_pc_biosdisk.lst +CLEANFILES += cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst fs-biosdisk_mod-disk_i386_pc_biosdisk.lst partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst COMMANDFILES += cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst FSFILES += fs-biosdisk_mod-disk_i386_pc_biosdisk.lst +PARTMAPFILES += partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh biosdisk > $@ || (rm -f $@; exit 1) @@ -895,6 +896,9 @@ cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/ fs-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh biosdisk > $@ || (rm -f $@; exit 1) +partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh biosdisk > $@ || (rm -f $@; exit 1) + biosdisk_mod_CFLAGS = $(COMMON_CFLAGS) biosdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -937,9 +941,10 @@ _chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c $(loader/i $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< -include _chain_mod-loader_i386_pc_chainloader.d -CLEANFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst fs-_chain_mod-loader_i386_pc_chainloader.lst +CLEANFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst fs-_chain_mod-loader_i386_pc_chainloader.lst partmap-_chain_mod-loader_i386_pc_chainloader.lst COMMANDFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst FSFILES += fs-_chain_mod-loader_i386_pc_chainloader.lst +PARTMAPFILES += partmap-_chain_mod-loader_i386_pc_chainloader.lst cmd-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) @@ -947,6 +952,9 @@ cmd-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(lo fs-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) +partmap-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _chain > $@ || (rm -f $@; exit 1) + _chain_mod_CFLAGS = $(COMMON_CFLAGS) _chain_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -989,9 +997,10 @@ chain_mod-loader_i386_pc_chainloader_normal.o: loader/i386/pc/chainloader_normal $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< -include chain_mod-loader_i386_pc_chainloader_normal.d -CLEANFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst fs-chain_mod-loader_i386_pc_chainloader_normal.lst +CLEANFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst fs-chain_mod-loader_i386_pc_chainloader_normal.lst partmap-chain_mod-loader_i386_pc_chainloader_normal.lst COMMANDFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst FSFILES += fs-chain_mod-loader_i386_pc_chainloader_normal.lst +PARTMAPFILES += partmap-chain_mod-loader_i386_pc_chainloader_normal.lst cmd-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) @@ -999,6 +1008,9 @@ cmd-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_ fs-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) +partmap-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) + chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1041,9 +1053,10 @@ _linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_i386_pc_linux.d -CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_pc_linux.lst +CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_pc_linux.lst partmap-_linux_mod-loader_i386_pc_linux.lst COMMANDFILES += cmd-_linux_mod-loader_i386_pc_linux.lst FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst +PARTMAPFILES += partmap-_linux_mod-loader_i386_pc_linux.lst cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) @@ -1051,6 +1064,9 @@ cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) +partmap-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) + _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1093,9 +1109,10 @@ linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c $(loader/ $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_i386_pc_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_i386_pc_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_i386_pc_linux_normal.lst partmap-linux_mod-loader_i386_pc_linux_normal.lst COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_pc_linux_normal.lst cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) @@ -1103,6 +1120,9 @@ cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(l fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1150,9 +1170,10 @@ normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst +CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst +PARTMAPFILES += partmap-normal_mod-normal_arg.lst cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1160,14 +1181,18 @@ cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdl fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst +CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst +PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1175,14 +1200,18 @@ cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENC fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst +CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst +PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1190,14 +1219,18 @@ cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENC fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst +CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst +PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1205,14 +1238,18 @@ cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_ fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst +CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst +PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1220,14 +1257,18 @@ cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENC fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst +CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst +PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1235,14 +1276,18 @@ cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPEND fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst +CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst +PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1250,14 +1295,18 @@ cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) g fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst +CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst +PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1265,14 +1314,18 @@ cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genc fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst +CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst +PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1280,14 +1333,18 @@ cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genc fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1295,14 +1352,18 @@ cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) g fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst +CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1310,14 +1371,18 @@ cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_ fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst +CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst +PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1325,14 +1390,18 @@ cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genc fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1340,14 +1409,18 @@ cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPEND fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst +CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst +PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1355,14 +1428,18 @@ cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_i386_setjmp.d -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst +CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst FSFILES += fs-normal_mod-normal_i386_setjmp.lst +PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -1370,6 +1447,9 @@ cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) @@ -1413,9 +1493,10 @@ reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst COMMANDFILES += cmd-reboot_mod-commands_reboot.lst FSFILES += fs-reboot_mod-commands_reboot.lst +PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1423,6 +1504,9 @@ cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPEND fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1465,9 +1549,10 @@ halt_mod-commands_i386_pc_halt.o: commands/i386/pc/halt.c $(commands/i386/pc/hal $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_i386_pc_halt.d -CLEANFILES += cmd-halt_mod-commands_i386_pc_halt.lst fs-halt_mod-commands_i386_pc_halt.lst +CLEANFILES += cmd-halt_mod-commands_i386_pc_halt.lst fs-halt_mod-commands_i386_pc_halt.lst partmap-halt_mod-commands_i386_pc_halt.lst COMMANDFILES += cmd-halt_mod-commands_i386_pc_halt.lst FSFILES += fs-halt_mod-commands_i386_pc_halt.lst +PARTMAPFILES += partmap-halt_mod-commands_i386_pc_halt.lst cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) @@ -1475,6 +1560,9 @@ cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/ fs-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +partmap-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1517,9 +1605,10 @@ serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_ $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< -include serial_mod-term_i386_pc_serial.d -CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst +CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst partmap-serial_mod-term_i386_pc_serial.lst COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst FSFILES += fs-serial_mod-term_i386_pc_serial.lst +PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) @@ -1527,6 +1616,9 @@ cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/ser fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) +partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) + serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1572,9 +1664,10 @@ _multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c $(loader/i $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot.d -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod-loader_i386_pc_multiboot.lst +CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod-loader_i386_pc_multiboot.lst partmap-_multiboot_mod-loader_i386_pc_multiboot.lst COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot.lst cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1582,14 +1675,18 @@ cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(lo fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_i386_pc_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod-loader_i386_pc_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod-loader_i386_pc_multiboot2.lst partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1597,14 +1694,18 @@ cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $( fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1612,14 +1713,18 @@ cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1627,6 +1732,9 @@ cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(load fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1669,9 +1777,10 @@ multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -1679,6 +1788,9 @@ cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_no fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) +partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1722,9 +1834,10 @@ vbe_mod-video_i386_pc_vbe.o: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENC $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbe.d -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbe.lst fs-vbe_mod-video_i386_pc_vbe.lst +CLEANFILES += cmd-vbe_mod-video_i386_pc_vbe.lst fs-vbe_mod-video_i386_pc_vbe.lst partmap-vbe_mod-video_i386_pc_vbe.lst COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbe.lst FSFILES += fs-vbe_mod-video_i386_pc_vbe.lst +PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbe.lst cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) @@ -1732,14 +1845,18 @@ cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEP fs-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) +partmap-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + vbe_mod-video_i386_pc_vbeblit.o: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbeblit.d -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst fs-vbe_mod-video_i386_pc_vbeblit.lst +CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst fs-vbe_mod-video_i386_pc_vbeblit.lst partmap-vbe_mod-video_i386_pc_vbeblit.lst COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst FSFILES += fs-vbe_mod-video_i386_pc_vbeblit.lst +PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbeblit.lst cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) @@ -1747,14 +1864,18 @@ cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/v fs-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) +partmap-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + vbe_mod-video_i386_pc_vbefill.o: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbefill.d -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst fs-vbe_mod-video_i386_pc_vbefill.lst +CLEANFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst fs-vbe_mod-video_i386_pc_vbefill.lst partmap-vbe_mod-video_i386_pc_vbefill.lst COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst FSFILES += fs-vbe_mod-video_i386_pc_vbefill.lst +PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbefill.lst cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) @@ -1762,14 +1883,18 @@ cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/v fs-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) +partmap-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + vbe_mod-video_i386_pc_vbeutil.o: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< -include vbe_mod-video_i386_pc_vbeutil.d -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeutil.lst fs-vbe_mod-video_i386_pc_vbeutil.lst +CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeutil.lst fs-vbe_mod-video_i386_pc_vbeutil.lst partmap-vbe_mod-video_i386_pc_vbeutil.lst COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeutil.lst FSFILES += fs-vbe_mod-video_i386_pc_vbeutil.lst +PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbeutil.lst cmd-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) @@ -1777,6 +1902,9 @@ cmd-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/v fs-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) +partmap-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + vbe_mod_CFLAGS = $(COMMON_CFLAGS) vbe_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1819,9 +1947,10 @@ vbeinfo_mod-commands_i386_pc_vbeinfo.o: commands/i386/pc/vbeinfo.c $(commands/i3 $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -MD -c -o $@ $< -include vbeinfo_mod-commands_i386_pc_vbeinfo.d -CLEANFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst +CLEANFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst COMMANDFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst FSFILES += fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst +PARTMAPFILES += partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1) @@ -1829,6 +1958,9 @@ cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(comma fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1) +partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbeinfo > $@ || (rm -f $@; exit 1) + vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS) vbeinfo_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1871,9 +2003,10 @@ vbetest_mod-commands_i386_pc_vbetest.o: commands/i386/pc/vbetest.c $(commands/i3 $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -MD -c -o $@ $< -include vbetest_mod-commands_i386_pc_vbetest.d -CLEANFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst fs-vbetest_mod-commands_i386_pc_vbetest.lst +CLEANFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst fs-vbetest_mod-commands_i386_pc_vbetest.lst partmap-vbetest_mod-commands_i386_pc_vbetest.lst COMMANDFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst FSFILES += fs-vbetest_mod-commands_i386_pc_vbetest.lst +PARTMAPFILES += partmap-vbetest_mod-commands_i386_pc_vbetest.lst cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1) @@ -1881,6 +2014,9 @@ cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(comma fs-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1) +partmap-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbetest > $@ || (rm -f $@; exit 1) + vbetest_mod_CFLAGS = $(COMMON_CFLAGS) vbetest_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1923,9 +2059,10 @@ play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c $(commands/i386/pc/pla $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -MD -c -o $@ $< -include play_mod-commands_i386_pc_play.d -CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_pc_play.lst +CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_pc_play.lst partmap-play_mod-commands_i386_pc_play.lst COMMANDFILES += cmd-play_mod-commands_i386_pc_play.lst FSFILES += fs-play_mod-commands_i386_pc_play.lst +PARTMAPFILES += partmap-play_mod-commands_i386_pc_play.lst cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) @@ -1933,6 +2070,9 @@ cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/ fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) +partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) + play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1975,9 +2115,10 @@ video_mod-video_video.o: video/video.c $(video/video.c_DEPENDENCIES) $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -MD -c -o $@ $< -include video_mod-video_video.d -CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst +CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst partmap-video_mod-video_video.lst COMMANDFILES += cmd-video_mod-video_video.lst FSFILES += fs-video_mod-video_video.lst +PARTMAPFILES += partmap-video_mod-video_video.lst cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) @@ -1985,6 +2126,9 @@ cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencm fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) +partmap-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) + video_mod_CFLAGS = $(COMMON_CFLAGS) video_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2027,9 +2171,10 @@ gfxterm_mod-term_gfxterm.o: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -MD -c -o $@ $< -include gfxterm_mod-term_gfxterm.d -CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst +CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst partmap-gfxterm_mod-term_gfxterm.lst COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst FSFILES += fs-gfxterm_mod-term_gfxterm.lst +PARTMAPFILES += partmap-gfxterm_mod-term_gfxterm.lst cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) @@ -2037,6 +2182,9 @@ cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) +partmap-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) + gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2079,9 +2227,10 @@ videotest_mod-commands_videotest.o: commands/videotest.c $(commands/videotest.c_ $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -MD -c -o $@ $< -include videotest_mod-commands_videotest.d -CLEANFILES += cmd-videotest_mod-commands_videotest.lst fs-videotest_mod-commands_videotest.lst +CLEANFILES += cmd-videotest_mod-commands_videotest.lst fs-videotest_mod-commands_videotest.lst partmap-videotest_mod-commands_videotest.lst COMMANDFILES += cmd-videotest_mod-commands_videotest.lst FSFILES += fs-videotest_mod-commands_videotest.lst +PARTMAPFILES += partmap-videotest_mod-commands_videotest.lst cmd-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1) @@ -2089,6 +2238,9 @@ cmd-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videot fs-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1) +partmap-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh videotest > $@ || (rm -f $@; exit 1) + videotest_mod_CFLAGS = $(COMMON_CFLAGS) videotest_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2131,9 +2283,10 @@ bitmap_mod-video_bitmap.o: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -MD -c -o $@ $< -include bitmap_mod-video_bitmap.d -CLEANFILES += cmd-bitmap_mod-video_bitmap.lst fs-bitmap_mod-video_bitmap.lst +CLEANFILES += cmd-bitmap_mod-video_bitmap.lst fs-bitmap_mod-video_bitmap.lst partmap-bitmap_mod-video_bitmap.lst COMMANDFILES += cmd-bitmap_mod-video_bitmap.lst FSFILES += fs-bitmap_mod-video_bitmap.lst +PARTMAPFILES += partmap-bitmap_mod-video_bitmap.lst cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bitmap > $@ || (rm -f $@; exit 1) @@ -2141,6 +2294,9 @@ cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) g fs-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bitmap > $@ || (rm -f $@; exit 1) +partmap-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bitmap > $@ || (rm -f $@; exit 1) + bitmap_mod_CFLAGS = $(COMMON_CFLAGS) bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2183,9 +2339,10 @@ tga_mod-video_readers_tga.o: video/readers/tga.c $(video/readers/tga.c_DEPENDENC $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -MD -c -o $@ $< -include tga_mod-video_readers_tga.d -CLEANFILES += cmd-tga_mod-video_readers_tga.lst fs-tga_mod-video_readers_tga.lst +CLEANFILES += cmd-tga_mod-video_readers_tga.lst fs-tga_mod-video_readers_tga.lst partmap-tga_mod-video_readers_tga.lst COMMANDFILES += cmd-tga_mod-video_readers_tga.lst FSFILES += fs-tga_mod-video_readers_tga.lst +PARTMAPFILES += partmap-tga_mod-video_readers_tga.lst cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tga > $@ || (rm -f $@; exit 1) @@ -2193,6 +2350,9 @@ cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEP fs-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tga > $@ || (rm -f $@; exit 1) +partmap-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tga > $@ || (rm -f $@; exit 1) + tga_mod_CFLAGS = $(COMMON_CFLAGS) tga_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2235,9 +2395,10 @@ cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_D $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< -include cpuid_mod-commands_i386_cpuid.d -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst +CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst +PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) @@ -2245,6 +2406,9 @@ cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpu fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) +partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2287,9 +2451,10 @@ ata_mod-disk_ata.o: disk/ata.c $(disk/ata.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $< -include ata_mod-disk_ata.d -CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst +CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst partmap-ata_mod-disk_ata.lst COMMANDFILES += cmd-ata_mod-disk_ata.lst FSFILES += fs-ata_mod-disk_ata.lst +PARTMAPFILES += partmap-ata_mod-disk_ata.lst cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) @@ -2297,6 +2462,9 @@ cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) +partmap-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) + ata_mod_CFLAGS = $(COMMON_CFLAGS) ata_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2339,9 +2507,10 @@ vga_mod-term_i386_pc_vga.o: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -MD -c -o $@ $< -include vga_mod-term_i386_pc_vga.d -CLEANFILES += cmd-vga_mod-term_i386_pc_vga.lst fs-vga_mod-term_i386_pc_vga.lst +CLEANFILES += cmd-vga_mod-term_i386_pc_vga.lst fs-vga_mod-term_i386_pc_vga.lst partmap-vga_mod-term_i386_pc_vga.lst COMMANDFILES += cmd-vga_mod-term_i386_pc_vga.lst FSFILES += fs-vga_mod-term_i386_pc_vga.lst +PARTMAPFILES += partmap-vga_mod-term_i386_pc_vga.lst cmd-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga > $@ || (rm -f $@; exit 1) @@ -2349,6 +2518,9 @@ cmd-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPEND fs-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga > $@ || (rm -f $@; exit 1) +partmap-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga > $@ || (rm -f $@; exit 1) + vga_mod_CFLAGS = $(COMMON_CFLAGS) vga_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2391,9 +2563,10 @@ memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< -include memdisk_mod-disk_memdisk.d -CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst +CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst FSFILES += fs-memdisk_mod-disk_memdisk.lst +PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) @@ -2401,6 +2574,9 @@ cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) +partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2443,9 +2619,10 @@ jpeg_mod-video_readers_jpeg.o: video/readers/jpeg.c $(video/readers/jpeg.c_DEPEN $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -MD -c -o $@ $< -include jpeg_mod-video_readers_jpeg.d -CLEANFILES += cmd-jpeg_mod-video_readers_jpeg.lst fs-jpeg_mod-video_readers_jpeg.lst +CLEANFILES += cmd-jpeg_mod-video_readers_jpeg.lst fs-jpeg_mod-video_readers_jpeg.lst partmap-jpeg_mod-video_readers_jpeg.lst COMMANDFILES += cmd-jpeg_mod-video_readers_jpeg.lst FSFILES += fs-jpeg_mod-video_readers_jpeg.lst +PARTMAPFILES += partmap-jpeg_mod-video_readers_jpeg.lst cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jpeg > $@ || (rm -f $@; exit 1) @@ -2453,6 +2630,9 @@ cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jpeg > $@ || (rm -f $@; exit 1) +partmap-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jpeg > $@ || (rm -f $@; exit 1) + jpeg_mod_CFLAGS = $(COMMON_CFLAGS) jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2495,9 +2675,10 @@ png_mod-video_readers_png.o: video/readers/png.c $(video/readers/png.c_DEPENDENC $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -MD -c -o $@ $< -include png_mod-video_readers_png.d -CLEANFILES += cmd-png_mod-video_readers_png.lst fs-png_mod-video_readers_png.lst +CLEANFILES += cmd-png_mod-video_readers_png.lst fs-png_mod-video_readers_png.lst partmap-png_mod-video_readers_png.lst COMMANDFILES += cmd-png_mod-video_readers_png.lst FSFILES += fs-png_mod-video_readers_png.lst +PARTMAPFILES += partmap-png_mod-video_readers_png.lst cmd-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) @@ -2505,6 +2686,9 @@ cmd-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEP fs-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) +partmap-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh png > $@ || (rm -f $@; exit 1) + png_mod_CFLAGS = $(COMMON_CFLAGS) png_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2547,9 +2731,10 @@ pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< -include pci_mod-bus_pci.d -CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst +CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst COMMANDFILES += cmd-pci_mod-bus_pci.lst FSFILES += fs-pci_mod-bus_pci.lst +PARTMAPFILES += partmap-pci_mod-bus_pci.lst cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) @@ -2557,6 +2742,9 @@ cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) +partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + pci_mod_CFLAGS = $(COMMON_CFLAGS) pci_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2599,9 +2787,10 @@ lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< -include lspci_mod-commands_lspci.d -CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst +CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst COMMANDFILES += cmd-lspci_mod-commands_lspci.lst FSFILES += fs-lspci_mod-commands_lspci.lst +PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) @@ -2609,6 +2798,9 @@ cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCI fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) +partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2651,9 +2843,10 @@ aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< -include aout_mod-loader_aout.d -CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst +CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst partmap-aout_mod-loader_aout.lst COMMANDFILES += cmd-aout_mod-loader_aout.lst FSFILES += fs-aout_mod-loader_aout.lst +PARTMAPFILES += partmap-aout_mod-loader_aout.lst cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) @@ -2661,6 +2854,9 @@ cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmd fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) +partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) + aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2703,9 +2899,10 @@ _bsd_mod-loader_i386_bsd.o: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -MD -c -o $@ $< -include _bsd_mod-loader_i386_bsd.d -CLEANFILES += cmd-_bsd_mod-loader_i386_bsd.lst fs-_bsd_mod-loader_i386_bsd.lst +CLEANFILES += cmd-_bsd_mod-loader_i386_bsd.lst fs-_bsd_mod-loader_i386_bsd.lst partmap-_bsd_mod-loader_i386_bsd.lst COMMANDFILES += cmd-_bsd_mod-loader_i386_bsd.lst FSFILES += fs-_bsd_mod-loader_i386_bsd.lst +PARTMAPFILES += partmap-_bsd_mod-loader_i386_bsd.lst cmd-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _bsd > $@ || (rm -f $@; exit 1) @@ -2713,6 +2910,9 @@ cmd-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDEN fs-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _bsd > $@ || (rm -f $@; exit 1) +partmap-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _bsd > $@ || (rm -f $@; exit 1) + _bsd_mod_CFLAGS = $(COMMON_CFLAGS) _bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2755,9 +2955,10 @@ bsd_mod-loader_i386_bsd_normal.o: loader/i386/bsd_normal.c $(loader/i386/bsd_nor $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -MD -c -o $@ $< -include bsd_mod-loader_i386_bsd_normal.d -CLEANFILES += cmd-bsd_mod-loader_i386_bsd_normal.lst fs-bsd_mod-loader_i386_bsd_normal.lst +CLEANFILES += cmd-bsd_mod-loader_i386_bsd_normal.lst fs-bsd_mod-loader_i386_bsd_normal.lst partmap-bsd_mod-loader_i386_bsd_normal.lst COMMANDFILES += cmd-bsd_mod-loader_i386_bsd_normal.lst FSFILES += fs-bsd_mod-loader_i386_bsd_normal.lst +PARTMAPFILES += partmap-bsd_mod-loader_i386_bsd_normal.lst cmd-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bsd > $@ || (rm -f $@; exit 1) @@ -2765,6 +2966,9 @@ cmd-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/b fs-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bsd > $@ || (rm -f $@; exit 1) +partmap-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bsd > $@ || (rm -f $@; exit 1) + bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index e3136d8dd..a44b7accc 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -620,9 +620,10 @@ _linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c $(lo $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< -include _linux_mod-loader_powerpc_ieee1275_linux.d -CLEANFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst fs-_linux_mod-loader_powerpc_ieee1275_linux.lst +CLEANFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst fs-_linux_mod-loader_powerpc_ieee1275_linux.lst partmap-_linux_mod-loader_powerpc_ieee1275_linux.lst COMMANDFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst FSFILES += fs-_linux_mod-loader_powerpc_ieee1275_linux.lst +PARTMAPFILES += partmap-_linux_mod-loader_powerpc_ieee1275_linux.lst cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) @@ -630,6 +631,9 @@ cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux. fs-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) +partmap-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) + _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -672,9 +676,10 @@ linux_mod-loader_powerpc_ieee1275_linux_normal.o: loader/powerpc/ieee1275/linux_ $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< -include linux_mod-loader_powerpc_ieee1275_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst partmap-linux_mod-loader_powerpc_ieee1275_linux_normal.lst COMMANDFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_powerpc_ieee1275_linux_normal.lst cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) @@ -682,6 +687,9 @@ cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/ fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -728,9 +736,10 @@ normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst +CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst +PARTMAPFILES += partmap-normal_mod-normal_arg.lst cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -738,14 +747,18 @@ cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdl fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst +CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst +PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -753,14 +766,18 @@ cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENC fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst +CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst +PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -768,14 +785,18 @@ cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENC fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst +CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst +PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -783,14 +804,18 @@ cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_ fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst +CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst +PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -798,14 +823,18 @@ cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENC fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst +CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst +PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -813,14 +842,18 @@ cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPEND fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst +CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst +PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -828,14 +861,18 @@ cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) g fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst +CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst +PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -843,14 +880,18 @@ cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genc fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst +CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst +PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -858,14 +899,18 @@ cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genc fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst +CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -873,14 +918,18 @@ cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_ fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst +CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst +PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -888,14 +937,18 @@ cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genc fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -903,14 +956,18 @@ cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPEND fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst +CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst +PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -918,14 +975,18 @@ cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_powerpc_setjmp.d -CLEANFILES += cmd-normal_mod-normal_powerpc_setjmp.lst fs-normal_mod-normal_powerpc_setjmp.lst +CLEANFILES += cmd-normal_mod-normal_powerpc_setjmp.lst fs-normal_mod-normal_powerpc_setjmp.lst partmap-normal_mod-normal_powerpc_setjmp.lst COMMANDFILES += cmd-normal_mod-normal_powerpc_setjmp.lst FSFILES += fs-normal_mod-normal_powerpc_setjmp.lst +PARTMAPFILES += partmap-normal_mod-normal_powerpc_setjmp.lst cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -933,14 +994,18 @@ cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/power fs-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst COMMANDFILES += cmd-normal_mod-normal_color.lst FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -948,6 +1013,9 @@ cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) g fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -991,9 +1059,10 @@ suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< -include suspend_mod-commands_ieee1275_suspend.d -CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst +CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst partmap-suspend_mod-commands_ieee1275_suspend.lst COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst +PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) @@ -1001,6 +1070,9 @@ cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(com fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) +partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) + suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1043,9 +1115,10 @@ reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst COMMANDFILES += cmd-reboot_mod-commands_reboot.lst FSFILES += fs-reboot_mod-commands_reboot.lst +PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1053,6 +1126,9 @@ cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPEND fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1095,9 +1171,10 @@ halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_halt.d -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst COMMANDFILES += cmd-halt_mod-commands_halt.lst FSFILES += fs-halt_mod-commands_halt.lst +PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) @@ -1105,6 +1182,9 @@ cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1149,9 +1229,10 @@ _multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(load $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_ieee1275_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_ieee1275_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1159,14 +1240,18 @@ cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c fs-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst FSFILES += fs-_multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1174,14 +1259,18 @@ cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< -include _multiboot_mod-loader_multiboot_loader.d -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst +CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) @@ -1189,6 +1278,9 @@ cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(load fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) + _multiboot_mod_CFLAGS = $(COMMON_CFLAGS) _multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1231,9 +1323,10 @@ multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot_loader_normal.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -1241,6 +1334,9 @@ cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_no fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) +partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 4ad18dc97..f71249119 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -227,9 +227,10 @@ fshelp_mod-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -MD -c -o $@ $< -include fshelp_mod-fs_fshelp.d -CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst +CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst partmap-fshelp_mod-fs_fshelp.lst COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst FSFILES += fs-fshelp_mod-fs_fshelp.lst +PARTMAPFILES += partmap-fshelp_mod-fs_fshelp.lst cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) @@ -237,6 +238,9 @@ cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) +partmap-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) + fshelp_mod_CFLAGS = $(COMMON_CFLAGS) fshelp_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -279,9 +283,10 @@ fat_mod-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -MD -c -o $@ $< -include fat_mod-fs_fat.d -CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst +CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst partmap-fat_mod-fs_fat.lst COMMANDFILES += cmd-fat_mod-fs_fat.lst FSFILES += fs-fat_mod-fs_fat.lst +PARTMAPFILES += partmap-fat_mod-fs_fat.lst cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) @@ -289,6 +294,9 @@ cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) +partmap-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) + fat_mod_CFLAGS = $(COMMON_CFLAGS) fat_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -331,9 +339,10 @@ ext2_mod-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -MD -c -o $@ $< -include ext2_mod-fs_ext2.d -CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst +CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst partmap-ext2_mod-fs_ext2.lst COMMANDFILES += cmd-ext2_mod-fs_ext2.lst FSFILES += fs-ext2_mod-fs_ext2.lst +PARTMAPFILES += partmap-ext2_mod-fs_ext2.lst cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) @@ -341,6 +350,9 @@ cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) +partmap-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) + ext2_mod_CFLAGS = $(COMMON_CFLAGS) ext2_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -383,9 +395,10 @@ ufs_mod-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -MD -c -o $@ $< -include ufs_mod-fs_ufs.d -CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst +CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst partmap-ufs_mod-fs_ufs.lst COMMANDFILES += cmd-ufs_mod-fs_ufs.lst FSFILES += fs-ufs_mod-fs_ufs.lst +PARTMAPFILES += partmap-ufs_mod-fs_ufs.lst cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) @@ -393,6 +406,9 @@ cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) +partmap-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) + ufs_mod_CFLAGS = $(COMMON_CFLAGS) ufs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -435,9 +451,10 @@ minix_mod-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -MD -c -o $@ $< -include minix_mod-fs_minix.d -CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst +CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst partmap-minix_mod-fs_minix.lst COMMANDFILES += cmd-minix_mod-fs_minix.lst FSFILES += fs-minix_mod-fs_minix.lst +PARTMAPFILES += partmap-minix_mod-fs_minix.lst cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) @@ -445,6 +462,9 @@ cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) +partmap-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) + minix_mod_CFLAGS = $(COMMON_CFLAGS) minix_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -487,9 +507,10 @@ hfs_mod-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -MD -c -o $@ $< -include hfs_mod-fs_hfs.d -CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst +CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst partmap-hfs_mod-fs_hfs.lst COMMANDFILES += cmd-hfs_mod-fs_hfs.lst FSFILES += fs-hfs_mod-fs_hfs.lst +PARTMAPFILES += partmap-hfs_mod-fs_hfs.lst cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) @@ -497,6 +518,9 @@ cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) +partmap-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) + hfs_mod_CFLAGS = $(COMMON_CFLAGS) hfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -539,9 +563,10 @@ jfs_mod-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -MD -c -o $@ $< -include jfs_mod-fs_jfs.d -CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst +CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst partmap-jfs_mod-fs_jfs.lst COMMANDFILES += cmd-jfs_mod-fs_jfs.lst FSFILES += fs-jfs_mod-fs_jfs.lst +PARTMAPFILES += partmap-jfs_mod-fs_jfs.lst cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) @@ -549,6 +574,9 @@ cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) +partmap-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) + jfs_mod_CFLAGS = $(COMMON_CFLAGS) jfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -596,9 +624,10 @@ xfs_mod-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -MD -c -o $@ $< -include xfs_mod-fs_xfs.d -CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst +CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst partmap-xfs_mod-fs_xfs.lst COMMANDFILES += cmd-xfs_mod-fs_xfs.lst FSFILES += fs-xfs_mod-fs_xfs.lst +PARTMAPFILES += partmap-xfs_mod-fs_xfs.lst cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) @@ -606,6 +635,9 @@ cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) +partmap-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) + xfs_mod_CFLAGS = $(COMMON_CFLAGS) xfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -648,9 +680,10 @@ affs_mod-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -MD -c -o $@ $< -include affs_mod-fs_affs.d -CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst +CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst partmap-affs_mod-fs_affs.lst COMMANDFILES += cmd-affs_mod-fs_affs.lst FSFILES += fs-affs_mod-fs_affs.lst +PARTMAPFILES += partmap-affs_mod-fs_affs.lst cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) @@ -658,6 +691,9 @@ cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) +partmap-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) + affs_mod_CFLAGS = $(COMMON_CFLAGS) affs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -700,9 +736,10 @@ sfs_mod-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -MD -c -o $@ $< -include sfs_mod-fs_sfs.d -CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst +CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst partmap-sfs_mod-fs_sfs.lst COMMANDFILES += cmd-sfs_mod-fs_sfs.lst FSFILES += fs-sfs_mod-fs_sfs.lst +PARTMAPFILES += partmap-sfs_mod-fs_sfs.lst cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) @@ -710,6 +747,9 @@ cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) +partmap-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) + sfs_mod_CFLAGS = $(COMMON_CFLAGS) sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -767,9 +807,10 @@ normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_arg.d -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst +CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst COMMANDFILES += cmd-normal_mod-normal_arg.lst FSFILES += fs-normal_mod-normal_arg.lst +PARTMAPFILES += partmap-normal_mod-normal_arg.lst cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -777,14 +818,18 @@ cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdl fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst +CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst COMMANDFILES += cmd-normal_mod-normal_cmdline.lst FSFILES += fs-normal_mod-normal_cmdline.lst +PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -792,14 +837,18 @@ cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENC fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_command.d -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst +CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst COMMANDFILES += cmd-normal_mod-normal_command.lst FSFILES += fs-normal_mod-normal_command.lst +PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -807,14 +856,18 @@ cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENC fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst +CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst COMMANDFILES += cmd-normal_mod-normal_completion.lst FSFILES += fs-normal_mod-normal_completion.lst +PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -822,14 +875,18 @@ cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_ fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst +CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst COMMANDFILES += cmd-normal_mod-normal_execute.lst FSFILES += fs-normal_mod-normal_execute.lst +PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -837,14 +894,18 @@ cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENC fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_function.d -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst +CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst COMMANDFILES += cmd-normal_mod-normal_function.lst FSFILES += fs-normal_mod-normal_function.lst +PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -852,14 +913,18 @@ cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPEND fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_lexer.d -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst +CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst COMMANDFILES += cmd-normal_mod-normal_lexer.lst FSFILES += fs-normal_mod-normal_lexer.lst +PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -867,14 +932,18 @@ cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) g fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_main.d -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst +CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst COMMANDFILES += cmd-normal_mod-normal_main.lst FSFILES += fs-normal_mod-normal_main.lst +PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -882,14 +951,18 @@ cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genc fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu.d -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst +CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst COMMANDFILES += cmd-normal_mod-normal_menu.lst FSFILES += fs-normal_mod-normal_menu.lst +PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -897,14 +970,18 @@ cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genc fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst +CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst FSFILES += fs-normal_mod-normal_menu_entry.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -912,14 +989,18 @@ cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_ fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_misc.d -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst +CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst COMMANDFILES += cmd-normal_mod-normal_misc.lst FSFILES += fs-normal_mod-normal_misc.lst +PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -927,14 +1008,18 @@ cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genc fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst +CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst COMMANDFILES += cmd-normal_mod-normal_script.lst FSFILES += fs-normal_mod-normal_script.lst +PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -942,14 +1027,18 @@ cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-normal_sparc64_setjmp.o: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< -include normal_mod-normal_sparc64_setjmp.d -CLEANFILES += cmd-normal_mod-normal_sparc64_setjmp.lst fs-normal_mod-normal_sparc64_setjmp.lst +CLEANFILES += cmd-normal_mod-normal_sparc64_setjmp.lst fs-normal_mod-normal_sparc64_setjmp.lst partmap-normal_mod-normal_sparc64_setjmp.lst COMMANDFILES += cmd-normal_mod-normal_sparc64_setjmp.lst FSFILES += fs-normal_mod-normal_sparc64_setjmp.lst +PARTMAPFILES += partmap-normal_mod-normal_sparc64_setjmp.lst cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -957,14 +1046,18 @@ cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc fs-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-grub_script_tab.d -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst COMMANDFILES += cmd-normal_mod-grub_script_tab.lst FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) @@ -972,6 +1065,9 @@ cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPEND fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) @@ -1015,9 +1111,10 @@ hello_mod-hello_hello.o: hello/hello.c $(hello/hello.c_DEPENDENCIES) $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -MD -c -o $@ $< -include hello_mod-hello_hello.d -CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst +CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst partmap-hello_mod-hello_hello.lst COMMANDFILES += cmd-hello_mod-hello_hello.lst FSFILES += fs-hello_mod-hello_hello.lst +PARTMAPFILES += partmap-hello_mod-hello_hello.lst cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) @@ -1025,6 +1122,9 @@ cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencm fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) +partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) + hello_mod_CFLAGS = $(COMMON_CFLAGS) hello_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1067,9 +1167,10 @@ boot_mod-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -MD -c -o $@ $< -include boot_mod-commands_boot.d -CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst +CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst partmap-boot_mod-commands_boot.lst COMMANDFILES += cmd-boot_mod-commands_boot.lst FSFILES += fs-boot_mod-commands_boot.lst +PARTMAPFILES += partmap-boot_mod-commands_boot.lst cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) @@ -1077,6 +1178,9 @@ cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) fs-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) +partmap-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh boot > $@ || (rm -f $@; exit 1) + boot_mod_CFLAGS = $(COMMON_CFLAGS) boot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1119,9 +1223,10 @@ terminal_mod-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPE $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -MD -c -o $@ $< -include terminal_mod-commands_terminal.d -CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_terminal.lst +CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_terminal.lst partmap-terminal_mod-commands_terminal.lst COMMANDFILES += cmd-terminal_mod-commands_terminal.lst FSFILES += fs-terminal_mod-commands_terminal.lst +PARTMAPFILES += partmap-terminal_mod-commands_terminal.lst cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) @@ -1129,6 +1234,9 @@ cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal. fs-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) +partmap-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminal > $@ || (rm -f $@; exit 1) + terminal_mod_CFLAGS = $(COMMON_CFLAGS) terminal_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1171,9 +1279,10 @@ ls_mod-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -MD -c -o $@ $< -include ls_mod-commands_ls.d -CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst +CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst partmap-ls_mod-commands_ls.lst COMMANDFILES += cmd-ls_mod-commands_ls.lst FSFILES += fs-ls_mod-commands_ls.lst +PARTMAPFILES += partmap-ls_mod-commands_ls.lst cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) @@ -1181,6 +1290,9 @@ cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdli fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) +partmap-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) + ls_mod_CFLAGS = $(COMMON_CFLAGS) ls_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1223,9 +1335,10 @@ cmp_mod-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -MD -c -o $@ $< -include cmp_mod-commands_cmp.d -CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst +CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst partmap-cmp_mod-commands_cmp.lst COMMANDFILES += cmd-cmp_mod-commands_cmp.lst FSFILES += fs-cmp_mod-commands_cmp.lst +PARTMAPFILES += partmap-cmp_mod-commands_cmp.lst cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) @@ -1233,6 +1346,9 @@ cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genc fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) +partmap-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) + cmp_mod_CFLAGS = $(COMMON_CFLAGS) cmp_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1275,9 +1391,10 @@ cat_mod-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -MD -c -o $@ $< -include cat_mod-commands_cat.d -CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst +CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst partmap-cat_mod-commands_cat.lst COMMANDFILES += cmd-cat_mod-commands_cat.lst FSFILES += fs-cat_mod-commands_cat.lst +PARTMAPFILES += partmap-cat_mod-commands_cat.lst cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) @@ -1285,6 +1402,9 @@ cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genc fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) +partmap-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) + cat_mod_CFLAGS = $(COMMON_CFLAGS) cat_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1327,9 +1447,10 @@ font_mod-font_manager.o: font/manager.c $(font/manager.c_DEPENDENCIES) $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< -include font_mod-font_manager.d -CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst +CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst partmap-font_mod-font_manager.lst COMMANDFILES += cmd-font_mod-font_manager.lst FSFILES += fs-font_mod-font_manager.lst +PARTMAPFILES += partmap-font_mod-font_manager.lst cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) @@ -1337,6 +1458,9 @@ cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gen fs-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) +partmap-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + font_mod_CFLAGS = $(COMMON_CFLAGS) font_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1379,9 +1503,10 @@ amiga_mod-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -MD -c -o $@ $< -include amiga_mod-partmap_amiga.d -CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst +CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst partmap-amiga_mod-partmap_amiga.lst COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst FSFILES += fs-amiga_mod-partmap_amiga.lst +PARTMAPFILES += partmap-amiga_mod-partmap_amiga.lst cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) @@ -1389,6 +1514,9 @@ cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) +partmap-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) + amiga_mod_CFLAGS = $(COMMON_CFLAGS) amiga_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1431,9 +1559,10 @@ apple_mod-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -MD -c -o $@ $< -include apple_mod-partmap_apple.d -CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst +CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst partmap-apple_mod-partmap_apple.lst COMMANDFILES += cmd-apple_mod-partmap_apple.lst FSFILES += fs-apple_mod-partmap_apple.lst +PARTMAPFILES += partmap-apple_mod-partmap_apple.lst cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) @@ -1441,6 +1570,9 @@ cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) +partmap-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) + apple_mod_CFLAGS = $(COMMON_CFLAGS) apple_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1483,9 +1615,10 @@ pc_mod-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -MD -c -o $@ $< -include pc_mod-partmap_pc.d -CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst +CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst partmap-pc_mod-partmap_pc.lst COMMANDFILES += cmd-pc_mod-partmap_pc.lst FSFILES += fs-pc_mod-partmap_pc.lst +PARTMAPFILES += partmap-pc_mod-partmap_pc.lst cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) @@ -1493,6 +1626,9 @@ cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist. fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) +partmap-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) + pc_mod_CFLAGS = $(COMMON_CFLAGS) pc_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1535,9 +1671,10 @@ sun_mod-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -MD -c -o $@ $< -include sun_mod-partmap_sun.d -CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst +CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst partmap-sun_mod-partmap_sun.lst COMMANDFILES += cmd-sun_mod-partmap_sun.lst FSFILES += fs-sun_mod-partmap_sun.lst +PARTMAPFILES += partmap-sun_mod-partmap_sun.lst cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) @@ -1545,6 +1682,9 @@ cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdl fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) +partmap-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) + sun_mod_CFLAGS = $(COMMON_CFLAGS) sun_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1587,9 +1727,10 @@ acorn_mod-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -MD -c -o $@ $< -include acorn_mod-partmap_acorn.d -CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst +CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst partmap-acorn_mod-partmap_acorn.lst COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst FSFILES += fs-acorn_mod-partmap_acorn.lst +PARTMAPFILES += partmap-acorn_mod-partmap_acorn.lst cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) @@ -1597,6 +1738,9 @@ cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) +partmap-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) + acorn_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1638,9 +1782,10 @@ loopback_mod-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -MD -c -o $@ $< -include loopback_mod-disk_loopback.d -CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.lst +CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.lst partmap-loopback_mod-disk_loopback.lst COMMANDFILES += cmd-loopback_mod-disk_loopback.lst FSFILES += fs-loopback_mod-disk_loopback.lst +PARTMAPFILES += partmap-loopback_mod-disk_loopback.lst cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) @@ -1648,6 +1793,9 @@ cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCI fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) +partmap-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) + loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1690,9 +1838,10 @@ suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< -include suspend_mod-commands_ieee1275_suspend.d -CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst +CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst partmap-suspend_mod-commands_ieee1275_suspend.lst COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst +PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) @@ -1700,6 +1849,9 @@ cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(com fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) +partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) + suspend_mod_CFLAGS = $(COMMON_CFLAGS) suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1742,9 +1894,10 @@ reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< -include reboot_mod-commands_reboot.d -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst COMMANDFILES += cmd-reboot_mod-commands_reboot.lst FSFILES += fs-reboot_mod-commands_reboot.lst +PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) @@ -1752,6 +1905,9 @@ cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPEND fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) +partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1794,9 +1950,10 @@ halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< -include halt_mod-commands_halt.d -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst COMMANDFILES += cmd-halt_mod-commands_halt.lst FSFILES += fs-halt_mod-commands_halt.lst +PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) @@ -1804,6 +1961,9 @@ cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) +partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1846,9 +2006,10 @@ help_mod-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -MD -c -o $@ $< -include help_mod-commands_help.d -CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst +CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst partmap-help_mod-commands_help.lst COMMANDFILES += cmd-help_mod-commands_help.lst FSFILES += fs-help_mod-commands_help.lst +PARTMAPFILES += partmap-help_mod-commands_help.lst cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) @@ -1856,6 +2017,9 @@ cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) +partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) + help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1908,9 +2072,10 @@ configfile_mod-commands_configfile.o: commands/configfile.c $(commands/configfil $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -MD -c -o $@ $< -include configfile_mod-commands_configfile.d -CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-commands_configfile.lst +CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-commands_configfile.lst partmap-configfile_mod-commands_configfile.lst COMMANDFILES += cmd-configfile_mod-commands_configfile.lst FSFILES += fs-configfile_mod-commands_configfile.lst +PARTMAPFILES += partmap-configfile_mod-commands_configfile.lst cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) @@ -1918,6 +2083,9 @@ cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/con fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) +partmap-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) + configfile_mod_CFLAGS = $(COMMON_CFLAGS) configfile_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -1960,9 +2128,10 @@ search_mod-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -MD -c -o $@ $< -include search_mod-commands_search.d -CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.lst +CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.lst partmap-search_mod-commands_search.lst COMMANDFILES += cmd-search_mod-commands_search.lst FSFILES += fs-search_mod-commands_search.lst +PARTMAPFILES += partmap-search_mod-commands_search.lst cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) @@ -1970,6 +2139,9 @@ cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPEND fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) +partmap-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) + search_mod_CFLAGS = $(COMMON_CFLAGS) search_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -2012,9 +2184,10 @@ gzio_mod-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -MD -c -o $@ $< -include gzio_mod-io_gzio.d -CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst +CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst partmap-gzio_mod-io_gzio.lst COMMANDFILES += cmd-gzio_mod-io_gzio.lst FSFILES += fs-gzio_mod-io_gzio.lst +PARTMAPFILES += partmap-gzio_mod-io_gzio.lst cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) @@ -2022,6 +2195,9 @@ cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) +partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) + gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) From 0a1150e26b97ee4fed4f360b59ee1b00558c42f8 Mon Sep 17 00:00:00 2001 From: chaac Date: Mon, 14 Apr 2008 19:08:38 +0000 Subject: [PATCH 0108/1707] 2008-04-14 Vesa Jaaskelainen * disk/lvm.c (grub_lvm_scan_device): Fix logical volume's physical volume name mapping to support bigger than 9 character names properly. --- ChangeLog | 5 +++++ disk/lvm.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 79c1db86b..10b22099b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-14 Vesa Jaaskelainen + + * disk/lvm.c (grub_lvm_scan_device): Fix logical volume's physical + volume name mapping to support bigger than 9 character names properly. + 2008-04-13 Robert Millan * disk/i386/pc/biosdisk.c (grub_biosdisk_rw): Fix CHS limit check, diff --git a/disk/lvm.c b/disk/lvm.c index d215ca4d9..7af01e2bb 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -467,7 +467,7 @@ grub_lvm_scan_device (const char *name) for (j = 0; j < seg->stripe_count; j++) { - char pvname[10]; + char *pvname; p = grub_strchr (p, '"'); if (p == NULL) @@ -477,6 +477,7 @@ grub_lvm_scan_device (const char *name) q++; s = q - p; + pvname = grub_malloc (s + 1); grub_memcpy (pvname, p, s); pvname[s] = '\0'; @@ -490,6 +491,8 @@ grub_lvm_scan_device (const char *name) } } + grub_free(pvname); + stripe->start = grub_lvm_getvalue (&p, ","); if (p == NULL) continue; From 01979850ed9c35cc0668890d7407f4bd7a505f37 Mon Sep 17 00:00:00 2001 From: chaac Date: Mon, 14 Apr 2008 19:39:04 +0000 Subject: [PATCH 0109/1707] 2008-04-14 Vesa Jaaskelainen * disk/lvm.c (grub_lvm_scan_device): Add forgotten failure path when there is no memory left for physical volume name. --- ChangeLog | 5 +++++ disk/lvm.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 10b22099b..09c3294b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-14 Vesa Jaaskelainen + + * disk/lvm.c (grub_lvm_scan_device): Add forgotten failure path when + there is no memory left for physical volume name. + 2008-04-14 Vesa Jaaskelainen * disk/lvm.c (grub_lvm_scan_device): Fix logical volume's physical diff --git a/disk/lvm.c b/disk/lvm.c index 7af01e2bb..fe49209e3 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -477,7 +477,11 @@ grub_lvm_scan_device (const char *name) q++; s = q - p; + pvname = grub_malloc (s + 1); + if (pvname == NULL) + goto lvs_segment_fail2; + grub_memcpy (pvname, p, s); pvname[s] = '\0'; From bfb1f1a2bc936f06d00101407c4bab1da492aab9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 15 Apr 2008 13:28:14 +0000 Subject: [PATCH 0110/1707] 2008-04-15 Robert Millan * disk/lvm.c: Update copyright year. * kern/misc.c: Likewise. --- ChangeLog | 5 +++++ disk/lvm.c | 2 +- kern/misc.c | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09c3294b7..c14397f54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-04-15 Robert Millan + + * disk/lvm.c: Update copyright year. + * kern/misc.c: Likewise. + 2008-04-14 Vesa Jaaskelainen * disk/lvm.c (grub_lvm_scan_device): Add forgotten failure path when diff --git a/disk/lvm.c b/disk/lvm.c index fe49209e3..148e0f89e 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -1,7 +1,7 @@ /* lvm.c - module to read Logical Volumes. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/kern/misc.c b/kern/misc.c index 1374e3b5f..444ce2e50 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -1,7 +1,7 @@ /* misc.c - definitions of misc functions */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 1977517daf5197a1727c6936477038e14bb7d058 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 17 Apr 2008 14:14:10 +0000 Subject: [PATCH 0111/1707] 2008-04-17 Lubomir Kundrak * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text section into account, newer toolchains generate unique build ids * configure.ac: remove the test for --build-id=none acceptance, we want build ids to bre preserved * genmk.rb: add -R .note.gnu.build-id to objcopy, so build id far from other sections don't cause the raw binary images grow size --- ChangeLog | 10 +++++++++ aclocal.m4 | 2 +- conf/i386-pc.mk | 12 +++++------ configure | 56 +------------------------------------------------ configure.ac | 10 --------- genmk.rb | 4 ++-- 6 files changed, 20 insertions(+), 74 deletions(-) diff --git a/ChangeLog b/ChangeLog index c14397f54..3ceca774d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-04-17 Lubomir Kundrak + + * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text + section into account, newer toolchains generate unique build ids + * configure.ac: remove the test for --build-id=none acceptance, + we want build ids to bre preserved + * genmk.rb: add -R .note.gnu.build-id to objcopy, so build id + far from other sections don't cause the raw binary images grow + size + 2008-04-15 Robert Millan * disk/lvm.c: Update copyright year. diff --git a/aclocal.m4 b/aclocal.m4 index a634253bb..fc6706614 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -61,7 +61,7 @@ for link_addr in 2000 8000 7C00; do else AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) fi - if AC_TRY_COMMAND([${OBJCOPY-objcopy} -O binary conftest.exec conftest]); then : + if AC_TRY_COMMAND([${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest]); then : else AC_MSG_ERROR([${OBJCOPY-objcopy} cannot create binary files]) fi diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index b0153a4ad..d06042185 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -22,7 +22,7 @@ CLEANFILES += boot.img boot.exec boot_img-boot_i386_pc_boot.o MOSTLYCLEANFILES += boot_img-boot_i386_pc_boot.d boot.img: boot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ boot.exec: boot_img-boot_i386_pc_boot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS) @@ -40,7 +40,7 @@ CLEANFILES += pxeboot.img pxeboot.exec pxeboot_img-boot_i386_pc_pxeboot.o MOSTLYCLEANFILES += pxeboot_img-boot_i386_pc_pxeboot.d pxeboot.img: pxeboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS) @@ -58,7 +58,7 @@ CLEANFILES += diskboot.img diskboot.exec diskboot_img-boot_i386_pc_diskboot.o MOSTLYCLEANFILES += diskboot_img-boot_i386_pc_diskboot.d diskboot.img: diskboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS) @@ -76,7 +76,7 @@ CLEANFILES += lnxboot.img lnxboot.exec lnxboot_img-boot_i386_pc_lnxboot.o MOSTLYCLEANFILES += lnxboot_img-boot_i386_pc_lnxboot.d lnxboot.img: lnxboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ lnxboot.exec: lnxboot_img-boot_i386_pc_lnxboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(lnxboot_img_LDFLAGS) @@ -94,7 +94,7 @@ CLEANFILES += cdboot.img cdboot.exec cdboot_img-boot_i386_pc_cdboot.o MOSTLYCLEANFILES += cdboot_img-boot_i386_pc_cdboot.d cdboot.img: cdboot.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS) @@ -118,7 +118,7 @@ CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_im MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d kernel.img: kernel.exec - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) diff --git a/configure b/configure index 2517a3c62..1f44d1900 100644 --- a/configure +++ b/configure @@ -6686,60 +6686,6 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -{ echo "$as_me:$LINENO: checking whether the linker accepts \`--build-id=none'" >&5 -echo $ECHO_N "checking whether the linker accepts \`--build-id=none'... $ECHO_C" >&6; } -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS -Wl,--build-id=none" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - build_id_flag=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - build_id_flag=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $build_id_flag" >&5 -echo "${ECHO_T}$build_id_flag" >&6; } -LDFLAGS="$save_LDFLAGS" -if test "x$build_id_flag" = xyes; then - TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" -fi - # # Compiler features. # @@ -6820,7 +6766,7 @@ for link_addr in 2000 8000 7C00; do echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} { (exit 1); exit 1; }; } fi - if { ac_try='${OBJCOPY-objcopy} -O binary conftest.exec conftest' + if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? diff --git a/configure.ac b/configure.ac index 80cb54238..5ec7a47de 100644 --- a/configure.ac +++ b/configure.ac @@ -238,16 +238,6 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi -AC_MSG_CHECKING([whether the linker accepts `--build-id=none']) -save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS -Wl,--build-id=none" -AC_TRY_LINK(, , build_id_flag=yes, build_id_flag=no) -AC_MSG_RESULT([$build_id_flag]) -LDFLAGS="$save_LDFLAGS" -if test "x$build_id_flag" = xyes; then - TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" -fi - # # Compiler features. # diff --git a/genmk.rb b/genmk.rb index 9faea5aad..a2179fab5 100644 --- a/genmk.rb +++ b/genmk.rb @@ -1,6 +1,6 @@ #! /usr/bin/ruby -w # -# Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. +# Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. # # This genmk.rb is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -57,7 +57,7 @@ class Image MOSTLYCLEANFILES += #{deps_str} #{@name}: #{exe} - $(OBJCOPY) -O binary -R .note -R .comment $< $@ + $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ #{exe}: #{objs_str} $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS) From 57490c2bd65138e09936157f96b4453778dfe811 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 18 Apr 2008 13:20:55 +0000 Subject: [PATCH 0112/1707] 2008-04-18 Robert Millan * util/update-grub.in: Fix syntax error when setting `GRUB_PRELOAD_MODULES'. Reported by Stephane Chazelas --- ChangeLog | 6 ++++++ util/update-grub.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3ceca774d..004996dd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-18 Robert Millan + + * util/update-grub.in: Fix syntax error when setting + `GRUB_PRELOAD_MODULES'. + Reported by Stephane Chazelas + 2008-04-17 Lubomir Kundrak * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text diff --git a/util/update-grub.in b/util/update-grub.in index 77c19a14d..6037b13d8 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -136,7 +136,7 @@ case ${GRUB_TERMINAL} in gfxterm) if path=`font_path` ; then GRUB_FONT_PATH="`convert_system_path_to_grub_path ${path}`" - GRUB_PRELOAD_MODULES="`${GRUB_PRELOAD_MODULES} ${grub_probe} -t abstraction ${path}`" + GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES} `${grub_probe} -t abstraction ${path}`" else # fallback to console GRUB_TERMINAL=console From 602566f64a4a2574b97744826681ec5f53695744 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 18 Apr 2008 15:53:20 +0000 Subject: [PATCH 0113/1707] 2008-04-18 Robert Millan Restructures early code path on ieee1275 to unify grub_main() as the first C function that is executed in every platform. * include/grub/ieee1275/ieee1275.h (grub_ieee1275_init): New prototype. * kern/i386/ieee1275/startup.S (_start): Jump to grub_main() instead of cmain(). * kern/powerpc/ieee1275/crt0.S (_start): Likewise. * kern/ieee1275/cmain.c (cmain): Rename to ... * kern/ieee1275/cmain.c (grub_ieee1275_init): ... this. * kern/ieee1275/init.c (grub_machine_init): Call grub_ieee1275_init() at the beginning. --- ChangeLog | 14 ++++++++++++++ include/grub/ieee1275/ieee1275.h | 1 + kern/i386/ieee1275/startup.S | 2 +- kern/ieee1275/cmain.c | 8 +------- kern/ieee1275/init.c | 2 ++ kern/powerpc/ieee1275/crt0.S | 2 +- 6 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 004996dd3..eed31714f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-04-18 Robert Millan + + Restructures early code path on ieee1275 to unify grub_main() as + the first C function that is executed in every platform. + + * include/grub/ieee1275/ieee1275.h (grub_ieee1275_init): New prototype. + * kern/i386/ieee1275/startup.S (_start): Jump to grub_main() instead of + cmain(). + * kern/powerpc/ieee1275/crt0.S (_start): Likewise. + * kern/ieee1275/cmain.c (cmain): Rename to ... + * kern/ieee1275/cmain.c (grub_ieee1275_init): ... this. + * kern/ieee1275/init.c (grub_machine_init): Call grub_ieee1275_init() + at the beginning. + 2008-04-18 Robert Millan * util/update-grub.in: Fix syntax error when setting diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 463180dca..eef08c395 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -97,6 +97,7 @@ extern void EXPORT_FUNC(grub_ieee1275_set_flag) (enum grub_ieee1275_flag flag); +void EXPORT_FUNC(grub_ieee1275_init) (void); int EXPORT_FUNC(grub_ieee1275_finddevice) (char *name, grub_ieee1275_phandle_t *phandlep); int EXPORT_FUNC(grub_ieee1275_get_property) (grub_ieee1275_phandle_t phandle, diff --git a/kern/i386/ieee1275/startup.S b/kern/i386/ieee1275/startup.S index 792642fb9..8bb731bc3 100644 --- a/kern/i386/ieee1275/startup.S +++ b/kern/i386/ieee1275/startup.S @@ -39,7 +39,7 @@ start: _start: movl %eax, EXT_C(grub_ieee1275_entry_fn) - jmp EXT_C(cmain) + jmp EXT_C(grub_main) /* * This call is special... it never returns... in fact it should simply diff --git a/kern/ieee1275/cmain.c b/kern/ieee1275/cmain.c index 31947ccb4..54a52b694 100644 --- a/kern/ieee1275/cmain.c +++ b/kern/ieee1275/cmain.c @@ -151,9 +151,8 @@ grub_ieee1275_find_options (void) #undef SF #undef OHW -void cmain (void); void -cmain (void) +grub_ieee1275_init (void) { grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen); @@ -162,9 +161,4 @@ cmain (void) grub_ieee1275_mmu = 0; grub_ieee1275_find_options (); - - /* Now invoke the main function. */ - grub_main (); - - /* Never reached. */ } diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index 6d08140f0..94a40b2eb 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -180,6 +180,8 @@ grub_machine_init (void) char args[256]; int actual; + grub_ieee1275_init (); + grub_console_init (); #ifdef __i386__ grub_keyboard_controller_init (); diff --git a/kern/powerpc/ieee1275/crt0.S b/kern/powerpc/ieee1275/crt0.S index 28130aa0c..fac99d6b0 100644 --- a/kern/powerpc/ieee1275/crt0.S +++ b/kern/powerpc/ieee1275/crt0.S @@ -42,5 +42,5 @@ _start: lis 9, grub_ieee1275_entry_fn@ha stw 5, grub_ieee1275_entry_fn@l(9) - bl cmain + bl grub_main 1: b 1b From e89d61e9a83f3b41ac63be219e68fd38ec236b64 Mon Sep 17 00:00:00 2001 From: tschwinge Date: Fri, 18 Apr 2008 16:42:57 +0000 Subject: [PATCH 0114/1707] 2008-04-18 Thomas Schwinge * util/i386/pc/grub-mkrescue.in (grub_mkimage): Don't overwrite correct value. * util/powerpc/ieee1275/grub-mkrescue.in (grub_mkimage): Likewise. --- ChangeLog | 6 ++++++ util/i386/pc/grub-mkrescue.in | 1 - util/powerpc/ieee1275/grub-mkrescue.in | 1 - 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index eed31714f..ac4038056 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-04-18 Thomas Schwinge + + * util/i386/pc/grub-mkrescue.in (grub_mkimage): Don't overwrite correct + value. + * util/powerpc/ieee1275/grub-mkrescue.in (grub_mkimage): Likewise. + 2008-04-18 Robert Millan Restructures early code path on ieee1275 to unify grub_main() as diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 668f270f4..b2d50c90b 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -57,7 +57,6 @@ EOF image_type=cdrom input_dir=${pkglibdir} -grub_mkimage=grub-mkimage emulation=none # Check the arguments. diff --git a/util/powerpc/ieee1275/grub-mkrescue.in b/util/powerpc/ieee1275/grub-mkrescue.in index 8e72eac8b..30bdabed5 100644 --- a/util/powerpc/ieee1275/grub-mkrescue.in +++ b/util/powerpc/ieee1275/grub-mkrescue.in @@ -53,7 +53,6 @@ EOF } input_dir=${pkglibdir} -grub_mkimage=grub-mkimage # Check the arguments. for option in "$@"; do From e0c5dacbf41eee8daa7700984ca235a3fb424313 Mon Sep 17 00:00:00 2001 From: tschwinge Date: Sat, 19 Apr 2008 17:47:21 +0000 Subject: [PATCH 0115/1707] Typo fixes. --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac4038056..5036d0f0a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,7 +29,7 @@ * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): take only .text section into account, newer toolchains generate unique build ids * configure.ac: remove the test for --build-id=none acceptance, - we want build ids to bre preserved + we want build ids to be preserved * genmk.rb: add -R .note.gnu.build-id to objcopy, so build id far from other sections don't cause the raw binary images grow size @@ -931,7 +931,7 @@ 2008-02-03 Pavel Roskin - * a/kern/i386/pc/startup.S (grub_chainloader_real_boot): Pop + * kern/i386/pc/startup.S (grub_chainloader_real_boot): Pop %edx and %esi from stack only after grub_gate_a20() is called. grub_gate_a20() clobbers %edx. From 25f16ec1f6b8d67b1ef1b0eac2e41eadc6d4c9c9 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 25 Apr 2008 19:41:51 +0000 Subject: [PATCH 0116/1707] 2008-04-25 Bean * Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and i386-linuxbios. * commands/hexdump.c (grub_cmd_hexdump): Support dumping of device, change the buffer size to 4096 for cdrom device. * conf/i386-ieee1275.rmk (pkglib_MODULES): Add _linux.mod, linux.mod and nand.mod. (_linux_mod_SOURCES): New variable. (_linux_mod_CFLAGS): Likewise. (_linux_mod_LDFLAGS): Likewise. (linux_mod_SOURCES): Likewise. (linux_mod_CFLAGS): Likewise. (linux_mod_LDFLAGS): Likewise. (nand_mod_SOURCES): Likewise. (nand_mod_CFLAGS): Likewise. (nand_mod_LDFLAGS): Likewise. * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Return GRUB_ERR_UNKNOWN_DEVICE instead of GRUB_ERR_BAD_DEVICE if no device type property. (nand device in olpc don't have this property) * include/grub/disk.h (grub_disk_dev_id): New macro GRUB_DISK_DEVICE_NAND_ID. * include/grub/i386/ieee1275/loader.h (grub_rescue_cmd_linux): New function prototype. (grub_rescue_cmd_initrd): Likewise. * include/grub/i386/linux.h (GRUB_LINUX_OFW_SIGNATURE): New macro. (linux_kernel_params): Add new member ofw_signature, ofw_num_items, ofw_cif_handler and ofw_idt, adjust padding number. * include/grub/i386/pc/memory.h (grub_upper_mem): Export it if GRUB_MACHINE_IEEE1275 is defined. * include/grub/ieee1275/ieee1275.h (grub_available_iterate): Use NESTED_FUNC_ATTR attribute on the hook parameter. * kern/powerpc/ieee1275/init.c (grub_claim_heap): Use NESTED_FUNC_ATTR on nested function heap_init. (grub_upper_mem): New variable for i386-ieee1275. (grub_get_extended_memory): New function for i386-ieee1275. (grub_machine_init): Call grub_get_extended_memory for i386-ieee1275. * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Use NESTED_FUNC_ATTR on the hook parameter. Don't quit if no device type property. * loader/i386/ieee1275/linux.c: New file. * loader/i386/ieee1275/linux_normal.c: New file. * disk/ieee1275/nand.c: New file. --- ChangeLog | 57 ++++++ Makefile.in | 2 +- commands/hexdump.c | 60 ++++-- conf/i386-ieee1275.mk | 171 +++++++++++++++- conf/i386-ieee1275.rmk | 18 +- disk/ieee1275/nand.c | 216 +++++++++++++++++++++ disk/ieee1275/ofdisk.c | 2 +- include/grub/disk.h | 1 + include/grub/i386/ieee1275/loader.h | 3 + include/grub/i386/linux.h | 18 +- include/grub/i386/pc/memory.h | 7 +- include/grub/ieee1275/ieee1275.h | 2 +- kern/ieee1275/init.c | 30 ++- kern/ieee1275/openfw.c | 6 +- loader/i386/ieee1275/linux.c | 289 ++++++++++++++++++++++++++++ loader/i386/ieee1275/linux_normal.c | 60 ++++++ term/ieee1275/ofconsole.c | 5 +- 17 files changed, 917 insertions(+), 30 deletions(-) create mode 100644 disk/ieee1275/nand.c create mode 100644 loader/i386/ieee1275/linux.c create mode 100644 loader/i386/ieee1275/linux_normal.c diff --git a/ChangeLog b/ChangeLog index 5036d0f0a..58a9b93d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,60 @@ +2008-04-25 Bean + + * Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and + i386-linuxbios. + + * commands/hexdump.c (grub_cmd_hexdump): Support dumping of device, + change the buffer size to 4096 for cdrom device. + + * conf/i386-ieee1275.rmk (pkglib_MODULES): Add _linux.mod, linux.mod + and nand.mod. + (_linux_mod_SOURCES): New variable. + (_linux_mod_CFLAGS): Likewise. + (_linux_mod_LDFLAGS): Likewise. + (linux_mod_SOURCES): Likewise. + (linux_mod_CFLAGS): Likewise. + (linux_mod_LDFLAGS): Likewise. + (nand_mod_SOURCES): Likewise. + (nand_mod_CFLAGS): Likewise. + (nand_mod_LDFLAGS): Likewise. + + * disk/ieee1275/ofdisk.c (grub_ofdisk_open): Return + GRUB_ERR_UNKNOWN_DEVICE instead of GRUB_ERR_BAD_DEVICE if no device + type property. (nand device in olpc don't have this property) + + * include/grub/disk.h (grub_disk_dev_id): New macro + GRUB_DISK_DEVICE_NAND_ID. + + * include/grub/i386/ieee1275/loader.h (grub_rescue_cmd_linux): New + function prototype. + (grub_rescue_cmd_initrd): Likewise. + + * include/grub/i386/linux.h (GRUB_LINUX_OFW_SIGNATURE): New macro. + (linux_kernel_params): Add new member ofw_signature, ofw_num_items, + ofw_cif_handler and ofw_idt, adjust padding number. + + * include/grub/i386/pc/memory.h (grub_upper_mem): Export it if + GRUB_MACHINE_IEEE1275 is defined. + + * include/grub/ieee1275/ieee1275.h (grub_available_iterate): + Use NESTED_FUNC_ATTR attribute on the hook parameter. + + * kern/powerpc/ieee1275/init.c (grub_claim_heap): Use NESTED_FUNC_ATTR + on nested function heap_init. + (grub_upper_mem): New variable for i386-ieee1275. + (grub_get_extended_memory): New function for i386-ieee1275. + (grub_machine_init): Call grub_get_extended_memory for i386-ieee1275. + + * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Use + NESTED_FUNC_ATTR on the hook parameter. Don't quit if no device type + property. + + * loader/i386/ieee1275/linux.c: New file. + + * loader/i386/ieee1275/linux_normal.c: New file. + + * disk/ieee1275/nand.c: New file. + 2008-04-18 Thomas Schwinge * util/i386/pc/grub-mkrescue.in (grub_mkimage): Don't overwrite correct diff --git a/Makefile.in b/Makefile.in index afe53a3bc..c29c5fdf5 100644 --- a/Makefile.in +++ b/Makefile.in @@ -91,7 +91,7 @@ enable_grub_fstest = @enable_grub_fstest@ ### General variables. RMKFILES = $(addprefix conf/,common.rmk i386-pc.rmk powerpc-ieee1275.rmk \ - sparc64-ieee1275.rmk i386-efi.rmk) + sparc64-ieee1275.rmk i386-efi.rmk i386-ieee1275.rmk i386-linuxbios.rmk) MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ diff --git a/commands/hexdump.c b/commands/hexdump.c index d353d5eaa..6d97fe4fe 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -82,26 +82,62 @@ hexdump (unsigned long bse, char *buf, int len) static grub_err_t grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) { - grub_file_t file; - char buf[GRUB_DISK_SECTOR_SIZE]; + char buf[GRUB_DISK_SECTOR_SIZE * 4]; grub_ssize_t size, length; unsigned long skip; - int is_file; + int namelen; if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + namelen = grub_strlen (args[0]); skip = (state[0].set) ? grub_strtoul (state[0].arg, 0, 0) : 0; - length = (state[1].set) ? grub_strtoul (state[1].arg, 0, 0) : 0; + length = (state[1].set) ? grub_strtoul (state[1].arg, 0, 0) : 256; - is_file = (grub_strcmp (args[0], "(mem)")); - if ((!is_file) && (!length)) - length = 256; - - if (is_file) + if (!grub_strcmp (args[0], "(mem)")) + hexdump (skip, (char *) skip, length); + else if ((args[0][0] == '(') && (args[0][namelen - 1] == ')')) { + grub_disk_t disk; + grub_disk_addr_t sector; + grub_size_t ofs; + + args[0][namelen - 1] = 0; + disk = grub_disk_open (&args[0][1]); + if (! disk) + return 0; + + sector = (skip >> (GRUB_DISK_SECTOR_BITS + 2)) * 4; + ofs = skip & (GRUB_DISK_SECTOR_SIZE * 4 - 1); + while (length) + { + grub_size_t len, n; + + len = length; + if (ofs + len > sizeof (buf)) + len = sizeof (buf) - ofs; + + n = ((ofs + len + GRUB_DISK_SECTOR_SIZE - 1) + >> GRUB_DISK_SECTOR_BITS); + if (disk->dev->read (disk, sector, n, buf)) + break; + + hexdump (skip, &buf[ofs], len); + + ofs = 0; + skip += len; + length -= len; + sector += 4; + } + + grub_disk_close (disk); + } + else + { + grub_file_t file; + file = grub_gzfile_open (args[0], 1); - if (!file) + if (! file) return 0; file->offset = skip; @@ -123,8 +159,6 @@ grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) grub_file_close (file); } - else - hexdump (skip, (char *) skip, length); return 0; } @@ -134,7 +168,7 @@ GRUB_MOD_INIT (hexdump) { (void) mod; /* To stop warning. */ grub_register_command ("hexdump", grub_cmd_hexdump, GRUB_COMMAND_FLAG_BOTH, - "hexdump [ -s offset ] [-n length] { FILE | (mem) }", + "hexdump [OPTIONS] FILE_OR_DEVICE", "Dump the contents of a file or memory.", options); } diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index fbac507f7..eb0334c2a 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -573,7 +573,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ - multiboot.mod _multiboot.mod aout.mod serial.mod + multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ + _linux.mod nand.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -1390,4 +1391,172 @@ partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For _linux.mod. +_linux_mod_SOURCES = loader/i386/ieee1275/linux.c +CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_ieee1275_linux.o und-_linux.lst +ifneq ($(_linux_mod_EXPORTS),no) +CLEANFILES += def-_linux.lst +DEFSYMFILES += def-_linux.lst +endif +MOSTLYCLEANFILES += _linux_mod-loader_i386_ieee1275_linux.d +UNDSYMFILES += und-_linux.lst + +_linux.mod: pre-_linux.o mod-_linux.o + -rm -f $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_ieee1275_linux.o + -rm -f $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_ieee1275_linux.o + +mod-_linux.o: mod-_linux.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< + +mod-_linux.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(_linux_mod_EXPORTS),no) +def-_linux.lst: pre-_linux.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ +endif + +und-_linux.lst: pre-_linux.o + echo '_linux' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +_linux_mod-loader_i386_ieee1275_linux.o: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< +-include _linux_mod-loader_i386_ieee1275_linux.d + +CLEANFILES += cmd-_linux_mod-loader_i386_ieee1275_linux.lst fs-_linux_mod-loader_i386_ieee1275_linux.lst partmap-_linux_mod-loader_i386_ieee1275_linux.lst +COMMANDFILES += cmd-_linux_mod-loader_i386_ieee1275_linux.lst +FSFILES += fs-_linux_mod-loader_i386_ieee1275_linux.lst +PARTMAPFILES += partmap-_linux_mod-loader_i386_ieee1275_linux.lst + +cmd-_linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) + +fs-_linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) + +partmap-_linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) + + +_linux_mod_CFLAGS = $(COMMON_CFLAGS) +_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For linux.mod. +linux_mod_SOURCES = loader/i386/ieee1275/linux_normal.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_ieee1275_linux_normal.o und-linux.lst +ifneq ($(linux_mod_EXPORTS),no) +CLEANFILES += def-linux.lst +DEFSYMFILES += def-linux.lst +endif +MOSTLYCLEANFILES += linux_mod-loader_i386_ieee1275_linux_normal.d +UNDSYMFILES += und-linux.lst + +linux.mod: pre-linux.o mod-linux.o + -rm -f $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_ieee1275_linux_normal.o + -rm -f $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_ieee1275_linux_normal.o + +mod-linux.o: mod-linux.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< + +mod-linux.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(linux_mod_EXPORTS),no) +def-linux.lst: pre-linux.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ +endif + +und-linux.lst: pre-linux.o + echo 'linux' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +linux_mod-loader_i386_ieee1275_linux_normal.o: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_ieee1275_linux_normal.d + +CLEANFILES += cmd-linux_mod-loader_i386_ieee1275_linux_normal.lst fs-linux_mod-loader_i386_ieee1275_linux_normal.lst partmap-linux_mod-loader_i386_ieee1275_linux_normal.lst +COMMANDFILES += cmd-linux_mod-loader_i386_ieee1275_linux_normal.lst +FSFILES += fs-linux_mod-loader_i386_ieee1275_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_ieee1275_linux_normal.lst + +cmd-linux_mod-loader_i386_ieee1275_linux_normal.lst: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + +fs-linux_mod-loader_i386_ieee1275_linux_normal.lst: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + +partmap-linux_mod-loader_i386_ieee1275_linux_normal.lst: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + + +linux_mod_CFLAGS = $(COMMON_CFLAGS) +linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For nand.mod. +nand_mod_SOURCES = disk/ieee1275/nand.c +CLEANFILES += nand.mod mod-nand.o mod-nand.c pre-nand.o nand_mod-disk_ieee1275_nand.o und-nand.lst +ifneq ($(nand_mod_EXPORTS),no) +CLEANFILES += def-nand.lst +DEFSYMFILES += def-nand.lst +endif +MOSTLYCLEANFILES += nand_mod-disk_ieee1275_nand.d +UNDSYMFILES += und-nand.lst + +nand.mod: pre-nand.o mod-nand.o + -rm -f $@ + $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-nand.o: $(nand_mod_DEPENDENCIES) nand_mod-disk_ieee1275_nand.o + -rm -f $@ + $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ nand_mod-disk_ieee1275_nand.o + +mod-nand.o: mod-nand.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -c -o $@ $< + +mod-nand.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'nand' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(nand_mod_EXPORTS),no) +def-nand.lst: pre-nand.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 nand/' > $@ +endif + +und-nand.lst: pre-nand.o + echo 'nand' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +nand_mod-disk_ieee1275_nand.o: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) + $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -MD -c -o $@ $< +-include nand_mod-disk_ieee1275_nand.d + +CLEANFILES += cmd-nand_mod-disk_ieee1275_nand.lst fs-nand_mod-disk_ieee1275_nand.lst partmap-nand_mod-disk_ieee1275_nand.lst +COMMANDFILES += cmd-nand_mod-disk_ieee1275_nand.lst +FSFILES += fs-nand_mod-disk_ieee1275_nand.lst +PARTMAPFILES += partmap-nand_mod-disk_ieee1275_nand.lst + +cmd-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh nand > $@ || (rm -f $@; exit 1) + +fs-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh nand > $@ || (rm -f $@; exit 1) + +partmap-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh nand > $@ || (rm -f $@; exit 1) + + +nand_mod_CFLAGS = $(COMMON_CFLAGS) +nand_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 08ff66477..0c62aeaf5 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -97,7 +97,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ - multiboot.mod _multiboot.mod aout.mod serial.mod + multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ + _linux.mod nand.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -151,4 +152,19 @@ serial_mod_SOURCES = term/i386/pc/serial.c serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For _linux.mod. +_linux_mod_SOURCES = loader/i386/ieee1275/linux.c +_linux_mod_CFLAGS = $(COMMON_CFLAGS) +_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For linux.mod. +linux_mod_SOURCES = loader/i386/ieee1275/linux_normal.c +linux_mod_CFLAGS = $(COMMON_CFLAGS) +linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For nand.mod. +nand_mod_SOURCES = disk/ieee1275/nand.c +nand_mod_CFLAGS = $(COMMON_CFLAGS) +nand_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/disk/ieee1275/nand.c b/disk/ieee1275/nand.c new file mode 100644 index 000000000..ba79faa54 --- /dev/null +++ b/disk/ieee1275/nand.c @@ -0,0 +1,216 @@ +/* nand.c - NAND flash disk access. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +struct grub_nand_data +{ + grub_ieee1275_ihandle_t handle; + grub_uint32_t block_size; +}; + +static int +grub_nand_iterate (int (*hook) (const char *name)) +{ + auto int dev_iterate (struct grub_ieee1275_devalias *alias); + int dev_iterate (struct grub_ieee1275_devalias *alias) + { + if (! grub_strcmp (alias->name, "nand")) + { + hook (alias->name); + return 1; + } + + return 0; + } + + grub_devalias_iterate (dev_iterate); + return 0; +} + +static grub_err_t +grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf); + +static grub_err_t +grub_nand_open (const char *name, grub_disk_t disk) +{ + grub_ieee1275_ihandle_t dev_ihandle = 0; + struct grub_nand_data *data = 0; + struct size_args + { + struct grub_ieee1275_common_hdr common; + char *method; + grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t result; + grub_ieee1275_cell_t size1; + grub_ieee1275_cell_t size2; + } args; + + if (! grub_strstr (name, "nand")) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Not a nand device"); + + data = grub_malloc (sizeof (*data)); + if (! data) + goto fail; + + grub_ieee1275_open (name, &dev_ihandle); + if (! dev_ihandle) + { + grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device"); + goto fail; + } + + data->handle = dev_ihandle; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 2); + args.method = "block-size"; + args.ihandle = dev_ihandle; + args.result = 1; + + if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) + { + grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't get block size"); + goto fail; + } + + data->block_size = (args.size1 >> GRUB_DISK_SECTOR_BITS); + + INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3); + args.method = "size"; + args.ihandle = dev_ihandle; + args.result = 1; + + if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) + { + grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't get disk size"); + goto fail; + } + + disk->total_sectors = args.size1; + disk->total_sectors <<= 32; + disk->total_sectors += args.size2; + disk->total_sectors >>= GRUB_DISK_SECTOR_BITS; + + disk->id = dev_ihandle; + + disk->has_partitions = 0; + disk->data = data; + + return 0; + +fail: + if (dev_ihandle) + grub_ieee1275_close (dev_ihandle); + grub_free (data); + return grub_errno; +} + +static void +grub_nand_close (grub_disk_t disk) +{ + grub_ieee1275_close (((struct grub_nand_data *) disk->data)->handle); + grub_free (disk->data); +} + +static grub_err_t +grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + struct grub_nand_data *data = disk->data; + grub_size_t bsize, ofs; + + struct read_args + { + struct grub_ieee1275_common_hdr common; + char *method; + grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t ofs; + grub_ieee1275_cell_t page; + grub_ieee1275_cell_t len; + grub_ieee1275_cell_t buf; + grub_ieee1275_cell_t result; + } args; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); + args.method = "pio-read"; + args.ihandle = data->handle; + args.buf = (grub_ieee1275_cell_t) buf; + args.page = (grub_ieee1275_cell_t) ((grub_size_t) sector / data->block_size); + + ofs = ((grub_size_t) sector % data->block_size) << GRUB_DISK_SECTOR_BITS; + size <<= GRUB_DISK_SECTOR_BITS; + bsize = (data->block_size << GRUB_DISK_SECTOR_BITS); + + do + { + grub_size_t len; + + len = (ofs + size > bsize) ? (bsize - ofs) : size; + + args.len = (grub_ieee1275_cell_t) len; + args.ofs = (grub_ieee1275_cell_t) ofs; + args.result = 1; + + if ((IEEE1275_CALL_ENTRY_FN (&args) == -1) || (args.result)) + return grub_error (GRUB_ERR_READ_ERROR, "Read error"); + + ofs = 0; + size -= len; + args.buf += len; + args.page++; + } while (size); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_nand_write (grub_disk_t disk __attribute ((unused)), + grub_disk_addr_t sector __attribute ((unused)), + grub_size_t size __attribute ((unused)), + const char *buf __attribute ((unused))) +{ + return GRUB_ERR_NOT_IMPLEMENTED_YET; +} + +static struct grub_disk_dev grub_nand_dev = + { + .name = "nand", + .id = GRUB_DISK_DEVICE_NAND_ID, + .iterate = grub_nand_iterate, + .open = grub_nand_open, + .close = grub_nand_close, + .read = grub_nand_read, + .write = grub_nand_write, + .next = 0 + }; + +GRUB_MOD_INIT(nand) +{ + grub_disk_dev_register (&grub_nand_dev); +} + +GRUB_MOD_FINI(nand) +{ + grub_disk_dev_unregister (&grub_nand_dev); +} diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index d86d95327..431ed96d5 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -109,7 +109,7 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) if (grub_ieee1275_get_property (dev, "device_type", prop, sizeof (prop), &actual)) { - grub_error (GRUB_ERR_BAD_DEVICE, "Can't read the device type"); + grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't read the device type"); goto fail; } diff --git a/include/grub/disk.h b/include/grub/disk.h index 2a79a0bff..3178203c0 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -37,6 +37,7 @@ enum grub_disk_dev_id GRUB_DISK_DEVICE_HOST_ID, GRUB_DISK_DEVICE_ATA_ID, GRUB_DISK_DEVICE_MEMDISK_ID, + GRUB_DISK_DEVICE_NAND_ID, }; struct grub_disk; diff --git a/include/grub/i386/ieee1275/loader.h b/include/grub/i386/ieee1275/loader.h index 2937bb082..942242b76 100644 --- a/include/grub/i386/ieee1275/loader.h +++ b/include/grub/i386/ieee1275/loader.h @@ -27,4 +27,7 @@ void EXPORT_FUNC(grub_multiboot2_real_boot) (grub_addr_t entry, struct grub_multiboot_info *mbi) __attribute__ ((noreturn)); +void grub_rescue_cmd_linux (int argc, char *argv[]); +void grub_rescue_cmd_initrd (int argc, char *argv[]); + #endif /* ! GRUB_LOADER_MACHINE_HEADER */ diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 444e57fda..7a8e006de 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -47,6 +47,9 @@ #define GRUB_LINUX_EFI_SIGNATURE \ ('E' << 24 | 'F' << 16 | 'I' << 8 | 'L') +#define GRUB_LINUX_OFW_SIGNATURE \ + (' ' << 24 | 'W' << 16 | 'F' << 8 | 'O') + #ifndef ASM_FILE /* For the Linux/i386 boot protocol version 2.03. */ @@ -154,7 +157,14 @@ struct linux_kernel_params grub_uint8_t hd1_drive_info[0x10]; /* 90 */ grub_uint16_t rom_config_len; /* a0 */ - grub_uint8_t padding6[0x1c0 - 0xa2]; + grub_uint8_t padding6[0xb0 - 0xa2]; + + grub_uint32_t ofw_signature; /* b0 */ + grub_uint32_t ofw_num_items; /* b4 */ + grub_uint32_t ofw_cif_handler; /* b8 */ + grub_uint32_t ofw_idt; /* bc */ + + grub_uint8_t padding7[0x1c0 - 0xc0]; grub_uint32_t efi_signature; /* 1c0 */ grub_uint32_t efi_system_table; /* 1c4 */ @@ -163,15 +173,15 @@ struct linux_kernel_params grub_uint32_t efi_mmap; /* 1d0 */ grub_uint32_t efi_mmap_size; /* 1d4 */ - grub_uint8_t padding7[0x1e0 - 0x1d8]; + grub_uint8_t padding8[0x1e0 - 0x1d8]; grub_uint32_t alt_mem; /* 1e0 */ - grub_uint8_t padding8[0x1e8 - 0x1e4]; + grub_uint8_t padding9[0x1e8 - 0x1e4]; grub_uint32_t mmap_size; /* 1e8 */ - grub_uint8_t padding9[0x1ff - 0x1ec]; + grub_uint8_t padding10[0x1ff - 0x1ec]; grub_uint8_t ps_mouse; /* 1ff */ } __attribute__ ((packed)); diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index 71132b020..a3e3ed793 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -76,11 +76,14 @@ /* The data segment of the pseudo real mode. */ #define GRUB_MEMORY_MACHINE_PSEUDO_REAL_DSEG 0x20 -#ifndef GRUB_MACHINE_IEEE1275 #ifndef ASM_FILE + +#ifndef GRUB_MACHINE_IEEE1275 extern grub_size_t EXPORT_VAR(grub_lower_mem); -extern grub_size_t EXPORT_VAR(grub_upper_mem); #endif + +extern grub_size_t EXPORT_VAR(grub_upper_mem); + #endif #endif /* ! GRUB_MEMORY_MACHINE_HEADER */ diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index eef08c395..5c06025ca 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -159,7 +159,7 @@ grub_err_t EXPORT_FUNC(grub_devalias_iterate) grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath, int (*hook) (struct grub_ieee1275_devalias *alias)); grub_err_t EXPORT_FUNC(grub_available_iterate) - (int (*hook) (grub_uint64_t, grub_uint64_t)); + (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t)); int EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size); char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path); diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index 94a40b2eb..b8f414b1d 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -128,8 +128,8 @@ static void grub_claim_heap (void) { unsigned long total = 0; - auto int heap_init (grub_uint64_t addr, grub_uint64_t len); - int heap_init (grub_uint64_t addr, grub_uint64_t len) + auto int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t len); + int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t len) { len -= 1; /* Required for some firmware. */ @@ -174,6 +174,31 @@ static void grub_claim_heap (void) grub_available_iterate (heap_init); } +#ifdef __i386__ + +grub_uint32_t grub_upper_mem; + +/* We need to call this before grub_claim_memory. */ +static void +grub_get_extended_memory (void) +{ + auto int NESTED_FUNC_ATTR find_ext_mem (grub_uint64_t addr, grub_uint64_t len); + int NESTED_FUNC_ATTR find_ext_mem (grub_uint64_t addr, grub_uint64_t len) + { + if (addr == 0x100000) + { + grub_upper_mem = len; + return 1; + } + + return 0; + } + + grub_available_iterate (find_ext_mem); +} + +#endif + void grub_machine_init (void) { @@ -184,6 +209,7 @@ grub_machine_init (void) grub_console_init (); #ifdef __i386__ + grub_get_extended_memory (); grub_keyboard_controller_init (); #endif grub_claim_heap (); diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index 69164a627..ac97a5920 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -131,8 +131,8 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) if (grub_ieee1275_get_property (dev, "device_type", devtype, sizeof devtype, &actual)) { - grub_dprintf ("devalias", "get device type failed\n"); - goto nextprop; + /* NAND device don't have device_type property. */ + devtype[0] = 0; } alias.name = aliasname; @@ -147,7 +147,7 @@ nextprop: return 0; } -grub_err_t grub_available_iterate (int (*hook) (grub_uint64_t, grub_uint64_t)) +grub_err_t grub_available_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t)) { grub_ieee1275_phandle_t root; grub_ieee1275_phandle_t memory; diff --git a/loader/i386/ieee1275/linux.c b/loader/i386/ieee1275/linux.c new file mode 100644 index 000000000..bc4567e69 --- /dev/null +++ b/loader/i386/ieee1275/linux.c @@ -0,0 +1,289 @@ +/* linux.c - boot Linux zImage or bzImage */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define GRUB_OFW_LINUX_PARAMS_ADDR 0x90000 +#define GRUB_OFW_LINUX_KERNEL_ADDR 0x100000 +#define GRUB_OFW_LINUX_INITRD_ADDR 0x800000 + +#define GRUB_OFW_LINUX_CL_OFFSET 0x1e00 +#define GRUB_OFW_LINUX_CL_LENGTH 0x100 + +static grub_dl_t my_mod; + +static grub_size_t kernel_size; +static char *kernel_addr, *kernel_cmdline; +static grub_size_t initrd_size; + +static grub_err_t +grub_linux_unload (void) +{ + grub_free (kernel_cmdline); + grub_free (kernel_addr); + kernel_cmdline = 0; + kernel_addr = 0; + initrd_size = 0; + + grub_dl_unref (my_mod); + + return GRUB_ERR_NONE; +} + +/* +static int +grub_ieee1275_debug (void) +{ + struct enter_args + { + struct grub_ieee1275_common_hdr common; + } + args; + + INIT_IEEE1275_COMMON (&args.common, "enter", 0, 0); + + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) + return -1; + + return 0; +} +*/ + +static void +grub_set_bootpath (void) +{ + +} + +static grub_err_t +grub_linux_boot (void) +{ + struct linux_kernel_params *params; + struct linux_kernel_header *lh; + char *prot_code; + char *bootpath; + grub_ssize_t len; + + bootpath = grub_env_get ("root"); + if (bootpath) + grub_ieee1275_set_property (grub_ieee1275_chosen, + "bootpath", bootpath, + grub_strlen (bootpath) + 1, + &len); + + params = (struct linux_kernel_params *) GRUB_OFW_LINUX_PARAMS_ADDR; + lh = (struct linux_kernel_header *) params; + + grub_memset ((char *) params, 0, GRUB_OFW_LINUX_CL_OFFSET); + + params->alt_mem = grub_upper_mem >> 10; + params->ext_mem = params->alt_mem; + + lh->cmd_line_ptr = (char *) + (GRUB_OFW_LINUX_PARAMS_ADDR + GRUB_OFW_LINUX_CL_OFFSET); + + params->cl_magic = GRUB_LINUX_CL_MAGIC; + params->cl_offset = GRUB_OFW_LINUX_CL_OFFSET; + + params->video_width = (grub_getwh () >> 8); + params->video_height = (grub_getwh () & 0xff); + params->font_size = 16; + + params->ofw_signature = GRUB_LINUX_OFW_SIGNATURE; + params->ofw_num_items = 1; + params->ofw_cif_handler = (grub_uint32_t) grub_ieee1275_entry_fn; + params->ofw_idt = 0; + + if (initrd_size) + { + lh->type_of_loader = 1; + lh->ramdisk_image = GRUB_OFW_LINUX_INITRD_ADDR; + lh->ramdisk_size = initrd_size; + } + + if (kernel_cmdline) + grub_strcpy (lh->cmd_line_ptr, kernel_cmdline); + + prot_code = (char *) GRUB_OFW_LINUX_KERNEL_ADDR; + grub_memcpy (prot_code, kernel_addr, kernel_size); + + asm volatile ("movl %0, %%esi" : : "m" (params)); + asm volatile ("movl %%esi, %%esp" : : ); + asm volatile ("movl %0, %%ecx" : : "m" (prot_code)); + asm volatile ("xorl %%ebx, %%ebx" : : ); + asm volatile ("jmp *%%ecx" : : ); + + return GRUB_ERR_NONE; +} + +void +grub_rescue_cmd_linux (int argc, char *argv[]) +{ + grub_file_t file = 0; + struct linux_kernel_header lh; + grub_uint8_t setup_sects; + grub_size_t real_size, prot_size; + int i; + char *dest; + + grub_dl_ref (my_mod); + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); + goto fail; + } + + file = grub_file_open (argv[0]); + if (! file) + goto fail; + + if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh)) + { + grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header"); + goto fail; + } + + if ((lh.boot_flag != grub_cpu_to_le16 (0xaa55)) || + (lh.header != grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE))) + { + grub_error (GRUB_ERR_BAD_OS, "invalid magic number"); + goto fail; + } + + setup_sects = lh.setup_sects; + if (! setup_sects) + setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; + + real_size = setup_sects << GRUB_DISK_SECTOR_BITS; + prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE; + + grub_printf (" [Linux-%s, setup=0x%x, size=0x%x]\n", + "bzImage", real_size, prot_size); + + grub_file_seek (file, real_size + GRUB_DISK_SECTOR_SIZE); + if (grub_errno) + goto fail; + + kernel_cmdline = grub_malloc (GRUB_OFW_LINUX_CL_LENGTH); + if (! kernel_cmdline) + goto fail; + + dest = kernel_cmdline; + for (i = 1; + i < argc + && dest + grub_strlen (argv[i]) + 1 < (kernel_cmdline + + GRUB_OFW_LINUX_CL_LENGTH); + i++) + { + *dest++ = ' '; + dest = grub_stpcpy (dest, argv[i]); + } + + kernel_addr = grub_malloc (prot_size); + if (! kernel_addr) + goto fail; + + kernel_size = prot_size; + if (grub_file_read (file, kernel_addr, prot_size) != (int) prot_size) + grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); + + if (grub_errno == GRUB_ERR_NONE) + grub_loader_set (grub_linux_boot, grub_linux_unload, 1); + +fail: + + if (file) + grub_file_close (file); + + if (grub_errno != GRUB_ERR_NONE) + { + grub_free (kernel_cmdline); + grub_free (kernel_addr); + kernel_cmdline = 0; + kernel_addr = 0; + + grub_dl_unref (my_mod); + } +} + +void +grub_rescue_cmd_initrd (int argc, char *argv[]) +{ + grub_file_t file = 0; + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified"); + goto fail; + } + + if (! kernel_addr) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first."); + goto fail; + } + + file = grub_file_open (argv[0]); + if (! file) + goto fail; + + initrd_size = grub_file_size (file); + if (grub_file_read (file, (char *) GRUB_OFW_LINUX_INITRD_ADDR, + initrd_size) != (int) initrd_size) + { + grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); + goto fail; + } + +fail: + if (file) + grub_file_close (file); +} + +GRUB_MOD_INIT(linux) +{ + grub_rescue_register_command ("linux", + grub_rescue_cmd_linux, + "load linux"); + grub_rescue_register_command ("initrd", + grub_rescue_cmd_initrd, + "load initrd"); + my_mod = mod; +} + +GRUB_MOD_FINI(linux) +{ + grub_rescue_unregister_command ("linux"); + grub_rescue_unregister_command ("initrd"); +} diff --git a/loader/i386/ieee1275/linux_normal.c b/loader/i386/ieee1275/linux_normal.c new file mode 100644 index 000000000..0206f76d7 --- /dev/null +++ b/loader/i386/ieee1275/linux_normal.c @@ -0,0 +1,60 @@ +/* linux_normal.c - boot another boot loader */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2004,2005,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +static grub_err_t +grub_normal_linux_command (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + grub_rescue_cmd_linux (argc, args); + return grub_errno; +} + + +static grub_err_t +grub_normal_initrd_command (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + grub_rescue_cmd_initrd (argc, args); + return grub_errno; +} + +GRUB_MOD_INIT(linux_normal) +{ + (void) mod; /* To stop warning. */ + grub_register_command ("linux", grub_normal_linux_command, + GRUB_COMMAND_FLAG_BOTH, + "linux FILE [ARGS...]", + "Load a linux kernel.", 0); + + grub_register_command ("initrd", grub_normal_initrd_command, + GRUB_COMMAND_FLAG_BOTH, + "initrd FILE", + "Load an initrd.", 0); +} + +GRUB_MOD_FINI(linux_normal) +{ + grub_unregister_command ("linux"); + grub_unregister_command ("initrd"); +} diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index b44950749..faf62bf66 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -84,7 +84,10 @@ grub_ofconsole_putchar (grub_uint32_t c) { grub_curr_x++; if (grub_curr_x > grub_ofconsole_width) - grub_putcode ('\n'); + { + grub_putcode ('\n'); + grub_curr_x++; + } } grub_ieee1275_write (stdout_ihandle, &chr, 1, 0); } From f4b1fc0217a985c756f6dbabc01d9d9278314546 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 26 Apr 2008 17:55:41 +0000 Subject: [PATCH 0117/1707] 2008-04-26 Robert Millan * DISTLIST: Sort (sort -u < DISTLIST | sponge DISTLIST). --- ChangeLog | 4 + DISTLIST | 281 +++++++++++++++++++++++++++--------------------------- 2 files changed, 144 insertions(+), 141 deletions(-) diff --git a/ChangeLog b/ChangeLog index 58a9b93d6..529c5532b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-26 Robert Millan + + * DISTLIST: Sort (sort -u < DISTLIST | sponge DISTLIST). + 2008-04-25 Bean * Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and diff --git a/DISTLIST b/DISTLIST index 584561a89..105d98bf1 100644 --- a/DISTLIST +++ b/DISTLIST @@ -1,42 +1,15 @@ -AUTHORS -COPYING -ChangeLog -DISTLIST -INSTALL -NEWS -README -THANKS -TODO -Makefile.in aclocal.m4 +AUTHORS autogen.sh -config.guess -config.h.in -config.sub -configure -configure.ac -gencmdlist.sh -gendistlist.sh -genfslist.sh -geninitheader.sh -geninit.sh -genkernsyms.sh.in -genmk.rb -genmoddep.awk -genmodsrc.sh -genpartmaplist.sh -gensymlist.sh.in -install-sh -mkinstalldirs -stamp-h.in boot/i386/pc/boot.S boot/i386/pc/cdboot.S boot/i386/pc/diskboot.S boot/i386/pc/lnxboot.S boot/i386/pc/pxeboot.S bus/pci.c -commands/boot.c +ChangeLog commands/blocklist.c +commands/boot.c commands/cat.c commands/cmp.c commands/configfile.c @@ -44,6 +17,13 @@ commands/echo.c commands/halt.c commands/help.c commands/hexdump.c +commands/i386/cpuid.c +commands/i386/pc/halt.c +commands/i386/pc/play.c +commands/i386/pc/reboot.c +commands/i386/pc/vbeinfo.c +commands/i386/pc/vbetest.c +commands/ieee1275/suspend.c commands/ls.c commands/lspci.c commands/read.c @@ -53,34 +33,34 @@ commands/sleep.c commands/terminal.c commands/test.c commands/videotest.c -commands/i386/cpuid.c -commands/i386/pc/halt.c -commands/i386/pc/play.c -commands/i386/pc/reboot.c -commands/i386/pc/vbeinfo.c -commands/i386/pc/vbetest.c -commands/ieee1275/suspend.c conf/common.mk conf/common.rmk conf/i386-efi.mk conf/i386-efi.rmk -conf/i386-linuxbios.rmk conf/i386-linuxbios.mk +conf/i386-linuxbios.rmk conf/i386-pc.mk conf/i386-pc.rmk +config.guess +config.h.in +config.sub +configure +configure.ac conf/powerpc-ieee1275.mk conf/powerpc-ieee1275.rmk conf/sparc64-ieee1275.mk conf/sparc64-ieee1275.rmk +COPYING disk/ata.c +disk/efi/efidisk.c disk/host.c +disk/i386/pc/biosdisk.c +disk/ieee1275/ofdisk.c disk/loopback.c disk/lvm.c disk/memdisk.c disk/raid.c -disk/efi/efidisk.c -disk/i386/pc/biosdisk.c -disk/ieee1275/ofdisk.c +DISTLIST docs/fdl.texi docs/grub.texi docs/mdate-sh @@ -102,9 +82,18 @@ fs/reiserfs.c fs/sfs.c fs/ufs.c fs/xfs.c +gencmdlist.sh +gendistlist.sh +genfslist.sh +geninitheader.sh +geninit.sh +genkernsyms.sh.in +genmk.rb +genmoddep.awk +genmodsrc.sh +genpartmaplist.sh +gensymlist.sh.in hello/hello.c -include/multiboot.h -include/multiboot2.h include/grub/acorn_filecore.h include/grub/arg.h include/grub/bitmap.h @@ -113,6 +102,14 @@ include/grub/cache.h include/grub/device.h include/grub/disk.h include/grub/dl.h +include/grub/efi/api.h +include/grub/efi/chainloader.h +include/grub/efi/console_control.h +include/grub/efi/console.h +include/grub/efi/disk.h +include/grub/efi/efi.h +include/grub/efi/pe32.h +include/grub/efi/time.h include/grub/elf.h include/grub/elfload.h include/grub/env.h @@ -125,44 +122,6 @@ include/grub/gpt_partition.h include/grub/gzio.h include/grub/hexdump.h include/grub/hfs.h -include/grub/kernel.h -include/grub/loader.h -include/grub/lvm.h -include/grub/misc.h -include/grub/mm.h -include/grub/multiboot.h -include/grub/multiboot_loader.h -include/grub/multiboot2.h -include/grub/net.h -include/grub/normal.h -include/grub/ntfs.h -include/grub/parser.h -include/grub/partition.h -include/grub/pc_partition.h -include/grub/pci.h -include/grub/raid.h -include/grub/rescue.h -include/grub/script.h -include/grub/setjmp.h -include/grub/symbol.h -include/grub/term.h -include/grub/terminfo.h -include/grub/tparm.h -include/grub/types.h -include/grub/video.h -include/grub/efi/api.h -include/grub/efi/chainloader.h -include/grub/efi/console.h -include/grub/efi/console_control.h -include/grub/efi/disk.h -include/grub/efi/efi.h -include/grub/efi/pe32.h -include/grub/efi/time.h -include/grub/i386/linux.h -include/grub/i386/loader.h -include/grub/i386/setjmp.h -include/grub/i386/time.h -include/grub/i386/types.h include/grub/i386/efi/kernel.h include/grub/i386/efi/loader.h include/grub/i386/efi/time.h @@ -179,6 +138,8 @@ include/grub/i386/linuxbios/loader.h include/grub/i386/linuxbios/memory.h include/grub/i386/linuxbios/serial.h include/grub/i386/linuxbios/time.h +include/grub/i386/linux.h +include/grub/i386/loader.h include/grub/i386/pc/biosdisk.h include/grub/i386/pc/boot.h include/grub/i386/pc/chainloader.h @@ -191,17 +152,31 @@ include/grub/i386/pc/memory.h include/grub/i386/pc/pci.h include/grub/i386/pc/serial.h include/grub/i386/pc/time.h -include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeblit.h include/grub/i386/pc/vbefill.h +include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeutil.h include/grub/i386/pc/vga.h +include/grub/i386/setjmp.h +include/grub/i386/time.h +include/grub/i386/types.h include/grub/ieee1275/ieee1275.h include/grub/ieee1275/ofdisk.h -include/grub/powerpc/libgcc.h -include/grub/powerpc/setjmp.h -include/grub/powerpc/time.h -include/grub/powerpc/types.h +include/grub/kernel.h +include/grub/loader.h +include/grub/lvm.h +include/grub/misc.h +include/grub/mm.h +include/grub/multiboot2.h +include/grub/multiboot.h +include/grub/multiboot_loader.h +include/grub/net.h +include/grub/normal.h +include/grub/ntfs.h +include/grub/parser.h +include/grub/partition.h +include/grub/pci.h +include/grub/pc_partition.h include/grub/powerpc/ieee1275/biosdisk.h include/grub/powerpc/ieee1275/console.h include/grub/powerpc/ieee1275/ieee1275.h @@ -209,68 +184,80 @@ include/grub/powerpc/ieee1275/kernel.h include/grub/powerpc/ieee1275/loader.h include/grub/powerpc/ieee1275/time.h include/grub/powerpc/ieee1275/util/biosdisk.h -include/grub/sparc64/setjmp.h -include/grub/sparc64/time.h -include/grub/sparc64/types.h +include/grub/powerpc/libgcc.h +include/grub/powerpc/setjmp.h +include/grub/powerpc/time.h +include/grub/powerpc/types.h +include/grub/raid.h +include/grub/rescue.h +include/grub/script.h +include/grub/setjmp.h include/grub/sparc64/ieee1275/console.h include/grub/sparc64/ieee1275/ieee1275.h include/grub/sparc64/ieee1275/kernel.h include/grub/sparc64/ieee1275/time.h +include/grub/sparc64/setjmp.h +include/grub/sparc64/time.h +include/grub/sparc64/types.h +include/grub/symbol.h +include/grub/term.h +include/grub/terminfo.h include/grub/time.h +include/grub/tparm.h +include/grub/types.h include/grub/util/biosdisk.h include/grub/util/getroot.h include/grub/util/lvm.h include/grub/util/misc.h include/grub/util/raid.h include/grub/util/resolve.h +include/grub/video.h +include/multiboot2.h +include/multiboot.h +INSTALL +install-sh io/gzio.c kern/device.c kern/disk.c kern/dl.c +kern/efi/efi.c +kern/efi/init.c +kern/efi/mm.c kern/elf.c kern/env.c kern/err.c kern/file.c kern/fs.c +kern/i386/dl.c +kern/i386/efi/init.c +kern/i386/efi/startup.S +kern/i386/linuxbios/init.c +kern/i386/linuxbios/startup.S +kern/i386/linuxbios/table.c +kern/i386/loader.S +kern/i386/pc/init.c +kern/i386/pc/lzo1x.S +kern/i386/pc/startup.S +kern/i386/realmode.S +kern/ieee1275/cmain.c +kern/ieee1275/ieee1275.c +kern/ieee1275/init.c +kern/ieee1275/openfw.c kern/loader.c kern/main.c kern/misc.c kern/mm.c kern/parser.c kern/partition.c -kern/rescue.c -kern/term.c -kern/efi/init.c -kern/efi/efi.c -kern/efi/mm.c -kern/i386/dl.c -kern/i386/efi/init.c -kern/i386/efi/startup.S -kern/i386/loader.S -kern/i386/linuxbios/init.c -kern/i386/linuxbios/startup.S -kern/i386/linuxbios/table.c -term/i386/pc/at_keyboard.c -kern/i386/pc/init.c -kern/i386/pc/lzo1x.S -kern/i386/pc/startup.S -term/i386/pc/vga_text.c -kern/i386/realmode.S kern/powerpc/cache.S kern/powerpc/dl.c kern/powerpc/ieee1275/crt0.S -kern/ieee1275/ieee1275.c -kern/ieee1275/cmain.c -kern/ieee1275/init.c -kern/ieee1275/openfw.c -kern/ieee1275/ieee1275.c +kern/rescue.c kern/sparc64/cache.S kern/sparc64/dl.c kern/sparc64/ieee1275/init.c kern/sparc64/ieee1275/openfw.c -loader/multiboot_loader.c -loader/multiboot_loader_normal.c -loader/multiboot2.c +kern/term.c loader/efi/chainloader.c loader/efi/chainloader_normal.c loader/i386/efi/linux.c @@ -279,81 +266,93 @@ loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c loader/i386/pc/linux_normal.c +loader/i386/pc/multiboot2.c loader/i386/pc/multiboot.c loader/i386/pc/multiboot_normal.c -loader/i386/pc/multiboot2.c +loader/ieee1275/multiboot2.c +loader/multiboot2.c +loader/multiboot_loader.c +loader/multiboot_loader_normal.c loader/powerpc/ieee1275/linux.c loader/powerpc/ieee1275/linux_normal.c -loader/ieee1275/multiboot2.c +Makefile.in +mkinstalldirs +NEWS normal/arg.c -normal/color.c normal/cmdline.c +normal/color.c normal/command.c normal/completion.c normal/execute.c normal/function.c +normal/i386/setjmp.S normal/lexer.c normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c normal/parser.y -normal/script.c -normal/i386/setjmp.S normal/powerpc/setjmp.S +normal/script.c partmap/acorn.c partmap/amiga.c partmap/apple.c partmap/gpt.c partmap/pc.c partmap/sun.c -term/terminfo.c -term/tparm.c -term/gfxterm.c +README +stamp-h.in term/efi/console.c +term/gfxterm.c +term/i386/pc/at_keyboard.c term/i386/pc/console.c term/i386/pc/serial.c term/i386/pc/vesafb.c term/i386/pc/vga.c +term/i386/pc/vga_text.c term/ieee1275/ofconsole.c +term/terminfo.c +term/tparm.c +THANKS +TODO util/biosdisk.c util/console.c +util/elf/grub-mkimage.c util/getroot.c -util/grub-emu.c -util/grub-mkdevicemap.c -util/grub-probe.c -util/hostfs.c -util/lvm.c -util/misc.c -util/raid.c -util/resolve.c -util/unifont2pff.rb -util/update-grub.in -util/update-grub_lib.in util/grub.d/00_header.in util/grub.d/10_hurd.in util/grub.d/10_linux.in util/grub.d/30_os-prober.in util/grub.d/README -util/elf/grub-mkimage.c +util/grub-emu.c +util/grub-mkdevicemap.c +util/grub-probe.c +util/hostfs.c util/i386/efi/grub-install.in util/i386/efi/grub-mkimage.c util/i386/get_disk_name.c util/i386/pc/grub-install.in util/i386/pc/grub-mkimage.c +util/i386/pc/grub-mkrescue.in util/i386/pc/grub-setup.c util/i386/pc/misc.c -util/i386/pc/grub-mkrescue.in util/ieee1275/get_disk_name.c +util/lvm.c +util/misc.c util/powerpc/ieee1275/grub-install.in util/powerpc/ieee1275/grub-mkrescue.in util/powerpc/ieee1275/misc.c +util/raid.c +util/resolve.c +util/unifont2pff.rb +util/update-grub.in +util/update-grub_lib.in video/bitmap.c -video/video.c -video/i386/pc/vbe.c video/i386/pc/vbeblit.c +video/i386/pc/vbe.c video/i386/pc/vbefill.c -video/readers/jpeg.c -video/readers/tga.c -video/readers/png.c video/i386/pc/vbeutil.c +video/readers/jpeg.c +video/readers/png.c +video/readers/tga.c +video/video.c From 329ce2a5f573cf1a7c5f51ae816395db28303e7b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 26 Apr 2008 17:57:56 +0000 Subject: [PATCH 0118/1707] 2008-04-26 Robert Millan * DISTLIST: Sort (sort -u < DISTLIST | sponge DISTLIST). Add `loader/i386/ieee1275/linux.c', `loader/i386/ieee1275/linux_normal.c' and `disk/ieee1275/nand.c'. --- ChangeLog | 4 +++- DISTLIST | 3 +++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 529c5532b..aaf05dc8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,8 @@ 2008-04-26 Robert Millan - * DISTLIST: Sort (sort -u < DISTLIST | sponge DISTLIST). + * DISTLIST: Sort (sort -u < DISTLIST | sponge DISTLIST). Add + `loader/i386/ieee1275/linux.c', `loader/i386/ieee1275/linux_normal.c' + and `disk/ieee1275/nand.c'. 2008-04-25 Bean diff --git a/DISTLIST b/DISTLIST index 105d98bf1..a36377ad2 100644 --- a/DISTLIST +++ b/DISTLIST @@ -55,6 +55,7 @@ disk/ata.c disk/efi/efidisk.c disk/host.c disk/i386/pc/biosdisk.c +disk/ieee1275/nand.c disk/ieee1275/ofdisk.c disk/loopback.c disk/lvm.c @@ -262,6 +263,8 @@ loader/efi/chainloader.c loader/efi/chainloader_normal.c loader/i386/efi/linux.c loader/i386/efi/linux_normal.c +loader/i386/ieee1275/linux.c +loader/i386/ieee1275/linux_normal.c loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c From 094c01d09c95ee83978352b855c4f684de8e13d0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 29 Apr 2008 12:17:33 +0000 Subject: [PATCH 0119/1707] 2008-04-29 Robert Millan * docs/grub.cfg: New file (example GRUB configuration). --- ChangeLog | 4 +++ DISTLIST | 1 + docs/grub.cfg | 69 +++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 74 insertions(+) create mode 100644 docs/grub.cfg diff --git a/ChangeLog b/ChangeLog index aaf05dc8f..ba434cab2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-04-29 Robert Millan + + * docs/grub.cfg: New file (example GRUB configuration). + 2008-04-26 Robert Millan * DISTLIST: Sort (sort -u < DISTLIST | sponge DISTLIST). Add diff --git a/DISTLIST b/DISTLIST index a36377ad2..b2f5f832b 100644 --- a/DISTLIST +++ b/DISTLIST @@ -63,6 +63,7 @@ disk/memdisk.c disk/raid.c DISTLIST docs/fdl.texi +docs/grub.cfg docs/grub.texi docs/mdate-sh docs/texinfo.tex diff --git a/docs/grub.cfg b/docs/grub.cfg new file mode 100644 index 000000000..506515c8d --- /dev/null +++ b/docs/grub.cfg @@ -0,0 +1,69 @@ +# +# Sample GRUB configuration file +# + +# Boot automatically after 30 secs. +set timeout=30 + +# By default, boot the first entry. +set default=0 + +# Fallback to the second entry. +set fallback=1 + +# For booting GNU/Hurd +menuentry "GNU (aka GNU/Hurd)" { + set root=(hd0,1) + multiboot /boot/gnumach.gz root=device:/dev/sda1 + module /hurd/ext2fs.static --readonly \ + --multiboot-command-line='${kernel-command-line}' \ + --host-priv-port='${host-port}' \ + --device-master-port='${device-port}' \ + --exec-server-task='${exec-task}' -T typed '${root}' \ + '$(task-create)' '$(task-resume)' + module /lib/ld.so.1 /hurd/exec '$(exec-task=task-create)' +} + +# For booting GNU/Linux +menuentry "GNU/Linux" { + set root=(hd0,1) + linux /vmlinuz root=/dev/sda1 + initrd /initrd.img +} + +# For booting FreeBSD +menuentry "FreeBSD (or GNU/kFreeBSD), direct boot" { + set root=(hd0,1,a) + freebsd /boot/kernel/kernel + freebsd_loadenv /boot/device.hints + freebsd_module /boot/splash.bmp type=splash_image_data + set FreeBSD.vfs.root.mountfrom=ufs:ad0s1a +} +menuentry "FreeBSD (or GNU/kFreeBSD), via /boot/loader" { + set root=(hd0,1,a) + freebsd /boot/loader +} + +# For booting NetBSD +menuentry "NetBSD" { + set root=(hd0,1,a) + netbsd /netbsd +} + +# For booting OpenBSD +menuentry "OpenBSD" { + set root=(hd0,1,a) + openbsd /bsd +} + +# For booting Microsoft Windows +menuentry "Microsoft Windows" { + set root=(hd0,1) + chainloader +1 +} + +# Change the colors. +menuentry "Change the colors" { + set menu_color_normal=light-green/brown + set menu_color_highlight=red/blue +} From 8124cdb77e131a0c3b649eb88e92939a05d82680 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 30 Apr 2008 11:06:27 +0000 Subject: [PATCH 0120/1707] 2008-04-30 Robert Millan Based on patch from Fabian Greffrath * util/grub.d/10_linux.in: Add ${GRUB_CMDLINE_LINUX_DEFAULT} to the first boot option. * util/update-grub.in: Export GRUB_CMDLINE_LINUX_DEFAULT. --- ChangeLog | 7 +++++++ util/grub.d/10_linux.in | 2 +- util/update-grub.in | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba434cab2..90a4284e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-04-30 Robert Millan + + Based on patch from Fabian Greffrath + * util/grub.d/10_linux.in: Add ${GRUB_CMDLINE_LINUX_DEFAULT} to the + first boot option. + * util/update-grub.in: Export GRUB_CMDLINE_LINUX_DEFAULT. + 2008-04-29 Robert Millan * docs/grub.cfg: New file (example GRUB configuration). diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 876d929e7..cd9ff13b5 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -105,7 +105,7 @@ while [ "x$list" != "x" ] ; do cat << EOF menuentry "${OS}, linux ${version}" { - linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX} + linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} EOF if test -n "${initrd}" ; then cat << EOF diff --git a/util/update-grub.in b/util/update-grub.in index 6037b13d8..cb38610f3 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -158,7 +158,7 @@ esac export GRUB_DEVICE GRUB_FS GRUB_DRIVE GRUB_DRIVE_BOOT GRUB_DRIVE_BOOT_GRUB GRUB_FONT_PATH GRUB_PRELOAD_MODULES # These are optional, user-defined variables. -export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_TERMINAL GRUB_SERIAL_COMMAND +export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND exec > ${grub_cfg}.new chmod 444 ${grub_cfg}.new From 0fbb311786e9f6392ea7d49f36f4f9589f2c71ba Mon Sep 17 00:00:00 2001 From: chrfranke Date: Mon, 5 May 2008 20:58:53 +0000 Subject: [PATCH 0121/1707] 2008-05-05 Christian Franke * util/grub-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]: Add Cygwin device names. (get_ide_disk_name) [__CYGWIN__]: Likewise. (get_scsi_disk_name) [__CYGWIN__]: Likewise. (check_device): Return error instead of success on empty name. (make_device_map): Move label inside linux specific code to prevent compiler warning. --- ChangeLog | 10 ++++++++++ util/grub-mkdevicemap.c | 17 ++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90a4284e6..640ed6fa6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-05-05 Christian Franke + + * util/grub-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]: + Add Cygwin device names. + (get_ide_disk_name) [__CYGWIN__]: Likewise. + (get_scsi_disk_name) [__CYGWIN__]: Likewise. + (check_device): Return error instead of success on empty name. + (make_device_map): Move label inside linux specific code to + prevent compiler warning. + 2008-04-30 Robert Millan Based on patch from Fabian Greffrath diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 5a33fdc78..174215efb 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -166,6 +166,9 @@ get_floppy_disk_name (char *name, int unit) #elif defined(__QNXNTO__) /* QNX RTP */ sprintf (name, "/dev/fd%d", unit); +#elif defined(__CYGWIN__) + /* Cygwin */ + sprintf (name, "/dev/fd%d", unit); #else # warning "BIOS floppy drives cannot be guessed in your operating system." /* Set NAME to a bogus string. */ @@ -207,6 +210,10 @@ get_ide_disk_name (char *name, int unit) /* Actually, QNX RTP doesn't distinguish IDE from SCSI, so this could contain SCSI disks. */ sprintf (name, "/dev/hd%d", unit); +#elif defined(__CYGWIN__) + /* Cygwin emulates all disks as /dev/sdX. */ + (void) unit; + *name = 0; #else # warning "BIOS IDE drives cannot be guessed in your operating system." /* Set NAME to a bogus string. */ @@ -248,6 +255,9 @@ get_scsi_disk_name (char *name, int unit) /* QNX RTP doesn't distinguish SCSI from IDE, so it is better to disable the detection of SCSI disks here. */ *name = 0; +#elif defined(__CYGWIN__) + /* Cygwin emulates all disks as /dev/sdX. */ + sprintf (name, "/dev/sd%c", unit + 'a'); #else # warning "BIOS SCSI drives cannot be guessed in your operating system." /* Set NAME to a bogus string. */ @@ -283,9 +293,9 @@ check_device (const char *device) char buf[512]; FILE *fp; - /* If DEVICE is empty, just return 1. */ + /* If DEVICE is empty, just return error. */ if (*device == 0) - return 1; + return 0; fp = fopen (device, "r"); if (! fp) @@ -513,9 +523,10 @@ make_device_map (const char *device_map, int floppy_disks) } } } -#endif /* __linux__ */ finish: +#endif /* __linux__ */ + if (fp != stdout) fclose (fp); } From 6cf12cbd25f2bdf9ef5ece45a4737545fe776408 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 6 May 2008 13:00:57 +0000 Subject: [PATCH 0122/1707] 2008-05-06 Robert Millan * util/grub-fstest.c (grub_refresh): Call `fflush (stdout)'. This ensures that output lines aren't intermangled with those sent to stderr (via grub_util_info()). * util/grub-probe.c (grub_refresh): Likewise. * util/i386/pc/grub-setup.c (grub_refresh): Likewise. --- ChangeLog | 8 ++++++++ util/grub-fstest.c | 1 + util/grub-probe.c | 1 + util/i386/pc/grub-setup.c | 1 + 4 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 640ed6fa6..cc9cb4432 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-06 Robert Millan + + * util/grub-fstest.c (grub_refresh): Call `fflush (stdout)'. This + ensures that output lines aren't intermangled with those sent to + stderr (via grub_util_info()). + * util/grub-probe.c (grub_refresh): Likewise. + * util/i386/pc/grub-setup.c (grub_refresh): Likewise. + 2008-05-05 Christian Franke * util/grub-mkdevicemap.c (get_floppy_disk_name) [__CYGWIN__]: diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 9e1d8863f..3872ff149 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -60,6 +60,7 @@ grub_term_get_current (void) void grub_refresh (void) { + fflush (stdout); } static struct grub_command cmd_loopback; diff --git a/util/grub-probe.c b/util/grub-probe.c index 986a4d733..4163f4b6a 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -74,6 +74,7 @@ grub_term_get_current (void) void grub_refresh (void) { + fflush (stdout); } static void diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 8fbe3e710..535a8d0e2 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -83,6 +83,7 @@ grub_term_get_current (void) void grub_refresh (void) { + fflush (stdout); } static void From b0346e0f431fd71173160e6736a87d8232ccb3c1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 6 May 2008 13:44:11 +0000 Subject: [PATCH 0123/1707] 2008-05-06 Robert Millan * util/update-grub_lib.in (make_system_path_relative_to_its_root): Do not print a trailing slash (therefore, the root directory is an empty string). (convert_system_path_to_grub_path): Do not remove trailing slash from make_system_path_relative_to_its_root() output. * util/i386/pc/grub-install.in: Add trailing slash to output from make_system_path_relative_to_its_root(). --- ChangeLog | 11 +++++++++++ util/i386/pc/grub-install.in | 2 +- util/update-grub_lib.in | 12 ++++++++---- 3 files changed, 20 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc9cb4432..fd9328bf2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-05-06 Robert Millan + + * util/update-grub_lib.in (make_system_path_relative_to_its_root): + Do not print a trailing slash (therefore, the root directory is an + empty string). + (convert_system_path_to_grub_path): Do not remove trailing slash + from make_system_path_relative_to_its_root() output. + + * util/i386/pc/grub-install.in: Add trailing slash to output from + make_system_path_relative_to_its_root(). + 2008-05-06 Robert Millan * util/grub-fstest.c (grub_refresh): Call `fflush (stdout)'. This diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 34e98e9f4..60da57a76 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -229,7 +229,7 @@ devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_ma # _chain is often useful modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain" -$grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}` $modules || exit 1 +$grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}`/ $modules || exit 1 # Now perform the installation. $grub_setup --directory=${grubdir} --device-map=${device_map} \ diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 628714084..2d7092b1b 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -61,7 +61,14 @@ make_system_path_relative_to_its_root () dir=$parent done - echo $path | sed -e "s,^$dir,/,g" -e "s,//,/,g" + # This function never prints trailing slashes (so that its output can be + # appended a slash unconditionally). Each slash in $dir is considered a + # preceding slash, and therefore the root directory is an empty string. + if [ "$dir" = "/" ] ; then + dir="" + fi + + echo $path | sed -e "s,^$dir,,g" } convert_system_path_to_grub_path () @@ -86,9 +93,6 @@ convert_system_path_to_grub_path () return 1 fi - # remove any trailing slash, even if that slash is everything we have - relative_path=`echo ${relative_path} | sed -e "s,/*$,,g"` - echo ${drive}${relative_path} } From 7f8866edc1b26b6d82776a0b2403fa556dc01145 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 7 May 2008 12:39:26 +0000 Subject: [PATCH 0124/1707] 2008-05-07 Robert Millan * disk/lvm.c (grub_lvm_scan_device): Detect errors in an additional grub_strstr() call. Correct a few mistakes in failure path handling. --- ChangeLog | 5 +++++ disk/lvm.c | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd9328bf2..8dfa07b21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-07 Robert Millan + + * disk/lvm.c (grub_lvm_scan_device): Detect errors in an additional + grub_strstr() call. Correct a few mistakes in failure path handling. + 2008-05-06 Robert Millan * util/update-grub_lib.in (make_system_path_relative_to_its_root): diff --git a/disk/lvm.c b/disk/lvm.c index 148e0f89e..1d898ff55 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -313,7 +313,10 @@ grub_lvm_scan_device (const char *name) grub_memcpy (vgname, p, vgname_len); vgname[vgname_len] = '\0'; - p = grub_strstr (q, "id = \"") + sizeof ("id = \"") - 1; + p = grub_strstr (q, "id = \""); + if (p == NULL) + goto fail3; + p += sizeof ("id = \"") - 1; grub_memcpy (vg_id, p, GRUB_LVM_ID_STRLEN); vg_id[GRUB_LVM_ID_STRLEN] = '\0'; @@ -329,16 +332,13 @@ grub_lvm_scan_device (const char *name) whole volume group structure. */ vg = grub_malloc (sizeof (*vg)); if (! vg) - { - grub_free (vgname); - goto fail; - } + goto fail3; vg->name = vgname; grub_memcpy (vg->id, vg_id, GRUB_LVM_ID_STRLEN+1); vg->extent_size = grub_lvm_getvalue (&p, "extent_size = "); if (p == NULL) - goto fail2; + goto fail4; vg->lvs = NULL; vg->pvs = NULL; @@ -390,7 +390,7 @@ grub_lvm_scan_device (const char *name) pvs_fail: grub_free (pv->name); grub_free (pv); - goto fail2; + goto fail4; } } @@ -510,7 +510,7 @@ grub_lvm_scan_device (const char *name) lvs_segment_fail2: grub_free (seg->stripes); lvs_segment_fail: - goto fail2; + goto fail4; } lv->number = lv_count++; @@ -527,7 +527,7 @@ grub_lvm_scan_device (const char *name) lvs_fail: grub_free (lv->name); grub_free (lv); - goto fail2; + goto fail4; } } } @@ -548,6 +548,15 @@ grub_lvm_scan_device (const char *name) } } + goto fail2; + + /* Failure path. */ + fail4: + grub_free (vg); + fail3: + grub_free (vgname); + + /* Normal exit path. */ fail2: grub_free (metadatabuf); fail: From b56c4eaa3fbecaca7544dd30513a7362e61acbf6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 7 May 2008 20:28:26 +0000 Subject: [PATCH 0125/1707] 2008-05-07 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle CCISS devices. * util/grub-mkdevicemap.c (get_cciss_disk_name) (make_device_map): Likewise. Reported by Roland Dreier --- ChangeLog | 8 ++++++++ util/biosdisk.c | 25 ++++++++++++++++++++++++- util/grub-mkdevicemap.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 62 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8dfa07b21..7570f79b1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-07 Robert Millan + + * util/biosdisk.c (linux_find_partition, get_os_disk): Handle CCISS + devices. + * util/grub-mkdevicemap.c (get_cciss_disk_name) + (make_device_map): Likewise. + Reported by Roland Dreier + 2008-05-07 Robert Millan * disk/lvm.c (grub_lvm_scan_device): Detect errors in an additional diff --git a/util/biosdisk.c b/util/biosdisk.c index e6e7f51ed..3b8b9e089 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -233,7 +233,7 @@ linux_find_partition (char *dev, unsigned long sector) p = real_dev + 8; format = "%d"; } - else if (strncmp (real_dev + 5, "rd/c", 4) == 0) + else if (strncmp (real_dev + 5, "rd/c", 4) == 0) /* dac960 */ { p = strchr (real_dev + 9, 'd'); if (! p) @@ -243,6 +243,18 @@ linux_find_partition (char *dev, unsigned long sector) while (*p && isdigit (*p)) p++; + format = "p%d"; + } + else if (strncmp (real_dev + 5, "cciss/c", sizeof("cciss/c")-1) == 0) + { + p = strchr (real_dev + 5 + sizeof("cciss/c")-1, 'd'); + if (! p) + return 0; + + p++; + while (*p && isdigit (*p)) + p++; + format = "p%d"; } else @@ -645,6 +657,17 @@ get_os_disk (const char *os_dev) return path; } + /* If this is a CCISS disk. */ + if (strncmp ("cciss/c", p, sizeof ("cciss/c") - 1) == 0) + { + /* /dev/cciss/c[0-9]+d[0-9]+(p[0-9]+)? */ + p = strchr (p, 'p'); + if (p) + *p = '\0'; + + return path; + } + /* If this is an IDE disk or a SCSI disk. */ if ((strncmp ("hd", p, 2) == 0 || strncmp ("sd", p, 2) == 0) diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 174215efb..12729812a 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -283,6 +283,12 @@ get_i2o_disk_name (char *name, char unit) { sprintf (name, "/dev/i2o/hd%c", unit); } + +static void +get_cciss_disk_name (char *name, int controller, int drive) +{ + sprintf (name, "/dev/cciss/c%dd%d", controller, drive); +} #endif /* Check if DEVICE can be read. If an error occurs, return zero, @@ -504,6 +510,30 @@ make_device_map (const char *device_map, int floppy_disks) } } + /* This is for CCISS - we have + /dev/cciss/cdp. */ + { + int controller, drive; + + for (controller = 0; controller < 3; controller++) + { + for (drive = 0; drive < 10; drive++) + { + char name[24]; + + get_cciss_disk_name (name, controller, drive); + if (check_device (name)) + { + char *p; + p = grub_util_get_disk_name (num_hd, name); + fprintf (fp, "(%s)\t%s\n", p, name); + free (p); + num_hd++; + } + } + } + } + /* This is for I2O - we have /dev/i2o/hd */ { char unit; From ed7593907d63d92a3f145e3b573228dc2056571d Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 7 May 2008 20:46:57 +0000 Subject: [PATCH 0126/1707] 2008-05-07 Ian Campbell * util/biosdisk.c (get_os_disk): Recognise xvd type disks. * util/grub-mkdevicemap.c (get_xvd_disk_name): New function. (make_device_map): Output entries for xvd type disks. --- ChangeLog | 6 ++++++ util/biosdisk.c | 8 ++++++++ util/grub-mkdevicemap.c | 22 ++++++++++++++++++++++ 3 files changed, 36 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7570f79b1..6a8e341c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-07 Ian Campbell + + * util/biosdisk.c (get_os_disk): Recognise xvd type disks. + * util/grub-mkdevicemap.c (get_xvd_disk_name): New function. + (make_device_map): Output entries for xvd type disks. + 2008-05-07 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle CCISS diff --git a/util/biosdisk.c b/util/biosdisk.c index 3b8b9e089..c4ee7c14a 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -677,6 +677,14 @@ get_os_disk (const char *os_dev) p[3] = '\0'; return path; } + + /* If this is a Xen virtual block device. */ + if ((strncmp ("xvd", p, 3) == 0) && p[3] >= 'a' && p[3] <= 'z') + { + /* /dev/xvd[a-z][0-9]* */ + p[4] = '\0'; + return path; + } } return path; diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 12729812a..19d6747bf 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -289,6 +289,12 @@ get_cciss_disk_name (char *name, int controller, int drive) { sprintf (name, "/dev/cciss/c%dd%d", controller, drive); } + +static void +get_xvd_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/xvd%c", unit + 'a'); +} #endif /* Check if DEVICE can be read. If an error occurs, return zero, @@ -464,6 +470,22 @@ make_device_map (const char *device_map, int floppy_disks) num_hd++; } } + + /* Xen virtual block devices. */ + for (i = 0; i < 16; i++) + { + char name[16]; + + get_xvd_disk_name (name, i); + if (check_device (name)) + { + char *p; + p = grub_util_get_disk_name (num_hd, name); + fprintf (fp, "(%s)\t%s\n", p, name); + free (p); + num_hd++; + } + } #endif /* __linux__ */ /* The rest is SCSI disks. */ From 1cf4059a492cc72a791dfd2400dc41d77b27dbd2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 9 May 2008 12:13:03 +0000 Subject: [PATCH 0127/1707] 2008-05-09 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle Virtio devices. * util/grub-mkdevicemap.c (get_virtio_disk_name) (make_device_map): Likewise. Reported by Aurelien Jarno --- ChangeLog | 8 ++++++++ util/biosdisk.c | 6 ++++-- util/grub-mkdevicemap.c | 22 ++++++++++++++++++++++ 3 files changed, 34 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6a8e341c8..eb26bb11d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-09 Robert Millan + + * util/biosdisk.c (linux_find_partition, get_os_disk): Handle Virtio + devices. + * util/grub-mkdevicemap.c (get_virtio_disk_name) + (make_device_map): Likewise. + Reported by Aurelien Jarno + 2008-05-07 Ian Campbell * util/biosdisk.c (get_os_disk): Recognise xvd type disks. diff --git a/util/biosdisk.c b/util/biosdisk.c index c4ee7c14a..fcf01a497 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -227,6 +227,7 @@ linux_find_partition (char *dev, unsigned long sector) format = "part%d"; } else if ((strncmp (real_dev + 5, "hd", 2) == 0 + || strncmp (real_dev + 5, "vd", 2) == 0 || strncmp (real_dev + 5, "sd", 2) == 0) && real_dev[7] >= 'a' && real_dev[7] <= 'z') { @@ -668,12 +669,13 @@ get_os_disk (const char *os_dev) return path; } - /* If this is an IDE disk or a SCSI disk. */ + /* If this is an IDE, SCSI or Virtio disk. */ if ((strncmp ("hd", p, 2) == 0 + || strncmp ("vd", p, 2) == 0 || strncmp ("sd", p, 2) == 0) && p[2] >= 'a' && p[2] <= 'z') { - /* /dev/[hs]d[a-z][0-9]* */ + /* /dev/[hsv]d[a-z][0-9]* */ p[3] = '\0'; return path; } diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 19d6747bf..d24d84416 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -266,6 +266,12 @@ get_scsi_disk_name (char *name, int unit) } #ifdef __linux__ +static void +get_virtio_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/vd%c", unit + 'a'); +} + static void get_dac960_disk_name (char *name, int controller, int drive) { @@ -455,6 +461,22 @@ make_device_map (const char *device_map, int floppy_disks) } #ifdef __linux__ + /* Virtio disks. */ + for (i = 0; i < 20; i++) + { + char name[16]; + + get_virtio_disk_name (name, i); + if (check_device (name)) + { + char *p; + p = grub_util_get_disk_name (num_hd, name); + fprintf (fp, "(%s)\t%s\n", p, name); + free (p); + num_hd++; + } + } + /* ATARAID disks. */ for (i = 0; i < 8; i++) { From a079699e979eba56128f58e638e79e2a270aaa3b Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 15 May 2008 11:51:22 +0000 Subject: [PATCH 0128/1707] 2008-05-15 Bean * kern/i386/pc/startup.S (grub_console_getkey): Workaround for the keyboard hang problem in apple's intel mac. --- ChangeLog | 5 +++++ kern/i386/pc/startup.S | 17 +++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/ChangeLog b/ChangeLog index eb26bb11d..d40e7420c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-15 Bean + + * kern/i386/pc/startup.S (grub_console_getkey): Workaround for the + keyboard hang problem in apple's intel mac. + 2008-05-09 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle Virtio diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 5d4bbcb99..ebb98fe60 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -1240,6 +1240,23 @@ FUNCTION(grub_console_getkey) call prot_to_real .code16 + /* + * Due to a bug in apple's bootcamp implementation, INT 16/AH = 0 would + * cause the machine to hang at the second keystroke. However, we can + * work around this problem by ensuring the presence of keystroke with + * INT 16/AH = 1 before calling INT 16/AH = 0. + */ + +1: + movb $1, %ah + int $0x16 + jnz 2f + hlt + jmp 1b + +2: + + movb $0, %ah int $0x16 movw %ax, %dx /* real_to_prot uses %eax */ From eedf167fef4312d511d456d257c4dced6653919c Mon Sep 17 00:00:00 2001 From: chrfranke Date: Fri, 16 May 2008 21:39:52 +0000 Subject: [PATCH 0129/1707] 2008-05-16 Christian Franke * util/biosdisk.c: [__CYGWIN__] Add includes. (grub_util_biosdisk_open): Use Linux code also for Cygwin. (get_os_disk): Move variable declarations to OS specific parts to avoid warning. [__GNU__] (get_os_disk): Fix /dev/sdXsN case. [__CYGWIN__] (get_os_disk): Add Cygwin /dev/sdXN device names. (grub_util_biosdisk_get_grub_dev): Use Linux code also for Cygwin. * util/getroot.c: [__CYGWIN__] Add includes. (strip_extra_slashes): Fix "/" case. [__CYGWIN__] (get_win32_path): New function. [__CYGWIN__] (grub_get_prefix): Add conversion to win32 path. [__CYGWIN__] (find_root_device): Disable. [__CYGWIN__] (get_bootsec_serial): New function. [__CYGWIN__] (find_cygwin_root_device): Likewise. [__linux__] (grub_guess_root_device): Add early returns to simplify structure. [__CYGWIN__] (grub_guess_root_device): Call find_cygwin_root_device. [__linux__] (grub_util_get_dev_abstraction): Enable LVM and RAID check for Linux only. --- ChangeLog | 23 +++++++ util/biosdisk.c | 34 +++++++--- util/getroot.c | 160 +++++++++++++++++++++++++++++++++++++++++++++--- 3 files changed, 199 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index d40e7420c..0a0e521cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2008-05-16 Christian Franke + + * util/biosdisk.c: [__CYGWIN__] Add includes. + (grub_util_biosdisk_open): Use Linux code also for Cygwin. + (get_os_disk): Move variable declarations to OS specific + parts to avoid warning. + [__GNU__] (get_os_disk): Fix /dev/sdXsN case. + [__CYGWIN__] (get_os_disk): Add Cygwin /dev/sdXN device names. + (grub_util_biosdisk_get_grub_dev): Use Linux code also for + Cygwin. + * util/getroot.c: [__CYGWIN__] Add includes. + (strip_extra_slashes): Fix "/" case. + [__CYGWIN__] (get_win32_path): New function. + [__CYGWIN__] (grub_get_prefix): Add conversion to win32 path. + [__CYGWIN__] (find_root_device): Disable. + [__CYGWIN__] (get_bootsec_serial): New function. + [__CYGWIN__] (find_cygwin_root_device): Likewise. + [__linux__] (grub_guess_root_device): Add early returns to simplify + structure. + [__CYGWIN__] (grub_guess_root_device): Call find_cygwin_root_device. + [__linux__] (grub_util_get_dev_abstraction): Enable LVM and RAID + check for Linux only. + 2008-05-15 Bean * kern/i386/pc/startup.S (grub_console_getkey): Workaround for the diff --git a/util/biosdisk.c b/util/biosdisk.c index fcf01a497..ddb3718c0 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -77,6 +77,14 @@ struct hd_geometry # endif /* ! LOOP_MAJOR */ #endif /* __linux__ */ +#ifdef __CYGWIN__ +# include +# include /* BLKGETSIZE64 */ +# include /* HDIO_GETGEO */ +# define MAJOR(dev) ((unsigned) ((dev) >> 16)) +# define FLOPPY_MAJOR 2 +#endif + static char *map[256]; #ifdef __linux__ @@ -162,7 +170,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) disk->id = drive; /* Get the size. */ -#ifdef __linux__ +#if defined(__linux__) || defined(__CYGWIN__) { unsigned long long nr; int fd; @@ -616,16 +624,14 @@ make_device_name (int drive, int dos_part, int bsd_part) static char * get_os_disk (const char *os_dev) { - char *path, *p; - #if defined(__linux__) - path = xmalloc (PATH_MAX); + char *path = xmalloc (PATH_MAX); if (! realpath (os_dev, path)) return 0; if (strncmp ("/dev/", path, 5) == 0) { - p = path + 5; + char *p = path + 5; /* If this is an IDE disk. */ if (strncmp ("ide/", p, 4) == 0) @@ -692,15 +698,21 @@ get_os_disk (const char *os_dev) return path; #elif defined(__GNU__) - path = xstrdup (os_dev); + char *path = xstrdup (os_dev); if (strncmp ("/dev/sd", path, 7) == 0 || strncmp ("/dev/hd", path, 7) == 0) { - p = strchr (path, 's'); + char *p = strchr (path + 7, 's'); if (p) *p = '\0'; } return path; +#elif defined(__CYGWIN__) + char *path = xstrdup (os_dev); + if (strncmp ("/dev/sd", path, 7) == 0 && 'a' <= path[7] && path[7] <= 'z') + path[8] = 0; + return path; + #else # warning "The function `get_os_disk' might not work on your OS correctly." return xstrdup (os_dev); @@ -751,11 +763,15 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) if (! S_ISBLK (st.st_mode)) return make_device_name (drive, -1, -1); -#if defined(__linux__) +#if defined(__linux__) || defined(__CYGWIN__) /* Linux counts partitions uniformly, whether a BSD partition or a DOS partition, so mapping them to GRUB devices is not trivial. Here, get the start sector of a partition by HDIO_GETGEO, and - compare it with each partition GRUB recognizes. */ + compare it with each partition GRUB recognizes. + + Cygwin /dev/sdXN emulation uses Windows partition mapping. It + does not count the extended partition and missing primary + partitions. Use same method as on Linux here. */ { char *name; grub_disk_t disk; diff --git a/util/getroot.c b/util/getroot.c index 5a9821883..1202a5c8b 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -22,6 +22,13 @@ #include #include +#ifdef __CYGWIN__ +# include +# include +# include +# define DEV_CYGDRIVE_MAJOR 98 +#endif + #include #include #include @@ -40,7 +47,8 @@ strip_extra_slashes (char *dir) } else if (p[1] == '\0') { - p[0] = '\0'; + if (p > dir) + p[0] = '\0'; break; } @@ -64,6 +72,30 @@ xgetcwd (void) return path; } +#ifdef __CYGWIN__ +/* Convert POSIX path to Win32 path, + remove drive letter, replace backslashes. */ +static char * +get_win32_path (const char *path) +{ + char winpath[PATH_MAX]; + cygwin_conv_to_full_win32_path (path, winpath); + + int len = strlen (winpath); + if (len > 2 && winpath[1] == ':') + { + len -= 2; + memmove (winpath, winpath + 2, len + 1); + } + + int i; + for (i = 0; i < len; i++) + if (winpath[i] == '\\') + winpath[i] = '/'; + return xstrdup (winpath); +} +#endif + char * grub_get_prefix (const char *dir) { @@ -116,6 +148,19 @@ grub_get_prefix (const char *dir) if (chdir (saved_cwd) < 0) grub_util_error ("Cannot change directory to `%s'", dir); +#ifdef __CYGWIN__ + if (st.st_dev != (DEV_CYGDRIVE_MAJOR << 16)) + { + /* Reached some mount point not below /cygdrive. + GRUB does not know Cygwin's emulated mounts, + convert to Win32 path. */ + grub_util_info ("Cygwin prefix = %s", prefix); + char * wprefix = get_win32_path (prefix); + free (prefix); + prefix = wprefix; + } +#endif + free (saved_cwd); free (abs_dir); free (prev_dir); @@ -124,6 +169,8 @@ grub_get_prefix (const char *dir) return prefix; } +#ifndef __CYGWIN__ + static char * find_root_device (const char *dir, dev_t dev) { @@ -216,6 +263,92 @@ find_root_device (const char *dir, dev_t dev) return 0; } +#else /* __CYGWIN__ */ + +/* Read drive/partition serial number from mbr/boot sector, + return 0 on read error, ~0 on unknown serial. */ +static unsigned +get_bootsec_serial (const char *os_dev, int mbr) +{ + /* Read boot sector. */ + int fd = open (os_dev, O_RDONLY); + if (fd < 0) + return 0; + unsigned char buf[0x200]; + int n = read (fd, buf, sizeof (buf)); + close (fd); + if (n != sizeof(buf)) + return 0; + + /* Check signature. */ + if (!(buf[0x1fe] == 0x55 && buf[0x1ff] == 0xaa)) + return ~0; + + /* Serial number offset depends on boot sector type. */ + if (mbr) + n = 0x1b8; + else if (memcmp (buf + 0x03, "NTFS", 4) == 0) + n = 0x048; + else if (memcmp (buf + 0x52, "FAT32", 5) == 0) + n = 0x043; + else if (memcmp (buf + 0x36, "FAT", 3) == 0) + n = 0x027; + else + return ~0; + + unsigned serial = *(unsigned *)(buf + n); + if (serial == 0) + return ~0; + return serial; +} + +static char * +find_cygwin_root_device (const char *path, dev_t dev) +{ + /* No root device for /cygdrive. */ + if (dev == (DEV_CYGDRIVE_MAJOR << 16)) + return 0; + + /* Convert to full POSIX and Win32 path. */ + char fullpath[PATH_MAX], winpath[PATH_MAX]; + cygwin_conv_to_full_posix_path (path, fullpath); + cygwin_conv_to_full_win32_path (fullpath, winpath); + + /* If identical, this is no real filesystem path. */ + if (strcmp (fullpath, winpath) == 0) + return 0; + + /* Check for floppy drive letter. */ + if (winpath[0] && winpath[1] == ':' && strchr ("AaBb", winpath[0])) + return xstrdup (strchr ("Aa", winpath[0]) ? "/dev/fd0" : "/dev/fd1"); + + /* Cygwin returns the partition serial number in stat.st_dev. + This is never identical to the device number of the emulated + /dev/sdXN device, so above find_root_device () does not work. + Search the partion with the same serial in boot sector instead. */ + char devpath[sizeof ("/dev/sda15") + 13]; /* Size + Paranoia. */ + int d; + for (d = 'a'; d <= 'z'; d++) + { + sprintf (devpath, "/dev/sd%c", d); + if (get_bootsec_serial (devpath, 1) == 0) + continue; + int p; + for (p = 1; p <= 15; p++) + { + sprintf (devpath, "/dev/sd%c%d", d, p); + unsigned ser = get_bootsec_serial (devpath, 0); + if (ser == 0) + break; + if (ser != (unsigned)~0 && dev == (dev_t)ser) + return xstrdup (devpath); + } + } + return 0; +} + +#endif /* __CYGWIN__ */ + char * grub_guess_root_device (const char *dir) { @@ -230,17 +363,24 @@ grub_guess_root_device (const char *dir) we don't do this, we get useless device names like /dev/dm-0 for LVM. */ os_dev = find_root_device ("/dev/mapper", st.st_dev); + if (os_dev) + return os_dev; /* The same applies to /dev/evms directory (for EVMS volumes). */ - if (! os_dev) - os_dev = find_root_device ("/dev/evms", st.st_dev); - - if (! os_dev) + os_dev = find_root_device ("/dev/evms", st.st_dev); + if (os_dev) + return os_dev; +#endif + +#ifdef __CYGWIN__ + /* Cygwin specific function. */ + os_dev = find_cygwin_root_device (dir, st.st_dev); + +#else + + /* This might be truly slow, but is there any better way? */ + os_dev = find_root_device ("/dev", st.st_dev); #endif - { - /* This might be truly slow, but is there any better way? */ - os_dev = find_root_device ("/dev", st.st_dev); - } return os_dev; } @@ -248,6 +388,7 @@ grub_guess_root_device (const char *dir) int grub_util_get_dev_abstraction (const char *os_dev) { +#ifdef __linux__ /* Check for LVM. */ if (!strncmp (os_dev, "/dev/mapper/", 12)) return GRUB_DEV_ABSTRACTION_LVM; @@ -255,6 +396,7 @@ grub_util_get_dev_abstraction (const char *os_dev) /* Check for RAID. */ if (!strncmp (os_dev, "/dev/md", 7)) return GRUB_DEV_ABSTRACTION_RAID; +#endif /* No abstraction found. */ return GRUB_DEV_ABSTRACTION_NONE; From b7c6bed50edfd01cfe9de1eb3808d8eec4280777 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Fri, 16 May 2008 21:55:29 +0000 Subject: [PATCH 0130/1707] 2008-05-16 Christian Franke * commands/cat.c (grub_cmd_cat): Remove non-ESC keys from keyboard queue to ensure that break with ESC will always work. * commands/sleep.c (grub_interruptible_millisleep): Likewise. Remove ESC from keyboard queue. --- ChangeLog | 7 +++++++ commands/cat.c | 12 ++++++------ commands/sleep.c | 3 ++- 3 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0a0e521cf..c072ccd4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-16 Christian Franke + + * commands/cat.c (grub_cmd_cat): Remove non-ESC keys from keyboard queue + to ensure that break with ESC will always work. + * commands/sleep.c (grub_interruptible_millisleep): Likewise. + Remove ESC from keyboard queue. + 2008-05-16 Christian Franke * util/biosdisk.c: [__CYGWIN__] Add includes. diff --git a/commands/cat.c b/commands/cat.c index 3a0d1f8fb..01fa3a455 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -34,6 +34,7 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), grub_file_t file; char buf[GRUB_DISK_SECTOR_SIZE]; grub_ssize_t size; + int key = 0; if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); @@ -42,7 +43,8 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), if (! file) return 0; - while ((size = grub_file_read (file, buf, sizeof (buf))) > 0) + while ((size = grub_file_read (file, buf, sizeof (buf))) > 0 + && key != GRUB_TERM_ESC) { int i; @@ -60,11 +62,9 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), } } - if (GRUB_TERM_ASCII_CHAR (grub_checkkey ()) == GRUB_TERM_ESC) - { - grub_getkey (); - break; - } + while (grub_checkkey () >= 0 && + (key = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != GRUB_TERM_ESC) + ; } grub_putchar ('\n'); diff --git a/commands/sleep.c b/commands/sleep.c index b239ef973..c4744c57a 100644 --- a/commands/sleep.c +++ b/commands/sleep.c @@ -52,7 +52,8 @@ grub_interruptible_millisleep (grub_uint32_t ms) end_at = grub_get_rtc () + grub_div_roundup (ms * GRUB_TICKS_PER_SECOND, 1000); while (grub_get_rtc () < end_at) - if (GRUB_TERM_ASCII_CHAR (grub_checkkey ()) == GRUB_TERM_ESC) + if (grub_checkkey () >= 0 && + GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC) return 1; return 0; From 887d2619bfa9493639ff64af4802b462403dc424 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 20 May 2008 05:00:53 +0000 Subject: [PATCH 0131/1707] 2008-05-20 Bean * fs/fshelp.c (grub_fshelp_map_block): New function. (grub_fshelp_find_file): Use 64-bit type for pos and block address. Use `>>' and `&' operator to avoid 64-bit divide and modulo. * include/grub/fshelp.h (grub_fshelp_journal_type): New enum. (GRUB_FSHELP_JOURNAL_UNUSED_MAPPING): New macro. (grub_fshelp_journal): New structure. (grub_fshelp_map_block): New function prototype. (grub_fshelp_read_file): Use grub_disk_addr_t as block type. (grub_fshelp_map_block): Likewise. * fs/ext2.c (EXT3_FEATURE_COMPAT_HAS_JOURNAL): New macro. (EXT3_JOURNAL_MAGIC_NUMBER): Likewise. (EXT3_JOURNAL_DESCRIPTOR_BLOCK): Likewise. (EXT3_JOURNAL_COMMIT_BLOCK): Likewise. (EXT3_JOURNAL_SUPERBLOCK_V1): Likewise. (EXT3_JOURNAL_SUPERBLOCK_V2): Likewise. (EXT3_JOURNAL_REVOKE_BLOCK): Likewise. (EXT3_JOURNAL_FLAG_ESCAPE): Likewise. (EXT3_JOURNAL_FLAG_SAME_UUID): Likewise. (EXT3_JOURNAL_FLAG_DELETED): Likewise. (EXT3_JOURNAL_FLAG_LAST_TAG): Likewise. (grub_ext2_sblock): New members for journal support. (grub_ext3_journal_header): New structure. (grub_ext3_journal_revoke_header): Likewise. (grub_ext3_journal_block_tag): Likewise. (grub_ext3_journal_sblock): Likewise. (grub_fshelp_node): New members logfile and journal. (grub_ext2_read_block): Change block type to grub_disk_addr_t. Use grub_fshelp_map_block to get real block number. (grub_ext2_blockgroup): Use grub_fshelp_map_block to get real block number. (grub_ext2_read_inode): Likewise. (grub_ext3_get_journal): New function. (grub_read_inode): Initialize journal using grub_ext3_get_journal. (grub_ext2_close): Release memory used by journal. * fs/reiserfs.c (REISERFS_MAGIC_STRING): Changed to "ReIsEr". (REISERFS_MAGIC_DESC_BLOCK): New macro. (grub_reiserfs_transaction_header): Renamed to grub_reiserfs_description_block, replace field data with real_blocks. (grub_reiserfs_commit_block): New structure. (grub_reiserfs_data): New member journal. (grub_reiserfs_get_item): Use grub_fshelp_map_block to get real block number. (grub_reiserfs_read_symlink): Likewise. (grub_reiserfs_iterate_dir): Likewise. (grub_reiserfs_open): Likewise. (grub_reiserfs_read): Likewise. (grub_reiserfs_get_journal): New function. (grub_reiserfs_mount): Use "ReIsEr" as super block magic, as there are three varieties ReIsErFs, ReIsEr2Fs and ReIsEr3Fs. Initialize journal using grub_reiserfs_get_journal. (grub_reiserfs_close): Release memory used by journal. * fs/affs.c (grub_affs_read_block): Change block type to grub_disk_addr_t. Use grub_divmod64 to do 64-bit division. * fs/afs.c (grub_afs_read_block): Change block type to grub_disk_addr_t. * fs/hfsplus.c (grub_hfsplus_read_block): Likewise. * fs/ntfs.c (grub_ntfs_read_block): Likewise. * fs/udf.c (grub_udf_read_block): Change block type to grub_disk_addr_t. Use type cast to avoid warning. * fs/xfs.c (grub_xfs_read_block): Likewise. --- ChangeLog | 71 ++++++++++++ fs/affs.c | 10 +- fs/afs.c | 6 +- fs/ext2.c | 261 +++++++++++++++++++++++++++++++++++++++--- fs/fshelp.c | 56 ++++++--- fs/hfsplus.c | 4 +- fs/ntfs.c | 4 +- fs/reiserfs.c | 181 ++++++++++++++++++++++++----- fs/sfs.c | 6 +- fs/udf.c | 8 +- fs/xfs.c | 10 +- include/grub/fshelp.h | 41 ++++++- 12 files changed, 575 insertions(+), 83 deletions(-) diff --git a/ChangeLog b/ChangeLog index c072ccd4c..d4dcd5907 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,74 @@ +2008-05-20 Bean + + * fs/fshelp.c (grub_fshelp_map_block): New function. + (grub_fshelp_find_file): Use 64-bit type for pos and block address. + Use `>>' and `&' operator to avoid 64-bit divide and modulo. + + * include/grub/fshelp.h (grub_fshelp_journal_type): New enum. + (GRUB_FSHELP_JOURNAL_UNUSED_MAPPING): New macro. + (grub_fshelp_journal): New structure. + (grub_fshelp_map_block): New function prototype. + (grub_fshelp_read_file): Use grub_disk_addr_t as block type. + (grub_fshelp_map_block): Likewise. + + * fs/ext2.c (EXT3_FEATURE_COMPAT_HAS_JOURNAL): New macro. + (EXT3_JOURNAL_MAGIC_NUMBER): Likewise. + (EXT3_JOURNAL_DESCRIPTOR_BLOCK): Likewise. + (EXT3_JOURNAL_COMMIT_BLOCK): Likewise. + (EXT3_JOURNAL_SUPERBLOCK_V1): Likewise. + (EXT3_JOURNAL_SUPERBLOCK_V2): Likewise. + (EXT3_JOURNAL_REVOKE_BLOCK): Likewise. + (EXT3_JOURNAL_FLAG_ESCAPE): Likewise. + (EXT3_JOURNAL_FLAG_SAME_UUID): Likewise. + (EXT3_JOURNAL_FLAG_DELETED): Likewise. + (EXT3_JOURNAL_FLAG_LAST_TAG): Likewise. + (grub_ext2_sblock): New members for journal support. + (grub_ext3_journal_header): New structure. + (grub_ext3_journal_revoke_header): Likewise. + (grub_ext3_journal_block_tag): Likewise. + (grub_ext3_journal_sblock): Likewise. + (grub_fshelp_node): New members logfile and journal. + (grub_ext2_read_block): Change block type to grub_disk_addr_t. Use + grub_fshelp_map_block to get real block number. + (grub_ext2_blockgroup): Use grub_fshelp_map_block to get real block + number. + (grub_ext2_read_inode): Likewise. + (grub_ext3_get_journal): New function. + (grub_read_inode): Initialize journal using grub_ext3_get_journal. + (grub_ext2_close): Release memory used by journal. + + * fs/reiserfs.c (REISERFS_MAGIC_STRING): Changed to "ReIsEr". + (REISERFS_MAGIC_DESC_BLOCK): New macro. + (grub_reiserfs_transaction_header): Renamed to + grub_reiserfs_description_block, replace field data with real_blocks. + (grub_reiserfs_commit_block): New structure. + (grub_reiserfs_data): New member journal. + (grub_reiserfs_get_item): Use grub_fshelp_map_block to get real block + number. + (grub_reiserfs_read_symlink): Likewise. + (grub_reiserfs_iterate_dir): Likewise. + (grub_reiserfs_open): Likewise. + (grub_reiserfs_read): Likewise. + (grub_reiserfs_get_journal): New function. + (grub_reiserfs_mount): Use "ReIsEr" as super block magic, as there are + three varieties ReIsErFs, ReIsEr2Fs and ReIsEr3Fs. Initialize journal + using grub_reiserfs_get_journal. + (grub_reiserfs_close): Release memory used by journal. + + * fs/affs.c (grub_affs_read_block): Change block type to + grub_disk_addr_t. Use grub_divmod64 to do 64-bit division. + + * fs/afs.c (grub_afs_read_block): Change block type to grub_disk_addr_t. + + * fs/hfsplus.c (grub_hfsplus_read_block): Likewise. + + * fs/ntfs.c (grub_ntfs_read_block): Likewise. + + * fs/udf.c (grub_udf_read_block): Change block type to + grub_disk_addr_t. Use type cast to avoid warning. + + * fs/xfs.c (grub_xfs_read_block): Likewise. + 2008-05-16 Christian Franke * commands/cat.c (grub_cmd_cat): Remove non-ESC keys from keyboard queue diff --git a/fs/affs.c b/fs/affs.c index 8ebfa4035..f1592ab78 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -109,18 +109,19 @@ static grub_dl_t my_mod; #endif -static int -grub_affs_read_block (grub_fshelp_node_t node, int fileblock) +static grub_disk_addr_t +grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { int links; grub_uint32_t pos; int block = node->block; struct grub_affs_file file; struct grub_affs_data *data = node->data; + grub_uint32_t mod; /* Find the block that points to the fileblock we are looking up by following the chain until the right table is reached. */ - for (links = fileblock / (data->htsize); links; links--) + for (links = grub_divmod64 (fileblock, data->htsize, &mod); links; links--) { grub_disk_read (data->disk, block + data->blocksize - 1, data->blocksize * (GRUB_DISK_SECTOR_SIZE @@ -133,7 +134,7 @@ grub_affs_read_block (grub_fshelp_node_t node, int fileblock) } /* Translate the fileblock to the block within the right table. */ - fileblock = fileblock % (data->htsize); + fileblock = mod; grub_disk_read (data->disk, block, GRUB_AFFS_BLOCKPTR_OFFSET + (data->htsize - fileblock - 1) * sizeof (pos), @@ -567,4 +568,3 @@ GRUB_MOD_FINI(affs) { grub_fs_unregister (&grub_affs_fs); } - diff --git a/fs/afs.c b/fs/afs.c index 7c6167162..5b5eb689d 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -199,12 +199,12 @@ grub_afs_read_inode (struct grub_afs_data *data, } static int -grub_afs_read_block (grub_fshelp_node_t node, int fileblock) +grub_afs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_afs_sblock *sb = &node->data->sblock; struct grub_afs_datastream *ds = &node->inode.stream; - if ((grub_uint32_t) fileblock < U64 (sb, ds->max_direct_range)) + if (fileblock < U64 (sb, ds->max_direct_range)) { int i; @@ -215,7 +215,7 @@ grub_afs_read_block (grub_fshelp_node_t node, int fileblock) fileblock -= U16 (sb, ds->direct[i].len); } } - else if ((grub_uint32_t) fileblock < U64 (sb, ds->max_indirect_range)) + else if (fileblock < U64 (sb, ds->max_indirect_range)) { int ptrs_per_blk = sb->block_size / sizeof (struct grub_afs_blockrun); struct grub_afs_blockrun indir[ptrs_per_blk]; diff --git a/fs/ext2.c b/fs/ext2.c index ec665827b..c09662859 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -71,6 +71,21 @@ ? EXT2_GOOD_OLD_INODE_SIZE \ : grub_le_to_cpu16 (data->sblock.inode_size)) +#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 + +#define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U + +#define EXT3_JOURNAL_DESCRIPTOR_BLOCK 1 +#define EXT3_JOURNAL_COMMIT_BLOCK 2 +#define EXT3_JOURNAL_SUPERBLOCK_V1 3 +#define EXT3_JOURNAL_SUPERBLOCK_V2 4 +#define EXT3_JOURNAL_REVOKE_BLOCK 5 + +#define EXT3_JOURNAL_FLAG_ESCAPE 1 +#define EXT3_JOURNAL_FLAG_SAME_UUID 2 +#define EXT3_JOURNAL_FLAG_DELETED 4 +#define EXT3_JOURNAL_FLAG_LAST_TAG 8 + /* The ext2 superblock. */ struct grub_ext2_sblock { @@ -109,6 +124,21 @@ struct grub_ext2_sblock char volume_name[16]; char last_mounted_on[64]; grub_uint32_t compression_info; + grub_uint8_t prealloc_blocks; + grub_uint8_t prealloc_dir_blocks; + grub_uint16_t reserved_gdt_blocks; + grub_uint8_t journal_uuid[16]; + grub_uint32_t journal_inum; + grub_uint32_t journal_dev; + grub_uint32_t last_orphan; + grub_uint32_t hash_seed[4]; + grub_uint8_t def_hash_version; + grub_uint8_t jnl_backup_type; + grub_uint16_t reserved_word_pad; + grub_uint32_t default_mount_opts; + grub_uint32_t first_meta_bg; + grub_uint32_t mkfs_time; + grub_uint32_t jnl_blocks[17]; }; /* The ext2 blockgroup. */ @@ -166,6 +196,36 @@ struct ext2_dirent grub_uint8_t filetype; }; +struct grub_ext3_journal_header +{ + grub_uint32_t magic; + grub_uint32_t block_type; + grub_uint32_t sequence; +}; + +struct grub_ext3_journal_revoke_header +{ + struct grub_ext3_journal_header header; + grub_uint32_t count; + grub_uint32_t data[0]; +}; + +struct grub_ext3_journal_block_tag +{ + grub_uint32_t block; + grub_uint32_t flags; +}; + +struct grub_ext3_journal_sblock +{ + struct grub_ext3_journal_header header; + grub_uint32_t block_size; + grub_uint32_t maxlen; + grub_uint32_t first; + grub_uint32_t sequence; + grub_uint32_t start; +}; + struct grub_fshelp_node { struct grub_ext2_data *data; @@ -181,6 +241,8 @@ struct grub_ext2_data grub_disk_t disk; struct grub_ext2_inode *inode; struct grub_fshelp_node diropen; + struct grub_fshelp_node logfile; + grub_fshelp_journal_t journal; }; #ifndef GRUB_UTIL @@ -196,20 +258,21 @@ grub_ext2_blockgroup (struct grub_ext2_data *data, int group, struct grub_ext2_block_group *blkgrp) { return grub_disk_read (data->disk, - ((grub_le_to_cpu32 (data->sblock.first_data_block) + 1) + (grub_fshelp_map_block (data->journal, + grub_le_to_cpu32 (data->sblock.first_data_block) + 1) << LOG2_EXT2_BLOCK_SIZE (data)), group * sizeof (struct grub_ext2_block_group), sizeof (struct grub_ext2_block_group), (char *) blkgrp); } -static int -grub_ext2_read_block (grub_fshelp_node_t node, int fileblock) +static grub_disk_addr_t +grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_ext2_data *data = node->data; struct grub_ext2_inode *inode = &node->inode; int blknr; - int blksz = EXT2_BLOCK_SIZE (data); + unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); /* Direct blocks. */ @@ -221,7 +284,8 @@ grub_ext2_read_block (grub_fshelp_node_t node, int fileblock) grub_uint32_t indir[blksz / 4]; if (grub_disk_read (data->disk, - grub_le_to_cpu32 (inode->blocks.indir_block) + grub_fshelp_map_block(data->journal, + grub_le_to_cpu32 (inode->blocks.indir_block)) << log2_blksz, 0, blksz, (char *) indir)) return grub_errno; @@ -237,13 +301,15 @@ grub_ext2_read_block (grub_fshelp_node_t node, int fileblock) grub_uint32_t indir[blksz / 4]; if (grub_disk_read (data->disk, - grub_le_to_cpu32 (inode->blocks.double_indir_block) + grub_fshelp_map_block(data->journal, + grub_le_to_cpu32 (inode->blocks.double_indir_block)) << log2_blksz, 0, blksz, (char *) indir)) return grub_errno; if (grub_disk_read (data->disk, - grub_le_to_cpu32 (indir[rblock / perblock]) + grub_fshelp_map_block(data->journal, + grub_le_to_cpu32 (indir[rblock / perblock])) << log2_blksz, 0, blksz, (char *) indir)) return grub_errno; @@ -259,10 +325,9 @@ grub_ext2_read_block (grub_fshelp_node_t node, int fileblock) blknr = -1; } - return blknr; + return grub_fshelp_map_block (data->journal, blknr); } - /* Read LEN bytes from the file described by DATA starting with byte POS. Return the amount of read bytes in READ. */ static grub_ssize_t @@ -308,8 +373,9 @@ grub_ext2_read_inode (struct grub_ext2_data *data, /* Read the inode. */ if (grub_disk_read (data->disk, - ((grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno) - << LOG2_EXT2_BLOCK_SIZE (data)), + grub_fshelp_map_block(data->journal, + grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno) + << LOG2_EXT2_BLOCK_SIZE (data), EXT2_INODE_SIZE (data) * blkoff, sizeof (struct grub_ext2_inode), (char *) inode)) return grub_errno; @@ -317,6 +383,169 @@ grub_ext2_read_inode (struct grub_ext2_data *data, return 0; } +static void +grub_ext3_get_journal (struct grub_ext2_data *data) +{ + char buf[1 << LOG2_BLOCK_SIZE (data)]; + struct grub_ext3_journal_sblock *jsb; + grub_fshelp_journal_t log; + int last_num, num, block, log2bs; + grub_uint32_t seq; + + auto void next_block (void); + void next_block (void) + { + block++; + if (block >= log->last_block) + block = log->first_block; + } + + data->journal = 0; + + if (! (data->sblock.feature_compatibility & EXT3_FEATURE_COMPAT_HAS_JOURNAL)) + return; + + if (! data->sblock.journal_inum) + return; + + data->logfile.data = data; + data->logfile.ino = data->sblock.journal_inum; + data->logfile.inode_read = 1; + + if (grub_ext2_read_inode (data, data->logfile.ino, &data->logfile.inode)) + return; + + log2bs = LOG2_EXT2_BLOCK_SIZE (data); + if (grub_fshelp_read_file (data->disk, &data->logfile, 0, + 0, sizeof (struct grub_ext3_journal_sblock), + buf, grub_ext2_read_block, + sizeof (buf), log2bs) != + sizeof (struct grub_ext3_journal_sblock)) + return; + + jsb = (struct grub_ext3_journal_sblock *) &buf[0]; + if (grub_be_to_cpu32 (jsb->header.magic) != EXT3_JOURNAL_MAGIC_NUMBER) + return; + + /* Empty journal. */ + if (! jsb->start) + return; + + log = grub_malloc (sizeof (struct grub_fshelp_journal) + + grub_be_to_cpu32 (jsb->maxlen) * sizeof (grub_disk_addr_t)); + if (! log) + return; + + log->type = GRUB_FSHELP_JOURNAL_TYPE_FILE; + log->node = &data->logfile; + log->get_block = grub_ext2_read_block; + log->first_block = grub_be_to_cpu32 (jsb->first); + log->last_block = grub_be_to_cpu32 (jsb->maxlen); + log->start_block = grub_be_to_cpu32 (jsb->start); + + last_num = num = 0; + block = log->start_block; + seq = grub_be_to_cpu32 (jsb->sequence); + + while (1) + { + struct grub_ext3_journal_header *jh; + + if (grub_fshelp_read_file (data->disk, &data->logfile, 0, + block << (log2bs + 9), sizeof (buf), + buf, grub_ext2_read_block, + log->last_block << (log2bs + 9), + log2bs) != + (int) sizeof (buf)) + break; + + jh = (struct grub_ext3_journal_header *) &buf[0]; + if (grub_be_to_cpu32 (jh->magic) != EXT3_JOURNAL_MAGIC_NUMBER) + break; + + if (grub_be_to_cpu32 (jh->sequence) != seq) + break; + + log->mapping[num++] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; + next_block(); + + switch (grub_be_to_cpu32 (jh->block_type)) + { + case EXT3_JOURNAL_DESCRIPTOR_BLOCK: + { + struct grub_ext3_journal_block_tag *tag; + int ofs, flags; + + ofs = sizeof (struct grub_ext3_journal_header); + + do + { + tag = (struct grub_ext3_journal_block_tag *) &buf[ofs]; + ofs += sizeof (struct grub_ext3_journal_block_tag); + + if (ofs > (int) sizeof (buf)) + break; + + flags = grub_be_to_cpu32 (tag->flags); + if (! (flags & EXT3_JOURNAL_FLAG_SAME_UUID)) + ofs += 16; + + log->mapping[num++] = grub_be_to_cpu32 (tag->block); + next_block(); + } + while (! (flags & EXT3_JOURNAL_FLAG_LAST_TAG)); + + continue; + } + + case EXT3_JOURNAL_COMMIT_BLOCK: + { + seq++; + last_num = num - 1; + continue; + } + + case EXT3_JOURNAL_REVOKE_BLOCK: + { + struct grub_ext3_journal_revoke_header *jrh; + grub_uint32_t i; + + jrh = (struct grub_ext3_journal_revoke_header *) jh; + + for (i = 0; i < grub_be_to_cpu32 (jrh->count); i++) + { + int j; + grub_uint32_t map; + + map = grub_be_to_cpu32 (jrh->data[i]); + for (j = 0; j < num; j++) + if (log->mapping[j] == map) + log->mapping[j] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; + } + + continue; + } + default: + last_num = 0; + goto quit; + } + } + +quit: + if (! last_num) + grub_free (log); + else + { + int size; + + size = sizeof (struct grub_fshelp_journal) + + last_num * sizeof (grub_disk_addr_t); + + log->num_mappings = last_num; + data->journal = grub_realloc (log, size); + } +} + static struct grub_ext2_data * grub_ext2_mount (grub_disk_t disk) { @@ -336,12 +565,14 @@ grub_ext2_mount (grub_disk_t disk) if (grub_le_to_cpu16 (data->sblock.magic) != EXT2_MAGIC) goto fail; + data->disk = disk; + grub_ext3_get_journal (data); + data->diropen.data = data; data->diropen.ino = 2; data->diropen.inode_read = 1; data->inode = &data->diropen.inode; - data->disk = disk; grub_ext2_read_inode (data, 2, data->inode); if (grub_errno) @@ -540,7 +771,11 @@ grub_ext2_open (struct grub_file *file, const char *name) static grub_err_t grub_ext2_close (grub_file_t file) { - grub_free (file->data); + if (file->data) + { + grub_free (((struct grub_ext2_data *) file->data)->journal); + grub_free (file->data); + } #ifndef GRUB_UTIL grub_dl_unref (my_mod); diff --git a/fs/fshelp.c b/fs/fshelp.c index bbb58ac9f..8a4f0612b 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -72,7 +72,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, void free_node (grub_fshelp_node_t node) { - if (node != rootnode && node != currroot) + if (node != rootnode && node != currroot) grub_free (node); } @@ -223,25 +223,26 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, grub_ssize_t grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, void NESTED_FUNC_ATTR (*read_hook) (grub_disk_addr_t sector, - unsigned offset, unsigned length), - int pos, grub_size_t len, char *buf, - int (*get_block) (grub_fshelp_node_t node, int block), + unsigned offset, + unsigned length), + grub_off_t pos, grub_size_t len, char *buf, + grub_disk_addr_t (*get_block) (grub_fshelp_node_t node, + grub_disk_addr_t block), grub_off_t filesize, int log2blocksize) { - int i; - int blockcnt; + grub_disk_addr_t i, blockcnt; int blocksize = 1 << (log2blocksize + GRUB_DISK_SECTOR_BITS); /* Adjust LEN so it we can't read past the end of the file. */ - if (len > filesize) - len = filesize; + if (pos + len > filesize) + len = filesize - pos; - blockcnt = ((len + pos) + blocksize - 1) / blocksize; + blockcnt = ((len + pos) + blocksize - 1) >> (log2blocksize + GRUB_DISK_SECTOR_BITS); - for (i = pos / blocksize; i < blockcnt; i++) + for (i = pos >> (log2blocksize + GRUB_DISK_SECTOR_BITS); i < blockcnt; i++) { - int blknr; - int blockoff = pos % blocksize; + grub_disk_addr_t blknr; + int blockoff = pos & (blocksize - 1); int blockend = blocksize; int skipfirst = 0; @@ -255,7 +256,7 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, /* Last block. */ if (i == blockcnt - 1) { - blockend = (len + pos) % blocksize; + blockend = (len + pos) & (blocksize - 1); /* The last portion is exactly blocksize. */ if (! blockend) @@ -263,7 +264,7 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, } /* First block. */ - if (i == pos / blocksize) + if (i == (pos >> (log2blocksize + GRUB_DISK_SECTOR_BITS))) { skipfirst = blockoff; blockend -= skipfirst; @@ -310,3 +311,30 @@ grub_fshelp_log2blksize (unsigned int blksize, unsigned int *pow) return GRUB_ERR_NONE; } + +grub_disk_addr_t +grub_fshelp_map_block (grub_fshelp_journal_t log, grub_disk_addr_t block) +{ + int map_block; + + if (! log) + return block; + + for (map_block = log->num_mappings - 1; map_block >= 0; map_block--) + { + if (log->mapping[map_block] == block) + break; + } + + if (map_block < 0) + return block; + + map_block += log->start_block; + if (map_block >= log->last_block) + map_block -= log->last_block - log->first_block; + + if (log->type == GRUB_FSHELP_JOURNAL_TYPE_BLOCK) + return log->blkno + map_block; + else + return log->get_block (log->node, map_block); +} diff --git a/fs/hfsplus.c b/fs/hfsplus.c index fe7253945..a13051a43 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -285,8 +285,8 @@ static int grub_hfsplus_cmp_extkey (struct grub_hfsplus_key *keya, /* Search for the block FILEBLOCK inside the file NODE. Return the blocknumber of this block on disk. */ -static int -grub_hfsplus_read_block (grub_fshelp_node_t node, int fileblock) +static grub_disk_addr_t +grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_hfsplus_btnode *nnode = 0; int blksleft = fileblock; diff --git a/fs/ntfs.c b/fs/ntfs.c index 2922ade6e..786f0e3d1 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -331,8 +331,8 @@ retry: return 0; } -static int -grub_ntfs_read_block (grub_fshelp_node_t node, int block) +static grub_disk_addr_t +grub_ntfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t block) { struct grub_ntfs_rlst *ctx; diff --git a/fs/reiserfs.c b/fs/reiserfs.c index b536b21fd..554d10453 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -52,7 +52,8 @@ #define REISERFS_SUPER_BLOCK_OFFSET 0x10000 #define REISERFS_MAGIC_LEN 12 -#define REISERFS_MAGIC_STRING "ReIsEr2Fs\0\0\0" +#define REISERFS_MAGIC_STRING "ReIsEr" +#define REISERFS_MAGIC_DESC_BLOCK "ReIsErLB" /* If the 3rd bit of an item state is set, then it's visible. */ #define GRUB_REISERFS_VISIBLE_MASK ((grub_uint16_t) 0x04) #define REISERFS_MAX_LABEL_LENGTH 16 @@ -109,8 +110,6 @@ struct grub_reiserfs_superblock grub_uint32_t inode_generation; } __attribute__ ((packed)); -#ifdef GRUB_REISERFS_JOURNALING -# error "Journaling not yet supported." struct grub_reiserfs_journal_header { grub_uint32_t last_flush_uid; @@ -118,15 +117,20 @@ struct grub_reiserfs_journal_header grub_uint32_t mount_id; } __attribute__ ((packed)); -struct grub_reiserfs_transaction_header +struct grub_reiserfs_description_block { grub_uint32_t id; grub_uint32_t len; grub_uint32_t mount_id; - char *data; - char checksum[12]; + grub_uint32_t real_blocks[0]; +} __attribute__ ((packed)); + +struct grub_reiserfs_commit_block +{ + grub_uint32_t id; + grub_uint32_t len; + grub_uint32_t real_blocks[0]; } __attribute__ ((packed)); -#endif struct grub_reiserfs_stat_item_v1 { @@ -228,6 +232,7 @@ struct grub_reiserfs_data { struct grub_reiserfs_superblock superblock; grub_disk_t disk; + grub_fshelp_journal_t journal; }; /* Internal-only functions. Not to be used outside of this file. */ @@ -504,8 +509,8 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, do { grub_disk_read (data->disk, - (((grub_disk_addr_t) block_number * block_size) - >> GRUB_DISK_SECTOR_BITS), + grub_fshelp_map_block (data->journal, block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS), (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), block_size, (char *) block_header); @@ -655,8 +660,8 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) block_size = grub_le_to_cpu16 (node->data->superblock.block_size); len = grub_le_to_cpu16 (found.header.item_size); - block = (((grub_disk_addr_t) found.block_number * block_size) - >> GRUB_DISK_SECTOR_BITS); + block = (grub_fshelp_map_block (node->data->journal, found.block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS)); offset = grub_le_to_cpu16 (found.header.item_location); symlink_buffer = grub_malloc (len + 1); @@ -675,6 +680,124 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) return 0; } +static void +grub_reiserfs_get_journal (struct grub_reiserfs_data *data) +{ + int block_size = grub_le_to_cpu16 (data->superblock.block_size); + char buf[block_size]; + struct grub_reiserfs_journal_header *jh; + grub_fshelp_journal_t log; + grub_uint32_t seq_id, mount_id; + int num_blocks = grub_le_to_cpu32 (data->superblock.journal_original_size); + int base_block = grub_le_to_cpu32 (data->superblock.journal_block); + int last_num, num, block; + + data->journal = 0; + + if (! data->superblock.journal_block) + return; + + if (grub_disk_read (data->disk, + (base_block + num_blocks) + * (block_size >> GRUB_DISK_SECTOR_BITS), + 0, sizeof (struct grub_reiserfs_journal_header), + buf)) + return; + + log = grub_malloc (sizeof (struct grub_fshelp_journal) + + num_blocks * sizeof (grub_disk_addr_t)); + if (! log) + return; + + jh = (struct grub_reiserfs_journal_header *) &buf[0]; + + log->type = GRUB_FSHELP_JOURNAL_TYPE_BLOCK; + log->blkno = base_block; + log->first_block = 0; + log->last_block = num_blocks; + log->start_block = grub_le_to_cpu32 (jh->unflushed_offset); + + seq_id = grub_le_to_cpu32 (jh->last_flush_uid); + mount_id = grub_le_to_cpu32 (jh->mount_id); + + last_num = num = 0; + block = log->start_block; + + while (1) + { + struct grub_reiserfs_description_block *db; + struct grub_reiserfs_commit_block *cb; + grub_uint32_t i, len, half_len, id, mid; + + if (grub_disk_read (data->disk, + (base_block + block) + * (block_size >> GRUB_DISK_SECTOR_BITS), + 0, sizeof (buf), buf)) + break; + + if (grub_memcmp (&buf[block_size - REISERFS_MAGIC_LEN], + REISERFS_MAGIC_DESC_BLOCK, + sizeof (REISERFS_MAGIC_DESC_BLOCK) - 1)) + break; + + db = (struct grub_reiserfs_description_block *) &buf[0]; + id = grub_le_to_cpu32 (db->id); + len = grub_le_to_cpu32 (db->len); + mid = grub_le_to_cpu32 (db->mount_id); + if ((id <= seq_id) && (mid <= mount_id)) + break; + + log->mapping[num++] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; + half_len = ((block_size - 24) >> 2); + if (half_len > len) + half_len = len; + + for (i = 0; i < half_len; i++) + log->mapping[num++] = db->real_blocks[i]; + + block += grub_le_to_cpu32 (db->len) + 1; + if (block >= log->last_block) + block -= log->last_block; + + if (grub_disk_read (data->disk, + (base_block + block) + * (block_size >> GRUB_DISK_SECTOR_BITS), + 0, sizeof (buf), buf)) + break; + + cb = (struct grub_reiserfs_commit_block *) &buf[0]; + if ((grub_le_to_cpu32 (cb->id) != id) || + (grub_le_to_cpu32 (cb->len) != len)) + break; + + for (i = 0; i < len - half_len; i++) + log->mapping[num++] = cb->real_blocks[i]; + + last_num = num; + log->mapping[num++] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; + + block++; + if (block >= log->last_block) + block -= log->last_block; + + seq_id = id; + mount_id = mid; + }; + + if (! last_num) + grub_free (log); + else + { + int size; + + size = sizeof (struct grub_fshelp_journal) + + last_num * sizeof (grub_disk_addr_t); + + log->num_mappings = last_num; + data->journal = grub_realloc (log, size); + } +} + /* Fill the mounted filesystem structure and return it. */ static struct grub_reiserfs_data * grub_reiserfs_mount (grub_disk_t disk) @@ -688,12 +811,13 @@ grub_reiserfs_mount (grub_disk_t disk) if (grub_errno) goto fail; if (grub_memcmp (data->superblock.magic_string, - REISERFS_MAGIC_STRING, REISERFS_MAGIC_LEN)) + REISERFS_MAGIC_STRING, sizeof (REISERFS_MAGIC_STRING) - 1)) { grub_error (GRUB_ERR_BAD_FS, "not a reiserfs filesystem"); goto fail; } data->disk = disk; + grub_reiserfs_get_journal (data); return data; fail: @@ -741,8 +865,8 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, struct grub_reiserfs_item_header *item_headers; grub_disk_read (data->disk, - (((grub_disk_addr_t) block_number * block_size) - >> GRUB_DISK_SECTOR_BITS), + grub_fshelp_map_block (data->journal, block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS), (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), block_size, (char *) block_header); @@ -836,7 +960,8 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, { struct grub_reiserfs_stat_item_v1 entry_v1_stat; grub_disk_read (data->disk, - ((grub_disk_addr_t) entry_block_number * block_size) >> GRUB_DISK_SECTOR_BITS, + grub_fshelp_map_block (data->journal, entry_block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS), grub_le_to_cpu16 (entry_item->header.item_location), sizeof (entry_v1_stat), (char *) &entry_v1_stat); @@ -878,7 +1003,8 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, { struct grub_reiserfs_stat_item_v2 entry_v2_stat; grub_disk_read (data->disk, - ((grub_disk_addr_t) entry_block_number * block_size) >> GRUB_DISK_SECTOR_BITS, + grub_fshelp_map_block (data->journal, entry_block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS), grub_le_to_cpu16 (entry_item->header.item_location), sizeof (entry_v2_stat), (char *) &entry_v2_stat); @@ -1026,8 +1152,8 @@ grub_reiserfs_open (struct grub_file *file, const char *name) { struct grub_reiserfs_stat_item_v1 entry_v1_stat; grub_disk_read (data->disk, - (((grub_disk_addr_t) block_number * block_size) - >> GRUB_DISK_SECTOR_BITS), + grub_fshelp_map_block (data->journal, block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS), entry_location + (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), @@ -1040,8 +1166,8 @@ grub_reiserfs_open (struct grub_file *file, const char *name) { struct grub_reiserfs_stat_item_v2 entry_v2_stat; grub_disk_read (data->disk, - (((grub_disk_addr_t) block_number * block_size) - >> GRUB_DISK_SECTOR_BITS), + grub_fshelp_map_block (data->journal, block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS), entry_location + (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), @@ -1109,8 +1235,8 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) switch (found.type) { case GRUB_REISERFS_DIRECT: - block = (((grub_disk_addr_t) found.block_number * block_size) - >> GRUB_DISK_SECTOR_BITS); + block = (grub_fshelp_map_block (data->journal, found.block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS)); grub_dprintf ("reiserfs_blocktype", "D: %u\n", (unsigned) block); if (initial_position < current_position + item_size) { @@ -1142,8 +1268,8 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) if (! indirect_block_ptr) goto fail; grub_disk_read (found.data->disk, - (((grub_disk_addr_t) found.block_number * block_size) - >> GRUB_DISK_SECTOR_BITS), + grub_fshelp_map_block (data->journal, found.block_number) * + (block_size >> GRUB_DISK_SECTOR_BITS), grub_le_to_cpu16 (found.header.item_location), item_size, (char *) indirect_block_ptr); if (grub_errno) @@ -1154,9 +1280,9 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) && current_position < final_position; indirect_block++) { - block = ((grub_disk_addr_t) - grub_le_to_cpu32 (indirect_block_ptr[indirect_block]) - * block_size) >> GRUB_DISK_SECTOR_BITS; + block = (grub_fshelp_map_block (data->journal, + grub_le_to_cpu32 (indirect_block_ptr[indirect_block])) * + (block_size >> GRUB_DISK_SECTOR_BITS)); grub_dprintf ("reiserfs_blocktype", "I: %u\n", (unsigned) block); if (current_position + block_size >= initial_position) { @@ -1255,6 +1381,7 @@ grub_reiserfs_close (grub_file_t file) struct grub_fshelp_node *node = file->data; struct grub_reiserfs_data *data = node->data; + grub_free (data->journal); grub_free (data); grub_free (node); #ifndef GRUB_UTIL diff --git a/fs/sfs.c b/fs/sfs.c index a453bc69c..82a0a9ec8 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -219,8 +219,8 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, return grub_error (GRUB_ERR_FILE_READ_ERROR, "SFS extent not found"); } -static int -grub_sfs_read_block (grub_fshelp_node_t node, int fileblock) +static grub_disk_addr_t +grub_sfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { int blk = node->block; int size = 0; @@ -239,7 +239,7 @@ grub_sfs_read_block (grub_fshelp_node_t node, int fileblock) if (err) return 0; - if (fileblock < size) + if (fileblock < (unsigned int) size) return fileblock + blk; fileblock -= size; diff --git a/fs/udf.c b/fs/udf.c index 8f833eb3c..072e44fc3 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -404,8 +404,8 @@ grub_udf_read_icb (struct grub_udf_data *data, return 0; } -static int -grub_udf_read_block (grub_fshelp_node_t node, int fileblock) +static grub_disk_addr_t +grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { char *ptr; int len; @@ -429,7 +429,7 @@ grub_udf_read_block (grub_fshelp_node_t node, int fileblock) len /= sizeof (struct grub_udf_short_ad); while (len > 0) { - if (fileblock < (int) U32 (ad->length)) + if (fileblock < U32 (ad->length)) return ((U32 (ad->position) & GRUB_UDF_EXT_MASK) ? 0 : (grub_udf_get_block (node->data, node->part_ref, @@ -448,7 +448,7 @@ grub_udf_read_block (grub_fshelp_node_t node, int fileblock) len /= sizeof (struct grub_udf_long_ad); while (len > 0) { - if (fileblock < (int) U32 (ad->length)) + if (fileblock < U32 (ad->length)) return ((U32 (ad->block.block_num) & GRUB_UDF_EXT_MASK) ? 0 : (grub_udf_get_block (node->data, ad->block.part_ref, diff --git a/fs/xfs.c b/fs/xfs.c index 88d22be6d..39fe0835b 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -220,8 +220,8 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, } -static int -grub_xfs_read_block (grub_fshelp_node_t node, int fileblock) +static grub_disk_addr_t +grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_xfs_btree_node *leaf = 0; int ex, nrec; @@ -244,7 +244,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, int fileblock) for (i = 0; i < nrec; i++) { - if ((grub_uint64_t) fileblock < grub_be_to_cpu64 (keys[i])) + if (fileblock < grub_be_to_cpu64 (keys[i])) break; } @@ -292,8 +292,8 @@ grub_xfs_read_block (grub_fshelp_node_t node, int fileblock) for (ex = 0; ex < nrec; ex++) { grub_uint64_t start = GRUB_XFS_EXTENT_BLOCK (exts, ex); - int offset = GRUB_XFS_EXTENT_OFFSET (exts, ex); - int size = GRUB_XFS_EXTENT_SIZE (exts, ex); + grub_uint64_t offset = GRUB_XFS_EXTENT_OFFSET (exts, ex); + grub_uint64_t size = GRUB_XFS_EXTENT_SIZE (exts, ex); /* Sparse block. */ if (fileblock < offset) diff --git a/include/grub/fshelp.h b/include/grub/fshelp.h index e25dd16a8..32d47a34a 100644 --- a/include/grub/fshelp.h +++ b/include/grub/fshelp.h @@ -34,6 +34,34 @@ enum grub_fshelp_filetype GRUB_FSHELP_SYMLINK }; +enum grub_fshelp_journal_type + { + GRUB_FSHELP_JOURNAL_TYPE_BLOCK, + GRUB_FSHELP_JOURNAL_TYPE_FILE + }; + +#define GRUB_FSHELP_JOURNAL_UNUSED_MAPPING (grub_disk_addr_t) -1 + +struct grub_fshelp_journal +{ + int type; + union + { + struct + { + grub_fshelp_node_t node; + grub_disk_addr_t (*get_block) (grub_fshelp_node_t node, grub_disk_addr_t block); + }; + grub_disk_addr_t blkno; + }; + int first_block; + int last_block; + int start_block; + int num_mappings; + grub_disk_addr_t mapping[0]; +}; +typedef struct grub_fshelp_journal *grub_fshelp_journal_t; + /* Lookup the node PATH. The node ROOTNODE describes the root of the directory tree. The node found is returned in FOUNDNODE, which is either a ROOTNODE or a new malloc'ed node. ITERATE_DIR is used to @@ -64,15 +92,18 @@ EXPORT_FUNC(grub_fshelp_find_file) (const char *path, grub_ssize_t EXPORT_FUNC(grub_fshelp_read_file) (grub_disk_t disk, grub_fshelp_node_t node, void NESTED_FUNC_ATTR (*read_hook) (grub_disk_addr_t sector, - unsigned offset, - unsigned length), - int pos, grub_size_t len, char *buf, - int (*get_block) (grub_fshelp_node_t node, - int block), + unsigned offset, + unsigned length), + grub_off_t pos, grub_size_t len, char *buf, + grub_disk_addr_t (*get_block) (grub_fshelp_node_t node, + grub_disk_addr_t block), grub_off_t filesize, int log2blocksize); unsigned int EXPORT_FUNC(grub_fshelp_log2blksize) (unsigned int blksize, unsigned int *pow); +grub_disk_addr_t +EXPORT_FUNC(grub_fshelp_map_block) (grub_fshelp_journal_t log, grub_disk_addr_t block); + #endif /* ! GRUB_FSHELP_HEADER */ From 23023641b8b94910c29234ee4e936ed5c49d025d Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 28 May 2008 19:53:25 +0000 Subject: [PATCH 0132/1707] 2008-05-28 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle MMC devices. * util/grub-mkdevicemap.c (get_mmc_disk_name) (make_device_map): Likewise. --- ChangeLog | 7 +++++++ util/biosdisk.c | 18 +++++++++++++++++- util/grub-mkdevicemap.c | 22 ++++++++++++++++++++++ 3 files changed, 46 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d4dcd5907..2f6b3f697 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-28 Robert Millan + + * util/biosdisk.c (linux_find_partition, get_os_disk): Handle MMC + devices. + * util/grub-mkdevicemap.c (get_mmc_disk_name) + (make_device_map): Likewise. + 2008-05-20 Bean * fs/fshelp.c (grub_fshelp_map_block): New function. diff --git a/util/biosdisk.c b/util/biosdisk.c index ddb3718c0..651677f02 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -239,7 +239,7 @@ linux_find_partition (char *dev, unsigned long sector) || strncmp (real_dev + 5, "sd", 2) == 0) && real_dev[7] >= 'a' && real_dev[7] <= 'z') { - p = real_dev + 8; + p = real_dev + sizeof("/dev/hda")-1; format = "%d"; } else if (strncmp (real_dev + 5, "rd/c", 4) == 0) /* dac960 */ @@ -266,6 +266,11 @@ linux_find_partition (char *dev, unsigned long sector) format = "p%d"; } + else if (strncmp (real_dev + 5, "mmcblk", sizeof("mmcblk")-1) == 0) + { + p = real_dev + sizeof("/dev/mmcblk0")-1; + format = "p%d"; + } else return 0; @@ -675,6 +680,17 @@ get_os_disk (const char *os_dev) return path; } + /* If this is a MultiMediaCard (MMC). */ + if (strncmp ("mmcblk", p, sizeof ("mmcblk") - 1) == 0) + { + /* /dev/mmcblk[0-9]+(p[0-9]+)? */ + p = strchr (p, 'p'); + if (p) + *p = '\0'; + + return path; + } + /* If this is an IDE, SCSI or Virtio disk. */ if ((strncmp ("hd", p, 2) == 0 || strncmp ("vd", p, 2) == 0 diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index d24d84416..2e8e82dba 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -296,6 +296,12 @@ get_cciss_disk_name (char *name, int controller, int drive) sprintf (name, "/dev/cciss/c%dd%d", controller, drive); } +static void +get_mmc_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/mmcblk%d", unit); +} + static void get_xvd_disk_name (char *name, int unit) { @@ -598,6 +604,22 @@ make_device_map (const char *device_map, int floppy_disks) } } + /* MultiMediaCard (MMC). */ + for (i = 0; i < 10; i++) + { + char name[16]; + + get_mmc_disk_name (name, i); + if (check_device (name)) + { + char *p; + p = grub_util_get_disk_name (num_hd, name); + fprintf (fp, "(%s)\t%s\n", p, name); + free (p); + num_hd++; + } + } + finish: #endif /* __linux__ */ From 12e65f3ab60a77a9f54fde63358794a0cd410468 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 28 May 2008 19:55:10 +0000 Subject: [PATCH 0133/1707] 2008-05-28 Robert Millan * util/update-grub.in: Allow chmod call to fail, since /boot/grub/ might need to be fatfs to support some firmware implementations (e.g. OFW or EFI). --- ChangeLog | 6 ++++++ util/update-grub.in | 5 ++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2f6b3f697..6bc6533c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-28 Robert Millan + + * util/update-grub.in: Allow chmod call to fail, since /boot/grub/ + might need to be fatfs to support some firmware implementations + (e.g. OFW or EFI). + 2008-05-28 Robert Millan * util/biosdisk.c (linux_find_partition, get_os_disk): Handle MMC diff --git a/util/update-grub.in b/util/update-grub.in index cb38610f3..e698e435d 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -161,7 +161,10 @@ export GRUB_DEVICE GRUB_FS GRUB_DRIVE GRUB_DRIVE_BOOT GRUB_DRIVE_BOOT_GRUB GRUB_ export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND exec > ${grub_cfg}.new -chmod 444 ${grub_cfg}.new + +# Allow this to fail, since /boot/grub/ might need to be fatfs to support some +# firmware implementations (e.g. OFW or EFI). +chmod 444 ${grub_cfg}.new || true echo "Updating ${grub_cfg} ..." >&2 From da9a6a946349f352efe6edf2fae7e5209ab72204 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 29 May 2008 13:01:43 +0000 Subject: [PATCH 0134/1707] 2008-05-29 Robert Millan * fs/affs.c: Update copyright year. * fs/ext2.c: Likewise. * fs/fshelp.c: Likewise. * fs/hfsplus.c: Likewise. * fs/ntfs.c: Likewise. * fs/xfs.c: Likewise. * include/grub/fshelp.h: Likewise. * util/grub-mkdevicemap.c: Likewise. --- ChangeLog | 11 +++++++++++ commands/cat.c | 2 +- fs/affs.c | 2 +- fs/ext2.c | 2 +- fs/fshelp.c | 2 +- fs/hfsplus.c | 2 +- fs/ntfs.c | 2 +- fs/xfs.c | 2 +- include/grub/fshelp.h | 2 +- util/grub-mkdevicemap.c | 2 +- 10 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6bc6533c9..4e9bd21aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-05-29 Robert Millan + + * fs/affs.c: Update copyright year. + * fs/ext2.c: Likewise. + * fs/fshelp.c: Likewise. + * fs/hfsplus.c: Likewise. + * fs/ntfs.c: Likewise. + * fs/xfs.c: Likewise. + * include/grub/fshelp.h: Likewise. + * util/grub-mkdevicemap.c: Likewise. + 2008-05-28 Robert Millan * util/update-grub.in: Allow chmod call to fail, since /boot/grub/ diff --git a/commands/cat.c b/commands/cat.c index 01fa3a455..b5dda4de0 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -1,7 +1,7 @@ /* cat.c - command to show the contents of a file */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/affs.c b/fs/affs.c index f1592ab78..c60fd9cf2 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -1,7 +1,7 @@ /* affs.c - Amiga Fast FileSystem. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/ext2.c b/fs/ext2.c index c09662859..e17aac2de 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -1,7 +1,7 @@ /* ext2.c - Second Extended filesystem */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/fshelp.c b/fs/fshelp.c index 8a4f0612b..faec1f7fd 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -1,7 +1,7 @@ /* fshelp.c -- Filesystem helper functions */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/hfsplus.c b/fs/hfsplus.c index a13051a43..e6493ce03 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -1,7 +1,7 @@ /* hfsplus.c - HFS+ Filesystem. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/ntfs.c b/fs/ntfs.c index 786f0e3d1..ad5374091 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -1,7 +1,7 @@ /* ntfs.c - NTFS filesystem */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. + * Copyright (C) 2007,2008 Free Software Foundation, Inc. * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/xfs.c b/fs/xfs.c index 39fe0835b..a778e9905 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -1,7 +1,7 @@ /* xfs.c - XFS. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/grub/fshelp.h b/include/grub/fshelp.h index 32d47a34a..0120cbf71 100644 --- a/include/grub/fshelp.h +++ b/include/grub/fshelp.h @@ -1,7 +1,7 @@ /* fshelp.h -- Filesystem helper functions */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 2e8e82dba..4bb1c486e 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -1,7 +1,7 @@ /* grub-mkdevicemap.c - make a device map file automatically */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From eee96e08377907e93f7e5d202710d4bd89d69495 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 29 May 2008 16:27:24 +0000 Subject: [PATCH 0135/1707] 2008-05-29 Robert Millan * util/powerpc/ieee1275/grub-install.in: Move from here ... * util/ieee1275/grub-install.in: ... to here. * powerpc-ieee1275.rmk (grub_install_SOURCES): Update location. * i386-ieee1275.rmk (sbin_SCRIPTS): New variable. (grub_install_SOURCES): Likewise. --- ChangeLog | 8 ++++++++ DISTLIST | 2 +- conf/i386-ieee1275.mk | 12 ++++++++++++ conf/i386-ieee1275.rmk | 6 ++++++ conf/powerpc-ieee1275.mk | 6 +++--- conf/powerpc-ieee1275.rmk | 2 +- util/{powerpc => }/ieee1275/grub-install.in | 0 7 files changed, 31 insertions(+), 5 deletions(-) rename util/{powerpc => }/ieee1275/grub-install.in (100%) diff --git a/ChangeLog b/ChangeLog index 4e9bd21aa..dcbf025ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-29 Robert Millan + + * util/powerpc/ieee1275/grub-install.in: Move from here ... + * util/ieee1275/grub-install.in: ... to here. + * powerpc-ieee1275.rmk (grub_install_SOURCES): Update location. + * i386-ieee1275.rmk (sbin_SCRIPTS): New variable. + (grub_install_SOURCES): Likewise. + 2008-05-29 Robert Millan * fs/affs.c: Update copyright year. diff --git a/DISTLIST b/DISTLIST index b2f5f832b..7b9598cde 100644 --- a/DISTLIST +++ b/DISTLIST @@ -341,9 +341,9 @@ util/i386/pc/grub-mkrescue.in util/i386/pc/grub-setup.c util/i386/pc/misc.c util/ieee1275/get_disk_name.c +util/ieee1275/grub-install.in util/lvm.c util/misc.c -util/powerpc/ieee1275/grub-install.in util/powerpc/ieee1275/grub-mkrescue.in util/powerpc/ieee1275/misc.c util/raid.c diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index eb0334c2a..9cb46947f 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -571,6 +571,18 @@ grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) grub_emu_LDFLAGS = $(LIBCURSES) +# Scripts. +sbin_SCRIPTS = grub-install + +# For grub-install. +grub_install_SOURCES = util/ieee1275/grub-install.in +CLEANFILES += grub-install + +grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPENDENCIES) config.status + ./config.status --file=grub-install:util/ieee1275/grub-install.in + chmod +x $@ + + # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 0c62aeaf5..17f035f02 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -95,6 +95,12 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_emu_LDFLAGS = $(LIBCURSES) +# Scripts. +sbin_SCRIPTS = grub-install + +# For grub-install. +grub_install_SOURCES = util/ieee1275/grub-install.in + # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index a44b7accc..32f2a0b29 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -555,11 +555,11 @@ sbin_SCRIPTS = grub-install bin_SCRIPTS = grub-mkrescue # For grub-install. -grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in +grub_install_SOURCES = util/ieee1275/grub-install.in CLEANFILES += grub-install -grub-install: util/powerpc/ieee1275/grub-install.in $(util/powerpc/ieee1275/grub-install.in_DEPENDENCIES) config.status - ./config.status --file=grub-install:util/powerpc/ieee1275/grub-install.in +grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPENDENCIES) config.status + ./config.status --file=grub-install:util/ieee1275/grub-install.in chmod +x $@ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b5ab18625..deab80b41 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -99,7 +99,7 @@ sbin_SCRIPTS = grub-install bin_SCRIPTS = grub-mkrescue # For grub-install. -grub_install_SOURCES = util/powerpc/ieee1275/grub-install.in +grub_install_SOURCES = util/ieee1275/grub-install.in # For grub-mkrescue. grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in diff --git a/util/powerpc/ieee1275/grub-install.in b/util/ieee1275/grub-install.in similarity index 100% rename from util/powerpc/ieee1275/grub-install.in rename to util/ieee1275/grub-install.in From ee632529051deaabbcf5bf43fa96a63cbe53180c Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 29 May 2008 17:40:27 +0000 Subject: [PATCH 0136/1707] 2008-05-29 Robert Millan * term/i386/pc/at_keyboard.c (grub_console_checkkey): Add support for control key combinations. --- ChangeLog | 5 +++++ term/i386/pc/at_keyboard.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index dcbf025ab..f70fdfddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-29 Robert Millan + + * term/i386/pc/at_keyboard.c (grub_console_checkkey): Add support for + control key combinations. + 2008-05-29 Robert Millan * util/powerpc/ieee1275/grub-install.in: Move from here ... diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index 51799e154..2417bf5f4 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -186,7 +186,9 @@ grub_console_checkkey (void) key = -1; break; default: - if ((at_keyboard_status & (KEYBOARD_STATUS_SHIFT_L | KEYBOARD_STATUS_SHIFT_R)) + if (at_keyboard_status & (KEYBOARD_STATUS_CTRL_L | KEYBOARD_STATUS_CTRL_R)) + key = keyboard_map[key] - 'a' + 1; + else if ((at_keyboard_status & (KEYBOARD_STATUS_SHIFT_L | KEYBOARD_STATUS_SHIFT_R)) && keyboard_map_shift[key]) key = keyboard_map_shift[key]; else From 47248e08256f17ff29cdd029cf653511095886d7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 29 May 2008 18:15:27 +0000 Subject: [PATCH 0137/1707] 2008-05-29 Robert Millan * term/i386/pc/at_keyboard.c: Include `grub/machine/machine.h'. (OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): New macros. [GRUB_MACHINE_IEEE1275] (keyboard_map): Add OLPC scan codes (grub_console_checkkey): Add grub_dprintf() call to report unknown scan codes. --- ChangeLog | 8 ++++++++ term/i386/pc/at_keyboard.c | 38 +++++++++++++++++++++++++++++--------- 2 files changed, 37 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f70fdfddb..f69678bab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-29 Robert Millan + + * term/i386/pc/at_keyboard.c: Include `grub/machine/machine.h'. + (OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): New macros. + [GRUB_MACHINE_IEEE1275] (keyboard_map): Add OLPC scan codes + (grub_console_checkkey): Add grub_dprintf() call to report unknown + scan codes. + 2008-05-29 Robert Millan * term/i386/pc/at_keyboard.c (grub_console_checkkey): Add support for diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index 2417bf5f4..b62cd6678 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -51,6 +52,18 @@ static short at_keyboard_status = 0; +#ifdef GRUB_MACHINE_IEEE1275 +#define OLPC_UP GRUB_TERM_UP +#define OLPC_DOWN GRUB_TERM_DOWN +#define OLPC_LEFT GRUB_TERM_LEFT +#define OLPC_RIGHT GRUB_TERM_RIGHT +#else +#define OLPC_UP '\0' +#define OLPC_DOWN '\0' +#define OLPC_LEFT '\0' +#define OLPC_RIGHT '\0' +#endif + static char keyboard_map[128] = { '\0', GRUB_TERM_ESC, '1', '2', '3', '4', '5', '6', @@ -63,7 +76,10 @@ static char keyboard_map[128] = '\0', ' ', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', GRUB_TERM_HOME, GRUB_TERM_UP, GRUB_TERM_NPAGE, '-', GRUB_TERM_LEFT, '\0', GRUB_TERM_RIGHT, '+', GRUB_TERM_END, - GRUB_TERM_DOWN, GRUB_TERM_PPAGE, '\0', GRUB_TERM_DC + GRUB_TERM_DOWN, GRUB_TERM_PPAGE, '\0', GRUB_TERM_DC, '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', OLPC_UP, OLPC_DOWN, OLPC_LEFT, + OLPC_RIGHT }; static char keyboard_map_shift[128] = @@ -167,14 +183,14 @@ grub_keyboard_getkey (void) int grub_console_checkkey (void) { - int key; - key = grub_keyboard_getkey (); - if (key == -1) + int code, key; + code = grub_keyboard_getkey (); + if (code == -1) return -1; #ifdef DEBUG_AT_KEYBOARD grub_dprintf ("atkeyb", "Detected key 0x%x\n", key); #endif - switch (key) + switch (code) { case CAPS_LOCK: at_keyboard_status ^= KEYBOARD_STATUS_CAPS_LOCK; @@ -187,12 +203,16 @@ grub_console_checkkey (void) break; default: if (at_keyboard_status & (KEYBOARD_STATUS_CTRL_L | KEYBOARD_STATUS_CTRL_R)) - key = keyboard_map[key] - 'a' + 1; + key = keyboard_map[code] - 'a' + 1; else if ((at_keyboard_status & (KEYBOARD_STATUS_SHIFT_L | KEYBOARD_STATUS_SHIFT_R)) - && keyboard_map_shift[key]) - key = keyboard_map_shift[key]; + && keyboard_map_shift[code]) + key = keyboard_map_shift[code]; else - key = keyboard_map[key]; + key = keyboard_map[code]; + + if (key == 0) + grub_dprintf ("atkeyb", "Unknown key 0x%x detected\n", code); + if (at_keyboard_status & KEYBOARD_STATUS_CAPS_LOCK) { if ((key >= 'a') && (key <= 'z')) From 528ad8f272bc8de6324f15b155178b144a4fec2c Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 30 May 2008 03:26:56 +0000 Subject: [PATCH 0138/1707] 2008-05-29 Pavel Roskin * include/grub/script.h: Don't include grub_script.tab.h. It's a generated file, which may only be included from the files with DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE, use union YYSTYPE, as the later allows forward declaration. * normal/lexer.c: Don't use typedef YYSTYPE, use union YYSTYPE. --- ChangeLog | 8 ++++++++ include/grub/script.h | 4 ++-- normal/lexer.c | 7 ++++--- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f69678bab..90536390c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-29 Pavel Roskin + + * include/grub/script.h: Don't include grub_script.tab.h. It's + a generated file, which may only be included from the files with + DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE, + use union YYSTYPE, as the later allows forward declaration. + * normal/lexer.c: Don't use typedef YYSTYPE, use union YYSTYPE. + 2008-05-29 Robert Millan * term/i386/pc/at_keyboard.c: Include `grub/machine/machine.h'. diff --git a/include/grub/script.h b/include/grub/script.h index 0dcd4a12b..5218d1352 100644 --- a/include/grub/script.h +++ b/include/grub/script.h @@ -23,7 +23,6 @@ #include #include #include -#include "grub_script.tab.h" struct grub_script_mem; @@ -238,7 +237,8 @@ struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *s void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size); /* Functions used by bison. */ -int grub_script_yylex (YYSTYPE *, struct grub_parser_param *); +union YYSTYPE; +int grub_script_yylex (union YYSTYPE *, struct grub_parser_param *); int grub_script_yyparse (struct grub_parser_param *); void grub_script_yyerror (struct grub_parser_param *, char const *); diff --git a/normal/lexer.c b/normal/lexer.c index b72b4ee47..d66237c6e 100644 --- a/normal/lexer.c +++ b/normal/lexer.c @@ -136,10 +136,11 @@ nextchar (struct grub_lexer_param *state) } int -grub_script_yylex2 (YYSTYPE *yylval, struct grub_parser_param *parsestate); +grub_script_yylex2 (union YYSTYPE *yylval, + struct grub_parser_param *parsestate); int -grub_script_yylex (YYSTYPE *yylval, struct grub_parser_param *parsestate) +grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) { int r = -1; @@ -153,7 +154,7 @@ grub_script_yylex (YYSTYPE *yylval, struct grub_parser_param *parsestate) } int -grub_script_yylex2 (YYSTYPE *yylval, struct grub_parser_param *parsestate) +grub_script_yylex2 (union YYSTYPE *yylval, struct grub_parser_param *parsestate) { grub_parser_state_t newstate; char use; From d1dff95dc7fa3c5227b038ce44e482000ecbf8fe Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 30 May 2008 03:57:16 +0000 Subject: [PATCH 0139/1707] 2008-05-29 Pavel Roskin * disk/lvm.c (grub_lvm_scan_device): Check for the buffer end when scanning metadata for volume group name. --- ChangeLog | 3 +++ disk/lvm.c | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 90536390c..eec4edcd1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-05-29 Pavel Roskin + * disk/lvm.c (grub_lvm_scan_device): Check for the buffer end + when scanning metadata for volume group name. + * include/grub/script.h: Don't include grub_script.tab.h. It's a generated file, which may only be included from the files with DEPENDENCIES rules in the makefile. Don't use typedef YYSTYPE, diff --git a/disk/lvm.c b/disk/lvm.c index 1d898ff55..997d15cd5 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -302,9 +302,12 @@ grub_lvm_scan_device (const char *name) rlocn = mdah->raw_locns; p = q = metadatabuf + grub_le_to_cpu64 (rlocn->offset); - while (*q != ' ') + while (*q != ' ' && q < metadatabuf + mda_size) q++; + if (q == metadatabuf + mda_size) + goto fail2; + vgname_len = q - p; vgname = grub_malloc (vgname_len + 1); if (!vgname) From 22f16596ae92f6591a2aa01b96696501d84ae3f4 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 30 May 2008 04:20:48 +0000 Subject: [PATCH 0140/1707] 2008-05-30 Pavel Roskin * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Remove, as compiling execute.c doesn't need grub_script.tab.h anymore. (normal/command.c_DEPENDENCIES): Likewise. (normal/function.c_DEPENDENCIES): Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. --- ChangeLog | 12 ++++++++++++ conf/i386-efi.mk | 3 --- conf/i386-efi.rmk | 3 --- conf/i386-ieee1275.mk | 3 --- conf/i386-ieee1275.rmk | 3 --- conf/i386-linuxbios.mk | 3 --- conf/i386-linuxbios.rmk | 3 --- conf/i386-pc.mk | 3 --- conf/i386-pc.rmk | 3 --- conf/powerpc-ieee1275.mk | 3 --- conf/powerpc-ieee1275.rmk | 3 --- conf/sparc64-ieee1275.mk | 3 --- conf/sparc64-ieee1275.rmk | 3 --- 13 files changed, 12 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index eec4edcd1..bdf54a4dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-05-30 Pavel Roskin + + * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Remove, as + compiling execute.c doesn't need grub_script.tab.h anymore. + (normal/command.c_DEPENDENCIES): Likewise. + (normal/function.c_DEPENDENCIES): Likewise. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-linuxbios.rmk: Likewise. + * conf/i386-pc.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + 2008-05-29 Pavel Roskin * disk/lvm.c (grub_lvm_scan_device): Check for the buffer end diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 7343672b0..b6a9d26f1 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -5,9 +5,6 @@ COMMON_CFLAGS = -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386 -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index cc60d3d63..87626c25e 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -5,9 +5,6 @@ COMMON_CFLAGS = -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386 -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 9cb46947f..667422a86 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -5,9 +5,6 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 17f035f02..ac2f45df4 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -5,9 +5,6 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 4bae9c617..467cc3863 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -5,9 +5,6 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 1721a1d14..31f03a9e5 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -5,9 +5,6 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index d06042185..6c0c12f73 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -7,9 +7,6 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 37a9f5bd9..a3f8467e9 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -7,9 +7,6 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 32f2a0b29..b9429372f 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -6,9 +6,6 @@ COMMON_CFLAGS = -ffreestanding -msoft-float COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index deab80b41..0dcc50234 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -6,9 +6,6 @@ COMMON_CFLAGS = -ffreestanding -msoft-float COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index f71249119..c1ff9cee9 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -6,9 +6,6 @@ COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index ff0f4e34e..c6d2ebca7 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -6,9 +6,6 @@ COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. From bbb64db0d3b5eafed7e7d2f2a44f7cc77e5b2c06 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 30 May 2008 04:22:04 +0000 Subject: [PATCH 0141/1707] Add 30_os-prober to .cvsignore --- .cvsignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.cvsignore b/.cvsignore index 818f53154..c609cd05a 100644 --- a/.cvsignore +++ b/.cvsignore @@ -6,6 +6,7 @@ 00_header 10_hurd 10_linux +30_os-prober Makefile autom4te.cache config.cache From 01b73ec8eb429ef58412e50a53894ece0c348b96 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 May 2008 10:50:00 +0000 Subject: [PATCH 0142/1707] 2008-05-30 Robert Millan * util/biosdisk.c (map): Redefine structure to hold information about GRUB drive name. (get_drive): Reimplement without assuming (and verifiing) BIOS-like drive names. (call_hook): Remove. (grub_util_biosdisk_iterate): Access drive names via `.drive' struct member. Assume drive has partitions. (grub_util_biosdisk_open): Access device names via `.device' struct member. (open_device): Likewise. (find_drive): Likewise. (read_device_map): Adjust map[] usage to match the new struct definition. Don't check for duplicates (still possible, but not cheap anymore). (grub_util_biosdisk_fini): Free malloced buffers referenced by map[]. (make_device_name): Remove assumption of BIOS-like drive names. --- ChangeLog | 19 ++++++++ util/biosdisk.c | 113 +++++++++++++++++++++++------------------------- 2 files changed, 73 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdf54a4dc..9c88d5e5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2008-05-30 Robert Millan + + * util/biosdisk.c (map): Redefine structure to hold information + about GRUB drive name. + (get_drive): Reimplement without assuming (and verifiing) BIOS-like + drive names. + (call_hook): Remove. + (grub_util_biosdisk_iterate): Access drive names via `.drive' struct + member. Assume drive has partitions. + (grub_util_biosdisk_open): Access device names via `.device' struct + member. + (open_device): Likewise. + (find_drive): Likewise. + (read_device_map): Adjust map[] usage to match the new struct + definition. Don't check for duplicates (still possible, but not cheap + anymore). + (grub_util_biosdisk_fini): Free malloced buffers referenced by map[]. + (make_device_name): Remove assumption of BIOS-like drive names. + 2008-05-30 Pavel Roskin * conf/i386-efi.rmk (normal/execute.c_DEPENDENCIES): Remove, as diff --git a/util/biosdisk.c b/util/biosdisk.c index 651677f02..2e1cec358 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -85,7 +85,11 @@ struct hd_geometry # define FLOPPY_MAJOR 2 #endif -static char *map[256]; +struct +{ + char *drive; + char *device; +} map[256]; #ifdef __linux__ /* Check if we have devfs support. */ @@ -108,45 +112,31 @@ have_devfs (void) static int get_drive (const char *name) { - unsigned long drive; - char *p; - - if ((name[0] != 'f' && name[0] != 'h') || name[1] != 'd') - goto fail; + unsigned int i; - drive = strtoul (name + 2, &p, 10); - if (p == name + 2) - goto fail; + if (name) + { + for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) + if (! strcmp (map[i].drive, name)) + return i; + } + else + { + for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) + if (! map[i].drive) + return i; + } - if (name[0] == 'h') - drive += 0x80; - - if (drive > sizeof (map) / sizeof (map[0])) - goto fail; - - return (int) drive; - - fail: - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a biosdisk"); return -1; } -static int -call_hook (int (*hook) (const char *name), int drive) -{ - char name[10]; - - sprintf (name, (drive & 0x80) ? "hd%d" : "fd%d", drive & (~0x80)); - return hook (name); -} - static int grub_util_biosdisk_iterate (int (*hook) (const char *name)) { unsigned i; for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) - if (map[i] && call_hook (hook, i)) + if (map[i].drive && hook (map[i].drive)) return 1; return 0; @@ -160,13 +150,10 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) drive = get_drive (name); if (drive < 0) - return grub_errno; - - if (! map[drive]) return grub_error (GRUB_ERR_BAD_DEVICE, "no mapping exists for `%s'", name); - disk->has_partitions = (drive & 0x80); + disk->has_partitions = 1; disk->id = drive; /* Get the size. */ @@ -175,9 +162,9 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) unsigned long long nr; int fd; - fd = open (map[drive], O_RDONLY); + fd = open (map[drive].device, O_RDONLY); if (fd == -1) - return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[drive]); + return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[drive].device); if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) { @@ -207,8 +194,8 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) #elif !defined (__GNU__) # warning "No special routine to get the size of a block device is implemented for your OS. This is not possibly fatal." #endif - if (stat (map[drive], &st) < 0) - return grub_error (GRUB_ERR_BAD_DEVICE, "cannot stat `%s'", map[drive]); + if (stat (map[drive].device, &st) < 0) + return grub_error (GRUB_ERR_BAD_DEVICE, "cannot stat `%s'", map[drive].device); disk->total_sectors = st.st_size >> GRUB_DISK_SECTOR_BITS; @@ -325,8 +312,8 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) int is_partition = 0; char dev[PATH_MAX]; - strcpy (dev, map[disk->id]); - if (disk->partition && strncmp (map[disk->id], "/dev/", 5) == 0) + strcpy (dev, map[disk->id].device); + if (disk->partition && strncmp (map[disk->id].device, "/dev/", 5) == 0) is_partition = linux_find_partition (dev, disk->partition->start); /* Open the partition. */ @@ -345,10 +332,10 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) sector -= disk->partition->start; } #else /* ! __linux__ */ - fd = open (map[disk->id], flags); + fd = open (map[disk->id].device, flags); if (fd < 0) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[disk->id]); + grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[disk->id].device); return -1; } #endif /* ! __linux__ */ @@ -366,7 +353,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) offset = (loff_t) sector << GRUB_DISK_SECTOR_BITS; if (_llseek (fd, offset >> 32, offset & 0xffffffff, &result, SEEK_SET)) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id]); + grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id].device); close (fd); return -1; } @@ -377,7 +364,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) if (lseek (fd, offset, SEEK_SET) != offset) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id]); + grub_error (GRUB_ERR_BAD_DEVICE, "cannot seek `%s'", map[disk->id].device); close (fd); return -1; } @@ -458,7 +445,7 @@ grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, parts. -jochen */ if (nread (fd, buf, GRUB_DISK_SECTOR_SIZE) != GRUB_DISK_SECTOR_SIZE) { - grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s'", map[disk->id]); + grub_error (GRUB_ERR_READ_ERROR, "cannot read `%s'", map[disk->id].device); close (fd); return grub_errno; } @@ -470,7 +457,7 @@ grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, if (nread (fd, buf, size << GRUB_DISK_SECTOR_BITS) != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) - grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id]); + grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id].device); close (fd); return grub_errno; @@ -488,7 +475,7 @@ grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, if (nwrite (fd, buf, size << GRUB_DISK_SECTOR_BITS) != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) - grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id]); + grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id].device); close (fd); return grub_errno; @@ -544,14 +531,20 @@ read_device_map (const char *dev_map) show_error ("No open parenthesis found"); p++; - drive = get_drive (p); - if (drive < 0 || drive >= (int) (sizeof (map) / sizeof (map[0]))) - show_error ("Bad device name"); + /* Find a free slot. */ + drive = get_drive (NULL); + if (drive < 0) + show_error ("Map table size exceeded"); + e = p; p = strchr (p, ')'); if (! p) show_error ("No close parenthesis found"); + map[drive].drive = xmalloc (p - e + sizeof ('\0')); + strncpy (map[drive].drive, e, p - e + sizeof ('\0')); + map[drive].drive[p - e] = '\0'; + p++; /* Skip leading spaces. */ while (*p && isspace (*p)) @@ -566,10 +559,6 @@ read_device_map (const char *dev_map) e++; *e = '\0'; - /* Multiple entries for a given drive is not allowed. */ - if (map[drive]) - show_error ("Duplicated entry found"); - if (stat (p, &st) == -1) { grub_util_info ("Cannot stat `%s', skipping", p); @@ -580,11 +569,11 @@ read_device_map (const char *dev_map) /* On Linux, the devfs uses symbolic links horribly, and that confuses the interface very much, so use realpath to expand symbolic links. */ - map[drive] = xmalloc (PATH_MAX); - if (! realpath (p, map[drive])) + map[drive].device = xmalloc (PATH_MAX); + if (! realpath (p, map[drive].device)) grub_util_error ("Cannot get the real path of `%s'", p); #else - map[drive] = xstrdup (p); + map[drive].device = xstrdup (p); #endif } @@ -604,7 +593,13 @@ grub_util_biosdisk_fini (void) unsigned i; for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) - free (map[i]); + { + if (map[i].drive) + free (map[i].drive); + if (map[i].device) + free (map[i].device); + map[i].drive = map[i].device = NULL; + } grub_disk_dev_unregister (&grub_util_biosdisk_dev); } @@ -615,7 +610,7 @@ make_device_name (int drive, int dos_part, int bsd_part) char *p; p = xmalloc (30); - sprintf (p, (drive & 0x80) ? "hd%d" : "fd%d", drive & ~0x80); + sprintf (p, "%s", map[drive].drive); if (dos_part >= 0) sprintf (p + strlen (p), ",%d", dos_part + 1); @@ -746,7 +741,7 @@ find_drive (const char *os_dev) return -1; for (i = 0; i < (int) (sizeof (map) / sizeof (map[0])); i++) - if (map[i] && strcmp (map[i], os_disk) == 0) + if (map[i].device && strcmp (map[i].device, os_disk) == 0) { free (os_disk); return i; From 6219127445f922b576b3b2b62a0f4fb3f2fbe472 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 May 2008 11:04:08 +0000 Subject: [PATCH 0143/1707] 2008-05-30 Robert Millan * commands/search.c (options): Add --fs_uuid option. (search_fs_uuid): New function. (grub_cmd_search): Fix --set argument passing. Use search_fs_uuid() when requested via --fs_uuid. (grub_search_init): Update help message. * fs/ext2.c (struct grub_ext2_sblock): Rename `unique_id' to `uuid' and redeclare it as an array of 16-bit words. (grub_ext2_uuid): New function. (grub_ext2_fs): Reference grub_ext2_uuid() in `uuid' struct member. * include/grub/fs.h (struct grub_fs): Add `uuid' struct member. * util/update-grub.in (GRUB_DEVICE_UUID, GRUB_DEVICE_BOOT) (GRUB_DEVICE_BOOT_UUID): New variables. (GRUB_DRIVE. GRUB_DRIVE_BOOT. GRUB_DRIVE_BOOT_GRUB): Remove. * util/grub.d/00_header.in: Set root using `search --fs_uuid' command whenever possible. * util/grub.d/10_hurd.in: Avoid explicit use of root drive. Instead, just assume `root' variable has the right value. * util/grub.d/10_linux.in: Likewise. * util/grub-probe.c (probe): Probe for filesystem UUID when requested via PRINT_FS_UUID. (main): Recognise `-t fs_uuid' argument. --- ChangeLog | 24 ++++++++++++++++ commands/search.c | 61 ++++++++++++++++++++++++++++++++++++---- fs/ext2.c | 37 ++++++++++++++++++++++-- include/grub/fs.h | 5 ++++ util/grub-probe.c | 31 ++++++++++++-------- util/grub.d/00_header.in | 8 ++++-- util/grub.d/10_hurd.in | 4 +-- util/grub.d/10_linux.in | 10 +++---- util/update-grub.in | 16 ++++------- 9 files changed, 159 insertions(+), 37 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c88d5e5c..2c1b5e3f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2008-05-30 Robert Millan + + * commands/search.c (options): Add --fs_uuid option. + (search_fs_uuid): New function. + (grub_cmd_search): Fix --set argument passing. + Use search_fs_uuid() when requested via --fs_uuid. + (grub_search_init): Update help message. + * fs/ext2.c (struct grub_ext2_sblock): Rename `unique_id' to `uuid' + and redeclare it as an array of 16-bit words. + (grub_ext2_uuid): New function. + (grub_ext2_fs): Reference grub_ext2_uuid() in `uuid' struct member. + * include/grub/fs.h (struct grub_fs): Add `uuid' struct member. + * util/update-grub.in (GRUB_DEVICE_UUID, GRUB_DEVICE_BOOT) + (GRUB_DEVICE_BOOT_UUID): New variables. + (GRUB_DRIVE. GRUB_DRIVE_BOOT. GRUB_DRIVE_BOOT_GRUB): Remove. + * util/grub.d/00_header.in: Set root using `search --fs_uuid' command + whenever possible. + * util/grub.d/10_hurd.in: Avoid explicit use of root drive. Instead, + just assume `root' variable has the right value. + * util/grub.d/10_linux.in: Likewise. + * util/grub-probe.c (probe): Probe for filesystem UUID when requested + via PRINT_FS_UUID. + (main): Recognise `-t fs_uuid' argument. + 2008-05-30 Robert Millan * util/biosdisk.c (map): Redefine structure to hold information diff --git a/commands/search.c b/commands/search.c index 61b35c45a..41a7b3c57 100644 --- a/commands/search.c +++ b/commands/search.c @@ -1,7 +1,7 @@ /* search.c - search devices based on a file or a filesystem label */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -32,6 +32,7 @@ static const struct grub_arg_option options[] = { {"file", 'f', 0, "search devices by a file (default)", 0, 0}, {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, + {"fs_uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; @@ -84,6 +85,54 @@ search_label (const char *key, const char *var) grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key); } +static void +search_fs_uuid (const char *key, const char *var) +{ + int count = 0; + auto int iterate_device (const char *name); + + int iterate_device (const char *name) + { + grub_device_t dev; + + dev = grub_device_open (name); + if (dev) + { + grub_fs_t fs; + + fs = grub_fs_probe (dev); + if (fs && fs->uuid) + { + char *uuid; + + (fs->uuid) (dev, &uuid); + if (grub_errno == GRUB_ERR_NONE && uuid) + { + if (grub_strcmp (uuid, key) == 0) + { + /* Found! */ + grub_printf (" %s", name); + if (count++ == 0 && var) + grub_env_set (var, name); + } + + grub_free (uuid); + } + } + + grub_device_close (dev); + } + + grub_errno = GRUB_ERR_NONE; + return 0; + } + + grub_device_iterate (iterate_device); + + if (count == 0) + grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key); +} + static void search_file (const char *key, const char *var) { @@ -136,11 +185,13 @@ grub_cmd_search (struct grub_arg_list *state, int argc, char **args) if (argc == 0) return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified"); - if (state[2].set) - var = state[2].arg ? : "root"; + if (state[3].set) + var = state[3].arg ? state[3].arg : "root"; if (state[1].set) search_label (args[0], var); + else if (state[2].set) + search_fs_uuid (args[0], var); else search_file (args[0], var); @@ -151,8 +202,8 @@ GRUB_MOD_INIT(search) { (void) mod; /* To stop warning. */ grub_register_command ("search", grub_cmd_search, GRUB_COMMAND_FLAG_BOTH, - "search [-f|-l|-s] NAME", - "Search devices by a file or a filesystem label." + "search [-f|-l|-u|-s] NAME", + "Search devices by file, filesystem label or filesystem UUID." " If --set is specified, the first device found is" " set to a variable. If no variable name is" " specified, \"root\" is used.", diff --git a/fs/ext2.c b/fs/ext2.c index e17aac2de..3c22aec8b 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -120,7 +120,7 @@ struct grub_ext2_sblock grub_uint32_t feature_compatibility; grub_uint32_t feature_incompat; grub_uint32_t feature_ro_compat; - grub_uint32_t unique_id[4]; + grub_uint16_t uuid[8]; char volume_name[16]; char last_mounted_on[64]; grub_uint32_t compression_info; @@ -861,7 +861,39 @@ grub_ext2_label (grub_device_t device, char **label) if (data) *label = grub_strndup (data->sblock.volume_name, 14); else - *label = 0; + *label = NULL; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + +static grub_err_t +grub_ext2_uuid (grub_device_t device, char **uuid) +{ + struct grub_ext2_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_ext2_mount (disk); + if (data) + { + *uuid = grub_malloc (40 + sizeof ('\0')); + grub_sprintf (*uuid, "%02x%02x-%02x-%02x-%02x-%02x%02x%02x", + grub_be_to_cpu16 (data->sblock.uuid[0]), grub_be_to_cpu16 (data->sblock.uuid[1]), + grub_be_to_cpu16 (data->sblock.uuid[2]), grub_be_to_cpu16 (data->sblock.uuid[3]), + grub_be_to_cpu16 (data->sblock.uuid[4]), grub_be_to_cpu16 (data->sblock.uuid[5]), + grub_be_to_cpu16 (data->sblock.uuid[6]), grub_be_to_cpu16 (data->sblock.uuid[7])); + } + else + *uuid = NULL; #ifndef GRUB_UTIL grub_dl_unref (my_mod); @@ -881,6 +913,7 @@ static struct grub_fs grub_ext2_fs = .read = grub_ext2_read, .close = grub_ext2_close, .label = grub_ext2_label, + .uuid = grub_ext2_uuid, .next = 0 }; diff --git a/include/grub/fs.h b/include/grub/fs.h index 303b6eaf0..46c74925c 100644 --- a/include/grub/fs.h +++ b/include/grub/fs.h @@ -51,6 +51,11 @@ struct grub_fs caller. */ grub_err_t (*label) (grub_device_t device, char **label); + /* Return the uuid of the device DEVICE in UUID. The uuid is + returned in a grub_malloc'ed buffer and should be freed by the + caller. */ + grub_err_t (*uuid) (grub_device_t device, char **uuid); + /* The next filesystem. */ struct grub_fs *next; }; diff --git a/util/grub-probe.c b/util/grub-probe.c index 4163f4b6a..a4f51e2bd 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -44,6 +44,7 @@ enum { PRINT_FS, + PRINT_FS_UUID, PRINT_DRIVE, PRINT_DEVICE, PRINT_PARTMAP, @@ -110,6 +111,7 @@ probe (const char *path, char *device_name) char *filebuf_via_grub = NULL, *filebuf_via_sys = NULL; int abstraction_type; grub_device_t dev = NULL; + grub_fs_t fs; if (path == NULL) { @@ -185,10 +187,13 @@ probe (const char *path, char *device_name) goto end; } + fs = grub_fs_probe (dev); + if (! fs) + grub_util_error ("%s", grub_errmsg); + if (print == PRINT_FS) { struct stat st; - grub_fs_t fs; stat (path, &st); @@ -210,19 +215,21 @@ probe (const char *path, char *device_name) if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size)) grub_util_error ("files differ"); - - fs = file->fs; } - else - { - fs = grub_fs_probe (dev); - if (! fs) - grub_util_error ("%s", grub_errmsg); - } - printf ("%s\n", fs->name); } + if (print == PRINT_FS_UUID) + { + char *uuid; + if (! fs->uuid) + grub_util_error ("%s does not support UUIDs", fs->name); + + fs->uuid (dev, &uuid); + + printf ("%s\n", uuid); + } + end: if (dev) grub_device_close (dev); @@ -257,7 +264,7 @@ Probe device information for a given path (or device, if the -d option is given) \n\ -d, --device given argument is a system device, not a path\n\ -m, --device-map=FILE use FILE as the device map [default=%s]\n\ - -t, --target=(fs|drive|device|partmap|abstraction)\n\ + -t, --target=(fs|fs_uuid|drive|device|partmap|abstraction)\n\ print filesystem module, GRUB drive, system device, partition map module or abstraction module [default=fs]\n\ -h, --help display this message and exit\n\ -V, --version print version information and exit\n\ @@ -302,6 +309,8 @@ main (int argc, char *argv[]) case 't': if (!strcmp (optarg, "fs")) print = PRINT_FS; + else if (!strcmp (optarg, "fs_uuid")) + print = PRINT_FS_UUID; else if (!strcmp (optarg, "drive")) print = PRINT_DRIVE; else if (!strcmp (optarg, "device")) diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 25c51627d..ab13939f2 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -38,8 +38,12 @@ set default=${GRUB_DEFAULT} set timeout=${GRUB_TIMEOUT} EOF -if [ "x${GRUB_DRIVE}" = "x" ] ; then : ; else - echo "set root=${GRUB_DRIVE}" +# If there's a filesystem UUID that GRUB is capable of identifiing, use it; +# otherwise set root as per value in device.map. +if [ "x${GRUB_DEVICE_BOOT_UUID}" = "x" ] ; then + echo "set root=`grub-probe --device ${GRUB_DEVICE_BOOT} --target=drive`" +else + echo "search --fs_uuid ${GRUB_DEVICE_BOOT_UUID} --set" fi case ${platform}:${GRUB_TERMINAL} in diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index dac54b12b..99d57e53b 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -31,9 +31,9 @@ for i in /boot/gnumach.gz /boot/gnumach ; do if test -e $i ; then basename=`basename $i` dirname=`dirname $i` - grub_dirname=`echo ${dirname} | sed -e "s%^/boot%${GRUB_DRIVE_BOOT}%g"` + rel_dirname=`make_system_path_relative_to_its_root $dirname` echo "Found GNU Mach: $i" >&2 - kernel=${grub_dirname}/${basename} + kernel=${rel_dirname}/${basename} at_least_one=true fi done diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index cd9ff13b5..e57f3e1a2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -87,7 +87,7 @@ while [ "x$list" != "x" ] ; do echo "Found linux image: $linux" >&2 basename=`basename $linux` dirname=`dirname $linux` - grub_dirname=`echo ${dirname} | sed -e "s%^/boot%${GRUB_DRIVE_BOOT}%g"` + rel_dirname=`make_system_path_relative_to_its_root $dirname` version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` alt_version=`echo $version | sed -e "s,\.old$,,g"` @@ -105,11 +105,11 @@ while [ "x$list" != "x" ] ; do cat << EOF menuentry "${OS}, linux ${version}" { - linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} + linux ${rel_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} EOF if test -n "${initrd}" ; then cat << EOF - initrd ${grub_dirname}/${initrd} + initrd ${rel_dirname}/${initrd} EOF fi cat << EOF @@ -118,11 +118,11 @@ EOF cat << EOF menuentry "${OS}, linux ${version} (single-user mode)" { - linux ${grub_dirname}/${basename} root=${GRUB_DEVICE} ro single ${GRUB_CMDLINE_LINUX} + linux ${rel_dirname}/${basename} root=${GRUB_DEVICE} ro single ${GRUB_CMDLINE_LINUX} EOF if test -n "${initrd}" ; then cat << EOF - initrd ${grub_dirname}/${initrd} + initrd ${rel_dirname}/${initrd} EOF fi cat << EOF diff --git a/util/update-grub.in b/util/update-grub.in index e698e435d..164396581 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -102,20 +102,16 @@ fi # Device containing our userland. Typically used for root= parameter. GRUB_DEVICE="`grub-probe --target=device /`" +GRUB_DEVICE_UUID="`grub-probe --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" + +# Device containing our /boot partition. Usually the same as GRUB_DEVICE. +GRUB_DEVICE_BOOT="`grub-probe --target=device /boot`" +GRUB_DEVICE_BOOT_UUID="`grub-probe --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. GRUB_FS="`grub-probe --target=fs / 2> /dev/null || echo unknown`" -# GRUB path to /. Only used for "set root=". Not critical. -GRUB_DRIVE="`grub-probe --target=drive /`" || true - -# GRUB path to /boot -GRUB_DRIVE_BOOT="`convert_system_path_to_grub_path /boot`" - -# GRUB path to /boot/grub -GRUB_DRIVE_BOOT_GRUB="`convert_system_path_to_grub_path /boot/grub`" - if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi @@ -155,7 +151,7 @@ esac # These are defined in this script, export them here so that user can # override them. -export GRUB_DEVICE GRUB_FS GRUB_DRIVE GRUB_DRIVE_BOOT GRUB_DRIVE_BOOT_GRUB GRUB_FONT_PATH GRUB_PRELOAD_MODULES +export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES # These are optional, user-defined variables. export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND From 972e2f7a66420d70435b48d499baa9c3d1dd4c6c Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 May 2008 14:39:44 +0000 Subject: [PATCH 0144/1707] 2008-05-30 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): New function. * util/update-grub.in: Set `GRUB_FONT_PATH' to the system path, without converting it first. * util/grub.d/00_header.in: Use prepare_grub_to_access_device() to setup grub.cfg for access to font file, and afterwards call it again to set the root device. --- ChangeLog | 9 +++++++++ util/grub.d/00_header.in | 18 ++++++++---------- util/update-grub.in | 3 +-- util/update-grub_lib.in | 16 ++++++++++++++++ 4 files changed, 34 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2c1b5e3f2..b35a5be2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-05-30 Robert Millan + + * util/update-grub_lib.in (prepare_grub_to_access_device): New function. + * util/update-grub.in: Set `GRUB_FONT_PATH' to the system path, without + converting it first. + * util/grub.d/00_header.in: Use prepare_grub_to_access_device() to setup + grub.cfg for access to font file, and afterwards call it again to set + the root device. + 2008-05-30 Robert Millan * commands/search.c (options): Add --fs_uuid option. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index ab13939f2..9087b0003 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -38,17 +38,12 @@ set default=${GRUB_DEFAULT} set timeout=${GRUB_TIMEOUT} EOF -# If there's a filesystem UUID that GRUB is capable of identifiing, use it; -# otherwise set root as per value in device.map. -if [ "x${GRUB_DEVICE_BOOT_UUID}" = "x" ] ; then - echo "set root=`grub-probe --device ${GRUB_DEVICE_BOOT} --target=drive`" -else - echo "search --fs_uuid ${GRUB_DEVICE_BOOT_UUID} --set" -fi - case ${platform}:${GRUB_TERMINAL} in - pc:gfxterm) cat << EOF -if font ${GRUB_FONT_PATH} ; then + pc:gfxterm) + # Make the font accessible + prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}` + cat << EOF +if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then set gfxmode=640x480 insmod gfxterm insmod vbe @@ -68,3 +63,6 @@ EOF echo "terminal ${GRUB_TERMINAL}" ;; esac + +# Set the root device. +prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} diff --git a/util/update-grub.in b/util/update-grub.in index 164396581..887ef19bc 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -131,8 +131,7 @@ esac case ${GRUB_TERMINAL} in gfxterm) if path=`font_path` ; then - GRUB_FONT_PATH="`convert_system_path_to_grub_path ${path}`" - GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES} `${grub_probe} -t abstraction ${path}`" + GRUB_FONT_PATH="${path}" else # fallback to console GRUB_TERMINAL=console diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 2d7092b1b..d7be39d5e 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -96,6 +96,22 @@ convert_system_path_to_grub_path () echo ${drive}${relative_path} } +prepare_grub_to_access_device () +{ + device=$1 + + # If there's a filesystem UUID that GRUB is capable of identifiing, use it; + # otherwise set root as per value in device.map. + if fs_uuid="`grub-probe --device ${device} --target=fs_uuid 2> /dev/null`" ; then + echo "search --fs_uuid --set ${fs_uuid}" + else + echo "set root=`${grub_probe} --device ${device} --target=drive`" + fi + + # Abstraction modules aren't auto-loaded. + GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES} `${grub_probe} --device ${device} --target=abstraction`" +} + font_path () { # Prefer system path for space reasons (/boot/grub might be a very small From cab63c95dc6fe759dfd46e3a5b44244eb95538e1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 May 2008 15:09:11 +0000 Subject: [PATCH 0145/1707] 2008-05-30 Robert Millan * util/grub.d/00_header.in: Remove obsolete comment referencing convert_system_path_to_grub_path(). * util/update-grub.in: Likewise. * util/update-grub_lib.in (is_path_readable_by_grub): New function. (convert_system_path_to_grub_path): Add a warning message explaining that this function is deprecated. Rely on is_path_readable_by_grub() for the readability checks. (font_path): Use is_path_readable_by_grub() for the readability check rather than convert_system_path_to_grub_path(). --- ChangeLog | 12 ++++++++++++ util/grub.d/00_header.in | 1 - util/update-grub.in | 1 - util/update-grub_lib.in | 20 +++++++++++++++++--- 4 files changed, 29 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index b35a5be2b..6d81bdfa7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-05-30 Robert Millan + + * util/grub.d/00_header.in: Remove obsolete comment referencing + convert_system_path_to_grub_path(). + * util/update-grub.in: Likewise. + * util/update-grub_lib.in (is_path_readable_by_grub): New function. + (convert_system_path_to_grub_path): Add a warning message explaining + that this function is deprecated. Rely on is_path_readable_by_grub() + for the readability checks. + (font_path): Use is_path_readable_by_grub() for the readability + check rather than convert_system_path_to_grub_path(). + 2008-05-30 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): New function. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 9087b0003..cabe569c3 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -21,7 +21,6 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ platform=@platform@ -# for convert_system_path_to_grub_path() . ${libdir}/grub/update-grub_lib # Do this as early as possible, since other commands might depend on it. diff --git a/util/update-grub.in b/util/update-grub.in index 887ef19bc..537c32300 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -66,7 +66,6 @@ for option in "$@"; do esac done -# for convert_system_path_to_grub_path(), font_path() . ${libdir}/grub/update-grub_lib if [ "x$UID" = "x" ] ; then diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index d7be39d5e..255c12d2d 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -71,11 +71,11 @@ make_system_path_relative_to_its_root () echo $path | sed -e "s,^$dir,,g" } -convert_system_path_to_grub_path () +is_path_readable_by_grub () { path=$1 - # abort if file doesn't exist + # abort if path doesn't exist if test -e $path ; then : ;else return 1 fi @@ -85,6 +85,20 @@ convert_system_path_to_grub_path () return 1 fi + return 0 +} + +convert_system_path_to_grub_path () +{ + path=$1 + + echo "Warning: convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." >&2 + + # abort if GRUB can't access the path + if is_path_readable_by_grub ${path} ; then : ; else + return 1 + fi + if drive=`${grub_probe} -t drive $path` ; then : ; else return 1 fi @@ -120,7 +134,7 @@ font_path () # Prefer complete fonts over incomplete ones. for basename in unicode unifont ascii ; do path="${dir}/${basename}.pff" - if convert_system_path_to_grub_path ${path} > /dev/null ; then + if is_path_readable_by_grub ${path} > /dev/null ; then echo "${path}" return 0 fi From 811d3878d8a168294dacec94dcd584886eeca22b Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 May 2008 20:47:43 +0000 Subject: [PATCH 0146/1707] 2008-05-30 Robert Millan * fs/ext2.c (grub_ext2_uuid): Use `04x' instead of '02x' as grub_printf() flags, since we're printing in units of 2 bytes. --- ChangeLog | 5 +++++ fs/ext2.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6d81bdfa7..60907540e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-30 Robert Millan + + * fs/ext2.c (grub_ext2_uuid): Use `04x' instead of '02x' as + grub_printf() flags, since we're printing in units of 2 bytes. + 2008-05-30 Robert Millan * util/grub.d/00_header.in: Remove obsolete comment referencing diff --git a/fs/ext2.c b/fs/ext2.c index 3c22aec8b..ffe9e3356 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -886,7 +886,7 @@ grub_ext2_uuid (grub_device_t device, char **uuid) if (data) { *uuid = grub_malloc (40 + sizeof ('\0')); - grub_sprintf (*uuid, "%02x%02x-%02x-%02x-%02x-%02x%02x%02x", + grub_sprintf (*uuid, "%04x%04x-%04x-%04x-%04x-%04x%04x%04x", grub_be_to_cpu16 (data->sblock.uuid[0]), grub_be_to_cpu16 (data->sblock.uuid[1]), grub_be_to_cpu16 (data->sblock.uuid[2]), grub_be_to_cpu16 (data->sblock.uuid[3]), grub_be_to_cpu16 (data->sblock.uuid[4]), grub_be_to_cpu16 (data->sblock.uuid[5]), From 51500452b98ace0f5119e0a72f52f264149a8c6c Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 May 2008 20:55:29 +0000 Subject: [PATCH 0147/1707] 2008-05-30 Robert Millan * commands/search.c (options): Rename --fs_uuid to --fs-uuid. * util/update-grub_lib.in (prepare_grub_to_access_device): Replace --fs_uuid with --fs-uuid. * util/update-grub.in: Allow filesystem UUID probes to fail (since not all filesystems support them). --- ChangeLog | 8 ++++++++ commands/search.c | 2 +- util/update-grub.in | 4 ++-- util/update-grub_lib.in | 2 +- 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60907540e..476a09776 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-30 Robert Millan + + * commands/search.c (options): Rename --fs_uuid to --fs-uuid. + * util/update-grub_lib.in (prepare_grub_to_access_device): Replace + --fs_uuid with --fs-uuid. + * util/update-grub.in: Allow filesystem UUID probes to fail (since not + all filesystems support them). + 2008-05-30 Robert Millan * fs/ext2.c (grub_ext2_uuid): Use `04x' instead of '02x' as diff --git a/commands/search.c b/commands/search.c index 41a7b3c57..a4bbd2c87 100644 --- a/commands/search.c +++ b/commands/search.c @@ -32,7 +32,7 @@ static const struct grub_arg_option options[] = { {"file", 'f', 0, "search devices by a file (default)", 0, 0}, {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, - {"fs_uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, + {"fs-uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; diff --git a/util/update-grub.in b/util/update-grub.in index 537c32300..f34ad9e17 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -101,11 +101,11 @@ fi # Device containing our userland. Typically used for root= parameter. GRUB_DEVICE="`grub-probe --target=device /`" -GRUB_DEVICE_UUID="`grub-probe --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" +GRUB_DEVICE_UUID="`grub-probe --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true # Device containing our /boot partition. Usually the same as GRUB_DEVICE. GRUB_DEVICE_BOOT="`grub-probe --target=device /boot`" -GRUB_DEVICE_BOOT_UUID="`grub-probe --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" +GRUB_DEVICE_BOOT_UUID="`grub-probe --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 255c12d2d..1dadbfcfc 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -117,7 +117,7 @@ prepare_grub_to_access_device () # If there's a filesystem UUID that GRUB is capable of identifiing, use it; # otherwise set root as per value in device.map. if fs_uuid="`grub-probe --device ${device} --target=fs_uuid 2> /dev/null`" ; then - echo "search --fs_uuid --set ${fs_uuid}" + echo "search --fs-uuid --set ${fs_uuid}" else echo "set root=`${grub_probe} --device ${device} --target=drive`" fi From 5786569b4147bd0bb931557c04acdd7aeaf6e3c3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 May 2008 21:53:17 +0000 Subject: [PATCH 0148/1707] 2008-05-30 Robert Millan * util/update-grub.in (GRUB_DISABLE_LINUX_UUID): Export variable. * util/grub.d/10_linux.in: If GRUB_DEVICE_UUID is set, and GRUB_DISABLE_LINUX_UUID isn't true, use the filesystem UUIDs as the `root' parameter to Linux. --- ChangeLog | 7 +++++++ util/grub.d/10_linux.in | 10 ++++++++-- util/update-grub.in | 2 +- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 476a09776..d230581d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-05-30 Robert Millan + + * util/update-grub.in (GRUB_DISABLE_LINUX_UUID): Export variable. + * util/grub.d/10_linux.in: If GRUB_DEVICE_UUID is set, and + GRUB_DISABLE_LINUX_UUID isn't true, use the filesystem UUIDs as + the `root' parameter to Linux. + 2008-05-30 Robert Millan * commands/search.c (options): Rename --fs_uuid to --fs-uuid. diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index e57f3e1a2..9aac6327b 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -27,6 +27,12 @@ else OS="${GRUB_DISTRIBUTOR} GNU/Linux" fi +if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] ; then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} +else + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} +fi + test_numeric () { local a=$1 @@ -105,7 +111,7 @@ while [ "x$list" != "x" ] ; do cat << EOF menuentry "${OS}, linux ${version}" { - linux ${rel_dirname}/${basename} root=${GRUB_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} + linux ${rel_dirname}/${basename} root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} EOF if test -n "${initrd}" ; then cat << EOF @@ -118,7 +124,7 @@ EOF cat << EOF menuentry "${OS}, linux ${version} (single-user mode)" { - linux ${rel_dirname}/${basename} root=${GRUB_DEVICE} ro single ${GRUB_CMDLINE_LINUX} + linux ${rel_dirname}/${basename} root=${LINUX_ROOT_DEVICE} ro single ${GRUB_CMDLINE_LINUX} EOF if test -n "${initrd}" ; then cat << EOF diff --git a/util/update-grub.in b/util/update-grub.in index f34ad9e17..9296e7336 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -152,7 +152,7 @@ esac export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES # These are optional, user-defined variables. -export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND +export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID exec > ${grub_cfg}.new From 520ae21bb747ac3008d0bd80783c24a1eaffab9c Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 30 May 2008 21:55:31 +0000 Subject: [PATCH 0149/1707] 2008-05-30 Pavel Roskin * util/biosdisk.c (linux_find_partition): Simplify logic and make the code more universal. Keep special processing for devfs, but use a simple rule for all other devices. If the device ends with a number, append 'p' and the partition number. Otherwise, append only the partition number. --- ChangeLog | 8 ++++++++ util/biosdisk.c | 47 +++++++++-------------------------------------- 2 files changed, 17 insertions(+), 38 deletions(-) diff --git a/ChangeLog b/ChangeLog index d230581d4..376b5dd50 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-05-30 Pavel Roskin + + * util/biosdisk.c (linux_find_partition): Simplify logic and + make the code more universal. Keep special processing for + devfs, but use a simple rule for all other devices. If the + device ends with a number, append 'p' and the partition number. + Otherwise, append only the partition number. + 2008-05-30 Robert Millan * util/update-grub.in (GRUB_DISABLE_LINUX_UUID): Export variable. diff --git a/util/biosdisk.c b/util/biosdisk.c index 2e1cec358..3a81e5fde 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -215,57 +215,28 @@ linux_find_partition (char *dev, unsigned long sector) char real_dev[PATH_MAX]; strcpy(real_dev, dev); - + if (have_devfs () && strcmp (real_dev + len - 5, "/disc") == 0) { p = real_dev + len - 4; format = "part%d"; } - else if ((strncmp (real_dev + 5, "hd", 2) == 0 - || strncmp (real_dev + 5, "vd", 2) == 0 - || strncmp (real_dev + 5, "sd", 2) == 0) - && real_dev[7] >= 'a' && real_dev[7] <= 'z') + else if (real_dev[len - 1] >= '0' && real_dev[len - 1] <= '9') { - p = real_dev + sizeof("/dev/hda")-1; - format = "%d"; - } - else if (strncmp (real_dev + 5, "rd/c", 4) == 0) /* dac960 */ - { - p = strchr (real_dev + 9, 'd'); - if (! p) - return 0; - - p++; - while (*p && isdigit (*p)) - p++; - - format = "p%d"; - } - else if (strncmp (real_dev + 5, "cciss/c", sizeof("cciss/c")-1) == 0) - { - p = strchr (real_dev + 5 + sizeof("cciss/c")-1, 'd'); - if (! p) - return 0; - - p++; - while (*p && isdigit (*p)) - p++; - - format = "p%d"; - } - else if (strncmp (real_dev + 5, "mmcblk", sizeof("mmcblk")-1) == 0) - { - p = real_dev + sizeof("/dev/mmcblk0")-1; + p = real_dev + len; format = "p%d"; } else - return 0; + { + p = real_dev + len; + format = "%d"; + } for (i = 1; i < 10000; i++) { int fd; struct hd_geometry hdg; - + sprintf (p, format, i); fd = open (real_dev, O_RDONLY); if (fd == -1) @@ -278,7 +249,7 @@ linux_find_partition (char *dev, unsigned long sector) } close (fd); - + if (hdg.start == sector) { strcpy (dev, real_dev); From 69ba137ec8154ad77045f3607687c5809f007825 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 31 May 2008 09:47:06 +0000 Subject: [PATCH 0150/1707] 2008-05-31 Robert Millan * util/update-grub_lib.in: Replace `grub-probe' with `${grub_probe}'. * util/update-grub.in: Likewise. --- ChangeLog | 5 +++++ util/update-grub.in | 10 +++++----- util/update-grub_lib.in | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 376b5dd50..007439e32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-31 Robert Millan + + * util/update-grub_lib.in: Replace `grub-probe' with `${grub_probe}'. + * util/update-grub.in: Likewise. + 2008-05-30 Pavel Roskin * util/biosdisk.c (linux_find_partition): Simplify logic and diff --git a/util/update-grub.in b/util/update-grub.in index 9296e7336..84a5e1852 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -100,16 +100,16 @@ if test -e ${grub_prefix}/device.map ; then : ; else fi # Device containing our userland. Typically used for root= parameter. -GRUB_DEVICE="`grub-probe --target=device /`" -GRUB_DEVICE_UUID="`grub-probe --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true +GRUB_DEVICE="`${grub_probe} --target=device /`" +GRUB_DEVICE_UUID="`${grub_probe} --device ${GRUB_DEVICE} --target=fs_uuid 2> /dev/null`" || true # Device containing our /boot partition. Usually the same as GRUB_DEVICE. -GRUB_DEVICE_BOOT="`grub-probe --target=device /boot`" -GRUB_DEVICE_BOOT_UUID="`grub-probe --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true +GRUB_DEVICE_BOOT="`${grub_probe} --target=device /boot`" +GRUB_DEVICE_BOOT_UUID="`${grub_probe} --device ${GRUB_DEVICE_BOOT} --target=fs_uuid 2> /dev/null`" || true # Filesystem for the device containing our userland. Used for stuff like # choosing Hurd filesystem module. -GRUB_FS="`grub-probe --target=fs / 2> /dev/null || echo unknown`" +GRUB_FS="`${grub_probe} --target=fs / 2> /dev/null || echo unknown`" if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 1dadbfcfc..75c5bbf5d 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -116,7 +116,7 @@ prepare_grub_to_access_device () # If there's a filesystem UUID that GRUB is capable of identifiing, use it; # otherwise set root as per value in device.map. - if fs_uuid="`grub-probe --device ${device} --target=fs_uuid 2> /dev/null`" ; then + if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then echo "search --fs-uuid --set ${fs_uuid}" else echo "set root=`${grub_probe} --device ${device} --target=drive`" From 41305bc8f78855937c5e9a76019a8366901b43d8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 31 May 2008 15:46:48 +0000 Subject: [PATCH 0151/1707] 2008-05-31 Michael Gorven * term/terminfo.c (grub_terminfo_set_current): Correct vt100 cursor on and off sequences. --- ChangeLog | 5 +++++ term/terminfo.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 007439e32..b680f8f1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-31 Michael Gorven + + * term/terminfo.c (grub_terminfo_set_current): Correct vt100 cursor + on and off sequences. + 2008-05-31 Robert Millan * util/update-grub_lib.in: Replace `grub-probe' with `${grub_probe}'. diff --git a/term/terminfo.c b/term/terminfo.c index bea413177..5cbbe16ab 100644 --- a/term/terminfo.c +++ b/term/terminfo.c @@ -98,8 +98,8 @@ grub_terminfo_set_current (const char *str) term.cls = grub_strdup ("\e[H\e[J"); term.reverse_video_on = grub_strdup ("\e[7m"); term.reverse_video_off = grub_strdup ("\e[m"); - term.cursor_on = grub_strdup ("\e[?25l"); - term.cursor_off = grub_strdup ("\e[?25h"); + term.cursor_on = grub_strdup ("\e[?25h"); + term.cursor_off = grub_strdup ("\e[?25l"); return grub_errno; } From 6e037aa95674c830d21861d5121e42c5aa001cf1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 31 May 2008 18:09:14 +0000 Subject: [PATCH 0152/1707] 2008-05-31 Robert Millan * term/ieee1275/ofconsole.c (grub_ofconsole_setcursor): Implement using "cursor-on" and "cursor-off" commands (understood at least by the Open Firmware flavour on OLPC). --- ChangeLog | 6 ++++++ term/ieee1275/ofconsole.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b680f8f1b..889efd9c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-31 Robert Millan + + * term/ieee1275/ofconsole.c (grub_ofconsole_setcursor): Implement + using "cursor-on" and "cursor-off" commands (understood at least by + the Open Firmware flavour on OLPC). + 2008-05-31 Michael Gorven * term/terminfo.c (grub_terminfo_set_current): Correct vt100 cursor diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index faf62bf66..3b269ce9a 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -302,9 +302,13 @@ grub_ofconsole_cls (void) } static void -grub_ofconsole_setcursor (int on __attribute ((unused))) +grub_ofconsole_setcursor (int on) { - /* XXX: Not supported. */ + /* Understood by the Open Firmware flavour in OLPC. */ + if (on) + grub_ieee1275_interpret ("cursor-on", 0); + else + grub_ieee1275_interpret ("cursor-off", 0); } static void From b7db5d47d96b7471ab1508920555a5a121896817 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 31 May 2008 21:08:04 +0000 Subject: [PATCH 0153/1707] 2008-05-31 Robert Millan * commands/search.c (search_label, search_fs_uuid, search_file): Do not print device names when we were asked to set a variable. --- ChangeLog | 5 +++++ commands/search.c | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 889efd9c1..5590227d0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-05-31 Robert Millan + + * commands/search.c (search_label, search_fs_uuid, search_file): Do + not print device names when we were asked to set a variable. + 2008-05-31 Robert Millan * term/ieee1275/ofconsole.c (grub_ofconsole_setcursor): Implement diff --git a/commands/search.c b/commands/search.c index a4bbd2c87..57b03976b 100644 --- a/commands/search.c +++ b/commands/search.c @@ -63,9 +63,12 @@ search_label (const char *key, const char *var) if (grub_strcmp (label, key) == 0) { /* Found! */ - grub_printf (" %s", name); - if (count++ == 0 && var) - grub_env_set (var, name); + if (var) + { + grub_printf (" %s", name); + if (count++ == 0) + grub_env_set (var, name); + } } grub_free (label); @@ -111,9 +114,12 @@ search_fs_uuid (const char *key, const char *var) if (grub_strcmp (uuid, key) == 0) { /* Found! */ - grub_printf (" %s", name); - if (count++ == 0 && var) - grub_env_set (var, name); + if (var) + { + grub_printf (" %s", name); + if (count++ == 0) + grub_env_set (var, name); + } } grub_free (uuid); @@ -158,9 +164,12 @@ search_file (const char *key, const char *var) if (file) { /* Found! */ - grub_printf (" %s", name); - if (count++ == 0 && var) - grub_env_set (var, name); + if (var) + { + grub_printf (" %s", name); + if (count++ == 0) + grub_env_set (var, name); + } grub_file_close (file); } From c682dfd71de7b003075c678886f1da1dca41ee4d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 31 May 2008 21:14:27 +0000 Subject: [PATCH 0154/1707] 2008-05-31 Robert Millan * disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Iterate through floppies after everything else, to ensure floppy drive isn't accessed unnecessarily (patch from Bean). --- ChangeLog | 6 ++++++ disk/i386/pc/biosdisk.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5590227d0..7276157a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-05-31 Robert Millan + + * disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Iterate through + floppies after everything else, to ensure floppy drive isn't accessed + unnecessarily (patch from Bean). + 2008-05-31 Robert Millan * commands/search.c (search_label, search_fs_uuid, search_file): Do diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index 094bde0aa..c8fd1423b 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -66,12 +66,6 @@ grub_biosdisk_iterate (int (*hook) (const char *name)) int drive; int num_floppies; - /* For floppy disks, we can get the number safely. */ - num_floppies = grub_biosdisk_get_num_floppies (); - for (drive = 0; drive < num_floppies; drive++) - if (grub_biosdisk_call_hook (hook, drive)) - return 1; - /* For hard disks, attempt to read the MBR. */ for (drive = 0x80; drive < 0x90; drive++) { @@ -92,6 +86,12 @@ grub_biosdisk_iterate (int (*hook) (const char *name)) return 1; } + /* For floppy disks, we can get the number safely. */ + num_floppies = grub_biosdisk_get_num_floppies (); + for (drive = 0; drive < num_floppies; drive++) + if (grub_biosdisk_call_hook (hook, drive)) + return 1; + return 0; } From 1385c5bb3d4d9dd3c3410de5b6e087b447ff36cf Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 1 Jun 2008 10:42:48 +0000 Subject: [PATCH 0155/1707] 2008-06-01 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Generate code that is backward compatible with pre-uuid search command. --- ChangeLog | 5 +++++ util/update-grub_lib.in | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7276157a3..e5ddeda69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-01 Robert Millan + + * util/update-grub_lib.in (prepare_grub_to_access_device): Generate + code that is backward compatible with pre-uuid search command. + 2008-05-31 Robert Millan * disk/i386/pc/biosdisk.c (grub_biosdisk_iterate): Iterate through diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 75c5bbf5d..969ec3011 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -116,10 +116,9 @@ prepare_grub_to_access_device () # If there's a filesystem UUID that GRUB is capable of identifiing, use it; # otherwise set root as per value in device.map. + echo "set root=`${grub_probe} --device ${device} --target=drive`" if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then echo "search --fs-uuid --set ${fs_uuid}" - else - echo "set root=`${grub_probe} --device ${device} --target=drive`" fi # Abstraction modules aren't auto-loaded. From 00c108a446ca71908db330427c8257208d86fe83 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 1 Jun 2008 13:30:00 +0000 Subject: [PATCH 0156/1707] 2008-06-01 Robert Millan * util/biosdisk.c (get_drive): Verify that `map[i].drive' is non-NULL before dereferencing it. * fs/fat.c (struct grub_fat_bpb): Move fat32-specific fields into a union with fat12/fat16-specific ones. Add some new fields, including `num_serial' for both versions. (struct grub_fat_data): Add `uuid' member. (grub_fat_mount): Refer to fat32-specific fields in `bpb' by their new names. Initialize `data->uuid' using `num_serial'. (grub_fat_uuid): New function. (grub_fat_fs): Reference grub_fat_uuid() in `uuid' struct member. * fs/reiserfs.c (grub_reiserfs_superblock): Add `uuid' field. (grub_reiserfs_uuid): New function. (grub_reiserfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct member. * fs/xfs.c (grub_xfs_sblock): Add `uuid' field. (grub_xfs_uuid): New function. (grub_xfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct member. --- ChangeLog | 23 ++++++++++++++ fs/fat.c | 83 +++++++++++++++++++++++++++++++++++++++++-------- fs/reiserfs.c | 35 +++++++++++++++++++++ fs/xfs.c | 45 ++++++++++++++++++++++++--- util/biosdisk.c | 2 +- 5 files changed, 169 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5ddeda69..f2513e07e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2008-06-01 Robert Millan + + * util/biosdisk.c (get_drive): Verify that `map[i].drive' is non-NULL + before dereferencing it. + + * fs/fat.c (struct grub_fat_bpb): Move fat32-specific fields into a + union with fat12/fat16-specific ones. Add some new fields, including + `num_serial' for both versions. + (struct grub_fat_data): Add `uuid' member. + (grub_fat_mount): Refer to fat32-specific fields in `bpb' by their new + names. Initialize `data->uuid' using `num_serial'. + (grub_fat_uuid): New function. + (grub_fat_fs): Reference grub_fat_uuid() in `uuid' struct member. + + * fs/reiserfs.c (grub_reiserfs_superblock): Add `uuid' field. + (grub_reiserfs_uuid): New function. + (grub_reiserfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct + member. + + * fs/xfs.c (grub_xfs_sblock): Add `uuid' field. + (grub_xfs_uuid): New function. + (grub_xfs_fs): Reference grub_reiserfs_uuid() in `uuid' struct member. + 2008-06-01 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Generate diff --git a/fs/fat.c b/fs/fat.c index 7f4107735..4d04aeca3 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -1,7 +1,7 @@ /* fat.c - FAT filesystem */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2001,2002,2003,2004,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -61,14 +61,34 @@ struct grub_fat_bpb grub_uint16_t num_heads; grub_uint32_t num_hidden_sectors; grub_uint32_t num_total_sectors_32; - - /* The following fields are only used by FAT32. */ - grub_uint32_t sectors_per_fat_32; - grub_uint16_t extended_flags; - grub_uint16_t fs_version; - grub_uint32_t root_cluster; - grub_uint16_t fs_info; - grub_uint16_t backup_boot_sector; + union + { + struct + { + grub_uint8_t num_ph_drive; + grub_uint8_t reserved; + grub_uint8_t boot_sig; + grub_uint32_t num_serial; + grub_uint8_t label[11]; + grub_uint8_t fstype[8]; + } __attribute__ ((packed)) fat12_or_fat16; + struct + { + grub_uint32_t sectors_per_fat_32; + grub_uint16_t extended_flags; + grub_uint16_t fs_version; + grub_uint32_t root_cluster; + grub_uint16_t fs_info; + grub_uint16_t backup_boot_sector; + grub_uint8_t reserved[12]; + grub_uint8_t num_ph_drive; + grub_uint8_t reserved1; + grub_uint8_t boot_sig; + grub_uint32_t num_serial; + grub_uint8_t label[11]; + grub_uint8_t fstype[8]; + } __attribute__ ((packed)) fat32; + } __attribute__ ((packed)) version_specific; } __attribute__ ((packed)); struct grub_fat_dir_entry @@ -122,6 +142,8 @@ struct grub_fat_data grub_uint32_t file_cluster; grub_uint32_t cur_cluster_num; grub_uint32_t cur_cluster; + + grub_uint16_t uuid[2]; }; #ifndef GRUB_UTIL @@ -183,7 +205,7 @@ grub_fat_mount (grub_disk_t disk) data->sectors_per_fat = ((bpb.sectors_per_fat_16 ? grub_le_to_cpu16 (bpb.sectors_per_fat_16) - : grub_le_to_cpu32 (bpb.sectors_per_fat_32)) + : grub_le_to_cpu32 (bpb.version_specific.fat32.sectors_per_fat_32)) << data->logical_sector_bits); if (data->sectors_per_fat == 0) goto fail; @@ -219,9 +241,9 @@ grub_fat_mount (grub_disk_t disk) if (! bpb.sectors_per_fat_16) { /* FAT32. */ - grub_uint16_t flags = grub_le_to_cpu16 (bpb.extended_flags); + grub_uint16_t flags = grub_le_to_cpu16 (bpb.version_specific.fat32.extended_flags); - data->root_cluster = grub_le_to_cpu32 (bpb.root_cluster); + data->root_cluster = grub_le_to_cpu32 (bpb.version_specific.fat32.root_cluster); data->fat_size = 32; data->cluster_eof_mark = 0x0ffffff8; @@ -236,7 +258,7 @@ grub_fat_mount (grub_disk_t disk) data->fat_sector += active_fat * data->sectors_per_fat; } - if (bpb.num_root_entries != 0 || bpb.fs_version != 0) + if (bpb.num_root_entries != 0 || bpb.version_specific.fat32.fs_version != 0) goto fail; } else @@ -286,6 +308,12 @@ grub_fat_mount (grub_disk_t disk) first_fat &= 0x00000fff; magic = 0x0f00; } + + /* Serial number. */ + if (bpb.sectors_per_fat_16) + *((grub_uint32_t *) &data->uuid) = grub_le_to_cpu32 (bpb.version_specific.fat12_or_fat16.num_serial); + else + *((grub_uint32_t *) &data->uuid) = grub_le_to_cpu32 (bpb.version_specific.fat32.num_serial); /* Ignore the 3rd bit, because some BIOSes assigns 0xF0 to the media descriptor, even if it is a so-called superfloppy (e.g. an USB key). @@ -797,6 +825,34 @@ grub_fat_label (grub_device_t device, char **label) return grub_errno; } +static grub_err_t +grub_fat_uuid (grub_device_t device, char **uuid) +{ + struct grub_fat_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_fat_mount (disk); + if (data) + { + *uuid = grub_malloc (sizeof ("xxxx-xxxx")); + grub_sprintf (*uuid, "%04x-%04x", data->uuid[1], data->uuid[0]); + } + else + *uuid = NULL; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + static struct grub_fs grub_fat_fs = { .name = "fat", @@ -805,6 +861,7 @@ static struct grub_fs grub_fat_fs = .read = grub_fat_read, .close = grub_fat_close, .label = grub_fat_label, + .uuid = grub_fat_uuid, .next = 0 }; diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 554d10453..9a059e3ca 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -108,6 +108,8 @@ struct grub_reiserfs_superblock grub_uint16_t version; grub_uint16_t reserved; grub_uint32_t inode_generation; + grub_uint8_t unused[4]; + grub_uint16_t uuid[8]; } __attribute__ ((packed)); struct grub_reiserfs_journal_header @@ -1468,6 +1470,38 @@ grub_reiserfs_label (grub_device_t device, char **label) return grub_errno; } +static grub_err_t +grub_reiserfs_uuid (grub_device_t device, char **uuid) +{ + struct grub_reiserfs_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_reiserfs_mount (disk); + if (data) + { + *uuid = grub_malloc (sizeof ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")); + grub_sprintf (*uuid, "%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + grub_be_to_cpu16 (data->superblock.uuid[0]), grub_be_to_cpu16 (data->superblock.uuid[1]), + grub_be_to_cpu16 (data->superblock.uuid[2]), grub_be_to_cpu16 (data->superblock.uuid[3]), + grub_be_to_cpu16 (data->superblock.uuid[4]), grub_be_to_cpu16 (data->superblock.uuid[5]), + grub_be_to_cpu16 (data->superblock.uuid[6]), grub_be_to_cpu16 (data->superblock.uuid[7])); + } + else + *uuid = NULL; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + static struct grub_fs grub_reiserfs_fs = { .name = "reiserfs", @@ -1476,6 +1510,7 @@ static struct grub_fs grub_reiserfs_fs = .read = grub_reiserfs_read, .close = grub_reiserfs_close, .label = grub_reiserfs_label, + .uuid = grub_reiserfs_uuid, .next = 0 }; diff --git a/fs/xfs.c b/fs/xfs.c index a778e9905..5437678ad 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -37,17 +37,19 @@ struct grub_xfs_sblock { grub_uint8_t magic[4]; grub_uint32_t bsize; - grub_uint8_t unused1[48]; + grub_uint8_t unused1[24]; + grub_uint16_t uuid[8]; + grub_uint8_t unused2[8]; grub_uint64_t rootino; - grub_uint8_t unused2[20]; - grub_uint32_t agsize; grub_uint8_t unused3[20]; + grub_uint32_t agsize; + grub_uint8_t unused4[20]; grub_uint8_t label[12]; grub_uint8_t log2_bsize; - grub_uint8_t unused4[2]; + grub_uint8_t unused5[2]; grub_uint8_t log2_inop; grub_uint8_t log2_agblk; - grub_uint8_t unused5[67]; + grub_uint8_t unused6[67]; grub_uint8_t log2_dirblk; } __attribute__ ((packed)); @@ -763,6 +765,38 @@ grub_xfs_label (grub_device_t device, char **label) return grub_errno; } +static grub_err_t +grub_xfs_uuid (grub_device_t device, char **uuid) +{ + struct grub_xfs_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_xfs_mount (disk); + if (data) + { + *uuid = grub_malloc (sizeof ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")); + grub_sprintf (*uuid, "%04x%04x-%04x-%04x-%04x-%04x%04x%04x", + grub_be_to_cpu16 (data->sblock.uuid[0]), grub_be_to_cpu16 (data->sblock.uuid[1]), + grub_be_to_cpu16 (data->sblock.uuid[2]), grub_be_to_cpu16 (data->sblock.uuid[3]), + grub_be_to_cpu16 (data->sblock.uuid[4]), grub_be_to_cpu16 (data->sblock.uuid[5]), + grub_be_to_cpu16 (data->sblock.uuid[6]), grub_be_to_cpu16 (data->sblock.uuid[7])); + } + else + *uuid = NULL; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + static struct grub_fs grub_xfs_fs = @@ -773,6 +807,7 @@ static struct grub_fs grub_xfs_fs = .read = grub_xfs_read, .close = grub_xfs_close, .label = grub_xfs_label, + .uuid = grub_xfs_uuid, .next = 0 }; diff --git a/util/biosdisk.c b/util/biosdisk.c index 3a81e5fde..b42c06df8 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -117,7 +117,7 @@ get_drive (const char *name) if (name) { for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) - if (! strcmp (map[i].drive, name)) + if (map[i].drive && ! strcmp (map[i].drive, name)) return i; } else From e6a30859dd81564d46e0ad2d36c394ad504fd388 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 4 Jun 2008 11:20:36 +0000 Subject: [PATCH 0157/1707] 2008-06-04 Robert Millan * util/biosdisk.c (get_os_disk): Handle IDA devices. * util/grub-mkdevicemap.c (get_mmc_disk_name) (make_device_map): Likewise. --- ChangeLog | 6 ++++++ util/biosdisk.c | 11 +++++++++++ util/grub-mkdevicemap.c | 30 ++++++++++++++++++++++++++++++ 3 files changed, 47 insertions(+) diff --git a/ChangeLog b/ChangeLog index f2513e07e..86c9012a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-04 Robert Millan + + * util/biosdisk.c (get_os_disk): Handle IDA devices. + * util/grub-mkdevicemap.c (get_mmc_disk_name) + (make_device_map): Likewise. + 2008-06-01 Robert Millan * util/biosdisk.c (get_drive): Verify that `map[i].drive' is non-NULL diff --git a/util/biosdisk.c b/util/biosdisk.c index b42c06df8..68f6b567d 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -646,6 +646,17 @@ get_os_disk (const char *os_dev) return path; } + /* If this is a Compaq Intelligent Drive Array. */ + if (strncmp ("ida/c", p, sizeof ("ida/c") - 1) == 0) + { + /* /dev/ida/c[0-9]+d[0-9]+(p[0-9]+)? */ + p = strchr (p, 'p'); + if (p) + *p = '\0'; + + return path; + } + /* If this is a MultiMediaCard (MMC). */ if (strncmp ("mmcblk", p, sizeof ("mmcblk") - 1) == 0) { diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 4bb1c486e..5b8943704 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -296,6 +296,12 @@ get_cciss_disk_name (char *name, int controller, int drive) sprintf (name, "/dev/cciss/c%dd%d", controller, drive); } +static void +get_ida_disk_name (char *name, int controller, int drive) +{ + sprintf (name, "/dev/ida/c%dd%d", controller, drive); +} + static void get_mmc_disk_name (char *name, int unit) { @@ -583,6 +589,30 @@ make_device_map (const char *device_map, int floppy_disks) } } } + + /* This is for Compaq Intelligent Drive Array - we have + /dev/ida/cdp. */ + { + int controller, drive; + + for (controller = 0; controller < 3; controller++) + { + for (drive = 0; drive < 10; drive++) + { + char name[24]; + + get_ida_disk_name (name, controller, drive); + if (check_device (name)) + { + char *p; + p = grub_util_get_disk_name (num_hd, name); + fprintf (fp, "(%s)\t%s\n", p, name); + free (p); + num_hd++; + } + } + } + } /* This is for I2O - we have /dev/i2o/hd */ { From 1ad36d3785fe264accbaf1be481cacbbea4a9ea2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 4 Jun 2008 13:59:55 +0000 Subject: [PATCH 0158/1707] 2008-06-04 Robert Millan * util/biosdisk.c (get_drive): Rename to ... (find_grub_drive): ... this. Update all users. (get_os_disk): Rename to ... (convert_system_partition_to_system_disk): ... this. Update all users. (find_drive): Rename to ... (find_system_device): ... this. Update all users. --- ChangeLog | 11 +++++++++++ util/biosdisk.c | 16 ++++++++-------- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 86c9012a7..40a82b8d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-06-04 Robert Millan + + * util/biosdisk.c (get_drive): Rename to ... + (find_grub_drive): ... this. Update all users. + + (get_os_disk): Rename to ... + (convert_system_partition_to_system_disk): ... this. Update all users. + + (find_drive): Rename to ... + (find_system_device): ... this. Update all users. + 2008-06-04 Robert Millan * util/biosdisk.c (get_os_disk): Handle IDA devices. diff --git a/util/biosdisk.c b/util/biosdisk.c index 68f6b567d..b949b2db6 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -110,7 +110,7 @@ have_devfs (void) #endif /* __linux__ */ static int -get_drive (const char *name) +find_grub_drive (const char *name) { unsigned int i; @@ -148,7 +148,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) int drive; struct stat st; - drive = get_drive (name); + drive = find_grub_drive (name); if (drive < 0) return grub_error (GRUB_ERR_BAD_DEVICE, "no mapping exists for `%s'", name); @@ -503,7 +503,7 @@ read_device_map (const char *dev_map) p++; /* Find a free slot. */ - drive = get_drive (NULL); + drive = find_grub_drive (NULL); if (drive < 0) show_error ("Map table size exceeded"); @@ -593,7 +593,7 @@ make_device_name (int drive, int dos_part, int bsd_part) } static char * -get_os_disk (const char *os_dev) +convert_system_partition_to_system_disk (const char *os_dev) { #if defined(__linux__) char *path = xmalloc (PATH_MAX); @@ -707,18 +707,18 @@ get_os_disk (const char *os_dev) return path; #else -# warning "The function `get_os_disk' might not work on your OS correctly." +# warning "The function `convert_system_partition_to_system_disk' might not work on your OS correctly." return xstrdup (os_dev); #endif } static int -find_drive (const char *os_dev) +find_system_device (const char *os_dev) { int i; char *os_disk; - os_disk = get_os_disk (os_dev); + os_disk = convert_system_partition_to_system_disk (os_dev); if (! os_disk) return -1; @@ -745,7 +745,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return 0; } - drive = find_drive (os_dev); + drive = find_system_device (os_dev); if (drive < 0) { grub_error (GRUB_ERR_BAD_DEVICE, From 9ece62fb9f28a9bf82459034caac7097634585ae Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 5 Jun 2008 21:27:54 +0000 Subject: [PATCH 0159/1707] 2008-06-05 Robert Millan * normal/misc.c (grub_normal_print_device_info): When a filesystem UUID is found, print it (same layout as with labels). --- ChangeLog | 5 +++++ normal/misc.c | 40 +++++++++++++++++++++++++++------------- 2 files changed, 32 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40a82b8d7..0382a5113 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-05 Robert Millan + + * normal/misc.c (grub_normal_print_device_info): When a filesystem UUID + is found, print it (same layout as with labels). + 2008-06-04 Robert Millan * util/biosdisk.c (get_drive): Rename to ... diff --git a/normal/misc.c b/normal/misc.c index 271bbc94f..83bf28fa8 100644 --- a/normal/misc.c +++ b/normal/misc.c @@ -42,7 +42,6 @@ grub_normal_print_device_info (const char *name) grub_printf ("Filesystem cannot be accessed"); else if (dev->disk) { - char *label; grub_fs_t fs; fs = grub_fs_probe (dev); @@ -50,23 +49,38 @@ grub_normal_print_device_info (const char *name) grub_errno = 0; if (fs) - grub_printf ("Filesystem type %s", fs->name); + { + grub_printf ("Filesystem type %s", fs->name); + if (fs->label) + { + char *label; + (fs->label) (dev, &label); + if (grub_errno == GRUB_ERR_NONE) + { + if (label && grub_strlen (label)) + grub_printf (", Label %s", label); + grub_free (label); + } + grub_errno = GRUB_ERR_NONE; + } + if (fs->uuid) + { + char *uuid; + (fs->uuid) (dev, &uuid); + if (grub_errno == GRUB_ERR_NONE) + { + if (uuid && grub_strlen (uuid)) + grub_printf (", UUID %s", uuid); + grub_free (uuid); + } + grub_errno = GRUB_ERR_NONE; + } + } else if (! dev->disk->has_partitions || dev->disk->partition) grub_printf ("Unknown filesystem"); else grub_printf ("Partition table"); - if (fs && fs->label) - { - (fs->label) (dev, &label); - if (grub_errno == GRUB_ERR_NONE) - { - if (label && grub_strlen (label)) - grub_printf (", Label %s", label); - grub_free (label); - } - grub_errno = GRUB_ERR_NONE; - } grub_device_close (dev); } From 25d6b3273b1e7dcde62c652e74f96d5f005de675 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 6 Jun 2008 15:49:23 +0000 Subject: [PATCH 0160/1707] 2008-06-06 Robert Millan * util/grub-emu.c (grub_machine_init): Move code in this function from here ... (main): ... to here (before grub_util_biosdisk_init() call, to prevent segfault in case grub_printf() is called). * util/i386/pc/grub-install.in: Append `--device-map=${device_map}' to grub_probe. Update all users not to explicitly add it again. (grub_device): New variable; contains corresponding device for grubdir. (fs_module, partmap_module, devabstraction_module): Pass `--device ${grub_device}' to grub_probe to avoid traversing /dev every time. --- ChangeLog | 14 ++++++++++++++ util/grub-emu.c | 5 +++-- util/i386/pc/grub-install.in | 11 ++++++++--- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0382a5113..6fa2838bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2008-06-06 Robert Millan + + * util/grub-emu.c (grub_machine_init): Move code in this function from + here ... + (main): ... to here (before grub_util_biosdisk_init() call, to prevent + segfault in case grub_printf() is called). + + * util/i386/pc/grub-install.in: Append `--device-map=${device_map}' to + grub_probe. Update all users not to explicitly add it again. + (grub_device): New variable; contains corresponding device for grubdir. + (fs_module, partmap_module, devabstraction_module): Pass + `--device ${grub_device}' to grub_probe to avoid traversing /dev + every time. + 2008-06-05 Robert Millan * normal/misc.c (grub_normal_print_device_info): When a filesystem UUID diff --git a/util/grub-emu.c b/util/grub-emu.c index 00a2c49c9..5431a92c8 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -71,8 +71,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) void grub_machine_init (void) { - signal (SIGINT, SIG_IGN); - grub_console_init (); } void @@ -183,6 +181,9 @@ main (int argc, char *argv[]) sleep (1); } + signal (SIGINT, SIG_IGN); + grub_console_init (); + /* XXX: This is a bit unportable. */ grub_util_biosdisk_init (dev_map); diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 60da57a76..87e5f84e2 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -148,6 +148,8 @@ esac grubdir=${bootdir}/`echo grub | sed ${transform}` device_map=${grubdir}/device.map +grub_probe="${grub_probe} --device-map=${device_map}" + # Check if GRUB is installed. set $grub_setup dummy if test -f "$1"; then @@ -210,8 +212,11 @@ for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst ${pkglibdir}/*.img; do cp -f $file ${grubdir} || exit 1 done +# Write device to a variable so we don't have to traverse /dev every time. +grub_device=`$grub_probe --target=device ${grubdir}` + # Create the core image. First, auto-detect the filesystem module. -fs_module=`$grub_probe --target=fs --device-map=${device_map} ${grubdir}` +fs_module=`$grub_probe --target=fs --device ${grub_device}` if test "x$fs_module" = x -a "x$modules" = x; then echo "Auto-detection of a filesystem module failed." 1>&2 echo "Please specify the module with the option \`--modules' explicitly." 1>&2 @@ -221,10 +226,10 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` +partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` # Device abstraction module, if any (lvm, raid). -devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` +devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` # _chain is often useful modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain" From 26a1f8c4552d4cb9d308f679207dcac515b0dcce Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 6 Jun 2008 15:56:46 +0000 Subject: [PATCH 0161/1707] 2008-06-06 Robert Millan * util/biosdisk.c (open_device): Do not modify sector offset when accessing a partition. kern/disk.c already handles this for us. --- ChangeLog | 5 +++++ util/biosdisk.c | 3 --- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fa2838bd..2f56c51a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-06 Robert Millan + + * util/biosdisk.c (open_device): Do not modify sector offset when + accessing a partition. kern/disk.c already handles this for us. + 2008-06-06 Robert Millan * util/grub-emu.c (grub_machine_init): Move code in this function from diff --git a/util/biosdisk.c b/util/biosdisk.c index b949b2db6..eb1f3ff9b 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -298,9 +298,6 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) /* Make the buffer cache consistent with the physical disk. */ ioctl (fd, BLKFLSBUF, 0); - - if (is_partition) - sector -= disk->partition->start; } #else /* ! __linux__ */ fd = open (map[disk->id].device, flags); From c5e3cfba139b77d27c53aad6ca6beb482610deee Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 6 Jun 2008 16:29:19 +0000 Subject: [PATCH 0162/1707] 2008-06-06 Robert Millan Ensure GRUB_KERNEL_MACHINE_DATA_END is always consistent with the rest of GRUB, and breakage doesn't happen if its value were modified. * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): Redefine as an offset from `GRUB_KERNEL_MACHINE_DATA_END' instead of a constant (same value). * kern/i386/pc/startup.S: Replace hardcoded `0x50' with `GRUB_KERNEL_MACHINE_DATA_END' (same value). --- ChangeLog | 11 +++++++++++ include/grub/i386/pc/kernel.h | 2 +- kern/i386/pc/startup.S | 2 +- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f56c51a7..d1485af22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-06-06 Robert Millan + + Ensure GRUB_KERNEL_MACHINE_DATA_END is always consistent with the + rest of GRUB, and breakage doesn't happen if its value were modified. + + * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): + Redefine as an offset from `GRUB_KERNEL_MACHINE_DATA_END' instead of + a constant (same value). + * kern/i386/pc/startup.S: Replace hardcoded `0x50' with + `GRUB_KERNEL_MACHINE_DATA_END' (same value). + 2008-06-06 Robert Millan * util/biosdisk.c (open_device): Do not modify sector offset when diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index 43a8d5b6e..13e887354 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -44,7 +44,7 @@ #define GRUB_KERNEL_MACHINE_DATA_END 0x50 /* The size of the first region which won't be compressed. */ -#define GRUB_KERNEL_MACHINE_RAW_SIZE 0x4A0 +#define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x450) #ifndef ASM_FILE diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index ebb98fe60..954297891 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -105,7 +105,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + 0x50 + . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END /* * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself). From dc20b0f9f5c0a3c1c4f7077d4015d914094f3c1a Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 7 Jun 2008 04:30:22 +0000 Subject: [PATCH 0163/1707] 2008-06-07 Pavel Roskin * util/biosdisk.c (open_device): Revert last change to the function, it broke installation. The sector needs to be different dependent on which device is opened. --- ChangeLog | 6 ++++++ util/biosdisk.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index d1485af22..0d8176af5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-07 Pavel Roskin + + * util/biosdisk.c (open_device): Revert last change to the + function, it broke installation. The sector needs to be + different dependent on which device is opened. + 2008-06-06 Robert Millan Ensure GRUB_KERNEL_MACHINE_DATA_END is always consistent with the diff --git a/util/biosdisk.c b/util/biosdisk.c index eb1f3ff9b..90df4f1ef 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -298,6 +298,9 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) /* Make the buffer cache consistent with the physical disk. */ ioctl (fd, BLKFLSBUF, 0); + + if (is_partition) + sector -= disk->partition->start; } #else /* ! __linux__ */ fd = open (map[disk->id].device, flags); From ad4936a0357cf9f9eefd535c11b754999848bd08 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Jun 2008 19:18:58 +0000 Subject: [PATCH 0164/1707] 2008-06-08 Robert Millan * include/grub/ntfs.h (struct grub_ntfs_bpb): Rename `serial_number' to `num_serial' (for consistency with other variables). (struct grub_ntfs_data): Add `uuid' member. * fs/ntfs.c (grub_ntfs_mount): Initialize `data->uuid'. (grub_ntfs_uuid): New function. (grub_ntfs_fs): Reference grub_ntfs_uuid() in `uuid' struct member. --- ChangeLog | 9 +++++++++ fs/ntfs.c | 31 +++++++++++++++++++++++++++++++ include/grub/ntfs.h | 3 ++- 3 files changed, 42 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0d8176af5..5678b40fd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-08 Robert Millan + + * include/grub/ntfs.h (struct grub_ntfs_bpb): Rename `serial_number' to + `num_serial' (for consistency with other variables). + (struct grub_ntfs_data): Add `uuid' member. + * fs/ntfs.c (grub_ntfs_mount): Initialize `data->uuid'. + (grub_ntfs_uuid): New function. + (grub_ntfs_fs): Reference grub_ntfs_uuid() in `uuid' struct member. + 2008-06-07 Pavel Roskin * util/biosdisk.c (open_device): Revert last change to the diff --git a/fs/ntfs.c b/fs/ntfs.c index ad5374091..5608e4e23 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -830,6 +830,8 @@ grub_ntfs_mount (grub_disk_t disk) (disk, data->mft_start, 0, data->mft_size << BLK_SHR, data->mmft.buf)) goto fail; + data->uuid = grub_le_to_cpu64 (bpb.num_serial); + if (fixup (data, data->mmft.buf, data->mft_size, "FILE")) goto fail; @@ -1078,6 +1080,34 @@ fail: return grub_errno; } +static grub_err_t +grub_ntfs_uuid (grub_device_t device, char **uuid) +{ + struct grub_ntfs_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_ntfs_mount (disk); + if (data) + { + *uuid = grub_malloc (16 + sizeof ('\0')); + grub_sprintf (*uuid, "%016llx", data->uuid); + } + else + *uuid = NULL; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + static struct grub_fs grub_ntfs_fs = { .name = "ntfs", .dir = grub_ntfs_dir, @@ -1085,6 +1115,7 @@ static struct grub_fs grub_ntfs_fs = { .read = grub_ntfs_read, .close = grub_ntfs_close, .label = grub_ntfs_label, + .uuid = grub_ntfs_uuid, .next = 0 }; diff --git a/include/grub/ntfs.h b/include/grub/ntfs.h index e66e0c318..bdd1a9ece 100644 --- a/include/grub/ntfs.h +++ b/include/grub/ntfs.h @@ -115,7 +115,7 @@ struct grub_ntfs_bpb grub_int8_t reserved_4[3]; grub_int8_t clusters_per_index; grub_int8_t reserved_5[3]; - grub_uint64_t serial_number; + grub_uint64_t num_serial; grub_uint32_t checksum; } __attribute__ ((packed)); @@ -151,6 +151,7 @@ struct grub_ntfs_data grub_uint32_t spc; grub_uint32_t blocksize; grub_uint32_t mft_start; + grub_uint64_t uuid; }; struct grub_ntfs_comp From ce525529f9cc072aea76f4dadf6a3a1027fba740 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Jun 2008 19:46:43 +0000 Subject: [PATCH 0165/1707] 2008-06-08 Robert Millan Based on description from Pavel: * kern/disk.c (grub_disk_check_range): Rename to ... (grub_disk_adjust_range): ... this. Add a comment explaining the tasks performed by this function. --- ChangeLog | 7 +++++++ kern/disk.c | 10 +++++++--- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5678b40fd..48cced2ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-08 Robert Millan + + Based on description from Pavel: + * kern/disk.c (grub_disk_check_range): Rename to ... + (grub_disk_adjust_range): ... this. Add a comment explaining the + tasks performed by this function. + 2008-06-08 Robert Millan * include/grub/ntfs.h (struct grub_ntfs_bpb): Rename `serial_number' to diff --git a/kern/disk.c b/kern/disk.c index 2529e8075..2bbc8c54a 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -322,8 +322,12 @@ grub_disk_close (grub_disk_t disk) grub_free (disk); } +/* This function performs three tasks: + - Make sectors disk relative from partition relative. + - Normalize offset to be less than the sector size. + - Verify that the range is inside the partition. */ static grub_err_t -grub_disk_check_range (grub_disk_t disk, grub_disk_addr_t *sector, +grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector, grub_off_t *offset, grub_size_t size) { *sector += *offset >> GRUB_DISK_SECTOR_BITS; @@ -364,7 +368,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, grub_dprintf ("disk", "Reading `%s'...\n", disk->name); /* First of all, check if the region is within the disk. */ - if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE) + if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE) { grub_error_push (); grub_dprintf ("disk", "Read out of range: sector 0x%llx (%s).\n", @@ -502,7 +506,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, grub_dprintf ("disk", "Writing `%s'...\n", disk->name); - if (grub_disk_check_range (disk, §or, &offset, size) != GRUB_ERR_NONE) + if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE) return -1; real_offset = offset; From f5679726cdeacec0d9bcd399523adaca0fd2664b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Jun 2008 22:54:34 +0000 Subject: [PATCH 0166/1707] 2008-06-08 Robert Millan * util/i386/pc/grub-setup.c (main): If install drive is an LVM, don't append the RAID prefix afterwards. Reported by Clint Adams. --- ChangeLog | 6 ++++++ util/i386/pc/grub-setup.c | 5 ++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48cced2ea..3f3230e92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-08 Robert Millan + + * util/i386/pc/grub-setup.c (main): If install drive is an LVM, + don't append the RAID prefix afterwards. + Reported by Clint Adams. + 2008-06-08 Robert Millan Based on description from Pavel: diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 535a8d0e2..343878149 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -749,9 +749,8 @@ main (int argc, char *argv[]) free (prefix); prefix = newprefix; } - - if (dest_dev[0] == 'm' && dest_dev[1] == 'd' - && dest_dev[2] >= '0' && dest_dev[2] <= '9') + else if (dest_dev[0] == 'm' && dest_dev[1] == 'd' + && dest_dev[2] >= '0' && dest_dev[2] <= '9') { char **devicelist; char *raid_prefix; From 40fd3a2b995ae0cb5caccb207e4e1549d2f0825f Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 9 Jun 2008 15:32:43 +0000 Subject: [PATCH 0167/1707] 2008-06-09 Pavel Roskin * fs/minix.c (grub_minix_mount): Handle error reading superblock. --- ChangeLog | 5 +++++ fs/minix.c | 15 +++++++++------ 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f3230e92..14c205e02 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-09 Pavel Roskin + + * fs/minix.c (grub_minix_mount): Handle error reading + superblock. + 2008-06-08 Robert Millan * util/i386/pc/grub-setup.c (main): If install drive is an LVM, diff --git a/fs/minix.c b/fs/minix.c index e78863e27..aa8ffb17d 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -422,6 +422,8 @@ grub_minix_mount (grub_disk_t disk) /* Read the superblock. */ grub_disk_read (disk, GRUB_MINIX_SBLOCK, 0, sizeof (struct grub_minix_sblock),(char *) &data->sblock); + if (grub_errno) + goto fail; if (grub_le_to_cpu16 (data->sblock.magic) == GRUB_MINIX_MAGIC) { @@ -444,16 +446,17 @@ grub_minix_mount (grub_disk_t disk) data->filename_size = 30; } else - { - grub_free (data); - grub_error (GRUB_ERR_BAD_FS, "not an minix filesystem"); - return 0; - } - + goto fail; + data->disk = disk; data->linknest = 0; return data; + + fail: + grub_free (data); + grub_error (GRUB_ERR_BAD_FS, "not a minix filesystem"); + return 0; } static grub_err_t From 16ae7781ef85a52a0dfe4ed4b1023cc94b0fda0f Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 12 Jun 2008 14:48:27 +0000 Subject: [PATCH 0168/1707] 2008-06-12 Pavel Roskin * fs/fshelp.c (grub_fshelp_read): New function. Implement linear disk read with journal translation. * fs/ext2.c: Use grub_fshelp_read() instead of grub_disk_read(). * include/grub/fshelp.h: Declare grub_fshelp_read(). --- ChangeLog | 7 +++++++ fs/ext2.c | 46 ++++++++++++++++++------------------------- fs/fshelp.c | 39 ++++++++++++++++++++++++++++++++++++ include/grub/fshelp.h | 9 +++++++++ 4 files changed, 74 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14c205e02..f830b732a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-12 Pavel Roskin + + * fs/fshelp.c (grub_fshelp_read): New function. Implement + linear disk read with journal translation. + * fs/ext2.c: Use grub_fshelp_read() instead of grub_disk_read(). + * include/grub/fshelp.h: Declare grub_fshelp_read(). + 2008-06-09 Pavel Roskin * fs/minix.c (grub_minix_mount): Handle error reading diff --git a/fs/ext2.c b/fs/ext2.c index ffe9e3356..999bd8080 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -257,12 +257,11 @@ inline static grub_err_t grub_ext2_blockgroup (struct grub_ext2_data *data, int group, struct grub_ext2_block_group *blkgrp) { - return grub_disk_read (data->disk, - (grub_fshelp_map_block (data->journal, - grub_le_to_cpu32 (data->sblock.first_data_block) + 1) - << LOG2_EXT2_BLOCK_SIZE (data)), - group * sizeof (struct grub_ext2_block_group), - sizeof (struct grub_ext2_block_group), (char *) blkgrp); + return grub_fshelp_read (data->disk, data->journal, + grub_le_to_cpu32 (data->sblock.first_data_block) + 1, + group * sizeof (struct grub_ext2_block_group), + sizeof (struct grub_ext2_block_group), + (char *) blkgrp, LOG2_EXT2_BLOCK_SIZE (data)); } @@ -283,11 +282,9 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { grub_uint32_t indir[blksz / 4]; - if (grub_disk_read (data->disk, - grub_fshelp_map_block(data->journal, - grub_le_to_cpu32 (inode->blocks.indir_block)) - << log2_blksz, - 0, blksz, (char *) indir)) + if (grub_fshelp_read (data->disk, data->journal, + grub_le_to_cpu32 (inode->blocks.indir_block), + 0, blksz, (char *) indir, log2_blksz)) return grub_errno; blknr = grub_le_to_cpu32 (indir[fileblock - INDIRECT_BLOCKS]); @@ -300,18 +297,14 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + blksz / 4); grub_uint32_t indir[blksz / 4]; - if (grub_disk_read (data->disk, - grub_fshelp_map_block(data->journal, - grub_le_to_cpu32 (inode->blocks.double_indir_block)) - << log2_blksz, - 0, blksz, (char *) indir)) + if (grub_fshelp_read (data->disk, data->journal, + grub_le_to_cpu32 (inode->blocks.double_indir_block), + 0, blksz, (char *) indir, log2_blksz)) return grub_errno; - if (grub_disk_read (data->disk, - grub_fshelp_map_block(data->journal, - grub_le_to_cpu32 (indir[rblock / perblock])) - << log2_blksz, - 0, blksz, (char *) indir)) + if (grub_fshelp_read (data->disk, data->journal, + grub_le_to_cpu32 (indir[rblock / perblock]), + 0, blksz, (char *) indir, log2_blksz)) return grub_errno; @@ -372,12 +365,11 @@ grub_ext2_read_inode (struct grub_ext2_data *data, % inodes_per_block; /* Read the inode. */ - if (grub_disk_read (data->disk, - grub_fshelp_map_block(data->journal, - grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno) - << LOG2_EXT2_BLOCK_SIZE (data), - EXT2_INODE_SIZE (data) * blkoff, - sizeof (struct grub_ext2_inode), (char *) inode)) + if (grub_fshelp_read (data->disk, data->journal, + grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno, + EXT2_INODE_SIZE (data) * blkoff, + sizeof (struct grub_ext2_inode), (char *) inode, + LOG2_EXT2_BLOCK_SIZE (data))) return grub_errno; return 0; diff --git a/fs/fshelp.c b/fs/fshelp.c index faec1f7fd..52131b019 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -215,6 +215,45 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, } +/* Read LEN bytes from the block BLOCK on disk DISK into the buffer BUF, + beginning with the block POS. Apply mappings from LOG. The blocks + have a size of LOG2BLOCKSIZE (in log2). */ +grub_err_t grub_fshelp_read (grub_disk_t disk, grub_fshelp_journal_t log, + grub_disk_addr_t block, grub_off_t pos, + grub_size_t len, char *buf, int log2blocksize) +{ + grub_off_t relblk; + + relblk = pos >> (log2blocksize + GRUB_DISK_SECTOR_BITS); + block += relblk; + pos -= relblk << (log2blocksize + GRUB_DISK_SECTOR_BITS); + + while (len > 0) + { + grub_err_t ret; + grub_size_t size; + + size = (GRUB_DISK_SECTOR_SIZE << log2blocksize) - pos; + if (size > len) + size = len; + + ret = grub_disk_read (disk, + grub_fshelp_map_block (log, block) << log2blocksize, + pos, size, buf); + + if (ret) + return ret; + + block++; + pos = 0; + buf += size; + len -= size; + } + + return 0; +} + + /* Read LEN bytes from the file NODE on disk DISK into the buffer BUF, beginning with the block POS. READ_HOOK should be set before reading a block from the file. GET_BLOCK is used to translate file diff --git a/include/grub/fshelp.h b/include/grub/fshelp.h index 0120cbf71..847f78e36 100644 --- a/include/grub/fshelp.h +++ b/include/grub/fshelp.h @@ -84,6 +84,15 @@ EXPORT_FUNC(grub_fshelp_find_file) (const char *path, enum grub_fshelp_filetype expect); +/* Read LEN bytes from the block BLOCK on disk DISK into the buffer BUF, + beginning with the block POS. Apply mappings from LOG. The blocks + have a size of LOG2BLOCKSIZE (in log2). */ +grub_err_t +EXPORT_FUNC(grub_fshelp_read) (grub_disk_t disk, grub_fshelp_journal_t log, + grub_disk_addr_t block, grub_off_t pos, + grub_size_t len, char *buf, int log2blocksize); + + /* Read LEN bytes from the file NODE on disk DISK into the buffer BUF, beginning with the block POS. READ_HOOK should be set before reading a block from the file. GET_BLOCK is used to translate file From e6d1a308ed9e6c7119f070a6e9e048501f92b9fb Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 12 Jun 2008 16:13:21 +0000 Subject: [PATCH 0169/1707] 2008-06-12 Pavel Roskin * fs/ext2.c (grub_ext2_read_inode): Don't normalize block number, grub_fshelp_read() does it for us. --- ChangeLog | 3 +++ fs/ext2.c | 13 +++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index f830b732a..9cc616548 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-06-12 Pavel Roskin + * fs/ext2.c (grub_ext2_read_inode): Don't normalize block + number, grub_fshelp_read() does it for us. + * fs/fshelp.c (grub_fshelp_read): New function. Implement linear disk read with journal translation. * fs/ext2.c: Use grub_fshelp_read() instead of grub_disk_read(). diff --git a/fs/ext2.c b/fs/ext2.c index 999bd8080..3768a816e 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -344,9 +344,6 @@ grub_ext2_read_inode (struct grub_ext2_data *data, { struct grub_ext2_block_group blkgrp; struct grub_ext2_sblock *sblock = &data->sblock; - int inodes_per_block; - - unsigned int blkno; unsigned int blkoff; /* It is easier to calculate if the first inode is 0. */ @@ -358,15 +355,11 @@ grub_ext2_read_inode (struct grub_ext2_data *data, if (grub_errno) return grub_errno; - inodes_per_block = EXT2_BLOCK_SIZE (data) / EXT2_INODE_SIZE (data); - blkno = (ino % grub_le_to_cpu32 (sblock->inodes_per_group)) - / inodes_per_block; - blkoff = (ino % grub_le_to_cpu32 (sblock->inodes_per_group)) - % inodes_per_block; - + blkoff = ino % grub_le_to_cpu32 (sblock->inodes_per_group); + /* Read the inode. */ if (grub_fshelp_read (data->disk, data->journal, - grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno, + grub_le_to_cpu32 (blkgrp.inode_table_id), EXT2_INODE_SIZE (data) * blkoff, sizeof (struct grub_ext2_inode), (char *) inode, LOG2_EXT2_BLOCK_SIZE (data))) From dfe9ddd4cb617ba548982e705311b1555d49da4d Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 13 Jun 2008 06:47:46 +0000 Subject: [PATCH 0170/1707] 2008-06-13 Bean * commands/hexdump.c (grub_cmd_hexdump): Adjust offset for partition. * fs/ext2.c (grub_ext3_get_journal): Fix revoke block handling. * fs/fshelp.c (grub_fshelp_map_block): Don't map block 0 as it's used to indicate sparse block. --- ChangeLog | 9 +++++++++ commands/hexdump.c | 6 +++++- fs/ext2.c | 18 ++++++++++-------- fs/fshelp.c | 2 +- 4 files changed, 25 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9cc616548..22beade10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-13 Bean + + * commands/hexdump.c (grub_cmd_hexdump): Adjust offset for partition. + + * fs/ext2.c (grub_ext3_get_journal): Fix revoke block handling. + + * fs/fshelp.c (grub_fshelp_map_block): Don't map block 0 as it's used + to indicate sparse block. + 2008-06-12 Pavel Roskin * fs/ext2.c (grub_ext2_read_inode): Don't normalize block diff --git a/commands/hexdump.c b/commands/hexdump.c index 6d97fe4fe..c9aa441e1 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -25,6 +25,7 @@ #include #include #include +#include static const struct grub_arg_option options[] = { {"skip", 's', 0, "skip offset bytes from the beginning of file.", 0, @@ -84,7 +85,7 @@ grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) { char buf[GRUB_DISK_SECTOR_SIZE * 4]; grub_ssize_t size, length; - unsigned long skip; + grub_disk_addr_t skip; int namelen; if (argc != 1) @@ -107,6 +108,9 @@ grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) if (! disk) return 0; + if (disk->partition) + skip += grub_partition_get_start (disk->partition) << GRUB_DISK_SECTOR_BITS; + sector = (skip >> (GRUB_DISK_SECTOR_BITS + 2)) * 4; ofs = skip & (GRUB_DISK_SECTOR_SIZE * 4 - 1); while (length) diff --git a/fs/ext2.c b/fs/ext2.c index 3768a816e..184b973ce 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -436,12 +436,12 @@ grub_ext3_get_journal (struct grub_ext2_data *data) { struct grub_ext3_journal_header *jh; - if (grub_fshelp_read_file (data->disk, &data->logfile, 0, - block << (log2bs + 9), sizeof (buf), - buf, grub_ext2_read_block, - log->last_block << (log2bs + 9), - log2bs) != - (int) sizeof (buf)) + grub_fshelp_read_file (data->disk, &data->logfile, 0, + block << (log2bs + 9), sizeof (buf), + buf, grub_ext2_read_block, + log->last_block << (log2bs + 9), + log2bs); + if (grub_errno) break; jh = (struct grub_ext3_journal_header *) &buf[0]; @@ -493,11 +493,13 @@ grub_ext3_get_journal (struct grub_ext2_data *data) case EXT3_JOURNAL_REVOKE_BLOCK: { struct grub_ext3_journal_revoke_header *jrh; - grub_uint32_t i; + grub_uint32_t i, cnt; jrh = (struct grub_ext3_journal_revoke_header *) jh; + cnt = (grub_be_to_cpu32 (jrh->count) - + sizeof (struct grub_ext3_journal_revoke_header)) >> 2; - for (i = 0; i < grub_be_to_cpu32 (jrh->count); i++) + for (i = 0; i < cnt; i++) { int j; grub_uint32_t map; diff --git a/fs/fshelp.c b/fs/fshelp.c index 52131b019..2fae065c8 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -356,7 +356,7 @@ grub_fshelp_map_block (grub_fshelp_journal_t log, grub_disk_addr_t block) { int map_block; - if (! log) + if ((! log) || (! block)) return block; for (map_block = log->num_mappings - 1; map_block >= 0; map_block--) From d687651c074c5392aa915f458d43904febbbddac Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 13 Jun 2008 21:51:14 +0000 Subject: [PATCH 0171/1707] 2008-06-13 Pavel Roskin * commands/ls.c (grub_ls_list_files): Fix format warnings. --- ChangeLog | 4 ++++ commands/ls.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 22beade10..f7a885b0e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-06-13 Pavel Roskin + + * commands/ls.c (grub_ls_list_files): Fix format warnings. + 2008-06-13 Bean * commands/hexdump.c (grub_cmd_hexdump): Adjust offset for partition. diff --git a/commands/ls.c b/commands/ls.c index e7b630275..77af426b1 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -105,7 +105,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) } if (! human) - grub_printf ("%-12llu", file->size); + grub_printf ("%-12llu", (unsigned long long) file->size); else { float fsize = file->size; @@ -126,7 +126,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) grub_printf ("%-12s", buf); } else - grub_printf ("%-12llu", file->size); + grub_printf ("%-12llu", (unsigned long long) file->size); } grub_file_close (file); From 23a64d8eafb1d56ddd358da6b09f8d3ba6f89534 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 14 Jun 2008 19:04:44 +0000 Subject: [PATCH 0172/1707] 2008-06-14 Robert Millan * util/i386/efi/grub-install.in (modules): Remove `_chain'. * util/i386/pc/grub-install.in (modules): Likewise. --- ChangeLog | 5 +++++ util/i386/efi/grub-install.in | 4 ++-- util/i386/pc/grub-install.in | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f7a885b0e..8913063db 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-14 Robert Millan + + * util/i386/efi/grub-install.in (modules): Remove `_chain'. + * util/i386/pc/grub-install.in (modules): Likewise. + 2008-06-13 Pavel Roskin * commands/ls.c (grub_ls_list_files): Fix format warnings. diff --git a/util/i386/efi/grub-install.in b/util/i386/efi/grub-install.in index fae15172f..645190da2 100644 --- a/util/i386/efi/grub-install.in +++ b/util/i386/efi/grub-install.in @@ -193,8 +193,8 @@ partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdi # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` -# _chain is often useful -modules="$modules $fs_module $partmap_module $devabstraction_module _chain" +# The order in this list is critical. Be careful when modifiing it. +modules="$modules $fs_module $partmap_module $devabstraction_module" $grub_mkimage --output=${grubdir}/grub.efi $modules || exit 1 diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 87e5f84e2..ef87187e8 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -231,8 +231,8 @@ partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/nul # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` -# _chain is often useful -modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module _chain" +# The order in this list is critical. Be careful when modifiing it. +modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module" $grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}`/ $modules || exit 1 From 21cf716ad4a21d61624e1139e6f8a9ff1ecbee91 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 15 Jun 2008 13:31:18 +0000 Subject: [PATCH 0173/1707] 2008-06-15 Robert Millan * fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in extent-btree which is written as big endian on disk. Reported by Alain Greppin . --- ChangeLog | 6 ++++++ fs/sfs.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8913063db..94e95fdef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-15 Robert Millan + + * fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in + extent-btree which is written as big endian on disk. + Reported by Alain Greppin . + 2008-06-14 Robert Millan * util/i386/efi/grub-install.in (modules): Remove `_chain'. diff --git a/fs/sfs.c b/fs/sfs.c index 82a0a9ec8..c92e57cfd 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -1,7 +1,7 @@ /* sfs.c - Amiga Smart FileSystem. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -172,7 +172,7 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, return grub_errno; } - for (i = 0; i < tree->nodes; i++) + for (i = 0; i < grub_be_to_cpu16 (tree->nodes); i++) { #define EXTNODE(tree, index) \ @@ -189,7 +189,7 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, /* In case the last node is reached just use that one, it is the right match. */ - if (i + 1 == tree->nodes && !tree->leaf) + if (i + 1 == grub_be_to_cpu16 (tree->nodes) && !tree->leaf) { next = grub_be_to_cpu32 (EXTNODE (tree, i)->data); break; From a7cbd45a07566e5fdefcdc0a7444e99b7e11b218 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 15 Jun 2008 14:19:34 +0000 Subject: [PATCH 0174/1707] 2008-06-15 Robert Millan * term/i386/pc/console.c [GRUB_MACHINE_LINUXBIOS] (grub_console_init): Initialize keyboard controller after registering the terminal, so that grub_printf() can be called from grub_keyboard_controller_init(). --- ChangeLog | 6 ++++++ term/i386/pc/console.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 94e95fdef..e2d30dce3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-15 Robert Millan + + * term/i386/pc/console.c [GRUB_MACHINE_LINUXBIOS] (grub_console_init): + Initialize keyboard controller after registering the terminal, so that + grub_printf() can be called from grub_keyboard_controller_init(). + 2008-06-15 Robert Millan * fs/sfs.c (grub_sfs_read_extent): Fix the count of nodes in diff --git a/term/i386/pc/console.c b/term/i386/pc/console.c index 04a1ae1e4..1d199e927 100644 --- a/term/i386/pc/console.c +++ b/term/i386/pc/console.c @@ -149,12 +149,12 @@ static struct grub_term grub_console_term = void grub_console_init (void) { + grub_term_register (&grub_console_term); + grub_term_set_current (&grub_console_term); + #ifdef GRUB_MACHINE_LINUXBIOS grub_keyboard_controller_init (); #endif - - grub_term_register (&grub_console_term); - grub_term_set_current (&grub_console_term); } void From a92072849301e528e658d5ba86178938377adc19 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 15 Jun 2008 18:21:16 +0000 Subject: [PATCH 0175/1707] 2008-06-15 Robert Millan * util/i386/pc/grub-mkimage.c (generate_image): If we included a drive in our prefix, set install_{dos,bsd}_part = -2 to indicate this can be skipped later. (main): If a memdisk was requested, add "(memdisk)" drive explicitly to the beginning of the prefix. * kern/i386/pc/init.c (make_install_device): Remove memdisk check. It is assumed that if we have a memdisk, grub-mkimage has set grub_prefix to include the "(memdisk)" drive in it. --- ChangeLog | 12 ++++++++++++ kern/i386/pc/init.c | 7 +------ util/i386/pc/grub-mkimage.c | 15 +++++++++++++++ 3 files changed, 28 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e2d30dce3..9de46681d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-15 Robert Millan + + * util/i386/pc/grub-mkimage.c (generate_image): If we included a drive + in our prefix, set install_{dos,bsd}_part = -2 to indicate this can be + skipped later. + (main): If a memdisk was requested, add "(memdisk)" drive explicitly to + the beginning of the prefix. + + * kern/i386/pc/init.c (make_install_device): Remove memdisk check. + It is assumed that if we have a memdisk, grub-mkimage has set + grub_prefix to include the "(memdisk)" drive in it. + 2008-06-15 Robert Millan * term/i386/pc/console.c [GRUB_MACHINE_LINUXBIOS] (grub_console_init): diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 757f5d5c5..e47cbfd86 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -64,12 +64,7 @@ make_install_device (void) /* XXX: This should be enough. */ char dev[100]; - if (grub_memdisk_image_size) - { - grub_sprintf (dev, "(memdisk)%s", grub_prefix); - grub_strcpy (grub_prefix, dev); - } - else if (grub_install_dos_part != -2) + if (grub_install_dos_part != -2) { /* If the root drive is not set explicitly, assume that it is identical to the boot drive. */ diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 48d6dfce7..189ec4e53 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -182,6 +182,16 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE)) = grub_cpu_to_le32 (core_size - GRUB_KERNEL_MACHINE_RAW_SIZE); + /* If we included a drive in our prefix, let GRUB know it doesn't have to + prepend the drive told by BIOS. */ + if (prefix[0] == '(') + { + *((grub_int32_t *) (core_img + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART)) + = grub_cpu_to_le32 (-2); + *((grub_int32_t *) (core_img + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART)) + = grub_cpu_to_le32 (-2); + } + if (core_size > GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR) grub_util_error ("Core image is too big (%p > %p)\n", core_size, GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR); @@ -278,6 +288,11 @@ main (int argc, char *argv[]) free (memdisk); memdisk = xstrdup (optarg); + + if (prefix) + free (prefix); + + prefix = xstrdup ("(memdisk)/boot/grub"); break; case 'h': From 50465dd603b2b79ad39d3fedc6d46b1558d64561 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 15 Jun 2008 20:15:57 +0000 Subject: [PATCH 0176/1707] 2008-06-15 Robert Millan * util/grub.d/10_linux.in: Use the underliing device for loop-AES devices. Reported by Max Vozeler. --- ChangeLog | 6 ++++++ util/grub.d/10_linux.in | 11 ++++++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9de46681d..b307b5668 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-15 Robert Millan + + * util/grub.d/10_linux.in: Use the underliing device for loop-AES + devices. + Reported by Max Vozeler. + 2008-06-15 Robert Millan * util/i386/pc/grub-mkimage.c (generate_image): If we included a drive diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 9aac6327b..1ae1e1e51 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -28,7 +28,16 @@ else fi if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] ; then - LINUX_ROOT_DEVICE=${GRUB_DEVICE} + # loop-AES arranges things so that /dev/loop/X can be our root device, but + # the initrds that Linux uses don't like that. + case ${GRUB_DEVICE} in + /dev/loop/*|/dev/loop[0-9]) + LINUX_ROOT_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; + *) + LINUX_ROOT_DEVICE=${GRUB_DEVICE} + ;; + esac else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi From 95614c84f8d53c3fa64a8d40c68fc0c0d54fe582 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 16 Jun 2008 00:42:48 +0000 Subject: [PATCH 0177/1707] 2008-06-15 Pavel Roskin * commands/ls.c (grub_ls_list_files): Use integer calculations for human readable format, avoid floating point use. * kern/misc.c (grub_ftoa): Remove. (grub_vsprintf): Remove floating point support. --- ChangeLog | 7 +++++++ commands/ls.c | 10 +++++++--- kern/misc.c | 31 ------------------------------- 3 files changed, 14 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index b307b5668..19ca14092 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-15 Pavel Roskin + + * commands/ls.c (grub_ls_list_files): Use integer calculations + for human readable format, avoid floating point use. + * kern/misc.c (grub_ftoa): Remove. + (grub_vsprintf): Remove floating point support. + 2008-06-15 Robert Millan * util/grub.d/10_linux.in: Use the underliing device for loop-AES diff --git a/commands/ls.c b/commands/ls.c index 77af426b1..4257e026f 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -108,21 +108,25 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) grub_printf ("%-12llu", (unsigned long long) file->size); else { - float fsize = file->size; + grub_uint64_t fsize = file->size * 100ULL; int fsz = file->size; int units = 0; char buf[20]; while (fsz / 1024) { - fsize /= 1024; + fsize = (fsize + 512) / 1024; fsz /= 1024; units++; } if (units) { - grub_sprintf (buf, "%0.2f%c", fsize, grub_human_sizes[units]); + grub_uint32_t whole, fraction; + + whole = grub_divmod64 (fsize, 100, &fraction); + grub_sprintf (buf, "%u.%02u%c", whole, fraction, + grub_human_sizes[units]); grub_printf ("%-12s", buf); } else diff --git a/kern/misc.c b/kern/misc.c index 444ce2e50..c662c963c 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -655,24 +655,6 @@ grub_lltoa (char *str, int c, unsigned long long n) return p; } -static char * -grub_ftoa (char *str, double f, int round) -{ - unsigned int intp; - unsigned int fractp; - unsigned int power = 1; - int i; - - for (i = 0; i < round; i++) - power *= 10; - - intp = f; - fractp = (f - (float) intp) * power; - - grub_sprintf (str, "%d.%d", intp, fractp); - return str; -} - int grub_vsprintf (char *str, const char *fmt, va_list args) { @@ -807,19 +789,6 @@ grub_vsprintf (char *str, const char *fmt, va_list args) write_char (n & 0xff); break; - case 'f': - { - float f; - f = va_arg (args, double); - grub_ftoa (tmp, f, format2); - if (!rightfill && grub_strlen (tmp) < format1) - write_fill (zerofill, format1 - grub_strlen (tmp)); - write_str (tmp); - if (rightfill && grub_strlen (tmp) < format1) - write_fill (zerofill, format1 - grub_strlen (tmp)); - break; - } - case 'C': { grub_uint32_t code = va_arg (args, grub_uint32_t); From fe6b695a02cbb711e0f2a956e032d4dfc0fa7091 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 16 Jun 2008 01:10:14 +0000 Subject: [PATCH 0178/1707] Fix typos --- ChangeLog | 64 +++++++++++++++++++++++++++---------------------------- 1 file changed, 32 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19ca14092..33d57cdf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,7 +7,7 @@ 2008-06-15 Robert Millan - * util/grub.d/10_linux.in: Use the underliing device for loop-AES + * util/grub.d/10_linux.in: Use the underlying device for loop-AES devices. Reported by Max Vozeler. @@ -280,7 +280,7 @@ * util/biosdisk.c (map): Redefine structure to hold information about GRUB drive name. - (get_drive): Reimplement without assuming (and verifiing) BIOS-like + (get_drive): Reimplement without assuming (and verifying) BIOS-like drive names. (call_hook): Remove. (grub_util_biosdisk_iterate): Access drive names via `.drive' struct @@ -685,7 +685,7 @@ iterating through it. (grub_lvm_open): Don't assume `vg->lvs != NULL' when iterating through it. - (grub_lvm_scan_device): Check the return value (and fail gracefuly + (grub_lvm_scan_device): Check the return value (and fail gracefully when due) on each grub_lvm_getvalue() or grub_strstr() call. Don't assume `vg->pvs != NULL' when iterating through it. @@ -1359,7 +1359,7 @@ * disk/raid.c (grub_raid_scan_device): Check for `array->device[sb.this_disk.number]' rather than for `array->device[sb.this_disk.number]->name', since the latter is not - garanteed to be accessible. + guaranteed to be accessible. 2008-02-08 Robert Millan @@ -1395,7 +1395,7 @@ Patch from Jeroen Dekkers. * disk/raid.c (grub_raid_scan_device): Reset `grub_errno' on disk - failure, since succesfuly reading all array members might not be + failure, since successfully reading all array members might not be required. 2008-02-06 Robert Millan @@ -1425,7 +1425,7 @@ * util/grub-fstest.c: Don't include unused header file script.h. - * conf/common.rmk (grub-fstest.c_DEPENDENCIES): Move to the begginning + * conf/common.rmk (grub-fstest.c_DEPENDENCIES): Move to the beginning of file. (grub_fstest_SOURCES): Likewise. @@ -1793,7 +1793,7 @@ Revert my previous commits (based on wrong assumption of how grub_errno works). - * kern/disk.c (grub_disk_open): Stop reseting grub_errno. + * kern/disk.c (grub_disk_open): Stop resetting grub_errno. * kern/file.c (grub_file_open): Likewise. 2008-01-24 Pavel Roskin @@ -2085,14 +2085,14 @@ * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_mmu): New variable. (grub_ieee1275_find_options): If `grub_ieee1275_mmu' is 0, set `GRUB_IEEE1275_FLAG_REAL_MODE'. - (cmain): Intialize `grub_ieee1275_mmu' (using /chosen/mmu integer + (cmain): Initialize `grub_ieee1275_mmu' (using /chosen/mmu integer property). * kern/powerpc/ieee1275/openfw.c (grub_map): Rely on pre-initialized `grub_ieee1275_mmu' rather than obtaining a handler on every call. 2008-01-19 Robert Millan - Get rid of confusing function (superceeded by + Get rid of confusing function (superseded by `grub_ieee1275_get_integer_property') * include/grub/ieee1275/ieee1275.h (grub_ieee1275_decode_int_4): Remove prototype. @@ -2172,7 +2172,7 @@ * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Replace grub_ieee1275_get_property() with grub_ieee1275_get_integer_property() - where appropiate. + where appropriate. * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Likewise. (grub_map): Likewise. * kern/sparc64/ieee1275/openfw.c (grub_map): Likewise. @@ -2342,7 +2342,7 @@ (grub_reiserfs_get_key_offset): Likewise. (grub_reiserfs_set_key_offset): Likewise. (grub_reiserfs_set_key_type): Likewise. - (grub_reiserfs_iterate_dir): Return 1 if found, otheriwise 0. + (grub_reiserfs_iterate_dir): Return 1 if found, otherwise 0. (GRUB_REISERFS_KEYV2_BITFIELD): Undefined. Probably it would be better to remove the bitfield version completely. @@ -2451,7 +2451,7 @@ 2008-01-05 Robert Millan * util/biosdisk.c (get_os_disk): Check for devfs-style IDE and SCSI - discs unconditionaly, since udev and others have options to provide + discs unconditionally, since udev and others have options to provide them. 2008-01-05 Robert Millan @@ -3339,7 +3339,7 @@ * geninitheader.sh: Process file specified in first parameter rather than hardcoding grub_modules_init.lst. - * geninit.sh: Likewise. Also, construct header name dynamicaly rather + * geninit.sh: Likewise. Also, construct header name dynamically rather than hardcoding grub_modules_init.h. * conf/common.rmk: Rename grub_modules_init.[ch] files associated with @@ -3681,11 +3681,11 @@ Also use grub-probe to get rid of unportable /proc/mounts check. Print the same informational message that the other scripts do, before - exitting. + exiting. 2007-06-23 Robert Millan - * util/update-grub_lib.in (font_path): New function. Determine wether + * util/update-grub_lib.in (font_path): New function. Determine whether a font file can be found and, if so, echo the GRUB path to it. * util/update-grub.in: Handle multiple terminals depending on user @@ -3753,7 +3753,7 @@ Add --pkglibdir=DIR option to override pkglibdir. Mention --image-type=TYPE in help output. Fix --grub-mkimage (it was a no-op). - Abort gracefuly when no parameter is given. + Abort gracefully when no parameter is given. 2007-06-11 Robert Millan @@ -3777,7 +3777,7 @@ * util/grub.d/00_header.in: Only set root variable when GRUB_DRIVE could be identified by update-grub. Remove redundant check for - unifont.pff existance (since convert_system_path_to_grub_path now + unifont.pff existence (since convert_system_path_to_grub_path now handles that). 2007-06-04 Robert Millan @@ -3974,7 +3974,7 @@ 2007-05-09 Robert Millan * util/i386/pc/grub-probe.c (probe): When detecting partition map, - fail gracefuly if dev->disk->partition == NULL. + fail gracefully if dev->disk->partition == NULL. 2007-05-07 Robert Millan @@ -4058,7 +4058,7 @@ 2007-04-10 Jerone Young - * configure.ac: Add argument for autoconf to use tranformation + * configure.ac: Add argument for autoconf to use transformation ability. * Makefile.in: Add autoconf package transformation code. * util/i386/pc/grub-install.in: Likewise. @@ -4543,7 +4543,7 @@ 2006-08-15 Johan Rydberg - * genmk.rb: Let GCC generate dependenceies the first time it + * genmk.rb: Let GCC generate dependencies the first time it compiles a file; using the -MD option. * conf/common.mk: Regenerate. * conf/i386-pc.mk: Likewise. @@ -4832,7 +4832,7 @@ SIZE to grub_disk_addr_t, grub_off_t and grub_size_t, respectively. - * kern/file.c (grub_file_read): Prevent an oveflow of LEN, as the + * kern/file.c (grub_file_read): Prevent an overflow of LEN, as the return value is signed. (grub_file_seek): Change the type of OLD to grub_off_t. Do not test if OFFSET is less than zero, as OFFSET is unsigned now. @@ -5515,7 +5515,7 @@ argument IMAGE_HANDLE and specify it to get a loaded image. (grub_arch_modules_addr): Specify GRUB_EFI_IMAGE_HANDLE to grub_efi_get_loaded_image. - (grub_efi_get_filename): Divide the legnth by the size of + (grub_efi_get_filename): Divide the length by the size of grub_efi_char16_t. (grub_efi_get_device_path): New function. (grub_efi_print_device_path): Print End Device Path nodes. Divide @@ -6745,7 +6745,7 @@ * conf/powerpc-ieee1275.rmk: Include conf/common.mk. (pkgdata_MODULES): Removed fshelp.mod, fat.mod, ext2.mod, ufs.mod, - minux.mod, hfs.mod, jfs.mod, xfs.mod, affs.mod, sfs.mod, + minix.mod, hfs.mod, jfs.mod, xfs.mod, affs.mod, sfs.mod, hello.mod, boot.mod, terminal.mod, ls.mod, cmp.mod, cat.mod, help.mod, font.mod, terminfo.mod, amiga.mod, apple.mod, pc.mod, sun.mod, acorn.mod, loopback.mod, default.mod, timeout.mod, @@ -6790,7 +6790,7 @@ * conf/i386-pc.rmk: Include conf/common.mk. (pkgdata_MODULES): Removed fshelp.mod, fat.mod, ext2.mod, ufs.mod, - minux.mod, hfs.mod, jfs.mod, xfs.mod, affs.mod, sfs.mod, + minix.mod, hfs.mod, jfs.mod, xfs.mod, affs.mod, sfs.mod, hello.mod, boot.mod, terminal.mod, ls.mod, cmp.mod, cat.mod, help.mod, font.mod, terminfo.mod, amiga.mod, apple.mod, pc.mod, sun.mod, acorn.mod, loopback.mod, default.mod, timeout.mod, @@ -6896,11 +6896,11 @@ * commands/timeout.c (grub_timeout_init, grub_timeout_fini): Likewise. * commands/i386/pc/halt.c (grub_halt_init, grub_halt_fini): Likewise. - * commands/iee1275/halt.c (grub_halt_init, grub_halt_fini): + * commands/ieee1275/halt.c (grub_halt_init, grub_halt_fini): Likewise. * commands/i386/pc/reboot.c (grub_reboot_init, grub_reboot_fini): Likewise. - * commands/iee1275/reboot.c (grub_reboot_init, grub_reboot_fini): + * commands/ieee1275/reboot.c (grub_reboot_init, grub_reboot_fini): Likewise. * disk/loopback.c (grub_loop_init, grub_loop_fini): Likewise. * fs/affs.c (grub_affs_init, grub_affs_fini): Likewise. @@ -7300,7 +7300,7 @@ * include/grub/types.h (grub_host_addr_t, grub_host_off_t) (grub_host_size_t, grub_host_ssize_t): New types. (grub_addr_t, grub_off_t, grub_size_t, grub_ssize_t): Make type - dependant of `GRUB_CPU_SIZEOF_VOID_P' instead on + dependent of `GRUB_CPU_SIZEOF_VOID_P' instead on `GRUB_HOST_SIZEOF_VOID_P'. * include/grub/kernel.h (struct grub_module_header): Type of @@ -7544,7 +7544,7 @@ 2005-08-20 Yoshinori K. Okuji * partmap/pc.c (pc_partition_map_iterate): Include the value of an - invalid magic in thre error. + invalid magic in the error. * commands/search.c: New file. @@ -7860,7 +7860,7 @@ of void. * normal/menu.c (draw_border): Cast GRUB_TERM_BORDER_WIDTH to - unsigned explictly before comparing it with I. + unsigned explicitly before comparing it with I. * kern/main.c (grub_env_write_root): Add the attribute unused into VAR. @@ -8011,7 +8011,7 @@ 2005-08-06 Yoshinori K. Okuji * conf/i386-pc.rmk (kernel_img_HEADERS): Reordered for - readablity. + readability. * config.guess: Updated to the latest version from gnulib. * config.sub: Likewise. @@ -10018,7 +10018,7 @@ print_partition_completion, add_completion, iterate_commands, iterate_dev, iterate_part and iterate_dir. Moved code to print partition information from here to kern/disk.c. - (pupa_cmdline_run): Don't check if the funtion exists anymore. + (pupa_cmdline_run): Don't check if the function exists anymore. * normal/main.c: Include . (pupa_rescue_cmd_normal): Use the environment variable `prefix' instead of using pupa_dl_get_prefix to get the prefix. @@ -10531,7 +10531,7 @@ * kern/rescue.c (pupa_rescue_cmd_rmmod): Call pupa_dl_unload, if possible. - * kern/dl.c (pupa_dl_ref): Refer dependending modules + * kern/dl.c (pupa_dl_ref): Refer depending modules recursively. (pupa_dl_unref): Unrefer depending modules recursively. Don't call pupa_dl_unload implicitly, because PUPA can crash if From 3540a760ea8cdde7d3c48b140190232ef43fd126 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 16 Jun 2008 05:00:50 +0000 Subject: [PATCH 0179/1707] 2008-06-16 Pavel Roskin * conf/powerpc-ieee1275.rmk: Remove -msoft-float, we don't use floating point anymore. * include/grub/powerpc/libgcc.h: Leave only necessary exports. --- ChangeLog | 6 ++++++ conf/powerpc-ieee1275.mk | 2 +- conf/powerpc-ieee1275.rmk | 2 +- include/grub/powerpc/libgcc.h | 22 ---------------------- 4 files changed, 8 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33d57cdf4..3de15425a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-16 Pavel Roskin + + * conf/powerpc-ieee1275.rmk: Remove -msoft-float, we don't use + floating point anymore. + * include/grub/powerpc/libgcc.h: Leave only necessary exports. + 2008-06-15 Pavel Roskin * commands/ls.c (grub_ls_list_files): Use integer calculations diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index b9429372f..8b52e3b17 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -2,7 +2,7 @@ # -*- makefile -*- COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__ -COMMON_CFLAGS = -ffreestanding -msoft-float +COMMON_CFLAGS = -ffreestanding COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 0dcc50234..2c16bc1e3 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -2,7 +2,7 @@ # -*- makefile -*- COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__ -COMMON_CFLAGS = -ffreestanding -msoft-float +COMMON_CFLAGS = -ffreestanding COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. diff --git a/include/grub/powerpc/libgcc.h b/include/grub/powerpc/libgcc.h index 0035b5f54..acdd1467c 100644 --- a/include/grub/powerpc/libgcc.h +++ b/include/grub/powerpc/libgcc.h @@ -17,29 +17,7 @@ */ void EXPORT_FUNC (memset) (void); -void EXPORT_FUNC (__adddf3) (void); -void EXPORT_FUNC (__addsf3) (void); void EXPORT_FUNC (__ashldi3) (void); -void EXPORT_FUNC (__bss_start) (void); -void EXPORT_FUNC (__extendsfdf2) (void); -void EXPORT_FUNC (__fixunsdfsi) (void); -void EXPORT_FUNC (__floatsidf) (void); -void EXPORT_FUNC (__floatsisf) (void); void EXPORT_FUNC (__lshrdi3) (void); -void EXPORT_FUNC (__make_dp) (void); -void EXPORT_FUNC (__make_fp) (void); -void EXPORT_FUNC (__muldf3) (void); -void EXPORT_FUNC (__mulsf3) (void); -void EXPORT_FUNC (__pack_d) (void); -void EXPORT_FUNC (__pack_f) (void); -void EXPORT_FUNC (__subdf3) (void); -void EXPORT_FUNC (__subsf3) (void); -void EXPORT_FUNC (__thenan_df) (void); -void EXPORT_FUNC (__thenan_sf) (void); void EXPORT_FUNC (__trampoline_setup) (void); -void EXPORT_FUNC (__truncdfsf2) (void); void EXPORT_FUNC (__ucmpdi2) (void); -void EXPORT_FUNC (__unpack_d) (void); -void EXPORT_FUNC (__unpack_f) (void); -void EXPORT_FUNC (__floatdisf) (void); -void EXPORT_FUNC (__cmpdi2) (void); From d31a32a14ce781078c8351d2d19d0e8feae6d418 Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 16 Jun 2008 19:02:08 +0000 Subject: [PATCH 0180/1707] 2008-06-16 Bean * fs/ext2.c (grub_ext2_blockgroup): Revert to pre journal state. (grub_ext2_read_block): Likewise. (grub_ext2_read_inode): Likewise. (grub_ext2_mount): Likewise. (grub_ext2_close): Likewise. (grub_ext3_get_journal): Removed. * fs/reiserfs.c (grub_reiserfs_get_item): Revert to pre journal state. (grub_reiserfs_read_symlink): Likewise. (grub_reiserfs_mount): Likewise. (grub_reiserfs_open): Likewise. (grub_reiserfs_read): Likewise. (grub_reiserfs_close): Likewise. (grub_reiserfs_get_journal): Removed. * fs/fshelp.c (grub_fshelp_read): Removed. (grub_fshelp_map_block): Likewise. * include/grub/fshelp.h (grub_fshelp_journal_type): Removed. (grub_fshelp_journal): Likewise. (grub_fshelp_read): Likewise. (grub_fshelp_map_block): Likewise. --- ChangeLog | 25 +++++ fs/ext2.c | 225 ++++++------------------------------------ fs/fshelp.c | 67 ------------- fs/reiserfs.c | 153 +++------------------------- include/grub/fshelp.h | 40 -------- 5 files changed, 67 insertions(+), 443 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3de15425a..ea17524f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2008-06-16 Bean + + * fs/ext2.c (grub_ext2_blockgroup): Revert to pre journal state. + (grub_ext2_read_block): Likewise. + (grub_ext2_read_inode): Likewise. + (grub_ext2_mount): Likewise. + (grub_ext2_close): Likewise. + (grub_ext3_get_journal): Removed. + + * fs/reiserfs.c (grub_reiserfs_get_item): Revert to pre journal state. + (grub_reiserfs_read_symlink): Likewise. + (grub_reiserfs_mount): Likewise. + (grub_reiserfs_open): Likewise. + (grub_reiserfs_read): Likewise. + (grub_reiserfs_close): Likewise. + (grub_reiserfs_get_journal): Removed. + + * fs/fshelp.c (grub_fshelp_read): Removed. + (grub_fshelp_map_block): Likewise. + + * include/grub/fshelp.h (grub_fshelp_journal_type): Removed. + (grub_fshelp_journal): Likewise. + (grub_fshelp_read): Likewise. + (grub_fshelp_map_block): Likewise. + 2008-06-16 Pavel Roskin * conf/powerpc-ieee1275.rmk: Remove -msoft-float, we don't use diff --git a/fs/ext2.c b/fs/ext2.c index 184b973ce..22fd27293 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -241,8 +241,6 @@ struct grub_ext2_data grub_disk_t disk; struct grub_ext2_inode *inode; struct grub_fshelp_node diropen; - struct grub_fshelp_node logfile; - grub_fshelp_journal_t journal; }; #ifndef GRUB_UTIL @@ -257,11 +255,11 @@ inline static grub_err_t grub_ext2_blockgroup (struct grub_ext2_data *data, int group, struct grub_ext2_block_group *blkgrp) { - return grub_fshelp_read (data->disk, data->journal, - grub_le_to_cpu32 (data->sblock.first_data_block) + 1, - group * sizeof (struct grub_ext2_block_group), - sizeof (struct grub_ext2_block_group), - (char *) blkgrp, LOG2_EXT2_BLOCK_SIZE (data)); + return grub_disk_read (data->disk, + ((grub_le_to_cpu32 (data->sblock.first_data_block) + 1) + << LOG2_EXT2_BLOCK_SIZE (data)), + group * sizeof (struct grub_ext2_block_group), + sizeof (struct grub_ext2_block_group), (char *) blkgrp); } @@ -282,9 +280,10 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { grub_uint32_t indir[blksz / 4]; - if (grub_fshelp_read (data->disk, data->journal, - grub_le_to_cpu32 (inode->blocks.indir_block), - 0, blksz, (char *) indir, log2_blksz)) + if (grub_disk_read (data->disk, + grub_le_to_cpu32 (inode->blocks.indir_block) + << log2_blksz, + 0, blksz, (char *) indir)) return grub_errno; blknr = grub_le_to_cpu32 (indir[fileblock - INDIRECT_BLOCKS]); @@ -297,14 +296,16 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + blksz / 4); grub_uint32_t indir[blksz / 4]; - if (grub_fshelp_read (data->disk, data->journal, - grub_le_to_cpu32 (inode->blocks.double_indir_block), - 0, blksz, (char *) indir, log2_blksz)) + if (grub_disk_read (data->disk, + grub_le_to_cpu32 (inode->blocks.double_indir_block) + << log2_blksz, + 0, blksz, (char *) indir)) return grub_errno; - if (grub_fshelp_read (data->disk, data->journal, - grub_le_to_cpu32 (indir[rblock / perblock]), - 0, blksz, (char *) indir, log2_blksz)) + if (grub_disk_read (data->disk, + grub_le_to_cpu32 (indir[rblock / perblock]) + << log2_blksz, + 0, blksz, (char *) indir)) return grub_errno; @@ -318,7 +319,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) blknr = -1; } - return grub_fshelp_map_block (data->journal, blknr); + return blknr; } /* Read LEN bytes from the file described by DATA starting with byte @@ -344,6 +345,8 @@ grub_ext2_read_inode (struct grub_ext2_data *data, { struct grub_ext2_block_group blkgrp; struct grub_ext2_sblock *sblock = &data->sblock; + int inodes_per_block; + unsigned int blkno; unsigned int blkoff; /* It is easier to calculate if the first inode is 0. */ @@ -355,184 +358,23 @@ grub_ext2_read_inode (struct grub_ext2_data *data, if (grub_errno) return grub_errno; - blkoff = ino % grub_le_to_cpu32 (sblock->inodes_per_group); + inodes_per_block = EXT2_BLOCK_SIZE (data) / EXT2_INODE_SIZE (data); + blkno = (ino % grub_le_to_cpu32 (sblock->inodes_per_group)) + / inodes_per_block; + blkoff = (ino % grub_le_to_cpu32 (sblock->inodes_per_group)) + % inodes_per_block; /* Read the inode. */ - if (grub_fshelp_read (data->disk, data->journal, - grub_le_to_cpu32 (blkgrp.inode_table_id), - EXT2_INODE_SIZE (data) * blkoff, - sizeof (struct grub_ext2_inode), (char *) inode, - LOG2_EXT2_BLOCK_SIZE (data))) + if (grub_disk_read (data->disk, + ((grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno) + << LOG2_EXT2_BLOCK_SIZE (data)), + EXT2_INODE_SIZE (data) * blkoff, + sizeof (struct grub_ext2_inode), (char *) inode)) return grub_errno; return 0; } -static void -grub_ext3_get_journal (struct grub_ext2_data *data) -{ - char buf[1 << LOG2_BLOCK_SIZE (data)]; - struct grub_ext3_journal_sblock *jsb; - grub_fshelp_journal_t log; - int last_num, num, block, log2bs; - grub_uint32_t seq; - - auto void next_block (void); - void next_block (void) - { - block++; - if (block >= log->last_block) - block = log->first_block; - } - - data->journal = 0; - - if (! (data->sblock.feature_compatibility & EXT3_FEATURE_COMPAT_HAS_JOURNAL)) - return; - - if (! data->sblock.journal_inum) - return; - - data->logfile.data = data; - data->logfile.ino = data->sblock.journal_inum; - data->logfile.inode_read = 1; - - if (grub_ext2_read_inode (data, data->logfile.ino, &data->logfile.inode)) - return; - - log2bs = LOG2_EXT2_BLOCK_SIZE (data); - if (grub_fshelp_read_file (data->disk, &data->logfile, 0, - 0, sizeof (struct grub_ext3_journal_sblock), - buf, grub_ext2_read_block, - sizeof (buf), log2bs) != - sizeof (struct grub_ext3_journal_sblock)) - return; - - jsb = (struct grub_ext3_journal_sblock *) &buf[0]; - if (grub_be_to_cpu32 (jsb->header.magic) != EXT3_JOURNAL_MAGIC_NUMBER) - return; - - /* Empty journal. */ - if (! jsb->start) - return; - - log = grub_malloc (sizeof (struct grub_fshelp_journal) + - grub_be_to_cpu32 (jsb->maxlen) * sizeof (grub_disk_addr_t)); - if (! log) - return; - - log->type = GRUB_FSHELP_JOURNAL_TYPE_FILE; - log->node = &data->logfile; - log->get_block = grub_ext2_read_block; - log->first_block = grub_be_to_cpu32 (jsb->first); - log->last_block = grub_be_to_cpu32 (jsb->maxlen); - log->start_block = grub_be_to_cpu32 (jsb->start); - - last_num = num = 0; - block = log->start_block; - seq = grub_be_to_cpu32 (jsb->sequence); - - while (1) - { - struct grub_ext3_journal_header *jh; - - grub_fshelp_read_file (data->disk, &data->logfile, 0, - block << (log2bs + 9), sizeof (buf), - buf, grub_ext2_read_block, - log->last_block << (log2bs + 9), - log2bs); - if (grub_errno) - break; - - jh = (struct grub_ext3_journal_header *) &buf[0]; - if (grub_be_to_cpu32 (jh->magic) != EXT3_JOURNAL_MAGIC_NUMBER) - break; - - if (grub_be_to_cpu32 (jh->sequence) != seq) - break; - - log->mapping[num++] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; - next_block(); - - switch (grub_be_to_cpu32 (jh->block_type)) - { - case EXT3_JOURNAL_DESCRIPTOR_BLOCK: - { - struct grub_ext3_journal_block_tag *tag; - int ofs, flags; - - ofs = sizeof (struct grub_ext3_journal_header); - - do - { - tag = (struct grub_ext3_journal_block_tag *) &buf[ofs]; - ofs += sizeof (struct grub_ext3_journal_block_tag); - - if (ofs > (int) sizeof (buf)) - break; - - flags = grub_be_to_cpu32 (tag->flags); - if (! (flags & EXT3_JOURNAL_FLAG_SAME_UUID)) - ofs += 16; - - log->mapping[num++] = grub_be_to_cpu32 (tag->block); - next_block(); - } - while (! (flags & EXT3_JOURNAL_FLAG_LAST_TAG)); - - continue; - } - - case EXT3_JOURNAL_COMMIT_BLOCK: - { - seq++; - last_num = num - 1; - continue; - } - - case EXT3_JOURNAL_REVOKE_BLOCK: - { - struct grub_ext3_journal_revoke_header *jrh; - grub_uint32_t i, cnt; - - jrh = (struct grub_ext3_journal_revoke_header *) jh; - cnt = (grub_be_to_cpu32 (jrh->count) - - sizeof (struct grub_ext3_journal_revoke_header)) >> 2; - - for (i = 0; i < cnt; i++) - { - int j; - grub_uint32_t map; - - map = grub_be_to_cpu32 (jrh->data[i]); - for (j = 0; j < num; j++) - if (log->mapping[j] == map) - log->mapping[j] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; - } - - continue; - } - default: - last_num = 0; - goto quit; - } - } - -quit: - if (! last_num) - grub_free (log); - else - { - int size; - - size = sizeof (struct grub_fshelp_journal) + - last_num * sizeof (grub_disk_addr_t); - - log->num_mappings = last_num; - data->journal = grub_realloc (log, size); - } -} - static struct grub_ext2_data * grub_ext2_mount (grub_disk_t disk) { @@ -553,7 +395,6 @@ grub_ext2_mount (grub_disk_t disk) goto fail; data->disk = disk; - grub_ext3_get_journal (data); data->diropen.data = data; data->diropen.ino = 2; @@ -758,11 +599,7 @@ grub_ext2_open (struct grub_file *file, const char *name) static grub_err_t grub_ext2_close (grub_file_t file) { - if (file->data) - { - grub_free (((struct grub_ext2_data *) file->data)->journal); - grub_free (file->data); - } + grub_free (file->data); #ifndef GRUB_UTIL grub_dl_unref (my_mod); diff --git a/fs/fshelp.c b/fs/fshelp.c index 2fae065c8..df33fa1fa 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -214,46 +214,6 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, return 0; } - -/* Read LEN bytes from the block BLOCK on disk DISK into the buffer BUF, - beginning with the block POS. Apply mappings from LOG. The blocks - have a size of LOG2BLOCKSIZE (in log2). */ -grub_err_t grub_fshelp_read (grub_disk_t disk, grub_fshelp_journal_t log, - grub_disk_addr_t block, grub_off_t pos, - grub_size_t len, char *buf, int log2blocksize) -{ - grub_off_t relblk; - - relblk = pos >> (log2blocksize + GRUB_DISK_SECTOR_BITS); - block += relblk; - pos -= relblk << (log2blocksize + GRUB_DISK_SECTOR_BITS); - - while (len > 0) - { - grub_err_t ret; - grub_size_t size; - - size = (GRUB_DISK_SECTOR_SIZE << log2blocksize) - pos; - if (size > len) - size = len; - - ret = grub_disk_read (disk, - grub_fshelp_map_block (log, block) << log2blocksize, - pos, size, buf); - - if (ret) - return ret; - - block++; - pos = 0; - buf += size; - len -= size; - } - - return 0; -} - - /* Read LEN bytes from the file NODE on disk DISK into the buffer BUF, beginning with the block POS. READ_HOOK should be set before reading a block from the file. GET_BLOCK is used to translate file @@ -350,30 +310,3 @@ grub_fshelp_log2blksize (unsigned int blksize, unsigned int *pow) return GRUB_ERR_NONE; } - -grub_disk_addr_t -grub_fshelp_map_block (grub_fshelp_journal_t log, grub_disk_addr_t block) -{ - int map_block; - - if ((! log) || (! block)) - return block; - - for (map_block = log->num_mappings - 1; map_block >= 0; map_block--) - { - if (log->mapping[map_block] == block) - break; - } - - if (map_block < 0) - return block; - - map_block += log->start_block; - if (map_block >= log->last_block) - map_block -= log->last_block - log->first_block; - - if (log->type == GRUB_FSHELP_JOURNAL_TYPE_BLOCK) - return log->blkno + map_block; - else - return log->get_block (log->node, map_block); -} diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 9a059e3ca..bf20f8736 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -234,7 +234,6 @@ struct grub_reiserfs_data { struct grub_reiserfs_superblock superblock; grub_disk_t disk; - grub_fshelp_journal_t journal; }; /* Internal-only functions. Not to be used outside of this file. */ @@ -511,8 +510,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, do { grub_disk_read (data->disk, - grub_fshelp_map_block (data->journal, block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS), + block_number * (block_size >> GRUB_DISK_SECTOR_BITS), (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), block_size, (char *) block_header); @@ -662,8 +660,7 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) block_size = grub_le_to_cpu16 (node->data->superblock.block_size); len = grub_le_to_cpu16 (found.header.item_size); - block = (grub_fshelp_map_block (node->data->journal, found.block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS)); + block = found.block_number * (block_size >> GRUB_DISK_SECTOR_BITS); offset = grub_le_to_cpu16 (found.header.item_location); symlink_buffer = grub_malloc (len + 1); @@ -682,124 +679,6 @@ grub_reiserfs_read_symlink (grub_fshelp_node_t node) return 0; } -static void -grub_reiserfs_get_journal (struct grub_reiserfs_data *data) -{ - int block_size = grub_le_to_cpu16 (data->superblock.block_size); - char buf[block_size]; - struct grub_reiserfs_journal_header *jh; - grub_fshelp_journal_t log; - grub_uint32_t seq_id, mount_id; - int num_blocks = grub_le_to_cpu32 (data->superblock.journal_original_size); - int base_block = grub_le_to_cpu32 (data->superblock.journal_block); - int last_num, num, block; - - data->journal = 0; - - if (! data->superblock.journal_block) - return; - - if (grub_disk_read (data->disk, - (base_block + num_blocks) - * (block_size >> GRUB_DISK_SECTOR_BITS), - 0, sizeof (struct grub_reiserfs_journal_header), - buf)) - return; - - log = grub_malloc (sizeof (struct grub_fshelp_journal) + - num_blocks * sizeof (grub_disk_addr_t)); - if (! log) - return; - - jh = (struct grub_reiserfs_journal_header *) &buf[0]; - - log->type = GRUB_FSHELP_JOURNAL_TYPE_BLOCK; - log->blkno = base_block; - log->first_block = 0; - log->last_block = num_blocks; - log->start_block = grub_le_to_cpu32 (jh->unflushed_offset); - - seq_id = grub_le_to_cpu32 (jh->last_flush_uid); - mount_id = grub_le_to_cpu32 (jh->mount_id); - - last_num = num = 0; - block = log->start_block; - - while (1) - { - struct grub_reiserfs_description_block *db; - struct grub_reiserfs_commit_block *cb; - grub_uint32_t i, len, half_len, id, mid; - - if (grub_disk_read (data->disk, - (base_block + block) - * (block_size >> GRUB_DISK_SECTOR_BITS), - 0, sizeof (buf), buf)) - break; - - if (grub_memcmp (&buf[block_size - REISERFS_MAGIC_LEN], - REISERFS_MAGIC_DESC_BLOCK, - sizeof (REISERFS_MAGIC_DESC_BLOCK) - 1)) - break; - - db = (struct grub_reiserfs_description_block *) &buf[0]; - id = grub_le_to_cpu32 (db->id); - len = grub_le_to_cpu32 (db->len); - mid = grub_le_to_cpu32 (db->mount_id); - if ((id <= seq_id) && (mid <= mount_id)) - break; - - log->mapping[num++] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; - half_len = ((block_size - 24) >> 2); - if (half_len > len) - half_len = len; - - for (i = 0; i < half_len; i++) - log->mapping[num++] = db->real_blocks[i]; - - block += grub_le_to_cpu32 (db->len) + 1; - if (block >= log->last_block) - block -= log->last_block; - - if (grub_disk_read (data->disk, - (base_block + block) - * (block_size >> GRUB_DISK_SECTOR_BITS), - 0, sizeof (buf), buf)) - break; - - cb = (struct grub_reiserfs_commit_block *) &buf[0]; - if ((grub_le_to_cpu32 (cb->id) != id) || - (grub_le_to_cpu32 (cb->len) != len)) - break; - - for (i = 0; i < len - half_len; i++) - log->mapping[num++] = cb->real_blocks[i]; - - last_num = num; - log->mapping[num++] = GRUB_FSHELP_JOURNAL_UNUSED_MAPPING; - - block++; - if (block >= log->last_block) - block -= log->last_block; - - seq_id = id; - mount_id = mid; - }; - - if (! last_num) - grub_free (log); - else - { - int size; - - size = sizeof (struct grub_fshelp_journal) + - last_num * sizeof (grub_disk_addr_t); - - log->num_mappings = last_num; - data->journal = grub_realloc (log, size); - } -} - /* Fill the mounted filesystem structure and return it. */ static struct grub_reiserfs_data * grub_reiserfs_mount (grub_disk_t disk) @@ -819,7 +698,6 @@ grub_reiserfs_mount (grub_disk_t disk) goto fail; } data->disk = disk; - grub_reiserfs_get_journal (data); return data; fail: @@ -867,8 +745,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, struct grub_reiserfs_item_header *item_headers; grub_disk_read (data->disk, - grub_fshelp_map_block (data->journal, block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS), + block_number * (block_size >> GRUB_DISK_SECTOR_BITS), (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), block_size, (char *) block_header); @@ -962,8 +839,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, { struct grub_reiserfs_stat_item_v1 entry_v1_stat; grub_disk_read (data->disk, - grub_fshelp_map_block (data->journal, entry_block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS), + entry_block_number * (block_size >> GRUB_DISK_SECTOR_BITS), grub_le_to_cpu16 (entry_item->header.item_location), sizeof (entry_v1_stat), (char *) &entry_v1_stat); @@ -1005,8 +881,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, { struct grub_reiserfs_stat_item_v2 entry_v2_stat; grub_disk_read (data->disk, - grub_fshelp_map_block (data->journal, entry_block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS), + entry_block_number * (block_size >> GRUB_DISK_SECTOR_BITS), grub_le_to_cpu16 (entry_item->header.item_location), sizeof (entry_v2_stat), (char *) &entry_v2_stat); @@ -1154,8 +1029,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name) { struct grub_reiserfs_stat_item_v1 entry_v1_stat; grub_disk_read (data->disk, - grub_fshelp_map_block (data->journal, block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS), + block_number * (block_size >> GRUB_DISK_SECTOR_BITS), entry_location + (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), @@ -1168,8 +1042,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name) { struct grub_reiserfs_stat_item_v2 entry_v2_stat; grub_disk_read (data->disk, - grub_fshelp_map_block (data->journal, block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS), + block_number * (block_size >> GRUB_DISK_SECTOR_BITS), entry_location + (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), @@ -1237,8 +1110,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) switch (found.type) { case GRUB_REISERFS_DIRECT: - block = (grub_fshelp_map_block (data->journal, found.block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS)); + block = found.block_number * (block_size >> GRUB_DISK_SECTOR_BITS); grub_dprintf ("reiserfs_blocktype", "D: %u\n", (unsigned) block); if (initial_position < current_position + item_size) { @@ -1270,8 +1142,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) if (! indirect_block_ptr) goto fail; grub_disk_read (found.data->disk, - grub_fshelp_map_block (data->journal, found.block_number) * - (block_size >> GRUB_DISK_SECTOR_BITS), + found.block_number * (block_size >> GRUB_DISK_SECTOR_BITS), grub_le_to_cpu16 (found.header.item_location), item_size, (char *) indirect_block_ptr); if (grub_errno) @@ -1282,9 +1153,8 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) && current_position < final_position; indirect_block++) { - block = (grub_fshelp_map_block (data->journal, - grub_le_to_cpu32 (indirect_block_ptr[indirect_block])) * - (block_size >> GRUB_DISK_SECTOR_BITS)); + block = grub_le_to_cpu32 (indirect_block_ptr[indirect_block]) * + (block_size >> GRUB_DISK_SECTOR_BITS); grub_dprintf ("reiserfs_blocktype", "I: %u\n", (unsigned) block); if (current_position + block_size >= initial_position) { @@ -1383,7 +1253,6 @@ grub_reiserfs_close (grub_file_t file) struct grub_fshelp_node *node = file->data; struct grub_reiserfs_data *data = node->data; - grub_free (data->journal); grub_free (data); grub_free (node); #ifndef GRUB_UTIL diff --git a/include/grub/fshelp.h b/include/grub/fshelp.h index 847f78e36..698c7aae7 100644 --- a/include/grub/fshelp.h +++ b/include/grub/fshelp.h @@ -34,34 +34,6 @@ enum grub_fshelp_filetype GRUB_FSHELP_SYMLINK }; -enum grub_fshelp_journal_type - { - GRUB_FSHELP_JOURNAL_TYPE_BLOCK, - GRUB_FSHELP_JOURNAL_TYPE_FILE - }; - -#define GRUB_FSHELP_JOURNAL_UNUSED_MAPPING (grub_disk_addr_t) -1 - -struct grub_fshelp_journal -{ - int type; - union - { - struct - { - grub_fshelp_node_t node; - grub_disk_addr_t (*get_block) (grub_fshelp_node_t node, grub_disk_addr_t block); - }; - grub_disk_addr_t blkno; - }; - int first_block; - int last_block; - int start_block; - int num_mappings; - grub_disk_addr_t mapping[0]; -}; -typedef struct grub_fshelp_journal *grub_fshelp_journal_t; - /* Lookup the node PATH. The node ROOTNODE describes the root of the directory tree. The node found is returned in FOUNDNODE, which is either a ROOTNODE or a new malloc'ed node. ITERATE_DIR is used to @@ -84,15 +56,6 @@ EXPORT_FUNC(grub_fshelp_find_file) (const char *path, enum grub_fshelp_filetype expect); -/* Read LEN bytes from the block BLOCK on disk DISK into the buffer BUF, - beginning with the block POS. Apply mappings from LOG. The blocks - have a size of LOG2BLOCKSIZE (in log2). */ -grub_err_t -EXPORT_FUNC(grub_fshelp_read) (grub_disk_t disk, grub_fshelp_journal_t log, - grub_disk_addr_t block, grub_off_t pos, - grub_size_t len, char *buf, int log2blocksize); - - /* Read LEN bytes from the file NODE on disk DISK into the buffer BUF, beginning with the block POS. READ_HOOK should be set before reading a block from the file. GET_BLOCK is used to translate file @@ -112,7 +75,4 @@ unsigned int EXPORT_FUNC(grub_fshelp_log2blksize) (unsigned int blksize, unsigned int *pow); -grub_disk_addr_t -EXPORT_FUNC(grub_fshelp_map_block) (grub_fshelp_journal_t log, grub_disk_addr_t block); - #endif /* ! GRUB_FSHELP_HEADER */ From 991477f8a7654285be851d73334b4fb3d7ead75a Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 16 Jun 2008 20:29:55 +0000 Subject: [PATCH 0181/1707] 2008-06-16 Robert Millan * util/update-grub.in: Check for $EUID instead of $UID. Reported by Vincent Zweije. --- ChangeLog | 5 +++++ util/update-grub.in | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ea17524f3..2ef74c20f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-16 Robert Millan + + * util/update-grub.in: Check for $EUID instead of $UID. + Reported by Vincent Zweije. + 2008-06-16 Bean * fs/ext2.c (grub_ext2_blockgroup): Revert to pre journal state. diff --git a/util/update-grub.in b/util/update-grub.in index 84a5e1852..c78444e19 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -68,11 +68,11 @@ done . ${libdir}/grub/update-grub_lib -if [ "x$UID" = "x" ] ; then - UID=`id -u` +if [ "x$EUID" = "x" ] ; then + EUID=`id -u` fi -if [ "$UID" != 0 ] ; then +if [ "$EUID" != 0 ] ; then echo "$0: You must run this as root" >&2 exit 1 fi From 347396d87f1b58744f216c17104b27322fe87777 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 16 Jun 2008 20:45:21 +0000 Subject: [PATCH 0182/1707] 2008-06-16 Robert Millan * util/biosdisk.c (convert_system_partition_to_system_disk): Detect I2O devices. Patch from Sven Mueller . --- ChangeLog | 6 ++++++ util/biosdisk.c | 8 ++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2ef74c20f..685d081dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-16 Robert Millan + + * util/biosdisk.c (convert_system_partition_to_system_disk): Detect + I2O devices. + Patch from Sven Mueller . + 2008-06-16 Robert Millan * util/update-grub.in: Check for $EUID instead of $UID. diff --git a/util/biosdisk.c b/util/biosdisk.c index 90df4f1ef..d78a69f77 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -657,6 +657,14 @@ convert_system_partition_to_system_disk (const char *os_dev) return path; } + /* If this is an I2O disk. */ + if (strncmp ("i2o/hd", p, sizeof ("i2o/hd") - 1) == 0) + { + /* /dev/i2o/hd[a-z]([0-9]+)? */ + p[sizeof ("i2o/hda") - 1] = '\0'; + return path; + } + /* If this is a MultiMediaCard (MMC). */ if (strncmp ("mmcblk", p, sizeof ("mmcblk") - 1) == 0) { From 3cca7ef3b6583eecb0463eeeae79a335863e88dd Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 16 Jun 2008 22:08:03 +0000 Subject: [PATCH 0183/1707] 2008-06-16 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): If we were asked to setup access for the same partition that provides /boot, don't bother using UUIDs since our root already has the value we want. --- ChangeLog | 7 +++++++ util/update-grub_lib.in | 6 ++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 685d081dc..653436fbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-16 Robert Millan + + * util/update-grub_lib.in (prepare_grub_to_access_device): If we were + asked to setup access for the same partition that provides /boot, + don't bother using UUIDs since our root already has the value we + want. + 2008-06-16 Robert Millan * util/biosdisk.c (convert_system_partition_to_system_disk): Detect diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 969ec3011..ac84b0bd3 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -114,6 +114,12 @@ prepare_grub_to_access_device () { device=$1 + # If our target is the same partition that provides /boot, our $root + # is already set to what we want, so no need to bother with UUIDs. + if [ "x${device}" = "x${GRUB_DEVICE_BOOT}" ] ; then + return + fi + # If there's a filesystem UUID that GRUB is capable of identifiing, use it; # otherwise set root as per value in device.map. echo "set root=`${grub_probe} --device ${device} --target=drive`" From 0aac2f79b739673f4550bbdf3e17a7f73e67e7fb Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 17 Jun 2008 13:35:04 +0000 Subject: [PATCH 0184/1707] 2008-06-17 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Use /boot/grub for the check in last commit, not /boot (they could be different partitions). --- ChangeLog | 6 ++++++ util/update-grub_lib.in | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 653436fbe..efef229bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-17 Robert Millan + + * util/update-grub_lib.in (prepare_grub_to_access_device): Use + /boot/grub for the check in last commit, not /boot (they could be + different partitions). + 2008-06-16 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): If we were diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index ac84b0bd3..76b7460a1 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -114,9 +114,9 @@ prepare_grub_to_access_device () { device=$1 - # If our target is the same partition that provides /boot, our $root + # If our target is the same partition that provides /boot/grub, our $root # is already set to what we want, so no need to bother with UUIDs. - if [ "x${device}" = "x${GRUB_DEVICE_BOOT}" ] ; then + if [ "x${device}" = "x`${grub_probe} --target=device /boot/grub`" ] ; then return fi From b23e5644cf47c39812c7206af302b7d6086fb82f Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 17 Jun 2008 15:27:14 +0000 Subject: [PATCH 0185/1707] 2008-06-17 Robert Millan * term/ieee1275/ofconsole.c (fgcolor, bgcolor): Remove variables. (grub_ofconsole_normal_color, grub_ofconsole_highlight_color): New variables. (grub_ofconsole_setcolor, grub_ofconsole_getcolor): Load/store values in grub_ofconsole_normal_color and grub_ofconsole_highlight_color (they're not directly related to background and foreground). (grub_ofconsole_setcolorstate): Extract background and foreground from grub_ofconsole_normal_color and grub_ofconsole_highlight_color. --- ChangeLog | 12 ++++++++++++ term/ieee1275/ofconsole.c | 20 ++++++++++---------- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index efef229bd..0d25eada9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-06-17 Robert Millan + + * term/ieee1275/ofconsole.c (fgcolor, bgcolor): Remove variables. + (grub_ofconsole_normal_color, grub_ofconsole_highlight_color): New + variables. + (grub_ofconsole_setcolor, grub_ofconsole_getcolor): Load/store + values in grub_ofconsole_normal_color and + grub_ofconsole_highlight_color (they're not directly related to + background and foreground). + (grub_ofconsole_setcolorstate): Extract background and foreground + from grub_ofconsole_normal_color and grub_ofconsole_highlight_color. + 2008-06-17 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Use diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index 3b269ce9a..dd60de6f2 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -56,8 +56,8 @@ static struct color colors[8] = { MAX, MAX, MAX} }; -static int fgcolor = 7; -static int bgcolor = 0; +static grub_uint8_t grub_ofconsole_normal_color = 0x7; +static grub_uint8_t grub_ofconsole_highlight_color = 0x70; /* Write control characters to the console. */ static void @@ -109,12 +109,12 @@ grub_ofconsole_setcolorstate (grub_term_color_state state) { case GRUB_TERM_COLOR_STANDARD: case GRUB_TERM_COLOR_NORMAL: - fg = fgcolor; - bg = bgcolor; + fg = grub_ofconsole_normal_color & 0x0f; + bg = grub_ofconsole_normal_color >> 4; break; case GRUB_TERM_COLOR_HIGHLIGHT: - fg = bgcolor; - bg = fgcolor; + fg = grub_ofconsole_highlight_color & 0x0f; + bg = grub_ofconsole_highlight_color >> 4; break; default: return; @@ -128,15 +128,15 @@ static void grub_ofconsole_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color) { - fgcolor = normal_color; - bgcolor = highlight_color; + grub_ofconsole_normal_color = normal_color; + grub_ofconsole_highlight_color = highlight_color; } static void grub_ofconsole_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color) { - *normal_color = fgcolor; - *highlight_color = bgcolor; + *normal_color = grub_ofconsole_normal_color; + *highlight_color = grub_ofconsole_highlight_color; } static int From 7847c51e22fc6d152730a0d92c1a9f18e22f6ef2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 18 Jun 2008 17:35:26 +0000 Subject: [PATCH 0186/1707] 2008-06-18 Robert Millan * util/i386/pc/grub-install.in: If the drive is LVM or RAID, prepend it in prefix. * util/i386/pc/grub-setup.c (main): Don't handle prefix at all. Set `must_embed' to 1 when root_dev is a RAID device. When dest_dev is a RAID device, run setup() for all members independently on whether LVM abstraction is being used. (setup): Don't handle prefix at all; let grub-mkimage take care of it. If grub-mkimage has set `*install_dos_part == -2', don't override this value. Perform *install_dos_part adjustments independently on whether we're embedding or not. Clarify error message when image is too big for embedding. Remove duplicate *install_dos_part stanza. --- ChangeLog | 17 +++++ util/i386/pc/grub-install.in | 10 ++- util/i386/pc/grub-setup.c | 141 ++++++++++++----------------------- 3 files changed, 73 insertions(+), 95 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d25eada9..9bf49bfe8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2008-06-18 Robert Millan + + * util/i386/pc/grub-install.in: If the drive is LVM or RAID, prepend + it in prefix. + + * util/i386/pc/grub-setup.c (main): Don't handle prefix at all. Set + `must_embed' to 1 when root_dev is a RAID device. When dest_dev is + a RAID device, run setup() for all members independently on whether + LVM abstraction is being used. + (setup): Don't handle prefix at all; let grub-mkimage take care of it. + If grub-mkimage has set `*install_dos_part == -2', don't override this + value. + Perform *install_dos_part adjustments independently on whether + we're embedding or not. + Clarify error message when image is too big for embedding. + Remove duplicate *install_dos_part stanza. + 2008-06-17 Robert Millan * term/ieee1275/ofconsole.c (fgcolor, bgcolor): Remove variables. diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index ef87187e8..36e0f887f 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -231,10 +231,18 @@ partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/nul # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` +if [ "x${devabstraction_module}" = "x" ] ; then + prefix_drive= +else + prefix_drive=`$grub_probe --target=drive --device ${grub_device}` +fi + # The order in this list is critical. Be careful when modifiing it. modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module" -$grub_mkimage --output=${grubdir}/core.img --prefix=`make_system_path_relative_to_its_root ${grubdir}`/ $modules || exit 1 +$grub_mkimage --output=${grubdir}/core.img \ + --prefix=${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`/ \ + $modules || exit 1 # Now perform the installation. $grub_setup --directory=${grubdir} --device-map=${device_map} \ diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 343878149..2a3ebd15f 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -87,7 +87,7 @@ grub_refresh (void) } static void -setup (const char *prefix, const char *dir, +setup (const char *dir, const char *boot_file, const char *core_file, const char *root, const char *dest, int must_embed) { @@ -101,7 +101,6 @@ setup (const char *prefix, const char *dir, grub_uint16_t *boot_drive_check; struct boot_blocklist *first_block, *block; grub_int32_t *install_dos_part, *install_bsd_part; - char *install_prefix; char *tmp_img; int i; grub_disk_addr_t first_sector; @@ -234,8 +233,6 @@ setup (const char *prefix, const char *dir, + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART); install_bsd_part = (grub_int32_t *) (core_img + GRUB_DISK_SECTOR_SIZE + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART); - install_prefix = (core_img + GRUB_DISK_SECTOR_SIZE - + GRUB_KERNEL_MACHINE_PREFIX); /* Open the root device and the destination device. */ root_dev = grub_device_open (root); @@ -274,6 +271,40 @@ setup (const char *prefix, const char *dir, if (dest_dev->disk->id & 0x80) /* Replace the jmp (2 bytes) with double nop's. */ *boot_drive_check = 0x9090; + + /* If we hardcoded drive as part of prefix, we don't want to + override the current setting. */ + if (*install_dos_part != -2) + { + /* Embed information about the installed location. */ + if (root_dev->disk->partition) + { + if (strcmp (root_dev->disk->partition->partmap->name, + "pc_partition_map") == 0) + { + struct grub_pc_partition *pcdata = + root_dev->disk->partition->data; + *install_dos_part + = grub_cpu_to_le32 (pcdata->dos_part); + *install_bsd_part + = grub_cpu_to_le32 (pcdata->bsd_part); + } + else if (strcmp (root_dev->disk->partition->partmap->name, + "gpt_partition_map") == 0) + { + *install_dos_part = grub_cpu_to_le32 (root_dev->disk->partition->index); + *install_bsd_part = grub_cpu_to_le32 (-1); + } + else + grub_util_error ("No PC style partitions found"); + } + else + *install_dos_part = *install_bsd_part = grub_cpu_to_le32 (-1); + } + + grub_util_info ("dos partition is %d, bsd partition is %d", + grub_le_to_cpu32 (*install_dos_part), + grub_le_to_cpu32 (*install_bsd_part)); /* If the destination device can have partitions and it is the MBR, try to embed the core image into after the MBR. */ @@ -299,39 +330,6 @@ setup (const char *prefix, const char *dir, block->len = 0; block->segment = 0; - /* Embed information about the installed location. */ - if (must_embed) - *install_dos_part = *install_bsd_part = grub_cpu_to_le32 (-2); - else if (root_dev->disk->partition) - { - if (strcmp (root_dev->disk->partition->partmap->name, - "pc_partition_map") == 0) - { - struct grub_pc_partition *pcdata = - root_dev->disk->partition->data; - *install_dos_part - = grub_cpu_to_le32 (pcdata->dos_part); - *install_bsd_part - = grub_cpu_to_le32 (pcdata->bsd_part); - } - else if (strcmp (root_dev->disk->partition->partmap->name, - "gpt_partition_map") == 0) - { - *install_dos_part = grub_cpu_to_le32 (root_dev->disk->partition->index); - *install_bsd_part = grub_cpu_to_le32 (-1); - } - else - grub_util_error ("No PC style partitions found"); - } - else - *install_dos_part = *install_bsd_part = grub_cpu_to_le32 (-1); - - grub_util_info ("dos partition is %d, bsd partition is %d, prefix is %s", - grub_le_to_cpu32 (*install_dos_part), - grub_le_to_cpu32 (*install_bsd_part), - prefix); - strcpy (install_prefix, prefix); - /* Write the core image onto the disk. */ if (grub_disk_write (dest_dev->disk, embed_region.start, 0, core_size, core_img)) grub_util_error ("%s", grub_errmsg); @@ -362,7 +360,7 @@ setup (const char *prefix, const char *dir, able_to_embed = 0; if (must_embed && ! able_to_embed) - grub_util_error ("Can't embed the core image, but this is required when\n" + grub_util_error ("Core image is too big for embedding, but this is required when\n" "the root device is on a RAID array or LVM volume."); /* The core image must be put on a filesystem unfortunately. */ @@ -370,7 +368,7 @@ setup (const char *prefix, const char *dir, /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); - core_path = grub_util_get_path (prefix, core_file); + core_path = grub_util_get_path (DEFAULT_DIRECTORY "core.img", core_file); /* It is a Good Thing to sync two times. */ sync (); @@ -488,38 +486,6 @@ setup (const char *prefix, const char *dir, the boot device. */ *root_drive = 0xFF; - /* Embed information about the installed location. */ - if (root_dev->disk->partition) - { - struct grub_pc_partition *pcdata = - root_dev->disk->partition->data; - - if (strcmp (root_dev->disk->partition->partmap->name, - "pc_partition_map") == 0) - { - *install_dos_part - = grub_cpu_to_le32 (pcdata->dos_part); - *install_bsd_part - = grub_cpu_to_le32 (pcdata->bsd_part); - } - else if (strcmp (root_dev->disk->partition->partmap->name, - "gpt_partition_map") == 0) - { - *install_dos_part = grub_cpu_to_le32 (root_dev->disk->partition->index); - *install_bsd_part = grub_cpu_to_le32 (-1); - } - else - grub_util_error ("No PC style partitions found"); - } - else - *install_dos_part = *install_bsd_part = grub_cpu_to_le32 (-1); - - grub_util_info ("dos partition is %d, bsd partition is %d, prefix is %s", - grub_le_to_cpu32 (*install_dos_part), - grub_le_to_cpu32 (*install_bsd_part), - prefix); - strcpy (install_prefix, prefix); - /* Write the first two sectors of the core image onto the disk. */ core_path = grub_util_get_path (dir, core_file); grub_util_info ("opening the core image `%s'", core_path); @@ -608,7 +574,6 @@ main (int argc, char *argv[]) char *dir = 0; char *dev_map = 0; char *root_dev = 0; - char *prefix; char *dest_dev; int must_embed = 0; @@ -714,8 +679,6 @@ main (int argc, char *argv[]) /* For simplicity. */ dest_dev = xstrdup (dest_dev); - prefix = grub_get_prefix (dir ? : DEFAULT_DIRECTORY); - if (root_dev) { char *tmp = get_device_name (root_dev); @@ -740,44 +703,35 @@ main (int argc, char *argv[]) #ifdef __linux__ if (grub_util_lvm_isvolume (root_dev)) + must_embed = 1; + + if (root_dev[0] == 'm' && root_dev[1] == 'd' + && root_dev[2] >= '0' && root_dev[2] <= '9') { - char *newprefix; + /* FIXME: we can avoid this on RAID1. */ must_embed = 1; - - newprefix = xmalloc (1 + strlen (root_dev) + 1 + strlen (prefix) + 1); - sprintf (newprefix, "(%s)%s", root_dev, prefix); - free (prefix); - prefix = newprefix; } - else if (dest_dev[0] == 'm' && dest_dev[1] == 'd' - && dest_dev[2] >= '0' && dest_dev[2] <= '9') + + if (dest_dev[0] == 'm' && dest_dev[1] == 'd' + && dest_dev[2] >= '0' && dest_dev[2] <= '9') { char **devicelist; - char *raid_prefix; int i; - raid_prefix = xmalloc (1 + strlen (dest_dev) + 1 + strlen (prefix) + 1); - - sprintf (raid_prefix, "(%s)%s", dest_dev, prefix); - devicelist = grub_util_raid_getmembers (dest_dev); for (i = 0; devicelist[i]; i++) { - setup (raid_prefix, - dir ? : DEFAULT_DIRECTORY, + setup (dir ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, root_dev, grub_util_get_grub_dev (devicelist[i]), 1); } - - free (raid_prefix); } else #endif /* Do the real work. */ - setup (prefix, - dir ? : DEFAULT_DIRECTORY, + setup (dir ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, root_dev, dest_dev, must_embed); @@ -791,7 +745,6 @@ main (int argc, char *argv[]) free (dir); free (dev_map); free (root_dev); - free (prefix); free (dest_dev); return 0; From a145ac2d9ad3e18f505fd59fa5df9d8a5b68da01 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 19 Jun 2008 01:04:59 +0000 Subject: [PATCH 0187/1707] 2008-06-18 Pavel Roskin * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Rename kernel_elf_symlist.c to symlist.c for consistency with other architectures. Update all users. * conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): Likewise. --- .cvsignore | 1 - ChangeLog | 7 +++++++ conf/powerpc-ieee1275.mk | 18 +++++++++--------- conf/powerpc-ieee1275.rmk | 6 +++--- conf/sparc64-ieee1275.mk | 18 +++++++++--------- conf/sparc64-ieee1275.rmk | 6 +++--- 6 files changed, 31 insertions(+), 25 deletions(-) diff --git a/.cvsignore b/.cvsignore index c609cd05a..d6d1b9449 100644 --- a/.cvsignore +++ b/.cvsignore @@ -28,7 +28,6 @@ grub_script.tab.h grub_setup_init.c grub_setup_init.h kernel.elf -kernel_elf_symlist.c mod-*.c stamp-h stamp-h1 diff --git a/ChangeLog b/ChangeLog index 9bf49bfe8..6b75fe01a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-18 Pavel Roskin + + * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Rename + kernel_elf_symlist.c to symlist.c for consistency with other + architectures. Update all users. + * conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): Likewise. + 2008-06-18 Robert Millan * util/i386/pc/grub-install.in: If the drive is LVM or RAID, prepend diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 8b52e3b17..e1d41df89 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -10,7 +10,7 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst +MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ @@ -18,7 +18,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h -kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh @@ -434,12 +434,12 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ - kernel_elf_symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_powerpc_cache.d + symlist.c kern/powerpc/cache.S +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S $(kern/powerpc/ieee1275/crt0.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -533,9 +533,9 @@ kernel_elf-kern_powerpc_dl.o: kern/powerpc/dl.c $(kern/powerpc/dl.c_DEPENDENCIES $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_dl.d -kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c $(kernel_elf_symlist.c_DEPENDENCIES) +kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kernel_elf_symlist.d +-include kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S $(kern/powerpc/cache.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 2c16bc1e3..935b505fc 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -10,7 +10,7 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst +MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ @@ -18,7 +18,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h -kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh @@ -84,7 +84,7 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ - kernel_elf_symlist.c kern/powerpc/cache.S + symlist.c kern/powerpc/cache.S kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index c1ff9cee9..bb7f52c49 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -10,7 +10,7 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst +MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ @@ -18,7 +18,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ symbol.h term.h time.h types.h sparc64/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h -kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For the parser. @@ -72,13 +72,13 @@ kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kern/fs.c kern/err.c kern/misc.c kern/mm.c kern/loader.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ - kern/partition.c kern/env.c kern/sparc64/dl.c kernel_elf_symlist.c \ + kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ kern/sparc64/cache.S kern/parser.c -CLEANFILES += kernel.elf kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o -MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_sparc64_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_sparc64_dl.d kernel_elf-kernel_elf_symlist.d kernel_elf-kern_sparc64_cache.d kernel_elf-kern_parser.d +CLEANFILES += kernel.elf kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o +MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_sparc64_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_sparc64_dl.d kernel_elf-symlist.d kernel_elf-kern_sparc64_cache.d kernel_elf-kern_parser.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o - $(TARGET_CC) -o $@ kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-kernel_elf_symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o + $(TARGET_CC) -o $@ kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c $(kern/sparc64/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -160,9 +160,9 @@ kernel_elf-kern_sparc64_dl.o: kern/sparc64/dl.c $(kern/sparc64/dl.c_DEPENDENCIES $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_sparc64_dl.d -kernel_elf-kernel_elf_symlist.o: kernel_elf_symlist.c $(kernel_elf_symlist.c_DEPENDENCIES) +kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kernel_elf_symlist.d +-include kernel_elf-symlist.d kernel_elf-kern_sparc64_cache.o: kern/sparc64/cache.S $(kern/sparc64/cache.S_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index c6d2ebca7..8083e8c5f 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -10,7 +10,7 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -MOSTLYCLEANFILES += kernel_elf_symlist.c kernel_syms.lst +MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ @@ -18,7 +18,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ symbol.h term.h time.h types.h sparc64/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h -kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # For the parser. @@ -72,7 +72,7 @@ kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kern/fs.c kern/err.c kern/misc.c kern/mm.c kern/loader.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ - kern/partition.c kern/env.c kern/sparc64/dl.c kernel_elf_symlist.c \ + kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ kern/sparc64/cache.S kern/parser.c kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) From 47395a42d7d41b7d9e7b73a7302c042a7d4768a9 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 19 Jun 2008 05:14:16 +0000 Subject: [PATCH 0188/1707] 2008-06-19 Pavel Roskin * conf/i386-efi.rmk: Recompile grub-mkimage.c if Makefile has changed. This is needed in case GRUB_LIBDIR changes. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-linuxbios.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. --- ChangeLog | 9 +++++++++ conf/i386-efi.mk | 1 + conf/i386-efi.rmk | 1 + conf/i386-ieee1275.mk | 1 + conf/i386-ieee1275.rmk | 1 + conf/i386-linuxbios.mk | 1 + conf/i386-linuxbios.rmk | 1 + conf/i386-pc.mk | 1 + conf/i386-pc.rmk | 1 + conf/powerpc-ieee1275.mk | 1 + conf/powerpc-ieee1275.rmk | 1 + 11 files changed, 19 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6b75fe01a..2e1bf307e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-06-19 Pavel Roskin + + * conf/i386-efi.rmk: Recompile grub-mkimage.c if Makefile has + changed. This is needed in case GRUB_LIBDIR changes. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-linuxbios.rmk: Likewise. + * conf/i386-pc.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + 2008-06-18 Pavel Roskin * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Rename diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index b6a9d26f1..4d280451e 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -35,6 +35,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< -include grub_mkimage-util_resolve.d +util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 87626c25e..311b6ab7d 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -17,6 +17,7 @@ sbin_UTILITIES = grub-mkdevicemap # For grub-mkimage. grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ util/resolve.c +util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 667422a86..a51fe14bb 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -178,6 +178,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) -include grub_mkimage-util_resolve.d grub_mkimage_LDFLAGS = $(LIBLZO) +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index ac2f45df4..e4f2a6637 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -50,6 +50,7 @@ endif grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ util/resolve.c grub_mkimage_LDFLAGS = $(LIBLZO) +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 467cc3863..19e5eb671 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -165,6 +165,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) -include grub_mkimage-util_resolve.d grub_mkimage_LDFLAGS = $(LIBLZO) +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ diff --git a/conf/i386-linuxbios.rmk b/conf/i386-linuxbios.rmk index 31f03a9e5..d2546beeb 100644 --- a/conf/i386-linuxbios.rmk +++ b/conf/i386-linuxbios.rmk @@ -49,6 +49,7 @@ endif grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ util/resolve.c grub_mkimage_LDFLAGS = $(LIBLZO) +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 6c0c12f73..37e08bcb6 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -248,6 +248,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) grub_mkimage_LDFLAGS = $(LIBLZO) +util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index a3f8467e9..7b7924fe2 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -76,6 +76,7 @@ grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) grub_mkimage_LDFLAGS = $(LIBLZO) +util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index e1d41df89..748d8fd40 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -55,6 +55,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< -include grub_mkimage-util_resolve.d +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 935b505fc..bb044908e 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -37,6 +37,7 @@ endif # For grub-mkimage. grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ util/resolve.c +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ From 3c62a39d26e236a11a2b2dc6ad313d7dec7a86f2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 19 Jun 2008 12:29:44 +0000 Subject: [PATCH 0189/1707] 2008-06-19 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Issue "insmod" command directly when abstraction modules are needed, instead of reliing on GRUB_PRELOAD_MODULES (which had no effect since it had already been processed). --- ChangeLog | 7 +++++++ util/update-grub_lib.in | 9 ++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e1bf307e..f28519489 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-19 Robert Millan + + * util/update-grub_lib.in (prepare_grub_to_access_device): Issue + "insmod" command directly when abstraction modules are needed, + instead of reliing on GRUB_PRELOAD_MODULES (which had no effect + since it had already been processed). + 2008-06-19 Pavel Roskin * conf/i386-efi.rmk: Recompile grub-mkimage.c if Makefile has diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 76b7460a1..b7d141e4e 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -120,15 +120,18 @@ prepare_grub_to_access_device () return fi + # Abstraction modules aren't auto-loaded. + abstraction="`${grub_probe} --device ${device} --target=abstraction`" + if [ "x${abstraction}" = "x" ] ; then : ; else + echo "insmod ${abstraction}" + fi + # If there's a filesystem UUID that GRUB is capable of identifiing, use it; # otherwise set root as per value in device.map. echo "set root=`${grub_probe} --device ${device} --target=drive`" if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then echo "search --fs-uuid --set ${fs_uuid}" fi - - # Abstraction modules aren't auto-loaded. - GRUB_PRELOAD_MODULES="${GRUB_PRELOAD_MODULES} `${grub_probe} --device ${device} --target=abstraction`" } font_path () From 73940cec5873d1e62e45c2000cf1cdc59a0d5a66 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 19 Jun 2008 12:31:42 +0000 Subject: [PATCH 0190/1707] 2008-06-19 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Remove check for partition that provides /boot/grub. Its logic is flawed, as it prevents prepare_grub_to_access_device() from being called multiple times. --- ChangeLog | 7 +++++++ util/update-grub_lib.in | 6 ------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f28519489..e3ab853dc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-19 Robert Millan + + * util/update-grub_lib.in (prepare_grub_to_access_device): Remove + check for partition that provides /boot/grub. Its logic is flawed, + as it prevents prepare_grub_to_access_device() from being called + multiple times. + 2008-06-19 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Issue diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index b7d141e4e..ed4029a61 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -114,12 +114,6 @@ prepare_grub_to_access_device () { device=$1 - # If our target is the same partition that provides /boot/grub, our $root - # is already set to what we want, so no need to bother with UUIDs. - if [ "x${device}" = "x`${grub_probe} --target=device /boot/grub`" ] ; then - return - fi - # Abstraction modules aren't auto-loaded. abstraction="`${grub_probe} --device ${device} --target=abstraction`" if [ "x${abstraction}" = "x" ] ; then : ; else From 6ce63911ab089ac5f16ea19653b147a34fe94557 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 19 Jun 2008 13:09:16 +0000 Subject: [PATCH 0191/1707] 2008-06-19 Robert Millan * commands/search.c (search_label, search_fs_uuid, search_file): Print search result when not saving to variable, not the other way around. When saving to variable, abort iteration as soon as a match is found. --- ChangeLog | 6 ++++++ commands/search.c | 33 +++++++++++++++++++++------------ 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3ab853dc..28dbecd44 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-19 Robert Millan + + * commands/search.c (search_label, search_fs_uuid, search_file): Print + search result when not saving to variable, not the other way around. + When saving to variable, abort iteration as soon as a match is found. + 2008-06-19 Robert Millan * util/update-grub_lib.in (prepare_grub_to_access_device): Remove diff --git a/commands/search.c b/commands/search.c index 57b03976b..caaee524d 100644 --- a/commands/search.c +++ b/commands/search.c @@ -46,6 +46,7 @@ search_label (const char *key, const char *var) int iterate_device (const char *name) { grub_device_t dev; + int abort = 0; dev = grub_device_open (name); if (dev) @@ -63,12 +64,14 @@ search_label (const char *key, const char *var) if (grub_strcmp (label, key) == 0) { /* Found! */ + count++; if (var) { - grub_printf (" %s", name); - if (count++ == 0) - grub_env_set (var, name); + grub_env_set (var, name); + abort = 1; } + else + grub_printf (" %s", name); } grub_free (label); @@ -79,7 +82,7 @@ search_label (const char *key, const char *var) } grub_errno = GRUB_ERR_NONE; - return 0; + return abort; } grub_device_iterate (iterate_device); @@ -97,6 +100,7 @@ search_fs_uuid (const char *key, const char *var) int iterate_device (const char *name) { grub_device_t dev; + int abort = 0; dev = grub_device_open (name); if (dev) @@ -114,12 +118,14 @@ search_fs_uuid (const char *key, const char *var) if (grub_strcmp (uuid, key) == 0) { /* Found! */ + count++; if (var) { - grub_printf (" %s", name); - if (count++ == 0) - grub_env_set (var, name); + grub_env_set (var, name); + abort = 1; } + else + grub_printf (" %s", name); } grub_free (uuid); @@ -130,7 +136,7 @@ search_fs_uuid (const char *key, const char *var) } grub_errno = GRUB_ERR_NONE; - return 0; + return abort; } grub_device_iterate (iterate_device); @@ -151,6 +157,7 @@ search_file (const char *key, const char *var) grub_size_t len; char *p; grub_file_t file; + int abort = 0; len = grub_strlen (name) + 2 + grub_strlen (key) + 1; p = grub_realloc (buf, len); @@ -164,18 +171,20 @@ search_file (const char *key, const char *var) if (file) { /* Found! */ + count++; if (var) { - grub_printf (" %s", name); - if (count++ == 0) - grub_env_set (var, name); + grub_env_set (var, name); + abort = 1; } + else + grub_printf (" %s", name); grub_file_close (file); } grub_errno = GRUB_ERR_NONE; - return 0; + return abort; } grub_device_iterate (iterate_device); From 650e1c79b929589abe0bc108c85cc5646d14d072 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 19 Jun 2008 20:08:57 +0000 Subject: [PATCH 0192/1707] 2008-06-19 Robert Millan * kern/main.c (grub_main): Export `prefix' variable inmediately after it has been set by grub_machine_set_prefix(). --- ChangeLog | 5 +++++ kern/main.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 28dbecd44..de71948be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-19 Robert Millan + + * kern/main.c (grub_main): Export `prefix' variable inmediately + after it has been set by grub_machine_set_prefix(). + 2008-06-19 Robert Millan * commands/search.c (search_label, search_fs_uuid, search_file): Print diff --git a/kern/main.c b/kern/main.c index 09de03ade..5b59d41f4 100644 --- a/kern/main.c +++ b/kern/main.c @@ -125,6 +125,7 @@ grub_main (void) /* It is better to set the root device as soon as possible, for convenience. */ grub_machine_set_prefix (); + grub_env_export ("prefix"); grub_set_root_dev (); /* Load the normal mode module. */ From 76a2bd44b3e3e6d4d33a8272743f8cc85c48dcb3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 21 Jun 2008 13:51:19 +0000 Subject: [PATCH 0193/1707] 2008-06-21 Robert Millan * util/grub.d/00_header.in: Move last prepare_grub_to_access_device() call from here ... * util/grub.d/10_hurd.in: ... to here ... * util/grub.d/10_linux.in: ... and here. --- ChangeLog | 8 ++++++++ util/grub.d/00_header.in | 3 --- util/grub.d/10_hurd.in | 2 ++ util/grub.d/10_linux.in | 4 ++++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index de71948be..49b3c58d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-06-21 Robert Millan + + * util/grub.d/00_header.in: Move last prepare_grub_to_access_device() + call from here ... + + * util/grub.d/10_hurd.in: ... to here ... + * util/grub.d/10_linux.in: ... and here. + 2008-06-19 Robert Millan * kern/main.c (grub_main): Export `prefix' variable inmediately diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index cabe569c3..bf9507c88 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -62,6 +62,3 @@ EOF echo "terminal ${GRUB_TERMINAL}" ;; esac - -# Set the root device. -prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index 99d57e53b..d437873d2 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -63,6 +63,8 @@ if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else exit 1 fi +prepare_grub_to_access_device ${GRUB_DEVICE} + cat << EOF menuentry "${OS}" { multiboot ${kernel} root=device:${GRUB_DEVICE} diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 1ae1e1e51..6ee705ba0 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -97,6 +97,10 @@ list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` +if [ "x$list" != "x" ] ; then + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} +fi + while [ "x$list" != "x" ] ; do linux=`find_latest $list` echo "Found linux image: $linux" >&2 From 25ff262a6c87c89620949eb5a78d75dae4d5daf9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 21 Jun 2008 14:21:03 +0000 Subject: [PATCH 0194/1707] 2008-06-21 Javier Mart\303\255n * util/i386/pc/grub-setup.c (setup): Remove literal "core.img" in a call to resolve the core image location that effectively appended the name twice. --- ChangeLog | 6 ++++++ util/i386/pc/grub-setup.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 49b3c58d8..7f288a1bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-21 Javier Martín + + * util/i386/pc/grub-setup.c (setup): Remove literal "core.img" in a + call to resolve the core image location that effectively appended the + name twice. + 2008-06-21 Robert Millan * util/grub.d/00_header.in: Move last prepare_grub_to_access_device() diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 2a3ebd15f..043484edb 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -368,7 +368,7 @@ setup (const char *dir, /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); - core_path = grub_util_get_path (DEFAULT_DIRECTORY "core.img", core_file); + core_path = grub_util_get_path (DEFAULT_DIRECTORY, core_file); /* It is a Good Thing to sync two times. */ sync (); From 37aaf354c93a73fe3495cf0292cb37c80f4adf08 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 26 Jun 2008 07:03:26 +0000 Subject: [PATCH 0195/1707] 2008-06-26 Robert Millan * util/grub.d/10_linux.in: Avoid passing UUIDs to Linux when either "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" does not exist, or when a Linux image includes no initrd. --- ChangeLog | 6 ++++++ util/grub.d/10_linux.in | 30 +++++++++++++++++------------- 2 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f288a1bb..d5aa52455 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-26 Robert Millan + + * util/grub.d/10_linux.in: Avoid passing UUIDs to Linux when either + "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" does not exist, or when a + Linux image includes no initrd. + 2008-06-21 Javier Martín * util/i386/pc/grub-setup.c (setup): Remove literal "core.img" in a diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 6ee705ba0..2512bd26e 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -27,17 +27,17 @@ else OS="${GRUB_DISTRIBUTOR} GNU/Linux" fi -if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] ; then - # loop-AES arranges things so that /dev/loop/X can be our root device, but - # the initrds that Linux uses don't like that. - case ${GRUB_DEVICE} in - /dev/loop/*|/dev/loop[0-9]) - LINUX_ROOT_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` - ;; - *) - LINUX_ROOT_DEVICE=${GRUB_DEVICE} - ;; - esac +# loop-AES arranges things so that /dev/loop/X can be our root device, but +# the initrds that Linux uses don't like that. +case ${GRUB_DEVICE} in + /dev/loop/*|/dev/loop[0-9]) + GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; +esac + +if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi @@ -109,6 +109,7 @@ while [ "x$list" != "x" ] ; do rel_dirname=`make_system_path_relative_to_its_root $dirname` version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` alt_version=`echo $version | sed -e "s,\.old$,,g"` + linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" initrd= for i in "initrd.img-${version}" "initrd-${version}.img" \ @@ -120,11 +121,14 @@ while [ "x$list" != "x" ] ; do done if test -n "${initrd}" ; then echo "Found initrd image: ${dirname}/${initrd}" >&2 + else + # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. + linux_root_device_thisversion=${GRUB_DEVICE} fi cat << EOF menuentry "${OS}, linux ${version}" { - linux ${rel_dirname}/${basename} root=${LINUX_ROOT_DEVICE} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} + linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} EOF if test -n "${initrd}" ; then cat << EOF @@ -137,7 +141,7 @@ EOF cat << EOF menuentry "${OS}, linux ${version} (single-user mode)" { - linux ${rel_dirname}/${basename} root=${LINUX_ROOT_DEVICE} ro single ${GRUB_CMDLINE_LINUX} + linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro single ${GRUB_CMDLINE_LINUX} EOF if test -n "${initrd}" ; then cat << EOF From aebe3d13bb9353bc4985f5731769a32f15d8d50a Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 26 Jun 2008 14:26:07 +0000 Subject: [PATCH 0196/1707] 2008-06-26 Robert Millan * disk/fs_uuid.c: New file. * conf/common.rmk (pkglib_MODULES): Add `fs_uuid.mod'. (fs_uuid_mod_SOURCES, fs_uuid_mod_CFLAGS) (fs_uuid_mod_LDFLAGS): New variables. * include/grub/disk.h (grub_disk_dev_id): Add `GRUB_DISK_DEVICE_UUID_ID'. * kern/disk.c (grub_disk_dev_iterate): Allow disk devices not to implement iterate(). --- ChangeLog | 11 ++++ conf/common.mk | 58 ++++++++++++++++++- conf/common.rmk | 7 ++- disk/fs_uuid.c | 137 ++++++++++++++++++++++++++++++++++++++++++++ include/grub/disk.h | 1 + kern/disk.c | 2 +- 6 files changed, 213 insertions(+), 3 deletions(-) create mode 100644 disk/fs_uuid.c diff --git a/ChangeLog b/ChangeLog index d5aa52455..d8a5674ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-06-26 Robert Millan + + * disk/fs_uuid.c: New file. + * conf/common.rmk (pkglib_MODULES): Add `fs_uuid.mod'. + (fs_uuid_mod_SOURCES, fs_uuid_mod_CFLAGS) + (fs_uuid_mod_LDFLAGS): New variables. + * include/grub/disk.h (grub_disk_dev_id): Add + `GRUB_DISK_DEVICE_UUID_ID'. + * kern/disk.c (grub_disk_dev_iterate): Allow disk devices not to + implement iterate(). + 2008-06-26 Robert Millan * util/grub.d/10_linux.in: Avoid passing UUIDs to Linux when either diff --git a/conf/common.mk b/conf/common.mk index 0b8cacf66..9228f1cbf 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1938,7 +1938,7 @@ lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ - loopback.mod configfile.mod echo.mod \ + loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod @@ -2614,6 +2614,62 @@ partmap-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPEND loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For fs_uuid.mod +fs_uuid_mod_SOURCES = disk/fs_uuid.c +CLEANFILES += fs_uuid.mod mod-fs_uuid.o mod-fs_uuid.c pre-fs_uuid.o fs_uuid_mod-disk_fs_uuid.o und-fs_uuid.lst +ifneq ($(fs_uuid_mod_EXPORTS),no) +CLEANFILES += def-fs_uuid.lst +DEFSYMFILES += def-fs_uuid.lst +endif +MOSTLYCLEANFILES += fs_uuid_mod-disk_fs_uuid.d +UNDSYMFILES += und-fs_uuid.lst + +fs_uuid.mod: pre-fs_uuid.o mod-fs_uuid.o + -rm -f $@ + $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-fs_uuid.o: $(fs_uuid_mod_DEPENDENCIES) fs_uuid_mod-disk_fs_uuid.o + -rm -f $@ + $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fs_uuid_mod-disk_fs_uuid.o + +mod-fs_uuid.o: mod-fs_uuid.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -c -o $@ $< + +mod-fs_uuid.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'fs_uuid' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(fs_uuid_mod_EXPORTS),no) +def-fs_uuid.lst: pre-fs_uuid.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fs_uuid/' > $@ +endif + +und-fs_uuid.lst: pre-fs_uuid.o + echo 'fs_uuid' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +fs_uuid_mod-disk_fs_uuid.o: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -MD -c -o $@ $< +-include fs_uuid_mod-disk_fs_uuid.d + +CLEANFILES += cmd-fs_uuid_mod-disk_fs_uuid.lst fs-fs_uuid_mod-disk_fs_uuid.lst partmap-fs_uuid_mod-disk_fs_uuid.lst +COMMANDFILES += cmd-fs_uuid_mod-disk_fs_uuid.lst +FSFILES += fs-fs_uuid_mod-disk_fs_uuid.lst +PARTMAPFILES += partmap-fs_uuid_mod-disk_fs_uuid.lst + +cmd-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fs_uuid > $@ || (rm -f $@; exit 1) + +fs-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fs_uuid > $@ || (rm -f $@; exit 1) + +partmap-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fs_uuid > $@ || (rm -f $@; exit 1) + + +fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS) +fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For configfile.mod configfile_mod_SOURCES = commands/configfile.c CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o und-configfile.lst diff --git a/conf/common.rmk b/conf/common.rmk index acbebc7b7..f34a2bf3b 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -280,7 +280,7 @@ lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ - loopback.mod configfile.mod echo.mod \ + loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod @@ -344,6 +344,11 @@ loopback_mod_SOURCES = disk/loopback.c loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For fs_uuid.mod +fs_uuid_mod_SOURCES = disk/fs_uuid.c +fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS) +fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For configfile.mod configfile_mod_SOURCES = commands/configfile.c configfile_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c new file mode 100644 index 000000000..47eb228c0 --- /dev/null +++ b/disk/fs_uuid.c @@ -0,0 +1,137 @@ +/* fs_uuid.c - Access disks by their filesystem UUID. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#include + +static grub_device_t +search_fs_uuid (const char *key, unsigned long *count) +{ + *count = 0; + grub_device_t ret = NULL; + + auto int iterate_device (const char *name); + int iterate_device (const char *name) + { + grub_device_t dev; + + dev = grub_device_open (name); + if (dev) + { + grub_fs_t fs; + + fs = grub_fs_probe (dev); + if (fs && fs->uuid) + { + char *uuid; + + (fs->uuid) (dev, &uuid); + if (grub_errno == GRUB_ERR_NONE && uuid) + { + *count++; + + if (grub_strcmp (uuid, key) == 0) + { + ret = dev; + grub_free (uuid); + return 1; + } + grub_free (uuid); + } + } + + grub_device_close (dev); + } + + grub_errno = GRUB_ERR_NONE; + return 0; + } + + grub_device_iterate (iterate_device); + + return ret; +} + +static grub_err_t +grub_fs_uuid_open (const char *name, grub_disk_t disk) +{ + grub_device_t dev; + + if (grub_strncmp (name, "UUID=", sizeof ("UUID=")-1)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a UUID virtual volume"); + + dev = search_fs_uuid (name + sizeof ("UUID=") - 1, &disk->id); + if (! dev) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching UUID found"); + + disk->total_sectors = dev->disk->total_sectors; + disk->has_partitions = 0; + disk->partition = dev->disk->partition; + disk->data = dev->disk; + + return GRUB_ERR_NONE; +} + +static void +grub_fs_uuid_close (grub_disk_t disk __attribute((unused))) +{ +} + +static grub_err_t +grub_fs_uuid_read (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + grub_disk_t parent = disk->data; + return parent->dev->read (parent, sector, size, buf); +} + +static grub_err_t +grub_fs_uuid_write (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, const char *buf) +{ + grub_disk_t parent = disk->data; + return parent->dev->write (parent, sector, size, buf); +} + +static struct grub_disk_dev grub_fs_uuid_dev = + { + .name = "fs_uuid", + .id = GRUB_DISK_DEVICE_UUID_ID, + .open = grub_fs_uuid_open, + .close = grub_fs_uuid_close, + .read = grub_fs_uuid_read, + .write = grub_fs_uuid_write, + .next = 0 + }; + +GRUB_MOD_INIT(fs_uuid) +{ + grub_disk_dev_register (&grub_fs_uuid_dev); +} + +GRUB_MOD_FINI(fs_uuid) +{ + grub_disk_dev_unregister (&grub_fs_uuid_dev); +} diff --git a/include/grub/disk.h b/include/grub/disk.h index 3178203c0..0e2789219 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -38,6 +38,7 @@ enum grub_disk_dev_id GRUB_DISK_DEVICE_ATA_ID, GRUB_DISK_DEVICE_MEMDISK_ID, GRUB_DISK_DEVICE_NAND_ID, + GRUB_DISK_DEVICE_UUID_ID, }; struct grub_disk; diff --git a/kern/disk.c b/kern/disk.c index 2bbc8c54a..980b5056a 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -202,7 +202,7 @@ grub_disk_dev_iterate (int (*hook) (const char *name)) grub_disk_dev_t p; for (p = grub_disk_dev_list; p; p = p->next) - if ((p->iterate) (hook)) + if (p->iterate && (p->iterate) (hook)) return 1; return 0; From f19dbdb73fe4ff4a6403ea8b571adbbe85cc085f Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 26 Jun 2008 15:02:58 +0000 Subject: [PATCH 0197/1707] Remove trailing spaces and tabs, replace spaces with tabs when needed --- ChangeLog | 296 +++++++++++++++++++++++++++--------------------------- 1 file changed, 148 insertions(+), 148 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8a5674ea..4031bc224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -385,7 +385,7 @@ 2008-05-30 Robert Millan * fs/ext2.c (grub_ext2_uuid): Use `04x' instead of '02x' as - grub_printf() flags, since we're printing in units of 2 bytes. + grub_printf() flags, since we're printing in units of 2 bytes. 2008-05-30 Robert Millan @@ -699,7 +699,7 @@ and `disk/ieee1275/nand.c'. 2008-04-25 Bean - + * Makefile.in (RMKFILES): Add missing arch i386-ieee1275 and i386-linuxbios. @@ -732,7 +732,7 @@ * include/grub/i386/linux.h (GRUB_LINUX_OFW_SIGNATURE): New macro. (linux_kernel_params): Add new member ofw_signature, ofw_num_items, ofw_cif_handler and ofw_idt, adjust padding number. - + * include/grub/i386/pc/memory.h (grub_upper_mem): Export it if GRUB_MACHINE_IEEE1275 is defined. @@ -748,7 +748,7 @@ * kern/powerpc/ieee1275/openfw.c (grub_available_iterate): Use NESTED_FUNC_ATTR on the hook parameter. Don't quit if no device type property. - + * loader/i386/ieee1275/linux.c: New file. * loader/i386/ieee1275/linux_normal.c: New file. @@ -799,7 +799,7 @@ 2008-04-14 Vesa Jaaskelainen * disk/lvm.c (grub_lvm_scan_device): Add forgotten failure path when - there is no memory left for physical volume name. + there is no memory left for physical volume name. 2008-04-14 Vesa Jaaskelainen @@ -834,7 +834,7 @@ Improve robustness when handling LVM. * disk/lvm.c (grub_lvm_getvalue): Return 0 when `*p' is NULL - (and leave `*p' unmodified). + (and leave `*p' unmodified). (grub_lvm_iterate): Don't assume `vg->lvs != NULL' when iterating through it. (grub_lvm_memberlist): Don't assume `lv->vg->pvs != NULL' when @@ -1131,7 +1131,7 @@ modified. * docs/fdl.texi: New file. - + * docs/mdate-sh: New file. Copied from gnulib. * docs/texinfo.tex: Likewise. @@ -1163,7 +1163,7 @@ (probe): Promote device_name from a variable to an argument. Receive device_name from grub_util_check_block_device() if path is NULL and from grub_guess_root_device() else. Do not free() device_name anymore. - (options): Introduce new parameter '-d, --device'. + (options): Introduce new parameter '-d, --device'. (main): Add description of the new parameter to the help screen. Rename path variable to argument. Set argument_is_device if the '-d' option is given. Pass argument to probe() depending on @@ -1623,7 +1623,7 @@ 2008-02-03 Yoshinori K. Okuji Make grub-setup handle a separate root device. - + * util/i386/pc/grub-setup.c (setup): Always open the root device, so that the root device can be compared with the destination device. @@ -1631,12 +1631,12 @@ are different, set ROOT_DRIVE to ROOT_DEV->DISK->ID. Otherwise, to 0xFF. When not embedding, set ROOT_DRIVE to 0xFF. - + 2008-02-03 Yoshinori K. Okuji Add support for having a grub directory in a different drive. This is still only the data handling part. - + * kern/i386/pc/startup.S (multiboot_trampoline): Set %dh to 0xFF. (codestart): Save %dh in GRUB_ROOT_DRIVE. (grub_root_drive): New variable. @@ -1756,7 +1756,7 @@ (pci_mod_LDFLAGS): Likewise. (lspci_mod_SOURCES): Likewise. (lspci_mod_CFLAGS): Likewise. - (lspci_mod_LDFLAGS): Likewise. + (lspci_mod_LDFLAGS): Likewise. 2008-02-02 Bean @@ -2346,7 +2346,7 @@ (command): Add delimiter at the end of command. (commands): Adjust to match the new command. (commandblock): Remove grub_script_lexer_record_start. - (menuentry): Add grub_script_lexer_record_start, use the new commands. + (menuentry): Add grub_script_lexer_record_start, use the new commands. (if): Use the new commands. * conf/common.rmk (pkgdata_MODULES): Add echo.mod. @@ -2425,7 +2425,7 @@ 2008-01-12 Yoshinori K. Okuji Remove some unused code from reiserfs. - + * fs/reiserfs.c (struct grub_reiserfs_key) [GRUB_REISERFS_KEYV2_BITFIELD]: Removed offset and type. (struct grub_reiserfs_node_body): Removed. @@ -2502,9 +2502,9 @@ (GRUB_REISERFS_KEYV2_BITFIELD): Undefined. Probably it would be better to remove the bitfield version completely. - + 2008-01-06 Yoshinori K. Okuji - + * fs/reiserfs.c (grub_reiserfs_iterate_dir): ENTRY_ITEM must be allocated from the heap, due to the fshelp implementation. (grub_reiserfs_dir): Free NODE, due to the same reason. @@ -2512,9 +2512,9 @@ 2008-01-06 Yoshinori K. Okuji Mostly from Vincent Pelletier: - + * fs/reiserfs.c: New file. - + * conf/common.rmk (pkglib_MODULES): Added reiserfs.mod. (reiserfs_mod_SOURCES): New variable. (reiserfs_mod_CFLAGS): Likewise. @@ -2646,11 +2646,11 @@ 2008-01-01 Vesa Jaaskelainen - * include/grub/video.h: Added grub_video_unmap_color and + * include/grub/video.h: Added grub_video_unmap_color and grub_video_get_active_render_target. (grub_video_adapter): Added unmap_color and get_active_render_target. - * video/video.c: Added grub_video_unmap_color and + * video/video.c: Added grub_video_unmap_color and grub_video_get_active_render_target. (grub_video_get_info): Changed method to accept NULL pointer as an argument to allow detection of active video adapter. @@ -2662,7 +2662,7 @@ (grub_video_vbe_adapter): Added unmap_color and get_active_render_target. - * video/i386/pc/vbeblit.c: Replaced grub_video_vbe_unmap_color usage + * video/i386/pc/vbeblit.c: Replaced grub_video_vbe_unmap_color usage with grub_video_vbe_unmap_color_int. * term/gfxterm.c (DEFAULT_STANDARD_COLOR): Added. @@ -2887,7 +2887,7 @@ (hexdump_mod_SOURCES): New variable. (hexdump_mod_CFLAGS): Likewise. (hexdump_mod_LDFLAGS): Likewise. - + * conf/i386-pc.rmk (grub_emu_SOURCES): Add command/hexdump.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Add command/hexdump.c. @@ -3073,7 +3073,7 @@ * include/grub/disk.h (grub_disk_dev_id): Add `GRUB_DISK_DEV_ATA_ID'. - + 2007-10-31 Robert Millan * include/grub/i386/pc/init.h (grub_lower_mem): Moved from here ... @@ -3317,9 +3317,9 @@ Reported by Hitoshi Ozeki. 2007-09-03 Yoshinori K. Okuji - + Do not use devices at boot in chainloading. - + * loader/i386/pc/chainloader.c (boot_drive): New variable. (boot_part_addr): Likewise. (grub_chainloader_boot): Simply call grub_chainloader_real_boot @@ -3401,7 +3401,7 @@ * conf/powerpc-ieee1275.rmk (grub_probe_SOURCES): Add fs/ntfs.c. (grub_emu_SOURCES): Likewise. - + * conf/misc.c (grub_utf16_to_utf8): Fix unicode conversion bug. * fs/ntfs.c: New file. @@ -3417,7 +3417,7 @@ * util/i386/pc/grub-setup.c (setup): Likewise. (save_first_sector): Likewise. (save_blocklists): Likewise. - + * fs/affs.c (grub_affs_read_file): Likewise. * fs/ext2.c (grub_ext2_read_file): Likewise. @@ -3437,7 +3437,7 @@ * fs/sfs.c (grub_sfs_read_file): Likewise. * fs/ufs.c (grub_ufs_read_file): Likewise. - + * fs/xfs.c (grub_xfs_read_file): Likewise. * command/blocklist.c (read_blocklist): Likewise. @@ -3464,7 +3464,7 @@ 2007-07-24 Jerone Young - * conf/i386-pc.rmk: Add Multiboot loader and multiboot 2 to multiboot + * conf/i386-pc.rmk: Add Multiboot loader and multiboot 2 to multiboot modules for compilation. * conf/powerpc-ieee1275.rmk: Likewise. @@ -3553,7 +3553,7 @@ 2007-07-22 Yoshinori K. Okuji Migrate to GNU General Public License Version 3. - + * COPYING: Replaced with the plain text version of GPLv3. * config.guess: Updated from gnulib. @@ -4017,14 +4017,14 @@ * configure.ac: Only use -fno-stack-protector for the target environment. - + 2007-05-17 Jeroen Dekkers * video/i386/pc/vbe.c (grub_video_vbe_create_render_target): Add __attribute_ ((unused)) to mode_type argument. * util/getroot.c (grub_guess_root_device): Fix #endif. - + * kern/misc.c (memcmp): Fix prototype. * include/grub/partition.h [GRUB_UTIL] @@ -4040,7 +4040,7 @@ * font/manager.c (find_glyph): Make table a const. (grub_font_get_glyph): Remove bitmap from if statement. - + 2007-05-16 Jeroen Dekkers * util/getroot.c (grub_guess_root_device): Remove RAID and LVM @@ -4130,7 +4130,7 @@ 2007-05-09 Robert Millan * util/i386/pc/grub-probe.c (probe): When detecting partition map, - fail gracefully if dev->disk->partition == NULL. + fail gracefully if dev->disk->partition == NULL. 2007-05-07 Robert Millan @@ -4204,7 +4204,7 @@ 2007-04-18 Jerone Young - * kernel/elf.c: Add missing parenthesis for conditional statement + * kernel/elf.c: Add missing parenthesis for conditional statement stanza. 2007-04-10 Jerone Young @@ -4213,7 +4213,7 @@ continue on and look for device node with real device name. 2007-04-10 Jerone Young - + * configure.ac: Add argument for autoconf to use transformation ability. * Makefile.in: Add autoconf package transformation code. @@ -4368,30 +4368,30 @@ * util/i386/pc/grub-mkimage.c (generate_image): Fix the offset of the number of sectors. Reported by Andrey Shuvikov . - + 2006-11-11 Jeroen Dekkers * kern/disk.c (grub_disk_read): When there is a read error, always try to read only the necessary data. - + * conf/i386-pc.rmk (grub_probe_SOURCES): Add disk/lvm.c and disk/raid.c. * include/grub/disk.h [GRUB_UTIL] (grub_raid_init): New prototype. [GRUB_UTIL] (grub_raid_fini): Likewise. [GRUB_UTIL] (grub_lvm_init): Likewise. - [GRUB_UTIL] (grub_lvm_fini): Likewise. + [GRUB_UTIL] (grub_lvm_fini): Likewise. * util/i386/pc/grub-probe.c (probe): Check whether DEVICE_NAME is RAID device and copy DEVICE_NAME to DRIVE_NAME in that case. (main): Call grub_raid_init(), grub_lvm_init(), grub_lvm_fini() and grub_raid_fini(). - + 2006-11-09 Jeroen Dekkers * include/grub/types.h (__unused): Rename to UNUSED. * kern/elf.c (grub_elf32_size): Use UNUSED instead of __unused. (grub_elf64_size): Likewise. - + 2006-11-03 Hollis Blanchard * kern/elf.c (grub_elf_file): Call grub_file_seek. Call @@ -4525,11 +4525,11 @@ 2006-10-14 Jeroen Dekkers Added support for RAID and LVM. - + * disk/lvm.c: New file. * disk/raid.c: Likewise. * include/grub/lvm.h: Likewise. - * include/grub/raid.h: Likewise. + * include/grub/raid.h: Likewise. * include/grub/util/lvm.h: Likewise. * include/grub/util/raid.h: Likewise. * util/lvm.c: Likewise. @@ -4541,7 +4541,7 @@ * kern/disk.c (grub_disk_open): Check whether grub_partition_probe() returns a partition. (grub_disk_get_size): New function. - + * kern/i386/pc/init.c (make_install_device): Copy the prefix verbatim if grub_install_dos_part is -2. @@ -4552,7 +4552,7 @@ MUST_EMBED. Force embedding of GRUB when the argument is true. Close FILE before returning. (main): Add support for RAID and LVM. - + * conf/common.rmk: Add RAID and LVM modules. * conf/i386-pc.rmk (grub_setup_SOURCES): Add util/raid.c and util/lvm.c. @@ -4669,7 +4669,7 @@ * conf/common.mk: Likewise. * conf/powerpc-ieee1275.mk: Likewise. * conf/sparc64-ieee1275.mk: Likewise. - + 2006-09-22 Robert Millan Sync with i386 version. @@ -4706,13 +4706,13 @@ * conf/i386-efi.mk: Likewise. * conf/powerpc-ieee1275.mk: Likewise. * conf/sparc64-ieee1275.mk: Likewise. - + 2006-08-04 Yoshinori K. Okuji Move the prototypes of grub_setjmp and grub_longjmp to cpu/setjmp.h, so that each architecture may specify different attributes. - + * include/grub/i386/setjmp.h (grub_setjmp): New prototype. (grub_longjmp): Likewise. * include/grub/powerpc/setjmp.h (grub_setjmp): Likewise.. @@ -4886,7 +4886,7 @@ * include/grub/kernel.h (struct grub_module_header): Change type of OFFSET to grub_target_off_t and type of SIZE to grub_target_size_t. (grub_module_info): Likewise. - + 2006-06-05 Yoshinori K. Okuji * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): The conditional @@ -4897,7 +4897,7 @@ Count partitions from 1 instead of 0 in the string representation of partitions. Still use 0-based internally. - + * partmap/sun.c (grub_sun_is_valid): A cosmetic change. (sun_partition_map_iterate): Use grub_partition_t instead of struct grub_partition *. Cast DESC->START_CYLINDER to @@ -4944,7 +4944,7 @@ Clean up the code to support 64-bit addressing in disks and files. This change is not enough for filesystems yet. - + * util/i386/pc/grub-setup.c (struct boot_blocklist): Change the type of "start" to grub_uint64_t. (setup): Change the types of KERNEL_SECTOR and FIRST_SECTOR to @@ -5069,7 +5069,7 @@ "write". (struct grub_disk): Change the type of "total_sectors" to grub_uint64_t. Change the type of SECTOR to grub_disk_addr_t in - "read_hook". + "read_hook". (grub_disk_read): Change the types of SECTOR, OFFSET and SIZE to grub_disk_addr_t, grub_off_t and grub_size_t, respectively. (grub_disk_write): Likewise. @@ -5227,13 +5227,13 @@ * util/powerpc/ieee1275/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. - + * util/i386/pc/grub-install.in (host_cpu): Removed. (target_cpu): New variable. (pkglibdir): Use target_cpu instead of host_cpu. * util/genmoddep.c: Removed. - + * kern/efi/mm.c (filter_memory_map): Use GRUB_CPU_SIZEOF_VOID_P instead of GRUB_HOST_SIZEOF_VOID_P. * kern/dl.c: Likewise. @@ -5309,7 +5309,7 @@ (AWK): Likewise. (include): Use target_cpu instead of host_cpu. (moddep.lst:): Use genmoddep.awk instead of genmoddep. - + * DISTLIST: Added genmoddep.awk. Removed util/genmoddep.c. 2006-05-29 Vesa Jaaskelainen @@ -5386,7 +5386,7 @@ * conf/i386-pc.rmk (grub_emu_SOURCES): Added commands/blocklist.c. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. - + * conf/common.rmk (pkgdata_MODULES): Added blocklist.mod. (blocklist_mod_SOURCES): New variable. (blocklist_mod_CFLAGS): Likewise. @@ -5432,7 +5432,7 @@ * include/grub/i386/linux.h (struct linux_kernel_params): New struct. - + 2006-05-09 Vesa Jaaskelainen * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Corrected bounds @@ -5497,7 +5497,7 @@ (platform): New variable. (pkglibdir): Likewise. Use PKGLIBDIR instead of PKGDATADIR. - + * util/i386/pc/grub-install.in (datadir): Removed. (host_vendor): Likewise. (host_os): Likewise. @@ -5531,7 +5531,7 @@ Use the environment context in the menu. Remove the commands "default" and "timeout", and use variables instead. - + * normal/menu.c: Include grub/env.h. (print_entry): Cast TITLE to silence gcc. (get_timeout): New function. @@ -5649,7 +5649,7 @@ Extend the loader so that GRUB can accept a loader which comes back to GRUB when a loaded image exits. Also, this change adds support for a chainloader on EFI. - + * term/efi/console.c: Include grub/misc.h. (grub_console_checkkey): Display a scan code on the top for debugging. This will be removed once the EFI port gets stable. @@ -5879,7 +5879,7 @@ * genkernsyms.sh: Removed. * gensymlist.sh: Likewise. - + * genkernsyms.sh.in: New file. * gensymlist.sh.in: Likewise. @@ -5899,7 +5899,7 @@ initialization can use modules. Also, this change adds an intensive debugging feature for the memory manager via the configure option "--enable-mm-debug". - + * partmap/gpt.c (gpt_partition_map_iterate): Add one more into PART.LEN. @@ -5984,7 +5984,7 @@ Use grub_abort instead of grub_stop, and grub_exit must be define in each architecture now. Also, this change adds support for EFI disks. - + * util/i386/pc/grub-probefs.c: Include grub/term.h. (grub_getkey): New function. (grub_term_get_current): Likewise. @@ -6204,7 +6204,7 @@ 2006-04-20 Yoshinori K. Okuji Add support for pre-loaded modules into the EFI port. - + * util/i386/efi/grub-mkimage.c (make_mods_section): Rewritten completely. Accept one more argument DIR. The caller has changed. @@ -6223,7 +6223,7 @@ (grub_efi_loaded_image_t): New type. 2006-04-20 Yoshinori K. Okuji - + * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Compare the file size with GRUB_OS_AREA_SIZE as grub_size_t instead of grub_ssize_t. Reported by Jeff Chua . @@ -6244,7 +6244,7 @@ * kern/efi/init.c: Likewise. * kern/efi/mm.c: Likewise. * term/efi/console.c: Likewise. - + * kern/i386/efi/init.c: Do not include grub/machine/time.h. (grub_stop): Removed. (grub_get_rtc): Likewise. @@ -6409,7 +6409,7 @@ (grub_script_create_cmdmenu): Likewise. (grub_script_add_cmd): Likewise. (grub_script_parse): Setup the state before calling the parser. - + 2006-04-16 Marco Gerards * normal/command.c (grub_command_init): Remove the title command. @@ -6766,7 +6766,7 @@ 2005-12-25 Marco Gerards Add support for Apple HFS+ filesystems. - + * fs/hfsplus.c: New file. * DISTLIST: Added `fs/hfsplus.c'. @@ -6854,7 +6854,7 @@ * conf/i386-pc.rmk (pkgdata_MODULES): Added play.mod. (play_mod_SOURCES, play_mod_CFLAGS, play_mod_LDFLAGS): New macros. - + 2005-11-27 Marco Gerards * include/grub/dl.h (GRUB_MOD_INIT): Use `__attribute__ @@ -7009,7 +7009,7 @@ * DISTLIST: Added `partmap/acorn.c' and `include/grub/acorn_filecore.h'. - + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `partmap/acorn.c'. (pkgdata_MODULES): Add `acorn.mod'. @@ -7092,7 +7092,7 @@ * term/i386/pc/vga.c (grub_vga_init): Renamed to `grub_vga_mod_init'. Updated all users. (grub_vga_fini): Renamed to `grub_vga_mod_fini'. - + * conf/i386-pc.rmk (grub_emu_SOURCES): Add `grub_emu_init.c'. (grub_modules_init.lst, grub_modules_init.h, grub_emu_init.c): New rules. @@ -7162,7 +7162,7 @@ * normal/script.c: Likewise. * configure.ac: Add `AC_PROG_YACC' test. - + * conf/i386-pc.rmk (grub_emu_SOURCES): Add `commands/test.c', `normal/execute.c', `normal/lexer.c', `grub_script.tab.c', `normal/function.c' and `normal/script.c'. @@ -7178,10 +7178,10 @@ * include/grub/normal.h (grub_test_init): New prototype. (grub_test_fini): Likewise. - + * normal/command.c: Include . (grub_command_execute): Rewritten. - + * util/grub-emu.c (main): Call `grub_test_init' and `grub_test_fini'. @@ -7204,7 +7204,7 @@ `debug' environment variable has been set. 2005-11-02 Hollis Blanchard - + * Makefile.in (install-local): Use $(DATA). (uninstall): Likewise. * conf/powerpc-ieee1275.rmk (bin_UTILITIES): Move grub-mkimage... @@ -7432,7 +7432,7 @@ * genmk.rb (class PModule): Always use `$(#{prefix}_LDFLAGS)' when linking. - + * conf/i386-pc.rmk (COMMON_CFLAGS): Add `-m32'. (COMMON_LDFLAGS): New variable. (kernel_img_LDFLAGS): Include `COMMON_FLAGS'. @@ -7469,7 +7469,7 @@ 2005-09-29 Yoshinori K. Okuji Make GRUB's kernel compliant to Multiboot Specification. - + * kern/i386/pc/startup.S (multiboot_header): New label. (multiboot_entry): Likewise. (multiboot_trampoline): Likewise. @@ -7510,7 +7510,7 @@ * include/grub/fs.h (grub_xfs_init): New prototype. (grub_xfs_fini): Likewise. - + 2005-09-18 Vesa Jaaskelainen * video/i386/pc/vbe.c (grub_vbe_set_video_mode): In indexed @@ -7547,7 +7547,7 @@ * boot/powerpc/ieee1275/cmain.c: Moved to ... * kern/powerpc/ieee1275/cmain.c: ... here. - + * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Use kern/powerpc/ieee1275/crt0.S and kern/powerpc/ieee1275/cmain.c instead of boot/powerpc/ieee1275/crt0.S and @@ -7598,10 +7598,10 @@ io/gzio.c, kern/sparc64/cache.c, kern/sparc64/dl.c, kern/sparc64/ieee1275/init.c, kern/sparc64/ieee1275/openfw.c and util/powerpc/ieee1275/misc.c. - + * include/grub/gzio.h: New file. * io/gzio.c: Likewise. - + * kern/file.c (grub_file_close): Call grub_device_close only if FILE->DEVICE is not NULL. @@ -7622,7 +7622,7 @@ * commands/cat.c: Include grub/gzio.h. (grub_cmd_cat): Use grub_gzfile_open instead of grub_file_open. - + * commands/cmp.c: Include grub/gzio.h. (grub_cmd_cmp): Use grub_gzfile_open instead of grub_file_open. @@ -7703,7 +7703,7 @@ invalid magic in the error. * commands/search.c: New file. - + * util/grub-emu.c (main): Call grub_search_init and grub_search_fini. @@ -7838,7 +7838,7 @@ * normal/misc.c: New file. * DISTLIST: Added normal/misc.c. - + * partmap/amiga.c (amiga_partition_map_iterate): Add an argument DISK to HOOK. Call HOOK with DISK. * partmap/apple.c (apple_partition_map_iterate): Likewise. @@ -7908,11 +7908,11 @@ 2005-08-16 Vesa Jaaskelainen * commands/i386/pc/vbe_list_modes.c: Update source formatting to - follow GCS more precisely. - * commands/i386/pc/vbe_test.c: Likewise. - * include/grub/i386/pc/vbe.h: Likewise. - * term/i386/pc/vesafb.c: Likewise. - * video/i386/pc/vbe.c: Likewise. + follow GCS more precisely. + * commands/i386/pc/vbe_test.c: Likewise. + * include/grub/i386/pc/vbe.h: Likewise. + * term/i386/pc/vesafb.c: Likewise. + * video/i386/pc/vbe.c: Likewise. 2005-08-16 Vesa Jaaskelainen @@ -7984,7 +7984,7 @@ * DISTLIST: Added normal/completion.c. * normal/completion.c: New file. - + * term/i386/pc/console.c (grub_console_getwh): New function. (grub_console_term): Assign grub_console_getwh to getwh. @@ -8155,7 +8155,7 @@ * COPYING: Upgraded to the latest version. Only the address of the FSF office has changed. - + 2005-08-07 Yoshinori K. Okuji * conf/powerpc-ieee1275.rmk (grubof_SOURCES): Replaced @@ -8187,7 +8187,7 @@ * kern/term.c (grub_putcode): Use `grub_getwh' instead of hardcoded value. - + From Vincent Pelletier * include/grub/term.h (GRUB_TERM_WIDTH, GRUB_TERM_HEIGHT): Redefined to use grub_getwh. @@ -8306,7 +8306,7 @@ Change the semantics of variable hooks. They now return strings instead of error values. - + * util/i386/pc/grub-setup.c: Include grub/env.h. (setup): Use grub_device_set_root instead of grub_env_set. @@ -8534,7 +8534,7 @@ (grub_fs_autoload_hook): New prototype. * genfslist.sh: New file. - + * genmk.rb: Added a rule to generate a filesystem list. 2005-06-30 Marco Gerards @@ -8702,7 +8702,7 @@ * DISTLIST: New file. * gendistlist.sh: Likewise. - + * Makefile.in (COMMON_DISTFILES): Removed. (BOOT_DISTFILES): Likewise. (CONF_DISTFILES): Likewise. @@ -8731,7 +8731,7 @@ 2005-03-08 Yoshinori Okuji Automatic loading of commands is supported. - + * normal/main.c (read_command_list): New function. (grub_normal_execute): Call read_command_list. @@ -8763,7 +8763,7 @@ 2005-03-02 Yoshinori K. Okuji * gencmdlist.sh: New file. - + * genmk.rb (PModule::rule): Generate a rule for a command list. Clean command.lst. Generate command.lst from $(COMMANDFILES). @@ -8794,7 +8794,7 @@ * include/grub/normal.h [GRUB_UTIL] (grub_configfile_init): New prototype. [GRUB_UTIL] (grub_configfile_fini): Likewise. - + 2005-02-27 Yoshinori K. Okuji * normal/arg.c (grub_arg_show_help): Do not show the bug report @@ -8808,7 +8808,7 @@ * commands/default.h: New file. * commands/timeout.h: Likewise. * normal/context.c: Likewise. - + * util/misc.c: Do not include sys/times.h. Include sys/time.h and grub/machine/time.h. (grub_get_rtc): Rewritten with gettimeofday. @@ -8895,9 +8895,9 @@ 2005-02-19 Yoshinori K. Okuji This implements an Emacs-like menu entry editor. - + * normal/menu_entry.c: New file. - + * util/console.c (grub_ncurses_putchar): Translate some Unicode characters to ASCII. (saved_char): New variable. @@ -9000,9 +9000,9 @@ * disk/i386/pc/biosdisk.c (grub_biosdisk_fini): New function. * kern/i386/pc/init.c (grub_machine_fini): Likewise. * term/i386/pc/console.c (grub_console_fini): Likewise. - + * util/i386/pc/misc.c: New file. - + * conf/i386-pc.rmk (grub_emu_SOURCES): Added util/i386/pc/misc.c, commands/i386/pc/halt.c and commands/i386/pc/reboot.c. @@ -9037,9 +9037,9 @@ 2005-02-12 Hollis Blanchard * kern/partition.c (grub_partition_probe): Clear `grub_errno' and - return 0 if `grub_errno' is GRUB_ERR_BAD_PART_TABLE. + return 0 if `grub_errno' is GRUB_ERR_BAD_PART_TABLE. (part_map_iterate): Clear `grub_errno' and return 0 if - `partmap->iterate' returns GRUB_ERR_BAD_PART_TABLE. + `partmap->iterate' returns GRUB_ERR_BAD_PART_TABLE. * partmap/amiga.c (amiga_partition_map_iterate): Return GRUB_ERR_BAD_PART_TABLE if no partition map magic is found. * partmap/apple.c (apple_partition_map_iterate): Likewise. @@ -9154,7 +9154,7 @@ Add the loopback device, a device via which files can be accessed as devices. - + * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/loopback.c'. (pkgdata_MODULES): Add loopback.mod. (loopback_mod_SOURCES): New variable. @@ -9186,7 +9186,7 @@ 2005-01-20 Timothy Baldwin * include/grub/dl.h (GRUB_MOD_INIT): Changed `__attribute__ - ((unused))' to `__attribute__ ((used))'. + ((unused))' to `__attribute__ ((used))'. (GRUB_MOD_FINI): Likewise. * kern/dl.c (grub_dl_load_file): Fix null pointer dereference. * genmk.rb (PModule): Assign space to common symbols when linking @@ -9411,12 +9411,12 @@ * normal/cmdline.c (grub_tab_complete): Add a blank line to the output so the output looks better. - + 2004-12-04 Marco Gerards Modulize the partition map support and add support for the amiga partition map. - + * commands/ls.c: Include instead of . * kern/disk.c: Likewise. @@ -9471,7 +9471,7 @@ of a PC partition. 2004-11-17 Hollis Blanchard - + * kern/powerpc/ieee1275/init.c (grub_setjmp): Remove function. (grub_longjmp): Likewise. * include/grub/powerpc/setjmp.h (grub_jmp_buf): Set array size to @@ -9482,7 +9482,7 @@ (grubof_CFLAGS): Add `-DGRUBOF'. * include/grub/setjmp.h [GRUB_UTIL]: Changed condition to [GRUB_UTIL && !GRUBOF]. - + 2004-11-16 Marco Gerards * kern/powerpc/ieee1275/openfw.c (grub_devalias_iterate): Skip any @@ -9527,7 +9527,7 @@ 2004-11-01 Marco Gerards Add support for iso9660 (including rockridge). - + * conf/i386-pc.rmk (grub_emu_SOURCES): Add fs/iso9660.c. (iso9660_mod_SOURCES): New variable. (iso9660_mod_CFLAGS): Likewise. @@ -9538,7 +9538,7 @@ * include/grub/misc.h (grub_strncat): New prototype. * kern/misc.c (grub_strncat): New function. - + * fs/hfs.c (grub_hfs_mount): Translate the error `GRUB_ERR_OUT_OF_RANGE' to `GRUB_ERR_BAD_FS'. * fs/jfs.c (grub_jfs_mount): Likewise. @@ -9590,7 +9590,7 @@ `ide', or `ata'. (grub_ofdisk_open): Remove manual device alias resolution. Fix memory leak when device cannot be opened. - * include/grub/powerpc/ieee1275/ieee1275.h + * include/grub/powerpc/ieee1275/ieee1275.h (grub_children_iterate): New prototype. * kern/powerpc/ieee1275/openfw.c (grub_children_iterate): New function. @@ -9640,7 +9640,7 @@ 2004-09-18 Yoshinori K. Okuji Make the source code of the menu interface more readable. - + * normal/menu.c: Include grub/mm.h. (TERM_WIDTH): New macro. (TERM_HEIGHT): Likewise. @@ -9670,17 +9670,17 @@ Add `linux.mod' and `multiboot.mod' so linux and multiboot kernels can be loaded from normal mode. - + * conf/i386-pc.rmk (pkgdata_MODULES): Add `linux.mod' and `multiboot.mod'. (linux_mod_SOURCES, linux_mod_CFLAGS, multiboot_mod_SOURCES) (multiboot_mod_CFLAGS): New variables. * loader/i386/pc/linux_normal.c: New file. - * loader/i386/pc/multiboot_normal.c: Likewise. - + * loader/i386/pc/multiboot_normal.c: Likewise. + * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Don't use the attribute `unused'. - + * fs/ext2.c (grub_ext2_iterate_dir): Fix typos in inode type. Use `fdiro' to read the mode information from instead of `diro'. @@ -9703,23 +9703,23 @@ `y + 1' instead of `y - 1'. * conf/powerpc-ieee1275.rmk (grubof_LDFLAGS): Add `-N' and `-S'. - + 2004-09-14 Yoshinori K. Okuji From Hollis Blanchard : * kern/misc.c (memmove): New alias for grub_memmove. (memcmp): New alias for grub_memcmp. (memset): New alias for grub_memset. - * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property): + * boot/powerpc/ieee1275/ieee1275.c (grub_ieee1275_get_property): Change "int handle" to "grub_ieee1275_phandle_t handle". - * include/grub/powerpc/ieee1275/ieee1275.h + * include/grub/powerpc/ieee1275/ieee1275.h (grub_ieee1275_get_property): Likewise. - + 2004-09-12 Tomas Ebenlendr Added normal mode command `chainloader' as module chain.mod, which depends on normal.mod and _chain.mod. - + * conf/i386-pc.rmk (pkgdata_MODULES): Add `chain.mod'. (chain_mod_SOURCES, chain_mod_CFLAGS): Variables added. * include/grub/i386/pc/loader.h (grub_rescue_cmd_chainloader): @@ -9813,7 +9813,7 @@ (grub_boot_fini) [GRUB_UTIL]: Likewise. (GRUB_MOD_INIT) [!GRUB_UTIL]: Likewise. (GRUB_MOD_FINI) [!GRUB_UTIL]: Likewise. - + * fs/hfs.c (grub_hfs_find_node): Add a prototype for `node_found'. (grub_hfs_iterate_dir): Make the function static. Add prototypes for `node_found' and `it_dir'. @@ -9825,13 +9825,13 @@ * include/grub/fs.h (grub_hfs_init): New prototype. (grub_hfs_fini): Likewise. - - + + 2004-08-21 Yoshinori K. Okuji Each disk device has its own id now. This is useful to make use of multiple disk devices. - + * include/grub/disk.h (grub_disk_dev_id): New enum. (GRUB_DISK_DEVICE_BIOSDISK_ID): New constant. (GRUB_DISK_DEVICE_OFDISK_ID): Likewise. @@ -9951,7 +9951,7 @@ Add support for UFS version 1 and 2. Add support for the minix filesystem version 1 and 2, both the variants with 14 and 30 long filenames. - + * conf/i386-pc.rmk (grub_setup_SOURCES): Add fs/ufs.c and fs/minix.c. (grub_emu_SOURCES): Likewise. @@ -10007,7 +10007,7 @@ generic ieee1275 functions, console and disk support. This should be easy to port to other architectures with support for Open Firmware. - + * configure.ac: Accept the powerpc as host_cpu. In the case of the powerpc cpu set the host_vendor to ieee1275. Make sure the i386 specific tests are only executed while building for the i386. @@ -10032,7 +10032,7 @@ These files were written by Johan Rydberg (jrydberg@night.trouble.net) and I only modified them slightly. - + * boot/powerpc/ieee1275/cmain.c: New file. * boot/powerpc/ieee1275/crt0.S: Likewise. * boot/powerpc/ieee1275/ieee1275.c: Likewise. @@ -10050,7 +10050,7 @@ * util/i386/pc/pupa-setup.c (usage): Likewise, (main): Call pupa_ext2_init and pupa_ext2_fini. - * fs/fat.c (log2): Renamed to ... + * fs/fat.c (log2): Renamed to ... (fat_log2): ... this. All callers changed. * kern/misc.c (memcpy): Alias to pupa_memmove. @@ -10064,7 +10064,7 @@ (open_device)[!__linux__]: Check if FD < 0 instead of !FD. (pupa_util_biosdisk_get_pupa_dev)[__GNU__]: Change type of N to long int. Use strtol instead of strtoul. - + 2004-03-14 Marco Gerards * commands/boot.c: New file. @@ -10223,7 +10223,7 @@ Now this project is GRUB 2 rather than PUPA. The location of the CVS repository was moved to GRUB's. - + * configure.ac: Use bug-grub as the reporting address. Use GRUB instead of PUPA. Change the version number to 1.90. @@ -10405,7 +10405,7 @@ * normal/normal.c (pupa_normal_init) [PUPA_UTIL]: New function. (pupa_normal_fini) [PUPA_UTIL]: Likewise. * util/console.c: New file. - + * util/i386/pc/getroot.c: New file. * util/i386/pc/pupa-setup.c: Include . (pupa_putchar): New function. @@ -10413,7 +10413,7 @@ (xgetcwd): Function moved to ... (strip_extra_slashes): Likewise. (get_prefix): Likewise. - * util/i386/pc/getroot.c: ... here. + * util/i386/pc/getroot.c: ... here. (find_root_device): Function moved and renamed to... * util/i386/pc/getroot.c (pupa_find_root_device): ... here. Changed all callers. @@ -10492,7 +10492,7 @@ (pupa_strncpy): New function. (pupa_strncmp): Likewise. * fs/ext2.c: New file. - + * kern/disk.c (pupa_disk_read): Set pupa_errno to PUPA_ERR_NONE when the read failed before retrying. * util/i386/pc/biosdisk.c (_LARGEFILE_SOURCE): Removed. @@ -10512,7 +10512,7 @@ buggy. Also, a lot of consideration is required for I18N, UNICODE, and VGA font issues. Therefore, assume that this is such that "better than nothing". - + * font/manager.c: New file. * include/pupa/font.h: Likewise. * include/pupa/i386/pc/vga.h: Likewise. @@ -10529,7 +10529,7 @@ * include/pupa/err.h (PUPA_ERR_BAD_FONT): New constant. * include/pupa/term.h: Include pupa/err.h. - (struct pupa_term): Added init and fini. + (struct pupa_term): Added init and fini. Changed the argument of putchar to pupa_uint32_t. * include/pupa/i386/pc/console.h: Include pupa/symbol.h. @@ -10566,7 +10566,7 @@ (DISP_LR): Likewise. * term/i386/pc/console.c (pupa_console_putchar): New function. - + 2003-02-08 NIIBE Yutaka * util/resolve.c (pupa_util_resolve_dependencies): BUG @@ -10581,7 +10581,7 @@ 2003-01-31 Yoshinori K. Okuji * kern/i386/pc/lzo1x.S: New file. - + * util/i386/pc/pupa-mkimage.c: Include lzo1x.h. (compress_kernel): New variable. (generate_image): Heavily modified to support compressing a @@ -10604,7 +10604,7 @@ * include/pupa/util/misc.h (pupa_util_write_image): Declared. - * include/pupa/i386/pc/kernel.h + * include/pupa/i386/pc/kernel.h (PUPA_KERNEL_MACHINE_COMPRESSED_SIZE): New macro. (PUPA_KERNEL_MACHINE_INSTALL_DOS_PART): Increased by 4. (PUPA_KERNEL_MACHINE_INSTALL_BSD_PART): Likewise. @@ -10628,7 +10628,7 @@ * normal/main.c: Likewise. * normal/menu.c: Likewise. * normal/i386/setjmp.S: Likewise. - + * loader/i386/pc/linux.c (pupa_rescue_cmd_linux): Made global. (pupa_rescue_cmd_initrd): Likewise. @@ -10700,7 +10700,7 @@ * include/pupa/i386/pc/linux.h: New file. * loader/i386/pc/linux.c: Likewise. - + * loader/i386/pc/chainloader.c (pupa_chainloader_boot_sector): Removed. (pupa_chainloader_unload): Return PUPA_ERR_NONE. @@ -10866,7 +10866,7 @@ (pupa_dl_get_prefix): Declared. * fs/fat.c [!PUPA_UTIL] (my_mod): New variable. - (pupa_fat_dir) [!PUPA_UTIL]: Prevent the fat module from being + (pupa_fat_dir) [!PUPA_UTIL]: Prevent the fat module from being unloaded. (pupa_fat_open) [!PUPA_UTIL]: Refer itself if succeeded. (pupa_fat_close) [!PUPA_UTIL]: Unrefer itself. @@ -10911,7 +10911,7 @@ * include/i386/pc/util/biosdisk.h: New file. * util/i386/pc/biosdisk.c: Likewise. * util/i386/pc/pupa-setup.c: Likewise. - + * Makefile.in (INCLUDE_DISTFILES): Added include/pupa/i386/pc/util/biosdisk.h. (UTIL_DISTFILES): Added biosdisk.c and pupa-setup.c under the @@ -10966,7 +10966,7 @@ This means that any missing prototypes could be fatal. Also, you must take care when writing assembly code. See the comments at the beginning of startup.S, for more details. - + * kern/i386/pc/startup.S (pupa_halt): Modified for the new compilation mechanism. (pupa_chainloader_real_boot): Likewise. @@ -10997,7 +10997,7 @@ respectively, before checking endianness and sizes. * Makefile.in (LD): New variable. - + 2002-12-27 Yoshinori K. Okuji * Makefile.in (BUILD_CC): CC -> BUILD_CC. From f527dbc80bebe16a153ad7251de445c406d15df8 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 26 Jun 2008 15:29:32 +0000 Subject: [PATCH 0198/1707] 2008-06-26 Pavel Roskin * util/i386/pc/grub-setup.c (setup): Don't reuse core_path, use core_path_dev for the core.img path on the target device. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 16 +++++++--------- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4031bc224..c9f0bee7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-06-26 Pavel Roskin + + * util/i386/pc/grub-setup.c (setup): Don't reuse core_path, use + core_path_dev for the core.img path on the target device. + 2008-06-26 Robert Millan * disk/fs_uuid.c: New file. diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 043484edb..62c1bf15d 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -91,7 +91,7 @@ setup (const char *dir, const char *boot_file, const char *core_file, const char *root, const char *dest, int must_embed) { - char *boot_path, *core_path; + char *boot_path, *core_path, *core_path_dev; char *boot_img, *core_img; size_t boot_size, core_size; grub_uint16_t core_sectors; @@ -222,7 +222,6 @@ setup (const char *dir, grub_util_error ("The size of `%s' is too large", core_path); core_img = grub_util_read_image (core_path); - free (core_path); /* Have FIRST_BLOCK to point to the first blocklist. */ first_block = (struct boot_blocklist *) (core_img @@ -368,7 +367,7 @@ setup (const char *dir, /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); - core_path = grub_util_get_path (DEFAULT_DIRECTORY, core_file); + core_path_dev = grub_util_get_path (DEFAULT_DIRECTORY, core_file); /* It is a Good Thing to sync two times. */ sync (); @@ -379,11 +378,11 @@ setup (const char *dir, for (i = 0; i < MAX_TRIES; i++) { grub_util_info ("attempting to read the core image `%s' from GRUB%s", - core_path, (i == 0) ? "" : " again"); + core_path_dev, (i == 0) ? "" : " again"); grub_disk_cache_invalidate_all (); - file = grub_file_open (core_path); + file = grub_file_open (core_path_dev); if (file) { if (grub_file_size (file) != core_size) @@ -436,7 +435,7 @@ setup (const char *dir, } if (i == MAX_TRIES) - grub_util_error ("Cannot read `%s' correctly", core_path); + grub_util_error ("Cannot read `%s' correctly", core_path_dev); /* Clean out the blocklists. */ block = first_block; @@ -470,7 +469,7 @@ setup (const char *dir, grub_file_close (file); - free (core_path); + free (core_path_dev); free (tmp_img); *kernel_sector = grub_cpu_to_le64 (first_sector); @@ -487,7 +486,6 @@ setup (const char *dir, *root_drive = 0xFF; /* Write the first two sectors of the core image onto the disk. */ - core_path = grub_util_get_path (dir, core_file); grub_util_info ("opening the core image `%s'", core_path); fp = fopen (core_path, "r+b"); if (! fp) @@ -495,7 +493,6 @@ setup (const char *dir, grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE * 2, fp); fclose (fp); - free (core_path); /* Write the boot image onto the disk. */ if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, boot_img)) @@ -506,6 +503,7 @@ setup (const char *dir, /* Sync is a Good Thing. */ sync (); + free (core_path); free (core_img); free (boot_img); grub_device_close (dest_dev); From 6c2d8df669f74a683f82fe43ab42beb68fc57263 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 26 Jun 2008 16:15:52 +0000 Subject: [PATCH 0199/1707] 2008-06-26 Pavel Roskin * util/biosdisk.c (read_device_map): Don't leave dead map entries for devices failing stat() check. --- ChangeLog | 3 +++ util/biosdisk.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index c9f0bee7c..bbcfb0530 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-06-26 Pavel Roskin + * util/biosdisk.c (read_device_map): Don't leave dead map + entries for devices failing stat() check. + * util/i386/pc/grub-setup.c (setup): Don't reuse core_path, use core_path_dev for the core.img path on the target device. diff --git a/util/biosdisk.c b/util/biosdisk.c index d78a69f77..65e5af0ad 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -532,6 +532,8 @@ read_device_map (const char *dev_map) if (stat (p, &st) == -1) { + free (map[drive].drive); + map[drive].drive = NULL; grub_util_info ("Cannot stat `%s', skipping", p); continue; } From 674835c8301e7825f040e07843374474a52ad5ec Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 29 Jun 2008 14:29:48 +0000 Subject: [PATCH 0200/1707] 2008-06-29 Robert Millan * util/update-grub_lib.in (font_path): Search for fonts in /boot/grub first, which is more likely to be readable (we aren't deciding where fonts live, just looking for them). --- ChangeLog | 6 ++++++ util/update-grub_lib.in | 4 +--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bbcfb0530..e865912f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-29 Robert Millan + + * util/update-grub_lib.in (font_path): Search for fonts in + /boot/grub first, which is more likely to be readable (we aren't + deciding where fonts live, just looking for them). + 2008-06-26 Pavel Roskin * util/biosdisk.c (read_device_map): Don't leave dead map diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index ed4029a61..036a67660 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -130,9 +130,7 @@ prepare_grub_to_access_device () font_path () { - # Prefer system path for space reasons (/boot/grub might be a very small - # partition in case of OpenFirmware, etc). - for dir in ${pkgdatadir} /usr/share/grub /boot/grub ; do + for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do # Prefer complete fonts over incomplete ones. for basename in unicode unifont ascii ; do path="${dir}/${basename}.pff" From 5444088da63599acf8615a37c4ff921bd55f6cdc Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 29 Jun 2008 21:33:38 +0000 Subject: [PATCH 0201/1707] 2008-06-29 Robert Millan * fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro. Maps filesystem block to disk block. (grub_xfs_read_block): Use GRUB_XFS_FSB_TO_BLOCK() on result. Patch from Niels B\303\266hm --- ChangeLog | 7 +++++++ fs/xfs.c | 6 +++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e865912f2..7319a5e31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-06-29 Robert Millan + + * fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro. Maps filesystem + block to disk block. + (grub_xfs_read_block): Use GRUB_XFS_FSB_TO_BLOCK() on result. + Patch from Niels Böhm + 2008-06-29 Robert Millan * util/update-grub_lib.in (font_path): Search for fonts in diff --git a/fs/xfs.c b/fs/xfs.c index 5437678ad..54d8031e0 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -163,6 +163,10 @@ static grub_dl_t my_mod; #define GRUB_XFS_INO_AG(data,ino) \ (grub_be_to_cpu64 (ino) >> GRUB_XFS_INO_AGBITS (data)) +#define GRUB_XFS_FSB_TO_BLOCK(data, fsb) \ + (((fsb) >> (data)->sblock.log2_agblk) * (data)->agsize \ + + ((fsb) & ((1 << (data)->sblock.log2_agblk) - 1))) + #define GRUB_XFS_EXTENT_OFFSET(exts,ex) \ ((grub_be_to_cpu32 (exts[ex][0]) & ~(1 << 31)) << 23 \ | grub_be_to_cpu32 (exts[ex][1]) >> 9) @@ -310,7 +314,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) if (leaf) grub_free (leaf); - return ret; + return GRUB_XFS_FSB_TO_BLOCK(node->data, ret); } From 3aefa8578176c09e40136e2b2b751342747a15be Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 30 Jun 2008 20:44:58 +0000 Subject: [PATCH 0202/1707] 2008-06-30 Pavel Roskin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * util/i386/pc/grub-setup.c (setup): Use core_path_dev, not core_path to calculate the blocklist. Patch from Javier Martín --- ChangeLog | 6 ++++++ util/i386/pc/grub-setup.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7319a5e31..7ff96067b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-06-30 Pavel Roskin + + * util/i386/pc/grub-setup.c (setup): Use core_path_dev, not + core_path to calculate the blocklist. + Patch from Javier Martín + 2008-06-29 Robert Millan * fs/xfs.c (GRUB_XFS_FSB_TO_BLOCK): New macro. Maps filesystem diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 62c1bf15d..a5e3175b0 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -452,7 +452,7 @@ setup (const char *dir, } /* Now read the core image to determine where the sectors are. */ - file = grub_file_open (core_path); + file = grub_file_open (core_path_dev); if (! file) grub_util_error ("%s", grub_errmsg); From 56c7668bae90b7a9e2358e14e49e748b31d0d95a Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 30 Jun 2008 23:52:24 +0000 Subject: [PATCH 0203/1707] 2008-06-30 Pavel Roskin * util/i386/pc/grub-setup.c (setup): Write install_dos_part and install_bsd_part immediately before core.img is embedded or modified on disk. This fixes core.img verification if core.img cannot be embedded. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 27 ++++++++++++++++++--------- 2 files changed, 23 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ff96067b..ab079c8df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-06-30 Pavel Roskin + * util/i386/pc/grub-setup.c (setup): Write install_dos_part and + install_bsd_part immediately before core.img is embedded or + modified on disk. This fixes core.img verification if core.img + cannot be embedded. + * util/i386/pc/grub-setup.c (setup): Use core_path_dev, not core_path to calculate the blocklist. Patch from Javier Martín diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index a5e3175b0..c6f4810e8 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -101,6 +101,7 @@ setup (const char *dir, grub_uint16_t *boot_drive_check; struct boot_blocklist *first_block, *block; grub_int32_t *install_dos_part, *install_bsd_part; + grub_int32_t dos_part, bsd_part; char *tmp_img; int i; grub_disk_addr_t first_sector; @@ -283,27 +284,29 @@ setup (const char *dir, { struct grub_pc_partition *pcdata = root_dev->disk->partition->data; - *install_dos_part - = grub_cpu_to_le32 (pcdata->dos_part); - *install_bsd_part - = grub_cpu_to_le32 (pcdata->bsd_part); + dos_part = pcdata->dos_part; + bsd_part = pcdata->bsd_part; } else if (strcmp (root_dev->disk->partition->partmap->name, "gpt_partition_map") == 0) { - *install_dos_part = grub_cpu_to_le32 (root_dev->disk->partition->index); - *install_bsd_part = grub_cpu_to_le32 (-1); + dos_part = root_dev->disk->partition->index; + bsd_part = -1; } else grub_util_error ("No PC style partitions found"); } else - *install_dos_part = *install_bsd_part = grub_cpu_to_le32 (-1); + dos_part = bsd_part = -1; + } + else + { + dos_part = grub_le_to_cpu32 (*install_dos_part); + bsd_part = grub_le_to_cpu32 (*install_bsd_part); } grub_util_info ("dos partition is %d, bsd partition is %d", - grub_le_to_cpu32 (*install_dos_part), - grub_le_to_cpu32 (*install_bsd_part)); + dos_part, bsd_part); /* If the destination device can have partitions and it is the MBR, try to embed the core image into after the MBR. */ @@ -316,6 +319,9 @@ setup (const char *dir, { grub_util_info ("will embed the core image at sector 0x%llx", embed_region.start); + *install_dos_part = grub_cpu_to_le32 (dos_part); + *install_bsd_part = grub_cpu_to_le32 (bsd_part); + /* The first blocklist contains the whole sectors. */ first_block->start = grub_cpu_to_le64 (embed_region.start + 1); first_block->len = grub_cpu_to_le16 (core_sectors - 1); @@ -485,6 +491,9 @@ setup (const char *dir, the boot device. */ *root_drive = 0xFF; + *install_dos_part = grub_cpu_to_le32 (dos_part); + *install_bsd_part = grub_cpu_to_le32 (bsd_part); + /* Write the first two sectors of the core image onto the disk. */ grub_util_info ("opening the core image `%s'", core_path); fp = fopen (core_path, "r+b"); From 0e9e51ec4fcab669635f35c3b8bc253eead52fd3 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 1 Jul 2008 23:02:16 +0000 Subject: [PATCH 0204/1707] 2008-07-01 Pavel Roskin * disk/raid.c: Cast grub_dprintf() arguments to unsigned long long if the format specifier expects it. * partmap/gpt.c (gpt_partition_map_iterate): Likewise. * partmap/pc.c (pc_partition_map_iterate): Likewise. * fs/ntfs.c (grub_ntfs_uuid): Cast data->uuid to unsigned long long to fix a warning. * fs/reiserfs.c (grub_reiserfs_read): Change casts in grub_dprintf() arguments to fix warnings. --- ChangeLog | 11 +++++++++++ disk/raid.c | 12 ++++++++---- fs/ntfs.c | 2 +- fs/reiserfs.c | 4 ++-- partmap/gpt.c | 5 +++-- partmap/pc.c | 4 +++- 6 files changed, 28 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab079c8df..68867d55b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-07-01 Pavel Roskin + + * disk/raid.c: Cast grub_dprintf() arguments to unsigned long + long if the format specifier expects it. + * partmap/gpt.c (gpt_partition_map_iterate): Likewise. + * partmap/pc.c (pc_partition_map_iterate): Likewise. + * fs/ntfs.c (grub_ntfs_uuid): Cast data->uuid to unsigned long + long to fix a warning. + * fs/reiserfs.c (grub_reiserfs_read): Change casts in + grub_dprintf() arguments to fix warnings. + 2008-06-30 Pavel Roskin * util/i386/pc/grub-setup.c (setup): Write install_dos_part and diff --git a/disk/raid.c b/disk/raid.c index c906edaf2..b8a5e1210 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -106,7 +106,8 @@ grub_raid_open (const char *name, grub_disk_t disk) disk->id = array->number; disk->data = array; - grub_dprintf ("raid", "%s: total_devs=%d, disk_size=%d\n", name, array->total_devs, array->disk_size); + grub_dprintf ("raid", "%s: total_devs=%d, disk_size=%lld\n", name, + array->total_devs, (unsigned long long) array->disk_size); switch (array->level) { @@ -124,7 +125,8 @@ grub_raid_open (const char *name, grub_disk_t disk) break; } - grub_dprintf ("raid", "%s: level=%d, total_sectors=%d\n", name, array->level, disk->total_sectors); + grub_dprintf ("raid", "%s: level=%d, total_sectors=%lld\n", name, + array->level, (unsigned long long) disk->total_sectors); return 0; } @@ -531,7 +533,8 @@ grub_raid_scan_device (const char *name) grub_dprintf ("raid", "Array contains only one disk, but its size (0x%llx) " "doesn't match with size indicated by superblock (0x%llx). " "Assuming superblock is wrong.\n", - array->device[sb.this_disk.number]->total_sectors, array->disk_size); + (unsigned long long) array->device[sb.this_disk.number]->total_sectors, + (unsigned long long) array->disk_size); array->disk_size = array->device[sb.this_disk.number]->total_sectors; } else if (array->level == 1) @@ -540,7 +543,8 @@ grub_raid_scan_device (const char *name) "doesn't match with size indicated by superblock (0x%llx). " "Assuming superblock is wrong.\n", sb.this_disk.number, - array->device[sb.this_disk.number]->total_sectors, array->disk_size); + (unsigned long long) array->device[sb.this_disk.number]->total_sectors, + (unsigned long long) array->disk_size); array->disk_size = array->device[sb.this_disk.number]->total_sectors; } } diff --git a/fs/ntfs.c b/fs/ntfs.c index 5608e4e23..3363eb02b 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -1094,7 +1094,7 @@ grub_ntfs_uuid (grub_device_t device, char **uuid) if (data) { *uuid = grub_malloc (16 + sizeof ('\0')); - grub_sprintf (*uuid, "%016llx", data->uuid); + grub_sprintf (*uuid, "%016llx", (unsigned long long) data->uuid); } else *uuid = NULL; diff --git a/fs/reiserfs.c b/fs/reiserfs.c index bf20f8736..ea6e5e39b 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -1120,7 +1120,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) grub_dprintf ("reiserfs", "Reading direct block %u from %u to %u...\n", (unsigned) block, (unsigned) offset, - (unsigned) offset + length); + (unsigned) (offset + length)); found.data->disk->read_hook = file->read_hook; grub_disk_read (found.data->disk, block, @@ -1165,7 +1165,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) grub_dprintf ("reiserfs", "Reading indirect block %u from %u to %u...\n", (unsigned) block, (unsigned) offset, - (unsigned) offset + length); + (unsigned) (offset + length)); #if 0 grub_dprintf ("reiserfs", "\nib=%04d/%04d, ip=%d, cp=%d, fp=%d, off=%d, l=%d, tl=%d\n", diff --git a/partmap/gpt.c b/partmap/gpt.c index 36eaef21c..ddfde2ec9 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -98,8 +98,9 @@ gpt_partition_map_iterate (grub_disk_t disk, part.partmap = &grub_gpt_partition_map; part.data = &entry; - grub_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n", - i, part.start, part.len); + grub_dprintf ("gpt", "GPT entry %d: start=%lld, length=%lld\n", i, + (unsigned long long) part.start, + (unsigned long long) part.len); if (hook (disk, &part)) return grub_errno; diff --git a/partmap/pc.c b/partmap/pc.c index f9268a75d..2fba45dbb 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -138,7 +138,9 @@ pc_partition_map_iterate (grub_disk_t disk, grub_dprintf ("partition", "partition %d: flag 0x%x, type 0x%x, start 0x%llx, len 0x%llx\n", - p.index, e->flag, pcdata.dos_type, p.start, p.len); + p.index, e->flag, pcdata.dos_type, + (unsigned long long) p.start, + (unsigned long long) p.len); /* If this is a GPT partition, this MBR is just a dummy. */ if (e->type == GRUB_PC_PARTITION_TYPE_GPT_DISK && p.index == 0) From f341f6692cea00cba17589a677b4a8369b14e7d7 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 1 Jul 2008 23:18:25 +0000 Subject: [PATCH 0205/1707] 2008-07-01 Pavel Roskin * fs/fat.c: Fix UUID calculation on big-endian systems. We write uuid as a 32-bit value in CPU byte order, so declare and use it as such. --- ChangeLog | 4 ++++ fs/fat.c | 9 +++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68867d55b..d7a858474 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-01 Pavel Roskin + * fs/fat.c: Fix UUID calculation on big-endian systems. We + write uuid as a 32-bit value in CPU byte order, so declare and + use it as such. + * disk/raid.c: Cast grub_dprintf() arguments to unsigned long long if the format specifier expects it. * partmap/gpt.c (gpt_partition_map_iterate): Likewise. diff --git a/fs/fat.c b/fs/fat.c index 4d04aeca3..63979b4b4 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -143,7 +143,7 @@ struct grub_fat_data grub_uint32_t cur_cluster_num; grub_uint32_t cur_cluster; - grub_uint16_t uuid[2]; + grub_uint32_t uuid; }; #ifndef GRUB_UTIL @@ -311,9 +311,9 @@ grub_fat_mount (grub_disk_t disk) /* Serial number. */ if (bpb.sectors_per_fat_16) - *((grub_uint32_t *) &data->uuid) = grub_le_to_cpu32 (bpb.version_specific.fat12_or_fat16.num_serial); + data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat12_or_fat16.num_serial); else - *((grub_uint32_t *) &data->uuid) = grub_le_to_cpu32 (bpb.version_specific.fat32.num_serial); + data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat32.num_serial); /* Ignore the 3rd bit, because some BIOSes assigns 0xF0 to the media descriptor, even if it is a so-called superfloppy (e.g. an USB key). @@ -839,7 +839,8 @@ grub_fat_uuid (grub_device_t device, char **uuid) if (data) { *uuid = grub_malloc (sizeof ("xxxx-xxxx")); - grub_sprintf (*uuid, "%04x-%04x", data->uuid[1], data->uuid[0]); + grub_sprintf (*uuid, "%04x-%04x", (grub_uint16_t) (data->uuid >> 8), + (grub_uint16_t) data->uuid); } else *uuid = NULL; From 29d7e38ad827093dfde85937ab82b40309808447 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 1 Jul 2008 23:33:49 +0000 Subject: [PATCH 0206/1707] 2008-07-01 Pavel Roskin * fs/afs.c (grub_afs_read_block): Return grub_disk_addr_t, as grub_fshelp_read_file() expects. --- ChangeLog | 3 +++ fs/afs.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d7a858474..9d373d72f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-01 Pavel Roskin + * fs/afs.c (grub_afs_read_block): Return grub_disk_addr_t, as + grub_fshelp_read_file() expects. + * fs/fat.c: Fix UUID calculation on big-endian systems. We write uuid as a 32-bit value in CPU byte order, so declare and use it as such. diff --git a/fs/afs.c b/fs/afs.c index 5b5eb689d..3f7efa767 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -198,7 +198,7 @@ grub_afs_read_inode (struct grub_afs_data *data, (char *) inode); } -static int +static grub_disk_addr_t grub_afs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_afs_sblock *sb = &node->data->sblock; From b8789f6c20442299088a4644d2e86154da487c7d Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 00:37:48 +0000 Subject: [PATCH 0207/1707] 2008-07-01 Pavel Roskin * loader/i386/pc/multiboot2.c (grub_mb2_arch_module_alloc): Use cast to suppress a warning. --- ChangeLog | 3 +++ loader/i386/pc/multiboot2.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9d373d72f..b75ef86df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-01 Pavel Roskin + * loader/i386/pc/multiboot2.c (grub_mb2_arch_module_alloc): Use + cast to suppress a warning. + * fs/afs.c (grub_afs_read_block): Return grub_disk_addr_t, as grub_fshelp_read_file() expects. diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c index 58afa2399..49917ada8 100644 --- a/loader/i386/pc/multiboot2.c +++ b/loader/i386/pc/multiboot2.c @@ -55,7 +55,7 @@ grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr) { grub_addr_t modaddr; - modaddr = grub_memalign (MULTIBOOT2_MOD_ALIGN, size); + modaddr = (grub_addr_t) grub_memalign (MULTIBOOT2_MOD_ALIGN, size); if (! modaddr) return grub_errno; From 10b159d1b2bf040549243c9417b29607346842af Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 00:39:55 +0000 Subject: [PATCH 0208/1707] 2008-07-01 Pavel Roskin * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Remove useless cast to fix a warning. --- ChangeLog | 3 +++ loader/i386/pc/linux.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b75ef86df..65f37e7e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-01 Pavel Roskin + * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Remove useless + cast to fix a warning. + * loader/i386/pc/multiboot2.c (grub_mb2_arch_module_alloc): Use cast to suppress a warning. diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index 0b0c26ccf..aaa413411 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -146,8 +146,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_linux_tmp_addr = (char *) GRUB_LINUX_BZIMAGE_ADDR + prot_size; if (! grub_linux_is_bzimage - && ((char *) GRUB_LINUX_ZIMAGE_ADDR + prot_size - > (grub_size_t) grub_linux_real_addr)) + && ((char *) GRUB_LINUX_ZIMAGE_ADDR + prot_size > grub_linux_real_addr)) { grub_error (GRUB_ERR_BAD_OS, "too big zImage (0x%x > 0x%x), use bzImage instead", (char *) GRUB_LINUX_ZIMAGE_ADDR + prot_size, From 6a42d99dd594914c9fabb50c680fe5d890cdca43 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 00:54:18 +0000 Subject: [PATCH 0209/1707] 2008-07-01 Pavel Roskin * term/tparm.c (analyze): Always set *popcount. --- ChangeLog | 2 ++ term/tparm.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 65f37e7e8..4aa1a239f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-07-01 Pavel Roskin + * term/tparm.c (analyze): Always set *popcount. + * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Remove useless cast to fix a warning. diff --git a/term/tparm.c b/term/tparm.c index 55955b639..e76cbe723 100644 --- a/term/tparm.c +++ b/term/tparm.c @@ -361,6 +361,8 @@ analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) const char *cp = string; static char dummy[] = ""; + *popcount = 0; + if (cp == 0) return 0; @@ -371,7 +373,6 @@ analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) } grub_memset(p_is_s, 0, sizeof(p_is_s[0]) * NUM_PARM); - *popcount = 0; while ((cp - string) < (int) len2) { if (*cp == '%') { From 8222a04b6f2c8c4fe7200bcf0c8f4bb5c49207fe Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 01:00:37 +0000 Subject: [PATCH 0210/1707] 2008-07-01 Pavel Roskin * normal/parser.y: Define YYENABLE_NLS as 0 to fix warnings. --- ChangeLog | 2 ++ normal/parser.y | 1 + 2 files changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4aa1a239f..a9feb9ae4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-07-01 Pavel Roskin + * normal/parser.y: Define YYENABLE_NLS as 0 to fix warnings. + * term/tparm.c (analyze): Always set *popcount. * loader/i386/pc/linux.c (grub_rescue_cmd_linux): Remove useless diff --git a/normal/parser.y b/normal/parser.y index ad0b5f756..4afd0c729 100644 --- a/normal/parser.y +++ b/normal/parser.y @@ -24,6 +24,7 @@ #define YYFREE grub_free #define YYMALLOC grub_malloc #define YYLTYPE_IS_TRIVIAL 0 +#define YYENABLE_NLS 0 %} From bf1835b13c9465de615b62f3ba5266d9d964cd55 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 01:07:37 +0000 Subject: [PATCH 0211/1707] 2008-07-01 Pavel Roskin * disk/fs_uuid.c (search_fs_uuid): Correctly increment count. --- ChangeLog | 2 ++ disk/fs_uuid.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a9feb9ae4..cf0ddefa4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-07-01 Pavel Roskin + * disk/fs_uuid.c (search_fs_uuid): Correctly increment count. + * normal/parser.y: Define YYENABLE_NLS as 0 to fix warnings. * term/tparm.c (analyze): Always set *popcount. diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c index 47eb228c0..27dffc2f6 100644 --- a/disk/fs_uuid.c +++ b/disk/fs_uuid.c @@ -50,7 +50,7 @@ search_fs_uuid (const char *key, unsigned long *count) (fs->uuid) (dev, &uuid); if (grub_errno == GRUB_ERR_NONE && uuid) { - *count++; + (*count)++; if (grub_strcmp (uuid, key) == 0) { From d89b76343e95ea7f444ddd22dfc291238d9361f0 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 01:17:43 +0000 Subject: [PATCH 0212/1707] 2008-07-01 Pavel Roskin * include/multiboot2.h (struct multiboot_tag_module): Use char, not unsigned char. This fixes warnings and is consistent with other tags. --- ChangeLog | 4 ++++ include/multiboot2.h | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cf0ddefa4..a27213f08 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-01 Pavel Roskin + * include/multiboot2.h (struct multiboot_tag_module): Use char, + not unsigned char. This fixes warnings and is consistent with + other tags. + * disk/fs_uuid.c (search_fs_uuid): Correctly increment count. * normal/parser.y: Define YYENABLE_NLS as 0 to fix warnings. diff --git a/include/multiboot2.h b/include/multiboot2.h index 7124ced46..f720dc3ea 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -77,8 +77,8 @@ struct multiboot_tag_module struct multiboot_tag_header header; multiboot_word addr; multiboot_word size; - unsigned char type[36]; - unsigned char cmdline[1]; + char type[36]; + char cmdline[1]; }; #define MULTIBOOT2_TAG_MEMORY 4 From 2270f77beaa9fc19ae267018f0a3006946f0a72b Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 2 Jul 2008 07:20:11 +0000 Subject: [PATCH 0213/1707] 2008-07-02 Bean * conf/common.rmk (bin_UTILITIES): Add grub-editenv. (grub_editenv_SOURCES): New variable. (pkglib_MODULES): Add loadenv.mod. (loadenv_mod_SOURCES): New variable. (loadenv_mod_CFLAGS): Likewise. (loadenv_mod_LDFLAGS): Likewise. * include/grub/envblk.h: New file. * util/envblk.c: New file. * util/grub-editenv.c: New file. * commands/loadenv.c: New file. --- ChangeLog | 17 +++ commands/loadenv.c | 257 ++++++++++++++++++++++++++++++++ conf/common.mk | 332 ++++++++++++++++++++++++++++-------------- conf/common.rmk | 32 ++-- include/grub/envblk.h | 45 ++++++ util/envblk.c | 156 ++++++++++++++++++++ util/grub-editenv.c | 258 ++++++++++++++++++++++++++++++++ 7 files changed, 973 insertions(+), 124 deletions(-) create mode 100644 commands/loadenv.c create mode 100644 include/grub/envblk.h create mode 100644 util/envblk.c create mode 100644 util/grub-editenv.c diff --git a/ChangeLog b/ChangeLog index a27213f08..f27f59b6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2008-07-02 Bean + + * conf/common.rmk (bin_UTILITIES): Add grub-editenv. + (grub_editenv_SOURCES): New variable. + (pkglib_MODULES): Add loadenv.mod. + (loadenv_mod_SOURCES): New variable. + (loadenv_mod_CFLAGS): Likewise. + (loadenv_mod_LDFLAGS): Likewise. + + * include/grub/envblk.h: New file. + + * util/envblk.c: New file. + + * util/grub-editenv.c: New file. + + * commands/loadenv.c: New file. + 2008-07-01 Pavel Roskin * include/multiboot2.h (struct multiboot_tag_module): Use char, diff --git a/commands/loadenv.c b/commands/loadenv.c new file mode 100644 index 000000000..735968318 --- /dev/null +++ b/commands/loadenv.c @@ -0,0 +1,257 @@ +/* loadenv.c - command to load/save environment variable. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct grub_arg_option options[] = + { + {"file", 'f', 0, "specify filename", 0, ARG_TYPE_PATHNAME}, + {0, 0, 0, 0, 0, 0} + }; + +char buffer[GRUB_ENVBLK_MAXLEN]; +grub_envblk_t envblk; + +static grub_file_t +read_envblk_file (char *filename, void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector, unsigned offset, unsigned length)) +{ + char *buf = 0; + grub_file_t file; + + if (! filename) + { + char *prefix; + + prefix = grub_env_get ("prefix"); + if (prefix) + { + int len; + + len = grub_strlen (prefix); + buf = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG)); + grub_strcpy (buf, prefix); + buf[len] = '/'; + grub_strcpy (buf + len + 1, GRUB_ENVBLK_DEFCFG); + filename = buf; + } + else + { + grub_error (GRUB_ERR_FILE_NOT_FOUND, "prefix is not found"); + return 0; + } + } + + file = grub_file_open (filename); + grub_free (buf); + if (! file) + return 0; + + if (read_hook) + { + if (! file->device->disk) + { + grub_file_close (file); + grub_error (GRUB_ERR_BAD_DEVICE, + "this command is available only for disk devices."); + return 0; + } + file->read_hook = read_hook; + } + + if (grub_file_read (file, buffer, GRUB_ENVBLK_MAXLEN) != GRUB_ENVBLK_MAXLEN) + { + grub_file_close (file); + grub_error (GRUB_ERR_BAD_FILE_TYPE, "file too short"); + return 0; + } + + envblk = grub_envblk_find (buffer); + if (! envblk) + { + grub_file_close (file); + grub_error (GRUB_ERR_BAD_FILE_TYPE, "environment block not found"); + return 0; + } + + return file; +} + +static grub_err_t +grub_cmd_load_env (struct grub_arg_list *state, + int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) + +{ + grub_file_t file; + + auto int hook (char *name, char *value); + int hook (char *name, char *value) + { + grub_env_set (name, value); + + return 0; + } + + file = read_envblk_file ((state[0].set) ? state[0].arg : 0, 0); + if (! file) + return grub_errno; + + grub_file_close (file); + + grub_envblk_iterate (envblk, hook); + + return grub_errno; +} + +static grub_err_t +grub_cmd_list_env (struct grub_arg_list *state, + int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) +{ + grub_file_t file; + + auto int hook (char *name, char *value); + int hook (char *name, char *value) + { + grub_printf ("%s=%s\n", name, value); + + return 0; + } + + file = read_envblk_file ((state[0].set) ? state[0].arg : 0, 0); + if (! file) + return grub_errno; + + grub_file_close (file); + + grub_envblk_iterate (envblk, hook); + + return grub_errno; +} + +static grub_err_t +grub_cmd_save_env (struct grub_arg_list *state, int argc, char **args) +{ + grub_file_t file; + grub_disk_t disk; + grub_disk_addr_t addr[GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS]; + char buf[GRUB_DISK_SECTOR_SIZE]; + grub_disk_addr_t part_start = 0; + int num = 0; + + auto void NESTED_FUNC_ATTR hook (grub_disk_addr_t sector, unsigned offset, + unsigned length); + + void NESTED_FUNC_ATTR hook (grub_disk_addr_t sector, + unsigned offset, unsigned length) + { + if ((offset != 0) || (length != GRUB_DISK_SECTOR_SIZE)) + return; + + if (num < (GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS)) + addr[num++] = sector; + } + + if (! argc) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "No variable is specified"); + + file = read_envblk_file ((state[0].set) ? state[0].arg : 0, hook); + if (! file) + return grub_errno; + + file->read_hook = 0; + + if (num != GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS) + { + grub_error (GRUB_ERR_BAD_DEVICE, "invalid blocklist"); + goto quit; + } + + disk = file->device->disk; + if (disk->partition) + part_start = grub_partition_get_start (disk->partition); + + for (num = 0; num < (GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS); num++) + { + if (grub_disk_read (disk, addr[num] - part_start, 0, + GRUB_DISK_SECTOR_SIZE, buf)) + goto quit; + + if (grub_memcmp (&buffer[num << GRUB_DISK_SECTOR_BITS], buf, + GRUB_DISK_SECTOR_SIZE)) + { + grub_error (GRUB_ERR_BAD_DEVICE, "invalid blocklist"); + goto quit; + } + } + + while (argc) + { + char *value; + + value = grub_env_get (args[0]); + if (value) + { + if (grub_envblk_insert (envblk, args[0], value)) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "environment block too small"); + goto quit; + } + } + + argc--; + args++; + } + + for (num = 0; num < (GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS); num++) + if (grub_disk_write (disk, addr[num] - part_start, 0, + GRUB_DISK_SECTOR_SIZE, + &buffer[num << GRUB_DISK_SECTOR_BITS])) + goto quit; + +quit: + grub_file_close (file); + + return grub_errno; +} + +GRUB_MOD_INIT(loadenv) +{ + (void) mod; + grub_register_command ("load_env", grub_cmd_load_env, GRUB_COMMAND_FLAG_BOTH, + "load_env [-f FILE]", "Load variables from environment block file.", options); + grub_register_command ("list_env", grub_cmd_list_env, GRUB_COMMAND_FLAG_BOTH, + "list_env [-f FILE]", "List variables from environment block file.", options); + grub_register_command ("save_env", grub_cmd_save_env, GRUB_COMMAND_FLAG_BOTH, + "save_env [-f FILE] variable_name [...]", "Save variables to environment block file.", options); +} + +GRUB_MOD_FINI(loadenv) +{ + grub_unregister_command ("load_env"); + grub_unregister_command ("list_env"); + grub_unregister_command ("save_env"); +} diff --git a/conf/common.mk b/conf/common.mk index 9228f1cbf..a889f3be9 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -426,6 +426,37 @@ grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_ rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ DISTCLEANFILES += grub_fstest_init.c +# for grub-editenv +bin_UTILITIES += grub-editenv +grub_editenv_SOURCES = util/grub-editenv.c util/envblk.c util/misc.c kern/misc.c kern/err.c +CLEANFILES += grub-editenv grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o +MOSTLYCLEANFILES += grub_editenv-util_grub_editenv.d grub_editenv-util_envblk.d grub_editenv-util_misc.d grub_editenv-kern_misc.d grub_editenv-kern_err.d + +grub-editenv: $(grub_editenv_DEPENDENCIES) grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o + $(CC) -o $@ grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o $(LDFLAGS) $(grub_editenv_LDFLAGS) + +grub_editenv-util_grub_editenv.o: util/grub-editenv.c $(util/grub-editenv.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< +-include grub_editenv-util_grub_editenv.d + +grub_editenv-util_envblk.o: util/envblk.c $(util/envblk.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< +-include grub_editenv-util_envblk.d + +grub_editenv-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< +-include grub_editenv-util_misc.d + +grub_editenv-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< +-include grub_editenv-kern_misc.d + +grub_editenv-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< +-include grub_editenv-kern_err.d + +CLEANFILES += grub-editenv + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< @@ -1940,7 +1971,7 @@ pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod + read.mod sleep.mod loadenv.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -2913,6 +2944,193 @@ partmap-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump. hexdump_mod_CFLAGS = $(COMMON_CFLAGS) hexdump_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For read.mod. +read_mod_SOURCES = commands/read.c +CLEANFILES += read.mod mod-read.o mod-read.c pre-read.o read_mod-commands_read.o und-read.lst +ifneq ($(read_mod_EXPORTS),no) +CLEANFILES += def-read.lst +DEFSYMFILES += def-read.lst +endif +MOSTLYCLEANFILES += read_mod-commands_read.d +UNDSYMFILES += und-read.lst + +read.mod: pre-read.o mod-read.o + -rm -f $@ + $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-read.o: $(read_mod_DEPENDENCIES) read_mod-commands_read.o + -rm -f $@ + $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ read_mod-commands_read.o + +mod-read.o: mod-read.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -c -o $@ $< + +mod-read.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'read' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(read_mod_EXPORTS),no) +def-read.lst: pre-read.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 read/' > $@ +endif + +und-read.lst: pre-read.o + echo 'read' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +read_mod-commands_read.o: commands/read.c $(commands/read.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -MD -c -o $@ $< +-include read_mod-commands_read.d + +CLEANFILES += cmd-read_mod-commands_read.lst fs-read_mod-commands_read.lst partmap-read_mod-commands_read.lst +COMMANDFILES += cmd-read_mod-commands_read.lst +FSFILES += fs-read_mod-commands_read.lst +PARTMAPFILES += partmap-read_mod-commands_read.lst + +cmd-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh read > $@ || (rm -f $@; exit 1) + +fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh read > $@ || (rm -f $@; exit 1) + +partmap-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh read > $@ || (rm -f $@; exit 1) + + +read_mod_CFLAGS = $(COMMON_CFLAGS) +read_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For sleep.mod. +sleep_mod_SOURCES = commands/sleep.c +CLEANFILES += sleep.mod mod-sleep.o mod-sleep.c pre-sleep.o sleep_mod-commands_sleep.o und-sleep.lst +ifneq ($(sleep_mod_EXPORTS),no) +CLEANFILES += def-sleep.lst +DEFSYMFILES += def-sleep.lst +endif +MOSTLYCLEANFILES += sleep_mod-commands_sleep.d +UNDSYMFILES += und-sleep.lst + +sleep.mod: pre-sleep.o mod-sleep.o + -rm -f $@ + $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-sleep.o: $(sleep_mod_DEPENDENCIES) sleep_mod-commands_sleep.o + -rm -f $@ + $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sleep_mod-commands_sleep.o + +mod-sleep.o: mod-sleep.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -c -o $@ $< + +mod-sleep.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'sleep' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(sleep_mod_EXPORTS),no) +def-sleep.lst: pre-sleep.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sleep/' > $@ +endif + +und-sleep.lst: pre-sleep.o + echo 'sleep' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +sleep_mod-commands_sleep.o: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -MD -c -o $@ $< +-include sleep_mod-commands_sleep.d + +CLEANFILES += cmd-sleep_mod-commands_sleep.lst fs-sleep_mod-commands_sleep.lst partmap-sleep_mod-commands_sleep.lst +COMMANDFILES += cmd-sleep_mod-commands_sleep.lst +FSFILES += fs-sleep_mod-commands_sleep.lst +PARTMAPFILES += partmap-sleep_mod-commands_sleep.lst + +cmd-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sleep > $@ || (rm -f $@; exit 1) + +fs-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sleep > $@ || (rm -f $@; exit 1) + +partmap-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sleep > $@ || (rm -f $@; exit 1) + + +sleep_mod_CFLAGS = $(COMMON_CFLAGS) +sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For loadenv.mod. +loadenv_mod_SOURCES = commands/loadenv.c util/envblk.c +CLEANFILES += loadenv.mod mod-loadenv.o mod-loadenv.c pre-loadenv.o loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o und-loadenv.lst +ifneq ($(loadenv_mod_EXPORTS),no) +CLEANFILES += def-loadenv.lst +DEFSYMFILES += def-loadenv.lst +endif +MOSTLYCLEANFILES += loadenv_mod-commands_loadenv.d loadenv_mod-util_envblk.d +UNDSYMFILES += und-loadenv.lst + +loadenv.mod: pre-loadenv.o mod-loadenv.o + -rm -f $@ + $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-loadenv.o: $(loadenv_mod_DEPENDENCIES) loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o + -rm -f $@ + $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o + +mod-loadenv.o: mod-loadenv.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -c -o $@ $< + +mod-loadenv.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'loadenv' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(loadenv_mod_EXPORTS),no) +def-loadenv.lst: pre-loadenv.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadenv/' > $@ +endif + +und-loadenv.lst: pre-loadenv.o + echo 'loadenv' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +loadenv_mod-commands_loadenv.o: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -MD -c -o $@ $< +-include loadenv_mod-commands_loadenv.d + +CLEANFILES += cmd-loadenv_mod-commands_loadenv.lst fs-loadenv_mod-commands_loadenv.lst partmap-loadenv_mod-commands_loadenv.lst +COMMANDFILES += cmd-loadenv_mod-commands_loadenv.lst +FSFILES += fs-loadenv_mod-commands_loadenv.lst +PARTMAPFILES += partmap-loadenv_mod-commands_loadenv.lst + +cmd-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) + +fs-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) + +partmap-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) + + +loadenv_mod-util_envblk.o: util/envblk.c $(util/envblk.c_DEPENDENCIES) + $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -MD -c -o $@ $< +-include loadenv_mod-util_envblk.d + +CLEANFILES += cmd-loadenv_mod-util_envblk.lst fs-loadenv_mod-util_envblk.lst partmap-loadenv_mod-util_envblk.lst +COMMANDFILES += cmd-loadenv_mod-util_envblk.lst +FSFILES += fs-loadenv_mod-util_envblk.lst +PARTMAPFILES += partmap-loadenv_mod-util_envblk.lst + +cmd-loadenv_mod-util_envblk.lst: util/envblk.c $(util/envblk.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) + +fs-loadenv_mod-util_envblk.lst: util/envblk.c $(util/envblk.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) + +partmap-loadenv_mod-util_envblk.lst: util/envblk.c $(util/envblk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) + + +loadenv_mod_CFLAGS = $(COMMON_CFLAGS) +loadenv_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Misc. pkglib_MODULES += gzio.mod elf.mod @@ -3027,115 +3245,3 @@ partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For read.mod. -read_mod_SOURCES = commands/read.c -CLEANFILES += read.mod mod-read.o mod-read.c pre-read.o read_mod-commands_read.o und-read.lst -ifneq ($(read_mod_EXPORTS),no) -CLEANFILES += def-read.lst -DEFSYMFILES += def-read.lst -endif -MOSTLYCLEANFILES += read_mod-commands_read.d -UNDSYMFILES += und-read.lst - -read.mod: pre-read.o mod-read.o - -rm -f $@ - $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ - -pre-read.o: $(read_mod_DEPENDENCIES) read_mod-commands_read.o - -rm -f $@ - $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ read_mod-commands_read.o - -mod-read.o: mod-read.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -c -o $@ $< - -mod-read.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'read' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(read_mod_EXPORTS),no) -def-read.lst: pre-read.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 read/' > $@ -endif - -und-read.lst: pre-read.o - echo 'read' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -read_mod-commands_read.o: commands/read.c $(commands/read.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -MD -c -o $@ $< --include read_mod-commands_read.d - -CLEANFILES += cmd-read_mod-commands_read.lst fs-read_mod-commands_read.lst partmap-read_mod-commands_read.lst -COMMANDFILES += cmd-read_mod-commands_read.lst -FSFILES += fs-read_mod-commands_read.lst -PARTMAPFILES += partmap-read_mod-commands_read.lst - -cmd-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh read > $@ || (rm -f $@; exit 1) - -fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh read > $@ || (rm -f $@; exit 1) - -partmap-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh read > $@ || (rm -f $@; exit 1) - - -read_mod_CFLAGS = $(COMMON_CFLAGS) -read_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sleep.mod. -sleep_mod_SOURCES = commands/sleep.c -CLEANFILES += sleep.mod mod-sleep.o mod-sleep.c pre-sleep.o sleep_mod-commands_sleep.o und-sleep.lst -ifneq ($(sleep_mod_EXPORTS),no) -CLEANFILES += def-sleep.lst -DEFSYMFILES += def-sleep.lst -endif -MOSTLYCLEANFILES += sleep_mod-commands_sleep.d -UNDSYMFILES += und-sleep.lst - -sleep.mod: pre-sleep.o mod-sleep.o - -rm -f $@ - $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ - -pre-sleep.o: $(sleep_mod_DEPENDENCIES) sleep_mod-commands_sleep.o - -rm -f $@ - $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sleep_mod-commands_sleep.o - -mod-sleep.o: mod-sleep.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -c -o $@ $< - -mod-sleep.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'sleep' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(sleep_mod_EXPORTS),no) -def-sleep.lst: pre-sleep.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sleep/' > $@ -endif - -und-sleep.lst: pre-sleep.o - echo 'sleep' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -sleep_mod-commands_sleep.o: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -MD -c -o $@ $< --include sleep_mod-commands_sleep.d - -CLEANFILES += cmd-sleep_mod-commands_sleep.lst fs-sleep_mod-commands_sleep.lst partmap-sleep_mod-commands_sleep.lst -COMMANDFILES += cmd-sleep_mod-commands_sleep.lst -FSFILES += fs-sleep_mod-commands_sleep.lst -PARTMAPFILES += partmap-sleep_mod-commands_sleep.lst - -cmd-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sleep > $@ || (rm -f $@; exit 1) - -fs-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sleep > $@ || (rm -f $@; exit 1) - -partmap-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sleep > $@ || (rm -f $@; exit 1) - - -sleep_mod_CFLAGS = $(COMMON_CFLAGS) -sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/common.rmk b/conf/common.rmk index f34a2bf3b..ecb8e040b 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -94,6 +94,11 @@ grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_ rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ DISTCLEANFILES += grub_fstest_init.c +# for grub-editenv +bin_UTILITIES += grub-editenv +grub_editenv_SOURCES = util/grub-editenv.c util/envblk.c util/misc.c kern/misc.c kern/err.c +CLEANFILES += grub-editenv + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< @@ -282,7 +287,7 @@ pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod + read.mod sleep.mod loadenv.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -369,6 +374,21 @@ hexdump_mod_SOURCES = commands/hexdump.c hexdump_mod_CFLAGS = $(COMMON_CFLAGS) hexdump_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For read.mod. +read_mod_SOURCES = commands/read.c +read_mod_CFLAGS = $(COMMON_CFLAGS) +read_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For sleep.mod. +sleep_mod_SOURCES = commands/sleep.c +sleep_mod_CFLAGS = $(COMMON_CFLAGS) +sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For loadenv.mod. +loadenv_mod_SOURCES = commands/loadenv.c util/envblk.c +loadenv_mod_CFLAGS = $(COMMON_CFLAGS) +loadenv_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Misc. pkglib_MODULES += gzio.mod elf.mod @@ -381,13 +401,3 @@ elf_mod_LDFLAGS = $(COMMON_LDFLAGS) gzio_mod_SOURCES = io/gzio.c gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For read.mod. -read_mod_SOURCES = commands/read.c -read_mod_CFLAGS = $(COMMON_CFLAGS) -read_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sleep.mod. -sleep_mod_SOURCES = commands/sleep.c -sleep_mod_CFLAGS = $(COMMON_CFLAGS) -sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/envblk.h b/include/grub/envblk.h new file mode 100644 index 000000000..5c1157e8f --- /dev/null +++ b/include/grub/envblk.h @@ -0,0 +1,45 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_ENVBLK_HEADER +#define GRUB_ENVBLK_HEADER 1 + +#define GRUB_ENVBLK_SIGNATURE 0x764e6547 /* GeNv */ + +#define GRUB_ENVBLK_MAXLEN 8192 + +#define GRUB_ENVBLK_DEFCFG "grubenv" + +#ifndef ASM_FILE + +struct grub_envblk +{ + grub_uint32_t signature; + grub_uint16_t length; + char data[0]; +} __attribute__ ((packed)); +typedef struct grub_envblk *grub_envblk_t; + +grub_envblk_t grub_envblk_find (char *buf); +int grub_envblk_insert (grub_envblk_t envblk, char *name, char *value); +void grub_envblk_delete (grub_envblk_t envblk, char *name); +void grub_envblk_iterate (grub_envblk_t envblk, int hook (char *name, char *value)); + +#endif + +#endif /* ! GRUB_ENVBLK_HEADER */ diff --git a/util/envblk.c b/util/envblk.c new file mode 100644 index 000000000..9cea7d6f9 --- /dev/null +++ b/util/envblk.c @@ -0,0 +1,156 @@ +/* envblk.c - Common function for environment block. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +grub_envblk_t +grub_envblk_find (char *buf) +{ + grub_uint32_t *pd; + int len; + + pd = (grub_uint32_t *) buf; + + for (len = GRUB_ENVBLK_MAXLEN - 6; len > 0; len -= 4, pd++) + if (*pd == GRUB_ENVBLK_SIGNATURE) + { + grub_envblk_t p; + + p = (grub_envblk_t) pd; + if (p->length <= len) + return p; + } + + return 0; +} + +int +grub_envblk_insert (grub_envblk_t envblk, char *name, char *value) +{ + char *p, *pend; + char *found = 0; + int nl; + + nl = grub_strlen (name); + p = envblk->data; + pend = p + envblk->length; + + while (*p) + { + if ((! found) && (! grub_memcmp (name, p, nl)) && (p[nl] == '=')) + found = p + nl + 1; + + p += grub_strlen (p) + 1; + if (p >= pend) + return 1; + } + + if (found) + { + int len1, len2; + + len1 = grub_strlen (found); + len2 = grub_strlen (value); + if ((p - envblk->data) + 1 - len1 + len2 > envblk->length) + return 1; + + grub_memcpy (found + len2 + 1, found + len1 + 1, (p - found) - len1); + grub_strcpy (found, value); + } + else + { + int len2 = grub_strlen (value); + + if ((p - envblk->data) + nl + 1 + len2 + 2 > envblk->length) + return 1; + + grub_strcpy (p, name); + p[nl] = '='; + grub_strcpy (p + nl + 1, value); + p[nl + 1 + len2 + 1] = 0; + } + + return 0; +} + +void +grub_envblk_delete (grub_envblk_t envblk, char *name) +{ + char *p, *pend; + char *found = 0; + int nl; + + nl = grub_strlen (name); + p = envblk->data; + pend = p + envblk->length; + + while (*p) + { + if ((! found) && (! grub_memcmp (name, p, nl)) && (p[nl] == '=')) + found = p; + + p += grub_strlen (p) + 1; + if (p >= pend) + return; + } + + if (found) + { + int len; + + len = grub_strlen (found); + grub_memcpy (found, found + len + 1, (p - found) - len); + } +} + +void +grub_envblk_iterate (grub_envblk_t envblk, + int hook (char *name, char *value)) +{ + char *p, *pend; + + p = envblk->data; + pend = p + envblk->length; + + while (*p) + { + char *v; + int r; + + v = grub_strchr (p, '='); + if (v) + { + *v = 0; + r = hook (p, v + 1); + *v = '='; + } + else + r = hook (p, ""); + + if (r) + break; + + p += grub_strlen (p) + 1; + if (p >= pend) + break; + } +} diff --git a/util/grub-editenv.c b/util/grub-editenv.c new file mode 100644 index 000000000..b2b2d679b --- /dev/null +++ b/util/grub-editenv.c @@ -0,0 +1,258 @@ +/* grub-editenv.c - tool to edit environment block. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +#include + +#include +#include +#include +#include +#include + +void +grub_putchar (int c) +{ + putchar (c); +} + +void +grub_refresh (void) +{ + fflush (stdout); +} + +void * +grub_term_get_current (void) +{ + return 0; +} + +int +grub_getkey (void) +{ + return 0; +} + +char * +grub_env_get (const char *name __attribute__ ((unused))) +{ + return NULL; +} + +static struct option options[] = { + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"verbose", no_argument, 0, 'v'}, + {0, 0, 0, 0} +}; + +char buffer[GRUB_ENVBLK_MAXLEN]; +grub_envblk_t envblk; + +static void +usage (int status) +{ + if (status) + fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n"); + else + printf ("\ +Usage: grub-editenv [OPTIONS] FILENAME COMMAND\n\ +\n\ +Tool to edit environment block.\n\ +\nCommands:\n\ + create create a blank environment block file\n\ + info show information about the environment block\n\ + list list the current variables\n\ + set [name=value] ... change/delete variables\n\ + clear delete all variables\n\ +\nOptions:\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ +\n\ +Report bugs to <%s>.\n", PACKAGE_BUGREPORT); + + exit (status); +} + +int +create_envblk_file (char *name) +{ + FILE *f; + grub_envblk_t p; + + f = fopen (name, "wb"); + if (! f) + return 1; + + /* Just in case OS don't save 0s. */ + memset (buffer, -1, sizeof (buffer)); + + p = (grub_envblk_t) &buffer[0]; + p->signature = GRUB_ENVBLK_SIGNATURE; + p->length = sizeof (buffer) - sizeof (struct grub_envblk); + p->data[0] = p->data[1] = 0; + + fwrite (buffer, sizeof (buffer), 1, f); + + fclose (f); + return 0; +} + +FILE * +open_envblk_file (char *name) +{ + FILE *f; + + f = fopen (name, "r+b"); + if (! f) + grub_util_error ("Can\'t open file %s", name); + + if (fread (buffer, 1, sizeof (buffer), f) != sizeof (buffer)) + grub_util_error ("The envblk file is too short"); + + envblk = grub_envblk_find (buffer); + if (! envblk) + grub_util_error ("Can\'t find environment block"); + + return f; +} + +static void +cmd_info (void) +{ + printf ("Envblk offset: %d\n", envblk->data - buffer); + printf ("Envblk length: %d\n", envblk->length); +} + +static void +cmd_list (void) +{ + auto int hook (char *name, char *value); + int hook (char *name, char *value) + { + printf ("%s=%s\n", name, value); + return 0; + } + + grub_envblk_iterate (envblk, hook); +} + +static void +cmd_set (int argc, char *argv[]) +{ + while (argc) + { + char *p; + + p = strchr (argv[0], '='); + if (! p) + grub_util_error ("Invalid parameter"); + + *(p++) = 0; + + if (*p) + { + if (grub_envblk_insert (envblk, argv[0], p)) + grub_util_error ("Environment block too small"); + } + else + grub_envblk_delete (envblk, argv[0]); + + argc--; + argv++; + } +} + +static void +cmd_clear (void) +{ + envblk->data[0] = envblk->data[1] = 0; +} + +int +main (int argc, char *argv[]) +{ + FILE *f; + + progname = "grub-editenv"; + + /* Check for options. */ + while (1) + { + int c = getopt_long (argc, argv, "hVv", options, 0); + + if (c == -1) + break; + else + switch (c) + { + case 'h': + usage (0); + break; + + case 'V': + printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); + return 0; + + case 'v': + verbosity++; + break; + + default: + usage (1); + break; + } + } + + /* Obtain PATH. */ + if (optind + 1 >= argc) + { + fprintf (stderr, "Not enough parameter.\n"); + usage (1); + } + + if (! strcmp (argv[optind + 1], "create")) + return create_envblk_file (argv[optind]); + + f = open_envblk_file (argv[optind]); + + optind++; + if (! strcmp (argv[optind], "info")) + cmd_info (); + else if (! strcmp (argv[optind], "list")) + cmd_list (); + else + { + if (! strcmp (argv[optind], "set")) + cmd_set (argc - optind - 1, argv + optind + 1); + else if (! strcmp (argv[optind], "clear")) + cmd_clear (); + + fseek (f, 0, SEEK_SET); + fwrite (buffer, sizeof (buffer), 1, f); + } + fclose (f); + + return 0; +} From d4156eeedf8ad7ed46672bc508c97503d4e2f28d Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 2 Jul 2008 07:38:46 +0000 Subject: [PATCH 0214/1707] 2008-07-02 Bean * include/grub/ieee1275.h (grub_ieee1275_flag): New constant GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM and GRUB_IEEE1275_FLAG_NO_ANSI. * kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set flag GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM and GRUB_IEEE1275_FLAG_NO_ANSI for Open Hackware. * kern/ieee1275/ieee1275.c (grub_ieee1275_interpret): Return immediately if GRUB_IEEE1275_FLAG_CANNOT_INTERPRET is set. * kern/ieee1275/init.c (grub_claim_heap): Claim memory directly if GRUB_IEEE1275_FLAG_FORCE_CLAIM is set. * term/ieee1275/ofconsole.c (grub_ofconsole_writeesc): Don't output esc sequence on non ANSI terminal. (grub_ofconsole_gotoxy): Emulate backspace key on non ANSI terminal. * util/elf/grub-mkimage.c (add_segments): Move ELF header to the beginning of file. --- ChangeLog | 23 +++++++++++++++++++++ include/grub/ieee1275/ieee1275.h | 9 +++++++++ kern/ieee1275/cmain.c | 3 +++ kern/ieee1275/ieee1275.c | 3 +++ kern/ieee1275/init.c | 5 ++++- term/ieee1275/ofconsole.c | 28 ++++++++++++++++++++++---- util/elf/grub-mkimage.c | 34 +++++++++++++++++++++----------- 7 files changed, 89 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index f27f59b6f..24d486e35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2008-07-02 Bean + + * include/grub/ieee1275.h (grub_ieee1275_flag): New constant + GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM + and GRUB_IEEE1275_FLAG_NO_ANSI. + + * kern/ieee1275/cmain.c (grub_ieee1275_find_options): Set flag + GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, GRUB_IEEE1275_FLAG_FORCE_CLAIM + and GRUB_IEEE1275_FLAG_NO_ANSI for Open Hackware. + + * kern/ieee1275/ieee1275.c (grub_ieee1275_interpret): Return + immediately if GRUB_IEEE1275_FLAG_CANNOT_INTERPRET is set. + + * kern/ieee1275/init.c (grub_claim_heap): Claim memory directly if + GRUB_IEEE1275_FLAG_FORCE_CLAIM is set. + + * term/ieee1275/ofconsole.c (grub_ofconsole_writeesc): Don't output + esc sequence on non ANSI terminal. + (grub_ofconsole_gotoxy): Emulate backspace key on non ANSI terminal. + + * util/elf/grub-mkimage.c (add_segments): Move ELF header to the + beginning of file. + 2008-07-02 Bean * conf/common.rmk (bin_UTILITIES): Add grub-editenv. diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 5c06025ca..6f8f1ccb8 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -89,6 +89,15 @@ enum grub_ieee1275_flag /* Open Hack'Ware stops when trying to set colors */ GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS, + + /* Open Hack'Ware stops when grub_ieee1275_interpret is used. */ + GRUB_IEEE1275_FLAG_CANNOT_INTERPRET, + + /* Open Hack'Ware has no memory map, just claim what we need. */ + GRUB_IEEE1275_FLAG_FORCE_CLAIM, + + /* Open Hack'Ware don't support the ANSI sequence. */ + GRUB_IEEE1275_FLAG_NO_ANSI, }; extern int EXPORT_FUNC(grub_ieee1275_test_flag) (enum grub_ieee1275_flag flag); diff --git a/kern/ieee1275/cmain.c b/kern/ieee1275/cmain.c index 54a52b694..b5e2ba66b 100644 --- a/kern/ieee1275/cmain.c +++ b/kern/ieee1275/cmain.c @@ -144,6 +144,9 @@ grub_ieee1275_find_options (void) { grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_BROKEN_OUTPUT); grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS); + grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET); + grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_FORCE_CLAIM); + grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_ANSI); } } } diff --git a/kern/ieee1275/ieee1275.c b/kern/ieee1275/ieee1275.c index 135b30e7f..2e8897669 100644 --- a/kern/ieee1275/ieee1275.c +++ b/kern/ieee1275/ieee1275.c @@ -390,6 +390,9 @@ grub_ieee1275_interpret (const char *command, grub_ieee1275_cell_t *catch) } args; + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + return -1; + INIT_IEEE1275_COMMON (&args.common, "interpret", 1, 1); args.command = (grub_ieee1275_cell_t) command; diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index b8f414b1d..26aca778e 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -171,7 +171,10 @@ static void grub_claim_heap (void) return 0; } - grub_available_iterate (heap_init); + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) + heap_init (HEAP_MAX_ADDR - HEAP_MIN_SIZE, HEAP_MIN_SIZE); + else + grub_available_iterate (heap_init); } #ifdef __i386__ diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index dd60de6f2..5d701ca64 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -63,6 +63,9 @@ static grub_uint8_t grub_ofconsole_highlight_color = 0x70; static void grub_ofconsole_writeesc (const char *str) { + if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_ANSI)) + return; + while (*str) { char chr = *(str++); @@ -284,11 +287,28 @@ static void grub_ofconsole_gotoxy (grub_uint8_t x, grub_uint8_t y) { char s[11]; /* 5 + 3 + 3. */ - grub_curr_x = x; - grub_curr_y = y; - grub_sprintf (s, "\e[%d;%dH", y + 1, x + 1); - grub_ofconsole_writeesc (s); + if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_ANSI)) + { + grub_curr_x = x; + grub_curr_y = y; + + grub_sprintf (s, "\e[%d;%dH", y + 1, x + 1); + grub_ofconsole_writeesc (s); + } + else + { + if ((y == grub_curr_y) && (x == grub_curr_x - 1)) + { + char chr; + + chr = '\b'; + grub_ieee1275_write (stdout_ihandle, &chr, 1, 0); + } + + grub_curr_x = x; + grub_curr_y = y; + } } static void diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index ca138dd5d..43c873e5f 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -166,8 +166,8 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) FILE *in; char *kernel_path; grub_addr_t grub_end = 0; - off_t phdroff; - int i; + off_t offset; + int i, phdr_size; /* Read ELF header. */ kernel_path = grub_util_get_path (dir, "kernel.elf"); @@ -177,8 +177,21 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) grub_util_read_at (&ehdr, sizeof (ehdr), 0, in); - phdrs = xmalloc (grub_target_to_host16 (ehdr.e_phentsize) - * (grub_target_to_host16 (ehdr.e_phnum) + 2)); + offset = ALIGN_UP (sizeof (ehdr), sizeof (long)); + ehdr.e_phoff = grub_host_to_target32 (offset); + + phdr_size = (grub_target_to_host16 (ehdr.e_phentsize) * + grub_target_to_host16 (ehdr.e_phnum)); + + if (mods[0] != NULL) + phdr_size += grub_target_to_host16 (ehdr.e_phentsize); + + if (chrp) + phdr_size += grub_target_to_host16 (ehdr.e_phentsize); + + phdrs = xmalloc (phdr_size); + offset += ALIGN_UP (phdr_size, sizeof (long)); + /* Copy all existing segments. */ for (i = 0; i < grub_target_to_host16 (ehdr.e_phnum); i++) { @@ -207,8 +220,11 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) grub_util_read_at (segment_img, grub_target_to_host32 (phdr->p_filesz), grub_target_to_host32 (phdr->p_offset), in); + + phdr->p_offset = grub_host_to_target32 (offset); grub_util_write_image_at (segment_img, grub_target_to_host32 (phdr->p_filesz), - grub_target_to_host32 (phdr->p_offset), out); + offset, out); + offset += ALIGN_UP (grub_target_to_host32 (phdr->p_filesz), sizeof (long)); free (segment_img); } @@ -249,14 +265,10 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) ehdr.e_shnum = 0; ehdr.e_shstrndx = 0; - /* Append entire segment table to the file. */ - phdroff = ALIGN_UP (grub_util_get_fp_size (out), sizeof (long)); - grub_util_write_image_at (phdrs, grub_target_to_host16 (ehdr.e_phentsize) - * grub_target_to_host16 (ehdr.e_phnum), phdroff, - out); + /* Write entire segment table to the file. */ + grub_util_write_image_at (phdrs, phdr_size, grub_target_to_host32 (ehdr.e_phoff), out); /* Write ELF header. */ - ehdr.e_phoff = grub_host_to_target32 (phdroff); grub_util_write_image_at (&ehdr, sizeof (ehdr), 0, out); free (phdrs); From d4c9b428e1dfee64411090935a0e447b1b081df3 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 18:40:32 +0000 Subject: [PATCH 0215/1707] 2008-07-02 Pavel Roskin * fs/xfs.c (struct grub_xfs_dir_header): Use names similar to those in Linux XFS code. Provide a way to access 64-bit parent inode. (grub_xfs_iterate_dir): Use the new names. Avoid reading past the end of struct grub_xfs_dir_header. --- ChangeLog | 8 ++++++++ fs/xfs.c | 18 +++++++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 24d486e35..fa5ad5dbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-02 Pavel Roskin + + * fs/xfs.c (struct grub_xfs_dir_header): Use names similar to + those in Linux XFS code. Provide a way to access 64-bit parent + inode. + (grub_xfs_iterate_dir): Use the new names. Avoid reading past + the end of struct grub_xfs_dir_header. + 2008-07-02 Bean * include/grub/ieee1275.h (grub_ieee1275_flag): New constant diff --git a/fs/xfs.c b/fs/xfs.c index 54d8031e0..7da3e4012 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -55,9 +55,13 @@ struct grub_xfs_sblock struct grub_xfs_dir_header { - grub_uint8_t entries; - grub_uint8_t smallino; - grub_uint32_t parent; + grub_uint8_t count; + grub_uint8_t i8count; + union + { + grub_uint32_t i4; + grub_uint64_t i8; + } parent __attribute__ ((packed)); } __attribute__ ((packed)); struct grub_xfs_dir_entry @@ -419,7 +423,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, case XFS_INODE_FORMAT_INO: { struct grub_xfs_dir_entry *de = &diro->inode.data.dir.direntry[0]; - int smallino = !diro->inode.data.dir.dirhead.smallino; + int smallino = !diro->inode.data.dir.dirhead.i8count; int i; grub_uint64_t parent; @@ -427,12 +431,12 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, parent inode number is small too. */ if (smallino) { - parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent); + parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent.i4); parent = grub_cpu_to_be64 (parent); } else { - parent = *(grub_uint64_t *) &diro->inode.data.dir.dirhead.parent; + parent = diro->inode.data.dir.dirhead.parent.i8; /* The header is a bit bigger than usual. */ de = (struct grub_xfs_dir_entry *) ((char *) de + 4); } @@ -444,7 +448,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, if (call_hook (parent, "..")) return 1; - for (i = 0; i < diro->inode.data.dir.dirhead.entries; i++) + for (i = 0; i < diro->inode.data.dir.dirhead.count; i++) { grub_uint64_t ino; void *inopos = (((char *) de) From cb71ba20e9e70bfc58d9bd867231f07828344472 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 19:03:23 +0000 Subject: [PATCH 0216/1707] 2008-07-02 Pavel Roskin * Makefile.in (MODULE_LDFLAGS): New variable. * aclocal.m4 (grub_PROG_LD_BUILD_ID_NONE): New macro. Check if the linker accepts --build-id=none. * configure.ac: Call grub_PROG_LD_BUILD_ID_NONE. Substitute MODULE_LDFLAGS. * genmk.rb: Use MODULE_LDFLAGS when linking modules. --- ChangeLog | 7 +++ Makefile.in | 1 + aclocal.m4 | 20 +++++++++ conf/common.mk | 96 ++++++++++++++++++++-------------------- conf/i386-efi.mk | 18 ++++---- conf/i386-ieee1275.mk | 24 +++++----- conf/i386-linuxbios.mk | 20 ++++----- conf/i386-pc.mk | 62 +++++++++++++------------- conf/powerpc-ieee1275.mk | 16 +++---- conf/sparc64-ieee1275.mk | 62 +++++++++++++------------- configure | 66 ++++++++++++++++++++++++++- configure.ac | 2 + genmk.rb | 2 +- 13 files changed, 245 insertions(+), 151 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa5ad5dbd..da1591f0f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2008-07-02 Pavel Roskin + * Makefile.in (MODULE_LDFLAGS): New variable. + * aclocal.m4 (grub_PROG_LD_BUILD_ID_NONE): New macro. Check if + the linker accepts --build-id=none. + * configure.ac: Call grub_PROG_LD_BUILD_ID_NONE. Substitute + MODULE_LDFLAGS. + * genmk.rb: Use MODULE_LDFLAGS when linking modules. + * fs/xfs.c (struct grub_xfs_dir_header): Use names similar to those in Linux XFS code. Provide a way to access 64-bit parent inode. diff --git a/Makefile.in b/Makefile.in index c29c5fdf5..c25520333 100644 --- a/Makefile.in +++ b/Makefile.in @@ -68,6 +68,7 @@ TARGET_CFLAGS = @TARGET_CFLAGS@ TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ +MODULE_LDFLAGS = @MODULE_LDFLAGS@ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ NM = @NM@ diff --git a/aclocal.m4 b/aclocal.m4 index fc6706614..a6732636a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -81,6 +81,26 @@ fi ]) +dnl Supply --build-id=none to ld if building modules. +dnl This suppresses warnings from ld on some systems +AC_DEFUN(grub_PROG_LD_BUILD_ID_NONE, +[AC_MSG_CHECKING([whether linker accepts --build-id=none]) +AC_CACHE_VAL(grub_cv_prog_ld_build_id_none, +[save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -Wl,--build-id=none" +AC_TRY_LINK([], [], + grub_cv_prog_ld_build_id_none=yes, + grub_cv_prog_ld_build_id_none=no) +LDFLAGS="$save_LDFLAGS" +]) +AC_MSG_RESULT([$grub_cv_prog_ld_build_id_none]) + +if test "x$grub_cv_prog_ld_build_id_none" = xyes; then + MODULE_LDFLAGS="$MODULE_LDFLAGS -Wl,--build-id=none" +fi +]) + + dnl Mass confusion! dnl Older versions of GAS interpret `.code16' to mean ``generate 32-bit dnl instructions, but implicitly insert addr32 and data32 bytes so diff --git a/conf/common.mk b/conf/common.mk index a889f3be9..0cfa37d9b 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -515,7 +515,7 @@ UNDSYMFILES += und-fshelp.lst fshelp.mod: pre-fshelp.o mod-fshelp.o -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o @@ -571,7 +571,7 @@ UNDSYMFILES += und-fat.lst fat.mod: pre-fat.o mod-fat.o -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o @@ -627,7 +627,7 @@ UNDSYMFILES += und-ufs.lst ufs.mod: pre-ufs.o mod-ufs.o -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o @@ -683,7 +683,7 @@ UNDSYMFILES += und-ext2.lst ext2.mod: pre-ext2.o mod-ext2.o -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o @@ -739,7 +739,7 @@ UNDSYMFILES += und-ntfs.lst ntfs.mod: pre-ntfs.o mod-ntfs.o -rm -f $@ - $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ntfs.o: $(ntfs_mod_DEPENDENCIES) ntfs_mod-fs_ntfs.o @@ -795,7 +795,7 @@ UNDSYMFILES += und-ntfscomp.lst ntfscomp.mod: pre-ntfscomp.o mod-ntfscomp.o -rm -f $@ - $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ntfscomp.o: $(ntfscomp_mod_DEPENDENCIES) ntfscomp_mod-fs_ntfscomp.o @@ -851,7 +851,7 @@ UNDSYMFILES += und-minix.lst minix.mod: pre-minix.o mod-minix.o -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o @@ -907,7 +907,7 @@ UNDSYMFILES += und-hfs.lst hfs.mod: pre-hfs.o mod-hfs.o -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o @@ -963,7 +963,7 @@ UNDSYMFILES += und-jfs.lst jfs.mod: pre-jfs.o mod-jfs.o -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o @@ -1019,7 +1019,7 @@ UNDSYMFILES += und-iso9660.lst iso9660.mod: pre-iso9660.o mod-iso9660.o -rm -f $@ - $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-iso9660.o: $(iso9660_mod_DEPENDENCIES) iso9660_mod-fs_iso9660.o @@ -1075,7 +1075,7 @@ UNDSYMFILES += und-xfs.lst xfs.mod: pre-xfs.o mod-xfs.o -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o @@ -1131,7 +1131,7 @@ UNDSYMFILES += und-affs.lst affs.mod: pre-affs.o mod-affs.o -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o @@ -1187,7 +1187,7 @@ UNDSYMFILES += und-sfs.lst sfs.mod: pre-sfs.o mod-sfs.o -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o @@ -1243,7 +1243,7 @@ UNDSYMFILES += und-hfsplus.lst hfsplus.mod: pre-hfsplus.o mod-hfsplus.o -rm -f $@ - $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-hfsplus.o: $(hfsplus_mod_DEPENDENCIES) hfsplus_mod-fs_hfsplus.o @@ -1299,7 +1299,7 @@ UNDSYMFILES += und-reiserfs.lst reiserfs.mod: pre-reiserfs.o mod-reiserfs.o -rm -f $@ - $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-reiserfs.o: $(reiserfs_mod_DEPENDENCIES) reiserfs_mod-fs_reiserfs.o @@ -1355,7 +1355,7 @@ UNDSYMFILES += und-cpio.lst cpio.mod: pre-cpio.o mod-cpio.o -rm -f $@ - $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cpio.o: $(cpio_mod_DEPENDENCIES) cpio_mod-fs_cpio.o @@ -1411,7 +1411,7 @@ UNDSYMFILES += und-udf.lst udf.mod: pre-udf.o mod-udf.o -rm -f $@ - $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-udf.o: $(udf_mod_DEPENDENCIES) udf_mod-fs_udf.o @@ -1467,7 +1467,7 @@ UNDSYMFILES += und-afs.lst afs.mod: pre-afs.o mod-afs.o -rm -f $@ - $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-afs.o: $(afs_mod_DEPENDENCIES) afs_mod-fs_afs.o @@ -1526,7 +1526,7 @@ UNDSYMFILES += und-amiga.lst amiga.mod: pre-amiga.o mod-amiga.o -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o @@ -1582,7 +1582,7 @@ UNDSYMFILES += und-apple.lst apple.mod: pre-apple.o mod-apple.o -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o @@ -1638,7 +1638,7 @@ UNDSYMFILES += und-pc.lst pc.mod: pre-pc.o mod-pc.o -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o @@ -1694,7 +1694,7 @@ UNDSYMFILES += und-sun.lst sun.mod: pre-sun.o mod-sun.o -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o @@ -1750,7 +1750,7 @@ UNDSYMFILES += und-acorn.lst acorn.mod: pre-acorn.o mod-acorn.o -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o @@ -1806,7 +1806,7 @@ UNDSYMFILES += und-gpt.lst gpt.mod: pre-gpt.o mod-gpt.o -rm -f $@ - $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-gpt.o: $(gpt_mod_DEPENDENCIES) gpt_mod-partmap_gpt.o @@ -1866,7 +1866,7 @@ UNDSYMFILES += und-raid.lst raid.mod: pre-raid.o mod-raid.o -rm -f $@ - $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-raid.o: $(raid_mod_DEPENDENCIES) raid_mod-disk_raid.o @@ -1922,7 +1922,7 @@ UNDSYMFILES += und-lvm.lst lvm.mod: pre-lvm.o mod-lvm.o -rm -f $@ - $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-lvm.o: $(lvm_mod_DEPENDENCIES) lvm_mod-disk_lvm.o @@ -1985,7 +1985,7 @@ UNDSYMFILES += und-hello.lst hello.mod: pre-hello.o mod-hello.o -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o @@ -2041,7 +2041,7 @@ UNDSYMFILES += und-boot.lst boot.mod: pre-boot.o mod-boot.o -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o @@ -2097,7 +2097,7 @@ UNDSYMFILES += und-terminal.lst terminal.mod: pre-terminal.o mod-terminal.o -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o @@ -2153,7 +2153,7 @@ UNDSYMFILES += und-ls.lst ls.mod: pre-ls.o mod-ls.o -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o @@ -2209,7 +2209,7 @@ UNDSYMFILES += und-cmp.lst cmp.mod: pre-cmp.o mod-cmp.o -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o @@ -2265,7 +2265,7 @@ UNDSYMFILES += und-cat.lst cat.mod: pre-cat.o mod-cat.o -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o @@ -2321,7 +2321,7 @@ UNDSYMFILES += und-echo.lst echo.mod: pre-echo.o mod-echo.o -rm -f $@ - $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-echo.o: $(echo_mod_DEPENDENCIES) echo_mod-commands_echo.o @@ -2377,7 +2377,7 @@ UNDSYMFILES += und-help.lst help.mod: pre-help.o mod-help.o -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o @@ -2433,7 +2433,7 @@ UNDSYMFILES += und-font.lst font.mod: pre-font.o mod-font.o -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o @@ -2489,7 +2489,7 @@ UNDSYMFILES += und-search.lst search.mod: pre-search.o mod-search.o -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o @@ -2545,7 +2545,7 @@ UNDSYMFILES += und-test.lst test.mod: pre-test.o mod-test.o -rm -f $@ - $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-test.o: $(test_mod_DEPENDENCIES) test_mod-commands_test.o @@ -2601,7 +2601,7 @@ UNDSYMFILES += und-loopback.lst loopback.mod: pre-loopback.o mod-loopback.o -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o @@ -2657,7 +2657,7 @@ UNDSYMFILES += und-fs_uuid.lst fs_uuid.mod: pre-fs_uuid.o mod-fs_uuid.o -rm -f $@ - $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-fs_uuid.o: $(fs_uuid_mod_DEPENDENCIES) fs_uuid_mod-disk_fs_uuid.o @@ -2713,7 +2713,7 @@ UNDSYMFILES += und-configfile.lst configfile.mod: pre-configfile.o mod-configfile.o -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configfile.o @@ -2769,7 +2769,7 @@ UNDSYMFILES += und-terminfo.lst terminfo.mod: pre-terminfo.o mod-terminfo.o -rm -f $@ - $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-terminfo.o: $(terminfo_mod_DEPENDENCIES) terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o @@ -2844,7 +2844,7 @@ UNDSYMFILES += und-blocklist.lst blocklist.mod: pre-blocklist.o mod-blocklist.o -rm -f $@ - $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-blocklist.o: $(blocklist_mod_DEPENDENCIES) blocklist_mod-commands_blocklist.o @@ -2900,7 +2900,7 @@ UNDSYMFILES += und-hexdump.lst hexdump.mod: pre-hexdump.o mod-hexdump.o -rm -f $@ - $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-hexdump.o: $(hexdump_mod_DEPENDENCIES) hexdump_mod-commands_hexdump.o @@ -2956,7 +2956,7 @@ UNDSYMFILES += und-read.lst read.mod: pre-read.o mod-read.o -rm -f $@ - $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-read.o: $(read_mod_DEPENDENCIES) read_mod-commands_read.o @@ -3012,7 +3012,7 @@ UNDSYMFILES += und-sleep.lst sleep.mod: pre-sleep.o mod-sleep.o -rm -f $@ - $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-sleep.o: $(sleep_mod_DEPENDENCIES) sleep_mod-commands_sleep.o @@ -3068,7 +3068,7 @@ UNDSYMFILES += und-loadenv.lst loadenv.mod: pre-loadenv.o mod-loadenv.o -rm -f $@ - $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-loadenv.o: $(loadenv_mod_DEPENDENCIES) loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o @@ -3146,7 +3146,7 @@ UNDSYMFILES += und-elf.lst elf.mod: pre-elf.o mod-elf.o -rm -f $@ - $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-elf.o: $(elf_mod_DEPENDENCIES) elf_mod-kern_elf.o @@ -3202,7 +3202,7 @@ UNDSYMFILES += und-gzio.lst gzio.mod: pre-gzio.o mod-gzio.o -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 4d280451e..20cf62241 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -137,7 +137,7 @@ UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o @@ -649,7 +649,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o @@ -972,7 +972,7 @@ UNDSYMFILES += und-_chain.lst _chain.mod: pre-_chain.o mod-_chain.o -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o @@ -1028,7 +1028,7 @@ UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o @@ -1084,7 +1084,7 @@ UNDSYMFILES += und-_linux.lst _linux.mod: pre-_linux.o mod-_linux.o -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o @@ -1140,7 +1140,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux_normal.o @@ -1196,7 +1196,7 @@ UNDSYMFILES += und-cpuid.lst cpuid.mod: pre-cpuid.o mod-cpuid.o -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o @@ -1252,7 +1252,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o @@ -1308,7 +1308,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index a51fe14bb..93ebab291 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -602,7 +602,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o @@ -927,7 +927,7 @@ UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o @@ -1021,7 +1021,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o @@ -1077,7 +1077,7 @@ UNDSYMFILES += und-aout.lst aout.mod: pre-aout.o mod-aout.o -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o @@ -1133,7 +1133,7 @@ UNDSYMFILES += und-suspend.lst suspend.mod: pre-suspend.o mod-suspend.o -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o @@ -1189,7 +1189,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o @@ -1245,7 +1245,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o @@ -1301,7 +1301,7 @@ UNDSYMFILES += und-cpuid.lst cpuid.mod: pre-cpuid.o mod-cpuid.o -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o @@ -1357,7 +1357,7 @@ UNDSYMFILES += und-serial.lst serial.mod: pre-serial.o mod-serial.o -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o @@ -1413,7 +1413,7 @@ UNDSYMFILES += und-_linux.lst _linux.mod: pre-_linux.o mod-_linux.o -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_ieee1275_linux.o @@ -1469,7 +1469,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_ieee1275_linux_normal.o @@ -1525,7 +1525,7 @@ UNDSYMFILES += und-nand.lst nand.mod: pre-nand.o mod-nand.o -rm -f $@ - $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-nand.o: $(nand_mod_DEPENDENCIES) nand_mod-disk_ieee1275_nand.o diff --git a/conf/i386-linuxbios.mk b/conf/i386-linuxbios.mk index 19e5eb671..c6ac9c76c 100644 --- a/conf/i386-linuxbios.mk +++ b/conf/i386-linuxbios.mk @@ -564,7 +564,7 @@ UNDSYMFILES += und-_linux.lst _linux.mod: pre-_linux.o mod-_linux.o -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_pc_linux.o @@ -620,7 +620,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux_normal.o @@ -680,7 +680,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o @@ -1003,7 +1003,7 @@ UNDSYMFILES += und-serial.lst serial.mod: pre-serial.o mod-serial.o -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o @@ -1062,7 +1062,7 @@ UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o @@ -1175,7 +1175,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o @@ -1231,7 +1231,7 @@ UNDSYMFILES += und-aout.lst aout.mod: pre-aout.o mod-aout.o -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o @@ -1287,7 +1287,7 @@ UNDSYMFILES += und-play.lst play.mod: pre-play.o mod-play.o -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o @@ -1343,7 +1343,7 @@ UNDSYMFILES += und-cpuid.lst cpuid.mod: pre-cpuid.o mod-cpuid.o -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o @@ -1399,7 +1399,7 @@ UNDSYMFILES += und-ata.lst ata.mod: pre-ata.o mod-ata.o -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 37e08bcb6..c58242059 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -857,7 +857,7 @@ UNDSYMFILES += und-biosdisk.lst biosdisk.mod: pre-biosdisk.o mod-biosdisk.o -rm -f $@ - $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-biosdisk.o: $(biosdisk_mod_DEPENDENCIES) biosdisk_mod-disk_i386_pc_biosdisk.o @@ -913,7 +913,7 @@ UNDSYMFILES += und-_chain.lst _chain.mod: pre-_chain.o mod-_chain.o -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_i386_pc_chainloader.o @@ -969,7 +969,7 @@ UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_i386_pc_chainloader_normal.o @@ -1025,7 +1025,7 @@ UNDSYMFILES += und-_linux.lst _linux.mod: pre-_linux.o mod-_linux.o -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_pc_linux.o @@ -1081,7 +1081,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux_normal.o @@ -1142,7 +1142,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o @@ -1465,7 +1465,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o @@ -1521,7 +1521,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_i386_pc_halt.o @@ -1577,7 +1577,7 @@ UNDSYMFILES += und-serial.lst serial.mod: pre-serial.o mod-serial.o -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o @@ -1636,7 +1636,7 @@ UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o @@ -1749,7 +1749,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o @@ -1806,7 +1806,7 @@ UNDSYMFILES += und-vbe.lst vbe.mod: pre-vbe.o mod-vbe.o -rm -f $@ - $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-vbe.o: $(vbe_mod_DEPENDENCIES) vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o vbe_mod-video_i386_pc_vbeutil.o @@ -1919,7 +1919,7 @@ UNDSYMFILES += und-vbeinfo.lst vbeinfo.mod: pre-vbeinfo.o mod-vbeinfo.o -rm -f $@ - $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-vbeinfo.o: $(vbeinfo_mod_DEPENDENCIES) vbeinfo_mod-commands_i386_pc_vbeinfo.o @@ -1975,7 +1975,7 @@ UNDSYMFILES += und-vbetest.lst vbetest.mod: pre-vbetest.o mod-vbetest.o -rm -f $@ - $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-vbetest.o: $(vbetest_mod_DEPENDENCIES) vbetest_mod-commands_i386_pc_vbetest.o @@ -2031,7 +2031,7 @@ UNDSYMFILES += und-play.lst play.mod: pre-play.o mod-play.o -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o @@ -2087,7 +2087,7 @@ UNDSYMFILES += und-video.lst video.mod: pre-video.o mod-video.o -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o @@ -2143,7 +2143,7 @@ UNDSYMFILES += und-gfxterm.lst gfxterm.mod: pre-gfxterm.o mod-gfxterm.o -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o @@ -2199,7 +2199,7 @@ UNDSYMFILES += und-videotest.lst videotest.mod: pre-videotest.o mod-videotest.o -rm -f $@ - $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-videotest.o: $(videotest_mod_DEPENDENCIES) videotest_mod-commands_videotest.o @@ -2255,7 +2255,7 @@ UNDSYMFILES += und-bitmap.lst bitmap.mod: pre-bitmap.o mod-bitmap.o -rm -f $@ - $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-bitmap.o: $(bitmap_mod_DEPENDENCIES) bitmap_mod-video_bitmap.o @@ -2311,7 +2311,7 @@ UNDSYMFILES += und-tga.lst tga.mod: pre-tga.o mod-tga.o -rm -f $@ - $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-tga.o: $(tga_mod_DEPENDENCIES) tga_mod-video_readers_tga.o @@ -2367,7 +2367,7 @@ UNDSYMFILES += und-cpuid.lst cpuid.mod: pre-cpuid.o mod-cpuid.o -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o @@ -2423,7 +2423,7 @@ UNDSYMFILES += und-ata.lst ata.mod: pre-ata.o mod-ata.o -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o @@ -2479,7 +2479,7 @@ UNDSYMFILES += und-vga.lst vga.mod: pre-vga.o mod-vga.o -rm -f $@ - $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-vga.o: $(vga_mod_DEPENDENCIES) vga_mod-term_i386_pc_vga.o @@ -2535,7 +2535,7 @@ UNDSYMFILES += und-memdisk.lst memdisk.mod: pre-memdisk.o mod-memdisk.o -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o @@ -2591,7 +2591,7 @@ UNDSYMFILES += und-jpeg.lst jpeg.mod: pre-jpeg.o mod-jpeg.o -rm -f $@ - $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-jpeg.o: $(jpeg_mod_DEPENDENCIES) jpeg_mod-video_readers_jpeg.o @@ -2647,7 +2647,7 @@ UNDSYMFILES += und-png.lst png.mod: pre-png.o mod-png.o -rm -f $@ - $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-png.o: $(png_mod_DEPENDENCIES) png_mod-video_readers_png.o @@ -2703,7 +2703,7 @@ UNDSYMFILES += und-pci.lst pci.mod: pre-pci.o mod-pci.o -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o @@ -2759,7 +2759,7 @@ UNDSYMFILES += und-lspci.lst lspci.mod: pre-lspci.o mod-lspci.o -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o @@ -2815,7 +2815,7 @@ UNDSYMFILES += und-aout.lst aout.mod: pre-aout.o mod-aout.o -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o @@ -2871,7 +2871,7 @@ UNDSYMFILES += und-_bsd.lst _bsd.mod: pre-_bsd.o mod-_bsd.o -rm -f $@ - $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_bsd.o: $(_bsd_mod_DEPENDENCIES) _bsd_mod-loader_i386_bsd.o @@ -2927,7 +2927,7 @@ UNDSYMFILES += und-bsd.lst bsd.mod: pre-bsd.o mod-bsd.o -rm -f $@ - $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-bsd.o: $(bsd_mod_DEPENDENCIES) bsd_mod-loader_i386_bsd_normal.o diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 748d8fd40..a5b6be010 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -592,7 +592,7 @@ UNDSYMFILES += und-_linux.lst _linux.mod: pre-_linux.o mod-_linux.o -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_powerpc_ieee1275_linux.o @@ -648,7 +648,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_powerpc_ieee1275_linux_normal.o @@ -708,7 +708,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o normal_mod-normal_color.o @@ -1031,7 +1031,7 @@ UNDSYMFILES += und-suspend.lst suspend.mod: pre-suspend.o mod-suspend.o -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o @@ -1087,7 +1087,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o @@ -1143,7 +1143,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o @@ -1201,7 +1201,7 @@ UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o @@ -1295,7 +1295,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index bb7f52c49..6939a33a4 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -198,7 +198,7 @@ UNDSYMFILES += und-fshelp.lst fshelp.mod: pre-fshelp.o mod-fshelp.o -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o @@ -254,7 +254,7 @@ UNDSYMFILES += und-fat.lst fat.mod: pre-fat.o mod-fat.o -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o @@ -310,7 +310,7 @@ UNDSYMFILES += und-ext2.lst ext2.mod: pre-ext2.o mod-ext2.o -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o @@ -366,7 +366,7 @@ UNDSYMFILES += und-ufs.lst ufs.mod: pre-ufs.o mod-ufs.o -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o @@ -422,7 +422,7 @@ UNDSYMFILES += und-minix.lst minix.mod: pre-minix.o mod-minix.o -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o @@ -478,7 +478,7 @@ UNDSYMFILES += und-hfs.lst hfs.mod: pre-hfs.o mod-hfs.o -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o @@ -534,7 +534,7 @@ UNDSYMFILES += und-jfs.lst jfs.mod: pre-jfs.o mod-jfs.o -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o @@ -595,7 +595,7 @@ UNDSYMFILES += und-xfs.lst xfs.mod: pre-xfs.o mod-xfs.o -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o @@ -651,7 +651,7 @@ UNDSYMFILES += und-affs.lst affs.mod: pre-affs.o mod-affs.o -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o @@ -707,7 +707,7 @@ UNDSYMFILES += und-sfs.lst sfs.mod: pre-sfs.o mod-sfs.o -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o @@ -778,7 +778,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o @@ -1082,7 +1082,7 @@ UNDSYMFILES += und-hello.lst hello.mod: pre-hello.o mod-hello.o -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o @@ -1138,7 +1138,7 @@ UNDSYMFILES += und-boot.lst boot.mod: pre-boot.o mod-boot.o -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o @@ -1194,7 +1194,7 @@ UNDSYMFILES += und-terminal.lst terminal.mod: pre-terminal.o mod-terminal.o -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o @@ -1250,7 +1250,7 @@ UNDSYMFILES += und-ls.lst ls.mod: pre-ls.o mod-ls.o -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o @@ -1306,7 +1306,7 @@ UNDSYMFILES += und-cmp.lst cmp.mod: pre-cmp.o mod-cmp.o -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o @@ -1362,7 +1362,7 @@ UNDSYMFILES += und-cat.lst cat.mod: pre-cat.o mod-cat.o -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o @@ -1418,7 +1418,7 @@ UNDSYMFILES += und-font.lst font.mod: pre-font.o mod-font.o -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o @@ -1474,7 +1474,7 @@ UNDSYMFILES += und-amiga.lst amiga.mod: pre-amiga.o mod-amiga.o -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o @@ -1530,7 +1530,7 @@ UNDSYMFILES += und-apple.lst apple.mod: pre-apple.o mod-apple.o -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o @@ -1586,7 +1586,7 @@ UNDSYMFILES += und-pc.lst pc.mod: pre-pc.o mod-pc.o -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o @@ -1642,7 +1642,7 @@ UNDSYMFILES += und-sun.lst sun.mod: pre-sun.o mod-sun.o -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o @@ -1698,7 +1698,7 @@ UNDSYMFILES += und-acorn.lst acorn.mod: pre-acorn.o mod-acorn.o -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o @@ -1753,7 +1753,7 @@ UNDSYMFILES += und-loopback.lst loopback.mod: pre-loopback.o mod-loopback.o -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o @@ -1809,7 +1809,7 @@ UNDSYMFILES += und-suspend.lst suspend.mod: pre-suspend.o mod-suspend.o -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o @@ -1865,7 +1865,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o @@ -1921,7 +1921,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o @@ -1977,7 +1977,7 @@ UNDSYMFILES += und-help.lst help.mod: pre-help.o mod-help.o -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o @@ -2043,7 +2043,7 @@ UNDSYMFILES += und-configfile.lst configfile.mod: pre-configfile.o mod-configfile.o -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configfile.o @@ -2099,7 +2099,7 @@ UNDSYMFILES += und-search.lst search.mod: pre-search.o mod-search.o -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o @@ -2155,7 +2155,7 @@ UNDSYMFILES += und-gzio.lst gzio.mod: pre-gzio.o mod-gzio.o -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o diff --git a/configure b/configure index 1f44d1900..b4d028044 100644 --- a/configure +++ b/configure @@ -694,6 +694,7 @@ NM TARGET_CFLAGS TARGET_CPPFLAGS TARGET_LDFLAGS +MODULE_LDFLAGS LIBCURSES enable_grub_emu enable_grub_fstest @@ -6723,6 +6724,7 @@ fi + # Set them to their new values for the tests below. CC="$TARGET_CC" CFLAGS="$TARGET_CFLAGS" @@ -6801,6 +6803,67 @@ echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binu { (exit 1); exit 1; }; } fi +{ echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 +echo $ECHO_N "checking whether linker accepts --build-id=none... $ECHO_C" >&6; } +if test "${grub_cv_prog_ld_build_id_none+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + save_LDFLAGS="$LDFLAGS" +LDFLAGS="$LDFLAGS -Wl,--build-id=none" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + grub_cv_prog_ld_build_id_none=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + grub_cv_prog_ld_build_id_none=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LDFLAGS="$save_LDFLAGS" + +fi + +{ echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 +echo "${ECHO_T}$grub_cv_prog_ld_build_id_none" >&6; } + +if test "x$grub_cv_prog_ld_build_id_none" = xyes; then + MODULE_LDFLAGS="$MODULE_LDFLAGS -Wl,--build-id=none" +fi + { echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } @@ -8851,6 +8914,7 @@ NM!$NM$ac_delim TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim +MODULE_LDFLAGS!$MODULE_LDFLAGS$ac_delim LIBCURSES!$LIBCURSES$ac_delim enable_grub_emu!$enable_grub_emu$ac_delim enable_grub_fstest!$enable_grub_fstest$ac_delim @@ -8858,7 +8922,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 84; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 5ec7a47de..18049db50 100644 --- a/configure.ac +++ b/configure.ac @@ -253,6 +253,7 @@ fi AC_SUBST(TARGET_CFLAGS) AC_SUBST(TARGET_CPPFLAGS) AC_SUBST(TARGET_LDFLAGS) +AC_SUBST(MODULE_LDFLAGS) # Set them to their new values for the tests below. CC="$TARGET_CC" @@ -262,6 +263,7 @@ LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. grub_PROG_OBJCOPY_ABSOLUTE +grub_PROG_LD_BUILD_ID_NONE grub_ASM_USCORE if test "x$target_cpu" = xi386; then grub_CHECK_START_SYMBOL diff --git a/genmk.rb b/genmk.rb index a2179fab5..56dee5c93 100644 --- a/genmk.rb +++ b/genmk.rb @@ -114,7 +114,7 @@ UNDSYMFILES += #{undsym} #{@name}: #{pre_obj} #{mod_obj} -rm -f $@ - $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ #{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str} From 08d3ef095f8225ddbd435374e05ceeed98bd0536 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 19:11:26 +0000 Subject: [PATCH 0217/1707] 2008-07-02 Pavel Roskin * util/grub-editenv.c (cmd_info): Fix warning in printf format. --- ChangeLog | 2 ++ util/grub-editenv.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index da1591f0f..c5f1ffadc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-07-02 Pavel Roskin + * util/grub-editenv.c (cmd_info): Fix warning in printf format. + * Makefile.in (MODULE_LDFLAGS): New variable. * aclocal.m4 (grub_PROG_LD_BUILD_ID_NONE): New macro. Check if the linker accepts --build-id=none. diff --git a/util/grub-editenv.c b/util/grub-editenv.c index b2b2d679b..3d06adf50 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -141,7 +141,7 @@ open_envblk_file (char *name) static void cmd_info (void) { - printf ("Envblk offset: %d\n", envblk->data - buffer); + printf ("Envblk offset: %ld\n", envblk->data - buffer); printf ("Envblk length: %d\n", envblk->length); } From a377d1896004cf46ece8105fa7c4c55a9d5655e2 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 19:14:55 +0000 Subject: [PATCH 0218/1707] Add grub-editenv to ignored files git-svn-id: svn://svn.savannah.gnu.org/grub/trunk/grub2@1674 d0de0278-0dc1-4c01-8a07-af38b3205e46 From d3ab74c94d69cd5e8b9fe8c3529129de7fae9501 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 19:16:49 +0000 Subject: [PATCH 0219/1707] Ignore "cpu" and "machine" symlinks git-svn-id: svn://svn.savannah.gnu.org/grub/trunk/grub2@1675 d0de0278-0dc1-4c01-8a07-af38b3205e46 From 00c7a56aeb87ddd07847c7f42cbf8891f1f55d6e Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 19:22:35 +0000 Subject: [PATCH 0220/1707] 2008-07-02 Pavel Roskin * loader/aout.c (grub_aout_load): Cast load_addr to pointer explicitly to fix a warning. --- ChangeLog | 3 +++ loader/aout.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c5f1ffadc..0de66f3c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-02 Pavel Roskin + * loader/aout.c (grub_aout_load): Cast load_addr to pointer + explicitly to fix a warning. + * util/grub-editenv.c (cmd_info): Fix warning in printf format. * Makefile.in (MODULE_LDFLAGS): New variable. diff --git a/loader/aout.c b/loader/aout.c index 2677e50e4..58b399204 100644 --- a/loader/aout.c +++ b/loader/aout.c @@ -55,7 +55,7 @@ grub_aout_load (grub_file_t file, int offset, return grub_errno; if (bss_end_addr) - grub_memset (load_addr + load_size, 0, + grub_memset ((char *) load_addr + load_size, 0, bss_end_addr - load_addr - load_size); return GRUB_ERR_NONE; From ce8d1766c2aa9a8a3b1320a29701da53a111c093 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 19:30:56 +0000 Subject: [PATCH 0221/1707] 2008-07-02 Pavel Roskin * commands/hexdump.c (grub_cmd_hexdump): Fix misuse of grub_disk_addr_t for memory addresses. --- ChangeLog | 3 +++ commands/hexdump.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0de66f3c7..611e84102 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-02 Pavel Roskin + * commands/hexdump.c (grub_cmd_hexdump): Fix misuse of + grub_disk_addr_t for memory addresses. + * loader/aout.c (grub_aout_load): Cast load_addr to pointer explicitly to fix a warning. diff --git a/commands/hexdump.c b/commands/hexdump.c index c9aa441e1..c340638a8 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -85,7 +85,7 @@ grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) { char buf[GRUB_DISK_SECTOR_SIZE * 4]; grub_ssize_t size, length; - grub_disk_addr_t skip; + grub_addr_t skip; int namelen; if (argc != 1) From ca62e5986f5cb5b7e0e6dec5eb559ebd3d387cc1 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 19:37:09 +0000 Subject: [PATCH 0222/1707] 2008-07-02 Pavel Roskin * fs/reiserfs.c: Remove #warning, TODO list items don't belong there. Real unexpected warnings should not drown in the noise about known problems. --- ChangeLog | 4 ++++ fs/reiserfs.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 611e84102..6ab260681 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-02 Pavel Roskin + * fs/reiserfs.c: Remove #warning, TODO list items don't belong + there. Real unexpected warnings should not drown in the noise + about known problems. + * commands/hexdump.c (grub_cmd_hexdump): Fix misuse of grub_disk_addr_t for memory addresses. diff --git a/fs/reiserfs.c b/fs/reiserfs.c index ea6e5e39b..58836647a 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -23,7 +23,6 @@ test tail packing & direct files validate partition label position */ -#warning "TODO : journal, tail packing (?)" #if 0 # define GRUB_REISERFS_DEBUG From c9c8e6063ff8838065b9b2fa185ffca8015d7045 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 20:02:54 +0000 Subject: [PATCH 0223/1707] 2008-07-02 Pavel Roskin * fs/reiserfs.c (grub_reiserfs_read): Fix misuse of grub_size_t for file offsets, use grub_off_t instead. Fix printf format warnings. --- ChangeLog | 4 ++++ fs/reiserfs.c | 17 ++++++++++------- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ab260681..7eee7f23c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-02 Pavel Roskin + * fs/reiserfs.c (grub_reiserfs_read): Fix misuse of grub_size_t + for file offsets, use grub_off_t instead. Fix printf format + warnings. + * fs/reiserfs.c: Remove #warning, TODO list items don't belong there. Real unexpected warnings should not drown in the noise about known problems. diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 58836647a..8e9114934 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -1079,7 +1079,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) grub_uint16_t item_size; grub_uint32_t *indirect_block_ptr = 0; grub_uint64_t current_key_offset = 1; - grub_size_t initial_position, current_position, final_position, length; + grub_off_t initial_position, current_position, final_position, length; grub_disk_addr_t block; grub_off_t offset; @@ -1094,9 +1094,11 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) current_position = 0; final_position = MIN (len + initial_position, file->size); grub_dprintf ("reiserfs", - "Reading from %d to %d (%d instead of requested %d)\n", - initial_position, final_position, - final_position - initial_position, len); + "Reading from %lld to %lld (%lld instead of requested %ld)\n", + (unsigned long long) initial_position, + (unsigned long long) final_position, + (unsigned long long) (final_position - initial_position), + (unsigned long) len); while (current_position < final_position) { grub_reiserfs_set_key_offset (&key, current_key_offset); @@ -1191,9 +1193,10 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) current_key_offset = current_position + 1; } - grub_dprintf("reiserfs", - "Have successfully read %d bytes (%d requested)\n", - current_position - initial_position, len); + grub_dprintf ("reiserfs", + "Have successfully read %lld bytes (%ld requested)\n", + (unsigned long long) (current_position - initial_position), + (unsigned long) len); return current_position - initial_position; /* switch (found.type) From b8fbce0ab9393d6850944ae95326bbbc62d9730b Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 20:18:51 +0000 Subject: [PATCH 0224/1707] 2008-07-02 Pavel Roskin * disk/memdisk.c (memdisk_addr): Make a pointer to fix warnings. (memdisk): Make memdisk_orig_addr a pointer. --- ChangeLog | 3 +++ disk/memdisk.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7eee7f23c..050ce284d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-02 Pavel Roskin + * disk/memdisk.c (memdisk_addr): Make a pointer to fix warnings. + (memdisk): Make memdisk_orig_addr a pointer. + * fs/reiserfs.c (grub_reiserfs_read): Fix misuse of grub_size_t for file offsets, use grub_off_t instead. Fix printf format warnings. diff --git a/disk/memdisk.c b/disk/memdisk.c index 840ef369c..d7f0670d1 100644 --- a/disk/memdisk.c +++ b/disk/memdisk.c @@ -25,7 +25,7 @@ #include #include -static grub_addr_t memdisk_addr; +static char *memdisk_addr; static grub_off_t memdisk_size = 0; static int @@ -82,13 +82,13 @@ static struct grub_disk_dev grub_memdisk_dev = GRUB_MOD_INIT(memdisk) { - grub_addr_t memdisk_orig_addr; + char *memdisk_orig_addr; memdisk_size = grub_arch_memdisk_size (); if (! memdisk_size) return; - memdisk_orig_addr = grub_arch_memdisk_addr (); + memdisk_orig_addr = (char *) grub_arch_memdisk_addr (); grub_dprintf ("memdisk", "Found memdisk image at %p\n", memdisk_orig_addr); memdisk_addr = grub_malloc (memdisk_size); From cbabfdd464501021118e515d87471b18e5bd7fb6 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 20:51:46 +0000 Subject: [PATCH 0225/1707] 2008-07-02 Pavel Roskin * util/grub-editenv.c (main): Be specific which parameter is missing. --- ChangeLog | 3 +++ util/grub-editenv.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 050ce284d..a613c6369 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-02 Pavel Roskin + * util/grub-editenv.c (main): Be specific which parameter is + missing. + * disk/memdisk.c (memdisk_addr): Make a pointer to fix warnings. (memdisk): Make memdisk_orig_addr a pointer. diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 3d06adf50..031b32633 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -226,9 +226,15 @@ main (int argc, char *argv[]) } /* Obtain PATH. */ + if (optind >= argc) + { + fprintf (stderr, "Filename not specified.\n"); + usage (1); + } + if (optind + 1 >= argc) { - fprintf (stderr, "Not enough parameter.\n"); + fprintf (stderr, "Command not specified.\n"); usage (1); } From 11e16b157b6092f1ffa181103e78875927ad9508 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 22:00:42 +0000 Subject: [PATCH 0226/1707] 2008-07-02 Pavel Roskin * util/grub-editenv.c (cmd_info): Cast argument to long explicitly. ptrdiff_t reduces to int on i386. --- ChangeLog | 3 +++ util/grub-editenv.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a613c6369..7618fe99b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-02 Pavel Roskin + * util/grub-editenv.c (cmd_info): Cast argument to long + explicitly. ptrdiff_t reduces to int on i386. + * util/grub-editenv.c (main): Be specific which parameter is missing. diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 031b32633..523e5c70e 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -141,7 +141,7 @@ open_envblk_file (char *name) static void cmd_info (void) { - printf ("Envblk offset: %ld\n", envblk->data - buffer); + printf ("Envblk offset: %ld\n", (long) (envblk->data - buffer)); printf ("Envblk length: %d\n", envblk->length); } From f707af4216e85f99333e404719ad44a248f55480 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 2 Jul 2008 23:58:06 +0000 Subject: [PATCH 0227/1707] 2008-07-02 Pavel Roskin * disk/ata.c (grub_ata_readwrite): Don't increment sector number for every read sector, we already increment it for the whole batch. This fixes reading more than 256 sectors at once. --- ChangeLog | 4 ++++ disk/ata.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7618fe99b..d4de5d0d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-02 Pavel Roskin + * disk/ata.c (grub_ata_readwrite): Don't increment sector number + for every read sector, we already increment it for the whole + batch. This fixes reading more than 256 sectors at once. + * util/grub-editenv.c (cmd_info): Cast argument to long explicitly. ptrdiff_t reduces to int on i386. diff --git a/disk/ata.c b/disk/ata.c index e75af9031..02c4b068a 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -525,7 +525,6 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, GRUB_DISK_SECTOR_SIZE)) return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); buf += GRUB_DISK_SECTOR_SIZE; - sector++; } } else From e43fc69027a997ef7a9b5b6e9dbe337782adb35f Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 3 Jul 2008 00:52:28 +0000 Subject: [PATCH 0228/1707] 2008-07-02 Pavel Roskin * boot/i386/pc/cdboot.S: Add _start entry to fix a linker warning. --- ChangeLog | 3 +++ boot/i386/pc/cdboot.S | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index d4de5d0d1..d2a7af460 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-02 Pavel Roskin + * boot/i386/pc/cdboot.S: Add _start entry to fix a linker + warning. + * disk/ata.c (grub_ata_readwrite): Don't increment sector number for every read sector, we already increment it for the whole batch. This fixes reading more than 256 sectors at once. diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S index 1709b8c89..02d4fce38 100644 --- a/boot/i386/pc/cdboot.S +++ b/boot/i386/pc/cdboot.S @@ -37,6 +37,7 @@ .globl start, _start start: +_start: call next next: From d93708738837cc8f7c8506b09980179b5933d4e3 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 3 Jul 2008 04:26:46 +0000 Subject: [PATCH 0229/1707] Remove svn:eol-style property for compatibility with Autoconf 2.62 generated configure, which uses bare carriage return to define ac_cr. From 277d0de997c691e706a5f99bd74b85927acfd988 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 3 Jul 2008 20:53:00 +0000 Subject: [PATCH 0230/1707] 2008-07-03 Pavel Roskin * disk/ata.c (grub_ata_pio_write): Check status before writing, like we do in grub_ata_pio_read(). (grub_ata_readwrite): Always write individual sectors. Fix the sector count for the remainder. (grub_ata_write): Enable writing to ATA devices. Correctly report error for ATAPI devices. --- ChangeLog | 9 +++++++++ disk/ata.c | 19 +++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d2a7af460..21925bc00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-03 Pavel Roskin + + * disk/ata.c (grub_ata_pio_write): Check status before writing, + like we do in grub_ata_pio_read(). + (grub_ata_readwrite): Always write individual sectors. Fix the + sector count for the remainder. + (grub_ata_write): Enable writing to ATA devices. Correctly + report error for ATAPI devices. + 2008-07-02 Pavel Roskin * boot/i386/pc/cdboot.S: Add _start entry to fix a linker diff --git a/disk/ata.c b/disk/ata.c index 02c4b068a..c9b049825 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -187,6 +187,9 @@ grub_ata_pio_write (struct grub_ata_device *dev, char *buf, grub_uint16_t *buf16 = (grub_uint16_t *) buf; unsigned int i; + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & 1) + return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); + /* Wait until the device is ready to write. */ grub_ata_wait_drq (dev); @@ -562,10 +565,9 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, /* Write sectors. */ grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd_write); grub_ata_wait (); - for (sect = 0; sect < batch; sect++) + for (sect = 0; sect < (size % batch); sect++) { - if (grub_ata_pio_write (dev, buf, - (size % batch) * GRUB_DISK_SECTOR_SIZE)) + if (grub_ata_pio_write (dev, buf, GRUB_DISK_SECTOR_SIZE)) return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); buf += GRUB_DISK_SECTOR_SIZE; } @@ -705,11 +707,12 @@ grub_ata_write (grub_disk_t disk, grub_size_t size, const char *buf) { -#if 1 - return GRUB_ERR_NOT_IMPLEMENTED_YET; -#else - return grub_ata_readwrite (disk, sector, size, (char *) buf, 1); -#endif + struct grub_ata_device *dev = (struct grub_ata_device *) disk->data; + + if (! dev->atapi) + return grub_ata_readwrite (disk, sector, size, (char *) buf, 1); + + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ATAPI write not supported"); } static struct grub_disk_dev grub_atadisk_dev = From 8516d2a8e122d1952b8b0265986d054e1eee02d3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 3 Jul 2008 22:56:43 +0000 Subject: [PATCH 0231/1707] 2008-07-04 Robert Millan This fixes a performance issue when pc & gpt partmap iterators didn't abort iteration even after our hook found what it was looking for (often causing expensive probes of non-existant drives). Some callers relied on previous buggy behaviour, since they would rise an error when their own hooks caused early abortion of its iteration. * kern/device.c (grub_device_open): Improve error message. * disk/lvm.c (grub_lvm_open): Likewise. * disk/raid.c (grub_raid_open): Likewise. * partmap/pc.c (pc_partition_map_iterate): Abort parent iteration when hook requests it, independently of grub_errno. (pc_partition_map_probe): Do not fail when find_func() caused early abortion of pc_partition_map_iterate(). * partmap/gpt.c (gpt_partition_map_iterate): Abort parent iteration when hook requests it, independently of grub_errno. (gpt_partition_map_probe): Do not fail when find_func() caused early abortion of gpt_partition_map_iterate(). * kern/partition.c (grub_partition_iterate): Abort parent iteration when hook requests it, independently of grub_errno. Do not fail when part_map_iterate_hook() caused early abortion of p->iterate(). * util/biosdisk.c (grub_util_biosdisk_get_grub_dev): Do not fail when grub_partition_iterate() returned with non-zero. --- ChangeLog | 31 +++++++++++++++++++++++++++++++ disk/lvm.c | 2 +- disk/raid.c | 2 +- kern/device.c | 2 +- kern/partition.c | 6 ++---- partmap/gpt.c | 5 +++-- partmap/pc.c | 7 ++++--- util/biosdisk.c | 3 ++- 8 files changed, 45 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 21925bc00..799a2e2d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2008-07-04 Robert Millan + + This fixes a performance issue when pc & gpt partmap iterators + didn't abort iteration even after our hook found what it was + looking for (often causing expensive probes of non-existant drives). + + Some callers relied on previous buggy behaviour, since they would + rise an error when their own hooks caused early abortion of its + iteration. + + * kern/device.c (grub_device_open): Improve error message. + * disk/lvm.c (grub_lvm_open): Likewise. + * disk/raid.c (grub_raid_open): Likewise. + + * partmap/pc.c (pc_partition_map_iterate): Abort parent iteration + when hook requests it, independently of grub_errno. + (pc_partition_map_probe): Do not fail when find_func() caused + early abortion of pc_partition_map_iterate(). + + * partmap/gpt.c (gpt_partition_map_iterate): Abort parent iteration + when hook requests it, independently of grub_errno. + (gpt_partition_map_probe): Do not fail when find_func() caused + early abortion of gpt_partition_map_iterate(). + + * kern/partition.c (grub_partition_iterate): Abort parent iteration + when hook requests it, independently of grub_errno. Do not fail when + part_map_iterate_hook() caused early abortion of p->iterate(). + + * util/biosdisk.c (grub_util_biosdisk_get_grub_dev): Do not fail + when grub_partition_iterate() returned with non-zero. + 2008-07-03 Pavel Roskin * disk/ata.c (grub_ata_pio_write): Check status before writing, diff --git a/disk/lvm.c b/disk/lvm.c index 997d15cd5..6a05caa75 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -95,7 +95,7 @@ grub_lvm_open (const char *name, grub_disk_t disk) } if (! lv) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown device"); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown LVM device %s", name); disk->has_partitions = 0; disk->id = lv->number; diff --git a/disk/raid.c b/disk/raid.c index b8a5e1210..a484fcf89 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -100,7 +100,7 @@ grub_raid_open (const char *name, grub_disk_t disk) } if (!array) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown device"); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown RAID device %s", name); disk->has_partitions = 1; disk->id = array->number; diff --git a/kern/device.c b/kern/device.c index a39fdcecb..1b5a77c00 100644 --- a/kern/device.c +++ b/kern/device.c @@ -50,7 +50,7 @@ grub_device_open (const char *name) disk = grub_disk_open (name); if (! disk) { - grub_error (GRUB_ERR_BAD_DEVICE, "unknown device"); + grub_error (GRUB_ERR_BAD_DEVICE, "unknown device %s", name); goto fail; } diff --git a/kern/partition.c b/kern/partition.c index b9a045775..cb0e4f7b8 100644 --- a/kern/partition.c +++ b/kern/partition.c @@ -103,12 +103,10 @@ grub_partition_iterate (struct grub_disk *disk, int part_map_iterate (const grub_partition_map_t p) { - grub_err_t err; - grub_dprintf ("partition", "Detecting %s...\n", p->name); - err = p->iterate (disk, part_map_iterate_hook); + p->iterate (disk, part_map_iterate_hook); - if (err != GRUB_ERR_NONE) + if (grub_errno != GRUB_ERR_NONE) { /* Continue to next partition map type. */ grub_dprintf ("partition", "%s detection failed.\n", p->name); diff --git a/partmap/gpt.c b/partmap/gpt.c index ddfde2ec9..683fcbace 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -103,7 +103,7 @@ gpt_partition_map_iterate (grub_disk_t disk, (unsigned long long) part.len); if (hook (disk, &part)) - return grub_errno; + return 1; } last_offset += grub_le_to_cpu32 (gpt.partentry_size); @@ -151,7 +151,8 @@ gpt_partition_map_probe (grub_disk_t disk, const char *str) return 0; } - if (gpt_partition_map_iterate (disk, find_func)) + gpt_partition_map_iterate (disk, find_func); + if (grub_errno) goto fail; return p; diff --git a/partmap/pc.c b/partmap/pc.c index 2fba45dbb..0aa1482a8 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -153,7 +153,7 @@ pc_partition_map_iterate (grub_disk_t disk, pcdata.dos_part++; if (hook (disk, &p)) - goto finish; + return 1; /* Check if this is a BSD partition. */ if (grub_pc_partition_is_bsd (e->type)) @@ -192,7 +192,7 @@ pc_partition_map_iterate (grub_disk_t disk, if (be->fs_type != GRUB_PC_PARTITION_BSD_TYPE_UNUSED) if (hook (disk, &p)) - goto finish; + return 1; } } } @@ -257,7 +257,8 @@ pc_partition_map_probe (grub_disk_t disk, const char *str) return 0; pcdata = p->data; - if (pc_partition_map_iterate (disk, find_func)) + pc_partition_map_iterate (disk, find_func); + if (grub_errno) goto fail; if (p->index < 0) diff --git a/util/biosdisk.c b/util/biosdisk.c index 65e5af0ad..1137e98fe 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -863,7 +863,8 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) if (! disk) return 0; - if (grub_partition_iterate (disk, find_partition) != GRUB_ERR_NONE) + grub_partition_iterate (disk, find_partition); + if (grub_errno != GRUB_ERR_NONE) { grub_disk_close (disk); return 0; From fdecb8fdbbdb6fe6d71ad13b3046f3c074d060f4 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 4 Jul 2008 01:53:52 +0000 Subject: [PATCH 0232/1707] 2008-07-04 Pavel Roskin * util/elf/grub-mkimage.c: Use GRUB_TARGET_SIZEOF_LONG instead of sizeof(long). This fixes PowerPC image generation on x86_64. --- ChangeLog | 5 +++++ util/elf/grub-mkimage.c | 15 ++++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 799a2e2d4..179dc2994 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-04 Pavel Roskin + + * util/elf/grub-mkimage.c: Use GRUB_TARGET_SIZEOF_LONG instead + of sizeof(long). This fixes PowerPC image generation on x86_64. + 2008-07-04 Robert Millan This fixes a performance issue when pc & gpt partmap iterators diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index 43c873e5f..239d3741d 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -88,7 +88,7 @@ load_note (Elf32_Phdr *phdr, FILE *out) /* Fill in the rest of the segment header. */ phdr->p_type = grub_host_to_target32 (PT_NOTE); phdr->p_flags = grub_host_to_target32 (PF_R); - phdr->p_align = grub_host_to_target32 (sizeof (long)); + phdr->p_align = grub_host_to_target32 (GRUB_TARGET_SIZEOF_LONG); phdr->p_vaddr = 0; phdr->p_paddr = 0; phdr->p_filesz = grub_host_to_target32 (note_size); @@ -150,7 +150,7 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, /* Fill in the rest of the segment header. */ phdr->p_type = grub_host_to_target32 (PT_LOAD); phdr->p_flags = grub_host_to_target32 (PF_R | PF_W | PF_X); - phdr->p_align = grub_host_to_target32 (sizeof (long)); + phdr->p_align = grub_host_to_target32 (GRUB_TARGET_SIZEOF_LONG); phdr->p_vaddr = grub_host_to_target32 (modbase); phdr->p_paddr = grub_host_to_target32 (modbase); phdr->p_filesz = grub_host_to_target32 (total_module_size); @@ -177,7 +177,7 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) grub_util_read_at (&ehdr, sizeof (ehdr), 0, in); - offset = ALIGN_UP (sizeof (ehdr), sizeof (long)); + offset = ALIGN_UP (sizeof (ehdr), GRUB_TARGET_SIZEOF_LONG); ehdr.e_phoff = grub_host_to_target32 (offset); phdr_size = (grub_target_to_host16 (ehdr.e_phentsize) * @@ -190,7 +190,7 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) phdr_size += grub_target_to_host16 (ehdr.e_phentsize); phdrs = xmalloc (phdr_size); - offset += ALIGN_UP (phdr_size, sizeof (long)); + offset += ALIGN_UP (phdr_size, GRUB_TARGET_SIZEOF_LONG); /* Copy all existing segments. */ for (i = 0; i < grub_target_to_host16 (ehdr.e_phnum); i++) @@ -224,7 +224,8 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) phdr->p_offset = grub_host_to_target32 (offset); grub_util_write_image_at (segment_img, grub_target_to_host32 (phdr->p_filesz), offset, out); - offset += ALIGN_UP (grub_target_to_host32 (phdr->p_filesz), sizeof (long)); + offset += ALIGN_UP (grub_target_to_host32 (phdr->p_filesz), + GRUB_TARGET_SIZEOF_LONG); free (segment_img); } @@ -242,7 +243,7 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) /* Fill in p_offset so the callees know where to write. */ phdr->p_offset = grub_host_to_target32 (ALIGN_UP (grub_util_get_fp_size (out), - sizeof (long))); + GRUB_TARGET_SIZEOF_LONG)); load_modules (modbase, phdr, dir, mods, out); } @@ -255,7 +256,7 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) /* Fill in p_offset so the callees know where to write. */ phdr->p_offset = grub_host_to_target32 (ALIGN_UP (grub_util_get_fp_size (out), - sizeof (long))); + GRUB_TARGET_SIZEOF_LONG)); load_note (phdr, out); } From 1759aa57d47b6d93334e058aab382ea44834d196 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 4 Jul 2008 02:12:54 +0000 Subject: [PATCH 0233/1707] 2008-07-04 Pavel Roskin * include/grub/misc.h (ALIGN_UP): Avoid unnecessary cast to a pointer, which can cause warnings. Support 64-bit addresses. --- ChangeLog | 3 +++ include/grub/misc.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 179dc2994..baed5558a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-04 Pavel Roskin + * include/grub/misc.h (ALIGN_UP): Avoid unnecessary cast to a + pointer, which can cause warnings. Support 64-bit addresses. + * util/elf/grub-mkimage.c: Use GRUB_TARGET_SIZEOF_LONG instead of sizeof(long). This fixes PowerPC image generation on x86_64. diff --git a/include/grub/misc.h b/include/grub/misc.h index 86bc456e4..3d89a6080 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -25,7 +25,7 @@ #include #include -#define ALIGN_UP(addr, align) ((long)((char *)addr + align - 1) & ~(align - 1)) +#define ALIGN_UP(addr, align) (((grub_uint64_t)addr + align - 1) & ~(align - 1)) #define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args); /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */ From af58ab3dbc2bc577e9232afae7933a359340587b Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 4 Jul 2008 03:01:55 +0000 Subject: [PATCH 0234/1707] 2008-07-04 Pavel Roskin * kern/ieee1275/init.c: Cast _start and _end to grub_addr_t to prevent warnings. --- ChangeLog | 3 +++ kern/ieee1275/init.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index baed5558a..f232e08fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-04 Pavel Roskin + * kern/ieee1275/init.c: Cast _start and _end to grub_addr_t to + prevent warnings. + * include/grub/misc.h (ALIGN_UP): Avoid unnecessary cast to a pointer, which can cause warnings. Support 64-bit addresses. diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index 26aca778e..efa7ca7ae 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -148,7 +148,7 @@ static void grub_claim_heap (void) as a safegard in case that doesn't happen. It does, however, not protect us from corrupting our module area, which extends up to a yet-undetermined region above _end. */ - if ((addr < _end) && ((addr + len) > _start)) + if ((addr < (grub_addr_t) _end) && ((addr + len) > (grub_addr_t) _start)) { grub_printf ("Warning: attempt to claim over our own code!\n"); len = 0; @@ -273,5 +273,5 @@ grub_get_rtc (void) grub_addr_t grub_arch_modules_addr (void) { - return ALIGN_UP(_end + GRUB_MOD_GAP, GRUB_MOD_ALIGN); + return ALIGN_UP((grub_addr_t) _end + GRUB_MOD_GAP, GRUB_MOD_ALIGN); } From bcd35b903dc73bde9e2dd968bd8b1195c39d1bec Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 4 Jul 2008 03:26:10 +0000 Subject: [PATCH 0235/1707] 2008-07-04 Pavel Roskin * kern/i386/linuxbios/init.c (grub_machine_init): Cast addr to grub_addr_t before casting it to the void pointer to fix a warning. Non-addressable regions are discarded earlier. (grub_arch_modules_addr): Cast _end to grub_addr_t. * kern/i386/linuxbios/table.c: Include grub/misc.h. (check_signature): Don't shadow table_header. (grub_linuxbios_table_iterate): Cast numeric constants to grub_linuxbios_table_header_t. * include/grub/i386/linuxbios/init.h: Add noreturn attribute to grub_stop(). --- ChangeLog | 11 +++++++++++ include/grub/i386/linuxbios/init.h | 2 +- kern/i386/linuxbios/init.c | 4 ++-- kern/i386/linuxbios/table.c | 11 +++++++---- 4 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f232e08fe..1724842a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,16 @@ 2008-07-04 Pavel Roskin + * kern/i386/linuxbios/init.c (grub_machine_init): Cast addr to + grub_addr_t before casting it to the void pointer to fix a + warning. Non-addressable regions are discarded earlier. + (grub_arch_modules_addr): Cast _end to grub_addr_t. + * kern/i386/linuxbios/table.c: Include grub/misc.h. + (check_signature): Don't shadow table_header. + (grub_linuxbios_table_iterate): Cast numeric constants to + grub_linuxbios_table_header_t. + * include/grub/i386/linuxbios/init.h: Add noreturn attribute to + grub_stop(). + * kern/ieee1275/init.c: Cast _start and _end to grub_addr_t to prevent warnings. diff --git a/include/grub/i386/linuxbios/init.h b/include/grub/i386/linuxbios/init.h index 85b896b06..e67007414 100644 --- a/include/grub/i386/linuxbios/init.h +++ b/include/grub/i386/linuxbios/init.h @@ -22,7 +22,7 @@ #include #include -void EXPORT_FUNC(grub_stop) (void); +void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn)); void EXPORT_FUNC(grub_stop_floppy) (void); #endif diff --git a/kern/i386/linuxbios/init.c b/kern/i386/linuxbios/init.c index 9a8a40877..362131129 100644 --- a/kern/i386/linuxbios/init.c +++ b/kern/i386/linuxbios/init.c @@ -140,7 +140,7 @@ grub_machine_init (void) quarter); } else - grub_mm_init_region ((void *) addr, (grub_size_t) size); + grub_mm_init_region ((void *) (grub_addr_t) addr, (grub_size_t) size); return 0; } @@ -168,5 +168,5 @@ grub_machine_fini (void) grub_addr_t grub_arch_modules_addr (void) { - return ALIGN_UP(_end, GRUB_MOD_ALIGN); + return ALIGN_UP((grub_addr_t) _end, GRUB_MOD_ALIGN); } diff --git a/kern/i386/linuxbios/table.c b/kern/i386/linuxbios/table.c index 1adab639a..dac89113a 100644 --- a/kern/i386/linuxbios/table.c +++ b/kern/i386/linuxbios/table.c @@ -19,6 +19,7 @@ #include #include #include +#include static grub_err_t grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t)) @@ -27,9 +28,9 @@ grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t)) grub_linuxbios_table_item_t table_item; auto int check_signature (grub_linuxbios_table_header_t); - int check_signature (grub_linuxbios_table_header_t table_header) + int check_signature (grub_linuxbios_table_header_t tbl_header) { - if (! grub_memcmp (table_header->signature, "LBIO", 4)) + if (! grub_memcmp (tbl_header->signature, "LBIO", 4)) return 1; return 0; @@ -37,11 +38,13 @@ grub_linuxbios_table_iterate (int (*hook) (grub_linuxbios_table_item_t)) /* Assuming table_header is aligned to its size (8 bytes). */ - for (table_header = 0x500; table_header < 0x1000; table_header++) + for (table_header = (grub_linuxbios_table_header_t) 0x500; + table_header < (grub_linuxbios_table_header_t) 0x1000; table_header++) if (check_signature (table_header)) goto signature_found; - for (table_header = 0xf0000; table_header < 0x100000; table_header++) + for (table_header = (grub_linuxbios_table_header_t) 0xf0000; + table_header < (grub_linuxbios_table_header_t) 0x100000; table_header++) if (check_signature (table_header)) goto signature_found; From 3e5581b0bfb79ae62045d15190fb120ad6a186f3 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 6 Jul 2008 00:57:36 +0000 Subject: [PATCH 0236/1707] 2008-07-05 Pavel Roskin * disk/ata.c: Use named constants for status bits. --- ChangeLog | 4 ++++ disk/ata.c | 21 +++++++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1724842a4..dfb9f3a4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-07-05 Pavel Roskin + + * disk/ata.c: Use named constants for status bits. + 2008-07-04 Pavel Roskin * kern/i386/linuxbios/init.c (grub_machine_init): Cast addr to diff --git a/disk/ata.c b/disk/ata.c index c9b049825..015e393a0 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -54,6 +54,15 @@ static const int grub_ata_ioaddress2[] = { 0x3f6, 0x376 }; #define GRUB_ATA_REG2_CONTROL 0 +#define GRUB_ATA_STATUS_ERR 0x01 +#define GRUB_ATA_STATUS_INDEX 0x02 +#define GRUB_ATA_STATUS_ECC 0x04 +#define GRUB_ATA_STATUS_DRQ 0x08 +#define GRUB_ATA_STATUS_SEEK 0x10 +#define GRUB_ATA_STATUS_WRERR 0x20 +#define GRUB_ATA_STATUS_READY 0x40 +#define GRUB_ATA_STATUS_BUSY 0x80 + enum grub_ata_commands { GRUB_ATA_CMD_READ_SECTORS = 0x20, @@ -129,13 +138,13 @@ grub_ata_regget2 (struct grub_ata_device *dev, int reg) static inline void grub_ata_wait_busy (struct grub_ata_device *dev) { - while ((grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & 0x80)); + while ((grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY)); } static inline void grub_ata_wait_drq (struct grub_ata_device *dev) { - while (! (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & 0x08)); + while (! (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_DRQ)); } static inline void @@ -164,7 +173,7 @@ grub_ata_pio_read (struct grub_ata_device *dev, char *buf, grub_uint16_t *buf16 = (grub_uint16_t *) buf; unsigned int i; - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & 1) + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); /* Wait until the data is available. */ @@ -174,7 +183,7 @@ grub_ata_pio_read (struct grub_ata_device *dev, char *buf, for (i = 0; i < size / 2; i++) buf16[i] = grub_le_to_cpu16 (grub_inw(dev->ioaddress + GRUB_ATA_REG_DATA)); - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & 1) + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); return 0; @@ -187,7 +196,7 @@ grub_ata_pio_write (struct grub_ata_device *dev, char *buf, grub_uint16_t *buf16 = (grub_uint16_t *) buf; unsigned int i; - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & 1) + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); /* Wait until the device is ready to write. */ @@ -197,7 +206,7 @@ grub_ata_pio_write (struct grub_ata_device *dev, char *buf, for (i = 0; i < size / 2; i++) grub_outw(grub_cpu_to_le16 (buf16[i]), dev->ioaddress + GRUB_ATA_REG_DATA); - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & 1) + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); return 0; From ea387a48e9932419b7b98c7b73fedc7263655412 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 6 Jul 2008 01:24:19 +0000 Subject: [PATCH 0237/1707] 2008-07-05 Pavel Roskin * disk/ata.c (grub_ata_dumpinfo): Don't output addressing and size for ATAPI devices, they are undefined. Output sector number in decimal form. --- ChangeLog | 4 ++++ disk/ata.c | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dfb9f3a4b..5bbb103b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-05 Pavel Roskin + * disk/ata.c (grub_ata_dumpinfo): Don't output addressing and + size for ATAPI devices, they are undefined. Output sector + number in decimal form. + * disk/ata.c: Use named constants for status bits. 2008-07-04 Pavel Roskin diff --git a/disk/ata.c b/disk/ata.c index 015e393a0..7925fb875 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -225,8 +225,11 @@ grub_ata_dumpinfo (struct grub_ata_device *dev, char *info) grub_ata_strncpy (text, info + 54, 40); grub_printf ("Model: %s\n", text); - grub_printf ("Addressing: %d\n", dev->addr); - grub_printf ("#sectors: 0x%llx\n", dev->size); + if (! dev->atapi) + { + grub_printf ("Addressing: %d\n", dev->addr); + grub_printf ("Sectors: %lld\n", dev->size); + } } static grub_err_t From 62a02d00d632d2e75422aa765cb94107e408b37a Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 7 Jul 2008 15:11:06 +0000 Subject: [PATCH 0238/1707] 2008-07-07 Pavel Roskin * boot/i386/pc/diskboot.S (notification_string): Replace "Loading kernel" with just "loading". This is shorter, less confusing and saves a few bytes for possible future changes. --- ChangeLog | 6 ++++++ boot/i386/pc/diskboot.S | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5bbb103b0..bc6987212 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-07 Pavel Roskin + + * boot/i386/pc/diskboot.S (notification_string): Replace + "Loading kernel" with just "loading". This is shorter, less + confusing and saves a few bytes for possible future changes. + 2008-07-05 Pavel Roskin * disk/ata.c (grub_ata_dumpinfo): Don't output addressing and diff --git a/boot/i386/pc/diskboot.S b/boot/i386/pc/diskboot.S index 724de62c9..95f87a035 100644 --- a/boot/i386/pc/diskboot.S +++ b/boot/i386/pc/diskboot.S @@ -326,7 +326,7 @@ general_error: /* go here when you need to stop the machine hard after an error condition */ stop: jmp stop -notification_string: .string "Loading kernel" +notification_string: .string "loading" notification_step: .string "." notification_done: .string "\r\n" From 947414b4b9935e1e8ddd3951ea31f9042adb76d9 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 11 Jul 2008 16:40:45 +0000 Subject: [PATCH 0239/1707] 2008-07-11 Pavel Roskin * term/i386/pc/serial.c (GRUB_SERIAL_PORT_NUM): New constant. [!GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Add COM2 and COM3. (serial_hw_get_port): Check validity of the port number. (grub_cmd_serial): Check return value of serial_hw_get_port(). --- ChangeLog | 7 +++++++ term/i386/pc/serial.c | 21 +++++++++++++-------- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc6987212..c80282e2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-11 Pavel Roskin + + * term/i386/pc/serial.c (GRUB_SERIAL_PORT_NUM): New constant. + [!GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Add COM2 and COM3. + (serial_hw_get_port): Check validity of the port number. + (grub_cmd_serial): Check return value of serial_hw_get_port(). + 2008-07-07 Pavel Roskin * boot/i386/pc/diskboot.S (notification_string): Replace diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 762d4e9c0..2d76ec1f8 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -67,15 +67,20 @@ static struct serial_port serial_settings; #ifdef GRUB_MACHINE_PCBIOS /* The BIOS data area. */ static const unsigned short *serial_hw_io_addr = (const unsigned short *) 0x0400; +#define GRUB_SERIAL_PORT_NUM 4 #else -static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8 }; +static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; +#define GRUB_SERIAL_PORT_NUM (sizeof(serial_hw_io_addr)/(serial_hw_io_addr[0])) #endif /* Return the port number for the UNITth serial device. */ static inline unsigned short -serial_hw_get_port (const unsigned short unit) +serial_hw_get_port (const unsigned int unit) { - return serial_hw_io_addr[unit]; + if (unit < GRUB_SERIAL_PORT_NUM) + return serial_hw_io_addr[unit]; + else + return 0; } /* Fetch a key. */ @@ -490,14 +495,14 @@ grub_cmd_serial (struct grub_arg_list *state, { struct serial_port backup_settings = serial_settings; grub_err_t hwiniterr; - int arg; if (state[0].set) { - arg = grub_strtoul (state[0].arg, 0, 0); - if (arg >= 0 && arg < 4) - serial_settings.port = serial_hw_get_port ((int) arg); - else + unsigned int unit; + + unit = grub_strtoul (state[0].arg, 0, 0); + serial_settings.port = serial_hw_get_port (unit); + if (!serial_settings.port) return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad unit number."); } From 0059cf6fdd750be9e6a2cca67155bfcd5b401906 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 11 Jul 2008 17:35:06 +0000 Subject: [PATCH 0240/1707] 2008-07-11 Pavel Roskin * commands/read.c (grub_getline): Fix invalid memory access. Don't add newline to the variable value. --- ChangeLog | 3 +++ commands/read.c | 13 +++++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c80282e2c..f1790926f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-11 Pavel Roskin + * commands/read.c (grub_getline): Fix invalid memory access. + Don't add newline to the variable value. + * term/i386/pc/serial.c (GRUB_SERIAL_PORT_NUM): New constant. [!GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Add COM2 and COM3. (serial_hw_get_port): Check validity of the port number. diff --git a/commands/read.c b/commands/read.c index 19959183d..4aa4f7633 100644 --- a/commands/read.c +++ b/commands/read.c @@ -30,17 +30,22 @@ grub_getline (void) int i; char *line; char *tmp; + char c; i = 0; line = grub_malloc (1 + i + sizeof('\0')); if (! line) return NULL; - while ((line[i - 1] != '\n') && (line[i - 1] != '\r')) + while (1) { - line[i] = grub_getkey (); - if (grub_isprint (line[i])) - grub_putchar (line[i]); + c = grub_getkey (); + if ((c == '\n') || (c == '\r')) + break; + + line[i] = c; + if (grub_isprint (c)) + grub_putchar (c); i++; tmp = grub_realloc (line, 1 + i + sizeof('\0')); if (! tmp) From d49a4cf6a7cdcfbe005d0e9ee5bbbd858d5ad316 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 11 Jul 2008 20:09:14 +0000 Subject: [PATCH 0241/1707] 2008-07-11 Robert Millan * util/grub.d/40_custom.in: New file. Example on how to add custom entries to /etc/grub.d. * conf/common.rmk (%, update-grub_SCRIPTS, CLEANFILES): Install 40_custom (implicitly, by merging all the grub.d rules). --- ChangeLog | 7 +++++++ DISTLIST | 1 + conf/common.mk | 24 +++--------------------- conf/common.rmk | 24 +++--------------------- util/grub.d/40_custom.in | 3 +++ 5 files changed, 17 insertions(+), 42 deletions(-) create mode 100644 util/grub.d/40_custom.in diff --git a/ChangeLog b/ChangeLog index f1790926f..aa5d3f2cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-11 Robert Millan + + * util/grub.d/40_custom.in: New file. Example on how to add custom + entries to /etc/grub.d. + * conf/common.rmk (%, update-grub_SCRIPTS, CLEANFILES): Install + 40_custom (implicitly, by merging all the grub.d rules). + 2008-07-11 Pavel Roskin * commands/read.c (grub_getline): Fix invalid memory access. diff --git a/DISTLIST b/DISTLIST index 7b9598cde..d5eb64540 100644 --- a/DISTLIST +++ b/DISTLIST @@ -327,6 +327,7 @@ util/grub.d/00_header.in util/grub.d/10_hurd.in util/grub.d/10_linux.in util/grub.d/30_os-prober.in +util/grub.d/40_custom.in util/grub.d/README util/grub-emu.c util/grub-mkdevicemap.c diff --git a/conf/common.mk b/conf/common.mk index 0cfa37d9b..9943d6d06 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -470,29 +470,11 @@ update-grub_lib: util/update-grub_lib.in config.status lib_DATA += update-grub_lib CLEANFILES += update-grub_lib -00_header: util/grub.d/00_header.in config.status +%: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS += 00_header -CLEANFILES += 00_header - -10_linux: util/grub.d/10_linux.in config.status - ./config.status --file=$@:$< - chmod +x $@ -update-grub_SCRIPTS += 10_linux -CLEANFILES += 10_linux - -10_hurd: util/grub.d/10_hurd.in config.status - ./config.status --file=$@:$< - chmod +x $@ -update-grub_SCRIPTS += 10_hurd -CLEANFILES += 10_hurd - -30_os-prober: util/grub.d/30_os-prober.in config.status - ./config.status --file=$@:$< - chmod +x $@ -update-grub_SCRIPTS += 30_os-prober -CLEANFILES += 30_os-prober +update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +CLEANFILES += $(update-grub_SCRIPTS) update-grub_DATA += util/grub.d/README diff --git a/conf/common.rmk b/conf/common.rmk index ecb8e040b..b403b0437 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -112,29 +112,11 @@ update-grub_lib: util/update-grub_lib.in config.status lib_DATA += update-grub_lib CLEANFILES += update-grub_lib -00_header: util/grub.d/00_header.in config.status +%: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS += 00_header -CLEANFILES += 00_header - -10_linux: util/grub.d/10_linux.in config.status - ./config.status --file=$@:$< - chmod +x $@ -update-grub_SCRIPTS += 10_linux -CLEANFILES += 10_linux - -10_hurd: util/grub.d/10_hurd.in config.status - ./config.status --file=$@:$< - chmod +x $@ -update-grub_SCRIPTS += 10_hurd -CLEANFILES += 10_hurd - -30_os-prober: util/grub.d/30_os-prober.in config.status - ./config.status --file=$@:$< - chmod +x $@ -update-grub_SCRIPTS += 30_os-prober -CLEANFILES += 30_os-prober +update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +CLEANFILES += $(update-grub_SCRIPTS) update-grub_DATA += util/grub.d/README diff --git a/util/grub.d/40_custom.in b/util/grub.d/40_custom.in new file mode 100644 index 000000000..e16d6e3d6 --- /dev/null +++ b/util/grub.d/40_custom.in @@ -0,0 +1,3 @@ +#!/bin/sh +exec tail -n +3 $0 +# This file is an example on how to add custom entries From 9a745147b809de83a16f163f10f66185ee097052 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 12 Jul 2008 15:40:50 +0000 Subject: [PATCH 0242/1707] 2008-07-12 Robert Millan * util/i386/pc/grub-mkrescue.in: s/grub-install/grub-mkrescue/g. --- ChangeLog | 4 ++++ util/i386/pc/grub-mkrescue.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index aa5d3f2cd..edab1b052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-07-12 Robert Millan + + * util/i386/pc/grub-mkrescue.in: s/grub-install/grub-mkrescue/g. + 2008-07-11 Robert Millan * util/grub.d/40_custom.in: New file. Example on how to add custom diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index b2d50c90b..83f4ee193 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -66,7 +66,7 @@ for option in "$@"; do usage exit 0 ;; -v | --version) - echo "grub-install (GNU GRUB ${PACKAGE_VERSION})" + echo "grub-mkrescue (GNU GRUB ${PACKAGE_VERSION})" exit 0 ;; --modules=*) modules=`echo "$option" | sed 's/--modules=//'` ;; From 4ae821ac9a28380dd6f2e665c38a6dd64fe50222 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 13 Jul 2008 01:13:12 +0000 Subject: [PATCH 0243/1707] 2008-07-13 Bean * fs/ext2.c (EXT4_EXTENTS_FLAG): New macro. (grub_ext4_extent_header): New structure. (grub_ext4_extent): Likewise. (grub_ext4_extent_idx): Likewise. (grub_ext4_find_leaf): New function. (grub_ext2_read_block): Handle extents. --- ChangeLog | 9 +++++ fs/ext2.c | 112 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 121 insertions(+) diff --git a/ChangeLog b/ChangeLog index edab1b052..9e3fdade3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-13 Bean + + * fs/ext2.c (EXT4_EXTENTS_FLAG): New macro. + (grub_ext4_extent_header): New structure. + (grub_ext4_extent): Likewise. + (grub_ext4_extent_idx): Likewise. + (grub_ext4_find_leaf): New function. + (grub_ext2_read_block): Handle extents. + 2008-07-12 Robert Millan * util/i386/pc/grub-mkrescue.in: s/grub-install/grub-mkrescue/g. diff --git a/fs/ext2.c b/fs/ext2.c index 22fd27293..7a002f56a 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -86,6 +86,8 @@ #define EXT3_JOURNAL_FLAG_DELETED 4 #define EXT3_JOURNAL_FLAG_LAST_TAG 8 +#define EXT4_EXTENTS_FLAG 0x80000 + /* The ext2 superblock. */ struct grub_ext2_sblock { @@ -226,6 +228,33 @@ struct grub_ext3_journal_sblock grub_uint32_t start; }; +#define EXT4_EXT_MAGIC 0xf30a + +struct grub_ext4_extent_header +{ + grub_uint16_t magic; + grub_uint16_t entries; + grub_uint16_t max; + grub_uint16_t depth; + grub_uint32_t generation; +}; + +struct grub_ext4_extent +{ + grub_uint32_t block; + grub_uint16_t len; + grub_uint16_t start_hi; + grub_uint32_t start; +}; + +struct grub_ext4_extent_idx +{ + grub_uint32_t block; + grub_uint32_t leaf; + grub_uint16_t leaf_hi; + grub_uint16_t unused; +}; + struct grub_fshelp_node { struct grub_ext2_data *data; @@ -262,6 +291,45 @@ grub_ext2_blockgroup (struct grub_ext2_data *data, int group, sizeof (struct grub_ext2_block_group), (char *) blkgrp); } +static struct grub_ext4_extent_header * +grub_ext4_find_leaf (struct grub_ext2_data *data, char *buf, + struct grub_ext4_extent_header *ext_block, + grub_uint32_t fileblock) +{ + struct grub_ext4_extent_idx *index; + + while (1) + { + int i; + grub_disk_addr_t block; + + index = (struct grub_ext4_extent_idx *) (ext_block + 1); + + if (grub_le_to_cpu16(ext_block->magic) != EXT4_EXT_MAGIC) + return 0; + + if (ext_block->depth == 0) + return ext_block; + + for (i = 0; i < grub_le_to_cpu16 (ext_block->entries); i++) + { + if (fileblock < grub_le_to_cpu32(index[i].block)) + break; + } + + if (--i < 0) + return 0; + + block = grub_le_to_cpu16 (index[i].leaf_hi); + block = (block << 32) + grub_le_to_cpu32 (index[i].leaf); + if (grub_disk_read (data->disk, + block << LOG2_EXT2_BLOCK_SIZE (data), + 0, EXT2_BLOCK_SIZE(data), buf)) + return 0; + + ext_block = (struct grub_ext4_extent_header *) buf; + } +} static grub_disk_addr_t grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) @@ -272,6 +340,50 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); + if (inode->flags & EXT4_EXTENTS_FLAG) + { + char buf[EXT2_BLOCK_SIZE(data)]; + struct grub_ext4_extent_header *leaf; + struct grub_ext4_extent *ext; + int i; + + leaf = grub_ext4_find_leaf (data, buf, + (struct grub_ext4_extent_header *) inode->blocks.dir_blocks, + fileblock); + if (! leaf) + { + grub_error (GRUB_ERR_BAD_FS, "invalid extent"); + return -1; + } + + ext = (struct grub_ext4_extent *) (leaf + 1); + for (i = 0; i < grub_le_to_cpu16 (leaf->entries); i++) + { + if (fileblock < grub_le_to_cpu32 (ext[i].block)) + break; + } + + if (--i >= 0) + { + fileblock -= grub_le_to_cpu32 (ext[i].block); + if (fileblock >= grub_le_to_cpu16 (ext[i].len)) + return 0; + else + { + grub_disk_addr_t start; + + start = grub_le_to_cpu16 (ext[i].start_hi); + start = (start << 32) + grub_le_to_cpu32 (ext[i].start); + + return fileblock + start; + } + } + else + { + grub_error (GRUB_ERR_BAD_FS, "something wrong with extent"); + return -1; + } + } /* Direct blocks. */ if (fileblock < INDIRECT_BLOCKS) blknr = grub_le_to_cpu32 (inode->blocks.dir_blocks[fileblock]); From aa24b516a2d81f922199a517c123e20f12152145 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 13 Jul 2008 01:55:15 +0000 Subject: [PATCH 0244/1707] 2008-07-13 Bean * Makefile.in (enable_lzo): New rule. * conf/i386-pc.rmk (grub_mkimage_SOURCES): New test with enable_lzo. * configure.ac (ENABLE_LZO): New option --enable-lzo. * boot/i386/pc/lnxboot.S: #include . * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): Change its value accordding to the compression algorithm used, lzo or lzma. * util/i386/pc/grub-mkimage.c (compress_kernel): Use different compression algorithm according to configure macro. * kern/i386/pc/startup.S (codestart): Likewise. * kern/i386/pc/lzma_decode.S: New file. * include/grub/lib/LzFind.h: Likewise. * include/grub/lib/LzHash.h: Likewise. * include/grub/lib/LzmaDec.h: Likewise. * include/grub/lib/LzmaEnc.h: Likewise. * include/grub/lib/LzmaTypes.h: Likewise. * lib/LzFind.c: Likewise. * lib/LzmaDec.c: Likewise. * lib/LzmaEnc.c: Likewise. --- ChangeLog | 36 + Makefile.in | 1 + boot/i386/pc/lnxboot.S | 1 + conf/i386-pc.mk | 33 +- conf/i386-pc.rmk | 7 +- config.h.in | 6 + configure | 36 +- configure.ac | 31 +- include/grub/i386/pc/kernel.h | 4 + include/grub/lib/LzFind.h | 130 ++ include/grub/lib/LzHash.h | 77 ++ include/grub/lib/LzmaDec.h | 246 ++++ include/grub/lib/LzmaEnc.h | 95 ++ include/grub/lib/LzmaTypes.h | 151 +++ kern/i386/pc/lzma_decode.S | 677 ++++++++++ kern/i386/pc/startup.S | 22 + lib/LzFind.c | 774 +++++++++++ lib/LzmaDec.c | 1035 +++++++++++++++ lib/LzmaEnc.c | 2353 +++++++++++++++++++++++++++++++++ util/i386/pc/grub-mkimage.c | 52 + 20 files changed, 5747 insertions(+), 20 deletions(-) create mode 100644 include/grub/lib/LzFind.h create mode 100644 include/grub/lib/LzHash.h create mode 100644 include/grub/lib/LzmaDec.h create mode 100644 include/grub/lib/LzmaEnc.h create mode 100644 include/grub/lib/LzmaTypes.h create mode 100644 kern/i386/pc/lzma_decode.S create mode 100644 lib/LzFind.c create mode 100644 lib/LzmaDec.c create mode 100644 lib/LzmaEnc.c diff --git a/ChangeLog b/ChangeLog index 9e3fdade3..055c39064 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2008-07-13 Bean + + * Makefile.in (enable_lzo): New rule. + + * conf/i386-pc.rmk (grub_mkimage_SOURCES): New test with enable_lzo. + + * configure.ac (ENABLE_LZO): New option --enable-lzo. + + * boot/i386/pc/lnxboot.S: #include . + + * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): Change + its value accordding to the compression algorithm used, lzo or lzma. + + * util/i386/pc/grub-mkimage.c (compress_kernel): Use different + compression algorithm according to configure macro. + + * kern/i386/pc/startup.S (codestart): Likewise. + + * kern/i386/pc/lzma_decode.S: New file. + + * include/grub/lib/LzFind.h: Likewise. + + * include/grub/lib/LzHash.h: Likewise. + + * include/grub/lib/LzmaDec.h: Likewise. + + * include/grub/lib/LzmaEnc.h: Likewise. + + * include/grub/lib/LzmaTypes.h: Likewise. + + * lib/LzFind.c: Likewise. + + * lib/LzmaDec.c: Likewise. + + * lib/LzmaEnc.c: Likewise. + 2008-07-13 Bean * fs/ext2.c (EXT4_EXTENTS_FLAG): New macro. diff --git a/Makefile.in b/Makefile.in index c25520333..768ebe01d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -88,6 +88,7 @@ UNIFONT_HEX = @UNIFONT_HEX@ # Options. enable_grub_emu = @enable_grub_emu@ enable_grub_fstest = @enable_grub_fstest@ +enable_lzo = @enable_lzo@ ### General variables. diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index 955cc419d..a8d056c50 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -17,6 +17,7 @@ * along with GRUB. If not, see . */ +#include #include #include #include diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index c58242059..6921b7fdc 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -226,6 +226,7 @@ sbin_UTILITIES += grub-emu endif # For grub-mkimage. +ifeq ($(enable_lzo), yes) grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c CLEANFILES += grub-mkimage grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o @@ -246,8 +247,38 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< -include grub_mkimage-util_resolve.d -grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) grub_mkimage_LDFLAGS = $(LIBLZO) +else +grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ + util/resolve.c lib/LzmaEnc.c lib/LzFind.c +CLEANFILES += grub-mkimage grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o +MOSTLYCLEANFILES += grub_mkimage-util_i386_pc_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub_mkimage-lib_LzmaEnc.d grub_mkimage-lib_LzFind.d + +grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o + $(CC) -o $@ grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) + +grub_mkimage-util_i386_pc_grub_mkimage.o: util/i386/pc/grub-mkimage.c $(util/i386/pc/grub-mkimage.c_DEPENDENCIES) + $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-util_i386_pc_grub_mkimage.d + +grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-util_misc.d + +grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-util_resolve.d + +grub_mkimage-lib_LzmaEnc.o: lib/LzmaEnc.c $(lib/LzmaEnc.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-lib_LzmaEnc.d + +grub_mkimage-lib_LzFind.o: lib/LzFind.c $(lib/LzFind.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-lib_LzFind.d + +endif +grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 7b7924fe2..b677a9621 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -72,10 +72,15 @@ sbin_UTILITIES += grub-emu endif # For grub-mkimage. +ifeq ($(enable_lzo), yes) grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c -grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) grub_mkimage_LDFLAGS = $(LIBLZO) +else +grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ + util/resolve.c lib/LzmaEnc.c lib/LzFind.c +endif +grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. diff --git a/config.h.in b/config.h.in index 1aef2123b..e2dd41f08 100644 --- a/config.h.in +++ b/config.h.in @@ -13,6 +13,12 @@ /* Define it to \"data32\" or \"data32;\" to make GAS happy */ #undef DATA32 +/* Use lzma compression */ +#undef ENABLE_LZMA + +/* Use lzo compression */ +#undef ENABLE_LZO + /* Define it to either end or _end */ #undef END_SYMBOL diff --git a/configure b/configure index b4d028044..80df8341e 100644 --- a/configure +++ b/configure @@ -686,6 +686,7 @@ CPP GREP EGREP LIBLZO +enable_lzo TARGET_CC ac_ct_TARGET_CC OBJCOPY @@ -1291,6 +1292,7 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files + --enable-lzo use lzo to compress kernel (default is lzma) --enable-mm-debug include memory manager debugging --enable-grub-emu build and install the `grub-emu' debugging utility --enable-grub-fstest build and install the `grub-fstest' debugging @@ -5299,9 +5301,20 @@ fi # Check LZO when compiling for the i386-pc. if test "$target_cpu"-"$platform" = i386-pc; then - # There are three possibilities. LZO version 2 installed with the name - # liblzo2, with the name liblzo, and LZO version 1. - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 + # Check whether --enable-lzo was given. +if test "${enable_lzo+set}" = set; then + enableval=$enable_lzo; +fi + + if [ x"$enable_lzo" = xyes ]; then + # There are three possibilities. LZO version 2 installed with the name + # liblzo2, with the name liblzo, and LZO version 1. + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_LZO 1 +_ACEOF + + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5503,8 +5516,8 @@ fi fi - LIBS="$LIBS $LIBLZO" - { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 + LIBS="$LIBS $LIBLZO" + { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5594,7 +5607,7 @@ echo "$as_me: error: LZO1X-999 must be enabled" >&2;} fi - # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h. + # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h. for ac_header in lzo/lzo1x.h lzo1x.h @@ -5741,6 +5754,14 @@ fi done + else + +cat >>confdefs.h <<\_ACEOF +#define ENABLE_LZMA 1 +_ACEOF + + fi + fi # Check for functions. @@ -8906,6 +8927,7 @@ CPP!$CPP$ac_delim GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LIBLZO!$LIBLZO$ac_delim +enable_lzo!$enable_lzo$ac_delim TARGET_CC!$TARGET_CC$ac_delim ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim OBJCOPY!$OBJCOPY$ac_delim @@ -8922,7 +8944,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 85; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 86; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 18049db50..ee932ca9a 100644 --- a/configure.ac +++ b/configure.ac @@ -143,19 +143,28 @@ fi # Check LZO when compiling for the i386-pc. if test "$target_cpu"-"$platform" = i386-pc; then - # There are three possibilities. LZO version 2 installed with the name - # liblzo2, with the name liblzo, and LZO version 1. - AC_CHECK_LIB(lzo2, __lzo_init_v2, [LIBLZO="-llzo2"], - AC_CHECK_LIB(lzo, __lzo_init_v2, [LIBLZO="-llzo"], - AC_CHECK_LIB(lzo, __lzo_init2, [LIBLZO="-llzo"], - AC_MSG_ERROR([LZO library version 1.02 or later is required])))) - AC_SUBST(LIBLZO) - LIBS="$LIBS $LIBLZO" - AC_CHECK_FUNC(lzo1x_999_compress, , + AC_ARG_ENABLE([lzo], + [AS_HELP_STRING([--enable-lzo], + [use lzo to compress kernel (default is lzma)])]) + [if [ x"$enable_lzo" = xyes ]; then + # There are three possibilities. LZO version 2 installed with the name + # liblzo2, with the name liblzo, and LZO version 1.] + AC_DEFINE([ENABLE_LZO], [1], [Use lzo compression]) + AC_CHECK_LIB([lzo2], [__lzo_init_v2], [LIBLZO="-llzo2"], + [AC_CHECK_LIB([lzo], [__lzo_init_v2], [LIBLZO="-llzo"], + [AC_CHECK_LIB([lzo], [__lzo_init2], [LIBLZO="-llzo"], + [AC_MSG_ERROR([LZO library version 1.02 or later is required])])])]) + AC_SUBST([LIBLZO]) + [LIBS="$LIBS $LIBLZO"] + AC_CHECK_FUNC([lzo1x_999_compress], , [AC_MSG_ERROR([LZO1X-999 must be enabled])]) - # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h. - AC_CHECK_HEADERS(lzo/lzo1x.h lzo1x.h) + [# LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.] + AC_CHECK_HEADERS([lzo/lzo1x.h lzo1x.h]) + [else] + AC_DEFINE([ENABLE_LZMA], [1], [Use lzma compression]) + [fi] + AC_SUBST([enable_lzo]) fi # Check for functions. diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index 13e887354..402faa3a9 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -44,7 +44,11 @@ #define GRUB_KERNEL_MACHINE_DATA_END 0x50 /* The size of the first region which won't be compressed. */ +#if defined(ENABLE_LZO) #define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x450) +#elif defined(ENABLE_LZMA) +#define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x5F0) +#endif #ifndef ASM_FILE diff --git a/include/grub/lib/LzFind.h b/include/grub/lib/LzFind.h new file mode 100644 index 000000000..69447b64b --- /dev/null +++ b/include/grub/lib/LzFind.h @@ -0,0 +1,130 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#ifndef __LZFIND_H +#define __LZFIND_H + +#include + +typedef UInt32 CLzRef; + +typedef struct _CMatchFinder +{ + Byte *buffer; + UInt32 pos; + UInt32 posLimit; + UInt32 streamPos; + UInt32 lenLimit; + + UInt32 cyclicBufferPos; + UInt32 cyclicBufferSize; /* it must be = (historySize + 1) */ + + UInt32 matchMaxLen; + CLzRef *hash; + CLzRef *son; + UInt32 hashMask; + UInt32 cutValue; + + Byte *bufferBase; + ISeqInStream *stream; + int streamEndWasReached; + + UInt32 blockSize; + UInt32 keepSizeBefore; + UInt32 keepSizeAfter; + + UInt32 numHashBytes; + int directInput; + int btMode; + /* int skipModeBits; */ + int bigHash; + UInt32 historySize; + UInt32 fixedHashSize; + UInt32 hashSizeSum; + UInt32 numSons; + SRes result; + UInt32 crc[256]; +} CMatchFinder; + +#define Inline_MatchFinder_GetPointerToCurrentPos(p) ((p)->buffer) +#define Inline_MatchFinder_GetIndexByte(p, index) ((p)->buffer[(Int32)(index)]) + +#define Inline_MatchFinder_GetNumAvailableBytes(p) ((p)->streamPos - (p)->pos) + +int MatchFinder_NeedMove(CMatchFinder *p); +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p); +void MatchFinder_MoveBlock(CMatchFinder *p); +void MatchFinder_ReadIfRequired(CMatchFinder *p); + +void MatchFinder_Construct(CMatchFinder *p); + +/* Conditions: + historySize <= 3 GB + keepAddBufferBefore + matchMaxLen + keepAddBufferAfter < 511MB +*/ +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc); +void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc); +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems); +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue); + +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *buffer, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 _cutValue, + UInt32 *distances, UInt32 maxLen); + +/* +Conditions: + Mf_GetNumAvailableBytes_Func must be called before each Mf_GetMatchLen_Func. + Mf_GetPointerToCurrentPos_Func's result must be used only before any other function +*/ + +typedef void (*Mf_Init_Func)(void *object); +typedef Byte (*Mf_GetIndexByte_Func)(void *object, Int32 index); +typedef UInt32 (*Mf_GetNumAvailableBytes_Func)(void *object); +typedef const Byte * (*Mf_GetPointerToCurrentPos_Func)(void *object); +typedef UInt32 (*Mf_GetMatches_Func)(void *object, UInt32 *distances); +typedef void (*Mf_Skip_Func)(void *object, UInt32); + +typedef struct _IMatchFinder +{ + Mf_Init_Func Init; + Mf_GetIndexByte_Func GetIndexByte; + Mf_GetNumAvailableBytes_Func GetNumAvailableBytes; + Mf_GetPointerToCurrentPos_Func GetPointerToCurrentPos; + Mf_GetMatches_Func GetMatches; + Mf_Skip_Func Skip; +} IMatchFinder; + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable); + +void MatchFinder_Init(CMatchFinder *p); +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances); +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num); + +#endif diff --git a/include/grub/lib/LzHash.h b/include/grub/lib/LzHash.h new file mode 100644 index 000000000..c3d55860b --- /dev/null +++ b/include/grub/lib/LzHash.h @@ -0,0 +1,77 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#ifndef __LZHASH_H +#define __LZHASH_H + +#define kHash2Size (1 << 10) +#define kHash3Size (1 << 16) +#define kHash4Size (1 << 20) + +#define kFix3HashSize (kHash2Size) +#define kFix4HashSize (kHash2Size + kHash3Size) +#define kFix5HashSize (kHash2Size + kHash3Size + kHash4Size) + +#define HASH2_CALC hashValue = cur[0] | ((UInt32)cur[1] << 8); + +#define HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hashValue = (temp ^ ((UInt32)cur[2] << 8)) & p->hashMask; } + +#define HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hashValue = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & p->hashMask; } + +#define HASH5_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)); \ + hashValue = (hash4Value ^ (p->crc[cur[4]] << 3)) & p->hashMask; \ + hash4Value &= (kHash4Size - 1); } + +/* #define HASH_ZIP_CALC hashValue = ((cur[0] | ((UInt32)cur[1] << 8)) ^ p->crc[cur[2]]) & 0xFFFF; */ +#define HASH_ZIP_CALC hashValue = ((cur[2] | ((UInt32)cur[0] << 8)) ^ p->crc[cur[1]]) & 0xFFFF; + + +#define MT_HASH2_CALC \ + hash2Value = (p->crc[cur[0]] ^ cur[1]) & (kHash2Size - 1); + +#define MT_HASH3_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); } + +#define MT_HASH4_CALC { \ + UInt32 temp = p->crc[cur[0]] ^ cur[1]; \ + hash2Value = temp & (kHash2Size - 1); \ + hash3Value = (temp ^ ((UInt32)cur[2] << 8)) & (kHash3Size - 1); \ + hash4Value = (temp ^ ((UInt32)cur[2] << 8) ^ (p->crc[cur[3]] << 5)) & (kHash4Size - 1); } + +#endif diff --git a/include/grub/lib/LzmaDec.h b/include/grub/lib/LzmaDec.h new file mode 100644 index 000000000..1e66b74d7 --- /dev/null +++ b/include/grub/lib/LzmaDec.h @@ -0,0 +1,246 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#ifndef __LZMADEC_H +#define __LZMADEC_H + +#include "Types.h" + +/* #define _LZMA_PROB32 */ +/* _LZMA_PROB32 can increase the speed on some CPUs, + but memory usage for CLzmaDec::probs will be doubled in that case */ + +#ifdef _LZMA_PROB32 +#define CLzmaProb UInt32 +#else +#define CLzmaProb UInt16 +#endif + + +/* ---------- LZMA Properties ---------- */ + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaProps +{ + unsigned lc, lp, pb; + UInt32 dicSize; +} CLzmaProps; + +/* LzmaProps_Decode - decodes properties +Returns: + SZ_OK + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size); + + +/* ---------- LZMA Decoder state ---------- */ + +/* LZMA_REQUIRED_INPUT_MAX = number of required input bytes for worst case. + Num bits = log2((2^11 / 31) ^ 22) + 26 < 134 + 26 = 160; */ + +#define LZMA_REQUIRED_INPUT_MAX 20 + +typedef struct +{ + CLzmaProps prop; + CLzmaProb *probs; + Byte *dic; + const Byte *buf; + UInt32 range, code; + SizeT dicPos; + SizeT dicBufSize; + UInt32 processedPos; + UInt32 checkDicSize; + unsigned state; + UInt32 reps[4]; + unsigned remainLen; + int needFlush; + int needInitState; + UInt32 numProbs; + unsigned tempBufSize; + Byte tempBuf[LZMA_REQUIRED_INPUT_MAX]; +} CLzmaDec; + +#define LzmaDec_Construct(p) { (p)->dic = 0; (p)->probs = 0; } + +void LzmaDec_Init(CLzmaDec *p); + +/* There are two types of LZMA streams: + 0) Stream with end mark. That end mark adds about 6 bytes to compressed size. + 1) Stream without end mark. You must know exact uncompressed size to decompress such stream. */ + +typedef enum +{ + LZMA_FINISH_ANY, /* finish at any point */ + LZMA_FINISH_END /* block must be finished at the end */ +} ELzmaFinishMode; + +/* ELzmaFinishMode has meaning only if the decoding reaches output limit !!! + + You must use LZMA_FINISH_END, when you know that current output buffer + covers last bytes of block. In other cases you must use LZMA_FINISH_ANY. + + If LZMA decoder sees end marker before reaching output limit, it returns SZ_OK, + and output value of destLen will be less than output buffer size limit. + You can check status result also. + + You can use multiple checks to test data integrity after full decompression: + 1) Check Result and "status" variable. + 2) Check that output(destLen) = uncompressedSize, if you know real uncompressedSize. + 3) Check that output(srcLen) = compressedSize, if you know real compressedSize. + You must use correct finish mode in that case. */ + +typedef enum +{ + LZMA_STATUS_NOT_SPECIFIED, /* use main error code instead */ + LZMA_STATUS_FINISHED_WITH_MARK, /* stream was finished with end mark. */ + LZMA_STATUS_NOT_FINISHED, /* stream was not finished */ + LZMA_STATUS_NEEDS_MORE_INPUT, /* you must provide more input bytes */ + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK /* there is probability that stream was finished without end mark */ +} ELzmaStatus; + +/* ELzmaStatus is used only as output value for function call */ + + +/* ---------- Interfaces ---------- */ + +/* There are 3 levels of interfaces: + 1) Dictionary Interface + 2) Buffer Interface + 3) One Call Interface + You can select any of these interfaces, but don't mix functions from different + groups for same object. */ + + +/* There are two variants to allocate state for Dictionary Interface: + 1) LzmaDec_Allocate / LzmaDec_Free + 2) LzmaDec_AllocateProbs / LzmaDec_FreeProbs + You can use variant 2, if you set dictionary buffer manually. + For Buffer Interface you must always use variant 1. + +LzmaDec_Allocate* can return: + SZ_OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties +*/ + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc); +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc); + +SRes LzmaDec_Allocate(CLzmaDec *state, const Byte *prop, unsigned propsSize, ISzAlloc *alloc); +void LzmaDec_Free(CLzmaDec *state, ISzAlloc *alloc); + +/* ---------- Dictionary Interface ---------- */ + +/* You can use it, if you want to eliminate the overhead for data copying from + dictionary to some other external buffer. + You must work with CLzmaDec variables directly in this interface. + + STEPS: + LzmaDec_Constr() + LzmaDec_Allocate() + for (each new stream) + { + LzmaDec_Init() + while (it needs more decompression) + { + LzmaDec_DecodeToDic() + use data from CLzmaDec::dic and update CLzmaDec::dicPos + } + } + LzmaDec_Free() +*/ + +/* LzmaDec_DecodeToDic + + The decoding to internal dictionary buffer (CLzmaDec::dic). + You must manually update CLzmaDec::dicPos, if it reaches CLzmaDec::dicBufSize !!! + +finishMode: + It has meaning only if the decoding reaches output limit (dicLimit). + LZMA_FINISH_ANY - Decode just dicLimit bytes. + LZMA_FINISH_END - Stream must be finished after dicLimit. + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_NEEDS_MORE_INPUT + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error +*/ + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- Buffer Interface ---------- */ + +/* It's zlib-like interface. + See LzmaDec_DecodeToDic description for information about STEPS and return results, + but you must use LzmaDec_DecodeToBuf instead of LzmaDec_DecodeToDic and you don't need + to work with CLzmaDec variables manually. + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). +*/ + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, + const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status); + + +/* ---------- One Call Interface ---------- */ + +/* LzmaDecode + +finishMode: + It has meaning only if the decoding reaches output limit (*destLen). + LZMA_FINISH_ANY - Decode just destLen bytes. + LZMA_FINISH_END - Stream must be finished after (*destLen). + +Returns: + SZ_OK + status: + LZMA_STATUS_FINISHED_WITH_MARK + LZMA_STATUS_NOT_FINISHED + LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK + SZ_ERROR_DATA - Data error + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_UNSUPPORTED - Unsupported properties + SZ_ERROR_INPUT_EOF - It needs more bytes in input buffer (src). +*/ + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAlloc *alloc); + +#endif diff --git a/include/grub/lib/LzmaEnc.h b/include/grub/lib/LzmaEnc.h new file mode 100644 index 000000000..c625cd0bc --- /dev/null +++ b/include/grub/lib/LzmaEnc.h @@ -0,0 +1,95 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#ifndef __LZMAENC_H +#define __LZMAENC_H + +#include "LzmaTypes.h" + +#define LZMA_PROPS_SIZE 5 + +typedef struct _CLzmaEncProps +{ + int level; /* 0 <= level <= 9 */ + UInt32 dictSize; /* (1 << 12) <= dictSize <= (1 << 27) for 32-bit version + (1 << 12) <= dictSize <= (1 << 30) for 64-bit version + default = (1 << 24) */ + int lc; /* 0 <= lc <= 8, default = 3 */ + int lp; /* 0 <= lp <= 4, default = 0 */ + int pb; /* 0 <= pb <= 4, default = 2 */ + int algo; /* 0 - fast, 1 - normal, default = 1 */ + int fb; /* 5 <= fb <= 273, default = 32 */ + int btMode; /* 0 - hashChain Mode, 1 - binTree mode - normal, default = 1 */ + int numHashBytes; /* 2, 3 or 4, default = 4 */ + UInt32 mc; /* 1 <= mc <= (1 << 30), default = 32 */ + unsigned writeEndMark; /* 0 - do not write EOPM, 1 - write EOPM, default = 0 */ + int numThreads; /* 1 or 2, default = 2 */ +} CLzmaEncProps; + +void LzmaEncProps_Init(CLzmaEncProps *p); +void LzmaEncProps_Normalize(CLzmaEncProps *p); +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); + + +/* ---------- CLzmaEncHandle Interface ---------- */ + +/* LzmaEnc_* functions can return the following exit codes: +Returns: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater in props + SZ_ERROR_WRITE - Write callback error. + SZ_ERROR_PROGRESS - some break from progress callback + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +typedef void * CLzmaEncHandle; + +CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc); +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig); +SRes LzmaEnc_SetProps(CLzmaEncHandle p, const CLzmaEncProps *props); +SRes LzmaEnc_WriteProperties(CLzmaEncHandle p, Byte *properties, SizeT *size); +SRes LzmaEnc_Encode(CLzmaEncHandle p, ISeqOutStream *outStream, ISeqInStream *inStream, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); +SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +/* ---------- One Call Interface ---------- */ + +/* LzmaEncode +Return code: + SZ_OK - OK + SZ_ERROR_MEM - Memory allocation error + SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_OUTPUT_EOF - output buffer overflow + SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) +*/ + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig); + +#endif diff --git a/include/grub/lib/LzmaTypes.h b/include/grub/lib/LzmaTypes.h new file mode 100644 index 000000000..1e783a2c7 --- /dev/null +++ b/include/grub/lib/LzmaTypes.h @@ -0,0 +1,151 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#ifndef __7Z_TYPES_H +#define __7Z_TYPES_H + +#define SZ_OK 0 + +#define SZ_ERROR_DATA 1 +#define SZ_ERROR_MEM 2 +#define SZ_ERROR_CRC 3 +#define SZ_ERROR_UNSUPPORTED 4 +#define SZ_ERROR_PARAM 5 +#define SZ_ERROR_INPUT_EOF 6 +#define SZ_ERROR_OUTPUT_EOF 7 +#define SZ_ERROR_READ 8 +#define SZ_ERROR_WRITE 9 +#define SZ_ERROR_PROGRESS 10 +#define SZ_ERROR_FAIL 11 +#define SZ_ERROR_THREAD 12 + +#define SZ_ERROR_ARCHIVE 16 +#define SZ_ERROR_NO_ARCHIVE 17 + +typedef int SRes; + +#ifndef RINOK +#define RINOK(x) { int __result__ = (x); if (__result__ != 0) return __result__; } +#endif + +typedef unsigned char Byte; +typedef short Int16; +typedef unsigned short UInt16; + +#ifdef _LZMA_UINT32_IS_ULONG +typedef long Int32; +typedef unsigned long UInt32; +#else +typedef int Int32; +typedef unsigned int UInt32; +#endif + +/* #define _SZ_NO_INT_64 */ +/* define it if your compiler doesn't support 64-bit integers */ + +#ifdef _SZ_NO_INT_64 + +typedef long Int64; +typedef unsigned long UInt64; + +#else + +#if defined(_MSC_VER) || defined(__BORLANDC__) +typedef __int64 Int64; +typedef unsigned __int64 UInt64; +#else +typedef long long int Int64; +typedef unsigned long long int UInt64; +#endif + +#endif + +#ifdef _LZMA_NO_SYSTEM_SIZE_T +typedef UInt32 SizeT; +#else +#include +typedef size_t SizeT; +#endif + +typedef int Bool; +#define True 1 +#define False 0 + + +#ifdef _MSC_VER + +#if _MSC_VER >= 1300 +#define MY_NO_INLINE __declspec(noinline) +#else +#define MY_NO_INLINE +#endif + +#define MY_CDECL __cdecl +#define MY_STD_CALL __stdcall +#define MY_FAST_CALL MY_NO_INLINE __fastcall + +#else + +#define MY_CDECL +#define MY_STD_CALL +#define MY_FAST_CALL + +#endif + + +/* The following interfaces use first parameter as pointer to structure */ + +typedef struct +{ + SRes (*Read)(void *p, void *buf, size_t *size); + /* if (input(*size) != 0 && output(*size) == 0) means end_of_stream. + (output(*size) < input(*size)) is allowed */ +} ISeqInStream; + +typedef struct +{ + size_t (*Write)(void *p, const void *buf, size_t size); + /* Returns: result - the number of actually written bytes. + (result < size) means error */ +} ISeqOutStream; + +typedef struct +{ + SRes (*Progress)(void *p, UInt64 inSize, UInt64 outSize); + /* Returns: result. (result != SZ_OK) means break. + Value (UInt64)(Int64)-1 for size means unknown value. */ +} ICompressProgress; + +typedef struct +{ + void *(*Alloc)(void *p, size_t size); + void (*Free)(void *p, void *address); /* address can be 0 */ +} ISzAlloc; + +#define IAlloc_Alloc(p, size) (p)->Alloc((p), size) +#define IAlloc_Free(p, a) (p)->Free((p), a) + +#endif diff --git a/kern/i386/pc/lzma_decode.S b/kern/i386/pc/lzma_decode.S new file mode 100644 index 000000000..a5a86848a --- /dev/null +++ b/kern/i386/pc/lzma_decode.S @@ -0,0 +1,677 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#define FIXED_PROPS + +#define LZMA_BASE_SIZE 1846 +#define LZMA_LIT_SIZE 768 + +#define LZMA_PROPERTIES_SIZE 5 + +#define kNumTopBits 24 +#define kTopValue (1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 + + +#define kNumPosBitsMax 4 +#define kNumPosStatesMax (1 << kNumPosBitsMax) + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumMidBits 3 +#define kLenNumMidSymbols (1 << kLenNumMidBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define LenChoice 0 +#define LenChoice2 (LenChoice + 1) +#define LenLow (LenChoice2 + 1) +#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) +#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) +#define kNumLenProbs (LenHigh + kLenNumHighSymbols) + + +#define kNumStates 12 +#define kNumLitStates 7 + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) + +#define kNumPosSlotBits 6 +#define kNumLenToPosStates 4 + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) + +#define kMatchMinLen 2 + +#define IsMatch 0 +#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) +#define IsRepG0 (IsRep + kNumStates) +#define IsRepG1 (IsRepG0 + kNumStates) +#define IsRepG2 (IsRepG1 + kNumStates) +#define IsRep0Long (IsRepG2 + kNumStates) +#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) +#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) +#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) +#define LenCoder (Align + kAlignTableSize) +#define RepLenCoder (LenCoder + kNumLenProbs) +#define Literal (RepLenCoder + kNumLenProbs) + + +#if 0 + +DbgOut: + pushf + pushl %ebp + pushl %edi + pushl %esi + pushl %edx + pushl %ecx + pushl %ebx + pushl %eax + + call _DebugPrint + + popl %eax + popl %ebx + popl %ecx + popl %edx + popl %esi + popl %edi + popl %ebp + popf + + ret + + +/* + * int LzmaDecodeProperties(CLzmaProperties *propsRes, + * const unsigned char *propsData, + * int size); + */ + +_LzmaDecodePropertiesA: + movb (%edx), %dl + + xorl %ecx, %ecx +1: + cmpb $45, %dl + jb 2f + incl %ecx + subb $45, %dl + jmp 1b +2: + movl %ecx, 8(%eax) /* pb */ + xorl %ecx, %ecx +1: + cmpb $9, %dl + jb 2f + incl %ecx + subb $9, %dl +2: + movl %ecx, 4(%eax) /* lp */ + movb %dl, %cl + movl %ecx, (%eax) /* lc */ + +#endif + +#ifndef ASM_FILE + xorl %eax, %eax +#endif + ret + +#define out_size 8(%ebp) + +#define now_pos -4(%ebp) +#define prev_byte -8(%ebp) +#define range -12(%ebp) +#define code -16(%ebp) +#define state -20(%ebp) +#define rep0 -24(%ebp) +#define rep1 -28(%ebp) +#define rep2 -32(%ebp) +#define rep3 -36(%ebp) + +#ifdef FIXED_PROPS + +#define FIXED_LC 3 +#define FIXED_LP 0 +#define FIXED_PB 2 + +#define POS_STATE_MASK ((1 << (FIXED_PB)) - 1) +#define LIT_POS_MASK ((1 << (FIXED_LP)) - 1) + +#define LOCAL_SIZE 36 + +#else + +#define lc (%ebx) +#define lp 4(%ebx) +#define pb 8(%ebx) +#define probs 12(%ebx) + +#define pos_state_mask -40(%ebp) +#define lit_pos_mask -44(%ebp) + +#define LOCAL_SIZE 44 + +#endif + +RangeDecoderBitDecode: +#ifdef FIXED_PROPS + leal (%ebx, %eax, 4), %eax +#else + shll $2, %eax + addl probs, %eax +#endif + + movl %eax, %ecx + movl (%ecx), %eax + + movl range, %edx + shrl $kNumBitModelTotalBits, %edx + mull %edx + + cmpl code, %eax + jbe 1f + + movl %eax, range + movl $kBitModelTotal, %edx + subl (%ecx), %edx + shrl $kNumMoveBits, %edx + addl %edx, (%ecx) + clc +3: + pushf + cmpl $kTopValue, range + jnc 2f + shll $8, code + lodsb + movb %al, code + shll $8, range +2: + popf + ret +1: + subl %eax, range + subl %eax, code + movl (%ecx), %edx + shrl $kNumMoveBits, %edx + subl %edx, (%ecx) + stc + jmp 3b + +RangeDecoderBitTreeDecode: +RangeDecoderReverseBitTreeDecode: + movzbl %cl, %ecx + xorl %edx, %edx + pushl %edx + incl %edx + pushl %edx + +1: + pushl %eax + pushl %ecx + pushl %edx + + addl %edx, %eax + call RangeDecoderBitDecode + + popl %edx + popl %ecx + + jnc 2f + movl 4(%esp), %eax + orl %eax, 8(%esp) + stc + +2: + adcl %edx, %edx + popl %eax + + shll $1, (%esp) + loop 1b + + popl %ecx + subl %ecx, %edx /* RangeDecoderBitTreeDecode */ + popl %ecx /* RangeDecoderReverseBitTreeDecode */ + ret + +LzmaLenDecode: + pushl %eax + addl $LenChoice, %eax + call RangeDecoderBitDecode + popl %eax + jc 1f + pushl $0 + movb $kLenNumLowBits, %cl + addl $LenLow, %eax +2: + movl 12(%esp), %edx + shll %cl, %edx + addl %edx, %eax +3: + + call RangeDecoderBitTreeDecode + popl %eax + addl %eax, %edx + ret + +1: + pushl %eax + addl $LenChoice2, %eax + call RangeDecoderBitDecode + popl %eax + jc 1f + pushl $kLenNumLowSymbols + movb $kLenNumMidBits, %cl + addl $LenMid, %eax + jmp 2b + +1: + pushl $(kLenNumLowSymbols + kLenNumMidSymbols) + addl $LenHigh, %eax + movb $kLenNumHighBits, %cl + jmp 3b + +WriteByte: + movb %al, prev_byte + stosb + incl now_pos + ret + +/* + * int LzmaDecode(CLzmaDecoderState *vs, + * const unsigned char *inStream, + * unsigned char *outStream, + * SizeT outSize); + */ + +_LzmaDecodeA: + + pushl %ebp + movl %esp, %ebp + subl $LOCAL_SIZE, %esp + +#ifndef ASM_FILE + pushl %esi + pushl %edi + pushl %ebx + + movl %eax, %ebx + movl %edx, %esi + pushl %ecx +#else + pushl %edi +#endif + + cld + +#ifdef FIXED_PROPS + movl %ebx, %edi + movl $(Literal + (LZMA_LIT_SIZE << (FIXED_LC + FIXED_LP))), %ecx +#else + movl $LZMA_LIT_SIZE, %eax + movb lc, %cl + addb lp, %cl + shll %cl, %eax + addl $Literal, %eax + movl %eax, %ecx + movl probs, %edi +#endif + + movl $(kBitModelTotal >> 1), %eax + + rep + stosl + + popl %edi + + xorl %eax, %eax + movl %eax, now_pos + movl %eax, prev_byte + movl %eax, state + + incl %eax + movl %eax, rep0 + movl %eax, rep1 + movl %eax, rep2 + movl %eax, rep3 + +#ifndef FIXED_PROPS + movl %eax, %edx + movb pb, %cl + shll %cl, %edx + decl %edx + movl %edx, pos_state_mask + + movl %eax, %edx + movb lp, %cl + shll %cl, %edx + decl %edx + movl %edx, lit_pos_mask; +#endif + + /* RangeDecoderInit */ + negl %eax + movl %eax, range + + incl %eax + movb $5, %cl + +1: + shll $8, %eax + lodsb + loop 1b + + movl %eax, code + +lzma_decode_loop: + movl now_pos, %eax + cmpl out_size, %eax + + jb 1f + +#ifndef ASM_FILE + xorl %eax, %eax + + popl %ebx + popl %edi + popl %esi +#endif + + movl %ebp, %esp + popl %ebp + ret + +1: +#ifdef FIXED_PROPS + andl $POS_STATE_MASK, %eax +#else + andl pos_state_mask, %eax +#endif + pushl %eax /* posState */ + movl state, %edx + shll $kNumPosBitsMax, %edx + addl %edx, %eax + pushl %eax /* (state << kNumPosBitsMax) + posState */ + + call RangeDecoderBitDecode + jc 1f + + movl now_pos, %eax + +#ifdef FIXED_PROPS + andl $LIT_POS_MASK, %eax + shll $FIXED_LC, %eax + movl prev_byte, %edx + shrl $(8 - FIXED_LC), %edx +#else + andl lit_pos_mask, %eax + movb lc, %cl + shll %cl, %eax + negb %cl + addb $8, %cl + movl prev_byte, %edx + shrl %cl, %edx +#endif + + addl %edx, %eax + movl $LZMA_LIT_SIZE, %edx + mull %edx + addl $Literal, %eax + pushl %eax + + incl %edx /* edx = 1 */ + + movl rep0, %eax + negl %eax + pushl (%edi, %eax) /* matchByte */ + + cmpb $kNumLitStates, state + jb 5f + + /* LzmaLiteralDecodeMatch */ + +3: + cmpl $0x100, %edx + jae 4f + + xorl %eax, %eax + shlb $1, (%esp) + adcl %eax, %eax + + pushl %eax + pushl %edx + + shll $8, %eax + leal 0x100(%edx, %eax), %eax + addl 12(%esp), %eax + call RangeDecoderBitDecode + + setc %al + popl %edx + adcl %edx, %edx + + popl %ecx + cmpb %cl, %al + jz 3b + +5: + + /* LzmaLiteralDecode */ + + cmpl $0x100, %edx + jae 4f + + pushl %edx + movl %edx, %eax + addl 8(%esp), %eax + call RangeDecoderBitDecode + popl %edx + adcl %edx, %edx + jmp 5b + +4: + addl $16, %esp + + movb %dl, %al + call WriteByte + + movb state, %al + cmpb $4, %al + jae 2f + xorb %al, %al + jmp 3f +2: + subb $3, %al + cmpb $7, %al + jb 3f + subb $3, %al +3: + movb %al, state + jmp lzma_decode_loop + +1: + movl state, %eax + addl $IsRep, %eax + call RangeDecoderBitDecode + jnc 1f + + movl state, %eax + addl $IsRepG0, %eax + call RangeDecoderBitDecode + jc 10f + + movl (%esp), %eax + addl $IsRep0Long, %eax + call RangeDecoderBitDecode + jc 20f + + cmpb $7, state + movb $9, state + jb 100f + addb $2, state +100: + + movl $1, %ecx + +3: + movl rep0, %edx + negl %edx + +4: + movb (%edi, %edx), %al + call WriteByte + loop 4b + + popl %eax + popl %eax + jmp lzma_decode_loop + +10: + movl state, %eax + addl $IsRepG1, %eax + call RangeDecoderBitDecode + movl rep1, %edx + jnc 100f + + movl state, %eax + addl $IsRepG2, %eax + call RangeDecoderBitDecode + movl rep2, %edx + jnc 1000f + movl rep2, %edx + xchgl rep3, %edx +1000: + pushl rep1 + popl rep2 +100: + xchg rep0, %edx + movl %edx, rep1 +20: + + movl $RepLenCoder, %eax + call LzmaLenDecode + + cmpb $7, state + movb $8, state + jb 100f + addb $3, state +100: + jmp 2f + +1: + movl rep0, %eax + xchgl rep1, %eax + xchgl rep2, %eax + movl %eax, rep3 + + cmpb $7, state + movb $7, state + jb 10f + addb $3, state +10: + + movl $LenCoder, %eax + call LzmaLenDecode + pushl %edx + + movl $(kNumLenToPosStates - 1), %eax + cmpl %eax, %edx + jbe 100f + movl %eax, %edx +100: + movb $kNumPosSlotBits, %cl + shll %cl, %edx + leal PosSlot(%edx), %eax + call RangeDecoderBitTreeDecode + + movl %edx, rep0 + cmpl $kStartPosModelIndex, %edx + jb 100f + + movl %edx, %ecx + shrl $1, %ecx + decl %ecx + + movzbl %dl, %eax + andb $1, %al + orb $2, %al + shll %cl, %eax + movl %eax, rep0 + + cmpl $kEndPosModelIndex, %edx + jae 200f + movl rep0, %eax + addl $(SpecPos - 1), %eax + subl %edx, %eax + jmp 300f +200: + + subb $kNumAlignBits, %cl + + /* RangeDecoderDecodeDirectBits */ + xorl %edx, %edx + +1000: + shrl $1, range + shll $1, %edx + + movl range, %eax + cmpl %eax, code + jb 2000f + subl %eax, code + orb $1, %dl +2000: + + cmpl $kTopValue, %eax + jae 3000f + shll $8, range + shll $8, code + lodsb + movb %al, code + +3000: + loop 1000b + + movb $kNumAlignBits, %cl + shll %cl, %edx + addl %edx, rep0 + + movl $Align, %eax + +300: + call RangeDecoderReverseBitTreeDecode + addl %ecx, rep0 + +100: + incl rep0 + popl %edx + +2: + + addl $kMatchMinLen, %edx + movl %edx, %ecx + + jmp 3b diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 954297891..8f420ccdc 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -200,6 +200,7 @@ codestart: incl %eax call EXT_C(grub_gate_a20) +#if defined(ENABLE_LZO) /* decompress the compressed part and put the result at 1MB */ movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %esi movl $(START_SYMBOL + GRUB_KERNEL_MACHINE_RAW_SIZE), %edi @@ -213,6 +214,23 @@ codestart: /* copy back the decompressed part */ movl %eax, %ecx cld +#elif defined(ENABLE_LZMA) + movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %edi + movl $(START_SYMBOL + GRUB_KERNEL_MACHINE_RAW_SIZE), %esi + pushl %edi + pushl %esi + movl EXT_C(grub_kernel_image_size), %ecx + addl EXT_C(grub_total_module_size), %ecx + addl EXT_C(grub_memdisk_image_size), %ecx + subl $GRUB_KERNEL_MACHINE_RAW_SIZE, %ecx + pushl %ecx + leal (%edi, %ecx), %ebx + call _LzmaDecodeA + popl %ecx + popl %edi + popl %esi +#endif + rep movsb @@ -476,7 +494,11 @@ gate_a20_check_state: popl %ebx ret +#if defined(ENABLE_LZO) #include "lzo1x.S" +#elif defined(ENABLE_LZMA) +#include "lzma_decode.S" +#endif /* * The code beyond this point is compressed. Assert that the uncompressed diff --git a/lib/LzFind.c b/lib/LzFind.c new file mode 100644 index 000000000..cd7a1cbab --- /dev/null +++ b/lib/LzFind.c @@ -0,0 +1,774 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#include + +#include +#include + +#define kEmptyHashValue 0 +#define kMaxValForNormalize ((UInt32)0xFFFFFFFF) +#define kNormalizeStepMin (1 << 10) /* it must be power of 2 */ +#define kNormalizeMask (~(kNormalizeStepMin - 1)) +#define kMaxHistorySize ((UInt32)3 << 30) + +#define kStartMaxLen 3 + +static void LzInWindow_Free(CMatchFinder *p, ISzAlloc *alloc) +{ + if (!p->directInput) + { + alloc->Free(alloc, p->bufferBase); + p->bufferBase = 0; + } +} + +/* keepSizeBefore + keepSizeAfter + keepSizeReserv must be < 4G) */ + +static int LzInWindow_Create(CMatchFinder *p, UInt32 keepSizeReserv, ISzAlloc *alloc) +{ + UInt32 blockSize = p->keepSizeBefore + p->keepSizeAfter + keepSizeReserv; + if (p->directInput) + { + p->blockSize = blockSize; + return 1; + } + if (p->bufferBase == 0 || p->blockSize != blockSize) + { + LzInWindow_Free(p, alloc); + p->blockSize = blockSize; + p->bufferBase = (Byte *)alloc->Alloc(alloc, (size_t)blockSize); + } + return (p->bufferBase != 0); +} + +Byte *MatchFinder_GetPointerToCurrentPos(CMatchFinder *p) { return p->buffer; } +Byte MatchFinder_GetIndexByte(CMatchFinder *p, Int32 index) { return p->buffer[index]; } + +UInt32 MatchFinder_GetNumAvailableBytes(CMatchFinder *p) { return p->streamPos - p->pos; } + +void MatchFinder_ReduceOffsets(CMatchFinder *p, UInt32 subValue) +{ + p->posLimit -= subValue; + p->pos -= subValue; + p->streamPos -= subValue; +} + +static void MatchFinder_ReadBlock(CMatchFinder *p) +{ + if (p->streamEndWasReached || p->result != SZ_OK) + return; + for (;;) + { + Byte *dest = p->buffer + (p->streamPos - p->pos); + size_t size = (p->bufferBase + p->blockSize - dest); + if (size == 0) + return; + p->result = p->stream->Read(p->stream, dest, &size); + if (p->result != SZ_OK) + return; + if (size == 0) + { + p->streamEndWasReached = 1; + return; + } + p->streamPos += (UInt32)size; + if (p->streamPos - p->pos > p->keepSizeAfter) + return; + } +} + +void MatchFinder_MoveBlock(CMatchFinder *p) +{ + memmove(p->bufferBase, + p->buffer - p->keepSizeBefore, + (size_t)(p->streamPos - p->pos + p->keepSizeBefore)); + p->buffer = p->bufferBase + p->keepSizeBefore; +} + +int MatchFinder_NeedMove(CMatchFinder *p) +{ + /* if (p->streamEndWasReached) return 0; */ + return ((size_t)(p->bufferBase + p->blockSize - p->buffer) <= p->keepSizeAfter); +} + +void MatchFinder_ReadIfRequired(CMatchFinder *p) +{ + if (p->streamEndWasReached) + return; + if (p->keepSizeAfter >= p->streamPos - p->pos) + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_CheckAndMoveAndRead(CMatchFinder *p) +{ + if (MatchFinder_NeedMove(p)) + MatchFinder_MoveBlock(p); + MatchFinder_ReadBlock(p); +} + +static void MatchFinder_SetDefaultSettings(CMatchFinder *p) +{ + p->cutValue = 32; + p->btMode = 1; + p->numHashBytes = 4; + /* p->skipModeBits = 0; */ + p->directInput = 0; + p->bigHash = 0; +} + +#define kCrcPoly 0xEDB88320 + +void MatchFinder_Construct(CMatchFinder *p) +{ + UInt32 i; + p->bufferBase = 0; + p->directInput = 0; + p->hash = 0; + MatchFinder_SetDefaultSettings(p); + + for (i = 0; i < 256; i++) + { + UInt32 r = i; + int j; + for (j = 0; j < 8; j++) + r = (r >> 1) ^ (kCrcPoly & ~((r & 1) - 1)); + p->crc[i] = r; + } +} + +static void MatchFinder_FreeThisClassMemory(CMatchFinder *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->hash); + p->hash = 0; +} + +void MatchFinder_Free(CMatchFinder *p, ISzAlloc *alloc) +{ + MatchFinder_FreeThisClassMemory(p, alloc); + LzInWindow_Free(p, alloc); +} + +static CLzRef* AllocRefs(UInt32 num, ISzAlloc *alloc) +{ + size_t sizeInBytes = (size_t)num * sizeof(CLzRef); + if (sizeInBytes / sizeof(CLzRef) != num) + return 0; + return (CLzRef *)alloc->Alloc(alloc, sizeInBytes); +} + +int MatchFinder_Create(CMatchFinder *p, UInt32 historySize, + UInt32 keepAddBufferBefore, UInt32 matchMaxLen, UInt32 keepAddBufferAfter, + ISzAlloc *alloc) +{ + UInt32 sizeReserv; + if (historySize > kMaxHistorySize) + { + MatchFinder_Free(p, alloc); + return 0; + } + sizeReserv = historySize >> 1; + if (historySize > ((UInt32)2 << 30)) + sizeReserv = historySize >> 2; + sizeReserv += (keepAddBufferBefore + matchMaxLen + keepAddBufferAfter) / 2 + (1 << 19); + + p->keepSizeBefore = historySize + keepAddBufferBefore + 1; + p->keepSizeAfter = matchMaxLen + keepAddBufferAfter; + /* we need one additional byte, since we use MoveBlock after pos++ and before dictionary using */ + if (LzInWindow_Create(p, sizeReserv, alloc)) + { + UInt32 newCyclicBufferSize = (historySize /* >> p->skipModeBits */) + 1; + UInt32 hs; + p->matchMaxLen = matchMaxLen; + { + p->fixedHashSize = 0; + if (p->numHashBytes == 2) + hs = (1 << 16) - 1; + else + { + hs = historySize - 1; + hs |= (hs >> 1); + hs |= (hs >> 2); + hs |= (hs >> 4); + hs |= (hs >> 8); + hs >>= 1; + /* hs >>= p->skipModeBits; */ + hs |= 0xFFFF; /* don't change it! It's required for Deflate */ + if (hs > (1 << 24)) + { + if (p->numHashBytes == 3) + hs = (1 << 24) - 1; + else + hs >>= 1; + } + } + p->hashMask = hs; + hs++; + if (p->numHashBytes > 2) p->fixedHashSize += kHash2Size; + if (p->numHashBytes > 3) p->fixedHashSize += kHash3Size; + if (p->numHashBytes > 4) p->fixedHashSize += kHash4Size; + hs += p->fixedHashSize; + } + + { + UInt32 prevSize = p->hashSizeSum + p->numSons; + UInt32 newSize; + p->historySize = historySize; + p->hashSizeSum = hs; + p->cyclicBufferSize = newCyclicBufferSize; + p->numSons = (p->btMode ? newCyclicBufferSize * 2 : newCyclicBufferSize); + newSize = p->hashSizeSum + p->numSons; + if (p->hash != 0 && prevSize == newSize) + return 1; + MatchFinder_FreeThisClassMemory(p, alloc); + p->hash = AllocRefs(newSize, alloc); + if (p->hash != 0) + { + p->son = p->hash + p->hashSizeSum; + return 1; + } + } + } + MatchFinder_Free(p, alloc); + return 0; +} + +static void MatchFinder_SetLimits(CMatchFinder *p) +{ + UInt32 limit = kMaxValForNormalize - p->pos; + UInt32 limit2 = p->cyclicBufferSize - p->cyclicBufferPos; + if (limit2 < limit) + limit = limit2; + limit2 = p->streamPos - p->pos; + if (limit2 <= p->keepSizeAfter) + { + if (limit2 > 0) + limit2 = 1; + } + else + limit2 -= p->keepSizeAfter; + if (limit2 < limit) + limit = limit2; + { + UInt32 lenLimit = p->streamPos - p->pos; + if (lenLimit > p->matchMaxLen) + lenLimit = p->matchMaxLen; + p->lenLimit = lenLimit; + } + p->posLimit = p->pos + limit; +} + +void MatchFinder_Init(CMatchFinder *p) +{ + UInt32 i; + for(i = 0; i < p->hashSizeSum; i++) + p->hash[i] = kEmptyHashValue; + p->cyclicBufferPos = 0; + p->buffer = p->bufferBase; + p->pos = p->streamPos = p->cyclicBufferSize; + p->result = SZ_OK; + p->streamEndWasReached = 0; + MatchFinder_ReadBlock(p); + MatchFinder_SetLimits(p); +} + +static UInt32 MatchFinder_GetSubValue(CMatchFinder *p) +{ + return (p->pos - p->historySize - 1) & kNormalizeMask; +} + +void MatchFinder_Normalize3(UInt32 subValue, CLzRef *items, UInt32 numItems) +{ + UInt32 i; + for (i = 0; i < numItems; i++) + { + UInt32 value = items[i]; + if (value <= subValue) + value = kEmptyHashValue; + else + value -= subValue; + items[i] = value; + } +} + +static void MatchFinder_Normalize(CMatchFinder *p) +{ + UInt32 subValue = MatchFinder_GetSubValue(p); + MatchFinder_Normalize3(subValue, p->hash, p->hashSizeSum + p->numSons); + MatchFinder_ReduceOffsets(p, subValue); +} + +static void MatchFinder_CheckLimits(CMatchFinder *p) +{ + if (p->pos == kMaxValForNormalize) + MatchFinder_Normalize(p); + if (!p->streamEndWasReached && p->keepSizeAfter == p->streamPos - p->pos) + MatchFinder_CheckAndMoveAndRead(p); + if (p->cyclicBufferPos == p->cyclicBufferSize) + p->cyclicBufferPos = 0; + MatchFinder_SetLimits(p); +} + +static UInt32 * Hc_GetMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) +{ + son[_cyclicBufferPos] = curMatch; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + return distances; + { + const Byte *pb = cur - delta; + curMatch = son[_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)]; + if (pb[maxLen] == cur[maxLen] && *pb == *cur) + { + UInt32 len = 0; + while(++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + return distances; + } + } + } + } +} + +UInt32 * GetMatchesSpec1(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue, + UInt32 *distances, UInt32 maxLen) +{ + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return distances; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + if (++len != lenLimit && pb[len] == cur[len]) + while(++len != lenLimit) + if (pb[len] != cur[len]) + break; + if (maxLen < len) + { + *distances++ = maxLen = len; + *distances++ = delta - 1; + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return distances; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +static void SkipMatchesSpec(UInt32 lenLimit, UInt32 curMatch, UInt32 pos, const Byte *cur, CLzRef *son, + UInt32 _cyclicBufferPos, UInt32 _cyclicBufferSize, UInt32 cutValue) +{ + CLzRef *ptr0 = son + (_cyclicBufferPos << 1) + 1; + CLzRef *ptr1 = son + (_cyclicBufferPos << 1); + UInt32 len0 = 0, len1 = 0; + for (;;) + { + UInt32 delta = pos - curMatch; + if (cutValue-- == 0 || delta >= _cyclicBufferSize) + { + *ptr0 = *ptr1 = kEmptyHashValue; + return; + } + { + CLzRef *pair = son + ((_cyclicBufferPos - delta + ((delta > _cyclicBufferPos) ? _cyclicBufferSize : 0)) << 1); + const Byte *pb = cur - delta; + UInt32 len = (len0 < len1 ? len0 : len1); + if (pb[len] == cur[len]) + { + while(++len != lenLimit) + if (pb[len] != cur[len]) + break; + { + if (len == lenLimit) + { + *ptr1 = pair[0]; + *ptr0 = pair[1]; + return; + } + } + } + if (pb[len] < cur[len]) + { + *ptr1 = curMatch; + ptr1 = pair + 1; + curMatch = *ptr1; + len1 = len; + } + else + { + *ptr0 = curMatch; + ptr0 = pair; + curMatch = *ptr0; + len0 = len; + } + } + } +} + +#define MOVE_POS \ + ++p->cyclicBufferPos; \ + p->buffer++; \ + if (++p->pos == p->posLimit) MatchFinder_CheckLimits(p); + +#define MOVE_POS_RET MOVE_POS return offset; + +static void MatchFinder_MovePos(CMatchFinder *p) { MOVE_POS; } + +#define GET_MATCHES_HEADER2(minLen, ret_op) \ + UInt32 lenLimit; UInt32 hashValue; const Byte *cur; UInt32 curMatch; \ + lenLimit = p->lenLimit; { if (lenLimit < minLen) { MatchFinder_MovePos(p); ret_op; }} \ + cur = p->buffer; + +#define GET_MATCHES_HEADER(minLen) GET_MATCHES_HEADER2(minLen, return 0) +#define SKIP_HEADER(minLen) GET_MATCHES_HEADER2(minLen, continue) + +#define MF_PARAMS(p) p->pos, p->buffer, p->son, p->cyclicBufferPos, p->cyclicBufferSize, p->cutValue + +#define GET_MATCHES_FOOTER(offset, maxLen) \ + offset = (UInt32)(GetMatchesSpec1(lenLimit, curMatch, MF_PARAMS(p), \ + distances + offset, maxLen) - distances); MOVE_POS_RET; + +#define SKIP_FOOTER \ + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); MOVE_POS; + +static UInt32 Bt2_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 1) +} + +UInt32 Bt3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = 0; + GET_MATCHES_FOOTER(offset, 2) +} + +static UInt32 Bt3_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, delta2, maxLen, offset; + GET_MATCHES_HEADER(3) + + HASH3_CALC; + + delta2 = p->pos - p->hash[hash2Value]; + curMatch = p->hash[kFix3HashSize + hashValue]; + + p->hash[hash2Value] = + p->hash[kFix3HashSize + hashValue] = p->pos; + + + maxLen = 2; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[0] = maxLen; + distances[1] = delta2 - 1; + offset = 2; + if (maxLen == lenLimit) + { + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + GET_MATCHES_FOOTER(offset, maxLen) +} + +static UInt32 Bt4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + delta2 = p->pos - p->hash[ hash2Value]; + delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; + curMatch = p->hash[kFix4HashSize + hashValue]; + + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + + maxLen = 1; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = delta2 - 1; + offset = 2; + } + if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) + { + maxLen = 3; + distances[offset + 1] = delta3 - 1; + offset += 2; + delta2 = delta3; + } + if (offset != 0) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[offset - 2] = maxLen; + if (maxLen == lenLimit) + { + SkipMatchesSpec(lenLimit, curMatch, MF_PARAMS(p)); + MOVE_POS_RET; + } + } + if (maxLen < 3) + maxLen = 3; + GET_MATCHES_FOOTER(offset, maxLen) +} + +static UInt32 Hc4_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 hash2Value, hash3Value, delta2, delta3, maxLen, offset; + GET_MATCHES_HEADER(4) + + HASH4_CALC; + + delta2 = p->pos - p->hash[ hash2Value]; + delta3 = p->pos - p->hash[kFix3HashSize + hash3Value]; + curMatch = p->hash[kFix4HashSize + hashValue]; + + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + + maxLen = 1; + offset = 0; + if (delta2 < p->cyclicBufferSize && *(cur - delta2) == *cur) + { + distances[0] = maxLen = 2; + distances[1] = delta2 - 1; + offset = 2; + } + if (delta2 != delta3 && delta3 < p->cyclicBufferSize && *(cur - delta3) == *cur) + { + maxLen = 3; + distances[offset + 1] = delta3 - 1; + offset += 2; + delta2 = delta3; + } + if (offset != 0) + { + for (; maxLen != lenLimit; maxLen++) + if (cur[(ptrdiff_t)maxLen - delta2] != cur[maxLen]) + break; + distances[offset - 2] = maxLen; + if (maxLen == lenLimit) + { + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS_RET; + } + } + if (maxLen < 3) + maxLen = 3; + offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances + offset, maxLen) - (distances)); + MOVE_POS_RET +} + +UInt32 Hc3Zip_MatchFinder_GetMatches(CMatchFinder *p, UInt32 *distances) +{ + UInt32 offset; + GET_MATCHES_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + offset = (UInt32)(Hc_GetMatchesSpec(lenLimit, curMatch, MF_PARAMS(p), + distances, 2) - (distances)); + MOVE_POS_RET +} + +static void Bt2_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(2) + HASH2_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +void Bt3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt3_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value; + SKIP_HEADER(3) + HASH3_CALC; + curMatch = p->hash[kFix3HashSize + hashValue]; + p->hash[hash2Value] = + p->hash[kFix3HashSize + hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Bt4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value, hash3Value; + SKIP_HEADER(4) + HASH4_CALC; + curMatch = p->hash[kFix4HashSize + hashValue]; + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = p->pos; + p->hash[kFix4HashSize + hashValue] = p->pos; + SKIP_FOOTER + } + while (--num != 0); +} + +static void Hc4_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + UInt32 hash2Value, hash3Value; + SKIP_HEADER(4) + HASH4_CALC; + curMatch = p->hash[kFix4HashSize + hashValue]; + p->hash[ hash2Value] = + p->hash[kFix3HashSize + hash3Value] = + p->hash[kFix4HashSize + hashValue] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +void Hc3Zip_MatchFinder_Skip(CMatchFinder *p, UInt32 num) +{ + do + { + SKIP_HEADER(3) + HASH_ZIP_CALC; + curMatch = p->hash[hashValue]; + p->hash[hashValue] = p->pos; + p->son[p->cyclicBufferPos] = curMatch; + MOVE_POS + } + while (--num != 0); +} + +void MatchFinder_CreateVTable(CMatchFinder *p, IMatchFinder *vTable) +{ + vTable->Init = (Mf_Init_Func)MatchFinder_Init; + vTable->GetIndexByte = (Mf_GetIndexByte_Func)MatchFinder_GetIndexByte; + vTable->GetNumAvailableBytes = (Mf_GetNumAvailableBytes_Func)MatchFinder_GetNumAvailableBytes; + vTable->GetPointerToCurrentPos = (Mf_GetPointerToCurrentPos_Func)MatchFinder_GetPointerToCurrentPos; + if (!p->btMode) + { + vTable->GetMatches = (Mf_GetMatches_Func)Hc4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Hc4_MatchFinder_Skip; + } + else if (p->numHashBytes == 2) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt2_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt2_MatchFinder_Skip; + } + else if (p->numHashBytes == 3) + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt3_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt3_MatchFinder_Skip; + } + else + { + vTable->GetMatches = (Mf_GetMatches_Func)Bt4_MatchFinder_GetMatches; + vTable->Skip = (Mf_Skip_Func)Bt4_MatchFinder_Skip; + } +} diff --git a/lib/LzmaDec.c b/lib/LzmaDec.c new file mode 100644 index 000000000..62ebee686 --- /dev/null +++ b/lib/LzmaDec.c @@ -0,0 +1,1035 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#include + +#include + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 + +#define RC_INIT_SIZE 5 + +#define NORMALIZE if (range < kTopValue) { range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0(p) ttt = *(p); NORMALIZE; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) +#define UPDATE_0(p) range = bound; *(p) = (CLzmaProb)(ttt + ((kBitModelTotal - ttt) >> kNumMoveBits)); +#define UPDATE_1(p) range -= bound; code -= bound; *(p) = (CLzmaProb)(ttt - (ttt >> kNumMoveBits)); +#define GET_BIT2(p, i, A0, A1) IF_BIT_0(p) \ + { UPDATE_0(p); i = (i + i); A0; } else \ + { UPDATE_1(p); i = (i + i) + 1; A1; } +#define GET_BIT(p, i) GET_BIT2(p, i, ; , ;) + +#define TREE_GET_BIT(probs, i) { GET_BIT((probs + i), i); } +#define TREE_DECODE(probs, limit, i) \ + { i = 1; do { TREE_GET_BIT(probs, i); } while (i < limit); i -= limit; } + +/* #define _LZMA_SIZE_OPT */ + +#ifdef _LZMA_SIZE_OPT +#define TREE_6_DECODE(probs, i) TREE_DECODE(probs, (1 << 6), i) +#else +#define TREE_6_DECODE(probs, i) \ + { i = 1; \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + TREE_GET_BIT(probs, i); \ + i -= 0x40; } +#endif + +#define NORMALIZE_CHECK if (range < kTopValue) { if (buf >= bufLimit) return DUMMY_ERROR; range <<= 8; code = (code << 8) | (*buf++); } + +#define IF_BIT_0_CHECK(p) ttt = *(p); NORMALIZE_CHECK; bound = (range >> kNumBitModelTotalBits) * ttt; if (code < bound) +#define UPDATE_0_CHECK range = bound; +#define UPDATE_1_CHECK range -= bound; code -= bound; +#define GET_BIT2_CHECK(p, i, A0, A1) IF_BIT_0_CHECK(p) \ + { UPDATE_0_CHECK; i = (i + i); A0; } else \ + { UPDATE_1_CHECK; i = (i + i) + 1; A1; } +#define GET_BIT_CHECK(p, i) GET_BIT2_CHECK(p, i, ; , ;) +#define TREE_DECODE_CHECK(probs, limit, i) \ + { i = 1; do { GET_BIT_CHECK(probs + i, i) } while(i < limit); i -= limit; } + + +#define kNumPosBitsMax 4 +#define kNumPosStatesMax (1 << kNumPosBitsMax) + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumMidBits 3 +#define kLenNumMidSymbols (1 << kLenNumMidBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define LenChoice 0 +#define LenChoice2 (LenChoice + 1) +#define LenLow (LenChoice2 + 1) +#define LenMid (LenLow + (kNumPosStatesMax << kLenNumLowBits)) +#define LenHigh (LenMid + (kNumPosStatesMax << kLenNumMidBits)) +#define kNumLenProbs (LenHigh + kLenNumHighSymbols) + + +#define kNumStates 12 +#define kNumLitStates 7 + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumFullDistances (1 << (kEndPosModelIndex >> 1)) + +#define kNumPosSlotBits 6 +#define kNumLenToPosStates 4 + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) + +#define kMatchMinLen 2 +#define kMatchSpecLenStart (kMatchMinLen + kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) + +#define IsMatch 0 +#define IsRep (IsMatch + (kNumStates << kNumPosBitsMax)) +#define IsRepG0 (IsRep + kNumStates) +#define IsRepG1 (IsRepG0 + kNumStates) +#define IsRepG2 (IsRepG1 + kNumStates) +#define IsRep0Long (IsRepG2 + kNumStates) +#define PosSlot (IsRep0Long + (kNumStates << kNumPosBitsMax)) +#define SpecPos (PosSlot + (kNumLenToPosStates << kNumPosSlotBits)) +#define Align (SpecPos + kNumFullDistances - kEndPosModelIndex) +#define LenCoder (Align + kAlignTableSize) +#define RepLenCoder (LenCoder + kNumLenProbs) +#define Literal (RepLenCoder + kNumLenProbs) + +#define LZMA_BASE_SIZE 1846 +#define LZMA_LIT_SIZE 768 + +#define LzmaProps_GetNumProbs(p) ((UInt32)LZMA_BASE_SIZE + (LZMA_LIT_SIZE << ((p)->lc + (p)->lp))) + +#if Literal != LZMA_BASE_SIZE +StopCompilingDueBUG +#endif + +/* +#define LZMA_STREAM_WAS_FINISHED_ID (-1) +#define LZMA_SPEC_LEN_OFFSET (-3) +*/ + +Byte kLiteralNextStates[kNumStates * 2] = +{ + 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5, + 7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10 +}; + +#define LZMA_DIC_MIN (1 << 12) + +/* First LZMA-symbol is always decoded. +And it decodes new LZMA-symbols while (buf < bufLimit), but "buf" is without last normalization +Out: + Result: + 0 - OK + 1 - Error + p->remainLen: + < kMatchSpecLenStart : normal remain + = kMatchSpecLenStart : finished + = kMatchSpecLenStart + 1 : Flush marker + = kMatchSpecLenStart + 2 : State Init Marker +*/ + +static int MY_FAST_CALL LzmaDec_DecodeReal(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + CLzmaProb *probs = p->probs; + + unsigned state = p->state; + UInt32 rep0 = p->reps[0], rep1 = p->reps[1], rep2 = p->reps[2], rep3 = p->reps[3]; + unsigned pbMask = ((unsigned)1 << (p->prop.pb)) - 1; + unsigned lpMask = ((unsigned)1 << (p->prop.lp)) - 1; + unsigned lc = p->prop.lc; + + Byte *dic = p->dic; + SizeT dicBufSize = p->dicBufSize; + SizeT dicPos = p->dicPos; + + UInt32 processedPos = p->processedPos; + UInt32 checkDicSize = p->checkDicSize; + unsigned len = 0; + + const Byte *buf = p->buf; + UInt32 range = p->range; + UInt32 code = p->code; + + do + { + CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = processedPos & pbMask; + + prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; + IF_BIT_0(prob) + { + unsigned symbol; + UPDATE_0(prob); + prob = probs + Literal; + if (checkDicSize != 0 || processedPos != 0) + prob += (LZMA_LIT_SIZE * (((processedPos & lpMask) << lc) + + (dic[(dicPos == 0 ? dicBufSize : dicPos) - 1] >> (8 - lc)))); + + if (state < kNumLitStates) + { + symbol = 1; + do { GET_BIT(prob + symbol, symbol) } while (symbol < 0x100); + } + else + { + unsigned matchByte = p->dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + unsigned offs = 0x100; + symbol = 1; + do + { + unsigned bit; + CLzmaProb *probLit; + matchByte <<= 1; + bit = (matchByte & offs); + probLit = prob + offs + bit + symbol; + GET_BIT2(probLit, symbol, offs &= ~bit, offs &= bit) + } + while (symbol < 0x100); + } + dic[dicPos++] = (Byte)symbol; + processedPos++; + + state = kLiteralNextStates[state]; + /* if (state < 4) state = 0; else if (state < 10) state -= 3; else state -= 6; */ + continue; + } + else + { + UPDATE_1(prob); + prob = probs + IsRep + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + state += kNumStates; + prob = probs + LenCoder; + } + else + { + UPDATE_1(prob); + if (checkDicSize == 0 && processedPos == 0) + return SZ_ERROR_DATA; + prob = probs + IsRepG0 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; + IF_BIT_0(prob) + { + UPDATE_0(prob); + dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + dicPos++; + processedPos++; + state = state < kNumLitStates ? 9 : 11; + continue; + } + UPDATE_1(prob); + } + else + { + UInt32 distance; + UPDATE_1(prob); + prob = probs + IsRepG1 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep1; + } + else + { + UPDATE_1(prob); + prob = probs + IsRepG2 + state; + IF_BIT_0(prob) + { + UPDATE_0(prob); + distance = rep2; + } + else + { + UPDATE_1(prob); + distance = rep3; + rep3 = rep2; + } + rep2 = rep1; + } + rep1 = rep0; + rep0 = distance; + } + state = state < kNumLitStates ? 8 : 11; + prob = probs + RepLenCoder; + } + { + unsigned limit, offset; + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenLow + (posState << kLenNumLowBits); + offset = 0; + limit = (1 << kLenNumLowBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenChoice2; + IF_BIT_0(probLen) + { + UPDATE_0(probLen); + probLen = prob + LenMid + (posState << kLenNumMidBits); + offset = kLenNumLowSymbols; + limit = (1 << kLenNumMidBits); + } + else + { + UPDATE_1(probLen); + probLen = prob + LenHigh; + offset = kLenNumLowSymbols + kLenNumMidSymbols; + limit = (1 << kLenNumHighBits); + } + } + TREE_DECODE(probLen, limit, len); + len += offset; + } + + if (state >= kNumStates) + { + UInt32 distance; + prob = probs + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << kNumPosSlotBits); + TREE_6_DECODE(prob, distance); + if (distance >= kStartPosModelIndex) + { + unsigned posSlot = (unsigned)distance; + int numDirectBits = (int)(((distance >> 1) - 1)); + distance = (2 | (distance & 1)); + if (posSlot < kEndPosModelIndex) + { + distance <<= numDirectBits; + prob = probs + SpecPos + distance - posSlot - 1; + { + UInt32 mask = 1; + unsigned i = 1; + do + { + GET_BIT2(prob + i, i, ; , distance |= mask); + mask <<= 1; + } + while(--numDirectBits != 0); + } + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE + range >>= 1; + + { + UInt32 t; + code -= range; + t = (0 - ((UInt32)code >> 31)); /* (UInt32)((Int32)code >> 31) */ + distance = (distance << 1) + (t + 1); + code += range & t; + } + /* + distance <<= 1; + if (code >= range) + { + code -= range; + distance |= 1; + } + */ + } + while (--numDirectBits != 0); + prob = probs + Align; + distance <<= kNumAlignBits; + { + unsigned i = 1; + GET_BIT2(prob + i, i, ; , distance |= 1); + GET_BIT2(prob + i, i, ; , distance |= 2); + GET_BIT2(prob + i, i, ; , distance |= 4); + GET_BIT2(prob + i, i, ; , distance |= 8); + } + if (distance == (UInt32)0xFFFFFFFF) + { + len += kMatchSpecLenStart; + state -= kNumStates; + break; + } + } + } + rep3 = rep2; + rep2 = rep1; + rep1 = rep0; + rep0 = distance + 1; + if (checkDicSize == 0) + { + if (distance >= processedPos) + return SZ_ERROR_DATA; + } + else if (distance >= checkDicSize) + return SZ_ERROR_DATA; + state = (state < kNumStates + kNumLitStates) ? kNumLitStates : kNumLitStates + 3; + /* state = kLiteralNextStates[state]; */ + } + + len += kMatchMinLen; + + { + SizeT rem = limit - dicPos; + unsigned curLen = ((rem < len) ? (unsigned)rem : len); + SizeT pos = (dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0); + + processedPos += curLen; + + len -= curLen; + if (pos + curLen <= dicBufSize) + { + Byte *dest = dic + dicPos; + ptrdiff_t src = (ptrdiff_t)pos - (ptrdiff_t)dicPos; + const Byte *lim = dest + curLen; + dicPos += curLen; + do + *(dest) = (Byte)*(dest + src); + while (++dest != lim); + } + else + { + do + { + dic[dicPos++] = dic[pos]; + if (++pos == dicBufSize) + pos = 0; + } + while (--curLen != 0); + } + } + } + } + while (dicPos < limit && buf < bufLimit); + NORMALIZE; + p->buf = buf; + p->range = range; + p->code = code; + p->remainLen = len; + p->dicPos = dicPos; + p->processedPos = processedPos; + p->reps[0] = rep0; + p->reps[1] = rep1; + p->reps[2] = rep2; + p->reps[3] = rep3; + p->state = state; + + return SZ_OK; +} + +static void MY_FAST_CALL LzmaDec_WriteRem(CLzmaDec *p, SizeT limit) +{ + if (p->remainLen != 0 && p->remainLen < kMatchSpecLenStart) + { + Byte *dic = p->dic; + SizeT dicPos = p->dicPos; + SizeT dicBufSize = p->dicBufSize; + unsigned len = p->remainLen; + UInt32 rep0 = p->reps[0]; + if (limit - dicPos < len) + len = (unsigned)(limit - dicPos); + + if (p->checkDicSize == 0 && p->prop.dicSize - p->processedPos <= len) + p->checkDicSize = p->prop.dicSize; + + p->processedPos += len; + p->remainLen -= len; + while (len-- != 0) + { + dic[dicPos] = dic[(dicPos - rep0) + ((dicPos < rep0) ? dicBufSize : 0)]; + dicPos++; + } + p->dicPos = dicPos; + } +} + +/* LzmaDec_DecodeReal2 decodes LZMA-symbols and sets p->needFlush and p->needInit, if required. */ + +static int MY_FAST_CALL LzmaDec_DecodeReal2(CLzmaDec *p, SizeT limit, const Byte *bufLimit) +{ + do + { + SizeT limit2 = limit; + if (p->checkDicSize == 0) + { + UInt32 rem = p->prop.dicSize - p->processedPos; + if (limit - p->dicPos > rem) + limit2 = p->dicPos + rem; + } + RINOK(LzmaDec_DecodeReal(p, limit2, bufLimit)); + if (p->processedPos >= p->prop.dicSize) + p->checkDicSize = p->prop.dicSize; + LzmaDec_WriteRem(p, limit); + } + while (p->dicPos < limit && p->buf < bufLimit && p->remainLen < kMatchSpecLenStart); + + if (p->remainLen > kMatchSpecLenStart) + { + p->remainLen = kMatchSpecLenStart; + } + return 0; +} + +typedef enum +{ + DUMMY_ERROR, /* unexpected end of input stream */ + DUMMY_LIT, + DUMMY_MATCH, + DUMMY_REP +} ELzmaDummy; + +static ELzmaDummy LzmaDec_TryDummy(const CLzmaDec *p, const Byte *buf, SizeT inSize) +{ + UInt32 range = p->range; + UInt32 code = p->code; + const Byte *bufLimit = buf + inSize; + CLzmaProb *probs = p->probs; + unsigned state = p->state; + ELzmaDummy res; + + { + CLzmaProb *prob; + UInt32 bound; + unsigned ttt; + unsigned posState = (p->processedPos) & ((1 << p->prop.pb) - 1); + + prob = probs + IsMatch + (state << kNumPosBitsMax) + posState; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK + + /* if (bufLimit - buf >= 7) return DUMMY_LIT; */ + + prob = probs + Literal; + if (p->checkDicSize != 0 || p->processedPos != 0) + prob += (LZMA_LIT_SIZE * + ((((p->processedPos) & ((1 << (p->prop.lp)) - 1)) << p->prop.lc) + + (p->dic[(p->dicPos == 0 ? p->dicBufSize : p->dicPos) - 1] >> (8 - p->prop.lc)))); + + if (state < kNumLitStates) + { + unsigned symbol = 1; + do { GET_BIT_CHECK(prob + symbol, symbol) } while (symbol < 0x100); + } + else + { + unsigned matchByte = p->dic[p->dicPos - p->reps[0] + + ((p->dicPos < p->reps[0]) ? p->dicBufSize : 0)]; + unsigned offs = 0x100; + unsigned symbol = 1; + do + { + unsigned bit; + CLzmaProb *probLit; + matchByte <<= 1; + bit = (matchByte & offs); + probLit = prob + offs + bit + symbol; + GET_BIT2_CHECK(probLit, symbol, offs &= ~bit, offs &= bit) + } + while (symbol < 0x100); + } + res = DUMMY_LIT; + } + else + { + unsigned len; + UPDATE_1_CHECK; + + prob = probs + IsRep + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + state = 0; + prob = probs + LenCoder; + res = DUMMY_MATCH; + } + else + { + UPDATE_1_CHECK; + res = DUMMY_REP; + prob = probs + IsRepG0 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + prob = probs + IsRep0Long + (state << kNumPosBitsMax) + posState; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + NORMALIZE_CHECK; + return DUMMY_REP; + } + else + { + UPDATE_1_CHECK; + } + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG1 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + prob = probs + IsRepG2 + state; + IF_BIT_0_CHECK(prob) + { + UPDATE_0_CHECK; + } + else + { + UPDATE_1_CHECK; + } + } + } + state = kNumStates; + prob = probs + RepLenCoder; + } + { + unsigned limit, offset; + CLzmaProb *probLen = prob + LenChoice; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenLow + (posState << kLenNumLowBits); + offset = 0; + limit = 1 << kLenNumLowBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenChoice2; + IF_BIT_0_CHECK(probLen) + { + UPDATE_0_CHECK; + probLen = prob + LenMid + (posState << kLenNumMidBits); + offset = kLenNumLowSymbols; + limit = 1 << kLenNumMidBits; + } + else + { + UPDATE_1_CHECK; + probLen = prob + LenHigh; + offset = kLenNumLowSymbols + kLenNumMidSymbols; + limit = 1 << kLenNumHighBits; + } + } + TREE_DECODE_CHECK(probLen, limit, len); + len += offset; + } + + if (state < 4) + { + unsigned posSlot; + prob = probs + PosSlot + + ((len < kNumLenToPosStates ? len : kNumLenToPosStates - 1) << + kNumPosSlotBits); + TREE_DECODE_CHECK(prob, 1 << kNumPosSlotBits, posSlot); + if (posSlot >= kStartPosModelIndex) + { + int numDirectBits = ((posSlot >> 1) - 1); + + /* if (bufLimit - buf >= 8) return DUMMY_MATCH; */ + + if (posSlot < kEndPosModelIndex) + { + prob = probs + SpecPos + ((2 | (posSlot & 1)) << numDirectBits) - posSlot - 1; + } + else + { + numDirectBits -= kNumAlignBits; + do + { + NORMALIZE_CHECK + range >>= 1; + code -= range & (((code - range) >> 31) - 1); + /* if (code >= range) code -= range; */ + } + while (--numDirectBits != 0); + prob = probs + Align; + numDirectBits = kNumAlignBits; + } + { + unsigned i = 1; + do + { + GET_BIT_CHECK(prob + i, i); + } + while(--numDirectBits != 0); + } + } + } + } + } + NORMALIZE_CHECK; + return res; +} + + +static void LzmaDec_InitRc(CLzmaDec *p, const Byte *data) +{ + p->code = ((UInt32)data[1] << 24) | ((UInt32)data[2] << 16) | ((UInt32)data[3] << 8) | ((UInt32)data[4]); + p->range = 0xFFFFFFFF; + p->needFlush = 0; +} + +void LzmaDec_InitDicAndState(CLzmaDec *p, Bool initDic, Bool initState) +{ + p->needFlush = 1; + p->remainLen = 0; + p->tempBufSize = 0; + + if (initDic) + { + p->processedPos = 0; + p->checkDicSize = 0; + p->needInitState = 1; + } + if (initState) + p->needInitState = 1; +} + +void LzmaDec_Init(CLzmaDec *p) +{ + p->dicPos = 0; + LzmaDec_InitDicAndState(p, True, True); +} + +static void LzmaDec_InitStateReal(CLzmaDec *p) +{ + UInt32 numProbs = Literal + ((UInt32)LZMA_LIT_SIZE << (p->prop.lc + p->prop.lp)); + UInt32 i; + CLzmaProb *probs = p->probs; + for (i = 0; i < numProbs; i++) + probs[i] = kBitModelTotal >> 1; + p->reps[0] = p->reps[1] = p->reps[2] = p->reps[3] = 1; + p->state = 0; + p->needInitState = 0; +} + +SRes LzmaDec_DecodeToDic(CLzmaDec *p, SizeT dicLimit, const Byte *src, SizeT *srcLen, + ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT inSize = *srcLen; + (*srcLen) = 0; + LzmaDec_WriteRem(p, dicLimit); + + *status = LZMA_STATUS_NOT_SPECIFIED; + + while (p->remainLen != kMatchSpecLenStart) + { + int checkEndMarkNow; + + if (p->needFlush != 0) + { + for (; inSize > 0 && p->tempBufSize < RC_INIT_SIZE; (*srcLen)++, inSize--) + p->tempBuf[p->tempBufSize++] = *src++; + if (p->tempBufSize < RC_INIT_SIZE) + { + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (p->tempBuf[0] != 0) + return SZ_ERROR_DATA; + + LzmaDec_InitRc(p, p->tempBuf); + p->tempBufSize = 0; + } + + checkEndMarkNow = 0; + if (p->dicPos >= dicLimit) + { + if (p->remainLen == 0 && p->code == 0) + { + *status = LZMA_STATUS_MAYBE_FINISHED_WITHOUT_MARK; + return SZ_OK; + } + if (finishMode == LZMA_FINISH_ANY) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_OK; + } + if (p->remainLen != 0) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + checkEndMarkNow = 1; + } + + if (p->needInitState) + LzmaDec_InitStateReal(p); + + if (p->tempBufSize == 0) + { + SizeT processed; + const Byte *bufLimit; + if (inSize < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, src, inSize); + if (dummyRes == DUMMY_ERROR) + { + memcpy(p->tempBuf, src, inSize); + p->tempBufSize = (unsigned)inSize; + (*srcLen) += inSize; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + bufLimit = src; + } + else + bufLimit = src + inSize - LZMA_REQUIRED_INPUT_MAX; + p->buf = src; + if (LzmaDec_DecodeReal2(p, dicLimit, bufLimit) != 0) + return SZ_ERROR_DATA; + processed = p->buf - src; + (*srcLen) += processed; + src += processed; + inSize -= processed; + } + else + { + unsigned rem = p->tempBufSize, lookAhead = 0; + while (rem < LZMA_REQUIRED_INPUT_MAX && lookAhead < inSize) + p->tempBuf[rem++] = src[lookAhead++]; + p->tempBufSize = rem; + if (rem < LZMA_REQUIRED_INPUT_MAX || checkEndMarkNow) + { + int dummyRes = LzmaDec_TryDummy(p, p->tempBuf, rem); + if (dummyRes == DUMMY_ERROR) + { + (*srcLen) += lookAhead; + *status = LZMA_STATUS_NEEDS_MORE_INPUT; + return SZ_OK; + } + if (checkEndMarkNow && dummyRes != DUMMY_MATCH) + { + *status = LZMA_STATUS_NOT_FINISHED; + return SZ_ERROR_DATA; + } + } + p->buf = p->tempBuf; + if (LzmaDec_DecodeReal2(p, dicLimit, p->buf) != 0) + return SZ_ERROR_DATA; + lookAhead -= (rem - (unsigned)(p->buf - p->tempBuf)); + (*srcLen) += lookAhead; + src += lookAhead; + inSize -= lookAhead; + p->tempBufSize = 0; + } + } + if (p->code == 0) + *status = LZMA_STATUS_FINISHED_WITH_MARK; + return (p->code == 0) ? SZ_OK : SZ_ERROR_DATA; +} + +SRes LzmaDec_DecodeToBuf(CLzmaDec *p, Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, ELzmaFinishMode finishMode, ELzmaStatus *status) +{ + SizeT outSize = *destLen; + SizeT inSize = *srcLen; + *srcLen = *destLen = 0; + for (;;) + { + SizeT inSizeCur = inSize, outSizeCur, dicPos; + ELzmaFinishMode curFinishMode; + SRes res; + if (p->dicPos == p->dicBufSize) + p->dicPos = 0; + dicPos = p->dicPos; + if (outSize > p->dicBufSize - dicPos) + { + outSizeCur = p->dicBufSize; + curFinishMode = LZMA_FINISH_ANY; + } + else + { + outSizeCur = dicPos + outSize; + curFinishMode = finishMode; + } + + res = LzmaDec_DecodeToDic(p, outSizeCur, src, &inSizeCur, curFinishMode, status); + src += inSizeCur; + inSize -= inSizeCur; + *srcLen += inSizeCur; + outSizeCur = p->dicPos - dicPos; + memcpy(dest, p->dic + dicPos, outSizeCur); + dest += outSizeCur; + outSize -= outSizeCur; + *destLen += outSizeCur; + if (res != 0) + return res; + if (outSizeCur == 0 || outSize == 0) + return SZ_OK; + } +} + +void LzmaDec_FreeProbs(CLzmaDec *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->probs); + p->probs = 0; +} + +static void LzmaDec_FreeDict(CLzmaDec *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->dic); + p->dic = 0; +} + +void LzmaDec_Free(CLzmaDec *p, ISzAlloc *alloc) +{ + LzmaDec_FreeProbs(p, alloc); + LzmaDec_FreeDict(p, alloc); +} + +SRes LzmaProps_Decode(CLzmaProps *p, const Byte *data, unsigned size) +{ + UInt32 dicSize; + Byte d; + + if (size < LZMA_PROPS_SIZE) + return SZ_ERROR_UNSUPPORTED; + else + dicSize = data[1] | ((UInt32)data[2] << 8) | ((UInt32)data[3] << 16) | ((UInt32)data[4] << 24); + + if (dicSize < LZMA_DIC_MIN) + dicSize = LZMA_DIC_MIN; + p->dicSize = dicSize; + + d = data[0]; + if (d >= (9 * 5 * 5)) + return SZ_ERROR_UNSUPPORTED; + + p->lc = d % 9; + d /= 9; + p->pb = d / 5; + p->lp = d % 5; + + return SZ_OK; +} + +static SRes LzmaDec_AllocateProbs2(CLzmaDec *p, const CLzmaProps *propNew, ISzAlloc *alloc) +{ + UInt32 numProbs = LzmaProps_GetNumProbs(propNew); + if (p->probs == 0 || numProbs != p->numProbs) + { + LzmaDec_FreeProbs(p, alloc); + p->probs = (CLzmaProb *)alloc->Alloc(alloc, numProbs * sizeof(CLzmaProb)); + p->numProbs = numProbs; + if (p->probs == 0) + return SZ_ERROR_MEM; + } + return SZ_OK; +} + +SRes LzmaDec_AllocateProbs(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +{ + CLzmaProps propNew; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDec_Allocate(CLzmaDec *p, const Byte *props, unsigned propsSize, ISzAlloc *alloc) +{ + CLzmaProps propNew; + SizeT dicBufSize; + RINOK(LzmaProps_Decode(&propNew, props, propsSize)); + RINOK(LzmaDec_AllocateProbs2(p, &propNew, alloc)); + dicBufSize = propNew.dicSize; + if (p->dic == 0 || dicBufSize != p->dicBufSize) + { + LzmaDec_FreeDict(p, alloc); + p->dic = (Byte *)alloc->Alloc(alloc, dicBufSize); + if (p->dic == 0) + { + LzmaDec_FreeProbs(p, alloc); + return SZ_ERROR_MEM; + } + } + p->dicBufSize = dicBufSize; + p->prop = propNew; + return SZ_OK; +} + +SRes LzmaDecode(Byte *dest, SizeT *destLen, const Byte *src, SizeT *srcLen, + const Byte *propData, unsigned propSize, ELzmaFinishMode finishMode, + ELzmaStatus *status, ISzAlloc *alloc) +{ + CLzmaDec p; + SRes res; + SizeT inSize = *srcLen; + SizeT outSize = *destLen; + *srcLen = *destLen = 0; + if (inSize < RC_INIT_SIZE) + return SZ_ERROR_INPUT_EOF; + + LzmaDec_Construct(&p); + res = LzmaDec_AllocateProbs(&p, propData, propSize, alloc); + if (res != 0) + return res; + p.dic = dest; + p.dicBufSize = outSize; + + LzmaDec_Init(&p); + + *srcLen = inSize; + res = LzmaDec_DecodeToDic(&p, outSize, src, srcLen, finishMode, status); + + if (res == SZ_OK && *status == LZMA_STATUS_NEEDS_MORE_INPUT) + res = SZ_ERROR_INPUT_EOF; + + (*destLen) = p.dicPos; + LzmaDec_FreeProbs(&p, alloc); + return res; +} diff --git a/lib/LzmaEnc.c b/lib/LzmaEnc.c new file mode 100644 index 000000000..9f7e16771 --- /dev/null +++ b/lib/LzmaEnc.c @@ -0,0 +1,2353 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1999-2008 Igor Pavlov + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* + * This code was taken from LZMA SDK 4.58 beta, and was slightly modified + * to adapt it to GRUB's requirement. + * + * See , for more information about LZMA. + */ + +#include +#include + +#include + +#include +#ifdef COMPRESS_MF_MT +#include +#endif + +/* #define SHOW_STAT */ +/* #define SHOW_STAT2 */ + +#ifdef SHOW_STAT +static int ttt = 0; +#endif + +#define kBlockSizeMax ((1 << LZMA_NUM_BLOCK_SIZE_BITS) - 1) + +#define kBlockSize (9 << 10) +#define kUnpackBlockSize (1 << 18) +#define kMatchArraySize (1 << 21) +#define kMatchRecordMaxSize ((LZMA_MATCH_LEN_MAX * 2 + 3) * LZMA_MATCH_LEN_MAX) + +#define kNumMaxDirectBits (31) + +#define kNumTopBits 24 +#define kTopValue ((UInt32)1 << kNumTopBits) + +#define kNumBitModelTotalBits 11 +#define kBitModelTotal (1 << kNumBitModelTotalBits) +#define kNumMoveBits 5 +#define kProbInitValue (kBitModelTotal >> 1) + +#define kNumMoveReducingBits 4 +#define kNumBitPriceShiftBits 4 +#define kBitPrice (1 << kNumBitPriceShiftBits) + +void LzmaEncProps_Init(CLzmaEncProps *p) +{ + p->level = 5; + p->dictSize = p->mc = 0; + p->lc = p->lp = p->pb = p->algo = p->fb = p->btMode = p->numHashBytes = p->numThreads = -1; + p->writeEndMark = 0; +} + +void LzmaEncProps_Normalize(CLzmaEncProps *p) +{ + int level = p->level; + if (level < 0) level = 5; + p->level = level; + if (p->dictSize == 0) p->dictSize = (level <= 5 ? (1 << (level * 2 + 14)) : (level == 6 ? (1 << 25) : (1 << 26))); + if (p->lc < 0) p->lc = 3; + if (p->lp < 0) p->lp = 0; + if (p->pb < 0) p->pb = 2; + if (p->algo < 0) p->algo = (level < 5 ? 0 : 1); + if (p->fb < 0) p->fb = (level < 7 ? 32 : 64); + if (p->btMode < 0) p->btMode = (p->algo == 0 ? 0 : 1); + if (p->numHashBytes < 0) p->numHashBytes = 4; + if (p->mc == 0) p->mc = (16 + (p->fb >> 1)) >> (p->btMode ? 0 : 1); + if (p->numThreads < 0) p->numThreads = ((p->btMode && p->algo) ? 2 : 1); +} + +UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2) +{ + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + return props.dictSize; +} + +/* #define LZMA_LOG_BSR */ +/* Define it for Intel's CPU */ + + +#ifdef LZMA_LOG_BSR + +#define kDicLogSizeMaxCompress 30 + +#define BSR2_RET(pos, res) { unsigned long i; _BitScanReverse(&i, (pos)); res = (i + i) + ((pos >> (i - 1)) & 1); } + +UInt32 GetPosSlot1(UInt32 pos) +{ + UInt32 res; + BSR2_RET(pos, res); + return res; +} +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < 2) res = pos; else BSR2_RET(pos, res); } + +#else + +#define kNumLogBits (9 + (int)sizeof(size_t) / 2) +#define kDicLogSizeMaxCompress ((kNumLogBits - 1) * 2 + 7) + +void LzmaEnc_FastPosInit(Byte *g_FastPos) +{ + int c = 2, slotFast; + g_FastPos[0] = 0; + g_FastPos[1] = 1; + + for (slotFast = 2; slotFast < kNumLogBits * 2; slotFast++) + { + UInt32 k = (1 << ((slotFast >> 1) - 1)); + UInt32 j; + for (j = 0; j < k; j++, c++) + g_FastPos[c] = (Byte)slotFast; + } +} + +#define BSR2_RET(pos, res) { UInt32 i = 6 + ((kNumLogBits - 1) & \ + (0 - (((((UInt32)1 << (kNumLogBits + 6)) - 1) - pos) >> 31))); \ + res = p->g_FastPos[pos >> i] + (i * 2); } +/* +#define BSR2_RET(pos, res) { res = (pos < (1 << (kNumLogBits + 6))) ? \ + p->g_FastPos[pos >> 6] + 12 : \ + p->g_FastPos[pos >> (6 + kNumLogBits - 1)] + (6 + (kNumLogBits - 1)) * 2; } +*/ + +#define GetPosSlot1(pos) p->g_FastPos[pos] +#define GetPosSlot2(pos, res) { BSR2_RET(pos, res); } +#define GetPosSlot(pos, res) { if (pos < kNumFullDistances) res = p->g_FastPos[pos]; else BSR2_RET(pos, res); } + +#endif + + +#define LZMA_NUM_REPS 4 + +typedef unsigned CState; + +typedef struct _COptimal +{ + UInt32 price; + + CState state; + int prev1IsChar; + int prev2; + + UInt32 posPrev2; + UInt32 backPrev2; + + UInt32 posPrev; + UInt32 backPrev; + UInt32 backs[LZMA_NUM_REPS]; +} COptimal; + +#define kNumOpts (1 << 12) + +#define kNumLenToPosStates 4 +#define kNumPosSlotBits 6 +#define kDicLogSizeMin 0 +#define kDicLogSizeMax 32 +#define kDistTableSizeMax (kDicLogSizeMax * 2) + + +#define kNumAlignBits 4 +#define kAlignTableSize (1 << kNumAlignBits) +#define kAlignMask (kAlignTableSize - 1) + +#define kStartPosModelIndex 4 +#define kEndPosModelIndex 14 +#define kNumPosModels (kEndPosModelIndex - kStartPosModelIndex) + +#define kNumFullDistances (1 << (kEndPosModelIndex / 2)) + +#ifdef _LZMA_PROB32 +#define CLzmaProb UInt32 +#else +#define CLzmaProb UInt16 +#endif + +#define LZMA_PB_MAX 4 +#define LZMA_LC_MAX 8 +#define LZMA_LP_MAX 4 + +#define LZMA_NUM_PB_STATES_MAX (1 << LZMA_PB_MAX) + + +#define kLenNumLowBits 3 +#define kLenNumLowSymbols (1 << kLenNumLowBits) +#define kLenNumMidBits 3 +#define kLenNumMidSymbols (1 << kLenNumMidBits) +#define kLenNumHighBits 8 +#define kLenNumHighSymbols (1 << kLenNumHighBits) + +#define kLenNumSymbolsTotal (kLenNumLowSymbols + kLenNumMidSymbols + kLenNumHighSymbols) + +#define LZMA_MATCH_LEN_MIN 2 +#define LZMA_MATCH_LEN_MAX (LZMA_MATCH_LEN_MIN + kLenNumSymbolsTotal - 1) + +#define kNumStates 12 + +typedef struct +{ + CLzmaProb choice; + CLzmaProb choice2; + CLzmaProb low[LZMA_NUM_PB_STATES_MAX << kLenNumLowBits]; + CLzmaProb mid[LZMA_NUM_PB_STATES_MAX << kLenNumMidBits]; + CLzmaProb high[kLenNumHighSymbols]; +} CLenEnc; + +typedef struct +{ + CLenEnc p; + UInt32 prices[LZMA_NUM_PB_STATES_MAX][kLenNumSymbolsTotal]; + UInt32 tableSize; + UInt32 counters[LZMA_NUM_PB_STATES_MAX]; +} CLenPriceEnc; + +typedef struct _CRangeEnc +{ + UInt32 range; + Byte cache; + UInt64 low; + UInt64 cacheSize; + Byte *buf; + Byte *bufLim; + Byte *bufBase; + ISeqOutStream *outStream; + UInt64 processed; + SRes res; +} CRangeEnc; + +typedef struct _CSeqInStreamBuf +{ + ISeqInStream funcTable; + const Byte *data; + SizeT rem; +} CSeqInStreamBuf; + +static SRes MyRead(void *pp, void *data, size_t *size) +{ + size_t curSize = *size; + CSeqInStreamBuf *p = (CSeqInStreamBuf *)pp; + if (p->rem < curSize) + curSize = p->rem; + memcpy(data, p->data, curSize); + p->rem -= curSize; + p->data += curSize; + *size = curSize; + return SZ_OK; +} + +typedef struct +{ + CLzmaProb *litProbs; + + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + + CLenPriceEnc lenEnc; + CLenPriceEnc repLenEnc; + + UInt32 reps[LZMA_NUM_REPS]; + UInt32 state; +} CSaveState; + +typedef struct _CLzmaEnc +{ + IMatchFinder matchFinder; + void *matchFinderObj; + + #ifdef COMPRESS_MF_MT + Bool mtMode; + CMatchFinderMt matchFinderMt; + #endif + + CMatchFinder matchFinderBase; + + #ifdef COMPRESS_MF_MT + Byte pad[128]; + #endif + + UInt32 optimumEndIndex; + UInt32 optimumCurrentIndex; + + Bool longestMatchWasFound; + UInt32 longestMatchLength; + UInt32 numDistancePairs; + + COptimal opt[kNumOpts]; + + #ifndef LZMA_LOG_BSR + Byte g_FastPos[1 << kNumLogBits]; + #endif + + UInt32 ProbPrices[kBitModelTotal >> kNumMoveReducingBits]; + UInt32 matchDistances[LZMA_MATCH_LEN_MAX * 2 + 2 + 1]; + UInt32 numFastBytes; + UInt32 additionalOffset; + UInt32 reps[LZMA_NUM_REPS]; + UInt32 state; + + UInt32 posSlotPrices[kNumLenToPosStates][kDistTableSizeMax]; + UInt32 distancesPrices[kNumLenToPosStates][kNumFullDistances]; + UInt32 alignPrices[kAlignTableSize]; + UInt32 alignPriceCount; + + UInt32 distTableSize; + + unsigned lc, lp, pb; + unsigned lpMask, pbMask; + + CLzmaProb *litProbs; + + CLzmaProb isMatch[kNumStates][LZMA_NUM_PB_STATES_MAX]; + CLzmaProb isRep[kNumStates]; + CLzmaProb isRepG0[kNumStates]; + CLzmaProb isRepG1[kNumStates]; + CLzmaProb isRepG2[kNumStates]; + CLzmaProb isRep0Long[kNumStates][LZMA_NUM_PB_STATES_MAX]; + + CLzmaProb posSlotEncoder[kNumLenToPosStates][1 << kNumPosSlotBits]; + CLzmaProb posEncoders[kNumFullDistances - kEndPosModelIndex]; + CLzmaProb posAlignEncoder[1 << kNumAlignBits]; + + CLenPriceEnc lenEnc; + CLenPriceEnc repLenEnc; + + unsigned lclp; + + Bool fastMode; + + CRangeEnc rc; + + Bool writeEndMark; + UInt64 nowPos64; + UInt32 matchPriceCount; + Bool finished; + Bool multiThread; + + SRes result; + UInt32 dictSize; + UInt32 matchFinderCycles; + + ISeqInStream *inStream; + CSeqInStreamBuf seqBufInStream; + + CSaveState saveState; +} CLzmaEnc; + +void LzmaEnc_SaveState(CLzmaEncHandle pp) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CSaveState *dest = &p->saveState; + int i; + dest->lenEnc = p->lenEnc; + dest->repLenEnc = p->repLenEnc; + dest->state = p->state; + + for (i = 0; i < kNumStates; i++) + { + memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); + memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); + } + for (i = 0; i < kNumLenToPosStates; i++) + memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); + memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); + memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); + memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); + memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); + memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); + memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); + memcpy(dest->reps, p->reps, sizeof(p->reps)); + memcpy(dest->litProbs, p->litProbs, (0x300 << p->lclp) * sizeof(CLzmaProb)); +} + +void LzmaEnc_RestoreState(CLzmaEncHandle pp) +{ + CLzmaEnc *dest = (CLzmaEnc *)pp; + const CSaveState *p = &dest->saveState; + int i; + dest->lenEnc = p->lenEnc; + dest->repLenEnc = p->repLenEnc; + dest->state = p->state; + + for (i = 0; i < kNumStates; i++) + { + memcpy(dest->isMatch[i], p->isMatch[i], sizeof(p->isMatch[i])); + memcpy(dest->isRep0Long[i], p->isRep0Long[i], sizeof(p->isRep0Long[i])); + } + for (i = 0; i < kNumLenToPosStates; i++) + memcpy(dest->posSlotEncoder[i], p->posSlotEncoder[i], sizeof(p->posSlotEncoder[i])); + memcpy(dest->isRep, p->isRep, sizeof(p->isRep)); + memcpy(dest->isRepG0, p->isRepG0, sizeof(p->isRepG0)); + memcpy(dest->isRepG1, p->isRepG1, sizeof(p->isRepG1)); + memcpy(dest->isRepG2, p->isRepG2, sizeof(p->isRepG2)); + memcpy(dest->posEncoders, p->posEncoders, sizeof(p->posEncoders)); + memcpy(dest->posAlignEncoder, p->posAlignEncoder, sizeof(p->posAlignEncoder)); + memcpy(dest->reps, p->reps, sizeof(p->reps)); + memcpy(dest->litProbs, p->litProbs, (0x300 << dest->lclp) * sizeof(CLzmaProb)); +} + +SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + CLzmaEncProps props = *props2; + LzmaEncProps_Normalize(&props); + + if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || + props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) + return SZ_ERROR_PARAM; + p->dictSize = props.dictSize; + p->matchFinderCycles = props.mc; + { + unsigned fb = props.fb; + if (fb < 5) + fb = 5; + if (fb > LZMA_MATCH_LEN_MAX) + fb = LZMA_MATCH_LEN_MAX; + p->numFastBytes = fb; + } + p->lc = props.lc; + p->lp = props.lp; + p->pb = props.pb; + p->fastMode = (props.algo == 0); + p->matchFinderBase.btMode = props.btMode; + { + UInt32 numHashBytes = 4; + if (props.btMode) + { + if (props.numHashBytes < 2) + numHashBytes = 2; + else if (props.numHashBytes < 4) + numHashBytes = props.numHashBytes; + } + p->matchFinderBase.numHashBytes = numHashBytes; + } + + p->matchFinderBase.cutValue = props.mc; + + p->writeEndMark = props.writeEndMark; + + #ifdef COMPRESS_MF_MT + /* + if (newMultiThread != _multiThread) + { + ReleaseMatchFinder(); + _multiThread = newMultiThread; + } + */ + p->multiThread = (props.numThreads > 1); + #endif + + return SZ_OK; +} + +static const int kLiteralNextStates[kNumStates] = {0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 4, 5}; +static const int kMatchNextStates[kNumStates] = {7, 7, 7, 7, 7, 7, 7, 10, 10, 10, 10, 10}; +static const int kRepNextStates[kNumStates] = {8, 8, 8, 8, 8, 8, 8, 11, 11, 11, 11, 11}; +static const int kShortRepNextStates[kNumStates]= {9, 9, 9, 9, 9, 9, 9, 11, 11, 11, 11, 11}; + +/* + void UpdateChar() { Index = kLiteralNextStates[Index]; } + void UpdateMatch() { Index = kMatchNextStates[Index]; } + void UpdateRep() { Index = kRepNextStates[Index]; } + void UpdateShortRep() { Index = kShortRepNextStates[Index]; } +*/ + +#define IsCharState(s) ((s) < 7) + + +#define GetLenToPosState(len) (((len) < kNumLenToPosStates + 1) ? (len) - 2 : kNumLenToPosStates - 1) + +#define kInfinityPrice (1 << 30) + +static void RangeEnc_Construct(CRangeEnc *p) +{ + p->outStream = 0; + p->bufBase = 0; +} + +#define RangeEnc_GetProcessed(p) ((p)->processed + ((p)->buf - (p)->bufBase) + (p)->cacheSize) + +#define RC_BUF_SIZE (1 << 16) +static int RangeEnc_Alloc(CRangeEnc *p, ISzAlloc *alloc) +{ + if (p->bufBase == 0) + { + p->bufBase = (Byte *)alloc->Alloc(alloc, RC_BUF_SIZE); + if (p->bufBase == 0) + return 0; + p->bufLim = p->bufBase + RC_BUF_SIZE; + } + return 1; +} + +static void RangeEnc_Free(CRangeEnc *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->bufBase); + p->bufBase = 0; +} + +static void RangeEnc_Init(CRangeEnc *p) +{ + /* Stream.Init(); */ + p->low = 0; + p->range = 0xFFFFFFFF; + p->cacheSize = 1; + p->cache = 0; + + p->buf = p->bufBase; + + p->processed = 0; + p->res = SZ_OK; +} + +static void RangeEnc_FlushStream(CRangeEnc *p) +{ + size_t num; + if (p->res != SZ_OK) + return; + num = p->buf - p->bufBase; + if (num != p->outStream->Write(p->outStream, p->bufBase, num)) + p->res = SZ_ERROR_WRITE; + p->processed += num; + p->buf = p->bufBase; +} + +static void MY_FAST_CALL RangeEnc_ShiftLow(CRangeEnc *p) +{ + if ((UInt32)p->low < (UInt32)0xFF000000 || (int)(p->low >> 32) != 0) + { + Byte temp = p->cache; + do + { + Byte *buf = p->buf; + *buf++ = (Byte)(temp + (Byte)(p->low >> 32)); + p->buf = buf; + if (buf == p->bufLim) + RangeEnc_FlushStream(p); + temp = 0xFF; + } + while (--p->cacheSize != 0); + p->cache = (Byte)((UInt32)p->low >> 24); + } + p->cacheSize++; + p->low = (UInt32)p->low << 8; +} + +static void RangeEnc_FlushData(CRangeEnc *p) +{ + int i; + for (i = 0; i < 5; i++) + RangeEnc_ShiftLow(p); +} + +static void RangeEnc_EncodeDirectBits(CRangeEnc *p, UInt32 value, int numBits) +{ + do + { + p->range >>= 1; + p->low += p->range & (0 - ((value >> --numBits) & 1)); + if (p->range < kTopValue) + { + p->range <<= 8; + RangeEnc_ShiftLow(p); + } + } + while (numBits != 0); +} + +static void RangeEnc_EncodeBit(CRangeEnc *p, CLzmaProb *prob, UInt32 symbol) +{ + UInt32 ttt = *prob; + UInt32 newBound = (p->range >> kNumBitModelTotalBits) * ttt; + if (symbol == 0) + { + p->range = newBound; + ttt += (kBitModelTotal - ttt) >> kNumMoveBits; + } + else + { + p->low += newBound; + p->range -= newBound; + ttt -= ttt >> kNumMoveBits; + } + *prob = (CLzmaProb)ttt; + if (p->range < kTopValue) + { + p->range <<= 8; + RangeEnc_ShiftLow(p); + } +} + +static void LitEnc_Encode(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol) +{ + symbol |= 0x100; + do + { + RangeEnc_EncodeBit(p, probs + (symbol >> 8), (symbol >> 7) & 1); + symbol <<= 1; + } + while (symbol < 0x10000); +} + +static void LitEnc_EncodeMatched(CRangeEnc *p, CLzmaProb *probs, UInt32 symbol, UInt32 matchByte) +{ + UInt32 offs = 0x100; + symbol |= 0x100; + do + { + matchByte <<= 1; + RangeEnc_EncodeBit(p, probs + (offs + (matchByte & offs) + (symbol >> 8)), (symbol >> 7) & 1); + symbol <<= 1; + offs &= ~(matchByte ^ symbol); + } + while (symbol < 0x10000); +} + +void LzmaEnc_InitPriceTables(UInt32 *ProbPrices) +{ + UInt32 i; + for (i = (1 << kNumMoveReducingBits) / 2; i < kBitModelTotal; i += (1 << kNumMoveReducingBits)) + { + const int kCyclesBits = kNumBitPriceShiftBits; + UInt32 w = i; + UInt32 bitCount = 0; + int j; + for (j = 0; j < kCyclesBits; j++) + { + w = w * w; + bitCount <<= 1; + while (w >= ((UInt32)1 << 16)) + { + w >>= 1; + bitCount++; + } + } + ProbPrices[i >> kNumMoveReducingBits] = ((kNumBitModelTotalBits << kCyclesBits) - 15 - bitCount); + } +} + + +#define GET_PRICE(prob, symbol) \ + p->ProbPrices[((prob) ^ (((-(int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICEa(prob, symbol) \ + ProbPrices[((prob) ^ ((-((int)(symbol))) & (kBitModelTotal - 1))) >> kNumMoveReducingBits]; + +#define GET_PRICE_0(prob) p->ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICE_1(prob) p->ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + +#define GET_PRICE_0a(prob) ProbPrices[(prob) >> kNumMoveReducingBits] +#define GET_PRICE_1a(prob) ProbPrices[((prob) ^ (kBitModelTotal - 1)) >> kNumMoveReducingBits] + +static UInt32 LitEnc_GetPrice(const CLzmaProb *probs, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + symbol |= 0x100; + do + { + price += GET_PRICEa(probs[symbol >> 8], (symbol >> 7) & 1); + symbol <<= 1; + } + while (symbol < 0x10000); + return price; +}; + +static UInt32 LitEnc_GetPriceMatched(const CLzmaProb *probs, UInt32 symbol, UInt32 matchByte, UInt32 *ProbPrices) +{ + UInt32 price = 0; + UInt32 offs = 0x100; + symbol |= 0x100; + do + { + matchByte <<= 1; + price += GET_PRICEa(probs[offs + (matchByte & offs) + (symbol >> 8)], (symbol >> 7) & 1); + symbol <<= 1; + offs &= ~(matchByte ^ symbol); + } + while (symbol < 0x10000); + return price; +}; + + +static void RcTree_Encode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) +{ + UInt32 m = 1; + int i; + for (i = numBitLevels; i != 0 ;) + { + UInt32 bit; + i--; + bit = (symbol >> i) & 1; + RangeEnc_EncodeBit(rc, probs + m, bit); + m = (m << 1) | bit; + } +}; + +static void RcTree_ReverseEncode(CRangeEnc *rc, CLzmaProb *probs, int numBitLevels, UInt32 symbol) +{ + UInt32 m = 1; + int i; + for (i = 0; i < numBitLevels; i++) + { + UInt32 bit = symbol & 1; + RangeEnc_EncodeBit(rc, probs + m, bit); + m = (m << 1) | bit; + symbol >>= 1; + } +} + +static UInt32 RcTree_GetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + symbol |= (1 << numBitLevels); + while (symbol != 1) + { + price += GET_PRICEa(probs[symbol >> 1], symbol & 1); + symbol >>= 1; + } + return price; +} + +static UInt32 RcTree_ReverseGetPrice(const CLzmaProb *probs, int numBitLevels, UInt32 symbol, UInt32 *ProbPrices) +{ + UInt32 price = 0; + UInt32 m = 1; + int i; + for (i = numBitLevels; i != 0; i--) + { + UInt32 bit = symbol & 1; + symbol >>= 1; + price += GET_PRICEa(probs[m], bit); + m = (m << 1) | bit; + } + return price; +} + + +static void LenEnc_Init(CLenEnc *p) +{ + unsigned i; + p->choice = p->choice2 = kProbInitValue; + for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumLowBits); i++) + p->low[i] = kProbInitValue; + for (i = 0; i < (LZMA_NUM_PB_STATES_MAX << kLenNumMidBits); i++) + p->mid[i] = kProbInitValue; + for (i = 0; i < kLenNumHighSymbols; i++) + p->high[i] = kProbInitValue; +} + +static void LenEnc_Encode(CLenEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState) +{ + if (symbol < kLenNumLowSymbols) + { + RangeEnc_EncodeBit(rc, &p->choice, 0); + RcTree_Encode(rc, p->low + (posState << kLenNumLowBits), kLenNumLowBits, symbol); + } + else + { + RangeEnc_EncodeBit(rc, &p->choice, 1); + if (symbol < kLenNumLowSymbols + kLenNumMidSymbols) + { + RangeEnc_EncodeBit(rc, &p->choice2, 0); + RcTree_Encode(rc, p->mid + (posState << kLenNumMidBits), kLenNumMidBits, symbol - kLenNumLowSymbols); + } + else + { + RangeEnc_EncodeBit(rc, &p->choice2, 1); + RcTree_Encode(rc, p->high, kLenNumHighBits, symbol - kLenNumLowSymbols - kLenNumMidSymbols); + } + } +} + +static void LenEnc_SetPrices(CLenEnc *p, UInt32 posState, UInt32 numSymbols, UInt32 *prices, UInt32 *ProbPrices) +{ + UInt32 a0 = GET_PRICE_0a(p->choice); + UInt32 a1 = GET_PRICE_1a(p->choice); + UInt32 b0 = a1 + GET_PRICE_0a(p->choice2); + UInt32 b1 = a1 + GET_PRICE_1a(p->choice2); + UInt32 i = 0; + for (i = 0; i < kLenNumLowSymbols; i++) + { + if (i >= numSymbols) + return; + prices[i] = a0 + RcTree_GetPrice(p->low + (posState << kLenNumLowBits), kLenNumLowBits, i, ProbPrices); + } + for (; i < kLenNumLowSymbols + kLenNumMidSymbols; i++) + { + if (i >= numSymbols) + return; + prices[i] = b0 + RcTree_GetPrice(p->mid + (posState << kLenNumMidBits), kLenNumMidBits, i - kLenNumLowSymbols, ProbPrices); + } + for (; i < numSymbols; i++) + prices[i] = b1 + RcTree_GetPrice(p->high, kLenNumHighBits, i - kLenNumLowSymbols - kLenNumMidSymbols, ProbPrices); +} + +static void MY_FAST_CALL LenPriceEnc_UpdateTable(CLenPriceEnc *p, UInt32 posState, UInt32 *ProbPrices) +{ + LenEnc_SetPrices(&p->p, posState, p->tableSize, p->prices[posState], ProbPrices); + p->counters[posState] = p->tableSize; +} + +static void LenPriceEnc_UpdateTables(CLenPriceEnc *p, UInt32 numPosStates, UInt32 *ProbPrices) +{ + UInt32 posState; + for (posState = 0; posState < numPosStates; posState++) + LenPriceEnc_UpdateTable(p, posState, ProbPrices); +} + +static void LenEnc_Encode2(CLenPriceEnc *p, CRangeEnc *rc, UInt32 symbol, UInt32 posState, Bool updatePrice, UInt32 *ProbPrices) +{ + LenEnc_Encode(&p->p, rc, symbol, posState); + if (updatePrice) + if (--p->counters[posState] == 0) + LenPriceEnc_UpdateTable(p, posState, ProbPrices); +} + + + + +static void MovePos(CLzmaEnc *p, UInt32 num) +{ + #ifdef SHOW_STAT + ttt += num; + printf("\n MovePos %d", num); + #endif + if (num != 0) + { + p->additionalOffset += num; + p->matchFinder.Skip(p->matchFinderObj, num); + } +} + +static UInt32 ReadMatchDistances(CLzmaEnc *p, UInt32 *numDistancePairsRes) +{ + UInt32 lenRes = 0, numDistancePairs; + numDistancePairs = p->matchFinder.GetMatches(p->matchFinderObj, p->matchDistances); + #ifdef SHOW_STAT + printf("\n i = %d numPairs = %d ", ttt, numDistancePairs / 2); + if (ttt >= 61994) + ttt = ttt; + + ttt++; + { + UInt32 i; + for (i = 0; i < numDistancePairs; i += 2) + printf("%2d %6d | ", p->matchDistances[i], p->matchDistances[i + 1]); + } + #endif + if (numDistancePairs > 0) + { + lenRes = p->matchDistances[numDistancePairs - 2]; + if (lenRes == p->numFastBytes) + { + UInt32 numAvail = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) + 1; + const Byte *pby = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + UInt32 distance = p->matchDistances[numDistancePairs - 1] + 1; + if (numAvail > LZMA_MATCH_LEN_MAX) + numAvail = LZMA_MATCH_LEN_MAX; + + { + const Byte *pby2 = pby - distance; + for (; lenRes < numAvail && pby[lenRes] == pby2[lenRes]; lenRes++); + } + } + } + p->additionalOffset++; + *numDistancePairsRes = numDistancePairs; + return lenRes; +} + + +#define MakeAsChar(p) (p)->backPrev = (UInt32)(-1); (p)->prev1IsChar = False; +#define MakeAsShortRep(p) (p)->backPrev = 0; (p)->prev1IsChar = False; +#define IsShortRep(p) ((p)->backPrev == 0) + +static UInt32 GetRepLen1Price(CLzmaEnc *p, UInt32 state, UInt32 posState) +{ + return + GET_PRICE_0(p->isRepG0[state]) + + GET_PRICE_0(p->isRep0Long[state][posState]); +} + +static UInt32 GetPureRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 state, UInt32 posState) +{ + UInt32 price; + if (repIndex == 0) + { + price = GET_PRICE_0(p->isRepG0[state]); + price += GET_PRICE_1(p->isRep0Long[state][posState]); + } + else + { + price = GET_PRICE_1(p->isRepG0[state]); + if (repIndex == 1) + price += GET_PRICE_0(p->isRepG1[state]); + else + { + price += GET_PRICE_1(p->isRepG1[state]); + price += GET_PRICE(p->isRepG2[state], repIndex - 2); + } + } + return price; +} + +static UInt32 GetRepPrice(CLzmaEnc *p, UInt32 repIndex, UInt32 len, UInt32 state, UInt32 posState) +{ + return p->repLenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN] + + GetPureRepPrice(p, repIndex, state, posState); +} + +static UInt32 Backward(CLzmaEnc *p, UInt32 *backRes, UInt32 cur) +{ + UInt32 posMem = p->opt[cur].posPrev; + UInt32 backMem = p->opt[cur].backPrev; + p->optimumEndIndex = cur; + do + { + if (p->opt[cur].prev1IsChar) + { + MakeAsChar(&p->opt[posMem]) + p->opt[posMem].posPrev = posMem - 1; + if (p->opt[cur].prev2) + { + p->opt[posMem - 1].prev1IsChar = False; + p->opt[posMem - 1].posPrev = p->opt[cur].posPrev2; + p->opt[posMem - 1].backPrev = p->opt[cur].backPrev2; + } + } + { + UInt32 posPrev = posMem; + UInt32 backCur = backMem; + + backMem = p->opt[posPrev].backPrev; + posMem = p->opt[posPrev].posPrev; + + p->opt[posPrev].backPrev = backCur; + p->opt[posPrev].posPrev = cur; + cur = posPrev; + } + } + while (cur != 0); + *backRes = p->opt[0].backPrev; + p->optimumCurrentIndex = p->opt[0].posPrev; + return p->optimumCurrentIndex; +} + +#define LIT_PROBS(pos, prevByte) (p->litProbs + ((((pos) & p->lpMask) << p->lc) + ((prevByte) >> (8 - p->lc))) * 0x300) + +static UInt32 GetOptimum(CLzmaEnc *p, UInt32 position, UInt32 *backRes) +{ + UInt32 numAvailableBytes, lenMain, numDistancePairs; + const Byte *data; + UInt32 reps[LZMA_NUM_REPS]; + UInt32 repLens[LZMA_NUM_REPS]; + UInt32 repMaxIndex, i; + UInt32 *matchDistances; + Byte currentByte, matchByte; + UInt32 posState; + UInt32 matchPrice, repMatchPrice; + UInt32 lenEnd; + UInt32 len; + UInt32 normalMatchPrice; + UInt32 cur; + if (p->optimumEndIndex != p->optimumCurrentIndex) + { + const COptimal *opt = &p->opt[p->optimumCurrentIndex]; + UInt32 lenRes = opt->posPrev - p->optimumCurrentIndex; + *backRes = opt->backPrev; + p->optimumCurrentIndex = opt->posPrev; + return lenRes; + } + p->optimumCurrentIndex = p->optimumEndIndex = 0; + + numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); + + if (!p->longestMatchWasFound) + { + lenMain = ReadMatchDistances(p, &numDistancePairs); + } + else + { + lenMain = p->longestMatchLength; + numDistancePairs = p->numDistancePairs; + p->longestMatchWasFound = False; + } + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + if (numAvailableBytes < 2) + { + *backRes = (UInt32)(-1); + return 1; + } + if (numAvailableBytes > LZMA_MATCH_LEN_MAX) + numAvailableBytes = LZMA_MATCH_LEN_MAX; + + repMaxIndex = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 lenTest; + const Byte *data2; + reps[i] = p->reps[i]; + data2 = data - (reps[i] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + { + repLens[i] = 0; + continue; + } + for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++); + repLens[i] = lenTest; + if (lenTest > repLens[repMaxIndex]) + repMaxIndex = i; + } + if (repLens[repMaxIndex] >= p->numFastBytes) + { + UInt32 lenRes; + *backRes = repMaxIndex; + lenRes = repLens[repMaxIndex]; + MovePos(p, lenRes - 1); + return lenRes; + } + + matchDistances = p->matchDistances; + if (lenMain >= p->numFastBytes) + { + *backRes = matchDistances[numDistancePairs - 1] + LZMA_NUM_REPS; + MovePos(p, lenMain - 1); + return lenMain; + } + currentByte = *data; + matchByte = *(data - (reps[0] + 1)); + + if (lenMain < 2 && currentByte != matchByte && repLens[repMaxIndex] < 2) + { + *backRes = (UInt32)-1; + return 1; + } + + p->opt[0].state = (CState)p->state; + + posState = (position & p->pbMask); + + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + p->opt[1].price = GET_PRICE_0(p->isMatch[p->state][posState]) + + (!IsCharState(p->state) ? + LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, currentByte, p->ProbPrices)); + } + + MakeAsChar(&p->opt[1]); + + matchPrice = GET_PRICE_1(p->isMatch[p->state][posState]); + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[p->state]); + + if (matchByte == currentByte) + { + UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, p->state, posState); + if (shortRepPrice < p->opt[1].price) + { + p->opt[1].price = shortRepPrice; + MakeAsShortRep(&p->opt[1]); + } + } + lenEnd = ((lenMain >= repLens[repMaxIndex]) ? lenMain : repLens[repMaxIndex]); + + if (lenEnd < 2) + { + *backRes = p->opt[1].backPrev; + return 1; + } + + p->opt[1].posPrev = 0; + for (i = 0; i < LZMA_NUM_REPS; i++) + p->opt[0].backs[i] = reps[i]; + + len = lenEnd; + do + p->opt[len--].price = kInfinityPrice; + while (len >= 2); + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 repLen = repLens[i]; + UInt32 price; + if (repLen < 2) + continue; + price = repMatchPrice + GetPureRepPrice(p, i, p->state, posState); + do + { + UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][repLen - 2]; + COptimal *opt = &p->opt[repLen]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = 0; + opt->backPrev = i; + opt->prev1IsChar = False; + } + } + while (--repLen >= 2); + } + + normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[p->state]); + + len = ((repLens[0] >= 2) ? repLens[0] + 1 : 2); + if (len <= lenMain) + { + UInt32 offs = 0; + while (len > matchDistances[offs]) + offs += 2; + for (; ; len++) + { + COptimal *opt; + UInt32 distance = matchDistances[offs + 1]; + + UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][len - LZMA_MATCH_LEN_MIN]; + UInt32 lenToPosState = GetLenToPosState(len); + if (distance < kNumFullDistances) + curAndLenPrice += p->distancesPrices[lenToPosState][distance]; + else + { + UInt32 slot; + GetPosSlot2(distance, slot); + curAndLenPrice += p->alignPrices[distance & kAlignMask] + p->posSlotPrices[lenToPosState][slot]; + } + opt = &p->opt[len]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = 0; + opt->backPrev = distance + LZMA_NUM_REPS; + opt->prev1IsChar = False; + } + if (len == matchDistances[offs]) + { + offs += 2; + if (offs == numDistancePairs) + break; + } + } + } + + cur = 0; + + #ifdef SHOW_STAT2 + if (position >= 0) + { + unsigned i; + printf("\n pos = %4X", position); + for (i = cur; i <= lenEnd; i++) + printf("\nprice[%4X] = %d", position - cur + i, p->opt[i].price); + } + #endif + + for (;;) + { + UInt32 numAvailableBytesFull, newLen, numDistancePairs; + COptimal *curOpt; + UInt32 posPrev; + UInt32 state; + UInt32 curPrice; + Bool nextIsChar; + const Byte *data; + Byte currentByte, matchByte; + UInt32 posState; + UInt32 curAnd1Price; + COptimal *nextOpt; + UInt32 matchPrice, repMatchPrice; + UInt32 numAvailableBytes; + UInt32 startLen; + + cur++; + if (cur == lenEnd) + return Backward(p, backRes, cur); + + numAvailableBytesFull = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); + newLen = ReadMatchDistances(p, &numDistancePairs); + if (newLen >= p->numFastBytes) + { + p->numDistancePairs = numDistancePairs; + p->longestMatchLength = newLen; + p->longestMatchWasFound = True; + return Backward(p, backRes, cur); + } + position++; + curOpt = &p->opt[cur]; + posPrev = curOpt->posPrev; + if (curOpt->prev1IsChar) + { + posPrev--; + if (curOpt->prev2) + { + state = p->opt[curOpt->posPrev2].state; + if (curOpt->backPrev2 < LZMA_NUM_REPS) + state = kRepNextStates[state]; + else + state = kMatchNextStates[state]; + } + else + state = p->opt[posPrev].state; + state = kLiteralNextStates[state]; + } + else + state = p->opt[posPrev].state; + if (posPrev == cur - 1) + { + if (IsShortRep(curOpt)) + state = kShortRepNextStates[state]; + else + state = kLiteralNextStates[state]; + } + else + { + UInt32 pos; + const COptimal *prevOpt; + if (curOpt->prev1IsChar && curOpt->prev2) + { + posPrev = curOpt->posPrev2; + pos = curOpt->backPrev2; + state = kRepNextStates[state]; + } + else + { + pos = curOpt->backPrev; + if (pos < LZMA_NUM_REPS) + state = kRepNextStates[state]; + else + state = kMatchNextStates[state]; + } + prevOpt = &p->opt[posPrev]; + if (pos < LZMA_NUM_REPS) + { + UInt32 i; + reps[0] = prevOpt->backs[pos]; + for (i = 1; i <= pos; i++) + reps[i] = prevOpt->backs[i - 1]; + for (; i < LZMA_NUM_REPS; i++) + reps[i] = prevOpt->backs[i]; + } + else + { + UInt32 i; + reps[0] = (pos - LZMA_NUM_REPS); + for (i = 1; i < LZMA_NUM_REPS; i++) + reps[i] = prevOpt->backs[i - 1]; + } + } + curOpt->state = (CState)state; + + curOpt->backs[0] = reps[0]; + curOpt->backs[1] = reps[1]; + curOpt->backs[2] = reps[2]; + curOpt->backs[3] = reps[3]; + + curPrice = curOpt->price; + nextIsChar = False; + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + currentByte = *data; + matchByte = *(data - (reps[0] + 1)); + + posState = (position & p->pbMask); + + curAnd1Price = curPrice + GET_PRICE_0(p->isMatch[state][posState]); + { + const CLzmaProb *probs = LIT_PROBS(position, *(data - 1)); + curAnd1Price += + (!IsCharState(state) ? + LitEnc_GetPriceMatched(probs, currentByte, matchByte, p->ProbPrices) : + LitEnc_GetPrice(probs, currentByte, p->ProbPrices)); + } + + nextOpt = &p->opt[cur + 1]; + + if (curAnd1Price < nextOpt->price) + { + nextOpt->price = curAnd1Price; + nextOpt->posPrev = cur; + MakeAsChar(nextOpt); + nextIsChar = True; + } + + matchPrice = curPrice + GET_PRICE_1(p->isMatch[state][posState]); + repMatchPrice = matchPrice + GET_PRICE_1(p->isRep[state]); + + if (matchByte == currentByte && !(nextOpt->posPrev < cur && nextOpt->backPrev == 0)) + { + UInt32 shortRepPrice = repMatchPrice + GetRepLen1Price(p, state, posState); + if (shortRepPrice <= nextOpt->price) + { + nextOpt->price = shortRepPrice; + nextOpt->posPrev = cur; + MakeAsShortRep(nextOpt); + nextIsChar = True; + } + } + + { + UInt32 temp = kNumOpts - 1 - cur; + if (temp < numAvailableBytesFull) + numAvailableBytesFull = temp; + } + numAvailableBytes = numAvailableBytesFull; + + if (numAvailableBytes < 2) + continue; + if (numAvailableBytes > p->numFastBytes) + numAvailableBytes = p->numFastBytes; + if (!nextIsChar && matchByte != currentByte) /* speed optimization */ + { + /* try Literal + rep0 */ + UInt32 temp; + UInt32 lenTest2; + const Byte *data2 = data - (reps[0] + 1); + UInt32 limit = p->numFastBytes + 1; + if (limit > numAvailableBytesFull) + limit = numAvailableBytesFull; + + for (temp = 1; temp < limit && data[temp] == data2[temp]; temp++); + lenTest2 = temp - 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kLiteralNextStates[state]; + UInt32 posStateNext = (position + 1) & p->pbMask; + UInt32 nextRepMatchPrice = curAnd1Price + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 curAndLenPrice; + COptimal *opt; + UInt32 offset = cur + 1 + lenTest2; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = False; + } + } + } + } + + startLen = 2; /* speed optimization */ + { + UInt32 repIndex; + for (repIndex = 0; repIndex < LZMA_NUM_REPS; repIndex++) + { + UInt32 lenTest; + UInt32 lenTestTemp; + UInt32 price; + const Byte *data2 = data - (reps[repIndex] + 1); + if (data[0] != data2[0] || data[1] != data2[1]) + continue; + for (lenTest = 2; lenTest < numAvailableBytes && data[lenTest] == data2[lenTest]; lenTest++); + while (lenEnd < cur + lenTest) + p->opt[++lenEnd].price = kInfinityPrice; + lenTestTemp = lenTest; + price = repMatchPrice + GetPureRepPrice(p, repIndex, state, posState); + do + { + UInt32 curAndLenPrice = price + p->repLenEnc.prices[posState][lenTest - 2]; + COptimal *opt = &p->opt[cur + lenTest]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur; + opt->backPrev = repIndex; + opt->prev1IsChar = False; + } + } + while (--lenTest >= 2); + lenTest = lenTestTemp; + + if (repIndex == 0) + startLen = lenTest + 1; + + /* if (_maxMode) */ + { + UInt32 lenTest2 = lenTest + 1; + UInt32 limit = lenTest2 + p->numFastBytes; + UInt32 nextRepMatchPrice; + if (limit > numAvailableBytesFull) + limit = numAvailableBytesFull; + for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); + lenTest2 -= lenTest + 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kRepNextStates[state]; + UInt32 posStateNext = (position + lenTest) & p->pbMask; + UInt32 curAndLenCharPrice = + price + p->repLenEnc.prices[posState][lenTest - 2] + + GET_PRICE_0(p->isMatch[state2][posStateNext]) + + LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), + data[lenTest], data2[lenTest], p->ProbPrices); + state2 = kLiteralNextStates[state2]; + posStateNext = (position + lenTest + 1) & p->pbMask; + nextRepMatchPrice = curAndLenCharPrice + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 curAndLenPrice; + COptimal *opt; + UInt32 offset = cur + lenTest + 1 + lenTest2; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + lenTest + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = True; + opt->posPrev2 = cur; + opt->backPrev2 = repIndex; + } + } + } + } + } + } + /* for (UInt32 lenTest = 2; lenTest <= newLen; lenTest++) */ + if (newLen > numAvailableBytes) + { + newLen = numAvailableBytes; + for (numDistancePairs = 0; newLen > matchDistances[numDistancePairs]; numDistancePairs += 2); + matchDistances[numDistancePairs] = newLen; + numDistancePairs += 2; + } + if (newLen >= startLen) + { + UInt32 normalMatchPrice = matchPrice + GET_PRICE_0(p->isRep[state]); + UInt32 offs, curBack, posSlot; + UInt32 lenTest; + while (lenEnd < cur + newLen) + p->opt[++lenEnd].price = kInfinityPrice; + + offs = 0; + while (startLen > matchDistances[offs]) + offs += 2; + curBack = matchDistances[offs + 1]; + GetPosSlot2(curBack, posSlot); + for (lenTest = /*2*/ startLen; ; lenTest++) + { + UInt32 curAndLenPrice = normalMatchPrice + p->lenEnc.prices[posState][lenTest - LZMA_MATCH_LEN_MIN]; + UInt32 lenToPosState = GetLenToPosState(lenTest); + COptimal *opt; + if (curBack < kNumFullDistances) + curAndLenPrice += p->distancesPrices[lenToPosState][curBack]; + else + curAndLenPrice += p->posSlotPrices[lenToPosState][posSlot] + p->alignPrices[curBack & kAlignMask]; + + opt = &p->opt[cur + lenTest]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur; + opt->backPrev = curBack + LZMA_NUM_REPS; + opt->prev1IsChar = False; + } + + if (/*_maxMode && */lenTest == matchDistances[offs]) + { + /* Try Match + Literal + Rep0 */ + const Byte *data2 = data - (curBack + 1); + UInt32 lenTest2 = lenTest + 1; + UInt32 limit = lenTest2 + p->numFastBytes; + UInt32 nextRepMatchPrice; + if (limit > numAvailableBytesFull) + limit = numAvailableBytesFull; + for (; lenTest2 < limit && data[lenTest2] == data2[lenTest2]; lenTest2++); + lenTest2 -= lenTest + 1; + if (lenTest2 >= 2) + { + UInt32 state2 = kMatchNextStates[state]; + UInt32 posStateNext = (position + lenTest) & p->pbMask; + UInt32 curAndLenCharPrice = curAndLenPrice + + GET_PRICE_0(p->isMatch[state2][posStateNext]) + + LitEnc_GetPriceMatched(LIT_PROBS(position + lenTest, data[lenTest - 1]), + data[lenTest], data2[lenTest], p->ProbPrices); + state2 = kLiteralNextStates[state2]; + posStateNext = (posStateNext + 1) & p->pbMask; + nextRepMatchPrice = curAndLenCharPrice + + GET_PRICE_1(p->isMatch[state2][posStateNext]) + + GET_PRICE_1(p->isRep[state2]); + + /* for (; lenTest2 >= 2; lenTest2--) */ + { + UInt32 offset = cur + lenTest + 1 + lenTest2; + UInt32 curAndLenPrice; + COptimal *opt; + while (lenEnd < offset) + p->opt[++lenEnd].price = kInfinityPrice; + curAndLenPrice = nextRepMatchPrice + GetRepPrice(p, 0, lenTest2, state2, posStateNext); + opt = &p->opt[offset]; + if (curAndLenPrice < opt->price) + { + opt->price = curAndLenPrice; + opt->posPrev = cur + lenTest + 1; + opt->backPrev = 0; + opt->prev1IsChar = True; + opt->prev2 = True; + opt->posPrev2 = cur; + opt->backPrev2 = curBack + LZMA_NUM_REPS; + } + } + } + offs += 2; + if (offs == numDistancePairs) + break; + curBack = matchDistances[offs + 1]; + if (curBack >= kNumFullDistances) + GetPosSlot2(curBack, posSlot); + } + } + } + } +} + +#define ChangePair(smallDist, bigDist) (((bigDist) >> 7) > (smallDist)) + +static UInt32 GetOptimumFast(CLzmaEnc *p, UInt32 *backRes) +{ + UInt32 numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); + UInt32 lenMain, numDistancePairs; + const Byte *data; + UInt32 repLens[LZMA_NUM_REPS]; + UInt32 repMaxIndex, i; + UInt32 *matchDistances; + UInt32 backMain; + + if (!p->longestMatchWasFound) + { + lenMain = ReadMatchDistances(p, &numDistancePairs); + } + else + { + lenMain = p->longestMatchLength; + numDistancePairs = p->numDistancePairs; + p->longestMatchWasFound = False; + } + + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + if (numAvailableBytes > LZMA_MATCH_LEN_MAX) + numAvailableBytes = LZMA_MATCH_LEN_MAX; + if (numAvailableBytes < 2) + { + *backRes = (UInt32)(-1); + return 1; + } + + repMaxIndex = 0; + + for (i = 0; i < LZMA_NUM_REPS; i++) + { + const Byte *data2 = data - (p->reps[i] + 1); + UInt32 len; + if (data[0] != data2[0] || data[1] != data2[1]) + { + repLens[i] = 0; + continue; + } + for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++); + if (len >= p->numFastBytes) + { + *backRes = i; + MovePos(p, len - 1); + return len; + } + repLens[i] = len; + if (len > repLens[repMaxIndex]) + repMaxIndex = i; + } + matchDistances = p->matchDistances; + if (lenMain >= p->numFastBytes) + { + *backRes = matchDistances[numDistancePairs - 1] + LZMA_NUM_REPS; + MovePos(p, lenMain - 1); + return lenMain; + } + + backMain = 0; /* for GCC */ + if (lenMain >= 2) + { + backMain = matchDistances[numDistancePairs - 1]; + while (numDistancePairs > 2 && lenMain == matchDistances[numDistancePairs - 4] + 1) + { + if (!ChangePair(matchDistances[numDistancePairs - 3], backMain)) + break; + numDistancePairs -= 2; + lenMain = matchDistances[numDistancePairs - 2]; + backMain = matchDistances[numDistancePairs - 1]; + } + if (lenMain == 2 && backMain >= 0x80) + lenMain = 1; + } + + if (repLens[repMaxIndex] >= 2) + { + if (repLens[repMaxIndex] + 1 >= lenMain || + (repLens[repMaxIndex] + 2 >= lenMain && (backMain > (1 << 9))) || + (repLens[repMaxIndex] + 3 >= lenMain && (backMain > (1 << 15)))) + { + UInt32 lenRes; + *backRes = repMaxIndex; + lenRes = repLens[repMaxIndex]; + MovePos(p, lenRes - 1); + return lenRes; + } + } + + if (lenMain >= 2 && numAvailableBytes > 2) + { + UInt32 i; + numAvailableBytes = p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); + p->longestMatchLength = ReadMatchDistances(p, &p->numDistancePairs); + if (p->longestMatchLength >= 2) + { + UInt32 newDistance = matchDistances[p->numDistancePairs - 1]; + if ((p->longestMatchLength >= lenMain && newDistance < backMain) || + (p->longestMatchLength == lenMain + 1 && !ChangePair(backMain, newDistance)) || + (p->longestMatchLength > lenMain + 1) || + (p->longestMatchLength + 1 >= lenMain && lenMain >= 3 && ChangePair(newDistance, backMain))) + { + p->longestMatchWasFound = True; + *backRes = (UInt32)(-1); + return 1; + } + } + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - 1; + for (i = 0; i < LZMA_NUM_REPS; i++) + { + UInt32 len; + const Byte *data2 = data - (p->reps[i] + 1); + if (data[1] != data2[1] || data[2] != data2[2]) + { + repLens[i] = 0; + continue; + } + for (len = 2; len < numAvailableBytes && data[len] == data2[len]; len++); + if (len + 1 >= lenMain) + { + p->longestMatchWasFound = True; + *backRes = (UInt32)(-1); + return 1; + } + } + *backRes = backMain + LZMA_NUM_REPS; + MovePos(p, lenMain - 2); + return lenMain; + } + *backRes = (UInt32)(-1); + return 1; +} + +static void WriteEndMarker(CLzmaEnc *p, UInt32 posState) +{ + UInt32 len; + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); + p->state = kMatchNextStates[p->state]; + len = LZMA_MATCH_LEN_MIN; + LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, (1 << kNumPosSlotBits) - 1); + RangeEnc_EncodeDirectBits(&p->rc, (((UInt32)1 << 30) - 1) >> kNumAlignBits, 30 - kNumAlignBits); + RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, kAlignMask); +} + +static SRes CheckErrors(CLzmaEnc *p) +{ + if (p->result != SZ_OK) + return p->result; + if (p->rc.res != SZ_OK) + p->result = SZ_ERROR_WRITE; + if (p->matchFinderBase.result != SZ_OK) + p->result = SZ_ERROR_READ; + if (p->result != SZ_OK) + p->finished = True; + return p->result; +} + +static SRes Flush(CLzmaEnc *p, UInt32 nowPos) +{ + /* ReleaseMFStream(); */ + p->finished = True; + if (p->writeEndMark) + WriteEndMarker(p, nowPos & p->pbMask); + RangeEnc_FlushData(&p->rc); + RangeEnc_FlushStream(&p->rc); + return CheckErrors(p); +} + +static void FillAlignPrices(CLzmaEnc *p) +{ + UInt32 i; + for (i = 0; i < kAlignTableSize; i++) + p->alignPrices[i] = RcTree_ReverseGetPrice(p->posAlignEncoder, kNumAlignBits, i, p->ProbPrices); + p->alignPriceCount = 0; +} + +static void FillDistancesPrices(CLzmaEnc *p) +{ + UInt32 tempPrices[kNumFullDistances]; + UInt32 i, lenToPosState; + for (i = kStartPosModelIndex; i < kNumFullDistances; i++) + { + UInt32 posSlot = GetPosSlot1(i); + UInt32 footerBits = ((posSlot >> 1) - 1); + UInt32 base = ((2 | (posSlot & 1)) << footerBits); + tempPrices[i] = RcTree_ReverseGetPrice(p->posEncoders + base - posSlot - 1, footerBits, i - base, p->ProbPrices); + } + + for (lenToPosState = 0; lenToPosState < kNumLenToPosStates; lenToPosState++) + { + UInt32 posSlot; + const CLzmaProb *encoder = p->posSlotEncoder[lenToPosState]; + UInt32 *posSlotPrices = p->posSlotPrices[lenToPosState]; + for (posSlot = 0; posSlot < p->distTableSize; posSlot++) + posSlotPrices[posSlot] = RcTree_GetPrice(encoder, kNumPosSlotBits, posSlot, p->ProbPrices); + for (posSlot = kEndPosModelIndex; posSlot < p->distTableSize; posSlot++) + posSlotPrices[posSlot] += ((((posSlot >> 1) - 1) - kNumAlignBits) << kNumBitPriceShiftBits); + + { + UInt32 *distancesPrices = p->distancesPrices[lenToPosState]; + UInt32 i; + for (i = 0; i < kStartPosModelIndex; i++) + distancesPrices[i] = posSlotPrices[i]; + for (; i < kNumFullDistances; i++) + distancesPrices[i] = posSlotPrices[GetPosSlot1(i)] + tempPrices[i]; + } + } + p->matchPriceCount = 0; +} + +void LzmaEnc_Construct(CLzmaEnc *p) +{ + RangeEnc_Construct(&p->rc); + MatchFinder_Construct(&p->matchFinderBase); + #ifdef COMPRESS_MF_MT + MatchFinderMt_Construct(&p->matchFinderMt); + p->matchFinderMt.MatchFinder = &p->matchFinderBase; + #endif + + { + CLzmaEncProps props; + LzmaEncProps_Init(&props); + LzmaEnc_SetProps(p, &props); + } + + #ifndef LZMA_LOG_BSR + LzmaEnc_FastPosInit(p->g_FastPos); + #endif + + LzmaEnc_InitPriceTables(p->ProbPrices); + p->litProbs = 0; + p->saveState.litProbs = 0; +} + +CLzmaEncHandle LzmaEnc_Create(ISzAlloc *alloc) +{ + void *p; + p = alloc->Alloc(alloc, sizeof(CLzmaEnc)); + if (p != 0) + LzmaEnc_Construct((CLzmaEnc *)p); + return p; +} + +void LzmaEnc_FreeLits(CLzmaEnc *p, ISzAlloc *alloc) +{ + alloc->Free(alloc, p->litProbs); + alloc->Free(alloc, p->saveState.litProbs); + p->litProbs = 0; + p->saveState.litProbs = 0; +} + +void LzmaEnc_Destruct(CLzmaEnc *p, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + #ifdef COMPRESS_MF_MT + MatchFinderMt_Destruct(&p->matchFinderMt, allocBig); + #endif + MatchFinder_Free(&p->matchFinderBase, allocBig); + LzmaEnc_FreeLits(p, alloc); + RangeEnc_Free(&p->rc, alloc); +} + +void LzmaEnc_Destroy(CLzmaEncHandle p, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + LzmaEnc_Destruct((CLzmaEnc *)p, alloc, allocBig); + alloc->Free(alloc, p); +} + +static SRes LzmaEnc_CodeOneBlock(CLzmaEnc *p, Bool useLimits, UInt32 maxPackSize, UInt32 maxUnpackSize) +{ + UInt32 nowPos32, startPos32; + if (p->inStream != 0) + { + p->matchFinderBase.stream = p->inStream; + p->matchFinder.Init(p->matchFinderObj); + p->inStream = 0; + } + + if (p->finished) + return p->result; + RINOK(CheckErrors(p)); + + nowPos32 = (UInt32)p->nowPos64; + startPos32 = nowPos32; + + if (p->nowPos64 == 0) + { + UInt32 numDistancePairs; + Byte curByte; + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + return Flush(p, nowPos32); + ReadMatchDistances(p, &numDistancePairs); + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][0], 0); + p->state = kLiteralNextStates[p->state]; + curByte = p->matchFinder.GetIndexByte(p->matchFinderObj, 0 - p->additionalOffset); + LitEnc_Encode(&p->rc, p->litProbs, curByte); + p->additionalOffset--; + nowPos32++; + } + + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) != 0) + for (;;) + { + UInt32 pos, len, posState; + + if (p->fastMode) + len = GetOptimumFast(p, &pos); + else + len = GetOptimum(p, nowPos32, &pos); + + #ifdef SHOW_STAT2 + printf("\n pos = %4X, len = %d pos = %d", nowPos32, len, pos); + #endif + + posState = nowPos32 & p->pbMask; + if (len == 1 && pos == 0xFFFFFFFF) + { + Byte curByte; + CLzmaProb *probs; + const Byte *data; + + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 0); + data = p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; + curByte = *data; + probs = LIT_PROBS(nowPos32, *(data - 1)); + if (IsCharState(p->state)) + LitEnc_Encode(&p->rc, probs, curByte); + else + LitEnc_EncodeMatched(&p->rc, probs, curByte, *(data - p->reps[0] - 1)); + p->state = kLiteralNextStates[p->state]; + } + else + { + RangeEnc_EncodeBit(&p->rc, &p->isMatch[p->state][posState], 1); + if (pos < LZMA_NUM_REPS) + { + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 1); + if (pos == 0) + { + RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 0); + RangeEnc_EncodeBit(&p->rc, &p->isRep0Long[p->state][posState], ((len == 1) ? 0 : 1)); + } + else + { + UInt32 distance = p->reps[pos]; + RangeEnc_EncodeBit(&p->rc, &p->isRepG0[p->state], 1); + if (pos == 1) + RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 0); + else + { + RangeEnc_EncodeBit(&p->rc, &p->isRepG1[p->state], 1); + RangeEnc_EncodeBit(&p->rc, &p->isRepG2[p->state], pos - 2); + if (pos == 3) + p->reps[3] = p->reps[2]; + p->reps[2] = p->reps[1]; + } + p->reps[1] = p->reps[0]; + p->reps[0] = distance; + } + if (len == 1) + p->state = kShortRepNextStates[p->state]; + else + { + LenEnc_Encode2(&p->repLenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + p->state = kRepNextStates[p->state]; + } + } + else + { + UInt32 posSlot; + RangeEnc_EncodeBit(&p->rc, &p->isRep[p->state], 0); + p->state = kMatchNextStates[p->state]; + LenEnc_Encode2(&p->lenEnc, &p->rc, len - LZMA_MATCH_LEN_MIN, posState, !p->fastMode, p->ProbPrices); + pos -= LZMA_NUM_REPS; + GetPosSlot(pos, posSlot); + RcTree_Encode(&p->rc, p->posSlotEncoder[GetLenToPosState(len)], kNumPosSlotBits, posSlot); + + if (posSlot >= kStartPosModelIndex) + { + UInt32 footerBits = ((posSlot >> 1) - 1); + UInt32 base = ((2 | (posSlot & 1)) << footerBits); + UInt32 posReduced = pos - base; + + if (posSlot < kEndPosModelIndex) + RcTree_ReverseEncode(&p->rc, p->posEncoders + base - posSlot - 1, footerBits, posReduced); + else + { + RangeEnc_EncodeDirectBits(&p->rc, posReduced >> kNumAlignBits, footerBits - kNumAlignBits); + RcTree_ReverseEncode(&p->rc, p->posAlignEncoder, kNumAlignBits, posReduced & kAlignMask); + p->alignPriceCount++; + } + } + p->reps[3] = p->reps[2]; + p->reps[2] = p->reps[1]; + p->reps[1] = p->reps[0]; + p->reps[0] = pos; + p->matchPriceCount++; + } + } + p->additionalOffset -= len; + nowPos32 += len; + if (p->additionalOffset == 0) + { + UInt32 processed; + if (!p->fastMode) + { + if (p->matchPriceCount >= (1 << 7)) + FillDistancesPrices(p); + if (p->alignPriceCount >= kAlignTableSize) + FillAlignPrices(p); + } + if (p->matchFinder.GetNumAvailableBytes(p->matchFinderObj) == 0) + break; + processed = nowPos32 - startPos32; + if (useLimits) + { + if (processed + kNumOpts + 300 >= maxUnpackSize || + RangeEnc_GetProcessed(&p->rc) + kNumOpts * 2 >= maxPackSize) + break; + } + else if (processed >= (1 << 15)) + { + p->nowPos64 += nowPos32 - startPos32; + return CheckErrors(p); + } + } + } + p->nowPos64 += nowPos32 - startPos32; + return Flush(p, nowPos32); +} + +#define kBigHashDicLimit ((UInt32)1 << 24) + +static SRes LzmaEnc_Alloc(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + UInt32 beforeSize = kNumOpts; + Bool btMode; + if (!RangeEnc_Alloc(&p->rc, alloc)) + return SZ_ERROR_MEM; + btMode = (p->matchFinderBase.btMode != 0); + #ifdef COMPRESS_MF_MT + p->mtMode = (p->multiThread && !p->fastMode && btMode); + #endif + + { + unsigned lclp = p->lc + p->lp; + if (p->litProbs == 0 || p->saveState.litProbs == 0 || p->lclp != lclp) + { + LzmaEnc_FreeLits(p, alloc); + p->litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); + p->saveState.litProbs = (CLzmaProb *)alloc->Alloc(alloc, (0x300 << lclp) * sizeof(CLzmaProb)); + if (p->litProbs == 0 || p->saveState.litProbs == 0) + { + LzmaEnc_FreeLits(p, alloc); + return SZ_ERROR_MEM; + } + p->lclp = lclp; + } + } + + p->matchFinderBase.bigHash = (p->dictSize > kBigHashDicLimit); + + if (beforeSize + p->dictSize < keepWindowSize) + beforeSize = keepWindowSize - p->dictSize; + + #ifdef COMPRESS_MF_MT + if (p->mtMode) + { + RINOK(MatchFinderMt_Create(&p->matchFinderMt, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)); + p->matchFinderObj = &p->matchFinderMt; + MatchFinderMt_CreateVTable(&p->matchFinderMt, &p->matchFinder); + } + else + #endif + { + if (!MatchFinder_Create(&p->matchFinderBase, p->dictSize, beforeSize, p->numFastBytes, LZMA_MATCH_LEN_MAX, allocBig)) + return SZ_ERROR_MEM; + p->matchFinderObj = &p->matchFinderBase; + MatchFinder_CreateVTable(&p->matchFinderBase, &p->matchFinder); + } + return SZ_OK; +} + +void LzmaEnc_Init(CLzmaEnc *p) +{ + UInt32 i; + p->state = 0; + for(i = 0 ; i < LZMA_NUM_REPS; i++) + p->reps[i] = 0; + + RangeEnc_Init(&p->rc); + + + for (i = 0; i < kNumStates; i++) + { + UInt32 j; + for (j = 0; j < LZMA_NUM_PB_STATES_MAX; j++) + { + p->isMatch[i][j] = kProbInitValue; + p->isRep0Long[i][j] = kProbInitValue; + } + p->isRep[i] = kProbInitValue; + p->isRepG0[i] = kProbInitValue; + p->isRepG1[i] = kProbInitValue; + p->isRepG2[i] = kProbInitValue; + } + + { + UInt32 num = 0x300 << (p->lp + p->lc); + for (i = 0; i < num; i++) + p->litProbs[i] = kProbInitValue; + } + + { + for (i = 0; i < kNumLenToPosStates; i++) + { + CLzmaProb *probs = p->posSlotEncoder[i]; + UInt32 j; + for (j = 0; j < (1 << kNumPosSlotBits); j++) + probs[j] = kProbInitValue; + } + } + { + for(i = 0; i < kNumFullDistances - kEndPosModelIndex; i++) + p->posEncoders[i] = kProbInitValue; + } + + LenEnc_Init(&p->lenEnc.p); + LenEnc_Init(&p->repLenEnc.p); + + for (i = 0; i < (1 << kNumAlignBits); i++) + p->posAlignEncoder[i] = kProbInitValue; + + p->longestMatchWasFound = False; + p->optimumEndIndex = 0; + p->optimumCurrentIndex = 0; + p->additionalOffset = 0; + + p->pbMask = (1 << p->pb) - 1; + p->lpMask = (1 << p->lp) - 1; +} + +void LzmaEnc_InitPrices(CLzmaEnc *p) +{ + if (!p->fastMode) + { + FillDistancesPrices(p); + FillAlignPrices(p); + } + + p->lenEnc.tableSize = + p->repLenEnc.tableSize = + p->numFastBytes + 1 - LZMA_MATCH_LEN_MIN; + LenPriceEnc_UpdateTables(&p->lenEnc, 1 << p->pb, p->ProbPrices); + LenPriceEnc_UpdateTables(&p->repLenEnc, 1 << p->pb, p->ProbPrices); +} + +static SRes LzmaEnc_AllocAndInit(CLzmaEnc *p, UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + UInt32 i; + for (i = 0; i < (UInt32)kDicLogSizeMaxCompress; i++) + if (p->dictSize <= ((UInt32)1 << i)) + break; + p->distTableSize = i * 2; + + p->finished = False; + p->result = SZ_OK; + RINOK(LzmaEnc_Alloc(p, keepWindowSize, alloc, allocBig)); + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + p->nowPos64 = 0; + return SZ_OK; +} + +static SRes LzmaEnc_Prepare(CLzmaEncHandle pp, ISeqInStream *inStream, ISeqOutStream *outStream, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->inStream = inStream; + p->rc.outStream = outStream; + return LzmaEnc_AllocAndInit(p, 0, alloc, allocBig); +} + +SRes LzmaEnc_PrepareForLzma2(CLzmaEncHandle pp, + ISeqInStream *inStream, UInt32 keepWindowSize, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + p->inStream = inStream; + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +static void LzmaEnc_SetInputBuf(CLzmaEnc *p, const Byte *src, SizeT srcLen) +{ + p->seqBufInStream.funcTable.Read = MyRead; + p->seqBufInStream.data = src; + p->seqBufInStream.rem = srcLen; +} + +SRes LzmaEnc_MemPrepare(CLzmaEncHandle pp, const Byte *src, SizeT srcLen, + UInt32 keepWindowSize, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + LzmaEnc_SetInputBuf(p, src, srcLen); + p->inStream = &p->seqBufInStream.funcTable; + return LzmaEnc_AllocAndInit(p, keepWindowSize, alloc, allocBig); +} + +void LzmaEnc_Finish(CLzmaEncHandle pp) +{ + #ifdef COMPRESS_MF_MT + CLzmaEnc *p = (CLzmaEnc *)pp; + if (p->mtMode) + MatchFinderMt_ReleaseStream(&p->matchFinderMt); + #endif +} + +typedef struct _CSeqOutStreamBuf +{ + ISeqOutStream funcTable; + Byte *data; + SizeT rem; + Bool overflow; +} CSeqOutStreamBuf; + +static size_t MyWrite(void *pp, const void *data, size_t size) +{ + CSeqOutStreamBuf *p = (CSeqOutStreamBuf *)pp; + if (p->rem < size) + { + size = p->rem; + p->overflow = True; + } + memcpy(p->data, data, size); + p->rem -= size; + p->data += size; + return size; +} + + +UInt32 LzmaEnc_GetNumAvailableBytes(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetNumAvailableBytes(p->matchFinderObj); +} + +const Byte *LzmaEnc_GetCurBuf(CLzmaEncHandle pp) +{ + const CLzmaEnc *p = (CLzmaEnc *)pp; + return p->matchFinder.GetPointerToCurrentPos(p->matchFinderObj) - p->additionalOffset; +} + +SRes LzmaEnc_CodeOneMemBlock(CLzmaEncHandle pp, Bool reInit, + Byte *dest, size_t *destLen, UInt32 desiredPackSize, UInt32 *unpackSize) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + UInt64 nowPos64; + SRes res; + CSeqOutStreamBuf outStream; + + outStream.funcTable.Write = MyWrite; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = False; + p->finished = False; + p->result = SZ_OK; + + if (reInit) + LzmaEnc_Init(p); + LzmaEnc_InitPrices(p); + nowPos64 = p->nowPos64; + RangeEnc_Init(&p->rc); + p->rc.outStream = &outStream.funcTable; + + res = LzmaEnc_CodeOneBlock(pp, True, desiredPackSize, *unpackSize); + + *unpackSize = (UInt32)(p->nowPos64 - nowPos64); + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + + return res; +} + +SRes LzmaEnc_Encode(CLzmaEncHandle pp, ISeqOutStream *outStream, ISeqInStream *inStream, ICompressProgress *progress, + ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + SRes res = SZ_OK; + + #ifdef COMPRESS_MF_MT + Byte allocaDummy[0x300]; + int i = 0; + for (i = 0; i < 16; i++) + allocaDummy[i] = (Byte)i; + #endif + + RINOK(LzmaEnc_Prepare(pp, inStream, outStream, alloc, allocBig)); + + for (;;) + { + res = LzmaEnc_CodeOneBlock(pp, False, 0, 0); + if (res != SZ_OK || p->finished != 0) + break; + if (progress != 0) + { + res = progress->Progress(progress, p->nowPos64, RangeEnc_GetProcessed(&p->rc)); + if (res != SZ_OK) + { + res = SZ_ERROR_PROGRESS; + break; + } + } + } + LzmaEnc_Finish(pp); + return res; +} + +SRes LzmaEnc_WriteProperties(CLzmaEncHandle pp, Byte *props, SizeT *size) +{ + CLzmaEnc *p = (CLzmaEnc *)pp; + int i; + UInt32 dictSize = p->dictSize; + if (*size < LZMA_PROPS_SIZE) + return SZ_ERROR_PARAM; + *size = LZMA_PROPS_SIZE; + props[0] = (Byte)((p->pb * 5 + p->lp) * 9 + p->lc); + + for (i = 11; i <= 30; i++) + { + if (dictSize <= ((UInt32)2 << i)) + { + dictSize = (2 << i); + break; + } + if (dictSize <= ((UInt32)3 << i)) + { + dictSize = (3 << i); + break; + } + } + + for (i = 0; i < 4; i++) + props[1 + i] = (Byte)(dictSize >> (8 * i)); + return SZ_OK; +} + +SRes LzmaEnc_MemEncode(CLzmaEncHandle pp, Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + int writeEndMark, ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + SRes res; + CLzmaEnc *p = (CLzmaEnc *)pp; + + CSeqOutStreamBuf outStream; + + LzmaEnc_SetInputBuf(p, src, srcLen); + + outStream.funcTable.Write = MyWrite; + outStream.data = dest; + outStream.rem = *destLen; + outStream.overflow = False; + + p->writeEndMark = writeEndMark; + res = LzmaEnc_Encode(pp, &outStream.funcTable, &p->seqBufInStream.funcTable, + progress, alloc, allocBig); + + *destLen -= outStream.rem; + if (outStream.overflow) + return SZ_ERROR_OUTPUT_EOF; + return res; +} + +SRes LzmaEncode(Byte *dest, SizeT *destLen, const Byte *src, SizeT srcLen, + const CLzmaEncProps *props, Byte *propsEncoded, SizeT *propsSize, int writeEndMark, + ICompressProgress *progress, ISzAlloc *alloc, ISzAlloc *allocBig) +{ + CLzmaEnc *p = (CLzmaEnc *)LzmaEnc_Create(alloc); + SRes res; + if (p == 0) + return SZ_ERROR_MEM; + + res = LzmaEnc_SetProps(p, props); + if (res == SZ_OK) + { + res = LzmaEnc_WriteProperties(p, propsEncoded, propsSize); + if (res == SZ_OK) + res = LzmaEnc_MemEncode(p, dest, destLen, src, srcLen, + writeEndMark, progress, alloc, allocBig); + } + + LzmaEnc_Destroy(p, alloc, allocBig); + return res; +} diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 189ec4e53..1c27284ee 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -36,12 +36,22 @@ #define _GNU_SOURCE 1 #include +#if defined(ENABLE_LZO) + #if defined(HAVE_LZO_LZO1X_H) # include #elif defined(HAVE_LZO1X_H) # include #endif +#elif defined(ENABLE_LZMA) + +#include + +#endif + +#if defined(ENABLE_LZO) + static void compress_kernel (char *kernel_img, size_t kernel_size, char **core_img, size_t *core_size) @@ -76,6 +86,48 @@ compress_kernel (char *kernel_img, size_t kernel_size, *core_size = (size_t) size + GRUB_KERNEL_MACHINE_RAW_SIZE; } +#elif defined(ENABLE_LZMA) + +static void *SzAlloc(void *p, size_t size) { p = p; return xmalloc(size); } +static void SzFree(void *p, void *address) { p = p; free(address); } +static ISzAlloc g_Alloc = { SzAlloc, SzFree }; + +static void +compress_kernel (char *kernel_img, size_t kernel_size, + char **core_img, size_t *core_size) +{ + CLzmaEncProps props; + unsigned char out_props[5]; + size_t out_props_size = 5; + + LzmaEncProps_Init(&props); + props.dictSize = 1 << 16; + props.lc = 3; + props.lp = 0; + props.pb = 2; + props.numThreads = 1; + + grub_util_info ("kernel_img=%p, kernel_size=0x%x", kernel_img, kernel_size); + if (kernel_size < GRUB_KERNEL_MACHINE_RAW_SIZE) + grub_util_error ("the core image is too small"); + + *core_img = xmalloc (kernel_size); + memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE); + + *core_size = kernel_size - GRUB_KERNEL_MACHINE_RAW_SIZE; + if (LzmaEncode((unsigned char *) *core_img + GRUB_KERNEL_MACHINE_RAW_SIZE, + core_size, + (unsigned char *) kernel_img + GRUB_KERNEL_MACHINE_RAW_SIZE, + kernel_size - GRUB_KERNEL_MACHINE_RAW_SIZE, + &props, out_props, &out_props_size, + 0, NULL, &g_Alloc, &g_Alloc) != SZ_OK) + grub_util_error ("cannot compress the kernel image"); + + *core_size += GRUB_KERNEL_MACHINE_RAW_SIZE; +} + +#endif + static void generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *memdisk_path) { From d4e2dad356e48b087249e258480ee978d3c6ffcb Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 13 Jul 2008 17:46:25 +0000 Subject: [PATCH 0245/1707] 2008-07-13 Pavel Roskin * lib/LzmaEnc.c (LzmaEnc_SetProps): Fix warning about comparison between signed and unsigned. (LzmaEnc_Finish): Fix warning about an unused parameter. --- ChangeLog | 6 ++++++ lib/LzmaEnc.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 055c39064..9dc5f5e4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-13 Pavel Roskin + + * lib/LzmaEnc.c (LzmaEnc_SetProps): Fix warning about comparison + between signed and unsigned. + (LzmaEnc_Finish): Fix warning about an unused parameter. + 2008-07-13 Bean * Makefile.in (enable_lzo): New rule. diff --git a/lib/LzmaEnc.c b/lib/LzmaEnc.c index 9f7e16771..842d43ac1 100644 --- a/lib/LzmaEnc.c +++ b/lib/LzmaEnc.c @@ -431,7 +431,7 @@ SRes LzmaEnc_SetProps(CLzmaEncHandle pp, const CLzmaEncProps *props2) LzmaEncProps_Normalize(&props); if (props.lc > LZMA_LC_MAX || props.lp > LZMA_LP_MAX || props.pb > LZMA_PB_MAX || - props.dictSize > (1 << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) + props.dictSize > (1U << kDicLogSizeMaxCompress) || props.dictSize > (1 << 30)) return SZ_ERROR_PARAM; p->dictSize = props.dictSize; p->matchFinderCycles = props.mc; @@ -2170,6 +2170,8 @@ void LzmaEnc_Finish(CLzmaEncHandle pp) CLzmaEnc *p = (CLzmaEnc *)pp; if (p->mtMode) MatchFinderMt_ReleaseStream(&p->matchFinderMt); + #else + (void)pp; #endif } From fe9870876ded82ef9aa6943edc09e1da25eb5587 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 13 Jul 2008 18:13:36 +0000 Subject: [PATCH 0246/1707] Fix typos in ChangeLog and comments --- ChangeLog | 24 ++++++++++++------------ include/grub/aout.h | 2 +- util/i386/efi/grub-install.in | 2 +- util/i386/pc/grub-install.in | 2 +- util/update-grub_lib.in | 2 +- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9dc5f5e4f..d8d20cb57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -15,7 +15,7 @@ * boot/i386/pc/lnxboot.S: #include . * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_RAW_SIZE): Change - its value accordding to the compression algorithm used, lzo or lzma. + its value according to the compression algorithm used, lzo or lzma. * util/i386/pc/grub-mkimage.c (compress_kernel): Use different compression algorithm according to configure macro. @@ -110,7 +110,7 @@ This fixes a performance issue when pc & gpt partmap iterators didn't abort iteration even after our hook found what it was - looking for (often causing expensive probes of non-existant drives). + looking for (often causing expensive probes of non-existent drives). Some callers relied on previous buggy behaviour, since they would rise an error when their own hooks caused early abortion of its @@ -332,7 +332,7 @@ 2008-06-19 Robert Millan - * kern/main.c (grub_main): Export `prefix' variable inmediately + * kern/main.c (grub_main): Export `prefix' variable immediately after it has been set by grub_machine_set_prefix(). 2008-06-19 Robert Millan @@ -352,7 +352,7 @@ * util/update-grub_lib.in (prepare_grub_to_access_device): Issue "insmod" command directly when abstraction modules are needed, - instead of reliing on GRUB_PRELOAD_MODULES (which had no effect + instead of relying on GRUB_PRELOAD_MODULES (which had no effect since it had already been processed). 2008-06-19 Pavel Roskin @@ -426,14 +426,14 @@ 2008-06-16 Bean - * fs/ext2.c (grub_ext2_blockgroup): Revert to pre journal state. + * fs/ext2.c (grub_ext2_blockgroup): Revert to pre-journal state. (grub_ext2_read_block): Likewise. (grub_ext2_read_inode): Likewise. (grub_ext2_mount): Likewise. (grub_ext2_close): Likewise. (grub_ext3_get_journal): Removed. - * fs/reiserfs.c (grub_reiserfs_get_item): Revert to pre journal state. + * fs/reiserfs.c (grub_reiserfs_get_item): Revert to pre-journal state. (grub_reiserfs_read_symlink): Likewise. (grub_reiserfs_mount): Likewise. (grub_reiserfs_open): Likewise. @@ -1580,7 +1580,7 @@ * loader/i386/pc/multiboot.c (grub_multiboot): Handle a.out format. * loader/multiboot2.c (grub_multiboot2): Reset grub_errno so that it - can test othe formats. + can test other formats. 2008-02-19 Robert Millan @@ -2557,7 +2557,7 @@ function. * term/ieee1275/ofconsole.c (grub_ofconsole_init): Avoid use of grub_ieee1275_decode_int_4(), by obtaining integer properties directly - in native endianess from grub_ieee1275_get_integer_property(). + in native endianness from grub_ieee1275_get_integer_property(). 2008-01-19 Robert Millan @@ -2625,7 +2625,7 @@ * kern/ieee1275/ieee1275.c: Include `'. (grub_ieee1275_get_integer_property): New function. Wraps around - grub_ieee1275_get_property() to handle endianess. + grub_ieee1275_get_property() to handle endianness. * kern/powerpc/ieee1275/cmain.c (grub_ieee1275_find_options): Replace grub_ieee1275_get_property() with grub_ieee1275_get_integer_property() @@ -5463,7 +5463,7 @@ * boot/i386/pc/boot.S (force_lba): Removed. (boot_drive): Moved to under KERNEL_SECTOR. - (kernel_sector): Moved to under KENREL_SEGMENT. Allocate 64-bit + (kernel_sector): Moved to under KERNEL_SEGMENT. Allocate 64-bit space. (real_start): Set %si earlier. Remove code for FORCE_LBA, since it is useless. @@ -6994,7 +6994,7 @@ (grub_normal_menu_addentry): New function. (read_config_file): Rewritten. * normal/menu.c (run_menu_entry): Mainly rewritten. - * normal/menu_entry.c (make_screen): Rewritten te code to insert + * normal/menu_entry.c (make_screen): Rewritten the code to insert the menu entry. (run): Mainly rewritten. * normal/parser.y (menu_entry): New variable. @@ -10105,7 +10105,7 @@ endian to the host endian. (grub_fat_utf16_to_utf8): Move function from there... * kern/misc.c (grub_utf16_to_utf8): ...to here. Do not convert - the endianess of the source string anymore. + the endianness of the source string anymore. * include/grub/misc.h (grub_utf16_to_utf8): New prototype. 2004-08-24 Marco Gerards diff --git a/include/grub/aout.h b/include/grub/aout.h index 3243b82ff..c5650ddf8 100644 --- a/include/grub/aout.h +++ b/include/grub/aout.h @@ -74,7 +74,7 @@ union grub_aout_header #define AOUT_MID_HPUX 0x20C /* hp200/300 HP-UX binary */ #define AOUT_MID_HPUX800 0x20B /* hp800 HP-UX binary */ -#define AOUT_FLAG_PIC 0x10 /* contains position independant code */ +#define AOUT_FLAG_PIC 0x10 /* contains position independent code */ #define AOUT_FLAG_DYNAMIC 0x20 /* contains run-time link-edit info */ #define AOUT_FLAG_DPMASK 0x30 /* mask for the above */ diff --git a/util/i386/efi/grub-install.in b/util/i386/efi/grub-install.in index 645190da2..a5f97e346 100644 --- a/util/i386/efi/grub-install.in +++ b/util/i386/efi/grub-install.in @@ -193,7 +193,7 @@ partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdi # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` -# The order in this list is critical. Be careful when modifiing it. +# The order in this list is critical. Be careful when modifying it. modules="$modules $fs_module $partmap_module $devabstraction_module" $grub_mkimage --output=${grubdir}/grub.efi $modules || exit 1 diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 36e0f887f..1b2bccbb8 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -237,7 +237,7 @@ else prefix_drive=`$grub_probe --target=drive --device ${grub_device}` fi -# The order in this list is critical. Be careful when modifiing it. +# The order in this list is critical. Be careful when modifying it. modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module" $grub_mkimage --output=${grubdir}/core.img \ diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 036a67660..c488a85d0 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -120,7 +120,7 @@ prepare_grub_to_access_device () echo "insmod ${abstraction}" fi - # If there's a filesystem UUID that GRUB is capable of identifiing, use it; + # If there's a filesystem UUID that GRUB is capable of identifying, use it; # otherwise set root as per value in device.map. echo "set root=`${grub_probe} --device ${device} --target=drive`" if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then From e4e8eaa5b39f5b593833c7964a1ddd960936f99a Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 14 Jul 2008 04:46:19 +0000 Subject: [PATCH 0247/1707] 2008-07-14 Pavel Roskin * commands/blocklist.c (grub_cmd_blocklist): Fix format warning. * commands/cmp.c (grub_cmd_cmp): Likewise. * kern/dl.c (grub_dl_flush_cache): Likewise. (grub_dl_load_core): Likewise. * kern/elf.c (grub_elf32_load_phdrs): Likewise. (grub_elf64_load_phdrs): Likewise. --- ChangeLog | 9 +++++++++ commands/blocklist.c | 2 +- commands/cmp.c | 6 +++--- kern/dl.c | 7 ++++--- kern/elf.c | 8 ++++---- 5 files changed, 21 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8d20cb57..fa8291b40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-14 Pavel Roskin + + * commands/blocklist.c (grub_cmd_blocklist): Fix format warning. + * commands/cmp.c (grub_cmd_cmp): Likewise. + * kern/dl.c (grub_dl_flush_cache): Likewise. + (grub_dl_load_core): Likewise. + * kern/elf.c (grub_elf32_load_phdrs): Likewise. + (grub_elf64_load_phdrs): Likewise. + 2008-07-13 Pavel Roskin * lib/LzmaEnc.c (LzmaEnc_SetProps): Fix warning about comparison diff --git a/commands/blocklist.c b/commands/blocklist.c index df0e63227..c797a5f1b 100644 --- a/commands/blocklist.c +++ b/commands/blocklist.c @@ -72,7 +72,7 @@ grub_cmd_blocklist (struct grub_arg_list *state __attribute__ ((unused)), if (num_entries++) grub_printf (","); - grub_printf ("%llu", sector - part_start); + grub_printf ("%llu", (unsigned long long) (sector - part_start)); if (num > 0) grub_printf ("+%u", num); if (offset != 0 || length != 0) diff --git a/commands/cmp.c b/commands/cmp.c index bb4de60e3..87620b624 100644 --- a/commands/cmp.c +++ b/commands/cmp.c @@ -51,8 +51,8 @@ grub_cmd_cmp (struct grub_arg_list *state __attribute__ ((unused)), if (grub_file_size (file1) != grub_file_size (file2)) grub_printf ("Differ in size: %llu [%s], %llu [%s]\n", - grub_file_size (file1), args[0], - grub_file_size (file2), args[1]); + (unsigned long long) grub_file_size (file1), args[0], + (unsigned long long) grub_file_size (file2), args[1]); else { pos = 0; @@ -78,7 +78,7 @@ grub_cmd_cmp (struct grub_arg_list *state __attribute__ ((unused)), if (buf1[i] != buf2[i]) { grub_printf ("Differ at the offset %llu: 0x%x [%s], 0x%x [%s]\n", - i + pos, buf1[i], args[0], + (unsigned long long) (i + pos), buf1[i], args[0], buf2[i], args[1]); goto cleanup; } diff --git a/kern/dl.c b/kern/dl.c index 9e8c24aba..c0d9f1d03 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -509,8 +509,8 @@ grub_dl_flush_cache (grub_dl_t mod) for (seg = mod->segment; seg; seg = seg->next) { if (seg->size) { - grub_dprintf ("modules", "flushing 0x%x bytes at %p\n", seg->size, - seg->addr); + grub_dprintf ("modules", "flushing 0x%lx bytes at %p\n", + (unsigned long) seg->size, seg->addr); grub_arch_sync_caches (seg->addr, seg->size); } } @@ -523,7 +523,8 @@ grub_dl_load_core (void *addr, grub_size_t size) Elf_Ehdr *e; grub_dl_t mod; - grub_dprintf ("modules", "module at %p, size 0x%x\n", addr, size); + grub_dprintf ("modules", "module at %p, size 0x%lx\n", addr, + (unsigned long) size); e = addr; if (grub_dl_check_header (e, size)) return 0; diff --git a/kern/elf.c b/kern/elf.c index cb8a72286..2b1e223f7 100644 --- a/kern/elf.c +++ b/kern/elf.c @@ -123,9 +123,9 @@ grub_elf32_load_phdrs (grub_elf_t elf) phdrs_size = elf->ehdr.ehdr32.e_phnum * elf->ehdr.ehdr32.e_phentsize; - grub_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%x.\n", + grub_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%lx.\n", (unsigned long long) elf->ehdr.ehdr32.e_phoff, - phdrs_size); + (unsigned long) phdrs_size); elf->phdrs = grub_malloc (phdrs_size); if (! elf->phdrs) @@ -301,9 +301,9 @@ grub_elf64_load_phdrs (grub_elf_t elf) phdrs_size = elf->ehdr.ehdr64.e_phnum * elf->ehdr.ehdr64.e_phentsize; - grub_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%x.\n", + grub_dprintf ("elf", "Loading program headers at 0x%llx, size 0x%lx.\n", (unsigned long long) elf->ehdr.ehdr64.e_phoff, - phdrs_size); + (unsigned long) phdrs_size); elf->phdrs = grub_malloc (phdrs_size); if (! elf->phdrs) From 407aceb4dab36fc53684a4ea7dee4e2365fcbb9f Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 14 Jul 2008 05:03:19 +0000 Subject: [PATCH 0248/1707] 2008-07-14 Pavel Roskin * kern/env.c (grub_register_variable_hook): Don't copy empty string, it leaks memory. Pass "" to grub_env_set(), it should handle constant strings. --- ChangeLog | 4 ++++ kern/env.c | 7 +------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fa8291b40..111179a78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-14 Pavel Roskin + * kern/env.c (grub_register_variable_hook): Don't copy empty + string, it leaks memory. Pass "" to grub_env_set(), it should + handle constant strings. + * commands/blocklist.c (grub_cmd_blocklist): Fix format warning. * commands/cmp.c (grub_cmd_cmp): Likewise. * kern/dl.c (grub_dl_flush_cache): Likewise. diff --git a/kern/env.c b/kern/env.c index a13989837..c47864824 100644 --- a/kern/env.c +++ b/kern/env.c @@ -331,12 +331,7 @@ grub_register_variable_hook (const char *name, if (! var) { - char *val = grub_strdup (""); - - if (! val) - return grub_errno; - - if (grub_env_set (name, val) != GRUB_ERR_NONE) + if (grub_env_set (name, "") != GRUB_ERR_NONE) return grub_errno; var = grub_env_find (name); From afc3b5d7c416fc3a6a85bb861620d902b9bfc40b Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 15 Jul 2008 04:07:37 +0000 Subject: [PATCH 0249/1707] 2008-07-15 Pavel Roskin * loader/ieee1275/multiboot2.c: Include grub/machine/loader.h. [__i386__] (grub_mb2_arch_boot): Avoid unnecessary cast. --- ChangeLog | 5 +++++ loader/ieee1275/multiboot2.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 111179a78..d304676e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-15 Pavel Roskin + + * loader/ieee1275/multiboot2.c: Include grub/machine/loader.h. + [__i386__] (grub_mb2_arch_boot): Avoid unnecessary cast. + 2008-07-14 Pavel Roskin * kern/env.c (grub_register_variable_hook): Don't copy empty diff --git a/loader/ieee1275/multiboot2.c b/loader/ieee1275/multiboot2.c index e3657fd48..c253fc938 100644 --- a/loader/ieee1275/multiboot2.c +++ b/loader/ieee1275/multiboot2.c @@ -26,6 +26,7 @@ #include #include #include +#include typedef void (*kernel_entry_t) (unsigned long, void *, int (void *), unsigned long, unsigned long); @@ -114,11 +115,11 @@ grub_mb2_arch_unload (struct multiboot_tag_header *tags) void grub_mb2_arch_boot (grub_addr_t entry_addr, void *tags) { - kernel_entry_t entry = (kernel_entry_t) entry_addr; #if defined(__powerpc__) + kernel_entry_t entry = (kernel_entry_t) entry_addr; entry (MULTIBOOT2_BOOTLOADER_MAGIC, tags, grub_ieee1275_entry_fn, 0, 0); #elif defined(__i386__) - grub_multiboot2_real_boot (entry, tags); + grub_multiboot2_real_boot (entry_addr, tags); #else #error #endif From ee01cf35f07d1ad5971c90fb40dcab21a3e9e641 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 15 Jul 2008 04:12:28 +0000 Subject: [PATCH 0250/1707] 2008-07-15 Pavel Roskin * fs/ext2.c (grub_ext2_read_block): Initialize blknr in the beginning to avoid warnings with some compilers. --- ChangeLog | 3 +++ fs/ext2.c | 3 +-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d304676e4..a037e3a19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-15 Pavel Roskin + * fs/ext2.c (grub_ext2_read_block): Initialize blknr in the + beginning to avoid warnings with some compilers. + * loader/ieee1275/multiboot2.c: Include grub/machine/loader.h. [__i386__] (grub_mb2_arch_boot): Avoid unnecessary cast. diff --git a/fs/ext2.c b/fs/ext2.c index 7a002f56a..81318f882 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -336,7 +336,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { struct grub_ext2_data *data = node->data; struct grub_ext2_inode *inode = &node->inode; - int blknr; + int blknr = -1; unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); @@ -428,7 +428,6 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ext2fs doesn't support triple indirect blocks"); - blknr = -1; } return blknr; From 8804b286f4798151f413107d6e16241d6174289f Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 15 Jul 2008 04:17:48 +0000 Subject: [PATCH 0251/1707] 2008-07-15 Pavel Roskin * loader/i386/ieee1275/linux.c (grub_set_bootpath): Remove. It's empty and unused. --- ChangeLog | 3 +++ loader/i386/ieee1275/linux.c | 6 ------ 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a037e3a19..4a55997ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-15 Pavel Roskin + * loader/i386/ieee1275/linux.c (grub_set_bootpath): Remove. + It's empty and unused. + * fs/ext2.c (grub_ext2_read_block): Initialize blknr in the beginning to avoid warnings with some compilers. diff --git a/loader/i386/ieee1275/linux.c b/loader/i386/ieee1275/linux.c index bc4567e69..d01349b4c 100644 --- a/loader/i386/ieee1275/linux.c +++ b/loader/i386/ieee1275/linux.c @@ -79,12 +79,6 @@ grub_ieee1275_debug (void) } */ -static void -grub_set_bootpath (void) -{ - -} - static grub_err_t grub_linux_boot (void) { From 0d3d8f2843b9752763bce8e41ebf02722ad1d9c9 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 15 Jul 2008 04:37:32 +0000 Subject: [PATCH 0252/1707] 2008-07-15 Pavel Roskin * include/grub/i386/ieee1275/console.h: Declare grub_console_init() and grub_console_fini(). --- ChangeLog | 3 +++ include/grub/i386/ieee1275/console.h | 6 ++++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4a55997ab..5dd9cae97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-15 Pavel Roskin + * include/grub/i386/ieee1275/console.h: Declare + grub_console_init() and grub_console_fini(). + * loader/i386/ieee1275/linux.c (grub_set_bootpath): Remove. It's empty and unused. diff --git a/include/grub/i386/ieee1275/console.h b/include/grub/i386/ieee1275/console.h index bdbedeece..ba1a9d295 100644 --- a/include/grub/i386/ieee1275/console.h +++ b/include/grub/i386/ieee1275/console.h @@ -25,4 +25,10 @@ void EXPORT_FUNC(grub_keyboard_controller_init) (void); int EXPORT_FUNC(grub_console_checkkey) (void); int EXPORT_FUNC(grub_console_getkey) (void); +/* Initialize the console system. */ +void grub_console_init (void); + +/* Finish the console system. */ +void grub_console_fini (void); + #endif /* ! GRUB_CONSOLE_MACHINE_HEADER */ From c4cd51d7a48647cceaca7701b4a6eeefd49bc95f Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 15 Jul 2008 13:22:27 +0000 Subject: [PATCH 0253/1707] 2008-07-15 Pavel Roskin * kern/ieee1275/ieee1275.c (grub_ieee1275_get_integer_property): Fix comparison between signed and unsigned. --- ChangeLog | 3 +++ kern/ieee1275/ieee1275.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5dd9cae97..a1c46af01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-15 Pavel Roskin + * kern/ieee1275/ieee1275.c (grub_ieee1275_get_integer_property): + Fix comparison between signed and unsigned. + * include/grub/i386/ieee1275/console.h: Declare grub_console_init() and grub_console_fini(). diff --git a/kern/ieee1275/ieee1275.c b/kern/ieee1275/ieee1275.c index 2e8897669..aa48e20c4 100644 --- a/kern/ieee1275/ieee1275.c +++ b/kern/ieee1275/ieee1275.c @@ -90,7 +90,7 @@ grub_ieee1275_get_integer_property (grub_ieee1275_phandle_t phandle, /* Integer properties are always in big endian. */ if (ret == 0) { - int i; + unsigned int i; size /= sizeof (grub_uint32_t); for (i = 0; i < size; i++) buf[i] = grub_be_to_cpu32 (buf[i]); From 62ead89c20246820bbc9942183ae854fd95ad465 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 15 Jul 2008 13:27:02 +0000 Subject: [PATCH 0254/1707] 2008-07-15 Pavel Roskin * term/ieee1275/ofconsole.c: Disable code unused on i386. --- ChangeLog | 2 ++ term/ieee1275/ofconsole.c | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index a1c46af01..cf4386f34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-07-15 Pavel Roskin + * term/ieee1275/ofconsole.c: Disable code unused on i386. + * kern/ieee1275/ieee1275.c (grub_ieee1275_get_integer_property): Fix comparison between signed and unsigned. diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index 5d701ca64..faa104926 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -33,8 +33,10 @@ static grub_uint8_t grub_ofconsole_height; static int grub_curr_x; static int grub_curr_y; +#ifndef __i386__ static int grub_keybuf; static int grub_buflen; +#endif struct color { @@ -142,6 +144,7 @@ grub_ofconsole_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_col *highlight_color = grub_ofconsole_highlight_color; } +#ifndef __i386__ static int grub_ofconsole_readkey (int *key) { @@ -226,6 +229,7 @@ grub_ofconsole_getkey (void) return key; } +#endif static grub_uint16_t grub_ofconsole_getxy (void) From 506b2b3e2bb6ecdd122bd50c026a6cb437ef57cb Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 15 Jul 2008 13:29:53 +0000 Subject: [PATCH 0255/1707] 2008-07-15 Pavel Roskin * kern/i386/ieee1275/init.c: Include grub/cache.h. --- ChangeLog | 2 ++ kern/i386/ieee1275/init.c | 1 + 2 files changed, 3 insertions(+) diff --git a/ChangeLog b/ChangeLog index cf4386f34..952d98c6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2008-07-15 Pavel Roskin + * kern/i386/ieee1275/init.c: Include grub/cache.h. + * term/ieee1275/ofconsole.c: Disable code unused on i386. * kern/ieee1275/ieee1275.c (grub_ieee1275_get_integer_property): diff --git a/kern/i386/ieee1275/init.c b/kern/i386/ieee1275/init.c index ee33f2821..066373e2e 100644 --- a/kern/i386/ieee1275/init.c +++ b/kern/i386/ieee1275/init.c @@ -18,6 +18,7 @@ */ #include +#include void grub_stop_floppy (void) From 59652a208f36de4f053551c3e6bf20a2acde5319 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 16 Jul 2008 06:55:42 +0000 Subject: [PATCH 0256/1707] 2008-07-16 Pavel Roskin * util/i386/efi/grub-mkimage.c (get_target_address): Return a pointer, not an integer. This fixes a warning and prevents precision loss on 64-bit systems. (relocate_addresses): Remove unneeded cast. --- ChangeLog | 7 +++++++ util/i386/efi/grub-mkimage.c | 7 +++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 952d98c6f..756fd3238 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-16 Pavel Roskin + + * util/i386/efi/grub-mkimage.c (get_target_address): Return a + pointer, not an integer. This fixes a warning and prevents + precision loss on 64-bit systems. + (relocate_addresses): Remove unneeded cast. + 2008-07-15 Pavel Roskin * kern/i386/ieee1275/init.c: Include grub/cache.h. diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index 57c1fc88d..123aaf093 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -272,10 +272,10 @@ get_symbol_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Word i) } /* Return the address of a modified value. */ -static Elf32_Addr +static Elf32_Addr * get_target_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Addr offset) { - return (Elf32_Addr) e + grub_le_to_cpu32 (s->sh_offset) + offset; + return (Elf32_Addr *) ((char *) e + grub_le_to_cpu32 (s->sh_offset) + offset); } /* Deal with relocation information. This function relocates addresses @@ -333,8 +333,7 @@ relocate_addresses (Elf32_Ehdr *e, Elf32_Shdr *sections, Elf32_Addr *target; offset = grub_le_to_cpu32 (r->r_offset); - target = (Elf32_Addr *) get_target_address (e, target_section, - offset); + target = get_target_address (e, target_section, offset); info = grub_le_to_cpu32 (r->r_info); sym_addr = get_symbol_address (e, symtab_section, ELF32_R_SYM (info)); From ef29405511da2274846c594e61d8c4ed9ad568cc Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 16 Jul 2008 07:06:11 +0000 Subject: [PATCH 0257/1707] 2008-07-16 Pavel Roskin * loader/i386/efi/linux.c (allocate_pages): Fix warnings in format strings. --- ChangeLog | 3 +++ loader/i386/efi/linux.c | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 756fd3238..b9bd3ca54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-16 Pavel Roskin + * loader/i386/efi/linux.c (allocate_pages): Fix warnings in + format strings. + * util/i386/efi/grub-mkimage.c (get_target_address): Return a pointer, not an integer. This fixes a warning and prevents precision loss on 64-bit systems. diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index ee3fb9967..946f56276 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -168,7 +168,7 @@ allocate_pages (grub_size_t real_size, grub_size_t prot_size) prot_size = page_align (prot_size); mmap_size = find_mmap_size (); - grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n", + grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %lx\n", real_size, prot_size, mmap_size); /* Calculate the number of pages; Combine the real mode code with @@ -217,7 +217,7 @@ allocate_pages (grub_size_t real_size, grub_size_t prot_size) if (addr < 0x10000) continue; - grub_dprintf ("linux", "trying to allocate %u pages at %x\n", + grub_dprintf ("linux", "trying to allocate %lu pages at %x\n", real_mode_pages, (unsigned) addr); real_mode_mem = grub_efi_allocate_pages (addr, real_mode_pages); if (! real_mode_mem) From 2001169405a6d5af59cf740ba31262053541a608 Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 17 Jul 2008 09:50:26 +0000 Subject: [PATCH 0258/1707] 2008-07-17 Bean * conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod. (appleldr_mod_SOURCE): New variavle. (appleldr_mod_CFLAGS): Likewise. (appleldr_mod_LDFLAGS): Likewise. (pci_mod_SOURCES): Likewise. (pci_mod_CFLAGS): Likewise. (pci_mod_LDFLAGS): Likewise. (lspci_mod_SOURCES): Likewise. (lspci_mod_CFLAGS): Likewise. (lspci_mod_LDFLAGS): Likewise. * conf/x86_64-efi.rmk: New file. * disk/efi/efidisk.c (grub_efidisk_read): Wrap efi calls with efi_call_N macro. (grub_efidisk_write): Likewise. * include/efi/api.h (efi_call_0): New macro. (efi_call_1): Likewise. (efi_call_2): Likewise. (efi_call_3): Likewise. (efi_call_4): Likewise. (efi_call_5): Likewise. (efi_call_6): Likewise. * include/grub/efi/chainloader.h (grub_chainloader_cmd): Rename to grub_rescue_cmd_chainloader. * include/grub/efi/pe32.h (GRUB_PE32_MACHINE_X86_64): New macro. (grub_pe32_optional_header): Change some fields based on i386 or x86_64 platform. (GRUB_PE32_PE32_MAGIC): Likewise. * include/grub/efi/uga_draw.h: New file. * include/grub/elf.h (STN_ABS): New constant. (R_X86_64_NONE): Relocation constant for x86_64. (R_X86_64_64): Likewise. (R_X86_64_PC32): Likewise. (R_X86_64_GOT32): Likewise. (R_X86_64_PLT32): Likewise. (R_X86_64_COPY): Likewise. (R_X86_64_GLOB_DAT): Likewise. (R_X86_64_JUMP_SLOT): Likewise. (R_X86_64_RELATIVE): Likewise. (R_X86_64_GOTPCREL): Likewise. (R_X86_64_32): Likewise. (R_X86_64_32S): Likewise. (R_X86_64_16): Likewise. (R_X86_64_PC16): Likewise. (R_X86_64_8): Likewise. (R_X86_64_PC8): Likewise. * include/grub/i386/efi/pci.h: New file. * include/grub/i386/linux.h (GRUB_LINUX_EFI_SIGNATURE): Change it value based on platform. (GRUB_LINUX_EFI_SIGNATURE_0204): New constant. (GRUB_E820_RAM): Likewise. (GRUB_E820_RESERVED): Likewise. (GRUB_E820_ACPI): Likewise. (GRUB_E820_NVS): Likewise. (GRUB_E820_EXEC_CODE): Likewise. (GRUB_E820_MAX_ENTRY): Likewise. (grub_e820_mmap): New structure. (linux_kernel_header): Change the efi field according to different kernel version, also field from linux_kernel_header. * include/grub/kernel.h (grub_module_info): Add padding for x86_64. * include/grub/pci.h (GRUB_PCI_ADDR_SPACE_MASK): New constant. (GRUB_PCI_ADDR_SPACE_MEMORY): Likewise. (GRUB_PCI_ADDR_SPACE_IO): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_MASK): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_32): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_1M): Likewise. (GRUB_PCI_ADDR_MEM_TYPE_64): Likewise. (GRUB_PCI_ADDR_MEM_PREFETCH): Likewise. (GRUB_PCI_ADDR_MEM_MASK): Likewise. (GRUB_PCI_ADDR_IO_MASK): Likewise. * include/grub/x86_64/efi/kernel.h: New file. * include/grub/x86_64/efi/loader.h: Likewise. * include/grub/x86_64/efi/machine.h: Likewise. * include/grub/x86_64/efi/pci.h: Likewise. * include/grub/x86_64/efi/time.h: Likewise. * include/grub/x86_64/linux.h: Likewise. * include/grub/x86_64/setjmp.h: Likewise. * include/grub/x86_64/time.h: Likewise. * include/grub/x86_64/types.h: Likewise. * kern/dl.c (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. * kern/efi/efi.c (grub_efi_locate_protocol): Wrap efi calls. (grub_efi_locate_handle): Likewise. (grub_efi_open_protocol): Likewise. (grub_efi_set_text_mode): Likewise. (grub_efi_stall): Likewise. (grub_exit): Likewise. (grub_reboot): Likewise. (grub_halt): Likewise. (grub_efi_exit_boot_services): Likewise. (grub_get_rtc): Likewise. * kern/efi/mm.c (MEMORY_MAP_SIZE): Change to 0x3000 for new models. (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. (grub_efi_allocate_pages): Wrap efi calls. (grub_efi_free_pages): Wrap efi calls. (grub_efi_get_memory_map): Wrap efi calls. * kern/x86_64/dl.c: New file. * kern/x86_64/efi/callwrap.S: Likewise. * kern/x86_64/efi/startup.S: Likewise. * loader/efi/appleloader.c: Likewise. * loader/efi/chainloader.c (cmdline): New variable. (grub_chainloader_unload): Wrap efi calls. (grub_chainloader_boot): Likewise. (grub_rescue_cmd_chainloader): Wrap efi calls, handle command line. * loader/efi/chainloader_normal.c (chainloader_command): Change grub_chainloader_cmd to grub_rescue_cmd_chainloader, pass command line. * loader/i386/efi/linux.c (allocate_pages): Change allocation method. (grub_e820_add_region): New function. (grub_linux_boot): Construct e820 map from efi map, handle x86_64 booting. (grub_find_video_card): New function. (grub_linux_setup_video): New function. (grub_rescue_cmd_linux): Probe for video information. * normal/x86_64/setjmp.S: New file. * term/efi/console.c (map_char): New function. (grub_console_putchar): Map unicode char. (grub_console_checkkey): Wrap efi calls. (grub_console_getkey): Likewise. (grub_console_getwh): Likewise. (grub_console_gotoxy): Likewise. (grub_console_cls): Likewise. (grub_console_setcolorstate): Likewise. (grub_console_setcursor): Likewise. * util/i386/efi/grub-mkimage.c: Add support for x86_64. --- ChangeLog | 162 +++ conf/i386-efi.mk | 172 +++- conf/i386-efi.rmk | 19 +- conf/x86_64-efi.mk | 1527 +++++++++++++++++++++++++++++ conf/x86_64-efi.rmk | 169 ++++ configure | 35 +- configure.ac | 29 +- disk/efi/efidisk.c | 4 +- include/grub/efi/api.h | 38 + include/grub/efi/chainloader.h | 2 +- include/grub/efi/pe32.h | 28 +- include/grub/efi/uga_draw.h | 76 ++ include/grub/elf.h | 20 + include/grub/i386/efi/pci.h | 19 + include/grub/i386/linux.h | 104 +- include/grub/kernel.h | 3 + include/grub/pci.h | 13 + include/grub/x86_64/efi/kernel.h | 33 + include/grub/x86_64/efi/loader.h | 32 + include/grub/x86_64/efi/machine.h | 24 + include/grub/x86_64/efi/pci.h | 19 + include/grub/x86_64/efi/time.h | 24 + include/grub/x86_64/linux.h | 19 + include/grub/x86_64/setjmp.h | 27 + include/grub/x86_64/time.h | 29 + include/grub/x86_64/types.h | 31 + kern/dl.c | 4 +- kern/efi/efi.c | 44 +- kern/efi/mm.c | 16 +- kern/x86_64/dl.c | 121 +++ kern/x86_64/efi/callwrap.S | 96 ++ kern/x86_64/efi/startup.S | 87 ++ loader/efi/appleloader.c | 208 ++++ loader/efi/chainloader.c | 67 +- loader/efi/chainloader_normal.c | 2 +- loader/i386/efi/linux.c | 409 ++++++-- normal/x86_64/setjmp.S | 60 ++ term/efi/console.c | 89 +- util/i386/efi/grub-mkimage.c | 408 +++++--- 39 files changed, 3960 insertions(+), 309 deletions(-) create mode 100644 conf/x86_64-efi.mk create mode 100644 conf/x86_64-efi.rmk create mode 100644 include/grub/efi/uga_draw.h create mode 100644 include/grub/i386/efi/pci.h create mode 100644 include/grub/x86_64/efi/kernel.h create mode 100644 include/grub/x86_64/efi/loader.h create mode 100644 include/grub/x86_64/efi/machine.h create mode 100644 include/grub/x86_64/efi/pci.h create mode 100644 include/grub/x86_64/efi/time.h create mode 100644 include/grub/x86_64/linux.h create mode 100644 include/grub/x86_64/setjmp.h create mode 100644 include/grub/x86_64/time.h create mode 100644 include/grub/x86_64/types.h create mode 100644 kern/x86_64/dl.c create mode 100644 kern/x86_64/efi/callwrap.S create mode 100644 kern/x86_64/efi/startup.S create mode 100644 loader/efi/appleloader.c create mode 100644 normal/x86_64/setjmp.S diff --git a/ChangeLog b/ChangeLog index b9bd3ca54..a7adb66b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,165 @@ +2008-07-17 Bean + + * conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod. + (appleldr_mod_SOURCE): New variavle. + (appleldr_mod_CFLAGS): Likewise. + (appleldr_mod_LDFLAGS): Likewise. + (pci_mod_SOURCES): Likewise. + (pci_mod_CFLAGS): Likewise. + (pci_mod_LDFLAGS): Likewise. + (lspci_mod_SOURCES): Likewise. + (lspci_mod_CFLAGS): Likewise. + (lspci_mod_LDFLAGS): Likewise. + + * conf/x86_64-efi.rmk: New file. + + * disk/efi/efidisk.c (grub_efidisk_read): Wrap efi calls with efi_call_N + macro. + (grub_efidisk_write): Likewise. + + * include/efi/api.h (efi_call_0): New macro. + (efi_call_1): Likewise. + (efi_call_2): Likewise. + (efi_call_3): Likewise. + (efi_call_4): Likewise. + (efi_call_5): Likewise. + (efi_call_6): Likewise. + + * include/grub/efi/chainloader.h (grub_chainloader_cmd): Rename to + grub_rescue_cmd_chainloader. + + * include/grub/efi/pe32.h (GRUB_PE32_MACHINE_X86_64): New macro. + (grub_pe32_optional_header): Change some fields based on i386 or + x86_64 platform. + (GRUB_PE32_PE32_MAGIC): Likewise. + + * include/grub/efi/uga_draw.h: New file. + + * include/grub/elf.h (STN_ABS): New constant. + (R_X86_64_NONE): Relocation constant for x86_64. + (R_X86_64_64): Likewise. + (R_X86_64_PC32): Likewise. + (R_X86_64_GOT32): Likewise. + (R_X86_64_PLT32): Likewise. + (R_X86_64_COPY): Likewise. + (R_X86_64_GLOB_DAT): Likewise. + (R_X86_64_JUMP_SLOT): Likewise. + (R_X86_64_RELATIVE): Likewise. + (R_X86_64_GOTPCREL): Likewise. + (R_X86_64_32): Likewise. + (R_X86_64_32S): Likewise. + (R_X86_64_16): Likewise. + (R_X86_64_PC16): Likewise. + (R_X86_64_8): Likewise. + (R_X86_64_PC8): Likewise. + + * include/grub/i386/efi/pci.h: New file. + + * include/grub/i386/linux.h (GRUB_LINUX_EFI_SIGNATURE): + Change it value based on platform. + (GRUB_LINUX_EFI_SIGNATURE_0204): New constant. + (GRUB_E820_RAM): Likewise. + (GRUB_E820_RESERVED): Likewise. + (GRUB_E820_ACPI): Likewise. + (GRUB_E820_NVS): Likewise. + (GRUB_E820_EXEC_CODE): Likewise. + (GRUB_E820_MAX_ENTRY): Likewise. + (grub_e820_mmap): New structure. + (linux_kernel_header): Change the efi field according to different + kernel version, also field from linux_kernel_header. + + * include/grub/kernel.h (grub_module_info): Add padding for x86_64. + + * include/grub/pci.h (GRUB_PCI_ADDR_SPACE_MASK): New constant. + (GRUB_PCI_ADDR_SPACE_MEMORY): Likewise. + (GRUB_PCI_ADDR_SPACE_IO): Likewise. + (GRUB_PCI_ADDR_MEM_TYPE_MASK): Likewise. + (GRUB_PCI_ADDR_MEM_TYPE_32): Likewise. + (GRUB_PCI_ADDR_MEM_TYPE_1M): Likewise. + (GRUB_PCI_ADDR_MEM_TYPE_64): Likewise. + (GRUB_PCI_ADDR_MEM_PREFETCH): Likewise. + (GRUB_PCI_ADDR_MEM_MASK): Likewise. + (GRUB_PCI_ADDR_IO_MASK): Likewise. + + * include/grub/x86_64/efi/kernel.h: New file. + + * include/grub/x86_64/efi/loader.h: Likewise. + + * include/grub/x86_64/efi/machine.h: Likewise. + + * include/grub/x86_64/efi/pci.h: Likewise. + + * include/grub/x86_64/efi/time.h: Likewise. + + * include/grub/x86_64/linux.h: Likewise. + + * include/grub/x86_64/setjmp.h: Likewise. + + * include/grub/x86_64/time.h: Likewise. + + * include/grub/x86_64/types.h: Likewise. + + * kern/dl.c (GRUB_CPU_SIZEOF_VOID_P): Changed to + GRUB_TARGET_SIZEOF_VOID_P. + + * kern/efi/efi.c (grub_efi_locate_protocol): Wrap efi calls. + (grub_efi_locate_handle): Likewise. + (grub_efi_open_protocol): Likewise. + (grub_efi_set_text_mode): Likewise. + (grub_efi_stall): Likewise. + (grub_exit): Likewise. + (grub_reboot): Likewise. + (grub_halt): Likewise. + (grub_efi_exit_boot_services): Likewise. + (grub_get_rtc): Likewise. + + * kern/efi/mm.c (MEMORY_MAP_SIZE): Change to 0x3000 for new models. + (GRUB_CPU_SIZEOF_VOID_P): Changed to GRUB_TARGET_SIZEOF_VOID_P. + (grub_efi_allocate_pages): Wrap efi calls. + (grub_efi_free_pages): Wrap efi calls. + (grub_efi_get_memory_map): Wrap efi calls. + + * kern/x86_64/dl.c: New file. + + * kern/x86_64/efi/callwrap.S: Likewise. + + * kern/x86_64/efi/startup.S: Likewise. + + * loader/efi/appleloader.c: Likewise. + + * loader/efi/chainloader.c (cmdline): New variable. + (grub_chainloader_unload): Wrap efi calls. + (grub_chainloader_boot): Likewise. + (grub_rescue_cmd_chainloader): Wrap efi calls, handle + command line. + + * loader/efi/chainloader_normal.c (chainloader_command): + Change grub_chainloader_cmd to grub_rescue_cmd_chainloader, pass + command line. + + * loader/i386/efi/linux.c (allocate_pages): Change allocation + method. + (grub_e820_add_region): New function. + (grub_linux_boot): Construct e820 map from efi map, handle x86_64 + booting. + (grub_find_video_card): New function. + (grub_linux_setup_video): New function. + (grub_rescue_cmd_linux): Probe for video information. + + * normal/x86_64/setjmp.S: New file. + + * term/efi/console.c (map_char): New function. + (grub_console_putchar): Map unicode char. + (grub_console_checkkey): Wrap efi calls. + (grub_console_getkey): Likewise. + (grub_console_getwh): Likewise. + (grub_console_gotoxy): Likewise. + (grub_console_cls): Likewise. + (grub_console_setcolorstate): Likewise. + (grub_console_setcursor): Likewise. + + * util/i386/efi/grub-mkimage.c: Add support for x86_64. + 2008-07-16 Pavel Roskin * loader/i386/efi/linux.c (allocate_pages): Fix warnings in diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 20cf62241..73f077e93 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -116,8 +116,8 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. -pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod +pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ + _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1072,6 +1072,62 @@ partmap-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_norm chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For appleldr.mod. +appleldr_mod_SOURCES = loader/efi/appleloader.c +CLEANFILES += appleldr.mod mod-appleldr.o mod-appleldr.c pre-appleldr.o appleldr_mod-loader_efi_appleloader.o und-appleldr.lst +ifneq ($(appleldr_mod_EXPORTS),no) +CLEANFILES += def-appleldr.lst +DEFSYMFILES += def-appleldr.lst +endif +MOSTLYCLEANFILES += appleldr_mod-loader_efi_appleloader.d +UNDSYMFILES += und-appleldr.lst + +appleldr.mod: pre-appleldr.o mod-appleldr.o + -rm -f $@ + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader.o + -rm -f $@ + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ appleldr_mod-loader_efi_appleloader.o + +mod-appleldr.o: mod-appleldr.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -c -o $@ $< + +mod-appleldr.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'appleldr' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(appleldr_mod_EXPORTS),no) +def-appleldr.lst: pre-appleldr.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 appleldr/' > $@ +endif + +und-appleldr.lst: pre-appleldr.o + echo 'appleldr' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +appleldr_mod-loader_efi_appleloader.o: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -MD -c -o $@ $< +-include appleldr_mod-loader_efi_appleloader.d + +CLEANFILES += cmd-appleldr_mod-loader_efi_appleloader.lst fs-appleldr_mod-loader_efi_appleloader.lst partmap-appleldr_mod-loader_efi_appleloader.lst +COMMANDFILES += cmd-appleldr_mod-loader_efi_appleloader.lst +FSFILES += fs-appleldr_mod-loader_efi_appleloader.lst +PARTMAPFILES += partmap-appleldr_mod-loader_efi_appleloader.lst + +cmd-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) + +fs-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) + +partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) + + +appleldr_mod_CFLAGS = $(COMMON_CFLAGS) +appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For _linux.mod. _linux_mod_SOURCES = loader/i386/efi/linux.c CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_efi_linux.o und-_linux.lst @@ -1352,4 +1408,116 @@ partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DE reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst +ifneq ($(pci_mod_EXPORTS),no) +CLEANFILES += def-pci.lst +DEFSYMFILES += def-pci.lst +endif +MOSTLYCLEANFILES += pci_mod-bus_pci.d +UNDSYMFILES += und-pci.lst + +pci.mod: pre-pci.o mod-pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o + +mod-pci.o: mod-pci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< + +mod-pci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pci_mod_EXPORTS),no) +def-pci.lst: pre-pci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ +endif + +und-pci.lst: pre-pci.o + echo 'pci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) + $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< +-include pci_mod-bus_pci.d + +CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst +COMMANDFILES += cmd-pci_mod-bus_pci.lst +FSFILES += fs-pci_mod-bus_pci.lst +PARTMAPFILES += partmap-pci_mod-bus_pci.lst + +cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + +fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + +partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + + +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst +ifneq ($(lspci_mod_EXPORTS),no) +CLEANFILES += def-lspci.lst +DEFSYMFILES += def-lspci.lst +endif +MOSTLYCLEANFILES += lspci_mod-commands_lspci.d +UNDSYMFILES += und-lspci.lst + +lspci.mod: pre-lspci.o mod-lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o + +mod-lspci.o: mod-lspci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< + +mod-lspci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lspci_mod_EXPORTS),no) +def-lspci.lst: pre-lspci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ +endif + +und-lspci.lst: pre-lspci.o + echo 'lspci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< +-include lspci_mod-commands_lspci.d + +CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst +COMMANDFILES += cmd-lspci_mod-commands_lspci.lst +FSFILES += fs-lspci_mod-commands_lspci.lst +PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst + +cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + +fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + +partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + + +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 311b6ab7d..99bb0d494 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -74,8 +74,8 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. -pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod +pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ + _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -123,6 +123,11 @@ chain_mod_SOURCES = loader/efi/chainloader_normal.c chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For appleldr.mod. +appleldr_mod_SOURCES = loader/efi/appleloader.c +appleldr_mod_CFLAGS = $(COMMON_CFLAGS) +appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For _linux.mod. _linux_mod_SOURCES = loader/i386/efi/linux.c _linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -148,4 +153,14 @@ reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk new file mode 100644 index 000000000..0d97dcd4e --- /dev/null +++ b/conf/x86_64-efi.mk @@ -0,0 +1,1527 @@ +# -*- makefile -*- + +COMMON_ASFLAGS = -nostdinc -fno-builtin -m64 +COMMON_CFLAGS = -fno-builtin -m64 +COMMON_LDFLAGS = -melf_x86_64 -nostdlib + +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h + +# Utilities. +bin_UTILITIES = grub-mkimage +#sbin_UTILITIES = grub-mkdevicemap +#ifeq ($(enable_grub_emu), yes) +#sbin_UTILITIES += grub-emu +#endif + +# For grub-mkimage. +grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ + util/resolve.c +CLEANFILES += grub-mkimage grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o +MOSTLYCLEANFILES += grub_mkimage-util_i386_efi_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d + +grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o + $(CC) -o $@ grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) + +grub_mkimage-util_i386_efi_grub_mkimage.o: util/i386/efi/grub-mkimage.c $(util/i386/efi/grub-mkimage.c_DEPENDENCIES) + $(CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-util_i386_efi_grub_mkimage.d + +grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-util_misc.d + +grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkimage-util_resolve.d + + +# For grub-setup. +#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +# util/misc.c util/getroot.c kern/device.c kern/disk.c \ +# kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ +# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ +# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ +# kern/fs.c kern/env.c fs/fshelp.c + +# For grub-mkdevicemap. +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ + util/i386/get_disk_name.c + +# For grub-emu. +util/grub-emu.c_DEPENDENCIES = grub_emu_init.h +grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ + commands/configfile.c commands/help.c \ + commands/terminal.c commands/ls.c commands/test.c \ + commands/search.c commands/hexdump.c \ + commands/halt.c commands/reboot.c \ + commands/i386/cpuid.c \ + disk/loopback.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ + \ + io/gzio.c \ + kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ + kern/err.c \ + normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ + kern/loader.c kern/main.c kern/misc.c kern/parser.c \ + grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ + normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + normal/completion.c normal/context.c normal/main.c \ + normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/color.c \ + partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/acorn.c partmap/gpt.c \ + util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c + +grub_emu_LDFLAGS = $(LIBCURSES) + +# Scripts. +sbin_SCRIPTS = grub-install + +# For grub-install. +grub_install_SOURCES = util/i386/efi/grub-install.in +CLEANFILES += grub-install + +grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPENDENCIES) config.status + ./config.status --file=grub-install:util/i386/efi/grub-install.in + chmod +x $@ + + +# Modules. +pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ + cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod + +# For kernel.mod. +kernel_mod_EXPORTS = no +kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ + kern/main.c kern/device.c \ + kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ + kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ + kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ + term/efi/console.c disk/efi/efidisk.c +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst +ifneq ($(kernel_mod_EXPORTS),no) +CLEANFILES += def-kernel.lst +DEFSYMFILES += def-kernel.lst +endif +MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d +UNDSYMFILES += und-kernel.lst + +kernel.mod: pre-kernel.o mod-kernel.o + -rm -f $@ + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o + -rm -f $@ + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o + +mod-kernel.o: mod-kernel.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< + +mod-kernel.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'kernel' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(kernel_mod_EXPORTS),no) +def-kernel.lst: pre-kernel.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 kernel/' > $@ +endif + +und-kernel.lst: pre-kernel.o + echo 'kernel' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +kernel_mod-kern_x86_64_efi_startup.o: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) + $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_x86_64_efi_startup.d + +CLEANFILES += cmd-kernel_mod-kern_x86_64_efi_startup.lst fs-kernel_mod-kern_x86_64_efi_startup.lst partmap-kernel_mod-kern_x86_64_efi_startup.lst +COMMANDFILES += cmd-kernel_mod-kern_x86_64_efi_startup.lst +FSFILES += fs-kernel_mod-kern_x86_64_efi_startup.lst +PARTMAPFILES += partmap-kernel_mod-kern_x86_64_efi_startup.lst + +cmd-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_x86_64_efi_callwrap.o: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) + $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_x86_64_efi_callwrap.d + +CLEANFILES += cmd-kernel_mod-kern_x86_64_efi_callwrap.lst fs-kernel_mod-kern_x86_64_efi_callwrap.lst partmap-kernel_mod-kern_x86_64_efi_callwrap.lst +COMMANDFILES += cmd-kernel_mod-kern_x86_64_efi_callwrap.lst +FSFILES += fs-kernel_mod-kern_x86_64_efi_callwrap.lst +PARTMAPFILES += partmap-kernel_mod-kern_x86_64_efi_callwrap.lst + +cmd-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_main.d + +CLEANFILES += cmd-kernel_mod-kern_main.lst fs-kernel_mod-kern_main.lst partmap-kernel_mod-kern_main.lst +COMMANDFILES += cmd-kernel_mod-kern_main.lst +FSFILES += fs-kernel_mod-kern_main.lst +PARTMAPFILES += partmap-kernel_mod-kern_main.lst + +cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_device.d + +CLEANFILES += cmd-kernel_mod-kern_device.lst fs-kernel_mod-kern_device.lst partmap-kernel_mod-kern_device.lst +COMMANDFILES += cmd-kernel_mod-kern_device.lst +FSFILES += fs-kernel_mod-kern_device.lst +PARTMAPFILES += partmap-kernel_mod-kern_device.lst + +cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_disk.d + +CLEANFILES += cmd-kernel_mod-kern_disk.lst fs-kernel_mod-kern_disk.lst partmap-kernel_mod-kern_disk.lst +COMMANDFILES += cmd-kernel_mod-kern_disk.lst +FSFILES += fs-kernel_mod-kern_disk.lst +PARTMAPFILES += partmap-kernel_mod-kern_disk.lst + +cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_dl.d + +CLEANFILES += cmd-kernel_mod-kern_dl.lst fs-kernel_mod-kern_dl.lst partmap-kernel_mod-kern_dl.lst +COMMANDFILES += cmd-kernel_mod-kern_dl.lst +FSFILES += fs-kernel_mod-kern_dl.lst +PARTMAPFILES += partmap-kernel_mod-kern_dl.lst + +cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_file.d + +CLEANFILES += cmd-kernel_mod-kern_file.lst fs-kernel_mod-kern_file.lst partmap-kernel_mod-kern_file.lst +COMMANDFILES += cmd-kernel_mod-kern_file.lst +FSFILES += fs-kernel_mod-kern_file.lst +PARTMAPFILES += partmap-kernel_mod-kern_file.lst + +cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_fs.d + +CLEANFILES += cmd-kernel_mod-kern_fs.lst fs-kernel_mod-kern_fs.lst partmap-kernel_mod-kern_fs.lst +COMMANDFILES += cmd-kernel_mod-kern_fs.lst +FSFILES += fs-kernel_mod-kern_fs.lst +PARTMAPFILES += partmap-kernel_mod-kern_fs.lst + +cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_err.d + +CLEANFILES += cmd-kernel_mod-kern_err.lst fs-kernel_mod-kern_err.lst partmap-kernel_mod-kern_err.lst +COMMANDFILES += cmd-kernel_mod-kern_err.lst +FSFILES += fs-kernel_mod-kern_err.lst +PARTMAPFILES += partmap-kernel_mod-kern_err.lst + +cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_misc.d + +CLEANFILES += cmd-kernel_mod-kern_misc.lst fs-kernel_mod-kern_misc.lst partmap-kernel_mod-kern_misc.lst +COMMANDFILES += cmd-kernel_mod-kern_misc.lst +FSFILES += fs-kernel_mod-kern_misc.lst +PARTMAPFILES += partmap-kernel_mod-kern_misc.lst + +cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_mm.d + +CLEANFILES += cmd-kernel_mod-kern_mm.lst fs-kernel_mod-kern_mm.lst partmap-kernel_mod-kern_mm.lst +COMMANDFILES += cmd-kernel_mod-kern_mm.lst +FSFILES += fs-kernel_mod-kern_mm.lst +PARTMAPFILES += partmap-kernel_mod-kern_mm.lst + +cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_loader.d + +CLEANFILES += cmd-kernel_mod-kern_loader.lst fs-kernel_mod-kern_loader.lst partmap-kernel_mod-kern_loader.lst +COMMANDFILES += cmd-kernel_mod-kern_loader.lst +FSFILES += fs-kernel_mod-kern_loader.lst +PARTMAPFILES += partmap-kernel_mod-kern_loader.lst + +cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_rescue.d + +CLEANFILES += cmd-kernel_mod-kern_rescue.lst fs-kernel_mod-kern_rescue.lst partmap-kernel_mod-kern_rescue.lst +COMMANDFILES += cmd-kernel_mod-kern_rescue.lst +FSFILES += fs-kernel_mod-kern_rescue.lst +PARTMAPFILES += partmap-kernel_mod-kern_rescue.lst + +cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_term.d + +CLEANFILES += cmd-kernel_mod-kern_term.lst fs-kernel_mod-kern_term.lst partmap-kernel_mod-kern_term.lst +COMMANDFILES += cmd-kernel_mod-kern_term.lst +FSFILES += fs-kernel_mod-kern_term.lst +PARTMAPFILES += partmap-kernel_mod-kern_term.lst + +cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_x86_64_dl.o: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_x86_64_dl.d + +CLEANFILES += cmd-kernel_mod-kern_x86_64_dl.lst fs-kernel_mod-kern_x86_64_dl.lst partmap-kernel_mod-kern_x86_64_dl.lst +COMMANDFILES += cmd-kernel_mod-kern_x86_64_dl.lst +FSFILES += fs-kernel_mod-kern_x86_64_dl.lst +PARTMAPFILES += partmap-kernel_mod-kern_x86_64_dl.lst + +cmd-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_i386_efi_init.d + +CLEANFILES += cmd-kernel_mod-kern_i386_efi_init.lst fs-kernel_mod-kern_i386_efi_init.lst partmap-kernel_mod-kern_i386_efi_init.lst +COMMANDFILES += cmd-kernel_mod-kern_i386_efi_init.lst +FSFILES += fs-kernel_mod-kern_i386_efi_init.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_init.lst + +cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_parser.d + +CLEANFILES += cmd-kernel_mod-kern_parser.lst fs-kernel_mod-kern_parser.lst partmap-kernel_mod-kern_parser.lst +COMMANDFILES += cmd-kernel_mod-kern_parser.lst +FSFILES += fs-kernel_mod-kern_parser.lst +PARTMAPFILES += partmap-kernel_mod-kern_parser.lst + +cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_partition.d + +CLEANFILES += cmd-kernel_mod-kern_partition.lst fs-kernel_mod-kern_partition.lst partmap-kernel_mod-kern_partition.lst +COMMANDFILES += cmd-kernel_mod-kern_partition.lst +FSFILES += fs-kernel_mod-kern_partition.lst +PARTMAPFILES += partmap-kernel_mod-kern_partition.lst + +cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_env.d + +CLEANFILES += cmd-kernel_mod-kern_env.lst fs-kernel_mod-kern_env.lst partmap-kernel_mod-kern_env.lst +COMMANDFILES += cmd-kernel_mod-kern_env.lst +FSFILES += fs-kernel_mod-kern_env.lst +PARTMAPFILES += partmap-kernel_mod-kern_env.lst + +cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) + $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-symlist.d + +CLEANFILES += cmd-kernel_mod-symlist.lst fs-kernel_mod-symlist.lst partmap-kernel_mod-symlist.lst +COMMANDFILES += cmd-kernel_mod-symlist.lst +FSFILES += fs-kernel_mod-symlist.lst +PARTMAPFILES += partmap-kernel_mod-symlist.lst + +cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_efi_efi.o: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_efi_efi.d + +CLEANFILES += cmd-kernel_mod-kern_efi_efi.lst fs-kernel_mod-kern_efi_efi.lst partmap-kernel_mod-kern_efi_efi.lst +COMMANDFILES += cmd-kernel_mod-kern_efi_efi.lst +FSFILES += fs-kernel_mod-kern_efi_efi.lst +PARTMAPFILES += partmap-kernel_mod-kern_efi_efi.lst + +cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_efi_init.o: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_efi_init.d + +CLEANFILES += cmd-kernel_mod-kern_efi_init.lst fs-kernel_mod-kern_efi_init.lst partmap-kernel_mod-kern_efi_init.lst +COMMANDFILES += cmd-kernel_mod-kern_efi_init.lst +FSFILES += fs-kernel_mod-kern_efi_init.lst +PARTMAPFILES += partmap-kernel_mod-kern_efi_init.lst + +cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_efi_mm.o: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_efi_mm.d + +CLEANFILES += cmd-kernel_mod-kern_efi_mm.lst fs-kernel_mod-kern_efi_mm.lst partmap-kernel_mod-kern_efi_mm.lst +COMMANDFILES += cmd-kernel_mod-kern_efi_mm.lst +FSFILES += fs-kernel_mod-kern_efi_mm.lst +PARTMAPFILES += partmap-kernel_mod-kern_efi_mm.lst + +cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) + $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-term_efi_console.d + +CLEANFILES += cmd-kernel_mod-term_efi_console.lst fs-kernel_mod-term_efi_console.lst partmap-kernel_mod-term_efi_console.lst +COMMANDFILES += cmd-kernel_mod-term_efi_console.lst +FSFILES += fs-kernel_mod-term_efi_console.lst +PARTMAPFILES += partmap-kernel_mod-term_efi_console.lst + +cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) + $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-disk_efi_efidisk.d + +CLEANFILES += cmd-kernel_mod-disk_efi_efidisk.lst fs-kernel_mod-disk_efi_efidisk.lst partmap-kernel_mod-disk_efi_efidisk.lst +COMMANDFILES += cmd-kernel_mod-disk_efi_efidisk.lst +FSFILES += fs-kernel_mod-disk_efi_efidisk.lst +PARTMAPFILES += partmap-kernel_mod-disk_efi_efidisk.lst + +cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ + env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ + partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + efi/efi.h efi/time.h efi/disk.h machine/loader.h +kernel_mod_CFLAGS = $(COMMON_CFLAGS) +kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) +kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) + +MOSTLYCLEANFILES += symlist.c +MOSTLYCLEANFILES += symlist.c kernel_syms.lst +DEFSYMFILES += kernel_syms.lst + +symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) + +kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) + +# For normal.mod. +normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ + normal/completion.c normal/execute.c \ + normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_entry.c normal/misc.c grub_script.tab.c \ + normal/script.c normal/x86_64/setjmp.S normal/color.c +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o normal_mod-normal_color.o und-normal.lst +ifneq ($(normal_mod_EXPORTS),no) +CLEANFILES += def-normal.lst +DEFSYMFILES += def-normal.lst +endif +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d normal_mod-normal_color.d +UNDSYMFILES += und-normal.lst + +normal.mod: pre-normal.o mod-normal.o + -rm -f $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o normal_mod-normal_color.o + -rm -f $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o normal_mod-normal_color.o + +mod-normal.o: mod-normal.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< + +mod-normal.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(normal_mod_EXPORTS),no) +def-normal.lst: pre-normal.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ +endif + +und-normal.lst: pre-normal.o + echo 'normal' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_arg.d + +CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst +COMMANDFILES += cmd-normal_mod-normal_arg.lst +FSFILES += fs-normal_mod-normal_arg.lst +PARTMAPFILES += partmap-normal_mod-normal_arg.lst + +cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_cmdline.d + +CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst +COMMANDFILES += cmd-normal_mod-normal_cmdline.lst +FSFILES += fs-normal_mod-normal_cmdline.lst +PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst + +cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_command.d + +CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst +COMMANDFILES += cmd-normal_mod-normal_command.lst +FSFILES += fs-normal_mod-normal_command.lst +PARTMAPFILES += partmap-normal_mod-normal_command.lst + +cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_completion.d + +CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst +COMMANDFILES += cmd-normal_mod-normal_completion.lst +FSFILES += fs-normal_mod-normal_completion.lst +PARTMAPFILES += partmap-normal_mod-normal_completion.lst + +cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_execute.d + +CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst +COMMANDFILES += cmd-normal_mod-normal_execute.lst +FSFILES += fs-normal_mod-normal_execute.lst +PARTMAPFILES += partmap-normal_mod-normal_execute.lst + +cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_function.d + +CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst +COMMANDFILES += cmd-normal_mod-normal_function.lst +FSFILES += fs-normal_mod-normal_function.lst +PARTMAPFILES += partmap-normal_mod-normal_function.lst + +cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_lexer.d + +CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst +COMMANDFILES += cmd-normal_mod-normal_lexer.lst +FSFILES += fs-normal_mod-normal_lexer.lst +PARTMAPFILES += partmap-normal_mod-normal_lexer.lst + +cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_main.d + +CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst +COMMANDFILES += cmd-normal_mod-normal_main.lst +FSFILES += fs-normal_mod-normal_main.lst +PARTMAPFILES += partmap-normal_mod-normal_main.lst + +cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu.d + +CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst +COMMANDFILES += cmd-normal_mod-normal_menu.lst +FSFILES += fs-normal_mod-normal_menu.lst +PARTMAPFILES += partmap-normal_mod-normal_menu.lst + +cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_entry.d + +CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst +COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst +FSFILES += fs-normal_mod-normal_menu_entry.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst + +cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_misc.d + +CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst +COMMANDFILES += cmd-normal_mod-normal_misc.lst +FSFILES += fs-normal_mod-normal_misc.lst +PARTMAPFILES += partmap-normal_mod-normal_misc.lst + +cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) + $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-grub_script_tab.d + +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst +COMMANDFILES += cmd-normal_mod-grub_script_tab.lst +FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst + +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_script.d + +CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst +COMMANDFILES += cmd-normal_mod-normal_script.lst +FSFILES += fs-normal_mod-normal_script.lst +PARTMAPFILES += partmap-normal_mod-normal_script.lst + +cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_x86_64_setjmp.o: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) + $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_x86_64_setjmp.d + +CLEANFILES += cmd-normal_mod-normal_x86_64_setjmp.lst fs-normal_mod-normal_x86_64_setjmp.lst partmap-normal_mod-normal_x86_64_setjmp.lst +COMMANDFILES += cmd-normal_mod-normal_x86_64_setjmp.lst +FSFILES += fs-normal_mod-normal_x86_64_setjmp.lst +PARTMAPFILES += partmap-normal_mod-normal_x86_64_setjmp.lst + +cmd-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_color.d + +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst +COMMANDFILES += cmd-normal_mod-normal_color.lst +FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst + +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod_CFLAGS = $(COMMON_CFLAGS) +normal_mod_ASFLAGS = $(COMMON_ASFLAGS) +normal_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For _chain.mod. +_chain_mod_SOURCES = loader/efi/chainloader.c +CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_efi_chainloader.o und-_chain.lst +ifneq ($(_chain_mod_EXPORTS),no) +CLEANFILES += def-_chain.lst +DEFSYMFILES += def-_chain.lst +endif +MOSTLYCLEANFILES += _chain_mod-loader_efi_chainloader.d +UNDSYMFILES += und-_chain.lst + +_chain.mod: pre-_chain.o mod-_chain.o + -rm -f $@ + $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o + -rm -f $@ + $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _chain_mod-loader_efi_chainloader.o + +mod-_chain.o: mod-_chain.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $< + +mod-_chain.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(_chain_mod_EXPORTS),no) +def-_chain.lst: pre-_chain.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _chain/' > $@ +endif + +und-_chain.lst: pre-_chain.o + echo '_chain' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +_chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< +-include _chain_mod-loader_efi_chainloader.d + +CLEANFILES += cmd-_chain_mod-loader_efi_chainloader.lst fs-_chain_mod-loader_efi_chainloader.lst partmap-_chain_mod-loader_efi_chainloader.lst +COMMANDFILES += cmd-_chain_mod-loader_efi_chainloader.lst +FSFILES += fs-_chain_mod-loader_efi_chainloader.lst +PARTMAPFILES += partmap-_chain_mod-loader_efi_chainloader.lst + +cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) + +fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) + +partmap-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _chain > $@ || (rm -f $@; exit 1) + + +_chain_mod_CFLAGS = $(COMMON_CFLAGS) +_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For chain.mod. +chain_mod_SOURCES = loader/efi/chainloader_normal.c +CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader_normal.o und-chain.lst +ifneq ($(chain_mod_EXPORTS),no) +CLEANFILES += def-chain.lst +DEFSYMFILES += def-chain.lst +endif +MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader_normal.d +UNDSYMFILES += und-chain.lst + +chain.mod: pre-chain.o mod-chain.o + -rm -f $@ + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o + -rm -f $@ + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_efi_chainloader_normal.o + +mod-chain.o: mod-chain.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< + +mod-chain.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(chain_mod_EXPORTS),no) +def-chain.lst: pre-chain.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 chain/' > $@ +endif + +und-chain.lst: pre-chain.o + echo 'chain' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< +-include chain_mod-loader_efi_chainloader_normal.d + +CLEANFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst fs-chain_mod-loader_efi_chainloader_normal.lst partmap-chain_mod-loader_efi_chainloader_normal.lst +COMMANDFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst +FSFILES += fs-chain_mod-loader_efi_chainloader_normal.lst +PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader_normal.lst + +cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) + +fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) + +partmap-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) + + +chain_mod_CFLAGS = $(COMMON_CFLAGS) +chain_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For appleldr.mod. +appleldr_mod_SOURCES = loader/efi/appleloader.c +CLEANFILES += appleldr.mod mod-appleldr.o mod-appleldr.c pre-appleldr.o appleldr_mod-loader_efi_appleloader.o und-appleldr.lst +ifneq ($(appleldr_mod_EXPORTS),no) +CLEANFILES += def-appleldr.lst +DEFSYMFILES += def-appleldr.lst +endif +MOSTLYCLEANFILES += appleldr_mod-loader_efi_appleloader.d +UNDSYMFILES += und-appleldr.lst + +appleldr.mod: pre-appleldr.o mod-appleldr.o + -rm -f $@ + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader.o + -rm -f $@ + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ appleldr_mod-loader_efi_appleloader.o + +mod-appleldr.o: mod-appleldr.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -c -o $@ $< + +mod-appleldr.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'appleldr' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(appleldr_mod_EXPORTS),no) +def-appleldr.lst: pre-appleldr.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 appleldr/' > $@ +endif + +und-appleldr.lst: pre-appleldr.o + echo 'appleldr' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +appleldr_mod-loader_efi_appleloader.o: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -MD -c -o $@ $< +-include appleldr_mod-loader_efi_appleloader.d + +CLEANFILES += cmd-appleldr_mod-loader_efi_appleloader.lst fs-appleldr_mod-loader_efi_appleloader.lst partmap-appleldr_mod-loader_efi_appleloader.lst +COMMANDFILES += cmd-appleldr_mod-loader_efi_appleloader.lst +FSFILES += fs-appleldr_mod-loader_efi_appleloader.lst +PARTMAPFILES += partmap-appleldr_mod-loader_efi_appleloader.lst + +cmd-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) + +fs-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) + +partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) + + +appleldr_mod_CFLAGS = $(COMMON_CFLAGS) +appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For _linux.mod. +_linux_mod_SOURCES = loader/i386/efi/linux.c +CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_efi_linux.o und-_linux.lst +ifneq ($(_linux_mod_EXPORTS),no) +CLEANFILES += def-_linux.lst +DEFSYMFILES += def-_linux.lst +endif +MOSTLYCLEANFILES += _linux_mod-loader_i386_efi_linux.d +UNDSYMFILES += und-_linux.lst + +_linux.mod: pre-_linux.o mod-_linux.o + -rm -f $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o + -rm -f $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_efi_linux.o + +mod-_linux.o: mod-_linux.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< + +mod-_linux.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(_linux_mod_EXPORTS),no) +def-_linux.lst: pre-_linux.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ +endif + +und-_linux.lst: pre-_linux.o + echo '_linux' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +_linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< +-include _linux_mod-loader_i386_efi_linux.d + +CLEANFILES += cmd-_linux_mod-loader_i386_efi_linux.lst fs-_linux_mod-loader_i386_efi_linux.lst partmap-_linux_mod-loader_i386_efi_linux.lst +COMMANDFILES += cmd-_linux_mod-loader_i386_efi_linux.lst +FSFILES += fs-_linux_mod-loader_i386_efi_linux.lst +PARTMAPFILES += partmap-_linux_mod-loader_i386_efi_linux.lst + +cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) + +fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) + +partmap-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) + + +_linux_mod_CFLAGS = $(COMMON_CFLAGS) +_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For linux.mod. +linux_mod_SOURCES = loader/i386/efi/linux_normal.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux_normal.o und-linux.lst +ifneq ($(linux_mod_EXPORTS),no) +CLEANFILES += def-linux.lst +DEFSYMFILES += def-linux.lst +endif +MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux_normal.d +UNDSYMFILES += und-linux.lst + +linux.mod: pre-linux.o mod-linux.o + -rm -f $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux_normal.o + -rm -f $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_efi_linux_normal.o + +mod-linux.o: mod-linux.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< + +mod-linux.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(linux_mod_EXPORTS),no) +def-linux.lst: pre-linux.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ +endif + +und-linux.lst: pre-linux.o + echo 'linux' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_efi_linux_normal.d + +CLEANFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst fs-linux_mod-loader_i386_efi_linux_normal.lst partmap-linux_mod-loader_i386_efi_linux_normal.lst +COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst +FSFILES += fs-linux_mod-loader_i386_efi_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux_normal.lst + +cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + +fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + +partmap-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + + +linux_mod_CFLAGS = $(COMMON_CFLAGS) +linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For cpuid.mod. +cpuid_mod_SOURCES = commands/i386/cpuid.c +CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst +ifneq ($(cpuid_mod_EXPORTS),no) +CLEANFILES += def-cpuid.lst +DEFSYMFILES += def-cpuid.lst +endif +MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d +UNDSYMFILES += und-cpuid.lst + +cpuid.mod: pre-cpuid.o mod-cpuid.o + -rm -f $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o + -rm -f $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o + +mod-cpuid.o: mod-cpuid.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< + +mod-cpuid.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(cpuid_mod_EXPORTS),no) +def-cpuid.lst: pre-cpuid.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ +endif + +und-cpuid.lst: pre-cpuid.o + echo 'cpuid' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< +-include cpuid_mod-commands_i386_cpuid.d + +CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst +COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst +FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst +PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst + +cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) + +fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) + +partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + + +cpuid_mod_CFLAGS = $(COMMON_CFLAGS) +cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For halt.mod. +halt_mod_SOURCES = commands/halt.c +CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst +ifneq ($(halt_mod_EXPORTS),no) +CLEANFILES += def-halt.lst +DEFSYMFILES += def-halt.lst +endif +MOSTLYCLEANFILES += halt_mod-commands_halt.d +UNDSYMFILES += und-halt.lst + +halt.mod: pre-halt.o mod-halt.o + -rm -f $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o + -rm -f $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o + +mod-halt.o: mod-halt.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< + +mod-halt.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(halt_mod_EXPORTS),no) +def-halt.lst: pre-halt.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ +endif + +und-halt.lst: pre-halt.o + echo 'halt' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< +-include halt_mod-commands_halt.d + +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst +COMMANDFILES += cmd-halt_mod-commands_halt.lst +FSFILES += fs-halt_mod-commands_halt.lst +PARTMAPFILES += partmap-halt_mod-commands_halt.lst + +cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + +fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + +partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + + +halt_mod_CFLAGS = $(COMMON_CFLAGS) +halt_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For reboot.mod. +reboot_mod_SOURCES = commands/reboot.c +CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst +ifneq ($(reboot_mod_EXPORTS),no) +CLEANFILES += def-reboot.lst +DEFSYMFILES += def-reboot.lst +endif +MOSTLYCLEANFILES += reboot_mod-commands_reboot.d +UNDSYMFILES += und-reboot.lst + +reboot.mod: pre-reboot.o mod-reboot.o + -rm -f $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o + -rm -f $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o + +mod-reboot.o: mod-reboot.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< + +mod-reboot.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(reboot_mod_EXPORTS),no) +def-reboot.lst: pre-reboot.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ +endif + +und-reboot.lst: pre-reboot.o + echo 'reboot' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-commands_reboot.d + +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst +COMMANDFILES += cmd-reboot_mod-commands_reboot.lst +FSFILES += fs-reboot_mod-commands_reboot.lst +PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst + +cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + +fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + +partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + + +reboot_mod_CFLAGS = $(COMMON_CFLAGS) +reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For pci.mod +pci_mod_SOURCES = bus/pci.c +CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst +ifneq ($(pci_mod_EXPORTS),no) +CLEANFILES += def-pci.lst +DEFSYMFILES += def-pci.lst +endif +MOSTLYCLEANFILES += pci_mod-bus_pci.d +UNDSYMFILES += und-pci.lst + +pci.mod: pre-pci.o mod-pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o + +mod-pci.o: mod-pci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< + +mod-pci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pci_mod_EXPORTS),no) +def-pci.lst: pre-pci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ +endif + +und-pci.lst: pre-pci.o + echo 'pci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) + $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< +-include pci_mod-bus_pci.d + +CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst +COMMANDFILES += cmd-pci_mod-bus_pci.lst +FSFILES += fs-pci_mod-bus_pci.lst +PARTMAPFILES += partmap-pci_mod-bus_pci.lst + +cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + +fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + +partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + + +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst +ifneq ($(lspci_mod_EXPORTS),no) +CLEANFILES += def-lspci.lst +DEFSYMFILES += def-lspci.lst +endif +MOSTLYCLEANFILES += lspci_mod-commands_lspci.d +UNDSYMFILES += und-lspci.lst + +lspci.mod: pre-lspci.o mod-lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + +pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o + +mod-lspci.o: mod-lspci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< + +mod-lspci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lspci_mod_EXPORTS),no) +def-lspci.lst: pre-lspci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ +endif + +und-lspci.lst: pre-lspci.o + echo 'lspci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< +-include lspci_mod-commands_lspci.d + +CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst +COMMANDFILES += cmd-lspci_mod-commands_lspci.lst +FSFILES += fs-lspci_mod-commands_lspci.lst +PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst + +cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + +fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + +partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + + +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk new file mode 100644 index 000000000..daa416c84 --- /dev/null +++ b/conf/x86_64-efi.rmk @@ -0,0 +1,169 @@ +# -*- makefile -*- + +COMMON_ASFLAGS = -nostdinc -fno-builtin -m64 +COMMON_CFLAGS = -fno-builtin -m64 +COMMON_LDFLAGS = -melf_x86_64 -nostdlib + +# Used by various components. These rules need to precede them. +normal/execute.c_DEPENDENCIES = grub_script.tab.h +normal/command.c_DEPENDENCIES = grub_script.tab.h +normal/function.c_DEPENDENCIES = grub_script.tab.h +normal/lexer.c_DEPENDENCIES = grub_script.tab.h + +# Utilities. +bin_UTILITIES = grub-mkimage +#sbin_UTILITIES = grub-mkdevicemap +#ifeq ($(enable_grub_emu), yes) +#sbin_UTILITIES += grub-emu +#endif + +# For grub-mkimage. +grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ + util/resolve.c + +# For grub-setup. +#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +# util/misc.c util/getroot.c kern/device.c kern/disk.c \ +# kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ +# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ +# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ +# kern/fs.c kern/env.c fs/fshelp.c + +# For grub-mkdevicemap. +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ + util/i386/get_disk_name.c + +# For grub-emu. +util/grub-emu.c_DEPENDENCIES = grub_emu_init.h +grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ + commands/configfile.c commands/help.c \ + commands/terminal.c commands/ls.c commands/test.c \ + commands/search.c commands/hexdump.c \ + commands/halt.c commands/reboot.c \ + commands/i386/cpuid.c \ + disk/loopback.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ + \ + io/gzio.c \ + kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ + kern/err.c \ + normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ + kern/loader.c kern/main.c kern/misc.c kern/parser.c \ + grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ + normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + normal/completion.c normal/context.c normal/main.c \ + normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/color.c \ + partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/acorn.c partmap/gpt.c \ + util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ + util/biosdisk.c util/getroot.c \ + util/i386/pc/misc.c \ + \ + disk/raid.c disk/lvm.c \ + grub_emu_init.c + +grub_emu_LDFLAGS = $(LIBCURSES) + +# Scripts. +sbin_SCRIPTS = grub-install + +# For grub-install. +grub_install_SOURCES = util/i386/efi/grub-install.in + +# Modules. +pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ + cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod + +# For kernel.mod. +kernel_mod_EXPORTS = no +kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ + kern/main.c kern/device.c \ + kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ + kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ + kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ + term/efi/console.c disk/efi/efidisk.c +kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ + env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ + partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + efi/efi.h efi/time.h efi/disk.h machine/loader.h +kernel_mod_CFLAGS = $(COMMON_CFLAGS) +kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) +kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) + +MOSTLYCLEANFILES += symlist.c +MOSTLYCLEANFILES += symlist.c kernel_syms.lst +DEFSYMFILES += kernel_syms.lst + +symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh + /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) + +kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh + /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) + +# For normal.mod. +normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ + normal/completion.c normal/execute.c \ + normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_entry.c normal/misc.c grub_script.tab.c \ + normal/script.c normal/x86_64/setjmp.S normal/color.c +normal_mod_CFLAGS = $(COMMON_CFLAGS) +normal_mod_ASFLAGS = $(COMMON_ASFLAGS) +normal_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For _chain.mod. +_chain_mod_SOURCES = loader/efi/chainloader.c +_chain_mod_CFLAGS = $(COMMON_CFLAGS) +_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For chain.mod. +chain_mod_SOURCES = loader/efi/chainloader_normal.c +chain_mod_CFLAGS = $(COMMON_CFLAGS) +chain_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For appleldr.mod. +appleldr_mod_SOURCES = loader/efi/appleloader.c +appleldr_mod_CFLAGS = $(COMMON_CFLAGS) +appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For _linux.mod. +_linux_mod_SOURCES = loader/i386/efi/linux.c +_linux_mod_CFLAGS = $(COMMON_CFLAGS) +_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For linux.mod. +linux_mod_SOURCES = loader/i386/efi/linux_normal.c +linux_mod_CFLAGS = $(COMMON_CFLAGS) +linux_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For cpuid.mod. +cpuid_mod_SOURCES = commands/i386/cpuid.c +cpuid_mod_CFLAGS = $(COMMON_CFLAGS) +cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For halt.mod. +halt_mod_SOURCES = commands/halt.c +halt_mod_CFLAGS = $(COMMON_CFLAGS) +halt_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For reboot.mod. +reboot_mod_SOURCES = commands/reboot.c +reboot_mod_CFLAGS = $(COMMON_CFLAGS) +reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For pci.mod +pci_mod_SOURCES = bus/pci.c +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +include $(srcdir)/conf/common.mk diff --git a/configure b/configure index 80df8341e..417d899ce 100644 --- a/configure +++ b/configure @@ -1930,13 +1930,6 @@ esac case "$target_cpu" in i[3456]86) target_cpu=i386 ;; - x86_64) target_cpu=i386 target_m32=1 ;; - powerpc) ;; - powerpc64) target_cpu=powerpc target_m32=1;; - sparc64) ;; - *) { { echo "$as_me:$LINENO: error: unsupported CPU type" >&5 -echo "$as_me: error: unsupported CPU type" >&2;} - { (exit 1); exit 1; }; } ;; esac # Specify the platform (such as firmware). @@ -1962,9 +1955,31 @@ else platform="$with_platform" fi +if test "x$platform" = "xefi" ; then + case "$target_cpu" in + i386) ;; + x86_64) target_m64=1 ;; + *) { { echo "$as_me:$LINENO: error: unsupported CPU type for EFI" >&5 +echo "$as_me: error: unsupported CPU type for EFI" >&2;} + { (exit 1); exit 1; }; } ;; + esac +else + case "$target_cpu" in + i386) ;; + x86_64) target_cpu=i386 target_m32=1 ;; + powerpc) ;; + powerpc64) target_cpu=powerpc target_m32=1;; + sparc64) ;; + *) { { echo "$as_me:$LINENO: error: unsupported CPU type" >&5 +echo "$as_me: error: unsupported CPU type" >&2;} + { (exit 1); exit 1; }; } ;; + esac +fi + # Sanity check. case "$target_cpu"-"$platform" in i386-efi) ;; + x86_64-efi) ;; i386-pc) ;; i386-linuxbios) ;; i386-ieee1275) ;; @@ -6708,6 +6723,12 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi +if test "x$target_m64" = x1; then + # Force 64-bit mode. + TARGET_CFLAGS="$TARGET_CFLAGS -m64" + TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" +fi + # # Compiler features. # diff --git a/configure.ac b/configure.ac index ee932ca9a..943b9fee4 100644 --- a/configure.ac +++ b/configure.ac @@ -49,11 +49,6 @@ esac case "$target_cpu" in i[[3456]]86) target_cpu=i386 ;; - x86_64) target_cpu=i386 target_m32=1 ;; - powerpc) ;; - powerpc64) target_cpu=powerpc target_m32=1;; - sparc64) ;; - *) AC_MSG_ERROR([unsupported CPU type]) ;; esac # Specify the platform (such as firmware). @@ -74,9 +69,27 @@ else platform="$with_platform" fi +if test "x$platform" = "xefi" ; then + case "$target_cpu" in + i386) ;; + x86_64) target_m64=1 ;; + *) AC_MSG_ERROR([unsupported CPU type for EFI]) ;; + esac +else + case "$target_cpu" in + i386) ;; + x86_64) target_cpu=i386 target_m32=1 ;; + powerpc) ;; + powerpc64) target_cpu=powerpc target_m32=1;; + sparc64) ;; + *) AC_MSG_ERROR([unsupported CPU type]) ;; + esac +fi + # Sanity check. case "$target_cpu"-"$platform" in i386-efi) ;; + x86_64-efi) ;; i386-pc) ;; i386-linuxbios) ;; i386-ieee1275) ;; @@ -247,6 +260,12 @@ if test "x$target_m32" = x1; then TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" fi +if test "x$target_m64" = x1; then + # Force 64-bit mode. + TARGET_CFLAGS="$TARGET_CFLAGS -m64" + TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" +fi + # # Compiler features. # diff --git a/disk/efi/efidisk.c b/disk/efi/efidisk.c index e51c2eae3..c66221081 100644 --- a/disk/efi/efidisk.c +++ b/disk/efi/efidisk.c @@ -574,7 +574,7 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, "reading 0x%x sectors at the sector 0x%llx from %s\n", size, sector, disk->name); - status = dio->read (dio, bio->media->media_id, + status = efi_call_5 (dio->read, dio, bio->media->media_id, (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS, (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS, buf); @@ -602,7 +602,7 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, "writing 0x%x sectors at the sector 0x%llx to %s\n", size, sector, disk->name); - status = dio->write (dio, bio->media->media_id, + status = efi_call_5 (dio->write, dio, bio->media->media_id, (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS, (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS, (void *) buf); diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 6c2975337..d1e51709b 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -1095,4 +1095,42 @@ struct grub_efi_block_io }; typedef struct grub_efi_block_io grub_efi_block_io_t; +#if GRUB_TARGET_SIZEOF_VOID_P == 4 + +#define efi_call_0(func) func() +#define efi_call_1(func, a) func(a) +#define efi_call_2(func, a, b) func(a, b) +#define efi_call_3(func, a, b, c) func(a, b, c) +#define efi_call_4(func, a, b, c, d) func(a, b, c, d) +#define efi_call_5(func, a, b, c, d, e) func(a, b, c, d, e) +#define efi_call_6(func, a, b, c, d, e, f) func(a, b, c, d, e, f) + +#else + +#define efi_call_0(func) efi_wrap_0(func) +#define efi_call_1(func, a) efi_wrap_1(func, (grub_uint64_t) a) +#define efi_call_2(func, a, b) efi_wrap_2(func, (grub_uint64_t) a, (grub_uint64_t) b) +#define efi_call_3(func, a, b, c) efi_wrap_3(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c) +#define efi_call_4(func, a, b, c, d) efi_wrap_4(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, (grub_uint64_t) d) +#define efi_call_5(func, a, b, c, d, e) efi_wrap_5(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, (grub_uint64_t) d, (grub_uint64_t) e) +#define efi_call_6(func, a, b, c, d, e, f) efi_wrap_6(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, (grub_uint64_t) d, (grub_uint64_t) e, (grub_uint64_t) f) + +grub_uint64_t EXPORT_FUNC(efi_wrap_0) (void *func); +grub_uint64_t EXPORT_FUNC(efi_wrap_1) (void *func, grub_uint64_t arg1); +grub_uint64_t EXPORT_FUNC(efi_wrap_2) (void *func, grub_uint64_t arg1, + grub_uint64_t arg2); +grub_uint64_t EXPORT_FUNC(efi_wrap_3) (void *func, grub_uint64_t arg1, + grub_uint64_t arg2, grub_uint64_t arg3); +grub_uint64_t EXPORT_FUNC(efi_wrap_4) (void *func, grub_uint64_t arg1, + grub_uint64_t arg2, grub_uint64_t arg3, + grub_uint64_t arg4); +grub_uint64_t EXPORT_FUNC(efi_wrap_5) (void *func, grub_uint64_t arg1, + grub_uint64_t arg2, grub_uint64_t arg3, + grub_uint64_t arg4, grub_uint64_t arg5); +grub_uint64_t EXPORT_FUNC(efi_wrap_6) (void *func, grub_uint64_t arg1, + grub_uint64_t arg2, grub_uint64_t arg3, + grub_uint64_t arg4, grub_uint64_t arg5, + grub_uint64_t arg6); +#endif + #endif /* ! GRUB_EFI_API_HEADER */ diff --git a/include/grub/efi/chainloader.h b/include/grub/efi/chainloader.h index 470132bc8..d5c11e345 100644 --- a/include/grub/efi/chainloader.h +++ b/include/grub/efi/chainloader.h @@ -19,6 +19,6 @@ #ifndef GRUB_EFI_CHAINLOADER_HEADER #define GRUB_EFI_CHAINLOADER_HEADER 1 -void grub_chainloader_cmd (const char *filename); +void grub_rescue_cmd_chainloader (int argc, char *argv[]); #endif /* ! GRUB_EFI_CHAINLOADER_HEADER */ diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h index b6f01a898..c36d85991 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -64,6 +64,7 @@ struct grub_pe32_coff_header }; #define GRUB_PE32_MACHINE_I386 0x14c +#define GRUB_PE32_MACHINE_X86_64 0x8664 #define GRUB_PE32_RELOCS_STRIPPED 0x0001 #define GRUB_PE32_EXECUTABLE_IMAGE 0x0002 @@ -98,9 +99,13 @@ struct grub_pe32_optional_header grub_uint32_t entry_addr; grub_uint32_t code_base; +#if GRUB_TARGET_SIZEOF_VOID_P == 4 grub_uint32_t data_base; - grub_uint32_t image_base; +#else + grub_uint64_t image_base; +#endif + grub_uint32_t section_alignment; grub_uint32_t file_alignment; grub_uint16_t major_os_version; @@ -115,10 +120,23 @@ struct grub_pe32_optional_header grub_uint32_t checksum; grub_uint16_t subsystem; grub_uint16_t dll_characteristics; + +#if GRUB_TARGET_SIZEOF_VOID_P == 4 + grub_uint32_t stack_reserve_size; grub_uint32_t stack_commit_size; grub_uint32_t heap_reserve_size; grub_uint32_t heap_commit_size; + +#else + + grub_uint64_t stack_reserve_size; + grub_uint64_t stack_commit_size; + grub_uint64_t heap_reserve_size; + grub_uint64_t heap_commit_size; + +#endif + grub_uint32_t loader_flags; grub_uint32_t num_data_directories; @@ -141,8 +159,16 @@ struct grub_pe32_optional_header struct grub_pe32_data_directory reserved_entry; }; +#if GRUB_TARGET_SIZEOF_VOID_P == 4 + #define GRUB_PE32_PE32_MAGIC 0x10b +#else + +#define GRUB_PE32_PE32_MAGIC 0x20b + +#endif + #define GRUB_PE32_SUBSYSTEM_EFI_APPLICATION 10 #define GRUB_PE32_NUM_DATA_DIRECTORIES 16 diff --git a/include/grub/efi/uga_draw.h b/include/grub/efi/uga_draw.h new file mode 100644 index 000000000..93504307c --- /dev/null +++ b/include/grub/efi/uga_draw.h @@ -0,0 +1,76 @@ +/* uga_draw.h - definitions of the uga draw protocol */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* The console control protocol is not a part of the EFI spec, + but defined in Intel's Sample Implementation. */ + +#ifndef GRUB_EFI_UGA_DRAW_HEADER +#define GRUB_EFI_UGA_DRAW_HEADER 1 + +#define GRUB_EFI_UGA_DRAW_GUID \ + { 0x982c298b, 0xf4fa, 0x41cb, { 0xb8, 0x38, 0x77, 0xaa, 0x68, 0x8f, 0xb8, 0x39 }} + +enum grub_efi_uga_blt_operation +{ + GRUB_EFI_UGA_VIDEO_FILL, + GRUB_EFI_UGA_VIDEO_TO_BLT, + GRUB_EFI_UGA_BLT_TO_VIDEO, + GRUB_EFI_UGA_VIDEO_TO_VIDEO, + GRUB_EFI_UGA_GLT_MAX +}; + +struct grub_efi_uga_pixel +{ + grub_uint8_t Blue; + grub_uint8_t Green; + grub_uint8_t Red; + grub_uint8_t Reserved; +}; + +struct grub_efi_uga_draw_protocol +{ + grub_efi_status_t + (*get_mode) (struct grub_efi_uga_draw_protocol *this, + grub_uint32_t *width, + grub_uint32_t *height, + grub_uint32_t *depth, + grub_uint32_t *refresh_rate); + + grub_efi_status_t + (*set_mode) (struct grub_efi_uga_draw_protocol *this, + grub_uint32_t width, + grub_uint32_t height, + grub_uint32_t depth, + grub_uint32_t refresh_rate); + + grub_efi_status_t + (*blt) (struct grub_efi_uga_draw_protocol *this, + struct grub_efi_uga_pixel *blt_buffer, + enum grub_efi_uga_blt_operation blt_operation, + grub_efi_uintn_t src_x, + grub_efi_uintn_t src_y, + grub_efi_uintn_t dest_x, + grub_efi_uintn_t dest_y, + grub_efi_uintn_t width, + grub_efi_uintn_t height, + grub_efi_uintn_t delta); +}; +typedef struct grub_efi_uga_draw_protocol grub_efi_uga_draw_protocol_t; + +#endif /* ! GRUB_EFI_UGA_DRAW_HEADER */ diff --git a/include/grub/elf.h b/include/grub/elf.h index 9aec816c7..7b76f5839 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -454,6 +454,7 @@ typedef struct the end of a chain, meaning no further symbols are found in that bucket. */ #define STN_UNDEF 0 /* End of a chain. */ +#define STN_ABS 65521 /* How to extract and insert information held in the st_other field. */ @@ -1108,8 +1109,27 @@ typedef struct /* Keep this the last entry. */ #define R_386_NUM 38 + /* SUN SPARC specific definitions. */ +/* x86_64 specific definitions. */ +#define R_X86_64_NONE 0 +#define R_X86_64_64 1 +#define R_X86_64_PC32 2 +#define R_X86_64_GOT32 3 +#define R_X86_64_PLT32 4 +#define R_X86_64_COPY 5 +#define R_X86_64_GLOB_DAT 6 +#define R_X86_64_JUMP_SLOT 7 +#define R_X86_64_RELATIVE 8 +#define R_X86_64_GOTPCREL 9 +#define R_X86_64_32 10 +#define R_X86_64_32S 11 +#define R_X86_64_16 12 +#define R_X86_64_PC16 13 +#define R_X86_64_8 14 +#define R_X86_64_PC8 15 + /* Legal values for ST_TYPE subfield of st_info (symbol type). */ #define STT_REGISTER 13 /* Global register reserved to app. */ diff --git a/include/grub/i386/efi/pci.h b/include/grub/i386/efi/pci.h new file mode 100644 index 000000000..8480fd79a --- /dev/null +++ b/include/grub/i386/efi/pci.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 7a8e006de..2c6873c4d 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -44,14 +44,44 @@ #define GRUB_LINUX_SETUP_MOVE_SIZE 0x9100 #define GRUB_LINUX_CL_MAGIC 0xA33F +#ifdef __x86_64__ + #define GRUB_LINUX_EFI_SIGNATURE \ - ('E' << 24 | 'F' << 16 | 'I' << 8 | 'L') + ('4' << 24 | '6' << 16 | 'L' << 8 | 'E') + +#else + +#define GRUB_LINUX_EFI_SIGNATURE \ + ('2' << 24 | '3' << 16 | 'L' << 8 | 'E') + +#endif + +#define GRUB_LINUX_EFI_SIGNATURE_0204 \ + ('L' << 24 | 'I' << 16 | 'F' << 8 | 'E') #define GRUB_LINUX_OFW_SIGNATURE \ (' ' << 24 | 'W' << 16 | 'F' << 8 | 'O') #ifndef ASM_FILE +#define GRUB_E820_RAM 1 +#define GRUB_E820_RESERVED 2 +#define GRUB_E820_ACPI 3 +#define GRUB_E820_NVS 4 +#define GRUB_E820_EXEC_CODE 5 + +#define GRUB_E820_MAX_ENTRY 128 + +struct grub_e820_mmap +{ + grub_uint64_t addr; + grub_uint64_t size; + grub_uint32_t type; +} __attribute__((packed)); + +#define GRUB_VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */ +#define GRUB_VIDEO_TYPE_EFI 0x70 + /* For the Linux/i386 boot protocol version 2.03. */ struct linux_kernel_header { @@ -164,26 +194,74 @@ struct linux_kernel_params grub_uint32_t ofw_cif_handler; /* b8 */ grub_uint32_t ofw_idt; /* bc */ - grub_uint8_t padding7[0x1c0 - 0xc0]; - - grub_uint32_t efi_signature; /* 1c0 */ - grub_uint32_t efi_system_table; /* 1c4 */ - grub_uint32_t efi_mem_desc_size; /* 1c8 */ - grub_uint32_t efi_mem_desc_version; /* 1cc */ - grub_uint32_t efi_mmap; /* 1d0 */ - grub_uint32_t efi_mmap_size; /* 1d4 */ - - grub_uint8_t padding8[0x1e0 - 0x1d8]; + grub_uint8_t padding7[0x1b8 - 0xc0]; + + union + { + struct + { + grub_uint32_t efi_system_table; /* 1b8 */ + grub_uint32_t padding7_1; /* 1bc */ + grub_uint32_t efi_signature; /* 1c0 */ + grub_uint32_t efi_mem_desc_size; /* 1c4 */ + grub_uint32_t efi_mem_desc_version; /* 1c8 */ + grub_uint32_t efi_mmap_size; /* 1cc */ + grub_uint32_t efi_mmap; /* 1d0 */ + } v0204; + struct + { + grub_uint32_t padding7_1; /* 1b8 */ + grub_uint32_t padding7_2; /* 1bc */ + grub_uint32_t efi_signature; /* 1c0 */ + grub_uint32_t efi_system_table; /* 1c4 */ + grub_uint32_t efi_mem_desc_size; /* 1c8 */ + grub_uint32_t efi_mem_desc_version; /* 1cc */ + grub_uint32_t efi_mmap; /* 1d0 */ + grub_uint32_t efi_mmap_size; /* 1d4 */ + grub_uint32_t efi_system_table_hi; /* 1d8 */ + grub_uint32_t efi_mmap_hi; /* 1dc */ + } v0206; + }; grub_uint32_t alt_mem; /* 1e0 */ - grub_uint8_t padding9[0x1e8 - 0x1e4]; + grub_uint8_t padding8[0x1e8 - 0x1e4]; grub_uint32_t mmap_size; /* 1e8 */ - grub_uint8_t padding10[0x1ff - 0x1ec]; + grub_uint8_t padding9[0x1f1 - 0x1ec]; + grub_uint8_t setup_sects; /* The size of the setup in sectors */ + grub_uint16_t root_flags; /* If the root is mounted readonly */ + grub_uint16_t syssize; /* obsolete */ + grub_uint16_t swap_dev; /* obsolete */ + grub_uint16_t ram_size; /* obsolete */ + grub_uint16_t vid_mode; /* Video mode control */ + grub_uint16_t root_dev; /* Default root device number */ + + grub_uint8_t padding10; /* 1fe */ grub_uint8_t ps_mouse; /* 1ff */ + + grub_uint16_t jump; /* Jump instruction */ + grub_uint32_t header; /* Magic signature "HdrS" */ + grub_uint16_t version; /* Boot protocol version supported */ + grub_uint32_t realmode_swtch; /* Boot loader hook */ + grub_uint16_t start_sys; /* The load-low segment (obsolete) */ + grub_uint16_t kernel_version; /* Points to kernel version string */ + grub_uint8_t type_of_loader; /* Boot loader identifier */ + grub_uint8_t loadflags; /* Boot protocol option flags */ + grub_uint16_t setup_move_size; /* Move to high memory size */ + grub_uint32_t code32_start; /* Boot loader hook */ + grub_uint32_t ramdisk_image; /* initrd load address */ + grub_uint32_t ramdisk_size; /* initrd size */ + grub_uint32_t bootsect_kludge; /* obsolete */ + grub_uint16_t heap_end_ptr; /* Free memory after setup end */ + grub_uint16_t pad1; /* Unused */ + grub_uint32_t cmd_line_ptr; /* Points to the kernel command line */ + + grub_uint8_t pad2[164]; /* 22c */ + struct grub_e820_mmap e820_map[GRUB_E820_MAX_ENTRY]; /* 2d0 */ + } __attribute__ ((packed)); #endif /* ! ASM_FILE */ diff --git a/include/grub/kernel.h b/include/grub/kernel.h index 4a4e2cc41..9cbbdaf22 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -38,6 +38,9 @@ struct grub_module_info { /* Magic number so we know we have modules present. */ grub_uint32_t magic; +#if GRUB_TARGET_SIZEOF_VOID_P == 8 + grub_uint32_t padding; +#endif /* The offset of the modules. */ grub_target_off_t offset; /* The size of all modules plus this header. */ diff --git a/include/grub/pci.h b/include/grub/pci.h index 71088867b..abc5c9084 100644 --- a/include/grub/pci.h +++ b/include/grub/pci.h @@ -22,6 +22,19 @@ #include #include +#define GRUB_PCI_ADDR_SPACE_MASK 0x01 +#define GRUB_PCI_ADDR_SPACE_MEMORY 0x00 +#define GRUB_PCI_ADDR_SPACE_IO 0x01 + +#define GRUB_PCI_ADDR_MEM_TYPE_MASK 0x06 +#define GRUB_PCI_ADDR_MEM_TYPE_32 0x00 /* 32 bit address */ +#define GRUB_PCI_ADDR_MEM_TYPE_1M 0x02 /* Below 1M [obsolete] */ +#define GRUB_PCI_ADDR_MEM_TYPE_64 0x04 /* 64 bit address */ +#define GRUB_PCI_ADDR_MEM_PREFETCH 0x08 /* prefetchable */ + +#define GRUB_PCI_ADDR_MEM_MASK ~0xf +#define GRUB_PCI_ADDR_IO_MASK ~0x03 + typedef grub_uint32_t grub_pci_id_t; typedef int (*grub_pci_iteratefunc_t) (int bus, int device, int func, grub_pci_id_t pciid); diff --git a/include/grub/x86_64/efi/kernel.h b/include/grub/x86_64/efi/kernel.h new file mode 100644 index 000000000..c0549f41a --- /dev/null +++ b/include/grub/x86_64/efi/kernel.h @@ -0,0 +1,33 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2003,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_KERNEL_HEADER +#define GRUB_MACHINE_KERNEL_HEADER 1 + +/* The prefix which points to the directory where GRUB modules and its + configuration file are located. */ +extern char grub_prefix[]; + +/* The offset of GRUB_PREFIX. */ +#define GRUB_KERNEL_MACHINE_PREFIX 0x8 + +/* End of the data section. */ +#define GRUB_KERNEL_MACHINE_DATA_END 0x50 + +#endif /* ! GRUB_MACHINE_KERNEL_HEADER */ + diff --git a/include/grub/x86_64/efi/loader.h b/include/grub/x86_64/efi/loader.h new file mode 100644 index 000000000..4368a8252 --- /dev/null +++ b/include/grub/x86_64/efi/loader.h @@ -0,0 +1,32 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2003,2004,2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_LOADER_MACHINE_HEADER +#define GRUB_LOADER_MACHINE_HEADER 1 + +#include +#include + +/* It is necessary to export these functions, because normal mode commands + reuse rescue mode commands. */ +void grub_rescue_cmd_linux (int argc, char *argv[]); +void grub_rescue_cmd_initrd (int argc, char *argv[]); + +void EXPORT_FUNC(grub_linux_real_boot) (void); + +#endif /* ! GRUB_LOADER_MACHINE_HEADER */ diff --git a/include/grub/x86_64/efi/machine.h b/include/grub/x86_64/efi/machine.h new file mode 100644 index 000000000..160076859 --- /dev/null +++ b/include/grub/x86_64/efi/machine.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_EFI 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/x86_64/efi/pci.h b/include/grub/x86_64/efi/pci.h new file mode 100644 index 000000000..8480fd79a --- /dev/null +++ b/include/grub/x86_64/efi/pci.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include diff --git a/include/grub/x86_64/efi/time.h b/include/grub/x86_64/efi/time.h new file mode 100644 index 000000000..7a9241fff --- /dev/null +++ b/include/grub/x86_64/efi/time.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_TIME_HEADER +#define GRUB_MACHINE_TIME_HEADER 1 + +#include + +#endif /* ! GRUB_MACHINE_TIME_HEADER */ diff --git a/include/grub/x86_64/linux.h b/include/grub/x86_64/linux.h new file mode 100644 index 000000000..19ea93686 --- /dev/null +++ b/include/grub/x86_64/linux.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include diff --git a/include/grub/x86_64/setjmp.h b/include/grub/x86_64/setjmp.h new file mode 100644 index 000000000..e417f65b7 --- /dev/null +++ b/include/grub/x86_64/setjmp.h @@ -0,0 +1,27 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_SETJMP_CPU_HEADER +#define GRUB_SETJMP_CPU_HEADER 1 + +typedef unsigned long grub_jmp_buf[8]; + +int grub_setjmp (grub_jmp_buf env); +void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); + +#endif /* ! GRUB_SETJMP_CPU_HEADER */ diff --git a/include/grub/x86_64/time.h b/include/grub/x86_64/time.h new file mode 100644 index 000000000..842882cf2 --- /dev/null +++ b/include/grub/x86_64/time.h @@ -0,0 +1,29 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef KERNEL_CPU_TIME_HEADER +#define KERNEL_CPU_TIME_HEADER 1 + +static __inline void +grub_cpu_idle (void) +{ + /* FIXME: this can't work until we handle interrupts. */ +/* __asm__ __volatile__ ("hlt"); */ +} + +#endif /* ! KERNEL_CPU_TIME_HEADER */ diff --git a/include/grub/x86_64/types.h b/include/grub/x86_64/types.h new file mode 100644 index 000000000..bdee5a109 --- /dev/null +++ b/include/grub/x86_64/types.h @@ -0,0 +1,31 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_TYPES_CPU_HEADER +#define GRUB_TYPES_CPU_HEADER 1 + +/* The size of void *. */ +#define GRUB_TARGET_SIZEOF_VOID_P 8 + +/* The size of long. */ +#define GRUB_TARGET_SIZEOF_LONG 8 + +/* x86_64 is little-endian. */ +#undef GRUB_TARGET_WORDS_BIGENDIAN + +#endif /* ! GRUB_TYPES_CPU_HEADER */ diff --git a/kern/dl.c b/kern/dl.c index c0d9f1d03..b57e78dc3 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -29,7 +29,7 @@ #include #include -#if GRUB_CPU_SIZEOF_VOID_P == 4 +#if GRUB_TARGET_SIZEOF_VOID_P == 4 typedef Elf32_Word Elf_Word; typedef Elf32_Addr Elf_Addr; @@ -40,7 +40,7 @@ typedef Elf32_Sym Elf_Sym; # define ELF_ST_BIND(val) ELF32_ST_BIND (val) # define ELF_ST_TYPE(val) ELF32_ST_TYPE (val) -#elif GRUB_CPU_SIZEOF_VOID_P == 8 +#elif GRUB_TARGET_SIZEOF_VOID_P == 8 typedef Elf64_Word Elf_Word; typedef Elf64_Addr Elf_Addr; diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 11dac5891..25dc1a609 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -43,9 +43,8 @@ grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration) void *interface; grub_efi_status_t status; - status = grub_efi_system_table->boot_services->locate_protocol (protocol, - registration, - &interface); + status = efi_call_3 (grub_efi_system_table->boot_services->locate_protocol, + protocol, registration, &interface); if (status != GRUB_EFI_SUCCESS) return 0; @@ -71,7 +70,7 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type, return 0; b = grub_efi_system_table->boot_services; - status = b->locate_handle (search_type, protocol, search_key, + status = efi_call_5 (b->locate_handle, search_type, protocol, search_key, &buffer_size, buffer); if (status == GRUB_EFI_BUFFER_TOO_SMALL) { @@ -80,7 +79,7 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type, if (! buffer) return 0; - status = b->locate_handle (search_type, protocol, search_key, + status = efi_call_5 (b->locate_handle, search_type, protocol, search_key, &buffer_size, buffer); } @@ -104,12 +103,12 @@ grub_efi_open_protocol (grub_efi_handle_t handle, void *interface; b = grub_efi_system_table->boot_services; - status = b->open_protocol (handle, - protocol, - &interface, - grub_efi_image_handle, - 0, - attributes); + status = efi_call_6 (b->open_protocol, handle, + protocol, + &interface, + grub_efi_image_handle, + 0, + attributes); if (status != GRUB_EFI_SUCCESS) return 0; @@ -128,12 +127,12 @@ grub_efi_set_text_mode (int on) already in text mode. */ return 1; - if (c->get_mode (c, &mode, 0, 0) != GRUB_EFI_SUCCESS) + if (efi_call_4 (c->get_mode, c, &mode, 0, 0) != GRUB_EFI_SUCCESS) return 0; new_mode = on ? GRUB_EFI_SCREEN_TEXT : GRUB_EFI_SCREEN_GRAPHICS; if (mode != new_mode) - if (c->set_mode (c, new_mode) != GRUB_EFI_SUCCESS) + if (efi_call_2 (c->set_mode, c, new_mode) != GRUB_EFI_SUCCESS) return 0; return 1; @@ -142,7 +141,7 @@ grub_efi_set_text_mode (int on) void grub_efi_stall (grub_efi_uintn_t microseconds) { - grub_efi_system_table->boot_services->stall (microseconds); + efi_call_1 (grub_efi_system_table->boot_services->stall, microseconds); } grub_efi_loaded_image_t * @@ -157,25 +156,24 @@ void grub_exit (void) { grub_efi_fini (); - grub_efi_system_table->boot_services->exit (grub_efi_image_handle, - GRUB_EFI_SUCCESS, - 0, 0); + efi_call_4 (grub_efi_system_table->boot_services->exit, + grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0); } void grub_reboot (void) { grub_efi_fini (); - grub_efi_system_table->runtime_services-> - reset_system (GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL); + efi_call_4 (grub_efi_system_table->runtime_services->reset_system, + GRUB_EFI_RESET_COLD, GRUB_EFI_SUCCESS, 0, NULL); } void grub_halt (void) { grub_efi_fini (); - grub_efi_system_table->runtime_services-> - reset_system (GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL); + efi_call_4 (grub_efi_system_table->runtime_services->reset_system, + GRUB_EFI_RESET_SHUTDOWN, GRUB_EFI_SUCCESS, 0, NULL); } int @@ -185,7 +183,7 @@ grub_efi_exit_boot_services (grub_efi_uintn_t map_key) grub_efi_status_t status; b = grub_efi_system_table->boot_services; - status = b->exit_boot_services (grub_efi_image_handle, map_key); + status = efi_call_2 (b->exit_boot_services, grub_efi_image_handle, map_key); return status == GRUB_EFI_SUCCESS; } @@ -196,7 +194,7 @@ grub_get_rtc (void) grub_efi_runtime_services_t *r; r = grub_efi_system_table->runtime_services; - if (r->get_time (&time, 0) != GRUB_EFI_SUCCESS) + if (efi_call_2 (r->get_time, &time, 0) != GRUB_EFI_SUCCESS) /* What is possible in this case? */ return 0; diff --git a/kern/efi/mm.c b/kern/efi/mm.c index 9cd096d7d..d73636998 100644 --- a/kern/efi/mm.c +++ b/kern/efi/mm.c @@ -30,7 +30,7 @@ /* The size of a memory map obtained from the firmware. This must be a multiplier of 4KB. */ -#define MEMORY_MAP_SIZE 0x1000 +#define MEMORY_MAP_SIZE 0x3000 /* Maintain the list of allocated pages. */ struct allocated_page @@ -59,7 +59,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, grub_efi_status_t status; grub_efi_boot_services_t *b; -#if GRUB_CPU_SIZEOF_VOID_P < 8 +#if GRUB_TARGET_SIZEOF_VOID_P < 8 /* Limit the memory access to less than 4GB for 32-bit platforms. */ if (address > 0xffffffff) return 0; @@ -79,7 +79,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, #endif b = grub_efi_system_table->boot_services; - status = b->allocate_pages (type, GRUB_EFI_LOADER_DATA, pages, &address); + status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address); if (status != GRUB_EFI_SUCCESS) return 0; @@ -88,7 +88,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, /* Uggh, the address 0 was allocated... This is too annoying, so reallocate another one. */ address = 0xffffffff; - status = b->allocate_pages (type, GRUB_EFI_LOADER_DATA, pages, &address); + status = efi_call_4 (b->allocate_pages, type, GRUB_EFI_LOADER_DATA, pages, &address); grub_efi_free_pages (0, pages); if (status != GRUB_EFI_SUCCESS) return 0; @@ -135,7 +135,7 @@ grub_efi_free_pages (grub_efi_physical_address_t address, } b = grub_efi_system_table->boot_services; - b->free_pages (address, pages); + efi_call_2 (b->free_pages, address, pages); } /* Get the memory map as defined in the EFI spec. Return 1 if successful, @@ -159,7 +159,7 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size, descriptor_version = &version; b = grub_efi_system_table->boot_services; - status = b->get_memory_map (memory_map_size, memory_map, map_key, + status = efi_call_5 (b->get_memory_map, memory_map_size, memory_map, map_key, descriptor_size, descriptor_version); if (status == GRUB_EFI_SUCCESS) return 1; @@ -218,7 +218,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY -#if GRUB_CPU_SIZEOF_VOID_P < 8 +#if GRUB_TARGET_SIZEOF_VOID_P < 8 && desc->physical_start <= 0xffffffff #endif && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000 @@ -234,7 +234,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, desc->physical_start = 0x100000; } -#if GRUB_CPU_SIZEOF_VOID_P < 8 +#if GRUB_TARGET_SIZEOF_VOID_P < 8 if (BYTES_TO_PAGES (filtered_desc->physical_start) + filtered_desc->num_pages > BYTES_TO_PAGES (0x100000000LL)) diff --git a/kern/x86_64/dl.c b/kern/x86_64/dl.c new file mode 100644 index 000000000..bef327052 --- /dev/null +++ b/kern/x86_64/dl.c @@ -0,0 +1,121 @@ +/* dl-x86_64.c - arch-dependent part of loadable module support */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +/* Check if EHDR is a valid ELF header. */ +grub_err_t +grub_arch_dl_check_header (void *ehdr) +{ + Elf64_Ehdr *e = ehdr; + + /* Check the magic numbers. */ + if (e->e_ident[EI_CLASS] != ELFCLASS64 + || e->e_ident[EI_DATA] != ELFDATA2LSB + || e->e_machine != EM_X86_64) + return grub_error (GRUB_ERR_BAD_OS, "invalid arch specific ELF magic"); + + return GRUB_ERR_NONE; +} + +/* Relocate symbols. */ +grub_err_t +grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) +{ + Elf64_Ehdr *e = ehdr; + Elf64_Shdr *s; + Elf64_Sym *symtab; + Elf64_Word entsize; + unsigned i; + + /* Find a symbol table. */ + for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_SYMTAB) + break; + + if (i == e->e_shnum) + return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); + + symtab = (Elf64_Sym *) ((char *) e + s->sh_offset); + entsize = s->sh_entsize; + + for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_RELA) + { + grub_dl_segment_t seg; + + /* Find the target segment. */ + for (seg = mod->segment; seg; seg = seg->next) + if (seg->section == s->sh_info) + break; + + if (seg) + { + Elf64_Rela *rel, *max; + + for (rel = (Elf64_Rela *) ((char *) e + s->sh_offset), + max = rel + s->sh_size / s->sh_entsize; + rel < max; + rel++) + { + Elf64_Word *addr32; + Elf64_Xword *addr64; + Elf64_Sym *sym; + + if (seg->size < rel->r_offset) + return grub_error (GRUB_ERR_BAD_MODULE, + "reloc offset is out of the segment"); + + addr32 = (Elf64_Word *) ((char *) seg->addr + rel->r_offset); + addr64 = (Elf64_Xword *) addr32; + sym = (Elf64_Sym *) ((char *) symtab + + entsize * ELF64_R_SYM (rel->r_info)); + + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_X86_64_64: + *addr64 = rel->r_addend + sym->st_value; + break; + + case R_X86_64_PC32: + *addr32 = rel->r_addend + sym->st_value - + (Elf64_Xword) seg->addr - rel->r_offset; + break; + + case R_X86_64_32: + case R_X86_64_32S: + *addr32 = rel->r_addend + sym->st_value; + break; + + default: + grub_fatal ("Unrecognized relocation: %d\n", ELF64_R_TYPE (rel->r_info)); + } + } + } + } + + return GRUB_ERR_NONE; +} diff --git a/kern/x86_64/efi/callwrap.S b/kern/x86_64/efi/callwrap.S new file mode 100644 index 000000000..36e550967 --- /dev/null +++ b/kern/x86_64/efi/callwrap.S @@ -0,0 +1,96 @@ +/* callwrap.S - wrapper for x86_64 efi calls */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +/* + * x86_64 uses registry to pass parameters. Unfortuanately, gcc and efi use + * different call conversion, so we need to do some conversion. + * + * gcc: + * %rdi, %esi, %rdx, %rcx, %r8, %r9, 8(%rsp), 16(%rsp), ... + * + * efi: + * %rcx, %rdx, %r8, %r9, 32(%rsp), 40(%rsp), 48(%rsp), ... + * + */ + + .file "callwrap.S" + .text + +FUNCTION(efi_wrap_0) + subq $40, %rsp + call *%rdi + addq $40, %rsp + ret + +FUNCTION(efi_wrap_1) + subq $40, %rsp + mov %rsi, %rcx + call *%rdi + addq $40, %rsp + ret + +FUNCTION(efi_wrap_2) + subq $40, %rsp + mov %rsi, %rcx + call *%rdi + addq $40, %rsp + ret + +FUNCTION(efi_wrap_3) + subq $40, %rsp + mov %rcx, %r8 + mov %rsi, %rcx + call *%rdi + addq $40, %rsp + ret + +FUNCTION(efi_wrap_4) + subq $40, %rsp + mov %r8, %r9 + mov %rcx, %r8 + mov %rsi, %rcx + call *%rdi + addq $40, %rsp + ret + +FUNCTION(efi_wrap_5) + subq $40, %rsp + mov %r9, 32(%rsp) + mov %r8, %r9 + mov %rcx, %r8 + mov %rsi, %rcx + call *%rdi + addq $40, %rsp + ret + +FUNCTION(efi_wrap_6) + subq $56, %rsp + mov 56+8(%rsp), %rax + mov %rax, 40(%rsp) + mov %r9, (%rsp) + mov %r8, %r9 + mov %rcx, %r8 + mov %rsi, %rcx + call *%rdi + addq $56, %rsp + ret diff --git a/kern/x86_64/efi/startup.S b/kern/x86_64/efi/startup.S new file mode 100644 index 000000000..2fa676697 --- /dev/null +++ b/kern/x86_64/efi/startup.S @@ -0,0 +1,87 @@ +/* startup.S - bootstrap GRUB itself */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + + .file "startup.S" + .text + .globl start, _start + .code64 + +start: +_start: + jmp codestart + + /* + * Compatibility version number + * + * These MUST be at byte offset 6 and 7 of the executable + * DO NOT MOVE !!! + */ + . = EXT_C(start) + 0x6 + .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR + + /* + * This is a special data area 8 bytes from the beginning. + */ + + . = EXT_C(start) + 0x8 + +VARIABLE(grub_prefix) + /* to be filled by grub-mkimage */ + + /* + * Leave some breathing room for the prefix. + */ + + . = EXT_C(start) + 0x50 + +codestart: + + movq %rcx, EXT_C(grub_efi_image_handle) + movq %rdx, EXT_C(grub_efi_system_table) + + call EXT_C(grub_main) + ret + + .code32 + +FUNCTION(grub_linux_real_boot) + /* Turn off PG bit in CR0 and set CR3 to zero. */ + movl %cr0, %eax + andl $0x7FFFFFFF, %eax + movl %eax, %cr0 + + /* Setup EFER (Extended Feature Enable Register). */ + movl $0xc0000080, %ecx + rdmsr + + /* Disable Long Mode. */ + andl $0xFFFFFEFF, %eax + + /* Make changes effective. */ + wrmsr + + /* Disable PAE. */ + xorl %eax, %eax + movl %eax, %cr4 + + jmp *%ebx diff --git a/loader/efi/appleloader.c b/loader/efi/appleloader.c new file mode 100644 index 000000000..910a13de0 --- /dev/null +++ b/loader/efi/appleloader.c @@ -0,0 +1,208 @@ +/* appleloader.c - apple legacy boot loader. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static grub_dl_t my_mod; + +static grub_efi_handle_t image_handle; +static grub_efi_char16_t *cmdline; + +static grub_err_t +grub_appleloader_unload (void) +{ + grub_efi_boot_services_t *b; + + b = grub_efi_system_table->boot_services; + efi_call_1 (b->unload_image, image_handle); + + grub_free (cmdline); + cmdline = 0; + + grub_dl_unref (my_mod); + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_appleloader_boot (void) +{ + grub_efi_boot_services_t *b; + + b = grub_efi_system_table->boot_services; + efi_call_3 (b->start_image, image_handle, 0, 0); + + grub_appleloader_unload (); + + return grub_errno; +} + +/* early 2006 Core Duo / Core Solo models */ +static grub_uint8_t devpath_1[] = +{ + 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xF9, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, + 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, +}; + +/* mid-2006 Mac Pro (and probably other Core 2 models) */ +static grub_uint8_t devpath_2[] = +{ + 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xF7, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, + 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, +}; + +/* mid-2007 MBP ("Santa Rosa" based models) */ +static grub_uint8_t devpath_3[] = +{ + 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xE0, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, + 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, +}; + +/* early-2008 MBA */ +static grub_uint8_t devpath_4[] = +{ + 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x00, 0xC0, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xFF, 0xF8, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, + 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, +}; + +struct devdata +{ + char *model; + grub_efi_device_path_t *devpath; +}; + +struct devdata devs[] = +{ + {"Core Duo/Solo", (grub_efi_device_path_t *) devpath_1}, + {"Mac Pro", (grub_efi_device_path_t *) devpath_2}, + {"MBP", (grub_efi_device_path_t *) devpath_3}, + {"MBA", (grub_efi_device_path_t *) devpath_4}, + {NULL, NULL}, +}; + +static grub_err_t +grub_cmd_appleloader (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_efi_boot_services_t *b; + grub_efi_loaded_image_t *loaded_image; + struct devdata *pdev; + + grub_dl_ref (my_mod); + + /* Initialize some global variables. */ + image_handle = 0; + + b = grub_efi_system_table->boot_services; + + for (pdev = devs ; pdev->devpath ; pdev++) + if (efi_call_6 (b->load_image, 0, grub_efi_image_handle, pdev->devpath, + NULL, 0, &image_handle) == GRUB_EFI_SUCCESS) + break; + + if (! pdev->devpath) + { + grub_error (GRUB_ERR_BAD_OS, "can't find model"); + goto fail; + } + + grub_printf ("Model : %s\n", pdev->model); + + loaded_image = grub_efi_get_loaded_image (image_handle); + if (! loaded_image) + { + grub_error (GRUB_ERR_BAD_OS, "no loaded image available"); + goto fail; + } + + if (argc > 0) + { + int i, len; + grub_efi_char16_t *p16; + + for (i = 0, len = 0; i < argc; i++) + len += grub_strlen (argv[i]) + 1; + + len *= sizeof (grub_efi_char16_t); + cmdline = p16 = grub_malloc (len); + if (! cmdline) + goto fail; + + for (i = 0; i < argc; i++) + { + char *p8; + + p8 = argv[i]; + while (*p8) + *(p16++) = *(p8++); + + *(p16++) = ' '; + } + *(--p16) = 0; + + loaded_image->load_options = cmdline; + loaded_image->load_options_size = len; + } + + grub_loader_set (grub_appleloader_boot, grub_appleloader_unload, 0); + + return 0; + + fail: + + grub_dl_unref (my_mod); + return grub_errno; +} + +GRUB_MOD_INIT(appleloader) +{ + grub_register_command ("appleloader", grub_cmd_appleloader, + GRUB_COMMAND_FLAG_BOTH, + "appleloader [OPTS]", + "Boot legacy system.", 0); + + my_mod = mod; +} + +GRUB_MOD_FINI(appleloader) +{ + grub_unregister_command ("appleloader"); +} diff --git a/loader/efi/chainloader.c b/loader/efi/chainloader.c index 19285d90e..a8b3322cc 100644 --- a/loader/efi/chainloader.c +++ b/loader/efi/chainloader.c @@ -40,6 +40,7 @@ static grub_efi_physical_address_t address; static grub_efi_uintn_t pages; static grub_efi_device_path_t *file_path; static grub_efi_handle_t image_handle; +static grub_efi_char16_t *cmdline; static grub_err_t grub_chainloader_unload (void) @@ -47,9 +48,12 @@ grub_chainloader_unload (void) grub_efi_boot_services_t *b; b = grub_efi_system_table->boot_services; - b->unload_image (image_handle); - b->free_pages (address, pages); + efi_call_1 (b->unload_image, image_handle); + efi_call_2 (b->free_pages, address, pages); + grub_free (file_path); + grub_free (cmdline); + cmdline = 0; grub_dl_unref (my_mod); return GRUB_ERR_NONE; @@ -64,7 +68,7 @@ grub_chainloader_boot (void) grub_efi_char16_t *exit_data; b = grub_efi_system_table->boot_services; - status = b->start_image (image_handle, &exit_data_size, &exit_data); + status = efi_call_3 (b->start_image, image_handle, &exit_data_size, &exit_data); if (status != GRUB_EFI_SUCCESS) { if (exit_data) @@ -86,7 +90,7 @@ grub_chainloader_boot (void) } if (exit_data) - b->free_pool (exit_data); + efi_call_1 (b->free_pool, exit_data); grub_chainloader_unload (); @@ -175,7 +179,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) } void -grub_chainloader_cmd (const char *filename) +grub_rescue_cmd_chainloader (int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -185,6 +189,14 @@ grub_chainloader_cmd (const char *filename) grub_device_t dev = 0; grub_efi_device_path_t *dp = 0; grub_efi_loaded_image_t *loaded_image; + char *filename; + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); + return; + } + filename = argv[0]; grub_dl_ref (my_mod); @@ -227,7 +239,7 @@ grub_chainloader_cmd (const char *filename) size = grub_file_size (file); pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12); - status = b->allocate_pages (GRUB_EFI_ALLOCATE_ANY_PAGES, + status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES, GRUB_EFI_LOADER_CODE, pages, &address); if (status != GRUB_EFI_SUCCESS) @@ -244,7 +256,7 @@ grub_chainloader_cmd (const char *filename) goto fail; } - status = b->load_image (0, grub_efi_image_handle, file_path, + status = efi_call_6 (b->load_image, 0, grub_efi_image_handle, file_path, (void *) ((grub_addr_t) address), size, &image_handle); if (status != GRUB_EFI_SUCCESS) @@ -269,6 +281,36 @@ grub_chainloader_cmd (const char *filename) loaded_image->device_handle = dev_handle; grub_file_close (file); + + if (argc > 1) + { + int i, len; + grub_efi_char16_t *p16; + + for (i = 1, len = 0; i < argc; i++) + len += grub_strlen (argv[i]) + 1; + + len *= sizeof (grub_efi_char16_t); + cmdline = p16 = grub_malloc (len); + if (! cmdline) + goto fail; + + for (i = 1; i < argc; i++) + { + char *p8; + + p8 = argv[i]; + while (*p8) + *(p16++) = *(p8++); + + *(p16++) = ' '; + } + *(--p16) = 0; + + loaded_image->load_options = cmdline; + loaded_image->load_options_size = len; + } + grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); return; @@ -284,20 +326,11 @@ grub_chainloader_cmd (const char *filename) grub_free (file_path); if (address) - b->free_pages (address, pages); + efi_call_2 (b->free_pages, address, pages); grub_dl_unref (my_mod); } -static void -grub_rescue_cmd_chainloader (int argc, char *argv[]) -{ - if (argc == 0) - grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); - else - grub_chainloader_cmd (argv[0]); -} - static const char loader_name[] = "chainloader"; GRUB_MOD_INIT(chainloader) diff --git a/loader/efi/chainloader_normal.c b/loader/efi/chainloader_normal.c index 2ea336837..455669e23 100644 --- a/loader/efi/chainloader_normal.c +++ b/loader/efi/chainloader_normal.c @@ -29,7 +29,7 @@ chainloader_command (struct grub_arg_list *state __attribute__ ((unused)), if (argc == 0) grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); else - grub_chainloader_cmd (args[0]); + grub_rescue_cmd_chainloader (argc, args); return grub_errno; } diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 946f56276..545117ed4 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -30,6 +30,11 @@ #include #include #include +#include +#include + +#define GRUB_EFI_CL_OFFSET 0x1000 +#define GRUB_EFI_CL_END_OFFSET 0x2000 #define NEXT_MEMORY_DESCRIPTOR(desc, size) \ ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) @@ -60,28 +65,24 @@ static grub_uint8_t gdt[] __attribute__ ((aligned(16))) = struct gdt_descriptor { - grub_uint16_t dummy; grub_uint16_t limit; - grub_uint32_t base; -} __attribute__ ((aligned(4), packed)); + void *base; +} __attribute__ ((packed)); static struct gdt_descriptor gdt_desc = { - 0, sizeof (gdt) - 1, - (grub_addr_t) gdt + gdt }; struct idt_descriptor { - grub_uint16_t dummy; grub_uint16_t limit; - grub_uint32_t base; -} __attribute__ ((aligned(4))); + void *base; +} __attribute__ ((packed)); static struct idt_descriptor idt_desc = { - 0, 0, 0 }; @@ -156,20 +157,21 @@ free_pages (void) /* Allocate pages for the real mode code and the protected mode code for linux as well as a memory map buffer. */ static int -allocate_pages (grub_size_t real_size, grub_size_t prot_size) +allocate_pages (grub_size_t prot_size) { grub_efi_uintn_t desc_size; grub_efi_memory_descriptor_t *mmap, *mmap_end; grub_efi_uintn_t mmap_size, tmp_mmap_size; grub_efi_memory_descriptor_t *desc; + grub_size_t real_size; /* Make sure that each size is aligned to a page boundary. */ - real_size = page_align (real_size + GRUB_DISK_SECTOR_SIZE); + real_size = GRUB_EFI_CL_END_OFFSET; prot_size = page_align (prot_size); mmap_size = find_mmap_size (); - grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %lx\n", - real_size, prot_size, mmap_size); + grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n", + (unsigned) real_size, (unsigned) prot_size, (unsigned) mmap_size); /* Calculate the number of pages; Combine the real mode code with the memory map buffer for simplicity. */ @@ -217,8 +219,8 @@ allocate_pages (grub_size_t real_size, grub_size_t prot_size) if (addr < 0x10000) continue; - grub_dprintf ("linux", "trying to allocate %lu pages at %x\n", - real_mode_pages, (unsigned) addr); + grub_dprintf ("linux", "trying to allocate %u pages at %lx\n", + (unsigned) real_mode_pages, (unsigned long) addr); real_mode_mem = grub_efi_allocate_pages (addr, real_mode_pages); if (! real_mode_mem) grub_fatal ("cannot allocate pages"); @@ -246,6 +248,11 @@ allocate_pages (grub_size_t real_size, grub_size_t prot_size) goto fail; } + grub_dprintf ("linux", "real_mode_mem = %lx, real_mode_pages = %x, " + "prot_mode_mem = %lx, prot_mode_pages = %x\n", + (unsigned long) real_mode_mem, (unsigned) real_mode_pages, + (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); + grub_free (mmap); return 1; @@ -255,56 +262,189 @@ allocate_pages (grub_size_t real_size, grub_size_t prot_size) return 0; } +static void +grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, + grub_uint64_t start, grub_uint64_t size, + grub_uint32_t type) +{ + int n = *e820_num; + + if (n >= GRUB_E820_MAX_ENTRY) + grub_fatal ("Too many e820 memory map entries"); + + if ((n > 0) && (e820_map[n - 1].addr + e820_map[n - 1].size == start) && + (e820_map[n - 1].type == type)) + e820_map[n - 1].size += size; + else + { + e820_map[n].addr = start; + e820_map[n].size = size; + e820_map[n].type = type; + (*e820_num)++; + } +} + +#ifdef __x86_64__ +struct +{ + grub_uint32_t kernel_entry; + grub_uint32_t kernel_cs; +} jumpvector; +#endif + static grub_err_t grub_linux_boot (void) { - struct linux_kernel_header *lh; struct linux_kernel_params *params; grub_efi_uintn_t mmap_size; grub_efi_uintn_t map_key; grub_efi_uintn_t desc_size; grub_efi_uint32_t desc_version; + grub_efi_memory_descriptor_t *desc; + int e820_num; - lh = real_mode_mem; params = real_mode_mem; - grub_dprintf ("linux", "code32_start = %x, idt_desc = %x, gdt_desc = %x\n", - (unsigned) lh->code32_start, (grub_addr_t) &(idt_desc.limit), - (grub_addr_t) &(gdt_desc.limit)); - grub_dprintf ("linux", "idt = %x:%x, gdt = %x:%x\n", - (unsigned) idt_desc.limit, (unsigned) idt_desc.base, - (unsigned) gdt_desc.limit, (unsigned) gdt_desc.base); + grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", + (unsigned) params->code32_start, + (unsigned long) &(idt_desc.limit), + (unsigned long) &(gdt_desc.limit)); + grub_dprintf ("linux", "idt = %x:%lx, gdt = %x:%lx\n", + (unsigned) idt_desc.limit, (unsigned long) idt_desc.base, + (unsigned) gdt_desc.limit, (unsigned long) gdt_desc.base); + mmap_size = find_mmap_size (); if (grub_efi_get_memory_map (&mmap_size, mmap_buf, &map_key, &desc_size, &desc_version) <= 0) grub_fatal ("cannot get memory map"); + e820_num = 0; + for (desc = mmap_buf; + desc < NEXT_MEMORY_DESCRIPTOR (mmap_buf, mmap_size); + desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) + { + switch (desc->type) + { + case GRUB_EFI_ACPI_RECLAIM_MEMORY: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_ACPI); + break; + + case GRUB_EFI_ACPI_MEMORY_NVS: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_NVS); + break; + + case GRUB_EFI_RUNTIME_SERVICES_CODE: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_EXEC_CODE); + break; + + case GRUB_EFI_LOADER_CODE: + case GRUB_EFI_LOADER_DATA: + case GRUB_EFI_BOOT_SERVICES_CODE: + case GRUB_EFI_BOOT_SERVICES_DATA: + case GRUB_EFI_CONVENTIONAL_MEMORY: + { + grub_uint64_t start, size, end; + + start = desc->physical_start; + size = desc->num_pages << 12; + end = start + size; + + /* Skip A0000 - 100000 region. */ + if ((start < 0x100000ULL) && (end > 0xA0000ULL)) + { + if (start < 0xA0000ULL) + { + grub_e820_add_region (params->e820_map, &e820_num, + start, + 0xA0000ULL - start, + GRUB_E820_RAM); + } + + if (end <= 0x100000ULL) + continue; + + start = 0x100000ULL; + size = end - start; + } + + grub_e820_add_region (params->e820_map, &e820_num, + start, size, GRUB_E820_RAM); + break; + } + + default: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_RESERVED); + } + } + + params->mmap_size = e820_num; + if (! grub_efi_exit_boot_services (map_key)) - grub_fatal ("cannot exit boot services"); + grub_fatal ("cannot exit boot services"); /* Note that no boot services are available from here. */ + /* Pass EFI parameters. */ + if (grub_le_to_cpu16 (params->version) >= 0x0206) + { + params->v0206.efi_mem_desc_size = desc_size; + params->v0206.efi_mem_desc_version = desc_version; + params->v0206.efi_mmap = (grub_uint32_t) (unsigned long) mmap_buf; + params->v0206.efi_mmap_size = mmap_size; +#ifdef __x86_64__ + params->v0206.efi_mmap_hi = (grub_uint32_t) ((grub_uint64_t) mmap_buf >> 32); +#endif + } + else if (grub_le_to_cpu16 (params->version) >= 0x0204) + { + params->v0204.efi_mem_desc_size = desc_size; + params->v0204.efi_mem_desc_version = desc_version; + params->v0204.efi_mmap = (grub_uint32_t) (unsigned long) mmap_buf; + params->v0204.efi_mmap_size = mmap_size; + } + /* Hardware interrupts are not safe any longer. */ asm volatile ("cli" : : ); - /* Pass EFI parameters. */ - params->efi_mem_desc_size = desc_size; - params->efi_mem_desc_version = desc_version; - params->efi_mmap = (grub_addr_t) mmap_buf; - params->efi_mmap_size = mmap_size; + /* Load the IDT and the GDT for the bootstrap. */ + asm volatile ("lidt %0" : : "m" (idt_desc)); + asm volatile ("lgdt %0" : : "m" (gdt_desc)); + +#ifdef __x86_64__ + + jumpvector.kernel_entry = (grub_uint64_t) grub_linux_real_boot; + jumpvector.kernel_cs = 0x10; + + asm volatile ( "mov %0, %%rbx" : : "m" (params->code32_start)); + asm volatile ( "mov %0, %%rsi" : : "m" (real_mode_mem)); + + asm volatile ( "ljmp *%0" : : "m" (jumpvector)); + +#else /* Pass parameters. */ + asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem)); - asm volatile ("movl %0, %%ecx" : : "m" (lh->code32_start)); - asm volatile ("xorl %%ebx, %%ebx" : : ); - /* Load the IDT and the GDT for the bootstrap. */ - asm volatile ("lidt %0" : : "m" (idt_desc.limit)); - asm volatile ("lgdt %0" : : "m" (gdt_desc.limit)); + asm volatile ("xorl %%ebx, %%ebx" : : ); /* Enter Linux. */ asm volatile ("jmp *%%ecx" : : ); +#endif + /* Never reach here. */ return GRUB_ERR_NONE; } @@ -318,6 +458,111 @@ grub_linux_unload (void) return GRUB_ERR_NONE; } +grub_uint64_t video_base; + +static int +grub_find_video_card (int bus, int dev, int func, + grub_pci_id_t pciid __attribute__ ((unused))) +{ + grub_pci_address_t addr; + + addr = grub_pci_make_address (bus, dev, func, 2); + + if (grub_pci_read (addr) >> 24 == 0x3) + { + int i; + + addr = grub_pci_make_address (bus, dev, func, 4); + for (i = 0; i < 6; i++, addr += 4) + { + grub_uint32_t base, type; + + base = grub_pci_read (addr); + + if ((base == 0) || (base == 0xffffffff) || + (base & GRUB_PCI_ADDR_SPACE_IO)) + continue; + + type = base & GRUB_PCI_ADDR_MEM_TYPE_MASK; + if (! (addr & GRUB_PCI_ADDR_MEM_PREFETCH)) + { + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + i++; + addr +=4 ; + } + continue; + } + + base &= GRUB_PCI_ADDR_MEM_MASK; + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + if (i == 5) + break; + + video_base = grub_pci_read (addr + 4); + video_base <<= 32; + } + + video_base |= base; + + return 1; + } + } + + return 0; +} + +static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; + +static int +grub_linux_setup_video (struct linux_kernel_params *params) +{ + grub_efi_uga_draw_protocol_t *c; + grub_uint32_t width, height, depth, rate; + + c = grub_efi_locate_protocol (&uga_draw_guid, 0); + if (! c) + return 1; + + if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate)) + return 1; + + grub_printf ("Video mode: %ux%u-%u@%u\n", width, height, depth, rate); + + video_base = 0; + grub_pci_iterate (grub_find_video_card); + + if (! video_base) + { + grub_printf ("Can\'t find frame buffer address\n"); + return 1; + } + + grub_printf ("Video frame buffer: %llx\n", (unsigned long long) video_base); + + params->lfb_width = width; + params->lfb_height = height; + params->lfb_depth = depth; + + /* FIXME: shouldn't use fixed value. */ + params->lfb_line_len = 8192; + + params->lfb_base = video_base; + params->lfb_size = (params->lfb_line_len * params->lfb_height + 65535) >> 16; + + params->red_mask_size = 8; + params->red_field_pos = 16; + params->green_mask_size = 8; + params->green_field_pos = 8; + params->blue_mask_size = 8; + params->blue_field_pos = 0; + params->reserved_mask_size = 8; + params->reserved_field_pos = 24; + + return 0; +} + void grub_rescue_cmd_linux (int argc, char *argv[]) { @@ -329,6 +574,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_ssize_t len; int i; char *dest; + int video_type; grub_dl_ref (my_mod); @@ -384,19 +630,33 @@ grub_rescue_cmd_linux (int argc, char *argv[]) real_size = setup_sects << GRUB_DISK_SECTOR_BITS; prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE; - if (! allocate_pages (real_size, prot_size)) + if (! allocate_pages (prot_size)) goto fail; + params = (struct linux_kernel_params *) real_mode_mem; + grub_memset (params, 0, GRUB_EFI_CL_END_OFFSET); + grub_memcpy (¶ms->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); + + params->ps_mouse = params->padding10 = 0; + + len = 0x400 - sizeof (lh); + if (grub_file_read (file, (char *) real_mode_mem + sizeof (lh), len) != len) + { + grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); + goto fail; + } + /* XXX Linux assumes that only elilo can boot Linux on EFI!!! */ - lh.type_of_loader = 0x50; + params->type_of_loader = 0x50; - lh.cl_magic = GRUB_LINUX_CL_MAGIC; - lh.cl_offset = GRUB_LINUX_CL_END_OFFSET; - lh.cmd_line_ptr = (char *) real_mode_mem + GRUB_LINUX_CL_OFFSET; - lh.ramdisk_image = 0; - lh.ramdisk_size = 0; + params->cl_magic = GRUB_LINUX_CL_MAGIC; + params->cl_offset = 0x1000; + params->cmd_line_ptr = (unsigned long) real_mode_mem + 0x1000; + params->ramdisk_image = 0; + params->ramdisk_size = 0; - params = (struct linux_kernel_params *) &lh; + params->heap_end_ptr = GRUB_LINUX_HEAP_END_OFFSET; + params->loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP; /* These are not needed to be precise, because Linux uses these values only to raise an error when the decompression code cannot find good @@ -414,6 +674,23 @@ grub_rescue_cmd_linux (int argc, char *argv[]) params->have_vga = 0; params->font_size = 16; /* XXX */ + if (grub_le_to_cpu16 (params->version) >= 0x0206) + { + params->v0206.efi_signature = GRUB_LINUX_EFI_SIGNATURE; + params->v0206.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table; +#ifdef __x86_64__ + params->v0206.efi_system_table_hi = (grub_uint32_t) ((grub_uint64_t) grub_efi_system_table >> 32); +#endif + } + else if (grub_le_to_cpu16 (params->version) >= 0x0204) + { + params->v0204.efi_signature = GRUB_LINUX_EFI_SIGNATURE_0204; + params->v0204.efi_system_table = (grub_uint32_t) (unsigned long) grub_efi_system_table; + } + +#if 0 + /* The structure is zeroed already. */ + /* No VBE on EFI. */ params->lfb_width = 0; params->lfb_height = 0; @@ -457,10 +734,6 @@ grub_rescue_cmd_linux (int argc, char *argv[]) /* No MCA on EFI. */ params->rom_config_len = 0; - params->efi_signature = GRUB_LINUX_EFI_SIGNATURE; /* XXX not used */ - params->efi_system_table = (grub_addr_t) grub_efi_system_table; - /* The other EFI parameters are filled when booting. */ - /* No need to fake the BIOS's memory map. */ params->mmap_size = 0; @@ -478,22 +751,19 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_memset (params->padding8, 0, sizeof (params->padding8)); grub_memset (params->padding9, 0, sizeof (params->padding9)); - /* Put the real mode code at the real location. */ - grub_memmove (real_mode_mem, &lh, sizeof (lh)); +#endif - len = real_size + GRUB_DISK_SECTOR_SIZE - sizeof (lh); - if (grub_file_read (file, (char *) real_mode_mem + sizeof (lh), len) != len) - { - grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); - goto fail; - } + /* The other EFI parameters are filled when booting. */ + + grub_file_seek (file, real_size + GRUB_DISK_SECTOR_SIZE); /* XXX there is no way to know if the kernel really supports EFI. */ grub_printf (" [Linux-EFI, setup=0x%x, size=0x%x]\n", - real_size, prot_size); + (unsigned) real_size, (unsigned) prot_size); /* Detect explicitly specified memory size, if any. */ linux_mem_size = 0; + video_type = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "mem=", 4) == 0) { @@ -529,9 +799,22 @@ grub_rescue_cmd_linux (int argc, char *argv[]) linux_mem_size <<= shift; } } + else if (grub_memcmp (argv[i], "video=", 6) == 0) + { + if (grub_memcmp (&argv[i][6], "vesafb", 6) == 0) + video_type = GRUB_VIDEO_TYPE_VLFB; + else if (grub_memcmp (&argv[i][6], "efifb", 5) == 0) + video_type = GRUB_VIDEO_TYPE_EFI; + } + + if (video_type) + { + if (! grub_linux_setup_video (params)) + params->have_vga = video_type; + } /* Specify the boot file. */ - dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, + dest = grub_stpcpy ((char *) real_mode_mem + GRUB_EFI_CL_OFFSET, "BOOT_IMAGE="); dest = grub_stpcpy (dest, argv[0]); @@ -539,7 +822,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) for (i = 1; i < argc && dest + grub_strlen (argv[i]) + 1 < ((char *) real_mode_mem - + GRUB_LINUX_CL_END_OFFSET); + + GRUB_EFI_CL_END_OFFSET); i++) { *dest++ = ' '; @@ -601,7 +884,7 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) lh = (struct linux_kernel_header *) real_mode_mem; - addr_max = grub_cpu_to_le32 (lh->initrd_addr_max); + addr_max = (grub_cpu_to_le32 (lh->initrd_addr_max) << 10); if (linux_mem_size != 0 && linux_mem_size < addr_max) addr_max = linux_mem_size; @@ -612,7 +895,8 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) addr_max -= 0x10000; /* Usually, the compression ratio is about 50%. */ - addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12); + addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) + + page_align (size); /* Find the highest address to put the initrd. */ mmap_size = find_mmap_size (); @@ -625,8 +909,6 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY - && desc->physical_start >= addr_min - && desc->physical_start + size < addr_max && desc->num_pages >= initrd_pages) { grub_efi_physical_address_t physical_end; @@ -635,6 +917,9 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) if (physical_end > addr_max) physical_end = addr_max; + if (physical_end < addr_min) + continue; + if (physical_end > addr) addr = physical_end - page_align (size); } @@ -657,7 +942,7 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) } grub_printf (" [Initrd, addr=0x%x, size=0x%x]\n", - addr, size); + (unsigned) addr, (unsigned) size); lh->ramdisk_image = addr; lh->ramdisk_size = size; diff --git a/normal/x86_64/setjmp.S b/normal/x86_64/setjmp.S new file mode 100644 index 000000000..4c8d4b3a5 --- /dev/null +++ b/normal/x86_64/setjmp.S @@ -0,0 +1,60 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + + .file "setjmp.S" + + .text + +/* + * jmp_buf: + * rbx rsp rbp r12 r13 r14 r15 rip + * 0 8 16 24 32 40 48 56 + */ + +/* + * int grub_setjmp (grub_jmp_buf env) + */ +FUNCTION(grub_setjmp) + pop %rsi /* Return address, and adjust the stack */ + xorq %rax, %rax + movq %rbx, 0(%rdi) /* RBX */ + movq %rsp, 8(%rdi) /* RSP */ + push %rsi + movq %rbp, 16(%rdi) /* RBP */ + movq %r12, 24(%rdi) /* R12 */ + movq %r13, 32(%rdi) /* R13 */ + movq %r14, 40(%rdi) /* R14 */ + movq %r15, 48(%rdi) /* R15 */ + movq %rsi, 56(%rdi) /* RSI */ + ret + +/* + * int grub_longjmp (grub_jmp_buf env, int val) + */ +FUNCTION(grub_longjmp) + movl %esi, %eax + movq (%rdi), %rbx + movq 8(%rdi), %rsp + movq 16(%rdi), %rbp + movq 24(%rdi), %r12 + movq 32(%rdi), %r13 + movq 40(%rdi), %r14 + movq 48(%rdi), %r15 + jmp *56(%rdi) diff --git a/term/efi/console.c b/term/efi/console.c index af198e56e..f3b62a58b 100644 --- a/term/efi/console.c +++ b/term/efi/console.c @@ -36,6 +36,54 @@ grub_console_highlight_color = GRUB_EFI_TEXT_ATTR (GRUB_EFI_BLACK, static int read_key = -1; +static grub_uint32_t +map_char (grub_uint32_t c) +{ + if (c > 0x7f) + { + /* Map some unicode characters to the EFI character. */ + switch (c) + { + case 0x2190: /* left arrow */ + c = 0x25c4; + break; + case 0x2191: /* up arrow */ + c = 0x25b2; + break; + case 0x2192: /* right arrow */ + c = 0x25ba; + break; + case 0x2193: /* down arrow */ + c = 0x25bc; + break; + case 0x2501: /* horizontal line */ + c = 0x2500; + break; + case 0x2503: /* vertical line */ + c = 0x2502; + break; + case 0x250F: /* upper-left corner */ + c = 0x250c; + break; + case 0x2513: /* upper-right corner */ + c = 0x2510; + break; + case 0x2517: /* lower-left corner */ + c = 0x2514; + break; + case 0x251B: /* lower-right corner */ + c = 0x2518; + break; + + default: + c = '?'; + break; + } + } + + return c; +} + static void grub_console_putchar (grub_uint32_t c) { @@ -48,14 +96,14 @@ grub_console_putchar (grub_uint32_t c) if (c > 0xffff) c = '?'; - str[0] = (grub_efi_char16_t) (c & 0xffff); + str[0] = (grub_efi_char16_t) map_char (c & 0xffff); str[1] = 0; /* Should this test be cached? */ - if (c > 0x7f && o->test_string (o, str) != GRUB_EFI_SUCCESS) + if (c > 0x7f && efi_call_2 (o->test_string, o, str) != GRUB_EFI_SUCCESS) return; - o->output_string (o, str); + efi_call_2 (o->output_string, o, str); } static grub_ssize_t @@ -76,8 +124,8 @@ grub_console_checkkey (void) return 1; i = grub_efi_system_table->con_in; - status = i->read_key_stroke (i, &key); -#if 1 + status = efi_call_2 (i->read_key_stroke, i, &key); +#if 0 switch (status) { case GRUB_EFI_SUCCESS: @@ -137,6 +185,15 @@ grub_console_checkkey (void) break; case 0x0a: break; + case 0x0b: + read_key = 24; + break; + case 0x0c: + read_key = 1; + break; + case 0x0d: + read_key = 5; + break; case 0x17: read_key = '\e'; break; @@ -169,9 +226,9 @@ grub_console_getkey (void) do { - status = b->wait_for_event (1, &(i->wait_for_key), &index); + status = efi_call_3 (b->wait_for_event, 1, &(i->wait_for_key), &index); if (status != GRUB_EFI_SUCCESS) - return -1; + return -1; grub_console_checkkey (); } @@ -189,7 +246,7 @@ grub_console_getwh (void) grub_efi_uintn_t columns, rows; o = grub_efi_system_table->con_out; - if (o->query_mode (o, o->mode->mode, &columns, &rows) != GRUB_EFI_SUCCESS) + if (efi_call_4 (o->query_mode, o, o->mode->mode, &columns, &rows) != GRUB_EFI_SUCCESS) { /* Why does this fail? */ columns = 80; @@ -214,7 +271,7 @@ grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y) grub_efi_simple_text_output_interface_t *o; o = grub_efi_system_table->con_out; - o->set_cursor_position (o, x, y); + efi_call_3 (o->set_cursor_position, o, x, y); } static void @@ -225,9 +282,9 @@ grub_console_cls (void) o = grub_efi_system_table->con_out; orig_attr = o->mode->attribute; - o->set_attributes (o, GRUB_EFI_BACKGROUND_BLACK); - o->clear_screen (o); - o->set_attributes (o, orig_attr); + efi_call_2 (o->set_attributes, o, GRUB_EFI_BACKGROUND_BLACK); + efi_call_1 (o->clear_screen, o); + efi_call_2 (o->set_attributes, o, orig_attr); } static void @@ -239,13 +296,13 @@ grub_console_setcolorstate (grub_term_color_state state) switch (state) { case GRUB_TERM_COLOR_STANDARD: - o->set_attributes (o, grub_console_standard_color); + efi_call_2 (o->set_attributes, o, grub_console_standard_color); break; case GRUB_TERM_COLOR_NORMAL: - o->set_attributes (o, grub_console_normal_color); + efi_call_2 (o->set_attributes, o, grub_console_normal_color); break; case GRUB_TERM_COLOR_HIGHLIGHT: - o->set_attributes (o, grub_console_highlight_color); + efi_call_2 (o->set_attributes, o, grub_console_highlight_color); break; default: break; @@ -272,7 +329,7 @@ grub_console_setcursor (int on) grub_efi_simple_text_output_interface_t *o; o = grub_efi_system_table->con_out; - o->enable_cursor (o, on); + efi_call_2 (o->enable_cursor, o, on); } static struct grub_term grub_console_term = diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index 123aaf093..db2653119 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -31,16 +31,56 @@ #include #include +#if GRUB_TARGET_SIZEOF_VOID_P == 4 + +typedef Elf32_Word Elf_Word; +typedef Elf32_Addr Elf_Addr; +typedef Elf32_Ehdr Elf_Ehdr; +typedef Elf32_Shdr Elf_Shdr; +typedef Elf32_Sym Elf_Sym; +typedef Elf32_Half Elf_Half; +typedef Elf32_Off Elf_Off; +typedef Elf32_Section Elf_Section; +typedef Elf32_Rel Elf_Rel; +typedef Elf32_Rela Elf_Rela; + +#define ELF_R_SYM ELF32_R_SYM +#define ELF_R_TYPE ELF32_R_TYPE +#define ELF_R_INFO ELF32_R_INFO + +#define grub_le_to_cpu grub_le_to_cpu32 + +#elif GRUB_TARGET_SIZEOF_VOID_P == 8 + +typedef Elf64_Word Elf_Word; +typedef Elf64_Addr Elf_Addr; +typedef Elf64_Ehdr Elf_Ehdr; +typedef Elf64_Shdr Elf_Shdr; +typedef Elf64_Sym Elf_Sym; +typedef Elf64_Half Elf_Half; +typedef Elf64_Off Elf_Off; +typedef Elf64_Section Elf_Section; +typedef Elf64_Rel Elf_Rel; +typedef Elf64_Rela Elf_Rela; + +#define ELF_R_SYM ELF64_R_SYM +#define ELF_R_TYPE ELF64_R_TYPE +#define ELF_R_INFO ELF64_R_INFO + +#define grub_le_to_cpu grub_le_to_cpu64 + +#endif + static const grub_uint8_t stub[] = GRUB_PE32_MSDOS_STUB; -static inline Elf32_Addr -align_address (Elf32_Addr addr, unsigned alignment) +static inline Elf_Addr +align_address (Elf_Addr addr, unsigned alignment) { return (addr + alignment - 1) & ~(alignment - 1); } -static inline Elf32_Addr -align_pe32_section (Elf32_Addr addr) +static inline Elf_Addr +align_pe32_section (Elf_Addr addr) { return align_address (addr, GRUB_PE32_SECTION_ALIGNMENT); } @@ -60,14 +100,15 @@ read_kernel_module (const char *dir, char *prefix, size_t *size) if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END) grub_util_error ("prefix too long"); - strcpy (kernel_image + 0x34 + GRUB_KERNEL_MACHINE_PREFIX, prefix); + + strcpy (kernel_image + sizeof (Elf_Ehdr) + GRUB_KERNEL_MACHINE_PREFIX, prefix); return kernel_image; } /* Return if the ELF header is valid. */ static int -check_elf_header (Elf32_Ehdr *e, size_t size) +check_elf_header (Elf_Ehdr *e, size_t size) { if (size < sizeof (*e) || e->e_ident[EI_MAG0] != ELFMAG0 @@ -76,9 +117,11 @@ check_elf_header (Elf32_Ehdr *e, size_t size) || e->e_ident[EI_MAG3] != ELFMAG3 || e->e_ident[EI_VERSION] != EV_CURRENT || e->e_version != grub_cpu_to_le32 (EV_CURRENT) - || e->e_ident[EI_CLASS] != ELFCLASS32 + || ((e->e_ident[EI_CLASS] != ELFCLASS32) && + (e->e_ident[EI_CLASS] != ELFCLASS64)) || e->e_ident[EI_DATA] != ELFDATA2LSB - || e->e_machine != grub_cpu_to_le16 (EM_386)) + || ((e->e_machine != grub_cpu_to_le16 (EM_386)) && + (e->e_machine != grub_cpu_to_le16 (EM_X86_64)))) return 0; return 1; @@ -87,7 +130,7 @@ check_elf_header (Elf32_Ehdr *e, size_t size) /* Return the starting address right after the header, aligned by the section alignment. Allocate 4 section tables for .text, .data, .reloc, and mods. */ -static Elf32_Addr +static Elf_Addr get_starting_section_address (void) { return align_pe32_section (sizeof (struct grub_pe32_header) @@ -97,7 +140,7 @@ get_starting_section_address (void) /* Determine if this section is a text section. Return false if this section is not allocated. */ static int -is_text_section (Elf32_Shdr *s) +is_text_section (Elf_Shdr *s) { return ((s->sh_flags & grub_cpu_to_le32 (SHF_EXECINSTR | SHF_ALLOC)) == grub_cpu_to_le32 (SHF_EXECINSTR | SHF_ALLOC)); @@ -107,7 +150,7 @@ is_text_section (Elf32_Shdr *s) BSS is also a data section, since the converter initializes BSS when producing PE32 to avoid a bug in EFI implementations. */ static int -is_data_section (Elf32_Shdr *s) +is_data_section (Elf_Shdr *s) { return (s->sh_flags & grub_cpu_to_le32 (SHF_ALLOC) && ! (s->sh_flags & grub_cpu_to_le32 (SHF_EXECINSTR))); @@ -116,14 +159,14 @@ is_data_section (Elf32_Shdr *s) /* Locate section addresses by merging code sections and data sections into .text and .data, respectively. Return the array of section addresses. */ -static Elf32_Addr * -locate_sections (Elf32_Shdr *sections, Elf32_Half section_entsize, - Elf32_Half num_sections, const char *strtab) +static Elf_Addr * +locate_sections (Elf_Shdr *sections, Elf_Half section_entsize, + Elf_Half num_sections, const char *strtab) { int i; - Elf32_Addr current_address; - Elf32_Addr *section_addresses; - Elf32_Shdr *s; + Elf_Addr current_address; + Elf_Addr *section_addresses; + Elf_Shdr *s; section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); @@ -133,10 +176,10 @@ locate_sections (Elf32_Shdr *sections, Elf32_Half section_entsize, /* .text */ for (i = 0, s = sections; i < num_sections; - i++, s = (Elf32_Shdr *) ((char *) s + section_entsize)) + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (is_text_section (s)) { - Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign); + Elf_Word align = grub_le_to_cpu32 (s->sh_addralign); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); if (align) @@ -153,10 +196,10 @@ locate_sections (Elf32_Shdr *sections, Elf32_Half section_entsize, /* .data */ for (i = 0, s = sections; i < num_sections; - i++, s = (Elf32_Shdr *) ((char *) s + section_entsize)) + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (is_data_section (s)) { - Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign); + Elf_Word align = grub_le_to_cpu32 (s->sh_addralign); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); if (align) @@ -172,16 +215,16 @@ locate_sections (Elf32_Shdr *sections, Elf32_Half section_entsize, } /* Return the symbol table section, if any. */ -static Elf32_Shdr * -find_symtab_section (Elf32_Shdr *sections, - Elf32_Half section_entsize, Elf32_Half num_sections) +static Elf_Shdr * +find_symtab_section (Elf_Shdr *sections, + Elf_Half section_entsize, Elf_Half num_sections) { int i; - Elf32_Shdr *s; + Elf_Shdr *s; for (i = 0, s = sections; i < num_sections; - i++, s = (Elf32_Shdr *) ((char *) s + section_entsize)) + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (s->sh_type == grub_cpu_to_le32 (SHT_SYMTAB)) return s; @@ -190,12 +233,12 @@ find_symtab_section (Elf32_Shdr *sections, /* Return the address of the string table. */ static const char * -find_strtab (Elf32_Ehdr *e, Elf32_Shdr *sections, Elf32_Half section_entsize) +find_strtab (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Half section_entsize) { - Elf32_Shdr *s; + Elf_Shdr *s; char *strtab; - s = (Elf32_Shdr *) ((char *) sections + s = (Elf_Shdr *) ((char *) sections + grub_le_to_cpu16 (e->e_shstrndx) * section_entsize); strtab = (char *) e + grub_le_to_cpu32 (s->sh_offset); return strtab; @@ -203,21 +246,21 @@ find_strtab (Elf32_Ehdr *e, Elf32_Shdr *sections, Elf32_Half section_entsize) /* Relocate symbols; note that this function overwrites the symbol table. Return the address of a start symbol. */ -static Elf32_Addr -relocate_symbols (Elf32_Ehdr *e, Elf32_Shdr *sections, - Elf32_Shdr *symtab_section, Elf32_Addr *section_addresses, - Elf32_Half section_entsize, Elf32_Half num_sections) +static Elf_Addr +relocate_symbols (Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Shdr *symtab_section, Elf_Addr *section_addresses, + Elf_Half section_entsize, Elf_Half num_sections) { - Elf32_Word symtab_size, sym_size, num_syms; - Elf32_Off symtab_offset; - Elf32_Addr start_address = 0; - Elf32_Sym *sym; - Elf32_Word i; - Elf32_Shdr *strtab_section; + Elf_Word symtab_size, sym_size, num_syms; + Elf_Off symtab_offset; + Elf_Addr start_address = 0; + Elf_Sym *sym; + Elf_Word i; + Elf_Shdr *strtab_section; const char *strtab; strtab_section - = (Elf32_Shdr *) ((char *) sections + = (Elf_Shdr *) ((char *) sections + (grub_le_to_cpu32 (symtab_section->sh_link) * section_entsize)); strtab = (char *) e + grub_le_to_cpu32 (strtab_section->sh_offset); @@ -227,17 +270,21 @@ relocate_symbols (Elf32_Ehdr *e, Elf32_Shdr *sections, symtab_offset = grub_le_to_cpu32 (symtab_section->sh_offset); num_syms = symtab_size / sym_size; - for (i = 0, sym = (Elf32_Sym *) ((char *) e + symtab_offset); + for (i = 0, sym = (Elf_Sym *) ((char *) e + symtab_offset); i < num_syms; - i++, sym = (Elf32_Sym *) ((char *) sym + sym_size)) + i++, sym = (Elf_Sym *) ((char *) sym + sym_size)) { - Elf32_Section index; + Elf_Section index; const char *name; name = strtab + grub_le_to_cpu32 (sym->st_name); index = grub_le_to_cpu16 (sym->st_shndx); - if (index == STN_UNDEF) + if (index == STN_ABS) + { + continue; + } + else if ((index == STN_UNDEF)) { if (sym->st_name) grub_util_error ("undefined symbol %s", name); @@ -260,22 +307,22 @@ relocate_symbols (Elf32_Ehdr *e, Elf32_Shdr *sections, } /* Return the address of a symbol at the index I in the section S. */ -static Elf32_Addr -get_symbol_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Word i) +static Elf_Addr +get_symbol_address (Elf_Ehdr *e, Elf_Shdr *s, Elf_Word i) { - Elf32_Sym *sym; + Elf_Sym *sym; - sym = (Elf32_Sym *) ((char *) e + sym = (Elf_Sym *) ((char *) e + grub_le_to_cpu32 (s->sh_offset) + i * grub_le_to_cpu32 (s->sh_entsize)); return sym->st_value; } /* Return the address of a modified value. */ -static Elf32_Addr * -get_target_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Addr offset) +static Elf_Addr * +get_target_address (Elf_Ehdr *e, Elf_Shdr *s, Elf_Addr offset) { - return (Elf32_Addr *) ((char *) e + grub_le_to_cpu32 (s->sh_offset) + offset); + return (Elf_Addr *) ((char *) e + grub_le_to_cpu32 (s->sh_offset) + offset); } /* Deal with relocation information. This function relocates addresses @@ -283,34 +330,35 @@ get_target_address (Elf32_Ehdr *e, Elf32_Shdr *s, Elf32_Addr offset) addresses can be fully resolved. Absolute addresses must be relocated again by a PE32 relocator when loaded. */ static void -relocate_addresses (Elf32_Ehdr *e, Elf32_Shdr *sections, - Elf32_Addr *section_addresses, - Elf32_Half section_entsize, Elf32_Half num_sections, +relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Addr *section_addresses, + Elf_Half section_entsize, Elf_Half num_sections, const char *strtab) { - Elf32_Half i; - Elf32_Shdr *s; + Elf_Half i; + Elf_Shdr *s; for (i = 0, s = sections; i < num_sections; - i++, s = (Elf32_Shdr *) ((char *) s + section_entsize)) - if (s->sh_type == grub_cpu_to_le32 (SHT_REL)) + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if ((s->sh_type == grub_cpu_to_le32 (SHT_REL)) || + (s->sh_type == grub_cpu_to_le32 (SHT_RELA))) { - Elf32_Rel *r; - Elf32_Word rtab_size, r_size, num_rs; - Elf32_Off rtab_offset; - Elf32_Shdr *symtab_section; - Elf32_Word target_section_index; - Elf32_Addr target_section_addr; - Elf32_Shdr *target_section; - Elf32_Word j; + Elf_Rela *r; + Elf_Word rtab_size, r_size, num_rs; + Elf_Off rtab_offset; + Elf_Shdr *symtab_section; + Elf_Word target_section_index; + Elf_Addr target_section_addr; + Elf_Shdr *target_section; + Elf_Word j; - symtab_section = (Elf32_Shdr *) ((char *) sections + symtab_section = (Elf_Shdr *) ((char *) sections + (grub_le_to_cpu32 (s->sh_link) * section_entsize)); target_section_index = grub_le_to_cpu32 (s->sh_info); target_section_addr = section_addresses[target_section_index]; - target_section = (Elf32_Shdr *) ((char *) sections + target_section = (Elf_Shdr *) ((char *) sections + (target_section_index * section_entsize)); @@ -323,46 +371,84 @@ relocate_addresses (Elf32_Ehdr *e, Elf32_Shdr *sections, rtab_offset = grub_le_to_cpu32 (s->sh_offset); num_rs = rtab_size / r_size; - for (j = 0, r = (Elf32_Rel *) ((char *) e + rtab_offset); + for (j = 0, r = (Elf_Rela *) ((char *) e + rtab_offset); j < num_rs; - j++, r = (Elf32_Rel *) ((char *) r + r_size)) + j++, r = (Elf_Rela *) ((char *) r + r_size)) { - Elf32_Word info; - Elf32_Addr offset; - Elf32_Addr sym_addr; - Elf32_Addr *target; + Elf_Addr info; + Elf_Addr offset; + Elf_Addr sym_addr; + Elf_Addr *target, *value; - offset = grub_le_to_cpu32 (r->r_offset); + offset = grub_le_to_cpu (r->r_offset); target = get_target_address (e, target_section, offset); - info = grub_le_to_cpu32 (r->r_info); + info = grub_le_to_cpu (r->r_info); sym_addr = get_symbol_address (e, symtab_section, - ELF32_R_SYM (info)); + ELF_R_SYM (info)); - switch (ELF32_R_TYPE (info)) + value = (s->sh_type == grub_cpu_to_le32 (SHT_RELA)) ? + (Elf_Addr *) &r->r_addend : target; + + switch (ELF_R_TYPE (info)) { +#if GRUB_TARGET_SIZEOF_VOID_P == 4 case R_386_NONE: break; case R_386_32: /* This is absolute. */ - *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*target) - + sym_addr); + *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*value) + + sym_addr); grub_util_info ("relocating an R_386_32 entry to 0x%x at the offset 0x%x", *target, offset); break; case R_386_PC32: /* This is relative. */ - *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*target) + *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*value) + sym_addr - target_section_addr - offset); grub_util_info ("relocating an R_386_PC32 entry to 0x%x at the offset 0x%x", *target, offset); break; +#else + + case R_X86_64_NONE: + break; + + case R_X86_64_64: + *target = grub_cpu_to_le64 (grub_le_to_cpu64 (*value) + sym_addr); + grub_util_info ("relocating an R_X86_64_64 entry to 0x%llx at the offset 0x%llx", + *target, offset); + break; + + case R_X86_64_PC32: + { + grub_uint32_t *t32 = (grub_uint32_t *) target; + *t32 = grub_cpu_to_le64 (grub_le_to_cpu64 (*value) + + sym_addr + - target_section_addr - offset); + grub_util_info ("relocating an R_X86_64_PC32 entry to 0x%x at the offset 0x%llx", + *t32, offset); + break; + } + + case R_X86_64_32: + case R_X86_64_32S: + { + grub_uint32_t *t32 = (grub_uint32_t *) target; + *t32 = grub_cpu_to_le64 (grub_le_to_cpu64 (*value) + + sym_addr); + grub_util_info ("relocating an R_X86_64_32(S) entry to 0x%x at the offset 0x%llx", + *t32, offset); + break; + } + +#endif default: grub_util_error ("unknown relocation type %d", - ELF32_R_TYPE (info)); + ELF_R_TYPE (info)); break; } } @@ -381,9 +467,9 @@ write_padding (FILE *out, size_t size) /* Add a PE32's fixup entry for a relocation. Return the resulting address after having written to the file OUT. */ -Elf32_Addr +Elf_Addr add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type, - Elf32_Addr addr, int flush, Elf32_Addr current_address, + Elf_Addr addr, int flush, Elf_Addr current_address, FILE *out) { struct grub_pe32_fixup_block *b = *block; @@ -399,7 +485,7 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type, { /* Add as much padding as necessary to align the address with a section boundary. */ - Elf32_Addr next_address; + Elf_Addr next_address; unsigned padding_size; size_t index; @@ -472,10 +558,10 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type, } /* Write out zeros to make space for the header. */ -static Elf32_Addr +static Elf_Addr make_header_space (FILE *out) { - Elf32_Addr addr; + Elf_Addr addr; addr = get_starting_section_address (); write_padding (out, addr); @@ -484,24 +570,24 @@ make_header_space (FILE *out) } /* Write text sections. */ -static Elf32_Addr -write_text_sections (FILE *out, Elf32_Addr current_address, - Elf32_Ehdr *e, Elf32_Shdr *sections, - Elf32_Half section_entsize, Elf32_Half num_sections, +static Elf_Addr +write_text_sections (FILE *out, Elf_Addr current_address, + Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Half section_entsize, Elf_Half num_sections, const char *strtab) { - Elf32_Half i; - Elf32_Shdr *s; - Elf32_Addr addr; + Elf_Half i; + Elf_Shdr *s; + Elf_Addr addr; for (i = 0, s = sections; i < num_sections; - i++, s = (Elf32_Shdr *) ((char *) s + section_entsize)) + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (is_text_section (s)) { - Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign); - Elf32_Off offset = grub_le_to_cpu32 (s->sh_offset); - Elf32_Word size = grub_le_to_cpu32 (s->sh_size); + Elf_Word align = grub_le_to_cpu32 (s->sh_addralign); + Elf_Off offset = grub_le_to_cpu32 (s->sh_offset); + Elf_Word size = grub_le_to_cpu32 (s->sh_size); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); if (align) @@ -537,24 +623,24 @@ write_text_sections (FILE *out, Elf32_Addr current_address, } /* Write data sections. */ -static Elf32_Addr -write_data_sections (FILE *out, Elf32_Addr current_address, - Elf32_Ehdr *e, Elf32_Shdr *sections, - Elf32_Half section_entsize, Elf32_Half num_sections, +static Elf_Addr +write_data_sections (FILE *out, Elf_Addr current_address, + Elf_Ehdr *e, Elf_Shdr *sections, + Elf_Half section_entsize, Elf_Half num_sections, const char *strtab) { - Elf32_Half i; - Elf32_Shdr *s; - Elf32_Addr addr; + Elf_Half i; + Elf_Shdr *s; + Elf_Addr addr; for (i = 0, s = sections; i < num_sections; - i++, s = (Elf32_Shdr *) ((char *) s + section_entsize)) + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) if (is_data_section (s)) { - Elf32_Word align = grub_le_to_cpu32 (s->sh_addralign); - Elf32_Off offset = grub_le_to_cpu32 (s->sh_offset); - Elf32_Word size = grub_le_to_cpu32 (s->sh_size); + Elf_Word align = grub_le_to_cpu32 (s->sh_addralign); + Elf_Off offset = grub_le_to_cpu32 (s->sh_offset); + Elf_Word size = grub_le_to_cpu32 (s->sh_size); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); if (align) @@ -593,15 +679,15 @@ write_data_sections (FILE *out, Elf32_Addr current_address, } /* Write modules. */ -static Elf32_Addr -make_mods_section (FILE *out, Elf32_Addr current_address, +static Elf_Addr +make_mods_section (FILE *out, Elf_Addr current_address, const char *dir, char *mods[]) { struct grub_util_path_list *path_list; grub_size_t total_module_size; struct grub_util_path_list *p; struct grub_module_info modinfo; - Elf32_Addr addr; + Elf_Addr addr; path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); @@ -665,26 +751,27 @@ make_mods_section (FILE *out, Elf32_Addr current_address, } /* Make a .reloc section. */ -static Elf32_Addr -make_reloc_section (FILE *out, Elf32_Addr current_address, Elf32_Ehdr *e, - Elf32_Addr *section_addresses, Elf32_Shdr *sections, - Elf32_Half section_entsize, Elf32_Half num_sections, +static Elf_Addr +make_reloc_section (FILE *out, Elf_Addr current_address, Elf_Ehdr *e, + Elf_Addr *section_addresses, Elf_Shdr *sections, + Elf_Half section_entsize, Elf_Half num_sections, const char *strtab) { - Elf32_Half i; - Elf32_Shdr *s; + Elf_Half i; + Elf_Shdr *s; struct grub_pe32_fixup_block *fixup_block = 0; for (i = 0, s = sections; i < num_sections; - i++, s = (Elf32_Shdr *) ((char *) s + section_entsize)) - if (s->sh_type == grub_cpu_to_le32 (SHT_REL)) + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if ((s->sh_type == grub_cpu_to_le32 (SHT_REL)) || + (s->sh_type == grub_cpu_to_le32 (SHT_RELA))) { - Elf32_Rel *r; - Elf32_Word rtab_size, r_size, num_rs; - Elf32_Off rtab_offset; - Elf32_Addr section_address; - Elf32_Word j; + Elf_Rel *r; + Elf_Word rtab_size, r_size, num_rs; + Elf_Off rtab_offset; + Elf_Addr section_address; + Elf_Word j; grub_util_info ("translating the relocation section %s", strtab + grub_le_to_cpu32 (s->sh_name)); @@ -696,20 +783,21 @@ make_reloc_section (FILE *out, Elf32_Addr current_address, Elf32_Ehdr *e, section_address = section_addresses[grub_le_to_cpu32 (s->sh_info)]; - for (j = 0, r = (Elf32_Rel *) ((char *) e + rtab_offset); + for (j = 0, r = (Elf_Rel *) ((char *) e + rtab_offset); j < num_rs; - j++, r = (Elf32_Rel *) ((char *) r + r_size)) + j++, r = (Elf_Rel *) ((char *) r + r_size)) { - Elf32_Word info; - Elf32_Addr offset; + Elf_Addr info; + Elf_Addr offset; offset = grub_le_to_cpu32 (r->r_offset); info = grub_le_to_cpu32 (r->r_info); /* Necessary to relocate only absolute addresses. */ - if (ELF32_R_TYPE (info) == R_386_32) +#if GRUB_TARGET_SIZEOF_VOID_P == 4 + if (ELF_R_TYPE (info) == R_386_32) { - Elf32_Addr addr; + Elf_Addr addr; addr = section_address + offset; grub_util_info ("adding a relocation entry for 0x%x", addr); @@ -718,6 +806,21 @@ make_reloc_section (FILE *out, Elf32_Addr current_address, Elf32_Ehdr *e, addr, 0, current_address, out); } +#else + if ((ELF_R_TYPE (info) == R_X86_64_64) || + (ELF_R_TYPE (info) == R_X86_64_32) || + (ELF_R_TYPE (info) == R_X86_64_32S)) + { + Elf_Addr addr; + + addr = section_address + offset; + grub_util_info ("adding a relocation entry for 0x%llx", addr); + current_address = add_fixup_entry (&fixup_block, + GRUB_PE32_REL_BASED_HIGHLOW, + addr, 0, current_address, + out); + } +#endif } } @@ -729,9 +832,9 @@ make_reloc_section (FILE *out, Elf32_Addr current_address, Elf32_Ehdr *e, /* Create the header. */ static void -make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address, - Elf32_Addr mods_address, Elf32_Addr reloc_address, - Elf32_Addr end_address, Elf32_Addr start_address) +make_header (FILE *out, Elf_Addr text_address, Elf_Addr data_address, + Elf_Addr mods_address, Elf_Addr reloc_address, + Elf_Addr end_address, Elf_Addr start_address) { struct grub_pe32_header header; struct grub_pe32_coff_header *c; @@ -746,14 +849,22 @@ make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address, /* The COFF file header. */ c = &header.coff_header; +#if GRUB_TARGET_SIZEOF_VOID_P == 4 c->machine = grub_cpu_to_le16 (GRUB_PE32_MACHINE_I386); +#else + c->machine = grub_cpu_to_le16 (GRUB_PE32_MACHINE_X86_64); +#endif + c->num_sections = grub_cpu_to_le16 (4); c->time = grub_cpu_to_le32 (time (0)); c->optional_header_size = grub_cpu_to_le16 (sizeof (header.optional_header)); c->characteristics = grub_cpu_to_le16 (GRUB_PE32_EXECUTABLE_IMAGE | GRUB_PE32_LINE_NUMS_STRIPPED +#if GRUB_TARGET_SIZEOF_VOID_P == 4 + | GRUB_PE32_32BIT_MACHINE +#endif | GRUB_PE32_LOCAL_SYMS_STRIPPED - | GRUB_PE32_32BIT_MACHINE); + | GRUB_PE32_DEBUG_STRIPPED); /* The PE Optional header. */ o = &header.optional_header; @@ -763,7 +874,9 @@ make_header (FILE *out, Elf32_Addr text_address, Elf32_Addr data_address, o->bss_size = 0; o->entry_addr = grub_cpu_to_le32 (start_address); o->code_base = grub_cpu_to_le32 (text_address); +#if GRUB_TARGET_SIZEOF_VOID_P == 4 o->data_base = grub_cpu_to_le32 (data_address); +#endif o->image_base = 0; o->section_alignment = grub_cpu_to_le32 (GRUB_PE32_SECTION_ALIGNMENT); o->file_alignment = grub_cpu_to_le32 (GRUB_PE32_FILE_ALIGNMENT); @@ -846,30 +959,31 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[]) char *kernel_image; size_t kernel_size; const char *strtab; - Elf32_Ehdr *e; - Elf32_Shdr *sections; - Elf32_Off section_offset; - Elf32_Half section_entsize; - Elf32_Half num_sections; - Elf32_Addr *section_addresses; - Elf32_Shdr *symtab_section; - Elf32_Addr start_address; - Elf32_Addr text_address, data_address, reloc_address, mods_address; - Elf32_Addr end_address; + Elf_Ehdr *e; + Elf_Shdr *sections; + Elf_Off section_offset; + Elf_Half section_entsize; + Elf_Half num_sections; + Elf_Addr *section_addresses; + Elf_Shdr *symtab_section; + Elf_Addr start_address; + Elf_Addr text_address, data_address, reloc_address, mods_address; + Elf_Addr end_address; /* Get the kernel image and check the format. */ kernel_image = read_kernel_module (dir, prefix, &kernel_size); - e = (Elf32_Ehdr *) kernel_image; + e = (Elf_Ehdr *) kernel_image; if (! check_elf_header (e, kernel_size)) grub_util_error ("invalid ELF header"); section_offset = grub_cpu_to_le32 (e->e_shoff); section_entsize = grub_cpu_to_le16 (e->e_shentsize); num_sections = grub_cpu_to_le16 (e->e_shnum); + if (kernel_size < section_offset + section_entsize * num_sections) grub_util_error ("invalid ELF format"); - sections = (Elf32_Shdr *) (kernel_image + section_offset); + sections = (Elf_Shdr *) (kernel_image + section_offset); strtab = find_strtab (e, sections, section_entsize); /* Relocate sections then symbols in the virtual address space. */ From 546f966aa570d80d36d79b43636fad0c37eadd8e Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 17 Jul 2008 15:05:12 +0000 Subject: [PATCH 0259/1707] 2008-07-17 Robert Millan Partial LinuxBIOS -> Coreboot rename. * conf/i386-linuxbios.rmk: Renamed to ... * conf/i386-coreboot.rmk: ... this. * Makefile.in (RMKFILES): s/i386-linuxbios.rmk/i386-coreboot.rmk/g. * configure.ac: Accept coreboot as input platform (but maintain compatibility with linuxbios). * include/grub/i386/linuxbios: Renamed to ... * include/grub/i386/coreboot: ... this. --- ChangeLog | 12 ++++ DISTLIST | 20 +++--- Makefile.in | 2 +- conf/{i386-linuxbios.mk => i386-coreboot.mk} | 0 .../{i386-linuxbios.rmk => i386-coreboot.rmk} | 0 configure | 6 +- configure.ac | 6 +- include/grub/i386/linuxbios/boot.h | 1 - include/grub/i386/linuxbios/console.h | 25 ------- include/grub/i386/linuxbios/init.h | 28 -------- include/grub/i386/linuxbios/kernel.h | 29 -------- include/grub/i386/linuxbios/loader.h | 1 - include/grub/i386/linuxbios/machine.h | 24 ------- include/grub/i386/linuxbios/memory.h | 68 ------------------- include/grub/i386/linuxbios/serial.h | 1 - include/grub/i386/linuxbios/time.h | 1 - 16 files changed, 33 insertions(+), 191 deletions(-) rename conf/{i386-linuxbios.mk => i386-coreboot.mk} (100%) rename conf/{i386-linuxbios.rmk => i386-coreboot.rmk} (100%) delete mode 100644 include/grub/i386/linuxbios/boot.h delete mode 100644 include/grub/i386/linuxbios/console.h delete mode 100644 include/grub/i386/linuxbios/init.h delete mode 100644 include/grub/i386/linuxbios/kernel.h delete mode 100644 include/grub/i386/linuxbios/loader.h delete mode 100644 include/grub/i386/linuxbios/machine.h delete mode 100644 include/grub/i386/linuxbios/memory.h delete mode 100644 include/grub/i386/linuxbios/serial.h delete mode 100644 include/grub/i386/linuxbios/time.h diff --git a/ChangeLog b/ChangeLog index a7adb66b4..e21504b9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-07-17 Robert Millan + + Partial LinuxBIOS -> Coreboot rename. + + * conf/i386-linuxbios.rmk: Renamed to ... + * conf/i386-coreboot.rmk: ... this. + * Makefile.in (RMKFILES): s/i386-linuxbios.rmk/i386-coreboot.rmk/g. + * configure.ac: Accept "coreboot" as input platform (but maintain + compatibility with "linuxbios"). + * include/grub/i386/linuxbios: Renamed to ... + * include/grub/i386/coreboot: ... this. + 2008-07-17 Bean * conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod. diff --git a/DISTLIST b/DISTLIST index d5eb64540..6a7fffcce 100644 --- a/DISTLIST +++ b/DISTLIST @@ -35,10 +35,10 @@ commands/test.c commands/videotest.c conf/common.mk conf/common.rmk +conf/i386-coreboot.mk +conf/i386-coreboot.rmk conf/i386-efi.mk conf/i386-efi.rmk -conf/i386-linuxbios.mk -conf/i386-linuxbios.rmk conf/i386-pc.mk conf/i386-pc.rmk config.guess @@ -124,6 +124,14 @@ include/grub/gpt_partition.h include/grub/gzio.h include/grub/hexdump.h include/grub/hfs.h +include/grub/i386/coreboot/boot.h +include/grub/i386/coreboot/console.h +include/grub/i386/coreboot/init.h +include/grub/i386/coreboot/kernel.h +include/grub/i386/coreboot/loader.h +include/grub/i386/coreboot/memory.h +include/grub/i386/coreboot/serial.h +include/grub/i386/coreboot/time.h include/grub/i386/efi/kernel.h include/grub/i386/efi/loader.h include/grub/i386/efi/time.h @@ -132,14 +140,6 @@ include/grub/i386/ieee1275/machine.h include/grub/i386/ieee1275/memory.h include/grub/i386/ieee1275/serial.h include/grub/i386/io.h -include/grub/i386/linuxbios/boot.h -include/grub/i386/linuxbios/console.h -include/grub/i386/linuxbios/init.h -include/grub/i386/linuxbios/kernel.h -include/grub/i386/linuxbios/loader.h -include/grub/i386/linuxbios/memory.h -include/grub/i386/linuxbios/serial.h -include/grub/i386/linuxbios/time.h include/grub/i386/linux.h include/grub/i386/loader.h include/grub/i386/pc/biosdisk.h diff --git a/Makefile.in b/Makefile.in index 768ebe01d..6f9474c9c 100644 --- a/Makefile.in +++ b/Makefile.in @@ -93,7 +93,7 @@ enable_lzo = @enable_lzo@ ### General variables. RMKFILES = $(addprefix conf/,common.rmk i386-pc.rmk powerpc-ieee1275.rmk \ - sparc64-ieee1275.rmk i386-efi.rmk i386-ieee1275.rmk i386-linuxbios.rmk) + sparc64-ieee1275.rmk i386-efi.rmk i386-ieee1275.rmk i386-coreboot.rmk) MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ diff --git a/conf/i386-linuxbios.mk b/conf/i386-coreboot.mk similarity index 100% rename from conf/i386-linuxbios.mk rename to conf/i386-coreboot.mk diff --git a/conf/i386-linuxbios.rmk b/conf/i386-coreboot.rmk similarity index 100% rename from conf/i386-linuxbios.rmk rename to conf/i386-coreboot.rmk diff --git a/configure b/configure index 417d899ce..0338d0d1e 100644 --- a/configure +++ b/configure @@ -1955,6 +1955,10 @@ else platform="$with_platform" fi +case "$platform" in + linuxbios) platform=coreboot ;; +esac + if test "x$platform" = "xefi" ; then case "$target_cpu" in i386) ;; @@ -1981,7 +1985,7 @@ case "$target_cpu"-"$platform" in i386-efi) ;; x86_64-efi) ;; i386-pc) ;; - i386-linuxbios) ;; + i386-coreboot) ;; i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; diff --git a/configure.ac b/configure.ac index 943b9fee4..031974d87 100644 --- a/configure.ac +++ b/configure.ac @@ -69,6 +69,10 @@ else platform="$with_platform" fi +case "$platform" in + linuxbios) platform=coreboot ;; +esac + if test "x$platform" = "xefi" ; then case "$target_cpu" in i386) ;; @@ -91,7 +95,7 @@ case "$target_cpu"-"$platform" in i386-efi) ;; x86_64-efi) ;; i386-pc) ;; - i386-linuxbios) ;; + i386-coreboot) ;; i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; diff --git a/include/grub/i386/linuxbios/boot.h b/include/grub/i386/linuxbios/boot.h deleted file mode 100644 index 6cd23aa83..000000000 --- a/include/grub/i386/linuxbios/boot.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/grub/i386/linuxbios/console.h b/include/grub/i386/linuxbios/console.h deleted file mode 100644 index f4f481077..000000000 --- a/include/grub/i386/linuxbios/console.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef _GRUB_CONSOLE_MACHINE_LB_HEADER -#define _GRUB_CONSOLE_MACHINE_LB_HEADER 1 -#include - -void grub_keyboard_controller_init (void); - -#endif /* ! _GRUB_CONSOLE_MACHINE_LB_HEADER */ diff --git a/include/grub/i386/linuxbios/init.h b/include/grub/i386/linuxbios/init.h deleted file mode 100644 index e67007414..000000000 --- a/include/grub/i386/linuxbios/init.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_INIT_I386_LINUXBIOS_HEADER -#define GRUB_INIT_I386_LINUXBIOS_HEADER 1 - -#include -#include - -void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn)); -void EXPORT_FUNC(grub_stop_floppy) (void); - -#endif diff --git a/include/grub/i386/linuxbios/kernel.h b/include/grub/i386/linuxbios/kernel.h deleted file mode 100644 index 480d8727d..000000000 --- a/include/grub/i386/linuxbios/kernel.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_KERNEL_MACHINE_HEADER -#define GRUB_KERNEL_MACHINE_HEADER 1 - -#include - -#define GRUB_MOD_ALIGN 0x1000 - -/* Non-zero value is only needed for some IEEE-1275 platforms. */ -#define GRUB_MOD_GAP 0 - -#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/include/grub/i386/linuxbios/loader.h b/include/grub/i386/linuxbios/loader.h deleted file mode 100644 index d3f36bba5..000000000 --- a/include/grub/i386/linuxbios/loader.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/grub/i386/linuxbios/machine.h b/include/grub/i386/linuxbios/machine.h deleted file mode 100644 index 3f278ede5..000000000 --- a/include/grub/i386/linuxbios/machine.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_MACHINE_MACHINE_HEADER -#define GRUB_MACHINE_MACHINE_HEADER 1 - -#define GRUB_MACHINE_LINUXBIOS 1 - -#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/i386/linuxbios/memory.h b/include/grub/i386/linuxbios/memory.h deleted file mode 100644 index 3534adf58..000000000 --- a/include/grub/i386/linuxbios/memory.h +++ /dev/null @@ -1,68 +0,0 @@ -/* memory.h - describe the memory map */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef _GRUB_MEMORY_MACHINE_LB_HEADER -#define _GRUB_MEMORY_MACHINE_LB_HEADER 1 - -#include -#include - -#ifndef ASM_FILE -#include -#include -#endif - -#define GRUB_MEMORY_MACHINE_LOWER_USABLE 0x9fc00 /* 640 kiB - 1 kiB */ -#define GRUB_MEMORY_MACHINE_LOWER_SIZE 0xf0000 /* 960 kiB */ - -#define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ - -#ifndef ASM_FILE - -struct grub_linuxbios_table_header -{ - char signature[4]; - grub_uint32_t size; -}; -typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t; - -struct grub_linuxbios_table_item -{ -#define GRUB_LINUXBIOS_MEMBER_UNUSED 0 -#define GRUB_LINUXBIOS_MEMBER_MEMORY 1 - grub_uint32_t tag; - grub_uint32_t size; -}; -typedef struct grub_linuxbios_table_item *grub_linuxbios_table_item_t; - -struct grub_linuxbios_mem_region -{ - grub_uint64_t addr; - grub_uint64_t size; -#define GRUB_LINUXBIOS_MEMORY_AVAILABLE 1 - grub_uint32_t type; -}; -typedef struct grub_linuxbios_mem_region *mem_region_t; - -grub_err_t EXPORT_FUNC(grub_available_iterate) - (int (*hook) (mem_region_t)); - -#endif - -#endif /* ! _GRUB_MEMORY_MACHINE_HEADER */ diff --git a/include/grub/i386/linuxbios/serial.h b/include/grub/i386/linuxbios/serial.h deleted file mode 100644 index 2c527f626..000000000 --- a/include/grub/i386/linuxbios/serial.h +++ /dev/null @@ -1 +0,0 @@ -#include diff --git a/include/grub/i386/linuxbios/time.h b/include/grub/i386/linuxbios/time.h deleted file mode 100644 index 2298ee8f4..000000000 --- a/include/grub/i386/linuxbios/time.h +++ /dev/null @@ -1 +0,0 @@ -#include From 737feb3579593d79a3e5f5b15d549a23833845e4 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 17 Jul 2008 15:31:16 +0000 Subject: [PATCH 0260/1707] 2008-07-17 Pavel Roskin * configure.ac: Default to pc platform for x86_64. --- ChangeLog | 4 ++++ configure | 1 + configure.ac | 1 + 3 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index e21504b9e..e8243693f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-07-17 Pavel Roskin + + * configure.ac: Default to pc platform for x86_64. + 2008-07-17 Robert Millan Partial LinuxBIOS -> Coreboot rename. diff --git a/configure b/configure index 0338d0d1e..dfa2b1d16 100644 --- a/configure +++ b/configure @@ -1945,6 +1945,7 @@ if test "x$with_platform" = x; then case "$target_cpu"-"$target_vendor" in i386-apple) platform=efi ;; i386-*) platform=pc ;; + x86_64-*) platform=pc ;; powerpc-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; *) { { echo "$as_me:$LINENO: error: unsupported machine type" >&5 diff --git a/configure.ac b/configure.ac index 031974d87..7d1782bbb 100644 --- a/configure.ac +++ b/configure.ac @@ -61,6 +61,7 @@ if test "x$with_platform" = x; then case "$target_cpu"-"$target_vendor" in i386-apple) platform=efi ;; i386-*) platform=pc ;; + x86_64-*) platform=pc ;; powerpc-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; *) AC_MSG_ERROR([unsupported machine type]) ;; From 58393a2d35e8f5f10d190bd3228774f87e250393 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 17 Jul 2008 18:13:57 +0000 Subject: [PATCH 0261/1707] 2008-07-17 Pavel Roskin * configure.ac: Default to efi platform for x86_64-apple. Allow powerpc64 CPU, default to ieee1275 platform for it. Split CPU adjustments from the rest, only do them if target is not explicitly given. Merge other adjustments with the final sanity check. Remove an extraneous check for supported CPU. Be specific which CPU and which platform is not supported. --- ChangeLog | 7 +++++++ configure | 43 +++++++++++++++---------------------------- configure.ac | 35 +++++++++++++---------------------- 3 files changed, 35 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8243693f..cef28b90b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2008-07-17 Pavel Roskin + * configure.ac: Default to efi platform for x86_64-apple. Allow + powerpc64 CPU, default to ieee1275 platform for it. Split CPU + adjustments from the rest, only do them if target is not + explicitly given. Merge other adjustments with the final sanity + check. Remove an extraneous check for supported CPU. Be + specific which CPU and which platform is not supported. + * configure.ac: Default to pc platform for x86_64. 2008-07-17 Robert Millan diff --git a/configure b/configure index dfa2b1d16..cc92328ac 100644 --- a/configure +++ b/configure @@ -1945,53 +1945,40 @@ if test "x$with_platform" = x; then case "$target_cpu"-"$target_vendor" in i386-apple) platform=efi ;; i386-*) platform=pc ;; + x86_64-apple) platform=efi ;; x86_64-*) platform=pc ;; powerpc-*) platform=ieee1275 ;; + powerpc64-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; - *) { { echo "$as_me:$LINENO: error: unsupported machine type" >&5 -echo "$as_me: error: unsupported machine type" >&2;} + *) { { echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 +echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac else platform="$with_platform" fi -case "$platform" in - linuxbios) platform=coreboot ;; -esac - -if test "x$platform" = "xefi" ; then - case "$target_cpu" in - i386) ;; - x86_64) target_m64=1 ;; - *) { { echo "$as_me:$LINENO: error: unsupported CPU type for EFI" >&5 -echo "$as_me: error: unsupported CPU type for EFI" >&2;} - { (exit 1); exit 1; }; } ;; - esac -else - case "$target_cpu" in - i386) ;; - x86_64) target_cpu=i386 target_m32=1 ;; - powerpc) ;; - powerpc64) target_cpu=powerpc target_m32=1;; - sparc64) ;; - *) { { echo "$as_me:$LINENO: error: unsupported CPU type" >&5 -echo "$as_me: error: unsupported CPU type" >&2;} - { (exit 1); exit 1; }; } ;; +# Adjust CPU unless target was explicitly specified. +if test -z "$target_alias"; then + case "$target_cpu"-"$platform" in + x86_64-efi) ;; + x86_64-*) target_cpu=i386 target_m32=1 ;; + powerpc64-ieee1275) target_cpu=powerpc target_m32=1 ;; esac fi -# Sanity check. +# Check if the platform is supported, make final adjustments. case "$target_cpu"-"$platform" in i386-efi) ;; - x86_64-efi) ;; + x86_64-efi) target_m64=1 ;; i386-pc) ;; i386-coreboot) ;; + i386-linuxbios) platform=coreboot ;; i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; - *) { { echo "$as_me:$LINENO: error: unsupported machine type" >&5 -echo "$as_me: error: unsupported machine type" >&2;} + *) { { echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 +echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac diff --git a/configure.ac b/configure.ac index 7d1782bbb..164f76049 100644 --- a/configure.ac +++ b/configure.ac @@ -61,46 +61,37 @@ if test "x$with_platform" = x; then case "$target_cpu"-"$target_vendor" in i386-apple) platform=efi ;; i386-*) platform=pc ;; + x86_64-apple) platform=efi ;; x86_64-*) platform=pc ;; powerpc-*) platform=ieee1275 ;; + powerpc64-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; - *) AC_MSG_ERROR([unsupported machine type]) ;; + *) AC_MSG_ERROR([unsupported CPU: "$target_cpu"]) ;; esac else platform="$with_platform" fi -case "$platform" in - linuxbios) platform=coreboot ;; -esac - -if test "x$platform" = "xefi" ; then - case "$target_cpu" in - i386) ;; - x86_64) target_m64=1 ;; - *) AC_MSG_ERROR([unsupported CPU type for EFI]) ;; - esac -else - case "$target_cpu" in - i386) ;; - x86_64) target_cpu=i386 target_m32=1 ;; - powerpc) ;; - powerpc64) target_cpu=powerpc target_m32=1;; - sparc64) ;; - *) AC_MSG_ERROR([unsupported CPU type]) ;; +# Adjust CPU unless target was explicitly specified. +if test -z "$target_alias"; then + case "$target_cpu"-"$platform" in + x86_64-efi) ;; + x86_64-*) target_cpu=i386 target_m32=1 ;; + powerpc64-ieee1275) target_cpu=powerpc target_m32=1 ;; esac fi -# Sanity check. +# Check if the platform is supported, make final adjustments. case "$target_cpu"-"$platform" in i386-efi) ;; - x86_64-efi) ;; + x86_64-efi) target_m64=1 ;; i386-pc) ;; i386-coreboot) ;; + i386-linuxbios) platform=coreboot ;; i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; - *) AC_MSG_ERROR([unsupported machine type]) ;; + *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; esac AC_SUBST(target_cpu) From f6130a12bdb5397ba929bc3ed6566127b75f0f65 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 17 Jul 2008 20:19:55 +0000 Subject: [PATCH 0262/1707] 2008-07-17 Pavel Roskin * aclocal.m4 (grub_PROG_TARGET_CC): New macro. Check if the target compiler is functional. * configure.ac: Call grub_PROG_TARGET_CC once all target flags are set up. --- ChangeLog | 5 +++++ aclocal.m4 | 16 ++++++++++++++ configure | 60 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 1 + 4 files changed, 82 insertions(+) diff --git a/ChangeLog b/ChangeLog index cef28b90b..1437af557 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-07-17 Pavel Roskin + * aclocal.m4 (grub_PROG_TARGET_CC): New macro. Check if the + target compiler is functional. + * configure.ac: Call grub_PROG_TARGET_CC once all target flags + are set up. + * configure.ac: Default to efi platform for x86_64-apple. Allow powerpc64 CPU, default to ieee1275 platform for it. Split CPU adjustments from the rest, only do them if target is not diff --git a/aclocal.m4 b/aclocal.m4 index a6732636a..b7cc0a22e 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,3 +1,19 @@ +dnl Check whether target compiler is working +AC_DEFUN(grub_PROG_TARGET_CC, +[AC_MSG_CHECKING([whether target compiler is working]) +AC_CACHE_VAL(grub_cv_prog_target_cc, +[AC_TRY_LINK([], [], + grub_cv_prog_target_cc=yes, + grub_cv_prog_target_cc=no) +]) +AC_MSG_RESULT([$grub_cv_prog_target_cc]) + +if test "x$grub_cv_prog_target_cc" = xno; then + AC_MSG_ERROR([cannot compile for the target]) +fi +]) + + dnl grub_ASM_USCORE checks if C symbols get an underscore after dnl compiling to assembler. dnl Written by Pavel Roskin. Based on grub_ASM_EXT_C written by diff --git a/configure b/configure index cc92328ac..ede2168d2 100644 --- a/configure +++ b/configure @@ -6766,6 +6766,66 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. +{ echo "$as_me:$LINENO: checking whether target compiler is working" >&5 +echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; } +if test "${grub_cv_prog_target_cc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + grub_cv_prog_target_cc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + grub_cv_prog_target_cc=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + +fi + +{ echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 +echo "${ECHO_T}$grub_cv_prog_target_cc" >&6; } + +if test "x$grub_cv_prog_target_cc" = xno; then + { { echo "$as_me:$LINENO: error: cannot compile for the target" >&5 +echo "$as_me: error: cannot compile for the target" >&2;} + { (exit 1); exit 1; }; } +fi + { echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } if test "${grub_cv_prog_objcopy_absolute+set}" = set; then diff --git a/configure.ac b/configure.ac index 164f76049..4d47f64cd 100644 --- a/configure.ac +++ b/configure.ac @@ -286,6 +286,7 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. +grub_PROG_TARGET_CC grub_PROG_OBJCOPY_ABSOLUTE grub_PROG_LD_BUILD_ID_NONE grub_ASM_USCORE From 4ad2d0499cf73d04ee56d1ff158e2446e0ad571d Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 18 Jul 2008 01:11:33 +0000 Subject: [PATCH 0263/1707] 2008-07-17 Pavel Roskin * disk/efi/efidisk.c: Fix format warnings on x86_64. * kern/efi/efi.c: Likewise. --- ChangeLog | 3 +++ disk/efi/efidisk.c | 10 +++++----- kern/efi/efi.c | 25 +++++++++++++------------ 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1437af557..3943e71e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-07-17 Pavel Roskin + * disk/efi/efidisk.c: Fix format warnings on x86_64. + * kern/efi/efi.c: Likewise. + * aclocal.m4 (grub_PROG_TARGET_CC): New macro. Check if the target compiler is functional. * configure.ac: Call grub_PROG_TARGET_CC once all target flags diff --git a/disk/efi/efidisk.c b/disk/efi/efidisk.c index c66221081..d2f5ea202 100644 --- a/disk/efi/efidisk.c +++ b/disk/efi/efidisk.c @@ -539,7 +539,7 @@ grub_efidisk_open (const char *name, struct grub_disk *disk) /* FIXME: Probably it is better to store the block size in the disk, and total sectors should be replaced with total blocks. */ grub_dprintf ("efidisk", "m = %p, last block = %llx, block size = %x\n", - m, m->last_block, m->block_size); + m, (unsigned long long) m->last_block, m->block_size); disk->total_sectors = (m->last_block * (m->block_size >> GRUB_DISK_SECTOR_BITS)); disk->data = d; @@ -571,8 +571,8 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, bio = d->block_io; grub_dprintf ("efidisk", - "reading 0x%x sectors at the sector 0x%llx from %s\n", - size, sector, disk->name); + "reading 0x%lx sectors at the sector 0x%llx from %s\n", + (unsigned long) size, (unsigned long long) sector, disk->name); status = efi_call_5 (dio->read, dio, bio->media->media_id, (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS, @@ -599,8 +599,8 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, bio = d->block_io; grub_dprintf ("efidisk", - "writing 0x%x sectors at the sector 0x%llx to %s\n", - size, sector, disk->name); + "writing 0x%lx sectors at the sector 0x%llx to %s\n", + (unsigned long) size, (unsigned long long) sector, disk->name); status = efi_call_5 (dio->write, dio, bio->media->media_id, (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS, diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 25dc1a609..9c9a40003 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -367,8 +367,8 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) grub_memcpy (&mmapped, dp, len); grub_printf ("/MMap(%x,%llx,%llx)", (unsigned) mmapped.memory_type, - mmapped.start_address, - mmapped.end_address); + (unsigned long long) mmapped.start_address, + (unsigned long long) mmapped.end_address); } break; case GRUB_EFI_VENDOR_DEVICE_PATH_SUBTYPE: @@ -470,14 +470,15 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) grub_efi_fibre_channel_device_path_t fc; grub_memcpy (&fc, dp, len); grub_printf ("/FibreChannel(%llx,%llx)", - fc.wwn, fc.lun); + (unsigned long long) fc.wwn, + (unsigned long long) fc.lun); } break; case GRUB_EFI_1394_DEVICE_PATH_SUBTYPE: { grub_efi_1394_device_path_t firewire; grub_memcpy (&firewire, dp, len); - grub_printf ("/1394(%llx)", firewire.guid); + grub_printf ("/1394(%llx)", (unsigned long long) firewire.guid); } break; case GRUB_EFI_USB_DEVICE_PATH_SUBTYPE: @@ -574,9 +575,9 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) grub_memcpy (&ib, dp, len); grub_printf ("/InfiniBand(%x,%llx,%llx,%llx)", (unsigned) ib.port_gid[0], /* XXX */ - ib.remote_id, - ib.target_port_id, - ib.device_id); + (unsigned long long) ib.remote_id, + (unsigned long long) ib.target_port_id, + (unsigned long long) ib.device_id); } break; case GRUB_EFI_UART_DEVICE_PATH_SUBTYPE: @@ -584,7 +585,7 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) grub_efi_uart_device_path_t uart; grub_memcpy (&uart, dp, len); grub_printf ("/UART(%llu,%u,%x,%x)", - uart.baud_rate, + (unsigned long long) uart.baud_rate, uart.data_bits, uart.parity, uart.stop_bits); @@ -623,8 +624,8 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) grub_memcpy (&hd, dp, len); grub_printf ("/HD(%u,%llx,%llx,%02x%02x%02x%02x%02x%02x%02x%02x,%x,%x)", hd.partition_number, - hd.partition_start, - hd.partition_size, + (unsigned long long) hd.partition_start, + (unsigned long long) hd.partition_size, (unsigned) hd.partition_signature[0], (unsigned) hd.partition_signature[1], (unsigned) hd.partition_signature[2], @@ -643,8 +644,8 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) grub_memcpy (&cd, dp, len); grub_printf ("/CD(%u,%llx,%llx)", cd.boot_entry, - cd.partition_start, - cd.partition_size); + (unsigned long long) cd.partition_start, + (unsigned long long) cd.partition_size); } break; case GRUB_EFI_VENDOR_MEDIA_DEVICE_PATH_SUBTYPE: From c11f6d160dc0b6cb36335f3ed2fc66f6b05cebd4 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 18 Jul 2008 01:13:58 +0000 Subject: [PATCH 0264/1707] Typo fix --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3943e71e8..11eac21b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -32,7 +32,7 @@ 2008-07-17 Bean * conf/i386/efi.rmk (pkglib_MODULES): add pci.mod and lspci.mod. - (appleldr_mod_SOURCE): New variavle. + (appleldr_mod_SOURCE): New variable. (appleldr_mod_CFLAGS): Likewise. (appleldr_mod_LDFLAGS): Likewise. (pci_mod_SOURCES): Likewise. From 3f4ce737bbdc3c8e82c193de2bf35bc7c3a9ac52 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 18 Jul 2008 03:21:47 +0000 Subject: [PATCH 0265/1707] 2008-07-17 Pavel Roskin * configure.ac: Use -m32 or -m64 regardless of whether we had to change target_cpu. The compiler default can mismatch target_cpu in any case. --- ChangeLog | 4 ++++ configure | 11 ++++++++--- configure.ac | 11 ++++++++--- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 11eac21b4..ceb29f0d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2008-07-17 Pavel Roskin + * configure.ac: Use -m32 or -m64 regardless of whether we had to + change target_cpu. The compiler default can mismatch target_cpu + in any case. + * disk/efi/efidisk.c: Fix format warnings on x86_64. * kern/efi/efi.c: Likewise. diff --git a/configure b/configure index ede2168d2..046c23e13 100644 --- a/configure +++ b/configure @@ -1962,15 +1962,15 @@ fi if test -z "$target_alias"; then case "$target_cpu"-"$platform" in x86_64-efi) ;; - x86_64-*) target_cpu=i386 target_m32=1 ;; - powerpc64-ieee1275) target_cpu=powerpc target_m32=1 ;; + x86_64-*) target_cpu=i386 ;; + powerpc64-ieee1275) target_cpu=powerpc ;; esac fi # Check if the platform is supported, make final adjustments. case "$target_cpu"-"$platform" in i386-efi) ;; - x86_64-efi) target_m64=1 ;; + x86_64-efi) ;; i386-pc) ;; i386-coreboot) ;; i386-linuxbios) platform=coreboot ;; @@ -1982,6 +1982,11 @@ echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$t { (exit 1); exit 1; }; } ;; esac +case "$target_cpu" in + i386 | powerpc) target_m32=1 ;; + x86_64 | sparc64) target_m64=1 ;; +esac + diff --git a/configure.ac b/configure.ac index 4d47f64cd..1d8bd08f0 100644 --- a/configure.ac +++ b/configure.ac @@ -76,15 +76,15 @@ fi if test -z "$target_alias"; then case "$target_cpu"-"$platform" in x86_64-efi) ;; - x86_64-*) target_cpu=i386 target_m32=1 ;; - powerpc64-ieee1275) target_cpu=powerpc target_m32=1 ;; + x86_64-*) target_cpu=i386 ;; + powerpc64-ieee1275) target_cpu=powerpc ;; esac fi # Check if the platform is supported, make final adjustments. case "$target_cpu"-"$platform" in i386-efi) ;; - x86_64-efi) target_m64=1 ;; + x86_64-efi) ;; i386-pc) ;; i386-coreboot) ;; i386-linuxbios) platform=coreboot ;; @@ -94,6 +94,11 @@ case "$target_cpu"-"$platform" in *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; esac +case "$target_cpu" in + i386 | powerpc) target_m32=1 ;; + x86_64 | sparc64) target_m64=1 ;; +esac + AC_SUBST(target_cpu) AC_SUBST(platform) From 8aaedab414c6c3e56ac9769b15298b1b06a481a1 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 18 Jul 2008 03:47:33 +0000 Subject: [PATCH 0266/1707] Typo fix --- kern/x86_64/efi/callwrap.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kern/x86_64/efi/callwrap.S b/kern/x86_64/efi/callwrap.S index 36e550967..6c390ec8f 100644 --- a/kern/x86_64/efi/callwrap.S +++ b/kern/x86_64/efi/callwrap.S @@ -22,7 +22,7 @@ #include /* - * x86_64 uses registry to pass parameters. Unfortuanately, gcc and efi use + * x86_64 uses registry to pass parameters. Unfortunately, gcc and efi use * different call conversion, so we need to do some conversion. * * gcc: From b095e2adbfe3914b4d788ea315e6c0fbd33460ea Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 18 Jul 2008 16:11:35 +0000 Subject: [PATCH 0267/1707] 2008-07-18 Pavel Roskin * kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P. We cannot load foreign architecture modules correctly anyway. Keep support for loading host architecture modules, whether we compile them or not. --- ChangeLog | 7 +++++++ kern/dl.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ceb29f0d7..7df7c4219 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-18 Pavel Roskin + + * kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P. We cannot + load foreign architecture modules correctly anyway. Keep + support for loading host architecture modules, whether we + compile them or not. + 2008-07-17 Pavel Roskin * configure.ac: Use -m32 or -m64 regardless of whether we had to diff --git a/kern/dl.c b/kern/dl.c index b57e78dc3..c0d9f1d03 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -29,7 +29,7 @@ #include #include -#if GRUB_TARGET_SIZEOF_VOID_P == 4 +#if GRUB_CPU_SIZEOF_VOID_P == 4 typedef Elf32_Word Elf_Word; typedef Elf32_Addr Elf_Addr; @@ -40,7 +40,7 @@ typedef Elf32_Sym Elf_Sym; # define ELF_ST_BIND(val) ELF32_ST_BIND (val) # define ELF_ST_TYPE(val) ELF32_ST_TYPE (val) -#elif GRUB_TARGET_SIZEOF_VOID_P == 8 +#elif GRUB_CPU_SIZEOF_VOID_P == 8 typedef Elf64_Word Elf_Word; typedef Elf64_Addr Elf_Addr; From 18eeaf04d75e5f8b196499469f6b935eb2e38b04 Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 21 Jul 2008 10:40:01 +0000 Subject: [PATCH 0268/1707] 2008-07-21 Bean * kern/i386/pc/startup.S (gate_a20_try_bios): Change test order for a20. Run keyboard test last, as it will cause macbook to halt. --- ChangeLog | 5 +++++ kern/i386/pc/startup.S | 46 +++++++++++++++++++++++------------------- 2 files changed, 30 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7df7c4219..2fe222616 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-21 Bean + + * kern/i386/pc/startup.S (gate_a20_try_bios): Change test order for + a20. Run keyboard test last, as it will cause macbook to halt. + 2008-07-18 Pavel Roskin * kern/dl.c: Go back to using GRUB_CPU_SIZEOF_VOID_P. We cannot diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 8f420ccdc..75c46adee 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -386,9 +386,32 @@ gate_a20_try_bios: popl %ebp call gate_a20_check_state cmpb %al, %dl - jnz gate_a20_try_keyboard_controller + jnz gate_a20_try_system_control_port_a ret +gate_a20_try_system_control_port_a: + /* + * In macbook, the keyboard test would hang the machine, so we move + * this forward. + */ + /* fourth, try the system control port A */ + inb $0x92 + andb $(~0x03), %al + testb %dl, %dl + jz 6f + orb $0x02, %al +6: outb $0x92 + + /* When turning off Gate A20, do not check the state strictly, + because a failure is not fatal usually, and Gate A20 is always + on some modern machines. */ + testb %dl, %dl + jz 7f + call gate_a20_check_state + cmpb %al, %dl + jnz gate_a20_try_keyboard_controller +7: ret + gate_a20_flush_keyboard_buffer: inb $0x64 andb $0x02, %al @@ -425,30 +448,11 @@ gate_a20_try_keyboard_controller: outb $0x64 call gate_a20_flush_keyboard_buffer - call gate_a20_check_state - cmpb %al, %dl - jnz gate_a20_try_system_control_port_a - ret - -gate_a20_try_system_control_port_a: - /* fourth, try the system control port A */ - inb $0x92 - andb $(~0x03), %al - testb %dl, %dl - jz 6f - orb $0x02, %al -6: outb $0x92 - - /* When turning off Gate A20, do not check the state strictly, - because a failure is not fatal usually, and Gate A20 is always - on some modern machines. */ - testb %dl, %dl - jz 7f call gate_a20_check_state cmpb %al, %dl /* everything failed, so restart from the beginning */ jnz gate_a20_try_bios -7: ret + ret gate_a20_check_state: /* iterate the checking for a while */ From 12ccdb75a93c9b5f1e846941f2ddee44816b134c Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 22 Jul 2008 22:23:45 +0000 Subject: [PATCH 0269/1707] 2008-07-23 Robert Millan * Makefile.in (UNICODE_ARROWS, UNICODE_LINES): New variables (they define the codes for arrows and lines used for the menu). (ascii.pff): Generate fonts for $(UNICODE_ARROWS) and $(UNICODE_LINES) as well. * util/update-grub_lib.in (font_path): Prefer ascii.pff over complete fonts, because the latter are too slow. --- ChangeLog | 10 ++++++++++ Makefile.in | 7 ++++++- util/update-grub_lib.in | 5 +++-- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2fe222616..dec4574a6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-07-23 Robert Millan + + * Makefile.in (UNICODE_ARROWS, UNICODE_LINES): New variables (they + define the codes for arrows and lines used for the menu). + (ascii.pff): Generate fonts for $(UNICODE_ARROWS) and $(UNICODE_LINES) + as well. + + * util/update-grub_lib.in (font_path): Prefer ascii.pff over complete + fonts, because the latter are too slow. + 2008-07-21 Bean * kern/i386/pc/startup.S (gate_a20_try_bios): Change test order for diff --git a/Makefile.in b/Makefile.in index 6f9474c9c..34b5bd0e6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -143,11 +143,16 @@ partmap.lst: $(PARTMAPFILES) ifeq (, $(UNIFONT_HEX)) else pkgdata_DATA += unicode.pff ascii.pff + +# Arrows and lines are needed to draw the menu, so we always include them +UNICODE_ARROWS=0x2190-0x2193 +UNICODE_LINES=0x2501-0x251B + unicode.pff: $(UNIFONT_HEX) ruby $(srcdir)/util/unifont2pff.rb $(UNIFONT_HEX) > $@ ascii.pff: $(UNIFONT_HEX) - ruby $(srcdir)/util/unifont2pff.rb 0-127 $(UNIFONT_HEX) > $@ + ruby $(srcdir)/util/unifont2pff.rb 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) $(UNIFONT_HEX) > $@ endif all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index c488a85d0..03a96ce8f 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -131,8 +131,9 @@ prepare_grub_to_access_device () font_path () { for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do - # Prefer complete fonts over incomplete ones. - for basename in unicode unifont ascii ; do + # FIXME: We prefer ascii because loading complete fonts is too slow (and + # we don't yet provide the gettext magic that would make unicode useful). + for basename in ascii unicode unifont ; do path="${dir}/${basename}.pff" if is_path_readable_by_grub ${path} > /dev/null ; then echo "${path}" From 2a8a80e4f4d09781b3ef0cde6f990063863225f7 Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 24 Jul 2008 14:56:30 +0000 Subject: [PATCH 0270/1707] 2008-07-24 Bean * common.rmk (bin_UTILITIES): Add grub-pe2elf. (grub_pe2elf_SOURCES): New macro. (CLEANFILES): Add grub-pe2elf. * include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant. (GRUB_PE32_SCN_ALIGN_2BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_4BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_8BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_16BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_32BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_64BYTES): Likewise. (GRUB_PE32_SCN_ALIGN_SHIFT): Likewise. (GRUB_PE32_SCN_ALIGN_MASK): Likewise. (GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise. (GRUB_PE32_SYM_CLASS_STATIC): Likewise. (GRUB_PE32_SYM_CLASS_FILE): Likewise. (GRUB_PE32_DT_FUNCTION): Likewise. (GRUB_PE32_REL_I386_DIR32): Likewise. (GRUB_PE32_REL_I386_REL32): Likewise. (grub_pe32_symbol): New structure. (grub_pe32_reloc): Likewise. * util/grub-pe2elf.c: New file. * configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for start symbol in non pc platform. * genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf. The following patches are from Christian Franke. * include/grub/dl.h: Remove .previous, gas supports this only for ELF format. * include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE): Remove .type, gas supports this only for ELF format. * kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing nullbytes in symbol table. This fixes an infinite loop if table is zero filled. * Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT, TARGET_IMG_LDFLAGS and EXEEXT. * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by TARGET_IMG_LDFLAGS_AC. (grub_CHECK_STACK_ARG_PROBE): New function. * conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS. * conf/i386-pc-cygwin-ld-img.sc: New linker script. * configure.ac: Add check for linker script "conf/${target}-img-ld.c" to set TARGET_IMG_LD* accordingly. Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly. Add call to grub_CHECK_STACK_ARG_PROBE. Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols. * genkernsyms.sh.in: Handle HAVE_ASM_USCORE case. * genmk.rb: Add EXEEXT to CLEANFILES. --- ChangeLog | 64 +++++ Makefile.in | 4 + aclocal.m4 | 18 +- conf/common.mk | 361 ++++++++++++++---------- conf/common.rmk | 5 + conf/i386-coreboot.mk | 76 ++--- conf/i386-efi.mk | 88 +++--- conf/i386-ieee1275.mk | 90 +++--- conf/i386-pc-cygwin-img-ld.sc | 53 ++++ conf/i386-pc.mk | 239 +++++++++------- conf/i386-pc.rmk | 12 +- conf/powerpc-ieee1275.mk | 62 ++-- conf/sparc64-ieee1275.mk | 217 ++++++++------ conf/x86_64-efi.mk | 86 +++--- configure | 69 ++++- configure.ac | 43 ++- genkernsyms.sh.in | 7 +- genmk.rb | 9 +- include/grub/dl.h | 4 +- include/grub/efi/pe32.h | 43 +++ include/grub/symbol.h | 6 + kern/dl.c | 2 +- util/grub-pe2elf.c | 514 ++++++++++++++++++++++++++++++++++ 23 files changed, 1533 insertions(+), 539 deletions(-) create mode 100644 conf/i386-pc-cygwin-img-ld.sc create mode 100644 util/grub-pe2elf.c diff --git a/ChangeLog b/ChangeLog index dec4574a6..155843fbe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,67 @@ +2008-07-24 Bean + + * common.rmk (bin_UTILITIES): Add grub-pe2elf. + (grub_pe2elf_SOURCES): New macro. + (CLEANFILES): Add grub-pe2elf. + + * include/grub/efi/pe32.h (GRUB_PE32_SCN_ALIGN_1BYTES): New constant. + (GRUB_PE32_SCN_ALIGN_2BYTES): Likewise. + (GRUB_PE32_SCN_ALIGN_4BYTES): Likewise. + (GRUB_PE32_SCN_ALIGN_8BYTES): Likewise. + (GRUB_PE32_SCN_ALIGN_16BYTES): Likewise. + (GRUB_PE32_SCN_ALIGN_32BYTES): Likewise. + (GRUB_PE32_SCN_ALIGN_64BYTES): Likewise. + (GRUB_PE32_SCN_ALIGN_SHIFT): Likewise. + (GRUB_PE32_SCN_ALIGN_MASK): Likewise. + (GRUB_PE32_SYM_CLASS_EXTERNAL): Likewise. + (GRUB_PE32_SYM_CLASS_STATIC): Likewise. + (GRUB_PE32_SYM_CLASS_FILE): Likewise. + (GRUB_PE32_DT_FUNCTION): Likewise. + (GRUB_PE32_REL_I386_DIR32): Likewise. + (GRUB_PE32_REL_I386_REL32): Likewise. + (grub_pe32_symbol): New structure. + (grub_pe32_reloc): Likewise. + + * util/grub-pe2elf.c: New file. + + * configure.ac: Set TARGET_OBJ2ELF if host os is cygwin. Don't test for + start symbol in non pc platform. + + * genmk.rb: Use TARGET_OBJ2ELF to convert native object format to elf. + + The following patches are from Christian Franke. + + * include/grub/dl.h: Remove .previous, gas supports this only + for ELF format. + + * include/grub/symbol.h [__CYGWIN__] (#define FUNCTION/VARIABLE): + Remove .type, gas supports this only for ELF format. + + * kern/dl.c (grub_dl_resolve_dependencies): Add check for trailing + nullbytes in symbol table. This fixes an infinite loop if table is + zero filled. + + * Makefile.in: Add autoconf replacements TARGET_IMG_LDSCRIPT, + TARGET_IMG_LDFLAGS and EXEEXT. + + * aclocal.m4 (grub_PROG_OBJCOPY_ABSOLUTE): Replace -Wl,-N by + TARGET_IMG_LDFLAGS_AC. + (grub_CHECK_STACK_ARG_PROBE): New function. + + * conf/i386-pc.rmk: Replace -Wl,-N by TARGET_IMG_LDFLAGS. + + * conf/i386-pc-cygwin-ld-img.sc: New linker script. + + * configure.ac: Add check for linker script "conf/${target}-img-ld.c" + to set TARGET_IMG_LD* accordingly. + Add check for Cygwin to set TARGET_MOD_OBJCOPY accordingly. + Add call to grub_CHECK_STACK_ARG_PROBE. + Use TARGET_IMG_LDFLAGS to check start, bss_start, end symbols. + + * genkernsyms.sh.in: Handle HAVE_ASM_USCORE case. + + * genmk.rb: Add EXEEXT to CLEANFILES. + 2008-07-23 Robert Millan * Makefile.in (UNICODE_ARROWS, UNICODE_LINES): New variables (they diff --git a/Makefile.in b/Makefile.in index 34b5bd0e6..2121431de 100644 --- a/Makefile.in +++ b/Makefile.in @@ -68,7 +68,11 @@ TARGET_CFLAGS = @TARGET_CFLAGS@ TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ +TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ +TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@ +TARGET_OBJ2ELF = @TARGET_OBJ2ELF@ MODULE_LDFLAGS = @MODULE_LDFLAGS@ +EXEEXT = @EXEEXT@ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ NM = @NM@ diff --git a/aclocal.m4 b/aclocal.m4 index b7cc0a22e..ee6c4db13 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -73,7 +73,7 @@ else fi grub_cv_prog_objcopy_absolute=yes for link_addr in 2000 8000 7C00; do - if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : + if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : else AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) fi @@ -398,3 +398,19 @@ else AC_MSG_RESULT([no]) [fi] ]) + +dnl Check if the C compiler supports `-mstack-arg-probe' (Cygwin). +AC_DEFUN(grub_CHECK_STACK_ARG_PROBE,[ +[# Smashing stack arg probe. +sap_possible=yes] +AC_MSG_CHECKING([whether `$CC' accepts `-mstack-arg-probe']) +AC_LANG_CONFTEST([[void foo (void) { volatile char a[8]; a[3]; }]]) +[if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then] + AC_MSG_RESULT([yes]) + [# Should we clear up other files as well, having called `AC_LANG_CONFTEST'? + rm -f conftest.s +else + sap_possible=no] + AC_MSG_RESULT([no]) +[fi] +]) diff --git a/conf/common.mk b/conf/common.mk index 9943d6d06..4e9b3300c 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -16,7 +16,7 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o +CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o @@ -190,7 +190,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ grub_fstest_init.c -CLEANFILES += grub-fstest grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o @@ -429,7 +429,7 @@ DISTCLEANFILES += grub_fstest_init.c # for grub-editenv bin_UTILITIES += grub-editenv grub_editenv_SOURCES = util/grub-editenv.c util/envblk.c util/misc.c kern/misc.c kern/err.c -CLEANFILES += grub-editenv grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o +CLEANFILES += grub-editenv$(EXEEXT) grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o MOSTLYCLEANFILES += grub_editenv-util_grub_editenv.d grub_editenv-util_envblk.d grub_editenv-util_misc.d grub_editenv-kern_misc.d grub_editenv-kern_err.d grub-editenv: $(grub_editenv_DEPENDENCIES) grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o @@ -457,6 +457,25 @@ grub_editenv-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) CLEANFILES += grub-editenv +# for grub-pe2elf +bin_UTILITIES += grub-pe2elf +grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c +CLEANFILES += grub-pe2elf$(EXEEXT) grub_pe2elf-util_grub_pe2elf.o grub_pe2elf-util_misc.o +MOSTLYCLEANFILES += grub_pe2elf-util_grub_pe2elf.d grub_pe2elf-util_misc.d + +grub-pe2elf: $(grub_pe2elf_DEPENDENCIES) grub_pe2elf-util_grub_pe2elf.o grub_pe2elf-util_misc.o + $(CC) -o $@ grub_pe2elf-util_grub_pe2elf.o grub_pe2elf-util_misc.o $(LDFLAGS) $(grub_pe2elf_LDFLAGS) + +grub_pe2elf-util_grub_pe2elf.o: util/grub-pe2elf.c $(util/grub-pe2elf.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_pe2elf_CFLAGS) -MD -c -o $@ $< +-include grub_pe2elf-util_grub_pe2elf.d + +grub_pe2elf-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_pe2elf_CFLAGS) -MD -c -o $@ $< +-include grub_pe2elf-util_misc.d + +CLEANFILES += grub-pe2elf + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< @@ -495,10 +514,11 @@ endif MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d UNDSYMFILES += und-fshelp.lst -fshelp.mod: pre-fshelp.o mod-fshelp.o +fshelp.mod: pre-fshelp.o mod-fshelp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o -rm -f $@ @@ -551,10 +571,11 @@ endif MOSTLYCLEANFILES += fat_mod-fs_fat.d UNDSYMFILES += und-fat.lst -fat.mod: pre-fat.o mod-fat.o +fat.mod: pre-fat.o mod-fat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o -rm -f $@ @@ -607,10 +628,11 @@ endif MOSTLYCLEANFILES += ufs_mod-fs_ufs.d UNDSYMFILES += und-ufs.lst -ufs.mod: pre-ufs.o mod-ufs.o +ufs.mod: pre-ufs.o mod-ufs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o -rm -f $@ @@ -663,10 +685,11 @@ endif MOSTLYCLEANFILES += ext2_mod-fs_ext2.d UNDSYMFILES += und-ext2.lst -ext2.mod: pre-ext2.o mod-ext2.o +ext2.mod: pre-ext2.o mod-ext2.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o -rm -f $@ @@ -719,10 +742,11 @@ endif MOSTLYCLEANFILES += ntfs_mod-fs_ntfs.d UNDSYMFILES += und-ntfs.lst -ntfs.mod: pre-ntfs.o mod-ntfs.o +ntfs.mod: pre-ntfs.o mod-ntfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfs.o mod-ntfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ntfs.o: $(ntfs_mod_DEPENDENCIES) ntfs_mod-fs_ntfs.o -rm -f $@ @@ -775,10 +799,11 @@ endif MOSTLYCLEANFILES += ntfscomp_mod-fs_ntfscomp.d UNDSYMFILES += und-ntfscomp.lst -ntfscomp.mod: pre-ntfscomp.o mod-ntfscomp.o +ntfscomp.mod: pre-ntfscomp.o mod-ntfscomp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfscomp.o mod-ntfscomp.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ntfscomp.o: $(ntfscomp_mod_DEPENDENCIES) ntfscomp_mod-fs_ntfscomp.o -rm -f $@ @@ -831,10 +856,11 @@ endif MOSTLYCLEANFILES += minix_mod-fs_minix.d UNDSYMFILES += und-minix.lst -minix.mod: pre-minix.o mod-minix.o +minix.mod: pre-minix.o mod-minix.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o -rm -f $@ @@ -887,10 +913,11 @@ endif MOSTLYCLEANFILES += hfs_mod-fs_hfs.d UNDSYMFILES += und-hfs.lst -hfs.mod: pre-hfs.o mod-hfs.o +hfs.mod: pre-hfs.o mod-hfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o -rm -f $@ @@ -943,10 +970,11 @@ endif MOSTLYCLEANFILES += jfs_mod-fs_jfs.d UNDSYMFILES += und-jfs.lst -jfs.mod: pre-jfs.o mod-jfs.o +jfs.mod: pre-jfs.o mod-jfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o -rm -f $@ @@ -999,10 +1027,11 @@ endif MOSTLYCLEANFILES += iso9660_mod-fs_iso9660.d UNDSYMFILES += und-iso9660.lst -iso9660.mod: pre-iso9660.o mod-iso9660.o +iso9660.mod: pre-iso9660.o mod-iso9660.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-iso9660.o mod-iso9660.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-iso9660.o: $(iso9660_mod_DEPENDENCIES) iso9660_mod-fs_iso9660.o -rm -f $@ @@ -1055,10 +1084,11 @@ endif MOSTLYCLEANFILES += xfs_mod-fs_xfs.d UNDSYMFILES += und-xfs.lst -xfs.mod: pre-xfs.o mod-xfs.o +xfs.mod: pre-xfs.o mod-xfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o -rm -f $@ @@ -1111,10 +1141,11 @@ endif MOSTLYCLEANFILES += affs_mod-fs_affs.d UNDSYMFILES += und-affs.lst -affs.mod: pre-affs.o mod-affs.o +affs.mod: pre-affs.o mod-affs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o -rm -f $@ @@ -1167,10 +1198,11 @@ endif MOSTLYCLEANFILES += sfs_mod-fs_sfs.d UNDSYMFILES += und-sfs.lst -sfs.mod: pre-sfs.o mod-sfs.o +sfs.mod: pre-sfs.o mod-sfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o -rm -f $@ @@ -1223,10 +1255,11 @@ endif MOSTLYCLEANFILES += hfsplus_mod-fs_hfsplus.d UNDSYMFILES += und-hfsplus.lst -hfsplus.mod: pre-hfsplus.o mod-hfsplus.o +hfsplus.mod: pre-hfsplus.o mod-hfsplus.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hfsplus.o mod-hfsplus.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-hfsplus.o: $(hfsplus_mod_DEPENDENCIES) hfsplus_mod-fs_hfsplus.o -rm -f $@ @@ -1279,10 +1312,11 @@ endif MOSTLYCLEANFILES += reiserfs_mod-fs_reiserfs.d UNDSYMFILES += und-reiserfs.lst -reiserfs.mod: pre-reiserfs.o mod-reiserfs.o +reiserfs.mod: pre-reiserfs.o mod-reiserfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reiserfs.o mod-reiserfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-reiserfs.o: $(reiserfs_mod_DEPENDENCIES) reiserfs_mod-fs_reiserfs.o -rm -f $@ @@ -1335,10 +1369,11 @@ endif MOSTLYCLEANFILES += cpio_mod-fs_cpio.d UNDSYMFILES += und-cpio.lst -cpio.mod: pre-cpio.o mod-cpio.o +cpio.mod: pre-cpio.o mod-cpio.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpio.o mod-cpio.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cpio.o: $(cpio_mod_DEPENDENCIES) cpio_mod-fs_cpio.o -rm -f $@ @@ -1391,10 +1426,11 @@ endif MOSTLYCLEANFILES += udf_mod-fs_udf.d UNDSYMFILES += und-udf.lst -udf.mod: pre-udf.o mod-udf.o +udf.mod: pre-udf.o mod-udf.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-udf.o mod-udf.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-udf.o: $(udf_mod_DEPENDENCIES) udf_mod-fs_udf.o -rm -f $@ @@ -1447,10 +1483,11 @@ endif MOSTLYCLEANFILES += afs_mod-fs_afs.d UNDSYMFILES += und-afs.lst -afs.mod: pre-afs.o mod-afs.o +afs.mod: pre-afs.o mod-afs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-afs.o mod-afs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-afs.o: $(afs_mod_DEPENDENCIES) afs_mod-fs_afs.o -rm -f $@ @@ -1506,10 +1543,11 @@ endif MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d UNDSYMFILES += und-amiga.lst -amiga.mod: pre-amiga.o mod-amiga.o +amiga.mod: pre-amiga.o mod-amiga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o -rm -f $@ @@ -1562,10 +1600,11 @@ endif MOSTLYCLEANFILES += apple_mod-partmap_apple.d UNDSYMFILES += und-apple.lst -apple.mod: pre-apple.o mod-apple.o +apple.mod: pre-apple.o mod-apple.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o -rm -f $@ @@ -1618,10 +1657,11 @@ endif MOSTLYCLEANFILES += pc_mod-partmap_pc.d UNDSYMFILES += und-pc.lst -pc.mod: pre-pc.o mod-pc.o +pc.mod: pre-pc.o mod-pc.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o -rm -f $@ @@ -1674,10 +1714,11 @@ endif MOSTLYCLEANFILES += sun_mod-partmap_sun.d UNDSYMFILES += und-sun.lst -sun.mod: pre-sun.o mod-sun.o +sun.mod: pre-sun.o mod-sun.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o -rm -f $@ @@ -1730,10 +1771,11 @@ endif MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d UNDSYMFILES += und-acorn.lst -acorn.mod: pre-acorn.o mod-acorn.o +acorn.mod: pre-acorn.o mod-acorn.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o -rm -f $@ @@ -1786,10 +1828,11 @@ endif MOSTLYCLEANFILES += gpt_mod-partmap_gpt.d UNDSYMFILES += und-gpt.lst -gpt.mod: pre-gpt.o mod-gpt.o +gpt.mod: pre-gpt.o mod-gpt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gpt.o mod-gpt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-gpt.o: $(gpt_mod_DEPENDENCIES) gpt_mod-partmap_gpt.o -rm -f $@ @@ -1846,10 +1889,11 @@ endif MOSTLYCLEANFILES += raid_mod-disk_raid.d UNDSYMFILES += und-raid.lst -raid.mod: pre-raid.o mod-raid.o +raid.mod: pre-raid.o mod-raid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-raid.o mod-raid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-raid.o: $(raid_mod_DEPENDENCIES) raid_mod-disk_raid.o -rm -f $@ @@ -1902,10 +1946,11 @@ endif MOSTLYCLEANFILES += lvm_mod-disk_lvm.d UNDSYMFILES += und-lvm.lst -lvm.mod: pre-lvm.o mod-lvm.o +lvm.mod: pre-lvm.o mod-lvm.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lvm.o mod-lvm.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-lvm.o: $(lvm_mod_DEPENDENCIES) lvm_mod-disk_lvm.o -rm -f $@ @@ -1965,10 +2010,11 @@ endif MOSTLYCLEANFILES += hello_mod-hello_hello.d UNDSYMFILES += und-hello.lst -hello.mod: pre-hello.o mod-hello.o +hello.mod: pre-hello.o mod-hello.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o -rm -f $@ @@ -2021,10 +2067,11 @@ endif MOSTLYCLEANFILES += boot_mod-commands_boot.d UNDSYMFILES += und-boot.lst -boot.mod: pre-boot.o mod-boot.o +boot.mod: pre-boot.o mod-boot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-boot.o mod-boot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o -rm -f $@ @@ -2077,10 +2124,11 @@ endif MOSTLYCLEANFILES += terminal_mod-commands_terminal.d UNDSYMFILES += und-terminal.lst -terminal.mod: pre-terminal.o mod-terminal.o +terminal.mod: pre-terminal.o mod-terminal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-terminal.o mod-terminal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o -rm -f $@ @@ -2133,10 +2181,11 @@ endif MOSTLYCLEANFILES += ls_mod-commands_ls.d UNDSYMFILES += und-ls.lst -ls.mod: pre-ls.o mod-ls.o +ls.mod: pre-ls.o mod-ls.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o -rm -f $@ @@ -2189,10 +2238,11 @@ endif MOSTLYCLEANFILES += cmp_mod-commands_cmp.d UNDSYMFILES += und-cmp.lst -cmp.mod: pre-cmp.o mod-cmp.o +cmp.mod: pre-cmp.o mod-cmp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o -rm -f $@ @@ -2245,10 +2295,11 @@ endif MOSTLYCLEANFILES += cat_mod-commands_cat.d UNDSYMFILES += und-cat.lst -cat.mod: pre-cat.o mod-cat.o +cat.mod: pre-cat.o mod-cat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o -rm -f $@ @@ -2301,10 +2352,11 @@ endif MOSTLYCLEANFILES += echo_mod-commands_echo.d UNDSYMFILES += und-echo.lst -echo.mod: pre-echo.o mod-echo.o +echo.mod: pre-echo.o mod-echo.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-echo.o mod-echo.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-echo.o: $(echo_mod_DEPENDENCIES) echo_mod-commands_echo.o -rm -f $@ @@ -2357,10 +2409,11 @@ endif MOSTLYCLEANFILES += help_mod-commands_help.d UNDSYMFILES += und-help.lst -help.mod: pre-help.o mod-help.o +help.mod: pre-help.o mod-help.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o -rm -f $@ @@ -2413,10 +2466,11 @@ endif MOSTLYCLEANFILES += font_mod-font_manager.d UNDSYMFILES += und-font.lst -font.mod: pre-font.o mod-font.o +font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o -rm -f $@ @@ -2469,10 +2523,11 @@ endif MOSTLYCLEANFILES += search_mod-commands_search.d UNDSYMFILES += und-search.lst -search.mod: pre-search.o mod-search.o +search.mod: pre-search.o mod-search.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o -rm -f $@ @@ -2525,10 +2580,11 @@ endif MOSTLYCLEANFILES += test_mod-commands_test.d UNDSYMFILES += und-test.lst -test.mod: pre-test.o mod-test.o +test.mod: pre-test.o mod-test.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-test.o mod-test.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-test.o: $(test_mod_DEPENDENCIES) test_mod-commands_test.o -rm -f $@ @@ -2581,10 +2637,11 @@ endif MOSTLYCLEANFILES += loopback_mod-disk_loopback.d UNDSYMFILES += und-loopback.lst -loopback.mod: pre-loopback.o mod-loopback.o +loopback.mod: pre-loopback.o mod-loopback.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o -rm -f $@ @@ -2637,10 +2694,11 @@ endif MOSTLYCLEANFILES += fs_uuid_mod-disk_fs_uuid.d UNDSYMFILES += und-fs_uuid.lst -fs_uuid.mod: pre-fs_uuid.o mod-fs_uuid.o +fs_uuid.mod: pre-fs_uuid.o mod-fs_uuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fs_uuid.o mod-fs_uuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-fs_uuid.o: $(fs_uuid_mod_DEPENDENCIES) fs_uuid_mod-disk_fs_uuid.o -rm -f $@ @@ -2693,10 +2751,11 @@ endif MOSTLYCLEANFILES += configfile_mod-commands_configfile.d UNDSYMFILES += und-configfile.lst -configfile.mod: pre-configfile.o mod-configfile.o +configfile.mod: pre-configfile.o mod-configfile.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configfile.o -rm -f $@ @@ -2749,10 +2808,11 @@ endif MOSTLYCLEANFILES += terminfo_mod-term_terminfo.d terminfo_mod-term_tparm.d UNDSYMFILES += und-terminfo.lst -terminfo.mod: pre-terminfo.o mod-terminfo.o +terminfo.mod: pre-terminfo.o mod-terminfo.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-terminfo.o mod-terminfo.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-terminfo.o: $(terminfo_mod_DEPENDENCIES) terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o -rm -f $@ @@ -2824,10 +2884,11 @@ endif MOSTLYCLEANFILES += blocklist_mod-commands_blocklist.d UNDSYMFILES += und-blocklist.lst -blocklist.mod: pre-blocklist.o mod-blocklist.o +blocklist.mod: pre-blocklist.o mod-blocklist.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-blocklist.o mod-blocklist.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-blocklist.o: $(blocklist_mod_DEPENDENCIES) blocklist_mod-commands_blocklist.o -rm -f $@ @@ -2880,10 +2941,11 @@ endif MOSTLYCLEANFILES += hexdump_mod-commands_hexdump.d UNDSYMFILES += und-hexdump.lst -hexdump.mod: pre-hexdump.o mod-hexdump.o +hexdump.mod: pre-hexdump.o mod-hexdump.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hexdump.o mod-hexdump.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-hexdump.o: $(hexdump_mod_DEPENDENCIES) hexdump_mod-commands_hexdump.o -rm -f $@ @@ -2936,10 +2998,11 @@ endif MOSTLYCLEANFILES += read_mod-commands_read.d UNDSYMFILES += und-read.lst -read.mod: pre-read.o mod-read.o +read.mod: pre-read.o mod-read.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-read.o mod-read.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-read.o: $(read_mod_DEPENDENCIES) read_mod-commands_read.o -rm -f $@ @@ -2992,10 +3055,11 @@ endif MOSTLYCLEANFILES += sleep_mod-commands_sleep.d UNDSYMFILES += und-sleep.lst -sleep.mod: pre-sleep.o mod-sleep.o +sleep.mod: pre-sleep.o mod-sleep.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sleep.o mod-sleep.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-sleep.o: $(sleep_mod_DEPENDENCIES) sleep_mod-commands_sleep.o -rm -f $@ @@ -3048,10 +3112,11 @@ endif MOSTLYCLEANFILES += loadenv_mod-commands_loadenv.d loadenv_mod-util_envblk.d UNDSYMFILES += und-loadenv.lst -loadenv.mod: pre-loadenv.o mod-loadenv.o +loadenv.mod: pre-loadenv.o mod-loadenv.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-loadenv.o mod-loadenv.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-loadenv.o: $(loadenv_mod_DEPENDENCIES) loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o -rm -f $@ @@ -3126,10 +3191,11 @@ endif MOSTLYCLEANFILES += elf_mod-kern_elf.d UNDSYMFILES += und-elf.lst -elf.mod: pre-elf.o mod-elf.o +elf.mod: pre-elf.o mod-elf.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-elf.o mod-elf.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-elf.o: $(elf_mod_DEPENDENCIES) elf_mod-kern_elf.o -rm -f $@ @@ -3182,10 +3248,11 @@ endif MOSTLYCLEANFILES += gzio_mod-io_gzio.d UNDSYMFILES += und-gzio.lst -gzio.mod: pre-gzio.o mod-gzio.o +gzio.mod: pre-gzio.o mod-gzio.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o -rm -f $@ diff --git a/conf/common.rmk b/conf/common.rmk index b403b0437..c0087f5bc 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -99,6 +99,11 @@ bin_UTILITIES += grub-editenv grub_editenv_SOURCES = util/grub-editenv.c util/envblk.c util/misc.c kern/misc.c kern/err.c CLEANFILES += grub-editenv +# for grub-pe2elf +bin_UTILITIES += grub-pe2elf +grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c +CLEANFILES += grub-pe2elf + # For update-grub update-grub: util/update-grub.in config.status ./config.status --file=$@:$< diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index c6ac9c76c..587ca572b 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -146,7 +146,7 @@ endif # For grub-mkimage. grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ util/resolve.c -CLEANFILES += grub-mkimage grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o +CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o MOSTLYCLEANFILES += grub_mkimage-util_elf_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o @@ -170,7 +170,7 @@ util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o @@ -222,7 +222,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o @@ -562,10 +562,11 @@ endif MOSTLYCLEANFILES += _linux_mod-loader_i386_pc_linux.d UNDSYMFILES += und-_linux.lst -_linux.mod: pre-_linux.o mod-_linux.o +_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_pc_linux.o -rm -f $@ @@ -618,10 +619,11 @@ endif MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux_normal.d UNDSYMFILES += und-linux.lst -linux.mod: pre-linux.o mod-linux.o +linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux_normal.o -rm -f $@ @@ -678,10 +680,11 @@ endif MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d normal_mod-normal_color.d UNDSYMFILES += und-normal.lst -normal.mod: pre-normal.o mod-normal.o +normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o -rm -f $@ @@ -1001,10 +1004,11 @@ endif MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d UNDSYMFILES += und-serial.lst -serial.mod: pre-serial.o mod-serial.o +serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o -rm -f $@ @@ -1060,10 +1064,11 @@ endif MOSTLYCLEANFILES += _multiboot_mod-loader_i386_pc_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o +_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ @@ -1173,10 +1178,11 @@ endif MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d UNDSYMFILES += und-multiboot.lst -multiboot.mod: pre-multiboot.o mod-multiboot.o +multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o -rm -f $@ @@ -1229,10 +1235,11 @@ endif MOSTLYCLEANFILES += aout_mod-loader_aout.d UNDSYMFILES += und-aout.lst -aout.mod: pre-aout.o mod-aout.o +aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o -rm -f $@ @@ -1285,10 +1292,11 @@ endif MOSTLYCLEANFILES += play_mod-commands_i386_pc_play.d UNDSYMFILES += und-play.lst -play.mod: pre-play.o mod-play.o +play.mod: pre-play.o mod-play.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o -rm -f $@ @@ -1341,10 +1349,11 @@ endif MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d UNDSYMFILES += und-cpuid.lst -cpuid.mod: pre-cpuid.o mod-cpuid.o +cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o -rm -f $@ @@ -1397,10 +1406,11 @@ endif MOSTLYCLEANFILES += ata_mod-disk_ata.d UNDSYMFILES += und-ata.lst -ata.mod: pre-ata.o mod-ata.o +ata.mod: pre-ata.o mod-ata.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o -rm -f $@ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 73f077e93..92830342a 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -17,7 +17,7 @@ sbin_UTILITIES = grub-mkdevicemap # For grub-mkimage. grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ util/resolve.c -CLEANFILES += grub-mkimage grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o +CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o MOSTLYCLEANFILES += grub_mkimage-util_i386_efi_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o @@ -48,7 +48,7 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o @@ -135,10 +135,11 @@ endif MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d UNDSYMFILES += und-kernel.lst -kernel.mod: pre-kernel.o mod-kernel.o +kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o -rm -f $@ @@ -647,10 +648,11 @@ endif MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d normal_mod-normal_color.d UNDSYMFILES += und-normal.lst -normal.mod: pre-normal.o mod-normal.o +normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o -rm -f $@ @@ -970,10 +972,11 @@ endif MOSTLYCLEANFILES += _chain_mod-loader_efi_chainloader.d UNDSYMFILES += und-_chain.lst -_chain.mod: pre-_chain.o mod-_chain.o +_chain.mod: pre-_chain.o mod-_chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_chain.o mod-_chain.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o -rm -f $@ @@ -1026,10 +1029,11 @@ endif MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader_normal.d UNDSYMFILES += und-chain.lst -chain.mod: pre-chain.o mod-chain.o +chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o -rm -f $@ @@ -1082,10 +1086,11 @@ endif MOSTLYCLEANFILES += appleldr_mod-loader_efi_appleloader.d UNDSYMFILES += und-appleldr.lst -appleldr.mod: pre-appleldr.o mod-appleldr.o +appleldr.mod: pre-appleldr.o mod-appleldr.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader.o -rm -f $@ @@ -1138,10 +1143,11 @@ endif MOSTLYCLEANFILES += _linux_mod-loader_i386_efi_linux.d UNDSYMFILES += und-_linux.lst -_linux.mod: pre-_linux.o mod-_linux.o +_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o -rm -f $@ @@ -1194,10 +1200,11 @@ endif MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux_normal.d UNDSYMFILES += und-linux.lst -linux.mod: pre-linux.o mod-linux.o +linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux_normal.o -rm -f $@ @@ -1250,10 +1257,11 @@ endif MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d UNDSYMFILES += und-cpuid.lst -cpuid.mod: pre-cpuid.o mod-cpuid.o +cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o -rm -f $@ @@ -1306,10 +1314,11 @@ endif MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst -halt.mod: pre-halt.o mod-halt.o +halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ @@ -1362,10 +1371,11 @@ endif MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst -reboot.mod: pre-reboot.o mod-reboot.o +reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ @@ -1418,10 +1428,11 @@ endif MOSTLYCLEANFILES += pci_mod-bus_pci.d UNDSYMFILES += und-pci.lst -pci.mod: pre-pci.o mod-pci.o +pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o -rm -f $@ @@ -1474,10 +1485,11 @@ endif MOSTLYCLEANFILES += lspci_mod-commands_lspci.d UNDSYMFILES += und-lspci.lst -lspci.mod: pre-lspci.o mod-lspci.o +lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o -rm -f $@ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 93ebab291..d19fd2ec0 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -159,7 +159,7 @@ endif # For grub-mkimage. grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ util/resolve.c -CLEANFILES += grub-mkimage grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o +CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o MOSTLYCLEANFILES += grub_mkimage-util_elf_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o @@ -183,7 +183,7 @@ util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o @@ -236,7 +236,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o @@ -600,10 +600,11 @@ endif MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d normal_mod-normal_color.d UNDSYMFILES += und-normal.lst -normal.mod: pre-normal.o mod-normal.o +normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o -rm -f $@ @@ -925,10 +926,11 @@ endif MOSTLYCLEANFILES += _multiboot_mod-loader_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o +_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ @@ -1019,10 +1021,11 @@ endif MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d UNDSYMFILES += und-multiboot.lst -multiboot.mod: pre-multiboot.o mod-multiboot.o +multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o -rm -f $@ @@ -1075,10 +1078,11 @@ endif MOSTLYCLEANFILES += aout_mod-loader_aout.d UNDSYMFILES += und-aout.lst -aout.mod: pre-aout.o mod-aout.o +aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o -rm -f $@ @@ -1131,10 +1135,11 @@ endif MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d UNDSYMFILES += und-suspend.lst -suspend.mod: pre-suspend.o mod-suspend.o +suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o -rm -f $@ @@ -1187,10 +1192,11 @@ endif MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst -reboot.mod: pre-reboot.o mod-reboot.o +reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ @@ -1243,10 +1249,11 @@ endif MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst -halt.mod: pre-halt.o mod-halt.o +halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ @@ -1299,10 +1306,11 @@ endif MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d UNDSYMFILES += und-cpuid.lst -cpuid.mod: pre-cpuid.o mod-cpuid.o +cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o -rm -f $@ @@ -1355,10 +1363,11 @@ endif MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d UNDSYMFILES += und-serial.lst -serial.mod: pre-serial.o mod-serial.o +serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o -rm -f $@ @@ -1411,10 +1420,11 @@ endif MOSTLYCLEANFILES += _linux_mod-loader_i386_ieee1275_linux.d UNDSYMFILES += und-_linux.lst -_linux.mod: pre-_linux.o mod-_linux.o +_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_ieee1275_linux.o -rm -f $@ @@ -1467,10 +1477,11 @@ endif MOSTLYCLEANFILES += linux_mod-loader_i386_ieee1275_linux_normal.d UNDSYMFILES += und-linux.lst -linux.mod: pre-linux.o mod-linux.o +linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_ieee1275_linux_normal.o -rm -f $@ @@ -1523,10 +1534,11 @@ endif MOSTLYCLEANFILES += nand_mod-disk_ieee1275_nand.d UNDSYMFILES += und-nand.lst -nand.mod: pre-nand.o mod-nand.o +nand.mod: pre-nand.o mod-nand.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-nand.o mod-nand.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-nand.o: $(nand_mod_DEPENDENCIES) nand_mod-disk_ieee1275_nand.o -rm -f $@ diff --git a/conf/i386-pc-cygwin-img-ld.sc b/conf/i386-pc-cygwin-img-ld.sc new file mode 100644 index 000000000..a41cac75e --- /dev/null +++ b/conf/i386-pc-cygwin-img-ld.sc @@ -0,0 +1,53 @@ +/* Linker script to create grub .img files on Cygwin. */ + +SECTIONS +{ + .text : + { + start = . ; + *(.text) + etext = . ; + } + .data : + { + __data_start__ = . ; + *(.data) + __data_end__ = . ; + } + .rdata : + { + __rdata_start__ = . ; + *(.rdata) + __rdata_end__ = . ; + } + .pdata : + { + *(.pdata) + edata = . ; + } + .bss : + { + __bss_start__ = . ; + *(.bss) + __common_start__ = . ; + *(COMMON) + __bss_end__ = . ; + } + .edata : + { + *(.edata) + end = . ; + } + .stab : + { + *(.stab) + } + .stabstr : + { + *(.stabstr) + } +} + +ASSERT("__rdata_end__"=="edata", ".pdata not empty") +ASSERT("__bss_end__" =="end" , ".edata not empty") + diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 6921b7fdc..e26cfa77e 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -29,7 +29,7 @@ boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S $(boot/i386/pc/boot.S_DEPENDEN -include boot_img-boot_i386_pc_boot.d boot_img_ASFLAGS = $(COMMON_ASFLAGS) -boot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 +boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 # For pxeboot.img pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S @@ -47,7 +47,7 @@ pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S $(boot/i386/pc/pxeboo -include pxeboot_img-boot_i386_pc_pxeboot.d pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) -pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 +pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S @@ -65,7 +65,7 @@ diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S $(boot/i386/pc/dis -include diskboot_img-boot_i386_pc_diskboot.d diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) -diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,8000 +diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000 # For lnxboot.img. lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S @@ -83,7 +83,7 @@ lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S $(boot/i386/pc/lnxboo -include lnxboot_img-boot_i386_pc_lnxboot.d lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) -lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,6000 +lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000 # For cdboot.img. cdboot_img_SOURCES = boot/i386/pc/cdboot.S @@ -101,7 +101,7 @@ cdboot_img-boot_i386_pc_cdboot.o: boot/i386/pc/cdboot.S $(boot/i386/pc/cdboot.S_ -include cdboot_img-boot_i386_pc_cdboot.d cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) -cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 +cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ @@ -207,7 +207,7 @@ kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h machine/kernel.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst @@ -229,7 +229,7 @@ endif ifeq ($(enable_lzo), yes) grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c -CLEANFILES += grub-mkimage grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o +CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o MOSTLYCLEANFILES += grub_mkimage-util_i386_pc_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o @@ -251,7 +251,7 @@ grub_mkimage_LDFLAGS = $(LIBLZO) else grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c lib/LzmaEnc.c lib/LzFind.c -CLEANFILES += grub-mkimage grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o +CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o MOSTLYCLEANFILES += grub_mkimage-util_i386_pc_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub_mkimage-lib_LzmaEnc.d grub_mkimage-lib_LzFind.d grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o @@ -298,7 +298,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ disk/raid.c disk/lvm.c \ util/raid.c util/lvm.c \ grub_setup_init.c -CLEANFILES += grub-setup grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o @@ -460,7 +460,7 @@ grub_setup-grub_setup_init.o: grub_setup_init.c $(grub_setup_init.c_DEPENDENCIES # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o @@ -513,7 +513,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o @@ -886,10 +886,11 @@ endif MOSTLYCLEANFILES += biosdisk_mod-disk_i386_pc_biosdisk.d UNDSYMFILES += und-biosdisk.lst -biosdisk.mod: pre-biosdisk.o mod-biosdisk.o +biosdisk.mod: pre-biosdisk.o mod-biosdisk.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-biosdisk.o mod-biosdisk.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-biosdisk.o: $(biosdisk_mod_DEPENDENCIES) biosdisk_mod-disk_i386_pc_biosdisk.o -rm -f $@ @@ -942,10 +943,11 @@ endif MOSTLYCLEANFILES += _chain_mod-loader_i386_pc_chainloader.d UNDSYMFILES += und-_chain.lst -_chain.mod: pre-_chain.o mod-_chain.o +_chain.mod: pre-_chain.o mod-_chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_chain.o mod-_chain.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_i386_pc_chainloader.o -rm -f $@ @@ -998,10 +1000,11 @@ endif MOSTLYCLEANFILES += chain_mod-loader_i386_pc_chainloader_normal.d UNDSYMFILES += und-chain.lst -chain.mod: pre-chain.o mod-chain.o +chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_i386_pc_chainloader_normal.o -rm -f $@ @@ -1054,10 +1057,11 @@ endif MOSTLYCLEANFILES += _linux_mod-loader_i386_pc_linux.d UNDSYMFILES += und-_linux.lst -_linux.mod: pre-_linux.o mod-_linux.o +_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_pc_linux.o -rm -f $@ @@ -1110,10 +1114,11 @@ endif MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux_normal.d UNDSYMFILES += und-linux.lst -linux.mod: pre-linux.o mod-linux.o +linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux_normal.o -rm -f $@ @@ -1171,10 +1176,11 @@ endif MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst -normal.mod: pre-normal.o mod-normal.o +normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ @@ -1494,10 +1500,11 @@ endif MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst -reboot.mod: pre-reboot.o mod-reboot.o +reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ @@ -1550,10 +1557,11 @@ endif MOSTLYCLEANFILES += halt_mod-commands_i386_pc_halt.d UNDSYMFILES += und-halt.lst -halt.mod: pre-halt.o mod-halt.o +halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_i386_pc_halt.o -rm -f $@ @@ -1606,10 +1614,11 @@ endif MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d UNDSYMFILES += und-serial.lst -serial.mod: pre-serial.o mod-serial.o +serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o -rm -f $@ @@ -1665,10 +1674,11 @@ endif MOSTLYCLEANFILES += _multiboot_mod-loader_i386_pc_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o +_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ @@ -1778,10 +1788,11 @@ endif MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d UNDSYMFILES += und-multiboot.lst -multiboot.mod: pre-multiboot.o mod-multiboot.o +multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o -rm -f $@ @@ -1835,10 +1846,11 @@ endif MOSTLYCLEANFILES += vbe_mod-video_i386_pc_vbe.d vbe_mod-video_i386_pc_vbeblit.d vbe_mod-video_i386_pc_vbefill.d vbe_mod-video_i386_pc_vbeutil.d UNDSYMFILES += und-vbe.lst -vbe.mod: pre-vbe.o mod-vbe.o +vbe.mod: pre-vbe.o mod-vbe.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vbe.o mod-vbe.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-vbe.o: $(vbe_mod_DEPENDENCIES) vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o vbe_mod-video_i386_pc_vbeutil.o -rm -f $@ @@ -1948,10 +1960,11 @@ endif MOSTLYCLEANFILES += vbeinfo_mod-commands_i386_pc_vbeinfo.d UNDSYMFILES += und-vbeinfo.lst -vbeinfo.mod: pre-vbeinfo.o mod-vbeinfo.o +vbeinfo.mod: pre-vbeinfo.o mod-vbeinfo.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vbeinfo.o mod-vbeinfo.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-vbeinfo.o: $(vbeinfo_mod_DEPENDENCIES) vbeinfo_mod-commands_i386_pc_vbeinfo.o -rm -f $@ @@ -2004,10 +2017,11 @@ endif MOSTLYCLEANFILES += vbetest_mod-commands_i386_pc_vbetest.d UNDSYMFILES += und-vbetest.lst -vbetest.mod: pre-vbetest.o mod-vbetest.o +vbetest.mod: pre-vbetest.o mod-vbetest.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vbetest.o mod-vbetest.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-vbetest.o: $(vbetest_mod_DEPENDENCIES) vbetest_mod-commands_i386_pc_vbetest.o -rm -f $@ @@ -2060,10 +2074,11 @@ endif MOSTLYCLEANFILES += play_mod-commands_i386_pc_play.d UNDSYMFILES += und-play.lst -play.mod: pre-play.o mod-play.o +play.mod: pre-play.o mod-play.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o -rm -f $@ @@ -2116,10 +2131,11 @@ endif MOSTLYCLEANFILES += video_mod-video_video.d UNDSYMFILES += und-video.lst -video.mod: pre-video.o mod-video.o +video.mod: pre-video.o mod-video.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o -rm -f $@ @@ -2172,10 +2188,11 @@ endif MOSTLYCLEANFILES += gfxterm_mod-term_gfxterm.d UNDSYMFILES += und-gfxterm.lst -gfxterm.mod: pre-gfxterm.o mod-gfxterm.o +gfxterm.mod: pre-gfxterm.o mod-gfxterm.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o -rm -f $@ @@ -2228,10 +2245,11 @@ endif MOSTLYCLEANFILES += videotest_mod-commands_videotest.d UNDSYMFILES += und-videotest.lst -videotest.mod: pre-videotest.o mod-videotest.o +videotest.mod: pre-videotest.o mod-videotest.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-videotest.o mod-videotest.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-videotest.o: $(videotest_mod_DEPENDENCIES) videotest_mod-commands_videotest.o -rm -f $@ @@ -2284,10 +2302,11 @@ endif MOSTLYCLEANFILES += bitmap_mod-video_bitmap.d UNDSYMFILES += und-bitmap.lst -bitmap.mod: pre-bitmap.o mod-bitmap.o +bitmap.mod: pre-bitmap.o mod-bitmap.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bitmap.o mod-bitmap.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-bitmap.o: $(bitmap_mod_DEPENDENCIES) bitmap_mod-video_bitmap.o -rm -f $@ @@ -2340,10 +2359,11 @@ endif MOSTLYCLEANFILES += tga_mod-video_readers_tga.d UNDSYMFILES += und-tga.lst -tga.mod: pre-tga.o mod-tga.o +tga.mod: pre-tga.o mod-tga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-tga.o mod-tga.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-tga.o: $(tga_mod_DEPENDENCIES) tga_mod-video_readers_tga.o -rm -f $@ @@ -2396,10 +2416,11 @@ endif MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d UNDSYMFILES += und-cpuid.lst -cpuid.mod: pre-cpuid.o mod-cpuid.o +cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o -rm -f $@ @@ -2452,10 +2473,11 @@ endif MOSTLYCLEANFILES += ata_mod-disk_ata.d UNDSYMFILES += und-ata.lst -ata.mod: pre-ata.o mod-ata.o +ata.mod: pre-ata.o mod-ata.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o -rm -f $@ @@ -2508,10 +2530,11 @@ endif MOSTLYCLEANFILES += vga_mod-term_i386_pc_vga.d UNDSYMFILES += und-vga.lst -vga.mod: pre-vga.o mod-vga.o +vga.mod: pre-vga.o mod-vga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vga.o mod-vga.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-vga.o: $(vga_mod_DEPENDENCIES) vga_mod-term_i386_pc_vga.o -rm -f $@ @@ -2564,10 +2587,11 @@ endif MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d UNDSYMFILES += und-memdisk.lst -memdisk.mod: pre-memdisk.o mod-memdisk.o +memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o -rm -f $@ @@ -2620,10 +2644,11 @@ endif MOSTLYCLEANFILES += jpeg_mod-video_readers_jpeg.d UNDSYMFILES += und-jpeg.lst -jpeg.mod: pre-jpeg.o mod-jpeg.o +jpeg.mod: pre-jpeg.o mod-jpeg.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jpeg.o mod-jpeg.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-jpeg.o: $(jpeg_mod_DEPENDENCIES) jpeg_mod-video_readers_jpeg.o -rm -f $@ @@ -2676,10 +2701,11 @@ endif MOSTLYCLEANFILES += png_mod-video_readers_png.d UNDSYMFILES += und-png.lst -png.mod: pre-png.o mod-png.o +png.mod: pre-png.o mod-png.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-png.o mod-png.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-png.o: $(png_mod_DEPENDENCIES) png_mod-video_readers_png.o -rm -f $@ @@ -2732,10 +2758,11 @@ endif MOSTLYCLEANFILES += pci_mod-bus_pci.d UNDSYMFILES += und-pci.lst -pci.mod: pre-pci.o mod-pci.o +pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o -rm -f $@ @@ -2788,10 +2815,11 @@ endif MOSTLYCLEANFILES += lspci_mod-commands_lspci.d UNDSYMFILES += und-lspci.lst -lspci.mod: pre-lspci.o mod-lspci.o +lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o -rm -f $@ @@ -2844,10 +2872,11 @@ endif MOSTLYCLEANFILES += aout_mod-loader_aout.d UNDSYMFILES += und-aout.lst -aout.mod: pre-aout.o mod-aout.o +aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o -rm -f $@ @@ -2900,10 +2929,11 @@ endif MOSTLYCLEANFILES += _bsd_mod-loader_i386_bsd.d UNDSYMFILES += und-_bsd.lst -_bsd.mod: pre-_bsd.o mod-_bsd.o +_bsd.mod: pre-_bsd.o mod-_bsd.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_bsd.o mod-_bsd.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_bsd.o: $(_bsd_mod_DEPENDENCIES) _bsd_mod-loader_i386_bsd.o -rm -f $@ @@ -2956,10 +2986,11 @@ endif MOSTLYCLEANFILES += bsd_mod-loader_i386_bsd_normal.d UNDSYMFILES += und-bsd.lst -bsd.mod: pre-bsd.o mod-bsd.o +bsd.mod: pre-bsd.o mod-bsd.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bsd.o mod-bsd.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-bsd.o: $(bsd_mod_DEPENDENCIES) bsd_mod-loader_i386_bsd_normal.o -rm -f $@ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index b677a9621..84c0b7dee 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -16,27 +16,27 @@ pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S boot_img_ASFLAGS = $(COMMON_ASFLAGS) -boot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 +boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 # For pxeboot.img pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) -pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 +pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) -diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,8000 +diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000 # For lnxboot.img. lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) -lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,6000 +lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000 # For cdboot.img. cdboot_img_SOURCES = boot/i386/pc/cdboot.S cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) -cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,7C00 +cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ @@ -53,7 +53,7 @@ kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h machine/kernel.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index a5b6be010..5a91801eb 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -37,7 +37,7 @@ endif # For grub-mkimage. grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ util/resolve.c -CLEANFILES += grub-mkimage grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o +CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o MOSTLYCLEANFILES += grub_mkimage-util_elf_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o @@ -60,7 +60,7 @@ util/elf/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/ieee1275/get_disk_name.c -CLEANFILES += grub-mkdevicemap grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_ieee1275_get_disk_name.o +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_ieee1275_get_disk_name.o MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_ieee1275_get_disk_name.d grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_ieee1275_get_disk_name.o @@ -111,7 +111,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o @@ -590,10 +590,11 @@ endif MOSTLYCLEANFILES += _linux_mod-loader_powerpc_ieee1275_linux.d UNDSYMFILES += und-_linux.lst -_linux.mod: pre-_linux.o mod-_linux.o +_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_powerpc_ieee1275_linux.o -rm -f $@ @@ -646,10 +647,11 @@ endif MOSTLYCLEANFILES += linux_mod-loader_powerpc_ieee1275_linux_normal.d UNDSYMFILES += und-linux.lst -linux.mod: pre-linux.o mod-linux.o +linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_powerpc_ieee1275_linux_normal.o -rm -f $@ @@ -706,10 +708,11 @@ endif MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d normal_mod-normal_color.d UNDSYMFILES += und-normal.lst -normal.mod: pre-normal.o mod-normal.o +normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o normal_mod-normal_color.o -rm -f $@ @@ -1029,10 +1032,11 @@ endif MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d UNDSYMFILES += und-suspend.lst -suspend.mod: pre-suspend.o mod-suspend.o +suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o -rm -f $@ @@ -1085,10 +1089,11 @@ endif MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst -reboot.mod: pre-reboot.o mod-reboot.o +reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ @@ -1141,10 +1146,11 @@ endif MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst -halt.mod: pre-halt.o mod-halt.o +halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ @@ -1199,10 +1205,11 @@ endif MOSTLYCLEANFILES += _multiboot_mod-loader_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o +_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ @@ -1293,10 +1300,11 @@ endif MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d UNDSYMFILES += und-multiboot.lst -multiboot.mod: pre-multiboot.o mod-multiboot.o +multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o -rm -f $@ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 6939a33a4..88ee85370 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -196,10 +196,11 @@ endif MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d UNDSYMFILES += und-fshelp.lst -fshelp.mod: pre-fshelp.o mod-fshelp.o +fshelp.mod: pre-fshelp.o mod-fshelp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o -rm -f $@ @@ -252,10 +253,11 @@ endif MOSTLYCLEANFILES += fat_mod-fs_fat.d UNDSYMFILES += und-fat.lst -fat.mod: pre-fat.o mod-fat.o +fat.mod: pre-fat.o mod-fat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o -rm -f $@ @@ -308,10 +310,11 @@ endif MOSTLYCLEANFILES += ext2_mod-fs_ext2.d UNDSYMFILES += und-ext2.lst -ext2.mod: pre-ext2.o mod-ext2.o +ext2.mod: pre-ext2.o mod-ext2.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o -rm -f $@ @@ -364,10 +367,11 @@ endif MOSTLYCLEANFILES += ufs_mod-fs_ufs.d UNDSYMFILES += und-ufs.lst -ufs.mod: pre-ufs.o mod-ufs.o +ufs.mod: pre-ufs.o mod-ufs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o -rm -f $@ @@ -420,10 +424,11 @@ endif MOSTLYCLEANFILES += minix_mod-fs_minix.d UNDSYMFILES += und-minix.lst -minix.mod: pre-minix.o mod-minix.o +minix.mod: pre-minix.o mod-minix.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o -rm -f $@ @@ -476,10 +481,11 @@ endif MOSTLYCLEANFILES += hfs_mod-fs_hfs.d UNDSYMFILES += und-hfs.lst -hfs.mod: pre-hfs.o mod-hfs.o +hfs.mod: pre-hfs.o mod-hfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o -rm -f $@ @@ -532,10 +538,11 @@ endif MOSTLYCLEANFILES += jfs_mod-fs_jfs.d UNDSYMFILES += und-jfs.lst -jfs.mod: pre-jfs.o mod-jfs.o +jfs.mod: pre-jfs.o mod-jfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o -rm -f $@ @@ -593,10 +600,11 @@ endif MOSTLYCLEANFILES += xfs_mod-fs_xfs.d UNDSYMFILES += und-xfs.lst -xfs.mod: pre-xfs.o mod-xfs.o +xfs.mod: pre-xfs.o mod-xfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o -rm -f $@ @@ -649,10 +657,11 @@ endif MOSTLYCLEANFILES += affs_mod-fs_affs.d UNDSYMFILES += und-affs.lst -affs.mod: pre-affs.o mod-affs.o +affs.mod: pre-affs.o mod-affs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o -rm -f $@ @@ -705,10 +714,11 @@ endif MOSTLYCLEANFILES += sfs_mod-fs_sfs.d UNDSYMFILES += und-sfs.lst -sfs.mod: pre-sfs.o mod-sfs.o +sfs.mod: pre-sfs.o mod-sfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o -rm -f $@ @@ -776,10 +786,11 @@ endif MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d normal_mod-grub_script_tab.d UNDSYMFILES += und-normal.lst -normal.mod: pre-normal.o mod-normal.o +normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o -rm -f $@ @@ -1080,10 +1091,11 @@ endif MOSTLYCLEANFILES += hello_mod-hello_hello.d UNDSYMFILES += und-hello.lst -hello.mod: pre-hello.o mod-hello.o +hello.mod: pre-hello.o mod-hello.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o -rm -f $@ @@ -1136,10 +1148,11 @@ endif MOSTLYCLEANFILES += boot_mod-commands_boot.d UNDSYMFILES += und-boot.lst -boot.mod: pre-boot.o mod-boot.o +boot.mod: pre-boot.o mod-boot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-boot.o mod-boot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o -rm -f $@ @@ -1192,10 +1205,11 @@ endif MOSTLYCLEANFILES += terminal_mod-commands_terminal.d UNDSYMFILES += und-terminal.lst -terminal.mod: pre-terminal.o mod-terminal.o +terminal.mod: pre-terminal.o mod-terminal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-terminal.o mod-terminal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o -rm -f $@ @@ -1248,10 +1262,11 @@ endif MOSTLYCLEANFILES += ls_mod-commands_ls.d UNDSYMFILES += und-ls.lst -ls.mod: pre-ls.o mod-ls.o +ls.mod: pre-ls.o mod-ls.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o -rm -f $@ @@ -1304,10 +1319,11 @@ endif MOSTLYCLEANFILES += cmp_mod-commands_cmp.d UNDSYMFILES += und-cmp.lst -cmp.mod: pre-cmp.o mod-cmp.o +cmp.mod: pre-cmp.o mod-cmp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o -rm -f $@ @@ -1360,10 +1376,11 @@ endif MOSTLYCLEANFILES += cat_mod-commands_cat.d UNDSYMFILES += und-cat.lst -cat.mod: pre-cat.o mod-cat.o +cat.mod: pre-cat.o mod-cat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o -rm -f $@ @@ -1416,10 +1433,11 @@ endif MOSTLYCLEANFILES += font_mod-font_manager.d UNDSYMFILES += und-font.lst -font.mod: pre-font.o mod-font.o +font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o -rm -f $@ @@ -1472,10 +1490,11 @@ endif MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d UNDSYMFILES += und-amiga.lst -amiga.mod: pre-amiga.o mod-amiga.o +amiga.mod: pre-amiga.o mod-amiga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o -rm -f $@ @@ -1528,10 +1547,11 @@ endif MOSTLYCLEANFILES += apple_mod-partmap_apple.d UNDSYMFILES += und-apple.lst -apple.mod: pre-apple.o mod-apple.o +apple.mod: pre-apple.o mod-apple.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o -rm -f $@ @@ -1584,10 +1604,11 @@ endif MOSTLYCLEANFILES += pc_mod-partmap_pc.d UNDSYMFILES += und-pc.lst -pc.mod: pre-pc.o mod-pc.o +pc.mod: pre-pc.o mod-pc.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o -rm -f $@ @@ -1640,10 +1661,11 @@ endif MOSTLYCLEANFILES += sun_mod-partmap_sun.d UNDSYMFILES += und-sun.lst -sun.mod: pre-sun.o mod-sun.o +sun.mod: pre-sun.o mod-sun.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o -rm -f $@ @@ -1696,10 +1718,11 @@ endif MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d UNDSYMFILES += und-acorn.lst -acorn.mod: pre-acorn.o mod-acorn.o +acorn.mod: pre-acorn.o mod-acorn.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o -rm -f $@ @@ -1751,10 +1774,11 @@ endif MOSTLYCLEANFILES += loopback_mod-disk_loopback.d UNDSYMFILES += und-loopback.lst -loopback.mod: pre-loopback.o mod-loopback.o +loopback.mod: pre-loopback.o mod-loopback.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o -rm -f $@ @@ -1807,10 +1831,11 @@ endif MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d UNDSYMFILES += und-suspend.lst -suspend.mod: pre-suspend.o mod-suspend.o +suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o -rm -f $@ @@ -1863,10 +1888,11 @@ endif MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst -reboot.mod: pre-reboot.o mod-reboot.o +reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ @@ -1919,10 +1945,11 @@ endif MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst -halt.mod: pre-halt.o mod-halt.o +halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ @@ -1975,10 +2002,11 @@ endif MOSTLYCLEANFILES += help_mod-commands_help.d UNDSYMFILES += und-help.lst -help.mod: pre-help.o mod-help.o +help.mod: pre-help.o mod-help.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o -rm -f $@ @@ -2041,10 +2069,11 @@ endif MOSTLYCLEANFILES += configfile_mod-commands_configfile.d UNDSYMFILES += und-configfile.lst -configfile.mod: pre-configfile.o mod-configfile.o +configfile.mod: pre-configfile.o mod-configfile.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configfile.o -rm -f $@ @@ -2097,10 +2126,11 @@ endif MOSTLYCLEANFILES += search_mod-commands_search.d UNDSYMFILES += und-search.lst -search.mod: pre-search.o mod-search.o +search.mod: pre-search.o mod-search.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o -rm -f $@ @@ -2153,10 +2183,11 @@ endif MOSTLYCLEANFILES += gzio_mod-io_gzio.d UNDSYMFILES += und-gzio.lst -gzio.mod: pre-gzio.o mod-gzio.o +gzio.mod: pre-gzio.o mod-gzio.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o -rm -f $@ diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 0d97dcd4e..915958c75 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -20,7 +20,7 @@ bin_UTILITIES = grub-mkimage # For grub-mkimage. grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ util/resolve.c -CLEANFILES += grub-mkimage grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o +CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o MOSTLYCLEANFILES += grub_mkimage-util_i386_efi_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o @@ -120,10 +120,11 @@ endif MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d UNDSYMFILES += und-kernel.lst -kernel.mod: pre-kernel.o mod-kernel.o +kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o -rm -f $@ @@ -651,10 +652,11 @@ endif MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d normal_mod-normal_color.d UNDSYMFILES += und-normal.lst -normal.mod: pre-normal.o mod-normal.o +normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o normal_mod-normal_color.o -rm -f $@ @@ -974,10 +976,11 @@ endif MOSTLYCLEANFILES += _chain_mod-loader_efi_chainloader.d UNDSYMFILES += und-_chain.lst -_chain.mod: pre-_chain.o mod-_chain.o +_chain.mod: pre-_chain.o mod-_chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_chain.o mod-_chain.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o -rm -f $@ @@ -1030,10 +1033,11 @@ endif MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader_normal.d UNDSYMFILES += und-chain.lst -chain.mod: pre-chain.o mod-chain.o +chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o -rm -f $@ @@ -1086,10 +1090,11 @@ endif MOSTLYCLEANFILES += appleldr_mod-loader_efi_appleloader.d UNDSYMFILES += und-appleldr.lst -appleldr.mod: pre-appleldr.o mod-appleldr.o +appleldr.mod: pre-appleldr.o mod-appleldr.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader.o -rm -f $@ @@ -1142,10 +1147,11 @@ endif MOSTLYCLEANFILES += _linux_mod-loader_i386_efi_linux.d UNDSYMFILES += und-_linux.lst -_linux.mod: pre-_linux.o mod-_linux.o +_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o -rm -f $@ @@ -1198,10 +1204,11 @@ endif MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux_normal.d UNDSYMFILES += und-linux.lst -linux.mod: pre-linux.o mod-linux.o +linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux_normal.o -rm -f $@ @@ -1254,10 +1261,11 @@ endif MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d UNDSYMFILES += und-cpuid.lst -cpuid.mod: pre-cpuid.o mod-cpuid.o +cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o -rm -f $@ @@ -1310,10 +1318,11 @@ endif MOSTLYCLEANFILES += halt_mod-commands_halt.d UNDSYMFILES += und-halt.lst -halt.mod: pre-halt.o mod-halt.o +halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o -rm -f $@ @@ -1366,10 +1375,11 @@ endif MOSTLYCLEANFILES += reboot_mod-commands_reboot.d UNDSYMFILES += und-reboot.lst -reboot.mod: pre-reboot.o mod-reboot.o +reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o -rm -f $@ @@ -1422,10 +1432,11 @@ endif MOSTLYCLEANFILES += pci_mod-bus_pci.d UNDSYMFILES += und-pci.lst -pci.mod: pre-pci.o mod-pci.o +pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o -rm -f $@ @@ -1478,10 +1489,11 @@ endif MOSTLYCLEANFILES += lspci_mod-commands_lspci.d UNDSYMFILES += und-lspci.lst -lspci.mod: pre-lspci.o mod-lspci.o +lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o -rm -f $@ diff --git a/configure b/configure index 046c23e13..f54b43116 100644 --- a/configure +++ b/configure @@ -687,6 +687,9 @@ GREP EGREP LIBLZO enable_lzo +TARGET_IMG_LDSCRIPT +TARGET_IMG_LDFLAGS +TARGET_OBJ2ELF TARGET_CC ac_ct_TARGET_CC OBJCOPY @@ -5877,6 +5880,34 @@ done # Check for target programs. # + +# Use linker script if present, otherwise use builtin -N script. +{ echo "$as_me:$LINENO: checking for option to link raw image" >&5 +echo $ECHO_N "checking for option to link raw image... $ECHO_C" >&6; } +if test -f "${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc"; then + TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" + TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" + TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" +else + TARGET_IMG_LDSCRIPT= + TARGET_IMG_LDFLAGS='-Wl,-N' + TARGET_IMG_LDFLAGS_AC='-Wl,-N' +fi + + +{ echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 +echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } + +# For platforms where ELF is not the default link format. +{ echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 +echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } +if test "$host_os" = cygwin; then + TARGET_OBJ2ELF='grub-pe2elf.exe' +fi + +{ echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 +echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } + # For cross-compiling. if test "x$target" != "x$host"; then # XXX this depends on the implementation of autoconf! @@ -6759,6 +6790,30 @@ if test "x$ssp_possible" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" fi +# Smashing stack arg probe. +sap_possible=yes +{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-mstack-arg-probe'... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +void foo (void) { volatile char a[8]; a[3]; } +_ACEOF +if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? + rm -f conftest.s +else + sap_possible=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + +# Cygwin's GCC uses alloca() to probe the stackframe on static +# stack allocations above some threshold. +if test x"$sap_possible" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" +fi + @@ -6856,7 +6911,7 @@ echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} fi grub_cv_prog_objcopy_absolute=yes for link_addr in 2000 8000 7C00; do - if { ac_try='${CC-cc} ${CFLAGS} ${LDFLAGS} -nostdlib -Wl,-N -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec' + if { ac_try='${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? @@ -7013,6 +7068,11 @@ fi echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } if test "x$target_cpu" = xi386; then + if test ! -z "$TARGET_IMG_LDSCRIPT"; then + # Check symbols provided by linker script. + CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" + fi + if test "x$target_platform" = xpc; then { echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6; } @@ -7456,6 +7516,8 @@ echo "$as_me: error: neither end nor _end is defined" >&2;} { (exit 1); exit 1; }; } fi + fi + CFLAGS="$TARGET_CFLAGS" { echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } @@ -9006,6 +9068,9 @@ GREP!$GREP$ac_delim EGREP!$EGREP$ac_delim LIBLZO!$LIBLZO$ac_delim enable_lzo!$enable_lzo$ac_delim +TARGET_IMG_LDSCRIPT!$TARGET_IMG_LDSCRIPT$ac_delim +TARGET_IMG_LDFLAGS!$TARGET_IMG_LDFLAGS$ac_delim +TARGET_OBJ2ELF!$TARGET_OBJ2ELF$ac_delim TARGET_CC!$TARGET_CC$ac_delim ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim OBJCOPY!$OBJCOPY$ac_delim @@ -9022,7 +9087,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 86; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 1d8bd08f0..a5868c3b2 100644 --- a/configure.ac +++ b/configure.ac @@ -188,6 +188,30 @@ AC_CHECK_FUNCS(posix_memalign memalign) # Check for target programs. # + +# Use linker script if present, otherwise use builtin -N script. +AC_MSG_CHECKING([for option to link raw image]) +if test -f "${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc"; then + TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" + TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" + TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" +else + TARGET_IMG_LDSCRIPT= + TARGET_IMG_LDFLAGS='-Wl,-N' + TARGET_IMG_LDFLAGS_AC='-Wl,-N' +fi +AC_SUBST(TARGET_IMG_LDSCRIPT) +AC_SUBST(TARGET_IMG_LDFLAGS) +AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) + +# For platforms where ELF is not the default link format. +AC_MSG_CHECKING([for command to convert module to ELF format]) +if test "$host_os" = cygwin; then + TARGET_OBJ2ELF='grub-pe2elf.exe' +fi +AC_SUBST(TARGET_OBJ2ELF) +AC_MSG_RESULT([$TARGET_OBJ2ELF]) + # For cross-compiling. if test "x$target" != "x$host"; then # XXX this depends on the implementation of autoconf! @@ -278,6 +302,12 @@ grub_CHECK_STACK_PROTECTOR if test "x$ssp_possible" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" fi +grub_CHECK_STACK_ARG_PROBE +# Cygwin's GCC uses alloca() to probe the stackframe on static +# stack allocations above some threshold. +if test x"$sap_possible" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" +fi AC_SUBST(TARGET_CFLAGS) AC_SUBST(TARGET_CPPFLAGS) @@ -296,9 +326,16 @@ grub_PROG_OBJCOPY_ABSOLUTE grub_PROG_LD_BUILD_ID_NONE grub_ASM_USCORE if test "x$target_cpu" = xi386; then - grub_CHECK_START_SYMBOL - grub_CHECK_BSS_START_SYMBOL - grub_CHECK_END_SYMBOL + if test ! -z "$TARGET_IMG_LDSCRIPT"; then + # Check symbols provided by linker script. + CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" + fi + if test "x$target_platform" = xpc; then + grub_CHECK_START_SYMBOL + grub_CHECK_BSS_START_SYMBOL + grub_CHECK_END_SYMBOL + fi + CFLAGS="$TARGET_CFLAGS" grub_I386_ASM_PREFIX_REQUIREMENT grub_I386_ASM_ADDR32 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK diff --git a/genkernsyms.sh.in b/genkernsyms.sh.in index a5e1271a5..0df0bbfe9 100644 --- a/genkernsyms.sh.in +++ b/genkernsyms.sh.in @@ -16,9 +16,12 @@ : ${srcdir=@srcdir@} : ${CC=@CC@} +u= +grep "^#define HAVE_ASM_USCORE" config.h >/dev/null 2>&1 && u="_" + $CC -DGRUB_SYMBOL_GENERATOR=1 -E -I. -Iinclude -I"$srcdir/include" $* \ | grep -v '^#' \ | sed -n \ - -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' \ - -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/\1 kernel/;p;}' \ + -e '/EXPORT_FUNC *([a-zA-Z0-9_]*)/{s/.*EXPORT_FUNC *(\([a-zA-Z0-9_]*\)).*/'"$u"'\1 kernel/;p;}' \ + -e '/EXPORT_VAR *([a-zA-Z0-9_]*)/{s/.*EXPORT_VAR *(\([a-zA-Z0-9_]*\)).*/'"$u"'\1 kernel/;p;}' \ | sort -u diff --git a/genmk.rb b/genmk.rb index 56dee5c93..cb0a67501 100644 --- a/genmk.rb +++ b/genmk.rb @@ -112,10 +112,11 @@ endif MOSTLYCLEANFILES += #{deps_str} UNDSYMFILES += #{undsym} -#{@name}: #{pre_obj} #{mod_obj} +#{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ $^ - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -R .note -R .comment $@ + $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj} + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ #{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str} -rm -f $@ @@ -194,7 +195,7 @@ class Utility deps = objs.collect {|obj| obj.suffix('d')} deps_str = deps.join(' '); - "CLEANFILES += #{@name} #{objs_str} + "CLEANFILES += #{@name}$(EXEEXT) #{objs_str} MOSTLYCLEANFILES += #{deps_str} #{@name}: $(#{prefix}_DEPENDENCIES) #{objs_str} diff --git a/include/grub/dl.h b/include/grub/dl.h index b630c6fcd..bdde089d1 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -41,10 +41,10 @@ static void \ grub_mod_fini (void) #define GRUB_MOD_NAME(name) \ -__asm__ (".section .modname,\"S\"\n.string \"" #name "\"\n.previous") +__asm__ (".section .modname\n.string \"" #name "\"\n") #define GRUB_MOD_DEP(name) \ -__asm__ (".section .moddeps,\"S\"\n.string \"" #name "\"\n.previous") +__asm__ (".section .moddeps\n.string \"" #name "\"\n") struct grub_dl_segment { diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h index c36d85991..6cfdeefbb 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -194,6 +194,18 @@ struct grub_pe32_section_table #define GRUB_PE32_SCN_MEM_READ 0x40000000 #define GRUB_PE32_SCN_MEM_WRITE 0x80000000 +#define GRUB_PE32_SCN_ALIGN_1BYTES 0x00100000 +#define GRUB_PE32_SCN_ALIGN_2BYTES 0x00200000 +#define GRUB_PE32_SCN_ALIGN_4BYTES 0x00300000 +#define GRUB_PE32_SCN_ALIGN_8BYTES 0x00400000 +#define GRUB_PE32_SCN_ALIGN_16BYTES 0x00500000 +#define GRUB_PE32_SCN_ALIGN_32BYTES 0x00600000 +#define GRUB_PE32_SCN_ALIGN_64BYTES 0x00700000 + +#define GRUB_PE32_SCN_ALIGN_SHIFT 20 +#define GRUB_PE32_SCN_ALIGN_MASK 7 + + struct grub_pe32_header { /* This should be filled in with GRUB_PE32_MSDOS_STUB. */ @@ -221,4 +233,35 @@ struct grub_pe32_fixup_block #define GRUB_PE32_REL_BASED_ABSOLUTE 0 #define GRUB_PE32_REL_BASED_HIGHLOW 3 +struct grub_pe32_symbol +{ + union + { + char short_name[8]; + grub_uint32_t long_name[2]; + }; + + grub_uint32_t value; + grub_uint16_t section; + grub_uint16_t type; + grub_uint8_t storage_class; + grub_uint8_t num_aux; +} __attribute__ ((packed)); + +#define GRUB_PE32_SYM_CLASS_EXTERNAL 2 +#define GRUB_PE32_SYM_CLASS_STATIC 3 +#define GRUB_PE32_SYM_CLASS_FILE 0x67 + +#define GRUB_PE32_DT_FUNCTION 0x20 + +struct grub_pe32_reloc +{ + grub_uint32_t offset; + grub_uint32_t symtab_index; + grub_uint16_t type; +} __attribute__ ((packed)); + +#define GRUB_PE32_REL_I386_DIR32 0x6 +#define GRUB_PE32_REL_I386_REL32 0x14 + #endif /* ! GRUB_EFI_PE32_HEADER */ diff --git a/include/grub/symbol.h b/include/grub/symbol.h index aa0ea5a36..e95149055 100644 --- a/include/grub/symbol.h +++ b/include/grub/symbol.h @@ -28,8 +28,14 @@ # define EXT_C(sym) sym #endif +#ifndef __CYGWIN__ #define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), "function" ; EXT_C(x): #define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), "object" ; EXT_C(x): +#else +/* .type not supported for non-ELF targets. XXX: Check this in configure? */ +#define FUNCTION(x) .globl EXT_C(x) ; .def EXT_C(x); .scl 2; .type 32; .endef; EXT_C(x): +#define VARIABLE(x) .globl EXT_C(x) ; .def EXT_C(x); .scl 2; .type 0; .endef; EXT_C(x): +#endif /* Mark an exported symbol. */ #ifndef GRUB_SYMBOL_GENERATOR diff --git a/kern/dl.c b/kern/dl.c index c0d9f1d03..b483134a8 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -454,7 +454,7 @@ grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e) const char *name = (char *) e + s->sh_offset; const char *max = name + s->sh_size; - while (name < max) + while ((name < max) && (*name)) { grub_dl_t m; grub_dl_dep_t dep; diff --git a/util/grub-pe2elf.c b/util/grub-pe2elf.c new file mode 100644 index 000000000..d703d33c3 --- /dev/null +++ b/util/grub-pe2elf.c @@ -0,0 +1,514 @@ +/* grub-pe2elf.c - tool to convert pe image to elf. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +#include +#include +#include +#include +#include + +static struct option options[] = { + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"verbose", no_argument, 0, 'v'}, + {0, 0, 0, 0} +}; + +static void +usage (int status) +{ + if (status) + fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n"); + else + printf ("\ +Usage: grub-editenv [OPTIONS] input [output]\n\ +\n\ +Tool to convert pe image to elf.\n\ +\nOptions:\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ +\n\ +Report bugs to <%s>.\n", PACKAGE_BUGREPORT); + + exit (status); +} + +/* + * Section layout + * + * null + * .text + * .rdata + * .data + * .bss + * .modname + * .moddeps + * .symtab + * .strtab + * relocation sections + */ + +#define TEXT_SECTION 1 +#define RDATA_SECTION 2 +#define DATA_SECTION 3 +#define BSS_SECTION 4 +#define MODNAME_SECTION 5 +#define MODDEPS_SECTION 6 +#define SYMTAB_SECTION 7 +#define STRTAB_SECTION 8 + +#define REL_SECTION 9 +#define MAX_SECTIONS 12 + +#define STRTAB_BLOCK 256 + +static char *strtab; +static int strtab_max, strtab_len; + +Elf32_Ehdr ehdr; +Elf32_Shdr shdr[MAX_SECTIONS]; +int num_sections; +grub_uint32_t offset; + +static int +insert_string (char *name) +{ + int len, result; + + if (*name == '_') + name++; + + len = strlen (name); + if (strtab_len + len >= strtab_max) + { + strtab_max += STRTAB_BLOCK; + strtab = xrealloc (strtab, strtab_max); + } + + strcpy (strtab + strtab_len, name); + result = strtab_len; + strtab_len += len + 1; + + return result; +} + +static int * +write_section_data (FILE* fp, char *image, + struct grub_pe32_coff_header *pe_chdr, + struct grub_pe32_section_table *pe_shdr) +{ + int *section_map; + int i; + + section_map = xmalloc ((pe_chdr->num_sections + 1) * sizeof (int)); + section_map[0] = 0; + + for (i = 0; i < pe_chdr->num_sections; i++, pe_shdr++) + { + grub_uint32_t idx; + + if (! strcmp (pe_shdr->name, ".text")) + { + idx = TEXT_SECTION; + shdr[idx].sh_flags = SHF_ALLOC | SHF_EXECINSTR; + } + else if (! strcmp (pe_shdr->name, ".rdata")) + { + idx = RDATA_SECTION; + shdr[idx].sh_flags = SHF_ALLOC; + } + else if (! strcmp (pe_shdr->name, ".data")) + { + idx = DATA_SECTION; + shdr[idx].sh_flags = SHF_ALLOC | SHF_WRITE; + } + else if (! strcmp (pe_shdr->name, ".bss")) + { + idx = BSS_SECTION; + shdr[idx].sh_flags = SHF_ALLOC | SHF_WRITE; + } + else if (! strcmp (pe_shdr->name, ".modname")) + idx = MODNAME_SECTION; + else if (! strcmp (pe_shdr->name, ".moddeps")) + idx = MODDEPS_SECTION; + else + { + section_map[i + 1] = -1; + continue; + } + + section_map[i + 1] = idx; + + shdr[idx].sh_type = (idx == BSS_SECTION) ? SHT_NOBITS : SHT_PROGBITS; + shdr[idx].sh_size = pe_shdr->raw_data_size; + shdr[idx].sh_addralign = 1 << (((pe_shdr->characteristics >> + GRUB_PE32_SCN_ALIGN_SHIFT) & + GRUB_PE32_SCN_ALIGN_MASK) - 1); + + if (idx != BSS_SECTION) + { + shdr[idx].sh_offset = offset; + grub_util_write_image_at (image + pe_shdr->raw_data_offset, + pe_shdr->raw_data_size, offset, fp); + + offset += pe_shdr->raw_data_size; + } + + if (pe_shdr->relocations_offset) + { + char name[5 + strlen (pe_shdr->name)]; + + if (num_sections >= MAX_SECTIONS) + grub_util_error ("Too many sections"); + + sprintf (name, ".rel%s", pe_shdr->name); + + shdr[num_sections].sh_name = insert_string (name); + shdr[num_sections].sh_link = i; + shdr[num_sections].sh_info = idx; + + shdr[idx].sh_name = shdr[num_sections].sh_name + 4; + + num_sections++; + } + else + shdr[idx].sh_name = insert_string (pe_shdr->name); + } + + return section_map; +} + +static void +write_reloc_section (FILE* fp, char *image, + struct grub_pe32_coff_header *pe_chdr, + struct grub_pe32_section_table *pe_shdr, + Elf32_Sym *symtab, + int *symtab_map) +{ + int i; + + for (i = REL_SECTION; i < num_sections; i++) + { + struct grub_pe32_section_table *pe_sec; + struct grub_pe32_reloc *pe_rel; + Elf32_Rel *rel; + int num_rels, j, modified; + + pe_sec = pe_shdr + shdr[i].sh_link; + pe_rel = (struct grub_pe32_reloc *) (image + pe_sec->relocations_offset); + rel = (Elf32_Rel *) xmalloc (pe_sec->num_relocations * sizeof (Elf32_Rel)); + num_rels = 0; + modified = 0; + + for (j = 0; j < pe_sec->num_relocations; j++, pe_rel++) + { + int type; + grub_uint32_t ofs, *addr; + + if ((pe_rel->symtab_index >= pe_chdr->num_symbols) || + (symtab_map[pe_rel->symtab_index] == -1)) + grub_util_error ("Invalid symbol"); + + if (pe_rel->type == GRUB_PE32_REL_I386_DIR32) + type = R_386_32; + else if (pe_rel->type == GRUB_PE32_REL_I386_REL32) + type = R_386_PC32; + else + grub_util_error ("Unknown pe relocation type %d\n", pe_rel->type); + + ofs = pe_rel->offset - pe_sec->virtual_address; + addr = (grub_uint32_t *)(image + pe_sec->raw_data_offset + ofs); + if (type == R_386_PC32) + { + unsigned char code; + + code = image[pe_sec->raw_data_offset + ofs - 1]; + + if (((code != 0xe8) && (code != 0xe9)) || (*addr)) + grub_util_error ("Invalid relocation (%x %x)", code, *addr); + + modified = 1; + if (symtab[symtab_map[pe_rel->symtab_index]].st_shndx) + { + if (symtab[symtab_map[pe_rel->symtab_index]].st_shndx + != shdr[i].sh_info) + grub_util_error ("Cross section call is not allowed"); + + *addr = (symtab[symtab_map[pe_rel->symtab_index]].st_value + - ofs - 4); + + continue; + } + else + *addr = -4; + } + + rel[num_rels].r_offset = ofs; + rel[num_rels].r_info = ELF32_R_INFO (symtab_map[pe_rel->symtab_index], + type); + num_rels++; + } + + if (modified) + grub_util_write_image_at (image + pe_sec->raw_data_offset, + shdr[shdr[i].sh_info].sh_size, + shdr[shdr[i].sh_info].sh_offset, + fp); + + shdr[i].sh_type = SHT_REL; + shdr[i].sh_offset = offset; + shdr[i].sh_link = SYMTAB_SECTION; + shdr[i].sh_addralign = 4; + shdr[i].sh_entsize = sizeof (Elf32_Rel); + shdr[i].sh_size = num_rels * sizeof (Elf32_Rel); + + grub_util_write_image_at (rel, shdr[i].sh_size, offset, fp); + offset += shdr[i].sh_size; + free (rel); + } +} + +static void +write_symbol_table (FILE* fp, char *image, + struct grub_pe32_coff_header *pe_chdr, + struct grub_pe32_section_table *pe_shdr, + int *section_map) +{ + struct grub_pe32_symbol *pe_symtab; + char *pe_strtab; + Elf32_Sym *symtab; + int *symtab_map, num_syms; + int i; + + pe_symtab = (struct grub_pe32_symbol *) (image + pe_chdr->symtab_offset); + pe_strtab = (char *) (pe_symtab + pe_chdr->num_symbols); + + symtab = (Elf32_Sym *) xmalloc ((pe_chdr->num_symbols + 1) * + sizeof (Elf32_Sym)); + memset (symtab, 0, (pe_chdr->num_symbols + 1) * sizeof (Elf32_Sym)); + num_syms = 1; + + symtab_map = (int *) xmalloc (pe_chdr->num_symbols * sizeof (int)); + + for (i = 0; i < (int) pe_chdr->num_symbols; + i += pe_symtab->num_aux + 1, pe_symtab += pe_symtab->num_aux + 1) + { + int bind, type; + + symtab_map[i] = -1; + if ((pe_symtab->section > pe_chdr->num_sections) || + (section_map[pe_symtab->section] == -1)) + continue; + + if (! pe_symtab->section) + type = STT_NOTYPE; + else if (pe_symtab->type == GRUB_PE32_DT_FUNCTION) + type = STT_FUNC; + else + type = STT_OBJECT; + + if (pe_symtab->storage_class == GRUB_PE32_SYM_CLASS_EXTERNAL) + bind = STB_GLOBAL; + else + bind = STB_LOCAL; + + if ((type != STT_FUNC) && (pe_symtab->num_aux)) + { + if (! pe_symtab->value) + type = STT_SECTION; + + symtab[num_syms].st_name = shdr[section_map[pe_symtab->section]].sh_name; + } + else + { + char *name; + + name = ((pe_symtab->long_name[0]) ? pe_symtab->short_name : + pe_strtab + pe_symtab->long_name[1]); + + if ((strcmp (name, "_grub_mod_init")) && + (strcmp (name, "_grub_mod_fini")) && + (bind == STB_LOCAL)) + continue; + + symtab[num_syms].st_name = insert_string (name); + } + + symtab[num_syms].st_shndx = section_map[pe_symtab->section]; + symtab[num_syms].st_value = pe_symtab->value; + symtab[num_syms].st_info = ELF32_ST_INFO (bind, type); + + symtab_map[i] = num_syms; + num_syms++; + } + + write_reloc_section (fp, image, pe_chdr, pe_shdr, symtab, symtab_map); + + shdr[SYMTAB_SECTION].sh_name = insert_string (".symtab"); + shdr[SYMTAB_SECTION].sh_type = SHT_SYMTAB; + shdr[SYMTAB_SECTION].sh_offset = offset; + shdr[SYMTAB_SECTION].sh_size = num_syms * sizeof (Elf32_Sym); + shdr[SYMTAB_SECTION].sh_entsize = sizeof (Elf32_Sym); + shdr[SYMTAB_SECTION].sh_link = STRTAB_SECTION; + shdr[SYMTAB_SECTION].sh_addralign = 4; + + grub_util_write_image_at (symtab, shdr[SYMTAB_SECTION].sh_size, + offset, fp); + offset += shdr[SYMTAB_SECTION].sh_size; + + free (symtab); + free (symtab_map); +} + +static void +write_string_table (FILE* fp) +{ + shdr[STRTAB_SECTION].sh_name = insert_string (".strtab"); + shdr[STRTAB_SECTION].sh_type = SHT_STRTAB; + shdr[STRTAB_SECTION].sh_offset = offset; + shdr[STRTAB_SECTION].sh_size = strtab_len; + shdr[STRTAB_SECTION].sh_addralign = 1; + grub_util_write_image_at (strtab, strtab_len, offset, fp); + offset += strtab_len; + + free (strtab); +} + +static void +write_section_header (FILE* fp) +{ + ehdr.e_ident[EI_MAG0] = ELFMAG0; + ehdr.e_ident[EI_MAG1] = ELFMAG1; + ehdr.e_ident[EI_MAG2] = ELFMAG2; + ehdr.e_ident[EI_MAG3] = ELFMAG3; + ehdr.e_ident[EI_VERSION] = EV_CURRENT; + ehdr.e_version = EV_CURRENT; + ehdr.e_type = ET_REL; + + ehdr.e_ident[EI_CLASS] = ELFCLASS32; + ehdr.e_ident[EI_DATA] = ELFDATA2LSB; + ehdr.e_machine = EM_386; + + ehdr.e_ehsize = sizeof (ehdr); + ehdr.e_shentsize = sizeof (Elf32_Shdr); + ehdr.e_shstrndx = STRTAB_SECTION; + + ehdr.e_shoff = offset; + ehdr.e_shnum = num_sections; + grub_util_write_image_at (&shdr, sizeof (Elf32_Shdr) * num_sections, + offset, fp); + + grub_util_write_image_at (&ehdr, sizeof (Elf32_Ehdr), 0, fp); +} + +static void +convert_pe (FILE* fp, char *image) +{ + struct grub_pe32_coff_header *pe_chdr; + struct grub_pe32_section_table *pe_shdr; + int *section_map; + + pe_chdr = (struct grub_pe32_coff_header *) image; + if (grub_le_to_cpu16 (pe_chdr->machine) != GRUB_PE32_MACHINE_I386) + grub_util_error ("Invalid coff image"); + + strtab = xmalloc (STRTAB_BLOCK); + strtab_max = STRTAB_BLOCK; + strtab[0] = 0; + strtab_len = 1; + + offset = sizeof (ehdr); + pe_shdr = (struct grub_pe32_section_table *) (pe_chdr + 1); + num_sections = REL_SECTION; + + section_map = write_section_data (fp, image, pe_chdr, pe_shdr); + + write_symbol_table (fp, image, pe_chdr, pe_shdr, section_map); + free (section_map); + + write_string_table (fp); + + write_section_header (fp); +} + +int +main (int argc, char *argv[]) +{ + char *image; + FILE* fp; + + progname = "grub-pe2elf"; + + /* Check for options. */ + while (1) + { + int c = getopt_long (argc, argv, "hVv", options, 0); + + if (c == -1) + break; + else + switch (c) + { + case 'h': + usage (0); + break; + + case 'V': + printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); + return 0; + + case 'v': + verbosity++; + break; + + default: + usage (1); + break; + } + } + + /* Obtain PATH. */ + if (optind >= argc) + { + fprintf (stderr, "Filename not specified.\n"); + usage (1); + } + + image = grub_util_read_image (argv[optind]); + + if (optind + 1 < argc) + optind++; + + fp = fopen (argv[optind], "wb"); + if (! fp) + grub_util_error ("cannot open %s", argv[optind]); + + convert_pe (fp, image); + + fclose (fp); + + return 0; +} From 42290e17c568d5f9bdf1e90136df0240a5f2011e Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 24 Jul 2008 15:02:36 +0000 Subject: [PATCH 0271/1707] 2008-07-24 Bean * video/reader/png.c (DELFATE_HLIT_MAX): Change value. (grub_png_init_fixed_block): New function. (grub_png_decode_image_data): Handle fixed huffman code compression. --- ChangeLog | 6 ++++++ video/readers/png.c | 42 +++++++++++++++++++++++++++++++++++++++--- 2 files changed, 45 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 155843fbe..4665a96c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-24 Bean + + * video/reader/png.c (DELFATE_HLIT_MAX): Change value. + (grub_png_init_fixed_block): New function. + (grub_png_decode_image_data): Handle fixed huffman code compression. + 2008-07-24 Bean * common.rmk (bin_UTILITIES): Add grub-pe2elf. diff --git a/video/readers/png.c b/video/readers/png.c index 608fa5e4a..9dac4b64c 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -68,7 +68,7 @@ #define DEFLATE_HCLEN_BASE 4 #define DEFLATE_HCLEN_MAX 19 #define DEFLATE_HLIT_BASE 257 -#define DEFLATE_HLIT_MAX 286 +#define DEFLATE_HLIT_MAX 288 #define DEFLATE_HDIST_BASE 1 #define DEFLATE_HDIST_MAX 30 @@ -390,6 +390,41 @@ grub_png_get_huff_code (struct grub_png_data *data, struct huff_table *ht) return 0; } +static grub_err_t +grub_png_init_fixed_block (struct grub_png_data *data) +{ + int i; + + grub_png_init_huff_table (&data->code_table, DEFLATE_HUFF_LEN, + data->code_values, data->code_maxval, + data->code_offset); + + for (i = 0; i < 144; i++) + grub_png_insert_huff_item (&data->code_table, i, 8); + + for (; i < 256; i++) + grub_png_insert_huff_item (&data->code_table, i, 9); + + for (; i < 280; i++) + grub_png_insert_huff_item (&data->code_table, i, 7); + + for (; i < DEFLATE_HLIT_MAX; i++) + grub_png_insert_huff_item (&data->code_table, i, 8); + + grub_png_build_huff_table (&data->code_table); + + grub_png_init_huff_table (&data->dist_table, DEFLATE_HUFF_LEN, + data->dist_values, data->dist_maxval, + data->dist_offset); + + for (i = 0; i < DEFLATE_HDIST_MAX; i++) + grub_png_insert_huff_item (&data->dist_table, i, 5); + + grub_png_build_huff_table (&data->dist_table); + + return grub_errno; +} + static grub_err_t grub_png_init_dynamic_block (struct grub_png_data *data) { @@ -699,8 +734,9 @@ grub_png_decode_image_data (struct grub_png_data *data) } case INFLATE_FIXED: - return grub_error (GRUB_ERR_BAD_FILE_TYPE, - "png: block type fixed not supported"); + grub_png_init_fixed_block (data); + grub_png_read_dynamic_block (data); + break; case INFLATE_DYNAMIC: grub_png_init_dynamic_block (data); From 7810e74787fe94a531d75007eb11cdb111bca830 Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 24 Jul 2008 18:14:41 +0000 Subject: [PATCH 0272/1707] 2008-07-24 Bean * configure.ac: Fixed a bug caused by the previous cygwin patch, variable `target_platform' should be `platform'. --- ChangeLog | 5 +++++ configure | 2 +- configure.ac | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4665a96c0..f014086e1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-24 Bean + + * configure.ac: Fixed a bug caused by the previous cygwin patch, + variable `target_platform' should be `platform'. + 2008-07-24 Bean * video/reader/png.c (DELFATE_HLIT_MAX): Change value. diff --git a/configure b/configure index f54b43116..69509d603 100644 --- a/configure +++ b/configure @@ -7072,7 +7072,7 @@ if test "x$target_cpu" = xi386; then # Check symbols provided by linker script. CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" fi - if test "x$target_platform" = xpc; then + if test "x$platform" = xpc; then { echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6; } diff --git a/configure.ac b/configure.ac index a5868c3b2..7a5938a38 100644 --- a/configure.ac +++ b/configure.ac @@ -330,7 +330,7 @@ if test "x$target_cpu" = xi386; then # Check symbols provided by linker script. CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" fi - if test "x$target_platform" = xpc; then + if test "x$platform" = xpc; then grub_CHECK_START_SYMBOL grub_CHECK_BSS_START_SYMBOL grub_CHECK_END_SYMBOL From 3a0fa256ac9fec79faa285b531d40c7c20cacc6c Mon Sep 17 00:00:00 2001 From: chrfranke Date: Thu, 24 Jul 2008 19:02:47 +0000 Subject: [PATCH 0273/1707] 2008-07-24 Christian Franke * util/i386/pc/grub-install.in: If `--debug' is specified, pass `--verbose' to grub-setup. Abort script if make_system_path_relative_to_its_root() fails. --- ChangeLog | 6 ++++++ util/i386/pc/grub-install.in | 10 ++++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index f014086e1..5061899a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-24 Christian Franke + + * util/i386/pc/grub-install.in: If `--debug' is specified, + pass `--verbose' to grub-setup. + Abort script if make_system_path_relative_to_its_root() fails. + 2008-07-24 Bean * configure.ac: Fixed a bug caused by the previous cygwin patch, diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 1b2bccbb8..d7966d595 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -127,8 +127,10 @@ if test "x$install_device" = x; then fi # If the debugging feature is enabled, print commands. +setup_verbose= if test $debug = yes; then set -x + setup_verbose="--verbose" fi # Initialize these directories here, since ROOTDIR was initialized. @@ -240,12 +242,12 @@ fi # The order in this list is critical. Be careful when modifying it. modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module" -$grub_mkimage --output=${grubdir}/core.img \ - --prefix=${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`/ \ - $modules || exit 1 +grub_prefix="${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`" || exit 1 + +$grub_mkimage --output=${grubdir}/core.img --prefix=${grub_prefix}/ $modules || exit 1 # Now perform the installation. -$grub_setup --directory=${grubdir} --device-map=${device_map} \ +$grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} \ ${install_device} || exit 1 # Prompt the user to check if the device map is correct. From 6af9849fbd0e37ca912f654d44a1a7dd38db4144 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Thu, 24 Jul 2008 19:40:05 +0000 Subject: [PATCH 0274/1707] Remove trailing whitespace. --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5061899a9..33600bb36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,5 @@ -2008-07-24 Christian Franke - +2008-07-24 Christian Franke + * util/i386/pc/grub-install.in: If `--debug' is specified, pass `--verbose' to grub-setup. Abort script if make_system_path_relative_to_its_root() fails. From 01453bfcd7aa74c4b16a271734f40a4980a99678 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 24 Jul 2008 23:36:13 +0000 Subject: [PATCH 0275/1707] 2008-07-24 Pavel Roskin * include/grub/types.h: Use __builtin_bswap32() and __builtin_bswap64() with gcc 4.3 and newer. --- ChangeLog | 5 +++++ include/grub/types.h | 12 ++++++++++++ 2 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 33600bb36..cfcdb0759 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-24 Pavel Roskin + + * include/grub/types.h: Use __builtin_bswap32() and + __builtin_bswap64() with gcc 4.3 and newer. + 2008-07-24 Christian Franke * util/i386/pc/grub-install.in: If `--debug' is specified, diff --git a/include/grub/types.h b/include/grub/types.h index c51652ff0..d2044292d 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -111,6 +111,17 @@ typedef grub_uint64_t grub_disk_addr_t; (grub_uint16_t) ((_x << 8) | (_x >> 8)); \ }) +#if defined(__GNUC__) && (__GNUC__ > 3) && (__GNUC__ > 4 || __GNUC_MINOR__ >= 3) +static inline grub_uint32_t grub_swap_bytes32(grub_uint32_t x) +{ + return __builtin_bswap32(x); +} + +static inline grub_uint64_t grub_swap_bytes64(grub_uint64_t x) +{ + return __builtin_bswap64(x); +} +#else /* not gcc 4.3 or newer */ #define grub_swap_bytes32(x) \ ({ \ grub_uint32_t _x = (x); \ @@ -132,6 +143,7 @@ typedef grub_uint64_t grub_disk_addr_t; | ((_x & (grub_uint64_t) 0xFF000000000000ULL) >> 40) \ | (_x >> 56)); \ }) +#endif /* not gcc 4.3 or newer */ #ifdef GRUB_CPU_WORDS_BIGENDIAN # define grub_cpu_to_le16(x) grub_swap_bytes16(x) From 51cc519338894b9b7454948d60534b271a531901 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 24 Jul 2008 23:37:22 +0000 Subject: [PATCH 0276/1707] Typo fix --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cfcdb0759..12a4027bb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -16,7 +16,7 @@ 2008-07-24 Bean - * video/reader/png.c (DELFATE_HLIT_MAX): Change value. + * video/reader/png.c (DEFLATE_HLIT_MAX): Change value. (grub_png_init_fixed_block): New function. (grub_png_decode_image_data): Handle fixed huffman code compression. From 9051607e1e79f8a0b391b36539ceb7c0c08d06e6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 25 Jul 2008 19:05:06 +0000 Subject: [PATCH 0277/1707] 2008-07-25 Robert Millan * util/getroot.c (find_root_device): Skip devices that match /dev/dm-[0-9]. This lets the real device be found for any type of abstraction (LVM, EVMS, RAID..). (grub_guess_root_device): Do not traverse /dev/mapper (for LVM) and /dev/evms (for EVMS) before traversing /dev. If a /dev/dm-[0-9] device is found first, find_root_device() will now skip it. --- ChangeLog | 9 +++++++++ util/getroot.c | 25 +++++++++++-------------- 2 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12a4027bb..09e2225c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-07-25 Robert Millan + + * util/getroot.c (find_root_device): Skip devices that match + /dev/dm-[0-9]. This lets the real device be found for any type of + abstraction (LVM, EVMS, RAID..). + (grub_guess_root_device): Do not traverse /dev/mapper (for LVM) + and /dev/evms (for EVMS) before traversing /dev. If a /dev/dm-[0-9] + device is found first, find_root_device() will now skip it. + 2008-07-24 Pavel Roskin * include/grub/types.h: Use __builtin_bswap32() and diff --git a/util/getroot.c b/util/getroot.c index 1202a5c8b..744d5effd 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -229,6 +229,17 @@ find_root_device (const char *dir, dev_t dev) if (S_ISBLK (st.st_mode) && st.st_rdev == dev) { +#ifdef __linux__ + /* Skip useless device names like /dev/dm-0, which prevent us from + finding /dev/mapper/*, /dev/evms/*, /dev/md*, etc. */ + if (ent->d_name[0] == 'd' && + ent->d_name[1] == 'm' && + ent->d_name[2] == '-' && + ent->d_name[3] >= '0' && + ent->d_name[3] <= '9') + continue; +#endif + /* Found! */ char *res; char *cwd; @@ -358,20 +369,6 @@ grub_guess_root_device (const char *dir) if (stat (dir, &st) < 0) grub_util_error ("Cannot stat `%s'", dir); -#ifdef __linux__ - /* We first try to find the device in the /dev/mapper directory. If - we don't do this, we get useless device names like /dev/dm-0 for - LVM. */ - os_dev = find_root_device ("/dev/mapper", st.st_dev); - if (os_dev) - return os_dev; - - /* The same applies to /dev/evms directory (for EVMS volumes). */ - os_dev = find_root_device ("/dev/evms", st.st_dev); - if (os_dev) - return os_dev; -#endif - #ifdef __CYGWIN__ /* Cygwin specific function. */ os_dev = find_cygwin_root_device (dir, st.st_dev); From cc349fb3dd8a08cec9014235a9f3beaa37c08fa2 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 27 Jul 2008 05:57:10 +0000 Subject: [PATCH 0278/1707] 2008-07-27 Pavel Roskin * util/getroot.c (find_root_device): Rephrase a comment to avoid spurious warnings about a comment within a comment. --- ChangeLog | 5 +++++ util/getroot.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 09e2225c4..3e0a6eddf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-27 Pavel Roskin + + * util/getroot.c (find_root_device): Rephrase a comment to avoid + spurious warnings about a comment within a comment. + 2008-07-25 Robert Millan * util/getroot.c (find_root_device): Skip devices that match diff --git a/util/getroot.c b/util/getroot.c index 744d5effd..c8d31ede2 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -230,8 +230,8 @@ find_root_device (const char *dir, dev_t dev) if (S_ISBLK (st.st_mode) && st.st_rdev == dev) { #ifdef __linux__ - /* Skip useless device names like /dev/dm-0, which prevent us from - finding /dev/mapper/*, /dev/evms/*, /dev/md*, etc. */ + /* Skip device names like /dev/dm-0, which are short-hand aliases + to more descriptive device names, e.g. those under /dev/mapper */ if (ent->d_name[0] == 'd' && ent->d_name[1] == 'm' && ent->d_name[2] == '-' && From 8749e9e5246f9db7a48e1dc77c1d08e19d811955 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 27 Jul 2008 13:04:02 +0000 Subject: [PATCH 0279/1707] 2008-07-27 Felix Zielcke * commands/help.c: Include . (TERM_WIDTH): Removed. Updated all users. --- ChangeLog | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3e0a6eddf..071faca95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-27 Felix Zielcke + + * commands/help.c: Include . + (TERM_WIDTH): Removed. Updated all users. + 2008-07-27 Pavel Roskin * util/getroot.c (find_root_device): Rephrase a comment to avoid From a85cd5a0b53799e7e6a2c9eec8d453c864079fb6 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 27 Jul 2008 13:51:30 +0000 Subject: [PATCH 0280/1707] 2008-07-27 Bean * commands/crc.c: New file. * lib/crc.c: Likewise. * include/grub/lib/crc.h: Likewise. * util/grub-fstest.c: grub/hexdump.h => grub/lib/hexdump.h. * commands/hexdump.c: grub/hexdump.h => grub/lib/hexdump.h. (hexdump): Move this function to ... * lib/hexdump.c: ... here. * include/grub/hexdump.h: Renamed to ... * include/grub/lib/hexdump.h: ... this. * commands/loadenv.c: grub/envblk.h => grub/lib/envblk.h * util/grub-editenv.c: Likewise. * include/envblk.h: Renamed to ... * include/lib/envblk.h: ... this. * util/envblk.c: Renamed to ... * lib/envblk.c: ... this. * conf/common.rmk (grub_fstest_SOURCES): commands/hexdump.c => lib/hexdump.c. (grub_editenv_SOURCES): util/envblk.c => lib/envblk.c (pkglib_MODULES): Add crc.mod. (hexdump_mod_SOURCES): Add lib/hexdump.c. (loadenv_mod_SOURCES): util/envblk.c => lib/envblk.c. (crc_mod_SOURCES): New macro. (crc_mod_CFLAGS): Likewise. (crc_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add lib/hexdump.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. --- ChangeLog | 51 +++++++++ commands/crc.c | 66 ++++++++++++ commands/hexdump.c | 48 +-------- commands/loadenv.c | 2 +- conf/common.mk | 175 ++++++++++++++++++++++++------- conf/common.rmk | 15 ++- conf/i386-coreboot.mk | 14 ++- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.mk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.mk | 14 ++- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.mk | 14 ++- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.mk | 14 ++- conf/powerpc-ieee1275.rmk | 2 +- conf/x86_64-efi.mk | 2 +- conf/x86_64-efi.rmk | 2 +- include/grub/lib/crc.h | 25 +++++ include/grub/{ => lib}/envblk.h | 0 include/grub/{ => lib}/hexdump.h | 0 lib/crc.c | 75 +++++++++++++ {util => lib}/envblk.c | 2 +- lib/hexdump.c | 68 ++++++++++++ util/grub-editenv.c | 3 +- util/grub-fstest.c | 2 +- 26 files changed, 479 insertions(+), 125 deletions(-) create mode 100644 commands/crc.c create mode 100644 include/grub/lib/crc.h rename include/grub/{ => lib}/envblk.h (100%) rename include/grub/{ => lib}/hexdump.h (100%) create mode 100644 lib/crc.c rename {util => lib}/envblk.c (99%) create mode 100644 lib/hexdump.c diff --git a/ChangeLog b/ChangeLog index 071faca95..7f094a1bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,54 @@ +2008-07-27 Bean + + * commands/crc.c: New file. + + * lib/crc.c: Likewise. + + * include/grub/lib/crc.h: Likewise. + + * util/grub-fstest.c: grub/hexdump.h => grub/lib/hexdump.h. + + * commands/hexdump.c: grub/hexdump.h => grub/lib/hexdump.h. + (hexdump): Move this function to ... + + * lib/hexdump.c: ... here. + + * include/grub/hexdump.h: Renamed to ... + + * include/grub/lib/hexdump.h: ... this. + + * commands/loadenv.c: grub/envblk.h => grub/lib/envblk.h + + * util/grub-editenv.c: Likewise. + + * include/envblk.h: Renamed to ... + + * include/lib/envblk.h: ... this. + + * util/envblk.c: Renamed to ... + + * lib/envblk.c: ... this. + + * conf/common.rmk (grub_fstest_SOURCES): commands/hexdump.c => + lib/hexdump.c. + (grub_editenv_SOURCES): util/envblk.c => lib/envblk.c + (pkglib_MODULES): Add crc.mod. + (hexdump_mod_SOURCES): Add lib/hexdump.c. + (loadenv_mod_SOURCES): util/envblk.c => lib/envblk.c. + (crc_mod_SOURCES): New macro. + (crc_mod_CFLAGS): Likewise. + (crc_mod_LDFLAGS): Likewise. + + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add lib/hexdump.c. + + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + + * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + 2008-07-27 Felix Zielcke * commands/help.c: Include . diff --git a/commands/crc.c b/commands/crc.c new file mode 100644 index 000000000..514864834 --- /dev/null +++ b/commands/crc.c @@ -0,0 +1,66 @@ +/* crc.c - command to calculate the crc32 checksum of a file */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +static grub_err_t +grub_cmd_crc (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) + +{ + grub_file_t file; + char buf[GRUB_DISK_SECTOR_SIZE]; + grub_ssize_t size; + grub_uint32_t crc; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + file = grub_file_open (args[0]); + if (! file) + return 0; + + crc = 0; + while ((size = grub_file_read (file, buf, sizeof (buf))) > 0) + crc = grub_getcrc32 (crc, buf, size); + + grub_file_close (file); + + grub_printf ("%08x\n", crc); + + return 0; +} + +GRUB_MOD_INIT(crc) +{ + (void) mod; /* To stop warning. */ + grub_register_command ("crc", grub_cmd_crc, GRUB_COMMAND_FLAG_BOTH, + "crc FILE", "Calculate the crc32 checksum of a file.", 0); +} + +GRUB_MOD_FINI(crc) +{ + grub_unregister_command ("crc"); +} diff --git a/commands/hexdump.c b/commands/hexdump.c index c340638a8..5c0ddc08e 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -24,8 +24,8 @@ #include #include #include -#include #include +#include static const struct grub_arg_option options[] = { {"skip", 's', 0, "skip offset bytes from the beginning of file.", 0, @@ -34,52 +34,6 @@ static const struct grub_arg_option options[] = { {0, 0, 0, 0, 0, 0} }; -void -hexdump (unsigned long bse, char *buf, int len) -{ - int pos; - char line[80]; - - while (len > 0) - { - int cnt, i; - - pos = grub_sprintf (line, "%08lx ", bse); - cnt = 16; - if (cnt > len) - cnt = len; - - for (i = 0; i < cnt; i++) - { - pos += grub_sprintf (&line[pos], "%02x ", (unsigned char) buf[i]); - if ((i & 7) == 7) - line[pos++] = ' '; - } - - for (; i < 16; i++) - { - pos += grub_sprintf (&line[pos], " "); - if ((i & 7) == 7) - line[pos++] = ' '; - } - - line[pos++] = '|'; - - for (i = 0; i < cnt; i++) - line[pos++] = ((buf[i] >= 32) && (buf[i] < 127)) ? buf[i] : '.'; - - line[pos++] = '|'; - - line[pos] = 0; - - grub_printf ("%s\n", line); - - bse += 16; - buf += 16; - len -= cnt; - } -} - static grub_err_t grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) { diff --git a/commands/loadenv.c b/commands/loadenv.c index 735968318..4dbf1d93c 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -25,8 +25,8 @@ #include #include #include -#include #include +#include static const struct grub_arg_option options[] = { diff --git a/conf/common.mk b/conf/common.mk index 4e9b3300c..149673f6d 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -180,7 +180,7 @@ util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ - io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ + io/gzio.c lib/hexdump.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ @@ -190,11 +190,11 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-commands_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-lib_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-lib_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-commands_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-lib_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-lib_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -248,9 +248,9 @@ grub_fstest-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-io_gzio.d -grub_fstest-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-commands_hexdump.d +grub_fstest-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-lib_hexdump.d grub_fstest-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -428,20 +428,20 @@ DISTCLEANFILES += grub_fstest_init.c # for grub-editenv bin_UTILITIES += grub-editenv -grub_editenv_SOURCES = util/grub-editenv.c util/envblk.c util/misc.c kern/misc.c kern/err.c -CLEANFILES += grub-editenv$(EXEEXT) grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o -MOSTLYCLEANFILES += grub_editenv-util_grub_editenv.d grub_editenv-util_envblk.d grub_editenv-util_misc.d grub_editenv-kern_misc.d grub_editenv-kern_err.d +grub_editenv_SOURCES = util/grub-editenv.c lib/envblk.c util/misc.c kern/misc.c kern/err.c +CLEANFILES += grub-editenv$(EXEEXT) grub_editenv-util_grub_editenv.o grub_editenv-lib_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o +MOSTLYCLEANFILES += grub_editenv-util_grub_editenv.d grub_editenv-lib_envblk.d grub_editenv-util_misc.d grub_editenv-kern_misc.d grub_editenv-kern_err.d -grub-editenv: $(grub_editenv_DEPENDENCIES) grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o - $(CC) -o $@ grub_editenv-util_grub_editenv.o grub_editenv-util_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o $(LDFLAGS) $(grub_editenv_LDFLAGS) +grub-editenv: $(grub_editenv_DEPENDENCIES) grub_editenv-util_grub_editenv.o grub_editenv-lib_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o + $(CC) -o $@ grub_editenv-util_grub_editenv.o grub_editenv-lib_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o $(LDFLAGS) $(grub_editenv_LDFLAGS) grub_editenv-util_grub_editenv.o: util/grub-editenv.c $(util/grub-editenv.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< -include grub_editenv-util_grub_editenv.d -grub_editenv-util_envblk.o: util/envblk.c $(util/envblk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< --include grub_editenv-util_envblk.d +grub_editenv-lib_envblk.o: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< +-include grub_editenv-lib_envblk.d grub_editenv-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< @@ -1998,7 +1998,7 @@ pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod + read.mod sleep.mod loadenv.mod crc.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -2932,13 +2932,13 @@ blocklist_mod_CFLAGS = $(COMMON_CFLAGS) blocklist_mod_LDFLAGS = $(COMMON_LDFLAGS) # For hexdump.mod. -hexdump_mod_SOURCES = commands/hexdump.c -CLEANFILES += hexdump.mod mod-hexdump.o mod-hexdump.c pre-hexdump.o hexdump_mod-commands_hexdump.o und-hexdump.lst +hexdump_mod_SOURCES = commands/hexdump.c lib/hexdump.c +CLEANFILES += hexdump.mod mod-hexdump.o mod-hexdump.c pre-hexdump.o hexdump_mod-commands_hexdump.o hexdump_mod-lib_hexdump.o und-hexdump.lst ifneq ($(hexdump_mod_EXPORTS),no) CLEANFILES += def-hexdump.lst DEFSYMFILES += def-hexdump.lst endif -MOSTLYCLEANFILES += hexdump_mod-commands_hexdump.d +MOSTLYCLEANFILES += hexdump_mod-commands_hexdump.d hexdump_mod-lib_hexdump.d UNDSYMFILES += und-hexdump.lst hexdump.mod: pre-hexdump.o mod-hexdump.o $(TARGET_OBJ2ELF) @@ -2947,9 +2947,9 @@ hexdump.mod: pre-hexdump.o mod-hexdump.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-hexdump.o: $(hexdump_mod_DEPENDENCIES) hexdump_mod-commands_hexdump.o +pre-hexdump.o: $(hexdump_mod_DEPENDENCIES) hexdump_mod-commands_hexdump.o hexdump_mod-lib_hexdump.o -rm -f $@ - $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hexdump_mod-commands_hexdump.o + $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hexdump_mod-commands_hexdump.o hexdump_mod-lib_hexdump.o mod-hexdump.o: mod-hexdump.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -c -o $@ $< @@ -2985,6 +2985,25 @@ partmap-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump. set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) +hexdump_mod-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -MD -c -o $@ $< +-include hexdump_mod-lib_hexdump.d + +CLEANFILES += cmd-hexdump_mod-lib_hexdump.lst fs-hexdump_mod-lib_hexdump.lst partmap-hexdump_mod-lib_hexdump.lst +COMMANDFILES += cmd-hexdump_mod-lib_hexdump.lst +FSFILES += fs-hexdump_mod-lib_hexdump.lst +PARTMAPFILES += partmap-hexdump_mod-lib_hexdump.lst + +cmd-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) + +fs-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) + +partmap-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) + + hexdump_mod_CFLAGS = $(COMMON_CFLAGS) hexdump_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -3103,13 +3122,13 @@ sleep_mod_CFLAGS = $(COMMON_CFLAGS) sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) # For loadenv.mod. -loadenv_mod_SOURCES = commands/loadenv.c util/envblk.c -CLEANFILES += loadenv.mod mod-loadenv.o mod-loadenv.c pre-loadenv.o loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o und-loadenv.lst +loadenv_mod_SOURCES = commands/loadenv.c lib/envblk.c +CLEANFILES += loadenv.mod mod-loadenv.o mod-loadenv.c pre-loadenv.o loadenv_mod-commands_loadenv.o loadenv_mod-lib_envblk.o und-loadenv.lst ifneq ($(loadenv_mod_EXPORTS),no) CLEANFILES += def-loadenv.lst DEFSYMFILES += def-loadenv.lst endif -MOSTLYCLEANFILES += loadenv_mod-commands_loadenv.d loadenv_mod-util_envblk.d +MOSTLYCLEANFILES += loadenv_mod-commands_loadenv.d loadenv_mod-lib_envblk.d UNDSYMFILES += und-loadenv.lst loadenv.mod: pre-loadenv.o mod-loadenv.o $(TARGET_OBJ2ELF) @@ -3118,9 +3137,9 @@ loadenv.mod: pre-loadenv.o mod-loadenv.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-loadenv.o: $(loadenv_mod_DEPENDENCIES) loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o +pre-loadenv.o: $(loadenv_mod_DEPENDENCIES) loadenv_mod-commands_loadenv.o loadenv_mod-lib_envblk.o -rm -f $@ - $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadenv_mod-commands_loadenv.o loadenv_mod-util_envblk.o + $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadenv_mod-commands_loadenv.o loadenv_mod-lib_envblk.o mod-loadenv.o: mod-loadenv.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -c -o $@ $< @@ -3156,28 +3175,104 @@ partmap-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv. set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) -loadenv_mod-util_envblk.o: util/envblk.c $(util/envblk.c_DEPENDENCIES) - $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -MD -c -o $@ $< --include loadenv_mod-util_envblk.d +loadenv_mod-lib_envblk.o: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -MD -c -o $@ $< +-include loadenv_mod-lib_envblk.d -CLEANFILES += cmd-loadenv_mod-util_envblk.lst fs-loadenv_mod-util_envblk.lst partmap-loadenv_mod-util_envblk.lst -COMMANDFILES += cmd-loadenv_mod-util_envblk.lst -FSFILES += fs-loadenv_mod-util_envblk.lst -PARTMAPFILES += partmap-loadenv_mod-util_envblk.lst +CLEANFILES += cmd-loadenv_mod-lib_envblk.lst fs-loadenv_mod-lib_envblk.lst partmap-loadenv_mod-lib_envblk.lst +COMMANDFILES += cmd-loadenv_mod-lib_envblk.lst +FSFILES += fs-loadenv_mod-lib_envblk.lst +PARTMAPFILES += partmap-loadenv_mod-lib_envblk.lst -cmd-loadenv_mod-util_envblk.lst: util/envblk.c $(util/envblk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) +cmd-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) -fs-loadenv_mod-util_envblk.lst: util/envblk.c $(util/envblk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) +fs-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) -partmap-loadenv_mod-util_envblk.lst: util/envblk.c $(util/envblk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iutil -I$(srcdir)/util $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) +partmap-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) loadenv_mod_CFLAGS = $(COMMON_CFLAGS) loadenv_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For crc.mod. +crc_mod_SOURCES = commands/crc.c lib/crc.c +CLEANFILES += crc.mod mod-crc.o mod-crc.c pre-crc.o crc_mod-commands_crc.o crc_mod-lib_crc.o und-crc.lst +ifneq ($(crc_mod_EXPORTS),no) +CLEANFILES += def-crc.lst +DEFSYMFILES += def-crc.lst +endif +MOSTLYCLEANFILES += crc_mod-commands_crc.d crc_mod-lib_crc.d +UNDSYMFILES += und-crc.lst + +crc.mod: pre-crc.o mod-crc.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(crc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-crc.o mod-crc.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-crc.o: $(crc_mod_DEPENDENCIES) crc_mod-commands_crc.o crc_mod-lib_crc.o + -rm -f $@ + $(TARGET_CC) $(crc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ crc_mod-commands_crc.o crc_mod-lib_crc.o + +mod-crc.o: mod-crc.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -c -o $@ $< + +mod-crc.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'crc' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(crc_mod_EXPORTS),no) +def-crc.lst: pre-crc.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 crc/' > $@ +endif + +und-crc.lst: pre-crc.o + echo 'crc' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +crc_mod-commands_crc.o: commands/crc.c $(commands/crc.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -MD -c -o $@ $< +-include crc_mod-commands_crc.d + +CLEANFILES += cmd-crc_mod-commands_crc.lst fs-crc_mod-commands_crc.lst partmap-crc_mod-commands_crc.lst +COMMANDFILES += cmd-crc_mod-commands_crc.lst +FSFILES += fs-crc_mod-commands_crc.lst +PARTMAPFILES += partmap-crc_mod-commands_crc.lst + +cmd-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) + +fs-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) + +partmap-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) + + +crc_mod-lib_crc.o: lib/crc.c $(lib/crc.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -MD -c -o $@ $< +-include crc_mod-lib_crc.d + +CLEANFILES += cmd-crc_mod-lib_crc.lst fs-crc_mod-lib_crc.lst partmap-crc_mod-lib_crc.lst +COMMANDFILES += cmd-crc_mod-lib_crc.lst +FSFILES += fs-crc_mod-lib_crc.lst +PARTMAPFILES += partmap-crc_mod-lib_crc.lst + +cmd-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) + +fs-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) + +partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) + + +crc_mod_CFLAGS = $(COMMON_CFLAGS) +crc_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Misc. pkglib_MODULES += gzio.mod elf.mod diff --git a/conf/common.rmk b/conf/common.rmk index c0087f5bc..7db0b2a32 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -26,7 +26,7 @@ util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ - io/gzio.c commands/hexdump.c commands/blocklist.c commands/ls.c \ + io/gzio.c lib/hexdump.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ @@ -96,7 +96,7 @@ DISTCLEANFILES += grub_fstest_init.c # for grub-editenv bin_UTILITIES += grub-editenv -grub_editenv_SOURCES = util/grub-editenv.c util/envblk.c util/misc.c kern/misc.c kern/err.c +grub_editenv_SOURCES = util/grub-editenv.c lib/envblk.c util/misc.c kern/misc.c kern/err.c CLEANFILES += grub-editenv # for grub-pe2elf @@ -274,7 +274,7 @@ pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod + read.mod sleep.mod loadenv.mod crc.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -357,7 +357,7 @@ blocklist_mod_CFLAGS = $(COMMON_CFLAGS) blocklist_mod_LDFLAGS = $(COMMON_LDFLAGS) # For hexdump.mod. -hexdump_mod_SOURCES = commands/hexdump.c +hexdump_mod_SOURCES = commands/hexdump.c lib/hexdump.c hexdump_mod_CFLAGS = $(COMMON_CFLAGS) hexdump_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -372,10 +372,15 @@ sleep_mod_CFLAGS = $(COMMON_CFLAGS) sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) # For loadenv.mod. -loadenv_mod_SOURCES = commands/loadenv.c util/envblk.c +loadenv_mod_SOURCES = commands/loadenv.c lib/envblk.c loadenv_mod_CFLAGS = $(COMMON_CFLAGS) loadenv_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For crc.mod. +crc_mod_SOURCES = commands/crc.c lib/crc.c +crc_mod_CFLAGS = $(COMMON_CFLAGS) +crc_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Misc. pkglib_MODULES += gzio.mod elf.mod diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 587ca572b..aab8e4b5e 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -195,7 +195,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/cpuid.c \ + lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ @@ -222,11 +222,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -276,6 +276,10 @@ grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_hexdump.d +grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_hexdump.d + grub_emu-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) $(CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_i386_cpuid.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index d2546beeb..5b110d9cc 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/cpuid.c \ + lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 92830342a..173fc4670 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -72,7 +72,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c \ + commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/loopback.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 99bb0d494..308dec4f0 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -36,7 +36,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c \ + commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/loopback.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index d19fd2ec0..5aa516a7a 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -208,7 +208,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/halt.c commands/reboot.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ @@ -236,11 +236,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -290,6 +290,10 @@ grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_hexdump.d +grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_hexdump.d + grub_emu-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_halt.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index e4f2a6637..03827ae7c 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -62,7 +62,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/halt.c commands/reboot.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index e26cfa77e..6aeef6cd6 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -485,7 +485,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/reboot.c \ + lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ fs/fshelp.c \ @@ -513,11 +513,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -567,6 +567,10 @@ grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_hexdump.d +grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_hexdump.d + grub_emu-commands_i386_pc_halt.o: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_i386_pc_halt.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 84c0b7dee..8617a9216 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -111,7 +111,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/i386/pc/halt.c commands/reboot.c \ + lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ fs/fshelp.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 5a91801eb..e341cf5fa 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -85,7 +85,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ - commands/halt.c commands/reboot.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ @@ -111,11 +111,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -161,6 +161,10 @@ grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_hexdump.d +grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_hexdump.d + grub_emu-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_halt.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index bb044908e..6ade1ab63 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -49,7 +49,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/terminal.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ - commands/halt.c commands/reboot.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 915958c75..aacd31f92 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -56,7 +56,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c \ + commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/loopback.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index daa416c84..744eda49e 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -38,7 +38,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/terminal.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c \ + commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ disk/loopback.c \ diff --git a/include/grub/lib/crc.h b/include/grub/lib/crc.h new file mode 100644 index 000000000..ff7284dc8 --- /dev/null +++ b/include/grub/lib/crc.h @@ -0,0 +1,25 @@ +/* crc.h - prototypes for crc */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CRC_H +#define GRUB_CRC_H 1 + +grub_uint32_t grub_getcrc32 (grub_uint32_t crc, void *buf, int size); + +#endif /* ! GRUB_CRC_H */ diff --git a/include/grub/envblk.h b/include/grub/lib/envblk.h similarity index 100% rename from include/grub/envblk.h rename to include/grub/lib/envblk.h diff --git a/include/grub/hexdump.h b/include/grub/lib/hexdump.h similarity index 100% rename from include/grub/hexdump.h rename to include/grub/lib/hexdump.h diff --git a/lib/crc.c b/lib/crc.c new file mode 100644 index 000000000..bc0d8aa8d --- /dev/null +++ b/lib/crc.c @@ -0,0 +1,75 @@ +/* crc.c - crc function */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +static grub_uint32_t crc32_table [256]; + +static void +init_crc32_table (void) +{ + auto grub_uint32_t reflect (grub_uint32_t ref, int len); + grub_uint32_t reflect (grub_uint32_t ref, int len) + { + grub_uint32_t result = 0; + int i; + + for (i = 1; i <= len; i++) + { + if (ref & 1) + result |= 1 << (len - i); + ref >>= 1; + } + + return result; + } + + grub_uint32_t polynomial = 0x04c11db7; + int i, j; + + for(i = 0; i < 256; i++) + { + crc32_table[i] = reflect(i, 8) << 24; + for (j = 0; j < 8; j++) + crc32_table[i] = (crc32_table[i] << 1) ^ + (crc32_table[i] & (1 << 31) ? polynomial : 0); + crc32_table[i] = reflect(crc32_table[i], 32); + } +} + +grub_uint32_t +grub_getcrc32 (grub_uint32_t crc, void *buf, int size) +{ + int i; + grub_uint8_t *data = buf; + + if (! crc32_table[1]) + init_crc32_table (); + + crc^= 0xffffffff; + + for (i = 0; i < size; i++) + { + crc = (crc >> 8) ^ crc32_table[(crc & 0xFF) ^ *data]; + data++; + } + + return crc ^ 0xffffffff; +} diff --git a/util/envblk.c b/lib/envblk.c similarity index 99% rename from util/envblk.c rename to lib/envblk.c index 9cea7d6f9..6618d97f6 100644 --- a/util/envblk.c +++ b/lib/envblk.c @@ -19,8 +19,8 @@ #include #include -#include #include +#include grub_envblk_t grub_envblk_find (char *buf) diff --git a/lib/hexdump.c b/lib/hexdump.c new file mode 100644 index 000000000..9b79f45b8 --- /dev/null +++ b/lib/hexdump.c @@ -0,0 +1,68 @@ +/* hexdump.c - hexdump function */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +void +hexdump (unsigned long bse, char *buf, int len) +{ + int pos; + char line[80]; + + while (len > 0) + { + int cnt, i; + + pos = grub_sprintf (line, "%08lx ", bse); + cnt = 16; + if (cnt > len) + cnt = len; + + for (i = 0; i < cnt; i++) + { + pos += grub_sprintf (&line[pos], "%02x ", (unsigned char) buf[i]); + if ((i & 7) == 7) + line[pos++] = ' '; + } + + for (; i < 16; i++) + { + pos += grub_sprintf (&line[pos], " "); + if ((i & 7) == 7) + line[pos++] = ' '; + } + + line[pos++] = '|'; + + for (i = 0; i < cnt; i++) + line[pos++] = ((buf[i] >= 32) && (buf[i] < 127)) ? buf[i] : '.'; + + line[pos++] = '|'; + + line[pos] = 0; + + grub_printf ("%s\n", line); + + bse += 16; + buf += 16; + len -= cnt; + } +} diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 523e5c70e..f53a9bb7b 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -20,8 +20,7 @@ #include #include #include - -#include +#include #include #include diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 3872ff149..35af6a500 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include From 8f5e379ff3b8da0b1dff7fad116d6c09f47a6126 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 27 Jul 2008 14:20:49 +0000 Subject: [PATCH 0281/1707] 2008-07-27 Bean * fs/xfs.c (grub_xfs_dir_header): Change field i8count back to smallino, as it's more descriptive, and i8count can be confused with the other field count. (grub_xfs_iterate_dir): Adjust grub_xfs_dir_entry pointer for small inode type. --- ChangeLog | 8 ++++++++ fs/xfs.c | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f094a1bc..bb55e2229 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-27 Bean + + * fs/xfs.c (grub_xfs_dir_header): Change field i8count back to + smallino, as it's more descriptive, and i8count can be confused with + the other field count. + (grub_xfs_iterate_dir): Adjust grub_xfs_dir_entry pointer for small + inode type. + 2008-07-27 Bean * commands/crc.c: New file. diff --git a/fs/xfs.c b/fs/xfs.c index 7da3e4012..81a27714b 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -56,7 +56,7 @@ struct grub_xfs_sblock struct grub_xfs_dir_header { grub_uint8_t count; - grub_uint8_t i8count; + grub_uint8_t smallino; union { grub_uint32_t i4; @@ -423,7 +423,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, case XFS_INODE_FORMAT_INO: { struct grub_xfs_dir_entry *de = &diro->inode.data.dir.direntry[0]; - int smallino = !diro->inode.data.dir.dirhead.i8count; + int smallino = !diro->inode.data.dir.dirhead.smallino; int i; grub_uint64_t parent; @@ -433,12 +433,12 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, { parent = grub_be_to_cpu32 (diro->inode.data.dir.dirhead.parent.i4); parent = grub_cpu_to_be64 (parent); + /* The header is a bit smaller than usual. */ + de = (struct grub_xfs_dir_entry *) ((char *) de - 4); } else { parent = diro->inode.data.dir.dirhead.parent.i8; - /* The header is a bit bigger than usual. */ - de = (struct grub_xfs_dir_entry *) ((char *) de + 4); } /* Synthesize the direntries for `.' and `..'. */ From b70a8427ce941de7335d232729de78863188dc7f Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 27 Jul 2008 14:46:45 +0000 Subject: [PATCH 0282/1707] 2008-07-27 Bean * fs/fat.c (GRUB_FAT_MAXFILE): New constant. (grub_fat_find_dir): Ignore case when comparing filename. --- ChangeLog | 5 +++++ fs/fat.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bb55e2229..010e9d242 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-27 Bean + + * fs/fat.c (GRUB_FAT_MAXFILE): New constant. + (grub_fat_find_dir): Ignore case when comparing filename. + 2008-07-27 Bean * fs/xfs.c (grub_xfs_dir_header): Change field i8count back to diff --git a/fs/fat.c b/fs/fat.c index 63979b4b4..8db176009 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -35,6 +35,8 @@ #define GRUB_FAT_ATTR_DIRECTORY 0x10 #define GRUB_FAT_ATTR_ARCHIVE 0x20 +#define GRUB_FAT_MAXFILE 256 + #define GRUB_FAT_ATTR_LONG_NAME (GRUB_FAT_ATTR_READ_ONLY \ | GRUB_FAT_ATTR_HIDDEN \ | GRUB_FAT_ATTR_SYSTEM \ @@ -629,7 +631,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, if (hook (filename, dir.attr & GRUB_FAT_ATTR_DIRECTORY)) break; } - else if (grub_strcmp (dirname, filename) == 0) + else if (grub_strncasecmp (dirname, filename, GRUB_FAT_MAXFILE) == 0) { if (call_hook) hook (filename, dir.attr & GRUB_FAT_ATTR_DIRECTORY); From 2c76932c4b5dcfc14cea787b73583f54c4187466 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 27 Jul 2008 15:41:43 +0000 Subject: [PATCH 0283/1707] forgot to checkin last commit --- commands/help.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/commands/help.c b/commands/help.c index d5d0caf64..efff37b61 100644 --- a/commands/help.c +++ b/commands/help.c @@ -22,10 +22,6 @@ #include #include -/* XXX: This has to be changed into a function so the screen can be - optimally used. */ -#define TERM_WIDTH 80 - static grub_err_t grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc, char **args) @@ -43,16 +39,16 @@ grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc, { if (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE) { - char description[TERM_WIDTH / 2]; + char description[GRUB_TERM_WIDTH / 2]; int desclen = grub_strlen (cmd->summary); - /* Make a string with a length of TERM_WIDTH / 2 - 1 filled + /* Make a string with a length of GRUB_TERM_WIDTH / 2 - 1 filled with the description followed by spaces. */ - grub_memset (description, ' ', TERM_WIDTH / 2 - 1); - description[TERM_WIDTH / 2 - 1] = '\0'; + grub_memset (description, ' ', GRUB_TERM_WIDTH / 2 - 1); + description[GRUB_TERM_WIDTH / 2 - 1] = '\0'; grub_memcpy (description, cmd->summary, - (desclen < TERM_WIDTH / 2 - 1 - ? desclen : TERM_WIDTH / 2 - 1)); + (desclen < GRUB_TERM_WIDTH / 2 - 1 + ? desclen : GRUB_TERM_WIDTH / 2 - 1)); grub_printf ("%s%s", description, (cnt++) % 2 ? "\n" : " "); } From 47f908abba60cc77e7aef648645ef8d87ae96cf4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 27 Jul 2008 15:44:37 +0000 Subject: [PATCH 0284/1707] add grub/term.h like ChangeLog says.. --- commands/help.c | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/help.c b/commands/help.c index efff37b61..7f9ef6ab7 100644 --- a/commands/help.c +++ b/commands/help.c @@ -21,6 +21,7 @@ #include #include #include +#include static grub_err_t grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc, From cd1df915eac97f10d1709198e19681d6a84eb58d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 27 Jul 2008 20:57:43 +0000 Subject: [PATCH 0285/1707] 2008-07-27 Robert Millan * disk/ata.c (grub_ata_dumpinfo): Use grub_dprintf() for debugging information. --- ChangeLog | 5 +++++ disk/ata.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 010e9d242..f28b1455a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-27 Robert Millan + + * disk/ata.c (grub_ata_dumpinfo): Use grub_dprintf() for debugging + information. + 2008-07-27 Bean * fs/fat.c (GRUB_FAT_MAXFILE): New constant. diff --git a/disk/ata.c b/disk/ata.c index 7925fb875..919f51bbd 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -219,16 +219,16 @@ grub_ata_dumpinfo (struct grub_ata_device *dev, char *info) /* The device information was read, dump it for debugging. */ grub_ata_strncpy (text, info + 20, 20); - grub_printf ("Serial: %s\n", text); + grub_dprintf ("ata", "Serial: %s\n", text); grub_ata_strncpy (text, info + 46, 8); - grub_printf ("Firmware: %s\n", text); + grub_dprintf ("ata", "Firmware: %s\n", text); grub_ata_strncpy (text, info + 54, 40); - grub_printf ("Model: %s\n", text); + grub_dprintf ("ata", "Model: %s\n", text); if (! dev->atapi) { - grub_printf ("Addressing: %d\n", dev->addr); - grub_printf ("Sectors: %lld\n", dev->size); + grub_dprintf ("ata", "Addressing: %d\n", dev->addr); + grub_dprintf ("ata", "Sectors: %lld\n", dev->size); } } From 93cce01644f3f7e4a9f306fa1699e18d0438e43f Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 28 Jul 2008 09:25:37 +0000 Subject: [PATCH 0286/1707] 2008-07-28 Robert Millan * disk/raid.c (grub_raid_scan_device): Do not abort when two disks with the same number are found, just use issue a warning with grub_dprintf(), as this error has been reported to be non-fatal. --- ChangeLog | 6 ++++++ disk/raid.c | 12 +++--------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index f28b1455a..02665d09b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-28 Robert Millan + + * disk/raid.c (grub_raid_scan_device): Do not abort when two disks + with the same number are found, just use issue a warning with + grub_dprintf(), as this error has been reported to be non-fatal. + 2008-07-27 Robert Millan * disk/ata.c (grub_ata_dumpinfo): Use grub_dprintf() for debugging diff --git a/disk/raid.c b/disk/raid.c index a484fcf89..731bf1f43 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -442,16 +442,10 @@ grub_raid_scan_device (const char *name) } if (array->device[sb.this_disk.number] != NULL) - { - /* We found multiple devices with the same number. Again, - this shouldn't happen.*/ - - grub_error (GRUB_ERR_BAD_NUMBER, - "Found two disks with the number %d?!?", + /* We found multiple devices with the same number. Again, + this shouldn't happen.*/ + grub_dprintf ("raid", "Found two disks with the number %d?!?", sb.this_disk.number); - - return 0; - } } /* Add an array to the list if we didn't find any. */ From c298def0bf718e05d2a5dbe40a8679d62e97fb08 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 28 Jul 2008 19:27:42 +0000 Subject: [PATCH 0287/1707] Fix spacing --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02665d09b..9288a2a74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,7 +3,7 @@ * disk/raid.c (grub_raid_scan_device): Do not abort when two disks with the same number are found, just use issue a warning with grub_dprintf(), as this error has been reported to be non-fatal. - + 2008-07-27 Robert Millan * disk/ata.c (grub_ata_dumpinfo): Use grub_dprintf() for debugging @@ -73,7 +73,7 @@ * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. -2008-07-27 Felix Zielcke +2008-07-27 Felix Zielcke * commands/help.c: Include . (TERM_WIDTH): Removed. Updated all users. From 96cdbeff6a5366948709c6e4cae1c49876720fb8 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 28 Jul 2008 19:34:15 +0000 Subject: [PATCH 0288/1707] autogen.sh: touch stamp-h.in after running autoheader This prevents autoheader from being rerun by make if somebody changes configure.ac or aclocal.m4 and runs autogen.sh. Suggested by Christian Franke --- autogen.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/autogen.sh b/autogen.sh index 387bea731..850bcbc17 100644 --- a/autogen.sh +++ b/autogen.sh @@ -4,6 +4,7 @@ set -e autoconf autoheader +echo timestamp > stamp-h.in for rmk in conf/*.rmk; do ruby genmk.rb < $rmk > `echo $rmk | sed 's/\.rmk$/.mk/'` done From cfd0b4e6faffc1268b48ec597d62d71d633d7018 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 28 Jul 2008 22:35:40 +0000 Subject: [PATCH 0289/1707] 2008-07-28 Pavel Roskin * genmk.rb: Add a warning to the beginning of the output that it's a generated file and should not be edited. --- ChangeLog | 5 +++++ conf/common.mk | 1 + conf/i386-coreboot.mk | 1 + conf/i386-efi.mk | 1 + conf/i386-ieee1275.mk | 1 + conf/i386-pc.mk | 1 + conf/powerpc-ieee1275.mk | 1 + conf/sparc64-ieee1275.mk | 1 + conf/x86_64-efi.mk | 1 + genmk.rb | 4 ++++ 10 files changed, 17 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9288a2a74..5145f50a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-28 Pavel Roskin + + * genmk.rb: Add a warning to the beginning of the output that + it's a generated file and should not be edited. + 2008-07-28 Robert Millan * disk/raid.c (grub_raid_scan_device): Do not abort when two disks diff --git a/conf/common.mk b/conf/common.mk index 149673f6d..11aeee981 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1,4 +1,5 @@ # -*- makefile -*- +# Generated by genmk.rb, please don't edit! # For grub-probe. sbin_UTILITIES += grub-probe diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index aab8e4b5e..41fc37b3d 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -1,4 +1,5 @@ # -*- makefile -*- +# Generated by genmk.rb, please don't edit! COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 173fc4670..28e38771b 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -1,4 +1,5 @@ # -*- makefile -*- +# Generated by genmk.rb, please don't edit! COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -fno-builtin -m32 diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 5aa516a7a..591408433 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -1,4 +1,5 @@ # -*- makefile -*- +# Generated by genmk.rb, please don't edit! COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 6aeef6cd6..28d6cebdf 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1,4 +1,5 @@ # -*- makefile -*- +# Generated by genmk.rb, please don't edit! GRUB_MEMORY_MACHINE_LINK_ADDR = 0x8200 diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index e341cf5fa..f9bdfe36e 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -1,4 +1,5 @@ +# Generated by genmk.rb, please don't edit! # -*- makefile -*- COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 88ee85370..a2b963863 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -1,4 +1,5 @@ +# Generated by genmk.rb, please don't edit! # -*- makefile -*- COMMON_ASFLAGS = -nostdinc diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index aacd31f92..495af8308 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -1,4 +1,5 @@ # -*- makefile -*- +# Generated by genmk.rb, please don't edit! COMMON_ASFLAGS = -nostdinc -fno-builtin -m64 COMMON_CFLAGS = -fno-builtin -m64 diff --git a/genmk.rb b/genmk.rb index cb0a67501..9ac1273fb 100644 --- a/genmk.rb +++ b/genmk.rb @@ -286,6 +286,10 @@ pmodules = [] programs = [] scripts = [] +l = gets +print l +print "# Generated by genmk.rb, please don't edit!\n" + cont = false s = nil while l = gets From 41694fd019afbd2eaea08fcaab9ca7c93a44c8f6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 28 Jul 2008 22:37:32 +0000 Subject: [PATCH 0290/1707] 2008-07-28 Robert Millan * partmap/apple.c (GRUB_APPLE_HEADER_MAGIC): New macro. (struct grub_apple_header): New struct. Describes the layout of the partmap header. (apple_partition_map_iterate): Check the header magic as well as the partition magic (which was already being checked). --- ChangeLog | 8 ++++++++ partmap/apple.c | 34 ++++++++++++++++++++++++++++------ 2 files changed, 36 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5145f50a4..bf8bfe19d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-28 Robert Millan + + * partmap/apple.c (GRUB_APPLE_HEADER_MAGIC): New macro. + (struct grub_apple_header): New struct. Describes the layout of + the partmap header. + (apple_partition_map_iterate): Check the header magic as well as the + partition magic (which was already being checked). + 2008-07-28 Pavel Roskin * genmk.rb: Add a warning to the beginning of the output that diff --git a/partmap/apple.c b/partmap/apple.c index 4e5c48116..d6ddc0b3f 100644 --- a/partmap/apple.c +++ b/partmap/apple.c @@ -1,7 +1,7 @@ /* apple.c - Read macintosh partition tables. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,11 +22,19 @@ #include #include +#define GRUB_APPLE_HEADER_MAGIC 0x4552 #define GRUB_APPLE_PART_MAGIC 0x504D +struct grub_apple_header +{ + /* The magic number to identify the partition map, it should have + the value `0x4552'. */ + grub_uint16_t magic; +}; + struct grub_apple_part { - /* The magic number to idenify this as a partition, it should have + /* The magic number to identify this as a partition, it should have the value `0x504D'. */ grub_uint16_t magic; @@ -98,6 +106,7 @@ apple_partition_map_iterate (grub_disk_t disk, const grub_partition_t partition)) { struct grub_partition part; + struct grub_apple_header aheader; struct grub_apple_part apart; struct grub_disk raw; int partno = 0; @@ -109,6 +118,18 @@ apple_partition_map_iterate (grub_disk_t disk, part.partmap = &grub_apple_partition_map; + if (grub_disk_read (&raw, 0, 0, sizeof (aheader), (char *) &aheader)) + return grub_errno; + + if (grub_be_to_cpu16 (aheader.magic) != GRUB_APPLE_HEADER_MAGIC) + { + grub_dprintf ("partition", + "bad magic (found 0x%x; wanted 0x%x\n", + grub_be_to_cpu16 (aheader.magic), + GRUB_APPLE_HEADER_MAGIC); + goto fail; + } + for (;;) { if (grub_disk_read (&raw, pos / GRUB_DISK_SECTOR_SIZE, @@ -147,11 +168,12 @@ apple_partition_map_iterate (grub_disk_t disk, partno++; } - if (pos == GRUB_DISK_SECTOR_SIZE) - return grub_error (GRUB_ERR_BAD_PART_TABLE, - "Apple partition map not found."); + if (pos != GRUB_DISK_SECTOR_SIZE) + return 0; - return 0; + fail: + return grub_error (GRUB_ERR_BAD_PART_TABLE, + "Apple partition map not found."); } From e93e4679ce15056e375933098c5d5169b93d9edd Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 29 Jul 2008 15:07:47 +0000 Subject: [PATCH 0291/1707] 2008-07-29 Bean * normal/main.c (get_line): Fix buffer overflow bug. --- ChangeLog | 4 ++++ normal/main.c | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf8bfe19d..488c56c6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-07-29 Bean + + * normal/main.c (get_line): Fix buffer overflow bug. + 2008-07-28 Robert Millan * partmap/apple.c (GRUB_APPLE_HEADER_MAGIC): New macro. diff --git a/normal/main.c b/normal/main.c index e5458fc98..2e6df90ea 100644 --- a/normal/main.c +++ b/normal/main.c @@ -97,9 +97,6 @@ get_line (grub_file_t file) } else { - if (c == '\n') - break; - if (pos >= max_len) { char *old_cmdline = cmdline; @@ -112,6 +109,9 @@ get_line (grub_file_t file) } } + if (c == '\n') + break; + cmdline[pos++] = c; } } From b609876d153e9240ae4dbcf02698cd6ba3501df1 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Tue, 29 Jul 2008 15:38:05 +0000 Subject: [PATCH 0292/1707] 2008-07-29 Christian Franke * util/update-grub.in: Add a check for admin group on Cygwin. Remove old `grub.cfg.new' before creation. Add `-f' to `mv' to handle the different filesystem semantics of Windows. --- ChangeLog | 8 ++++++++ util/update-grub.in | 19 ++++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 488c56c6b..985b30ac7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-07-29 Christian Franke + + * util/update-grub.in: Add a check for admin + group on Cygwin. + Remove old `grub.cfg.new' before creation. + Add `-f' to `mv' to handle the different filesystem + semantics of Windows. + 2008-07-29 Bean * normal/main.c (get_line): Fix buffer overflow bug. diff --git a/util/update-grub.in b/util/update-grub.in index c78444e19..70607a50e 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -73,8 +73,20 @@ if [ "x$EUID" = "x" ] ; then fi if [ "$EUID" != 0 ] ; then - echo "$0: You must run this as root" >&2 - exit 1 + root=f + case "`uname 2>/dev/null`" in + CYGWIN*) + # Cygwin: Assume root if member of admin group + for g in `id -G 2>/dev/null` ; do + case $g in + 0|544) root=t ;; + esac + done ;; + esac + if [ $root != t ] ; then + echo "$0: You must run this as root" >&2 + exit 1 + fi fi set $grub_mkdevicemap dummy @@ -154,6 +166,7 @@ export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_ # These are optional, user-defined variables. export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID +rm -f ${grub_cfg}.new exec > ${grub_cfg}.new # Allow this to fail, since /boot/grub/ might need to be fatfs to support some @@ -187,6 +200,6 @@ for i in ${update_grub_dir}/* ; do done # none of the children aborted with error, install the new grub.cfg -mv ${grub_cfg}.new ${grub_cfg} +mv -f ${grub_cfg}.new ${grub_cfg} echo "done" >&2 From 2921d33798fbfc625b9f4974a1969db4f6116792 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Tue, 29 Jul 2008 16:47:31 +0000 Subject: [PATCH 0293/1707] 2008-07-29 Christian Franke * util/update-grub_lib.in (make_system_path_relative_to_its_root): Add conversion of emulated mount points on Cygwin. --- ChangeLog | 5 +++++ util/update-grub_lib.in | 17 ++++++++++++++++- 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 985b30ac7..8d18362d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-29 Christian Franke + + * util/update-grub_lib.in (make_system_path_relative_to_its_root): + Add conversion of emulated mount points on Cygwin. + 2008-07-29 Christian Franke * util/update-grub.in: Add a check for admin diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 03a96ce8f..9d0f0c603 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -68,7 +68,22 @@ make_system_path_relative_to_its_root () dir="" fi - echo $path | sed -e "s,^$dir,,g" + # XXX: This fails if $dir contains ','. + path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1 + + case "`uname 2>/dev/null`" in + CYGWIN*) + # Cygwin: Check if regular or emulated mount. + if [ -z "$dir" ] || [ "`stat -c %D "$dir/.."`" != 620000 ] ; then + # Reached some mount point not below /cygdrive. + # GRUB does not know Cygwin's emulated mounts, + # convert to Win32 path and remove drive letter. + path=`cygpath -m "$path" | sed -n 's,^[A-Za-z]:,,p'` + test ! -z "$path" || return 1 + fi ;; + esac + + echo "$path" } is_path_readable_by_grub () From 4ca049a3659402ad045c8fb328e78b6e04d1f4c9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 29 Jul 2008 23:29:03 +0000 Subject: [PATCH 0294/1707] 2008-07-30 Robert Millan * term/i386/pc/vga_text.c (grub_console_cls): Use grub_console_gotoxy() to go back to beginning of the screen. Found by Patrick Georgi --- ChangeLog | 6 ++++++ term/i386/pc/vga_text.c | 1 + 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8d18362d3..7316a088f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-07-30 Robert Millan + + * term/i386/pc/vga_text.c (grub_console_cls): Use + grub_console_gotoxy() to go back to beginning of the screen. + Found by Patrick Georgi + 2008-07-29 Christian Franke * util/update-grub_lib.in (make_system_path_relative_to_its_root): diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index 07a254469..58a3c6c2e 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -124,6 +124,7 @@ grub_console_cls (void) int i; for (i = 0; i < ROWS * COLS; i++) ((short *) VGA_TEXT_SCREEN)[i] = ' ' | (grub_console_cur_color << 8); + grub_console_gotoxy (0, 0); } void From 14f41dd1edb583631b83d60d325abae1ec8fc2c2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 30 Jul 2008 00:21:35 +0000 Subject: [PATCH 0295/1707] 2008-07-30 Robert Millan * util/grub.d/10_hurd.in: Source /grub/update-grub_lib. --- ChangeLog | 4 ++++ util/grub.d/10_hurd.in | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7316a088f..797a7dddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-07-30 Robert Millan + + * util/grub.d/10_hurd.in: Source ${libdir}/grub/update-grub_lib. + 2008-07-30 Robert Millan * term/i386/pc/vga_text.c (grub_console_cls): Use diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index d437873d2..ed54f2f0a 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -16,6 +16,11 @@ # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +. ${libdir}/grub/update-grub_lib + if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU else From ae88bca30199ec4027d57752d55975dcb1998609 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 30 Jul 2008 10:42:11 +0000 Subject: [PATCH 0296/1707] 2008-07-30 Robert Millan * kern/ieee1275/init.c (grub_machine_set_prefix): If `grub_prefix' is non-empty, use it to set the `prefix' environment variable instead of the usual approach. * kern/i386/linuxbios/init.c (make_install_device): Remove function. (grub_machine_set_prefix): Use `grub_prefix' to set the `prefix' environment variable instead of dummy make_install_device(). * kern/i386/ieee1275/startup.S: Include `'. (start): Insert a data section, with `grub_prefix' variable. * kern/i386/linuxbios/startup.S: Likewise. * include/grub/powerpc/ieee1275/kernel.h [!ASM_FILE] (grub_prefix): New variable reference. * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX): New macro. Defines offset of `grub_prefix' within startup.S (relative to `start'). (GRUB_KERNEL_MACHINE_DATA_END): New macro. Defines the end of data section within startup.S (relative to `start'). * include/grub/i386/coreboot/kernel.h: Likewise. * util/elf/grub-mkimage.c (add_segments): Receive `prefix' parameter. Overwrite grub_prefix with its contents, at the beginning of the first segment. (main): Understand -p|--prefix. --- ChangeLog | 27 +++++++++++++++++++ include/grub/i386/coreboot/kernel.h | 36 ++++++++++++++++++++++++++ include/grub/i386/ieee1275/kernel.h | 3 +++ include/grub/powerpc/ieee1275/kernel.h | 8 ++++++ kern/i386/ieee1275/startup.S | 19 ++++++++++++++ kern/i386/linuxbios/init.c | 8 +----- kern/i386/linuxbios/startup.S | 22 ++++++++++++++-- kern/ieee1275/init.c | 7 +++++ util/elf/grub-mkimage.c | 25 +++++++++++++++--- 9 files changed, 142 insertions(+), 13 deletions(-) create mode 100644 include/grub/i386/coreboot/kernel.h diff --git a/ChangeLog b/ChangeLog index 797a7dddb..63f073a46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,30 @@ +2008-07-30 Robert Millan + + * kern/ieee1275/init.c (grub_machine_set_prefix): If `grub_prefix' + is non-empty, use it to set the `prefix' environment variable instead + of the usual approach. + * kern/i386/linuxbios/init.c (make_install_device): Remove function. + (grub_machine_set_prefix): Use `grub_prefix' to set the `prefix' + environment variable instead of dummy make_install_device(). + + * kern/i386/ieee1275/startup.S: Include `'. + (start): Insert a data section, with `grub_prefix' variable. + * kern/i386/linuxbios/startup.S: Likewise. + + * include/grub/powerpc/ieee1275/kernel.h [!ASM_FILE] (grub_prefix): + New variable reference. + * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX): + New macro. Defines offset of `grub_prefix' within startup.S (relative + to `start'). + (GRUB_KERNEL_MACHINE_DATA_END): New macro. Defines the end of data + section within startup.S (relative to `start'). + * include/grub/i386/coreboot/kernel.h: Likewise. + + * util/elf/grub-mkimage.c (add_segments): Receive `prefix' parameter. + Overwrite grub_prefix with its contents, at the beginning of the + first segment. + (main): Understand -p|--prefix. + 2008-07-30 Robert Millan * util/grub.d/10_hurd.in: Source ${libdir}/grub/update-grub_lib. diff --git a/include/grub/i386/coreboot/kernel.h b/include/grub/i386/coreboot/kernel.h new file mode 100644 index 000000000..442d941b0 --- /dev/null +++ b/include/grub/i386/coreboot/kernel.h @@ -0,0 +1,36 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_KERNEL_MACHINE_HEADER +#define GRUB_KERNEL_MACHINE_HEADER 1 + +#include + +#define GRUB_MOD_ALIGN 0x1000 + +/* Non-zero value is only needed for some IEEE-1275 platforms. */ +#define GRUB_MOD_GAP 0 + +#ifndef ASM_FILE +extern char grub_prefix[]; +#endif + +#define GRUB_KERNEL_MACHINE_PREFIX 0x2 +#define GRUB_KERNEL_MACHINE_DATA_END 0x42 + +#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/include/grub/i386/ieee1275/kernel.h b/include/grub/i386/ieee1275/kernel.h index dccf8cbe1..66cd4fbf7 100644 --- a/include/grub/i386/ieee1275/kernel.h +++ b/include/grub/i386/ieee1275/kernel.h @@ -1 +1,4 @@ #include + +#define GRUB_KERNEL_MACHINE_PREFIX 0x2 +#define GRUB_KERNEL_MACHINE_DATA_END 0x42 diff --git a/include/grub/powerpc/ieee1275/kernel.h b/include/grub/powerpc/ieee1275/kernel.h index 129ee200d..5b437f313 100644 --- a/include/grub/powerpc/ieee1275/kernel.h +++ b/include/grub/powerpc/ieee1275/kernel.h @@ -28,7 +28,15 @@ rewrite grub-mkimage to generate valid ELF files. */ #define GRUB_MOD_GAP 0x8000 +#ifndef ASM_FILE + void EXPORT_FUNC (grub_reboot) (void); void EXPORT_FUNC (grub_halt) (void); +/* The prefix which points to the directory where GRUB modules and its + configuration file are located. */ +extern char grub_prefix[]; + +#endif + #endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/kern/i386/ieee1275/startup.S b/kern/i386/ieee1275/startup.S index 8bb731bc3..0e1ffd17c 100644 --- a/kern/i386/ieee1275/startup.S +++ b/kern/i386/ieee1275/startup.S @@ -19,6 +19,7 @@ #define ASM_FILE 1 #include +#include #include #include #include @@ -38,6 +39,24 @@ start: _start: + jmp codestart + + /* + * This is a special data area at a fixed offset from the beginning. + */ + + . = EXT_C(start) + GRUB_KERNEL_MACHINE_PREFIX + +VARIABLE(grub_prefix) + /* to be filled by grub-mkimage */ + + /* + * Leave some breathing room for the prefix. + */ + + . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END + +codestart: movl %eax, EXT_C(grub_ieee1275_entry_fn) jmp EXT_C(grub_main) diff --git a/kern/i386/linuxbios/init.c b/kern/i386/linuxbios/init.c index 362131129..ed49071f0 100644 --- a/kern/i386/linuxbios/init.c +++ b/kern/i386/linuxbios/init.c @@ -78,12 +78,6 @@ grub_arch_sync_caches (void *address __attribute__ ((unused)), { } -static char * -make_install_device (void) -{ - return NULL; -} - void grub_machine_init (void) { @@ -155,7 +149,7 @@ void grub_machine_set_prefix (void) { /* Initialize the prefix. */ - grub_env_set ("prefix", make_install_device ()); + grub_env_set ("prefix", grub_prefix); } void diff --git a/kern/i386/linuxbios/startup.S b/kern/i386/linuxbios/startup.S index 2eb2ecdb0..930813f2c 100644 --- a/kern/i386/linuxbios/startup.S +++ b/kern/i386/linuxbios/startup.S @@ -19,6 +19,7 @@ #define ASM_FILE 1 #include +#include #include #include #include @@ -35,6 +36,24 @@ .file "startup.S" .text .globl start, _start +start: +_start: + jmp codestart + + /* + * This is a special data area at a fixed offset from the beginning. + */ + + . = EXT_C(start) + GRUB_KERNEL_MACHINE_PREFIX + +VARIABLE(grub_prefix) + /* to be filled by grub-mkimage */ + + /* + * Leave some breathing room for the prefix. + */ + + . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END #if 0 /* @@ -49,8 +68,7 @@ multiboot_header: .long -0x1BADB002 #endif -start: -_start: +codestart: /* initialize the stack */ movl $GRUB_MEMORY_MACHINE_PROT_STACK, %esp diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index efa7ca7ae..d1d53e0cf 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -84,6 +84,13 @@ grub_machine_set_prefix (void) /* We already set prefix in grub_machine_init(). */ return; + if (grub_prefix[0]) + { + grub_env_set ("prefix", grub_prefix); + /* Prefix is hardcoded in the core image. */ + return; + } + if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, sizeof (bootpath), 0)) { diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index 239d3741d..a27567a36 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -158,7 +158,7 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, } void -add_segments (char *dir, FILE *out, int chrp, char *mods[]) +add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[]) { Elf32_Ehdr ehdr; Elf32_Phdr *phdrs = NULL; @@ -166,7 +166,7 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) FILE *in; char *kernel_path; grub_addr_t grub_end = 0; - off_t offset; + off_t offset, first_segment; int i, phdr_size; /* Read ELF header. */ @@ -192,6 +192,8 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) phdrs = xmalloc (phdr_size); offset += ALIGN_UP (phdr_size, GRUB_TARGET_SIZEOF_LONG); + first_segment = offset; + /* Copy all existing segments. */ for (i = 0; i < grub_target_to_host16 (ehdr.e_phnum); i++) { @@ -272,6 +274,13 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) /* Write ELF header. */ grub_util_write_image_at (&ehdr, sizeof (ehdr), 0, out); + if (prefix) + { + if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END) + grub_util_error ("prefix too long"); + grub_util_write_image_at (prefix, strlen (prefix) + 1, first_segment + GRUB_KERNEL_MACHINE_PREFIX, out); + } + free (phdrs); free (kernel_path); } @@ -279,6 +288,7 @@ add_segments (char *dir, FILE *out, int chrp, char *mods[]) static struct option options[] = { {"directory", required_argument, 0, 'd'}, + {"prefix", required_argument, 0, 'p'}, {"output", required_argument, 0, 'o'}, {"help", no_argument, 0, 'h'}, {"note", no_argument, 0, 'n'}, @@ -299,6 +309,7 @@ Usage: grub-mkimage -o FILE [OPTION]... [MODULES]\n\ Make a bootable image of GRUB.\n\ \n\ -d, --directory=DIR use images and modules under DIR [default=%s]\n\ +-p, --prefix=DIR set grub_prefix directory\n\ -o, --output=FILE output a generated image to FILE\n\ -h, --help display this message and exit\n\ -n, --note add NOTE segment for CHRP Open Firmware\n\ @@ -317,13 +328,14 @@ main (int argc, char *argv[]) FILE *fp; char *output = NULL; char *dir = NULL; + char *prefix = NULL; int chrp = 0; progname = "grub-mkimage"; while (1) { - int c = getopt_long (argc, argv, "d:o:hVvn", options, 0); + int c = getopt_long (argc, argv, "d:p:o:hVvn", options, 0); if (c == -1) break; @@ -334,6 +346,11 @@ main (int argc, char *argv[]) free (dir); dir = xstrdup (optarg); break; + case 'p': + if (prefix) + free (prefix); + prefix = xstrdup (optarg); + break; case 'h': usage (0); break; @@ -364,7 +381,7 @@ main (int argc, char *argv[]) if (! fp) grub_util_error ("cannot open %s", output); - add_segments (dir ? : GRUB_LIBDIR, fp, chrp, argv + optind); + add_segments (dir ? : GRUB_LIBDIR, prefix, fp, chrp, argv + optind); fclose (fp); From 59198b722ca7cf2b754ddfcd93b499176f27c045 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 30 Jul 2008 10:44:38 +0000 Subject: [PATCH 0297/1707] 2008-07-30 Robert Millan * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_DATA_END): Increase from 0x50 to 0x60. * util/i386/pc/grub-install.in: Detect cross-disk installs, and use UUIDs to identify the root drive for them. If that's not possible, abort. * util/i386/pc/grub-setup.c (setup): Do not special-case, or even check, for cross-disk installs. --- ChangeLog | 10 ++++++++++ include/grub/i386/pc/kernel.h | 2 +- util/i386/pc/grub-install.in | 27 +++++++++++++++++++++++---- util/i386/pc/grub-setup.c | 25 ++++++------------------- 4 files changed, 40 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63f073a46..601dbf94b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-07-30 Robert Millan + + * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_DATA_END): + Increase from 0x50 to 0x60. + * util/i386/pc/grub-install.in: Detect cross-disk installs, and + use UUIDs to identify the root drive for them. If that's not + possible, abort. + * util/i386/pc/grub-setup.c (setup): Do not special-case, or even + check, for cross-disk installs. + 2008-07-30 Robert Millan * kern/ieee1275/init.c (grub_machine_set_prefix): If `grub_prefix' diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index 402faa3a9..a00117bd7 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -41,7 +41,7 @@ #define GRUB_KERNEL_MACHINE_PREFIX 0x20 /* End of the data section. */ -#define GRUB_KERNEL_MACHINE_DATA_END 0x50 +#define GRUB_KERNEL_MACHINE_DATA_END 0x60 /* The size of the first region which won't be compressed. */ #if defined(ENABLE_LZO) diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index d7966d595..5875039a9 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -233,15 +233,34 @@ partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/nul # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` +# The order in this list is critical. Be careful when modifying it. +modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module" + +prefix_drive= if [ "x${devabstraction_module}" = "x" ] ; then - prefix_drive= + if echo "${install_device}" | grep -qx "(.*)" ; then + install_drive="${install_device}" + else + install_drive="`$grub_probe --target=drive --device ${install_device}`" + fi + grub_drive="`$grub_probe --target=drive --device ${grub_device}`" + + # Strip partition number + install_drive="`echo ${install_drive} | sed -e s/,[0-9]*//g`" + grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*//g`" + if [ "x${grub_drive}" != "x${install_drive}" ] ; then + uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" + if [ "x${uuid}" = "x" ] ; then + echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + exit 1 + fi + prefix_drive="(UUID=${uuid})" + modules="$modules fs_uuid" + fi else prefix_drive=`$grub_probe --target=drive --device ${grub_device}` fi -# The order in this list is critical. Be careful when modifying it. -modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module" - grub_prefix="${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`" || exit 1 $grub_mkimage --output=${grubdir}/core.img --prefix=${grub_prefix}/ $modules || exit 1 diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index c6f4810e8..94826855c 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -339,17 +339,11 @@ setup (const char *dir, if (grub_disk_write (dest_dev->disk, embed_region.start, 0, core_size, core_img)) grub_util_error ("%s", grub_errmsg); - /* The boot image and the core image are on the same drive, - so there is no need to specify the boot drive explicitly. */ - *boot_drive = 0xff; - *kernel_sector = grub_cpu_to_le64 (embed_region.start); + /* FIXME: can this be skipped? */ + *boot_drive = 0xFF; + *root_drive = 0xFF; - /* If the root device is different from the destination device, - it is necessary to embed the root drive explicitly. */ - if (root_dev->disk->id != dest_dev->disk->id) - *root_drive = (grub_uint8_t) root_dev->disk->id; - else - *root_drive = 0xFF; + *kernel_sector = grub_cpu_to_le64 (embed_region.start); /* Write the boot image onto the disk. */ if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, @@ -480,15 +474,8 @@ setup (const char *dir, *kernel_sector = grub_cpu_to_le64 (first_sector); - /* If the destination device is different from the root device, - it is necessary to embed the boot drive explicitly. */ - if (root_dev->disk->id != dest_dev->disk->id) - *boot_drive = (grub_uint8_t) root_dev->disk->id; - else - *boot_drive = 0xFF; - - /* When the core image is not embedded, the root device always follows - the boot device. */ + /* FIXME: can this be skipped? */ + *boot_drive = 0xFF; *root_drive = 0xFF; *install_dos_part = grub_cpu_to_le32 (dos_part); From 16e641b612c4b0b096983324e598be495678947f Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 31 Jul 2008 14:15:53 +0000 Subject: [PATCH 0298/1707] 2008-07-31 Bean * boot/i386/pc/lnxboot.S (real_code_2): Replace 0x50 with GRUB_KERNEL_MACHINE_DATA_END. --- ChangeLog | 5 +++++ boot/i386/pc/lnxboot.S | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 601dbf94b..717f9f1aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-07-31 Bean + + * boot/i386/pc/lnxboot.S (real_code_2): Replace 0x50 with + GRUB_KERNEL_MACHINE_DATA_END. + 2008-07-30 Robert Millan * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_DATA_END): diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index a8d056c50..e7f55df86 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -186,7 +186,7 @@ real_code_2: call move_memory /* Check for multiboot signature. */ - cmpl $MULTIBOOT_MAGIC, %ss:(DATA_ADDR + 0x50) + cmpl $MULTIBOOT_MAGIC, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_DATA_END) jz 1f movl (ramdisk_image - start), %esi From edb3d5c2728583f857c3e0a9eac1a86fa4079b4b Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 31 Jul 2008 19:33:23 +0000 Subject: [PATCH 0299/1707] Add missing copyright years for recent changes --- disk/ata.c | 2 +- include/grub/powerpc/ieee1275/kernel.h | 2 +- kern/i386/linuxbios/init.c | 2 +- kern/i386/linuxbios/startup.S | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/disk/ata.c b/disk/ata.c index 919f51bbd..f77f63513 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -1,7 +1,7 @@ /* ata.c - ATA disk access. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. + * Copyright (C) 2007, 2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/include/grub/powerpc/ieee1275/kernel.h b/include/grub/powerpc/ieee1275/kernel.h index 5b437f313..bb6767c2b 100644 --- a/include/grub/powerpc/ieee1275/kernel.h +++ b/include/grub/powerpc/ieee1275/kernel.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/kern/i386/linuxbios/init.c b/kern/i386/linuxbios/init.c index ed49071f0..7293a394a 100644 --- a/kern/i386/linuxbios/init.c +++ b/kern/i386/linuxbios/init.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/kern/i386/linuxbios/startup.S b/kern/i386/linuxbios/startup.S index 930813f2c..4b11245ac 100644 --- a/kern/i386/linuxbios/startup.S +++ b/kern/i386/linuxbios/startup.S @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 3d8383e7a53661905b50aea6bcba2260dccab204 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 31 Jul 2008 20:48:40 +0000 Subject: [PATCH 0300/1707] 2008-07-31 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): When loading ELF segments, use a macro for arbitrarily accessing any of them instead of preparing a pointer that allows access to one at a time. (grub_multiboot_load_elf64): Likewise. --- ChangeLog | 7 ++++ loader/i386/pc/multiboot.c | 76 ++++++++++++++++++++------------------ 2 files changed, 47 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 717f9f1aa..7b6f19400 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-07-31 Robert Millan + + * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): When loading + ELF segments, use a macro for arbitrarily accessing any of them instead + of preparing a pointer that allows access to one at a time. + (grub_multiboot_load_elf64): Likewise. + 2008-07-31 Bean * boot/i386/pc/lnxboot.S (real_code_2): Replace 0x50 with diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index ac2cf2da8..0e336cbf9 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -97,7 +97,7 @@ static grub_err_t grub_multiboot_load_elf32 (grub_file_t file, void *buffer) { Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; - Elf32_Phdr *phdr; + char *phdr_base; grub_addr_t physical_entry_addr = 0; int i; @@ -116,43 +116,45 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) entry = ehdr->e_entry; + phdr_base = (char *) buffer + ehdr->e_phoff; +#define phdr(i) ((Elf32_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) + /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { - phdr = (Elf32_Phdr *) ((char *) buffer + ehdr->e_phoff - + i * ehdr->e_phentsize); - if (phdr->p_type == PT_LOAD) + if (phdr(i)->p_type == PT_LOAD) { /* The segment should fit in the area reserved for the OS. */ - if (phdr->p_paddr < grub_os_area_addr) + if (phdr(i)->p_paddr < grub_os_area_addr) return grub_error (GRUB_ERR_BAD_OS, "segment doesn't fit in memory reserved for the OS (0x%lx < 0x%lx)", - phdr->p_paddr, grub_os_area_addr); - if (phdr->p_paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size) + phdr(i)->p_paddr, grub_os_area_addr); + if (phdr(i)->p_paddr + phdr(i)->p_memsz > grub_os_area_addr + grub_os_area_size) return grub_error (GRUB_ERR_BAD_OS, "segment doesn't fit in memory reserved for the OS (0x%lx > 0x%lx)", - phdr->p_paddr + phdr->p_memsz, + phdr(i)->p_paddr + phdr(i)->p_memsz, grub_os_area_addr + grub_os_area_size); - if (grub_file_seek (file, (grub_off_t) phdr->p_offset) + if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) return grub_error (GRUB_ERR_BAD_OS, "invalid offset in program header"); - if (grub_file_read (file, (void *) phdr->p_paddr, phdr->p_filesz) - != (grub_ssize_t) phdr->p_filesz) + if (grub_file_read (file, (void *) phdr(i)->p_paddr, phdr(i)->p_filesz) + != (grub_ssize_t) phdr(i)->p_filesz) return grub_error (GRUB_ERR_BAD_OS, "couldn't read segment from file"); - if (phdr->p_filesz < phdr->p_memsz) - grub_memset ((char *) phdr->p_paddr + phdr->p_filesz, 0, - phdr->p_memsz - phdr->p_filesz); + if (phdr(i)->p_filesz < phdr(i)->p_memsz) + grub_memset ((char *) phdr(i)->p_paddr + phdr(i)->p_filesz, 0, + phdr(i)->p_memsz - phdr(i)->p_filesz); - if ((entry >= phdr->p_vaddr) && - (entry < phdr->p_vaddr + phdr->p_memsz)) - physical_entry_addr = entry + phdr->p_paddr - phdr->p_vaddr; + if ((entry >= phdr(i)->p_vaddr) && + (entry < phdr(i)->p_vaddr + phdr(i)->p_memsz)) + physical_entry_addr = entry + phdr(i)->p_paddr - phdr(i)->p_vaddr; } } +#undef phdr if (physical_entry_addr) entry = physical_entry_addr; @@ -173,7 +175,7 @@ static grub_err_t grub_multiboot_load_elf64 (grub_file_t file, void *buffer) { Elf64_Ehdr *ehdr = (Elf64_Ehdr *) buffer; - Elf64_Phdr *phdr; + char *phdr_base; grub_addr_t physical_entry_addr = 0; int i; @@ -202,47 +204,49 @@ grub_multiboot_load_elf64 (grub_file_t file, void *buffer) entry = ehdr->e_entry; + phdr_base = (char *) buffer + ehdr->e_phoff; +#define phdr(i) ((Elf64_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) + /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { - phdr = (Elf64_Phdr *) ((char *) buffer + ehdr->e_phoff - + i * ehdr->e_phentsize); - if (phdr->p_type == PT_LOAD) + if (phdr(i)->p_type == PT_LOAD) { /* The segment should fit in the area reserved for the OS. */ - if (phdr->p_paddr < (grub_uint64_t) grub_os_area_addr) + if (phdr(i)->p_paddr < (grub_uint64_t) grub_os_area_addr) return grub_error (GRUB_ERR_BAD_OS, "segment doesn't fit in memory reserved for the OS (0x%lx < 0x%lx)", - phdr->p_paddr, (grub_uint64_t) grub_os_area_addr); - if (phdr->p_paddr + phdr->p_memsz + phdr(i)->p_paddr, (grub_uint64_t) grub_os_area_addr); + if (phdr(i)->p_paddr + phdr(i)->p_memsz > (grub_uint64_t) grub_os_area_addr + (grub_uint64_t) grub_os_area_size) return grub_error (GRUB_ERR_BAD_OS, "segment doesn't fit in memory reserved for the OS (0x%lx > 0x%lx)", - phdr->p_paddr + phdr->p_memsz, + phdr(i)->p_paddr + phdr(i)->p_memsz, (grub_uint64_t) grub_os_area_addr + (grub_uint64_t) grub_os_area_size); - if (grub_file_seek (file, (grub_off_t) phdr->p_offset) + if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) return grub_error (GRUB_ERR_BAD_OS, "invalid offset in program header"); - if (grub_file_read (file, (void *) ((grub_uint32_t) phdr->p_paddr), - phdr->p_filesz) - != (grub_ssize_t) phdr->p_filesz) + if (grub_file_read (file, (void *) ((grub_uint32_t) phdr(i)->p_paddr), + phdr(i)->p_filesz) + != (grub_ssize_t) phdr(i)->p_filesz) return grub_error (GRUB_ERR_BAD_OS, "couldn't read segment from file"); - if (phdr->p_filesz < phdr->p_memsz) - grub_memset (((char *) ((grub_uint32_t) phdr->p_paddr) - + phdr->p_filesz), + if (phdr(i)->p_filesz < phdr(i)->p_memsz) + grub_memset (((char *) ((grub_uint32_t) phdr(i)->p_paddr) + + phdr(i)->p_filesz), 0, - phdr->p_memsz - phdr->p_filesz); + phdr(i)->p_memsz - phdr(i)->p_filesz); - if ((entry >= phdr->p_vaddr) && - (entry < phdr->p_vaddr + phdr->p_memsz)) - physical_entry_addr = entry + phdr->p_paddr - phdr->p_vaddr; + if ((entry >= phdr(i)->p_vaddr) && + (entry < phdr(i)->p_vaddr + phdr(i)->p_memsz)) + physical_entry_addr = entry + phdr(i)->p_paddr - phdr(i)->p_vaddr; } } +#undef phdr if (physical_entry_addr) entry = physical_entry_addr; From 9175e93d11669e15fdf29090b43d1ca877129366 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 1 Aug 2008 04:06:55 +0000 Subject: [PATCH 0301/1707] 2008-08-01 Bean * conf/common.rmk (pkglib_MODULES): Add bufio.mod. (bufio_mod_SOURCES): New macro. (bufio_mod_CFLAGS): Likewise. (bufio_mod_LDFLAGS): Likewise. * include/grub/bufio.h: New file. * io/bufio.c: Likewise. * video/png.c: Replace with . (grub_video_reader_png): Use grub_buffile_open to open file. * video/jpeg.c: Replace with . (grub_video_reader_jpeg): Use grub_buffile_open to open file. * video/tga.c: Replace with . (grub_video_reader_tga): Use grub_buffile_open to open file. * font/manager.c: Include . (add_font): Use grub_buffile_open to open file. --- ChangeLog | 23 +++++ conf/common.mk | 59 ++++++++++++- conf/common.rmk | 7 +- font/manager.c | 3 +- include/grub/bufio.h | 28 ++++++ io/bufio.c | 205 +++++++++++++++++++++++++++++++++++++++++++ video/readers/jpeg.c | 4 +- video/readers/png.c | 4 +- video/readers/tga.c | 4 +- 9 files changed, 328 insertions(+), 9 deletions(-) create mode 100644 include/grub/bufio.h create mode 100644 io/bufio.c diff --git a/ChangeLog b/ChangeLog index 7b6f19400..fb14bd3bf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2008-08-01 Bean + + * conf/common.rmk (pkglib_MODULES): Add bufio.mod. + (bufio_mod_SOURCES): New macro. + (bufio_mod_CFLAGS): Likewise. + (bufio_mod_LDFLAGS): Likewise. + + * include/grub/bufio.h: New file. + + * io/bufio.c: Likewise. + + * video/png.c: Replace with . + (grub_video_reader_png): Use grub_buffile_open to open file. + + * video/jpeg.c: Replace with . + (grub_video_reader_jpeg): Use grub_buffile_open to open file. + + * video/tga.c: Replace with . + (grub_video_reader_tga): Use grub_buffile_open to open file. + + * font/manager.c: Include . + (add_font): Use grub_buffile_open to open file. + 2008-07-31 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): When loading diff --git a/conf/common.mk b/conf/common.mk index 11aeee981..4a8b72cff 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -3275,7 +3275,7 @@ crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) # Misc. -pkglib_MODULES += gzio.mod elf.mod +pkglib_MODULES += gzio.mod bufio.mod elf.mod # For elf.mod. elf_mod_SOURCES = kern/elf.c @@ -3390,3 +3390,60 @@ partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For bufio.mod. +bufio_mod_SOURCES = io/bufio.c +CLEANFILES += bufio.mod mod-bufio.o mod-bufio.c pre-bufio.o bufio_mod-io_bufio.o und-bufio.lst +ifneq ($(bufio_mod_EXPORTS),no) +CLEANFILES += def-bufio.lst +DEFSYMFILES += def-bufio.lst +endif +MOSTLYCLEANFILES += bufio_mod-io_bufio.d +UNDSYMFILES += und-bufio.lst + +bufio.mod: pre-bufio.o mod-bufio.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(bufio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bufio.o mod-bufio.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-bufio.o: $(bufio_mod_DEPENDENCIES) bufio_mod-io_bufio.o + -rm -f $@ + $(TARGET_CC) $(bufio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bufio_mod-io_bufio.o + +mod-bufio.o: mod-bufio.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -c -o $@ $< + +mod-bufio.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'bufio' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(bufio_mod_EXPORTS),no) +def-bufio.lst: pre-bufio.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 bufio/' > $@ +endif + +und-bufio.lst: pre-bufio.o + echo 'bufio' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +bufio_mod-io_bufio.o: io/bufio.c $(io/bufio.c_DEPENDENCIES) + $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -MD -c -o $@ $< +-include bufio_mod-io_bufio.d + +CLEANFILES += cmd-bufio_mod-io_bufio.lst fs-bufio_mod-io_bufio.lst partmap-bufio_mod-io_bufio.lst +COMMANDFILES += cmd-bufio_mod-io_bufio.lst +FSFILES += fs-bufio_mod-io_bufio.lst +PARTMAPFILES += partmap-bufio_mod-io_bufio.lst + +cmd-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bufio > $@ || (rm -f $@; exit 1) + +fs-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bufio > $@ || (rm -f $@; exit 1) + +partmap-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bufio > $@ || (rm -f $@; exit 1) + + +bufio_mod_CFLAGS = $(COMMON_CFLAGS) +bufio_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/common.rmk b/conf/common.rmk index 7db0b2a32..3d3cd8aec 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -382,7 +382,7 @@ crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) # Misc. -pkglib_MODULES += gzio.mod elf.mod +pkglib_MODULES += gzio.mod bufio.mod elf.mod # For elf.mod. elf_mod_SOURCES = kern/elf.c @@ -393,3 +393,8 @@ elf_mod_LDFLAGS = $(COMMON_LDFLAGS) gzio_mod_SOURCES = io/gzio.c gzio_mod_CFLAGS = $(COMMON_CFLAGS) gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For bufio.mod. +bufio_mod_SOURCES = io/bufio.c +bufio_mod_CFLAGS = $(COMMON_CFLAGS) +bufio_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/font/manager.c b/font/manager.c index 80d8d07b5..28f63ae75 100644 --- a/font/manager.c +++ b/font/manager.c @@ -23,6 +23,7 @@ #include #include #include +#include struct entry { @@ -69,7 +70,7 @@ add_font (const char *filename) grub_uint32_t num, i; struct font *font = 0; - file = grub_file_open (filename); + file = grub_buffile_open (filename, 0); if (! file) goto fail; diff --git a/include/grub/bufio.h b/include/grub/bufio.h new file mode 100644 index 000000000..9a2294c26 --- /dev/null +++ b/include/grub/bufio.h @@ -0,0 +1,28 @@ +/* bufio.h - prototypes for bufio */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_BUFIO_H +#define GRUB_BUFIO_H 1 + +#include + +grub_file_t grub_bufio_open (grub_file_t io, int size); +grub_file_t grub_buffile_open (const char *name, int size); + +#endif /* ! GRUB_BUFIO_H */ diff --git a/io/bufio.c b/io/bufio.c new file mode 100644 index 000000000..92f29279e --- /dev/null +++ b/io/bufio.c @@ -0,0 +1,205 @@ +/* bufio.c - buffered io access */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#define GRUB_BUFIO_DEF_SIZE 8192 +#define GRUB_BUFIO_MAX_SIZE 1048576 + +struct grub_bufio +{ + grub_file_t file; + grub_size_t block_size; + grub_size_t buffer_len; + char buffer[0]; +}; +typedef struct grub_bufio *grub_bufio_t; + +static struct grub_fs grub_bufio_fs; + +grub_file_t +grub_bufio_open (grub_file_t io, int size) +{ + grub_file_t file; + grub_bufio_t bufio = 0; + + file = (grub_file_t) grub_malloc (sizeof (*file)); + if (! file) + return 0; + + if (size == 0) + size = GRUB_BUFIO_DEF_SIZE; + else if (size > GRUB_BUFIO_MAX_SIZE) + size = GRUB_BUFIO_MAX_SIZE; + + if ((size < 0) || ((unsigned) size > io->size)) + size = ((io->size > GRUB_BUFIO_MAX_SIZE) ? GRUB_BUFIO_MAX_SIZE : + io->size); + + bufio = grub_malloc (sizeof (struct grub_bufio) + size); + if (! bufio) + { + grub_free (file); + return 0; + } + + bufio->file = io; + bufio->block_size = size; + bufio->buffer_len = 0; + + file->device = io->device; + file->offset = 0; + file->size = io->size; + file->data = bufio; + file->read_hook = 0; + file->fs = &grub_bufio_fs; + + return file; +} + +grub_file_t +grub_buffile_open (const char *name, int size) +{ + grub_file_t io, file; + + io = grub_file_open (name); + if (! io) + return 0; + + file = grub_bufio_open (io, size); + if (! file) + { + grub_file_close (io); + return 0; + } + + return file; +} + +static grub_ssize_t +grub_bufio_read (grub_file_t file, char *buf, grub_size_t len) +{ + grub_size_t res = len; + grub_bufio_t bufio = file->data; + grub_uint32_t pos; + + if ((file->offset >= bufio->file->offset) && + (file->offset < bufio->file->offset + bufio->buffer_len)) + { + grub_size_t n; + + pos = file->offset - bufio->file->offset; + n = bufio->buffer_len - pos; + if (n > len) + n = len; + + grub_memcpy (buf, &bufio->buffer[pos], n); + len -= n; + if (! len) + return res; + + buf += n; + bufio->file->offset += bufio->buffer_len; + pos = 0; + } + else + { + bufio->file->offset = grub_divmod64 (file->offset, bufio->block_size, + &pos); + bufio->file->offset *= bufio->block_size; + } + + if (pos + len >= bufio->block_size) + { + if (pos) + { + grub_size_t n; + + bufio->file->fs->read (bufio->file, bufio->buffer, + bufio->block_size); + if (grub_errno) + return -1; + + n = bufio->block_size - pos; + grub_memcpy (buf, &bufio->buffer[pos], n); + len -= n; + buf += n; + bufio->file->offset += bufio->block_size; + pos = 0; + } + + while (len >= bufio->block_size) + { + bufio->file->fs->read (bufio->file, buf, bufio->block_size); + if (grub_errno) + return -1; + + len -= bufio->block_size; + buf += bufio->block_size; + bufio->file->offset += bufio->block_size; + } + + if (! len) + { + bufio->buffer_len = 0; + return res; + } + } + + bufio->buffer_len = bufio->file->size - bufio->file->offset; + if (bufio->buffer_len > bufio->block_size) + bufio->buffer_len = bufio->block_size; + + bufio->file->fs->read (bufio->file, bufio->buffer, bufio->buffer_len); + if (grub_errno) + return -1; + + grub_memcpy (buf, &bufio->buffer[pos], len); + + return res; +} + +static grub_err_t +grub_bufio_close (grub_file_t file) +{ + grub_bufio_t bufio = file->data; + + grub_file_close (bufio->file); + grub_free (bufio); + + file->device = 0; + + return grub_errno; +} + +static struct grub_fs grub_bufio_fs = + { + .name = "bufio", + .dir = 0, + .open = 0, + .read = grub_bufio_read, + .close = grub_bufio_close, + .label = 0, + .next = 0 + }; diff --git a/video/readers/jpeg.c b/video/readers/jpeg.c index 8a4f80307..03f3a9437 100644 --- a/video/readers/jpeg.c +++ b/video/readers/jpeg.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include /* Uncomment following define to enable JPEG debug. */ //#define JPEG_DEBUG @@ -664,7 +664,7 @@ grub_video_reader_jpeg (struct grub_video_bitmap **bitmap, grub_file_t file; struct grub_jpeg_data *data; - file = grub_file_open (filename); + file = grub_buffile_open (filename, 0); if (!file) return grub_errno; diff --git a/video/readers/png.c b/video/readers/png.c index 9dac4b64c..ceb77e72c 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include /* Uncomment following define to enable PNG debug. */ //#define PNG_DEBUG @@ -840,7 +840,7 @@ grub_video_reader_png (struct grub_video_bitmap **bitmap, grub_file_t file; struct grub_png_data *data; - file = grub_file_open (filename); + file = grub_buffile_open (filename, 0); if (!file) return grub_errno; diff --git a/video/readers/tga.c b/video/readers/tga.c index 7b944b09f..e99841532 100644 --- a/video/readers/tga.c +++ b/video/readers/tga.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include /* Uncomment following define to enable TGA debug. */ //#define TGA_DEBUG @@ -319,7 +319,7 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, struct grub_tga_header header; int has_alpha; - file = grub_file_open (filename); + file = grub_buffile_open (filename, 0); if (! file) return grub_errno; From cdfb3d2273fce654c3a2fcfe77e479a17246c646 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 1 Aug 2008 12:56:56 +0000 Subject: [PATCH 0302/1707] 2008-08-01 Robert Millan * util/grub.d/10_linux.in: Use prepare_grub_to_access_device() from within menuentries, not before them. util/grub.d/10_hurd.in: Likewise. --- ChangeLog | 6 ++++++ util/grub.d/10_hurd.in | 5 +++-- util/grub.d/10_linux.in | 10 ++++++---- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb14bd3bf..17c0347c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-01 Robert Millan + + * util/grub.d/10_linux.in: Use prepare_grub_to_access_device() from + within menuentries, not before them. + util/grub.d/10_hurd.in: Likewise. + 2008-08-01 Bean * conf/common.rmk (pkglib_MODULES): Add bufio.mod. diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index ed54f2f0a..833b24fc6 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -68,10 +68,11 @@ if ${all_of_them} && test -e /lib/ld.so.1 ; then : ; else exit 1 fi -prepare_grub_to_access_device ${GRUB_DEVICE} - cat << EOF menuentry "${OS}" { +EOF +prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" +cat << EOF multiboot ${kernel} root=device:${GRUB_DEVICE} module /hurd/${hurd_fs}.static --readonly \\ --multiboot-command-line='\${kernel-command-line}' \\ diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 2512bd26e..9045904cb 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -97,10 +97,6 @@ list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` -if [ "x$list" != "x" ] ; then - prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} -fi - while [ "x$list" != "x" ] ; do linux=`find_latest $list` echo "Found linux image: $linux" >&2 @@ -128,6 +124,9 @@ while [ "x$list" != "x" ] ; do cat << EOF menuentry "${OS}, linux ${version}" { +EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + cat << EOF linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} EOF if test -n "${initrd}" ; then @@ -141,6 +140,9 @@ EOF cat << EOF menuentry "${OS}, linux ${version} (single-user mode)" { +EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + cat << EOF linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro single ${GRUB_CMDLINE_LINUX} EOF if test -n "${initrd}" ; then From b15d8a0cc61a3593194510cb4e156d3c68dc9918 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 1 Aug 2008 18:18:32 +0000 Subject: [PATCH 0303/1707] 2008-08-01 Bean * normal/menu_entry.c (editor_getline): Don't return the original string as result, as it will be released by lexer once it has done using it. --- ChangeLog | 6 ++++++ normal/menu_entry.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 17c0347c1..b4478f76f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-01 Bean + + * normal/menu_entry.c (editor_getline): Don't return the original + string as result, as it will be released by lexer once it has done + using it. + 2008-08-01 Robert Millan * util/grub.d/10_linux.in: Use prepare_grub_to_access_device() from diff --git a/normal/menu_entry.c b/normal/menu_entry.c index 5faeef07a..a9c17886f 100644 --- a/normal/menu_entry.c +++ b/normal/menu_entry.c @@ -996,7 +996,7 @@ run (struct screen *screen) linep->len = p - linep->buf; for (p = linep->buf; grub_isspace (*p); p++) ; - *line = p; + *line = grub_strdup (p); currline++; return 0; } From a927cc738309279c868ea9feeea535adc74b4c64 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 Aug 2008 12:12:14 +0000 Subject: [PATCH 0304/1707] 2008-08-02 Robert Millan * loader/i386/pc/multiboot.c (playground, forward_relocator) (backward_relocator): New variables. Used to allocate and relocate the payload, respectively. (grub_multiboot_load_elf32): Load into heap instead of requested address, install the appropiate relocator code in each bound of the payload, and set the entry point such that grub_multiboot_real_boot() will jump to one of them. * kern/i386/loader.S (grub_multiboot_payload_size) (grub_multiboot_payload_orig, grub_multiboot_payload_dest) (grub_multiboot_payload_entry_offset): New variables. (grub_multiboot_real_boot): Set cpu context to what the relocator expects, and jump to the relocator instead of the payload. * include/grub/i386/loader.h (grub_multiboot_payload_size) (grub_multiboot_payload_orig, grub_multiboot_payload_dest) (grub_multiboot_payload_entry_offset): Export. --- ChangeLog | 20 ++++++++++ include/grub/i386/loader.h | 4 ++ kern/i386/loader.S | 24 ++++++++--- loader/i386/pc/multiboot.c | 82 ++++++++++++++++++++++++++++---------- 4 files changed, 104 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4478f76f..e8e55a957 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2008-08-02 Robert Millan + + * loader/i386/pc/multiboot.c (playground, forward_relocator) + (backward_relocator): New variables. Used to allocate and relocate + the payload, respectively. + (grub_multiboot_load_elf32): Load into heap instead of requested + address, install the appropiate relocator code in each bound of + the payload, and set the entry point such that + grub_multiboot_real_boot() will jump to one of them. + + * kern/i386/loader.S (grub_multiboot_payload_size) + (grub_multiboot_payload_orig, grub_multiboot_payload_dest) + (grub_multiboot_payload_entry_offset): New variables. + (grub_multiboot_real_boot): Set cpu context to what the relocator + expects, and jump to the relocator instead of the payload. + + * include/grub/i386/loader.h (grub_multiboot_payload_size) + (grub_multiboot_payload_orig, grub_multiboot_payload_dest) + (grub_multiboot_payload_entry_offset): Export. + 2008-08-01 Bean * normal/menu_entry.c (editor_getline): Don't return the original diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index b120207a9..2a2325c93 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -43,6 +43,10 @@ void EXPORT_FUNC(grub_multiboot2_real_boot) (grub_addr_t entry, void EXPORT_FUNC(grub_unix_real_boot) (grub_addr_t entry, ...) __attribute__ ((cdecl,noreturn)); +extern grub_addr_t EXPORT_VAR(grub_multiboot_payload_orig); +extern grub_addr_t EXPORT_VAR(grub_multiboot_payload_dest); +extern grub_size_t EXPORT_VAR(grub_multiboot_payload_size); +extern grub_uint32_t EXPORT_VAR(grub_multiboot_payload_entry_offset); /* It is necessary to export these functions, because normal mode commands reuse rescue mode commands. */ diff --git a/kern/i386/loader.S b/kern/i386/loader.S index 39cf6a001..8a0f45c4b 100644 --- a/kern/i386/loader.S +++ b/kern/i386/loader.S @@ -123,6 +123,15 @@ linux_setup_seg: * This starts the multiboot kernel. */ +VARIABLE(grub_multiboot_payload_size) + .long 0 +VARIABLE(grub_multiboot_payload_orig) + .long 0 +VARIABLE(grub_multiboot_payload_dest) + .long 0 +VARIABLE(grub_multiboot_payload_entry_offset) + .long 0 + FUNCTION(grub_multiboot_real_boot) /* Push the entry address on the stack. */ pushl %eax @@ -136,11 +145,16 @@ FUNCTION(grub_multiboot_real_boot) /* Interrupts should be disabled. */ cli - /* Move the magic value into eax and jump to the kernel. */ - movl $MULTIBOOT_MAGIC2,%eax - popl %ecx - jmp *%ecx - + /* Where do we copy what from. */ + movl EXT_C(grub_multiboot_payload_size), %ecx + movl EXT_C(grub_multiboot_payload_orig), %esi + movl EXT_C(grub_multiboot_payload_dest), %edi + movl EXT_C(grub_multiboot_payload_entry_offset), %eax + + /* Jump to the relocator. */ + popl %edx + jmp *%edx + /* * This starts the multiboot 2 kernel. */ diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 0e336cbf9..d39dea857 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -50,6 +50,33 @@ extern grub_dl_t my_mod; static struct grub_multiboot_info *mbi; static grub_addr_t entry; +static char *playground = NULL; + +static grub_uint8_t forward_relocator[] = +{ + 0xfc, /* cld */ + 0x89, 0xf2, /* movl %esi, %edx */ + 0xf3, 0xa4, /* rep movsb */ + 0x01, 0xc2, /* addl %eax, %edx */ + 0xb8, 0x02, 0xb0, 0xad, 0x2b, /* movl $MULTIBOOT_MAGIC2, %eax */ + 0xff, 0xe2, /* jmp *%edx */ +}; + +static grub_uint8_t backward_relocator[] = +{ + 0xfd, /* std */ + 0x01, 0xce, /* addl %ecx, %esi */ + 0x01, 0xcf, /* addl %ecx, %edi */ + /* backward movsb is implicitly off-by-one. compensate that. */ + 0x41, /* incl %ecx */ + 0xf3, 0xa4, /* rep movsb */ + /* same problem again. */ + 0x47, /* incl %edi */ + 0x01, 0xc7, /* addl %eax, %edi */ + 0xb8, 0x02, 0xb0, 0xad, 0x2b, /* movl $MULTIBOOT_MAGIC2, %eax */ + 0xff, 0xe7, /* jmp *%edi */ +}; + static grub_err_t grub_multiboot_boot (void) { @@ -99,6 +126,7 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; char *phdr_base; grub_addr_t physical_entry_addr = 0; + int lowest_segment = 0, highest_segment = 0; int i; if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) @@ -114,50 +142,62 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); - entry = ehdr->e_entry; - phdr_base = (char *) buffer + ehdr->e_phoff; #define phdr(i) ((Elf32_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) + for (i = 0; i < ehdr->e_phnum; i++) + if (phdr(i)->p_type == PT_LOAD) + { + if (phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr) + lowest_segment = i; + if (phdr(i)->p_paddr > phdr(highest_segment)->p_paddr) + highest_segment = i; + } + grub_multiboot_payload_size = (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; + grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; + + if (playground) + grub_free (playground); + playground = grub_malloc (sizeof (forward_relocator) + grub_multiboot_payload_size + sizeof (backward_relocator)); + if (! playground) + return grub_errno; + + grub_multiboot_payload_orig = playground + sizeof (forward_relocator); + + grub_memmove (playground, forward_relocator, sizeof (forward_relocator)); + grub_memmove (grub_multiboot_payload_orig + grub_multiboot_payload_size, backward_relocator, sizeof (backward_relocator)); + /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { if (phdr(i)->p_type == PT_LOAD) { - /* The segment should fit in the area reserved for the OS. */ - if (phdr(i)->p_paddr < grub_os_area_addr) - return grub_error (GRUB_ERR_BAD_OS, - "segment doesn't fit in memory reserved for the OS (0x%lx < 0x%lx)", - phdr(i)->p_paddr, grub_os_area_addr); - if (phdr(i)->p_paddr + phdr(i)->p_memsz > grub_os_area_addr + grub_os_area_size) - return grub_error (GRUB_ERR_BAD_OS, - "segment doesn't fit in memory reserved for the OS (0x%lx > 0x%lx)", - phdr(i)->p_paddr + phdr(i)->p_memsz, - grub_os_area_addr + grub_os_area_size); + char *load_this_module_at = grub_multiboot_payload_orig + (phdr(i)->p_paddr - phdr(0)->p_paddr); - if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) + if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) return grub_error (GRUB_ERR_BAD_OS, "invalid offset in program header"); - if (grub_file_read (file, (void *) phdr(i)->p_paddr, phdr(i)->p_filesz) + if (grub_file_read (file, load_this_module_at, phdr(i)->p_filesz) != (grub_ssize_t) phdr(i)->p_filesz) return grub_error (GRUB_ERR_BAD_OS, "couldn't read segment from file"); if (phdr(i)->p_filesz < phdr(i)->p_memsz) - grub_memset ((char *) phdr(i)->p_paddr + phdr(i)->p_filesz, 0, + grub_memset (load_this_module_at + phdr(i)->p_filesz, 0, phdr(i)->p_memsz - phdr(i)->p_filesz); - - if ((entry >= phdr(i)->p_vaddr) && - (entry < phdr(i)->p_vaddr + phdr(i)->p_memsz)) - physical_entry_addr = entry + phdr(i)->p_paddr - phdr(i)->p_vaddr; } } + + grub_multiboot_payload_entry_offset = ehdr->e_entry - phdr(lowest_segment)->p_vaddr; + #undef phdr - if (physical_entry_addr) - entry = physical_entry_addr; + if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) + entry = (grub_addr_t) playground; + else + entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size; return grub_errno; } From 3bd0a12acabe1913342f47fa2d3b6cfc88bd2fe5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 Aug 2008 12:17:44 +0000 Subject: [PATCH 0305/1707] 2008-08-02 Robert Millan * disk/memdisk.c (memdisk_size): Don't initialize. (GRUB_MOD_INIT(memdisk)): Find memdisk using grub_module_iterate(). * include/grub/i386/pc/kernel.h (GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): Remove macro. (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Shift. (grub_memdisk_image_size, grub_arch_memdisk_addr) (grub_arch_memdisk_size): Remove. * include/grub/kernel.h (struct grub_module_header): Remove `offset' field (was only used to transfer a constant). Add `type' field to support multiple module types. (grub_module_iterate): New function. * kern/device.c (grub_device_open): Do not hide error messages when grub_disk_open() fails. Use grub_print_error() instead. * kern/i386/pc/init.c (grub_arch_modules_addr) (grub_arch_memdisk_size): Remove functions. (grub_arch_modules_addr): Return the module address in high memory (now that it isn't copied anymore). * kern/i386/pc/startup.S (grub_memdisk_image_size): Remove variable. (codestart): Don't add grub_memdisk_image_size to %ecx in LZMA decompression routine (grub_total_module_size already includes that now). Don't copy modules back to low memory. * kern/main.c: Include `'. (grub_load_modules): Split out (and use) ... (grub_module_iterate): ... this function, which iterates through module objects and runs a hook. Comment out grub_mm_init_region() call, as it would cause non-ELF modules to be overwritten. * util/i386/pc/grub-mkimage.c (generate_image): Instead of appending the memdisk image in its own region, make it part of the module list. * util/elf/grub-mkimage.c (options): Add "memdisk"|'m' option. (main): Parse --memdisk|-m option, and pass user-provided path as parameter to generate_image(). (add_segments): Pass `memdisk_path' down to load_modules(). (load_modules): Embed memdisk image in module section when requested. * util/i386/efi/grub-mkimage.c (make_mods_section): Initialize `header.type' instead of `header.offset'. * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add `memdisk.mod'. (memdisk_mod_SOURCES, memdisk_mod_CFLAGS) (memdisk_mod_LDFLAGS): New variables. * conf/i386-coreboot.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. --- ChangeLog | 52 ++++++++++++++++++++++++++++++ conf/i386-coreboot.mk | 59 ++++++++++++++++++++++++++++++++++- conf/i386-coreboot.rmk | 7 ++++- conf/i386-ieee1275.mk | 59 ++++++++++++++++++++++++++++++++++- conf/i386-ieee1275.rmk | 7 ++++- conf/powerpc-ieee1275.mk | 59 ++++++++++++++++++++++++++++++++++- conf/powerpc-ieee1275.rmk | 7 ++++- disk/memdisk.c | 29 +++++++++++------ include/grub/i386/pc/kernel.h | 13 ++------ include/grub/kernel.h | 14 +++++++-- kern/device.c | 3 +- kern/i386/pc/init.c | 17 +--------- kern/i386/pc/startup.S | 9 +++--- kern/main.c | 31 +++++++++++++----- util/elf/grub-mkimage.c | 50 ++++++++++++++++++++++++----- util/i386/efi/grub-mkimage.c | 2 +- util/i386/pc/grub-mkimage.c | 29 ++++++++++------- 17 files changed, 368 insertions(+), 79 deletions(-) diff --git a/ChangeLog b/ChangeLog index e8e55a957..eb9bdd22d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,55 @@ +2008-08-02 Robert Millan + + * disk/memdisk.c (memdisk_size): Don't initialize. + (GRUB_MOD_INIT(memdisk)): Find memdisk using grub_module_iterate(). + + * include/grub/i386/pc/kernel.h + (GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE): Remove macro. + (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Shift. + (grub_memdisk_image_size, grub_arch_memdisk_addr) + (grub_arch_memdisk_size): Remove. + + * include/grub/kernel.h (struct grub_module_header): Remove `offset' + field (was only used to transfer a constant). Add `type' field to + support multiple module types. + (grub_module_iterate): New function. + + * kern/device.c (grub_device_open): Do not hide error messages + when grub_disk_open() fails. Use grub_print_error() instead. + + * kern/i386/pc/init.c (grub_arch_modules_addr) + (grub_arch_memdisk_size): Remove functions. + (grub_arch_modules_addr): Return the module address in high memory + (now that it isn't copied anymore). + + * kern/i386/pc/startup.S (grub_memdisk_image_size): Remove variable. + (codestart): Don't add grub_memdisk_image_size to %ecx in LZMA + decompression routine (grub_total_module_size already includes that + now). Don't copy modules back to low memory. + + * kern/main.c: Include `'. + (grub_load_modules): Split out (and use) ... + (grub_module_iterate): ... this function, which iterates through + module objects and runs a hook. + Comment out grub_mm_init_region() call, as it would cause non-ELF + modules to be overwritten. + + * util/i386/pc/grub-mkimage.c (generate_image): Instead of appending + the memdisk image in its own region, make it part of the module list. + * util/elf/grub-mkimage.c (options): Add "memdisk"|'m' option. + (main): Parse --memdisk|-m option, and pass user-provided path as + parameter to generate_image(). + (add_segments): Pass `memdisk_path' down to load_modules(). + (load_modules): Embed memdisk image in module section when requested. + * util/i386/efi/grub-mkimage.c (make_mods_section): Initialize + `header.type' instead of `header.offset'. + + * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add `memdisk.mod'. + (memdisk_mod_SOURCES, memdisk_mod_CFLAGS) + (memdisk_mod_LDFLAGS): New variables. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + 2008-08-02 Robert Millan * loader/i386/pc/multiboot.c (playground, forward_relocator) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 41fc37b3d..efd9e4df8 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -555,7 +555,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod + play.mod cpuid.mod serial.mod ata.mod memdisk.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -1458,4 +1458,61 @@ partmap-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genpartmapli ata_mod_CFLAGS = $(COMMON_CFLAGS) ata_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memdisk.mod. +memdisk_mod_SOURCES = disk/memdisk.c +CLEANFILES += memdisk.mod mod-memdisk.o mod-memdisk.c pre-memdisk.o memdisk_mod-disk_memdisk.o und-memdisk.lst +ifneq ($(memdisk_mod_EXPORTS),no) +CLEANFILES += def-memdisk.lst +DEFSYMFILES += def-memdisk.lst +endif +MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d +UNDSYMFILES += und-memdisk.lst + +memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o + -rm -f $@ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memdisk_mod-disk_memdisk.o + +mod-memdisk.o: mod-memdisk.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< + +mod-memdisk.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(memdisk_mod_EXPORTS),no) +def-memdisk.lst: pre-memdisk.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memdisk/' > $@ +endif + +und-memdisk.lst: pre-memdisk.o + echo 'memdisk' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< +-include memdisk_mod-disk_memdisk.d + +CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst +COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst +FSFILES += fs-memdisk_mod-disk_memdisk.lst +PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst + +cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) + +fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) + +partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + + +memdisk_mod_CFLAGS = $(COMMON_CFLAGS) +memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 5b110d9cc..a6a997340 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -94,7 +94,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod + play.mod cpuid.mod serial.mod ata.mod memdisk.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -154,4 +154,9 @@ ata_mod_SOURCES = disk/ata.c ata_mod_CFLAGS = $(COMMON_CFLAGS) ata_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memdisk.mod. +memdisk_mod_SOURCES = disk/memdisk.c +memdisk_mod_CFLAGS = $(COMMON_CFLAGS) +memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 591408433..0c0f6220e 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -589,7 +589,7 @@ grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPE # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod + _linux.mod nand.mod memdisk.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -1586,4 +1586,61 @@ partmap-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/na nand_mod_CFLAGS = $(COMMON_CFLAGS) nand_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memdisk.mod. +memdisk_mod_SOURCES = disk/memdisk.c +CLEANFILES += memdisk.mod mod-memdisk.o mod-memdisk.c pre-memdisk.o memdisk_mod-disk_memdisk.o und-memdisk.lst +ifneq ($(memdisk_mod_EXPORTS),no) +CLEANFILES += def-memdisk.lst +DEFSYMFILES += def-memdisk.lst +endif +MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d +UNDSYMFILES += und-memdisk.lst + +memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o + -rm -f $@ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memdisk_mod-disk_memdisk.o + +mod-memdisk.o: mod-memdisk.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< + +mod-memdisk.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(memdisk_mod_EXPORTS),no) +def-memdisk.lst: pre-memdisk.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memdisk/' > $@ +endif + +und-memdisk.lst: pre-memdisk.o + echo 'memdisk' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< +-include memdisk_mod-disk_memdisk.d + +CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst +COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst +FSFILES += fs-memdisk_mod-disk_memdisk.lst +PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst + +cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) + +fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) + +partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + + +memdisk_mod_CFLAGS = $(COMMON_CFLAGS) +memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 03827ae7c..03b4173f3 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -102,7 +102,7 @@ grub_install_SOURCES = util/ieee1275/grub-install.in # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod + _linux.mod nand.mod memdisk.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -171,4 +171,9 @@ nand_mod_SOURCES = disk/ieee1275/nand.c nand_mod_CFLAGS = $(COMMON_CFLAGS) nand_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memdisk.mod. +memdisk_mod_SOURCES = disk/memdisk.c +memdisk_mod_CFLAGS = $(COMMON_CFLAGS) +memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index f9bdfe36e..cb9351d68 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -583,7 +583,8 @@ pkglib_MODULES = halt.mod \ reboot.mod \ suspend.mod \ _multiboot.mod \ - multiboot.mod + multiboot.mod \ + memdisk.mod # For _linux.mod. _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c @@ -1352,6 +1353,62 @@ partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loade multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memdisk.mod. +memdisk_mod_SOURCES = disk/memdisk.c +CLEANFILES += memdisk.mod mod-memdisk.o mod-memdisk.c pre-memdisk.o memdisk_mod-disk_memdisk.o und-memdisk.lst +ifneq ($(memdisk_mod_EXPORTS),no) +CLEANFILES += def-memdisk.lst +DEFSYMFILES += def-memdisk.lst +endif +MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d +UNDSYMFILES += und-memdisk.lst + +memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o + -rm -f $@ + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memdisk_mod-disk_memdisk.o + +mod-memdisk.o: mod-memdisk.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< + +mod-memdisk.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(memdisk_mod_EXPORTS),no) +def-memdisk.lst: pre-memdisk.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memdisk/' > $@ +endif + +und-memdisk.lst: pre-memdisk.o + echo 'memdisk' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< +-include memdisk_mod-disk_memdisk.d + +CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst +COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst +FSFILES += fs-memdisk_mod-disk_memdisk.lst +PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst + +cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) + +fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) + +partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + + +memdisk_mod_CFLAGS = $(COMMON_CFLAGS) +memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) include $(srcdir)/conf/common.mk diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 6ade1ab63..9d7a6727d 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -110,7 +110,8 @@ pkglib_MODULES = halt.mod \ reboot.mod \ suspend.mod \ _multiboot.mod \ - multiboot.mod + multiboot.mod \ + memdisk.mod # For _linux.mod. _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c @@ -159,6 +160,10 @@ multiboot_mod_SOURCES = loader/multiboot_loader_normal.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memdisk.mod. +memdisk_mod_SOURCES = disk/memdisk.c +memdisk_mod_CFLAGS = $(COMMON_CFLAGS) +memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) include $(srcdir)/conf/common.mk diff --git a/disk/memdisk.c b/disk/memdisk.c index d7f0670d1..978eae553 100644 --- a/disk/memdisk.c +++ b/disk/memdisk.c @@ -82,21 +82,30 @@ static struct grub_disk_dev grub_memdisk_dev = GRUB_MOD_INIT(memdisk) { - char *memdisk_orig_addr; + auto int hook (struct grub_module_header *); + int hook (struct grub_module_header *header) + { + if (header->type == OBJ_TYPE_MEMDISK) + { + char *memdisk_orig_addr; + memdisk_orig_addr = (char *) header + sizeof (struct grub_module_header); - memdisk_size = grub_arch_memdisk_size (); - if (! memdisk_size) - return; + grub_dprintf ("memdisk", "Found memdisk image at %p\n", memdisk_orig_addr); - memdisk_orig_addr = (char *) grub_arch_memdisk_addr (); - grub_dprintf ("memdisk", "Found memdisk image at %p\n", memdisk_orig_addr); + memdisk_size = header->size - sizeof (struct grub_module_header); + memdisk_addr = grub_malloc (memdisk_size); - memdisk_addr = grub_malloc (memdisk_size); + grub_dprintf ("memdisk", "Copying memdisk image to dynamic memory\n"); + grub_memmove (memdisk_addr, memdisk_orig_addr, memdisk_size); - grub_dprintf ("memdisk", "Copying memdisk image to dynamic memory\n"); - grub_memmove (memdisk_addr, memdisk_orig_addr, memdisk_size); + grub_disk_dev_register (&grub_memdisk_dev); + return 1; + } - grub_disk_dev_register (&grub_memdisk_dev); + return 0; + } + + grub_module_iterate (hook); } GRUB_MOD_FINI(memdisk) diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index a00117bd7..b6650bc89 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -34,14 +34,11 @@ /* The offset of GRUB_INSTALL_BSD_PART. */ #define GRUB_KERNEL_MACHINE_INSTALL_BSD_PART 0x18 -/* The offset of GRUB_MEMDISK_IMAGE_SIZE. */ -#define GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE 0x1c - /* The offset of GRUB_PREFIX. */ -#define GRUB_KERNEL_MACHINE_PREFIX 0x20 +#define GRUB_KERNEL_MACHINE_PREFIX 0x1c /* End of the data section. */ -#define GRUB_KERNEL_MACHINE_DATA_END 0x60 +#define GRUB_KERNEL_MACHINE_DATA_END 0x5c /* The size of the first region which won't be compressed. */ #if defined(ENABLE_LZO) @@ -67,9 +64,6 @@ extern grub_int32_t grub_install_dos_part; /* The BSD partition number of the installed partition. */ extern grub_int32_t grub_install_bsd_part; -/* The size of memory disk image, if present. */ -extern grub_int32_t grub_memdisk_image_size; - /* The prefix which points to the directory where GRUB modules and its configuration file are located. */ extern char grub_prefix[]; @@ -83,9 +77,6 @@ extern grub_int32_t grub_root_drive; /* The end address of the kernel. */ extern grub_addr_t grub_end_addr; -extern grub_addr_t EXPORT_FUNC(grub_arch_memdisk_addr) (void); -extern grub_off_t EXPORT_FUNC(grub_arch_memdisk_size) (void); - #endif /* ! ASM_FILE */ #endif /* ! KERNEL_MACHINE_HEADER */ diff --git a/include/grub/kernel.h b/include/grub/kernel.h index 9cbbdaf22..0401c3aa2 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -25,9 +25,15 @@ /* The module header. */ struct grub_module_header { - /* The offset of object code. */ - grub_target_off_t offset; - /* The size of object code plus this header. */ + /* The type of object. */ + grub_int8_t type; + enum + { + OBJ_TYPE_ELF, + OBJ_TYPE_MEMDISK, + } grub_module_header_types; + + /* The size of object (including this header). */ grub_target_size_t size; }; @@ -49,6 +55,8 @@ struct grub_module_info extern grub_addr_t grub_arch_modules_addr (void); +extern void EXPORT_FUNC(grub_module_iterate) (int (*hook) (struct grub_module_header *)); + /* The start point of the C code. */ void grub_main (void); diff --git a/kern/device.c b/kern/device.c index 1b5a77c00..0b44f381a 100644 --- a/kern/device.c +++ b/kern/device.c @@ -50,7 +50,8 @@ grub_device_open (const char *name) disk = grub_disk_open (name); if (! disk) { - grub_error (GRUB_ERR_BAD_DEVICE, "unknown device %s", name); + grub_print_error (); + grub_errno = GRUB_ERR_NONE; goto fail; } diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index e47cbfd86..6386686bd 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -249,22 +249,7 @@ grub_machine_fini (void) /* Return the end of the core image. */ grub_addr_t grub_arch_modules_addr (void) -{ - return grub_end_addr; -} - -/* Return the start of the memdisk image. */ -grub_addr_t -grub_arch_memdisk_addr (void) { return GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR - + (grub_kernel_image_size - GRUB_KERNEL_MACHINE_RAW_SIZE) - + grub_total_module_size; -} - -/* Return the size of the memdisk image. */ -grub_off_t -grub_arch_memdisk_size (void) -{ - return grub_memdisk_image_size; + + (grub_kernel_image_size - GRUB_KERNEL_MACHINE_RAW_SIZE); } diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 75c46adee..aa582ac49 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -96,8 +96,6 @@ VARIABLE(grub_install_dos_part) .long 0xFFFFFFFF VARIABLE(grub_install_bsd_part) .long 0xFFFFFFFF -VARIABLE(grub_memdisk_image_size) - .long 0 VARIABLE(grub_prefix) /* to be filled by grub-mkimage */ @@ -211,7 +209,6 @@ codestart: call lzo1x_decompress addl $12, %esp - /* copy back the decompressed part */ movl %eax, %ecx cld #elif defined(ENABLE_LZMA) @@ -221,19 +218,22 @@ codestart: pushl %esi movl EXT_C(grub_kernel_image_size), %ecx addl EXT_C(grub_total_module_size), %ecx - addl EXT_C(grub_memdisk_image_size), %ecx subl $GRUB_KERNEL_MACHINE_RAW_SIZE, %ecx pushl %ecx leal (%edi, %ecx), %ebx call _LzmaDecodeA + /* _LzmaDecodeA clears DF, so no need to run cld */ popl %ecx popl %edi popl %esi #endif + /* copy back the decompressed part (except the modules) */ + subl EXT_C(grub_total_module_size), %ecx rep movsb +#if 0 /* copy modules before cleaning out the bss */ movl EXT_C(grub_total_module_size), %ecx movl EXT_C(grub_kernel_image_size), %esi @@ -246,6 +246,7 @@ codestart: std rep movsb +#endif /* clean out the bss */ movl $BSS_START_SYMBOL, %edi diff --git a/kern/main.c b/kern/main.c index 5b59d41f4..acf6911dd 100644 --- a/kern/main.c +++ b/kern/main.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -28,9 +27,8 @@ #include #include -/* Load all modules in core. */ -static void -grub_load_modules (void) +void +grub_module_iterate (int (*hook) (struct grub_module_header *header)) { struct grub_module_info *modinfo; struct grub_module_header *header; @@ -47,13 +45,30 @@ grub_load_modules (void) header < (struct grub_module_header *) (modbase + modinfo->size); header = (struct grub_module_header *) ((char *) header + header->size)) { - if (! grub_dl_load_core ((char *) header + header->offset, - (header->size - header->offset))) + if (hook (header)) + break; + } +} + +/* Load all modules in core. */ +static void +grub_load_modules (void) +{ + auto int hook (struct grub_module_header *); + int hook (struct grub_module_header *header) + { + /* Not an ELF module, skip. */ + if (header->type != OBJ_TYPE_ELF) + return 0; + + if (! grub_dl_load_core ((char *) header + sizeof (struct grub_module_header), + (header->size - sizeof (struct grub_module_header)))) grub_fatal ("%s", grub_errmsg); + + return 0; } - /* Add the region where modules reside into dynamic memory. */ - grub_mm_init_region ((void *) modinfo, modinfo->size); + grub_module_iterate (hook); } /* Write hook for the environment variables of root. Remove surrounding diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index a27567a36..d53737c7f 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -97,19 +97,26 @@ load_note (Elf32_Phdr *phdr, FILE *out) void load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, - char *mods[], FILE *out) + char *mods[], FILE *out, char *memdisk_path) { char *module_img; struct grub_util_path_list *path_list; struct grub_util_path_list *p; struct grub_module_info *modinfo; - size_t offset; - size_t total_module_size; + size_t offset, total_module_size, memdisk_size; path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); offset = sizeof (struct grub_module_info); total_module_size = sizeof (struct grub_module_info); + + if (memdisk_path) + { + memdisk_size = ALIGN_UP(grub_util_get_image_size (memdisk_path), 512); + grub_util_info ("the size of memory disk is 0x%x", memdisk_size); + total_module_size += memdisk_size + sizeof (struct grub_module_header); + } + for (p = path_list; p; p = p->next) { total_module_size += (grub_util_get_image_size (p->name) @@ -135,7 +142,7 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, mod_size = grub_util_get_image_size (p->name); header = (struct grub_module_header *) (module_img + offset); - header->offset = grub_host_to_target32 (sizeof (*header)); + header->type = grub_host_to_target32 (OBJ_TYPE_ELF); header->size = grub_host_to_target32 (mod_size + sizeof (*header)); grub_util_load_image (p->name, module_img + offset + sizeof (*header)); @@ -143,6 +150,20 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, offset += sizeof (*header) + mod_size; } + if (memdisk_path) + { + struct grub_module_header *header; + + header = (struct grub_module_header *) (module_img + offset); + header->type = grub_cpu_to_le32 (OBJ_TYPE_MEMDISK); + header->size = grub_cpu_to_le32 (memdisk_size + sizeof (*header)); + offset += sizeof (*header); + + grub_util_load_image (memdisk_path, module_img + offset); + offset += memdisk_size; + } + + /* Write the module data to the new segment. */ grub_util_write_image_at (module_img, total_module_size, grub_host_to_target32 (phdr->p_offset), out); @@ -158,7 +179,7 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, } void -add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[]) +add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[], char *memdisk_path) { Elf32_Ehdr ehdr; Elf32_Phdr *phdrs = NULL; @@ -247,7 +268,7 @@ add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[]) phdr->p_offset = grub_host_to_target32 (ALIGN_UP (grub_util_get_fp_size (out), GRUB_TARGET_SIZEOF_LONG)); - load_modules (modbase, phdr, dir, mods, out); + load_modules (modbase, phdr, dir, mods, out, memdisk_path); } if (chrp) @@ -289,6 +310,7 @@ static struct option options[] = { {"directory", required_argument, 0, 'd'}, {"prefix", required_argument, 0, 'p'}, + {"memdisk", required_argument, 0, 'm'}, {"output", required_argument, 0, 'o'}, {"help", no_argument, 0, 'h'}, {"note", no_argument, 0, 'n'}, @@ -310,6 +332,7 @@ Make a bootable image of GRUB.\n\ \n\ -d, --directory=DIR use images and modules under DIR [default=%s]\n\ -p, --prefix=DIR set grub_prefix directory\n\ +-m, --memdisk=FILE embed FILE as a memdisk image\n\ -o, --output=FILE output a generated image to FILE\n\ -h, --help display this message and exit\n\ -n, --note add NOTE segment for CHRP Open Firmware\n\ @@ -329,13 +352,14 @@ main (int argc, char *argv[]) char *output = NULL; char *dir = NULL; char *prefix = NULL; + char *memdisk = NULL; int chrp = 0; progname = "grub-mkimage"; while (1) { - int c = getopt_long (argc, argv, "d:p:o:hVvn", options, 0); + int c = getopt_long (argc, argv, "d:p:m:o:hVvn", options, 0); if (c == -1) break; @@ -350,6 +374,16 @@ main (int argc, char *argv[]) if (prefix) free (prefix); prefix = xstrdup (optarg); + break; + case 'm': + if (memdisk) + free (memdisk); + memdisk = xstrdup (optarg); + + if (prefix) + free (prefix); + prefix = xstrdup ("(memdisk)/boot/grub"); + break; case 'h': usage (0); @@ -381,7 +415,7 @@ main (int argc, char *argv[]) if (! fp) grub_util_error ("cannot open %s", output); - add_segments (dir ? : GRUB_LIBDIR, prefix, fp, chrp, argv + optind); + add_segments (dir ? : GRUB_LIBDIR, prefix, fp, chrp, argv + optind, memdisk); fclose (fp); diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index db2653119..eac119b47 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -716,7 +716,7 @@ make_mods_section (FILE *out, Elf_Addr current_address, grub_util_info ("adding module %s", p->name); mod_size = grub_util_get_image_size (p->name); - header.offset = grub_cpu_to_le32 (sizeof (header)); + header.type = grub_cpu_to_le32 (OBJ_TYPE_ELF); header.size = grub_cpu_to_le32 (mod_size + sizeof (header)); mod_image = grub_util_read_image (p->name); diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 1c27284ee..4625b6ddb 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -146,19 +146,21 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me kernel_size = grub_util_get_image_size (kernel_path); total_module_size = sizeof (struct grub_module_info); + + if (memdisk_path) + { + memdisk_size = ALIGN_UP(grub_util_get_image_size (memdisk_path), 512); + grub_util_info ("the size of memory disk is 0x%x", memdisk_size); + total_module_size += memdisk_size + sizeof (struct grub_module_header); + } + for (p = path_list; p; p = p->next) total_module_size += (grub_util_get_image_size (p->name) + sizeof (struct grub_module_header)); grub_util_info ("the total module size is 0x%x", total_module_size); - if (memdisk_path) - { - memdisk_size = ALIGN_UP(grub_util_get_image_size (memdisk_path), 512); - grub_util_info ("the size of memory disk is 0x%x", memdisk_size); - } - - kernel_img = xmalloc (kernel_size + total_module_size + memdisk_size); + kernel_img = xmalloc (kernel_size + total_module_size); grub_util_load_image (kernel_path, kernel_img); if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END) @@ -180,7 +182,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me mod_size = grub_util_get_image_size (p->name); header = (struct grub_module_header *) (kernel_img + offset); - header->offset = grub_cpu_to_le32 (sizeof (*header)); + header->type = grub_cpu_to_le32 (OBJ_TYPE_ELF); header->size = grub_cpu_to_le32 (mod_size + sizeof (*header)); offset += sizeof (*header); @@ -190,11 +192,18 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me if (memdisk_path) { + struct grub_module_header *header; + + header = (struct grub_module_header *) (kernel_img + offset); + header->type = grub_cpu_to_le32 (OBJ_TYPE_MEMDISK); + header->size = grub_cpu_to_le32 (memdisk_size + sizeof (*header)); + offset += sizeof (*header); + grub_util_load_image (memdisk_path, kernel_img + offset); offset += memdisk_size; } - compress_kernel (kernel_img, kernel_size + total_module_size + memdisk_size, + compress_kernel (kernel_img, kernel_size + total_module_size, &core_img, &core_size); grub_util_info ("the core size is 0x%x", core_size); @@ -229,8 +238,6 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me = grub_cpu_to_le32 (total_module_size); *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE)) = grub_cpu_to_le32 (kernel_size); - *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_MEMDISK_IMAGE_SIZE)) - = grub_cpu_to_le32 (memdisk_size); *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE)) = grub_cpu_to_le32 (core_size - GRUB_KERNEL_MACHINE_RAW_SIZE); From 93808428ced87e0c6e9131cbc535cdbbaed6d024 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 Aug 2008 15:51:12 +0000 Subject: [PATCH 0306/1707] 2008-08-02 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Add a pair of informational grub_dprintf() calls. --- ChangeLog | 5 +++++ loader/i386/pc/multiboot.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index eb9bdd22d..2b10723ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-02 Robert Millan + + * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Add a pair + of informational grub_dprintf() calls. + 2008-08-02 Robert Millan * disk/memdisk.c (memdisk_size): Don't initialize. diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index d39dea857..0359f183e 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -174,6 +174,9 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) { char *load_this_module_at = grub_multiboot_payload_orig + (phdr(i)->p_paddr - phdr(0)->p_paddr); + grub_dprintf ("multiboot_loader", "segment %d: paddr=%p, memsz=%p\n", + i, phdr(i)->p_paddr, phdr(i)->p_memsz); + if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) return grub_error (GRUB_ERR_BAD_OS, @@ -199,6 +202,11 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) else entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size; + grub_dprintf ("multiboot_loader", "dest=%p, size=%p, entry_offset=%p\n", + grub_multiboot_payload_dest, + grub_multiboot_payload_size, + grub_multiboot_payload_entry_offset); + return grub_errno; } From 2a5cd121daaf9fb28e17f07d8a47a4bac99e8a39 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 Aug 2008 20:30:19 +0000 Subject: [PATCH 0307/1707] 2008-08-02 Robert Millan * util/i386/pc/grub-install.in: Remove trailing slash from prefix. --- ChangeLog | 4 ++++ util/i386/pc/grub-install.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2b10723ca..d90de0e6f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-02 Robert Millan + + * util/i386/pc/grub-install.in: Remove trailing slash from prefix. + 2008-08-02 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Add a pair diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 5875039a9..4a4546ee9 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -263,7 +263,7 @@ fi grub_prefix="${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`" || exit 1 -$grub_mkimage --output=${grubdir}/core.img --prefix=${grub_prefix}/ $modules || exit 1 +$grub_mkimage --output=${grubdir}/core.img --prefix=${grub_prefix} $modules || exit 1 # Now perform the installation. $grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} \ From 2d52f57f1035397ed183e7c6a488e0e26e6e5a86 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 Aug 2008 23:24:34 +0000 Subject: [PATCH 0308/1707] 2008-08-03 Robert Millan * kern/i386/pc/init.c (make_install_device): Check for `grub_prefix' instead of `grub_install_dos_part' to determine whether a drive needs to be prepended to prefix (`grub_install_dos_part' is not reliable, because it can be overriden when loading GRUB via Multiboot). --- ChangeLog | 7 +++++++ kern/i386/pc/init.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d90de0e6f..5989ecb13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-03 Robert Millan + + * kern/i386/pc/init.c (make_install_device): Check for `grub_prefix' + instead of `grub_install_dos_part' to determine whether a drive needs + to be prepended to prefix (`grub_install_dos_part' is not reliable, + because it can be overriden when loading GRUB via Multiboot). + 2008-08-02 Robert Millan * util/i386/pc/grub-install.in: Remove trailing slash from prefix. diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 6386686bd..0e973eaf4 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -64,7 +64,7 @@ make_install_device (void) /* XXX: This should be enough. */ char dev[100]; - if (grub_install_dos_part != -2) + if (grub_prefix[0] != '(') { /* If the root drive is not set explicitly, assume that it is identical to the boot drive. */ From 52768e37c2744c7027635d5de3ec16dea795d219 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Aug 2008 16:38:40 +0000 Subject: [PATCH 0309/1707] 2008-08-03 Robert Millan * util/grub.d/00_header.in: Be platform-agnostic. Probe for existence of modules instead of assuming which platform provides what. * util/update-grub.in: Likewise. --- ChangeLog | 6 ++++++ util/grub.d/00_header.in | 34 ++++++++++++++++++++++++++++------ util/update-grub.in | 29 ++++++++++++++--------------- 3 files changed, 48 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5989ecb13..e60ca752a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-03 Robert Millan + + * util/grub.d/00_header.in: Be platform-agnostic. Probe for existence + of modules instead of assuming which platform provides what. + * util/update-grub.in: Likewise. + 2008-08-03 Robert Millan * kern/i386/pc/init.c (make_install_device): Check for `grub_prefix' diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index bf9507c88..007c0268c 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -16,10 +16,12 @@ # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . +transform="@program_transform_name@" + prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -platform=@platform@ +grub_prefix=`echo /boot/grub | sed ${transform}` . ${libdir}/grub/update-grub_lib @@ -37,20 +39,37 @@ set default=${GRUB_DEFAULT} set timeout=${GRUB_TIMEOUT} EOF -case ${platform}:${GRUB_TERMINAL} in - pc:gfxterm) +case x${GRUB_TERMINAL} in + xgfxterm) # Make the font accessible prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}` + + # Pick a video backend + video_backend= + for i in vbe ; do + if test -e ${grub_prefix}/$i.mod ; then + video_backend=$i + break + fi + done + if ! [ "${video_backend}" ] ; then + echo "No suitable backend could be found for gfxterm." >&2 ; exit 1 + fi + cat << EOF if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then set gfxmode=640x480 insmod gfxterm - insmod vbe + insmod ${video_backend} terminal gfxterm fi EOF ;; - *:serial) + xserial) + if ! test -e ${grub_prefix}/serial.mod ; then + echo "Serial terminal not available on this platform." >&2 ; exit 1 + fi + if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." >&2 GRUB_SERIAL_COMMAND=serial @@ -58,7 +77,10 @@ EOF echo "${GRUB_SERIAL_COMMAND}" echo "terminal serial" ;; - *:*) + x) + # Just use the native terminal + ;; + x*) echo "terminal ${GRUB_TERMINAL}" ;; esac diff --git a/util/update-grub.in b/util/update-grub.in index 70607a50e..8c60c412f 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -26,7 +26,6 @@ sysconfdir=@sysconfdir@ grub_prefix=`echo /boot/grub | sed ${transform}` grub_cfg=${grub_prefix}/grub.cfg update_grub_dir=${sysconfdir}/grub.d -platform=@platform@ grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` @@ -127,15 +126,15 @@ if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi -# if ${GRUB_TERMINAL} is set, check it has a sane value. if undefined, -# fallback to our default -case ${platform}:${GRUB_TERMINAL} in - pc:) GRUB_TERMINAL=gfxterm ;; - ieee1275:) GRUB_TERMINAL=ofconsole ;; - *:) GRUB_TERMINAL=console ;; - pc:console | pc:serial | ieee1275:ofconsole | ieee1275:console | *:gfxterm) - ;; - *:*) echo "Invalid terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;; +case x${GRUB_TERMINAL} in + x) + # If this platform supports gfxterm, try to use it. + if test -e ${grub_prefix}/gfxterm.mod ; then + GRUB_TERMINAL=gfxterm + fi + ;; + xconsole | xserial | xofconsole | xgfxterm) ;; + *) echo "Invalid terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;; esac # check for terminals that require fonts @@ -144,16 +143,16 @@ case ${GRUB_TERMINAL} in if path=`font_path` ; then GRUB_FONT_PATH="${path}" else - # fallback to console - GRUB_TERMINAL=console + # fallback to the native terminal for this platform + unset GRUB_TERMINAL fi ;; esac # does our terminal support utf-8 ? -case ${platform}:${GRUB_TERMINAL} in - *:gfxterm) ;; - *:*) +case ${GRUB_TERMINAL} in + gfxterm) ;; + *) # make sure all our children behave in conformance with ascii.. export LANG=C ;; From e14a6184ba309d9a4dbdc36a6a4aa2fa85181fdb Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Aug 2008 17:09:21 +0000 Subject: [PATCH 0310/1707] 2008-08-03 Robert Millan * term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro. (grub_console_setcursor): Make it possible to set cursor off. --- ChangeLog | 5 +++++ term/i386/pc/vga_text.c | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e60ca752a..e7d577ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-03 Robert Millan + + * term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro. + (grub_console_setcursor): Make it possible to set cursor off. + 2008-08-03 Robert Millan * util/grub.d/00_header.in: Be platform-agnostic. Probe for existence diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index 58a3c6c2e..ec3c0f565 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -34,6 +34,8 @@ static int grub_curr_x, grub_curr_y; #define CRTC_CURSOR_ADDR_HIGH 0x0e #define CRTC_CURSOR_ADDR_LOW 0x0f +#define CRTC_CURSOR_DISABLE (1 << 5) + static void screen_write_char (int x, int y, short c) { @@ -133,5 +135,8 @@ grub_console_setcursor (int on) grub_uint8_t old; grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT); old = grub_inb (CRTC_DATA_PORT); - grub_outb ((old & ~(on << 5)), CRTC_DATA_PORT); + if (on) + grub_outb (old & ~CRTC_CURSOR_DISABLE, CRTC_DATA_PORT); + else + grub_outb (old | CRTC_CURSOR_DISABLE, CRTC_DATA_PORT); } From dd19c7d795a40b5334ba27dd00e591dfa0adb4f9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Aug 2008 18:14:07 +0000 Subject: [PATCH 0311/1707] 2008-08-03 Robert Millan Make PCI available on all i386 architectures. * include/grub/i386/pc/pci.h: Move from here ... * include/grub/i386/pci.h: ... to here. * include/grub/i386/pc/pci.h: Remove. * include/grub/i386/efi/pci.h: Remove. * include/grub/x86_64/efi/pci.h: Remove. * include/grub/pci.h: Replace `' with `'. * conf/i386-coreboot.rmk (pkglib_MODULES): Add `pci' and `lspci'. (pci_mod_SOURCES, pci_mod_CFLAGS, pci_mod_LDFLAGS, lspci_mod_SOURCES) (lspci_mod_CFLAGS, lspci_mod_LDFLAGS): New variables. * conf/i386-ieee1275.rmk: Likewise. --- ChangeLog | 20 ++++++ conf/i386-coreboot.mk | 117 ++++++++++++++++++++++++++++++- conf/i386-coreboot.rmk | 13 +++- conf/i386-ieee1275.mk | 116 +++++++++++++++++++++++++++++- conf/i386-ieee1275.rmk | 12 +++- include/grub/i386/efi/pci.h | 19 ----- include/grub/i386/{pc => }/pci.h | 0 include/grub/pci.h | 2 +- include/grub/x86_64/efi/pci.h | 19 ----- 9 files changed, 275 insertions(+), 43 deletions(-) delete mode 100644 include/grub/i386/efi/pci.h rename include/grub/i386/{pc => }/pci.h (100%) delete mode 100644 include/grub/x86_64/efi/pci.h diff --git a/ChangeLog b/ChangeLog index e7d577ee8..fbf13b284 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2008-08-03 Robert Millan + + Make PCI available on all i386 architectures. + + * include/grub/i386/pc/pci.h: Move from here ... + * include/grub/i386/pci.h: ... to here. + + * include/grub/i386/pc/pci.h: Remove. + * include/grub/i386/efi/pci.h: Remove. + * include/grub/x86_64/efi/pci.h: Remove. + + * include/grub/pci.h: Replace `' with + `'. + + * conf/i386-coreboot.rmk (pkglib_MODULES): Add `pci' and `lspci'. + (pci_mod_SOURCES, pci_mod_CFLAGS, pci_mod_LDFLAGS, lspci_mod_SOURCES) + (lspci_mod_CFLAGS, lspci_mod_LDFLAGS): New variables. + + * conf/i386-ieee1275.rmk: Likewise. + 2008-08-03 Robert Millan * term/i386/pc/vga_text.c (CRTC_CURSOR_DISABLE): New macro. diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index efd9e4df8..3fbce3630 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -555,7 +555,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod memdisk.mod + play.mod cpuid.mod serial.mod ata.mod \ + memdisk.mod pci.mod lspci.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -1515,4 +1516,118 @@ partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCI memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst +ifneq ($(pci_mod_EXPORTS),no) +CLEANFILES += def-pci.lst +DEFSYMFILES += def-pci.lst +endif +MOSTLYCLEANFILES += pci_mod-bus_pci.d +UNDSYMFILES += und-pci.lst + +pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o + +mod-pci.o: mod-pci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< + +mod-pci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pci_mod_EXPORTS),no) +def-pci.lst: pre-pci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ +endif + +und-pci.lst: pre-pci.o + echo 'pci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) + $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< +-include pci_mod-bus_pci.d + +CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst +COMMANDFILES += cmd-pci_mod-bus_pci.lst +FSFILES += fs-pci_mod-bus_pci.lst +PARTMAPFILES += partmap-pci_mod-bus_pci.lst + +cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + +fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + +partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + + +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst +ifneq ($(lspci_mod_EXPORTS),no) +CLEANFILES += def-lspci.lst +DEFSYMFILES += def-lspci.lst +endif +MOSTLYCLEANFILES += lspci_mod-commands_lspci.d +UNDSYMFILES += und-lspci.lst + +lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o + +mod-lspci.o: mod-lspci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< + +mod-lspci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lspci_mod_EXPORTS),no) +def-lspci.lst: pre-lspci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ +endif + +und-lspci.lst: pre-lspci.o + echo 'lspci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< +-include lspci_mod-commands_lspci.d + +CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst +COMMANDFILES += cmd-lspci_mod-commands_lspci.lst +FSFILES += fs-lspci_mod-commands_lspci.lst +PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst + +cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + +fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + +partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + + +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index a6a997340..01f3165a1 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -94,7 +94,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod memdisk.mod + play.mod cpuid.mod serial.mod ata.mod \ + memdisk.mod pci.mod lspci.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -159,4 +160,14 @@ memdisk_mod_SOURCES = disk/memdisk.c memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 0c0f6220e..c2e1f3f35 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -589,7 +589,7 @@ grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPE # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod memdisk.mod + _linux.mod nand.mod memdisk.mod pci.mod lspci.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -1643,4 +1643,118 @@ partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCI memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst +ifneq ($(pci_mod_EXPORTS),no) +CLEANFILES += def-pci.lst +DEFSYMFILES += def-pci.lst +endif +MOSTLYCLEANFILES += pci_mod-bus_pci.d +UNDSYMFILES += und-pci.lst + +pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o + -rm -f $@ + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o + +mod-pci.o: mod-pci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< + +mod-pci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pci_mod_EXPORTS),no) +def-pci.lst: pre-pci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ +endif + +und-pci.lst: pre-pci.o + echo 'pci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) + $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< +-include pci_mod-bus_pci.d + +CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst +COMMANDFILES += cmd-pci_mod-bus_pci.lst +FSFILES += fs-pci_mod-bus_pci.lst +PARTMAPFILES += partmap-pci_mod-bus_pci.lst + +cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + +fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + +partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + + +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst +ifneq ($(lspci_mod_EXPORTS),no) +CLEANFILES += def-lspci.lst +DEFSYMFILES += def-lspci.lst +endif +MOSTLYCLEANFILES += lspci_mod-commands_lspci.d +UNDSYMFILES += und-lspci.lst + +lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o + -rm -f $@ + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o + +mod-lspci.o: mod-lspci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< + +mod-lspci.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lspci_mod_EXPORTS),no) +def-lspci.lst: pre-lspci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ +endif + +und-lspci.lst: pre-lspci.o + echo 'lspci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< +-include lspci_mod-commands_lspci.d + +CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst +COMMANDFILES += cmd-lspci_mod-commands_lspci.lst +FSFILES += fs-lspci_mod-commands_lspci.lst +PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst + +cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + +fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + +partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + + +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 03b4173f3..1c7856227 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -102,7 +102,7 @@ grub_install_SOURCES = util/ieee1275/grub-install.in # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod memdisk.mod + _linux.mod nand.mod memdisk.mod pci.mod lspci.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -176,4 +176,14 @@ memdisk_mod_SOURCES = disk/memdisk.c memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pci.mod +pci_mod_SOURCES = bus/pci.c +pci_mod_CFLAGS = $(COMMON_CFLAGS) +pci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lspci.mod +lspci_mod_SOURCES = commands/lspci.c +lspci_mod_CFLAGS = $(COMMON_CFLAGS) +lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/include/grub/i386/efi/pci.h b/include/grub/i386/efi/pci.h deleted file mode 100644 index 8480fd79a..000000000 --- a/include/grub/i386/efi/pci.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include diff --git a/include/grub/i386/pc/pci.h b/include/grub/i386/pci.h similarity index 100% rename from include/grub/i386/pc/pci.h rename to include/grub/i386/pci.h diff --git a/include/grub/pci.h b/include/grub/pci.h index abc5c9084..aceee494f 100644 --- a/include/grub/pci.h +++ b/include/grub/pci.h @@ -45,6 +45,6 @@ grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device, void EXPORT_FUNC(grub_pci_iterate) (grub_pci_iteratefunc_t hook); -#include +#include #endif /* GRUB_PCI_H */ diff --git a/include/grub/x86_64/efi/pci.h b/include/grub/x86_64/efi/pci.h deleted file mode 100644 index 8480fd79a..000000000 --- a/include/grub/x86_64/efi/pci.h +++ /dev/null @@ -1,19 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include From 2960a0c2281e78ebffd093b1b9de8193b9e0e6a5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 3 Aug 2008 20:28:36 +0000 Subject: [PATCH 0312/1707] Add a few new files. --- .cvsignore | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.cvsignore b/.cvsignore index d6d1b9449..0742a73af 100644 --- a/.cvsignore +++ b/.cvsignore @@ -3,10 +3,12 @@ *.img *.lst *.mod +*.elf 00_header 10_hurd 10_linux 30_os-prober +40_custom Makefile autom4te.cache config.cache @@ -19,6 +21,7 @@ grub-install grub-mkdevicemap grub-mkimage grub-mkrescue +grub-pe2elf grub-probe grub-setup grub_probe_init.c @@ -27,7 +30,6 @@ grub_script.tab.c grub_script.tab.h grub_setup_init.c grub_setup_init.h -kernel.elf mod-*.c stamp-h stamp-h1 From a9053f8f5da3af9a92d3b0146ba4b2fe07e8b44a Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 Aug 2008 09:30:36 +0000 Subject: [PATCH 0313/1707] 2008-08-04 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Fix misc warnings introduced in my last commit. --- ChangeLog | 5 +++++ loader/i386/pc/multiboot.c | 15 +++++++-------- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index fbf13b284..33a5abbfb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-04 Robert Millan + + * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Fix misc + warnings introduced in my last commit. + 2008-08-03 Robert Millan Make PCI available on all i386 architectures. diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 0359f183e..8da18e648 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -125,7 +125,6 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) { Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; char *phdr_base; - grub_addr_t physical_entry_addr = 0; int lowest_segment = 0, highest_segment = 0; int i; @@ -162,20 +161,20 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) if (! playground) return grub_errno; - grub_multiboot_payload_orig = playground + sizeof (forward_relocator); + grub_multiboot_payload_orig = (long) playground + sizeof (forward_relocator); grub_memmove (playground, forward_relocator, sizeof (forward_relocator)); - grub_memmove (grub_multiboot_payload_orig + grub_multiboot_payload_size, backward_relocator, sizeof (backward_relocator)); + grub_memmove ((char *) (grub_multiboot_payload_orig + grub_multiboot_payload_size), backward_relocator, sizeof (backward_relocator)); /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { if (phdr(i)->p_type == PT_LOAD) { - char *load_this_module_at = grub_multiboot_payload_orig + (phdr(i)->p_paddr - phdr(0)->p_paddr); + char *load_this_module_at = (char *) (grub_multiboot_payload_orig + (phdr(i)->p_paddr - phdr(0)->p_paddr)); - grub_dprintf ("multiboot_loader", "segment %d: paddr=%p, memsz=%p\n", - i, phdr(i)->p_paddr, phdr(i)->p_memsz); + grub_dprintf ("multiboot_loader", "segment %d: paddr=%p, memsz=0x%x\n", + i, (void *) phdr(i)->p_paddr, phdr(i)->p_memsz); if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) @@ -202,8 +201,8 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) else entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size; - grub_dprintf ("multiboot_loader", "dest=%p, size=%p, entry_offset=%p\n", - grub_multiboot_payload_dest, + grub_dprintf ("multiboot_loader", "dest=%p, size=0x%x, entry_offset=0x%x\n", + (void *) grub_multiboot_payload_dest, grub_multiboot_payload_size, grub_multiboot_payload_entry_offset); From 5e15ee3d386a7f6facb2e64637c8756e98a4e424 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 Aug 2008 11:38:45 +0000 Subject: [PATCH 0314/1707] 2008-08-04 Robert Millan * conf/i386-coreboot.rmk (COMMON_ASFLAGS, COMMON_CFLAGS) (COMMON_LDFLAGS): Harmonize with i386-pc version (fixes a code corruption problem). --- ChangeLog | 6 ++++++ conf/i386-coreboot.mk | 6 +++--- conf/i386-coreboot.rmk | 6 +++--- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 33a5abbfb..6e5bbeefc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-04 Robert Millan + + * conf/i386-coreboot.rmk (COMMON_ASFLAGS, COMMON_CFLAGS) + (COMMON_LDFLAGS): Harmonize with i386-pc version (fixes a code + corruption problem). + 2008-08-04 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Fix misc diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 3fbce3630..e01f4e810 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -1,9 +1,9 @@ # -*- makefile -*- # Generated by genmk.rb, please don't edit! -COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin -COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 -COMMON_LDFLAGS = -nostdlib -static -lgcc +COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 +COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 +COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. normal/lexer.c_DEPENDENCIES = grub_script.tab.h diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 01f3165a1..c4dc567be 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -1,8 +1,8 @@ # -*- makefile -*- -COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin -COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 -COMMON_LDFLAGS = -nostdlib -static -lgcc +COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 +COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 +COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. normal/lexer.c_DEPENDENCIES = grub_script.tab.h From 825aa57ad064a12b83fa7e1777b547ee0c51a096 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 4 Aug 2008 22:50:09 +0000 Subject: [PATCH 0315/1707] Typos, spacing --- ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e5bbeefc..26a7d3adc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -45,7 +45,7 @@ * kern/i386/pc/init.c (make_install_device): Check for `grub_prefix' instead of `grub_install_dos_part' to determine whether a drive needs to be prepended to prefix (`grub_install_dos_part' is not reliable, - because it can be overriden when loading GRUB via Multiboot). + because it can be overridden when loading GRUB via Multiboot). 2008-08-02 Robert Millan @@ -114,7 +114,7 @@ (backward_relocator): New variables. Used to allocate and relocate the payload, respectively. (grub_multiboot_load_elf32): Load into heap instead of requested - address, install the appropiate relocator code in each bound of + address, install the appropriate relocator code in each bound of the payload, and set the entry point such that grub_multiboot_real_boot() will jump to one of them. @@ -196,7 +196,7 @@ * kern/i386/ieee1275/startup.S: Include `'. (start): Insert a data section, with `grub_prefix' variable. - * kern/i386/linuxbios/startup.S: Likewise. + * kern/i386/linuxbios/startup.S: Likewise. * include/grub/powerpc/ieee1275/kernel.h [!ASM_FILE] (grub_prefix): New variable reference. From 8d23f507732595bdd16cd79c20880697845e8395 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 4 Aug 2008 22:54:06 +0000 Subject: [PATCH 0316/1707] 2008-08-04 Pavel Roskin * kern/main.c: Include grub/mm.h. --- ChangeLog | 4 ++++ kern/main.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 26a7d3adc..981a869ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-04 Pavel Roskin + + * kern/main.c: Include grub/mm.h. + 2008-08-04 Robert Millan * conf/i386-coreboot.rmk (COMMON_ASFLAGS, COMMON_CFLAGS) diff --git a/kern/main.c b/kern/main.c index acf6911dd..40300b24d 100644 --- a/kern/main.c +++ b/kern/main.c @@ -26,6 +26,7 @@ #include #include #include +#include void grub_module_iterate (int (*hook) (struct grub_module_header *header)) From 9ec92aaf1fd66debb92140987ffc27eefe4c8c80 Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 5 Aug 2008 09:41:10 +0000 Subject: [PATCH 0317/1707] 2008-08-05 Marco Gerards * disk/ata.c: Include . (enum grub_ata_commands): Add `GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS'. (grub_ata_initialize): Rewritten. (grub_ata_device_initialize): New function. --- ChangeLog | 7 ++ disk/ata.c | 203 +++++++++++++++++++++++++++++++++++++---------------- 2 files changed, 150 insertions(+), 60 deletions(-) diff --git a/ChangeLog b/ChangeLog index 981a869ee..f0a68eb00 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-05 Marco Gerards + + * disk/ata.c: Include . + (enum grub_ata_commands): Add `GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS'. + (grub_ata_initialize): Rewritten. + (grub_ata_device_initialize): New function. + 2008-08-04 Pavel Roskin * kern/main.c: Include grub/mm.h. diff --git a/disk/ata.c b/disk/ata.c index f77f63513..48435b467 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -22,6 +22,7 @@ #include #include #include +#include /* XXX: For now this only works on i386. */ #include @@ -71,7 +72,8 @@ enum grub_ata_commands GRUB_ATA_CMD_WRITE_SECTORS_EXT = 0x34, GRUB_ATA_CMD_IDENTIFY_DEVICE = 0xEC, GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE = 0xA1, - GRUB_ATA_CMD_PACKET = 0xA0 + GRUB_ATA_CMD_PACKET = 0xA0, + GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS = 0x90 }; struct grub_ata_device @@ -344,82 +346,163 @@ grub_ata_identify (struct grub_ata_device *dev) } static grub_err_t -grub_ata_initialize (void) +grub_ata_device_initialize (int port, int device, int addr, int addr2) { struct grub_ata_device *dev; struct grub_ata_device **devp; - int port; - int device; - for (port = 0; port <= 1; port++) + grub_dprintf ("ata", "detecting device %d,%d (0x%x, 0x%x)\n", + port, device, addr, addr2); + + dev = grub_malloc (sizeof(*dev)); + if (! dev) + return grub_errno; + + /* Setup the device information. */ + dev->port = port; + dev->device = device; + dev->ioaddress = grub_ata_ioaddress[dev->port]; + dev->ioaddress2 = grub_ata_ioaddress2[dev->port]; + dev->next = NULL; + + /* Try to detect if the port is in use by writing to it, + waiting for a while and reading it again. If the value + was preserved, there is a device connected. */ + grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); + grub_ata_wait (); + grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A); + grub_ata_wait (); + if (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) != 0x5A) { - for (device = 0; device <= 1; device++) + grub_free(dev); + return 0; + } + + /* Detect if the device is present by issuing a EXECUTE + DEVICE DIAGNOSTICS command. */ + grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); + grub_ata_regset (dev, GRUB_ATA_REG_CMD, + GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS); + grub_ata_wait (); + + grub_dprintf ("ata", "Registers: %x %x %x %x\n", + grub_ata_regget (dev, GRUB_ATA_REG_SECTORS), + grub_ata_regget (dev, GRUB_ATA_REG_LBALOW), + grub_ata_regget (dev, GRUB_ATA_REG_LBAMID), + grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH)); + + /* Check some registers to see if the channel is used. */ + if (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) == 0x01 + && grub_ata_regget (dev, GRUB_ATA_REG_LBALOW) == 0x01 + && grub_ata_regget (dev, GRUB_ATA_REG_LBAMID) == 0x14 + && grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH) == 0xeb) + { + grub_dprintf ("ata", "ATAPI signature detected\n"); + } + else if (! (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) == 0x01 + && grub_ata_regget (dev, GRUB_ATA_REG_LBALOW) == 0x01 + && grub_ata_regget (dev, GRUB_ATA_REG_LBAMID) == 0x00 + && grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH) == 0x00)) + { + grub_dprintf ("ata", "incorrect signature\n"); + grub_free (dev); + return 0; + } + else + { + grub_dprintf ("ata", "ATA detected\n"); + } + + + /* Use the IDENTIFY DEVICE command to query the device. */ + if (grub_ata_identify (dev)) + { + grub_free (dev); + return 0; + } + + /* Register the device. */ + for (devp = &grub_ata_devices; *devp; devp = &(*devp)->next); + *devp = dev; + + return 0; +} + +static int +grub_ata_pciinit (int bus, int device, int func, grub_pci_id_t pciid) +{ + static int compat_use[2] = { 0 }; + grub_pci_address_t addr; + grub_uint32_t class; + grub_uint32_t bar1; + grub_uint32_t bar2; + int rega; + int regb; + int i; + + /* Read class. */ + addr = grub_pci_make_address (bus, device, func, 2); + class = grub_pci_read (addr); + + /* Check if this class ID matches that of a PCI IDE Controller. */ + if (class >> 16 != 0x0101) + return 0; + + for (i = 0; i < 2; i++) + { + /* Set to 0 when the channel operated in compatibility mode. */ + int compat = (class >> (2 * i)) & 1; + + rega = 0; + regb = 0; + + /* If the channel is in compatibility mode, just assign the + default registers. */ + if (compat == 0 && !compat_use[i]) { - dev = grub_malloc (sizeof(*dev)); - if (! dev) - return grub_errno; + rega = grub_ata_ioaddress[i]; + regb = grub_ata_ioaddress2[i]; + compat_use[i] = 0; + } + else if (compat) + { + /* Read the BARs, which either contain a mmapped IO address + or the IO port address. */ + addr = grub_pci_make_address (bus, device, func, 4 + 2 * i); + bar1 = grub_pci_read (addr); + addr = grub_pci_make_address (bus, device, func, 5 + 2 * i); + bar2 = grub_pci_read (addr); - /* Setup the device information. */ - dev->port = port; - dev->device = device; - dev->ioaddress = grub_ata_ioaddress[dev->port]; - dev->ioaddress2 = grub_ata_ioaddress2[dev->port]; - dev->next = NULL; - - /* Try to detect if the port is in use by writing to it, - waiting for a while and reading it again. If the value - was preserved, there is a device connected. */ - grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); - grub_ata_wait (); - grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A); - grub_ata_wait (); - if (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) != 0x5A) + /* Check if the BARs describe an IO region. */ + if ((bar1 & 1) && (bar2 & 1)) { - grub_free(dev); - continue; + rega = bar1 & ~3; + regb = bar2 & ~3; } + } - /* Detect if the device is present by issuing a reset. */ - grub_ata_regset2 (dev, GRUB_ATA_REG2_CONTROL, 6); - grub_ata_wait (); - grub_ata_regset2 (dev, GRUB_ATA_REG2_CONTROL, 2); - grub_ata_wait (); - grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); - grub_ata_wait (); + grub_dprintf ("ata", + "PCI dev (%d,%d,%d) compat=%d rega=0x%x regb=0x%x\n", + bus, device, func, compat, rega, regb); - /* XXX: Check some registers to see if the reset worked as - expected for this device. */ -#if 1 - /* Enable for ATAPI . */ - if (grub_ata_regget (dev, GRUB_ATA_REG_CYLLSB) != 0x14 - || grub_ata_regget (dev, GRUB_ATA_REG_CYLMSB) != 0xeb) -#endif - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) == 0 - || (grub_ata_regget (dev, GRUB_ATA_REG_CYLLSB) != 0 - && grub_ata_regget (dev, GRUB_ATA_REG_CYLMSB) != 0 - && grub_ata_regget (dev, GRUB_ATA_REG_CYLLSB) != 0x3c - && grub_ata_regget (dev, GRUB_ATA_REG_CYLLSB) != 0xc3)) - { - grub_free (dev); - continue; - } - - /* Use the IDENTIFY DEVICE command to query the device. */ - if (grub_ata_identify (dev)) - { - grub_free (dev); - continue; - } - - /* Register the device. */ - for (devp = &grub_ata_devices; *devp; devp = &(*devp)->next); - *devp = dev; + if (rega && regb) + { + grub_ata_device_initialize (i, 0, rega, regb); + grub_ata_device_initialize (i, 1, rega, regb); } } return 0; } +static grub_err_t +grub_ata_initialize (void) +{ + grub_pci_iterate (grub_ata_pciinit); + return 0; +} + + static void grub_ata_setlba (struct grub_ata_device *dev, grub_disk_addr_t sector, grub_size_t size) From 9c2ff3eefe87cd6aae5946ec80dda10a8cc9127d Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 5 Aug 2008 11:54:37 +0000 Subject: [PATCH 0318/1707] 2008-08-05 Colin D Bennett High resolution timer support. Implemented for x86 CPUs using TSC. Extracted generic grub_millisleep() so it's linked in only as needed. This requires a Pentium compatible CPU; if the RDTSC instruction is not supported, then it falls back on the generic grub_get_time_ms() implementation that uses the machine's RTC. * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/time.c', `kern/i386/tsc.c', `kern/generic/rtc_get_time_ms.c' and `kern/generic/millisleep.c'. * conf/i386-efi.rmk (kernel_mod_SOURCES): Add `kern/i386/tsc.c', `kern/generic/rtc_get_time_ms.c' and `kern/generic/millisleep.c'. * conf/x86_64-efi.rml (kernel_mod_SOURCES): Add `kern/generic/millisleep.c' and `kern/generic/rtc_get_time_ms.c'. * conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/generic/millisleep.c'. * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Likewise. * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Add `kern/time.c'. * kern/generic/rtc_get_time_ms.c: New file. * kern/generic/millisleep.c: New file. * kern/misc.c: Don't include anymore. (grub_millisleep_generic): Removed. * commands/sleep.c (grub_interruptible_millisleep): Uses grub_get_time_ms() instead of grub_get_rtc(). * include/grub/i386/tsc.h (grub_get_tsc): New file. New inline function. (grub_cpu_is_cpuid_supported): New inline function. (grub_cpu_is_tsc_supported): New inline function. (grub_tsc_init): New function prototype. (grub_tsc_get_time_ms): New function prototype. * kern/i386/tsc.c (grub_get_time_ms): New file. * include/grub/time.h: Include . Don't include anymore. (grub_millisleep): Removed. (grub_machine_init): Call grub_tsc_init. * kern/i386/linuxbios/init.c (grub_machine_init): Install the RTC get_time_ms() implementation. * kern/sparc64/ieee1275/init.c (grub_millisleep): Removed. (ieee1275_get_time_ms): New function. (grub_machine_init): Install get_time_ms() implementation. * kern/i386/pc/init.c: Include . (grub_machine_init): Call grub_tsc_init(). (grub_millisleep): Removed. * kern/ieee1275/init.c (grub_millisleep): Removed. (grub_machine_init): Install ieee1275_get_time_ms() implementation. (ieee1275_get_time_ms): New function. (grub_get_rtc): Now calls ieee1275_get_time_ms(), which does the real work. --- ChangeLog | 79 ++++++++++++++++++++++++++++++++++++ commands/sleep.c | 12 +++--- conf/i386-coreboot.rmk | 1 + conf/i386-efi.rmk | 5 ++- conf/i386-ieee1275.rmk | 1 + conf/i386-pc.rmk | 4 ++ conf/powerpc-ieee1275.rmk | 1 + conf/sparc64-ieee1275.rmk | 1 + conf/x86_64-efi.rmk | 1 + include/grub/time.h | 9 +++- kern/i386/efi/init.c | 9 +--- kern/i386/linuxbios/init.c | 2 + kern/i386/pc/init.c | 9 ++-- kern/ieee1275/init.c | 20 +++++---- kern/misc.c | 12 ------ kern/sparc64/ieee1275/init.c | 15 ++++--- 16 files changed, 133 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index f0a68eb00..68b63686f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,82 @@ +2008-08-05 Colin D Bennett + + High resolution timer support. Implemented for x86 CPUs using TSC. + Extracted generic grub_millisleep() so it's linked in only as needed. + This requires a Pentium compatible CPU; if the RDTSC instruction is + not supported, then it falls back on the generic grub_get_time_ms() + implementation that uses the machine's RTC. + + * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/time.c', + `kern/i386/tsc.c', `kern/generic/rtc_get_time_ms.c' and + `kern/generic/millisleep.c'. + + * conf/i386-efi.rmk (kernel_mod_SOURCES): Add `kern/i386/tsc.c', + `kern/generic/rtc_get_time_ms.c' and `kern/generic/millisleep.c'. + + * conf/x86_64-efi.rml (kernel_mod_SOURCES): Add + `kern/generic/millisleep.c' and `kern/generic/rtc_get_time_ms.c'. + + * conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): Likewise. + + * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add + `kern/generic/millisleep.c'. + + * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Likewise. + + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Add `kern/time.c'. + + * kern/generic/rtc_get_time_ms.c: New file. + + * kern/generic/millisleep.c: New file. + + * kern/misc.c: Don't include + anymore. + (grub_millisleep_generic): Removed. + + * commands/sleep.c (grub_interruptible_millisleep): Uses + grub_get_time_ms() instead of grub_get_rtc(). + + * include/grub/i386/tsc.h (grub_get_tsc): New file. New inline + function. + (grub_cpu_is_cpuid_supported): New inline function. + (grub_cpu_is_tsc_supported): New inline function. + (grub_tsc_init): New function prototype. + (grub_tsc_get_time_ms): New function prototype. + + * kern/i386/tsc.c (grub_get_time_ms): New file. + + * include/grub/time.h: Include . Don't include + anymore. + (grub_millisleep): Removed. + (grub_machine_init): Call grub_tsc_init. + + * kern/i386/linuxbios/init.c (grub_machine_init): Install the RTC + get_time_ms() implementation. + + * kern/sparc64/ieee1275/init.c (grub_millisleep): Removed. + (ieee1275_get_time_ms): New function. + (grub_machine_init): Install get_time_ms() implementation. + + * kern/i386/pc/init.c: Include . + (grub_machine_init): Call grub_tsc_init(). + (grub_millisleep): Removed. + + * kern/ieee1275/init.c (grub_millisleep): Removed. + (grub_machine_init): Install ieee1275_get_time_ms() + implementation. + (ieee1275_get_time_ms): New function. + (grub_get_rtc): Now calls ieee1275_get_time_ms(), which does the + real work. + 2008-08-05 Marco Gerards * disk/ata.c: Include . diff --git a/commands/sleep.c b/commands/sleep.c index c4744c57a..46c13268c 100644 --- a/commands/sleep.c +++ b/commands/sleep.c @@ -43,15 +43,15 @@ do_print (int n) grub_printf ("%d ", n); } -/* Based on grub_millisleep() from kern/misc.c. */ +/* Based on grub_millisleep() from kern/generic/millisleep.c. */ static int grub_interruptible_millisleep (grub_uint32_t ms) { - grub_uint32_t end_at; - - end_at = grub_get_rtc () + grub_div_roundup (ms * GRUB_TICKS_PER_SECOND, 1000); - - while (grub_get_rtc () < end_at) + grub_uint64_t start; + + start = grub_get_time_ms (); + + while (grub_get_time_ms () - start < ms) if (grub_checkkey () >= 0 && GRUB_TERM_ASCII_CHAR (grub_getkey ()) == GRUB_TERM_ESC) return 1; diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index c4dc567be..c4ca95e8c 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -16,6 +16,7 @@ kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/time.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ term/i386/pc/console.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 308dec4f0..e35a5c9a7 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -84,7 +84,10 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - term/efi/console.c disk/efi/efidisk.c + term/efi/console.c disk/efi/efidisk.c \ + kern/i386/tsc.c \ + kern/generic/rtc_get_time_ms.c \ + kern/generic/millisleep.c kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 1c7856227..818dc9191 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -19,6 +19,7 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ + kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c term/i386/pc/at_keyboard.c \ disk/ieee1275/ofdisk.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 8617a9216..e400ffc63 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -42,7 +42,11 @@ cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/time.c \ kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ + kern/i386/tsc.c \ + kern/generic/rtc_get_time_ms.c \ + kern/generic/millisleep.c \ kern/env.c \ term/i386/pc/console.c \ symlist.c diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 9d7a6727d..0ed75f3e3 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -85,6 +85,7 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ + kern/generic/millisleep.c \ symlist.c kern/powerpc/cache.S kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 8083e8c5f..4571bbdc9 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -73,6 +73,7 @@ kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ + kern/generic/millisleep.c kern/generic/get_time_ms.c \ kern/sparc64/cache.S kern/parser.c kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 744eda49e..25dc8eb22 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -87,6 +87,7 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ + kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ diff --git a/include/grub/time.h b/include/grub/time.h index bf017d204..4dcd843de 100644 --- a/include/grub/time.h +++ b/include/grub/time.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. + * Copyright (C) 2007, 2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,12 +19,15 @@ #ifndef KERNEL_TIME_HEADER #define KERNEL_TIME_HEADER 1 +#include #include #include #include void EXPORT_FUNC(grub_millisleep) (grub_uint32_t ms); -void EXPORT_FUNC(grub_millisleep_generic) (grub_uint32_t ms); +grub_uint64_t EXPORT_FUNC(grub_get_time_ms) (void); + +grub_uint64_t grub_rtc_get_time_ms (void); static __inline void grub_sleep (grub_uint32_t s) @@ -32,4 +35,6 @@ grub_sleep (grub_uint32_t s) grub_millisleep (1000 * s); } +void grub_install_get_time_ms (grub_uint64_t (*get_time_ms_func) (void)); + #endif /* ! KERNEL_TIME_HEADER */ diff --git a/kern/i386/efi/init.c b/kern/i386/efi/init.c index 0683502a8..e9cc07078 100644 --- a/kern/i386/efi/init.c +++ b/kern/i386/efi/init.c @@ -25,18 +25,13 @@ #include #include #include -#include - -void -grub_millisleep (grub_uint32_t ms) -{ - grub_millisleep_generic (ms); -} +#include void grub_machine_init (void) { grub_efi_init (); + grub_tsc_init (); } void diff --git a/kern/i386/linuxbios/init.c b/kern/i386/linuxbios/init.c index 7293a394a..1d25986b7 100644 --- a/kern/i386/linuxbios/init.c +++ b/kern/i386/linuxbios/init.c @@ -143,6 +143,8 @@ grub_machine_init (void) /* This variable indicates size, not offset. */ grub_upper_mem -= GRUB_MEMORY_MACHINE_UPPER_START; + + grub_install_get_time_ms (grub_rtc_get_time_ms); } void diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 0e973eaf4..955a52f08 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -30,6 +30,7 @@ #include #include #include +#include struct mem_region { @@ -46,12 +47,6 @@ grub_addr_t grub_os_area_addr; grub_size_t grub_os_area_size; grub_size_t grub_lower_mem, grub_upper_mem; -void -grub_millisleep (grub_uint32_t ms) -{ - grub_millisleep_generic (ms); -} - void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) @@ -231,6 +226,8 @@ grub_machine_init (void) if (! grub_os_area_addr) grub_fatal ("no upper memory"); + + grub_tsc_init (); } void diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index d1d53e0cf..513e81fea 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -46,12 +46,6 @@ extern char _start[]; extern char _end[]; -void -grub_millisleep (grub_uint32_t ms) -{ - grub_millisleep_generic (ms); -} - void grub_exit (void) { @@ -209,6 +203,8 @@ grub_get_extended_memory (void) #endif +static grub_uint64_t ieee1275_get_time_ms (void); + void grub_machine_init (void) { @@ -258,6 +254,8 @@ grub_machine_init (void) } } } + + grub_install_get_time_ms (ieee1275_get_time_ms); } void @@ -267,8 +265,8 @@ grub_machine_fini (void) grub_console_fini (); } -grub_uint32_t -grub_get_rtc (void) +static grub_uint64_t +ieee1275_get_time_ms (void) { grub_uint32_t msecs = 0; @@ -277,6 +275,12 @@ grub_get_rtc (void) return msecs; } +grub_uint32_t +grub_get_rtc (void) +{ + return ieee1275_get_time_ms (); +} + grub_addr_t grub_arch_modules_addr (void) { diff --git a/kern/misc.c b/kern/misc.c index c662c963c..83fcc1684 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -23,7 +23,6 @@ #include #include #include -#include void * grub_memmove (void *dest, const void *src, grub_size_t n) @@ -1018,17 +1017,6 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, const grub_uint8_t *src, return p - dest; } -void -grub_millisleep_generic (grub_uint32_t ms) -{ - grub_uint32_t end_at; - - end_at = grub_get_rtc () + grub_div_roundup (ms * GRUB_TICKS_PER_SECOND, 1000); - - while (grub_get_rtc () < end_at) - grub_cpu_idle (); -} - /* Abort GRUB. This function does not return. */ void grub_abort (void) diff --git a/kern/sparc64/ieee1275/init.c b/kern/sparc64/ieee1275/init.c index dbc1fee3e..57ffc3898 100644 --- a/kern/sparc64/ieee1275/init.c +++ b/kern/sparc64/ieee1275/init.c @@ -66,12 +66,6 @@ _start (uint64_t r0 __attribute__((unused)), /* Never reached. */ } -void -grub_millisleep (grub_uint32_t ms) -{ - grub_millisleep_generic (ms); -} - int grub_ieee1275_test_flag (enum grub_ieee1275_flag flag) { @@ -145,6 +139,8 @@ grub_machine_set_prefix (void) grub_free (prefix); } +grub_uint64_t ieee1275_get_time_ms (void); + void grub_machine_init (void) { @@ -201,6 +197,7 @@ grub_machine_init (void) } } + grub_install_get_time_ms (ieee1275_get_time_ms); } void @@ -216,6 +213,12 @@ grub_exit (void) grub_ieee1275_enter (); } +grub_uint64_t +ieee1275_get_time_ms (void) +{ + return grub_get_rtc (); +} + grub_uint32_t grub_get_rtc (void) { From a829251bdb086dcc6a99ff1d99780d623e390e38 Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 5 Aug 2008 12:26:29 +0000 Subject: [PATCH 0319/1707] Urgh, and now actually add the files :-) --- conf/i386-coreboot.mk | 13 +++-- conf/i386-efi.mk | 70 ++++++++++++++++++++-- conf/i386-ieee1275.mk | 13 +++-- conf/i386-pc.mk | 26 ++++++++- conf/powerpc-ieee1275.mk | 13 +++-- conf/sparc64-ieee1275.mk | 17 ++++-- include/grub/i386/tsc.h | 80 ++++++++++++++++++++++++++ kern/generic/millisleep.c | 39 +++++++++++++ kern/generic/rtc_get_time_ms.c | 37 ++++++++++++ kern/i386/tsc.c | 102 +++++++++++++++++++++++++++++++++ 10 files changed, 386 insertions(+), 24 deletions(-) create mode 100644 include/grub/i386/tsc.h create mode 100644 kern/generic/millisleep.c create mode 100644 kern/generic/rtc_get_time_ms.c create mode 100644 kern/i386/tsc.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index e01f4e810..cff6cebad 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -17,16 +17,17 @@ kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/time.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ term/i386/pc/console.c \ term/i386/pc/at_keyboard.c term/i386/pc/vga_text.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_linuxbios_startup.d kernel_elf-kern_i386_linuxbios_init.d kernel_elf-kern_i386_linuxbios_table.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_linuxbios_startup.d kernel_elf-kern_i386_linuxbios_init.d kernel_elf-kern_i386_linuxbios_table.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_linuxbios_startup.o: kern/i386/linuxbios/startup.S $(kern/i386/linuxbios/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -88,6 +89,10 @@ kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_term.d +kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_time.d + kernel_elf-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_dl.d diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 28e38771b..26d546ec1 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -127,13 +127,16 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - term/efi/console.c disk/efi/efidisk.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst + term/efi/console.c disk/efi/efidisk.c \ + kern/i386/tsc.c \ + kern/generic/rtc_get_time_ms.c \ + kern/generic/millisleep.c +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d +MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -142,9 +145,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -617,6 +620,63 @@ partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_i386_tsc.d + +CLEANFILES += cmd-kernel_mod-kern_i386_tsc.lst fs-kernel_mod-kern_i386_tsc.lst partmap-kernel_mod-kern_i386_tsc.lst +COMMANDFILES += cmd-kernel_mod-kern_i386_tsc.lst +FSFILES += fs-kernel_mod-kern_i386_tsc.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_tsc.lst + +cmd-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_generic_rtc_get_time_ms.d + +CLEANFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst fs-kernel_mod-kern_generic_rtc_get_time_ms.lst partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst +COMMANDFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst +FSFILES += fs-kernel_mod-kern_generic_rtc_get_time_ms.lst +PARTMAPFILES += partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst + +cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_generic_millisleep.d + +CLEANFILES += cmd-kernel_mod-kern_generic_millisleep.lst fs-kernel_mod-kern_generic_millisleep.lst partmap-kernel_mod-kern_generic_millisleep.lst +COMMANDFILES += cmd-kernel_mod-kern_generic_millisleep.lst +FSFILES += fs-kernel_mod-kern_generic_millisleep.lst +PARTMAPFILES += partmap-kernel_mod-kern_generic_millisleep.lst + +cmd-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index c2e1f3f35..0389f424b 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -20,15 +20,16 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ + kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c term/i386/pc/at_keyboard.c \ disk/ieee1275/ofdisk.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -114,6 +115,10 @@ kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d +kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_generic_millisleep.d + kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_ieee1275.d diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 28d6cebdf..71d975817 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -108,17 +108,21 @@ cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/time.c \ kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ + kern/i386/tsc.c \ + kern/generic/rtc_get_time_ms.c \ + kern/generic/millisleep.c \ kern/env.c \ term/i386/pc/console.c \ symlist.c -CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o -MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d +CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o +MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d kernel.img: kernel.exec $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ -kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o +kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) @@ -173,6 +177,10 @@ kernel_img-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_term.d +kernel_img-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_time.d + kernel_img-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_dl.d @@ -189,6 +197,18 @@ kernel_img-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_partition.d +kernel_img-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_i386_tsc.d + +kernel_img-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_generic_rtc_get_time_ms.d + +kernel_img-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_generic_millisleep.d + kernel_img-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_env.d diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index cb9351d68..c9eb1feb0 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -440,12 +440,13 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ + kern/generic/millisleep.c \ symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S $(kern/powerpc/ieee1275/crt0.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -539,6 +540,10 @@ kernel_elf-kern_powerpc_dl.o: kern/powerpc/dl.c $(kern/powerpc/dl.c_DEPENDENCIES $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_dl.d +kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_generic_millisleep.d + kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index a2b963863..cbdd52a13 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -74,12 +74,13 @@ kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ + kern/generic/millisleep.c kern/generic/get_time_ms.c \ kern/sparc64/cache.S kern/parser.c -CLEANFILES += kernel.elf kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o -MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_sparc64_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_sparc64_dl.d kernel_elf-symlist.d kernel_elf-kern_sparc64_cache.d kernel_elf-kern_parser.d +CLEANFILES += kernel.elf kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_generic_get_time_ms.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o +MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_sparc64_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_sparc64_dl.d kernel_elf-symlist.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_generic_get_time_ms.d kernel_elf-kern_sparc64_cache.d kernel_elf-kern_parser.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o - $(TARGET_CC) -o $@ kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_generic_get_time_ms.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o + $(TARGET_CC) -o $@ kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_generic_get_time_ms.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c $(kern/sparc64/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -165,6 +166,14 @@ kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d +kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_generic_millisleep.d + +kernel_elf-kern_generic_get_time_ms.o: kern/generic/get_time_ms.c $(kern/generic/get_time_ms.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_generic_get_time_ms.d + kernel_elf-kern_sparc64_cache.o: kern/sparc64/cache.S $(kern/sparc64/cache.S_DEPENDENCIES) $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_sparc64_cache.d diff --git a/include/grub/i386/tsc.h b/include/grub/i386/tsc.h new file mode 100644 index 000000000..63ec69df5 --- /dev/null +++ b/include/grub/i386/tsc.h @@ -0,0 +1,80 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef KERNEL_CPU_TSC_HEADER +#define KERNEL_CPU_TSC_HEADER 1 + +#include + +/* Read the TSC value, which increments with each CPU clock cycle. */ +static __inline grub_uint64_t +grub_get_tsc (void) +{ + grub_uint32_t lo, hi; + + /* The CPUID instruction is a 'serializing' instruction, and + avoids out-of-order execution of the RDTSC instruction. */ + __asm__ __volatile__ ("xorl %%eax, %%eax\n\t" + "cpuid":::"%rax", "%rbx", "%rcx", "%rdx"); + /* Read TSC value. We cannot use "=A", since this would use + %rax on x86_64. */ + __asm__ __volatile__ ("rdtsc":"=a" (lo), "=d" (hi)); + + return (((grub_uint64_t) hi) << 32) | lo; +} + +static __inline int +grub_cpu_is_cpuid_supported (void) +{ + grub_uint32_t id_supported; + + __asm__ ("pushfl\n\t" + "popl %%eax /* Get EFLAGS into EAX */\n\t" + "movl %%eax, %%ecx /* Save original flags in ECX */\n\t" + "xorl $0x200000, %%eax /* Flip ID bit in EFLAGS */\n\t" + "pushl %%eax /* Store modified EFLAGS on stack */\n\t" + "popfl /* Replace current EFLAGS */\n\t" + "pushfl /* Read back the EFLAGS */\n\t" + "popl %%eax /* Get EFLAGS into EAX */\n\t" + "xorl %%ecx, %%eax /* Check if flag could be modified */\n\t" + : "=a" (id_supported) + : /* No inputs. */ + : /* Clobbered: */ "%rcx"); + + return id_supported != 0; +} + +static __inline int +grub_cpu_is_tsc_supported (void) +{ + if (! grub_cpu_is_cpuid_supported ()) + return 0; + + grub_uint32_t features; + __asm__ ("movl $1, %%eax\n\t" + "cpuid" + : "=d" (features) + : /* No inputs. */ + : /* Clobbered: */ "%rax", "%rbx", "%rcx"); + return (features & (1 << 4)) != 0; +} + +void grub_tsc_init (void); +grub_uint64_t grub_tsc_get_time_ms (void); + +#endif /* ! KERNEL_CPU_TSC_HEADER */ diff --git a/kern/generic/millisleep.c b/kern/generic/millisleep.c new file mode 100644 index 000000000..20d883d44 --- /dev/null +++ b/kern/generic/millisleep.c @@ -0,0 +1,39 @@ +/* millisleep.c - generic millisleep function. + * The generic implementation of these functions can be used for architectures + * or platforms that do not have a more specialized implementation. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +void +grub_millisleep (grub_uint32_t ms) +{ + grub_uint64_t start; + + start = grub_get_time_ms (); + + /* Instead of setting an end time and looping while the current time is + less than that, comparing the elapsed sleep time with the desired sleep + time handles the (unlikely!) case that the timer would wrap around + during the sleep. */ + + while (grub_get_time_ms () - start < ms) + grub_cpu_idle (); +} diff --git a/kern/generic/rtc_get_time_ms.c b/kern/generic/rtc_get_time_ms.c new file mode 100644 index 000000000..74979e7fd --- /dev/null +++ b/kern/generic/rtc_get_time_ms.c @@ -0,0 +1,37 @@ +/* rtc_get_time_ms.c - get_time_ms implementation using platform RTC. + * The generic implementation of these functions can be used for architectures + * or platforms that do not have a more specialized implementation. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +/* Calculate the time in milliseconds since the epoch based on the RTC. */ +grub_uint64_t +grub_rtc_get_time_ms (void) +{ + /* By dimensional analysis: + + 1000 ms N rtc ticks 1 s + ------- * ----------- * ----------- = 1000*N/T ms + 1 s 1 T rtc ticks + */ + grub_uint64_t ticks_ms_per_sec = ((grub_uint64_t) 1000) * grub_get_rtc (); + return grub_divmod64 (ticks_ms_per_sec, GRUB_TICKS_PER_SECOND, 0); +} diff --git a/kern/i386/tsc.c b/kern/i386/tsc.c new file mode 100644 index 000000000..a142e3d64 --- /dev/null +++ b/kern/i386/tsc.c @@ -0,0 +1,102 @@ +/* kern/i386/tsc.c - x86 TSC time source implementation + * Requires Pentium or better x86 CPU that supports the RDTSC instruction. + * This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to + * real time. + * + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +/* Calibrated reference for TSC=0. This defines the time since the epoch in + milliseconds that TSC=0 refers to. */ +static grub_uint64_t tsc_boot_time; + +/* Calibrated TSC rate. (In TSC ticks per millisecond.) */ +static grub_uint64_t tsc_ticks_per_ms; + + +grub_uint64_t +grub_tsc_get_time_ms (void) +{ + return tsc_boot_time + grub_divmod64 (grub_get_tsc (), tsc_ticks_per_ms, 0); +} + + +/* How many RTC ticks to use for calibration loop. (>= 1) */ +#define CALIBRATION_TICKS 2 + +/* Calibrate the TSC based on the RTC. */ +static void +calibrate_tsc (void) +{ + /* First calbrate the TSC rate (relative, not absolute time). */ + grub_uint64_t start_tsc; + grub_uint64_t end_tsc; + grub_uint32_t initial_tick; + grub_uint32_t start_tick; + grub_uint32_t end_tick; + + /* Wait for the start of the next tick; + we'll base out timing off this edge. */ + initial_tick = grub_get_rtc (); + do + { + start_tick = grub_get_rtc (); + } + while (start_tick == initial_tick); + start_tsc = grub_get_tsc (); + + /* Wait for the start of the next tick. This will + be the end of the 1-tick period. */ + do + { + end_tick = grub_get_rtc (); + } + while (end_tick - start_tick < CALIBRATION_TICKS); + end_tsc = grub_get_tsc (); + + tsc_ticks_per_ms = + grub_divmod64 (grub_divmod64 + (end_tsc - start_tsc, end_tick - start_tick, 0) + * GRUB_TICKS_PER_SECOND, 1000, 0); + + /* Reference the TSC zero (boot time) to the epoch to + get an absolute real time reference. */ + grub_uint64_t ms_since_boot = grub_divmod64 (end_tsc, tsc_ticks_per_ms, 0); + grub_uint64_t mstime_now = grub_divmod64 ((grub_uint64_t) 1000 * end_tick, + GRUB_TICKS_PER_SECOND, + 0); + tsc_boot_time = mstime_now - ms_since_boot; +} + +void +grub_tsc_init (void) +{ + if (grub_cpu_is_tsc_supported ()) + { + calibrate_tsc (); + grub_install_get_time_ms (grub_tsc_get_time_ms); + } + else + { + grub_install_get_time_ms (grub_rtc_get_time_ms); + } +} From bf06a93f70e01d4584a512afc8a5af5b78565d23 Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 5 Aug 2008 12:30:42 +0000 Subject: [PATCH 0320/1707] Urgh, and now actually add the files :-) --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 68b63686f..8024e21d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -69,7 +69,7 @@ * kern/i386/pc/init.c: Include . (grub_machine_init): Call grub_tsc_init(). (grub_millisleep): Removed. - + * kern/ieee1275/init.c (grub_millisleep): Removed. (grub_machine_init): Install ieee1275_get_time_ms() implementation. From 748d089ee3b1ba45f0a7d5eea736bd66304299a3 Mon Sep 17 00:00:00 2001 From: marco_g Date: Tue, 5 Aug 2008 12:38:12 +0000 Subject: [PATCH 0321/1707] actually add kern/time.c --- kern/time.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 kern/time.c diff --git a/kern/time.c b/kern/time.c new file mode 100644 index 000000000..6521ec66f --- /dev/null +++ b/kern/time.c @@ -0,0 +1,37 @@ +/* time.c - kernel time functions */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +typedef grub_uint64_t (*get_time_ms_func_t) (void); + +/* Function pointer to the implementation in use. */ +static get_time_ms_func_t get_time_ms_func; + +grub_uint64_t +grub_get_time_ms (void) +{ + return get_time_ms_func (); +} + +void +grub_install_get_time_ms (get_time_ms_func_t func) +{ + get_time_ms_func = func; +} From 6977d49f980dfbc51c8c47d5d39ce1c7498f79f6 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 5 Aug 2008 14:20:00 +0000 Subject: [PATCH 0322/1707] 2008-08-05 Bean * util/console.c (grub_console_cur_color): New variable. (grub_console_standard_color): Likewise. (grub_console_normal_color): Likewise. (grub_console_highlight_color): Likewise. (color_map): Likewise. (use_color): Likewise. (NUM_COLORS): New macro. (grub_ncurses_setcolorstate): Handle color properly. (grub_ncurses_setcolor): Don't change color here, just remember the settings, color will be set in grub_ncurses_setcolorstate. (grub_ncurses_getcolor): New function. (grub_ncurses_init): Initialize color pairs. (grub_ncurses_term): New member grub_ncurses_getcolor. --- ChangeLog | 16 +++++++++++++ util/console.c | 65 ++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 79 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8024e21d9..f6ac4191b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2008-08-05 Bean + + * util/console.c (grub_console_cur_color): New variable. + (grub_console_standard_color): Likewise. + (grub_console_normal_color): Likewise. + (grub_console_highlight_color): Likewise. + (color_map): Likewise. + (use_color): Likewise. + (NUM_COLORS): New macro. + (grub_ncurses_setcolorstate): Handle color properly. + (grub_ncurses_setcolor): Don't change color here, just remember the + settings, color will be set in grub_ncurses_setcolorstate. + (grub_ncurses_getcolor): New function. + (grub_ncurses_init): Initialize color pairs. + (grub_ncurses_term): New member grub_ncurses_getcolor. + 2008-08-05 Colin D Bennett High resolution timer support. Implemented for x86 CPUs using TSC. diff --git a/util/console.c b/util/console.c index 8c9401c1d..01eb55758 100644 --- a/util/console.c +++ b/util/console.c @@ -41,6 +41,28 @@ static int grub_console_attr = A_NORMAL; +grub_uint8_t grub_console_cur_color = 7; + +static grub_uint8_t grub_console_standard_color = 0x7; +static grub_uint8_t grub_console_normal_color = 0x7; +static grub_uint8_t grub_console_highlight_color = 0x70; + +#define NUM_COLORS 8 + +static grub_uint8_t color_map[NUM_COLORS] = +{ + COLOR_BLACK, + COLOR_BLUE, + COLOR_GREEN, + COLOR_CYAN, + COLOR_RED, + COLOR_MAGENTA, + COLOR_YELLOW, + COLOR_WHITE +}; + +static int use_color; + static void grub_ncurses_putchar (grub_uint32_t c) { @@ -100,24 +122,46 @@ grub_ncurses_setcolorstate (grub_term_color_state state) switch (state) { case GRUB_TERM_COLOR_STANDARD: + grub_console_cur_color = grub_console_standard_color; grub_console_attr = A_NORMAL; break; case GRUB_TERM_COLOR_NORMAL: + grub_console_cur_color = grub_console_normal_color; grub_console_attr = A_NORMAL; break; case GRUB_TERM_COLOR_HIGHLIGHT: + grub_console_cur_color = grub_console_highlight_color; grub_console_attr = A_STANDOUT; break; default: break; } + + if (use_color) + { + grub_uint8_t fg, bg; + + fg = (grub_console_cur_color & 7); + bg = (grub_console_cur_color >> 4) & 7; + + grub_console_attr = (grub_console_cur_color & 8) ? A_BOLD : A_NORMAL; + color_set ((bg << 3) + fg, 0); + } } /* XXX: This function is never called. */ static void grub_ncurses_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color) { - color_set (normal_color << 8 | highlight_color, 0); + grub_console_normal_color = normal_color; + grub_console_highlight_color = highlight_color; +} + +static void +grub_ncurses_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color) +{ + *normal_color = grub_console_normal_color; + *highlight_color = grub_console_highlight_color; } static int saved_char = ERR; @@ -272,7 +316,23 @@ grub_ncurses_init (void) nonl (); intrflush (stdscr, FALSE); keypad (stdscr, TRUE); - start_color (); + + if (has_colors ()) + { + start_color (); + + if ((COLORS >= NUM_COLORS) && (COLOR_PAIRS >= NUM_COLORS * NUM_COLORS)) + { + int i, j, n; + + n = 0; + for (i = 0; i < NUM_COLORS; i++) + for (j = 0; j < NUM_COLORS; j++) + init_pair(n++, color_map[j], color_map[i]); + + use_color = 1; + } + } return 0; } @@ -300,6 +360,7 @@ static struct grub_term grub_ncurses_term = .cls = grub_ncurses_cls, .setcolorstate = grub_ncurses_setcolorstate, .setcolor = grub_ncurses_setcolor, + .getcolor = grub_ncurses_getcolor, .setcursor = grub_ncurses_setcursor, .refresh = grub_ncurses_refresh, .flags = 0, From 9e7007b310fbdc663390af532ada0a4eed801156 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 5 Aug 2008 15:15:59 +0000 Subject: [PATCH 0323/1707] 2008-08-05 Bean * boot/i386/pc/pxeboot.S (_start): Use drive number 0x7F for pxe. * conf/i386-pc.rmk (kernel_img_HEADERS): Add machine/pxe.h. (pkglib_MODULES): Add pxe.mod and pxecmd.mod. (pxe_mod_SOURCES): New macro. (pxe_mod_CFLAGS): Likewise. (pxe_mod_LDFLAGS): Likewise. (pxecmd_mod_SOURCES): Likewise. (pxecmd_mod_CFLAGS): Likewise. (pxecmd_mod_LDFLAGS): Likewise. * kern/i386/pc/startup.S (grub_pxe_scan): New function. (grub_pxe_call): Likewise. * include/grub/disk.h (grub_disk_dev_id): Add GRUB_DISK_DEVICE_PXE_ID. * commands/i386/pc/pxecmd.c: New file. * disk/i386/pc/pxe.c: Likewise. * include/grub/i386/pc/pxe.h: Likewise. --- ChangeLog | 24 +++ boot/i386/pc/pxeboot.S | 3 +- commands/i386/pc/pxecmd.c | 96 +++++++++++ conf/i386-pc.mk | 119 ++++++++++++- conf/i386-pc.rmk | 15 +- conf/x86_64-efi.mk | 47 +++++- fs/i386/pc/pxe.c | 335 +++++++++++++++++++++++++++++++++++++ include/grub/disk.h | 1 + include/grub/i386/pc/pxe.h | 318 +++++++++++++++++++++++++++++++++++ kern/i386/pc/startup.S | 99 +++++++++++ 10 files changed, 1048 insertions(+), 9 deletions(-) create mode 100644 commands/i386/pc/pxecmd.c create mode 100644 fs/i386/pc/pxe.c create mode 100644 include/grub/i386/pc/pxe.h diff --git a/ChangeLog b/ChangeLog index f6ac4191b..d7d6a820c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2008-08-05 Bean + + * boot/i386/pc/pxeboot.S (_start): Use drive number 0x7F for pxe. + + * conf/i386-pc.rmk (kernel_img_HEADERS): Add machine/pxe.h. + (pkglib_MODULES): Add pxe.mod and pxecmd.mod. + (pxe_mod_SOURCES): New macro. + (pxe_mod_CFLAGS): Likewise. + (pxe_mod_LDFLAGS): Likewise. + (pxecmd_mod_SOURCES): Likewise. + (pxecmd_mod_CFLAGS): Likewise. + (pxecmd_mod_LDFLAGS): Likewise. + + * kern/i386/pc/startup.S (grub_pxe_scan): New function. + (grub_pxe_call): Likewise. + + * include/grub/disk.h (grub_disk_dev_id): Add GRUB_DISK_DEVICE_PXE_ID. + + * commands/i386/pc/pxecmd.c: New file. + + * disk/i386/pc/pxe.c: Likewise. + + * include/grub/i386/pc/pxe.h: Likewise. + 2008-08-05 Bean * util/console.c (grub_console_cur_color): New variable. diff --git a/boot/i386/pc/pxeboot.S b/boot/i386/pc/pxeboot.S index 7f2a14396..4fdff764f 100644 --- a/boot/i386/pc/pxeboot.S +++ b/boot/i386/pc/pxeboot.S @@ -26,7 +26,8 @@ .globl _start; _start: /* Root drive will default to boot drive */ - movb $0xFF, %dh + movb $0xFF, %dh + movb $0x7F, %dl /* Jump to the real world */ ljmp $0, $0x8200 diff --git a/commands/i386/pc/pxecmd.c b/commands/i386/pc/pxecmd.c new file mode 100644 index 000000000..bf4afa228 --- /dev/null +++ b/commands/i386/pc/pxecmd.c @@ -0,0 +1,96 @@ +/* pxe.c - command to control the pxe driver */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static const struct grub_arg_option options[] = +{ + {"info", 'i', 0, "show PXE information.", 0, 0}, + {"bsize", 'b', 0, "set PXE block size", 0, ARG_TYPE_INT}, + {"unload", 'u', 0, "unload PXE stack.", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + +static void +print_ip (grub_uint32_t ip) +{ + int i; + + for (i = 0; i < 3; i++) + { + grub_printf ("%d.", ip & 0xFF); + ip >>= 8; + } + grub_printf ("%d", ip); +} + +static grub_err_t +grub_cmd_pxe (struct grub_arg_list *state, int argc, char **args) +{ + if (! grub_pxe_pxenv) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "no pxe environment"); + + if (state[1].set) + { + int size; + + size = grub_strtoul (state[1].arg, 0, 0); + if (size < GRUB_PXE_MIN_BLKSIZE) + size = GRUB_PXE_MIN_BLKSIZE; + else if (size > GRUB_PXE_MAX_BLKSIZE) + size = GRUB_PXE_MAX_BLKSIZE; + + grub_pxe_blksize = size; + } + + if (state[0].set) + { + grub_printf ("blksize : %d\n", grub_pxe_blksize); + grub_printf ("client ip : "); + print_ip (grub_pxe_your_ip); + grub_printf ("\nserver ip : "); + print_ip (grub_pxe_server_ip); + grub_printf ("\ngateway ip : "); + print_ip (grub_pxe_gateway_ip); + grub_printf ("\n"); + } + + if (state[2].set) + grub_pxe_unload (); + + return 0; +} + +GRUB_MOD_INIT(pxecmd) +{ + (void) mod; /* To stop warning. */ + grub_register_command ("pxe", grub_cmd_pxe, GRUB_COMMAND_FLAG_BOTH, + "pxe [-i|-b|-u]", + "Command to control the PXE device.", options); +} + +GRUB_MOD_FINI(pxecmd) +{ + grub_unregister_command ("pxe"); +} diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 71d975817..edbf0cf8f 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -225,7 +225,8 @@ kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h machine/vga.h machine/vbe.h machine/kernel.h + machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ + machine/kernel.h machine/pxe.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) @@ -899,7 +900,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ - aout.mod _bsd.mod bsd.mod + aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -3058,4 +3059,118 @@ partmap-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i3 bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pxe.mod +pxe_mod_SOURCES = fs/i386/pc/pxe.c +CLEANFILES += pxe.mod mod-pxe.o mod-pxe.c pre-pxe.o pxe_mod-fs_i386_pc_pxe.o und-pxe.lst +ifneq ($(pxe_mod_EXPORTS),no) +CLEANFILES += def-pxe.lst +DEFSYMFILES += def-pxe.lst +endif +MOSTLYCLEANFILES += pxe_mod-fs_i386_pc_pxe.d +UNDSYMFILES += und-pxe.lst + +pxe.mod: pre-pxe.o mod-pxe.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(pxe_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pxe.o mod-pxe.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-pxe.o: $(pxe_mod_DEPENDENCIES) pxe_mod-fs_i386_pc_pxe.o + -rm -f $@ + $(TARGET_CC) $(pxe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pxe_mod-fs_i386_pc_pxe.o + +mod-pxe.o: mod-pxe.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -c -o $@ $< + +mod-pxe.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pxe' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pxe_mod_EXPORTS),no) +def-pxe.lst: pre-pxe.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pxe/' > $@ +endif + +und-pxe.lst: pre-pxe.o + echo 'pxe' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pxe_mod-fs_i386_pc_pxe.o: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) + $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -MD -c -o $@ $< +-include pxe_mod-fs_i386_pc_pxe.d + +CLEANFILES += cmd-pxe_mod-fs_i386_pc_pxe.lst fs-pxe_mod-fs_i386_pc_pxe.lst partmap-pxe_mod-fs_i386_pc_pxe.lst +COMMANDFILES += cmd-pxe_mod-fs_i386_pc_pxe.lst +FSFILES += fs-pxe_mod-fs_i386_pc_pxe.lst +PARTMAPFILES += partmap-pxe_mod-fs_i386_pc_pxe.lst + +cmd-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxe > $@ || (rm -f $@; exit 1) + +fs-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxe > $@ || (rm -f $@; exit 1) + +partmap-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxe > $@ || (rm -f $@; exit 1) + + +pxe_mod_CFLAGS = $(COMMON_CFLAGS) +pxe_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For pxecmd.mod +pxecmd_mod_SOURCES = commands/i386/pc/pxecmd.c +CLEANFILES += pxecmd.mod mod-pxecmd.o mod-pxecmd.c pre-pxecmd.o pxecmd_mod-commands_i386_pc_pxecmd.o und-pxecmd.lst +ifneq ($(pxecmd_mod_EXPORTS),no) +CLEANFILES += def-pxecmd.lst +DEFSYMFILES += def-pxecmd.lst +endif +MOSTLYCLEANFILES += pxecmd_mod-commands_i386_pc_pxecmd.d +UNDSYMFILES += und-pxecmd.lst + +pxecmd.mod: pre-pxecmd.o mod-pxecmd.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(pxecmd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pxecmd.o mod-pxecmd.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-pxecmd.o: $(pxecmd_mod_DEPENDENCIES) pxecmd_mod-commands_i386_pc_pxecmd.o + -rm -f $@ + $(TARGET_CC) $(pxecmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pxecmd_mod-commands_i386_pc_pxecmd.o + +mod-pxecmd.o: mod-pxecmd.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -c -o $@ $< + +mod-pxecmd.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pxecmd' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pxecmd_mod_EXPORTS),no) +def-pxecmd.lst: pre-pxecmd.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pxecmd/' > $@ +endif + +und-pxecmd.lst: pre-pxecmd.o + echo 'pxecmd' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pxecmd_mod-commands_i386_pc_pxecmd.o: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -MD -c -o $@ $< +-include pxecmd_mod-commands_i386_pc_pxecmd.d + +CLEANFILES += cmd-pxecmd_mod-commands_i386_pc_pxecmd.lst fs-pxecmd_mod-commands_i386_pc_pxecmd.lst partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst +COMMANDFILES += cmd-pxecmd_mod-commands_i386_pc_pxecmd.lst +FSFILES += fs-pxecmd_mod-commands_i386_pc_pxecmd.lst +PARTMAPFILES += partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst + +cmd-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxecmd > $@ || (rm -f $@; exit 1) + +fs-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxecmd > $@ || (rm -f $@; exit 1) + +partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxecmd > $@ || (rm -f $@; exit 1) + + +pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) +pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index e400ffc63..3e8469e00 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -54,7 +54,8 @@ kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h machine/vga.h machine/vbe.h machine/kernel.h + machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ + machine/kernel.h machine/pxe.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) @@ -162,7 +163,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ - aout.mod _bsd.mod bsd.mod + aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -329,4 +330,14 @@ bsd_mod_SOURCES = loader/i386/bsd_normal.c bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For pxe.mod +pxe_mod_SOURCES = fs/i386/pc/pxe.c +pxe_mod_CFLAGS = $(COMMON_CFLAGS) +pxe_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For pxecmd.mod +pxecmd_mod_SOURCES = commands/i386/pc/pxecmd.c +pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) +pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 495af8308..8f25993fb 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -112,13 +112,14 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ + kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d +MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -127,9 +128,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -583,6 +584,44 @@ partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_generic_millisleep.d + +CLEANFILES += cmd-kernel_mod-kern_generic_millisleep.lst fs-kernel_mod-kern_generic_millisleep.lst partmap-kernel_mod-kern_generic_millisleep.lst +COMMANDFILES += cmd-kernel_mod-kern_generic_millisleep.lst +FSFILES += fs-kernel_mod-kern_generic_millisleep.lst +PARTMAPFILES += partmap-kernel_mod-kern_generic_millisleep.lst + +cmd-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_generic_rtc_get_time_ms.d + +CLEANFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst fs-kernel_mod-kern_generic_rtc_get_time_ms.lst partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst +COMMANDFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst +FSFILES += fs-kernel_mod-kern_generic_rtc_get_time_ms.lst +PARTMAPFILES += partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst + +cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-term_efi_console.d diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c new file mode 100644 index 000000000..ced1088a5 --- /dev/null +++ b/fs/i386/pc/pxe.c @@ -0,0 +1,335 @@ +/* pxe.c - Driver to provide access to the pxe filesystem */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#define SEGMENT(x) ((x) >> 4) +#define OFFSET(x) ((x) & 0xF) +#define SEGOFS(x) ((SEGMENT(x) << 16) + OFFSET(x)) +#define LINEAR(x) (void *) (((x >> 16) <<4) + (x & 0xFFFF)) + +struct grub_pxenv *grub_pxe_pxenv; +grub_uint32_t grub_pxe_your_ip; +grub_uint32_t grub_pxe_server_ip; +grub_uint32_t grub_pxe_gateway_ip; +int grub_pxe_blksize = GRUB_PXE_MIN_BLKSIZE; + +struct grub_pxe_data +{ + grub_uint32_t packet_number; + char filename[0]; +}; + +static int +grub_pxe_iterate (int (*hook) (const char *name)) +{ + if (hook ("pxe")) + return 1; + return 0; +} + +static grub_err_t +grub_pxe_open (const char *name, grub_disk_t disk) +{ + if (grub_strcmp (name, "pxe")) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a pxe disk"); + + disk->total_sectors = 0; + disk->id = (unsigned long) "pxe"; + + disk->has_partitions = 0; + disk->data = 0; + + return GRUB_ERR_NONE; +} + +static void +grub_pxe_close (grub_disk_t disk __attribute((unused))) +{ +} + +static grub_err_t +grub_pxe_read (grub_disk_t disk __attribute((unused)), + grub_disk_addr_t sector __attribute((unused)), + grub_size_t size __attribute((unused)), + char *buf __attribute((unused))) +{ + return GRUB_ERR_OUT_OF_RANGE; +} + +static grub_err_t +grub_pxe_write (grub_disk_t disk __attribute((unused)), + grub_disk_addr_t sector __attribute((unused)), + grub_size_t size __attribute((unused)), + const char *buf __attribute((unused))) +{ + return GRUB_ERR_OUT_OF_RANGE; +} + +static struct grub_disk_dev grub_pxe_dev = + { + .name = "pxe", + .id = GRUB_DISK_DEVICE_PXE_ID, + .iterate = grub_pxe_iterate, + .open = grub_pxe_open, + .close = grub_pxe_close, + .read = grub_pxe_read, + .write = grub_pxe_write, + .next = 0 + }; + +static grub_err_t +grub_pxefs_dir (grub_device_t device __attribute((unused)), + const char *path __attribute((unused)), + int (*hook) (const char *filename, int dir) __attribute((unused))) +{ + return GRUB_ERR_NONE; +} + +static struct grub_fs grub_pxefs_fs_int; + +static grub_err_t +grub_pxefs_open (struct grub_file *file, const char *name) +{ + union + { + struct grub_pxenv_tftp_get_fsize c1; + struct grub_pxenv_tftp_open c2; + } c; + struct grub_pxe_data *data; + grub_file_t file_int, bufio; + + c.c1.server_ip = grub_pxe_server_ip; + c.c1.gateway_ip = grub_pxe_gateway_ip; + grub_strcpy (c.c1.filename, name); + grub_pxe_call (GRUB_PXENV_TFTP_GET_FSIZE, &c.c1); + if (c.c1.status) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); + + file->size = c.c1.file_size; + + c.c2.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT); + c.c2.packet_size = grub_pxe_blksize; + grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &c.c2); + if (c.c2.status) + return grub_error (GRUB_ERR_BAD_FS, "open fails"); + + data = grub_malloc (sizeof (struct grub_pxe_data) + grub_strlen (name) + 1); + if (! data) + return grub_errno; + + data->packet_number = 0; + grub_strcpy (data->filename, name); + + file_int = grub_malloc (sizeof (*file_int)); + if (! file_int) + { + grub_free (data); + return grub_errno; + } + + file_int->data = data; + file_int->offset = 0; + file_int->device = 0; + file_int->size = file->size; + file_int->read_hook = 0; + file_int->fs = &grub_pxefs_fs_int; + + bufio = grub_bufio_open (file_int, grub_pxe_blksize); + if (! bufio) + { + grub_free (file_int); + grub_free (data); + return grub_errno; + } + + file->data = bufio; + + return GRUB_ERR_NONE; +} + +static grub_ssize_t +grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) +{ + grub_file_t bufio; + + bufio = file->data; + bufio->offset = file->offset; + + return bufio->fs->read (bufio, buf, len); +} + +static grub_ssize_t +grub_pxefs_close (grub_file_t file) +{ + grub_file_close ((grub_file_t) file->data); + + return grub_errno; +} + +static grub_ssize_t +grub_pxefs_read_int (grub_file_t file, char *buf, grub_size_t len) +{ + struct grub_pxenv_tftp_read c; + struct grub_pxe_data *data; + grub_uint32_t pn, r; + + data = file->data; + + pn = grub_divmod64 (file->offset, grub_pxe_blksize, &r); + if (r) + return grub_error (GRUB_ERR_BAD_FS, + "read access must be aligned to packet size"); + + if (data->packet_number > pn) + { + struct grub_pxenv_tftp_open o; + + grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &o); + + o.server_ip = grub_pxe_server_ip; + o.gateway_ip = grub_pxe_gateway_ip; + grub_strcpy (o.filename, data->filename); + o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT); + o.packet_size = grub_pxe_blksize; + grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o); + if (o.status) + return grub_error (GRUB_ERR_BAD_FS, "open fails"); + data->packet_number = 0; + } + + c.buffer = SEGOFS (GRUB_MEMORY_MACHINE_SCRATCH_ADDR); + while (pn >= data->packet_number) + { + c.buffer_size = grub_pxe_blksize; + grub_pxe_call (GRUB_PXENV_TFTP_READ, &c); + if (c.status) + { + grub_error (GRUB_ERR_BAD_FS, "read fails"); + return -1; + } + data->packet_number++; + } + + grub_memcpy (buf, (char *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR, len); + + return len; +} + +static grub_err_t +grub_pxefs_close_int (grub_file_t file) +{ + struct grub_pxenv_tftp_close c; + + grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &c); + grub_free (file->data); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_pxefs_label (grub_device_t device __attribute ((unused)), + char **label __attribute ((unused))) +{ + *label = 0; + return GRUB_ERR_NONE; +} + +static struct grub_fs grub_pxefs_fs = + { + .name = "pxefs", + .dir = grub_pxefs_dir, + .open = grub_pxefs_open, + .read = grub_pxefs_read, + .close = grub_pxefs_close, + .label = grub_pxefs_label, + .next = 0 + }; + +static struct grub_fs grub_pxefs_fs_int = + { + .name = "pxefs", + .read = grub_pxefs_read_int, + .close = grub_pxefs_close_int, + }; + +static void +grub_pxe_detect (void) +{ + struct grub_pxenv *pxenv; + struct grub_pxenv_get_cached_info ci; + struct grub_pxenv_boot_player *bp; + + pxenv = grub_pxe_scan (); + if (! pxenv) + return; + + ci.packet_type = GRUB_PXENV_PACKET_TYPE_DHCP_ACK; + ci.buffer = 0; + ci.buffer_size = 0; + grub_pxe_call (GRUB_PXENV_GET_CACHED_INFO, &ci); + if (ci.status) + return; + + bp = LINEAR (ci.buffer); + + grub_pxe_your_ip = bp->your_ip; + grub_pxe_server_ip = bp->server_ip; + grub_pxe_gateway_ip = bp->gateway_ip; + + grub_pxe_pxenv = pxenv; +} + +void +grub_pxe_unload (void) +{ + if (grub_pxe_pxenv) + { + grub_fs_unregister (&grub_pxefs_fs); + grub_disk_dev_unregister (&grub_pxe_dev); + + grub_pxe_pxenv = 0; + } +} + +GRUB_MOD_INIT(pxe) +{ + (void) mod; /* To stop warning. */ + + grub_pxe_detect (); + if (grub_pxe_pxenv) + { + grub_disk_dev_register (&grub_pxe_dev); + grub_fs_register (&grub_pxefs_fs); + } +} + +GRUB_MOD_FINI(pxe) +{ + grub_pxe_unload (); +} diff --git a/include/grub/disk.h b/include/grub/disk.h index 0e2789219..049cc91b9 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -39,6 +39,7 @@ enum grub_disk_dev_id GRUB_DISK_DEVICE_MEMDISK_ID, GRUB_DISK_DEVICE_NAND_ID, GRUB_DISK_DEVICE_UUID_ID, + GRUB_DISK_DEVICE_PXE_ID, }; struct grub_disk; diff --git a/include/grub/i386/pc/pxe.h b/include/grub/i386/pc/pxe.h new file mode 100644 index 000000000..482132896 --- /dev/null +++ b/include/grub/i386/pc/pxe.h @@ -0,0 +1,318 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CPU_PXE_H +#define GRUB_CPU_PXE_H + +#include + +#define GRUB_PXENV_TFTP_OPEN 0x0020 +#define GRUB_PXENV_TFTP_CLOSE 0x0021 +#define GRUB_PXENV_TFTP_READ 0x0022 +#define GRUB_PXENV_TFTP_READ_FILE 0x0023 +#define GRUB_PXENV_TFTP_READ_FILE_PMODE 0x0024 +#define GRUB_PXENV_TFTP_GET_FSIZE 0x0025 + +#define GRUB_PXENV_UDP_OPEN 0x0030 +#define GRUB_PXENV_UDP_CLOSE 0x0031 +#define GRUB_PXENV_UDP_READ 0x0032 +#define GRUB_PXENV_UDP_WRITE 0x0033 + +#define GRUB_PXENV_START_UNDI 0x0000 +#define GRUB_PXENV_UNDI_STARTUP 0x0001 +#define GRUB_PXENV_UNDI_CLEANUP 0x0002 +#define GRUB_PXENV_UNDI_INITIALIZE 0x0003 +#define GRUB_PXENV_UNDI_RESET_NIC 0x0004 +#define GRUB_PXENV_UNDI_SHUTDOWN 0x0005 +#define GRUB_PXENV_UNDI_OPEN 0x0006 +#define GRUB_PXENV_UNDI_CLOSE 0x0007 +#define GRUB_PXENV_UNDI_TRANSMIT 0x0008 +#define GRUB_PXENV_UNDI_SET_MCAST_ADDR 0x0009 +#define GRUB_PXENV_UNDI_SET_STATION_ADDR 0x000A +#define GRUB_PXENV_UNDI_SET_PACKET_FILTER 0x000B +#define GRUB_PXENV_UNDI_GET_INFORMATION 0x000C +#define GRUB_PXENV_UNDI_GET_STATISTICS 0x000D +#define GRUB_PXENV_UNDI_CLEAR_STATISTICS 0x000E +#define GRUB_PXENV_UNDI_INITIATE_DIAGS 0x000F +#define GRUB_PXENV_UNDI_FORCE_INTERRUPT 0x0010 +#define GRUB_PXENV_UNDI_GET_MCAST_ADDR 0x0011 +#define GRUB_PXENV_UNDI_GET_NIC_TYPE 0x0012 +#define GRUB_PXENV_UNDI_GET_IFACE_INFO 0x0013 +#define GRUB_PXENV_UNDI_ISR 0x0014 +#define GRUB_PXENV_STOP_UNDI 0x0015 +#define GRUB_PXENV_UNDI_GET_STATE 0x0015 + +#define GRUB_PXENV_UNLOAD_STACK 0x0070 +#define GRUB_PXENV_GET_CACHED_INFO 0x0071 +#define GRUB_PXENV_RESTART_DHCP 0x0072 +#define GRUB_PXENV_RESTART_TFTP 0x0073 +#define GRUB_PXENV_MODE_SWITCH 0x0074 +#define GRUB_PXENV_START_BASE 0x0075 +#define GRUB_PXENV_STOP_BASE 0x0076 + +#define GRUB_PXENV_EXIT_SUCCESS 0x0000 +#define GRUB_PXENV_EXIT_FAILURE 0x0001 + +#define GRUB_PXENV_STATUS_SUCCESS 0x00 +#define GRUB_PXENV_STATUS_FAILURE 0x01 +#define GRUB_PXENV_STATUS_BAD_FUNC 0x02 +#define GRUB_PXENV_STATUS_UNSUPPORTED 0x03 +#define GRUB_PXENV_STATUS_KEEP_UNDI 0x04 +#define GRUB_PXENV_STATUS_KEEP_ALL 0x05 +#define GRUB_PXENV_STATUS_OUT_OF_RESOURCES 0x06 +#define GRUB_PXENV_STATUS_ARP_TIMEOUT 0x11 +#define GRUB_PXENV_STATUS_UDP_CLOSED 0x18 +#define GRUB_PXENV_STATUS_UDP_OPEN 0x19 +#define GRUB_PXENV_STATUS_TFTP_CLOSED 0x1A +#define GRUB_PXENV_STATUS_TFTP_OPEN 0x1B +#define GRUB_PXENV_STATUS_MCOPY_PROBLEM 0x20 +#define GRUB_PXENV_STATUS_BIS_INTEGRITY_FAILURE 0x21 +#define GRUB_PXENV_STATUS_BIS_VALIDATE_FAILURE 0x22 +#define GRUB_PXENV_STATUS_BIS_INIT_FAILURE 0x23 +#define GRUB_PXENV_STATUS_BIS_SHUTDOWN_FAILURE 0x24 +#define GRUB_PXENV_STATUS_BIS_GBOA_FAILURE 0x25 +#define GRUB_PXENV_STATUS_BIS_FREE_FAILURE 0x26 +#define GRUB_PXENV_STATUS_BIS_GSI_FAILURE 0x27 +#define GRUB_PXENV_STATUS_BIS_BAD_CKSUM 0x28 +#define GRUB_PXENV_STATUS_TFTP_CANNOT_ARP_ADDRESS 0x30 +#define GRUB_PXENV_STATUS_TFTP_OPEN_TIMEOUT 0x32 + +#define GRUB_PXENV_STATUS_TFTP_UNKNOWN_OPCODE 0x33 +#define GRUB_PXENV_STATUS_TFTP_READ_TIMEOUT 0x35 +#define GRUB_PXENV_STATUS_TFTP_ERROR_OPCODE 0x36 +#define GRUB_PXENV_STATUS_TFTP_CANNOT_OPEN_CONNECTION 0x38 +#define GRUB_PXENV_STATUS_TFTP_CANNOT_READ_FROM_CONNECTION 0x39 +#define GRUB_PXENV_STATUS_TFTP_TOO_MANY_PACKAGES 0x3A +#define GRUB_PXENV_STATUS_TFTP_FILE_NOT_FOUND 0x3B +#define GRUB_PXENV_STATUS_TFTP_ACCESS_VIOLATION 0x3C +#define GRUB_PXENV_STATUS_TFTP_NO_MCAST_ADDRESS 0x3D +#define GRUB_PXENV_STATUS_TFTP_NO_FILESIZE 0x3E +#define GRUB_PXENV_STATUS_TFTP_INVALID_PACKET_SIZE 0x3F +#define GRUB_PXENV_STATUS_DHCP_TIMEOUT 0x51 +#define GRUB_PXENV_STATUS_DHCP_NO_IP_ADDRESS 0x52 +#define GRUB_PXENV_STATUS_DHCP_NO_BOOTFILE_NAME 0x53 +#define GRUB_PXENV_STATUS_DHCP_BAD_IP_ADDRESS 0x54 +#define GRUB_PXENV_STATUS_UNDI_INVALID_FUNCTION 0x60 +#define GRUB_PXENV_STATUS_UNDI_MEDIATEST_FAILED 0x61 +#define GRUB_PXENV_STATUS_UNDI_CANNOT_INIT_NIC_FOR_MCAST 0x62 +#define GRUB_PXENV_STATUS_UNDI_CANNOT_INITIALIZE_NIC 0x63 +#define GRUB_PXENV_STATUS_UNDI_CANNOT_INITIALIZE_PHY 0x64 +#define GRUB_PXENV_STATUS_UNDI_CANNOT_READ_CONFIG_DATA 0x65 +#define GRUB_PXENV_STATUS_UNDI_CANNOT_READ_INIT_DATA 0x66 +#define GRUB_PXENV_STATUS_UNDI_BAD_MAC_ADDRESS 0x67 +#define GRUB_PXENV_STATUS_UNDI_BAD_EEPROM_CHECKSUM 0x68 +#define GRUB_PXENV_STATUS_UNDI_ERROR_SETTING_ISR 0x69 +#define GRUB_PXENV_STATUS_UNDI_INVALID_STATE 0x6A +#define GRUB_PXENV_STATUS_UNDI_TRANSMIT_ERROR 0x6B +#define GRUB_PXENV_STATUS_UNDI_INVALID_PARAMETER 0x6C +#define GRUB_PXENV_STATUS_BSTRAP_PROMPT_MENU 0x74 +#define GRUB_PXENV_STATUS_BSTRAP_MCAST_ADDR 0x76 +#define GRUB_PXENV_STATUS_BSTRAP_MISSING_LIST 0x77 +#define GRUB_PXENV_STATUS_BSTRAP_NO_RESPONSE 0x78 +#define GRUB_PXENV_STATUS_BSTRAP_FILE_TOO_BIG 0x79 +#define GRUB_PXENV_STATUS_BINL_CANCELED_BY_KEYSTROKE 0xA0 +#define GRUB_PXENV_STATUS_BINL_NO_PXE_SERVER 0xA1 +#define GRUB_PXENV_STATUS_NOT_AVAILABLE_IN_PMODE 0xA2 +#define GRUB_PXENV_STATUS_NOT_AVAILABLE_IN_RMODE 0xA3 +#define GRUB_PXENV_STATUS_BUSD_DEVICE_NOT_SUPPORTED 0xB0 +#define GRUB_PXENV_STATUS_LOADER_NO_FREE_BASE_MEMORY 0xC0 +#define GRUB_PXENV_STATUS_LOADER_NO_BC_ROMID 0xC1 +#define GRUB_PXENV_STATUS_LOADER_BAD_BC_ROMID 0xC2 +#define GRUB_PXENV_STATUS_LOADER_BAD_BC_RUNTIME_IMAGE 0xC3 +#define GRUB_PXENV_STATUS_LOADER_NO_UNDI_ROMID 0xC4 +#define GRUB_PXENV_STATUS_LOADER_BAD_UNDI_ROMID 0xC5 +#define GRUB_PXENV_STATUS_LOADER_BAD_UNDI_DRIVER_IMAGE 0xC6 +#define GRUB_PXENV_STATUS_LOADER_NO_PXE_STRUCT 0xC8 +#define GRUB_PXENV_STATUS_LOADER_NO_PXENV_STRUCT 0xC9 +#define GRUB_PXENV_STATUS_LOADER_UNDI_START 0xCA +#define GRUB_PXENV_STATUS_LOADER_BC_START 0xCB + +#define GRUB_PXENV_PACKET_TYPE_DHCP_DISCOVER 1 +#define GRUB_PXENV_PACKET_TYPE_DHCP_ACK 2 +#define GRUB_PXENV_PACKET_TYPE_CACHED_REPLY 3 + +#define GRUB_PXE_BOOTP_REQ 1 +#define GRUB_PXE_BOOTP_REP 2 + +#define GRUB_PXE_BOOTP_BCAST 0x8000 + +#if 1 +#define GRUB_PXE_BOOTP_DHCPVEND 1024 /* DHCP extended vendor field size. */ +#else +#define GRUB_PXE_BOOTP_DHCPVEND 312 /* DHCP standard vendor field size. */ +#endif + +#define GRUB_PXE_MIN_BLKSIZE 512 +#define GRUB_PXE_MAX_BLKSIZE 1432 + +#define GRUB_PXE_TFTP_PORT 69 + +#define GRUB_PXE_VM_RFC1048 0x63825363L + +#define GRUB_PXE_ERR_LEN 0xFFFFFFFF + +#ifndef ASM_FILE + +struct grub_pxenv +{ + grub_uint8_t signature[6]; /* 'PXENV+'. */ + grub_uint16_t version; /* MSB = major, LSB = minor. */ + grub_uint8_t length; /* structure length. */ + grub_uint8_t checksum; /* checksum pad. */ + grub_uint32_t rm_entry; /* SEG:OFF to PXE entry point. */ + grub_uint32_t pm_offset; /* Protected mode entry. */ + grub_uint16_t pm_selector; /* Protected mode selector. */ + grub_uint16_t stack_seg; /* Stack segment address. */ + grub_uint16_t stack_size; /* Stack segment size (bytes). */ + grub_uint16_t bc_code_seg; /* BC Code segment address. */ + grub_uint16_t bc_code_size; /* BC Code segment size (bytes). */ + grub_uint16_t bc_data_seg; /* BC Data segment address. */ + grub_uint16_t bc_data_size; /* BC Data segment size (bytes). */ + grub_uint16_t undi_data_seg; /* UNDI Data segment address. */ + grub_uint16_t undi_data_size; /* UNDI Data segment size (bytes). */ + grub_uint16_t undi_code_seg; /* UNDI Code segment address. */ + grub_uint16_t undi_code_size; /* UNDI Code segment size (bytes). */ + grub_uint32_t pxe_ptr; /* SEG:OFF to !PXE struct. */ +} __attribute__ ((packed)); + +struct grub_pxenv_get_cached_info +{ + grub_uint16_t status; + grub_uint16_t packet_type; + grub_uint16_t buffer_size; + grub_uint32_t buffer; + grub_uint16_t buffer_limit; +} __attribute__ ((packed)); + +#define GRUB_PXE_MAC_ADDR_LEN 16 + +typedef grub_uint8_t grub_pxe_mac_addr[GRUB_PXE_MAC_ADDR_LEN]; + +struct grub_pxenv_boot_player +{ + grub_uint8_t opcode; + grub_uint8_t hw_type; /* hardware type. */ + grub_uint8_t hw_len; /* hardware addr len. */ + grub_uint8_t gate_hops; /* zero it. */ + grub_uint32_t ident; /* random number chosen by client. */ + grub_uint16_t seconds; /* seconds since did initial bootstrap. */ + grub_uint16_t flags; + grub_uint32_t client_ip; + grub_uint32_t your_ip; + grub_uint32_t server_ip; + grub_uint32_t gateway_ip; + grub_pxe_mac_addr mac_addr; + grub_uint8_t server_name[64]; + grub_uint8_t boot_file[128]; + union + { + grub_uint8_t d[GRUB_PXE_BOOTP_DHCPVEND]; /* raw array of vendor/dhcp options. */ + struct + { + grub_uint32_t magic; /* DHCP magic cookie. */ + grub_uint32_t flags; /* bootp flags/opcodes. */ + grub_uint8_t padding[56]; + } v; + } vendor; +} __attribute__ ((packed)); + +struct grub_pxenv_tftp_open +{ + grub_uint16_t status; + grub_uint32_t server_ip; + grub_uint32_t gateway_ip; + grub_uint8_t filename[128]; + grub_uint16_t tftp_port; + grub_uint16_t packet_size; +} __attribute__ ((packed)); + +struct grub_pxenv_tftp_close +{ + grub_uint16_t status; +} __attribute__ ((packed)); + +struct grub_pxenv_tftp_read +{ + grub_uint16_t status; + grub_uint16_t packet_number; + grub_uint16_t buffer_size; + grub_uint32_t buffer; +} __attribute__ ((packed)); + +struct grub_pxenv_tftp_get_fsize +{ + grub_uint16_t status; + grub_uint32_t server_ip; + grub_uint32_t gateway_ip; + grub_uint8_t filename[128]; + grub_uint32_t file_size; +} __attribute__ ((packed)); + +struct grub_pxenv_udp_open +{ + grub_uint16_t status; + grub_uint32_t src_ip; +} __attribute__ ((packed)); + +struct grub_pxenv_udp_close +{ + grub_uint16_t status; +} __attribute__ ((packed)); + +struct grub_pxenv_udp_write +{ + grub_uint16_t status; + grub_uint32_t ip; + grub_uint32_t gateway; + grub_uint16_t src_port; + grub_uint16_t dst_port; + grub_uint16_t buffer_size; + grub_uint32_t buffer; +} __attribute__ ((packed)); + +struct grub_pxenv_udp_read +{ + grub_uint16_t status; + grub_uint32_t src_ip; + grub_uint32_t dst_ip; + grub_uint16_t src_port; + grub_uint16_t dst_port; + grub_uint16_t buffer_size; + grub_uint32_t buffer; +} __attribute__ ((packed)); + +struct grub_pxenv_unload_stack +{ + grub_uint16_t status; + grub_uint8_t reserved[10]; +} __attribute__ ((packed)); + +struct grub_pxenv * EXPORT_FUNC(grub_pxe_scan) (void); +int EXPORT_FUNC(grub_pxe_call) (int func, void * data); + +extern struct grub_pxenv *grub_pxe_pxenv; +extern grub_uint32_t grub_pxe_your_ip; +extern grub_uint32_t grub_pxe_server_ip; +extern grub_uint32_t grub_pxe_gateway_ip; +extern int grub_pxe_blksize; + +void grub_pxe_unload (void); + +#endif + +#endif /* GRUB_CPU_PXE_H */ diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index aa582ac49..197c447e3 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -2054,3 +2054,102 @@ FUNCTION(grub_vbe_bios_set_palette_data) popl %ebx popl %ebp ret + + +pxe_rm_entry: + .long 0 + +/* + * struct grub_pxenv *grub_pxe_scan (void); + */ +FUNCTION(grub_pxe_scan) + pushl %ebp + pushl %ebx + + xorl %ebx, %ebx + xorl %ecx, %ecx + + call prot_to_real + .code16 + + pushw %es + + movw $0x5650, %ax + int $0x1A + cmpw $0x564E, %ax + jnz 1f + cmpl $0x4E455850, %es:(%bx) /* PXEN(V+) */ + jnz 1f + cmpw $0x201, %es:6(%bx) /* API version */ + jb 1f + lesw %es:0x28(%bx), %bx /* !PXE structure */ + cmpl $0x45585021, %es:(%bx) /* !PXE */ + jnz 1f + movw %es, %cx + jmp 2f +1: + xorw %bx, %bx + xorw %cx, %cx +2: + + popw %es + + DATA32 call real_to_prot + .code32 + + xorl %eax, %eax + leal (%eax, %ecx, 4), %ecx + leal (%ebx, %ecx, 4), %eax /* eax = ecx * 16 + ebx */ + + orl %eax, %eax + jz 1f + + movl 0x10(%eax), %ecx + movl %ecx, pxe_rm_entry + +1: + + popl %ebx + popl %ebp + ret + +/* + * int grub_pxe_call (int func, void* data); + */ +FUNCTION(grub_pxe_call) + pushl %ebp + movl %esp, %ebp + pushl %esi + pushl %edi + pushl %ebx + + movl %eax, %ecx + movl %edx, %eax + andl $0xF, %eax + shrl $4, %edx + shll $16, %edx + addl %eax, %edx + movl pxe_rm_entry, %ebx + + call prot_to_real + .code16 + + pushl %ebx + pushl %edx + pushw %cx + movw %sp, %bx + lcall *%ss:6(%bx) + cld + addw $10, %sp + movw %ax, %cx + + DATA32 call real_to_prot + .code32 + + movzwl %cx, %eax + + popl %ebx + popl %edi + popl %esi + popl %ebp + ret From 24371d2620ba4b36905f86555a9d5793b6deb900 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 5 Aug 2008 20:24:00 +0000 Subject: [PATCH 0324/1707] 2008-08-05 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/pit.c'. * conf/i386-efi.rmk (kernel_mod_SOURCES): Likewise. * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Likewise. Also add `kern/i386/tsc.c', `kern/generic/rtc_get_time_ms.c' and `kern/generic/millisleep.c'. * kern/i386/tsc.c (calibrate_tsc): Rewrite using grub_pit_wait() instead of grub_get_rtc(). (grub_tsc_init): Initialize `tsc_boot_time'. * kern/i386/linuxbios/init.c (grub_millisleep): Remove stub. (grub_machine_init): Use grub_tsc_init() rather than installing an RTC-based handler via grub_install_get_time_ms(). * kern/i386/pit.c: New file. * include/grub/i386/pit.h: Likewise. --- ChangeLog | 19 +++++++++++++++++++ DISTLIST | 2 ++ conf/i386-coreboot.rmk | 3 +++ conf/i386-efi.rmk | 2 +- conf/i386-pc.rmk | 2 +- include/grub/i386/pit.h | 19 +++++++++++++++++++ kern/i386/linuxbios/init.c | 7 +------ kern/i386/pit.c | 39 ++++++++++++++++++++++++++++++++++++++ kern/i386/tsc.c | 39 +++++--------------------------------- 9 files changed, 90 insertions(+), 42 deletions(-) create mode 100644 include/grub/i386/pit.h create mode 100644 kern/i386/pit.c diff --git a/ChangeLog b/ChangeLog index d7d6a820c..85117e75c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2008-08-05 Robert Millan + + * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/pit.c'. + * conf/i386-efi.rmk (kernel_mod_SOURCES): Likewise. + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Likewise. Also add + `kern/i386/tsc.c', `kern/generic/rtc_get_time_ms.c' and + `kern/generic/millisleep.c'. + + * kern/i386/tsc.c (calibrate_tsc): Rewrite using grub_pit_wait() + instead of grub_get_rtc(). + (grub_tsc_init): Initialize `tsc_boot_time'. + + * kern/i386/linuxbios/init.c (grub_millisleep): Remove stub. + (grub_machine_init): Use grub_tsc_init() rather than + installing an RTC-based handler via grub_install_get_time_ms(). + + * kern/i386/pit.c: New file. + * include/grub/i386/pit.h: Likewise. + 2008-08-05 Bean * boot/i386/pc/pxeboot.S (_start): Use drive number 0x7F for pxe. diff --git a/DISTLIST b/DISTLIST index 6a7fffcce..649cb9085 100644 --- a/DISTLIST +++ b/DISTLIST @@ -159,6 +159,7 @@ include/grub/i386/pc/vbefill.h include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeutil.h include/grub/i386/pc/vga.h +include/grub/i386/pit.h include/grub/i386/setjmp.h include/grub/i386/time.h include/grub/i386/types.h @@ -240,6 +241,7 @@ kern/i386/loader.S kern/i386/pc/init.c kern/i386/pc/lzo1x.S kern/i386/pc/startup.S +kern/i386/pit.c kern/i386/realmode.S kern/ieee1275/cmain.c kern/ieee1275/ieee1275.c diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index c4ca95e8c..5535dab7a 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -18,6 +18,9 @@ kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/time.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ + kern/i386/tsc.c kern/i386/pit.c \ + kern/generic/rtc_get_time_ms.c \ + kern/generic/millisleep.c \ kern/env.c \ term/i386/pc/console.c \ term/i386/pc/at_keyboard.c term/i386/pc/vga_text.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index e35a5c9a7..a3234b596 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -85,7 +85,7 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ - kern/i386/tsc.c \ + kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 3e8469e00..c1e4ac4a9 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -44,7 +44,7 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/time.c \ kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ - kern/i386/tsc.c \ + kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ diff --git a/include/grub/i386/pit.h b/include/grub/i386/pit.h new file mode 100644 index 000000000..7ac0256a2 --- /dev/null +++ b/include/grub/i386/pit.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +extern void grub_pit_wait (grub_uint16_t tics); diff --git a/kern/i386/linuxbios/init.c b/kern/i386/linuxbios/init.c index 1d25986b7..0e6567b9d 100644 --- a/kern/i386/linuxbios/init.c +++ b/kern/i386/linuxbios/init.c @@ -60,11 +60,6 @@ grub_stop_floppy (void) grub_outb (0, GRUB_FLOPPY_REG_DIGITAL_OUTPUT); } -void -grub_millisleep (grub_uint32_t ms __attribute__ ((unused))) -{ -} - void grub_exit (void) { @@ -144,7 +139,7 @@ grub_machine_init (void) /* This variable indicates size, not offset. */ grub_upper_mem -= GRUB_MEMORY_MACHINE_UPPER_START; - grub_install_get_time_ms (grub_rtc_get_time_ms); + grub_tsc_init (); } void diff --git a/kern/i386/pit.c b/kern/i386/pit.c new file mode 100644 index 000000000..0dbbf1cd0 --- /dev/null +++ b/kern/i386/pit.c @@ -0,0 +1,39 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +#define TIMER2_REG_CONTROL 0x42 +#define TIMER_REG_COMMAND 0x43 +#define TIMER2_REG_LATCH 0x61 + +#define TIMER2_SELECT 0x80 +#define TIMER_ENABLE_LSB 0x20 +#define TIMER_ENABLE_MSB 0x10 +#define TIMER2_LATCH 0x20 + +void +grub_pit_wait (grub_uint16_t tics) +{ + grub_outb (TIMER2_SELECT | TIMER_ENABLE_LSB | TIMER_ENABLE_MSB, TIMER_REG_COMMAND); + grub_outb (tics & 0xff, TIMER2_REG_CONTROL); + grub_outb (tics >> 8, TIMER2_REG_CONTROL); + + while ((grub_inb (TIMER2_REG_LATCH) & TIMER2_LATCH) == 0x00); +} diff --git a/kern/i386/tsc.c b/kern/i386/tsc.c index a142e3d64..458fc0ec9 100644 --- a/kern/i386/tsc.c +++ b/kern/i386/tsc.c @@ -25,8 +25,7 @@ #include #include -/* Calibrated reference for TSC=0. This defines the time since the epoch in - milliseconds that TSC=0 refers to. */ +/* This defines the value TSC had at the epoch (that is, when we calibrated it). */ static grub_uint64_t tsc_boot_time; /* Calibrated TSC rate. (In TSC ticks per millisecond.) */ @@ -47,44 +46,15 @@ grub_tsc_get_time_ms (void) static void calibrate_tsc (void) { - /* First calbrate the TSC rate (relative, not absolute time). */ + /* First calibrate the TSC rate (relative, not absolute time). */ grub_uint64_t start_tsc; grub_uint64_t end_tsc; - grub_uint32_t initial_tick; - grub_uint32_t start_tick; - grub_uint32_t end_tick; - /* Wait for the start of the next tick; - we'll base out timing off this edge. */ - initial_tick = grub_get_rtc (); - do - { - start_tick = grub_get_rtc (); - } - while (start_tick == initial_tick); start_tsc = grub_get_tsc (); - - /* Wait for the start of the next tick. This will - be the end of the 1-tick period. */ - do - { - end_tick = grub_get_rtc (); - } - while (end_tick - start_tick < CALIBRATION_TICKS); + grub_pit_wait (0xffff); end_tsc = grub_get_tsc (); - tsc_ticks_per_ms = - grub_divmod64 (grub_divmod64 - (end_tsc - start_tsc, end_tick - start_tick, 0) - * GRUB_TICKS_PER_SECOND, 1000, 0); - - /* Reference the TSC zero (boot time) to the epoch to - get an absolute real time reference. */ - grub_uint64_t ms_since_boot = grub_divmod64 (end_tsc, tsc_ticks_per_ms, 0); - grub_uint64_t mstime_now = grub_divmod64 ((grub_uint64_t) 1000 * end_tick, - GRUB_TICKS_PER_SECOND, - 0); - tsc_boot_time = mstime_now - ms_since_boot; + tsc_ticks_per_ms = grub_divmod64 (end_tsc - start_tsc, 55, 0); } void @@ -92,6 +62,7 @@ grub_tsc_init (void) { if (grub_cpu_is_tsc_supported ()) { + tsc_boot_time = grub_get_tsc (); calibrate_tsc (); grub_install_get_time_ms (grub_tsc_get_time_ms); } From a55d42e0e0c952dc3730db71380c719c2cee5a43 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 6 Aug 2008 00:20:04 +0000 Subject: [PATCH 0325/1707] 2008-08-06 Robert Millan * conf/i386-coreboot.rmk (pkglib_MODULES): Add `reboot.mod' and `halt.mod'. (reboot_mod_SOURCES, reboot_mod_CFLAGS, reboot_mod_LDFLAGS) (halt_mod_SOURCES, halt_mod_CFLAGS, halt_mod_LDFLAGS): New variables. * kern/i386/halt.c: New file. * kern/i386/reboot.c: Likewise. * include/grub/i386/reboot.h: Likewise. * include/grub/i386/halt.h: Likewise. * commands/halt.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI]: Include `'. * commands/reboot.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI] [! GRUB_MACHINE_PCBIOS]: Include `'. * term/i386/pc/at_keyboard.c: Include `'. (SHIFT_L, SHIFT_R, CTRL, ALT, CAPS_LOCK, KEYBOARD_REG_DATA) (KEYBOARD_REG_STATUS, KEYBOARD_COMMAND_ISREADY, KEYBOARD_COMMAND_READ) (KEYBOARD_COMMAND_WRITE, KEYBOARD_COMMAND_REBOOT) (KEYBOARD_SCANCODE_SET1, KEYBOARD_ISMAKE, KEYBOARD_ISREADY) (KEYBOARD_SCANCODE, OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): Move from here ... * include/grub/i386/at_keyboard.h: ... to here. --- ChangeLog | 26 +++++ DISTLIST | 5 + commands/halt.c | 3 + commands/reboot.c | 3 + conf/i386-coreboot.mk | 182 +++++++++++++++++++++++++++++++- conf/i386-coreboot.rmk | 13 ++- conf/i386-efi.mk | 29 ++++- conf/i386-pc.mk | 12 ++- include/grub/i386/at_keyboard.h | 57 ++++++++++ include/grub/i386/halt.h | 19 ++++ include/grub/i386/reboot.h | 19 ++++ kern/i386/halt.c | 42 ++++++++ kern/i386/reboot.c | 31 ++++++ term/i386/pc/at_keyboard.c | 36 +------ 14 files changed, 428 insertions(+), 49 deletions(-) create mode 100644 include/grub/i386/at_keyboard.h create mode 100644 include/grub/i386/halt.h create mode 100644 include/grub/i386/reboot.h create mode 100644 kern/i386/halt.c create mode 100644 kern/i386/reboot.c diff --git a/ChangeLog b/ChangeLog index 85117e75c..0b1065fb1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2008-08-06 Robert Millan + + * conf/i386-coreboot.rmk (pkglib_MODULES): Add `reboot.mod' and + `halt.mod'. + (reboot_mod_SOURCES, reboot_mod_CFLAGS, reboot_mod_LDFLAGS) + (halt_mod_SOURCES, halt_mod_CFLAGS, halt_mod_LDFLAGS): New variables. + + * kern/i386/halt.c: New file. + * kern/i386/reboot.c: Likewise. + * include/grub/i386/reboot.h: Likewise. + * include/grub/i386/halt.h: Likewise. + + * commands/halt.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI]: + Include `'. + * commands/reboot.c [! GRUB_MACHINE_IEEE1275 ! GRUB_MACHINE_EFI] + [! GRUB_MACHINE_PCBIOS]: Include `'. + + * term/i386/pc/at_keyboard.c: Include `'. + (SHIFT_L, SHIFT_R, CTRL, ALT, CAPS_LOCK, KEYBOARD_REG_DATA) + (KEYBOARD_REG_STATUS, KEYBOARD_COMMAND_ISREADY, KEYBOARD_COMMAND_READ) + (KEYBOARD_COMMAND_WRITE, KEYBOARD_COMMAND_REBOOT) + (KEYBOARD_SCANCODE_SET1, KEYBOARD_ISMAKE, KEYBOARD_ISREADY) + (KEYBOARD_SCANCODE, OLPC_UP, OLPC_DOWN, OLPC_LEFT, OLPC_RIGHT): Move + from here ... + * include/grub/i386/at_keyboard.h: ... to here. + 2008-08-05 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/pit.c'. diff --git a/DISTLIST b/DISTLIST index 649cb9085..e98d0f658 100644 --- a/DISTLIST +++ b/DISTLIST @@ -124,6 +124,7 @@ include/grub/gpt_partition.h include/grub/gzio.h include/grub/hexdump.h include/grub/hfs.h +include/grub/i386/at_keyboard.h include/grub/i386/coreboot/boot.h include/grub/i386/coreboot/console.h include/grub/i386/coreboot/init.h @@ -135,6 +136,7 @@ include/grub/i386/coreboot/time.h include/grub/i386/efi/kernel.h include/grub/i386/efi/loader.h include/grub/i386/efi/time.h +include/grub/i386/halt.h include/grub/i386/ieee1275/loader.h include/grub/i386/ieee1275/machine.h include/grub/i386/ieee1275/memory.h @@ -160,6 +162,7 @@ include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeutil.h include/grub/i386/pc/vga.h include/grub/i386/pit.h +include/grub/i386/reboot.h include/grub/i386/setjmp.h include/grub/i386/time.h include/grub/i386/types.h @@ -234,6 +237,7 @@ kern/fs.c kern/i386/dl.c kern/i386/efi/init.c kern/i386/efi/startup.S +kern/i386/halt.c kern/i386/linuxbios/init.c kern/i386/linuxbios/startup.S kern/i386/linuxbios/table.c @@ -243,6 +247,7 @@ kern/i386/pc/lzo1x.S kern/i386/pc/startup.S kern/i386/pit.c kern/i386/realmode.S +kern/i386/reboot.c kern/ieee1275/cmain.c kern/ieee1275/ieee1275.c kern/ieee1275/init.c diff --git a/commands/halt.c b/commands/halt.c index 65da1ea0a..c12c9d238 100644 --- a/commands/halt.c +++ b/commands/halt.c @@ -25,6 +25,9 @@ #include #elif defined(GRUB_MACHINE_EFI) #include +#else +/* Platforms shipping standalone halt, such as coreboot. */ +#include #endif static grub_err_t diff --git a/commands/reboot.c b/commands/reboot.c index c668b36bd..bff7a57ec 100644 --- a/commands/reboot.c +++ b/commands/reboot.c @@ -27,6 +27,9 @@ #include #elif defined(GRUB_MACHINE_PCBIOS) #include +#else +/* Platforms shipping standalone reboot, such as coreboot. */ +#include #endif diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index cff6cebad..6f68a0e51 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -19,15 +19,18 @@ kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/time.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ + kern/i386/tsc.c kern/i386/pit.c \ + kern/generic/rtc_get_time_ms.c \ + kern/generic/millisleep.c \ kern/env.c \ term/i386/pc/console.c \ term/i386/pc/at_keyboard.c term/i386/pc/vga_text.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_linuxbios_startup.d kernel_elf-kern_i386_linuxbios_init.d kernel_elf-kern_i386_linuxbios_table.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_linuxbios_startup.d kernel_elf-kern_i386_linuxbios_init.d kernel_elf-kern_i386_linuxbios_table.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_linuxbios_startup.o: kern/i386/linuxbios/startup.S $(kern/i386/linuxbios/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -105,6 +108,22 @@ kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_partition.d +kernel_elf-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_i386_tsc.d + +kernel_elf-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_i386_pit.d + +kernel_elf-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_generic_rtc_get_time_ms.d + +kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_generic_millisleep.d + kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d @@ -561,7 +580,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ play.mod cpuid.mod serial.mod ata.mod \ - memdisk.mod pci.mod lspci.mod + memdisk.mod pci.mod lspci.mod reboot.mod \ + halt.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -1005,6 +1025,158 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For reboot.mod. +reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c +CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o reboot_mod-kern_i386_reboot.o und-reboot.lst +ifneq ($(reboot_mod_EXPORTS),no) +CLEANFILES += def-reboot.lst +DEFSYMFILES += def-reboot.lst +endif +MOSTLYCLEANFILES += reboot_mod-commands_reboot.d reboot_mod-kern_i386_reboot.d +UNDSYMFILES += und-reboot.lst + +reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o reboot_mod-kern_i386_reboot.o + -rm -f $@ + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o reboot_mod-kern_i386_reboot.o + +mod-reboot.o: mod-reboot.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< + +mod-reboot.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(reboot_mod_EXPORTS),no) +def-reboot.lst: pre-reboot.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ +endif + +und-reboot.lst: pre-reboot.o + echo 'reboot' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-commands_reboot.d + +CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst +COMMANDFILES += cmd-reboot_mod-commands_reboot.lst +FSFILES += fs-reboot_mod-commands_reboot.lst +PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst + +cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + +fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + +partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + + +reboot_mod-kern_i386_reboot.o: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< +-include reboot_mod-kern_i386_reboot.d + +CLEANFILES += cmd-reboot_mod-kern_i386_reboot.lst fs-reboot_mod-kern_i386_reboot.lst partmap-reboot_mod-kern_i386_reboot.lst +COMMANDFILES += cmd-reboot_mod-kern_i386_reboot.lst +FSFILES += fs-reboot_mod-kern_i386_reboot.lst +PARTMAPFILES += partmap-reboot_mod-kern_i386_reboot.lst + +cmd-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + +fs-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + +partmap-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + + +reboot_mod_CFLAGS = $(COMMON_CFLAGS) +reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For halt.mod. +halt_mod_SOURCES = commands/halt.c kern/i386/halt.c +CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o halt_mod-kern_i386_halt.o und-halt.lst +ifneq ($(halt_mod_EXPORTS),no) +CLEANFILES += def-halt.lst +DEFSYMFILES += def-halt.lst +endif +MOSTLYCLEANFILES += halt_mod-commands_halt.d halt_mod-kern_i386_halt.d +UNDSYMFILES += und-halt.lst + +halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o halt_mod-kern_i386_halt.o + -rm -f $@ + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o halt_mod-kern_i386_halt.o + +mod-halt.o: mod-halt.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< + +mod-halt.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(halt_mod_EXPORTS),no) +def-halt.lst: pre-halt.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ +endif + +und-halt.lst: pre-halt.o + echo 'halt' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< +-include halt_mod-commands_halt.d + +CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst +COMMANDFILES += cmd-halt_mod-commands_halt.lst +FSFILES += fs-halt_mod-commands_halt.lst +PARTMAPFILES += partmap-halt_mod-commands_halt.lst + +cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + +fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + +partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + + +halt_mod-kern_i386_halt.o: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< +-include halt_mod-kern_i386_halt.d + +CLEANFILES += cmd-halt_mod-kern_i386_halt.lst fs-halt_mod-kern_i386_halt.lst partmap-halt_mod-kern_i386_halt.lst +COMMANDFILES += cmd-halt_mod-kern_i386_halt.lst +FSFILES += fs-halt_mod-kern_i386_halt.lst +PARTMAPFILES += partmap-halt_mod-kern_i386_halt.lst + +cmd-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + +fs-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + +partmap-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + + +halt_mod_CFLAGS = $(COMMON_CFLAGS) +halt_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For serial.mod. serial_mod_SOURCES = term/i386/pc/serial.c CLEANFILES += serial.mod mod-serial.o mod-serial.c pre-serial.o serial_mod-term_i386_pc_serial.o und-serial.lst diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 5535dab7a..5aee1f8c2 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -99,7 +99,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ play.mod cpuid.mod serial.mod ata.mod \ - memdisk.mod pci.mod lspci.mod + memdisk.mod pci.mod lspci.mod reboot.mod \ + halt.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -121,6 +122,16 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For reboot.mod. +reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c +reboot_mod_CFLAGS = $(COMMON_CFLAGS) +reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For halt.mod. +halt_mod_SOURCES = commands/halt.c kern/i386/halt.c +halt_mod_CFLAGS = $(COMMON_CFLAGS) +halt_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For serial.mod. serial_mod_SOURCES = term/i386/pc/serial.c serial_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 26d546ec1..f971828d4 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -128,15 +128,15 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ - kern/i386/tsc.c \ + kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d +MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -145,9 +145,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -639,6 +639,25 @@ partmap-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDEN set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_i386_pit.d + +CLEANFILES += cmd-kernel_mod-kern_i386_pit.lst fs-kernel_mod-kern_i386_pit.lst partmap-kernel_mod-kern_i386_pit.lst +COMMANDFILES += cmd-kernel_mod-kern_i386_pit.lst +FSFILES += fs-kernel_mod-kern_i386_pit.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_pit.lst + +cmd-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_generic_rtc_get_time_ms.d diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index edbf0cf8f..8a5d53a21 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -110,19 +110,19 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/time.c \ kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ - kern/i386/tsc.c \ + kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ term/i386/pc/console.c \ symlist.c -CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o -MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d +CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o +MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d kernel.img: kernel.exec $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ -kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o +kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) @@ -201,6 +201,10 @@ kernel_img-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_tsc.d +kernel_img-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_i386_pit.d + kernel_img-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_generic_rtc_get_time_ms.d diff --git a/include/grub/i386/at_keyboard.h b/include/grub/i386/at_keyboard.h new file mode 100644 index 000000000..5c15ef344 --- /dev/null +++ b/include/grub/i386/at_keyboard.h @@ -0,0 +1,57 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CPU_AT_KEYBOARD_HEADER +#define GRUB_CPU_AT_KEYBOARD_HEADER 1 + +#include + +#define SHIFT_L 0x2a +#define SHIFT_R 0x36 +#define CTRL 0x1d +#define ALT 0x38 +#define CAPS_LOCK 0x3a + +#define KEYBOARD_REG_DATA 0x60 +#define KEYBOARD_REG_STATUS 0x64 + +/* Used for sending commands to the controller. */ +#define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02) +#define KEYBOARD_COMMAND_READ 0x20 +#define KEYBOARD_COMMAND_WRITE 0x60 +#define KEYBOARD_COMMAND_REBOOT 0xfe + +#define KEYBOARD_SCANCODE_SET1 0x40 + +#define KEYBOARD_ISMAKE(x) !((x) & 0x80) +#define KEYBOARD_ISREADY(x) (((x) & 0x01) == 0) +#define KEYBOARD_SCANCODE(x) ((x) & 0x7f) + +#ifdef GRUB_MACHINE_IEEE1275 +#define OLPC_UP GRUB_TERM_UP +#define OLPC_DOWN GRUB_TERM_DOWN +#define OLPC_LEFT GRUB_TERM_LEFT +#define OLPC_RIGHT GRUB_TERM_RIGHT +#else +#define OLPC_UP '\0' +#define OLPC_DOWN '\0' +#define OLPC_LEFT '\0' +#define OLPC_RIGHT '\0' +#endif + +#endif diff --git a/include/grub/i386/halt.h b/include/grub/i386/halt.h new file mode 100644 index 000000000..1c403a7d5 --- /dev/null +++ b/include/grub/i386/halt.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +extern void grub_halt (void); diff --git a/include/grub/i386/reboot.h b/include/grub/i386/reboot.h new file mode 100644 index 000000000..5bcbb5d64 --- /dev/null +++ b/include/grub/i386/reboot.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +extern void grub_reboot (void); diff --git a/kern/i386/halt.c b/kern/i386/halt.c new file mode 100644 index 000000000..3895ae113 --- /dev/null +++ b/kern/i386/halt.c @@ -0,0 +1,42 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +const char bochs_shutdown[] = "Shutdown"; + +void +grub_halt (void) +{ + int i; + + /* Disable interrupts. */ + __asm__ __volatile__ ("cli"); + + /* Bochs, QEMU, etc. */ + for (i = 0; i < sizeof (bochs_shutdown) - 1; i++) + grub_outb (bochs_shutdown[i], 0x8900); + + grub_printf ("GRUB doesn't know how to halt this machine yet!\n"); + + /* In order to return we'd have to check what the previous status of IF + flag was. But user most likely doesn't want to return anyway ... */ + grub_stop (); +} diff --git a/kern/i386/reboot.c b/kern/i386/reboot.c new file mode 100644 index 000000000..d2b0060bb --- /dev/null +++ b/kern/i386/reboot.c @@ -0,0 +1,31 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +void +grub_reboot (void) +{ + /* Use the keyboard controller to reboot. That's what keyboards were + designed for, isn't it? */ + grub_outb (KEYBOARD_COMMAND_REBOOT, KEYBOARD_REG_STATUS); + + grub_printf ("GRUB doesn't know how to reboot this machine yet!\n"); +} diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index b62cd6678..c9bbd836c 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -17,16 +17,12 @@ */ #include -#include +#include #include #include #include -#define SHIFT_L 0x2a -#define SHIFT_R 0x36 -#define CTRL 0x1d -#define ALT 0x38 -#define CAPS_LOCK 0x3a +static short at_keyboard_status = 0; #define KEYBOARD_STATUS_SHIFT_L (1 << 0) #define KEYBOARD_STATUS_SHIFT_R (1 << 1) @@ -36,34 +32,6 @@ #define KEYBOARD_STATUS_CTRL_R (1 << 5) #define KEYBOARD_STATUS_CAPS_LOCK (1 << 6) -#define KEYBOARD_REG_DATA 0x60 -#define KEYBOARD_REG_STATUS 0x64 - -/* Used for sending commands to the controller. */ -#define KEYBOARD_COMMAND_ISREADY(x) !((x) & 0x02) -#define KEYBOARD_COMMAND_READ 0x20 -#define KEYBOARD_COMMAND_WRITE 0x60 - -#define KEYBOARD_SCANCODE_SET1 0x40 - -#define KEYBOARD_ISMAKE(x) !((x) & 0x80) -#define KEYBOARD_ISREADY(x) (((x) & 0x01) == 0) -#define KEYBOARD_SCANCODE(x) ((x) & 0x7f) - -static short at_keyboard_status = 0; - -#ifdef GRUB_MACHINE_IEEE1275 -#define OLPC_UP GRUB_TERM_UP -#define OLPC_DOWN GRUB_TERM_DOWN -#define OLPC_LEFT GRUB_TERM_LEFT -#define OLPC_RIGHT GRUB_TERM_RIGHT -#else -#define OLPC_UP '\0' -#define OLPC_DOWN '\0' -#define OLPC_LEFT '\0' -#define OLPC_RIGHT '\0' -#endif - static char keyboard_map[128] = { '\0', GRUB_TERM_ESC, '1', '2', '3', '4', '5', '6', From 9f0234cb9af64d9277eef339bc9f53790373db47 Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 6 Aug 2008 04:05:12 +0000 Subject: [PATCH 0326/1707] 2008-08-06 Bean * fs/i386/pc/pxe.c (curr_file): new variable. (grub_pxefs_open): Simply the handling of pxe file system. Don't require the dummy internal file system anymore. (grub_pxefs_read): Removed. (grub_pxefs_close): Likewise. (grub_pxefs_fs_int): Likewise. (grub_pxefs_read_int): Renamed to grub_pxefs_read. Reinitialize tftp connection when we switch file. (grub_pxefs_close_int): Renamed to grub_pxefs_close. --- ChangeLog | 14 +++++++++++++- fs/i386/pc/pxe.c | 44 +++++++++----------------------------------- 2 files changed, 22 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b1065fb1..e803ca304 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-08-06 Bean + + * fs/i386/pc/pxe.c (curr_file): new variable. + (grub_pxefs_open): Simply the handling of pxe file system. Don't + require the dummy internal file system anymore. + (grub_pxefs_read): Removed. + (grub_pxefs_close): Likewise. + (grub_pxefs_fs_int): Likewise. + (grub_pxefs_read_int): Renamed to grub_pxefs_read. Reinitialize tftp + connection when we switch file. + (grub_pxefs_close_int): Renamed to grub_pxefs_close. + 2008-08-06 Robert Millan * conf/i386-coreboot.rmk (pkglib_MODULES): Add `reboot.mod' and @@ -63,7 +75,7 @@ * commands/i386/pc/pxecmd.c: New file. - * disk/i386/pc/pxe.c: Likewise. + * fs/i386/pc/pxe.c: Likewise. * include/grub/i386/pc/pxe.h: Likewise. diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index ced1088a5..fb69fb385 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -39,6 +39,8 @@ grub_uint32_t grub_pxe_server_ip; grub_uint32_t grub_pxe_gateway_ip; int grub_pxe_blksize = GRUB_PXE_MIN_BLKSIZE; +static grub_file_t curr_file = 0; + struct grub_pxe_data { grub_uint32_t packet_number; @@ -153,12 +155,9 @@ grub_pxefs_open (struct grub_file *file, const char *name) return grub_errno; } - file_int->data = data; - file_int->offset = 0; - file_int->device = 0; - file_int->size = file->size; - file_int->read_hook = 0; - file_int->fs = &grub_pxefs_fs_int; + file->data = data; + grub_memcpy (file_int, file, sizeof (struct grub_file)); + curr_file = file_int; bufio = grub_bufio_open (file_int, grub_pxe_blksize); if (! bufio) @@ -168,32 +167,13 @@ grub_pxefs_open (struct grub_file *file, const char *name) return grub_errno; } - file->data = bufio; + grub_memcpy (file, bufio, sizeof (struct grub_file)); return GRUB_ERR_NONE; } static grub_ssize_t grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) -{ - grub_file_t bufio; - - bufio = file->data; - bufio->offset = file->offset; - - return bufio->fs->read (bufio, buf, len); -} - -static grub_ssize_t -grub_pxefs_close (grub_file_t file) -{ - grub_file_close ((grub_file_t) file->data); - - return grub_errno; -} - -static grub_ssize_t -grub_pxefs_read_int (grub_file_t file, char *buf, grub_size_t len) { struct grub_pxenv_tftp_read c; struct grub_pxe_data *data; @@ -206,7 +186,7 @@ grub_pxefs_read_int (grub_file_t file, char *buf, grub_size_t len) return grub_error (GRUB_ERR_BAD_FS, "read access must be aligned to packet size"); - if (data->packet_number > pn) + if ((curr_file != file) || (data->packet_number > pn)) { struct grub_pxenv_tftp_open o; @@ -221,6 +201,7 @@ grub_pxefs_read_int (grub_file_t file, char *buf, grub_size_t len) if (o.status) return grub_error (GRUB_ERR_BAD_FS, "open fails"); data->packet_number = 0; + curr_file = file; } c.buffer = SEGOFS (GRUB_MEMORY_MACHINE_SCRATCH_ADDR); @@ -242,7 +223,7 @@ grub_pxefs_read_int (grub_file_t file, char *buf, grub_size_t len) } static grub_err_t -grub_pxefs_close_int (grub_file_t file) +grub_pxefs_close (grub_file_t file) { struct grub_pxenv_tftp_close c; @@ -271,13 +252,6 @@ static struct grub_fs grub_pxefs_fs = .next = 0 }; -static struct grub_fs grub_pxefs_fs_int = - { - .name = "pxefs", - .read = grub_pxefs_read_int, - .close = grub_pxefs_close_int, - }; - static void grub_pxe_detect (void) { From 2b99f1234565442ce9ebfceef48e4f6330f6b701 Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 6 Aug 2008 06:17:14 +0000 Subject: [PATCH 0327/1707] 2008-08-06 Bean * fs/i386/pc/pxe.c (grub_pxe_data): New member block_size. (grub_pxefs_fs_int): Remove dummy definition. (grub_pxefs_open): Use data->block_size to store the current block size setting. (grub_pxefs_read): Use block size stored in data->block_size. As the value of grub_pxe_blksize can be changed after the file is opened. --- ChangeLog | 9 +++++++++ fs/i386/pc/pxe.c | 10 +++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index e803ca304..4f8558938 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-06 Bean + + * fs/i386/pc/pxe.c (grub_pxe_data): New member block_size. + (grub_pxefs_fs_int): Remove dummy definition. + (grub_pxefs_open): Use data->block_size to store the current block + size setting. + (grub_pxefs_read): Use block size stored in data->block_size. As the + value of grub_pxe_blksize can be changed after the file is opened. + 2008-08-06 Bean * fs/i386/pc/pxe.c (curr_file): new variable. diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index fb69fb385..f5f215ff4 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -44,6 +44,7 @@ static grub_file_t curr_file = 0; struct grub_pxe_data { grub_uint32_t packet_number; + grub_uint32_t block_size; char filename[0]; }; @@ -113,8 +114,6 @@ grub_pxefs_dir (grub_device_t device __attribute((unused)), return GRUB_ERR_NONE; } -static struct grub_fs grub_pxefs_fs_int; - static grub_err_t grub_pxefs_open (struct grub_file *file, const char *name) { @@ -146,6 +145,7 @@ grub_pxefs_open (struct grub_file *file, const char *name) return grub_errno; data->packet_number = 0; + data->block_size = grub_pxe_blksize; grub_strcpy (data->filename, name); file_int = grub_malloc (sizeof (*file_int)); @@ -159,7 +159,7 @@ grub_pxefs_open (struct grub_file *file, const char *name) grub_memcpy (file_int, file, sizeof (struct grub_file)); curr_file = file_int; - bufio = grub_bufio_open (file_int, grub_pxe_blksize); + bufio = grub_bufio_open (file_int, data->block_size); if (! bufio) { grub_free (file_int); @@ -181,7 +181,7 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) data = file->data; - pn = grub_divmod64 (file->offset, grub_pxe_blksize, &r); + pn = grub_divmod64 (file->offset, data->block_size, &r); if (r) return grub_error (GRUB_ERR_BAD_FS, "read access must be aligned to packet size"); @@ -196,7 +196,7 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) o.gateway_ip = grub_pxe_gateway_ip; grub_strcpy (o.filename, data->filename); o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT); - o.packet_size = grub_pxe_blksize; + o.packet_size = data->block_size; grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o); if (o.status) return grub_error (GRUB_ERR_BAD_FS, "open fails"); From 057bc4acaffc722fabe9d060782e85caed9aadc9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 6 Aug 2008 12:27:28 +0000 Subject: [PATCH 0328/1707] 2008-08-06 Robert Millan * conf/i386-coreboot.rmk (kernel_elf_ASFLAGS): New variable. * kern/i386/tsc.c: Include `'. --- ChangeLog | 5 +++++ conf/i386-coreboot.mk | 1 + conf/i386-coreboot.rmk | 1 + kern/i386/tsc.c | 1 + 4 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4f8558938..156a167e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-06 Robert Millan + + * conf/i386-coreboot.rmk (kernel_elf_ASFLAGS): New variable. + * kern/i386/tsc.c: Include `'. + 2008-08-06 Bean * fs/i386/pc/pxe.c (grub_pxe_data): New member block_size. diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 6f68a0e51..f766b9f4b 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -150,6 +150,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) +kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic MOSTLYCLEANFILES += symlist.c kernel_syms.lst diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 5aee1f8c2..4827c0f81 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -31,6 +31,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) +kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic MOSTLYCLEANFILES += symlist.c kernel_syms.lst diff --git a/kern/i386/tsc.c b/kern/i386/tsc.c index 458fc0ec9..4d3f05a26 100644 --- a/kern/i386/tsc.c +++ b/kern/i386/tsc.c @@ -24,6 +24,7 @@ #include #include #include +#include /* This defines the value TSC had at the epoch (that is, when we calibrated it). */ static grub_uint64_t tsc_boot_time; From 337f5a1e9345170fdca339c7bc01406c5aa82746 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 6 Aug 2008 13:28:28 +0000 Subject: [PATCH 0329/1707] 2008-08-06 Pavel Roskin * kern/i386/pit.c: Include `'. --- ChangeLog | 8 ++++++-- kern/i386/pit.c | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 156a167e5..117dcf16e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-06 Pavel Roskin + + * kern/i386/pit.c: Include `'. + 2008-08-06 Robert Millan * conf/i386-coreboot.rmk (kernel_elf_ASFLAGS): New variable. @@ -110,7 +114,7 @@ (grub_ncurses_term): New member grub_ncurses_getcolor. 2008-08-05 Colin D Bennett - + High resolution timer support. Implemented for x86 CPUs using TSC. Extracted generic grub_millisleep() so it's linked in only as needed. This requires a Pentium compatible CPU; if the RDTSC instruction is @@ -139,7 +143,7 @@ * kern/generic/rtc_get_time_ms.c: New file. * kern/generic/millisleep.c: New file. - + * kern/misc.c: Don't include anymore. (grub_millisleep_generic): Removed. diff --git a/kern/i386/pit.c b/kern/i386/pit.c index 0dbbf1cd0..d0a6eda7d 100644 --- a/kern/i386/pit.c +++ b/kern/i386/pit.c @@ -18,6 +18,7 @@ #include #include +#include #define TIMER2_REG_CONTROL 0x42 #define TIMER_REG_COMMAND 0x43 From 35eafe238f6885040e891f1d46f15d4dcbec0d8d Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 6 Aug 2008 13:42:02 +0000 Subject: [PATCH 0330/1707] Remove executable flag From 1cbb58ac6274c3fedde6914a4319a8f13f903ffb Mon Sep 17 00:00:00 2001 From: chrfranke Date: Wed, 6 Aug 2008 18:45:51 +0000 Subject: [PATCH 0331/1707] 2008-08-06 Christian Franke * conf/common.rmk: Build and install `10_windows'. * util/grub.d/10_windows.in: New script. --- .cvsignore | 1 + ChangeLog | 5 +++ conf/common.mk | 2 +- conf/common.rmk | 2 +- util/grub.d/10_windows.in | 83 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 91 insertions(+), 2 deletions(-) create mode 100644 util/grub.d/10_windows.in diff --git a/.cvsignore b/.cvsignore index 0742a73af..fdb992098 100644 --- a/.cvsignore +++ b/.cvsignore @@ -7,6 +7,7 @@ 00_header 10_hurd 10_linux +10_windows 30_os-prober 40_custom Makefile diff --git a/ChangeLog b/ChangeLog index 117dcf16e..d230805f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-06 Christian Franke + + * conf/common.rmk: Build and install `10_windows'. + * util/grub.d/10_windows.in: New script. + 2008-08-06 Pavel Roskin * kern/i386/pit.c: Include `'. diff --git a/conf/common.mk b/conf/common.mk index 4a8b72cff..e287542d4 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -493,7 +493,7 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +update-grub_SCRIPTS = 00_header 10_linux 10_hurd 10_windows 30_os-prober 40_custom CLEANFILES += $(update-grub_SCRIPTS) update-grub_DATA += util/grub.d/README diff --git a/conf/common.rmk b/conf/common.rmk index 3d3cd8aec..3d674a68c 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -120,7 +120,7 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +update-grub_SCRIPTS = 00_header 10_linux 10_hurd 10_windows 30_os-prober 40_custom CLEANFILES += $(update-grub_SCRIPTS) update-grub_DATA += util/grub.d/README diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in new file mode 100644 index 000000000..e8f3c3e14 --- /dev/null +++ b/util/grub.d/10_windows.in @@ -0,0 +1,83 @@ +#! /bin/sh -e + +# update-grub helper script. +# Copyright (C) 2008 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +. ${libdir}/grub/update-grub_lib + +case "`uname 2>/dev/null`" in + CYGWIN*) ;; + *) exit 0 ;; +esac + +# Try C: even if current system is on other partition. +case "$SYSTEMDRIVE" in + [Cc]:) dirlist="C:" ;; + [D-Zd-z]:) dirlist="C: $SYSTEMDRIVE" ;; + *) exit 0 ;; +esac + +get_os_name_from_boot_ini () +{ + # Fail if no or more than one partition. + test "`sed -n 's,^\(\(multi\|scsi\)[^=]*\)=.*$,\1,p' "$1" 2>/dev/null | \ + sort | uniq | wc -l`" = 1 || return 1 + + # Search 'default=PARTITION' + local part=`sed -n 's,^default=,,p' "$1" | sed 's,\\\\,/,g;s,[ \t\r]*$,,;1q'` + test -n "$part" || return 1 + + # Search 'PARTITION="NAME" ...' + local name=`sed -n 's,\\\\,/,g;s,^'"$part"'="\([^"]*\)".*$,\1,p' "$1" | sed 1q` + test -n "$name" || return 1 + + echo "$name" +} + + +for dir in $dirlist ; do + + # Check for Vista bootmgr. + if [ -f "$dir"/bootmgr -a -f "$dir"/boot/bcd ] ; then + OS="Windows Vista bootmgr" + + # Check for NTLDR. + elif [ -f "$dir"/ntldr -a -f "$dir"/ntdetect.com -a -f "$dir"/boot.ini ] ; then + OS=`get_os_name_from_boot_ini "$dir"/boot.ini` || OS="Windows NT/2000/XP loader" + + else + continue + fi + + # Get boot /dev/ice. + dev=`${grub_probe} -t device "$dir" 2>/dev/null` || continue + + echo "Found $OS on $dir ($dev)" >&2 + cat << EOF +menuentry "$OS" { +EOF + + prepare_grub_to_access_device "$dev" | sed 's,^,\t,' + + cat << EOF + chainloader +1 +} +EOF +done + From 16106770b391f4320eda31697af51a8cce0c33f6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 7 Aug 2008 10:49:06 +0000 Subject: [PATCH 0332/1707] Add 10_windows.in to DISTLIST. --- DISTLIST | 1 + 1 file changed, 1 insertion(+) diff --git a/DISTLIST b/DISTLIST index e98d0f658..5116daa3f 100644 --- a/DISTLIST +++ b/DISTLIST @@ -333,6 +333,7 @@ util/getroot.c util/grub.d/00_header.in util/grub.d/10_hurd.in util/grub.d/10_linux.in +util/grub.d/10_windows.in util/grub.d/30_os-prober.in util/grub.d/40_custom.in util/grub.d/README From e383b3d0c82c664ee479d0b4203b4754b616a722 Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 7 Aug 2008 11:58:55 +0000 Subject: [PATCH 0333/1707] 2008-08-07 Bean * conf/i386-efi.rmk (kernel_mod_SOURCES): Add kern/time.c. * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Add kern/time.c, * include/grub/i386/pit.h: Use macro KERNEL_CPU_PIT_HEADER to avoid multiple inclusion. Add #include . --- ChangeLog | 9 +++++++++ conf/i386-efi.mk | 28 ++++++++++++++++++++++++---- conf/i386-efi.rmk | 1 + conf/i386-ieee1275.mk | 13 +++++++++---- conf/i386-ieee1275.rmk | 1 + include/grub/i386/pit.h | 7 +++++++ 6 files changed, 51 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index d230805f0..4a4ccf01f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-07 Bean + + * conf/i386-efi.rmk (kernel_mod_SOURCES): Add kern/time.c. + + * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Add kern/time.c, + + * include/grub/i386/pit.h: Use macro KERNEL_CPU_PIT_HEADER to avoid + multiple inclusion. Add #include . + 2008-08-06 Christian Franke * conf/common.rmk: Build and install `10_windows'. diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index f971828d4..78992a4ac 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -128,15 +128,16 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ + kern/time.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d +MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_time.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -145,9 +146,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -620,6 +621,25 @@ partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_time.d + +CLEANFILES += cmd-kernel_mod-kern_time.lst fs-kernel_mod-kern_time.lst partmap-kernel_mod-kern_time.lst +COMMANDFILES += cmd-kernel_mod-kern_time.lst +FSFILES += fs-kernel_mod-kern_time.lst +PARTMAPFILES += partmap-kernel_mod-kern_time.lst + +cmd-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_tsc.d diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index a3234b596..2ce21b195 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -85,6 +85,7 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ + kern/time.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 0389f424b..d8b17bf60 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -20,16 +20,17 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ + kern/time.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c term/i386/pc/at_keyboard.c \ disk/ieee1275/ofdisk.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -115,6 +116,10 @@ kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d +kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_time.d + kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_generic_millisleep.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 818dc9191..a93845efb 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -19,6 +19,7 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ + kern/time.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c term/i386/pc/at_keyboard.c \ diff --git a/include/grub/i386/pit.h b/include/grub/i386/pit.h index 7ac0256a2..0da271dfa 100644 --- a/include/grub/i386/pit.h +++ b/include/grub/i386/pit.h @@ -16,4 +16,11 @@ * along with GRUB. If not, see . */ +#ifndef KERNEL_CPU_PIT_HEADER +#define KERNEL_CPU_PIT_HEADER 1 + +#include + extern void grub_pit_wait (grub_uint16_t tics); + +#endif /* ! KERNEL_CPU_PIT_HEADER */ From 1a6cac8921d426230cc2e00dbfaad1cb583f36cb Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 7 Aug 2008 14:34:19 +0000 Subject: [PATCH 0334/1707] Migrate .cvsignore to svn:ignore property --- .cvsignore | 39 --------------------------------------- 1 file changed, 39 deletions(-) delete mode 100644 .cvsignore diff --git a/.cvsignore b/.cvsignore deleted file mode 100644 index fdb992098..000000000 --- a/.cvsignore +++ /dev/null @@ -1,39 +0,0 @@ -*.d -*.exec -*.img -*.lst -*.mod -*.elf -00_header -10_hurd -10_linux -10_windows -30_os-prober -40_custom -Makefile -autom4te.cache -config.cache -config.h -config.log -config.status -genkernsyms.sh -gensymlist.sh -grub-install -grub-mkdevicemap -grub-mkimage -grub-mkrescue -grub-pe2elf -grub-probe -grub-setup -grub_probe_init.c -grub_probe_init.h -grub_script.tab.c -grub_script.tab.h -grub_setup_init.c -grub_setup_init.h -mod-*.c -stamp-h -stamp-h1 -symlist.c -update-grub -update-grub_lib From 5ebc275d6f643e17646f818bcf9fe887dc75cf22 Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 7 Aug 2008 19:21:25 +0000 Subject: [PATCH 0335/1707] 2008-08-07 Bean * conf/x86_64-efi.rmk (kernel_mod_SOURCES): Add kern/time.c, kern/i386/tsc.c and kern/i386/pit.c. * include/grub/i386/tsc.h (grub_cpu_is_cpuid_supported): Handle x86_64 platform. * kern/i386/efi/init.c: Replace with . * kern/i386/pit.c: Replace with . --- ChangeLog | 13 ++++++++ conf/x86_64-efi.mk | 67 ++++++++++++++++++++++++++++++++++++++--- conf/x86_64-efi.rmk | 2 ++ include/grub/i386/tsc.h | 27 +++++++++++++++++ kern/i386/efi/init.c | 2 +- kern/i386/pit.c | 2 +- 6 files changed, 107 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a4ccf01f..334b1d8c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-08-07 Bean + + * conf/x86_64-efi.rmk (kernel_mod_SOURCES): Add kern/time.c, + kern/i386/tsc.c and kern/i386/pit.c. + + * include/grub/i386/tsc.h (grub_cpu_is_cpuid_supported): Handle + x86_64 platform. + + * kern/i386/efi/init.c: Replace with + . + + * kern/i386/pit.c: Replace with . + 2008-08-07 Bean * conf/i386-efi.rmk (kernel_mod_SOURCES): Add kern/time.c. diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 8f25993fb..bb9feaa8e 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -112,14 +112,16 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ + kern/time.c \ + kern/i386/tsc.c kern/i386/pit.c \ kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d +MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_time.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -128,9 +130,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -584,6 +586,63 @@ partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_time.d + +CLEANFILES += cmd-kernel_mod-kern_time.lst fs-kernel_mod-kern_time.lst partmap-kernel_mod-kern_time.lst +COMMANDFILES += cmd-kernel_mod-kern_time.lst +FSFILES += fs-kernel_mod-kern_time.lst +PARTMAPFILES += partmap-kernel_mod-kern_time.lst + +cmd-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_i386_tsc.d + +CLEANFILES += cmd-kernel_mod-kern_i386_tsc.lst fs-kernel_mod-kern_i386_tsc.lst partmap-kernel_mod-kern_i386_tsc.lst +COMMANDFILES += cmd-kernel_mod-kern_i386_tsc.lst +FSFILES += fs-kernel_mod-kern_i386_tsc.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_tsc.lst + +cmd-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_i386_pit.d + +CLEANFILES += cmd-kernel_mod-kern_i386_pit.lst fs-kernel_mod-kern_i386_pit.lst partmap-kernel_mod-kern_i386_pit.lst +COMMANDFILES += cmd-kernel_mod-kern_i386_pit.lst +FSFILES += fs-kernel_mod-kern_i386_pit.lst +PARTMAPFILES += partmap-kernel_mod-kern_i386_pit.lst + +cmd-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_generic_millisleep.d diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 25dc8eb22..4f8abba99 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -87,6 +87,8 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ + kern/time.c \ + kern/i386/tsc.c kern/i386/pit.c \ kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ diff --git a/include/grub/i386/tsc.h b/include/grub/i386/tsc.h index 63ec69df5..963370113 100644 --- a/include/grub/i386/tsc.h +++ b/include/grub/i386/tsc.h @@ -38,6 +38,31 @@ grub_get_tsc (void) return (((grub_uint64_t) hi) << 32) | lo; } +#ifdef __x86_64__ + +static __inline int +grub_cpu_is_cpuid_supported (void) +{ + grub_uint64_t id_supported; + + __asm__ ("pushfq\n\t" + "popq %%rax /* Get EFLAGS into EAX */\n\t" + "movq %%rax, %%rcx /* Save original flags in ECX */\n\t" + "xorq $0x200000, %%rax /* Flip ID bit in EFLAGS */\n\t" + "pushq %%rax /* Store modified EFLAGS on stack */\n\t" + "popfq /* Replace current EFLAGS */\n\t" + "pushfq /* Read back the EFLAGS */\n\t" + "popq %%rax /* Get EFLAGS into EAX */\n\t" + "xorq %%rcx, %%rax /* Check if flag could be modified */\n\t" + : "=a" (id_supported) + : /* No inputs. */ + : /* Clobbered: */ "%rcx"); + + return id_supported != 0; +} + +#else + static __inline int grub_cpu_is_cpuid_supported (void) { @@ -59,6 +84,8 @@ grub_cpu_is_cpuid_supported (void) return id_supported != 0; } +#endif + static __inline int grub_cpu_is_tsc_supported (void) { diff --git a/kern/i386/efi/init.c b/kern/i386/efi/init.c index e9cc07078..e1950d758 100644 --- a/kern/i386/efi/init.c +++ b/kern/i386/efi/init.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include void grub_machine_init (void) diff --git a/kern/i386/pit.c b/kern/i386/pit.c index d0a6eda7d..fad521b1a 100644 --- a/kern/i386/pit.c +++ b/kern/i386/pit.c @@ -17,7 +17,7 @@ */ #include -#include +#include #include #define TIMER2_REG_CONTROL 0x42 From 5c41d44d7d348701f445bb074d86562d12c6ca79 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Thu, 7 Aug 2008 19:43:36 +0000 Subject: [PATCH 0336/1707] 2008-08-07 Christian Franke * kern/i386/pit.c (TIMER2_SPEAKER): New define. (TIMER2_GATE): Likewise. (grub_pit_wait): Add enable/disable of the timer2 gate bit of port 0x61. This fixes a possible infinite loop. --- ChangeLog | 7 +++++++ kern/i386/pit.c | 16 ++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 334b1d8c4..1237565be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-07 Christian Franke + + * kern/i386/pit.c (TIMER2_SPEAKER): New define. + (TIMER2_GATE): Likewise. + (grub_pit_wait): Add enable/disable of the timer2 gate + bit of port 0x61. This fixes a possible infinite loop. + 2008-08-07 Bean * conf/x86_64-efi.rmk (kernel_mod_SOURCES): Add kern/time.c, diff --git a/kern/i386/pit.c b/kern/i386/pit.c index fad521b1a..82a17d3e0 100644 --- a/kern/i386/pit.c +++ b/kern/i386/pit.c @@ -28,13 +28,29 @@ #define TIMER_ENABLE_LSB 0x20 #define TIMER_ENABLE_MSB 0x10 #define TIMER2_LATCH 0x20 +#define TIMER2_SPEAKER 0x02 +#define TIMER2_GATE 0x01 void grub_pit_wait (grub_uint16_t tics) { + /* Disable timer2 gate and speaker. */ + grub_outb (grub_inb (TIMER2_REG_LATCH) & ~ (TIMER2_SPEAKER | TIMER2_GATE), + TIMER2_REG_LATCH); + + /* Set tics. */ grub_outb (TIMER2_SELECT | TIMER_ENABLE_LSB | TIMER_ENABLE_MSB, TIMER_REG_COMMAND); grub_outb (tics & 0xff, TIMER2_REG_CONTROL); grub_outb (tics >> 8, TIMER2_REG_CONTROL); + /* Enable timer2 gate, keep speaker disabled. */ + grub_outb ((grub_inb (TIMER2_REG_LATCH) & ~ TIMER2_SPEAKER) | TIMER2_GATE, + TIMER2_REG_LATCH); + + /* Wait. */ while ((grub_inb (TIMER2_REG_LATCH) & TIMER2_LATCH) == 0x00); + + /* Disable timer2 gate and speaker. */ + grub_outb (grub_inb (TIMER2_REG_LATCH) & ~ (TIMER2_SPEAKER | TIMER2_GATE), + TIMER2_REG_LATCH); } From 819ce6c0a9d54754c39be6c9819b8bcd15cd436a Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 7 Aug 2008 20:16:59 +0000 Subject: [PATCH 0337/1707] 2008-08-07 Bean * include/grub/x86_64/pci.h: New file. --- ChangeLog | 4 ++++ include/grub/x86_64/pci.h | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 include/grub/x86_64/pci.h diff --git a/ChangeLog b/ChangeLog index 1237565be..06543e76a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-07 Bean + + * include/grub/x86_64/pci.h: New file. + 2008-08-07 Christian Franke * kern/i386/pit.c (TIMER2_SPEAKER): New define. diff --git a/include/grub/x86_64/pci.h b/include/grub/x86_64/pci.h new file mode 100644 index 000000000..91a9924fc --- /dev/null +++ b/include/grub/x86_64/pci.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include From 1fbc5e66817338035e4a6bc8e6048fc9ff85e188 Mon Sep 17 00:00:00 2001 From: marco_g Date: Thu, 7 Aug 2008 22:43:03 +0000 Subject: [PATCH 0338/1707] 2008-08-08 Marco Gerards * NEWS: Update. --- ChangeLog | 4 ++++ NEWS | 44 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 48 insertions(+) diff --git a/ChangeLog b/ChangeLog index 06543e76a..7599c0f6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-08 Marco Gerards + + * NEWS: Update. + 2008-08-07 Bean * include/grub/x86_64/pci.h: New file. diff --git a/NEWS b/NEWS index f0edaada4..f243052a2 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,47 @@ +New in 1.97 - : + +* When booting from PXE, PXE can be used to load files. + +* High resolution timer support. + +* Image loaders now support IO buffering. + +* Add `crc' command. + +* Add grub-pe2elf to convert PE modules to ELF modules. + +* Add x86_64 EFI support. + +* Add support for LZMA compression. + +* Support for saving the environment from and loading the environment + from a file. + +* Allow the UUID to be used as device name. + +* The `search' command can use UUIDs now. + +* Add support for IEEE 1275 on i386. + +* Create partmap.lst and use it to automatically load partition map + modules. + +* Add os-prober that can add operating systems to the boot menu. + +* The ATA driver supports filesystems bigger than 2TB. + +* Add support for the UDF, AFS filesystem. + +* The ISO9660 filesystem supports the Juliet extension + +* Add aout and BSD kernel loaders. + +* Add new command `sleep'. + +* Support for direct access to AT keyboards. + +* New utility `grub-fstest'. + New in 1.96 - 2008-02-03: * The license term is changed to GNU General Public License Version 3. From 2fc96ba33861e6f50a195c0b79b1fc41814693ec Mon Sep 17 00:00:00 2001 From: marco_g Date: Thu, 7 Aug 2008 22:55:50 +0000 Subject: [PATCH 0339/1707] Some fixes to the last commit --- NEWS | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index f243052a2..7914be92f 100644 --- a/NEWS +++ b/NEWS @@ -30,9 +30,9 @@ New in 1.97 - : * The ATA driver supports filesystems bigger than 2TB. -* Add support for the UDF, AFS filesystem. +* Add support for the UDF, AFS and EXT4 filesystems. -* The ISO9660 filesystem supports the Juliet extension +* The ISO9660 filesystem supports the Joliet extension * Add aout and BSD kernel loaders. From 7f280db5540b3630b9213fbd747de91859eb44a4 Mon Sep 17 00:00:00 2001 From: marco_g Date: Thu, 7 Aug 2008 23:37:33 +0000 Subject: [PATCH 0340/1707] 2008-08-08 Marco Gerards * disk/ata.c (grub_ata_regget): Change return type to `grub_uint8_t'. (grub_ata_regget2): Likewise. (grub_ata_wait_status): New function. (grub_ata_wait_busy): Removed function, updated all users to use `grub_ata_wait_status'. (grub_ata_wait_drq): Likewise. (grub_ata_cmd): New function. (grub_ata_pio_read): Change return type to `grub_uint8_t'. Add error handling. (grub_ata_pio_write): Add error handling. (grub_atapi_identify): Likewise. (grub_atapi_packet): Use `grub_ata_cmd' and improve error handling. (grub_ata_identify): Use `grub_ata_cmd' and improve error handling. Actually use the detected registers. Reorder the detection logic such that it is easier to read. (grub_ata_pciinit): Do not assign the same ID to each controller. (grub_ata_setaddress): Use `grub_ata_cmd' and improve error handling. (grub_atapi_readsector): Check the result of `grub_ata_pio_read'. * include/grub/err.h (grub_err_t): Add `GRUB_ERR_TIMEOUT'. --- ChangeLog | 26 ++++++ disk/ata.c | 197 +++++++++++++++++++++++++++++++-------------- include/grub/err.h | 3 +- 3 files changed, 164 insertions(+), 62 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7599c0f6b..d10fac416 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2008-08-08 Marco Gerards + + * disk/ata.c (grub_ata_regget): Change return type to + `grub_uint8_t'. + (grub_ata_regget2): Likewise. + (grub_ata_wait_status): New function. + (grub_ata_wait_busy): Removed function, updated all users to use + `grub_ata_wait_status'. + (grub_ata_wait_drq): Likewise. + (grub_ata_cmd): New function. + (grub_ata_pio_read): Change return type to `grub_uint8_t'. Add + error handling. + (grub_ata_pio_write): Add error handling. + (grub_atapi_identify): Likewise. + (grub_atapi_packet): Use `grub_ata_cmd' and improve error + handling. + (grub_ata_identify): Use `grub_ata_cmd' and improve error + handling. Actually use the detected registers. Reorder the + detection logic such that it is easier to read. + (grub_ata_pciinit): Do not assign the same ID to each controller. + (grub_ata_setaddress): Use `grub_ata_cmd' and improve error + handling. + (grub_atapi_readsector): Check the result of `grub_ata_pio_read'. + + * include/grub/err.h (grub_err_t): Add `GRUB_ERR_TIMEOUT'. + 2008-08-08 Marco Gerards * NEWS: Update. diff --git a/disk/ata.c b/disk/ata.c index 48435b467..4bcb6390b 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -118,7 +118,7 @@ grub_ata_regset (struct grub_ata_device *dev, int reg, int val) grub_outb (val, dev->ioaddress + reg); } -static inline int +static inline grub_uint8_t grub_ata_regget (struct grub_ata_device *dev, int reg) { return grub_inb (dev->ioaddress + reg); @@ -130,23 +130,30 @@ grub_ata_regset2 (struct grub_ata_device *dev, int reg, int val) grub_outb (val, dev->ioaddress2 + reg); } -static inline int +static inline grub_uint8_t grub_ata_regget2 (struct grub_ata_device *dev, int reg) { return grub_inb (dev->ioaddress2 + reg); } -/* Wait until the device DEV has the status set to ready. */ -static inline void -grub_ata_wait_busy (struct grub_ata_device *dev) +static inline grub_err_t +grub_ata_wait_status (struct grub_ata_device *dev, + grub_uint8_t maskset, grub_uint8_t maskclear) { - while ((grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY)); -} + int i; -static inline void -grub_ata_wait_drq (struct grub_ata_device *dev) -{ - while (! (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_DRQ)); + for (i = 0; i < 1000; i++) + { + grub_uint8_t reg; + + reg = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + if ((reg & maskset) == maskset && (reg & maskclear) == 0) + return GRUB_ERR_NONE; + + grub_millisleep (1); + } + + return grub_error (GRUB_ERR_TIMEOUT, "ata timeout"); } static inline void @@ -155,6 +162,21 @@ grub_ata_wait (void) grub_millisleep (50); } +static grub_err_t +grub_ata_cmd (struct grub_ata_device *dev, int cmd) +{ + grub_err_t err; + + err = grub_ata_wait_status (dev, 0, + GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_BUSY); + if (err) + return err; + + grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd); + + return GRUB_ERR_NONE; +} + /* Byteorder has to be changed before strings can be read. */ static inline void grub_ata_strncpy (char *dst, char *src, grub_size_t len) @@ -164,11 +186,11 @@ grub_ata_strncpy (char *dst, char *src, grub_size_t len) unsigned int i; for (i = 0; i < len / 2; i++) - *(dst16++) = grub_be_to_cpu16(*(src16++)); + *(dst16++) = grub_be_to_cpu16 (*(src16++)); dst[len] = '\0'; } -static int +static grub_err_t grub_ata_pio_read (struct grub_ata_device *dev, char *buf, grub_size_t size) { @@ -179,16 +201,17 @@ grub_ata_pio_read (struct grub_ata_device *dev, char *buf, return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); /* Wait until the data is available. */ - grub_ata_wait_drq (dev); + if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0)) + return grub_errno;; /* Read in the data, word by word. */ for (i = 0; i < size / 2; i++) buf16[i] = grub_le_to_cpu16 (grub_inw(dev->ioaddress + GRUB_ATA_REG_DATA)); if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); + return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); - return 0; + return GRUB_ERR_NONE; } static grub_err_t @@ -201,17 +224,18 @@ grub_ata_pio_write (struct grub_ata_device *dev, char *buf, if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); - /* Wait until the device is ready to write. */ - grub_ata_wait_drq (dev); + /* Wait until the data is available. */ + if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0)) + return 0; /* Write the data, word by word. */ for (i = 0; i < size / 2; i++) grub_outw(grub_cpu_to_le16 (buf16[i]), dev->ioaddress + GRUB_ATA_REG_DATA); if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); + return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); - return 0; + return GRUB_ERR_NONE; } static void @@ -243,14 +267,25 @@ grub_atapi_identify (struct grub_ata_device *dev) if (! info) return grub_errno; - grub_ata_wait_busy (dev); + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + { + grub_free (info); + return grub_errno; + } grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4); - grub_ata_regset (dev, GRUB_ATA_REG_CMD, - GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE); - grub_ata_wait (); - grub_ata_pio_read (dev, info, 256); + if (grub_ata_cmd (dev, GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE)) + { + grub_free (info); + return grub_errno; + } + + if (grub_ata_pio_read (dev, info, 256)) + { + grub_free (info); + return grub_errno; + } dev->atapi = 1; @@ -258,7 +293,7 @@ grub_atapi_identify (struct grub_ata_device *dev) grub_free (info); - return 0; + return GRUB_ERR_NONE; } static grub_err_t @@ -269,12 +304,14 @@ grub_atapi_packet (struct grub_ata_device *dev, char *packet) grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0); grub_ata_regset (dev, GRUB_ATA_REG_LBAHIGH, 0xFF); grub_ata_regset (dev, GRUB_ATA_REG_LBAMID, 0xFF); - grub_ata_regset (dev, GRUB_ATA_REG_CMD, GRUB_ATA_CMD_PACKET); - grub_ata_wait (); - grub_ata_pio_write (dev, packet, 12); + if (grub_ata_cmd (dev, GRUB_ATA_CMD_PACKET)) + return grub_errno; - return 0; + if (grub_ata_pio_write (dev, packet, 12)) + return grub_errno; + + return GRUB_ERR_NONE; } static grub_err_t @@ -282,7 +319,7 @@ grub_ata_identify (struct grub_ata_device *dev) { char *info; grub_uint16_t *info16; - int ataerr; + int ataerr = 0; info = grub_malloc (GRUB_DISK_SECTOR_SIZE); if (! info) @@ -290,13 +327,22 @@ grub_ata_identify (struct grub_ata_device *dev) info16 = (grub_uint16_t *) info; - grub_ata_wait_busy (dev); + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + { + grub_free (info); + return grub_errno; + } grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4); - grub_ata_regset (dev, GRUB_ATA_REG_CMD, GRUB_ATA_CMD_IDENTIFY_DEVICE); + if (grub_ata_cmd (dev, GRUB_ATA_CMD_IDENTIFY_DEVICE)) + { + grub_free (info); + return grub_errno; + } grub_ata_wait (); - ataerr = grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE); + if (grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE)) + ataerr = grub_ata_regget (dev, GRUB_ATA_REG_ERROR); if (ataerr & 4) { /* ATAPI device detected. */ @@ -361,8 +407,8 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) /* Setup the device information. */ dev->port = port; dev->device = device; - dev->ioaddress = grub_ata_ioaddress[dev->port]; - dev->ioaddress2 = grub_ata_ioaddress2[dev->port]; + dev->ioaddress = addr; + dev->ioaddress2 = addr2; dev->next = NULL; /* Try to detect if the port is in use by writing to it, @@ -381,8 +427,11 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) /* Detect if the device is present by issuing a EXECUTE DEVICE DIAGNOSTICS command. */ grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); - grub_ata_regset (dev, GRUB_ATA_REG_CMD, - GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS); + if (grub_ata_cmd (dev, GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS)) + { + grub_free (dev); + return grub_errno; + } grub_ata_wait (); grub_dprintf ("ata", "Registers: %x %x %x %x\n", @@ -399,19 +448,19 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) { grub_dprintf ("ata", "ATAPI signature detected\n"); } - else if (! (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) == 0x01 - && grub_ata_regget (dev, GRUB_ATA_REG_LBALOW) == 0x01 - && grub_ata_regget (dev, GRUB_ATA_REG_LBAMID) == 0x00 - && grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH) == 0x00)) + else if (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) == 0x01 + && grub_ata_regget (dev, GRUB_ATA_REG_LBALOW) == 0x01 + && grub_ata_regget (dev, GRUB_ATA_REG_LBAMID) == 0x00 + && grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH) == 0x00) + { + grub_dprintf ("ata", "ATA detected\n"); + } + else { grub_dprintf ("ata", "incorrect signature\n"); grub_free (dev); return 0; } - else - { - grub_dprintf ("ata", "ATA detected\n"); - } /* Use the IDENTIFY DEVICE command to query the device. */ @@ -429,7 +478,8 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) } static int -grub_ata_pciinit (int bus, int device, int func, grub_pci_id_t pciid) +grub_ata_pciinit (int bus, int device, int func, + grub_pci_id_t pciid __attribute__((unused))) { static int compat_use[2] = { 0 }; grub_pci_address_t addr; @@ -439,6 +489,7 @@ grub_ata_pciinit (int bus, int device, int func, grub_pci_id_t pciid) int rega; int regb; int i; + static int controller = 0; /* Read class. */ addr = grub_pci_make_address (bus, device, func, 2); @@ -487,11 +538,13 @@ grub_ata_pciinit (int bus, int device, int func, grub_pci_id_t pciid) if (rega && regb) { - grub_ata_device_initialize (i, 0, rega, regb); - grub_ata_device_initialize (i, 1, rega, regb); + grub_ata_device_initialize (controller * 2 + i, 0, rega, regb); + grub_ata_device_initialize (controller * 2 + i, 1, rega, regb); } } + controller++; + return 0; } @@ -519,7 +572,8 @@ grub_ata_setaddress (struct grub_ata_device *dev, grub_disk_addr_t sector, grub_size_t size) { - grub_ata_wait_busy (dev); + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + return grub_errno; switch (addressing) { @@ -615,21 +669,31 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, if (rw == 0) { /* Read 256/65536 sectors. */ - grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd); - grub_ata_wait (); + if (grub_ata_cmd (dev, cmd)) + return grub_errno; + + /* Wait for the command to complete. */ + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + return grub_errno; + for (sect = 0; sect < batch; sect++) { if (grub_ata_pio_read (dev, buf, GRUB_DISK_SECTOR_SIZE)) - return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); + return grub_errno; buf += GRUB_DISK_SECTOR_SIZE; } } else { /* Write 256/65536 sectors. */ - grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd_write); - grub_ata_wait (); + if (grub_ata_cmd (dev, cmd)) + return grub_errno; + + /* Wait for the command to complete. */ + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + return grub_errno; + for (sect = 0; sect < batch; sect++) { if (grub_ata_pio_write (dev, buf, @@ -648,18 +712,28 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, if (rw == 0) { /* Read sectors. */ - grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd); - grub_ata_wait (); + if (grub_ata_cmd (dev, cmd)) + return grub_errno; + + /* Wait for the command to complete. */ + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + return grub_errno; + for (sect = 0; sect < (size % batch); sect++) { if (grub_ata_pio_read (dev, buf, GRUB_DISK_SECTOR_SIZE)) - return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); + return grub_errno; buf += GRUB_DISK_SECTOR_SIZE; } } else { /* Write sectors. */ - grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd_write); - grub_ata_wait (); + if (grub_ata_cmd (dev, cmd)) + return grub_errno; + + /* Wait for the command to complete. */ + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + return grub_errno; + for (sect = 0; sect < (size % batch); sect++) { if (grub_ata_pio_write (dev, buf, GRUB_DISK_SECTOR_SIZE)) @@ -746,7 +820,8 @@ grub_atapi_readsector (struct grub_ata_device *dev, grub_atapi_packet (dev, (char *) &readcmd); grub_ata_wait (); - grub_ata_pio_read (dev, buf, GRUB_CDROM_SECTOR_SIZE); + if (grub_ata_pio_read (dev, buf, GRUB_CDROM_SECTOR_SIZE)) + return grub_errno; return 0; } diff --git a/include/grub/err.h b/include/grub/err.h index 3b0fc2595..317bda436 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -51,7 +51,8 @@ typedef enum GRUB_ERR_NOT_IMPLEMENTED_YET, GRUB_ERR_SYMLINK_LOOP, GRUB_ERR_BAD_GZIP_DATA, - GRUB_ERR_MENU + GRUB_ERR_MENU, + GRUB_ERR_TIMEOUT } grub_err_t; From 042bd419daf5fb0572731a1662a8395909360b2e Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 7 Aug 2008 23:48:13 +0000 Subject: [PATCH 0341/1707] 2008-08-08 Robert Millan * kern/disk.c: Replace `' with `'. (grub_last_time): Change type to grub_uint64_t. (grub_disk_open): Migrate code from to using grub_get_time_ms(). (grub_disk_close): Likewise. * normal/menu.c: Replace `' with `'. (run_menu): Migrate code from to using grub_get_time_ms(). * util/misc.c (grub_get_time_ms): New function. --- ChangeLog | 12 ++++++++++++ kern/disk.c | 12 ++++++------ normal/menu.c | 12 ++++++------ util/misc.c | 11 +++++++++++ 4 files changed, 35 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index d10fac416..a20d59833 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-08-08 Robert Millan + + * kern/disk.c: Replace `' with `'. + (grub_last_time): Change type to grub_uint64_t. + (grub_disk_open): Migrate code from to using grub_get_time_ms(). + (grub_disk_close): Likewise. + + * normal/menu.c: Replace `' with `'. + (run_menu): Migrate code from to using grub_get_time_ms(). + + * util/misc.c (grub_get_time_ms): New function. + 2008-08-08 Marco Gerards * disk/ata.c (grub_ata_regget): Change return type to diff --git a/kern/disk.c b/kern/disk.c index 980b5056a..ed82506fd 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -22,13 +22,13 @@ #include #include #include -#include +#include #include #define GRUB_CACHE_TIMEOUT 2 /* The last time the disk was used. */ -static unsigned long grub_last_time = 0; +static grub_uint64_t grub_last_time = 0; /* Disk cache. */ @@ -215,7 +215,7 @@ grub_disk_open (const char *name) grub_disk_t disk; grub_disk_dev_t dev; char *raw = (char *) name; - unsigned long current_time; + grub_uint64_t current_time; grub_dprintf ("disk", "Opening `%s'...\n", name); @@ -280,10 +280,10 @@ grub_disk_open (const char *name) /* The cache will be invalidated about 2 seconds after a device was closed. */ - current_time = grub_get_rtc (); + current_time = grub_get_time_ms (); if (current_time > (grub_last_time - + GRUB_CACHE_TIMEOUT * GRUB_TICKS_PER_SECOND)) + + GRUB_CACHE_TIMEOUT * 1000)) grub_disk_cache_invalidate_all (); grub_last_time = current_time; @@ -315,7 +315,7 @@ grub_disk_close (grub_disk_t disk) (disk->dev->close) (disk); /* Reset the timer. */ - grub_last_time = grub_get_rtc (); + grub_last_time = grub_get_time_ms (); grub_free (disk->partition); grub_free ((void *) disk->name); diff --git a/normal/menu.c b/normal/menu.c index 1d4d4ec73..8a110d176 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include #include #include @@ -326,7 +326,7 @@ static int run_menu (grub_menu_t menu, int nested) { int first, offset; - unsigned long saved_time; + grub_uint64_t saved_time; int default_entry; int timeout; @@ -351,7 +351,7 @@ run_menu (grub_menu_t menu, int nested) } /* Initialize the time. */ - saved_time = grub_get_rtc (); + saved_time = grub_get_time_ms (); refresh: grub_setcursor (0); @@ -371,10 +371,10 @@ run_menu (grub_menu_t menu, int nested) if (timeout > 0) { - unsigned long current_time; + grub_uint64_t current_time; - current_time = grub_get_rtc (); - if (current_time - saved_time >= GRUB_TICKS_PER_SECOND) + current_time = grub_get_time_ms (); + if (current_time - saved_time >= 1000) { timeout--; set_timeout (timeout); diff --git a/util/misc.c b/util/misc.c index b285af378..ce98665c8 100644 --- a/util/misc.c +++ b/util/misc.c @@ -33,6 +33,7 @@ #include #include #include +#include #include /* Include malloc.h, only if memalign is available. It is known that @@ -284,6 +285,16 @@ grub_get_rtc (void) * GRUB_TICKS_PER_SECOND / 1000000)); } +grub_uint64_t +grub_get_time_ms (void) +{ + struct timeval tv; + + gettimeofday (&tv, 0); + + return (tv.tv_sec * 1000 + tv.tv_usec / 1000); +} + void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) From 2d05bc6a3e66005dba2091f81779e88268ae82d5 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Sat, 9 Aug 2008 12:30:26 +0000 Subject: [PATCH 0342/1707] 2008-08-09 Christian Franke * Makefile.in: Add `target_os' and `enable_grub_pe2elf'. * conf/common.rmk: Install `grub-pe2elf' only if requested. Install `grub.d/10_windows' only on Cygwin. * configure.ac: Add subst of `target_os'. Check `target_os' also before setting TARGET_OBJ2ELF. Add `--enable-grub-pe2elf'. --- ChangeLog | 9 +++++++++ Makefile.in | 2 ++ conf/common.mk | 9 ++++++++- conf/common.rmk | 9 ++++++++- configure | 21 +++++++++++++++++---- configure.ac | 13 ++++++++++--- 6 files changed, 54 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index a20d59833..3337228ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-09 Christian Franke + + * Makefile.in: Add `target_os' and `enable_grub_pe2elf'. + * conf/common.rmk: Install `grub-pe2elf' only if requested. + Install `grub.d/10_windows' only on Cygwin. + * configure.ac: Add subst of `target_os'. + Check `target_os' also before setting TARGET_OBJ2ELF. + Add `--enable-grub-pe2elf'. + 2008-08-08 Robert Millan * kern/disk.c: Replace `' with `'. diff --git a/Makefile.in b/Makefile.in index 2121431de..613797442 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,6 +48,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ target_cpu = @target_cpu@ +target_os = @target_os@ platform = @platform@ INSTALL = @INSTALL@ @@ -92,6 +93,7 @@ UNIFONT_HEX = @UNIFONT_HEX@ # Options. enable_grub_emu = @enable_grub_emu@ enable_grub_fstest = @enable_grub_fstest@ +enable_grub_pe2elf = @enable_grub_pe2elf@ enable_lzo = @enable_lzo@ ### General variables. diff --git a/conf/common.mk b/conf/common.mk index e287542d4..55cbf472b 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -459,7 +459,10 @@ grub_editenv-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) CLEANFILES += grub-editenv # for grub-pe2elf +ifeq ($(enable_grub_pe2elf), yes) bin_UTILITIES += grub-pe2elf +endif + grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c CLEANFILES += grub-pe2elf$(EXEEXT) grub_pe2elf-util_grub_pe2elf.o grub_pe2elf-util_misc.o MOSTLYCLEANFILES += grub_pe2elf-util_grub_pe2elf.d grub_pe2elf-util_misc.d @@ -493,7 +496,11 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS = 00_header 10_linux 10_hurd 10_windows 30_os-prober 40_custom +update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +ifeq ($(target_os), cygwin) +update-grub_SCRIPTS += 10_windows +endif + CLEANFILES += $(update-grub_SCRIPTS) update-grub_DATA += util/grub.d/README diff --git a/conf/common.rmk b/conf/common.rmk index 3d674a68c..95859f708 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -100,7 +100,10 @@ grub_editenv_SOURCES = util/grub-editenv.c lib/envblk.c util/misc.c kern/misc.c CLEANFILES += grub-editenv # for grub-pe2elf +ifeq ($(enable_grub_pe2elf), yes) bin_UTILITIES += grub-pe2elf +endif + grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c CLEANFILES += grub-pe2elf @@ -120,7 +123,11 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS = 00_header 10_linux 10_hurd 10_windows 30_os-prober 40_custom +update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +ifeq ($(target_os), cygwin) +update-grub_SCRIPTS += 10_windows +endif + CLEANFILES += $(update-grub_SCRIPTS) update-grub_DATA += util/grub.d/README diff --git a/configure b/configure index 69509d603..7c070af21 100644 --- a/configure +++ b/configure @@ -702,6 +702,7 @@ MODULE_LDFLAGS LIBCURSES enable_grub_emu enable_grub_fstest +enable_grub_pe2elf LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -1300,6 +1301,8 @@ Optional Features: --enable-grub-emu build and install the `grub-emu' debugging utility --enable-grub-fstest build and install the `grub-fstest' debugging utility + --enable-grub-pe2elf build and install the `grub-pe2elf' conversion + utility Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -1993,6 +1996,7 @@ esac + # # Checks for build programs. # @@ -5901,9 +5905,10 @@ echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } # For platforms where ELF is not the default link format. { echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } -if test "$host_os" = cygwin; then - TARGET_OBJ2ELF='grub-pe2elf.exe' -fi +case "${host_os}:${target_os}" in + cygwin:cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; + *) ;; +esac { echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } @@ -8363,6 +8368,13 @@ fi +# Check whether --enable-grub-pe2elf was given. +if test "${enable_grub_pe2elf+set}" = set; then + enableval=$enable_grub_pe2elf; +fi + + + # Output files. ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" @@ -9083,11 +9095,12 @@ MODULE_LDFLAGS!$MODULE_LDFLAGS$ac_delim LIBCURSES!$LIBCURSES$ac_delim enable_grub_emu!$enable_grub_emu$ac_delim enable_grub_fstest!$enable_grub_fstest$ac_delim +enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 89; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 7a5938a38..f561b8bb0 100644 --- a/configure.ac +++ b/configure.ac @@ -100,6 +100,7 @@ case "$target_cpu" in esac AC_SUBST(target_cpu) +AC_SUBST(target_os) AC_SUBST(platform) # @@ -206,9 +207,10 @@ AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) # For platforms where ELF is not the default link format. AC_MSG_CHECKING([for command to convert module to ELF format]) -if test "$host_os" = cygwin; then - TARGET_OBJ2ELF='grub-pe2elf.exe' -fi +case "${host_os}:${target_os}" in + cygwin:cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; + *) ;; +esac AC_SUBST(TARGET_OBJ2ELF) AC_MSG_RESULT([$TARGET_OBJ2ELF]) @@ -385,6 +387,11 @@ AC_ARG_ENABLE([grub-fstest], [build and install the `grub-fstest' debugging utility])]) AC_SUBST([enable_grub_fstest]) +AC_ARG_ENABLE([grub-pe2elf], + [AS_HELP_STRING([--enable-grub-pe2elf], + [build and install the `grub-pe2elf' conversion utility])]) +AC_SUBST([enable_grub_pe2elf]) + # Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform]) From e352e9cde3a9217b1b9767ac792751c7a9fa2854 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 11 Aug 2008 10:33:14 +0000 Subject: [PATCH 0343/1707] 2008-08-11 Robert Millan * kern/device.c (grub_device_open): Do not handle grub_disk_open() errors. Leave it to the upper layer to handle them. --- ChangeLog | 5 +++++ kern/device.c | 6 +----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3337228ba..d29808bc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-11 Robert Millan + + * kern/device.c (grub_device_open): Do not handle grub_disk_open() + errors. Leave it to the upper layer to handle them. + 2008-08-09 Christian Franke * Makefile.in: Add `target_os' and `enable_grub_pe2elf'. diff --git a/kern/device.c b/kern/device.c index 0b44f381a..60f25c192 100644 --- a/kern/device.c +++ b/kern/device.c @@ -49,11 +49,7 @@ grub_device_open (const char *name) /* Try to open a disk. */ disk = grub_disk_open (name); if (! disk) - { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - goto fail; - } + goto fail; dev->disk = disk; dev->net = 0; /* FIXME */ From 20024ab021f1357650d3c0d0d401affd6311f39b Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 11 Aug 2008 14:57:39 +0000 Subject: [PATCH 0344/1707] 2008-08-11 Robert Millan * kern/i386/linuxbios/startup.S: Move from here ... * kern/i386/coreboot/startup.S: ... to here. * kern/i386/linuxbios/init.c: Move from here ... * kern/i386/coreboot/init.c: ... to here. * kern/i386/linuxbios/table.c: Move from here ... * kern/i386/coreboot/mmap.c: ... to here. * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Update moved files. --- ChangeLog | 13 ++++++++ DISTLIST | 6 ++-- conf/i386-coreboot.mk | 31 ++++++++++--------- conf/i386-coreboot.rmk | 5 +-- kern/i386/{linuxbios => coreboot}/init.c | 0 .../{linuxbios/table.c => coreboot/mmap.c} | 0 kern/i386/{linuxbios => coreboot}/startup.S | 0 7 files changed, 35 insertions(+), 20 deletions(-) rename kern/i386/{linuxbios => coreboot}/init.c (100%) rename kern/i386/{linuxbios/table.c => coreboot/mmap.c} (100%) rename kern/i386/{linuxbios => coreboot}/startup.S (100%) diff --git a/ChangeLog b/ChangeLog index d29808bc7..0baa99a39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-08-11 Robert Millan + + * kern/i386/linuxbios/startup.S: Move from here ... + * kern/i386/coreboot/startup.S: ... to here. + + * kern/i386/linuxbios/init.c: Move from here ... + * kern/i386/coreboot/init.c: ... to here. + + * kern/i386/linuxbios/table.c: Move from here ... + * kern/i386/coreboot/mmap.c: ... to here. + + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Update moved files. + 2008-08-11 Robert Millan * kern/device.c (grub_device_open): Do not handle grub_disk_open() diff --git a/DISTLIST b/DISTLIST index 5116daa3f..6fa049b69 100644 --- a/DISTLIST +++ b/DISTLIST @@ -234,13 +234,13 @@ kern/env.c kern/err.c kern/file.c kern/fs.c +kern/i386/coreboot/init.c +kern/i386/coreboot/mmap.c +kern/i386/coreboot/startup.S kern/i386/dl.c kern/i386/efi/init.c kern/i386/efi/startup.S kern/i386/halt.c -kern/i386/linuxbios/init.c -kern/i386/linuxbios/startup.S -kern/i386/linuxbios/table.c kern/i386/loader.S kern/i386/pc/init.c kern/i386/pc/lzo1x.S diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index f766b9f4b..9559fc93a 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -12,8 +12,9 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h pkglib_PROGRAMS = kernel.elf # For kernel.elf. -kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \ - kern/i386/linuxbios/table.c \ +kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ + kern/i386/coreboot/init.c \ + kern/i386/coreboot/mmap.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ @@ -26,23 +27,23 @@ kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \ term/i386/pc/console.c \ term/i386/pc/at_keyboard.c term/i386/pc/vga_text.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_linuxbios_startup.d kernel_elf-kern_i386_linuxbios_init.d kernel_elf-kern_i386_linuxbios_table.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_coreboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_coreboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_linuxbios_startup.o kernel_elf-kern_i386_linuxbios_init.o kernel_elf-kern_i386_linuxbios_table.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_coreboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_coreboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) -kernel_elf-kern_i386_linuxbios_startup.o: kern/i386/linuxbios/startup.S $(kern/i386/linuxbios/startup.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_linuxbios_startup.d +kernel_elf-kern_i386_coreboot_startup.o: kern/i386/coreboot/startup.S $(kern/i386/coreboot/startup.S_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_i386_coreboot_startup.d -kernel_elf-kern_i386_linuxbios_init.o: kern/i386/linuxbios/init.c $(kern/i386/linuxbios/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_linuxbios_init.d +kernel_elf-kern_i386_coreboot_init.o: kern/i386/coreboot/init.c $(kern/i386/coreboot/init.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_i386_coreboot_init.d -kernel_elf-kern_i386_linuxbios_table.o: kern/i386/linuxbios/table.c $(kern/i386/linuxbios/table.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/linuxbios -I$(srcdir)/kern/i386/linuxbios $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_linuxbios_table.d +kernel_elf-kern_i386_coreboot_mmap.o: kern/i386/coreboot/mmap.c $(kern/i386/coreboot/mmap.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_i386_coreboot_mmap.d kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 4827c0f81..606b99c38 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -11,8 +11,9 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h pkglib_PROGRAMS = kernel.elf # For kernel.elf. -kernel_elf_SOURCES = kern/i386/linuxbios/startup.S kern/i386/linuxbios/init.c \ - kern/i386/linuxbios/table.c \ +kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ + kern/i386/coreboot/init.c \ + kern/i386/coreboot/mmap.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ diff --git a/kern/i386/linuxbios/init.c b/kern/i386/coreboot/init.c similarity index 100% rename from kern/i386/linuxbios/init.c rename to kern/i386/coreboot/init.c diff --git a/kern/i386/linuxbios/table.c b/kern/i386/coreboot/mmap.c similarity index 100% rename from kern/i386/linuxbios/table.c rename to kern/i386/coreboot/mmap.c diff --git a/kern/i386/linuxbios/startup.S b/kern/i386/coreboot/startup.S similarity index 100% rename from kern/i386/linuxbios/startup.S rename to kern/i386/coreboot/startup.S From 05f9452b12696b0352133abb36a1c3d90eee3711 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 12 Aug 2008 13:58:29 +0000 Subject: [PATCH 0345/1707] 2008-08-12 Bean * disk/raid.c (grub_raid_read): Fix a bug in raid0 code. --- ChangeLog | 4 ++++ disk/raid.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0baa99a39..c03105992 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-12 Bean + + * disk/raid.c (grub_raid_read): Fix a bug in raid0 code. + 2008-08-11 Robert Millan * kern/i386/linuxbios/startup.S: Move from here ... diff --git a/disk/raid.c b/disk/raid.c index 731bf1f43..163bd8159 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -177,7 +177,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, if (err) break; - buf += read_size; + buf += read_size << GRUB_DISK_SECTOR_BITS; size -= read_size; if (! size) break; From 371458b576b2a094e061ebe22fcc58eba2414fe2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 12 Aug 2008 15:40:26 +0000 Subject: [PATCH 0346/1707] 2008-08-12 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Move part of the relocation code from here ... (grub_multiboot): ... to here. (forward_relocator, backward_relocator): Move from here ... * kern/i386/loader.S (grub_multiboot_forward_relocator) (grub_multiboot_backward_relocator): ... to here. (grub_multiboot_real_boot): Use %edx for entry offset. Put Multiboot magic in %eax. Use %ebp for jumping (so %edx is not trashed). * include/grub/i386/loader.h (grub_multiboot_forward_relocator) (grub_multiboot_forward_relocator_end) (grub_multiboot_backward_relocator) (grub_multiboot_backward_relocator_end): New variables. --- ChangeLog | 15 ++++++ include/grub/i386/loader.h | 7 +++ kern/i386/loader.S | 41 ++++++++++++-- loader/i386/pc/multiboot.c | 106 +++++++++++++++++++------------------ 4 files changed, 113 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index c03105992..84bd7ddb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2008-08-12 Robert Millan + + * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Move part + of the relocation code from here ... + (grub_multiboot): ... to here. + (forward_relocator, backward_relocator): Move from here ... + * kern/i386/loader.S (grub_multiboot_forward_relocator) + (grub_multiboot_backward_relocator): ... to here. + (grub_multiboot_real_boot): Use %edx for entry offset. Put Multiboot + magic in %eax. Use %ebp for jumping (so %edx is not trashed). + * include/grub/i386/loader.h (grub_multiboot_forward_relocator) + (grub_multiboot_forward_relocator_end) + (grub_multiboot_backward_relocator) + (grub_multiboot_backward_relocator_end): New variables. + 2008-08-12 Bean * disk/raid.c (grub_raid_read): Fix a bug in raid0 code. diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index 2a2325c93..9673e82dc 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -53,4 +53,11 @@ extern grub_uint32_t EXPORT_VAR(grub_multiboot_payload_entry_offset); void grub_rescue_cmd_linux (int argc, char *argv[]); void grub_rescue_cmd_initrd (int argc, char *argv[]); +extern grub_uint8_t EXPORT_VAR(grub_multiboot_forward_relocator); +extern grub_uint8_t EXPORT_VAR(grub_multiboot_forward_relocator_end); +extern grub_uint8_t EXPORT_VAR(grub_multiboot_backward_relocator); +extern grub_uint8_t EXPORT_VAR(grub_multiboot_backward_relocator_end); + +#define RELOCATOR_SIZEOF(x) (&grub_multiboot_##x##_relocator_end - &grub_multiboot_##x##_relocator) + #endif /* ! GRUB_LOADER_CPU_HEADER */ diff --git a/kern/i386/loader.S b/kern/i386/loader.S index 8a0f45c4b..8f146d92e 100644 --- a/kern/i386/loader.S +++ b/kern/i386/loader.S @@ -132,6 +132,36 @@ VARIABLE(grub_multiboot_payload_dest) VARIABLE(grub_multiboot_payload_entry_offset) .long 0 +/* + * The relocators below understand the following parameters: + * ecx: Size of the block to be copied. + * esi: Where to copy from (always lowest address, even if we're relocating + * backwards). + * edi: Where to copy to (likewise). + * edx: Offset of the entry point (relative to the beginning of the block). + */ +VARIABLE(grub_multiboot_forward_relocator) + cld + addl %edi, %edx + rep + movsb + jmp *%edx +VARIABLE(grub_multiboot_forward_relocator_end) + +VARIABLE(grub_multiboot_backward_relocator) + std + addl %ecx, %esi + addl %ecx, %edi + /* backward movsb is implicitly off-by-one. compensate that. */ + incl %ecx + rep + movsb + /* same problem again. */ + incl %edi + addl %edi, %edx + jmp *%edx +VARIABLE(grub_multiboot_backward_relocator_end) + FUNCTION(grub_multiboot_real_boot) /* Push the entry address on the stack. */ pushl %eax @@ -149,11 +179,14 @@ FUNCTION(grub_multiboot_real_boot) movl EXT_C(grub_multiboot_payload_size), %ecx movl EXT_C(grub_multiboot_payload_orig), %esi movl EXT_C(grub_multiboot_payload_dest), %edi - movl EXT_C(grub_multiboot_payload_entry_offset), %eax - + movl EXT_C(grub_multiboot_payload_entry_offset), %edx + + /* Move the magic value into eax. */ + movl $MULTIBOOT_MAGIC2, %eax + /* Jump to the relocator. */ - popl %edx - jmp *%edx + popl %ebp + jmp *%ebp /* * This starts the multiboot 2 kernel. diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 8da18e648..b9b4a9e29 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -52,31 +52,6 @@ static grub_addr_t entry; static char *playground = NULL; -static grub_uint8_t forward_relocator[] = -{ - 0xfc, /* cld */ - 0x89, 0xf2, /* movl %esi, %edx */ - 0xf3, 0xa4, /* rep movsb */ - 0x01, 0xc2, /* addl %eax, %edx */ - 0xb8, 0x02, 0xb0, 0xad, 0x2b, /* movl $MULTIBOOT_MAGIC2, %eax */ - 0xff, 0xe2, /* jmp *%edx */ -}; - -static grub_uint8_t backward_relocator[] = -{ - 0xfd, /* std */ - 0x01, 0xce, /* addl %ecx, %esi */ - 0x01, 0xcf, /* addl %ecx, %edi */ - /* backward movsb is implicitly off-by-one. compensate that. */ - 0x41, /* incl %ecx */ - 0xf3, 0xa4, /* rep movsb */ - /* same problem again. */ - 0x47, /* incl %edi */ - 0x01, 0xc7, /* addl %eax, %edi */ - 0xb8, 0x02, 0xb0, 0xad, 0x2b, /* movl $MULTIBOOT_MAGIC2, %eax */ - 0xff, 0xe7, /* jmp *%edi */ -}; - static grub_err_t grub_multiboot_boot (void) { @@ -155,16 +130,11 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) grub_multiboot_payload_size = (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; - if (playground) - grub_free (playground); - playground = grub_malloc (sizeof (forward_relocator) + grub_multiboot_payload_size + sizeof (backward_relocator)); + playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); if (! playground) return grub_errno; - grub_multiboot_payload_orig = (long) playground + sizeof (forward_relocator); - - grub_memmove (playground, forward_relocator, sizeof (forward_relocator)); - grub_memmove ((char *) (grub_multiboot_payload_orig + grub_multiboot_payload_size), backward_relocator, sizeof (backward_relocator)); + grub_multiboot_payload_orig = (long) playground + RELOCATOR_SIZEOF(forward); /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) @@ -196,16 +166,6 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) #undef phdr - if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) - entry = (grub_addr_t) playground; - else - entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size; - - grub_dprintf ("multiboot_loader", "dest=%p, size=0x%x, entry_offset=0x%x\n", - (void *) grub_multiboot_payload_dest, - grub_multiboot_payload_size, - grub_multiboot_payload_entry_offset); - return grub_errno; } @@ -413,24 +373,66 @@ grub_multiboot (int argc, char *argv[]) goto fail; } + if (playground) + { + grub_free (playground); + playground = NULL; + } + if (header->flags & MULTIBOOT_AOUT_KLUDGE) { - int ofs; + int offset = ((char *) header - buffer - + (header->header_addr - header->load_addr)); + int load_size = ((header->load_end_addr == 0) ? file->size - offset : + header->load_end_addr - header->load_addr); - ofs = (char *) header - buffer - - (header->header_addr - header->load_addr); - if ((grub_aout_load (file, ofs, header->load_addr, - ((header->load_end_addr == 0) ? 0 : - header->load_end_addr - header->load_addr), - header->bss_end_addr)) - !=GRUB_ERR_NONE) - goto fail; + if (header->bss_end_addr) + grub_multiboot_payload_size = (header->bss_end_addr - header->load_addr); + else + grub_multiboot_payload_size = load_size; + grub_multiboot_payload_dest = header->load_addr; + + playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); + if (! playground) + goto fail; + + grub_multiboot_payload_orig = (long) playground + RELOCATOR_SIZEOF(forward); + + if ((grub_file_seek (file, offset)) == (grub_off_t) - 1) + goto fail; + + grub_file_read (file, grub_multiboot_payload_orig, load_size); + if (grub_errno) + goto fail; + + if (header->bss_end_addr) + grub_memset (grub_multiboot_payload_orig + load_size, 0, + header->bss_end_addr - header->load_addr - load_size); + + grub_multiboot_payload_entry_offset = header->entry_addr - header->load_addr; - entry = header->entry_addr; } else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE) goto fail; + + if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) + { + grub_memmove (playground, &grub_multiboot_forward_relocator, RELOCATOR_SIZEOF(forward)); + entry = (grub_addr_t) playground; + } + else + { + grub_memmove ((char *) (grub_multiboot_payload_orig + grub_multiboot_payload_size), + &grub_multiboot_backward_relocator, RELOCATOR_SIZEOF(backward)); + entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size; + } + + grub_dprintf ("multiboot_loader", "dest=%p, size=0x%x, entry_offset=0x%x\n", + (void *) grub_multiboot_payload_dest, + grub_multiboot_payload_size, + grub_multiboot_payload_entry_offset); + mbi = grub_malloc (sizeof (struct grub_multiboot_info)); if (! mbi) goto fail; From a19675227748a421d8055f6ffc12661a75db8d62 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 13 Aug 2008 16:55:06 +0000 Subject: [PATCH 0347/1707] 2008-08-13 Robert Millan * docs/grub.cfg: Use the native device name for the example GNU/Hurd boot entry. --- ChangeLog | 5 +++++ docs/grub.cfg | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 84bd7ddb8..7319e0b7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-13 Robert Millan + + * docs/grub.cfg: Use the native device name for the example GNU/Hurd + boot entry. + 2008-08-12 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Move part diff --git a/docs/grub.cfg b/docs/grub.cfg index 506515c8d..3d8e7eca7 100644 --- a/docs/grub.cfg +++ b/docs/grub.cfg @@ -14,7 +14,7 @@ set fallback=1 # For booting GNU/Hurd menuentry "GNU (aka GNU/Hurd)" { set root=(hd0,1) - multiboot /boot/gnumach.gz root=device:/dev/sda1 + multiboot /boot/gnumach.gz root=device:/dev/hd0s1 module /hurd/ext2fs.static --readonly \ --multiboot-command-line='${kernel-command-line}' \ --host-priv-port='${host-port}' \ From 7161f0e02b93043f98063d6d4185379888b70bd5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 13 Aug 2008 16:59:12 +0000 Subject: [PATCH 0348/1707] 2008-08-13 Robert Millan * docs/grub.cfg: Remove `/dev/' prefix in GNU/Hurd boot entry. --- ChangeLog | 4 ++++ docs/grub.cfg | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7319e0b7f..2a7ae8dd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-13 Robert Millan + + * docs/grub.cfg: Remove `/dev/' prefix in GNU/Hurd boot entry. + 2008-08-13 Robert Millan * docs/grub.cfg: Use the native device name for the example GNU/Hurd diff --git a/docs/grub.cfg b/docs/grub.cfg index 3d8e7eca7..7f02727d0 100644 --- a/docs/grub.cfg +++ b/docs/grub.cfg @@ -14,7 +14,7 @@ set fallback=1 # For booting GNU/Hurd menuentry "GNU (aka GNU/Hurd)" { set root=(hd0,1) - multiboot /boot/gnumach.gz root=device:/dev/hd0s1 + multiboot /boot/gnumach.gz root=device:hd0s1 module /hurd/ext2fs.static --readonly \ --multiboot-command-line='${kernel-command-line}' \ --host-priv-port='${host-port}' \ From b86408f869e4a8a1c7bfcb88d066c1f19b871727 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 14 Aug 2008 18:46:47 +0000 Subject: [PATCH 0349/1707] 2008-08-14 Felix Zielcke * include/grub/err.h (grub_err_printf): New function prototype. * util/misc.c (grub_err_printf): New function. * kern/misc.c [! GRUB_UTIL] (grub_err_printf): New alias for grub_printf. * kern/err.c (grub_print_error): Use grub_err_printf. --- ChangeLog | 8 ++++++++ include/grub/err.h | 4 +++- kern/err.c | 6 +++--- kern/misc.c | 5 +++++ util/misc.c | 15 ++++++++++++++- 5 files changed, 33 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2a7ae8dd3..9e22291f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-14 Felix Zielcke + + * include/grub/err.h (grub_err_printf): New function prototype. + * util/misc.c (grub_err_printf): New function. + * kern/misc.c [! GRUB_UTIL] (grub_err_printf): New alias for + grub_printf. + * kern/err.c (grub_print_error): Use grub_err_printf. + 2008-08-13 Robert Millan * docs/grub.cfg: Remove `/dev/' prefix in GNU/Hurd boot entry. diff --git a/include/grub/err.h b/include/grub/err.h index 317bda436..50a9ea455 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -1,7 +1,7 @@ /* err.h - error numbers and prototypes */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,5 +64,7 @@ void EXPORT_FUNC(grub_fatal) (const char *fmt, ...) __attribute__ ((noreturn)); void EXPORT_FUNC(grub_error_push) (void); int EXPORT_FUNC(grub_error_pop) (void); void EXPORT_FUNC(grub_print_error) (void); +int EXPORT_FUNC(grub_err_printf) (const char *fmt, ...) +__attribute__ ((format (printf, 1, 2))); #endif /* ! GRUB_ERR_HEADER */ diff --git a/kern/err.c b/kern/err.c index 837707971..8c78cb7b0 100644 --- a/kern/err.c +++ b/kern/err.c @@ -1,7 +1,7 @@ /* err.c - error handling routines */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,14 +121,14 @@ grub_print_error (void) do { if (grub_errno != GRUB_ERR_NONE) - grub_printf ("error: %s\n", grub_errmsg); + grub_err_printf ("error: %s\n", grub_errmsg); } while (grub_error_pop ()); /* If there was an assert while using error stack, report about it. */ if (grub_error_stack_assert) { - grub_printf ("assert: error stack overflow detected!\n"); + grub_err_printf ("assert: error stack overflow detected!\n"); grub_error_stack_assert = 0; } } diff --git a/kern/misc.c b/kern/misc.c index 83fcc1684..bec6ebd33 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -134,6 +134,11 @@ grub_printf (const char *fmt, ...) return ret; } +#ifndef GRUB_UTIL +int grub_err_printf (const char *fmt, ...) +__attribute__ ((alias("grub_printf"))); +#endif + void grub_real_dprintf (const char *file, const int line, const char *condition, const char *fmt, ...) diff --git a/util/misc.c b/util/misc.c index ce98665c8..7d877ccf3 100644 --- a/util/misc.c +++ b/util/misc.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -74,6 +74,19 @@ grub_util_error (const char *fmt, ...) exit (1); } +int +grub_err_printf (const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start (ap, fmt); + ret = vfprintf (stderr, fmt, ap); + va_end (ap); + + return ret; +} + void * xmalloc (size_t size) { From eba0ce9f97e45c2dab3a3128004c84f3d2b8bda1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 14 Aug 2008 18:59:33 +0000 Subject: [PATCH 0350/1707] 2008-08-14 Robert Millan * conf/common.rmk (bin_UTILITIES): Add `grub-mkelfimage'. (grub_mkelfimage_SOURCES): New variable. (util/elf/grub-mkimage.c_DEPENDENCIES): Likewise. * conf/i386-coreboot.rmk (bin_UTILITIES, grub_mkimage_SOURCES) (grub_mkimage_LDFLAGS, util/elf/grub-mkimage.c_DEPENDENCIES): Remove. * conf/powerpc-ieee1275.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * kern/ieee1275/init.c: Include `'. * kern/i386/coreboot/init.c: Likewise. * kern/i386/ieee1275/startup.S: Replace `' with `'. (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Renamed to ... (GRUB_KERNEL_CPU_PREFIX, GRUB_KERNEL_CPU_DATA_END): ... this. * kern/i386/coreboot/startup.S: Likewise. * include/grub/powerpc/ieee1275/kernel.h (GRUB_MOD_ALIGN) (GRUB_MOD_GAP): Remove. * include/grub/powerpc/kernel.h: New file. * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX) (GRUB_KERNEL_MACHINE_DATA_END): Remove. * include/grub/i386/kernel.h: New file. * include/grub/i386/coreboot/kernel.h (GRUB_MOD_ALIGN) (GRUB_MOD_GAP, GRUB_KERNEL_MACHINE_PREFIX) (GRUB_KERNEL_MACHINE_DATA_END): Remove. * util/ieee1275/grub-install.in (grub_mkimage): Initialize to use `grub-mkelfimage'. Use --directory when invoking grub_mkimage. * util/elf/grub-mkimage.c: Include `'. (add_segments): Replace GRUB_KERNEL_MACHINE_DATA_END and GRUB_KERNEL_MACHINE_PREFIX with GRUB_KERNEL_CPU_DATA_END and GRUB_KERNEL_CPU_PREFIX. --- DISTLIST | 2 ++ conf/common.rmk | 6 +++++ conf/i386-coreboot.rmk | 7 ------ conf/i386-ieee1275.rmk | 7 ------ conf/powerpc-ieee1275.rmk | 6 ----- include/grub/i386/coreboot/kernel.h | 8 ------- include/grub/i386/ieee1275/kernel.h | 3 --- include/grub/i386/kernel.h | 30 +++++++++++++++++++++++ include/grub/powerpc/ieee1275/kernel.h | 7 ------ include/grub/powerpc/kernel.h | 33 ++++++++++++++++++++++++++ kern/i386/coreboot/init.c | 1 + kern/i386/coreboot/startup.S | 6 ++--- kern/i386/ieee1275/startup.S | 6 ++--- kern/ieee1275/init.c | 1 + util/elf/grub-mkimage.c | 6 ++--- util/ieee1275/grub-install.in | 4 ++-- 16 files changed, 84 insertions(+), 49 deletions(-) create mode 100644 include/grub/i386/kernel.h create mode 100644 include/grub/powerpc/kernel.h diff --git a/DISTLIST b/DISTLIST index 6fa049b69..7039b3742 100644 --- a/DISTLIST +++ b/DISTLIST @@ -142,6 +142,7 @@ include/grub/i386/ieee1275/machine.h include/grub/i386/ieee1275/memory.h include/grub/i386/ieee1275/serial.h include/grub/i386/io.h +include/grub/i386/kernel.h include/grub/i386/linux.h include/grub/i386/loader.h include/grub/i386/pc/biosdisk.h @@ -190,6 +191,7 @@ include/grub/powerpc/ieee1275/kernel.h include/grub/powerpc/ieee1275/loader.h include/grub/powerpc/ieee1275/time.h include/grub/powerpc/ieee1275/util/biosdisk.h +include/grub/powerpc/kernel.h include/grub/powerpc/libgcc.h include/grub/powerpc/setjmp.h include/grub/powerpc/time.h diff --git a/conf/common.rmk b/conf/common.rmk index 95859f708..9ca03d463 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -1,5 +1,11 @@ # -*- makefile -*- +# For grub-mkelfimage. +bin_UTILITIES += grub-mkelfimage +grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ + util/resolve.c +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile + # For grub-probe. sbin_UTILITIES += grub-probe util/grub-probe.c_DEPENDENCIES = grub_probe_init.h diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 606b99c38..c5d3e1204 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -45,18 +45,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. -bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif -# For grub-mkimage. -grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ - util/resolve.c -grub_mkimage_LDFLAGS = $(LIBLZO) -util/elf/grub-mkimage.c_DEPENDENCIES = Makefile - # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index a93845efb..8227d7242 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -42,18 +42,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. -bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif -# For grub-mkimage. -grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ - util/resolve.c -grub_mkimage_LDFLAGS = $(LIBLZO) -util/elf/grub-mkimage.c_DEPENDENCIES = Makefile - # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 0ed75f3e3..7e4aaa969 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -28,17 +28,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke pkglib_PROGRAMS = kernel.elf # Utilities. -bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif -# For grub-mkimage. -grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ - util/resolve.c -util/elf/grub-mkimage.c_DEPENDENCIES = Makefile - # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/ieee1275/get_disk_name.c diff --git a/include/grub/i386/coreboot/kernel.h b/include/grub/i386/coreboot/kernel.h index 442d941b0..fb60668cc 100644 --- a/include/grub/i386/coreboot/kernel.h +++ b/include/grub/i386/coreboot/kernel.h @@ -21,16 +21,8 @@ #include -#define GRUB_MOD_ALIGN 0x1000 - -/* Non-zero value is only needed for some IEEE-1275 platforms. */ -#define GRUB_MOD_GAP 0 - #ifndef ASM_FILE extern char grub_prefix[]; #endif -#define GRUB_KERNEL_MACHINE_PREFIX 0x2 -#define GRUB_KERNEL_MACHINE_DATA_END 0x42 - #endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/include/grub/i386/ieee1275/kernel.h b/include/grub/i386/ieee1275/kernel.h index 66cd4fbf7..dccf8cbe1 100644 --- a/include/grub/i386/ieee1275/kernel.h +++ b/include/grub/i386/ieee1275/kernel.h @@ -1,4 +1 @@ #include - -#define GRUB_KERNEL_MACHINE_PREFIX 0x2 -#define GRUB_KERNEL_MACHINE_DATA_END 0x42 diff --git a/include/grub/i386/kernel.h b/include/grub/i386/kernel.h new file mode 100644 index 000000000..0dfab05b2 --- /dev/null +++ b/include/grub/i386/kernel.h @@ -0,0 +1,30 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_KERNEL_CPU_HEADER +#define GRUB_KERNEL_CPU_HEADER 1 + +#define GRUB_MOD_ALIGN 0x1000 + +/* Non-zero value is only needed for PowerMacs. */ +#define GRUB_MOD_GAP 0x0 + +#define GRUB_KERNEL_CPU_PREFIX 0x2 +#define GRUB_KERNEL_CPU_DATA_END 0x42 + +#endif diff --git a/include/grub/powerpc/ieee1275/kernel.h b/include/grub/powerpc/ieee1275/kernel.h index bb6767c2b..917e1548f 100644 --- a/include/grub/powerpc/ieee1275/kernel.h +++ b/include/grub/powerpc/ieee1275/kernel.h @@ -21,13 +21,6 @@ #include -#define GRUB_MOD_ALIGN 0x1000 - -/* Minimal gap between _end and the start of the modules. It's a hack - for PowerMac to prevent "CLAIM failed" error. The real fix is to - rewrite grub-mkimage to generate valid ELF files. */ -#define GRUB_MOD_GAP 0x8000 - #ifndef ASM_FILE void EXPORT_FUNC (grub_reboot) (void); diff --git a/include/grub/powerpc/kernel.h b/include/grub/powerpc/kernel.h new file mode 100644 index 000000000..2bcc3785d --- /dev/null +++ b/include/grub/powerpc/kernel.h @@ -0,0 +1,33 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_KERNEL_CPU_HEADER +#define GRUB_KERNEL_CPU_HEADER 1 + +#define GRUB_MOD_ALIGN 0x1000 + +/* Minimal gap between _end and the start of the modules. It's a hack + for PowerMac to prevent "CLAIM failed" error. The real fix is to + rewrite grub-mkimage to generate valid ELF files. */ +#define GRUB_MOD_GAP 0x8000 + +/* prefix not supported on powerpc yet. */ +#define GRUB_KERNEL_CPU_PREFIX 0 +#define GRUB_KERNEL_CPU_DATA_END 0 + +#endif diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 0e6567b9d..f1861dda7 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -33,6 +33,7 @@ #include #include #include +#include #define GRUB_FLOPPY_REG_DIGITAL_OUTPUT 0x3f2 diff --git a/kern/i386/coreboot/startup.S b/kern/i386/coreboot/startup.S index 4b11245ac..8d1aa3c15 100644 --- a/kern/i386/coreboot/startup.S +++ b/kern/i386/coreboot/startup.S @@ -19,9 +19,9 @@ #define ASM_FILE 1 #include -#include #include #include +#include #include #include @@ -44,7 +44,7 @@ _start: * This is a special data area at a fixed offset from the beginning. */ - . = EXT_C(start) + GRUB_KERNEL_MACHINE_PREFIX + . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX VARIABLE(grub_prefix) /* to be filled by grub-mkimage */ @@ -53,7 +53,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END + . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END #if 0 /* diff --git a/kern/i386/ieee1275/startup.S b/kern/i386/ieee1275/startup.S index 0e1ffd17c..db6ce1e62 100644 --- a/kern/i386/ieee1275/startup.S +++ b/kern/i386/ieee1275/startup.S @@ -19,9 +19,9 @@ #define ASM_FILE 1 #include -#include #include #include +#include #include #include @@ -45,7 +45,7 @@ _start: * This is a special data area at a fixed offset from the beginning. */ - . = EXT_C(start) + GRUB_KERNEL_MACHINE_PREFIX + . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX VARIABLE(grub_prefix) /* to be filled by grub-mkimage */ @@ -54,7 +54,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END + . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END codestart: movl %eax, EXT_C(grub_ieee1275_entry_fn) diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index 513e81fea..b07fe67f9 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #include diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index d53737c7f..715dddad8 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -30,7 +30,7 @@ #include #include #include -#include +#include #define GRUB_IEEE1275_NOTE_NAME "PowerPC" #define GRUB_IEEE1275_NOTE_TYPE 0x1275 @@ -297,9 +297,9 @@ add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[], char * if (prefix) { - if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END) + if (GRUB_KERNEL_CPU_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_CPU_DATA_END) grub_util_error ("prefix too long"); - grub_util_write_image_at (prefix, strlen (prefix) + 1, first_segment + GRUB_KERNEL_MACHINE_PREFIX, out); + grub_util_write_image_at (prefix, strlen (prefix) + 1, first_segment + GRUB_KERNEL_CPU_PREFIX, out); } free (phdrs); diff --git a/util/ieee1275/grub-install.in b/util/ieee1275/grub-install.in index 490da9792..710ed125b 100644 --- a/util/ieee1275/grub-install.in +++ b/util/ieee1275/grub-install.in @@ -34,7 +34,7 @@ target_cpu=@target_cpu@ platform=@platform@ pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` -grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}` grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` rootdir= @@ -182,7 +182,7 @@ devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_ma modules="$modules $fs_module $partmap_module $devabstraction_module" # Now perform the installation. -"$grub_mkimage" --output=${grubdir}/grub $modules || exit 1 +"$grub_mkimage" --directory=${pkglibdir} --output=${grubdir}/grub $modules || exit 1 if test $update_nvram = yes; then set $ofpathname dummy From 0e9242da3a82bd1c102960c87daccc258d5653f0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 14 Aug 2008 19:05:28 +0000 Subject: [PATCH 0351/1707] oops, missed the changelog entry --- ChangeLog | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9e22291f2..bc7b50551 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,43 @@ +2008-08-14 Robert Millan + + * conf/common.rmk (bin_UTILITIES): Add `grub-mkelfimage'. + (grub_mkelfimage_SOURCES): New variable. + (util/elf/grub-mkimage.c_DEPENDENCIES): Likewise. + + * conf/i386-coreboot.rmk (bin_UTILITIES, grub_mkimage_SOURCES) + (grub_mkimage_LDFLAGS, util/elf/grub-mkimage.c_DEPENDENCIES): Remove. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + + * kern/ieee1275/init.c: Include `'. + * kern/i386/coreboot/init.c: Likewise. + + * kern/i386/ieee1275/startup.S: Replace `' + with `'. + (GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Renamed + to ... + (GRUB_KERNEL_CPU_PREFIX, GRUB_KERNEL_CPU_DATA_END): ... this. + * kern/i386/coreboot/startup.S: Likewise. + + * include/grub/powerpc/ieee1275/kernel.h (GRUB_MOD_ALIGN) + (GRUB_MOD_GAP): Remove. + * include/grub/powerpc/kernel.h: New file. + * include/grub/i386/ieee1275/kernel.h (GRUB_KERNEL_MACHINE_PREFIX) + (GRUB_KERNEL_MACHINE_DATA_END): Remove. + * include/grub/i386/kernel.h: New file. + * include/grub/i386/coreboot/kernel.h (GRUB_MOD_ALIGN) + (GRUB_MOD_GAP, GRUB_KERNEL_MACHINE_PREFIX) + (GRUB_KERNEL_MACHINE_DATA_END): Remove. + + * util/ieee1275/grub-install.in (grub_mkimage): Initialize to use + `grub-mkelfimage'. + Use --directory when invoking grub_mkimage. + + * util/elf/grub-mkimage.c: Include `'. + (add_segments): Replace GRUB_KERNEL_MACHINE_DATA_END and + GRUB_KERNEL_MACHINE_PREFIX with GRUB_KERNEL_CPU_DATA_END + and GRUB_KERNEL_CPU_PREFIX. + 2008-08-14 Felix Zielcke * include/grub/err.h (grub_err_printf): New function prototype. From 42ce5170b732b0e5473bf32180ed3bb678bd075e Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 15 Aug 2008 15:39:02 +0000 Subject: [PATCH 0352/1707] 2008-08-15 Bean * conf/i386-pc.rmk (pkglib_MODULES): Add datetime.mod, date.mod and datehook.mod. (datetime_mod_SOURCES): New macro. (datetime_mod_CFLAGS): Likewise. (datetime_mod_LDFLAGS): Likewise. (date_mod_SOURCES): Likewise. (date_mod_CFLAGS): Likewise. (date_mod_LDFLAGS): Likewise. (datehook_mod_SOURCES): Likewise. (datehook_mod_CFLAGS): Likewise. (datehook_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk (pkglib_MODULES): Add datetime.mod, date.mod and datehook.mod. (datetime_mod_SOURCES): New macro. (datetime_mod_CFLAGS): Likewise. (datetime_mod_LDFLAGS): Likewise. (date_mod_SOURCES): Likewise. (date_mod_CFLAGS): Likewise. (date_mod_LDFLAGS): Likewise. (datehook_mod_SOURCES): Likewise. (datehook_mod_CFLAGS): Likewise. (datehook_mod_LDFLAGS): Likewise. * conf/i386-ieee1275.rmk (pkglib_MODULES): Add datetime.mod, date.mod and datehook.mod. (datetime_mod_SOURCES): New macro. (datetime_mod_CFLAGS): Likewise. (datetime_mod_LDFLAGS): Likewise. (date_mod_SOURCES): Likewise. (date_mod_CFLAGS): Likewise. (date_mod_LDFLAGS): Likewise. (datehook_mod_SOURCES): Likewise. (datehook_mod_CFLAGS): Likewise. (datehook_mod_LDFLAGS): Likewise. * conf/i386-efi.rmk (pkglib_MODULES): Add datetime.mod, date.mod and datehook.mod. (datetime_mod_SOURCES): New macro. (datetime_mod_CFLAGS): Likewise. (datetime_mod_LDFLAGS): Likewise. (date_mod_SOURCES): Likewise. (date_mod_CFLAGS): Likewise. (date_mod_LDFLAGS): Likewise. (datehook_mod_SOURCES): Likewise. (datehook_mod_CFLAGS): Likewise. (datehook_mod_LDFLAGS): Likewise. * conf/x86_64-efi.rmk (pkglib_MODULES): Add datetime.mod, date.mod and datehook.mod. (datetime_mod_SOURCES): New macro. (datetime_mod_CFLAGS): Likewise. (datetime_mod_LDFLAGS): Likewise. (date_mod_SOURCES): Likewise. (date_mod_CFLAGS): Likewise. (date_mod_LDFLAGS): Likewise. (datehook_mod_SOURCES): Likewise. (datehook_mod_CFLAGS): Likewise. (datehook_mod_LDFLAGS): Likewise. * kern/env.c (grub_env_insert): Fix a bug in prevp pointer. * commands/date.c: New file. * hook/datehook.c: Likewise. * include/grub/lib/datetime.h: Likewise. * include/grub/i386/cmos.h: Likewise. * lib/datetime.c: Likewise. * lib/i386/datetime.c: Likewise. * lib/efi/datetime.c: Likewise. --- ChangeLog | 78 +++++++++++++ commands/date.c | 145 ++++++++++++++++++++++++ conf/common.mk | 24 ++++ conf/i386-coreboot.mk | 217 ++++++++++++++++++++++++++++++----- conf/i386-coreboot.rmk | 17 ++- conf/i386-efi.mk | 193 ++++++++++++++++++++++++++++++- conf/i386-efi.rmk | 18 ++- conf/i386-ieee1275.mk | 218 +++++++++++++++++++++++++++++++----- conf/i386-ieee1275.rmk | 18 ++- conf/i386-pc.mk | 193 ++++++++++++++++++++++++++++++- conf/i386-pc.rmk | 18 ++- conf/powerpc-ieee1275.mk | 24 ---- conf/x86_64-efi.mk | 193 ++++++++++++++++++++++++++++++- conf/x86_64-efi.rmk | 18 ++- hook/datehook.c | 106 ++++++++++++++++++ include/grub/i386/cmos.h | 74 ++++++++++++ include/grub/lib/datetime.h | 44 ++++++++ kern/env.c | 4 +- lib/datetime.c | 49 ++++++++ lib/efi/datetime.c | 79 +++++++++++++ lib/i386/datetime.c | 155 +++++++++++++++++++++++++ 21 files changed, 1799 insertions(+), 86 deletions(-) create mode 100644 commands/date.c create mode 100644 hook/datehook.c create mode 100644 include/grub/i386/cmos.h create mode 100644 include/grub/lib/datetime.h create mode 100644 lib/datetime.c create mode 100644 lib/efi/datetime.c create mode 100644 lib/i386/datetime.c diff --git a/ChangeLog b/ChangeLog index bc7b50551..7473bd320 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,81 @@ +2008-08-15 Bean + + * conf/i386-pc.rmk (pkglib_MODULES): Add datetime.mod, date.mod + and datehook.mod. + (datetime_mod_SOURCES): New macro. + (datetime_mod_CFLAGS): Likewise. + (datetime_mod_LDFLAGS): Likewise. + (date_mod_SOURCES): Likewise. + (date_mod_CFLAGS): Likewise. + (date_mod_LDFLAGS): Likewise. + (datehook_mod_SOURCES): Likewise. + (datehook_mod_CFLAGS): Likewise. + (datehook_mod_LDFLAGS): Likewise. + + * conf/i386-coreboot.rmk (pkglib_MODULES): Add datetime.mod, date.mod + and datehook.mod. + (datetime_mod_SOURCES): New macro. + (datetime_mod_CFLAGS): Likewise. + (datetime_mod_LDFLAGS): Likewise. + (date_mod_SOURCES): Likewise. + (date_mod_CFLAGS): Likewise. + (date_mod_LDFLAGS): Likewise. + (datehook_mod_SOURCES): Likewise. + (datehook_mod_CFLAGS): Likewise. + (datehook_mod_LDFLAGS): Likewise. + + * conf/i386-ieee1275.rmk (pkglib_MODULES): Add datetime.mod, date.mod + and datehook.mod. + (datetime_mod_SOURCES): New macro. + (datetime_mod_CFLAGS): Likewise. + (datetime_mod_LDFLAGS): Likewise. + (date_mod_SOURCES): Likewise. + (date_mod_CFLAGS): Likewise. + (date_mod_LDFLAGS): Likewise. + (datehook_mod_SOURCES): Likewise. + (datehook_mod_CFLAGS): Likewise. + (datehook_mod_LDFLAGS): Likewise. + + * conf/i386-efi.rmk (pkglib_MODULES): Add datetime.mod, date.mod + and datehook.mod. + (datetime_mod_SOURCES): New macro. + (datetime_mod_CFLAGS): Likewise. + (datetime_mod_LDFLAGS): Likewise. + (date_mod_SOURCES): Likewise. + (date_mod_CFLAGS): Likewise. + (date_mod_LDFLAGS): Likewise. + (datehook_mod_SOURCES): Likewise. + (datehook_mod_CFLAGS): Likewise. + (datehook_mod_LDFLAGS): Likewise. + + * conf/x86_64-efi.rmk (pkglib_MODULES): Add datetime.mod, date.mod + and datehook.mod. + (datetime_mod_SOURCES): New macro. + (datetime_mod_CFLAGS): Likewise. + (datetime_mod_LDFLAGS): Likewise. + (date_mod_SOURCES): Likewise. + (date_mod_CFLAGS): Likewise. + (date_mod_LDFLAGS): Likewise. + (datehook_mod_SOURCES): Likewise. + (datehook_mod_CFLAGS): Likewise. + (datehook_mod_LDFLAGS): Likewise. + + * kern/env.c (grub_env_insert): Fix a bug in prevp pointer. + + * commands/date.c: New file. + + * hook/datehook.c: Likewise. + + * include/grub/lib/datetime.h: Likewise. + + * include/grub/i386/cmos.h: Likewise. + + * lib/datetime.c: Likewise. + + * lib/i386/datetime.c: Likewise. + + * lib/efi/datetime.c: Likewise. + 2008-08-14 Robert Millan * conf/common.rmk (bin_UTILITIES): Add `grub-mkelfimage'. diff --git a/commands/date.c b/commands/date.c new file mode 100644 index 000000000..23319182e --- /dev/null +++ b/commands/date.c @@ -0,0 +1,145 @@ +/* date.c - command to display/set current datetime. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#define GRUB_DATETIME_SET_YEAR 1 +#define GRUB_DATETIME_SET_MONTH 2 +#define GRUB_DATETIME_SET_DAY 4 +#define GRUB_DATETIME_SET_HOUR 8 +#define GRUB_DATETIME_SET_MINUTE 16 +#define GRUB_DATETIME_SET_SECOND 32 + +static grub_err_t +grub_cmd_date (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + struct grub_datetime datetime; + int limit[6][2] = {{1980, 2079}, {1, 12}, {1, 31}, {0, 23}, {0, 59}, {0, 59}}; + int value[6], mask; + + if (argc == 0) + { + if (grub_get_datetime (&datetime)) + return grub_errno; + + grub_printf ("%d-%02d-%02d %02d:%02d:%02d %s\n", + datetime.year, datetime.month, datetime.day, + datetime.hour, datetime.minute, datetime.second, + grub_get_weekday_name (&datetime)); + + return 0; + } + + grub_memset (&value, 0, sizeof (value)); + mask = 0; + + for (; argc; argc--, args++) + { + char *p, c; + int m1, ofs, n, cur_mask; + + p = args[0]; + m1 = grub_strtoul (p, &p, 10); + + c = *p; + if (c == '-') + ofs = 0; + else if (c == ':') + ofs = 3; + else + goto fail; + + value[ofs] = m1; + cur_mask = (1 << ofs); + mask &= ~(cur_mask * (1 + 2 + 4)); + + for (n = 1; (n < 3) && (*p); n++) + { + if (*p != c) + goto fail; + + value[ofs + n] = grub_strtoul (p + 1, &p, 10); + cur_mask |= (1 << (ofs + n)); + } + + if (*p) + goto fail; + + if ((ofs == 0) && (n == 2)) + { + value[ofs + 2] = value[ofs + 1]; + value[ofs + 1] = value[ofs]; + ofs++; + cur_mask <<= 1; + } + + for (; n; n--, ofs++) + if ((value [ofs] < limit[ofs][0]) || + (value [ofs] > limit[ofs][1])) + goto fail; + + mask |= cur_mask; + } + + if (grub_get_datetime (&datetime)) + return grub_errno; + + if (mask & GRUB_DATETIME_SET_YEAR) + datetime.year = value[0]; + + if (mask & GRUB_DATETIME_SET_MONTH) + datetime.month = value[1]; + + if (mask & GRUB_DATETIME_SET_DAY) + datetime.day = value[2]; + + if (mask & GRUB_DATETIME_SET_HOUR) + datetime.hour = value[3]; + + if (mask & GRUB_DATETIME_SET_MINUTE) + datetime.minute = value[4]; + + if (mask & GRUB_DATETIME_SET_SECOND) + datetime.second = value[5]; + + return grub_set_datetime (&datetime); + +fail: + return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid datetime"); +} + +GRUB_MOD_INIT(date) +{ + (void) mod; /* To stop warning. */ + grub_register_command ("date", grub_cmd_date, + GRUB_COMMAND_FLAG_BOTH, + "date [[year-]month-day] [hour:minute[:second]]", + "Command to display/set current datetime.", 0); +} + +GRUB_MOD_FINI(date) +{ + grub_unregister_command ("date"); +} diff --git a/conf/common.mk b/conf/common.mk index 55cbf472b..9004f269c 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1,6 +1,30 @@ # -*- makefile -*- # Generated by genmk.rb, please don't edit! +# For grub-mkelfimage. +bin_UTILITIES += grub-mkelfimage +grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ + util/resolve.c +CLEANFILES += grub-mkelfimage$(EXEEXT) grub_mkelfimage-util_elf_grub_mkimage.o grub_mkelfimage-util_misc.o grub_mkelfimage-util_resolve.o +MOSTLYCLEANFILES += grub_mkelfimage-util_elf_grub_mkimage.d grub_mkelfimage-util_misc.d grub_mkelfimage-util_resolve.d + +grub-mkelfimage: $(grub_mkelfimage_DEPENDENCIES) grub_mkelfimage-util_elf_grub_mkimage.o grub_mkelfimage-util_misc.o grub_mkelfimage-util_resolve.o + $(CC) -o $@ grub_mkelfimage-util_elf_grub_mkimage.o grub_mkelfimage-util_misc.o grub_mkelfimage-util_resolve.o $(LDFLAGS) $(grub_mkelfimage_LDFLAGS) + +grub_mkelfimage-util_elf_grub_mkimage.o: util/elf/grub-mkimage.c $(util/elf/grub-mkimage.c_DEPENDENCIES) + $(CC) -Iutil/elf -I$(srcdir)/util/elf $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkelfimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkelfimage-util_elf_grub_mkimage.d + +grub_mkelfimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkelfimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkelfimage-util_misc.d + +grub_mkelfimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkelfimage_CFLAGS) -MD -c -o $@ $< +-include grub_mkelfimage-util_resolve.d + +util/elf/grub-mkimage.c_DEPENDENCIES = Makefile + # For grub-probe. sbin_UTILITIES += grub-probe util/grub-probe.c_DEPENDENCIES = grub_probe_init.h diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 9559fc93a..62efd6695 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -164,36 +164,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. -bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif -# For grub-mkimage. -grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ - util/resolve.c -CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o -MOSTLYCLEANFILES += grub_mkimage-util_elf_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d - -grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o - $(CC) -o $@ grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) - -grub_mkimage-util_elf_grub_mkimage.o: util/elf/grub-mkimage.c $(util/elf/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/elf -I$(srcdir)/util/elf $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_elf_grub_mkimage.d - -grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_misc.d - -grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_resolve.d - -grub_mkimage_LDFLAGS = $(LIBLZO) -util/elf/grub-mkimage.c_DEPENDENCIES = Makefile - # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c @@ -583,7 +558,7 @@ pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ play.mod cpuid.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ - halt.mod + halt.mod datetime.mod date.mod datehook.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -1809,4 +1784,194 @@ partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPEND lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst +ifneq ($(datetime_mod_EXPORTS),no) +CLEANFILES += def-datetime.lst +DEFSYMFILES += def-datetime.lst +endif +MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_i386_datetime.d +UNDSYMFILES += und-datetime.lst + +datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + +mod-datetime.o: mod-datetime.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< + +mod-datetime.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datetime_mod_EXPORTS),no) +def-datetime.lst: pre-datetime.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ +endif + +und-datetime.lst: pre-datetime.o + echo 'datetime' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_datetime.lst +FSFILES += fs-datetime_mod-lib_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst + +cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_i386_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_i386_datetime.lst fs-datetime_mod-lib_i386_datetime.lst partmap-datetime_mod-lib_i386_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_i386_datetime.lst +FSFILES += fs-datetime_mod-lib_i386_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst + +cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst +ifneq ($(date_mod_EXPORTS),no) +CLEANFILES += def-date.lst +DEFSYMFILES += def-date.lst +endif +MOSTLYCLEANFILES += date_mod-commands_date.d +UNDSYMFILES += und-date.lst + +date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o + +mod-date.o: mod-date.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< + +mod-date.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(date_mod_EXPORTS),no) +def-date.lst: pre-date.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ +endif + +und-date.lst: pre-date.o + echo 'date' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< +-include date_mod-commands_date.d + +CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst +COMMANDFILES += cmd-date_mod-commands_date.lst +FSFILES += fs-date_mod-commands_date.lst +PARTMAPFILES += partmap-date_mod-commands_date.lst + +cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + +fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + +partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + + +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst +ifneq ($(datehook_mod_EXPORTS),no) +CLEANFILES += def-datehook.lst +DEFSYMFILES += def-datehook.lst +endif +MOSTLYCLEANFILES += datehook_mod-hook_datehook.d +UNDSYMFILES += und-datehook.lst + +datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o + +mod-datehook.o: mod-datehook.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< + +mod-datehook.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datehook_mod_EXPORTS),no) +def-datehook.lst: pre-datehook.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ +endif + +und-datehook.lst: pre-datehook.o + echo 'datehook' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) + $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< +-include datehook_mod-hook_datehook.d + +CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst +COMMANDFILES += cmd-datehook_mod-hook_datehook.lst +FSFILES += fs-datehook_mod-hook_datehook.lst +PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst + +cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + +fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + +partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + + +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index c5d3e1204..34b3b40ed 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -95,7 +95,7 @@ pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ play.mod cpuid.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ - halt.mod + halt.mod datetime.mod date.mod datehook.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/pc/linux.c @@ -180,4 +180,19 @@ lspci_mod_SOURCES = commands/lspci.c lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 78992a4ac..3c322af0f 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -118,7 +118,8 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod + _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod \ + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1632,4 +1633,194 @@ partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPEND lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst +ifneq ($(datetime_mod_EXPORTS),no) +CLEANFILES += def-datetime.lst +DEFSYMFILES += def-datetime.lst +endif +MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_efi_datetime.d +UNDSYMFILES += und-datetime.lst + +datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o + +mod-datetime.o: mod-datetime.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< + +mod-datetime.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datetime_mod_EXPORTS),no) +def-datetime.lst: pre-datetime.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ +endif + +und-datetime.lst: pre-datetime.o + echo 'datetime' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_datetime.lst +FSFILES += fs-datetime_mod-lib_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst + +cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_efi_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_efi_datetime.lst fs-datetime_mod-lib_efi_datetime.lst partmap-datetime_mod-lib_efi_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_efi_datetime.lst +FSFILES += fs-datetime_mod-lib_efi_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_efi_datetime.lst + +cmd-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst +ifneq ($(date_mod_EXPORTS),no) +CLEANFILES += def-date.lst +DEFSYMFILES += def-date.lst +endif +MOSTLYCLEANFILES += date_mod-commands_date.d +UNDSYMFILES += und-date.lst + +date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o + +mod-date.o: mod-date.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< + +mod-date.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(date_mod_EXPORTS),no) +def-date.lst: pre-date.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ +endif + +und-date.lst: pre-date.o + echo 'date' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< +-include date_mod-commands_date.d + +CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst +COMMANDFILES += cmd-date_mod-commands_date.lst +FSFILES += fs-date_mod-commands_date.lst +PARTMAPFILES += partmap-date_mod-commands_date.lst + +cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + +fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + +partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + + +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst +ifneq ($(datehook_mod_EXPORTS),no) +CLEANFILES += def-datehook.lst +DEFSYMFILES += def-datehook.lst +endif +MOSTLYCLEANFILES += datehook_mod-hook_datehook.d +UNDSYMFILES += und-datehook.lst + +datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o + +mod-datehook.o: mod-datehook.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< + +mod-datehook.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datehook_mod_EXPORTS),no) +def-datehook.lst: pre-datehook.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ +endif + +und-datehook.lst: pre-datehook.o + echo 'datehook' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) + $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< +-include datehook_mod-hook_datehook.d + +CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst +COMMANDFILES += cmd-datehook_mod-hook_datehook.lst +FSFILES += fs-datehook_mod-hook_datehook.lst +PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst + +cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + +fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + +partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + + +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 2ce21b195..ef7d8a293 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -75,7 +75,8 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod + _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod \ + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -167,4 +168,19 @@ lspci_mod_SOURCES = commands/lspci.c lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index d8b17bf60..58cd310dc 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -161,36 +161,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. -bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif -# For grub-mkimage. -grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ - util/resolve.c -CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o -MOSTLYCLEANFILES += grub_mkimage-util_elf_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d - -grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o - $(CC) -o $@ grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) - -grub_mkimage-util_elf_grub_mkimage.o: util/elf/grub-mkimage.c $(util/elf/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/elf -I$(srcdir)/util/elf $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_elf_grub_mkimage.d - -grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_misc.d - -grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_resolve.d - -grub_mkimage_LDFLAGS = $(LIBLZO) -util/elf/grub-mkimage.c_DEPENDENCIES = Makefile - # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/i386/get_disk_name.c @@ -599,7 +574,8 @@ grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPE # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod memdisk.mod pci.mod lspci.mod + _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ + date.mod datehook.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -1767,4 +1743,194 @@ partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPEND lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst +ifneq ($(datetime_mod_EXPORTS),no) +CLEANFILES += def-datetime.lst +DEFSYMFILES += def-datetime.lst +endif +MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_i386_datetime.d +UNDSYMFILES += und-datetime.lst + +datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + +mod-datetime.o: mod-datetime.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< + +mod-datetime.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datetime_mod_EXPORTS),no) +def-datetime.lst: pre-datetime.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ +endif + +und-datetime.lst: pre-datetime.o + echo 'datetime' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_datetime.lst +FSFILES += fs-datetime_mod-lib_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst + +cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_i386_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_i386_datetime.lst fs-datetime_mod-lib_i386_datetime.lst partmap-datetime_mod-lib_i386_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_i386_datetime.lst +FSFILES += fs-datetime_mod-lib_i386_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst + +cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst +ifneq ($(date_mod_EXPORTS),no) +CLEANFILES += def-date.lst +DEFSYMFILES += def-date.lst +endif +MOSTLYCLEANFILES += date_mod-commands_date.d +UNDSYMFILES += und-date.lst + +date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o + +mod-date.o: mod-date.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< + +mod-date.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(date_mod_EXPORTS),no) +def-date.lst: pre-date.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ +endif + +und-date.lst: pre-date.o + echo 'date' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< +-include date_mod-commands_date.d + +CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst +COMMANDFILES += cmd-date_mod-commands_date.lst +FSFILES += fs-date_mod-commands_date.lst +PARTMAPFILES += partmap-date_mod-commands_date.lst + +cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + +fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + +partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + + +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst +ifneq ($(datehook_mod_EXPORTS),no) +CLEANFILES += def-datehook.lst +DEFSYMFILES += def-datehook.lst +endif +MOSTLYCLEANFILES += datehook_mod-hook_datehook.d +UNDSYMFILES += und-datehook.lst + +datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o + +mod-datehook.o: mod-datehook.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< + +mod-datehook.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datehook_mod_EXPORTS),no) +def-datehook.lst: pre-datehook.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ +endif + +und-datehook.lst: pre-datehook.o + echo 'datehook' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) + $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< +-include datehook_mod-hook_datehook.d + +CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst +COMMANDFILES += cmd-datehook_mod-hook_datehook.lst +FSFILES += fs-datehook_mod-hook_datehook.lst +PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst + +cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + +fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + +partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + + +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 8227d7242..d62a65610 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -97,7 +97,8 @@ grub_install_SOURCES = util/ieee1275/grub-install.in # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod memdisk.mod pci.mod lspci.mod + _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ + date.mod datehook.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -181,4 +182,19 @@ lspci_mod_SOURCES = commands/lspci.c lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 8a5d53a21..c1beaac9b 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -904,7 +904,8 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ - aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod + aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ + datehook.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -3177,4 +3178,194 @@ partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(comm pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst +ifneq ($(datetime_mod_EXPORTS),no) +CLEANFILES += def-datetime.lst +DEFSYMFILES += def-datetime.lst +endif +MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_i386_datetime.d +UNDSYMFILES += und-datetime.lst + +datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + +mod-datetime.o: mod-datetime.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< + +mod-datetime.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datetime_mod_EXPORTS),no) +def-datetime.lst: pre-datetime.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ +endif + +und-datetime.lst: pre-datetime.o + echo 'datetime' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_datetime.lst +FSFILES += fs-datetime_mod-lib_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst + +cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_i386_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_i386_datetime.lst fs-datetime_mod-lib_i386_datetime.lst partmap-datetime_mod-lib_i386_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_i386_datetime.lst +FSFILES += fs-datetime_mod-lib_i386_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst + +cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst +ifneq ($(date_mod_EXPORTS),no) +CLEANFILES += def-date.lst +DEFSYMFILES += def-date.lst +endif +MOSTLYCLEANFILES += date_mod-commands_date.d +UNDSYMFILES += und-date.lst + +date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o + +mod-date.o: mod-date.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< + +mod-date.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(date_mod_EXPORTS),no) +def-date.lst: pre-date.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ +endif + +und-date.lst: pre-date.o + echo 'date' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< +-include date_mod-commands_date.d + +CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst +COMMANDFILES += cmd-date_mod-commands_date.lst +FSFILES += fs-date_mod-commands_date.lst +PARTMAPFILES += partmap-date_mod-commands_date.lst + +cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + +fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + +partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + + +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst +ifneq ($(datehook_mod_EXPORTS),no) +CLEANFILES += def-datehook.lst +DEFSYMFILES += def-datehook.lst +endif +MOSTLYCLEANFILES += datehook_mod-hook_datehook.d +UNDSYMFILES += und-datehook.lst + +datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o + +mod-datehook.o: mod-datehook.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< + +mod-datehook.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datehook_mod_EXPORTS),no) +def-datehook.lst: pre-datehook.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ +endif + +und-datehook.lst: pre-datehook.o + echo 'datehook' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) + $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< +-include datehook_mod-hook_datehook.d + +CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst +COMMANDFILES += cmd-datehook_mod-hook_datehook.lst +FSFILES += fs-datehook_mod-hook_datehook.lst +PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst + +cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + +fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + +partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + + +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index c1e4ac4a9..1ad2e73ca 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -163,7 +163,8 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ - aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod + aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ + datehook.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -340,4 +341,19 @@ pxecmd_mod_SOURCES = commands/i386/pc/pxecmd.c pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index c9eb1feb0..9193ea7f0 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -29,35 +29,11 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genke pkglib_PROGRAMS = kernel.elf # Utilities. -bin_UTILITIES = grub-mkimage sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif -# For grub-mkimage. -grub_mkimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ - util/resolve.c -CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o -MOSTLYCLEANFILES += grub_mkimage-util_elf_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d - -grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o - $(CC) -o $@ grub_mkimage-util_elf_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) - -grub_mkimage-util_elf_grub_mkimage.o: util/elf/grub-mkimage.c $(util/elf/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/elf -I$(srcdir)/util/elf $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_elf_grub_mkimage.d - -grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_misc.d - -grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_resolve.d - -util/elf/grub-mkimage.c_DEPENDENCIES = Makefile - # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ util/ieee1275/get_disk_name.c diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index bb9feaa8e..dae199d51 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -102,7 +102,8 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod + cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1635,4 +1636,194 @@ partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPEND lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst +ifneq ($(datetime_mod_EXPORTS),no) +CLEANFILES += def-datetime.lst +DEFSYMFILES += def-datetime.lst +endif +MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_efi_datetime.d +UNDSYMFILES += und-datetime.lst + +datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o + -rm -f $@ + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o + +mod-datetime.o: mod-datetime.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< + +mod-datetime.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datetime_mod_EXPORTS),no) +def-datetime.lst: pre-datetime.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ +endif + +und-datetime.lst: pre-datetime.o + echo 'datetime' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_datetime.lst +FSFILES += fs-datetime_mod-lib_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst + +cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< +-include datetime_mod-lib_efi_datetime.d + +CLEANFILES += cmd-datetime_mod-lib_efi_datetime.lst fs-datetime_mod-lib_efi_datetime.lst partmap-datetime_mod-lib_efi_datetime.lst +COMMANDFILES += cmd-datetime_mod-lib_efi_datetime.lst +FSFILES += fs-datetime_mod-lib_efi_datetime.lst +PARTMAPFILES += partmap-datetime_mod-lib_efi_datetime.lst + +cmd-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + +fs-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + +partmap-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + + +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst +ifneq ($(date_mod_EXPORTS),no) +CLEANFILES += def-date.lst +DEFSYMFILES += def-date.lst +endif +MOSTLYCLEANFILES += date_mod-commands_date.d +UNDSYMFILES += und-date.lst + +date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o + -rm -f $@ + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o + +mod-date.o: mod-date.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< + +mod-date.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(date_mod_EXPORTS),no) +def-date.lst: pre-date.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ +endif + +und-date.lst: pre-date.o + echo 'date' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< +-include date_mod-commands_date.d + +CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst +COMMANDFILES += cmd-date_mod-commands_date.lst +FSFILES += fs-date_mod-commands_date.lst +PARTMAPFILES += partmap-date_mod-commands_date.lst + +cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + +fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + +partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + + +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst +ifneq ($(datehook_mod_EXPORTS),no) +CLEANFILES += def-datehook.lst +DEFSYMFILES += def-datehook.lst +endif +MOSTLYCLEANFILES += datehook_mod-hook_datehook.d +UNDSYMFILES += und-datehook.lst + +datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o + -rm -f $@ + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o + +mod-datehook.o: mod-datehook.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< + +mod-datehook.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(datehook_mod_EXPORTS),no) +def-datehook.lst: pre-datehook.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ +endif + +und-datehook.lst: pre-datehook.o + echo 'datehook' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) + $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< +-include datehook_mod-hook_datehook.d + +CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst +COMMANDFILES += cmd-datehook_mod-hook_datehook.lst +FSFILES += fs-datehook_mod-hook_datehook.lst +PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst + +cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + +fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + +partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + + +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 4f8abba99..473c34e1d 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -77,7 +77,8 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod + cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -169,4 +170,19 @@ lspci_mod_SOURCES = commands/lspci.c lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For datetime.mod +datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c +datetime_mod_CFLAGS = $(COMMON_CFLAGS) +datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For date.mod +date_mod_SOURCES = commands/date.c +date_mod_CFLAGS = $(COMMON_CFLAGS) +date_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For datehook.mod +datehook_mod_SOURCES = hook/datehook.c +datehook_mod_CFLAGS = $(COMMON_CFLAGS) +datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/hook/datehook.c b/hook/datehook.c new file mode 100644 index 000000000..9419d482e --- /dev/null +++ b/hook/datehook.c @@ -0,0 +1,106 @@ +/* datehook.c - Module to install datetime hooks. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static char *grub_datetime_names[] = +{ + "YEAR", + "MONTH", + "DAY", + "HOUR", + "MINUTE", + "SECOND", + "WEEKDAY", +}; + +static char * +grub_read_hook_datetime (struct grub_env_var *var, + const char *val __attribute__ ((unused))) +{ + struct grub_datetime datetime; + static char buf[6]; + + buf[0] = 0; + if (! grub_get_datetime (&datetime)) + { + int i; + + for (i = 0; i < 7; i++) + if (! grub_strcmp (var->name, grub_datetime_names[i])) + { + int n; + + switch (i) + { + case 0: + n = datetime.year; + break; + case 1: + n = datetime.month; + break; + case 2: + n = datetime.day; + break; + case 3: + n = datetime.hour; + break; + case 4: + n = datetime.minute; + break; + case 5: + n = datetime.second; + break; + default: + return grub_get_weekday_name (&datetime); + } + + grub_sprintf (buf, "%d", n); + break; + } + } + + return buf; +} + +GRUB_MOD_INIT(datetime) +{ + (void)mod; /* To stop warning. */ + int i; + + for (i = 0; i < 7; i++) + grub_register_variable_hook (grub_datetime_names[i], + grub_read_hook_datetime, 0); +} + +GRUB_MOD_FINI(datetime) +{ + int i; + + for (i = 0; i < 7; i++) + { + grub_register_variable_hook (grub_datetime_names[i], 0, 0); + grub_env_unset (grub_datetime_names[i]); + } +} diff --git a/include/grub/i386/cmos.h b/include/grub/i386/cmos.h new file mode 100644 index 000000000..1c0530dba --- /dev/null +++ b/include/grub/i386/cmos.h @@ -0,0 +1,74 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CPU_CMOS_H +#define GRUB_CPU_CMOS_H 1 + +#include +#include + +#define GRUB_CMOS_ADDR_REG 0x70 +#define GRUB_CMOS_DATA_REG 0x71 + +#define GRUB_CMOS_INDEX_SECOND 0 +#define GRUB_CMOS_INDEX_SECOND_ALARM 1 +#define GRUB_CMOS_INDEX_MINUTE 2 +#define GRUB_CMOS_INDEX_MINUTE_ALARM 3 +#define GRUB_CMOS_INDEX_HOUR 4 +#define GRUB_CMOS_INDEX_HOUR_ALARM 5 +#define GRUB_CMOS_INDEX_DAY_OF_WEEK 6 +#define GRUB_CMOS_INDEX_DAY_OF_MONTH 7 +#define GRUB_CMOS_INDEX_MONTH 8 +#define GRUB_CMOS_INDEX_YEAR 9 + +#define GRUB_CMOS_INDEX_STATUS_A 0xA +#define GRUB_CMOS_INDEX_STATUS_B 0xB +#define GRUB_CMOS_INDEX_STATUS_C 0xC +#define GRUB_CMOS_INDEX_STATUS_D 0xD + +#define GRUB_CMOS_STATUS_B_DAYLIGHT 1 +#define GRUB_CMOS_STATUS_B_24HOUR 2 +#define GRUB_CMOS_STATUS_B_BINARY 4 + +static inline grub_uint8_t +grub_bcd_to_num (grub_uint8_t a) +{ + return ((a >> 4) * 10 + (a & 0xF)); +} + +static inline grub_uint8_t +grub_num_to_bcd (grub_uint8_t a) +{ + return (((a / 10) << 4) + (a % 10)); +} + +static inline grub_uint8_t +grub_cmos_read (grub_uint8_t index) +{ + grub_outb (index, GRUB_CMOS_ADDR_REG); + return grub_inb (GRUB_CMOS_DATA_REG); +} + +static inline void +grub_cmos_write (grub_uint8_t index, grub_uint8_t value) +{ + grub_outb (index, GRUB_CMOS_ADDR_REG); + grub_outb (value, GRUB_CMOS_DATA_REG); +} + +#endif /* GRUB_CPU_CMOS_H */ diff --git a/include/grub/lib/datetime.h b/include/grub/lib/datetime.h new file mode 100644 index 000000000..7b140ccfe --- /dev/null +++ b/include/grub/lib/datetime.h @@ -0,0 +1,44 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef KERNEL_DATETIME_HEADER +#define KERNEL_DATETIME_HEADER 1 + +#include +#include + +struct grub_datetime +{ + grub_uint16_t year; + grub_uint8_t month; + grub_uint8_t day; + grub_uint8_t hour; + grub_uint8_t minute; + grub_uint8_t second; +}; + +/* Return date and time. */ +grub_err_t grub_get_datetime (struct grub_datetime *datetime); + +/* Set date and time. */ +grub_err_t grub_set_datetime (struct grub_datetime *datetime); + +int grub_get_weekday (struct grub_datetime *datetime); +char *grub_get_weekday_name (struct grub_datetime *datetime); + +#endif /* ! KERNEL_DATETIME_HEADER */ diff --git a/kern/env.c b/kern/env.c index c47864824..6a74c70a5 100644 --- a/kern/env.c +++ b/kern/env.c @@ -146,10 +146,10 @@ grub_env_insert (struct grub_env_context *context, int idx = grub_env_hashval (var->name); /* Insert the variable into the hashtable. */ - var->prevp = &context->vars[idx];; + var->prevp = &context->vars[idx]; var->next = context->vars[idx]; if (var->next) - var->next->prevp = &var; + var->next->prevp = &(var->next); context->vars[idx] = var; } diff --git a/lib/datetime.c b/lib/datetime.c new file mode 100644 index 000000000..7215a6a6d --- /dev/null +++ b/lib/datetime.c @@ -0,0 +1,49 @@ +/* datetime.c - Module for common datetime function. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +static char *grub_weekday_names[] = +{ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", +}; + +int +grub_get_weekday (struct grub_datetime *datetime) +{ + int a, y, m; + + a = (14 - datetime->month) / 12; + y = datetime->year - a; + m = datetime->month + 12 * a - 2; + + return (datetime->day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12)) % 7; +} + +char * +grub_get_weekday_name (struct grub_datetime *datetime) +{ + return grub_weekday_names[grub_get_weekday (datetime)]; +} diff --git a/lib/efi/datetime.c b/lib/efi/datetime.c new file mode 100644 index 000000000..9fa72fddc --- /dev/null +++ b/lib/efi/datetime.c @@ -0,0 +1,79 @@ +/* kern/efi/datetime.c - efi datetime function. + * + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +grub_err_t +grub_get_datetime (struct grub_datetime *datetime) +{ + grub_efi_status_t status; + struct grub_efi_time efi_time; + + status = efi_call_2 (grub_efi_system_table->runtime_services->get_time, + &efi_time, 0); + + if (status) + return grub_error (GRUB_ERR_INVALID_COMMAND, + "can\'t get datetime using efi"); + else + { + datetime->year = efi_time.year; + datetime->month = efi_time.month; + datetime->day = efi_time.day; + datetime->hour = efi_time.hour; + datetime->minute = efi_time.minute; + datetime->second = efi_time.second; + } + + return 0; +} + +grub_err_t +grub_set_datetime (struct grub_datetime *datetime) +{ + grub_efi_status_t status; + struct grub_efi_time efi_time; + + status = efi_call_2 (grub_efi_system_table->runtime_services->get_time, + &efi_time, 0); + + if (status) + return grub_error (GRUB_ERR_INVALID_COMMAND, + "can\'t get datetime using efi"); + + efi_time.year = datetime->year; + efi_time.month = datetime->month; + efi_time.day = datetime->day; + efi_time.hour = datetime->hour; + efi_time.minute = datetime->minute; + efi_time.second = datetime->second; + + status = efi_call_1 (grub_efi_system_table->runtime_services->set_time, + &efi_time); + + if (status) + return grub_error (GRUB_ERR_INVALID_COMMAND, + "can\'t set datetime using efi"); + + return 0; +} diff --git a/lib/i386/datetime.c b/lib/i386/datetime.c new file mode 100644 index 000000000..1e5974608 --- /dev/null +++ b/lib/i386/datetime.c @@ -0,0 +1,155 @@ +/* kern/i386/datetime.c - x86 CMOS datetime function. + * + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +grub_err_t +grub_get_datetime (struct grub_datetime *datetime) +{ + int is_bcd, is_12hour; + grub_uint8_t value, flag; + + flag = grub_cmos_read (GRUB_CMOS_INDEX_STATUS_B); + + is_bcd = ! (flag & GRUB_CMOS_STATUS_B_BINARY); + + value = grub_cmos_read (GRUB_CMOS_INDEX_YEAR); + if (is_bcd) + value = grub_bcd_to_num (value); + + datetime->year = value; + datetime->year += (value < 80) ? 2000 : 1900; + + value = grub_cmos_read (GRUB_CMOS_INDEX_MONTH); + if (is_bcd) + value = grub_bcd_to_num (value); + + datetime->month = value; + + value = grub_cmos_read (GRUB_CMOS_INDEX_DAY_OF_MONTH); + if (is_bcd) + value = grub_bcd_to_num (value); + + datetime->day = value; + + is_12hour = ! (flag & GRUB_CMOS_STATUS_B_24HOUR); + + value = grub_cmos_read (GRUB_CMOS_INDEX_HOUR); + if (is_12hour) + { + is_12hour = (value & 0x80); + + value &= 0x7F; + value--; + } + + if (is_bcd) + value = grub_bcd_to_num (value); + + if (is_12hour) + value += 12; + + datetime->hour = value; + + value = grub_cmos_read (GRUB_CMOS_INDEX_MINUTE); + if (is_bcd) + value = grub_bcd_to_num (value); + + datetime->minute = value; + + value = grub_cmos_read (GRUB_CMOS_INDEX_SECOND); + if (is_bcd) + value = grub_bcd_to_num (value); + + datetime->second = value; + + return 0; +} + +grub_err_t +grub_set_datetime (struct grub_datetime *datetime) +{ + int is_bcd, is_12hour; + grub_uint8_t value, flag; + + flag = grub_cmos_read (GRUB_CMOS_INDEX_STATUS_B); + + is_bcd = ! (flag & GRUB_CMOS_STATUS_B_BINARY); + + value = ((datetime->year >= 2000) ? datetime->year - 2000 : + datetime->year - 1900); + + if (is_bcd) + value = grub_num_to_bcd (value); + + grub_cmos_write (GRUB_CMOS_INDEX_YEAR, value); + + value = datetime->month; + + if (is_bcd) + value = grub_num_to_bcd (value); + + grub_cmos_write (GRUB_CMOS_INDEX_MONTH, value); + + value = datetime->day; + + if (is_bcd) + value = grub_num_to_bcd (value); + + grub_cmos_write (GRUB_CMOS_INDEX_DAY_OF_MONTH, value); + + value = datetime->hour; + + is_12hour = (! (flag & GRUB_CMOS_STATUS_B_24HOUR)); + + if (is_12hour) + { + value++; + + if (value > 12) + value -= 12; + else + is_12hour = 0; + } + + if (is_bcd) + value = grub_num_to_bcd (value); + + if (is_12hour) + value |= 0x80; + + grub_cmos_write (GRUB_CMOS_INDEX_HOUR, value); + + value = datetime->minute; + + if (is_bcd) + value = grub_num_to_bcd (value); + + grub_cmos_write (GRUB_CMOS_INDEX_MINUTE, value); + + value = datetime->second; + + if (is_bcd) + value = grub_num_to_bcd (value); + + grub_cmos_write (GRUB_CMOS_INDEX_SECOND, value); + + return 0; +} From 1082b929e36c67677cee0fd3d5215554a0e5a878 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 16 Aug 2008 12:52:34 +0000 Subject: [PATCH 0353/1707] 2008-08-16 Robert Millan * disk/raid.c (grub_raid_init): Handle/report errors set by grub_device_iterate(). * disk/lvm.c (grub_lvm_init): Likewise. --- ChangeLog | 6 ++++++ disk/lvm.c | 6 ++++++ disk/raid.c | 6 ++++++ 3 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7473bd320..f43a275c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-16 Robert Millan + + * disk/raid.c (grub_raid_init): Handle/report errors set by + grub_device_iterate(). + * disk/lvm.c (grub_lvm_init): Likewise. + 2008-08-15 Bean * conf/i386-pc.rmk (pkglib_MODULES): Add datetime.mod, date.mod diff --git a/disk/lvm.c b/disk/lvm.c index 6a05caa75..cd9e44751 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -586,6 +586,12 @@ static struct grub_disk_dev grub_lvm_dev = GRUB_MOD_INIT(lvm) { grub_device_iterate (&grub_lvm_scan_device); + if (grub_errno) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + } + grub_disk_dev_register (&grub_lvm_dev); } diff --git a/disk/raid.c b/disk/raid.c index 163bd8159..7aa2398fc 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -580,6 +580,12 @@ static struct grub_disk_dev grub_raid_dev = GRUB_MOD_INIT(raid) { grub_device_iterate (&grub_raid_scan_device); + if (grub_errno) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + } + grub_disk_dev_register (&grub_raid_dev); } From d5e619ca8a58b05ded56ed0d8d7c1599931c7488 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 16 Aug 2008 13:16:36 +0000 Subject: [PATCH 0354/1707] change spaces to tabs for changelog entry of r1805 --- ChangeLog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f43a275c9..81f1c792f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -124,11 +124,11 @@ 2008-08-14 Felix Zielcke - * include/grub/err.h (grub_err_printf): New function prototype. - * util/misc.c (grub_err_printf): New function. - * kern/misc.c [! GRUB_UTIL] (grub_err_printf): New alias for - grub_printf. - * kern/err.c (grub_print_error): Use grub_err_printf. + * include/grub/err.h (grub_err_printf): New function prototype. + * util/misc.c (grub_err_printf): New function. + * kern/misc.c [! GRUB_UTIL] (grub_err_printf): New alias for + grub_printf. + * kern/err.c (grub_print_error): Use grub_err_printf. 2008-08-13 Robert Millan From 54d8374603091d9c2780f3137eaaca047729df31 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 16 Aug 2008 18:56:49 +0000 Subject: [PATCH 0355/1707] Add Cygwin support and update `os-prober' item in NEWS. --- NEWS | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 7914be92f..1c6f5570f 100644 --- a/NEWS +++ b/NEWS @@ -8,6 +8,8 @@ New in 1.97 - : * Add `crc' command. +* Add Cygwin support. + * Add grub-pe2elf to convert PE modules to ELF modules. * Add x86_64 EFI support. @@ -26,7 +28,8 @@ New in 1.97 - : * Create partmap.lst and use it to automatically load partition map modules. -* Add os-prober that can add operating systems to the boot menu. +* update-grub supports os-prober to add operating systems to the + boot menu. * The ATA driver supports filesystems bigger than 2TB. From 210db6c653ecc3e654fe23de031a4fea28ba5279 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 16 Aug 2008 20:21:07 +0000 Subject: [PATCH 0356/1707] 2008-08-16 Felix Zielcke * gendistlist.sh (EXTRA_DISTFILES): Remove gensymlist.sh, genkernsyms.sh. Add geninit.sh, geninitheader.sh, genkernsyms.sh.in, genmoddep.awk, gensymlist.sh.in (DISTDIRS): Add bus, docs, hook, lib * DISTLIST: Regenerated. * NEWS: Add cygwin support and change `os-prober' entry a bit. (NEWS is in previous commit.) --- ChangeLog | 9 ++ DISTLIST | 376 +++++++++++++++++++++++++++++-------------------- gendistlist.sh | 9 +- 3 files changed, 236 insertions(+), 158 deletions(-) diff --git a/ChangeLog b/ChangeLog index 81f1c792f..0d24ec251 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-16 Felix Zielcke + + * gendistlist.sh (EXTRA_DISTFILES): Remove gensymlist.sh, + genkernsyms.sh. Add geninit.sh, geninitheader.sh, genkernsyms.sh.in, + genmoddep.awk, gensymlist.sh.in + (DISTDIRS): Add bus, docs, hook, lib + * DISTLIST: Regenerated. + * NEWS: Add cygwin support and change `os-prober' entry a bit. + 2008-08-16 Robert Millan * disk/raid.c (grub_raid_init): Handle/report errors set by diff --git a/DISTLIST b/DISTLIST index 7039b3742..9bf9045b9 100644 --- a/DISTLIST +++ b/DISTLIST @@ -1,29 +1,52 @@ -aclocal.m4 AUTHORS +COPYING +ChangeLog +DISTLIST +INSTALL +NEWS +README +THANKS +TODO +Makefile.in +aclocal.m4 autogen.sh +config.guess +config.h.in +config.sub +configure +configure.ac +gencmdlist.sh +gendistlist.sh +genfslist.sh +geninit.sh +geninitheader.sh +genkernsyms.sh.in +genmk.rb +genmoddep.awk +genmodsrc.sh +genpartmaplist.sh +gensymlist.sh.in +install-sh +mkinstalldirs +stamp-h.in boot/i386/pc/boot.S boot/i386/pc/cdboot.S boot/i386/pc/diskboot.S boot/i386/pc/lnxboot.S boot/i386/pc/pxeboot.S bus/pci.c -ChangeLog commands/blocklist.c commands/boot.c commands/cat.c commands/cmp.c commands/configfile.c +commands/crc.c +commands/date.c commands/echo.c commands/halt.c commands/help.c commands/hexdump.c -commands/i386/cpuid.c -commands/i386/pc/halt.c -commands/i386/pc/play.c -commands/i386/pc/reboot.c -commands/i386/pc/vbeinfo.c -commands/i386/pc/vbetest.c -commands/ieee1275/suspend.c +commands/loadenv.c commands/ls.c commands/lspci.c commands/read.c @@ -33,42 +56,43 @@ commands/sleep.c commands/terminal.c commands/test.c commands/videotest.c +commands/i386/cpuid.c +commands/i386/pc/halt.c +commands/i386/pc/play.c +commands/i386/pc/pxecmd.c +commands/i386/pc/vbeinfo.c +commands/i386/pc/vbetest.c +commands/ieee1275/suspend.c conf/common.mk conf/common.rmk conf/i386-coreboot.mk conf/i386-coreboot.rmk conf/i386-efi.mk conf/i386-efi.rmk +conf/i386-ieee1275.mk +conf/i386-ieee1275.rmk conf/i386-pc.mk conf/i386-pc.rmk -config.guess -config.h.in -config.sub -configure -configure.ac conf/powerpc-ieee1275.mk conf/powerpc-ieee1275.rmk conf/sparc64-ieee1275.mk conf/sparc64-ieee1275.rmk -COPYING +conf/x86_64-efi.mk +conf/x86_64-efi.rmk disk/ata.c -disk/efi/efidisk.c +disk/fs_uuid.c disk/host.c -disk/i386/pc/biosdisk.c -disk/ieee1275/nand.c -disk/ieee1275/ofdisk.c disk/loopback.c disk/lvm.c disk/memdisk.c disk/raid.c -DISTLIST -docs/fdl.texi -docs/grub.cfg -docs/grub.texi -docs/mdate-sh -docs/texinfo.tex +disk/efi/efidisk.c +disk/i386/pc/biosdisk.c +disk/ieee1275/nand.c +disk/ieee1275/ofdisk.c font/manager.c fs/affs.c +fs/afs.c fs/cpio.c fs/ext2.c fs/fat.c @@ -82,36 +106,24 @@ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c +fs/udf.c fs/ufs.c fs/xfs.c -gencmdlist.sh -gendistlist.sh -genfslist.sh -geninitheader.sh -geninit.sh -genkernsyms.sh.in -genmk.rb -genmoddep.awk -genmodsrc.sh -genpartmaplist.sh -gensymlist.sh.in +fs/i386/pc/pxe.c hello/hello.c +hook/datehook.c +include/multiboot.h +include/multiboot2.h include/grub/acorn_filecore.h +include/grub/aout.h include/grub/arg.h include/grub/bitmap.h include/grub/boot.h +include/grub/bufio.h include/grub/cache.h include/grub/device.h include/grub/disk.h include/grub/dl.h -include/grub/efi/api.h -include/grub/efi/chainloader.h -include/grub/efi/console_control.h -include/grub/efi/console.h -include/grub/efi/disk.h -include/grub/efi/efi.h -include/grub/efi/pe32.h -include/grub/efi/time.h include/grub/elf.h include/grub/elfload.h include/grub/env.h @@ -122,29 +134,78 @@ include/grub/fs.h include/grub/fshelp.h include/grub/gpt_partition.h include/grub/gzio.h -include/grub/hexdump.h include/grub/hfs.h +include/grub/kernel.h +include/grub/loader.h +include/grub/lvm.h +include/grub/misc.h +include/grub/mm.h +include/grub/multiboot.h +include/grub/multiboot2.h +include/grub/multiboot_loader.h +include/grub/net.h +include/grub/normal.h +include/grub/ntfs.h +include/grub/parser.h +include/grub/partition.h +include/grub/pc_partition.h +include/grub/pci.h +include/grub/raid.h +include/grub/rescue.h +include/grub/script.h +include/grub/setjmp.h +include/grub/symbol.h +include/grub/term.h +include/grub/terminfo.h +include/grub/time.h +include/grub/tparm.h +include/grub/types.h +include/grub/video.h +include/grub/efi/api.h +include/grub/efi/chainloader.h +include/grub/efi/console.h +include/grub/efi/console_control.h +include/grub/efi/disk.h +include/grub/efi/efi.h +include/grub/efi/pe32.h +include/grub/efi/time.h +include/grub/efi/uga_draw.h include/grub/i386/at_keyboard.h +include/grub/i386/bsd.h +include/grub/i386/cmos.h +include/grub/i386/halt.h +include/grub/i386/io.h +include/grub/i386/kernel.h +include/grub/i386/linux.h +include/grub/i386/loader.h +include/grub/i386/pci.h +include/grub/i386/pit.h +include/grub/i386/reboot.h +include/grub/i386/setjmp.h +include/grub/i386/time.h +include/grub/i386/tsc.h +include/grub/i386/types.h include/grub/i386/coreboot/boot.h include/grub/i386/coreboot/console.h include/grub/i386/coreboot/init.h include/grub/i386/coreboot/kernel.h include/grub/i386/coreboot/loader.h +include/grub/i386/coreboot/machine.h include/grub/i386/coreboot/memory.h include/grub/i386/coreboot/serial.h include/grub/i386/coreboot/time.h include/grub/i386/efi/kernel.h include/grub/i386/efi/loader.h +include/grub/i386/efi/machine.h include/grub/i386/efi/time.h -include/grub/i386/halt.h +include/grub/i386/ieee1275/console.h +include/grub/i386/ieee1275/ieee1275.h +include/grub/i386/ieee1275/kernel.h include/grub/i386/ieee1275/loader.h include/grub/i386/ieee1275/machine.h include/grub/i386/ieee1275/memory.h include/grub/i386/ieee1275/serial.h -include/grub/i386/io.h -include/grub/i386/kernel.h -include/grub/i386/linux.h -include/grub/i386/loader.h +include/grub/i386/ieee1275/time.h include/grub/i386/pc/biosdisk.h include/grub/i386/pc/boot.h include/grub/i386/pc/chainloader.h @@ -154,123 +215,136 @@ include/grub/i386/pc/kernel.h include/grub/i386/pc/loader.h include/grub/i386/pc/machine.h include/grub/i386/pc/memory.h -include/grub/i386/pc/pci.h +include/grub/i386/pc/pxe.h include/grub/i386/pc/serial.h include/grub/i386/pc/time.h +include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeblit.h include/grub/i386/pc/vbefill.h -include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeutil.h include/grub/i386/pc/vga.h -include/grub/i386/pit.h -include/grub/i386/reboot.h -include/grub/i386/setjmp.h -include/grub/i386/time.h -include/grub/i386/types.h include/grub/ieee1275/ieee1275.h include/grub/ieee1275/ofdisk.h -include/grub/kernel.h -include/grub/loader.h -include/grub/lvm.h -include/grub/misc.h -include/grub/mm.h -include/grub/multiboot2.h -include/grub/multiboot.h -include/grub/multiboot_loader.h -include/grub/net.h -include/grub/normal.h -include/grub/ntfs.h -include/grub/parser.h -include/grub/partition.h -include/grub/pci.h -include/grub/pc_partition.h -include/grub/powerpc/ieee1275/biosdisk.h -include/grub/powerpc/ieee1275/console.h -include/grub/powerpc/ieee1275/ieee1275.h -include/grub/powerpc/ieee1275/kernel.h -include/grub/powerpc/ieee1275/loader.h -include/grub/powerpc/ieee1275/time.h -include/grub/powerpc/ieee1275/util/biosdisk.h +include/grub/lib/LzFind.h +include/grub/lib/LzHash.h +include/grub/lib/LzmaDec.h +include/grub/lib/LzmaEnc.h +include/grub/lib/LzmaTypes.h +include/grub/lib/crc.h +include/grub/lib/datetime.h +include/grub/lib/envblk.h +include/grub/lib/hexdump.h include/grub/powerpc/kernel.h include/grub/powerpc/libgcc.h include/grub/powerpc/setjmp.h include/grub/powerpc/time.h include/grub/powerpc/types.h -include/grub/raid.h -include/grub/rescue.h -include/grub/script.h -include/grub/setjmp.h -include/grub/sparc64/ieee1275/console.h -include/grub/sparc64/ieee1275/ieee1275.h -include/grub/sparc64/ieee1275/kernel.h -include/grub/sparc64/ieee1275/time.h +include/grub/powerpc/ieee1275/biosdisk.h +include/grub/powerpc/ieee1275/console.h +include/grub/powerpc/ieee1275/ieee1275.h +include/grub/powerpc/ieee1275/kernel.h +include/grub/powerpc/ieee1275/loader.h +include/grub/powerpc/ieee1275/machine.h +include/grub/powerpc/ieee1275/time.h +include/grub/powerpc/ieee1275/util/biosdisk.h +include/grub/sparc64/libgcc.h include/grub/sparc64/setjmp.h include/grub/sparc64/time.h include/grub/sparc64/types.h -include/grub/symbol.h -include/grub/term.h -include/grub/terminfo.h -include/grub/time.h -include/grub/tparm.h -include/grub/types.h +include/grub/sparc64/ieee1275/console.h +include/grub/sparc64/ieee1275/ieee1275.h +include/grub/sparc64/ieee1275/kernel.h +include/grub/sparc64/ieee1275/machine.h +include/grub/sparc64/ieee1275/time.h include/grub/util/biosdisk.h include/grub/util/getroot.h include/grub/util/lvm.h include/grub/util/misc.h include/grub/util/raid.h include/grub/util/resolve.h -include/grub/video.h -include/multiboot2.h -include/multiboot.h -INSTALL -install-sh +include/grub/x86_64/linux.h +include/grub/x86_64/pci.h +include/grub/x86_64/setjmp.h +include/grub/x86_64/time.h +include/grub/x86_64/types.h +include/grub/x86_64/efi/kernel.h +include/grub/x86_64/efi/loader.h +include/grub/x86_64/efi/machine.h +include/grub/x86_64/efi/time.h +io/bufio.c io/gzio.c kern/device.c kern/disk.c kern/dl.c -kern/efi/efi.c -kern/efi/init.c -kern/efi/mm.c kern/elf.c kern/env.c kern/err.c kern/file.c kern/fs.c -kern/i386/coreboot/init.c -kern/i386/coreboot/mmap.c -kern/i386/coreboot/startup.S -kern/i386/dl.c -kern/i386/efi/init.c -kern/i386/efi/startup.S -kern/i386/halt.c -kern/i386/loader.S -kern/i386/pc/init.c -kern/i386/pc/lzo1x.S -kern/i386/pc/startup.S -kern/i386/pit.c -kern/i386/realmode.S -kern/i386/reboot.c -kern/ieee1275/cmain.c -kern/ieee1275/ieee1275.c -kern/ieee1275/init.c -kern/ieee1275/openfw.c kern/loader.c kern/main.c kern/misc.c kern/mm.c kern/parser.c kern/partition.c +kern/rescue.c +kern/term.c +kern/time.c +kern/efi/efi.c +kern/efi/init.c +kern/efi/mm.c +kern/generic/millisleep.c +kern/generic/rtc_get_time_ms.c +kern/i386/dl.c +kern/i386/halt.c +kern/i386/loader.S +kern/i386/pit.c +kern/i386/realmode.S +kern/i386/reboot.c +kern/i386/tsc.c +kern/i386/coreboot/init.c +kern/i386/coreboot/mmap.c +kern/i386/coreboot/startup.S +kern/i386/efi/init.c +kern/i386/efi/startup.S +kern/i386/ieee1275/init.c +kern/i386/ieee1275/startup.S +kern/i386/pc/init.c +kern/i386/pc/lzma_decode.S +kern/i386/pc/lzo1x.S +kern/i386/pc/startup.S +kern/ieee1275/cmain.c +kern/ieee1275/ieee1275.c +kern/ieee1275/init.c +kern/ieee1275/openfw.c kern/powerpc/cache.S kern/powerpc/dl.c kern/powerpc/ieee1275/crt0.S -kern/rescue.c kern/sparc64/cache.S kern/sparc64/dl.c kern/sparc64/ieee1275/init.c kern/sparc64/ieee1275/openfw.c -kern/term.c +kern/x86_64/dl.c +kern/x86_64/efi/callwrap.S +kern/x86_64/efi/startup.S +lib/LzFind.c +lib/LzmaDec.c +lib/LzmaEnc.c +lib/crc.c +lib/datetime.c +lib/envblk.c +lib/hexdump.c +lib/efi/datetime.c +lib/i386/datetime.c +loader/aout.c +loader/multiboot2.c +loader/multiboot_loader.c +loader/multiboot_loader_normal.c +loader/efi/appleloader.c loader/efi/chainloader.c loader/efi/chainloader_normal.c +loader/i386/bsd.c +loader/i386/bsd_normal.c loader/i386/efi/linux.c loader/i386/efi/linux_normal.c loader/i386/ieee1275/linux.c @@ -279,18 +353,12 @@ loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c loader/i386/pc/linux_normal.c -loader/i386/pc/multiboot2.c loader/i386/pc/multiboot.c +loader/i386/pc/multiboot2.c loader/i386/pc/multiboot_normal.c loader/ieee1275/multiboot2.c -loader/multiboot2.c -loader/multiboot_loader.c -loader/multiboot_loader_normal.c loader/powerpc/ieee1275/linux.c loader/powerpc/ieee1275/linux_normal.c -Makefile.in -mkinstalldirs -NEWS normal/arg.c normal/cmdline.c normal/color.c @@ -298,25 +366,26 @@ normal/command.c normal/completion.c normal/execute.c normal/function.c -normal/i386/setjmp.S normal/lexer.c normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c -normal/parser.y -normal/powerpc/setjmp.S normal/script.c +normal/i386/setjmp.S +normal/powerpc/setjmp.S +normal/sparc64/setjmp.S +normal/x86_64/setjmp.S partmap/acorn.c partmap/amiga.c partmap/apple.c partmap/gpt.c partmap/pc.c partmap/sun.c -README -stamp-h.in -term/efi/console.c term/gfxterm.c +term/terminfo.c +term/tparm.c +term/efi/console.c term/i386/pc/at_keyboard.c term/i386/pc/console.c term/i386/pc/serial.c @@ -324,28 +393,34 @@ term/i386/pc/vesafb.c term/i386/pc/vga.c term/i386/pc/vga_text.c term/ieee1275/ofconsole.c -term/terminfo.c -term/tparm.c -THANKS -TODO util/biosdisk.c util/console.c -util/elf/grub-mkimage.c +util/genmoddep.c util/getroot.c +util/grub-editenv.c +util/grub-emu.c +util/grub-fstest.c +util/grub-mkdevicemap.c +util/grub-pe2elf.c +util/grub-probe.c +util/hostfs.c +util/lvm.c +util/misc.c +util/raid.c +util/resolve.c +util/unifont2pff.rb +util/update-grub.in +util/update-grub_lib.in +util/elf/grub-mkimage.c util/grub.d/00_header.in util/grub.d/10_hurd.in util/grub.d/10_linux.in util/grub.d/10_windows.in util/grub.d/30_os-prober.in util/grub.d/40_custom.in -util/grub.d/README -util/grub-emu.c -util/grub-mkdevicemap.c -util/grub-probe.c -util/hostfs.c +util/i386/get_disk_name.c util/i386/efi/grub-install.in util/i386/efi/grub-mkimage.c -util/i386/get_disk_name.c util/i386/pc/grub-install.in util/i386/pc/grub-mkimage.c util/i386/pc/grub-mkrescue.in @@ -353,21 +428,14 @@ util/i386/pc/grub-setup.c util/i386/pc/misc.c util/ieee1275/get_disk_name.c util/ieee1275/grub-install.in -util/lvm.c -util/misc.c util/powerpc/ieee1275/grub-mkrescue.in util/powerpc/ieee1275/misc.c -util/raid.c -util/resolve.c -util/unifont2pff.rb -util/update-grub.in -util/update-grub_lib.in video/bitmap.c -video/i386/pc/vbeblit.c +video/video.c video/i386/pc/vbe.c +video/i386/pc/vbeblit.c video/i386/pc/vbefill.c video/i386/pc/vbeutil.c video/readers/jpeg.c video/readers/png.c video/readers/tga.c -video/video.c diff --git a/gendistlist.sh b/gendistlist.sh index 4c648aa90..fdd5d4a66 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -16,11 +16,12 @@ EXTRA_DISTFILES="AUTHORS COPYING ChangeLog DISTLIST INSTALL NEWS README \ THANKS TODO Makefile.in aclocal.m4 autogen.sh config.guess \ config.h.in config.sub configure configure.ac gencmdlist.sh \ - gendistlist.sh genfslist.sh genpartmaplist.sh genkernsyms.sh genmk.rb \ - genmodsrc.sh gensymlist.sh install-sh mkinstalldirs stamp-h.in" + gendistlist.sh genfslist.sh geninit.sh geninitheader.sh genkernsyms.sh.in \ + genmk.rb genmoddep.awk genmodsrc.sh genpartmaplist.sh gensymlist.sh.in + install-sh mkinstalldirs stamp-h.in" -DISTDIRS="boot commands conf disk font fs hello include io kern loader \ - normal partmap term util video" +DISTDIRS="boot bus commands conf disk docs font fs hello hook include io kern lib \ + loader normal partmap term util video" for f in $EXTRA_DISTFILES; do echo $f From 48cdbfd409f4b9ca73e75de138b45b3e953d1e6a Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 16 Aug 2008 20:25:46 +0000 Subject: [PATCH 0357/1707] fix previous changelog commit --- ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d24ec251..6cf6d4278 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,10 +2,10 @@ * gendistlist.sh (EXTRA_DISTFILES): Remove gensymlist.sh, genkernsyms.sh. Add geninit.sh, geninitheader.sh, genkernsyms.sh.in, - genmoddep.awk, gensymlist.sh.in - (DISTDIRS): Add bus, docs, hook, lib + genmoddep.awk, gensymlist.sh.in. + (DISTDIRS): Add bus, docs, hook, lib. * DISTLIST: Regenerated. - * NEWS: Add cygwin support and change `os-prober' entry a bit. + * NEWS: Add cygwin support and change the `os-prober' entry a bit. 2008-08-16 Robert Millan From 605f5bb64b41936736591e3b9bea0ccca2cf6cab Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 17 Aug 2008 09:12:59 +0000 Subject: [PATCH 0358/1707] 2008-08-17 Felix Zielcke * gendistlist.sh: Add *.y, *.tex, *.texi, grub.cfg, README, *.sc, mdate-sh to the list `find' searches for. * DISTLIST: Regenerated. --- ChangeLog | 6 ++++++ DISTLIST | 35 +++++++++++++++++++++-------------- gendistlist.sh | 5 +++-- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cf6d4278..e472a921a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-17 Felix Zielcke + + * gendistlist.sh: Add *.y, *.tex, *.texi, grub.cfg, README, *.sc, + mdate-sh to the list `find' searches for. + * DISTLIST: Regenerated. + 2008-08-16 Felix Zielcke * gendistlist.sh (EXTRA_DISTFILES): Remove gensymlist.sh, diff --git a/DISTLIST b/DISTLIST index 9bf9045b9..91cbdbc0c 100644 --- a/DISTLIST +++ b/DISTLIST @@ -71,6 +71,7 @@ conf/i386-efi.mk conf/i386-efi.rmk conf/i386-ieee1275.mk conf/i386-ieee1275.rmk +conf/i386-pc-cygwin-img-ld.sc conf/i386-pc.mk conf/i386-pc.rmk conf/powerpc-ieee1275.mk @@ -90,6 +91,10 @@ disk/efi/efidisk.c disk/i386/pc/biosdisk.c disk/ieee1275/nand.c disk/ieee1275/ofdisk.c +docs/fdl.texi +docs/grub.cfg +docs/grub.texi +docs/texinfo.tex font/manager.c fs/affs.c fs/afs.c @@ -112,8 +117,8 @@ fs/xfs.c fs/i386/pc/pxe.c hello/hello.c hook/datehook.c -include/multiboot.h include/multiboot2.h +include/multiboot.h include/grub/acorn_filecore.h include/grub/aout.h include/grub/arg.h @@ -140,16 +145,16 @@ include/grub/loader.h include/grub/lvm.h include/grub/misc.h include/grub/mm.h -include/grub/multiboot.h include/grub/multiboot2.h +include/grub/multiboot.h include/grub/multiboot_loader.h include/grub/net.h include/grub/normal.h include/grub/ntfs.h include/grub/parser.h include/grub/partition.h -include/grub/pc_partition.h include/grub/pci.h +include/grub/pc_partition.h include/grub/raid.h include/grub/rescue.h include/grub/script.h @@ -163,8 +168,8 @@ include/grub/types.h include/grub/video.h include/grub/efi/api.h include/grub/efi/chainloader.h -include/grub/efi/console.h include/grub/efi/console_control.h +include/grub/efi/console.h include/grub/efi/disk.h include/grub/efi/efi.h include/grub/efi/pe32.h @@ -218,22 +223,22 @@ include/grub/i386/pc/memory.h include/grub/i386/pc/pxe.h include/grub/i386/pc/serial.h include/grub/i386/pc/time.h -include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeblit.h include/grub/i386/pc/vbefill.h +include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeutil.h include/grub/i386/pc/vga.h include/grub/ieee1275/ieee1275.h include/grub/ieee1275/ofdisk.h +include/grub/lib/crc.h +include/grub/lib/datetime.h +include/grub/lib/envblk.h +include/grub/lib/hexdump.h include/grub/lib/LzFind.h include/grub/lib/LzHash.h include/grub/lib/LzmaDec.h include/grub/lib/LzmaEnc.h include/grub/lib/LzmaTypes.h -include/grub/lib/crc.h -include/grub/lib/datetime.h -include/grub/lib/envblk.h -include/grub/lib/hexdump.h include/grub/powerpc/kernel.h include/grub/powerpc/libgcc.h include/grub/powerpc/setjmp.h @@ -327,13 +332,13 @@ kern/sparc64/ieee1275/openfw.c kern/x86_64/dl.c kern/x86_64/efi/callwrap.S kern/x86_64/efi/startup.S -lib/LzFind.c -lib/LzmaDec.c -lib/LzmaEnc.c lib/crc.c lib/datetime.c lib/envblk.c lib/hexdump.c +lib/LzFind.c +lib/LzmaDec.c +lib/LzmaEnc.c lib/efi/datetime.c lib/i386/datetime.c loader/aout.c @@ -353,8 +358,8 @@ loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c loader/i386/pc/linux_normal.c -loader/i386/pc/multiboot.c loader/i386/pc/multiboot2.c +loader/i386/pc/multiboot.c loader/i386/pc/multiboot_normal.c loader/ieee1275/multiboot2.c loader/powerpc/ieee1275/linux.c @@ -371,6 +376,7 @@ normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c +normal/parser.y normal/script.c normal/i386/setjmp.S normal/powerpc/setjmp.S @@ -418,6 +424,7 @@ util/grub.d/10_linux.in util/grub.d/10_windows.in util/grub.d/30_os-prober.in util/grub.d/40_custom.in +util/grub.d/README util/i386/get_disk_name.c util/i386/efi/grub-install.in util/i386/efi/grub-mkimage.c @@ -432,8 +439,8 @@ util/powerpc/ieee1275/grub-mkrescue.in util/powerpc/ieee1275/misc.c video/bitmap.c video/video.c -video/i386/pc/vbe.c video/i386/pc/vbeblit.c +video/i386/pc/vbe.c video/i386/pc/vbefill.c video/i386/pc/vbeutil.c video/readers/jpeg.c diff --git a/gendistlist.sh b/gendistlist.sh index fdd5d4a66..1ce8f1601 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -32,8 +32,9 @@ cd $dir for dir in $DISTDIRS; do for d in `find $dir -type d | sort`; do - find $d -maxdepth 1 -name '*.[chS]' -o -name '*.mk' -o -name '*.rmk' \ - -o -name '*.rb' -o -name '*.in' \ + find $d -maxdepth 1 -name '*.[chSy]' -o -name '*.mk' -o -name '*.rmk' \ + -o -name '*.rb' -o -name '*.in' -o -name '*.tex' -o -name '*.texi' \ + -o -name 'grub.cfg' -o -name 'README' -o -name '*.sc' -o -name 'mdate.sh' \ | sort done done From f8aa0f43c494fde8a27f278425afc9c5b9548111 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 17 Aug 2008 10:30:25 +0000 Subject: [PATCH 0359/1707] 2008-08-17 Carles Pina i Estany * menu/normal.c (run_menu): Add Home and End keys in grub-menu. --- ChangeLog | 4 ++++ normal/menu.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index e472a921a..31bea9379 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-17 Carles Pina i Estany + + * menu/normal.c (run_menu): Add Home and End keys in grub-menu. + 2008-08-17 Felix Zielcke * gendistlist.sh: Add *.y, *.tex, *.texi, grub.cfg, README, *.sc, diff --git a/normal/menu.c b/normal/menu.c index 8a110d176..279dd5877 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -405,6 +405,22 @@ run_menu (grub_menu_t menu, int nested) switch (c) { + case GRUB_TERM_HOME: + first = 0; + offset = 0; + print_entries (menu, first, offset); + break; + + case GRUB_TERM_END: + offset = menu->size - 1; + if (offset > GRUB_TERM_NUM_ENTRIES - 1) + { + first = offset - (GRUB_TERM_NUM_ENTRIES - 1); + offset = GRUB_TERM_NUM_ENTRIES - 1; + } + print_entries (menu, first, offset); + break; + case 16: case '^': if (offset > 0) From 9807deb97d3129ea283b1af89262d03348cff10a Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 17 Aug 2008 15:50:36 +0000 Subject: [PATCH 0360/1707] changing spaces to \t again sigh --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 31bea9379..914e2a33a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2008-08-17 Carles Pina i Estany - * menu/normal.c (run_menu): Add Home and End keys in grub-menu. + * menu/normal.c (run_menu): Add Home and End keys in grub-menu. 2008-08-17 Felix Zielcke From deceb3ecd38a046c1ae641109240a35d1506d71c Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 17 Aug 2008 16:32:18 +0000 Subject: [PATCH 0361/1707] 2008-08-17 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/pc/mmap.c'. * include/grub/i386/pc/init.h (GRUB_MACHINE_MEMORY_AVAILABLE) (GRUB_MACHINE_MEMORY_RESERVED): New macros. (grub_machine_mmap_iterate): New function declaration. * include/grub/multiboot.h (struct grub_multiboot_mmap_entry): New structure. (GRUB_MMAP_MEMORY_AVAILABLE, GRUB_MMAP_MEMORY_RESERVED): New macros. * kern/i386/pc/init.c (grub_machine_init): Replace hardcoded region type check value with `GRUB_MACHINE_MEMORY_AVAILABLE'. Move e820 parsing from here ... * kern/i386/pc/mmap.c: New file. (grub_machine_mmap_iterate): ... to here. * include/grub/i386/coreboot/memory.h: Remove `'. (GRUB_LINUXBIOS_MEMORY_AVAILABLE): Rename (for consistency) to ... (GRUB_MACHINE_MEMORY_AVAILABLE): ... this. Update all users. (grub_available_iterate): Redeclare to return `void', and redeclare its hook to use grub_uint64_t as addr and size parameters, and rename to ... (grub_machine_mmap_iterate): ... this. Update all users. * kern/i386/coreboot/mmap.c (grub_mmap_iterate): Simplify parser loop to make it more readable. Rename to ... (grub_machine_mmap_iterate): ... this. * loader/i386/pc/multiboot.c (mmap_addr, mmap_length): New variables. (grub_get_multiboot_mmap_len, grub_fill_multiboot_mmap): New functions. (grub_multiboot): Allocate an extra region after the payload, and fill it with a Multiboot memory map. Adjust a.out loader to calculate size with the extra space. (grub_multiboot_load_elf32): Adjust elf32 loader to calculate size with the extra space. --- ChangeLog | 38 +++++++++++++++ conf/i386-pc.rmk | 3 +- include/grub/i386/coreboot/memory.h | 67 +++++++++++++++++++++++++++ include/grub/i386/pc/init.h | 7 ++- include/grub/multiboot.h | 12 ++++- kern/i386/coreboot/init.c | 11 ++--- kern/i386/coreboot/mmap.c | 18 +++++--- kern/i386/pc/init.c | 71 ++++++++++------------------ kern/i386/pc/mmap.c | 60 ++++++++++++++++++++++++ loader/i386/pc/multiboot.c | 72 ++++++++++++++++++++++++++--- 10 files changed, 289 insertions(+), 70 deletions(-) create mode 100644 include/grub/i386/coreboot/memory.h create mode 100644 kern/i386/pc/mmap.c diff --git a/ChangeLog b/ChangeLog index 914e2a33a..abb359e35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,41 @@ +2008-08-17 Robert Millan + + * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/pc/mmap.c'. + + * include/grub/i386/pc/init.h (GRUB_MACHINE_MEMORY_AVAILABLE) + (GRUB_MACHINE_MEMORY_RESERVED): New macros. + (grub_machine_mmap_iterate): New function declaration. + * include/grub/multiboot.h (struct grub_multiboot_mmap_entry): New + structure. + (GRUB_MMAP_MEMORY_AVAILABLE, GRUB_MMAP_MEMORY_RESERVED): New + macros. + + * kern/i386/pc/init.c (grub_machine_init): Replace hardcoded region + type check value with `GRUB_MACHINE_MEMORY_AVAILABLE'. + Move e820 parsing from here ... + * kern/i386/pc/mmap.c: New file. + (grub_machine_mmap_iterate): ... to here. + + * include/grub/i386/coreboot/memory.h: Remove `'. + (GRUB_LINUXBIOS_MEMORY_AVAILABLE): Rename (for consistency) to ... + (GRUB_MACHINE_MEMORY_AVAILABLE): ... this. Update all users. + (grub_available_iterate): Redeclare to return `void', and redeclare + its hook to use grub_uint64_t as addr and size parameters, and rename + to ... + (grub_machine_mmap_iterate): ... this. Update all users. + + * kern/i386/coreboot/mmap.c (grub_mmap_iterate): Simplify parser loop + to make it more readable. Rename to ... + (grub_machine_mmap_iterate): ... this. + + * loader/i386/pc/multiboot.c (mmap_addr, mmap_length): New variables. + (grub_get_multiboot_mmap_len, grub_fill_multiboot_mmap): New functions. + (grub_multiboot): Allocate an extra region after the payload, and fill + it with a Multiboot memory map. Adjust a.out loader to calculate size + with the extra space. + (grub_multiboot_load_elf32): Adjust elf32 loader to calculate size + with the extra space. + 2008-08-17 Carles Pina i Estany * menu/normal.c (run_menu): Add Home and End keys in grub-menu. diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 1ad2e73ca..a2ab94def 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -43,7 +43,8 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/time.c \ - kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ + kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ + kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ diff --git a/include/grub/i386/coreboot/memory.h b/include/grub/i386/coreboot/memory.h new file mode 100644 index 000000000..687077c48 --- /dev/null +++ b/include/grub/i386/coreboot/memory.h @@ -0,0 +1,67 @@ +/* memory.h - describe the memory map */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef _GRUB_MEMORY_MACHINE_LB_HEADER +#define _GRUB_MEMORY_MACHINE_LB_HEADER 1 + +#include +#include + +#ifndef ASM_FILE +#include +#endif + +#define GRUB_MEMORY_MACHINE_LOWER_USABLE 0x9fc00 /* 640 kiB - 1 kiB */ +#define GRUB_MEMORY_MACHINE_LOWER_SIZE 0xf0000 /* 960 kiB */ + +#define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ + +#ifndef ASM_FILE + +struct grub_linuxbios_table_header +{ + char signature[4]; + grub_uint32_t size; +}; +typedef struct grub_linuxbios_table_header *grub_linuxbios_table_header_t; + +struct grub_linuxbios_table_item +{ +#define GRUB_LINUXBIOS_MEMBER_UNUSED 0 +#define GRUB_LINUXBIOS_MEMBER_MEMORY 1 + grub_uint32_t tag; + grub_uint32_t size; +}; +typedef struct grub_linuxbios_table_item *grub_linuxbios_table_item_t; + +struct grub_linuxbios_mem_region +{ + grub_uint64_t addr; + grub_uint64_t size; +#define GRUB_MACHINE_MEMORY_AVAILABLE 1 + grub_uint32_t type; +}; +typedef struct grub_linuxbios_mem_region *mem_region_t; + +void EXPORT_FUNC(grub_machine_mmap_iterate) + (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); + +#endif + +#endif /* ! _GRUB_MEMORY_MACHINE_HEADER */ diff --git a/include/grub/i386/pc/init.h b/include/grub/i386/pc/init.h index 0c6a12934..1a031db1e 100644 --- a/include/grub/i386/pc/init.h +++ b/include/grub/i386/pc/init.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2004,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,8 @@ struct grub_machine_mmap_entry grub_uint32_t size; grub_uint64_t addr; grub_uint64_t len; +#define GRUB_MACHINE_MEMORY_AVAILABLE 1 +#define GRUB_MACHINE_MEMORY_RESERVED 2 grub_uint32_t type; } __attribute__((packed)); @@ -43,6 +45,9 @@ struct grub_machine_mmap_entry grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_machine_mmap_entry *entry, grub_uint32_t cont); +void EXPORT_FUNC(grub_machine_mmap_iterate) + (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); + /* Turn on/off Gate A20. */ void grub_gate_a20 (int on); diff --git a/include/grub/multiboot.h b/include/grub/multiboot.h index 6a1da055b..5285ea2f5 100644 --- a/include/grub/multiboot.h +++ b/include/grub/multiboot.h @@ -1,7 +1,7 @@ /* multiboot.h - multiboot header file with grub definitions. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -101,6 +101,16 @@ struct grub_multiboot_info grub_uint16_t vbe_interface_len; }; +struct grub_multiboot_mmap_entry +{ + grub_uint32_t size; + grub_uint64_t addr; + grub_uint64_t len; +#define GRUB_MULTIBOOT_MEMORY_AVAILABLE 1 +#define GRUB_MULTIBOOT_MEMORY_RESERVED 2 + grub_uint32_t type; +} __attribute__((packed)); + struct grub_mod_list { /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */ diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index f1861dda7..6890e9053 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -83,12 +83,9 @@ grub_machine_init (void) grub_lower_mem = GRUB_MEMORY_MACHINE_LOWER_USABLE; grub_upper_mem = 0; - auto int heap_init (mem_region_t); - int heap_init (mem_region_t mem_region) + auto int NESTED_FUNC_ATTR heap_init (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) { - grub_uint64_t addr = mem_region->addr; - grub_uint64_t size = mem_region->size; - #if GRUB_CPU_SIZEOF_VOID_P == 4 /* Restrict ourselves to 32-bit memory space. */ if (addr > ULONG_MAX) @@ -102,7 +99,7 @@ grub_machine_init (void) grub_upper_mem = grub_max (grub_upper_mem, addr + size); - if (mem_region->type != GRUB_LINUXBIOS_MEMORY_AVAILABLE) + if (type != GRUB_MACHINE_MEMORY_AVAILABLE) return 0; /* Avoid the lower memory. */ @@ -135,7 +132,7 @@ grub_machine_init (void) return 0; } - grub_available_iterate (heap_init); + grub_machine_mmap_iterate (heap_init); /* This variable indicates size, not offset. */ grub_upper_mem -= GRUB_MEMORY_MACHINE_UPPER_START; diff --git a/kern/i386/coreboot/mmap.c b/kern/i386/coreboot/mmap.c index dac89113a..b15369ee5 100644 --- a/kern/i386/coreboot/mmap.c +++ b/kern/i386/coreboot/mmap.c @@ -63,8 +63,8 @@ signature_found: return 0; } -grub_err_t -grub_available_iterate (int (*hook) (mem_region_t)) +void +grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) { mem_region_t mem_region; @@ -77,10 +77,16 @@ grub_available_iterate (int (*hook) (mem_region_t)) mem_region = (mem_region_t) ((long) table_item + sizeof (struct grub_linuxbios_table_item)); - for (; (long) mem_region < (long) table_item + (long) table_item->size; - mem_region++) - if (hook (mem_region)) - return 1; + while ((long) mem_region < (long) table_item + (long) table_item->size) + { + if (hook (mem_region->addr, mem_region->size, + /* Multiboot mmaps match with the coreboot mmap definition. + Therefore, we can just pass type through. */ + mem_region->type)) + return 1; + + mem_region++; + } return 0; } diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 955a52f08..c604e9352 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -132,9 +132,6 @@ compact_mem_regions (void) void grub_machine_init (void) { - grub_uint32_t cont; - struct grub_machine_mmap_entry *entry - = (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; int i; /* Initialize the console as early as possible. */ @@ -156,55 +153,35 @@ grub_machine_init (void) add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END, grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END); - /* Check if grub_get_mmap_entry works. */ - cont = grub_get_mmap_entry (entry, 0); - - if (entry->size) - do - { - /* Avoid the lower memory. */ - if (entry->addr < 0x100000) - { - if (entry->len <= 0x100000 - entry->addr) - goto next; - - entry->len -= 0x100000 - entry->addr; - entry->addr = 0x100000; - } - - /* Ignore >4GB. */ - if (entry->addr <= 0xFFFFFFFF && entry->type == 1) - { - grub_addr_t addr; - grub_size_t len; - - addr = (grub_addr_t) entry->addr; - len = ((addr + entry->len > 0xFFFFFFFF) - ? 0xFFFFFFFF - addr - : (grub_size_t) entry->len); - add_mem_region (addr, len); - } - - next: - if (! cont) - break; - - cont = grub_get_mmap_entry (entry, cont); - } - while (entry->size); - else + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) { - grub_uint32_t eisa_mmap = grub_get_eisa_mmap (); - - if (eisa_mmap) + /* Avoid the lower memory. */ + if (addr < 0x100000) { - add_mem_region (0x100000, (eisa_mmap & 0xFFFF) << 10); - add_mem_region (0x1000000, eisa_mmap & ~0xFFFF); + if (size <= 0x100000 - addr) + return 0; + + size -= 0x100000 - addr; + addr = 0x100000; } - else - add_mem_region (0x100000, grub_get_memsize (1) << 10); + + /* Ignore >4GB. */ + if (addr <= 0xFFFFFFFF && type == GRUB_MACHINE_MEMORY_AVAILABLE) + { + grub_size_t len; + + len = (grub_size_t) ((addr + size > 0xFFFFFFFF) + ? 0xFFFFFFFF - addr + : size); + add_mem_region (addr, len); + } + + return 0; } + grub_machine_mmap_iterate (hook); + compact_mem_regions (); /* Add the memory regions to free memory, except for the region starting diff --git a/kern/i386/pc/mmap.c b/kern/i386/pc/mmap.c new file mode 100644 index 000000000..47aa53cff --- /dev/null +++ b/kern/i386/pc/mmap.c @@ -0,0 +1,60 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +void +grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) +{ + grub_uint32_t cont; + struct grub_machine_mmap_entry *entry + = (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + + /* Check if grub_get_mmap_entry works. */ + cont = grub_get_mmap_entry (entry, 0); + + if (entry->size) + do + { + if (hook (entry->addr, entry->len, + /* Multiboot mmaps have been defined to match with the E820 definition. + Therefore, we can just pass type through. */ + entry->type)) + break; + + if (! cont) + break; + + cont = grub_get_mmap_entry (entry, cont); + } + while (entry->size); + else + { + grub_uint32_t eisa_mmap = grub_get_eisa_mmap (); + + if (eisa_mmap) + { + if (hook (0x100000, (eisa_mmap & 0xFFFF) << 10, GRUB_MACHINE_MEMORY_AVAILABLE) == 0) + hook (0x1000000, eisa_mmap & ~0xFFFF, GRUB_MACHINE_MEMORY_AVAILABLE); + } + else + hook (0x100000, grub_get_memsize (1) << 10, GRUB_MACHINE_MEMORY_AVAILABLE); + } +} diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index b9b4a9e29..fe8a1e9c1 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -78,14 +78,60 @@ grub_multiboot_unload (void) grub_free ((void *) mbi->cmdline); grub_free (mbi); } - - + mbi = 0; grub_dl_unref (my_mod); return GRUB_ERR_NONE; } +/* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated + by the spec. Is there something we can do about it? */ +static grub_uint32_t mmap_addr = 0; +static grub_uint32_t mmap_length; + +/* Return the length of the Multiboot mmap that will be needed to allocate + our platform's map. */ +static grub_uint32_t +grub_get_multiboot_mmap_len () +{ + grub_size_t count = 0; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + grub_uint32_t type __attribute__ ((unused))) + { + count++; + return 0; + } + + grub_machine_mmap_iterate (hook); + + return count * sizeof (struct grub_multiboot_mmap_entry); +} + +/* Fill previously allocated Multiboot mmap. */ +static void +grub_fill_multiboot_mmap (struct grub_multiboot_mmap_entry *first_entry) +{ + struct grub_multiboot_mmap_entry *mmap_entry = (struct grub_multiboot_mmap_entry *) first_entry; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) + { + mmap_entry->addr = addr; + mmap_entry->len = size; + mmap_entry->type = type; + mmap_entry->size = sizeof (struct grub_multiboot_mmap_entry) - sizeof (mmap_entry->size); + mmap_entry++; + + return 0; + } + + grub_machine_mmap_iterate (hook); +} + /* Check if BUFFER contains ELF32. */ static int grub_multiboot_is_elf32 (void *buffer) @@ -127,7 +173,7 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) if (phdr(i)->p_paddr > phdr(highest_segment)->p_paddr) highest_segment = i; } - grub_multiboot_payload_size = (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; + grub_multiboot_payload_size += (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); @@ -379,6 +425,9 @@ grub_multiboot (int argc, char *argv[]) playground = NULL; } + mmap_length = grub_get_multiboot_mmap_len (); + grub_multiboot_payload_size = mmap_length; + if (header->flags & MULTIBOOT_AOUT_KLUDGE) { int offset = ((char *) header - buffer - @@ -387,9 +436,9 @@ grub_multiboot (int argc, char *argv[]) header->load_end_addr - header->load_addr); if (header->bss_end_addr) - grub_multiboot_payload_size = (header->bss_end_addr - header->load_addr); + grub_multiboot_payload_size += (header->bss_end_addr - header->load_addr); else - grub_multiboot_payload_size = load_size; + grub_multiboot_payload_size += load_size; grub_multiboot_payload_dest = header->load_addr; playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); @@ -416,6 +465,12 @@ grub_multiboot (int argc, char *argv[]) goto fail; + grub_fill_multiboot_mmap ((struct grub_mmap_entry *) (grub_multiboot_payload_orig + + grub_multiboot_payload_size + - mmap_length)); + + mmap_addr = grub_multiboot_payload_dest + grub_multiboot_payload_size - mmap_length; + if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) { grub_memmove (playground, &grub_multiboot_forward_relocator, RELOCATOR_SIZEOF(forward)); @@ -439,11 +494,14 @@ grub_multiboot (int argc, char *argv[]) grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); - mbi->flags = MULTIBOOT_INFO_MEMORY; - /* Convert from bytes to kilobytes. */ mbi->mem_lower = grub_lower_mem / 1024; mbi->mem_upper = grub_upper_mem / 1024; + mbi->flags |= MULTIBOOT_INFO_MEMORY; + + mbi->mmap_addr = mmap_addr; + mbi->mmap_length = mmap_length; + mbi->flags |= MULTIBOOT_INFO_MEM_MAP; for (i = 0, len = 0; i < argc; i++) len += grub_strlen (argv[i]) + 1; From 38487ddbd22c9ae97b008ba2ffdd023264dd508b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 17 Aug 2008 20:28:00 +0000 Subject: [PATCH 0362/1707] 2008-08-17 Robert Millan * include/grub/x86_64/kernel.h: New file ( stub). --- ChangeLog | 4 ++++ DISTLIST | 2 ++ include/grub/x86_64/kernel.h | 1 + 3 files changed, 7 insertions(+) create mode 100644 include/grub/x86_64/kernel.h diff --git a/ChangeLog b/ChangeLog index abb359e35..6793aa77a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-17 Robert Millan + + * include/grub/x86_64/kernel.h: New file ( stub). + 2008-08-17 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/pc/mmap.c'. diff --git a/DISTLIST b/DISTLIST index 91cbdbc0c..5718718b4 100644 --- a/DISTLIST +++ b/DISTLIST @@ -267,6 +267,7 @@ include/grub/util/lvm.h include/grub/util/misc.h include/grub/util/raid.h include/grub/util/resolve.h +include/grub/x86_64/kernel.h include/grub/x86_64/linux.h include/grub/x86_64/pci.h include/grub/x86_64/setjmp.h @@ -317,6 +318,7 @@ kern/i386/ieee1275/startup.S kern/i386/pc/init.c kern/i386/pc/lzma_decode.S kern/i386/pc/lzo1x.S +kern/i386/pc/mmap.c kern/i386/pc/startup.S kern/ieee1275/cmain.c kern/ieee1275/ieee1275.c diff --git a/include/grub/x86_64/kernel.h b/include/grub/x86_64/kernel.h new file mode 100644 index 000000000..25ac57e40 --- /dev/null +++ b/include/grub/x86_64/kernel.h @@ -0,0 +1 @@ +#include From 7f42f83e87fe77ab58736901bca78bc0e5bf0b29 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 18 Aug 2008 13:01:01 +0000 Subject: [PATCH 0363/1707] 2008-08-18 Robert Millan * include/grub/i386/linux.h (LINUX_LOADER_ID_LILO) (LINUX_LOADER_ID_LOADLIN, LINUX_LOADER_ID_BOOTSECT) (LINUX_LOADER_ID_SYSLINUX, LINUX_LOADER_ID_ETHERBOOT) (LINUX_LOADER_ID_ELILO, LINUX_LOADER_ID_GRUB, LINUX_LOADER_ID_UBOOT) (LINUX_LOADER_ID_XEN, LINUX_LOADER_ID_GUJIN, LINUX_LOADER_ID_QEMU): New macros. (GRUB_LINUX_CL_OFFSET, GRUB_LINUX_CL_END_OFFSET): Move from here ... * loader/i386/pc/linux.c (GRUB_LINUX_CL_OFFSET) (GRUB_LINUX_CL_END_OFFSET): ... to here. * loader/i386/efi/linux.c (GRUB_EFI_CL_OFFSET): Rename to ... (GRUB_LINUX_CL_OFFSET): ... this. Update all users. (GRUB_EFI_CL_END_OFFSET): Rename to ... (GRUB_LINUX_CL_END_OFFSET): ... this. Update all users. (grub_rescue_cmd_linux): Macroify `type_of_loader' initialization. Initialize `params->video_cursor_x' and `params->video_cursor_y' portably using grub_getxy(). Replace `-EFI' with `-bzImage' in boot message. --- ChangeLog | 20 ++++++++++++++++++++ include/grub/i386/linux.h | 13 +++++++++++-- loader/i386/efi/linux.c | 22 +++++++++++----------- loader/i386/pc/linux.c | 3 +++ 4 files changed, 45 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6793aa77a..23ddf4069 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2008-08-18 Robert Millan + + * include/grub/i386/linux.h (LINUX_LOADER_ID_LILO) + (LINUX_LOADER_ID_LOADLIN, LINUX_LOADER_ID_BOOTSECT) + (LINUX_LOADER_ID_SYSLINUX, LINUX_LOADER_ID_ETHERBOOT) + (LINUX_LOADER_ID_ELILO, LINUX_LOADER_ID_GRUB, LINUX_LOADER_ID_UBOOT) + (LINUX_LOADER_ID_XEN, LINUX_LOADER_ID_GUJIN, LINUX_LOADER_ID_QEMU): + New macros. + (GRUB_LINUX_CL_OFFSET, GRUB_LINUX_CL_END_OFFSET): Move from here ... + * loader/i386/pc/linux.c (GRUB_LINUX_CL_OFFSET) + (GRUB_LINUX_CL_END_OFFSET): ... to here. + * loader/i386/efi/linux.c (GRUB_EFI_CL_OFFSET): Rename to ... + (GRUB_LINUX_CL_OFFSET): ... this. Update all users. + (GRUB_EFI_CL_END_OFFSET): Rename to ... + (GRUB_LINUX_CL_END_OFFSET): ... this. Update all users. + (grub_rescue_cmd_linux): Macroify `type_of_loader' initialization. + Initialize `params->video_cursor_x' and `params->video_cursor_y' + portably using grub_getxy(). + Replace `-EFI' with `-bzImage' in boot message. + 2008-08-17 Robert Millan * include/grub/x86_64/kernel.h: New file ( stub). diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 2c6873c4d..ae0de6d98 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -39,8 +39,6 @@ #define GRUB_LINUX_VID_MODE_EXTENDED 0xFFFE #define GRUB_LINUX_VID_MODE_ASK 0xFFFD -#define GRUB_LINUX_CL_OFFSET 0x9000 -#define GRUB_LINUX_CL_END_OFFSET 0x90FF #define GRUB_LINUX_SETUP_MOVE_SIZE 0x9100 #define GRUB_LINUX_CL_MAGIC 0xA33F @@ -104,6 +102,17 @@ struct linux_kernel_header grub_uint16_t start_sys; /* The load-low segment (obsolete) */ grub_uint16_t kernel_version; /* Points to kernel version string */ grub_uint8_t type_of_loader; /* Boot loader identifier */ +#define LINUX_LOADER_ID_LILO 0x0 +#define LINUX_LOADER_ID_LOADLIN 0x1 +#define LINUX_LOADER_ID_BOOTSECT 0x2 +#define LINUX_LOADER_ID_SYSLINUX 0x3 +#define LINUX_LOADER_ID_ETHERBOOT 0x4 +#define LINUX_LOADER_ID_ELILO 0x5 +#define LINUX_LOADER_ID_GRUB 0x7 +#define LINUX_LOADER_ID_UBOOT 0x8 +#define LINUX_LOADER_ID_XEN 0x9 +#define LINUX_LOADER_ID_GUJIN 0xa +#define LINUX_LOADER_ID_QEMU 0xb grub_uint8_t loadflags; /* Boot protocol option flags */ grub_uint16_t setup_move_size; /* Move to high memory size */ grub_uint32_t code32_start; /* Boot loader hook */ diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 545117ed4..50e1ff1c8 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,8 +33,8 @@ #include #include -#define GRUB_EFI_CL_OFFSET 0x1000 -#define GRUB_EFI_CL_END_OFFSET 0x2000 +#define GRUB_LINUX_CL_OFFSET 0x1000 +#define GRUB_LINUX_CL_END_OFFSET 0x2000 #define NEXT_MEMORY_DESCRIPTOR(desc, size) \ ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) @@ -166,7 +166,7 @@ allocate_pages (grub_size_t prot_size) grub_size_t real_size; /* Make sure that each size is aligned to a page boundary. */ - real_size = GRUB_EFI_CL_END_OFFSET; + real_size = GRUB_LINUX_CL_END_OFFSET; prot_size = page_align (prot_size); mmap_size = find_mmap_size (); @@ -634,7 +634,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) goto fail; params = (struct linux_kernel_params *) real_mode_mem; - grub_memset (params, 0, GRUB_EFI_CL_END_OFFSET); + grub_memset (params, 0, GRUB_LINUX_CL_END_OFFSET); grub_memcpy (¶ms->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); params->ps_mouse = params->padding10 = 0; @@ -647,7 +647,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) } /* XXX Linux assumes that only elilo can boot Linux on EFI!!! */ - params->type_of_loader = 0x50; + params->type_of_loader = (LINUX_LOADER_ID_ELILO << 4); params->cl_magic = GRUB_LINUX_CL_MAGIC; params->cl_offset = 0x1000; @@ -664,8 +664,8 @@ grub_rescue_cmd_linux (int argc, char *argv[]) params->ext_mem = ((32 * 0x100000) >> 10); params->alt_mem = ((32 * 0x100000) >> 10); - params->video_cursor_x = grub_efi_system_table->con_out->mode->cursor_column; - params->video_cursor_y = grub_efi_system_table->con_out->mode->cursor_row; + params->video_cursor_x = grub_getxy () >> 8; + params->video_cursor_y = grub_getxy () & 0xff; params->video_page = 0; /* ??? */ params->video_mode = grub_efi_system_table->con_out->mode->mode; params->video_width = (grub_getwh () >> 8); @@ -758,7 +758,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_file_seek (file, real_size + GRUB_DISK_SECTOR_SIZE); /* XXX there is no way to know if the kernel really supports EFI. */ - grub_printf (" [Linux-EFI, setup=0x%x, size=0x%x]\n", + grub_printf (" [Linux-bzImage, setup=0x%x, size=0x%x]\n", (unsigned) real_size, (unsigned) prot_size); /* Detect explicitly specified memory size, if any. */ @@ -814,7 +814,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) } /* Specify the boot file. */ - dest = grub_stpcpy ((char *) real_mode_mem + GRUB_EFI_CL_OFFSET, + dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, "BOOT_IMAGE="); dest = grub_stpcpy (dest, argv[0]); @@ -822,7 +822,7 @@ grub_rescue_cmd_linux (int argc, char *argv[]) for (i = 1; i < argc && dest + grub_strlen (argv[i]) + 1 < ((char *) real_mode_mem - + GRUB_EFI_CL_END_OFFSET); + + GRUB_LINUX_CL_END_OFFSET); i++) { *dest++ = ' '; diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index aaa413411..cd6ea3f0a 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -31,6 +31,9 @@ #include #include +#define GRUB_LINUX_CL_OFFSET 0x9000 +#define GRUB_LINUX_CL_END_OFFSET 0x90FF + static grub_dl_t my_mod; static grub_size_t linux_mem_size; From dd6bd6abb9b5e34d3bbf1b5ce2feb2b2fca80739 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 18 Aug 2008 13:46:31 +0000 Subject: [PATCH 0364/1707] 2008-08-18 Robert Millan Unify (identical) linux_normal.c files. * loader/i386/efi/linux_normal.c: Move from here ... * loader/linux_normal.c: ... to here. Update all users. * loader/i386/pc/linux_normal.c: Delete. Update all users. * loader/i386/ieee1275/linux_normal.c: Likewise. --- ChangeLog | 8 ++++ DISTLIST | 4 +- conf/i386-coreboot.mk | 36 ++++++++--------- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.mk | 36 ++++++++--------- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.mk | 36 ++++++++--------- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.mk | 49 +++++++++++++---------- conf/i386-pc.rmk | 2 +- conf/x86_64-efi.mk | 36 ++++++++--------- conf/x86_64-efi.rmk | 2 +- loader/i386/ieee1275/linux_normal.c | 60 ---------------------------- loader/i386/pc/linux_normal.c | 60 ---------------------------- loader/{i386/efi => }/linux_normal.c | 0 15 files changed, 113 insertions(+), 222 deletions(-) delete mode 100644 loader/i386/ieee1275/linux_normal.c delete mode 100644 loader/i386/pc/linux_normal.c rename loader/{i386/efi => }/linux_normal.c (100%) diff --git a/ChangeLog b/ChangeLog index 23ddf4069..144a5311d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-18 Robert Millan + + Unify (identical) linux_normal.c files. + * loader/i386/efi/linux_normal.c: Move from here ... + * loader/linux_normal.c: ... to here. Update all users. + * loader/i386/pc/linux_normal.c: Delete. Update all users. + * loader/i386/ieee1275/linux_normal.c: Likewise. + 2008-08-18 Robert Millan * include/grub/i386/linux.h (LINUX_LOADER_ID_LILO) diff --git a/DISTLIST b/DISTLIST index 5718718b4..b18d8d230 100644 --- a/DISTLIST +++ b/DISTLIST @@ -344,6 +344,7 @@ lib/LzmaEnc.c lib/efi/datetime.c lib/i386/datetime.c loader/aout.c +loader/linux_normal.c loader/multiboot2.c loader/multiboot_loader.c loader/multiboot_loader_normal.c @@ -353,13 +354,10 @@ loader/efi/chainloader_normal.c loader/i386/bsd.c loader/i386/bsd_normal.c loader/i386/efi/linux.c -loader/i386/efi/linux_normal.c loader/i386/ieee1275/linux.c -loader/i386/ieee1275/linux_normal.c loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c -loader/i386/pc/linux_normal.c loader/i386/pc/multiboot2.c loader/i386/pc/multiboot.c loader/i386/pc/multiboot_normal.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 62efd6695..06bd2af97 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -618,13 +618,13 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/pc/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_pc_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/linux_normal.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -633,9 +633,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_pc_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -652,23 +652,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_pc_linux_normal.d +linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_i386_pc_linux_normal.lst partmap-linux_mod-loader_i386_pc_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst -FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_pc_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst +COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst +FSFILES += fs-linux_mod-loader_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst -cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 34b3b40ed..9b5f31a6b 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -103,7 +103,7 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/pc/linux_normal.c +linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 3c322af0f..66def1151 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -1292,13 +1292,13 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/efi/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/linux_normal.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1307,9 +1307,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_efi_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1326,23 +1326,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_efi_linux_normal.d +linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst fs-linux_mod-loader_i386_efi_linux_normal.lst partmap-linux_mod-loader_i386_efi_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst -FSFILES += fs-linux_mod-loader_i386_efi_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst +COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst +FSFILES += fs-linux_mod-loader_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst -cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index ef7d8a293..98482ce7f 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -139,7 +139,7 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/efi/linux_normal.c +linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 58cd310dc..9d396b009 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -1459,13 +1459,13 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/ieee1275/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_ieee1275_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/linux_normal.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_i386_ieee1275_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1474,9 +1474,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_ieee1275_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_ieee1275_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1493,23 +1493,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_ieee1275_linux_normal.o: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_ieee1275_linux_normal.d +linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_ieee1275_linux_normal.lst fs-linux_mod-loader_i386_ieee1275_linux_normal.lst partmap-linux_mod-loader_i386_ieee1275_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_i386_ieee1275_linux_normal.lst -FSFILES += fs-linux_mod-loader_i386_ieee1275_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_ieee1275_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst +COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst +FSFILES += fs-linux_mod-loader_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst -cmd-linux_mod-loader_i386_ieee1275_linux_normal.lst: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_ieee1275_linux_normal.lst: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_i386_ieee1275_linux_normal.lst: loader/i386/ieee1275/linux_normal.c $(loader/i386/ieee1275/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index d62a65610..7cf5183be 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -158,7 +158,7 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/ieee1275/linux_normal.c +linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index c1beaac9b..483a5e907 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -109,20 +109,21 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/time.c \ - kern/i386/dl.c kern/i386/pc/init.c kern/parser.c kern/partition.c \ + kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ + kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ term/i386/pc/console.c \ symlist.c -CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o -MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d +CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o +MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d kernel.img: kernel.exec $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ -kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o +kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) @@ -189,6 +190,10 @@ kernel_img-kern_i386_pc_init.o: kern/i386/pc/init.c $(kern/i386/pc/init.c_DEPEND $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_pc_init.d +kernel_img-kern_i386_pc_mmap.o: kern/i386/pc/mmap.c $(kern/i386/pc/mmap.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_i386_pc_mmap.d + kernel_img-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_parser.d @@ -1136,13 +1141,13 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/pc/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_pc_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/linux_normal.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1151,9 +1156,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_pc_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1170,23 +1175,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_pc_linux_normal.o: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_pc_linux_normal.d +linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst fs-linux_mod-loader_i386_pc_linux_normal.lst partmap-linux_mod-loader_i386_pc_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux_normal.lst -FSFILES += fs-linux_mod-loader_i386_pc_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_pc_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst +COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst +FSFILES += fs-linux_mod-loader_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst -cmd-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_i386_pc_linux_normal.lst: loader/i386/pc/linux_normal.c $(loader/i386/pc/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index a2ab94def..83b1d713b 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -188,7 +188,7 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/pc/linux_normal.c +linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index dae199d51..0bfab7b59 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -1295,13 +1295,13 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/efi/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/linux_normal.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1310,9 +1310,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_efi_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1329,23 +1329,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_efi_linux_normal.o: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_efi_linux_normal.d +linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_linux_normal.d -CLEANFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst fs-linux_mod-loader_i386_efi_linux_normal.lst partmap-linux_mod-loader_i386_efi_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux_normal.lst -FSFILES += fs-linux_mod-loader_i386_efi_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst +COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst +FSFILES += fs-linux_mod-loader_linux_normal.lst +PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst -cmd-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_i386_efi_linux_normal.lst: loader/i386/efi/linux_normal.c $(loader/i386/efi/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 473c34e1d..92213b9c9 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -141,7 +141,7 @@ _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/efi/linux_normal.c +linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/loader/i386/ieee1275/linux_normal.c b/loader/i386/ieee1275/linux_normal.c deleted file mode 100644 index 0206f76d7..000000000 --- a/loader/i386/ieee1275/linux_normal.c +++ /dev/null @@ -1,60 +0,0 @@ -/* linux_normal.c - boot another boot loader */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static grub_err_t -grub_normal_linux_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_linux (argc, args); - return grub_errno; -} - - -static grub_err_t -grub_normal_initrd_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_initrd (argc, args); - return grub_errno; -} - -GRUB_MOD_INIT(linux_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("linux", grub_normal_linux_command, - GRUB_COMMAND_FLAG_BOTH, - "linux FILE [ARGS...]", - "Load a linux kernel.", 0); - - grub_register_command ("initrd", grub_normal_initrd_command, - GRUB_COMMAND_FLAG_BOTH, - "initrd FILE", - "Load an initrd.", 0); -} - -GRUB_MOD_FINI(linux_normal) -{ - grub_unregister_command ("linux"); - grub_unregister_command ("initrd"); -} diff --git a/loader/i386/pc/linux_normal.c b/loader/i386/pc/linux_normal.c deleted file mode 100644 index 69fcebbe7..000000000 --- a/loader/i386/pc/linux_normal.c +++ /dev/null @@ -1,60 +0,0 @@ -/* linux_normal.c - boot another boot loader */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static grub_err_t -grub_normal_linux_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_linux (argc, args); - return grub_errno; -} - - -static grub_err_t -grub_normal_initrd_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_initrd (argc, args); - return grub_errno; -} - -GRUB_MOD_INIT(linux_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("linux", grub_normal_linux_command, - GRUB_COMMAND_FLAG_BOTH, - "linux FILE [ARGS...]", - "Load a linux kernel.", 0); - - grub_register_command ("initrd", grub_normal_initrd_command, - GRUB_COMMAND_FLAG_BOTH, - "initrd FILE", - "Load an initrd.", 0); -} - -GRUB_MOD_FINI(linux_normal) -{ - grub_unregister_command ("linux"); - grub_unregister_command ("initrd"); -} diff --git a/loader/i386/efi/linux_normal.c b/loader/linux_normal.c similarity index 100% rename from loader/i386/efi/linux_normal.c rename to loader/linux_normal.c From f9dbfc961ecd2cb1cdfa84c2263e080eafb42ccb Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 19 Aug 2008 19:20:33 +0000 Subject: [PATCH 0365/1707] 2008-08-19 Robert Millan * term/gfxterm.c (DEFAULT_CURSOR_COLOR): Remove. (struct grub_virtual_screen): Remove `cursor_color'. (grub_virtual_screen_setup): Remove `virtual_screen.cursor_color' initialization. (write_cursor): Use `virtual_screen.fg_color' to draw cursor. --- ChangeLog | 8 ++++++++ term/gfxterm.c | 6 +----- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 144a5311d..9256549d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-19 Robert Millan + + * term/gfxterm.c (DEFAULT_CURSOR_COLOR): Remove. + (struct grub_virtual_screen): Remove `cursor_color'. + (grub_virtual_screen_setup): Remove `virtual_screen.cursor_color' + initialization. + (write_cursor): Use `virtual_screen.fg_color' to draw cursor. + 2008-08-18 Robert Millan Unify (identical) linux_normal.c files. diff --git a/term/gfxterm.c b/term/gfxterm.c index eb5136518..8efcd91a2 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -42,7 +42,6 @@ #define DEFAULT_STANDARD_COLOR 0x07 #define DEFAULT_NORMAL_COLOR 0x07 #define DEFAULT_HIGHLIGHT_COLOR 0x70 -#define DEFAULT_CURSOR_COLOR 0x07 struct grub_dirty_region { @@ -100,7 +99,6 @@ struct grub_virtual_screen /* Color settings. */ grub_video_color_t fg_color; grub_video_color_t bg_color; - grub_video_color_t cursor_color; /* Text buffer for virtual screen. Contains (columns * rows) number of entries. */ @@ -219,8 +217,6 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, set_term_color (virtual_screen.term_color); - virtual_screen.cursor_color = grub_video_map_color (DEFAULT_CURSOR_COLOR); - grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); return grub_errno; @@ -709,7 +705,7 @@ write_cursor (void) width = virtual_screen.char_width; height = 2; - color = virtual_screen.cursor_color; + color = virtual_screen.fg_color; /* Render cursor to text layer. */ grub_video_set_active_render_target (text_layer); From e290bef2e1f06e255253f7ae4524b15cf96e105a Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 20 Aug 2008 10:07:56 +0000 Subject: [PATCH 0366/1707] 2008-08-20 Carles Pina i Estany * menu/normal.c (run_menu): Replace hardcoded numbers with macros (16 for GRUB_TERM_UP and 14 for GRUB_TERM_DOWN) --- ChangeLog | 5 +++++ normal/menu.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9256549d6..88394b853 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-20 Carles Pina i Estany + + * menu/normal.c (run_menu): Replace hardcoded numbers with macros + (16 for GRUB_TERM_UP and 14 for GRUB_TERM_DOWN) + 2008-08-19 Robert Millan * term/gfxterm.c (DEFAULT_CURSOR_COLOR): Remove. diff --git a/normal/menu.c b/normal/menu.c index 279dd5877..d6fc0a33e 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -421,7 +421,7 @@ run_menu (grub_menu_t menu, int nested) print_entries (menu, first, offset); break; - case 16: + case GRUB_TERM_UP: case '^': if (offset > 0) { @@ -438,7 +438,7 @@ run_menu (grub_menu_t menu, int nested) } break; - case 14: + case GRUB_TERM_DOWN: case 'v': if (menu->size > first + offset + 1) { From c9baafe713c91f78118f5235a1bb62eaf87a1557 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 21 Aug 2008 13:18:07 +0000 Subject: [PATCH 0367/1707] 2008-08-21 Robert Millan * loader/i386/linux.c: New file. Implements generic 32-bit Linux loader. * conf/i386-coreboot.rmk (_linux_mod_SOURCES): Replace `loader/i386/pc/linux.c' with `loader/i386/linux.c'. --- ChangeLog | 7 + DISTLIST | 1 + conf/i386-coreboot.mk | 36 +-- conf/i386-coreboot.rmk | 2 +- loader/i386/linux.c | 570 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 597 insertions(+), 19 deletions(-) create mode 100644 loader/i386/linux.c diff --git a/ChangeLog b/ChangeLog index 88394b853..19603ad9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-08-21 Robert Millan + + * loader/i386/linux.c: New file. Implements generic 32-bit Linux + loader. + * conf/i386-coreboot.rmk (_linux_mod_SOURCES): Replace + `loader/i386/pc/linux.c' with `loader/i386/linux.c'. + 2008-08-20 Carles Pina i Estany * menu/normal.c (run_menu): Replace hardcoded numbers with macros diff --git a/DISTLIST b/DISTLIST index b18d8d230..213d87dc2 100644 --- a/DISTLIST +++ b/DISTLIST @@ -353,6 +353,7 @@ loader/efi/chainloader.c loader/efi/chainloader_normal.c loader/i386/bsd.c loader/i386/bsd_normal.c +loader/i386/linux.c loader/i386/efi/linux.c loader/i386/ieee1275/linux.c loader/i386/pc/chainloader.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 06bd2af97..244f49e37 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -561,13 +561,13 @@ pkglib_MODULES = _linux.mod linux.mod normal.mod \ halt.mod datetime.mod date.mod datehook.mod # For _linux.mod. -_linux_mod_SOURCES = loader/i386/pc/linux.c -CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_pc_linux.o und-_linux.lst +_linux_mod_SOURCES = loader/i386/linux.c +CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_linux.o und-_linux.lst ifneq ($(_linux_mod_EXPORTS),no) CLEANFILES += def-_linux.lst DEFSYMFILES += def-_linux.lst endif -MOSTLYCLEANFILES += _linux_mod-loader_i386_pc_linux.d +MOSTLYCLEANFILES += _linux_mod-loader_i386_linux.d UNDSYMFILES += und-_linux.lst _linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) @@ -576,9 +576,9 @@ _linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_pc_linux.o +pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_linux.o -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_pc_linux.o + $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_linux.o mod-_linux.o: mod-_linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< @@ -595,23 +595,23 @@ und-_linux.lst: pre-_linux.o echo '_linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< --include _linux_mod-loader_i386_pc_linux.d +_linux_mod-loader_i386_linux.o: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< +-include _linux_mod-loader_i386_linux.d -CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_pc_linux.lst partmap-_linux_mod-loader_i386_pc_linux.lst -COMMANDFILES += cmd-_linux_mod-loader_i386_pc_linux.lst -FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst -PARTMAPFILES += partmap-_linux_mod-loader_i386_pc_linux.lst +CLEANFILES += cmd-_linux_mod-loader_i386_linux.lst fs-_linux_mod-loader_i386_linux.lst partmap-_linux_mod-loader_i386_linux.lst +COMMANDFILES += cmd-_linux_mod-loader_i386_linux.lst +FSFILES += fs-_linux_mod-loader_i386_linux.lst +PARTMAPFILES += partmap-_linux_mod-loader_i386_linux.lst -cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) +cmd-_linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) -fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) +fs-_linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) -partmap-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) +partmap-_linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) _linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 9b5f31a6b..26b545569 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -98,7 +98,7 @@ pkglib_MODULES = _linux.mod linux.mod normal.mod \ halt.mod datetime.mod date.mod datehook.mod # For _linux.mod. -_linux_mod_SOURCES = loader/i386/pc/linux.c +_linux_mod_SOURCES = loader/i386/linux.c _linux_mod_CFLAGS = $(COMMON_CFLAGS) _linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/loader/i386/linux.c b/loader/i386/linux.c new file mode 100644 index 000000000..20aea990b --- /dev/null +++ b/loader/i386/linux.c @@ -0,0 +1,570 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define GRUB_LINUX_CL_OFFSET 0x1000 +#define GRUB_LINUX_CL_END_OFFSET 0x2000 + +static grub_dl_t my_mod; + +static grub_size_t linux_mem_size; +static int loaded; +static void *real_mode_mem; +static void *prot_mode_mem; +static void *initrd_mem; +static grub_uint32_t real_mode_pages; +static grub_uint32_t prot_mode_pages; +static grub_uint32_t initrd_pages; + +static grub_uint8_t gdt[] __attribute__ ((aligned(16))) = + { + /* NULL. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* Reserved. */ + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + /* Code segment. */ + 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00, + /* Data segment. */ + 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00 + }; + +struct gdt_descriptor +{ + grub_uint16_t limit; + void *base; +} __attribute__ ((packed)); + +static struct gdt_descriptor gdt_desc = + { + sizeof (gdt) - 1, + gdt + }; + +struct idt_descriptor +{ + grub_uint16_t limit; + void *base; +} __attribute__ ((packed)); + +static struct idt_descriptor idt_desc = + { + 0, + 0 + }; + +static inline grub_size_t +page_align (grub_size_t size) +{ + return (size + (1 << 12) - 1) & (~((1 << 12) - 1)); +} + +/* Find the optimal number of pages for the memory map. */ +static grub_size_t +find_mmap_size (void) +{ + grub_size_t count = 0, mmap_size; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + grub_uint32_t type __attribute__ ((unused))) + { + count++; + return 0; + } + + grub_machine_mmap_iterate (hook); + + mmap_size = count * sizeof (struct grub_e820_mmap); + + /* Increase the size a bit for safety, because GRUB allocates more on + later. */ + mmap_size += (1 << 12); + + return page_align (mmap_size); +} + +static void +free_pages (void) +{ + real_mode_mem = prot_mode_mem = initrd_mem = 0; +} + +/* Allocate pages for the real mode code and the protected mode code + for linux as well as a memory map buffer. */ +static int +allocate_pages (grub_size_t prot_size) +{ + grub_size_t real_size, mmap_size; + + /* Make sure that each size is aligned to a page boundary. */ + real_size = GRUB_LINUX_CL_END_OFFSET; + prot_size = page_align (prot_size); + mmap_size = find_mmap_size (); + + grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n", + (unsigned) real_size, (unsigned) prot_size, (unsigned) mmap_size); + + /* Calculate the number of pages; Combine the real mode code with + the memory map buffer for simplicity. */ + real_mode_pages = ((real_size + mmap_size) >> 12); + prot_mode_pages = (prot_size >> 12); + + /* Initialize the memory pointers with NULL for convenience. */ + real_mode_mem = 0; + prot_mode_mem = 0; + + real_mode_mem = grub_malloc (real_mode_pages << 12); + + if (! real_mode_mem) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate real mode pages"); + goto fail; + } + + /* Next, find free pages for the protected mode code. */ + /* XXX what happens if anything is using this address? */ + prot_mode_mem = (void *) 0x100000; + if (! prot_mode_mem) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "cannot allocate protected mode pages"); + goto fail; + } + + grub_dprintf ("linux", "real_mode_mem = %lx, real_mode_pages = %x, " + "prot_mode_mem = %lx, prot_mode_pages = %x\n", + (unsigned long) real_mode_mem, (unsigned) real_mode_pages, + (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); + + return 1; + + fail: + free_pages (); + return 0; +} + +static void +grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, + grub_uint64_t start, grub_uint64_t size, + grub_uint32_t type) +{ + int n = *e820_num; + + if (n >= GRUB_E820_MAX_ENTRY) + grub_fatal ("Too many e820 memory map entries"); + + if ((n > 0) && (e820_map[n - 1].addr + e820_map[n - 1].size == start) && + (e820_map[n - 1].type == type)) + e820_map[n - 1].size += size; + else + { + e820_map[n].addr = start; + e820_map[n].size = size; + e820_map[n].type = type; + (*e820_num)++; + } +} + +#ifdef __x86_64__ +struct +{ + grub_uint32_t kernel_entry; + grub_uint32_t kernel_cs; +} jumpvector; +#endif + +static grub_err_t +grub_linux32_boot (void) +{ + struct linux_kernel_params *params; + int e820_num; + + params = real_mode_mem; + + grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", + (unsigned) params->code32_start, + (unsigned long) &(idt_desc.limit), + (unsigned long) &(gdt_desc.limit)); + grub_dprintf ("linux", "idt = %x:%lx, gdt = %x:%lx\n", + (unsigned) idt_desc.limit, (unsigned long) idt_desc.base, + (unsigned) gdt_desc.limit, (unsigned long) gdt_desc.base); + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) + { + switch (type) + { + case GRUB_MACHINE_MEMORY_AVAILABLE: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_RAM); + break; + + default: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_RESERVED); + } + return 0; + } + + e820_num = 0; + grub_machine_mmap_iterate (hook); + params->mmap_size = e820_num; + + /* Hardware interrupts are not safe any longer. */ + asm volatile ("cli" : : ); + + /* Load the IDT and the GDT for the bootstrap. */ + asm volatile ("lidt %0" : : "m" (idt_desc)); + asm volatile ("lgdt %0" : : "m" (gdt_desc)); + +#ifdef __x86_64__ + + jumpvector.kernel_entry = (grub_uint64_t) grub_linux_real_boot; + jumpvector.kernel_cs = 0x10; + + asm volatile ( "mov %0, %%rbx" : : "m" (params->code32_start)); + asm volatile ( "mov %0, %%rsi" : : "m" (real_mode_mem)); + + asm volatile ( "ljmp *%0" : : "m" (jumpvector)); + +#else + + /* Pass parameters. */ + asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); + asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem)); + + asm volatile ("xorl %%ebx, %%ebx" : : ); + + /* Enter Linux. */ + asm volatile ("jmp *%%ecx" : : ); + +#endif + + /* Never reach here. */ + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_linux_unload (void) +{ + free_pages (); + grub_dl_unref (my_mod); + loaded = 0; + return GRUB_ERR_NONE; +} + +void +grub_rescue_cmd_linux (int argc, char *argv[]) +{ + grub_file_t file = 0; + struct linux_kernel_header lh; + struct linux_kernel_params *params; + grub_uint8_t setup_sects; + grub_size_t real_size, prot_size; + grub_ssize_t len; + int i; + char *dest; + int video_type; + + grub_dl_ref (my_mod); + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); + goto fail; + } + + file = grub_file_open (argv[0]); + if (! file) + goto fail; + + if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh)) + { + grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header"); + goto fail; + } + + if (lh.boot_flag != grub_cpu_to_le16 (0xaa55)) + { + grub_error (GRUB_ERR_BAD_OS, "invalid magic number"); + goto fail; + } + + if (lh.setup_sects > GRUB_LINUX_MAX_SETUP_SECTS) + { + grub_error (GRUB_ERR_BAD_OS, "too many setup sectors"); + goto fail; + } + + /* FIXME: Is 2.02 recent enough for 32-bit boot? */ + if (lh.header != grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0203) + { + grub_error (GRUB_ERR_BAD_OS, "too old version"); + goto fail; + } + + /* zImage doesn't support 32-bit boot. */ + if (! (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL)) + { + grub_error (GRUB_ERR_BAD_OS, "zImage is not supported"); + goto fail; + } + + setup_sects = lh.setup_sects; + + /* If SETUP_SECTS is not set, set it to the default (4). */ + if (! setup_sects) + setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; + + real_size = setup_sects << GRUB_DISK_SECTOR_BITS; + prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE; + + if (! allocate_pages (prot_size)) + goto fail; + + params = (struct linux_kernel_params *) real_mode_mem; + grub_memset (params, 0, GRUB_LINUX_CL_END_OFFSET); + grub_memcpy (¶ms->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); + + params->ps_mouse = params->padding10 = 0; + + len = 0x400 - sizeof (lh); + if (grub_file_read (file, (char *) real_mode_mem + sizeof (lh), len) != len) + { + grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); + goto fail; + } + + params->type_of_loader = (LINUX_LOADER_ID_GRUB << 4); + + params->cl_magic = GRUB_LINUX_CL_MAGIC; + params->cl_offset = 0x1000; + params->cmd_line_ptr = (unsigned long) real_mode_mem + 0x1000; + params->ramdisk_image = 0; + params->ramdisk_size = 0; + + params->heap_end_ptr = GRUB_LINUX_HEAP_END_OFFSET; + params->loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP; + + /* These are not needed to be precise, because Linux uses these values + only to raise an error when the decompression code cannot find good + space. */ + params->ext_mem = ((32 * 0x100000) >> 10); + params->alt_mem = ((32 * 0x100000) >> 10); + + params->video_cursor_x = grub_getxy () >> 8; + params->video_cursor_y = grub_getxy () & 0xff; + params->video_page = 0; /* ??? */ + params->video_mode = 0; + params->video_width = (grub_getwh () >> 8); + params->video_ega_bx = 0; + params->video_height = (grub_getwh () & 0xff); + params->have_vga = 0; + params->font_size = 16; /* XXX */ + + /* The other parameters are filled when booting. */ + + grub_file_seek (file, real_size + GRUB_DISK_SECTOR_SIZE); + + grub_printf (" [Linux-bzImage, setup=0x%x, size=0x%x]\n", + (unsigned) real_size, (unsigned) prot_size); + + /* Detect explicitly specified memory size, if any. */ + linux_mem_size = 0; + video_type = 0; + for (i = 1; i < argc; i++) + if (grub_memcmp (argv[i], "mem=", 4) == 0) + { + char *val = argv[i] + 4; + + linux_mem_size = grub_strtoul (val, &val, 0); + + if (grub_errno) + { + grub_errno = GRUB_ERR_NONE; + linux_mem_size = 0; + } + else + { + int shift = 0; + + switch (grub_tolower (val[0])) + { + case 'g': + shift += 10; + case 'm': + shift += 10; + case 'k': + shift += 10; + default: + break; + } + + /* Check an overflow. */ + if (linux_mem_size > (~0UL >> shift)) + linux_mem_size = 0; + else + linux_mem_size <<= shift; + } + } + + /* Specify the boot file. */ + dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, + "BOOT_IMAGE="); + dest = grub_stpcpy (dest, argv[0]); + + /* Copy kernel parameters. */ + for (i = 1; + i < argc + && dest + grub_strlen (argv[i]) + 1 < ((char *) real_mode_mem + + GRUB_LINUX_CL_END_OFFSET); + i++) + { + *dest++ = ' '; + dest = grub_stpcpy (dest, argv[i]); + } + + len = prot_size; + if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) + grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); + + if (grub_errno == GRUB_ERR_NONE) + { + grub_loader_set (grub_linux32_boot, grub_linux_unload, 1); + loaded = 1; + } + + fail: + + if (file) + grub_file_close (file); + + if (grub_errno != GRUB_ERR_NONE) + { + grub_dl_unref (my_mod); + loaded = 0; + } +} + +void +grub_rescue_cmd_initrd (int argc, char *argv[]) +{ + grub_file_t file = 0; + grub_ssize_t size; + grub_addr_t addr_min, addr_max; + grub_addr_t addr; + struct linux_kernel_header *lh; + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified"); + goto fail; + } + + if (! loaded) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first."); + goto fail; + } + + file = grub_file_open (argv[0]); + if (! file) + goto fail; + + size = grub_file_size (file); + initrd_pages = (page_align (size) >> 12); + + lh = (struct linux_kernel_header *) real_mode_mem; + + addr_max = (grub_cpu_to_le32 (lh->initrd_addr_max) << 10); + if (linux_mem_size != 0 && linux_mem_size < addr_max) + addr_max = linux_mem_size; + + /* Linux 2.3.xx has a bug in the memory range check, so avoid + the last page. + Linux 2.2.xx has a bug in the memory range check, which is + worse than that of Linux 2.3.xx, so avoid the last 64kb. */ + addr_max -= 0x10000; + + /* Usually, the compression ratio is about 50%. */ + addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) + + page_align (size); + + /* FIXME: This doesn't take addr_max & addr_min into account. */ + addr = (grub_addr_t) grub_malloc (page_align (size)); + + if (addr == 0) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "no free pages available"); + goto fail; + } + + initrd_mem = (void *) addr; + if (! initrd_mem) + grub_fatal ("cannot allocate pages"); + + if (grub_file_read (file, initrd_mem, size) != size) + { + grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); + goto fail; + } + + grub_printf (" [Initrd, addr=0x%x, size=0x%x]\n", + (unsigned) addr, (unsigned) size); + + lh->ramdisk_image = addr; + lh->ramdisk_size = size; + lh->root_dev = 0x0100; /* XXX */ + + fail: + if (file) + grub_file_close (file); +} + + +GRUB_MOD_INIT(linux) +{ + grub_rescue_register_command ("linux", + grub_rescue_cmd_linux, + "load linux"); + grub_rescue_register_command ("initrd", + grub_rescue_cmd_initrd, + "load initrd"); + my_mod = mod; +} + +GRUB_MOD_FINI(linux) +{ + grub_rescue_unregister_command ("linux"); + grub_rescue_unregister_command ("initrd"); +} From 380cfbb4585be5d7ce63021c8d6fcbb673b0d5f9 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 21 Aug 2008 13:30:32 +0000 Subject: [PATCH 0368/1707] 2008-08-21 Felix Zielcke * fs/ntfs.c (grub_ntfs_mount): Fix a memory leak. --- ChangeLog | 4 ++++ fs/ntfs.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 19603ad9e..d7f91bb4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-21 Felix Zielcke + + * fs/ntfs.c (grub_ntfs_mount): Fix a memory leak. + 2008-08-21 Robert Millan * loader/i386/linux.c: New file. Implements generic 32-bit Linux diff --git a/fs/ntfs.c b/fs/ntfs.c index 3363eb02b..3174ab181 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -850,6 +850,7 @@ fail: { free_file (&data->mmft); free_file (&data->cmft); + grub_free (data); } return 0; } From d5a7dc5b743e7700a066292f14be0ece23517614 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 22 Aug 2008 12:58:46 +0000 Subject: [PATCH 0369/1707] 2008-08-22 Felix Zielcke * util/update-grub.in (GRUB_GFXMODE): Export variable. * util/grub.d/00_header.in: Allow the administrator to change default gfxmode via ${GRUB_GFXMODE}. --- ChangeLog | 6 ++++++ util/grub.d/00_header.in | 3 ++- util/update-grub.in | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7f91bb4d..4ea1fa416 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-22 Felix Zielcke + + * util/update-grub.in (GRUB_GFXMODE): Export variable. + * util/grub.d/00_header.in: Allow the administrator to change default + gfxmode via ${GRUB_GFXMODE}. + 2008-08-21 Felix Zielcke * fs/ntfs.c (grub_ntfs_mount): Fix a memory leak. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 007c0268c..9ef25cfd7 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -33,6 +33,7 @@ done if [ "x${GRUB_DEFAULT}" = "x" ] ; then GRUB_DEFAULT=0 ; fi if [ "x${GRUB_TIMEOUT}" = "x" ] ; then GRUB_TIMEOUT=5 ; fi +if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi cat << EOF set default=${GRUB_DEFAULT} @@ -58,7 +59,7 @@ case x${GRUB_TERMINAL} in cat << EOF if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then - set gfxmode=640x480 + set gfxmode=${GRUB_GFXMODE} insmod gfxterm insmod ${video_backend} terminal gfxterm diff --git a/util/update-grub.in b/util/update-grub.in index 8c60c412f..75780acb2 100644 --- a/util/update-grub.in +++ b/util/update-grub.in @@ -163,7 +163,7 @@ esac export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES # These are optional, user-defined variables. -export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID +export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE rm -f ${grub_cfg}.new exec > ${grub_cfg}.new From 8415f2617c326ac38e1737ab7ecf0114880df24b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 23 Aug 2008 12:19:43 +0000 Subject: [PATCH 0370/1707] 2008-08-23 Robert Millan * util/getroot.c (find_root_device): Skip anything that starts with a dot, not just directories. This avoids things like /dev/.tmp.md0. --- ChangeLog | 5 +++++ util/getroot.c | 11 ++++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ea1fa416..3b0ce520b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-23 Robert Millan + + * util/getroot.c (find_root_device): Skip anything that starts with + a dot, not just directories. This avoids things like /dev/.tmp.md0. + 2008-08-22 Felix Zielcke * util/update-grub.in (GRUB_GFXMODE): Export variable. diff --git a/util/getroot.c b/util/getroot.c index c8d31ede2..826092b99 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -196,7 +196,10 @@ find_root_device (const char *dir, dev_t dev) { struct stat st; - if (strcmp (ent->d_name, ".") == 0 || strcmp (ent->d_name, "..") == 0) + /* Avoid: + - dotfiles (like "/dev/.tmp.md0") since they could be duplicates. + - dotdirs (like "/dev/.static") since they could contain duplicates. */ + if (ent->d_name[0] == '.') continue; if (lstat (ent->d_name, &st) < 0) @@ -207,11 +210,9 @@ find_root_device (const char *dir, dev_t dev) /* Don't follow symbolic links. */ continue; - if (S_ISDIR (st.st_mode) && ent->d_name[0] != '.') + if (S_ISDIR (st.st_mode)) { - /* Find it recursively, but avoid dotdirs (like ".static") since they - could contain duplicates, which would later break the - pathname-based check */ + /* Find it recursively. */ char *res; res = find_root_device (ent->d_name, dev); From 29c18915637fa2317ab9f3e3e1ec1bb8562e5f68 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 23 Aug 2008 14:20:45 +0000 Subject: [PATCH 0371/1707] 2008-08-22 Bean * normal/x86_64/setjmp.S (grub_longjmp): Return 1 when val = 0. * genfslist.sh: Ignore kernel.mod. * genpartmaplist.sh: Likewise. --- ChangeLog | 8 ++++++++ genfslist.sh | 5 +++++ genpartmaplist.sh | 5 +++++ normal/x86_64/setjmp.S | 5 +++++ 4 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3b0ce520b..e289ff83d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-08-23 Bean + + * normal/x86_64/setjmp.S (grub_longjmp): Return 1 when val = 0. + + * genfslist.sh: Ignore kernel.mod. + + * genpartmaplist.sh: Likewise. + 2008-08-23 Robert Millan * util/getroot.c (find_root_device): Skip anything that starts with diff --git a/genfslist.sh b/genfslist.sh index b54f0ff82..ec48e86ed 100644 --- a/genfslist.sh +++ b/genfslist.sh @@ -15,6 +15,11 @@ module=$1 +# Ignore kernel.mod. +if test $module = kernel; then + exit +fi + # For now, this emits only a module name, if the module registers a filesystem. if grep -v "^#" | grep '^ *grub_fs_register' >/dev/null 2>&1; then echo $module diff --git a/genpartmaplist.sh b/genpartmaplist.sh index ba6504999..fceb0f869 100644 --- a/genpartmaplist.sh +++ b/genpartmaplist.sh @@ -15,6 +15,11 @@ module=$1 +# Ignore kernel.mod. +if test $module = kernel; then + exit +fi + # For now, this emits only a module name, if the module registers a partition map. if grep -v "^#" | grep '^ *grub_partition_map_register' >/dev/null 2>&1; then echo $module diff --git a/normal/x86_64/setjmp.S b/normal/x86_64/setjmp.S index 4c8d4b3a5..621b09b93 100644 --- a/normal/x86_64/setjmp.S +++ b/normal/x86_64/setjmp.S @@ -50,6 +50,11 @@ FUNCTION(grub_setjmp) */ FUNCTION(grub_longjmp) movl %esi, %eax + orl %eax, %eax + jnz 1f + incl %eax +1: + movq (%rdi), %rbx movq 8(%rdi), %rsp movq 16(%rdi), %rbp From 5ed20adcb903fc3241871387c81595ea562fe56f Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 23 Aug 2008 14:51:19 +0000 Subject: [PATCH 0372/1707] 2008-08-23 Bean * conf/common.rmk (grub_probe_SOURCES): Add disk/mdraid_linux.c. (grub_fstest_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c and lib/crc.c. (pkglib_MODULES): Add raid5rec.mod, raid6rec.mod, mdraid.mod and dm_nv.mod. (raid5rec_mod_SOURCES): New macro. (raid5rec_mod_CFLAGS): Likewise. (raid5rec_mod_LDFLAGS): Likewise. (raid6rec_mod_SOURCES): Likewise. (raid6rec_mod_CFLAGS): Likewise. (raid6rec_mod_LDFLAGS): Likewise. (mdraid_mod_SOURCES): Likewise. (mdraid_mod_CFLAGS): Likewise. (mdraid_mod_LDFLAGS): Likewise. (dm_nv_mod_SOURCES): Likewise. (dm_nv_mod_CFLAGS): Likewise. (dm_nv_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (grub_setup_SOURCES): Add disk/mdraid_linux.c. (grub_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * disk/raid5_recover.c: New file. * disk/raid6_recover.c: Likewise. * disk/mdraid_linux.c: Likewise. * disk/dmraid_nvidia.c: Likewise. * disk/i386/pc/biosdisk.c: Set total_sectors of cdrom device to ULONG_MAX. * disk/raid.c (grub_raid_open): Use the size of the smallest disk to calculate the size of raid device. (grub_raid_read): Simplify raid0 code. Support raid4, raid6 and four different layout of raid5. (grub_raid_scan_device): Remove code specific to mdraid. (grub_raid_list): New variable. (free_array): New function. (grub_raid_register): Likewise. (grub_raid_unregister): Likewise. (grub_raid_rescan): Likewise. (GRUB_MOD_INIT): Don't iterate device here. (GRUB_MOD_FINI): Use free_array to release resource. * include/grub/raid.h: Remove macro and structure specific to mdraid. (grub_raid5_recover_func_t): New function variable type. (grub_raid6_recover_func_t): Likewise. (grub_raid5_recover_func): New variable. (grub_raid6_recover_func): Likewise. (grub_raid_register): New function. (grub_raid_unregister): Likewise. (grub_raid_rescan): Likewise. (grub_raid_block_xor): Likewise. * util/grub-fstest.c: Add #include and . (CMD_CRC): New macro. (part): Removed. (read_file): Handle device as well as file. (cmd_crc): New function. (fstest): Handle multiple disks. (options): Remove part, raw and long, add root and diskcount. (usage): Add crc, remove -p, -r, -l, add -r and -c. (main): Find the first non option entry and ignore subsequence options, add handling for the new options, support multiple disks. * util/grub-probe.c (probe): Add mdraid to abstraction_name. --- ChangeLog | 82 ++++ conf/common.mk | 285 ++++++++++++- conf/common.rmk | 33 +- conf/i386-coreboot.mk | 27 +- conf/i386-coreboot.rmk | 3 +- conf/i386-efi.mk | 3 +- conf/i386-efi.rmk | 3 +- conf/i386-ieee1275.mk | 27 +- conf/i386-ieee1275.rmk | 3 +- conf/i386-pc.mk | 41 +- conf/i386-pc.rmk | 5 +- conf/powerpc-ieee1275.mk | 27 +- conf/powerpc-ieee1275.rmk | 3 +- conf/x86_64-efi.mk | 3 +- conf/x86_64-efi.rmk | 3 +- disk/dmraid_nvidia.c | 166 ++++++++ disk/i386/pc/biosdisk.c | 2 +- disk/mdraid_linux.c | 233 +++++++++++ disk/raid.c | 830 ++++++++++++++++++++++---------------- disk/raid5_recover.c | 72 ++++ disk/raid6_recover.c | 216 ++++++++++ include/grub/raid.h | 180 ++------- util/grub-fstest.c | 263 ++++++++---- util/grub-probe.c | 2 +- 24 files changed, 1877 insertions(+), 635 deletions(-) create mode 100644 disk/dmraid_nvidia.c create mode 100644 disk/mdraid_linux.c create mode 100644 disk/raid5_recover.c create mode 100644 disk/raid6_recover.c diff --git a/ChangeLog b/ChangeLog index e289ff83d..a6c7cb5f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,85 @@ +2008-08-23 Bean + + * conf/common.rmk (grub_probe_SOURCES): Add disk/mdraid_linux.c. + (grub_fstest_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, + disk/mdraid_linux.c and disk/dmraid_nvidia.c and lib/crc.c. + (pkglib_MODULES): Add raid5rec.mod, raid6rec.mod, mdraid.mod and + dm_nv.mod. + (raid5rec_mod_SOURCES): New macro. + (raid5rec_mod_CFLAGS): Likewise. + (raid5rec_mod_LDFLAGS): Likewise. + (raid6rec_mod_SOURCES): Likewise. + (raid6rec_mod_CFLAGS): Likewise. + (raid6rec_mod_LDFLAGS): Likewise. + (mdraid_mod_SOURCES): Likewise. + (mdraid_mod_CFLAGS): Likewise. + (mdraid_mod_LDFLAGS): Likewise. + (dm_nv_mod_SOURCES): Likewise. + (dm_nv_mod_CFLAGS): Likewise. + (dm_nv_mod_LDFLAGS): Likewise. + + * conf/i386-pc.rmk (grub_setup_SOURCES): Add disk/mdraid_linux.c. + (grub_emu_SOURCES): Add disk/raid5_recover.c, disk/raid6_recover.c, + disk/mdraid_linux.c and disk/dmraid_nvidia.c. + + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add disk/raid5_recover.c, + disk/raid6_recover.c, disk/mdraid_linux.c and disk/dmraid_nvidia.c. + + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + + * disk/raid5_recover.c: New file. + + * disk/raid6_recover.c: Likewise. + + * disk/mdraid_linux.c: Likewise. + + * disk/dmraid_nvidia.c: Likewise. + + * disk/i386/pc/biosdisk.c: Set total_sectors of cdrom device to + ULONG_MAX. + + * disk/raid.c (grub_raid_open): Use the size of the smallest disk to + calculate the size of raid device. + (grub_raid_read): Simplify raid0 code. Support raid4, raid6 and four + different layout of raid5. + (grub_raid_scan_device): Remove code specific to mdraid. + (grub_raid_list): New variable. + (free_array): New function. + (grub_raid_register): Likewise. + (grub_raid_unregister): Likewise. + (grub_raid_rescan): Likewise. + (GRUB_MOD_INIT): Don't iterate device here. + (GRUB_MOD_FINI): Use free_array to release resource. + + * include/grub/raid.h: Remove macro and structure specific to mdraid. + (grub_raid5_recover_func_t): New function variable type. + (grub_raid6_recover_func_t): Likewise. + (grub_raid5_recover_func): New variable. + (grub_raid6_recover_func): Likewise. + (grub_raid_register): New function. + (grub_raid_unregister): Likewise. + (grub_raid_rescan): Likewise. + (grub_raid_block_xor): Likewise. + + * util/grub-fstest.c: Add #include and . + (CMD_CRC): New macro. + (part): Removed. + (read_file): Handle device as well as file. + (cmd_crc): New function. + (fstest): Handle multiple disks. + (options): Remove part, raw and long, add root and diskcount. + (usage): Add crc, remove -p, -r, -l, add -r and -c. + (main): Find the first non option entry and ignore subsequence options, + add handling for the new options, support multiple disks. + + * util/grub-probe.c (probe): Add mdraid to abstraction_name. + 2008-08-23 Bean * normal/x86_64/setjmp.S (grub_longjmp): Return 1 when val = 0. diff --git a/conf/common.mk b/conf/common.mk index 9004f269c..b180f051b 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -40,12 +40,12 @@ grub_probe_SOURCES = util/grub-probe.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c -CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-grub_probe_init.d + disk/lvm.c disk/raid.c disk/mdraid_linux.c grub_probe_init.c +CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -191,6 +191,10 @@ grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-disk_raid.d +grub_probe-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-disk_mdraid_linux.d + grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-grub_probe_init.d @@ -205,7 +209,7 @@ util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ - io/gzio.c lib/hexdump.c commands/blocklist.c commands/ls.c \ + lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ @@ -213,13 +217,15 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/ufs.c fs/xfs.c fs/afs.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-lib_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-io_gzio.d grub_fstest-lib_hexdump.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-lib_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-io_gzio.o grub_fstest-lib_hexdump.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -269,14 +275,14 @@ grub_fstest-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-normal_misc.d -grub_fstest-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-io_gzio.d - grub_fstest-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-lib_hexdump.d +grub_fstest-lib_crc.o: lib/crc.c $(lib/crc.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-lib_crc.d + grub_fstest-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-commands_blocklist.d @@ -389,6 +395,22 @@ grub_fstest-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-disk_raid.d +grub_fstest-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_raid5_recover.d + +grub_fstest-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_raid6_recover.d + +grub_fstest-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_mdraid_linux.d + +grub_fstest-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_dmraid_nvidia.d + grub_fstest-grub_fstest_init.o: grub_fstest_init.c $(grub_fstest_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-grub_fstest_init.d @@ -1909,7 +1931,8 @@ gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) # Special disk structures -pkglib_MODULES += raid.mod lvm.mod +pkglib_MODULES += raid.mod raid5rec.mod raid6rec.mod mdraid.mod dm_nv.mod \ + lvm.mod # For raid.mod raid_mod_SOURCES = disk/raid.c @@ -1968,7 +1991,235 @@ partmap-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genpartm raid_mod_CFLAGS = $(COMMON_CFLAGS) raid_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For raid.mod +# For raid5rec.mod +raid5rec_mod_SOURCES = disk/raid5_recover.c +CLEANFILES += raid5rec.mod mod-raid5rec.o mod-raid5rec.c pre-raid5rec.o raid5rec_mod-disk_raid5_recover.o und-raid5rec.lst +ifneq ($(raid5rec_mod_EXPORTS),no) +CLEANFILES += def-raid5rec.lst +DEFSYMFILES += def-raid5rec.lst +endif +MOSTLYCLEANFILES += raid5rec_mod-disk_raid5_recover.d +UNDSYMFILES += und-raid5rec.lst + +raid5rec.mod: pre-raid5rec.o mod-raid5rec.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(raid5rec_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-raid5rec.o mod-raid5rec.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-raid5rec.o: $(raid5rec_mod_DEPENDENCIES) raid5rec_mod-disk_raid5_recover.o + -rm -f $@ + $(TARGET_CC) $(raid5rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ raid5rec_mod-disk_raid5_recover.o + +mod-raid5rec.o: mod-raid5rec.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -c -o $@ $< + +mod-raid5rec.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'raid5rec' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(raid5rec_mod_EXPORTS),no) +def-raid5rec.lst: pre-raid5rec.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 raid5rec/' > $@ +endif + +und-raid5rec.lst: pre-raid5rec.o + echo 'raid5rec' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +raid5rec_mod-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -MD -c -o $@ $< +-include raid5rec_mod-disk_raid5_recover.d + +CLEANFILES += cmd-raid5rec_mod-disk_raid5_recover.lst fs-raid5rec_mod-disk_raid5_recover.lst partmap-raid5rec_mod-disk_raid5_recover.lst +COMMANDFILES += cmd-raid5rec_mod-disk_raid5_recover.lst +FSFILES += fs-raid5rec_mod-disk_raid5_recover.lst +PARTMAPFILES += partmap-raid5rec_mod-disk_raid5_recover.lst + +cmd-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid5rec > $@ || (rm -f $@; exit 1) + +fs-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid5rec > $@ || (rm -f $@; exit 1) + +partmap-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid5rec > $@ || (rm -f $@; exit 1) + + +raid5rec_mod_CFLAGS = $(COMMON_CFLAGS) +raid5rec_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For raid6rec.mod +raid6rec_mod_SOURCES = disk/raid6_recover.c +CLEANFILES += raid6rec.mod mod-raid6rec.o mod-raid6rec.c pre-raid6rec.o raid6rec_mod-disk_raid6_recover.o und-raid6rec.lst +ifneq ($(raid6rec_mod_EXPORTS),no) +CLEANFILES += def-raid6rec.lst +DEFSYMFILES += def-raid6rec.lst +endif +MOSTLYCLEANFILES += raid6rec_mod-disk_raid6_recover.d +UNDSYMFILES += und-raid6rec.lst + +raid6rec.mod: pre-raid6rec.o mod-raid6rec.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(raid6rec_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-raid6rec.o mod-raid6rec.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-raid6rec.o: $(raid6rec_mod_DEPENDENCIES) raid6rec_mod-disk_raid6_recover.o + -rm -f $@ + $(TARGET_CC) $(raid6rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ raid6rec_mod-disk_raid6_recover.o + +mod-raid6rec.o: mod-raid6rec.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -c -o $@ $< + +mod-raid6rec.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'raid6rec' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(raid6rec_mod_EXPORTS),no) +def-raid6rec.lst: pre-raid6rec.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 raid6rec/' > $@ +endif + +und-raid6rec.lst: pre-raid6rec.o + echo 'raid6rec' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +raid6rec_mod-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -MD -c -o $@ $< +-include raid6rec_mod-disk_raid6_recover.d + +CLEANFILES += cmd-raid6rec_mod-disk_raid6_recover.lst fs-raid6rec_mod-disk_raid6_recover.lst partmap-raid6rec_mod-disk_raid6_recover.lst +COMMANDFILES += cmd-raid6rec_mod-disk_raid6_recover.lst +FSFILES += fs-raid6rec_mod-disk_raid6_recover.lst +PARTMAPFILES += partmap-raid6rec_mod-disk_raid6_recover.lst + +cmd-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid6rec > $@ || (rm -f $@; exit 1) + +fs-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid6rec > $@ || (rm -f $@; exit 1) + +partmap-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid6rec > $@ || (rm -f $@; exit 1) + + +raid6rec_mod_CFLAGS = $(COMMON_CFLAGS) +raid6rec_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For mdraid.mod +mdraid_mod_SOURCES = disk/mdraid_linux.c +CLEANFILES += mdraid.mod mod-mdraid.o mod-mdraid.c pre-mdraid.o mdraid_mod-disk_mdraid_linux.o und-mdraid.lst +ifneq ($(mdraid_mod_EXPORTS),no) +CLEANFILES += def-mdraid.lst +DEFSYMFILES += def-mdraid.lst +endif +MOSTLYCLEANFILES += mdraid_mod-disk_mdraid_linux.d +UNDSYMFILES += und-mdraid.lst + +mdraid.mod: pre-mdraid.o mod-mdraid.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(mdraid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-mdraid.o mod-mdraid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-mdraid.o: $(mdraid_mod_DEPENDENCIES) mdraid_mod-disk_mdraid_linux.o + -rm -f $@ + $(TARGET_CC) $(mdraid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ mdraid_mod-disk_mdraid_linux.o + +mod-mdraid.o: mod-mdraid.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -c -o $@ $< + +mod-mdraid.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'mdraid' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(mdraid_mod_EXPORTS),no) +def-mdraid.lst: pre-mdraid.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 mdraid/' > $@ +endif + +und-mdraid.lst: pre-mdraid.o + echo 'mdraid' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +mdraid_mod-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -MD -c -o $@ $< +-include mdraid_mod-disk_mdraid_linux.d + +CLEANFILES += cmd-mdraid_mod-disk_mdraid_linux.lst fs-mdraid_mod-disk_mdraid_linux.lst partmap-mdraid_mod-disk_mdraid_linux.lst +COMMANDFILES += cmd-mdraid_mod-disk_mdraid_linux.lst +FSFILES += fs-mdraid_mod-disk_mdraid_linux.lst +PARTMAPFILES += partmap-mdraid_mod-disk_mdraid_linux.lst + +cmd-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh mdraid > $@ || (rm -f $@; exit 1) + +fs-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh mdraid > $@ || (rm -f $@; exit 1) + +partmap-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh mdraid > $@ || (rm -f $@; exit 1) + + +mdraid_mod_CFLAGS = $(COMMON_CFLAGS) +mdraid_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For dm_nv.mod +dm_nv_mod_SOURCES = disk/dmraid_nvidia.c +CLEANFILES += dm_nv.mod mod-dm_nv.o mod-dm_nv.c pre-dm_nv.o dm_nv_mod-disk_dmraid_nvidia.o und-dm_nv.lst +ifneq ($(dm_nv_mod_EXPORTS),no) +CLEANFILES += def-dm_nv.lst +DEFSYMFILES += def-dm_nv.lst +endif +MOSTLYCLEANFILES += dm_nv_mod-disk_dmraid_nvidia.d +UNDSYMFILES += und-dm_nv.lst + +dm_nv.mod: pre-dm_nv.o mod-dm_nv.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(dm_nv_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-dm_nv.o mod-dm_nv.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-dm_nv.o: $(dm_nv_mod_DEPENDENCIES) dm_nv_mod-disk_dmraid_nvidia.o + -rm -f $@ + $(TARGET_CC) $(dm_nv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ dm_nv_mod-disk_dmraid_nvidia.o + +mod-dm_nv.o: mod-dm_nv.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -c -o $@ $< + +mod-dm_nv.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'dm_nv' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(dm_nv_mod_EXPORTS),no) +def-dm_nv.lst: pre-dm_nv.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 dm_nv/' > $@ +endif + +und-dm_nv.lst: pre-dm_nv.o + echo 'dm_nv' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +dm_nv_mod-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -MD -c -o $@ $< +-include dm_nv_mod-disk_dmraid_nvidia.d + +CLEANFILES += cmd-dm_nv_mod-disk_dmraid_nvidia.lst fs-dm_nv_mod-disk_dmraid_nvidia.lst partmap-dm_nv_mod-disk_dmraid_nvidia.lst +COMMANDFILES += cmd-dm_nv_mod-disk_dmraid_nvidia.lst +FSFILES += fs-dm_nv_mod-disk_dmraid_nvidia.lst +PARTMAPFILES += partmap-dm_nv_mod-disk_dmraid_nvidia.lst + +cmd-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh dm_nv > $@ || (rm -f $@; exit 1) + +fs-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh dm_nv > $@ || (rm -f $@; exit 1) + +partmap-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh dm_nv > $@ || (rm -f $@; exit 1) + + +dm_nv_mod_CFLAGS = $(COMMON_CFLAGS) +dm_nv_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lvm.mod lvm_mod_SOURCES = disk/lvm.c CLEANFILES += lvm.mod mod-lvm.o mod-lvm.c pre-lvm.o lvm_mod-disk_lvm.o und-lvm.lst ifneq ($(lvm_mod_EXPORTS),no) diff --git a/conf/common.rmk b/conf/common.rmk index 9ca03d463..75863831a 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -21,7 +21,7 @@ grub_probe_SOURCES = util/grub-probe.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c grub_probe_init.c + disk/lvm.c disk/raid.c disk/mdraid_linux.c grub_probe_init.c ifeq ($(enable_grub_fstest), yes) bin_UTILITIES += grub-fstest @@ -32,7 +32,7 @@ util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ - io/gzio.c lib/hexdump.c commands/blocklist.c commands/ls.c \ + lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ @@ -40,7 +40,9 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/ufs.c fs/xfs.c fs/afs.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c \ grub_fstest_init.c # For the parser. @@ -270,14 +272,35 @@ gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) # Special disk structures -pkglib_MODULES += raid.mod lvm.mod +pkglib_MODULES += raid.mod raid5rec.mod raid6rec.mod mdraid.mod dm_nv.mod \ + lvm.mod # For raid.mod raid_mod_SOURCES = disk/raid.c raid_mod_CFLAGS = $(COMMON_CFLAGS) raid_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For raid.mod +# For raid5rec.mod +raid5rec_mod_SOURCES = disk/raid5_recover.c +raid5rec_mod_CFLAGS = $(COMMON_CFLAGS) +raid5rec_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For raid6rec.mod +raid6rec_mod_SOURCES = disk/raid6_recover.c +raid6rec_mod_CFLAGS = $(COMMON_CFLAGS) +raid6rec_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For mdraid.mod +mdraid_mod_SOURCES = disk/mdraid_linux.c +mdraid_mod_CFLAGS = $(COMMON_CFLAGS) +mdraid_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For dm_nv.mod +dm_nv_mod_SOURCES = disk/dmraid_nvidia.c +dm_nv_mod_CFLAGS = $(COMMON_CFLAGS) +dm_nv_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For lvm.mod lvm_mod_SOURCES = disk/lvm.c lvm_mod_CFLAGS = $(COMMON_CFLAGS) lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 244f49e37..3e857f5eb 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -222,13 +222,14 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -542,6 +543,22 @@ grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_raid.d +grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid5_recover.d + +grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid6_recover.d + +grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_mdraid_linux.d + +grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_dmraid_nvidia.d + grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_lvm.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 26b545569..3f57d41d3 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -85,7 +85,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 66def1151..bf654fe19 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -99,7 +99,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 98482ce7f..d0a216bd6 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -62,7 +62,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 9d396b009..0f3c1648a 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -220,13 +220,14 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -548,6 +549,22 @@ grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_raid.d +grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid5_recover.d + +grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid6_recover.d + +grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_mdraid_linux.d + +grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_dmraid_nvidia.d + grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_lvm.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 7cf5183be..24cd719f2 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -83,7 +83,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 483a5e907..169ca74ac 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -326,14 +326,14 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ \ partmap/pc.c partmap/gpt.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/mdraid_linux.c disk/lvm.c \ util/raid.c util/lvm.c \ grub_setup_init.c -CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d +CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_mdraid_linux.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) +grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o + $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(util/i386/pc/grub-setup.c_DEPENDENCIES) $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< @@ -471,6 +471,10 @@ grub_setup-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-disk_raid.d +grub_setup-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< +-include grub_setup-disk_mdraid_linux.d + grub_setup-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-disk_lvm.d @@ -542,13 +546,14 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -870,6 +875,22 @@ grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_raid.d +grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid5_recover.d + +grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid6_recover.d + +grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_mdraid_linux.d + +grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_dmraid_nvidia.d + grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_lvm.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 83b1d713b..fc36a6ea2 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -103,7 +103,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ \ partmap/pc.c partmap/gpt.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/mdraid_linux.c disk/lvm.c \ util/raid.c util/lvm.c \ grub_setup_init.c @@ -143,7 +143,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 9193ea7f0..47155003f 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -86,13 +86,14 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/powerpc/ieee1275/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -394,6 +395,22 @@ grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_raid.d +grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid5_recover.d + +grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_raid6_recover.d + +grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_mdraid_linux.d + +grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_dmraid_nvidia.d + grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_lvm.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 7e4aaa969..d97207dff 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -67,7 +67,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/powerpc/ieee1275/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 0bfab7b59..bd0a4e1d5 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -83,7 +83,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 92213b9c9..16008522d 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -64,7 +64,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ util/biosdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ - disk/raid.c disk/lvm.c \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/disk/dmraid_nvidia.c b/disk/dmraid_nvidia.c new file mode 100644 index 000000000..c2d5ed369 --- /dev/null +++ b/disk/dmraid_nvidia.c @@ -0,0 +1,166 @@ +/* dmraid_nvidia.c - module to handle Nvidia fakeraid. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#define NV_SIGNATURES 4 + +#define NV_IDLE 0 +#define NV_SCDB_INIT_RAID 2 +#define NV_SCDB_REBUILD_RAID 3 +#define NV_SCDB_UPGRADE_RAID 4 +#define NV_SCDB_SYNC_RAID 5 + +#define NV_LEVEL_UNKNOWN 0x00 +#define NV_LEVEL_JBOD 0xFF +#define NV_LEVEL_0 0x80 +#define NV_LEVEL_1 0x81 +#define NV_LEVEL_3 0x83 +#define NV_LEVEL_5 0x85 +#define NV_LEVEL_10 0x8a +#define NV_LEVEL_1_0 0x8180 + +#define NV_ARRAY_FLAG_BOOT 1 /* BIOS use only. */ +#define NV_ARRAY_FLAG_ERROR 2 /* Degraded or offling. */ +#define NV_ARRAY_FLAG_PARITY_VALID 4 /* RAID-3/5 parity valid. */ + +struct grub_nv_array +{ + grub_uint32_t version; + grub_uint32_t signature[NV_SIGNATURES]; + grub_uint8_t raid_job_code; + grub_uint8_t stripe_width; + grub_uint8_t total_volumes; + grub_uint8_t original_width; + grub_uint32_t raid_level; + grub_uint32_t stripe_block_size; + grub_uint32_t stripe_block_size_bytes; + grub_uint32_t stripe_block_size_log2; + grub_uint32_t stripe_mask; + grub_uint32_t stripe_size; + grub_uint32_t stripe_size_bytes; + grub_uint32_t raid_job_mask; + grub_uint32_t original_capacity; + grub_uint32_t flags; +}; + +#define NV_ID_LEN 8 +#define NV_ID_STRING "NVIDIA" +#define NV_VERSION 100 + +#define NV_PRODID_LEN 16 +#define NV_PRODREV_LEN 4 + +struct grub_nv_super +{ + char vendor[NV_ID_LEN]; /* 0x00 - 0x07 ID string. */ + grub_uint32_t size; /* 0x08 - 0x0B Size of metadata in dwords. */ + grub_uint32_t chksum; /* 0x0C - 0x0F Checksum of this struct. */ + grub_uint16_t version; /* 0x10 - 0x11 NV version. */ + grub_uint8_t unit_number; /* 0x12 Disk index in array. */ + grub_uint8_t reserved; /* 0x13. */ + grub_uint32_t capacity; /* 0x14 - 0x17 Array capacity in sectors. */ + grub_uint32_t sector_size; /* 0x18 - 0x1B Sector size. */ + char prodid[NV_PRODID_LEN]; /* 0x1C - 0x2B Array product ID. */ + char prodrev[NV_PRODREV_LEN]; /* 0x2C - 0x2F Array product revision */ + grub_uint32_t unit_flags; /* 0x30 - 0x33 Flags for this disk */ + struct grub_nv_array array; /* Array information */ +} __attribute__ ((packed)); + +static grub_err_t +grub_dmraid_nv_detect (grub_disk_t disk, struct grub_raid_array *array) +{ + grub_disk_addr_t sector; + struct grub_nv_super sb; + grub_uint32_t *uuid; + + if (disk->partition) + return grub_error (GRUB_ERR_OUT_OF_RANGE, "skip partition"); + + sector = grub_disk_get_size (disk) - 2; + + if (grub_disk_read (disk, sector, 0, sizeof (sb), (char *) &sb)) + return grub_errno; + + if (grub_memcmp (sb.vendor, NV_ID_STRING, 6)) + return grub_error (GRUB_ERR_OUT_OF_RANGE, "not raid"); + + if (sb.version != NV_VERSION) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "Unknown version: %d.%d", sb.version); + + switch (sb.array.raid_level) + { + case NV_LEVEL_0: + array->level = 0; + array->disk_size = sb.capacity / sb.array.total_volumes; + break; + + case NV_LEVEL_1: + array->level = 1; + array->disk_size = sb.capacity; + break; + + case NV_LEVEL_5: + array->level = 5; + array->layout = GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC; + array->disk_size = sb.capacity / (sb.array.total_volumes - 1); + break; + + default: + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "Unsupported RAID level: %d", sb.array.raid_level); + } + + array->number = 0; + array->total_devs = sb.array.total_volumes; + array->chunk_size = sb.array.stripe_block_size; + array->index = sb.unit_number; + array->uuid_len = sizeof (sb.array.signature); + array->uuid = grub_malloc (sizeof (sb.array.signature)); + if (! array->uuid) + return grub_errno; + + grub_memcpy (array->uuid, (char *) &sb.array.signature, + sizeof (sb.array.signature)); + + return 0; +} + +static struct grub_raid grub_dmraid_nv_dev = +{ + .name = "dmraid_nv", + .detect = grub_dmraid_nv_detect, + .next = 0 +}; + +GRUB_MOD_INIT(dm_nv) +{ + grub_raid_register (&grub_dmraid_nv_dev); +} + +GRUB_MOD_FINI(dm_nv) +{ + grub_raid_register (&grub_dmraid_nv_dev); +} diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index c8fd1423b..120d46f25 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -120,7 +120,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) { data->flags = GRUB_BIOSDISK_FLAG_LBA | GRUB_BIOSDISK_FLAG_CDROM; data->sectors = 32; - total_sectors = 9000000; /* TODO: get the correct size. */ + total_sectors = ULONG_MAX; /* TODO: get the correct size. */ } else if (drive & 0x80) { diff --git a/disk/mdraid_linux.c b/disk/mdraid_linux.c new file mode 100644 index 000000000..f5eb84ca1 --- /dev/null +++ b/disk/mdraid_linux.c @@ -0,0 +1,233 @@ +/* mdraid_linux.c - module to handle linux softraid. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +/* Linux RAID on disk structures and constants, + copied from include/linux/raid/md_p.h. */ + +#define RESERVED_BYTES (64 * 1024) +#define RESERVED_SECTORS (RESERVED_BYTES / 512) + +#define NEW_SIZE_SECTORS(x) ((x & ~(RESERVED_SECTORS - 1)) \ + - RESERVED_SECTORS) + +#define SB_BYTES 4096 +#define SB_WORDS (SB_BYTES / 4) +#define SB_SECTORS (SB_BYTES / 512) + +/* + * The following are counted in 32-bit words + */ +#define SB_GENERIC_OFFSET 0 + +#define SB_PERSONALITY_OFFSET 64 +#define SB_DISKS_OFFSET 128 +#define SB_DESCRIPTOR_OFFSET 992 + +#define SB_GENERIC_CONSTANT_WORDS 32 +#define SB_GENERIC_STATE_WORDS 32 +#define SB_GENERIC_WORDS (SB_GENERIC_CONSTANT_WORDS + \ + SB_GENERIC_STATE_WORDS) + +#define SB_PERSONALITY_WORDS 64 +#define SB_DESCRIPTOR_WORDS 32 +#define SB_DISKS 27 +#define SB_DISKS_WORDS (SB_DISKS * SB_DESCRIPTOR_WORDS) + +#define SB_RESERVED_WORDS (1024 \ + - SB_GENERIC_WORDS \ + - SB_PERSONALITY_WORDS \ + - SB_DISKS_WORDS \ + - SB_DESCRIPTOR_WORDS) + +#define SB_EQUAL_WORDS (SB_GENERIC_WORDS \ + + SB_PERSONALITY_WORDS \ + + SB_DISKS_WORDS) + +/* + * Device "operational" state bits + */ +#define DISK_FAULTY 0 +#define DISK_ACTIVE 1 +#define DISK_SYNC 2 +#define DISK_REMOVED 3 + +#define DISK_WRITEMOSTLY 9 + +#define SB_MAGIC 0xa92b4efc + +/* + * Superblock state bits + */ +#define SB_CLEAN 0 +#define SB_ERRORS 1 + +#define SB_BITMAP_PRESENT 8 + +struct grub_raid_disk_09 +{ + grub_uint32_t number; /* Device number in the entire set. */ + grub_uint32_t major; /* Device major number. */ + grub_uint32_t minor; /* Device minor number. */ + grub_uint32_t raid_disk; /* The role of the device in the raid set. */ + grub_uint32_t state; /* Operational state. */ + grub_uint32_t reserved[SB_DESCRIPTOR_WORDS - 5]; +}; + +struct grub_raid_super_09 +{ + /* + * Constant generic information + */ + grub_uint32_t md_magic; /* MD identifier. */ + grub_uint32_t major_version; /* Major version. */ + grub_uint32_t minor_version; /* Minor version. */ + grub_uint32_t patch_version; /* Patchlevel version. */ + grub_uint32_t gvalid_words; /* Number of used words in this section. */ + grub_uint32_t set_uuid0; /* Raid set identifier. */ + grub_uint32_t ctime; /* Creation time. */ + grub_uint32_t level; /* Raid personality. */ + grub_uint32_t size; /* Apparent size of each individual disk. */ + grub_uint32_t nr_disks; /* Total disks in the raid set. */ + grub_uint32_t raid_disks; /* Disks in a fully functional raid set. */ + grub_uint32_t md_minor; /* Preferred MD minor device number. */ + grub_uint32_t not_persistent; /* Does it have a persistent superblock. */ + grub_uint32_t set_uuid1; /* Raid set identifier #2. */ + grub_uint32_t set_uuid2; /* Raid set identifier #3. */ + grub_uint32_t set_uuid3; /* Raid set identifier #4. */ + grub_uint32_t gstate_creserved[SB_GENERIC_CONSTANT_WORDS - 16]; + + /* + * Generic state information + */ + grub_uint32_t utime; /* Superblock update time. */ + grub_uint32_t state; /* State bits (clean, ...). */ + grub_uint32_t active_disks; /* Number of currently active disks. */ + grub_uint32_t working_disks; /* Number of working disks. */ + grub_uint32_t failed_disks; /* Number of failed disks. */ + grub_uint32_t spare_disks; /* Number of spare disks. */ + grub_uint32_t sb_csum; /* Checksum of the whole superblock. */ + grub_uint64_t events; /* Superblock update count. */ + grub_uint64_t cp_events; /* Checkpoint update count. */ + grub_uint32_t recovery_cp; /* Recovery checkpoint sector count. */ + grub_uint32_t gstate_sreserved[SB_GENERIC_STATE_WORDS - 12]; + + /* + * Personality information + */ + grub_uint32_t layout; /* The array's physical layout. */ + grub_uint32_t chunk_size; /* Chunk size in bytes. */ + grub_uint32_t root_pv; /* LV root PV. */ + grub_uint32_t root_block; /* LV root block. */ + grub_uint32_t pstate_reserved[SB_PERSONALITY_WORDS - 4]; + + /* + * Disks information + */ + struct grub_raid_disk_09 disks[SB_DISKS]; + + /* + * Reserved + */ + grub_uint32_t reserved[SB_RESERVED_WORDS]; + + /* + * Active descriptor + */ + struct grub_raid_disk_09 this_disk; +} __attribute__ ((packed)); + +static grub_err_t +grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array) +{ + grub_disk_addr_t sector; + grub_uint64_t size; + struct grub_raid_super_09 sb; + grub_uint32_t *uuid; + + /* The sector where the RAID superblock is stored, if available. */ + size = grub_disk_get_size (disk); + sector = NEW_SIZE_SECTORS (size); + + if (grub_disk_read (disk, sector, 0, SB_BYTES, (char *) &sb)) + return grub_errno; + + /* Look whether there is a RAID superblock. */ + if (sb.md_magic != SB_MAGIC) + return grub_error (GRUB_ERR_OUT_OF_RANGE, "not raid"); + + /* FIXME: Also support version 1.0. */ + if (sb.major_version != 0 || sb.minor_version != 90) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "Unsupported RAID version: %d.%d", + sb.major_version, sb.minor_version); + + /* FIXME: Check the checksum. */ + + /* Multipath. */ + if ((int) sb.level == -4) + sb.level = 1; + + if (sb.level != 0 && sb.level != 1 && sb.level != 4 && + sb.level != 5 && sb.level != 6 && sb.level != 10) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "Unsupported RAID level: %d", sb.level); + + array->number = sb.md_minor; + array->level = sb.level; + array->layout = sb.layout; + array->total_devs = sb.raid_disks; + array->disk_size = (sb.size) ? sb.size * 2 : sector; + array->chunk_size = sb.chunk_size >> 9; + array->index = sb.this_disk.number; + array->uuid_len = 16; + array->uuid = grub_malloc (16); + if (!array->uuid) + return grub_errno; + + uuid = (grub_uint32_t *) array->uuid; + uuid[0] = sb.set_uuid0; + uuid[1] = sb.set_uuid1; + uuid[2] = sb.set_uuid2; + uuid[3] = sb.set_uuid3; + + return 0; +} + +static struct grub_raid grub_mdraid_dev = { + .name = "mdraid", + .detect = grub_mdraid_detect, + .next = 0 +}; + +GRUB_MOD_INIT (mdraid) +{ + grub_raid_register (&grub_mdraid_dev); +} + +GRUB_MOD_FINI (mdraid) +{ + grub_raid_register (&grub_mdraid_dev); +} diff --git a/disk/raid.c b/disk/raid.c index 7aa2398fc..3dab0d802 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -26,6 +26,8 @@ /* Linked list of RAID arrays. */ static struct grub_raid_array *array_list; +grub_raid5_recover_func_t grub_raid5_recover_func; +grub_raid6_recover_func_t grub_raid6_recover_func; static char @@ -43,10 +45,29 @@ grub_is_array_readable (struct grub_raid_array *array) return 1; break; + case 4: case 5: - if (array->nr_devs >= array->total_devs - 1) - return 1; - break; + case 6: + case 10: + { + unsigned int n; + + if (array->level == 10) + { + n = array->layout & 0xFF; + if (n == 1) + n = (array->layout >> 8) & 0xFF; + + n--; + } + else + n = array->level / 3; + + if (array->nr_devs >= array->total_devs - n) + return 1; + + break; + } } return 0; @@ -76,12 +97,13 @@ grub_raid_memberlist (grub_disk_t disk) unsigned int i; for (i = 0; i < array->total_devs; i++) - { - tmp = grub_malloc (sizeof (*tmp)); - tmp->disk = array->device[i]; - tmp->next = list; - list = tmp; - } + if (array->device[i]) + { + tmp = grub_malloc (sizeof (*tmp)); + tmp->disk = array->device[i]; + tmp->next = list; + list = tmp; + } return list; } @@ -91,6 +113,7 @@ static grub_err_t grub_raid_open (const char *name, grub_disk_t disk) { struct grub_raid_array *array; + unsigned n; for (array = array_list; array != NULL; array = array->next) { @@ -100,7 +123,8 @@ grub_raid_open (const char *name, grub_disk_t disk) } if (!array) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown RAID device %s", name); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown RAID device %s", + name); disk->has_partitions = 1; disk->id = array->number; @@ -111,17 +135,27 @@ grub_raid_open (const char *name, grub_disk_t disk) switch (array->level) { - case 0: - /* FIXME: RAID0 disks can have different sizes! */ - disk->total_sectors = array->total_devs * array->disk_size; - break; - case 1: disk->total_sectors = array->disk_size; break; + case 10: + n = array->layout & 0xFF; + if (n == 1) + n = (array->layout >> 8) & 0xFF; + + disk->total_sectors = grub_divmod64 (array->total_devs * + array->disk_size, + n, 0); + break; + + case 0: + case 4: case 5: - disk->total_sectors = (array->total_devs - 1) * array->disk_size; + case 6: + n = array->level / 3; + + disk->total_sectors = (array->total_devs - n) * array->disk_size; break; } @@ -137,6 +171,22 @@ grub_raid_close (grub_disk_t disk __attribute ((unused))) return; } +void +grub_raid_block_xor (char *buf1, char *buf2, int size) +{ + grub_size_t *p1, *p2; + + p1 = (grub_size_t *) buf1; + p2 = (grub_size_t *) buf2; + size /= GRUB_CPU_SIZEOF_VOID_P; + + while (size) + { + *(p1++) ^= *(p2++); + size--; + } +} + static grub_err_t grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, grub_size_t size, char *buf) @@ -147,190 +197,264 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, switch (array->level) { case 0: + case 1: + case 10: + { + grub_disk_addr_t read_sector, far_ofs; + grub_uint32_t disknr, b, near, far, ofs; + + read_sector = grub_divmod64 (sector, array->chunk_size, &b); + far = ofs = near = 1; + far_ofs = 0; + + if (array->level == 1) + near = array->total_devs; + else if (array->level == 10) + { + near = array->layout & 0xFF; + far = (array->layout >> 8) & 0xFF; + if (array->layout >> 16) + { + ofs = far; + far_ofs = 1; + } + else + far_ofs = grub_divmod64 (array->disk_size, + far * array->chunk_size, 0); + + far_ofs *= array->chunk_size; + } + + read_sector = grub_divmod64 (read_sector * near, array->total_devs, + &disknr); + + ofs *= array->chunk_size; + read_sector *= ofs; + + while (1) + { + grub_size_t read_size; + unsigned int i, j; + + read_size = array->chunk_size - b; + if (read_size > size) + read_size = size; + + for (i = 0; i < near; i++) + { + unsigned int k; + + k = disknr; + for (j = 0; j < far; j++) + { + if (array->device[k]) + { + if (grub_errno == GRUB_ERR_READ_ERROR) + grub_errno = GRUB_ERR_NONE; + + err = grub_disk_read (array->device[k], + read_sector + j * far_ofs + b, + 0, + read_size << GRUB_DISK_SECTOR_BITS, + buf); + if (! err) + break; + else if (err != GRUB_ERR_READ_ERROR) + return err; + } + else + err = grub_error (GRUB_ERR_READ_ERROR, + "disk missing."); + + k++; + if (k == array->total_devs) + k = 0; + } + + if (! err) + break; + + disknr++; + if (disknr == array->total_devs) + { + disknr = 0; + read_sector += ofs; + } + } + + if (err) + return err; + + buf += read_size << GRUB_DISK_SECTOR_BITS; + size -= read_size; + if (! size) + break; + + b = 0; + disknr += (near - i); + while (disknr >= array->total_devs) + { + disknr -= array->total_devs; + read_sector += ofs; + } + } + break; + } + + case 4: + case 5: + case 6: { - grub_uint64_t a; - grub_uint32_t b; - unsigned int disknr; grub_disk_addr_t read_sector; - grub_size_t read_size; + grub_uint32_t b, p, n, disknr, e; + + /* n = 1 for level 4 and 5, 2 for level 6. */ + n = array->level / 3; /* Find the first sector to read. */ - a = grub_divmod64 (sector, array->chunk_size, NULL); - grub_divmod64 (a, array->total_devs, &disknr); + read_sector = grub_divmod64 (sector, array->chunk_size, &b); + read_sector = grub_divmod64 (read_sector, array->total_devs - n, + &disknr); + if (array->level >= 5) + { + grub_divmod64 (read_sector, array->total_devs, &p); - a = grub_divmod64 (sector, array->chunk_size * array->total_devs, NULL); - grub_divmod64 (sector, array->chunk_size, &b); - read_sector = a * array->chunk_size + b; + if (! (array->layout & GRUB_RAID_LAYOUT_RIGHT_MASK)) + p = array->total_devs - 1 - p; - grub_divmod64 (read_sector, array->chunk_size, &b); - read_size = array->chunk_size - b; - - if (read_size > size) - read_size = size; + if (array->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK) + { + disknr += p + n; + } + else + { + grub_uint32_t q; + + q = p + (n - 1); + if (q >= array->total_devs) + q -= array->total_devs; + + if (disknr >= p) + disknr += n; + else if (disknr >= q) + disknr += q + 1; + } + + if (disknr >= array->total_devs) + disknr -= array->total_devs; + } + else + p = array->total_devs - n; + + read_sector *= array->chunk_size; while (1) { - grub_uint32_t i; + grub_size_t read_size; + int next_level; + + read_size = array->chunk_size - b; + if (read_size > size) + read_size = size; + + e = 0; + if (array->device[disknr]) + { + /* Reset read error. */ + if (grub_errno == GRUB_ERR_READ_ERROR) + grub_errno = GRUB_ERR_NONE; + + err = grub_disk_read (array->device[disknr], + read_sector + b, 0, + read_size << GRUB_DISK_SECTOR_BITS, + buf); + + if ((err) && (err != GRUB_ERR_READ_ERROR)) + break; + e++; + } + else + err = GRUB_ERR_READ_ERROR; - err = grub_disk_read (array->device[disknr], read_sector, 0, - read_size << GRUB_DISK_SECTOR_BITS, buf); if (err) - break; + { + if (array->nr_devs < array->total_devs - n + e) + break; + grub_errno = GRUB_ERR_NONE; + if (array->level == 6) + { + err = ((grub_raid6_recover_func) ? + (*grub_raid6_recover_func) (array, disknr, p, + buf, read_sector + b, + read_size) : + grub_error (GRUB_ERR_BAD_DEVICE, + "raid6rec is not loaded")); + } + else + { + err = ((grub_raid5_recover_func) ? + (*grub_raid5_recover_func) (array, disknr, + buf, read_sector + b, + read_size) : + grub_error (GRUB_ERR_BAD_DEVICE, + "raid5rec is not loaded")); + } + + if (err) + break; + } + buf += read_size << GRUB_DISK_SECTOR_BITS; size -= read_size; if (! size) break; - if (size > array->chunk_size) - read_size = array->chunk_size; - else - read_size = size; - - /* Check whether the sector was aligned on a chunk size - boundary. If this isn't the case, it's the first read - and the next read should be set back to start of the - boundary. */ - grub_divmod64 (read_sector, array->chunk_size, &i); - read_sector -= i; - + b = 0; disknr++; - /* See whether the disk was the last disk, and start - reading from the first disk in that case. */ - if (disknr == array->total_devs) - { - disknr = 0; - read_sector += array->chunk_size; - } - } - } - break; - case 1: - /* This is easy, we can read from any disk we want. We will loop - over all disks until we've found one that is available. In - case of errs, we will try the to read the next disk. */ - { - unsigned int i = 0; - - for (i = 0; i < array->total_devs; i++) - { - if (array->device[i]) - { - err = grub_disk_read (array->device[i], sector, 0, - size << GRUB_DISK_SECTOR_BITS, buf); + if (array->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK) + { + if (disknr == array->total_devs) + disknr = 0; - if (!err) - break; - } - } - } - break; + next_level = (disknr == p); + } + else + { + if (disknr == p) + disknr += n; - case 5: - { - grub_uint64_t a; - grub_uint32_t b; - int disknr; - grub_disk_addr_t read_sector; - grub_size_t read_size; + next_level = (disknr >= array->total_devs); + } - /* Find the first sector to read. */ - a = grub_divmod64 (sector, array->chunk_size, NULL); - grub_divmod64 (a, (array->total_devs - 1), &b); - disknr = b; + if (next_level) + { + read_sector += array->chunk_size; - a = grub_divmod64 (sector, array->chunk_size * (array->total_devs - 1), - NULL); - grub_divmod64 (sector, array->chunk_size, &b); - read_sector = a * array->chunk_size + b; + if (array->level >= 5) + { + if (array->layout & GRUB_RAID_LAYOUT_RIGHT_MASK) + p = (p == array->total_devs - 1) ? 0 : p + 1; + else + p = (p == 0) ? array->total_devs - 1 : p - 1; - grub_divmod64 (read_sector, array->chunk_size * array->total_devs, &b); - disknr -= (b / array->chunk_size); - if (disknr < 0) - disknr += array->total_devs; - - grub_divmod64 (read_sector, array->chunk_size, &b); - read_size = array->chunk_size - b; - - if (read_size > size) - read_size = size; - - while (1) - { - grub_uint32_t i; - - if (array->device[disknr]) - err = grub_disk_read (array->device[disknr], read_sector, 0, - read_size << GRUB_DISK_SECTOR_BITS, buf); - - /* If an error occurs when we already have an degraded - array we can't recover from that. */ - if (err && ((array->total_devs - 1) == array->nr_devs)) - break; - - if (err || ! array->device[disknr]) - { - /* Either an error occured or the disk is not - available. We have to compute this block from the - blocks on the other hard disks. */ - grub_size_t buf_size = read_size << GRUB_DISK_SECTOR_BITS; - char buf2[buf_size]; - unsigned int j; - - grub_memset (buf, 0, buf_size); - - for (j = 0; j < array->total_devs; j++) - { - unsigned int k; - - if (j != (unsigned int) disknr) - { - err = grub_disk_read (array->device[j], read_sector, - 0, buf_size, buf2); - if (err) - return err; - - for (k = 0; k < buf_size; k++) - buf[k] = buf[k] ^ buf2[k]; - } - } - } - - buf += (read_size << GRUB_DISK_SECTOR_BITS); - size -= read_size; - if (! size) - break; - - if (size > array->chunk_size) - read_size = array->chunk_size; - else - read_size = size; - - /* Check whether the sector was aligned on a chunk size - boundary. If this isn't the case, it's the first read - and the next read should be set back to start of the - boundary. */ - grub_divmod64 (read_sector, array->chunk_size, &i); - read_sector -= i; - - disknr++; - grub_divmod64 (read_sector, - array->chunk_size * array->total_devs, &i); - if ((unsigned int) disknr == (array->total_devs - (i / array->chunk_size) - 1)) - disknr++; - /* See whether the disk was the last disk, and start - reading from the first disk in that case. */ - if ((unsigned int) disknr == array->total_devs) - { - disknr = 0; - read_sector += array->chunk_size; - grub_divmod64 (read_sector, - array->chunk_size * array->total_devs, &i); - - if ((i / array->chunk_size) == (array->total_devs - 1)) - disknr++; - } + if (array->layout & GRUB_RAID_LAYOUT_SYMMETRIC_MASK) + { + disknr = p + n; + if (disknr >= array->total_devs) + disknr -= array->total_devs; + } + else + { + disknr -= array->total_devs; + if (disknr == p) + disknr += n; + } + } + else + disknr = 0; + } } } break; @@ -348,169 +472,105 @@ grub_raid_write (grub_disk_t disk __attribute ((unused)), return GRUB_ERR_NOT_IMPLEMENTED_YET; } -static int -grub_raid_scan_device (const char *name) +static grub_err_t +insert_array (grub_disk_t disk, struct grub_raid_array *new_array, + const char *scanner_name) { - grub_err_t err; - grub_disk_t disk; - grub_disk_addr_t sector; - grub_uint64_t size; - struct grub_raid_super_09 sb; - struct grub_raid_array *p, *array = NULL; - - grub_dprintf ("raid", "Scanning for RAID devices\n"); - - disk = grub_disk_open (name); - if (!disk) - return 0; - - /* The sector where the RAID superblock is stored, if available. */ - size = grub_disk_get_size (disk); - sector = GRUB_RAID_NEW_SIZE_SECTORS(size); - - err = grub_disk_read (disk, sector, 0, GRUB_RAID_SB_BYTES, (char *) &sb); - grub_disk_close (disk); - if (err) - { - grub_errno = GRUB_ERR_NONE; - return 0; - } - - /* Look whether there is a RAID superblock. */ - if (sb.md_magic != GRUB_RAID_SB_MAGIC) - return 0; - - /* FIXME: Also support version 1.0. */ - if (sb.major_version != 0 || sb.minor_version != 90) - { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "Unsupported RAID version: %d.%d", - sb.major_version, sb.minor_version); - return 0; - } - - /* FIXME: Check the checksum. */ - - /* FIXME: Support all RAID levels. */ - if (sb.level != 0 && sb.level != 1 && sb.level != 5) - { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "Unsupported RAID level: %d", - sb.level); - return 0; - } - - /* FIXME: Support all layouts. */ - if (sb.level == 5 && sb.layout != 2) - { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "Unsupported RAID5 layout: %d", - sb.layout); - return 0; - } + struct grub_raid_array *array = 0, *p; /* See whether the device is part of an array we have already seen a device from. */ for (p = array_list; p != NULL; p = p->next) - { - if (p->uuid[0] == sb.set_uuid0 && p->uuid[1] == sb.set_uuid1 - && p->uuid[2] == sb.set_uuid2 && p->uuid[3] == sb.set_uuid3) - { - array = p; - break; - } - } + if ((p->uuid_len == new_array->uuid_len) && + (! grub_memcmp (p->uuid, new_array->uuid, p->uuid_len))) + { + grub_free (new_array->uuid); + array = p; - /* Do some checks before adding the device to the array. */ - if (array) - { - /* FIXME: Check whether the update time of the superblocks are - the same. */ - - if (array->total_devs == array->nr_devs) - { - /* We found more members of the array than the array - actually has according to its superblock. This shouldn't - happen normally, but what is the sanest things to do in such - a case? */ - - grub_error (GRUB_ERR_BAD_NUMBER, - "array->nr_devs > array->total_devs (%d)?!?", - array->total_devs); + /* Do some checks before adding the device to the array. */ - return 0; - } - - if (array->device[sb.this_disk.number] != NULL) - /* We found multiple devices with the same number. Again, - this shouldn't happen.*/ - grub_dprintf ("raid", "Found two disks with the number %d?!?", - sb.this_disk.number); - } + /* FIXME: Check whether the update time of the superblocks are + the same. */ + + if (array->total_devs == array->nr_devs) + /* We found more members of the array than the array + actually has according to its superblock. This shouldn't + happen normally, but what is the sanest things to do in such + a case? */ + return grub_error (GRUB_ERR_BAD_NUMBER, + "array->nr_devs > array->total_devs (%d)?!?", + array->total_devs); + + if (array->device[new_array->index] != NULL) + /* We found multiple devices with the same number. Again, + this shouldn't happen.*/ + return grub_error (GRUB_ERR_BAD_NUMBER, + "Found two disks with the number %d?!?", + new_array->number); + + if (new_array->disk_size < array->disk_size) + array->disk_size = new_array->disk_size; + break; + } /* Add an array to the list if we didn't find any. */ if (!array) { array = grub_malloc (sizeof (*array)); if (!array) - return 0; - grub_memset (array, 0, sizeof (*array)); - array->number = sb.md_minor; - array->version = sb.major_version; - array->level = sb.level; - array->layout = sb.layout; - array->total_devs = sb.nr_disks; + { + grub_free (new_array->uuid); + return grub_errno; + } + + *array = *new_array; array->nr_devs = 0; - array->uuid[0] = sb.set_uuid0; - array->uuid[1] = sb.set_uuid1; - array->uuid[2] = sb.set_uuid2; - array->uuid[3] = sb.set_uuid3; - /* The superblock specifies the size in 1024-byte sectors. */ - array->disk_size = sb.size * 2; - array->chunk_size = sb.chunk_size / 512; + grub_memset (&array->device, 0, sizeof (array->device)); /* Check whether we don't have multiple arrays with the same number. */ for (p = array_list; p != NULL; p = p->next) - { - if (p->number == array->number) - break; - } + { + if (p->number == array->number) + break; + } if (p) - { - /* The number is already in use, so we need to find an new number. */ - int i = 0; + { + /* The number is already in use, so we need to find an new number. */ + int i = 0; - while (1) - { - for (p = array_list; p != NULL; p = p->next) - { - if (p->number == i) - break; - } + while (1) + { + for (p = array_list; p != NULL; p = p->next) + { + if (p->number == i) + break; + } - if (!p) - { - /* We found an unused number. */ - array->number = i; - break; - } + if (!p) + { + /* We found an unused number. */ + array->number = i; + break; + } - i++; - } - } + i++; + } + } array->name = grub_malloc (13); if (! array->name) - { - grub_free (array); + { + grub_free (array->uuid); + grub_free (array); - return 0; - } + return grub_errno; + } grub_sprintf (array->name, "md%d", array->number); - grub_dprintf ("raid", "Found array: %s\n", array->name); + grub_dprintf ("raid", "Found array %s (%s)\n", array->name, + scanner_name); /* Add our new array to the list. */ array->next = array_list; @@ -518,47 +578,116 @@ grub_raid_scan_device (const char *name) } /* Add the device to the array. */ - array->device[sb.this_disk.number] = grub_disk_open (name); + array->device[new_array->index] = disk; + array->nr_devs++; - if (array->disk_size != array->device[sb.this_disk.number]->total_sectors) + return 0; +} + +static grub_raid_t grub_raid_list; + +static void +grub_raid_scan_device (int head_only) +{ + auto int hook (const char *name); + int hook (const char *name) { - if (array->total_devs == 1) - { - grub_dprintf ("raid", "Array contains only one disk, but its size (0x%llx) " - "doesn't match with size indicated by superblock (0x%llx). " - "Assuming superblock is wrong.\n", - (unsigned long long) array->device[sb.this_disk.number]->total_sectors, - (unsigned long long) array->disk_size); - array->disk_size = array->device[sb.this_disk.number]->total_sectors; - } - else if (array->level == 1) - { - grub_dprintf ("raid", "Array is RAID level 1, but the size of disk %d (0x%llx) " - "doesn't match with size indicated by superblock (0x%llx). " - "Assuming superblock is wrong.\n", - sb.this_disk.number, - (unsigned long long) array->device[sb.this_disk.number]->total_sectors, - (unsigned long long) array->disk_size); - array->disk_size = array->device[sb.this_disk.number]->total_sectors; - } - } - - if (! array->device[sb.this_disk.number]) - { - /* Remove array from the list if we have just added it. */ - if (array->nr_devs == 0) - { - array_list = array->next; - grub_free (array->name); - grub_free (array); - } - + grub_disk_t disk; + struct grub_raid_array array; + struct grub_raid *p; + + grub_dprintf ("raid", "Scanning for RAID devices\n"); + + disk = grub_disk_open (name); + if (!disk) + return 0; + + if (disk->total_sectors == ULONG_MAX) + { + grub_disk_close (disk); + return 0; + } + + for (p = grub_raid_list; p; p = p->next) + { + if (! p->detect (disk, &array)) + { + if (! insert_array (disk, &array, p->name)) + return 0; + + break; + } + + /* This error usually means it's not raid, no need to display + it. */ + if (grub_errno != GRUB_ERR_OUT_OF_RANGE) + grub_print_error (); + + grub_errno = GRUB_ERR_NONE; + if (head_only) + break; + } + + grub_disk_close (disk); + return 0; } - - array->nr_devs++; - return 0; + grub_device_iterate (&hook); +} + +static void +free_array (void) +{ + struct grub_raid_array *array; + + array = array_list; + while (array) + { + struct grub_raid_array *p; + int i; + + p = array; + array = array->next; + + for (i = 0; i < GRUB_RAID_MAX_DEVICES; i++) + if (p->device[i]) + grub_disk_close (p->device[i]); + + grub_free (p->uuid); + grub_free (p->name); + grub_free (p); + } + + array_list = 0; +} + +void +grub_raid_register (grub_raid_t raid) +{ + raid->next = grub_raid_list; + grub_raid_list = raid; + grub_raid_scan_device (1); +} + +void +grub_raid_unregister (grub_raid_t raid) +{ + grub_raid_t *p, q; + + for (p = &grub_raid_list, q = *p; q; p = &(q->next), q = q->next) + if (q == raid) + { + *p = q->next; + break; + } +} + +void +grub_raid_rescan (void) +{ + free_array (); + grub_raid_scan_device (0); } static struct grub_disk_dev grub_raid_dev = @@ -579,18 +708,11 @@ static struct grub_disk_dev grub_raid_dev = GRUB_MOD_INIT(raid) { - grub_device_iterate (&grub_raid_scan_device); - if (grub_errno) - { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - } - grub_disk_dev_register (&grub_raid_dev); } GRUB_MOD_FINI(raid) { grub_disk_dev_unregister (&grub_raid_dev); - /* FIXME: free the array list. */ + free_array (); } diff --git a/disk/raid5_recover.c b/disk/raid5_recover.c new file mode 100644 index 000000000..31cef88b1 --- /dev/null +++ b/disk/raid5_recover.c @@ -0,0 +1,72 @@ +/* raid5_recover.c - module to recover from faulty RAID4/5 arrays. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_err_t +grub_raid5_recover (struct grub_raid_array *array, int disknr, + char *buf, grub_disk_addr_t sector, int size) +{ + char *buf2; + int i; + + size <<= GRUB_DISK_SECTOR_BITS; + buf2 = grub_malloc (size); + if (!buf2) + return grub_errno; + + grub_memset (buf, 0, size); + + for (i = 0; i < (int) array->total_devs; i++) + { + grub_err_t err; + + if (i == disknr) + continue; + + err = grub_disk_read (array->device[i], sector, 0, size, buf2); + + if (err) + { + grub_free (buf2); + return err; + } + + grub_raid_block_xor (buf, buf2, size); + } + + grub_free (buf2); + + return GRUB_ERR_NONE; +} + +GRUB_MOD_INIT(raid5rec) +{ + grub_raid5_recover_func = grub_raid5_recover; +} + +GRUB_MOD_FINI(raid5rec) +{ + grub_raid5_recover_func = 0; +} diff --git a/disk/raid6_recover.c b/disk/raid6_recover.c new file mode 100644 index 000000000..3cb08abfe --- /dev/null +++ b/disk/raid6_recover.c @@ -0,0 +1,216 @@ +/* raid6_recover.c - module to recover from faulty RAID6 arrays. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_uint8_t raid6_table1[256][256]; +static grub_uint8_t raid6_table2[256][256]; + +static void +grub_raid_block_mul (grub_uint8_t mul, char *buf, int size) +{ + int i; + grub_uint8_t *p; + + p = (grub_uint8_t *) buf; + for (i = 0; i < size; i++, p++) + *p = raid6_table1[mul][*p]; +} + +static void +grub_raid6_init_table (void) +{ + int i, j; + + for (i = 0; i < 256; i++) + raid6_table1[i][1] = raid6_table1[1][i] = i; + + for (i = 2; i < 256; i++) + for (j = i; j < 256; j++) + { + int n; + grub_uint8_t c; + + n = i >> 1; + + c = raid6_table1[n][j]; + c = (c << 1) ^ ((c & 0x80) ? 0x1d : 0); + if (i & 1) + c ^= j; + + raid6_table1[j][i] = raid6_table1[i][j] = c; + } + + raid6_table2[0][0] = 1; + for (i = 1; i < 256; i++) + raid6_table2[i][i] = raid6_table1[raid6_table2[i - 1][i - 1]][2]; + + for (i = 0; i < 254; i++) + for (j = 0; j < 254; j++) + { + grub_uint8_t c, n; + int k; + + if (i == j) + continue; + + k = i - j; + if (k < 0) + k += 255; + + c = n = raid6_table2[k][k] ^ 1; + for (k = 0; k < 253; k++) + c = raid6_table1[c][n]; + + raid6_table2[i][j] = raid6_table1[raid6_table2[255 - j][255 - j]][c]; + } +} + +static grub_err_t +grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, + char *buf, grub_disk_addr_t sector, int size) +{ + int i, q, pos; + int err[2], nerr; + char *pbuf = 0, *qbuf = 0; + + size <<= GRUB_DISK_SECTOR_BITS; + pbuf = grub_malloc (size); + if (!pbuf) + goto quit; + + qbuf = grub_malloc (size); + if (!qbuf) + goto quit; + + q = p + 1; + if (q == (int) array->total_devs) + q = 0; + + grub_memset (pbuf, 0, size); + grub_memset (qbuf, 0, size); + + pos = q + 1; + if (pos == (int) array->total_devs) + pos = 0; + + nerr = 1; + for (i = 0; i < (int) array->total_devs - 2; i++) + { + if (pos == disknr) + err[0] = i; + else + { + if ((array->device[pos]) && + (! grub_disk_read (array->device[pos], sector, 0, size, buf))) + { + grub_raid_block_xor (pbuf, buf, size); + grub_raid_block_mul (raid6_table2[i][i], buf, size); + grub_raid_block_xor (qbuf, buf, size); + } + else + { + if (nerr >= 2) + goto quit; + + err[nerr++] = i; + grub_errno = GRUB_ERR_NONE; + } + } + + pos++; + if (pos == (int) array->total_devs) + pos = 0; + } + + if (nerr == 1) + { + if ((array->device[p]) && + (! grub_disk_read (array->device[p], sector, 0, size, buf))) + { + grub_raid_block_xor (buf, pbuf, size); + goto quit; + } + + if (! array->device[q]) + { + grub_error (GRUB_ERR_READ_ERROR, "Not enough disk to restore"); + goto quit; + } + + grub_errno = GRUB_ERR_NONE; + if (grub_disk_read (array->device[q], sector, 0, size, buf)) + goto quit; + + grub_raid_block_xor (buf, qbuf, size); + grub_raid_block_mul (raid6_table2[255 - err[0]][255 - err[0]], buf, + size); + } + else + { + grub_uint8_t c; + + if ((! array->device[p]) || (! array->device[q])) + { + grub_error (GRUB_ERR_READ_ERROR, "Not enough disk to restore"); + goto quit; + } + + if (grub_disk_read (array->device[p], sector, 0, size, buf)) + goto quit; + + grub_raid_block_xor (pbuf, buf, size); + + if (grub_disk_read (array->device[q], sector, 0, size, buf)) + goto quit; + + grub_raid_block_xor (qbuf, buf, size); + + c = raid6_table2[err[1]][err[0]]; + grub_raid_block_mul (c, qbuf, size); + + c = raid6_table1[raid6_table2[err[1]][err[1]]][c]; + grub_raid_block_mul (c, pbuf, size); + + grub_raid_block_xor (pbuf, qbuf, size); + grub_memcpy (buf, pbuf, size); + } + +quit: + grub_free (pbuf); + grub_free (qbuf); + + return grub_errno; +} + +GRUB_MOD_INIT(raid6rec) +{ + grub_raid6_init_table (); + grub_raid6_recover_func = grub_raid6_recover; +} + +GRUB_MOD_FINI(raid6rec) +{ + grub_raid6_recover_func = 0; +} diff --git a/include/grub/raid.h b/include/grub/raid.h index 4af97f1d7..a36be6d95 100644 --- a/include/grub/raid.h +++ b/include/grub/raid.h @@ -22,165 +22,65 @@ #include +#define GRUB_RAID_MAX_DEVICES 32 + +#define GRUB_RAID_LAYOUT_LEFT_ASYMMETRIC 0 +#define GRUB_RAID_LAYOUT_RIGHT_ASYMMETRIC 1 +#define GRUB_RAID_LAYOUT_LEFT_SYMMETRIC 2 +#define GRUB_RAID_LAYOUT_RIGHT_SYMMETRIC 3 + +#define GRUB_RAID_LAYOUT_RIGHT_MASK 1 +#define GRUB_RAID_LAYOUT_SYMMETRIC_MASK 2 + struct grub_raid_array { int number; /* The device number, taken from md_minor so we are consistent with the device name in Linux. */ - int version; /* 0 = 0.90, 1 = 1.0 */ int level; /* RAID levels, only 0, 1 or 5 at the moment. */ - int layout; /* Only for RAID 5. */ + int layout; /* Layout for RAID 5/6. */ unsigned int total_devs; /* Total number of devices in the array. */ - unsigned int nr_devs; /* The number of devices we've found so far. */ - grub_size_t chunk_size; /* The size of a chunk, in 512 byte sectors. */ - grub_uint32_t uuid[4]; /* The UUID of the device. */ - char *name; /* That will be "md". */ + grub_size_t chunk_size; /* The size of a chunk, in 512 byte sectors. */ grub_uint64_t disk_size; /* Size of an individual disk, in 512 byte sectors. */ - grub_disk_t device[32]; /* Array of total_devs devices. */ + int index; /* Index of current device. */ + int uuid_len; /* The length of uuid. */ + char *uuid; /* The UUID of the device. */ + + /* The following field is setup by the caller. */ + char *name; /* That will be "md". */ + unsigned int nr_devs; /* The number of devices we've found so far. */ + grub_disk_t device[GRUB_RAID_MAX_DEVICES]; /* Array of total_devs devices. */ struct grub_raid_array *next; }; -/* Linux RAID on disk structures and constants, - copied from include/linux/raid/md_p.h. */ +struct grub_raid +{ + const char *name; -#define GRUB_RAID_RESERVED_BYTES (64 * 1024) -#define GRUB_RAID_RESERVED_SECTORS (GRUB_RAID_RESERVED_BYTES / 512) + grub_err_t (*detect) (grub_disk_t disk, struct grub_raid_array *array); -#define GRUB_RAID_NEW_SIZE_SECTORS(x) ((x & ~(GRUB_RAID_RESERVED_SECTORS - 1)) \ - - GRUB_RAID_RESERVED_SECTORS) - -#define GRUB_RAID_SB_BYTES 4096 -#define GRUB_RAID_SB_WORDS (GRUB_RAID_SB_BYTES / 4) -#define GRUB_RAID_SB_SECTORS (GRUB_RAID_SB_BYTES / 512) - -/* - * The following are counted in 32-bit words - */ -#define GRUB_RAID_SB_GENERIC_OFFSET 0 - -#define GRUB_RAID_SB_PERSONALITY_OFFSET 64 -#define GRUB_RAID_SB_DISKS_OFFSET 128 -#define GRUB_RAID_SB_DESCRIPTOR_OFFSET 992 - -#define GRUB_RAID_SB_GENERIC_CONSTANT_WORDS 32 -#define GRUB_RAID_SB_GENERIC_STATE_WORDS 32 -#define GRUB_RAID_SB_GENERIC_WORDS (GRUB_RAID_SB_GENERIC_CONSTANT_WORDS \ - + GRUB_RAID_SB_GENERIC_STATE_WORDS) -#define GRUB_RAID_SB_PERSONALITY_WORDS 64 -#define GRUB_RAID_SB_DESCRIPTOR_WORDS 32 -#define GRUB_RAID_SB_DISKS 27 -#define GRUB_RAID_SB_DISKS_WORDS (GRUB_RAID_SB_DISKS*GRUB_RAID_SB_DESCRIPTOR_WORDS) -#define GRUB_RAID_SB_RESERVED_WORDS (1024 - GRUB_RAID_SB_GENERIC_WORDS \ - - GRUB_RAID_SB_PERSONALITY_WORDS \ - - GRUB_RAID_SB_DISKS_WORDS \ - - GRUB_RAID_SB_DESCRIPTOR_WORDS) -#define GRUB_RAID_SB_EQUAL_WORDS (GRUB_RAID_SB_GENERIC_WORDS \ - + GRUB_RAID_SB_PERSONALITY_WORDS \ - + GRUB_RAID_SB_DISKS_WORDS) - -/* - * Device "operational" state bits - */ -#define GRUB_RAID_DISK_FAULTY 0 /* disk is faulty / operational */ -#define GRUB_RAID_DISK_ACTIVE 1 /* disk is running or spare disk */ -#define GRUB_RAID_DISK_SYNC 2 /* disk is in sync with the raid set */ -#define GRUB_RAID_DISK_REMOVED 3 /* disk is in sync with the raid set */ - -#define GRUB_RAID_DISK_WRITEMOSTLY 9 /* disk is "write-mostly" is RAID1 config. - * read requests will only be sent here in - * dire need - */ - - -#define GRUB_RAID_SB_MAGIC 0xa92b4efc - -/* - * Superblock state bits - */ -#define GRUB_RAID_SB_CLEAN 0 -#define GRUB_RAID_SB_ERRORS 1 - -#define GRUB_RAID_SB_BITMAP_PRESENT 8 /* bitmap may be present nearby */ - -struct grub_raid_disk_09 { - grub_uint32_t number; /* 0 Device number in the entire set */ - grub_uint32_t major; /* 1 Device major number */ - grub_uint32_t minor; /* 2 Device minor number */ - grub_uint32_t raid_disk; /* 3 The role of the device in the raid set */ - grub_uint32_t state; /* 4 Operational state */ - grub_uint32_t reserved[GRUB_RAID_SB_DESCRIPTOR_WORDS - 5]; + struct grub_raid *next; }; +typedef struct grub_raid *grub_raid_t; -struct grub_raid_super_09 { - /* - * Constant generic information - */ - grub_uint32_t md_magic; /* 0 MD identifier */ - grub_uint32_t major_version; /* 1 major version to which the set conforms */ - grub_uint32_t minor_version; /* 2 minor version ... */ - grub_uint32_t patch_version; /* 3 patchlevel version ... */ - grub_uint32_t gvalid_words; /* 4 Number of used words in this section */ - grub_uint32_t set_uuid0; /* 5 Raid set identifier */ - grub_uint32_t ctime; /* 6 Creation time */ - grub_uint32_t level; /* 7 Raid personality */ - grub_uint32_t size; /* 8 Apparent size of each individual disk */ - grub_uint32_t nr_disks; /* 9 total disks in the raid set */ - grub_uint32_t raid_disks; /* 10 disks in a fully functional raid set */ - grub_uint32_t md_minor; /* 11 preferred MD minor device number */ - grub_uint32_t not_persistent; /* 12 does it have a persistent superblock */ - grub_uint32_t set_uuid1; /* 13 Raid set identifier #2 */ - grub_uint32_t set_uuid2; /* 14 Raid set identifier #3 */ - grub_uint32_t set_uuid3; /* 15 Raid set identifier #4 */ - grub_uint32_t gstate_creserved[GRUB_RAID_SB_GENERIC_CONSTANT_WORDS - 16]; +void grub_raid_register (grub_raid_t raid); +void grub_raid_unregister (grub_raid_t raid); - /* - * Generic state information - */ - grub_uint32_t utime; /* 0 Superblock update time */ - grub_uint32_t state; /* 1 State bits (clean, ...) */ - grub_uint32_t active_disks; /* 2 Number of currently active disks */ - grub_uint32_t working_disks; /* 3 Number of working disks */ - grub_uint32_t failed_disks; /* 4 Number of failed disks */ - grub_uint32_t spare_disks; /* 5 Number of spare disks */ - grub_uint32_t sb_csum; /* 6 checksum of the whole superblock */ -#ifdef GRUB_HOST_WORDS_BIGENDIAN - grub_uint32_t events_hi; /* 7 high-order of superblock update count */ - grub_uint32_t events_lo; /* 8 low-order of superblock update count */ - grub_uint32_t cp_events_hi; /* 9 high-order of checkpoint update count */ - grub_uint32_t cp_events_lo; /* 10 low-order of checkpoint update count */ -#else - grub_uint32_t events_lo; /* 7 low-order of superblock update count */ - grub_uint32_t events_hi; /* 8 high-order of superblock update count */ - grub_uint32_t cp_events_lo; /* 9 low-order of checkpoint update count */ - grub_uint32_t cp_events_hi; /* 10 high-order of checkpoint update count */ -#endif - grub_uint32_t recovery_cp; /* 11 recovery checkpoint sector count */ - grub_uint32_t gstate_sreserved[GRUB_RAID_SB_GENERIC_STATE_WORDS - 12]; +void grub_raid_rescan (void); +void grub_raid_block_xor (char *buf1, char *buf2, int size); - /* - * Personality information - */ - grub_uint32_t layout; /* 0 the array's physical layout */ - grub_uint32_t chunk_size; /* 1 chunk size in bytes */ - grub_uint32_t root_pv; /* 2 LV root PV */ - grub_uint32_t root_block; /* 3 LV root block */ - grub_uint32_t pstate_reserved[GRUB_RAID_SB_PERSONALITY_WORDS - 4]; +typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_raid_array *array, + int disknr, char *buf, + grub_disk_addr_t sector, + int size); - /* - * Disks information - */ - struct grub_raid_disk_09 disks[GRUB_RAID_SB_DISKS]; +typedef grub_err_t (*grub_raid6_recover_func_t) (struct grub_raid_array *array, + int disknr, int p, char *buf, + grub_disk_addr_t sector, + int size); - /* - * Reserved - */ - grub_uint32_t reserved[GRUB_RAID_SB_RESERVED_WORDS]; - - /* - * Active descriptor - */ - struct grub_raid_disk_09 this_disk; -}; +extern grub_raid5_recover_func_t grub_raid5_recover_func; +extern grub_raid6_recover_func_t grub_raid6_recover_func; #endif /* ! GRUB_RAID_H */ diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 35af6a500..fc259f2ee 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -29,7 +29,9 @@ #include #include #include +#include #include +#include #include @@ -136,12 +138,12 @@ grub_unregister_command (const char *name __attribute__ ((unused))) #define CMD_CP 2 #define CMD_CMP 3 #define CMD_HEX 4 -#define CMD_BLOCKLIST 5 +#define CMD_CRC 6 +#define CMD_BLOCKLIST 7 #define BUF_SIZE 32256 static grub_off_t skip, leng; -static char *part; static void read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len)) @@ -150,16 +152,53 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len)) grub_file_t file; grub_off_t ofs, len; - file = grub_file_open (pathname); - if (!file) + if ((pathname[0] == '-') && (pathname[1] == 0)) { - grub_util_error ("cannot open file %s.\n", pathname); + grub_device_t dev; + + dev = grub_device_open (0); + if ((! dev) || (! dev->disk)) + grub_util_error ("Can\'t open device."); + + grub_util_info ("total sectors : %lld.", + (unsigned long long) dev->disk->total_sectors); + + if (! leng) + leng = (dev->disk->total_sectors << GRUB_DISK_SECTOR_BITS) - skip; + + while (leng) + { + grub_size_t len; + + len = (leng > BUF_SIZE) ? BUF_SIZE : leng; + + if (grub_disk_read (dev->disk, 0, skip, len, buf)) + grub_util_error ("Disk read fails at offset %lld, length %d.", + skip, len); + + if (hook (skip, buf, len)) + break; + + skip += len; + leng -= len; + } + + grub_device_close (dev); return; } + file = grub_file_open (pathname); + if (!file) + { + grub_util_error ("cannot open file %s.", pathname); + return; + } + + grub_util_info ("file size : %lld.", (unsigned long long) file->size); + if (skip > file->size) { - grub_util_error ("invalid skip value %d.\n"); + grub_util_error ("invalid skip value %d."); return; } @@ -177,7 +216,7 @@ read_file (char *pathname, int (*hook) (grub_off_t ofs, char *buf, int len)) sz = grub_file_read (file, buf, (len > BUF_SIZE) ? BUF_SIZE : len); if (sz < 0) { - grub_util_error ("read error at offset %llu.\n", ofs); + grub_util_error ("read error at offset %llu.", ofs); break; } @@ -203,17 +242,17 @@ cmd_cp (char *src, char *dest) if ((int) fwrite (buf, 1, len, ff) != len) { - grub_util_error ("write error.\n"); + grub_util_error ("write error."); return 1; } return 0; } - ff = fopen (dest, "w"); + ff = fopen (dest, "wb"); if (ff == NULL) { - grub_util_error ("open error.\n"); + grub_util_error ("open error."); return; } read_file (src, cp_hook); @@ -231,7 +270,7 @@ cmd_cmp (char *src, char *dest) { if ((int) fread (buf_1, 1, len, ff) != len) { - grub_util_error ("read error at offset %llu.\n", ofs); + grub_util_error ("read error at offset %llu.", ofs); return 1; } @@ -242,22 +281,22 @@ cmd_cmp (char *src, char *dest) for (i = 0; i < len; i++, ofs++) if (buf_1[i] != buf[i]) { - grub_util_error ("compare fail at offset %llu.\n", ofs); + grub_util_error ("compare fail at offset %llu.", ofs); return 1; } } return 0; } - ff = fopen (dest, "r"); + ff = fopen (dest, "rb"); if (ff == NULL) { - grub_util_error ("open error.\n"); + grub_util_error ("open error."); return; } if ((skip) && (fseeko (ff, skip, SEEK_SET))) - grub_util_error ("seek error.\n"); + grub_util_error ("seek error."); read_file (src, cmp_hook); fclose (ff); @@ -277,28 +316,44 @@ cmd_hex (char *pathname) } static void -fstest (char *image_path, int cmd, int n, char **args) +cmd_crc (char *pathname) { - char host_file[7 + grub_strlen (image_path) + 1]; - char device_name[(part) ? (6 + grub_strlen (part)) : 5]; - char *argv[3] = { "-p", "loop", host_file }; + grub_uint32_t crc = 0; + auto int crc_hook (grub_off_t ofs, char *buf, int len); + int crc_hook (grub_off_t ofs, char *buf, int len) + { + (void) ofs; - grub_sprintf (host_file, "(host)/%s", image_path); + crc = grub_getcrc32 (crc, buf, len); + return 0; + } - if (execute_command (&cmd_loopback, 3, argv)) + read_file (pathname, crc_hook); + printf ("%08x\n", crc); +} + +static void +fstest (char **images, int num_disks, int cmd, int n, char **args) +{ + char host_file[128]; + char loop_name[8]; + char *argv[3] = { "-p", loop_name, host_file}; + int i; + + for (i = 0; i < num_disks; i++) { - grub_util_error ("loopback command fails.\n"); - goto fail; + if (grub_strlen (images[i]) + 7 > sizeof (host_file)) + grub_util_error ("Pathname %s too long.", images[i]); + + grub_sprintf (loop_name, "loop%d", i); + grub_sprintf (host_file, "(host)%s", images[i]); + + if (execute_command (&cmd_loopback, 3, argv)) + grub_util_error ("loopback command fails."); } - if (part) - grub_sprintf (device_name, "loop,%s", part); - else - grub_strcpy (device_name, "loop"); - - grub_env_set ("root", device_name); - + grub_raid_rescan (); switch (cmd) { case CMD_LS: @@ -313,29 +368,32 @@ fstest (char *image_path, int cmd, int n, char **args) case CMD_HEX: cmd_hex (args[0]); break; + case CMD_CRC: + cmd_crc (args[0]); + break; case CMD_BLOCKLIST: execute_command (&cmd_blocklist, n, args); grub_printf ("\n"); } -fail: - argv[0] = "-d"; - execute_command (&cmd_loopback, 2, argv); + for (i = 0; i < num_disks; i++) + { + grub_sprintf (loop_name, "loop%d", i); + execute_command (&cmd_loopback, 2, argv); + } } static struct option options[] = { - {"part", required_argument, 0, 'p'}, + {"root", required_argument, 0, 'r'}, {"skip", required_argument, 0, 's'}, {"length", required_argument, 0, 'n'}, + {"diskcount", required_argument, 0, 'c'}, {"debug", required_argument, 0, 'd'}, - {"raw", no_argument, 0, 'r'}, - {"long", no_argument, 0, 'l'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {"verbose", no_argument, 0, 'v'}, - {0, 0, 0, 0} }; @@ -351,17 +409,17 @@ Usage: grub-fstest [OPTION]... IMAGE_PATH COMMANDS\n\ Debug tool for filesystem driver.\n\ \nCommands:\n\ ls PATH list files in PATH\n\ - cp SRC DEST copy file to local system\n\ - cmp SRC DEST compare files\n\ - hex FILE hex dump FILE\n\ + cp FILE LOCAL copy FILE to local file LOCAL\n\ + cmp FILE LOCAL compare FILE with local file LOCAL\n\ + hex FILE Hex dump FILE\n\ + crc FILE Get crc32 checksum of FILE\n\ blocklist FILE display blocklist of FILE\n\ \nOptions:\n\ - -p, --part=NUM select partition NUM\n\ + -r, --root=DEVICE_NAME set root device\n\ -s, --skip=N skip N bytes from output file\n\ -n, --length=N handle N bytes in output file\n\ + -c, --diskcount=N N input files\n\ -d, --debug=S Set debug environment variable\n\ - -r, --raw disable auto decompression\n\ - -l, --long show long directory list\n\ -h, --help display this message and exit\n\ -V, --version print version information and exit\n\ -v, --verbose print verbose messages\n\ @@ -374,45 +432,66 @@ Report bugs to <%s>.\n", PACKAGE_BUGREPORT); int main (int argc, char *argv[]) { - char *image_path, *debug_str = 0; - int cmd, is_raw = 0, is_long = 0; + char *debug_str = 0, *root = 0, *default_root, *alloc_root; + int i, cmd, num_opts, image_index, num_disks = 1; progname = "grub-fstest"; + /* Find the first non option entry. */ + for (num_opts = 1; num_opts < argc; num_opts++) + if (argv[num_opts][0] == '-') + { + if ((argv[num_opts][2] == 0) && (num_opts < argc - 1) && + ((argv[num_opts][1] == 'r') || + (argv[num_opts][1] == 's') || + (argv[num_opts][1] == 'n') || + (argv[num_opts][1] == 'c') || + (argv[num_opts][1] == 'd'))) + num_opts++; + } + else + break; + /* Check for options. */ while (1) { - int c = getopt_long (argc, argv, "p:s:n:d:rlhVv", options, 0); + int c = getopt_long (num_opts, argv, "r:s:n:c:d:hVv", options, 0); + char *p; if (c == -1) break; else switch (c) { - case 'p': - part = optarg; + case 'r': + root = optarg; break; case 's': - skip = grub_strtoul (optarg, NULL, 0); + skip = grub_strtoul (optarg, &p, 0); + if (*p == 's') + skip <<= GRUB_DISK_SECTOR_BITS; break; case 'n': - leng = grub_strtoul (optarg, NULL, 0); + leng = grub_strtoul (optarg, &p, 0); + if (*p == 's') + leng <<= GRUB_DISK_SECTOR_BITS; break; + case 'c': + num_disks = grub_strtoul (optarg, NULL, 0); + if (num_disks < 1) + { + fprintf (stderr, "Invalid disk count.\n"); + usage (1); + } + break; + case 'd': debug_str = optarg; break; - case 'r': - is_raw = 1; - break; - - case 'l': - is_long = 1; - break; - case 'h': usage (0); break; @@ -432,52 +511,53 @@ main (int argc, char *argv[]) } /* Obtain PATH. */ - if (optind >= argc) + if (optind + num_disks - 1 >= argc) { - fprintf (stderr, "No path is specified.\n"); + fprintf (stderr, "Not enough pathname.\n"); usage (1); } - image_path = argv[optind]; - - if (*image_path != '/') - { - fprintf (stderr, "Must use absolute path.\n"); - usage (1); - } - - optind++; + image_index = optind; + for (i = 0; i < num_disks; i++, optind++) + if (argv[optind][0] != '/') + { + fprintf (stderr, "Must use absolute path.\n"); + usage (1); + } cmd = 0; if (optind < argc) { - int nparm = 1; + int nparm = 0; if (!grub_strcmp (argv[optind], "ls")) - { - cmd = CMD_LS; - if (is_long) - argv[optind--] = "-l"; - else - nparm = 0; - } + { + cmd = CMD_LS; + } else if (!grub_strcmp (argv[optind], "cp")) { cmd = CMD_CP; - nparm = 2; + nparm = 2; } else if (!grub_strcmp (argv[optind], "cmp")) { cmd = CMD_CMP; - nparm = 2; + nparm = 2; } else if (!grub_strcmp (argv[optind], "hex")) { cmd = CMD_HEX; + nparm = 1; + } + else if (!grub_strcmp (argv[optind], "crc")) + { + cmd = CMD_CRC; + nparm = 1; } else if (!grub_strcmp (argv[optind], "blocklist")) { cmd = CMD_BLOCKLIST; + nparm = 1; } else { @@ -503,14 +583,31 @@ main (int argc, char *argv[]) /* Initialize all modules. */ grub_init_all (); - if (is_raw) - grub_env_set ("filehook", "0"); - if (debug_str) grub_env_set ("debug", debug_str); + default_root = (num_disks == 1) ? "loop0" : "md0"; + alloc_root = 0; + if (root) + { + if ((*root >= '0') && (*root <= '9')) + { + alloc_root = xmalloc (strlen (default_root) + strlen (root) + 2); + + sprintf (alloc_root, "%s,%s", default_root, root); + root = alloc_root; + } + } + else + root = default_root; + + grub_env_set ("root", root); + + if (alloc_root) + free (alloc_root); + /* Do it. */ - fstest (image_path + 1, cmd, argc - optind, argv + optind); + fstest (argv + image_index, num_disks, cmd, argc - optind, argv + optind); /* Free resources. */ grub_fini_all (); diff --git a/util/grub-probe.c b/util/grub-probe.c index a4f51e2bd..301082317 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -142,7 +142,7 @@ probe (const char *path, char *device_name) abstraction_name = "lvm"; break; case GRUB_DEV_ABSTRACTION_RAID: - abstraction_name = "raid"; + abstraction_name = "raid mdraid"; break; default: grub_util_info ("did not find LVM/RAID in %s, assuming raw device", device_name); From c07ae501cb8d70908029ea16ed36f29099689740 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 26 Aug 2008 19:09:07 +0000 Subject: [PATCH 0373/1707] 2008-08-26 Robert Millan * util/biosdisk.c (grub_util_biosdisk_open, open_device) (grub_util_biosdisk_get_grub_dev): Make error messages a bit more descriptive. --- ChangeLog | 6 ++++++ util/biosdisk.c | 8 ++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6c7cb5f6..79c1d435e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-26 Robert Millan + + * util/biosdisk.c (grub_util_biosdisk_open, open_device) + (grub_util_biosdisk_get_grub_dev): Make error messages a bit more + descriptive. + 2008-08-23 Bean * conf/common.rmk (grub_probe_SOURCES): Add disk/mdraid_linux.c. diff --git a/util/biosdisk.c b/util/biosdisk.c index 1137e98fe..fa1143b1f 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -164,7 +164,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) fd = open (map[drive].device, O_RDONLY); if (fd == -1) - return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[drive].device); + return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk size", map[drive].device); if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) { @@ -288,7 +288,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) is_partition = linux_find_partition (dev, disk->partition->start); /* Open the partition. */ - grub_util_info ("opening the device `%s'", dev); + grub_util_info ("opening the device `%s' in open_device()", dev); fd = open (dev, flags); if (fd < 0) { @@ -306,7 +306,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) fd = open (map[disk->id].device, flags); if (fd < 0) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", map[disk->id].device); + grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' in open_device()", map[disk->id].device); return -1; } #endif /* ! __linux__ */ @@ -835,7 +835,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) fd = open (os_dev, O_RDONLY); if (fd == -1) { - grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s'", os_dev); + grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk geometry", os_dev); free (name); return 0; } From 965c75ca69bbe9bf519977afde57a6ea994ff30f Mon Sep 17 00:00:00 2001 From: marco_g Date: Wed, 27 Aug 2008 15:05:00 +0000 Subject: [PATCH 0374/1707] 2008-08-27 Marco Gerards * conf/common.rmk (pkglib_MODULES): Add scsi.mod. (scsi_mod_SOURCES): New variable. (scsi_mod_CFLAGS): Likewise (scsi_mod_LDFLAGS): Likewise. * disk/scsi.c: New file. * include/grub/scsi.h: Likewise. * include/grub/scsicmd.h: Likewise. * disk/ata.c: Include . (grub_atapi_packet): Do not use grub_ata_cmd, use registers instead. (grub_ata_iterate): Skip ATAPI devices. (grub_ata_open): Only handle ATAPI devices. (struct grub_atapi_read): Removed. (grub_atapi_readsector): Likewise. (grub_ata_read): No longer handle ATAPI devices. (grub_ata_write): Likewise. (grub_atapi_iterate): New function. (grub_atapi_read): Likewise. (grub_atapi_write): Likewise. (grub_atapi_open): Likewise. (grub_atapi_close): Likewise. (grub_atapi_dev): New variable. (GRUB_MOD_INIT(ata)): Register ATAPI as SCSI device. (GRUB_MOD_FINI(ata)): Unregister ATAPI. * include/grub/disk.h (enum grub_disk_dev_id): Add `GRUB_DISK_DEVICE_SCSI_ID'. --- ChangeLog | 34 ++++ conf/common.mk | 61 ++++++- conf/common.rmk | 9 +- disk/ata.c | 196 ++++++++++++--------- disk/scsi.c | 385 +++++++++++++++++++++++++++++++++++++++++ include/grub/disk.h | 1 + include/grub/scsi.h | 88 ++++++++++ include/grub/scsicmd.h | 122 +++++++++++++ 8 files changed, 814 insertions(+), 82 deletions(-) create mode 100644 disk/scsi.c create mode 100644 include/grub/scsi.h create mode 100644 include/grub/scsicmd.h diff --git a/ChangeLog b/ChangeLog index 79c1d435e..1cf7194c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +2008-08-27 Marco Gerards + + * conf/common.rmk (pkglib_MODULES): Add scsi.mod. + (scsi_mod_SOURCES): New variable. + (scsi_mod_CFLAGS): Likewise + (scsi_mod_LDFLAGS): Likewise. + + * disk/scsi.c: New file. + + * include/grub/scsi.h: Likewise. + + * include/grub/scsicmd.h: Likewise. + + * disk/ata.c: Include . + (grub_atapi_packet): Do not use grub_ata_cmd, use registers + instead. + (grub_ata_iterate): Skip ATAPI devices. + (grub_ata_open): Only handle ATAPI devices. + (struct grub_atapi_read): Removed. + (grub_atapi_readsector): Likewise. + (grub_ata_read): No longer handle ATAPI devices. + (grub_ata_write): Likewise. + (grub_atapi_iterate): New function. + (grub_atapi_read): Likewise. + (grub_atapi_write): Likewise. + (grub_atapi_open): Likewise. + (grub_atapi_close): Likewise. + (grub_atapi_dev): New variable. + (GRUB_MOD_INIT(ata)): Register ATAPI as SCSI device. + (GRUB_MOD_FINI(ata)): Unregister ATAPI. + + * include/grub/disk.h (enum grub_disk_dev_id): Add + `GRUB_DISK_DEVICE_SCSI_ID'. + 2008-08-26 Robert Millan * util/biosdisk.c (grub_util_biosdisk_open, open_device) diff --git a/conf/common.mk b/conf/common.mk index b180f051b..d432b0597 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -1929,10 +1929,10 @@ partmap-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) gen gpt_mod_CFLAGS = $(COMMON_CFLAGS) gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# Special disk structures +# Special disk structures and generic drivers pkglib_MODULES += raid.mod raid5rec.mod raid6rec.mod mdraid.mod dm_nv.mod \ - lvm.mod + lvm.mod scsi.mod # For raid.mod raid_mod_SOURCES = disk/raid.c @@ -2276,6 +2276,63 @@ partmap-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genpartmapli lvm_mod_CFLAGS = $(COMMON_CFLAGS) lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For scsi.mod +scsi_mod_SOURCES = disk/scsi.c +CLEANFILES += scsi.mod mod-scsi.o mod-scsi.c pre-scsi.o scsi_mod-disk_scsi.o und-scsi.lst +ifneq ($(scsi_mod_EXPORTS),no) +CLEANFILES += def-scsi.lst +DEFSYMFILES += def-scsi.lst +endif +MOSTLYCLEANFILES += scsi_mod-disk_scsi.d +UNDSYMFILES += und-scsi.lst + +scsi.mod: pre-scsi.o mod-scsi.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(scsi_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-scsi.o mod-scsi.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-scsi.o: $(scsi_mod_DEPENDENCIES) scsi_mod-disk_scsi.o + -rm -f $@ + $(TARGET_CC) $(scsi_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ scsi_mod-disk_scsi.o + +mod-scsi.o: mod-scsi.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -c -o $@ $< + +mod-scsi.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'scsi' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(scsi_mod_EXPORTS),no) +def-scsi.lst: pre-scsi.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 scsi/' > $@ +endif + +und-scsi.lst: pre-scsi.o + echo 'scsi' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +scsi_mod-disk_scsi.o: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -MD -c -o $@ $< +-include scsi_mod-disk_scsi.d + +CLEANFILES += cmd-scsi_mod-disk_scsi.lst fs-scsi_mod-disk_scsi.lst partmap-scsi_mod-disk_scsi.lst +COMMANDFILES += cmd-scsi_mod-disk_scsi.lst +FSFILES += fs-scsi_mod-disk_scsi.lst +PARTMAPFILES += partmap-scsi_mod-disk_scsi.lst + +cmd-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh scsi > $@ || (rm -f $@; exit 1) + +fs-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh scsi > $@ || (rm -f $@; exit 1) + +partmap-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh scsi > $@ || (rm -f $@; exit 1) + + +scsi_mod_CFLAGS = $(COMMON_CFLAGS) +scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Commands. pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ diff --git a/conf/common.rmk b/conf/common.rmk index 75863831a..d1c401aec 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -270,10 +270,10 @@ gpt_mod_SOURCES = partmap/gpt.c gpt_mod_CFLAGS = $(COMMON_CFLAGS) gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# Special disk structures +# Special disk structures and generic drivers pkglib_MODULES += raid.mod raid5rec.mod raid6rec.mod mdraid.mod dm_nv.mod \ - lvm.mod + lvm.mod scsi.mod # For raid.mod raid_mod_SOURCES = disk/raid.c @@ -305,6 +305,11 @@ lvm_mod_SOURCES = disk/lvm.c lvm_mod_CFLAGS = $(COMMON_CFLAGS) lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For scsi.mod +scsi_mod_SOURCES = disk/scsi.c +scsi_mod_CFLAGS = $(COMMON_CFLAGS) +scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Commands. pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ cmp.mod cat.mod help.mod font.mod search.mod \ diff --git a/disk/ata.c b/disk/ata.c index 4bcb6390b..ab4a1da24 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -23,6 +23,7 @@ #include #include #include +#include /* XXX: For now this only works on i386. */ #include @@ -305,8 +306,9 @@ grub_atapi_packet (struct grub_ata_device *dev, char *packet) grub_ata_regset (dev, GRUB_ATA_REG_LBAHIGH, 0xFF); grub_ata_regset (dev, GRUB_ATA_REG_LBAMID, 0xFF); - if (grub_ata_cmd (dev, GRUB_ATA_CMD_PACKET)) - return grub_errno; + grub_ata_regset (dev, GRUB_ATA_REG_CMD, GRUB_ATA_CMD_PACKET); + + grub_ata_wait (); if (grub_ata_pio_write (dev, packet, 12)) return grub_errno; @@ -757,6 +759,9 @@ grub_ata_iterate (int (*hook) (const char *name)) char devname[5]; grub_sprintf (devname, "ata%d", dev->port * 2 + dev->device); + if (dev->atapi) + continue; + if (hook (devname)) return 1; } @@ -781,13 +786,13 @@ grub_ata_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device"); if (dev->atapi) - disk->total_sectors = 9000000; /* XXX */ - else - disk->total_sectors = dev->size; + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not an ATA harddisk"); + + disk->total_sectors = dev->size; disk->id = (unsigned long) dev; - disk->has_partitions = !dev->atapi; + disk->has_partitions = 1; disk->data = dev; return 0; @@ -799,76 +804,11 @@ grub_ata_close (grub_disk_t disk __attribute__((unused))) } -struct grub_atapi_read -{ - grub_uint8_t code; - grub_uint8_t reserved1; - grub_uint32_t lba; - grub_uint32_t length; - grub_uint8_t reserved2[2]; -} __attribute__((packed)); - -static grub_err_t -grub_atapi_readsector (struct grub_ata_device *dev, - char *buf, grub_disk_addr_t sector) -{ - struct grub_atapi_read readcmd; - - readcmd.code = 0xA8; - readcmd.lba = grub_cpu_to_be32 (sector); - readcmd.length = grub_cpu_to_be32 (1); - - grub_atapi_packet (dev, (char *) &readcmd); - grub_ata_wait (); - if (grub_ata_pio_read (dev, buf, GRUB_CDROM_SECTOR_SIZE)) - return grub_errno; - - return 0; -} - static grub_err_t grub_ata_read (grub_disk_t disk, grub_disk_addr_t sector, grub_size_t size, char *buf) { - struct grub_ata_device *dev = (struct grub_ata_device *) disk->data; - int cdsector; - char *sbuf; - - if (! dev->atapi) - return grub_ata_readwrite (disk, sector, size, buf, 0); - - /* ATAPI is being used, so try to read from CDROM using ATAPI. */ - - sbuf = grub_malloc (GRUB_CDROM_SECTOR_SIZE); - if (! sbuf) - return grub_errno; - - /* CDROMs have sectors of 2048 bytes, so chop them into pieces of - 512 bytes. */ - while (size > 0) - { - int rsize; - int offset; - int max; - - cdsector = sector >> 2; - rsize = ((size * GRUB_DISK_SECTOR_SIZE > GRUB_CDROM_SECTOR_SIZE) - ? GRUB_CDROM_SECTOR_SIZE : size * GRUB_DISK_SECTOR_SIZE); - offset = (sector & 3) * GRUB_DISK_SECTOR_SIZE; - max = GRUB_CDROM_SECTOR_SIZE - offset; - rsize = (rsize > max) ? max : rsize; - - grub_atapi_readsector (dev, sbuf, cdsector); - grub_memcpy (buf + offset, sbuf, rsize); - - buf += rsize; - size -= rsize / GRUB_DISK_SECTOR_SIZE; - sector += rsize / GRUB_DISK_SECTOR_SIZE; - } - - grub_free (sbuf); - - return 0; + return grub_ata_readwrite (disk, sector, size, buf, 0); } static grub_err_t @@ -877,12 +817,7 @@ grub_ata_write (grub_disk_t disk, grub_size_t size, const char *buf) { - struct grub_ata_device *dev = (struct grub_ata_device *) disk->data; - - if (! dev->atapi) - return grub_ata_readwrite (disk, sector, size, (char *) buf, 1); - - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ATAPI write not supported"); + return grub_ata_readwrite (disk, sector, size, (char *) buf, 1); } static struct grub_disk_dev grub_atadisk_dev = @@ -897,6 +832,107 @@ static struct grub_disk_dev grub_atadisk_dev = .next = 0 }; + + +/* ATAPI code. */ + +static int +grub_atapi_iterate (int (*hook) (const char *name, int luns)) +{ + struct grub_ata_device *dev; + + for (dev = grub_ata_devices; dev; dev = dev->next) + { + char devname[7]; + grub_sprintf (devname, "ata%d", dev->port * 2 + dev->device); + + if (! dev->atapi) + continue; + + if (hook (devname, 1)) + return 1; + } + + return 0; + +} + +static grub_err_t +grub_atapi_read (struct grub_scsi *scsi, + grub_size_t cmdsize __attribute__((unused)), + char *cmd, grub_size_t size, char *buf) +{ + struct grub_ata_device *dev = (struct grub_ata_device *) scsi->data; + + if (grub_atapi_packet (dev, cmd)) + return grub_errno; + + grub_ata_wait (); /* XXX */ + + return grub_ata_pio_read (dev, buf, size); +} + +static grub_err_t +grub_atapi_write (struct grub_scsi *scsi, + grub_size_t cmdsize __attribute__((unused)), + char *cmd, grub_size_t size, char *buf) +{ + struct grub_ata_device *dev = (struct grub_ata_device *) scsi->data; + + if (grub_atapi_packet (dev, cmd)) + return grub_errno; + + grub_ata_wait (); /* XXX */ + + return grub_ata_pio_write (dev, buf, size); +} + +static grub_err_t +grub_atapi_open (const char *name, struct grub_scsi *scsi) +{ + struct grub_ata_device *dev; + struct grub_ata_device *devfnd; + + for (dev = grub_ata_devices; dev; dev = dev->next) + { + char devname[7]; + grub_sprintf (devname, "ata%d", dev->port * 2 + dev->device); + + if (!grub_strcmp (devname, name)) + { + devfnd = dev; + break; + } + } + + grub_dprintf ("ata", "opening ATAPI dev `%s'\n", name); + + if (! devfnd) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such ATAPI device"); + + scsi->data = devfnd; + scsi->name = grub_strdup (name); + scsi->luns = 1; + + return GRUB_ERR_NONE; +} + +static void +grub_atapi_close (struct grub_scsi *scsi) +{ + grub_free (scsi->name); +} + +static struct grub_scsi_dev grub_atapi_dev = + { + .name = "ATAPI", + .iterate = grub_atapi_iterate, + .open = grub_atapi_open, + .close = grub_atapi_close, + .read = grub_atapi_read, + .write = grub_atapi_write + }; + GRUB_MOD_INIT(ata) @@ -915,9 +951,13 @@ GRUB_MOD_INIT(ata) grub_ata_initialize (); grub_disk_dev_register (&grub_atadisk_dev); + + /* ATAPI devices are handled by scsi.mod. */ + grub_scsi_dev_register (&grub_atapi_dev); } GRUB_MOD_FINI(ata) { + grub_scsi_dev_unregister (&grub_atapi_dev); grub_disk_dev_unregister (&grub_atadisk_dev); } diff --git a/disk/scsi.c b/disk/scsi.c new file mode 100644 index 000000000..01ef04ee7 --- /dev/null +++ b/disk/scsi.c @@ -0,0 +1,385 @@ +/* scsi.c - scsi support. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +static grub_scsi_dev_t grub_scsi_dev_list; + +void +grub_scsi_dev_register (grub_scsi_dev_t dev) +{ + dev->next = grub_scsi_dev_list; + grub_scsi_dev_list = dev; +} + +void +grub_scsi_dev_unregister (grub_scsi_dev_t dev) +{ + grub_scsi_dev_t *p, q; + + for (p = &grub_scsi_dev_list, q = *p; q; p = &(q->next), q = q->next) + if (q == dev) + { + *p = q->next; + break; + } +} + + +/* Determine the the device is removable and the type of the device + SCSI. */ +static grub_err_t +grub_scsi_inquiry (grub_scsi_t scsi) +{ + struct grub_scsi_inquiry iq; + struct grub_scsi_inquiry_data iqd; + grub_err_t err; + + iq.opcode = grub_scsi_cmd_inquiry; + iq.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + iq.reserved = 0; + iq.alloc_length = 0x24; /* XXX: Hardcoded for now */ + iq.reserved2 = 0; + + err = scsi->dev->read (scsi, sizeof (iq), (char *) &iq, + sizeof (iqd), (char *) &iqd); + if (err) + return err; + + scsi->devtype = iqd.devtype & GRUB_SCSI_DEVTYPE_MASK; + scsi->removable = iqd.rmb >> GRUB_SCSI_REMOVABLE_BIT; + + return GRUB_ERR_NONE; +} + +/* Read the capacity and block size of SCSI. */ +static grub_err_t +grub_scsi_read_capacity (grub_scsi_t scsi) +{ + struct grub_scsi_read_capacity rc; + struct grub_scsi_read_capacity_data rcd; + grub_err_t err; + + rc.opcode = grub_scsi_cmd_read_capacity; + rc.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + grub_memset (rc.reserved, 0, sizeof (rc.reserved)); + + err = scsi->dev->read (scsi, sizeof (rc), (char *) &rc, + sizeof (rcd), (char *) &rcd); + if (err) + return err; + + scsi->size = grub_be_to_cpu32 (rcd.size); + scsi->blocksize = grub_be_to_cpu32 (rcd.blocksize); + + return GRUB_ERR_NONE; +} + +/* Send a SCSI request for DISK: read SIZE sectors starting with + sector SECTOR to BUF. */ +static grub_err_t +grub_scsi_read10 (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + grub_scsi_t scsi; + struct grub_scsi_read10 rd; + + scsi = disk->data; + + rd.opcode = grub_scsi_cmd_read10; + rd.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + rd.lba = grub_cpu_to_be32 (sector); + rd.reserved = 0; + rd.size = grub_cpu_to_be16 (size); + rd.reserved2 = 0; + rd.pad = 0; + + return scsi->dev->read (scsi, sizeof (rd), (char *) &rd, size * 512, buf); +} + +/* Send a SCSI request for DISK: read SIZE sectors starting with + sector SECTOR to BUF. */ +static grub_err_t +grub_scsi_read12 (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + grub_scsi_t scsi; + struct grub_scsi_read12 rd; + + scsi = disk->data; + + rd.opcode = grub_scsi_cmd_read12; + rd.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + rd.lba = grub_cpu_to_be32 (sector); + rd.size = grub_cpu_to_be32 (size); + rd.reserved = 0; + rd.control = 0; + + return scsi->dev->read (scsi, sizeof (rd), (char *) &rd, size * 512, buf); +} + +#if 0 +/* Send a SCSI request for DISK: write the data stored in BUF to SIZE + sectors starting with SECTOR. */ +static grub_err_t +grub_scsi_write10 (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + grub_scsi_t scsi; + struct grub_scsi_write10 wr; + + scsi = disk->data; + + wr.opcode = grub_scsi_cmd_write10; + wr.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + wr.lba = grub_cpu_to_be32 (sector); + wr.reserved = 0; + wr.size = grub_cpu_to_be16 (size); + wr.reserved2 = 0; + wr.pad = 0; + + return scsi->dev->write (scsi, sizeof (wr), (char *) &wr, size * 512, buf); +} + +/* Send a SCSI request for DISK: write the data stored in BUF to SIZE + sectors starting with SECTOR. */ +static grub_err_t +grub_scsi_write12 (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + grub_scsi_t scsi; + struct grub_scsi_write10 wr; + + scsi = disk->data; + + wr.opcode = grub_scsi_cmd_write12; + wr.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + wr.lba = grub_cpu_to_be32 (sector); + wr.size = grub_cpu_to_be32 (size); + wr.reserved = 0; + wr.pad = 0; + + return scsi->dev->write (scsi, sizeof (wr), (char *) &wr, size * 512, buf); +} +#endif + + +static int +grub_scsi_iterate (int (*hook) (const char *name)) +{ + grub_scsi_dev_t p; + + auto int scsi_iterate (const char *name, int luns); + + int scsi_iterate (const char *name, int luns) + { + char sname[40]; + int i; + + /* In case of a single LUN, just return `usbX'. */ + if (luns == 1) + return hook (name); + + /* In case of multiple LUNs, every LUN will get a prefix to + distinguish it. */ + for (i = 0; i < luns; i++) + { + grub_sprintf (sname, "%s%c", name, 'a' + i); + if (hook (sname)) + return 1; + } + return 0; + } + + for (p = grub_scsi_dev_list; p; p = p->next) + if (p->iterate && (p->iterate) (scsi_iterate)) + return 1; + + return 0; +} + +static grub_err_t +grub_scsi_open (const char *name, grub_disk_t disk) +{ + grub_scsi_dev_t p; + grub_scsi_t scsi; + grub_err_t err; + int len; + int lun; + + scsi = grub_malloc (sizeof (*scsi)); + if (! scsi) + return grub_errno; + + len = grub_strlen (name); + lun = name[len - 1] - 'a'; + + /* Try to detect a LUN ('a'-'z'), otherwise just use the first + LUN. */ + if (lun < 0 || lun > 26) + lun = 0; + + for (p = grub_scsi_dev_list; p; p = p->next) + { + if (! p->open (name, scsi)) + { + disk->id = (unsigned long) "scsi"; /* XXX */ + disk->data = scsi; + scsi->dev = p; + scsi->lun = lun; + scsi->name = grub_strdup (name); + if (! scsi->name) + { + p->close (scsi); + return grub_errno; + } + + grub_dprintf ("scsi", "dev opened\n"); + + err = grub_scsi_inquiry (scsi); + if (err) + { + grub_dprintf ("scsi", "inquiry failed\n"); + p->close (scsi); + return grub_errno; + } + + grub_dprintf ("scsi", "inquiry: devtype=0x%02x removable=%d\n", + scsi->devtype, scsi->removable); + + /* Try to be conservative about the device types + supported. */ + if (scsi->devtype != grub_scsi_devtype_direct + && scsi->devtype != grub_scsi_devtype_cdrom) + { + p->close (scsi); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "unknown SCSI device"); + } + + if (scsi->devtype == grub_scsi_devtype_cdrom) + disk->has_partitions = 0; + else + disk->has_partitions = 1; + + err = grub_scsi_read_capacity (scsi); + if (err) + { + grub_dprintf ("scsi", "READ CAPACITY failed\n"); + p->close (scsi); + return grub_errno; + } + + /* SCSI blocks can be something else than 512, although GRUB + wants 512 byte blocks. */ + disk->total_sectors = ((scsi->size * scsi->blocksize) + << GRUB_DISK_SECTOR_BITS); + + grub_dprintf ("scsi", "capacity=%d, blksize=%d\n", + (int) disk->total_sectors, scsi->blocksize); + + return GRUB_ERR_NONE; + } + } + + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); +} + +static void +grub_scsi_close (grub_disk_t disk) +{ + grub_scsi_t scsi; + + scsi = disk->data; + return scsi->dev->close (scsi); +} + +static grub_err_t +grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + grub_scsi_t scsi; + + scsi = disk->data; + + /* SCSI sectors are variable in size. GRUB uses 512 byte + sectors. */ + sector = grub_divmod64 (sector, scsi->blocksize >> GRUB_DISK_SECTOR_BITS, + NULL); + + /* Depending on the type, select a read function. */ + switch (scsi->devtype) + { + case grub_scsi_devtype_direct: + return grub_scsi_read10 (disk, sector, size, buf); + + case grub_scsi_devtype_cdrom: + return grub_scsi_read12 (disk, sector, size, buf); + } + + /* XXX: Never reached. */ + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_scsi_write (grub_disk_t disk __attribute((unused)), + grub_disk_addr_t sector __attribute((unused)), + grub_size_t size __attribute((unused)), + const char *buf __attribute((unused))) +{ +#if 0 + /* XXX: Not tested yet! */ + + /* XXX: This should depend on the device type? */ + return grub_scsi_write10 (disk, sector, size, buf); +#endif + return GRUB_ERR_NOT_IMPLEMENTED_YET; +} + + +static struct grub_disk_dev grub_scsi_dev = + { + .name = "scsi", + .id = GRUB_DISK_DEVICE_SCSI_ID, + .iterate = grub_scsi_iterate, + .open = grub_scsi_open, + .close = grub_scsi_close, + .read = grub_scsi_read, + .write = grub_scsi_write, + .next = 0 + }; + +GRUB_MOD_INIT(scsi) +{ + grub_disk_dev_register (&grub_scsi_dev); +} + +GRUB_MOD_FINI(scsi) +{ + grub_disk_dev_unregister (&grub_scsi_dev); +} diff --git a/include/grub/disk.h b/include/grub/disk.h index 049cc91b9..a39afe2ff 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -40,6 +40,7 @@ enum grub_disk_dev_id GRUB_DISK_DEVICE_NAND_ID, GRUB_DISK_DEVICE_UUID_ID, GRUB_DISK_DEVICE_PXE_ID, + GRUB_DISK_DEVICE_SCSI_ID, }; struct grub_disk; diff --git a/include/grub/scsi.h b/include/grub/scsi.h new file mode 100644 index 000000000..fbe4582ca --- /dev/null +++ b/include/grub/scsi.h @@ -0,0 +1,88 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_SCSI_H +#define GRUB_SCSI_H 1 + +typedef struct grub_scsi_dev *grub_scsi_dev_t; + +void grub_scsi_dev_register (grub_scsi_dev_t dev); +void grub_scsi_dev_unregister (grub_scsi_dev_t dev); + +struct grub_scsi; + +struct grub_scsi_dev +{ + /* The device name. */ + const char *name; + + /* Call HOOK with each device name, until HOOK returns non-zero. */ + int (*iterate) (int (*hook) (const char *name, int luns)); + + /* Open the device named NAME, and set up SCSI. */ + grub_err_t (*open) (const char *name, struct grub_scsi *scsi); + + /* Close the scsi device SCSI. */ + void (*close) (struct grub_scsi *scsi); + + /* Read SIZE bytes from the device SCSI into BUF after sending the + command CMD of size CMDSIZE. */ + grub_err_t (*read) (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, + grub_size_t size, char *buf); + + /* Write SIZE bytes from BUF to the device SCSI after sending the + command CMD of size CMDSIZE. */ + grub_err_t (*write) (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, + grub_size_t size, char *buf); + + /* The next scsi device. */ + struct grub_scsi_dev *next; +}; + +struct grub_scsi +{ + /* The scsi device name. */ + char *name; + + /* The underlying scsi device. */ + grub_scsi_dev_t dev; + + /* Type of SCSI device. XXX: Make enum. */ + grub_uint8_t devtype; + + /* Number of LUNs. */ + int luns; + + /* LUN for this `struct grub_scsi'. */ + int lun; + + /* Set to 0 when not removable, 1 when removable. */ + int removable; + + /* Size of the device in blocks. */ + int size; + + /* Size of one block. */ + int blocksize; + + /* Device-specific data. */ + void *data; +}; +typedef struct grub_scsi *grub_scsi_t; + +#endif /* GRUB_SCSI_H */ diff --git a/include/grub/scsicmd.h b/include/grub/scsicmd.h new file mode 100644 index 000000000..40f237a17 --- /dev/null +++ b/include/grub/scsicmd.h @@ -0,0 +1,122 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_SCSICMD_H +#define GRUB_SCSICMD_H 1 + +#include + +#define GRUB_SCSI_DEVTYPE_MASK 31 +#define GRUB_SCSI_REMOVABLE_BIT 7 +#define GRUB_SCSI_LUN_SHIFT 5 + +struct grub_scsi_inquiry +{ + grub_uint8_t opcode; + grub_uint8_t lun; + grub_uint16_t reserved; + grub_uint16_t alloc_length; + grub_uint8_t reserved2; + grub_uint8_t pad[5]; +} __attribute__((packed)); + +struct grub_scsi_inquiry_data +{ + grub_uint8_t devtype; + grub_uint8_t rmb; + grub_uint16_t reserved; + grub_uint8_t length; + grub_uint8_t reserved2[3]; + char vendor[8]; + char prodid[16]; + char prodrev[4]; +} __attribute__((packed)); + +struct grub_scsi_read_capacity +{ + grub_uint8_t opcode; + grub_uint8_t lun; + grub_uint8_t reserved[8]; + grub_uint8_t pad[2]; +} __attribute__((packed)); + +struct grub_scsi_read_capacity_data +{ + grub_uint32_t size; + grub_uint32_t blocksize; +} __attribute__((packed)); + +struct grub_scsi_read10 +{ + grub_uint8_t opcode; + grub_uint8_t lun; + grub_uint32_t lba; + grub_uint8_t reserved; + grub_uint16_t size; + grub_uint8_t reserved2; + grub_uint16_t pad; +} __attribute__((packed)); + +struct grub_scsi_read12 +{ + grub_uint8_t opcode; + grub_uint8_t lun; + grub_uint32_t lba; + grub_uint32_t size; + grub_uint8_t reserved; + grub_uint8_t control; +} __attribute__((packed)); + +struct grub_scsi_write10 +{ + grub_uint8_t opcode; + grub_uint8_t lun; + grub_uint32_t lba; + grub_uint8_t reserved; + grub_uint16_t size; + grub_uint8_t reserved2; + grub_uint16_t pad; +} __attribute__((packed)); + +struct grub_scsi_write12 +{ + grub_uint8_t opcode; + grub_uint8_t lun; + grub_uint32_t lba; + grub_uint32_t size; + grub_uint8_t reserved; + grub_uint8_t control; +} __attribute__((packed)); + +typedef enum + { + grub_scsi_cmd_inquiry = 0x12, + grub_scsi_cmd_read_capacity = 0x25, + grub_scsi_cmd_read10 = 0x28, + grub_scsi_cmd_write10 = 0x2a, + grub_scsi_cmd_read12 = 0xa8, + grub_scsi_cmd_write12 = 0xaa + } grub_scsi_cmd_t; + +typedef enum + { + grub_scsi_devtype_direct = 0x00, + grub_scsi_devtype_cdrom = 0x05 + } grub_scsi_devtype_t; + +#endif /* GRUB_SCSICMD_H */ From 678e849cd303b9c0d7a3f563c36cf59ed1c7f367 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 28 Aug 2008 14:36:18 +0000 Subject: [PATCH 0375/1707] 2008-08-28 Robert Millan Change find_grub_drive() syntax so it doesn't prevent it from detecting NULL names as errors. * util/biosdisk.c (find_grub_drive): Move free slot search code from here ... (find_free_slot): ... to here. (read_device_map): Use find_free_slot() to search for free slots. --- ChangeLog | 10 ++++++++++ util/biosdisk.c | 18 +++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1cf7194c6..52fa13eff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-08-28 Robert Millan + + Change find_grub_drive() syntax so it doesn't prevent it from + detecting NULL names as errors. + + * util/biosdisk.c (find_grub_drive): Move free slot search code + from here ... + (find_free_slot): ... to here. + (read_device_map): Use find_free_slot() to search for free slots. + 2008-08-27 Marco Gerards * conf/common.rmk (pkglib_MODULES): Add scsi.mod. diff --git a/util/biosdisk.c b/util/biosdisk.c index fa1143b1f..9fc158373 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -120,12 +120,16 @@ find_grub_drive (const char *name) if (map[i].drive && ! strcmp (map[i].drive, name)) return i; } - else - { - for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) - if (! map[i].drive) - return i; - } + + return -1; +} + +static int +find_free_slot () +{ + for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) + if (! map[i].drive) + return i; return -1; } @@ -503,7 +507,7 @@ read_device_map (const char *dev_map) p++; /* Find a free slot. */ - drive = find_grub_drive (NULL); + drive = find_free_slot (); if (drive < 0) show_error ("Map table size exceeded"); From 1c282483bf0454efe72fe1d942e18fb07f5371b0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 28 Aug 2008 19:08:21 +0000 Subject: [PATCH 0376/1707] 2008-08-28 Robert Millan * util/biosdisk.c (find_grub_drive): Declare missing `i' variable. --- ChangeLog | 4 ++++ util/biosdisk.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 52fa13eff..b2528ee16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-28 Robert Millan + + * util/biosdisk.c (find_grub_drive): Declare missing `i' variable. + 2008-08-28 Robert Millan Change find_grub_drive() syntax so it doesn't prevent it from diff --git a/util/biosdisk.c b/util/biosdisk.c index 9fc158373..2d92cfe2c 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -127,6 +127,8 @@ find_grub_drive (const char *name) static int find_free_slot () { + unsigned int i; + for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) if (! map[i].drive) return i; From ab3f2673290b547ca731449bf788ddf9e94aa7d3 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 29 Aug 2008 01:08:05 +0000 Subject: [PATCH 0377/1707] 2008-08-28 Pavel Roskin * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add kern/time.c. --- ChangeLog | 5 +++++ conf/powerpc-ieee1275.mk | 14 +++++++++----- conf/powerpc-ieee1275.rmk | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2528ee16..38300e0aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-28 Pavel Roskin + + * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add + kern/time.c. + 2008-08-28 Robert Millan * util/biosdisk.c (find_grub_drive): Declare missing `i' variable. diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 47155003f..68742a692 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -433,13 +433,13 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ - kern/generic/millisleep.c \ + kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S $(kern/powerpc/ieee1275/crt0.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -537,6 +537,10 @@ kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/m $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_generic_millisleep.d +kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_time.d + kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index d97207dff..e31e31c9f 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -80,7 +80,7 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/init.c term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ - kern/generic/millisleep.c \ + kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) From 6e5a42fe9a99870f1551666662591f04cf58d832 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 29 Aug 2008 19:55:23 +0000 Subject: [PATCH 0378/1707] 2008-08-29 Bean * configure.ac: Change host_os to cygwin for mingw. (asprintf): New check for function. * include/grub/symbol.h: Replace #ifndef __CYGWIN__ with #if ! defined (__CYGWIN__) && ! defined (__MINGW32__). * include/grub/util/misc.h: #include and , declear asprintf if HAVE_ASPRINTF is not set, declear fseeko, ftello, sync, sleep and grub_util_get_disk_size for mingw. * util/biosdisk.c (grub_util_biosdisk_open): Use grub_util_get_disk_size to get size in mingw. (open_device): Use flag O_BINARY if it's defined. (find_root_device): Add dummy code for mingw. * util/grub-mkdevicemap.c (get_floppy_disk_name): Return 0 for mingw. (get_ide_disk_name): Return //./PHYSICALDRIVE%d for mingw. (get_scsi_disk_name): Return 0 for mingw. * util/hostfs.c: #include . (grub_hostfs_open): Use "rb" flag to open file, use grub_util_get_disk_size to get disk size for mingw. * util/misc.c: #include and in mingw. (asprintf): New function if HAVE_ASPRINTF is not set. (sync): New function for mingw. (sleep): Likewise. (grub_util_get_disk_size): Likewise. --- ChangeLog | 31 +++++++++++++++ config.h.in | 3 ++ configure | 11 +++++- configure.ac | 10 ++++- include/grub/symbol.h | 2 +- include/grub/util/misc.h | 21 +++++++++++ util/biosdisk.c | 20 +++++++++- util/getroot.c | 11 +++++- util/grub-mkdevicemap.c | 8 ++++ util/hostfs.c | 7 +++- util/misc.c | 81 ++++++++++++++++++++++++++++++++++++++++ 11 files changed, 199 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38300e0aa..17b7ef605 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2008-08-29 Bean + + * configure.ac: Change host_os to cygwin for mingw. + (asprintf): New check for function. + + * include/grub/symbol.h: Replace #ifndef __CYGWIN__ with + #if ! defined (__CYGWIN__) && ! defined (__MINGW32__). + + * include/grub/util/misc.h: #include and , + declear asprintf if HAVE_ASPRINTF is not set, declear fseeko, ftello, + sync, sleep and grub_util_get_disk_size for mingw. + + * util/biosdisk.c (grub_util_biosdisk_open): Use grub_util_get_disk_size + to get size in mingw. + (open_device): Use flag O_BINARY if it's defined. + (find_root_device): Add dummy code for mingw. + + * util/grub-mkdevicemap.c (get_floppy_disk_name): Return 0 for mingw. + (get_ide_disk_name): Return //./PHYSICALDRIVE%d for mingw. + (get_scsi_disk_name): Return 0 for mingw. + + * util/hostfs.c: #include . + (grub_hostfs_open): Use "rb" flag to open file, use + grub_util_get_disk_size to get disk size for mingw. + + * util/misc.c: #include and in mingw. + (asprintf): New function if HAVE_ASPRINTF is not set. + (sync): New function for mingw. + (sleep): Likewise. + (grub_util_get_disk_size): Likewise. + 2008-08-28 Pavel Roskin * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add diff --git a/config.h.in b/config.h.in index e2dd41f08..044e81ee9 100644 --- a/config.h.in +++ b/config.h.in @@ -25,6 +25,9 @@ /* Define if C symbols get an underscore after compilation */ #undef HAVE_ASM_USCORE +/* Define to 1 if you have the `asprintf' function. */ +#undef HAVE_ASPRINTF + /* Define to 1 if you have the header file. */ #undef HAVE_CURSES_H diff --git a/configure b/configure index 7c070af21..818204d8e 100644 --- a/configure +++ b/configure @@ -1993,6 +1993,14 @@ case "$target_cpu" in x86_64 | sparc64) target_m64=1 ;; esac +case "$host_os" in + mingw32) host_os=cygwin ;; +esac + +case "$target_os" in + mingw32) target_os=cygwin ;; +esac + @@ -5786,7 +5794,8 @@ fi # Check for functions. -for ac_func in posix_memalign memalign + +for ac_func in posix_memalign memalign asprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 diff --git a/configure.ac b/configure.ac index f561b8bb0..c36745413 100644 --- a/configure.ac +++ b/configure.ac @@ -99,6 +99,14 @@ case "$target_cpu" in x86_64 | sparc64) target_m64=1 ;; esac +case "$host_os" in + mingw32) host_os=cygwin ;; +esac + +case "$target_os" in + mingw32) target_os=cygwin ;; +esac + AC_SUBST(target_cpu) AC_SUBST(target_os) AC_SUBST(platform) @@ -183,7 +191,7 @@ if test "$target_cpu"-"$platform" = i386-pc; then fi # Check for functions. -AC_CHECK_FUNCS(posix_memalign memalign) +AC_CHECK_FUNCS(posix_memalign memalign asprintf) # # Check for target programs. diff --git a/include/grub/symbol.h b/include/grub/symbol.h index e95149055..c662c14d3 100644 --- a/include/grub/symbol.h +++ b/include/grub/symbol.h @@ -28,7 +28,7 @@ # define EXT_C(sym) sym #endif -#ifndef __CYGWIN__ +#if ! defined (__CYGWIN__) && ! defined (__MINGW32__) #define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), "function" ; EXT_C(x): #define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), "object" ; EXT_C(x): #else diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h index c9a8528c2..3f145e86a 100644 --- a/include/grub/util/misc.h +++ b/include/grub/util/misc.h @@ -24,6 +24,9 @@ #include #include +#include +#include + #ifdef __NetBSD__ /* NetBSD uses /boot for its boot block. */ # define DEFAULT_DIRECTORY "/grub" @@ -55,4 +58,22 @@ void grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out); char *grub_util_get_disk_name (int disk, char *name); +#ifndef HAVE_ASPRINTF + +int asprintf (char **buf, const char *fmt, ...); + +#endif + +#ifdef __MINGW32__ + +#define fseeko fseeko64 +#define ftello ftello64 + +void sync (void); +void sleep(int s); + +grub_int64_t grub_util_get_disk_size (char *name); + +#endif + #endif /* ! GRUB_UTIL_MISC_HEADER */ diff --git a/util/biosdisk.c b/util/biosdisk.c index 2d92cfe2c..5465cb058 100644 --- a/util/biosdisk.c +++ b/util/biosdisk.c @@ -163,7 +163,22 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) disk->id = drive; /* Get the size. */ -#if defined(__linux__) || defined(__CYGWIN__) +#if defined(__MINGW32__) + { + grub_uint64_t size; + + size = grub_util_get_disk_size (map[drive].device); + + if (size % 512) + grub_util_error ("unaligned device size"); + + disk->total_sectors = size >> 9; + + grub_util_info ("the size of %s is %llu", name, disk->total_sectors); + + return GRUB_ERR_NONE; + } +#elif defined(__linux__) || defined(__CYGWIN__) { unsigned long long nr; int fd; @@ -281,6 +296,9 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) #ifdef O_FSYNC flags |= O_FSYNC; #endif +#ifdef O_BINARY + flags |= O_BINARY; +#endif #ifdef __linux__ /* Linux has a bug that the disk cache for a whole disk is not consistent diff --git a/util/getroot.c b/util/getroot.c index 826092b99..f721e7fc3 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -169,7 +169,16 @@ grub_get_prefix (const char *dir) return prefix; } -#ifndef __CYGWIN__ +#ifdef __MINGW32__ + +static char * +find_root_device (const char *dir __attribute__ ((unused)), + dev_t dev __attribute__ ((unused))) +{ + return 0; +} + +#elif ! defined(__CYGWIN__) static char * find_root_device (const char *dir, dev_t dev) diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 5b8943704..38a90b7b3 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -169,6 +169,9 @@ get_floppy_disk_name (char *name, int unit) #elif defined(__CYGWIN__) /* Cygwin */ sprintf (name, "/dev/fd%d", unit); +#elif defined(__MINGW32__) + (void) unit; + *name = 0; #else # warning "BIOS floppy drives cannot be guessed in your operating system." /* Set NAME to a bogus string. */ @@ -214,6 +217,8 @@ get_ide_disk_name (char *name, int unit) /* Cygwin emulates all disks as /dev/sdX. */ (void) unit; *name = 0; +#elif defined(__MINGW32__) + sprintf (name, "//./PHYSICALDRIVE%d", unit); #else # warning "BIOS IDE drives cannot be guessed in your operating system." /* Set NAME to a bogus string. */ @@ -258,6 +263,9 @@ get_scsi_disk_name (char *name, int unit) #elif defined(__CYGWIN__) /* Cygwin emulates all disks as /dev/sdX. */ sprintf (name, "/dev/sd%c", unit + 'a'); +#elif defined(__MINGW32__) + (void) unit; + *name = 0; #else # warning "BIOS SCSI drives cannot be guessed in your operating system." /* Set NAME to a bogus string. */ diff --git a/util/hostfs.c b/util/hostfs.c index b74fbd3ca..d68c36fe3 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include @@ -95,15 +96,19 @@ grub_hostfs_open (struct grub_file *file, const char *name) { FILE *f; - f = fopen (name, "r"); + f = fopen (name, "rb"); if (! f) return grub_error (GRUB_ERR_BAD_FILENAME, "can't open `%s'", name); file->data = f; +#ifdef __MINGW32__ + file->size = grub_util_get_disk_size (name); +#else fseeko (f, 0, SEEK_END); file->size = ftello (f); fseeko (f, 0, SEEK_SET); +#endif return GRUB_ERR_NONE; } diff --git a/util/misc.c b/util/misc.c index 7d877ccf3..559022ff1 100644 --- a/util/misc.c +++ b/util/misc.c @@ -259,6 +259,8 @@ grub_memalign (grub_size_t align, grub_size_t size) #elif defined(HAVE_MEMALIGN) p = memalign (align, size); #else + (void) align; + (void) size; grub_util_error ("grub_memalign is not supported"); #endif @@ -313,3 +315,82 @@ grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) { } + +#ifndef HAVE_ASPRINTF + +int +asprintf (char **buf, const char *fmt, ...) +{ + int status; + va_list ap; + + /* Should be large enough. */ + *buf = xmalloc (512); + + va_start (ap, fmt); + status = vsprintf (*buf, fmt, ap); + va_end (ap); + + return status; +} + +#endif + +#ifdef __MINGW32__ + +#include +#include + +void sync (void) +{ +} + +void sleep (int s) +{ + Sleep (s * 1000); +} + +grub_int64_t +grub_util_get_disk_size (char *name) +{ + HANDLE hd; + grub_int64_t size = -1LL; + + hd = CreateFile (name, GENERIC_READ, FILE_SHARE_READ | FILE_SHARE_WRITE, + 0, OPEN_EXISTING, 0, 0); + + if (hd == INVALID_HANDLE_VALUE) + return size; + + if (((name[0] == '/') || (name[0] == '\\')) && + ((name[1] == '/') || (name[1] == '\\')) && + (name[2] == '.') && + ((name[3] == '/') || (name[3] == '\\')) && + (! strncasecmp (name + 4, "PHYSICALDRIVE", 13))) + { + DWORD nr; + DISK_GEOMETRY g; + + if (! DeviceIoControl (hd, IOCTL_DISK_GET_DRIVE_GEOMETRY, + 0, 0, &g, sizeof (g), &nr, 0)) + goto fail; + + size = g.Cylinders.QuadPart; + size *= g.TracksPerCylinder * g.SectorsPerTrack * g.BytesPerSector; + } + else + { + LARGE_INTEGER s; + + s.LowPart = GetFileSize (hd, &s.HighPart); + size = s.QuadPart; + } + +fail: + + CloseHandle (hd); + + return size; +} + +#endif From b497a269dbb43dd84f27706ad40c5dfcb2d075d0 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 29 Aug 2008 21:46:17 +0000 Subject: [PATCH 0379/1707] 2008-08-29 Pavel Roskin * kern/powerpc/ieee1275/crt0.S: Include grub/symbol.h and grub/cpu/kernel.h. Add start label for consistency with other platforms. Add grub_prefix immediately after start. Add jump to the code after grub_prefix. * include/grub/powerpc/kernel.h: Provide valid values for GRUB_KERNEL_CPU_PREFIX and GRUB_KERNEL_CPU_DATA_END. --- ChangeLog | 9 +++++++++ include/grub/powerpc/kernel.h | 5 ++--- kern/powerpc/ieee1275/crt0.S | 22 ++++++++++++++++++++-- 3 files changed, 31 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 17b7ef605..42c9ebdeb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-08-29 Pavel Roskin + + * kern/powerpc/ieee1275/crt0.S: Include grub/symbol.h and + grub/cpu/kernel.h. Add start label for consistency with other + platforms. Add grub_prefix immediately after start. Add jump + to the code after grub_prefix. + * include/grub/powerpc/kernel.h: Provide valid values for + GRUB_KERNEL_CPU_PREFIX and GRUB_KERNEL_CPU_DATA_END. + 2008-08-29 Bean * configure.ac: Change host_os to cygwin for mingw. diff --git a/include/grub/powerpc/kernel.h b/include/grub/powerpc/kernel.h index 2bcc3785d..b4687337f 100644 --- a/include/grub/powerpc/kernel.h +++ b/include/grub/powerpc/kernel.h @@ -26,8 +26,7 @@ rewrite grub-mkimage to generate valid ELF files. */ #define GRUB_MOD_GAP 0x8000 -/* prefix not supported on powerpc yet. */ -#define GRUB_KERNEL_CPU_PREFIX 0 -#define GRUB_KERNEL_CPU_DATA_END 0 +#define GRUB_KERNEL_CPU_PREFIX 0x4 +#define GRUB_KERNEL_CPU_DATA_END 0x44 #endif diff --git a/kern/powerpc/ieee1275/crt0.S b/kern/powerpc/ieee1275/crt0.S index fac99d6b0..35d6133e2 100644 --- a/kern/powerpc/ieee1275/crt0.S +++ b/kern/powerpc/ieee1275/crt0.S @@ -17,13 +17,31 @@ * along with GRUB. If not, see . */ +#include +#include + .extern __bss_start .extern _end .text .align 2 - .globl _start -_start: + .globl start, _start +start: +_start: + b codestart + + . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX + +VARIABLE(grub_prefix) + /* to be filled by grub-mkelfimage */ + + /* + * Leave some breathing room for the prefix. + */ + + . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END + +codestart: li 2, 0 li 13, 0 From e3925185cc73bcd3f15479562519d60c37b817f7 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 29 Aug 2008 21:54:26 +0000 Subject: [PATCH 0380/1707] 2008-08-29 Pavel Roskin * kern/powerpc/ieee1275/crt0.S: Rename to ... * kern/powerpc/ieee1275/startup.S: ... this. * conf/powerpc-ieee1275.rmk: Adjust for the above. * DISTLIST: Likewise. --- ChangeLog | 5 +++++ DISTLIST | 2 +- conf/powerpc-ieee1275.mk | 14 +++++++------- conf/powerpc-ieee1275.rmk | 2 +- kern/powerpc/ieee1275/{crt0.S => startup.S} | 2 +- 5 files changed, 15 insertions(+), 10 deletions(-) rename kern/powerpc/ieee1275/{crt0.S => startup.S} (97%) diff --git a/ChangeLog b/ChangeLog index 42c9ebdeb..687db986b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2008-08-29 Pavel Roskin + * kern/powerpc/ieee1275/crt0.S: Rename to ... + * kern/powerpc/ieee1275/startup.S: ... this. + * conf/powerpc-ieee1275.rmk: Adjust for the above. + * DISTLIST: Likewise. + * kern/powerpc/ieee1275/crt0.S: Include grub/symbol.h and grub/cpu/kernel.h. Add start label for consistency with other platforms. Add grub_prefix immediately after start. Add jump diff --git a/DISTLIST b/DISTLIST index 213d87dc2..55ff9df62 100644 --- a/DISTLIST +++ b/DISTLIST @@ -326,7 +326,7 @@ kern/ieee1275/init.c kern/ieee1275/openfw.c kern/powerpc/cache.S kern/powerpc/dl.c -kern/powerpc/ieee1275/crt0.S +kern/powerpc/ieee1275/startup.S kern/sparc64/cache.S kern/sparc64/dl.c kern/sparc64/ieee1275/init.c diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 68742a692..10e3a97fc 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -426,7 +426,7 @@ grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) grub_emu_LDFLAGS = $(LIBCURSES) -kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ +kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ @@ -435,15 +435,15 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_crt0.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_crt0.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) -kernel_elf-kern_powerpc_ieee1275_crt0.o: kern/powerpc/ieee1275/crt0.S $(kern/powerpc/ieee1275/crt0.S_DEPENDENCIES) +kernel_elf-kern_powerpc_ieee1275_startup.o: kern/powerpc/ieee1275/startup.S $(kern/powerpc/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_crt0.d +-include kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.o: kern/ieee1275/cmain.c $(kern/ieee1275/cmain.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index e31e31c9f..b75e90309 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -73,7 +73,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_emu_LDFLAGS = $(LIBCURSES) -kernel_elf_SOURCES = kern/powerpc/ieee1275/crt0.S kern/ieee1275/cmain.c \ +kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ diff --git a/kern/powerpc/ieee1275/crt0.S b/kern/powerpc/ieee1275/startup.S similarity index 97% rename from kern/powerpc/ieee1275/crt0.S rename to kern/powerpc/ieee1275/startup.S index 35d6133e2..4b18fd745 100644 --- a/kern/powerpc/ieee1275/crt0.S +++ b/kern/powerpc/ieee1275/startup.S @@ -1,4 +1,4 @@ -/* crt0.S - Startup code for the PowerPC. */ +/* startup.S - Startup code for the PowerPC. */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. From 4cebd25a85db0cda744ac5342ea34ccc45508fba Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 30 Aug 2008 17:51:24 +0000 Subject: [PATCH 0381/1707] 2008-08-30 Robert Millan * kern/i386/pc/startup.S (multiboot_header): Force 4-byte alignment as required by Multiboot spec (it was already 4-byte aligned, but only by chance). --- ChangeLog | 6 ++++++ kern/i386/pc/startup.S | 1 + 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 687db986b..ab0ebc1f4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-30 Robert Millan + + * kern/i386/pc/startup.S (multiboot_header): Force 4-byte alignment + as required by Multiboot spec (it was already 4-byte aligned, but + only by chance). + 2008-08-29 Pavel Roskin * kern/powerpc/ieee1275/crt0.S: Rename to ... diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 197c447e3..18f61d801 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -110,6 +110,7 @@ VARIABLE(grub_prefix) * This uses the a.out kludge to load raw binary to the area starting at 1MB, * and relocates itself after loaded. */ + .p2align 2 /* force 4-byte alignment */ multiboot_header: /* magic */ .long 0x1BADB002 From 7c5d8d950c24d33e7195b709cd0fac92fe134782 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 31 Aug 2008 02:19:17 +0000 Subject: [PATCH 0382/1707] 2008-08-30 Pavel Roskin * util/genmoddep.c: Remove for real this time. * DISTLIST: Remove util/genmoddep.c. --- ChangeLog | 5 + DISTLIST | 1 - util/genmoddep.c | 278 ----------------------------------------------- 3 files changed, 5 insertions(+), 279 deletions(-) delete mode 100644 util/genmoddep.c diff --git a/ChangeLog b/ChangeLog index ab0ebc1f4..9603a8725 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-30 Pavel Roskin + + * util/genmoddep.c: Remove for real this time. + * DISTLIST: Remove util/genmoddep.c. + 2008-08-30 Robert Millan * kern/i386/pc/startup.S (multiboot_header): Force 4-byte alignment diff --git a/DISTLIST b/DISTLIST index 55ff9df62..acf375a6d 100644 --- a/DISTLIST +++ b/DISTLIST @@ -402,7 +402,6 @@ term/i386/pc/vga_text.c term/ieee1275/ofconsole.c util/biosdisk.c util/console.c -util/genmoddep.c util/getroot.c util/grub-editenv.c util/grub-emu.c diff --git a/util/genmoddep.c b/util/genmoddep.c deleted file mode 100644 index e2620a81f..000000000 --- a/util/genmoddep.c +++ /dev/null @@ -1,278 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -#define BUF_SIZE 1024 -#define SYMTAB_SIZE 509 - -struct symbol -{ - const char *name; - const char *mod; - struct symbol *next; -}; - -struct module -{ - const char *name; - struct module *next; -}; - -static char buf[BUF_SIZE]; -static struct symbol *symtab[SYMTAB_SIZE]; - -static void -err (const char *fmt, ...) -{ - va_list ap; - - fprintf (stderr, "genmoddep: error: "); - - va_start (ap, fmt); - vfprintf (stderr, fmt, ap); - va_end (ap); - - fputc ('\n', stderr); - exit (1); -} - -static void * -xmalloc (size_t size) -{ - void *p; - - p = malloc (size); - if (! p) - err ("out of memory"); - - return p; -} - -static char * -xstrdup (const char *str) -{ - char *s; - size_t len; - - len = strlen (str); - s = (char *) xmalloc (len + 1); - memcpy (s, str, len + 1); - - return s; -} - -static void -chomp (char *str) -{ - int end; - - end = strlen (str) - 1; - if (end < 0) - err ("empty string"); - - if (str[end] == '\n') - str[end] = '\0'; -} - -static unsigned -symbol_hash (const char *s) -{ - unsigned key = 0; - - while (*s) - key = key * 65599 + *s++; - - return (key + (key >> 5)) % SYMTAB_SIZE; -} - -static struct symbol * -get_symbol (const char *name) -{ - unsigned k; - struct symbol *sym; - - k = symbol_hash (name); - for (sym = symtab[k]; sym; sym = sym->next) - if (strcmp (sym->name, name) == 0) - return sym; - - return 0; -} - -static void -add_symbol (const char *name, const char *mod) -{ - unsigned k; - struct symbol *sym; - - if (get_symbol (name)) - err ("duplicated symbol: %s", name); - - sym = (struct symbol *) xmalloc (sizeof (*sym)); - sym->name = xstrdup (name); - sym->mod = xstrdup (mod); - - k = symbol_hash (name); - sym->next = symtab[k]; - symtab[k] = sym; -} - -static void -free_symbols (void) -{ - int i; - - for (i = 0; i < SYMTAB_SIZE; i++) - { - struct symbol *p, *q; - - p = symtab[i]; - while (p) - { - q = p->next; - free ((void *) p->name); - free ((void *) p->mod); - free (p); - p = q; - } - } -} - -static void -read_defined_symbols (FILE *fp) -{ - while (fgets (buf, sizeof (buf), fp)) - { - char *p; - - if (! *buf) - err ("empty symbol name: %s", buf); - - p = strchr (buf, ' '); - if (! p) - err ("invalid line format: %s", buf); - - p++; - - if (! *p) - err ("empty module name: %s", buf); - - *(p - 1) = '\0'; - chomp (p); - - add_symbol (buf, p); - } -} - -static void -add_module (struct module **head, const char *name) -{ - struct module *mod; - - for (mod = *head; mod; mod = mod->next) - if (strcmp (mod->name, name) == 0) - return; - - mod = (struct module *) xmalloc (sizeof (*mod)); - mod->name = xstrdup (name); - - mod->next = *head; - *head = mod; -} - -static void -free_modules (struct module *head) -{ - struct module *next; - - while (head) - { - next = head->next; - free ((void *) head->name); - free (head); - head = next; - } -} - -static void -find_dependencies (FILE *fp) -{ - char *mod_name; - struct module *mod_list = 0; - struct module *mod; - - if (! fgets (buf, sizeof (buf), fp) || buf[0] == '\n' || buf[0] == '\0') - err ("no module name"); - - chomp (buf); - mod_name = xstrdup (buf); - - while (fgets (buf, sizeof (buf), fp)) - { - struct symbol *sym; - - chomp (buf); - sym = get_symbol (buf); - if (! sym) - err ("%s in %s is not defined", buf, mod_name); - - add_module (&mod_list, sym->mod); - } - - printf ("%s:", mod_name); - - for (mod = mod_list; mod; mod = mod->next) - if (strcmp (mod->name, "kernel") != 0) - printf (" %s", mod->name); - - putchar ('\n'); - - free_modules (mod_list); -} - -int -main (int argc, char *argv[]) -{ - int i; - - /* First, get defined symbols. */ - read_defined_symbols (stdin); - - /* Second, find the dependencies. */ - for (i = 1; i < argc; i++) - { - FILE *fp; - - fp = fopen (argv[i], "r"); - if (! fp) - err ("cannot open %s", argv[i]); - - find_dependencies (fp); - - fclose (fp); - } - - /* Last, free memory. */ - free_symbols (); - - return 0; -} From c08a6c1877b1e3085b4bfb9d56334cc8652e810c Mon Sep 17 00:00:00 2001 From: chaac Date: Sun, 31 Aug 2008 09:28:36 +0000 Subject: [PATCH 0383/1707] 2008-08-31 Colin D Bennett * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Show VBE version and total video memory in 'vbeinfo' output; show color format details for each video mode. --- ChangeLog | 6 ++++++ commands/i386/pc/vbeinfo.c | 37 ++++++++++++++++++++++++++++++------- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9603a8725..2931813e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-31 Colin D Bennett + + * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Show VBE version and + total video memory in 'vbeinfo' output; show color format details for + each video mode. + 2008-08-30 Pavel Roskin * util/genmoddep.c: Remove for real this time. diff --git a/commands/i386/pc/vbeinfo.c b/commands/i386/pc/vbeinfo.c index bf0291696..090061664 100644 --- a/commands/i386/pc/vbeinfo.c +++ b/commands/i386/pc/vbeinfo.c @@ -48,12 +48,18 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), grub_err_t err; char *modevar; - grub_printf ("List of compatible video modes:\n"); - err = grub_vbe_probe (&controller_info); if (err != GRUB_ERR_NONE) return err; + grub_printf ("VBE info: version: %d.%d OEM software rev: %d.%d\n", + controller_info.version >> 8, + controller_info.version & 0xFF, + controller_info.oem_software_rev >> 8, + controller_info.oem_software_rev & 0xFF); + grub_printf (" total memory: %d KiB\n", + (controller_info.total_memory << 16) / 1024); + /* Because the information on video modes is stored in a temporary place, it is better to copy it to somewhere safe. */ p = video_mode_list = real2pm (controller_info.video_mode_ptr); @@ -67,6 +73,10 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), grub_memcpy (saved_video_mode_list, video_mode_list, video_mode_list_size); + grub_printf ("List of compatible video modes:\n"); + grub_printf ("Legend: P=Packed pixel, D=Direct color, " + "mask/pos=R/G/B/reserved\n"); + /* Walk through all video modes listed. */ for (p = saved_video_mode_list; *p != 0xFFFF; p++) { @@ -103,10 +113,10 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), switch (mode_info_tmp.memory_model) { case 0x04: - memory_model = "Packed Pixel"; + memory_model = "Packed"; break; case 0x06: - memory_model = "Direct Color"; + memory_model = "Direct"; break; default: @@ -116,12 +126,25 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), if (! memory_model) continue; - grub_printf ("0x%03x: %d x %d x %d bpp (%s)\n", - mode, + grub_printf ("0x%03x: %4d x %4d x %2d %s", + mode, mode_info_tmp.x_resolution, mode_info_tmp.y_resolution, mode_info_tmp.bits_per_pixel, - memory_model); + memory_model); + + /* Show mask and position details for direct color modes. */ + if (mode_info_tmp.memory_model == 0x06) + grub_printf (", mask: %d/%d/%d/%d pos: %d/%d/%d/%d", + mode_info_tmp.red_mask_size, + mode_info_tmp.green_mask_size, + mode_info_tmp.blue_mask_size, + mode_info_tmp.rsvd_mask_size, + mode_info_tmp.red_field_position, + mode_info_tmp.green_field_position, + mode_info_tmp.blue_field_position, + mode_info_tmp.rsvd_field_position); + grub_printf ("\n"); } grub_free (saved_video_mode_list); From 64d2d53c6b4b16b976a29d864c749a721e263c56 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 31 Aug 2008 16:28:32 +0000 Subject: [PATCH 0384/1707] 2008-08-31 Colin D Bennett * util/i386/pc/grub-mkrescue.in: Support multiple overlay directories. --- ChangeLog | 4 ++++ util/i386/pc/grub-mkrescue.in | 10 ++++++---- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2931813e5..3c02678f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-08-31 Colin D Bennett + + * util/i386/pc/grub-mkrescue.in: Support multiple overlay directories. + 2008-08-31 Colin D Bennett * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Show VBE version and diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 83f4ee193..3a74b06d9 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -43,6 +43,7 @@ Make GRUB rescue image. -v, --version print the version information and exit --modules=MODULES pre-load specified modules MODULES --overlay=DIR overlay directory DIR in the memdisk image + (may be specified multiple times) --pkglibdir=DIR use images from directory DIR instead of ${pkglibdir} --grub-mkimage=FILE use FILE as grub-mkimage --image-type=TYPE select floppy or cdrom (default) @@ -71,7 +72,7 @@ for option in "$@"; do --modules=*) modules=`echo "$option" | sed 's/--modules=//'` ;; --overlay=*) - overlay=`echo "$option" | sed 's/--overlay=//'` ;; + overlay=${overlay}${overlay:+ }`echo "$option" | sed 's/--overlay=//'` ;; --pkglibdir=*) input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;; --grub-mkimage=*) @@ -124,9 +125,10 @@ for i in ${modules} ; do echo "insmod $i" done > ${aux_dir}/boot/grub/grub.cfg -if test "x$overlay" = x ; then : ; else - cp -dpR ${overlay}/* ${aux_dir}/ -fi +for d in ${overlay}; do + echo "Overlaying $d" + cp -dpR "${d}"/* "${aux_dir}"/ +done if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then # build memdisk From e27a75c58f378c8002cbcb14614c041474808096 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 31 Aug 2008 19:12:02 +0000 Subject: [PATCH 0385/1707] 2008-08-31 Robert Millan * loader/i386/pc/multiboot.c: Update comment not to say that a.out or memory map support are unimplemented. --- ChangeLog | 5 +++++ loader/i386/pc/multiboot.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3c02678f6..cc73734d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-31 Robert Millan + + * loader/i386/pc/multiboot.c: Update comment not to say that a.out + or memory map support are unimplemented. + 2008-08-31 Colin D Bennett * util/i386/pc/grub-mkrescue.in: Support multiple overlay directories. diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index fe8a1e9c1..895811378 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -21,10 +21,8 @@ * FIXME: The following features from the Multiboot specification still * need to be implemented: * - VBE support - * - a.out support * - boot device * - symbol table - * - memory map * - drives table * - ROM configuration table * - APM table From 21751d508aad72611e710b423403e8f5ea38de8b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 31 Aug 2008 19:25:41 +0000 Subject: [PATCH 0386/1707] 2008-08-31 Robert Millan * loader/i386/pc/multiboot.c: Update comment not to say that boot_device support is unimplemented. --- ChangeLog | 5 +++++ loader/i386/pc/multiboot.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cc73734d4..5fa24cd97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-08-31 Robert Millan + + * loader/i386/pc/multiboot.c: Update comment not to say that + boot_device support is unimplemented. + 2008-08-31 Robert Millan * loader/i386/pc/multiboot.c: Update comment not to say that a.out diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 895811378..b64e2b7dc 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -21,7 +21,6 @@ * FIXME: The following features from the Multiboot specification still * need to be implemented: * - VBE support - * - boot device * - symbol table * - drives table * - ROM configuration table From 93d5cbf809c567eee0ed7614a2ff7dc37389e54f Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 31 Aug 2008 20:43:03 +0000 Subject: [PATCH 0387/1707] 2008-08-31 Robert Millan * loader/i386/pc/multiboot.c (grub_get_multiboot_mmap_len): Fix declaration. (grub_multiboot): Fix a few warnings. --- ChangeLog | 6 ++++++ loader/i386/pc/multiboot.c | 12 ++++++------ 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5fa24cd97..0ee1b031d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-31 Robert Millan + + * loader/i386/pc/multiboot.c (grub_get_multiboot_mmap_len): Fix + declaration. + (grub_multiboot): Fix a few warnings. + 2008-08-31 Robert Millan * loader/i386/pc/multiboot.c: Update comment not to say that diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index b64e2b7dc..509dacbd5 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -90,7 +90,7 @@ static grub_uint32_t mmap_length; /* Return the length of the Multiboot mmap that will be needed to allocate our platform's map. */ static grub_uint32_t -grub_get_multiboot_mmap_len () +grub_get_multiboot_mmap_len (void) { grub_size_t count = 0; @@ -447,12 +447,12 @@ grub_multiboot (int argc, char *argv[]) if ((grub_file_seek (file, offset)) == (grub_off_t) - 1) goto fail; - grub_file_read (file, grub_multiboot_payload_orig, load_size); + grub_file_read (file, (void *) grub_multiboot_payload_orig, load_size); if (grub_errno) goto fail; if (header->bss_end_addr) - grub_memset (grub_multiboot_payload_orig + load_size, 0, + grub_memset ((void *) (grub_multiboot_payload_orig + load_size), 0, header->bss_end_addr - header->load_addr - load_size); grub_multiboot_payload_entry_offset = header->entry_addr - header->load_addr; @@ -462,9 +462,9 @@ grub_multiboot (int argc, char *argv[]) goto fail; - grub_fill_multiboot_mmap ((struct grub_mmap_entry *) (grub_multiboot_payload_orig - + grub_multiboot_payload_size - - mmap_length)); + grub_fill_multiboot_mmap ((struct grub_multiboot_mmap_entry *) (grub_multiboot_payload_orig + + grub_multiboot_payload_size + - mmap_length)); mmap_addr = grub_multiboot_payload_dest + grub_multiboot_payload_size - mmap_length; From f06199587d3c7bae96ccb0b0481473a93dceded4 Mon Sep 17 00:00:00 2001 From: chaac Date: Mon, 1 Sep 2008 15:58:13 +0000 Subject: [PATCH 0388/1707] 2008-09-01 Colin D Bennett * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Replaced constant values with defines. * include/grub/i386/pc/vbe.h (GRUB_VBE_MODEATTR_SUPPORTED): Added. (GRUB_VBE_MODEATTR_RESERVED_1): Likewise. (GRUB_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT): Likewise. (GRUB_VBE_MODEATTR_COLOR): Likewise. (GRUB_VBE_MODEATTR_GRAPHICS): Likewise. (GRUB_VBE_MODEATTR_VGA_COMPATIBLE): Likewise. (GRUB_VBE_MODEATTR_VGA_WINDOWED_AVAIL): Likewise. (GRUB_VBE_MODEATTR_LFB_AVAIL): Likewise. (GRUB_VBE_MODEATTR_DOUBLE_SCAN_AVAIL): Likewise. (GRUB_VBE_MODEATTR_INTERLACED_AVAIL): Likewise. (GRUB_VBE_MODEATTR_TRIPLE_BUF_AVAIL): Likewise. (GRUB_VBE_MODEATTR_STEREO_AVAIL): Likewise. (GRUB_VBE_MODEATTR_DUAL_DISPLAY_START): Likewise. (GRUB_VBE_MEMORY_MODEL_TEXT): Likewise. (GRUB_VBE_MEMORY_MODEL_CGA): Likewise. (GRUB_VBE_MEMORY_MODEL_HERCULES): Likewise. (GRUB_VBE_MEMORY_MODEL_PLANAR): Likewise. (GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256): Likewise. (GRUB_VBE_MEMORY_MODEL_YUV): Likewise. --- ChangeLog | 25 +++++++++++++++++++++++++ commands/i386/pc/vbeinfo.c | 18 ++++++++++-------- include/grub/i386/pc/vbe.h | 27 ++++++++++++++++++++++++--- 3 files changed, 59 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ee1b031d..68c236917 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2008-09-01 Colin D Bennett + + * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Replaced constant + values with defines. + + * include/grub/i386/pc/vbe.h (GRUB_VBE_MODEATTR_SUPPORTED): Added. + (GRUB_VBE_MODEATTR_RESERVED_1): Likewise. + (GRUB_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT): Likewise. + (GRUB_VBE_MODEATTR_COLOR): Likewise. + (GRUB_VBE_MODEATTR_GRAPHICS): Likewise. + (GRUB_VBE_MODEATTR_VGA_COMPATIBLE): Likewise. + (GRUB_VBE_MODEATTR_VGA_WINDOWED_AVAIL): Likewise. + (GRUB_VBE_MODEATTR_LFB_AVAIL): Likewise. + (GRUB_VBE_MODEATTR_DOUBLE_SCAN_AVAIL): Likewise. + (GRUB_VBE_MODEATTR_INTERLACED_AVAIL): Likewise. + (GRUB_VBE_MODEATTR_TRIPLE_BUF_AVAIL): Likewise. + (GRUB_VBE_MODEATTR_STEREO_AVAIL): Likewise. + (GRUB_VBE_MODEATTR_DUAL_DISPLAY_START): Likewise. + (GRUB_VBE_MEMORY_MODEL_TEXT): Likewise. + (GRUB_VBE_MEMORY_MODEL_CGA): Likewise. + (GRUB_VBE_MEMORY_MODEL_HERCULES): Likewise. + (GRUB_VBE_MEMORY_MODEL_PLANAR): Likewise. + (GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256): Likewise. + (GRUB_VBE_MEMORY_MODEL_YUV): Likewise. + 2008-08-31 Robert Millan * loader/i386/pc/multiboot.c (grub_get_multiboot_mmap_len): Fix diff --git a/commands/i386/pc/vbeinfo.c b/commands/i386/pc/vbeinfo.c index 090061664..305e69958 100644 --- a/commands/i386/pc/vbeinfo.c +++ b/commands/i386/pc/vbeinfo.c @@ -57,6 +57,8 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), controller_info.version & 0xFF, controller_info.oem_software_rev >> 8, controller_info.oem_software_rev & 0xFF); + + /* The total_memory field is in 64 KiB units. */ grub_printf (" total memory: %d KiB\n", (controller_info.total_memory << 16) / 1024); @@ -90,32 +92,32 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), continue; } - if ((mode_info_tmp.mode_attributes & 0x001) == 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_SUPPORTED) == 0) /* If not available, skip it. */ continue; - if ((mode_info_tmp.mode_attributes & 0x002) == 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_RESERVED_1) == 0) /* Not enough information. */ continue; - if ((mode_info_tmp.mode_attributes & 0x008) == 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_COLOR) == 0) /* Monochrome is unusable. */ continue; - if ((mode_info_tmp.mode_attributes & 0x080) == 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_LFB_AVAIL) == 0) /* We support only linear frame buffer modes. */ continue; - if ((mode_info_tmp.mode_attributes & 0x010) == 0) + if ((mode_info_tmp.mode_attributes & GRUB_VBE_MODEATTR_GRAPHICS) == 0) /* We allow only graphical modes. */ continue; switch (mode_info_tmp.memory_model) { - case 0x04: + case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL: memory_model = "Packed"; break; - case 0x06: + case GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR: memory_model = "Direct"; break; @@ -134,7 +136,7 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), memory_model); /* Show mask and position details for direct color modes. */ - if (mode_info_tmp.memory_model == 0x06) + if (mode_info_tmp.memory_model == GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR) grub_printf (", mask: %d/%d/%d/%d pos: %d/%d/%d/%d", mode_info_tmp.red_mask_size, mode_info_tmp.green_mask_size, diff --git a/include/grub/i386/pc/vbe.h b/include/grub/i386/pc/vbe.h index 455de8461..9a8cb954d 100644 --- a/include/grub/i386/pc/vbe.h +++ b/include/grub/i386/pc/vbe.h @@ -30,9 +30,30 @@ /* VBE status codes. */ #define GRUB_VBE_STATUS_OK 0x004f -/* VBE memory model types. */ -#define GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL 0x04 -#define GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR 0x06 +/* Bits from the GRUB_VBE "mode_attributes" field in the mode info struct. */ +#define GRUB_VBE_MODEATTR_SUPPORTED (1 << 0) +#define GRUB_VBE_MODEATTR_RESERVED_1 (1 << 1) +#define GRUB_VBE_MODEATTR_BIOS_TTY_OUTPUT_SUPPORT (1 << 2) +#define GRUB_VBE_MODEATTR_COLOR (1 << 3) +#define GRUB_VBE_MODEATTR_GRAPHICS (1 << 4) +#define GRUB_VBE_MODEATTR_VGA_COMPATIBLE (1 << 5) +#define GRUB_VBE_MODEATTR_VGA_WINDOWED_AVAIL (1 << 6) +#define GRUB_VBE_MODEATTR_LFB_AVAIL (1 << 7) +#define GRUB_VBE_MODEATTR_DOUBLE_SCAN_AVAIL (1 << 8) +#define GRUB_VBE_MODEATTR_INTERLACED_AVAIL (1 << 9) +#define GRUB_VBE_MODEATTR_TRIPLE_BUF_AVAIL (1 << 10) +#define GRUB_VBE_MODEATTR_STEREO_AVAIL (1 << 11) +#define GRUB_VBE_MODEATTR_DUAL_DISPLAY_START (1 << 12) + +/* Values for the GRUB_VBE memory_model field in the mode info struct. */ +#define GRUB_VBE_MEMORY_MODEL_TEXT 0x00 +#define GRUB_VBE_MEMORY_MODEL_CGA 0x01 +#define GRUB_VBE_MEMORY_MODEL_HERCULES 0x02 +#define GRUB_VBE_MEMORY_MODEL_PLANAR 0x03 +#define GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL 0x04 +#define GRUB_VBE_MEMORY_MODEL_NONCHAIN4_256 0x05 +#define GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR 0x06 +#define GRUB_VBE_MEMORY_MODEL_YUV 0x07 /* Note: From a0224a4e62812865f3aca120fb15672ec01fe0b1 Mon Sep 17 00:00:00 2001 From: chaac Date: Mon, 1 Sep 2008 19:03:16 +0000 Subject: [PATCH 0389/1707] 2008-09-01 Colin D Bennett * include/grub/normal.h: Fixed incorrect comment for GRUB_COMMAND_FLAG_NO_ARG_PARSE. --- ChangeLog | 5 +++++ include/grub/normal.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 68c236917..171ad08ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-01 Colin D Bennett + + * include/grub/normal.h: Fixed incorrect comment for + GRUB_COMMAND_FLAG_NO_ARG_PARSE. + 2008-09-01 Colin D Bennett * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Replaced constant diff --git a/include/grub/normal.h b/include/grub/normal.h index 9ed47877c..544a95787 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -39,7 +39,7 @@ #define GRUB_COMMAND_FLAG_TITLE 0x4 /* Don't print the command on booting. */ #define GRUB_COMMAND_FLAG_NO_ECHO 0x8 -/* Don't print the command on booting. */ +/* Pass arguments to the command without parsing options. */ #define GRUB_COMMAND_FLAG_NO_ARG_PARSE 0x10 /* Not loaded yet. Used for auto-loading. */ #define GRUB_COMMAND_FLAG_NOT_LOADED 0x20 From 9124f65de04a6f7dd8c8d2fc6eb92a8dff3bb7f4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 3 Sep 2008 10:52:07 +0000 Subject: [PATCH 0390/1707] 2008-09-03 Robert Millan * disk/scsi.c (grub_scsi_open): Remove size limit when printing `disk->total_sectors'. --- ChangeLog | 5 +++++ disk/scsi.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 171ad08ea..ad1e6adaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-03 Robert Millan + + * disk/scsi.c (grub_scsi_open): Remove size limit when printing + `disk->total_sectors'. + 2008-09-01 Colin D Bennett * include/grub/normal.h: Fixed incorrect comment for diff --git a/disk/scsi.c b/disk/scsi.c index 01ef04ee7..aad59b5a3 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -300,8 +300,8 @@ grub_scsi_open (const char *name, grub_disk_t disk) disk->total_sectors = ((scsi->size * scsi->blocksize) << GRUB_DISK_SECTOR_BITS); - grub_dprintf ("scsi", "capacity=%d, blksize=%d\n", - (int) disk->total_sectors, scsi->blocksize); + grub_dprintf ("scsi", "capacity=%llu, blksize=%d\n", + disk->total_sectors, scsi->blocksize); return GRUB_ERR_NONE; } From 9059a0f99f126da045fff46db1efccbab348555e Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 3 Sep 2008 21:55:14 +0000 Subject: [PATCH 0391/1707] changing mime-type of docs/*.texi and docs/texinfo.tex to text/plain From 58b6645a8f933c560f84fa7c4fbca310843fb206 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 4 Sep 2008 07:54:06 +0000 Subject: [PATCH 0392/1707] 2008-09-04 Felix Zielcke * config.guess: Update to latest version from config.git. * config.sub: Likewise. --- ChangeLog | 5 ++++ config.guess | 38 +++++++++++++++++----------- config.sub | 71 +++++++++++++++++++++++++++++++++++++++++++--------- 3 files changed, 88 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad1e6adaf..1b8b46d10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-04 Felix Zielcke + + * config.guess: Update to latest version from config.git. + * config.sub: Likewise. + 2008-09-03 Robert Millan * disk/scsi.c (grub_scsi_open): Remove size limit when printing diff --git a/config.guess b/config.guess index 278f9e9e0..c7607c74f 100644 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-07-22' +timestamp='2008-04-14' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -56,8 +56,8 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -532,7 +532,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[45]) + *:AIX:*:[456]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -799,6 +799,9 @@ EOF EM64T | authenticamd) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; + IA64) + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks @@ -833,7 +836,14 @@ EOF echo ${UNAME_MACHINE}-pc-minix exit ;; arm*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + eval $set_cc_for_build + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ + | grep -q __ARM_EABI__ + then + echo ${UNAME_MACHINE}-unknown-linux-gnu + else + echo ${UNAME_MACHINE}-unknown-linux-gnueabi + fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -954,8 +964,8 @@ EOF x86_64:Linux:*:*) echo x86_64-unknown-linux-gnu exit ;; - xtensa:Linux:*:*) - echo xtensa-unknown-linux-gnu + xtensa*:Linux:*:*) + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; i*86:Linux:*:*) # The BFD linker knows what the default object file format is, so @@ -975,9 +985,6 @@ EOF a.out-i386-linux) echo "${UNAME_MACHINE}-pc-linux-gnuaout" exit ;; - coff-i386) - echo "${UNAME_MACHINE}-pc-linux-gnucoff" - exit ;; "") # Either a pre-BFD a.out linker (linux-gnuoldld) or # one that does not give us useful --help. @@ -1206,6 +1213,9 @@ EOF BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; + BePC:Haiku:*:*) # Haiku running on Intel PC compatible. + echo i586-pc-haiku + exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; @@ -1474,9 +1484,9 @@ This script, last modified $timestamp, has failed to recognize the operating system you are using. It is advised that you download the most up to date version of the config scripts from - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD and - http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub + http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD If the version you run ($0) is already up to date, please send the following data and any information you think might be diff --git a/config.sub b/config.sub index 1761d8bdf..a649350a6 100644 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation, -# Inc. +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# Free Software Foundation, Inc. -timestamp='2007-06-28' +timestamp='2008-06-16' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -72,8 +72,8 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005 -Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -250,12 +250,14 @@ case $basic_machine in | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep \ + | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ - | mips64vr | mips64vrel \ + | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ + | mips64r5900 | mips64r5900el \ + | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ @@ -331,12 +333,14 @@ case $basic_machine in | ip2k-* | iq2000-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ - | mips64vr-* | mips64vrel-* \ + | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ + | mips64r5900-* | mips64r5900el-* \ + | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ @@ -364,15 +368,19 @@ case $basic_machine in | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ | tron-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ - | xstormy16-* | xtensa-* \ + | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-*) ;; + # Recognize the basic CPU types without company name, with glob match. + xtensa*) + basic_machine=$basic_machine-unknown + ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) @@ -443,10 +451,22 @@ case $basic_machine in basic_machine=ns32k-sequent os=-dynix ;; + blackfin) + basic_machine=bfin-unknown + os=-linux + ;; + blackfin-*) + basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; c90) basic_machine=c90-cray os=-unicos ;; + cegcc) + basic_machine=arm-unknown + os=-cegcc + ;; convex-c1) basic_machine=c1-convex os=-bsd @@ -514,6 +534,10 @@ case $basic_machine in basic_machine=m88k-motorola os=-sysv3 ;; + dicos) + basic_machine=i686-pc + os=-dicos + ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp @@ -668,6 +692,14 @@ case $basic_machine in basic_machine=m68k-isi os=-sysv ;; + m68knommu) + basic_machine=m68k-unknown + os=-linux + ;; + m68knommu-*) + basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; m88k-omron*) basic_machine=m88k-omron ;; @@ -813,6 +845,14 @@ case $basic_machine in basic_machine=i860-intel os=-osf ;; + parisc) + basic_machine=hppa-unknown + os=-linux + ;; + parisc-*) + basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` + os=-linux + ;; pbd) basic_machine=sparc-tti ;; @@ -1021,6 +1061,10 @@ case $basic_machine in basic_machine=tic6x-unknown os=-coff ;; + tile*) + basic_machine=tile-unknown + os=-linux-gnu + ;; tx39) basic_machine=mipstx39-unknown ;; @@ -1216,7 +1260,7 @@ case $os in | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* \ + | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ @@ -1356,6 +1400,9 @@ case $os in -zvmoe) os=-zvmoe ;; + -dicos*) + os=-dicos + ;; -none) ;; *) From 4ee559213787de1156fd794d890dec1ff3bc45d8 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 4 Sep 2008 19:54:59 +0000 Subject: [PATCH 0393/1707] 2008-09-04 Felix Zielcke * util/getroot.c: Include . (grub_util_get_grub_dev): Rewrite to use asprintf for mdraid devices, add support for /dev/md/N devices and handle LVM double dash escaping. --- ChangeLog | 10 ++++++-- util/getroot.c | 65 ++++++++++++++++++++++---------------------------- 2 files changed, 36 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1b8b46d10..571472959 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ 2008-09-04 Felix Zielcke - * config.guess: Update to latest version from config.git. - * config.sub: Likewise. + * util/getroot.c: Include . + (grub_util_get_grub_dev): Rewrite to use asprintf for mdraid devices, + add support for /dev/md/N devices and handle LVM double dash escaping. + +2008-09-04 Felix Zielcke + + * config.guess: Update to latest version from config git. + * config.sub: Likewise. 2008-09-03 Robert Millan diff --git a/util/getroot.c b/util/getroot.c index f721e7fc3..07d4580a3 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -17,6 +17,7 @@ * along with GRUB. If not, see . */ +#include #include #include #include @@ -417,62 +418,52 @@ grub_util_get_grub_dev (const char *os_dev) switch (grub_util_get_dev_abstraction (os_dev)) { case GRUB_DEV_ABSTRACTION_LVM: - grub_dev = xmalloc (strlen (os_dev) - 12 + 1); - strcpy (grub_dev, os_dev + 12); + { + unsigned short i, len; + grub_size_t offset = sizeof ("/dev/mapper/") - 1; + len = strlen (os_dev) - offset + 1; + grub_dev = xmalloc (len); + + for (i = 0; i < len; i++, offset++) + { + grub_dev[i] = os_dev[offset]; + if (os_dev[offset] == '-' && os_dev[offset + 1] == '-') + offset++; + } + } + break; case GRUB_DEV_ABSTRACTION_RAID: - grub_dev = xmalloc (20); if (os_dev[7] == '_' && os_dev[8] == 'd') { - const char *p; - /* This a partitionable RAID device of the form /dev/md_dNNpMM. */ - int i; - - grub_dev[0] = 'm'; - grub_dev[1] = 'd'; - i = 2; - p = os_dev + 9; - while (*p >= '0' && *p <= '9') - { - grub_dev[i] = *p; - i++; - p++; - } + char *p , *q; - if (*p == '\0') - grub_dev[i] = '\0'; - else if (*p == 'p') - { - p++; - grub_dev[i] = ','; - i++; + p = strdup (os_dev + sizeof ("/dev/md_d") - 1); - while (*p >= '0' && *p <= '9') - { - grub_dev[i] = *p; - i++; - p++; - } + q = strchr (p, 'p'); + if (q) + *q = ','; - grub_dev[i] = '\0'; - } - else - grub_util_error ("Unknown kind of RAID device `%s'", os_dev); + asprintf (&grub_dev, "md%s", p); + free (p); } else if (os_dev[7] >= '0' && os_dev[7] <= '9') { - memcpy (grub_dev, os_dev + 5, 7); - grub_dev[7] = '\0'; + asprintf (&grub_dev, "md%s", os_dev + sizeof ("/dev/md") - 1); + } + else if (os_dev[7] == '/' && os_dev[8] >= '0' && os_dev[8] <= '9') + { + asprintf (&grub_dev, "md%s", os_dev + sizeof ("/dev/md/") - 1); } else grub_util_error ("Unknown kind of RAID device `%s'", os_dev); - + break; default: /* GRUB_DEV_ABSTRACTION_NONE */ From 59261157329c39b994ff72cf4f75bf6abf62cf07 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 5 Sep 2008 15:48:37 +0000 Subject: [PATCH 0394/1707] 2008-09-05 Bean * fs/fshelp.c (grub_fshelp_find_file): Handle case insensitive names. * fs/ntfs.c (list_file): Ignore names in DOS namespace, set the case insensitive bit for names in Win32 and Win32 & DOS namespace. * include/grub/fshelp.h (GRUB_FSHELP_CASE_INSENSITIVE): New macro. * include/grub/types.h (LONG_MAX): Likewise. --- ChangeLog | 11 +++++++++++ fs/fshelp.c | 7 +++++-- fs/ntfs.c | 18 ++++++++++++++---- include/grub/fshelp.h | 2 ++ include/grub/types.h | 2 ++ 5 files changed, 34 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 571472959..9e59ecdcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-09-05 Bean + + * fs/fshelp.c (grub_fshelp_find_file): Handle case insensitive names. + + * fs/ntfs.c (list_file): Ignore names in DOS namespace, set the case + insensitive bit for names in Win32 and Win32 & DOS namespace. + + * include/grub/fshelp.h (GRUB_FSHELP_CASE_INSENSITIVE): New macro. + + * include/grub/types.h (LONG_MAX): Likewise. + 2008-09-04 Felix Zielcke * util/getroot.c: Include . diff --git a/fs/fshelp.c b/fs/fshelp.c index df33fa1fa..a5eccdd68 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -80,14 +80,17 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { - if (type == GRUB_FSHELP_UNKNOWN || grub_strcmp (name, filename)) + if (filetype == GRUB_FSHELP_UNKNOWN || + (grub_strcmp (name, filename) && + (! (filetype & GRUB_FSHELP_CASE_INSENSITIVE) || + grub_strncasecmp (name, filename, LONG_MAX)))) { grub_free (node); return 0; } /* The node is found, stop iterating over the nodes. */ - type = filetype; + type = filetype & ~GRUB_FSHELP_CASE_INSENSITIVE; oldnode = currnode; currnode = node; diff --git a/fs/ntfs.c b/fs/ntfs.c index 3174ab181..a590ade1e 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -575,13 +575,20 @@ list_file (struct grub_ntfs_file *diro, char *pos, while (1) { - char *ustr; + char *ustr, namespace; + if (pos[0xC] & 2) /* end signature */ break; - np = pos + 0x52; - ns = (unsigned char) *(np - 2); - if (ns) + np = pos + 0x50; + ns = (unsigned char) *(np++); + namespace = *(np++); + + /* + * Ignore files in DOS namespace, as they will reappear as Win32 + * names. + */ + if ((ns) && (namespace != 2)) { enum grub_fshelp_filetype type; struct grub_ntfs_file *fdiro; @@ -610,6 +617,9 @@ list_file (struct grub_ntfs_file *diro, char *pos, *grub_utf16_to_utf8 ((grub_uint8_t *) ustr, (grub_uint16_t *) np, ns) = '\0'; + if (namespace) + type |= GRUB_FSHELP_CASE_INSENSITIVE; + if (hook (ustr, type, fdiro)) { grub_free (ustr); diff --git a/include/grub/fshelp.h b/include/grub/fshelp.h index 698c7aae7..7092cac45 100644 --- a/include/grub/fshelp.h +++ b/include/grub/fshelp.h @@ -26,6 +26,8 @@ typedef struct grub_fshelp_node *grub_fshelp_node_t; +#define GRUB_FSHELP_CASE_INSENSITIVE 0x100 + enum grub_fshelp_filetype { GRUB_FSHELP_UNKNOWN, diff --git a/include/grub/types.h b/include/grub/types.h index d2044292d..6f256c165 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -94,8 +94,10 @@ typedef grub_int32_t grub_ssize_t; #if GRUB_CPU_SIZEOF_VOID_P == 8 # define ULONG_MAX 18446744073709551615UL +# define LONG_MAX 9223372036854775807UL #else # define ULONG_MAX 4294967295UL +# define LONG_MAX 2147483647UL #endif /* The type for representing a file offset. */ From c375ae58f206896903ef0ec5e904e8d29288a482 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 6 Sep 2008 11:16:52 +0000 Subject: [PATCH 0395/1707] 2008-08-31 Felix Zielcke * fs/iso9660.c (grub_iso9660_date): New structure. (grub_iso9660_primary_voldesc): Add `grub_iso9660_date' member. (grub_iso9660_uuid): New function. --- ChangeLog | 6 +++++ fs/iso9660.c | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9e59ecdcb..50925d149 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-08-31 Felix Zielcke + + * fs/iso9660.c (grub_iso9660_date): New structure. + (grub_iso9660_primary_voldesc): Add `grub_iso9660_date' member. + (grub_iso9660_uuid): New function. + 2008-09-05 Bean * fs/fshelp.c (grub_fshelp_find_file): Handle case insensitive names. diff --git a/fs/iso9660.c b/fs/iso9660.c index 143585ae7..f42beb597 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -67,6 +67,18 @@ struct grub_iso9660_dir grub_uint8_t namelen; } __attribute__ ((packed)); +struct grub_iso9660_date +{ + grub_uint8_t year[4]; + grub_uint8_t month[2]; + grub_uint8_t day[2]; + grub_uint8_t hour[2]; + grub_uint8_t minute[2]; + grub_uint8_t second[2]; + grub_uint8_t hundredth[2]; + grub_uint8_t offset; +} __attribute__ ((packed)); + /* The primary volume descriptor. Only little endian is used. */ struct grub_iso9660_primary_voldesc { @@ -81,6 +93,8 @@ struct grub_iso9660_primary_voldesc grub_uint32_t path_table; grub_uint8_t unused5[12]; struct grub_iso9660_dir rootdir; + grub_uint8_t unused6[641]; + struct grub_iso9660_date created; } __attribute__ ((packed)); /* A single entry in the path table. */ @@ -812,6 +826,58 @@ grub_iso9660_label (grub_device_t device, char **label) return grub_errno; } + +static grub_err_t +grub_iso9660_uuid (grub_device_t device, char **uuid) +{ + struct grub_iso9660_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_iso9660_mount (disk); + if (data) + { + if (! data->voldesc.created.year[0] && ! data->voldesc.created.year[1] + && ! data->voldesc.created.year[2] && ! data->voldesc.created.year[3] + && ! data->voldesc.created.month[0] && ! data->voldesc.created.month[1] + && ! data->voldesc.created.day[0] && ! data->voldesc.created.day[1] + && ! data->voldesc.created.hour[0] && ! data->voldesc.created.hour[1] + && ! data->voldesc.created.minute[0] && ! data->voldesc.created.minute[1] + && ! data->voldesc.created.second[0] && ! data->voldesc.created.second[1] + && ! data->voldesc.created.hundredth[0] && ! data->voldesc.created.hundredth[1]) + { + grub_error (GRUB_ERR_BAD_NUMBER, "No creation date in filesystem to generate UUID."); + *uuid = NULL; + } + else + { + *uuid = grub_malloc (sizeof ("YYYY-MM-DD-HH-mm-ss-hh")); + grub_sprintf (*uuid, "%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c", + data->voldesc.created.year[0], data->voldesc.created.year[1], + data->voldesc.created.year[2], data->voldesc.created.year[3], + data->voldesc.created.month[0], data->voldesc.created.month[1], + data->voldesc.created.day[0], data->voldesc.created.day[1], + data->voldesc.created.hour[0], data->voldesc.created.hour[1], + data->voldesc.created.minute[0], data->voldesc.created.minute[1], + data->voldesc.created.second[0], data->voldesc.created.second[1], + data->voldesc.created.hundredth[0], data->voldesc.created.hundredth[1]); + } + } + else + *uuid = NULL; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + static struct grub_fs grub_iso9660_fs = @@ -822,6 +888,7 @@ static struct grub_fs grub_iso9660_fs = .read = grub_iso9660_read, .close = grub_iso9660_close, .label = grub_iso9660_label, + .uuid = grub_iso9660_uuid, .next = 0 }; From 6bcd8ee530c5472d5d534046bcfb92ed282e472c Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 6 Sep 2008 11:18:06 +0000 Subject: [PATCH 0396/1707] urgs commited a bit too fast the changelog .. --- ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 50925d149..6c8b60da2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,8 @@ -2008-08-31 Felix Zielcke +2008-09-06 Felix Zielcke - * fs/iso9660.c (grub_iso9660_date): New structure. - (grub_iso9660_primary_voldesc): Add `grub_iso9660_date' member. - (grub_iso9660_uuid): New function. + * fs/iso9660.c (grub_iso9660_date): New structure. + (grub_iso9660_primary_voldesc): Add `grub_iso9660_date' member. + (grub_iso9660_uuid): New function. 2008-09-05 Bean From e8a83df664ad34954a36b21cf46b1f54c43ea799 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 6 Sep 2008 13:56:15 +0000 Subject: [PATCH 0397/1707] 2008-09-04 Felix Zielcke * disk/raid.c (insert_array): Set `array->chunk_size' to 64 for RAID level 1. --- ChangeLog | 5 +++++ disk/raid.c | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6c8b60da2..685934009 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-06 Felix Zielcke + + * disk/raid.c (insert_array): Set `array->chunk_size' to 64 for + RAID level 1. + 2008-09-06 Felix Zielcke * fs/iso9660.c (grub_iso9660_date): New structure. diff --git a/disk/raid.c b/disk/raid.c index 3dab0d802..62cbcb5ba 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -575,6 +575,11 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array, /* Add our new array to the list. */ array->next = array_list; array_list = array; + + /* RAID 1 doestn't use a chunksize but code assumes one so set + one. */ + if (array->level == 1) + array->chunk_size = 64; } /* Add the device to the array. */ From 0ea85a3787b5e1ebfc51eb3647a0d960f16e8a0e Mon Sep 17 00:00:00 2001 From: chaac Date: Sun, 7 Sep 2008 15:55:58 +0000 Subject: [PATCH 0398/1707] =?UTF-8?q?2008-09-07=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on patch created by Colin D Bennett . Adds optimization support for BGR based modes. * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): Removed. (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_R8G8B8): Likewise. (grub_video_i386_vbeblit_index_index): Likewise. (grub_video_i386_vbeblit_replace_directN): Added. (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. (grub_video_i386_vbefill_direct32): Added. (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types. --- ChangeLog | 98 ++++ include/grub/i386/pc/vbeblit.h | 125 +++-- include/grub/i386/pc/vbefill.h | 37 +- include/grub/video.h | 26 +- video/bitmap.c | 4 +- video/i386/pc/vbe.c | 411 ++++++++------ video/i386/pc/vbeblit.c | 942 +++++++++++++++++++++------------ video/i386/pc/vbefill.c | 206 ++++--- video/readers/jpeg.c | 2 +- video/readers/png.c | 4 +- video/readers/tga.c | 4 +- video/video.c | 98 +++- 12 files changed, 1274 insertions(+), 683 deletions(-) diff --git a/ChangeLog b/ChangeLog index 685934009..22626adf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,101 @@ +2008-09-07 Vesa Jääskeläinen + + Based on patch created by Colin D Bennett . + Adds optimization support for BGR based modes. + + * include/grub/i386/pc/vbeblit.h (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8) Removed. + (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. + (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. + (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. + (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. + (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. + (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. + (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. + (grub_video_i386_vbeblit_index_R8G8B8): Likewise. + (grub_video_i386_vbeblit_index_index): Likewise. + (grub_video_i386_vbeblit_replace_directN): Added. + (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. + (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. + (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. + (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. + (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. + + * include/grub/i386/pc/vbefill.h (grub_video_i386_vbefill_R8G8B8A8) Removed. + (grub_video_i386_vbefill_R8G8B8): Likewise. + (grub_video_i386_vbefill_index): Likewise. + (grub_video_i386_vbefill_direct32): Added. + (grub_video_i386_vbefill_direct24): Likewise. + (grub_video_i386_vbefill_direct16): Likewise. + (grub_video_i386_vbefill_direct8): Likewise. + + * include/grub/video.h (grub_video_blit_format): Removed + GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. + (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, + GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, + GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, + GRUB_VIDEO_BLIT_FORMAT_BGR_565. + + * video/video.c (grub_video_get_blit_format): Updated to use new + blit formats. Added handling for 16 bit color modes. + + * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new + fillers. + (common_blitter): Updated to use new blitters. + + * video/i386/pc/vbeblit.c (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8): + Removed. + (grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8): Likewise. + (grub_video_i386_vbeblit_R8G8B8_R8G8B8A8): Likewise. + (grub_video_i386_vbeblit_R8G8B8_R8G8B8X8): Likewise. + (grub_video_i386_vbeblit_index_R8G8B8A8): Likewise. + (grub_video_i386_vbeblit_index_R8G8B8X8): Likewise. + (grub_video_i386_vbeblit_R8G8B8A8_R8G8B8): Likewise. + (grub_video_i386_vbeblit_R8G8B8_R8G8B8): Likewise. + (grub_video_i386_vbeblit_index_R8G8B8): Likewise. + (grub_video_i386_vbeblit_index_index): Likewise. + (grub_video_i386_vbeblit_replace_directN): Added. + (grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_BGRX8888_RGB888): Likewise. + (grub_video_i386_vbeblit_replace_BGR888_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. + (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. + (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. + (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. + (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. + + * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. + (grub_video_i386_vbefill_R8G8B8): Likewise. + (grub_video_i386_vbefill_index): Likewise. + (grub_video_i386_vbefill_direct32): Added. + (grub_video_i386_vbefill_direct24): Likewise. + (grub_video_i386_vbefill_direct16): Likewise. + (grub_video_i386_vbefill_direct8): Likewise. + + * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter + types. + + * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter + types. + + * video/readers/png.c (grub_png_decode_image_header): Adapt to new + blitter types. + + * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter + types. + 2008-09-06 Felix Zielcke * disk/raid.c (insert_array): Set `array->chunk_size' to 64 for diff --git a/include/grub/i386/pc/vbeblit.h b/include/grub/i386/pc/vbeblit.h index 796c4888e..5a2aa7af0 100644 --- a/include/grub/i386/pc/vbeblit.h +++ b/include/grub/i386/pc/vbeblit.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,64 +25,70 @@ struct grub_video_i386_vbeblit_info; void -grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_directN (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_R8G8B8_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_R8G8B8_R8G8B8X8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_index_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_index_R8G8B8X8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_BGR888_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_R8G8B8_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_index_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); void -grub_video_i386_vbeblit_index_index (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); void grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, @@ -91,9 +97,38 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, int offset_x, int offset_y); void -grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); +grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_i386_vbeblit_blend_index_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); #endif /* ! GRUB_VBEBLIT_MACHINE_HEADER */ diff --git a/include/grub/i386/pc/vbefill.h b/include/grub/i386/pc/vbefill.h index 3cc790b9e..efc6378d4 100644 --- a/include/grub/i386/pc/vbefill.h +++ b/include/grub/i386/pc/vbefill.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -24,24 +24,29 @@ struct grub_video_i386_vbeblit_info; -void -grub_video_i386_vbefill_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - -void -grub_video_i386_vbefill_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - -void -grub_video_i386_vbefill_index (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - void grub_video_i386_vbefill (struct grub_video_i386_vbeblit_info *dst, grub_video_color_t color, int x, int y, int width, int height); +void +grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +void +grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +void +grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +void +grub_video_i386_vbefill_direct8 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + #endif /* ! GRUB_VBEFILL_MACHINE_HEADER */ diff --git a/include/grub/video.h b/include/grub/video.h index b6c8fcdc8..13993267d 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -26,7 +26,7 @@ specific coding format. */ typedef grub_uint32_t grub_video_color_t; -/* This structure is driver specific and should not be accessed directly by +/* This structure is driver specific and should not be accessed directly by outside code. */ struct grub_video_render_target; @@ -55,14 +55,22 @@ struct grub_video_bitmap; /* Defined blitting formats. */ enum grub_video_blit_format { - /* Follow exactly field & mask information. */ + /* Generic RGBA, use fields & masks. */ GRUB_VIDEO_BLIT_FORMAT_RGBA, - /* Make optimization assumption. */ - GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, - /* Follow exactly field & mask information. */ + + /* Optimized RGBA's. */ + GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, + GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, + + /* Generic RGB, use fields & masks. */ GRUB_VIDEO_BLIT_FORMAT_RGB, - /* Make optimization assumption. */ - GRUB_VIDEO_BLIT_FORMAT_R8G8B8, + + /* Optimized RGB's. */ + GRUB_VIDEO_BLIT_FORMAT_RGB_888, + GRUB_VIDEO_BLIT_FORMAT_BGR_888, + GRUB_VIDEO_BLIT_FORMAT_RGB_565, + GRUB_VIDEO_BLIT_FORMAT_BGR_565, + /* When needed, decode color or just use value as is. */ GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR }; @@ -84,7 +92,7 @@ struct grub_video_mode_info /* Height of the screen. */ unsigned int height; - /* Mode type bitmask. Contains information like is it Index color or + /* Mode type bitmask. Contains information like is it Index color or RGB mode. */ unsigned int mode_type; @@ -124,7 +132,7 @@ struct grub_video_mode_info /* How many bits are reserved in color. */ unsigned int reserved_mask_size; - /* What is location of reserved color bits. In Index Color mode, + /* What is location of reserved color bits. In Index Color mode, this is 0. */ unsigned int reserved_field_pos; }; diff --git a/video/bitmap.c b/video/bitmap.c index edbe8240d..8fda51166 100644 --- a/video/bitmap.c +++ b/video/bitmap.c @@ -78,7 +78,7 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, switch (blit_format) { - case GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8: + case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB | GRUB_VIDEO_MODE_TYPE_ALPHA; mode_info->bpp = 32; @@ -94,7 +94,7 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, mode_info->reserved_field_pos = 24; break; - case GRUB_VIDEO_BLIT_FORMAT_R8G8B8: + case GRUB_VIDEO_BLIT_FORMAT_RGB_888: mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB; mode_info->bpp = 24; mode_info->bytes_per_pixel = 3; diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index edd73d50d..41660ac06 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -217,7 +217,7 @@ grub_vbe_set_video_mode (grub_uint32_t mode, case 8: framebuffer.bytes_per_pixel = 1; break; default: grub_vbe_bios_set_mode (old_mode, 0); - return grub_error (GRUB_ERR_BAD_DEVICE, + return grub_error (GRUB_ERR_BAD_DEVICE, "cannot set VBE mode %x", mode); break; @@ -231,9 +231,9 @@ grub_vbe_set_video_mode (grub_uint32_t mode, /* Make sure that the BIOS can reach the palette. */ grub_memcpy (palette, vga_colors, sizeof (vga_colors)); - status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) - / sizeof (struct grub_vbe_palette_data), - 0, + status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) + / sizeof (struct grub_vbe_palette_data), + 0, palette); /* Just ignore the status. */ @@ -413,7 +413,7 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, unsigned int i; /* Decode depth from mode_type. If it is zero, then autodetect. */ - depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) + depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; /* Walk thru mode list and try to find matching mode. */ @@ -490,7 +490,7 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, /* Try to initialize best mode found. */ if (best_mode != 0) { - /* If this fails, then we have mode selection heuristics problem, + /* If this fails, then we have mode selection heuristics problem, or adapter failure. */ grub_vbe_set_video_mode (best_mode, &active_mode_info); if (grub_errno != GRUB_ERR_NONE) @@ -538,8 +538,8 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, render_target->data = framebuffer.ptr; /* Copy default palette to initialize emulated palette. */ - for (i = 0; - i < (sizeof (vga_colors) + for (i = 0; + i < (sizeof (vga_colors) / sizeof (struct grub_vbe_palette_data)); i++) { @@ -560,7 +560,7 @@ static grub_err_t grub_video_vbe_get_info (struct grub_video_mode_info *mode_info) { /* Copy mode info from active render target. */ - grub_memcpy (mode_info, &render_target->mode_info, + grub_memcpy (mode_info, &render_target->mode_info, sizeof (struct grub_video_mode_info)); return GRUB_ERR_NONE; @@ -575,9 +575,9 @@ grub_video_vbe_set_palette (unsigned int start, unsigned int count, if (framebuffer.index_color_mode) { /* TODO: Implement setting indexed color mode palette to hardware. */ - //status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) - // / sizeof (struct grub_vbe_palette_data), - // 0, + //status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) + // / sizeof (struct grub_vbe_palette_data), + // 0, // palette); } @@ -646,6 +646,7 @@ grub_video_vbe_get_viewport (unsigned int *x, unsigned int *y, return GRUB_ERR_NONE; } +/* Maps color name to target optimized color format. */ static grub_video_color_t grub_video_vbe_map_color (grub_uint32_t color_name) { @@ -671,11 +672,12 @@ grub_video_vbe_map_color (grub_uint32_t color_name) return 0; } +/* Maps RGB to target optimized color format. */ grub_video_color_t grub_video_vbe_map_rgb (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue) { - if ((render_target->mode_info.mode_type + if ((render_target->mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) { int minindex = 0; @@ -728,11 +730,12 @@ grub_video_vbe_map_rgb (grub_uint8_t red, grub_uint8_t green, } +/* Maps RGBA to target optimized color format. */ grub_video_color_t grub_video_vbe_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue, grub_uint8_t alpha) { - if ((render_target->mode_info.mode_type + if ((render_target->mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) /* No alpha available in index color modes, just use same value as in only RGB modes. */ @@ -755,6 +758,7 @@ grub_video_vbe_map_rgba (grub_uint8_t red, grub_uint8_t green, } } +/* Splits target optimized format to components. */ grub_err_t grub_video_vbe_unmap_color (grub_video_color_t color, grub_uint8_t *red, grub_uint8_t *green, grub_uint8_t *blue, grub_uint8_t *alpha) @@ -765,10 +769,11 @@ grub_err_t grub_video_vbe_unmap_color (grub_video_color_t color, target_info.data = render_target->data; grub_video_vbe_unmap_color_int (&target_info, color, red, green, blue, alpha); - + return GRUB_ERR_NONE; } +/* Splits color in source format to components. */ void grub_video_vbe_unmap_color_int (struct grub_video_i386_vbeblit_info * source, grub_video_color_t color, @@ -778,7 +783,7 @@ grub_video_vbe_unmap_color_int (struct grub_video_i386_vbeblit_info * source, struct grub_video_mode_info *mode_info; mode_info = source->mode_info; - if ((mode_info->mode_type + if ((mode_info->mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) { /* If we have an out-of-bounds color, return transparent black. */ @@ -875,25 +880,42 @@ grub_video_vbe_fill_rect (grub_video_color_t color, int x, int y, target.mode_info = &render_target->mode_info; target.data = render_target->data; - /* Try to figure out more optimized version. */ - if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8) + /* Try to figure out more optimized version. Note that color is already + mapped to target format so we can make assumptions based on that. */ + if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) { - grub_video_i386_vbefill_R8G8B8A8 (&target, color, x, y, + grub_video_i386_vbefill_direct32 (&target, color, x, y, width, height); return GRUB_ERR_NONE; } - - if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8) + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) { - grub_video_i386_vbefill_R8G8B8 (&target, color, x, y, - width, height); + grub_video_i386_vbefill_direct32 (&target, color, x, y, + width, height); return GRUB_ERR_NONE; } - - if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) { - grub_video_i386_vbefill_index (&target, color, x, y, - width, height); + grub_video_i386_vbefill_direct24 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_565) + { + grub_video_i386_vbefill_direct16 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_565) + { + grub_video_i386_vbefill_direct16 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_i386_vbefill_direct8 (&target, color, x, y, + width, height); return GRUB_ERR_NONE; } @@ -965,15 +987,15 @@ grub_video_vbe_blit_glyph (struct grub_font_glyph * glyph, /* Draw glyph. */ for (j = 0; j < height; j++) for (i = 0; i < width; i++) - if ((glyph->bitmap[((i + x_offset) / 8) - + (j + y_offset) * (charwidth / 8)] + if ((glyph->bitmap[((i + x_offset) / 8) + + (j + y_offset) * (charwidth / 8)] & (1 << ((charwidth - (i + x_offset) - 1) % 8)))) set_pixel (&target, x+i, y+j, color); return GRUB_ERR_NONE; } -/* NOTE: This function assumes that given coordinates are within bounds of +/* NOTE: This function assumes that given coordinates are within bounds of handled data. */ static void common_blitter (struct grub_video_i386_vbeblit_info *target, @@ -985,146 +1007,193 @@ common_blitter (struct grub_video_i386_vbeblit_info *target, if (oper == GRUB_VIDEO_BLIT_REPLACE) { /* Try to figure out more optimized version for replace operator. */ - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8) - { - grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8) - { - grub_video_i386_vbeblit_R8G8B8_R8G8B8X8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_index_R8G8B8X8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8) - { - grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8) - { - grub_video_i386_vbeblit_R8G8B8_R8G8B8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_index_R8G8B8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_index_index (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } + if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_i386_vbeblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_i386_vbeblit_replace_index_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_i386_vbeblit_replace_BGR888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_i386_vbeblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_i386_vbeblit_replace_index_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_i386_vbeblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_i386_vbeblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } /* No optimized replace operator found, use default (slow) blitter. */ grub_video_i386_vbeblit_replace (target, source, x, y, width, height, - offset_x, offset_y); + offset_x, offset_y); } else { /* Try to figure out more optimized blend operator. */ - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8) - { - grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } + if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_i386_vbeblit_blend_index_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + /* Note: There is really no alpha information here, so blend is + changed to replace. */ - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8) - { - grub_video_i386_vbeblit_R8G8B8_R8G8B8A8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_index_R8G8B8A8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8) - { - grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_R8G8B8) - { - grub_video_i386_vbeblit_R8G8B8_R8G8B8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_index_R8G8B8 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_index_index (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_i386_vbeblit_replace_BGR888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_i386_vbeblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_i386_vbeblit_replace_index_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } /* No optimized blend operation found, use default (slow) blitter. */ grub_video_i386_vbeblit_blend (target, source, x, y, width, height, - offset_x, offset_y); + offset_x, offset_y); } } @@ -1148,10 +1217,10 @@ grub_video_vbe_blit_bitmap (struct grub_video_bitmap *bitmap, return GRUB_ERR_NONE; if ((y + (int)bitmap->mode_info.height) < 0) return GRUB_ERR_NONE; - if ((offset_x >= (int)bitmap->mode_info.width) + if ((offset_x >= (int)bitmap->mode_info.width) || (offset_x + (int)width < 0)) return GRUB_ERR_NONE; - if ((offset_y >= (int)bitmap->mode_info.height) + if ((offset_y >= (int)bitmap->mode_info.height) || (offset_y + (int)height < 0)) return GRUB_ERR_NONE; @@ -1239,10 +1308,10 @@ grub_video_vbe_blit_render_target (struct grub_video_render_target *source, return GRUB_ERR_NONE; if ((y + (int)source->mode_info.height) < 0) return GRUB_ERR_NONE; - if ((offset_x >= (int)source->mode_info.width) + if ((offset_x >= (int)source->mode_info.width) || (offset_x + (int)width < 0)) return GRUB_ERR_NONE; - if ((offset_y >= (int)source->mode_info.height) + if ((offset_y >= (int)source->mode_info.height) || (offset_y + (int)height < 0)) return GRUB_ERR_NONE; @@ -1304,7 +1373,7 @@ grub_video_vbe_blit_render_target (struct grub_video_render_target *source, target_info.data = render_target->data; /* Do actual blitting. */ - common_blitter (&target_info, &source_info, oper, x, y, width, height, + common_blitter (&target_info, &source_info, oper, x, y, width, height, offset_x, offset_y); return GRUB_ERR_NONE; @@ -1350,7 +1419,7 @@ grub_video_vbe_scroll (grub_video_color_t color, int dx, int dy) } /* 2. Check if there is need to copy data. */ - if ((grub_abs (dx) < render_target->viewport.width) + if ((grub_abs (dx) < render_target->viewport.width) && (grub_abs (dy) < render_target->viewport.height)) { /* 3. Move data in render target. */ @@ -1389,7 +1458,7 @@ grub_video_vbe_scroll (grub_video_color_t color, int dx, int dy) /* 4b. Fill left & right parts. */ if (dx > 0) - grub_video_vbe_fill_rect (color, 0, 0, + grub_video_vbe_fill_rect (color, 0, 0, dx, render_target->viewport.height); else if (dx < 0) { @@ -1403,7 +1472,7 @@ grub_video_vbe_scroll (grub_video_color_t color, int dx, int dy) return GRUB_ERR_NONE; } -static grub_err_t +static grub_err_t grub_video_vbe_swap_buffers (void) { /* TODO: Implement buffer swapping. */ @@ -1445,7 +1514,7 @@ grub_video_vbe_create_render_target (struct grub_video_render_target **result, /* Setup render target format. */ target->mode_info.width = width; target->mode_info.height = height; - target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB + target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB | GRUB_VIDEO_MODE_TYPE_ALPHA; target->mode_info.bpp = 32; target->mode_info.bytes_per_pixel = 4; @@ -1513,11 +1582,11 @@ grub_video_vbe_set_active_render_target (struct grub_video_render_target *target } if (target == GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "double buffering not implemented yet."); if (! target->data) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid render target given."); render_target = target; @@ -1529,7 +1598,7 @@ static grub_err_t grub_video_vbe_get_active_render_target (struct grub_video_render_target **target) { *target = render_target; - + return GRUB_ERR_NONE; } diff --git a/video/i386/pc/vbeblit.c b/video/i386/pc/vbeblit.c index c5582f96a..4121bfe6c 100644 --- a/video/i386/pc/vbeblit.c +++ b/video/i386/pc/vbeblit.c @@ -34,308 +34,245 @@ #include #include +/* Generic replacing blitter (slow). Works for every supported format. */ void -grub_video_i386_vbeblit_R8G8B8A8_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y) { - grub_uint32_t color; int i; + int j; + grub_uint8_t src_red; + grub_uint8_t src_green; + grub_uint8_t src_blue; + grub_uint8_t src_alpha; + grub_video_color_t src_color; + grub_video_color_t dst_color; + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + src_color = get_pixel (src, i + offset_x, j + offset_y); + + grub_video_vbe_unmap_color_int (src, src_color, &src_red, &src_green, + &src_blue, &src_alpha); + + dst_color = grub_video_vbe_map_rgba (src_red, src_green, + src_blue, src_alpha); + + set_pixel (dst, x + i, y + j, dst_color); + } + } +} + +/* Block copy replacing blitter. Works with modes multiple of 8 bits. */ +void +grub_video_i386_vbeblit_replace_directN (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y) +{ int j; grub_uint32_t *srcptr; grub_uint32_t *dstptr; - unsigned int sr; - unsigned int sg; - unsigned int sb; - unsigned int a; - unsigned int dr; - unsigned int dg; - unsigned int db; + int bpp; - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ + bpp = src->mode_info->bytes_per_pixel; for (j = 0; j < height; j++) { srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); dstptr = (grub_uint32_t *)get_data_ptr (dst, x, y + j); + grub_memmove (dstptr, srcptr, width * bpp); + } +} + +/* Optimized replacing blitter for RGBX8888 to BGRX8888. */ +void +grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + unsigned int srcrowskip; + unsigned int dstrowskip; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + srcptr = (grub_uint8_t *) get_data_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { for (i = 0; i < width; i++) { + grub_uint8_t r = *srcptr++; + grub_uint8_t g = *srcptr++; + grub_uint8_t b = *srcptr++; + grub_uint8_t a = *srcptr++; + + *dstptr++ = b; + *dstptr++ = g; + *dstptr++ = r; + *dstptr++ = a; + } + + srcptr += srcrowskip; + dstptr += dstrowskip; + } +} + +/* Optimized replacing blitter for RGB888 to BGRX8888. */ +void +grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + unsigned int srcrowskip; + unsigned int dstrowskip; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + srcptr = (grub_uint8_t *) get_data_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + grub_uint8_t r = *srcptr++; + grub_uint8_t g = *srcptr++; + grub_uint8_t b = *srcptr++; + + *dstptr++ = b; + *dstptr++ = g; + *dstptr++ = r; + + /* Set alpha component as opaque. */ + *dstptr++ = 255; + } + + srcptr += srcrowskip; + dstptr += dstrowskip; + } +} + +/* Optimized replacing blitter for RGBX8888 to BGR888. */ +void +grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + grub_uint32_t *srcptr; + grub_uint8_t *dstptr; + unsigned int srcrowskip; + unsigned int dstrowskip; + int i; + int j; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + srcptr = (grub_uint32_t *) get_data_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + grub_uint32_t color; + grub_uint8_t sr; + grub_uint8_t sg; + grub_uint8_t sb; + color = *srcptr++; - a = color >> 24; - - if (a == 0) - { - dstptr++; - continue; - } - - if (a == 255) - { - *dstptr++ = color; - continue; - } - sr = (color >> 0) & 0xFF; sg = (color >> 8) & 0xFF; sb = (color >> 16) & 0xFF; - color = *dstptr; - - dr = (color >> 0) & 0xFF; - dg = (color >> 8) & 0xFF; - db = (color >> 16) & 0xFF; - - dr = (dr * (255 - a) + sr * a) / 255; - dg = (dg * (255 - a) + sg * a) / 255; - db = (db * (255 - a) + sb * a) / 255; - - color = (a << 24) | (db << 16) | (dg << 8) | dr; - - *dstptr++ = color; + *dstptr++ = sb; + *dstptr++ = sg; + *dstptr++ = sr; } + + srcptr = (grub_uint32_t *) (((grub_uint8_t *) srcptr) + srcrowskip); + dstptr += dstrowskip; } } +/* Optimized replacing blitter for RGB888 to BGR888. */ void -grub_video_i386_vbeblit_R8G8B8X8_R8G8B8X8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_i386_vbeblit_replace_BGR888_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { - int j; - grub_uint32_t *srcptr; - grub_uint32_t *dstptr; - int pitch; - - pitch = src->mode_info->bytes_per_pixel; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint32_t *)get_data_ptr (dst, x, y + j); - - grub_memmove (dstptr, srcptr, width * pitch); - } -} - -void -grub_video_i386_vbeblit_R8G8B8_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) -{ - grub_uint32_t color; int i; int j; - grub_uint32_t *srcptr; + grub_uint8_t *srcptr; grub_uint8_t *dstptr; - unsigned int sr; - unsigned int sg; - unsigned int sb; - unsigned int a; - unsigned int dr; - unsigned int dg; - unsigned int db; + unsigned int srcrowskip; + unsigned int dstrowskip; - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + srcptr = (grub_uint8_t *) get_data_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); for (j = 0; j < height; j++) { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); - for (i = 0; i < width; i++) { - color = *srcptr++; + grub_uint8_t r = *srcptr++; + grub_uint8_t g = *srcptr++; + grub_uint8_t b = *srcptr++; - a = color >> 24; - - if (a == 0) - { - dstptr += 3; - continue; - } - - sr = (color >> 0) & 0xFF; - sg = (color >> 8) & 0xFF; - sb = (color >> 16) & 0xFF; - - if (a == 255) - { - *dstptr++ = sr; - *dstptr++ = sg; - *dstptr++ = sb; - - continue; - } - - dr = dstptr[0]; - dg = dstptr[1]; - db = dstptr[2]; - - dr = (dr * (255 - a) + sr * a) / 255; - dg = (dg * (255 - a) + sg * a) / 255; - db = (db * (255 - a) + sb * a) / 255; - - *dstptr++ = dr; - *dstptr++ = dg; - *dstptr++ = db; + *dstptr++ = b; + *dstptr++ = g; + *dstptr++ = r; } + + srcptr += srcrowskip; + dstptr += dstrowskip; } } +/* Optimized replacing blitter for RGB888 to RGBX8888. */ void -grub_video_i386_vbeblit_R8G8B8_R8G8B8X8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) -{ - grub_uint32_t color; - int i; - int j; - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; - unsigned int sr; - unsigned int sg; - unsigned int sb; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); - - for (i = 0; i < width; i++) - { - color = *srcptr++; - - sr = (color >> 0) & 0xFF; - sg = (color >> 8) & 0xFF; - sb = (color >> 16) & 0xFF; - - *dstptr++ = sr; - *dstptr++ = sg; - *dstptr++ = sb; - } - } -} - -void -grub_video_i386_vbeblit_index_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) -{ - grub_uint32_t color; - int i; - int j; - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; - unsigned int sr; - unsigned int sg; - unsigned int sb; - unsigned int a; - unsigned char dr; - unsigned char dg; - unsigned char db; - unsigned char da; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); - - for (i = 0; i < width; i++) - { - color = *srcptr++; - - a = color >> 24; - - if (a == 0) - { - dstptr++; - continue; - } - - sr = (color >> 0) & 0xFF; - sg = (color >> 8) & 0xFF; - sb = (color >> 16) & 0xFF; - - if (a == 255) - { - color = grub_video_vbe_map_rgb(sr, sg, sb); - *dstptr++ = color & 0xFF; - continue; - } - - grub_video_vbe_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da); - - dr = (dr * (255 - a) + sr * a) / 255; - dg = (dg * (255 - a) + sg * a) / 255; - db = (db * (255 - a) + sb * a) / 255; - - color = grub_video_vbe_map_rgb(dr, dg, db); - - *dstptr++ = color & 0xFF; - } - } -} - -void -grub_video_i386_vbeblit_index_R8G8B8X8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) -{ - grub_uint32_t color; - int i; - int j; - grub_uint32_t *srcptr; - grub_uint8_t *dstptr; - unsigned int sr; - unsigned int sg; - unsigned int sb; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); - - for (i = 0; i < width; i++) - { - color = *srcptr++; - - sr = (color >> 0) & 0xFF; - sg = (color >> 8) & 0xFF; - sb = (color >> 16) & 0xFF; - - color = grub_video_vbe_map_rgb(sr, sg, sb); - *dstptr++ = color & 0xFF; - } - } -} - -void -grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -346,9 +283,6 @@ grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_i386_vbeblit_info *ds unsigned int sg; unsigned int sb; - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - for (j = 0; j < height; j++) { srcptr = (grub_uint8_t *)get_data_ptr (src, offset_x, j + offset_y); @@ -360,6 +294,7 @@ grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_i386_vbeblit_info *ds sg = *srcptr++; sb = *srcptr++; + /* Set alpha as opaque. */ color = 0xFF000000 | (sb << 16) | (sg << 8) | sr; *dstptr++ = color; @@ -367,36 +302,86 @@ grub_video_i386_vbeblit_R8G8B8A8_R8G8B8 (struct grub_video_i386_vbeblit_info *ds } } +/* Optimized replacing blitter for RGBX8888 to RGB888. */ void -grub_video_i386_vbeblit_R8G8B8_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { + grub_uint32_t color; + int i; int j; - grub_uint8_t *srcptr; + grub_uint32_t *srcptr; grub_uint8_t *dstptr; - int pitch; - - pitch = src->mode_info->bytes_per_pixel; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ + unsigned int sr; + unsigned int sg; + unsigned int sb; for (j = 0; j < height; j++) { - srcptr = (grub_uint8_t *)get_data_ptr (src, offset_x, j + offset_y); + srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); - grub_memmove (dstptr, srcptr, width * pitch); + for (i = 0; i < width; i++) + { + color = *srcptr++; + + sr = (color >> 0) & 0xFF; + sg = (color >> 8) & 0xFF; + sb = (color >> 16) & 0xFF; + + *dstptr++ = sr; + *dstptr++ = sg; + *dstptr++ = sb; + } } } +/* Optimized replacing blitter for RGBX8888 to indexed color. */ void -grub_video_i386_vbeblit_index_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + grub_uint32_t color; + int i; + int j; + grub_uint32_t *srcptr; + grub_uint8_t *dstptr; + unsigned int sr; + unsigned int sg; + unsigned int sb; + + for (j = 0; j < height; j++) + { + srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + + for (i = 0; i < width; i++) + { + color = *srcptr++; + + sr = (color >> 0) & 0xFF; + sg = (color >> 8) & 0xFF; + sb = (color >> 16) & 0xFF; + + color = grub_video_vbe_map_rgb(sr, sg, sb); + *dstptr++ = color & 0xFF; + } + } +} + +/* Optimized replacing blitter for RGB888 to indexed color. */ +void +grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -407,9 +392,6 @@ grub_video_i386_vbeblit_index_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, unsigned int sg; unsigned int sb; - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - for (j = 0; j < height; j++) { srcptr = (grub_uint8_t *)get_data_ptr (src, offset_x, j + offset_y); @@ -428,31 +410,7 @@ grub_video_i386_vbeblit_index_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, } } -void -grub_video_i386_vbeblit_index_index (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) -{ - int j; - grub_uint8_t *srcptr; - grub_uint8_t *dstptr; - int pitch; - - pitch = src->mode_info->bytes_per_pixel; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - srcptr = (grub_uint8_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); - - grub_memmove (dstptr, srcptr, width * pitch); - } -} - +/* Generic blending blitter. Works for every supported format. */ void grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, struct grub_video_i386_vbeblit_info *src, @@ -462,9 +420,6 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, int i; int j; - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - for (j = 0; j < height; j++) { for (i = 0; i < width; i++) @@ -516,35 +471,358 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, } } +/* Optimized blending blitter for RGBA8888 to BGRA8888. */ void -grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { + grub_uint32_t *srcptr; + grub_uint32_t *dstptr; + unsigned int srcrowskip; + unsigned int dstrowskip; int i; int j; - grub_uint8_t src_red; - grub_uint8_t src_green; - grub_uint8_t src_blue; - grub_uint8_t src_alpha; - grub_video_color_t src_color; - grub_video_color_t dst_color; - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + srcptr = (grub_uint32_t *) get_data_ptr (src, offset_x, offset_y); + dstptr = (grub_uint32_t *) get_data_ptr (dst, x, y); for (j = 0; j < height; j++) - { - for (i = 0; i < width; i++) { - src_color = get_pixel (src, i + offset_x, j + offset_y); - grub_video_vbe_unmap_color_int (src, src_color, &src_red, &src_green, - &src_blue, &src_alpha); + for (i = 0; i < width; i++) + { + grub_uint32_t color; + unsigned int sr; + unsigned int sg; + unsigned int sb; + unsigned int a; + unsigned int dr; + unsigned int dg; + unsigned int db; - dst_color = grub_video_vbe_map_rgba (src_red, src_green, - src_blue, src_alpha); - set_pixel (dst, x + i, y + j, dst_color); + color = *srcptr++; + + a = color >> 24; + + if (a == 0) + { + /* Skip transparent source pixels. */ + dstptr++; + continue; + } + + sr = (color >> 0) & 0xFF; + sg = (color >> 8) & 0xFF; + sb = (color >> 16) & 0xFF; + + if (a == 255) + { + /* Opaque pixel shortcut. */ + dr = sr; + dg = sg; + db = sb; + } + else + { + /* General pixel color blending. */ + color = *dstptr; + + dr = (color >> 16) & 0xFF; + dr = (dr * (255 - a) + sr * a) / 255; + dg = (color >> 8) & 0xFF; + dg = (dg * (255 - a) + sg * a) / 255; + db = (color >> 0) & 0xFF; + db = (db * (255 - a) + sb * a) / 255; + } + + color = (a << 24) | (dr << 16) | (dg << 8) | db; + + *dstptr++ = color; + } + + srcptr = (grub_uint32_t *) (((grub_uint8_t *) srcptr) + srcrowskip); + dstptr = (grub_uint32_t *) (((grub_uint8_t *) dstptr) + dstrowskip); + } +} + +/* Optimized blending blitter for RGBA8888 to BGR888. */ +void +grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + grub_uint32_t *srcptr; + grub_uint8_t *dstptr; + unsigned int srcrowskip; + unsigned int dstrowskip; + int i; + int j; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + srcptr = (grub_uint32_t *) get_data_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + grub_uint32_t color; + unsigned int sr; + unsigned int sg; + unsigned int sb; + unsigned int a; + unsigned int dr; + unsigned int dg; + unsigned int db; + + color = *srcptr++; + + a = color >> 24; + + if (a == 0) + { + /* Skip transparent source pixels. */ + dstptr += 3; + continue; + } + + sr = (color >> 0) & 0xFF; + sg = (color >> 8) & 0xFF; + sb = (color >> 16) & 0xFF; + + if (a == 255) + { + /* Opaque pixel shortcut. */ + dr = sr; + dg = sg; + db = sb; + } + else + { + /* General pixel color blending. */ + color = *dstptr; + + db = dstptr[0]; + db = (db * (255 - a) + sb * a) / 255; + dg = dstptr[1]; + dg = (dg * (255 - a) + sg * a) / 255; + dr = dstptr[2]; + dr = (dr * (255 - a) + sr * a) / 255; + } + + *dstptr++ = db; + *dstptr++ = dg; + *dstptr++ = dr; + } + + srcptr = (grub_uint32_t *) (((grub_uint8_t *) srcptr) + srcrowskip); + dstptr += dstrowskip; + } +} + +/* Optimized blending blitter for RGBA888 to RGBA8888. */ +void +grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + grub_uint32_t color; + int i; + int j; + grub_uint32_t *srcptr; + grub_uint32_t *dstptr; + unsigned int sr; + unsigned int sg; + unsigned int sb; + unsigned int a; + unsigned int dr; + unsigned int dg; + unsigned int db; + + for (j = 0; j < height; j++) + { + srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint32_t *)get_data_ptr (dst, x, y + j); + + for (i = 0; i < width; i++) + { + color = *srcptr++; + + a = color >> 24; + + if (a == 0) + { + dstptr++; + continue; + } + + if (a == 255) + { + *dstptr++ = color; + continue; + } + + sr = (color >> 0) & 0xFF; + sg = (color >> 8) & 0xFF; + sb = (color >> 16) & 0xFF; + + color = *dstptr; + + dr = (color >> 0) & 0xFF; + dg = (color >> 8) & 0xFF; + db = (color >> 16) & 0xFF; + + dr = (dr * (255 - a) + sr * a) / 255; + dg = (dg * (255 - a) + sg * a) / 255; + db = (db * (255 - a) + sb * a) / 255; + + color = (a << 24) | (db << 16) | (dg << 8) | dr; + + *dstptr++ = color; + } + } +} + +/* Optimized blending blitter for RGBA8888 to RGB888. */ +void +grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + grub_uint32_t color; + int i; + int j; + grub_uint32_t *srcptr; + grub_uint8_t *dstptr; + unsigned int sr; + unsigned int sg; + unsigned int sb; + unsigned int a; + unsigned int dr; + unsigned int dg; + unsigned int db; + + for (j = 0; j < height; j++) + { + srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + + for (i = 0; i < width; i++) + { + color = *srcptr++; + + a = color >> 24; + + if (a == 0) + { + dstptr += 3; + continue; + } + + sr = (color >> 0) & 0xFF; + sg = (color >> 8) & 0xFF; + sb = (color >> 16) & 0xFF; + + if (a == 255) + { + *dstptr++ = sr; + *dstptr++ = sg; + *dstptr++ = sb; + + continue; + } + + dr = dstptr[0]; + dg = dstptr[1]; + db = dstptr[2]; + + dr = (dr * (255 - a) + sr * a) / 255; + dg = (dg * (255 - a) + sg * a) / 255; + db = (db * (255 - a) + sb * a) / 255; + + *dstptr++ = dr; + *dstptr++ = dg; + *dstptr++ = db; + } + } +} + +/* Optimized blending blitter for RGBA8888 to indexed color. */ +void +grub_video_i386_vbeblit_blend_index_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, + struct grub_video_i386_vbeblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + grub_uint32_t color; + int i; + int j; + grub_uint32_t *srcptr; + grub_uint8_t *dstptr; + unsigned int sr; + unsigned int sg; + unsigned int sb; + unsigned int a; + unsigned char dr; + unsigned char dg; + unsigned char db; + unsigned char da; + + for (j = 0; j < height; j++) + { + srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + + for (i = 0; i < width; i++) + { + color = *srcptr++; + + a = color >> 24; + + if (a == 0) + { + dstptr++; + continue; + } + + sr = (color >> 0) & 0xFF; + sg = (color >> 8) & 0xFF; + sb = (color >> 16) & 0xFF; + + if (a == 255) + { + color = grub_video_vbe_map_rgb(sr, sg, sb); + *dstptr++ = color & 0xFF; + continue; + } + + grub_video_vbe_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da); + + dr = (dr * (255 - a) + sr * a) / 255; + dg = (dg * (255 - a) + sg * a) / 255; + db = (db * (255 - a) + sb * a) / 255; + + color = grub_video_vbe_map_rgb(dr, dg, db); + + *dstptr++ = color & 0xFF; + } } - } } diff --git a/video/i386/pc/vbefill.c b/video/i386/pc/vbefill.c index 8ba550ad9..3a98a715a 100644 --- a/video/i386/pc/vbefill.c +++ b/video/i386/pc/vbefill.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,77 +33,7 @@ #include #include -void -grub_video_i386_vbefill_R8G8B8A8 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) -{ - int i; - int j; - grub_uint32_t *dstptr; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - dstptr = (grub_uint32_t *)grub_video_vbe_get_video_ptr (dst, x, y + j); - - for (i = 0; i < width; i++) - *dstptr++ = color; - } -} - -void -grub_video_i386_vbefill_R8G8B8 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) -{ - int i; - int j; - grub_uint8_t *dstptr; - grub_uint8_t fillr = (grub_uint8_t)((color >> 0) & 0xFF); - grub_uint8_t fillg = (grub_uint8_t)((color >> 8) & 0xFF); - grub_uint8_t fillb = (grub_uint8_t)((color >> 16) & 0xFF); - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j); - - for (i = 0; i < width; i++) - { - *dstptr++ = fillr; - *dstptr++ = fillg; - *dstptr++ = fillb; - } - } -} - -void -grub_video_i386_vbefill_index (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) -{ - int i; - int j; - grub_uint8_t *dstptr; - grub_uint8_t fill = (grub_uint8_t)color & 0xFF; - - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - - for (j = 0; j < height; j++) - { - dstptr = (grub_uint8_t *)grub_video_vbe_get_video_ptr (dst, x, y + j); - - for (i = 0; i < width; i++) - *dstptr++ = fill; - } -} - +/* Generic filler that works for every supported mode. */ void grub_video_i386_vbefill (struct grub_video_i386_vbeblit_info *dst, grub_video_color_t color, int x, int y, @@ -112,10 +42,136 @@ grub_video_i386_vbefill (struct grub_video_i386_vbeblit_info *dst, int i; int j; - /* We do not need to worry about data being out of bounds - as we assume that everything has been checked before. */ - for (j = 0; j < height; j++) for (i = 0; i < width; i++) set_pixel (dst, x+i, y+j, color); } + +/* Optimized filler for direct color 32 bit modes. It is assumed that color + is already mapped to destination format. */ +void +grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) +{ + int i; + int j; + grub_uint32_t *dstptr; + grub_size_t rowskip; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + /* Get the start address. */ + dstptr = (grub_uint32_t *) grub_video_vbe_get_video_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + *dstptr++ = color; + + /* Advance the dest pointer to the right location on the next line. */ + dstptr = (grub_uint32_t *) (((char *) dstptr) + rowskip); + } +} + +/* Optimized filler for direct color 24 bit modes. It is assumed that color + is already mapped to destination format. */ +void +grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) +{ + int i; + int j; + grub_size_t rowskip; + grub_uint8_t *dstptr; + grub_uint8_t fill0 = (grub_uint8_t)((color >> 0) & 0xFF); + grub_uint8_t fill1 = (grub_uint8_t)((color >> 8) & 0xFF); + grub_uint8_t fill2 = (grub_uint8_t)((color >> 16) & 0xFF); + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + /* Get the start address. */ + dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + *dstptr++ = fill0; + *dstptr++ = fill1; + *dstptr++ = fill2; + } + + /* Advance the dest pointer to the right location on the next line. */ + dstptr += rowskip; + } +} + +/* Optimized filler for direct color 16 bit modes. It is assumed that color + is already mapped to destination format. */ +void +grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) +{ + int i; + int j; + grub_size_t rowskip; + grub_uint8_t *dstptr; + grub_uint8_t fill0 = (grub_uint8_t)((color >> 0) & 0xFF); + grub_uint8_t fill1 = (grub_uint8_t)((color >> 8) & 0xFF); + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + /* Get the start address. */ + dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + *dstptr++ = fill0; + *dstptr++ = fill1; + } + + /* Advance the dest pointer to the right location on the next line. */ + dstptr += rowskip; + } +} + +/* Optimized filler for index color. It is assumed that color + is already mapped to destination format. */ +void +grub_video_i386_vbefill_direct8 (struct grub_video_i386_vbeblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) +{ + int i; + int j; + grub_size_t rowskip; + grub_uint8_t *dstptr; + grub_uint8_t fill = (grub_uint8_t)color & 0xFF; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + + /* Get the start address. */ + dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + *dstptr++ = fill; + + /* Advance the dest pointer to the right location on the next line. */ + dstptr += rowskip; + } +} diff --git a/video/readers/jpeg.c b/video/readers/jpeg.c index 03f3a9437..327c9f91c 100644 --- a/video/readers/jpeg.c +++ b/video/readers/jpeg.c @@ -542,7 +542,7 @@ grub_jpeg_decode_sos (struct grub_jpeg_data *data) if (grub_video_bitmap_create (data->bitmap, data->image_width, data->image_height, - GRUB_VIDEO_BLIT_FORMAT_R8G8B8)) + GRUB_VIDEO_BLIT_FORMAT_RGB_888)) return grub_errno; data->bit_mask = 0x0; diff --git a/video/readers/png.c b/video/readers/png.c index ceb77e72c..3364d56c0 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -231,7 +231,7 @@ grub_png_decode_image_header (struct grub_png_data *data) { if (grub_video_bitmap_create (data->bitmap, data->image_width, data->image_height, - GRUB_VIDEO_BLIT_FORMAT_R8G8B8)) + GRUB_VIDEO_BLIT_FORMAT_RGB_888)) return grub_errno; data->bpp = 3; } @@ -239,7 +239,7 @@ grub_png_decode_image_header (struct grub_png_data *data) { if (grub_video_bitmap_create (data->bitmap, data->image_width, data->image_height, - GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8)) + GRUB_VIDEO_BLIT_FORMAT_RGBA_8888)) return grub_errno; data->bpp = 4; } diff --git a/video/readers/tga.c b/video/readers/tga.c index e99841532..de56008cb 100644 --- a/video/readers/tga.c +++ b/video/readers/tga.c @@ -397,7 +397,7 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, { grub_video_bitmap_create (bitmap, header.image_width, header.image_height, - GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8); + GRUB_VIDEO_BLIT_FORMAT_RGBA_8888); if (grub_errno != GRUB_ERR_NONE) { grub_file_close (file); @@ -420,7 +420,7 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, { grub_video_bitmap_create (bitmap, header.image_width, header.image_height, - GRUB_VIDEO_BLIT_FORMAT_R8G8B8); + GRUB_VIDEO_BLIT_FORMAT_RGB_888); if (grub_errno != GRUB_ERR_NONE) { grub_file_close (file); diff --git a/video/video.c b/video/video.c index c365afeb4..1caf8861b 100644 --- a/video/video.c +++ b/video/video.c @@ -108,7 +108,7 @@ grub_video_setup (unsigned int width, unsigned int height, } /* We couldn't find suitable adapter for specified mode. */ - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't locate valid adapter for mode"); } @@ -140,7 +140,7 @@ grub_video_get_info (struct grub_video_mode_info *mode_info) grub_errno = GRUB_ERR_NONE; return grub_errno; } - + return grub_video_adapter_active->get_info (mode_info); } @@ -152,40 +152,82 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) if (mode_info->bpp == 32) { if ((mode_info->red_mask_size == 8) - && (mode_info->red_field_pos == 0) - && (mode_info->green_mask_size == 8) - && (mode_info->green_field_pos == 8) - && (mode_info->blue_mask_size == 8) - && (mode_info->blue_field_pos == 16) - && (mode_info->reserved_mask_size == 8) - && (mode_info->reserved_field_pos == 24)) - { - return GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8; - } + && (mode_info->red_field_pos == 16) + && (mode_info->green_mask_size == 8) + && (mode_info->green_field_pos == 8) + && (mode_info->blue_mask_size == 8) + && (mode_info->blue_field_pos == 0)) + { + return GRUB_VIDEO_BLIT_FORMAT_BGRA_8888; + } + else if ((mode_info->red_mask_size == 8) + && (mode_info->red_field_pos == 0) + && (mode_info->green_mask_size == 8) + && (mode_info->green_field_pos == 8) + && (mode_info->blue_mask_size == 8) + && (mode_info->blue_field_pos == 16)) + { + return GRUB_VIDEO_BLIT_FORMAT_RGBA_8888; + } } - /* Check if we have any known 24 bit modes. */ - if (mode_info->bpp == 24) + else if (mode_info->bpp == 24) { if ((mode_info->red_mask_size == 8) - && (mode_info->red_field_pos == 0) - && (mode_info->green_mask_size == 8) - && (mode_info->green_field_pos == 8) - && (mode_info->blue_mask_size == 8) - && (mode_info->blue_field_pos == 16)) - { - return GRUB_VIDEO_BLIT_FORMAT_R8G8B8; - } + && (mode_info->red_field_pos == 16) + && (mode_info->green_mask_size == 8) + && (mode_info->green_field_pos == 8) + && (mode_info->blue_mask_size == 8) + && (mode_info->blue_field_pos == 0)) + { + return GRUB_VIDEO_BLIT_FORMAT_BGR_888; + } + else if ((mode_info->red_mask_size == 8) + && (mode_info->red_field_pos == 0) + && (mode_info->green_mask_size == 8) + && (mode_info->green_field_pos == 8) + && (mode_info->blue_mask_size == 8) + && (mode_info->blue_field_pos == 16)) + { + return GRUB_VIDEO_BLIT_FORMAT_RGB_888; + } } + /* Check if we have any known 16 bit modes. */ + else if (mode_info->bpp == 16) + { + if ((mode_info->red_mask_size == 5) + && (mode_info->red_field_pos == 11) + && (mode_info->green_mask_size == 6) + && (mode_info->green_field_pos == 5) + && (mode_info->blue_mask_size == 5) + && (mode_info->blue_field_pos == 0)) + { + return GRUB_VIDEO_BLIT_FORMAT_BGR_565; + } + else if ((mode_info->red_mask_size == 5) + && (mode_info->red_field_pos == 0) + && (mode_info->green_mask_size == 6) + && (mode_info->green_field_pos == 5) + && (mode_info->blue_mask_size == 5) + && (mode_info->blue_field_pos == 11)) + { + return GRUB_VIDEO_BLIT_FORMAT_RGB_565; + } + } + + /* Backup route. Unknown format. */ /* If there are more than 8 bits per color, assume RGB(A) mode. */ if (mode_info->bpp > 8) { if (mode_info->reserved_mask_size > 0) - { - return GRUB_VIDEO_BLIT_FORMAT_RGBA; - } - return GRUB_VIDEO_BLIT_FORMAT_RGB; + { + return GRUB_VIDEO_BLIT_FORMAT_RGBA; + } + else + { + return GRUB_VIDEO_BLIT_FORMAT_RGB; + } } /* Assume as indexcolor mode. */ @@ -269,8 +311,8 @@ grub_video_map_rgba (grub_uint8_t red, grub_uint8_t green, grub_uint8_t blue, /* Unmap video color back to RGBA components. */ grub_err_t -grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red, - grub_uint8_t *green, grub_uint8_t *blue, +grub_video_unmap_color (grub_video_color_t color, grub_uint8_t *red, + grub_uint8_t *green, grub_uint8_t *blue, grub_uint8_t *alpha) { if (! grub_video_adapter_active) From 548e2ea57cf0fe17e79d14e2f31996da2ee256a3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 7 Sep 2008 16:09:21 +0000 Subject: [PATCH 0399/1707] 2008-09-07 Robert Millan * conf/i386.rmk: New file. Provides declaration for building `cpuid.mod'. * conf/i386-pc.rmk (pkglib_MODULES): Remove `cpuid.mod'. (cpuid_mod_SOURCES, cpuid_mod_CFLAGS, cpuid_mod_LDFLAGS): Remove variables. Include `conf/i386.mk'. * conf/i386-efi.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. --- ChangeLog | 13 +++++++++ conf/i386-coreboot.mk | 60 ++--------------------------------------- conf/i386-coreboot.rmk | 8 ++---- conf/i386-efi.mk | 60 ++--------------------------------------- conf/i386-efi.rmk | 8 ++---- conf/i386-ieee1275.mk | 60 ++--------------------------------------- conf/i386-ieee1275.rmk | 8 ++---- conf/i386-pc.mk | 60 ++--------------------------------------- conf/i386-pc.rmk | 8 ++---- conf/i386.mk | 61 ++++++++++++++++++++++++++++++++++++++++++ conf/i386.rmk | 8 ++++++ conf/x86_64-efi.mk | 60 ++--------------------------------------- conf/x86_64-efi.rmk | 8 ++---- 13 files changed, 102 insertions(+), 320 deletions(-) create mode 100644 conf/i386.mk create mode 100644 conf/i386.rmk diff --git a/ChangeLog b/ChangeLog index 22626adf3..41aa04ae8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-09-07 Robert Millan + + * conf/i386.rmk: New file. Provides declaration for building + `cpuid.mod'. + * conf/i386-pc.rmk (pkglib_MODULES): Remove `cpuid.mod'. + (cpuid_mod_SOURCES, cpuid_mod_CFLAGS, cpuid_mod_LDFLAGS): Remove + variables. + Include `conf/i386.mk'. + * conf/i386-efi.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + 2008-09-07 Vesa Jääskeläinen Based on patch created by Colin D Bennett . diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 3e857f5eb..4ffbfb4f7 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -573,7 +573,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod \ + play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod @@ -1516,63 +1516,6 @@ partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c CLEANFILES += ata.mod mod-ata.o mod-ata.c pre-ata.o ata_mod-disk_ata.o und-ata.lst @@ -1991,4 +1934,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 3f57d41d3..ac3091277 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -94,7 +94,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ - play.mod cpuid.mod serial.mod ata.mod \ + play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod @@ -156,11 +156,6 @@ play_mod_SOURCES = commands/i386/pc/play.c play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c ata_mod_CFLAGS = $(COMMON_CFLAGS) @@ -196,4 +191,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index bf654fe19..286ec54f5 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -119,7 +119,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod \ + _linux.mod linux.mod halt.mod reboot.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -1349,63 +1349,6 @@ partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst @@ -1824,4 +1767,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index d0a216bd6..3259f0ff3 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -76,7 +76,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod cpuid.mod halt.mod reboot.mod pci.mod lspci.mod \ + _linux.mod linux.mod halt.mod reboot.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -144,11 +144,6 @@ linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -184,4 +179,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 0f3c1648a..e24915c73 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -589,7 +589,7 @@ grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPE # Modules. -pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ +pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod @@ -1304,63 +1304,6 @@ partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCI halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For serial.mod. serial_mod_SOURCES = term/i386/pc/serial.c CLEANFILES += serial.mod mod-serial.o mod-serial.c pre-serial.o serial_mod-term_i386_pc_serial.o und-serial.lst @@ -1950,4 +1893,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 24cd719f2..79cfd47eb 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -96,7 +96,7 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/ieee1275/grub-install.in # Modules. -pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod cpuid.mod \ +pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod @@ -143,11 +143,6 @@ halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For serial.mod. serial_mod_SOURCES = term/i386/pc/serial.c serial_mod_CFLAGS = $(COMMON_CFLAGS) @@ -198,4 +193,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 169ca74ac..71d273e68 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -928,7 +928,7 @@ grub-mkrescue: util/i386/pc/grub-mkrescue.in $(util/i386/pc/grub-mkrescue.in_DEP pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ - videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ + videotest.mod play.mod bitmap.mod tga.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod @@ -2463,63 +2463,6 @@ partmap-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c tga_mod_CFLAGS = $(COMMON_CFLAGS) tga_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c CLEANFILES += ata.mod mod-ata.o mod-ata.c pre-ata.o ata_mod-disk_ata.o und-ata.lst @@ -3394,4 +3337,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index fc36a6ea2..1c2447a2c 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -163,7 +163,7 @@ grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ - videotest.mod play.mod bitmap.mod tga.mod cpuid.mod serial.mod \ + videotest.mod play.mod bitmap.mod tga.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod @@ -278,11 +278,6 @@ tga_mod_SOURCES = video/readers/tga.c tga_mod_CFLAGS = $(COMMON_CFLAGS) tga_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c ata_mod_CFLAGS = $(COMMON_CFLAGS) @@ -358,4 +353,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386.mk b/conf/i386.mk new file mode 100644 index 000000000..77616d1cc --- /dev/null +++ b/conf/i386.mk @@ -0,0 +1,61 @@ +# -*- makefile -*- +# Generated by genmk.rb, please don't edit! + +pkglib_MODULES += cpuid.mod + +# For cpuid.mod. +cpuid_mod_SOURCES = commands/i386/cpuid.c +CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst +ifneq ($(cpuid_mod_EXPORTS),no) +CLEANFILES += def-cpuid.lst +DEFSYMFILES += def-cpuid.lst +endif +MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d +UNDSYMFILES += und-cpuid.lst + +cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o + -rm -f $@ + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o + +mod-cpuid.o: mod-cpuid.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< + +mod-cpuid.c: moddep.lst genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(cpuid_mod_EXPORTS),no) +def-cpuid.lst: pre-cpuid.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ +endif + +und-cpuid.lst: pre-cpuid.o + echo 'cpuid' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< +-include cpuid_mod-commands_i386_cpuid.d + +CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst +COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst +FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst +PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst + +cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) + +fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) + +partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + + +cpuid_mod_CFLAGS = $(COMMON_CFLAGS) +cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386.rmk b/conf/i386.rmk new file mode 100644 index 000000000..458415b08 --- /dev/null +++ b/conf/i386.rmk @@ -0,0 +1,8 @@ +# -*- makefile -*- + +pkglib_MODULES += cpuid.mod + +# For cpuid.mod. +cpuid_mod_SOURCES = commands/i386/cpuid.c +cpuid_mod_CFLAGS = $(COMMON_CFLAGS) +cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index bd0a4e1d5..d0e0811fc 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -103,7 +103,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ + halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -1352,63 +1352,6 @@ partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: moddep.lst genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst @@ -1827,4 +1770,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 16008522d..6d13981bf 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -78,7 +78,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - cpuid.mod halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ + halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -146,11 +146,6 @@ linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For cpuid.mod. -cpuid_mod_SOURCES = commands/i386/cpuid.c -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For halt.mod. halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -186,4 +181,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk From 783d0f484f18a3a32545e0702ae0982c19d90888 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 7 Sep 2008 17:13:00 +0000 Subject: [PATCH 0400/1707] 2008-09-07 Robert Millan * loader/i386/pc/multiboot.c (mmap_addr, mmap_length): Remove variables. (grub_multiboot): Move `mbi' allocation upwards, so that mmap address and length can be stored directly in the `mbi->mmap_addr' and `mbi->mmap_length' struct fields. --- ChangeLog | 8 ++++++++ loader/i386/pc/multiboot.c | 34 ++++++++++++++-------------------- 2 files changed, 22 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 41aa04ae8..8b0119982 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-07 Robert Millan + + * loader/i386/pc/multiboot.c (mmap_addr, mmap_length): Remove + variables. + (grub_multiboot): Move `mbi' allocation upwards, so that mmap address + and length can be stored directly in the `mbi->mmap_addr' and + `mbi->mmap_length' struct fields. + 2008-09-07 Robert Millan * conf/i386.rmk: New file. Provides declaration for building diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 509dacbd5..725fac887 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -1,7 +1,7 @@ /* multiboot.c - boot a multiboot OS image. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -82,11 +82,6 @@ grub_multiboot_unload (void) return GRUB_ERR_NONE; } -/* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated - by the spec. Is there something we can do about it? */ -static grub_uint32_t mmap_addr = 0; -static grub_uint32_t mmap_length; - /* Return the length of the Multiboot mmap that will be needed to allocate our platform's map. */ static grub_uint32_t @@ -422,8 +417,14 @@ grub_multiboot (int argc, char *argv[]) playground = NULL; } - mmap_length = grub_get_multiboot_mmap_len (); - grub_multiboot_payload_size = mmap_length; + mbi = grub_malloc (sizeof (struct grub_multiboot_info)); + if (! mbi) + goto fail; + + grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); + + mbi->mmap_length = grub_get_multiboot_mmap_len (); + grub_multiboot_payload_size = mbi->mmap_length; if (header->flags & MULTIBOOT_AOUT_KLUDGE) { @@ -464,9 +465,12 @@ grub_multiboot (int argc, char *argv[]) grub_fill_multiboot_mmap ((struct grub_multiboot_mmap_entry *) (grub_multiboot_payload_orig + grub_multiboot_payload_size - - mmap_length)); + - mbi->mmap_length)); - mmap_addr = grub_multiboot_payload_dest + grub_multiboot_payload_size - mmap_length; + /* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated + by the spec. Is there something we can do about it? */ + mbi->mmap_addr = grub_multiboot_payload_dest + grub_multiboot_payload_size - mbi->mmap_length; + mbi->flags |= MULTIBOOT_INFO_MEM_MAP; if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) { @@ -485,21 +489,11 @@ grub_multiboot (int argc, char *argv[]) grub_multiboot_payload_size, grub_multiboot_payload_entry_offset); - mbi = grub_malloc (sizeof (struct grub_multiboot_info)); - if (! mbi) - goto fail; - - grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); - /* Convert from bytes to kilobytes. */ mbi->mem_lower = grub_lower_mem / 1024; mbi->mem_upper = grub_upper_mem / 1024; mbi->flags |= MULTIBOOT_INFO_MEMORY; - mbi->mmap_addr = mmap_addr; - mbi->mmap_length = mmap_length; - mbi->flags |= MULTIBOOT_INFO_MEM_MAP; - for (i = 0, len = 0; i < argc; i++) len += grub_strlen (argv[i]) + 1; From ddbf5556a7a948f53764ebf4fd45d0abb6533734 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 8 Sep 2008 13:52:30 +0000 Subject: [PATCH 0401/1707] 2008-09-08 Robert Millan * include/grub/util/biosdisk.h: Move to ... * include/grub/util/hostdisk.h: ... here. Update all users. * util/biosdisk.c: Move to ... * util/hostdisk.c: ... here. Update all users. --- ChangeLog | 7 +++++ conf/common.mk | 14 +++++----- conf/common.rmk | 2 +- conf/i386-coreboot.mk | 14 +++++----- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.mk | 4 +-- conf/i386-efi.rmk | 4 +-- conf/i386-ieee1275.mk | 14 +++++----- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.mk | 28 ++++++++++---------- conf/i386-pc.rmk | 4 +-- conf/powerpc-ieee1275.mk | 14 +++++----- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.mk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- conf/x86_64-efi.mk | 4 +-- conf/x86_64-efi.rmk | 4 +-- include/grub/util/{biosdisk.h => hostdisk.h} | 0 util/getroot.c | 2 +- util/grub-emu.c | 2 +- util/grub-probe.c | 2 +- util/{biosdisk.c => hostdisk.c} | 0 util/i386/pc/grub-setup.c | 2 +- 23 files changed, 69 insertions(+), 62 deletions(-) rename include/grub/util/{biosdisk.h => hostdisk.h} (100%) rename util/{biosdisk.c => hostdisk.c} (100%) diff --git a/ChangeLog b/ChangeLog index 8b0119982..43a35afe5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-08 Robert Millan + + * include/grub/util/biosdisk.h: Move to ... + * include/grub/util/hostdisk.h: ... here. Update all users. + * util/biosdisk.c: Move to ... + * util/hostdisk.c: ... here. Update all users. + 2008-09-07 Robert Millan * loader/i386/pc/multiboot.c (mmap_addr, mmap_length): Remove diff --git a/conf/common.mk b/conf/common.mk index d432b0597..444bd8350 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -29,7 +29,7 @@ util/elf/grub-mkimage.c_DEPENDENCIES = Makefile sbin_UTILITIES += grub-probe util/grub-probe.c_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ + util/hostdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c \ kern/parser.c kern/partition.c kern/file.c \ \ @@ -41,19 +41,19 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ disk/lvm.c disk/raid.c disk/mdraid_linux.c grub_probe_init.c -CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_biosdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-grub_probe_init.d +CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_biosdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-util_grub_probe.d -grub_probe-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) +grub_probe-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_biosdisk.d +-include grub_probe-util_hostdisk.d grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< diff --git a/conf/common.rmk b/conf/common.rmk index d1c401aec..109fb7a10 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -10,7 +10,7 @@ util/elf/grub-mkimage.c_DEPENDENCIES = Makefile sbin_UTILITIES += grub-probe util/grub-probe.c_DEPENDENCIES = grub_probe_init.h grub_probe_SOURCES = util/grub-probe.c \ - util/biosdisk.c util/misc.c util/getroot.c \ + util/hostdisk.c util/misc.c util/getroot.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c \ kern/parser.c kern/partition.c kern/file.c \ \ diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 4ffbfb4f7..b38de8ea5 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -219,17 +219,17 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -527,9 +527,9 @@ grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_misc.d -grub_emu-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) +grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_biosdisk.d +-include grub_emu-util_hostdisk.d grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index ac3091277..788442e25 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -82,7 +82,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 286ec54f5..b680767c7 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -39,7 +39,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. -#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ # fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ @@ -96,7 +96,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 3259f0ff3..67daa6a95 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -20,7 +20,7 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. -#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ # fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ @@ -59,7 +59,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index e24915c73..5d0fbd948 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -217,17 +217,17 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -533,9 +533,9 @@ grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_misc.d -grub_emu-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) +grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_biosdisk.d +-include grub_emu-util_hostdisk.d grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 79cfd47eb..78a5d915b 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -80,7 +80,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 71d273e68..8d7683528 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -314,7 +314,7 @@ util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h -grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ util/misc.c util/getroot.c kern/device.c kern/disk.c \ kern/err.c kern/misc.c kern/parser.c kern/partition.c \ kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ @@ -329,19 +329,19 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c \ util/raid.c util/lvm.c \ grub_setup_init.c -CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_biosdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_mdraid_linux.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d +CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_hostdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_mdraid_linux.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_biosdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) +grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o + $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(util/i386/pc/grub-setup.c_DEPENDENCIES) $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-util_i386_pc_grub_setup.d -grub_setup-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) +grub_setup-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-util_biosdisk.d +-include grub_setup-util_hostdisk.d grub_setup-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< @@ -543,17 +543,17 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/ufs.c fs/xfs.c fs/afs.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -859,9 +859,9 @@ grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_misc.d -grub_emu-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) +grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_biosdisk.d +-include grub_emu-util_hostdisk.d grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 1c2447a2c..e1aa60c39 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -91,7 +91,7 @@ util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h -grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ util/misc.c util/getroot.c kern/device.c kern/disk.c \ kern/err.c kern/misc.c kern/parser.c kern/partition.c \ kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ @@ -140,7 +140,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/ufs.c fs/xfs.c fs/afs.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 10e3a97fc..aec892168 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -83,17 +83,17 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/powerpc/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_biosdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_biosdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -379,9 +379,9 @@ grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_misc.d -grub_emu-util_biosdisk.o: util/biosdisk.c $(util/biosdisk.c_DEPENDENCIES) +grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_biosdisk.d +-include grub_emu-util_hostdisk.d grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b75e90309..c06e55da4 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -64,7 +64,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/powerpc/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index cbdd52a13..03cefc7fc 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -63,7 +63,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ -# util/biosdisk.c util/getroot.c \ +# util/hostdisk.c util/getroot.c \ # util/sparc64/ieee1275/misc.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 4571bbdc9..f658ac249 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -62,7 +62,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ -# util/biosdisk.c util/getroot.c \ +# util/hostdisk.c util/getroot.c \ # util/sparc64/ieee1275/misc.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index d0e0811fc..4ed75906b 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -41,7 +41,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) # For grub-setup. -#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ # fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ @@ -80,7 +80,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 6d13981bf..29a695e35 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -22,7 +22,7 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ util/resolve.c # For grub-setup. -#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/biosdisk.c \ +#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ # fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/biosdisk.c util/getroot.c \ + util/hostdisk.c util/getroot.c \ util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ diff --git a/include/grub/util/biosdisk.h b/include/grub/util/hostdisk.h similarity index 100% rename from include/grub/util/biosdisk.h rename to include/grub/util/hostdisk.h diff --git a/util/getroot.c b/util/getroot.c index 07d4580a3..ae2a07556 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -31,7 +31,7 @@ #endif #include -#include +#include #include static void diff --git a/util/grub-emu.c b/util/grub-emu.c index 5431a92c8..4569d9ed9 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -27,7 +27,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/util/grub-probe.c b/util/grub-probe.c index 301082317..4681cf72d 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/util/biosdisk.c b/util/hostdisk.c similarity index 100% rename from util/biosdisk.c rename to util/hostdisk.c diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 94826855c..39fd825f5 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include #include From 40da438f10281714b8357eeff31c607e2da97493 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 8 Sep 2008 14:00:29 +0000 Subject: [PATCH 0402/1707] 2008-09-08 Robert Millan * util/hostdisk.c (open_device): Replace a grub_util_info() call with grub_dprintf("hostdisk", ...), as it was so verbose that it clobbered useful information. --- ChangeLog | 6 ++++++ util/hostdisk.c | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 43a35afe5..e78d3eeaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-08 Robert Millan + + * util/hostdisk.c (open_device): Replace a grub_util_info() call + with grub_dprintf("hostdisk", ...), as it was so verbose that it + clobbered useful information. + 2008-09-08 Robert Millan * include/grub/util/biosdisk.h: Move to ... diff --git a/util/hostdisk.c b/util/hostdisk.c index 5465cb058..5f6c52f0f 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -24,6 +24,7 @@ #include #include #include +#include #include #include @@ -312,7 +313,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) is_partition = linux_find_partition (dev, disk->partition->start); /* Open the partition. */ - grub_util_info ("opening the device `%s' in open_device()", dev); + grub_dprintf ("hostdisk", "opening the device `%s' in open_device()", dev); fd = open (dev, flags); if (fd < 0) { From 89d5ffcfd1cd2fe89e5ded67998e6a52cc7973e1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 8 Sep 2008 19:10:16 +0000 Subject: [PATCH 0403/1707] 2008-09-08 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Skip segments when their filesz is zero (grub_file_read() interprets zero-size as "read untill EOF", which results in memory corruption). Use `lowest_segment' rather than 0 for calculating the current segment load address. --- ChangeLog | 8 ++++++++ loader/i386/pc/multiboot.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e78d3eeaf..3342a8751 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-09-08 Robert Millan + + * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Skip + segments when their filesz is zero (grub_file_read() interprets + zero-size as "read untill EOF", which results in memory corruption). + Use `lowest_segment' rather than 0 for calculating the current + segment load address. + 2008-09-08 Robert Millan * util/hostdisk.c (open_device): Replace a grub_util_info() call diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index 725fac887..c0d1fe1ca 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -158,7 +158,7 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) #define phdr(i) ((Elf32_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) for (i = 0; i < ehdr->e_phnum; i++) - if (phdr(i)->p_type == PT_LOAD) + if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) { if (phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr) lowest_segment = i; @@ -177,9 +177,9 @@ grub_multiboot_load_elf32 (grub_file_t file, void *buffer) /* Load every loadable segment in memory. */ for (i = 0; i < ehdr->e_phnum; i++) { - if (phdr(i)->p_type == PT_LOAD) + if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) { - char *load_this_module_at = (char *) (grub_multiboot_payload_orig + (phdr(i)->p_paddr - phdr(0)->p_paddr)); + char *load_this_module_at = (char *) (grub_multiboot_payload_orig + (phdr(i)->p_paddr - phdr(lowest_segment)->p_paddr)); grub_dprintf ("multiboot_loader", "segment %d: paddr=%p, memsz=0x%x\n", i, (void *) phdr(i)->p_paddr, phdr(i)->p_memsz); From 7fd75377be74fc92e36139ddbd29651dad691dc2 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 9 Sep 2008 07:28:17 +0000 Subject: [PATCH 0404/1707] 2008-09-09 Felix Zielcke * util/hostdisk.c: Change #include to #include . --- ChangeLog | 5 +++++ util/hostdisk.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3342a8751..eeca20a6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-09 Felix Zielcke + + * util/hostdisk.c: Change #include to + #include . + 2008-09-08 Robert Millan * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Skip diff --git a/util/hostdisk.c b/util/hostdisk.c index 5f6c52f0f..67a1233af 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -23,7 +23,7 @@ #include #include #include -#include +#include #include #include From 040030b3f2ac000b656884362a63b4d2e75b63d3 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 9 Sep 2008 13:58:21 +0000 Subject: [PATCH 0405/1707] 008-09-09 Felix Zielcke * Makefile.in (RMKFILES): Add `i386.rmk' and `x86_64-efi.rmk'. Sort the list. --- ChangeLog | 7 ++++++- Makefile.in | 6 ++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index eeca20a6a..8155c7584 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,11 @@ 2008-09-09 Felix Zielcke - * util/hostdisk.c: Change #include to + * Makefile.in (RMKFILES): Add `i386.rmk' and `x86_64-efi.rmk'. + Sort the list. + +2008-09-09 Felix Zielcke + + * util/hostdisk.c: Replace #include with #include . 2008-09-08 Robert Millan diff --git a/Makefile.in b/Makefile.in index 613797442..57a1f0a3f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -98,8 +98,10 @@ enable_lzo = @enable_lzo@ ### General variables. -RMKFILES = $(addprefix conf/,common.rmk i386-pc.rmk powerpc-ieee1275.rmk \ - sparc64-ieee1275.rmk i386-efi.rmk i386-ieee1275.rmk i386-coreboot.rmk) +RMKFILES = $(addprefix conf/,common.rmk i386-coreboot.rmk i386-efi.rmk \ + i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \ + sparc64-ieee1275.rmk x86_64-efi.rmk) + MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ From 9035dce47f871b90429147fb921e0d9ad0df525e Mon Sep 17 00:00:00 2001 From: chrfranke Date: Fri, 19 Sep 2008 06:55:20 +0000 Subject: [PATCH 0406/1707] 2008-09-19 Christian Franke * aclocal.m4 (grub_CHECK_ENABLE_EXECUTE_STACK): New function. * configure.ac: Call grub_CHECK_ENABLE_EXECUTE_STACK. * include/grub/misc.h [NEED_ENABLE_EXECUTE_STACK]: Export __enable_execute_stack() to modules. * kern/misc.c [NEED_ENABLE_EXECUTE_STACK] (__enable_execute_stack): New function. --- ChangeLog | 9 +++++++++ aclocal.m4 | 27 +++++++++++++++++++++++++++ config.h.in | 3 +++ configure | 41 +++++++++++++++++++++++++++++++++++++++++ configure.ac | 3 +++ include/grub/misc.h | 4 ++++ kern/misc.c | 9 +++++++++ 7 files changed, 96 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8155c7584..f2da11503 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-09-19 Christian Franke + + * aclocal.m4 (grub_CHECK_ENABLE_EXECUTE_STACK): New function. + * configure.ac: Call grub_CHECK_ENABLE_EXECUTE_STACK. + * include/grub/misc.h [NEED_ENABLE_EXECUTE_STACK]: + Export __enable_execute_stack() to modules. + * kern/misc.c [NEED_ENABLE_EXECUTE_STACK] (__enable_execute_stack): + New function. + 2008-09-09 Felix Zielcke * Makefile.in (RMKFILES): Add `i386.rmk' and `x86_64-efi.rmk'. diff --git a/aclocal.m4 b/aclocal.m4 index ee6c4db13..7be8d3b2f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -379,6 +379,33 @@ dnl So use regparm 2 until a better test is found. [Catch gcc bug]) fi ]) + +dnl Check if the C compiler generates calls to `__enable_execute_stack()'. +AC_DEFUN(grub_CHECK_ENABLE_EXECUTE_STACK,[ +AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()']) +AC_LANG_CONFTEST([[ +void f (int (*p) (void)); +void g (int i) +{ + int nestedfunc (void) { return i; } + f (nestedfunc); +} +]]) +if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -S conftest.c]) && test -s conftest.s; then + true +else + AC_MSG_ERROR([${CC-cc} failed to produce assembly code]) +fi +if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then + AC_DEFINE([NEED_ENABLE_EXECUTE_STACK], 1, + [Define to 1 if GCC generates calls to __enable_execute_stack()]) + AC_MSG_RESULT([yes]) +else + AC_MSG_RESULT([no]) +fi +rm -f conftest* +]) + dnl Check if the C compiler supports `-fstack-protector'. AC_DEFUN(grub_CHECK_STACK_PROTECTOR,[ diff --git a/config.h.in b/config.h.in index 044e81ee9..dbd87d992 100644 --- a/config.h.in +++ b/config.h.in @@ -79,6 +79,9 @@ /* Define to 1 if you enable memory manager debugging. */ #undef MM_DEBUG +/* Define to 1 if GCC generates calls to __enable_execute_stack() */ +#undef NEED_ENABLE_EXECUTE_STACK + /* Catch gcc bug */ #undef NESTED_FUNC_ATTR diff --git a/configure b/configure index 818204d8e..6af424a27 100644 --- a/configure +++ b/configure @@ -6775,6 +6775,47 @@ fi # Compiler features. # +# Need __enable_execute_stack() for nested function trampolines? + +{ echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 +echo $ECHO_N "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF + +void f (int (*p) (void)); +void g (int i) +{ + int nestedfunc (void) { return i; } + f (nestedfunc); +} + +_ACEOF +if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && test -s conftest.s; then + true +else + { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { (exit 1); exit 1; }; } +fi +if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then + +cat >>confdefs.h <<\_ACEOF +#define NEED_ENABLE_EXECUTE_STACK 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -f conftest* + + # Smashing stack protector. # Smashing stack protector. diff --git a/configure.ac b/configure.ac index c36745413..2b0d1467f 100644 --- a/configure.ac +++ b/configure.ac @@ -305,6 +305,9 @@ fi # Compiler features. # +# Need __enable_execute_stack() for nested function trampolines? +grub_CHECK_ENABLE_EXECUTE_STACK + # Smashing stack protector. grub_CHECK_STACK_PROTECTOR # Need that, because some distributions ship compilers that include diff --git a/include/grub/misc.h b/include/grub/misc.h index 3d89a6080..15c18f534 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -82,6 +82,10 @@ grub_ssize_t EXPORT_FUNC(grub_utf8_to_ucs4) (grub_uint32_t *dest, grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r); +#ifdef NEED_ENABLE_EXECUTE_STACK +void EXPORT_FUNC(__enable_execute_stack) (void *addr); +#endif + /* Inline functions. */ static inline unsigned int diff --git a/kern/misc.c b/kern/misc.c index bec6ebd33..635eb7227 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -1036,3 +1036,12 @@ grub_abort (void) } /* GCC emits references to abort(). */ void abort (void) __attribute__ ((alias ("grub_abort"))); + +#ifdef NEED_ENABLE_EXECUTE_STACK +/* Some gcc versions generate a call to this function + in trampolines for nested functions. */ +__enable_execute_stack (void *addr __attribute__ ((unused))) +{ +} +#endif + From 5dc434106eaf6acdc87980c06726f93e76e7b09a Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 21 Sep 2008 16:39:28 +0000 Subject: [PATCH 0407/1707] 2008-09-21 Felix Zielcke * autogen.sh: Add a call to `gendistlist.sh'. --- ChangeLog | 4 ++++ autogen.sh | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index f2da11503..b98bcc705 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-09-21 Felix Zielcke + + * autogen.sh: Add a call to `gendistlist.sh'. + 2008-09-19 Christian Franke * aclocal.m4 (grub_CHECK_ENABLE_EXECUTE_STACK): New function. diff --git a/autogen.sh b/autogen.sh index 850bcbc17..6895de221 100644 --- a/autogen.sh +++ b/autogen.sh @@ -8,5 +8,6 @@ echo timestamp > stamp-h.in for rmk in conf/*.rmk; do ruby genmk.rb < $rmk > `echo $rmk | sed 's/\.rmk$/.mk/'` done +./gendistlist.sh > DISTLIST exit 0 From f5e8f6b083b7b7810065a89fc60b188729f05d5c Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 21 Sep 2008 16:41:55 +0000 Subject: [PATCH 0408/1707] Update DISTLIST --- DISTLIST | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/DISTLIST b/DISTLIST index acf375a6d..80fc98b98 100644 --- a/DISTLIST +++ b/DISTLIST @@ -71,9 +71,11 @@ conf/i386-efi.mk conf/i386-efi.rmk conf/i386-ieee1275.mk conf/i386-ieee1275.rmk +conf/i386.mk conf/i386-pc-cygwin-img-ld.sc conf/i386-pc.mk conf/i386-pc.rmk +conf/i386.rmk conf/powerpc-ieee1275.mk conf/powerpc-ieee1275.rmk conf/sparc64-ieee1275.mk @@ -81,12 +83,17 @@ conf/sparc64-ieee1275.rmk conf/x86_64-efi.mk conf/x86_64-efi.rmk disk/ata.c +disk/dmraid_nvidia.c disk/fs_uuid.c disk/host.c disk/loopback.c disk/lvm.c +disk/mdraid_linux.c disk/memdisk.c +disk/raid5_recover.c +disk/raid6_recover.c disk/raid.c +disk/scsi.c disk/efi/efidisk.c disk/i386/pc/biosdisk.c disk/ieee1275/nand.c @@ -158,6 +165,8 @@ include/grub/pc_partition.h include/grub/raid.h include/grub/rescue.h include/grub/script.h +include/grub/scsicmd.h +include/grub/scsi.h include/grub/setjmp.h include/grub/symbol.h include/grub/term.h @@ -261,8 +270,8 @@ include/grub/sparc64/ieee1275/ieee1275.h include/grub/sparc64/ieee1275/kernel.h include/grub/sparc64/ieee1275/machine.h include/grub/sparc64/ieee1275/time.h -include/grub/util/biosdisk.h include/grub/util/getroot.h +include/grub/util/hostdisk.h include/grub/util/lvm.h include/grub/util/misc.h include/grub/util/raid.h @@ -400,7 +409,6 @@ term/i386/pc/vesafb.c term/i386/pc/vga.c term/i386/pc/vga_text.c term/ieee1275/ofconsole.c -util/biosdisk.c util/console.c util/getroot.c util/grub-editenv.c @@ -409,6 +417,7 @@ util/grub-fstest.c util/grub-mkdevicemap.c util/grub-pe2elf.c util/grub-probe.c +util/hostdisk.c util/hostfs.c util/lvm.c util/misc.c From eb73121d0d5d221f08b87d60a6cfba81931996c3 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 21 Sep 2008 17:38:33 +0000 Subject: [PATCH 0409/1707] 008-09-21 Felix Zielcke * configure.ac (AC_INIT): Quote version number. (AC_PREREQ): Bumped to 2.59. (AC_TRY_COMPILE): Replace obsolete macro with ... (AC_COMPILE_IFELSE): ... this. * aclocal.m4 (AC_TRY_LINK): Replace obsolete macro with ... (AC_LINK_IFELSE): ... this. --- ChangeLog | 9 ++++++++ aclocal.m4 | 61 +++++++++++++++++++++++++++++----------------------- configure.ac | 12 +++++++---- 3 files changed, 51 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index b98bcc705..734616b69 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +008-09-21 Felix Zielcke + + * configure.ac (AC_INIT): Quote `GRUB' string and version number. + (AC_PREREQ): Bumped to 2.59. + (AC_TRY_COMPILE): Replace obsolete macro with ... + (AC_COMPILE_IFELSE): ... this. + * aclocal.m4 (AC_TRY_LINK): Replace obsolete macro with ... + (AC_LINK_IFELSE): ... this. + 2008-09-21 Felix Zielcke * autogen.sh: Add a call to `gendistlist.sh'. diff --git a/aclocal.m4 b/aclocal.m4 index 7be8d3b2f..1dd5ffb3f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2,9 +2,9 @@ dnl Check whether target compiler is working AC_DEFUN(grub_PROG_TARGET_CC, [AC_MSG_CHECKING([whether target compiler is working]) AC_CACHE_VAL(grub_cv_prog_target_cc, -[AC_TRY_LINK([], [], - grub_cv_prog_target_cc=yes, - grub_cv_prog_target_cc=no) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_prog_target_cc=yes], + [grub_cv_prog_target_cc=no]) ]) AC_MSG_RESULT([$grub_cv_prog_target_cc]) @@ -104,9 +104,9 @@ AC_DEFUN(grub_PROG_LD_BUILD_ID_NONE, AC_CACHE_VAL(grub_cv_prog_ld_build_id_none, [save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" -AC_TRY_LINK([], [], - grub_cv_prog_ld_build_id_none=yes, - grub_cv_prog_ld_build_id_none=no) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_prog_ld_build_id_none=yes], + [grub_cv_prog_ld_build_id_none=no]) LDFLAGS="$save_LDFLAGS" ]) AC_MSG_RESULT([$grub_cv_prog_ld_build_id_none]) @@ -230,17 +230,19 @@ AC_DEFUN(grub_CHECK_START_SYMBOL, [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([if start is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_start_symbol, -[AC_TRY_LINK([], [asm ("incl start")], - grub_cv_check_start_symbol=yes, - grub_cv_check_start_symbol=no)]) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[asm ("incl start")]])], + [grub_cv_check_start_symbol=yes], + [grub_cv_check_start_symbol=no])]) AC_MSG_RESULT([$grub_cv_check_start_symbol]) AC_MSG_CHECKING([if _start is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_uscore_start_symbol, -[AC_TRY_LINK([], [asm ("incl _start")], - grub_cv_check_uscore_start_symbol=yes, - grub_cv_check_uscore_start_symbol=no)]) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[asm ("incl _start")]])], + [grub_cv_check_uscore_start_symbol=yes], + [grub_cv_check_uscore_start_symbol=no])]) AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol]) @@ -261,25 +263,28 @@ AC_DEFUN(grub_CHECK_BSS_START_SYMBOL, [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([if __bss_start is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_uscore_uscore_bss_start_symbol, -[AC_TRY_LINK([], [asm ("incl __bss_start")], - grub_cv_check_uscore_uscore_bss_start_symbol=yes, - grub_cv_check_uscore_uscore_bss_start_symbol=no)]) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[asm ("incl __bss_start")]])], + [grub_cv_check_uscore_uscore_bss_start_symbol=yes], + [grub_cv_check_uscore_uscore_bss_start_symbol=no])]) AC_MSG_RESULT([$grub_cv_check_uscore_uscore_bss_start_symbol]) AC_MSG_CHECKING([if edata is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_edata_symbol, -[AC_TRY_LINK([], [asm ("incl edata")], - grub_cv_check_edata_symbol=yes, - grub_cv_check_edata_symbol=no)]) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[asm ("incl edata")]])], + [grub_cv_check_edata_symbol=yes], + [grub_cv_check_edata_symbol=no])]) AC_MSG_RESULT([$grub_cv_check_edata_symbol]) AC_MSG_CHECKING([if _edata is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_uscore_edata_symbol, -[AC_TRY_LINK([], [asm ("incl _edata")], - grub_cv_check_uscore_edata_symbol=yes, - grub_cv_check_uscore_edata_symbol=no)]) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[asm ("incl _edata")]])], + [grub_cv_check_uscore_edata_symbol=yes], + [grub_cv_check_uscore_edata_symbol=no])]) AC_MSG_RESULT([$grub_cv_check_uscore_edata_symbol]) @@ -302,17 +307,19 @@ AC_DEFUN(grub_CHECK_END_SYMBOL, [AC_REQUIRE([AC_PROG_CC]) AC_MSG_CHECKING([if end is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_end_symbol, -[AC_TRY_LINK([], [asm ("incl end")], - grub_cv_check_end_symbol=yes, - grub_cv_check_end_symbol=no)]) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[asm ("incl end")]])], + [grub_cv_check_end_symbol=yes], + [grub_cv_check_end_symbol=no])]) AC_MSG_RESULT([$grub_cv_check_end_symbol]) AC_MSG_CHECKING([if _end is defined by the compiler]) AC_CACHE_VAL(grub_cv_check_uscore_end_symbol, -[AC_TRY_LINK([], [asm ("incl _end")], - grub_cv_check_uscore_end_symbol=yes, - grub_cv_check_uscore_end_symbol=no)]) +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], + [[asm ("incl _end")]])], + [grub_cv_check_uscore_end_symbol=yes], + [grub_cv_check_uscore_end_symbol=no])]) AC_MSG_RESULT([$grub_cv_check_uscore_end_symbol]) diff --git a/configure.ac b/configure.ac index 2b0d1467f..dab8002a7 100644 --- a/configure.ac +++ b/configure.ac @@ -31,8 +31,8 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT(GRUB, 1.96, [bug-grub@gnu.org]) -AC_PREREQ(2.53) +AC_INIT([GRUB],[1.96],[bug-grub@gnu.org]) +AC_PREREQ(2.61) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) @@ -266,7 +266,9 @@ if test "x$TARGET_CFLAGS" = x; then # optimization flags. AC_CACHE_CHECK([whether optimization for size works], grub_cv_cc_Os, [ CFLAGS=-Os - AC_TRY_COMPILE(, , grub_cv_cc_Os=yes, grub_cv_cc_Os=no) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_Os=yes], + [grub_cv_cc_Os=no]) ]) if test "x$grub_cv_cc_Os" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" @@ -278,7 +280,9 @@ if test "x$TARGET_CFLAGS" = x; then if test "x$target_cpu" = xi386; then AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ CFLAGS="-falign-loops=1" - AC_TRY_COMPILE(, , [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no]) + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_falign_loop=yes], + [grub_cv_cc_falign_loop=no]) ]) if test "x$grub_cv_cc_falign_loop" = xyes; then From 46e04eb9adc334229ddd6be96231ee19d21b0e9f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 21 Sep 2008 17:40:13 +0000 Subject: [PATCH 0410/1707] urm configure.ac/PREREQ should be 2.59 not 2.61 --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index dab8002a7..4aaf200ce 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ dnl type. AC_INIT([GRUB],[1.96],[bug-grub@gnu.org]) -AC_PREREQ(2.61) +AC_PREREQ(2.59) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) From c40fd116ea7d8de4903e9cdeaa1279a0015c6342 Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 22 Sep 2008 03:49:26 +0000 Subject: [PATCH 0411/1707] 2008-09-22 Bean * disk/ata.c (grub_apapi_open): Initialize devfnd, no need to set scsi->name and scsi->luns, as they will be set in grub_scsi_open. * disk/scsi.c (grub_scsi_open): Don't call p->close (scsi) here when error occurs, as grub_disk_open will call grub_disk_close, which will call p->close (scsi). --- ChangeLog | 9 +++++++++ disk/ata.c | 4 +--- disk/scsi.c | 4 ---- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 734616b69..b4a0f7674 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-09-22 Bean + + * disk/ata.c (grub_apapi_open): Initialize devfnd, no need to set + scsi->name and scsi->luns, as they will be set in grub_scsi_open. + + * disk/scsi.c (grub_scsi_open): Don't call p->close (scsi) here when + error occurs, as grub_disk_open will call grub_disk_close, which will + call p->close (scsi). + 008-09-21 Felix Zielcke * configure.ac (AC_INIT): Quote `GRUB' string and version number. diff --git a/disk/ata.c b/disk/ata.c index ab4a1da24..214a2cac7 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -891,7 +891,7 @@ static grub_err_t grub_atapi_open (const char *name, struct grub_scsi *scsi) { struct grub_ata_device *dev; - struct grub_ata_device *devfnd; + struct grub_ata_device *devfnd = 0; for (dev = grub_ata_devices; dev; dev = dev->next) { @@ -911,8 +911,6 @@ grub_atapi_open (const char *name, struct grub_scsi *scsi) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "No such ATAPI device"); scsi->data = devfnd; - scsi->name = grub_strdup (name); - scsi->luns = 1; return GRUB_ERR_NONE; } diff --git a/disk/scsi.c b/disk/scsi.c index aad59b5a3..b7b6834e7 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -255,7 +255,6 @@ grub_scsi_open (const char *name, grub_disk_t disk) scsi->name = grub_strdup (name); if (! scsi->name) { - p->close (scsi); return grub_errno; } @@ -265,7 +264,6 @@ grub_scsi_open (const char *name, grub_disk_t disk) if (err) { grub_dprintf ("scsi", "inquiry failed\n"); - p->close (scsi); return grub_errno; } @@ -277,7 +275,6 @@ grub_scsi_open (const char *name, grub_disk_t disk) if (scsi->devtype != grub_scsi_devtype_direct && scsi->devtype != grub_scsi_devtype_cdrom) { - p->close (scsi); return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown SCSI device"); } @@ -291,7 +288,6 @@ grub_scsi_open (const char *name, grub_disk_t disk) if (err) { grub_dprintf ("scsi", "READ CAPACITY failed\n"); - p->close (scsi); return grub_errno; } From a91b6c7c8f25485e1bed088f485f92f9913151c9 Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 22 Sep 2008 04:18:57 +0000 Subject: [PATCH 0412/1707] 2008-09-22 Bean * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a rare case where $BITMAP is resident and in attribute list. * include/grub/ntfs.h (BMP_LEN): Removed. --- ChangeLog | 7 +++++++ fs/ntfs.c | 49 +++++++++++++++++++++------------------------ include/grub/ntfs.h | 2 -- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4a0f7674..ed44de64c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-22 Bean + + * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a rare case where $BITMAP is + resident and in attribute list. + + * include/grub/ntfs.h (BMP_LEN): Removed. + 2008-09-22 Bean * disk/ata.c (grub_apapi_open): Initialize devfnd, no need to set diff --git a/fs/ntfs.c b/fs/ntfs.c index a590ade1e..e0e50f164 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -697,35 +697,32 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, (u32at (cur_pos, ofs) == 0x490024) && (u32at (cur_pos, ofs + 4) == 0x300033)) { - if ((at->flags & AF_ALST) && (cur_pos[8] == 0)) - { - grub_error (GRUB_ERR_BAD_FS, - "$BITMAP should be non-resident when in attribute list"); - goto done; - } - if (cur_pos[8] == 0) - { - bitmap = (unsigned char *) (cur_pos + u16at (cur_pos, 0x14)); - bitmap_len = u32at (cur_pos, 0x10); - break; - } - if (u32at (cur_pos, 0x28) > BMP_LEN) - { - grub_error (GRUB_ERR_BAD_FS, "Non-resident $BITMAP too large"); - goto done; - } - bmp = grub_malloc (u32at (cur_pos, 0x28)); - if (bmp == NULL) - goto done; + int is_resident = (cur_pos[8] == 0); - bitmap = (unsigned char *) bmp; - bitmap_len = u32at (cur_pos, 0x30); - if (read_data (at, cur_pos, bmp, 0, u32at (cur_pos, 0x28), 0, 0)) + bitmap_len = ((is_resident) ? u32at (cur_pos, 0x10) : + (cur_pos, 0x28)); + + bmp = grub_malloc (bitmap_len); + if (bmp == NULL) + goto done; + + if (is_resident) { - grub_error (GRUB_ERR_BAD_FS, - "Fails to read non-resident $BITMAP"); - goto done; + grub_memcpy (bmp, (char *) (cur_pos + u16at (cur_pos, 0x14)), + bitmap_len); } + else + { + if (read_data (at, cur_pos, bmp, 0, bitmap_len, 0, 0)) + { + grub_error (GRUB_ERR_BAD_FS, + "Fails to read non-resident $BITMAP"); + goto done; + } + bitmap_len = u32at (cur_pos, 0x30); + } + + bitmap = (unsigned char *) bmp; break; } } diff --git a/include/grub/ntfs.h b/include/grub/ntfs.h index bdd1a9ece..9b2ae0a0c 100644 --- a/include/grub/ntfs.h +++ b/include/grub/ntfs.h @@ -75,8 +75,6 @@ #define COM_LEN 4096 #define COM_SEC (COM_LEN >> BLK_SHR) -#define BMP_LEN 4096 - #define AF_ALST 1 #define AF_MMFT 2 #define AF_GPOS 4 From 397093d331cfe65beb07a9b81f7398be0cef755d Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 24 Sep 2008 10:17:56 +0000 Subject: [PATCH 0413/1707] 2008-09-24 Robert Millan * include/grub/powerpc/ieee1275/console.h (GRUB_CONSOLE_KEY_*): Remove macros (they were i386-pc specific). * include/grub/sparc64/ieee1275/console.h: Likewise. * include/grub/efi/console.h: Likewise. --- ChangeLog | 7 +++++++ include/grub/efi/console.h | 13 ------------- include/grub/powerpc/ieee1275/console.h | 13 ------------- include/grub/sparc64/ieee1275/console.h | 14 -------------- 4 files changed, 7 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed44de64c..75fcee0f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-09-24 Robert Millan + + * include/grub/powerpc/ieee1275/console.h (GRUB_CONSOLE_KEY_*): Remove + macros (they were i386-pc specific). + * include/grub/sparc64/ieee1275/console.h: Likewise. + * include/grub/efi/console.h: Likewise. + 2008-09-22 Bean * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a rare case where $BITMAP is diff --git a/include/grub/efi/console.h b/include/grub/efi/console.h index 2d3742a39..f90b5b78c 100644 --- a/include/grub/efi/console.h +++ b/include/grub/efi/console.h @@ -19,19 +19,6 @@ #ifndef GRUB_EFI_CONSOLE_HEADER #define GRUB_EFI_CONSOLE_HEADER 1 -/* Define scan codes. */ -#define GRUB_CONSOLE_KEY_LEFT 0x4B00 -#define GRUB_CONSOLE_KEY_RIGHT 0x4D00 -#define GRUB_CONSOLE_KEY_UP 0x4800 -#define GRUB_CONSOLE_KEY_DOWN 0x5000 -#define GRUB_CONSOLE_KEY_IC 0x5200 -#define GRUB_CONSOLE_KEY_DC 0x5300 -#define GRUB_CONSOLE_KEY_BACKSPACE 0x0008 -#define GRUB_CONSOLE_KEY_HOME 0x4700 -#define GRUB_CONSOLE_KEY_END 0x4F00 -#define GRUB_CONSOLE_KEY_NPAGE 0x4900 -#define GRUB_CONSOLE_KEY_PPAGE 0x5100 - #include #include diff --git a/include/grub/powerpc/ieee1275/console.h b/include/grub/powerpc/ieee1275/console.h index acd65f7f7..ed2b7202a 100644 --- a/include/grub/powerpc/ieee1275/console.h +++ b/include/grub/powerpc/ieee1275/console.h @@ -19,19 +19,6 @@ #ifndef GRUB_CONSOLE_MACHINE_HEADER #define GRUB_CONSOLE_MACHINE_HEADER 1 -/* Define scan codes. */ -#define GRUB_CONSOLE_KEY_LEFT 0x4B00 -#define GRUB_CONSOLE_KEY_RIGHT 0x4D00 -#define GRUB_CONSOLE_KEY_UP 0x4800 -#define GRUB_CONSOLE_KEY_DOWN 0x5000 -#define GRUB_CONSOLE_KEY_IC 0x5200 -#define GRUB_CONSOLE_KEY_DC 0x5300 -#define GRUB_CONSOLE_KEY_BACKSPACE 0x0008 -#define GRUB_CONSOLE_KEY_HOME 0x4700 -#define GRUB_CONSOLE_KEY_END 0x4F00 -#define GRUB_CONSOLE_KEY_NPAGE 0x4900 -#define GRUB_CONSOLE_KEY_PPAGE 0x5100 - /* Initialize the console system. */ void grub_console_init (void); diff --git a/include/grub/sparc64/ieee1275/console.h b/include/grub/sparc64/ieee1275/console.h index 63ca0e5ea..ed2b7202a 100644 --- a/include/grub/sparc64/ieee1275/console.h +++ b/include/grub/sparc64/ieee1275/console.h @@ -19,20 +19,6 @@ #ifndef GRUB_CONSOLE_MACHINE_HEADER #define GRUB_CONSOLE_MACHINE_HEADER 1 -/* Define scan codes. */ -/* FIXME (sparc64). */ -#define GRUB_CONSOLE_KEY_LEFT 0x4B00 -#define GRUB_CONSOLE_KEY_RIGHT 0x4D00 -#define GRUB_CONSOLE_KEY_UP 0x4800 -#define GRUB_CONSOLE_KEY_DOWN 0x5000 -#define GRUB_CONSOLE_KEY_IC 0x5200 -#define GRUB_CONSOLE_KEY_DC 0x5300 -#define GRUB_CONSOLE_KEY_BACKSPACE 0x0008 -#define GRUB_CONSOLE_KEY_HOME 0x4700 -#define GRUB_CONSOLE_KEY_END 0x4F00 -#define GRUB_CONSOLE_KEY_NPAGE 0x4900 -#define GRUB_CONSOLE_KEY_PPAGE 0x5100 - /* Initialize the console system. */ void grub_console_init (void); From 5a0042794deae30293a7f2ad5841ac49b19d4ca2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 24 Sep 2008 10:22:18 +0000 Subject: [PATCH 0414/1707] 2008-09-24 Carles Pina i Estany * include/grub/i386/pc/console.h (GRUB_TERM_NPAGE): Changed to 0x5100. (GRUB_TERM_PPAGE): Changed to 0x4900. --- ChangeLog | 6 ++++++ include/grub/i386/pc/console.h | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75fcee0f1..e0beb8798 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-24 Carles Pina i Estany + + * include/grub/i386/pc/console.h (GRUB_TERM_NPAGE): + Changed to 0x5100. + (GRUB_TERM_PPAGE): Changed to 0x4900. + 2008-09-24 Robert Millan * include/grub/powerpc/ieee1275/console.h (GRUB_CONSOLE_KEY_*): Remove diff --git a/include/grub/i386/pc/console.h b/include/grub/i386/pc/console.h index 2e09cde31..03ad42ba9 100644 --- a/include/grub/i386/pc/console.h +++ b/include/grub/i386/pc/console.h @@ -29,8 +29,8 @@ #define GRUB_CONSOLE_KEY_BACKSPACE 0x0008 #define GRUB_CONSOLE_KEY_HOME 0x4700 #define GRUB_CONSOLE_KEY_END 0x4F00 -#define GRUB_CONSOLE_KEY_NPAGE 0x4900 -#define GRUB_CONSOLE_KEY_PPAGE 0x5100 +#define GRUB_CONSOLE_KEY_NPAGE 0x5100 +#define GRUB_CONSOLE_KEY_PPAGE 0x4900 #ifndef ASM_FILE From b0c301f78ff12710f98435f0d3808b9b7106240e Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 24 Sep 2008 16:38:58 +0000 Subject: [PATCH 0415/1707] 2008-09-24 Carles Pina i Estany * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Fix `unused parameter' warning. * commands/i386/pc/pxecmd.c (dmraid_nvidia): Likewise. --- ChangeLog | 6 ++++++ commands/i386/pc/pxecmd.c | 3 ++- disk/dmraid_nvidia.c | 1 - 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e0beb8798..aca20b480 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-09-24 Carles Pina i Estany + + * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Fix `unused parameter' + warning. + * commands/i386/pc/pxecmd.c (dmraid_nvidia): Likewise. + 2008-09-24 Carles Pina i Estany * include/grub/i386/pc/console.h (GRUB_TERM_NPAGE): diff --git a/commands/i386/pc/pxecmd.c b/commands/i386/pc/pxecmd.c index bf4afa228..2a2aadcdd 100644 --- a/commands/i386/pc/pxecmd.c +++ b/commands/i386/pc/pxecmd.c @@ -46,7 +46,8 @@ print_ip (grub_uint32_t ip) } static grub_err_t -grub_cmd_pxe (struct grub_arg_list *state, int argc, char **args) +grub_cmd_pxe (struct grub_arg_list *state, int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) { if (! grub_pxe_pxenv) return grub_error (GRUB_ERR_FILE_NOT_FOUND, "no pxe environment"); diff --git a/disk/dmraid_nvidia.c b/disk/dmraid_nvidia.c index c2d5ed369..ee43bef54 100644 --- a/disk/dmraid_nvidia.c +++ b/disk/dmraid_nvidia.c @@ -93,7 +93,6 @@ grub_dmraid_nv_detect (grub_disk_t disk, struct grub_raid_array *array) { grub_disk_addr_t sector; struct grub_nv_super sb; - grub_uint32_t *uuid; if (disk->partition) return grub_error (GRUB_ERR_OUT_OF_RANGE, "skip partition"); From 81a06771bf1be8cd54c61bbe645508dd1ee5bc30 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 24 Sep 2008 21:01:11 +0000 Subject: [PATCH 0416/1707] Fix typos, dates and spacing --- ChangeLog | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index aca20b480..9b1000f3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2008-09-24 Carles Pina i Estany +2008-09-24 Carles Pina i Estany * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Fix `unused parameter' warning. @@ -26,14 +26,14 @@ 2008-09-22 Bean - * disk/ata.c (grub_apapi_open): Initialize devfnd, no need to set + * disk/ata.c (grub_atapi_open): Initialize devfnd, no need to set scsi->name and scsi->luns, as they will be set in grub_scsi_open. * disk/scsi.c (grub_scsi_open): Don't call p->close (scsi) here when error occurs, as grub_disk_open will call grub_disk_close, which will call p->close (scsi). -008-09-21 Felix Zielcke +2008-09-21 Felix Zielcke * configure.ac (AC_INIT): Quote `GRUB' string and version number. (AC_PREREQ): Bumped to 2.59. @@ -69,7 +69,7 @@ * loader/i386/pc/multiboot.c (grub_multiboot_load_elf32): Skip segments when their filesz is zero (grub_file_read() interprets - zero-size as "read untill EOF", which results in memory corruption). + zero-size as "read until EOF", which results in memory corruption). Use `lowest_segment' rather than 0 for calculating the current segment load address. @@ -129,7 +129,7 @@ (grub_video_i386_vbeblit_replace_BGR888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGBX8888_RGB888): Likewise. (grub_video_i386_vbeblit_replace_RGB888_RGBX8888): Likewise. - (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. + (grub_video_i386_vbeblit_replace_index_RGBX8888): Likewise. (grub_video_i386_vbeblit_replace_index_RGB888): Likewise. (grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_BGR888_RGBA8888): Likewise. @@ -145,17 +145,17 @@ (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. - * include/grub/video.h (grub_video_blit_format): Removed + * include/grub/video.h (grub_video_blit_format): Removed GRUB_VIDEO_BLIT_FORMAT_R8G8B8A8, GRUB_VIDEO_BLIT_FORMAT_R8G8B8. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_RGBA_8888, GRUB_VIDEO_BLIT_FORMAT_BGRA_8888, GRUB_VIDEO_BLIT_FORMAT_RGB_888, GRUB_VIDEO_BLIT_FORMAT_BGR_888, GRUB_VIDEO_BLIT_FORMAT_RGB_565, GRUB_VIDEO_BLIT_FORMAT_BGR_565. - + * video/video.c (grub_video_get_blit_format): Updated to use new blit formats. Added handling for 16 bit color modes. - - * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new + + * video/i386/pc/vbe.c (grub_video_vbe_fill_rect): Updated to use new fillers. (common_blitter): Updated to use new blitters. @@ -184,7 +184,7 @@ (grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_RGB888_RGBA8888): Likewise. (grub_video_i386_vbeblit_blend_index_RGBA8888): Likewise. - + * video/i386/pc/vbefill.c (grub_video_i386_vbefill_R8G8B8A8): Removed. (grub_video_i386_vbefill_R8G8B8): Likewise. (grub_video_i386_vbefill_index): Likewise. @@ -192,16 +192,16 @@ (grub_video_i386_vbefill_direct24): Likewise. (grub_video_i386_vbefill_direct16): Likewise. (grub_video_i386_vbefill_direct8): Likewise. - + * video/readers/jpeg.c (grub_jpeg_decode_sos): Adapt to new blitter types. - + * video/readers/tga.c (grub_video_reader_tga): Adapt to new blitter types. - + * video/readers/png.c (grub_png_decode_image_header): Adapt to new blitter types. - + * video/bitmap.c (grub_video_bitmap_create): Adapt to new blitter types. @@ -243,12 +243,12 @@ * disk/scsi.c (grub_scsi_open): Remove size limit when printing `disk->total_sectors'. -2008-09-01 Colin D Bennett +2008-09-01 Colin D Bennett * include/grub/normal.h: Fixed incorrect comment for GRUB_COMMAND_FLAG_NO_ARG_PARSE. -2008-09-01 Colin D Bennett +2008-09-01 Colin D Bennett * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Replaced constant values with defines. @@ -289,11 +289,11 @@ * loader/i386/pc/multiboot.c: Update comment not to say that a.out or memory map support are unimplemented. -2008-08-31 Colin D Bennett +2008-08-31 Colin D Bennett * util/i386/pc/grub-mkrescue.in: Support multiple overlay directories. -2008-08-31 Colin D Bennett +2008-08-31 Colin D Bennett * commands/i386/pc/vbeinfo.c (grub_cmd_vbeinfo): Show VBE version and total video memory in 'vbeinfo' output; show color format details for @@ -333,7 +333,7 @@ #if ! defined (__CYGWIN__) && ! defined (__MINGW32__). * include/grub/util/misc.h: #include and , - declear asprintf if HAVE_ASPRINTF is not set, declear fseeko, ftello, + declare asprintf if HAVE_ASPRINTF is not set, declare fseeko, ftello, sync, sleep and grub_util_get_disk_size for mingw. * util/biosdisk.c (grub_util_biosdisk_open): Use grub_util_get_disk_size @@ -510,7 +510,7 @@ a dot, not just directories. This avoids things like /dev/.tmp.md0. 2008-08-22 Felix Zielcke - + * util/update-grub.in (GRUB_GFXMODE): Export variable. * util/grub.d/00_header.in: Allow the administrator to change default gfxmode via ${GRUB_GFXMODE}. From d2a367b86f209524aa7708ee5d337f64e2abe1a3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 25 Sep 2008 14:15:24 +0000 Subject: [PATCH 0417/1707] 2008-09-25 Robert Millan * conf/i386-pc.rmk (grub_mkdevicemap_SOURCES): Remove `util/i386/get_disk_name.c'. * conf/i386-efi.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/powerpc-ieee1275.rmk (grub_mkdevicemap_SOURCES): Remove `util/ieee1275/get_disk_name.c'. * include/grub/util/misc.h (grub_util_get_disk_name): Remove. * util/ieee1275/get_disk_name.c: Remove file. * util/i386/get_disk_name.c: Remove file. * util/grub-mkdevicemap.c (make_device_map): Back to hardcoding "hd%d" for device.map entries, rather than using grub_util_get_disk_name(). --- ChangeLog | 17 ++++++++++ conf/i386-coreboot.rmk | 3 +- conf/i386-efi.rmk | 3 +- conf/i386-ieee1275.rmk | 3 +- conf/i386-pc.rmk | 3 +- conf/powerpc-ieee1275.rmk | 3 +- conf/x86_64-efi.rmk | 3 +- include/grub/util/misc.h | 1 - util/grub-mkdevicemap.c | 30 ++++------------- util/i386/get_disk_name.c | 31 ------------------ util/ieee1275/get_disk_name.c | 61 ----------------------------------- 11 files changed, 29 insertions(+), 129 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9b1000f3f..36b114245 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2008-09-25 Robert Millan + + * conf/i386-pc.rmk (grub_mkdevicemap_SOURCES): Remove + `util/i386/get_disk_name.c'. + * conf/i386-efi.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + * conf/powerpc-ieee1275.rmk (grub_mkdevicemap_SOURCES): Remove + `util/ieee1275/get_disk_name.c'. + * include/grub/util/misc.h (grub_util_get_disk_name): Remove. + * util/ieee1275/get_disk_name.c: Remove file. + * util/i386/get_disk_name.c: Remove file. + * util/grub-mkdevicemap.c (make_device_map): Back to hardcoding + "hd%d" for device.map entries, rather than using + grub_util_get_disk_name(). + 2008-09-24 Carles Pina i Estany * disk/dmraid_nvidia.c (grub_dmraid_nv_detect): Fix `unused parameter' diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 788442e25..78088fd3f 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -51,8 +51,7 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 67daa6a95..c13a3a789 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -28,8 +28,7 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 78a5d915b..2e27ca1da 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -48,8 +48,7 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index e1aa60c39..82cb12b40 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -108,8 +108,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ grub_setup_init.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index c06e55da4..9460ba46f 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -34,8 +34,7 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/ieee1275/get_disk_name.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 29a695e35..a1b94b664 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -30,8 +30,7 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h index 3f145e86a..52090b701 100644 --- a/include/grub/util/misc.h +++ b/include/grub/util/misc.h @@ -56,7 +56,6 @@ void grub_util_load_image (const char *path, char *buf); void grub_util_write_image (const char *img, size_t size, FILE *out); void grub_util_write_image_at (const void *img, size_t size, off_t offset, FILE *out); -char *grub_util_get_disk_name (int disk, char *name); #ifndef HAVE_ASPRINTF diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 38a90b7b3..cd9ea1940 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -450,11 +450,8 @@ make_device_map (const char *device_map, int floppy_disks) if (realpath (discn, name)) { - char *p; strcat (name, "/disc"); - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); } num_hd++; @@ -472,10 +469,7 @@ make_device_map (const char *device_map, int floppy_disks) get_ide_disk_name (name, i); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -505,10 +499,7 @@ make_device_map (const char *device_map, int floppy_disks) get_ataraid_disk_name (name, i); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -538,10 +529,7 @@ make_device_map (const char *device_map, int floppy_disks) get_scsi_disk_name (name, i); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -564,10 +552,7 @@ make_device_map (const char *device_map, int floppy_disks) get_dac960_disk_name (name, controller, drive); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -633,10 +618,7 @@ make_device_map (const char *device_map, int floppy_disks) get_i2o_disk_name (name, unit); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } diff --git a/util/i386/get_disk_name.c b/util/i386/get_disk_name.c index 38195e248..e69de29bb 100644 --- a/util/i386/get_disk_name.c +++ b/util/i386/get_disk_name.c @@ -1,31 +0,0 @@ -/* get_disk_name.c */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include - -char * -grub_util_get_disk_name (int disk, char *name __attribute__ ((unused))) -{ - char *p; - - p = xmalloc (16); - sprintf (p, "hd%d", disk); - - return p; -} diff --git a/util/ieee1275/get_disk_name.c b/util/ieee1275/get_disk_name.c index 30e965ab4..e69de29bb 100644 --- a/util/ieee1275/get_disk_name.c +++ b/util/ieee1275/get_disk_name.c @@ -1,61 +0,0 @@ -/* get_disk_name.c */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include - -char * -grub_util_get_disk_name (int disk __attribute__ ((unused)), char *name) -{ - int p[2]; - - char *line = NULL; - size_t zero = 0; - int len; - - pipe (p); - - switch (fork ()) - { - case -1: - perror ("fork"); - exit (1); - case 0: - close (1); - dup (p[1]); - close (p[0]); - close (p[1]); - execlp ("ofpathname", "ofpathname", "-a", name, NULL); - perror ("execlp"); - default: - close (0); - dup (p[0]); - close (p[0]); - close (p[1]); - } - - len = getline (&line, &zero, stdin); - if (len < 2) - grub_util_error ("ofpathname didn't print a meaningful alias name"); - - line[len - 1] = '\0'; - - return line; -} From 0e981d36bb9e9b6b4e3d2ab0a8c56a81eb912b04 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 25 Sep 2008 14:17:43 +0000 Subject: [PATCH 0418/1707] Forgot to remove files / run autogen.sh --- DISTLIST | 2 -- conf/i386-coreboot.mk | 15 +++++---------- conf/i386-efi.mk | 15 +++++---------- conf/i386-ieee1275.mk | 15 +++++---------- conf/i386-pc.mk | 15 +++++---------- conf/powerpc-ieee1275.mk | 15 +++++---------- conf/x86_64-efi.mk | 3 +-- util/i386/get_disk_name.c | 0 util/ieee1275/get_disk_name.c | 0 9 files changed, 26 insertions(+), 54 deletions(-) delete mode 100644 util/i386/get_disk_name.c delete mode 100644 util/ieee1275/get_disk_name.c diff --git a/DISTLIST b/DISTLIST index 80fc98b98..21cbbfe95 100644 --- a/DISTLIST +++ b/DISTLIST @@ -434,7 +434,6 @@ util/grub.d/10_windows.in util/grub.d/30_os-prober.in util/grub.d/40_custom.in util/grub.d/README -util/i386/get_disk_name.c util/i386/efi/grub-install.in util/i386/efi/grub-mkimage.c util/i386/pc/grub-install.in @@ -442,7 +441,6 @@ util/i386/pc/grub-mkimage.c util/i386/pc/grub-mkrescue.in util/i386/pc/grub-setup.c util/i386/pc/misc.c -util/ieee1275/get_disk_name.c util/ieee1275/grub-install.in util/powerpc/ieee1275/grub-mkrescue.in util/powerpc/ieee1275/misc.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index b38de8ea5..ac7887e10 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -170,13 +170,12 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o +MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) +grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o + $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< @@ -186,10 +185,6 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< -include grub_mkdevicemap-util_misc.d -grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i386/get_disk_name.c_DEPENDENCIES) - $(CC) -Iutil/i386 -I$(srcdir)/util/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_i386_get_disk_name.d - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index b680767c7..c953d4a06 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -47,13 +47,12 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o +MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) +grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o + $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< @@ -63,10 +62,6 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< -include grub_mkdevicemap-util_misc.d -grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i386/get_disk_name.c_DEPENDENCIES) - $(CC) -Iutil/i386 -I$(srcdir)/util/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_i386_get_disk_name.d - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 5d0fbd948..a3d855db5 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -167,13 +167,12 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o +MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) +grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o + $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< @@ -183,10 +182,6 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< -include grub_mkdevicemap-util_misc.d -grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i386/get_disk_name.c_DEPENDENCIES) - $(CC) -Iutil/i386 -I$(srcdir)/util/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_i386_get_disk_name.d - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 8d7683528..dd455917e 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -493,13 +493,12 @@ grub_setup-grub_setup_init.o: grub_setup_init.c $(grub_setup_init.c_DEPENDENCIES # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_i386_get_disk_name.d +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o +MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_i386_get_disk_name.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) +grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o + $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< @@ -509,10 +508,6 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< -include grub_mkdevicemap-util_misc.d -grub_mkdevicemap-util_i386_get_disk_name.o: util/i386/get_disk_name.c $(util/i386/get_disk_name.c_DEPENDENCIES) - $(CC) -Iutil/i386 -I$(srcdir)/util/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_i386_get_disk_name.d - # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index aec892168..7ea4edb5d 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -35,13 +35,12 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/ieee1275/get_disk_name.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_ieee1275_get_disk_name.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d grub_mkdevicemap-util_ieee1275_get_disk_name.d +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o +MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_ieee1275_get_disk_name.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o grub_mkdevicemap-util_ieee1275_get_disk_name.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) +grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o + $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< @@ -51,10 +50,6 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< -include grub_mkdevicemap-util_misc.d -grub_mkdevicemap-util_ieee1275_get_disk_name.o: util/ieee1275/get_disk_name.c $(util/ieee1275/get_disk_name.c_DEPENDENCIES) - $(CC) -Iutil/ieee1275 -I$(srcdir)/util/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_ieee1275_get_disk_name.d - # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 4ed75906b..54f72f96b 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -49,8 +49,7 @@ grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c \ - util/i386/get_disk_name.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/util/i386/get_disk_name.c b/util/i386/get_disk_name.c deleted file mode 100644 index e69de29bb..000000000 diff --git a/util/ieee1275/get_disk_name.c b/util/ieee1275/get_disk_name.c deleted file mode 100644 index e69de29bb..000000000 From add6f17a17574e8577110ccb17c3e5b733a9f37c Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 25 Sep 2008 14:40:59 +0000 Subject: [PATCH 0419/1707] 2008-09-25 Robert Millan * util/grub-mkdevicemap.c (make_device_map): Actually replace all instances of grub_util_get_disk_name() (see previous commit). --- ChangeLog | 5 +++++ util/grub-mkdevicemap.c | 25 +++++-------------------- 2 files changed, 10 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 36b114245..d615f65eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-25 Robert Millan + + * util/grub-mkdevicemap.c (make_device_map): Actually replace all + instances of grub_util_get_disk_name() (see previous commit). + 2008-09-25 Robert Millan * conf/i386-pc.rmk (grub_mkdevicemap_SOURCES): Remove diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index cd9ea1940..fa8b158dc 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -483,10 +483,7 @@ make_device_map (const char *device_map, int floppy_disks) get_virtio_disk_name (name, i); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -512,10 +509,7 @@ make_device_map (const char *device_map, int floppy_disks) get_xvd_disk_name (name, i); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -573,10 +567,7 @@ make_device_map (const char *device_map, int floppy_disks) get_cciss_disk_name (name, controller, drive); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -597,10 +588,7 @@ make_device_map (const char *device_map, int floppy_disks) get_ida_disk_name (name, controller, drive); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } @@ -632,10 +620,7 @@ make_device_map (const char *device_map, int floppy_disks) get_mmc_disk_name (name, i); if (check_device (name)) { - char *p; - p = grub_util_get_disk_name (num_hd, name); - fprintf (fp, "(%s)\t%s\n", p, name); - free (p); + fprintf (fp, "(hd%d)\t%s\n", num_hd, name); num_hd++; } } From 92274e85da78a3f4d859046c0cbf18bf328eddc1 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 28 Sep 2008 03:35:49 +0000 Subject: [PATCH 0420/1707] 2008-09-28 Bean * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a bug in the previous patch. Thanks to Christian Franke for finding this bug. --- ChangeLog | 5 +++++ fs/ntfs.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d615f65eb..c9a38983e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-09-28 Bean + + * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a bug in the previous patch. + Thanks to Christian Franke for finding this bug. + 2008-09-25 Robert Millan * util/grub-mkdevicemap.c (make_device_map): Actually replace all diff --git a/fs/ntfs.c b/fs/ntfs.c index e0e50f164..22477c532 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -700,7 +700,7 @@ grub_ntfs_iterate_dir (grub_fshelp_node_t dir, int is_resident = (cur_pos[8] == 0); bitmap_len = ((is_resident) ? u32at (cur_pos, 0x10) : - (cur_pos, 0x28)); + u32at (cur_pos, 0x28)); bmp = grub_malloc (bitmap_len); if (bmp == NULL) From eb079ba9e22faa18c785df79d1ffb6050b5e76fd Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 28 Sep 2008 14:19:00 +0000 Subject: [PATCH 0421/1707] 008-09-28 Felix Zielcke fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one. Based on code from Tomas Ebenlendr . --- ChangeLog | 5 +++++ fs/jfs.c | 12 +++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9a38983e..351934fa3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +008-09-28 Felix Zielcke + + fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one. + Based on code from Tomas Ebenlendr . + 2008-09-28 Bean * fs/ntfs.c (grub_ntfs_iterate_dir): Fix a bug in the previous patch. diff --git a/fs/jfs.c b/fs/jfs.c index 8a027aec8..a4907ff55 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -614,8 +614,8 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) if (grub_jfs_read_inode (data, GRUB_JFS_AGGR_INODE, &data->currinode)) return grub_errno; - /* Skip the first slash. */ - if (name[0] == '/') + /* Skip the first slashes. */ + while (*name == '/') { name++; if (!*name) @@ -626,10 +626,12 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) next = grub_strchr (name, '/'); if (next) { - next[0] = '\0'; - next++; + while (*next == '/') + { + next[0] = '\0'; + next++; + } } - diro = grub_jfs_opendir (data, &data->currinode); if (!diro) return grub_errno; From 556ce6ac48444bf86903990140707fc0c7e8d5ea Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 28 Sep 2008 15:22:28 +0000 Subject: [PATCH 0422/1707] 2008-09-28 Robert Millan * fs/iso9660.c (struct grub_iso9660_primary_voldesc): Rename `created' to `modified'. Add the real `created' field. (grub_iso9660_uuid): Use `modified' rather than `created' for constructing the UUID. --- ChangeLog | 9 ++++++++- fs/iso9660.c | 35 ++++++++++++++++++----------------- 2 files changed, 26 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 351934fa3..cf66038ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,11 @@ -008-09-28 Felix Zielcke +2008-09-28 Robert Millan + + * fs/iso9660.c (struct grub_iso9660_primary_voldesc): Rename `created' + to `modified'. Add the real `created' field. + (grub_iso9660_uuid): Use `modified' rather than `created' for + constructing the UUID. + +2008-09-28 Felix Zielcke fs/jfs.c (grub_jfs_find_file): Treat multiple slashes like one. Based on code from Tomas Ebenlendr . diff --git a/fs/iso9660.c b/fs/iso9660.c index f42beb597..af5f62450 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -93,8 +93,9 @@ struct grub_iso9660_primary_voldesc grub_uint32_t path_table; grub_uint8_t unused5[12]; struct grub_iso9660_dir rootdir; - grub_uint8_t unused6[641]; + grub_uint8_t unused6[624]; struct grub_iso9660_date created; + struct grub_iso9660_date modified; } __attribute__ ((packed)); /* A single entry in the path table. */ @@ -840,14 +841,14 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) data = grub_iso9660_mount (disk); if (data) { - if (! data->voldesc.created.year[0] && ! data->voldesc.created.year[1] - && ! data->voldesc.created.year[2] && ! data->voldesc.created.year[3] - && ! data->voldesc.created.month[0] && ! data->voldesc.created.month[1] - && ! data->voldesc.created.day[0] && ! data->voldesc.created.day[1] - && ! data->voldesc.created.hour[0] && ! data->voldesc.created.hour[1] - && ! data->voldesc.created.minute[0] && ! data->voldesc.created.minute[1] - && ! data->voldesc.created.second[0] && ! data->voldesc.created.second[1] - && ! data->voldesc.created.hundredth[0] && ! data->voldesc.created.hundredth[1]) + if (! data->voldesc.modified.year[0] && ! data->voldesc.modified.year[1] + && ! data->voldesc.modified.year[2] && ! data->voldesc.modified.year[3] + && ! data->voldesc.modified.month[0] && ! data->voldesc.modified.month[1] + && ! data->voldesc.modified.day[0] && ! data->voldesc.modified.day[1] + && ! data->voldesc.modified.hour[0] && ! data->voldesc.modified.hour[1] + && ! data->voldesc.modified.minute[0] && ! data->voldesc.modified.minute[1] + && ! data->voldesc.modified.second[0] && ! data->voldesc.modified.second[1] + && ! data->voldesc.modified.hundredth[0] && ! data->voldesc.modified.hundredth[1]) { grub_error (GRUB_ERR_BAD_NUMBER, "No creation date in filesystem to generate UUID."); *uuid = NULL; @@ -856,14 +857,14 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) { *uuid = grub_malloc (sizeof ("YYYY-MM-DD-HH-mm-ss-hh")); grub_sprintf (*uuid, "%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c", - data->voldesc.created.year[0], data->voldesc.created.year[1], - data->voldesc.created.year[2], data->voldesc.created.year[3], - data->voldesc.created.month[0], data->voldesc.created.month[1], - data->voldesc.created.day[0], data->voldesc.created.day[1], - data->voldesc.created.hour[0], data->voldesc.created.hour[1], - data->voldesc.created.minute[0], data->voldesc.created.minute[1], - data->voldesc.created.second[0], data->voldesc.created.second[1], - data->voldesc.created.hundredth[0], data->voldesc.created.hundredth[1]); + data->voldesc.modified.year[0], data->voldesc.modified.year[1], + data->voldesc.modified.year[2], data->voldesc.modified.year[3], + data->voldesc.modified.month[0], data->voldesc.modified.month[1], + data->voldesc.modified.day[0], data->voldesc.modified.day[1], + data->voldesc.modified.hour[0], data->voldesc.modified.hour[1], + data->voldesc.modified.minute[0], data->voldesc.modified.minute[1], + data->voldesc.modified.second[0], data->voldesc.modified.second[1], + data->voldesc.modified.hundredth[0], data->voldesc.modified.hundredth[1]); } } else From 18ade780eda51968722fe9face6bda3de58aa24a Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 29 Sep 2008 14:57:05 +0000 Subject: [PATCH 0423/1707] 2008-09-29 Felix Zielcke * util/update-grub_lib.in: Copy to ... * util/grub-mkconfig_lib.in: ... this. Update all users. * util/update-grub_lib.in: Make it a stub to `grub-mkconfigig_lib.in'. * util/update-grub.in: Rename to ... * util/grub-mkconfig.in: ... this. Update all users. Remove `-y' option. Add `--output' option to allow users to specify the generated configuration file. Default to stdout. (update_grub_dir): Rename to ... (grub_mkconfig_dir): ... this. (grub_cfg): Default to an empty string. * conf/common.rmk (update-grub): Rename to ... (grub-mkconfig): ... this. (update-grub_lib): Copy to ... (grub-mkconfig_lib): ... this. (update-grub_SCRIPTS): Copy to ... (grub-mkconfig_SCRIPTS): ... this. Update all users. (update-grub_DATA): Rename to ... (grub-mkconfig_DATA): ... this. --- ChangeLog | 21 +++ DISTLIST | 3 +- Makefile.in | 8 +- conf/common.mk | 22 ++- conf/common.rmk | 22 ++- util/{update-grub.in => grub-mkconfig.in} | 43 +++--- util/grub-mkconfig_lib.in | 173 ++++++++++++++++++++++ util/grub.d/00_header.in | 2 +- util/grub.d/10_hurd.in | 2 +- util/grub.d/10_linux.in | 2 +- util/grub.d/10_windows.in | 2 +- util/grub.d/30_os-prober.in | 2 +- util/update-grub_lib.in | 159 +------------------- 13 files changed, 262 insertions(+), 199 deletions(-) rename util/{update-grub.in => grub-mkconfig.in} (85%) create mode 100644 util/grub-mkconfig_lib.in diff --git a/ChangeLog b/ChangeLog index cf66038ab..b0d03515e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2008-09-29 Felix Zielcke + + * util/update-grub_lib.in: Copy to ... + * util/grub-mkconfig_lib.in: ... this. Update all users. + * util/update-grub_lib.in: Make it a stub to `grub-mkconfigig_lib.in'. + * util/update-grub.in: Rename to ... + * util/grub-mkconfig.in: ... this. Update all users. Remove `-y' + option. Add `--output' option to allow users to specify the generated + configuration file. Default to stdout. + (update_grub_dir): Rename to ... + (grub_mkconfig_dir): ... this. + (grub_cfg): Default to an empty string. + * conf/common.rmk (update-grub): Rename to ... + (grub-mkconfig): ... this. + (update-grub_lib): Copy to ... + (grub-mkconfig_lib): ... this. + (update-grub_SCRIPTS): Copy to ... + (grub-mkconfig_SCRIPTS): ... this. Update all users. + (update-grub_DATA): Rename to ... + (grub-mkconfig_DATA): ... this. + 2008-09-28 Robert Millan * fs/iso9660.c (struct grub_iso9660_primary_voldesc): Rename `created' diff --git a/DISTLIST b/DISTLIST index 21cbbfe95..502773f7b 100644 --- a/DISTLIST +++ b/DISTLIST @@ -414,6 +414,8 @@ util/getroot.c util/grub-editenv.c util/grub-emu.c util/grub-fstest.c +util/grub-mkconfig.in +util/grub-mkconfig_lib.in util/grub-mkdevicemap.c util/grub-pe2elf.c util/grub-probe.c @@ -424,7 +426,6 @@ util/misc.c util/raid.c util/resolve.c util/unifont2pff.rb -util/update-grub.in util/update-grub_lib.in util/elf/grub-mkimage.c util/grub.d/00_header.in diff --git a/Makefile.in b/Makefile.in index 57a1f0a3f..b137b8765 100644 --- a/Makefile.in +++ b/Makefile.in @@ -108,7 +108,7 @@ PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ $(pkglib_DATA) $(lib_DATA) PKGDATA = $(pkgdata_DATA) PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) -SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(update-grub_SCRIPTS) +SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) CLEANFILES = MOSTLYCLEANFILES = @@ -209,12 +209,12 @@ install-local: all $(HELP2MAN) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \ done $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d - @list='$(update-grub_SCRIPTS)'; for file in $$list; do \ + @list='$(grub-mkconfig_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ done - @list='$(update-grub_DATA)'; for file in $$list; do \ + @list='$(grub-mkconfig_DATA)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ @@ -249,7 +249,7 @@ uninstall: dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ rm -f $(DESTDIR)$(sbindir)/$$dest; \ done - @list='$(update-grub_SCRIPTS) $(update-grub_DATA)'; for file in $$list; do \ + @list='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in $$list; do \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ rm -f $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ done diff --git a/conf/common.mk b/conf/common.mk index 444bd8350..925eac16a 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -526,12 +526,18 @@ grub_pe2elf-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) CLEANFILES += grub-pe2elf -# For update-grub -update-grub: util/update-grub.in config.status +# For grub-mkconfig +grub-mkconfig: util/grub-mkconfig.in config.status ./config.status --file=$@:$< chmod +x $@ -sbin_SCRIPTS += update-grub -CLEANFILES += update-grub +sbin_SCRIPTS += grub-mkconfig +CLEANFILES += grub-mkconfig + +grub-mkconfig_lib: util/grub-mkconfig_lib.in config.status + ./config.status --file=$@:$< + chmod +x $@ +lib_DATA += grub-mkconfig_lib +CLEANFILES += grub-mkconfig_lib update-grub_lib: util/update-grub_lib.in config.status ./config.status --file=$@:$< @@ -542,14 +548,14 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom ifeq ($(target_os), cygwin) -update-grub_SCRIPTS += 10_windows +grub-mkconfig_SCRIPTS += 10_windows endif -CLEANFILES += $(update-grub_SCRIPTS) +CLEANFILES += $(grub-mkconfig_SCRIPTS) -update-grub_DATA += util/grub.d/README +grub-mkconfig_DATA += util/grub.d/README # Filing systems. diff --git a/conf/common.rmk b/conf/common.rmk index 109fb7a10..b8e19a3dc 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -115,12 +115,18 @@ endif grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c CLEANFILES += grub-pe2elf -# For update-grub -update-grub: util/update-grub.in config.status +# For grub-mkconfig +grub-mkconfig: util/grub-mkconfig.in config.status ./config.status --file=$@:$< chmod +x $@ -sbin_SCRIPTS += update-grub -CLEANFILES += update-grub +sbin_SCRIPTS += grub-mkconfig +CLEANFILES += grub-mkconfig + +grub-mkconfig_lib: util/grub-mkconfig_lib.in config.status + ./config.status --file=$@:$< + chmod +x $@ +lib_DATA += grub-mkconfig_lib +CLEANFILES += grub-mkconfig_lib update-grub_lib: util/update-grub_lib.in config.status ./config.status --file=$@:$< @@ -131,14 +137,14 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -update-grub_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom ifeq ($(target_os), cygwin) -update-grub_SCRIPTS += 10_windows +grub-mkconfig_SCRIPTS += 10_windows endif -CLEANFILES += $(update-grub_SCRIPTS) +CLEANFILES += $(grub-mkconfig_SCRIPTS) -update-grub_DATA += util/grub.d/README +grub-mkconfig_DATA += util/grub.d/README # Filing systems. diff --git a/util/update-grub.in b/util/grub-mkconfig.in similarity index 85% rename from util/update-grub.in rename to util/grub-mkconfig.in index 75780acb2..f7cf0d1f0 100644 --- a/util/update-grub.in +++ b/util/grub-mkconfig.in @@ -24,8 +24,8 @@ sbindir=@sbindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ grub_prefix=`echo /boot/grub | sed ${transform}` -grub_cfg=${grub_prefix}/grub.cfg -update_grub_dir=${sysconfdir}/grub.d +grub_cfg="" +grub_mkconfig_dir=${sysconfdir}/grub.d grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` @@ -35,11 +35,11 @@ grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` usage () { cat <. EOF @@ -54,9 +54,13 @@ for option in "$@"; do -v | --version) echo "$0 (GNU GRUB ${PACKAGE_VERSION})" exit 0 ;; - -y) - echo "$0: warning: Ignoring -y option (no longer needed)." >&2 - ;; + -o) + shift + grub_cfg=$1 + ;; + --output=) + grub_cfg=`echo "$option" | sed 's/--output=//'` + ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage @@ -65,7 +69,7 @@ for option in "$@"; do esac done -. ${libdir}/grub/update-grub_lib +. ${libdir}/grub/grub-mkconfig_lib if [ "x$EUID" = "x" ] ; then EUID=`id -u` @@ -165,14 +169,15 @@ export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_ # These are optional, user-defined variables. export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE -rm -f ${grub_cfg}.new -exec > ${grub_cfg}.new +if test "x${grub_cfg}" != "x"; then + rm -f ${grub_cfg}.new + exec > ${grub_cfg}.new -# Allow this to fail, since /boot/grub/ might need to be fatfs to support some -# firmware implementations (e.g. OFW or EFI). -chmod 444 ${grub_cfg}.new || true - -echo "Updating ${grub_cfg} ..." >&2 + # Allow this to fail, since /boot/grub/ might need to be fatfs to support some + # firmware implementations (e.g. OFW or EFI). + chmod 444 ${grub_cfg}.new || true +fi +echo "Generating grub.cfg ..." >&2 cat << EOF # @@ -183,7 +188,7 @@ cat << EOF # EOF -for i in ${update_grub_dir}/* ; do +for i in ${grub_mkconfig_dir}/* ; do case "$i" in # emacsen backup files. FIXME: support other editors *~) ;; @@ -198,7 +203,9 @@ for i in ${update_grub_dir}/* ; do esac done -# none of the children aborted with error, install the new grub.cfg -mv -f ${grub_cfg}.new ${grub_cfg} +if test "x${grub_cfg}" != "x" ; then + # none of the children aborted with error, install the new grub.cfg + mv -f ${grub_cfg}.new ${grub_cfg} +fi echo "done" >&2 diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in new file mode 100644 index 000000000..83eb3b8d7 --- /dev/null +++ b/util/grub-mkconfig_lib.in @@ -0,0 +1,173 @@ +# Helper library for grub-mkconfig +# Copyright (C) 2007,2008 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +transform="@program_transform_name@" + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +datarootdir=@datarootdir@ +datadir=@datadir@ +sbindir=@sbindir@ +pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` + +grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` + +make_system_path_relative_to_its_root () +{ + path=$1 + # abort if file doesn't exist + if test -e $path ; then : ;else + return 1 + fi + + # canonicalize + if path=`readlink -f $path` ; then : ; else + return 1 + fi + + # if not a directory, climb up to the directory containing it + if test -d $path ; then + dir=$path + else + dir=`echo $path | sed -e "s,/[^/]*$,,g"` + fi + + num=`stat -c %d $dir` + + # this loop sets $dir to the root directory of the filesystem we're inspecting + while : ; do + parent=`readlink -f $dir/..` + if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else + # $parent is another filesystem; we found it. + break + fi + if [ "x$dir" = "x/" ] ; then + # / is our root. + break + fi + dir=$parent + done + + # This function never prints trailing slashes (so that its output can be + # appended a slash unconditionally). Each slash in $dir is considered a + # preceding slash, and therefore the root directory is an empty string. + if [ "$dir" = "/" ] ; then + dir="" + fi + + # XXX: This fails if $dir contains ','. + path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1 + + case "`uname 2>/dev/null`" in + CYGWIN*) + # Cygwin: Check if regular or emulated mount. + if [ -z "$dir" ] || [ "`stat -c %D "$dir/.."`" != 620000 ] ; then + # Reached some mount point not below /cygdrive. + # GRUB does not know Cygwin's emulated mounts, + # convert to Win32 path and remove drive letter. + path=`cygpath -m "$path" | sed -n 's,^[A-Za-z]:,,p'` + test ! -z "$path" || return 1 + fi ;; + esac + + echo "$path" +} + +is_path_readable_by_grub () +{ + path=$1 + + # abort if path doesn't exist + if test -e $path ; then : ;else + return 1 + fi + + # abort if file is in a filesystem we can't read + if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else + return 1 + fi + + return 0 +} + +convert_system_path_to_grub_path () +{ + path=$1 + + echo "Warning: convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." >&2 + + # abort if GRUB can't access the path + if is_path_readable_by_grub ${path} ; then : ; else + return 1 + fi + + if drive=`${grub_probe} -t drive $path` ; then : ; else + return 1 + fi + + if relative_path=`make_system_path_relative_to_its_root $path` ; then : ; else + return 1 + fi + + echo ${drive}${relative_path} +} + +prepare_grub_to_access_device () +{ + device=$1 + + # Abstraction modules aren't auto-loaded. + abstraction="`${grub_probe} --device ${device} --target=abstraction`" + if [ "x${abstraction}" = "x" ] ; then : ; else + echo "insmod ${abstraction}" + fi + + # If there's a filesystem UUID that GRUB is capable of identifying, use it; + # otherwise set root as per value in device.map. + echo "set root=`${grub_probe} --device ${device} --target=drive`" + if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then + echo "search --fs-uuid --set ${fs_uuid}" + fi +} + +font_path () +{ + for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do + # FIXME: We prefer ascii because loading complete fonts is too slow (and + # we don't yet provide the gettext magic that would make unicode useful). + for basename in ascii unicode unifont ; do + path="${dir}/${basename}.pff" + if is_path_readable_by_grub ${path} > /dev/null ; then + echo "${path}" + return 0 + fi + done + done + + return 1 +} + +grub_file_is_not_garbage () +{ + if test -f "$1" ; then + case "$1" in + *.dpkg-dist|*.dpkg-old|*.dpkg-tmp) return 1 ;; # debian dpkg + esac + else + return 1 + fi + return 0 +} diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 9ef25cfd7..a8e2902b1 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -23,7 +23,7 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ grub_prefix=`echo /boot/grub | sed ${transform}` -. ${libdir}/grub/update-grub_lib +. ${libdir}/grub/grub-mkconfig_lib # Do this as early as possible, since other commands might depend on it. # (e.g. the `font' command might need lvm or raid modules) diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index 833b24fc6..12d61b039 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -19,7 +19,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -. ${libdir}/grub/update-grub_lib +. ${libdir}/grub/grub-mkconfig_lib if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 9045904cb..7cd5a9ed2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -19,7 +19,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -. ${libdir}/grub/update-grub_lib +. ${libdir}/grub/grub-mkconfig_lib if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then OS=GNU/Linux diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in index e8f3c3e14..8877b15d5 100644 --- a/util/grub.d/10_windows.in +++ b/util/grub.d/10_windows.in @@ -19,7 +19,7 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -. ${libdir}/grub/update-grub_lib +. ${libdir}/grub/grub-mkconfig_lib case "`uname 2>/dev/null`" in CYGWIN*) ;; diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 56686e7b9..429cc9582 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -83,7 +83,7 @@ EOF done ;; hurd|*) - echo " ${LONGNAME} is not yet supported by update-grub." >&2 + echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2 ;; esac done diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 9d0f0c603..c4f187d39 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -1,4 +1,4 @@ -# Helper library for update-grub +# stub for new grub-mkconfig_lib # Copyright (C) 2007,2008 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify @@ -14,160 +14,9 @@ # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . -transform="@program_transform_name@" - prefix=@prefix@ exec_prefix=@exec_prefix@ -datarootdir=@datarootdir@ -datadir=@datadir@ -sbindir=@sbindir@ -pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` +libdir=@libdir@ -grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` - -make_system_path_relative_to_its_root () -{ - path=$1 - # abort if file doesn't exist - if test -e $path ; then : ;else - return 1 - fi - - # canonicalize - if path=`readlink -f $path` ; then : ; else - return 1 - fi - - # if not a directory, climb up to the directory containing it - if test -d $path ; then - dir=$path - else - dir=`echo $path | sed -e "s,/[^/]*$,,g"` - fi - - num=`stat -c %d $dir` - - # this loop sets $dir to the root directory of the filesystem we're inspecting - while : ; do - parent=`readlink -f $dir/..` - if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else - # $parent is another filesystem; we found it. - break - fi - if [ "x$dir" = "x/" ] ; then - # / is our root. - break - fi - dir=$parent - done - - # This function never prints trailing slashes (so that its output can be - # appended a slash unconditionally). Each slash in $dir is considered a - # preceding slash, and therefore the root directory is an empty string. - if [ "$dir" = "/" ] ; then - dir="" - fi - - # XXX: This fails if $dir contains ','. - path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1 - - case "`uname 2>/dev/null`" in - CYGWIN*) - # Cygwin: Check if regular or emulated mount. - if [ -z "$dir" ] || [ "`stat -c %D "$dir/.."`" != 620000 ] ; then - # Reached some mount point not below /cygdrive. - # GRUB does not know Cygwin's emulated mounts, - # convert to Win32 path and remove drive letter. - path=`cygpath -m "$path" | sed -n 's,^[A-Za-z]:,,p'` - test ! -z "$path" || return 1 - fi ;; - esac - - echo "$path" -} - -is_path_readable_by_grub () -{ - path=$1 - - # abort if path doesn't exist - if test -e $path ; then : ;else - return 1 - fi - - # abort if file is in a filesystem we can't read - if ${grub_probe} -t fs $path > /dev/null 2>&1 ; then : ; else - return 1 - fi - - return 0 -} - -convert_system_path_to_grub_path () -{ - path=$1 - - echo "Warning: convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." >&2 - - # abort if GRUB can't access the path - if is_path_readable_by_grub ${path} ; then : ; else - return 1 - fi - - if drive=`${grub_probe} -t drive $path` ; then : ; else - return 1 - fi - - if relative_path=`make_system_path_relative_to_its_root $path` ; then : ; else - return 1 - fi - - echo ${drive}${relative_path} -} - -prepare_grub_to_access_device () -{ - device=$1 - - # Abstraction modules aren't auto-loaded. - abstraction="`${grub_probe} --device ${device} --target=abstraction`" - if [ "x${abstraction}" = "x" ] ; then : ; else - echo "insmod ${abstraction}" - fi - - # If there's a filesystem UUID that GRUB is capable of identifying, use it; - # otherwise set root as per value in device.map. - echo "set root=`${grub_probe} --device ${device} --target=drive`" - if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then - echo "search --fs-uuid --set ${fs_uuid}" - fi -} - -font_path () -{ - for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do - # FIXME: We prefer ascii because loading complete fonts is too slow (and - # we don't yet provide the gettext magic that would make unicode useful). - for basename in ascii unicode unifont ; do - path="${dir}/${basename}.pff" - if is_path_readable_by_grub ${path} > /dev/null ; then - echo "${path}" - return 0 - fi - done - done - - return 1 -} - -grub_file_is_not_garbage () -{ - if test -f "$1" ; then - case "$1" in - *.dpkg-dist|*.dpkg-old|*.dpkg-tmp) return 1 ;; # debian dpkg - esac - else - return 1 - fi - return 0 -} +echo "warning: this file is deprecated, use grub-mkconfig_lib instead" >&2 +. ${libdir}/grub/grub-mkconfig_lib From 6d994591d39c8e2236fc6bfcd916431cf6d7dee6 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 29 Sep 2008 15:50:27 +0000 Subject: [PATCH 0424/1707] 2008-09-29 Felix Zielcke * NEWS: Update for rename of update-grub to grub-mkconfig. --- ChangeLog | 4 ++++ NEWS | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b0d03515e..e4f2c30ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-09-29 Felix Zielcke + + * NEWS: Update for rename of update-grub to grub-mkconfig. + 2008-09-29 Felix Zielcke * util/update-grub_lib.in: Copy to ... diff --git a/NEWS b/NEWS index 1c6f5570f..e223cdbff 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,7 @@ New in 1.97 - : +* update-grub is renamed to grub-mkconfig. + * When booting from PXE, PXE can be used to load files. * High resolution timer support. @@ -28,7 +30,7 @@ New in 1.97 - : * Create partmap.lst and use it to automatically load partition map modules. -* update-grub supports os-prober to add operating systems to the +* grub-mkconfig supports os-prober to add operating systems to the boot menu. * The ATA driver supports filesystems bigger than 2TB. From bf981c620bd0b169a3d31dc42b6d9cb5174bf9cf Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 3 Oct 2008 07:22:45 +0000 Subject: [PATCH 0425/1707] 2008-10-03 Felix Zielcke * util/update-grub_lib.in: Mention filename in warning message. --- ChangeLog | 4 ++++ util/update-grub_lib.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e4f2c30ae..672cefbcf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-10-03 Felix Zielcke + + * util/update-grub_lib.in: Mention filename in warning message. + 2008-09-29 Felix Zielcke * NEWS: Update for rename of update-grub to grub-mkconfig. diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index c4f187d39..25311ce2b 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -18,5 +18,5 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -echo "warning: this file is deprecated, use grub-mkconfig_lib instead" >&2 +echo "warning: update-grub_lib is deprecated, use grub-mkconfig_lib instead" >&2 . ${libdir}/grub/grub-mkconfig_lib From c9618ab2faed353c42d13a6b6233c40828a46504 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 3 Oct 2008 18:05:21 +0000 Subject: [PATCH 0426/1707] 2008-10-03 Felix Zielcke * util/i386/pc: Source grub-mkconfig_lib instead of update-grub_lib. --- ChangeLog | 4 ++++ util/i386/pc/grub-install.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 672cefbcf..22eacd461 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-10-03 Felix Zielcke + + * util/i386/pc: Source grub-mkconfig_lib instead of update-grub_lib. + 2008-10-03 Felix Zielcke * util/update-grub_lib.in: Mention filename in warning message. diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 4a4546ee9..41805c0d1 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -118,7 +118,7 @@ for option in "$@"; do done # for make_system_path_relative_to_its_root() -. ${libdir}/grub/update-grub_lib +. ${libdir}/grub/grub-mkconfig_lib if test "x$install_device" = x; then echo "install_device not specified." 1>&2 From 7a36edcafda52b797861682e9461bff89b5a15d8 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 3 Oct 2008 18:05:52 +0000 Subject: [PATCH 0427/1707] args forgot filename in previos commit changelog --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 22eacd461..8d74cc1bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2008-10-03 Felix Zielcke - * util/i386/pc: Source grub-mkconfig_lib instead of update-grub_lib. + * util/i386/pc/grub-install.in: Source grub-mkconfig_lib instead of update-grub_lib. 2008-10-03 Felix Zielcke From 1b7748eb13380b61dcf240472d23db42cf30e17e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 5 Oct 2008 10:51:23 +0000 Subject: [PATCH 0428/1707] 2008-10-05 Hans Lambermont * disk/lvm.c (grub_lvm_scan_device): Allocate buffer space for the circular metadata worst case scenario. If the metadata is circular then copy the wrap in place. * include/grub/lvm.h: Add GRUB_LVM_MDA_HEADER_SIZE, from the LVM2 project lib/format_text/layout.h Circular metadata bug found and patch debugged by Jan Derk Gerlings. --- ChangeLog | 9 +++++++++ disk/lvm.c | 13 ++++++++++++- include/grub/lvm.h | 1 + 3 files changed, 22 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8d74cc1bc..2e75ce8d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-10-05 Hans Lambermont + + * disk/lvm.c (grub_lvm_scan_device): Allocate buffer space for the + circular metadata worst case scenario. If the metadata is circular + then copy the wrap in place. + * include/grub/lvm.h: Add GRUB_LVM_MDA_HEADER_SIZE, from the LVM2 + project lib/format_text/layout.h + Circular metadata bug found and patch debugged by Jan Derk Gerlings. + 2008-10-03 Felix Zielcke * util/i386/pc/grub-install.in: Source grub-mkconfig_lib instead of update-grub_lib. diff --git a/disk/lvm.c b/disk/lvm.c index cd9e44751..a28d339a5 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -281,7 +281,8 @@ grub_lvm_scan_device (const char *name) goto fail; } - metadatabuf = grub_malloc (mda_size); + /* Allocate buffer space for the circular worst-case scenario. */ + metadatabuf = grub_malloc (2 * mda_size); if (! metadatabuf) goto fail; @@ -300,6 +301,16 @@ grub_lvm_scan_device (const char *name) } rlocn = mdah->raw_locns; + if (grub_le_to_cpu64 (rlocn->offset) + grub_le_to_cpu64 (rlocn->size) > + grub_le_to_cpu64 (mdah->size)) + { + /* Metadata is circular. Copy the wrap in place. */ + grub_memcpy (metadatabuf + mda_size, + metadatabuf + GRUB_LVM_MDA_HEADER_SIZE, + grub_le_to_cpu64 (rlocn->offset) + + grub_le_to_cpu64 (rlocn->size) - + grub_le_to_cpu64 (mdah->size)); + } p = q = metadatabuf + grub_le_to_cpu64 (rlocn->offset); while (*q != ' ' && q < metadatabuf + mda_size) diff --git a/include/grub/lvm.h b/include/grub/lvm.h index 8c07ec449..dd91cc672 100644 --- a/include/grub/lvm.h +++ b/include/grub/lvm.h @@ -103,6 +103,7 @@ struct grub_lvm_pv_header { #define GRUB_LVM_FMTT_MAGIC "\040\114\126\115\062\040\170\133\065\101\045\162\060\116\052\076" #define GRUB_LVM_FMTT_VERSION 1 +#define GRUB_LVM_MDA_HEADER_SIZE 512 /* On disk */ struct grub_lvm_raw_locn { From 7ab28c2157b9d8fbf7145a661c2dae2b4665591e Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 29 Oct 2008 19:14:12 +0000 Subject: [PATCH 0429/1707] 2008-10-29 Robert Millan * util/i386/pc/grub-install.in: Handle empty string as output from make_system_path_relative_to_its_root(). --- ChangeLog | 5 +++++ util/i386/pc/grub-install.in | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e75ce8d5..02a5bbc04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-29 Robert Millan + + * util/i386/pc/grub-install.in: Handle empty string as output from + make_system_path_relative_to_its_root(). + 2008-10-05 Hans Lambermont * disk/lvm.c (grub_lvm_scan_device): Allocate buffer space for the diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 41805c0d1..4b39cbfdd 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -261,9 +261,12 @@ else prefix_drive=`$grub_probe --target=drive --device ${grub_device}` fi -grub_prefix="${prefix_drive}`make_system_path_relative_to_its_root ${grubdir}`" || exit 1 +relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1 +if [ "x${relative_grubdir}" = "x" ] ; then + relative_grubdir=/ +fi -$grub_mkimage --output=${grubdir}/core.img --prefix=${grub_prefix} $modules || exit 1 +$grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 # Now perform the installation. $grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} \ From b7279447026533ec73e96b33712462661d303a68 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 29 Oct 2008 19:22:13 +0000 Subject: [PATCH 0430/1707] 2008-10-29 Guillem Jover * disk/lvm.c (grub_lvm_scan_device): Fix possible NULL value handling (add a missing NULL check, and correct them by moving the pointer operations after the actual check). --- ChangeLog | 6 ++++++ disk/lvm.c | 8 ++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02a5bbc04..98aefe434 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-10-29 Guillem Jover + + * disk/lvm.c (grub_lvm_scan_device): Fix possible NULL value handling + (add a missing NULL check, and correct them by moving the pointer + operations after the actual check). + 2008-10-29 Robert Millan * util/i386/pc/grub-install.in: Handle empty string as output from diff --git a/disk/lvm.c b/disk/lvm.c index a28d339a5..0b35aa9ad 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -384,9 +384,10 @@ grub_lvm_scan_device (const char *name) grub_memcpy (pv->name, p, s); pv->name[s] = '\0'; - p = grub_strstr (p, "id = \"") + sizeof("id = \"") - 1; + p = grub_strstr (p, "id = \""); if (p == NULL) goto pvs_fail; + p += sizeof("id = \"") - 1; grub_memcpy (pv->id, p, GRUB_LVM_ID_STRLEN); pv->id[GRUB_LVM_ID_STRLEN] = '\0'; @@ -398,7 +399,10 @@ grub_lvm_scan_device (const char *name) pv->next = vg->pvs; vg->pvs = pv; - p = grub_strchr (p, '}') + 1; + p = grub_strchr (p, '}'); + if (p == NULL) + goto pvs_fail; + p++; continue; pvs_fail: From de4fa71c6c61d78a0816da81e0c0806185a174f1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 29 Oct 2008 19:24:11 +0000 Subject: [PATCH 0431/1707] 2008-10-29 Guillem Jover * disk/lvm.c (grub_lvm_scan_device): Fix error recovery by delaying the addition of objects until the code is not going to be able to fail. --- ChangeLog | 5 +++++ disk/lvm.c | 22 ++++++++++++---------- 2 files changed, 17 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 98aefe434..430a37b78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-10-29 Guillem Jover + + * disk/lvm.c (grub_lvm_scan_device): Fix error recovery by delaying the + addition of objects until the code is not going to be able to fail. + 2008-10-29 Guillem Jover * disk/lvm.c (grub_lvm_scan_device): Fix possible NULL value handling diff --git a/disk/lvm.c b/disk/lvm.c index 0b35aa9ad..6ebde636f 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -356,8 +356,6 @@ grub_lvm_scan_device (const char *name) vg->lvs = NULL; vg->pvs = NULL; - vg->next = vg_list; - vg_list = vg; p = grub_strstr (p, "physical_volumes {"); if (p) @@ -395,14 +393,15 @@ grub_lvm_scan_device (const char *name) pv->start = grub_lvm_getvalue (&p, "pe_start = "); if (p == NULL) goto pvs_fail; - pv->disk = NULL; - pv->next = vg->pvs; - vg->pvs = pv; p = grub_strchr (p, '}'); if (p == NULL) goto pvs_fail; p++; + + pv->disk = NULL; + pv->next = vg->pvs; + vg->pvs = pv; continue; pvs_fail: @@ -531,16 +530,16 @@ grub_lvm_scan_device (const char *name) goto fail4; } - lv->number = lv_count++; - lv->vg = vg; - lv->next = vg->lvs; - vg->lvs = lv; - p = grub_strchr (p, '}'); if (p == NULL) goto lvs_fail; p += 3; + lv->number = lv_count++; + lv->vg = vg; + lv->next = vg->lvs; + vg->lvs = lv; + continue; lvs_fail: grub_free (lv->name); @@ -548,6 +547,9 @@ grub_lvm_scan_device (const char *name) goto fail4; } } + + vg->next = vg_list; + vg_list = vg; } else { From 1432e958900f9bdafa784bd0bf8b95a148c06ee0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 1 Nov 2008 12:42:27 +0000 Subject: [PATCH 0432/1707] 2008-11-01 Carles Pina i Estany * normal/menu.c (run_menu): Add Previous and Next Page keys in menu. --- ChangeLog | 4 ++++ normal/menu.c | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+) diff --git a/ChangeLog b/ChangeLog index 430a37b78..efc26e947 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-11-01 Carles Pina i Estany + + * normal/menu.c (run_menu): Add Previous and Next Page keys in menu. + 2008-10-29 Guillem Jover * disk/lvm.c (grub_lvm_scan_device): Fix error recovery by delaying the diff --git a/normal/menu.c b/normal/menu.c index d6fc0a33e..103aa6f15 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -457,6 +457,57 @@ run_menu (grub_menu_t menu, int nested) } } break; + + case GRUB_TERM_PPAGE: + if (first == 0) + { + offset = 0; + } + else + { + first -= GRUB_TERM_NUM_ENTRIES; + + if (first < 0) + { + offset += first; + first = 0; + } + } + print_entries (menu, first, offset); + break; + + case GRUB_TERM_NPAGE: + if (offset == 0) + { + offset += GRUB_TERM_NUM_ENTRIES - 1; + if (first + offset >= menu->size) + { + offset = menu->size - first - 1; + } + } + else + { + first += GRUB_TERM_NUM_ENTRIES; + + if (first + offset >= menu->size) + { + first -= GRUB_TERM_NUM_ENTRIES; + offset += GRUB_TERM_NUM_ENTRIES; + + if (offset > menu->size - 1 || + offset > GRUB_TERM_NUM_ENTRIES - 1) + { + offset = menu->size - first - 1; + } + if (offset > GRUB_TERM_NUM_ENTRIES) + { + first += offset - GRUB_TERM_NUM_ENTRIES + 1; + offset = GRUB_TERM_NUM_ENTRIES - 1; + } + } + } + print_entries (menu, first, offset); + break; case '\n': case '\r': From 926b98230e5047d828d3c071c87b65b0013c43a1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 1 Nov 2008 17:44:47 +0000 Subject: [PATCH 0433/1707] 2008-11-01 Robert Millan * Makefile.in (CPPFLAGS): Fix builddir=. assumption. (TARGET_CPPFLAGS): Likewise. * genmk.rb (mod_src): Fix builddir=. and srcdir=. assumptions. --- ChangeLog | 6 +++ Makefile.in | 4 +- conf/common.mk | 110 +++++++++++++++++++-------------------- conf/i386-coreboot.mk | 34 ++++++------ conf/i386-efi.mk | 28 +++++----- conf/i386-ieee1275.mk | 34 ++++++------ conf/i386-pc.mk | 70 ++++++++++++------------- conf/i386.mk | 2 +- conf/powerpc-ieee1275.mk | 18 +++---- conf/sparc64-ieee1275.mk | 62 +++++++++++----------- conf/x86_64-efi.mk | 28 +++++----- genmk.rb | 2 +- 12 files changed, 202 insertions(+), 196 deletions(-) diff --git a/ChangeLog b/ChangeLog index efc26e947..f29bfb841 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-01 Robert Millan + + * Makefile.in (CPPFLAGS): Fix builddir=. assumption. + (TARGET_CPPFLAGS): Likewise. + * genmk.rb (mod_src): Fix builddir=. and srcdir=. assumptions. + 2008-11-01 Carles Pina i Estany * normal/menu.c (run_menu): Add Previous and Next Page keys in menu. diff --git a/Makefile.in b/Makefile.in index b137b8765..eae8f3163 100644 --- a/Makefile.in +++ b/Makefile.in @@ -62,11 +62,11 @@ mkinstalldirs = $(srcdir)/mkinstalldirs CC = @CC@ CFLAGS = @CFLAGS@ LDFLAGS = @LDFLAGS@ -CPPFLAGS = @CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include -Wall -W \ +CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include -Wall -W \ -DGRUB_LIBDIR=\"$(pkglibdir)\" TARGET_CC = @TARGET_CC@ TARGET_CFLAGS = @TARGET_CFLAGS@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I. -Iinclude -I$(srcdir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ diff --git a/conf/common.mk b/conf/common.mk index 925eac16a..7254d065c 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -587,7 +587,7 @@ pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o mod-fshelp.o: mod-fshelp.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $< -mod-fshelp.c: moddep.lst genmodsrc.sh +mod-fshelp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1) ifneq ($(fshelp_mod_EXPORTS),no) @@ -644,7 +644,7 @@ pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o mod-fat.o: mod-fat.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $< -mod-fat.c: moddep.lst genmodsrc.sh +mod-fat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1) ifneq ($(fat_mod_EXPORTS),no) @@ -701,7 +701,7 @@ pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o mod-ufs.o: mod-ufs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $< -mod-ufs.c: moddep.lst genmodsrc.sh +mod-ufs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1) ifneq ($(ufs_mod_EXPORTS),no) @@ -758,7 +758,7 @@ pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o mod-ext2.o: mod-ext2.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $< -mod-ext2.c: moddep.lst genmodsrc.sh +mod-ext2.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1) ifneq ($(ext2_mod_EXPORTS),no) @@ -815,7 +815,7 @@ pre-ntfs.o: $(ntfs_mod_DEPENDENCIES) ntfs_mod-fs_ntfs.o mod-ntfs.o: mod-ntfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -c -o $@ $< -mod-ntfs.c: moddep.lst genmodsrc.sh +mod-ntfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ntfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(ntfs_mod_EXPORTS),no) @@ -872,7 +872,7 @@ pre-ntfscomp.o: $(ntfscomp_mod_DEPENDENCIES) ntfscomp_mod-fs_ntfscomp.o mod-ntfscomp.o: mod-ntfscomp.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -c -o $@ $< -mod-ntfscomp.c: moddep.lst genmodsrc.sh +mod-ntfscomp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ntfscomp' $< > $@ || (rm -f $@; exit 1) ifneq ($(ntfscomp_mod_EXPORTS),no) @@ -929,7 +929,7 @@ pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o mod-minix.o: mod-minix.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $< -mod-minix.c: moddep.lst genmodsrc.sh +mod-minix.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1) ifneq ($(minix_mod_EXPORTS),no) @@ -986,7 +986,7 @@ pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o mod-hfs.o: mod-hfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $< -mod-hfs.c: moddep.lst genmodsrc.sh +mod-hfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(hfs_mod_EXPORTS),no) @@ -1043,7 +1043,7 @@ pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o mod-jfs.o: mod-jfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $< -mod-jfs.c: moddep.lst genmodsrc.sh +mod-jfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(jfs_mod_EXPORTS),no) @@ -1100,7 +1100,7 @@ pre-iso9660.o: $(iso9660_mod_DEPENDENCIES) iso9660_mod-fs_iso9660.o mod-iso9660.o: mod-iso9660.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $< -mod-iso9660.c: moddep.lst genmodsrc.sh +mod-iso9660.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'iso9660' $< > $@ || (rm -f $@; exit 1) ifneq ($(iso9660_mod_EXPORTS),no) @@ -1157,7 +1157,7 @@ pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o mod-xfs.o: mod-xfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $< -mod-xfs.c: moddep.lst genmodsrc.sh +mod-xfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(xfs_mod_EXPORTS),no) @@ -1214,7 +1214,7 @@ pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o mod-affs.o: mod-affs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $< -mod-affs.c: moddep.lst genmodsrc.sh +mod-affs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1) ifneq ($(affs_mod_EXPORTS),no) @@ -1271,7 +1271,7 @@ pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o mod-sfs.o: mod-sfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $< -mod-sfs.c: moddep.lst genmodsrc.sh +mod-sfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(sfs_mod_EXPORTS),no) @@ -1328,7 +1328,7 @@ pre-hfsplus.o: $(hfsplus_mod_DEPENDENCIES) hfsplus_mod-fs_hfsplus.o mod-hfsplus.o: mod-hfsplus.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $< -mod-hfsplus.c: moddep.lst genmodsrc.sh +mod-hfsplus.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'hfsplus' $< > $@ || (rm -f $@; exit 1) ifneq ($(hfsplus_mod_EXPORTS),no) @@ -1385,7 +1385,7 @@ pre-reiserfs.o: $(reiserfs_mod_DEPENDENCIES) reiserfs_mod-fs_reiserfs.o mod-reiserfs.o: mod-reiserfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -c -o $@ $< -mod-reiserfs.c: moddep.lst genmodsrc.sh +mod-reiserfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reiserfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(reiserfs_mod_EXPORTS),no) @@ -1442,7 +1442,7 @@ pre-cpio.o: $(cpio_mod_DEPENDENCIES) cpio_mod-fs_cpio.o mod-cpio.o: mod-cpio.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -c -o $@ $< -mod-cpio.c: moddep.lst genmodsrc.sh +mod-cpio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'cpio' $< > $@ || (rm -f $@; exit 1) ifneq ($(cpio_mod_EXPORTS),no) @@ -1499,7 +1499,7 @@ pre-udf.o: $(udf_mod_DEPENDENCIES) udf_mod-fs_udf.o mod-udf.o: mod-udf.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -c -o $@ $< -mod-udf.c: moddep.lst genmodsrc.sh +mod-udf.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'udf' $< > $@ || (rm -f $@; exit 1) ifneq ($(udf_mod_EXPORTS),no) @@ -1556,7 +1556,7 @@ pre-afs.o: $(afs_mod_DEPENDENCIES) afs_mod-fs_afs.o mod-afs.o: mod-afs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -c -o $@ $< -mod-afs.c: moddep.lst genmodsrc.sh +mod-afs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'afs' $< > $@ || (rm -f $@; exit 1) ifneq ($(afs_mod_EXPORTS),no) @@ -1616,7 +1616,7 @@ pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o mod-amiga.o: mod-amiga.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $< -mod-amiga.c: moddep.lst genmodsrc.sh +mod-amiga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1) ifneq ($(amiga_mod_EXPORTS),no) @@ -1673,7 +1673,7 @@ pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o mod-apple.o: mod-apple.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $< -mod-apple.c: moddep.lst genmodsrc.sh +mod-apple.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1) ifneq ($(apple_mod_EXPORTS),no) @@ -1730,7 +1730,7 @@ pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o mod-pc.o: mod-pc.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $< -mod-pc.c: moddep.lst genmodsrc.sh +mod-pc.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1) ifneq ($(pc_mod_EXPORTS),no) @@ -1787,7 +1787,7 @@ pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o mod-sun.o: mod-sun.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $< -mod-sun.c: moddep.lst genmodsrc.sh +mod-sun.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1) ifneq ($(sun_mod_EXPORTS),no) @@ -1844,7 +1844,7 @@ pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o mod-acorn.o: mod-acorn.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $< -mod-acorn.c: moddep.lst genmodsrc.sh +mod-acorn.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1) ifneq ($(acorn_mod_EXPORTS),no) @@ -1901,7 +1901,7 @@ pre-gpt.o: $(gpt_mod_DEPENDENCIES) gpt_mod-partmap_gpt.o mod-gpt.o: mod-gpt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $< -mod-gpt.c: moddep.lst genmodsrc.sh +mod-gpt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'gpt' $< > $@ || (rm -f $@; exit 1) ifneq ($(gpt_mod_EXPORTS),no) @@ -1963,7 +1963,7 @@ pre-raid.o: $(raid_mod_DEPENDENCIES) raid_mod-disk_raid.o mod-raid.o: mod-raid.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -c -o $@ $< -mod-raid.c: moddep.lst genmodsrc.sh +mod-raid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'raid' $< > $@ || (rm -f $@; exit 1) ifneq ($(raid_mod_EXPORTS),no) @@ -2020,7 +2020,7 @@ pre-raid5rec.o: $(raid5rec_mod_DEPENDENCIES) raid5rec_mod-disk_raid5_recover.o mod-raid5rec.o: mod-raid5rec.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -c -o $@ $< -mod-raid5rec.c: moddep.lst genmodsrc.sh +mod-raid5rec.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'raid5rec' $< > $@ || (rm -f $@; exit 1) ifneq ($(raid5rec_mod_EXPORTS),no) @@ -2077,7 +2077,7 @@ pre-raid6rec.o: $(raid6rec_mod_DEPENDENCIES) raid6rec_mod-disk_raid6_recover.o mod-raid6rec.o: mod-raid6rec.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -c -o $@ $< -mod-raid6rec.c: moddep.lst genmodsrc.sh +mod-raid6rec.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'raid6rec' $< > $@ || (rm -f $@; exit 1) ifneq ($(raid6rec_mod_EXPORTS),no) @@ -2134,7 +2134,7 @@ pre-mdraid.o: $(mdraid_mod_DEPENDENCIES) mdraid_mod-disk_mdraid_linux.o mod-mdraid.o: mod-mdraid.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -c -o $@ $< -mod-mdraid.c: moddep.lst genmodsrc.sh +mod-mdraid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'mdraid' $< > $@ || (rm -f $@; exit 1) ifneq ($(mdraid_mod_EXPORTS),no) @@ -2191,7 +2191,7 @@ pre-dm_nv.o: $(dm_nv_mod_DEPENDENCIES) dm_nv_mod-disk_dmraid_nvidia.o mod-dm_nv.o: mod-dm_nv.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -c -o $@ $< -mod-dm_nv.c: moddep.lst genmodsrc.sh +mod-dm_nv.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'dm_nv' $< > $@ || (rm -f $@; exit 1) ifneq ($(dm_nv_mod_EXPORTS),no) @@ -2248,7 +2248,7 @@ pre-lvm.o: $(lvm_mod_DEPENDENCIES) lvm_mod-disk_lvm.o mod-lvm.o: mod-lvm.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -c -o $@ $< -mod-lvm.c: moddep.lst genmodsrc.sh +mod-lvm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'lvm' $< > $@ || (rm -f $@; exit 1) ifneq ($(lvm_mod_EXPORTS),no) @@ -2305,7 +2305,7 @@ pre-scsi.o: $(scsi_mod_DEPENDENCIES) scsi_mod-disk_scsi.o mod-scsi.o: mod-scsi.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -c -o $@ $< -mod-scsi.c: moddep.lst genmodsrc.sh +mod-scsi.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'scsi' $< > $@ || (rm -f $@; exit 1) ifneq ($(scsi_mod_EXPORTS),no) @@ -2369,7 +2369,7 @@ pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o mod-hello.o: mod-hello.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $< -mod-hello.c: moddep.lst genmodsrc.sh +mod-hello.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1) ifneq ($(hello_mod_EXPORTS),no) @@ -2426,7 +2426,7 @@ pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o mod-boot.o: mod-boot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $< -mod-boot.c: moddep.lst genmodsrc.sh +mod-boot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1) ifneq ($(boot_mod_EXPORTS),no) @@ -2483,7 +2483,7 @@ pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o mod-terminal.o: mod-terminal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $< -mod-terminal.c: moddep.lst genmodsrc.sh +mod-terminal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1) ifneq ($(terminal_mod_EXPORTS),no) @@ -2540,7 +2540,7 @@ pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o mod-ls.o: mod-ls.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $< -mod-ls.c: moddep.lst genmodsrc.sh +mod-ls.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1) ifneq ($(ls_mod_EXPORTS),no) @@ -2597,7 +2597,7 @@ pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o mod-cmp.o: mod-cmp.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $< -mod-cmp.c: moddep.lst genmodsrc.sh +mod-cmp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1) ifneq ($(cmp_mod_EXPORTS),no) @@ -2654,7 +2654,7 @@ pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o mod-cat.o: mod-cat.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $< -mod-cat.c: moddep.lst genmodsrc.sh +mod-cat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1) ifneq ($(cat_mod_EXPORTS),no) @@ -2711,7 +2711,7 @@ pre-echo.o: $(echo_mod_DEPENDENCIES) echo_mod-commands_echo.o mod-echo.o: mod-echo.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -c -o $@ $< -mod-echo.c: moddep.lst genmodsrc.sh +mod-echo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'echo' $< > $@ || (rm -f $@; exit 1) ifneq ($(echo_mod_EXPORTS),no) @@ -2768,7 +2768,7 @@ pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o mod-help.o: mod-help.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $< -mod-help.c: moddep.lst genmodsrc.sh +mod-help.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1) ifneq ($(help_mod_EXPORTS),no) @@ -2825,7 +2825,7 @@ pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o mod-font.o: mod-font.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< -mod-font.c: moddep.lst genmodsrc.sh +mod-font.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1) ifneq ($(font_mod_EXPORTS),no) @@ -2882,7 +2882,7 @@ pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o mod-search.o: mod-search.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $< -mod-search.c: moddep.lst genmodsrc.sh +mod-search.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1) ifneq ($(search_mod_EXPORTS),no) @@ -2939,7 +2939,7 @@ pre-test.o: $(test_mod_DEPENDENCIES) test_mod-commands_test.o mod-test.o: mod-test.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -c -o $@ $< -mod-test.c: moddep.lst genmodsrc.sh +mod-test.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'test' $< > $@ || (rm -f $@; exit 1) ifneq ($(test_mod_EXPORTS),no) @@ -2996,7 +2996,7 @@ pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o mod-loopback.o: mod-loopback.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $< -mod-loopback.c: moddep.lst genmodsrc.sh +mod-loopback.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1) ifneq ($(loopback_mod_EXPORTS),no) @@ -3053,7 +3053,7 @@ pre-fs_uuid.o: $(fs_uuid_mod_DEPENDENCIES) fs_uuid_mod-disk_fs_uuid.o mod-fs_uuid.o: mod-fs_uuid.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -c -o $@ $< -mod-fs_uuid.c: moddep.lst genmodsrc.sh +mod-fs_uuid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'fs_uuid' $< > $@ || (rm -f $@; exit 1) ifneq ($(fs_uuid_mod_EXPORTS),no) @@ -3110,7 +3110,7 @@ pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configf mod-configfile.o: mod-configfile.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $< -mod-configfile.c: moddep.lst genmodsrc.sh +mod-configfile.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1) ifneq ($(configfile_mod_EXPORTS),no) @@ -3167,7 +3167,7 @@ pre-terminfo.o: $(terminfo_mod_DEPENDENCIES) terminfo_mod-term_terminfo.o termin mod-terminfo.o: mod-terminfo.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $< -mod-terminfo.c: moddep.lst genmodsrc.sh +mod-terminfo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'terminfo' $< > $@ || (rm -f $@; exit 1) ifneq ($(terminfo_mod_EXPORTS),no) @@ -3243,7 +3243,7 @@ pre-blocklist.o: $(blocklist_mod_DEPENDENCIES) blocklist_mod-commands_blocklist. mod-blocklist.o: mod-blocklist.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -c -o $@ $< -mod-blocklist.c: moddep.lst genmodsrc.sh +mod-blocklist.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'blocklist' $< > $@ || (rm -f $@; exit 1) ifneq ($(blocklist_mod_EXPORTS),no) @@ -3300,7 +3300,7 @@ pre-hexdump.o: $(hexdump_mod_DEPENDENCIES) hexdump_mod-commands_hexdump.o hexdum mod-hexdump.o: mod-hexdump.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -c -o $@ $< -mod-hexdump.c: moddep.lst genmodsrc.sh +mod-hexdump.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'hexdump' $< > $@ || (rm -f $@; exit 1) ifneq ($(hexdump_mod_EXPORTS),no) @@ -3376,7 +3376,7 @@ pre-read.o: $(read_mod_DEPENDENCIES) read_mod-commands_read.o mod-read.o: mod-read.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -c -o $@ $< -mod-read.c: moddep.lst genmodsrc.sh +mod-read.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'read' $< > $@ || (rm -f $@; exit 1) ifneq ($(read_mod_EXPORTS),no) @@ -3433,7 +3433,7 @@ pre-sleep.o: $(sleep_mod_DEPENDENCIES) sleep_mod-commands_sleep.o mod-sleep.o: mod-sleep.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -c -o $@ $< -mod-sleep.c: moddep.lst genmodsrc.sh +mod-sleep.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'sleep' $< > $@ || (rm -f $@; exit 1) ifneq ($(sleep_mod_EXPORTS),no) @@ -3490,7 +3490,7 @@ pre-loadenv.o: $(loadenv_mod_DEPENDENCIES) loadenv_mod-commands_loadenv.o loaden mod-loadenv.o: mod-loadenv.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -c -o $@ $< -mod-loadenv.c: moddep.lst genmodsrc.sh +mod-loadenv.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'loadenv' $< > $@ || (rm -f $@; exit 1) ifneq ($(loadenv_mod_EXPORTS),no) @@ -3566,7 +3566,7 @@ pre-crc.o: $(crc_mod_DEPENDENCIES) crc_mod-commands_crc.o crc_mod-lib_crc.o mod-crc.o: mod-crc.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -c -o $@ $< -mod-crc.c: moddep.lst genmodsrc.sh +mod-crc.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'crc' $< > $@ || (rm -f $@; exit 1) ifneq ($(crc_mod_EXPORTS),no) @@ -3645,7 +3645,7 @@ pre-elf.o: $(elf_mod_DEPENDENCIES) elf_mod-kern_elf.o mod-elf.o: mod-elf.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -c -o $@ $< -mod-elf.c: moddep.lst genmodsrc.sh +mod-elf.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'elf' $< > $@ || (rm -f $@; exit 1) ifneq ($(elf_mod_EXPORTS),no) @@ -3702,7 +3702,7 @@ pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o mod-gzio.o: mod-gzio.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $< -mod-gzio.c: moddep.lst genmodsrc.sh +mod-gzio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1) ifneq ($(gzio_mod_EXPORTS),no) @@ -3759,7 +3759,7 @@ pre-bufio.o: $(bufio_mod_DEPENDENCIES) bufio_mod-io_bufio.o mod-bufio.o: mod-bufio.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -c -o $@ $< -mod-bufio.c: moddep.lst genmodsrc.sh +mod-bufio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'bufio' $< > $@ || (rm -f $@; exit 1) ifneq ($(bufio_mod_EXPORTS),no) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index ac7887e10..aaa221c61 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -595,7 +595,7 @@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_linux.o mod-_linux.o: mod-_linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< -mod-_linux.c: moddep.lst genmodsrc.sh +mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(_linux_mod_EXPORTS),no) @@ -652,7 +652,7 @@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< -mod-linux.c: moddep.lst genmodsrc.sh +mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(linux_mod_EXPORTS),no) @@ -713,7 +713,7 @@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-norm mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< -mod-normal.c: moddep.lst genmodsrc.sh +mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) ifneq ($(normal_mod_EXPORTS),no) @@ -1037,7 +1037,7 @@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o reboot_mod mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< -mod-reboot.c: moddep.lst genmodsrc.sh +mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(reboot_mod_EXPORTS),no) @@ -1113,7 +1113,7 @@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o halt_mod-kern_i386 mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< -mod-halt.c: moddep.lst genmodsrc.sh +mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) ifneq ($(halt_mod_EXPORTS),no) @@ -1189,7 +1189,7 @@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o mod-serial.o: mod-serial.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $< -mod-serial.c: moddep.lst genmodsrc.sh +mod-serial.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1) ifneq ($(serial_mod_EXPORTS),no) @@ -1249,7 +1249,7 @@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_m mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< -mod-_multiboot.c: moddep.lst genmodsrc.sh +mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(_multiboot_mod_EXPORTS),no) @@ -1363,7 +1363,7 @@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_lo mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< -mod-multiboot.c: moddep.lst genmodsrc.sh +mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(multiboot_mod_EXPORTS),no) @@ -1420,7 +1420,7 @@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o mod-aout.o: mod-aout.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< -mod-aout.c: moddep.lst genmodsrc.sh +mod-aout.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) ifneq ($(aout_mod_EXPORTS),no) @@ -1477,7 +1477,7 @@ pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o mod-play.o: mod-play.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -c -o $@ $< -mod-play.c: moddep.lst genmodsrc.sh +mod-play.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'play' $< > $@ || (rm -f $@; exit 1) ifneq ($(play_mod_EXPORTS),no) @@ -1534,7 +1534,7 @@ pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o mod-ata.o: mod-ata.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -c -o $@ $< -mod-ata.c: moddep.lst genmodsrc.sh +mod-ata.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ata' $< > $@ || (rm -f $@; exit 1) ifneq ($(ata_mod_EXPORTS),no) @@ -1591,7 +1591,7 @@ pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o mod-memdisk.o: mod-memdisk.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< -mod-memdisk.c: moddep.lst genmodsrc.sh +mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) ifneq ($(memdisk_mod_EXPORTS),no) @@ -1648,7 +1648,7 @@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o mod-pci.o: mod-pci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< -mod-pci.c: moddep.lst genmodsrc.sh +mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) ifneq ($(pci_mod_EXPORTS),no) @@ -1705,7 +1705,7 @@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o mod-lspci.o: mod-lspci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< -mod-lspci.c: moddep.lst genmodsrc.sh +mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) ifneq ($(lspci_mod_EXPORTS),no) @@ -1762,7 +1762,7 @@ pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetim mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< -mod-datetime.c: moddep.lst genmodsrc.sh +mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) ifneq ($(datetime_mod_EXPORTS),no) @@ -1838,7 +1838,7 @@ pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o mod-date.o: mod-date.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< -mod-date.c: moddep.lst genmodsrc.sh +mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) ifneq ($(date_mod_EXPORTS),no) @@ -1895,7 +1895,7 @@ pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o mod-datehook.o: mod-datehook.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< -mod-datehook.c: moddep.lst genmodsrc.sh +mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) ifneq ($(datehook_mod_EXPORTS),no) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index c953d4a06..f9d7c1b82 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -150,7 +150,7 @@ pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kern mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< -mod-kernel.c: moddep.lst genmodsrc.sh +mod-kernel.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'kernel' $< > $@ || (rm -f $@; exit 1) ifneq ($(kernel_mod_EXPORTS),no) @@ -758,7 +758,7 @@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-norm mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< -mod-normal.c: moddep.lst genmodsrc.sh +mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) ifneq ($(normal_mod_EXPORTS),no) @@ -1082,7 +1082,7 @@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o mod-_chain.o: mod-_chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $< -mod-_chain.c: moddep.lst genmodsrc.sh +mod-_chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1) ifneq ($(_chain_mod_EXPORTS),no) @@ -1139,7 +1139,7 @@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o mod-chain.o: mod-chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< -mod-chain.c: moddep.lst genmodsrc.sh +mod-chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1) ifneq ($(chain_mod_EXPORTS),no) @@ -1196,7 +1196,7 @@ pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader mod-appleldr.o: mod-appleldr.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -c -o $@ $< -mod-appleldr.c: moddep.lst genmodsrc.sh +mod-appleldr.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'appleldr' $< > $@ || (rm -f $@; exit 1) ifneq ($(appleldr_mod_EXPORTS),no) @@ -1253,7 +1253,7 @@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o mod-_linux.o: mod-_linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< -mod-_linux.c: moddep.lst genmodsrc.sh +mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(_linux_mod_EXPORTS),no) @@ -1310,7 +1310,7 @@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< -mod-linux.c: moddep.lst genmodsrc.sh +mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(linux_mod_EXPORTS),no) @@ -1367,7 +1367,7 @@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< -mod-halt.c: moddep.lst genmodsrc.sh +mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) ifneq ($(halt_mod_EXPORTS),no) @@ -1424,7 +1424,7 @@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< -mod-reboot.c: moddep.lst genmodsrc.sh +mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(reboot_mod_EXPORTS),no) @@ -1481,7 +1481,7 @@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o mod-pci.o: mod-pci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< -mod-pci.c: moddep.lst genmodsrc.sh +mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) ifneq ($(pci_mod_EXPORTS),no) @@ -1538,7 +1538,7 @@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o mod-lspci.o: mod-lspci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< -mod-lspci.c: moddep.lst genmodsrc.sh +mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) ifneq ($(lspci_mod_EXPORTS),no) @@ -1595,7 +1595,7 @@ pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetim mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< -mod-datetime.c: moddep.lst genmodsrc.sh +mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) ifneq ($(datetime_mod_EXPORTS),no) @@ -1671,7 +1671,7 @@ pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o mod-date.o: mod-date.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< -mod-date.c: moddep.lst genmodsrc.sh +mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) ifneq ($(date_mod_EXPORTS),no) @@ -1728,7 +1728,7 @@ pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o mod-datehook.o: mod-datehook.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< -mod-datehook.c: moddep.lst genmodsrc.sh +mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) ifneq ($(datehook_mod_EXPORTS),no) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index a3d855db5..541f698fc 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -616,7 +616,7 @@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-norm mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< -mod-normal.c: moddep.lst genmodsrc.sh +mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) ifneq ($(normal_mod_EXPORTS),no) @@ -942,7 +942,7 @@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_ mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< -mod-_multiboot.c: moddep.lst genmodsrc.sh +mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(_multiboot_mod_EXPORTS),no) @@ -1037,7 +1037,7 @@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_lo mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< -mod-multiboot.c: moddep.lst genmodsrc.sh +mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(multiboot_mod_EXPORTS),no) @@ -1094,7 +1094,7 @@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o mod-aout.o: mod-aout.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< -mod-aout.c: moddep.lst genmodsrc.sh +mod-aout.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) ifneq ($(aout_mod_EXPORTS),no) @@ -1151,7 +1151,7 @@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend mod-suspend.o: mod-suspend.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $< -mod-suspend.c: moddep.lst genmodsrc.sh +mod-suspend.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1) ifneq ($(suspend_mod_EXPORTS),no) @@ -1208,7 +1208,7 @@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< -mod-reboot.c: moddep.lst genmodsrc.sh +mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(reboot_mod_EXPORTS),no) @@ -1265,7 +1265,7 @@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< -mod-halt.c: moddep.lst genmodsrc.sh +mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) ifneq ($(halt_mod_EXPORTS),no) @@ -1322,7 +1322,7 @@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o mod-serial.o: mod-serial.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $< -mod-serial.c: moddep.lst genmodsrc.sh +mod-serial.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1) ifneq ($(serial_mod_EXPORTS),no) @@ -1379,7 +1379,7 @@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_ieee1275_linux.o mod-_linux.o: mod-_linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< -mod-_linux.c: moddep.lst genmodsrc.sh +mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(_linux_mod_EXPORTS),no) @@ -1436,7 +1436,7 @@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< -mod-linux.c: moddep.lst genmodsrc.sh +mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(linux_mod_EXPORTS),no) @@ -1493,7 +1493,7 @@ pre-nand.o: $(nand_mod_DEPENDENCIES) nand_mod-disk_ieee1275_nand.o mod-nand.o: mod-nand.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -c -o $@ $< -mod-nand.c: moddep.lst genmodsrc.sh +mod-nand.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'nand' $< > $@ || (rm -f $@; exit 1) ifneq ($(nand_mod_EXPORTS),no) @@ -1550,7 +1550,7 @@ pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o mod-memdisk.o: mod-memdisk.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< -mod-memdisk.c: moddep.lst genmodsrc.sh +mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) ifneq ($(memdisk_mod_EXPORTS),no) @@ -1607,7 +1607,7 @@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o mod-pci.o: mod-pci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< -mod-pci.c: moddep.lst genmodsrc.sh +mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) ifneq ($(pci_mod_EXPORTS),no) @@ -1664,7 +1664,7 @@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o mod-lspci.o: mod-lspci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< -mod-lspci.c: moddep.lst genmodsrc.sh +mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) ifneq ($(lspci_mod_EXPORTS),no) @@ -1721,7 +1721,7 @@ pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetim mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< -mod-datetime.c: moddep.lst genmodsrc.sh +mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) ifneq ($(datetime_mod_EXPORTS),no) @@ -1797,7 +1797,7 @@ pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o mod-date.o: mod-date.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< -mod-date.c: moddep.lst genmodsrc.sh +mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) ifneq ($(date_mod_EXPORTS),no) @@ -1854,7 +1854,7 @@ pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o mod-datehook.o: mod-datehook.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< -mod-datehook.c: moddep.lst genmodsrc.sh +mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) ifneq ($(datehook_mod_EXPORTS),no) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index dd455917e..cb5b33530 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -951,7 +951,7 @@ pre-biosdisk.o: $(biosdisk_mod_DEPENDENCIES) biosdisk_mod-disk_i386_pc_biosdisk. mod-biosdisk.o: mod-biosdisk.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -c -o $@ $< -mod-biosdisk.c: moddep.lst genmodsrc.sh +mod-biosdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'biosdisk' $< > $@ || (rm -f $@; exit 1) ifneq ($(biosdisk_mod_EXPORTS),no) @@ -1008,7 +1008,7 @@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_i386_pc_chainloader.o mod-_chain.o: mod-_chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $< -mod-_chain.c: moddep.lst genmodsrc.sh +mod-_chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1) ifneq ($(_chain_mod_EXPORTS),no) @@ -1065,7 +1065,7 @@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_i386_pc_chainloader_norm mod-chain.o: mod-chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< -mod-chain.c: moddep.lst genmodsrc.sh +mod-chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1) ifneq ($(chain_mod_EXPORTS),no) @@ -1122,7 +1122,7 @@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_pc_linux.o mod-_linux.o: mod-_linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< -mod-_linux.c: moddep.lst genmodsrc.sh +mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(_linux_mod_EXPORTS),no) @@ -1179,7 +1179,7 @@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< -mod-linux.c: moddep.lst genmodsrc.sh +mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(linux_mod_EXPORTS),no) @@ -1241,7 +1241,7 @@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-norm mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< -mod-normal.c: moddep.lst genmodsrc.sh +mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) ifneq ($(normal_mod_EXPORTS),no) @@ -1565,7 +1565,7 @@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< -mod-reboot.c: moddep.lst genmodsrc.sh +mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(reboot_mod_EXPORTS),no) @@ -1622,7 +1622,7 @@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_i386_pc_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< -mod-halt.c: moddep.lst genmodsrc.sh +mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) ifneq ($(halt_mod_EXPORTS),no) @@ -1679,7 +1679,7 @@ pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o mod-serial.o: mod-serial.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $< -mod-serial.c: moddep.lst genmodsrc.sh +mod-serial.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1) ifneq ($(serial_mod_EXPORTS),no) @@ -1739,7 +1739,7 @@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_m mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< -mod-_multiboot.c: moddep.lst genmodsrc.sh +mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(_multiboot_mod_EXPORTS),no) @@ -1853,7 +1853,7 @@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_lo mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< -mod-multiboot.c: moddep.lst genmodsrc.sh +mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(multiboot_mod_EXPORTS),no) @@ -1911,7 +1911,7 @@ pre-vbe.o: $(vbe_mod_DEPENDENCIES) vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i38 mod-vbe.o: mod-vbe.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $< -mod-vbe.c: moddep.lst genmodsrc.sh +mod-vbe.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'vbe' $< > $@ || (rm -f $@; exit 1) ifneq ($(vbe_mod_EXPORTS),no) @@ -2025,7 +2025,7 @@ pre-vbeinfo.o: $(vbeinfo_mod_DEPENDENCIES) vbeinfo_mod-commands_i386_pc_vbeinfo. mod-vbeinfo.o: mod-vbeinfo.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $< -mod-vbeinfo.c: moddep.lst genmodsrc.sh +mod-vbeinfo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'vbeinfo' $< > $@ || (rm -f $@; exit 1) ifneq ($(vbeinfo_mod_EXPORTS),no) @@ -2082,7 +2082,7 @@ pre-vbetest.o: $(vbetest_mod_DEPENDENCIES) vbetest_mod-commands_i386_pc_vbetest. mod-vbetest.o: mod-vbetest.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $< -mod-vbetest.c: moddep.lst genmodsrc.sh +mod-vbetest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'vbetest' $< > $@ || (rm -f $@; exit 1) ifneq ($(vbetest_mod_EXPORTS),no) @@ -2139,7 +2139,7 @@ pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o mod-play.o: mod-play.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -c -o $@ $< -mod-play.c: moddep.lst genmodsrc.sh +mod-play.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'play' $< > $@ || (rm -f $@; exit 1) ifneq ($(play_mod_EXPORTS),no) @@ -2196,7 +2196,7 @@ pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o mod-video.o: mod-video.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $< -mod-video.c: moddep.lst genmodsrc.sh +mod-video.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1) ifneq ($(video_mod_EXPORTS),no) @@ -2253,7 +2253,7 @@ pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o mod-gfxterm.o: mod-gfxterm.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $< -mod-gfxterm.c: moddep.lst genmodsrc.sh +mod-gfxterm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1) ifneq ($(gfxterm_mod_EXPORTS),no) @@ -2310,7 +2310,7 @@ pre-videotest.o: $(videotest_mod_DEPENDENCIES) videotest_mod-commands_videotest. mod-videotest.o: mod-videotest.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $< -mod-videotest.c: moddep.lst genmodsrc.sh +mod-videotest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'videotest' $< > $@ || (rm -f $@; exit 1) ifneq ($(videotest_mod_EXPORTS),no) @@ -2367,7 +2367,7 @@ pre-bitmap.o: $(bitmap_mod_DEPENDENCIES) bitmap_mod-video_bitmap.o mod-bitmap.o: mod-bitmap.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -c -o $@ $< -mod-bitmap.c: moddep.lst genmodsrc.sh +mod-bitmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'bitmap' $< > $@ || (rm -f $@; exit 1) ifneq ($(bitmap_mod_EXPORTS),no) @@ -2424,7 +2424,7 @@ pre-tga.o: $(tga_mod_DEPENDENCIES) tga_mod-video_readers_tga.o mod-tga.o: mod-tga.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -c -o $@ $< -mod-tga.c: moddep.lst genmodsrc.sh +mod-tga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'tga' $< > $@ || (rm -f $@; exit 1) ifneq ($(tga_mod_EXPORTS),no) @@ -2481,7 +2481,7 @@ pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o mod-ata.o: mod-ata.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -c -o $@ $< -mod-ata.c: moddep.lst genmodsrc.sh +mod-ata.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ata' $< > $@ || (rm -f $@; exit 1) ifneq ($(ata_mod_EXPORTS),no) @@ -2538,7 +2538,7 @@ pre-vga.o: $(vga_mod_DEPENDENCIES) vga_mod-term_i386_pc_vga.o mod-vga.o: mod-vga.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -c -o $@ $< -mod-vga.c: moddep.lst genmodsrc.sh +mod-vga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'vga' $< > $@ || (rm -f $@; exit 1) ifneq ($(vga_mod_EXPORTS),no) @@ -2595,7 +2595,7 @@ pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o mod-memdisk.o: mod-memdisk.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< -mod-memdisk.c: moddep.lst genmodsrc.sh +mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) ifneq ($(memdisk_mod_EXPORTS),no) @@ -2652,7 +2652,7 @@ pre-jpeg.o: $(jpeg_mod_DEPENDENCIES) jpeg_mod-video_readers_jpeg.o mod-jpeg.o: mod-jpeg.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -c -o $@ $< -mod-jpeg.c: moddep.lst genmodsrc.sh +mod-jpeg.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'jpeg' $< > $@ || (rm -f $@; exit 1) ifneq ($(jpeg_mod_EXPORTS),no) @@ -2709,7 +2709,7 @@ pre-png.o: $(png_mod_DEPENDENCIES) png_mod-video_readers_png.o mod-png.o: mod-png.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -c -o $@ $< -mod-png.c: moddep.lst genmodsrc.sh +mod-png.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'png' $< > $@ || (rm -f $@; exit 1) ifneq ($(png_mod_EXPORTS),no) @@ -2766,7 +2766,7 @@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o mod-pci.o: mod-pci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< -mod-pci.c: moddep.lst genmodsrc.sh +mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) ifneq ($(pci_mod_EXPORTS),no) @@ -2823,7 +2823,7 @@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o mod-lspci.o: mod-lspci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< -mod-lspci.c: moddep.lst genmodsrc.sh +mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) ifneq ($(lspci_mod_EXPORTS),no) @@ -2880,7 +2880,7 @@ pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o mod-aout.o: mod-aout.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< -mod-aout.c: moddep.lst genmodsrc.sh +mod-aout.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) ifneq ($(aout_mod_EXPORTS),no) @@ -2937,7 +2937,7 @@ pre-_bsd.o: $(_bsd_mod_DEPENDENCIES) _bsd_mod-loader_i386_bsd.o mod-_bsd.o: mod-_bsd.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -c -o $@ $< -mod-_bsd.c: moddep.lst genmodsrc.sh +mod-_bsd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_bsd' $< > $@ || (rm -f $@; exit 1) ifneq ($(_bsd_mod_EXPORTS),no) @@ -2994,7 +2994,7 @@ pre-bsd.o: $(bsd_mod_DEPENDENCIES) bsd_mod-loader_i386_bsd_normal.o mod-bsd.o: mod-bsd.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -c -o $@ $< -mod-bsd.c: moddep.lst genmodsrc.sh +mod-bsd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'bsd' $< > $@ || (rm -f $@; exit 1) ifneq ($(bsd_mod_EXPORTS),no) @@ -3051,7 +3051,7 @@ pre-pxe.o: $(pxe_mod_DEPENDENCIES) pxe_mod-fs_i386_pc_pxe.o mod-pxe.o: mod-pxe.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -c -o $@ $< -mod-pxe.c: moddep.lst genmodsrc.sh +mod-pxe.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pxe' $< > $@ || (rm -f $@; exit 1) ifneq ($(pxe_mod_EXPORTS),no) @@ -3108,7 +3108,7 @@ pre-pxecmd.o: $(pxecmd_mod_DEPENDENCIES) pxecmd_mod-commands_i386_pc_pxecmd.o mod-pxecmd.o: mod-pxecmd.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -c -o $@ $< -mod-pxecmd.c: moddep.lst genmodsrc.sh +mod-pxecmd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pxecmd' $< > $@ || (rm -f $@; exit 1) ifneq ($(pxecmd_mod_EXPORTS),no) @@ -3165,7 +3165,7 @@ pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetim mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< -mod-datetime.c: moddep.lst genmodsrc.sh +mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) ifneq ($(datetime_mod_EXPORTS),no) @@ -3241,7 +3241,7 @@ pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o mod-date.o: mod-date.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< -mod-date.c: moddep.lst genmodsrc.sh +mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) ifneq ($(date_mod_EXPORTS),no) @@ -3298,7 +3298,7 @@ pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o mod-datehook.o: mod-datehook.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< -mod-datehook.c: moddep.lst genmodsrc.sh +mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) ifneq ($(datehook_mod_EXPORTS),no) diff --git a/conf/i386.mk b/conf/i386.mk index 77616d1cc..47f59b9ac 100644 --- a/conf/i386.mk +++ b/conf/i386.mk @@ -26,7 +26,7 @@ pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o mod-cpuid.o: mod-cpuid.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< -mod-cpuid.c: moddep.lst genmodsrc.sh +mod-cpuid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) ifneq ($(cpuid_mod_EXPORTS),no) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 7ea4edb5d..c924a3457 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -606,7 +606,7 @@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_powerpc_ieee1275_linu mod-_linux.o: mod-_linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< -mod-_linux.c: moddep.lst genmodsrc.sh +mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(_linux_mod_EXPORTS),no) @@ -663,7 +663,7 @@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_powerpc_ieee1275_linux_n mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< -mod-linux.c: moddep.lst genmodsrc.sh +mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(linux_mod_EXPORTS),no) @@ -724,7 +724,7 @@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-norm mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< -mod-normal.c: moddep.lst genmodsrc.sh +mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) ifneq ($(normal_mod_EXPORTS),no) @@ -1048,7 +1048,7 @@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend mod-suspend.o: mod-suspend.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $< -mod-suspend.c: moddep.lst genmodsrc.sh +mod-suspend.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1) ifneq ($(suspend_mod_EXPORTS),no) @@ -1105,7 +1105,7 @@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< -mod-reboot.c: moddep.lst genmodsrc.sh +mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(reboot_mod_EXPORTS),no) @@ -1162,7 +1162,7 @@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< -mod-halt.c: moddep.lst genmodsrc.sh +mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) ifneq ($(halt_mod_EXPORTS),no) @@ -1221,7 +1221,7 @@ pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_ mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< -mod-_multiboot.c: moddep.lst genmodsrc.sh +mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(_multiboot_mod_EXPORTS),no) @@ -1316,7 +1316,7 @@ pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_lo mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< -mod-multiboot.c: moddep.lst genmodsrc.sh +mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(multiboot_mod_EXPORTS),no) @@ -1373,7 +1373,7 @@ pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o mod-memdisk.o: mod-memdisk.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< -mod-memdisk.c: moddep.lst genmodsrc.sh +mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) ifneq ($(memdisk_mod_EXPORTS),no) diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 03cefc7fc..901b62649 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -219,7 +219,7 @@ pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o mod-fshelp.o: mod-fshelp.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $< -mod-fshelp.c: moddep.lst genmodsrc.sh +mod-fshelp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1) ifneq ($(fshelp_mod_EXPORTS),no) @@ -276,7 +276,7 @@ pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o mod-fat.o: mod-fat.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $< -mod-fat.c: moddep.lst genmodsrc.sh +mod-fat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1) ifneq ($(fat_mod_EXPORTS),no) @@ -333,7 +333,7 @@ pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o mod-ext2.o: mod-ext2.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $< -mod-ext2.c: moddep.lst genmodsrc.sh +mod-ext2.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1) ifneq ($(ext2_mod_EXPORTS),no) @@ -390,7 +390,7 @@ pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o mod-ufs.o: mod-ufs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $< -mod-ufs.c: moddep.lst genmodsrc.sh +mod-ufs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1) ifneq ($(ufs_mod_EXPORTS),no) @@ -447,7 +447,7 @@ pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o mod-minix.o: mod-minix.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $< -mod-minix.c: moddep.lst genmodsrc.sh +mod-minix.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1) ifneq ($(minix_mod_EXPORTS),no) @@ -504,7 +504,7 @@ pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o mod-hfs.o: mod-hfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $< -mod-hfs.c: moddep.lst genmodsrc.sh +mod-hfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(hfs_mod_EXPORTS),no) @@ -561,7 +561,7 @@ pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o mod-jfs.o: mod-jfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $< -mod-jfs.c: moddep.lst genmodsrc.sh +mod-jfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(jfs_mod_EXPORTS),no) @@ -623,7 +623,7 @@ pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o mod-xfs.o: mod-xfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $< -mod-xfs.c: moddep.lst genmodsrc.sh +mod-xfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(xfs_mod_EXPORTS),no) @@ -680,7 +680,7 @@ pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o mod-affs.o: mod-affs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $< -mod-affs.c: moddep.lst genmodsrc.sh +mod-affs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1) ifneq ($(affs_mod_EXPORTS),no) @@ -737,7 +737,7 @@ pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o mod-sfs.o: mod-sfs.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $< -mod-sfs.c: moddep.lst genmodsrc.sh +mod-sfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1) ifneq ($(sfs_mod_EXPORTS),no) @@ -809,7 +809,7 @@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-norm mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< -mod-normal.c: moddep.lst genmodsrc.sh +mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) ifneq ($(normal_mod_EXPORTS),no) @@ -1114,7 +1114,7 @@ pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o mod-hello.o: mod-hello.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $< -mod-hello.c: moddep.lst genmodsrc.sh +mod-hello.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1) ifneq ($(hello_mod_EXPORTS),no) @@ -1171,7 +1171,7 @@ pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o mod-boot.o: mod-boot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $< -mod-boot.c: moddep.lst genmodsrc.sh +mod-boot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1) ifneq ($(boot_mod_EXPORTS),no) @@ -1228,7 +1228,7 @@ pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o mod-terminal.o: mod-terminal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $< -mod-terminal.c: moddep.lst genmodsrc.sh +mod-terminal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1) ifneq ($(terminal_mod_EXPORTS),no) @@ -1285,7 +1285,7 @@ pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o mod-ls.o: mod-ls.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $< -mod-ls.c: moddep.lst genmodsrc.sh +mod-ls.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1) ifneq ($(ls_mod_EXPORTS),no) @@ -1342,7 +1342,7 @@ pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o mod-cmp.o: mod-cmp.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $< -mod-cmp.c: moddep.lst genmodsrc.sh +mod-cmp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1) ifneq ($(cmp_mod_EXPORTS),no) @@ -1399,7 +1399,7 @@ pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o mod-cat.o: mod-cat.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $< -mod-cat.c: moddep.lst genmodsrc.sh +mod-cat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1) ifneq ($(cat_mod_EXPORTS),no) @@ -1456,7 +1456,7 @@ pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o mod-font.o: mod-font.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< -mod-font.c: moddep.lst genmodsrc.sh +mod-font.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1) ifneq ($(font_mod_EXPORTS),no) @@ -1513,7 +1513,7 @@ pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o mod-amiga.o: mod-amiga.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $< -mod-amiga.c: moddep.lst genmodsrc.sh +mod-amiga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1) ifneq ($(amiga_mod_EXPORTS),no) @@ -1570,7 +1570,7 @@ pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o mod-apple.o: mod-apple.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $< -mod-apple.c: moddep.lst genmodsrc.sh +mod-apple.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1) ifneq ($(apple_mod_EXPORTS),no) @@ -1627,7 +1627,7 @@ pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o mod-pc.o: mod-pc.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $< -mod-pc.c: moddep.lst genmodsrc.sh +mod-pc.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1) ifneq ($(pc_mod_EXPORTS),no) @@ -1684,7 +1684,7 @@ pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o mod-sun.o: mod-sun.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $< -mod-sun.c: moddep.lst genmodsrc.sh +mod-sun.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1) ifneq ($(sun_mod_EXPORTS),no) @@ -1741,7 +1741,7 @@ pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o mod-acorn.o: mod-acorn.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $< -mod-acorn.c: moddep.lst genmodsrc.sh +mod-acorn.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1) ifneq ($(acorn_mod_EXPORTS),no) @@ -1797,7 +1797,7 @@ pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o mod-loopback.o: mod-loopback.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $< -mod-loopback.c: moddep.lst genmodsrc.sh +mod-loopback.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1) ifneq ($(loopback_mod_EXPORTS),no) @@ -1854,7 +1854,7 @@ pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend mod-suspend.o: mod-suspend.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $< -mod-suspend.c: moddep.lst genmodsrc.sh +mod-suspend.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1) ifneq ($(suspend_mod_EXPORTS),no) @@ -1911,7 +1911,7 @@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< -mod-reboot.c: moddep.lst genmodsrc.sh +mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(reboot_mod_EXPORTS),no) @@ -1968,7 +1968,7 @@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< -mod-halt.c: moddep.lst genmodsrc.sh +mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) ifneq ($(halt_mod_EXPORTS),no) @@ -2025,7 +2025,7 @@ pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o mod-help.o: mod-help.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $< -mod-help.c: moddep.lst genmodsrc.sh +mod-help.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1) ifneq ($(help_mod_EXPORTS),no) @@ -2092,7 +2092,7 @@ pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configf mod-configfile.o: mod-configfile.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $< -mod-configfile.c: moddep.lst genmodsrc.sh +mod-configfile.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1) ifneq ($(configfile_mod_EXPORTS),no) @@ -2149,7 +2149,7 @@ pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o mod-search.o: mod-search.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $< -mod-search.c: moddep.lst genmodsrc.sh +mod-search.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1) ifneq ($(search_mod_EXPORTS),no) @@ -2206,7 +2206,7 @@ pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o mod-gzio.o: mod-gzio.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $< -mod-gzio.c: moddep.lst genmodsrc.sh +mod-gzio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1) ifneq ($(gzio_mod_EXPORTS),no) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 54f72f96b..ca8d6cdd7 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -138,7 +138,7 @@ pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o ke mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< -mod-kernel.c: moddep.lst genmodsrc.sh +mod-kernel.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'kernel' $< > $@ || (rm -f $@; exit 1) ifneq ($(kernel_mod_EXPORTS),no) @@ -765,7 +765,7 @@ pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-norm mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< -mod-normal.c: moddep.lst genmodsrc.sh +mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) ifneq ($(normal_mod_EXPORTS),no) @@ -1089,7 +1089,7 @@ pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o mod-_chain.o: mod-_chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $< -mod-_chain.c: moddep.lst genmodsrc.sh +mod-_chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1) ifneq ($(_chain_mod_EXPORTS),no) @@ -1146,7 +1146,7 @@ pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o mod-chain.o: mod-chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< -mod-chain.c: moddep.lst genmodsrc.sh +mod-chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1) ifneq ($(chain_mod_EXPORTS),no) @@ -1203,7 +1203,7 @@ pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader mod-appleldr.o: mod-appleldr.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -c -o $@ $< -mod-appleldr.c: moddep.lst genmodsrc.sh +mod-appleldr.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'appleldr' $< > $@ || (rm -f $@; exit 1) ifneq ($(appleldr_mod_EXPORTS),no) @@ -1260,7 +1260,7 @@ pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o mod-_linux.o: mod-_linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< -mod-_linux.c: moddep.lst genmodsrc.sh +mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(_linux_mod_EXPORTS),no) @@ -1317,7 +1317,7 @@ pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< -mod-linux.c: moddep.lst genmodsrc.sh +mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) ifneq ($(linux_mod_EXPORTS),no) @@ -1374,7 +1374,7 @@ pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o mod-halt.o: mod-halt.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< -mod-halt.c: moddep.lst genmodsrc.sh +mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) ifneq ($(halt_mod_EXPORTS),no) @@ -1431,7 +1431,7 @@ pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o mod-reboot.o: mod-reboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< -mod-reboot.c: moddep.lst genmodsrc.sh +mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) ifneq ($(reboot_mod_EXPORTS),no) @@ -1488,7 +1488,7 @@ pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o mod-pci.o: mod-pci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< -mod-pci.c: moddep.lst genmodsrc.sh +mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) ifneq ($(pci_mod_EXPORTS),no) @@ -1545,7 +1545,7 @@ pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o mod-lspci.o: mod-lspci.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< -mod-lspci.c: moddep.lst genmodsrc.sh +mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) ifneq ($(lspci_mod_EXPORTS),no) @@ -1602,7 +1602,7 @@ pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetim mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< -mod-datetime.c: moddep.lst genmodsrc.sh +mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) ifneq ($(datetime_mod_EXPORTS),no) @@ -1678,7 +1678,7 @@ pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o mod-date.o: mod-date.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< -mod-date.c: moddep.lst genmodsrc.sh +mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) ifneq ($(date_mod_EXPORTS),no) @@ -1735,7 +1735,7 @@ pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o mod-datehook.o: mod-datehook.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< -mod-datehook.c: moddep.lst genmodsrc.sh +mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) ifneq ($(datehook_mod_EXPORTS),no) diff --git a/genmk.rb b/genmk.rb index 9ac1273fb..c41872c2a 100644 --- a/genmk.rb +++ b/genmk.rb @@ -125,7 +125,7 @@ UNDSYMFILES += #{undsym} #{mod_obj}: #{mod_src} $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -c -o $@ $< -#{mod_src}: moddep.lst genmodsrc.sh +#{mod_src}: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh sh $(srcdir)/genmodsrc.sh '#{mod_name}' $< > $@ || (rm -f $@; exit 1) ifneq ($(#{prefix}_EXPORTS),no) From 556f377582edb6b117c164490c8d13ae0c4bda0a Mon Sep 17 00:00:00 2001 From: bean Date: Mon, 3 Nov 2008 13:08:21 +0000 Subject: [PATCH 0434/1707] 2008-11-03 Bean * kern/elf.c (grub_elf32_load): Revert to previous code. (grub_elf64_load): Likewise. * loader/i386/bsd.c (grub_bsd_elf32_hook): Change return address. --- ChangeLog | 7 +++++++ kern/elf.c | 4 ++-- loader/i386/bsd.c | 4 +++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f29bfb841..aead197a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-03 Bean + + * kern/elf.c (grub_elf32_load): Revert to previous code. + (grub_elf64_load): Likewise. + + * loader/i386/bsd.c (grub_bsd_elf32_hook): Change return address. + 2008-11-01 Robert Millan * Makefile.in (CPPFLAGS): Fix builddir=. assumption. diff --git a/kern/elf.c b/kern/elf.c index 2b1e223f7..8ddf9e540 100644 --- a/kern/elf.c +++ b/kern/elf.c @@ -232,9 +232,9 @@ grub_elf32_load (grub_elf_t _elf, grub_elf32_load_hook_t _load_hook, if (phdr->p_type != PT_LOAD) return 0; + load_addr = phdr->p_paddr; if (load_hook && load_hook (phdr, &load_addr)) return 1; - load_addr = phdr->p_paddr; if (load_addr < load_base) load_base = load_addr; @@ -411,9 +411,9 @@ grub_elf64_load (grub_elf_t _elf, grub_elf64_load_hook_t _load_hook, if (phdr->p_type != PT_LOAD) return 0; + load_addr = phdr->p_paddr; if (load_hook && load_hook (phdr, &load_addr)) return 1; - load_addr = phdr->p_paddr; if (load_addr < load_base) load_base = load_addr; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 4966afa86..25d0f5990 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -454,7 +454,7 @@ grub_bsd_load_aout (grub_file_t file) } static grub_err_t -grub_bsd_elf32_hook (Elf32_Phdr * phdr, UNUSED grub_addr_t * addr) +grub_bsd_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr) { Elf32_Addr paddr; @@ -472,6 +472,8 @@ grub_bsd_elf32_hook (Elf32_Phdr * phdr, UNUSED grub_addr_t * addr) if (paddr + phdr->p_memsz > kern_end) kern_end = paddr + phdr->p_memsz; + *addr = paddr; + return GRUB_ERR_NONE; } From 96e5d876a4117a774f4f78b5c9c47d610e898e5e Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 4 Nov 2008 15:20:35 +0000 Subject: [PATCH 0435/1707] 2008-11-04 Robert Millan * util/grub.d/10_freebsd.in: New file. Generate grub configuration for FreeBSD. * conf/common.rmk (grub-mkconfig_SCRIPTS): Add 10_freebsd. --- ChangeLog | 6 ++++ DISTLIST | 1 + conf/common.mk | 2 +- conf/common.rmk | 2 +- util/grub.d/10_freebsd.in | 60 +++++++++++++++++++++++++++++++++++++++ 5 files changed, 69 insertions(+), 2 deletions(-) create mode 100644 util/grub.d/10_freebsd.in diff --git a/ChangeLog b/ChangeLog index aead197a8..889643932 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-04 Robert Millan + + * util/grub.d/10_freebsd.in: New file. Generate grub configuration + for FreeBSD. + * conf/common.rmk (grub-mkconfig_SCRIPTS): Add 10_freebsd. + 2008-11-03 Bean * kern/elf.c (grub_elf32_load): Revert to previous code. diff --git a/DISTLIST b/DISTLIST index 502773f7b..b54ba2903 100644 --- a/DISTLIST +++ b/DISTLIST @@ -429,6 +429,7 @@ util/unifont2pff.rb util/update-grub_lib.in util/elf/grub-mkimage.c util/grub.d/00_header.in +util/grub.d/10_freebsd.in util/grub.d/10_hurd.in util/grub.d/10_linux.in util/grub.d/10_windows.in diff --git a/conf/common.mk b/conf/common.mk index 7254d065c..6c12bacdc 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -548,7 +548,7 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 10_freebsd 30_os-prober 40_custom ifeq ($(target_os), cygwin) grub-mkconfig_SCRIPTS += 10_windows endif diff --git a/conf/common.rmk b/conf/common.rmk index b8e19a3dc..251a21f8e 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -137,7 +137,7 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 30_os-prober 40_custom +grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 10_freebsd 30_os-prober 40_custom ifeq ($(target_os), cygwin) grub-mkconfig_SCRIPTS += 10_windows endif diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in new file mode 100644 index 000000000..61d5450b1 --- /dev/null +++ b/util/grub.d/10_freebsd.in @@ -0,0 +1,60 @@ +#! /bin/sh -e + +# grub-mkconfig helper script. +# Copyright (C) 2008 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +. ${libdir}/grub/grub-mkconfig_lib + +devices=/boot/devices.hints +if ! test -e ${devices} ; then + # not FreeBSD + exit 0 +fi + +if test -e /boot/kernel/kernel ; then + kfreebsd=/boot/kernel/kernel +fi + +if [ "x$kfreebsd" != "x" ] ; then + echo "Found kernel of FreeBSD: $kfreebsd" >&2 + + kfreebsd_basename=`basename $kfreebsd` + kfreebsd_dirname=`dirname $kfreebsd` + kfreebsd_rel_dirname=`make_system_path_relative_to_its_root $kfreebsd_dirname` + + devices_basename=`basename $devices` + devices_dirname=`dirname $devices` + devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` + + root_device=`basename ${GRUB_DEVICE}` + + # For "ufs" it's the same. Do we care about the others? + kfreebsd_fs=${GRUB_FS} + + cat << EOF +menuentry "FreeBSD" { +EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + cat << EOF + freebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} + freebsd_loadenv ${devices_rel_dirname}/${devices_basename} + set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${root_device} +} +EOF +fi From 651c29b79e64eafbb26aa025424e51d2d3216d19 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Nov 2008 19:11:39 +0000 Subject: [PATCH 0436/1707] 2008-11-07 Robert Millan Modularize at_keyboard.mod: * conf/i386.rmk (pkglib_MODULES): Add `at_keyboard.mod'. (at_keyboard_mod_SOURCES, at_keyboard_mod_CFLAGS) (at_keyboard_mod_LDFLAGS): New variables. Actual terminal split: * include/grub/term.h (struct grub_term): Split in ... (struct grub_term_input): ... this, and ... (struct grub_term_output): ... this. Update all users. (grub_term_set_current): Split in ... (grub_term_set_current_input): ... this, and ... (grub_term_set_current_output): ... this. (grub_term_get_current): Split in ... (grub_term_get_current_input): ... this, and ... (grub_term_get_current_output): ... this. (grub_term_register): Split in ... (grub_term_register_input): ... this, and ... (grub_term_register_output): ... this. (grub_term_unregister): Split in ... (grub_term_unregister_input): ... this, and ... (grub_term_unregister_output): ... this. (grub_term_iterate): Split in ... (grub_term_iterate_input): ... this, and ... (grub_term_iterate_output): ... this. * kern/term.c (grub_term_list): Split in ... (grub_term_list_input): ... this, and ... (grub_term_list_output): ... this. Update all users. (grub_cur_term): Split in ... (grub_cur_term_input): ... this, and ... (grub_cur_term_output): ... this. Update all users. (grub_term_set_current): Split in ... (grub_term_set_current_input): ... this, and ... (grub_term_set_current_output): ... this. (grub_term_get_current): Split in ... (grub_term_get_current_input): ... this, and ... (grub_term_get_current_output): ... this. (grub_term_register): Split in ... (grub_term_register_input): ... this, and ... (grub_term_register_output): ... this. (grub_term_unregister): Split in ... (grub_term_unregister_input): ... this, and ... (grub_term_unregister_output): ... this. (grub_term_iterate): Split in ... (grub_term_iterate_input): ... this, and ... (grub_term_iterate_output): ... this. * kern/misc.c (grub_abort): Split use of grub_term_get_current() into a check for input and one for output (and only attempt to get keys from user when input works). * util/grub-probe.c (grub_term_get_current): Split in ... (grub_term_get_current_input): ... this, and ... (grub_term_get_current_output): ... this. * util/grub-fstest.c: Likewise. * util/i386/pc/grub-setup.c: Likewise. * util/grub-editenv.c: Likewise. Portability adjustments: * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Remove `term/i386/pc/at_keyboard.c'. * kern/ieee1275/init.c [__i386__] (grub_machine_init): Remove call to grub_keyboard_controller_init() (now handled by terminal .init). * kern/i386/coreboot/init.c (grub_machine_init): Add call to grub_at_keyboard_init(). * include/grub/i386/ieee1275/console.h (grub_keyboard_controller_init) (grub_console_checkkey, grub_console_getkey): Remove (now provided by at_keyboard.mod via input terminal interface). * include/grub/i386/coreboot/console.h: Convert into a stub for `'. Migrate full terminals to new API: * term/efi/console.c (grub_console_term): Split into ... (grub_console_term_input): ... this, and ... (grub_console_term_output): ... this. Update all users. * term/ieee1275/ofconsole.c: Remove __i386__ hack. (grub_ofconsole_init): Split into ... (grub_ofconsole_init_input): ... this, and ... (grub_ofconsole_init_output): ... this. (grub_ofconsole_term): Split into ... (grub_ofconsole_term_input): ... this, and ... (grub_ofconsole_term_output): ... this. Update all users. * term/i386/pc/serial.c (grub_serial_term): Split into ... (grub_serial_term_input): ... this, and ... (grub_serial_term_output): ... this. Update all users. * term/i386/pc/console.c (grub_console_term): Split into ... (grub_console_term_input): ... this, and ... (grub_console_term_output): ... this. Update all users. (grub_console_term_input): Only enable it on PC/BIOS platform. (grub_console_init): Remove grub_keyboard_controller_init() call. Migrate input terminals to new API: * term/i386/pc/at_keyboard.c: Replace `cpu' and `machine' with `i386' and `i386/pc' to enable build on x86_64 (this driver is i386-specific anyway). (grub_console_checkkey): Rename to ... (grub_at_keyboard_checkkey): ... this. Static-ize. Update all users. (grub_keyboard_controller_orig): New variable. (grub_console_getkey): Rename to ... (grub_at_keyboard_getkey): ... this. Static-ize. Update all users. (grub_keyboard_controller_init): Static-ize. Save original controller value so that it can be restored ... (grub_keyboard_controller_fini): ... here (new function). (grub_at_keyboard_term): New structure. (GRUB_MOD_INIT(at_keyboard), GRUB_MOD_FINI(at_keyboard)): New functions. Migrate output terminals to new API: * term/i386/pc/vga.c (grub_vga_term): Change type to `struct grub_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. * term/gfxterm.c (grub_video_term): Change type to `struct grub_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. * include/grub/i386/pc/console.h (grub_console_checkkey) (grub_console_getkey): Do not export (no longer needed by gfxterm, etc). Migrate `terminal' command and userland tools to new API: * commands/terminal.c (grub_cmd_terminal): Split into ... (grub_cmd_terminal_input): ... this, and ... (grub_cmd_terminal_output): ... this. (GRUB_MOD_INIT(terminal)): Split `terminal' command in two commands: `terminal_input' and `terminal_output'. * util/grub.d/00_header.in: Adjust `terminal' calls to new `terminal_input' / `terminal_output' API. * util/grub-mkconfig.in: Export ${GRUB_TERMINAL_INPUT} and ${GRUB_TERMINAL_OUTPUT} instead of ${GRUB_TERMINAL} (and if user provided ${GRUB_TERMINAL}, convert it). --- ChangeLog | 141 +++++++++++++++++++++++++++ commands/terminal.c | 78 ++++++++++++--- conf/i386-ieee1275.rmk | 2 +- conf/i386.rmk | 7 +- include/grub/i386/coreboot/console.h | 1 + include/grub/i386/ieee1275/console.h | 4 - include/grub/i386/pc/console.h | 4 +- include/grub/term.h | 49 +++++++--- kern/i386/coreboot/init.c | 1 + kern/ieee1275/init.c | 1 - kern/misc.c | 11 ++- kern/term.c | 131 +++++++++++++++++-------- term/efi/console.c | 23 +++-- term/gfxterm.c | 8 +- term/i386/pc/at_keyboard.c | 59 ++++++++--- term/i386/pc/console.c | 36 ++++--- term/i386/pc/serial.c | 25 +++-- term/i386/pc/vga.c | 9 +- term/ieee1275/ofconsole.c | 53 +++++----- util/console.c | 3 +- util/grub-editenv.c | 8 +- util/grub-fstest.c | 8 +- util/grub-mkconfig.in | 20 ++-- util/grub-probe.c | 10 +- util/grub.d/00_header.in | 43 +++++--- util/i386/pc/grub-setup.c | 10 +- 26 files changed, 555 insertions(+), 190 deletions(-) create mode 100644 include/grub/i386/coreboot/console.h diff --git a/ChangeLog b/ChangeLog index 889643932..481446c45 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,144 @@ +2008-11-07 Robert Millan + + Modularize at_keyboard.mod: + + * conf/i386.rmk (pkglib_MODULES): Add `at_keyboard.mod'. + (at_keyboard_mod_SOURCES, at_keyboard_mod_CFLAGS) + (at_keyboard_mod_LDFLAGS): New variables. + + Actual terminal split: + + * include/grub/term.h (struct grub_term): Split in ... + (struct grub_term_input): ... this, and ... + (struct grub_term_output): ... this. Update all users. + (grub_term_set_current): Split in ... + (grub_term_set_current_input): ... this, and ... + (grub_term_set_current_output): ... this. + (grub_term_get_current): Split in ... + (grub_term_get_current_input): ... this, and ... + (grub_term_get_current_output): ... this. + (grub_term_register): Split in ... + (grub_term_register_input): ... this, and ... + (grub_term_register_output): ... this. + (grub_term_unregister): Split in ... + (grub_term_unregister_input): ... this, and ... + (grub_term_unregister_output): ... this. + (grub_term_iterate): Split in ... + (grub_term_iterate_input): ... this, and ... + (grub_term_iterate_output): ... this. + + * kern/term.c (grub_term_list): Split in ... + (grub_term_list_input): ... this, and ... + (grub_term_list_output): ... this. Update all users. + (grub_cur_term): Split in ... + (grub_cur_term_input): ... this, and ... + (grub_cur_term_output): ... this. Update all users. + (grub_term_set_current): Split in ... + (grub_term_set_current_input): ... this, and ... + (grub_term_set_current_output): ... this. + (grub_term_get_current): Split in ... + (grub_term_get_current_input): ... this, and ... + (grub_term_get_current_output): ... this. + (grub_term_register): Split in ... + (grub_term_register_input): ... this, and ... + (grub_term_register_output): ... this. + (grub_term_unregister): Split in ... + (grub_term_unregister_input): ... this, and ... + (grub_term_unregister_output): ... this. + (grub_term_iterate): Split in ... + (grub_term_iterate_input): ... this, and ... + (grub_term_iterate_output): ... this. + + * kern/misc.c (grub_abort): Split use of grub_term_get_current() into + a check for input and one for output (and only attempt to get keys + from user when input works). + + * util/grub-probe.c (grub_term_get_current): Split in ... + (grub_term_get_current_input): ... this, and ... + (grub_term_get_current_output): ... this. + * util/grub-fstest.c: Likewise. + * util/i386/pc/grub-setup.c: Likewise. + * util/grub-editenv.c: Likewise. + + Portability adjustments: + + * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Remove + `term/i386/pc/at_keyboard.c'. + * kern/ieee1275/init.c [__i386__] (grub_machine_init): Remove call to + grub_keyboard_controller_init() (now handled by terminal .init). + * kern/i386/coreboot/init.c (grub_machine_init): Add call to + grub_at_keyboard_init(). + * include/grub/i386/ieee1275/console.h (grub_keyboard_controller_init) + (grub_console_checkkey, grub_console_getkey): Remove (now provided by + at_keyboard.mod via input terminal interface). + * include/grub/i386/coreboot/console.h: Convert into a stub for + `'. + + Migrate full terminals to new API: + + * term/efi/console.c (grub_console_term): Split into ... + (grub_console_term_input): ... this, and ... + (grub_console_term_output): ... this. Update all users. + * term/ieee1275/ofconsole.c: Remove __i386__ hack. + (grub_ofconsole_init): Split into ... + (grub_ofconsole_init_input): ... this, and ... + (grub_ofconsole_init_output): ... this. + (grub_ofconsole_term): Split into ... + (grub_ofconsole_term_input): ... this, and ... + (grub_ofconsole_term_output): ... this. Update all users. + * term/i386/pc/serial.c (grub_serial_term): Split into ... + (grub_serial_term_input): ... this, and ... + (grub_serial_term_output): ... this. Update all users. + * term/i386/pc/console.c (grub_console_term): Split into ... + (grub_console_term_input): ... this, and ... + (grub_console_term_output): ... this. Update all users. + (grub_console_term_input): Only enable it on PC/BIOS platform. + (grub_console_init): Remove grub_keyboard_controller_init() call. + + Migrate input terminals to new API: + + * term/i386/pc/at_keyboard.c: Replace `cpu' and `machine' with + `i386' and `i386/pc' to enable build on x86_64 (this driver is + i386-specific anyway). + (grub_console_checkkey): Rename to ... + (grub_at_keyboard_checkkey): ... this. Static-ize. Update all + users. + (grub_keyboard_controller_orig): New variable. + (grub_console_getkey): Rename to ... + (grub_at_keyboard_getkey): ... this. Static-ize. Update all + users. + (grub_keyboard_controller_init): Static-ize. Save original + controller value so that it can be restored ... + (grub_keyboard_controller_fini): ... here (new function). + (grub_at_keyboard_term): New structure. + (GRUB_MOD_INIT(at_keyboard), GRUB_MOD_FINI(at_keyboard)): New + functions. + + Migrate output terminals to new API: + + * term/i386/pc/vga.c (grub_vga_term): Change type to + `struct grub_term_output'. Remove `.checkkey' and `.getkey' + members. Update all users. + * term/gfxterm.c (grub_video_term): Change type to + `struct grub_term_output'. Remove `.checkkey' and `.getkey' + members. Update all users. + * include/grub/i386/pc/console.h (grub_console_checkkey) + (grub_console_getkey): Do not export (no longer needed by gfxterm, + etc). + + Migrate `terminal' command and userland tools to new API: + + * commands/terminal.c (grub_cmd_terminal): Split into ... + (grub_cmd_terminal_input): ... this, and ... + (grub_cmd_terminal_output): ... this. + (GRUB_MOD_INIT(terminal)): Split `terminal' command in two commands: + `terminal_input' and `terminal_output'. + * util/grub.d/00_header.in: Adjust `terminal' calls to new + `terminal_input' / `terminal_output' API. + * util/grub-mkconfig.in: Export ${GRUB_TERMINAL_INPUT} and + ${GRUB_TERMINAL_OUTPUT} instead of ${GRUB_TERMINAL} (and if user + provided ${GRUB_TERMINAL}, convert it). + 2008-11-04 Robert Millan * util/grub.d/10_freebsd.in: New file. Generate grub configuration diff --git a/commands/terminal.c b/commands/terminal.c index bd57b6f96..31c979d4c 100644 --- a/commands/terminal.c +++ b/commands/terminal.c @@ -24,21 +24,21 @@ #include static grub_err_t -grub_cmd_terminal (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) +grub_cmd_terminal_input (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) { - grub_term_t term = 0; + grub_term_input_t term = 0; - auto int print_terminal (grub_term_t); - auto int find_terminal (grub_term_t); + auto int print_terminal (grub_term_input_t); + auto int find_terminal (grub_term_input_t); - int print_terminal (grub_term_t t) + int print_terminal (grub_term_input_t t) { grub_printf (" %s", t->name); return 0; } - int find_terminal (grub_term_t t) + int find_terminal (grub_term_input_t t) { if (grub_strcmp (t->name, args[0]) == 0) { @@ -51,19 +51,65 @@ grub_cmd_terminal (struct grub_arg_list *state __attribute__ ((unused)), if (argc == 0) { - grub_printf ("Available terminal(s):"); - grub_term_iterate (print_terminal); + grub_printf ("Available input terminal(s):"); + grub_term_iterate_input (print_terminal); grub_putchar ('\n'); - grub_printf ("Current terminal: %s\n", grub_term_get_current ()->name); + grub_printf ("Current input terminal: %s\n", grub_term_get_current_input ()->name); } else { - grub_term_iterate (find_terminal); + grub_term_iterate_input (find_terminal); if (! term) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such terminal"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such input terminal"); - grub_term_set_current (term); + grub_term_set_current_input (term); + } + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_terminal_output (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + grub_term_output_t term = 0; + + auto int print_terminal (grub_term_output_t); + auto int find_terminal (grub_term_output_t); + + int print_terminal (grub_term_output_t t) + { + grub_printf (" %s", t->name); + return 0; + } + + int find_terminal (grub_term_output_t t) + { + if (grub_strcmp (t->name, args[0]) == 0) + { + term = t; + return 1; + } + + return 0; + } + + if (argc == 0) + { + grub_printf ("Available output terminal(s):"); + grub_term_iterate_output (print_terminal); + grub_putchar ('\n'); + + grub_printf ("Current output terminal: %s\n", grub_term_get_current_output ()->name); + } + else + { + grub_term_iterate_output (find_terminal); + if (! term) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such output terminal"); + + grub_term_set_current_output (term); } return GRUB_ERR_NONE; @@ -73,8 +119,10 @@ grub_cmd_terminal (struct grub_arg_list *state __attribute__ ((unused)), GRUB_MOD_INIT(terminal) { (void)mod; /* To stop warning. */ - grub_register_command ("terminal", grub_cmd_terminal, GRUB_COMMAND_FLAG_BOTH, - "terminal [TERM...]", "Select a terminal.", 0); + grub_register_command ("terminal_input", grub_cmd_terminal_input, GRUB_COMMAND_FLAG_BOTH, + "terminal_input [TERM...]", "Select an input terminal.", 0); + grub_register_command ("terminal_output", grub_cmd_terminal_output, GRUB_COMMAND_FLAG_BOTH, + "terminal_output [TERM...]", "Select an output terminal.", 0); } GRUB_MOD_FINI(terminal) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 2e27ca1da..bbd856640 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -22,7 +22,7 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/time.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ - term/ieee1275/ofconsole.c term/i386/pc/at_keyboard.c \ + term/ieee1275/ofconsole.c \ disk/ieee1275/ofdisk.c \ symlist.c kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \ diff --git a/conf/i386.rmk b/conf/i386.rmk index 458415b08..577d58f66 100644 --- a/conf/i386.rmk +++ b/conf/i386.rmk @@ -1,8 +1,11 @@ # -*- makefile -*- pkglib_MODULES += cpuid.mod - -# For cpuid.mod. cpuid_mod_SOURCES = commands/i386/cpuid.c cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += at_keyboard.mod +at_keyboard_mod_SOURCES = term/i386/pc/at_keyboard.c +at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) +at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/i386/coreboot/console.h b/include/grub/i386/coreboot/console.h new file mode 100644 index 000000000..305a46d8e --- /dev/null +++ b/include/grub/i386/coreboot/console.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/ieee1275/console.h b/include/grub/i386/ieee1275/console.h index ba1a9d295..854724ac1 100644 --- a/include/grub/i386/ieee1275/console.h +++ b/include/grub/i386/ieee1275/console.h @@ -21,10 +21,6 @@ #include -void EXPORT_FUNC(grub_keyboard_controller_init) (void); -int EXPORT_FUNC(grub_console_checkkey) (void); -int EXPORT_FUNC(grub_console_getkey) (void); - /* Initialize the console system. */ void grub_console_init (void); diff --git a/include/grub/i386/pc/console.h b/include/grub/i386/pc/console.h index 03ad42ba9..2b37db515 100644 --- a/include/grub/i386/pc/console.h +++ b/include/grub/i386/pc/console.h @@ -40,8 +40,8 @@ /* These are global to share code between C and asm. */ extern grub_uint8_t grub_console_cur_color; void grub_console_real_putchar (int c); -int EXPORT_FUNC(grub_console_checkkey) (void); -int EXPORT_FUNC(grub_console_getkey) (void); +int grub_console_checkkey (void); +int grub_console_getkey (void); grub_uint16_t grub_console_getxy (void); void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y); void grub_console_cls (void); diff --git a/include/grub/term.h b/include/grub/term.h index 3ffee425b..13835bbbb 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -137,7 +137,29 @@ grub_term_color_state; - 1) -struct grub_term +struct grub_term_input +{ + /* The terminal name. */ + const char *name; + + /* Initialize the terminal. */ + grub_err_t (*init) (void); + + /* Clean up the terminal. */ + grub_err_t (*fini) (void); + + /* Check if any input character is available. */ + int (*checkkey) (void); + + /* Get a character. */ + int (*getkey) (void); + + /* The next terminal. */ + struct grub_term_input *next; +}; +typedef struct grub_term_input *grub_term_input_t; + +struct grub_term_output { /* The terminal name. */ const char *name; @@ -155,12 +177,6 @@ struct grub_term encoded in Unicode. */ grub_ssize_t (*getcharwidth) (grub_uint32_t c); - /* Check if any input character is available. */ - int (*checkkey) (void); - - /* Get a character. */ - int (*getkey) (void); - /* Get the screen size. The return value is ((Width << 8) | Height). */ grub_uint16_t (*getwh) (void); @@ -194,16 +210,21 @@ struct grub_term grub_uint32_t flags; /* The next terminal. */ - struct grub_term *next; + struct grub_term_output *next; }; -typedef struct grub_term *grub_term_t; +typedef struct grub_term_output *grub_term_output_t; -void EXPORT_FUNC(grub_term_register) (grub_term_t term); -void EXPORT_FUNC(grub_term_unregister) (grub_term_t term); -void EXPORT_FUNC(grub_term_iterate) (int (*hook) (grub_term_t term)); +void EXPORT_FUNC(grub_term_register_input) (grub_term_input_t term); +void EXPORT_FUNC(grub_term_register_output) (grub_term_output_t term); +void EXPORT_FUNC(grub_term_unregister_input) (grub_term_input_t term); +void EXPORT_FUNC(grub_term_unregister_output) (grub_term_output_t term); +void EXPORT_FUNC(grub_term_iterate_input) (int (*hook) (grub_term_input_t term)); +void EXPORT_FUNC(grub_term_iterate_output) (int (*hook) (grub_term_output_t term)); -grub_err_t EXPORT_FUNC(grub_term_set_current) (grub_term_t term); -grub_term_t EXPORT_FUNC(grub_term_get_current) (void); +grub_err_t EXPORT_FUNC(grub_term_set_current_input) (grub_term_input_t term); +grub_err_t EXPORT_FUNC(grub_term_set_current_output) (grub_term_output_t term); +grub_term_input_t EXPORT_FUNC(grub_term_get_current_input) (void); +grub_term_output_t EXPORT_FUNC(grub_term_get_current_output) (void); void EXPORT_FUNC(grub_putchar) (int c); void EXPORT_FUNC(grub_putcode) (grub_uint32_t code); diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 6890e9053..051154765 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -138,6 +138,7 @@ grub_machine_init (void) grub_upper_mem -= GRUB_MEMORY_MACHINE_UPPER_START; grub_tsc_init (); + grub_at_keyboard_init (); } void diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index b07fe67f9..71b7ba9c6 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -217,7 +217,6 @@ grub_machine_init (void) grub_console_init (); #ifdef __i386__ grub_get_extended_memory (); - grub_keyboard_controller_init (); #endif grub_claim_heap (); grub_ofdisk_init (); diff --git a/kern/misc.c b/kern/misc.c index 635eb7227..5b1e65e4a 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -1026,10 +1026,15 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, const grub_uint8_t *src, void grub_abort (void) { - if (grub_term_get_current ()) + if (grub_term_get_current_output ()) { - grub_printf ("\nAborted. Press any key to exit."); - grub_getkey (); + grub_printf ("\nAborted."); + + if (grub_term_get_current_input ()) + { + grub_printf (" Press any key to exit."); + grub_getkey (); + } } grub_exit (); diff --git a/kern/term.c b/kern/term.c index 4c45d713d..24324c203 100644 --- a/kern/term.c +++ b/kern/term.c @@ -23,10 +23,12 @@ #include /* The list of terminals. */ -static grub_term_t grub_term_list; +static grub_term_input_t grub_term_list_input; +static grub_term_output_t grub_term_list_output; /* The current terminal. */ -static grub_term_t grub_cur_term; +static grub_term_input_t grub_cur_term_input; +static grub_term_output_t grub_cur_term_output; /* The amount of lines counted by the pager. */ static int grub_more_lines; @@ -38,18 +40,25 @@ static int grub_more; static int cursor_state = 1; void -grub_term_register (grub_term_t term) +grub_term_register_input (grub_term_input_t term) { - term->next = grub_term_list; - grub_term_list = term; + term->next = grub_term_list_input; + grub_term_list_input = term; } void -grub_term_unregister (grub_term_t term) +grub_term_register_output (grub_term_output_t term) { - grub_term_t *p, q; + term->next = grub_term_list_output; + grub_term_list_output = term; +} + +void +grub_term_unregister_input (grub_term_input_t term) +{ + grub_term_input_t *p, q; - for (p = &grub_term_list, q = *p; q; p = &(q->next), q = q->next) + for (p = &grub_term_list_input, q = *p; q; p = &(q->next), q = q->next) if (q == term) { *p = q->next; @@ -58,36 +67,78 @@ grub_term_unregister (grub_term_t term) } void -grub_term_iterate (int (*hook) (grub_term_t term)) +grub_term_unregister_output (grub_term_output_t term) { - grub_term_t p; + grub_term_output_t *p, q; - for (p = grub_term_list; p; p = p->next) + for (p = &grub_term_list_output, q = *p; q; p = &(q->next), q = q->next) + if (q == term) + { + *p = q->next; + break; + } +} + +void +grub_term_iterate_input (int (*hook) (grub_term_input_t term)) +{ + grub_term_input_t p; + + for (p = grub_term_list_input; p; p = p->next) + if (hook (p)) + break; +} + +void +grub_term_iterate_output (int (*hook) (grub_term_output_t term)) +{ + grub_term_output_t p; + + for (p = grub_term_list_output; p; p = p->next) if (hook (p)) break; } grub_err_t -grub_term_set_current (grub_term_t term) +grub_term_set_current_input (grub_term_input_t term) { - if (grub_cur_term && grub_cur_term->fini) - if ((grub_cur_term->fini) () != GRUB_ERR_NONE) + if (grub_cur_term_input && grub_cur_term_input->fini) + if ((grub_cur_term_input->fini) () != GRUB_ERR_NONE) return grub_errno; if (term->init) if ((term->init) () != GRUB_ERR_NONE) return grub_errno; - grub_cur_term = term; - grub_cls (); - grub_setcursor (grub_getcursor ()); + grub_cur_term_input = term; return GRUB_ERR_NONE; } -grub_term_t -grub_term_get_current (void) +grub_err_t +grub_term_set_current_output (grub_term_output_t term) { - return grub_cur_term; + if (grub_cur_term_output && grub_cur_term_output->fini) + if ((grub_cur_term_output->fini) () != GRUB_ERR_NONE) + return grub_errno; + + if (term->init) + if ((term->init) () != GRUB_ERR_NONE) + return grub_errno; + + grub_cur_term_output = term; + return GRUB_ERR_NONE; +} + +grub_term_input_t +grub_term_get_current_input (void) +{ + return grub_cur_term_input; +} + +grub_term_output_t +grub_term_get_current_output (void) +{ + return grub_cur_term_output; } /* Put a Unicode character. */ @@ -96,7 +147,7 @@ grub_putcode (grub_uint32_t code) { int height = grub_getwh () & 255; - if (code == '\t' && grub_cur_term->getxy) + if (code == '\t' && grub_cur_term_output->getxy) { int n; @@ -107,7 +158,7 @@ grub_putcode (grub_uint32_t code) return; } - (grub_cur_term->putchar) (code); + (grub_cur_term_output->putchar) (code); if (code == '\n') { @@ -171,70 +222,70 @@ grub_putchar (int c) grub_ssize_t grub_getcharwidth (grub_uint32_t code) { - return (grub_cur_term->getcharwidth) (code); + return (grub_cur_term_output->getcharwidth) (code); } int grub_getkey (void) { - return (grub_cur_term->getkey) (); + return (grub_cur_term_input->getkey) (); } int grub_checkkey (void) { - return (grub_cur_term->checkkey) (); + return (grub_cur_term_input->checkkey) (); } grub_uint16_t grub_getxy (void) { - return (grub_cur_term->getxy) (); + return (grub_cur_term_output->getxy) (); } grub_uint16_t grub_getwh (void) { - return (grub_cur_term->getwh) (); + return (grub_cur_term_output->getwh) (); } void grub_gotoxy (grub_uint8_t x, grub_uint8_t y) { - (grub_cur_term->gotoxy) (x, y); + (grub_cur_term_output->gotoxy) (x, y); } void grub_cls (void) { - if ((grub_cur_term->flags & GRUB_TERM_DUMB) || (grub_env_get ("debug"))) + if ((grub_cur_term_output->flags & GRUB_TERM_DUMB) || (grub_env_get ("debug"))) { grub_putchar ('\n'); grub_refresh (); } else - (grub_cur_term->cls) (); + (grub_cur_term_output->cls) (); } void grub_setcolorstate (grub_term_color_state state) { - if (grub_cur_term->setcolorstate) - (grub_cur_term->setcolorstate) (state); + if (grub_cur_term_output->setcolorstate) + (grub_cur_term_output->setcolorstate) (state); } void grub_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color) { - if (grub_cur_term->setcolor) - (grub_cur_term->setcolor) (normal_color, highlight_color); + if (grub_cur_term_output->setcolor) + (grub_cur_term_output->setcolor) (normal_color, highlight_color); } void grub_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color) { - if (grub_cur_term->getcolor) - (grub_cur_term->getcolor) (normal_color, highlight_color); + if (grub_cur_term_output->getcolor) + (grub_cur_term_output->getcolor) (normal_color, highlight_color); } int @@ -242,9 +293,9 @@ grub_setcursor (int on) { int ret = cursor_state; - if (grub_cur_term->setcursor) + if (grub_cur_term_output->setcursor) { - (grub_cur_term->setcursor) (on); + (grub_cur_term_output->setcursor) (on); cursor_state = on; } @@ -260,8 +311,8 @@ grub_getcursor (void) void grub_refresh (void) { - if (grub_cur_term->refresh) - (grub_cur_term->refresh) (); + if (grub_cur_term_output->refresh) + (grub_cur_term_output->refresh) (); } void diff --git a/term/efi/console.c b/term/efi/console.c index f3b62a58b..33d404f26 100644 --- a/term/efi/console.c +++ b/term/efi/console.c @@ -332,15 +332,18 @@ grub_console_setcursor (int on) efi_call_2 (o->enable_cursor, o, on); } -static struct grub_term grub_console_term = +static struct grub_term_input grub_console_term_input = { .name = "console", - .init = 0, - .fini = 0, - .putchar = grub_console_putchar, - .getcharwidth = grub_console_getcharwidth, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + }; + +static struct grub_term_output grub_console_term_output = + { + .name = "console", + .putchar = grub_console_putchar, + .getcharwidth = grub_console_getcharwidth, .getwh = grub_console_getwh, .getxy = grub_console_getxy, .gotoxy = grub_console_gotoxy, @@ -350,7 +353,6 @@ static struct grub_term grub_console_term = .getcolor = grub_console_getcolor, .setcursor = grub_console_setcursor, .flags = 0, - .next = 0 }; void @@ -364,12 +366,15 @@ grub_console_init (void) return; } - grub_term_register (&grub_console_term); - grub_term_set_current (&grub_console_term); + grub_term_register_input (&grub_console_term_input); + grub_term_register_output (&grub_console_term_output); + grub_term_set_current_output (&grub_console_term_output); + grub_term_set_current_input (&grub_console_term_input); } void grub_console_fini (void) { - grub_term_unregister (&grub_console_term); + grub_term_unregister_input (&grub_console_term_input); + grub_term_unregister_output (&grub_console_term_output); } diff --git a/term/gfxterm.c b/term/gfxterm.c index 8efcd91a2..c4377929c 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -1056,15 +1056,13 @@ grub_gfxterm_background_image_cmd (struct grub_arg_list *state __attribute__ ((u return grub_errno; } -static struct grub_term grub_video_term = +static struct grub_term_output grub_video_term = { .name = "gfxterm", .init = grub_gfxterm_init, .fini = grub_gfxterm_fini, .putchar = grub_gfxterm_putchar, .getcharwidth = grub_gfxterm_getcharwidth, - .checkkey = grub_console_checkkey, - .getkey = grub_console_getkey, .getwh = grub_virtual_screen_getwh, .getxy = grub_virtual_screen_getxy, .gotoxy = grub_gfxterm_gotoxy, @@ -1081,7 +1079,7 @@ static struct grub_term grub_video_term = GRUB_MOD_INIT(term_gfxterm) { my_mod = mod; - grub_term_register (&grub_video_term); + grub_term_register_output (&grub_video_term); grub_register_command ("background_image", grub_gfxterm_background_image_cmd, @@ -1094,5 +1092,5 @@ GRUB_MOD_INIT(term_gfxterm) GRUB_MOD_FINI(term_gfxterm) { grub_unregister_command ("bgimage"); - grub_term_unregister (&grub_video_term); + grub_term_unregister_output (&grub_video_term); } diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index c9bbd836c..c674ef312 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -16,9 +16,10 @@ * along with GRUB. If not, see . */ -#include -#include -#include +#include +#include +#include +#include #include #include @@ -61,6 +62,8 @@ static char keyboard_map_shift[128] = 'B', 'N', 'M', '<', '>', '?' }; +static grub_uint8_t grub_keyboard_controller_orig; + static void grub_keyboard_controller_write (grub_uint8_t c) { @@ -77,12 +80,6 @@ grub_keyboard_controller_read (void) return grub_inb (KEYBOARD_REG_DATA); } -void -grub_keyboard_controller_init (void) -{ - grub_keyboard_controller_write (grub_keyboard_controller_read () | KEYBOARD_SCANCODE_SET1); -} - /* FIXME: This should become an interrupt service routine. For now it's just used to catch events from control keys. */ static void @@ -148,8 +145,8 @@ grub_keyboard_getkey (void) } /* If there is a character pending, return it; otherwise return -1. */ -int -grub_console_checkkey (void) +static int +grub_at_keyboard_checkkey (void) { int code, key; code = grub_keyboard_getkey (); @@ -192,13 +189,47 @@ grub_console_checkkey (void) return (int) key; } -int -grub_console_getkey (void) +static int +grub_at_keyboard_getkey (void) { int key; do { - key = grub_console_checkkey (); + key = grub_at_keyboard_checkkey (); } while (key == -1); return key; } + +static grub_err_t +grub_keyboard_controller_init (void) +{ + grub_keyboard_controller_orig = grub_keyboard_controller_read (); + grub_keyboard_controller_write (grub_keyboard_controller_orig | KEYBOARD_SCANCODE_SET1); + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_keyboard_controller_fini (void) +{ + grub_keyboard_controller_write (grub_keyboard_controller_orig); + return GRUB_ERR_NONE; +} + +static struct grub_term_input grub_at_keyboard_term = + { + .name = "at_keyboard", + .init = grub_keyboard_controller_init, + .fini = grub_keyboard_controller_fini, + .checkkey = grub_at_keyboard_checkkey, + .getkey = grub_at_keyboard_getkey, + }; + +GRUB_MOD_INIT(at_keyboard) +{ + grub_term_register_input (&grub_at_keyboard_term); +} + +GRUB_MOD_FINI(at_keyboard) +{ + grub_term_unregister_output (&grub_at_keyboard_term); +} diff --git a/term/i386/pc/console.c b/term/i386/pc/console.c index 1d199e927..6105ac7d8 100644 --- a/term/i386/pc/console.c +++ b/term/i386/pc/console.c @@ -125,15 +125,22 @@ grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color *highlight_color = grub_console_highlight_color; } -static struct grub_term grub_console_term = +/* On non-BIOS platforms, console.c is used in combination with vga_text.c + (only to handle output). */ +#ifdef GRUB_MACHINE_PCBIOS +static struct grub_term_input grub_console_term_input = { .name = "console", - .init = 0, - .fini = 0, - .putchar = grub_console_putchar, - .getcharwidth = grub_console_getcharwidth, .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + }; +#endif + +static struct grub_term_output grub_console_term_output = + { + .name = "console", + .putchar = grub_console_putchar, + .getcharwidth = grub_console_getcharwidth, .getwh = grub_console_getwh, .getxy = grub_console_getxy, .gotoxy = grub_console_gotoxy, @@ -143,23 +150,26 @@ static struct grub_term grub_console_term = .getcolor = grub_console_getcolor, .setcursor = grub_console_setcursor, .flags = 0, - .next = 0 }; void grub_console_init (void) { - grub_term_register (&grub_console_term); - grub_term_set_current (&grub_console_term); - -#ifdef GRUB_MACHINE_LINUXBIOS - grub_keyboard_controller_init (); + grub_term_register_output (&grub_console_term_output); + grub_term_set_current_output (&grub_console_term_output); +#ifdef GRUB_MACHINE_PCBIOS + grub_term_register_input (&grub_console_term_input); + grub_term_set_current_input (&grub_console_term_input); #endif } void grub_console_fini (void) { - grub_term_set_current (&grub_console_term); - grub_term_unregister (&grub_console_term); + grub_term_set_current_output (&grub_console_term_output); +#ifdef GRUB_MACHINE_PCBIOS + grub_term_set_current_input (&grub_console_term_input); + grub_term_unregister_input (&grub_console_term_input); +#endif + grub_term_unregister_output (&grub_console_term_output); } diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 2d76ec1f8..612492206 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -467,15 +467,18 @@ grub_serial_setcursor (const int on) grub_terminfo_cursor_off (); } -static struct grub_term grub_serial_term = +static struct grub_term_input grub_serial_term_input = { .name = "serial", - .init = 0, - .fini = 0, - .putchar = grub_serial_putchar, - .getcharwidth = grub_serial_getcharwidth, .checkkey = grub_serial_checkkey, .getkey = grub_serial_getkey, +}; + +static struct grub_term_output grub_serial_term_output = +{ + .name = "serial", + .putchar = grub_serial_putchar, + .getcharwidth = grub_serial_getcharwidth, .getwh = grub_serial_getwh, .getxy = grub_serial_getxy, .gotoxy = grub_serial_gotoxy, @@ -483,7 +486,6 @@ static struct grub_term grub_serial_term = .setcolorstate = grub_serial_setcolorstate, .setcursor = grub_serial_setcursor, .flags = 0, - .next = 0 }; @@ -575,7 +577,8 @@ grub_cmd_serial (struct grub_arg_list *state, /* Register terminal if not yet registered. */ if (registered == 0) { - grub_term_register (&grub_serial_term); + grub_term_register_input (&grub_serial_term_input); + grub_term_register_output (&grub_serial_term_output); registered = 1; } } @@ -590,7 +593,8 @@ grub_cmd_serial (struct grub_arg_list *state, if (serial_hw_init () != GRUB_ERR_NONE) { /* If unable to restore settings, unregister terminal. */ - grub_term_unregister (&grub_serial_term); + grub_term_unregister_input (&grub_serial_term_input); + grub_term_unregister_output (&grub_serial_term_output); registered = 0; } } @@ -616,5 +620,8 @@ GRUB_MOD_FINI(serial) { grub_unregister_command ("serial"); if (registered == 1) /* Unregister terminal only if registered. */ - grub_term_unregister (&grub_serial_term); + { + grub_term_unregister_input (&grub_serial_term_input); + grub_term_unregister_output (&grub_serial_term_output); + } } diff --git a/term/i386/pc/vga.c b/term/i386/pc/vga.c index ebcc54d1d..7143745cc 100644 --- a/term/i386/pc/vga.c +++ b/term/i386/pc/vga.c @@ -473,15 +473,13 @@ grub_vga_setcursor (int on) } } -static struct grub_term grub_vga_term = +static struct grub_term_output grub_vga_term = { .name = "vga", .init = grub_vga_mod_init, .fini = grub_vga_mod_fini, .putchar = grub_vga_putchar, .getcharwidth = grub_vga_getcharwidth, - .checkkey = grub_console_checkkey, - .getkey = grub_console_getkey, .getwh = grub_vga_getwh, .getxy = grub_vga_getxy, .gotoxy = grub_vga_gotoxy, @@ -489,7 +487,6 @@ static struct grub_term grub_vga_term = .setcolorstate = grub_vga_setcolorstate, .setcursor = grub_vga_setcursor, .flags = 0, - .next = 0 }; GRUB_MOD_INIT(vga) @@ -497,10 +494,10 @@ GRUB_MOD_INIT(vga) #ifndef GRUB_UTIL my_mod = mod; #endif - grub_term_register (&grub_vga_term); + grub_term_register_output (&grub_vga_term); } GRUB_MOD_FINI(vga) { - grub_term_unregister (&grub_vga_term); + grub_term_unregister_output (&grub_vga_term); } diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index faa104926..ec35a13ea 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -33,10 +33,8 @@ static grub_uint8_t grub_ofconsole_height; static int grub_curr_x; static int grub_curr_y; -#ifndef __i386__ static int grub_keybuf; static int grub_buflen; -#endif struct color { @@ -144,7 +142,6 @@ grub_ofconsole_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_col *highlight_color = grub_ofconsole_highlight_color; } -#ifndef __i386__ static int grub_ofconsole_readkey (int *key) { @@ -342,7 +339,20 @@ grub_ofconsole_refresh (void) } static grub_err_t -grub_ofconsole_init (void) +grub_ofconsole_init_input (void) +{ + grub_ssize_t actual; + + if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdin", &stdin_ihandle, + sizeof stdin_ihandle, &actual) + || actual != sizeof stdin_ihandle) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdin"); + + return 0; +} + +static grub_err_t +grub_ofconsole_init_output (void) { grub_ssize_t actual; int col; @@ -358,11 +368,6 @@ grub_ofconsole_init (void) || actual != sizeof stdout_ihandle) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdout"); - if (grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "stdin", &stdin_ihandle, - sizeof stdin_ihandle, &actual) - || actual != sizeof stdin_ihandle) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Cannot find stdin"); - /* Initialize colors. */ if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_SET_COLORS)) { @@ -385,20 +390,22 @@ grub_ofconsole_fini (void) -static struct grub_term grub_ofconsole_term = +static struct grub_term_input grub_ofconsole_term_input = { .name = "ofconsole", - .init = grub_ofconsole_init, + .init = grub_ofconsole_init_input, + .fini = grub_ofconsole_fini, + .checkkey = grub_ofconsole_checkkey, + .getkey = grub_ofconsole_getkey, + }; + +static struct grub_term_output grub_ofconsole_term_output = + { + .name = "ofconsole", + .init = grub_ofconsole_init_output, .fini = grub_ofconsole_fini, .putchar = grub_ofconsole_putchar, .getcharwidth = grub_ofconsole_getcharwidth, -#ifdef __i386__ - .checkkey = grub_console_checkkey, - .getkey = grub_console_getkey, -#else - .checkkey = grub_ofconsole_checkkey, - .getkey = grub_ofconsole_getkey, -#endif .getxy = grub_ofconsole_getxy, .getwh = grub_ofconsole_getwh, .gotoxy = grub_ofconsole_gotoxy, @@ -409,18 +416,20 @@ static struct grub_term grub_ofconsole_term = .setcursor = grub_ofconsole_setcursor, .refresh = grub_ofconsole_refresh, .flags = 0, - .next = 0 }; void grub_console_init (void) { - grub_term_register (&grub_ofconsole_term); - grub_term_set_current (&grub_ofconsole_term); + grub_term_register_input (&grub_ofconsole_term_input); + grub_term_register_output (&grub_ofconsole_term_output); + grub_term_set_current_output (&grub_ofconsole_term_output); + grub_term_set_current_input (&grub_ofconsole_term_input); } void grub_console_fini (void) { - grub_term_unregister (&grub_ofconsole_term); + grub_term_unregister_input (&grub_ofconsole_term_input); + grub_term_unregister_output (&grub_ofconsole_term_output); } diff --git a/util/console.c b/util/console.c index 01eb55758..30f184e91 100644 --- a/util/console.c +++ b/util/console.c @@ -371,7 +371,8 @@ void grub_console_init (void) { grub_term_register (&grub_ncurses_term); - grub_term_set_current (&grub_ncurses_term); + grub_term_set_current_input (&grub_ncurses_term); + grub_term_set_current_output (&grub_ncurses_term); } void diff --git a/util/grub-editenv.c b/util/grub-editenv.c index f53a9bb7b..68caf4263 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -41,7 +41,13 @@ grub_refresh (void) } void * -grub_term_get_current (void) +grub_term_get_current_input (void) +{ + return 0; +} + +void * +grub_term_get_current_output (void) { return 0; } diff --git a/util/grub-fstest.c b/util/grub-fstest.c index fc259f2ee..b622f8491 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -54,7 +54,13 @@ grub_getkey (void) } grub_term_t -grub_term_get_current (void) +grub_term_get_current_input (void) +{ + return 0; +} + +grub_term_t +grub_term_get_current_output (void) { return 0; } diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index f7cf0d1f0..2d7510f83 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -130,31 +130,37 @@ if test -f ${sysconfdir}/default/grub ; then . ${sysconfdir}/default/grub fi -case x${GRUB_TERMINAL} in +# XXX: should this be deprecated at some point? +if [ "x${GRUB_TERMINAL}" != "x" ] ; then + GRUB_TERMINAL_INPUT="${GRUB_TERMINAL}" + GRUB_TERMINAL_OUTPUT="${GRUB_TERMINAL}" +fi + +case x${GRUB_TERMINAL_OUTPUT} in x) # If this platform supports gfxterm, try to use it. if test -e ${grub_prefix}/gfxterm.mod ; then - GRUB_TERMINAL=gfxterm + GRUB_TERMINAL_OUTPUT=gfxterm fi ;; xconsole | xserial | xofconsole | xgfxterm) ;; - *) echo "Invalid terminal \"${GRUB_TERMINAL}\"" >&2 ; exit 1 ;; + *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;; esac # check for terminals that require fonts -case ${GRUB_TERMINAL} in +case ${GRUB_TERMINAL_OUTPUT} in gfxterm) if path=`font_path` ; then GRUB_FONT_PATH="${path}" else # fallback to the native terminal for this platform - unset GRUB_TERMINAL + unset GRUB_TERMINAL_OUTPUT fi ;; esac # does our terminal support utf-8 ? -case ${GRUB_TERMINAL} in +case ${GRUB_TERMINAL_OUTPUT} in gfxterm) ;; *) # make sure all our children behave in conformance with ascii.. @@ -167,7 +173,7 @@ esac export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES # These are optional, user-defined variables. -export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE +export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE if test "x${grub_cfg}" != "x"; then rm -f ${grub_cfg}.new diff --git a/util/grub-probe.c b/util/grub-probe.c index 4681cf72d..402b75839 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -66,8 +66,14 @@ grub_getkey (void) return -1; } -grub_term_t -grub_term_get_current (void) +grub_term_input_t +grub_term_get_current_input (void) +{ + return 0; +} + +grub_term_output_t +grub_term_get_current_output (void) { return 0; } diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index a8e2902b1..a0b314b32 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -40,8 +40,31 @@ set default=${GRUB_DEFAULT} set timeout=${GRUB_TIMEOUT} EOF -case x${GRUB_TERMINAL} in - xgfxterm) +case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in + serial:* | *: serial) + if ! test -e ${grub_prefix}/serial.mod ; then + echo "Serial terminal not available on this platform." >&2 ; exit 1 + fi + + if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then + echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." >&2 + GRUB_SERIAL_COMMAND=serial + fi + echo "${GRUB_SERIAL_COMMAND}" + ;; +esac + +case x${GRUB_TERMINAL_INPUT} in + x) + # Just use the native terminal + ;; + x*) + echo "terminal_input ${GRUB_TERMINAL_INPUT}" + ;; +esac + +case x${GRUB_TERMINAL_OUTPUT} in + xgfxterm) # Make the font accessible prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}` @@ -62,26 +85,14 @@ if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then set gfxmode=${GRUB_GFXMODE} insmod gfxterm insmod ${video_backend} - terminal gfxterm + terminal_output gfxterm fi EOF ;; - xserial) - if ! test -e ${grub_prefix}/serial.mod ; then - echo "Serial terminal not available on this platform." >&2 ; exit 1 - fi - - if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then - echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." >&2 - GRUB_SERIAL_COMMAND=serial - fi - echo "${GRUB_SERIAL_COMMAND}" - echo "terminal serial" - ;; x) # Just use the native terminal ;; x*) - echo "terminal ${GRUB_TERMINAL}" + echo "terminal_output ${GRUB_TERMINAL_OUTPUT}" ;; esac diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 39fd825f5..ccbb46536 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -74,8 +74,14 @@ grub_getkey (void) return -1; } -grub_term_t -grub_term_get_current (void) +grub_term_input_t +grub_term_get_current_input (void) +{ + return 0; +} + +grub_term_output_t +grub_term_get_current_output (void) { return 0; } From 9f3af64471f1b3342b0cc7b46f8a3663f2c8cacf Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Nov 2008 19:12:11 +0000 Subject: [PATCH 0437/1707] run autogen.sh ... --- conf/i386-ieee1275.mk | 14 ++++------ conf/i386.mk | 59 +++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 62 insertions(+), 11 deletions(-) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 541f698fc..2d981d045 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -23,14 +23,14 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/time.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ - term/ieee1275/ofconsole.c term/i386/pc/at_keyboard.c \ + term/ieee1275/ofconsole.c \ disk/ieee1275/ofdisk.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -132,10 +132,6 @@ kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_ieee1275_ofconsole.d -kernel_elf-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_i386_pc_at_keyboard.d - kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-disk_ieee1275_ofdisk.d diff --git a/conf/i386.mk b/conf/i386.mk index 47f59b9ac..6f528b7b7 100644 --- a/conf/i386.mk +++ b/conf/i386.mk @@ -2,8 +2,6 @@ # Generated by genmk.rb, please don't edit! pkglib_MODULES += cpuid.mod - -# For cpuid.mod. cpuid_mod_SOURCES = commands/i386/cpuid.c CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst ifneq ($(cpuid_mod_EXPORTS),no) @@ -59,3 +57,60 @@ partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386 cpuid_mod_CFLAGS = $(COMMON_CFLAGS) cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += at_keyboard.mod +at_keyboard_mod_SOURCES = term/i386/pc/at_keyboard.c +CLEANFILES += at_keyboard.mod mod-at_keyboard.o mod-at_keyboard.c pre-at_keyboard.o at_keyboard_mod-term_i386_pc_at_keyboard.o und-at_keyboard.lst +ifneq ($(at_keyboard_mod_EXPORTS),no) +CLEANFILES += def-at_keyboard.lst +DEFSYMFILES += def-at_keyboard.lst +endif +MOSTLYCLEANFILES += at_keyboard_mod-term_i386_pc_at_keyboard.d +UNDSYMFILES += und-at_keyboard.lst + +at_keyboard.mod: pre-at_keyboard.o mod-at_keyboard.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(at_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-at_keyboard.o mod-at_keyboard.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-at_keyboard.o: $(at_keyboard_mod_DEPENDENCIES) at_keyboard_mod-term_i386_pc_at_keyboard.o + -rm -f $@ + $(TARGET_CC) $(at_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ at_keyboard_mod-term_i386_pc_at_keyboard.o + +mod-at_keyboard.o: mod-at_keyboard.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -c -o $@ $< + +mod-at_keyboard.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'at_keyboard' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(at_keyboard_mod_EXPORTS),no) +def-at_keyboard.lst: pre-at_keyboard.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 at_keyboard/' > $@ +endif + +und-at_keyboard.lst: pre-at_keyboard.o + echo 'at_keyboard' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +at_keyboard_mod-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) + $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -MD -c -o $@ $< +-include at_keyboard_mod-term_i386_pc_at_keyboard.d + +CLEANFILES += cmd-at_keyboard_mod-term_i386_pc_at_keyboard.lst fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst +COMMANDFILES += cmd-at_keyboard_mod-term_i386_pc_at_keyboard.lst +FSFILES += fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst +PARTMAPFILES += partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst + +cmd-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh at_keyboard > $@ || (rm -f $@; exit 1) + +fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh at_keyboard > $@ || (rm -f $@; exit 1) + +partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh at_keyboard > $@ || (rm -f $@; exit 1) + + +at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) +at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) From c32ee8c9a88e94168bcb9d8dc3f6b1a7d5277ab2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Nov 2008 19:53:25 +0000 Subject: [PATCH 0438/1707] 2008-11-07 Robert Millan * include/multiboot2.h (struct multiboot_header): Add `flags' member as per specification. * loader/multiboot2.c (grub_multiboot2): Fix Multiboot2 header check. * loader/multiboot_loader.c (find_multi_boot2_header): New function (based on find_multi_boot1_header). (grub_rescue_cmd_multiboot_loader): Check for Multiboot2 header, using find_multi_boot2_header(), and abort if neither Multiboot or Multiboot headers were found. --- ChangeLog | 11 +++++++++++ include/multiboot2.h | 1 + loader/multiboot2.c | 4 ++-- loader/multiboot_loader.c | 40 ++++++++++++++++++++++++++++++++------- 4 files changed, 47 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 481446c45..c00a0026e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2008-11-07 Robert Millan + + * include/multiboot2.h (struct multiboot_header): Add `flags' member as + per specification. + * loader/multiboot2.c (grub_multiboot2): Fix Multiboot2 header check. + * loader/multiboot_loader.c (find_multi_boot2_header): New function + (based on find_multi_boot1_header). + (grub_rescue_cmd_multiboot_loader): Check for Multiboot2 header, + using find_multi_boot2_header(), and abort if neither Multiboot or + Multiboot headers were found. + 2008-11-07 Robert Millan Modularize at_keyboard.mod: diff --git a/include/multiboot2.h b/include/multiboot2.h index f720dc3ea..0f2b0cf2d 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -46,6 +46,7 @@ typedef uint32_t multiboot_word; struct multiboot_header { uint32_t magic; + uint32_t flags; }; struct multiboot_tag_header diff --git a/loader/multiboot2.c b/loader/multiboot2.c index 42c6fadfe..2fb56bfdf 100644 --- a/loader/multiboot2.c +++ b/loader/multiboot2.c @@ -342,8 +342,8 @@ grub_multiboot2 (int argc, char *argv[]) } /* Look for the multiboot header in the buffer. The header should - be at least 12 bytes and aligned on a 4-byte boundary. */ - for (p = buffer; p <= buffer + len - 12; p += 4) + be at least 8 bytes and aligned on a 8-byte boundary. */ + for (p = buffer; p <= buffer + len - 8; p += 8) { header = (struct multiboot_header *) p; if (header->magic == MULTIBOOT2_HEADER_MAGIC) diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index d56b42c20..53971dfea 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -71,6 +71,34 @@ find_multi_boot1_header (grub_file_t file) return found_status; } +static int +find_multi_boot2_header (grub_file_t file) +{ + struct multiboot_header *header; + char buffer[MULTIBOOT_SEARCH]; + int found_status = 0; + grub_ssize_t len; + + len = grub_file_read (file, buffer, MULTIBOOT_SEARCH); + if (len < 32) + return found_status; + + /* Look for the multiboot header in the buffer. The header should + be at least 8 bytes and aligned on a 8-byte boundary. */ + for (header = (struct multiboot_header *) buffer; + ((char *) header <= buffer + len - 8) || (header = 0); + header = (struct multiboot_header *) ((char *) header + 8)) + { + if (header->magic == MULTIBOOT2_HEADER_MAGIC) + { + found_status = 1; + break; + } + } + + return found_status; +} + void grub_rescue_cmd_multiboot_loader (int argc, char *argv[]) { @@ -94,16 +122,14 @@ grub_rescue_cmd_multiboot_loader (int argc, char *argv[]) } /* find which header is in the file */ - if (find_multi_boot1_header(file)) + if (find_multi_boot1_header (file)) header_multi_ver_found = 1; + else if (find_multi_boot2_header (file)) + header_multi_ver_found = 2; else { - /* The behavior is that if you don't find a multiboot 1 header - use multiboot 2 loader (as you do not have to have a header - to use multiboot 2 */ - grub_dprintf ("multiboot_loader", "No multiboot 1 header found. \n \ - Using multiboot 2 loader\n"); - header_multi_ver_found = 0; + grub_error (GRUB_ERR_BAD_OS, "Multiboot header not found"); + goto fail; } /* close file before calling functions */ From b6c15a2d2abd950f8121d5b6bc38a75c03006002 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 7 Nov 2008 22:30:24 +0000 Subject: [PATCH 0439/1707] 2008-11-07 Pavel Roskin * util/grub.d/00_header.in: Remove incorrect space before "serial". --- ChangeLog | 5 +++++ util/grub.d/00_header.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c00a0026e..56df59395 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-07 Pavel Roskin + + * util/grub.d/00_header.in: Remove incorrect space before + "serial". + 2008-11-07 Robert Millan * include/multiboot2.h (struct multiboot_header): Add `flags' member as diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index a0b314b32..8967fd68d 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -41,7 +41,7 @@ set timeout=${GRUB_TIMEOUT} EOF case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in - serial:* | *: serial) + serial:* | *:serial) if ! test -e ${grub_prefix}/serial.mod ; then echo "Serial terminal not available on this platform." >&2 ; exit 1 fi From d99d46f105dd96d83b5ae2aba89490645bae6922 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 7 Nov 2008 22:33:37 +0000 Subject: [PATCH 0440/1707] 2008-11-07 Pavel Roskin * gendistlist.sh: Use C locale for sorting to ensure consistent output on all systems. --- ChangeLog | 3 +++ DISTLIST | 34 +++++++++++++++++----------------- gendistlist.sh | 3 +++ 3 files changed, 23 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56df59395..0f7d4fb6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-11-07 Pavel Roskin + * gendistlist.sh: Use C locale for sorting to ensure consistent + output on all systems. + * util/grub.d/00_header.in: Remove incorrect space before "serial". diff --git a/DISTLIST b/DISTLIST index b54ba2903..95f28a4d0 100644 --- a/DISTLIST +++ b/DISTLIST @@ -71,10 +71,10 @@ conf/i386-efi.mk conf/i386-efi.rmk conf/i386-ieee1275.mk conf/i386-ieee1275.rmk -conf/i386.mk conf/i386-pc-cygwin-img-ld.sc conf/i386-pc.mk conf/i386-pc.rmk +conf/i386.mk conf/i386.rmk conf/powerpc-ieee1275.mk conf/powerpc-ieee1275.rmk @@ -90,9 +90,9 @@ disk/loopback.c disk/lvm.c disk/mdraid_linux.c disk/memdisk.c +disk/raid.c disk/raid5_recover.c disk/raid6_recover.c -disk/raid.c disk/scsi.c disk/efi/efidisk.c disk/i386/pc/biosdisk.c @@ -124,8 +124,8 @@ fs/xfs.c fs/i386/pc/pxe.c hello/hello.c hook/datehook.c -include/multiboot2.h include/multiboot.h +include/multiboot2.h include/grub/acorn_filecore.h include/grub/aout.h include/grub/arg.h @@ -152,21 +152,21 @@ include/grub/loader.h include/grub/lvm.h include/grub/misc.h include/grub/mm.h -include/grub/multiboot2.h include/grub/multiboot.h +include/grub/multiboot2.h include/grub/multiboot_loader.h include/grub/net.h include/grub/normal.h include/grub/ntfs.h include/grub/parser.h include/grub/partition.h -include/grub/pci.h include/grub/pc_partition.h +include/grub/pci.h include/grub/raid.h include/grub/rescue.h include/grub/script.h -include/grub/scsicmd.h include/grub/scsi.h +include/grub/scsicmd.h include/grub/setjmp.h include/grub/symbol.h include/grub/term.h @@ -177,8 +177,8 @@ include/grub/types.h include/grub/video.h include/grub/efi/api.h include/grub/efi/chainloader.h -include/grub/efi/console_control.h include/grub/efi/console.h +include/grub/efi/console_control.h include/grub/efi/disk.h include/grub/efi/efi.h include/grub/efi/pe32.h @@ -232,22 +232,22 @@ include/grub/i386/pc/memory.h include/grub/i386/pc/pxe.h include/grub/i386/pc/serial.h include/grub/i386/pc/time.h +include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeblit.h include/grub/i386/pc/vbefill.h -include/grub/i386/pc/vbe.h include/grub/i386/pc/vbeutil.h include/grub/i386/pc/vga.h include/grub/ieee1275/ieee1275.h include/grub/ieee1275/ofdisk.h -include/grub/lib/crc.h -include/grub/lib/datetime.h -include/grub/lib/envblk.h -include/grub/lib/hexdump.h include/grub/lib/LzFind.h include/grub/lib/LzHash.h include/grub/lib/LzmaDec.h include/grub/lib/LzmaEnc.h include/grub/lib/LzmaTypes.h +include/grub/lib/crc.h +include/grub/lib/datetime.h +include/grub/lib/envblk.h +include/grub/lib/hexdump.h include/grub/powerpc/kernel.h include/grub/powerpc/libgcc.h include/grub/powerpc/setjmp.h @@ -343,13 +343,13 @@ kern/sparc64/ieee1275/openfw.c kern/x86_64/dl.c kern/x86_64/efi/callwrap.S kern/x86_64/efi/startup.S +lib/LzFind.c +lib/LzmaDec.c +lib/LzmaEnc.c lib/crc.c lib/datetime.c lib/envblk.c lib/hexdump.c -lib/LzFind.c -lib/LzmaDec.c -lib/LzmaEnc.c lib/efi/datetime.c lib/i386/datetime.c loader/aout.c @@ -368,8 +368,8 @@ loader/i386/ieee1275/linux.c loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c -loader/i386/pc/multiboot2.c loader/i386/pc/multiboot.c +loader/i386/pc/multiboot2.c loader/i386/pc/multiboot_normal.c loader/ieee1275/multiboot2.c loader/powerpc/ieee1275/linux.c @@ -448,8 +448,8 @@ util/powerpc/ieee1275/grub-mkrescue.in util/powerpc/ieee1275/misc.c video/bitmap.c video/video.c -video/i386/pc/vbeblit.c video/i386/pc/vbe.c +video/i386/pc/vbeblit.c video/i386/pc/vbefill.c video/i386/pc/vbeutil.c video/readers/jpeg.c diff --git a/gendistlist.sh b/gendistlist.sh index 1ce8f1601..286329ab2 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -23,6 +23,9 @@ EXTRA_DISTFILES="AUTHORS COPYING ChangeLog DISTLIST INSTALL NEWS README \ DISTDIRS="boot bus commands conf disk docs font fs hello hook include io kern lib \ loader normal partmap term util video" +LC_COLLATE=C +export LC_COLLATE + for f in $EXTRA_DISTFILES; do echo $f done From 37c86336bfe06a7a4bfd4f8868609c115a690f03 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 8 Nov 2008 11:29:53 +0000 Subject: [PATCH 0441/1707] 2008-11-08 Robert Millan * Makefile.in (PKGLIB): Add $(pkglib_BUILDDIR). (PKGDATA): Add $(pkgdata_SRCDIR). (pkglib_BUILDDIR): New variable. (pkgdata_SRCDIR): New variable. (build_env.mk): New target. (include_DATA): New variable. (install-local): Install $(include_DATA) files in $(includedir). --- ChangeLog | 10 ++++++++++ Makefile.in | 33 +++++++++++++++++++++++++++++++-- 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0f7d4fb6a..7f4334890 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2008-11-08 Robert Millan + + * Makefile.in (PKGLIB): Add $(pkglib_BUILDDIR). + (PKGDATA): Add $(pkgdata_SRCDIR). + (pkglib_BUILDDIR): New variable. + (pkgdata_SRCDIR): New variable. + (build_env.mk): New target. + (include_DATA): New variable. + (install-local): Install $(include_DATA) files in $(includedir). + 2008-11-07 Pavel Roskin * gendistlist.sh: Use C locale for sorting to ensure consistent diff --git a/Makefile.in b/Makefile.in index eae8f3163..9eb47b2ff 100644 --- a/Makefile.in +++ b/Makefile.in @@ -105,8 +105,8 @@ RMKFILES = $(addprefix conf/,common.rmk i386-coreboot.rmk i386-efi.rmk \ MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ - $(pkglib_DATA) $(lib_DATA) -PKGDATA = $(pkgdata_DATA) + $(pkglib_DATA) $(lib_DATA) $(pkglib_BUILDDIR) +PKGDATA = $(pkgdata_DATA) $(pkgdata_SRCDIR) PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) @@ -163,6 +163,22 @@ ascii.pff: $(UNIFONT_HEX) ruby $(srcdir)/util/unifont2pff.rb 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) $(UNIFONT_HEX) > $@ endif +# Used for building modules externally +pkglib_BUILDDIR += build_env.mk +build_env.mk: Makefile + (\ + echo "TARGET_CC=$(TARGET_CC)" ; \ + echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \ + echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir)" ; \ + echo "STRIP=$(STRIP)" ; \ + echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \ + echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \ + echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\ + ) > $@ +pkglib_BUILDDIR += config.h grub_script.tab.h +pkgdata_SRCDIR += genmodsrc.sh genmk.rb +include_DATA += $(shell find include -name \*.h) include/grub/cpu + all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) install: install-local @@ -175,6 +191,19 @@ install-local: all dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \ done + $(mkinstalldirs) $(DESTDIR)$(includedir) + @list='$(include_DATA)'; \ + for file in $$list; do \ + if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ + dest="`echo $$file | sed 's,include/,,'`"; \ + destdir="`echo $$dest | sed 's,\(^\|/\)[^/]*$$,,g'`"; \ + $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \ + if test -f "$$dir$$file"; then \ + $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ + elif test -L "$$dir$$file"; then \ + cp -d $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ + fi; \ + done $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @list='$(PKGDATA)'; \ for file in $$list; do \ From 0025933a5ed187143f466eaeff160e4a5d54b94d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 8 Nov 2008 12:17:51 +0000 Subject: [PATCH 0442/1707] 2008-11-08 Robert Millan * term/i386/pc/vesafb.c (grub_vesafb_term): Change type to `struct grub_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. * util/console.c (grub_ncurses_term): Split in ... (grub_ncurses_term_input): ... this, and ... (grub_ncurses_term_output): ... this. Update all users. --- ChangeLog | 9 +++++++++ term/i386/pc/vesafb.c | 9 +++------ util/console.c | 19 ++++++++++++------- 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7f4334890..8302276fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-08 Robert Millan + + * term/i386/pc/vesafb.c (grub_vesafb_term): Change type to + `struct grub_term_output'. Remove `.checkkey' and `.getkey' + members. Update all users. + * util/console.c (grub_ncurses_term): Split in ... + (grub_ncurses_term_input): ... this, and ... + (grub_ncurses_term_output): ... this. Update all users. + 2008-11-08 Robert Millan * Makefile.in (PKGLIB): Add $(pkglib_BUILDDIR). diff --git a/term/i386/pc/vesafb.c b/term/i386/pc/vesafb.c index c1811a846..c5a46731d 100644 --- a/term/i386/pc/vesafb.c +++ b/term/i386/pc/vesafb.c @@ -578,15 +578,13 @@ grub_vesafb_setcursor (int on) } } -static struct grub_term grub_vesafb_term = +static struct grub_term_output grub_vesafb_term = { .name = "vesafb", .init = grub_vesafb_mod_init, .fini = grub_vesafb_mod_fini, .putchar = grub_vesafb_putchar, .getcharwidth = grub_vesafb_getcharwidth, - .checkkey = grub_console_checkkey, - .getkey = grub_console_getkey, .getwh = grub_virtual_screen_getwh, .getxy = grub_virtual_screen_getxy, .gotoxy = grub_vesafb_gotoxy, @@ -594,16 +592,15 @@ static struct grub_term grub_vesafb_term = .setcolorstate = grub_virtual_screen_setcolorstate, .setcursor = grub_vesafb_setcursor, .flags = 0, - .next = 0 }; GRUB_MOD_INIT(vesafb) { my_mod = mod; - grub_term_register (&grub_vesafb_term); + grub_term_register_output (&grub_vesafb_term); } GRUB_MOD_FINI(vesafb) { - grub_term_unregister (&grub_vesafb_term); + grub_term_unregister_output (&grub_vesafb_term); } diff --git a/util/console.c b/util/console.c index 30f184e91..bc4414c8d 100644 --- a/util/console.c +++ b/util/console.c @@ -345,15 +345,20 @@ grub_ncurses_fini (void) } -static struct grub_term grub_ncurses_term = +static struct grub_term_input grub_ncurses_term_input = + { + .name = "console", + .checkkey = grub_ncurses_checkkey, + .getkey = grub_ncurses_getkey, + }; + +static struct grub_term_output grub_ncurses_term_output = { .name = "console", .init = grub_ncurses_init, .fini = grub_ncurses_fini, .putchar = grub_ncurses_putchar, .getcharwidth = grub_ncurses_getcharwidth, - .checkkey = grub_ncurses_checkkey, - .getkey = grub_ncurses_getkey, .getxy = grub_ncurses_getxy, .getwh = grub_ncurses_getwh, .gotoxy = grub_ncurses_gotoxy, @@ -364,15 +369,15 @@ static struct grub_term grub_ncurses_term = .setcursor = grub_ncurses_setcursor, .refresh = grub_ncurses_refresh, .flags = 0, - .next = 0 }; void grub_console_init (void) { - grub_term_register (&grub_ncurses_term); - grub_term_set_current_input (&grub_ncurses_term); - grub_term_set_current_output (&grub_ncurses_term); + grub_term_register_output (&grub_ncurses_term_output); + grub_term_register_input (&grub_ncurses_term_input); + grub_term_set_current_output (&grub_ncurses_term_output); + grub_term_set_current_input (&grub_ncurses_term_input); } void From dcb6fa0a1c79471a2a81ba98bd91c79aad084985 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 8 Nov 2008 12:25:52 +0000 Subject: [PATCH 0443/1707] * term/ieee1275/ofconsole.c: Remove stale `#endif'. --- ChangeLog | 1 + term/ieee1275/ofconsole.c | 1 - 2 files changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8302276fc..f3e86c2eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,7 @@ * util/console.c (grub_ncurses_term): Split in ... (grub_ncurses_term_input): ... this, and ... (grub_ncurses_term_output): ... this. Update all users. + * term/ieee1275/ofconsole.c: Remove stale `#endif'. 2008-11-08 Robert Millan diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index ec35a13ea..cec227ae4 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -226,7 +226,6 @@ grub_ofconsole_getkey (void) return key; } -#endif static grub_uint16_t grub_ofconsole_getxy (void) From ac293d504e110b0084aeccd7e69203c31bede568 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 8 Nov 2008 12:53:22 +0000 Subject: [PATCH 0444/1707] 2008-11-08 Robert Millan * Makefile.in (include_DATA): Fix srcdir=. assumption. --- ChangeLog | 4 ++++ Makefile.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f3e86c2eb..34e0d1c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-11-08 Robert Millan + + * Makefile.in (include_DATA): Fix srcdir=. assumption. + 2008-11-08 Robert Millan * term/i386/pc/vesafb.c (grub_vesafb_term): Change type to diff --git a/Makefile.in b/Makefile.in index 9eb47b2ff..1eba7870f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -177,7 +177,7 @@ build_env.mk: Makefile ) > $@ pkglib_BUILDDIR += config.h grub_script.tab.h pkgdata_SRCDIR += genmodsrc.sh genmk.rb -include_DATA += $(shell find include -name \*.h) include/grub/cpu +include_DATA += $(shell find $(srcdir)/include -name \*.h | sed -e "s,^$(srcdir)/,,g") include/grub/cpu all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) From 2a9c59400ba37493a3656a7243607b7d791d2a5b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 8 Nov 2008 15:21:57 +0000 Subject: [PATCH 0445/1707] (DISTCLEANFILES): Add `build_env.mk'. --- ChangeLog | 1 + Makefile.in | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 34e0d1c54..5024cda2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,7 @@ 2008-11-08 Robert Millan * Makefile.in (include_DATA): Fix srcdir=. assumption. + (DISTCLEANFILES): Add `build_env.mk'. 2008-11-08 Robert Millan diff --git a/Makefile.in b/Makefile.in index 1eba7870f..5ce8be712 100644 --- a/Makefile.in +++ b/Makefile.in @@ -114,7 +114,7 @@ CLEANFILES = MOSTLYCLEANFILES = DISTCLEANFILES = config.status config.cache config.log config.h \ Makefile stamp-h include/grub/cpu include/grub/machine \ - gensymlist.sh genkernsyms.sh + gensymlist.sh genkernsyms.sh build_env.mk MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) # The default target. From 132e4113427202f43ebc9f42b7b1707f280b4904 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 9 Nov 2008 12:44:31 +0000 Subject: [PATCH 0446/1707] 2008-11-09 Robert Millan * commands/terminal.c (GRUB_MOD_FINI(terminal)): Unregister `terminal_input' / `terminal_output', not `terminal'. --- ChangeLog | 5 +++++ commands/terminal.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5024cda2a..b8e0b1810 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-09 Robert Millan + + * commands/terminal.c (GRUB_MOD_FINI(terminal)): Unregister + `terminal_input' / `terminal_output', not `terminal'. + 2008-11-08 Robert Millan * Makefile.in (include_DATA): Fix srcdir=. assumption. diff --git a/commands/terminal.c b/commands/terminal.c index 31c979d4c..fa7364456 100644 --- a/commands/terminal.c +++ b/commands/terminal.c @@ -127,5 +127,6 @@ GRUB_MOD_INIT(terminal) GRUB_MOD_FINI(terminal) { - grub_unregister_command ("terminal"); + grub_unregister_command ("terminal_input"); + grub_unregister_command ("terminal_output"); } From 6c529df74c67ecfd2d4707b3dde439c16c4eb694 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 10 Nov 2008 08:49:26 +0000 Subject: [PATCH 0447/1707] 2008-11-10 Robert Millan * util/grub.d/00_header.in: Add backward compatibility check for versions of terminal.mod that don't understand `terminal_input' or `terminal_output'. --- ChangeLog | 6 ++++++ util/grub.d/00_header.in | 22 +++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8e0b1810..ba2b0e6c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-10 Robert Millan + + * util/grub.d/00_header.in: Add backward compatibility check for + versions of terminal.mod that don't understand `terminal_input' or + `terminal_output'. + 2008-11-09 Robert Millan * commands/terminal.c (GRUB_MOD_FINI(terminal)): Unregister diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 8967fd68d..fe17b6769 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -59,7 +59,13 @@ case x${GRUB_TERMINAL_INPUT} in # Just use the native terminal ;; x*) - echo "terminal_input ${GRUB_TERMINAL_INPUT}" + cat << EOF +if terminal_input ${GRUB_TERMINAL_INPUT} ; then true ; else + # For backward compatibility with versions of terminal.mod that don't + # understand terminal_input + terminal ${GRUB_TERMINAL_INPUT} +fi +EOF ;; esac @@ -85,7 +91,11 @@ if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then set gfxmode=${GRUB_GFXMODE} insmod gfxterm insmod ${video_backend} - terminal_output gfxterm + if terminal_output gfxterm ; then true ; else + # For backward compatibility with versions of terminal.mod that don't + # understand terminal_output + terminal gfxterm + fi fi EOF ;; @@ -93,6 +103,12 @@ EOF # Just use the native terminal ;; x*) - echo "terminal_output ${GRUB_TERMINAL_OUTPUT}" + cat << EOF +if terminal_output ${GRUB_TERMINAL_OUTPUT} ; then true ; else + # For backward compatibility with versions of terminal.mod that don't + # understand terminal_output + terminal ${GRUB_TERMINAL_OUTPUT} +fi +EOF ;; esac From dba3f844eb6e56356d3032b5e0a76b0d722c23e2 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 10 Nov 2008 15:04:00 +0000 Subject: [PATCH 0448/1707] Fix spacing and a minor typo --- ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba2b0e6c6..38d4a88eb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -17,7 +17,7 @@ 2008-11-08 Robert Millan * term/i386/pc/vesafb.c (grub_vesafb_term): Change type to - `struct grub_term_output'. Remove `.checkkey' and `.getkey' + `struct grub_term_output'. Remove `.checkkey' and `.getkey' members. Update all users. * util/console.c (grub_ncurses_term): Split in ... (grub_ncurses_term_input): ... this, and ... @@ -217,12 +217,12 @@ * normal/menu.c (run_menu): Add Previous and Next Page keys in menu. -2008-10-29 Guillem Jover +2008-10-29 Guillem Jover * disk/lvm.c (grub_lvm_scan_device): Fix error recovery by delaying the addition of objects until the code is not going to be able to fail. -2008-10-29 Guillem Jover +2008-10-29 Guillem Jover * disk/lvm.c (grub_lvm_scan_device): Fix possible NULL value handling (add a missing NULL check, and correct them by moving the pointer @@ -807,7 +807,7 @@ (fstest): Handle multiple disks. (options): Remove part, raw and long, add root and diskcount. (usage): Add crc, remove -p, -r, -l, add -r and -c. - (main): Find the first non option entry and ignore subsequence options, + (main): Find the first non option entry and ignore subsequent options, add handling for the new options, support multiple disks. * util/grub-probe.c (probe): Add mdraid to abstraction_name. From 761ca975a9f70f681b52b515f1d4140cd2c17785 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 11 Nov 2008 23:16:54 +0000 Subject: [PATCH 0449/1707] 2008-11-12 Robert Millan Fix a regression introduced by the at_keyboard.mod split. Because some terminals are default on some platforms and non-default on others, the first terminal being registered determines which is going to be default. * kern/term.c (grub_term_register_input): If this is the first terminal being registered, set it as the current one. (grub_term_register_output): Likewise. * term/efi/console.c (grub_console_init): Do not call grub_term_set_current_output() or grub_term_set_current_input(). * term/ieee1275/ofconsole.c (grub_console_init): Likewise. * term/i386/pc/console.c (grub_console_init): Likewise. (grub_console_fini): Do not call grub_term_set_current_input() (but leave grub_term_set_current_output() to restore text mode). --- ChangeLog | 18 ++++++++++++++++++ kern/term.c | 4 ++++ term/efi/console.c | 2 -- term/i386/pc/console.c | 6 +++--- term/ieee1275/ofconsole.c | 2 -- 5 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38d4a88eb..33e70ec89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2008-11-12 Robert Millan + + Fix a regression introduced by the at_keyboard.mod split. Because + some terminals are default on some platforms and non-default on + others, the first terminal being registered determines which is + going to be default. + + * kern/term.c (grub_term_register_input): If this is the first + terminal being registered, set it as the current one. + (grub_term_register_output): Likewise. + + * term/efi/console.c (grub_console_init): Do not call + grub_term_set_current_output() or grub_term_set_current_input(). + * term/ieee1275/ofconsole.c (grub_console_init): Likewise. + * term/i386/pc/console.c (grub_console_init): Likewise. + (grub_console_fini): Do not call grub_term_set_current_input() + (but leave grub_term_set_current_output() to restore text mode). + 2008-11-10 Robert Millan * util/grub.d/00_header.in: Add backward compatibility check for diff --git a/kern/term.c b/kern/term.c index 24324c203..2acfdae72 100644 --- a/kern/term.c +++ b/kern/term.c @@ -44,6 +44,8 @@ grub_term_register_input (grub_term_input_t term) { term->next = grub_term_list_input; grub_term_list_input = term; + if (! grub_cur_term_input) + grub_term_set_current_input (term); } void @@ -51,6 +53,8 @@ grub_term_register_output (grub_term_output_t term) { term->next = grub_term_list_output; grub_term_list_output = term; + if (! grub_cur_term_output) + grub_term_set_current_output (term); } void diff --git a/term/efi/console.c b/term/efi/console.c index 33d404f26..ff842c0f3 100644 --- a/term/efi/console.c +++ b/term/efi/console.c @@ -368,8 +368,6 @@ grub_console_init (void) grub_term_register_input (&grub_console_term_input); grub_term_register_output (&grub_console_term_output); - grub_term_set_current_output (&grub_console_term_output); - grub_term_set_current_input (&grub_console_term_input); } void diff --git a/term/i386/pc/console.c b/term/i386/pc/console.c index 6105ac7d8..7c1512813 100644 --- a/term/i386/pc/console.c +++ b/term/i386/pc/console.c @@ -156,19 +156,19 @@ void grub_console_init (void) { grub_term_register_output (&grub_console_term_output); - grub_term_set_current_output (&grub_console_term_output); #ifdef GRUB_MACHINE_PCBIOS grub_term_register_input (&grub_console_term_input); - grub_term_set_current_input (&grub_console_term_input); #endif } void grub_console_fini (void) { + /* This is to make sure the console is restored to text mode before + we boot. */ grub_term_set_current_output (&grub_console_term_output); + #ifdef GRUB_MACHINE_PCBIOS - grub_term_set_current_input (&grub_console_term_input); grub_term_unregister_input (&grub_console_term_input); #endif grub_term_unregister_output (&grub_console_term_output); diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index cec227ae4..70fda9ab4 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -422,8 +422,6 @@ grub_console_init (void) { grub_term_register_input (&grub_ofconsole_term_input); grub_term_register_output (&grub_ofconsole_term_output); - grub_term_set_current_output (&grub_ofconsole_term_output); - grub_term_set_current_input (&grub_ofconsole_term_input); } void From 95b841d37b8479851d16e0ad53bb29eda1da0744 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 11 Nov 2008 23:27:18 +0000 Subject: [PATCH 0450/1707] 2008-11-12 Robert Millan Use newly-added Multiboot support in coreboot. * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace `kern/i386/coreboot/mmap.c' with `kern/i386/multiboot_mmap.c'. * kern/i386/coreboot/startup.S: Enable Multiboot header, fix its alignment, set `MULTIBOOT_MEMORY_INFO' flag. (codestart): Store the MBI in `startup_multiboot_info' when we're being loaded using Multiboot. * kern/i386/coreboot/init.c (grub_machine_init): Move grub_at_keyboard_init() call to beginning of function (useful for debugging). Call grub_machine_mmap_init() before attempting to use grub_machine_mmap_iterate(). (grub_lower_mem, grub_upper_mem): Move from here ... * kern/i386/multiboot_mmap.c (grub_lower_mem, grub_upper_mem): ... to here (new file). * include/grub/i386/coreboot/memory.h (grub_machine_mmap_init): New function prototype. --- ChangeLog | 23 ++++++++ DISTLIST | 1 + conf/i386-coreboot.mk | 16 +++--- conf/i386-coreboot.rmk | 2 +- include/grub/i386/coreboot/memory.h | 2 + kern/i386/coreboot/init.c | 7 +-- kern/i386/coreboot/startup.S | 12 +++-- kern/i386/multiboot_mmap.c | 84 +++++++++++++++++++++++++++++ 8 files changed, 129 insertions(+), 18 deletions(-) create mode 100644 kern/i386/multiboot_mmap.c diff --git a/ChangeLog b/ChangeLog index 33e70ec89..cbb920c62 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2008-11-12 Robert Millan + + Use newly-added Multiboot support in coreboot. + + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace + `kern/i386/coreboot/mmap.c' with `kern/i386/multiboot_mmap.c'. + + * kern/i386/coreboot/startup.S: Enable Multiboot header, fix its + alignment, set `MULTIBOOT_MEMORY_INFO' flag. + (codestart): Store the MBI in `startup_multiboot_info' when we're + being loaded using Multiboot. + + * kern/i386/coreboot/init.c (grub_machine_init): Move + grub_at_keyboard_init() call to beginning of function (useful for + debugging). Call grub_machine_mmap_init() before attempting to use + grub_machine_mmap_iterate(). + (grub_lower_mem, grub_upper_mem): Move from here ... + * kern/i386/multiboot_mmap.c (grub_lower_mem, grub_upper_mem): ... to + here (new file). + + * include/grub/i386/coreboot/memory.h (grub_machine_mmap_init): New + function prototype. + 2008-11-12 Robert Millan Fix a regression introduced by the at_keyboard.mod split. Because diff --git a/DISTLIST b/DISTLIST index 95f28a4d0..01046c2e4 100644 --- a/DISTLIST +++ b/DISTLIST @@ -313,6 +313,7 @@ kern/generic/rtc_get_time_ms.c kern/i386/dl.c kern/i386/halt.c kern/i386/loader.S +kern/i386/multiboot_mmap.c kern/i386/pit.c kern/i386/realmode.S kern/i386/reboot.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index aaa221c61..f15ae2158 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -14,7 +14,7 @@ pkglib_PROGRAMS = kernel.elf # For kernel.elf. kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/i386/coreboot/init.c \ - kern/i386/coreboot/mmap.c \ + kern/i386/multiboot_mmap.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ @@ -27,11 +27,11 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ term/i386/pc/console.c \ term/i386/pc/at_keyboard.c term/i386/pc/vga_text.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_coreboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_coreboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_coreboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_coreboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_coreboot_startup.o: kern/i386/coreboot/startup.S $(kern/i386/coreboot/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -41,9 +41,9 @@ kernel_elf-kern_i386_coreboot_init.o: kern/i386/coreboot/init.c $(kern/i386/core $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_coreboot_init.d -kernel_elf-kern_i386_coreboot_mmap.o: kern/i386/coreboot/mmap.c $(kern/i386/coreboot/mmap.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_coreboot_mmap.d +kernel_elf-kern_i386_multiboot_mmap.o: kern/i386/multiboot_mmap.c $(kern/i386/multiboot_mmap.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 78088fd3f..79333e5b7 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -13,7 +13,7 @@ pkglib_PROGRAMS = kernel.elf # For kernel.elf. kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/i386/coreboot/init.c \ - kern/i386/coreboot/mmap.c \ + kern/i386/multiboot_mmap.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ diff --git a/include/grub/i386/coreboot/memory.h b/include/grub/i386/coreboot/memory.h index 687077c48..b1b015472 100644 --- a/include/grub/i386/coreboot/memory.h +++ b/include/grub/i386/coreboot/memory.h @@ -59,6 +59,8 @@ struct grub_linuxbios_mem_region }; typedef struct grub_linuxbios_mem_region *mem_region_t; +void grub_machine_mmap_init (void); + void EXPORT_FUNC(grub_machine_mmap_iterate) (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 051154765..e08bc866d 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -42,7 +42,6 @@ extern char _end[]; grub_addr_t grub_os_area_addr; grub_size_t grub_os_area_size; -grub_size_t grub_lower_mem, grub_upper_mem; /* FIXME: we need interrupts to do this right */ static grub_uint32_t grub_time_tics = 0; @@ -79,9 +78,7 @@ grub_machine_init (void) { /* Initialize the console as early as possible. */ grub_console_init (); - - grub_lower_mem = GRUB_MEMORY_MACHINE_LOWER_USABLE; - grub_upper_mem = 0; + grub_at_keyboard_init (); auto int NESTED_FUNC_ATTR heap_init (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) @@ -132,13 +129,13 @@ grub_machine_init (void) return 0; } + grub_machine_mmap_init (); grub_machine_mmap_iterate (heap_init); /* This variable indicates size, not offset. */ grub_upper_mem -= GRUB_MEMORY_MACHINE_UPPER_START; grub_tsc_init (); - grub_at_keyboard_init (); } void diff --git a/kern/i386/coreboot/startup.S b/kern/i386/coreboot/startup.S index 8d1aa3c15..835978bfe 100644 --- a/kern/i386/coreboot/startup.S +++ b/kern/i386/coreboot/startup.S @@ -55,20 +55,24 @@ VARIABLE(grub_prefix) . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END -#if 0 /* * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself). */ + .p2align 2 /* force 4-byte alignment */ multiboot_header: /* magic */ .long 0x1BADB002 /* flags */ - .long 0 + .long MULTIBOOT_MEMORY_INFO /* checksum */ - .long -0x1BADB002 -#endif + .long -0x1BADB002 - MULTIBOOT_MEMORY_INFO codestart: + cmpl $MULTIBOOT_MAGIC2, %eax + jne 0f + movl %ebx, EXT_C(startup_multiboot_info) +0: + /* initialize the stack */ movl $GRUB_MEMORY_MACHINE_PROT_STACK, %esp diff --git a/kern/i386/multiboot_mmap.c b/kern/i386/multiboot_mmap.c new file mode 100644 index 000000000..16f155bac --- /dev/null +++ b/kern/i386/multiboot_mmap.c @@ -0,0 +1,84 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +grub_size_t grub_lower_mem, grub_upper_mem; + +/* A pointer to the MBI in its initial location. */ +struct grub_multiboot_info *startup_multiboot_info; + +/* The MBI has to be copied to our BSS so that it won't be + overwritten. This is its final location. */ +static struct grub_multiboot_info kern_multiboot_info; + +/* Unfortunately we can't use heap at this point. But 32 looks like a sane + limit (used by memtest86). */ +static grub_uint8_t mmap_entries[sizeof (struct grub_multiboot_mmap_entry) * 32]; + +void +grub_machine_mmap_init () +{ + if (! startup_multiboot_info) + grub_fatal ("Must be loaded using Multiboot specification (is this an old version of coreboot?)"); + + /* Move MBI to a safe place. */ + grub_memmove (&kern_multiboot_info, startup_multiboot_info, sizeof (struct grub_multiboot_info)); + + if ((kern_multiboot_info.flags & MULTIBOOT_INFO_MEM_MAP) == 0) + grub_fatal ("Missing Multiboot memory information"); + + /* Move the memory map to a safe place. */ + if (kern_multiboot_info.mmap_length > sizeof (mmap_entries)) + { + grub_printf ("WARNING: Memory map size exceeds limit; it will be truncated\n"); + kern_multiboot_info.mmap_length = sizeof (mmap_entries); + } + grub_memmove (mmap_entries, (void *) kern_multiboot_info.mmap_addr, kern_multiboot_info.mmap_length); + kern_multiboot_info.mmap_addr = (grub_uint32_t) mmap_entries; + + if ((kern_multiboot_info.flags & MULTIBOOT_INFO_MEMORY) == 0) + { + grub_lower_mem = GRUB_MEMORY_MACHINE_LOWER_USABLE; + grub_upper_mem = 0; + } + else + { + grub_lower_mem = kern_multiboot_info.mem_lower * 1024; + grub_upper_mem = kern_multiboot_info.mem_upper * 1024; + } +} + +void +grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) +{ + struct grub_multiboot_mmap_entry *entry = (void *) kern_multiboot_info.mmap_addr; + + while ((unsigned long) entry < kern_multiboot_info.mmap_addr + kern_multiboot_info.mmap_length) + { + if (hook (entry->addr, entry->len, entry->type)) + break; + + entry = (void *) ((grub_addr_t) entry + entry->size + sizeof (entry->size)); + } +} From 76679cd3a49de30cb48407f1832e2e579dd12ee1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 12 Nov 2008 15:02:17 +0000 Subject: [PATCH 0451/1707] 2008-11-12 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'. * conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'. (vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New variables. * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace `term/i386/pc/console.c' with `term/i386/vga_common.c'. * kern/i386/coreboot/init.c (grub_machine_init): Replace call to grub_console_init() with call to grub_vga_text_init(). (grub_machine_fini): Replace call to grub_console_fini() with call to grub_vga_text_fini() and grub_at_keyboard_fini(). * include/grub/i386/pc/console.h: Include `'. (grub_console_putchar, grub_console_getcharwidth, grub_console_getwh) (grub_console_setcolorstate, grub_console_setcolor) (grub_console_getcolor): New function prototypes. * term/i386/pc/vga_text.c: Include `'. (grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls) (grub_vga_text_setcursor): Static-ize. (grub_vga_text_term): New structure. (GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions. * term/i386/pc/console.c: Remove `'. (grub_console_cur_color, grub_console_standard_color) (grub_console_normal_color, grub_console_highlight_color) (map_char, grub_console_putchar, grub_console_getcharwidth) (grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor) (grub_console_getcolor): Move from here ... * term/i386/vga_common.c: ... to here (same function names). --- ChangeLog | 34 +++++++++ DISTLIST | 1 + conf/i386-coreboot.mk | 24 +++---- conf/i386-coreboot.rmk | 4 +- conf/i386-pc.mk | 12 ++-- conf/i386-pc.rmk | 2 +- conf/i386.mk | 76 ++++++++++++++++++++ conf/i386.rmk | 5 ++ include/grub/i386/pc/console.h | 11 ++- kern/i386/coreboot/init.c | 5 +- term/i386/pc/console.c | 113 ----------------------------- term/i386/pc/vga_text.c | 48 ++++++++++--- term/i386/vga_common.c | 125 +++++++++++++++++++++++++++++++++ 13 files changed, 315 insertions(+), 145 deletions(-) create mode 100644 term/i386/vga_common.c diff --git a/ChangeLog b/ChangeLog index cbb920c62..1b41d7e6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +2008-11-12 Robert Millan + + * conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'. + * conf/i386.rmk (pkglib_MODULES): Add `vga_text.mod'. + (vga_text_mod_SOURCES, vga_text_mod_CFLAGS, vga_text_mod_LDFLAGS): New + variables. + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Replace + `term/i386/pc/console.c' with `term/i386/vga_common.c'. + + * kern/i386/coreboot/init.c (grub_machine_init): Replace call to + grub_console_init() with call to grub_vga_text_init(). + (grub_machine_fini): Replace call to + grub_console_fini() with call to grub_vga_text_fini() and + grub_at_keyboard_fini(). + + * include/grub/i386/pc/console.h: Include `'. + (grub_console_putchar, grub_console_getcharwidth, grub_console_getwh) + (grub_console_setcolorstate, grub_console_setcolor) + (grub_console_getcolor): New function prototypes. + + * term/i386/pc/vga_text.c: Include `'. + (grub_vga_text_getxy, grub_vga_text_gotoxy, grub_vga_text_cls) + (grub_vga_text_setcursor): Static-ize. + (grub_vga_text_term): New structure. + (GRUB_MOD_INIT(vga_text), GRUB_MOD_FINI(vga_text)): New functions. + + * term/i386/pc/console.c: Remove `'. + (grub_console_cur_color, grub_console_standard_color) + (grub_console_normal_color, grub_console_highlight_color) + (map_char, grub_console_putchar, grub_console_getcharwidth) + (grub_console_getwh, grub_console_setcolorstate, grub_console_setcolor) + (grub_console_getcolor): Move from here ... + * term/i386/vga_common.c: ... to here (same function names). + 2008-11-12 Robert Millan Use newly-added Multiboot support in coreboot. diff --git a/DISTLIST b/DISTLIST index 01046c2e4..87ab7ad8c 100644 --- a/DISTLIST +++ b/DISTLIST @@ -403,6 +403,7 @@ term/gfxterm.c term/terminfo.c term/tparm.c term/efi/console.c +term/i386/vga_common.c term/i386/pc/at_keyboard.c term/i386/pc/console.c term/i386/pc/serial.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index f15ae2158..982a1b4a2 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -24,14 +24,14 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ - term/i386/pc/console.c \ - term/i386/pc/at_keyboard.c term/i386/pc/vga_text.c \ + term/i386/pc/vga_text.c term/i386/vga_common.c \ + term/i386/pc/at_keyboard.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_console.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-term_i386_vga_common.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_console.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_coreboot_startup.o: kern/i386/coreboot/startup.S $(kern/i386/coreboot/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -129,18 +129,18 @@ kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_env.d -kernel_elf-term_i386_pc_console.o: term/i386/pc/console.c $(term/i386/pc/console.c_DEPENDENCIES) +kernel_elf-term_i386_pc_vga_text.o: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_i386_pc_console.d +-include kernel_elf-term_i386_pc_vga_text.d + +kernel_elf-term_i386_vga_common.o: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) + $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-term_i386_vga_common.d kernel_elf-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_i386_pc_at_keyboard.d -kernel_elf-term_i386_pc_vga_text.o: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_i386_pc_vga_text.d - kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 79333e5b7..48f679535 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -23,8 +23,8 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ - term/i386/pc/console.c \ - term/i386/pc/at_keyboard.c term/i386/pc/vga_text.c \ + term/i386/pc/vga_text.c term/i386/vga_common.c \ + term/i386/pc/at_keyboard.c \ symlist.c kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index cb5b33530..4c413ef34 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -115,15 +115,15 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ - term/i386/pc/console.c \ + term/i386/pc/console.c term/i386/vga_common.c \ symlist.c -CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o -MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-symlist.d +CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o +MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d kernel.img: kernel.exec $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ -kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-symlist.o +kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) @@ -226,6 +226,10 @@ kernel_img-term_i386_pc_console.o: term/i386/pc/console.c $(term/i386/pc/console $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-term_i386_pc_console.d +kernel_img-term_i386_vga_common.o: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) + $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-term_i386_vga_common.d + kernel_img-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-symlist.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 82cb12b40..975df39c8 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -49,7 +49,7 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ kern/env.c \ - term/i386/pc/console.c \ + term/i386/pc/console.c term/i386/vga_common.c \ symlist.c kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ diff --git a/conf/i386.mk b/conf/i386.mk index 6f528b7b7..5cd7b4203 100644 --- a/conf/i386.mk +++ b/conf/i386.mk @@ -114,3 +114,79 @@ partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += vga_text.mod +vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c +CLEANFILES += vga_text.mod mod-vga_text.o mod-vga_text.c pre-vga_text.o vga_text_mod-term_i386_pc_vga_text.o vga_text_mod-term_i386_vga_common.o und-vga_text.lst +ifneq ($(vga_text_mod_EXPORTS),no) +CLEANFILES += def-vga_text.lst +DEFSYMFILES += def-vga_text.lst +endif +MOSTLYCLEANFILES += vga_text_mod-term_i386_pc_vga_text.d vga_text_mod-term_i386_vga_common.d +UNDSYMFILES += und-vga_text.lst + +vga_text.mod: pre-vga_text.o mod-vga_text.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(vga_text_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vga_text.o mod-vga_text.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-vga_text.o: $(vga_text_mod_DEPENDENCIES) vga_text_mod-term_i386_pc_vga_text.o vga_text_mod-term_i386_vga_common.o + -rm -f $@ + $(TARGET_CC) $(vga_text_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ vga_text_mod-term_i386_pc_vga_text.o vga_text_mod-term_i386_vga_common.o + +mod-vga_text.o: mod-vga_text.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -c -o $@ $< + +mod-vga_text.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'vga_text' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(vga_text_mod_EXPORTS),no) +def-vga_text.lst: pre-vga_text.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vga_text/' > $@ +endif + +und-vga_text.lst: pre-vga_text.o + echo 'vga_text' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +vga_text_mod-term_i386_pc_vga_text.o: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) + $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -MD -c -o $@ $< +-include vga_text_mod-term_i386_pc_vga_text.d + +CLEANFILES += cmd-vga_text_mod-term_i386_pc_vga_text.lst fs-vga_text_mod-term_i386_pc_vga_text.lst partmap-vga_text_mod-term_i386_pc_vga_text.lst +COMMANDFILES += cmd-vga_text_mod-term_i386_pc_vga_text.lst +FSFILES += fs-vga_text_mod-term_i386_pc_vga_text.lst +PARTMAPFILES += partmap-vga_text_mod-term_i386_pc_vga_text.lst + +cmd-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) + +fs-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) + +partmap-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) + + +vga_text_mod-term_i386_vga_common.o: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) + $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -MD -c -o $@ $< +-include vga_text_mod-term_i386_vga_common.d + +CLEANFILES += cmd-vga_text_mod-term_i386_vga_common.lst fs-vga_text_mod-term_i386_vga_common.lst partmap-vga_text_mod-term_i386_vga_common.lst +COMMANDFILES += cmd-vga_text_mod-term_i386_vga_common.lst +FSFILES += fs-vga_text_mod-term_i386_vga_common.lst +PARTMAPFILES += partmap-vga_text_mod-term_i386_vga_common.lst + +cmd-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) + +fs-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) + +partmap-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) + + +vga_text_mod_CFLAGS = $(COMMON_CFLAGS) +vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386.rmk b/conf/i386.rmk index 577d58f66..93f84ce39 100644 --- a/conf/i386.rmk +++ b/conf/i386.rmk @@ -9,3 +9,8 @@ pkglib_MODULES += at_keyboard.mod at_keyboard_mod_SOURCES = term/i386/pc/at_keyboard.c at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += vga_text.mod +vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c +vga_text_mod_CFLAGS = $(COMMON_CFLAGS) +vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/i386/pc/console.h b/include/grub/i386/pc/console.h index 2b37db515..480c21c42 100644 --- a/include/grub/i386/pc/console.h +++ b/include/grub/i386/pc/console.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,6 +36,7 @@ #include #include +#include /* These are global to share code between C and asm. */ extern grub_uint8_t grub_console_cur_color; @@ -47,6 +48,14 @@ void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y); void grub_console_cls (void); void grub_console_setcursor (int on); +/* Provided by vga_common.c. */ +void grub_console_putchar (grub_uint32_t c); +grub_ssize_t grub_console_getcharwidth (grub_uint32_t c); +grub_uint16_t grub_console_getwh (void); +void grub_console_setcolorstate (grub_term_color_state state); +void grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color); +void grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color); + /* Initialize the console system. */ void grub_console_init (void); diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index e08bc866d..3a5005099 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -77,7 +77,7 @@ void grub_machine_init (void) { /* Initialize the console as early as possible. */ - grub_console_init (); + grub_vga_text_init (); grub_at_keyboard_init (); auto int NESTED_FUNC_ATTR heap_init (grub_uint64_t, grub_uint64_t, grub_uint32_t); @@ -148,7 +148,8 @@ grub_machine_set_prefix (void) void grub_machine_fini (void) { - grub_console_fini (); + grub_at_keyboard_fini (); + grub_vga_text_fini (); } /* Return the end of the core image. */ diff --git a/term/i386/pc/console.c b/term/i386/pc/console.c index 7c1512813..6c6be463c 100644 --- a/term/i386/pc/console.c +++ b/term/i386/pc/console.c @@ -16,125 +16,16 @@ * along with GRUB. If not, see . */ -#include #include #include #include -grub_uint8_t grub_console_cur_color = 0x7; -static grub_uint8_t grub_console_standard_color = 0x7; -static grub_uint8_t grub_console_normal_color = 0x7; -static grub_uint8_t grub_console_highlight_color = 0x70; - -static grub_uint32_t -map_char (grub_uint32_t c) -{ - if (c > 0x7f) - { - /* Map some unicode characters to the VGA font, if possible. */ - switch (c) - { - case 0x2190: /* left arrow */ - c = 0x1b; - break; - case 0x2191: /* up arrow */ - c = 0x18; - break; - case 0x2192: /* right arrow */ - c = 0x1a; - break; - case 0x2193: /* down arrow */ - c = 0x19; - break; - case 0x2501: /* horizontal line */ - c = 0xc4; - break; - case 0x2503: /* vertical line */ - c = 0xb3; - break; - case 0x250F: /* upper-left corner */ - c = 0xda; - break; - case 0x2513: /* upper-right corner */ - c = 0xbf; - break; - case 0x2517: /* lower-left corner */ - c = 0xc0; - break; - case 0x251B: /* lower-right corner */ - c = 0xd9; - break; - - default: - c = '?'; - break; - } - } - - return c; -} - -static void -grub_console_putchar (grub_uint32_t c) -{ - grub_console_real_putchar (map_char (c)); -} - -static grub_ssize_t -grub_console_getcharwidth (grub_uint32_t c __attribute__ ((unused))) -{ - /* For now, every printable character has the width 1. */ - return 1; -} - -static grub_uint16_t -grub_console_getwh (void) -{ - return (80 << 8) | 25; -} - -static void -grub_console_setcolorstate (grub_term_color_state state) -{ - switch (state) { - case GRUB_TERM_COLOR_STANDARD: - grub_console_cur_color = grub_console_standard_color; - break; - case GRUB_TERM_COLOR_NORMAL: - grub_console_cur_color = grub_console_normal_color; - break; - case GRUB_TERM_COLOR_HIGHLIGHT: - grub_console_cur_color = grub_console_highlight_color; - break; - default: - break; - } -} - -static void -grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color) -{ - grub_console_normal_color = normal_color; - grub_console_highlight_color = highlight_color; -} - -static void -grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color) -{ - *normal_color = grub_console_normal_color; - *highlight_color = grub_console_highlight_color; -} - -/* On non-BIOS platforms, console.c is used in combination with vga_text.c - (only to handle output). */ -#ifdef GRUB_MACHINE_PCBIOS static struct grub_term_input grub_console_term_input = { .name = "console", .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, }; -#endif static struct grub_term_output grub_console_term_output = { @@ -156,9 +47,7 @@ void grub_console_init (void) { grub_term_register_output (&grub_console_term_output); -#ifdef GRUB_MACHINE_PCBIOS grub_term_register_input (&grub_console_term_input); -#endif } void @@ -168,8 +57,6 @@ grub_console_fini (void) we boot. */ grub_term_set_current_output (&grub_console_term_output); -#ifdef GRUB_MACHINE_PCBIOS grub_term_unregister_input (&grub_console_term_input); -#endif grub_term_unregister_output (&grub_console_term_output); } diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index ec3c0f565..5ffdde661 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. + * Copyright (C) 2007, 2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,7 @@ * along with GRUB. If not, see . */ +#include #include #include #include @@ -106,31 +107,31 @@ grub_console_real_putchar (int c) update_cursor (); } -grub_uint16_t -grub_console_getxy (void) +static grub_uint16_t +grub_vga_text_getxy (void) { return (grub_curr_x << 8) | grub_curr_y; } -void -grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y) +static void +grub_vga_text_gotoxy (grub_uint8_t x, grub_uint8_t y) { grub_curr_x = x; grub_curr_y = y; update_cursor (); } -void -grub_console_cls (void) +static void +grub_vga_text_cls (void) { int i; for (i = 0; i < ROWS * COLS; i++) ((short *) VGA_TEXT_SCREEN)[i] = ' ' | (grub_console_cur_color << 8); - grub_console_gotoxy (0, 0); + grub_vga_text_gotoxy (0, 0); } -void -grub_console_setcursor (int on) +static void +grub_vga_text_setcursor (int on) { grub_uint8_t old; grub_outb (CRTC_CURSOR, CRTC_ADDR_PORT); @@ -140,3 +141,30 @@ grub_console_setcursor (int on) else grub_outb (old | CRTC_CURSOR_DISABLE, CRTC_DATA_PORT); } + +static struct grub_term_output grub_vga_text_term = + { + .name = "vga_text", + .init = grub_vga_text_cls, + .fini = grub_vga_text_cls, + .putchar = grub_console_putchar, + .getcharwidth = grub_console_getcharwidth, + .getwh = grub_console_getwh, + .getxy = grub_vga_text_getxy, + .gotoxy = grub_vga_text_gotoxy, + .cls = grub_vga_text_cls, + .setcolorstate = grub_console_setcolorstate, + .setcolor = grub_console_setcolor, + .getcolor = grub_console_getcolor, + .setcursor = grub_vga_text_setcursor, + }; + +GRUB_MOD_INIT(vga_text) +{ + grub_term_register_output (&grub_vga_text_term); +} + +GRUB_MOD_FINI(vga_text) +{ + grub_term_unregister_output (&grub_vga_text_term); +} diff --git a/term/i386/vga_common.c b/term/i386/vga_common.c new file mode 100644 index 000000000..5c862396b --- /dev/null +++ b/term/i386/vga_common.c @@ -0,0 +1,125 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2003,2005,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +grub_uint8_t grub_console_cur_color = 0x7; +static grub_uint8_t grub_console_standard_color = 0x7; +static grub_uint8_t grub_console_normal_color = 0x7; +static grub_uint8_t grub_console_highlight_color = 0x70; + +static grub_uint32_t +map_char (grub_uint32_t c) +{ + if (c > 0x7f) + { + /* Map some unicode characters to the VGA font, if possible. */ + switch (c) + { + case 0x2190: /* left arrow */ + c = 0x1b; + break; + case 0x2191: /* up arrow */ + c = 0x18; + break; + case 0x2192: /* right arrow */ + c = 0x1a; + break; + case 0x2193: /* down arrow */ + c = 0x19; + break; + case 0x2501: /* horizontal line */ + c = 0xc4; + break; + case 0x2503: /* vertical line */ + c = 0xb3; + break; + case 0x250F: /* upper-left corner */ + c = 0xda; + break; + case 0x2513: /* upper-right corner */ + c = 0xbf; + break; + case 0x2517: /* lower-left corner */ + c = 0xc0; + break; + case 0x251B: /* lower-right corner */ + c = 0xd9; + break; + + default: + c = '?'; + break; + } + } + + return c; +} + +void +grub_console_putchar (grub_uint32_t c) +{ + grub_console_real_putchar (map_char (c)); +} + +grub_ssize_t +grub_console_getcharwidth (grub_uint32_t c __attribute__ ((unused))) +{ + /* For now, every printable character has the width 1. */ + return 1; +} + +grub_uint16_t +grub_console_getwh (void) +{ + return (80 << 8) | 25; +} + +void +grub_console_setcolorstate (grub_term_color_state state) +{ + switch (state) { + case GRUB_TERM_COLOR_STANDARD: + grub_console_cur_color = grub_console_standard_color; + break; + case GRUB_TERM_COLOR_NORMAL: + grub_console_cur_color = grub_console_normal_color; + break; + case GRUB_TERM_COLOR_HIGHLIGHT: + grub_console_cur_color = grub_console_highlight_color; + break; + default: + break; + } +} + +void +grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color) +{ + grub_console_normal_color = normal_color; + grub_console_highlight_color = highlight_color; +} + +void +grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color) +{ + *normal_color = grub_console_normal_color; + *highlight_color = grub_console_highlight_color; +} From 976b07d0447c72455cf72e44ba68cb93b307f631 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 12 Nov 2008 17:43:39 +0000 Subject: [PATCH 0452/1707] 2008-11-12 Robert Millan Fix build problems on i386-ieee1275 and *-efi (introduced by vga_text split). * include/grub/i386/pc/console.h: Include `'. (grub_console_cur_color, grub_console_real_putchar) (grub_console_putchar, grub_console_getcharwidth, grub_console_getwh) (grub_console_setcolorstate, grub_console_setcolor) (grub_console_getcolor): Move from here ... * include/grub/i386/vga_common.h: ... to here (new file). * term/i386/pc/vga_text.c: Replace `' with `' and `' with `'. * term/i386/vga_common.c: Replace `' with `'. --- ChangeLog | 18 +++++++++++++++ DISTLIST | 1 + include/grub/i386/pc/console.h | 11 +--------- include/grub/i386/vga_common.h | 40 ++++++++++++++++++++++++++++++++++ term/i386/pc/vga_text.c | 4 ++-- term/i386/vga_common.c | 2 +- 6 files changed, 63 insertions(+), 13 deletions(-) create mode 100644 include/grub/i386/vga_common.h diff --git a/ChangeLog b/ChangeLog index 1b41d7e6a..1f92fa62f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2008-11-12 Robert Millan + + Fix build problems on i386-ieee1275 and *-efi (introduced by vga_text + split). + + * include/grub/i386/pc/console.h: Include `'. + (grub_console_cur_color, grub_console_real_putchar) + (grub_console_putchar, grub_console_getcharwidth, grub_console_getwh) + (grub_console_setcolorstate, grub_console_setcolor) + (grub_console_getcolor): Move from here ... + * include/grub/i386/vga_common.h: ... to here (new file). + + * term/i386/pc/vga_text.c: Replace `' with + `' and `' with + `'. + * term/i386/vga_common.c: Replace `' with + `'. + 2008-11-12 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `term/i386/vga_common.c'. diff --git a/DISTLIST b/DISTLIST index 87ab7ad8c..a283043bb 100644 --- a/DISTLIST +++ b/DISTLIST @@ -199,6 +199,7 @@ include/grub/i386/setjmp.h include/grub/i386/time.h include/grub/i386/tsc.h include/grub/i386/types.h +include/grub/i386/vga_common.h include/grub/i386/coreboot/boot.h include/grub/i386/coreboot/console.h include/grub/i386/coreboot/init.h diff --git a/include/grub/i386/pc/console.h b/include/grub/i386/pc/console.h index 480c21c42..2a74d152c 100644 --- a/include/grub/i386/pc/console.h +++ b/include/grub/i386/pc/console.h @@ -37,10 +37,9 @@ #include #include #include +#include /* These are global to share code between C and asm. */ -extern grub_uint8_t grub_console_cur_color; -void grub_console_real_putchar (int c); int grub_console_checkkey (void); int grub_console_getkey (void); grub_uint16_t grub_console_getxy (void); @@ -48,14 +47,6 @@ void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y); void grub_console_cls (void); void grub_console_setcursor (int on); -/* Provided by vga_common.c. */ -void grub_console_putchar (grub_uint32_t c); -grub_ssize_t grub_console_getcharwidth (grub_uint32_t c); -grub_uint16_t grub_console_getwh (void); -void grub_console_setcolorstate (grub_term_color_state state); -void grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color); -void grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color); - /* Initialize the console system. */ void grub_console_init (void); diff --git a/include/grub/i386/vga_common.h b/include/grub/i386/vga_common.h new file mode 100644 index 000000000..f17fc018a --- /dev/null +++ b/include/grub/i386/vga_common.h @@ -0,0 +1,40 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2005,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_VGA_COMMON_CPU_HEADER +#define GRUB_VGA_COMMON_CPU_HEADER 1 + +#include +#include +#include + +extern grub_uint8_t grub_console_cur_color; + +void grub_console_putchar (grub_uint32_t c); +grub_ssize_t grub_console_getcharwidth (grub_uint32_t c); +grub_uint16_t grub_console_getwh (void); +void grub_console_setcolorstate (grub_term_color_state state); +void grub_console_setcolor (grub_uint8_t normal_color, grub_uint8_t highlight_color); +void grub_console_getcolor (grub_uint8_t *normal_color, grub_uint8_t *highlight_color); + +/* Implemented in both kern/i386/pc/startup.S and vga_text.c; this symbol + is not exported, so there's no collision, but vga_common.c expects this + prototype to be the same. */ +void grub_console_real_putchar (int c); + +#endif /* ! GRUB_VGA_COMMON_CPU_HEADER */ diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index 5ffdde661..8b8aecb30 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -17,8 +17,8 @@ */ #include -#include -#include +#include +#include #include #define COLS 80 diff --git a/term/i386/vga_common.c b/term/i386/vga_common.c index 5c862396b..131b43ab6 100644 --- a/term/i386/vga_common.c +++ b/term/i386/vga_common.c @@ -16,7 +16,7 @@ * along with GRUB. If not, see . */ -#include +#include #include #include From fe8e8d69e1f531bbbc489a73dc60407fc64a123b Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 12 Nov 2008 20:53:48 +0000 Subject: [PATCH 0453/1707] 2008-11-12 Robert Millan Make loader/i386/linux.c buildable on i386-pc (although disabled). * include/grub/i386/pc/init.h: Include `'. (struct grub_machine_mmap_entry, grub_machine_mmap_iterate): Move from here ... * include/grub/i386/pc/memory.h: ... to here. --- ChangeLog | 9 +++++++++ include/grub/i386/pc/init.h | 14 +------------- include/grub/i386/pc/memory.h | 13 +++++++++++++ 3 files changed, 23 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1f92fa62f..ddba3f052 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-12 Robert Millan + + Make loader/i386/linux.c buildable on i386-pc (although disabled). + + * include/grub/i386/pc/init.h: Include `'. + (struct grub_machine_mmap_entry, grub_machine_mmap_iterate): Move + from here ... + * include/grub/i386/pc/memory.h: ... to here. + 2008-11-12 Robert Millan Fix build problems on i386-ieee1275 and *-efi (introduced by vga_text diff --git a/include/grub/i386/pc/init.h b/include/grub/i386/pc/init.h index 1a031db1e..f18a0dae4 100644 --- a/include/grub/i386/pc/init.h +++ b/include/grub/i386/pc/init.h @@ -21,6 +21,7 @@ #include #include +#include /* Get the memory size in KB. If EXTENDED is zero, return conventional memory, otherwise return extended memory. */ @@ -30,24 +31,11 @@ grub_uint16_t grub_get_memsize (int extended); in 1KB parts, and upper 16 bits are above 16MB in 64KB parts. */ grub_uint32_t grub_get_eisa_mmap (void); -struct grub_machine_mmap_entry -{ - grub_uint32_t size; - grub_uint64_t addr; - grub_uint64_t len; -#define GRUB_MACHINE_MEMORY_AVAILABLE 1 -#define GRUB_MACHINE_MEMORY_RESERVED 2 - grub_uint32_t type; -} __attribute__((packed)); - /* Get a memory map entry. Return next continuation value. Zero means the end. */ grub_uint32_t EXPORT_FUNC(grub_get_mmap_entry) (struct grub_machine_mmap_entry *entry, grub_uint32_t cont); -void EXPORT_FUNC(grub_machine_mmap_iterate) - (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); - /* Turn on/off Gate A20. */ void grub_gate_a20 (int on); diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index a3e3ed793..6a4830788 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -84,6 +84,19 @@ extern grub_size_t EXPORT_VAR(grub_lower_mem); extern grub_size_t EXPORT_VAR(grub_upper_mem); +struct grub_machine_mmap_entry +{ + grub_uint32_t size; + grub_uint64_t addr; + grub_uint64_t len; +#define GRUB_MACHINE_MEMORY_AVAILABLE 1 +#define GRUB_MACHINE_MEMORY_RESERVED 2 + grub_uint32_t type; +} __attribute__((packed)); + +void EXPORT_FUNC(grub_machine_mmap_iterate) + (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); + #endif #endif /* ! GRUB_MEMORY_MACHINE_HEADER */ From e2e078478e80aceac11f1722365a738b443904a3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 14 Nov 2008 17:57:39 +0000 Subject: [PATCH 0454/1707] 2008-11-14 Robert Millan * term/i386/pc/serial.c [! GRUB_MACHINE_PCBIOS] (GRUB_SERIAL_PORT_NUM): Fix misscalculation. --- ChangeLog | 5 +++++ term/i386/pc/serial.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ddba3f052..6018e6cc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-14 Robert Millan + + * term/i386/pc/serial.c [! GRUB_MACHINE_PCBIOS] + (GRUB_SERIAL_PORT_NUM): Fix misscalculation. + 2008-11-12 Robert Millan Make loader/i386/linux.c buildable on i386-pc (although disabled). diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 612492206..4cca42f46 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -70,7 +70,7 @@ static const unsigned short *serial_hw_io_addr = (const unsigned short *) 0x0400 #define GRUB_SERIAL_PORT_NUM 4 #else static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; -#define GRUB_SERIAL_PORT_NUM (sizeof(serial_hw_io_addr)/(serial_hw_io_addr[0])) +#define GRUB_SERIAL_PORT_NUM (sizeof(serial_hw_io_addr)/sizeof(serial_hw_io_addr[0])) #endif /* Return the port number for the UNITth serial device. */ From 10fc3eb9a78a8281c530a146048fd9d27bd79643 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 14 Nov 2008 19:04:26 +0000 Subject: [PATCH 0455/1707] 2008-11-14 Robert Millan * include/grub/i386/coreboot/memory.h (GRUB_MEMORY_MACHINE_LOWER_SIZE): Redefine to match with GRUB_MEMORY_MACHINE_UPPER_START (0x100000). We don't want to mess with lower memory, because it is used in the Linux loader. * loader/i386/linux.c (allocate_pages): Allocate `real_mode_mem' in an appropiate place in lower memory, between 0x10000 and 0x90000, like loader/i386/efi/linux.c does. Linux often panics if real_mode_mem is in our heap (probably as a result of it being corrupted during decompression). --- ChangeLog | 13 ++++++++++ include/grub/i386/coreboot/memory.h | 2 +- loader/i386/linux.c | 37 +++++++++++++++++++++-------- 3 files changed, 41 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6018e6cc8..89955178e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2008-11-14 Robert Millan + + * include/grub/i386/coreboot/memory.h (GRUB_MEMORY_MACHINE_LOWER_SIZE): + Redefine to match with GRUB_MEMORY_MACHINE_UPPER_START (0x100000). We + don't want to mess with lower memory, because it is used in the Linux + loader. + + * loader/i386/linux.c (allocate_pages): Allocate `real_mode_mem' in + an appropiate place in lower memory, between 0x10000 and 0x90000, + like loader/i386/efi/linux.c does. Linux often panics if real_mode_mem + is in our heap (probably as a result of it being corrupted during + decompression). + 2008-11-14 Robert Millan * term/i386/pc/serial.c [! GRUB_MACHINE_PCBIOS] diff --git a/include/grub/i386/coreboot/memory.h b/include/grub/i386/coreboot/memory.h index b1b015472..faac757bd 100644 --- a/include/grub/i386/coreboot/memory.h +++ b/include/grub/i386/coreboot/memory.h @@ -28,9 +28,9 @@ #endif #define GRUB_MEMORY_MACHINE_LOWER_USABLE 0x9fc00 /* 640 kiB - 1 kiB */ -#define GRUB_MEMORY_MACHINE_LOWER_SIZE 0xf0000 /* 960 kiB */ #define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ +#define GRUB_MEMORY_MACHINE_LOWER_SIZE GRUB_MEMORY_MACHINE_UPPER_START #ifndef ASM_FILE diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 20aea990b..333b9d6e7 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -142,23 +142,40 @@ allocate_pages (grub_size_t prot_size) real_mode_mem = 0; prot_mode_mem = 0; - real_mode_mem = grub_malloc (real_mode_pages << 12); - + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) + { + /* We must put real mode code in the traditional space. */ + + if (type == GRUB_MACHINE_MEMORY_AVAILABLE + && addr <= 0x90000) + { + if (addr < 0x10000) + { + size += addr - 0x10000; + addr = 0x10000; + } + + if (addr + size > 0x90000) + size = 0x90000 - addr; + + if (real_size + mmap_size > size) + return 0; + + real_mode_mem = (addr + size) - (real_size + mmap_size); + return 1; + } + + return 0; + } + grub_machine_mmap_iterate (hook); if (! real_mode_mem) { grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate real mode pages"); goto fail; } - /* Next, find free pages for the protected mode code. */ - /* XXX what happens if anything is using this address? */ prot_mode_mem = (void *) 0x100000; - if (! prot_mode_mem) - { - grub_error (GRUB_ERR_OUT_OF_MEMORY, - "cannot allocate protected mode pages"); - goto fail; - } grub_dprintf ("linux", "real_mode_mem = %lx, real_mode_pages = %x, " "prot_mode_mem = %lx, prot_mode_pages = %x\n", From dfab719fc83f2f4cc2e66c3a6350978e662643be Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 14 Nov 2008 20:08:47 +0000 Subject: [PATCH 0456/1707] 2008-11-14 Robert Millan * fs/cpio.c (grub_cpio_open): Compare `name' and `fn' by hand in order to cope with duplicate slashes. --- ChangeLog | 5 +++++ fs/cpio.c | 31 +++++++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89955178e..834efaca0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-14 Robert Millan + + * fs/cpio.c (grub_cpio_open): Compare `name' and `fn' by hand in + order to cope with duplicate slashes. + 2008-11-14 Robert Millan * include/grub/i386/coreboot/memory.h (GRUB_MEMORY_MACHINE_LOWER_SIZE): diff --git a/fs/cpio.c b/fs/cpio.c index 1692d6108..4965fe57d 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -262,6 +262,7 @@ grub_cpio_open (grub_file_t file, const char *name) struct grub_cpio_data *data; grub_uint32_t ofs; char *fn; + int i, j; #ifndef GRUB_UTIL grub_dl_ref (my_mod); @@ -283,15 +284,33 @@ grub_cpio_open (grub_file_t file, const char *name) break; } - if (grub_strcmp (name + 1, fn) == 0) + /* Compare NAME and FN by hand in order to cope with duplicate + slashes. */ + i = 1; + j = 0; + while (1) { - file->data = data; - file->size = data->size; - grub_free (fn); - - return GRUB_ERR_NONE; + if (name[i] != fn[j]) + goto no_match; + + if (name[i] == '\0') + break; + + if (name[i] == '/' && name[i+1] == '/') + i++; + + i++; + j++; } + file->data = data; + file->size = data->size; + grub_free (fn); + + return GRUB_ERR_NONE; + + no_match: + grub_free (fn); data->hofs = ofs; } From 2f2a3442573c97dd3cf60378c7acaf25894cec98 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 14 Nov 2008 20:18:07 +0000 Subject: [PATCH 0457/1707] Add #error instance with comment to explain why this loader isn't currently usable on PC/BIOS. --- ChangeLog | 3 ++- loader/i386/linux.c | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 834efaca0..c3bbea91d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -14,7 +14,8 @@ an appropiate place in lower memory, between 0x10000 and 0x90000, like loader/i386/efi/linux.c does. Linux often panics if real_mode_mem is in our heap (probably as a result of it being corrupted during - decompression). + decompression). Add #error instance with comment to explain why this + loader isn't currently usable on PC/BIOS. 2008-11-14 Robert Millan diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 333b9d6e7..085f1f1fa 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -142,6 +143,12 @@ allocate_pages (grub_size_t prot_size) real_mode_mem = 0; prot_mode_mem = 0; + /* i386-pc port adds lower memory to heap, which collides with + `real_mode_mem' allocation below. */ +#ifdef GRUB_MACHINE_PCBIOS +#error +#endif + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) { From ebaaf49b0229a4d3e6bc048f1329b37273192e19 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 19 Nov 2008 12:05:20 +0000 Subject: [PATCH 0458/1707] 2008-11-19 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. --- ChangeLog | 4 ++++ loader/i386/pc/linux.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c3bbea91d..d5b035292 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2008-11-19 Robert Millan + + * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. + 2008-11-14 Robert Millan * fs/cpio.c (grub_cpio_open): Compare `name' and `fn' by hand in diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index cd6ea3f0a..d34b5d721 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -347,7 +347,7 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) size = grub_file_size (file); - /* Put the initrd as high as possible, 4Ki aligned. */ + /* Put the initrd as high as possible, 4KiB aligned. */ addr = (addr_max - size) & ~0xFFF; if (addr < addr_min) From 929071106065207cfea29e3767b8ae7533581954 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 19 Nov 2008 12:11:44 +0000 Subject: [PATCH 0459/1707] * loader/i386/linux.c (grub_rescue_cmd_initrd): Implement a few needed constraints to initrd allocation (based on code from loader/i386/pc/linux.c). Without them, initrd was allocated too high for Linux to find it. --- ChangeLog | 4 ++++ loader/i386/linux.c | 28 +++++++++++++++++++++------- 2 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index d5b035292..49f32ce2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,10 @@ 2008-11-19 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. + * loader/i386/linux.c (grub_rescue_cmd_initrd): Implement a few needed + constraints to initrd allocation (based on code from + loader/i386/pc/linux.c). Without them, initrd was allocated too high + for Linux to find it. 2008-11-14 Robert Millan diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 085f1f1fa..98027b0ed 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -529,8 +529,21 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) initrd_pages = (page_align (size) >> 12); lh = (struct linux_kernel_header *) real_mode_mem; + + /* Get the highest address available for the initrd. */ + if (grub_le_to_cpu16 (lh->version) >= 0x0203) + { + addr_max = grub_cpu_to_le32 (lh->initrd_addr_max); + + /* XXX in reality, Linux specifies a bogus value, so + it is necessary to make sure that ADDR_MAX does not exceed + 0x3fffffff. */ + if (addr_max > GRUB_LINUX_INITRD_MAX_ADDRESS) + addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS; + } + else + addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS; - addr_max = (grub_cpu_to_le32 (lh->initrd_addr_max) << 10); if (linux_mem_size != 0 && linux_mem_size < addr_max) addr_max = linux_mem_size; @@ -544,18 +557,19 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) + page_align (size); - /* FIXME: This doesn't take addr_max & addr_min into account. */ - addr = (grub_addr_t) grub_malloc (page_align (size)); + if (addr_max > grub_os_area_addr + grub_os_area_size) + addr_max = grub_os_area_addr + grub_os_area_size; - if (addr == 0) + /* Put the initrd as high as possible, 4KiB aligned. */ + addr = (addr_max - size) & ~0xFFF; + + if (addr < addr_min) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "no free pages available"); + grub_error (GRUB_ERR_OUT_OF_RANGE, "The initrd is too big"); goto fail; } initrd_mem = (void *) addr; - if (! initrd_mem) - grub_fatal ("cannot allocate pages"); if (grub_file_read (file, initrd_mem, size) != size) { From 3cf6ac19e17a564335a273853f0b714a2fe71672 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 20 Nov 2008 18:07:10 +0000 Subject: [PATCH 0460/1707] 2008-11-19 Robert Millan * kern/i386/coreboot/init.c (grub_time_tics): Remove variable. (grub_get_rtc, grub_exit): Abort with grub_fatal() if called. --- ChangeLog | 5 +++++ kern/i386/coreboot/init.c | 8 ++------ 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 49f32ce2e..8009d8022 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-19 Robert Millan + + * kern/i386/coreboot/init.c (grub_time_tics): Remove variable. + (grub_get_rtc, grub_exit): Abort with grub_fatal() if called. + 2008-11-19 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 3a5005099..9978d4a17 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -43,13 +43,10 @@ extern char _end[]; grub_addr_t grub_os_area_addr; grub_size_t grub_os_area_size; -/* FIXME: we need interrupts to do this right */ -static grub_uint32_t grub_time_tics = 0; - grub_uint32_t grub_get_rtc (void) { - return grub_time_tics; + grub_fatal ("grub_get_rtc() is not implemented.\n"); } /* Stop the floppy drive from spinning, so that other software is @@ -63,8 +60,7 @@ grub_stop_floppy (void) void grub_exit (void) { - grub_printf ("grub_exit() is not implemented.\n"); - grub_stop (); + grub_fatal ("grub_exit() is not implemented.\n"); } void From 73e8e268b7ac5daec77ee44a596afde07f0cd35b Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 20 Nov 2008 19:22:20 +0000 Subject: [PATCH 0461/1707] * util/grub-mkconfig_lib.in (grub_warn): New function. (convert_system_path_to_grub_path): Use grub_warn() when issuing warnings, to obtain consistent formatting. * util/grub.d/00_header.in: Likewise. * util/update-grub_lib.in: Likewise. --- ChangeLog | 8 +++++++- util/grub-mkconfig_lib.in | 7 ++++++- util/grub.d/00_header.in | 2 +- util/update-grub_lib.in | 3 ++- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8009d8022..8517aed5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,14 @@ -2008-11-19 Robert Millan +2008-11-20 Robert Millan * kern/i386/coreboot/init.c (grub_time_tics): Remove variable. (grub_get_rtc, grub_exit): Abort with grub_fatal() if called. + * util/grub-mkconfig_lib.in (grub_warn): New function. + (convert_system_path_to_grub_path): Use grub_warn() when issuing + warnings, to obtain consistent formatting. + * util/grub.d/00_header.in: Likewise. + * util/update-grub_lib.in: Likewise. + 2008-11-19 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 83eb3b8d7..fb842f2d4 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -25,6 +25,11 @@ pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` +grub_warn () +{ + echo "Warning: $@" >&2 +} + make_system_path_relative_to_its_root () { path=$1 @@ -107,7 +112,7 @@ convert_system_path_to_grub_path () { path=$1 - echo "Warning: convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." >&2 + grub_warn "convert_system_path_to_grub_path() is deprecated. Use prepare_grub_to_access_device() instead." # abort if GRUB can't access the path if is_path_readable_by_grub ${path} ; then : ; else diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index fe17b6769..3d434d765 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -47,7 +47,7 @@ case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in fi if [ "x${GRUB_SERIAL_COMMAND}" = "x" ] ; then - echo "Warning, requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." >&2 + grub_warn "Requested serial terminal but GRUB_SERIAL_COMMAND is unspecified. Default parameters will be used." GRUB_SERIAL_COMMAND=serial fi echo "${GRUB_SERIAL_COMMAND}" diff --git a/util/update-grub_lib.in b/util/update-grub_lib.in index 25311ce2b..998452e67 100644 --- a/util/update-grub_lib.in +++ b/util/update-grub_lib.in @@ -18,5 +18,6 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ libdir=@libdir@ -echo "warning: update-grub_lib is deprecated, use grub-mkconfig_lib instead" >&2 . ${libdir}/grub/grub-mkconfig_lib + +grub_warn "update-grub_lib is deprecated, use grub-mkconfig_lib instead" From e94045a11015f02af1969bda091016e7a3190ea7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 20 Nov 2008 20:22:04 +0000 Subject: [PATCH 0462/1707] * loader/i386/linux.c (allocate_pages): Fix a warning. --- ChangeLog | 2 ++ loader/i386/linux.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8517aed5a..71a564de0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,8 @@ * util/grub.d/00_header.in: Likewise. * util/update-grub_lib.in: Likewise. + * loader/i386/linux.c (allocate_pages): Fix a warning. + 2008-11-19 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 98027b0ed..8b653cf2f 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -169,7 +169,7 @@ allocate_pages (grub_size_t prot_size) if (real_size + mmap_size > size) return 0; - real_mode_mem = (addr + size) - (real_size + mmap_size); + real_mode_mem = (void *) ((addr + size) - (real_size + mmap_size)); return 1; } From 40f9faa4de2560ffd3be705ba9acc149b5b2f0c0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 20 Nov 2008 20:25:30 +0000 Subject: [PATCH 0463/1707] Move comment text to `#error' stanza. --- ChangeLog | 1 + loader/i386/linux.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71a564de0..c78361cdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,7 @@ * util/update-grub_lib.in: Likewise. * loader/i386/linux.c (allocate_pages): Fix a warning. + Move comment text to `#error' stanza. 2008-11-19 Robert Millan diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 8b653cf2f..a5fbf041e 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -143,10 +143,8 @@ allocate_pages (grub_size_t prot_size) real_mode_mem = 0; prot_mode_mem = 0; - /* i386-pc port adds lower memory to heap, which collides with - `real_mode_mem' allocation below. */ #ifdef GRUB_MACHINE_PCBIOS -#error +#error i386-pc port adds lower memory to heap, which collides with `real_mode_mem' allocation below #endif auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); From 79d29fd7b805842ff83063d9dd1406b33a75f0d9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 20 Nov 2008 20:30:24 +0000 Subject: [PATCH 0464/1707] Harmonize ieee1275's grub_available_iterate() with the generic grub_machine_mmap_iterate() interface (fixes a recently-introduced build problem on i386-ieee1275): * kern/ieee1275/openfw.c (grub_available_iterate): Moved from here ... * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): ... here. Add third parameter `type'. Update all users of this function. * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/ieee1275/mmap.c'. * kern/ieee1275/init.c * include/grub/ieee1275/ieee1275.h (grub_available_iterate): Replace with ... (grub_machine_mmap_iterate): ... this. * include/grub/i386/pc/memory.h (grub_machine_mmap_iterate): Change return type to `grub_err_t'. Update all implementations of this function prototype. * include/grub/i386/coreboot/memory.h (grub_machine_mmap_iterate): Likewise. --- ChangeLog | 18 ++++++++ DISTLIST | 1 + conf/i386-ieee1275.mk | 13 ++++-- conf/i386-ieee1275.rmk | 1 + include/grub/i386/coreboot/memory.h | 3 +- include/grub/i386/pc/memory.h | 3 +- include/grub/ieee1275/ieee1275.h | 4 +- kern/i386/multiboot_mmap.c | 4 +- kern/i386/pc/mmap.c | 5 +- kern/ieee1275/init.c | 19 ++++---- kern/ieee1275/mmap.c | 71 +++++++++++++++++++++++++++++ kern/ieee1275/openfw.c | 49 -------------------- 12 files changed, 124 insertions(+), 67 deletions(-) create mode 100644 kern/ieee1275/mmap.c diff --git a/ChangeLog b/ChangeLog index c78361cdf..74a91ed22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -12,6 +12,24 @@ * loader/i386/linux.c (allocate_pages): Fix a warning. Move comment text to `#error' stanza. + Harmonize ieee1275's grub_available_iterate() with the generic + grub_machine_mmap_iterate() interface (fixes a recently-introduced + build problem on i386-ieee1275): + * kern/ieee1275/openfw.c (grub_available_iterate): Moved from here ... + * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): ... here. Add third + parameter `type'. Update all users of this function. + * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): Add + `kern/ieee1275/mmap.c'. + * kern/ieee1275/init.c + * include/grub/ieee1275/ieee1275.h (grub_available_iterate): Replace + with ... + (grub_machine_mmap_iterate): ... this. + * include/grub/i386/pc/memory.h (grub_machine_mmap_iterate): Change + return type to `grub_err_t'. Update all implementations of this + function prototype. + * include/grub/i386/coreboot/memory.h (grub_machine_mmap_iterate): + Likewise. + 2008-11-19 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. diff --git a/DISTLIST b/DISTLIST index a283043bb..b93b0a81c 100644 --- a/DISTLIST +++ b/DISTLIST @@ -334,6 +334,7 @@ kern/i386/pc/startup.S kern/ieee1275/cmain.c kern/ieee1275/ieee1275.c kern/ieee1275/init.c +kern/ieee1275/mmap.c kern/ieee1275/openfw.c kern/powerpc/cache.S kern/powerpc/dl.c diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 2d981d045..bad302fbf 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -14,6 +14,7 @@ pkglib_PROGRAMS = kernel.elf # For kernel.elf. kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/ieee1275/init.c \ + kern/ieee1275/mmap.c \ kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ @@ -26,11 +27,11 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ term/ieee1275/ofconsole.c \ disk/ieee1275/ofdisk.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -44,6 +45,10 @@ kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEP $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_init.d +kernel_elf-kern_ieee1275_mmap.o: kern/ieee1275/mmap.c $(kern/ieee1275/mmap.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_mmap.d + kernel_elf-kern_ieee1275_cmain.o: kern/ieee1275/cmain.c $(kern/ieee1275/cmain.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_cmain.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index bbd856640..1b96ca1d7 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -13,6 +13,7 @@ pkglib_PROGRAMS = kernel.elf # For kernel.elf. kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/ieee1275/init.c \ + kern/ieee1275/mmap.c \ kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ diff --git a/include/grub/i386/coreboot/memory.h b/include/grub/i386/coreboot/memory.h index faac757bd..434ae622e 100644 --- a/include/grub/i386/coreboot/memory.h +++ b/include/grub/i386/coreboot/memory.h @@ -24,6 +24,7 @@ #include #ifndef ASM_FILE +#include #include #endif @@ -61,7 +62,7 @@ typedef struct grub_linuxbios_mem_region *mem_region_t; void grub_machine_mmap_init (void); -void EXPORT_FUNC(grub_machine_mmap_iterate) +grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); #endif diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index 6a4830788..08e92a9f2 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -24,6 +24,7 @@ #include #ifndef ASM_FILE #include +#include #endif /* The scratch buffer used in real mode code. */ @@ -94,7 +95,7 @@ struct grub_machine_mmap_entry grub_uint32_t type; } __attribute__((packed)); -void EXPORT_FUNC(grub_machine_mmap_iterate) +grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); #endif diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 6f8f1ccb8..628d888cd 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -167,8 +167,8 @@ grub_err_t EXPORT_FUNC(grub_devalias_iterate) (int (*hook) (struct grub_ieee1275_devalias *alias)); grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath, int (*hook) (struct grub_ieee1275_devalias *alias)); -grub_err_t EXPORT_FUNC(grub_available_iterate) - (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t)); +grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) + (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); int EXPORT_FUNC(grub_claimmap) (grub_addr_t addr, grub_size_t size); char *EXPORT_FUNC(grub_ieee1275_encode_devname) (const char *path); diff --git a/kern/i386/multiboot_mmap.c b/kern/i386/multiboot_mmap.c index 16f155bac..8331bd5df 100644 --- a/kern/i386/multiboot_mmap.c +++ b/kern/i386/multiboot_mmap.c @@ -69,7 +69,7 @@ grub_machine_mmap_init () } } -void +grub_err_t grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) { struct grub_multiboot_mmap_entry *entry = (void *) kern_multiboot_info.mmap_addr; @@ -81,4 +81,6 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uin entry = (void *) ((grub_addr_t) entry + entry->size + sizeof (entry->size)); } + + return 0; } diff --git a/kern/i386/pc/mmap.c b/kern/i386/pc/mmap.c index 47aa53cff..d289c731d 100644 --- a/kern/i386/pc/mmap.c +++ b/kern/i386/pc/mmap.c @@ -18,9 +18,10 @@ #include #include +#include #include -void +grub_err_t grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) { grub_uint32_t cont; @@ -57,4 +58,6 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uin else hook (0x100000, grub_get_memsize (1) << 10, GRUB_MACHINE_MEMORY_AVAILABLE); } + + return 0; } diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index 71b7ba9c6..d345ba2dd 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -130,9 +130,12 @@ static void grub_claim_heap (void) { unsigned long total = 0; - auto int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t len); - int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t len) + auto int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t len, grub_uint32_t type); + int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t len, grub_uint32_t type) { + if (type != 1) + return 0; + len -= 1; /* Required for some firmware. */ /* Never exceed HEAP_MAX_SIZE */ @@ -174,9 +177,9 @@ static void grub_claim_heap (void) } if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_CANNOT_INTERPRET)) - heap_init (HEAP_MAX_ADDR - HEAP_MIN_SIZE, HEAP_MIN_SIZE); + heap_init (HEAP_MAX_ADDR - HEAP_MIN_SIZE, HEAP_MIN_SIZE, 1); else - grub_available_iterate (heap_init); + grub_machine_mmap_iterate (heap_init); } #ifdef __i386__ @@ -187,10 +190,10 @@ grub_uint32_t grub_upper_mem; static void grub_get_extended_memory (void) { - auto int NESTED_FUNC_ATTR find_ext_mem (grub_uint64_t addr, grub_uint64_t len); - int NESTED_FUNC_ATTR find_ext_mem (grub_uint64_t addr, grub_uint64_t len) + auto int NESTED_FUNC_ATTR find_ext_mem (grub_uint64_t addr, grub_uint64_t len, grub_uint32_t type); + int NESTED_FUNC_ATTR find_ext_mem (grub_uint64_t addr, grub_uint64_t len, grub_uint32_t type) { - if (addr == 0x100000) + if (type == 1 && addr == 0x100000) { grub_upper_mem = len; return 1; @@ -199,7 +202,7 @@ grub_get_extended_memory (void) return 0; } - grub_available_iterate (find_ext_mem); + grub_machine_mmap_iterate (find_ext_mem); } #endif diff --git a/kern/ieee1275/mmap.c b/kern/ieee1275/mmap.c new file mode 100644 index 000000000..5b30dbb9e --- /dev/null +++ b/kern/ieee1275/mmap.c @@ -0,0 +1,71 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +grub_err_t +grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) +{ + grub_ieee1275_phandle_t root; + grub_ieee1275_phandle_t memory; + grub_uint32_t available[32]; + grub_ssize_t available_size; + grub_uint32_t address_cells = 1; + grub_uint32_t size_cells = 1; + int i; + + /* Determine the format of each entry in `available'. */ + grub_ieee1275_finddevice ("/", &root); + grub_ieee1275_get_integer_property (root, "#address-cells", &address_cells, + sizeof address_cells, 0); + grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells, + sizeof size_cells, 0); + + /* Load `/memory/available'. */ + if (grub_ieee1275_finddevice ("/memory", &memory)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "Couldn't find /memory node"); + if (grub_ieee1275_get_integer_property (memory, "available", available, + sizeof available, &available_size)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "Couldn't examine /memory/available property"); + + /* Decode each entry and call `hook'. */ + i = 0; + available_size /= sizeof (grub_uint32_t); + while (i < available_size) + { + grub_uint64_t address; + grub_uint64_t size; + + address = available[i++]; + if (address_cells == 2) + address = (address << 32) | available[i++]; + + size = available[i++]; + if (size_cells == 2) + size = (size << 32) | available[i++]; + + if (hook (address, size, GRUB_MACHINE_MEMORY_AVAILABLE)) + break; + } + + return grub_errno; +} diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index ac97a5920..e88f3b338 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -147,55 +147,6 @@ nextprop: return 0; } -grub_err_t grub_available_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t)) -{ - grub_ieee1275_phandle_t root; - grub_ieee1275_phandle_t memory; - grub_uint32_t available[32]; - grub_ssize_t available_size; - grub_uint32_t address_cells = 1; - grub_uint32_t size_cells = 1; - int i; - - /* Determine the format of each entry in `available'. */ - grub_ieee1275_finddevice ("/", &root); - grub_ieee1275_get_integer_property (root, "#address-cells", &address_cells, - sizeof address_cells, 0); - grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells, - sizeof size_cells, 0); - - /* Load `/memory/available'. */ - if (grub_ieee1275_finddevice ("/memory", &memory)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "Couldn't find /memory node"); - if (grub_ieee1275_get_integer_property (memory, "available", available, - sizeof available, &available_size)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "Couldn't examine /memory/available property"); - - /* Decode each entry and call `hook'. */ - i = 0; - available_size /= sizeof (grub_uint32_t); - while (i < available_size) - { - grub_uint64_t address; - grub_uint64_t size; - - address = available[i++]; - if (address_cells == 2) - address = (address << 32) | available[i++]; - - size = available[i++]; - if (size_cells == 2) - size = (size << 32) | available[i++]; - - if (hook (address, size)) - break; - } - - return grub_errno; -} - /* Call the "map" method of /chosen/mmu. */ static int grub_map (grub_addr_t phys, grub_addr_t virt, grub_uint32_t size, From 60d6b16e1e134448441c96d1c7f3d4f40181ee5a Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 20 Nov 2008 20:34:14 +0000 Subject: [PATCH 0465/1707] Add `lsmmap' command (lists firmware-provided memory map): * commands/lsmmap.c: New file. * conf/i386-pc.rmk (pkglib_MODULES): Add `lsmmap.mod'. (lsmmap_mod_SOURCES, lsmmap_mod_CFLAGS, lsmmap_mod_LDFLAGS): New variables. * conf/powerpc-ieee1275.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. --- ChangeLog | 9 ++++++ DISTLIST | 1 + commands/lsmmap.c | 52 +++++++++++++++++++++++++++++++++ conf/i386-coreboot.mk | 60 ++++++++++++++++++++++++++++++++++++++- conf/i386-coreboot.rmk | 8 +++++- conf/i386-ieee1275.mk | 59 +++++++++++++++++++++++++++++++++++++- conf/i386-ieee1275.rmk | 7 ++++- conf/i386-pc.mk | 59 +++++++++++++++++++++++++++++++++++++- conf/i386-pc.rmk | 7 ++++- conf/powerpc-ieee1275.mk | 60 ++++++++++++++++++++++++++++++++++++++- conf/powerpc-ieee1275.rmk | 8 +++++- 11 files changed, 322 insertions(+), 8 deletions(-) create mode 100644 commands/lsmmap.c diff --git a/ChangeLog b/ChangeLog index 74a91ed22..dbad92b0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -30,6 +30,15 @@ * include/grub/i386/coreboot/memory.h (grub_machine_mmap_iterate): Likewise. + Add `lsmmap' command (lists firmware-provided memory map): + * commands/lsmmap.c: New file. + * conf/i386-pc.rmk (pkglib_MODULES): Add `lsmmap.mod'. + (lsmmap_mod_SOURCES, lsmmap_mod_CFLAGS, lsmmap_mod_LDFLAGS): New + variables. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + 2008-11-19 Robert Millan * loader/i386/pc/linux.c (grub_rescue_cmd_initrd): Fix a typo. diff --git a/DISTLIST b/DISTLIST index b93b0a81c..314b9c738 100644 --- a/DISTLIST +++ b/DISTLIST @@ -48,6 +48,7 @@ commands/help.c commands/hexdump.c commands/loadenv.c commands/ls.c +commands/lsmmap.c commands/lspci.c commands/read.c commands/reboot.c diff --git a/commands/lsmmap.c b/commands/lsmmap.c new file mode 100644 index 000000000..d2e53656c --- /dev/null +++ b/commands/lsmmap.c @@ -0,0 +1,52 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +static grub_err_t +grub_cmd_lsmmap (struct grub_arg_list *state __attribute__ ((unused)), + int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) + +{ + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) + { + grub_printf ("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n", + addr, size, type); + return 0; + } + grub_machine_mmap_iterate (hook); + + return 0; +} + + +GRUB_MOD_INIT(lsmmap) +{ + (void) mod; /* To stop warning. */ + grub_register_command ("lsmmap", grub_cmd_lsmmap, GRUB_COMMAND_FLAG_BOTH, + "lsmmap", "List memory map provided by firmware.", 0); +} + +GRUB_MOD_FINI(lsmmap) +{ + grub_unregister_command ("lsmmap"); +} diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 982a1b4a2..4c087293e 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -570,7 +570,8 @@ pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ - halt.mod datetime.mod date.mod datehook.mod + halt.mod datetime.mod date.mod datehook.mod \ + lsmmap.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/linux.c @@ -1929,5 +1930,62 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst +ifneq ($(lsmmap_mod_EXPORTS),no) +CLEANFILES += def-lsmmap.lst +DEFSYMFILES += def-lsmmap.lst +endif +MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d +UNDSYMFILES += und-lsmmap.lst + +lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o + +mod-lsmmap.o: mod-lsmmap.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< + +mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lsmmap_mod_EXPORTS),no) +def-lsmmap.lst: pre-lsmmap.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ +endif + +und-lsmmap.lst: pre-lsmmap.o + echo 'lsmmap' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< +-include lsmmap_mod-commands_lsmmap.d + +CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst +COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst +FSFILES += fs-lsmmap_mod-commands_lsmmap.lst +PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst + +cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + +fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + +partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + + +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 48f679535..0635378b1 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -95,7 +95,8 @@ pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ - halt.mod datetime.mod date.mod datehook.mod + halt.mod datetime.mod date.mod datehook.mod \ + lsmmap.mod # For _linux.mod. _linux_mod_SOURCES = loader/i386/linux.c @@ -190,5 +191,10 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index bad302fbf..5923b6f02 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -588,7 +588,7 @@ grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPE pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ - date.mod datehook.mod + date.mod datehook.mod lsmmap.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -1889,5 +1889,62 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst +ifneq ($(lsmmap_mod_EXPORTS),no) +CLEANFILES += def-lsmmap.lst +DEFSYMFILES += def-lsmmap.lst +endif +MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d +UNDSYMFILES += und-lsmmap.lst + +lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o + +mod-lsmmap.o: mod-lsmmap.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< + +mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lsmmap_mod_EXPORTS),no) +def-lsmmap.lst: pre-lsmmap.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ +endif + +und-lsmmap.lst: pre-lsmmap.o + echo 'lsmmap' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< +-include lsmmap_mod-commands_lsmmap.d + +CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst +COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst +FSFILES += fs-lsmmap_mod-commands_lsmmap.lst +PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst + +cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + +fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + +partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + + +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 1b96ca1d7..ce11a257b 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -99,7 +99,7 @@ grub_install_SOURCES = util/ieee1275/grub-install.in pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ - date.mod datehook.mod + date.mod datehook.mod lsmmap.mod # For normal.mod. normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ @@ -193,5 +193,10 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 4c413ef34..7f8fb90e7 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -930,7 +930,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ videotest.mod play.mod bitmap.mod tga.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ - datehook.mod + datehook.mod lsmmap.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -3336,5 +3336,62 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst +ifneq ($(lsmmap_mod_EXPORTS),no) +CLEANFILES += def-lsmmap.lst +DEFSYMFILES += def-lsmmap.lst +endif +MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d +UNDSYMFILES += und-lsmmap.lst + +lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o + +mod-lsmmap.o: mod-lsmmap.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< + +mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lsmmap_mod_EXPORTS),no) +def-lsmmap.lst: pre-lsmmap.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ +endif + +und-lsmmap.lst: pre-lsmmap.o + echo 'lsmmap' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< +-include lsmmap_mod-commands_lsmmap.d + +CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst +COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst +FSFILES += fs-lsmmap_mod-commands_lsmmap.lst +PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst + +cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + +fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + +partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + + +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 975df39c8..81fa3f070 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -165,7 +165,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ videotest.mod play.mod bitmap.mod tga.mod serial.mod \ ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ - datehook.mod + datehook.mod lsmmap.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -352,5 +352,10 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index c924a3457..908c6a314 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -581,7 +581,8 @@ pkglib_MODULES = halt.mod \ suspend.mod \ _multiboot.mod \ multiboot.mod \ - memdisk.mod + memdisk.mod \ + lsmmap.mod # For _linux.mod. _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c @@ -1407,5 +1408,62 @@ partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCI memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst +ifneq ($(lsmmap_mod_EXPORTS),no) +CLEANFILES += def-lsmmap.lst +DEFSYMFILES += def-lsmmap.lst +endif +MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d +UNDSYMFILES += und-lsmmap.lst + +lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o + -rm -f $@ + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o + +mod-lsmmap.o: mod-lsmmap.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< + +mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(lsmmap_mod_EXPORTS),no) +def-lsmmap.lst: pre-lsmmap.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ +endif + +und-lsmmap.lst: pre-lsmmap.o + echo 'lsmmap' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< +-include lsmmap_mod-commands_lsmmap.d + +CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst +COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst +FSFILES += fs-lsmmap_mod-commands_lsmmap.lst +PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst + +cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + +fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + +partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + + +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 9460ba46f..5b2bf53f3 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -106,7 +106,8 @@ pkglib_MODULES = halt.mod \ suspend.mod \ _multiboot.mod \ multiboot.mod \ - memdisk.mod + memdisk.mod \ + lsmmap.mod # For _linux.mod. _linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c @@ -160,5 +161,10 @@ memdisk_mod_SOURCES = disk/memdisk.c memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk From bc3a2f31151c91acb59c5cfbe1c864b5d2d2637c Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 22 Nov 2008 14:56:52 +0000 Subject: [PATCH 0466/1707] 2008-11-22 Robert Millan Fix breakage on coreboot due to declaration missmatch. * term/i386/pc/vga_text.c (grub_vga_text_init_fini): New function. (grub_vga_text_term): Use grub_vga_text_init_fini() instead of grub_vga_text_cls(). --- ChangeLog | 7 +++++++ term/i386/pc/vga_text.c | 11 +++++++++-- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index dbad92b0c..755112460 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-22 Robert Millan + + Fix breakage on coreboot due to declaration missmatch. + * term/i386/pc/vga_text.c (grub_vga_text_init_fini): New function. + (grub_vga_text_term): Use grub_vga_text_init_fini() instead of + grub_vga_text_cls(). + 2008-11-20 Robert Millan * kern/i386/coreboot/init.c (grub_time_tics): Remove variable. diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index 8b8aecb30..0649262d5 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -142,11 +142,18 @@ grub_vga_text_setcursor (int on) grub_outb (old | CRTC_CURSOR_DISABLE, CRTC_DATA_PORT); } +static grub_err_t +grub_vga_text_init_fini () +{ + grub_vga_text_cls (); + return 0; +} + static struct grub_term_output grub_vga_text_term = { .name = "vga_text", - .init = grub_vga_text_cls, - .fini = grub_vga_text_cls, + .init = grub_vga_text_init_fini, + .fini = grub_vga_text_init_fini, .putchar = grub_console_putchar, .getcharwidth = grub_console_getcharwidth, .getwh = grub_console_getwh, From 80fc88f22dba0b213c208202807ee7311f6d7e9a Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 22 Nov 2008 15:00:39 +0000 Subject: [PATCH 0467/1707] * kern/i386/loader.S (grub_multiboot_backward_relocator): Improve comments. Avoid copiing one more byte than necessary (just in case). --- ChangeLog | 3 +++ kern/i386/loader.S | 20 ++++++++++++++------ 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 755112460..5a6d71773 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ (grub_vga_text_term): Use grub_vga_text_init_fini() instead of grub_vga_text_cls(). + * kern/i386/loader.S (grub_multiboot_backward_relocator): Improve + comments. Avoid copiing one more byte than necessary (just in case). + 2008-11-20 Robert Millan * kern/i386/coreboot/init.c (grub_time_tics): Remove variable. diff --git a/kern/i386/loader.S b/kern/i386/loader.S index 8f146d92e..cacbbea73 100644 --- a/kern/i386/loader.S +++ b/kern/i386/loader.S @@ -141,24 +141,32 @@ VARIABLE(grub_multiboot_payload_entry_offset) * edx: Offset of the entry point (relative to the beginning of the block). */ VARIABLE(grub_multiboot_forward_relocator) - cld + /* Add entry offset. */ addl %edi, %edx + + /* Forward copy. */ + cld rep movsb + jmp *%edx VARIABLE(grub_multiboot_forward_relocator_end) VARIABLE(grub_multiboot_backward_relocator) + /* Add entry offset (before %edi is mangled). */ + addl %edi, %edx + + /* Backward movsb is implicitly off-by-one. compensate that. */ + decl %esi + decl %edi + + /* Backward copy. */ std addl %ecx, %esi addl %ecx, %edi - /* backward movsb is implicitly off-by-one. compensate that. */ - incl %ecx rep movsb - /* same problem again. */ - incl %edi - addl %edi, %edx + jmp *%edx VARIABLE(grub_multiboot_backward_relocator_end) From cbf36fd39d5849600e0c7ec4d9ce75a82032546f Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 22 Nov 2008 20:13:22 +0000 Subject: [PATCH 0468/1707] * conf/powerpc-ieee1275.rmk (kernel_elf_LDFLAGS): Change link address to 0x200000 (avoids trouble with some OFW implementations, and matches with the one in Yaboot). Reported by Manoel Abranches --- ChangeLog | 5 +++++ conf/powerpc-ieee1275.mk | 2 +- conf/powerpc-ieee1275.rmk | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5a6d71773..beccd79c1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ * kern/i386/loader.S (grub_multiboot_backward_relocator): Improve comments. Avoid copiing one more byte than necessary (just in case). + * conf/powerpc-ieee1275.rmk (kernel_elf_LDFLAGS): Change link address + to 0x200000 (avoids trouble with some OFW implementations, and matches + with the one in Yaboot). + Reported by Manoel Abranches + 2008-11-20 Robert Millan * kern/i386/coreboot/init.c (grub_time_tics): Remove variable. diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 908c6a314..5139fbdcc 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -548,7 +548,7 @@ kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ - -Wl,-N,-S,-Ttext,0x10000,-Bstatic + -Wl,-N,-S,-Ttext,0x200000,-Bstatic # Scripts. sbin_SCRIPTS = grub-install diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 5b2bf53f3..014bf412f 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -85,7 +85,7 @@ kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ - -Wl,-N,-S,-Ttext,0x10000,-Bstatic + -Wl,-N,-S,-Ttext,0x200000,-Bstatic # Scripts. sbin_SCRIPTS = grub-install From 9fc5388a5da00a9a1d38859d018a73c9da49f143 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 25 Nov 2008 16:40:17 +0000 Subject: [PATCH 0469/1707] 2008-11-25 Felix Zielcke * util/grub-fstest.c (grub_term_get_current_input): Change return type to `grub_term_input_t'. (grub_term_get_current_output): Change return type to `grub_term_output_t'. --- ChangeLog | 7 +++++++ util/grub-fstest.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index beccd79c1..29dfbabaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2008-11-25 Felix Zielcke + + * util/grub-fstest.c (grub_term_get_current_input): Change return type + to `grub_term_input_t'. + (grub_term_get_current_output): Change return type to + `grub_term_output_t'. + 2008-11-22 Robert Millan Fix breakage on coreboot due to declaration missmatch. diff --git a/util/grub-fstest.c b/util/grub-fstest.c index b622f8491..ca25425ae 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -53,13 +53,13 @@ grub_getkey (void) return -1; } -grub_term_t +grub_term_input_t grub_term_get_current_input (void) { return 0; } -grub_term_t +grub_term_output_t grub_term_get_current_output (void) { return 0; From 893137807d6f209ec5a55f700253afd2d819c5e1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 28 Nov 2008 19:56:19 +0000 Subject: [PATCH 0470/1707] 2008-11-28 Robert Millan Fix build on powerpc-ieee1275. Based on patch created by Manoel Abranches . * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/ieee1275/mmap.c'. * include/grub/powerpc/ieee1275/memory.h: New file. --- ChangeLog | 8 ++++++++ DISTLIST | 1 + conf/powerpc-ieee1275.mk | 16 +++++++++++----- conf/powerpc-ieee1275.rmk | 4 +++- include/grub/powerpc/ieee1275/memory.h | 24 ++++++++++++++++++++++++ 5 files changed, 47 insertions(+), 6 deletions(-) create mode 100644 include/grub/powerpc/ieee1275/memory.h diff --git a/ChangeLog b/ChangeLog index 29dfbabaf..6e474ee67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2008-11-28 Robert Millan + + Fix build on powerpc-ieee1275. Based on patch created by + Manoel Abranches . + * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add + `kern/ieee1275/mmap.c'. + * include/grub/powerpc/ieee1275/memory.h: New file. + 2008-11-25 Felix Zielcke * util/grub-fstest.c (grub_term_get_current_input): Change return type diff --git a/DISTLIST b/DISTLIST index 314b9c738..f86844285 100644 --- a/DISTLIST +++ b/DISTLIST @@ -261,6 +261,7 @@ include/grub/powerpc/ieee1275/ieee1275.h include/grub/powerpc/ieee1275/kernel.h include/grub/powerpc/ieee1275/loader.h include/grub/powerpc/ieee1275/machine.h +include/grub/powerpc/ieee1275/memory.h include/grub/powerpc/ieee1275/time.h include/grub/powerpc/ieee1275/util/biosdisk.h include/grub/sparc64/libgcc.h diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 5139fbdcc..c98197d04 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -425,16 +425,18 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/ieee1275/init.c term/ieee1275/ofconsole.c \ + kern/ieee1275/init.c \ + kern/ieee1275/mmap.c \ + term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_powerpc_ieee1275_startup.o: kern/powerpc/ieee1275/startup.S $(kern/powerpc/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -500,6 +502,10 @@ kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEP $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_init.d +kernel_elf-kern_ieee1275_mmap.o: kern/ieee1275/mmap.c $(kern/ieee1275/mmap.c_DEPENDENCIES) + $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_ieee1275_mmap.d + kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-term_ieee1275_ofconsole.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 014bf412f..f22540f0a 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -76,7 +76,9 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/ieee1275/init.c term/ieee1275/ofconsole.c \ + kern/ieee1275/init.c \ + kern/ieee1275/mmap.c \ + term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ diff --git a/include/grub/powerpc/ieee1275/memory.h b/include/grub/powerpc/ieee1275/memory.h new file mode 100644 index 000000000..23e282f93 --- /dev/null +++ b/include/grub/powerpc/ieee1275/memory.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MEMORY_MACHINE_HEADER +#define GRUB_MEMORY_MACHINE_HEADER 1 + +#define GRUB_MACHINE_MEMORY_AVAILABLE 1 + +#endif From 15257703ebe95599f4f98a716f76293a3a5569d2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 28 Nov 2008 20:06:55 +0000 Subject: [PATCH 0471/1707] Provide grub-install on coreboot. * conf/i386-coreboot.rmk (sbin_SCRIPTS): Add `grub-install'. (grub_install_SOURCES): New variable. * util/i386/pc/grub-install.in: Add a few condition checks to make it usable on coreboot. --- ChangeLog | 6 ++++ conf/i386-coreboot.mk | 9 ++++++ conf/i386-coreboot.rmk | 3 ++ util/i386/pc/grub-install.in | 57 +++++++++++++++++++++++++++--------- 4 files changed, 61 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e474ee67..47c523ac5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,12 @@ `kern/ieee1275/mmap.c'. * include/grub/powerpc/ieee1275/memory.h: New file. + Provide grub-install on coreboot. + * conf/i386-coreboot.rmk (sbin_SCRIPTS): Add `grub-install'. + (grub_install_SOURCES): New variable. + * util/i386/pc/grub-install.in: Add a few condition checks to make it + usable on coreboot. + 2008-11-25 Felix Zielcke * util/grub-fstest.c (grub_term_get_current_input): Change return type diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 4c087293e..1689f6d78 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -565,6 +565,15 @@ grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) grub_emu_LDFLAGS = $(LIBCURSES) +sbin_SCRIPTS += grub-install +grub_install_SOURCES = util/i386/pc/grub-install.in +CLEANFILES += grub-install + +grub-install: util/i386/pc/grub-install.in $(util/i386/pc/grub-install.in_DEPENDENCIES) config.status + ./config.status --file=grub-install:util/i386/pc/grub-install.in + chmod +x $@ + + # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 0635378b1..ac9ea8f74 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -90,6 +90,9 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_emu_LDFLAGS = $(LIBCURSES) +sbin_SCRIPTS += grub-install +grub_install_SOURCES = util/i386/pc/grub-install.in + # Modules. pkglib_MODULES = _linux.mod linux.mod normal.mod \ _multiboot.mod multiboot.mod aout.mod \ diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 4b39cbfdd..ff1ed1e75 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -32,7 +32,11 @@ platform=@platform@ pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` grub_setup=${sbindir}/`echo grub-setup | sed ${transform}` -grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then + grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +else + grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}` +fi grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` rootdir= @@ -153,12 +157,14 @@ device_map=${grubdir}/device.map grub_probe="${grub_probe} --device-map=${device_map}" # Check if GRUB is installed. -set $grub_setup dummy -if test -f "$1"; then - : -else - echo "$1: Not found." 1>&2 - exit 1 +if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then + set $grub_setup dummy + if test -f "$1"; then + : + else + echo "$1: Not found." 1>&2 + exit 1 + fi fi set $grub_mkimage dummy @@ -210,9 +216,14 @@ for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img; do rm -f $file || exit 1 fi done -for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst ${pkglibdir}/*.img; do +for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do cp -f $file ${grubdir} || exit 1 done +if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then + for file in ${pkglibdir}/*.img; do + cp -f $file ${grubdir} || exit 1 + done +fi # Write device to a variable so we don't have to traverse /dev every time. grub_device=`$grub_probe --target=device ${grubdir}` @@ -234,7 +245,12 @@ partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/nul devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` # The order in this list is critical. Be careful when modifying it. -modules="$modules $fs_module $partmap_module biosdisk $devabstraction_module" +if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then + modules="$modules biosdisk" +else + modules="$modules ata" +fi +modules="$modules $fs_module $partmap_module $devabstraction_module" prefix_drive= if [ "x${devabstraction_module}" = "x" ] ; then @@ -248,7 +264,16 @@ if [ "x${devabstraction_module}" = "x" ] ; then # Strip partition number install_drive="`echo ${install_drive} | sed -e s/,[0-9]*//g`" grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*//g`" - if [ "x${grub_drive}" != "x${install_drive}" ] ; then + if [ "${target_cpu}-${platform}" != "i386-pc" ] ; then + # generic method (used on coreboot) + uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" + if [ "x${uuid}" = "x" ] ; then + echo "UUID needed on this platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + exit 1 + fi + prefix_drive="(UUID=${uuid})" + modules="$modules fs_uuid" + elif [ "x${grub_drive}" != "x${install_drive}" ] ; then uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" if [ "x${uuid}" = "x" ] ; then echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 @@ -266,11 +291,15 @@ if [ "x${relative_grubdir}" = "x" ] ; then relative_grubdir=/ fi -$grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 +if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then + $grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 -# Now perform the installation. -$grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} \ - ${install_device} || exit 1 + # Now perform the installation. + $grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} \ + ${install_device} || exit 1 +else + $grub_mkimage -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 +fi # Prompt the user to check if the device map is correct. echo "Installation finished. No error reported." From 0c5e79ab5f46f4e9a07f3142e40f23bb4394b74f Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 28 Nov 2008 20:10:36 +0000 Subject: [PATCH 0472/1707] 2008-11-28 Krzysztof Smiechowicz * fs/affs.c (grub_affs_iterate_dir): Return failure when directory iteration failed. * fs/sfs.c (grub_sfs_iterate_dir): Likewise. --- ChangeLog | 6 ++++++ fs/affs.c | 2 +- fs/sfs.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 47c523ac5..f3b277020 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-11-28 Krzysztof Smiechowicz + + * fs/affs.c (grub_affs_iterate_dir): Return failure when directory + iteration failed. + * fs/sfs.c (grub_sfs_iterate_dir): Likewise. + 2008-11-28 Robert Millan Fix build on powerpc-ieee1275. Based on patch created by diff --git a/fs/affs.c b/fs/affs.c index c60fd9cf2..bc7bc218b 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -381,7 +381,7 @@ grub_affs_iterate_dir (grub_fshelp_node_t dir, fail: grub_free (node); grub_free (hashtable); - return 1; + return 0; } diff --git a/fs/sfs.c b/fs/sfs.c index c92e57cfd..910bbf2c8 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -451,7 +451,7 @@ grub_sfs_iterate_dir (grub_fshelp_node_t dir, fail: grub_free (objc_data); - return 1; + return 0; } From 7fd0ee30f823f9f9508d51e9f8f120e396dae244 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 29 Nov 2008 21:05:59 +0000 Subject: [PATCH 0473/1707] 2008-11-29 Robert Millan * disk/ata.c (grub_ata_pciinit): Handle errors rised by grub_ata_device_initialize() calls. --- ChangeLog | 5 +++++ disk/ata.c | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+) diff --git a/ChangeLog b/ChangeLog index f3b277020..6f4934cf6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-11-29 Robert Millan + + * disk/ata.c (grub_ata_pciinit): Handle errors rised by + grub_ata_device_initialize() calls. + 2008-11-28 Krzysztof Smiechowicz * fs/affs.c (grub_affs_iterate_dir): Return failure when directory diff --git a/disk/ata.c b/disk/ata.c index 214a2cac7..6e0b8b805 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -541,7 +541,25 @@ grub_ata_pciinit (int bus, int device, int func, if (rega && regb) { grub_ata_device_initialize (controller * 2 + i, 0, rega, regb); + + /* Most errors rised by grub_ata_device_initialize() are harmless. + They just indicate this particular drive is not responding, most + likely because it doesn't exist. We might want to ignore specific + error types here, instead of printing them. */ + if (grub_errno) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + } + grub_ata_device_initialize (controller * 2 + i, 1, rega, regb); + + /* Likewise. */ + if (grub_errno) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + } } } From 3ced05cf170caf1c34c5be507922a176169149ef Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 12 Dec 2008 04:12:05 +0000 Subject: [PATCH 0474/1707] 2008-12-12 Alex Smith * fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection at a time limit of the PXE TFTP API correctly. (grub_pxefs_close): Likewise. --- ChangeLog | 6 ++++++ fs/i386/pc/pxe.c | 16 ++++++++++++++-- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6f4934cf6..f3864223d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2008-12-12 Alex Smith + + * fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection + at a time limit of the PXE TFTP API correctly. + (grub_pxefs_close): Likewise. + 2008-11-29 Robert Millan * disk/ata.c (grub_ata_pciinit): Handle errors rised by diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index f5f215ff4..f52d61188 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -125,6 +125,12 @@ grub_pxefs_open (struct grub_file *file, const char *name) struct grub_pxe_data *data; grub_file_t file_int, bufio; + if (curr_file != 0) + { + grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &c.c2); + curr_file = 0; + } + c.c1.server_ip = grub_pxe_server_ip; c.c1.gateway_ip = grub_pxe_gateway_ip; grub_strcpy (c.c1.filename, name); @@ -190,7 +196,8 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) { struct grub_pxenv_tftp_open o; - grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &o); + if (curr_file != 0) + grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &o); o.server_ip = grub_pxe_server_ip; o.gateway_ip = grub_pxe_gateway_ip; @@ -227,7 +234,12 @@ grub_pxefs_close (grub_file_t file) { struct grub_pxenv_tftp_close c; - grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &c); + if (curr_file == file) + { + grub_pxe_call (GRUB_PXENV_TFTP_CLOSE, &c); + curr_file = 0; + } + grub_free (file->data); return GRUB_ERR_NONE; From 278922e80b445894e5cd839d883c0b6ea3b83188 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 28 Dec 2008 16:20:30 +0000 Subject: [PATCH 0475/1707] 2008-12-28 Felix Zielcke * util/getroot.c (grub_util_get_grub_dev): Add support for /dev/md/dNNpNN style partitionable mdraid devices. --- ChangeLog | 5 +++++ util/getroot.c | 19 +++++++++++++++++-- 2 files changed, 22 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3864223d..301346eb2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2008-12-28 Felix Zielcke + + * util/getroot.c (grub_util_get_grub_dev): Add support for + /dev/md/dNNpNN style partitionable mdraid devices. + 2008-12-12 Alex Smith * fs/i386/pc/pxe.c (grub_pxefs_open): Handle the one open connection diff --git a/util/getroot.c b/util/getroot.c index ae2a07556..ffb581da8 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -441,11 +441,26 @@ grub_util_get_grub_dev (const char *os_dev) if (os_dev[7] == '_' && os_dev[8] == 'd') { /* This a partitionable RAID device of the form /dev/md_dNNpMM. */ - - char *p , *q; + + char *p, *q; p = strdup (os_dev + sizeof ("/dev/md_d") - 1); + q = strchr (p, 'p'); + if (q) + *q = ','; + + asprintf (&grub_dev, "md%s", p); + free (p); + } + else if (os_dev[7] == '/' && os_dev[8] == 'd') + { + /* This a partitionable RAID device of the form /dev/md/dNNpMM. */ + + char *p, *q; + + p = strdup (os_dev + sizeof ("/dev/md/d") - 1); + q = strchr (p, 'p'); if (q) *q = ','; From 1e901a7573970dadc8dff64403573cc8d64afb37 Mon Sep 17 00:00:00 2001 From: chaac Date: Fri, 2 Jan 2009 15:26:06 +0000 Subject: [PATCH 0476/1707] 2009-01-02 Colin D Bennett MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit New font engine. Additional changes by Vesa Jääskeläinen to adapt to build system and fixed gfxterm.c to work with different sized fonts. * configure.ac: Changed UNIFONT_HEX to UNIFONT_BDF. * configure: Re-generated. * DISTLIST: Removed font/manager.c. Added font/font.c. Added font/font_cmd.c. * Makefile.in: Changed UNIFONT_HEX to UNIFONT_BDF. Added Font tool compilation. * include/grub/misc.h (grub_utf8_to_ucs4): Changed prototype. Changed users. * kern/misc.c (grub_utf8_to_ucs4): Changed prototype. * kern/term.c: Changed users of grub_utf8_to_ucs4. * normal/menu.c: Likewise. * conf/common.rmk (font_mod_SOURCES): Removed font/manager.c. (font_mod_SOURCES): Added font/font_cmd.c, font/font.c. * include/grub/font.h: Replaced with new file. * include/grub/video.h (GRUB_VIDEO_MODE_TYPE_ALPHA): Changed value. (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED): Likewise. (GRUB_VIDEO_MODE_TYPE_COLOR_MASK): Likewise. (GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP): Added. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED. (grub_video_mode_info): Added bg_red, bg_green, bg_blue, bg_alpha, fg_red, fg_green, fg_blue, fg_alpha. (grub_video_adapter): Removed blit_glyph. (grub_video_blit_glyph): Removed. * font/manager.c: Removed file. * font/font.c: New file. * font/font_cmd.c: Likewise. * video/video.c (grub_video_blit_glyph): Removed. * video/i386/pc/vbe.c (grub_video_vbe_map_rgb): Added 1-bit support. (grub_video_vbe_map_rgba): Likewise. (grub_video_vbe_unmap_color_int): Likewise. (grub_video_vbe_blit_glyph): Removed. (grub_video_vbe_adapter): Removed blit_glyph. * video/i386/pc/vbeutil.c (get_data_ptr): Added 1-bit support. (get_pixel): Likewise. (set_pixel): Likewise. * commands/videotest.c (grub_cmd_videotest): Added more tests for fonts. * term/gfxterm.c: Adapted to new font engine. * term/i386/pc/vesafb.c: Marked as deprecated. Made it compile. * term/i386/pc/vga.c: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java: New file. * util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/Converter.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/Font.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/Glyph.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java: Likewise. * util/grub.d/00_header.in: Changed to use new loadfont command. * util/grub-mkconfig_lib.in: Changed font extension. --- ChangeLog | 89 ++ DISTLIST | 3 +- Makefile.in | 23 +- commands/videotest.c | 86 +- conf/common.mk | 47 +- conf/common.rmk | 2 +- configure | 8 +- configure.ac | 6 +- font/font.c | 1026 +++++++++++++++++ font/font_cmd.c | 77 ++ font/manager.c | 283 ----- include/grub/font.h | 108 +- include/grub/misc.h | 6 +- include/grub/video.h | 33 +- kern/misc.c | 36 +- kern/term.c | 4 +- normal/menu.c | 10 +- term/gfxterm.c | 194 +++- term/i386/pc/vesafb.c | 7 +- term/i386/pc/vga.c | 46 +- .../src/org/gnu/grub/fonttool/BDFLoader.java | 271 +++++ .../src/org/gnu/grub/fonttool/CharDefs.java | 181 +++ .../gnu/grub/fonttool/CharStorageInfo.java | 36 + .../org/gnu/grub/fonttool/CharacterRange.java | 75 ++ .../src/org/gnu/grub/fonttool/Converter.java | 168 +++ .../src/org/gnu/grub/fonttool/Font.java | 123 ++ .../src/org/gnu/grub/fonttool/Glyph.java | 100 ++ .../org/gnu/grub/fonttool/PFF2Sections.java | 36 + .../src/org/gnu/grub/fonttool/PFF2Writer.java | 154 +++ util/grub-mkconfig_lib.in | 4 +- util/grub.d/00_header.in | 4 +- video/i386/pc/vbe.c | 113 +- video/i386/pc/vbeutil.c | 30 +- video/video.c | 13 +- 34 files changed, 2859 insertions(+), 543 deletions(-) create mode 100644 font/font.c create mode 100644 font/font_cmd.c delete mode 100644 font/manager.c create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/Converter.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/Font.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/Glyph.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java create mode 100644 util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java diff --git a/ChangeLog b/ChangeLog index 301346eb2..6fb3e626e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,92 @@ +2009-01-02 Colin D Bennett + + New font engine. + + Additional changes by Vesa Jääskeläinen to adapt to + build system and fixed gfxterm.c to work with different sized fonts. + + * configure.ac: Changed UNIFONT_HEX to UNIFONT_BDF. + + * configure: Re-generated. + + * DISTLIST: Removed font/manager.c. + Added font/font.c. + Added font/font_cmd.c. + + * Makefile.in: Changed UNIFONT_HEX to UNIFONT_BDF. Added Font tool + compilation. + + * include/grub/misc.h (grub_utf8_to_ucs4): Changed prototype. Changed users. + + * kern/misc.c (grub_utf8_to_ucs4): Changed prototype. + + * kern/term.c: Changed users of grub_utf8_to_ucs4. + + * normal/menu.c: Likewise. + + * conf/common.rmk (font_mod_SOURCES): Removed font/manager.c. + (font_mod_SOURCES): Added font/font_cmd.c, font/font.c. + + * include/grub/font.h: Replaced with new file. + + * include/grub/video.h (GRUB_VIDEO_MODE_TYPE_ALPHA): Changed value. + (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED): Likewise. + (GRUB_VIDEO_MODE_TYPE_COLOR_MASK): Likewise. + (GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP): Added. + (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED. + (grub_video_mode_info): Added bg_red, bg_green, bg_blue, bg_alpha, + fg_red, fg_green, fg_blue, fg_alpha. + (grub_video_adapter): Removed blit_glyph. + (grub_video_blit_glyph): Removed. + + * font/manager.c: Removed file. + + * font/font.c: New file. + + * font/font_cmd.c: Likewise. + + * video/video.c (grub_video_blit_glyph): Removed. + + * video/i386/pc/vbe.c (grub_video_vbe_map_rgb): Added 1-bit support. + (grub_video_vbe_map_rgba): Likewise. + (grub_video_vbe_unmap_color_int): Likewise. + (grub_video_vbe_blit_glyph): Removed. + (grub_video_vbe_adapter): Removed blit_glyph. + + * video/i386/pc/vbeutil.c (get_data_ptr): Added 1-bit support. + (get_pixel): Likewise. + (set_pixel): Likewise. + + * commands/videotest.c (grub_cmd_videotest): Added more tests for fonts. + + * term/gfxterm.c: Adapted to new font engine. + + * term/i386/pc/vesafb.c: Marked as deprecated. Made it compile. + + * term/i386/pc/vga.c: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java: New file. + + * util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/Converter.java: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/Font.java: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/Glyph.java: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java: Likewise. + + * util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java: Likewise. + + * util/grub.d/00_header.in: Changed to use new loadfont command. + + * util/grub-mkconfig_lib.in: Changed font extension. + 2008-12-28 Felix Zielcke * util/getroot.c (grub_util_get_grub_dev): Add support for diff --git a/DISTLIST b/DISTLIST index f86844285..22be10bce 100644 --- a/DISTLIST +++ b/DISTLIST @@ -103,7 +103,8 @@ docs/fdl.texi docs/grub.cfg docs/grub.texi docs/texinfo.tex -font/manager.c +font/font.c +font/font_cmd.c fs/affs.c fs/afs.c fs/cpio.c diff --git a/Makefile.in b/Makefile.in index 5ce8be712..8cc0f1afc 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # -*- makefile -*- # -# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007 Free Software Foundation, Inc. +# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. # # This Makefile.in is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -88,7 +88,7 @@ AWK = @AWK@ LIBCURSES = @LIBCURSES@ LIBLZO = @LIBLZO@ YACC = @YACC@ -UNIFONT_HEX = @UNIFONT_HEX@ +UNIFONT_BDF = @UNIFONT_BDF@ # Options. enable_grub_emu = @enable_grub_emu@ @@ -148,19 +148,26 @@ fs.lst: $(FSFILES) partmap.lst: $(PARTMAPFILES) cat $^ /dev/null | sort > $@ -ifeq (, $(UNIFONT_HEX)) +ifeq (, $(UNIFONT_BDF)) else -pkgdata_DATA += unicode.pff ascii.pff +pkgdata_DATA += unicode.pf2 ascii.pf2 # Arrows and lines are needed to draw the menu, so we always include them UNICODE_ARROWS=0x2190-0x2193 UNICODE_LINES=0x2501-0x251B -unicode.pff: $(UNIFONT_HEX) - ruby $(srcdir)/util/unifont2pff.rb $(UNIFONT_HEX) > $@ +# Note: fonttool should be replaced with C only implementation -ascii.pff: $(UNIFONT_HEX) - ruby $(srcdir)/util/unifont2pff.rb 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) $(UNIFONT_HEX) > $@ +$(builddir)/fonttool/fonttool.jar: + mkdir -p "$(builddir)/fonttool/src" + javac -source 1.5 -target 1.5 -g -deprecation -encoding UTF-8 -d "$(builddir)/fonttool/src" `find "$(srcdir)/util/fonttool/src/" -name '*.java'` + jar cf $(builddir)/fonttool/fonttool.jar -C $(builddir)/fonttool/src . + +unicode.pf2: $(UNIFONT_BDF) $(builddir)/fonttool/fonttool.jar + java -cp $(builddir)/fonttool/fonttool.jar org.gnu.grub.fonttool.Converter --in=$(UNIFONT_BDF) --out=$@ + +ascii.pf2: $(UNIFONT_BDF) $(builddir)/fonttool/fonttool.jar + java -cp $(builddir)/fonttool/fonttool.jar org.gnu.grub.fonttool.Converter --in=$(UNIFONT_BDF) --out=$@ 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) endif # Used for building modules externally diff --git a/commands/videotest.c b/commands/videotest.c index 477727bbc..b0599df3b 100644 --- a/commands/videotest.c +++ b/commands/videotest.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,17 +36,21 @@ grub_cmd_videotest (struct grub_arg_list *state __attribute__ ((unused)), GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != GRUB_ERR_NONE) return grub_errno; - grub_getkey (); - grub_video_color_t color; unsigned int x; unsigned int y; unsigned int width; unsigned int height; int i; - struct grub_font_glyph glyph; + grub_font_t sansbig; + grub_font_t sans; + grub_font_t sanssmall; + grub_font_t fixed; + struct grub_font_glyph *glyph; struct grub_video_render_target *text_layer; grub_video_color_t palette[16]; + const char *str; + int texty; grub_video_get_viewport (&x, &y, &width, &height); @@ -65,8 +69,15 @@ grub_cmd_videotest (struct grub_arg_list *state __attribute__ ((unused)), color = grub_video_map_rgb (0, 255, 255); grub_video_fill_rect (color, 100, 100, 100, 100); - grub_font_get_glyph ('*', &glyph); - grub_video_blit_glyph (&glyph, color, 200 ,0); + sansbig = grub_font_get ("Helvetica Bold 24"); + sans = grub_font_get ("Helvetica Bold 14"); + sanssmall = grub_font_get ("Helvetica 8"); + fixed = grub_font_get ("Fixed 20"); + if (! sansbig || ! sans || ! sanssmall || ! fixed) + return grub_error (GRUB_ERR_BAD_FONT, "No font loaded."); + + glyph = grub_font_get_glyph (fixed, '*'); + grub_font_draw_glyph (glyph, color, 200 ,0); grub_video_set_viewport (x + 150, y + 150, width - 150 * 2, height - 150 * 2); @@ -77,18 +88,69 @@ grub_cmd_videotest (struct grub_arg_list *state __attribute__ ((unused)), color = grub_video_map_rgb (255, 255, 255); - grub_font_get_glyph ('A', &glyph); - grub_video_blit_glyph (&glyph, color, 16, 16); - grub_font_get_glyph ('B', &glyph); - grub_video_blit_glyph (&glyph, color, 16 * 2, 16); + texty = 32; + grub_font_draw_string ("The quick brown fox jumped over the lazy dog.", + sans, color, 16, texty); + texty += grub_font_get_descent (sans) + grub_font_get_leading (sans); - grub_font_get_glyph ('*', &glyph); + texty += grub_font_get_ascent (fixed); + grub_font_draw_string ("The quick brown fox jumped over the lazy dog.", + fixed, color, 16, texty); + texty += grub_font_get_descent (fixed) + grub_font_get_leading (fixed); + + /* To convert Unicode characters into UTF-8 for this test, the following + command is useful: + echo -ne '\x00\x00\x26\x3A' | iconv -f UTF-32BE -t UTF-8 | od -t x1 + This converts the Unicode character U+263A to UTF-8. */ + + /* Characters used: + Code point Description UTF-8 encoding + ----------- ------------------------------ -------------- + U+263A unfilled smiley face E2 98 BA + U+00A1 inverted exclamation point C2 A1 + U+00A3 British pound currency symbol C2 A3 + U+03C4 Greek tau CF 84 + U+00E4 lowercase letter a with umlaut C3 A4 + U+2124 set 'Z' symbol (integers) E2 84 A4 + U+2287 subset symbol E2 8A 87 + U+211D set 'R' symbol (real numbers) E2 84 9D */ + + str = + "Unicode test: happy\xE2\x98\xBA \xC2\xA3 5.00" + " \xC2\xA1\xCF\x84\xC3\xA4u! " + " \xE2\x84\xA4\xE2\x8A\x87\xE2\x84\x9D"; + color = grub_video_map_rgb (128, 128, 255); + + /* All characters in the string exist in the 'Fixed 20' (10x20) font. */ + texty += grub_font_get_ascent(fixed); + grub_font_draw_string (str, fixed, color, 16, texty); + texty += grub_font_get_descent (fixed) + grub_font_get_leading (fixed); + + /* Some character don't exist in the Helvetica font, so the font engine + will fall back to using glyphs from another font that does contain them. + TODO The font engine should be smart about selecting a replacement font + and prioritize fonts with similar sizes. */ + + texty += grub_font_get_ascent(sansbig); + grub_font_draw_string (str, sansbig, color, 16, texty); + texty += grub_font_get_descent (sansbig) + grub_font_get_leading (sansbig); + + texty += grub_font_get_ascent(sans); + grub_font_draw_string (str, sans, color, 16, texty); + texty += grub_font_get_descent (sans) + grub_font_get_leading (sans); + + texty += grub_font_get_ascent(sanssmall); + grub_font_draw_string (str, sanssmall, color, 16, texty); + texty += (grub_font_get_descent (sanssmall) + + grub_font_get_leading (sanssmall)); + + glyph = grub_font_get_glyph (fixed, '*'); for (i = 0; i < 16; i++) { color = grub_video_map_color (i); palette[i] = color; - grub_video_blit_glyph (&glyph, color, 16 + i * 16, 32); + grub_font_draw_glyph (glyph, color, 16 + i * 16, 220); } grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); diff --git a/conf/common.mk b/conf/common.mk index 6c12bacdc..d54093198 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -2803,13 +2803,13 @@ help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) # For font.mod. -font_mod_SOURCES = font/manager.c -CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_manager.o und-font.lst +font_mod_SOURCES = font/font_cmd.c font/font.c +CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_font_cmd.o font_mod-font_font.o und-font.lst ifneq ($(font_mod_EXPORTS),no) CLEANFILES += def-font.lst DEFSYMFILES += def-font.lst endif -MOSTLYCLEANFILES += font_mod-font_manager.d +MOSTLYCLEANFILES += font_mod-font_font_cmd.d font_mod-font_font.d UNDSYMFILES += und-font.lst font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) @@ -2818,9 +2818,9 @@ font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o +pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_font_cmd.o font_mod-font_font.o -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ font_mod-font_manager.o + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ font_mod-font_font_cmd.o font_mod-font_font.o mod-font.o: mod-font.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< @@ -2837,22 +2837,41 @@ und-font.lst: pre-font.o echo 'font' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -font_mod-font_manager.o: font/manager.c $(font/manager.c_DEPENDENCIES) +font_mod-font_font_cmd.o: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< --include font_mod-font_manager.d +-include font_mod-font_font_cmd.d -CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst partmap-font_mod-font_manager.lst -COMMANDFILES += cmd-font_mod-font_manager.lst -FSFILES += fs-font_mod-font_manager.lst -PARTMAPFILES += partmap-font_mod-font_manager.lst +CLEANFILES += cmd-font_mod-font_font_cmd.lst fs-font_mod-font_font_cmd.lst partmap-font_mod-font_font_cmd.lst +COMMANDFILES += cmd-font_mod-font_font_cmd.lst +FSFILES += fs-font_mod-font_font_cmd.lst +PARTMAPFILES += partmap-font_mod-font_font_cmd.lst -cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gencmdlist.sh +cmd-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) -fs-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genfslist.sh +fs-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) -partmap-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genpartmaplist.sh +partmap-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + + +font_mod-font_font.o: font/font.c $(font/font.c_DEPENDENCIES) + $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< +-include font_mod-font_font.d + +CLEANFILES += cmd-font_mod-font_font.lst fs-font_mod-font_font.lst partmap-font_mod-font_font.lst +COMMANDFILES += cmd-font_mod-font_font.lst +FSFILES += fs-font_mod-font_font.lst +PARTMAPFILES += partmap-font_mod-font_font.lst + +cmd-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) + +fs-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) + +partmap-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) diff --git a/conf/common.rmk b/conf/common.rmk index 251a21f8e..78a7dc55e 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -364,7 +364,7 @@ help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) # For font.mod. -font_mod_SOURCES = font/manager.c +font_mod_SOURCES = font/font_cmd.c font/font.c font_mod_CFLAGS = $(COMMON_CFLAGS) font_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/configure b/configure index 6af424a27..f1639999c 100644 --- a/configure +++ b/configure @@ -667,7 +667,7 @@ target_os platform CMP YACC -UNIFONT_HEX +UNIFONT_BDF INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA @@ -2107,9 +2107,9 @@ echo "$as_me: error: bison is not found" >&2;} { (exit 1); exit 1; }; } fi -for file in /usr/share/unifont/unifont.hex ; do +for file in /usr/src/unifont.bdf ; do if test -e $file ; then - UNIFONT_HEX=$file + UNIFONT_BDF=$file break fi @@ -9110,7 +9110,7 @@ target_os!$target_os$ac_delim platform!$platform$ac_delim CMP!$CMP$ac_delim YACC!$YACC$ac_delim -UNIFONT_HEX!$UNIFONT_HEX$ac_delim +UNIFONT_BDF!$UNIFONT_BDF$ac_delim INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim INSTALL_DATA!$INSTALL_DATA$ac_delim diff --git a/configure.ac b/configure.ac index 4aaf200ce..ad6429ff0 100644 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ # Process this file with autoconf to produce a configure script. -# Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. +# Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. # # This configure.ac is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -127,9 +127,9 @@ if test "x$YACC" = x; then AC_MSG_ERROR([bison is not found]) fi -for file in /usr/share/unifont/unifont.hex ; do +for file in /usr/src/unifont.bdf ; do if test -e $file ; then - AC_SUBST([UNIFONT_HEX], [$file]) + AC_SUBST([UNIFONT_BDF], [$file]) break fi done diff --git a/font/font.c b/font/font.c new file mode 100644 index 000000000..a16267a82 --- /dev/null +++ b/font/font.c @@ -0,0 +1,1026 @@ +/* font.c - Font API and font file loader. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifndef FONT_DEBUG +#define FONT_DEBUG 0 +#endif + +struct char_index_entry +{ + grub_uint32_t code; + grub_uint8_t storage_flags; + grub_uint32_t offset; + + /* Glyph if loaded, or NULL otherwise. */ + struct grub_font_glyph *glyph; +}; + +#define FONT_WEIGHT_NORMAL 100 +#define FONT_WEIGHT_BOLD 200 + +struct grub_font +{ + char *name; + grub_file_t file; + char *family; + short point_size; + short weight; + short max_char_width; + short max_char_height; + short ascent; + short descent; + short leading; + grub_uint32_t num_chars; + struct char_index_entry *char_index; +}; + +/* Definition of font registry. */ +struct grub_font_node *grub_font_list; + +static int register_font (grub_font_t font); +static void font_init (grub_font_t font); +static void free_font (grub_font_t font); +static void remove_font (grub_font_t font); + +struct font_file_section +{ + /* The file this section is in. */ + grub_file_t file; + + /* FOURCC name of the section. */ + char name[4]; + + /* Length of the section contents. */ + grub_uint32_t length; + + /* Set by open_section() on EOF. */ + int eof; +}; + +/* Font file format constants. */ +static const char pff2_magic[4] = { 'P', 'F', 'F', '2' }; +static const char section_names_file[4] = { 'F', 'I', 'L', 'E' }; +static const char section_names_font_name[4] = { 'N', 'A', 'M', 'E' }; +static const char section_names_point_size[4] = { 'P', 'T', 'S', 'Z' }; +static const char section_names_weight[4] = { 'W', 'E', 'I', 'G' }; +static const char section_names_max_char_width[4] = { 'M', 'A', 'X', 'W' }; +static const char section_names_max_char_height[4] = { 'M', 'A', 'X', 'H' }; +static const char section_names_ascent[4] = { 'A', 'S', 'C', 'E' }; +static const char section_names_descent[4] = { 'D', 'E', 'S', 'C' }; +static const char section_names_char_index[4] = { 'C', 'H', 'I', 'X' }; +static const char section_names_data[4] = { 'D', 'A', 'T', 'A' }; + +/* Replace unknown glyphs with a rounded question mark. */ +static grub_uint8_t unknown_glyph_bitmap[] = +{ + /* 76543210 */ + 0x7C, /* ooooo */ + 0x82, /* o o */ + 0xBA, /* o ooo o */ + 0xAA, /* o o o o */ + 0xAA, /* o o o o */ + 0x8A, /* o o o */ + 0x9A, /* o oo o */ + 0x92, /* o o o */ + 0x92, /* o o o */ + 0x92, /* o o o */ + 0x92, /* o o o */ + 0x82, /* o o */ + 0x92, /* o o o */ + 0x82, /* o o */ + 0x7C, /* ooooo */ + 0x00 /* */ +}; + +/* The "unknown glyph" glyph, used as a last resort. */ +static struct grub_font_glyph *unknown_glyph; + +/* The font structure used when no other font is loaded. This functions + as a "Null Object" pattern, so that code everywhere does not have to + check for a NULL grub_font_t to avoid dereferencing a null pointer. */ +static struct grub_font null_font; + +/* Flag to ensure module is initialized only once. */ +static grub_uint8_t font_loader_initialized; + +void +grub_font_loader_init (void) +{ + /* Only initialize font loader once. */ + if (font_loader_initialized) + return; + + /* Make glyph for unknown glyph. */ + unknown_glyph = grub_malloc(sizeof(struct grub_font_glyph) + + sizeof(unknown_glyph_bitmap)); + if (! unknown_glyph) + return; + + unknown_glyph->width = 8; + unknown_glyph->height = 16; + unknown_glyph->offset_x = 0; + unknown_glyph->offset_y = 0; + unknown_glyph->device_width = 8; + grub_memcpy(unknown_glyph->bitmap, + unknown_glyph_bitmap, sizeof(unknown_glyph_bitmap)); + + /* Initialize the null font. */ + font_init (&null_font); + null_font.name = ""; + null_font.ascent = unknown_glyph->height; + null_font.descent = 1; + null_font.max_char_width = unknown_glyph->width; + null_font.max_char_height = unknown_glyph->height; + + font_loader_initialized = 1; +} + +/* Initialize the font object with initial default values. */ +static void +font_init (grub_font_t font) +{ + font->name = 0; + font->file = 0; + font->family = 0; + font->point_size = 0; + font->weight = 0; + + /* Default leading value, not in font file yet. */ + font->leading = 1; + + font->max_char_width = 0; + font->max_char_height = 0; + font->ascent = 0; + font->descent = 0; + font->num_chars = 0; + font->char_index = 0; +} + +/* Open the next section in the file. + + On success, the section name is stored in section->name and the length in + section->length, and 0 is returned. On failure, 1 is returned and + grub_errno is set approriately with an error message. + + If 1 is returned due to being at the end of the file, then section->eof is + set to 1; otherwise, section->eof is set to 0. */ +static int +open_section (grub_file_t file, struct font_file_section *section) +{ + grub_ssize_t retval; + grub_uint32_t raw_length; + + section->file = file; + section->eof = 0; + + /* Read the FOURCC section name. */ + retval = grub_file_read (file, section->name, 4); + if (retval >= 0 && retval < 4) + { + /* EOF encountered. */ + section->eof = 1; + return 1; + } + else if (retval < 0) + { + grub_error (GRUB_ERR_BAD_FONT, + "Font format error: can't read section name"); + return 1; + } + + /* Read the big-endian 32-bit section length. */ + retval = grub_file_read (file, (char *) &raw_length, 4); + if (retval >= 0 && retval < 4) + { + /* EOF encountered. */ + section->eof = 1; + return 1; + } + else if (retval < 0) + { + grub_error (GRUB_ERR_BAD_FONT, + "Font format error: can't read section length"); + return 1; + } + + /* Convert byte-order and store in *length. */ + section->length = grub_be_to_cpu32 (raw_length); + + return 0; +} + +/* Size in bytes of each character index (CHIX section) + entry in the font file. */ +#define FONT_CHAR_INDEX_ENTRY_SIZE (4 + 1 + 4) + +/* Load the character index (CHIX) section contents from the font file. This + presumes that the position of FILE is positioned immediately after the + section length for the CHIX section (i.e., at the start of the section + contents). Returns 0 upon success, nonzero for failure (in which case + grub_errno is set appropriately). */ +static int +load_font_index (grub_file_t file, grub_uint32_t sect_length, struct + grub_font *font) +{ + unsigned i; + +#if FONT_DEBUG >= 2 + grub_printf("load_font_index(sect_length=%d)\n", sect_length); +#endif + + /* Sanity check: ensure section length is divisible by the entry size. */ + if ((sect_length % FONT_CHAR_INDEX_ENTRY_SIZE) != 0) + { + grub_error (GRUB_ERR_BAD_FONT, + "Font file format error: character index length %d " + "is not a multiple of the entry size %d", + sect_length, FONT_CHAR_INDEX_ENTRY_SIZE); + return 1; + } + + /* Calculate the number of characters. */ + font->num_chars = sect_length / FONT_CHAR_INDEX_ENTRY_SIZE; + + /* Allocate the character index array. */ + font->char_index = grub_malloc (font->num_chars + * sizeof (struct char_index_entry)); + if (! font->char_index) + return 1; + +#if FONT_DEBUG >= 2 + grub_printf("num_chars=%d)\n", font->num_chars); +#endif + + /* Load the character index data from the file. */ + for (i = 0; i < font->num_chars; i++) + { + struct char_index_entry *entry = &font->char_index[i]; + + /* Read code point value; convert to native byte order. */ + if (grub_file_read (file, (char *) &entry->code, 4) != 4) + return 1; + entry->code = grub_be_to_cpu32 (entry->code); + + /* Read storage flags byte. */ + if (grub_file_read (file, (char *) &entry->storage_flags, 1) != 1) + return 1; + + /* Read glyph data offset; convert to native byte order. */ + if (grub_file_read (file, (char *) &entry->offset, 4) != 4) + return 1; + entry->offset = grub_be_to_cpu32 (entry->offset); + + /* No glyph loaded. Will be loaded on demand and cached thereafter. */ + entry->glyph = 0; + +#if FONT_DEBUG >= 5 + /* Print the 1st 10 characters. */ + if (i < 10) + grub_printf("c=%d o=%d\n", entry->code, entry->offset); +#endif + } + + return 0; +} + +/* Read the contents of the specified section as a string, which is + allocated on the heap. Returns 0 if there is an error. */ +static char * +read_section_as_string (struct font_file_section *section) +{ + char *str; + grub_ssize_t ret; + + str = grub_malloc (section->length + 1); + if (! str) + return 0; + + ret = grub_file_read (section->file, str, section->length); + if (ret < 0 || ret != (grub_ssize_t) section->length) + { + grub_free (str); + return 0; + } + + str[section->length] = '\0'; + return str; +} + +/* Read the contents of the current section as a 16-bit integer value, + which is stored into *VALUE. + Returns 0 upon success, nonzero upon failure. */ +static int +read_section_as_short (struct font_file_section *section, grub_int16_t *value) +{ + grub_uint16_t raw_value; + + if (section->length != 2) + { + grub_error (GRUB_ERR_BAD_FONT, + "Font file format error: section %c%c%c%c length " + "is %d but should be 2", + section->name[0], section->name[1], + section->name[2], section->name[3], + section->length); + return 1; + } + if (grub_file_read (section->file, (char *) &raw_value, 2) != 2) + return 1; + + *value = grub_be_to_cpu16 (raw_value); + return 0; +} + +/* Load a font and add it to the beginning of the global font list. + Returns 0 upon success, nonzero upon failure. */ +int +grub_font_load (const char *filename) +{ + grub_file_t file = 0; + struct font_file_section section; + char magic[4]; + grub_font_t font = 0; + +#if FONT_DEBUG >= 1 + grub_printf("add_font(%s)\n", filename); +#endif + + file = grub_buffile_open (filename, 1024); + if (!file) + goto fail; + +#if FONT_DEBUG >= 3 + grub_printf("file opened\n"); +#endif + + /* Read the FILE section. It indicates the file format. */ + if (open_section (file, §ion) != 0) + goto fail; + +#if FONT_DEBUG >= 3 + grub_printf("opened FILE section\n"); +#endif + if (grub_memcmp (section.name, section_names_file, 4) != 0) + { + grub_error (GRUB_ERR_BAD_FONT, + "Font file format error: 1st section must be FILE"); + goto fail; + } + +#if FONT_DEBUG >= 3 + grub_printf("section name ok\n"); +#endif + if (section.length != 4) + { + grub_error (GRUB_ERR_BAD_FONT, + "Font file format error (file type ID length is %d " + "but should be 4)", section.length); + goto fail; + } + +#if FONT_DEBUG >= 3 + grub_printf("section length ok\n"); +#endif + /* Check the file format type code. */ + if (grub_file_read (file, magic, 4) != 4) + goto fail; + +#if FONT_DEBUG >= 3 + grub_printf("read magic ok\n"); +#endif + + if (grub_memcmp (magic, pff2_magic, 4) != 0) + { + grub_error (GRUB_ERR_BAD_FONT, "Invalid font magic %x %x %x %x", + magic[0], magic[1], magic[2], magic[3]); + goto fail; + } + +#if FONT_DEBUG >= 3 + grub_printf("compare magic ok\n"); +#endif + + /* Allocate the font object. */ + font = (grub_font_t) grub_malloc (sizeof (struct grub_font)); + if (! font) + goto fail; + + font_init (font); + font->file = file; + +#if FONT_DEBUG >= 3 + grub_printf("allocate font ok; loading font info\n"); +#endif + + /* Load the font information. */ + while (1) + { + if (open_section (file, §ion) != 0) + { + if (section.eof) + break; /* Done reading the font file. */ + else + goto fail; + } + +#if FONT_DEBUG >= 2 + grub_printf("opened section %c%c%c%c ok\n", + section.name[0], section.name[1], + section.name[2], section.name[3]); +#endif + + if (grub_memcmp (section.name, section_names_font_name, 4) == 0) + { + font->name = read_section_as_string (§ion); + if (!font->name) + goto fail; + } + else if (grub_memcmp (section.name, section_names_point_size, 4) == 0) + { + if (read_section_as_short (§ion, &font->point_size) != 0) + goto fail; + } + else if (grub_memcmp (section.name, section_names_weight, 4) == 0) + { + char *wt; + wt = read_section_as_string (§ion); + if (!wt) + continue; + /* Convert the weight string 'normal' or 'bold' into a number. */ + if (grub_strcmp (wt, "normal") == 0) + font->weight = FONT_WEIGHT_NORMAL; + else if (grub_strcmp (wt, "bold") == 0) + font->weight = FONT_WEIGHT_BOLD; + grub_free (wt); + } + else if (grub_memcmp (section.name, section_names_max_char_width, 4) == 0) + { + if (read_section_as_short (§ion, &font->max_char_width) != 0) + goto fail; + } + else if (grub_memcmp (section.name, section_names_max_char_height, 4) == 0) + { + if (read_section_as_short (§ion, &font->max_char_height) != 0) + goto fail; + } + else if (grub_memcmp (section.name, section_names_ascent, 4) == 0) + { + if (read_section_as_short (§ion, &font->ascent) != 0) + goto fail; + } + else if (grub_memcmp (section.name, section_names_descent, 4) == 0) + { + if (read_section_as_short (§ion, &font->descent) != 0) + goto fail; + } + else if (grub_memcmp (section.name, section_names_char_index, 4) == 0) + { + if (load_font_index (file, section.length, font) != 0) + goto fail; + } + else if (grub_memcmp (section.name, section_names_data, 4) == 0) + { + /* When the DATA section marker is reached, we stop reading. */ + break; + } + else + { + /* Unhandled section type, simply skip past it. */ +#if FONT_DEBUG >= 3 + grub_printf("Unhandled section type, skipping.\n"); +#endif + grub_off_t section_end = grub_file_tell (file) + section.length; + if ((int) grub_file_seek (file, section_end) == -1) + goto fail; + } + } + + if (! font->name) + { + grub_printf ("Note: Font has no name.\n"); + font->name = grub_strdup ("Unknown"); + } + +#if FONT_DEBUG >= 1 + grub_printf ("Loaded font `%s'.\n" + "Ascent=%d Descent=%d MaxW=%d MaxH=%d Number of characters=%d.\n", + font->name, + font->ascent, font->descent, + font->max_char_width, font->max_char_height, + font->num_chars); +#endif + + if (font->max_char_width == 0 + || font->max_char_height == 0 + || font->num_chars == 0 + || font->char_index == 0 + || font->ascent == 0 + || font->descent == 0) + { + grub_error (GRUB_ERR_BAD_FONT, + "Invalid font file: missing some required data."); + goto fail; + } + + /* Add the font to the global font registry. */ + if (register_font (font) != 0) + goto fail; + + return 0; + +fail: + free_font (font); + return 1; +} + +/* Read a 16-bit big-endian integer from FILE, convert it to native byte + order, and store it in *VALUE. + Returns 0 on success, 1 on failure. */ +static int +read_be_uint16 (grub_file_t file, grub_uint16_t * value) +{ + if (grub_file_read (file, (char *) value, 2) != 2) + return 1; + *value = grub_be_to_cpu16 (*value); + return 0; +} + +static int +read_be_int16 (grub_file_t file, grub_int16_t * value) +{ + /* For the signed integer version, use the same code as for unsigned. */ + return read_be_uint16 (file, (grub_uint16_t *) value); +} + +/* Return a pointer to the character index entry for the glyph corresponding to + the codepoint CODE in the font FONT. If not found, return zero. */ +static struct char_index_entry * +find_glyph (const grub_font_t font, grub_uint32_t code) +{ + grub_uint32_t i; + grub_uint32_t len = font->num_chars; + struct char_index_entry *table = font->char_index; + + /* Do a linear search. */ + for (i = 0; i < len; i++) + { + if (table[i].code == code) + return &table[i]; + } + + return 0; +} + +/* Get a glyph for the Unicode character CODE in FONT. The glyph is loaded + from the font file if has not been loaded yet. + Returns a pointer to the glyph if found, or 0 if it is not found. */ +static struct grub_font_glyph * +grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) +{ + struct char_index_entry *index_entry; + + index_entry = find_glyph (font, code); + if (index_entry) + { + struct grub_font_glyph *glyph = 0; + grub_uint16_t width; + grub_uint16_t height; + grub_int16_t xoff; + grub_int16_t yoff; + grub_int16_t dwidth; + int len; + + if (index_entry->glyph) + /* Return cached glyph. */ + return index_entry->glyph; + + if (! font->file) + /* No open file, can't load any glyphs. */ + return 0; + + /* Make sure we can find glyphs for error messages. Push active + error message to error stack and reset error message. */ + grub_error_push (); + + grub_file_seek (font->file, index_entry->offset); + + /* Read the glyph width, height, and baseline. */ + if (read_be_uint16(font->file, &width) != 0 + || read_be_uint16(font->file, &height) != 0 + || read_be_int16(font->file, &xoff) != 0 + || read_be_int16(font->file, &yoff) != 0 + || read_be_int16(font->file, &dwidth) != 0) + { + remove_font (font); + return 0; + } + + len = (width * height + 7) / 8; + glyph = grub_malloc (sizeof (struct grub_font_glyph) + len); + if (! glyph) + { + remove_font (font); + return 0; + } + + glyph->font = font; + glyph->width = width; + glyph->height = height; + glyph->offset_x = xoff; + glyph->offset_y = yoff; + glyph->device_width = dwidth; + + /* Don't try to read empty bitmaps (e.g., space characters). */ + if (len != 0) + { + if (grub_file_read (font->file, (char *) glyph->bitmap, len) != len) + { + remove_font (font); + return 0; + } + } + + /* Restore old error message. */ + grub_error_pop (); + + /* Cache the glyph. */ + index_entry->glyph = glyph; + + return glyph; + } + + return 0; +} + +/* Free the memory used by FONT. + This should not be called if the font has been made available to + users (once it is added to the global font list), since there would + be the possibility of a dangling pointer. */ +static void +free_font (grub_font_t font) +{ + if (font) + { + if (font->file) + grub_file_close (font->file); + grub_free (font->name); + grub_free (font->family); + grub_free (font->char_index); + grub_free (font); + } +} + +/* Add FONT to the global font registry. + Returns 0 upon success, nonzero on failure + (the font was not registered). */ +static int +register_font (grub_font_t font) +{ + struct grub_font_node *node = 0; + + node = grub_malloc (sizeof (struct grub_font_node)); + if (! node) + return 1; + + node->value = font; + node->next = grub_font_list; + grub_font_list = node; + + return 0; +} + +/* Remove the font from the global font list. We don't actually free the + font's memory since users could be holding references to the font. */ +static void +remove_font (grub_font_t font) +{ + struct grub_font_node **nextp, *cur; + + for (nextp = &grub_font_list, cur = *nextp; + cur; + nextp = &cur->next, cur = cur->next) + { + if (cur->value == font) + { + *nextp = cur->next; + + /* Free the node, but not the font itself. */ + grub_free (cur); + + return; + } + } +} + +/* Get a font from the list of loaded fonts. This function will return + another font if the requested font is not available. If no fonts are + loaded, then a special 'null font' is returned, which contains no glyphs, + but is not a null pointer so the caller may omit checks for NULL. */ +grub_font_t +grub_font_get (const char *font_name) +{ + struct grub_font_node *node; + + for (node = grub_font_list; node; node = node->next) + { + grub_font_t font = node->value; + if (grub_strcmp (font->name, font_name) == 0) + return font; + } + + /* If no font by that name is found, return the first font in the list + as a fallback. */ + if (grub_font_list && grub_font_list->value) + return grub_font_list->value; + else + /* The null_font is a last resort. */ + return &null_font; +} + +/* Get the full name of the font. For instance, "Helvetica Bold 12". */ +const char * +grub_font_get_name (grub_font_t font) +{ + return font->name; +} + +/* Get the maximum width of any character in the font in pixels. */ +int +grub_font_get_max_char_width (grub_font_t font) +{ + return font->max_char_width; +} + +/* Get the maximum height of any character in the font in pixels. */ +int +grub_font_get_max_char_height (grub_font_t font) +{ + return font->max_char_height; +} + +/* Get the distance in pixels from the top of characters to the baseline. */ +int +grub_font_get_ascent (grub_font_t font) +{ + return font->ascent; +} + +/* Get the distance in pixels from the baseline to the lowest descenders + (for instance, in a lowercase 'y', 'g', etc.). */ +int +grub_font_get_descent (grub_font_t font) +{ + return font->descent; +} + +/* Get the *standard leading* of the font in pixel, which is the spacing + between two lines of text. Specifically, it is the space between the + descent of one line and the ascent of the next line. This is included + in the *height* metric. */ +int +grub_font_get_leading (grub_font_t font) +{ + return font->leading; +} + +/* Get the distance in pixels between baselines of adjacent lines of text. */ +int +grub_font_get_height (grub_font_t font) +{ + return font->ascent + font->descent + font->leading; +} + +/* Get the width in pixels of the specified UTF-8 string, when rendered in + in the specified font (but falling back on other fonts for glyphs that + are missing). */ +int +grub_font_get_string_width (grub_font_t font, const char *str) +{ + int width; + struct grub_font_glyph *glyph; + grub_uint32_t code; + const grub_uint8_t *ptr; + + for (ptr = (const grub_uint8_t *) str, width = 0; + grub_utf8_to_ucs4 (&code, 1, ptr, -1, &ptr) > 0; ) + { + glyph = grub_font_get_glyph_with_fallback (font, code); + width += glyph->device_width; + } + + return width; +} + +/* Get the glyph for FONT corresponding to the Unicode code point CODE. + Returns a pointer to an glyph indicating there is no glyph available + if CODE does not exist in the font. The glyphs are cached once loaded. */ +struct grub_font_glyph * +grub_font_get_glyph (grub_font_t font, grub_uint32_t code) +{ + struct grub_font_glyph *glyph; + glyph = grub_font_get_glyph_internal (font, code); + if (glyph == 0) + glyph = unknown_glyph; + return glyph; +} + + +/* Calculate a subject value representing "how similar" two fonts are. + This is used to prioritize the order that fonts are scanned for missing + glyphs. The object is to select glyphs from the most similar font + possible, for the best appearance. + The heuristic is crude, but it helps greatly when fonts of similar + sizes are used so that tiny 8 point glyphs are not mixed into a string + of 24 point text unless there is no other choice. */ +static int +get_font_diversity(grub_font_t a, grub_font_t b) +{ + int d; + + d = 0; + + if (a->ascent && b->ascent) + d += grub_abs (a->ascent - b->ascent) * 8; + else + /* Penalty for missing attributes. */ + d += 50; + + if (a->max_char_height && b->max_char_height) + d += grub_abs (a->max_char_height - b->max_char_height) * 8; + else + /* Penalty for missing attributes. */ + d += 50; + + /* Weight is a minor factor. */ + d += (a->weight != b->weight) ? 5 : 0; + + return d; +} + +/* Get a glyph corresponding to the codepoint CODE. If FONT contains the + specified glyph, then it is returned. Otherwise, all other loaded fonts + are searched until one is found that contains a glyph for CODE. + If no glyph is available for CODE in the loaded fonts, then a glyph + representing an unknown character is returned. + This function never returns NULL. + The returned glyph is owned by the font manager and should not be freed + by the caller. The glyphs are cached. */ +struct grub_font_glyph * +grub_font_get_glyph_with_fallback (grub_font_t font, grub_uint32_t code) +{ + struct grub_font_glyph *glyph; + struct grub_font_node *node; + /* Keep track of next node, in case there's an I/O error in + grub_font_get_glyph_internal() and the font is removed from the list. */ + struct grub_font_node *next; + /* Information on the best glyph found so far, to help find the glyph in + the best matching to the requested one. */ + int best_diversity; + struct grub_font_glyph *best_glyph; + + if (font) + { + /* First try to get the glyph from the specified font. */ + glyph = grub_font_get_glyph_internal (font, code); + if (glyph) + return glyph; + } + + /* Otherwise, search all loaded fonts for the glyph and use the one from + the font that best matches the requested font. */ + best_diversity = 10000; + best_glyph = 0; + + for (node = grub_font_list; node; node = next) + { + grub_font_t curfont; + + curfont = node->value; + next = node->next; + + glyph = grub_font_get_glyph_internal (curfont, code); + if (glyph) + { + int d; + + d = get_font_diversity (curfont, font); + if (d < best_diversity) + { + best_diversity = d; + best_glyph = glyph; + } + } + } + + if (best_glyph) + return best_glyph; + else + /* Glyph not available in any font. Return unknown glyph. */ + return unknown_glyph; +} + + +/* Draw the specified glyph at (x, y). The y coordinate designates the + baseline of the character, while the x coordinate designates the left + side location of the character. */ +grub_err_t +grub_font_draw_glyph (struct grub_font_glyph *glyph, + grub_video_color_t color, + int left_x, int baseline_y) +{ + struct grub_video_bitmap glyph_bitmap; + + /* Don't try to draw empty glyphs (U+0020, etc.). */ + if (glyph->width == 0 || glyph->height == 0) + return GRUB_ERR_NONE; + + glyph_bitmap.mode_info.width = glyph->width; + glyph_bitmap.mode_info.height = glyph->height; + glyph_bitmap.mode_info.mode_type = + (1 << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) + | GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP; + glyph_bitmap.mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED; + glyph_bitmap.mode_info.bpp = 1; + + /* Really 1 bit per pixel. */ + glyph_bitmap.mode_info.bytes_per_pixel = 0; + + /* Packed densely as bits. */ + glyph_bitmap.mode_info.pitch = glyph->width; + + glyph_bitmap.mode_info.number_of_colors = 2; + glyph_bitmap.mode_info.bg_red = 0; + glyph_bitmap.mode_info.bg_green = 0; + glyph_bitmap.mode_info.bg_blue = 0; + glyph_bitmap.mode_info.bg_alpha = 0; + grub_video_unmap_color(color, + &glyph_bitmap.mode_info.fg_red, + &glyph_bitmap.mode_info.fg_green, + &glyph_bitmap.mode_info.fg_blue, + &glyph_bitmap.mode_info.fg_alpha); + glyph_bitmap.data = glyph->bitmap; + + int bitmap_left = left_x + glyph->offset_x; + int bitmap_bottom = baseline_y - glyph->offset_y; + int bitmap_top = bitmap_bottom - glyph->height; + + return grub_video_blit_bitmap (&glyph_bitmap, GRUB_VIDEO_BLIT_BLEND, + bitmap_left, bitmap_top, + 0, 0, + glyph->width, glyph->height); +} + +/* Draw a UTF-8 string of text on the current video render target. + The x coordinate specifies the starting x position for the first character, + while the y coordinate specifies the baseline position. + If the string contains a character that FONT does not contain, then + a glyph from another loaded font may be used instead. */ +grub_err_t +grub_font_draw_string (const char *str, grub_font_t font, + grub_video_color_t color, + int left_x, int baseline_y) +{ + int x; + struct grub_font_glyph *glyph; + grub_uint32_t code; + const grub_uint8_t *ptr; + + for (ptr = (const grub_uint8_t *) str, x = left_x; + grub_utf8_to_ucs4 (&code, 1, ptr, -1, &ptr) > 0; ) + { + glyph = grub_font_get_glyph_with_fallback (font, code); + if (grub_font_draw_glyph (glyph, color, x, baseline_y) + != GRUB_ERR_NONE) + return grub_errno; + x += glyph->device_width; + } + + return GRUB_ERR_NONE; +} + diff --git a/font/font_cmd.c b/font/font_cmd.c new file mode 100644 index 000000000..6cbae5b0a --- /dev/null +++ b/font/font_cmd.c @@ -0,0 +1,77 @@ +/* font_cmd.c - Font command definition. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +static grub_err_t +loadfont_command (struct grub_arg_list *state __attribute__ ((unused)), + int argc, + char **args) +{ + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no font specified"); + + while (argc--) + if (grub_font_load (*args++) != 0) + return GRUB_ERR_BAD_FONT; + + return GRUB_ERR_NONE; +} + +static grub_err_t +lsfonts_command (struct grub_arg_list *state __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) +{ + struct grub_font_node *node; + + grub_printf ("Loaded fonts:\n"); + for (node = grub_font_list; node; node = node->next) + { + grub_font_t font = node->value; + grub_printf ("%s\n", grub_font_get_name (font)); + } + + return GRUB_ERR_NONE; +} + +GRUB_MOD_INIT(font_manager) +{ + grub_font_loader_init (); + + grub_register_command ("loadfont", loadfont_command, GRUB_COMMAND_FLAG_BOTH, + "loadfont FILE...", + "Specify one or more font files to load.", 0); + + grub_register_command ("lsfonts", lsfonts_command, GRUB_COMMAND_FLAG_BOTH, + "lsfonts", + "List the loaded fonts.", 0); +} + +GRUB_MOD_FINI(font_manager) +{ + /* TODO: Determine way to free allocated resources. + Warning: possible pointer references could be in use. */ + + grub_unregister_command ("loadfont"); +} + diff --git a/font/manager.c b/font/manager.c deleted file mode 100644 index 28f63ae75..000000000 --- a/font/manager.c +++ /dev/null @@ -1,283 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2006,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#include - -struct entry -{ - grub_uint32_t code; - grub_uint32_t offset; -}; - -struct font -{ - struct font *next; - grub_file_t file; - grub_uint32_t num; - struct entry table[0]; -}; - -static struct font *font_list; - -/* Fill unknown glyph's with rounded question mark. */ -static grub_uint8_t unknown_glyph[16] = -{ /* 76543210 */ - 0x7C, /* ooooo */ - 0x82, /* o o */ - 0xBA, /* o ooo o */ - 0xAA, /* o o o o */ - 0xAA, /* o o o o */ - 0x8A, /* o o o */ - 0x9A, /* o oo o */ - 0x92, /* o o o */ - 0x92, /* o o o */ - 0x92, /* o o o */ - 0x92, /* o o o */ - 0x82, /* o o */ - 0x92, /* o o o */ - 0x82, /* o o */ - 0x7C, /* ooooo */ - 0x00 /* */ -}; - -static int -add_font (const char *filename) -{ - grub_file_t file = 0; - char magic[4]; - grub_uint32_t num, i; - struct font *font = 0; - - file = grub_buffile_open (filename, 0); - if (! file) - goto fail; - - if (grub_file_read (file, magic, 4) != 4) - goto fail; - - if (grub_memcmp (magic, GRUB_FONT_MAGIC, 4) != 0) - { - grub_error (GRUB_ERR_BAD_FONT, "invalid font magic"); - goto fail; - } - - if (grub_file_read (file, (char *) &num, 4) != 4) - goto fail; - - num = grub_le_to_cpu32 (num); - font = (struct font *) grub_malloc (sizeof (struct font) - + sizeof (struct entry) * num); - if (! font) - goto fail; - - font->file = file; - font->num = num; - - for (i = 0; i < num; i++) - { - grub_uint32_t code, offset; - - if (grub_file_read (file, (char *) &code, 4) != 4) - goto fail; - - if (grub_file_read (file, (char *) &offset, 4) != 4) - goto fail; - - font->table[i].code = grub_le_to_cpu32 (code); - font->table[i].offset = grub_le_to_cpu32 (offset); - } - - font->next = font_list; - font_list = font; - - return 1; - - fail: - if (font) - grub_free (font); - - if (file) - grub_file_close (file); - - return 0; -} - -static void -remove_font (struct font *font) -{ - struct font **p, *q; - - for (p = &font_list, q = *p; q; p = &(q->next), q = q->next) - if (q == font) - { - *p = q->next; - - grub_file_close (font->file); - grub_free (font); - - break; - } -} - -/* Return the offset of the glyph corresponding to the codepoint CODE - in the font FONT. If no found, return zero. */ -static grub_uint32_t -find_glyph (const struct font *font, grub_uint32_t code) -{ - grub_uint32_t start = 0; - grub_uint32_t end = font->num - 1; - const struct entry *table = font->table; - - /* This shouldn't happen. */ - if (font->num == 0) - return 0; - - /* Do a binary search. */ - while (start <= end) - { - grub_uint32_t i = (start + end) / 2; - - if (table[i].code < code) - start = i + 1; - else if (table[i].code > code) - end = i - 1; - else - return table[i].offset; - } - - return 0; -} - -/* Set the glyph to something stupid. */ -static void -fill_with_default_glyph (grub_font_glyph_t glyph) -{ - unsigned i; - - /* Use pre-defined pattern to fill unknown glyphs. */ - for (i = 0; i < 16; i++) - glyph->bitmap[i] = unknown_glyph[i]; - - glyph->char_width = 1; - glyph->width = glyph->char_width * 8; - glyph->height = 16; - glyph->baseline = (16 * 3) / 4; -} - -/* Get a glyph corresponding to the codepoint CODE. Always fill glyph - information with something, even if no glyph is found. */ -int -grub_font_get_glyph (grub_uint32_t code, - grub_font_glyph_t glyph) -{ - struct font *font; - grub_uint8_t bitmap[32]; - - /* FIXME: It is necessary to cache glyphs! */ - - restart: - for (font = font_list; font; font = font->next) - { - grub_uint32_t offset; - - offset = find_glyph (font, code); - if (offset) - { - grub_uint32_t w; - int len; - - /* Make sure we can find glyphs for error messages. Push active - error message to error stack and reset error message. */ - grub_error_push (); - - grub_file_seek (font->file, offset); - if ((len = grub_file_read (font->file, (char *) &w, sizeof (w))) - != sizeof (w)) - { - remove_font (font); - goto restart; - } - - w = grub_le_to_cpu32 (w); - if (w != 1 && w != 2) - { - /* grub_error (GRUB_ERR_BAD_FONT, "invalid width"); */ - remove_font (font); - goto restart; - } - - if (grub_file_read (font->file, (char *) bitmap, w * 16) - != (grub_ssize_t) w * 16) - { - remove_font (font); - goto restart; - } - - /* Fill glyph with information. */ - grub_memcpy (glyph->bitmap, bitmap, w * 16); - - glyph->char_width = w; - glyph->width = glyph->char_width * 8; - glyph->height = 16; - glyph->baseline = (16 * 3) / 4; - - /* Restore old error message. */ - grub_error_pop (); - - return 1; - } - } - - /* Uggh... No font was found. */ - fill_with_default_glyph (glyph); - return 0; -} - -static grub_err_t -font_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char **args __attribute__ ((unused))) -{ - if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no font specified"); - - while (argc--) - if (! add_font (*args++)) - return 1; - - return 0; -} - -GRUB_MOD_INIT(font_manager) -{ - grub_register_command ("font", font_command, GRUB_COMMAND_FLAG_BOTH, - "font FILE...", - "Specify one or more font files to display.", 0); -} - -GRUB_MOD_FINI(font_manager) -{ - grub_unregister_command ("font"); -} diff --git a/include/grub/font.h b/include/grub/font.h index 0841a151c..8a5f3ac7d 100644 --- a/include/grub/font.h +++ b/include/grub/font.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,34 +20,96 @@ #define GRUB_FONT_HEADER 1 #include +#include -#define GRUB_FONT_MAGIC "PPF\x7f" +/* Forward declaration of opaque structure grub_font. + Users only pass struct grub_font pointers to the font module functions, + and do not have knowledge of the structure contents. */ +struct grub_font; + +/* Font type used to access font functions. */ +typedef struct grub_font *grub_font_t; + +struct grub_font_node +{ + struct grub_font_node *next; + grub_font_t value; +}; + +/* Global font registry. */ +extern struct grub_font_node *grub_font_list; struct grub_font_glyph { - /* Glyph width in pixels. */ - grub_uint8_t width; - - /* Glyph height in pixels. */ - grub_uint8_t height; - - /* Glyph width in characters. */ - grub_uint8_t char_width; - - /* Glyph baseline position in pixels (from up). */ - grub_uint8_t baseline; - - /* Glyph bitmap data array of bytes in ((width + 7) / 8) * height. - Bitmap is formulated by height scanlines, each scanline having - width number of pixels. Pixels are coded as bits, value 1 meaning - of opaque pixel and 0 is transparent. If width does not fit byte - boundary, it will be padded with 0 to make it fit. */ - grub_uint8_t bitmap[32]; + /* Reference to the font this glyph belongs to. */ + grub_font_t font; + + /* Glyph bitmap width in pixels. */ + grub_uint16_t width; + + /* Glyph bitmap height in pixels. */ + grub_uint16_t height; + + /* Glyph bitmap x offset in pixels. Add to screen coordinate. */ + grub_int16_t offset_x; + + /* Glyph bitmap y offset in pixels. Subtract from screen coordinate. */ + grub_int16_t offset_y; + + /* Number of pixels to advance to start the next character. */ + grub_uint16_t device_width; + + /* Row-major order, packed bits (no padding; rows can break within a byte). + The length of the array is (width * height + 7) / 8. Within a + byte, the most significant bit is the first (leftmost/uppermost) pixel. + Pixels are coded as bits, value 1 meaning of opaque pixel and 0 is + transparent. If the length of the array does not fit byte boundary, it + will be padded with 0 bits to make it fit. */ + grub_uint8_t bitmap[0]; }; -typedef struct grub_font_glyph *grub_font_glyph_t; +/* Initialize the font loader. + Must be called before any fonts are loaded or used. */ +void grub_font_loader_init (void); -int grub_font_get_glyph (grub_uint32_t code, - grub_font_glyph_t glyph); +/* Load a font and add it to the beginning of the global font list. + Returns: 0 upon success; nonzero upon failure. */ +int grub_font_load (const char *filename); + +/* Get the font that has the specified name. Font names are in the form + "Family Name Bold Italic 14", where Bold and Italic are optional. + If no font matches the name specified, the most recently loaded font + is returned as a fallback. */ +grub_font_t grub_font_get (const char *font_name); + +const char *grub_font_get_name (grub_font_t font); + +int grub_font_get_max_char_width (grub_font_t font); + +int grub_font_get_max_char_height (grub_font_t font); + +int grub_font_get_ascent (grub_font_t font); + +int grub_font_get_descent (grub_font_t font); + +int grub_font_get_leading (grub_font_t font); + +int grub_font_get_height (grub_font_t font); + +int grub_font_get_string_width (grub_font_t font, const char *str); + +struct grub_font_glyph *grub_font_get_glyph (grub_font_t font, + grub_uint32_t code); + +struct grub_font_glyph *grub_font_get_glyph_with_fallback (grub_font_t font, + grub_uint32_t code); + +grub_err_t grub_font_draw_glyph (struct grub_font_glyph *glyph, + grub_video_color_t color, + int left_x, int baseline_y); + +grub_err_t grub_font_draw_string (const char *str, grub_font_t font, + grub_video_color_t color, + int left_x, int baseline_y); #endif /* ! GRUB_FONT_HEADER */ diff --git a/include/grub/misc.h b/include/grub/misc.h index 15c18f534..9c999487a 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -1,7 +1,7 @@ /* misc.h - prototypes for misc functions */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -77,8 +77,10 @@ grub_uint8_t *EXPORT_FUNC(grub_utf16_to_utf8) (grub_uint8_t *dest, grub_uint16_t *src, grub_size_t size); grub_ssize_t EXPORT_FUNC(grub_utf8_to_ucs4) (grub_uint32_t *dest, + grub_size_t destsize, const grub_uint8_t *src, - grub_size_t size); + grub_size_t srcsize, + const grub_uint8_t **srcend); grub_uint64_t EXPORT_FUNC(grub_divmod64) (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r); diff --git a/include/grub/video.h b/include/grub/video.h index 13993267d..cb73dae21 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,17 +31,17 @@ typedef grub_uint32_t grub_video_color_t; struct grub_video_render_target; /* Forward declarations for used data structures. */ -struct grub_font_glyph; struct grub_video_bitmap; /* Defines used to describe video mode or rendering target. */ -#define GRUB_VIDEO_MODE_TYPE_ALPHA 0x00000008 -#define GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED 0x00000004 +#define GRUB_VIDEO_MODE_TYPE_ALPHA 0x00000020 +#define GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED 0x00000010 +#define GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP 0x00000004 #define GRUB_VIDEO_MODE_TYPE_INDEX_COLOR 0x00000002 #define GRUB_VIDEO_MODE_TYPE_RGB 0x00000001 /* Defines used to mask flags. */ -#define GRUB_VIDEO_MODE_TYPE_COLOR_MASK 0x00000003 +#define GRUB_VIDEO_MODE_TYPE_COLOR_MASK 0x0000000F /* Defines used to specify requested bit depth. */ #define GRUB_VIDEO_MODE_TYPE_DEPTH_MASK 0x0000ff00 @@ -72,7 +72,10 @@ enum grub_video_blit_format GRUB_VIDEO_BLIT_FORMAT_BGR_565, /* When needed, decode color or just use value as is. */ - GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR + GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR, + + /* Two color bitmap; bits packed: rows are not padded to byte boundary. */ + GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED }; /* Define blitting operators. */ @@ -135,6 +138,18 @@ struct grub_video_mode_info /* What is location of reserved color bits. In Index Color mode, this is 0. */ unsigned int reserved_field_pos; + + /* For 1-bit bitmaps, the background color. Used for bits = 0. */ + grub_uint8_t bg_red; + grub_uint8_t bg_green; + grub_uint8_t bg_blue; + grub_uint8_t bg_alpha; + + /* For 1-bit bitmaps, the foreground color. Used for bits = 1. */ + grub_uint8_t fg_red; + grub_uint8_t fg_green; + grub_uint8_t fg_blue; + grub_uint8_t fg_alpha; }; struct grub_video_palette_data @@ -188,9 +203,6 @@ struct grub_video_adapter grub_err_t (*fill_rect) (grub_video_color_t color, int x, int y, unsigned int width, unsigned int height); - grub_err_t (*blit_glyph) (struct grub_font_glyph *glyph, - grub_video_color_t color, int x, int y); - grub_err_t (*blit_bitmap) (struct grub_video_bitmap *bitmap, enum grub_video_blit_operators oper, int x, int y, int offset_x, int offset_y, @@ -260,9 +272,6 @@ grub_err_t grub_video_unmap_color (grub_video_color_t color, grub_err_t grub_video_fill_rect (grub_video_color_t color, int x, int y, unsigned int width, unsigned int height); -grub_err_t grub_video_blit_glyph (struct grub_font_glyph *glyph, - grub_video_color_t color, int x, int y); - grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap, enum grub_video_blit_operators oper, int x, int y, int offset_x, int offset_y, diff --git a/kern/misc.c b/kern/misc.c index 5b1e65e4a..6fbc6510a 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -1,7 +1,7 @@ /* misc.c - definitions of misc functions */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -951,22 +951,29 @@ grub_utf16_to_utf8 (grub_uint8_t *dest, grub_uint16_t *src, return dest; } -/* Convert an UTF-8 string to an UCS-4 string. Return the number of - characters converted. DEST must be able to hold at least SIZE - characters (when the input is unknown). If an invalid sequence is found, - return -1. */ +/* Convert a (possibly null-terminated) UTF-8 string of at most SRCSIZE + bytes (if SRCSIZE is -1, it is ignored) in length to a UCS-4 string. + Return the number of characters converted. DEST must be able to hold + at least DESTSIZE characters. If an invalid sequence is found, return -1. + If SRCEND is not NULL, then *SRCEND is set to the next byte after the + last byte used in SRC. */ grub_ssize_t -grub_utf8_to_ucs4 (grub_uint32_t *dest, const grub_uint8_t *src, - grub_size_t size) +grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, + const grub_uint8_t *src, grub_size_t srcsize, + const grub_uint8_t **srcend) { grub_uint32_t *p = dest; int count = 0; grub_uint32_t code = 0; - while (size--) + if (srcend) + *srcend = src; + + while (srcsize && destsize) { grub_uint32_t c = *src++; - + if (srcsize != (grub_size_t)-1) + srcsize--; if (count) { if ((c & 0xc0) != 0x80) @@ -983,6 +990,9 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, const grub_uint8_t *src, } else { + if (c == 0) + break; + if ((c & 0x80) == 0x00) code = c; else if ((c & 0xe0) == 0xc0) @@ -1011,14 +1021,18 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, const grub_uint8_t *src, code = c & 0x01; } else - /* invalid */ return -1; } if (count == 0) - *p++ = code; + { + *p++ = code; + destsize--; + } } + if (srcend) + *srcend = src; return p - dest; } diff --git a/kern/term.c b/kern/term.c index 2acfdae72..8d5a23b41 100644 --- a/kern/term.c +++ b/kern/term.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -208,7 +208,7 @@ grub_putchar (int c) grub_ssize_t ret; buf[size++] = c; - ret = grub_utf8_to_ucs4 (&code, buf, size); + ret = grub_utf8_to_ucs4 (&code, 1, buf, size, 0); if (ret > 0) { diff --git a/normal/menu.c b/normal/menu.c index 103aa6f15..644446976 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -116,19 +116,21 @@ print_entry (int y, int highlight, grub_menu_entry_t entry) { int x; const char *title; + grub_size_t title_len; grub_ssize_t len; grub_uint32_t *unicode_title; grub_ssize_t i; grub_uint8_t old_color_normal, old_color_highlight; title = entry ? entry->title : ""; - unicode_title = grub_malloc (grub_strlen (title) * sizeof (*unicode_title)); + title_len = grub_strlen (title); + unicode_title = grub_malloc (title_len * sizeof (*unicode_title)); if (! unicode_title) /* XXX How to show this error? */ return; - len = grub_utf8_to_ucs4 (unicode_title, (grub_uint8_t *) title, - grub_strlen (title)); + len = grub_utf8_to_ucs4 (unicode_title, title_len, + (grub_uint8_t *) title, -1, 0); if (len < 0) { /* It is an invalid sequence. */ diff --git a/term/gfxterm.c b/term/gfxterm.c index c4377929c..3e7fcd826 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -34,9 +34,6 @@ #define DEFAULT_VIDEO_HEIGHT 480 #define DEFAULT_VIDEO_FLAGS 0 -#define DEFAULT_CHAR_WIDTH 8 -#define DEFAULT_CHAR_HEIGHT 16 - #define DEFAULT_BORDER_WIDTH 10 #define DEFAULT_STANDARD_COLOR 0x07 @@ -69,27 +66,32 @@ struct grub_colored_char struct grub_virtual_screen { - /* Dimensions of the virtual screen. */ + /* Dimensions of the virtual screen in pixels. */ unsigned int width; unsigned int height; - /* Offset in the display. */ + /* Offset in the display in pixels. */ unsigned int offset_x; unsigned int offset_y; - /* TTY Character sizes. */ - unsigned int char_width; - unsigned int char_height; + /* TTY Character sizes in pixes. */ + unsigned int normal_char_width; + unsigned int normal_char_height; - /* Virtual screen TTY size. */ + /* Virtual screen TTY size in characters. */ unsigned int columns; unsigned int rows; - /* Current cursor details. */ + /* Current cursor location in characters. */ unsigned int cursor_x; unsigned int cursor_y; + + /* Current cursor state. */ int cursor_state; + /* Font settings. */ + grub_font_t font; + /* Terminal color settings. */ grub_uint8_t standard_color_setting; grub_uint8_t normal_color_setting; @@ -125,6 +127,10 @@ static int dirty_region_is_empty (void); static void dirty_region_add (int x, int y, unsigned int width, unsigned int height); +static unsigned int calculate_normal_character_width (grub_font_t font); + +static unsigned char calculate_character_width (struct grub_font_glyph *glyph); + static void set_term_color (grub_uint8_t term_color) { @@ -168,25 +174,32 @@ grub_virtual_screen_free (void) static grub_err_t grub_virtual_screen_setup (unsigned int x, unsigned int y, - unsigned int width, unsigned int height) + unsigned int width, unsigned int height, + const char *font_name) { /* Free old virtual screen. */ grub_virtual_screen_free (); /* Initialize with default data. */ + virtual_screen.font = grub_font_get (font_name); + if (!virtual_screen.font) + return grub_error (GRUB_ERR_BAD_FONT, + "No font loaded."); virtual_screen.width = width; virtual_screen.height = height; virtual_screen.offset_x = x; virtual_screen.offset_y = y; - virtual_screen.char_width = DEFAULT_CHAR_WIDTH; - virtual_screen.char_height = DEFAULT_CHAR_HEIGHT; + virtual_screen.normal_char_width = + calculate_normal_character_width (virtual_screen.font); + virtual_screen.normal_char_height = + grub_font_get_max_char_height (virtual_screen.font); virtual_screen.cursor_x = 0; virtual_screen.cursor_y = 0; virtual_screen.cursor_state = 1; /* Calculate size of text buffer. */ - virtual_screen.columns = virtual_screen.width / virtual_screen.char_width; - virtual_screen.rows = virtual_screen.height / virtual_screen.char_height; + virtual_screen.columns = virtual_screen.width / virtual_screen.normal_char_width; + virtual_screen.rows = virtual_screen.height / virtual_screen.normal_char_height; /* Allocate memory for text buffer. */ virtual_screen.text_buffer = @@ -225,6 +238,7 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, static grub_err_t grub_gfxterm_init (void) { + char *font_name; char *modevar; int width = DEFAULT_VIDEO_WIDTH; int height = DEFAULT_VIDEO_HEIGHT; @@ -232,6 +246,11 @@ grub_gfxterm_init (void) int flags = DEFAULT_VIDEO_FLAGS; grub_video_color_t color; + /* Select the font to use. */ + font_name = grub_env_get ("gfxterm_font"); + if (! font_name) + font_name = ""; /* Allow fallback to any font. */ + /* Parse gfxmode environment variable if set. */ modevar = grub_env_get ("gfxmode"); if (modevar) @@ -471,7 +490,7 @@ grub_gfxterm_init (void) /* Create virtual screen. */ if (grub_virtual_screen_setup (DEFAULT_BORDER_WIDTH, DEFAULT_BORDER_WIDTH, - width, height) != GRUB_ERR_NONE) + width, height, font_name) != GRUB_ERR_NONE) { grub_video_restore (); return grub_errno; @@ -657,11 +676,12 @@ static void write_char (void) { struct grub_colored_char *p; - struct grub_font_glyph glyph; + struct grub_font_glyph *glyph; grub_video_color_t color; grub_video_color_t bgcolor; unsigned int x; unsigned int y; + int ascent; /* Find out active character. */ p = (virtual_screen.text_buffer @@ -671,27 +691,28 @@ write_char (void) p -= p->index; /* Get glyph for character. */ - grub_font_get_glyph (p->code, &glyph); + glyph = grub_font_get_glyph (virtual_screen.font, p->code); + ascent = grub_font_get_ascent (virtual_screen.font); color = p->fg_color; bgcolor = p->bg_color; - x = virtual_screen.cursor_x * virtual_screen.char_width; - y = virtual_screen.cursor_y * virtual_screen.char_height; + x = virtual_screen.cursor_x * virtual_screen.normal_char_width; + y = virtual_screen.cursor_y * virtual_screen.normal_char_height; /* Render glyph to text layer. */ grub_video_set_active_render_target (text_layer); - grub_video_fill_rect (bgcolor, x, y, glyph.width, glyph.height); - grub_video_blit_glyph (&glyph, color, x, y); + grub_video_fill_rect (bgcolor, x, y, glyph->width, glyph->height); + grub_font_draw_glyph (glyph, color, x, y + ascent); grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); /* Mark character to be drawn. */ dirty_region_add (virtual_screen.offset_x + x, virtual_screen.offset_y + y, - glyph.width, glyph.height); + glyph->width, glyph->height); } static void -write_cursor (void) +draw_cursor (int show) { unsigned int x; unsigned int y; @@ -700,12 +721,22 @@ write_cursor (void) grub_video_color_t color; /* Determine cursor properties and position on text layer. */ - x = virtual_screen.cursor_x * virtual_screen.char_width; - y = ((virtual_screen.cursor_y + 1) * virtual_screen.char_height) - 3; - width = virtual_screen.char_width; + x = virtual_screen.cursor_x * virtual_screen.normal_char_width; + y = (virtual_screen.cursor_y * virtual_screen.normal_char_height + + grub_font_get_ascent (virtual_screen.font)); + width = virtual_screen.normal_char_width; height = 2; - color = virtual_screen.fg_color; + if (show) + { + color = virtual_screen.fg_color; + } + else + { + color = virtual_screen.bg_color; + y = virtual_screen.cursor_y * virtual_screen.normal_char_height; + height = virtual_screen.normal_char_height; + } /* Render cursor to text layer. */ grub_video_set_active_render_target (text_layer); @@ -727,7 +758,7 @@ scroll_up (void) if (!bitmap) { /* Remove cursor. */ - write_char (); + draw_cursor (0); /* Redraw only changed regions. */ dirty_region_redraw (); @@ -755,7 +786,7 @@ scroll_up (void) /* Scroll physical screen. */ grub_video_set_active_render_target (text_layer); color = virtual_screen.bg_color; - grub_video_scroll (color, 0, -virtual_screen.char_height); + grub_video_scroll (color, 0, -virtual_screen.normal_char_height); grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); /* If we have bitmap, re-draw screen, otherwise scroll physical screen too. */ @@ -767,16 +798,16 @@ scroll_up (void) else { /* Clear new border area. */ - grub_video_fill_rect (color, - virtual_screen.offset_x, virtual_screen.offset_y, - virtual_screen.width, virtual_screen.char_height); - + grub_video_fill_rect (color, + virtual_screen.offset_x, virtual_screen.offset_y, + virtual_screen.width, virtual_screen.normal_char_height); + /* Scroll physical screen. */ - grub_video_scroll (color, 0, -virtual_screen.char_height); + grub_video_scroll (color, 0, -virtual_screen.normal_char_height); /* Draw cursor if visible. */ if (virtual_screen.cursor_state) - write_cursor (); + draw_cursor (1); } } @@ -791,7 +822,7 @@ grub_gfxterm_putchar (grub_uint32_t c) { /* Erase current cursor, if any. */ if (virtual_screen.cursor_state) - write_char (); + draw_cursor (0); switch (c) { @@ -814,18 +845,27 @@ grub_gfxterm_putchar (grub_uint32_t c) /* Redraw cursor if visible. */ if (virtual_screen.cursor_state) - write_cursor (); + draw_cursor (1); } else { - struct grub_font_glyph glyph; + struct grub_font_glyph *glyph; struct grub_colored_char *p; + unsigned char char_width; - /* Get properties of the character. */ - grub_font_get_glyph (c, &glyph); + /* Erase current cursor, if any. */ + if (virtual_screen.cursor_state) + draw_cursor (0); + + /* Get properties of the character. */ + glyph = grub_font_get_glyph (virtual_screen.font, c); + + /* Calculate actual character width for glyph. This is number of + times of normal_font_width. */ + char_width = calculate_character_width(glyph); /* If we are about to exceed line length, wrap to next line. */ - if (virtual_screen.cursor_x + glyph.char_width > virtual_screen.columns) + if (virtual_screen.cursor_x + char_width > virtual_screen.columns) grub_putchar ('\n'); /* Find position on virtual screen, and fill information. */ @@ -835,18 +875,18 @@ grub_gfxterm_putchar (grub_uint32_t c) p->code = c; p->fg_color = virtual_screen.fg_color; p->bg_color = virtual_screen.bg_color; - p->width = glyph.char_width - 1; + p->width = char_width - 1; p->index = 0; /* If we have large glyph, add fixup info. */ - if (glyph.char_width > 1) + if (char_width > 1) { unsigned i; - for (i = 1; i < glyph.char_width; i++) + for (i = 1; i < char_width; i++) { p[i].code = ' '; - p[i].width = glyph.char_width - 1; + p[i].width = char_width - 1; p[i].index = i; } } @@ -855,7 +895,7 @@ grub_gfxterm_putchar (grub_uint32_t c) write_char (); /* Make sure we scroll screen when needed and wrap line correctly. */ - virtual_screen.cursor_x += glyph.char_width; + virtual_screen.cursor_x += char_width; if (virtual_screen.cursor_x >= virtual_screen.columns) { virtual_screen.cursor_x = 0; @@ -868,18 +908,58 @@ grub_gfxterm_putchar (grub_uint32_t c) /* Draw cursor if visible. */ if (virtual_screen.cursor_state) - write_cursor (); + draw_cursor (1); } } +/* Use ASCII characters to determine normal character width. */ +static unsigned int +calculate_normal_character_width (grub_font_t font) +{ + struct grub_font_glyph *glyph; + unsigned int width = 0; + unsigned int i; + + /* Get properties of every printable ASCII character. */ + for (i = 32; i < 127; i++) + { + glyph = grub_font_get_glyph (font, i); + + /* Skip unknown characters. Should never happen on normal conditions. */ + if (! glyph) + continue; + + if (glyph->device_width > width) + width = glyph->device_width; + } + + return width; +} + +static unsigned char +calculate_character_width (struct grub_font_glyph *glyph) +{ + if (! glyph || glyph->device_width == 0) + return 1; + + return (glyph->device_width + + (virtual_screen.normal_char_width - 1)) + / virtual_screen.normal_char_width; +} + static grub_ssize_t grub_gfxterm_getcharwidth (grub_uint32_t c) { - struct grub_font_glyph glyph; + struct grub_font_glyph *glyph; + unsigned char char_width; - grub_font_get_glyph (c, &glyph); + /* Get properties of the character. */ + glyph = grub_font_get_glyph (virtual_screen.font, c); - return glyph.char_width; + /* Calculate actual character width for glyph. */ + char_width = calculate_character_width (glyph); + + return char_width; } static grub_uint16_t @@ -903,14 +983,16 @@ grub_gfxterm_gotoxy (grub_uint8_t x, grub_uint8_t y) if (y >= virtual_screen.rows) y = virtual_screen.rows - 1; + /* Erase current cursor, if any. */ if (virtual_screen.cursor_state) - write_char (); + draw_cursor (0); virtual_screen.cursor_x = x; virtual_screen.cursor_y = y; + /* Draw cursor if visible. */ if (virtual_screen.cursor_state) - write_cursor (); + draw_cursor (1); } static void @@ -995,9 +1077,9 @@ grub_gfxterm_setcursor (int on) if (virtual_screen.cursor_state != on) { if (virtual_screen.cursor_state) - write_char (); + draw_cursor (0); else - write_cursor (); + draw_cursor (1); virtual_screen.cursor_state = on; } diff --git a/term/i386/pc/vesafb.c b/term/i386/pc/vesafb.c index c5a46731d..730595433 100644 --- a/term/i386/pc/vesafb.c +++ b/term/i386/pc/vesafb.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,8 @@ * along with GRUB. If not, see . */ +// TODO: Deprecated and broken. Scheduled for removal as there is VBE driver in Video subsystem. + #include #include #include @@ -250,10 +252,11 @@ grub_virtual_screen_get_glyph (grub_uint32_t code, break; default: - return grub_font_get_glyph (code, bitmap, width); + return grub_font_get_glyph_any (code, bitmap, width); } } + /* TODO This is wrong for the new font module. Should it be fixed? */ if (bitmap) grub_memcpy (bitmap, vga_font + code * virtual_screen.char_height, diff --git a/term/i386/pc/vga.c b/term/i386/pc/vga.c index 7143745cc..d32c86e6b 100644 --- a/term/i386/pc/vga.c +++ b/term/i386/pc/vga.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,6 +16,8 @@ * along with GRUB. If not, see . */ +// TODO: Deprecated and broken. Needs to be converted to Video Driver! + #include #include #include @@ -65,6 +67,7 @@ static unsigned char fg_color, bg_color; static struct colored_char text_buf[TEXT_WIDTH * TEXT_HEIGHT]; static unsigned char saved_map_mask; static int page = 0; +static grub_font_t font = 0; #define SEQUENCER_ADDR_PORT 0x3C4 #define SEQUENCER_DATA_PORT 0x3C5 @@ -161,6 +164,9 @@ grub_vga_mod_init (void) saved_map_mask = get_map_mask (); set_map_mask (0x0f); set_start_address (PAGE_OFFSET (page)); + font = grub_font_get (""); /* Choose any font, for now. */ + if (!font) + return grub_error (GRUB_ERR_BAD_FONT, "No font loaded."); return GRUB_ERR_NONE; } @@ -185,7 +191,7 @@ static void write_char (void) { struct colored_char *p = text_buf + xpos + ypos * TEXT_WIDTH; - struct grub_font_glyph glyph; + struct grub_font_glyph *glyph; unsigned char *mem_base; unsigned plane; @@ -194,7 +200,7 @@ write_char (void) p -= p->index; /* Get glyph for character. */ - grub_font_get_glyph (p->code, &glyph); + glyph = grub_font_get_glyph (font, p->code); for (plane = 0x01; plane <= 0x08; plane <<= 1) { @@ -208,19 +214,23 @@ write_char (void) y < CHAR_HEIGHT; y++, mem += TEXT_WIDTH) { + /* TODO Re-implement glyph drawing for vga module. */ +#if 0 unsigned i; - for (i = 0; i < glyph.char_width && offset < 32; i++) + unsigned char_width = 1; /* TODO Figure out wide characters. */ + for (i = 0; i < char_width && offset < 32; i++) { unsigned char fg_mask, bg_mask; - fg_mask = (p->fg_color & plane) ? glyph.bitmap[offset] : 0; - bg_mask = (p->bg_color & plane) ? ~(glyph.bitmap[offset]) : 0; + fg_mask = (p->fg_color & plane) ? glyph->bitmap[offset] : 0; + bg_mask = (p->bg_color & plane) ? ~(glyph->bitmap[offset]) : 0; offset++; if (check_vga_mem (mem + i)) mem[i] = (fg_mask | bg_mask); } +#endif /* 0 */ } } @@ -320,36 +330,37 @@ grub_vga_putchar (grub_uint32_t c) } else { - struct grub_font_glyph glyph; + struct grub_font_glyph *glyph; struct colored_char *p; + unsigned char_width = 1; - grub_font_get_glyph(c, &glyph); + glyph = grub_font_get_glyph(font, c); - if (xpos + glyph.char_width > TEXT_WIDTH) + if (xpos + char_width > TEXT_WIDTH) grub_putchar ('\n'); p = text_buf + xpos + ypos * TEXT_WIDTH; p->code = c; p->fg_color = fg_color; p->bg_color = bg_color; - p->width = glyph.char_width - 1; + p->width = char_width - 1; p->index = 0; - if (glyph.char_width > 1) + if (char_width > 1) { unsigned i; - for (i = 1; i < glyph.char_width; i++) + for (i = 1; i < char_width; i++) { p[i].code = ' '; - p[i].width = glyph.char_width - 1; + p[i].width = char_width - 1; p[i].index = i; } } write_char (); - xpos += glyph.char_width; + xpos += char_width; if (xpos >= TEXT_WIDTH) { xpos = 0; @@ -381,11 +392,16 @@ grub_vga_putchar (grub_uint32_t c) static grub_ssize_t grub_vga_getcharwidth (grub_uint32_t c) { +#if 0 struct grub_font_glyph glyph; - grub_font_get_glyph (c, &glyph); + glyph = grub_font_get_glyph (c); return glyph.char_width; +#else + (void) c; /* Prevent warning. */ + return 1; /* TODO Fix wide characters? */ +#endif } static grub_uint16_t diff --git a/util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java b/util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java new file mode 100644 index 000000000..1cb53a805 --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java @@ -0,0 +1,271 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +import java.io.*; +import java.util.StringTokenizer; +import java.util.regex.Matcher; +import java.util.regex.Pattern; + +public class BDFLoader { + private final BufferedReader in; + private final Font font; + private int maxCharWidth; + private int maxCharHeight; + + BDFLoader(BufferedReader in) { + this.in = in; + this.font = new Font(); + this.maxCharWidth = 0; + this.maxCharHeight = 0; + } + + public static boolean isBDFFile(String filename) { + DataInputStream in = null; + try { + in = new DataInputStream(new FileInputStream(filename)); + final String signature = "STARTFONT "; + byte[] b = new byte[signature.length()]; + in.readFully(b); + in.close(); + + String s = new String(b, "US-ASCII"); + return signature.equals(s); + } catch (IOException e) { + if (in != null) { + try { + in.close(); + } catch (IOException e1) { + // Ignore. + } + } + return false; + } + } + + public static Font loadFontResource(String resourceName) throws IOException { + InputStream in = BDFLoader.class.getClassLoader().getResourceAsStream(resourceName); + if (in == null) + throw new FileNotFoundException("Font resource " + resourceName + " not found"); + return loadFontFromStream(in); + } + + public static Font loadFontFile(String filename) throws IOException { + InputStream in = new FileInputStream(filename); + return loadFontFromStream(in); + } + + private static Font loadFontFromStream(InputStream inStream) throws IOException { + BufferedReader in; + try { + in = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); + } catch (UnsupportedEncodingException e) { + throw new RuntimeException("Encoding not supported: " + e.getMessage(), e); + } + return new BDFLoader(in).loadFont(); + } + + private Font loadFont() throws IOException { + loadFontInfo(); + while (loadChar()) { + /* Loop. */ + } + + font.setMaxCharWidth(maxCharWidth); + font.setMaxCharHeight(maxCharHeight); + return font; + } + + private void loadFontInfo() throws IOException { + final Pattern stringSettingPattern = Pattern.compile("^(\\w+)\\s+\"([^\"]+)\"$"); + String line; + // Load the global font information that appears before CHARS. + final int UNSET = Integer.MIN_VALUE; + font.setAscent(UNSET); + font.setDescent(UNSET); + font.setFamily("Unknown"); + font.setBold(false); + font.setItalic(false); + font.setPointSize(Font.UNKNOWN_POINT_SIZE); + do { + line = in.readLine(); + if (line == null) + throw new IOException("BDF format error: end of file while " + + "reading global font information"); + + StringTokenizer st = new StringTokenizer(line); + if (st.hasMoreTokens()) { + String name = st.nextToken(); + if (name.equals("FONT_ASCENT")) { + if (!st.hasMoreTokens()) + throw new IOException("BDF format error: " + + "no tokens after " + name); + font.setAscent(Integer.parseInt(st.nextToken())); + } else if (name.equals("FONT_DESCENT")) { + if (!st.hasMoreTokens()) + throw new IOException("BDF format error: " + + "no tokens after " + name); + font.setDescent(Integer.parseInt(st.nextToken())); + } else if (name.equals("POINT_SIZE")) { + if (!st.hasMoreTokens()) + throw new IOException("BDF format error: " + + "no tokens after " + name); + // Divide by 10, since it is stored X10. + font.setPointSize(Integer.parseInt(st.nextToken()) / 10); + } else if (name.equals("FAMILY_NAME")) { + Matcher matcher = stringSettingPattern.matcher(line); + if (!matcher.matches()) + throw new IOException("BDF format error: " + + "line doesn't match string " + + "setting pattern: " + line); + font.setFamily(matcher.group(2)); + } else if (name.equals("WEIGHT_NAME")) { + Matcher matcher = stringSettingPattern.matcher(line); + if (!matcher.matches()) + throw new IOException("BDF format error: " + + "line doesn't match string " + + "setting pattern: " + line); + String weightName = matcher.group(2); + font.setBold("bold".equalsIgnoreCase(weightName)); + } else if (name.equals("SLANT")) { + Matcher matcher = stringSettingPattern.matcher(line); + if (!matcher.matches()) + throw new IOException("BDF format error: " + + "line doesn't match string " + + "setting pattern: " + line); + String slantType = matcher.group(2); + font.setItalic(!"R".equalsIgnoreCase(slantType)); + } else if (name.equals("CHARS")) { + // This is the end of the global font information and + // the beginning of the character definitions. + break; + } else { + // Skip other fields. + } + } + } while (true); + + if (font.getAscent() == UNSET) + throw new IOException("BDF format error: no FONT_ASCENT property"); + if (font.getDescent() == UNSET) + throw new IOException("BDF format error: no FONT_DESCENT property"); + } + + private boolean loadChar() throws IOException { + String line; + // Find start of character + do { + line = in.readLine(); + if (line == null) + return false; + StringTokenizer st = new StringTokenizer(line); + if (st.hasMoreTokens() && st.nextToken().equals("STARTCHAR")) { + if (!st.hasMoreTokens()) + throw new IOException("BDF format error: no character name after STARTCHAR"); + break; + } + } while (true); + + // Find properties + final int UNSET = Integer.MIN_VALUE; + int codePoint = UNSET; + int bbx = UNSET; + int bby = UNSET; + int bbox = UNSET; + int bboy = UNSET; + int dwidth = UNSET; + do { + line = in.readLine(); + if (line == null) + return false; + StringTokenizer st = new StringTokenizer(line); + if (st.hasMoreTokens()) { + String field = st.nextToken(); + if (field.equals("ENCODING")) { + if (!st.hasMoreTokens()) + throw new IOException("BDF format error: no encoding # after ENCODING"); + String codePointStr = st.nextToken(); + codePoint = Integer.parseInt(codePointStr); + } else if (field.equals("BBX")) { + if (!st.hasMoreTokens()) + throw new IOException("BDF format error: no tokens after BBX"); + bbx = Integer.parseInt(st.nextToken()); + bby = Integer.parseInt(st.nextToken()); + bbox = Integer.parseInt(st.nextToken()); + bboy = Integer.parseInt(st.nextToken()); + } else if (field.equals("DWIDTH")) { + if (!st.hasMoreTokens()) + throw new IOException("BDF format error: no tokens after DWIDTH"); + dwidth = Integer.parseInt(st.nextToken()); + int dwidthY = Integer.parseInt(st.nextToken()); + // The DWIDTH Y value should be zero for any normal font. + if (dwidthY != 0) { + throw new IOException("BDF format error: dwidth Y value" + + "is nonzero (" + dwidthY + ") " + + "for char " + codePoint + "."); + } + } else if (field.equals("BITMAP")) { + break; // now read the bitmap + } + } + } while (true); + + if (codePoint == UNSET) + throw new IOException("BDF format error: " + + "no code point set"); + if (bbx == UNSET || bby == UNSET) + throw new IOException("BDF format error: " + + "bbx/bby missing: " + bbx + ", " + bby + + " for char " + codePoint); + + if (bbox == UNSET || bboy == UNSET) + throw new IOException("BDF format error: " + + "bbox/bboy missing: " + bbox + ", " + bboy + + " for char " + codePoint); + + if (dwidth == UNSET) + throw new IOException("BDF format error: " + + "dwidth missing for char " + codePoint); + + final int glyphWidth = bbx; + final int glyphHeight = bby; + if (glyphWidth > maxCharWidth) + maxCharWidth = glyphWidth; + if (glyphHeight > maxCharHeight) + maxCharHeight = glyphHeight; + + // Read the bitmap + Glyph glyph = new Glyph(codePoint, glyphWidth, glyphHeight, bbox, bboy, dwidth); + for (int y = 0; y < glyphHeight; y++) { + line = in.readLine(); + if (line == null) + return false; + for (int b = 0; b < line.length(); b++) { + int v = Integer.parseInt(Character.toString(line.charAt(b)), 16); + for (int x = b * 4, i = 0; i < 4 && x < glyphWidth; x++, i++) { + boolean set = (v & 0x8) != 0; + v <<= 1; + glyph.setPixel(x, y, set); + } + } + } + + font.putGlyph(codePoint, glyph); + return true; + } +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java b/util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java new file mode 100644 index 000000000..fa2fd9b6e --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java @@ -0,0 +1,181 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +import java.io.ByteArrayOutputStream; +import java.io.DataOutputStream; +import java.io.IOException; +import java.util.Arrays; +import java.util.HashMap; +import java.util.Iterator; +import java.util.List; +import java.util.TreeMap; + +class CharDefs { + private boolean debug = "1".equals(System.getProperty("fonttool.debug")); + private TreeMap glyphs; + private ByteArrayOutputStream charDefsData; + private int maxCharWidth; + private int maxCharHeight; + private HashMap charIndex; + + public CharDefs(Font font) { + this.glyphs = font.getGlyphs(); + this.charIndex = null; + this.charDefsData = null; + + calculateMaxSizes(); + } + + private void calculateMaxSizes() { + maxCharWidth = 0; + maxCharHeight = 0; + for (Glyph glyph : glyphs.values()) { + final int w = glyph.getWidth(); + final int h = glyph.getHeight(); + if (w > maxCharWidth) + maxCharWidth = w; + if (h > maxCharHeight) + maxCharHeight = h; + } + } + + void buildDefinitions(List rangeList) { + charIndex = new HashMap(); + HashMap charDefIndex = new HashMap(); + charDefsData = new ByteArrayOutputStream(); + DataOutputStream charDefs = new DataOutputStream(charDefsData); + try { + // Loop through all the glyphs, writing the glyph data to the + // in-memory byte stream, collapsing duplicate glyphs, and + // constructing index information. + for (Glyph glyph : glyphs.values()) { + // Determine if glyph should be included in written file + if (rangeList.size() > 0) { + boolean skip = true; + + for (Iterator iter = rangeList.iterator(); iter + .hasNext();) { + CharacterRange item = iter.next(); + + if (item.isWithinRange(glyph.getCodePoint())) { + skip = false; + break; + } + } + + if (skip) { + continue; + } + } + + CharDef charDef = new CharDef(glyph.getWidth(), + glyph.getHeight(), + glyph.getBitmap()); + + if (charDefIndex.containsKey(charDef)) { + // Use already-written glyph. + if (debug) + System.out.printf("Duplicate glyph for character U+%04X%n", + glyph.getCodePoint()); + final int charOffset = charDefIndex.get(charDef).intValue(); + final CharStorageInfo info = + new CharStorageInfo(glyph.getCodePoint(), charOffset); + charIndex.put(glyph.getCodePoint(), info); + } else { + // Write glyph data. + final int charOffset = charDefs.size(); + final CharStorageInfo info = + new CharStorageInfo(glyph.getCodePoint(), charOffset); + charIndex.put(glyph.getCodePoint(), info); + + charDefIndex.put(charDef, (long) charOffset); + + charDefs.writeShort(glyph.getWidth()); + charDefs.writeShort(glyph.getHeight()); + charDefs.writeShort(glyph.getBbox()); + charDefs.writeShort(glyph.getBboy()); + charDefs.writeShort(glyph.getDeviceWidth()); + charDefs.write(glyph.getBitmap()); + } + } + } catch (IOException e) { + throw new RuntimeException("Error writing to in-memory byte stream", e); + } + } + + public int getMaxCharWidth() { + return maxCharWidth; + } + + public int getMaxCharHeight() { + return maxCharHeight; + } + + public HashMap getCharIndex() { + if (charIndex == null) throw new IllegalStateException(); + return charIndex; + } + + public byte[] getDefinitionData() { + if (charDefsData == null) throw new IllegalStateException(); + return charDefsData.toByteArray(); + } + + + private static class CharDef { + private final int width; + private final int height; + private final byte[] data; + + public CharDef(int width, int height, byte[] data) { + this.width = width; + this.height = height; + this.data = data; + } + + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + + CharDef charDef = (CharDef) o; + + if (height != charDef.height) return false; + if (width != charDef.width) return false; + if (!Arrays.equals(data, charDef.data)) return false; + + return true; + } + + public int hashCode() { + int result; + result = width; + result = 31 * result + height; + result = 31 * result + Arrays.hashCode(data); + return result; + } + } + + + public int getIndexSize() { + if (charIndex == null) + return 0; + + return charIndex.size(); + } +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java b/util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java new file mode 100644 index 000000000..3d2ba554e --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java @@ -0,0 +1,36 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +class CharStorageInfo { + private final int codePoint; + private final int fileOffset; + + public CharStorageInfo(int codePoint, int fileOffset) { + this.codePoint = codePoint; + this.fileOffset = fileOffset; + } + + public int getCodePoint() { + return codePoint; + } + + public int getFileOffset() { + return fileOffset; + } +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java b/util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java new file mode 100644 index 000000000..378fdedea --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java @@ -0,0 +1,75 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +/** + * @author chaac + * + */ +public class CharacterRange { + private int start; + private int end; + + public CharacterRange(int start, int end) { + this.start = start; + this.end = end; + } + + public int getStart() { + return start; + } + + public int getEnd() { + return end; + } + + protected boolean isCombinable(CharacterRange range) { + if (getStart() <= range.getStart() && range.getStart() <= getEnd()) + return true; + + if (range.getStart() <= getStart() && getStart() <= range.getEnd()) + return true; + + return false; + } + + public boolean isWithinRange(int value) { + if (value >= start && value <= end) + return true; + + return false; + } + + public boolean combine(CharacterRange range) { + int start; + int end; + + if (! isCombinable(range)) + return false; + + start = getStart(); + if (range.getStart() < start) + start = range.getStart(); + + end = getEnd(); + if (range.getEnd() > end) + end = range.getEnd(); + + return true; + } +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/Converter.java b/util/fonttool/src/org/gnu/grub/fonttool/Converter.java new file mode 100644 index 000000000..c84fc7104 --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/Converter.java @@ -0,0 +1,168 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +import java.io.IOException; +import java.util.ArrayList; +import java.util.Iterator; +import java.util.List; + +/** + * Program to convert BDF fonts into PFF2 fonts for use with GRUB. + */ +public class Converter { + public static void main(String[] args) { + if (args.length < 1) { + printUsageAndExit(); + } + + String in = null; + String out = null; + List rangeList = new ArrayList(); + + try { + for (String arg : args) { + if (arg.startsWith("--")) { + String option; + String value; + int equalsPos = arg.indexOf('='); + if (equalsPos < 0) { + option = arg.substring(2); + value = null; + } else { + option = arg.substring(2, equalsPos); + value = arg.substring(equalsPos + 1); + } + + if ("in".equals(option)) { + if (value == null) + throw new CommandLineException(option + + " option requires a value."); + in = value; + } else if ("out".equals(option)) { + if (value == null) + throw new CommandLineException(option + + " option requires a value."); + out = value; + } + } else if (arg.startsWith("0x")) { + // Range specifier + String strRange[] = arg.split("-"); + + if (strRange.length > 0) { + boolean validRange = true; + int start; + int end; + + if (strRange.length > 2) { + validRange = false; + } else if (strRange.length == 2 + && !strRange[1].startsWith("0x")) { + validRange = false; + } else + { + try { + start = Integer.parseInt(strRange[0] + .substring(2), 16); + end = start; + + if (strRange.length == 2) { + end = Integer.parseInt(strRange[1] + .substring(2), 16); + } + + CharacterRange range = new CharacterRange( + start, end); + boolean add = true; + + // First, try to combine range to existing ranges + for (Iterator iter = rangeList.iterator(); iter.hasNext(); ) + { + CharacterRange item = iter.next(); + + if (range.equals(item)) + { + add = false; + continue; + } + + if (item.combine(range)) + { + // Start from beginning of list using combined range + range = item; + iter = rangeList.iterator(); + add = false; + } + } + + // If range could not be combined or no matching range, add it to the list + if (add) + { + rangeList.add(range); + } + + } catch (NumberFormatException e) { + validRange = false; + } + + } + + if (!validRange) { + throw new CommandLineException("Invalid range `" + + arg + "'."); + } + } + } else { + throw new CommandLineException("Non-option argument `" + arg + "'."); + } + } + if (in == null || out == null) { + throw new CommandLineException("Both --in=X and --out=Y must be specified."); + } + } catch (CommandLineException e) { + System.err.println("Error: " + e.getMessage()); + System.exit(1); + } + + try { + // Read BDF. + Font font = BDFLoader.loadFontFile(in); + + // Write PFF2. + new PFF2Writer(out).writeFont(font, rangeList); + } catch (IOException e) { + System.err.println("I/O error converting font: " + e); + e.printStackTrace(); + System.exit(1); + } + } + + private static class CommandLineException extends Exception { + public CommandLineException(String message) { + super(message); + } + } + + private static void printUsageAndExit() { + System.err.println("GNU GRUB Font Conversion Tool"); + System.err.println(); + System.err.println("Usage: Converter --in=IN.bdf --out=OUT.pf2"); + System.err.println(); + System.exit(1); + } +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/Font.java b/util/fonttool/src/org/gnu/grub/fonttool/Font.java new file mode 100644 index 000000000..77df4b25c --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/Font.java @@ -0,0 +1,123 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +import java.util.TreeMap; + +public class Font { + public static final int UNKNOWN_POINT_SIZE = -1; + + private TreeMap glyphs; + private String family; + private boolean bold; + private boolean italic; + private int pointSize; + private int maxCharWidth; + private int maxCharHeight; + private int ascent; + private int descent; + + public Font() { + glyphs = new TreeMap(); + } + + public String getFamily() { + return family; + } + + public void setFamily(String family) { + this.family = family; + } + + public boolean isBold() { + return bold; + } + + public void setBold(boolean bold) { + this.bold = bold; + } + + public boolean isItalic() { + return italic; + } + + public void setItalic(boolean italic) { + this.italic = italic; + } + + public int getPointSize() { + return pointSize; + } + + public void setPointSize(int pointSize) { + this.pointSize = pointSize; + } + + public int getMaxCharWidth() { + return maxCharWidth; + } + + public void setMaxCharWidth(int maxCharWidth) { + this.maxCharWidth = maxCharWidth; + } + + public int getMaxCharHeight() { + return maxCharHeight; + } + + public void setMaxCharHeight(int maxCharHeight) { + this.maxCharHeight = maxCharHeight; + } + + public int getAscent() { + return ascent; + } + + public void setAscent(int ascent) { + this.ascent = ascent; + } + + public int getDescent() { + return descent; + } + + public void setDescent(int descent) { + this.descent = descent; + } + + public void putGlyph(int codePoint, Glyph glyph) { + glyphs.put(codePoint, glyph); + } + + public TreeMap getGlyphs() { + return glyphs; + } + + public Glyph getGlyph(int codePoint) { + return glyphs.get(codePoint); + } + + public String getStandardName() { + StringBuilder name = new StringBuilder(getFamily()); + if (isBold()) name.append(" Bold"); + if (isItalic()) name.append(" Italic"); + name.append(' '); + name.append(getPointSize()); + return name.toString(); + } +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/Glyph.java b/util/fonttool/src/org/gnu/grub/fonttool/Glyph.java new file mode 100644 index 000000000..c1bc5e576 --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/Glyph.java @@ -0,0 +1,100 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +public class Glyph { + private final int codePoint; + private final int width; + private final int height; + + // These define the amounts to shift the character bitmap by + // before drawing it. See + // http://www.adobe.com/devnet/font/pdfs/5005.BDF_Spec.pdf + // and + // http://www.linuxbabble.com/documentation/x/bdf/ + // for explanatory figures. + private final int bbox; + private final int bboy; + + // Number of pixels to advance horizontally from this character's origin + // to the origin of the next character. + private final int deviceWidth; + + // Row-major order, no padding. Rows can break within a byte. + // MSb is first (leftmost/uppermost) pixel. + private final byte[] bitmap; + + public Glyph(int codePoint, int width, int height, int bbox, int bboy, int deviceWidth) { + this(codePoint, width, height, bbox, bboy, deviceWidth, + new byte[(width * height + 7) / 8]); + } + + public Glyph(int codePoint, int width, int height, + int bbox, int bboy, int deviceWidth, + byte[] bitmap) { + this.codePoint = codePoint; + this.width = width; + this.height = height; + this.bboy = bboy; + this.bbox = bbox; + this.deviceWidth = deviceWidth; + this.bitmap = bitmap; + } + + public void setPixel(int x, int y, boolean value) { + if (x < 0 || y < 0 || x >= width || y >= height) + throw new IllegalArgumentException( + "Invalid pixel location (" + x + ", " + y + ") for " + + width + "x" + height + " glyph"); + + int bitIndex = y * width + x; + int byteIndex = bitIndex / 8; + int bitPos = bitIndex % 8; + int v = value ? 0x80 >>> bitPos : 0; + int mask = ~(0x80 >>> bitPos); + bitmap[byteIndex] = (byte) ((bitmap[byteIndex] & mask) | v); + } + + public int getCodePoint() { + return codePoint; + } + + public int getWidth() { + return width; + } + + public int getHeight() { + return height; + } + + public int getBbox() { + return bbox; + } + + public int getBboy() { + return bboy; + } + + public int getDeviceWidth() { + return deviceWidth; + } + + public byte[] getBitmap() { + return bitmap; + } +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java b/util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java new file mode 100644 index 000000000..61e8d8892 --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java @@ -0,0 +1,36 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +/** + * Section name constants for the PFF2 file format. + */ +public class PFF2Sections { + static final String FILE = "FILE"; + static final String FONT_NAME = "NAME"; + static final String FONT_FAMILY = "FAMI"; + static final String FONT_WEIGHT = "WEIG"; + static final String FONT_SLANT = "SLAN"; + static final String FONT_POINT_SIZE = "PTSZ"; + static final String MAX_CHAR_WIDTH = "MAXW"; + static final String MAX_CHAR_HEIGHT = "MAXH"; + static final String FONT_ASCENT = "ASCE"; + static final String FONT_DESCENT = "DESC"; + static final String CHAR_INDEX = "CHIX"; + static final String REMAINDER_IS_DATA = "DATA"; +} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java b/util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java new file mode 100644 index 000000000..d38ed2724 --- /dev/null +++ b/util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java @@ -0,0 +1,154 @@ +/** + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +package org.gnu.grub.fonttool; + +import java.io.FileNotFoundException; +import java.io.IOException; +import java.io.RandomAccessFile; +import java.util.List; + +// TODO Add DEFLATE compressed blocks of characters. +public class PFF2Writer { + private RandomAccessFile f; + private String currentSection; + private long currentSectionStart; + + public PFF2Writer(String filename) throws FileNotFoundException { + this.f = new RandomAccessFile(filename, "rw"); + this.currentSection = null; + this.currentSectionStart = -1; + } + + public void writeFont(Font font, List rangeList) throws IOException { + // Clear existing file. + f.setLength(0); + + // Write file type ID header. + writeSection(PFF2Sections.FILE, "PFF2"); + + writeSection(PFF2Sections.FONT_NAME, font.getStandardName()); + writeSection(PFF2Sections.FONT_FAMILY, font.getFamily()); + writeSection(PFF2Sections.FONT_WEIGHT, font.isBold() ? "bold" : "normal"); + writeSection(PFF2Sections.FONT_SLANT, font.isItalic() ? "italic" : "normal"); + if (font.getPointSize() != Font.UNKNOWN_POINT_SIZE) + writeShortSection(PFF2Sections.FONT_POINT_SIZE, font.getPointSize()); + + // Construct character definitions. + CharDefs charDefs = new CharDefs(font); + charDefs.buildDefinitions(rangeList); + + // Write max character width and height metrics. + writeShortSection(PFF2Sections.MAX_CHAR_WIDTH, charDefs.getMaxCharWidth()); + writeShortSection(PFF2Sections.MAX_CHAR_HEIGHT, charDefs.getMaxCharHeight()); + writeShortSection(PFF2Sections.FONT_ASCENT, font.getAscent()); + writeShortSection(PFF2Sections.FONT_DESCENT, font.getDescent()); + + // Write character index with pointers to the character definitions. + beginSection(PFF2Sections.CHAR_INDEX); + + // Determine the size of the index, so we can properly refer to the + // character definition offset in the index. The actual number of + // bytes written is compared to the calculated value to ensure we + // are correct. + final int indexStart = (int) f.getFilePointer(); + final int calculatedIndexLength = + charDefs.getIndexSize() * (4 + 1 + 4); + final int charDefStart = indexStart + calculatedIndexLength + 8; + + for (CharStorageInfo storageInfo : charDefs.getCharIndex().values()) { + f.writeInt(storageInfo.getCodePoint()); + f.writeByte(0); // Storage flags: bits 1..0 = 00b : uncompressed. + f.writeInt(charDefStart + storageInfo.getFileOffset()); + } + + final int indexEnd = (int) f.getFilePointer(); + if (indexEnd - indexStart != calculatedIndexLength) { + throw new RuntimeException("Incorrect index length calculated, calc=" + + calculatedIndexLength + + " actual=" + (indexEnd - indexStart)); + } + endSection(PFF2Sections.CHAR_INDEX); + + f.writeBytes(PFF2Sections.REMAINDER_IS_DATA); + f.writeInt(-1); // Data takes up the rest of the file. + f.write(charDefs.getDefinitionData()); + + f.close(); + } + + private void beginSection(String sectionName) throws IOException { + verifyOkToBeginSection(sectionName); + + f.writeBytes(sectionName); + f.writeInt(-1); // Placeholder for the section length. + currentSection = sectionName; + currentSectionStart = f.getFilePointer(); + } + + private void endSection(String sectionName) throws IOException { + verifyOkToEndSection(sectionName); + + long sectionEnd = f.getFilePointer(); + long sectionLength = sectionEnd - currentSectionStart; + f.seek(currentSectionStart - 4); + f.writeInt((int) sectionLength); + f.seek(sectionEnd); + currentSection = null; + currentSectionStart = -1; + } + + private void verifyOkToBeginSection(String sectionName) { + if (sectionName.length() != 4) + throw new IllegalArgumentException( + "Section names must be 4 characters: `" + sectionName + "'."); + if (currentSection != null) + throw new IllegalStateException( + "Attempt to start `" + sectionName + + "' section before ending the previous section `" + + currentSection + "'."); + } + + private void verifyOkToEndSection(String sectionName) { + if (sectionName.length() != 4) + throw new IllegalStateException("Invalid section name '" + sectionName + + "'; must be 4 characters."); + if (currentSection == null) + throw new IllegalStateException( + "Attempt to end section `" + sectionName + + "' when no section active."); + if (!sectionName.equals(currentSection)) + throw new IllegalStateException( + "Attempt to end `" + sectionName + + "' section during active section `" + + currentSection + "'."); + } + + private void writeSection(String sectionName, String contents) throws IOException { + verifyOkToBeginSection(sectionName); + f.writeBytes(sectionName); + f.writeInt(contents.length()); + f.writeBytes(contents); + } + + private void writeShortSection(String sectionName, int value) throws IOException { + verifyOkToBeginSection(sectionName); + f.writeBytes(sectionName); + f.writeInt(2); + f.writeShort(value); + } +} diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index fb842f2d4..0c5c45621 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -1,5 +1,5 @@ # Helper library for grub-mkconfig -# Copyright (C) 2007,2008 Free Software Foundation, Inc. +# Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -154,7 +154,7 @@ font_path () # FIXME: We prefer ascii because loading complete fonts is too slow (and # we don't yet provide the gettext magic that would make unicode useful). for basename in ascii unicode unifont ; do - path="${dir}/${basename}.pff" + path="${dir}/${basename}.pf2" if is_path_readable_by_grub ${path} > /dev/null ; then echo "${path}" return 0 diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 3d434d765..93b90675b 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -1,7 +1,7 @@ #! /bin/sh -e # update-grub helper script. -# Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. +# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -87,7 +87,7 @@ case x${GRUB_TERMINAL_OUTPUT} in fi cat << EOF -if font `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then +if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then set gfxmode=${GRUB_GFXMODE} insmod gfxterm insmod ${video_backend} diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index 41660ac06..7f1cb9d90 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -710,6 +709,16 @@ grub_video_vbe_map_rgb (grub_uint8_t red, grub_uint8_t green, return minindex; } + else if ((render_target->mode_info.mode_type + & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + { + if (red == render_target->mode_info.fg_red + && green == render_target->mode_info.fg_green + && blue == render_target->mode_info.fg_blue) + return 1; + else + return 0; + } else { grub_uint32_t value; @@ -740,6 +749,17 @@ grub_video_vbe_map_rgba (grub_uint8_t red, grub_uint8_t green, /* No alpha available in index color modes, just use same value as in only RGB modes. */ return grub_video_vbe_map_rgb (red, green, blue); + else if ((render_target->mode_info.mode_type + & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + { + if (red == render_target->mode_info.fg_red + && green == render_target->mode_info.fg_green + && blue == render_target->mode_info.fg_blue + && alpha == render_target->mode_info.fg_alpha) + return 1; + else + return 0; + } else { grub_uint32_t value; @@ -802,6 +822,24 @@ grub_video_vbe_unmap_color_int (struct grub_video_i386_vbeblit_info * source, *alpha = framebuffer.palette[color].a; return; } + else if ((mode_info->mode_type + & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + { + if (color & 1) + { + *red = mode_info->fg_red; + *green = mode_info->fg_green; + *blue = mode_info->fg_blue; + *alpha = mode_info->fg_alpha; + } + else + { + *red = mode_info->bg_red; + *green = mode_info->bg_green; + *blue = mode_info->bg_blue; + *alpha = mode_info->bg_alpha; + } + } else { grub_uint32_t tmp; @@ -925,76 +963,6 @@ grub_video_vbe_fill_rect (grub_video_color_t color, int x, int y, return GRUB_ERR_NONE; } -// TODO: Remove this method and replace with bitmap based glyphs -static grub_err_t -grub_video_vbe_blit_glyph (struct grub_font_glyph * glyph, - grub_video_color_t color, int x, int y) -{ - struct grub_video_i386_vbeblit_info target; - unsigned int width; - unsigned int charwidth; - unsigned int height; - unsigned int i; - unsigned int j; - unsigned int x_offset = 0; - unsigned int y_offset = 0; - - /* Make sure there is something to do. */ - if (x >= (int)render_target->viewport.width) - return GRUB_ERR_NONE; - - if (y >= (int)render_target->viewport.height) - return GRUB_ERR_NONE; - - /* Calculate glyph dimensions. */ - width = ((glyph->width + 7) / 8) * 8; - charwidth = width; - height = glyph->height; - - if (x + (int)width < 0) - return GRUB_ERR_NONE; - - if (y + (int)height < 0) - return GRUB_ERR_NONE; - - /* Do not allow drawing out of viewport. */ - if (x < 0) - { - width += x; - x_offset = (unsigned int)-x; - x = 0; - } - if (y < 0) - { - height += y; - y_offset = (unsigned int)-y; - y = 0; - } - - if ((x + width) > render_target->viewport.width) - width = render_target->viewport.width - x; - if ((y + height) > render_target->viewport.height) - height = render_target->viewport.height - y; - - /* Add viewport offset. */ - x += render_target->viewport.x; - y += render_target->viewport.y; - - /* Use vbeblit_info to encapsulate rendering. */ - target.mode_info = &render_target->mode_info; - target.data = render_target->data; - - /* Draw glyph. */ - for (j = 0; j < height; j++) - for (i = 0; i < width; i++) - if ((glyph->bitmap[((i + x_offset) / 8) - + (j + y_offset) * (charwidth / 8)] - & (1 << ((charwidth - (i + x_offset) - 1) % 8)))) - set_pixel (&target, x+i, y+j, color); - - return GRUB_ERR_NONE; -} - /* NOTE: This function assumes that given coordinates are within bounds of handled data. */ static void @@ -1619,7 +1587,6 @@ static struct grub_video_adapter grub_video_vbe_adapter = .map_rgba = grub_video_vbe_map_rgba, .unmap_color = grub_video_vbe_unmap_color, .fill_rect = grub_video_vbe_fill_rect, - .blit_glyph = grub_video_vbe_blit_glyph, .blit_bitmap = grub_video_vbe_blit_bitmap, .blit_render_target = grub_video_vbe_blit_render_target, .scroll = grub_video_vbe_scroll, diff --git a/video/i386/pc/vbeutil.c b/video/i386/pc/vbeutil.c index 4556928ef..1040dc934 100644 --- a/video/i386/pc/vbeutil.c +++ b/video/i386/pc/vbeutil.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -52,6 +52,12 @@ get_data_ptr (struct grub_video_i386_vbeblit_info *source, + y * source->mode_info->pitch + x; break; + + case 1: + /* For 1-bit bitmaps, addressing needs to be done at the bit level + and it doesn't make sense, in general, to ask for a pointer + to a particular pixel's data. */ + break; } return ptr; @@ -86,6 +92,17 @@ get_pixel (struct grub_video_i386_vbeblit_info *source, color = *(grub_uint8_t *)get_data_ptr (source, x, y); break; + case 1: + if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) + { + int bit_index = y * source->mode_info->width + x; + grub_uint8_t *ptr = (grub_uint8_t *)source->data + + bit_index / 8; + int bit_pos = 7 - bit_index % 8; + color = (*ptr >> bit_pos) & 0x01; + } + break; + default: break; } @@ -143,6 +160,17 @@ set_pixel (struct grub_video_i386_vbeblit_info *source, } break; + case 1: + if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) + { + int bit_index = y * source->mode_info->width + x; + grub_uint8_t *ptr = (grub_uint8_t *)source->data + + bit_index / 8; + int bit_pos = 7 - bit_index % 8; + *ptr = (*ptr & ~(1 << bit_pos)) | ((color & 0x01) << bit_pos); + } + break; + default: break; } diff --git a/video/video.c b/video/video.c index 1caf8861b..49e6cb95e 100644 --- a/video/video.c +++ b/video/video.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -336,17 +336,6 @@ grub_video_fill_rect (grub_video_color_t color, int x, int y, return grub_video_adapter_active->fill_rect (color, x, y, width, height); } -/* Blit glyph to screen using specified color. */ -grub_err_t -grub_video_blit_glyph (struct grub_font_glyph *glyph, - grub_video_color_t color, int x, int y) -{ - if (! grub_video_adapter_active) - return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated"); - - return grub_video_adapter_active->blit_glyph (glyph, color, x, y); -} - /* Blit bitmap to screen. */ grub_err_t grub_video_blit_bitmap (struct grub_video_bitmap *bitmap, From 34c44600fedf6dec93383c96512ad4b7f528c9fb Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 2 Jan 2009 23:38:44 +0000 Subject: [PATCH 0477/1707] Fix typos, trailing whitespace --- ChangeLog | 84 +++++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6fb3e626e..9772280e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,90 +1,90 @@ 2009-01-02 Colin D Bennett New font engine. - + Additional changes by Vesa Jääskeläinen to adapt to build system and fixed gfxterm.c to work with different sized fonts. * configure.ac: Changed UNIFONT_HEX to UNIFONT_BDF. - + * configure: Re-generated. - + * DISTLIST: Removed font/manager.c. Added font/font.c. Added font/font_cmd.c. - + * Makefile.in: Changed UNIFONT_HEX to UNIFONT_BDF. Added Font tool compilation. - + * include/grub/misc.h (grub_utf8_to_ucs4): Changed prototype. Changed users. - - * kern/misc.c (grub_utf8_to_ucs4): Changed prototype. + + * kern/misc.c (grub_utf8_to_ucs4): Changed prototype. * kern/term.c: Changed users of grub_utf8_to_ucs4. - + * normal/menu.c: Likewise. - + * conf/common.rmk (font_mod_SOURCES): Removed font/manager.c. (font_mod_SOURCES): Added font/font_cmd.c, font/font.c. - + * include/grub/font.h: Replaced with new file. - + * include/grub/video.h (GRUB_VIDEO_MODE_TYPE_ALPHA): Changed value. (GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED): Likewise. (GRUB_VIDEO_MODE_TYPE_COLOR_MASK): Likewise. (GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP): Added. (grub_video_blit_format): Added GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED. - (grub_video_mode_info): Added bg_red, bg_green, bg_blue, bg_alpha, + (grub_video_mode_info): Added bg_red, bg_green, bg_blue, bg_alpha, fg_red, fg_green, fg_blue, fg_alpha. (grub_video_adapter): Removed blit_glyph. - (grub_video_blit_glyph): Removed. - + (grub_video_blit_glyph): Removed. + * font/manager.c: Removed file. - - * font/font.c: New file. - + + * font/font.c: New file. + * font/font_cmd.c: Likewise. - + * video/video.c (grub_video_blit_glyph): Removed. - + * video/i386/pc/vbe.c (grub_video_vbe_map_rgb): Added 1-bit support. (grub_video_vbe_map_rgba): Likewise. (grub_video_vbe_unmap_color_int): Likewise. (grub_video_vbe_blit_glyph): Removed. (grub_video_vbe_adapter): Removed blit_glyph. - + * video/i386/pc/vbeutil.c (get_data_ptr): Added 1-bit support. (get_pixel): Likewise. - (set_pixel): Likewise. - + (set_pixel): Likewise. + * commands/videotest.c (grub_cmd_videotest): Added more tests for fonts. - + * term/gfxterm.c: Adapted to new font engine. - + * term/i386/pc/vesafb.c: Marked as deprecated. Made it compile. - + * term/i386/pc/vga.c: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java: New file. - + * util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/Converter.java: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/Font.java: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/Glyph.java: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java: Likewise. - + * util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java: Likewise. * util/grub.d/00_header.in: Changed to use new loadfont command. - + * util/grub-mkconfig_lib.in: Changed font extension. 2008-12-28 Felix Zielcke @@ -100,10 +100,10 @@ 2008-11-29 Robert Millan - * disk/ata.c (grub_ata_pciinit): Handle errors rised by + * disk/ata.c (grub_ata_pciinit): Handle errors raised by grub_ata_device_initialize() calls. -2008-11-28 Krzysztof Smiechowicz +2008-11-28 Krzysztof Smiechowicz * fs/affs.c (grub_affs_iterate_dir): Return failure when directory iteration failed. @@ -132,13 +132,13 @@ 2008-11-22 Robert Millan - Fix breakage on coreboot due to declaration missmatch. + Fix breakage on coreboot due to declaration mismatch. * term/i386/pc/vga_text.c (grub_vga_text_init_fini): New function. (grub_vga_text_term): Use grub_vga_text_init_fini() instead of grub_vga_text_cls(). * kern/i386/loader.S (grub_multiboot_backward_relocator): Improve - comments. Avoid copiing one more byte than necessary (just in case). + comments. Avoid copying one more byte than necessary (just in case). * conf/powerpc-ieee1275.rmk (kernel_elf_LDFLAGS): Change link address to 0x200000 (avoids trouble with some OFW implementations, and matches @@ -207,7 +207,7 @@ loader. * loader/i386/linux.c (allocate_pages): Allocate `real_mode_mem' in - an appropiate place in lower memory, between 0x10000 and 0x90000, + an appropriate place in lower memory, between 0x10000 and 0x90000, like loader/i386/efi/linux.c does. Linux often panics if real_mode_mem is in our heap (probably as a result of it being corrupted during decompression). Add #error instance with comment to explain why this @@ -216,7 +216,7 @@ 2008-11-14 Robert Millan * term/i386/pc/serial.c [! GRUB_MACHINE_PCBIOS] - (GRUB_SERIAL_PORT_NUM): Fix misscalculation. + (GRUB_SERIAL_PORT_NUM): Fix miscalculation. 2008-11-12 Robert Millan @@ -2550,7 +2550,7 @@ looking for (often causing expensive probes of non-existent drives). Some callers relied on previous buggy behaviour, since they would - rise an error when their own hooks caused early abortion of its + raise an error when their own hooks caused early abortion of its iteration. * kern/device.c (grub_device_open): Improve error message. From 644fff97d2c8956f86f4fc68156a7ac8f476126b Mon Sep 17 00:00:00 2001 From: jerone Date: Mon, 5 Jan 2009 05:25:05 +0000 Subject: [PATCH 0478/1707] 2009-01-04 Jerone Young Make on screen instructions clearer Based on patch created by Jidanni * normal/menu.c: print clearer instructions on the screen --- ChangeLog | 8 ++++++++ normal/menu.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9772280e4..9774896d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-01-04 Jerone Young + + Make on screen instructions clearer + + Based on patch created by Jidanni + + * normal/menu.c: print clearer instructions on the screen + 2009-01-02 Colin D Bennett New font engine. diff --git a/normal/menu.c b/normal/menu.c index 644446976..7dd5300be 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -82,8 +82,8 @@ print_message (int nested, int edit) { grub_printf ("\n\ Minimum Emacs-like screen editing is supported. TAB lists\n\ - available completions. Press C-x (\'x\' with Ctrl) to boot,\n\ - C-c (\'c\' with Ctrl) for a command-line or ESC to return menu."); + completions. Press Ctrl-x to boot, Ctrl-c for a command-line\n\ + or ESC to return menu."); } else { From 7f02114b792b12290c1c74b0a798df81dc84bd76 Mon Sep 17 00:00:00 2001 From: chaac Date: Mon, 5 Jan 2009 23:01:00 +0000 Subject: [PATCH 0479/1707] =?UTF-8?q?2009-01-06=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commands/videotest.c: Removed include to grub/machine/memory.h. * conf/i386-pc.rmk (pkglib_MODULES): Removed video.mod, gfxterm.mod, videotest.mod, bitmap.mod, tga.mod, jpeg.mod, png.mod. (video_mod_SOURCES): Removed. (video_mod_CFLAGS): Likewise. (video_mod_LDFLAGS): Likewise. (gfxterm_mod_SOURCES): Likewise. (gfxterm_mod_CFLAGS): Likewise. (gfxterm_mod_LDFLAGS): Likewise. (videotest_mod_SOURCES): Likewise. (videotest_mod_CFLAGS): Likewise. (videotest_mod_LDFLAGS): Likewise. (bitmap_mod_SOURCES): Likewise. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. (jpeg_mod_SOURCES): Likewise. (jpeg_mod_CFLAGS): Likewise. (jpeg_mod_LDFLAGS): Likewise. (png_mod_SOURCES): Likewise. (png_mod_CFLAGS): Likewise. (png_mod_LDFLAGS): Likewise. * conf/common.rmk (pkglib_MODULES): Added video.mod, videotest.mod, bitmap.mod, tga.mod, jpeg.mod, png.mod, font.mod, gfxterm.mod (video_mod_SOURCES): Added. (video_mod_CFLAGS): Likewise. (video_mod_LDFLAGS): Likewise. (videotest_mod_SOURCES): Likewise. (videotest_mod_CFLAGS): Likewise. (videotest_mod_LDFLAGS): Likewise. (bitmap_mod_SOURCES): Likewise. (bitmap_mod_CFLAGS): Likewise. (bitmap_mod_LDFLAGS): Likewise. (tga_mod_SOURCES): Likewise. (tga_mod_CFLAGS): Likewise. (tga_mod_LDFLAGS): Likewise. (jpeg_mod_SOURCES): Likewise. (jpeg_mod_CFLAGS): Likewise. (jpeg_mod_LDFLAGS): Likewise. (png_mod_SOURCES): Likewise. (png_mod_CFLAGS): Likewise. (png_mod_LDFLAGS): Likewise. (gfxterm_mod_SOURCES): Likewise. (gfxterm_mod_CFLAGS): Likewise. (gfxterm_mod_LDFLAGS): Likewise. * term/gfxterm.c: Removed include to grub/machine/memory.h, grub/machine/console.h. --- ChangeLog | 55 ++++++ commands/videotest.c | 1 - conf/common.mk | 404 ++++++++++++++++++++++++++++++++++++++++++- conf/common.rmk | 51 +++++- conf/i386-pc.mk | 404 +------------------------------------------ conf/i386-pc.rmk | 40 +---- term/gfxterm.c | 2 - 7 files changed, 506 insertions(+), 451 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9774896d1..f4c62de3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,58 @@ +2009-01-06 Vesa Jääskeläinen + + * commands/videotest.c: Removed include to grub/machine/memory.h. + + * conf/i386-pc.rmk (pkglib_MODULES): Removed video.mod, gfxterm.mod, + videotest.mod, bitmap.mod, tga.mod, jpeg.mod, png.mod. + (video_mod_SOURCES): Removed. + (video_mod_CFLAGS): Likewise. + (video_mod_LDFLAGS): Likewise. + (gfxterm_mod_SOURCES): Likewise. + (gfxterm_mod_CFLAGS): Likewise. + (gfxterm_mod_LDFLAGS): Likewise. + (videotest_mod_SOURCES): Likewise. + (videotest_mod_CFLAGS): Likewise. + (videotest_mod_LDFLAGS): Likewise. + (bitmap_mod_SOURCES): Likewise. + (bitmap_mod_CFLAGS): Likewise. + (bitmap_mod_LDFLAGS): Likewise. + (tga_mod_SOURCES): Likewise. + (tga_mod_CFLAGS): Likewise. + (tga_mod_LDFLAGS): Likewise. + (jpeg_mod_SOURCES): Likewise. + (jpeg_mod_CFLAGS): Likewise. + (jpeg_mod_LDFLAGS): Likewise. + (png_mod_SOURCES): Likewise. + (png_mod_CFLAGS): Likewise. + (png_mod_LDFLAGS): Likewise. + + * conf/common.rmk (pkglib_MODULES): Added video.mod, videotest.mod, + bitmap.mod, tga.mod, jpeg.mod, png.mod, font.mod, gfxterm.mod + (video_mod_SOURCES): Added. + (video_mod_CFLAGS): Likewise. + (video_mod_LDFLAGS): Likewise. + (videotest_mod_SOURCES): Likewise. + (videotest_mod_CFLAGS): Likewise. + (videotest_mod_LDFLAGS): Likewise. + (bitmap_mod_SOURCES): Likewise. + (bitmap_mod_CFLAGS): Likewise. + (bitmap_mod_LDFLAGS): Likewise. + (tga_mod_SOURCES): Likewise. + (tga_mod_CFLAGS): Likewise. + (tga_mod_LDFLAGS): Likewise. + (jpeg_mod_SOURCES): Likewise. + (jpeg_mod_CFLAGS): Likewise. + (jpeg_mod_LDFLAGS): Likewise. + (png_mod_SOURCES): Likewise. + (png_mod_CFLAGS): Likewise. + (png_mod_LDFLAGS): Likewise. + (gfxterm_mod_SOURCES): Likewise. + (gfxterm_mod_CFLAGS): Likewise. + (gfxterm_mod_LDFLAGS): Likewise. + + * term/gfxterm.c: Removed include to grub/machine/memory.h, + grub/machine/console.h. + 2009-01-04 Jerone Young Make on screen instructions clearer diff --git a/commands/videotest.c b/commands/videotest.c index b0599df3b..a9ead8128 100644 --- a/commands/videotest.c +++ b/commands/videotest.c @@ -16,7 +16,6 @@ * along with GRUB. If not, see . */ -#include #include #include #include diff --git a/conf/common.mk b/conf/common.mk index d54093198..cec65c001 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -2341,10 +2341,11 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ - cmp.mod cat.mod help.mod font.mod search.mod \ + cmp.mod cat.mod help.mod video.mod font.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod + read.mod sleep.mod loadenv.mod crc.mod gfxterm.mod \ + videotest.mod bitmap.mod tga.mod jpeg.mod png.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -2802,6 +2803,63 @@ partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCI help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For video.mod. +video_mod_SOURCES = video/video.c +CLEANFILES += video.mod mod-video.o mod-video.c pre-video.o video_mod-video_video.o und-video.lst +ifneq ($(video_mod_EXPORTS),no) +CLEANFILES += def-video.lst +DEFSYMFILES += def-video.lst +endif +MOSTLYCLEANFILES += video_mod-video_video.d +UNDSYMFILES += und-video.lst + +video.mod: pre-video.o mod-video.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o + -rm -f $@ + $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ video_mod-video_video.o + +mod-video.o: mod-video.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $< + +mod-video.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(video_mod_EXPORTS),no) +def-video.lst: pre-video.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 video/' > $@ +endif + +und-video.lst: pre-video.o + echo 'video' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +video_mod-video_video.o: video/video.c $(video/video.c_DEPENDENCIES) + $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -MD -c -o $@ $< +-include video_mod-video_video.d + +CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst partmap-video_mod-video_video.lst +COMMANDFILES += cmd-video_mod-video_video.lst +FSFILES += fs-video_mod-video_video.lst +PARTMAPFILES += partmap-video_mod-video_video.lst + +cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) + +fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) + +partmap-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) + + +video_mod_CFLAGS = $(COMMON_CFLAGS) +video_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For font.mod. font_mod_SOURCES = font/font_cmd.c font/font.c CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_font_cmd.o font_mod-font_font.o und-font.lst @@ -3638,6 +3696,348 @@ partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist. crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For gfxterm.mod. +gfxterm_mod_SOURCES = term/gfxterm.c +CLEANFILES += gfxterm.mod mod-gfxterm.o mod-gfxterm.c pre-gfxterm.o gfxterm_mod-term_gfxterm.o und-gfxterm.lst +ifneq ($(gfxterm_mod_EXPORTS),no) +CLEANFILES += def-gfxterm.lst +DEFSYMFILES += def-gfxterm.lst +endif +MOSTLYCLEANFILES += gfxterm_mod-term_gfxterm.d +UNDSYMFILES += und-gfxterm.lst + +gfxterm.mod: pre-gfxterm.o mod-gfxterm.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o + -rm -f $@ + $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gfxterm_mod-term_gfxterm.o + +mod-gfxterm.o: mod-gfxterm.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $< + +mod-gfxterm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(gfxterm_mod_EXPORTS),no) +def-gfxterm.lst: pre-gfxterm.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gfxterm/' > $@ +endif + +und-gfxterm.lst: pre-gfxterm.o + echo 'gfxterm' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +gfxterm_mod-term_gfxterm.o: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) + $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -MD -c -o $@ $< +-include gfxterm_mod-term_gfxterm.d + +CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst partmap-gfxterm_mod-term_gfxterm.lst +COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst +FSFILES += fs-gfxterm_mod-term_gfxterm.lst +PARTMAPFILES += partmap-gfxterm_mod-term_gfxterm.lst + +cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) + +fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) + +partmap-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) + + +gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) +gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For videotest.mod. +videotest_mod_SOURCES = commands/videotest.c +CLEANFILES += videotest.mod mod-videotest.o mod-videotest.c pre-videotest.o videotest_mod-commands_videotest.o und-videotest.lst +ifneq ($(videotest_mod_EXPORTS),no) +CLEANFILES += def-videotest.lst +DEFSYMFILES += def-videotest.lst +endif +MOSTLYCLEANFILES += videotest_mod-commands_videotest.d +UNDSYMFILES += und-videotest.lst + +videotest.mod: pre-videotest.o mod-videotest.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-videotest.o mod-videotest.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-videotest.o: $(videotest_mod_DEPENDENCIES) videotest_mod-commands_videotest.o + -rm -f $@ + $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ videotest_mod-commands_videotest.o + +mod-videotest.o: mod-videotest.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $< + +mod-videotest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'videotest' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(videotest_mod_EXPORTS),no) +def-videotest.lst: pre-videotest.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 videotest/' > $@ +endif + +und-videotest.lst: pre-videotest.o + echo 'videotest' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +videotest_mod-commands_videotest.o: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -MD -c -o $@ $< +-include videotest_mod-commands_videotest.d + +CLEANFILES += cmd-videotest_mod-commands_videotest.lst fs-videotest_mod-commands_videotest.lst partmap-videotest_mod-commands_videotest.lst +COMMANDFILES += cmd-videotest_mod-commands_videotest.lst +FSFILES += fs-videotest_mod-commands_videotest.lst +PARTMAPFILES += partmap-videotest_mod-commands_videotest.lst + +cmd-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1) + +fs-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1) + +partmap-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh videotest > $@ || (rm -f $@; exit 1) + + +videotest_mod_CFLAGS = $(COMMON_CFLAGS) +videotest_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For bitmap.mod +bitmap_mod_SOURCES = video/bitmap.c +CLEANFILES += bitmap.mod mod-bitmap.o mod-bitmap.c pre-bitmap.o bitmap_mod-video_bitmap.o und-bitmap.lst +ifneq ($(bitmap_mod_EXPORTS),no) +CLEANFILES += def-bitmap.lst +DEFSYMFILES += def-bitmap.lst +endif +MOSTLYCLEANFILES += bitmap_mod-video_bitmap.d +UNDSYMFILES += und-bitmap.lst + +bitmap.mod: pre-bitmap.o mod-bitmap.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bitmap.o mod-bitmap.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-bitmap.o: $(bitmap_mod_DEPENDENCIES) bitmap_mod-video_bitmap.o + -rm -f $@ + $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bitmap_mod-video_bitmap.o + +mod-bitmap.o: mod-bitmap.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -c -o $@ $< + +mod-bitmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'bitmap' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(bitmap_mod_EXPORTS),no) +def-bitmap.lst: pre-bitmap.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 bitmap/' > $@ +endif + +und-bitmap.lst: pre-bitmap.o + echo 'bitmap' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +bitmap_mod-video_bitmap.o: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) + $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -MD -c -o $@ $< +-include bitmap_mod-video_bitmap.d + +CLEANFILES += cmd-bitmap_mod-video_bitmap.lst fs-bitmap_mod-video_bitmap.lst partmap-bitmap_mod-video_bitmap.lst +COMMANDFILES += cmd-bitmap_mod-video_bitmap.lst +FSFILES += fs-bitmap_mod-video_bitmap.lst +PARTMAPFILES += partmap-bitmap_mod-video_bitmap.lst + +cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bitmap > $@ || (rm -f $@; exit 1) + +fs-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bitmap > $@ || (rm -f $@; exit 1) + +partmap-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bitmap > $@ || (rm -f $@; exit 1) + + +bitmap_mod_CFLAGS = $(COMMON_CFLAGS) +bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For tga.mod +tga_mod_SOURCES = video/readers/tga.c +CLEANFILES += tga.mod mod-tga.o mod-tga.c pre-tga.o tga_mod-video_readers_tga.o und-tga.lst +ifneq ($(tga_mod_EXPORTS),no) +CLEANFILES += def-tga.lst +DEFSYMFILES += def-tga.lst +endif +MOSTLYCLEANFILES += tga_mod-video_readers_tga.d +UNDSYMFILES += und-tga.lst + +tga.mod: pre-tga.o mod-tga.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-tga.o mod-tga.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-tga.o: $(tga_mod_DEPENDENCIES) tga_mod-video_readers_tga.o + -rm -f $@ + $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ tga_mod-video_readers_tga.o + +mod-tga.o: mod-tga.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -c -o $@ $< + +mod-tga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'tga' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(tga_mod_EXPORTS),no) +def-tga.lst: pre-tga.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 tga/' > $@ +endif + +und-tga.lst: pre-tga.o + echo 'tga' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +tga_mod-video_readers_tga.o: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) + $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -MD -c -o $@ $< +-include tga_mod-video_readers_tga.d + +CLEANFILES += cmd-tga_mod-video_readers_tga.lst fs-tga_mod-video_readers_tga.lst partmap-tga_mod-video_readers_tga.lst +COMMANDFILES += cmd-tga_mod-video_readers_tga.lst +FSFILES += fs-tga_mod-video_readers_tga.lst +PARTMAPFILES += partmap-tga_mod-video_readers_tga.lst + +cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tga > $@ || (rm -f $@; exit 1) + +fs-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tga > $@ || (rm -f $@; exit 1) + +partmap-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tga > $@ || (rm -f $@; exit 1) + + +tga_mod_CFLAGS = $(COMMON_CFLAGS) +tga_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For jpeg.mod. +jpeg_mod_SOURCES = video/readers/jpeg.c +CLEANFILES += jpeg.mod mod-jpeg.o mod-jpeg.c pre-jpeg.o jpeg_mod-video_readers_jpeg.o und-jpeg.lst +ifneq ($(jpeg_mod_EXPORTS),no) +CLEANFILES += def-jpeg.lst +DEFSYMFILES += def-jpeg.lst +endif +MOSTLYCLEANFILES += jpeg_mod-video_readers_jpeg.d +UNDSYMFILES += und-jpeg.lst + +jpeg.mod: pre-jpeg.o mod-jpeg.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jpeg.o mod-jpeg.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-jpeg.o: $(jpeg_mod_DEPENDENCIES) jpeg_mod-video_readers_jpeg.o + -rm -f $@ + $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ jpeg_mod-video_readers_jpeg.o + +mod-jpeg.o: mod-jpeg.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -c -o $@ $< + +mod-jpeg.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'jpeg' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(jpeg_mod_EXPORTS),no) +def-jpeg.lst: pre-jpeg.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 jpeg/' > $@ +endif + +und-jpeg.lst: pre-jpeg.o + echo 'jpeg' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +jpeg_mod-video_readers_jpeg.o: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) + $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -MD -c -o $@ $< +-include jpeg_mod-video_readers_jpeg.d + +CLEANFILES += cmd-jpeg_mod-video_readers_jpeg.lst fs-jpeg_mod-video_readers_jpeg.lst partmap-jpeg_mod-video_readers_jpeg.lst +COMMANDFILES += cmd-jpeg_mod-video_readers_jpeg.lst +FSFILES += fs-jpeg_mod-video_readers_jpeg.lst +PARTMAPFILES += partmap-jpeg_mod-video_readers_jpeg.lst + +cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jpeg > $@ || (rm -f $@; exit 1) + +fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jpeg > $@ || (rm -f $@; exit 1) + +partmap-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jpeg > $@ || (rm -f $@; exit 1) + + +jpeg_mod_CFLAGS = $(COMMON_CFLAGS) +jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For png.mod. +png_mod_SOURCES = video/readers/png.c +CLEANFILES += png.mod mod-png.o mod-png.c pre-png.o png_mod-video_readers_png.o und-png.lst +ifneq ($(png_mod_EXPORTS),no) +CLEANFILES += def-png.lst +DEFSYMFILES += def-png.lst +endif +MOSTLYCLEANFILES += png_mod-video_readers_png.d +UNDSYMFILES += und-png.lst + +png.mod: pre-png.o mod-png.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-png.o mod-png.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-png.o: $(png_mod_DEPENDENCIES) png_mod-video_readers_png.o + -rm -f $@ + $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ png_mod-video_readers_png.o + +mod-png.o: mod-png.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -c -o $@ $< + +mod-png.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'png' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(png_mod_EXPORTS),no) +def-png.lst: pre-png.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 png/' > $@ +endif + +und-png.lst: pre-png.o + echo 'png' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +png_mod-video_readers_png.o: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) + $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -MD -c -o $@ $< +-include png_mod-video_readers_png.d + +CLEANFILES += cmd-png_mod-video_readers_png.lst fs-png_mod-video_readers_png.lst partmap-png_mod-video_readers_png.lst +COMMANDFILES += cmd-png_mod-video_readers_png.lst +FSFILES += fs-png_mod-video_readers_png.lst +PARTMAPFILES += partmap-png_mod-video_readers_png.lst + +cmd-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) + +fs-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) + +partmap-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh png > $@ || (rm -f $@; exit 1) + + +png_mod_CFLAGS = $(COMMON_CFLAGS) +png_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Misc. pkglib_MODULES += gzio.mod bufio.mod elf.mod diff --git a/conf/common.rmk b/conf/common.rmk index 78a7dc55e..4924f8a88 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -318,7 +318,7 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ - cmp.mod cat.mod help.mod font.mod search.mod \ + cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod @@ -363,11 +363,6 @@ help_mod_SOURCES = commands/help.c help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For font.mod. -font_mod_SOURCES = font/font_cmd.c font/font.c -font_mod_CFLAGS = $(COMMON_CFLAGS) -font_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For search.mod. search_mod_SOURCES = commands/search.c search_mod_CFLAGS = $(COMMON_CFLAGS) @@ -428,6 +423,50 @@ crc_mod_SOURCES = commands/crc.c lib/crc.c crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) +# Common Video Subsystem specific modules. +pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ + png.mod font.mod gfxterm.mod + +# For video.mod. +video_mod_SOURCES = video/video.c +video_mod_CFLAGS = $(COMMON_CFLAGS) +video_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For videotest.mod. +videotest_mod_SOURCES = commands/videotest.c +videotest_mod_CFLAGS = $(COMMON_CFLAGS) +videotest_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For bitmap.mod +bitmap_mod_SOURCES = video/bitmap.c +bitmap_mod_CFLAGS = $(COMMON_CFLAGS) +bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For tga.mod +tga_mod_SOURCES = video/readers/tga.c +tga_mod_CFLAGS = $(COMMON_CFLAGS) +tga_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For jpeg.mod. +jpeg_mod_SOURCES = video/readers/jpeg.c +jpeg_mod_CFLAGS = $(COMMON_CFLAGS) +jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For png.mod. +png_mod_SOURCES = video/readers/png.c +png_mod_CFLAGS = $(COMMON_CFLAGS) +png_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For font.mod. +font_mod_SOURCES = font/font_cmd.c font/font.c +font_mod_CFLAGS = $(COMMON_CFLAGS) +font_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For gfxterm.mod. +gfxterm_mod_SOURCES = term/gfxterm.c +gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) +gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Misc. pkglib_MODULES += gzio.mod bufio.mod elf.mod diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 7f8fb90e7..5297fa6b3 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -926,9 +926,8 @@ grub-mkrescue: util/i386/pc/grub-mkrescue.in $(util/i386/pc/grub-mkrescue.in_DEP # Modules. pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ - vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ - videotest.mod play.mod bitmap.mod tga.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ + vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ + ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod @@ -2177,291 +2176,6 @@ partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For video.mod. -video_mod_SOURCES = video/video.c -CLEANFILES += video.mod mod-video.o mod-video.c pre-video.o video_mod-video_video.o und-video.lst -ifneq ($(video_mod_EXPORTS),no) -CLEANFILES += def-video.lst -DEFSYMFILES += def-video.lst -endif -MOSTLYCLEANFILES += video_mod-video_video.d -UNDSYMFILES += und-video.lst - -video.mod: pre-video.o mod-video.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o - -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ video_mod-video_video.o - -mod-video.o: mod-video.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $< - -mod-video.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(video_mod_EXPORTS),no) -def-video.lst: pre-video.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 video/' > $@ -endif - -und-video.lst: pre-video.o - echo 'video' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -video_mod-video_video.o: video/video.c $(video/video.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -MD -c -o $@ $< --include video_mod-video_video.d - -CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst partmap-video_mod-video_video.lst -COMMANDFILES += cmd-video_mod-video_video.lst -FSFILES += fs-video_mod-video_video.lst -PARTMAPFILES += partmap-video_mod-video_video.lst - -cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) - -fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) - -partmap-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) - - -video_mod_CFLAGS = $(COMMON_CFLAGS) -video_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For gfxterm.mod. -gfxterm_mod_SOURCES = term/gfxterm.c -CLEANFILES += gfxterm.mod mod-gfxterm.o mod-gfxterm.c pre-gfxterm.o gfxterm_mod-term_gfxterm.o und-gfxterm.lst -ifneq ($(gfxterm_mod_EXPORTS),no) -CLEANFILES += def-gfxterm.lst -DEFSYMFILES += def-gfxterm.lst -endif -MOSTLYCLEANFILES += gfxterm_mod-term_gfxterm.d -UNDSYMFILES += und-gfxterm.lst - -gfxterm.mod: pre-gfxterm.o mod-gfxterm.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o - -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gfxterm_mod-term_gfxterm.o - -mod-gfxterm.o: mod-gfxterm.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $< - -mod-gfxterm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(gfxterm_mod_EXPORTS),no) -def-gfxterm.lst: pre-gfxterm.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gfxterm/' > $@ -endif - -und-gfxterm.lst: pre-gfxterm.o - echo 'gfxterm' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -gfxterm_mod-term_gfxterm.o: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) - $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -MD -c -o $@ $< --include gfxterm_mod-term_gfxterm.d - -CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst partmap-gfxterm_mod-term_gfxterm.lst -COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst -FSFILES += fs-gfxterm_mod-term_gfxterm.lst -PARTMAPFILES += partmap-gfxterm_mod-term_gfxterm.lst - -cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) - -fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) - -partmap-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) - - -gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) -gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For videotest.mod. -videotest_mod_SOURCES = commands/videotest.c -CLEANFILES += videotest.mod mod-videotest.o mod-videotest.c pre-videotest.o videotest_mod-commands_videotest.o und-videotest.lst -ifneq ($(videotest_mod_EXPORTS),no) -CLEANFILES += def-videotest.lst -DEFSYMFILES += def-videotest.lst -endif -MOSTLYCLEANFILES += videotest_mod-commands_videotest.d -UNDSYMFILES += und-videotest.lst - -videotest.mod: pre-videotest.o mod-videotest.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-videotest.o mod-videotest.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-videotest.o: $(videotest_mod_DEPENDENCIES) videotest_mod-commands_videotest.o - -rm -f $@ - $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ videotest_mod-commands_videotest.o - -mod-videotest.o: mod-videotest.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $< - -mod-videotest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'videotest' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(videotest_mod_EXPORTS),no) -def-videotest.lst: pre-videotest.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 videotest/' > $@ -endif - -und-videotest.lst: pre-videotest.o - echo 'videotest' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -videotest_mod-commands_videotest.o: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -MD -c -o $@ $< --include videotest_mod-commands_videotest.d - -CLEANFILES += cmd-videotest_mod-commands_videotest.lst fs-videotest_mod-commands_videotest.lst partmap-videotest_mod-commands_videotest.lst -COMMANDFILES += cmd-videotest_mod-commands_videotest.lst -FSFILES += fs-videotest_mod-commands_videotest.lst -PARTMAPFILES += partmap-videotest_mod-commands_videotest.lst - -cmd-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1) - -fs-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1) - -partmap-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh videotest > $@ || (rm -f $@; exit 1) - - -videotest_mod_CFLAGS = $(COMMON_CFLAGS) -videotest_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For bitmap.mod -bitmap_mod_SOURCES = video/bitmap.c -CLEANFILES += bitmap.mod mod-bitmap.o mod-bitmap.c pre-bitmap.o bitmap_mod-video_bitmap.o und-bitmap.lst -ifneq ($(bitmap_mod_EXPORTS),no) -CLEANFILES += def-bitmap.lst -DEFSYMFILES += def-bitmap.lst -endif -MOSTLYCLEANFILES += bitmap_mod-video_bitmap.d -UNDSYMFILES += und-bitmap.lst - -bitmap.mod: pre-bitmap.o mod-bitmap.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bitmap.o mod-bitmap.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-bitmap.o: $(bitmap_mod_DEPENDENCIES) bitmap_mod-video_bitmap.o - -rm -f $@ - $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bitmap_mod-video_bitmap.o - -mod-bitmap.o: mod-bitmap.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -c -o $@ $< - -mod-bitmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'bitmap' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(bitmap_mod_EXPORTS),no) -def-bitmap.lst: pre-bitmap.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 bitmap/' > $@ -endif - -und-bitmap.lst: pre-bitmap.o - echo 'bitmap' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -bitmap_mod-video_bitmap.o: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -MD -c -o $@ $< --include bitmap_mod-video_bitmap.d - -CLEANFILES += cmd-bitmap_mod-video_bitmap.lst fs-bitmap_mod-video_bitmap.lst partmap-bitmap_mod-video_bitmap.lst -COMMANDFILES += cmd-bitmap_mod-video_bitmap.lst -FSFILES += fs-bitmap_mod-video_bitmap.lst -PARTMAPFILES += partmap-bitmap_mod-video_bitmap.lst - -cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bitmap > $@ || (rm -f $@; exit 1) - -fs-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bitmap > $@ || (rm -f $@; exit 1) - -partmap-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bitmap > $@ || (rm -f $@; exit 1) - - -bitmap_mod_CFLAGS = $(COMMON_CFLAGS) -bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For tga.mod -tga_mod_SOURCES = video/readers/tga.c -CLEANFILES += tga.mod mod-tga.o mod-tga.c pre-tga.o tga_mod-video_readers_tga.o und-tga.lst -ifneq ($(tga_mod_EXPORTS),no) -CLEANFILES += def-tga.lst -DEFSYMFILES += def-tga.lst -endif -MOSTLYCLEANFILES += tga_mod-video_readers_tga.d -UNDSYMFILES += und-tga.lst - -tga.mod: pre-tga.o mod-tga.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-tga.o mod-tga.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-tga.o: $(tga_mod_DEPENDENCIES) tga_mod-video_readers_tga.o - -rm -f $@ - $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ tga_mod-video_readers_tga.o - -mod-tga.o: mod-tga.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -c -o $@ $< - -mod-tga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'tga' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(tga_mod_EXPORTS),no) -def-tga.lst: pre-tga.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 tga/' > $@ -endif - -und-tga.lst: pre-tga.o - echo 'tga' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -tga_mod-video_readers_tga.o: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -MD -c -o $@ $< --include tga_mod-video_readers_tga.d - -CLEANFILES += cmd-tga_mod-video_readers_tga.lst fs-tga_mod-video_readers_tga.lst partmap-tga_mod-video_readers_tga.lst -COMMANDFILES += cmd-tga_mod-video_readers_tga.lst -FSFILES += fs-tga_mod-video_readers_tga.lst -PARTMAPFILES += partmap-tga_mod-video_readers_tga.lst - -cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tga > $@ || (rm -f $@; exit 1) - -fs-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tga > $@ || (rm -f $@; exit 1) - -partmap-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tga > $@ || (rm -f $@; exit 1) - - -tga_mod_CFLAGS = $(COMMON_CFLAGS) -tga_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c CLEANFILES += ata.mod mod-ata.o mod-ata.c pre-ata.o ata_mod-disk_ata.o und-ata.lst @@ -2633,120 +2347,6 @@ partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCI memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For jpeg.mod. -jpeg_mod_SOURCES = video/readers/jpeg.c -CLEANFILES += jpeg.mod mod-jpeg.o mod-jpeg.c pre-jpeg.o jpeg_mod-video_readers_jpeg.o und-jpeg.lst -ifneq ($(jpeg_mod_EXPORTS),no) -CLEANFILES += def-jpeg.lst -DEFSYMFILES += def-jpeg.lst -endif -MOSTLYCLEANFILES += jpeg_mod-video_readers_jpeg.d -UNDSYMFILES += und-jpeg.lst - -jpeg.mod: pre-jpeg.o mod-jpeg.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jpeg.o mod-jpeg.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-jpeg.o: $(jpeg_mod_DEPENDENCIES) jpeg_mod-video_readers_jpeg.o - -rm -f $@ - $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ jpeg_mod-video_readers_jpeg.o - -mod-jpeg.o: mod-jpeg.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -c -o $@ $< - -mod-jpeg.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'jpeg' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(jpeg_mod_EXPORTS),no) -def-jpeg.lst: pre-jpeg.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 jpeg/' > $@ -endif - -und-jpeg.lst: pre-jpeg.o - echo 'jpeg' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -jpeg_mod-video_readers_jpeg.o: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -MD -c -o $@ $< --include jpeg_mod-video_readers_jpeg.d - -CLEANFILES += cmd-jpeg_mod-video_readers_jpeg.lst fs-jpeg_mod-video_readers_jpeg.lst partmap-jpeg_mod-video_readers_jpeg.lst -COMMANDFILES += cmd-jpeg_mod-video_readers_jpeg.lst -FSFILES += fs-jpeg_mod-video_readers_jpeg.lst -PARTMAPFILES += partmap-jpeg_mod-video_readers_jpeg.lst - -cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jpeg > $@ || (rm -f $@; exit 1) - -fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jpeg > $@ || (rm -f $@; exit 1) - -partmap-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jpeg > $@ || (rm -f $@; exit 1) - - -jpeg_mod_CFLAGS = $(COMMON_CFLAGS) -jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For png.mod. -png_mod_SOURCES = video/readers/png.c -CLEANFILES += png.mod mod-png.o mod-png.c pre-png.o png_mod-video_readers_png.o und-png.lst -ifneq ($(png_mod_EXPORTS),no) -CLEANFILES += def-png.lst -DEFSYMFILES += def-png.lst -endif -MOSTLYCLEANFILES += png_mod-video_readers_png.d -UNDSYMFILES += und-png.lst - -png.mod: pre-png.o mod-png.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-png.o mod-png.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-png.o: $(png_mod_DEPENDENCIES) png_mod-video_readers_png.o - -rm -f $@ - $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ png_mod-video_readers_png.o - -mod-png.o: mod-png.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -c -o $@ $< - -mod-png.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'png' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(png_mod_EXPORTS),no) -def-png.lst: pre-png.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 png/' > $@ -endif - -und-png.lst: pre-png.o - echo 'png' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -png_mod-video_readers_png.o: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -MD -c -o $@ $< --include png_mod-video_readers_png.d - -CLEANFILES += cmd-png_mod-video_readers_png.lst fs-png_mod-video_readers_png.lst partmap-png_mod-video_readers_png.lst -COMMANDFILES += cmd-png_mod-video_readers_png.lst -FSFILES += fs-png_mod-video_readers_png.lst -PARTMAPFILES += partmap-png_mod-video_readers_png.lst - -cmd-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) - -fs-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) - -partmap-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh png > $@ || (rm -f $@; exit 1) - - -png_mod_CFLAGS = $(COMMON_CFLAGS) -png_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For pci.mod pci_mod_SOURCES = bus/pci.c CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 81fa3f070..099825277 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -161,9 +161,8 @@ grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in # Modules. pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ - vbe.mod vbetest.mod vbeinfo.mod video.mod gfxterm.mod \ - videotest.mod play.mod bitmap.mod tga.mod serial.mod \ - ata.mod vga.mod memdisk.mod jpeg.mod png.mod pci.mod lspci.mod \ + vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ + ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod @@ -252,31 +251,6 @@ play_mod_SOURCES = commands/i386/pc/play.c play_mod_CFLAGS = $(COMMON_CFLAGS) play_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For video.mod. -video_mod_SOURCES = video/video.c -video_mod_CFLAGS = $(COMMON_CFLAGS) -video_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For gfxterm.mod. -gfxterm_mod_SOURCES = term/gfxterm.c -gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) -gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For videotest.mod. -videotest_mod_SOURCES = commands/videotest.c -videotest_mod_CFLAGS = $(COMMON_CFLAGS) -videotest_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For bitmap.mod -bitmap_mod_SOURCES = video/bitmap.c -bitmap_mod_CFLAGS = $(COMMON_CFLAGS) -bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For tga.mod -tga_mod_SOURCES = video/readers/tga.c -tga_mod_CFLAGS = $(COMMON_CFLAGS) -tga_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For ata.mod. ata_mod_SOURCES = disk/ata.c ata_mod_CFLAGS = $(COMMON_CFLAGS) @@ -292,16 +266,6 @@ memdisk_mod_SOURCES = disk/memdisk.c memdisk_mod_CFLAGS = $(COMMON_CFLAGS) memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For jpeg.mod. -jpeg_mod_SOURCES = video/readers/jpeg.c -jpeg_mod_CFLAGS = $(COMMON_CFLAGS) -jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For png.mod. -png_mod_SOURCES = video/readers/png.c -png_mod_CFLAGS = $(COMMON_CFLAGS) -png_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For pci.mod pci_mod_SOURCES = bus/pci.c pci_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/term/gfxterm.c b/term/gfxterm.c index 3e7fcd826..f3d59f01c 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -16,8 +16,6 @@ * along with GRUB. If not, see . */ -#include -#include #include #include #include From d098b090c7c201b8e702e214fa18dad42851627b Mon Sep 17 00:00:00 2001 From: chaac Date: Mon, 5 Jan 2009 23:14:32 +0000 Subject: [PATCH 0480/1707] Forgot to regenerate after last changes. --- conf/common.mk | 349 +++++++++++++++++++++++++------------------------ 1 file changed, 176 insertions(+), 173 deletions(-) diff --git a/conf/common.mk b/conf/common.mk index cec65c001..c8ea89dad 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -2341,11 +2341,10 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ - cmp.mod cat.mod help.mod video.mod font.mod search.mod \ + cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod gfxterm.mod \ - videotest.mod bitmap.mod tga.mod jpeg.mod png.mod + read.mod sleep.mod loadenv.mod crc.mod # For hello.mod. hello_mod_SOURCES = hello/hello.c @@ -2803,139 +2802,6 @@ partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCI help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For video.mod. -video_mod_SOURCES = video/video.c -CLEANFILES += video.mod mod-video.o mod-video.c pre-video.o video_mod-video_video.o und-video.lst -ifneq ($(video_mod_EXPORTS),no) -CLEANFILES += def-video.lst -DEFSYMFILES += def-video.lst -endif -MOSTLYCLEANFILES += video_mod-video_video.d -UNDSYMFILES += und-video.lst - -video.mod: pre-video.o mod-video.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o - -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ video_mod-video_video.o - -mod-video.o: mod-video.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $< - -mod-video.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(video_mod_EXPORTS),no) -def-video.lst: pre-video.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 video/' > $@ -endif - -und-video.lst: pre-video.o - echo 'video' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -video_mod-video_video.o: video/video.c $(video/video.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -MD -c -o $@ $< --include video_mod-video_video.d - -CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst partmap-video_mod-video_video.lst -COMMANDFILES += cmd-video_mod-video_video.lst -FSFILES += fs-video_mod-video_video.lst -PARTMAPFILES += partmap-video_mod-video_video.lst - -cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) - -fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) - -partmap-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) - - -video_mod_CFLAGS = $(COMMON_CFLAGS) -video_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For font.mod. -font_mod_SOURCES = font/font_cmd.c font/font.c -CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_font_cmd.o font_mod-font_font.o und-font.lst -ifneq ($(font_mod_EXPORTS),no) -CLEANFILES += def-font.lst -DEFSYMFILES += def-font.lst -endif -MOSTLYCLEANFILES += font_mod-font_font_cmd.d font_mod-font_font.d -UNDSYMFILES += und-font.lst - -font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_font_cmd.o font_mod-font_font.o - -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ font_mod-font_font_cmd.o font_mod-font_font.o - -mod-font.o: mod-font.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< - -mod-font.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(font_mod_EXPORTS),no) -def-font.lst: pre-font.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@ -endif - -und-font.lst: pre-font.o - echo 'font' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -font_mod-font_font_cmd.o: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) - $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< --include font_mod-font_font_cmd.d - -CLEANFILES += cmd-font_mod-font_font_cmd.lst fs-font_mod-font_font_cmd.lst partmap-font_mod-font_font_cmd.lst -COMMANDFILES += cmd-font_mod-font_font_cmd.lst -FSFILES += fs-font_mod-font_font_cmd.lst -PARTMAPFILES += partmap-font_mod-font_font_cmd.lst - -cmd-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) - -fs-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) - -partmap-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) - - -font_mod-font_font.o: font/font.c $(font/font.c_DEPENDENCIES) - $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< --include font_mod-font_font.d - -CLEANFILES += cmd-font_mod-font_font.lst fs-font_mod-font_font.lst partmap-font_mod-font_font.lst -COMMANDFILES += cmd-font_mod-font_font.lst -FSFILES += fs-font_mod-font_font.lst -PARTMAPFILES += partmap-font_mod-font_font.lst - -cmd-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) - -fs-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) - -partmap-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) - - -font_mod_CFLAGS = $(COMMON_CFLAGS) -font_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For search.mod. search_mod_SOURCES = commands/search.c CLEANFILES += search.mod mod-search.o mod-search.c pre-search.o search_mod-commands_search.o und-search.lst @@ -3696,62 +3562,66 @@ partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist. crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For gfxterm.mod. -gfxterm_mod_SOURCES = term/gfxterm.c -CLEANFILES += gfxterm.mod mod-gfxterm.o mod-gfxterm.c pre-gfxterm.o gfxterm_mod-term_gfxterm.o und-gfxterm.lst -ifneq ($(gfxterm_mod_EXPORTS),no) -CLEANFILES += def-gfxterm.lst -DEFSYMFILES += def-gfxterm.lst -endif -MOSTLYCLEANFILES += gfxterm_mod-term_gfxterm.d -UNDSYMFILES += und-gfxterm.lst +# Common Video Subsystem specific modules. +pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ + png.mod font.mod gfxterm.mod -gfxterm.mod: pre-gfxterm.o mod-gfxterm.o $(TARGET_OBJ2ELF) +# For video.mod. +video_mod_SOURCES = video/video.c +CLEANFILES += video.mod mod-video.o mod-video.c pre-video.o video_mod-video_video.o und-video.lst +ifneq ($(video_mod_EXPORTS),no) +CLEANFILES += def-video.lst +DEFSYMFILES += def-video.lst +endif +MOSTLYCLEANFILES += video_mod-video_video.d +UNDSYMFILES += und-video.lst + +video.mod: pre-video.o mod-video.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o + $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o +pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gfxterm_mod-term_gfxterm.o + $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ video_mod-video_video.o -mod-gfxterm.o: mod-gfxterm.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $< +mod-video.o: mod-video.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $< -mod-gfxterm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1) +mod-video.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1) -ifneq ($(gfxterm_mod_EXPORTS),no) -def-gfxterm.lst: pre-gfxterm.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gfxterm/' > $@ +ifneq ($(video_mod_EXPORTS),no) +def-video.lst: pre-video.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 video/' > $@ endif -und-gfxterm.lst: pre-gfxterm.o - echo 'gfxterm' > $@ +und-video.lst: pre-video.o + echo 'video' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -gfxterm_mod-term_gfxterm.o: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) - $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -MD -c -o $@ $< --include gfxterm_mod-term_gfxterm.d +video_mod-video_video.o: video/video.c $(video/video.c_DEPENDENCIES) + $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -MD -c -o $@ $< +-include video_mod-video_video.d -CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst partmap-gfxterm_mod-term_gfxterm.lst -COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst -FSFILES += fs-gfxterm_mod-term_gfxterm.lst -PARTMAPFILES += partmap-gfxterm_mod-term_gfxterm.lst +CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst partmap-video_mod-video_video.lst +COMMANDFILES += cmd-video_mod-video_video.lst +FSFILES += fs-video_mod-video_video.lst +PARTMAPFILES += partmap-video_mod-video_video.lst -cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) +cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) -fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) +fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) -partmap-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) +partmap-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) -gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) -gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) +video_mod_CFLAGS = $(COMMON_CFLAGS) +video_mod_LDFLAGS = $(COMMON_LDFLAGS) # For videotest.mod. videotest_mod_SOURCES = commands/videotest.c @@ -4038,6 +3908,139 @@ partmap-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c png_mod_CFLAGS = $(COMMON_CFLAGS) png_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For font.mod. +font_mod_SOURCES = font/font_cmd.c font/font.c +CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_font_cmd.o font_mod-font_font.o und-font.lst +ifneq ($(font_mod_EXPORTS),no) +CLEANFILES += def-font.lst +DEFSYMFILES += def-font.lst +endif +MOSTLYCLEANFILES += font_mod-font_font_cmd.d font_mod-font_font.d +UNDSYMFILES += und-font.lst + +font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_font_cmd.o font_mod-font_font.o + -rm -f $@ + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ font_mod-font_font_cmd.o font_mod-font_font.o + +mod-font.o: mod-font.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< + +mod-font.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(font_mod_EXPORTS),no) +def-font.lst: pre-font.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@ +endif + +und-font.lst: pre-font.o + echo 'font' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +font_mod-font_font_cmd.o: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) + $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< +-include font_mod-font_font_cmd.d + +CLEANFILES += cmd-font_mod-font_font_cmd.lst fs-font_mod-font_font_cmd.lst partmap-font_mod-font_font_cmd.lst +COMMANDFILES += cmd-font_mod-font_font_cmd.lst +FSFILES += fs-font_mod-font_font_cmd.lst +PARTMAPFILES += partmap-font_mod-font_font_cmd.lst + +cmd-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) + +fs-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) + +partmap-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + + +font_mod-font_font.o: font/font.c $(font/font.c_DEPENDENCIES) + $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< +-include font_mod-font_font.d + +CLEANFILES += cmd-font_mod-font_font.lst fs-font_mod-font_font.lst partmap-font_mod-font_font.lst +COMMANDFILES += cmd-font_mod-font_font.lst +FSFILES += fs-font_mod-font_font.lst +PARTMAPFILES += partmap-font_mod-font_font.lst + +cmd-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) + +fs-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) + +partmap-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + + +font_mod_CFLAGS = $(COMMON_CFLAGS) +font_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For gfxterm.mod. +gfxterm_mod_SOURCES = term/gfxterm.c +CLEANFILES += gfxterm.mod mod-gfxterm.o mod-gfxterm.c pre-gfxterm.o gfxterm_mod-term_gfxterm.o und-gfxterm.lst +ifneq ($(gfxterm_mod_EXPORTS),no) +CLEANFILES += def-gfxterm.lst +DEFSYMFILES += def-gfxterm.lst +endif +MOSTLYCLEANFILES += gfxterm_mod-term_gfxterm.d +UNDSYMFILES += und-gfxterm.lst + +gfxterm.mod: pre-gfxterm.o mod-gfxterm.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o + -rm -f $@ + $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gfxterm_mod-term_gfxterm.o + +mod-gfxterm.o: mod-gfxterm.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $< + +mod-gfxterm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(gfxterm_mod_EXPORTS),no) +def-gfxterm.lst: pre-gfxterm.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gfxterm/' > $@ +endif + +und-gfxterm.lst: pre-gfxterm.o + echo 'gfxterm' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +gfxterm_mod-term_gfxterm.o: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) + $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -MD -c -o $@ $< +-include gfxterm_mod-term_gfxterm.d + +CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst partmap-gfxterm_mod-term_gfxterm.lst +COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst +FSFILES += fs-gfxterm_mod-term_gfxterm.lst +PARTMAPFILES += partmap-gfxterm_mod-term_gfxterm.lst + +cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) + +fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) + +partmap-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) + + +gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) +gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Misc. pkglib_MODULES += gzio.mod bufio.mod elf.mod From f36cc10867b2a8948acceea88004854abee6c499 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 10 Jan 2009 13:07:44 +0000 Subject: [PATCH 0481/1707] 2009-01-10 Robert Millan Update a few copyright years which we forgot to do in 2008 (only for files whose changes made in 2008 were copyright-significant) * Makefile.in: Add 2008 to Copyright line. * disk/ieee1275/ofdisk.c: Likewise. * disk/efi/efidisk.c: Likewise. * kern/dl.c: Likewise. * kern/sparc64/ieee1275/init.c: Likewise. * kern/mm.c: Likewise. * kern/efi/mm.c: Likewise. * boot/i386/pc/boot.S: Likewise. * genfslist.sh: Likewise. * fs/iso9660.c: Likewise. * fs/hfs.c: Likewise. * fs/jfs.c: Likewise. * fs/minix.c: Likewise. * fs/ufs.c: Likewise. * gensymlist.sh.in: Likewise. * genkernsyms.sh.in: Likewise. * include/grub/misc.h: Likewise. * include/grub/types.h: Likewise. * include/grub/symbol.h: Likewise. * include/grub/elf.h: Likewise. * include/grub/kernel.h: Likewise. * include/grub/disk.h: Likewise. * include/grub/dl.h: Likewise. * include/grub/i386/linux.h: Likewise. * include/grub/i386/pc/biosdisk.h: Likewise. * include/grub/efi/api.h: Likewise. * include/grub/efi/pe32.h: Likewise. * include/grub/util/misc.h: Likewise. * normal/execute.c: Likewise. * normal/arg.c: Likewise. * normal/completion.c: Likewise. * normal/lexer.c: Likewise. * normal/parser.y: Likewise. * normal/misc.c: Likewise. * commands/i386/pc/vbeinfo.c: Likewise. * commands/hexdump.c: Likewise. * commands/terminal.c: Likewise. * commands/ls.c: Likewise. * commands/help.c: Likewise. * partmap/pc.c: Likewise. * loader/efi/chainloader.c: Likewise. * loader/multiboot_loader.c: Likewise. * loader/i386/pc/multiboot2.c: Likewise. * term/efi/console.c: Likewise. * term/i386/pc/serial.c: Likewise. * util/lvm.c: Likewise. * util/console.c: Likewise. * util/i386/efi/grub-mkimage.c: Likewise. * util/raid.c: Likewise. --- ChangeLog | 55 +++++++++++++++++++++++++++++++++ Makefile.in | 2 +- boot/i386/pc/boot.S | 2 +- commands/help.c | 2 +- commands/hexdump.c | 2 +- commands/i386/pc/vbeinfo.c | 2 +- commands/ls.c | 2 +- commands/terminal.c | 2 +- disk/efi/efidisk.c | 2 +- disk/ieee1275/ofdisk.c | 2 +- fs/hfs.c | 2 +- fs/iso9660.c | 2 +- fs/jfs.c | 2 +- fs/minix.c | 2 +- fs/ufs.c | 2 +- genfslist.sh | 2 +- genkernsyms.sh.in | 2 +- gensymlist.sh.in | 4 +-- include/grub/disk.h | 2 +- include/grub/dl.h | 2 +- include/grub/efi/api.h | 2 +- include/grub/efi/pe32.h | 2 +- include/grub/elf.h | 2 +- include/grub/i386/linux.h | 2 +- include/grub/i386/pc/biosdisk.h | 2 +- include/grub/kernel.h | 2 +- include/grub/misc.h | 2 +- include/grub/symbol.h | 2 +- include/grub/types.h | 2 +- include/grub/util/misc.h | 2 +- kern/dl.c | 2 +- kern/efi/mm.c | 2 +- kern/mm.c | 2 +- kern/sparc64/ieee1275/init.c | 2 +- loader/efi/chainloader.c | 2 +- loader/i386/pc/multiboot2.c | 2 +- loader/multiboot_loader.c | 2 +- normal/arg.c | 2 +- normal/completion.c | 2 +- normal/execute.c | 2 +- normal/lexer.c | 2 +- normal/misc.c | 2 +- normal/parser.y | 2 +- partmap/pc.c | 2 +- term/efi/console.c | 2 +- term/i386/pc/serial.c | 2 +- util/console.c | 2 +- util/i386/efi/grub-mkimage.c | 2 +- util/lvm.c | 2 +- util/raid.c | 2 +- 50 files changed, 105 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4c62de3b..d3329536c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,58 @@ +2009-01-10 Robert Millan + + Update a few copyright years which we forgot to do in 2008 (only for + files whose changes made in 2008 were copyright-significant) + + * Makefile.in: Add 2008 to Copyright line. + * disk/ieee1275/ofdisk.c: Likewise. + * disk/efi/efidisk.c: Likewise. + * kern/dl.c: Likewise. + * kern/sparc64/ieee1275/init.c: Likewise. + * kern/mm.c: Likewise. + * kern/efi/mm.c: Likewise. + * boot/i386/pc/boot.S: Likewise. + * genfslist.sh: Likewise. + * fs/iso9660.c: Likewise. + * fs/hfs.c: Likewise. + * fs/jfs.c: Likewise. + * fs/minix.c: Likewise. + * fs/ufs.c: Likewise. + * gensymlist.sh.in: Likewise. + * genkernsyms.sh.in: Likewise. + * include/grub/misc.h: Likewise. + * include/grub/types.h: Likewise. + * include/grub/symbol.h: Likewise. + * include/grub/elf.h: Likewise. + * include/grub/kernel.h: Likewise. + * include/grub/disk.h: Likewise. + * include/grub/dl.h: Likewise. + * include/grub/i386/linux.h: Likewise. + * include/grub/i386/pc/biosdisk.h: Likewise. + * include/grub/efi/api.h: Likewise. + * include/grub/efi/pe32.h: Likewise. + * include/grub/util/misc.h: Likewise. + * normal/execute.c: Likewise. + * normal/arg.c: Likewise. + * normal/completion.c: Likewise. + * normal/lexer.c: Likewise. + * normal/parser.y: Likewise. + * normal/misc.c: Likewise. + * commands/i386/pc/vbeinfo.c: Likewise. + * commands/hexdump.c: Likewise. + * commands/terminal.c: Likewise. + * commands/ls.c: Likewise. + * commands/help.c: Likewise. + * partmap/pc.c: Likewise. + * loader/efi/chainloader.c: Likewise. + * loader/multiboot_loader.c: Likewise. + * loader/i386/pc/multiboot2.c: Likewise. + * term/efi/console.c: Likewise. + * term/i386/pc/serial.c: Likewise. + * util/lvm.c: Likewise. + * util/console.c: Likewise. + * util/i386/efi/grub-mkimage.c: Likewise. + * util/raid.c: Likewise. + 2009-01-06 Vesa Jääskeläinen * commands/videotest.c: Removed include to grub/machine/memory.h. diff --git a/Makefile.in b/Makefile.in index 8cc0f1afc..dbc4588ad 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # -*- makefile -*- # -# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. +# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2008 Free Software Foundation, Inc. # # This Makefile.in is free software; the author # gives unlimited permission to copy and/or distribute it, diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 64d40c8fb..805673121 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -1,7 +1,7 @@ /* -*-Asm-*- */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/commands/help.c b/commands/help.c index 7f9ef6ab7..3e78cb9c9 100644 --- a/commands/help.c +++ b/commands/help.c @@ -1,7 +1,7 @@ /* help.c - command to show a help text. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/commands/hexdump.c b/commands/hexdump.c index 5c0ddc08e..10b63201a 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -1,7 +1,7 @@ /* hexdump.c - command to dump the contents of a file or memory */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. + * Copyright (C) 2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/commands/i386/pc/vbeinfo.c b/commands/i386/pc/vbeinfo.c index 305e69958..237ecdd44 100644 --- a/commands/i386/pc/vbeinfo.c +++ b/commands/i386/pc/vbeinfo.c @@ -1,7 +1,7 @@ /* vbeinfo.c - command to list compatible VBE video modes. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/commands/ls.c b/commands/ls.c index 4257e026f..7f5a60930 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -1,7 +1,7 @@ /* ls.c - command to list files and devices */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/commands/terminal.c b/commands/terminal.c index fa7364456..98e6d1132 100644 --- a/commands/terminal.c +++ b/commands/terminal.c @@ -1,7 +1,7 @@ /* terminal.c - command to show and select a terminal */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/disk/efi/efidisk.c b/disk/efi/efidisk.c index d2f5ea202..767ebf8ce 100644 --- a/disk/efi/efidisk.c +++ b/disk/efi/efidisk.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index 431ed96d5..fec56beab 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -1,7 +1,7 @@ /* ofdisk.c - Open Firmware disk access. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/hfs.c b/fs/hfs.c index 43f82eeeb..b01c42e81 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -1,7 +1,7 @@ /* hfs.c - HFS. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/iso9660.c b/fs/iso9660.c index af5f62450..6db228359 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -2,7 +2,7 @@ SUSP, Rock Ridge. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/jfs.c b/fs/jfs.c index a4907ff55..fc9dab8f6 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -1,7 +1,7 @@ /* jfs.c - JFS. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/minix.c b/fs/minix.c index aa8ffb17d..cc03d7d82 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -1,7 +1,7 @@ /* minix.c - The minix filesystem, version 1 and 2. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/fs/ufs.c b/fs/ufs.c index ebb719878..1f333b0c8 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -1,7 +1,7 @@ /* ufs.c - Unix File System */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2007,2008 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by diff --git a/genfslist.sh b/genfslist.sh index ec48e86ed..6fa7e927d 100644 --- a/genfslist.sh +++ b/genfslist.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2005 Free Software Foundation, Inc. +# Copyright (C) 2005,2008 Free Software Foundation, Inc. # # This gensymlist.sh is free software; the author # gives unlimited permission to copy and/or distribute it, diff --git a/genkernsyms.sh.in b/genkernsyms.sh.in index 0df0bbfe9..3dec5828d 100644 --- a/genkernsyms.sh.in +++ b/genkernsyms.sh.in @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2002,2006 Free Software Foundation, Inc. +# Copyright (C) 2002,2006,2008 Free Software Foundation, Inc. # # This gensymlist.sh is free software; the author # gives unlimited permission to copy and/or distribute it, diff --git a/gensymlist.sh.in b/gensymlist.sh.in index d8b987157..8f50b99ea 100644 --- a/gensymlist.sh.in +++ b/gensymlist.sh.in @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2002,2006,2007 Free Software Foundation, Inc. +# Copyright (C) 2002,2006,2007,2008 Free Software Foundation, Inc. # # This gensymlist.sh.in is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -21,7 +21,7 @@ cat < Date: Mon, 12 Jan 2009 20:23:13 +0000 Subject: [PATCH 0482/1707] 2009-01-12 Christian Franke * disk/ata.c (grub_ata_pciinit): Fix bit numbers of compatibility mode check. Fix setting of compat_use[]. --- ChangeLog | 5 +++++ disk/ata.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d3329536c..b77f4385c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-12 Christian Franke + + * disk/ata.c (grub_ata_pciinit): Fix bit numbers of compatibility + mode check. Fix setting of compat_use[]. + 2009-01-10 Robert Millan Update a few copyright years which we forgot to do in 2008 (only for diff --git a/disk/ata.c b/disk/ata.c index 6e0b8b805..4ca63c233 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -504,7 +504,7 @@ grub_ata_pciinit (int bus, int device, int func, for (i = 0; i < 2; i++) { /* Set to 0 when the channel operated in compatibility mode. */ - int compat = (class >> (2 * i)) & 1; + int compat = (class >> (8 + 2 * i)) & 1; rega = 0; regb = 0; @@ -515,7 +515,7 @@ grub_ata_pciinit (int bus, int device, int func, { rega = grub_ata_ioaddress[i]; regb = grub_ata_ioaddress2[i]; - compat_use[i] = 0; + compat_use[i] = 1; } else if (compat) { From e52db1f72288877c956905bc278fdf847b7f235e Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 13 Jan 2009 16:34:26 +0000 Subject: [PATCH 0483/1707] 2009-01-13 Bean * Makefile.in: (enable_grub_mkfont): New variable. (freetype_cflags): Likewise. (freetype_libs): Likewise. * common.rmk (bin_UTILITIES): Add `grub-mkfont' if requested. (grub_mkfont_SOURCES): New variable. (grub_mkfont_CFLAGS): Likewise. (grub_mkfont_LDFLAGS): Likewise. * configure.ac (--enable-grub-mkfont): New option. Check for freetype2 library if `--enable-grub-mkfont' is requested. (enable_grub_mkfont): New variable. (freetype_cflags): Likewise. (freetype_libs): Likewise. * util/grub-mkfont.c: New file. --- ChangeLog | 19 ++ DISTLIST | 1 + Makefile.in | 3 + conf/common.mk | 22 ++ conf/common.rmk | 8 + configure | 72 +++++- configure.ac | 16 ++ util/grub-mkfont.c | 625 +++++++++++++++++++++++++++++++++++++++++++++ 8 files changed, 765 insertions(+), 1 deletion(-) create mode 100644 util/grub-mkfont.c diff --git a/ChangeLog b/ChangeLog index b77f4385c..afb2fbb57 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2009-01-13 Bean + + * Makefile.in: (enable_grub_mkfont): New variable. + (freetype_cflags): Likewise. + (freetype_libs): Likewise. + + * common.rmk (bin_UTILITIES): Add `grub-mkfont' if requested. + (grub_mkfont_SOURCES): New variable. + (grub_mkfont_CFLAGS): Likewise. + (grub_mkfont_LDFLAGS): Likewise. + + * configure.ac (--enable-grub-mkfont): New option. Check for freetype2 + library if `--enable-grub-mkfont' is requested. + (enable_grub_mkfont): New variable. + (freetype_cflags): Likewise. + (freetype_libs): Likewise. + + * util/grub-mkfont.c: New file. + 2009-01-12 Christian Franke * disk/ata.c (grub_ata_pciinit): Fix bit numbers of compatibility diff --git a/DISTLIST b/DISTLIST index 22be10bce..521aec475 100644 --- a/DISTLIST +++ b/DISTLIST @@ -424,6 +424,7 @@ util/grub-fstest.c util/grub-mkconfig.in util/grub-mkconfig_lib.in util/grub-mkdevicemap.c +util/grub-mkfont.c util/grub-pe2elf.c util/grub-probe.c util/hostdisk.c diff --git a/Makefile.in b/Makefile.in index dbc4588ad..42439d9ad 100644 --- a/Makefile.in +++ b/Makefile.in @@ -95,6 +95,9 @@ enable_grub_emu = @enable_grub_emu@ enable_grub_fstest = @enable_grub_fstest@ enable_grub_pe2elf = @enable_grub_pe2elf@ enable_lzo = @enable_lzo@ +enable_grub_mkfont = @enable_grub_mkfont@ +freetype_cflags = @freetype_cflags@ +freetype_libs = @freetype_libs@ ### General variables. diff --git a/conf/common.mk b/conf/common.mk index c8ea89dad..d6ecb374a 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -416,6 +416,28 @@ grub_fstest-grub_fstest_init.o: grub_fstest_init.c $(grub_fstest_init.c_DEPENDEN -include grub_fstest-grub_fstest_init.d +# For grub-mkfont. +ifeq ($(enable_grub_mkfont), yes) +bin_UTILITIES += grub-mkfont +grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c +CLEANFILES += grub-mkfont$(EXEEXT) grub_mkfont-util_grub_mkfont.o grub_mkfont-util_misc.o +MOSTLYCLEANFILES += grub_mkfont-util_grub_mkfont.d grub_mkfont-util_misc.d + +grub-mkfont: $(grub_mkfont_DEPENDENCIES) grub_mkfont-util_grub_mkfont.o grub_mkfont-util_misc.o + $(CC) -o $@ grub_mkfont-util_grub_mkfont.o grub_mkfont-util_misc.o $(LDFLAGS) $(grub_mkfont_LDFLAGS) + +grub_mkfont-util_grub_mkfont.o: util/grub-mkfont.c $(util/grub-mkfont.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkfont_CFLAGS) -MD -c -o $@ $< +-include grub_mkfont-util_grub_mkfont.d + +grub_mkfont-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkfont_CFLAGS) -MD -c -o $@ $< +-include grub_mkfont-util_misc.d + +grub_mkfont_CFLAGS = $(freetype_cflags) +grub_mkfont_LDFLAGS = $(freetype_libs) +endif + # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y diff --git a/conf/common.rmk b/conf/common.rmk index 4924f8a88..560d47764 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -45,6 +45,14 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c \ grub_fstest_init.c +# For grub-mkfont. +ifeq ($(enable_grub_mkfont), yes) +bin_UTILITIES += grub-mkfont +grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c +grub_mkfont_CFLAGS = $(freetype_cflags) +grub_mkfont_LDFLAGS = $(freetype_libs) +endif + # For the parser. grub_script.tab.c grub_script.tab.h: normal/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y diff --git a/configure b/configure index f1639999c..de8ef269f 100644 --- a/configure +++ b/configure @@ -703,6 +703,10 @@ LIBCURSES enable_grub_emu enable_grub_fstest enable_grub_pe2elf +FREETYPE +enable_grub_mkfont +freetype_cflags +freetype_libs LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -1303,6 +1307,7 @@ Optional Features: utility --enable-grub-pe2elf build and install the `grub-pe2elf' conversion utility + --enable-grub-mkfont build and install the `grub-mkfont' utility Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] @@ -8425,6 +8430,67 @@ fi +# Check whether --enable-grub-mkfont was given. +if test "${enable_grub_mkfont+set}" = set; then + enableval=$enable_grub_mkfont; +fi + +if test x"$enable_grub_mkfont" = xyes ; then + # Check for freetype libraries. + for ac_prog in freetype-config +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +if test "${ac_cv_prog_FREETYPE+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$FREETYPE"; then + ac_cv_prog_FREETYPE="$FREETYPE" # Let the user override the test. +else +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +for as_dir in $PATH +do + IFS=$as_save_IFS + test -z "$as_dir" && as_dir=. + for ac_exec_ext in '' $ac_executable_extensions; do + if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + ac_cv_prog_FREETYPE="$ac_prog" + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + break 2 + fi +done +done +IFS=$as_save_IFS + +fi +fi +FREETYPE=$ac_cv_prog_FREETYPE +if test -n "$FREETYPE"; then + { echo "$as_me:$LINENO: result: $FREETYPE" >&5 +echo "${ECHO_T}$FREETYPE" >&6; } +else + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi + + + test -n "$FREETYPE" && break +done + + if test "x$FREETYPE" = x ; then + { { echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 +echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} + { (exit 1); exit 1; }; } + fi + freetype_cflags=`freetype-config --cflags` + freetype_libs=`freetype-config --libs` +fi + + + + # Output files. ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" @@ -9146,11 +9212,15 @@ LIBCURSES!$LIBCURSES$ac_delim enable_grub_emu!$enable_grub_emu$ac_delim enable_grub_fstest!$enable_grub_fstest$ac_delim enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim +FREETYPE!$FREETYPE$ac_delim +enable_grub_mkfont!$enable_grub_mkfont$ac_delim +freetype_cflags!$freetype_cflags$ac_delim +freetype_libs!$freetype_libs$ac_delim LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 90; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index ad6429ff0..8caaa0697 100644 --- a/configure.ac +++ b/configure.ac @@ -407,6 +407,22 @@ AC_ARG_ENABLE([grub-pe2elf], [build and install the `grub-pe2elf' conversion utility])]) AC_SUBST([enable_grub_pe2elf]) +AC_ARG_ENABLE([grub-mkfont], + [AS_HELP_STRING([--enable-grub-mkfont], + [build and install the `grub-mkfont' utility])]) +if test x"$enable_grub_mkfont" = xyes ; then + # Check for freetype libraries. + AC_CHECK_PROGS([FREETYPE], [freetype-config]) + if test "x$FREETYPE" = x ; then + AC_MSG_ERROR([freetype2 libraries are required to build `grub-mkfont']) + fi + freetype_cflags=`freetype-config --cflags` + freetype_libs=`freetype-config --libs` +fi +AC_SUBST([enable_grub_mkfont]) +AC_SUBST([freetype_cflags]) +AC_SUBST([freetype_libs]) + # Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform]) diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c new file mode 100644 index 000000000..58ec46960 --- /dev/null +++ b/util/grub-mkfont.c @@ -0,0 +1,625 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +#include +#include +#include +#include + +#include +#include FT_FREETYPE_H +#include + +#define GRUB_FONT_DEFAULT_SIZE 16 + +#define GRUB_FONT_RANGE_BLOCK 1024 + +struct grub_glyph_info +{ + struct grub_glyph_info *next; + grub_uint32_t char_code; + int width; + int height; + int x_ofs; + int y_ofs; + int device_width; + int bitmap_size; + grub_uint8_t bitmap[0]; +}; + +#define GRUB_FONT_FLAG_BOLD 1 +#define GRUB_FONT_FLAG_NOBITMAP 2 +#define GRUB_FONT_FLAG_NOHINTING 4 +#define GRUB_FONT_FLAG_FORCEHINT 8 + +struct grub_font_info +{ + char* name; + int style; + int desc; + int size; + int max_width; + int max_height; + int min_y; + int flags; + int num_range; + grub_uint32_t *ranges; + struct grub_glyph_info *glyph; +}; + +static struct option options[] = +{ + {"output", required_argument, 0, 'o'}, + {"name", required_argument, 0, 'n'}, + {"index", required_argument, 0, 'i'}, + {"range", required_argument, 0, 'r'}, + {"size", required_argument, 0, 's'}, + {"desc", required_argument, 0, 'd'}, + {"bold", no_argument, 0, 'b'}, + {"no-bitmap", no_argument, 0, 0x100}, + {"no-hinting", no_argument, 0, 0x101}, + {"force-autohint", no_argument, 0, 'a'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"verbose", no_argument, 0, 'v'}, + {0, 0, 0, 0} +}; + +int font_verbosity; + +static void +usage (int status) +{ + if (status) + fprintf (stderr, "Try ``grub-mkfont --help'' for more information.\n"); + else + printf ("\ +Usage: grub-mkfont [OPTIONS] FONT_FILES\n\ +\nOptions:\n\ + -o, --output=FILE_NAME set output file name\n\ + -i, --index=N set face index\n\ + -r, --range=A-B[,C-D] set font range\n\ + -n, --name=S set font family name\n\ + -s, --size=N set font size\n\ + -d, --desc=N set font descent\n\ + -b, --bold convert to bold font\n\ + -a, --force-autohine force autohint\n\ + --no-hinting disable hinting\n\ + --no-bitmap ignore bitmap strikes when loading\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ +\n\ +Report bugs to <%s>.\n", PACKAGE_BUGREPORT); + + exit (status); +} + +void +add_pixel (grub_uint8_t **data, int *mask, int not_blank) +{ + if (*mask == 0) + { + (*data)++; + **data = 0; + *mask = 128; + } + + if (not_blank) + **data |= *mask; + + *mask >>= 1; +} + +void +add_char (struct grub_font_info *font_info, FT_Face face, + grub_uint32_t char_code) +{ + struct grub_glyph_info *glyph_info, **p_glyph; + int width, height; + grub_uint8_t *data; + int mask, i, j, bitmap_size; + FT_GlyphSlot glyph; + int flag = FT_LOAD_RENDER | FT_LOAD_MONOCHROME; + + if (font_info->flags & GRUB_FONT_FLAG_NOBITMAP) + flag |= FT_LOAD_NO_BITMAP; + + if (font_info->flags & GRUB_FONT_FLAG_NOHINTING) + flag |= FT_LOAD_NO_HINTING; + else if (font_info->flags & GRUB_FONT_FLAG_FORCEHINT) + flag |= FT_LOAD_FORCE_AUTOHINT; + + if (FT_Load_Char (face, char_code, flag)) + return; + + glyph = face->glyph; + + if (font_info->flags & GRUB_FONT_FLAG_BOLD) + FT_GlyphSlot_Embolden (glyph); + + p_glyph = &font_info->glyph; + while ((*p_glyph) && ((*p_glyph)->char_code > char_code)) + { + p_glyph = &(*p_glyph)->next; + } + + /* Ignore duplicated glyph. */ + if ((*p_glyph) && ((*p_glyph)->char_code == char_code)) + return; + + width = glyph->bitmap.width; + height = glyph->bitmap.rows; + + bitmap_size = ((width * height + 7) / 8); + glyph_info = xmalloc (sizeof (struct grub_glyph_info) + bitmap_size); + glyph_info->bitmap_size = bitmap_size; + + glyph_info->next = *p_glyph; + *p_glyph = glyph_info; + + glyph_info->char_code = char_code; + glyph_info->width = width; + glyph_info->height = height; + glyph_info->x_ofs = glyph->bitmap_left; + glyph_info->y_ofs = glyph->bitmap_top - height; + glyph_info->device_width = glyph->metrics.horiAdvance / 64; + + if (width > font_info->max_width) + font_info->max_width = width; + + if (height > font_info->max_height) + font_info->max_height = height; + + if (glyph_info->y_ofs < font_info->min_y) + font_info->min_y = glyph_info->y_ofs; + + mask = 0; + data = &glyph_info->bitmap[0] - 1; + for (j = 0; j < height; j++) + for (i = 0; i < width; i++) + add_pixel (&data, &mask, + glyph->bitmap.buffer[i / 8 + j * glyph->bitmap.pitch] & + (1 << (7 - (i & 7)))); +} + +void +add_font (struct grub_font_info *font_info, FT_Face face) +{ + if (font_info->num_range) + { + int i; + grub_uint32_t j; + + for (i = 0; i < font_info->num_range; i++) + for (j = font_info->ranges[i * 2]; j <= font_info->ranges[i * 2 + 1]; + j++) + add_char (font_info, face, j); + } + else + { + grub_uint32_t char_code, glyph_index; + + for (char_code = FT_Get_First_Char (face, &glyph_index); + glyph_index; + char_code = FT_Get_Next_Char (face, char_code, &glyph_index)) + add_char (font_info, face, char_code); + } +} + +void +write_string_section (char *name, char *str, int* offset, FILE* file) +{ + grub_uint32_t leng, leng_be32; + + leng = strlen (str) + 1; + leng_be32 = grub_cpu_to_be32 (leng); + + grub_util_write_image (name, 4, file); + grub_util_write_image ((char *) &leng_be32, 4, file); + grub_util_write_image (str, leng, file); + + *offset += 8 + leng; +} + +void +write_be16_section (char *name, grub_uint16_t data, int* offset, FILE* file) +{ + grub_uint32_t leng; + + leng = grub_cpu_to_be32 (2); + data = grub_cpu_to_be16 (data); + grub_util_write_image (name, 4, file); + grub_util_write_image ((char *) &leng, 4, file); + grub_util_write_image ((char *) &data, 2, file); + + *offset += 10; +} + +void +print_glyphs (struct grub_font_info *font_info) +{ + int num; + struct grub_glyph_info *glyph; + char line[512]; + + for (glyph = font_info->glyph, num = 0; glyph; glyph = glyph->next, num++) + { + int x, y, xmax, xmin, ymax, ymin; + grub_uint8_t *bitmap, mask; + + printf ("\nGlyph #%d, U+%04x\n", num, glyph->char_code); + printf ("Width %d, Height %d, X offset %d, Y offset %d, Device width %d\n", + glyph->width, glyph->height, glyph->x_ofs, glyph->y_ofs, + glyph->device_width); + + xmax = glyph->x_ofs + glyph->width; + if (xmax < glyph->device_width) + xmax = glyph->device_width; + + xmin = glyph->x_ofs; + if (xmin > 0) + xmin = 0; + + ymax = glyph->y_ofs + glyph->height; + if (ymax < font_info->size - font_info->desc) + ymax = font_info->size - font_info->desc; + + ymin = glyph->y_ofs; + if (ymin > - font_info->desc) + ymin = - font_info->desc; + + bitmap = glyph->bitmap; + mask = 0x80; + for (y = ymax - 1; y >= ymin; y--) + { + int line_pos; + + line_pos = 0; + for (x = xmin; x < xmax; x++) + { + if ((x >= glyph->x_ofs) && + (x < glyph->x_ofs + glyph->width) && + (y >= glyph->y_ofs) && + (y < glyph->y_ofs + glyph->height)) + { + line[line_pos++] = (*bitmap & mask) ? '#' : '_'; + mask >>= 1; + if (mask == 0) + { + mask = 0x80; + bitmap++; + } + } + else if ((x >= 0) && + (x < glyph->device_width) && + (y >= - font_info->desc) && + (y < font_info->size - font_info->desc)) + { + line[line_pos++] = ((x == 0) || (y == 0)) ? '+' : '.'; + } + else + line[line_pos++] = '*'; + } + line[line_pos] = 0; + printf ("%s\n", line); + } + } +} + +void +write_font (struct grub_font_info *font_info, char *output_file) +{ + FILE *file; + grub_uint32_t leng, data; + char style_name[20], *font_name; + struct grub_glyph_info *cur, *pre; + int num, offset; + + file = fopen (output_file, "wb"); + if (! file) + grub_util_error ("Can\'t write to file %s.", output_file); + + offset = 0; + + leng = grub_cpu_to_be32 (4); + grub_util_write_image ("FILE", 4, file); + grub_util_write_image ((char *) &leng, 4, file); + grub_util_write_image ("PFF2", 4, file); + offset += 12; + + if (! font_info->name) + font_info->name = "Unknown"; + + if (font_info->flags & GRUB_FONT_FLAG_BOLD) + font_info->style |= FT_STYLE_FLAG_BOLD; + + style_name[0] = 0; + if (font_info->style & FT_STYLE_FLAG_BOLD) + strcpy (style_name, " Bold"); + + if (font_info->style & FT_STYLE_FLAG_ITALIC) + strcat (style_name, " Italic"); + + if (! style_name[0]) + strcpy (style_name, " Regular"); + + asprintf (&font_name, "%s %s %d", font_info->name, &style_name[1], + font_info->size); + + write_string_section ("NAME", font_name, &offset, file); + write_string_section ("FAMI", font_info->name, &offset, file); + write_string_section ("WEIG", + (font_info->style & FT_STYLE_FLAG_BOLD) ? + "bold" : "normal", + &offset, file); + write_string_section ("SLAN", + (font_info->style & FT_STYLE_FLAG_ITALIC) ? + "italic" : "normal", + &offset, file); + + write_be16_section ("PTSZ", font_info->size, &offset, file); + write_be16_section ("MAXW", font_info->max_width, &offset, file); + write_be16_section ("MAXH", font_info->max_height, &offset, file); + + if (! font_info->desc) + { + if (font_info->min_y >= 0) + font_info->desc = 1; + else + font_info->desc = - font_info->min_y; + } + + write_be16_section ("ASCE", font_info->size - font_info->desc, &offset, file); + write_be16_section ("DESC", font_info->desc, &offset, file); + + if (font_verbosity > 0) + { + printf ("Font name: %s\n", font_name); + printf ("Max width: %d\n", font_info->max_width); + printf ("Max height: %d\n", font_info->max_height); + printf ("Font ascent: %d\n", font_info->size - font_info->desc); + printf ("Font descent: %d\n", font_info->desc); + } + + num = 0; + pre = 0; + cur = font_info->glyph; + while (cur) + { + struct grub_glyph_info *nxt; + + nxt = cur->next; + cur->next = pre; + pre = cur; + cur = nxt; + num++; + } + + font_info->glyph = pre; + + if (font_verbosity > 0) + printf ("Number of glyph: %d\n", num); + + leng = grub_cpu_to_be32 (num * 9); + grub_util_write_image ("CHIX", 4, file); + grub_util_write_image ((char *) &leng, 4, file); + offset += 8 + num * 9 + 8; + + for (cur = font_info->glyph; cur; cur = cur->next) + { + if (offset >= 0x95ed) + { + fclose (file); + grub_util_error ("Stop at %d %d\n", cur->char_code, offset); + } + data = grub_cpu_to_be32 (cur->char_code); + grub_util_write_image ((char *) &data, 4, file); + data = 0; + grub_util_write_image ((char *) &data, 1, file); + data = grub_cpu_to_be32 (offset); + grub_util_write_image ((char *) &data, 4, file); + offset += 10 + cur->bitmap_size; + } + + leng = 0xffffffff; + grub_util_write_image ("DATA", 4, file); + grub_util_write_image ((char *) &leng, 4, file); + + for (cur = font_info->glyph; cur; cur = cur->next) + { + data = grub_cpu_to_be16 (cur->width); + grub_util_write_image ((char *) &data, 2, file); + data = grub_cpu_to_be16 (cur->height); + grub_util_write_image ((char *) &data, 2, file); + data = grub_cpu_to_be16 (cur->x_ofs); + grub_util_write_image ((char *) &data, 2, file); + data = grub_cpu_to_be16 (cur->y_ofs); + grub_util_write_image ((char *) &data, 2, file); + data = grub_cpu_to_be16 (cur->device_width); + grub_util_write_image ((char *) &data, 2, file); + grub_util_write_image ((char *) &cur->bitmap[0], cur->bitmap_size, file); + } + + if (font_verbosity > 1) + print_glyphs (font_info); + + fclose (file); +} + +int +main (int argc, char *argv[]) +{ + struct grub_font_info font_info; + FT_Library ft_lib; + int font_index = 0; + int font_size = 0; + char *output_file = NULL; + + memset (&font_info, 0, sizeof (font_info)); + + progname = "grub-mkfont"; + + /* Check for options. */ + while (1) + { + int c = getopt_long (argc, argv, "bao:n:i:s:d:r:hVv", options, 0); + + if (c == -1) + break; + else + switch (c) + { + case 'b': + font_info.flags |= GRUB_FONT_FLAG_BOLD; + break; + + case 0x100: + font_info.flags |= GRUB_FONT_FLAG_NOBITMAP; + break; + + case 0x101: + font_info.flags |= GRUB_FONT_FLAG_NOHINTING; + break; + + case 'a': + font_info.flags |= GRUB_FONT_FLAG_FORCEHINT; + break; + + case 'o': + output_file = optarg; + break; + + case 'n': + font_info.name = optarg; + break; + + case 'i': + font_index = strtoul (optarg, NULL, 0); + break; + + case 's': + font_size = strtoul (optarg, NULL, 0); + break; + + case 'r': + { + char *p = optarg; + + while (1) + { + grub_uint32_t a, b; + + a = strtoul (p, &p, 0); + if (*p != '-') + grub_util_error ("Invalid font range"); + b = strtoul (p + 1, &p, 0); + if ((font_info.num_range & (GRUB_FONT_RANGE_BLOCK - 1)) == 0) + font_info.ranges = xrealloc (font_info.ranges, + (font_info.num_range + + GRUB_FONT_RANGE_BLOCK) * + sizeof (int) * 2); + + font_info.ranges[font_info.num_range * 2] = a; + font_info.ranges[font_info.num_range * 2 + 1] = b; + font_info.num_range++; + + if (*p) + { + if (*p != ',') + grub_util_error ("Invalid font range"); + else + p++; + } + else + break; + } + break; + } + + case 'd': + font_info.desc = strtoul (optarg, NULL, 0); + break; + + case 'h': + usage (0); + break; + + case 'V': + printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); + return 0; + + case 'v': + font_verbosity++; + break; + + default: + usage (1); + break; + } + } + + if (! output_file) + grub_util_error ("No output file is specified."); + + if (FT_Init_FreeType (&ft_lib)) + grub_util_error ("FT_Init_FreeType fails"); + + for (; optind < argc; optind++) + { + FT_Face ft_face; + int size; + + if (FT_New_Face (ft_lib, argv[optind], font_index, &ft_face)) + { + grub_util_info ("Can't open file %s, index %d\n", argv[optind], + font_index); + continue; + } + + if ((! font_info.name) && (ft_face->family_name)) + font_info.name = xstrdup (ft_face->family_name); + + size = font_size; + if (! size) + { + if ((ft_face->face_flags & FT_FACE_FLAG_SCALABLE) || + (! ft_face->num_fixed_sizes)) + size = GRUB_FONT_DEFAULT_SIZE; + else + size = ft_face->available_sizes[0].height; + } + + font_info.style = ft_face->style_flags; + font_info.size = size; + + FT_Set_Pixel_Sizes (ft_face, size, size); + add_font (&font_info, ft_face); + FT_Done_Face (ft_face); + } + + FT_Done_FreeType (ft_lib); + + write_font (&font_info, output_file); + + return 0; +} From d913988ca9799c58c313b5e1bb1d68536881c94a Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 13 Jan 2009 17:03:13 +0000 Subject: [PATCH 0484/1707] 2009-01-13 Bean * util/grub-mkfont.c (write_font): forget to remove some debug code. --- ChangeLog | 4 ++++ util/grub-mkfont.c | 5 ----- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index afb2fbb57..54c5112ab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-01-13 Bean + + * util/grub-mkfont.c (write_font): forget to remove some debug code. + 2009-01-13 Bean * Makefile.in: (enable_grub_mkfont): New variable. diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c index 58ec46960..330e47d74 100644 --- a/util/grub-mkfont.c +++ b/util/grub-mkfont.c @@ -427,11 +427,6 @@ write_font (struct grub_font_info *font_info, char *output_file) for (cur = font_info->glyph; cur; cur = cur->next) { - if (offset >= 0x95ed) - { - fclose (file); - grub_util_error ("Stop at %d %d\n", cur->char_code, offset); - } data = grub_cpu_to_be32 (cur->char_code); grub_util_write_image ((char *) &data, 4, file); data = 0; From 7795c55ef915d3cd34619f1a45f4f571a22fd734 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 14 Jan 2009 00:13:52 +0000 Subject: [PATCH 0485/1707] Spacing fixes --- ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54c5112ab..881f3436d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,8 @@ -2009-01-13 Bean +2009-01-13 Bean * util/grub-mkfont.c (write_font): forget to remove some debug code. -2009-01-13 Bean +2009-01-13 Bean * Makefile.in: (enable_grub_mkfont): New variable. (freetype_cflags): Likewise. @@ -131,7 +131,7 @@ (png_mod_LDFLAGS): Likewise. (gfxterm_mod_SOURCES): Likewise. (gfxterm_mod_CFLAGS): Likewise. - (gfxterm_mod_LDFLAGS): Likewise. + (gfxterm_mod_LDFLAGS): Likewise. * term/gfxterm.c: Removed include to grub/machine/memory.h, grub/machine/console.h. From 4a412913d1557666b8b70f7ae43ba704aa7eeb50 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 14 Jan 2009 00:17:12 +0000 Subject: [PATCH 0486/1707] 2009-01-13 Carles Pina i Estany * util/grub-editenv.c (main): Use fseeko(), not fseek(). --- ChangeLog | 4 ++++ util/grub-editenv.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 881f3436d..afef98251 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-01-13 Carles Pina i Estany + + * util/grub-editenv.c (main): Use fseeko(), not fseek(). + 2009-01-13 Bean * util/grub-mkfont.c (write_font): forget to remove some debug code. diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 68caf4263..475d12d12 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -260,7 +260,7 @@ main (int argc, char *argv[]) else if (! strcmp (argv[optind], "clear")) cmd_clear (); - fseek (f, 0, SEEK_SET); + fseeko (f, 0, SEEK_SET); fwrite (buffer, sizeof (buffer), 1, f); } fclose (f); From 7086085ba3338e66775ab7e5a11986c3c80d4ef0 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Fri, 16 Jan 2009 19:29:41 +0000 Subject: [PATCH 0487/1707] 2009-01-16 Christian Franke * disk/ata.c (enum grub_ata_commands): Remove EXEC_DEV_DIAGNOSTICS. (enum grub_ata_timeout_milliseconds): New enum. (grub_ata_wait_status): Add parameter milliseconds. (grub_ata_cmd): Remove variable `err'. Remove wait for !DRQ to allow recovery from timed-out commands. (grub_ata_pio_read): Add parameter milliseconds. Fix error return, return grub_errno instead of REG_ERROR. (grub_ata_pio_write): Add parameter milliseconds. (grub_atapi_identify): Fix size of ATAPI IDENTIFY sector. Pass milliseconds to grub_ata_wait_status () and grub_ata_pio_read (). (grub_atapi_packet): Pass milliseconds to grub_ata_pio_write (). (grub_ata_identify): Remove variable `ataerr'. Pass milliseconds to grub_ata_wait_status (). Fix IDENTIFY timeout check. (grub_ata_device_initialize): Remove EXECUTE DEVICE DIAGNOSTICS. It is not suitable for device detection, because DEV bit is ignored, the command may run too long, and not all devices set the signature properly. (grub_ata_pciinit): Clear grub_errno before grub_ata_device_initialize (). (grub_ata_setaddress): Pass milliseconds to grub_ata_wait_status (). Fix device selection, DEV bit must be set first to address the registers of the correct device. (grub_ata_readwrite): Pass milliseconds to grub_ata_wait_status () and grub_ata_pio_read/write (). (grub_atapi_read): Pass milliseconds to grub_ata_pio_read (). (grub_atapi_write): Pass milliseconds to grub_ata_pio_write (). --- ChangeLog | 29 +++++++++++ disk/ata.c | 141 ++++++++++++++++++++--------------------------------- 2 files changed, 82 insertions(+), 88 deletions(-) diff --git a/ChangeLog b/ChangeLog index afef98251..705b653d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,32 @@ +2009-01-16 Christian Franke + + * disk/ata.c (enum grub_ata_commands): Remove EXEC_DEV_DIAGNOSTICS. + (enum grub_ata_timeout_milliseconds): New enum. + (grub_ata_wait_status): Add parameter milliseconds. + (grub_ata_cmd): Remove variable `err'. Remove wait for !DRQ to allow + recovery from timed-out commands. + (grub_ata_pio_read): Add parameter milliseconds. Fix error return, + return grub_errno instead of REG_ERROR. + (grub_ata_pio_write): Add parameter milliseconds. + (grub_atapi_identify): Fix size of ATAPI IDENTIFY sector. + Pass milliseconds to grub_ata_wait_status () and + grub_ata_pio_read (). + (grub_atapi_packet): Pass milliseconds to grub_ata_pio_write (). + (grub_ata_identify): Remove variable `ataerr'. Pass milliseconds to + grub_ata_wait_status (). Fix IDENTIFY timeout check. + (grub_ata_device_initialize): Remove EXECUTE DEVICE DIAGNOSTICS. + It is not suitable for device detection, because DEV bit is ignored, + the command may run too long, and not all devices set the signature + properly. + (grub_ata_pciinit): Clear grub_errno before grub_ata_device_initialize (). + (grub_ata_setaddress): Pass milliseconds to grub_ata_wait_status (). + Fix device selection, DEV bit must be set first to address the registers + of the correct device. + (grub_ata_readwrite): Pass milliseconds to grub_ata_wait_status () and + grub_ata_pio_read/write (). + (grub_atapi_read): Pass milliseconds to grub_ata_pio_read (). + (grub_atapi_write): Pass milliseconds to grub_ata_pio_write (). + 2009-01-13 Carles Pina i Estany * util/grub-editenv.c (main): Use fseeko(), not fseek(). diff --git a/disk/ata.c b/disk/ata.c index 4ca63c233..af7158cc6 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -74,7 +74,12 @@ enum grub_ata_commands GRUB_ATA_CMD_IDENTIFY_DEVICE = 0xEC, GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE = 0xA1, GRUB_ATA_CMD_PACKET = 0xA0, - GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS = 0x90 + }; + +enum grub_ata_timeout_milliseconds + { + GRUB_ATA_TOUT_STD = 1000, /* 1s standard timeout. */ + GRUB_ATA_TOUT_DATA = 10000 /* 10s DATA I/O timeout. */ }; struct grub_ata_device @@ -139,11 +144,12 @@ grub_ata_regget2 (struct grub_ata_device *dev, int reg) static inline grub_err_t grub_ata_wait_status (struct grub_ata_device *dev, - grub_uint8_t maskset, grub_uint8_t maskclear) + grub_uint8_t maskset, grub_uint8_t maskclear, + int milliseconds) { int i; - for (i = 0; i < 1000; i++) + for (i = 0; i < milliseconds; i++) { grub_uint8_t reg; @@ -166,12 +172,8 @@ grub_ata_wait (void) static grub_err_t grub_ata_cmd (struct grub_ata_device *dev, int cmd) { - grub_err_t err; - - err = grub_ata_wait_status (dev, 0, - GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_BUSY); - if (err) - return err; + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) + return grub_errno; grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd); @@ -193,16 +195,16 @@ grub_ata_strncpy (char *dst, char *src, grub_size_t len) static grub_err_t grub_ata_pio_read (struct grub_ata_device *dev, char *buf, - grub_size_t size) + grub_size_t size, int milliseconds) { grub_uint16_t *buf16 = (grub_uint16_t *) buf; unsigned int i; if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); + return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); /* Wait until the data is available. */ - if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0)) + if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0, milliseconds)) return grub_errno;; /* Read in the data, word by word. */ @@ -217,16 +219,16 @@ grub_ata_pio_read (struct grub_ata_device *dev, char *buf, static grub_err_t grub_ata_pio_write (struct grub_ata_device *dev, char *buf, - grub_size_t size) + grub_size_t size, int milliseconds) { grub_uint16_t *buf16 = (grub_uint16_t *) buf; unsigned int i; if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_ata_regget (dev, GRUB_ATA_REG_ERROR); + return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); - /* Wait until the data is available. */ - if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0)) + /* Wait until drive is ready to read data. */ + if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0, milliseconds)) return 0; /* Write the data, word by word. */ @@ -264,11 +266,11 @@ grub_atapi_identify (struct grub_ata_device *dev) { char *info; - info = grub_malloc (256); + info = grub_malloc (GRUB_DISK_SECTOR_SIZE); if (! info) return grub_errno; - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) { grub_free (info); return grub_errno; @@ -282,7 +284,7 @@ grub_atapi_identify (struct grub_ata_device *dev) return grub_errno; } - if (grub_ata_pio_read (dev, info, 256)) + if (grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_STD)) { grub_free (info); return grub_errno; @@ -310,7 +312,7 @@ grub_atapi_packet (struct grub_ata_device *dev, char *packet) grub_ata_wait (); - if (grub_ata_pio_write (dev, packet, 12)) + if (grub_ata_pio_write (dev, packet, 12, GRUB_ATA_TOUT_STD)) return grub_errno; return GRUB_ERR_NONE; @@ -321,7 +323,6 @@ grub_ata_identify (struct grub_ata_device *dev) { char *info; grub_uint16_t *info16; - int ataerr = 0; info = grub_malloc (GRUB_DISK_SECTOR_SIZE); if (! info) @@ -329,7 +330,7 @@ grub_ata_identify (struct grub_ata_device *dev) info16 = (grub_uint16_t *) info; - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) { grub_free (info); return grub_errno; @@ -343,20 +344,22 @@ grub_ata_identify (struct grub_ata_device *dev) } grub_ata_wait (); - if (grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE)) - ataerr = grub_ata_regget (dev, GRUB_ATA_REG_ERROR); - if (ataerr & 4) + if (grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_STD)) { - /* ATAPI device detected. */ - grub_free(info); - return grub_atapi_identify (dev); - } - else if (ataerr) - { - /* Error. */ - grub_free(info); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "device can not be identified"); + if (grub_ata_regget (dev, GRUB_ATA_REG_ERROR) & 0x04) /* ABRT */ + { + /* Device without ATA IDENTIFY, try ATAPI. */ + grub_free(info); + grub_errno = GRUB_ERR_NONE; + return grub_atapi_identify (dev); + } + else + { + /* Error. */ + grub_free(info); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "device can not be identified"); + } } /* Now it is certain that this is not an ATAPI device. */ @@ -426,45 +429,6 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) return 0; } - /* Detect if the device is present by issuing a EXECUTE - DEVICE DIAGNOSTICS command. */ - grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); - if (grub_ata_cmd (dev, GRUB_ATA_CMD_EXEC_DEV_DIAGNOSTICS)) - { - grub_free (dev); - return grub_errno; - } - grub_ata_wait (); - - grub_dprintf ("ata", "Registers: %x %x %x %x\n", - grub_ata_regget (dev, GRUB_ATA_REG_SECTORS), - grub_ata_regget (dev, GRUB_ATA_REG_LBALOW), - grub_ata_regget (dev, GRUB_ATA_REG_LBAMID), - grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH)); - - /* Check some registers to see if the channel is used. */ - if (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) == 0x01 - && grub_ata_regget (dev, GRUB_ATA_REG_LBALOW) == 0x01 - && grub_ata_regget (dev, GRUB_ATA_REG_LBAMID) == 0x14 - && grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH) == 0xeb) - { - grub_dprintf ("ata", "ATAPI signature detected\n"); - } - else if (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) == 0x01 - && grub_ata_regget (dev, GRUB_ATA_REG_LBALOW) == 0x01 - && grub_ata_regget (dev, GRUB_ATA_REG_LBAMID) == 0x00 - && grub_ata_regget (dev, GRUB_ATA_REG_LBAHIGH) == 0x00) - { - grub_dprintf ("ata", "ATA detected\n"); - } - else - { - grub_dprintf ("ata", "incorrect signature\n"); - grub_free (dev); - return 0; - } - - /* Use the IDENTIFY DEVICE command to query the device. */ if (grub_ata_identify (dev)) { @@ -540,6 +504,7 @@ grub_ata_pciinit (int bus, int device, int func, if (rega && regb) { + grub_errno = GRUB_ERR_NONE; grub_ata_device_initialize (controller * 2 + i, 0, rega, regb); /* Most errors rised by grub_ata_device_initialize() are harmless. @@ -592,7 +557,7 @@ grub_ata_setaddress (struct grub_ata_device *dev, grub_disk_addr_t sector, grub_size_t size) { - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) return grub_errno; switch (addressing) @@ -616,10 +581,10 @@ grub_ata_setaddress (struct grub_ata_device *dev, "sector %d can not be addressed " "using CHS addressing", sector); + grub_ata_regset (dev, GRUB_ATA_REG_DISK, (dev->device << 4) | head); grub_ata_regset (dev, GRUB_ATA_REG_SECTNUM, sect); grub_ata_regset (dev, GRUB_ATA_REG_CYLLSB, cylinder & 0xFF); grub_ata_regset (dev, GRUB_ATA_REG_CYLMSB, cylinder >> 8); - grub_ata_regset (dev, GRUB_ATA_REG_DISK, (dev->device << 4) | head); break; } @@ -627,20 +592,20 @@ grub_ata_setaddress (struct grub_ata_device *dev, case GRUB_ATA_LBA: if (size == 256) size = 0; - grub_ata_setlba (dev, sector, size); grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | (dev->device << 4) | ((sector >> 24) & 0x0F)); + grub_ata_setlba (dev, sector, size); break; case GRUB_ATA_LBA48: if (size == 65536) size = 0; + grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | (dev->device << 4)); /* Set "Previous". */ grub_ata_setlba (dev, sector >> 24, size >> 8); /* Set "Current". */ grub_ata_setlba (dev, sector, size); - grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | (dev->device << 4)); break; } @@ -693,13 +658,13 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, return grub_errno; /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) return grub_errno; for (sect = 0; sect < batch; sect++) { if (grub_ata_pio_read (dev, buf, - GRUB_DISK_SECTOR_SIZE)) + GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) return grub_errno; buf += GRUB_DISK_SECTOR_SIZE; } @@ -711,13 +676,13 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, return grub_errno; /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) return grub_errno; for (sect = 0; sect < batch; sect++) { if (grub_ata_pio_write (dev, buf, - GRUB_DISK_SECTOR_SIZE)) + GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); buf += GRUB_DISK_SECTOR_SIZE; } @@ -736,12 +701,12 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, return grub_errno; /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) return grub_errno; for (sect = 0; sect < (size % batch); sect++) { - if (grub_ata_pio_read (dev, buf, GRUB_DISK_SECTOR_SIZE)) + if (grub_ata_pio_read (dev, buf, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) return grub_errno; buf += GRUB_DISK_SECTOR_SIZE; } @@ -751,12 +716,12 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, return grub_errno; /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY)) + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) return grub_errno; for (sect = 0; sect < (size % batch); sect++) { - if (grub_ata_pio_write (dev, buf, GRUB_DISK_SECTOR_SIZE)) + if (grub_ata_pio_write (dev, buf, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); buf += GRUB_DISK_SECTOR_SIZE; } @@ -887,7 +852,7 @@ grub_atapi_read (struct grub_scsi *scsi, grub_ata_wait (); /* XXX */ - return grub_ata_pio_read (dev, buf, size); + return grub_ata_pio_read (dev, buf, size, GRUB_ATA_TOUT_DATA); } static grub_err_t @@ -902,7 +867,7 @@ grub_atapi_write (struct grub_scsi *scsi, grub_ata_wait (); /* XXX */ - return grub_ata_pio_write (dev, buf, size); + return grub_ata_pio_write (dev, buf, size, GRUB_ATA_TOUT_DATA); } static grub_err_t From 4fa809981f093756db2bbc4e4a8e4657e8787f37 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 17 Jan 2009 09:38:38 +0000 Subject: [PATCH 0488/1707] 2009-01-17 Felix Zielcke * Makefile.in: Change font compilation to use new grub-mkfont instead of java version. * util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java: Remove. * util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/Converter.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/Font.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/Glyph.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java: Likewise. * util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java: Likewise. --- ChangeLog | 15 + Makefile.in | 19 +- .../src/org/gnu/grub/fonttool/BDFLoader.java | 271 ------------------ .../src/org/gnu/grub/fonttool/CharDefs.java | 181 ------------ .../gnu/grub/fonttool/CharStorageInfo.java | 36 --- .../org/gnu/grub/fonttool/CharacterRange.java | 75 ----- .../src/org/gnu/grub/fonttool/Converter.java | 168 ----------- .../src/org/gnu/grub/fonttool/Font.java | 123 -------- .../src/org/gnu/grub/fonttool/Glyph.java | 100 ------- .../org/gnu/grub/fonttool/PFF2Sections.java | 36 --- .../src/org/gnu/grub/fonttool/PFF2Writer.java | 154 ---------- 11 files changed, 23 insertions(+), 1155 deletions(-) delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/Converter.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/Font.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/Glyph.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java delete mode 100644 util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java diff --git a/ChangeLog b/ChangeLog index 705b653d8..939cf21ec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-01-17 Felix Zielcke + + * Makefile.in: Change font compilation to use new grub-mkfont instead + of java version. + + * util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java: Remove. + * util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java: Likewise. + * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. + * util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java: Likewise. + * util/fonttool/src/org/gnu/grub/fonttool/Converter.java: Likewise. + * util/fonttool/src/org/gnu/grub/fonttool/Font.java: Likewise. + * util/fonttool/src/org/gnu/grub/fonttool/Glyph.java: Likewise. + * util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java: Likewise. + * util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java: Likewise. + 2009-01-16 Christian Franke * disk/ata.c (enum grub_ata_commands): Remove EXEC_DEV_DIAGNOSTICS. diff --git a/Makefile.in b/Makefile.in index 42439d9ad..ea193d8b6 100644 --- a/Makefile.in +++ b/Makefile.in @@ -153,24 +153,21 @@ partmap.lst: $(PARTMAPFILES) ifeq (, $(UNIFONT_BDF)) else + +ifeq ($(enable_grub_mkfont),yes) + pkgdata_DATA += unicode.pf2 ascii.pf2 # Arrows and lines are needed to draw the menu, so we always include them UNICODE_ARROWS=0x2190-0x2193 UNICODE_LINES=0x2501-0x251B -# Note: fonttool should be replaced with C only implementation +unicode.pf2: $(UNIFONT_BDF) grub-mkfont + $(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF) -$(builddir)/fonttool/fonttool.jar: - mkdir -p "$(builddir)/fonttool/src" - javac -source 1.5 -target 1.5 -g -deprecation -encoding UTF-8 -d "$(builddir)/fonttool/src" `find "$(srcdir)/util/fonttool/src/" -name '*.java'` - jar cf $(builddir)/fonttool/fonttool.jar -C $(builddir)/fonttool/src . - -unicode.pf2: $(UNIFONT_BDF) $(builddir)/fonttool/fonttool.jar - java -cp $(builddir)/fonttool/fonttool.jar org.gnu.grub.fonttool.Converter --in=$(UNIFONT_BDF) --out=$@ - -ascii.pf2: $(UNIFONT_BDF) $(builddir)/fonttool/fonttool.jar - java -cp $(builddir)/fonttool/fonttool.jar org.gnu.grub.fonttool.Converter --in=$(UNIFONT_BDF) --out=$@ 0x0-0x7f $(UNICODE_ARROWS) $(UNICODE_LINES) +ascii.pf2: $(UNIFONT_BDF) grub-mkfont + $(builddir)/grub-mkfont -o $@ $(UNIFONT_BDF) -r 0x0-0x7f,$(UNICODE_ARROWS),$(UNICODE_LINES) +endif endif # Used for building modules externally diff --git a/util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java b/util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java deleted file mode 100644 index 1cb53a805..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/BDFLoader.java +++ /dev/null @@ -1,271 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -import java.io.*; -import java.util.StringTokenizer; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class BDFLoader { - private final BufferedReader in; - private final Font font; - private int maxCharWidth; - private int maxCharHeight; - - BDFLoader(BufferedReader in) { - this.in = in; - this.font = new Font(); - this.maxCharWidth = 0; - this.maxCharHeight = 0; - } - - public static boolean isBDFFile(String filename) { - DataInputStream in = null; - try { - in = new DataInputStream(new FileInputStream(filename)); - final String signature = "STARTFONT "; - byte[] b = new byte[signature.length()]; - in.readFully(b); - in.close(); - - String s = new String(b, "US-ASCII"); - return signature.equals(s); - } catch (IOException e) { - if (in != null) { - try { - in.close(); - } catch (IOException e1) { - // Ignore. - } - } - return false; - } - } - - public static Font loadFontResource(String resourceName) throws IOException { - InputStream in = BDFLoader.class.getClassLoader().getResourceAsStream(resourceName); - if (in == null) - throw new FileNotFoundException("Font resource " + resourceName + " not found"); - return loadFontFromStream(in); - } - - public static Font loadFontFile(String filename) throws IOException { - InputStream in = new FileInputStream(filename); - return loadFontFromStream(in); - } - - private static Font loadFontFromStream(InputStream inStream) throws IOException { - BufferedReader in; - try { - in = new BufferedReader(new InputStreamReader(inStream, "ISO-8859-1")); - } catch (UnsupportedEncodingException e) { - throw new RuntimeException("Encoding not supported: " + e.getMessage(), e); - } - return new BDFLoader(in).loadFont(); - } - - private Font loadFont() throws IOException { - loadFontInfo(); - while (loadChar()) { - /* Loop. */ - } - - font.setMaxCharWidth(maxCharWidth); - font.setMaxCharHeight(maxCharHeight); - return font; - } - - private void loadFontInfo() throws IOException { - final Pattern stringSettingPattern = Pattern.compile("^(\\w+)\\s+\"([^\"]+)\"$"); - String line; - // Load the global font information that appears before CHARS. - final int UNSET = Integer.MIN_VALUE; - font.setAscent(UNSET); - font.setDescent(UNSET); - font.setFamily("Unknown"); - font.setBold(false); - font.setItalic(false); - font.setPointSize(Font.UNKNOWN_POINT_SIZE); - do { - line = in.readLine(); - if (line == null) - throw new IOException("BDF format error: end of file while " + - "reading global font information"); - - StringTokenizer st = new StringTokenizer(line); - if (st.hasMoreTokens()) { - String name = st.nextToken(); - if (name.equals("FONT_ASCENT")) { - if (!st.hasMoreTokens()) - throw new IOException("BDF format error: " + - "no tokens after " + name); - font.setAscent(Integer.parseInt(st.nextToken())); - } else if (name.equals("FONT_DESCENT")) { - if (!st.hasMoreTokens()) - throw new IOException("BDF format error: " + - "no tokens after " + name); - font.setDescent(Integer.parseInt(st.nextToken())); - } else if (name.equals("POINT_SIZE")) { - if (!st.hasMoreTokens()) - throw new IOException("BDF format error: " + - "no tokens after " + name); - // Divide by 10, since it is stored X10. - font.setPointSize(Integer.parseInt(st.nextToken()) / 10); - } else if (name.equals("FAMILY_NAME")) { - Matcher matcher = stringSettingPattern.matcher(line); - if (!matcher.matches()) - throw new IOException("BDF format error: " + - "line doesn't match string " + - "setting pattern: " + line); - font.setFamily(matcher.group(2)); - } else if (name.equals("WEIGHT_NAME")) { - Matcher matcher = stringSettingPattern.matcher(line); - if (!matcher.matches()) - throw new IOException("BDF format error: " + - "line doesn't match string " + - "setting pattern: " + line); - String weightName = matcher.group(2); - font.setBold("bold".equalsIgnoreCase(weightName)); - } else if (name.equals("SLANT")) { - Matcher matcher = stringSettingPattern.matcher(line); - if (!matcher.matches()) - throw new IOException("BDF format error: " + - "line doesn't match string " + - "setting pattern: " + line); - String slantType = matcher.group(2); - font.setItalic(!"R".equalsIgnoreCase(slantType)); - } else if (name.equals("CHARS")) { - // This is the end of the global font information and - // the beginning of the character definitions. - break; - } else { - // Skip other fields. - } - } - } while (true); - - if (font.getAscent() == UNSET) - throw new IOException("BDF format error: no FONT_ASCENT property"); - if (font.getDescent() == UNSET) - throw new IOException("BDF format error: no FONT_DESCENT property"); - } - - private boolean loadChar() throws IOException { - String line; - // Find start of character - do { - line = in.readLine(); - if (line == null) - return false; - StringTokenizer st = new StringTokenizer(line); - if (st.hasMoreTokens() && st.nextToken().equals("STARTCHAR")) { - if (!st.hasMoreTokens()) - throw new IOException("BDF format error: no character name after STARTCHAR"); - break; - } - } while (true); - - // Find properties - final int UNSET = Integer.MIN_VALUE; - int codePoint = UNSET; - int bbx = UNSET; - int bby = UNSET; - int bbox = UNSET; - int bboy = UNSET; - int dwidth = UNSET; - do { - line = in.readLine(); - if (line == null) - return false; - StringTokenizer st = new StringTokenizer(line); - if (st.hasMoreTokens()) { - String field = st.nextToken(); - if (field.equals("ENCODING")) { - if (!st.hasMoreTokens()) - throw new IOException("BDF format error: no encoding # after ENCODING"); - String codePointStr = st.nextToken(); - codePoint = Integer.parseInt(codePointStr); - } else if (field.equals("BBX")) { - if (!st.hasMoreTokens()) - throw new IOException("BDF format error: no tokens after BBX"); - bbx = Integer.parseInt(st.nextToken()); - bby = Integer.parseInt(st.nextToken()); - bbox = Integer.parseInt(st.nextToken()); - bboy = Integer.parseInt(st.nextToken()); - } else if (field.equals("DWIDTH")) { - if (!st.hasMoreTokens()) - throw new IOException("BDF format error: no tokens after DWIDTH"); - dwidth = Integer.parseInt(st.nextToken()); - int dwidthY = Integer.parseInt(st.nextToken()); - // The DWIDTH Y value should be zero for any normal font. - if (dwidthY != 0) { - throw new IOException("BDF format error: dwidth Y value" + - "is nonzero (" + dwidthY + ") " + - "for char " + codePoint + "."); - } - } else if (field.equals("BITMAP")) { - break; // now read the bitmap - } - } - } while (true); - - if (codePoint == UNSET) - throw new IOException("BDF format error: " + - "no code point set"); - if (bbx == UNSET || bby == UNSET) - throw new IOException("BDF format error: " + - "bbx/bby missing: " + bbx + ", " + bby + - " for char " + codePoint); - - if (bbox == UNSET || bboy == UNSET) - throw new IOException("BDF format error: " + - "bbox/bboy missing: " + bbox + ", " + bboy + - " for char " + codePoint); - - if (dwidth == UNSET) - throw new IOException("BDF format error: " + - "dwidth missing for char " + codePoint); - - final int glyphWidth = bbx; - final int glyphHeight = bby; - if (glyphWidth > maxCharWidth) - maxCharWidth = glyphWidth; - if (glyphHeight > maxCharHeight) - maxCharHeight = glyphHeight; - - // Read the bitmap - Glyph glyph = new Glyph(codePoint, glyphWidth, glyphHeight, bbox, bboy, dwidth); - for (int y = 0; y < glyphHeight; y++) { - line = in.readLine(); - if (line == null) - return false; - for (int b = 0; b < line.length(); b++) { - int v = Integer.parseInt(Character.toString(line.charAt(b)), 16); - for (int x = b * 4, i = 0; i < 4 && x < glyphWidth; x++, i++) { - boolean set = (v & 0x8) != 0; - v <<= 1; - glyph.setPixel(x, y, set); - } - } - } - - font.putGlyph(codePoint, glyph); - return true; - } -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java b/util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java deleted file mode 100644 index fa2fd9b6e..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/CharDefs.java +++ /dev/null @@ -1,181 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -import java.io.ByteArrayOutputStream; -import java.io.DataOutputStream; -import java.io.IOException; -import java.util.Arrays; -import java.util.HashMap; -import java.util.Iterator; -import java.util.List; -import java.util.TreeMap; - -class CharDefs { - private boolean debug = "1".equals(System.getProperty("fonttool.debug")); - private TreeMap glyphs; - private ByteArrayOutputStream charDefsData; - private int maxCharWidth; - private int maxCharHeight; - private HashMap charIndex; - - public CharDefs(Font font) { - this.glyphs = font.getGlyphs(); - this.charIndex = null; - this.charDefsData = null; - - calculateMaxSizes(); - } - - private void calculateMaxSizes() { - maxCharWidth = 0; - maxCharHeight = 0; - for (Glyph glyph : glyphs.values()) { - final int w = glyph.getWidth(); - final int h = glyph.getHeight(); - if (w > maxCharWidth) - maxCharWidth = w; - if (h > maxCharHeight) - maxCharHeight = h; - } - } - - void buildDefinitions(List rangeList) { - charIndex = new HashMap(); - HashMap charDefIndex = new HashMap(); - charDefsData = new ByteArrayOutputStream(); - DataOutputStream charDefs = new DataOutputStream(charDefsData); - try { - // Loop through all the glyphs, writing the glyph data to the - // in-memory byte stream, collapsing duplicate glyphs, and - // constructing index information. - for (Glyph glyph : glyphs.values()) { - // Determine if glyph should be included in written file - if (rangeList.size() > 0) { - boolean skip = true; - - for (Iterator iter = rangeList.iterator(); iter - .hasNext();) { - CharacterRange item = iter.next(); - - if (item.isWithinRange(glyph.getCodePoint())) { - skip = false; - break; - } - } - - if (skip) { - continue; - } - } - - CharDef charDef = new CharDef(glyph.getWidth(), - glyph.getHeight(), - glyph.getBitmap()); - - if (charDefIndex.containsKey(charDef)) { - // Use already-written glyph. - if (debug) - System.out.printf("Duplicate glyph for character U+%04X%n", - glyph.getCodePoint()); - final int charOffset = charDefIndex.get(charDef).intValue(); - final CharStorageInfo info = - new CharStorageInfo(glyph.getCodePoint(), charOffset); - charIndex.put(glyph.getCodePoint(), info); - } else { - // Write glyph data. - final int charOffset = charDefs.size(); - final CharStorageInfo info = - new CharStorageInfo(glyph.getCodePoint(), charOffset); - charIndex.put(glyph.getCodePoint(), info); - - charDefIndex.put(charDef, (long) charOffset); - - charDefs.writeShort(glyph.getWidth()); - charDefs.writeShort(glyph.getHeight()); - charDefs.writeShort(glyph.getBbox()); - charDefs.writeShort(glyph.getBboy()); - charDefs.writeShort(glyph.getDeviceWidth()); - charDefs.write(glyph.getBitmap()); - } - } - } catch (IOException e) { - throw new RuntimeException("Error writing to in-memory byte stream", e); - } - } - - public int getMaxCharWidth() { - return maxCharWidth; - } - - public int getMaxCharHeight() { - return maxCharHeight; - } - - public HashMap getCharIndex() { - if (charIndex == null) throw new IllegalStateException(); - return charIndex; - } - - public byte[] getDefinitionData() { - if (charDefsData == null) throw new IllegalStateException(); - return charDefsData.toByteArray(); - } - - - private static class CharDef { - private final int width; - private final int height; - private final byte[] data; - - public CharDef(int width, int height, byte[] data) { - this.width = width; - this.height = height; - this.data = data; - } - - public boolean equals(Object o) { - if (this == o) return true; - if (o == null || getClass() != o.getClass()) return false; - - CharDef charDef = (CharDef) o; - - if (height != charDef.height) return false; - if (width != charDef.width) return false; - if (!Arrays.equals(data, charDef.data)) return false; - - return true; - } - - public int hashCode() { - int result; - result = width; - result = 31 * result + height; - result = 31 * result + Arrays.hashCode(data); - return result; - } - } - - - public int getIndexSize() { - if (charIndex == null) - return 0; - - return charIndex.size(); - } -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java b/util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java deleted file mode 100644 index 3d2ba554e..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/CharStorageInfo.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -class CharStorageInfo { - private final int codePoint; - private final int fileOffset; - - public CharStorageInfo(int codePoint, int fileOffset) { - this.codePoint = codePoint; - this.fileOffset = fileOffset; - } - - public int getCodePoint() { - return codePoint; - } - - public int getFileOffset() { - return fileOffset; - } -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java b/util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java deleted file mode 100644 index 378fdedea..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/CharacterRange.java +++ /dev/null @@ -1,75 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -/** - * @author chaac - * - */ -public class CharacterRange { - private int start; - private int end; - - public CharacterRange(int start, int end) { - this.start = start; - this.end = end; - } - - public int getStart() { - return start; - } - - public int getEnd() { - return end; - } - - protected boolean isCombinable(CharacterRange range) { - if (getStart() <= range.getStart() && range.getStart() <= getEnd()) - return true; - - if (range.getStart() <= getStart() && getStart() <= range.getEnd()) - return true; - - return false; - } - - public boolean isWithinRange(int value) { - if (value >= start && value <= end) - return true; - - return false; - } - - public boolean combine(CharacterRange range) { - int start; - int end; - - if (! isCombinable(range)) - return false; - - start = getStart(); - if (range.getStart() < start) - start = range.getStart(); - - end = getEnd(); - if (range.getEnd() > end) - end = range.getEnd(); - - return true; - } -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/Converter.java b/util/fonttool/src/org/gnu/grub/fonttool/Converter.java deleted file mode 100644 index c84fc7104..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/Converter.java +++ /dev/null @@ -1,168 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.Iterator; -import java.util.List; - -/** - * Program to convert BDF fonts into PFF2 fonts for use with GRUB. - */ -public class Converter { - public static void main(String[] args) { - if (args.length < 1) { - printUsageAndExit(); - } - - String in = null; - String out = null; - List rangeList = new ArrayList(); - - try { - for (String arg : args) { - if (arg.startsWith("--")) { - String option; - String value; - int equalsPos = arg.indexOf('='); - if (equalsPos < 0) { - option = arg.substring(2); - value = null; - } else { - option = arg.substring(2, equalsPos); - value = arg.substring(equalsPos + 1); - } - - if ("in".equals(option)) { - if (value == null) - throw new CommandLineException(option - + " option requires a value."); - in = value; - } else if ("out".equals(option)) { - if (value == null) - throw new CommandLineException(option - + " option requires a value."); - out = value; - } - } else if (arg.startsWith("0x")) { - // Range specifier - String strRange[] = arg.split("-"); - - if (strRange.length > 0) { - boolean validRange = true; - int start; - int end; - - if (strRange.length > 2) { - validRange = false; - } else if (strRange.length == 2 - && !strRange[1].startsWith("0x")) { - validRange = false; - } else - { - try { - start = Integer.parseInt(strRange[0] - .substring(2), 16); - end = start; - - if (strRange.length == 2) { - end = Integer.parseInt(strRange[1] - .substring(2), 16); - } - - CharacterRange range = new CharacterRange( - start, end); - boolean add = true; - - // First, try to combine range to existing ranges - for (Iterator iter = rangeList.iterator(); iter.hasNext(); ) - { - CharacterRange item = iter.next(); - - if (range.equals(item)) - { - add = false; - continue; - } - - if (item.combine(range)) - { - // Start from beginning of list using combined range - range = item; - iter = rangeList.iterator(); - add = false; - } - } - - // If range could not be combined or no matching range, add it to the list - if (add) - { - rangeList.add(range); - } - - } catch (NumberFormatException e) { - validRange = false; - } - - } - - if (!validRange) { - throw new CommandLineException("Invalid range `" - + arg + "'."); - } - } - } else { - throw new CommandLineException("Non-option argument `" + arg + "'."); - } - } - if (in == null || out == null) { - throw new CommandLineException("Both --in=X and --out=Y must be specified."); - } - } catch (CommandLineException e) { - System.err.println("Error: " + e.getMessage()); - System.exit(1); - } - - try { - // Read BDF. - Font font = BDFLoader.loadFontFile(in); - - // Write PFF2. - new PFF2Writer(out).writeFont(font, rangeList); - } catch (IOException e) { - System.err.println("I/O error converting font: " + e); - e.printStackTrace(); - System.exit(1); - } - } - - private static class CommandLineException extends Exception { - public CommandLineException(String message) { - super(message); - } - } - - private static void printUsageAndExit() { - System.err.println("GNU GRUB Font Conversion Tool"); - System.err.println(); - System.err.println("Usage: Converter --in=IN.bdf --out=OUT.pf2"); - System.err.println(); - System.exit(1); - } -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/Font.java b/util/fonttool/src/org/gnu/grub/fonttool/Font.java deleted file mode 100644 index 77df4b25c..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/Font.java +++ /dev/null @@ -1,123 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -import java.util.TreeMap; - -public class Font { - public static final int UNKNOWN_POINT_SIZE = -1; - - private TreeMap glyphs; - private String family; - private boolean bold; - private boolean italic; - private int pointSize; - private int maxCharWidth; - private int maxCharHeight; - private int ascent; - private int descent; - - public Font() { - glyphs = new TreeMap(); - } - - public String getFamily() { - return family; - } - - public void setFamily(String family) { - this.family = family; - } - - public boolean isBold() { - return bold; - } - - public void setBold(boolean bold) { - this.bold = bold; - } - - public boolean isItalic() { - return italic; - } - - public void setItalic(boolean italic) { - this.italic = italic; - } - - public int getPointSize() { - return pointSize; - } - - public void setPointSize(int pointSize) { - this.pointSize = pointSize; - } - - public int getMaxCharWidth() { - return maxCharWidth; - } - - public void setMaxCharWidth(int maxCharWidth) { - this.maxCharWidth = maxCharWidth; - } - - public int getMaxCharHeight() { - return maxCharHeight; - } - - public void setMaxCharHeight(int maxCharHeight) { - this.maxCharHeight = maxCharHeight; - } - - public int getAscent() { - return ascent; - } - - public void setAscent(int ascent) { - this.ascent = ascent; - } - - public int getDescent() { - return descent; - } - - public void setDescent(int descent) { - this.descent = descent; - } - - public void putGlyph(int codePoint, Glyph glyph) { - glyphs.put(codePoint, glyph); - } - - public TreeMap getGlyphs() { - return glyphs; - } - - public Glyph getGlyph(int codePoint) { - return glyphs.get(codePoint); - } - - public String getStandardName() { - StringBuilder name = new StringBuilder(getFamily()); - if (isBold()) name.append(" Bold"); - if (isItalic()) name.append(" Italic"); - name.append(' '); - name.append(getPointSize()); - return name.toString(); - } -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/Glyph.java b/util/fonttool/src/org/gnu/grub/fonttool/Glyph.java deleted file mode 100644 index c1bc5e576..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/Glyph.java +++ /dev/null @@ -1,100 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -public class Glyph { - private final int codePoint; - private final int width; - private final int height; - - // These define the amounts to shift the character bitmap by - // before drawing it. See - // http://www.adobe.com/devnet/font/pdfs/5005.BDF_Spec.pdf - // and - // http://www.linuxbabble.com/documentation/x/bdf/ - // for explanatory figures. - private final int bbox; - private final int bboy; - - // Number of pixels to advance horizontally from this character's origin - // to the origin of the next character. - private final int deviceWidth; - - // Row-major order, no padding. Rows can break within a byte. - // MSb is first (leftmost/uppermost) pixel. - private final byte[] bitmap; - - public Glyph(int codePoint, int width, int height, int bbox, int bboy, int deviceWidth) { - this(codePoint, width, height, bbox, bboy, deviceWidth, - new byte[(width * height + 7) / 8]); - } - - public Glyph(int codePoint, int width, int height, - int bbox, int bboy, int deviceWidth, - byte[] bitmap) { - this.codePoint = codePoint; - this.width = width; - this.height = height; - this.bboy = bboy; - this.bbox = bbox; - this.deviceWidth = deviceWidth; - this.bitmap = bitmap; - } - - public void setPixel(int x, int y, boolean value) { - if (x < 0 || y < 0 || x >= width || y >= height) - throw new IllegalArgumentException( - "Invalid pixel location (" + x + ", " + y + ") for " - + width + "x" + height + " glyph"); - - int bitIndex = y * width + x; - int byteIndex = bitIndex / 8; - int bitPos = bitIndex % 8; - int v = value ? 0x80 >>> bitPos : 0; - int mask = ~(0x80 >>> bitPos); - bitmap[byteIndex] = (byte) ((bitmap[byteIndex] & mask) | v); - } - - public int getCodePoint() { - return codePoint; - } - - public int getWidth() { - return width; - } - - public int getHeight() { - return height; - } - - public int getBbox() { - return bbox; - } - - public int getBboy() { - return bboy; - } - - public int getDeviceWidth() { - return deviceWidth; - } - - public byte[] getBitmap() { - return bitmap; - } -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java b/util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java deleted file mode 100644 index 61e8d8892..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/PFF2Sections.java +++ /dev/null @@ -1,36 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -/** - * Section name constants for the PFF2 file format. - */ -public class PFF2Sections { - static final String FILE = "FILE"; - static final String FONT_NAME = "NAME"; - static final String FONT_FAMILY = "FAMI"; - static final String FONT_WEIGHT = "WEIG"; - static final String FONT_SLANT = "SLAN"; - static final String FONT_POINT_SIZE = "PTSZ"; - static final String MAX_CHAR_WIDTH = "MAXW"; - static final String MAX_CHAR_HEIGHT = "MAXH"; - static final String FONT_ASCENT = "ASCE"; - static final String FONT_DESCENT = "DESC"; - static final String CHAR_INDEX = "CHIX"; - static final String REMAINDER_IS_DATA = "DATA"; -} diff --git a/util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java b/util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java deleted file mode 100644 index d38ed2724..000000000 --- a/util/fonttool/src/org/gnu/grub/fonttool/PFF2Writer.java +++ /dev/null @@ -1,154 +0,0 @@ -/** - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ -package org.gnu.grub.fonttool; - -import java.io.FileNotFoundException; -import java.io.IOException; -import java.io.RandomAccessFile; -import java.util.List; - -// TODO Add DEFLATE compressed blocks of characters. -public class PFF2Writer { - private RandomAccessFile f; - private String currentSection; - private long currentSectionStart; - - public PFF2Writer(String filename) throws FileNotFoundException { - this.f = new RandomAccessFile(filename, "rw"); - this.currentSection = null; - this.currentSectionStart = -1; - } - - public void writeFont(Font font, List rangeList) throws IOException { - // Clear existing file. - f.setLength(0); - - // Write file type ID header. - writeSection(PFF2Sections.FILE, "PFF2"); - - writeSection(PFF2Sections.FONT_NAME, font.getStandardName()); - writeSection(PFF2Sections.FONT_FAMILY, font.getFamily()); - writeSection(PFF2Sections.FONT_WEIGHT, font.isBold() ? "bold" : "normal"); - writeSection(PFF2Sections.FONT_SLANT, font.isItalic() ? "italic" : "normal"); - if (font.getPointSize() != Font.UNKNOWN_POINT_SIZE) - writeShortSection(PFF2Sections.FONT_POINT_SIZE, font.getPointSize()); - - // Construct character definitions. - CharDefs charDefs = new CharDefs(font); - charDefs.buildDefinitions(rangeList); - - // Write max character width and height metrics. - writeShortSection(PFF2Sections.MAX_CHAR_WIDTH, charDefs.getMaxCharWidth()); - writeShortSection(PFF2Sections.MAX_CHAR_HEIGHT, charDefs.getMaxCharHeight()); - writeShortSection(PFF2Sections.FONT_ASCENT, font.getAscent()); - writeShortSection(PFF2Sections.FONT_DESCENT, font.getDescent()); - - // Write character index with pointers to the character definitions. - beginSection(PFF2Sections.CHAR_INDEX); - - // Determine the size of the index, so we can properly refer to the - // character definition offset in the index. The actual number of - // bytes written is compared to the calculated value to ensure we - // are correct. - final int indexStart = (int) f.getFilePointer(); - final int calculatedIndexLength = - charDefs.getIndexSize() * (4 + 1 + 4); - final int charDefStart = indexStart + calculatedIndexLength + 8; - - for (CharStorageInfo storageInfo : charDefs.getCharIndex().values()) { - f.writeInt(storageInfo.getCodePoint()); - f.writeByte(0); // Storage flags: bits 1..0 = 00b : uncompressed. - f.writeInt(charDefStart + storageInfo.getFileOffset()); - } - - final int indexEnd = (int) f.getFilePointer(); - if (indexEnd - indexStart != calculatedIndexLength) { - throw new RuntimeException("Incorrect index length calculated, calc=" - + calculatedIndexLength - + " actual=" + (indexEnd - indexStart)); - } - endSection(PFF2Sections.CHAR_INDEX); - - f.writeBytes(PFF2Sections.REMAINDER_IS_DATA); - f.writeInt(-1); // Data takes up the rest of the file. - f.write(charDefs.getDefinitionData()); - - f.close(); - } - - private void beginSection(String sectionName) throws IOException { - verifyOkToBeginSection(sectionName); - - f.writeBytes(sectionName); - f.writeInt(-1); // Placeholder for the section length. - currentSection = sectionName; - currentSectionStart = f.getFilePointer(); - } - - private void endSection(String sectionName) throws IOException { - verifyOkToEndSection(sectionName); - - long sectionEnd = f.getFilePointer(); - long sectionLength = sectionEnd - currentSectionStart; - f.seek(currentSectionStart - 4); - f.writeInt((int) sectionLength); - f.seek(sectionEnd); - currentSection = null; - currentSectionStart = -1; - } - - private void verifyOkToBeginSection(String sectionName) { - if (sectionName.length() != 4) - throw new IllegalArgumentException( - "Section names must be 4 characters: `" + sectionName + "'."); - if (currentSection != null) - throw new IllegalStateException( - "Attempt to start `" + sectionName - + "' section before ending the previous section `" - + currentSection + "'."); - } - - private void verifyOkToEndSection(String sectionName) { - if (sectionName.length() != 4) - throw new IllegalStateException("Invalid section name '" + sectionName - + "'; must be 4 characters."); - if (currentSection == null) - throw new IllegalStateException( - "Attempt to end section `" + sectionName - + "' when no section active."); - if (!sectionName.equals(currentSection)) - throw new IllegalStateException( - "Attempt to end `" + sectionName - + "' section during active section `" - + currentSection + "'."); - } - - private void writeSection(String sectionName, String contents) throws IOException { - verifyOkToBeginSection(sectionName); - f.writeBytes(sectionName); - f.writeInt(contents.length()); - f.writeBytes(contents); - } - - private void writeShortSection(String sectionName, int value) throws IOException { - verifyOkToBeginSection(sectionName); - f.writeBytes(sectionName); - f.writeInt(2); - f.writeShort(value); - } -} From 3e643f8c1325a2438c3f42578c510678956d04a6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 19 Jan 2009 12:33:07 +0000 Subject: [PATCH 0489/1707] 2009-01-19 Robert Millan * config.guess: Update to latest version from config git. * config.sub: Likewise. --- ChangeLog | 5 +++++ config.guess | 32 +++++++++++++++++++++++++++++--- config.sub | 20 ++++++++++++++------ 3 files changed, 48 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 939cf21ec..5e8ac4864 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-19 Robert Millan + + * config.guess: Update to latest version from config git. + * config.sub: Likewise. + 2009-01-17 Felix Zielcke * Makefile.in: Change font compilation to use new grub-mkfont instead diff --git a/config.guess b/config.guess index c7607c74f..3f51f4ea9 100644 --- a/config.guess +++ b/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-04-14' +timestamp='2008-12-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -331,7 +331,20 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -796,7 +809,7 @@ EOF x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + EM64T | authenticamd | genuineintel) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) @@ -935,6 +948,9 @@ EOF if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -1138,6 +1154,16 @@ EOF 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; diff --git a/config.sub b/config.sub index a649350a6..d8573e81c 100644 --- a/config.sub +++ b/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 # Free Software Foundation, Inc. -timestamp='2008-06-16' +timestamp='2009-01-19' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -122,6 +122,7 @@ maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -249,6 +250,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ @@ -279,7 +281,7 @@ case $basic_machine in | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ @@ -288,7 +290,7 @@ case $basic_machine in | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; m6811 | m68hc11 | m6812 | m68hc12) @@ -331,6 +333,7 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ @@ -362,7 +365,7 @@ case $basic_machine in | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ @@ -375,7 +378,7 @@ case $basic_machine in | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -1140,6 +1143,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1178,7 +1185,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1250,6 +1257,7 @@ case $os in -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ From bee5fe5d095d8cf0c3bd67b22f23ef225bec6c9b Mon Sep 17 00:00:00 2001 From: chaac Date: Mon, 19 Jan 2009 17:09:53 +0000 Subject: [PATCH 0490/1707] =?UTF-8?q?2009-01-19=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * font/font.c (grub_font_loader_init): Re-position unknown glyph. * term/gfxterm.c (write_char): Fix background rendering for wide width glyphs. --- ChangeLog | 7 +++++++ font/font.c | 6 +++--- term/gfxterm.c | 11 ++++++++--- 3 files changed, 18 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5e8ac4864..3dd76d54f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-01-19 Vesa Jääskeläinen + + * font/font.c (grub_font_loader_init): Re-position unknown glyph. + + * term/gfxterm.c (write_char): Fix background rendering for wide + width glyphs. + 2009-01-19 Robert Millan * config.guess: Update to latest version from config git. diff --git a/font/font.c b/font/font.c index a16267a82..cfe1ee462 100644 --- a/font/font.c +++ b/font/font.c @@ -145,7 +145,7 @@ grub_font_loader_init (void) unknown_glyph->width = 8; unknown_glyph->height = 16; unknown_glyph->offset_x = 0; - unknown_glyph->offset_y = 0; + unknown_glyph->offset_y = -3; unknown_glyph->device_width = 8; grub_memcpy(unknown_glyph->bitmap, unknown_glyph_bitmap, sizeof(unknown_glyph_bitmap)); @@ -153,8 +153,8 @@ grub_font_loader_init (void) /* Initialize the null font. */ font_init (&null_font); null_font.name = ""; - null_font.ascent = unknown_glyph->height; - null_font.descent = 1; + null_font.ascent = unknown_glyph->height-3; + null_font.descent = 3; null_font.max_char_width = unknown_glyph->width; null_font.max_char_height = unknown_glyph->height; diff --git a/term/gfxterm.c b/term/gfxterm.c index f3d59f01c..abb1b9ed7 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -680,6 +680,8 @@ write_char (void) unsigned int x; unsigned int y; int ascent; + unsigned int height; + unsigned int width; /* Find out active character. */ p = (virtual_screen.text_buffer @@ -691,7 +693,10 @@ write_char (void) /* Get glyph for character. */ glyph = grub_font_get_glyph (virtual_screen.font, p->code); ascent = grub_font_get_ascent (virtual_screen.font); - + + width = virtual_screen.normal_char_width * calculate_character_width(glyph); + height = virtual_screen.normal_char_height; + color = p->fg_color; bgcolor = p->bg_color; @@ -700,13 +705,13 @@ write_char (void) /* Render glyph to text layer. */ grub_video_set_active_render_target (text_layer); - grub_video_fill_rect (bgcolor, x, y, glyph->width, glyph->height); + grub_video_fill_rect (bgcolor, x, y, width, height); grub_font_draw_glyph (glyph, color, x, y + ascent); grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); /* Mark character to be drawn. */ dirty_region_add (virtual_screen.offset_x + x, virtual_screen.offset_y + y, - glyph->width, glyph->height); + width, height); } static void From 1cfe20b333510db233ed9e51fcbbfcaf545332e7 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Mon, 19 Jan 2009 20:27:54 +0000 Subject: [PATCH 0491/1707] 2009-01-19 Christian Franke * disk/scsi.c (grub_scsi_read10): Use scsi->blocksize instead of 512 to calculate data size. (grub_scsi_read12): Likewise. (grub_scsi_write10): Likewise. (grub_scsi_write12): Likewise. (grub_scsi_read): Adjust size according to blocksize. Add checks for invalid blocksize and unaligned transfer. --- ChangeLog | 10 ++++++++++ disk/scsi.c | 26 ++++++++++++++++++++------ 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3dd76d54f..602c3dbed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-01-19 Christian Franke + + * disk/scsi.c (grub_scsi_read10): Use scsi->blocksize instead + of 512 to calculate data size. + (grub_scsi_read12): Likewise. + (grub_scsi_write10): Likewise. + (grub_scsi_write12): Likewise. + (grub_scsi_read): Adjust size according to blocksize. + Add checks for invalid blocksize and unaligned transfer. + 2009-01-19 Vesa Jääskeläinen * font/font.c (grub_font_loader_init): Re-position unknown glyph. diff --git a/disk/scsi.c b/disk/scsi.c index b7b6834e7..d1653097c 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -119,7 +119,7 @@ grub_scsi_read10 (grub_disk_t disk, grub_disk_addr_t sector, rd.reserved2 = 0; rd.pad = 0; - return scsi->dev->read (scsi, sizeof (rd), (char *) &rd, size * 512, buf); + return scsi->dev->read (scsi, sizeof (rd), (char *) &rd, size * scsi->blocksize, buf); } /* Send a SCSI request for DISK: read SIZE sectors starting with @@ -140,7 +140,7 @@ grub_scsi_read12 (grub_disk_t disk, grub_disk_addr_t sector, rd.reserved = 0; rd.control = 0; - return scsi->dev->read (scsi, sizeof (rd), (char *) &rd, size * 512, buf); + return scsi->dev->read (scsi, sizeof (rd), (char *) &rd, size * scsi->blocksize, buf); } #if 0 @@ -163,7 +163,7 @@ grub_scsi_write10 (grub_disk_t disk, grub_disk_addr_t sector, wr.reserved2 = 0; wr.pad = 0; - return scsi->dev->write (scsi, sizeof (wr), (char *) &wr, size * 512, buf); + return scsi->dev->write (scsi, sizeof (wr), (char *) &wr, size * scsi->blocksize, buf); } /* Send a SCSI request for DISK: write the data stored in BUF to SIZE @@ -184,7 +184,7 @@ grub_scsi_write12 (grub_disk_t disk, grub_disk_addr_t sector, wr.reserved = 0; wr.pad = 0; - return scsi->dev->write (scsi, sizeof (wr), (char *) &wr, size * 512, buf); + return scsi->dev->write (scsi, sizeof (wr), (char *) &wr, size * scsi->blocksize, buf); } #endif @@ -325,8 +325,22 @@ grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector, /* SCSI sectors are variable in size. GRUB uses 512 byte sectors. */ - sector = grub_divmod64 (sector, scsi->blocksize >> GRUB_DISK_SECTOR_BITS, - NULL); + if (scsi->blocksize != GRUB_DISK_SECTOR_SIZE) + { + unsigned spb = scsi->blocksize >> GRUB_DISK_SECTOR_BITS; + if (! (spb != 0 && (scsi->blocksize & GRUB_DISK_SECTOR_SIZE) == 0)) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "Unsupported SCSI block size"); + + grub_int32_t sector_mod = 0; + sector = grub_divmod64 (sector, spb, §or_mod); + + if (! (sector_mod == 0 && size % spb == 0)) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "Unaligned SCSI read not supported"); + + size /= spb; + } /* Depending on the type, select a read function. */ switch (scsi->devtype) From 59a64ef6dad452a05881a3c8aaa2526a7ae4c650 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Mon, 19 Jan 2009 20:39:57 +0000 Subject: [PATCH 0492/1707] 2009-01-19 Christian Franke * disk/ata.c (GRUB_ATAPI_REG_*): New defines. (GRUB_ATAPI_IREASON_*): Likewise. (grub_ata_pio_write): Fix timeout error return. (grub_atapi_identify): Add grub_ata_wait () after cmd. (grub_atapi_wait_drq): New function. (grub_atapi_packet): New parameter `size'. Use grub_atapi_wait_drq () and direct write instead of grub_ata_pio_write (). (grub_atapi_read): Replace grub_ata_pio_read () by a loop which reads the number of bytes requested by the device for each DRQ assertion. (grub_atapi_write): Remove old implementation, return not implemented instead. --- ChangeLog | 16 +++++++ disk/ata.c | 121 +++++++++++++++++++++++++++++++++++++++++++---------- 2 files changed, 116 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 602c3dbed..b5cf52a06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-01-19 Christian Franke + + * disk/ata.c (GRUB_ATAPI_REG_*): New defines. + (GRUB_ATAPI_IREASON_*): Likewise. + (grub_ata_pio_write): Fix timeout error return. + (grub_atapi_identify): Add grub_ata_wait () after cmd. + (grub_atapi_wait_drq): New function. + (grub_atapi_packet): New parameter `size'. + Use grub_atapi_wait_drq () and direct write instead of + grub_ata_pio_write (). + (grub_atapi_read): Replace grub_ata_pio_read () by a loop which + reads the number of bytes requested by the device for each DRQ + assertion. + (grub_atapi_write): Remove old implementation, return not + implemented instead. + 2009-01-19 Christian Franke * disk/scsi.c (grub_scsi_read10): Use scsi->blocksize instead diff --git a/disk/ata.c b/disk/ata.c index af7158cc6..c0904fb79 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -44,12 +44,15 @@ static const int grub_ata_ioaddress2[] = { 0x3f6, 0x376 }; #define GRUB_ATA_REG_ERROR 1 #define GRUB_ATA_REG_FEATURES 1 #define GRUB_ATA_REG_SECTORS 2 +#define GRUB_ATAPI_REG_IREASON 2 #define GRUB_ATA_REG_SECTNUM 3 #define GRUB_ATA_REG_CYLLSB 4 #define GRUB_ATA_REG_CYLMSB 5 #define GRUB_ATA_REG_LBALOW 3 #define GRUB_ATA_REG_LBAMID 4 +#define GRUB_ATAPI_REG_CNTLOW 4 #define GRUB_ATA_REG_LBAHIGH 5 +#define GRUB_ATAPI_REG_CNTHIGH 5 #define GRUB_ATA_REG_DISK 6 #define GRUB_ATA_REG_CMD 7 #define GRUB_ATA_REG_STATUS 7 @@ -65,6 +68,13 @@ static const int grub_ata_ioaddress2[] = { 0x3f6, 0x376 }; #define GRUB_ATA_STATUS_READY 0x40 #define GRUB_ATA_STATUS_BUSY 0x80 +/* ATAPI interrupt reason values (I/O, D/C bits). */ +#define GRUB_ATAPI_IREASON_MASK 0x3 +#define GRUB_ATAPI_IREASON_DATA_OUT 0x0 +#define GRUB_ATAPI_IREASON_CMD_OUT 0x1 +#define GRUB_ATAPI_IREASON_DATA_IN 0x2 +#define GRUB_ATAPI_IREASON_ERROR 0x3 + enum grub_ata_commands { GRUB_ATA_CMD_READ_SECTORS = 0x20, @@ -229,7 +239,7 @@ grub_ata_pio_write (struct grub_ata_device *dev, char *buf, /* Wait until drive is ready to read data. */ if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0, milliseconds)) - return 0; + return grub_errno; /* Write the data, word by word. */ for (i = 0; i < size / 2; i++) @@ -283,6 +293,7 @@ grub_atapi_identify (struct grub_ata_device *dev) grub_free (info); return grub_errno; } + grub_ata_wait (); if (grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_STD)) { @@ -300,21 +311,65 @@ grub_atapi_identify (struct grub_ata_device *dev) } static grub_err_t -grub_atapi_packet (struct grub_ata_device *dev, char *packet) +grub_atapi_wait_drq (struct grub_ata_device *dev, + grub_uint8_t ireason, + int milliseconds) { + grub_millisleep (1); /* ATA allows 400ns to assert BSY. */ + + if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, milliseconds)) + return grub_errno; + + grub_uint8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + grub_uint8_t irs = grub_ata_regget (dev, GRUB_ATAPI_REG_IREASON); + + /* OK if DRQ is asserted and interrupt reason is as expected. */ + if ((sts & GRUB_ATA_STATUS_DRQ) + && (irs & GRUB_ATAPI_IREASON_MASK) == ireason) + return GRUB_ERR_NONE; + + /* No DRQ implies error condition. */ + grub_dprintf("ata", "atapi error: status=0x%x, ireason=0x%x, error=0x%x\n", + sts, irs, grub_ata_regget (dev, GRUB_ATA_REG_ERROR)); + + if (! (sts & GRUB_ATA_STATUS_DRQ) + && (irs & GRUB_ATAPI_IREASON_MASK) == GRUB_ATAPI_IREASON_ERROR) + { + if (ireason == GRUB_ATAPI_IREASON_CMD_OUT) + return grub_error (GRUB_ERR_READ_ERROR, "ATA PACKET command error"); + else + return grub_error (GRUB_ERR_READ_ERROR, "ATAPI read error"); + } + + return grub_error (GRUB_ERR_READ_ERROR, "ATAPI protocol error"); +} + +static grub_err_t +grub_atapi_packet (struct grub_ata_device *dev, char *packet, + grub_size_t size) +{ + if (grub_ata_wait_status(dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) + return grub_errno; + + /* Send ATA PACKET command. */ grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); grub_ata_regset (dev, GRUB_ATA_REG_FEATURES, 0); - grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0); - grub_ata_regset (dev, GRUB_ATA_REG_LBAHIGH, 0xFF); - grub_ata_regset (dev, GRUB_ATA_REG_LBAMID, 0xFF); + grub_ata_regset (dev, GRUB_ATAPI_REG_IREASON, 0); + grub_ata_regset (dev, GRUB_ATAPI_REG_CNTHIGH, size >> 8); + grub_ata_regset (dev, GRUB_ATAPI_REG_CNTLOW, size & 0xFF); grub_ata_regset (dev, GRUB_ATA_REG_CMD, GRUB_ATA_CMD_PACKET); - grub_ata_wait (); - - if (grub_ata_pio_write (dev, packet, 12, GRUB_ATA_TOUT_STD)) + /* Wait for !BSY, DRQ, !I/O, C/D. */ + if (grub_atapi_wait_drq (dev, GRUB_ATAPI_IREASON_CMD_OUT, GRUB_ATA_TOUT_STD)) return grub_errno; + /* Write the packet. */ + grub_uint16_t *buf16 = (grub_uint16_t *) packet; + unsigned i; + for (i = 0; i < 12 / 2; i++) + grub_outw (grub_cpu_to_le16 (buf16[i]), dev->ioaddress + GRUB_ATA_REG_DATA); + return GRUB_ERR_NONE; } @@ -847,27 +902,51 @@ grub_atapi_read (struct grub_scsi *scsi, { struct grub_ata_device *dev = (struct grub_ata_device *) scsi->data; - if (grub_atapi_packet (dev, cmd)) + grub_dprintf("ata", "grub_atapi_read (size=%u)\n", size); + + if (grub_atapi_packet (dev, cmd, size)) return grub_errno; - grub_ata_wait (); /* XXX */ + grub_size_t nread = 0; + while (nread < size) + { + /* Wait for !BSY, DRQ, I/O, !C/D. */ + if (grub_atapi_wait_drq (dev, GRUB_ATAPI_IREASON_DATA_IN, GRUB_ATA_TOUT_DATA)) + return grub_errno; - return grub_ata_pio_read (dev, buf, size, GRUB_ATA_TOUT_DATA); + /* Get byte count for this DRQ assertion. */ + unsigned cnt = grub_ata_regget (dev, GRUB_ATAPI_REG_CNTHIGH) << 8 + | grub_ata_regget (dev, GRUB_ATAPI_REG_CNTLOW); + grub_dprintf("ata", "DRQ count=%u\n", cnt); + + /* Count of last transfer may be uneven. */ + if (! (0 < cnt && cnt <= size - nread && (! (cnt & 1) || cnt == size - nread))) + return grub_error (GRUB_ERR_READ_ERROR, "Invalid ATAPI transfer count"); + + /* Read the data. */ + grub_uint16_t *buf16 = (grub_uint16_t *) (buf + nread); + unsigned i; + for (i = 0; i < cnt / 2; i++) + buf16[i] = grub_le_to_cpu16 (grub_inw (dev->ioaddress + GRUB_ATA_REG_DATA)); + + if (cnt & 1) + buf[nread + cnt - 1] = (char) grub_le_to_cpu16 (grub_inw (dev->ioaddress + GRUB_ATA_REG_DATA)); + + nread += cnt; + } + + return GRUB_ERR_NONE; } static grub_err_t -grub_atapi_write (struct grub_scsi *scsi, +grub_atapi_write (struct grub_scsi *scsi __attribute__((unused)), grub_size_t cmdsize __attribute__((unused)), - char *cmd, grub_size_t size, char *buf) + char *cmd __attribute__((unused)), + grub_size_t size __attribute__((unused)), + char *buf __attribute__((unused))) { - struct grub_ata_device *dev = (struct grub_ata_device *) scsi->data; - - if (grub_atapi_packet (dev, cmd)) - return grub_errno; - - grub_ata_wait (); /* XXX */ - - return grub_ata_pio_write (dev, buf, size, GRUB_ATA_TOUT_DATA); + // XXX: scsi.mod does not use write yet. + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "ATAPI write not implemented"); } static grub_err_t From 3138b44c9042958ca07c53c90719c48bc26ca69d Mon Sep 17 00:00:00 2001 From: chrfranke Date: Thu, 22 Jan 2009 20:15:05 +0000 Subject: [PATCH 0493/1707] 2009-01-22 Christian Franke * disk/ata.c (grub_ata_wait_status): Replace by ... (grub_ata_wait_not_busy): ... this function. Checks only BSY bit, other status bits may be invalid while BSY is asserted. (grub_ata_check_ready): New function. (grub_ata_cmd): Removed. (grub_ata_wait_drq): New function. (grub_ata_strncpy): Remove inline. (grub_ata_pio_read): Reduce to actual block transfer. BSY wait and error check now done by grub_ata_wait_drq (). (grub_ata_pio_write): Likewise. (grub_atapi_identify): Set DEV before check for !BSY. Use grub_ata_wait_drq () to wait for data. (grub_ata_device_initialize): Add status register check to detect missing SATA slave devices. Add debug messages. (grub_atapi_wait_drq): Use grub_ata_wait_not_busy (). (grub_atapi_packet): Set DEV before check for !BSY. Replace transfer loop by grub_ata_pio_write (). (grub_ata_identify): Set DEV before check for !BSY. Use grub_ata_wait_drq () to wait for data. (grub_ata_setaddress): Set DEV before check for !BSY. (grub_ata_readwrite): Remove duplicate code, handle batch/rest and read/write in one loop. Fix invalid command on write. Fix incomplete command on (size % batch) == 0. Add missing error check after write of last block. Add debug messages. (grub_atapi_read): Replace transfer loop by grub_ata_pio_read (). --- ChangeLog | 28 +++++ disk/ata.c | 295 ++++++++++++++++++++++++----------------------------- 2 files changed, 160 insertions(+), 163 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5cf52a06..bfec017f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,31 @@ +2009-01-22 Christian Franke + + * disk/ata.c (grub_ata_wait_status): Replace by ... + (grub_ata_wait_not_busy): ... this function. Checks only BSY bit, + other status bits may be invalid while BSY is asserted. + (grub_ata_check_ready): New function. + (grub_ata_cmd): Removed. + (grub_ata_wait_drq): New function. + (grub_ata_strncpy): Remove inline. + (grub_ata_pio_read): Reduce to actual block transfer. BSY wait + and error check now done by grub_ata_wait_drq (). + (grub_ata_pio_write): Likewise. + (grub_atapi_identify): Set DEV before check for !BSY. Use + grub_ata_wait_drq () to wait for data. + (grub_ata_device_initialize): Add status register check to + detect missing SATA slave devices. Add debug messages. + (grub_atapi_wait_drq): Use grub_ata_wait_not_busy (). + (grub_atapi_packet): Set DEV before check for !BSY. Replace + transfer loop by grub_ata_pio_write (). + (grub_ata_identify): Set DEV before check for !BSY. Use + grub_ata_wait_drq () to wait for data. + (grub_ata_setaddress): Set DEV before check for !BSY. + (grub_ata_readwrite): Remove duplicate code, handle batch/rest and + read/write in one loop. Fix invalid command on write. Fix incomplete + command on (size % batch) == 0. Add missing error check after write of + last block. Add debug messages. + (grub_atapi_read): Replace transfer loop by grub_ata_pio_read (). + 2009-01-19 Christian Franke * disk/ata.c (GRUB_ATAPI_REG_*): New defines. diff --git a/disk/ata.c b/disk/ata.c index c0904fb79..e981fe926 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -152,25 +152,29 @@ grub_ata_regget2 (struct grub_ata_device *dev, int reg) return grub_inb (dev->ioaddress2 + reg); } -static inline grub_err_t -grub_ata_wait_status (struct grub_ata_device *dev, - grub_uint8_t maskset, grub_uint8_t maskclear, - int milliseconds) +/* Wait for !BSY. */ +static grub_err_t +grub_ata_wait_not_busy (struct grub_ata_device *dev, int milliseconds) { - int i; + /* ATA requires 400ns (after a write to CMD register) or + 1 PIO cycle (after a DRQ block transfer) before + first check of BSY. */ + grub_millisleep (1); - for (i = 0; i < milliseconds; i++) + int i = 1; + while (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY) { - grub_uint8_t reg; - - reg = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); - if ((reg & maskset) == maskset && (reg & maskclear) == 0) - return GRUB_ERR_NONE; + if (i >= milliseconds) + { + grub_dprintf ("ata", "timeout: %dms\n", milliseconds); + return grub_error (GRUB_ERR_TIMEOUT, "ATA timeout"); + } grub_millisleep (1); + i++; } - return grub_error (GRUB_ERR_TIMEOUT, "ata timeout"); + return GRUB_ERR_NONE; } static inline void @@ -179,19 +183,42 @@ grub_ata_wait (void) grub_millisleep (50); } -static grub_err_t -grub_ata_cmd (struct grub_ata_device *dev, int cmd) +/* Check for !BSY before issuing a new command. */ +static inline grub_err_t +grub_ata_check_ready (struct grub_ata_device *dev) { - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY) + return grub_ata_wait_not_busy (dev, GRUB_ATA_TOUT_STD); + + return GRUB_ERR_NONE; +} + +/* Wait for !BSY, DRQ. */ +static grub_err_t +grub_ata_wait_drq (struct grub_ata_device *dev, int rw, + int milliseconds) +{ + if (grub_ata_wait_not_busy (dev, milliseconds)) return grub_errno; - grub_ata_regset (dev, GRUB_ATA_REG_CMD, cmd); + /* !DRQ implies error condition. */ + grub_uint8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + if ((sts & (GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) + != GRUB_ATA_STATUS_DRQ) + { + grub_dprintf ("ata", "ata error: status=0x%x, error=0x%x\n", + sts, grub_ata_regget (dev, GRUB_ATA_REG_ERROR)); + if (! rw) + return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); + else + return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); + } return GRUB_ERR_NONE; } /* Byteorder has to be changed before strings can be read. */ -static inline void +static void grub_ata_strncpy (char *dst, char *src, grub_size_t len) { grub_uint16_t *src16 = (grub_uint16_t *) src; @@ -203,52 +230,26 @@ grub_ata_strncpy (char *dst, char *src, grub_size_t len) dst[len] = '\0'; } -static grub_err_t -grub_ata_pio_read (struct grub_ata_device *dev, char *buf, - grub_size_t size, int milliseconds) +static void +grub_ata_pio_read (struct grub_ata_device *dev, char *buf, grub_size_t size) { grub_uint16_t *buf16 = (grub_uint16_t *) buf; unsigned int i; - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); - - /* Wait until the data is available. */ - if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0, milliseconds)) - return grub_errno;; - /* Read in the data, word by word. */ for (i = 0; i < size / 2; i++) buf16[i] = grub_le_to_cpu16 (grub_inw(dev->ioaddress + GRUB_ATA_REG_DATA)); - - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_error (GRUB_ERR_READ_ERROR, "ATA read error"); - - return GRUB_ERR_NONE; } -static grub_err_t -grub_ata_pio_write (struct grub_ata_device *dev, char *buf, - grub_size_t size, int milliseconds) +static void +grub_ata_pio_write (struct grub_ata_device *dev, char *buf, grub_size_t size) { grub_uint16_t *buf16 = (grub_uint16_t *) buf; unsigned int i; - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); - - /* Wait until drive is ready to read data. */ - if (grub_ata_wait_status (dev, GRUB_ATA_STATUS_DRQ, 0, milliseconds)) - return grub_errno; - /* Write the data, word by word. */ for (i = 0; i < size / 2; i++) grub_outw(grub_cpu_to_le16 (buf16[i]), dev->ioaddress + GRUB_ATA_REG_DATA); - - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_ERR) - return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); - - return GRUB_ERR_NONE; } static void @@ -280,26 +281,22 @@ grub_atapi_identify (struct grub_ata_device *dev) if (! info) return grub_errno; - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) - { - grub_free (info); - return grub_errno; - } - grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4); - - if (grub_ata_cmd (dev, GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE)) + if (grub_ata_check_ready (dev)) { grub_free (info); return grub_errno; } + + grub_ata_regset (dev, GRUB_ATA_REG_CMD, GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE); grub_ata_wait (); - if (grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_STD)) + if (grub_ata_wait_drq (dev, 0, GRUB_ATA_TOUT_STD)) { grub_free (info); return grub_errno; } + grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE); dev->atapi = 1; @@ -315,9 +312,8 @@ grub_atapi_wait_drq (struct grub_ata_device *dev, grub_uint8_t ireason, int milliseconds) { - grub_millisleep (1); /* ATA allows 400ns to assert BSY. */ - - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, milliseconds)) + /* Wait for !BSY, DRQ, ireason */ + if (grub_ata_wait_not_busy (dev, milliseconds)) return grub_errno; grub_uint8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); @@ -328,9 +324,9 @@ grub_atapi_wait_drq (struct grub_ata_device *dev, && (irs & GRUB_ATAPI_IREASON_MASK) == ireason) return GRUB_ERR_NONE; - /* No DRQ implies error condition. */ - grub_dprintf("ata", "atapi error: status=0x%x, ireason=0x%x, error=0x%x\n", - sts, irs, grub_ata_regget (dev, GRUB_ATA_REG_ERROR)); + /* !DRQ implies error condition. */ + grub_dprintf ("ata", "atapi error: status=0x%x, ireason=0x%x, error=0x%x\n", + sts, irs, grub_ata_regget (dev, GRUB_ATA_REG_ERROR)); if (! (sts & GRUB_ATA_STATUS_DRQ) && (irs & GRUB_ATAPI_IREASON_MASK) == GRUB_ATAPI_IREASON_ERROR) @@ -348,11 +344,11 @@ static grub_err_t grub_atapi_packet (struct grub_ata_device *dev, char *packet, grub_size_t size) { - if (grub_ata_wait_status(dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) + grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); + if (grub_ata_check_ready (dev)) return grub_errno; /* Send ATA PACKET command. */ - grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); grub_ata_regset (dev, GRUB_ATA_REG_FEATURES, 0); grub_ata_regset (dev, GRUB_ATAPI_REG_IREASON, 0); grub_ata_regset (dev, GRUB_ATAPI_REG_CNTHIGH, size >> 8); @@ -365,10 +361,7 @@ grub_atapi_packet (struct grub_ata_device *dev, char *packet, return grub_errno; /* Write the packet. */ - grub_uint16_t *buf16 = (grub_uint16_t *) packet; - unsigned i; - for (i = 0; i < 12 / 2; i++) - grub_outw (grub_cpu_to_le16 (buf16[i]), dev->ioaddress + GRUB_ATA_REG_DATA); + grub_ata_pio_write (dev, packet, 12); return GRUB_ERR_NONE; } @@ -385,21 +378,17 @@ grub_ata_identify (struct grub_ata_device *dev) info16 = (grub_uint16_t *) info; - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) + grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4); + if (grub_ata_check_ready (dev)) { grub_free (info); return grub_errno; } - grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4); - if (grub_ata_cmd (dev, GRUB_ATA_CMD_IDENTIFY_DEVICE)) - { - grub_free (info); - return grub_errno; - } + grub_ata_regset (dev, GRUB_ATA_REG_CMD, GRUB_ATA_CMD_IDENTIFY_DEVICE); grub_ata_wait (); - if (grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_STD)) + if (grub_ata_wait_drq (dev, 0, GRUB_ATA_TOUT_STD)) { if (grub_ata_regget (dev, GRUB_ATA_REG_ERROR) & 0x04) /* ABRT */ { @@ -417,6 +406,8 @@ grub_ata_identify (struct grub_ata_device *dev) } } + grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE); + /* Now it is certain that this is not an ATAPI device. */ dev->atapi = 0; @@ -471,14 +462,31 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) dev->ioaddress2 = addr2; dev->next = NULL; - /* Try to detect if the port is in use by writing to it, - waiting for a while and reading it again. If the value - was preserved, there is a device connected. */ grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); grub_ata_wait (); + + /* If status is 0x00, it is safe to assume that there + is no device (or only a !READY) device connected. */ + grub_int8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + grub_dprintf ("ata", "status=0x%x\n", sts); + if (sts == 0x00) + { + grub_free(dev); + return 0; + } + + /* Try to detect if the port is in use by writing to it, + waiting for a while and reading it again. If the value + was preserved, there is a device connected. + But this tests often detects a second (slave) device + connected to a SATA controller which supports only one + (master) device. In this case, the status register + check above usually works. */ grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A); grub_ata_wait (); - if (grub_ata_regget (dev, GRUB_ATA_REG_SECTORS) != 0x5A) + grub_int8_t sec = grub_ata_regget (dev, GRUB_ATA_REG_SECTORS); + grub_dprintf ("ata", "sectors=0x%x\n", sec); + if (sec != 0x5A) { grub_free(dev); return 0; @@ -612,9 +620,6 @@ grub_ata_setaddress (struct grub_ata_device *dev, grub_disk_addr_t sector, grub_size_t size) { - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_STD)) - return grub_errno; - switch (addressing) { case GRUB_ATA_CHS: @@ -637,6 +642,9 @@ grub_ata_setaddress (struct grub_ata_device *dev, "using CHS addressing", sector); grub_ata_regset (dev, GRUB_ATA_REG_DISK, (dev->device << 4) | head); + if (grub_ata_check_ready (dev)) + return grub_errno; + grub_ata_regset (dev, GRUB_ATA_REG_SECTNUM, sect); grub_ata_regset (dev, GRUB_ATA_REG_CYLLSB, cylinder & 0xFF); grub_ata_regset (dev, GRUB_ATA_REG_CYLMSB, cylinder >> 8); @@ -649,6 +657,9 @@ grub_ata_setaddress (struct grub_ata_device *dev, size = 0; grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | (dev->device << 4) | ((sector >> 24) & 0x0F)); + if (grub_ata_check_ready (dev)) + return grub_errno; + grub_ata_setlba (dev, sector, size); break; @@ -657,6 +668,9 @@ grub_ata_setaddress (struct grub_ata_device *dev, size = 0; grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | (dev->device << 4)); + if (grub_ata_check_ready (dev)) + return grub_errno; + /* Set "Previous". */ grub_ata_setlba (dev, sector >> 24, size >> 8); /* Set "Current". */ @@ -673,14 +687,12 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, grub_size_t size, char *buf, int rw) { struct grub_ata_device *dev = (struct grub_ata_device *) disk->data; - grub_size_t cnt; - grub_size_t batch; - grub_ata_addressing_t addressing; - int cmd; - int cmd_write; - unsigned int sect; - addressing = dev->addr; + grub_dprintf("ata", "grub_ata_readwrite (size=%u, rw=%d)\n", size, rw); + + grub_ata_addressing_t addressing = dev->addr; + grub_size_t batch; + int cmd, cmd_write; if (addressing == GRUB_ATA_LBA48 && ((sector + size) >> 28) != 0) { @@ -697,89 +709,49 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, cmd_write = GRUB_ATA_CMD_WRITE_SECTORS; } - cnt = size / batch; - - /* Read/write batches of 256/65536 sectors, when more than 256/65536 - sectors should be read/written. */ - for (; cnt; cnt--) + grub_size_t nsectors = 0; + while (nsectors < size) { + if (size - nsectors < batch) + batch = size - nsectors; + + grub_dprintf("ata", "rw=%d, sector=%llu, batch=%u\n", rw, sector, batch); + + /* Send read/write commmand. */ if (grub_ata_setaddress (dev, addressing, sector, batch)) return grub_errno; - if (rw == 0) + grub_ata_regset (dev, GRUB_ATA_REG_CMD, (! rw ? cmd : cmd_write)); + + unsigned sect; + for (sect = 0; sect < batch; sect++) { - /* Read 256/65536 sectors. */ - if (grub_ata_cmd (dev, cmd)) + /* Wait for !BSY, DRQ. */ + if (grub_ata_wait_drq (dev, rw, GRUB_ATA_TOUT_DATA)) return grub_errno; - /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) - return grub_errno; + /* Transfer data. */ + if (! rw) + grub_ata_pio_read (dev, buf, GRUB_DISK_SECTOR_SIZE); + else + grub_ata_pio_write (dev, buf, GRUB_DISK_SECTOR_SIZE); - for (sect = 0; sect < batch; sect++) - { - if (grub_ata_pio_read (dev, buf, - GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) - return grub_errno; - buf += GRUB_DISK_SECTOR_SIZE; - } - } - else - { - /* Write 256/65536 sectors. */ - if (grub_ata_cmd (dev, cmd)) - return grub_errno; - - /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) - return grub_errno; - - for (sect = 0; sect < batch; sect++) - { - if (grub_ata_pio_write (dev, buf, - GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) - return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); - buf += GRUB_DISK_SECTOR_SIZE; - } - } - sector += batch; - } - - /* Read/write just a "few" sectors. */ - if (grub_ata_setaddress (dev, addressing, sector, size % batch)) - return grub_errno; - - if (rw == 0) - { - /* Read sectors. */ - if (grub_ata_cmd (dev, cmd)) - return grub_errno; - - /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) - return grub_errno; - - for (sect = 0; sect < (size % batch); sect++) - { - if (grub_ata_pio_read (dev, buf, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) - return grub_errno; buf += GRUB_DISK_SECTOR_SIZE; } - } else { - /* Write sectors. */ - if (grub_ata_cmd (dev, cmd)) - return grub_errno; - /* Wait for the command to complete. */ - if (grub_ata_wait_status (dev, 0, GRUB_ATA_STATUS_BUSY, GRUB_ATA_TOUT_DATA)) - return grub_errno; + if (rw) + { + /* Check for write error. */ + if (grub_ata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) + return grub_errno; - for (sect = 0; sect < (size % batch); sect++) - { - if (grub_ata_pio_write (dev, buf, GRUB_DISK_SECTOR_SIZE, GRUB_ATA_TOUT_DATA)) + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) + & (GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) return grub_error (GRUB_ERR_WRITE_ERROR, "ATA write error"); - buf += GRUB_DISK_SECTOR_SIZE; } + + sector += batch; + nsectors += batch; } return GRUB_ERR_NONE; @@ -924,10 +896,7 @@ grub_atapi_read (struct grub_scsi *scsi, return grub_error (GRUB_ERR_READ_ERROR, "Invalid ATAPI transfer count"); /* Read the data. */ - grub_uint16_t *buf16 = (grub_uint16_t *) (buf + nread); - unsigned i; - for (i = 0; i < cnt / 2; i++) - buf16[i] = grub_le_to_cpu16 (grub_inw (dev->ioaddress + GRUB_ATA_REG_DATA)); + grub_ata_pio_read (dev, buf + nread, cnt); if (cnt & 1) buf[nread + cnt - 1] = (char) grub_le_to_cpu16 (grub_inw (dev->ioaddress + GRUB_ATA_REG_DATA)); From d31c24f1e078e92cdb9c12ec0d27423f672cb2ab Mon Sep 17 00:00:00 2001 From: chrfranke Date: Thu, 22 Jan 2009 20:27:52 +0000 Subject: [PATCH 0494/1707] 2009-01-22 Christian Franke * kern/misc.c (grub_vsprintf): Fix size and termination of `format2' (precision) digit string. Allow `.format2' without `format1' (width). Limit input chars for `%s' output to `format2' if specified. This is compatible with standard printf (). --- ChangeLog | 7 +++++++ kern/misc.c | 50 +++++++++++++++++++++++++++++--------------------- 2 files changed, 36 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index bfec017f2..7c8a28345 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-01-22 Christian Franke + + * kern/misc.c (grub_vsprintf): Fix size and termination of `format2' + (precision) digit string. Allow `.format2' without `format1' (width). + Limit input chars for `%s' output to `format2' if specified. This is + compatible with standard printf (). + 2009-01-22 Christian Franke * disk/ata.c (grub_ata_wait_status): Replace by ... diff --git a/kern/misc.c b/kern/misc.c index 6fbc6510a..da64eb050 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -700,7 +700,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) char tmp[32]; char *p; unsigned int format1 = 0; - unsigned int format2 = 3; + unsigned int format2 = ~ 0U; char zerofill = ' '; int rightfill = 0; int n; @@ -727,20 +727,22 @@ grub_vsprintf (char *str, const char *fmt, va_list args) zerofill = '0'; format1 = grub_strtoul (s, 0, 10); fmt = p; - if (*p && *p == '.') + } + + if (*p && *p == '.') + { + p++; + fmt++; + while (*p && grub_isdigit (*p)) + p++; + + if (p > fmt) { - p++; - fmt++; - while (*p && grub_isdigit (*p)) - p++; - - if (p > fmt) - { - char fstr[p - fmt]; - grub_strncpy (fstr, fmt, p - fmt); - format2 = grub_strtoul (fstr, 0, 10); - fmt = p; - } + char fstr[p - fmt + 1]; + grub_strncpy (fstr, fmt, p - fmt); + fstr[p - fmt] = 0; + format2 = grub_strtoul (fstr, 0, 10); + fmt = p; } } @@ -847,13 +849,19 @@ grub_vsprintf (char *str, const char *fmt, va_list args) p = va_arg (args, char *); if (p) { - if (!rightfill && grub_strlen (p) < format1) - write_fill (zerofill, format1 - grub_strlen (p)); - - write_str (p); - - if (rightfill && grub_strlen (p) < format1) - write_fill (zerofill, format1 - grub_strlen (p)); + grub_size_t len = 0; + while (len < format2 && p[len]) + len++; + + if (!rightfill && len < format1) + write_fill (zerofill, format1 - len); + + grub_size_t i; + for (i = 0; i < len; i++) + write_char (*p++); + + if (rightfill && len < format1) + write_fill (zerofill, format1 - len); } else write_str ("(null)"); From 580b2a0fb2839b46088a78a5b6818f83d5deeb2b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 25 Jan 2009 23:04:46 +0000 Subject: [PATCH 0495/1707] 2009-01-26 Robert Millan * configure.ac: Fix cross-compilation check. --- ChangeLog | 4 ++++ configure | 2 +- configure.ac | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c8a28345..1136aabc8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-01-26 Robert Millan + + * configure.ac: Fix cross-compilation check. + 2009-01-22 Christian Franke * kern/misc.c (grub_vsprintf): Fix size and termination of `format2' diff --git a/configure b/configure index de8ef269f..e1c8c9691 100644 --- a/configure +++ b/configure @@ -5928,7 +5928,7 @@ esac echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } # For cross-compiling. -if test "x$target" != "x$host"; then +if test "x$build" != "x$host"; then # XXX this depends on the implementation of autoconf! tmp_ac_tool_prefix="$ac_tool_prefix" ac_tool_prefix=$target_alias- diff --git a/configure.ac b/configure.ac index 8caaa0697..e563c14df 100644 --- a/configure.ac +++ b/configure.ac @@ -223,7 +223,7 @@ AC_SUBST(TARGET_OBJ2ELF) AC_MSG_RESULT([$TARGET_OBJ2ELF]) # For cross-compiling. -if test "x$target" != "x$host"; then +if test "x$build" != "x$host"; then # XXX this depends on the implementation of autoconf! tmp_ac_tool_prefix="$ac_tool_prefix" ac_tool_prefix=$target_alias- From ef257b36a647712c157fd338f6888785d2e5a2e3 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 26 Jan 2009 04:05:54 +0000 Subject: [PATCH 0496/1707] Remove trailing whitespace --- ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1136aabc8..edbf9c96d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2009-01-26 Robert Millan * configure.ac: Fix cross-compilation check. - + 2009-01-22 Christian Franke * kern/misc.c (grub_vsprintf): Fix size and termination of `format2' @@ -30,7 +30,7 @@ transfer loop by grub_ata_pio_write (). (grub_ata_identify): Set DEV before check for !BSY. Use grub_ata_wait_drq () to wait for data. - (grub_ata_setaddress): Set DEV before check for !BSY. + (grub_ata_setaddress): Set DEV before check for !BSY. (grub_ata_readwrite): Remove duplicate code, handle batch/rest and read/write in one loop. Fix invalid command on write. Fix incomplete command on (size % batch) == 0. Add missing error check after write of @@ -67,7 +67,7 @@ * font/font.c (grub_font_loader_init): Re-position unknown glyph. - * term/gfxterm.c (write_char): Fix background rendering for wide + * term/gfxterm.c (write_char): Fix background rendering for wide width glyphs. 2009-01-19 Robert Millan From 1806b56e2b5181be642d28dc51044cca9ca1cefe Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 26 Jan 2009 04:22:44 +0000 Subject: [PATCH 0497/1707] 2009-01-26 Daniel Mierswa * kern/misc.c (grub_strcasecmp): New function. (grub_strcasecmp): Use grub_size_t instead of int for length. Fix return value. * include/grub/misc.h: Update function prototypes. --- ChangeLog | 7 +++++++ include/grub/misc.h | 3 ++- kern/misc.c | 33 ++++++++++++++++++++++++--------- 3 files changed, 33 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index edbf9c96d..a88fadf14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-01-26 Daniel Mierswa + + * kern/misc.c (grub_strcasecmp): New function. + (grub_strcasecmp): Use grub_size_t instead of int for length. + Fix return value. + * include/grub/misc.h: Update function prototypes. + 2009-01-26 Robert Millan * configure.ac: Fix cross-compilation check. diff --git a/include/grub/misc.h b/include/grub/misc.h index e37847ef0..c377c20a2 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -45,7 +45,8 @@ void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2); int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); -int EXPORT_FUNC(grub_strncasecmp) (const char *s1, const char *s2, int c); +int EXPORT_FUNC(grub_strcasecmp) (const char *s1, const char *s2); +int EXPORT_FUNC(grub_strncasecmp) (const char *s1, const char *s2, grub_size_t n); char *EXPORT_FUNC(grub_strchr) (const char *s, int c); char *EXPORT_FUNC(grub_strrchr) (const char *s, int c); int EXPORT_FUNC(grub_strword) (const char *s, const char *w); diff --git a/kern/misc.c b/kern/misc.c index da64eb050..641bd7aef 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -194,7 +194,7 @@ grub_strcmp (const char *s1, const char *s2) while (*s1 && *s2) { if (*s1 != *s2) - return (int) *s1 - (int) *s2; + break; s1++; s2++; @@ -212,7 +212,7 @@ grub_strncmp (const char *s1, const char *s2, grub_size_t n) while (*s1 && *s2 && --n) { if (*s1 != *s2) - return (int) *s1 - (int) *s2; + break; s1++; s2++; @@ -222,21 +222,36 @@ grub_strncmp (const char *s1, const char *s2, grub_size_t n) } int -grub_strncasecmp (const char *s1, const char *s2, int c) +grub_strcasecmp (const char *s1, const char *s2) { - int p = 1; - - while (grub_tolower (*s1) && grub_tolower (*s2) && p < c) + while (*s1 && *s2) { if (grub_tolower (*s1) != grub_tolower (*s2)) - return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); + break; + + s1++; + s2++; + } + + return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); +} + +int +grub_strncasecmp (const char *s1, const char *s2, grub_size_t n) +{ + if (n == 0) + return 0; + + while (*s1 && *s2 && --n) + { + if (grub_tolower (*s1) != grub_tolower (*s2)) + break; s1++; s2++; - p++; } - return (int) *s1 - (int) *s2; + return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); } char * From 336e1fb9eac8c726a48da9ce7d2c72dcd936723b Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 26 Jan 2009 04:26:47 +0000 Subject: [PATCH 0498/1707] 2009-01-26 Daniel Mierswa * commands/search.c (search_fs_uuid): Ignore case of the UUID. --- ChangeLog | 2 ++ commands/search.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a88fadf14..bab56b233 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-01-26 Daniel Mierswa + * commands/search.c (search_fs_uuid): Ignore case of the UUID. + * kern/misc.c (grub_strcasecmp): New function. (grub_strcasecmp): Use grub_size_t instead of int for length. Fix return value. diff --git a/commands/search.c b/commands/search.c index caaee524d..a07259a65 100644 --- a/commands/search.c +++ b/commands/search.c @@ -115,7 +115,7 @@ search_fs_uuid (const char *key, const char *var) (fs->uuid) (dev, &uuid); if (grub_errno == GRUB_ERR_NONE && uuid) { - if (grub_strcmp (uuid, key) == 0) + if (grub_strcasecmp (uuid, key) == 0) { /* Found! */ count++; From 3fb18f094d6b59b9374f54a03033f66056f31e51 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 26 Jan 2009 04:35:57 +0000 Subject: [PATCH 0499/1707] 2009-01-26 Daniel Mierswa * fs/fat.c (grub_fat_uuid): Fix shift of the first two bytes. --- ChangeLog | 2 ++ fs/fat.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bab56b233..9f37ae986 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-01-26 Daniel Mierswa + * fs/fat.c (grub_fat_uuid): Fix shift of the first two bytes. + * commands/search.c (search_fs_uuid): Ignore case of the UUID. * kern/misc.c (grub_strcasecmp): New function. diff --git a/fs/fat.c b/fs/fat.c index 8db176009..d62adbc27 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -841,7 +841,7 @@ grub_fat_uuid (grub_device_t device, char **uuid) if (data) { *uuid = grub_malloc (sizeof ("xxxx-xxxx")); - grub_sprintf (*uuid, "%04x-%04x", (grub_uint16_t) (data->uuid >> 8), + grub_sprintf (*uuid, "%04x-%04x", (grub_uint16_t) (data->uuid >> 16), (grub_uint16_t) data->uuid); } else From 6a7eab2c139b028aff161673b5b3eb39656f92e1 Mon Sep 17 00:00:00 2001 From: chaac Date: Tue, 27 Jan 2009 18:26:09 +0000 Subject: [PATCH 0500/1707] =?UTF-8?q?2009-01-27=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * disk/scsi.c (grub_scsi_read): Fix sign problem. * term/i386/pc/vga_text.c (grub_vga_text_init_fini). Fix declaration. * util/grub-mkfont.c (usage): Fix typo. * util/elf/grub-mkimage.c (load_modules): Fix warning. --- ChangeLog | 10 ++++++++++ disk/scsi.c | 10 +++++----- term/i386/pc/vga_text.c | 2 +- util/elf/grub-mkimage.c | 12 +++++++----- util/grub-mkfont.c | 2 +- 5 files changed, 24 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f37ae986..be78dd597 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-01-27 Vesa Jääskeläinen + + * disk/scsi.c (grub_scsi_read): Fix sign problem. + + * term/i386/pc/vga_text.c (grub_vga_text_init_fini). Fix declaration. + + * util/grub-mkfont.c (usage): Fix typo. + + * util/elf/grub-mkimage.c (load_modules): Fix warning. + 2009-01-26 Daniel Mierswa * fs/fat.c (grub_fat_uuid): Fix shift of the first two bytes. diff --git a/disk/scsi.c b/disk/scsi.c index d1653097c..5dce28873 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -41,7 +41,7 @@ void grub_scsi_dev_unregister (grub_scsi_dev_t dev) { grub_scsi_dev_t *p, q; - + for (p = &grub_scsi_dev_list, q = *p; q; p = &(q->next), q = q->next) if (q == dev) { @@ -52,7 +52,7 @@ grub_scsi_dev_unregister (grub_scsi_dev_t dev) /* Determine the the device is removable and the type of the device - SCSI. */ + SCSI. */ static grub_err_t grub_scsi_inquiry (grub_scsi_t scsi) { @@ -231,7 +231,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) grub_err_t err; int len; int lun; - + scsi = grub_malloc (sizeof (*scsi)); if (! scsi) return grub_errno; @@ -269,7 +269,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) grub_dprintf ("scsi", "inquiry: devtype=0x%02x removable=%d\n", scsi->devtype, scsi->removable); - + /* Try to be conservative about the device types supported. */ if (scsi->devtype != grub_scsi_devtype_direct @@ -332,7 +332,7 @@ grub_scsi_read (grub_disk_t disk, grub_disk_addr_t sector, return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "Unsupported SCSI block size"); - grub_int32_t sector_mod = 0; + grub_uint32_t sector_mod = 0; sector = grub_divmod64 (sector, spb, §or_mod); if (! (sector_mod == 0 && size % spb == 0)) diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index 0649262d5..e067ed615 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -143,7 +143,7 @@ grub_vga_text_setcursor (int on) } static grub_err_t -grub_vga_text_init_fini () +grub_vga_text_init_fini (void) { grub_vga_text_cls (); return 0; diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index 715dddad8..f841035c2 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -103,7 +103,9 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, struct grub_util_path_list *path_list; struct grub_util_path_list *p; struct grub_module_info *modinfo; - size_t offset, total_module_size, memdisk_size; + size_t offset; + size_t total_module_size; + size_t memdisk_size = 0; path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); @@ -197,7 +199,7 @@ add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[], char * grub_util_error ("cannot open %s", kernel_path); grub_util_read_at (&ehdr, sizeof (ehdr), 0, in); - + offset = ALIGN_UP (sizeof (ehdr), GRUB_TARGET_SIZEOF_LONG); ehdr.e_phoff = grub_host_to_target32 (offset); @@ -240,7 +242,7 @@ add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[], char * /* Read segment data and write it to new file. */ segment_img = xmalloc (grub_target_to_host32 (phdr->p_filesz)); - + grub_util_read_at (segment_img, grub_target_to_host32 (phdr->p_filesz), grub_target_to_host32 (phdr->p_offset), in); @@ -379,11 +381,11 @@ main (int argc, char *argv[]) if (memdisk) free (memdisk); memdisk = xstrdup (optarg); - + if (prefix) free (prefix); prefix = xstrdup ("(memdisk)/boot/grub"); - + break; case 'h': usage (0); diff --git a/util/grub-mkfont.c b/util/grub-mkfont.c index 330e47d74..cfd6f9df3 100644 --- a/util/grub-mkfont.c +++ b/util/grub-mkfont.c @@ -102,7 +102,7 @@ Usage: grub-mkfont [OPTIONS] FONT_FILES\n\ -s, --size=N set font size\n\ -d, --desc=N set font descent\n\ -b, --bold convert to bold font\n\ - -a, --force-autohine force autohint\n\ + -a, --force-autohint force autohint\n\ --no-hinting disable hinting\n\ --no-bitmap ignore bitmap strikes when loading\n\ -h, --help display this message and exit\n\ From 994b5e841d5350b3b60d0f1ec810519a0496388b Mon Sep 17 00:00:00 2001 From: chaac Date: Tue, 27 Jan 2009 19:07:32 +0000 Subject: [PATCH 0501/1707] =?UTF-8?q?2009-01-27=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commands/lsmmap.c: Add include to grub/machine/memory.h. * fs/i386/pc/pxe.c (grub_pxefs_open): Fix sign problem. * term/i386/pc/at_keyboard.c (GRUB_MOD_FINI(at_keyboard)): Use proper unregister function. --- ChangeLog | 9 +++++++++ commands/lsmmap.c | 3 ++- fs/i386/pc/pxe.c | 4 ++-- term/i386/pc/at_keyboard.c | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index be78dd597..d995fbdb4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-01-27 Vesa Jääskeläinen + + * commands/lsmmap.c: Add include to grub/machine/memory.h. + + * fs/i386/pc/pxe.c (grub_pxefs_open): Fix sign problem. + + * term/i386/pc/at_keyboard.c (GRUB_MOD_FINI(at_keyboard)): Use proper + unregister function. + 2009-01-27 Vesa Jääskeläinen * disk/scsi.c (grub_scsi_read): Fix sign problem. diff --git a/commands/lsmmap.c b/commands/lsmmap.c index d2e53656c..c705591b9 100644 --- a/commands/lsmmap.c +++ b/commands/lsmmap.c @@ -16,6 +16,7 @@ * along with GRUB. If not, see . */ +#include #include #include #include @@ -34,7 +35,7 @@ grub_cmd_lsmmap (struct grub_arg_list *state __attribute__ ((unused)), return 0; } grub_machine_mmap_iterate (hook); - + return 0; } diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index f52d61188..e12ca18a5 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -133,7 +133,7 @@ grub_pxefs_open (struct grub_file *file, const char *name) c.c1.server_ip = grub_pxe_server_ip; c.c1.gateway_ip = grub_pxe_gateway_ip; - grub_strcpy (c.c1.filename, name); + grub_strcpy ((char *)&c.c1.filename[0], name); grub_pxe_call (GRUB_PXENV_TFTP_GET_FSIZE, &c.c1); if (c.c1.status) return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); @@ -201,7 +201,7 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) o.server_ip = grub_pxe_server_ip; o.gateway_ip = grub_pxe_gateway_ip; - grub_strcpy (o.filename, data->filename); + grub_strcpy ((char *)&o.filename[0], data->filename); o.tftp_port = grub_cpu_to_be16 (GRUB_PXE_TFTP_PORT); o.packet_size = data->block_size; grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o); diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index c674ef312..ff5246d1b 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -231,5 +231,5 @@ GRUB_MOD_INIT(at_keyboard) GRUB_MOD_FINI(at_keyboard) { - grub_term_unregister_output (&grub_at_keyboard_term); + grub_term_unregister_input (&grub_at_keyboard_term); } From d72521b377002f4a73033e4d37692dbf8163f15e Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 28 Jan 2009 02:19:07 +0000 Subject: [PATCH 0502/1707] 2009-01-27 Pavel Roskin * disk/fs_uuid.c (search_fs_uuid): Ignore case of the UUID. --- ChangeLog | 4 ++++ disk/fs_uuid.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d995fbdb4..06ba821d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-01-27 Pavel Roskin + + * disk/fs_uuid.c (search_fs_uuid): Ignore case of the UUID. + 2009-01-27 Vesa Jääskeläinen * commands/lsmmap.c: Add include to grub/machine/memory.h. diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c index 27dffc2f6..125d29b21 100644 --- a/disk/fs_uuid.c +++ b/disk/fs_uuid.c @@ -52,7 +52,7 @@ search_fs_uuid (const char *key, unsigned long *count) { (*count)++; - if (grub_strcmp (uuid, key) == 0) + if (grub_strcasecmp (uuid, key) == 0) { ret = dev; grub_free (uuid); From 56192c234600473317ed40998d576703238293b6 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Fri, 30 Jan 2009 21:10:17 +0000 Subject: [PATCH 0503/1707] 2009-01-30 Christian Franke * normal/arg.c (grub_arg_show_help): Add indentation if '\n' appears in option help text. --- ChangeLog | 5 +++++ normal/arg.c | 17 ++++++++++++++--- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 06ba821d2..182d5535d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-30 Christian Franke + + * normal/arg.c (grub_arg_show_help): Add indentation if '\n' appears + in option help text. + 2009-01-27 Pavel Roskin * disk/fs_uuid.c (search_fs_uuid): Ignore case of the UUID. diff --git a/normal/arg.c b/normal/arg.c index 602f7eaff..52c11d3a2 100644 --- a/normal/arg.c +++ b/normal/arg.c @@ -156,10 +156,21 @@ grub_arg_show_help (grub_command_t cmd) } } - while (spacing-- > 0) - grub_putchar (' '); + const char *doc = opt->doc; + for (;;) + { + while (spacing-- > 0) + grub_putchar (' '); - grub_printf ("%s\n", opt->doc); + while (*doc && *doc != '\n') + grub_putchar (*doc++); + grub_putchar ('\n'); + + if (! *doc) + break; + doc++; + spacing = 4 + 20; + } switch (opt->shortarg) { From 6fa42fa65a8a6a7ffda9bf265937a181e052f4bc Mon Sep 17 00:00:00 2001 From: chaac Date: Sat, 31 Jan 2009 09:15:43 +0000 Subject: [PATCH 0504/1707] 2009-01-31 Colin D Bennett MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * normal/main.c: Add include to grub/menu_viewer.h. (free_menu_entry_classes): Added. (grub_normal_menu_addentry): Added class property handling. (grub_normal_execute): Changed to use new menu viewer for menu viewing. (GRUB_MOD_INIT(normal)): Added register for text based menu viewer. * normal/menu_viewer.c: New file. * normal/menu.c (run_menu_entry): Renamed to ... (grub_menu_execute_entry): ... this and made it as global. (grub_menu_run): Renamed to ... (show_text_menu): ... this and made it local. (show_text_menu): Adapt to new function names. (grub_normal_terminal_menu_viewer): New global variable. * include/grub/menu.h: New file. * include/grub/menu_viewer.h: New file. * include/grub/normal.h: Added include to grub/menu.h. (grub_menu_entry): Moved to include/grub/menu.h. (grub_menu_entry_t): Likewise. (grub_menu): Likewise. (grub_menu_t): Likewise. (grub_normal_terminal_menu_viewer): Added. (grub_menu_execute_entry): Likewise. (grub_menu_run): Removed. * DISTLIST: Added include/grub/menu.h. Added include/grub/menu_viewer.h. Added normal/menu_viewer.c. 2009-01-31 Vesa Jääskeläinen * normal/execute.c (grub_script_execute_menuentry): Changed to use arglist for menutitle arguments. * normal/main.c (grub_normal_menu_addentry): Likewise. * normal/parser.y (menuentry): Likewise. * normal/script.c (grub_script_create_cmdmenu): Likewise. * include/grub/script.h (grub_script_cmd_menuentry): Likewise. (grub_script_create_cmdmenu): Likewise. * include/grub/normal.h (grub_normal_menu_addentry): Likewise. * conf/i386-pc.rmk (normal_mod_SOURCES): Adapt Colin D Bennett's changes. * conf/x86_64-efi.rmk (normal_mod_SOURCES): Likewise. * conf/i386-coreboot.rmk (normal_mod_SOURCES): Likewise. * conf/i386-efi.rmk (normal_mod_SOURCES): Likewise. * conf/i386-ieee1275.rmk (normal_mod_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (normal_mod_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (normal_mod_SOURCES): Likewise. --- ChangeLog | 65 +++++++++++++++++++++ DISTLIST | 3 + conf/i386-coreboot.mk | 81 +++++++++++++++++--------- conf/i386-coreboot.rmk | 16 +++++- conf/i386-efi.mk | 83 +++++++++++++++++--------- conf/i386-efi.rmk | 18 ++++-- conf/i386-ieee1275.mk | 81 +++++++++++++++++--------- conf/i386-ieee1275.rmk | 16 +++++- conf/i386-pc.mk | 42 +++++++++++--- conf/i386-pc.rmk | 15 ++++- conf/powerpc-ieee1275.mk | 83 +++++++++++++++++--------- conf/powerpc-ieee1275.rmk | 18 ++++-- conf/sparc64-ieee1275.mk | 103 ++++++++++++++++++++++++--------- conf/sparc64-ieee1275.rmk | 19 ++++-- conf/x86_64-efi.mk | 83 +++++++++++++++++--------- conf/x86_64-efi.rmk | 18 ++++-- include/grub/menu.h | 63 ++++++++++++++++++++ include/grub/menu_viewer.h | 43 ++++++++++++++ include/grub/normal.h | 37 ++---------- include/grub/script.h | 8 +-- normal/execute.c | 57 ++++++++++++------ normal/main.c | 115 +++++++++++++++++++++++++++++++++++-- normal/menu.c | 93 ++++++++++++++++-------------- normal/menu_viewer.c | 63 ++++++++++++++++++++ normal/parser.y | 4 +- normal/script.c | 8 +-- 26 files changed, 934 insertions(+), 301 deletions(-) create mode 100644 include/grub/menu.h create mode 100644 include/grub/menu_viewer.h create mode 100644 normal/menu_viewer.c diff --git a/ChangeLog b/ChangeLog index 182d5535d..3b5b949c0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,68 @@ +2009-01-31 Colin D Bennett + + * normal/main.c: Add include to grub/menu_viewer.h. + (free_menu_entry_classes): Added. + (grub_normal_menu_addentry): Added class property handling. + (grub_normal_execute): Changed to use new menu viewer for menu viewing. + (GRUB_MOD_INIT(normal)): Added register for text based menu viewer. + + * normal/menu_viewer.c: New file. + + * normal/menu.c (run_menu_entry): Renamed to ... + (grub_menu_execute_entry): ... this and made it as global. + (grub_menu_run): Renamed to ... + (show_text_menu): ... this and made it local. + (show_text_menu): Adapt to new function names. + (grub_normal_terminal_menu_viewer): New global variable. + + * include/grub/menu.h: New file. + + * include/grub/menu_viewer.h: New file. + + * include/grub/normal.h: Added include to grub/menu.h. + (grub_menu_entry): Moved to include/grub/menu.h. + (grub_menu_entry_t): Likewise. + (grub_menu): Likewise. + (grub_menu_t): Likewise. + (grub_normal_terminal_menu_viewer): Added. + (grub_menu_execute_entry): Likewise. + (grub_menu_run): Removed. + + * DISTLIST: Added include/grub/menu.h. + Added include/grub/menu_viewer.h. + Added normal/menu_viewer.c. + +2009-01-31 Vesa Jääskeläinen + + * normal/execute.c (grub_script_execute_menuentry): Changed to use + arglist for menutitle arguments. + + * normal/main.c (grub_normal_menu_addentry): Likewise. + + * normal/parser.y (menuentry): Likewise. + + * normal/script.c (grub_script_create_cmdmenu): Likewise. + + * include/grub/script.h (grub_script_cmd_menuentry): Likewise. + (grub_script_create_cmdmenu): Likewise. + + * include/grub/normal.h (grub_normal_menu_addentry): Likewise. + + * conf/i386-pc.rmk (normal_mod_SOURCES): Adapt Colin D Bennett's + changes. + + * conf/x86_64-efi.rmk (normal_mod_SOURCES): Likewise. + + * conf/i386-coreboot.rmk (normal_mod_SOURCES): Likewise. + + * conf/i386-efi.rmk (normal_mod_SOURCES): Likewise. + + * conf/i386-ieee1275.rmk (normal_mod_SOURCES): Likewise. + + * conf/powerpc-ieee1275.rmk (normal_mod_SOURCES): Likewise. + + * conf/sparc64-ieee1275.rmk (normal_mod_SOURCES): Likewise. + 2009-01-30 Christian Franke * normal/arg.c (grub_arg_show_help): Add indentation if '\n' appears diff --git a/DISTLIST b/DISTLIST index 521aec475..5e31c5989 100644 --- a/DISTLIST +++ b/DISTLIST @@ -152,6 +152,8 @@ include/grub/hfs.h include/grub/kernel.h include/grub/loader.h include/grub/lvm.h +include/grub/menu.h +include/grub/menu_viewer.h include/grub/misc.h include/grub/mm.h include/grub/multiboot.h @@ -391,6 +393,7 @@ normal/lexer.c normal/main.c normal/menu.c normal/menu_entry.c +normal/menu_viewer.c normal/misc.c normal/parser.y normal/script.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 1689f6d78..9665117ec 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -696,18 +696,28 @@ partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S normal/color.c -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o und-normal.lst + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d normal_mod-normal_color.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -716,9 +726,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -906,6 +916,44 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_color.d + +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst +COMMANDFILES += cmd-normal_mod-normal_color.lst +FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst + +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_viewer.d + +CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst +COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst +FSFILES += fs-normal_mod-normal_menu_viewer.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst + +cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -1001,25 +1049,6 @@ partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/se set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index ac9ea8f74..591ea74c8 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -111,12 +111,22 @@ linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S normal/color.c + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index f9d7c1b82..ccd6ac7d9 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -731,18 +731,28 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S normal/color.c -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o und-normal.lst + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d normal_mod-normal_color.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -751,9 +761,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -941,6 +951,44 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_color.d + +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst +COMMANDFILES += cmd-normal_mod-normal_color.lst +FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst + +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_viewer.d + +CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst +COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst +FSFILES += fs-normal_mod-normal_menu_viewer.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst + +cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -1036,25 +1084,6 @@ partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/se set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index c13a3a789..0ab02f653 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -108,12 +108,22 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S normal/color.c + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 5923b6f02..26dda9028 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -590,18 +590,28 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod lsmmap.mod -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S normal/color.c -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o und-normal.lst + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d normal_mod-normal_color.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -610,9 +620,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o normal_mod-normal_color.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -800,6 +810,44 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_color.d + +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst +COMMANDFILES += cmd-normal_mod-normal_color.lst +FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst + +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_viewer.d + +CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst +COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst +FSFILES += fs-normal_mod-normal_menu_viewer.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst + +cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -895,25 +943,6 @@ partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/se set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index ce11a257b..3e75b2781 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -101,12 +101,22 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod lsmmap.mod -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S normal/color.c + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 5297fa6b3..4482329b3 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1216,19 +1216,28 @@ partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/color.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -1237,9 +1246,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -1446,6 +1455,25 @@ partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIE set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_viewer.d + +CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst +COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst +FSFILES += fs-normal_mod-normal_menu_viewer.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst + +cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 099825277..1b9cc214c 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -191,13 +191,22 @@ linux_mod_SOURCES = loader/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/color.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/i386/setjmp.S + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/i386/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index c98197d04..038d44988 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -704,18 +704,28 @@ partmap-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1 linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/powerpc/setjmp.S normal/color.c -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o normal_mod-normal_color.o und-normal.lst + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/powerpc/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d normal_mod-normal_color.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -724,9 +734,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o normal_mod-normal_color.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o normal_mod-normal_color.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -914,6 +924,44 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_color.d + +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst +COMMANDFILES += cmd-normal_mod-normal_color.lst +FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst + +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_viewer.d + +CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst +COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst +FSFILES += fs-normal_mod-normal_menu_viewer.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst + +cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -1009,28 +1057,9 @@ partmap-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/p set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) +normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For suspend.mod suspend_mod_SOURCES = commands/ieee1275/suspend.c diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index f22540f0a..7f5425472 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -121,15 +121,25 @@ linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/powerpc/setjmp.S normal/color.c + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/powerpc/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) +normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For suspend.mod suspend_mod_SOURCES = commands/ieee1275/suspend.c diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 901b62649..a9033a530 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -781,19 +781,28 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) #linux_mod_CFLAGS = $(COMMON_CFLAGS) #linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c normal/script.c \ - normal/sparc64/setjmp.S \ - grub_script.tab.c -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o und-normal.lst + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/sparc64/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d normal_mod-grub_script_tab.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -802,9 +811,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o normal_mod-grub_script_tab.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -992,6 +1001,44 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_color.d + +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst +COMMANDFILES += cmd-normal_mod-normal_color.lst +FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst + +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_viewer.d + +CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst +COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst +FSFILES += fs-normal_mod-normal_menu_viewer.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst + +cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -1030,6 +1077,25 @@ partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) + $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-grub_script_tab.d + +CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst +COMMANDFILES += cmd-normal_mod-grub_script_tab.lst +FSFILES += fs-normal_mod-grub_script_tab.lst +PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst + +cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_script.d @@ -1068,25 +1134,6 @@ partmap-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/s set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index f658ac249..17dd175e0 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -154,13 +154,22 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) #linux_mod_CFLAGS = $(COMMON_CFLAGS) #linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c normal/script.c \ - normal/sparc64/setjmp.S \ - grub_script.tab.c + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/sparc64/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index ca8d6cdd7..3f5e0b553 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -738,18 +738,28 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/x86_64/setjmp.S normal/color.c -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o normal_mod-normal_color.o und-normal.lst + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/x86_64/setjmp.S +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d normal_mod-normal_color.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -758,9 +768,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o normal_mod-normal_color.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o normal_mod-normal_color.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -948,6 +958,44 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_color.d + +CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst +COMMANDFILES += cmd-normal_mod-normal_color.lst +FSFILES += fs-normal_mod-normal_color.lst +PARTMAPFILES += partmap-normal_mod-normal_color.lst + +cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + +normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_viewer.d + +CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst +COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst +FSFILES += fs-normal_mod-normal_menu_viewer.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst + +cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_menu_entry.d @@ -1043,25 +1091,6 @@ partmap-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86 set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index a1b94b664..eb7f6d177 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -110,12 +110,22 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# For normal.mod. +# +# Only arch dependant part of normal.mod will be here. Common part for +# all architecures of normal.mod is at start and should be kept at sync +# with other makefiles. +# +# Please put arch dependant part of normal.mod at the end of list to +# keep it simpler to update to different architectures. +# normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c grub_script.tab.c \ - normal/script.c normal/x86_64/setjmp.S normal/color.c + normal/color.c \ + normal/menu_viewer.c normal/menu_entry.c \ + normal/misc.c grub_script.tab.c \ + normal/script.c \ + normal/x86_64/setjmp.S normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/menu.h b/include/grub/menu.h new file mode 100644 index 000000000..6850846b4 --- /dev/null +++ b/include/grub/menu.h @@ -0,0 +1,63 @@ +/* menu.h - Menu and menu entry model declarations. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MENU_HEADER +#define GRUB_MENU_HEADER 1 + +struct grub_menu_entry_class +{ + char *name; + struct grub_menu_entry_class *next; +}; + +/* The menu entry. */ +struct grub_menu_entry +{ + /* The title name. */ + const char *title; + + /* The classes associated with the menu entry: + used to choose an icon or other style attributes. + This is a dummy head node for the linked list, so for an entry E, + E.classes->next is the first class if it is not NULL. */ + struct grub_menu_entry_class *classes; + + /* The commands associated with this menu entry. */ + struct grub_script *commands; + + /* The sourcecode of the menu entry, used by the editor. */ + const char *sourcecode; + + /* The next element. */ + struct grub_menu_entry *next; +}; +typedef struct grub_menu_entry *grub_menu_entry_t; + +/* The menu. */ +struct grub_menu +{ + /* The size of a menu. */ + int size; + + /* The list of menu entries. */ + grub_menu_entry_t entry_list; +}; +typedef struct grub_menu *grub_menu_t; + +#endif /* GRUB_MENU_HEADER */ diff --git a/include/grub/menu_viewer.h b/include/grub/menu_viewer.h new file mode 100644 index 000000000..725c97548 --- /dev/null +++ b/include/grub/menu_viewer.h @@ -0,0 +1,43 @@ +/* menu_viewer.h - Interface to menu viewer implementations. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MENU_VIEWER_HEADER +#define GRUB_MENU_VIEWER_HEADER 1 + +#include +#include +#include +#include + +struct grub_menu_viewer +{ + /* The menu viewer name. */ + const char *name; + + grub_err_t (*show_menu) (grub_menu_t menu, int nested); + + struct grub_menu_viewer *next; +}; +typedef struct grub_menu_viewer *grub_menu_viewer_t; + +void grub_menu_viewer_register (grub_menu_viewer_t viewer); + +grub_err_t grub_menu_viewer_show_menu (grub_menu_t menu, int nested); + +#endif /* GRUB_MENU_VIEWER_HEADER */ diff --git a/include/grub/normal.h b/include/grub/normal.h index 544a95787..8cb715bbe 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -1,7 +1,7 @@ /* normal.h - prototypes for the normal mode */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -25,6 +25,7 @@ #include #include #include +#include /* The maximum size of a command-line. */ #define GRUB_MAX_CMDLINE 1600 @@ -84,34 +85,6 @@ struct grub_command }; typedef struct grub_command *grub_command_t; -/* The menu entry. */ -struct grub_menu_entry -{ - /* The title name. */ - const char *title; - - /* The commands associated with this menu entry. */ - struct grub_script *commands; - - /* The sourcecode of the menu entry, used by the editor. */ - const char *sourcecode; - - /* The next element. */ - struct grub_menu_entry *next; -}; -typedef struct grub_menu_entry *grub_menu_entry_t; - -/* The menu. */ -struct grub_menu -{ - /* The size of a menu. */ - int size; - - /* The list of menu entries. */ - grub_menu_entry_t entry_list; -}; -typedef struct grub_menu *grub_menu_t; - /* This is used to store the names of filesystem modules for auto-loading. */ struct grub_fs_module_list { @@ -123,10 +96,12 @@ typedef struct grub_fs_module_list *grub_fs_module_list_t; /* To exit from the normal mode. */ extern grub_jmp_buf grub_exit_env; +extern struct grub_menu_viewer grub_normal_terminal_menu_viewer; + void grub_enter_normal_mode (const char *config); void grub_normal_execute (const char *config, int nested); -void grub_menu_run (grub_menu_t menu, int nested); void grub_menu_entry_run (grub_menu_entry_t entry); +void grub_menu_execute_entry(grub_menu_entry_t entry); void grub_cmdline_run (int nested); int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, int echo_char, int readline); @@ -152,7 +127,7 @@ void grub_arg_show_help (grub_command_t cmd); char *grub_normal_do_completion (char *buf, int *restore, void (*hook) (const char *item, grub_completion_type_t type, int count)); grub_err_t grub_normal_print_device_info (const char *name); -grub_err_t grub_normal_menu_addentry (const char *title, +grub_err_t grub_normal_menu_addentry (int argc, const char **args, struct grub_script *script, const char *sourcecode); char *grub_env_write_color_normal (struct grub_env_var *var, const char *val); diff --git a/include/grub/script.h b/include/grub/script.h index 5218d1352..4d18b9266 100644 --- a/include/grub/script.h +++ b/include/grub/script.h @@ -1,7 +1,7 @@ /* script.h */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -113,8 +113,8 @@ struct grub_script_cmd_menuentry { struct grub_script_cmd cmd; - /* The title of the menu entry. */ - struct grub_script_arg *title; + /* The arguments for this menu entry. */ + struct grub_script_arglist *arglist; /* The sourcecode the entry will be generated from. */ const char *sourcecode; @@ -204,7 +204,7 @@ grub_script_create_cmdif (struct grub_parser_param *state, struct grub_script_cmd * grub_script_create_cmdmenu (struct grub_parser_param *state, - struct grub_script_arg *title, + struct grub_script_arglist *arglist, char *sourcecode, int options); diff --git a/normal/execute.c b/normal/execute.c index 4211cad93..35b7a4be1 100644 --- a/normal/execute.c +++ b/normal/execute.c @@ -1,7 +1,7 @@ /* execute.c -- Execute a GRUB script. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -148,11 +148,11 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) parser = (struct grub_arg_option *) grubcmd->options; while (parser && (parser++)->doc) maxargs++; - + /* Set up the option state. */ state = grub_malloc (sizeof (struct grub_arg_list) * maxargs); grub_memset (state, 0, sizeof (struct grub_arg_list) * maxargs); - + /* Start the command. */ if (! (grubcmd->flags & GRUB_COMMAND_FLAG_NO_ARG_PARSE)) { @@ -161,7 +161,7 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) } else ret = (grubcmd->func) (state, argcount, args); - + grub_free (state); } else @@ -178,7 +178,7 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) return ret; } -/* Execute a block of one or more commands. */ +/* Execute a block of one or more commands. */ grub_err_t grub_script_execute_cmdblock (struct grub_script_cmd *cmd) { @@ -216,32 +216,53 @@ grub_err_t grub_script_execute_menuentry (struct grub_script_cmd *cmd) { struct grub_script_cmd_menuentry *cmd_menuentry; - char *title; + struct grub_script_arglist *arglist; struct grub_script *script; + char **args = 0; + int argcount = 0; + int i = 0; cmd_menuentry = (struct grub_script_cmd_menuentry *) cmd; - /* The title can contain variables, parse them and generate a string - from it. */ - title = grub_script_execute_argument_to_string (cmd_menuentry->title); - if (! title) - return grub_errno; + if (cmd_menuentry->arglist) + { + argcount = cmd_menuentry->arglist->argcount; + + /* Create argv from the arguments. */ + args = grub_malloc (sizeof (char *) * argcount); + + if (! args) + { + return grub_errno; + } + + for (arglist = cmd_menuentry->arglist; arglist; arglist = arglist->next) + { + char *str; + str = grub_script_execute_argument_to_string (arglist->arg); + args[i++] = str; + } + } /* Parse the menu entry *again*. */ script = grub_script_parse ((char *) cmd_menuentry->sourcecode, 0); - if (! script) + /* Add new menu entry. */ + if (script) { - grub_free (title); - return grub_errno; + grub_normal_menu_addentry (argcount, (const char **)args, + script, cmd_menuentry->sourcecode); } - /* XXX: When this fails, the memory should be freed? */ - return grub_normal_menu_addentry (title, script, - cmd_menuentry->sourcecode); + /* Free arguments. */ + for (i = 0; i < argcount; i++) + grub_free (args[i]); + grub_free (args); + + return grub_errno; } - + /* Execute any GRUB pre-parsed command or script. */ grub_err_t diff --git a/normal/main.c b/normal/main.c index 2e6df90ea..09d17b26d 100644 --- a/normal/main.c +++ b/normal/main.c @@ -1,7 +1,7 @@ /* main.c - the normal mode main routine */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,7 @@ #include #include #include +#include grub_jmp_buf grub_exit_env; @@ -147,14 +148,41 @@ free_menu (grub_menu_t menu) grub_env_unset_data_slot ("menu"); } +static void +free_menu_entry_classes (struct grub_menu_entry_class *head) +{ + /* Free all the classes. */ + while (head) + { + struct grub_menu_entry_class *next; + + grub_free (head->name); + next = head->next; + grub_free (head); + head = next; + } +} + grub_err_t -grub_normal_menu_addentry (const char *title, struct grub_script *script, +grub_normal_menu_addentry (int argc, const char **args, struct grub_script *script, const char *sourcecode) { - const char *menutitle; + const char *menutitle = 0; const char *menusourcecode; grub_menu_t menu; grub_menu_entry_t *last; + int failed = 0; + int i; + struct grub_menu_entry_class *classes_head; /* Dummy head node for list. */ + struct grub_menu_entry_class *classes_tail; + + /* Allocate dummy head node for class list. */ + classes_head = grub_malloc (sizeof (struct grub_menu_entry_class)); + if (! classes_head) + return grub_errno; + classes_head->name = 0; + classes_head->next = 0; + classes_tail = classes_head; menu = grub_env_get_data_slot("menu"); if (! menu) @@ -166,10 +194,81 @@ grub_normal_menu_addentry (const char *title, struct grub_script *script, if (! menusourcecode) return grub_errno; - menutitle = grub_strdup (title); - if (! menutitle) + /* Parse menu arguments. */ + for (i = 0; i < argc; i++) { + /* Capture arguments. */ + if (grub_strncmp ("--", args[i], 2) == 0) + { + const char *arg = &args[i][2]; + + /* Handle menu class. */ + if (grub_strcmp(arg, "class") == 0) + { + char *class_name; + struct grub_menu_entry_class *new_class; + + i++; + class_name = grub_strdup (args[i]); + if (! class_name) + { + failed = 1; + break; + } + + /* Create a new class and add it at the tail of the list. */ + new_class = grub_malloc (sizeof (struct grub_menu_entry_class)); + if (! new_class) + { + grub_free (class_name); + failed = 1; + break; + } + /* Fill in the new class node. */ + new_class->name = class_name; + new_class->next = 0; + /* Link the tail to it, and make it the new tail. */ + classes_tail->next = new_class; + classes_tail = new_class; + continue; + } + else + { + /* Handle invalid argument. */ + failed = 1; + grub_error (GRUB_ERR_MENU, "invalid argument for menuentry: %s", args[i]); + break; + } + } + + /* Capture title. */ + if (! menutitle) + { + menutitle = grub_strdup (args[i]); + } + else + { + failed = 1; + grub_error (GRUB_ERR_MENU, "too many titles for menuentry: %s", args[i]); + break; + } + } + + /* Validate arguments. */ + if ((! failed) && (! menutitle)) + { + grub_error (GRUB_ERR_MENU, "menuentry is missing title"); + failed = 1; + } + + /* If argument parsing failed, free any allocated resources. */ + if (failed) + { + free_menu_entry_classes (classes_head); + grub_free ((void *) menutitle); grub_free ((void *) menusourcecode); + + /* Here we assume that grub_error has been used to specify failure details. */ return grub_errno; } @@ -180,6 +279,7 @@ grub_normal_menu_addentry (const char *title, struct grub_script *script, *last = grub_malloc (sizeof (**last)); if (! *last) { + free_menu_entry_classes (classes_head); grub_free ((void *) menutitle); grub_free ((void *) menusourcecode); return grub_errno; @@ -187,6 +287,7 @@ grub_normal_menu_addentry (const char *title, struct grub_script *script, (*last)->commands = script; (*last)->title = menutitle; + (*last)->classes = classes_head; (*last)->next = 0; (*last)->sourcecode = menusourcecode; @@ -476,7 +577,7 @@ grub_normal_execute (const char *config, int nested) if (menu && menu->size) { - grub_menu_run (menu, nested); + grub_menu_viewer_show_menu (menu, nested); if (nested) free_menu (menu); } @@ -519,6 +620,8 @@ GRUB_MOD_INIT(normal) if (mod) grub_dl_ref (mod); + grub_menu_viewer_register (&grub_normal_terminal_menu_viewer); + grub_set_history (GRUB_DEFAULT_HISTORY_SIZE); /* Register a command "normal" for the rescue mode. */ diff --git a/normal/menu.c b/normal/menu.c index 7dd5300be..b4fec26f0 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -24,6 +24,7 @@ #include #include #include +#include static grub_uint8_t grub_color_menu_normal; static grub_uint8_t grub_color_menu_highlight; @@ -41,9 +42,9 @@ static void draw_border (void) { unsigned i; - + grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); - + grub_gotoxy (GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y); grub_putcode (GRUB_TERM_DISP_UL); for (i = 0; i < (unsigned) GRUB_TERM_BORDER_WIDTH - 2; i++) @@ -97,7 +98,7 @@ print_message (int nested, int edit) grub_printf ("\n\ ESC to return previous menu."); } - + } static grub_menu_entry_t @@ -128,7 +129,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry) if (! unicode_title) /* XXX How to show this error? */ return; - + len = grub_utf8_to_ucs4 (unicode_title, title_len, (grub_uint8_t *) title, -1, 0); if (len < 0) @@ -157,7 +158,7 @@ print_entry (int y, int highlight, grub_menu_entry_t entry) grub_ssize_t width; width = grub_getcharwidth (unicode_title[i]); - + if (x + width > (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH - GRUB_TERM_MARGIN - 1)) grub_putcode (GRUB_TERM_DISP_RIGHT); @@ -187,7 +188,7 @@ print_entries (grub_menu_t menu, int first, int offset) { grub_menu_entry_t e; int i; - + grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH, GRUB_TERM_FIRST_ENTRY_Y); @@ -248,13 +249,13 @@ get_timeout (void) { char *val; int timeout; - + val = grub_env_get ("timeout"); if (! val) return -1; - + grub_error_push (); - + timeout = (int) grub_strtoul (val, 0, 0); /* If the value is invalid, unset the variable. */ @@ -266,7 +267,7 @@ get_timeout (void) } grub_error_pop (); - + return timeout; } @@ -278,7 +279,7 @@ set_timeout (int timeout) if (timeout > 0) { char buf[16]; - + grub_sprintf (buf, "%d", timeout); grub_env_set ("timeout", buf); } @@ -290,13 +291,13 @@ get_entry_number (const char *name) { char *val; int entry; - + val = grub_env_get (name); if (! val) return -1; - + grub_error_push (); - + entry = (int) grub_strtoul (val, 0, 0); if (grub_errno != GRUB_ERR_NONE) @@ -306,7 +307,7 @@ get_entry_number (const char *name) } grub_error_pop (); - + return entry; } @@ -317,7 +318,7 @@ print_timeout (int timeout, int offset, int second_stage) They are required to clear the line. */ char *msg = " The highlighted entry will be booted automatically in %ds. "; char *msg_end = grub_strchr (msg, '%'); - + grub_gotoxy (second_stage ? (msg_end - msg) : 0, GRUB_TERM_HEIGHT - 3); grub_printf (second_stage ? msg_end : msg, timeout); grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); @@ -331,9 +332,9 @@ run_menu (grub_menu_t menu, int nested) grub_uint64_t saved_time; int default_entry; int timeout; - + first = 0; - + default_entry = get_entry_number ("default"); /* If DEFAULT_ENTRY is not within the menu entries, fall back to @@ -370,7 +371,7 @@ run_menu (grub_menu_t menu, int nested) { int c; timeout = get_timeout (); - + if (timeout > 0) { grub_uint64_t current_time; @@ -390,11 +391,11 @@ run_menu (grub_menu_t menu, int nested) grub_env_unset ("timeout"); return default_entry; } - + if (grub_checkkey () >= 0 || timeout < 0) { c = GRUB_TERM_ASCII_CHAR (grub_getkey ()); - + if (timeout >= 0) { grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); @@ -404,7 +405,7 @@ run_menu (grub_menu_t menu, int nested) grub_env_unset ("fallback"); grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); } - + switch (c) { case GRUB_TERM_HOME: @@ -439,7 +440,7 @@ run_menu (grub_menu_t menu, int nested) print_entries (menu, first, offset); } break; - + case GRUB_TERM_DOWN: case 'v': if (menu->size > first + offset + 1) @@ -459,7 +460,7 @@ run_menu (grub_menu_t menu, int nested) } } break; - + case GRUB_TERM_PPAGE: if (first == 0) { @@ -490,12 +491,12 @@ run_menu (grub_menu_t menu, int nested) else { first += GRUB_TERM_NUM_ENTRIES; - + if (first + offset >= menu->size) { first -= GRUB_TERM_NUM_ENTRIES; offset += GRUB_TERM_NUM_ENTRIES; - + if (offset > menu->size - 1 || offset > GRUB_TERM_NUM_ENTRIES - 1) { @@ -510,13 +511,13 @@ run_menu (grub_menu_t menu, int nested) } print_entries (menu, first, offset); break; - + case '\n': case '\r': case 6: grub_setcursor (1); return first + offset; - + case '\e': if (nested) { @@ -524,7 +525,7 @@ run_menu (grub_menu_t menu, int nested) return -1; } break; - + case 'c': grub_cmdline_run (1); goto refresh; @@ -536,11 +537,11 @@ run_menu (grub_menu_t menu, int nested) grub_menu_entry_run (e); } goto refresh; - + default: break; } - + grub_refresh (); } } @@ -550,25 +551,25 @@ run_menu (grub_menu_t menu, int nested) } /* Run a menu entry. */ -static void -run_menu_entry (grub_menu_entry_t entry) +void +grub_menu_execute_entry(grub_menu_entry_t entry) { grub_script_execute (entry->commands); - + if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ()) /* Implicit execution of boot, only if something is loaded. */ grub_command_execute ("boot", 0); } -void -grub_menu_run (grub_menu_t menu, int nested) +static grub_err_t +show_text_menu (grub_menu_t menu, int nested) { while (1) { int boot_entry; grub_menu_entry_t e; int fallback_entry; - + boot_entry = run_menu (menu, nested); if (boot_entry < 0) break; @@ -576,13 +577,13 @@ grub_menu_run (grub_menu_t menu, int nested) e = get_entry (menu, boot_entry); if (! e) continue; /* Menu is empty. */ - + grub_cls (); grub_setcursor (1); grub_printf (" Booting \'%s\'\n\n", e->title); - - run_menu_entry (e); + + grub_menu_execute_entry (e); /* Deal with a fallback entry. */ /* FIXME: Multiple fallback entries like GRUB Legacy. */ @@ -591,11 +592,11 @@ grub_menu_run (grub_menu_t menu, int nested) { grub_print_error (); grub_errno = GRUB_ERR_NONE; - + e = get_entry (menu, fallback_entry); grub_env_unset ("fallback"); grub_printf ("\n Falling back to \'%s\'\n\n", e->title); - run_menu_entry (e); + grub_menu_execute_entry (e); } if (grub_errno != GRUB_ERR_NONE) @@ -606,4 +607,12 @@ grub_menu_run (grub_menu_t menu, int nested) grub_wait_after_message (); } } + + return GRUB_ERR_NONE; } + +struct grub_menu_viewer grub_normal_terminal_menu_viewer = +{ + .name = "terminal", + .show_menu = show_text_menu +}; diff --git a/normal/menu_viewer.c b/normal/menu_viewer.c new file mode 100644 index 000000000..f7047c7fc --- /dev/null +++ b/normal/menu_viewer.c @@ -0,0 +1,63 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +/* The list of menu viewers. */ +static grub_menu_viewer_t menu_viewer_list; + +void +grub_menu_viewer_register (grub_menu_viewer_t viewer) +{ + viewer->next = menu_viewer_list; + menu_viewer_list = viewer; +} + +static grub_menu_viewer_t get_current_menu_viewer (void) +{ + const char *selected_name = grub_env_get ("menuviewer"); + + /* If none selected, pick the last registered one. */ + if (selected_name == 0) + return menu_viewer_list; + + grub_menu_viewer_t cur; + for (cur = menu_viewer_list; cur; cur = cur->next) + { + if (grub_strcmp (cur->name, selected_name) == 0) + return cur; + } + + /* Fall back to the first entry (or null). */ + return menu_viewer_list; +} + +grub_err_t +grub_menu_viewer_show_menu (grub_menu_t menu, int nested) +{ + grub_menu_viewer_t cur = get_current_menu_viewer (); + if (!cur) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "No menu viewer available."); + + return cur->show_menu (menu, nested); +} + diff --git a/normal/parser.y b/normal/parser.y index f3525927b..ea62b6434 100644 --- a/normal/parser.y +++ b/normal/parser.y @@ -1,7 +1,7 @@ /* parser.y - The scripting parser. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -204,7 +204,7 @@ commandblock: '{' ; /* A menu entry. Carefully save the memory that is allocated. */ -menuentry: "menuentry" argument +menuentry: "menuentry" arguments { grub_script_lexer_ref (state->lexerstate); } newlines '{' diff --git a/normal/script.c b/normal/script.c index 5169e4949..0d5d5a8b7 100644 --- a/normal/script.c +++ b/normal/script.c @@ -1,7 +1,7 @@ /* script.c -- Functions to create an in memory description of the script. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -206,7 +206,7 @@ grub_script_create_cmdif (struct grub_parser_param *state, The options for this entry are passed in OPTIONS. */ struct grub_script_cmd * grub_script_create_cmdmenu (struct grub_parser_param *state, - struct grub_script_arg *title, + struct grub_script_arglist *arglist, char *sourcecode, int options) { @@ -232,9 +232,9 @@ grub_script_create_cmdmenu (struct grub_parser_param *state, cmd->cmd.next = 0; /* XXX: Check if this memory is properly freed. */ cmd->sourcecode = sourcecode; - cmd->title = title; + cmd->arglist = arglist; cmd->options = options; - + return (struct grub_script_cmd *) cmd; } From a69ef770ffd214f8dc48f9ed3b7643010407e85c Mon Sep 17 00:00:00 2001 From: chaac Date: Sun, 1 Feb 2009 09:03:15 +0000 Subject: [PATCH 0505/1707] =?UTF-8?q?2009-02-01=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Based on patch on bug #25318 created by Bernhard Rosenkraenzer . * normal/parser.y (script_init): Add missing semicolon. --- ChangeLog | 7 +++++++ normal/parser.y | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3b5b949c0..aff9db8ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-01 Vesa Jääskeläinen + + Based on patch on bug #25318 created by Bernhard Rosenkraenzer + . + + * normal/parser.y (script_init): Add missing semicolon. + 2009-01-31 Colin D Bennett * normal/main.c: Add include to grub/menu_viewer.h. diff --git a/normal/parser.y b/normal/parser.y index ea62b6434..eaf400b45 100644 --- a/normal/parser.y +++ b/normal/parser.y @@ -56,7 +56,7 @@ %% /* It should be possible to do this in a clean way... */ -script_init: { state->err = 0} script +script_init: { state->err = 0; } script { state->parsed = $2; } From 825a182b6a319ad152648d99c5aee457ca8d2652 Mon Sep 17 00:00:00 2001 From: chaac Date: Sun, 1 Feb 2009 09:33:29 +0000 Subject: [PATCH 0506/1707] =?UTF-8?q?2009-02-01=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Base on patch on bug #24154 created by Tomas Tintera . * video/i386/pc/vbe.c (grub_video_vbe_scroll): Fix downward scrolling. --- ChangeLog | 7 +++++++ video/i386/pc/vbe.c | 30 +++++++++++++++++++++--------- 2 files changed, 28 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index aff9db8ea..f9154b292 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-01 Vesa Jääskeläinen + + Base on patch on bug #24154 created by Tomas Tintera + . + + * video/i386/pc/vbe.c (grub_video_vbe_scroll): Fix downward scrolling. + 2009-02-01 Vesa Jääskeläinen Based on patch on bug #25318 created by Bernhard Rosenkraenzer diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index 7f1cb9d90..7de37e914 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -709,7 +709,7 @@ grub_video_vbe_map_rgb (grub_uint8_t red, grub_uint8_t green, return minindex; } - else if ((render_target->mode_info.mode_type + else if ((render_target->mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) { if (red == render_target->mode_info.fg_red @@ -749,7 +749,7 @@ grub_video_vbe_map_rgba (grub_uint8_t red, grub_uint8_t green, /* No alpha available in index color modes, just use same value as in only RGB modes. */ return grub_video_vbe_map_rgb (red, green, blue); - else if ((render_target->mode_info.mode_type + else if ((render_target->mode_info.mode_type & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) { if (red == render_target->mode_info.fg_red @@ -1399,13 +1399,25 @@ grub_video_vbe_scroll (grub_video_color_t color, int dx, int dy) target.mode_info = &render_target->mode_info; target.data = render_target->data; - for (j = 0; j < height; j++) - { - dst = grub_video_vbe_get_video_ptr (&target, dst_x, dst_y + j); - src = grub_video_vbe_get_video_ptr (&target, src_x, src_y + j); - grub_memmove (dst, src, - width * target.mode_info->bytes_per_pixel); - } + /* Check vertical direction of the move. */ + if (dy <= 0) + /* 3a. Move data upwards. */ + for (j = 0; j < height; j++) + { + dst = grub_video_vbe_get_video_ptr (&target, dst_x, dst_y + j); + src = grub_video_vbe_get_video_ptr (&target, src_x, src_y + j); + grub_memmove (dst, src, + width * target.mode_info->bytes_per_pixel); + } + else + /* 3b. Move data downwards. */ + for (j = (height - 1); j >= 0; j--) + { + dst = grub_video_vbe_get_video_ptr (&target, dst_x, dst_y + j); + src = grub_video_vbe_get_video_ptr (&target, src_x, src_y + j); + grub_memmove (dst, src, + width * target.mode_info->bytes_per_pixel); + } } /* 4. Fill empty space with specified color. In this implementation From de3aa260797857d439323b8ed394d4a37af19ae6 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 1 Feb 2009 16:17:32 +0000 Subject: [PATCH 0507/1707] 2009-02-01 Felix Zielcke * INSTALL: Note that we now require at least autconf 2.59 and that LZO is optional. --- ChangeLog | 5 +++++ INSTALL | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f9154b292..ce45490ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-01 Felix Zielcke + + * INSTALL: Note that we now require at least autconf 2.59 and that LZO + is optional. + 2009-02-01 Vesa Jääskeläinen Base on patch on bug #24154 created by Tomas Tintera diff --git a/INSTALL b/INSTALL index d55324e56..e2b7c00e3 100644 --- a/INSTALL +++ b/INSTALL @@ -16,12 +16,12 @@ configuring the GRUB. * GNU Bison * GNU binutils 2.9.1.0.23 or later * Other standard GNU/Unix tools -* LZO 1.02 or later +* LZO 1.02 or later (optional) If you'd like to develop GRUB, these below are also required. * Ruby 1.6 or later -* Autoconf 2.53 or later +* Autoconf 2.59 or later Configuring the GRUB ==================== From b4315fb069a0fc6294acc4964e323aba8ddc5b88 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Mon, 2 Feb 2009 19:43:14 +0000 Subject: [PATCH 0508/1707] 2009-02-02 Christian Franke * lib/hexdump.c (hexdump): Print at most 3 lines if data is identical. --- ChangeLog | 4 ++++ lib/hexdump.c | 16 ++++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index ce45490ed..53ba5e67b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-02 Christian Franke + + * lib/hexdump.c (hexdump): Print at most 3 lines if data is identical. + 2009-02-01 Felix Zielcke * INSTALL: Note that we now require at least autconf 2.59 and that LZO diff --git a/lib/hexdump.c b/lib/hexdump.c index 9b79f45b8..c69cb093b 100644 --- a/lib/hexdump.c +++ b/lib/hexdump.c @@ -61,6 +61,22 @@ hexdump (unsigned long bse, char *buf, int len) grub_printf ("%s\n", line); + /* Print only first and last line if more than 3 lines are identical. */ + if (len >= 4 * 16 + && ! grub_memcmp (buf, buf + 1 * 16, 16) + && ! grub_memcmp (buf, buf + 2 * 16, 16) + && ! grub_memcmp (buf, buf + 3 * 16, 16)) + { + grub_printf ("*\n"); + do + { + bse += 16; + buf += 16; + len -= 16; + } + while (len >= 3 * 16 && ! grub_memcmp (buf, buf + 2 * 16, 16)); + } + bse += 16; buf += 16; len -= cnt; From d2c2b4cdb9da78736a214cdb9f9a4795b683176a Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 3 Feb 2009 13:22:26 +0000 Subject: [PATCH 0509/1707] 2009-02-03 Felix Zielcke * conf/i386-pc.rmk (grub_emu_SOURCES): Add `normal/menu_viewer.c'. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. --- ChangeLog | 10 ++++++++++ conf/i386-coreboot.mk | 15 ++++++++++----- conf/i386-coreboot.rmk | 3 ++- conf/i386-efi.mk | 3 ++- conf/i386-efi.rmk | 3 ++- conf/i386-ieee1275.mk | 15 ++++++++++----- conf/i386-ieee1275.rmk | 3 ++- conf/i386-pc.mk | 15 ++++++++++----- conf/i386-pc.rmk | 3 ++- conf/powerpc-ieee1275.mk | 23 ++++++++++++++--------- conf/powerpc-ieee1275.rmk | 11 ++++++----- conf/sparc64-ieee1275.mk | 5 +++-- conf/sparc64-ieee1275.rmk | 5 +++-- conf/x86_64-efi.mk | 3 ++- conf/x86_64-efi.rmk | 3 ++- 15 files changed, 80 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53ba5e67b..08b8fcda7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-02-03 Felix Zielcke + + * conf/i386-pc.rmk (grub_emu_SOURCES): Add `normal/menu_viewer.c'. + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + 2009-02-02 Christian Franke * lib/hexdump.c (hexdump): Print at most 3 lines if data is identical. diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 9665117ec..ad86ef289 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -209,7 +209,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ @@ -220,11 +221,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -470,6 +471,10 @@ grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDEN $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu_entry.d +grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_viewer.d + grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_misc.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 591ea74c8..3deb7c84d 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -76,7 +76,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index ccd6ac7d9..ae03d4c2c 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -86,7 +86,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 0ab02f653..af21726ad 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -53,7 +53,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 26dda9028..557ab66f4 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -208,7 +208,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ @@ -219,11 +220,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -477,6 +478,10 @@ grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDEN $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu_entry.d +grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_viewer.d + grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_misc.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 3e75b2781..73a07597c 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -75,7 +75,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 4482329b3..f67b10955 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -532,7 +532,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/color.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ \ @@ -548,11 +549,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -742,6 +743,10 @@ grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDEN $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu_entry.d +grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_viewer.d + grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_misc.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 1b9cc214c..9b1071ae0 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -129,7 +129,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/color.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 038d44988..9a2bccaf0 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -60,10 +60,10 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ @@ -73,7 +73,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ + normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ @@ -84,11 +85,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -326,6 +327,10 @@ grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDEN $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu_entry.d +grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_viewer.d + grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_misc.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 7f5425472..e8dff5d50 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -45,10 +45,10 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ @@ -58,7 +58,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ + normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index a9033a530..5b5d10bd3 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -59,11 +59,12 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # normal/arg.c normal/cmdline.c normal/command.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ -# normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \ +# normal/main.c normal/menu.c normal/menu_entry.c \ + normal/menu_viewer.c normal/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ -# util/hostdisk.c util/getroot.c \ +# util/hostdisk.c util/getroot.c \ # util/sparc64/ieee1275/misc.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 17dd175e0..292071cc7 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -58,11 +58,12 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # normal/arg.c normal/cmdline.c normal/command.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ -# normal/main.c normal/menu.c normal/menu_entry.c normal/misc.c \ +# normal/main.c normal/menu.c normal/menu_entry.c \ + normal/menu_viewer.c normal/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ -# util/hostdisk.c util/getroot.c \ +# util/hostdisk.c util/getroot.c \ # util/sparc64/ieee1275/misc.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 3f5e0b553..6f3a477b6 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -74,7 +74,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index eb7f6d177..83d9c8bc5 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -55,7 +55,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/misc.c normal/script.c \ + normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ From e507a2c14fcad9bcc9ecc862bfd9a3f45d8cd78d Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 3 Feb 2009 13:34:52 +0000 Subject: [PATCH 0510/1707] 2009-02-03 Felix Zielcke * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Add a missing trailing `#'. --- ChangeLog | 5 +++++ conf/sparc64-ieee1275.mk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08b8fcda7..814479f13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-03 Felix Zielcke + + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Add a missing trailing + `#'. + 2009-02-03 Felix Zielcke * conf/i386-pc.rmk (grub_emu_SOURCES): Add `normal/menu_viewer.c'. diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 5b5d10bd3..a8ecb83d2 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -60,7 +60,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ # normal/main.c normal/menu.c normal/menu_entry.c \ - normal/menu_viewer.c normal/misc.c \ +# normal/menu_viewer.c normal/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 292071cc7..334caeeac 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -59,7 +59,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ # normal/main.c normal/menu.c normal/menu_entry.c \ - normal/menu_viewer.c normal/misc.c \ +# normal/menu_viewer.c normal/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ From 9cba6fce00a99ab8c55d5145d4e49a6d1394879f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 3 Feb 2009 20:23:33 +0000 Subject: [PATCH 0511/1707] 2009-02-03 Felix Zielcke * util/unifont2pff.rb: Remove. --- ChangeLog | 4 +++ util/unifont2pff.rb | 87 --------------------------------------------- 2 files changed, 4 insertions(+), 87 deletions(-) delete mode 100644 util/unifont2pff.rb diff --git a/ChangeLog b/ChangeLog index 814479f13..57ee5c8d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-03 Felix Zielcke + + * util/unifont2pff.rb: Remove. + 2009-02-03 Felix Zielcke * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Add a missing trailing diff --git a/util/unifont2pff.rb b/util/unifont2pff.rb deleted file mode 100644 index f5f59b2bc..000000000 --- a/util/unifont2pff.rb +++ /dev/null @@ -1,87 +0,0 @@ -#! /usr/bin/ruby -w -# -# Copyright (C) 2003 Free Software Foundation, Inc. -# -# This unifont2pff.rb is free software; the author -# gives unlimited permission to copy and/or distribute it, -# with or without modifications, as long as this notice is preserved. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY, to the extent permitted by law; without -# even the implied warranty of MERCHANTABILITY or FITNESS FOR A -# PARTICULAR PURPOSE. - -# The magic number of the font file. -MAGIC = "PPF\x7f" - -def usage(status = 0) - puts "Usage: ruby unifont2pff.rb [RANGE ...] FILE" - exit(status) -end - -if ARGV.length == 0 - usage(1) -end - -file = ARGV.pop - -ranges = [] -ARGV.each do |range| - if /\A0x([0-9a-fA-F]+)[:-]0x([0-9a-fA-F]+)\z/ =~ range - ranges << [$1.hex, $2.hex] - elsif /\A0x([0-9a-fA-F]+)\z/ =~ range - ranges << [$1.hex, $1.hex] - elsif /\A([0-9]+)[:-]([0-9]+)\z/ =~ range - ranges << [$1.to_i, $2.to_i] - elsif /\A([0-9]+)\z/ =~ range - ranges << [$1.to_i, $1.to_i] - else - usage(1) - end -end - -def ranges.contain?(code) - if self.empty? - true - else - self.each do |r| - return true if r[0] <= code and r[1] >= code - end - false - end -end - -fonts = [] -IO.foreach(file) do |line| - if /^([0-9A-F]+):([0-9A-F]+)$/ =~ line - code = $1.hex - next unless ranges.contain?(code) - - bitmap = $2 - if bitmap.size != 32 and bitmap.size != 64 - raise "invalid bitmap size: #{bitmap}" - end - - fonts << [code, bitmap] - else - raise "invalid line format: #{line}" - end -end - -fonts.sort! {|a,b| a[0] <=> b[0]} - -# Output the result. -print MAGIC -print [fonts.size].pack('V') - -offset = 8 + fonts.size * 8 -fonts.each do |f| - print [f[0]].pack('V') - print [offset].pack('V') - offset += 4 + 16 * f[1].size / 32 -end - -fonts.each do |f| - print [f[1].size / 32].pack('V') - print f[1].scan(/../).collect {|a| a.hex}.pack('C*') -end From 7c3ff286eb0b44e56a81d64e6b300f5077c7f010 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 3 Feb 2009 22:33:45 +0000 Subject: [PATCH 0512/1707] Fix typos and extra spaces --- ChangeLog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 57ee5c8d8..1519475a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -23,8 +23,8 @@ 2009-02-01 Felix Zielcke - * INSTALL: Note that we now require at least autconf 2.59 and that LZO - is optional. + * INSTALL: Note that we now require at least autoconf 2.59 and + that LZO is optional. 2009-02-01 Vesa Jääskeläinen @@ -35,14 +35,14 @@ 2009-02-01 Vesa Jääskeläinen - Based on patch on bug #25318 created by Bernhard Rosenkraenzer + Based on patch on bug #25318 created by Bernhard Rosenkraenzer . * normal/parser.y (script_init): Add missing semicolon. 2009-01-31 Colin D Bennett - * normal/main.c: Add include to grub/menu_viewer.h. + * normal/main.c: Add include to grub/menu_viewer.h. (free_menu_entry_classes): Added. (grub_normal_menu_addentry): Added class property handling. (grub_normal_execute): Changed to use new menu viewer for menu viewing. @@ -997,7 +997,7 @@ * util/update-grub_lib.in: Copy to ... * util/grub-mkconfig_lib.in: ... this. Update all users. - * util/update-grub_lib.in: Make it a stub to `grub-mkconfigig_lib.in'. + * util/update-grub_lib.in: Make it a stub to `grub-mkconfig_lib.in'. * util/update-grub.in: Rename to ... * util/grub-mkconfig.in: ... this. Update all users. Remove `-y' option. Add `--output' option to allow users to specify the generated From 3143cc1c5f05429501392f253140a61333223717 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 4 Feb 2009 10:52:25 +0000 Subject: [PATCH 0513/1707] 2009-02-04 Felix Zielcke util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and /dev/md/NpN style mdraid devices. --- ChangeLog | 5 +++++ util/getroot.c | 22 ++++++++++++++++++++-- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1519475a0..4c392487f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-04 Felix Zielcke + + util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and + /dev/md/NpN style mdraid devices. + 2009-02-03 Felix Zielcke * util/unifont2pff.rb: Remove. diff --git a/util/getroot.c b/util/getroot.c index ffb581da8..e88354e07 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -470,11 +470,29 @@ grub_util_get_grub_dev (const char *os_dev) } else if (os_dev[7] >= '0' && os_dev[7] <= '9') { - asprintf (&grub_dev, "md%s", os_dev + sizeof ("/dev/md") - 1); + char *p , *q; + + p = strdup (os_dev + sizeof ("/dev/md") - 1); + + q = strchr (p, 'p'); + if (q) + *q = ','; + + asprintf (&grub_dev, "md%s", p); + free (p); } else if (os_dev[7] == '/' && os_dev[8] >= '0' && os_dev[8] <= '9') { - asprintf (&grub_dev, "md%s", os_dev + sizeof ("/dev/md/") - 1); + char *p , *q; + + p = strdup (os_dev + sizeof ("/dev/md/") - 1); + + q = strchr (p, 'p'); + if (q) + *q = ','; + + asprintf (&grub_dev, "md%s", p); + free (p); } else grub_util_error ("Unknown kind of RAID device `%s'", os_dev); From 38a0f8e7b57e6f134a0e69adf3df010cd926a7c9 Mon Sep 17 00:00:00 2001 From: chaac Date: Thu, 5 Feb 2009 18:28:58 +0000 Subject: [PATCH 0514/1707] =?UTF-8?q?2009-02-05=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Fixes problem when running vbetest command as reported by Vladimir Serbinenko . * (grub_vbe_set_video_mode): Fixed problem with text modes. --- ChangeLog | 7 +++++ video/i386/pc/vbe.c | 63 +++++++++++++++++++++++++++------------------ 2 files changed, 45 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c392487f..928acf0d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-05 Vesa Jääskeläinen + + Fixes problem when running vbetest command as reported by + Vladimir Serbinenko . + + * (grub_vbe_set_video_mode): Fixed problem with text modes. + 2009-02-04 Felix Zielcke util/getroot.c (grub_util_get_grub_dev): Add support for /dev/mdNpN and diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index 7de37e914..23f7d46f0 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -206,36 +206,49 @@ grub_vbe_set_video_mode (grub_uint32_t mode, framebuffer.bytes_per_scan_line = active_mode_info.bytes_per_scan_line; } - /* Calculate bytes_per_pixel value. */ - switch(active_mode_info.bits_per_pixel) + /* Check whether mode is text mode or graphics mode. */ + if (active_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) { - case 32: framebuffer.bytes_per_pixel = 4; break; - case 24: framebuffer.bytes_per_pixel = 3; break; - case 16: framebuffer.bytes_per_pixel = 2; break; - case 15: framebuffer.bytes_per_pixel = 2; break; - case 8: framebuffer.bytes_per_pixel = 1; break; - default: - grub_vbe_bios_set_mode (old_mode, 0); - return grub_error (GRUB_ERR_BAD_DEVICE, - "cannot set VBE mode %x", - mode); - break; + /* Text mode. */ + + /* No special action needed for text mode as it is not supported for + graphical support. */ } - - /* If video mode is in indexed color, setup default VGA palette. */ - if (framebuffer.index_color_mode) + else { - struct grub_vbe_palette_data *palette - = (struct grub_vbe_palette_data *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + /* Graphics mode. */ - /* Make sure that the BIOS can reach the palette. */ - grub_memcpy (palette, vga_colors, sizeof (vga_colors)); - status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) - / sizeof (struct grub_vbe_palette_data), - 0, - palette); + /* Calculate bytes_per_pixel value. */ + switch(active_mode_info.bits_per_pixel) + { + case 32: framebuffer.bytes_per_pixel = 4; break; + case 24: framebuffer.bytes_per_pixel = 3; break; + case 16: framebuffer.bytes_per_pixel = 2; break; + case 15: framebuffer.bytes_per_pixel = 2; break; + case 8: framebuffer.bytes_per_pixel = 1; break; + default: + grub_vbe_bios_set_mode (old_mode, 0); + return grub_error (GRUB_ERR_BAD_DEVICE, + "cannot set VBE mode %x", + mode); + break; + } - /* Just ignore the status. */ + /* If video mode is in indexed color, setup default VGA palette. */ + if (framebuffer.index_color_mode) + { + struct grub_vbe_palette_data *palette + = (struct grub_vbe_palette_data *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + + /* Make sure that the BIOS can reach the palette. */ + grub_memcpy (palette, vga_colors, sizeof (vga_colors)); + status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) + / sizeof (struct grub_vbe_palette_data), + 0, + palette); + + /* Just ignore the status. */ + } } /* Copy mode info for caller. */ From 0bb5115e67e927b492fd47f184ca04fadfef0d6e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 7 Feb 2009 20:55:48 +0000 Subject: [PATCH 0515/1707] 2009-02-07 Robert Millan * conf/common.rmk (grub_probe_SOURCES, grub_fstest_SOURCES): Move position of `disk/lvm.c\' to ensure grub_init_all() always picks it after the RAID stuff. --- ChangeLog | 6 ++++++ DISTLIST | 1 - conf/common.mk | 38 +++++++++++++++++++------------------- conf/common.rmk | 6 +++--- 4 files changed, 28 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 928acf0d7..4361b101c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-07 Robert Millan + + * conf/common.rmk (grub_probe_SOURCES, grub_fstest_SOURCES): Move + position of `disk/lvm.c' to ensure grub_init_all() always picks it + after the RAID stuff. + 2009-02-05 Vesa Jääskeläinen Fixes problem when running vbetest command as reported by diff --git a/DISTLIST b/DISTLIST index 5e31c5989..ade975990 100644 --- a/DISTLIST +++ b/DISTLIST @@ -436,7 +436,6 @@ util/lvm.c util/misc.c util/raid.c util/resolve.c -util/unifont2pff.rb util/update-grub_lib.in util/elf/grub-mkimage.c util/grub.d/00_header.in diff --git a/conf/common.mk b/conf/common.mk index d6ecb374a..1fe3d3724 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -40,12 +40,12 @@ grub_probe_SOURCES = util/grub-probe.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c disk/mdraid_linux.c grub_probe_init.c -CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_lvm.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-grub_probe_init.d + disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c +CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_lvm.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -183,10 +183,6 @@ grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_fshelp.d -grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_lvm.d - grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-disk_raid.d @@ -195,6 +191,10 @@ grub_probe-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPEND $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-disk_mdraid_linux.d +grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-disk_lvm.d + grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-grub_probe_init.d @@ -217,15 +217,15 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/ufs.c fs/xfs.c fs/afs.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_lvm.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_lvm.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -387,10 +387,6 @@ grub_fstest-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_fshelp.d -grub_fstest-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_lvm.d - grub_fstest-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-disk_raid.d @@ -411,6 +407,10 @@ grub_fstest-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DE $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-disk_dmraid_nvidia.d +grub_fstest-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-disk_lvm.d + grub_fstest-grub_fstest_init.o: grub_fstest_init.c $(grub_fstest_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-grub_fstest_init.d diff --git a/conf/common.rmk b/conf/common.rmk index 560d47764..78f38cdc5 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -21,7 +21,7 @@ grub_probe_SOURCES = util/grub-probe.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ - disk/lvm.c disk/raid.c disk/mdraid_linux.c grub_probe_init.c + disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c ifeq ($(enable_grub_fstest), yes) bin_UTILITIES += grub-fstest @@ -40,9 +40,9 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/ufs.c fs/xfs.c fs/afs.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c disk/lvm.c disk/raid.c \ + kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_fstest_init.c # For grub-mkfont. From cea15bca5bd276640d195a243db0e5db5a895f11 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 7 Feb 2009 20:57:23 +0000 Subject: [PATCH 0516/1707] 2009-02-07 Michael Scherer * fs/hfs.c (grub_hfsplus_iterate_dir): Treat hfs+ as case insensitive. --- ChangeLog | 4 ++++ fs/hfsplus.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4361b101c..3514812d7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-07 Michael Scherer + + * fs/hfs.c (grub_hfsplus_iterate_dir): Treat hfs+ as case insensitive. + 2009-02-07 Robert Millan * conf/common.rmk (grub_probe_SOURCES, grub_fstest_SOURCES): Move diff --git a/fs/hfsplus.c b/fs/hfsplus.c index e6493ce03..7022f9897 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -767,6 +767,9 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, for (i = 0; i < grub_be_to_cpu16 (catkey->namelen); i++) catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]); + /* hfs+ is case insensitive. */ + type |= GRUB_FSHELP_CASE_INSENSITIVE; + /* Only accept valid nodes. */ if (grub_strlen (filename) == grub_be_to_cpu16 (catkey->namelen)) { From aebfc4b0857893f6811d05b66a0ab8dcb28c724e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 7 Feb 2009 23:13:48 +0000 Subject: [PATCH 0517/1707] 2009-02-07 Robert Millan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fs/ext2.c (grub_ext2_mount): Avoid mounting filesystems with backward-incompatible features. Based on patch from Javier Martín, with some adjustments. --- ChangeLog | 7 +++++++ fs/ext2.c | 62 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 66 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3514812d7..9f3e8f097 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-07 Robert Millan + + * fs/ext2.c (grub_ext2_mount): Avoid mounting filesystems with + backward-incompatible features. + + Based on patch from Javier Martín, with some adjustments. + 2009-02-07 Michael Scherer * fs/hfs.c (grub_hfsplus_iterate_dir): Treat hfs+ as case insensitive. diff --git a/fs/ext2.c b/fs/ext2.c index 81318f882..06623eb2f 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -71,7 +71,52 @@ ? EXT2_GOOD_OLD_INODE_SIZE \ : grub_le_to_cpu16 (data->sblock.inode_size)) -#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 +/* Superblock filesystem feature flags (RW compatible) + * A filesystem with any of these enabled can be read and written by a driver + * that does not understand them without causing metadata/data corruption */ +#define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 +#define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 +#define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 +#define EXT2_FEATURE_COMPAT_EXT_ATTR 0x0008 +#define EXT2_FEATURE_COMPAT_RESIZE_INODE 0x0010 +#define EXT2_FEATURE_COMPAT_DIR_INDEX 0x0020 +/* Superblock filesystem feature flags (RO compatible) + * A filesystem with any of these enabled can be safely read by a driver that + * does not understand them, but should not be written to, usually because + * additional metadata is required */ +#define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 +#define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 +#define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 +#define EXT4_FEATURE_RO_COMPAT_GDT_CSUM 0x0010 +#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020 +#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040 +/* Superblock filesystem feature flags (back-incompatible) + * A filesystem with any of these enabled should not be attempted to be read + * by a driver that does not understand them, since they usually indicate + * metadata format changes that might confuse the reader. */ +#define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 +#define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 +#define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ +#define EXT3_FEATURE_INCOMPAT_JOURNAL_DEV 0x0008 /* Volume is journal device */ +#define EXT2_FEATURE_INCOMPAT_META_BG 0x0010 +#define EXT4_FEATURE_INCOMPAT_EXTENTS 0x0040 /* Extents used */ +#define EXT4_FEATURE_INCOMPAT_64BIT 0x0080 +#define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 + +/* The set of back-incompatible features this driver DOES support. Add (OR) + * flags here as the related features are implemented into the driver */ +#define EXT2_DRIVER_SUPPORTED_INCOMPAT ( EXT2_FEATURE_INCOMPAT_FILETYPE \ + | EXT4_FEATURE_INCOMPAT_EXTENTS ) +/* List of rationales for the ignored "incompatible" features: + * needs_recovery: Not really back-incompatible - was added as such to forbid + * ext2 drivers from mounting an ext3 volume with a dirty + * journal because they will ignore the journal, but the next + * ext3 driver to mount the volume will find the journal and + * replay it, potentially corrupting the metadata written by + * the ext2 drivers + */ +#define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER ) + #define EXT3_JOURNAL_MAGIC_NUMBER 0xc03b3998U @@ -503,7 +548,19 @@ grub_ext2_mount (grub_disk_t disk) /* Make sure this is an ext2 filesystem. */ if (grub_le_to_cpu16 (data->sblock.magic) != EXT2_MAGIC) - goto fail; + { + grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); + goto fail; + } + + /* Check the FS doesn't have feature bits enabled that we don't support. */ + if (grub_le_to_cpu32 (data->sblock.feature_incompat) + & ~(EXT2_DRIVER_SUPPORTED_INCOMPAT | EXT2_DRIVER_IGNORED_INCOMPAT)) + { + grub_error (GRUB_ERR_BAD_FS, "filesystem has unsupported incompatible features"); + goto fail; + } + data->disk = disk; @@ -520,7 +577,6 @@ grub_ext2_mount (grub_disk_t disk) return data; fail: - grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); grub_free (data); return 0; } From f821ce593a5aa74c355995d18db3c3b4e3f4a381 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 7 Feb 2009 23:38:01 +0000 Subject: [PATCH 0518/1707] 2009-02-08 Robert Millan * fs/cpio.c: Split tar functionality to ... * fs/tar.c: ... here (new file). Update all users. --- ChangeLog | 5 ++ DISTLIST | 1 + conf/common.mk | 89 ++++++++++++++++++++++++++++++----- conf/common.rmk | 13 +++-- conf/i386-coreboot.mk | 14 ++++-- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.mk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.mk | 14 ++++-- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.mk | 28 +++++++---- conf/i386-pc.rmk | 4 +- conf/powerpc-ieee1275.mk | 14 ++++-- conf/powerpc-ieee1275.rmk | 2 +- fs/cpio.c | 47 ++++++++++-------- util/i386/pc/grub-mkrescue.in | 2 +- 16 files changed, 172 insertions(+), 69 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9f3e8f097..03a8c36d5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-08 Robert Millan + + * fs/cpio.c: Split tar functionality to ... + * fs/tar.c: ... here (new file). Update all users. + 2009-02-07 Robert Millan * fs/ext2.c (grub_ext2_mount): Avoid mounting filesystems with diff --git a/DISTLIST b/DISTLIST index ade975990..d8a181a09 100644 --- a/DISTLIST +++ b/DISTLIST @@ -120,6 +120,7 @@ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c +fs/tar.c fs/udf.c fs/ufs.c fs/xfs.c diff --git a/conf/common.mk b/conf/common.mk index 1fe3d3724..e75c46b50 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -36,16 +36,16 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c -CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d +CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-fs_tar.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -159,6 +159,10 @@ grub_probe-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_afs.d +grub_probe-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_tar.d + grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-partmap_pc.d @@ -214,18 +218,18 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -359,6 +363,10 @@ grub_fstest-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_afs.d +grub_fstest-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_tar.d + grub_fstest-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-kern_partition.d @@ -583,8 +591,8 @@ grub-mkconfig_DATA += util/grub.d/README # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ - affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod \ - afs.mod + affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod tar.mod \ + udf.mod afs.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -1498,6 +1506,63 @@ partmap-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genpartmaplist cpio_mod_CFLAGS = $(COMMON_CFLAGS) cpio_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For tar.mod. +tar_mod_SOURCES = fs/cpio.c +CLEANFILES += tar.mod mod-tar.o mod-tar.c pre-tar.o tar_mod-fs_cpio.o und-tar.lst +ifneq ($(tar_mod_EXPORTS),no) +CLEANFILES += def-tar.lst +DEFSYMFILES += def-tar.lst +endif +MOSTLYCLEANFILES += tar_mod-fs_cpio.d +UNDSYMFILES += und-tar.lst + +tar.mod: pre-tar.o mod-tar.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(tar_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-tar.o mod-tar.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-tar.o: $(tar_mod_DEPENDENCIES) tar_mod-fs_cpio.o + -rm -f $@ + $(TARGET_CC) $(tar_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ tar_mod-fs_cpio.o + +mod-tar.o: mod-tar.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -c -o $@ $< + +mod-tar.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'tar' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(tar_mod_EXPORTS),no) +def-tar.lst: pre-tar.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 tar/' > $@ +endif + +und-tar.lst: pre-tar.o + echo 'tar' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +tar_mod-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) + $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -MD -c -o $@ $< +-include tar_mod-fs_cpio.d + +CLEANFILES += cmd-tar_mod-fs_cpio.lst fs-tar_mod-fs_cpio.lst partmap-tar_mod-fs_cpio.lst +COMMANDFILES += cmd-tar_mod-fs_cpio.lst +FSFILES += fs-tar_mod-fs_cpio.lst +PARTMAPFILES += partmap-tar_mod-fs_cpio.lst + +cmd-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tar > $@ || (rm -f $@; exit 1) + +fs-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tar > $@ || (rm -f $@; exit 1) + +partmap-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tar > $@ || (rm -f $@; exit 1) + + +tar_mod_CFLAGS = $(COMMON_CFLAGS) -DMODE_USTAR +tar_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For udf.mod. udf_mod_SOURCES = fs/udf.c CLEANFILES += udf.mod mod-udf.o mod-udf.c pre-udf.o udf_mod-fs_udf.o und-udf.lst diff --git a/conf/common.rmk b/conf/common.rmk index 78f38cdc5..f91d6ff4e 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -17,7 +17,7 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ @@ -37,7 +37,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ @@ -158,8 +158,8 @@ grub-mkconfig_DATA += util/grub.d/README # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ - affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod udf.mod \ - afs.mod + affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod tar.mod \ + udf.mod afs.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -241,6 +241,11 @@ cpio_mod_SOURCES = fs/cpio.c cpio_mod_CFLAGS = $(COMMON_CFLAGS) cpio_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For tar.mod. +tar_mod_SOURCES = fs/cpio.c +tar_mod_CFLAGS = $(COMMON_CFLAGS) -DMODE_USTAR +tar_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For udf.mod. udf_mod_SOURCES = fs/udf.c udf_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index ad86ef289..1018c1494 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -198,7 +198,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ @@ -221,11 +221,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -359,6 +359,10 @@ grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_afs.d +grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_tar.d + grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 3deb7c84d..739aeff4d 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -65,7 +65,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index ae03d4c2c..a2f330477 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -76,7 +76,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index af21726ad..dc0547e19 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -43,7 +43,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 557ab66f4..74914d7f2 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -197,7 +197,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ @@ -220,11 +220,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -366,6 +366,10 @@ grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_afs.d +grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_tar.d + grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 73a07597c..56569a6f0 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -64,7 +64,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index f67b10955..63d0b239c 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -326,18 +326,18 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ partmap/pc.c partmap/gpt.c \ \ disk/raid.c disk/mdraid_linux.c disk/lvm.c \ util/raid.c util/lvm.c \ grub_setup_init.c -CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_hostdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_mdraid_linux.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d +CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-fs_tar.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o +MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_hostdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-fs_tar.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_mdraid_linux.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) +grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-fs_tar.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o + $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-fs_tar.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(util/i386/pc/grub-setup.c_DEPENDENCIES) $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< @@ -463,6 +463,10 @@ grub_setup-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-fs_afs.d +grub_setup-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< +-include grub_setup-fs_tar.d + grub_setup-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< -include grub_setup-partmap_pc.d @@ -540,7 +544,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ @@ -549,11 +553,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -847,6 +851,10 @@ grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_afs.d +grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_tar.d + grub_emu-util_console.o: util/console.c $(util/console.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-util_console.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 9b1071ae0..e7de5e9a7 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -99,7 +99,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ partmap/pc.c partmap/gpt.c \ \ @@ -137,7 +137,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 9a2bccaf0..534eb9b5b 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -63,7 +63,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ @@ -85,11 +85,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -219,6 +219,10 @@ grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_afs.d +grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_tar.d + grub_emu-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-io_gzio.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index e8dff5d50..818d645ca 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -48,7 +48,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/fs/cpio.c b/fs/cpio.c index 4965fe57d..3d8078ae9 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -66,16 +66,12 @@ struct HEAD_USTAR #define HEAD_LENG sizeof(struct HEAD_USTAR) -#define MODE_BCPIO 1 -#define MODE_USTAR 2 - struct grub_cpio_data { grub_disk_t disk; grub_uint32_t hofs; grub_uint32_t dofs; grub_uint32_t size; - int mode; }; #ifndef GRUB_UTIL @@ -86,8 +82,7 @@ static grub_err_t grub_cpio_find_file (struct grub_cpio_data *data, char **name, grub_uint32_t * ofs) { - if (data->mode == MODE_BCPIO) - { +#ifndef MODE_USTAR struct HEAD_BCPIO hd; if (grub_disk_read @@ -123,9 +118,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, *ofs = data->dofs + data->size; if (data->size & 1) (*ofs)++; - } - else - { +#else struct HEAD_USTAR hd; if (grub_disk_read @@ -148,7 +141,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, data->dofs = data->hofs + GRUB_DISK_SECTOR_SIZE; *ofs = data->dofs + ((data->size + GRUB_DISK_SECTOR_SIZE - 1) & ~(GRUB_DISK_SECTOR_SIZE - 1)); - } +#endif return GRUB_ERR_NONE; } @@ -157,17 +150,16 @@ grub_cpio_mount (grub_disk_t disk) { char hd[HEAD_LENG]; struct grub_cpio_data *data; - int mode; if (grub_disk_read (disk, 0, 0, sizeof (hd), hd)) goto fail; - if (((struct HEAD_BCPIO *) hd)->magic == MAGIC_BCPIO) - mode = MODE_BCPIO; - else if (!grub_memcmp (((struct HEAD_USTAR *) hd)->magic, MAGIC_USTAR, +#ifndef MODE_USTAR + if (((struct HEAD_BCPIO *) hd)->magic != MAGIC_BCPIO) +#else + if (grub_memcmp (((struct HEAD_USTAR *) hd)->magic, MAGIC_USTAR, sizeof (MAGIC_USTAR) - 1)) - mode = MODE_USTAR; - else +#endif goto fail; data = (struct grub_cpio_data *) grub_malloc (sizeof (*data)); @@ -175,12 +167,17 @@ grub_cpio_mount (grub_disk_t disk) goto fail; data->disk = disk; - data->mode = mode; return data; fail: - grub_error (GRUB_ERR_BAD_FS, "not a cpio filesystem"); + grub_error (GRUB_ERR_BAD_FS, "not a " +#ifdef MODE_USTAR + "tar" +#else + "cpio" +#endif + " filesystem"); return 0; } @@ -350,16 +347,22 @@ grub_cpio_close (grub_file_t file) } static struct grub_fs grub_cpio_fs = { +#ifdef MODE_USTAR + .name = "tarfs", +#else .name = "cpiofs", +#endif .dir = grub_cpio_dir, .open = grub_cpio_open, .read = grub_cpio_read, .close = grub_cpio_close, - .label = 0, - .next = 0 }; +#ifdef MODE_USTAR GRUB_MOD_INIT (cpio) +#else +GRUB_MOD_INIT (tar) +#endif { grub_fs_register (&grub_cpio_fs); #ifndef GRUB_UTIL @@ -367,7 +370,11 @@ GRUB_MOD_INIT (cpio) #endif } +#ifdef MODE_USTAR GRUB_MOD_FINI (cpio) +#else +GRUB_MOD_FINI (tar) +#endif { grub_fs_unregister (&grub_cpio_fs); } diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 3a74b06d9..358b37b17 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -138,7 +138,7 @@ if [ "x${image_type}" = xfloppy -o "x${emulation}" = xfloppy ] ; then # build core.img core_img=`mktemp` - ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk cpio + ${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${core_img} memdisk tar rm -f ${memdisk_img} # build floppy image From 73a4ce818cdec641072d35203844df20cf7cd527 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Feb 2009 00:28:09 +0000 Subject: [PATCH 0519/1707] 2009-02-08 Robert Millan MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch from Javier Martín. * fs/ext2.c (EXT2_DRIVER_SUPPORTED_INCOMPAT): Add `EXT4_FEATURE_INCOMPAT_FLEX_BG'. --- ChangeLog | 6 ++++++ fs/ext2.c | 14 +++++++------- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03a8c36d5..827679b22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-08 Robert Millan + + Patch from Javier Martín. + * fs/ext2.c (EXT2_DRIVER_SUPPORTED_INCOMPAT): Add + `EXT4_FEATURE_INCOMPAT_FLEX_BG'. + 2009-02-08 Robert Millan * fs/cpio.c: Split tar functionality to ... diff --git a/fs/ext2.c b/fs/ext2.c index 06623eb2f..ac0757e7c 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -73,7 +73,7 @@ /* Superblock filesystem feature flags (RW compatible) * A filesystem with any of these enabled can be read and written by a driver - * that does not understand them without causing metadata/data corruption */ + * that does not understand them without causing metadata/data corruption. */ #define EXT2_FEATURE_COMPAT_DIR_PREALLOC 0x0001 #define EXT2_FEATURE_COMPAT_IMAGIC_INODES 0x0002 #define EXT3_FEATURE_COMPAT_HAS_JOURNAL 0x0004 @@ -83,7 +83,7 @@ /* Superblock filesystem feature flags (RO compatible) * A filesystem with any of these enabled can be safely read by a driver that * does not understand them, but should not be written to, usually because - * additional metadata is required */ + * additional metadata is required. */ #define EXT2_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 #define EXT2_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 #define EXT2_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 @@ -93,7 +93,7 @@ /* Superblock filesystem feature flags (back-incompatible) * A filesystem with any of these enabled should not be attempted to be read * by a driver that does not understand them, since they usually indicate - * metadata format changes that might confuse the reader. */ + * metadata format changes that might confuse the reader. */ #define EXT2_FEATURE_INCOMPAT_COMPRESSION 0x0001 #define EXT2_FEATURE_INCOMPAT_FILETYPE 0x0002 #define EXT3_FEATURE_INCOMPAT_RECOVER 0x0004 /* Needs recovery */ @@ -104,17 +104,17 @@ #define EXT4_FEATURE_INCOMPAT_FLEX_BG 0x0200 /* The set of back-incompatible features this driver DOES support. Add (OR) - * flags here as the related features are implemented into the driver */ + * flags here as the related features are implemented into the driver. */ #define EXT2_DRIVER_SUPPORTED_INCOMPAT ( EXT2_FEATURE_INCOMPAT_FILETYPE \ - | EXT4_FEATURE_INCOMPAT_EXTENTS ) + | EXT4_FEATURE_INCOMPAT_EXTENTS \ + | EXT4_FEATURE_INCOMPAT_FLEX_BG ) /* List of rationales for the ignored "incompatible" features: * needs_recovery: Not really back-incompatible - was added as such to forbid * ext2 drivers from mounting an ext3 volume with a dirty * journal because they will ignore the journal, but the next * ext3 driver to mount the volume will find the journal and * replay it, potentially corrupting the metadata written by - * the ext2 drivers - */ + * the ext2 drivers. Safe to ignore for this RO driver. */ #define EXT2_DRIVER_IGNORED_INCOMPAT ( EXT3_FEATURE_INCOMPAT_RECOVER ) From e5698dc684d178d9cd0a1d0abf5c2c409e5be81c Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Feb 2009 00:51:22 +0000 Subject: [PATCH 0520/1707] Forgot tar.c --- fs/tar.c | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 fs/tar.c diff --git a/fs/tar.c b/fs/tar.c new file mode 100644 index 000000000..2b0c4cb5f --- /dev/null +++ b/fs/tar.c @@ -0,0 +1,2 @@ +#define MODE_USTAR 1 +#include "fs/cpio.c" From 2b40d6bb9f61e0620a32ca276d1ef75cf69c8a41 Mon Sep 17 00:00:00 2001 From: chaac Date: Sun, 8 Feb 2009 10:52:03 +0000 Subject: [PATCH 0521/1707] =?UTF-8?q?2009-02-08=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * kern/mm.c: Add more comments. --- ChangeLog | 4 +++ kern/mm.c | 97 ++++++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 79 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 827679b22..34f5f66a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-08 Vesa Jääskeläinen + + * kern/mm.c: Add more comments. + 2009-02-08 Robert Millan Patch from Javier Martín. diff --git a/kern/mm.c b/kern/mm.c index e0cb9cd3c..a31dc2efd 100644 --- a/kern/mm.c +++ b/kern/mm.c @@ -129,7 +129,7 @@ get_header_from_pointer (void *ptr, grub_mm_header_t *p, grub_mm_region_t *r) if (! *r) grub_fatal ("out of range pointer %p", ptr); - + *p = (grub_mm_header_t) ptr - 1; if ((*p)->magic != GRUB_MM_ALLOC_MAGIC) grub_fatal ("alloc magic is broken at %p", *p); @@ -155,7 +155,7 @@ grub_mm_init_region (void *addr, grub_size_t size) r = (grub_mm_region_t) (((grub_addr_t) addr + GRUB_MM_ALIGN - 1) & (~(GRUB_MM_ALIGN - 1))); size -= (char *) r - (char *) addr + sizeof (*r); - + h = (grub_mm_header_t) ((char *) r + GRUB_MM_ALIGN); h->next = h; h->magic = GRUB_MM_FREE_MAGIC; @@ -170,22 +170,26 @@ grub_mm_init_region (void *addr, grub_size_t size) for (p = &base, q = *p; q; p = &(q->next), q = *p) if (q->size > r->size) break; - + *p = r; r->next = q; } /* Allocate the number of units N with the alignment ALIGN from the ring - buffer starting from *FIRST. ALIGN must be a power of two. Return a - non-NULL if successful, otherwise return NULL. */ + buffer starting from *FIRST. ALIGN must be a power of two. Both N and + ALIGN are in units of GRUB_MM_ALIGN. Return a non-NULL if successful, + otherwise return NULL. */ static void * grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) { grub_mm_header_t p, q; + /* When everything is allocated side effect is that *first will have alloc + magic marked, meaning that there is no room in this region. */ if ((*first)->magic == GRUB_MM_ALLOC_MAGIC) return 0; + /* Try to search free slot for allocation in this memory region. */ for (q = *first, p = q->next; ; q = p, p = p->next) { grub_off_t extra; @@ -204,11 +208,37 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) { if (extra == 0 && p->size == n) { + /* There is no special alignment requirement and memory block + is complete match. + + 1. Just mark memory block as allocated and remove it from + free list. + + Result: + +---------------+ previous block's next + | alloc, size=n | | + +---------------+ v + */ q->next = p->next; p->magic = GRUB_MM_ALLOC_MAGIC; } else if (extra == 0 || p->size == n + extra) { + /* There might be alignment requirement, when taking it into + account memory block fits in. + + 1. Allocate new area at end of memory block. + 2. Reduce size of available blocks from original node. + 3. Mark new area as allocated and "remove" it from free + list. + + Result: + +---------------+ + | free, size-=n | next --+ + +---------------+ | + | alloc, size=n | | + +---------------+ v + */ p->size -= n; p += p->size; p->size = n; @@ -216,13 +246,32 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) } else { + /* There is alignment requirement and there is room in memory + block. Split memory block to three pieces. + + 1. Create new memory block right after section being + allocated. Mark it as free. + 2. Add new memory block to free chain. + 3. Mark current memory block having only extra blocks. + 4. Advance to aligned block and mark that as allocated and + "remove" it from free list. + + Result: + +------------------------------+ + | free, size=extra | next --+ + +------------------------------+ | + | alloc, size=n | | + +------------------------------+ | + | free, size=orig.size-extra-n | <------+, next --+ + +------------------------------+ v + */ grub_mm_header_t r; r = p + extra + n; r->magic = GRUB_MM_FREE_MAGIC; r->size = p->size - extra - n; r->next = p->next; - + p->size = extra; p->next = r; p += extra; @@ -230,11 +279,15 @@ grub_real_malloc (grub_mm_header_t *first, grub_size_t n, grub_size_t align) p->magic = GRUB_MM_ALLOC_MAGIC; } + /* Mark find as a start marker for next allocation to fasten it. + This will have side effect of fragmenting memory as small + pieces before this will be un-used. */ *first = q; - + return p + 1; } + /* Search was completed without result. */ if (p == *first) break; } @@ -249,17 +302,17 @@ grub_memalign (grub_size_t align, grub_size_t size) grub_mm_region_t r; grub_size_t n = ((size + GRUB_MM_ALIGN - 1) >> GRUB_MM_ALIGN_LOG2) + 1; int count = 0; - + align = (align >> GRUB_MM_ALIGN_LOG2); if (align == 0) align = 1; again: - + for (r = base; r; r = r->next) { void *p; - + p = grub_real_malloc (&(r->first), n, align); if (p) return p; @@ -273,7 +326,7 @@ grub_memalign (grub_size_t align, grub_size_t size) grub_disk_cache_invalidate_all (); count++; goto again; - + case 1: /* Unload unneeded modules. */ grub_dl_unload_unneeded (); @@ -283,7 +336,7 @@ grub_memalign (grub_size_t align, grub_size_t size) default: break; } - + grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of memory"); return 0; } @@ -326,12 +379,12 @@ grub_free (void *ptr) } while (q != r->first); #endif - + for (q = r->first; q >= p || q->next <= p; q = q->next) { if (q->magic != GRUB_MM_FREE_MAGIC) grub_fatal ("free magic is broken at %p: 0x%x", q, q->magic); - + if (q >= q->next && (q < p || q->next > p)) break; } @@ -339,7 +392,7 @@ grub_free (void *ptr) p->magic = GRUB_MM_FREE_MAGIC; p->next = q->next; q->next = p; - + if (p + p->size == p->next) { if (p->next == q) @@ -349,7 +402,7 @@ grub_free (void *ptr) p->size += p->next->size; p->next = p->next->next; } - + if (q + q->size == p) { p->magic = 0; @@ -370,7 +423,7 @@ grub_realloc (void *ptr, grub_size_t size) grub_mm_region_t r; void *q; grub_size_t n; - + if (! ptr) return grub_malloc (size); @@ -383,14 +436,14 @@ grub_realloc (void *ptr, grub_size_t size) /* FIXME: Not optimal. */ n = ((size + GRUB_MM_ALIGN - 1) >> GRUB_MM_ALIGN_LOG2) + 1; get_header_from_pointer (ptr, &p, &r); - + if (p->size >= n) return ptr; - + q = grub_malloc (size); if (! q) return q; - + grub_memcpy (q, ptr, size); grub_free (ptr); return q; @@ -434,7 +487,7 @@ grub_mm_dump (unsigned lineno) for (r = base; r; r = r->next) { grub_mm_header_t p; - + for (p = (grub_mm_header_t) ((r->addr + GRUB_MM_ALIGN - 1) & (~(GRUB_MM_ALIGN - 1))); (grub_addr_t) p < r->addr + r->size; @@ -493,7 +546,7 @@ grub_debug_memalign (const char *file, int line, grub_size_t align, grub_size_t size) { void *ptr; - + if (grub_mm_debug) grub_printf ("%s:%d: memalign (0x%x, 0x%x) = ", file, line, align, size); From d64399b562efdc862fc76ed509f8977085138626 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Feb 2009 17:58:32 +0000 Subject: [PATCH 0522/1707] 2009-02-08 Marco Gerards * Makefile.in (enable_grub_emu_usb): New variable. * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'. (grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c', `util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'. (grub_emu_LDFLAGS): Add `$(LIBUSB)'. (pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod', `usbtest.mod' and `usbms.mod'. (usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS) (usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS) (uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS, (ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS) (usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New variables. * disk/usbms.c: New file. * include/grub/usb.h: Likewise. * include/grub/usbtrans.h: Likewise. * include/grub/usbdesc.h: Likewise. * bus/usb/usbtrans.c: Likewise. * bus/usb/ohci.c: Likewise. * bus/usb/uhci.c: Likewise. * bus/usb/usbhub.c: Likewise. * bus/usb/usb.c: Likewise. * commands/usbtest.c: Likewise. * util/usb.c: Likewise. * include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'. * configure.ac: Test for libusb presence. * util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'. --- ChangeLog | 44 +++ DISTLIST | 11 + Makefile.in | 1 + bus/usb/ohci.c | 608 ++++++++++++++++++++++++++++++++++++ bus/usb/uhci.c | 675 ++++++++++++++++++++++++++++++++++++++++ bus/usb/usb.c | 263 ++++++++++++++++ bus/usb/usbhub.c | 193 ++++++++++++ bus/usb/usbtrans.c | 212 +++++++++++++ commands/usbtest.c | 160 ++++++++++ conf/i386-pc.mk | 370 +++++++++++++++++++++- conf/i386-pc.rmk | 38 ++- config.h.in | 3 + configure | 245 ++++++++++++++- configure.ac | 15 + disk/usbms.c | 393 +++++++++++++++++++++++ include/grub/err.h | 3 +- include/grub/usb.h | 207 ++++++++++++ include/grub/usbdesc.h | 119 +++++++ include/grub/usbtrans.h | 107 +++++++ util/grub-emu.c | 4 + util/usb.c | 191 ++++++++++++ 21 files changed, 3846 insertions(+), 16 deletions(-) create mode 100644 bus/usb/ohci.c create mode 100644 bus/usb/uhci.c create mode 100644 bus/usb/usb.c create mode 100644 bus/usb/usbhub.c create mode 100644 bus/usb/usbtrans.c create mode 100644 commands/usbtest.c create mode 100644 disk/usbms.c create mode 100644 include/grub/usb.h create mode 100644 include/grub/usbdesc.h create mode 100644 include/grub/usbtrans.h create mode 100644 util/usb.c diff --git a/ChangeLog b/ChangeLog index 34f5f66a9..f806b40a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,47 @@ +2009-02-08 Marco Gerards + + * Makefile.in (enable_grub_emu_usb): New variable. + * conf/i386-pc.rmk (grub_emu_SOURCES): Add `disk/scsi.c'. + (grub_emu_SOURCES) [grub_emu_SOURCES]: Add `disk/usbms.c', + `util/usb.c', `bus/usb/usb.c' and `commands/usbtest.c'. + (grub_emu_LDFLAGS): Add `$(LIBUSB)'. + (pkglib_MODULES): Add `usb.mod', `uhci.mod', `ohci.mod', + `usbtest.mod' and `usbms.mod'. + (usb_mod_SOURCES, usb_mod_CFLAGS, usb_mod_LDFLAGS) + (usbtest_mod_SOURCES, usbtest_mod_CFLAGS, usbtest_mod_LDFLAGS) + (uhci_mod_SOURCES, uhci_mod_CFLAGS, uhci_mod_LDFLAGS, + (ohci_mod_SOURCES, ohci_mod_CFLAGS, ohci_mod_LDFLAGS) + (usbms_mod_SOURCES, usbms_mod_CFLAGS, usbms_mod_LDFLAGS): New + variables. + + * disk/usbms.c: New file. + + * include/grub/usb.h: Likewise. + + * include/grub/usbtrans.h: Likewise. + + * include/grub/usbdesc.h: Likewise. + + * bus/usb/usbtrans.c: Likewise. + + * bus/usb/ohci.c: Likewise. + + * bus/usb/uhci.c: Likewise. + + * bus/usb/usbhub.c: Likewise. + + * bus/usb/usb.c: Likewise. + + * commands/usbtest.c: Likewise. + + * util/usb.c: Likewise. + + * include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'. + + * configure.ac: Test for libusb presence. + + * util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'. + 2009-02-08 Vesa Jääskeläinen * kern/mm.c: Add more comments. diff --git a/DISTLIST b/DISTLIST index d8a181a09..a9e879d18 100644 --- a/DISTLIST +++ b/DISTLIST @@ -35,6 +35,11 @@ boot/i386/pc/diskboot.S boot/i386/pc/lnxboot.S boot/i386/pc/pxeboot.S bus/pci.c +bus/usb/ohci.c +bus/usb/uhci.c +bus/usb/usb.c +bus/usb/usbhub.c +bus/usb/usbtrans.c commands/blocklist.c commands/boot.c commands/cat.c @@ -56,6 +61,7 @@ commands/search.c commands/sleep.c commands/terminal.c commands/test.c +commands/usbtest.c commands/videotest.c commands/i386/cpuid.c commands/i386/pc/halt.c @@ -95,6 +101,7 @@ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c disk/scsi.c +disk/usbms.c disk/efi/efidisk.c disk/i386/pc/biosdisk.c disk/ieee1275/nand.c @@ -179,6 +186,9 @@ include/grub/terminfo.h include/grub/time.h include/grub/tparm.h include/grub/types.h +include/grub/usb.h +include/grub/usbdesc.h +include/grub/usbtrans.h include/grub/video.h include/grub/efi/api.h include/grub/efi/chainloader.h @@ -438,6 +448,7 @@ util/misc.c util/raid.c util/resolve.c util/update-grub_lib.in +util/usb.c util/elf/grub-mkimage.c util/grub.d/00_header.in util/grub.d/10_freebsd.in diff --git a/Makefile.in b/Makefile.in index ea193d8b6..398f92816 100644 --- a/Makefile.in +++ b/Makefile.in @@ -92,6 +92,7 @@ UNIFONT_BDF = @UNIFONT_BDF@ # Options. enable_grub_emu = @enable_grub_emu@ +enable_grub_emu_usb = @enable_grub_emu_usb@ enable_grub_fstest = @enable_grub_fstest@ enable_grub_pe2elf = @enable_grub_pe2elf@ enable_lzo = @enable_lzo@ diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c new file mode 100644 index 000000000..d2e78d4c9 --- /dev/null +++ b/bus/usb/ohci.c @@ -0,0 +1,608 @@ +/* ohci.c - OHCI Support. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct grub_ohci_hcca +{ + /* Pointers to Interrupt Endpoint Descriptors. Not used by + GRUB. */ + grub_uint32_t inttable[32]; + + /* Current frame number. */ + grub_uint16_t framenumber; + + grub_uint16_t pad; + + /* List of completed TDs. */ + grub_uint32_t donehead; + + grub_uint8_t reserved[116]; +} __attribute__((packed)); + +/* OHCI Endpoint Descriptor. */ +struct grub_ohci_ed +{ + grub_uint32_t target; + grub_uint32_t td_tail; + grub_uint32_t td_head; + grub_uint32_t next_ed; +} __attribute__((packed)); + +struct grub_ohci_td +{ + /* Information used to construct the TOKEN packet. */ + grub_uint32_t token; + + grub_uint32_t buffer; + grub_uint32_t next_td; + grub_uint32_t buffer_end; +} __attribute__((packed)); + +typedef struct grub_ohci_td *grub_ohci_td_t; +typedef struct grub_ohci_ed *grub_ohci_ed_t; + +struct grub_ohci +{ + volatile grub_uint32_t *iobase; + volatile struct grub_ohci_hcca *hcca; + struct grub_ohci *next; +}; + +static struct grub_ohci *ohci; + +typedef enum +{ + GRUB_OHCI_REG_REVISION = 0x00, + GRUB_OHCI_REG_CONTROL, + GRUB_OHCI_REG_CMDSTATUS, + GRUB_OHCI_REG_INTSTATUS, + GRUB_OHCI_REG_INTENA, + GRUB_OHCI_REG_INTDIS, + GRUB_OHCI_REG_HCCA, + GRUB_OHCI_REG_PERIODIC, + GRUB_OHCI_REG_CONTROLHEAD, + GRUB_OHCI_REG_CONTROLCURR, + GRUB_OHCI_REG_BULKHEAD, + GRUB_OHCI_REG_BULKCURR, + GRUB_OHCI_REG_DONEHEAD, + GRUB_OHCI_REG_FRAME_INTERVAL, + GRUB_OHCI_REG_RHUBA = 18, + GRUB_OHCI_REG_RHUBPORT = 21 +} grub_ohci_reg_t; + +static grub_uint32_t +grub_ohci_readreg32 (struct grub_ohci *o, grub_ohci_reg_t reg) +{ + return grub_le_to_cpu32 (*(o->iobase + reg)); +} + +static void +grub_ohci_writereg32 (struct grub_ohci *o, + grub_ohci_reg_t reg, grub_uint32_t val) +{ + *(o->iobase + reg) = grub_cpu_to_le32 (val); +} + + + +/* Iterate over all PCI devices. Determine if a device is an OHCI + controller. If this is the case, initialize it. */ +static int grub_ohci_pci_iter (int bus, int device, int func, + grub_pci_id_t pciid __attribute__((unused))) +{ + grub_uint32_t class; + grub_uint32_t subclass; + int interf; + grub_uint32_t base; + grub_pci_address_t addr; + struct grub_ohci *o; + grub_uint32_t revision; + grub_uint32_t frame_interval; + + addr = grub_pci_make_address (bus, device, func, 2); + class = grub_pci_read (addr); + addr = grub_pci_make_address (bus, device, func, 2); + class = grub_pci_read (addr); + + interf = class & 0xFF; + subclass = (class >> 16) & 0xFF; + class >>= 24; + + /* If this is not an OHCI controller, just return. */ + if (class != 0x0c || subclass != 0x03) + return 0; + + /* Determine IO base address. */ + addr = grub_pci_make_address (bus, device, func, 4); + base = grub_pci_read (addr); + +#if 0 + /* Stop if there is no IO space base address defined. */ + if (! (base & 1)) + return 0; +#endif + + /* Allocate memory for the controller and register it. */ + o = grub_malloc (sizeof (*o)); + if (! o) + return 1; + + /* Link in the OHCI. */ + o->next = ohci; + ohci = o; + o->iobase = (grub_uint32_t *) base; + + /* Reserve memory for the HCCA. */ + o->hcca = (struct grub_ohci_hcca *) grub_memalign (256, 256); + + /* Check if the OHCI revision is actually 1.0 as supported. */ + revision = grub_ohci_readreg32 (o, GRUB_OHCI_REG_REVISION); + grub_dprintf ("ohci", "OHCI revision=0x%02x\n", revision & 0xFF); + if ((revision & 0xFF) != 0x10) + goto fail; + + /* Backup the frame interval register. */ + frame_interval = grub_ohci_readreg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL); + + /* Suspend the OHCI by issuing a reset. */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1); /* XXX: Magic. + */ + grub_millisleep (1); + grub_dprintf ("ohci", "OHCI reset\n"); + + /* Restore the frame interval register. */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL, frame_interval); + + /* Setup the HCCA. */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, (grub_uint32_t) o->hcca); + grub_dprintf ("ohci", "OHCI HCCA\n"); + + /* Enable the OHCI. */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, + (2 << 6)); + grub_dprintf ("ohci", "OHCI enable: 0x%02x\n", + (grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) >> 6) & 3); + + return 0; + + fail: + if (o) + grub_free ((void *) o->hcca); + grub_free (o); + + return 1; +} + + +static void +grub_ohci_inithw (void) +{ + grub_pci_iterate (grub_ohci_pci_iter); +} + + + +static int +grub_ohci_iterate (int (*hook) (grub_usb_controller_t dev)) +{ + struct grub_ohci *o; + struct grub_usb_controller dev; + + for (o = ohci; o; o = o->next) + { + dev.data = o; + if (hook (&dev)) + return 1; + } + + return 0; +} + +static void +grub_ohci_transaction (grub_ohci_td_t td, + grub_transfer_type_t type, unsigned int toggle, + grub_size_t size, char *data) +{ + grub_uint32_t token; + grub_uint32_t buffer; + grub_uint32_t buffer_end; + + grub_dprintf ("ohci", "OHCI transaction td=0x%02x type=%d, toggle=%d, size=%d\n", + td, type, toggle, size); + + switch (type) + { + case GRUB_USB_TRANSFER_TYPE_SETUP: + token = 0 << 19; + break; + case GRUB_USB_TRANSFER_TYPE_IN: + token = 2 << 19; + break; + case GRUB_USB_TRANSFER_TYPE_OUT: + token = 1 << 19; + break; + default: + token = 0; + break; + } + + /* Generate no interrupts. */ + token |= 7 << 21; + + /* Set the token. */ + token |= toggle << 24; + token |= 1 << 25; + + buffer = (grub_uint32_t) data; + buffer_end = buffer + size - 1; + + td->token = grub_cpu_to_le32 (token); + td->buffer = grub_cpu_to_le32 (buffer); + td->next_td = 0; + td->buffer_end = grub_cpu_to_le32 (buffer_end); +} + +static grub_usb_err_t +grub_ohci_transfer (grub_usb_controller_t dev, + grub_usb_transfer_t transfer) +{ + struct grub_ohci *o = (struct grub_ohci *) dev->data; + grub_ohci_ed_t ed; + grub_ohci_td_t td_list; + grub_uint32_t target; + grub_uint32_t td_tail; + grub_uint32_t td_head; + grub_uint32_t status; + grub_uint32_t control; + grub_usb_err_t err; + int i; + + /* Allocate an Endpoint Descriptor. */ + ed = grub_memalign (16, sizeof (*ed)); + if (! ed) + return GRUB_USB_ERR_INTERNAL; + + td_list = grub_memalign (16, sizeof (*td_list) * (transfer->transcnt + 1)); + if (! td_list) + { + grub_free ((void *) ed); + return GRUB_USB_ERR_INTERNAL; + } + + grub_dprintf ("ohci", "alloc=0x%08x\n", td_list); + + /* Setup all Transfer Descriptors. */ + for (i = 0; i < transfer->transcnt; i++) + { + grub_usb_transaction_t tr = &transfer->transactions[i]; + + grub_ohci_transaction (&td_list[i], tr->pid, tr->toggle, + tr->size, tr->data); + + td_list[i].next_td = grub_cpu_to_le32 (&td_list[i + 1]); + } + + /* Setup the Endpoint Descriptor. */ + + /* Set the device address. */ + target = transfer->devaddr; + + /* Set the endpoint. */ + target |= transfer->endpoint << 7; + + /* Set the device speed. */ + target |= (transfer->dev->speed == GRUB_USB_SPEED_LOW) << 13; + + /* Set the maximum packet size. */ + target |= transfer->max << 16; + + td_head = (grub_uint32_t) td_list; + + td_tail = (grub_uint32_t) &td_list[transfer->transcnt]; + + ed->target = grub_cpu_to_le32 (target); + ed->td_head = grub_cpu_to_le32 (td_head); + ed->td_tail = grub_cpu_to_le32 (td_tail); + ed->next_ed = grub_cpu_to_le32 (0); + + grub_dprintf ("ohci", "program OHCI\n"); + + /* Program the OHCI to actually transfer. */ + switch (transfer->type) + { + case GRUB_USB_TRANSACTION_TYPE_BULK: + { + grub_dprintf ("ohci", "add to bulk list\n"); + + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS); + control = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL); + + /* Disable the Control and Bulk lists. */ + control &= ~(3 << 4); + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, control); + + /* Clear BulkListFilled. */ + status &= ~(1 << 2); + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status); + + grub_ohci_writereg32 (o, GRUB_OHCI_REG_BULKHEAD, (grub_uint32_t) ed); + + /* Enable the Bulk list. */ + control |= 1 << 5; + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, control); + + /* Set BulkListFilled. */ + status |= 1 << 2; + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status); + + break; + } + + case GRUB_USB_TRANSACTION_TYPE_CONTROL: + { + grub_dprintf ("ohci", "add to control list\n"); + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS); + control = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL); + + /* Disable the Control and Bulk lists. */ + control &= ~(3 << 4); + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, control); + + /* Clear ControlListFilled. */ + status &= ~(1 << 1); + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status); + + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD, + (grub_uint32_t) ed); + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROLHEAD+1, + (grub_uint32_t) ed); + + /* Enable the Control list. */ + control |= 1 << 4; + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, control); + + /* Set ControlListFilled. */ + status |= 1 << 1; + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status); + break; + } + } + + grub_dprintf ("ohci", "wait for completion\n"); + grub_dprintf ("ohci", "control=0x%02x status=0x%02x\n", + grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL), + grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS)); + + /* Wait until the transfer is completed or STALLs. */ + while ((ed->td_head & ~0xf) != (ed->td_tail & ~0xf)) + { + grub_cpu_idle (); + + grub_dprintf ("ohci", "head=0x%02x tail=0x%02x\n", ed->td_head, ed->td_tail); + + /* Detected a STALL. */ + if (ed->td_head & 1) + break; + } + + grub_dprintf ("ohci", "complete\n"); + +/* if (ed->td_head & 1) */ +/* err = GRUB_USB_ERR_STALL; */ +/* else if (ed->td */ + + + if (ed->td_head & 1) + { + grub_uint8_t errcode; + grub_ohci_td_t tderr; + + tderr = (grub_ohci_td_t) grub_ohci_readreg32 (o, + GRUB_OHCI_REG_DONEHEAD); + errcode = tderr->token >> 28; + + switch (errcode) + { + case 0: + /* XXX: Should not happen! */ + grub_error (GRUB_ERR_IO, "OHCI without reporting the reason"); + err = GRUB_USB_ERR_INTERNAL; + break; + + case 1: + /* XXX: CRC error. */ + err = GRUB_USB_ERR_TIMEOUT; + break; + + case 2: + err = GRUB_USB_ERR_BITSTUFF; + break; + + case 3: + /* XXX: Data Toggle error. */ + err = GRUB_USB_ERR_DATA; + break; + + case 4: + err = GRUB_USB_ERR_STALL; + break; + + case 5: + /* XXX: Not responding. */ + err = GRUB_USB_ERR_TIMEOUT; + break; + + case 6: + /* XXX: PID Check bits failed. */ + err = GRUB_USB_ERR_BABBLE; + break; + + case 7: + /* XXX: PID unexpected failed. */ + err = GRUB_USB_ERR_BABBLE; + break; + + case 8: + /* XXX: Data overrun error. */ + err = GRUB_USB_ERR_DATA; + break; + + case 9: + /* XXX: Data underrun error. */ + err = GRUB_USB_ERR_DATA; + break; + + case 10: + /* XXX: Reserved. */ + err = GRUB_USB_ERR_NAK; + break; + + case 11: + /* XXX: Reserved. */ + err = GRUB_USB_ERR_NAK; + break; + + case 12: + /* XXX: Buffer overrun. */ + err = GRUB_USB_ERR_DATA; + break; + + case 13: + /* XXX: Buffer underrun. */ + err = GRUB_USB_ERR_DATA; + break; + + default: + err = GRUB_USB_ERR_NAK; + break; + } + } + else + err = GRUB_USB_ERR_NONE; + + /* Disable the Control and Bulk lists. */ + control = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL); + control &= ~(3 << 4); + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, control); + + /* Clear BulkListFilled and ControlListFilled. */ + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_CMDSTATUS); + status &= ~((1 << 2) | (1 << 3)); + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, status); + + /* XXX */ + grub_free (td_list); + grub_free (ed); + + return err; +} + +static grub_err_t +grub_ohci_portstatus (grub_usb_controller_t dev, + unsigned int port, unsigned int enable) +{ + struct grub_ohci *o = (struct grub_ohci *) dev->data; + grub_uint32_t status; + + /* Reset the port. */ + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + status |= (1 << 4); /* XXX: Magic. */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, status); + grub_millisleep (100); + + /* End the reset signaling. */ + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + status |= (1 << 20); /* XXX: Magic. */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, status); + grub_millisleep (10); + + /* Enable the port. */ + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + status |= (enable << 1); /* XXX: Magic. */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_RHUBPORT + port, status); + + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + grub_dprintf ("ohci", "portstatus=0x%02x\n", status); + + return GRUB_ERR_NONE; +} + +static grub_usb_speed_t +grub_ohci_detect_dev (grub_usb_controller_t dev, int port) +{ + struct grub_ohci *o = (struct grub_ohci *) dev->data; + grub_uint32_t status; + + status = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBPORT + port); + + grub_dprintf ("ohci", "detect_dev status=0x%02x\n", status); + + if (! (status & 1)) + return GRUB_USB_SPEED_NONE; + else if (status & (1 << 9)) + return GRUB_USB_SPEED_LOW; + else + return GRUB_USB_SPEED_FULL; +} + +static int +grub_ohci_hubports (grub_usb_controller_t dev) +{ + struct grub_ohci *o = (struct grub_ohci *) dev->data; + grub_uint32_t portinfo; + + portinfo = grub_ohci_readreg32 (o, GRUB_OHCI_REG_RHUBA); + + grub_dprintf ("ohci", "root hub ports=%d\n", portinfo & 0xFF); + + /* The root hub has exactly two ports. */ + return portinfo & 0xFF; +} + + + +static struct grub_usb_controller_dev usb_controller = +{ + .name = "ohci", + .iterate = grub_ohci_iterate, + .transfer = grub_ohci_transfer, + .hubports = grub_ohci_hubports, + .portstatus = grub_ohci_portstatus, + .detect_dev = grub_ohci_detect_dev +}; + +GRUB_MOD_INIT(ohci) +{ + grub_ohci_inithw (); + grub_usb_controller_dev_register (&usb_controller); +} + +GRUB_MOD_FINI(ohci) +{ + grub_usb_controller_dev_unregister (&usb_controller); +} diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c new file mode 100644 index 000000000..c59c0ca7d --- /dev/null +++ b/bus/usb/uhci.c @@ -0,0 +1,675 @@ +/* uhci.c - UHCI Support. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define GRUB_UHCI_IOMASK (0x7FF << 5) + +typedef enum + { + GRUB_UHCI_REG_USBCMD = 0x00, + GRUB_UHCI_REG_FLBASEADD = 0x08, + GRUB_UHCI_REG_PORTSC1 = 0x10, + GRUB_UHCI_REG_PORTSC2 = 0x12 + } grub_uhci_reg_t; + +#define GRUB_UHCI_LINK_TERMINATE 1 +#define GRUB_UHCI_LINK_QUEUE_HEAD 2 + + +/* UHCI Queue Head. */ +struct grub_uhci_qh +{ + /* Queue head link pointer which points to the next queue head. */ + grub_uint32_t linkptr; + + /* Queue element link pointer which points to the first data object + within the queue. */ + grub_uint32_t elinkptr; + + /* Queue heads are aligned on 16 bytes, pad so a queue head is 16 + bytes so we can store many in a 4K page. */ + grub_uint8_t pad[8]; +} __attribute__ ((packed)); + +/* UHCI Tranfer Descriptor. */ +struct grub_uhci_td +{ + /* Pointer to the next TD in the list. */ + grub_uint32_t linkptr; + + /* Control and status bits. */ + grub_uint32_t ctrl_status; + + /* All information required to transfer the Token packet. */ + grub_uint32_t token; + + /* A pointer to the data buffer, UHCI requires this pointer to be 32 + bits. */ + grub_uint32_t buffer; + + /* Another linkptr that is not overwritten by the Host Controller. + This is GRUB specific. */ + grub_uint32_t linkptr2; + + /* 3 additional 32 bits words reserved for the Host Controller Driver. */ + grub_uint32_t data[3]; +} __attribute__ ((packed)); + +typedef volatile struct grub_uhci_td *grub_uhci_td_t; +typedef volatile struct grub_uhci_qh *grub_uhci_qh_t; + +struct grub_uhci +{ + int iobase; + grub_uint32_t *framelist; + + /* 256 Queue Heads. */ + grub_uhci_qh_t qh; + + /* 256 Transfer Descriptors. */ + grub_uhci_td_t td; + + /* Free Transfer Descriptors. */ + grub_uhci_td_t tdfree; + + struct grub_uhci *next; +}; + +static struct grub_uhci *uhci; + +static grub_uint16_t +grub_uhci_readreg16 (struct grub_uhci *u, grub_uhci_reg_t reg) +{ + return grub_inw (u->iobase + reg); +} + +#if 0 +static grub_uint32_t +grub_uhci_readreg32 (struct grub_uhci *u, grub_uhci_reg_t reg) +{ + return grub_inl (u->iobase + reg); +} +#endif + +static void +grub_uhci_writereg16 (struct grub_uhci *u, + grub_uhci_reg_t reg, grub_uint16_t val) +{ + grub_outw (val, u->iobase + reg); +} + +static void +grub_uhci_writereg32 (struct grub_uhci *u, + grub_uhci_reg_t reg, grub_uint32_t val) +{ + grub_outl (val, u->iobase + reg); +} + +static grub_err_t +grub_uhci_portstatus (grub_usb_controller_t dev, + unsigned int port, unsigned int enable); + + +/* Iterate over all PCI devices. Determine if a device is an UHCI + controller. If this is the case, initialize it. */ +static int grub_uhci_pci_iter (int bus, int device, int func, + grub_pci_id_t pciid __attribute__((unused))) +{ + grub_uint32_t class; + grub_uint32_t subclass; + grub_uint32_t base; + grub_uint32_t fp; + grub_pci_address_t addr; + struct grub_uhci *u; + int i; + + addr = grub_pci_make_address (bus, device, func, 2); + class = grub_pci_read (addr); + addr = grub_pci_make_address (bus, device, func, 2); + class = grub_pci_read (addr); + + subclass = (class >> 16) & 0xFF; + class >>= 24; + + /* If this is not an UHCI controller, just return. */ + if (class != 0x0c || subclass != 0x03) + return 0; + + /* Determine IO base address. */ + addr = grub_pci_make_address (bus, device, func, 8); + base = grub_pci_read (addr); + /* Stop if there is no IO space base address defined. */ + if (! (base & 1)) + return 0; + + /* Allocate memory for the controller and register it. */ + u = grub_malloc (sizeof (*u)); + if (! u) + return 1; + + u->next = uhci; + uhci = u; + u->iobase = base & GRUB_UHCI_IOMASK; + u->framelist = 0; + u->qh = 0; + u->td = 0; + grub_dprintf ("uhci", "class=0x%02x 0x%02x base=0x%x\n", + class, subclass, u->iobase); + + /* Reserve a page for the frame list. */ + u->framelist = grub_memalign (4096, 4096); + if (! u->framelist) + goto fail; + + /* The framelist pointer of UHCI is only 32 bits, make sure this + code works on on 64 bits architectures. */ +#if GRUB_CPU_SIZEOF_VOID_P == 8 + if ((grub_uint64_t) u->framelist >> 32) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "allocated frame list memory not <4GB"); + goto fail; + } +#endif + + /* The QH pointer of UHCI is only 32 bits, make sure this + code works on on 64 bits architectures. */ + u->qh = (grub_uhci_qh_t) grub_memalign (4096, 4096); + if (! u->qh) + goto fail; + +#if GRUB_CPU_SIZEOF_VOID_P == 8 + if ((grub_uint64_t) u->qh >> 32) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "allocated QH memory not <4GB"); + goto fail; + } +#endif + + /* The TD pointer of UHCI is only 32 bits, make sure this + code works on on 64 bits architectures. */ + u->td = (grub_uhci_td_t) grub_memalign (4096, 4096*2); + if (! u->td) + goto fail; + +#if GRUB_CPU_SIZEOF_VOID_P == 8 + if ((grub_uint64_t) u->td >> 32) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "allocated TD memory not <4GB"); + goto fail; + } +#endif + + /* Link all Transfer Descriptors in a list of available Transfer + Descriptors. */ + for (i = 0; i < 256; i++) + u->td[i].linkptr = (grub_uint32_t) &u->td[i + 1]; + u->td[255 - 1].linkptr = 0; + u->tdfree = u->td; + + /* Make sure UHCI is disabled! */ + grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, 0); + + /* Setup the frame list pointers. Since no isochronous transfers + are and will be supported, they all point to the (same!) queue + head. */ + fp = (grub_uint32_t) u->qh & (~15); + /* Mark this as a queue head. */ + fp |= 2; + for (i = 0; i < 1024; i++) + u->framelist[i] = fp; + /* Program the framelist address into the UHCI controller. */ + grub_uhci_writereg32 (u, GRUB_UHCI_REG_FLBASEADD, + (grub_uint32_t) u->framelist); + + /* Make the Queue Heads point to eachother. */ + for (i = 0; i < 256; i++) + { + /* Point to the next QH. */ + u->qh[i].linkptr = (grub_uint32_t) (&u->qh[i + 1]) & (~15); + + /* This is a QH. */ + u->qh[i].linkptr |= GRUB_UHCI_LINK_QUEUE_HEAD; + + /* For the moment, do not point to a Transfer Descriptor. These + are set at transfer time, so just terminate it. */ + u->qh[i].elinkptr = 1; + } + + /* The last Queue Head should terminate. 256 are too many QHs so + just use 50. */ + u->qh[50 - 1].linkptr = 1; + + /* Enable UHCI again. */ + grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, 1 | (1 << 7)); + + /* UHCI is initialized and ready for transfers. */ + grub_dprintf ("uhci", "UHCI initialized\n"); + + +#if 0 + { + int i; + for (i = 0; i < 10; i++) + { + grub_uint16_t frnum; + + frnum = grub_uhci_readreg16 (u, 6); + grub_dprintf ("uhci", "Framenum=%d\n", frnum); + grub_millisleep (100); + } + } +#endif + + return 0; + + fail: + if (u) + { + grub_free ((void *) u->qh); + grub_free (u->framelist); + } + grub_free (u); + + return 1; +} + +static void +grub_uhci_inithw (void) +{ + grub_pci_iterate (grub_uhci_pci_iter); +} + +static grub_uhci_td_t +grub_alloc_td (struct grub_uhci *u) +{ + grub_uhci_td_t ret; + + /* Check if there is a Transfer Descriptor available. */ + if (! u->tdfree) + return NULL; + + ret = u->tdfree; + u->tdfree = (grub_uhci_td_t) u->tdfree->linkptr; + + return ret; +} + +static void +grub_free_td (struct grub_uhci *u, grub_uhci_td_t td) +{ + td->linkptr = (grub_uint32_t) u->tdfree; + u->tdfree = td; +} + +static void +grub_free_queue (struct grub_uhci *u, grub_uhci_td_t td) +{ + /* Free the TDs in this queue. */ + while (td) + { + grub_uhci_td_t tdprev; + + /* Unlink the queue. */ + tdprev = td; + td = (grub_uhci_td_t) td->linkptr2; + + /* Free the TD. */ + grub_free_td (u, tdprev); + } +} + +static grub_uhci_qh_t +grub_alloc_qh (struct grub_uhci *u, + grub_transaction_type_t tr __attribute__((unused))) +{ + int i; + grub_uhci_qh_t qh; + + /* Look for a Queue Head for this transfer. Skip the first QH if + this is a Interrupt Transfer. */ +#if 0 + if (tr == GRUB_USB_TRANSACTION_TYPE_INTERRUPT) + i = 0; + else +#endif + i = 1; + + for (; i < 255; i++) + { + if (u->qh[i].elinkptr & 1) + break; + } + qh = &u->qh[i]; + if (! (qh->elinkptr & 1)) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "no free queue heads available"); + return NULL; + } + + return qh; +} + +static grub_uhci_td_t +grub_uhci_transaction (struct grub_uhci *u, unsigned int endp, + grub_transfer_type_t type, unsigned int addr, + unsigned int toggle, grub_size_t size, + char *data) +{ + grub_uhci_td_t td; + static const unsigned int tf[] = { 0x69, 0xE1, 0x2D }; + + /* XXX: Check if data is <4GB. If it isn't, just copy stuff around. + This is only relevant for 64 bits architectures. */ + + /* Grab a free Transfer Descriptor and initialize it. */ + td = grub_alloc_td (u); + if (! td) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "no transfer descriptors available for UHCI transfer"); + return 0; + } + + grub_dprintf ("uhci", + "transaction: endp=%d, type=%d, addr=%d, toggle=%d, size=%d data=%p td=%p\n", + endp, type, addr, toggle, size, data, td); + + /* Don't point to any TD, just terminate. */ + td->linkptr = 1; + + /* Active! Only retry a transfer 3 times. */ + td->ctrl_status = (1 << 23) | (3 << 27); + + /* If zero bytes are transmitted, size is 0x7FF. Otherwise size is + size-1. */ + if (size == 0) + size = 0x7FF; + else + size = size - 1; + + /* Setup whatever is required for the token packet. */ + td->token = ((size << 21) | (toggle << 19) | (endp << 15) + | (addr << 8) | tf[type]); + + td->buffer = (grub_uint32_t) data; + + return td; +} + +static grub_usb_err_t +grub_uhci_transfer (grub_usb_controller_t dev, + grub_usb_transfer_t transfer) +{ + struct grub_uhci *u = (struct grub_uhci *) dev->data; + grub_uhci_qh_t qh; + grub_uhci_td_t td; + grub_uhci_td_t td_first = NULL; + grub_uhci_td_t td_prev = NULL; + grub_usb_err_t err = GRUB_USB_ERR_NONE; + int i; + + /* Allocate a queue head for the transfer queue. */ + qh = grub_alloc_qh (u, GRUB_USB_TRANSACTION_TYPE_CONTROL); + if (! qh) + return grub_errno; + + for (i = 0; i < transfer->transcnt; i++) + { + grub_usb_transaction_t tr = &transfer->transactions[i]; + + td = grub_uhci_transaction (u, transfer->endpoint, tr->pid, + transfer->devaddr, tr->toggle, + tr->size, tr->data); + if (! td) + { + /* Terminate and free. */ + td_prev->linkptr2 = 0; + td_prev->linkptr = 1; + + if (td_first) + grub_free_queue (u, td_first); + + return GRUB_USB_ERR_INTERNAL; + } + + if (! td_first) + td_first = td; + else + { + td_prev->linkptr2 = (grub_uint32_t) td; + td_prev->linkptr = (grub_uint32_t) td; + td_prev->linkptr |= 4; + } + td_prev = td; + } + td_prev->linkptr2 = 0; + td_prev->linkptr = 1; + + grub_dprintf ("uhci", "setup transaction %d\n", transfer->type); + + /* Link it into the queue and terminate. Now the transaction can + take place. */ + qh->elinkptr = (grub_uint32_t) td_first; + + grub_dprintf ("uhci", "initiate transaction\n"); + + /* Wait until either the transaction completed or an error + occured. */ + for (;;) + { + grub_uhci_td_t errtd; + + errtd = (grub_uhci_td_t) (qh->elinkptr & ~0x0f); + + grub_dprintf ("uhci", ">t status=0x%02x data=0x%02x td=%p\n", + errtd->ctrl_status, errtd->buffer & (~15), errtd); + + /* Check if the transaction completed. */ + if (qh->elinkptr & 1) + break; + + grub_dprintf ("uhci", "t status=0x%02x\n", errtd->ctrl_status); + + /* Check if the TD is not longer active. */ + if (! (errtd->ctrl_status & (1 << 23))) + { + grub_dprintf ("uhci", ">>t status=0x%02x\n", errtd->ctrl_status); + + /* Check if the endpoint is stalled. */ + if (errtd->ctrl_status & (1 << 22)) + err = GRUB_USB_ERR_STALL; + + /* Check if an error related to the data buffer occured. */ + if (errtd->ctrl_status & (1 << 21)) + err = GRUB_USB_ERR_DATA; + + /* Check if a babble error occured. */ + if (errtd->ctrl_status & (1 << 20)) + err = GRUB_USB_ERR_BABBLE; + + /* Check if a NAK occured. */ + if (errtd->ctrl_status & (1 << 19)) + err = GRUB_USB_ERR_NAK; + + /* Check if a timeout occured. */ + if (errtd->ctrl_status & (1 << 18)) + err = GRUB_USB_ERR_TIMEOUT; + + /* Check if a bitstuff error occured. */ + if (errtd->ctrl_status & (1 << 17)) + err = GRUB_USB_ERR_BITSTUFF; + + if (err) + goto fail; + + /* Fall through, no errors occured, so the QH might be + updated. */ + grub_dprintf ("uhci", "transaction fallthrough\n"); + } + } + + grub_dprintf ("uhci", "transaction complete\n"); + + fail: + + grub_dprintf ("uhci", "transaction failed\n"); + + /* Place the QH back in the free list and deallocate the associated + TDs. */ + qh->elinkptr = 1; + grub_free_queue (u, td_first); + + return err; +} + +static int +grub_uhci_iterate (int (*hook) (grub_usb_controller_t dev)) +{ + struct grub_uhci *u; + struct grub_usb_controller dev; + + for (u = uhci; u; u = u->next) + { + dev.data = u; + if (hook (&dev)) + return 1; + } + + return 0; +} + +static grub_err_t +grub_uhci_portstatus (grub_usb_controller_t dev, + unsigned int port, unsigned int enable) +{ + struct grub_uhci *u = (struct grub_uhci *) dev->data; + int reg; + unsigned int status; + + grub_dprintf ("uhci", "enable=%d port=%d\n", enable, port); + + if (port == 0) + reg = GRUB_UHCI_REG_PORTSC1; + else if (port == 1) + reg = GRUB_UHCI_REG_PORTSC2; + else + return grub_error (GRUB_ERR_OUT_OF_RANGE, + "UHCI Root Hub port does not exist"); + + status = grub_uhci_readreg16 (u, reg); + grub_dprintf ("uhci", "detect=0x%02x\n", status); + + /* Reset the port. */ + grub_uhci_writereg16 (u, reg, enable << 9); + + /* Wait for the reset to complete. XXX: How long exactly? */ + grub_millisleep (10); + status = grub_uhci_readreg16 (u, reg); + grub_uhci_writereg16 (u, reg, status & ~(1 << 9)); + grub_dprintf ("uhci", "reset completed\n"); + + /* Enable the port. */ + grub_uhci_writereg16 (u, reg, enable << 2); + grub_millisleep (10); + + grub_dprintf ("uhci", "waiting for the port to be enabled\n"); + + while (! (grub_uhci_readreg16 (u, reg) & (1 << 2))); + + status = grub_uhci_readreg16 (u, reg); + grub_dprintf ("uhci", ">3detect=0x%02x\n", status); + + + return GRUB_ERR_NONE; +} + +static grub_usb_speed_t +grub_uhci_detect_dev (grub_usb_controller_t dev, int port) +{ + struct grub_uhci *u = (struct grub_uhci *) dev->data; + int reg; + unsigned int status; + + if (port == 0) + reg = GRUB_UHCI_REG_PORTSC1; + else if (port == 1) + reg = GRUB_UHCI_REG_PORTSC2; + else + return grub_error (GRUB_ERR_OUT_OF_RANGE, + "UHCI Root Hub port does not exist"); + + status = grub_uhci_readreg16 (u, reg); + + grub_dprintf ("uhci", "detect=0x%02x port=%d\n", status, port); + + if (! (status & 1)) + return GRUB_USB_SPEED_NONE; + else if (status & (1 << 8)) + return GRUB_USB_SPEED_LOW; + else + return GRUB_USB_SPEED_FULL; +} + +static int +grub_uhci_hubports (grub_usb_controller_t dev __attribute__((unused))) +{ + /* The root hub has exactly two ports. */ + return 2; +} + + +static struct grub_usb_controller_dev usb_controller = +{ + .name = "uhci", + .iterate = grub_uhci_iterate, + .transfer = grub_uhci_transfer, + .hubports = grub_uhci_hubports, + .portstatus = grub_uhci_portstatus, + .detect_dev = grub_uhci_detect_dev +}; + +GRUB_MOD_INIT(uhci) +{ + grub_uhci_inithw (); + grub_usb_controller_dev_register (&usb_controller); + grub_dprintf ("uhci", "registed\n"); +} + +GRUB_MOD_FINI(uhci) +{ + struct grub_uhci *u; + + /* Disable all UHCI controllers. */ + for (u = uhci; u; u = u->next) + grub_uhci_writereg16 (u, GRUB_UHCI_REG_USBCMD, 0); + + /* Unregister the controller. */ + grub_usb_controller_dev_unregister (&usb_controller); +} diff --git a/bus/usb/usb.c b/bus/usb/usb.c new file mode 100644 index 000000000..a30598f00 --- /dev/null +++ b/bus/usb/usb.c @@ -0,0 +1,263 @@ +/* usb.c - Generic USB interfaces. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +static grub_usb_controller_dev_t grub_usb_list; + +void +grub_usb_controller_dev_register (grub_usb_controller_dev_t usb) +{ + auto int iterate_hook (grub_usb_controller_t dev); + + /* Iterate over all controllers found by the driver. */ + int iterate_hook (grub_usb_controller_t dev) + { + dev->dev = usb; + + /* Enable the ports of the USB Root Hub. */ + grub_usb_root_hub (dev); + + return 0; + } + + usb->next = grub_usb_list; + grub_usb_list = usb; + + if (usb->iterate) + usb->iterate (iterate_hook); +} + +void +grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb) +{ + grub_usb_controller_dev_t *p, q; + + for (p = &grub_usb_list, q = *p; q; p = &(q->next), q = q->next) + if (q == usb) + { + *p = q->next; + break; + } +} + +#if 0 +int +grub_usb_controller_iterate (int (*hook) (grub_usb_controller_t dev)) +{ + grub_usb_controller_dev_t p; + + auto int iterate_hook (grub_usb_controller_t dev); + + int iterate_hook (grub_usb_controller_t dev) + { + dev->dev = p; + if (hook (dev)) + return 1; + return 0; + } + + /* Iterate over all controller drivers. */ + for (p = grub_usb_list; p; p = p->next) + { + /* Iterate over the busses of the controllers. XXX: Actually, a + hub driver should do this. */ + if (p->iterate (iterate_hook)) + return 1; + } + + return 0; +} +#endif + + +grub_usb_err_t +grub_usb_clear_halt (grub_usb_device_t dev, int endpoint) +{ + dev->toggle[endpoint] = 0; + return grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT + | GRUB_USB_REQTYPE_STANDARD + | GRUB_USB_REQTYPE_TARGET_ENDP), + GRUB_USB_REQ_CLEAR_FEATURE, + GRUB_USB_FEATURE_ENDP_HALT, + endpoint, 0, 0); +} + +grub_usb_err_t +grub_usb_set_configuration (grub_usb_device_t dev, int configuration) +{ + int i; + + for (i = 0; i < 16; i++) + dev->toggle[i] = 0; + + return grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT + | GRUB_USB_REQTYPE_STANDARD + | GRUB_USB_REQTYPE_TARGET_DEV), + GRUB_USB_REQ_SET_CONFIGURATION, configuration, + 0, 0, NULL); +} + +grub_usb_err_t +grub_usb_get_descriptor (grub_usb_device_t dev, + grub_uint8_t type, grub_uint8_t index, + grub_size_t size, char *data) +{ + return grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN + | GRUB_USB_REQTYPE_STANDARD + | GRUB_USB_REQTYPE_TARGET_DEV), + GRUB_USB_REQ_GET_DESCRIPTOR, + (type << 8) | index, + 0, size, data); +} + +struct grub_usb_desc_endp * +grub_usb_get_endpdescriptor (grub_usb_device_t usbdev, int addr) +{ + int i; + + for (i = 0; i < usbdev->config[0].descconf->numif; i++) + { + struct grub_usb_desc_if *interf; + int j; + + interf = usbdev->config[0].interf[i].descif; + + for (j = 0; j < interf->endpointcnt; j++) + { + struct grub_usb_desc_endp *endp; + endp = &usbdev->config[0].interf[i].descendp[j]; + + if (endp->endp_addr == addr) + return endp; + } + } + + return NULL; +} + +grub_usb_err_t +grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, int langid, + char **string) +{ + struct grub_usb_desc_str descstr; + struct grub_usb_desc_str *descstrp; + grub_usb_err_t err; + + /* Only get the length. */ + err = grub_usb_control_msg (dev, 1 << 7, + 0x06, (3 << 8) | index, + langid, 1, (char *) &descstr); + if (err) + return err; + + descstrp = grub_malloc (descstr.length); + if (! descstrp) + return GRUB_USB_ERR_INTERNAL; + err = grub_usb_control_msg (dev, 1 << 7, + 0x06, (3 << 8) | index, + langid, descstr.length, (char *) descstrp); + + *string = grub_malloc (descstr.length / 2); + if (! *string) + { + grub_free (descstrp); + return GRUB_USB_ERR_INTERNAL; + } + + grub_utf16_to_utf8 ((grub_uint8_t *) *string, descstrp->str, descstrp->length / 2 - 1); + (*string)[descstr.length / 2 - 1] = '\0'; + grub_free (descstrp); + + return GRUB_USB_ERR_NONE; +} + +grub_usb_err_t +grub_usb_device_initialize (grub_usb_device_t dev) +{ + struct grub_usb_desc_device *descdev; + struct grub_usb_desc_config config; + grub_usb_err_t err; + int i; + + err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_DEVICE, + 0, sizeof (struct grub_usb_desc_device), + (char *) &dev->descdev); + if (err) + return err; + descdev = &dev->descdev; + + for (i = 0; i < 8; i++) + dev->config[i].descconf = NULL; + + for (i = 0; i < descdev->configcnt; i++) + { + int pos; + int currif; + char *data; + + /* First just read the first 4 bytes of the configuration + descriptor, after that it is known how many bytes really have + to be read. */ + err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_CONFIG, i, 4, + (char *) &config); + + data = grub_malloc (config.totallen); + if (! data) + { + err = GRUB_USB_ERR_INTERNAL; + goto fail; + } + + dev->config[i].descconf = (struct grub_usb_desc_config *) data; + err = grub_usb_get_descriptor (dev, GRUB_USB_DESCRIPTOR_CONFIG, i, + config.totallen, data); + if (err) + goto fail; + + /* Skip the configuration descriptor. */ + pos = sizeof (struct grub_usb_desc_config); + + /* Read all interfaces. */ + for (currif = 0; currif < dev->config[i].descconf->numif; currif++) + { + dev->config[i].interf[currif].descif + = (struct grub_usb_desc_if *) &data[pos]; + pos += sizeof (struct grub_usb_desc_if); + + /* Point to the first endpoint. */ + dev->config[i].interf[currif].descendp + = (struct grub_usb_desc_endp *) &data[pos]; + pos += (sizeof (struct grub_usb_desc_endp) + * dev->config[i].interf[currif].descif->endpointcnt); + } + } + + return GRUB_USB_ERR_NONE; + + fail: + + for (i = 0; i < 8; i++) + grub_free (dev->config[i].descconf); + + return err; +} diff --git a/bus/usb/usbhub.c b/bus/usb/usbhub.c new file mode 100644 index 000000000..ba0925a33 --- /dev/null +++ b/bus/usb/usbhub.c @@ -0,0 +1,193 @@ +/* usb.c - USB Hub Support. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +/* USB Supports 127 devices, with device 0 as special case. */ +static struct grub_usb_device *grub_usb_devs[128]; + +/* Add a device that currently has device number 0 and resides on + CONTROLLER, the Hub reported that the device speed is SPEED. */ +static grub_usb_device_t +grub_usb_hub_add_dev (grub_usb_controller_t controller, grub_usb_speed_t speed) +{ + grub_usb_device_t dev; + int i; + + dev = grub_malloc (sizeof (struct grub_usb_device)); + if (! dev) + return NULL; + + dev->controller = *controller; + dev->addr = 0; + dev->initialized = 0; + dev->speed = speed; + + grub_usb_device_initialize (dev); + + /* Assign a new address to the device. */ + for (i = 1; i < 128; i++) + { + if (! grub_usb_devs[i]) + break; + } + if (grub_usb_devs[i]) + { + grub_error (GRUB_ERR_IO, "Can't assign address to USB device"); + return NULL; + } + + grub_usb_control_msg (dev, + (GRUB_USB_REQTYPE_OUT + | GRUB_USB_REQTYPE_STANDARD + | GRUB_USB_REQTYPE_TARGET_DEV), + GRUB_USB_REQ_SET_ADDRESS, + i, 0, 0, NULL); + dev->addr = i; + dev->initialized = 1; + grub_usb_devs[i] = dev; + + return dev; +} + + +static grub_err_t +grub_usb_add_hub (grub_usb_device_t dev) +{ + struct grub_usb_usb_hubdesc hubdesc; + grub_err_t err; + int i; + + grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN + | GRUB_USB_REQTYPE_CLASS + | GRUB_USB_REQTYPE_TARGET_DEV), + GRUB_USB_REQ_GET_DESCRIPTOR, + (GRUB_USB_DESCRIPTOR_HUB << 8) | 0, + 0, sizeof (hubdesc), (char *) &hubdesc); + + /* Iterate over the Hub ports. */ + for (i = 1; i <= hubdesc.portcnt; i++) + { + grub_uint32_t status; + + /* Get the port status. */ + err = grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_IN + | GRUB_USB_REQTYPE_CLASS + | GRUB_USB_REQTYPE_TARGET_OTHER), + GRUB_USB_REQ_HUB_GET_PORT_STATUS, + 0, i, sizeof (status), (char *) &status); + + /* Just ignore the device if the Hub does not report the + status. */ + if (err) + continue; + + /* If connected, reset and enable the port. */ + if (status & GRUB_USB_HUB_STATUS_CONNECTED) + { + grub_usb_speed_t speed; + + /* Determine the device speed. */ + if (status & GRUB_USB_HUB_STATUS_LOWSPEED) + speed = GRUB_USB_SPEED_LOW; + else + { + if (status & GRUB_USB_HUB_STATUS_HIGHSPEED) + speed = GRUB_USB_SPEED_HIGH; + else + speed = GRUB_USB_SPEED_FULL; + } + + /* A device is actually connected to this port, not enable + the port. XXX: Why 0x03? According to some docs it + should be 0x0. Check the specification! */ + err = grub_usb_control_msg (dev, (GRUB_USB_REQTYPE_OUT + | GRUB_USB_REQTYPE_CLASS + | GRUB_USB_REQTYPE_TARGET_OTHER), + 0x3, 0x4, i, 0, 0); + + /* If the Hub does not cooperate for this port, just skip + the port. */ + if (err) + continue; + + /* Add the device and assign a device address to it. */ + grub_usb_hub_add_dev (&dev->controller, speed); + } + } + + return GRUB_ERR_NONE; +} + +grub_usb_err_t +grub_usb_root_hub (grub_usb_controller_t controller) +{ + grub_err_t err; + int ports; + int i; + + /* Query the number of ports the root Hub has. */ + ports = controller->dev->hubports (controller); + + for (i = 0; i < ports; i++) + { + grub_usb_speed_t speed = controller->dev->detect_dev (controller, i); + + if (speed != GRUB_USB_SPEED_NONE) + { + grub_usb_device_t dev; + + /* Enable the port. */ + err = controller->dev->portstatus (controller, i, 1); + if (err) + continue; + + /* Enable the port and create a device. */ + dev = grub_usb_hub_add_dev (controller, speed); + if (! dev) + continue; + + /* If the device is a Hub, scan it for more devices. */ + if (dev->descdev.class == 0x09) + grub_usb_add_hub (dev); + } + } + + return GRUB_USB_ERR_NONE; +} + +int +grub_usb_iterate (int (*hook) (grub_usb_device_t dev)) +{ + int i; + + for (i = 0; i < 128; i++) + { + if (grub_usb_devs[i]) + { + if (hook (grub_usb_devs[i])) + return 1; + } + } + + return 0; +} diff --git a/bus/usb/usbtrans.c b/bus/usb/usbtrans.c new file mode 100644 index 000000000..8b2d5ad01 --- /dev/null +++ b/bus/usb/usbtrans.c @@ -0,0 +1,212 @@ +/* usbtrans.c - USB Transfers and Transactions. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +grub_usb_err_t +grub_usb_control_msg (grub_usb_device_t dev, + grub_uint8_t reqtype, + grub_uint8_t request, + grub_uint16_t value, + grub_uint16_t index, + grub_size_t size, char *data) +{ + int i; + grub_usb_transfer_t transfer; + int datablocks; + struct grub_usb_packet_setup setupdata; + grub_usb_err_t err; + int max; + + grub_dprintf ("usb", + "control: reqtype=0x%02x req=0x%02x val=0x%02x idx=0x%02x size=%d\n", + reqtype, request, value, index, size); + + /* Create a transfer. */ + transfer = grub_malloc (sizeof (struct grub_usb_transfer)); + if (! transfer) + return grub_errno; + + /* Determine the maximum packet size. */ + if (dev->initialized) + max = dev->descdev.maxsize0; + else + max = 64; + + datablocks = (size + max - 1) / max; + + /* XXX: Discriminate between different types of control + messages. */ + transfer->transcnt = datablocks + 2; + transfer->size = size; /* XXX ? */ + transfer->endpoint = 0; + transfer->devaddr = dev->addr; + transfer->type = GRUB_USB_TRANSACTION_TYPE_CONTROL; + transfer->max = max; + transfer->dev = dev; + + /* Allocate an array of transfer data structures. */ + transfer->transactions = grub_malloc (transfer->transcnt + * sizeof (struct grub_usb_transfer)); + if (! transfer->transactions) + { + grub_free (transfer); + return grub_errno; + } + + /* Build a Setup packet. XXX: Endianess. */ + setupdata.reqtype = reqtype; + setupdata.request = request; + setupdata.value = value; + setupdata.index = index; + setupdata.length = size; + transfer->transactions[0].size = sizeof (setupdata); + transfer->transactions[0].pid = GRUB_USB_TRANSFER_TYPE_SETUP; + transfer->transactions[0].data = (char *) &setupdata; + transfer->transactions[0].toggle = 0; + + /* Now the data... XXX: Is this the right way to transfer control + transfers? */ + for (i = 0; i < datablocks; i++) + { + grub_usb_transaction_t tr = &transfer->transactions[i + 1]; + + tr->size = (size > max) ? max : size; + /* Use the right most bit as the data toggle. Simple and + effective. */ + tr->toggle = !(i & 1); + if (reqtype & 128) + tr->pid = GRUB_USB_TRANSFER_TYPE_IN; + else + tr->pid = GRUB_USB_TRANSFER_TYPE_OUT; + tr->data = &data[i * max]; + size -= max; + } + + /* End with an empty OUT transaction. */ + transfer->transactions[datablocks + 1].size = 0; + transfer->transactions[datablocks + 1].data = NULL; + if (reqtype & 128) + transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_OUT; + else + transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_IN; + + transfer->transactions[datablocks + 1].toggle = 1; + + err = dev->controller.dev->transfer (&dev->controller, transfer); + + grub_free (transfer->transactions); + grub_free (transfer); + + return err; +} + +static grub_usb_err_t +grub_usb_bulk_readwrite (grub_usb_device_t dev, + int endpoint, grub_size_t size, char *data, + grub_transfer_type_t type) +{ + int i; + grub_usb_transfer_t transfer; + int datablocks; + unsigned int max; + grub_usb_err_t err; + int toggle = dev->toggle[endpoint]; + + /* Use the maximum packet size given in the endpoint descriptor. */ + if (dev->initialized) + { + struct grub_usb_desc_endp *endpdesc; + endpdesc = grub_usb_get_endpdescriptor (dev, 0); + + if (endpdesc) + max = endpdesc->maxpacket; + else + max = 64; + } + else + max = 64; + + /* Create a transfer. */ + transfer = grub_malloc (sizeof (struct grub_usb_transfer)); + if (! transfer) + return grub_errno; + + datablocks = ((size + max - 1) / max); + transfer->transcnt = datablocks; + transfer->size = size - 1; + transfer->endpoint = endpoint; + transfer->devaddr = dev->addr; + transfer->type = GRUB_USB_TRANSACTION_TYPE_BULK; + transfer->max = max; + transfer->dev = dev; + + /* Allocate an array of transfer data structures. */ + transfer->transactions = grub_malloc (transfer->transcnt + * sizeof (struct grub_usb_transfer)); + if (! transfer->transactions) + { + grub_free (transfer); + return grub_errno; + } + + /* Set up all transfers. */ + for (i = 0; i < datablocks; i++) + { + grub_usb_transaction_t tr = &transfer->transactions[i]; + + tr->size = (size > max) ? max : size; + /* XXX: Use the right most bit as the data toggle. Simple and + effective. */ + tr->toggle = toggle; + toggle = toggle ? 0 : 1; + tr->pid = type; + tr->data = &data[i * max]; + size -= tr->size; + } + + err = dev->controller.dev->transfer (&dev->controller, transfer); + grub_dprintf ("usb", "toggle=%d\n", toggle); + dev->toggle[endpoint] = toggle; + + grub_free (transfer->transactions); + grub_free (transfer); + + return err; +} + +grub_usb_err_t +grub_usb_bulk_write (grub_usb_device_t dev, + int endpoint, grub_size_t size, char *data) +{ + return grub_usb_bulk_readwrite (dev, endpoint, size, data, + GRUB_USB_TRANSFER_TYPE_OUT); +} + +grub_usb_err_t +grub_usb_bulk_read (grub_usb_device_t dev, + int endpoint, grub_size_t size, char *data) +{ + return grub_usb_bulk_readwrite (dev, endpoint, size, data, + GRUB_USB_TRANSFER_TYPE_IN); +} diff --git a/commands/usbtest.c b/commands/usbtest.c new file mode 100644 index 000000000..8262b2e64 --- /dev/null +++ b/commands/usbtest.c @@ -0,0 +1,160 @@ +/* usbtest.c - test module for USB */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +static const char *usb_classes[] = + { + "", + "Audio", + "Communication Interface", + "HID", + "", + "Physical", + "Image", + "Printer", + "Mass Storage", + "Hub", + "Data Interface", + "Smart Card", + "Content Security", + "Video" + }; + +static const char *usb_endp_type[] = + { + "Control", + "Isochronous", + "Bulk", + "Interrupt" + }; + +static const char *usb_devspeed[] = + { + "", + "Low", + "Full", + "High" + }; + +static void +usb_print_str (const char *description, grub_usb_device_t dev, int idx) +{ + char *name; + /* XXX: LANGID */ + + if (! idx) + return; + + grub_usb_get_string (dev, idx, 0x0409, &name); + grub_printf ("%s: `%s'\n", description, name); + grub_free (name); +} + +static int +usb_iterate (grub_usb_device_t dev) +{ + struct grub_usb_desc_device *descdev; + int i; + + descdev = &dev->descdev; + + usb_print_str ("Product", dev, descdev->strprod); + usb_print_str ("Vendor", dev, descdev->strvendor); + usb_print_str ("Serial", dev, descdev->strserial); + + if (descdev->class > 0 && descdev->class <= 0x0E) + grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", + descdev->class, usb_classes[descdev->class], + descdev->subclass, descdev->protocol); + grub_printf ("USB version %d.%d, VendorID: 0x%02x, ProductID: 0x%02x, #conf: %d\n", + descdev->usbrel >> 8, (descdev->usbrel >> 4) & 0x0F, + descdev->vendorid, descdev->prodid, descdev->configcnt); + + grub_printf ("%s speed device\n", usb_devspeed[dev->speed]); + + for (i = 0; i < descdev->configcnt; i++) + { + struct grub_usb_desc_config *config; + + config = dev->config[i].descconf; + usb_print_str ("Configuration:", dev, config->strconfig); + } + + for (i = 0; i < dev->config[0].descconf->numif; i++) + { + int j; + struct grub_usb_desc_if *interf; + interf = dev->config[0].interf[i].descif; + + grub_printf ("Interface #%d: #Endpoints: %d ", + i, interf->endpointcnt); + if (interf->class > 0 && interf->class <= 0x0E) + grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", + interf->class, usb_classes[interf->class], + interf->subclass, interf->protocol); + + usb_print_str ("Interface", dev, interf->strif); + + for (j = 0; j < interf->endpointcnt; j++) + { + struct grub_usb_desc_endp *endp; + endp = &dev->config[0].interf[i].descendp[j]; + + grub_printf ("Endpoint #%d: %s, max packed size: %d, transfer type: %s, latency: %d\n", + endp->endp_addr & 15, + (endp->endp_addr & 128) ? "IN" : "OUT", + endp->maxpacket, usb_endp_type[endp->attrib & 3], + endp->interval); + } + } + + grub_printf("\n"); + + return 0; +} + +static grub_err_t +grub_cmd_usbtest (struct grub_arg_list *state __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) +{ + grub_printf ("USB devices:\n\n"); + grub_usb_iterate (usb_iterate); + + return 0; +} + +GRUB_MOD_INIT(usbtest) +{ + (void)mod; /* To stop warning. */ + grub_register_command ("usb", grub_cmd_usbtest, GRUB_COMMAND_FLAG_BOTH, + "usb", "Test USB support", 0); +} + +GRUB_MOD_FINI(usbtest) +{ + grub_unregister_command ("usb"); +} diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 63d0b239c..5345475e3 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -525,7 +525,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c \ + disk/host.c disk/loopback.c disk/scsi.c \ fs/fshelp.c \ \ io/gzio.c \ @@ -553,11 +553,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -631,6 +631,10 @@ grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_loopback.d +grub_emu-disk_scsi.o: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_scsi.d + grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d @@ -912,7 +916,35 @@ grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) -include grub_emu-grub_emu_init.d -grub_emu_LDFLAGS = $(LIBCURSES) +grub_emu_LDFLAGS = $(LIBCURSES) + +ifeq ($(enable_grub_emu_usb), yes) +grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \ + commands/usbtest.c +CLEANFILES += grub-emu$(EXEEXT) grub_emu-disk_usbms.o grub_emu-util_usb.o grub_emu-bus_usb_usb.o grub_emu-commands_usbtest.o +MOSTLYCLEANFILES += grub_emu-disk_usbms.d grub_emu-util_usb.d grub_emu-bus_usb_usb.d grub_emu-commands_usbtest.d + +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-disk_usbms.o grub_emu-util_usb.o grub_emu-bus_usb_usb.o grub_emu-commands_usbtest.o + $(CC) -o $@ grub_emu-disk_usbms.o grub_emu-util_usb.o grub_emu-bus_usb_usb.o grub_emu-commands_usbtest.o $(LDFLAGS) $(grub_emu_LDFLAGS) + +grub_emu-disk_usbms.o: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) + $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-disk_usbms.d + +grub_emu-util_usb.o: util/usb.c $(util/usb.c_DEPENDENCIES) + $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-util_usb.d + +grub_emu-bus_usb_usb.o: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) + $(CC) -Ibus/usb -I$(srcdir)/bus/usb $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-bus_usb_usb.d + +grub_emu-commands_usbtest.o: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_usbtest.d + +grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB) +endif # Scripts. sbin_SCRIPTS = grub-install @@ -942,7 +974,8 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ - datehook.mod lsmmap.mod + datehook.mod lsmmap.mod \ + usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -2673,6 +2706,329 @@ partmap-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i3 bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For usb.mod +usb_mod_SOURCES = bus/usb/usb.c bus/usb/usbtrans.c bus/usb/usbhub.c +CLEANFILES += usb.mod mod-usb.o mod-usb.c pre-usb.o usb_mod-bus_usb_usb.o usb_mod-bus_usb_usbtrans.o usb_mod-bus_usb_usbhub.o und-usb.lst +ifneq ($(usb_mod_EXPORTS),no) +CLEANFILES += def-usb.lst +DEFSYMFILES += def-usb.lst +endif +MOSTLYCLEANFILES += usb_mod-bus_usb_usb.d usb_mod-bus_usb_usbtrans.d usb_mod-bus_usb_usbhub.d +UNDSYMFILES += und-usb.lst + +usb.mod: pre-usb.o mod-usb.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(usb_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usb.o mod-usb.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-usb.o: $(usb_mod_DEPENDENCIES) usb_mod-bus_usb_usb.o usb_mod-bus_usb_usbtrans.o usb_mod-bus_usb_usbhub.o + -rm -f $@ + $(TARGET_CC) $(usb_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usb_mod-bus_usb_usb.o usb_mod-bus_usb_usbtrans.o usb_mod-bus_usb_usbhub.o + +mod-usb.o: mod-usb.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -c -o $@ $< + +mod-usb.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'usb' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(usb_mod_EXPORTS),no) +def-usb.lst: pre-usb.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usb/' > $@ +endif + +und-usb.lst: pre-usb.o + echo 'usb' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +usb_mod-bus_usb_usb.o: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) + $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -MD -c -o $@ $< +-include usb_mod-bus_usb_usb.d + +CLEANFILES += cmd-usb_mod-bus_usb_usb.lst fs-usb_mod-bus_usb_usb.lst partmap-usb_mod-bus_usb_usb.lst +COMMANDFILES += cmd-usb_mod-bus_usb_usb.lst +FSFILES += fs-usb_mod-bus_usb_usb.lst +PARTMAPFILES += partmap-usb_mod-bus_usb_usb.lst + +cmd-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) + +fs-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) + +partmap-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) + + +usb_mod-bus_usb_usbtrans.o: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) + $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -MD -c -o $@ $< +-include usb_mod-bus_usb_usbtrans.d + +CLEANFILES += cmd-usb_mod-bus_usb_usbtrans.lst fs-usb_mod-bus_usb_usbtrans.lst partmap-usb_mod-bus_usb_usbtrans.lst +COMMANDFILES += cmd-usb_mod-bus_usb_usbtrans.lst +FSFILES += fs-usb_mod-bus_usb_usbtrans.lst +PARTMAPFILES += partmap-usb_mod-bus_usb_usbtrans.lst + +cmd-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) + +fs-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) + +partmap-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) + + +usb_mod-bus_usb_usbhub.o: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) + $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -MD -c -o $@ $< +-include usb_mod-bus_usb_usbhub.d + +CLEANFILES += cmd-usb_mod-bus_usb_usbhub.lst fs-usb_mod-bus_usb_usbhub.lst partmap-usb_mod-bus_usb_usbhub.lst +COMMANDFILES += cmd-usb_mod-bus_usb_usbhub.lst +FSFILES += fs-usb_mod-bus_usb_usbhub.lst +PARTMAPFILES += partmap-usb_mod-bus_usb_usbhub.lst + +cmd-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) + +fs-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) + +partmap-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) + + +usb_mod_CFLAGS = $(COMMON_CFLAGS) +usb_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For usbtest.mod +usbtest_mod_SOURCES = commands/usbtest.c +CLEANFILES += usbtest.mod mod-usbtest.o mod-usbtest.c pre-usbtest.o usbtest_mod-commands_usbtest.o und-usbtest.lst +ifneq ($(usbtest_mod_EXPORTS),no) +CLEANFILES += def-usbtest.lst +DEFSYMFILES += def-usbtest.lst +endif +MOSTLYCLEANFILES += usbtest_mod-commands_usbtest.d +UNDSYMFILES += und-usbtest.lst + +usbtest.mod: pre-usbtest.o mod-usbtest.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(usbtest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usbtest.o mod-usbtest.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-usbtest.o: $(usbtest_mod_DEPENDENCIES) usbtest_mod-commands_usbtest.o + -rm -f $@ + $(TARGET_CC) $(usbtest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usbtest_mod-commands_usbtest.o + +mod-usbtest.o: mod-usbtest.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -c -o $@ $< + +mod-usbtest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'usbtest' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(usbtest_mod_EXPORTS),no) +def-usbtest.lst: pre-usbtest.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usbtest/' > $@ +endif + +und-usbtest.lst: pre-usbtest.o + echo 'usbtest' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +usbtest_mod-commands_usbtest.o: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -MD -c -o $@ $< +-include usbtest_mod-commands_usbtest.d + +CLEANFILES += cmd-usbtest_mod-commands_usbtest.lst fs-usbtest_mod-commands_usbtest.lst partmap-usbtest_mod-commands_usbtest.lst +COMMANDFILES += cmd-usbtest_mod-commands_usbtest.lst +FSFILES += fs-usbtest_mod-commands_usbtest.lst +PARTMAPFILES += partmap-usbtest_mod-commands_usbtest.lst + +cmd-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbtest > $@ || (rm -f $@; exit 1) + +fs-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbtest > $@ || (rm -f $@; exit 1) + +partmap-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbtest > $@ || (rm -f $@; exit 1) + + +usbtest_mod_CFLAGS = $(COMMON_CFLAGS) +usbtest_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For uhci.mod +uhci_mod_SOURCES = bus/usb/uhci.c +CLEANFILES += uhci.mod mod-uhci.o mod-uhci.c pre-uhci.o uhci_mod-bus_usb_uhci.o und-uhci.lst +ifneq ($(uhci_mod_EXPORTS),no) +CLEANFILES += def-uhci.lst +DEFSYMFILES += def-uhci.lst +endif +MOSTLYCLEANFILES += uhci_mod-bus_usb_uhci.d +UNDSYMFILES += und-uhci.lst + +uhci.mod: pre-uhci.o mod-uhci.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(uhci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-uhci.o mod-uhci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-uhci.o: $(uhci_mod_DEPENDENCIES) uhci_mod-bus_usb_uhci.o + -rm -f $@ + $(TARGET_CC) $(uhci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ uhci_mod-bus_usb_uhci.o + +mod-uhci.o: mod-uhci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -c -o $@ $< + +mod-uhci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'uhci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(uhci_mod_EXPORTS),no) +def-uhci.lst: pre-uhci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 uhci/' > $@ +endif + +und-uhci.lst: pre-uhci.o + echo 'uhci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +uhci_mod-bus_usb_uhci.o: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) + $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -MD -c -o $@ $< +-include uhci_mod-bus_usb_uhci.d + +CLEANFILES += cmd-uhci_mod-bus_usb_uhci.lst fs-uhci_mod-bus_usb_uhci.lst partmap-uhci_mod-bus_usb_uhci.lst +COMMANDFILES += cmd-uhci_mod-bus_usb_uhci.lst +FSFILES += fs-uhci_mod-bus_usb_uhci.lst +PARTMAPFILES += partmap-uhci_mod-bus_usb_uhci.lst + +cmd-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh uhci > $@ || (rm -f $@; exit 1) + +fs-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh uhci > $@ || (rm -f $@; exit 1) + +partmap-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh uhci > $@ || (rm -f $@; exit 1) + + +uhci_mod_CFLAGS = $(COMMON_CFLAGS) +uhci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For ohci.mod +ohci_mod_SOURCES = bus/usb/ohci.c +CLEANFILES += ohci.mod mod-ohci.o mod-ohci.c pre-ohci.o ohci_mod-bus_usb_ohci.o und-ohci.lst +ifneq ($(ohci_mod_EXPORTS),no) +CLEANFILES += def-ohci.lst +DEFSYMFILES += def-ohci.lst +endif +MOSTLYCLEANFILES += ohci_mod-bus_usb_ohci.d +UNDSYMFILES += und-ohci.lst + +ohci.mod: pre-ohci.o mod-ohci.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(ohci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ohci.o mod-ohci.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-ohci.o: $(ohci_mod_DEPENDENCIES) ohci_mod-bus_usb_ohci.o + -rm -f $@ + $(TARGET_CC) $(ohci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ohci_mod-bus_usb_ohci.o + +mod-ohci.o: mod-ohci.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -c -o $@ $< + +mod-ohci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'ohci' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(ohci_mod_EXPORTS),no) +def-ohci.lst: pre-ohci.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ohci/' > $@ +endif + +und-ohci.lst: pre-ohci.o + echo 'ohci' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +ohci_mod-bus_usb_ohci.o: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) + $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -MD -c -o $@ $< +-include ohci_mod-bus_usb_ohci.d + +CLEANFILES += cmd-ohci_mod-bus_usb_ohci.lst fs-ohci_mod-bus_usb_ohci.lst partmap-ohci_mod-bus_usb_ohci.lst +COMMANDFILES += cmd-ohci_mod-bus_usb_ohci.lst +FSFILES += fs-ohci_mod-bus_usb_ohci.lst +PARTMAPFILES += partmap-ohci_mod-bus_usb_ohci.lst + +cmd-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ohci > $@ || (rm -f $@; exit 1) + +fs-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ohci > $@ || (rm -f $@; exit 1) + +partmap-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ohci > $@ || (rm -f $@; exit 1) + + +ohci_mod_CFLAGS = $(COMMON_CFLAGS) +ohci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For usbms.mod +usbms_mod_SOURCES = disk/usbms.c +CLEANFILES += usbms.mod mod-usbms.o mod-usbms.c pre-usbms.o usbms_mod-disk_usbms.o und-usbms.lst +ifneq ($(usbms_mod_EXPORTS),no) +CLEANFILES += def-usbms.lst +DEFSYMFILES += def-usbms.lst +endif +MOSTLYCLEANFILES += usbms_mod-disk_usbms.d +UNDSYMFILES += und-usbms.lst + +usbms.mod: pre-usbms.o mod-usbms.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(usbms_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usbms.o mod-usbms.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-usbms.o: $(usbms_mod_DEPENDENCIES) usbms_mod-disk_usbms.o + -rm -f $@ + $(TARGET_CC) $(usbms_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usbms_mod-disk_usbms.o + +mod-usbms.o: mod-usbms.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -c -o $@ $< + +mod-usbms.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'usbms' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(usbms_mod_EXPORTS),no) +def-usbms.lst: pre-usbms.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usbms/' > $@ +endif + +und-usbms.lst: pre-usbms.o + echo 'usbms' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +usbms_mod-disk_usbms.o: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -MD -c -o $@ $< +-include usbms_mod-disk_usbms.d + +CLEANFILES += cmd-usbms_mod-disk_usbms.lst fs-usbms_mod-disk_usbms.lst partmap-usbms_mod-disk_usbms.lst +COMMANDFILES += cmd-usbms_mod-disk_usbms.lst +FSFILES += fs-usbms_mod-disk_usbms.lst +PARTMAPFILES += partmap-usbms_mod-disk_usbms.lst + +cmd-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbms > $@ || (rm -f $@; exit 1) + +fs-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbms > $@ || (rm -f $@; exit 1) + +partmap-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbms > $@ || (rm -f $@; exit 1) + + +usbms_mod_CFLAGS = $(COMMON_CFLAGS) +usbms_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For pxe.mod pxe_mod_SOURCES = fs/i386/pc/pxe.c CLEANFILES += pxe.mod mod-pxe.o mod-pxe.c pre-pxe.o pxe_mod-fs_i386_pc_pxe.o und-pxe.lst diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index e7de5e9a7..0b405e306 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -118,7 +118,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ - disk/host.c disk/loopback.c \ + disk/host.c disk/loopback.c disk/scsi.c \ fs/fshelp.c \ \ io/gzio.c \ @@ -147,7 +147,13 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -grub_emu_LDFLAGS = $(LIBCURSES) +grub_emu_LDFLAGS = $(LIBCURSES) + +ifeq ($(enable_grub_emu_usb), yes) +grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \ + commands/usbtest.c +grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB) +endif # Scripts. sbin_SCRIPTS = grub-install @@ -165,7 +171,8 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ - datehook.mod lsmmap.mod + datehook.mod lsmmap.mod \ + usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -301,6 +308,31 @@ bsd_mod_SOURCES = loader/i386/bsd_normal.c bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For usb.mod +usb_mod_SOURCES = bus/usb/usb.c bus/usb/usbtrans.c bus/usb/usbhub.c +usb_mod_CFLAGS = $(COMMON_CFLAGS) +usb_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For usbtest.mod +usbtest_mod_SOURCES = commands/usbtest.c +usbtest_mod_CFLAGS = $(COMMON_CFLAGS) +usbtest_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For uhci.mod +uhci_mod_SOURCES = bus/usb/uhci.c +uhci_mod_CFLAGS = $(COMMON_CFLAGS) +uhci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For ohci.mod +ohci_mod_SOURCES = bus/usb/ohci.c +ohci_mod_CFLAGS = $(COMMON_CFLAGS) +ohci_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For usbms.mod +usbms_mod_SOURCES = disk/usbms.c +usbms_mod_CFLAGS = $(COMMON_CFLAGS) +usbms_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For pxe.mod pxe_mod_SOURCES = fs/i386/pc/pxe.c pxe_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/config.h.in b/config.h.in index dbd87d992..91e9615f8 100644 --- a/config.h.in +++ b/config.h.in @@ -76,6 +76,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H +/* Define to 1 if you have the header file. */ +#undef HAVE_USB_H + /* Define to 1 if you enable memory manager debugging. */ #undef MM_DEBUG diff --git a/configure b/configure index e1c8c9691..74c400f63 100644 --- a/configure +++ b/configure @@ -700,7 +700,9 @@ TARGET_CPPFLAGS TARGET_LDFLAGS MODULE_LDFLAGS LIBCURSES +LIBUSB enable_grub_emu +enable_grub_emu_usb enable_grub_fstest enable_grub_pe2elf FREETYPE @@ -1303,6 +1305,8 @@ Optional Features: --enable-lzo use lzo to compress kernel (default is lzma) --enable-mm-debug include memory manager debugging --enable-grub-emu build and install the `grub-emu' debugging utility + --enable-grub-emu-usb build and install the `grub-emu' debugging utility + with USB support --enable-grub-fstest build and install the `grub-fstest' debugging utility --enable-grub-pe2elf build and install the `grub-pe2elf' conversion @@ -7832,6 +7836,11 @@ if test "${enable_grub_emu+set}" = set; then enableval=$enable_grub_emu; fi +# Check whether --enable-grub-emu-usb was given. +if test "${enable_grub_emu_usb+set}" = set; then + enableval=$enable_grub_emu_usb; +fi + if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 @@ -8413,8 +8422,234 @@ fi done + + if [ x"$enable_grub_emu_usb" = xyes ]; then + # Check for libusb libraries. + { echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 +echo $ECHO_N "checking for usb_claim_interface in -lusb... $ECHO_C" >&6; } +if test "${ac_cv_lib_usb_usb_claim_interface+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lusb $LIBS" +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char usb_claim_interface (); +int +main () +{ +return usb_claim_interface (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + ac_cv_lib_usb_usb_claim_interface=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_lib_usb_usb_claim_interface=no fi +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 +echo "${ECHO_T}$ac_cv_lib_usb_usb_claim_interface" >&6; } +if test $ac_cv_lib_usb_usb_claim_interface = yes; then + LIBUSB="-lusb" +else + { { echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 +echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} + { (exit 1); exit 1; }; } +fi + + + + # Check for headers. + +for ac_header in usb.h +do +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +else + # Is the header compilable? +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +#include <$ac_header> +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } + +# Is the header present? +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <$ac_header> +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-grub@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + eval "$as_ac_Header=\$ac_header_preproc" +fi +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } + +fi +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +_ACEOF + +else + { { echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 +echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} + { (exit 1); exit 1; }; } +fi + +done + + fi +fi + + # Check whether --enable-grub-fstest was given. if test "${enable_grub_fstest+set}" = set; then @@ -9209,7 +9444,9 @@ TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim MODULE_LDFLAGS!$MODULE_LDFLAGS$ac_delim LIBCURSES!$LIBCURSES$ac_delim +LIBUSB!$LIBUSB$ac_delim enable_grub_emu!$enable_grub_emu$ac_delim +enable_grub_emu_usb!$enable_grub_emu_usb$ac_delim enable_grub_fstest!$enable_grub_fstest$ac_delim enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim FREETYPE!$FREETYPE$ac_delim @@ -9220,7 +9457,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 94; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 @@ -9239,7 +9476,7 @@ fi cat >>$CONFIG_STATUS <<_ACEOF cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF sed ' s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g @@ -9252,8 +9489,6 @@ N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n ' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -:end -s/|#_!!_#|//g CEOF$ac_eof _ACEOF @@ -9501,7 +9736,7 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && diff --git a/configure.ac b/configure.ac index e563c14df..1df449600 100644 --- a/configure.ac +++ b/configure.ac @@ -382,6 +382,9 @@ AC_ARG_ENABLE([mm-debug], AC_ARG_ENABLE([grub-emu], [AS_HELP_STRING([--enable-grub-emu], [build and install the `grub-emu' debugging utility])]) +AC_ARG_ENABLE([grub-emu-usb], + [AS_HELP_STRING([--enable-grub-emu-usb], + [build and install the `grub-emu' debugging utility with USB support])]) [if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries.] AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"], @@ -394,8 +397,20 @@ AC_ARG_ENABLE([grub-emu], [AC_CHECK_HEADERS([ncurses.h], [], [AC_CHECK_HEADERS([curses.h], [], [AC_MSG_ERROR([(n)curses header files are required to build `grub-emu'])])])]) + + [if [ x"$enable_grub_emu_usb" = xyes ]; then + # Check for libusb libraries.] + AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], + [AC_MSG_ERROR([libusb libraries are required to build `grub-emu' with USB support])]) + AC_SUBST([LIBUSB]) + + [# Check for headers.] + AC_CHECK_HEADERS([usb.h], [], + [AC_MSG_ERROR([libusb header file is required to build `grub-emu' with USB support])]) + [fi] [fi] AC_SUBST([enable_grub_emu]) +AC_SUBST([enable_grub_emu_usb]) AC_ARG_ENABLE([grub-fstest], [AS_HELP_STRING([--enable-grub-fstest], diff --git a/disk/usbms.c b/disk/usbms.c new file mode 100644 index 000000000..d08256b65 --- /dev/null +++ b/disk/usbms.c @@ -0,0 +1,393 @@ +/* usbms.c - USB Mass Storage Support. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#define GRUB_USBMS_DIRECTION_BIT 7 + +/* The USB Mass Storage Command Block Wrapper. */ +struct grub_usbms_cbw +{ + grub_uint32_t signature; + grub_uint32_t tag; + grub_uint32_t transfer_length; + grub_uint8_t flags; + grub_uint8_t lun; + grub_uint8_t length; + grub_uint8_t cbwcb[16]; +} __attribute__ ((packed)); + +struct grub_usbms_csw +{ + grub_uint32_t signature; + grub_uint32_t tag; + grub_uint32_t residue; + grub_uint8_t status; +} __attribute__ ((packed)); + +struct grub_usbms_dev +{ + struct grub_usb_device *dev; + + int luns; + + int interface; + struct grub_usb_desc_endp *in; + struct grub_usb_desc_endp *out; + + int in_maxsz; + int out_maxsz; + + struct grub_usbms_dev *next; +}; +typedef struct grub_usbms_dev *grub_usbms_dev_t; + +static grub_usbms_dev_t grub_usbms_dev_list; + +static int devcnt; + +static grub_err_t +grub_usbms_reset (grub_usb_device_t dev, int interface) +{ + return grub_usb_control_msg (dev, 0x21, 255, 0, interface, 0, 0); +} + +static void +grub_usbms_finddevs (void) +{ + auto int usb_iterate (grub_usb_device_t dev); + + int usb_iterate (grub_usb_device_t usbdev) + { + grub_usb_err_t err; + struct grub_usb_desc_device *descdev = &usbdev->descdev; + int i; + + if (descdev->class != 0 || descdev->subclass || descdev->protocol != 0) + return 0; + + /* XXX: Just check configuration 0 for now. */ + for (i = 0; i < usbdev->config[0].descconf->numif; i++) + { + struct grub_usbms_dev *usbms; + struct grub_usb_desc_if *interf; + int j; + grub_uint8_t luns; + + interf = usbdev->config[0].interf[i].descif; + + /* If this is not a USB Mass Storage device with a supported + protocol, just skip it. */ + if (interf->class != GRUB_USB_CLASS_MASS_STORAGE + || interf->subclass != GRUB_USBMS_SUBCLASS_BULK + || interf->protocol != GRUB_USBMS_PROTOCOL_BULK) + { + continue; + } + + devcnt++; + usbms = grub_malloc (sizeof (struct grub_usbms_dev)); + if (! usbms) + return 1; + + usbms->dev = usbdev; + usbms->interface = i; + usbms->in = NULL; + usbms->out = NULL; + + /* Iterate over all endpoints of this interface, at least a + IN and OUT bulk endpoint are required. */ + for (j = 0; j < interf->endpointcnt; j++) + { + struct grub_usb_desc_endp *endp; + endp = &usbdev->config[0].interf[i].descendp[j]; + + if ((endp->endp_addr & 128) && (endp->attrib & 3) == 2) + { + /* Bulk IN endpoint. */ + usbms->in = endp; + grub_usb_clear_halt (usbdev, endp->endp_addr & 128); + usbms->in_maxsz = endp->maxpacket; + } + else if (!(endp->endp_addr & 128) && (endp->attrib & 3) == 2) + { + /* Bulk OUT endpoint. */ + usbms->out = endp; + grub_usb_clear_halt (usbdev, endp->endp_addr & 128); + usbms->out_maxsz = endp->maxpacket; + } + } + + if (!usbms->in || !usbms->out) + { + grub_free (usbms); + return 0; + } + + /* Query the amount of LUNs. */ + err = grub_usb_control_msg (usbdev, 0xA1, 254, + 0, i, 1, (char *) &luns); + if (err) + { + /* In case of a stall, clear the stall. */ + if (err == GRUB_USB_ERR_STALL) + { + grub_usb_clear_halt (usbdev, usbms->in->endp_addr & 3); + grub_usb_clear_halt (usbdev, usbms->out->endp_addr & 3); + } + + /* Just set the amount of LUNs to one. */ + grub_errno = GRUB_ERR_NONE; + usbms->luns = 1; + } + else + usbms->luns = luns; + + /* XXX: Check the magic values, does this really make + sense? */ + grub_usb_control_msg (usbdev, (1 << 6) | 1, 255, + 0, i, 0, 0); + + /* XXX: To make Qemu work? */ + if (usbms->luns == 0) + usbms->luns = 1; + + usbms->next = grub_usbms_dev_list; + grub_usbms_dev_list = usbms; + + /* XXX: Activate the first configuration. */ + grub_usb_set_configuration (usbdev, 1); + + /* Bolk-Only Mass Storage Reset, after the reset commands + will be accepted. */ + grub_usbms_reset (usbdev, i); + + return 0; + } + + return 0; + } + + grub_usb_iterate (usb_iterate); +} + + + +static int +grub_usbms_iterate (int (*hook) (const char *name, int luns)) +{ + grub_usbms_dev_t p; + int cnt = 0; + + for (p = grub_usbms_dev_list; p; p = p->next) + { + char devname[20]; + grub_sprintf (devname, "usb%d", cnt); + + if (hook (devname, p->luns)) + return 1; + cnt++; + } + + return 0; +} + +static grub_err_t +grub_usbms_tranfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, + grub_size_t size, char *buf, int read_write) +{ + struct grub_usbms_cbw cbw; + grub_usbms_dev_t dev = (grub_usbms_dev_t) scsi->data; + struct grub_usbms_csw status; + static grub_uint32_t tag = 0; + grub_usb_err_t err; + int retrycnt = 3; + + retry: + if (retrycnt == 0) + return err; + + /* Setup the request. */ + grub_memset (&cbw, 0, sizeof (cbw)); + cbw.signature = grub_cpu_to_le32 (0x43425355); + cbw.tag = tag++; + cbw.transfer_length = grub_cpu_to_le32 (size); + cbw.flags = (!read_write) << GRUB_USBMS_DIRECTION_BIT; + cbw.lun = scsi->lun << GRUB_SCSI_LUN_SHIFT; + cbw.length = cmdsize; + grub_memcpy (cbw.cbwcb, cmd, cmdsize); + + /* Write the request. */ + err = grub_usb_bulk_write (dev->dev, dev->out->endp_addr & 15, + sizeof (cbw), (char *) &cbw); + if (err) + { + if (err == GRUB_USB_ERR_STALL) + { + grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + goto retry; + } + return grub_error (GRUB_ERR_IO, "USB Mass Storage request failed");; + } + + /* Read/write the data. */ + if (read_write == 0) + { + err = grub_usb_bulk_read (dev->dev, dev->in->endp_addr & 15, size, buf); + grub_dprintf ("usb", "read: %d %d\n", err, GRUB_USB_ERR_STALL); + if (err) + { + if (err == GRUB_USB_ERR_STALL) + { + grub_usb_clear_halt (dev->dev, dev->in->endp_addr); + goto retry; + } + return grub_error (GRUB_ERR_READ_ERROR, + "can't read from USB Mass Storage device"); + } + } + else + { + err = grub_usb_bulk_write (dev->dev, dev->in->endp_addr & 15, size, buf); + grub_dprintf ("usb", "write: %d %d\n", err, GRUB_USB_ERR_STALL); + if (err) + { + if (err == GRUB_USB_ERR_STALL) + { + grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + goto retry; + } + return grub_error (GRUB_ERR_WRITE_ERROR, + "can't write to USB Mass Storage device"); + } + } + + /* Read the status. */ + err = grub_usb_bulk_read (dev->dev, dev->in->endp_addr & 15, + sizeof (status), (char *) &status); + if (err) + { + if (err == GRUB_USB_ERR_STALL) + { + grub_usb_clear_halt (dev->dev, dev->in->endp_addr); + goto retry; + } + return grub_error (GRUB_ERR_READ_ERROR, + "can't read status from USB Mass Storage device"); + } + + /* XXX: Magic and check this code. */ + if (status.status == 2) + { + /* XXX: Phase error, reset device. */ + grub_usbms_reset (dev->dev, dev->interface); + grub_usb_clear_halt (dev->dev, dev->in->endp_addr); + grub_usb_clear_halt (dev->dev, dev->out->endp_addr); + + retrycnt--; + if (retrycnt) + goto retry; + } + + if (status.status) + return grub_error (GRUB_ERR_READ_ERROR, + "error communication with USB Mass Storage device"); + + return GRUB_ERR_NONE; +} + + +static grub_err_t +grub_usbms_read (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, + grub_size_t size, char *buf) +{ + return grub_usbms_tranfer (scsi, cmdsize, cmd, size, buf, 0); +} + +static grub_err_t +grub_usbms_write (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, + grub_size_t size, char *buf) +{ + return grub_usbms_tranfer (scsi, cmdsize, cmd, size, buf, 1); +} + +static grub_err_t +grub_usbms_open (const char *name, struct grub_scsi *scsi) +{ + grub_usbms_dev_t p; + int devnum; + int i = 0; + + if (grub_strncmp (name, "usb", 3)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "not a USB Mass Storage device"); + + devnum = grub_strtoul (name + 3, NULL, 10); + for (p = grub_usbms_dev_list; p; p = p->next) + { + /* Check if this is the devnumth device. */ + if (devnum == i) + { + scsi->data = p; + scsi->name = grub_strdup (name); + scsi->luns = p->luns; + if (! scsi->name) + return grub_errno; + + return GRUB_ERR_NONE; + } + + i++; + } + + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "not a USB Mass Storage device"); +} + +static void +grub_usbms_close (struct grub_scsi *scsi) +{ + grub_free (scsi->name); +} + +static struct grub_scsi_dev grub_usbms_dev = + { + .name = "usb", + .iterate = grub_usbms_iterate, + .open = grub_usbms_open, + .close = grub_usbms_close, + .read = grub_usbms_read, + .write = grub_usbms_write + }; + +GRUB_MOD_INIT(usbms) +{ + grub_usbms_finddevs (); + grub_scsi_dev_register (&grub_usbms_dev); +} + +GRUB_MOD_FINI(usbms) +{ + grub_scsi_dev_unregister (&grub_usbms_dev); +} diff --git a/include/grub/err.h b/include/grub/err.h index 50a9ea455..3435fb769 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -52,7 +52,8 @@ typedef enum GRUB_ERR_SYMLINK_LOOP, GRUB_ERR_BAD_GZIP_DATA, GRUB_ERR_MENU, - GRUB_ERR_TIMEOUT + GRUB_ERR_TIMEOUT, + GRUB_ERR_IO } grub_err_t; diff --git a/include/grub/usb.h b/include/grub/usb.h new file mode 100644 index 000000000..9c9e58bcd --- /dev/null +++ b/include/grub/usb.h @@ -0,0 +1,207 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_USB_H +#define GRUB_USB_H 1 + +#include +#include + +typedef struct grub_usb_device *grub_usb_device_t; +typedef struct grub_usb_controller *grub_usb_controller_t; +typedef struct grub_usb_controller_dev *grub_usb_controller_dev_t; + +typedef enum + { + GRUB_USB_ERR_NONE, + GRUB_USB_ERR_INTERNAL, + GRUB_USB_ERR_STALL, + GRUB_USB_ERR_DATA, + GRUB_USB_ERR_NAK, + GRUB_USB_ERR_BABBLE, + GRUB_USB_ERR_TIMEOUT, + GRUB_USB_ERR_BITSTUFF + } grub_usb_err_t; + +typedef enum + { + GRUB_USB_SPEED_NONE, + GRUB_USB_SPEED_LOW, + GRUB_USB_SPEED_FULL, + GRUB_USB_SPEED_HIGH + } grub_usb_speed_t; + +/* Call HOOK with each device, until HOOK returns non-zero. */ +int grub_usb_iterate (int (*hook) (grub_usb_device_t dev)); + +grub_usb_err_t grub_usb_device_initialize (grub_usb_device_t dev); + +grub_usb_err_t grub_usb_get_descriptor (grub_usb_device_t dev, + grub_uint8_t type, grub_uint8_t index, + grub_size_t size, char *data); + +struct grub_usb_desc_endp * +grub_usb_get_endpdescriptor (grub_usb_device_t usbdev, int addr); + +grub_usb_err_t grub_usb_clear_halt (grub_usb_device_t dev, int endpoint); + + +grub_usb_err_t grub_usb_set_configuration (grub_usb_device_t dev, + int configuration); + +grub_usb_err_t grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, + int langid, char **string); + +void grub_usb_controller_dev_register (grub_usb_controller_dev_t usb); + +void grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb); + +int grub_usb_controller_iterate (int (*hook) (grub_usb_controller_t dev)); + + +grub_usb_err_t grub_usb_control_msg (grub_usb_device_t dev, grub_uint8_t reqtype, + grub_uint8_t request, grub_uint16_t value, + grub_uint16_t index, grub_size_t size, + char *data); + +grub_usb_err_t +grub_usb_bulk_read (grub_usb_device_t dev, + int endpoint, grub_size_t size, char *data); +grub_usb_err_t +grub_usb_bulk_write (grub_usb_device_t dev, + int endpoint, grub_size_t size, char *data); + +grub_usb_err_t +grub_usb_root_hub (grub_usb_controller_t controller); + + +/* XXX: All handled by libusb for now. */ +struct grub_usb_controller_dev +{ + /* The device name. */ + const char *name; + + int (*iterate) (int (*hook) (grub_usb_controller_t dev)); + + grub_usb_err_t (*transfer) (grub_usb_controller_t dev, + grub_usb_transfer_t transfer); + + int (*hubports) (grub_usb_controller_t dev); + + grub_err_t (*portstatus) (grub_usb_controller_t dev, unsigned int port, + unsigned int enable); + + grub_usb_speed_t (*detect_dev) (grub_usb_controller_t dev, int port); + + /* The next host controller. */ + struct grub_usb_controller_dev *next; +}; + +struct grub_usb_controller +{ + /* The underlying USB Host Controller device. */ + grub_usb_controller_dev_t dev; + + /* Data used by the USB Host Controller Driver. */ + void *data; +}; + + +struct grub_usb_interface +{ + struct grub_usb_desc_if *descif; + + struct grub_usb_desc_endp *descendp; +}; + +struct grub_usb_configuration +{ + /* Configuration descriptors . */ + struct grub_usb_desc_config *descconf; + + /* Interfaces associated to this configuration. */ + struct grub_usb_interface interf[32]; +}; + +struct grub_usb_device +{ + /* The device descriptor of this device. */ + struct grub_usb_desc_device descdev; + + /* The controller the device is connected to. */ + struct grub_usb_controller controller; + + /* Device configurations (after opening the device). */ + struct grub_usb_configuration config[8]; + + /* Device address. */ + int addr; + + /* Device speed. */ + grub_usb_speed_t speed; + + /* All desciptors are read if this is set to 1. */ + int initialized; + + /* Data toggle values (used for bulk transfers only). */ + int toggle[16]; + + /* Device-specific data. */ + void *data; +}; + + + +typedef enum + { + GRUB_USB_CLASS_NOTHERE, + GRUB_USB_CLASS_AUDIO, + GRUB_USB_CLASS_COMMUNICATION, + GRUB_USB_CLASS_HID, + GRUB_USB_CLASS_XXX, + GRUB_USB_CLASS_PHYSICAL, + GRUB_USB_CLASS_IMAGE, + GRUB_USB_CLASS_PRINTER, + GRUB_USB_CLASS_MASS_STORAGE, + GRUB_USB_CLASS_HUB, + GRUB_USB_CLASS_DATA_INTERFACE, + GRUB_USB_CLASS_SMART_CARD, + GRUB_USB_CLASS_CONTENT_SECURITY, + GRUB_USB_CLASS_VIDEO + } grub_usb_classes_t; + +typedef enum + { + GRUB_USBMS_SUBCLASS_BULK = 0x06 + } grub_usbms_subclass_t; + +typedef enum + { + GRUB_USBMS_PROTOCOL_BULK = 0x50 + } grub_usbms_protocol_t; + +static inline struct grub_usb_desc_if * +grub_usb_get_config_interface (struct grub_usb_desc_config *config) +{ + struct grub_usb_desc_if *interf; + + interf = (struct grub_usb_desc_if *) (sizeof (*config) + (char *) config); + return interf; +} + +#endif /* GRUB_USB_H */ diff --git a/include/grub/usbdesc.h b/include/grub/usbdesc.h new file mode 100644 index 000000000..97947dc1b --- /dev/null +++ b/include/grub/usbdesc.h @@ -0,0 +1,119 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_USBDESC_H +#define GRUB_USBDESC_H 1 + +#include +#include + +typedef enum { + GRUB_USB_DESCRIPTOR_DEVICE = 1, + GRUB_USB_DESCRIPTOR_CONFIG, + GRUB_USB_DESCRIPTOR_STRING, + GRUB_USB_DESCRIPTOR_INTERFACE, + GRUB_USB_DESCRIPTOR_ENDPOINT, + GRUB_USB_DESCRIPTOR_HUB = 0x29 +} grub_usb_descriptor_t; + +struct grub_usb_desc_device +{ + grub_uint8_t length; + grub_uint8_t type; + grub_uint16_t usbrel; + grub_uint8_t class; + grub_uint8_t subclass; + grub_uint8_t protocol; + grub_uint8_t maxsize0; + grub_uint16_t vendorid; + grub_uint16_t prodid; + grub_uint16_t devrel; + grub_uint8_t strvendor; + grub_uint8_t strprod; + grub_uint8_t strserial; + grub_uint8_t configcnt; +} __attribute__ ((packed)); + +struct grub_usb_desc_config +{ + grub_uint8_t length; + grub_uint8_t type; + grub_uint16_t totallen; + grub_uint8_t numif; + grub_uint8_t config; + grub_uint8_t strconfig; + grub_uint8_t attrib; + grub_uint8_t maxpower; +} __attribute__ ((packed)); + +#if 0 +struct grub_usb_desc_ifassosiation +{ + grub_uint8_t length; + grub_uint8_t type; + grub_uint8_t firstif; + grub_uint8_t ifcnt; + grub_uint8_t class; + grub_uint8_t subclass; + grub_uint8_t protocol; + grub_uint8_t function; +} __attribute__ ((packed)); +#endif + +struct grub_usb_desc_if +{ + grub_uint8_t length; + grub_uint8_t type; + grub_uint8_t ifnum; + grub_uint8_t altsetting; + grub_uint8_t endpointcnt; + grub_uint8_t class; + grub_uint8_t subclass; + grub_uint8_t protocol; + grub_uint8_t strif; +} __attribute__ ((packed)); + +struct grub_usb_desc_endp +{ + grub_uint8_t length; + grub_uint8_t type; + grub_uint8_t endp_addr; + grub_uint8_t attrib; + grub_uint16_t maxpacket; + grub_uint8_t interval; +} __attribute__ ((packed)); + +struct grub_usb_desc_str +{ + grub_uint8_t length; + grub_uint8_t type; + grub_uint16_t str[0]; +} __attribute__ ((packed)); + +struct grub_usb_usb_hubdesc +{ + grub_uint8_t length; + grub_uint8_t type; + grub_uint8_t portcnt; + grub_uint16_t characteristics; + grub_uint8_t pwdgood; + grub_uint8_t current; + /* Removable and power control bits follow. */ +} __attribute__ ((packed)); + +#endif /* GRUB_USBDESC_H */ diff --git a/include/grub/usbtrans.h b/include/grub/usbtrans.h new file mode 100644 index 000000000..7e4a9d7ee --- /dev/null +++ b/include/grub/usbtrans.h @@ -0,0 +1,107 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_USBTRANS_H +#define GRUB_USBTRANS_H 1 + +typedef enum + { + GRUB_USB_TRANSFER_TYPE_IN, + GRUB_USB_TRANSFER_TYPE_OUT, + GRUB_USB_TRANSFER_TYPE_SETUP + } grub_transfer_type_t; + +typedef enum + { + GRUB_USB_TRANSACTION_TYPE_CONTROL, + GRUB_USB_TRANSACTION_TYPE_BULK + } grub_transaction_type_t; + +struct grub_usb_transaction +{ + int size; + int toggle; + grub_transfer_type_t pid; + char *data; +}; +typedef struct grub_usb_transaction *grub_usb_transaction_t; + +struct grub_usb_transfer +{ + int devaddr; + + int endpoint; + + int size; + + int transcnt; + + int max; + + grub_transaction_type_t type; + + struct grub_usb_device *dev; + + struct grub_usb_transaction *transactions; +}; +typedef struct grub_usb_transfer *grub_usb_transfer_t; + + +#define GRUB_USB_REQTYPE_IN (1 << 7) +#define GRUB_USB_REQTYPE_OUT (0 << 7) +#define GRUB_USB_REQTYPE_STANDARD (0 << 5) +#define GRUB_USB_REQTYPE_CLASS (1 << 5) +#define GRUB_USB_REQTYPE_VENDOR (2 << 5) +#define GRUB_USB_REQTYPE_TARGET_DEV (0 << 0) +#define GRUB_USB_REQTYPE_TARGET_INTERF (1 << 0) +#define GRUB_USB_REQTYPE_TARGET_ENDP (2 << 0) +#define GRUB_USB_REQTYPE_TARGET_OTHER (3 << 0) + +#define GRUB_USB_REQ_GET_STATUS 0x00 +#define GRUB_USB_REQ_CLEAR_FEATURE 0x01 +#define GRUB_USB_REQ_SET_FEATURE 0x03 +#define GRUB_USB_REQ_SET_ADDRESS 0x05 +#define GRUB_USB_REQ_GET_DESCRIPTOR 0x06 +#define GRUB_USB_REQ_SET_DESCRIPTOR 0x07 +#define GRUB_USB_REQ_GET_CONFIGURATION 0x08 +#define GRUB_USB_REQ_SET_CONFIGURATION 0x09 +#define GRUB_USB_REQ_GET_INTERFACE 0x0A +#define GRUB_USB_REQ_SET_INTERFACE 0x0B +#define GRUB_USB_REQ_SYNC_FRAME 0x0C + +#define GRUB_USB_REQ_HUB_GET_PORT_STATUS 0x00 + +#define GRUB_USB_FEATURE_ENDP_HALT 0x01 +#define GRUB_USB_FEATURE_DEV_REMOTE_WU 0x02 +#define GRUB_USB_FEATURE_TEST_MODE 0x04 + +#define GRUB_USB_HUB_STATUS_CONNECTED (1 << 0) +#define GRUB_USB_HUB_STATUS_LOWSPEED (1 << 9) +#define GRUB_USB_HUB_STATUS_HIGHSPEED (1 << 10) + +struct grub_usb_packet_setup +{ + grub_uint8_t reqtype; + grub_uint8_t request; + grub_uint16_t value; + grub_uint16_t index; + grub_uint16_t length; +} __attribute__((packed)); + + +#endif /* GRUB_USBTRANS_H */ diff --git a/util/grub-emu.c b/util/grub-emu.c index 4569d9ed9..59392fe35 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -187,6 +187,10 @@ main (int argc, char *argv[]) /* XXX: This is a bit unportable. */ grub_util_biosdisk_init (dev_map); +#if HAVE_USB_H + grub_libusb_init (); +#endif + grub_init_all (); /* Make sure that there is a root device. */ diff --git a/util/usb.c b/util/usb.c new file mode 100644 index 000000000..744ad86c9 --- /dev/null +++ b/util/usb.c @@ -0,0 +1,191 @@ +/* usb.c -- libusb USB support for GRUB. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + + +static struct grub_usb_controller_dev usb_controller = +{ + .name = "libusb" +}; + +static struct grub_usb_device *grub_usb_devs[128]; + +struct usb_bus *busses; + +static grub_err_t +grub_libusb_devices (void) + +{ + struct usb_bus *bus; + int last = 0; + + busses = usb_get_busses(); + + for (bus = busses; bus; bus = bus->next) + { + struct usb_device *usbdev; + struct grub_usb_device *dev; + + for (usbdev = bus->devices; usbdev; usbdev = usbdev->next) + { + struct usb_device_descriptor *desc = &usbdev->descriptor; + + if (! desc->bcdUSB) + continue; + + dev = grub_malloc (sizeof (*dev)); + if (! dev) + return grub_errno; + + dev->data = usbdev; + + /* Fill in all descriptors. */ + grub_usb_device_initialize (dev); + + /* Register the device. */ + grub_usb_devs[last++] = dev; + } + } + + return GRUB_USB_ERR_NONE; +} + +grub_err_t +grub_libusb_init (void) +{ + usb_init(); + usb_find_busses(); + usb_find_devices(); + + if (grub_libusb_devices ()) + return grub_errno; + + grub_usb_controller_dev_register (&usb_controller); + + return 0; +} + +grub_err_t +grub_libusb_fini (void) +{ + return 0; +} + + +int +grub_usb_iterate (int (*hook) (grub_usb_device_t dev)) +{ + int i; + + for (i = 0; i < 128; i++) + { + if (grub_usb_devs[i]) + { + if (hook (grub_usb_devs[i])) + return 1; + } + } + + return 0; +} + +grub_usb_err_t +grub_usb_root_hub (grub_usb_controller_t controller __attribute__((unused))) +{ + return GRUB_USB_ERR_NONE; +} + +grub_usb_err_t +grub_usb_control_msg (grub_usb_device_t dev, grub_uint8_t reqtype, + grub_uint8_t request, grub_uint16_t value, + grub_uint16_t index, grub_size_t size, char *data) +{ + usb_dev_handle *devh; + struct usb_device *d = dev->data; + + devh = usb_open (d); + if (usb_control_msg (devh, reqtype, request, + value, index, data, size, 20) < 0) + { + usb_close (devh); + return GRUB_USB_ERR_STALL; + } + + usb_close (devh); + + return GRUB_USB_ERR_NONE; +} + +grub_usb_err_t +grub_usb_bulk_read (grub_usb_device_t dev, + int endpoint, grub_size_t size, char *data) +{ + usb_dev_handle *devh; + struct usb_device *d = dev->data; + + devh = usb_open (d); + if (usb_claim_interface (devh, 0) < 1) + { + usb_close (devh); + return GRUB_USB_ERR_STALL; + } + + if (usb_bulk_read (devh, endpoint, data, size, 20) < 1) + { + usb_close (devh); + return GRUB_USB_ERR_STALL; + } + + usb_release_interface (devh, 0); + usb_close (devh); + + return GRUB_USB_ERR_NONE; +} + +grub_usb_err_t +grub_usb_bulk_write (grub_usb_device_t dev, + int endpoint, grub_size_t size, char *data) +{ + usb_dev_handle *devh; + struct usb_device *d = dev->data; + + devh = usb_open (d); + if (usb_claim_interface (devh, 0) < 0) + goto fail; + + if (usb_bulk_write (devh, endpoint, data, size, 20) < 0) + goto fail; + + if (usb_release_interface (devh, 0) < 0) + goto fail; + + usb_close (devh); + + return GRUB_USB_ERR_NONE; + + fail: + usb_close (devh); + return GRUB_USB_ERR_STALL; +} From 56978920b1e0e3ddecf7265d1da7873910421415 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Feb 2009 19:59:32 +0000 Subject: [PATCH 0523/1707] 2009-02-08 Robert Millan * Makefile.in (host_os, host_cpu): New variables. (target_os): Remove. Update all users. --- ChangeLog | 5 +++++ Makefile.in | 4 +++- conf/common.mk | 2 +- conf/common.rmk | 2 +- configure | 14 ++++++-------- configure.ac | 16 +++++++--------- 6 files changed, 23 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index f806b40a3..ecf7b8338 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-08 Robert Millan + + * Makefile.in (host_os, host_cpu): New variables. + (target_os): Remove. Update all users. + 2009-02-08 Marco Gerards * Makefile.in (enable_grub_emu_usb): New variable. diff --git a/Makefile.in b/Makefile.in index 398f92816..44dc57795 100644 --- a/Makefile.in +++ b/Makefile.in @@ -47,8 +47,10 @@ PACKAGE_VERSION = @PACKAGE_VERSION@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ +host_os = @host_os@ +host_cpu = @host_cpu@ + target_cpu = @target_cpu@ -target_os = @target_os@ platform = @platform@ INSTALL = @INSTALL@ diff --git a/conf/common.mk b/conf/common.mk index e75c46b50..8053739e4 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -579,7 +579,7 @@ CLEANFILES += update-grub_lib ./config.status --file=$@:$< chmod +x $@ grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 10_freebsd 30_os-prober 40_custom -ifeq ($(target_os), cygwin) +ifeq ($(host_os), cygwin) grub-mkconfig_SCRIPTS += 10_windows endif diff --git a/conf/common.rmk b/conf/common.rmk index f91d6ff4e..c7f97dd32 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -146,7 +146,7 @@ CLEANFILES += update-grub_lib ./config.status --file=$@:$< chmod +x $@ grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 10_freebsd 30_os-prober 40_custom -ifeq ($(target_os), cygwin) +ifeq ($(host_os), cygwin) grub-mkconfig_SCRIPTS += 10_windows endif diff --git a/configure b/configure index 74c400f63..c82ee244d 100644 --- a/configure +++ b/configure @@ -2006,9 +2006,7 @@ case "$host_os" in mingw32) host_os=cygwin ;; esac -case "$target_os" in - mingw32) target_os=cygwin ;; -esac + @@ -5906,10 +5904,10 @@ done # Use linker script if present, otherwise use builtin -N script. { echo "$as_me:$LINENO: checking for option to link raw image" >&5 echo $ECHO_N "checking for option to link raw image... $ECHO_C" >&6; } -if test -f "${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc"; then - TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" +if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then + TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" - TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" + TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" else TARGET_IMG_LDSCRIPT= TARGET_IMG_LDFLAGS='-Wl,-N' @@ -5923,8 +5921,8 @@ echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } # For platforms where ELF is not the default link format. { echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } -case "${host_os}:${target_os}" in - cygwin:cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; +case "${host_os}" in + cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; *) ;; esac diff --git a/configure.ac b/configure.ac index 1df449600..7658c7a42 100644 --- a/configure.ac +++ b/configure.ac @@ -103,12 +103,10 @@ case "$host_os" in mingw32) host_os=cygwin ;; esac -case "$target_os" in - mingw32) target_os=cygwin ;; -esac +AC_SUBST(host_cpu) +AC_SUBST(host_os) AC_SUBST(target_cpu) -AC_SUBST(target_os) AC_SUBST(platform) # @@ -200,10 +198,10 @@ AC_CHECK_FUNCS(posix_memalign memalign asprintf) # Use linker script if present, otherwise use builtin -N script. AC_MSG_CHECKING([for option to link raw image]) -if test -f "${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc"; then - TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" +if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then + TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" - TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${target_os}-img-ld.sc" + TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" else TARGET_IMG_LDSCRIPT= TARGET_IMG_LDFLAGS='-Wl,-N' @@ -215,8 +213,8 @@ AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) # For platforms where ELF is not the default link format. AC_MSG_CHECKING([for command to convert module to ELF format]) -case "${host_os}:${target_os}" in - cygwin:cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; +case "${host_os}" in + cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; *) ;; esac AC_SUBST(TARGET_OBJ2ELF) From 2550c62fe08f6863013beae8504c876ee59dcc4e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Feb 2009 21:50:27 +0000 Subject: [PATCH 0524/1707] 2009-02-08 Robert Millan * fs/tar.c: Replace "fs/cpio.h" with "cpio.h". --- ChangeLog | 4 ++++ fs/tar.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ecf7b8338..9bf64808b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-08 Robert Millan + + * fs/tar.c: Replace "fs/cpio.h" with "cpio.h". + 2009-02-08 Robert Millan * Makefile.in (host_os, host_cpu): New variables. diff --git a/fs/tar.c b/fs/tar.c index 2b0c4cb5f..6ab62bca7 100644 --- a/fs/tar.c +++ b/fs/tar.c @@ -1,2 +1,2 @@ #define MODE_USTAR 1 -#include "fs/cpio.c" +#include "cpio.c" From be110b3076995e25893ccb869fc9ffe1919c2c17 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Feb 2009 22:11:48 +0000 Subject: [PATCH 0525/1707] Fix ChangeLog entry --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9bf64808b..440f2cebc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2009-02-08 Robert Millan - * fs/tar.c: Replace "fs/cpio.h" with "cpio.h". + * fs/tar.c: Replace "fs/cpio.c" with "cpio.c". 2009-02-08 Robert Millan From 6dca6fe432cdd3659973f688ca066c7698149beb Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 9 Feb 2009 14:17:19 +0000 Subject: [PATCH 0526/1707] 2009-02-09 Felix Zielcke fs/fat.c (grub_fat_mount): Try to avoid false positives by checking bpb.version_specific.fat12_or_fat16.fstype and bpb.version_specific.fat32.fstype. --- ChangeLog | 6 ++++++ fs/fat.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 440f2cebc..9dd5df219 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-09 Felix Zielcke + + fs/fat.c (grub_fat_mount): Try to avoid false positives by checking + bpb.version_specific.fat12_or_fat16.fstype and + bpb.version_specific.fat32.fstype. + 2009-02-08 Robert Millan * fs/tar.c: Replace "fs/cpio.c" with "cpio.c". diff --git a/fs/fat.c b/fs/fat.c index d62adbc27..6b39ef0f6 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -187,6 +187,11 @@ grub_fat_mount (grub_disk_t disk) if (grub_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb)) goto fail; + if (! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT12",5) + || ! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT16",5) + || ! grub_strncmp((const char *) bpb.version_specific.fat32.fstype, "FAT32",5)) + goto fail; + /* Get the sizes of logical sectors and clusters. */ data->logical_sector_bits = fat_log2 (grub_le_to_cpu16 (bpb.bytes_per_sector)); From 96da94074c2f485c8a7f463731010dbe874b43e2 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 9 Feb 2009 18:00:36 +0000 Subject: [PATCH 0527/1707] 2009-02-09 Felix Zielcke * conf/common.rmk (grub_probe_SOURCES): Move fs/ext2.c before fs/fat.c to avoid false posivites with FAT. (grub_fstest_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. --- ChangeLog | 12 ++++++++++++ conf/common.rmk | 4 ++-- conf/i386-coreboot.rmk | 2 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- conf/x86_64-efi.rmk | 2 +- 8 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9dd5df219..516c3bb3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-02-09 Felix Zielcke + + * conf/common.rmk (grub_probe_SOURCES): Move fs/ext2.c before fs/fat.c + to avoid false posivites with FAT. + (grub_fstest_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + 2009-02-09 Felix Zielcke fs/fat.c (grub_fat_mount): Try to avoid false positives by checking diff --git a/conf/common.rmk b/conf/common.rmk index c7f97dd32..dfd481a89 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -14,7 +14,7 @@ grub_probe_SOURCES = util/grub-probe.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c \ kern/parser.c kern/partition.c kern/file.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -34,7 +34,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 739aeff4d..f26bf4a36 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -62,7 +62,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 56569a6f0..90fc2f035 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 0b405e306..2fd03b5ed 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -134,7 +134,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 818d645ca..b48f303d5 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -45,7 +45,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 334caeeac..ce133e910 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -48,7 +48,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # commands/timeout.c commands/test.c \ # commands/halt.c commands/reboot.c \ # disk/loopback.c \ -# fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ +# fs/affs.c fs/fat.c fs/ext2.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ # fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ # grub_script.tab.c \ # io/gzio.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 83d9c8bc5..973260b13 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -42,7 +42,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/i386/cpuid.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c \ From 06ff20fcfede54cafe6a76c82aafade4cbe91eeb Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 10 Feb 2009 09:50:08 +0000 Subject: [PATCH 0528/1707] 2009-02-10 Felix Zielcke MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fs/fat.c (grub_fat_mount): Fix wrong comparison. Based on patch from Javier Martín. --- ChangeLog | 8 +++++++- conf/common.mk | 36 ++++++++++++++++++------------------ conf/i386-pc.mk | 18 +++++++++--------- fs/fat.c | 6 +++--- 4 files changed, 37 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 516c3bb3c..10a00f93f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-10 Felix Zielcke + + * fs/fat.c (grub_fat_mount): Fix wrong comparison. + + Based on patch from Javier Martín. + 2009-02-09 Felix Zielcke * conf/common.rmk (grub_probe_SOURCES): Move fs/ext2.c before fs/fat.c @@ -12,7 +18,7 @@ 2009-02-09 Felix Zielcke - fs/fat.c (grub_fat_mount): Try to avoid false positives by checking + * fs/fat.c (grub_fat_mount): Try to avoid false positives by checking bpb.version_specific.fat12_or_fat16.fstype and bpb.version_specific.fat32.fstype. diff --git a/conf/common.mk b/conf/common.mk index 8053739e4..9b67944e5 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -33,7 +33,7 @@ grub_probe_SOURCES = util/grub-probe.c \ kern/device.c kern/disk.c kern/err.c kern/misc.c \ kern/parser.c kern/partition.c kern/file.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -41,11 +41,11 @@ grub_probe_SOURCES = util/grub-probe.c \ partmap/pc.c partmap/apple.c partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c -CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_ext2.d grub_probe-fs_fat.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-fs_tar.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d +CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-fs_tar.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_ext2.o grub_probe-fs_fat.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -99,14 +99,14 @@ grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_cpio.d -grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ext2.d - grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_fat.d +grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-fs_ext2.d + grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-fs_hfs.d @@ -215,7 +215,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -225,11 +225,11 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_ext2.d grub_fstest-fs_fat.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_ext2.o grub_fstest-fs_fat.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -303,14 +303,14 @@ grub_fstest-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_cpio.d -grub_fstest-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ext2.d - grub_fstest-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_fat.d +grub_fstest-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-fs_ext2.d + grub_fstest-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-fs_hfs.d diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 5345475e3..3bb4c8269 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -541,7 +541,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -553,11 +553,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -795,14 +795,14 @@ grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_cpio.d -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fat.d +grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_ext2.d + grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_hfs.d diff --git a/fs/fat.c b/fs/fat.c index 6b39ef0f6..36278b092 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -187,9 +187,9 @@ grub_fat_mount (grub_disk_t disk) if (grub_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb)) goto fail; - if (! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT12",5) - || ! grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT16",5) - || ! grub_strncmp((const char *) bpb.version_specific.fat32.fstype, "FAT32",5)) + if (grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT12", 5) + && grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT16", 5) + && grub_strncmp((const char *) bpb.version_specific.fat32.fstype, "FAT32", 5)) goto fail; /* Get the sizes of logical sectors and clusters. */ From 16ac430e8cfc34017bcf3b63dc2de65c0d05679c Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 11 Feb 2009 00:36:58 +0000 Subject: [PATCH 0529/1707] 2009-02-11 Robert Millan * util/grub.d/00_header.in: Update old reference to `font' command. --- ChangeLog | 4 ++++ util/grub.d/00_header.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 10a00f93f..2832d9cdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-11 Robert Millan + + * util/grub.d/00_header.in: Update old reference to `font' command. + 2009-02-10 Felix Zielcke * fs/fat.c (grub_fat_mount): Fix wrong comparison. diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 93b90675b..d8fa4165d 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -26,7 +26,7 @@ grub_prefix=`echo /boot/grub | sed ${transform}` . ${libdir}/grub/grub-mkconfig_lib # Do this as early as possible, since other commands might depend on it. -# (e.g. the `font' command might need lvm or raid modules) +# (e.g. the `loadfont' command might need lvm or raid modules) for i in ${GRUB_PRELOAD_MODULES} ; do echo "insmod $i" done From 772e23dad2677d2777401dbee4748fd8a5a799da Mon Sep 17 00:00:00 2001 From: cbennett Date: Fri, 13 Feb 2009 20:06:27 +0000 Subject: [PATCH 0530/1707] 2009-02-13 Colin D Bennett Support multiple fallback entries, and provide an API to support executing default+fallback menu entries. Renamed the `terminal' menu viewer to `text'. * include/grub/normal.h (grub_normal_text_menu_viewer): New global variable declaration. (grub_menu_execute_callback): New structure declaration. (grub_menu_execute_callback_t): New typedef. (grub_menu_execute_with_fallback): New function declaration. (grub_menu_get_entry): Likewise. (grub_menu_get_timeout): Likewise. (grub_menu_set_timeout): Likewise. * normal/main.c (GRUB_MOD_INIT(normal)): Refer to new variable name. * normal/menu.c (grub_wait_after_message): Moved to `normal/menu_text.c'. (draw_border): Likewise. (print_message): Likewise. (print_entry): Likewise. (print_entries): Likewise. (grub_menu_init_page): Likewise. (get_entry_number): Likewise. (print_timeout): Likewise. (run_menu): Likewise. (grub_menu_execute_entry): Likewise. (show_text_menu): Likewise. (get_and_remove_first_entry_number): New function. (grub_menu_execute_with_fallback): Likewise. (get_entry): Renamed to ... (grub_menu_get_entry): .. this and made it global. (get_timeout): Renamed to ... (grub_menu_get_timeout): ... this and made it global. (set_timeout): Renamed to ... (grub_menu_set_timeout): ... this and made it global. (grub_normal_terminal_menu_viewer): Renamed to ... (grub_normal_text_menu_viewer): ... this. * normal/menu_text.c: New file. Extracted text-menu-specific code from normal/menu.c. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add `normal/menu_text.c'. (normal_mod_SOURCES): Likewise. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. * conf/i386-pc.rmk, (grub_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. (normal_mod_SOURCES): Likewise. --- ChangeLog | 64 ++++ conf/i386-coreboot.mk | 52 +++- conf/i386-coreboot.rmk | 3 +- conf/i386-efi.mk | 29 +- conf/i386-efi.rmk | 2 + conf/i386-ieee1275.mk | 52 +++- conf/i386-ieee1275.rmk | 3 +- conf/i386-pc.mk | 41 ++- conf/i386-pc.rmk | 2 + conf/powerpc-ieee1275.mk | 47 ++- conf/powerpc-ieee1275.rmk | 2 + conf/sparc64-ieee1275.mk | 31 +- conf/sparc64-ieee1275.rmk | 2 + conf/x86_64-efi.mk | 31 +- conf/x86_64-efi.rmk | 2 + include/grub/normal.h | 31 +- normal/main.c | 2 +- normal/menu.c | 556 ++++------------------------------- normal/menu_text.c | 600 ++++++++++++++++++++++++++++++++++++++ 19 files changed, 984 insertions(+), 568 deletions(-) create mode 100644 normal/menu_text.c diff --git a/ChangeLog b/ChangeLog index 2832d9cdf..a041adc49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,67 @@ +2009-02-13 Colin D Bennett + + Support multiple fallback entries, and provide an API to support + executing default+fallback menu entries. Renamed the `terminal' menu + viewer to `text'. + + * include/grub/normal.h (grub_normal_text_menu_viewer): New global + variable declaration. + (grub_menu_execute_callback): New structure declaration. + (grub_menu_execute_callback_t): New typedef. + (grub_menu_execute_with_fallback): New function declaration. + (grub_menu_get_entry): Likewise. + (grub_menu_get_timeout): Likewise. + (grub_menu_set_timeout): Likewise. + + * normal/main.c (GRUB_MOD_INIT(normal)): Refer to new variable name. + + * normal/menu.c (grub_wait_after_message): Moved to + `normal/menu_text.c'. + (draw_border): Likewise. + (print_message): Likewise. + (print_entry): Likewise. + (print_entries): Likewise. + (grub_menu_init_page): Likewise. + (get_entry_number): Likewise. + (print_timeout): Likewise. + (run_menu): Likewise. + (grub_menu_execute_entry): Likewise. + (show_text_menu): Likewise. + (get_and_remove_first_entry_number): New function. + (grub_menu_execute_with_fallback): Likewise. + (get_entry): Renamed to ... + (grub_menu_get_entry): .. this and made it global. + (get_timeout): Renamed to ... + (grub_menu_get_timeout): ... this and made it global. + (set_timeout): Renamed to ... + (grub_menu_set_timeout): ... this and made it global. + (grub_normal_terminal_menu_viewer): Renamed to ... + (grub_normal_text_menu_viewer): ... this. + + * normal/menu_text.c: New file. Extracted text-menu-specific code + from normal/menu.c. + + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add `normal/menu_text.c'. + (normal_mod_SOURCES): Likewise. + + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + (normal_mod_SOURCES): Likewise. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + (normal_mod_SOURCES): Likewise. + + * conf/i386-pc.rmk, (grub_emu_SOURCES): Likewise. + (normal_mod_SOURCES): Likewise. + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + (normal_mod_SOURCES): Likewise. + + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + (normal_mod_SOURCES): Likewise. + + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + (normal_mod_SOURCES): Likewise. + 2009-02-11 Robert Millan * util/grub.d/00_header.in: Update old reference to `font' command. diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 1018c1494..c10d16f24 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -195,7 +195,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -208,7 +208,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/main.c \ + normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ normal/color.c \ @@ -221,11 +221,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -299,14 +299,14 @@ grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_cpio.d -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fat.d +grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_ext2.d + grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_hfs.d @@ -467,6 +467,10 @@ grub_emu-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_main.d +grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_text.d + grub_emu-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu.d @@ -716,17 +720,18 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -735,9 +740,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -925,6 +930,25 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_text.d + +CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst +COMMANDFILES += cmd-normal_mod-normal_menu_text.lst +FSFILES += fs-normal_mod-normal_menu_text.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst + +cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index f26bf4a36..b97483b20 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -75,7 +75,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/main.c \ + normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ normal/color.c \ @@ -123,6 +123,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index a2f330477..9e98098c4 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -87,6 +87,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/menu_text.c \ normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ @@ -743,17 +744,18 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -762,9 +764,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -952,6 +954,25 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_text.d + +CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst +COMMANDFILES += cmd-normal_mod-normal_menu_text.lst +FSFILES += fs-normal_mod-normal_menu_text.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst + +cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index dc0547e19..3814abb0c 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -54,6 +54,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/menu_text.c \ normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ @@ -120,6 +121,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 74914d7f2..504a18539 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -194,7 +194,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -207,7 +207,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/main.c \ + normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ normal/color.c \ @@ -220,11 +220,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -306,14 +306,14 @@ grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_cpio.d -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fat.d +grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_ext2.d + grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_hfs.d @@ -474,6 +474,10 @@ grub_emu-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_main.d +grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_text.d + grub_emu-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu.d @@ -610,17 +614,18 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -629,9 +634,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -819,6 +824,25 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_text.d + +CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst +COMMANDFILES += cmd-normal_mod-normal_menu_text.lst +FSFILES += fs-normal_mod-normal_menu_text.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst + +cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 90fc2f035..903113ead 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -74,7 +74,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/main.c \ + normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ normal/color.c \ @@ -113,6 +113,7 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 3bb4c8269..638334446 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -537,6 +537,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/menu_text.c \ normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ @@ -553,11 +554,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -755,6 +756,10 @@ grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPEN $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu_viewer.d +grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_text.d + grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_misc.d @@ -1273,17 +1278,18 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -1292,9 +1298,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -1482,6 +1488,25 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_text.d + +CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst +COMMANDFILES += cmd-normal_mod-normal_menu_text.lst +FSFILES += fs-normal_mod-normal_menu_text.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst + +cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 2fd03b5ed..3ef351e34 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -130,6 +130,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/menu_text.c \ normal/misc.c normal/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ @@ -210,6 +211,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 534eb9b5b..18edeafe0 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -60,7 +60,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -73,6 +73,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ normal/script.c \ normal/color.c \ @@ -85,11 +86,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -167,6 +168,10 @@ grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fat.d +grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) + $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-fs_ext2.d + grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_hfs.d @@ -327,6 +332,10 @@ grub_emu-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu.d +grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_menu_text.d + grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_menu_entry.d @@ -724,17 +733,18 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/powerpc/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -743,9 +753,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -933,6 +943,25 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_text.d + +CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst +COMMANDFILES += cmd-normal_mod-normal_menu_text.lst +FSFILES += fs-normal_mod-normal_menu_text.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst + +cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b48f303d5..51e7c07c3 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -58,6 +58,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ normal/script.c \ normal/color.c \ @@ -133,6 +134,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index a8ecb83d2..ce49690e9 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -49,7 +49,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # commands/timeout.c commands/test.c \ # commands/halt.c commands/reboot.c \ # disk/loopback.c \ -# fs/affs.c fs/ext2.c fs/fat.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ +# fs/affs.c fs/fat.c fs/ext2.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ # fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ # grub_script.tab.c \ # io/gzio.c \ @@ -60,6 +60,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ # normal/main.c normal/menu.c normal/menu_entry.c \ +# normal/menu_text.c \ # normal/menu_viewer.c normal/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ @@ -793,17 +794,18 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/sparc64/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -812,9 +814,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -1002,6 +1004,25 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_text.d + +CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst +COMMANDFILES += cmd-normal_mod-normal_menu_text.lst +FSFILES += fs-normal_mod-normal_menu_text.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst + +cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index ce133e910..640ceda63 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -59,6 +59,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ # normal/main.c normal/menu.c normal/menu_entry.c \ +# normal/menu_text.c \ # normal/menu_viewer.c normal/misc.c \ # partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ # partmap/acorn.c \ @@ -166,6 +167,7 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 6f3a477b6..b2095df28 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/i386/cpuid.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c \ @@ -75,6 +75,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/menu_text.c \ normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ @@ -750,17 +751,18 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/x86_64/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -769,9 +771,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -959,6 +961,25 @@ partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_menu_text.d + +CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst +COMMANDFILES += cmd-normal_mod-normal_menu_text.lst +FSFILES += fs-normal_mod-normal_menu_text.lst +PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst + +cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_color.d diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 973260b13..5b108d2a3 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -56,6 +56,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ + normal/menu_text.c \ normal/misc.c normal/script.c \ normal/color.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ @@ -122,6 +123,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/include/grub/normal.h b/include/grub/normal.h index 8cb715bbe..216ae0ddc 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -79,7 +79,7 @@ struct grub_command /* The name of a module. Used for auto-loading. */ char *module_name; - + /* The next element. */ struct grub_command *next; }; @@ -96,12 +96,39 @@ typedef struct grub_fs_module_list *grub_fs_module_list_t; /* To exit from the normal mode. */ extern grub_jmp_buf grub_exit_env; -extern struct grub_menu_viewer grub_normal_terminal_menu_viewer; +extern struct grub_menu_viewer grub_normal_text_menu_viewer; + +/* Callback structure menu viewers can use to provide user feedback when + default entries are executed, possibly including fallback entries. */ +typedef struct grub_menu_execute_callback +{ + /* Called immediately before ENTRY is booted. */ + void (*notify_booting) (grub_menu_entry_t entry, void *userdata); + + /* Called when executing one entry has failed, and another entry, ENTRY, will + be executed as a fallback. The implementation of this function should + delay for a period of at least 2 seconds before returning in order to + allow the user time to read the information before it can be lost by + executing ENTRY. */ + void (*notify_fallback) (grub_menu_entry_t entry, void *userdata); + + /* Called when an entry has failed to execute and there is no remaining + fallback entry to attempt. */ + void (*notify_failure) (void *userdata); +} +*grub_menu_execute_callback_t; void grub_enter_normal_mode (const char *config); void grub_normal_execute (const char *config, int nested); +void grub_menu_execute_with_fallback (grub_menu_t menu, + grub_menu_entry_t entry, + grub_menu_execute_callback_t callback, + void *callback_data); void grub_menu_entry_run (grub_menu_entry_t entry); void grub_menu_execute_entry(grub_menu_entry_t entry); +grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no); +int grub_menu_get_timeout (void); +void grub_menu_set_timeout (int timeout); void grub_cmdline_run (int nested); int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, int echo_char, int readline); diff --git a/normal/main.c b/normal/main.c index 09d17b26d..a0c013555 100644 --- a/normal/main.c +++ b/normal/main.c @@ -620,7 +620,7 @@ GRUB_MOD_INIT(normal) if (mod) grub_dl_ref (mod); - grub_menu_viewer_register (&grub_normal_terminal_menu_viewer); + grub_menu_viewer_register (&grub_normal_text_menu_viewer); grub_set_history (GRUB_DEFAULT_HISTORY_SIZE); diff --git a/normal/menu.c b/normal/menu.c index b4fec26f0..df262096c 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -1,3 +1,4 @@ +/* menu.c - General supporting functionality for menus. */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. @@ -17,7 +18,6 @@ */ #include -#include #include #include #include @@ -26,83 +26,9 @@ #include #include -static grub_uint8_t grub_color_menu_normal; -static grub_uint8_t grub_color_menu_highlight; - -/* Wait until the user pushes any key so that the user - can see what happened. */ -void -grub_wait_after_message (void) -{ - grub_printf ("\nPress any key to continue..."); - (void) grub_getkey (); -} - -static void -draw_border (void) -{ - unsigned i; - - grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); - - grub_gotoxy (GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y); - grub_putcode (GRUB_TERM_DISP_UL); - for (i = 0; i < (unsigned) GRUB_TERM_BORDER_WIDTH - 2; i++) - grub_putcode (GRUB_TERM_DISP_HLINE); - grub_putcode (GRUB_TERM_DISP_UR); - - for (i = 0; i < (unsigned) GRUB_TERM_NUM_ENTRIES; i++) - { - grub_gotoxy (GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y + i + 1); - grub_putcode (GRUB_TERM_DISP_VLINE); - grub_gotoxy (GRUB_TERM_MARGIN + GRUB_TERM_BORDER_WIDTH - 1, - GRUB_TERM_TOP_BORDER_Y + i + 1); - grub_putcode (GRUB_TERM_DISP_VLINE); - } - - grub_gotoxy (GRUB_TERM_MARGIN, - GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES + 1); - grub_putcode (GRUB_TERM_DISP_LL); - for (i = 0; i < (unsigned) GRUB_TERM_BORDER_WIDTH - 2; i++) - grub_putcode (GRUB_TERM_DISP_HLINE); - grub_putcode (GRUB_TERM_DISP_LR); - - grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); - - grub_gotoxy (GRUB_TERM_MARGIN, - (GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES - + GRUB_TERM_MARGIN + 1)); -} - -static void -print_message (int nested, int edit) -{ - grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); - - if (edit) - { - grub_printf ("\n\ - Minimum Emacs-like screen editing is supported. TAB lists\n\ - completions. Press Ctrl-x to boot, Ctrl-c for a command-line\n\ - or ESC to return menu."); - } - else - { - grub_printf ("\n\ - Use the %C and %C keys to select which entry is highlighted.\n", - (grub_uint32_t) GRUB_TERM_DISP_UP, (grub_uint32_t) GRUB_TERM_DISP_DOWN); - grub_printf ("\ - Press enter to boot the selected OS, \'e\' to edit the\n\ - commands before booting or \'c\' for a command-line."); - if (nested) - grub_printf ("\n\ - ESC to return previous menu."); - } - -} - -static grub_menu_entry_t -get_entry (grub_menu_t menu, int no) +/* Get a menu entry by its index in the entry list. */ +grub_menu_entry_t +grub_menu_get_entry (grub_menu_t menu, int no) { grub_menu_entry_t e; @@ -112,140 +38,10 @@ get_entry (grub_menu_t menu, int no) return e; } -static void -print_entry (int y, int highlight, grub_menu_entry_t entry) -{ - int x; - const char *title; - grub_size_t title_len; - grub_ssize_t len; - grub_uint32_t *unicode_title; - grub_ssize_t i; - grub_uint8_t old_color_normal, old_color_highlight; - - title = entry ? entry->title : ""; - title_len = grub_strlen (title); - unicode_title = grub_malloc (title_len * sizeof (*unicode_title)); - if (! unicode_title) - /* XXX How to show this error? */ - return; - - len = grub_utf8_to_ucs4 (unicode_title, title_len, - (grub_uint8_t *) title, -1, 0); - if (len < 0) - { - /* It is an invalid sequence. */ - grub_free (unicode_title); - return; - } - - grub_getcolor (&old_color_normal, &old_color_highlight); - grub_setcolor (grub_color_menu_normal, grub_color_menu_highlight); - grub_setcolorstate (highlight - ? GRUB_TERM_COLOR_HIGHLIGHT - : GRUB_TERM_COLOR_NORMAL); - - grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN, y); - - for (x = GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1, i = 0; - x < GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH - GRUB_TERM_MARGIN; - i++) - { - if (i < len - && x <= (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH - - GRUB_TERM_MARGIN - 1)) - { - grub_ssize_t width; - - width = grub_getcharwidth (unicode_title[i]); - - if (x + width > (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH - - GRUB_TERM_MARGIN - 1)) - grub_putcode (GRUB_TERM_DISP_RIGHT); - else - grub_putcode (unicode_title[i]); - - x += width; - } - else - { - grub_putchar (' '); - x++; - } - } - grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); - grub_putchar (' '); - - grub_gotoxy (GRUB_TERM_CURSOR_X, y); - - grub_setcolor (old_color_normal, old_color_highlight); - grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); - grub_free (unicode_title); -} - -static void -print_entries (grub_menu_t menu, int first, int offset) -{ - grub_menu_entry_t e; - int i; - - grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH, - GRUB_TERM_FIRST_ENTRY_Y); - - if (first) - grub_putcode (GRUB_TERM_DISP_UP); - else - grub_putchar (' '); - - e = get_entry (menu, first); - - for (i = 0; i < GRUB_TERM_NUM_ENTRIES; i++) - { - print_entry (GRUB_TERM_FIRST_ENTRY_Y + i, offset == i, e); - if (e) - e = e->next; - } - - grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH, - GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES); - - if (e) - grub_putcode (GRUB_TERM_DISP_DOWN); - else - grub_putchar (' '); - - grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); -} - -/* Initialize the screen. If NESTED is non-zero, assume that this menu - is run from another menu or a command-line. If EDIT is non-zero, show - a message for the menu entry editor. */ -void -grub_menu_init_page (int nested, int edit) -{ - grub_uint8_t old_color_normal, old_color_highlight; - - grub_getcolor (&old_color_normal, &old_color_highlight); - - /* By default, use the same colors for the menu. */ - grub_color_menu_normal = old_color_normal; - grub_color_menu_highlight = old_color_highlight; - - /* Then give user a chance to replace them. */ - grub_parse_color_name_pair (&grub_color_menu_normal, grub_env_get ("menu_color_normal")); - grub_parse_color_name_pair (&grub_color_menu_highlight, grub_env_get ("menu_color_highlight")); - - grub_normal_init_page (); - grub_setcolor (grub_color_menu_normal, grub_color_menu_highlight); - draw_border (); - grub_setcolor (old_color_normal, old_color_highlight); - print_message (nested, edit); -} - /* Return the current timeout. If the variable "timeout" is not set or invalid, return -1. */ -static int -get_timeout (void) +int +grub_menu_get_timeout (void) { char *val; int timeout; @@ -272,8 +68,8 @@ get_timeout (void) } /* Set current timeout in the variable "timeout". */ -static void -set_timeout (int timeout) +void +grub_menu_set_timeout (int timeout) { /* Ignore TIMEOUT if it is zero, because it will be unset really soon. */ if (timeout > 0) @@ -285,11 +81,15 @@ set_timeout (int timeout) } } -/* Get the entry number from the variable NAME. */ +/* Get the first entry number from the value of the environment variable NAME, + which is a space-separated list of nonnegative integers. The entry number + which is returned is stripped from the value of NAME. If no entry number + can be found, -1 is returned. */ static int -get_entry_number (const char *name) +get_and_remove_first_entry_number (const char *name) { char *val; + char *tail; int entry; val = grub_env_get (name); @@ -298,10 +98,18 @@ get_entry_number (const char *name) grub_error_push (); - entry = (int) grub_strtoul (val, 0, 0); + entry = (int) grub_strtoul (val, &tail, 0); - if (grub_errno != GRUB_ERR_NONE) + if (grub_errno == GRUB_ERR_NONE) { + /* Skip whitespace to find the next digit. */ + while (*tail && grub_isspace (*tail)) + tail++; + grub_env_set (name, tail); + } + else + { + grub_env_unset (name); grub_errno = GRUB_ERR_NONE; entry = -1; } @@ -311,245 +119,6 @@ get_entry_number (const char *name) return entry; } -static void -print_timeout (int timeout, int offset, int second_stage) -{ - /* NOTE: Do not remove the trailing space characters. - They are required to clear the line. */ - char *msg = " The highlighted entry will be booted automatically in %ds. "; - char *msg_end = grub_strchr (msg, '%'); - - grub_gotoxy (second_stage ? (msg_end - msg) : 0, GRUB_TERM_HEIGHT - 3); - grub_printf (second_stage ? msg_end : msg, timeout); - grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); - grub_refresh (); -}; - -static int -run_menu (grub_menu_t menu, int nested) -{ - int first, offset; - grub_uint64_t saved_time; - int default_entry; - int timeout; - - first = 0; - - default_entry = get_entry_number ("default"); - - /* If DEFAULT_ENTRY is not within the menu entries, fall back to - the first entry. */ - if (default_entry < 0 || default_entry >= menu->size) - default_entry = 0; - - /* If timeout is 0, drawing is pointless (and ugly). */ - if (get_timeout () == 0) - return default_entry; - - offset = default_entry; - if (offset > GRUB_TERM_NUM_ENTRIES - 1) - { - first = offset - (GRUB_TERM_NUM_ENTRIES - 1); - offset = GRUB_TERM_NUM_ENTRIES - 1; - } - - /* Initialize the time. */ - saved_time = grub_get_time_ms (); - - refresh: - grub_setcursor (0); - grub_menu_init_page (nested, 0); - print_entries (menu, first, offset); - grub_refresh (); - - timeout = get_timeout (); - - if (timeout > 0) - print_timeout (timeout, offset, 0); - - while (1) - { - int c; - timeout = get_timeout (); - - if (timeout > 0) - { - grub_uint64_t current_time; - - current_time = grub_get_time_ms (); - if (current_time - saved_time >= 1000) - { - timeout--; - set_timeout (timeout); - saved_time = current_time; - print_timeout (timeout, offset, 1); - } - } - - if (timeout == 0) - { - grub_env_unset ("timeout"); - return default_entry; - } - - if (grub_checkkey () >= 0 || timeout < 0) - { - c = GRUB_TERM_ASCII_CHAR (grub_getkey ()); - - if (timeout >= 0) - { - grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); - grub_printf ("\ - "); - grub_env_unset ("timeout"); - grub_env_unset ("fallback"); - grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); - } - - switch (c) - { - case GRUB_TERM_HOME: - first = 0; - offset = 0; - print_entries (menu, first, offset); - break; - - case GRUB_TERM_END: - offset = menu->size - 1; - if (offset > GRUB_TERM_NUM_ENTRIES - 1) - { - first = offset - (GRUB_TERM_NUM_ENTRIES - 1); - offset = GRUB_TERM_NUM_ENTRIES - 1; - } - print_entries (menu, first, offset); - break; - - case GRUB_TERM_UP: - case '^': - if (offset > 0) - { - print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 0, - get_entry (menu, first + offset)); - offset--; - print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 1, - get_entry (menu, first + offset)); - } - else if (first > 0) - { - first--; - print_entries (menu, first, offset); - } - break; - - case GRUB_TERM_DOWN: - case 'v': - if (menu->size > first + offset + 1) - { - if (offset < GRUB_TERM_NUM_ENTRIES - 1) - { - print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 0, - get_entry (menu, first + offset)); - offset++; - print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 1, - get_entry (menu, first + offset)); - } - else - { - first++; - print_entries (menu, first, offset); - } - } - break; - - case GRUB_TERM_PPAGE: - if (first == 0) - { - offset = 0; - } - else - { - first -= GRUB_TERM_NUM_ENTRIES; - - if (first < 0) - { - offset += first; - first = 0; - } - } - print_entries (menu, first, offset); - break; - - case GRUB_TERM_NPAGE: - if (offset == 0) - { - offset += GRUB_TERM_NUM_ENTRIES - 1; - if (first + offset >= menu->size) - { - offset = menu->size - first - 1; - } - } - else - { - first += GRUB_TERM_NUM_ENTRIES; - - if (first + offset >= menu->size) - { - first -= GRUB_TERM_NUM_ENTRIES; - offset += GRUB_TERM_NUM_ENTRIES; - - if (offset > menu->size - 1 || - offset > GRUB_TERM_NUM_ENTRIES - 1) - { - offset = menu->size - first - 1; - } - if (offset > GRUB_TERM_NUM_ENTRIES) - { - first += offset - GRUB_TERM_NUM_ENTRIES + 1; - offset = GRUB_TERM_NUM_ENTRIES - 1; - } - } - } - print_entries (menu, first, offset); - break; - - case '\n': - case '\r': - case 6: - grub_setcursor (1); - return first + offset; - - case '\e': - if (nested) - { - grub_setcursor (1); - return -1; - } - break; - - case 'c': - grub_cmdline_run (1); - goto refresh; - - case 'e': - { - grub_menu_entry_t e = get_entry (menu, first + offset); - if (e) - grub_menu_entry_run (e); - } - goto refresh; - - default: - break; - } - - grub_refresh (); - } - } - - /* Never reach here. */ - return -1; -} - /* Run a menu entry. */ void grub_menu_execute_entry(grub_menu_entry_t entry) @@ -561,58 +130,37 @@ grub_menu_execute_entry(grub_menu_entry_t entry) grub_command_execute ("boot", 0); } -static grub_err_t -show_text_menu (grub_menu_t menu, int nested) +/* Execute ENTRY from the menu MENU, falling back to entries specified + in the environment variable "fallback" if it fails. CALLBACK is a + pointer to a struct of function pointers which are used to allow the + caller provide feedback to the user. */ +void +grub_menu_execute_with_fallback (grub_menu_t menu, + grub_menu_entry_t entry, + grub_menu_execute_callback_t callback, + void *callback_data) { - while (1) + int fallback_entry; + + callback->notify_booting (entry, callback_data); + + grub_menu_execute_entry (entry); + + /* Deal with fallback entries. */ + while ((fallback_entry = get_and_remove_first_entry_number ("fallback")) + >= 0) { - int boot_entry; - grub_menu_entry_t e; - int fallback_entry; + grub_print_error (); + grub_errno = GRUB_ERR_NONE; - boot_entry = run_menu (menu, nested); - if (boot_entry < 0) - break; - - e = get_entry (menu, boot_entry); - if (! e) - continue; /* Menu is empty. */ - - grub_cls (); - grub_setcursor (1); - - grub_printf (" Booting \'%s\'\n\n", e->title); - - grub_menu_execute_entry (e); - - /* Deal with a fallback entry. */ - /* FIXME: Multiple fallback entries like GRUB Legacy. */ - fallback_entry = get_entry_number ("fallback"); - if (fallback_entry >= 0) - { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - - e = get_entry (menu, fallback_entry); - grub_env_unset ("fallback"); - grub_printf ("\n Falling back to \'%s\'\n\n", e->title); - grub_menu_execute_entry (e); - } - - if (grub_errno != GRUB_ERR_NONE) - { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - - grub_wait_after_message (); - } + entry = grub_menu_get_entry (menu, fallback_entry); + callback->notify_fallback (entry, callback_data); + grub_menu_execute_entry (entry); + /* If the function call to execute the entry returns at all, then this is + taken to indicate a boot failure. For menu entries that do something + other than actually boot an operating system, this could assume + incorrectly that something failed. */ } - return GRUB_ERR_NONE; + callback->notify_failure (callback_data); } - -struct grub_menu_viewer grub_normal_terminal_menu_viewer = -{ - .name = "terminal", - .show_menu = show_text_menu -}; diff --git a/normal/menu_text.c b/normal/menu_text.c new file mode 100644 index 000000000..cb229828e --- /dev/null +++ b/normal/menu_text.c @@ -0,0 +1,600 @@ +/* menu_text.c - Basic text menu implementation. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Time to delay after displaying an error message about a default/fallback + entry failing to boot. */ +#define DEFAULT_ENTRY_ERROR_DELAY_MS 2500 + +static grub_uint8_t grub_color_menu_normal; +static grub_uint8_t grub_color_menu_highlight; + +/* Wait until the user pushes any key so that the user + can see what happened. */ +void +grub_wait_after_message (void) +{ + grub_printf ("\nPress any key to continue..."); + (void) grub_getkey (); +} + +static void +draw_border (void) +{ + unsigned i; + + grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); + + grub_gotoxy (GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y); + grub_putcode (GRUB_TERM_DISP_UL); + for (i = 0; i < (unsigned) GRUB_TERM_BORDER_WIDTH - 2; i++) + grub_putcode (GRUB_TERM_DISP_HLINE); + grub_putcode (GRUB_TERM_DISP_UR); + + for (i = 0; i < (unsigned) GRUB_TERM_NUM_ENTRIES; i++) + { + grub_gotoxy (GRUB_TERM_MARGIN, GRUB_TERM_TOP_BORDER_Y + i + 1); + grub_putcode (GRUB_TERM_DISP_VLINE); + grub_gotoxy (GRUB_TERM_MARGIN + GRUB_TERM_BORDER_WIDTH - 1, + GRUB_TERM_TOP_BORDER_Y + i + 1); + grub_putcode (GRUB_TERM_DISP_VLINE); + } + + grub_gotoxy (GRUB_TERM_MARGIN, + GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES + 1); + grub_putcode (GRUB_TERM_DISP_LL); + for (i = 0; i < (unsigned) GRUB_TERM_BORDER_WIDTH - 2; i++) + grub_putcode (GRUB_TERM_DISP_HLINE); + grub_putcode (GRUB_TERM_DISP_LR); + + grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); + + grub_gotoxy (GRUB_TERM_MARGIN, + (GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES + + GRUB_TERM_MARGIN + 1)); +} + +static void +print_message (int nested, int edit) +{ + grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); + + if (edit) + { + grub_printf ("\n\ + Minimum Emacs-like screen editing is supported. TAB lists\n\ + completions. Press Ctrl-x to boot, Ctrl-c for a command-line\n\ + or ESC to return menu."); + } + else + { + grub_printf ("\n\ + Use the %C and %C keys to select which entry is highlighted.\n", + (grub_uint32_t) GRUB_TERM_DISP_UP, (grub_uint32_t) GRUB_TERM_DISP_DOWN); + grub_printf ("\ + Press enter to boot the selected OS, \'e\' to edit the\n\ + commands before booting or \'c\' for a command-line."); + if (nested) + grub_printf ("\n\ + ESC to return previous menu."); + } +} + +static void +print_entry (int y, int highlight, grub_menu_entry_t entry) +{ + int x; + const char *title; + grub_size_t title_len; + grub_ssize_t len; + grub_uint32_t *unicode_title; + grub_ssize_t i; + grub_uint8_t old_color_normal, old_color_highlight; + + title = entry ? entry->title : ""; + title_len = grub_strlen (title); + unicode_title = grub_malloc (title_len * sizeof (*unicode_title)); + if (! unicode_title) + /* XXX How to show this error? */ + return; + + len = grub_utf8_to_ucs4 (unicode_title, title_len, + (grub_uint8_t *) title, -1, 0); + if (len < 0) + { + /* It is an invalid sequence. */ + grub_free (unicode_title); + return; + } + + grub_getcolor (&old_color_normal, &old_color_highlight); + grub_setcolor (grub_color_menu_normal, grub_color_menu_highlight); + grub_setcolorstate (highlight + ? GRUB_TERM_COLOR_HIGHLIGHT + : GRUB_TERM_COLOR_NORMAL); + + grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN, y); + + for (x = GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1, i = 0; + x < GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH - GRUB_TERM_MARGIN; + i++) + { + if (i < len + && x <= (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH + - GRUB_TERM_MARGIN - 1)) + { + grub_ssize_t width; + + width = grub_getcharwidth (unicode_title[i]); + + if (x + width > (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH + - GRUB_TERM_MARGIN - 1)) + grub_putcode (GRUB_TERM_DISP_RIGHT); + else + grub_putcode (unicode_title[i]); + + x += width; + } + else + { + grub_putchar (' '); + x++; + } + } + grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); + grub_putchar (' '); + + grub_gotoxy (GRUB_TERM_CURSOR_X, y); + + grub_setcolor (old_color_normal, old_color_highlight); + grub_setcolorstate (GRUB_TERM_COLOR_NORMAL); + grub_free (unicode_title); +} + +static void +print_entries (grub_menu_t menu, int first, int offset) +{ + grub_menu_entry_t e; + int i; + + grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH, + GRUB_TERM_FIRST_ENTRY_Y); + + if (first) + grub_putcode (GRUB_TERM_DISP_UP); + else + grub_putchar (' '); + + e = grub_menu_get_entry (menu, first); + + for (i = 0; i < GRUB_TERM_NUM_ENTRIES; i++) + { + print_entry (GRUB_TERM_FIRST_ENTRY_Y + i, offset == i, e); + if (e) + e = e->next; + } + + grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH, + GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES); + + if (e) + grub_putcode (GRUB_TERM_DISP_DOWN); + else + grub_putchar (' '); + + grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); +} + +/* Initialize the screen. If NESTED is non-zero, assume that this menu + is run from another menu or a command-line. If EDIT is non-zero, show + a message for the menu entry editor. */ +void +grub_menu_init_page (int nested, int edit) +{ + grub_uint8_t old_color_normal, old_color_highlight; + + grub_getcolor (&old_color_normal, &old_color_highlight); + + /* By default, use the same colors for the menu. */ + grub_color_menu_normal = old_color_normal; + grub_color_menu_highlight = old_color_highlight; + + /* Then give user a chance to replace them. */ + grub_parse_color_name_pair (&grub_color_menu_normal, grub_env_get ("menu_color_normal")); + grub_parse_color_name_pair (&grub_color_menu_highlight, grub_env_get ("menu_color_highlight")); + + grub_normal_init_page (); + grub_setcolor (grub_color_menu_normal, grub_color_menu_highlight); + draw_border (); + grub_setcolor (old_color_normal, old_color_highlight); + print_message (nested, edit); +} + +/* Get the entry number from the variable NAME. */ +static int +get_entry_number (const char *name) +{ + char *val; + int entry; + + val = grub_env_get (name); + if (! val) + return -1; + + grub_error_push (); + + entry = (int) grub_strtoul (val, 0, 0); + + if (grub_errno != GRUB_ERR_NONE) + { + grub_errno = GRUB_ERR_NONE; + entry = -1; + } + + grub_error_pop (); + + return entry; +} + +static void +print_timeout (int timeout, int offset, int second_stage) +{ + /* NOTE: Do not remove the trailing space characters. + They are required to clear the line. */ + char *msg = " The highlighted entry will be booted automatically in %ds. "; + char *msg_end = grub_strchr (msg, '%'); + + grub_gotoxy (second_stage ? (msg_end - msg) : 0, GRUB_TERM_HEIGHT - 3); + grub_printf (second_stage ? msg_end : msg, timeout); + grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); + grub_refresh (); +}; + +/* Show the menu and handle menu entry selection. Returns the menu entry + index that should be executed or -1 if no entry should be executed (e.g., + Esc pressed to exit a sub-menu or switching menu viewers). + If the return value is not -1, then *AUTO_BOOT is nonzero iff the menu + entry to be executed is a result of an automatic default selection because + of the timeout. */ +static int +run_menu (grub_menu_t menu, int nested, int *auto_boot) +{ + int first, offset; + grub_uint64_t saved_time; + int default_entry; + int timeout; + + first = 0; + + default_entry = get_entry_number ("default"); + + /* If DEFAULT_ENTRY is not within the menu entries, fall back to + the first entry. */ + if (default_entry < 0 || default_entry >= menu->size) + default_entry = 0; + + /* If timeout is 0, drawing is pointless (and ugly). */ + if (grub_menu_get_timeout () == 0) + { + *auto_boot = 1; + return default_entry; + } + + offset = default_entry; + if (offset > GRUB_TERM_NUM_ENTRIES - 1) + { + first = offset - (GRUB_TERM_NUM_ENTRIES - 1); + offset = GRUB_TERM_NUM_ENTRIES - 1; + } + + /* Initialize the time. */ + saved_time = grub_get_time_ms (); + + refresh: + grub_setcursor (0); + grub_menu_init_page (nested, 0); + print_entries (menu, first, offset); + grub_refresh (); + + timeout = grub_menu_get_timeout (); + + if (timeout > 0) + print_timeout (timeout, offset, 0); + + while (1) + { + int c; + timeout = grub_menu_get_timeout (); + + if (timeout > 0) + { + grub_uint64_t current_time; + + current_time = grub_get_time_ms (); + if (current_time - saved_time >= 1000) + { + timeout--; + grub_menu_set_timeout (timeout); + saved_time = current_time; + print_timeout (timeout, offset, 1); + } + } + + if (timeout == 0) + { + grub_env_unset ("timeout"); + *auto_boot = 1; + return default_entry; + } + + if (grub_checkkey () >= 0 || timeout < 0) + { + c = GRUB_TERM_ASCII_CHAR (grub_getkey ()); + + if (timeout >= 0) + { + grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); + grub_printf ("\ + "); + grub_env_unset ("timeout"); + grub_env_unset ("fallback"); + grub_gotoxy (GRUB_TERM_CURSOR_X, GRUB_TERM_FIRST_ENTRY_Y + offset); + } + + switch (c) + { + case GRUB_TERM_HOME: + first = 0; + offset = 0; + print_entries (menu, first, offset); + break; + + case GRUB_TERM_END: + offset = menu->size - 1; + if (offset > GRUB_TERM_NUM_ENTRIES - 1) + { + first = offset - (GRUB_TERM_NUM_ENTRIES - 1); + offset = GRUB_TERM_NUM_ENTRIES - 1; + } + print_entries (menu, first, offset); + break; + + case GRUB_TERM_UP: + case '^': + if (offset > 0) + { + print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 0, + grub_menu_get_entry (menu, first + offset)); + offset--; + print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 1, + grub_menu_get_entry (menu, first + offset)); + } + else if (first > 0) + { + first--; + print_entries (menu, first, offset); + } + break; + + case GRUB_TERM_DOWN: + case 'v': + if (menu->size > first + offset + 1) + { + if (offset < GRUB_TERM_NUM_ENTRIES - 1) + { + print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 0, + grub_menu_get_entry (menu, first + offset)); + offset++; + print_entry (GRUB_TERM_FIRST_ENTRY_Y + offset, 1, + grub_menu_get_entry (menu, first + offset)); + } + else + { + first++; + print_entries (menu, first, offset); + } + } + break; + + case GRUB_TERM_PPAGE: + if (first == 0) + { + offset = 0; + } + else + { + first -= GRUB_TERM_NUM_ENTRIES; + + if (first < 0) + { + offset += first; + first = 0; + } + } + print_entries (menu, first, offset); + break; + + case GRUB_TERM_NPAGE: + if (offset == 0) + { + offset += GRUB_TERM_NUM_ENTRIES - 1; + if (first + offset >= menu->size) + { + offset = menu->size - first - 1; + } + } + else + { + first += GRUB_TERM_NUM_ENTRIES; + + if (first + offset >= menu->size) + { + first -= GRUB_TERM_NUM_ENTRIES; + offset += GRUB_TERM_NUM_ENTRIES; + + if (offset > menu->size - 1 || + offset > GRUB_TERM_NUM_ENTRIES - 1) + { + offset = menu->size - first - 1; + } + if (offset > GRUB_TERM_NUM_ENTRIES) + { + first += offset - GRUB_TERM_NUM_ENTRIES + 1; + offset = GRUB_TERM_NUM_ENTRIES - 1; + } + } + } + print_entries (menu, first, offset); + break; + + case '\n': + case '\r': + case 6: + grub_setcursor (1); + *auto_boot = 0; + return first + offset; + + case '\e': + if (nested) + { + grub_setcursor (1); + return -1; + } + break; + + case 'c': + grub_cmdline_run (1); + goto refresh; + + case 'e': + { + grub_menu_entry_t e = grub_menu_get_entry (menu, first + offset); + if (e) + grub_menu_entry_run (e); + } + goto refresh; + + default: + break; + } + + grub_refresh (); + } + } + + /* Never reach here. */ + return -1; +} + +/* Callback invoked immediately before a menu entry is executed. */ +static void +notify_booting (grub_menu_entry_t entry, + void *userdata __attribute__((unused))) +{ + grub_printf (" Booting \'%s\'\n\n", entry->title); +} + +/* Callback invoked when a default menu entry executed because of a timeout + has failed and an attempt will be made to execute the next fallback + entry, ENTRY. */ +static void +notify_fallback (grub_menu_entry_t entry, + void *userdata __attribute__((unused))) +{ + grub_printf ("\n Falling back to \'%s\'\n\n", entry->title); + grub_millisleep (DEFAULT_ENTRY_ERROR_DELAY_MS); +} + +/* Callback invoked when a menu entry has failed and there is no remaining + fallback entry to attempt. */ +static void +notify_execution_failure (void *userdata __attribute__((unused))) +{ + if (grub_errno != GRUB_ERR_NONE) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + } + grub_printf ("\n Failed to boot default entries.\n"); + grub_wait_after_message (); +} + +/* Callbacks used by the text menu to provide user feedback when menu entries + are executed. */ +static struct grub_menu_execute_callback execution_callback = +{ + .notify_booting = notify_booting, + .notify_fallback = notify_fallback, + .notify_failure = notify_execution_failure +}; + +static grub_err_t +show_text_menu (grub_menu_t menu, int nested) +{ + while (1) + { + int boot_entry; + grub_menu_entry_t e; + int auto_boot; + + boot_entry = run_menu (menu, nested, &auto_boot); + if (boot_entry < 0) + break; + + e = grub_menu_get_entry (menu, boot_entry); + if (! e) + continue; /* Menu is empty. */ + + grub_cls (); + grub_setcursor (1); + + if (auto_boot) + { + grub_menu_execute_with_fallback (menu, e, &execution_callback, 0); + } + else + { + grub_errno = GRUB_ERR_NONE; + grub_menu_execute_entry (e); + if (grub_errno != GRUB_ERR_NONE) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + grub_wait_after_message (); + } + } + } + + return GRUB_ERR_NONE; +} + +struct grub_menu_viewer grub_normal_text_menu_viewer = +{ + .name = "text", + .show_menu = show_text_menu +}; From ac84cfb8f680a4af1e1bba59e7329e7e7a7b05f9 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 13 Feb 2009 20:26:56 +0000 Subject: [PATCH 0531/1707] Regenerate --- DISTLIST | 1 + 1 file changed, 1 insertion(+) diff --git a/DISTLIST b/DISTLIST index a9e879d18..b5c8bfdea 100644 --- a/DISTLIST +++ b/DISTLIST @@ -404,6 +404,7 @@ normal/lexer.c normal/main.c normal/menu.c normal/menu_entry.c +normal/menu_text.c normal/menu_viewer.c normal/misc.c normal/parser.y From 9ff516f3ebf954b6711d8fa985d136f03027fe15 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Sat, 14 Feb 2009 12:57:55 +0000 Subject: [PATCH 0532/1707] 2009-02-14 Christian Franke * commands/hdparm.c: New file. Provides `hdparm' command which sends ATA commands via grub_disk_ata_pass_through (). * conf/i386-pc.rmk: Add ata_pthru.mod and hdparm.mod. * disk/ata.c: Include . Move and to include/grub/ata.h. (enum grub_ata_addressing_t): Move to include/grub/ata.h. (GRUB_CDROM_SECTOR_SIZE): Remove. (GRUB_ATA_*): Move to include/grub/ata.h. (GRUB_ATAPI_*): Likewise. (enum grub_ata_commands): Likewise. (enum grub_ata_timeout_milliseconds): Likewise. (struct grub_ata_device): Likewise. (grub_ata_regset): Likewise. (grub_ata_regget): Likewise. (grub_ata_regset2): Likewise. (grub_ata_regget2): Likewise. (grub_ata_check_ready): Likewise. (grub_ata_wait_not_busy): Remove static, exported in include/grub/ata.h. (grub_ata_wait_drq): Likewise. (grub_ata_pio_read): Likewise. * disk/ata_pthru.c: New file. Provides grub_ata_pass_through () function for hdparm.mod. * include/grub/ata.h: New file, contains declarations from disk/ata.c. (enum grub_ata_commands): Add new commands for commands/hdparm.c. * include/grub/disk.h (grub_disk_ata_pass_through_parms): New struct. (grub_disk_ata_pass_through): New exported variable. * kern/disk.c (grub_disk_ata_pass_through): New variable. --- ChangeLog | 38 ++++ DISTLIST | 3 + commands/hdparm.c | 421 ++++++++++++++++++++++++++++++++++++++++++++ conf/i386-pc.mk | 135 +++++++++++++- conf/i386-pc.rmk | 12 +- disk/ata.c | 141 +-------------- disk/ata_pthru.c | 109 ++++++++++++ include/grub/ata.h | 168 ++++++++++++++++++ include/grub/disk.h | 11 ++ kern/disk.c | 4 + 10 files changed, 904 insertions(+), 138 deletions(-) create mode 100644 commands/hdparm.c create mode 100644 disk/ata_pthru.c create mode 100644 include/grub/ata.h diff --git a/ChangeLog b/ChangeLog index a041adc49..3e09cb823 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,41 @@ +2009-02-14 Christian Franke + + * commands/hdparm.c: New file. Provides `hdparm' command + which sends ATA commands via grub_disk_ata_pass_through (). + + * conf/i386-pc.rmk: Add ata_pthru.mod and hdparm.mod. + + * disk/ata.c: Include . Move + and to include/grub/ata.h. + (enum grub_ata_addressing_t): Move to include/grub/ata.h. + (GRUB_CDROM_SECTOR_SIZE): Remove. + (GRUB_ATA_*): Move to include/grub/ata.h. + (GRUB_ATAPI_*): Likewise. + (enum grub_ata_commands): Likewise. + (enum grub_ata_timeout_milliseconds): Likewise. + (struct grub_ata_device): Likewise. + (grub_ata_regset): Likewise. + (grub_ata_regget): Likewise. + (grub_ata_regset2): Likewise. + (grub_ata_regget2): Likewise. + (grub_ata_check_ready): Likewise. + (grub_ata_wait_not_busy): Remove static, exported in + include/grub/ata.h. + (grub_ata_wait_drq): Likewise. + (grub_ata_pio_read): Likewise. + + * disk/ata_pthru.c: New file. Provides grub_ata_pass_through () + function for hdparm.mod. + + * include/grub/ata.h: New file, contains declarations from + disk/ata.c. + (enum grub_ata_commands): Add new commands for commands/hdparm.c. + + * include/grub/disk.h (grub_disk_ata_pass_through_parms): New struct. + (grub_disk_ata_pass_through): New exported variable. + + * kern/disk.c (grub_disk_ata_pass_through): New variable. + 2009-02-13 Colin D Bennett Support multiple fallback entries, and provide an API to support diff --git a/DISTLIST b/DISTLIST index b5c8bfdea..63cff3dd6 100644 --- a/DISTLIST +++ b/DISTLIST @@ -49,6 +49,7 @@ commands/crc.c commands/date.c commands/echo.c commands/halt.c +commands/hdparm.c commands/help.c commands/hexdump.c commands/loadenv.c @@ -90,6 +91,7 @@ conf/sparc64-ieee1275.rmk conf/x86_64-efi.mk conf/x86_64-efi.rmk disk/ata.c +disk/ata_pthru.c disk/dmraid_nvidia.c disk/fs_uuid.c disk/host.c @@ -139,6 +141,7 @@ include/multiboot2.h include/grub/acorn_filecore.h include/grub/aout.h include/grub/arg.h +include/grub/ata.h include/grub/bitmap.h include/grub/boot.h include/grub/bufio.h diff --git a/commands/hdparm.c b/commands/hdparm.c new file mode 100644 index 000000000..9f2ba905c --- /dev/null +++ b/commands/hdparm.c @@ -0,0 +1,421 @@ +/* hdparm.c - command to get/set ATA disk parameters. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + + +static const struct grub_arg_option options[] = { + {"apm", 'B', 0, "set Advanced Power Management\n" + "(1=low, ..., 254=high, 255=off)", + 0, ARG_TYPE_INT}, + {"power", 'C', 0, "check power mode", 0, ARG_TYPE_NONE}, + {"security-freeze", 'F', 0, "freeze ATA security settings until reset", + 0, ARG_TYPE_NONE}, + {"health", 'H', 0, "check SMART health status", 0, ARG_TYPE_NONE}, + {"aam", 'M', 0, "set Automatic Acoustic Management\n" + "(0=off, 128=quiet, ..., 254=fast)", + 0, ARG_TYPE_INT}, + {"standby-timeout", 'S', 0, "set standby timeout\n" + "(0=off, 1=5s, 2=10s, ..., 240=20m, 241=30m, ...)", + 0, ARG_TYPE_INT}, + {"standby", 'y', 0, "set drive to standby mode", 0, ARG_TYPE_NONE}, + {"sleep", 'Y', 0, "set drive to sleep mode", 0, ARG_TYPE_NONE}, + {"identify", 'i', 0, "print drive identity and settings", + 0, ARG_TYPE_NONE}, + {"dumpid", 'I', 0, "dump contents of ATA IDENTIFY sector", + 0, ARG_TYPE_NONE}, + {"smart", -1, 0, "disable/enable SMART (0/1)", 0, ARG_TYPE_INT}, + {"quiet", 'q', 0, "do not print messages", 0, ARG_TYPE_NONE}, + {0, 0, 0, 0, 0, 0} +}; + +enum grub_ata_smart_commands + { + GRUB_ATA_FEAT_SMART_ENABLE = 0xd8, + GRUB_ATA_FEAT_SMART_DISABLE = 0xd9, + GRUB_ATA_FEAT_SMART_STATUS = 0xda, + }; + +static int quiet = 0; + +static grub_err_t +grub_hdparm_do_ata_cmd (grub_disk_t disk, grub_uint8_t cmd, + grub_uint8_t features, grub_uint8_t sectors, + void * buffer, int size) +{ + struct grub_disk_ata_pass_through_parms apt; + grub_memset (&apt, 0, sizeof (apt)); + + apt.taskfile[GRUB_ATA_REG_CMD] = cmd; + apt.taskfile[GRUB_ATA_REG_FEATURES] = features; + apt.taskfile[GRUB_ATA_REG_SECTORS] = sectors; + apt.buffer = buffer; + apt.size = size; + + if (grub_disk_ata_pass_through (disk, &apt)) + return grub_errno; + + return GRUB_ERR_NONE; +} + +static int +grub_hdparm_do_check_powermode_cmd (grub_disk_t disk) +{ + struct grub_disk_ata_pass_through_parms apt; + grub_memset (&apt, 0, sizeof (apt)); + + apt.taskfile[GRUB_ATA_REG_CMD] = GRUB_ATA_CMD_CHECK_POWER_MODE; + + if (grub_disk_ata_pass_through (disk, &apt)) + return -1; + + return apt.taskfile[GRUB_ATA_REG_SECTORS]; +} + +static int +grub_hdparm_do_smart_cmd (grub_disk_t disk, grub_uint8_t features) +{ + struct grub_disk_ata_pass_through_parms apt; + grub_memset (&apt, 0, sizeof (apt)); + + apt.taskfile[GRUB_ATA_REG_CMD] = GRUB_ATA_CMD_SMART; + apt.taskfile[GRUB_ATA_REG_FEATURES] = features; + apt.taskfile[GRUB_ATA_REG_LBAMID] = 0x4f; + apt.taskfile[GRUB_ATA_REG_LBAHIGH] = 0xc2; + + if (grub_disk_ata_pass_through (disk, &apt)) + return -1; + + if (features == GRUB_ATA_FEAT_SMART_STATUS) + { + if ( apt.taskfile[GRUB_ATA_REG_LBAMID] == 0x4f + && apt.taskfile[GRUB_ATA_REG_LBAHIGH] == 0xc2) + return 0; /* Good SMART status. */ + else if ( apt.taskfile[GRUB_ATA_REG_LBAMID] == 0xf4 + && apt.taskfile[GRUB_ATA_REG_LBAHIGH] == 0x2c) + return 1; /* Bad SMART status. */ + else + return -1; + } + return 0; +} + +static grub_err_t +grub_hdparm_simple_cmd (const char * msg, + grub_disk_t disk, grub_uint8_t cmd) +{ + if (! quiet && msg) + grub_printf ("%s", msg); + + grub_err_t err = grub_hdparm_do_ata_cmd (disk, cmd, 0, 0, NULL, 0); + + if (! quiet && msg) + grub_printf ("%s\n", ! err ? "" : ": not supported"); + return err; +} + +static grub_err_t +grub_hdparm_set_val_cmd (const char * msg, int val, + grub_disk_t disk, grub_uint8_t cmd, + grub_uint8_t features, grub_uint8_t sectors) +{ + if (! quiet && msg && *msg) + { + if (val >= 0) + grub_printf ("Set %s to %d", msg, val); + else + grub_printf ("Disable %s", msg); + } + + grub_err_t err = grub_hdparm_do_ata_cmd (disk, cmd, features, sectors, + NULL, 0); + + if (! quiet && msg) + grub_printf ("%s\n", ! err ? "" : ": not supported"); + return err; +} + +static const char * +le16_to_char (char *dest, const grub_uint16_t * src16, unsigned bytes) +{ + grub_uint16_t * dest16 = (grub_uint16_t *) dest; + unsigned i; + for (i = 0; i < bytes / 2; i++) + dest16[i] = grub_be_to_cpu16 (src16[i]); + return dest; +} + +static void +grub_hdparm_print_identify (const char * idbuf) +{ + const grub_uint16_t * idw = (const grub_uint16_t *) idbuf; + + /* Print identity strings. */ + char tmp[40]; + grub_printf ("Model: \"%.40s\"\n", le16_to_char (tmp, &idw[27], 40)); + grub_printf ("Firmware: \"%.8s\"\n", le16_to_char (tmp, &idw[23], 8)); + grub_printf ("Serial: \"%.20s\"\n", le16_to_char (tmp, &idw[10], 20)); + + /* Print AAM, APM and SMART settings. */ + grub_uint16_t features1 = grub_le_to_cpu16 (idw[82]); + grub_uint16_t features2 = grub_le_to_cpu16 (idw[83]); + grub_uint16_t enabled1 = grub_le_to_cpu16 (idw[85]); + grub_uint16_t enabled2 = grub_le_to_cpu16 (idw[86]); + + grub_printf ("Automatic Acoustic Management: "); + if (features2 & 0x0200) + { + if (enabled2 & 0x0200) + { + grub_uint16_t aam = grub_le_to_cpu16 (idw[94]); + grub_printf ("%u (128=quiet, ..., 254=fast, recommended=%u)\n", + aam & 0xff, (aam >> 8) & 0xff); + } + else + grub_printf ("disabled\n"); + } + else + grub_printf ("not supported\n"); + + grub_printf ("Advanced Power Management: "); + if (features2 & 0x0008) + { + if (enabled2 & 0x0008) + grub_printf ("%u (1=low, ..., 254=high)\n", + grub_le_to_cpu16 (idw[91]) & 0xff); + else + grub_printf ("disabled\n"); + } + else + grub_printf ("not supported\n"); + + grub_printf ("SMART Feature Set: "); + if (features1 & 0x0001) + grub_printf ("%sabled\n", (enabled1 & 0x0001 ? "en" : "dis")); + else + grub_printf ("not supported\n"); + + /* Print security settings. */ + grub_uint16_t security = grub_le_to_cpu16 (idw[128]); + + grub_printf ("ATA Security: "); + if (security & 0x0001) + grub_printf ("%s, %s, %s, %s\n", + (security & 0x0002 ? "ENABLED" : "disabled"), + (security & 0x0004 ? "**LOCKED**" : "not locked"), + (security & 0x0008 ? "frozen" : "NOT FROZEN"), + (security & 0x0010 ? "COUNT EXPIRED" : "count not expired")); + else + grub_printf ("not supported\n"); +} + +static void +grub_hdparm_print_standby_tout (int timeout) +{ + if (timeout == 0) + grub_printf ("off"); + else if (timeout <= 252 || timeout == 255) + { + int h = 0, m = 0 , s = 0; + if (timeout == 255) + { + m = 21; + s = 15; + } + else if (timeout == 252) + m = 21; + else if (timeout <= 240) + { + s = timeout * 5; + m = s / 60; + s %= 60; + } + else + { + m = (timeout - 240) * 30; + h = m / 60; + m %= 60; + } + grub_printf ("%02d:%02d:%02d", h, m, s); + } + else + grub_printf ("invalid or vendor-specific"); +} + +static int get_int_arg (const struct grub_arg_list *state) +{ + return (state->set ? (int)grub_strtoul (state->arg, 0, 0) : -1); +} + + +static grub_err_t +grub_cmd_hdparm (struct grub_arg_list *state, int argc, char **args) // state???? +{ + /* Check command line. */ + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing device name argument"); + + grub_size_t len = grub_strlen (args[0]); + if (! (args[0][0] == '(' && args[0][len - 1] == ')')) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "argument is not a device name"); + args[0][len - 1] = 0; + + if (! grub_disk_ata_pass_through) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "ATA pass through not available"); + + int i = 0; + int apm = get_int_arg (&state[i++]); + int power = state[i++].set; + int sec_freeze = state[i++].set; + int health = state[i++].set; + int aam = get_int_arg (&state[i++]); + int standby_tout = get_int_arg (&state[i++]); + int standby_now = state[i++].set; + int sleep_now = state[i++].set; + int ident = state[i++].set; + int dumpid = state[i++].set; + int enable_smart = get_int_arg (&state[i++]); + quiet = state[i++].set; + + /* Open disk. */ + grub_disk_t disk = grub_disk_open (&args[0][1]); + if (! disk) + return grub_errno; + + if (disk->partition) + { + grub_disk_close (disk); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "partition not allowed"); + } + + /* Change settings. */ + if (aam >= 0) + grub_hdparm_set_val_cmd ("Automatic Acoustic Management", (aam ? aam : -1), + disk, GRUB_ATA_CMD_SET_FEATURES, (aam ? 0x42 : 0xc2), aam); + + if (apm >= 0) + grub_hdparm_set_val_cmd ("Advanced Power Management", + (apm != 255 ? apm : -1), disk, GRUB_ATA_CMD_SET_FEATURES, + (apm != 255 ? 0x05 : 0x85), (apm != 255 ? apm : 0)); + + if (standby_tout >= 0) + { + if (! quiet) + { + grub_printf ("Set standby timeout to %d (", standby_tout); + grub_hdparm_print_standby_tout (standby_tout); + grub_printf (")"); + } + /* The IDLE cmd sets disk to idle mode and configures standby timer. */ + grub_hdparm_set_val_cmd ("", -1, disk, GRUB_ATA_CMD_IDLE, 0, standby_tout); + } + + if (enable_smart >= 0) + { + if (! quiet) + grub_printf ("%sable SMART operations", (enable_smart ? "En" : "Dis")); + int err = grub_hdparm_do_smart_cmd (disk, (enable_smart ? + GRUB_ATA_FEAT_SMART_ENABLE : GRUB_ATA_FEAT_SMART_DISABLE)); + if (! quiet) + grub_printf ("%s\n", err ? ": not supported" : ""); + } + + if (sec_freeze) + grub_hdparm_simple_cmd ("Freeze security settings", disk, + GRUB_ATA_CMD_SECURITY_FREEZE_LOCK); + + /* Print/dump IDENTIFY. */ + if (ident || dumpid) + { + char buf[GRUB_DISK_SECTOR_SIZE]; + if (grub_hdparm_do_ata_cmd (disk, GRUB_ATA_CMD_IDENTIFY_DEVICE, + 0, 0, buf, sizeof (buf))) + grub_printf ("Cannot read ATA IDENTIFY data\n"); + else + { + if (ident) + grub_hdparm_print_identify (buf); + if (dumpid) + hexdump (0, buf, sizeof (buf)); + } + } + + /* Check power mode. */ + if (power) + { + grub_printf ("Disk power mode is: "); + int mode = grub_hdparm_do_check_powermode_cmd (disk); + if (mode < 0) + grub_printf ("unknown\n"); + else + grub_printf ("%s (0x%02x)\n", + (mode == 0xff ? "active/idle" : + mode == 0x80 ? "idle" : + mode == 0x00 ? "standby" : "unknown"), mode); + } + + /* Check health. */ + int status = 0; + if (health) + { + if (! quiet) + grub_printf ("SMART status is: "); + int err = grub_hdparm_do_smart_cmd (disk, GRUB_ATA_FEAT_SMART_STATUS); + if (! quiet) + grub_printf ("%s\n", (err < 0 ? "unknown" : + err == 0 ? "OK" : "*BAD*")); + status = (err > 0); + } + + /* Change power mode. */ + if (standby_now) + grub_hdparm_simple_cmd ("Set disk to standby mode", disk, + GRUB_ATA_CMD_STANDBY_IMMEDIATE); + + if (sleep_now) + grub_hdparm_simple_cmd ("Set disk to sleep mode", disk, + GRUB_ATA_CMD_SLEEP); + + grub_disk_close (disk); + + grub_errno = GRUB_ERR_NONE; + return status; +} + + +GRUB_MOD_INIT(hdparm) +{ + (void) mod; + + grub_register_command ("hdparm", grub_cmd_hdparm, GRUB_COMMAND_FLAG_BOTH, + "hdparm [OPTIONS] DISK", + "Get/set ATA disk parameters.", options); +} + +GRUB_MOD_FINI(hdparm) +{ + grub_unregister_command ("hdparm"); +} diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 638334446..ee7dad8f1 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -979,7 +979,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ - datehook.mod lsmmap.mod \ + datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod # For biosdisk.mod. @@ -3415,5 +3415,138 @@ partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DE lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For ata_pthru.mod. +ata_pthru_mod_SOURCES = disk/ata_pthru.c +CLEANFILES += ata_pthru.mod mod-ata_pthru.o mod-ata_pthru.c pre-ata_pthru.o ata_pthru_mod-disk_ata_pthru.o und-ata_pthru.lst +ifneq ($(ata_pthru_mod_EXPORTS),no) +CLEANFILES += def-ata_pthru.lst +DEFSYMFILES += def-ata_pthru.lst +endif +MOSTLYCLEANFILES += ata_pthru_mod-disk_ata_pthru.d +UNDSYMFILES += und-ata_pthru.lst + +ata_pthru.mod: pre-ata_pthru.o mod-ata_pthru.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(ata_pthru_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ata_pthru.o mod-ata_pthru.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-ata_pthru.o: $(ata_pthru_mod_DEPENDENCIES) ata_pthru_mod-disk_ata_pthru.o + -rm -f $@ + $(TARGET_CC) $(ata_pthru_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ata_pthru_mod-disk_ata_pthru.o + +mod-ata_pthru.o: mod-ata_pthru.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -c -o $@ $< + +mod-ata_pthru.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'ata_pthru' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(ata_pthru_mod_EXPORTS),no) +def-ata_pthru.lst: pre-ata_pthru.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ata_pthru/' > $@ +endif + +und-ata_pthru.lst: pre-ata_pthru.o + echo 'ata_pthru' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +ata_pthru_mod-disk_ata_pthru.o: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) + $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -MD -c -o $@ $< +-include ata_pthru_mod-disk_ata_pthru.d + +CLEANFILES += cmd-ata_pthru_mod-disk_ata_pthru.lst fs-ata_pthru_mod-disk_ata_pthru.lst partmap-ata_pthru_mod-disk_ata_pthru.lst +COMMANDFILES += cmd-ata_pthru_mod-disk_ata_pthru.lst +FSFILES += fs-ata_pthru_mod-disk_ata_pthru.lst +PARTMAPFILES += partmap-ata_pthru_mod-disk_ata_pthru.lst + +cmd-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata_pthru > $@ || (rm -f $@; exit 1) + +fs-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata_pthru > $@ || (rm -f $@; exit 1) + +partmap-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata_pthru > $@ || (rm -f $@; exit 1) + + +ata_pthru_mod_CFLAGS = $(COMMON_CFLAGS) +ata_pthru_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For hdparm.mod. +hdparm_mod_SOURCES = commands/hdparm.c lib/hexdump.c +CLEANFILES += hdparm.mod mod-hdparm.o mod-hdparm.c pre-hdparm.o hdparm_mod-commands_hdparm.o hdparm_mod-lib_hexdump.o und-hdparm.lst +ifneq ($(hdparm_mod_EXPORTS),no) +CLEANFILES += def-hdparm.lst +DEFSYMFILES += def-hdparm.lst +endif +MOSTLYCLEANFILES += hdparm_mod-commands_hdparm.d hdparm_mod-lib_hexdump.d +UNDSYMFILES += und-hdparm.lst + +hdparm.mod: pre-hdparm.o mod-hdparm.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(hdparm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hdparm.o mod-hdparm.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-hdparm.o: $(hdparm_mod_DEPENDENCIES) hdparm_mod-commands_hdparm.o hdparm_mod-lib_hexdump.o + -rm -f $@ + $(TARGET_CC) $(hdparm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hdparm_mod-commands_hdparm.o hdparm_mod-lib_hexdump.o + +mod-hdparm.o: mod-hdparm.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -c -o $@ $< + +mod-hdparm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'hdparm' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(hdparm_mod_EXPORTS),no) +def-hdparm.lst: pre-hdparm.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hdparm/' > $@ +endif + +und-hdparm.lst: pre-hdparm.o + echo 'hdparm' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +hdparm_mod-commands_hdparm.o: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -MD -c -o $@ $< +-include hdparm_mod-commands_hdparm.d + +CLEANFILES += cmd-hdparm_mod-commands_hdparm.lst fs-hdparm_mod-commands_hdparm.lst partmap-hdparm_mod-commands_hdparm.lst +COMMANDFILES += cmd-hdparm_mod-commands_hdparm.lst +FSFILES += fs-hdparm_mod-commands_hdparm.lst +PARTMAPFILES += partmap-hdparm_mod-commands_hdparm.lst + +cmd-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) + +fs-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) + +partmap-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) + + +hdparm_mod-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -MD -c -o $@ $< +-include hdparm_mod-lib_hexdump.d + +CLEANFILES += cmd-hdparm_mod-lib_hexdump.lst fs-hdparm_mod-lib_hexdump.lst partmap-hdparm_mod-lib_hexdump.lst +COMMANDFILES += cmd-hdparm_mod-lib_hexdump.lst +FSFILES += fs-hdparm_mod-lib_hexdump.lst +PARTMAPFILES += partmap-hdparm_mod-lib_hexdump.lst + +cmd-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) + +fs-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) + +partmap-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) + + +hdparm_mod_CFLAGS = $(COMMON_CFLAGS) +hdparm_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 3ef351e34..b8f1c6d8a 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -172,7 +172,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ - datehook.mod lsmmap.mod \ + datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod # For biosdisk.mod. @@ -365,5 +365,15 @@ lsmmap_mod_SOURCES = commands/lsmmap.c lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For ata_pthru.mod. +ata_pthru_mod_SOURCES = disk/ata_pthru.c +ata_pthru_mod_CFLAGS = $(COMMON_CFLAGS) +ata_pthru_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For hdparm.mod. +hdparm_mod_SOURCES = commands/hdparm.c lib/hexdump.c +hdparm_mod_CFLAGS = $(COMMON_CFLAGS) +hdparm_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/disk/ata.c b/disk/ata.c index e981fe926..ed98b0b87 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -1,7 +1,7 @@ /* ata.c - ATA disk access. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007, 2008 Free Software Foundation, Inc. + * Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,143 +17,22 @@ * along with GRUB. If not, see . */ +#include #include -#include #include #include #include #include #include -/* XXX: For now this only works on i386. */ -#include - -typedef enum - { - GRUB_ATA_CHS, - GRUB_ATA_LBA, - GRUB_ATA_LBA48 - } grub_ata_addressing_t; /* At the moment, only two IDE ports are supported. */ static const int grub_ata_ioaddress[] = { 0x1f0, 0x170 }; static const int grub_ata_ioaddress2[] = { 0x3f6, 0x376 }; -#define GRUB_CDROM_SECTOR_SIZE 2048 - -#define GRUB_ATA_REG_DATA 0 -#define GRUB_ATA_REG_ERROR 1 -#define GRUB_ATA_REG_FEATURES 1 -#define GRUB_ATA_REG_SECTORS 2 -#define GRUB_ATAPI_REG_IREASON 2 -#define GRUB_ATA_REG_SECTNUM 3 -#define GRUB_ATA_REG_CYLLSB 4 -#define GRUB_ATA_REG_CYLMSB 5 -#define GRUB_ATA_REG_LBALOW 3 -#define GRUB_ATA_REG_LBAMID 4 -#define GRUB_ATAPI_REG_CNTLOW 4 -#define GRUB_ATA_REG_LBAHIGH 5 -#define GRUB_ATAPI_REG_CNTHIGH 5 -#define GRUB_ATA_REG_DISK 6 -#define GRUB_ATA_REG_CMD 7 -#define GRUB_ATA_REG_STATUS 7 - -#define GRUB_ATA_REG2_CONTROL 0 - -#define GRUB_ATA_STATUS_ERR 0x01 -#define GRUB_ATA_STATUS_INDEX 0x02 -#define GRUB_ATA_STATUS_ECC 0x04 -#define GRUB_ATA_STATUS_DRQ 0x08 -#define GRUB_ATA_STATUS_SEEK 0x10 -#define GRUB_ATA_STATUS_WRERR 0x20 -#define GRUB_ATA_STATUS_READY 0x40 -#define GRUB_ATA_STATUS_BUSY 0x80 - -/* ATAPI interrupt reason values (I/O, D/C bits). */ -#define GRUB_ATAPI_IREASON_MASK 0x3 -#define GRUB_ATAPI_IREASON_DATA_OUT 0x0 -#define GRUB_ATAPI_IREASON_CMD_OUT 0x1 -#define GRUB_ATAPI_IREASON_DATA_IN 0x2 -#define GRUB_ATAPI_IREASON_ERROR 0x3 - -enum grub_ata_commands - { - GRUB_ATA_CMD_READ_SECTORS = 0x20, - GRUB_ATA_CMD_READ_SECTORS_EXT = 0x24, - GRUB_ATA_CMD_WRITE_SECTORS = 0x30, - GRUB_ATA_CMD_WRITE_SECTORS_EXT = 0x34, - GRUB_ATA_CMD_IDENTIFY_DEVICE = 0xEC, - GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE = 0xA1, - GRUB_ATA_CMD_PACKET = 0xA0, - }; - -enum grub_ata_timeout_milliseconds - { - GRUB_ATA_TOUT_STD = 1000, /* 1s standard timeout. */ - GRUB_ATA_TOUT_DATA = 10000 /* 10s DATA I/O timeout. */ - }; - -struct grub_ata_device -{ - /* IDE port to use. */ - int port; - - /* IO addresses on which the registers for this device can be - found. */ - int ioaddress; - int ioaddress2; - - /* Two devices can be connected to a single cable. Use this field - to select device 0 (commonly known as "master") or device 1 - (commonly known as "slave"). */ - int device; - - /* Addressing methods available for accessing this device. If CHS - is only available, use that. Otherwise use LBA, except for the - high sectors. In that case use LBA48. */ - grub_ata_addressing_t addr; - - /* Sector count. */ - grub_uint64_t size; - - /* CHS maximums. */ - grub_uint16_t cylinders; - grub_uint16_t heads; - grub_uint16_t sectors_per_track; - - /* Set to 0 for ATA, set to 1 for ATAPI. */ - int atapi; - - struct grub_ata_device *next; -}; - static struct grub_ata_device *grub_ata_devices; -static inline void -grub_ata_regset (struct grub_ata_device *dev, int reg, int val) -{ - grub_outb (val, dev->ioaddress + reg); -} - -static inline grub_uint8_t -grub_ata_regget (struct grub_ata_device *dev, int reg) -{ - return grub_inb (dev->ioaddress + reg); -} - -static inline void -grub_ata_regset2 (struct grub_ata_device *dev, int reg, int val) -{ - grub_outb (val, dev->ioaddress2 + reg); -} - -static inline grub_uint8_t -grub_ata_regget2 (struct grub_ata_device *dev, int reg) -{ - return grub_inb (dev->ioaddress2 + reg); -} - /* Wait for !BSY. */ -static grub_err_t +grub_err_t grub_ata_wait_not_busy (struct grub_ata_device *dev, int milliseconds) { /* ATA requires 400ns (after a write to CMD register) or @@ -183,18 +62,8 @@ grub_ata_wait (void) grub_millisleep (50); } -/* Check for !BSY before issuing a new command. */ -static inline grub_err_t -grub_ata_check_ready (struct grub_ata_device *dev) -{ - if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY) - return grub_ata_wait_not_busy (dev, GRUB_ATA_TOUT_STD); - - return GRUB_ERR_NONE; -} - /* Wait for !BSY, DRQ. */ -static grub_err_t +grub_err_t grub_ata_wait_drq (struct grub_ata_device *dev, int rw, int milliseconds) { @@ -230,7 +99,7 @@ grub_ata_strncpy (char *dst, char *src, grub_size_t len) dst[len] = '\0'; } -static void +void grub_ata_pio_read (struct grub_ata_device *dev, char *buf, grub_size_t size) { grub_uint16_t *buf16 = (grub_uint16_t *) buf; diff --git a/disk/ata_pthru.c b/disk/ata_pthru.c new file mode 100644 index 000000000..cc74eb41b --- /dev/null +++ b/disk/ata_pthru.c @@ -0,0 +1,109 @@ +/* ata_pthru.c - ATA pass through for ata.mod. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + + +/* ATA pass through support, used by hdparm.mod. */ +static grub_err_t +grub_ata_pass_through (grub_disk_t disk, + struct grub_disk_ata_pass_through_parms *parms) +{ + if (disk->dev->id != GRUB_DISK_DEVICE_ATA_ID) + return grub_error (GRUB_ERR_BAD_DEVICE, + "Device not accessed via ata.mod"); + + struct grub_ata_device *dev = (struct grub_ata_device *) disk->data; + + if (! (parms->size == 0 || parms->size == GRUB_DISK_SECTOR_SIZE)) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "ATA multi-sector read and DATA OUT not implemented"); + + grub_dprintf ("ata", "ata_pass_through: cmd=0x%x, features=0x%x, sectors=0x%x\n", + parms->taskfile[GRUB_ATA_REG_CMD], + parms->taskfile[GRUB_ATA_REG_FEATURES], + parms->taskfile[GRUB_ATA_REG_SECTORS]); + grub_dprintf ("ata", "lba_high=0x%x, lba_mid=0x%x, lba_low=0x%x, size=%d\n", + parms->taskfile[GRUB_ATA_REG_LBAHIGH], + parms->taskfile[GRUB_ATA_REG_LBAMID], + parms->taskfile[GRUB_ATA_REG_LBALOW], parms->size); + + /* Set registers. */ + grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4 + | (parms->taskfile[GRUB_ATA_REG_DISK] & 0xf)); + if (grub_ata_check_ready (dev)) + return grub_errno; + + int i; + for (i = GRUB_ATA_REG_FEATURES; i <= GRUB_ATA_REG_LBAHIGH; i++) + grub_ata_regset (dev, i, parms->taskfile[i]); + + /* Start command. */ + grub_ata_regset (dev, GRUB_ATA_REG_CMD, parms->taskfile[GRUB_ATA_REG_CMD]); + + /* Wait for !BSY. */ + if (grub_ata_wait_not_busy (dev, GRUB_ATA_TOUT_DATA)) + return grub_errno; + + /* Check status. */ + grub_int8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + grub_dprintf ("ata", "status=0x%x\n", sts); + + /* Transfer data. */ + if ((sts & (GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) == GRUB_ATA_STATUS_DRQ) + { + if (parms->size != GRUB_DISK_SECTOR_SIZE) + return grub_error (GRUB_ERR_READ_ERROR, "DRQ unexpected"); + grub_ata_pio_read (dev, parms->buffer, GRUB_DISK_SECTOR_SIZE); + } + + /* Return registers. */ + for (i = GRUB_ATA_REG_ERROR; i <= GRUB_ATA_REG_STATUS; i++) + parms->taskfile[i] = grub_ata_regget (dev, i); + + grub_dprintf ("ata", "status=0x%x, error=0x%x, sectors=0x%x\n", + parms->taskfile[GRUB_ATA_REG_STATUS], + parms->taskfile[GRUB_ATA_REG_ERROR], + parms->taskfile[GRUB_ATA_REG_SECTORS]); + + if (parms->taskfile[GRUB_ATA_REG_STATUS] + & (GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) + return grub_error (GRUB_ERR_READ_ERROR, "ATA passthrough failed"); + + return GRUB_ERR_NONE; +} + + + +GRUB_MOD_INIT(ata_pthru) +{ + (void) mod; + + /* Register ATA pass through function. */ + grub_disk_ata_pass_through = grub_ata_pass_through; +} + +GRUB_MOD_FINI(ata_pthru) +{ + if (grub_disk_ata_pass_through == grub_ata_pass_through) + grub_disk_ata_pass_through = NULL; +} diff --git a/include/grub/ata.h b/include/grub/ata.h new file mode 100644 index 000000000..aaa2e147a --- /dev/null +++ b/include/grub/ata.h @@ -0,0 +1,168 @@ +/* ata.h - ATA disk access. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007, 2008, 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_ATA_HEADER +#define GRUB_ATA_HEADER 1 + +#include +#include +/* XXX: For now this only works on i386. */ +#include + +typedef enum + { + GRUB_ATA_CHS, + GRUB_ATA_LBA, + GRUB_ATA_LBA48 + } grub_ata_addressing_t; + +#define GRUB_ATA_REG_DATA 0 +#define GRUB_ATA_REG_ERROR 1 +#define GRUB_ATA_REG_FEATURES 1 +#define GRUB_ATA_REG_SECTORS 2 +#define GRUB_ATAPI_REG_IREASON 2 +#define GRUB_ATA_REG_SECTNUM 3 +#define GRUB_ATA_REG_CYLLSB 4 +#define GRUB_ATA_REG_CYLMSB 5 +#define GRUB_ATA_REG_LBALOW 3 +#define GRUB_ATA_REG_LBAMID 4 +#define GRUB_ATAPI_REG_CNTLOW 4 +#define GRUB_ATA_REG_LBAHIGH 5 +#define GRUB_ATAPI_REG_CNTHIGH 5 +#define GRUB_ATA_REG_DISK 6 +#define GRUB_ATA_REG_CMD 7 +#define GRUB_ATA_REG_STATUS 7 + +#define GRUB_ATA_REG2_CONTROL 0 + +#define GRUB_ATA_STATUS_ERR 0x01 +#define GRUB_ATA_STATUS_INDEX 0x02 +#define GRUB_ATA_STATUS_ECC 0x04 +#define GRUB_ATA_STATUS_DRQ 0x08 +#define GRUB_ATA_STATUS_SEEK 0x10 +#define GRUB_ATA_STATUS_WRERR 0x20 +#define GRUB_ATA_STATUS_READY 0x40 +#define GRUB_ATA_STATUS_BUSY 0x80 + +/* ATAPI interrupt reason values (I/O, D/C bits). */ +#define GRUB_ATAPI_IREASON_MASK 0x3 +#define GRUB_ATAPI_IREASON_DATA_OUT 0x0 +#define GRUB_ATAPI_IREASON_CMD_OUT 0x1 +#define GRUB_ATAPI_IREASON_DATA_IN 0x2 +#define GRUB_ATAPI_IREASON_ERROR 0x3 + +enum grub_ata_commands + { + GRUB_ATA_CMD_CHECK_POWER_MODE = 0xe5, + GRUB_ATA_CMD_IDENTIFY_DEVICE = 0xec, + GRUB_ATA_CMD_IDENTIFY_PACKET_DEVICE = 0xa1, + GRUB_ATA_CMD_IDLE = 0xe3, + GRUB_ATA_CMD_PACKET = 0xa0, + GRUB_ATA_CMD_READ_SECTORS = 0x20, + GRUB_ATA_CMD_READ_SECTORS_EXT = 0x24, + GRUB_ATA_CMD_SECURITY_FREEZE_LOCK = 0xf5, + GRUB_ATA_CMD_SET_FEATURES = 0xef, + GRUB_ATA_CMD_SLEEP = 0xe6, + GRUB_ATA_CMD_SMART = 0xb0, + GRUB_ATA_CMD_STANDBY_IMMEDIATE = 0xe0, + GRUB_ATA_CMD_WRITE_SECTORS = 0x30, + GRUB_ATA_CMD_WRITE_SECTORS_EXT = 0x34, + }; + +enum grub_ata_timeout_milliseconds + { + GRUB_ATA_TOUT_STD = 1000, /* 1s standard timeout. */ + GRUB_ATA_TOUT_DATA = 10000 /* 10s DATA I/O timeout. */ + }; + +struct grub_ata_device +{ + /* IDE port to use. */ + int port; + + /* IO addresses on which the registers for this device can be + found. */ + int ioaddress; + int ioaddress2; + + /* Two devices can be connected to a single cable. Use this field + to select device 0 (commonly known as "master") or device 1 + (commonly known as "slave"). */ + int device; + + /* Addressing methods available for accessing this device. If CHS + is only available, use that. Otherwise use LBA, except for the + high sectors. In that case use LBA48. */ + grub_ata_addressing_t addr; + + /* Sector count. */ + grub_uint64_t size; + + /* CHS maximums. */ + grub_uint16_t cylinders; + grub_uint16_t heads; + grub_uint16_t sectors_per_track; + + /* Set to 0 for ATA, set to 1 for ATAPI. */ + int atapi; + + struct grub_ata_device *next; +}; + +grub_err_t EXPORT_FUNC(grub_ata_wait_not_busy) (struct grub_ata_device *dev, + int milliseconds); +grub_err_t EXPORT_FUNC(grub_ata_wait_drq) (struct grub_ata_device *dev, + int rw, int milliseconds); +void EXPORT_FUNC(grub_ata_pio_read) (struct grub_ata_device *dev, + char *buf, grub_size_t size); + +static inline void +grub_ata_regset (struct grub_ata_device *dev, int reg, int val) +{ + grub_outb (val, dev->ioaddress + reg); +} + +static inline grub_uint8_t +grub_ata_regget (struct grub_ata_device *dev, int reg) +{ + return grub_inb (dev->ioaddress + reg); +} + +static inline void +grub_ata_regset2 (struct grub_ata_device *dev, int reg, int val) +{ + grub_outb (val, dev->ioaddress2 + reg); +} + +static inline grub_uint8_t +grub_ata_regget2 (struct grub_ata_device *dev, int reg) +{ + return grub_inb (dev->ioaddress2 + reg); +} + +static inline grub_err_t +grub_ata_check_ready (struct grub_ata_device *dev) +{ + if (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY) + return grub_ata_wait_not_busy (dev, GRUB_ATA_TOUT_STD); + + return GRUB_ERR_NONE; +} + +#endif /* ! GRUB_ATA_HEADER */ diff --git a/include/grub/disk.h b/include/grub/disk.h index f2fa421a5..1e8046a1d 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -161,6 +161,17 @@ grub_uint64_t EXPORT_FUNC(grub_disk_get_size) (grub_disk_t disk); extern void (* EXPORT_VAR(grub_disk_firmware_fini)) (void); extern int EXPORT_VAR(grub_disk_firmware_is_tainted); +/* ATA pass through parameters and function. */ +struct grub_disk_ata_pass_through_parms +{ + grub_uint8_t taskfile[8]; + void * buffer; + int size; +}; + +extern grub_err_t (* EXPORT_VAR(grub_disk_ata_pass_through)) (grub_disk_t, + struct grub_disk_ata_pass_through_parms *); + #ifdef GRUB_UTIL void grub_raid_init (void); void grub_raid_fini (void); diff --git a/kern/disk.c b/kern/disk.c index ed82506fd..3f7e45110 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -46,6 +46,10 @@ static struct grub_disk_cache grub_disk_cache_table[GRUB_DISK_CACHE_NUM]; void (*grub_disk_firmware_fini) (void); int grub_disk_firmware_is_tainted; +grub_err_t (* grub_disk_ata_pass_through) (grub_disk_t, + struct grub_ata_pass_through_cmd *); + + #if 0 static unsigned long grub_disk_cache_hits; static unsigned long grub_disk_cache_misses; From 265372ca7417e4099c72e355d488aa7c4e5fffb6 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 14 Feb 2009 14:38:50 +0000 Subject: [PATCH 0533/1707] 2009-02-14 Felix Zielcke * fs/fat.c: Add 2009 to Copyright line. --- ChangeLog | 4 ++++ fs/fat.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3e09cb823..7382a4e7a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-14 Felix Zielcke + + * fs/fat.c: Add 2009 to Copyright line. + 2009-02-14 Christian Franke * commands/hdparm.c: New file. Provides `hdparm' command diff --git a/fs/fat.c b/fs/fat.c index 36278b092..acaa0274b 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -1,7 +1,7 @@ /* fat.c - FAT filesystem */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 6aa1169b6dbedb93710611c2633348e0e74903a5 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Sat, 14 Feb 2009 16:02:12 +0000 Subject: [PATCH 0534/1707] 2009-02-14 Christian Franke * gendistlist.sh: Ignore `.svn' directories. --- ChangeLog | 4 ++++ gendistlist.sh | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7382a4e7a..893b64695 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-02-14 Christian Franke + + * gendistlist.sh: Ignore `.svn' directories. + 2009-02-14 Felix Zielcke * fs/fat.c: Add 2009 to Copyright line. diff --git a/gendistlist.sh b/gendistlist.sh index 286329ab2..011554ddf 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -1,6 +1,6 @@ #! /bin/sh # -# Copyright (C) 2005, 2008 Free Software Foundation, Inc. +# Copyright (C) 2005, 2008, 2009 Free Software Foundation, Inc. # # This gendistlist.sh is free software; the author # gives unlimited permission to copy and/or distribute it, @@ -34,7 +34,7 @@ dir=`dirname $0` cd $dir for dir in $DISTDIRS; do - for d in `find $dir -type d | sort`; do + for d in `find $dir -type d | sed '/\/\.svn$/d;\/\.svn\//d' | sort`; do find $d -maxdepth 1 -name '*.[chSy]' -o -name '*.mk' -o -name '*.rmk' \ -o -name '*.rb' -o -name '*.in' -o -name '*.tex' -o -name '*.texi' \ -o -name 'grub.cfg' -o -name 'README' -o -name '*.sc' -o -name 'mdate.sh' \ From 353976ac0ecec0c010efd876e4098d53ee3bf193 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Sat, 14 Feb 2009 17:26:35 +0000 Subject: [PATCH 0535/1707] 2009-02-14 Christian Franke * commands/lspci.c (grub_pci_classes): Add `SATA Controller'. (grub_lspci_iter): Print class code and programming interface byte. --- ChangeLog | 5 +++++ commands/lspci.c | 13 ++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 893b64695..90d9dfee6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-14 Christian Franke + + * commands/lspci.c (grub_pci_classes): Add `SATA Controller'. + (grub_lspci_iter): Print class code and programming interface byte. + 2009-02-14 Christian Franke * gendistlist.sh: Ignore `.svn' directories. diff --git a/commands/lspci.c b/commands/lspci.c index 0f52cf5df..979180056 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -1,7 +1,7 @@ /* lspci.c - List PCI devices. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,6 +37,7 @@ static const struct grub_pci_classname grub_pci_classes[] = { 1, 2, "Floppy Controller" }, { 1, 3, "IPI Controller" }, { 1, 4, "RAID Controller" }, + { 1, 6, "SATA Controller" }, { 1, 0x80, "Mass storage Controller" }, { 2, 0, "Ethernet Controller" }, { 2, 1, "Token Ring Controller" }, @@ -124,7 +125,7 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) pciid >> 16); addr = grub_pci_make_address (bus, dev, func, 2); class = grub_pci_read (addr); - + /* Lookup the class name, if there isn't a specific one, retry with 0x80 to get the generic class name. */ sclass = grub_pci_get_class (class >> 24, (class >> 16) & 0xFF); @@ -133,7 +134,13 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) if (! sclass) sclass = ""; - grub_printf (" %s\n", sclass); + grub_printf (" [%04x] %s", (class >> 16) & 0xffff, sclass); + + grub_uint8_t pi = (class >> 8) & 0xff; + if (pi) + grub_printf (" [PI %02x]", pi); + + grub_printf ("\n"); return 0; } From 8fa4ea7017053cfe86d77acf54ba2cf13662c655 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Sat, 14 Feb 2009 19:24:31 +0000 Subject: [PATCH 0536/1707] 2009-02-14 Vladimir Serbinenko Corrected wrong declaration * kern/disk.c: corrected declaration of grub_disk_ata_pass_through. --- ChangeLog | 6 ++++++ kern/disk.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 90d9dfee6..0686af0a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-02-14 Vladimir Serbinenko + + Corrected wrong declaration + + * kern/disk.c: corrected declaration of grub_disk_ata_pass_through. + 2009-02-14 Christian Franke * commands/lspci.c (grub_pci_classes): Add `SATA Controller'. diff --git a/kern/disk.c b/kern/disk.c index 3f7e45110..4ee03e0d9 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -47,7 +47,7 @@ void (*grub_disk_firmware_fini) (void); int grub_disk_firmware_is_tainted; grub_err_t (* grub_disk_ata_pass_through) (grub_disk_t, - struct grub_ata_pass_through_cmd *); + struct grub_disk_ata_pass_through_parms *); #if 0 From 6374daf38764fcac1e05d047ec4f0c320871e166 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 21 Feb 2009 14:55:06 +0000 Subject: [PATCH 0537/1707] 2009-02-21 Robert Millan Implement USB keyboard support (based on patch by Marco Gerards) * conf/i386-pc.rmk (pkglib_MODULES): Add `usb_keyboard.mod'. (usb_keyboard_mod_SOURCES, usb_keyboard_mod_CFLAGS) (usb_keyboard_mod_LDFLAGS): New variables. * term/usb_keyboard.c: New file. --- ChangeLog | 10 ++ DISTLIST | 1 + conf/i386-pc.mk | 59 +++++++++- conf/i386-pc.rmk | 7 +- term/usb_keyboard.c | 257 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 332 insertions(+), 2 deletions(-) create mode 100644 term/usb_keyboard.c diff --git a/ChangeLog b/ChangeLog index 0686af0a2..0ec24e970 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-02-21 Robert Millan + + Implement USB keyboard support (based on patch by Marco Gerards) + + * conf/i386-pc.rmk (pkglib_MODULES): Add `usb_keyboard.mod'. + (usb_keyboard_mod_SOURCES, usb_keyboard_mod_CFLAGS) + (usb_keyboard_mod_LDFLAGS): New variables. + + * term/usb_keyboard.c: New file. + 2009-02-14 Vladimir Serbinenko Corrected wrong declaration diff --git a/DISTLIST b/DISTLIST index 63cff3dd6..a92f73323 100644 --- a/DISTLIST +++ b/DISTLIST @@ -425,6 +425,7 @@ partmap/sun.c term/gfxterm.c term/terminfo.c term/tparm.c +term/usb_keyboard.c term/efi/console.c term/i386/vga_common.c term/i386/pc/at_keyboard.c diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index ee7dad8f1..72e0957e5 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -980,7 +980,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ - usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod + usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -3054,6 +3054,63 @@ partmap-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) genp usbms_mod_CFLAGS = $(COMMON_CFLAGS) usbms_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For usb_keyboard.mod +usb_keyboard_mod_SOURCES = term/usb_keyboard.c +CLEANFILES += usb_keyboard.mod mod-usb_keyboard.o mod-usb_keyboard.c pre-usb_keyboard.o usb_keyboard_mod-term_usb_keyboard.o und-usb_keyboard.lst +ifneq ($(usb_keyboard_mod_EXPORTS),no) +CLEANFILES += def-usb_keyboard.lst +DEFSYMFILES += def-usb_keyboard.lst +endif +MOSTLYCLEANFILES += usb_keyboard_mod-term_usb_keyboard.d +UNDSYMFILES += und-usb_keyboard.lst + +usb_keyboard.mod: pre-usb_keyboard.o mod-usb_keyboard.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(usb_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usb_keyboard.o mod-usb_keyboard.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-usb_keyboard.o: $(usb_keyboard_mod_DEPENDENCIES) usb_keyboard_mod-term_usb_keyboard.o + -rm -f $@ + $(TARGET_CC) $(usb_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usb_keyboard_mod-term_usb_keyboard.o + +mod-usb_keyboard.o: mod-usb_keyboard.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -c -o $@ $< + +mod-usb_keyboard.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'usb_keyboard' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(usb_keyboard_mod_EXPORTS),no) +def-usb_keyboard.lst: pre-usb_keyboard.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usb_keyboard/' > $@ +endif + +und-usb_keyboard.lst: pre-usb_keyboard.o + echo 'usb_keyboard' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +usb_keyboard_mod-term_usb_keyboard.o: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) + $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -MD -c -o $@ $< +-include usb_keyboard_mod-term_usb_keyboard.d + +CLEANFILES += cmd-usb_keyboard_mod-term_usb_keyboard.lst fs-usb_keyboard_mod-term_usb_keyboard.lst partmap-usb_keyboard_mod-term_usb_keyboard.lst +COMMANDFILES += cmd-usb_keyboard_mod-term_usb_keyboard.lst +FSFILES += fs-usb_keyboard_mod-term_usb_keyboard.lst +PARTMAPFILES += partmap-usb_keyboard_mod-term_usb_keyboard.lst + +cmd-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb_keyboard > $@ || (rm -f $@; exit 1) + +fs-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb_keyboard > $@ || (rm -f $@; exit 1) + +partmap-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb_keyboard > $@ || (rm -f $@; exit 1) + + +usb_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) +usb_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For pxe.mod pxe_mod_SOURCES = fs/i386/pc/pxe.c CLEANFILES += pxe.mod mod-pxe.o mod-pxe.c pre-pxe.o pxe_mod-fs_i386_pc_pxe.o und-pxe.lst diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index b8f1c6d8a..fd66ce9fc 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -173,7 +173,7 @@ pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ - usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod + usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c @@ -335,6 +335,11 @@ usbms_mod_SOURCES = disk/usbms.c usbms_mod_CFLAGS = $(COMMON_CFLAGS) usbms_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For usb_keyboard.mod +usb_keyboard_mod_SOURCES = term/usb_keyboard.c +usb_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) +usb_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For pxe.mod pxe_mod_SOURCES = fs/i386/pc/pxe.c pxe_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c new file mode 100644 index 000000000..07f7d08b4 --- /dev/null +++ b/term/usb_keyboard.c @@ -0,0 +1,257 @@ +/* Support for the HID Boot Protocol. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008, 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +static char keyboard_map[128] = + { + '\0', '\0', '\0', '\0', 'a', 'b', 'c', 'd', + 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', + 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', + 'u', 'v', 'w', 'x', 'y', 'z', '1', '2', + '3', '4', '5', '6', '7', '8', '9', '0', + '\n', GRUB_TERM_ESC, GRUB_TERM_BACKSPACE, GRUB_TERM_TAB, ' ', '-', '=', '[', + ']', '\\', '#', ';', '\'', '`', ',', '.', + '/', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', '\0', '\0', '\0', '\0', '\0', '\0', + '\0', '\0', GRUB_TERM_HOME, GRUB_TERM_PPAGE, GRUB_TERM_DC, GRUB_TERM_END, GRUB_TERM_NPAGE, GRUB_TERM_RIGHT, + GRUB_TERM_LEFT, GRUB_TERM_DOWN, GRUB_TERM_UP + }; + +static char keyboard_map_shift[128] = + { + '\0', '\0', '\0', '\0', 'A', 'B', 'C', 'D', + 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', + 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', + 'U', 'V', 'W', 'X', 'Y', 'Z', '!', '@', + '#', '$', '%', '^', '&', '*', '(', ')', + '\n', '\0', '\0', '\0', ' ', '_', '+', '{', + '}', '|', '#', ':', '"', '`', '<', '>', + '?' + }; + +static grub_usb_device_t usbdev; + +static void +grub_usb_hid (void) +{ + struct grub_usb_desc_device *descdev; + + auto int usb_iterate (grub_usb_device_t dev); + int usb_iterate (grub_usb_device_t dev) + { + descdev = &dev->descdev; + + grub_dprintf ("usb_keyboard", "%x %x %x\n", + descdev->class, descdev->subclass, descdev->protocol); + +#if 0 + if (descdev->class != 0x09 + || descdev->subclass == 0x01 + || descdev->protocol != 0x02) + return 0; +#endif + + if (descdev->class != 0 || descdev->subclass != 0 || descdev->protocol != 0) + return 0; + + grub_printf ("HID found!\n"); + + usbdev = dev; + + return 1; + } + grub_usb_iterate (usb_iterate); + + /* Place the device in boot mode. */ + grub_usb_control_msg (usbdev, 0x21, 0x0B, 0, 0, 0, 0); + + /* Reports everytime an event occurs and not more often than that. */ + grub_usb_control_msg (usbdev, 0x21, 0x0A, 0<<8, 0, 0, 0); +} + +static grub_err_t +grub_usb_keyboard_getreport (grub_usb_device_t dev, unsigned char *report) +{ + return grub_usb_control_msg (dev, (1 << 7) | (1 << 5) | 1, 0x01, 0, 0, + 8, (char *) report); +} + + + +static int +grub_usb_keyboard_checkkey (void) +{ + unsigned char data[8]; + int key; + int i; + grub_err_t err; + + data[2] = 0; + for (i = 0; i < 50; i++) + { + /* Get_Report. */ + err = grub_usb_keyboard_getreport (usbdev, data); + + if (! err && data[2]) + break; + } + + if (err || !data[2]) + return -1; + + grub_dprintf ("usb_keyboard", + "report: 0x%02x 0x%02x 0x%02x 0x%02x" + " 0x%02x 0x%02x 0x%02x 0x%02x\n", + data[0], data[1], data[2], data[3], + data[4], data[5], data[6], data[7]); + + /* Check if the Control or Shift key was pressed. */ + if (data[0] & 0x01 || data[0] & 0x10) + key = keyboard_map[data[2]] - 'a' + 1; + else if (data[0] & 0x02 || data[0] & 0x20) + key = keyboard_map_shift[data[2]]; + else + key = keyboard_map[data[2]]; + + if (key == 0) + grub_printf ("Unknown key 0x%x detected\n", data[2]); + +#if 0 + /* Wait until the key is released. */ + while (!err && data[2]) + { + err = grub_usb_control_msg (usbdev, (1 << 7) | (1 << 5) | 1, 0x01, 0, 0, + sizeof (data), (char *) data); + grub_dprintf ("usb_keyboard", + "report2: 0x%02x 0x%02x 0x%02x 0x%02x" + " 0x%02x 0x%02x 0x%02x 0x%02x\n", + data[0], data[1], data[2], data[3], + data[4], data[5], data[6], data[7]); + } +#endif + + grub_errno = GRUB_ERR_NONE; + + return key; +} + +typedef enum +{ + GRUB_HIDBOOT_REPEAT_NONE, + GRUB_HIDBOOT_REPEAT_FIRST, + GRUB_HIDBOOT_REPEAT +} grub_usb_keyboard_repeat_t; + +static int +grub_usb_keyboard_getkey (void) +{ + int key; + int key_release; + grub_err_t err; + unsigned char data[8]; + grub_uint64_t currtime; + int timeout; + static grub_usb_keyboard_repeat_t repeat = GRUB_HIDBOOT_REPEAT_NONE; + + again: + + do + { + key = grub_usb_keyboard_checkkey (); + } while (key == -1); + + data[2] = !0; /* Or whatever. */ + err = 0; + + switch (repeat) + { + case GRUB_HIDBOOT_REPEAT_NONE: + timeout = 100; + break; + case GRUB_HIDBOOT_REPEAT_FIRST: + timeout = 500; + break; + case GRUB_HIDBOOT_REPEAT: + timeout = 50; + break; + } + + /* Wait until the key is released. */ + currtime = grub_get_time_ms (); + while (!err && data[2]) + { + /* Implement a timeout. */ + if (grub_get_time_ms () > currtime + timeout) + { + if (repeat == 0) + repeat = 1; + else + repeat = 2; + + grub_errno = GRUB_ERR_NONE; + return key; + } + + err = grub_usb_keyboard_getreport (usbdev, data); + } + + if (repeat) + { + repeat = 0; + goto again; + } + + repeat = 0; + + grub_errno = GRUB_ERR_NONE; + + return key; +} + +static struct grub_term_input grub_usb_keyboard_term = + { + .name = "usb_keyboard", + .checkkey = grub_usb_keyboard_checkkey, + .getkey = grub_usb_keyboard_getkey, + .next = 0 + }; + +GRUB_MOD_INIT(usb_keyboard) +{ + (void) mod; /* To stop warning. */ + + grub_usb_hid (); + grub_term_register_input (&grub_usb_keyboard_term); +} + +GRUB_MOD_FINI(usb_keyboard) +{ + grub_term_unregister_input (&grub_usb_keyboard_term); +} From a455f472aa3fa3854603d03a4790d8aca5974478 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 22 Feb 2009 00:44:22 +0000 Subject: [PATCH 0538/1707] 2009-02-22 Robert Millan * include/multiboot.h (MULTIBOOT_INFO_ALIGN): New macro. * loader/i386/pc/multiboot.c (grub_multiboot): Include the MBI in our relocation, instead of using it directly from heap. Also use `MULTIBOOT_INFO_ALIGN' to ensure it is aligned. --- ChangeLog | 7 +++++++ include/multiboot.h | 5 ++++- loader/i386/pc/multiboot.c | 17 +++++++++-------- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ec24e970..25c27a9aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-22 Robert Millan + + * include/multiboot.h (MULTIBOOT_INFO_ALIGN): New macro. + * loader/i386/pc/multiboot.c (grub_multiboot): Include the MBI + in our relocation, instead of using it directly from heap. Also + use `MULTIBOOT_INFO_ALIGN' to ensure it is aligned. + 2009-02-21 Robert Millan Implement USB keyboard support (based on patch by Marco Gerards) diff --git a/include/multiboot.h b/include/multiboot.h index 9adc8736a..2298fa200 100644 --- a/include/multiboot.h +++ b/include/multiboot.h @@ -1,7 +1,7 @@ /* multiboot.h - multiboot header file. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -35,6 +35,9 @@ /* Alignment of multiboot modules. */ #define MULTIBOOT_MOD_ALIGN 0x00001000 +/* Alignment of the multiboot info structure. */ +#define MULTIBOOT_INFO_ALIGN 0x00000004 + /* * Flags set in the 'flags' member of the multiboot header. */ diff --git a/loader/i386/pc/multiboot.c b/loader/i386/pc/multiboot.c index c0d1fe1ca..b45bc472a 100644 --- a/loader/i386/pc/multiboot.c +++ b/loader/i386/pc/multiboot.c @@ -1,7 +1,7 @@ /* multiboot.c - boot a multiboot OS image. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -363,6 +363,7 @@ grub_multiboot (int argc, char *argv[]) char buffer[MULTIBOOT_SEARCH], *cmdline = 0, *p; struct grub_multiboot_header *header; grub_ssize_t len; + grub_uint32_t mmap_length; int i; grub_loader_unset (); @@ -417,14 +418,9 @@ grub_multiboot (int argc, char *argv[]) playground = NULL; } - mbi = grub_malloc (sizeof (struct grub_multiboot_info)); - if (! mbi) - goto fail; + mmap_length = grub_get_multiboot_mmap_len (); - grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); - - mbi->mmap_length = grub_get_multiboot_mmap_len (); - grub_multiboot_payload_size = mbi->mmap_length; + grub_multiboot_payload_size = sizeof (struct grub_multiboot_info) + mmap_length + MULTIBOOT_INFO_ALIGN; if (header->flags & MULTIBOOT_AOUT_KLUDGE) { @@ -462,6 +458,11 @@ grub_multiboot (int argc, char *argv[]) else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE) goto fail; + grub_multiboot_payload_size = ALIGN_UP (grub_multiboot_payload_size, MULTIBOOT_INFO_ALIGN); + + mbi = grub_multiboot_payload_orig + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info); + grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); + mbi->mmap_length = mmap_length; grub_fill_multiboot_mmap ((struct grub_multiboot_mmap_entry *) (grub_multiboot_payload_orig + grub_multiboot_payload_size From 74b21bee5ceffb33468e0e862e318e20b16cd150 Mon Sep 17 00:00:00 2001 From: chaac Date: Sun, 22 Feb 2009 21:55:49 +0000 Subject: [PATCH 0539/1707] =?UTF-8?q?2009-02-22=20=20Vesa=20J=C3=A4=C3=A4s?= =?UTF-8?q?kel=C3=A4inen=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Patch #25624 by Kevin Lacquement . * util/grub-mkconfig.in: Use ${grub_mkdevicemap} instead of hard coding tool name. --- ChangeLog | 7 +++++++ util/grub-mkconfig.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 25c27a9aa..c8c558a68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-02-22 Vesa Jääskeläinen + + Patch #25624 by Kevin Lacquement . + + * util/grub-mkconfig.in: Use ${grub_mkdevicemap} instead of hard + coding tool name. + 2009-02-22 Robert Millan * include/multiboot.h (MULTIBOOT_INFO_ALIGN): New macro. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 2d7510f83..106476322 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -111,7 +111,7 @@ fi mkdir -p ${grub_prefix} if test -e ${grub_prefix}/device.map ; then : ; else - grub-mkdevicemap + ${grub_mkdevicemap} fi # Device containing our userland. Typically used for root= parameter. From 6e09b8b72e90a81f9542c9c6b902947d190be851 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 24 Feb 2009 13:19:46 +0000 Subject: [PATCH 0540/1707] 2009-02-24 Bean * configure.ac: Check for -mcmodel=large in x86_64 target. * include/grub/efi/api.h (efi_call_10): New macro. (efi_wrap_10): New function. * include/grub/efi/pe32.h (GRUB_PE32_REL_BASE_HIGH): New macro. (GRUB_PE32_REL_BASED_HIGH): Likewise. (GRUB_PE32_REL_BASED_LOW): Likewise. (GRUB_PE32_REL_BASED_HIGHLOW): Likewise. (GRUB_PE32_REL_BASED_HIGHADJ): Likewise. (GRUB_PE32_REL_BASED_MIPS_JMPADDR): Likewise. (GRUB_PE32_REL_BASED_SECTION): Likewise. (GRUB_PE32_REL_BASED_REL): Likewise. (GRUB_PE32_REL_BASED_IA64_IMM64): Likewise. (GRUB_PE32_REL_BASED_DIR64): Likewise. (GRUB_PE32_REL_BASED_HIGH3ADJ): Likewise. * kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Fixed relocation issue. * kern/x86_64/efi/callwrap.S (efi_wrap_6): Bug fix. (efi_wrap_10): New function. * kern/x86_64/efi/startup.S (codestart): Use relative addressing. * loader/efi/appleloader.c (devpath_5): Add support for late 2008 MB/MBP model (NV chipset). (devdata_devs): Add devpath_5 to the list. * load/i386/efi/linux.c (video_base): Remove variable. (RGB_MASK): New macro. (RGB_MAGIC): Likewise. (LINE_MIN): Likewise. (LINE_MAX): Likewise. (FBTEST_STEP): Likewise. (FBTEST_COUNT): Likewise. (fb_list): New variable. (grub_find_video_card): Remove function. (find_framebuf): New function. (grub_linux_setup_video): Use find_framebuf to get frame buffer and line length. * util/i386/efi/grub-mkimage.c (grub_reloc_section): Fix relocation problem for x86_64. --- ChangeLog | 47 +++++++++++++++++++ configure | 59 ++++++++++++++++++++++- configure.ac | 11 ++++- include/grub/efi/api.h | 35 +++++++++++--- include/grub/efi/pe32.h | 9 ++++ kern/x86_64/dl.c | 6 +-- kern/x86_64/efi/callwrap.S | 24 +++++++++- kern/x86_64/efi/startup.S | 7 ++- loader/efi/appleloader.c | 11 +++++ loader/i386/efi/linux.c | 91 +++++++++++++++++------------------- util/i386/efi/grub-mkimage.c | 14 ++++-- 11 files changed, 242 insertions(+), 72 deletions(-) diff --git a/ChangeLog b/ChangeLog index c8c558a68..f1f95f25c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,50 @@ +2009-02-24 Bean + + * configure.ac: Check for -mcmodel=large in x86_64 target. + + * include/grub/efi/api.h (efi_call_10): New macro. + (efi_wrap_10): New function. + + * include/grub/efi/pe32.h (GRUB_PE32_REL_BASE_HIGH): New macro. + (GRUB_PE32_REL_BASED_HIGH): Likewise. + (GRUB_PE32_REL_BASED_LOW): Likewise. + (GRUB_PE32_REL_BASED_HIGHLOW): Likewise. + (GRUB_PE32_REL_BASED_HIGHADJ): Likewise. + (GRUB_PE32_REL_BASED_MIPS_JMPADDR): Likewise. + (GRUB_PE32_REL_BASED_SECTION): Likewise. + (GRUB_PE32_REL_BASED_REL): Likewise. + (GRUB_PE32_REL_BASED_IA64_IMM64): Likewise. + (GRUB_PE32_REL_BASED_DIR64): Likewise. + (GRUB_PE32_REL_BASED_HIGH3ADJ): Likewise. + + * kern/x86_64/dl.c (grub_arch_dl_relocate_symbols): Fixed relocation + issue. + + * kern/x86_64/efi/callwrap.S (efi_wrap_6): Bug fix. + (efi_wrap_10): New function. + + * kern/x86_64/efi/startup.S (codestart): Use relative addressing. + + * loader/efi/appleloader.c (devpath_5): Add support for late 2008 + MB/MBP model (NV chipset). + (devdata_devs): Add devpath_5 to the list. + + * load/i386/efi/linux.c (video_base): Remove variable. + (RGB_MASK): New macro. + (RGB_MAGIC): Likewise. + (LINE_MIN): Likewise. + (LINE_MAX): Likewise. + (FBTEST_STEP): Likewise. + (FBTEST_COUNT): Likewise. + (fb_list): New variable. + (grub_find_video_card): Remove function. + (find_framebuf): New function. + (grub_linux_setup_video): Use find_framebuf to get frame buffer and + line length. + + * util/i386/efi/grub-mkimage.c (grub_reloc_section): Fix relocation + problem for x86_64. + 2009-02-22 Vesa Jääskeläinen Patch #25624 by Kevin Lacquement . diff --git a/configure b/configure index c82ee244d..c3677c687 100644 --- a/configure +++ b/configure @@ -6774,7 +6774,64 @@ fi if test "x$target_m64" = x1; then # Force 64-bit mode. - TARGET_CFLAGS="$TARGET_CFLAGS -m64" + { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 +echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; } +if test "${grub_cv_cc_mcmodel+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CFLAGS="-m64 -mcmodel=large" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + grub_cv_cc_mcmodel=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + grub_cv_cc_mcmodel=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 +echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; } + if test "x$grub_cv_cc_mcmodel" = xno; then + { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 +echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} + { (exit 1); exit 1; }; } + fi + TARGET_CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large" TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" fi diff --git a/configure.ac b/configure.ac index 7658c7a42..fd89d302a 100644 --- a/configure.ac +++ b/configure.ac @@ -299,7 +299,16 @@ fi if test "x$target_m64" = x1; then # Force 64-bit mode. - TARGET_CFLAGS="$TARGET_CFLAGS -m64" + AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ + CFLAGS="-m64 -mcmodel=large" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_mcmodel=yes], + [grub_cv_cc_mcmodel=no]) + ]) + if test "x$grub_cv_cc_mcmodel" = xno; then + AC_MSG_ERROR([-mcmodel=large not supported, upgrade your gcc]) + fi + TARGET_CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large" TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" fi diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 44b7d27e4..50556bfe7 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -1104,16 +1104,31 @@ typedef struct grub_efi_block_io grub_efi_block_io_t; #define efi_call_4(func, a, b, c, d) func(a, b, c, d) #define efi_call_5(func, a, b, c, d, e) func(a, b, c, d, e) #define efi_call_6(func, a, b, c, d, e, f) func(a, b, c, d, e, f) +#define efi_call_10(func, a, b, c, d, e, f, g, h, i, j) func(a, b, c, d, e, f, g, h, i, j) #else -#define efi_call_0(func) efi_wrap_0(func) -#define efi_call_1(func, a) efi_wrap_1(func, (grub_uint64_t) a) -#define efi_call_2(func, a, b) efi_wrap_2(func, (grub_uint64_t) a, (grub_uint64_t) b) -#define efi_call_3(func, a, b, c) efi_wrap_3(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c) -#define efi_call_4(func, a, b, c, d) efi_wrap_4(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, (grub_uint64_t) d) -#define efi_call_5(func, a, b, c, d, e) efi_wrap_5(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, (grub_uint64_t) d, (grub_uint64_t) e) -#define efi_call_6(func, a, b, c, d, e, f) efi_wrap_6(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, (grub_uint64_t) d, (grub_uint64_t) e, (grub_uint64_t) f) +#define efi_call_0(func) \ + efi_wrap_0(func) +#define efi_call_1(func, a) \ + efi_wrap_1(func, (grub_uint64_t) a) +#define efi_call_2(func, a, b) \ + efi_wrap_2(func, (grub_uint64_t) a, (grub_uint64_t) b) +#define efi_call_3(func, a, b, c) \ + efi_wrap_3(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c) +#define efi_call_4(func, a, b, c, d) \ + efi_wrap_4(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, \ + (grub_uint64_t) d) +#define efi_call_5(func, a, b, c, d, e) \ + efi_wrap_5(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, \ + (grub_uint64_t) d, (grub_uint64_t) e) +#define efi_call_6(func, a, b, c, d, e, f) \ + efi_wrap_6(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, \ + (grub_uint64_t) d, (grub_uint64_t) e, (grub_uint64_t) f) +#define efi_call_10(func, a, b, c, d, e, f, g, h, i, j) \ + efi_wrap_10(func, (grub_uint64_t) a, (grub_uint64_t) b, (grub_uint64_t) c, \ + (grub_uint64_t) d, (grub_uint64_t) e, (grub_uint64_t) f, (grub_uint64_t) g, \ + (grub_uint64_t) h, (grub_uint64_t) i, (grub_uint64_t) j) grub_uint64_t EXPORT_FUNC(efi_wrap_0) (void *func); grub_uint64_t EXPORT_FUNC(efi_wrap_1) (void *func, grub_uint64_t arg1); @@ -1131,6 +1146,12 @@ grub_uint64_t EXPORT_FUNC(efi_wrap_6) (void *func, grub_uint64_t arg1, grub_uint64_t arg2, grub_uint64_t arg3, grub_uint64_t arg4, grub_uint64_t arg5, grub_uint64_t arg6); +grub_uint64_t EXPORT_FUNC(efi_wrap_10) (void *func, grub_uint64_t arg1, + grub_uint64_t arg2, grub_uint64_t arg3, + grub_uint64_t arg4, grub_uint64_t arg5, + grub_uint64_t arg6, grub_uint64_t arg7, + grub_uint64_t arg8, grub_uint64_t arg9, + grub_uint64_t arg10); #endif #endif /* ! GRUB_EFI_API_HEADER */ diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h index 50b41028f..15de7906e 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -231,7 +231,16 @@ struct grub_pe32_fixup_block #define GRUB_PE32_FIXUP_ENTRY(type, offset) (((type) << 12) | (offset)) #define GRUB_PE32_REL_BASED_ABSOLUTE 0 +#define GRUB_PE32_REL_BASED_HIGH 1 +#define GRUB_PE32_REL_BASED_LOW 2 #define GRUB_PE32_REL_BASED_HIGHLOW 3 +#define GRUB_PE32_REL_BASED_HIGHADJ 4 +#define GRUB_PE32_REL_BASED_MIPS_JMPADDR 5 +#define GRUB_PE32_REL_BASED_SECTION 6 +#define GRUB_PE32_REL_BASED_REL 7 +#define GRUB_PE32_REL_BASED_IA64_IMM64 9 +#define GRUB_PE32_REL_BASED_DIR64 10 +#define GRUB_PE32_REL_BASED_HIGH3ADJ 11 struct grub_pe32_symbol { diff --git a/kern/x86_64/dl.c b/kern/x86_64/dl.c index bef327052..a60690148 100644 --- a/kern/x86_64/dl.c +++ b/kern/x86_64/dl.c @@ -97,17 +97,17 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) switch (ELF64_R_TYPE (rel->r_info)) { case R_X86_64_64: - *addr64 = rel->r_addend + sym->st_value; + *addr64 += rel->r_addend + sym->st_value; break; case R_X86_64_PC32: - *addr32 = rel->r_addend + sym->st_value - + *addr32 += rel->r_addend + sym->st_value - (Elf64_Xword) seg->addr - rel->r_offset; break; case R_X86_64_32: case R_X86_64_32S: - *addr32 = rel->r_addend + sym->st_value; + *addr32 += rel->r_addend + sym->st_value; break; default: diff --git a/kern/x86_64/efi/callwrap.S b/kern/x86_64/efi/callwrap.S index 6c390ec8f..558d28061 100644 --- a/kern/x86_64/efi/callwrap.S +++ b/kern/x86_64/efi/callwrap.S @@ -1,7 +1,7 @@ /* callwrap.S - wrapper for x86_64 efi calls */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -87,10 +87,30 @@ FUNCTION(efi_wrap_6) subq $56, %rsp mov 56+8(%rsp), %rax mov %rax, 40(%rsp) - mov %r9, (%rsp) + mov %r9, 32(%rsp) mov %r8, %r9 mov %rcx, %r8 mov %rsi, %rcx call *%rdi addq $56, %rsp ret + +FUNCTION(efi_wrap_10) + subq $88, %rsp + mov 88+40(%rsp), %rax + mov %rax, 72(%rsp) + mov 88+32(%rsp), %rax + mov %rax, 64(%rsp) + mov 88+24(%rsp), %rax + mov %rax, 56(%rsp) + mov 88+16(%rsp), %rax + mov %rax, 48(%rsp) + mov 88+8(%rsp), %rax + mov %rax, 40(%rsp) + mov %r9, 32(%rsp) + mov %r8, %r9 + mov %rcx, %r8 + mov %rsi, %rcx + call *%rdi + addq $88, %rsp + ret \ No newline at end of file diff --git a/kern/x86_64/efi/startup.S b/kern/x86_64/efi/startup.S index 2fa676697..835c4fb28 100644 --- a/kern/x86_64/efi/startup.S +++ b/kern/x86_64/efi/startup.S @@ -1,7 +1,7 @@ /* startup.S - bootstrap GRUB itself */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -55,9 +55,8 @@ VARIABLE(grub_prefix) . = EXT_C(start) + 0x50 codestart: - - movq %rcx, EXT_C(grub_efi_image_handle) - movq %rdx, EXT_C(grub_efi_system_table) + movq %rcx, EXT_C(grub_efi_image_handle)(%rip) + movq %rdx, EXT_C(grub_efi_system_table)(%rip) call EXT_C(grub_main) ret diff --git a/loader/efi/appleloader.c b/loader/efi/appleloader.c index 910a13de0..97982ef48 100644 --- a/loader/efi/appleloader.c +++ b/loader/efi/appleloader.c @@ -103,6 +103,16 @@ static grub_uint8_t devpath_4[] = 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, }; +/* late-2008 MB/MBP (NVidia chipset) */ +static grub_uint8_t devpath_5[] = { + 0x01, 0x03, 0x18, 0x00, 0x0B, 0x00, 0x00, 0x00, + 0x00, 0x40, 0xCB, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0xFF, 0xBF, 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, + 0x04, 0x06, 0x14, 0x00, 0xEB, 0x85, 0x05, 0x2B, + 0xB8, 0xD8, 0xA9, 0x49, 0x8B, 0x8C, 0xE2, 0x1B, + 0x01, 0xAE, 0xF2, 0xB7, 0x7F, 0xFF, 0x04, 0x00, +}; + struct devdata { char *model; @@ -115,6 +125,7 @@ struct devdata devs[] = {"Mac Pro", (grub_efi_device_path_t *) devpath_2}, {"MBP", (grub_efi_device_path_t *) devpath_3}, {"MBA", (grub_efi_device_path_t *) devpath_4}, + {"MB NV", (grub_efi_device_path_t *) devpath_5}, {NULL, NULL}, }; diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 50e1ff1c8..4528c216e 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -31,7 +31,6 @@ #include #include #include -#include #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 @@ -458,68 +457,59 @@ grub_linux_unload (void) return GRUB_ERR_NONE; } -grub_uint64_t video_base; +static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; + + +#define RGB_MASK 0xffffff +#define RGB_MAGIC 0x121314 +#define LINE_MIN 800 +#define LINE_MAX 4096 +#define FBTEST_STEP (0x10000 >> 2) +#define FBTEST_COUNT 8 + +static grub_uint32_t fb_list[]= + {0x40000000, 0x80000000, 0xc0000000, 0}; static int -grub_find_video_card (int bus, int dev, int func, - grub_pci_id_t pciid __attribute__ ((unused))) +find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) { - grub_pci_address_t addr; + grub_uint32_t *fb; - addr = grub_pci_make_address (bus, dev, func, 2); - - if (grub_pci_read (addr) >> 24 == 0x3) + for (fb = fb_list; *fb; fb++) { + grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb; int i; - addr = grub_pci_make_address (bus, dev, func, 4); - for (i = 0; i < 6; i++, addr += 4) + for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) { - grub_uint32_t base, type; + if ((*base & RGB_MASK) == RGB_MAGIC) + { + int j; - base = grub_pci_read (addr); - - if ((base == 0) || (base == 0xffffffff) || - (base & GRUB_PCI_ADDR_SPACE_IO)) - continue; - - type = base & GRUB_PCI_ADDR_MEM_TYPE_MASK; - if (! (addr & GRUB_PCI_ADDR_MEM_PREFETCH)) + for (j = LINE_MIN; j <= LINE_MAX; j++) { - if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + if ((base[j] & RGB_MASK) == RGB_MAGIC) { - i++; - addr +=4 ; + *fb_base = (grub_uint32_t) (grub_target_addr_t) base; + *line_len = j << 2; + + return 0; } - continue; } - base &= GRUB_PCI_ADDR_MEM_MASK; - if (type == GRUB_PCI_ADDR_MEM_TYPE_64) - { - if (i == 5) break; - - video_base = grub_pci_read (addr + 4); - video_base <<= 32; } - - video_base |= base; - - return 1; } } - - return 0; + return 1; } -static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; - static int grub_linux_setup_video (struct linux_kernel_params *params) { grub_efi_uga_draw_protocol_t *c; - grub_uint32_t width, height, depth, rate; + grub_uint32_t width, height, depth, rate, pixel, fb_base, line_len; + int ret; c = grub_efi_locate_protocol (&uga_draw_guid, 0); if (! c) @@ -530,26 +520,29 @@ grub_linux_setup_video (struct linux_kernel_params *params) grub_printf ("Video mode: %ux%u-%u@%u\n", width, height, depth, rate); - video_base = 0; - grub_pci_iterate (grub_find_video_card); + grub_efi_set_text_mode (0); + pixel = RGB_MAGIC; + efi_call_10 (c->blt, c, &pixel, GRUB_EFI_UGA_VIDEO_FILL, + 0, 0, 0, 0, 1, height, 0); + ret = find_framebuf (&fb_base, &line_len); + grub_efi_set_text_mode (1); - if (! video_base) + if (ret) { grub_printf ("Can\'t find frame buffer address\n"); return 1; } - grub_printf ("Video frame buffer: %llx\n", (unsigned long long) video_base); + grub_printf ("Video frame buffer: 0x%x\n", fb_base); + grub_printf ("Video line length: %d\n", line_len); params->lfb_width = width; params->lfb_height = height; params->lfb_depth = depth; + params->lfb_line_len = line_len; - /* FIXME: shouldn't use fixed value. */ - params->lfb_line_len = 8192; - - params->lfb_base = video_base; - params->lfb_size = (params->lfb_line_len * params->lfb_height + 65535) >> 16; + params->lfb_base = fb_base; + params->lfb_size = (line_len * params->lfb_height + 65535) >> 16; params->red_mask_size = 8; params->red_field_pos = 16; diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index 36ea31f67..db88a0fff 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -807,17 +807,21 @@ make_reloc_section (FILE *out, Elf_Addr current_address, Elf_Ehdr *e, out); } #else - if ((ELF_R_TYPE (info) == R_X86_64_64) || - (ELF_R_TYPE (info) == R_X86_64_32) || + if ((ELF_R_TYPE (info) == R_X86_64_32) || (ELF_R_TYPE (info) == R_X86_64_32S)) + { + grub_util_error ("Can\'t add fixup entry for R_X86_64_32(S)"); + } + else if (ELF_R_TYPE (info) == R_X86_64_64) { Elf_Addr addr; addr = section_address + offset; grub_util_info ("adding a relocation entry for 0x%llx", addr); current_address = add_fixup_entry (&fixup_block, - GRUB_PE32_REL_BASED_HIGHLOW, - addr, 0, current_address, + GRUB_PE32_REL_BASED_DIR64, + addr, + 0, current_address, out); } #endif From 8cc50345f854b0a83da749adaeb0d83780e6ede6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 19:33:38 +0000 Subject: [PATCH 0541/1707] 2009-02-27 Robert Millan * kern/misc.c (grub_strtoull): Fix bug (it mistakenly parsed the `0x' qualifier as 0 when base is specified as parameter). --- ChangeLog | 5 +++++ kern/misc.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1f95f25c..cbf9a414d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Robert Millan + + * kern/misc.c (grub_strtoull): Fix bug (it mistakenly parsed the + `0x' qualifier as 0 when base is specified as parameter). + 2009-02-24 Bean * configure.ac: Check for -mcmodel=large in x86_64 target. diff --git a/kern/misc.c b/kern/misc.c index 641bd7aef..23eaa14e3 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -438,7 +438,7 @@ grub_strtoull (const char *str, char **end, int base) /* Guess the base, if not specified. The prefix `0x' means 16, and the prefix `0' means 8. */ - if (base == 0 && str[0] == '0') + if (str[0] == '0') { if (str[1] == 'x') { @@ -448,7 +448,7 @@ grub_strtoull (const char *str, char **end, int base) str += 2; } } - else if (str[1] >= '0' && str[1] <= '7') + else if (base == 0 && str[1] >= '0' && str[1] <= '7') base = 8; } From 34519c3f9dca29cba180db37128da25d84e149f2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 19:50:53 +0000 Subject: [PATCH 0542/1707] 2009-02-27 Krzysztof Smiechowicz * fs/sfs.c (grub_sfs_read_extent): Correction to traversing extent b-tree. --- ChangeLog | 5 +++++ fs/sfs.c | 12 ++---------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index cbf9a414d..e33065c60 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Krzysztof Smiechowicz + + * fs/sfs.c (grub_sfs_read_extent): Correction to traversing extent + b-tree. + 2009-02-27 Robert Millan * kern/misc.c (grub_strtoull): Fix bug (it mistakenly parsed the diff --git a/fs/sfs.c b/fs/sfs.c index 910bbf2c8..d719e299e 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -172,7 +172,7 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, return grub_errno; } - for (i = 0; i < grub_be_to_cpu16 (tree->nodes); i++) + for (i = grub_be_to_cpu16 (tree->nodes) - 1; i >= 0; i--) { #define EXTNODE(tree, index) \ @@ -180,16 +180,8 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, + (index) * (tree)->nodesize)) /* Follow the tree down to the leaf level. */ - if ((grub_be_to_cpu32 (EXTNODE(tree, i)->key) >= block) + if ((grub_be_to_cpu32 (EXTNODE(tree, i)->key) <= block) && !tree->leaf) - { - next = grub_be_to_cpu32 (EXTNODE (tree, i - 1)->data); - break; - } - - /* In case the last node is reached just use that one, it is - the right match. */ - if (i + 1 == grub_be_to_cpu16 (tree->nodes) && !tree->leaf) { next = grub_be_to_cpu32 (EXTNODE (tree, i)->data); break; From b941342428a63915a147e236f256f441671a4561 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 21:01:25 +0000 Subject: [PATCH 0543/1707] 2009-02-27 Robert Millan Patch from Alexandre Bique * util/i386/pc/grub-setup.c (setup): Fix directory path. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e33065c60..15bc11893 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Robert Millan + + Patch from Alexandre Bique + * util/i386/pc/grub-setup.c (setup): Fix directory path. + 2009-02-27 Krzysztof Smiechowicz * fs/sfs.c (grub_sfs_read_extent): Correction to traversing extent diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index ccbb46536..295e30ad9 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -373,7 +373,7 @@ setup (const char *dir, /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); - core_path_dev = grub_util_get_path (DEFAULT_DIRECTORY, core_file); + core_path_dev = grub_util_get_path (dir, core_file); /* It is a Good Thing to sync two times. */ sync (); From 4b6bf4f97cac8b402bf4d94a0c7f10aca2d02f7b Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 21:19:00 +0000 Subject: [PATCH 0544/1707] 2009-02-27 Robert Millan * loader/i386/pc/multiboot.c: Move from here ... * loader/i386/multiboot.c: ... to here. Update all users. --- ChangeLog | 5 +++++ DISTLIST | 4 +++- conf/i386-coreboot.mk | 36 ++++++++++++++++---------------- conf/i386-coreboot.rmk | 2 +- conf/i386-pc.mk | 36 ++++++++++++++++---------------- conf/i386-pc.rmk | 2 +- loader/i386/{pc => }/multiboot.c | 0 7 files changed, 46 insertions(+), 39 deletions(-) rename loader/i386/{pc => }/multiboot.c (100%) diff --git a/ChangeLog b/ChangeLog index 15bc11893..711030629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Robert Millan + + * loader/i386/pc/multiboot.c: Move from here ... + * loader/i386/multiboot.c: ... to here. Update all users. + 2009-02-27 Robert Millan Patch from Alexandre Bique diff --git a/DISTLIST b/DISTLIST index a92f73323..8c429a5d4 100644 --- a/DISTLIST +++ b/DISTLIST @@ -385,13 +385,15 @@ loader/efi/chainloader_normal.c loader/i386/bsd.c loader/i386/bsd_normal.c loader/i386/linux.c +loader/i386/multiboot.c loader/i386/efi/linux.c loader/i386/ieee1275/linux.c loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c -loader/i386/pc/multiboot.c loader/i386/pc/multiboot2.c +loader/i386/pc/multiboot_elf32.c +loader/i386/pc/multiboot_elf64.c loader/i386/pc/multiboot_normal.c loader/ieee1275/multiboot2.c loader/powerpc/ieee1275/linux.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index c10d16f24..5c21b0493 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -1296,16 +1296,16 @@ serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c \ +_multiboot_mod_SOURCES = loader/i386/multiboot.c \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst +CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst ifneq ($(_multiboot_mod_EXPORTS),no) CLEANFILES += def-_multiboot.lst DEFSYMFILES += def-_multiboot.lst endif -MOSTLYCLEANFILES += _multiboot_mod-loader_i386_pc_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d +MOSTLYCLEANFILES += _multiboot_mod-loader_i386_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) @@ -1314,9 +1314,9 @@ _multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o +pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< @@ -1333,23 +1333,23 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_i386_pc_multiboot.d +_multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include _multiboot_mod-loader_i386_multiboot.d -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod-loader_i386_pc_multiboot.lst partmap-_multiboot_mod-loader_i386_pc_multiboot.lst -COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst -FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot.lst +CLEANFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst fs-_multiboot_mod-loader_i386_multiboot.lst partmap-_multiboot_mod-loader_i386_multiboot.lst +COMMANDFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst +FSFILES += fs-_multiboot_mod-loader_i386_multiboot.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_i386_multiboot.lst -cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) +cmd-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +fs-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -partmap-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) _multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index b97483b20..cc2b6a8e0 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -149,7 +149,7 @@ serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c \ +_multiboot_mod_SOURCES = loader/i386/multiboot.c \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 72e0957e5..8ebb7ebc3 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1816,16 +1816,16 @@ serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c \ +_multiboot_mod_SOURCES = loader/i386/multiboot.c \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst +CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst ifneq ($(_multiboot_mod_EXPORTS),no) CLEANFILES += def-_multiboot.lst DEFSYMFILES += def-_multiboot.lst endif -MOSTLYCLEANFILES += _multiboot_mod-loader_i386_pc_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d +MOSTLYCLEANFILES += _multiboot_mod-loader_i386_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-_multiboot.lst _multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) @@ -1834,9 +1834,9 @@ _multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o +pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_i386_pc_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o + $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o mod-_multiboot.o: mod-_multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< @@ -1853,23 +1853,23 @@ und-_multiboot.lst: pre-_multiboot.o echo '_multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -_multiboot_mod-loader_i386_pc_multiboot.o: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_i386_pc_multiboot.d +_multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include _multiboot_mod-loader_i386_multiboot.d -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst fs-_multiboot_mod-loader_i386_pc_multiboot.lst partmap-_multiboot_mod-loader_i386_pc_multiboot.lst -COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot.lst -FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot.lst +CLEANFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst fs-_multiboot_mod-loader_i386_multiboot.lst partmap-_multiboot_mod-loader_i386_multiboot.lst +COMMANDFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst +FSFILES += fs-_multiboot_mod-loader_i386_multiboot.lst +PARTMAPFILES += partmap-_multiboot_mod-loader_i386_multiboot.lst -cmd-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) +cmd-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) -fs-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) +fs-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) -partmap-_multiboot_mod-loader_i386_pc_multiboot.lst: loader/i386/pc/multiboot.c $(loader/i386/pc/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) +partmap-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) _multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index fd66ce9fc..34a3777b3 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -237,7 +237,7 @@ serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/pc/multiboot.c \ +_multiboot_mod_SOURCES = loader/i386/multiboot.c \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c diff --git a/loader/i386/pc/multiboot.c b/loader/i386/multiboot.c similarity index 100% rename from loader/i386/pc/multiboot.c rename to loader/i386/multiboot.c From 6e8c9c3a873bc334c3c4acd2c7be41b7900d03e0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 21:27:01 +0000 Subject: [PATCH 0545/1707] 2009-02-27 Vladimir Serbinenko Don't leak in SCSI code. * disk/scsi.c (grub_scsi_close): free `scsi'. --- ChangeLog | 5 +++++ disk/scsi.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 711030629..206dc8c3d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Vladimir Serbinenko + + Don't leak in SCSI code. + * disk/scsi.c (grub_scsi_close): free `scsi'. + 2009-02-27 Robert Millan * loader/i386/pc/multiboot.c: Move from here ... diff --git a/disk/scsi.c b/disk/scsi.c index 5dce28873..75b92b409 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -312,7 +312,8 @@ grub_scsi_close (grub_disk_t disk) grub_scsi_t scsi; scsi = disk->data; - return scsi->dev->close (scsi); + scsi->dev->close (scsi); + grub_free (scsi); } static grub_err_t From 51cd3dfc70e1cf0c78652293407006591eae5faa Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 21:37:07 +0000 Subject: [PATCH 0546/1707] 2009-02-27 Robert Millan * util/grub.d/10_linux.in: Rename "single-user mode" to "recovery mode". --- ChangeLog | 5 +++++ util/grub.d/10_linux.in | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 206dc8c3d..99d36940a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-02-27 Robert Millan + + * util/grub.d/10_linux.in: Rename "single-user mode" to + "recovery mode". + 2009-02-27 Vladimir Serbinenko Don't leak in SCSI code. diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 7cd5a9ed2..010660f68 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -1,7 +1,7 @@ #! /bin/sh -e # update-grub helper script. -# Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. +# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -139,7 +139,7 @@ EOF EOF cat << EOF -menuentry "${OS}, linux ${version} (single-user mode)" { +menuentry "${OS}, linux ${version} (recovery mode)" { EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF From 8a31787ff517f42f3f9e62dbd10c1d714df1da52 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 27 Feb 2009 23:04:46 +0000 Subject: [PATCH 0547/1707] 2009-02-27 Robert Millan Factorize elf32 / elf64 code in Multiboot loader. This will prevent it from getting out of sync again. * loader/i386/multiboot.c (grub_multiboot_is_elf32, grub_multiboot_load_elf32, grub_multiboot_is_elf64, grub_multiboot_load_elf64): Move from here ... * loader/i386/multiboot_elfxx.c (grub_multiboot_is_elf, grub_multiboot_load_elf): ... to here (new file). --- ChangeLog | 11 +++ loader/i386/multiboot.c | 181 ++-------------------------------- loader/i386/multiboot_elfxx.c | 137 +++++++++++++++++++++++++ 3 files changed, 155 insertions(+), 174 deletions(-) create mode 100644 loader/i386/multiboot_elfxx.c diff --git a/ChangeLog b/ChangeLog index 99d36940a..a9bfe66ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-02-27 Robert Millan + + Factorize elf32 / elf64 code in Multiboot loader. This will + prevent it from getting out of sync again. + + * loader/i386/multiboot.c (grub_multiboot_is_elf32, + grub_multiboot_load_elf32, grub_multiboot_is_elf64, + grub_multiboot_load_elf64): Move from here ... + * loader/i386/multiboot_elfxx.c (grub_multiboot_is_elf, + grub_multiboot_load_elf): ... to here (new file). + 2009-02-27 Robert Millan * util/grub.d/10_linux.in: Rename "single-user mode" to diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index b45bc472a..24c8b2183 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -124,180 +124,13 @@ grub_fill_multiboot_mmap (struct grub_multiboot_mmap_entry *first_entry) grub_machine_mmap_iterate (hook); } -/* Check if BUFFER contains ELF32. */ -static int -grub_multiboot_is_elf32 (void *buffer) -{ - Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; +#define MULTIBOOT_LOAD_ELF64 +#include "multiboot_elfxx.c" +#undef MULTIBOOT_LOAD_ELF64 - return ehdr->e_ident[EI_CLASS] == ELFCLASS32; -} - -static grub_err_t -grub_multiboot_load_elf32 (grub_file_t file, void *buffer) -{ - Elf32_Ehdr *ehdr = (Elf32_Ehdr *) buffer; - char *phdr_base; - int lowest_segment = 0, highest_segment = 0; - int i; - - if (ehdr->e_ident[EI_CLASS] != ELFCLASS32) - return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF class"); - - if (grub_dl_check_header (ehdr, sizeof(Elf32_Ehdr))) - return grub_error (GRUB_ERR_UNKNOWN_OS, "no valid ELF header found"); - - if (ehdr->e_type != ET_EXEC) - return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF file type"); - - /* FIXME: Should we support program headers at strange locations? */ - if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) - return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); - - phdr_base = (char *) buffer + ehdr->e_phoff; -#define phdr(i) ((Elf32_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) - - for (i = 0; i < ehdr->e_phnum; i++) - if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) - { - if (phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr) - lowest_segment = i; - if (phdr(i)->p_paddr > phdr(highest_segment)->p_paddr) - highest_segment = i; - } - grub_multiboot_payload_size += (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; - grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; - - playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); - if (! playground) - return grub_errno; - - grub_multiboot_payload_orig = (long) playground + RELOCATOR_SIZEOF(forward); - - /* Load every loadable segment in memory. */ - for (i = 0; i < ehdr->e_phnum; i++) - { - if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) - { - char *load_this_module_at = (char *) (grub_multiboot_payload_orig + (phdr(i)->p_paddr - phdr(lowest_segment)->p_paddr)); - - grub_dprintf ("multiboot_loader", "segment %d: paddr=%p, memsz=0x%x\n", - i, (void *) phdr(i)->p_paddr, phdr(i)->p_memsz); - - if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) - == (grub_off_t) -1) - return grub_error (GRUB_ERR_BAD_OS, - "invalid offset in program header"); - - if (grub_file_read (file, load_this_module_at, phdr(i)->p_filesz) - != (grub_ssize_t) phdr(i)->p_filesz) - return grub_error (GRUB_ERR_BAD_OS, - "couldn't read segment from file"); - - if (phdr(i)->p_filesz < phdr(i)->p_memsz) - grub_memset (load_this_module_at + phdr(i)->p_filesz, 0, - phdr(i)->p_memsz - phdr(i)->p_filesz); - } - } - - grub_multiboot_payload_entry_offset = ehdr->e_entry - phdr(lowest_segment)->p_vaddr; - -#undef phdr - - return grub_errno; -} - -/* Check if BUFFER contains ELF64. */ -static int -grub_multiboot_is_elf64 (void *buffer) -{ - Elf64_Ehdr *ehdr = (Elf64_Ehdr *) buffer; - - return ehdr->e_ident[EI_CLASS] == ELFCLASS64; -} - -static grub_err_t -grub_multiboot_load_elf64 (grub_file_t file, void *buffer) -{ - Elf64_Ehdr *ehdr = (Elf64_Ehdr *) buffer; - char *phdr_base; - grub_addr_t physical_entry_addr = 0; - int i; - - if (ehdr->e_ident[EI_CLASS] != ELFCLASS64) - return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF class"); - - if (ehdr->e_ident[EI_MAG0] != ELFMAG0 - || ehdr->e_ident[EI_MAG1] != ELFMAG1 - || ehdr->e_ident[EI_MAG2] != ELFMAG2 - || ehdr->e_ident[EI_MAG3] != ELFMAG3 - || ehdr->e_version != EV_CURRENT - || ehdr->e_ident[EI_DATA] != ELFDATA2LSB - || ehdr->e_machine != EM_X86_64) - return grub_error(GRUB_ERR_UNKNOWN_OS, "no valid ELF header found"); - - if (ehdr->e_type != ET_EXEC) - return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF file type"); - - /* FIXME: Should we support program headers at strange locations? */ - if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) - return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); - - /* We still in 32-bit mode */ - if (ehdr->e_entry > 0xffffffff) - return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64"); - - entry = ehdr->e_entry; - - phdr_base = (char *) buffer + ehdr->e_phoff; -#define phdr(i) ((Elf64_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) - - /* Load every loadable segment in memory. */ - for (i = 0; i < ehdr->e_phnum; i++) - { - if (phdr(i)->p_type == PT_LOAD) - { - /* The segment should fit in the area reserved for the OS. */ - if (phdr(i)->p_paddr < (grub_uint64_t) grub_os_area_addr) - return grub_error (GRUB_ERR_BAD_OS, - "segment doesn't fit in memory reserved for the OS (0x%lx < 0x%lx)", - phdr(i)->p_paddr, (grub_uint64_t) grub_os_area_addr); - if (phdr(i)->p_paddr + phdr(i)->p_memsz - > (grub_uint64_t) grub_os_area_addr + (grub_uint64_t) grub_os_area_size) - return grub_error (GRUB_ERR_BAD_OS, - "segment doesn't fit in memory reserved for the OS (0x%lx > 0x%lx)", - phdr(i)->p_paddr + phdr(i)->p_memsz, - (grub_uint64_t) grub_os_area_addr + (grub_uint64_t) grub_os_area_size); - - if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) - == (grub_off_t) -1) - return grub_error (GRUB_ERR_BAD_OS, - "invalid offset in program header"); - - if (grub_file_read (file, (void *) ((grub_uint32_t) phdr(i)->p_paddr), - phdr(i)->p_filesz) - != (grub_ssize_t) phdr(i)->p_filesz) - return grub_error (GRUB_ERR_BAD_OS, - "couldn't read segment from file"); - - if (phdr(i)->p_filesz < phdr(i)->p_memsz) - grub_memset (((char *) ((grub_uint32_t) phdr(i)->p_paddr) - + phdr(i)->p_filesz), - 0, - phdr(i)->p_memsz - phdr(i)->p_filesz); - - if ((entry >= phdr(i)->p_vaddr) && - (entry < phdr(i)->p_vaddr + phdr(i)->p_memsz)) - physical_entry_addr = entry + phdr(i)->p_paddr - phdr(i)->p_vaddr; - } - } -#undef phdr - - if (physical_entry_addr) - entry = physical_entry_addr; - - return grub_errno; -} +#define MULTIBOOT_LOAD_ELF32 +#include "multiboot_elfxx.c" +#undef MULTIBOOT_LOAD_ELF32 /* Load ELF32 or ELF64. */ static grub_err_t @@ -460,7 +293,7 @@ grub_multiboot (int argc, char *argv[]) grub_multiboot_payload_size = ALIGN_UP (grub_multiboot_payload_size, MULTIBOOT_INFO_ALIGN); - mbi = grub_multiboot_payload_orig + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info); + mbi = (void *) (grub_multiboot_payload_orig + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info)); grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); mbi->mmap_length = mmap_length; diff --git a/loader/i386/multiboot_elfxx.c b/loader/i386/multiboot_elfxx.c new file mode 100644 index 000000000..e2cf5453e --- /dev/null +++ b/loader/i386/multiboot_elfxx.c @@ -0,0 +1,137 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#if defined(MULTIBOOT_LOAD_ELF32) +# define XX 32 +# define E_MACHINE EM_386 +# define ELFCLASSXX ELFCLASS32 +# define Elf_Ehdr Elf32_Ehdr +# define Elf_Phdr Elf32_Phdr +#elif defined(MULTIBOOT_LOAD_ELF64) +# define XX 64 +# define E_MACHINE EM_X86_64 +# define ELFCLASSXX ELFCLASS64 +# define Elf_Ehdr Elf64_Ehdr +# define Elf_Phdr Elf64_Phdr +#else +#error "I'm confused" +#endif + +#define CONCAT(a,b) CONCAT_(a, b) +#define CONCAT_(a,b) a ## b + +/* Check if BUFFER contains ELF32 (or ELF64). */ +static int +CONCAT(grub_multiboot_is_elf, XX) (void *buffer) +{ + Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer; + + return ehdr->e_ident[EI_CLASS] == ELFCLASSXX; +} + +static grub_err_t +CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) +{ + Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer; + char *phdr_base; + int lowest_segment = 0, highest_segment = 0; + int i; + + if (ehdr->e_ident[EI_CLASS] != ELFCLASSXX) + return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF class"); + + if (ehdr->e_ident[EI_MAG0] != ELFMAG0 + || ehdr->e_ident[EI_MAG1] != ELFMAG1 + || ehdr->e_ident[EI_MAG2] != ELFMAG2 + || ehdr->e_ident[EI_MAG3] != ELFMAG3 + || ehdr->e_version != EV_CURRENT + || ehdr->e_ident[EI_DATA] != ELFDATA2LSB + || ehdr->e_machine != E_MACHINE) + return grub_error(GRUB_ERR_UNKNOWN_OS, "no valid ELF header found"); + + if (ehdr->e_type != ET_EXEC) + return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF file type"); + + /* FIXME: Should we support program headers at strange locations? */ + if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) + return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); + +#ifdef MULTIBOOT_LOAD_ELF64 + /* We still in 32-bit mode. */ + if (ehdr->e_entry > 0xffffffff) + return grub_error (GRUB_ERR_BAD_OS, "invalid entry point for ELF64"); +#endif + + phdr_base = (char *) buffer + ehdr->e_phoff; +#define phdr(i) ((Elf_Phdr *) (phdr_base + (i) * ehdr->e_phentsize)) + + for (i = 0; i < ehdr->e_phnum; i++) + if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) + { + if (phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr) + lowest_segment = i; + if (phdr(i)->p_paddr > phdr(highest_segment)->p_paddr) + highest_segment = i; + } + grub_multiboot_payload_size += (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; + grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; + + playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); + if (! playground) + return grub_errno; + + grub_multiboot_payload_orig = (long) playground + RELOCATOR_SIZEOF(forward); + + /* Load every loadable segment in memory. */ + for (i = 0; i < ehdr->e_phnum; i++) + { + if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) + { + char *load_this_module_at = (char *) (grub_multiboot_payload_orig + (long) (phdr(i)->p_paddr - phdr(lowest_segment)->p_paddr)); + + grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx\n", + i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz); + + if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) + == (grub_off_t) -1) + return grub_error (GRUB_ERR_BAD_OS, + "invalid offset in program header"); + + if (grub_file_read (file, load_this_module_at, phdr(i)->p_filesz) + != (grub_ssize_t) phdr(i)->p_filesz) + return grub_error (GRUB_ERR_BAD_OS, + "couldn't read segment from file"); + + if (phdr(i)->p_filesz < phdr(i)->p_memsz) + grub_memset (load_this_module_at + phdr(i)->p_filesz, 0, + phdr(i)->p_memsz - phdr(i)->p_filesz); + } + } + + grub_multiboot_payload_entry_offset = ehdr->e_entry - phdr(lowest_segment)->p_vaddr; + +#undef phdr + + return grub_errno; +} + +#undef XX +#undef E_MACHINE +#undef ELFCLASSXX +#undef Elf_Ehdr +#undef Elf_Phdr From 71b9f36193fe33e5b4e78c58eb26f6e66c12c797 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 1 Mar 2009 17:51:44 +0000 Subject: [PATCH 0548/1707] 2009-03-01 Bean * commands/terminal.c: Removed. * commands/handler.c: New file. * include/grub/list.h: Likewise. * include/grub/handler.h: Likewise. * kern/list.c: Likewise. * kern/handler.c: Likewise. * kern/term.h: Include header file . (grub_term_input): Move next field to the beginning. (grub_term_output): Likewise. (grub_term_input_class): New variable. (grub_term_output_class): Likewise. (grub_term_register_input): Changed to inline function. (grub_term_register_output): Likewise. (grub_term_unregister_input): Likewise. (grub_term_unregister_output): Likewise. (grub_term_set_current_input): Likewise. (grub_term_set_current_output): Likewise. (grub_term_get_current_input): Likewise. (grub_term_get_current_output): Likewise. (grub_term_iterate_input): Removed. (grub_term_iterate_output): Likewise. * kern/term.c (grub_term_list_input): Removed. (grub_term_list_output): Likewise. (grub_term_input_class): New variable. (grub_term_output_class): Likewise. (grub_cur_term_input): Change varaible as macro. (grub_cur_term_output): Likewise. (grub_term_register_input): Removed. (grub_term_register_output): Likewise. (grub_term_unregister_input): Likewise. (grub_term_unregister_output): Likewise. (grub_term_set_current_input): Likewise. (grub_term_set_current_output): Likewise. (grub_term_iterate_input): Likewise. (grub_term_iterate_output): Likewise. (grub_term_get_current_input): Likewise. (grub_term_get_current_output): Likewise. * util/grub-editenv.c: Include header file . (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. (grub_term_outout_class): Likewise. * util/grub-fstest.c (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. (grub_term_outout_class): Likewise. * util/grub-probe.c (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. (grub_term_outout_class): Likewise. * util/i386/pc/grub-setup.c (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. (grub_term_outout_class): Likewise. * conf/common.rmk (pkglib_MODULES): Replace terminal with handler. (terminal_mod_SOURCES): Likewise. (terminal_mod_CFLAGS): Likewise. (terminal_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Replace terminal.c with handler.c. (kernel_img_SOURCES): Add list.c and handler.c. (kernel_img_HEADERS): Add list.h and handler.h. * conf/i386-efi.rmk (grub_emu_SOURCES): Replace terminal.c with handler.c. (kernel_mod_SOURCES): Add list.c and handler.c. (kernel_mod_HEADERS): Add list.h and handler.h. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Replace terminal.c with handler.c. (kernel_elf_SOURCES): Add list.c and handler.c. (kernel_elf_HEADERS): Add list.h and handler.h. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace terminal.c with handler.c. (kernel_elf_SOURCES): Add list.c and handler.c. (kernel_elf_HEADERS): Add list.h and handler.h. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Replace terminal.c with handler.c. (kernel_mod_SOURCES): Add list.c and handler.c. (kernel_mod_HEADERS): Add list.h and handler.h. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Replace terminal.c with handler.c. (kernel_elf_SOURCES): Add list.c and handler.c. (kernel_elf_HEADERS): Add list.h and handler.h. --- ChangeLog | 103 +++++++++++++++++++++++++++++ DISTLIST | 8 ++- commands/handler.c | 132 ++++++++++++++++++++++++++++++++++++++ commands/terminal.c | 132 -------------------------------------- conf/common.mk | 74 ++++++++++----------- conf/common.rmk | 10 +-- conf/i386-coreboot.mk | 34 ++++++---- conf/i386-coreboot.rmk | 6 +- conf/i386-efi.mk | 52 +++++++++++++-- conf/i386-efi.rmk | 6 +- conf/i386-ieee1275.mk | 35 ++++++---- conf/i386-ieee1275.rmk | 7 +- conf/i386-pc.mk | 32 +++++---- conf/i386-pc.rmk | 6 +- conf/powerpc-ieee1275.mk | 14 ++-- conf/powerpc-ieee1275.rmk | 2 +- conf/x86_64-efi.mk | 52 +++++++++++++-- conf/x86_64-efi.rmk | 6 +- include/grub/handler.h | 60 +++++++++++++++++ include/grub/list.h | 69 ++++++++++++++++++++ include/grub/term.h | 74 ++++++++++++++++----- kern/handler.c | 64 ++++++++++++++++++ kern/list.c | 84 ++++++++++++++++++++++++ kern/term.c | 117 +++------------------------------ util/grub-editenv.c | 14 +--- util/grub-fstest.c | 13 +--- util/grub-probe.c | 13 +--- util/i386/pc/grub-setup.c | 13 +--- 28 files changed, 812 insertions(+), 420 deletions(-) create mode 100644 commands/handler.c delete mode 100644 commands/terminal.c create mode 100644 include/grub/handler.h create mode 100644 include/grub/list.h create mode 100644 kern/handler.c create mode 100644 kern/list.c diff --git a/ChangeLog b/ChangeLog index a9bfe66ea..6cb872350 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,106 @@ +2009-03-01 Bean + + * commands/terminal.c: Removed. + + * commands/handler.c: New file. + + * include/grub/list.h: Likewise. + + * include/grub/handler.h: Likewise. + + * kern/list.c: Likewise. + + * kern/handler.c: Likewise. + + * kern/term.h: Include header file . + (grub_term_input): Move next field to the beginning. + (grub_term_output): Likewise. + (grub_term_input_class): New variable. + (grub_term_output_class): Likewise. + (grub_term_register_input): Changed to inline function. + (grub_term_register_output): Likewise. + (grub_term_unregister_input): Likewise. + (grub_term_unregister_output): Likewise. + (grub_term_set_current_input): Likewise. + (grub_term_set_current_output): Likewise. + (grub_term_get_current_input): Likewise. + (grub_term_get_current_output): Likewise. + (grub_term_iterate_input): Removed. + (grub_term_iterate_output): Likewise. + + * kern/term.c (grub_term_list_input): Removed. + (grub_term_list_output): Likewise. + (grub_term_input_class): New variable. + (grub_term_output_class): Likewise. + (grub_cur_term_input): Change varaible as macro. + (grub_cur_term_output): Likewise. + (grub_term_register_input): Removed. + (grub_term_register_output): Likewise. + (grub_term_unregister_input): Likewise. + (grub_term_unregister_output): Likewise. + (grub_term_set_current_input): Likewise. + (grub_term_set_current_output): Likewise. + (grub_term_iterate_input): Likewise. + (grub_term_iterate_output): Likewise. + (grub_term_get_current_input): Likewise. + (grub_term_get_current_output): Likewise. + + * util/grub-editenv.c: Include header file . + (grub_term_get_current_input): Removed. + (grub_term_get_current_output): Likewise. + (grub_term_input_class): New variable. + (grub_term_outout_class): Likewise. + + * util/grub-fstest.c (grub_term_get_current_input): Removed. + (grub_term_get_current_output): Likewise. + (grub_term_input_class): New variable. + (grub_term_outout_class): Likewise. + + * util/grub-probe.c (grub_term_get_current_input): Removed. + (grub_term_get_current_output): Likewise. + (grub_term_input_class): New variable. + (grub_term_outout_class): Likewise. + + * util/i386/pc/grub-setup.c (grub_term_get_current_input): Removed. + (grub_term_get_current_output): Likewise. + (grub_term_input_class): New variable. + (grub_term_outout_class): Likewise. + + * conf/common.rmk (pkglib_MODULES): Replace terminal with handler. + (terminal_mod_SOURCES): Likewise. + (terminal_mod_CFLAGS): Likewise. + (terminal_mod_LDFLAGS): Likewise. + + * conf/i386-pc.rmk (grub_emu_SOURCES): Replace terminal.c with + handler.c. + (kernel_img_SOURCES): Add list.c and handler.c. + (kernel_img_HEADERS): Add list.h and handler.h. + + * conf/i386-efi.rmk (grub_emu_SOURCES): Replace terminal.c with + handler.c. + (kernel_mod_SOURCES): Add list.c and handler.c. + (kernel_mod_HEADERS): Add list.h and handler.h. + + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Replace terminal.c with + handler.c. + (kernel_elf_SOURCES): Add list.c and handler.c. + (kernel_elf_HEADERS): Add list.h and handler.h. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Replace terminal.c with + handler.c. + (kernel_elf_SOURCES): Add list.c and handler.c. + (kernel_elf_HEADERS): Add list.h and handler.h. + + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Replace terminal.c with + handler.c. + (kernel_mod_SOURCES): Add list.c and handler.c. + (kernel_mod_HEADERS): Add list.h and handler.h. + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Replace terminal.c with + handler.c. + (kernel_elf_SOURCES): Add list.c and handler.c. + (kernel_elf_HEADERS): Add list.h and handler.h. + 2009-02-27 Robert Millan Factorize elf32 / elf64 code in Multiboot loader. This will diff --git a/DISTLIST b/DISTLIST index 8c429a5d4..3c8bd341b 100644 --- a/DISTLIST +++ b/DISTLIST @@ -49,6 +49,7 @@ commands/crc.c commands/date.c commands/echo.c commands/halt.c +commands/handler.c commands/hdparm.c commands/help.c commands/hexdump.c @@ -159,8 +160,10 @@ include/grub/fs.h include/grub/fshelp.h include/grub/gpt_partition.h include/grub/gzio.h +include/grub/handler.h include/grub/hfs.h include/grub/kernel.h +include/grub/list.h include/grub/loader.h include/grub/lvm.h include/grub/menu.h @@ -316,6 +319,8 @@ kern/env.c kern/err.c kern/file.c kern/fs.c +kern/handler.c +kern/list.c kern/loader.c kern/main.c kern/misc.c @@ -386,14 +391,13 @@ loader/i386/bsd.c loader/i386/bsd_normal.c loader/i386/linux.c loader/i386/multiboot.c +loader/i386/multiboot_elfxx.c loader/i386/efi/linux.c loader/i386/ieee1275/linux.c loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c loader/i386/pc/multiboot2.c -loader/i386/pc/multiboot_elf32.c -loader/i386/pc/multiboot_elf64.c loader/i386/pc/multiboot_normal.c loader/ieee1275/multiboot2.c loader/powerpc/ieee1275/linux.c diff --git a/commands/handler.c b/commands/handler.c new file mode 100644 index 000000000..f30337e1f --- /dev/null +++ b/commands/handler.c @@ -0,0 +1,132 @@ +/* handler.c - test module for dynamic loading */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_err_t +grub_cmd_handler_generic (int argc, char **args, char *class_name) +{ + char *find_name; + void *find_result; + void *curr_item = 0; + grub_handler_class_t head; + + auto int list_item (grub_named_list_t item); + int list_item (grub_named_list_t item) + { + if (item == curr_item) + grub_putchar ('*'); + + grub_printf ("%s\n", item->name); + + return 0; + } + + head = grub_handler_class_list; + if ((argc == 0) && (class_name == 0)) + { + grub_list_iterate (head, (grub_list_hook_t) list_item); + } + else + { + grub_handler_class_t class; + + if (class_name == 0) + { + class_name = args[0]; + argc--; + args++; + } + + class = grub_named_list_find (GRUB_AS_NAMED_LIST (head), class_name); + if (! class) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "class not found"); + + if (argc == 0) + { + curr_item = class->cur_handler; + grub_list_iterate (class->handler_list, + (grub_list_hook_t) list_item); + } + else + { + grub_handler_t handler; + + handler = + grub_named_list_find (GRUB_AS_NAMED_LIST (class->handler_list), + args[0]); + + if (! handler) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "handler not found"); + + grub_handler_set_current (class, handler); + } + } + + return 0; +} + +static grub_err_t +grub_cmd_handler (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + return grub_cmd_handler_generic (argc, args, 0); +} + +static grub_err_t +grub_cmd_terminal_input (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + return grub_cmd_handler_generic (argc, args, "terminal_input"); +} + +static grub_err_t +grub_cmd_terminal_output (struct grub_arg_list *state __attribute__ ((unused)), + int argc, char **args) +{ + return grub_cmd_handler_generic (argc, args, "terminal_output"); +} + +GRUB_MOD_INIT(handler) +{ + (void)mod; /* To stop warning. */ + grub_register_command ("handler", grub_cmd_handler, GRUB_COMMAND_FLAG_BOTH, + "handler [class [handler]]", + "List or select a handler", 0); + grub_register_command ("terminal_input", grub_cmd_terminal_input, + GRUB_COMMAND_FLAG_BOTH, + "terminal_input [handler]", + "List or select a handler", 0); + grub_register_command ("terminal_output", grub_cmd_terminal_output, + GRUB_COMMAND_FLAG_BOTH, + "terminal_output [handler]", + "List or select a handler", 0); +} + +GRUB_MOD_FINI(handler) +{ + grub_unregister_command ("terminal_input"); + grub_unregister_command ("terminal_output"); + grub_unregister_command ("handler"); +} diff --git a/commands/terminal.c b/commands/terminal.c deleted file mode 100644 index 98e6d1132..000000000 --- a/commands/terminal.c +++ /dev/null @@ -1,132 +0,0 @@ -/* terminal.c - command to show and select a terminal */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2007,2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include - -static grub_err_t -grub_cmd_terminal_input (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_term_input_t term = 0; - - auto int print_terminal (grub_term_input_t); - auto int find_terminal (grub_term_input_t); - - int print_terminal (grub_term_input_t t) - { - grub_printf (" %s", t->name); - return 0; - } - - int find_terminal (grub_term_input_t t) - { - if (grub_strcmp (t->name, args[0]) == 0) - { - term = t; - return 1; - } - - return 0; - } - - if (argc == 0) - { - grub_printf ("Available input terminal(s):"); - grub_term_iterate_input (print_terminal); - grub_putchar ('\n'); - - grub_printf ("Current input terminal: %s\n", grub_term_get_current_input ()->name); - } - else - { - grub_term_iterate_input (find_terminal); - if (! term) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such input terminal"); - - grub_term_set_current_input (term); - } - - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_cmd_terminal_output (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_term_output_t term = 0; - - auto int print_terminal (grub_term_output_t); - auto int find_terminal (grub_term_output_t); - - int print_terminal (grub_term_output_t t) - { - grub_printf (" %s", t->name); - return 0; - } - - int find_terminal (grub_term_output_t t) - { - if (grub_strcmp (t->name, args[0]) == 0) - { - term = t; - return 1; - } - - return 0; - } - - if (argc == 0) - { - grub_printf ("Available output terminal(s):"); - grub_term_iterate_output (print_terminal); - grub_putchar ('\n'); - - grub_printf ("Current output terminal: %s\n", grub_term_get_current_output ()->name); - } - else - { - grub_term_iterate_output (find_terminal); - if (! term) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such output terminal"); - - grub_term_set_current_output (term); - } - - return GRUB_ERR_NONE; -} - - -GRUB_MOD_INIT(terminal) -{ - (void)mod; /* To stop warning. */ - grub_register_command ("terminal_input", grub_cmd_terminal_input, GRUB_COMMAND_FLAG_BOTH, - "terminal_input [TERM...]", "Select an input terminal.", 0); - grub_register_command ("terminal_output", grub_cmd_terminal_output, GRUB_COMMAND_FLAG_BOTH, - "terminal_output [TERM...]", "Select an output terminal.", 0); -} - -GRUB_MOD_FINI(terminal) -{ - grub_unregister_command ("terminal_input"); - grub_unregister_command ("terminal_output"); -} diff --git a/conf/common.mk b/conf/common.mk index 9b67944e5..b07871f78 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -2427,7 +2427,7 @@ scsi_mod_CFLAGS = $(COMMON_CFLAGS) scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. -pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ +pkglib_MODULES += hello.mod boot.mod handler.mod ls.mod \ cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ @@ -2547,62 +2547,62 @@ partmap-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCI boot_mod_CFLAGS = $(COMMON_CFLAGS) boot_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For terminal.mod. -terminal_mod_SOURCES = commands/terminal.c -CLEANFILES += terminal.mod mod-terminal.o mod-terminal.c pre-terminal.o terminal_mod-commands_terminal.o und-terminal.lst -ifneq ($(terminal_mod_EXPORTS),no) -CLEANFILES += def-terminal.lst -DEFSYMFILES += def-terminal.lst +# For handler.mod. +handler_mod_SOURCES = commands/handler.c +CLEANFILES += handler.mod mod-handler.o mod-handler.c pre-handler.o handler_mod-commands_handler.o und-handler.lst +ifneq ($(handler_mod_EXPORTS),no) +CLEANFILES += def-handler.lst +DEFSYMFILES += def-handler.lst endif -MOSTLYCLEANFILES += terminal_mod-commands_terminal.d -UNDSYMFILES += und-terminal.lst +MOSTLYCLEANFILES += handler_mod-commands_handler.d +UNDSYMFILES += und-handler.lst -terminal.mod: pre-terminal.o mod-terminal.o $(TARGET_OBJ2ELF) +handler.mod: pre-handler.o mod-handler.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-terminal.o mod-terminal.o + $(TARGET_CC) $(handler_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-handler.o mod-handler.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o +pre-handler.o: $(handler_mod_DEPENDENCIES) handler_mod-commands_handler.o -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ terminal_mod-commands_terminal.o + $(TARGET_CC) $(handler_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ handler_mod-commands_handler.o -mod-terminal.o: mod-terminal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $< +mod-handler.o: mod-handler.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -c -o $@ $< -mod-terminal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1) +mod-handler.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'handler' $< > $@ || (rm -f $@; exit 1) -ifneq ($(terminal_mod_EXPORTS),no) -def-terminal.lst: pre-terminal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminal/' > $@ +ifneq ($(handler_mod_EXPORTS),no) +def-handler.lst: pre-handler.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 handler/' > $@ endif -und-terminal.lst: pre-terminal.o - echo 'terminal' > $@ +und-handler.lst: pre-handler.o + echo 'handler' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -terminal_mod-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -MD -c -o $@ $< --include terminal_mod-commands_terminal.d +handler_mod-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -MD -c -o $@ $< +-include handler_mod-commands_handler.d -CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_terminal.lst partmap-terminal_mod-commands_terminal.lst -COMMANDFILES += cmd-terminal_mod-commands_terminal.lst -FSFILES += fs-terminal_mod-commands_terminal.lst -PARTMAPFILES += partmap-terminal_mod-commands_terminal.lst +CLEANFILES += cmd-handler_mod-commands_handler.lst fs-handler_mod-commands_handler.lst partmap-handler_mod-commands_handler.lst +COMMANDFILES += cmd-handler_mod-commands_handler.lst +FSFILES += fs-handler_mod-commands_handler.lst +PARTMAPFILES += partmap-handler_mod-commands_handler.lst -cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) +cmd-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh handler > $@ || (rm -f $@; exit 1) -fs-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) +fs-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh handler > $@ || (rm -f $@; exit 1) -partmap-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminal > $@ || (rm -f $@; exit 1) +partmap-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh handler > $@ || (rm -f $@; exit 1) -terminal_mod_CFLAGS = $(COMMON_CFLAGS) -terminal_mod_LDFLAGS = $(COMMON_LDFLAGS) +handler_mod_CFLAGS = $(COMMON_CFLAGS) +handler_mod_LDFLAGS = $(COMMON_LDFLAGS) # For ls.mod. ls_mod_SOURCES = commands/ls.c diff --git a/conf/common.rmk b/conf/common.rmk index dfd481a89..9a62ac3c5 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -330,7 +330,7 @@ scsi_mod_CFLAGS = $(COMMON_CFLAGS) scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. -pkglib_MODULES += hello.mod boot.mod terminal.mod ls.mod \ +pkglib_MODULES += hello.mod boot.mod handler.mod ls.mod \ cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ @@ -346,10 +346,10 @@ boot_mod_SOURCES = commands/boot.c boot_mod_CFLAGS = $(COMMON_CFLAGS) boot_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For terminal.mod. -terminal_mod_SOURCES = commands/terminal.c -terminal_mod_CFLAGS = $(COMMON_CFLAGS) -terminal_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For handler.mod. +handler_mod_SOURCES = commands/handler.c +handler_mod_CFLAGS = $(COMMON_CFLAGS) +handler_mod_LDFLAGS = $(COMMON_LDFLAGS) # For ls.mod. ls_mod_SOURCES = commands/ls.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 5c21b0493..60f2e34bf 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -18,7 +18,7 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ @@ -27,11 +27,11 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ term/i386/pc/vga_text.c term/i386/vga_common.c \ term/i386/pc/at_keyboard.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-term_i386_vga_common.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-term_i386_vga_common.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_coreboot_startup.o: kern/i386/coreboot/startup.S $(kern/i386/coreboot/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -97,6 +97,14 @@ kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_time.d +kernel_elf-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_list.d + +kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_handler.d + kernel_elf-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_dl.d @@ -149,7 +157,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h + machine/memory.h machine/loader.h list.h handler.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic @@ -190,7 +198,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ @@ -221,11 +229,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -251,9 +259,9 @@ grub_emu-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_help.d -grub_emu-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) +grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_terminal.d +-include grub_emu-commands_handler.d grub_emu-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index cc2b6a8e0..978df18b5 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -17,7 +17,7 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ @@ -30,7 +30,7 @@ kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h + machine/memory.h machine/loader.h list.h handler.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic @@ -57,7 +57,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 9e98098c4..53008f722 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -67,7 +67,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ @@ -127,16 +127,16 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_time.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d +MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -145,9 +145,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -639,6 +639,44 @@ partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpar set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_list.d + +CLEANFILES += cmd-kernel_mod-kern_list.lst fs-kernel_mod-kern_list.lst partmap-kernel_mod-kern_list.lst +COMMANDFILES += cmd-kernel_mod-kern_list.lst +FSFILES += fs-kernel_mod-kern_list.lst +PARTMAPFILES += partmap-kernel_mod-kern_list.lst + +cmd-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_handler.d + +CLEANFILES += cmd-kernel_mod-kern_handler.lst fs-kernel_mod-kern_handler.lst partmap-kernel_mod-kern_handler.lst +COMMANDFILES += cmd-kernel_mod-kern_handler.lst +FSFILES += fs-kernel_mod-kern_handler.lst +PARTMAPFILES += partmap-kernel_mod-kern_handler.lst + +cmd-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_tsc.d @@ -718,7 +756,7 @@ partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h + efi/efi.h efi/time.h efi/disk.h list.h handler.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 3814abb0c..7ae9c5e96 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -34,7 +34,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ @@ -88,14 +88,14 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h + efi/efi.h efi/time.h efi/disk.h list.h handler.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 504a18539..a8f3237de 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -21,17 +21,17 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c \ disk/ieee1275/ofdisk.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -125,6 +125,14 @@ kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_time.d +kernel_elf-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_list.d + +kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_handler.d + kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_generic_millisleep.d @@ -148,7 +156,8 @@ kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h + ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ + list.h handler.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic @@ -188,7 +197,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ @@ -220,11 +229,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -250,9 +259,9 @@ grub_emu-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_help.d -grub_emu-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) +grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_terminal.d +-include grub_emu-commands_handler.d grub_emu-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 903113ead..16a3fba13 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -20,7 +20,7 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c \ @@ -29,7 +29,8 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h + ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ + list.h handler.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic @@ -55,7 +56,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 8ebb7ebc3..7b567827b 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -108,7 +108,7 @@ cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ @@ -117,13 +117,13 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/env.c \ term/i386/pc/console.c term/i386/vga_common.c \ symlist.c -CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o -MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d +CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o +MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_list.d kernel_img-kern_handler.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d kernel.img: kernel.exec $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ -kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o +kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) @@ -182,6 +182,14 @@ kernel_img-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_time.d +kernel_img-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_list.d + +kernel_img-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_handler.d + kernel_img-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_dl.d @@ -239,7 +247,7 @@ kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ - machine/kernel.h machine/pxe.h + machine/kernel.h machine/pxe.h list.h handler.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) @@ -521,7 +529,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ @@ -554,11 +562,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_terminal.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_terminal.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -584,9 +592,9 @@ grub_emu-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_help.d -grub_emu-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) +grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_terminal.d +-include grub_emu-commands_handler.d grub_emu-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 34a3777b3..4221db42b 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -42,7 +42,7 @@ cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ @@ -56,7 +56,7 @@ kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ - machine/kernel.h machine/pxe.h + machine/kernel.h machine/pxe.h list.h handler.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) @@ -114,7 +114,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/i386/cpuid.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 18edeafe0..bc09bbc69 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -55,7 +55,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/search.c commands/terminal.c commands/test.c \ + commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ @@ -86,11 +86,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_terminal.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_terminal.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -116,9 +116,9 @@ grub_emu-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-commands_search.d -grub_emu-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) +grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_terminal.d +-include grub_emu-commands_handler.d grub_emu-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 51e7c07c3..bedd4e08b 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -40,7 +40,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/search.c commands/terminal.c commands/test.c \ + commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index b2095df28..a8627ca49 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -55,7 +55,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ @@ -115,16 +115,16 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_time.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d +MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -133,9 +133,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -608,6 +608,44 @@ partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpar set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_list.d + +CLEANFILES += cmd-kernel_mod-kern_list.lst fs-kernel_mod-kern_list.lst partmap-kernel_mod-kern_list.lst +COMMANDFILES += cmd-kernel_mod-kern_list.lst +FSFILES += fs-kernel_mod-kern_list.lst +PARTMAPFILES += partmap-kernel_mod-kern_list.lst + +cmd-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_handler.d + +CLEANFILES += cmd-kernel_mod-kern_handler.lst fs-kernel_mod-kern_handler.lst partmap-kernel_mod-kern_handler.lst +COMMANDFILES += cmd-kernel_mod-kern_handler.lst +FSFILES += fs-kernel_mod-kern_handler.lst +PARTMAPFILES += partmap-kernel_mod-kern_handler.lst + +cmd-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_tsc.d @@ -725,7 +763,7 @@ partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h machine/loader.h + efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 5b108d2a3..07bf1a667 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -36,7 +36,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/terminal.c commands/ls.c commands/test.c \ + commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ @@ -90,14 +90,14 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - kern/time.c \ + kern/time.c kern/list.c kern/handler.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h machine/loader.h + efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/handler.h b/include/grub/handler.h new file mode 100644 index 000000000..3331bb417 --- /dev/null +++ b/include/grub/handler.h @@ -0,0 +1,60 @@ +/* handler.h - header for grub handler */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_HANDLER_HEADER +#define GRUB_HANDLER_HEADER 1 + +#include +#include + +struct grub_handler +{ + struct grub_handler *next; + const char *name; + grub_err_t (*init) (void); + grub_err_t (*fini) (void); +}; +typedef struct grub_handler *grub_handler_t; + +struct grub_handler_class +{ + struct grub_handler_class *next; + const char *name; + grub_handler_t handler_list; + grub_handler_t cur_handler; +}; +typedef struct grub_handler_class *grub_handler_class_t; + +extern grub_handler_class_t EXPORT_VAR(grub_handler_class_list); + +void EXPORT_FUNC(grub_handler_register) (grub_handler_class_t class, + grub_handler_t handler); +void EXPORT_FUNC(grub_handler_unregister) (grub_handler_class_t class, + grub_handler_t handler); +grub_err_t EXPORT_FUNC(grub_handler_set_current) (grub_handler_class_t class, + grub_handler_t handler); + +#define GRUB_AS_HANDLER(ptr) \ + ((GRUB_FIELD_MATCH (ptr, grub_handler_t, next) && \ + GRUB_FIELD_MATCH (ptr, grub_handler_t, name) && \ + GRUB_FIELD_MATCH (ptr, grub_handler_t, init) && \ + GRUB_FIELD_MATCH (ptr, grub_handler_t, fini)) ? \ + (grub_handler_t) ptr : grub_assert_fail ()) + +#endif /* ! GRUB_HANDLER_HEADER */ diff --git a/include/grub/list.h b/include/grub/list.h new file mode 100644 index 000000000..b2af3b80b --- /dev/null +++ b/include/grub/list.h @@ -0,0 +1,69 @@ +/* list.h - header for grub list */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_LIST_HEADER +#define GRUB_LIST_HEADER 1 + +#include +#include + +struct grub_list +{ + struct grub_list *next; +}; +typedef struct grub_list *grub_list_t; + +typedef int (*grub_list_hook_t) (grub_list_t item); + +void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item); +void * EXPORT_FUNC(grub_list_pop) (grub_list_t *head); +void EXPORT_FUNC(grub_list_remove) (grub_list_t *head, grub_list_t item); +void EXPORT_FUNC(grub_list_iterate) (grub_list_t head, grub_list_hook_t hook); + +/* This function doesn't exist, so if assertion is false for some reason, the + linker would fail. */ +extern void* grub_assert_fail (void); + +#define GRUB_FIELD_MATCH(ptr, type, field) \ + ((char *) &(ptr)->field == (char *) &((type) (ptr))->field) + +#define GRUB_AS_LIST(ptr) \ + (GRUB_FIELD_MATCH (ptr, grub_list_t, next) ? \ + (grub_list_t) ptr : grub_assert_fail ()) + +#define GRUB_AS_LIST_P(pptr) \ + (GRUB_FIELD_MATCH (*pptr, grub_list_t, next) ? \ + (grub_list_t *) (void *) pptr : grub_assert_fail ()) + +struct grub_named_list +{ + struct grub_named_list *next; + const char *name; +}; +typedef struct grub_named_list *grub_named_list_t; + +void * EXPORT_FUNC(grub_named_list_find) (grub_named_list_t head, + const char *name); + +#define GRUB_AS_NAMED_LIST(ptr) \ + ((GRUB_FIELD_MATCH (ptr, grub_named_list_t, next) && \ + GRUB_FIELD_MATCH (ptr, grub_named_list_t, name))? \ + (grub_named_list_t) ptr : grub_assert_fail ()) + +#endif /* ! GRUB_LIST_HEADER */ diff --git a/include/grub/term.h b/include/grub/term.h index 13835bbbb..6a356647f 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -38,6 +38,7 @@ #include #include #include +#include /* These are used to represent the various color states we use. */ typedef enum @@ -139,6 +140,9 @@ grub_term_color_state; struct grub_term_input { + /* The next terminal. */ + struct grub_term_input *next; + /* The terminal name. */ const char *name; @@ -153,14 +157,14 @@ struct grub_term_input /* Get a character. */ int (*getkey) (void); - - /* The next terminal. */ - struct grub_term_input *next; }; typedef struct grub_term_input *grub_term_input_t; struct grub_term_output { + /* The next terminal. */ + struct grub_term_output *next; + /* The terminal name. */ const char *name; @@ -208,23 +212,61 @@ struct grub_term_output /* The feature flags defined above. */ grub_uint32_t flags; - - /* The next terminal. */ - struct grub_term_output *next; }; typedef struct grub_term_output *grub_term_output_t; -void EXPORT_FUNC(grub_term_register_input) (grub_term_input_t term); -void EXPORT_FUNC(grub_term_register_output) (grub_term_output_t term); -void EXPORT_FUNC(grub_term_unregister_input) (grub_term_input_t term); -void EXPORT_FUNC(grub_term_unregister_output) (grub_term_output_t term); -void EXPORT_FUNC(grub_term_iterate_input) (int (*hook) (grub_term_input_t term)); -void EXPORT_FUNC(grub_term_iterate_output) (int (*hook) (grub_term_output_t term)); +extern struct grub_handler_class EXPORT_VAR(grub_term_input_class); +extern struct grub_handler_class EXPORT_VAR(grub_term_output_class); -grub_err_t EXPORT_FUNC(grub_term_set_current_input) (grub_term_input_t term); -grub_err_t EXPORT_FUNC(grub_term_set_current_output) (grub_term_output_t term); -grub_term_input_t EXPORT_FUNC(grub_term_get_current_input) (void); -grub_term_output_t EXPORT_FUNC(grub_term_get_current_output) (void); +static inline void +grub_term_register_input (grub_term_input_t term) +{ + grub_handler_register (&grub_term_input_class, GRUB_AS_HANDLER (term)); +} + +static inline void +grub_term_register_output (grub_term_output_t term) +{ + grub_handler_register (&grub_term_output_class, GRUB_AS_HANDLER (term)); +} + +static inline void +grub_term_unregister_input (grub_term_input_t term) +{ + grub_handler_unregister (&grub_term_input_class, GRUB_AS_HANDLER (term)); +} + +static inline void +grub_term_unregister_output (grub_term_output_t term) +{ + grub_handler_unregister (&grub_term_output_class, GRUB_AS_HANDLER (term)); +} + +static inline grub_err_t +grub_term_set_current_input (grub_term_input_t term) +{ + return grub_handler_set_current (&grub_term_input_class, + GRUB_AS_HANDLER (term)); +} + +static inline grub_err_t +grub_term_set_current_output (grub_term_output_t term) +{ + return grub_handler_set_current (&grub_term_output_class, + GRUB_AS_HANDLER (term)); +} + +static inline grub_term_input_t +grub_term_get_current_input (void) +{ + return (grub_term_input_t) grub_term_input_class.cur_handler; +} + +static inline grub_term_output_t +grub_term_get_current_output (void) +{ + return (grub_term_output_t) grub_term_output_class.cur_handler; +} void EXPORT_FUNC(grub_putchar) (int c); void EXPORT_FUNC(grub_putcode) (grub_uint32_t code); diff --git a/kern/handler.c b/kern/handler.c new file mode 100644 index 000000000..c3ca18f24 --- /dev/null +++ b/kern/handler.c @@ -0,0 +1,64 @@ +/* handler.c - grub handler function*/ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +grub_handler_class_t grub_handler_class_list; + +void +grub_handler_register (grub_handler_class_t class, grub_handler_t handler) +{ + int first_handler = (class->handler_list == 0); + + grub_list_push (GRUB_AS_LIST_P (&class->handler_list), + GRUB_AS_LIST (handler)); + + if (first_handler) + { + grub_list_push (GRUB_AS_LIST_P (&grub_handler_class_list), + GRUB_AS_LIST (class)); + grub_handler_set_current (class, handler); + } +} + +void +grub_handler_unregister (grub_handler_class_t class, grub_handler_t handler) +{ + grub_list_remove (GRUB_AS_LIST_P (&class->handler_list), + GRUB_AS_LIST (handler)); + + if (class->handler_list == 0) + grub_list_remove (GRUB_AS_LIST_P (&grub_handler_class_list), + GRUB_AS_LIST (class)); +} + +grub_err_t +grub_handler_set_current (grub_handler_class_t class, grub_handler_t handler) +{ + if (class->cur_handler && class->cur_handler->fini) + if ((class->cur_handler->fini) () != GRUB_ERR_NONE) + return grub_errno; + + if (handler->init) + if ((handler->init) () != GRUB_ERR_NONE) + return grub_errno; + + class->cur_handler = handler; + return GRUB_ERR_NONE; +} diff --git a/kern/list.c b/kern/list.c new file mode 100644 index 000000000..b22218ee9 --- /dev/null +++ b/kern/list.c @@ -0,0 +1,84 @@ +/* list.c - grub list function*/ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +void +grub_list_push (grub_list_t *head, grub_list_t item) +{ + item->next = *head; + *head = item; +} + +void * +grub_list_pop (grub_list_t *head) +{ + grub_list_t item; + + item = *head; + if (item) + *head = item->next; + + return item; +} + +void +grub_list_remove (grub_list_t *head, grub_list_t item) +{ + grub_list_t *p, q; + + for (p = head, q = *p; q; p = &(q->next), q = q->next) + if (q == item) + { + *p = q->next; + break; + } +} + +void +grub_list_iterate (grub_list_t head, grub_list_hook_t hook) +{ + grub_list_t p; + + for (p = head; p; p = p->next) + if (hook (p)) + break; +} + +void * +grub_named_list_find (grub_named_list_t head, const char *name) +{ + grub_named_list_t result = 0; + + auto int list_find (grub_named_list_t item); + int list_find (grub_named_list_t item) + { + if (! grub_strcmp (item->name, name)) + { + result = item; + return 1; + } + + return 0; + } + + grub_list_iterate (GRUB_AS_LIST (head), (grub_list_hook_t) list_find); + return result; +} diff --git a/kern/term.c b/kern/term.c index 8d5a23b41..c7c46cf94 100644 --- a/kern/term.c +++ b/kern/term.c @@ -22,14 +22,6 @@ #include #include -/* The list of terminals. */ -static grub_term_input_t grub_term_list_input; -static grub_term_output_t grub_term_list_output; - -/* The current terminal. */ -static grub_term_input_t grub_cur_term_input; -static grub_term_output_t grub_cur_term_output; - /* The amount of lines counted by the pager. */ static int grub_more_lines; @@ -39,111 +31,18 @@ static int grub_more; /* The current cursor state. */ static int cursor_state = 1; -void -grub_term_register_input (grub_term_input_t term) -{ - term->next = grub_term_list_input; - grub_term_list_input = term; - if (! grub_cur_term_input) - grub_term_set_current_input (term); -} - -void -grub_term_register_output (grub_term_output_t term) -{ - term->next = grub_term_list_output; - grub_term_list_output = term; - if (! grub_cur_term_output) - grub_term_set_current_output (term); -} - -void -grub_term_unregister_input (grub_term_input_t term) -{ - grub_term_input_t *p, q; - - for (p = &grub_term_list_input, q = *p; q; p = &(q->next), q = q->next) - if (q == term) +struct grub_handler_class grub_term_input_class = { - *p = q->next; - break; - } -} - -void -grub_term_unregister_output (grub_term_output_t term) -{ - grub_term_output_t *p, q; + .name = "terminal_input" + }; - for (p = &grub_term_list_output, q = *p; q; p = &(q->next), q = q->next) - if (q == term) +struct grub_handler_class grub_term_output_class = { - *p = q->next; - break; - } -} - -void -grub_term_iterate_input (int (*hook) (grub_term_input_t term)) -{ - grub_term_input_t p; + .name = "terminal_output" + }; - for (p = grub_term_list_input; p; p = p->next) - if (hook (p)) - break; -} - -void -grub_term_iterate_output (int (*hook) (grub_term_output_t term)) -{ - grub_term_output_t p; - - for (p = grub_term_list_output; p; p = p->next) - if (hook (p)) - break; -} - -grub_err_t -grub_term_set_current_input (grub_term_input_t term) -{ - if (grub_cur_term_input && grub_cur_term_input->fini) - if ((grub_cur_term_input->fini) () != GRUB_ERR_NONE) - return grub_errno; - - if (term->init) - if ((term->init) () != GRUB_ERR_NONE) - return grub_errno; - - grub_cur_term_input = term; - return GRUB_ERR_NONE; -} - -grub_err_t -grub_term_set_current_output (grub_term_output_t term) -{ - if (grub_cur_term_output && grub_cur_term_output->fini) - if ((grub_cur_term_output->fini) () != GRUB_ERR_NONE) - return grub_errno; - - if (term->init) - if ((term->init) () != GRUB_ERR_NONE) - return grub_errno; - - grub_cur_term_output = term; - return GRUB_ERR_NONE; -} - -grub_term_input_t -grub_term_get_current_input (void) -{ - return grub_cur_term_input; -} - -grub_term_output_t -grub_term_get_current_output (void) -{ - return grub_cur_term_output; -} +#define grub_cur_term_input grub_term_get_current_input () +#define grub_cur_term_output grub_term_get_current_output () /* Put a Unicode character. */ void diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 475d12d12..1ffeb32ca 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -21,6 +21,7 @@ #include #include #include +#include #include #include @@ -40,17 +41,8 @@ grub_refresh (void) fflush (stdout); } -void * -grub_term_get_current_input (void) -{ - return 0; -} - -void * -grub_term_get_current_output (void) -{ - return 0; -} +struct grub_handler_class grub_term_input_class; +struct grub_handler_class grub_term_output_class; int grub_getkey (void) diff --git a/util/grub-fstest.c b/util/grub-fstest.c index ca25425ae..76cefa6af 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -53,17 +53,8 @@ grub_getkey (void) return -1; } -grub_term_input_t -grub_term_get_current_input (void) -{ - return 0; -} - -grub_term_output_t -grub_term_get_current_output (void) -{ - return 0; -} +struct grub_handler_class grub_term_input_class; +struct grub_handler_class grub_term_output_class; void grub_refresh (void) diff --git a/util/grub-probe.c b/util/grub-probe.c index 402b75839..4811d7b9e 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -66,17 +66,8 @@ grub_getkey (void) return -1; } -grub_term_input_t -grub_term_get_current_input (void) -{ - return 0; -} - -grub_term_output_t -grub_term_get_current_output (void) -{ - return 0; -} +struct grub_handler_class grub_term_input_class; +struct grub_handler_class grub_term_output_class; void grub_refresh (void) diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 295e30ad9..1421297b8 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -74,17 +74,8 @@ grub_getkey (void) return -1; } -grub_term_input_t -grub_term_get_current_input (void) -{ - return 0; -} - -grub_term_output_t -grub_term_get_current_output (void) -{ - return 0; -} +struct grub_handler_class grub_term_input_class; +struct grub_handler_class grub_term_output_class; void grub_refresh (void) From 9902d0472567094a6419586ffaf0cd33c82ed4ea Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 1 Mar 2009 17:57:57 +0000 Subject: [PATCH 0549/1707] 2009-03-01 Bean * include/grub/efi/api.h (GRUB_EFI_MPS_TABALE_GUID): New constant. (GRUB_EFI_ACPI_TABLE_GUID): Likewise. (GRUB_EFI_ACPI_20_TABLE_GUID): Likewise. (GRUB_EFI_SMBIOS_TABLE_GUID): Likewise. * loader/i386/efi/linux.c (acpi_guid): New variable. (acpi_guid): Likewise. (EBDA_SEG_ADDR): New constant. (LOW_MEM_ADDR): Likewise. (FAKE_EBDA_SEG): Likewise. (fake_bios_data): New function. (grub_linux_boot): Call fake_bios_data. --- ChangeLog | 15 +++++++++++ include/grub/efi/api.h | 20 +++++++++++++++ loader/i386/efi/linux.c | 57 +++++++++++++++++++++++++++++++++++++++-- 3 files changed, 90 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cb872350..098840de5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-03-01 Bean + + * include/grub/efi/api.h (GRUB_EFI_MPS_TABALE_GUID): New constant. + (GRUB_EFI_ACPI_TABLE_GUID): Likewise. + (GRUB_EFI_ACPI_20_TABLE_GUID): Likewise. + (GRUB_EFI_SMBIOS_TABLE_GUID): Likewise. + + * loader/i386/efi/linux.c (acpi_guid): New variable. + (acpi_guid): Likewise. + (EBDA_SEG_ADDR): New constant. + (LOW_MEM_ADDR): Likewise. + (FAKE_EBDA_SEG): Likewise. + (fake_bios_data): New function. + (grub_linux_boot): Call fake_bios_data. + 2009-03-01 Bean * commands/terminal.c: Removed. diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 50556bfe7..a764b370d 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -88,6 +88,26 @@ { 0x8e, 0x39, 0x00, 0xa0, 0xc9, 0x69, 0x72, 0x3b } \ } +#define GRUB_EFI_MPS_TABLE_GUID \ + { 0xeb9d2d2f, 0x2d88, 0x11d3, \ + { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + } + +#define GRUB_EFI_ACPI_TABLE_GUID \ + { 0xeb9d2d30, 0x2d88, 0x11d3, \ + { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + } + +#define GRUB_EFI_ACPI_20_TABLE_GUID \ + { 0x8868e871, 0xe4f1, 0x11d3, \ + { 0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81 } \ + } + +#define GRUB_EFI_SMBIOS_TABLE_GUID \ + { 0xeb9d2d31, 0x2d88, 0x11d3, \ + { 0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d } \ + } + /* Enumerations. */ enum grub_efi_timer_delay { diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 4528c216e..cd6f3a59f 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -283,6 +283,57 @@ grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, } } +static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; +static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; + +#define EBDA_SEG_ADDR 0x40e +#define LOW_MEM_ADDR 0x413 +#define FAKE_EBDA_SEG 0x9fc0 + +static void +fake_bios_data (void) +{ + unsigned i; + void *acpi; + grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; + + acpi = 0; + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + { + grub_efi_guid_t *guid = + &grub_efi_system_table->configuration_table[i].vendor_guid; + + if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) + { + acpi = grub_efi_system_table->configuration_table[i].vendor_table; + grub_printf ("ACPI2: %p\n", acpi); + } + else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) + { + void *t; + + t = grub_efi_system_table->configuration_table[i].vendor_table; + if (! acpi) + acpi = t; + grub_printf ("ACPI: %p\n", t); + } + } + + if (acpi == 0) + return; + + ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; + low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; + + if ((*ebda_seg_ptr) || (*low_mem_ptr)) + return; + + *ebda_seg_ptr = FAKE_EBDA_SEG; + *low_mem_ptr = FAKE_EBDA_SEG >> 6; + + grub_memcpy ((char *) (FAKE_EBDA_SEG << 4), acpi, 1024); +} + #ifdef __x86_64__ struct { @@ -302,6 +353,8 @@ grub_linux_boot (void) grub_efi_memory_descriptor_t *desc; int e820_num; + fake_bios_data (); + params = real_mode_mem; grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", @@ -522,8 +575,8 @@ grub_linux_setup_video (struct linux_kernel_params *params) grub_efi_set_text_mode (0); pixel = RGB_MAGIC; - efi_call_10 (c->blt, c, &pixel, GRUB_EFI_UGA_VIDEO_FILL, - 0, 0, 0, 0, 1, height, 0); + efi_call_10 (c->blt, c, (struct grub_efi_uga_pixel *) &pixel, + GRUB_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0); ret = find_framebuf (&fb_base, &line_len); grub_efi_set_text_mode (1); From f501677cb2c4a6c8bd3c57b0733387d305c80fd5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 3 Mar 2009 19:00:41 +0000 Subject: [PATCH 0550/1707] 2009-03-03 Robert Millan Move more components to the relocation area, and fix mbi pointer handling to use the destination rather than the origin (thanks to Vladimir Serbinenko for spotting). * loader/i386/multiboot.c (mbi_dest): New variable. (grub_multiboot_boot): Use `mbi_dest' instead of `mbi'. (grub_multiboot): Put cmdline, boot_loader_name and mbi in the relocation area. --- ChangeLog | 11 ++++++++++ loader/i386/multiboot.c | 45 +++++++++++++++++++++++++---------------- 2 files changed, 39 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 098840de5..329d82156 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-03-03 Robert Millan + + Move more components to the relocation area, and fix mbi pointer + handling to use the destination rather than the origin (thanks to + Vladimir Serbinenko for spotting). + + * loader/i386/multiboot.c (mbi_dest): New variable. + (grub_multiboot_boot): Use `mbi_dest' instead of `mbi'. + (grub_multiboot): Put cmdline, boot_loader_name and mbi in the + relocation area. + 2009-03-01 Bean * include/grub/efi/api.h (GRUB_EFI_MPS_TABALE_GUID): New constant. diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 24c8b2183..7a2f100e4 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -44,7 +44,7 @@ #include extern grub_dl_t my_mod; -static struct grub_multiboot_info *mbi; +static struct grub_multiboot_info *mbi, *mbi_dest; static grub_addr_t entry; static char *playground = NULL; @@ -52,7 +52,7 @@ static char *playground = NULL; static grub_err_t grub_multiboot_boot (void) { - grub_multiboot_real_boot (entry, mbi); + grub_multiboot_real_boot (entry, mbi_dest); /* Not reached. */ return GRUB_ERR_NONE; @@ -195,7 +195,7 @@ grub_multiboot (int argc, char *argv[]) grub_file_t file = 0; char buffer[MULTIBOOT_SEARCH], *cmdline = 0, *p; struct grub_multiboot_header *header; - grub_ssize_t len; + grub_ssize_t len, cmdline_length, boot_loader_name_length; grub_uint32_t mmap_length; int i; @@ -253,7 +253,22 @@ grub_multiboot (int argc, char *argv[]) mmap_length = grub_get_multiboot_mmap_len (); - grub_multiboot_payload_size = sizeof (struct grub_multiboot_info) + mmap_length + MULTIBOOT_INFO_ALIGN; + /* Figure out cmdline length. */ + for (i = 0, cmdline_length = 0; i < argc; i++) + cmdline_length += grub_strlen (argv[i]) + 1; + + boot_loader_name_length = sizeof(PACKAGE_STRING); + +#define cmdline_addr(x) ((void *) ((x) + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info) - boot_loader_name_length - cmdline_length)) +#define boot_loader_name_addr(x) \ + ((void *) ((x) + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info) - boot_loader_name_length)) +#define mbi_addr(x) ((void *) ((x) + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info))) +#define mmap_addr(x) ((void *) ((x) + grub_multiboot_payload_size - mmap_length)) + + /* This provides alignment for the MBI, the memory map and the backward relocator. */ + boot_loader_name_length += (ALIGN_UP (mbi_addr (0), 4) - (unsigned long) mbi_addr (0)); + + grub_multiboot_payload_size = cmdline_length + boot_loader_name_length + sizeof (struct grub_multiboot_info) + mmap_length; if (header->flags & MULTIBOOT_AOUT_KLUDGE) { @@ -291,19 +306,16 @@ grub_multiboot (int argc, char *argv[]) else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE) goto fail; - grub_multiboot_payload_size = ALIGN_UP (grub_multiboot_payload_size, MULTIBOOT_INFO_ALIGN); - - mbi = (void *) (grub_multiboot_payload_orig + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info)); + mbi = mbi_addr (grub_multiboot_payload_orig); + mbi_dest = mbi_addr (grub_multiboot_payload_dest); grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); mbi->mmap_length = mmap_length; - grub_fill_multiboot_mmap ((struct grub_multiboot_mmap_entry *) (grub_multiboot_payload_orig - + grub_multiboot_payload_size - - mbi->mmap_length)); + grub_fill_multiboot_mmap (mmap_addr (grub_multiboot_payload_orig)); /* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated by the spec. Is there something we can do about it? */ - mbi->mmap_addr = grub_multiboot_payload_dest + grub_multiboot_payload_size - mbi->mmap_length; + mbi->mmap_addr = mmap_addr (grub_multiboot_payload_dest); mbi->flags |= MULTIBOOT_INFO_MEM_MAP; if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) @@ -328,10 +340,7 @@ grub_multiboot (int argc, char *argv[]) mbi->mem_upper = grub_upper_mem / 1024; mbi->flags |= MULTIBOOT_INFO_MEMORY; - for (i = 0, len = 0; i < argc; i++) - len += grub_strlen (argv[i]) + 1; - - cmdline = p = grub_malloc (len); + cmdline = p = cmdline_addr (grub_multiboot_payload_orig); if (! cmdline) goto fail; @@ -345,10 +354,12 @@ grub_multiboot (int argc, char *argv[]) *(--p) = '\0'; mbi->flags |= MULTIBOOT_INFO_CMDLINE; - mbi->cmdline = (grub_uint32_t) cmdline; + mbi->cmdline = (grub_uint32_t) cmdline_addr (grub_multiboot_payload_dest); + + grub_strcpy (boot_loader_name_addr (grub_multiboot_payload_orig), PACKAGE_STRING); mbi->flags |= MULTIBOOT_INFO_BOOT_LOADER_NAME; - mbi->boot_loader_name = (grub_uint32_t) grub_strdup (PACKAGE_STRING); + mbi->boot_loader_name = (grub_uint32_t) boot_loader_name_addr (grub_multiboot_payload_dest); if (grub_multiboot_get_bootdev (&mbi->boot_device)) mbi->flags |= MULTIBOOT_INFO_BOOTDEV; From 7e9ca17ace0d997114bdcba57196265b7a910085 Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 4 Mar 2009 05:56:31 +0000 Subject: [PATCH 0551/1707] 2009-03-04 Bean * configure.ac: Only test -mcmodel=large option in x86_64-efi, also add another option -mno-red-zone. * commands/handler.c: Change module description. * kern/handler.c: Add missing space at the end of description line. * kern/list.c: Likewise. --- ChangeLog | 11 +++++++ DISTLIST | 1 - commands/handler.c | 2 +- configure | 71 ++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 23 +++++++++++++-- kern/handler.c | 2 +- kern/list.c | 2 +- 7 files changed, 102 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 329d82156..4968e0d3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-03-04 Bean + + * configure.ac: Only test -mcmodel=large option in x86_64-efi, also add + another option -mno-red-zone. + + * commands/handler.c: Change module description. + + * kern/handler.c: Add missing space at the end of description line. + + * kern/list.c: Likewise. + 2009-03-03 Robert Millan Move more components to the relocation area, and fix mbi pointer diff --git a/DISTLIST b/DISTLIST index 3c8bd341b..fbe6aef5b 100644 --- a/DISTLIST +++ b/DISTLIST @@ -61,7 +61,6 @@ commands/read.c commands/reboot.c commands/search.c commands/sleep.c -commands/terminal.c commands/test.c commands/usbtest.c commands/videotest.c diff --git a/commands/handler.c b/commands/handler.c index f30337e1f..cb1e7baea 100644 --- a/commands/handler.c +++ b/commands/handler.c @@ -1,4 +1,4 @@ -/* handler.c - test module for dynamic loading */ +/* handler.c - commands to list or select handlers */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. diff --git a/configure b/configure index c3677c687..b24958080 100644 --- a/configure +++ b/configure @@ -6774,6 +6774,12 @@ fi if test "x$target_m64" = x1; then # Force 64-bit mode. + TARGET_CFLAGS="$TARGET_CFLAGS -m64" + TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" +fi + +if test "$target_cpu"-"$platform" = x86_64-efi; then + # Use large model to support 4G memory { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; } if test "${grub_cv_cc_mcmodel+set}" = set; then @@ -6826,13 +6832,72 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; } - if test "x$grub_cv_cc_mcmodel" = xno; then + if test "x$grub_cv_cc_no_mcmodel" = xno; then { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi - TARGET_CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large" - TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" + + # EFI writes to stack below %rsp, we must not use the red zone + { echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 +echo $ECHO_N "checking whether option -mno-red-zone works... $ECHO_C" >&6; } +if test "${grub_cv_cc_no_red_zone+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + + CFLAGS="-m64 -mno-red-zone" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + grub_cv_cc_no_red_zone=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + grub_cv_cc_no_red_zone=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + +fi +{ echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 +echo "${ECHO_T}$grub_cv_cc_no_red_zone" >&6; } + if test "x$grub_cv_cc_no_red_zone" = xno; then + { { echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 +echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} + { (exit 1); exit 1; }; } + fi + + TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large -mno-red-zone" fi # diff --git a/configure.ac b/configure.ac index fd89d302a..0220898c6 100644 --- a/configure.ac +++ b/configure.ac @@ -299,17 +299,34 @@ fi if test "x$target_m64" = x1; then # Force 64-bit mode. + TARGET_CFLAGS="$TARGET_CFLAGS -m64" + TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" +fi + +if test "$target_cpu"-"$platform" = x86_64-efi; then + # Use large model to support 4G memory AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ CFLAGS="-m64 -mcmodel=large" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_mcmodel=yes], [grub_cv_cc_mcmodel=no]) ]) - if test "x$grub_cv_cc_mcmodel" = xno; then + if test "x$grub_cv_cc_no_mcmodel" = xno; then AC_MSG_ERROR([-mcmodel=large not supported, upgrade your gcc]) fi - TARGET_CFLAGS="$TARGET_CFLAGS -m64 -mcmodel=large" - TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" + + # EFI writes to stack below %rsp, we must not use the red zone + AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ + CFLAGS="-m64 -mno-red-zone" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_no_red_zone=yes], + [grub_cv_cc_no_red_zone=no]) + ]) + if test "x$grub_cv_cc_no_red_zone" = xno; then + AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc]) + fi + + TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large -mno-red-zone" fi # diff --git a/kern/handler.c b/kern/handler.c index c3ca18f24..2bf85313c 100644 --- a/kern/handler.c +++ b/kern/handler.c @@ -1,4 +1,4 @@ -/* handler.c - grub handler function*/ +/* handler.c - grub handler function */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. diff --git a/kern/list.c b/kern/list.c index b22218ee9..41f55740b 100644 --- a/kern/list.c +++ b/kern/list.c @@ -1,4 +1,4 @@ -/* list.c - grub list function*/ +/* list.c - grub list function */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. From 2a54b559179a0bcfa302f68537d07fd0514eb67b Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 4 Mar 2009 10:25:31 +0000 Subject: [PATCH 0552/1707] 2009-03-04 Felix Zielcke * util/misc.c: Include . (grub_millisleep): New function. --- util/misc.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/util/misc.c b/util/misc.c index 559022ff1..8d7d0808b 100644 --- a/util/misc.c +++ b/util/misc.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -310,6 +311,16 @@ grub_get_time_ms (void) return (tv.tv_sec * 1000 + tv.tv_usec / 1000); } +void +grub_millisleep (grub_uint32_t ms) +{ + struct timespec ts; + + ts.tv_sec = ms / 1000; + ts.tv_nsec = (ms % 1000) * 1000000; + nanosleep (&ts, NULL); +} + void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) From 4910684af335d5dbc6dc6a55e0f06d4f6f9e60dd Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 4 Mar 2009 12:44:18 +0000 Subject: [PATCH 0553/1707] args forgot Changelog entry in previous commit --- ChangeLog | 5 +++++ partmap/pc.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4968e0d3c..f0f26e1f2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-04 Felix Zielcke + + * util/misc.c: Include . + (grub_millisleep): New function. + 2009-03-04 Bean * configure.ac: Only test -mcmodel=large option in x86_64-efi, also add diff --git a/partmap/pc.c b/partmap/pc.c index 419775a21..d7e1da162 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -160,9 +160,10 @@ pc_partition_map_iterate (grub_disk_t disk, { /* Check if the BSD label is within the DOS partition. */ if (p.len <= GRUB_PC_PARTITION_BSD_LABEL_SECTOR) - return grub_error (GRUB_ERR_BAD_PART_TABLE, - "no space for disk label"); - + { + grub_dprintf ("partition", "no space for disk label\n"); + continue; + } /* Read the BSD label. */ if (grub_disk_read (&raw, (p.start @@ -175,10 +176,12 @@ pc_partition_map_iterate (grub_disk_t disk, /* Check if it is valid. */ if (label.magic != grub_cpu_to_le32 (GRUB_PC_PARTITION_BSD_LABEL_MAGIC)) - return grub_error (GRUB_ERR_BAD_PART_TABLE, - "invalid disk label magic 0x%x", - label.magic); - + { + grub_dprintf ("partition", + "invalid disk label magic 0x%x on partition %d\n", + label.magic, p.index); + continue; + } for (pcdata.bsd_part = 0; pcdata.bsd_part < grub_cpu_to_le16 (label.num_partitions); pcdata.bsd_part++) From ceb1223c92ffcfb2900109228ef4e73004a04587 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 4 Mar 2009 12:45:41 +0000 Subject: [PATCH 0554/1707] 2009-03-04 Felix Zielcke * partmap/pc.c (pc_partition_map_iterate): Skip over invalid BSD partitions or if there's no space for the disk label and print the partition number on a invalid magic. --- ChangeLog | 6 ++++++ partmap/pc.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f0f26e1f2..53594779b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-04 Felix Zielcke + + * partmap/pc.c (pc_partition_map_iterate): Skip over invalid BSD partitions + or if there's no space for the disk label and print the partition number on a + invalid magic. + 2009-03-04 Felix Zielcke * util/misc.c: Include . diff --git a/partmap/pc.c b/partmap/pc.c index d7e1da162..38aa75278 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -1,7 +1,7 @@ /* pc.c - Read PC style partition tables. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From 2ba60b6286e4010db8453684599185f1422c0491 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 4 Mar 2009 14:08:05 +0000 Subject: [PATCH 0555/1707] 2009-02-03 Felix Zielcke * conf/i386-pc.rmk (grub_emu_SOURCES): Add `kern/list.c' and `kern/handler.c'. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. --- ChangeLog | 11 +++++++++++ conf/i386-coreboot.mk | 18 +++++++++++++----- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.mk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.mk | 18 +++++++++++++----- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.mk | 18 +++++++++++++----- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.mk | 18 +++++++++++++----- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.mk | 1 + conf/sparc64-ieee1275.rmk | 1 + conf/x86_64-efi.mk | 2 +- conf/x86_64-efi.rmk | 2 +- 15 files changed, 73 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 53594779b..baac88f4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-02-03 Felix Zielcke + + * conf/i386-pc.rmk (grub_emu_SOURCES): Add `kern/list.c' and + `kern/handler.c'. + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + 2009-03-04 Felix Zielcke * partmap/pc.c (pc_partition_map_iterate): Skip over invalid BSD partitions diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 60f2e34bf..dda08a30c 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -211,7 +211,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/fshelp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ @@ -229,11 +229,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -403,6 +403,14 @@ grub_emu-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_err.d +grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_list.d + +grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_handler.d + grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_execute.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 978df18b5..e68bed335 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -70,7 +70,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/fshelp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 53008f722..d13d08597 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -80,7 +80,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 7ae9c5e96..1c372cd26 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -47,7 +47,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index a8f3237de..3e7f34e6b 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -211,7 +211,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/fshelp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ @@ -229,11 +229,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -411,6 +411,14 @@ grub_emu-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_err.d +grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_list.d + +grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_handler.d + grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_execute.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 16a3fba13..089055cea 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -70,7 +70,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ fs/fshelp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 7b567827b..e122e7021 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -538,7 +538,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ @@ -562,11 +562,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -676,6 +676,14 @@ grub_emu-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_err.d +grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_list.d + +grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_handler.d + grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_execute.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 4221db42b..c996e45e2 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -123,7 +123,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index bc09bbc69..ea3ea4e84 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -69,7 +69,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ - kern/term.c fs/fshelp.c \ + kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ @@ -86,11 +86,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -292,6 +292,14 @@ grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_term.d +grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_list.d + +grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_handler.d + grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index bedd4e08b..e9c6066f6 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -54,7 +54,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ - kern/term.c fs/fshelp.c \ + kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ normal/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index ce49690e9..60110aa7b 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -56,6 +56,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ # kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ # kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ +# kern/list.c kern/handler.c \ # normal/arg.c normal/cmdline.c normal/command.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 640ceda63..1658a66bb 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -55,6 +55,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ # kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ # kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ +# kern/list.c kern/handler.c \ # normal/arg.c normal/cmdline.c normal/command.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index a8627ca49..608407115 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -68,7 +68,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 07bf1a667..47132f714 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -49,7 +49,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c \ + kern/err.c kern/list.c kern/handler.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ From eabc95fb9a78ce57c9d6f5190cd4b9e35246d798 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 4 Mar 2009 14:49:44 +0000 Subject: [PATCH 0556/1707] fix date of previous changelog entry --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index baac88f4f..7c4975298 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2009-02-03 Felix Zielcke +2009-03-04 Felix Zielcke * conf/i386-pc.rmk (grub_emu_SOURCES): Add `kern/list.c' and `kern/handler.c'. From 9304eef146537ab0cf9a28ec1e98634235708934 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 4 Mar 2009 22:00:41 +0000 Subject: [PATCH 0557/1707] 2009-03-04 Robert Millan Filter /etc/grub.d/10_* so that only add-ons for native kernels are installed. * Makefile.in (host_kernel): New variable. * conf/common.rmk (grub-mkconfig_SCRIPTS): Conditionalize all 10_*.in scripts instead of just the windows one. * configure.ac: Initialize and AC_SUBST `host_kernel'. --- ChangeLog | 10 ++++++++++ Makefile.in | 1 + conf/common.mk | 6 +++--- conf/common.rmk | 6 +++--- configure | 15 ++++++++++++++- configure.ac | 11 +++++++++++ 6 files changed, 42 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7c4975298..9047b44f9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-03-04 Robert Millan + + Filter /etc/grub.d/10_* so that only add-ons for native kernels are + installed. + + * Makefile.in (host_kernel): New variable. + * conf/common.rmk (grub-mkconfig_SCRIPTS): Conditionalize all 10_*.in + scripts instead of just the windows one. + * configure.ac: Initialize and AC_SUBST `host_kernel'. + 2009-03-04 Felix Zielcke * conf/i386-pc.rmk (grub_emu_SOURCES): Add `kern/list.c' and diff --git a/Makefile.in b/Makefile.in index 44dc57795..28aa38506 100644 --- a/Makefile.in +++ b/Makefile.in @@ -48,6 +48,7 @@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ host_os = @host_os@ +host_kernel = @host_kernel@ host_cpu = @host_cpu@ target_cpu = @target_cpu@ diff --git a/conf/common.mk b/conf/common.mk index b07871f78..b16daf520 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -578,9 +578,9 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 10_freebsd 30_os-prober 40_custom -ifeq ($(host_os), cygwin) -grub-mkconfig_SCRIPTS += 10_windows +grub-mkconfig_SCRIPTS = 00_header 30_os-prober 40_custom +ifneq (, $(host_kernel)) +grub-mkconfig_SCRIPTS += 10_$(host_kernel) endif CLEANFILES += $(grub-mkconfig_SCRIPTS) diff --git a/conf/common.rmk b/conf/common.rmk index 9a62ac3c5..857d8b869 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -145,9 +145,9 @@ CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status ./config.status --file=$@:$< chmod +x $@ -grub-mkconfig_SCRIPTS = 00_header 10_linux 10_hurd 10_freebsd 30_os-prober 40_custom -ifeq ($(host_os), cygwin) -grub-mkconfig_SCRIPTS += 10_windows +grub-mkconfig_SCRIPTS = 00_header 30_os-prober 40_custom +ifneq (, $(host_kernel)) +grub-mkconfig_SCRIPTS += 10_$(host_kernel) endif CLEANFILES += $(grub-mkconfig_SCRIPTS) diff --git a/configure b/configure index b24958080..89b564ae3 100644 --- a/configure +++ b/configure @@ -664,6 +664,7 @@ target target_cpu target_vendor target_os +host_kernel platform CMP YACC @@ -2006,6 +2007,17 @@ case "$host_os" in mingw32) host_os=cygwin ;; esac +# This normalizes the names, and creates a new variable ("host_kernel") +# while at it, since the mapping is not always 1:1 (e.g. different OSes +# using the same kernel type). +case "$host_os" in + gnu*) host_kernel=hurd ;; + linux*) host_kernel=linux ;; + freebsd* | kfreebsd*-gnu) host_kernel=freebsd ;; + cygwin) host_kernel=windows ;; +esac + + @@ -9528,6 +9540,7 @@ target!$target$ac_delim target_cpu!$target_cpu$ac_delim target_vendor!$target_vendor$ac_delim target_os!$target_os$ac_delim +host_kernel!$host_kernel$ac_delim platform!$platform$ac_delim CMP!$CMP$ac_delim YACC!$YACC$ac_delim @@ -9577,7 +9590,7 @@ LIBOBJS!$LIBOBJS$ac_delim LTLIBOBJS!$LTLIBOBJS$ac_delim _ACEOF - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then break elif $ac_last_try; then { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 diff --git a/configure.ac b/configure.ac index 0220898c6..134e0a339 100644 --- a/configure.ac +++ b/configure.ac @@ -103,8 +103,19 @@ case "$host_os" in mingw32) host_os=cygwin ;; esac +# This normalizes the names, and creates a new variable ("host_kernel") +# while at it, since the mapping is not always 1:1 (e.g. different OSes +# using the same kernel type). +case "$host_os" in + gnu*) host_kernel=hurd ;; + linux*) host_kernel=linux ;; + freebsd* | kfreebsd*-gnu) host_kernel=freebsd ;; + cygwin) host_kernel=windows ;; +esac + AC_SUBST(host_cpu) AC_SUBST(host_os) +AC_SUBST(host_kernel) AC_SUBST(target_cpu) AC_SUBST(platform) From 50fb7002e5f8af4467ee1416ca6bccf8bdde0e25 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 5 Mar 2009 05:23:58 +0000 Subject: [PATCH 0558/1707] Fix typos, spacing --- ChangeLog | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9047b44f9..1e472cfa4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -54,7 +54,7 @@ 2009-03-01 Bean - * include/grub/efi/api.h (GRUB_EFI_MPS_TABALE_GUID): New constant. + * include/grub/efi/api.h (GRUB_EFI_MPS_TABLE_GUID): New constant. (GRUB_EFI_ACPI_TABLE_GUID): Likewise. (GRUB_EFI_ACPI_20_TABLE_GUID): Likewise. (GRUB_EFI_SMBIOS_TABLE_GUID): Likewise. @@ -101,7 +101,7 @@ (grub_term_list_output): Likewise. (grub_term_input_class): New variable. (grub_term_output_class): Likewise. - (grub_cur_term_input): Change varaible as macro. + (grub_cur_term_input): Change variable as macro. (grub_cur_term_output): Likewise. (grub_term_register_input): Removed. (grub_term_register_output): Likewise. @@ -118,22 +118,22 @@ (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. - (grub_term_outout_class): Likewise. + (grub_term_output_class): Likewise. * util/grub-fstest.c (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. - (grub_term_outout_class): Likewise. + (grub_term_output_class): Likewise. * util/grub-probe.c (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. - (grub_term_outout_class): Likewise. + (grub_term_output_class): Likewise. * util/i386/pc/grub-setup.c (grub_term_get_current_input): Removed. (grub_term_get_current_output): Likewise. (grub_term_input_class): New variable. - (grub_term_outout_class): Likewise. + (grub_term_output_class): Likewise. * conf/common.rmk (pkglib_MODULES): Replace terminal with handler. (terminal_mod_SOURCES): Likewise. @@ -201,7 +201,7 @@ Patch from Alexandre Bique * util/i386/pc/grub-setup.c (setup): Fix directory path. -2009-02-27 Krzysztof Smiechowicz +2009-02-27 Krzysztof Smiechowicz * fs/sfs.c (grub_sfs_read_extent): Correction to traversing extent b-tree. @@ -416,7 +416,7 @@ 2009-02-09 Felix Zielcke * conf/common.rmk (grub_probe_SOURCES): Move fs/ext2.c before fs/fat.c - to avoid false posivites with FAT. + to avoid false positives with FAT. (grub_fstest_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. @@ -477,11 +477,11 @@ * commands/usbtest.c: Likewise. * util/usb.c: Likewise. - + * include/grub/err.h (grub_err_t): Add `GRUB_ERR_IO'. * configure.ac: Test for libusb presence. - + * util/grub-emu.c (main) [HAVE_LIBUSB_H]: Call `grub_libusb_init'. 2009-02-08 Vesa Jääskeläinen @@ -506,7 +506,7 @@ Based on patch from Javier Martín, with some adjustments. -2009-02-07 Michael Scherer +2009-02-07 Michael Scherer * fs/hfs.c (grub_hfsplus_iterate_dir): Treat hfs+ as case insensitive. @@ -518,7 +518,7 @@ 2009-02-05 Vesa Jääskeläinen - Fixes problem when running vbetest command as reported by + Fixes problem when running vbetest command as reported by Vladimir Serbinenko . * (grub_vbe_set_video_mode): Fixed problem with text modes. From b362c9e9908c1688802d1f52d77cc91f970d235f Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 6 Mar 2009 19:10:23 +0000 Subject: [PATCH 0559/1707] 2009-03-06 Robert Millan Fix display issue on terminals with screen size other than 80x25 (e.g. gfxterm with resolution higher than 640x480). * normal/main.c (grub_normal_init_page): Display title text in a position relative to the center of the terminal instead of reliing on a hardcoded offset. --- ChangeLog | 9 +++++++++ normal/main.c | 18 +++++++++++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e472cfa4..5d81a1e42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-03-06 Robert Millan + + Fix display issue on terminals with screen size other than 80x25 + (e.g. gfxterm with resolution higher than 640x480). + + * normal/main.c (grub_normal_init_page): Display title text in a + position relative to the center of the terminal instead of reliing + on a hardcoded offset. + 2009-03-04 Robert Millan Filter /etc/grub.d/10_* so that only add-ons for native kernels are diff --git a/normal/main.c b/normal/main.c index a0c013555..ea60b8374 100644 --- a/normal/main.c +++ b/normal/main.c @@ -389,10 +389,22 @@ grub_enter_normal_mode (const char *config) void grub_normal_init_page (void) { + grub_uint8_t width, margin; + +#define TITLE ("GNU GRUB version " PACKAGE_VERSION) + + width = grub_getwh () >> 8; + margin = (width - (sizeof(TITLE) + 7)) / 2; + grub_cls (); - grub_printf ("\n\ - GNU GRUB version %s\n\n", - PACKAGE_VERSION); + grub_putchar ('\n'); + + while (margin--) + grub_putchar (' '); + + grub_printf ("%s\n\n", TITLE); + +#undef TITLE } /* Read the file command.lst for auto-loading. */ From d8b3b60eeaa0eaf954316c2c81fa87d2430d3cb0 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 7 Mar 2009 10:50:43 +0000 Subject: [PATCH 0560/1707] 2009-03-07 Bean * loader/i386/efi/linux.c (grub_rescue_cmd_initrd): Fix a bug in initrd allocation. --- ChangeLog | 5 +++++ loader/i386/efi/linux.c | 10 +++++++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5d81a1e42..2add04029 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-07 Bean + + * loader/i386/efi/linux.c (grub_rescue_cmd_initrd): Fix a bug in initrd + allocation. + 2009-03-06 Robert Millan Fix display issue on terminals with screen size other than 80x25 diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index cd6f3a59f..60fa8823c 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -963,11 +963,15 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) if (physical_end > addr_max) physical_end = addr_max; - if (physical_end < addr_min) + if (physical_end < page_align (size)) continue; - if (physical_end > addr) - addr = physical_end - page_align (size); + physical_end -= page_align (size); + + if ((physical_end >= addr_min) && + (physical_end >= desc->physical_start) && + (physical_end > addr)) + addr = physical_end; } } From aa9f3bffbd52f683e3e868a0a7231e0121a62bf7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 8 Mar 2009 12:46:27 +0000 Subject: [PATCH 0561/1707] 2009-03-08 Robert Millan Make loader/i386/linux.c usable on i386-pc again. * kern/i386/pc/init.c (grub_machine_init): Disable addition of low memory to heap. * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (allocate_pages): Remove `#error' stanza. --- ChangeLog | 9 +++++++++ kern/i386/pc/init.c | 5 +++++ loader/i386/linux.c | 5 ++--- 3 files changed, 16 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2add04029..150e6d526 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-03-08 Robert Millan + + Make loader/i386/linux.c usable on i386-pc again. + + * kern/i386/pc/init.c (grub_machine_init): Disable addition of low + memory to heap. + * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (allocate_pages): Remove + `#error' stanza. + 2009-03-07 Bean * loader/i386/efi/linux.c (grub_rescue_cmd_initrd): Fix a bug in initrd diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index c604e9352..1d6d22f96 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -148,10 +148,15 @@ grub_machine_init (void) grub_gate_a20 (1); #endif +/* FIXME: This prevents loader/i386/linux.c from using low memory. When our + heap implements support for requesting a chunk in low memory, this should + no longer be a problem. */ +#if 0 /* Add the lower memory into free memory. */ if (grub_lower_mem >= GRUB_MEMORY_MACHINE_RESERVED_END) add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END, grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END); +#endif auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) diff --git a/loader/i386/linux.c b/loader/i386/linux.c index a5fbf041e..1c87c919f 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -143,9 +143,8 @@ allocate_pages (grub_size_t prot_size) real_mode_mem = 0; prot_mode_mem = 0; -#ifdef GRUB_MACHINE_PCBIOS -#error i386-pc port adds lower memory to heap, which collides with `real_mode_mem' allocation below -#endif + /* FIXME: Should request low memory from the heap when this feature is + implemented. */ auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) From a83ea1d20a7dd4c3fce92f0ae948ebcb037f6eae Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 9 Mar 2009 09:02:52 +0000 Subject: [PATCH 0562/1707] 2009-03-09 Felix Zielcke * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove duplicated `fs/ext2.c'. --- ChangeLog | 5 +++++ conf/powerpc-ieee1275.rmk | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 150e6d526..755195743 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-09 Felix Zielcke + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove duplicated + `fs/ext2.c'. + 2009-03-08 Robert Millan Make loader/i386/linux.c usable on i386-pc again. diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index e9c6066f6..2d4a5a5b5 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -45,7 +45,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/ext2.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ From 6377ef3a1d76b7c039fb0f4f79799a8581ea664f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 9 Mar 2009 09:50:50 +0000 Subject: [PATCH 0563/1707] forgot to run ./autogen.sh --- conf/powerpc-ieee1275.mk | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index ea3ea4e84..cb7935255 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -60,7 +60,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/ext2.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ @@ -86,11 +86,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_ext2.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_ext2.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -160,10 +160,6 @@ grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_cpio.d -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fat.d From 1ca7fc96f7e807580a1833c201ae1ecbbcdf7c7e Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 10 Mar 2009 23:47:51 +0000 Subject: [PATCH 0564/1707] 2009-03-11 Robert Millan * loader/i386/multiboot.c (code_size): New variable. (grub_multiboot): Define offsets by adding to `code_size' rather than substracting from `grub_multiboot_payload_size'. Provide 4-byte alignment to MBI and others by increasing `boot_loader_name_length' appropiately. * loader/i386/multiboot_elfxx.c (CONCAT(grub_multiboot_load_elf, XX)): Initialize `code_size'. --- ChangeLog | 11 +++++++++++ loader/i386/multiboot.c | 33 +++++++++++++++++++-------------- loader/i386/multiboot_elfxx.c | 3 ++- 3 files changed, 32 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 755195743..9dc1dae53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-03-11 Robert Millan + + * loader/i386/multiboot.c (code_size): New variable. + (grub_multiboot): Define offsets by adding to `code_size' rather + than substracting from `grub_multiboot_payload_size'. Provide + 4-byte alignment to MBI and others by increasing + `boot_loader_name_length' appropiately. + + * loader/i386/multiboot_elfxx.c + (CONCAT(grub_multiboot_load_elf, XX)): Initialize `code_size'. + 2009-03-09 Felix Zielcke * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Remove duplicated diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 7a2f100e4..4c01d8714 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -47,7 +47,8 @@ extern grub_dl_t my_mod; static struct grub_multiboot_info *mbi, *mbi_dest; static grub_addr_t entry; -static char *playground = NULL; +static char *playground; +static grub_size_t code_size; static grub_err_t grub_multiboot_boot (void) @@ -259,16 +260,16 @@ grub_multiboot (int argc, char *argv[]) boot_loader_name_length = sizeof(PACKAGE_STRING); -#define cmdline_addr(x) ((void *) ((x) + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info) - boot_loader_name_length - cmdline_length)) +#define cmdline_addr(x) ((void *) ((x) + code_size)) #define boot_loader_name_addr(x) \ - ((void *) ((x) + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info) - boot_loader_name_length)) -#define mbi_addr(x) ((void *) ((x) + grub_multiboot_payload_size - mmap_length - sizeof (struct grub_multiboot_info))) -#define mmap_addr(x) ((void *) ((x) + grub_multiboot_payload_size - mmap_length)) + ((void *) ((x) + code_size + cmdline_length)) +#define mbi_addr(x) ((void *) ((x) + code_size + cmdline_length + boot_loader_name_length)) +#define mmap_addr(x) ((void *) ((x) + code_size + cmdline_length + boot_loader_name_length + sizeof (struct grub_multiboot_info))) - /* This provides alignment for the MBI, the memory map and the backward relocator. */ - boot_loader_name_length += (ALIGN_UP (mbi_addr (0), 4) - (unsigned long) mbi_addr (0)); - - grub_multiboot_payload_size = cmdline_length + boot_loader_name_length + sizeof (struct grub_multiboot_info) + mmap_length; + grub_multiboot_payload_size = cmdline_length + /* boot_loader_name_length might need to grow for mbi,etc to be aligned (see below) */ + + boot_loader_name_length + 3 + + sizeof (struct grub_multiboot_info) + mmap_length; if (header->flags & MULTIBOOT_AOUT_KLUDGE) { @@ -278,11 +279,12 @@ grub_multiboot (int argc, char *argv[]) header->load_end_addr - header->load_addr); if (header->bss_end_addr) - grub_multiboot_payload_size += (header->bss_end_addr - header->load_addr); + code_size = (header->bss_end_addr - header->load_addr); else - grub_multiboot_payload_size += load_size; + code_size = load_size; grub_multiboot_payload_dest = header->load_addr; + grub_multiboot_payload_size += code_size; playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); if (! playground) goto fail; @@ -306,11 +308,14 @@ grub_multiboot (int argc, char *argv[]) else if (grub_multiboot_load_elf (file, buffer) != GRUB_ERR_NONE) goto fail; + /* This provides alignment for the MBI, the memory map and the backward relocator. */ + boot_loader_name_length += (0x04 - ((unsigned long) mbi_addr (grub_multiboot_payload_dest) & 0x03)); + mbi = mbi_addr (grub_multiboot_payload_orig); mbi_dest = mbi_addr (grub_multiboot_payload_dest); grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); mbi->mmap_length = mmap_length; - + grub_fill_multiboot_mmap (mmap_addr (grub_multiboot_payload_orig)); /* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated @@ -355,8 +360,8 @@ grub_multiboot (int argc, char *argv[]) mbi->flags |= MULTIBOOT_INFO_CMDLINE; mbi->cmdline = (grub_uint32_t) cmdline_addr (grub_multiboot_payload_dest); - - + + grub_strcpy (boot_loader_name_addr (grub_multiboot_payload_orig), PACKAGE_STRING); mbi->flags |= MULTIBOOT_INFO_BOOT_LOADER_NAME; mbi->boot_loader_name = (grub_uint32_t) boot_loader_name_addr (grub_multiboot_payload_dest); diff --git a/loader/i386/multiboot_elfxx.c b/loader/i386/multiboot_elfxx.c index e2cf5453e..97356c49f 100644 --- a/loader/i386/multiboot_elfxx.c +++ b/loader/i386/multiboot_elfxx.c @@ -88,9 +88,10 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) if (phdr(i)->p_paddr > phdr(highest_segment)->p_paddr) highest_segment = i; } - grub_multiboot_payload_size += (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; + code_size = (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; + grub_multiboot_payload_size += code_size; playground = grub_malloc (RELOCATOR_SIZEOF(forward) + grub_multiboot_payload_size + RELOCATOR_SIZEOF(backward)); if (! playground) return grub_errno; From b7b50e5f3126016b2b2b11d8f206634b1233a583 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 11 Mar 2009 08:25:22 +0000 Subject: [PATCH 0565/1707] 2009-03-11 Felix Zielcke * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/list.c' and `kern/handler.c'. --- ChangeLog | 5 +++++ conf/powerpc-ieee1275.mk | 17 +++++++++++++---- conf/powerpc-ieee1275.rmk | 1 + 3 files changed, 19 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9dc1dae53..bf33db2df 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-11 Felix Zielcke + + * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/list.c' and + `kern/handler.c'. + 2009-03-11 Robert Millan * loader/i386/multiboot.c (code_size): New variable. diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index cb7935255..11e932a7d 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -447,6 +447,7 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/list.c kern/handler.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ term/ieee1275/ofconsole.c \ @@ -454,11 +455,11 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_powerpc_ieee1275_startup.o: kern/powerpc/ieee1275/startup.S $(kern/powerpc/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -520,6 +521,14 @@ kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_term.d +kernel_elf-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_list.d + +kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_handler.d + kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_init.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 2d4a5a5b5..efa59c03e 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -78,6 +78,7 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/list.c kern/handler.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ term/ieee1275/ofconsole.c \ From 6394042e02928c112865d7d8b53535aee2b05cbb Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 11 Mar 2009 21:27:01 +0000 Subject: [PATCH 0566/1707] 2009-03-11 Robert Millan * loader/i386/multiboot_elfxx.c (CONCAT(grub_multiboot_load_elf, XX)): Do not reject ET_DYN files. --- ChangeLog | 5 +++++ loader/i386/multiboot_elfxx.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bf33db2df..68da09553 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-11 Robert Millan + + * loader/i386/multiboot_elfxx.c + (CONCAT(grub_multiboot_load_elf, XX)): Do not reject ET_DYN files. + 2009-03-11 Felix Zielcke * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): Add `kern/list.c' and diff --git a/loader/i386/multiboot_elfxx.c b/loader/i386/multiboot_elfxx.c index 97356c49f..801800c55 100644 --- a/loader/i386/multiboot_elfxx.c +++ b/loader/i386/multiboot_elfxx.c @@ -63,10 +63,10 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) || ehdr->e_ident[EI_DATA] != ELFDATA2LSB || ehdr->e_machine != E_MACHINE) return grub_error(GRUB_ERR_UNKNOWN_OS, "no valid ELF header found"); - - if (ehdr->e_type != ET_EXEC) + + if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF file type"); - + /* FIXME: Should we support program headers at strange locations? */ if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); From 5415144ac8ad4556647e9359afc544e12373a219 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 11 Mar 2009 21:51:16 +0000 Subject: [PATCH 0567/1707] 2009-03-11 Pavel Roskin * fs/hfs.c (grub_hfs_strncasecmp): New function. (grub_hfs_cmp_catkeys): Use HFS specific string comparison. --- ChangeLog | 5 ++ fs/hfs.c | 241 +++++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 245 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 68da09553..496c68c8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-11 Pavel Roskin + + * fs/hfs.c (grub_hfs_strncasecmp): New function. + (grub_hfs_cmp_catkeys): Use HFS specific string comparison. + 2009-03-11 Robert Millan * loader/i386/multiboot_elfxx.c diff --git a/fs/hfs.c b/fs/hfs.c index b01c42e81..a923309cf 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -390,6 +390,245 @@ grub_hfs_mount (grub_disk_t disk) return 0; } +/* Case insensitive string comparison using HFS character ordering */ +static int +grub_hfs_strncasecmp (const unsigned char *s1, const unsigned char *s2, + grub_size_t n) +{ + /* Taken from hfsutils 3.2.6 and converted to a readable form */ + static const unsigned char hfs_charorder[256] = { + [0x00] = 0, + [0x01] = 1, + [0x02] = 2, + [0x03] = 3, + [0x04] = 4, + [0x05] = 5, + [0x06] = 6, + [0x07] = 7, + [0x08] = 8, + [0x09] = 9, + [0x0A] = 10, + [0x0B] = 11, + [0x0C] = 12, + [0x0D] = 13, + [0x0E] = 14, + [0x0F] = 15, + [0x10] = 16, + [0x11] = 17, + [0x12] = 18, + [0x13] = 19, + [0x14] = 20, + [0x15] = 21, + [0x16] = 22, + [0x17] = 23, + [0x18] = 24, + [0x19] = 25, + [0x1A] = 26, + [0x1B] = 27, + [0x1C] = 28, + [0x1D] = 29, + [0x1E] = 30, + [0x1F] = 31, + [' '] = 32, [0xCA] = 32, + ['!'] = 33, + ['"'] = 34, + [0xD2] = 35, + [0xD3] = 36, + [0xC7] = 37, + [0xC8] = 38, + ['#'] = 39, + ['$'] = 40, + ['%'] = 41, + ['&'] = 42, + ['\''] = 43, + [0xD4] = 44, + [0xD5] = 45, + ['('] = 46, + [')'] = 47, + ['*'] = 48, + ['+'] = 49, + [','] = 50, + ['-'] = 51, + ['.'] = 52, + ['/'] = 53, + ['0'] = 54, + ['1'] = 55, + ['2'] = 56, + ['3'] = 57, + ['4'] = 58, + ['5'] = 59, + ['6'] = 60, + ['7'] = 61, + ['8'] = 62, + ['9'] = 63, + [':'] = 64, + [';'] = 65, + ['<'] = 66, + ['='] = 67, + ['>'] = 68, + ['?'] = 69, + ['@'] = 70, + ['A'] = 71, ['a'] = 71, + [0x88] = 72, [0xCB] = 72, + [0x80] = 73, [0x8A] = 73, + [0x8B] = 74, [0xCC] = 74, + [0x81] = 75, [0x8C] = 75, + [0xAE] = 76, [0xBE] = 76, + ['`'] = 77, + [0x87] = 78, + [0x89] = 79, + [0xBB] = 80, + ['B'] = 81, ['b'] = 81, + ['C'] = 82, ['c'] = 82, + [0x82] = 83, [0x8D] = 83, + ['D'] = 84, ['d'] = 84, + ['E'] = 85, ['e'] = 85, + [0x83] = 86, [0x8E] = 86, + [0x8F] = 87, + [0x90] = 88, + [0x91] = 89, + ['F'] = 90, ['f'] = 90, + ['G'] = 91, ['g'] = 91, + ['H'] = 92, ['h'] = 92, + ['I'] = 93, ['i'] = 93, + [0x92] = 94, + [0x93] = 95, + [0x94] = 96, + [0x95] = 97, + ['J'] = 98, ['j'] = 98, + ['K'] = 99, ['k'] = 99, + ['L'] = 100, ['l'] = 100, + ['M'] = 101, ['m'] = 101, + ['N'] = 102, ['n'] = 102, + [0x84] = 103, [0x96] = 103, + ['O'] = 104, ['o'] = 104, + [0x85] = 105, [0x9A] = 105, + [0x9B] = 106, [0xCD] = 106, + [0xAF] = 107, [0xBF] = 107, + [0xCE] = 108, [0xCF] = 108, + [0x97] = 109, + [0x98] = 110, + [0x99] = 111, + [0xBC] = 112, + ['P'] = 113, ['p'] = 113, + ['Q'] = 114, ['q'] = 114, + ['R'] = 115, ['r'] = 115, + ['S'] = 116, ['s'] = 116, + [0xA7] = 117, + ['T'] = 118, ['t'] = 118, + ['U'] = 119, ['u'] = 119, + [0x86] = 120, [0x9F] = 120, + [0x9C] = 121, + [0x9D] = 122, + [0x9E] = 123, + ['V'] = 124, ['v'] = 124, + ['W'] = 125, ['w'] = 125, + ['X'] = 126, ['x'] = 126, + ['Y'] = 127, ['y'] = 127, + [0xD8] = 128, + ['Z'] = 129, ['z'] = 129, + ['['] = 130, + ['\\'] = 131, + [']'] = 132, + ['^'] = 133, + ['_'] = 134, + ['{'] = 135, + ['|'] = 136, + ['}'] = 137, + ['~'] = 138, + [0x7F] = 139, + [0xA0] = 140, + [0xA1] = 141, + [0xA2] = 142, + [0xA3] = 143, + [0xA4] = 144, + [0xA5] = 145, + [0xA6] = 146, + [0xA8] = 147, + [0xA9] = 148, + [0xAA] = 149, + [0xAB] = 150, + [0xAC] = 151, + [0xAD] = 152, + [0xB0] = 153, + [0xB1] = 154, + [0xB2] = 155, + [0xB3] = 156, + [0xB4] = 157, + [0xB5] = 158, + [0xB6] = 159, + [0xB7] = 160, + [0xB8] = 161, + [0xB9] = 162, + [0xBA] = 163, + [0xBD] = 164, + [0xC0] = 165, + [0xC1] = 166, + [0xC2] = 167, + [0xC3] = 168, + [0xC4] = 169, + [0xC5] = 170, + [0xC6] = 171, + [0xC9] = 172, + [0xD0] = 173, + [0xD1] = 174, + [0xD6] = 175, + [0xD7] = 176, + [0xD9] = 177, + [0xDA] = 178, + [0xDB] = 179, + [0xDC] = 180, + [0xDD] = 181, + [0xDE] = 182, + [0xDF] = 183, + [0xE0] = 184, + [0xE1] = 185, + [0xE2] = 186, + [0xE3] = 187, + [0xE4] = 188, + [0xE5] = 189, + [0xE6] = 190, + [0xE7] = 191, + [0xE8] = 192, + [0xE9] = 193, + [0xEA] = 194, + [0xEB] = 195, + [0xEC] = 196, + [0xED] = 197, + [0xEE] = 198, + [0xEF] = 199, + [0xF0] = 200, + [0xF1] = 201, + [0xF2] = 202, + [0xF3] = 203, + [0xF4] = 204, + [0xF5] = 205, + [0xF6] = 206, + [0xF7] = 207, + [0xF8] = 208, + [0xF9] = 209, + [0xFA] = 210, + [0xFB] = 211, + [0xFC] = 212, + [0xFD] = 213, + [0xFE] = 214, + [0xFF] = 215, + }; + + if (n == 0) + return 0; + + while (*s1 && *s2 && --n) + { + if (hfs_charorder[*s1] != hfs_charorder[*s2]) + break; + + s1++; + s2++; + } + + return (int) hfs_charorder[*s1] - (int) hfs_charorder[*s2]; +} /* Compare the K1 and K2 catalog file keys. */ static int @@ -402,7 +641,7 @@ grub_hfs_cmp_catkeys (struct grub_hfs_catalog_key *k1, if (cmp != 0) return cmp; - cmp = grub_strncasecmp ((char *) (k1->str), (char *) (k2->str), k1->strlen); + cmp = grub_hfs_strncasecmp (k1->str, k2->str, k1->strlen); /* This is required because the compared strings are not of equal length. */ From c58bc32a67976b88f918005c7148ad1b2b21cc1e Mon Sep 17 00:00:00 2001 From: cbennett Date: Thu, 12 Mar 2009 18:30:44 +0000 Subject: [PATCH 0568/1707] 2009-03-12 Colin D Bennett * term/gfxterm.c (draw_cursor): Ensure character is redrawn. (grub_gfxterm_putchar): Extract pairs of identical calls to draw_cursor out of conditional blocks. --- ChangeLog | 6 ++++ term/gfxterm.c | 74 ++++++++++++++++++++++---------------------------- 2 files changed, 38 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index 496c68c8f..406dcb2f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-12 Colin D Bennett + + * term/gfxterm.c (draw_cursor): Ensure character is redrawn. + (grub_gfxterm_putchar): Extract pairs of identical calls to + draw_cursor out of conditional blocks. + 2009-03-11 Pavel Roskin * fs/hfs.c (grub_hfs_strncasecmp): New function. diff --git a/term/gfxterm.c b/term/gfxterm.c index abb1b9ed7..ef32b00e2 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -717,38 +717,34 @@ write_char (void) static void draw_cursor (int show) { - unsigned int x; - unsigned int y; - unsigned int width; - unsigned int height; - grub_video_color_t color; - - /* Determine cursor properties and position on text layer. */ - x = virtual_screen.cursor_x * virtual_screen.normal_char_width; - y = (virtual_screen.cursor_y * virtual_screen.normal_char_height - + grub_font_get_ascent (virtual_screen.font)); - width = virtual_screen.normal_char_width; - height = 2; + write_char (); if (show) { + unsigned int x; + unsigned int y; + unsigned int width; + unsigned int height; + grub_video_color_t color; + + /* Determine cursor properties and position on text layer. */ + x = virtual_screen.cursor_x * virtual_screen.normal_char_width; + width = virtual_screen.normal_char_width; color = virtual_screen.fg_color; - } - else - { - color = virtual_screen.bg_color; - y = virtual_screen.cursor_y * virtual_screen.normal_char_height; - height = virtual_screen.normal_char_height; - } + y = (virtual_screen.cursor_y * virtual_screen.normal_char_height + + grub_font_get_ascent (virtual_screen.font)); + height = 2; - /* Render cursor to text layer. */ - grub_video_set_active_render_target (text_layer); - grub_video_fill_rect (color, x, y, width, height); - grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); + /* Render cursor to text layer. */ + grub_video_set_active_render_target (text_layer); + grub_video_fill_rect (color, x, y, width, height); + grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); - /* Mark cursor to be redrawn. */ - dirty_region_add (virtual_screen.offset_x + x, virtual_screen.offset_y + y, - width, height); + /* Mark cursor to be redrawn. */ + dirty_region_add (virtual_screen.offset_x + x, + virtual_screen.offset_y + y, + width, height); + } } static void @@ -821,12 +817,12 @@ grub_gfxterm_putchar (grub_uint32_t c) /* FIXME */ return; + /* Erase current cursor, if any. */ + if (virtual_screen.cursor_state) + draw_cursor (0); + if (c == '\b' || c == '\n' || c == '\r') { - /* Erase current cursor, if any. */ - if (virtual_screen.cursor_state) - draw_cursor (0); - switch (c) { case '\b': @@ -845,10 +841,6 @@ grub_gfxterm_putchar (grub_uint32_t c) virtual_screen.cursor_x = 0; break; } - - /* Redraw cursor if visible. */ - if (virtual_screen.cursor_state) - draw_cursor (1); } else { @@ -856,10 +848,6 @@ grub_gfxterm_putchar (grub_uint32_t c) struct grub_colored_char *p; unsigned char char_width; - /* Erase current cursor, if any. */ - if (virtual_screen.cursor_state) - draw_cursor (0); - /* Get properties of the character. */ glyph = grub_font_get_glyph (virtual_screen.font, c); @@ -908,11 +896,13 @@ grub_gfxterm_putchar (grub_uint32_t c) else virtual_screen.cursor_y++; } - - /* Draw cursor if visible. */ - if (virtual_screen.cursor_state) - draw_cursor (1); } + + /* Redraw cursor if it should be visible. */ + /* Note: This will redraw the character as well, which means that the + above call to write_char is redundant when the cursor is showing. */ + if (virtual_screen.cursor_state) + draw_cursor (1); } /* Use ASCII characters to determine normal character width. */ From 40164e7552c989c283b2134c68ad0b76f3aa93e6 Mon Sep 17 00:00:00 2001 From: cbennett Date: Thu, 12 Mar 2009 18:57:42 +0000 Subject: [PATCH 0569/1707] 2009-03-12 Vladimir Serbinenko * term/gfxterm.c (GRUB_MOD_FINI(term_gfxterm)): Correct name of background image command. --- ChangeLog | 5 +++++ term/gfxterm.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 406dcb2f6..7b697a868 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-12 Vladimir Serbinenko + + * term/gfxterm.c (GRUB_MOD_FINI(term_gfxterm)): Correct name of + background image command. + 2009-03-12 Colin D Bennett * term/gfxterm.c (draw_cursor): Ensure character is redrawn. diff --git a/term/gfxterm.c b/term/gfxterm.c index ef32b00e2..b9e1eb1a9 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -1166,6 +1166,6 @@ GRUB_MOD_INIT(term_gfxterm) GRUB_MOD_FINI(term_gfxterm) { - grub_unregister_command ("bgimage"); + grub_unregister_command ("background_image"); grub_term_unregister_output (&grub_video_term); } From 8cf83a279bef0e98df93c45685d000fd30632407 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 14 Mar 2009 15:18:59 +0000 Subject: [PATCH 0570/1707] 2009-03-14 Robert Millan Fix build on powerpc. * conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): Add `handler.h'. --- ChangeLog | 5 +++++ conf/powerpc-ieee1275.rmk | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7b697a868..d8639446d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-14 Robert Millan + + Fix build on powerpc. + * conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): Add `handler.h'. + 2009-03-12 Vladimir Serbinenko * term/gfxterm.c (GRUB_MOD_FINI(term_gfxterm)): Correct name of diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index efa59c03e..8b0401892 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -16,7 +16,7 @@ DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h + pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) From 14aad8072c93b13c0f48398826c4342da699ce46 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 18 Mar 2009 10:21:28 +0000 Subject: [PATCH 0571/1707] 2009-03-18 Robert Millan * loader/i386/linux.c: Include `' and `'.. (grub_linux_setup_video): New function. Loosely based on the EFI one. (grub_linux32_boot): Attempt to configure video settings with grub_linux_setup_video(). (grub_rescue_cmd_linux): Set noreturn=0 in grub_loader_set, in order to avoid grub_console_fini() which would step out of graphical mode unconditionally. --- ChangeLog | 11 ++++++++++ loader/i386/linux.c | 49 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 56 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d8639446d..6c94b93a2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-03-18 Robert Millan + + * loader/i386/linux.c: Include `' and + `'.. + (grub_linux_setup_video): New function. Loosely based on the EFI one. + (grub_linux32_boot): Attempt to configure video settings with + grub_linux_setup_video(). + (grub_rescue_cmd_linux): Set noreturn=0 in grub_loader_set, in order + to avoid grub_console_fini() which would step out of graphical mode + unconditionally. + 2009-03-14 Robert Millan Fix build on powerpc. diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 1c87c919f..6b9aad3d9 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,6 +30,10 @@ #include #include #include +#include +/* FIXME: the definition of `struct grub_video_render_target' is + VBE-specific. */ +#include #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 @@ -215,6 +219,41 @@ grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, } } +static int +grub_linux_setup_video (struct linux_kernel_params *params) +{ + struct grub_video_mode_info mode_info; + struct grub_video_render_target *render_target; + int ret; + + ret = grub_video_get_info (&mode_info); + if (ret) + return 1; + + ret = grub_video_get_active_render_target (&render_target); + if (ret) + return 1; + + params->lfb_width = mode_info.width; + params->lfb_height = mode_info.height; + params->lfb_depth = mode_info.bpp; + params->lfb_line_len = mode_info.pitch; + + params->lfb_base = (void *) render_target->data; + params->lfb_size = (params->lfb_line_len * params->lfb_height + 65535) >> 16; + + params->red_mask_size = 8; + params->red_field_pos = 16; + params->green_mask_size = 8; + params->green_field_pos = 8; + params->blue_mask_size = 8; + params->blue_field_pos = 0; + params->reserved_mask_size = 8; + params->reserved_field_pos = 24; + + return 0; +} + #ifdef __x86_64__ struct { @@ -231,6 +270,9 @@ grub_linux32_boot (void) params = real_mode_mem; + if (! grub_linux_setup_video (params)) + params->have_vga = GRUB_VIDEO_TYPE_VLFB; + grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", (unsigned) params->code32_start, (unsigned long) &(idt_desc.limit), @@ -314,7 +356,6 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_ssize_t len; int i; char *dest; - int video_type; grub_dl_ref (my_mod); @@ -422,7 +463,6 @@ grub_rescue_cmd_linux (int argc, char *argv[]) /* Detect explicitly specified memory size, if any. */ linux_mem_size = 0; - video_type = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "mem=", 4) == 0) { @@ -481,7 +521,8 @@ grub_rescue_cmd_linux (int argc, char *argv[]) if (grub_errno == GRUB_ERR_NONE) { - grub_loader_set (grub_linux32_boot, grub_linux_unload, 1); + grub_loader_set (grub_linux32_boot, grub_linux_unload, + 0 /* set noreturn=0 in order to avoid grub_console_fini() */); loaded = 1; } From 177b82ca8b4746153a91889dfe565ceecd91da7d Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 19 Mar 2009 09:36:52 +0000 Subject: [PATCH 0572/1707] =?UTF-8?q?2009-03-18=20=20Michel=20D=C3=A4nzer?= =?UTF-8?q?=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * fs/ext2.c (grub_ext2_read_block): Take endianness into account when checking inode flags for EXT4_EXTENTS_FLAG. --- ChangeLog | 5 +++++ fs/ext2.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6c94b93a2..436bd57ef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-18 Michel Dänzer + + * fs/ext2.c (grub_ext2_read_block): Take endianness into account when + checking inode flags for EXT4_EXTENTS_FLAG. + 2009-03-18 Robert Millan * loader/i386/linux.c: Include `' and diff --git a/fs/ext2.c b/fs/ext2.c index ac0757e7c..465246171 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -385,7 +385,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); - if (inode->flags & EXT4_EXTENTS_FLAG) + if (grub_le_to_cpu32(inode->flags) & EXT4_EXTENTS_FLAG) { char buf[EXT2_BLOCK_SIZE(data)]; struct grub_ext4_extent_header *leaf; From 2156d5ba735ed9e95a03eced4250d4e6c34e701d Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 21 Mar 2009 07:35:04 +0000 Subject: [PATCH 0573/1707] 2009-03-21 Bean * fs/ext2.c (grub_ext2_mount): Change errno to GRUB_ERR_BAD_FS for out of range error. --- ChangeLog | 5 +++++ fs/ext2.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 436bd57ef..244239898 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-21 Bean + + * fs/ext2.c (grub_ext2_mount): Change errno to GRUB_ERR_BAD_FS for + out of range error. + 2009-03-18 Michel Dänzer * fs/ext2.c (grub_ext2_read_block): Take endianness into account when diff --git a/fs/ext2.c b/fs/ext2.c index 465246171..2dc79a429 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -577,6 +577,9 @@ grub_ext2_mount (grub_disk_t disk) return data; fail: + if (grub_errno == GRUB_ERR_OUT_OF_RANGE) + grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); + grub_free (data); return 0; } From 1f4147aaf0b8fe2590a97461f92a6c6d3a57fa6b Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 21 Mar 2009 07:48:28 +0000 Subject: [PATCH 0574/1707] 2009-03-21 Bean * util/hostdisk.c (read_device_map): Use grub_util_get_disk_size instead of stat in mingw environment. * util/misc.c (grub_millisleep): Use Sleep in mingw environment. * aclocal.m4 (grub_CHECK_LINK_DIR): New function. * configure.ac: Use grub_CHECK_LINK_DIR to determine whether to use AC_CONFIG_LINKS. --- ChangeLog | 12 ++++++++++++ DISTLIST | 1 + aclocal.m4 | 18 ++++++++++++++++++ conf/powerpc-ieee1275.mk | 2 +- configure | 29 ++++++++++++++++++++++++++++- configure.ac | 11 ++++++++++- util/hostdisk.c | 5 +++++ util/misc.c | 20 +++++++++++++++++--- 8 files changed, 92 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 244239898..8e2da3e14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-03-21 Bean + + * util/hostdisk.c (read_device_map): Use grub_util_get_disk_size + instead of stat in mingw environment. + + * util/misc.c (grub_millisleep): Use Sleep in mingw environment. + + * aclocal.m4 (grub_CHECK_LINK_DIR): New function. + + * configure.ac: Use grub_CHECK_LINK_DIR to determine whether to use + AC_CONFIG_LINKS. + 2009-03-21 Bean * fs/ext2.c (grub_ext2_mount): Change errno to GRUB_ERR_BAD_FS for diff --git a/DISTLIST b/DISTLIST index fbe6aef5b..a6d9d204e 100644 --- a/DISTLIST +++ b/DISTLIST @@ -392,6 +392,7 @@ loader/i386/linux.c loader/i386/multiboot.c loader/i386/multiboot_elfxx.c loader/i386/efi/linux.c +loader/i386/efi/loadbios.c loader/i386/ieee1275/linux.c loader/i386/pc/chainloader.c loader/i386/pc/chainloader_normal.c diff --git a/aclocal.m4 b/aclocal.m4 index 1dd5ffb3f..3c72ca9ec 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -448,3 +448,21 @@ else AC_MSG_RESULT([no]) [fi] ]) + +dnl Check if ln can handle directories properly (mingw). +AC_DEFUN(grub_CHECK_LINK_DIR,[ +AC_MSG_CHECKING([whether ln can handle directories properly]) +[mkdir testdir 2>/dev/null +case $srcdir in +[\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; + *) reldir=../$srcdir/include/grub/util ;; +esac +if ln -s $reldir testdir/util 2>/dev/null ; then] + AC_MSG_RESULT([yes]) + [link_dir=yes +else + link_dir=no] + AC_MSG_RESULT([no]) +[fi +rm -rf testdir] +]) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 11e932a7d..436c2bf39 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -17,7 +17,7 @@ DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h + pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) diff --git a/configure b/configure index 89b564ae3..f77ebf839 100644 --- a/configure +++ b/configure @@ -8859,8 +8859,35 @@ fi # Output files. -ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" +{ echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 +echo $ECHO_N "checking whether ln can handle directories properly... $ECHO_C" >&6; } +mkdir testdir 2>/dev/null +case $srcdir in +[\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; + *) reldir=../$srcdir/include/grub/util ;; +esac +if ln -s $reldir testdir/util 2>/dev/null ; then + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } + link_dir=yes +else + link_dir=no + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } +fi +rm -rf testdir + +if test x"$link_dir" = xyes ; then + ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" + +else + mkdir -p include/grub 2>/dev/null + rm -rf include/grub/cpu + cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null + rm -rf include/grub/machine + cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null +fi ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" ac_config_files="$ac_config_files stamp-h" diff --git a/configure.ac b/configure.ac index 134e0a339..d9f182d4a 100644 --- a/configure.ac +++ b/configure.ac @@ -474,8 +474,17 @@ AC_SUBST([freetype_cflags]) AC_SUBST([freetype_libs]) # Output files. -AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu +grub_CHECK_LINK_DIR +if test x"$link_dir" = xyes ; then + AC_CONFIG_LINKS([include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform]) +else + mkdir -p include/grub 2>/dev/null + rm -rf include/grub/cpu + cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null + rm -rf include/grub/machine + cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null +fi AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_OUTPUT diff --git a/util/hostdisk.c b/util/hostdisk.c index 67a1233af..bea3fb98f 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -555,7 +555,12 @@ read_device_map (const char *dev_map) e++; *e = '\0'; +#ifdef __MINGW32__ + (void) st; + if (grub_util_get_disk_size (p) == -1LL) +#else if (stat (p, &st) == -1) +#endif { free (map[drive].drive); map[drive].drive = NULL; diff --git a/util/misc.c b/util/misc.c index 8d7d0808b..64c35fd9f 100644 --- a/util/misc.c +++ b/util/misc.c @@ -43,6 +43,11 @@ # include #endif +#ifdef __MINGW32__ +#include +#include +#endif + char *progname = 0; int verbosity = 0; @@ -311,6 +316,16 @@ grub_get_time_ms (void) return (tv.tv_sec * 1000 + tv.tv_usec / 1000); } +#ifdef __MINGW32__ + +void +grub_millisleep (grub_uint32_t ms) +{ + Sleep (ms); +} + +#else + void grub_millisleep (grub_uint32_t ms) { @@ -321,6 +336,8 @@ grub_millisleep (grub_uint32_t ms) nanosleep (&ts, NULL); } +#endif + void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) @@ -349,9 +366,6 @@ asprintf (char **buf, const char *fmt, ...) #ifdef __MINGW32__ -#include -#include - void sync (void) { } From b1b797cb1bbfa041fa8cecf6caa0dc39d9f00898 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 21 Mar 2009 08:39:59 +0000 Subject: [PATCH 0575/1707] 2009-03-21 Bean * commands/blocklist.c: Add include file , remove and . (grub_cmd_blocklist): Use the new command interface. (GRUB_MOD_INIT): Likewise. (GRUB_MOD_FINI): Likewise. * commands/boot.c: Likewise. * commands/cat.c: Likewise. * commands/cmp.c: Likewise. * commands/configfile.c: Likewise. * commands/crc.c: Likewise. * commands/echo.c: Likewise. * commands/halt.c: Likewise. * commands/handler.c: Likewise. * commands/hdparm.c: Likewise. * commands/help.c: Likewise. * commands/hexdump.c: Likewise. * commands/loadenv.c: Likewise. * commands/ls.c: Likewise. * commands/lsmmap.c: Likewise. * commands/lspci.c: Likewise. * commands/loadenv.c: Likewise. * commands/read.c: Likewise. * commands/reboot.c: Likewise. * commands/search.c: Likewise. * commands/sleep.c: Likewise. * commands/test.c: Likewise. * commands/usbtest.c: Likewise. * commands/videotest.c: Likewise. * commands/i386/cpuid.c: Likewise. * commands/i386/pc/halt.c: Likewise. * commands/i386/pc/play.c: Likewise. * commands/i386/pc/pxecmd.c: Likewise. * commands/i386/pc/vbeinfo.c: Likewise. * commands/i386/pc/vbetest.c: Likewise. * commands/ieee1275/suspend.c: Likewise. * disk/loopback.c: Likewise. * font/font_cmd.c: Likewise. * hello/hello.c: Likewise. * loader/efi/appleloader.c: Likewise. * loader/efi/chainloader.c: Likewise. * loader/i386/bsd.c: Likewise. * loader/i386/efi/linux.c: Likewise. * loader/i386/ieee1275/linux.c: Likewise. * loader/i386/linux.c: Likewise. * loader/i386/pc/chainloader.c: Likewise. * loader/i386/pc/linux.c: Likewise. * loader/powerpc/ieee1275/linux.c: Likewise. * loader/multiboot_loader.c: Likewise. * term/gfxterm.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/terminfo.c: Likewise. * term/i386/pc/vesafb.c: Removed . * term/i386/pc/vga.c: Likewise. * video/readers/jpeg.c: Likewise. * video/readers/png.c: Likewise. * video/readers/tga.c: Likewise. * util/grub-fstest (cmd_loopback): Removed. (cmd_blocklist): Likewise. (cmd_ls): Likewise. (grub_register_command): Likewise. (grub_unregister_command): Likewise. (execute_command): Use grub_command_find to locate command and execute it. * include/grub/efi/chainloader.h: Removed. * loader/efi/chainloader_normal.c: Likewise. * loader/i386/bsd_normal.c: Likewise. * loader/i386/pc/chainloader_normal.c: Likewise. * loader/i386/pc/multiboot_normal.c: Likewise. * loader/linux_normal.c: Likewise. * loader/multiboot_loader_normal.c: Likewise. * loader/powerpc/ieee1275/linux_normal.c: Likewise. * gencmdlist.sh: Scan new registration command grub_register_extcmd and grub_register_command_p1. * conf/common.rmk (grub_fstest_SOURCES): Add kern/list.c, kern/command.c, lib/arg.c and commands/extcmd.c. (pkglib_MODULES): Remove boot.mod, and minicmd.mod and extcmd.mod. (minicmd_mod_SOURCES): New variable. (minicmd_mod_CFLAGS): Likewise. (minicmd_mod_LDFLAGS): Likewise. (extcmd_mod_SOURCES): Likewise. (extcmd_mod_CFLAGS): Likewise. (extcmd_mod_LDFLAGS): Likewise. (boot_mod_SOURCES): Removed. (boot_mod_CFLAGS): Likewise. (boot_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/command.c and kern/corecmd.c. (kernel_img_HEADERS): Add command.h. (grub_emu_SOURCES): Remove commands/boot.c and normal/arg.c, add commands/minicmd.c, kern/command.c, kern/corecmd.c, commands/extcmd.c and lib/arg.c. (pkglib_MODULES): Change _linux.mod, _chain.mod, _bsd.mod and _multiboot.mod as linux.mod, chain.mod, bsd.mod and multiboot.mod, remove the corresponding normal mode command. (normal_mod_SOURCES): Remove normal/arg.c. * conf/i386-coreboot.rmk: Likewise. * conf/i386-efi.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * include/grub/arg.h: Move from here ... * include/grub/lib/arg.h: ... to here. * normal/arg.c: Move from here ... * lib/arg.c: ... to here. * commands/extcmd.c: New file. * commands/minicmd.c: Likewise. * include/grub/command.h: Likewise. * include/grub/extcmd.h: Likewise. * kern/command.c: Likewise. * kern/corecmd.c: Likewise. * kern/list.c (grub_list_iterate): Return int instead of void. (grub_list_insert): New function. (grub_prio_list_insert): Likewise. * kern/rescue.c (grub_rescue_command): Removed. (grub_rescue_command_list): Likewise. (grub_rescue_register_command): Likewise. (grub_rescue_unregister_command): Likewise. (grub_rescue_cmd_boot): Move to minicmd.c (grub_rescue_cmd_help): Likewise. (grub_rescue_cmd_info): Likewise. (grub_rescue_cmd_boot): Likewise. (grub_rescue_cmd_testload): Likewise. (grub_rescue_cmd_dump): Likewise. (grub_rescue_cmd_rmmod): Likewise. (grub_rescue_cmd_lsmod): Likewise. (grub_rescue_cmd_exit): Likewise. (grub_rescue_print_devices): Moved to corecmd.c. (grub_rescue_print_files): Likewise. (grub_rescue_cmd_ls): Likewise. (grub_rescue_cmd_insmod): Likewise. (grub_rescue_cmd_set): Likewise. (grub_rescue_cmd_unset): Likewise. (attemp_normal_mode): Use grub_command_find to get normal module. (grub_enter_rescue_mode): Use grub_register_core_commands to register commands, remove grub_rescue_regiter_command calls. * normal/command.c (grub_regiser_command): Removed. (grub_unregister_command): Likewise. (grub_command_find): Likewise. (grub_iterate_commands): Likewise. (rescue_command): Likewise. (export_command): Moved to corecmd.c. (set_command): Removed. (unset_command): Likewise. (insmod_command): Likewise. (rmmod_command): Likewise. (lsmod_command): Likewise. (grub_command_init): Likewise. * normal/completion.c (iterate_command): Use cmd->prio to check for active command. (complete_arguments): Use grub_extcmd_t structure to find options. (grub_normal_do_completion): Change function grub_iterate_commands to grub_command_iterate. * normal/execute.c (grub_script_execute_cmd): No need to parse argument here. * normal/main.c (grub_dyncmd_dispatcher): New function. (read_command_list): Register unload commands as dyncmd. (grub_cmd_normal): Use new command interface, register rescue, unregister normal at entry, register normal, unregister rescue at exit. * include/grub/list.h (grub_list_test_t): New type. (grub_list_iterate): Return int instead of void. (grub_list_insert): New function. (GRUB_AS_NAMED_LIST_P): New macro. (GRUB_AS_PRIO_LIST): Likewise. (GRUB_AS_PRIO_LIST_P): Likewise. (GRUB_PRIO_LIST_PRIO_MASK): New constant. (GRUB_PRIO_LIST_FLAG_ACTIVE): Likewise. (grub_prio_list): New structure. (grub_prio_list_insert): New function. (grub_prio_list_remove): New inline function. * include/grub/normal.h: Remove , add . (GRUB_COMMAND_FLAG_CMDLINE): Moved to command.h. (GRUB_COMMAND_FLAG_MENU): Likewise. (GRUB_COMMAND_FLAG_BOTH): Likewise. (GRUB_COMMAND_FLAG_TITLE): Likewise. (GRUB_COMMAND_FLAG_NO_ECHO): Likewise. (GRUB_COMMAND_FLAG_NO_ARG_PARSE): Removed. (GRUB_COMMAND_FLAG_NOT_LOADED): Likewise. (grub_command): Likewise. (grub_register_command): Likewise. (grub_command_find): Likewise. (grub_iterate_commands): Likewise. (grub_command_init): Likewise. (grub_arg_parse): Likewise. (grub_arg_show_help): Likewise. * include/grub/rescue.h (grub_rescue_register_command): Removed. (grub_rescue_unregister_command): Likewise. * include/grub/i386/bsd.h: Remove grub_rescue_cmd_freebsd, grub_rescue_cmd_openbsd, grub_rescue_cmd_netbsd, grub_rescue_cmd_freebsd_loadenv and grub_rescue_cmd_freebsd_module. * include/grub/i386/efi/loader.h: Remove grub_rescue_cmd_linux and grub_rescue_cmd_initrd. * include/grub/i386/loader.h: Likewise. * include/grub/x86_64/loader.h: Likewise. * include/grub/i386/pc/chainloader.h: Remove grub_chainloader_cmd. --- ChangeLog | 218 ++++++++++ DISTLIST | 19 +- commands/blocklist.c | 14 +- commands/boot.c | 1 - commands/cat.c | 12 +- commands/cmp.c | 12 +- commands/configfile.c | 69 ++- commands/crc.c | 14 +- commands/date.c | 17 +- commands/echo.c | 16 +- commands/extcmd.c | 97 +++++ commands/halt.c | 13 +- commands/handler.c | 64 +-- commands/hdparm.c | 19 +- commands/help.c | 58 +-- commands/hexdump.c | 17 +- commands/i386/cpuid.c | 19 +- commands/i386/pc/halt.c | 17 +- commands/i386/pc/play.c | 12 +- commands/i386/pc/pxecmd.c | 17 +- commands/i386/pc/vbeinfo.c | 22 +- commands/i386/pc/vbetest.c | 15 +- commands/ieee1275/suspend.c | 11 +- commands/loadenv.c | 51 ++- commands/ls.c | 20 +- commands/lsmmap.c | 12 +- commands/lspci.c | 14 +- commands/minicmd.c | 391 +++++++++++++++++ commands/read.c | 13 +- commands/reboot.c | 11 +- commands/search.c | 30 +- commands/sleep.c | 14 +- commands/test.c | 22 +- commands/usbtest.c | 12 +- commands/videotest.c | 17 +- conf/common.mk | 223 +++++++--- conf/common.rmk | 22 +- conf/i386-coreboot.mk | 385 ++++++---------- conf/i386-coreboot.rmk | 34 +- conf/i386-efi.mk | 268 ++++-------- conf/i386-efi.rmk | 31 +- conf/i386-ieee1275.mk | 346 +++++---------- conf/i386-ieee1275.rmk | 33 +- conf/i386-pc.mk | 561 +++++++----------------- conf/i386-pc.rmk | 56 +-- conf/powerpc-ieee1275.mk | 337 +++++--------- conf/powerpc-ieee1275.rmk | 32 +- conf/x86_64-efi.mk | 269 ++++-------- conf/x86_64-efi.rmk | 32 +- disk/loopback.c | 18 +- font/font_cmd.c | 28 +- gencmdlist.sh | 4 +- hello/hello.c | 12 +- include/grub/command.h | 118 +++++ include/grub/efi/chainloader.h | 24 - include/grub/extcmd.h | 55 +++ include/grub/i386/bsd.h | 7 - include/grub/i386/efi/loader.h | 5 - include/grub/i386/loader.h | 5 - include/grub/i386/pc/chainloader.h | 3 - include/grub/{ => lib}/arg.h | 7 + include/grub/list.h | 44 +- include/grub/normal.h | 61 +-- include/grub/rescue.h | 9 - include/grub/x86_64/efi/loader.h | 5 - kern/command.c | 59 +++ kern/corecmd.c | 201 +++++++++ kern/list.c | 48 +- kern/rescue.c | 580 +------------------------ {normal => lib}/arg.c | 71 ++- loader/efi/appleloader.c | 15 +- loader/efi/chainloader.c | 26 +- loader/efi/chainloader_normal.c | 48 -- loader/i386/bsd.c | 102 +++-- loader/i386/bsd_normal.c | 102 ----- loader/i386/efi/linux.c | 31 +- loader/i386/ieee1275/linux.c | 32 +- loader/i386/linux.c | 31 +- loader/i386/pc/chainloader.c | 22 +- loader/i386/pc/chainloader_normal.c | 56 --- loader/i386/pc/linux.c | 33 +- loader/i386/pc/multiboot_normal.c | 60 --- loader/linux_normal.c | 60 --- loader/multiboot_loader.c | 34 +- loader/multiboot_loader_normal.c | 61 --- loader/powerpc/ieee1275/linux.c | 30 +- loader/powerpc/ieee1275/linux_normal.c | 60 --- normal/command.c | 330 +------------- normal/completion.c | 16 +- normal/execute.c | 30 +- normal/main.c | 130 ++++-- term/gfxterm.c | 175 ++++---- term/i386/pc/serial.c | 17 +- term/i386/pc/vesafb.c | 1 - term/i386/pc/vga.c | 1 - term/terminfo.c | 14 +- util/grub-fstest.c | 79 +--- video/readers/jpeg.c | 1 - video/readers/png.c | 1 - video/readers/tga.c | 1 - 100 files changed, 3058 insertions(+), 3914 deletions(-) create mode 100644 commands/extcmd.c create mode 100644 commands/minicmd.c create mode 100644 include/grub/command.h delete mode 100644 include/grub/efi/chainloader.h create mode 100644 include/grub/extcmd.h rename include/grub/{ => lib}/arg.h (88%) create mode 100644 kern/command.c create mode 100644 kern/corecmd.c rename {normal => lib}/arg.c (91%) delete mode 100644 loader/efi/chainloader_normal.c delete mode 100644 loader/i386/bsd_normal.c delete mode 100644 loader/i386/pc/chainloader_normal.c delete mode 100644 loader/i386/pc/multiboot_normal.c delete mode 100644 loader/linux_normal.c delete mode 100644 loader/multiboot_loader_normal.c delete mode 100644 loader/powerpc/ieee1275/linux_normal.c diff --git a/ChangeLog b/ChangeLog index 8e2da3e14..d4824dc26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,221 @@ +2009-03-21 Bean + + * commands/blocklist.c: Add include file , remove + and . + (grub_cmd_blocklist): Use the new command interface. + (GRUB_MOD_INIT): Likewise. + (GRUB_MOD_FINI): Likewise. + * commands/boot.c: Likewise. + * commands/cat.c: Likewise. + * commands/cmp.c: Likewise. + * commands/configfile.c: Likewise. + * commands/crc.c: Likewise. + * commands/echo.c: Likewise. + * commands/halt.c: Likewise. + * commands/handler.c: Likewise. + * commands/hdparm.c: Likewise. + * commands/help.c: Likewise. + * commands/hexdump.c: Likewise. + * commands/loadenv.c: Likewise. + * commands/ls.c: Likewise. + * commands/lsmmap.c: Likewise. + * commands/lspci.c: Likewise. + * commands/loadenv.c: Likewise. + * commands/read.c: Likewise. + * commands/reboot.c: Likewise. + * commands/search.c: Likewise. + * commands/sleep.c: Likewise. + * commands/test.c: Likewise. + * commands/usbtest.c: Likewise. + * commands/videotest.c: Likewise. + * commands/i386/cpuid.c: Likewise. + * commands/i386/pc/halt.c: Likewise. + * commands/i386/pc/play.c: Likewise. + * commands/i386/pc/pxecmd.c: Likewise. + * commands/i386/pc/vbeinfo.c: Likewise. + * commands/i386/pc/vbetest.c: Likewise. + * commands/ieee1275/suspend.c: Likewise. + * disk/loopback.c: Likewise. + * font/font_cmd.c: Likewise. + * hello/hello.c: Likewise. + * loader/efi/appleloader.c: Likewise. + * loader/efi/chainloader.c: Likewise. + * loader/i386/bsd.c: Likewise. + * loader/i386/efi/linux.c: Likewise. + * loader/i386/ieee1275/linux.c: Likewise. + * loader/i386/linux.c: Likewise. + * loader/i386/pc/chainloader.c: Likewise. + * loader/i386/pc/linux.c: Likewise. + * loader/powerpc/ieee1275/linux.c: Likewise. + * loader/multiboot_loader.c: Likewise. + * term/gfxterm.c: Likewise. + * term/i386/pc/serial.c: Likewise. + * term/terminfo.c: Likewise. + + * term/i386/pc/vesafb.c: Removed . + * term/i386/pc/vga.c: Likewise. + * video/readers/jpeg.c: Likewise. + * video/readers/png.c: Likewise. + * video/readers/tga.c: Likewise. + + * util/grub-fstest (cmd_loopback): Removed. + (cmd_blocklist): Likewise. + (cmd_ls): Likewise. + (grub_register_command): Likewise. + (grub_unregister_command): Likewise. + (execute_command): Use grub_command_find to locate command and execute + it. + + * include/grub/efi/chainloader.h: Removed. + * loader/efi/chainloader_normal.c: Likewise. + * loader/i386/bsd_normal.c: Likewise. + * loader/i386/pc/chainloader_normal.c: Likewise. + * loader/i386/pc/multiboot_normal.c: Likewise. + * loader/linux_normal.c: Likewise. + * loader/multiboot_loader_normal.c: Likewise. + * loader/powerpc/ieee1275/linux_normal.c: Likewise. + + * gencmdlist.sh: Scan new registration command grub_register_extcmd + and grub_register_command_p1. + + * conf/common.rmk (grub_fstest_SOURCES): Add kern/list.c, + kern/command.c, lib/arg.c and commands/extcmd.c. + (pkglib_MODULES): Remove boot.mod, and minicmd.mod and extcmd.mod. + (minicmd_mod_SOURCES): New variable. + (minicmd_mod_CFLAGS): Likewise. + (minicmd_mod_LDFLAGS): Likewise. + (extcmd_mod_SOURCES): Likewise. + (extcmd_mod_CFLAGS): Likewise. + (extcmd_mod_LDFLAGS): Likewise. + (boot_mod_SOURCES): Removed. + (boot_mod_CFLAGS): Likewise. + (boot_mod_LDFLAGS): Likewise. + + * conf/i386-pc.rmk (kernel_img_SOURCES): Add kern/command.c and + kern/corecmd.c. + (kernel_img_HEADERS): Add command.h. + (grub_emu_SOURCES): Remove commands/boot.c and normal/arg.c, add + commands/minicmd.c, kern/command.c, kern/corecmd.c, commands/extcmd.c + and lib/arg.c. + (pkglib_MODULES): Change _linux.mod, _chain.mod, _bsd.mod and + _multiboot.mod as linux.mod, chain.mod, bsd.mod and multiboot.mod, + remove the corresponding normal mode command. + (normal_mod_SOURCES): Remove normal/arg.c. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-efi.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + + * include/grub/arg.h: Move from here ... + * include/grub/lib/arg.h: ... to here. + + * normal/arg.c: Move from here ... + * lib/arg.c: ... to here. + + * commands/extcmd.c: New file. + * commands/minicmd.c: Likewise. + * include/grub/command.h: Likewise. + * include/grub/extcmd.h: Likewise. + * kern/command.c: Likewise. + * kern/corecmd.c: Likewise. + + * kern/list.c (grub_list_iterate): Return int instead of void. + (grub_list_insert): New function. + (grub_prio_list_insert): Likewise. + + * kern/rescue.c (grub_rescue_command): Removed. + (grub_rescue_command_list): Likewise. + (grub_rescue_register_command): Likewise. + (grub_rescue_unregister_command): Likewise. + (grub_rescue_cmd_boot): Move to minicmd.c + (grub_rescue_cmd_help): Likewise. + (grub_rescue_cmd_info): Likewise. + (grub_rescue_cmd_boot): Likewise. + (grub_rescue_cmd_testload): Likewise. + (grub_rescue_cmd_dump): Likewise. + (grub_rescue_cmd_rmmod): Likewise. + (grub_rescue_cmd_lsmod): Likewise. + (grub_rescue_cmd_exit): Likewise. + (grub_rescue_print_devices): Moved to corecmd.c. + (grub_rescue_print_files): Likewise. + (grub_rescue_cmd_ls): Likewise. + (grub_rescue_cmd_insmod): Likewise. + (grub_rescue_cmd_set): Likewise. + (grub_rescue_cmd_unset): Likewise. + (attemp_normal_mode): Use grub_command_find to get normal module. + (grub_enter_rescue_mode): Use grub_register_core_commands to register + commands, remove grub_rescue_regiter_command calls. + + * normal/command.c (grub_regiser_command): Removed. + (grub_unregister_command): Likewise. + (grub_command_find): Likewise. + (grub_iterate_commands): Likewise. + (rescue_command): Likewise. + (export_command): Moved to corecmd.c. + (set_command): Removed. + (unset_command): Likewise. + (insmod_command): Likewise. + (rmmod_command): Likewise. + (lsmod_command): Likewise. + (grub_command_init): Likewise. + + * normal/completion.c (iterate_command): Use cmd->prio to check for + active command. + (complete_arguments): Use grub_extcmd_t structure to find options. + (grub_normal_do_completion): Change function grub_iterate_commands to + grub_command_iterate. + + * normal/execute.c (grub_script_execute_cmd): No need to parse + argument here. + + * normal/main.c (grub_dyncmd_dispatcher): New function. + (read_command_list): Register unload commands as dyncmd. + (grub_cmd_normal): Use new command interface, register rescue, + unregister normal at entry, register normal, unregister rescue at exit. + + * include/grub/list.h (grub_list_test_t): New type. + (grub_list_iterate): Return int instead of void. + (grub_list_insert): New function. + (GRUB_AS_NAMED_LIST_P): New macro. + (GRUB_AS_PRIO_LIST): Likewise. + (GRUB_AS_PRIO_LIST_P): Likewise. + (GRUB_PRIO_LIST_PRIO_MASK): New constant. + (GRUB_PRIO_LIST_FLAG_ACTIVE): Likewise. + (grub_prio_list): New structure. + (grub_prio_list_insert): New function. + (grub_prio_list_remove): New inline function. + + * include/grub/normal.h: Remove , add . + (GRUB_COMMAND_FLAG_CMDLINE): Moved to command.h. + (GRUB_COMMAND_FLAG_MENU): Likewise. + (GRUB_COMMAND_FLAG_BOTH): Likewise. + (GRUB_COMMAND_FLAG_TITLE): Likewise. + (GRUB_COMMAND_FLAG_NO_ECHO): Likewise. + (GRUB_COMMAND_FLAG_NO_ARG_PARSE): Removed. + (GRUB_COMMAND_FLAG_NOT_LOADED): Likewise. + (grub_command): Likewise. + (grub_register_command): Likewise. + (grub_command_find): Likewise. + (grub_iterate_commands): Likewise. + (grub_command_init): Likewise. + (grub_arg_parse): Likewise. + (grub_arg_show_help): Likewise. + + * include/grub/rescue.h (grub_rescue_register_command): Removed. + (grub_rescue_unregister_command): Likewise. + + * include/grub/i386/bsd.h: Remove grub_rescue_cmd_freebsd, + grub_rescue_cmd_openbsd, grub_rescue_cmd_netbsd, + grub_rescue_cmd_freebsd_loadenv and grub_rescue_cmd_freebsd_module. + + * include/grub/i386/efi/loader.h: Remove grub_rescue_cmd_linux and + grub_rescue_cmd_initrd. + * include/grub/i386/loader.h: Likewise. + * include/grub/x86_64/loader.h: Likewise. + + * include/grub/i386/pc/chainloader.h: Remove grub_chainloader_cmd. + 2009-03-21 Bean * util/hostdisk.c (read_device_map): Use grub_util_get_disk_size diff --git a/DISTLIST b/DISTLIST index a6d9d204e..945eb17bd 100644 --- a/DISTLIST +++ b/DISTLIST @@ -48,6 +48,7 @@ commands/configfile.c commands/crc.c commands/date.c commands/echo.c +commands/extcmd.c commands/halt.c commands/handler.c commands/hdparm.c @@ -57,6 +58,7 @@ commands/loadenv.c commands/ls.c commands/lsmmap.c commands/lspci.c +commands/minicmd.c commands/read.c commands/reboot.c commands/search.c @@ -140,12 +142,12 @@ include/multiboot.h include/multiboot2.h include/grub/acorn_filecore.h include/grub/aout.h -include/grub/arg.h include/grub/ata.h include/grub/bitmap.h include/grub/boot.h include/grub/bufio.h include/grub/cache.h +include/grub/command.h include/grub/device.h include/grub/disk.h include/grub/dl.h @@ -153,6 +155,7 @@ include/grub/elf.h include/grub/elfload.h include/grub/env.h include/grub/err.h +include/grub/extcmd.h include/grub/file.h include/grub/font.h include/grub/fs.h @@ -196,7 +199,6 @@ include/grub/usbdesc.h include/grub/usbtrans.h include/grub/video.h include/grub/efi/api.h -include/grub/efi/chainloader.h include/grub/efi/console.h include/grub/efi/console_control.h include/grub/efi/disk.h @@ -265,6 +267,7 @@ include/grub/lib/LzHash.h include/grub/lib/LzmaDec.h include/grub/lib/LzmaEnc.h include/grub/lib/LzmaTypes.h +include/grub/lib/arg.h include/grub/lib/crc.h include/grub/lib/datetime.h include/grub/lib/envblk.h @@ -310,6 +313,8 @@ include/grub/x86_64/efi/machine.h include/grub/x86_64/efi/time.h io/bufio.c io/gzio.c +kern/command.c +kern/corecmd.c kern/device.c kern/disk.c kern/dl.c @@ -372,6 +377,7 @@ kern/x86_64/efi/startup.S lib/LzFind.c lib/LzmaDec.c lib/LzmaEnc.c +lib/arg.c lib/crc.c lib/datetime.c lib/envblk.c @@ -379,30 +385,21 @@ lib/hexdump.c lib/efi/datetime.c lib/i386/datetime.c loader/aout.c -loader/linux_normal.c loader/multiboot2.c loader/multiboot_loader.c -loader/multiboot_loader_normal.c loader/efi/appleloader.c loader/efi/chainloader.c -loader/efi/chainloader_normal.c loader/i386/bsd.c -loader/i386/bsd_normal.c loader/i386/linux.c loader/i386/multiboot.c loader/i386/multiboot_elfxx.c loader/i386/efi/linux.c -loader/i386/efi/loadbios.c loader/i386/ieee1275/linux.c loader/i386/pc/chainloader.c -loader/i386/pc/chainloader_normal.c loader/i386/pc/linux.c loader/i386/pc/multiboot2.c -loader/i386/pc/multiboot_normal.c loader/ieee1275/multiboot2.c loader/powerpc/ieee1275/linux.c -loader/powerpc/ieee1275/linux_normal.c -normal/arg.c normal/cmdline.c normal/color.c normal/command.c diff --git a/commands/blocklist.c b/commands/blocklist.c index c797a5f1b..b8c538544 100644 --- a/commands/blocklist.c +++ b/commands/blocklist.c @@ -17,17 +17,16 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include #include #include +#include static grub_err_t -grub_cmd_blocklist (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { grub_file_t file; @@ -106,17 +105,16 @@ grub_cmd_blocklist (struct grub_arg_list *state __attribute__ ((unused)), return grub_errno; } +static grub_command_t cmd; GRUB_MOD_INIT(blocklist) { (void) mod; /* To stop warning. */ - grub_register_command ("blocklist", grub_cmd_blocklist, - GRUB_COMMAND_FLAG_BOTH, - "blocklist FILE", - "Print a block list.", 0); + cmd = grub_register_command ("blocklist", grub_cmd_blocklist, + "blocklist FILE", "Print a block list."); } GRUB_MOD_FINI(blocklist) { - grub_unregister_command ("blocklist"); + grub_unregister_command (cmd); } diff --git a/commands/boot.c b/commands/boot.c index e24a3a411..ee0a0832e 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -19,7 +19,6 @@ #include #include -#include #include #include diff --git a/commands/cat.c b/commands/cat.c index b5dda4de0..786113ec4 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -17,17 +17,16 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include #include #include +#include static grub_err_t -grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { @@ -74,15 +73,16 @@ grub_cmd_cat (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; GRUB_MOD_INIT(cat) { (void) mod; /* To stop warning. */ - grub_register_command ("cat", grub_cmd_cat, GRUB_COMMAND_FLAG_BOTH, - "cat FILE", "Show the contents of a file.", 0); + cmd = grub_register_command_p1 ("cat", grub_cmd_cat, + "cat FILE", "Show the contents of a file."); } GRUB_MOD_FINI(cat) { - grub_unregister_command ("cat"); + grub_unregister_command (cmd); } diff --git a/commands/cmp.c b/commands/cmp.c index 87620b624..c70690a63 100644 --- a/commands/cmp.c +++ b/commands/cmp.c @@ -17,18 +17,17 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include #include +#include #define BUFFER_SIZE 512 static grub_err_t -grub_cmd_cmp (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { grub_ssize_t rd1, rd2; @@ -105,15 +104,16 @@ cleanup: return grub_errno; } +static grub_command_t cmd; GRUB_MOD_INIT(cmp) { (void) mod; /* To stop warning. */ - grub_register_command ("cmp", grub_cmd_cmp, GRUB_COMMAND_FLAG_BOTH, - "cmp FILE1 FILE2", "Compare two files.", 0); + cmd = grub_register_command ("cmp", grub_cmd_cmp, + "cmp FILE1 FILE2", "Compare two files."); } GRUB_MOD_FINI(cmp) { - grub_unregister_command ("cmp"); + grub_unregister_command (cmd); } diff --git a/commands/configfile.c b/commands/configfile.c index 2d1fb6751..77b9c37cb 100644 --- a/commands/configfile.c +++ b/commands/configfile.c @@ -17,62 +17,59 @@ * along with GRUB. If not, see . */ -#include #include -#include #include -#include #include +#include +#include static grub_err_t -grub_cmd_configfile (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) - -{ - if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); - - grub_cls (); - grub_env_context_open (); - grub_normal_execute (args[0], 1); - grub_env_context_close (); - - return 0; -} - -static grub_err_t -grub_cmd_source (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) - +grub_cmd_source (grub_command_t cmd, int argc, char **args) { + int new_env; + if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + new_env = (cmd->name[0] == 'c'); + + if (new_env) + { + grub_cls (); + grub_env_context_open (); + } + grub_normal_execute (args[0], 1); + if (new_env) + grub_env_context_close (); + return 0; } +static grub_command_t cmd_configfile, cmd_source, cmd_dot; GRUB_MOD_INIT(configfile) { (void) mod; /* To stop warning. */ - grub_register_command ("configfile", grub_cmd_configfile, - GRUB_COMMAND_FLAG_BOTH, "configfile FILE", - "Load another config file.", 0); - grub_register_command ("source", grub_cmd_source, - GRUB_COMMAND_FLAG_BOTH, "source FILE", - "Load another config file without changing context.", - 0); - grub_register_command (".", grub_cmd_source, - GRUB_COMMAND_FLAG_BOTH, ". FILE", - "Load another config file without changing context.", - 0); + cmd_configfile = + grub_register_command ("configfile", grub_cmd_source, + "configfile FILE", "Load another config file."); + cmd_source = + grub_register_command ("source", grub_cmd_source, + "source FILE", + "Load another config file without changing context." + ); + cmd_dot = + grub_register_command (".", grub_cmd_source, + ". FILE", + "Load another config file without changing context." + ); } GRUB_MOD_FINI(configfile) { - grub_unregister_command ("configfile"); - grub_unregister_command ("source"); - grub_unregister_command ("."); + grub_unregister_command (cmd_configfile); + grub_unregister_command (cmd_source); + grub_unregister_command (cmd_dot); } diff --git a/commands/crc.c b/commands/crc.c index 514864834..71a0c065c 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -17,16 +17,15 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include #include +#include static grub_err_t -grub_cmd_crc (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_crc (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { @@ -53,14 +52,17 @@ grub_cmd_crc (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; + GRUB_MOD_INIT(crc) { (void) mod; /* To stop warning. */ - grub_register_command ("crc", grub_cmd_crc, GRUB_COMMAND_FLAG_BOTH, - "crc FILE", "Calculate the crc32 checksum of a file.", 0); + cmd = grub_register_command ("crc", grub_cmd_crc, + "crc FILE", + "Calculate the crc32 checksum of a file."); } GRUB_MOD_FINI(crc) { - grub_unregister_command ("crc"); + grub_unregister_command (cmd); } diff --git a/commands/date.c b/commands/date.c index 23319182e..27010e91e 100644 --- a/commands/date.c +++ b/commands/date.c @@ -17,12 +17,11 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include +#include #define GRUB_DATETIME_SET_YEAR 1 #define GRUB_DATETIME_SET_MONTH 2 @@ -32,7 +31,7 @@ #define GRUB_DATETIME_SET_SECOND 32 static grub_err_t -grub_cmd_date (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_date (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { struct grub_datetime datetime; @@ -130,16 +129,18 @@ fail: return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid datetime"); } +static grub_command_t cmd; + GRUB_MOD_INIT(date) { (void) mod; /* To stop warning. */ - grub_register_command ("date", grub_cmd_date, - GRUB_COMMAND_FLAG_BOTH, - "date [[year-]month-day] [hour:minute[:second]]", - "Command to display/set current datetime.", 0); + cmd = + grub_register_command ("date", grub_cmd_date, + "date [[year-]month-day] [hour:minute[:second]]", + "Command to display/set current datetime."); } GRUB_MOD_FINI(date) { - grub_unregister_command ("date"); + grub_unregister_command (cmd); } diff --git a/commands/echo.c b/commands/echo.c index e2a483cf9..55181430c 100644 --- a/commands/echo.c +++ b/commands/echo.c @@ -17,10 +17,9 @@ * along with GRUB. If not, see . */ -#include #include -#include #include +#include static const struct grub_arg_option options[] = { @@ -29,10 +28,10 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; - static grub_err_t -grub_cmd_echo (struct grub_arg_list *state, int argc, char **args) +grub_cmd_echo (grub_extcmd_t cmd, int argc, char **args) { + struct grub_arg_list *state = cmd->state; int newline = 1; int i; @@ -109,16 +108,17 @@ grub_cmd_echo (struct grub_arg_list *state, int argc, char **args) return 0; } +static grub_extcmd_t cmd; GRUB_MOD_INIT(echo) { (void) mod; /* To stop warning. */ - grub_register_command ("echo", grub_cmd_echo, GRUB_COMMAND_FLAG_BOTH, - "echo [-e|-n] FILE", "Display a line of text.", - options); + cmd = grub_register_extcmd ("echo", grub_cmd_echo, GRUB_COMMAND_FLAG_BOTH, + "echo [-e|-n] FILE", "Display a line of text.", + options); } GRUB_MOD_FINI(echo) { - grub_unregister_command ("echo"); + grub_unregister_extcmd (cmd); } diff --git a/commands/extcmd.c b/commands/extcmd.c new file mode 100644 index 000000000..a6053872a --- /dev/null +++ b/commands/extcmd.c @@ -0,0 +1,97 @@ +/* extcmd.c - support extended command */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +static grub_err_t +grub_extcmd_dispatcher (struct grub_command *cmd, + int argc, char **args) +{ + int new_argc; + char **new_args; + struct grub_arg_option *parser; + struct grub_arg_list *state; + int maxargs = 0; + grub_err_t ret; + grub_extcmd_t ext; + + ext = cmd->data; + parser = (struct grub_arg_option *) ext->options; + while (parser && (parser++)->doc) + maxargs++; + + /* Set up the option state. */ + state = grub_malloc (sizeof (struct grub_arg_list) * maxargs); + grub_memset (state, 0, sizeof (struct grub_arg_list) * maxargs); + + if (grub_arg_parse (ext, argc, args, state, &new_args, &new_argc)) + { + ext->state = state; + ret = (ext->func) (ext, new_argc, new_args); + grub_free (new_args); + } + else + ret = grub_errno; + + grub_free (state); + + return ret; +} + +grub_extcmd_t +grub_register_extcmd (const char *name, grub_extcmd_func_t func, + unsigned flags, const char *summary, + const char *description, + const struct grub_arg_option *parser) +{ + grub_extcmd_t ext; + grub_command_t cmd; + + ext = (grub_extcmd_t) grub_malloc (sizeof (*ext)); + if (! ext) + return 0; + + cmd = grub_register_command_prio (name, grub_extcmd_dispatcher, + summary, description, 1); + if (! cmd) + { + grub_free (ext); + return 0; + } + + cmd->flags = (flags | GRUB_COMMAND_FLAG_EXTCMD); + cmd->data = ext; + + ext->cmd = cmd; + ext->func = func; + ext->options = parser; + ext->data = 0; + + return ext; +} + +void +grub_unregister_extcmd (grub_extcmd_t ext) +{ + grub_unregister_command (ext->cmd); + grub_free (ext); +} diff --git a/commands/halt.c b/commands/halt.c index c12c9d238..0ae2b36bd 100644 --- a/commands/halt.c +++ b/commands/halt.c @@ -17,9 +17,9 @@ * along with GRUB. If not, see . */ -#include #include #include +#include #if defined(GRUB_MACHINE_IEEE1275) #include @@ -31,7 +31,7 @@ #endif static grub_err_t -grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_halt (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -39,16 +39,17 @@ grub_cmd_halt (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; GRUB_MOD_INIT(halt) { (void)mod; /* To stop warning. */ - grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH, - "halt", "halts the computer. This command does not" - " work on all firmware.", 0); + cmd = grub_register_command ("halt", grub_cmd_halt, + 0, "halts the computer. This command does not" + " work on all firmware."); } GRUB_MOD_FINI(halt) { - grub_unregister_command ("halt"); + grub_unregister_command (cmd); } diff --git a/commands/handler.c b/commands/handler.c index cb1e7baea..d9ed61185 100644 --- a/commands/handler.c +++ b/commands/handler.c @@ -17,18 +17,18 @@ * along with GRUB. If not, see . */ -#include #include #include #include #include #include +#include static grub_err_t -grub_cmd_handler_generic (int argc, char **args, char *class_name) +grub_cmd_handler (struct grub_command *cmd, + int argc, char **args) { - char *find_name; - void *find_result; + char *class_name; void *curr_item = 0; grub_handler_class_t head; @@ -43,10 +43,12 @@ grub_cmd_handler_generic (int argc, char **args, char *class_name) return 0; } + class_name = (grub_strcmp (cmd->name, "handler")) ? (char *) cmd->name : 0; + head = grub_handler_class_list; if ((argc == 0) && (class_name == 0)) { - grub_list_iterate (head, (grub_list_hook_t) list_item); + grub_list_iterate (GRUB_AS_LIST (head), (grub_list_hook_t) list_item); } else { @@ -66,7 +68,7 @@ grub_cmd_handler_generic (int argc, char **args, char *class_name) if (argc == 0) { curr_item = class->cur_handler; - grub_list_iterate (class->handler_list, + grub_list_iterate (GRUB_AS_LIST (class->handler_list), (grub_list_hook_t) list_item); } else @@ -87,46 +89,28 @@ grub_cmd_handler_generic (int argc, char **args, char *class_name) return 0; } -static grub_err_t -grub_cmd_handler (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - return grub_cmd_handler_generic (argc, args, 0); -} - -static grub_err_t -grub_cmd_terminal_input (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - return grub_cmd_handler_generic (argc, args, "terminal_input"); -} - -static grub_err_t -grub_cmd_terminal_output (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - return grub_cmd_handler_generic (argc, args, "terminal_output"); -} +static grub_command_t cmd_handler, cmd_terminal_input, cmd_terminal_output; GRUB_MOD_INIT(handler) { (void)mod; /* To stop warning. */ - grub_register_command ("handler", grub_cmd_handler, GRUB_COMMAND_FLAG_BOTH, - "handler [class [handler]]", - "List or select a handler", 0); - grub_register_command ("terminal_input", grub_cmd_terminal_input, - GRUB_COMMAND_FLAG_BOTH, - "terminal_input [handler]", - "List or select a handler", 0); - grub_register_command ("terminal_output", grub_cmd_terminal_output, - GRUB_COMMAND_FLAG_BOTH, - "terminal_output [handler]", - "List or select a handler", 0); + cmd_handler = + grub_register_command ("handler", grub_cmd_handler, + "handler [class [handler]]", + "List or select a handler"); + cmd_terminal_input = + grub_register_command ("terminal_input", grub_cmd_handler, + "terminal_input [handler]", + "List or select a handler"); + cmd_terminal_output = + grub_register_command ("terminal_output", grub_cmd_handler, + "terminal_output [handler]", + "List or select a handler"); } GRUB_MOD_FINI(handler) { - grub_unregister_command ("terminal_input"); - grub_unregister_command ("terminal_output"); - grub_unregister_command ("handler"); + grub_unregister_command (cmd_handler); + grub_unregister_command (cmd_terminal_input); + grub_unregister_command (cmd_terminal_output); } diff --git a/commands/hdparm.c b/commands/hdparm.c index 9f2ba905c..8dcd6c256 100644 --- a/commands/hdparm.c +++ b/commands/hdparm.c @@ -17,15 +17,13 @@ * along with GRUB. If not, see . */ -#include #include #include #include #include -#include #include #include - +#include static const struct grub_arg_option options[] = { {"apm", 'B', 0, "set Advanced Power Management\n" @@ -270,10 +268,11 @@ static int get_int_arg (const struct grub_arg_list *state) return (state->set ? (int)grub_strtoul (state->arg, 0, 0) : -1); } - static grub_err_t -grub_cmd_hdparm (struct grub_arg_list *state, int argc, char **args) // state???? +grub_cmd_hdparm (grub_extcmd_t cmd, int argc, char **args) // state???? { + struct grub_arg_list *state = cmd->state; + /* Check command line. */ if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "missing device name argument"); @@ -405,17 +404,19 @@ grub_cmd_hdparm (struct grub_arg_list *state, int argc, char **args) // state??? return status; } +static grub_extcmd_t cmd; GRUB_MOD_INIT(hdparm) { (void) mod; - grub_register_command ("hdparm", grub_cmd_hdparm, GRUB_COMMAND_FLAG_BOTH, - "hdparm [OPTIONS] DISK", - "Get/set ATA disk parameters.", options); + cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm, + GRUB_COMMAND_FLAG_BOTH, + "hdparm [OPTIONS] DISK", + "Get/set ATA disk parameters.", options); } GRUB_MOD_FINI(hdparm) { - grub_unregister_command ("hdparm"); + grub_unregister_extcmd (cmd); } diff --git a/commands/help.c b/commands/help.c index 3e78cb9c9..10da69ad1 100644 --- a/commands/help.c +++ b/commands/help.c @@ -17,16 +17,14 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include +#include static grub_err_t -grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc, +grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc, char **args) - { int cnt = 0; char *currarg; @@ -36,44 +34,46 @@ grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc, int print_command_info (grub_command_t cmd) { - if (grub_command_find (cmd->name)) + if ((cmd->prio & GRUB_PRIO_LIST_FLAG_ACTIVE) && + (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE)) { - if (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE) - { - char description[GRUB_TERM_WIDTH / 2]; - int desclen = grub_strlen (cmd->summary); - - /* Make a string with a length of GRUB_TERM_WIDTH / 2 - 1 filled - with the description followed by spaces. */ - grub_memset (description, ' ', GRUB_TERM_WIDTH / 2 - 1); - description[GRUB_TERM_WIDTH / 2 - 1] = '\0'; - grub_memcpy (description, cmd->summary, - (desclen < GRUB_TERM_WIDTH / 2 - 1 - ? desclen : GRUB_TERM_WIDTH / 2 - 1)); - - grub_printf ("%s%s", description, (cnt++) % 2 ? "\n" : " "); - } + char description[GRUB_TERM_WIDTH / 2]; + int desclen = grub_strlen (cmd->summary); + + /* Make a string with a length of GRUB_TERM_WIDTH / 2 - 1 filled + with the description followed by spaces. */ + grub_memset (description, ' ', GRUB_TERM_WIDTH / 2 - 1); + description[GRUB_TERM_WIDTH / 2 - 1] = '\0'; + grub_memcpy (description, cmd->summary, + (desclen < GRUB_TERM_WIDTH / 2 - 1 + ? desclen : GRUB_TERM_WIDTH / 2 - 1)); + + grub_printf ("%s%s", description, (cnt++) % 2 ? "\n" : " "); } return 0; } int print_command_help (grub_command_t cmd) { - if (grub_command_find (cmd->name)) + if (cmd->flags & GRUB_PRIO_LIST_FLAG_ACTIVE) { if (! grub_strncmp (cmd->name, currarg, grub_strlen (currarg))) { if (cnt++ > 0) grub_printf ("\n\n"); - grub_arg_show_help (cmd); + if (cmd->flags & GRUB_COMMAND_FLAG_EXTCMD) + grub_arg_show_help ((grub_extcmd_t) cmd->data); + else + grub_printf ("Usage: %s\n%s\b", cmd->summary, + cmd->description); } } return 0; } if (argc == 0) - grub_iterate_commands (print_command_info); + grub_command_iterate (print_command_info); else { int i; @@ -81,23 +81,25 @@ grub_cmd_help (struct grub_arg_list *state __attribute__ ((unused)), int argc, for (i = 0; i < argc; i++) { currarg = args[i]; - grub_iterate_commands (print_command_help); + grub_command_iterate (print_command_help); } } return 0; } - +static grub_extcmd_t cmd; GRUB_MOD_INIT(help) { (void)mod; /* To stop warning. */ - grub_register_command ("help", grub_cmd_help, GRUB_COMMAND_FLAG_CMDLINE, - "help [PATTERN ...]", "Show a help message.", 0); + cmd = grub_register_extcmd ("help", grub_cmd_help, + GRUB_COMMAND_FLAG_CMDLINE, + "help [PATTERN ...]", + "Show a help message.", 0); } GRUB_MOD_FINI(help) { - grub_unregister_command ("help"); + grub_unregister_extcmd (cmd); } diff --git a/commands/hexdump.c b/commands/hexdump.c index 10b63201a..c4b7d323d 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -17,15 +17,14 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include #include #include #include +#include static const struct grub_arg_option options[] = { {"skip", 's', 0, "skip offset bytes from the beginning of file.", 0, @@ -35,8 +34,9 @@ static const struct grub_arg_option options[] = { }; static grub_err_t -grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) +grub_cmd_hexdump (grub_extcmd_t cmd, int argc, char **args) { + struct grub_arg_list *state = cmd->state; char buf[GRUB_DISK_SECTOR_SIZE * 4]; grub_ssize_t size, length; grub_addr_t skip; @@ -121,16 +121,19 @@ grub_cmd_hexdump (struct grub_arg_list *state, int argc, char **args) return 0; } +static grub_extcmd_t cmd; GRUB_MOD_INIT (hexdump) { (void) mod; /* To stop warning. */ - grub_register_command ("hexdump", grub_cmd_hexdump, GRUB_COMMAND_FLAG_BOTH, - "hexdump [OPTIONS] FILE_OR_DEVICE", - "Dump the contents of a file or memory.", options); + cmd = grub_register_extcmd ("hexdump", grub_cmd_hexdump, + GRUB_COMMAND_FLAG_BOTH, + "hexdump [OPTIONS] FILE_OR_DEVICE", + "Dump the contents of a file or memory.", + options); } GRUB_MOD_FINI (hexdump) { - grub_unregister_command ("hexdump"); + grub_unregister_extcmd (cmd); } diff --git a/commands/i386/cpuid.c b/commands/i386/cpuid.c index 87873d202..b80b14c10 100644 --- a/commands/i386/cpuid.c +++ b/commands/i386/cpuid.c @@ -18,12 +18,11 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include +#include #define cpuid(num,a,b,c,d) \ asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \ @@ -34,20 +33,16 @@ static unsigned char has_longmode = 0; -static const struct grub_arg_option options[] = - { - {"long-mode", 'l', 0, "check for long mode flag (default)", 0, 0}, - {0, 0, 0, 0, 0, 0} - }; - static grub_err_t -grub_cmd_cpuid (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_cpuid (struct grub_command *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { return !has_longmode; } +static grub_command_t cmd; + GRUB_MOD_INIT(cpuid) { #ifdef __x86_64__ @@ -83,11 +78,11 @@ GRUB_MOD_INIT(cpuid) done: #endif - grub_register_command ("cpuid", grub_cmd_cpuid, GRUB_COMMAND_FLAG_CMDLINE, - "cpuid", "Check for CPU features", options); + cmd = grub_register_command ("cpuid", grub_cmd_cpuid, + 0, "Check for CPU features"); } GRUB_MOD_FINI(cpuid) { - grub_unregister_command ("cpuid"); + grub_unregister_command (cmd); } diff --git a/commands/i386/pc/halt.c b/commands/i386/pc/halt.c index c3660c5fe..8999f5aac 100644 --- a/commands/i386/pc/halt.c +++ b/commands/i386/pc/halt.c @@ -17,10 +17,9 @@ * along with GRUB. If not, see . */ -#include #include -#include #include +#include static const struct grub_arg_option options[] = { @@ -29,11 +28,12 @@ static const struct grub_arg_option options[] = }; static grub_err_t -grub_cmd_halt (struct grub_arg_list *state, +grub_cmd_halt (grub_extcmd_t cmd, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { + struct grub_arg_list *state = cmd->state; int no_apm = 0; if (state[0].set) no_apm = 1; @@ -41,17 +41,18 @@ grub_cmd_halt (struct grub_arg_list *state, return 0; } - +static grub_extcmd_t cmd; GRUB_MOD_INIT(halt) { (void)mod; /* To stop warning. */ - grub_register_command ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH, - "halt [-n]", - "Halt the system, if possible using APM", options); + cmd = grub_register_extcmd ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH, + "halt [-n]", + "Halt the system, if possible using APM", + options); } GRUB_MOD_FINI(halt) { - grub_unregister_command ("halt"); + grub_unregister_extcmd (cmd); } diff --git a/commands/i386/pc/play.c b/commands/i386/pc/play.c index 4fbae0830..40ab81c0c 100644 --- a/commands/i386/pc/play.c +++ b/commands/i386/pc/play.c @@ -19,15 +19,14 @@ /* Lots of this file is borrowed from GNU/Hurd generic-speaker driver. */ -#include #include -#include #include #include #include #include #include #include +#include #define BASE_TEMPO 120 @@ -144,7 +143,7 @@ beep_on (short pitch) } static grub_err_t -grub_cmd_play (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { grub_file_t file; @@ -203,15 +202,16 @@ grub_cmd_play (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; GRUB_MOD_INIT(play) { (void)mod; /* To stop warning. */ - grub_register_command ("play", grub_cmd_play, GRUB_COMMAND_FLAG_BOTH, - "play FILE", "Play a tune", 0); + cmd = grub_register_command ("play", grub_cmd_play, + "play FILE", "Play a tune"); } GRUB_MOD_FINI(play) { - grub_unregister_command ("play"); + grub_unregister_command (cmd); } diff --git a/commands/i386/pc/pxecmd.c b/commands/i386/pc/pxecmd.c index 2a2aadcdd..7a2e9e907 100644 --- a/commands/i386/pc/pxecmd.c +++ b/commands/i386/pc/pxecmd.c @@ -17,12 +17,11 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include +#include static const struct grub_arg_option options[] = { @@ -46,9 +45,11 @@ print_ip (grub_uint32_t ip) } static grub_err_t -grub_cmd_pxe (struct grub_arg_list *state, int argc __attribute__ ((unused)), +grub_cmd_pxe (grub_extcmd_t cmd, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { + struct grub_arg_list *state = cmd->state; + if (! grub_pxe_pxenv) return grub_error (GRUB_ERR_FILE_NOT_FOUND, "no pxe environment"); @@ -83,15 +84,17 @@ grub_cmd_pxe (struct grub_arg_list *state, int argc __attribute__ ((unused)), return 0; } +static grub_extcmd_t cmd; + GRUB_MOD_INIT(pxecmd) { (void) mod; /* To stop warning. */ - grub_register_command ("pxe", grub_cmd_pxe, GRUB_COMMAND_FLAG_BOTH, - "pxe [-i|-b|-u]", - "Command to control the PXE device.", options); + cmd = grub_register_extcmd ("pxe", grub_cmd_pxe, GRUB_COMMAND_FLAG_BOTH, + "pxe [-i|-b|-u]", + "Command to control the PXE device.", options); } GRUB_MOD_FINI(pxecmd) { - grub_unregister_command ("pxe"); + grub_unregister_extcmd (cmd); } diff --git a/commands/i386/pc/vbeinfo.c b/commands/i386/pc/vbeinfo.c index 237ecdd44..bf26689f0 100644 --- a/commands/i386/pc/vbeinfo.c +++ b/commands/i386/pc/vbeinfo.c @@ -17,14 +17,13 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include #include #include +#include static void * real2pm (grub_vbe_farptr_t ptr) @@ -34,7 +33,7 @@ real2pm (grub_vbe_farptr_t ptr) } static grub_err_t -grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -53,7 +52,7 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), return err; grub_printf ("VBE info: version: %d.%d OEM software rev: %d.%d\n", - controller_info.version >> 8, + controller_info.version >> 8, controller_info.version & 0xFF, controller_info.oem_software_rev >> 8, controller_info.oem_software_rev & 0xFF); @@ -77,7 +76,7 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), grub_printf ("List of compatible video modes:\n"); grub_printf ("Legend: P=Packed pixel, D=Direct color, " - "mask/pos=R/G/B/reserved\n"); + "mask/pos=R/G/B/reserved\n"); /* Walk through all video modes listed. */ for (p = saved_video_mode_list; *p != 0xFFFF; p++) @@ -170,18 +169,17 @@ grub_cmd_vbeinfo (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; + GRUB_MOD_INIT(vbeinfo) { (void) mod; /* To stop warning. */ - grub_register_command ("vbeinfo", - grub_cmd_vbeinfo, - GRUB_COMMAND_FLAG_BOTH, - "vbeinfo", - "List compatible VESA BIOS extension video modes.", - 0); + cmd = + grub_register_command ("vbeinfo", grub_cmd_vbeinfo, 0, + "List compatible VESA BIOS extension video modes."); } GRUB_MOD_FINI(vbeinfo) { - grub_unregister_command ("vbeinfo"); + grub_unregister_command (cmd); } diff --git a/commands/i386/pc/vbetest.c b/commands/i386/pc/vbetest.c index 570421dd8..f47383065 100644 --- a/commands/i386/pc/vbetest.c +++ b/commands/i386/pc/vbetest.c @@ -19,7 +19,6 @@ #include #include -#include #include #include #include @@ -28,7 +27,7 @@ #include static grub_err_t -grub_cmd_vbetest (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_vbetest (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -162,18 +161,16 @@ grub_cmd_vbetest (struct grub_arg_list *state __attribute__ ((unused)), return grub_errno; } +static grub_command_t cmd; + GRUB_MOD_INIT(vbetest) { (void) mod; /* To stop warning. */ - grub_register_command ("vbetest", - grub_cmd_vbetest, - GRUB_COMMAND_FLAG_BOTH, - "vbetest", - "Test VESA BIOS Extension 2.0+ support", - 0); + cmd = grub_register_command ("vbetest", grub_cmd_vbetest, + 0, "Test VESA BIOS Extension 2.0+ support"); } GRUB_MOD_FINI(vbetest) { - grub_unregister_command ("vbetest"); + grub_unregister_command (cmd); } diff --git a/commands/ieee1275/suspend.c b/commands/ieee1275/suspend.c index e6b9febac..01e132441 100644 --- a/commands/ieee1275/suspend.c +++ b/commands/ieee1275/suspend.c @@ -17,14 +17,14 @@ * along with GRUB. If not, see . */ -#include #include #include #include #include +#include static grub_err_t -grub_cmd_suspend (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_suspend (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -34,15 +34,16 @@ grub_cmd_suspend (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; GRUB_MOD_INIT(ieee1275_suspend) { (void)mod; /* To stop warning. */ - grub_register_command ("suspend", grub_cmd_suspend, GRUB_COMMAND_FLAG_BOTH, - "suspend", "Return to Open Firmware prompt", 0); + cmd = grub_register_command ("suspend", grub_cmd_suspend, + 0, "Return to Open Firmware prompt"); } GRUB_MOD_FINI(ieee1275_suspend) { - grub_unregister_command ("suspend"); + grub_unregister_command (cmd); } diff --git a/commands/loadenv.c b/commands/loadenv.c index 4dbf1d93c..8d7c8c907 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -17,16 +17,15 @@ * along with GRUB. If not, see . */ -#include #include #include -#include #include #include #include #include #include #include +#include static const struct grub_arg_option options[] = { @@ -102,10 +101,12 @@ read_envblk_file (char *filename, void NESTED_FUNC_ATTR read_hook (grub_disk_add } static grub_err_t -grub_cmd_load_env (struct grub_arg_list *state, - int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) +grub_cmd_load_env (grub_extcmd_t cmd, + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) { + struct grub_arg_list *state = cmd->state; grub_file_t file; auto int hook (char *name, char *value); @@ -128,9 +129,11 @@ grub_cmd_load_env (struct grub_arg_list *state, } static grub_err_t -grub_cmd_list_env (struct grub_arg_list *state, - int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) +grub_cmd_list_env (grub_extcmd_t cmd, + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) { + struct grub_arg_list *state = cmd->state; grub_file_t file; auto int hook (char *name, char *value); @@ -153,8 +156,9 @@ grub_cmd_list_env (struct grub_arg_list *state, } static grub_err_t -grub_cmd_save_env (struct grub_arg_list *state, int argc, char **args) +grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) { + struct grub_arg_list *state = cmd->state; grub_file_t file; grub_disk_t disk; grub_disk_addr_t addr[GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS]; @@ -238,20 +242,35 @@ quit: return grub_errno; } +static grub_extcmd_t cmd_load, cmd_list, cmd_save; + GRUB_MOD_INIT(loadenv) { (void) mod; - grub_register_command ("load_env", grub_cmd_load_env, GRUB_COMMAND_FLAG_BOTH, - "load_env [-f FILE]", "Load variables from environment block file.", options); - grub_register_command ("list_env", grub_cmd_list_env, GRUB_COMMAND_FLAG_BOTH, - "list_env [-f FILE]", "List variables from environment block file.", options); - grub_register_command ("save_env", grub_cmd_save_env, GRUB_COMMAND_FLAG_BOTH, - "save_env [-f FILE] variable_name [...]", "Save variables to environment block file.", options); + + cmd_load = + grub_register_extcmd ("load_env", grub_cmd_load_env, + GRUB_COMMAND_FLAG_BOTH, + "load_env [-f FILE]", + "Load variables from environment block file.", + options); + cmd_list = + grub_register_extcmd ("list_env", grub_cmd_list_env, + GRUB_COMMAND_FLAG_BOTH, + "list_env [-f FILE]", + "List variables from environment block file.", + options); + cmd_save = + grub_register_extcmd ("save_env", grub_cmd_save_env, + GRUB_COMMAND_FLAG_BOTH, + "save_env [-f FILE] variable_name [...]", + "Save variables to environment block file.", + options); } GRUB_MOD_FINI(loadenv) { - grub_unregister_command ("load_env"); - grub_unregister_command ("list_env"); - grub_unregister_command ("save_env"); + grub_unregister_extcmd (cmd_load); + grub_unregister_extcmd (cmd_list); + grub_unregister_extcmd (cmd_save); } diff --git a/commands/ls.c b/commands/ls.c index 7f5a60930..40fceeb7f 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -22,13 +22,13 @@ #include #include #include -#include -#include #include #include #include #include #include +#include +#include static const struct grub_arg_option options[] = { @@ -134,7 +134,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) } grub_file_close (file); - } + } else grub_printf ("%-12s", "DIR"); @@ -220,8 +220,10 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) } static grub_err_t -grub_cmd_ls (struct grub_arg_list *state, int argc, char **args) +grub_cmd_ls (grub_extcmd_t cmd, int argc, char **args) { + struct grub_arg_list *state = cmd->state; + if (argc == 0) grub_ls_list_devices (state[0].set); else @@ -231,15 +233,17 @@ grub_cmd_ls (struct grub_arg_list *state, int argc, char **args) return 0; } +static grub_extcmd_t cmd; + GRUB_MOD_INIT(ls) { (void)mod; /* To stop warning. */ - grub_register_command ("ls", grub_cmd_ls, GRUB_COMMAND_FLAG_BOTH, - "ls [-l|-h|-a] [FILE]", - "List devices and files.", options); + cmd = grub_register_extcmd ("ls", grub_cmd_ls, GRUB_COMMAND_FLAG_BOTH, + "ls [-l|-h|-a] [FILE]", + "List devices and files.", options); } GRUB_MOD_FINI(ls) { - grub_unregister_command ("ls"); + grub_unregister_extcmd (cmd); } diff --git a/commands/lsmmap.c b/commands/lsmmap.c index c705591b9..562ba21a8 100644 --- a/commands/lsmmap.c +++ b/commands/lsmmap.c @@ -17,13 +17,12 @@ */ #include -#include #include -#include #include +#include static grub_err_t -grub_cmd_lsmmap (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -39,15 +38,16 @@ grub_cmd_lsmmap (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; GRUB_MOD_INIT(lsmmap) { (void) mod; /* To stop warning. */ - grub_register_command ("lsmmap", grub_cmd_lsmmap, GRUB_COMMAND_FLAG_BOTH, - "lsmmap", "List memory map provided by firmware.", 0); + cmd = grub_register_command ("lsmmap", grub_cmd_lsmmap, + 0, "List memory map provided by firmware."); } GRUB_MOD_FINI(lsmmap) { - grub_unregister_command ("lsmmap"); + grub_unregister_command (cmd); } diff --git a/commands/lspci.c b/commands/lspci.c index 979180056..a084b42d7 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -19,8 +19,8 @@ #include #include -#include #include +#include struct grub_pci_classname { @@ -146,7 +146,7 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) } static grub_err_t -grub_cmd_lspci (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_lspci (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -154,18 +154,16 @@ grub_cmd_lspci (struct grub_arg_list *state __attribute__ ((unused)), return GRUB_ERR_NONE; } - - +static grub_command_t cmd; GRUB_MOD_INIT(pci) { (void) mod; /* To stop warning. */ - grub_register_command ("lspci", grub_cmd_lspci, GRUB_COMMAND_FLAG_BOTH, - "lspci", "List PCI devices", 0); + cmd = grub_register_command ("lspci", grub_cmd_lspci, + 0, "List PCI devices"); } - GRUB_MOD_FINI(pci) { - grub_unregister_command ("lspci"); + grub_unregister_command (cmd); } diff --git a/commands/minicmd.c b/commands/minicmd.c new file mode 100644 index 000000000..071c889e1 --- /dev/null +++ b/commands/minicmd.c @@ -0,0 +1,391 @@ +/* minicmd.c - commands for the rescue mode */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003,2005,2006,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* boot */ +static grub_err_t +grub_mini_cmd_boot (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + return grub_loader_boot (); +} + +/* cat FILE */ +static grub_err_t +grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_file_t file; + char buf[GRUB_DISK_SECTOR_SIZE]; + grub_ssize_t size; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); + + file = grub_file_open (argv[0]); + if (! file) + return grub_errno; + + while ((size = grub_file_read (file, buf, sizeof (buf))) > 0) + { + int i; + + for (i = 0; i < size; i++) + { + unsigned char c = buf[i]; + + if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') + grub_putchar (c); + else + { + grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); + grub_printf ("<%x>", (int) c); + grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); + } + } + } + + grub_putchar ('\n'); + grub_refresh (); + grub_file_close (file); + + return 0; +} + +/* help */ +static grub_err_t +grub_mini_cmd_help (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + grub_command_t p; + + for (p = grub_command_list; p; p = p->next) + grub_printf ("%s (%d%c)\t%s\n", p->name, + p->prio & GRUB_PRIO_LIST_PRIO_MASK, + (p->prio & GRUB_PRIO_LIST_FLAG_ACTIVE) ? '+' : '-', + p->description); + + return 0; +} + +#if 0 +static void +grub_rescue_cmd_info (void) +{ + extern void grub_disk_cache_get_performance (unsigned long *, + unsigned long *); + unsigned long hits, misses; + + grub_disk_cache_get_performance (&hits, &misses); + grub_printf ("Disk cache: hits = %u, misses = %u ", hits, misses); + if (hits + misses) + { + unsigned long ratio = hits * 10000 / (hits + misses); + grub_printf ("(%u.%u%%)\n", ratio / 100, ratio % 100); + } + else + grub_printf ("(N/A)\n"); +} +#endif + +/* root [DEVICE] */ +static grub_err_t +grub_mini_cmd_root (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_device_t dev; + grub_fs_t fs; + + if (argc > 0) + { + char *device_name = grub_file_get_device_name (argv[0]); + if (! device_name) + return grub_errno; + + grub_env_set ("root", device_name); + grub_free (device_name); + } + + dev = grub_device_open (0); + if (! dev) + return grub_errno; + + fs = grub_fs_probe (dev); + if (grub_errno == GRUB_ERR_UNKNOWN_FS) + grub_errno = GRUB_ERR_NONE; + + grub_printf ("(%s): Filesystem is %s.\n", + grub_env_get ("root"), fs ? fs->name : "unknown"); + + grub_device_close (dev); + + return 0; +} + +#if 0 +static void +grub_rescue_cmd_testload (int argc, char *argv[]) +{ + grub_file_t file; + char *buf; + grub_ssize_t size; + grub_ssize_t pos; + auto void read_func (unsigned long sector, unsigned offset, unsigned len); + + void read_func (unsigned long sector __attribute__ ((unused)), + unsigned offset __attribute__ ((unused)), + unsigned len __attribute__ ((unused))) + { + grub_putchar ('.'); + grub_refresh (); + } + + if (argc < 1) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); + return; + } + + file = grub_file_open (argv[0]); + if (! file) + return; + + size = grub_file_size (file) & ~(GRUB_DISK_SECTOR_SIZE - 1); + if (size == 0) + { + grub_file_close (file); + return; + } + + buf = grub_malloc (size); + if (! buf) + goto fail; + + grub_printf ("Reading %s sequentially", argv[0]); + file->read_hook = read_func; + if (grub_file_read (file, buf, size) != size) + goto fail; + grub_printf (" Done.\n"); + + /* Read sequentially again. */ + grub_printf ("Reading %s sequentially again", argv[0]); + if (grub_file_seek (file, 0) < 0) + goto fail; + + for (pos = 0; pos < size; pos += GRUB_DISK_SECTOR_SIZE) + { + char sector[GRUB_DISK_SECTOR_SIZE]; + + if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE) + != GRUB_DISK_SECTOR_SIZE) + goto fail; + + if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0) + { + grub_printf ("\nDiffers in %d\n", pos); + goto fail; + } + } + grub_printf (" Done.\n"); + + /* Read backwards and compare. */ + grub_printf ("Reading %s backwards", argv[0]); + pos = size; + while (pos > 0) + { + char sector[GRUB_DISK_SECTOR_SIZE]; + + pos -= GRUB_DISK_SECTOR_SIZE; + + if (grub_file_seek (file, pos) < 0) + goto fail; + + if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE) + != GRUB_DISK_SECTOR_SIZE) + goto fail; + + if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0) + { + int i; + + grub_printf ("\nDiffers in %d\n", pos); + + for (i = 0; i < GRUB_DISK_SECTOR_SIZE; i++) + grub_putchar (buf[pos + i]); + + if (i) + grub_refresh (); + + goto fail; + } + } + grub_printf (" Done.\n"); + + fail: + + grub_file_close (file); + grub_free (buf); +} +#endif + +/* dump ADDRESS [SIZE] */ +static grub_err_t +grub_mini_cmd_dump (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_uint8_t *addr; + grub_size_t size = 4; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no address specified"); + + addr = (grub_uint8_t *) grub_strtoul (argv[0], 0, 0); + if (grub_errno) + return grub_errno; + + if (argc > 1) + size = (grub_size_t) grub_strtoul (argv[1], 0, 0); + + while (size--) + { + grub_printf ("%x%x ", *addr >> 4, *addr & 0xf); + addr++; + } + + return 0; +} + +/* rmmod MODULE */ +static grub_err_t +grub_mini_cmd_rmmod (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_dl_t mod; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); + + mod = grub_dl_get (argv[0]); + if (! mod) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such module"); + + if (grub_dl_unref (mod) <= 0) + grub_dl_unload (mod); + + return 0; +} + +/* lsmod */ +static grub_err_t +grub_mini_cmd_lsmod (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + auto int print_module (grub_dl_t mod); + + int print_module (grub_dl_t mod) + { + grub_dl_dep_t dep; + + grub_printf ("%s\t%d\t\t", mod->name, mod->ref_count); + for (dep = mod->dep; dep; dep = dep->next) + { + if (dep != mod->dep) + grub_putchar (','); + + grub_printf ("%s", dep->mod->name); + } + grub_putchar ('\n'); + grub_refresh (); + + return 0; + } + + grub_printf ("Name\tRef Count\tDependencies\n"); + grub_dl_iterate (print_module); + + return 0; +} + +/* exit */ +static grub_err_t +grub_mini_cmd_exit (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + grub_exit (); + return 0; +} + +static grub_command_t cmd_boot, cmd_cat, cmd_help, cmd_root; +static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit; + +GRUB_MOD_INIT(minicmd) +{ + (void) mod; /* To stop warning. */ + + cmd_boot = + grub_register_command ("boot", grub_mini_cmd_boot, + 0, "boot an operating system"); + cmd_cat = + grub_register_command ("cat", grub_mini_cmd_cat, + "cat FILE", "show the contents of a file"); + cmd_help = + grub_register_command ("help", grub_mini_cmd_help, + 0, "show this message"); + cmd_root = + grub_register_command ("root", grub_mini_cmd_root, + "root [DEVICE]", "set the root device"); + cmd_dump = + grub_register_command ("dump", grub_mini_cmd_dump, + "dump ADDR", "dump memory"); + cmd_rmmod = + grub_register_command ("rmmod", grub_mini_cmd_rmmod, + "rmmod MODULE", "remove a module"); + cmd_lsmod = + grub_register_command ("lsmod", grub_mini_cmd_lsmod, + 0, "show loaded modules"); + cmd_exit = + grub_register_command ("exit", grub_mini_cmd_exit, + 0, "exit from GRUB"); +} + +GRUB_MOD_FINI(minicmd) +{ + grub_unregister_command (cmd_boot); + grub_unregister_command (cmd_cat); + grub_unregister_command (cmd_help); + grub_unregister_command (cmd_root); + grub_unregister_command (cmd_dump); + grub_unregister_command (cmd_rmmod); + grub_unregister_command (cmd_lsmod); + grub_unregister_command (cmd_exit); +} diff --git a/commands/read.c b/commands/read.c index 4aa4f7633..82b30b461 100644 --- a/commands/read.c +++ b/commands/read.c @@ -20,9 +20,10 @@ #include #include #include -#include +#include #include #include +#include static char * grub_getline (void) @@ -61,7 +62,7 @@ grub_getline (void) } static grub_err_t -grub_cmd_read (struct grub_arg_list *state UNUSED, int argc, char **args) +grub_cmd_read (grub_command_t cmd UNUSED, int argc, char **args) { char *line = grub_getline (); if (! line) @@ -73,14 +74,16 @@ grub_cmd_read (struct grub_arg_list *state UNUSED, int argc, char **args) return 0; } +static grub_command_t cmd; GRUB_MOD_INIT(read) { - grub_register_command ("read", grub_cmd_read, GRUB_COMMAND_FLAG_CMDLINE, - "read [ENVVAR]", "Set variable with user input", 0); + cmd = grub_register_command ("read", grub_cmd_read, + "read [ENVVAR]", + "Set variable with user input"); } GRUB_MOD_FINI(read) { - grub_unregister_command ("read"); + grub_unregister_command (cmd); } diff --git a/commands/reboot.c b/commands/reboot.c index bff7a57ec..b5b42cde1 100644 --- a/commands/reboot.c +++ b/commands/reboot.c @@ -17,9 +17,9 @@ * along with GRUB. If not, see . */ -#include #include #include +#include #if defined(GRUB_MACHINE_IEEE1275) #include @@ -34,7 +34,7 @@ static grub_err_t -grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_reboot (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -42,15 +42,16 @@ grub_cmd_reboot (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; GRUB_MOD_INIT(reboot) { (void)mod; /* To stop warning. */ - grub_register_command ("reboot", grub_cmd_reboot, GRUB_COMMAND_FLAG_BOTH, - "reboot", "Reboot the computer", 0); + cmd = grub_register_command ("reboot", grub_cmd_reboot, + 0, "Reboot the computer"); } GRUB_MOD_FINI(reboot) { - grub_unregister_command ("reboot"); + grub_unregister_command (cmd); } diff --git a/commands/search.c b/commands/search.c index a07259a65..ccf4d16fc 100644 --- a/commands/search.c +++ b/commands/search.c @@ -22,11 +22,10 @@ #include #include #include -#include -#include #include #include #include +#include static const struct grub_arg_option options[] = { @@ -121,8 +120,8 @@ search_fs_uuid (const char *key, const char *var) count++; if (var) { - grub_env_set (var, name); - abort = 1; + grub_env_set (var, name); + abort = 1; } else grub_printf (" %s", name); @@ -196,8 +195,9 @@ search_file (const char *key, const char *var) } static grub_err_t -grub_cmd_search (struct grub_arg_list *state, int argc, char **args) +grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) { + struct grub_arg_list *state = cmd->state; const char *var = 0; if (argc == 0) @@ -216,19 +216,23 @@ grub_cmd_search (struct grub_arg_list *state, int argc, char **args) return grub_errno; } +static grub_extcmd_t cmd; + GRUB_MOD_INIT(search) { (void) mod; /* To stop warning. */ - grub_register_command ("search", grub_cmd_search, GRUB_COMMAND_FLAG_BOTH, - "search [-f|-l|-u|-s] NAME", - "Search devices by file, filesystem label or filesystem UUID." - " If --set is specified, the first device found is" - " set to a variable. If no variable name is" - " specified, \"root\" is used.", - options); + cmd = + grub_register_extcmd ("search", grub_cmd_search, + GRUB_COMMAND_FLAG_BOTH, + "search [-f|-l|-u|-s] NAME", + "Search devices by file, filesystem label or filesystem UUID." + " If --set is specified, the first device found is" + " set to a variable. If no variable name is" + " specified, \"root\" is used.", + options); } GRUB_MOD_FINI(search) { - grub_unregister_command ("search"); + grub_unregister_extcmd (cmd); } diff --git a/commands/sleep.c b/commands/sleep.c index 46c13268c..c9d533369 100644 --- a/commands/sleep.c +++ b/commands/sleep.c @@ -22,8 +22,8 @@ #include #include #include -#include #include +#include static const struct grub_arg_option options[] = { @@ -60,8 +60,9 @@ grub_interruptible_millisleep (grub_uint32_t ms) } static grub_err_t -grub_cmd_sleep (struct grub_arg_list *state, int argc, char **args) +grub_cmd_sleep (grub_extcmd_t cmd, int argc, char **args) { + struct grub_arg_list *state = cmd->state; grub_uint16_t xy; int n; @@ -99,14 +100,17 @@ grub_cmd_sleep (struct grub_arg_list *state, int argc, char **args) return 0; } +static grub_extcmd_t cmd; GRUB_MOD_INIT(sleep) { - grub_register_command ("sleep", grub_cmd_sleep, GRUB_COMMAND_FLAG_BOTH, - "sleep NUMBER_OF_SECONDS", "Wait for a specified number of seconds", options); + cmd = grub_register_extcmd ("sleep", grub_cmd_sleep, GRUB_COMMAND_FLAG_BOTH, + "sleep NUMBER_OF_SECONDS", + "Wait for a specified number of seconds", + options); } GRUB_MOD_FINI(sleep) { - grub_unregister_command ("sleep"); + grub_unregister_extcmd (cmd); } diff --git a/commands/test.c b/commands/test.c index 3d273dbc5..a9c82814d 100644 --- a/commands/test.c +++ b/commands/test.c @@ -17,17 +17,15 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include +#include static grub_err_t -grub_cmd_test (struct grub_arg_list *state __attribute__ ((unused)), int argc, - char **args) - +grub_cmd_test (grub_command_t cmd __attribute__ ((unused)), + int argc, char **args) { char *eq; char *eqis; @@ -52,19 +50,19 @@ grub_cmd_test (struct grub_arg_list *state __attribute__ ((unused)), int argc, return grub_errno; } - +static grub_command_t cmd_1, cmd_2; GRUB_MOD_INIT(test) { (void)mod; /* To stop warning. */ - grub_register_command ("[", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, - "[ EXPRESSION ]", "Evaluate an expression", 0); - grub_register_command ("test", grub_cmd_test, GRUB_COMMAND_FLAG_CMDLINE, - "test EXPRESSION", "Evaluate an expression", 0); + cmd_1 = grub_register_command ("[", grub_cmd_test, + "[ EXPRESSION ]", "Evaluate an expression"); + cmd_2 = grub_register_command ("test", grub_cmd_test, + "test EXPRESSION", "Evaluate an expression"); } GRUB_MOD_FINI(test) { - grub_unregister_command ("["); - grub_unregister_command ("test"); + grub_unregister_command (cmd_1); + grub_unregister_command (cmd_2); } diff --git a/commands/usbtest.c b/commands/usbtest.c index 8262b2e64..c05173ea8 100644 --- a/commands/usbtest.c +++ b/commands/usbtest.c @@ -22,8 +22,8 @@ #include #include #include -#include #include +#include static const char *usb_classes[] = { @@ -137,7 +137,7 @@ usb_iterate (grub_usb_device_t dev) } static grub_err_t -grub_cmd_usbtest (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_usbtest (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -147,14 +147,16 @@ grub_cmd_usbtest (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_command_t cmd; + GRUB_MOD_INIT(usbtest) { (void)mod; /* To stop warning. */ - grub_register_command ("usb", grub_cmd_usbtest, GRUB_COMMAND_FLAG_BOTH, - "usb", "Test USB support", 0); + cmd = grub_register_command ("usb", grub_cmd_usbtest, + 0, "Test USB support"); } GRUB_MOD_FINI(usbtest) { - grub_unregister_command ("usb"); + grub_unregister_command (cmd); } diff --git a/commands/videotest.c b/commands/videotest.c index a9ead8128..db7f704ed 100644 --- a/commands/videotest.c +++ b/commands/videotest.c @@ -20,14 +20,13 @@ #include #include #include -#include -#include #include #include #include +#include static grub_err_t -grub_cmd_videotest (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -175,17 +174,15 @@ grub_cmd_videotest (struct grub_arg_list *state __attribute__ ((unused)), return grub_errno; } +static grub_command_t cmd; + GRUB_MOD_INIT(videotest) { - grub_register_command ("videotest", - grub_cmd_videotest, - GRUB_COMMAND_FLAG_BOTH, - "videotest", - "Test video subsystem", - 0); + cmd = grub_register_command ("videotest", grub_cmd_videotest, + 0, "Test video subsystem"); } GRUB_MOD_FINI(videotest) { - grub_unregister_command ("videotest"); + grub_unregister_command (cmd); } diff --git a/conf/common.mk b/conf/common.mk index b16daf520..bcf75a879 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -212,7 +212,8 @@ endif util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ - disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ + disk/host.c disk/loopback.c kern/list.c kern/command.c \ + lib/arg.c commands/extcmd.c normal/misc.c \ lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -225,11 +226,11 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-normal_arg.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-kern_list.d grub_fstest-kern_command.d grub_fstest-lib_arg.d grub_fstest-commands_extcmd.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-normal_arg.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -271,9 +272,21 @@ grub_fstest-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-disk_loopback.d -grub_fstest-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-normal_arg.d +grub_fstest-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_list.d + +grub_fstest-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-kern_command.d + +grub_fstest-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-lib_arg.d + +grub_fstest-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-commands_extcmd.d grub_fstest-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -2427,12 +2440,145 @@ scsi_mod_CFLAGS = $(COMMON_CFLAGS) scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. -pkglib_MODULES += hello.mod boot.mod handler.mod ls.mod \ - cmp.mod cat.mod help.mod search.mod \ +pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ + ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod +# For minicmd.mod. +minicmd_mod_SOURCES = commands/minicmd.c +CLEANFILES += minicmd.mod mod-minicmd.o mod-minicmd.c pre-minicmd.o minicmd_mod-commands_minicmd.o und-minicmd.lst +ifneq ($(minicmd_mod_EXPORTS),no) +CLEANFILES += def-minicmd.lst +DEFSYMFILES += def-minicmd.lst +endif +MOSTLYCLEANFILES += minicmd_mod-commands_minicmd.d +UNDSYMFILES += und-minicmd.lst + +minicmd.mod: pre-minicmd.o mod-minicmd.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(minicmd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-minicmd.o mod-minicmd.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-minicmd.o: $(minicmd_mod_DEPENDENCIES) minicmd_mod-commands_minicmd.o + -rm -f $@ + $(TARGET_CC) $(minicmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ minicmd_mod-commands_minicmd.o + +mod-minicmd.o: mod-minicmd.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -c -o $@ $< + +mod-minicmd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'minicmd' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(minicmd_mod_EXPORTS),no) +def-minicmd.lst: pre-minicmd.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 minicmd/' > $@ +endif + +und-minicmd.lst: pre-minicmd.o + echo 'minicmd' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +minicmd_mod-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -MD -c -o $@ $< +-include minicmd_mod-commands_minicmd.d + +CLEANFILES += cmd-minicmd_mod-commands_minicmd.lst fs-minicmd_mod-commands_minicmd.lst partmap-minicmd_mod-commands_minicmd.lst +COMMANDFILES += cmd-minicmd_mod-commands_minicmd.lst +FSFILES += fs-minicmd_mod-commands_minicmd.lst +PARTMAPFILES += partmap-minicmd_mod-commands_minicmd.lst + +cmd-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minicmd > $@ || (rm -f $@; exit 1) + +fs-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minicmd > $@ || (rm -f $@; exit 1) + +partmap-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minicmd > $@ || (rm -f $@; exit 1) + + +minicmd_mod_CFLAGS = $(COMMON_CFLAGS) +minicmd_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For extcmd.mod. +extcmd_mod_SOURCES = commands/extcmd.c lib/arg.c +CLEANFILES += extcmd.mod mod-extcmd.o mod-extcmd.c pre-extcmd.o extcmd_mod-commands_extcmd.o extcmd_mod-lib_arg.o und-extcmd.lst +ifneq ($(extcmd_mod_EXPORTS),no) +CLEANFILES += def-extcmd.lst +DEFSYMFILES += def-extcmd.lst +endif +MOSTLYCLEANFILES += extcmd_mod-commands_extcmd.d extcmd_mod-lib_arg.d +UNDSYMFILES += und-extcmd.lst + +extcmd.mod: pre-extcmd.o mod-extcmd.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(extcmd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-extcmd.o mod-extcmd.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-extcmd.o: $(extcmd_mod_DEPENDENCIES) extcmd_mod-commands_extcmd.o extcmd_mod-lib_arg.o + -rm -f $@ + $(TARGET_CC) $(extcmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ extcmd_mod-commands_extcmd.o extcmd_mod-lib_arg.o + +mod-extcmd.o: mod-extcmd.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -c -o $@ $< + +mod-extcmd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'extcmd' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(extcmd_mod_EXPORTS),no) +def-extcmd.lst: pre-extcmd.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 extcmd/' > $@ +endif + +und-extcmd.lst: pre-extcmd.o + echo 'extcmd' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +extcmd_mod-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -MD -c -o $@ $< +-include extcmd_mod-commands_extcmd.d + +CLEANFILES += cmd-extcmd_mod-commands_extcmd.lst fs-extcmd_mod-commands_extcmd.lst partmap-extcmd_mod-commands_extcmd.lst +COMMANDFILES += cmd-extcmd_mod-commands_extcmd.lst +FSFILES += fs-extcmd_mod-commands_extcmd.lst +PARTMAPFILES += partmap-extcmd_mod-commands_extcmd.lst + +cmd-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) + +fs-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) + +partmap-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) + + +extcmd_mod-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) + $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -MD -c -o $@ $< +-include extcmd_mod-lib_arg.d + +CLEANFILES += cmd-extcmd_mod-lib_arg.lst fs-extcmd_mod-lib_arg.lst partmap-extcmd_mod-lib_arg.lst +COMMANDFILES += cmd-extcmd_mod-lib_arg.lst +FSFILES += fs-extcmd_mod-lib_arg.lst +PARTMAPFILES += partmap-extcmd_mod-lib_arg.lst + +cmd-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) + +fs-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) + +partmap-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) + + +extcmd_mod_CFLAGS = $(COMMON_CFLAGS) +extcmd_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For hello.mod. hello_mod_SOURCES = hello/hello.c CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o und-hello.lst @@ -2490,63 +2636,6 @@ partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) g hello_mod_CFLAGS = $(COMMON_CFLAGS) hello_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For boot.mod. -boot_mod_SOURCES = commands/boot.c -CLEANFILES += boot.mod mod-boot.o mod-boot.c pre-boot.o boot_mod-commands_boot.o und-boot.lst -ifneq ($(boot_mod_EXPORTS),no) -CLEANFILES += def-boot.lst -DEFSYMFILES += def-boot.lst -endif -MOSTLYCLEANFILES += boot_mod-commands_boot.d -UNDSYMFILES += und-boot.lst - -boot.mod: pre-boot.o mod-boot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-boot.o mod-boot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o - -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ boot_mod-commands_boot.o - -mod-boot.o: mod-boot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $< - -mod-boot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(boot_mod_EXPORTS),no) -def-boot.lst: pre-boot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 boot/' > $@ -endif - -und-boot.lst: pre-boot.o - echo 'boot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -boot_mod-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -MD -c -o $@ $< --include boot_mod-commands_boot.d - -CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst partmap-boot_mod-commands_boot.lst -COMMANDFILES += cmd-boot_mod-commands_boot.lst -FSFILES += fs-boot_mod-commands_boot.lst -PARTMAPFILES += partmap-boot_mod-commands_boot.lst - -cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) - -fs-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) - -partmap-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh boot > $@ || (rm -f $@; exit 1) - - -boot_mod_CFLAGS = $(COMMON_CFLAGS) -boot_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For handler.mod. handler_mod_SOURCES = commands/handler.c CLEANFILES += handler.mod mod-handler.o mod-handler.c pre-handler.o handler_mod-commands_handler.o und-handler.lst diff --git a/conf/common.rmk b/conf/common.rmk index 857d8b869..43bc683b0 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -31,7 +31,8 @@ endif util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ - disk/host.c disk/loopback.c normal/arg.c normal/misc.c \ + disk/host.c disk/loopback.c kern/list.c kern/command.c \ + lib/arg.c commands/extcmd.c normal/misc.c \ lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -330,22 +331,27 @@ scsi_mod_CFLAGS = $(COMMON_CFLAGS) scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. -pkglib_MODULES += hello.mod boot.mod handler.mod ls.mod \ - cmp.mod cat.mod help.mod search.mod \ +pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ + ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod +# For minicmd.mod. +minicmd_mod_SOURCES = commands/minicmd.c +minicmd_mod_CFLAGS = $(COMMON_CFLAGS) +minicmd_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For extcmd.mod. +extcmd_mod_SOURCES = commands/extcmd.c lib/arg.c +extcmd_mod_CFLAGS = $(COMMON_CFLAGS) +extcmd_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For hello.mod. hello_mod_SOURCES = hello/hello.c hello_mod_CFLAGS = $(COMMON_CFLAGS) hello_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For boot.mod. -boot_mod_SOURCES = commands/boot.c -boot_mod_CFLAGS = $(COMMON_CFLAGS) -boot_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For handler.mod. handler_mod_SOURCES = commands/handler.c handler_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index dda08a30c..36f797f89 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -18,7 +18,7 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ @@ -27,11 +27,11 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ term/i386/pc/vga_text.c term/i386/vga_common.c \ term/i386/pc/at_keyboard.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-term_i386_vga_common.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_command.d kernel_elf-kern_corecmd.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-term_i386_vga_common.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_coreboot_startup.o: kern/i386/coreboot/startup.S $(kern/i386/coreboot/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -105,6 +105,14 @@ kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_handler.d +kernel_elf-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_command.d + +kernel_elf-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_corecmd.d + kernel_elf-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_i386_dl.d @@ -153,11 +161,11 @@ kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d -kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h list.h handler.h + machine/memory.h machine/loader.h list.h handler.h command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic @@ -196,7 +204,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ @@ -212,10 +220,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ @@ -229,15 +238,15 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) -grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) +grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_boot.d +-include grub_emu-commands_minicmd.d grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -411,6 +420,18 @@ grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_handler.d +grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_command.d + +grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_corecmd.d + +grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_extcmd.d + grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_execute.d @@ -459,9 +480,9 @@ grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_term.d -grub_emu-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_arg.d +grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_arg.d grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -604,78 +625,20 @@ grub-install: util/i386/pc/grub-install.in $(util/i386/pc/grub-install.in_DEPEND # Modules. -pkglib_MODULES = _linux.mod linux.mod normal.mod \ - _multiboot.mod multiboot.mod aout.mod \ - play.mod serial.mod ata.mod \ +pkglib_MODULES = linux.mod normal.mod multiboot.mod \ + aout.mod play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod \ lsmmap.mod -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/linux.c -CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_linux.o und-_linux.lst -ifneq ($(_linux_mod_EXPORTS),no) -CLEANFILES += def-_linux.lst -DEFSYMFILES += def-_linux.lst -endif -MOSTLYCLEANFILES += _linux_mod-loader_i386_linux.d -UNDSYMFILES += und-_linux.lst - -_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_linux.o - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_linux.o - -mod-_linux.o: mod-_linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< - -mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_linux_mod_EXPORTS),no) -def-_linux.lst: pre-_linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ -endif - -und-_linux.lst: pre-_linux.o - echo '_linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_linux_mod-loader_i386_linux.o: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< --include _linux_mod-loader_i386_linux.d - -CLEANFILES += cmd-_linux_mod-loader_i386_linux.lst fs-_linux_mod-loader_i386_linux.lst partmap-_linux_mod-loader_i386_linux.lst -COMMANDFILES += cmd-_linux_mod-loader_i386_linux.lst -FSFILES += fs-_linux_mod-loader_i386_linux.lst -PARTMAPFILES += partmap-_linux_mod-loader_i386_linux.lst - -cmd-_linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) - -fs-_linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) - -partmap-_linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) - - -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/i386/linux.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_linux.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_i386_linux.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -684,9 +647,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_linux.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -703,23 +666,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_linux_normal.d +linux_mod-loader_i386_linux.o: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_linux.d -CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst -FSFILES += fs-linux_mod-loader_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_linux.lst fs-linux_mod-loader_i386_linux.lst partmap-linux_mod-loader_i386_linux.lst +COMMANDFILES += cmd-linux_mod-loader_i386_linux.lst +FSFILES += fs-linux_mod-loader_i386_linux.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_linux.lst -cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -733,7 +696,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -742,12 +705,12 @@ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -756,9 +719,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -775,25 +738,6 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_arg.d - -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst -COMMANDFILES += cmd-normal_mod-normal_arg.lst -FSFILES += fs-normal_mod-normal_arg.lst -PARTMAPFILES += partmap-normal_mod-normal_arg.lst - -cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -1311,131 +1255,17 @@ partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/multiboot.c \ +# For multiboot.mod. +multiboot_mod_SOURCES = loader/i386/multiboot.c \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst -ifneq ($(_multiboot_mod_EXPORTS),no) -CLEANFILES += def-_multiboot.lst -DEFSYMFILES += def-_multiboot.lst -endif -MOSTLYCLEANFILES += _multiboot_mod-loader_i386_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-_multiboot.lst - -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -mod-_multiboot.o: mod-_multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< - -mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_multiboot_mod_EXPORTS),no) -def-_multiboot.lst: pre-_multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _multiboot/' > $@ -endif - -und-_multiboot.lst: pre-_multiboot.o - echo '_multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_i386_multiboot.d - -CLEANFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst fs-_multiboot_mod-loader_i386_multiboot.lst partmap-_multiboot_mod-loader_i386_multiboot.lst -COMMANDFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst -FSFILES += fs-_multiboot_mod-loader_i386_multiboot.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_i386_multiboot.lst - -cmd-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_i386_pc_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod-loader_i386_pc_multiboot2.lst partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst - -cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst - -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst - -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod. -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_multiboot_loader_normal.o und-multiboot.lst +CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst ifneq ($(multiboot_mod_EXPORTS),no) CLEANFILES += def-multiboot.lst DEFSYMFILES += def-multiboot.lst endif -MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d +MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) @@ -1444,9 +1274,9 @@ multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o +pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_multiboot_loader_normal.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< @@ -1463,22 +1293,79 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) +multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_i386_multiboot.d + +CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot.lst fs-multiboot_mod-loader_i386_multiboot.lst partmap-multiboot_mod-loader_i386_multiboot.lst +COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot.lst +FSFILES += fs-multiboot_mod-loader_i386_multiboot.lst +PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot.lst + +cmd-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_i386_pc_multiboot2.d + +CLEANFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst fs-multiboot_mod-loader_i386_pc_multiboot2.lst partmap-multiboot_mod-loader_i386_pc_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_i386_pc_multiboot2.lst + +cmd-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader_normal.d +-include multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh +fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) -partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_multiboot_loader.d + +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst +FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst + +cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index e68bed335..0b4f216cf 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -17,7 +17,7 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ @@ -26,11 +26,11 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ term/i386/pc/vga_text.c term/i386/vga_common.c \ term/i386/pc/at_keyboard.c \ symlist.c -kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h list.h handler.h + machine/memory.h machine/loader.h list.h handler.h command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic @@ -55,7 +55,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ @@ -71,10 +71,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ @@ -95,20 +96,14 @@ sbin_SCRIPTS += grub-install grub_install_SOURCES = util/i386/pc/grub-install.in # Modules. -pkglib_MODULES = _linux.mod linux.mod normal.mod \ - _multiboot.mod multiboot.mod aout.mod \ - play.mod serial.mod ata.mod \ +pkglib_MODULES = linux.mod normal.mod multiboot.mod \ + aout.mod play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod \ lsmmap.mod -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/linux.c -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c +linux_mod_SOURCES = loader/i386/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -120,7 +115,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -148,16 +143,11 @@ serial_mod_SOURCES = term/i386/pc/serial.c serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/multiboot.c \ +# For multiboot.mod. +multiboot_mod_SOURCES = loader/i386/multiboot.c \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod. -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index d13d08597..f9205a4a5 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -65,7 +65,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ @@ -81,10 +81,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -115,8 +116,8 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. -pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod halt.mod reboot.mod pci.mod lspci.mod \ +pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ + linux.mod halt.mod reboot.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -127,16 +128,16 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d +MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_command.d kernel_mod-kern_corecmd.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -145,9 +146,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -677,6 +678,44 @@ partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIE set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_command.d + +CLEANFILES += cmd-kernel_mod-kern_command.lst fs-kernel_mod-kern_command.lst partmap-kernel_mod-kern_command.lst +COMMANDFILES += cmd-kernel_mod-kern_command.lst +FSFILES += fs-kernel_mod-kern_command.lst +PARTMAPFILES += partmap-kernel_mod-kern_command.lst + +cmd-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_corecmd.d + +CLEANFILES += cmd-kernel_mod-kern_corecmd.lst fs-kernel_mod-kern_corecmd.lst partmap-kernel_mod-kern_corecmd.lst +COMMANDFILES += cmd-kernel_mod-kern_corecmd.lst +FSFILES += fs-kernel_mod-kern_corecmd.lst +PARTMAPFILES += partmap-kernel_mod-kern_corecmd.lst + +cmd-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_tsc.d @@ -753,10 +792,10 @@ partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h list.h handler.h + efi/efi.h efi/time.h efi/disk.h list.h handler.h command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -779,7 +818,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -788,12 +827,12 @@ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -802,9 +841,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -821,25 +860,6 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_arg.d - -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst -COMMANDFILES += cmd-normal_mod-normal_arg.lst -FSFILES += fs-normal_mod-normal_arg.lst -PARTMAPFILES += partmap-normal_mod-normal_arg.lst - -cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -1148,71 +1168,14 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _chain.mod. -_chain_mod_SOURCES = loader/efi/chainloader.c -CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_efi_chainloader.o und-_chain.lst -ifneq ($(_chain_mod_EXPORTS),no) -CLEANFILES += def-_chain.lst -DEFSYMFILES += def-_chain.lst -endif -MOSTLYCLEANFILES += _chain_mod-loader_efi_chainloader.d -UNDSYMFILES += und-_chain.lst - -_chain.mod: pre-_chain.o mod-_chain.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_chain.o mod-_chain.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o - -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _chain_mod-loader_efi_chainloader.o - -mod-_chain.o: mod-_chain.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $< - -mod-_chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_chain_mod_EXPORTS),no) -def-_chain.lst: pre-_chain.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _chain/' > $@ -endif - -und-_chain.lst: pre-_chain.o - echo '_chain' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< --include _chain_mod-loader_efi_chainloader.d - -CLEANFILES += cmd-_chain_mod-loader_efi_chainloader.lst fs-_chain_mod-loader_efi_chainloader.lst partmap-_chain_mod-loader_efi_chainloader.lst -COMMANDFILES += cmd-_chain_mod-loader_efi_chainloader.lst -FSFILES += fs-_chain_mod-loader_efi_chainloader.lst -PARTMAPFILES += partmap-_chain_mod-loader_efi_chainloader.lst - -cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) - -fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) - -partmap-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _chain > $@ || (rm -f $@; exit 1) - - -_chain_mod_CFLAGS = $(COMMON_CFLAGS) -_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. -chain_mod_SOURCES = loader/efi/chainloader_normal.c -CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader_normal.o und-chain.lst +chain_mod_SOURCES = loader/efi/chainloader.c +CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader.o und-chain.lst ifneq ($(chain_mod_EXPORTS),no) CLEANFILES += def-chain.lst DEFSYMFILES += def-chain.lst endif -MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader_normal.d +MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader.d UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) @@ -1221,9 +1184,9 @@ chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o +pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader.o -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_efi_chainloader_normal.o + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_efi_chainloader.o mod-chain.o: mod-chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< @@ -1240,22 +1203,22 @@ und-chain.lst: pre-chain.o echo 'chain' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) +chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< --include chain_mod-loader_efi_chainloader_normal.d +-include chain_mod-loader_efi_chainloader.d -CLEANFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst fs-chain_mod-loader_efi_chainloader_normal.lst partmap-chain_mod-loader_efi_chainloader_normal.lst -COMMANDFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst -FSFILES += fs-chain_mod-loader_efi_chainloader_normal.lst -PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader_normal.lst +CLEANFILES += cmd-chain_mod-loader_efi_chainloader.lst fs-chain_mod-loader_efi_chainloader.lst partmap-chain_mod-loader_efi_chainloader.lst +COMMANDFILES += cmd-chain_mod-loader_efi_chainloader.lst +FSFILES += fs-chain_mod-loader_efi_chainloader.lst +PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader.lst -cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) -fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genfslist.sh +fs-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) -partmap-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) @@ -1319,71 +1282,14 @@ partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(load appleldr_mod_CFLAGS = $(COMMON_CFLAGS) appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/efi/linux.c -CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_efi_linux.o und-_linux.lst -ifneq ($(_linux_mod_EXPORTS),no) -CLEANFILES += def-_linux.lst -DEFSYMFILES += def-_linux.lst -endif -MOSTLYCLEANFILES += _linux_mod-loader_i386_efi_linux.d -UNDSYMFILES += und-_linux.lst - -_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_efi_linux.o - -mod-_linux.o: mod-_linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< - -mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_linux_mod_EXPORTS),no) -def-_linux.lst: pre-_linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ -endif - -und-_linux.lst: pre-_linux.o - echo '_linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< --include _linux_mod-loader_i386_efi_linux.d - -CLEANFILES += cmd-_linux_mod-loader_i386_efi_linux.lst fs-_linux_mod-loader_i386_efi_linux.lst partmap-_linux_mod-loader_i386_efi_linux.lst -COMMANDFILES += cmd-_linux_mod-loader_i386_efi_linux.lst -FSFILES += fs-_linux_mod-loader_i386_efi_linux.lst -PARTMAPFILES += partmap-_linux_mod-loader_i386_efi_linux.lst - -cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) - -fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) - -partmap-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) - - -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/i386/efi/linux.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1392,9 +1298,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_efi_linux.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1411,23 +1317,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_linux_normal.d +linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_efi_linux.d -CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst -FSFILES += fs-linux_mod-loader_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_efi_linux.lst fs-linux_mod-loader_i386_efi_linux.lst partmap-linux_mod-loader_i386_efi_linux.lst +COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux.lst +FSFILES += fs-linux_mod-loader_i386_efi_linux.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux.lst -cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 1c372cd26..18a99df7e 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -32,7 +32,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ @@ -48,10 +48,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -76,8 +77,8 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. -pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - _linux.mod linux.mod halt.mod reboot.mod pci.mod lspci.mod \ +pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ + linux.mod halt.mod reboot.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -88,14 +89,14 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c -kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h list.h handler.h + efi/efi.h efi/time.h efi/disk.h list.h handler.h command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -118,7 +119,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -131,13 +132,8 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _chain.mod. -_chain_mod_SOURCES = loader/efi/chainloader.c -_chain_mod_CFLAGS = $(COMMON_CFLAGS) -_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. -chain_mod_SOURCES = loader/efi/chainloader_normal.c +chain_mod_SOURCES = loader/efi/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -146,13 +142,8 @@ appleldr_mod_SOURCES = loader/efi/appleloader.c appleldr_mod_CFLAGS = $(COMMON_CFLAGS) appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/efi/linux.c -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c +linux_mod_SOURCES = loader/i386/efi/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 3e7f34e6b..5c140e8b8 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -21,17 +21,17 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c \ disk/ieee1275/ofdisk.c \ symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d +CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o +MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_command.d kernel_elf-kern_corecmd.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o + $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -133,6 +133,14 @@ kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_handler.d +kernel_elf-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_command.d + +kernel_elf-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_corecmd.d + kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_generic_millisleep.d @@ -153,11 +161,11 @@ kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-symlist.d -kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_elf_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ - list.h handler.h + list.h handler.h command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic @@ -195,7 +203,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ @@ -212,10 +220,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ @@ -229,15 +238,15 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) -grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) +grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_boot.d +-include grub_emu-commands_minicmd.d grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -419,6 +428,18 @@ grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_handler.d +grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_command.d + +grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_corecmd.d + +grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_extcmd.d + grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_execute.d @@ -467,9 +488,9 @@ grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_term.d -grub_emu-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_arg.d +grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_arg.d grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -616,8 +637,8 @@ grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPE # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ - multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ + multiboot.mod aout.mod serial.mod linux.mod \ + nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod lsmmap.mod # @@ -628,7 +649,7 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -637,12 +658,12 @@ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -651,9 +672,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -670,25 +691,6 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_arg.d - -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst -COMMANDFILES += cmd-normal_mod-normal_arg.lst -FSFILES += fs-normal_mod-normal_arg.lst -PARTMAPFILES += partmap-normal_mod-normal_arg.lst - -cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -997,111 +999,16 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod. -_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ +# For multiboot.mod. +multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst -ifneq ($(_multiboot_mod_EXPORTS),no) -CLEANFILES += def-_multiboot.lst -DEFSYMFILES += def-_multiboot.lst -endif -MOSTLYCLEANFILES += _multiboot_mod-loader_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-_multiboot.lst - -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -mod-_multiboot.o: mod-_multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< - -mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_multiboot_mod_EXPORTS),no) -def-_multiboot.lst: pre-_multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _multiboot/' > $@ -endif - -und-_multiboot.lst: pre-_multiboot.o - echo '_multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_ieee1275_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_ieee1275_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst - -cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst - -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst - -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod. -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_multiboot_loader_normal.o und-multiboot.lst +CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst ifneq ($(multiboot_mod_EXPORTS),no) CLEANFILES += def-multiboot.lst DEFSYMFILES += def-multiboot.lst endif -MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d +MOSTLYCLEANFILES += multiboot_mod-loader_ieee1275_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) @@ -1110,9 +1017,9 @@ multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o +pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_multiboot_loader_normal.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< @@ -1129,22 +1036,60 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) +multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_ieee1275_multiboot2.d + +CLEANFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst fs-multiboot_mod-loader_ieee1275_multiboot2.lst partmap-multiboot_mod-loader_ieee1275_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_ieee1275_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_ieee1275_multiboot2.lst + +cmd-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader_normal.d +-include multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh +fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) -partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_multiboot_loader.d + +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst +FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst + +cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -1436,71 +1381,14 @@ partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/ieee1275/linux.c -CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_ieee1275_linux.o und-_linux.lst -ifneq ($(_linux_mod_EXPORTS),no) -CLEANFILES += def-_linux.lst -DEFSYMFILES += def-_linux.lst -endif -MOSTLYCLEANFILES += _linux_mod-loader_i386_ieee1275_linux.d -UNDSYMFILES += und-_linux.lst - -_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_ieee1275_linux.o - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_ieee1275_linux.o - -mod-_linux.o: mod-_linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< - -mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_linux_mod_EXPORTS),no) -def-_linux.lst: pre-_linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ -endif - -und-_linux.lst: pre-_linux.o - echo '_linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_linux_mod-loader_i386_ieee1275_linux.o: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< --include _linux_mod-loader_i386_ieee1275_linux.d - -CLEANFILES += cmd-_linux_mod-loader_i386_ieee1275_linux.lst fs-_linux_mod-loader_i386_ieee1275_linux.lst partmap-_linux_mod-loader_i386_ieee1275_linux.lst -COMMANDFILES += cmd-_linux_mod-loader_i386_ieee1275_linux.lst -FSFILES += fs-_linux_mod-loader_i386_ieee1275_linux.lst -PARTMAPFILES += partmap-_linux_mod-loader_i386_ieee1275_linux.lst - -cmd-_linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) - -fs-_linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) - -partmap-_linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) - - -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/i386/ieee1275/linux.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_ieee1275_linux.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_i386_ieee1275_linux.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1509,9 +1397,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_ieee1275_linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_ieee1275_linux.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1528,23 +1416,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_linux_normal.d +linux_mod-loader_i386_ieee1275_linux.o: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_ieee1275_linux.d -CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst -FSFILES += fs-linux_mod-loader_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_ieee1275_linux.lst fs-linux_mod-loader_i386_ieee1275_linux.lst partmap-linux_mod-loader_i386_ieee1275_linux.lst +COMMANDFILES += cmd-linux_mod-loader_i386_ieee1275_linux.lst +FSFILES += fs-linux_mod-loader_i386_ieee1275_linux.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_ieee1275_linux.lst -cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 089055cea..dbcbb4a8e 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -20,17 +20,17 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/generic/millisleep.c \ kern/ieee1275/ieee1275.c \ term/ieee1275/ofconsole.c \ disk/ieee1275/ofdisk.c \ symlist.c -kernel_elf_HEADERS = arg.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_elf_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ - list.h handler.h + list.h handler.h command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic @@ -54,7 +54,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ @@ -71,10 +71,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ @@ -99,8 +100,8 @@ grub_install_SOURCES = util/ieee1275/grub-install.in # Modules. pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ - multiboot.mod _multiboot.mod aout.mod serial.mod linux.mod \ - _linux.mod nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ + multiboot.mod aout.mod serial.mod linux.mod \ + nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod lsmmap.mod # @@ -111,7 +112,7 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -124,15 +125,10 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod. -_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ +# For multiboot.mod. +multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod. -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -161,13 +157,8 @@ serial_mod_SOURCES = term/i386/pc/serial.c serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/ieee1275/linux.c -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c +linux_mod_SOURCES = loader/i386/ieee1275/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index e122e7021..b728dacc7 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -108,7 +108,7 @@ cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ @@ -117,13 +117,13 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/env.c \ term/i386/pc/console.c term/i386/vga_common.c \ symlist.c -CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o -MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_list.d kernel_img-kern_handler.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d +CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_command.o kernel_img-kern_corecmd.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o +MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_list.d kernel_img-kern_handler.d kernel_img-kern_command.d kernel_img-kern_corecmd.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d kernel.img: kernel.exec $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ -kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o +kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_command.o kernel_img-kern_corecmd.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) @@ -190,6 +190,14 @@ kernel_img-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_handler.d +kernel_img-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_command.d + +kernel_img-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< +-include kernel_img-kern_corecmd.d + kernel_img-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-kern_i386_dl.d @@ -242,12 +250,12 @@ kernel_img-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< -include kernel_img-symlist.d -kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ - machine/kernel.h machine/pxe.h list.h handler.h + machine/kernel.h machine/pxe.h list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) @@ -527,7 +535,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ @@ -539,10 +547,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -562,15 +571,15 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) -grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) +grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_boot.d +-include grub_emu-commands_minicmd.d grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -684,6 +693,18 @@ grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_handler.d +grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_command.d + +grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_corecmd.d + +grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_extcmd.d + grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_execute.d @@ -732,9 +753,9 @@ grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-kern_term.d -grub_emu-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_arg.d +grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_arg.d grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -989,12 +1010,11 @@ grub-mkrescue: util/i386/pc/grub-mkrescue.in $(util/i386/pc/grub-mkrescue.in_DEP chmod +x $@ -# Modules. -pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ - _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ +pkglib_MODULES = biosdisk.mod chain.mod linux.mod normal.mod \ + multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ - ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ - aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ + ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ + aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod @@ -1055,71 +1075,14 @@ partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i biosdisk_mod_CFLAGS = $(COMMON_CFLAGS) biosdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _chain.mod. -_chain_mod_SOURCES = loader/i386/pc/chainloader.c -CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_i386_pc_chainloader.o und-_chain.lst -ifneq ($(_chain_mod_EXPORTS),no) -CLEANFILES += def-_chain.lst -DEFSYMFILES += def-_chain.lst -endif -MOSTLYCLEANFILES += _chain_mod-loader_i386_pc_chainloader.d -UNDSYMFILES += und-_chain.lst - -_chain.mod: pre-_chain.o mod-_chain.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_chain.o mod-_chain.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_i386_pc_chainloader.o - -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _chain_mod-loader_i386_pc_chainloader.o - -mod-_chain.o: mod-_chain.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $< - -mod-_chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_chain_mod_EXPORTS),no) -def-_chain.lst: pre-_chain.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _chain/' > $@ -endif - -und-_chain.lst: pre-_chain.o - echo '_chain' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< --include _chain_mod-loader_i386_pc_chainloader.d - -CLEANFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst fs-_chain_mod-loader_i386_pc_chainloader.lst partmap-_chain_mod-loader_i386_pc_chainloader.lst -COMMANDFILES += cmd-_chain_mod-loader_i386_pc_chainloader.lst -FSFILES += fs-_chain_mod-loader_i386_pc_chainloader.lst -PARTMAPFILES += partmap-_chain_mod-loader_i386_pc_chainloader.lst - -cmd-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) - -fs-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) - -partmap-_chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _chain > $@ || (rm -f $@; exit 1) - - -_chain_mod_CFLAGS = $(COMMON_CFLAGS) -_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. -chain_mod_SOURCES = loader/i386/pc/chainloader_normal.c -CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_i386_pc_chainloader_normal.o und-chain.lst +chain_mod_SOURCES = loader/i386/pc/chainloader.c +CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_i386_pc_chainloader.o und-chain.lst ifneq ($(chain_mod_EXPORTS),no) CLEANFILES += def-chain.lst DEFSYMFILES += def-chain.lst endif -MOSTLYCLEANFILES += chain_mod-loader_i386_pc_chainloader_normal.d +MOSTLYCLEANFILES += chain_mod-loader_i386_pc_chainloader.d UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) @@ -1128,9 +1091,9 @@ chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_i386_pc_chainloader_normal.o +pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_i386_pc_chainloader.o -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_i386_pc_chainloader_normal.o + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_i386_pc_chainloader.o mod-chain.o: mod-chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< @@ -1147,22 +1110,22 @@ und-chain.lst: pre-chain.o echo 'chain' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -chain_mod-loader_i386_pc_chainloader_normal.o: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) +chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< --include chain_mod-loader_i386_pc_chainloader_normal.d +-include chain_mod-loader_i386_pc_chainloader.d -CLEANFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst fs-chain_mod-loader_i386_pc_chainloader_normal.lst partmap-chain_mod-loader_i386_pc_chainloader_normal.lst -COMMANDFILES += cmd-chain_mod-loader_i386_pc_chainloader_normal.lst -FSFILES += fs-chain_mod-loader_i386_pc_chainloader_normal.lst -PARTMAPFILES += partmap-chain_mod-loader_i386_pc_chainloader_normal.lst +CLEANFILES += cmd-chain_mod-loader_i386_pc_chainloader.lst fs-chain_mod-loader_i386_pc_chainloader.lst partmap-chain_mod-loader_i386_pc_chainloader.lst +COMMANDFILES += cmd-chain_mod-loader_i386_pc_chainloader.lst +FSFILES += fs-chain_mod-loader_i386_pc_chainloader.lst +PARTMAPFILES += partmap-chain_mod-loader_i386_pc_chainloader.lst -cmd-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) -fs-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) genfslist.sh +fs-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) -partmap-chain_mod-loader_i386_pc_chainloader_normal.lst: loader/i386/pc/chainloader_normal.c $(loader/i386/pc/chainloader_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) @@ -1170,70 +1133,13 @@ chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _linux.mod. -_linux_mod_SOURCES = loader/i386/pc/linux.c -CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_pc_linux.o und-_linux.lst -ifneq ($(_linux_mod_EXPORTS),no) -CLEANFILES += def-_linux.lst -DEFSYMFILES += def-_linux.lst -endif -MOSTLYCLEANFILES += _linux_mod-loader_i386_pc_linux.d -UNDSYMFILES += und-_linux.lst - -_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_pc_linux.o - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_pc_linux.o - -mod-_linux.o: mod-_linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< - -mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_linux_mod_EXPORTS),no) -def-_linux.lst: pre-_linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ -endif - -und-_linux.lst: pre-_linux.o - echo '_linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< --include _linux_mod-loader_i386_pc_linux.d - -CLEANFILES += cmd-_linux_mod-loader_i386_pc_linux.lst fs-_linux_mod-loader_i386_pc_linux.lst partmap-_linux_mod-loader_i386_pc_linux.lst -COMMANDFILES += cmd-_linux_mod-loader_i386_pc_linux.lst -FSFILES += fs-_linux_mod-loader_i386_pc_linux.lst -PARTMAPFILES += partmap-_linux_mod-loader_i386_pc_linux.lst - -cmd-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) - -fs-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) - -partmap-_linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) - - -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/i386/pc/linux.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_pc_linux.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1242,9 +1148,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_pc_linux.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1261,23 +1167,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_linux_normal.d +linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_pc_linux.d -CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst -FSFILES += fs-linux_mod-loader_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_pc_linux.lst fs-linux_mod-loader_i386_pc_linux.lst partmap-linux_mod-loader_i386_pc_linux.lst +COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux.lst +FSFILES += fs-linux_mod-loader_i386_pc_linux.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_pc_linux.lst -cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1291,7 +1197,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -1300,12 +1206,12 @@ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -1314,9 +1220,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -1333,25 +1239,6 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_arg.d - -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst -COMMANDFILES += cmd-normal_mod-normal_arg.lst -FSFILES += fs-normal_mod-normal_arg.lst -PARTMAPFILES += partmap-normal_mod-normal_arg.lst - -cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -1831,131 +1718,17 @@ partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/multiboot.c \ - loader/i386/pc/multiboot2.c \ - loader/multiboot2.c \ - loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst -ifneq ($(_multiboot_mod_EXPORTS),no) -CLEANFILES += def-_multiboot.lst -DEFSYMFILES += def-_multiboot.lst -endif -MOSTLYCLEANFILES += _multiboot_mod-loader_i386_multiboot.d _multiboot_mod-loader_i386_pc_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-_multiboot.lst - -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_i386_multiboot.o _multiboot_mod-loader_i386_pc_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -mod-_multiboot.o: mod-_multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< - -mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_multiboot_mod_EXPORTS),no) -def-_multiboot.lst: pre-_multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _multiboot/' > $@ -endif - -und-_multiboot.lst: pre-_multiboot.o - echo '_multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_i386_multiboot.d - -CLEANFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst fs-_multiboot_mod-loader_i386_multiboot.lst partmap-_multiboot_mod-loader_i386_multiboot.lst -COMMANDFILES += cmd-_multiboot_mod-loader_i386_multiboot.lst -FSFILES += fs-_multiboot_mod-loader_i386_multiboot.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_i386_multiboot.lst - -cmd-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_i386_pc_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst fs-_multiboot_mod-loader_i386_pc_multiboot2.lst partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_i386_pc_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst - -cmd-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst - -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst - -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For multiboot.mod. -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_multiboot_loader_normal.o und-multiboot.lst +multiboot_mod_SOURCES = loader/i386/multiboot.c \ + loader/i386/pc/multiboot2.c \ + loader/multiboot2.c \ + loader/multiboot_loader.c +CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst ifneq ($(multiboot_mod_EXPORTS),no) CLEANFILES += def-multiboot.lst DEFSYMFILES += def-multiboot.lst endif -MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d +MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) @@ -1964,9 +1737,9 @@ multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o +pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_multiboot_loader_normal.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< @@ -1983,22 +1756,79 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) +multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_i386_multiboot.d + +CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot.lst fs-multiboot_mod-loader_i386_multiboot.lst partmap-multiboot_mod-loader_i386_multiboot.lst +COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot.lst +FSFILES += fs-multiboot_mod-loader_i386_multiboot.lst +PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot.lst + +cmd-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_i386_pc_multiboot2.d + +CLEANFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst fs-multiboot_mod-loader_i386_pc_multiboot2.lst partmap-multiboot_mod-loader_i386_pc_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_i386_pc_multiboot2.lst + +cmd-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader_normal.d +-include multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh +fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) -partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_multiboot_loader.d + +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst +FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst + +cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) @@ -2633,71 +2463,14 @@ partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) ge aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _bsd.mod -_bsd_mod_SOURCES = loader/i386/bsd.c -CLEANFILES += _bsd.mod mod-_bsd.o mod-_bsd.c pre-_bsd.o _bsd_mod-loader_i386_bsd.o und-_bsd.lst -ifneq ($(_bsd_mod_EXPORTS),no) -CLEANFILES += def-_bsd.lst -DEFSYMFILES += def-_bsd.lst -endif -MOSTLYCLEANFILES += _bsd_mod-loader_i386_bsd.d -UNDSYMFILES += und-_bsd.lst - -_bsd.mod: pre-_bsd.o mod-_bsd.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_bsd.o mod-_bsd.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_bsd.o: $(_bsd_mod_DEPENDENCIES) _bsd_mod-loader_i386_bsd.o - -rm -f $@ - $(TARGET_CC) $(_bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _bsd_mod-loader_i386_bsd.o - -mod-_bsd.o: mod-_bsd.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -c -o $@ $< - -mod-_bsd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_bsd' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_bsd_mod_EXPORTS),no) -def-_bsd.lst: pre-_bsd.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _bsd/' > $@ -endif - -und-_bsd.lst: pre-_bsd.o - echo '_bsd' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_bsd_mod-loader_i386_bsd.o: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -MD -c -o $@ $< --include _bsd_mod-loader_i386_bsd.d - -CLEANFILES += cmd-_bsd_mod-loader_i386_bsd.lst fs-_bsd_mod-loader_i386_bsd.lst partmap-_bsd_mod-loader_i386_bsd.lst -COMMANDFILES += cmd-_bsd_mod-loader_i386_bsd.lst -FSFILES += fs-_bsd_mod-loader_i386_bsd.lst -PARTMAPFILES += partmap-_bsd_mod-loader_i386_bsd.lst - -cmd-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _bsd > $@ || (rm -f $@; exit 1) - -fs-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _bsd > $@ || (rm -f $@; exit 1) - -partmap-_bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _bsd > $@ || (rm -f $@; exit 1) - - -_bsd_mod_CFLAGS = $(COMMON_CFLAGS) -_bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For bsd.mod -bsd_mod_SOURCES = loader/i386/bsd_normal.c -CLEANFILES += bsd.mod mod-bsd.o mod-bsd.c pre-bsd.o bsd_mod-loader_i386_bsd_normal.o und-bsd.lst +bsd_mod_SOURCES = loader/i386/bsd.c +CLEANFILES += bsd.mod mod-bsd.o mod-bsd.c pre-bsd.o bsd_mod-loader_i386_bsd.o und-bsd.lst ifneq ($(bsd_mod_EXPORTS),no) CLEANFILES += def-bsd.lst DEFSYMFILES += def-bsd.lst endif -MOSTLYCLEANFILES += bsd_mod-loader_i386_bsd_normal.d +MOSTLYCLEANFILES += bsd_mod-loader_i386_bsd.d UNDSYMFILES += und-bsd.lst bsd.mod: pre-bsd.o mod-bsd.o $(TARGET_OBJ2ELF) @@ -2706,9 +2479,9 @@ bsd.mod: pre-bsd.o mod-bsd.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-bsd.o: $(bsd_mod_DEPENDENCIES) bsd_mod-loader_i386_bsd_normal.o +pre-bsd.o: $(bsd_mod_DEPENDENCIES) bsd_mod-loader_i386_bsd.o -rm -f $@ - $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bsd_mod-loader_i386_bsd_normal.o + $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bsd_mod-loader_i386_bsd.o mod-bsd.o: mod-bsd.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -c -o $@ $< @@ -2725,22 +2498,22 @@ und-bsd.lst: pre-bsd.o echo 'bsd' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -bsd_mod-loader_i386_bsd_normal.o: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) +bsd_mod-loader_i386_bsd.o: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -MD -c -o $@ $< --include bsd_mod-loader_i386_bsd_normal.d +-include bsd_mod-loader_i386_bsd.d -CLEANFILES += cmd-bsd_mod-loader_i386_bsd_normal.lst fs-bsd_mod-loader_i386_bsd_normal.lst partmap-bsd_mod-loader_i386_bsd_normal.lst -COMMANDFILES += cmd-bsd_mod-loader_i386_bsd_normal.lst -FSFILES += fs-bsd_mod-loader_i386_bsd_normal.lst -PARTMAPFILES += partmap-bsd_mod-loader_i386_bsd_normal.lst +CLEANFILES += cmd-bsd_mod-loader_i386_bsd.lst fs-bsd_mod-loader_i386_bsd.lst partmap-bsd_mod-loader_i386_bsd.lst +COMMANDFILES += cmd-bsd_mod-loader_i386_bsd.lst +FSFILES += fs-bsd_mod-loader_i386_bsd.lst +PARTMAPFILES += partmap-bsd_mod-loader_i386_bsd.lst -cmd-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bsd > $@ || (rm -f $@; exit 1) -fs-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) genfslist.sh +fs-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bsd > $@ || (rm -f $@; exit 1) -partmap-bsd_mod-loader_i386_bsd_normal.lst: loader/i386/bsd_normal.c $(loader/i386/bsd_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bsd > $@ || (rm -f $@; exit 1) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index c996e45e2..cc845ed68 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -42,7 +42,7 @@ cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ @@ -51,12 +51,12 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/env.c \ term/i386/pc/console.c term/i386/vga_common.c \ symlist.c -kernel_img_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ - machine/kernel.h machine/pxe.h list.h handler.h + machine/kernel.h machine/pxe.h list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) @@ -112,7 +112,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ @@ -124,10 +124,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -166,12 +167,11 @@ grub_install_SOURCES = util/i386/pc/grub-install.in # For grub-mkrescue. grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in -# Modules. -pkglib_MODULES = biosdisk.mod _chain.mod _linux.mod linux.mod normal.mod \ - _multiboot.mod chain.mod multiboot.mod reboot.mod halt.mod \ +pkglib_MODULES = biosdisk.mod chain.mod linux.mod normal.mod \ + multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ - ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ - aout.mod _bsd.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ + ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ + aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod @@ -180,23 +180,13 @@ biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c biosdisk_mod_CFLAGS = $(COMMON_CFLAGS) biosdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _chain.mod. -_chain_mod_SOURCES = loader/i386/pc/chainloader.c -_chain_mod_CFLAGS = $(COMMON_CFLAGS) -_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. -chain_mod_SOURCES = loader/i386/pc/chainloader_normal.c +chain_mod_SOURCES = loader/i386/pc/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) # For _linux.mod. -_linux_mod_SOURCES = loader/i386/pc/linux.c -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c +linux_mod_SOURCES = loader/i386/pc/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -208,7 +198,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -236,16 +226,11 @@ serial_mod_SOURCES = term/i386/pc/serial.c serial_mod_CFLAGS = $(COMMON_CFLAGS) serial_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod. -_multiboot_mod_SOURCES = loader/i386/multiboot.c \ - loader/i386/pc/multiboot2.c \ - loader/multiboot2.c \ - loader/multiboot_loader.c -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For multiboot.mod. -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c +multiboot_mod_SOURCES = loader/i386/multiboot.c \ + loader/i386/pc/multiboot2.c \ + loader/multiboot2.c \ + loader/multiboot_loader.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -300,13 +285,8 @@ aout_mod_SOURCES = loader/aout.c aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _bsd.mod -_bsd_mod_SOURCES = loader/i386/bsd.c -_bsd_mod_CFLAGS = $(COMMON_CFLAGS) -_bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For bsd.mod -bsd_mod_SOURCES = loader/i386/bsd_normal.c +bsd_mod_SOURCES = loader/i386/bsd.c bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 436c2bf39..47c965f65 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -14,7 +14,7 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h @@ -53,7 +53,7 @@ grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ @@ -70,7 +70,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ - normal/arg.c normal/cmdline.c normal/command.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ + lib/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -86,15 +87,15 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_boot.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-normal_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_boot.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-normal_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) -grub_emu-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) +grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_boot.d +-include grub_emu-commands_minicmd.d grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -300,9 +301,21 @@ grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-fs_fshelp.d -grub_emu-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_arg.d +grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_command.d + +grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-kern_corecmd.d + +grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_extcmd.d + +grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) + $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-lib_arg.d grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -447,7 +460,7 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/list.c kern/handler.c \ + kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ term/ieee1275/ofconsole.c \ @@ -455,11 +468,11 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d +CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o +MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_command.d kernel_elf-kern_corecmd.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) +kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o + $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) kernel_elf-kern_powerpc_ieee1275_startup.o: kern/powerpc/ieee1275/startup.S $(kern/powerpc/ieee1275/startup.S_DEPENDENCIES) $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< @@ -529,6 +542,14 @@ kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_handler.d +kernel_elf-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_command.d + +kernel_elf-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< +-include kernel_elf-kern_corecmd.d + kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEPENDENCIES) $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_ieee1275_init.d @@ -581,7 +602,8 @@ kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S $(kern/powerpc/cache.S_DEP $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_cache.d -kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h +kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h list.h handler.h \ + command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ @@ -611,81 +633,22 @@ grub-mkrescue: util/powerpc/ieee1275/grub-mkrescue.in $(util/powerpc/ieee1275/gr # Modules. pkglib_MODULES = halt.mod \ - _linux.mod \ linux.mod \ normal.mod \ reboot.mod \ suspend.mod \ - _multiboot.mod \ multiboot.mod \ memdisk.mod \ lsmmap.mod -# For _linux.mod. -_linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c -CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_powerpc_ieee1275_linux.o und-_linux.lst -ifneq ($(_linux_mod_EXPORTS),no) -CLEANFILES += def-_linux.lst -DEFSYMFILES += def-_linux.lst -endif -MOSTLYCLEANFILES += _linux_mod-loader_powerpc_ieee1275_linux.d -UNDSYMFILES += und-_linux.lst - -_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_powerpc_ieee1275_linux.o - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_powerpc_ieee1275_linux.o - -mod-_linux.o: mod-_linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< - -mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_linux_mod_EXPORTS),no) -def-_linux.lst: pre-_linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ -endif - -und-_linux.lst: pre-_linux.o - echo '_linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< --include _linux_mod-loader_powerpc_ieee1275_linux.d - -CLEANFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst fs-_linux_mod-loader_powerpc_ieee1275_linux.lst partmap-_linux_mod-loader_powerpc_ieee1275_linux.lst -COMMANDFILES += cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst -FSFILES += fs-_linux_mod-loader_powerpc_ieee1275_linux.lst -PARTMAPFILES += partmap-_linux_mod-loader_powerpc_ieee1275_linux.lst - -cmd-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) - -fs-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) - -partmap-_linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) - - -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_powerpc_ieee1275_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_powerpc_ieee1275_linux.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_powerpc_ieee1275_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_powerpc_ieee1275_linux.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -694,9 +657,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_powerpc_ieee1275_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_powerpc_ieee1275_linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_powerpc_ieee1275_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_powerpc_ieee1275_linux.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -713,22 +676,22 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_powerpc_ieee1275_linux_normal.o: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) +linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_powerpc_ieee1275_linux_normal.d +-include linux_mod-loader_powerpc_ieee1275_linux.d -CLEANFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst partmap-linux_mod-loader_powerpc_ieee1275_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst -FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_powerpc_ieee1275_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux.lst fs-linux_mod-loader_powerpc_ieee1275_linux.lst partmap-linux_mod-loader_powerpc_ieee1275_linux.lst +COMMANDFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux.lst +FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux.lst +PARTMAPFILES += partmap-linux_mod-loader_powerpc_ieee1275_linux.lst -cmd-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) genfslist.sh +fs-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_powerpc_ieee1275_linux_normal.lst: loader/powerpc/ieee1275/linux_normal.c $(loader/powerpc/ieee1275/linux_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) @@ -743,7 +706,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -752,12 +715,12 @@ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/powerpc/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -766,9 +729,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -785,25 +748,6 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_arg.d - -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst -COMMANDFILES += cmd-normal_mod-normal_arg.lst -FSFILES += fs-normal_mod-normal_arg.lst -PARTMAPFILES += partmap-normal_mod-normal_arg.lst - -cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -1283,111 +1227,16 @@ partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCI halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod -_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ +# For multiboot.mod +multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += _multiboot.mod mod-_multiboot.o mod-_multiboot.c pre-_multiboot.o _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o und-_multiboot.lst -ifneq ($(_multiboot_mod_EXPORTS),no) -CLEANFILES += def-_multiboot.lst -DEFSYMFILES += def-_multiboot.lst -endif -MOSTLYCLEANFILES += _multiboot_mod-loader_ieee1275_multiboot2.d _multiboot_mod-loader_multiboot2.d _multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-_multiboot.lst - -_multiboot.mod: pre-_multiboot.o mod-_multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_multiboot.o mod-_multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_multiboot.o: $(_multiboot_mod_DEPENDENCIES) _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(_multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _multiboot_mod-loader_ieee1275_multiboot2.o _multiboot_mod-loader_multiboot2.o _multiboot_mod-loader_multiboot_loader.o - -mod-_multiboot.o: mod-_multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -c -o $@ $< - -mod-_multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_multiboot_mod_EXPORTS),no) -def-_multiboot.lst: pre-_multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _multiboot/' > $@ -endif - -und-_multiboot.lst: pre-_multiboot.o - echo '_multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_ieee1275_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst fs-_multiboot_mod-loader_ieee1275_multiboot2.lst partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_ieee1275_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst - -cmd-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot2.lst fs-_multiboot_mod-loader_multiboot2.lst partmap-_multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot2.lst -FSFILES += fs-_multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot2.lst - -cmd-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -MD -c -o $@ $< --include _multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst fs-_multiboot_mod-loader_multiboot_loader.lst partmap-_multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-_multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-_multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-_multiboot_mod-loader_multiboot_loader.lst - -cmd-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _multiboot > $@ || (rm -f $@; exit 1) - -fs-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _multiboot > $@ || (rm -f $@; exit 1) - -partmap-_multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _multiboot > $@ || (rm -f $@; exit 1) - - -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_multiboot_loader_normal.o und-multiboot.lst +CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst ifneq ($(multiboot_mod_EXPORTS),no) CLEANFILES += def-multiboot.lst DEFSYMFILES += def-multiboot.lst endif -MOSTLYCLEANFILES += multiboot_mod-loader_multiboot_loader_normal.d +MOSTLYCLEANFILES += multiboot_mod-loader_ieee1275_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) @@ -1396,9 +1245,9 @@ multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_multiboot_loader_normal.o +pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_multiboot_loader_normal.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< @@ -1415,22 +1264,60 @@ und-multiboot.lst: pre-multiboot.o echo 'multiboot' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -multiboot_mod-loader_multiboot_loader_normal.o: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) +multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_ieee1275_multiboot2.d + +CLEANFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst fs-multiboot_mod-loader_ieee1275_multiboot2.lst partmap-multiboot_mod-loader_ieee1275_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_ieee1275_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_ieee1275_multiboot2.lst + +cmd-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader_normal.d +-include multiboot_mod-loader_multiboot2.d -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst fs-multiboot_mod-loader_multiboot_loader_normal.lst partmap-multiboot_mod-loader_multiboot_loader_normal.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader_normal.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader_normal.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader_normal.lst +CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst +FSFILES += fs-multiboot_mod-loader_multiboot2.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst -cmd-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) -fs-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genfslist.sh +fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) -partmap-multiboot_mod-loader_multiboot_loader_normal.lst: loader/multiboot_loader_normal.c $(loader/multiboot_loader_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + +multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) + $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_multiboot_loader.d + +CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst +COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst +FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst +PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst + +cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 8b0401892..5aaaf5629 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -13,7 +13,7 @@ normal/lexer.c_DEPENDENCIES = grub_script.tab.h MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h @@ -38,7 +38,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ @@ -55,7 +55,8 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ - normal/arg.c normal/cmdline.c normal/command.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ + lib/arg.c normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -78,7 +79,7 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/list.c kern/handler.c \ + kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ term/ieee1275/ofconsole.c \ @@ -86,7 +87,8 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h +kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h list.h handler.h \ + command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ @@ -104,23 +106,16 @@ grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in # Modules. pkglib_MODULES = halt.mod \ - _linux.mod \ linux.mod \ normal.mod \ reboot.mod \ suspend.mod \ - _multiboot.mod \ multiboot.mod \ memdisk.mod \ lsmmap.mod -# For _linux.mod. -_linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/powerpc/ieee1275/linux_normal.c +linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -132,7 +127,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -160,15 +155,10 @@ halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _multiboot.mod -_multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ +# For multiboot.mod +multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -_multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -_multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod -multiboot_mod_SOURCES = loader/multiboot_loader_normal.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 608407115..f22840caf 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -53,7 +53,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ @@ -69,10 +69,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -103,8 +104,8 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. -pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ +pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ + halt.mod reboot.mod linux.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -115,16 +116,16 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst +CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst ifneq ($(kernel_mod_EXPORTS),no) CLEANFILES += def-kernel.lst DEFSYMFILES += def-kernel.lst endif -MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d +MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_command.d kernel_mod-kern_corecmd.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) @@ -133,9 +134,9 @@ kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o +pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o mod-kernel.o: mod-kernel.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< @@ -646,6 +647,44 @@ partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIE set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) +kernel_mod-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_command.d + +CLEANFILES += cmd-kernel_mod-kern_command.lst fs-kernel_mod-kern_command.lst partmap-kernel_mod-kern_command.lst +COMMANDFILES += cmd-kernel_mod-kern_command.lst +FSFILES += fs-kernel_mod-kern_command.lst +PARTMAPFILES += partmap-kernel_mod-kern_command.lst + +cmd-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + +kernel_mod-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) + $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< +-include kernel_mod-kern_corecmd.d + +CLEANFILES += cmd-kernel_mod-kern_corecmd.lst fs-kernel_mod-kern_corecmd.lst partmap-kernel_mod-kern_corecmd.lst +COMMANDFILES += cmd-kernel_mod-kern_corecmd.lst +FSFILES += fs-kernel_mod-kern_corecmd.lst +PARTMAPFILES += partmap-kernel_mod-kern_corecmd.lst + +cmd-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + +fs-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + +partmap-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + + kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< -include kernel_mod-kern_i386_tsc.d @@ -760,10 +799,11 @@ partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) -kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h + efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h \ + command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -786,7 +826,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -795,12 +835,12 @@ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/x86_64/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -809,9 +849,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -828,25 +868,6 @@ und-normal.lst: pre-normal.o echo 'normal' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_arg.d - -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst -COMMANDFILES += cmd-normal_mod-normal_arg.lst -FSFILES += fs-normal_mod-normal_arg.lst -PARTMAPFILES += partmap-normal_mod-normal_arg.lst - -cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_cmdline.d @@ -1155,71 +1176,14 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _chain.mod. -_chain_mod_SOURCES = loader/efi/chainloader.c -CLEANFILES += _chain.mod mod-_chain.o mod-_chain.c pre-_chain.o _chain_mod-loader_efi_chainloader.o und-_chain.lst -ifneq ($(_chain_mod_EXPORTS),no) -CLEANFILES += def-_chain.lst -DEFSYMFILES += def-_chain.lst -endif -MOSTLYCLEANFILES += _chain_mod-loader_efi_chainloader.d -UNDSYMFILES += und-_chain.lst - -_chain.mod: pre-_chain.o mod-_chain.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_chain.o mod-_chain.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_chain.o: $(_chain_mod_DEPENDENCIES) _chain_mod-loader_efi_chainloader.o - -rm -f $@ - $(TARGET_CC) $(_chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _chain_mod-loader_efi_chainloader.o - -mod-_chain.o: mod-_chain.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -c -o $@ $< - -mod-_chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_chain' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_chain_mod_EXPORTS),no) -def-_chain.lst: pre-_chain.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _chain/' > $@ -endif - -und-_chain.lst: pre-_chain.o - echo '_chain' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -MD -c -o $@ $< --include _chain_mod-loader_efi_chainloader.d - -CLEANFILES += cmd-_chain_mod-loader_efi_chainloader.lst fs-_chain_mod-loader_efi_chainloader.lst partmap-_chain_mod-loader_efi_chainloader.lst -COMMANDFILES += cmd-_chain_mod-loader_efi_chainloader.lst -FSFILES += fs-_chain_mod-loader_efi_chainloader.lst -PARTMAPFILES += partmap-_chain_mod-loader_efi_chainloader.lst - -cmd-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _chain > $@ || (rm -f $@; exit 1) - -fs-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _chain > $@ || (rm -f $@; exit 1) - -partmap-_chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _chain > $@ || (rm -f $@; exit 1) - - -_chain_mod_CFLAGS = $(COMMON_CFLAGS) -_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. -chain_mod_SOURCES = loader/efi/chainloader_normal.c -CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader_normal.o und-chain.lst +chain_mod_SOURCES = loader/efi/chainloader.c +CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader.o und-chain.lst ifneq ($(chain_mod_EXPORTS),no) CLEANFILES += def-chain.lst DEFSYMFILES += def-chain.lst endif -MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader_normal.d +MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader.d UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) @@ -1228,9 +1192,9 @@ chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader_normal.o +pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader.o -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_efi_chainloader_normal.o + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_efi_chainloader.o mod-chain.o: mod-chain.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< @@ -1247,22 +1211,22 @@ und-chain.lst: pre-chain.o echo 'chain' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -chain_mod-loader_efi_chainloader_normal.o: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) +chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< --include chain_mod-loader_efi_chainloader_normal.d +-include chain_mod-loader_efi_chainloader.d -CLEANFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst fs-chain_mod-loader_efi_chainloader_normal.lst partmap-chain_mod-loader_efi_chainloader_normal.lst -COMMANDFILES += cmd-chain_mod-loader_efi_chainloader_normal.lst -FSFILES += fs-chain_mod-loader_efi_chainloader_normal.lst -PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader_normal.lst +CLEANFILES += cmd-chain_mod-loader_efi_chainloader.lst fs-chain_mod-loader_efi_chainloader.lst partmap-chain_mod-loader_efi_chainloader.lst +COMMANDFILES += cmd-chain_mod-loader_efi_chainloader.lst +FSFILES += fs-chain_mod-loader_efi_chainloader.lst +PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader.lst -cmd-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) gencmdlist.sh +cmd-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) -fs-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genfslist.sh +fs-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) -partmap-chain_mod-loader_efi_chainloader_normal.lst: loader/efi/chainloader_normal.c $(loader/efi/chainloader_normal.c_DEPENDENCIES) genpartmaplist.sh +partmap-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) @@ -1326,71 +1290,14 @@ partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(load appleldr_mod_CFLAGS = $(COMMON_CFLAGS) appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/efi/linux.c -CLEANFILES += _linux.mod mod-_linux.o mod-_linux.c pre-_linux.o _linux_mod-loader_i386_efi_linux.o und-_linux.lst -ifneq ($(_linux_mod_EXPORTS),no) -CLEANFILES += def-_linux.lst -DEFSYMFILES += def-_linux.lst -endif -MOSTLYCLEANFILES += _linux_mod-loader_i386_efi_linux.d -UNDSYMFILES += und-_linux.lst - -_linux.mod: pre-_linux.o mod-_linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-_linux.o mod-_linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-_linux.o: $(_linux_mod_DEPENDENCIES) _linux_mod-loader_i386_efi_linux.o - -rm -f $@ - $(TARGET_CC) $(_linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ _linux_mod-loader_i386_efi_linux.o - -mod-_linux.o: mod-_linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -c -o $@ $< - -mod-_linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh '_linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(_linux_mod_EXPORTS),no) -def-_linux.lst: pre-_linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 _linux/' > $@ -endif - -und-_linux.lst: pre-_linux.o - echo '_linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -_linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -MD -c -o $@ $< --include _linux_mod-loader_i386_efi_linux.d - -CLEANFILES += cmd-_linux_mod-loader_i386_efi_linux.lst fs-_linux_mod-loader_i386_efi_linux.lst partmap-_linux_mod-loader_i386_efi_linux.lst -COMMANDFILES += cmd-_linux_mod-loader_i386_efi_linux.lst -FSFILES += fs-_linux_mod-loader_i386_efi_linux.lst -PARTMAPFILES += partmap-_linux_mod-loader_i386_efi_linux.lst - -cmd-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh _linux > $@ || (rm -f $@; exit 1) - -fs-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh _linux > $@ || (rm -f $@; exit 1) - -partmap-_linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(_linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh _linux > $@ || (rm -f $@; exit 1) - - -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_linux_normal.o und-linux.lst +linux_mod_SOURCES = loader/i386/efi/linux.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_linux_normal.d +MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1399,9 +1306,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_linux_normal.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_linux_normal.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_efi_linux.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1418,23 +1325,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_linux_normal.o: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_linux_normal.d +linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_efi_linux.d -CLEANFILES += cmd-linux_mod-loader_linux_normal.lst fs-linux_mod-loader_linux_normal.lst partmap-linux_mod-loader_linux_normal.lst -COMMANDFILES += cmd-linux_mod-loader_linux_normal.lst -FSFILES += fs-linux_mod-loader_linux_normal.lst -PARTMAPFILES += partmap-linux_mod-loader_linux_normal.lst +CLEANFILES += cmd-linux_mod-loader_i386_efi_linux.lst fs-linux_mod-loader_i386_efi_linux.lst partmap-linux_mod-loader_i386_efi_linux.lst +COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux.lst +FSFILES += fs-linux_mod-loader_i386_efi_linux.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux.lst -cmd-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_linux_normal.lst: loader/linux_normal.c $(loader/linux_normal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 47132f714..faa59fb47 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -34,7 +34,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ @@ -50,10 +50,11 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - normal/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -78,8 +79,8 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. -pkglib_MODULES = kernel.mod normal.mod _chain.mod chain.mod appleldr.mod \ - halt.mod reboot.mod _linux.mod linux.mod pci.mod lspci.mod \ +pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ + halt.mod reboot.mod linux.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod # For kernel.mod. @@ -90,14 +91,15 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - kern/time.c kern/list.c kern/handler.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ term/efi/console.c disk/efi/efidisk.c -kernel_mod_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h + efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h \ + command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -120,7 +122,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -133,13 +135,8 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _chain.mod. -_chain_mod_SOURCES = loader/efi/chainloader.c -_chain_mod_CFLAGS = $(COMMON_CFLAGS) -_chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. -chain_mod_SOURCES = loader/efi/chainloader_normal.c +chain_mod_SOURCES = loader/efi/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -148,13 +145,8 @@ appleldr_mod_SOURCES = loader/efi/appleloader.c appleldr_mod_CFLAGS = $(COMMON_CFLAGS) appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -_linux_mod_SOURCES = loader/i386/efi/linux.c -_linux_mod_CFLAGS = $(COMMON_CFLAGS) -_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -linux_mod_SOURCES = loader/linux_normal.c +linux_mod_SOURCES = loader/i386/efi/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/disk/loopback.c b/disk/loopback.c index 709c422df..d41a78301 100644 --- a/disk/loopback.c +++ b/disk/loopback.c @@ -17,13 +17,12 @@ * along with GRUB. If not, see . */ -#include #include -#include #include #include #include #include +#include struct grub_loopback { @@ -71,9 +70,9 @@ delete_loopback (const char *name) /* The command to add and remove loopback devices. */ static grub_err_t -grub_cmd_loopback (struct grub_arg_list *state, - int argc, char **args) +grub_cmd_loopback (grub_extcmd_t cmd, int argc, char **args) { + struct grub_arg_list *state = state = cmd->state; grub_file_t file; struct grub_loopback *newdev; @@ -240,19 +239,20 @@ static struct grub_disk_dev grub_loopback_dev = .next = 0 }; - +static grub_extcmd_t cmd; GRUB_MOD_INIT(loop) { (void) mod; /* To stop warning. */ - grub_register_command ("loopback", grub_cmd_loopback, GRUB_COMMAND_FLAG_BOTH, - "loopback [-d|-p] DEVICENAME FILE", - "Make a device of a file.", options); + cmd = grub_register_extcmd ("loopback", grub_cmd_loopback, + GRUB_COMMAND_FLAG_BOTH, + "loopback [-d|-p] DEVICENAME FILE", + "Make a device of a file.", options); grub_disk_dev_register (&grub_loopback_dev); } GRUB_MOD_FINI(loop) { - grub_unregister_command ("loopback"); + grub_unregister_extcmd (cmd); grub_disk_dev_unregister (&grub_loopback_dev); } diff --git a/font/font_cmd.c b/font/font_cmd.c index 6cbae5b0a..c3f428316 100644 --- a/font/font_cmd.c +++ b/font/font_cmd.c @@ -19,13 +19,13 @@ #include #include -#include #include +#include static grub_err_t -loadfont_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, - char **args) +loadfont_command (grub_command_t cmd __attribute__ ((unused)), + int argc, + char **args) { if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no font specified"); @@ -38,7 +38,7 @@ loadfont_command (struct grub_arg_list *state __attribute__ ((unused)), } static grub_err_t -lsfonts_command (struct grub_arg_list *state __attribute__ ((unused)), +lsfonts_command (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -54,17 +54,19 @@ lsfonts_command (struct grub_arg_list *state __attribute__ ((unused)), return GRUB_ERR_NONE; } +static grub_command_t cmd_loadfont, cmd_lsfonts; + GRUB_MOD_INIT(font_manager) { grub_font_loader_init (); - grub_register_command ("loadfont", loadfont_command, GRUB_COMMAND_FLAG_BOTH, + cmd_loadfont = + grub_register_command ("loadfont", loadfont_command, "loadfont FILE...", - "Specify one or more font files to load.", 0); - - grub_register_command ("lsfonts", lsfonts_command, GRUB_COMMAND_FLAG_BOTH, - "lsfonts", - "List the loaded fonts.", 0); + "Specify one or more font files to load."); + cmd_lsfonts = + grub_register_command ("lsfonts", lsfonts_command, + 0, "List the loaded fonts."); } GRUB_MOD_FINI(font_manager) @@ -72,6 +74,6 @@ GRUB_MOD_FINI(font_manager) /* TODO: Determine way to free allocated resources. Warning: possible pointer references could be in use. */ - grub_unregister_command ("loadfont"); + grub_unregister_command (cmd_loadfont); + grub_unregister_command (cmd_lsfonts); } - diff --git a/gencmdlist.sh b/gencmdlist.sh index 5955066c2..5d3897c7d 100644 --- a/gencmdlist.sh +++ b/gencmdlist.sh @@ -15,4 +15,6 @@ module=$1 -grep -v "^#" | sed -ne "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" +grep -v "^#" | sed -n \ + -e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" \ + -e "/\(grub_register_extcmd\|grub_register_command_p1\) *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" diff --git a/hello/hello.c b/hello/hello.c index 70cbf60b8..e3cf3212c 100644 --- a/hello/hello.c +++ b/hello/hello.c @@ -23,10 +23,10 @@ #include #include #include -#include +#include static grub_err_t -grub_cmd_hello (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_hello (struct grub_extcmd *cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { @@ -34,14 +34,16 @@ grub_cmd_hello (struct grub_arg_list *state __attribute__ ((unused)), return 0; } +static grub_extcmd_t cmd; + GRUB_MOD_INIT(hello) { (void)mod; /* To stop warning. */ - grub_register_command ("hello", grub_cmd_hello, GRUB_COMMAND_FLAG_BOTH, - "hello", "Say hello", 0); + cmd = grub_register_extcmd ("hello", grub_cmd_hello, GRUB_COMMAND_FLAG_BOTH, + "hello", "Say hello", 0); } GRUB_MOD_FINI(hello) { - grub_unregister_command ("hello"); + grub_unregister_extcmd (cmd); } diff --git a/include/grub/command.h b/include/grub/command.h new file mode 100644 index 000000000..18f2934fa --- /dev/null +++ b/include/grub/command.h @@ -0,0 +1,118 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_COMMAND_HEADER +#define GRUB_COMMAND_HEADER 1 + +#include +#include +#include + +/* Can be run in the command-line. */ +#define GRUB_COMMAND_FLAG_CMDLINE 0x1 +/* Can be run in the menu. */ +#define GRUB_COMMAND_FLAG_MENU 0x2 +/* Can be run in both interfaces. */ +#define GRUB_COMMAND_FLAG_BOTH 0x3 +/* Only for the command title. */ +#define GRUB_COMMAND_FLAG_TITLE 0x4 +/* Don't print the command on booting. */ +#define GRUB_COMMAND_FLAG_NO_ECHO 0x8 +/* This is an extended command. */ +#define GRUB_COMMAND_FLAG_EXTCMD 0x10 +/* This is an dynamic command. */ +#define GRUB_COMMAND_FLAG_DYNCMD 0x20 + +struct grub_command; + +typedef grub_err_t (*grub_command_func_t) (struct grub_command *cmd, + int argc, char **argv); + +/* The command description. */ +struct grub_command +{ + /* The next element. */ + struct grub_command *next; + + /* The name. */ + const char *name; + + /* The priority. */ + int prio; + + /* The callback function. */ + grub_command_func_t func; + + /* The flags. */ + unsigned flags; + + /* The summary of the command usage. */ + const char *summary; + + /* The description of the command. */ + const char *description; + + /* Arbitary data. */ + void *data; +}; +typedef struct grub_command *grub_command_t; + +extern grub_command_t EXPORT_VAR(grub_command_list); + +grub_command_t +EXPORT_FUNC(grub_register_command_prio) (const char *name, + grub_command_func_t func, + const char *summary, + const char *description, + int prio); +void EXPORT_FUNC(grub_unregister_command) (grub_command_t cmd); + +static inline grub_command_t +grub_register_command (const char *name, + grub_command_func_t func, + const char *summary, + const char *description) +{ + return grub_register_command_prio (name, func, summary, description, 0); +} + +static inline grub_command_t +grub_register_command_p1 (const char *name, + grub_command_func_t func, + const char *summary, + const char *description) +{ + return grub_register_command_prio (name, func, summary, description, 1); +} + +static inline grub_command_t +grub_command_find (const char *name) +{ + return grub_named_list_find (GRUB_AS_NAMED_LIST (grub_command_list), name); +} + +static inline int +grub_command_iterate (int (*func) (grub_command_t)) +{ + return grub_list_iterate (GRUB_AS_LIST (grub_command_list), + (grub_list_hook_t) func); +} + +void grub_register_core_commands (void); + +#endif /* ! GRUB_COMMAND_HEADER */ diff --git a/include/grub/efi/chainloader.h b/include/grub/efi/chainloader.h deleted file mode 100644 index d5c11e345..000000000 --- a/include/grub/efi/chainloader.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_EFI_CHAINLOADER_HEADER -#define GRUB_EFI_CHAINLOADER_HEADER 1 - -void grub_rescue_cmd_chainloader (int argc, char *argv[]); - -#endif /* ! GRUB_EFI_CHAINLOADER_HEADER */ diff --git a/include/grub/extcmd.h b/include/grub/extcmd.h new file mode 100644 index 000000000..03eaba8f8 --- /dev/null +++ b/include/grub/extcmd.h @@ -0,0 +1,55 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_EXTCMD_HEADER +#define GRUB_EXTCMD_HEADER 1 + +#include +#include + +struct grub_extcmd; + +typedef grub_err_t (*grub_extcmd_func_t) (struct grub_extcmd *cmd, + int argc, char **args); + +/* The argcmd description. */ +struct grub_extcmd +{ + grub_command_t cmd; + + grub_extcmd_func_t func; + + /* The argument parser optionlist. */ + const struct grub_arg_option *options; + + void *data; + + struct grub_arg_list *state; +}; +typedef struct grub_extcmd *grub_extcmd_t; + +grub_extcmd_t grub_register_extcmd (const char *name, + grub_extcmd_func_t func, + unsigned flags, + const char *summary, + const char *description, + const struct grub_arg_option *parser); + +void grub_unregister_extcmd (grub_extcmd_t cmd); + +#endif /* ! GRUB_EXTCMD_HEADER */ diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index 00296c9c6..f50f18e16 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -222,11 +222,4 @@ struct grub_netbsd_btinfo_bootdisk int partition; }; -void grub_rescue_cmd_freebsd (int argc, char *argv[]); -void grub_rescue_cmd_openbsd (int argc, char *argv[]); -void grub_rescue_cmd_netbsd (int argc, char *argv[]); - -void grub_rescue_cmd_freebsd_loadenv (int argc, char *argv[]); -void grub_rescue_cmd_freebsd_module (int argc, char *argv[]); - #endif /* ! GRUB_BSD_CPU_HEADER */ diff --git a/include/grub/i386/efi/loader.h b/include/grub/i386/efi/loader.h index 3308be04b..222dae82d 100644 --- a/include/grub/i386/efi/loader.h +++ b/include/grub/i386/efi/loader.h @@ -19,9 +19,4 @@ #ifndef GRUB_LOADER_MACHINE_HEADER #define GRUB_LOADER_MACHINE_HEADER 1 -/* It is necessary to export these functions, because normal mode commands - reuse rescue mode commands. */ -void grub_rescue_cmd_linux (int argc, char *argv[]); -void grub_rescue_cmd_initrd (int argc, char *argv[]); - #endif /* ! GRUB_LOADER_MACHINE_HEADER */ diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index 9673e82dc..df8b4e3b8 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -48,11 +48,6 @@ extern grub_addr_t EXPORT_VAR(grub_multiboot_payload_dest); extern grub_size_t EXPORT_VAR(grub_multiboot_payload_size); extern grub_uint32_t EXPORT_VAR(grub_multiboot_payload_entry_offset); -/* It is necessary to export these functions, because normal mode commands - reuse rescue mode commands. */ -void grub_rescue_cmd_linux (int argc, char *argv[]); -void grub_rescue_cmd_initrd (int argc, char *argv[]); - extern grub_uint8_t EXPORT_VAR(grub_multiboot_forward_relocator); extern grub_uint8_t EXPORT_VAR(grub_multiboot_forward_relocator_end); extern grub_uint8_t EXPORT_VAR(grub_multiboot_backward_relocator); diff --git a/include/grub/i386/pc/chainloader.h b/include/grub/i386/pc/chainloader.h index c28a42d87..ca1da23a7 100644 --- a/include/grub/i386/pc/chainloader.h +++ b/include/grub/i386/pc/chainloader.h @@ -27,7 +27,4 @@ typedef enum GRUB_CHAINLOADER_FORCE = 0x1 } grub_chainloader_flags_t; -void EXPORT_FUNC(grub_chainloader_cmd) (const char * file, - grub_chainloader_flags_t flags); - #endif /* GRUB_CHAINLOADER_MACHINE_HEADER */ diff --git a/include/grub/arg.h b/include/grub/lib/arg.h similarity index 88% rename from include/grub/arg.h rename to include/grub/lib/arg.h index bb9ce7b0e..e6af60cf9 100644 --- a/include/grub/arg.h +++ b/include/grub/lib/arg.h @@ -62,4 +62,11 @@ struct grub_arg_list char *arg; }; +struct grub_extcmd; + +int grub_arg_parse (struct grub_extcmd *cmd, int argc, char **argv, + struct grub_arg_list *usr, char ***args, int *argnum); + +void grub_arg_show_help (struct grub_extcmd *cmd); + #endif /* ! GRUB_ARG_HEADER */ diff --git a/include/grub/list.h b/include/grub/list.h index b2af3b80b..eba12371b 100644 --- a/include/grub/list.h +++ b/include/grub/list.h @@ -30,11 +30,14 @@ struct grub_list typedef struct grub_list *grub_list_t; typedef int (*grub_list_hook_t) (grub_list_t item); +typedef int (*grub_list_test_t) (grub_list_t new_item, grub_list_t item); void EXPORT_FUNC(grub_list_push) (grub_list_t *head, grub_list_t item); void * EXPORT_FUNC(grub_list_pop) (grub_list_t *head); void EXPORT_FUNC(grub_list_remove) (grub_list_t *head, grub_list_t item); -void EXPORT_FUNC(grub_list_iterate) (grub_list_t head, grub_list_hook_t hook); +int EXPORT_FUNC(grub_list_iterate) (grub_list_t head, grub_list_hook_t hook); +void EXPORT_FUNC(grub_list_insert) (grub_list_t *head, grub_list_t item, + grub_list_test_t test); /* This function doesn't exist, so if assertion is false for some reason, the linker would fail. */ @@ -66,4 +69,43 @@ void * EXPORT_FUNC(grub_named_list_find) (grub_named_list_t head, GRUB_FIELD_MATCH (ptr, grub_named_list_t, name))? \ (grub_named_list_t) ptr : grub_assert_fail ()) +#define GRUB_AS_NAMED_LIST_P(pptr) \ + ((GRUB_FIELD_MATCH (*pptr, grub_named_list_t, next) && \ + GRUB_FIELD_MATCH (*pptr, grub_named_list_t, name))? \ + (grub_named_list_t *) (void *) pptr : grub_assert_fail ()) + +#define GRUB_PRIO_LIST_PRIO_MASK 0xff +#define GRUB_PRIO_LIST_FLAG_ACTIVE 0x100 + +struct grub_prio_list +{ + struct grub_prio_list *next; + const char *name; + int prio; +}; +typedef struct grub_prio_list *grub_prio_list_t; + +void EXPORT_FUNC(grub_prio_list_insert) (grub_prio_list_t *head, + grub_prio_list_t item); + +static inline void +grub_prio_list_remove (grub_prio_list_t *head, grub_prio_list_t item) +{ + if ((item->prio & GRUB_PRIO_LIST_FLAG_ACTIVE) && (item->next)) + item->next->prio |= GRUB_PRIO_LIST_FLAG_ACTIVE; + grub_list_remove (GRUB_AS_LIST_P (head), GRUB_AS_LIST (item)); +} + +#define GRUB_AS_PRIO_LIST(ptr) \ + ((GRUB_FIELD_MATCH (ptr, grub_prio_list_t, next) && \ + GRUB_FIELD_MATCH (ptr, grub_prio_list_t, name) && \ + GRUB_FIELD_MATCH (ptr, grub_prio_list_t, prio))? \ + (grub_prio_list_t) ptr : grub_assert_fail ()) + +#define GRUB_AS_PRIO_LIST_P(pptr) \ + ((GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, next) && \ + GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, name) && \ + GRUB_FIELD_MATCH (*pptr, grub_prio_list_t, prio))? \ + (grub_prio_list_t *) (void *) pptr : grub_assert_fail ()) + #endif /* ! GRUB_LIST_HEADER */ diff --git a/include/grub/normal.h b/include/grub/normal.h index 216ae0ddc..48cd91f08 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -23,28 +23,13 @@ #include #include #include -#include #include #include +#include /* The maximum size of a command-line. */ #define GRUB_MAX_CMDLINE 1600 -/* Can be run in the command-line. */ -#define GRUB_COMMAND_FLAG_CMDLINE 0x1 -/* Can be run in the menu. */ -#define GRUB_COMMAND_FLAG_MENU 0x2 -/* Can be run in both interfaces. */ -#define GRUB_COMMAND_FLAG_BOTH 0x3 -/* Only for the command title. */ -#define GRUB_COMMAND_FLAG_TITLE 0x4 -/* Don't print the command on booting. */ -#define GRUB_COMMAND_FLAG_NO_ECHO 0x8 -/* Pass arguments to the command without parsing options. */ -#define GRUB_COMMAND_FLAG_NO_ARG_PARSE 0x10 -/* Not loaded yet. Used for auto-loading. */ -#define GRUB_COMMAND_FLAG_NOT_LOADED 0x20 - /* The type of a completion item. */ enum grub_completion_type { @@ -56,35 +41,6 @@ enum grub_completion_type }; typedef enum grub_completion_type grub_completion_type_t; -/* The command description. */ -struct grub_command -{ - /* The name. */ - char *name; - - /* The callback function. */ - grub_err_t (*func) (struct grub_arg_list *state, int argc, char **args); - - /* The flags. */ - unsigned flags; - - /* The summary of the command usage. */ - const char *summary; - - /* The description of the command. */ - const char *description; - - /* The argument parser optionlist. */ - const struct grub_arg_option *options; - - /* The name of a module. Used for auto-loading. */ - char *module_name; - - /* The next element. */ - struct grub_command *next; -}; -typedef struct grub_command *grub_command_t; - /* This is used to store the names of filesystem modules for auto-loading. */ struct grub_fs_module_list { @@ -132,25 +88,10 @@ void grub_menu_set_timeout (int timeout); void grub_cmdline_run (int nested); int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, int echo_char, int readline); -grub_command_t grub_register_command (const char *name, - grub_err_t (*func) (struct grub_arg_list *state, - int argc, - char **args), - unsigned flags, - const char *summary, - const char *description, - const struct grub_arg_option *parser); -void grub_unregister_command (const char *name); -grub_command_t grub_command_find (char *cmdline); grub_err_t grub_set_history (int newsize); -int grub_iterate_commands (int (*iterate) (grub_command_t)); int grub_command_execute (char *cmdline, int interactive); -void grub_command_init (void); void grub_normal_init_page (void); void grub_menu_init_page (int nested, int edit); -int grub_arg_parse (grub_command_t parser, int argc, char **argv, - struct grub_arg_list *usr, char ***args, int *argnum); -void grub_arg_show_help (grub_command_t cmd); char *grub_normal_do_completion (char *buf, int *restore, void (*hook) (const char *item, grub_completion_type_t type, int count)); grub_err_t grub_normal_print_device_info (const char *name); diff --git a/include/grub/rescue.h b/include/grub/rescue.h index 4d8d1673d..d02c83ece 100644 --- a/include/grub/rescue.h +++ b/include/grub/rescue.h @@ -24,13 +24,4 @@ /* Enter rescue mode. */ void grub_enter_rescue_mode (void); -/* Register a rescue mode command. */ -void EXPORT_FUNC(grub_rescue_register_command) (const char *name, - void (*func) (int argc, - char *argv[]), - const char *message); - -/* Unregister a rescue mode command. */ -void EXPORT_FUNC(grub_rescue_unregister_command) (const char *name); - #endif /* ! GRUB_RESCUE_HEADER */ diff --git a/include/grub/x86_64/efi/loader.h b/include/grub/x86_64/efi/loader.h index 4368a8252..fac67463b 100644 --- a/include/grub/x86_64/efi/loader.h +++ b/include/grub/x86_64/efi/loader.h @@ -22,11 +22,6 @@ #include #include -/* It is necessary to export these functions, because normal mode commands - reuse rescue mode commands. */ -void grub_rescue_cmd_linux (int argc, char *argv[]); -void grub_rescue_cmd_initrd (int argc, char *argv[]); - void EXPORT_FUNC(grub_linux_real_boot) (void); #endif /* ! GRUB_LOADER_MACHINE_HEADER */ diff --git a/kern/command.c b/kern/command.c new file mode 100644 index 000000000..63b536eb7 --- /dev/null +++ b/kern/command.c @@ -0,0 +1,59 @@ +/* command.c - support basic command */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +grub_command_t grub_command_list; + +grub_command_t +grub_register_command_prio (const char *name, + grub_command_func_t func, + const char *summary, + const char *description, + int prio) +{ + grub_command_t cmd; + + cmd = (grub_command_t) grub_malloc (sizeof (*cmd)); + if (! cmd) + return 0; + + cmd->name = name; + cmd->func = func; + cmd->summary = (summary) ? summary : name; + cmd->description = description; + + cmd->flags = GRUB_COMMAND_FLAG_BOTH; + cmd->prio = prio; + cmd->data = 0; + + grub_prio_list_insert (GRUB_AS_PRIO_LIST_P (&grub_command_list), + GRUB_AS_PRIO_LIST (cmd)); + + return cmd; +} + +void +grub_unregister_command (grub_command_t cmd) +{ + grub_prio_list_remove (GRUB_AS_PRIO_LIST_P (&grub_command_list), + GRUB_AS_PRIO_LIST (cmd)); + grub_free (cmd); +} diff --git a/kern/corecmd.c b/kern/corecmd.c new file mode 100644 index 000000000..ad2ba0967 --- /dev/null +++ b/kern/corecmd.c @@ -0,0 +1,201 @@ +/* corecmd.c - critical commands which are registered in kernel */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* set ENVVAR=VALUE */ +static grub_err_t +grub_core_cmd_set (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + char *var; + char *val; + + auto int print_env (struct grub_env_var *env); + + int print_env (struct grub_env_var *env) + { + grub_printf ("%s=%s\n", env->name, env->value); + return 0; + } + + if (argc < 1) + { + grub_env_iterate (print_env); + return 0; + } + + var = argv[0]; + val = grub_strchr (var, '='); + if (! val) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "not an assignment"); + + val[0] = 0; + grub_env_set (var, val + 1); + val[0] = '='; + + return 0; +} + +static grub_err_t +grub_core_cmd_unset (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "no environment variable specified"); + + grub_env_unset (argv[0]); + return 0; +} + +static grub_err_t +grub_core_cmd_export (struct grub_command *cmd __attribute__ ((unused)), + int argc, char **args) +{ + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "no environment variable specified"); + + grub_env_export (args[0]); + return 0; +} + +/* insmod MODULE */ +static grub_err_t +grub_core_cmd_insmod (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + char *p; + grub_dl_t mod; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); + + p = grub_strchr (argv[0], '/'); + if (! p) + mod = grub_dl_load (argv[0]); + else + mod = grub_dl_load_file (argv[0]); + + if (mod) + grub_dl_ref (mod); + + return 0; +} + +static int +grub_mini_print_devices (const char *name) +{ + grub_printf ("(%s) ", name); + + return 0; +} + +static int +grub_mini_print_files (const char *filename, int dir) +{ + grub_printf ("%s%s ", filename, dir ? "/" : ""); + + return 0; +} + +/* ls [ARG] */ +static grub_err_t +grub_core_cmd_ls (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + if (argc < 1) + { + grub_device_iterate (grub_mini_print_devices); + grub_putchar ('\n'); + grub_refresh (); + } + else + { + char *device_name; + grub_device_t dev; + grub_fs_t fs; + char *path; + + device_name = grub_file_get_device_name (argv[0]); + dev = grub_device_open (device_name); + if (! dev) + goto fail; + + fs = grub_fs_probe (dev); + path = grub_strchr (argv[0], ')'); + if (! path) + path = argv[0]; + else + path++; + + if (! path && ! device_name) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument"); + goto fail; + } + + if (! path) + { + if (grub_errno == GRUB_ERR_UNKNOWN_FS) + grub_errno = GRUB_ERR_NONE; + + grub_printf ("(%s): Filesystem is %s.\n", + device_name, fs ? fs->name : "unknown"); + } + else if (fs) + { + (fs->dir) (dev, path, grub_mini_print_files); + grub_putchar ('\n'); + grub_refresh (); + } + + fail: + if (dev) + grub_device_close (dev); + + grub_free (device_name); + } + + return grub_errno; +} + +void +grub_register_core_commands (void) +{ + grub_register_command ("set", grub_core_cmd_set, + "set [ENVVAR=VALUE]", "set an environment variable"); + grub_register_command ("unset", grub_core_cmd_unset, + "unset ENVVAR", "remove an environment variable"); + grub_register_command ("export", grub_core_cmd_export, + "export ENVVAR", "Export a variable."); + grub_register_command ("ls", grub_core_cmd_ls, + "ls [ARG]", "list devices or files"); + grub_register_command ("insmod", grub_core_cmd_insmod, + "insmod MODULE", "insert a module"); +} diff --git a/kern/list.c b/kern/list.c index 41f55740b..b879f1320 100644 --- a/kern/list.c +++ b/kern/list.c @@ -52,14 +52,30 @@ grub_list_remove (grub_list_t *head, grub_list_t item) } } -void +int grub_list_iterate (grub_list_t head, grub_list_hook_t hook) { grub_list_t p; for (p = head; p; p = p->next) if (hook (p)) + return 1; + + return 0; +} + +void +grub_list_insert (grub_list_t *head, grub_list_t item, + grub_list_test_t test) +{ + grub_list_t *p, q; + + for (p = head, q = *p; q; p = &(q->next), q = q->next) + if (test (item, q)) break; + + *p = item; + item->next = q; } void * @@ -82,3 +98,33 @@ grub_named_list_find (grub_named_list_t head, const char *name) grub_list_iterate (GRUB_AS_LIST (head), (grub_list_hook_t) list_find); return result; } + +void +grub_prio_list_insert (grub_prio_list_t *head, grub_prio_list_t nitem) +{ + int inactive = 0; + + auto int test (grub_prio_list_t new_item, grub_prio_list_t item); + int test (grub_prio_list_t new_item, grub_prio_list_t item) + { + int r; + + r = grub_strcmp (new_item->name, item->name); + if (r) + return (r < 0); + + if (new_item->prio >= (item->prio & GRUB_PRIO_LIST_PRIO_MASK)) + { + item->prio &= ~GRUB_PRIO_LIST_FLAG_ACTIVE; + return 1; + } + + inactive = 1; + return 0; + } + + grub_list_insert (GRUB_AS_LIST_P (head), GRUB_AS_LIST (nitem), + (grub_list_test_t) test); + if (! inactive) + nitem->prio |= GRUB_PRIO_LIST_FLAG_ACTIVE; +} diff --git a/kern/rescue.c b/kern/rescue.c index e333ab5f5..69a5db90e 100644 --- a/kern/rescue.c +++ b/kern/rescue.c @@ -30,56 +30,14 @@ #include #include #include +#include +#include #define GRUB_RESCUE_BUF_SIZE 256 #define GRUB_RESCUE_MAX_ARGS 20 -struct grub_rescue_command -{ - const char *name; - void (*func) (int argc, char *argv[]); - const char *message; - struct grub_rescue_command *next; -}; -typedef struct grub_rescue_command *grub_rescue_command_t; - static char linebuf[GRUB_RESCUE_BUF_SIZE]; -static grub_rescue_command_t grub_rescue_command_list; - -void -grub_rescue_register_command (const char *name, - void (*func) (int argc, char *argv[]), - const char *message) -{ - grub_rescue_command_t cmd; - - cmd = (grub_rescue_command_t) grub_malloc (sizeof (*cmd)); - if (! cmd) - return; - - cmd->name = name; - cmd->func = func; - cmd->message = message; - - cmd->next = grub_rescue_command_list; - grub_rescue_command_list = cmd; -} - -void -grub_rescue_unregister_command (const char *name) -{ - grub_rescue_command_t *p, q; - - for (p = &grub_rescue_command_list, q = *p; q; p = &(q->next), q = q->next) - if (grub_strcmp (name, q->name) == 0) - { - *p = q->next; - grub_free (q); - break; - } -} - /* Prompt to input a command and read the line. */ static void grub_rescue_get_command_line (const char *prompt) @@ -117,489 +75,14 @@ grub_rescue_get_command_line (const char *prompt) grub_refresh (); } -/* boot */ -static void -grub_rescue_cmd_boot (int argc __attribute__ ((unused)), - char *argv[] __attribute__ ((unused))) -{ - grub_loader_boot (); -} - -/* cat FILE */ -static void -grub_rescue_cmd_cat (int argc, char *argv[]) -{ - grub_file_t file; - char buf[GRUB_DISK_SECTOR_SIZE]; - grub_ssize_t size; - - if (argc < 1) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); - return; - } - - file = grub_file_open (argv[0]); - if (! file) - return; - - while ((size = grub_file_read (file, buf, sizeof (buf))) > 0) - { - int i; - - for (i = 0; i < size; i++) - { - unsigned char c = buf[i]; - - if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') - grub_putchar (c); - else - { - grub_setcolorstate (GRUB_TERM_COLOR_HIGHLIGHT); - grub_printf ("<%x>", (int) c); - grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); - } - } - } - - grub_putchar ('\n'); - grub_refresh (); - grub_file_close (file); -} - -static int -grub_rescue_print_devices (const char *name) -{ - grub_printf ("(%s) ", name); - - return 0; -} - -static int -grub_rescue_print_files (const char *filename, int dir) -{ - grub_printf ("%s%s ", filename, dir ? "/" : ""); - - return 0; -} - -/* ls [ARG] */ -static void -grub_rescue_cmd_ls (int argc, char *argv[]) -{ - if (argc < 1) - { - grub_device_iterate (grub_rescue_print_devices); - grub_putchar ('\n'); - grub_refresh (); - } - else - { - char *device_name; - grub_device_t dev; - grub_fs_t fs; - char *path; - - device_name = grub_file_get_device_name (argv[0]); - dev = grub_device_open (device_name); - if (! dev) - goto fail; - - fs = grub_fs_probe (dev); - path = grub_strchr (argv[0], ')'); - if (! path) - path = argv[0]; - else - path++; - - if (! path && ! device_name) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument"); - goto fail; - } - - if (! path) - { - if (grub_errno == GRUB_ERR_UNKNOWN_FS) - grub_errno = GRUB_ERR_NONE; - - grub_printf ("(%s): Filesystem is %s.\n", - device_name, fs ? fs->name : "unknown"); - } - else if (fs) - { - (fs->dir) (dev, path, grub_rescue_print_files); - grub_putchar ('\n'); - grub_refresh (); - } - - fail: - if (dev) - grub_device_close (dev); - - grub_free (device_name); - } -} - -/* help */ -static void -grub_rescue_cmd_help (int argc __attribute__ ((unused)), - char *argv[] __attribute__ ((unused))) -{ - grub_rescue_command_t p, q; - - /* Sort the commands. This is not a good algorithm, but this is enough, - because rescue mode has a small number of commands. */ - for (p = grub_rescue_command_list; p; p = p->next) - for (q = p->next; q; q = q->next) - if (grub_strcmp (p->name, q->name) > 0) - { - struct grub_rescue_command tmp; - - tmp.name = p->name; - tmp.func = p->func; - tmp.message = p->message; - - p->name = q->name; - p->func = q->func; - p->message = q->message; - - q->name = tmp.name; - q->func = tmp.func; - q->message = tmp.message; - } - - /* Print them. */ - for (p = grub_rescue_command_list; p; p = p->next) - grub_printf ("%s\t%s\n", p->name, p->message); -} - -#if 0 -static void -grub_rescue_cmd_info (void) -{ - extern void grub_disk_cache_get_performance (unsigned long *, - unsigned long *); - unsigned long hits, misses; - - grub_disk_cache_get_performance (&hits, &misses); - grub_printf ("Disk cache: hits = %u, misses = %u ", hits, misses); - if (hits + misses) - { - unsigned long ratio = hits * 10000 / (hits + misses); - grub_printf ("(%u.%u%%)\n", ratio / 100, ratio % 100); - } - else - grub_printf ("(N/A)\n"); -} -#endif - -/* root [DEVICE] */ -static void -grub_rescue_cmd_root (int argc, char *argv[]) -{ - grub_device_t dev; - grub_fs_t fs; - - if (argc > 0) - { - char *device_name = grub_file_get_device_name (argv[0]); - if (! device_name) - return; - - grub_env_set ("root", device_name); - grub_free (device_name); - } - - dev = grub_device_open (0); - if (! dev) - return; - - fs = grub_fs_probe (dev); - if (grub_errno == GRUB_ERR_UNKNOWN_FS) - grub_errno = GRUB_ERR_NONE; - - grub_printf ("(%s): Filesystem is %s.\n", - grub_env_get ("root"), fs ? fs->name : "unknown"); - - grub_device_close (dev); -} - -#if 0 -static void -grub_rescue_cmd_testload (int argc, char *argv[]) -{ - grub_file_t file; - char *buf; - grub_ssize_t size; - grub_ssize_t pos; - auto void read_func (unsigned long sector, unsigned offset, unsigned len); - - void read_func (unsigned long sector __attribute__ ((unused)), - unsigned offset __attribute__ ((unused)), - unsigned len __attribute__ ((unused))) - { - grub_putchar ('.'); - grub_refresh (); - } - - if (argc < 1) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); - return; - } - - file = grub_file_open (argv[0]); - if (! file) - return; - - size = grub_file_size (file) & ~(GRUB_DISK_SECTOR_SIZE - 1); - if (size == 0) - { - grub_file_close (file); - return; - } - - buf = grub_malloc (size); - if (! buf) - goto fail; - - grub_printf ("Reading %s sequentially", argv[0]); - file->read_hook = read_func; - if (grub_file_read (file, buf, size) != size) - goto fail; - grub_printf (" Done.\n"); - - /* Read sequentially again. */ - grub_printf ("Reading %s sequentially again", argv[0]); - if (grub_file_seek (file, 0) < 0) - goto fail; - - for (pos = 0; pos < size; pos += GRUB_DISK_SECTOR_SIZE) - { - char sector[GRUB_DISK_SECTOR_SIZE]; - - if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE) - != GRUB_DISK_SECTOR_SIZE) - goto fail; - - if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0) - { - grub_printf ("\nDiffers in %d\n", pos); - goto fail; - } - } - grub_printf (" Done.\n"); - - /* Read backwards and compare. */ - grub_printf ("Reading %s backwards", argv[0]); - pos = size; - while (pos > 0) - { - char sector[GRUB_DISK_SECTOR_SIZE]; - - pos -= GRUB_DISK_SECTOR_SIZE; - - if (grub_file_seek (file, pos) < 0) - goto fail; - - if (grub_file_read (file, sector, GRUB_DISK_SECTOR_SIZE) - != GRUB_DISK_SECTOR_SIZE) - goto fail; - - if (grub_memcmp (sector, buf + pos, GRUB_DISK_SECTOR_SIZE) != 0) - { - int i; - - grub_printf ("\nDiffers in %d\n", pos); - - for (i = 0; i < GRUB_DISK_SECTOR_SIZE; i++) - grub_putchar (buf[pos + i]); - - if (i) - grub_refresh (); - - goto fail; - } - } - grub_printf (" Done.\n"); - - fail: - - grub_file_close (file); - grub_free (buf); -} -#endif - -/* dump ADDRESS [SIZE] */ -static void -grub_rescue_cmd_dump (int argc, char *argv[]) -{ - grub_uint8_t *addr; - grub_size_t size = 4; - - if (argc == 0) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no address specified"); - return; - } - - addr = (grub_uint8_t *) grub_strtoul (argv[0], 0, 0); - if (grub_errno) - return; - - if (argc > 1) - size = (grub_size_t) grub_strtoul (argv[1], 0, 0); - - while (size--) - { - grub_printf ("%x%x ", *addr >> 4, *addr & 0xf); - addr++; - } -} - -/* insmod MODULE */ -static void -grub_rescue_cmd_insmod (int argc, char *argv[]) -{ - char *p; - grub_dl_t mod; - - if (argc == 0) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); - return; - } - - p = grub_strchr (argv[0], '/'); - if (! p) - mod = grub_dl_load (argv[0]); - else - mod = grub_dl_load_file (argv[0]); - - if (mod) - grub_dl_ref (mod); -} - -/* rmmod MODULE */ -static void -grub_rescue_cmd_rmmod (int argc, char *argv[]) -{ - grub_dl_t mod; - - if (argc == 0) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); - return; - } - - mod = grub_dl_get (argv[0]); - if (! mod) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no such module"); - return; - } - - if (grub_dl_unref (mod) <= 0) - grub_dl_unload (mod); -} - -/* lsmod */ -static void -grub_rescue_cmd_lsmod (int argc __attribute__ ((unused)), - char *argv[] __attribute__ ((unused))) -{ - auto int print_module (grub_dl_t mod); - - int print_module (grub_dl_t mod) - { - grub_dl_dep_t dep; - - grub_printf ("%s\t%d\t\t", mod->name, mod->ref_count); - for (dep = mod->dep; dep; dep = dep->next) - { - if (dep != mod->dep) - grub_putchar (','); - - grub_printf ("%s", dep->mod->name); - } - grub_putchar ('\n'); - grub_refresh (); - - return 0; - } - - grub_printf ("Name\tRef Count\tDependencies\n"); - grub_dl_iterate (print_module); -} - -/* set ENVVAR=VALUE */ -static void -grub_rescue_cmd_set (int argc, char *argv[]) -{ - char *var; - char *val; - - auto int print_env (struct grub_env_var *env); - - int print_env (struct grub_env_var *env) - { - grub_printf ("%s=%s\n", env->name, env->value); - return 0; - } - - if (argc < 1) - { - grub_env_iterate (print_env); - return; - } - - var = argv[0]; - val = grub_strchr (var, '='); - if (! val) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "not an assignment"); - return; - } - - val[0] = 0; - grub_env_set (var, val + 1); - val[0] = '='; -} - -static void -grub_rescue_cmd_unset (int argc, char *argv[]) -{ - if (argc < 1) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no environment variable specified"); - return; - } - - grub_env_unset (argv[0]); -} - -/* exit */ -static void -grub_rescue_cmd_exit (int argc __attribute__ ((unused)), - char *argv[] __attribute__ ((unused))) -{ - grub_exit (); -} - static void attempt_normal_mode (void) { - grub_rescue_command_t cmd; + grub_command_t cmd; - for (cmd = grub_rescue_command_list; cmd; cmd = cmd->next) - { - if (grub_strcmp ("normal", cmd->name) == 0) - { - (cmd->func) (0, 0); - break; - } - } + cmd = grub_command_find ("normal"); + if (cmd) + (cmd->func) (cmd, 0, 0); } /* Enter the rescue mode. */ @@ -615,42 +98,19 @@ grub_enter_rescue_mode (void) return 0; } + grub_register_core_commands (); + /* First of all, attempt to execute the normal mode. */ attempt_normal_mode (); grub_printf ("Entering rescue mode...\n"); - grub_rescue_register_command ("boot", grub_rescue_cmd_boot, - "boot an operating system"); - grub_rescue_register_command ("cat", grub_rescue_cmd_cat, - "show the contents of a file"); - grub_rescue_register_command ("help", grub_rescue_cmd_help, - "show this message"); - grub_rescue_register_command ("ls", grub_rescue_cmd_ls, - "list devices or files"); - grub_rescue_register_command ("root", grub_rescue_cmd_root, - "set the root device"); - grub_rescue_register_command ("dump", grub_rescue_cmd_dump, - "dump memory"); - grub_rescue_register_command ("insmod", grub_rescue_cmd_insmod, - "insert a module"); - grub_rescue_register_command ("rmmod", grub_rescue_cmd_rmmod, - "remove a module"); - grub_rescue_register_command ("lsmod", grub_rescue_cmd_lsmod, - "show loaded modules"); - grub_rescue_register_command ("set", grub_rescue_cmd_set, - "set an environment variable"); - grub_rescue_register_command ("unset", grub_rescue_cmd_unset, - "remove an environment variable"); - grub_rescue_register_command ("exit", grub_rescue_cmd_exit, - "exit from GRUB"); - while (1) { char *line = linebuf; char *name; int n; - grub_rescue_command_t cmd; + grub_command_t cmd; char **args; /* Print an error, if any. */ @@ -682,23 +142,17 @@ grub_enter_rescue_mode (void) /* If nothing is specified, restart. */ if (*name == '\0') - { - grub_free (args[0]); - continue; - } - - /* Find the command and execute it. */ - for (cmd = grub_rescue_command_list; cmd; cmd = cmd->next) { - if (grub_strcmp (name, cmd->name) == 0) - { - (cmd->func) (n, &args[1]); - break; - } + grub_free (args[0]); + continue; } - /* If not found, print an error message. */ - if (! cmd) + cmd = grub_command_find (name); + if (cmd) + { + (cmd->func) (cmd, n, &args[1]); + } + else { grub_printf ("Unknown command `%s'\n", name); grub_printf ("Try `help' for usage\n"); diff --git a/normal/arg.c b/lib/arg.c similarity index 91% rename from normal/arg.c rename to lib/arg.c index 52c11d3a2..e61404856 100644 --- a/normal/arg.c +++ b/lib/arg.c @@ -17,12 +17,11 @@ * along with GRUB. If not, see . */ -#include #include #include #include -#include #include +#include /* Built-in parser for default options. */ #define SHORT_ARG_HELP -100 @@ -56,7 +55,7 @@ find_short (const struct grub_arg_option *options, char c) if (options) found = fnd_short (options); - + if (! found) { switch (c) @@ -73,7 +72,7 @@ find_short (const struct grub_arg_option *options, char c) break; } } - + return found; } @@ -109,32 +108,32 @@ find_long (const struct grub_arg_option *options, char *s) if (options) found = fnd_long (options); - + if (! found) found = fnd_long (help_options); - + return found; } static void -show_usage (grub_command_t cmd) +show_usage (grub_extcmd_t cmd) { - grub_printf ("Usage: %s\n", cmd->summary); + grub_printf ("Usage: %s\n", cmd->cmd->summary); } void -grub_arg_show_help (grub_command_t cmd) +grub_arg_show_help (grub_extcmd_t cmd) { auto void showargs (const struct grub_arg_option *opt); int h_is_used = 0; int u_is_used = 0; - + auto void showargs (const struct grub_arg_option *opt) { for (; opt->doc; opt++) { int spacing = 20; - + if (opt->shortarg && grub_isgraph (opt->shortarg)) grub_printf ("-%c%c ", opt->shortarg, opt->longarg ? ',':' '); else if (opt->shortarg == SHORT_ARG_HELP && ! h_is_used) @@ -143,12 +142,12 @@ grub_arg_show_help (grub_command_t cmd) grub_printf ("-u, "); else grub_printf (" "); - + if (opt->longarg) { grub_printf ("--%s", opt->longarg); spacing -= grub_strlen (opt->longarg) + 2; - + if (opt->arg) { grub_printf ("=%s", opt->arg); @@ -186,10 +185,10 @@ grub_arg_show_help (grub_command_t cmd) break; } } - } + } show_usage (cmd); - grub_printf ("%s\n\n", cmd->description); + grub_printf ("%s\n\n", cmd->cmd->description); if (cmd->options) showargs (cmd->options); showargs (help_options); @@ -200,14 +199,14 @@ grub_arg_show_help (grub_command_t cmd) static int -parse_option (grub_command_t cmd, int key, char *arg, struct grub_arg_list *usr) +parse_option (grub_extcmd_t cmd, int key, char *arg, struct grub_arg_list *usr) { switch (key) { case SHORT_ARG_HELP: grub_arg_show_help (cmd); return -1; - + case SHORT_ARG_USAGE: show_usage (cmd); return -1; @@ -228,7 +227,7 @@ parse_option (grub_command_t cmd, int key, char *arg, struct grub_arg_list *usr) opt++; i++; } - + if (found == -1) return -1; @@ -236,12 +235,12 @@ parse_option (grub_command_t cmd, int key, char *arg, struct grub_arg_list *usr) usr[found].arg = arg; } } - + return 0; } int -grub_arg_parse (grub_command_t cmd, int argc, char **argv, +grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, struct grub_arg_list *usr, char ***args, int *argnum) { int curarg; @@ -272,7 +271,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, { if (add_arg (arg) != 0) goto fail; - + continue; } @@ -290,7 +289,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, "Unknown argument `-%c'\n", *curshort); goto fail; } - + curshort++; /* Parse all arguments here except the last one because @@ -307,7 +306,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, if (curarg + 1 < argc) { char *nextarg = argv[curarg + 1]; - if (!(opt->flags & GRUB_ARG_OPTION_OPTIONAL) + if (!(opt->flags & GRUB_ARG_OPTION_OPTIONAL) || (grub_strlen (nextarg) < 2 || nextarg[0] != '-')) option = argv[++curarg]; } @@ -315,7 +314,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, break; } } - + } else /* The argument starts with "--". */ { @@ -344,42 +343,42 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, } } - if (! (opt->type == ARG_TYPE_NONE + if (! (opt->type == ARG_TYPE_NONE || (! option && (opt->flags & GRUB_ARG_OPTION_OPTIONAL)))) { if (! option) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + grub_error (GRUB_ERR_BAD_ARGUMENT, "Missing mandatory option for `%s'\n", opt->longarg); goto fail; } - + switch (opt->type) { case ARG_TYPE_NONE: /* This will never happen. */ break; - + case ARG_TYPE_STRING: /* No need to do anything. */ break; - + case ARG_TYPE_INT: { char *tail; - + grub_strtoul (option, &tail, 0); if (tail == 0 || tail == option || *tail != '\0' || grub_errno) { - grub_error (GRUB_ERR_BAD_ARGUMENT, - "The argument `%s' requires an integer.", + grub_error (GRUB_ERR_BAD_ARGUMENT, + "The argument `%s' requires an integer.", arg); goto fail; } break; } - + case ARG_TYPE_DEVICE: case ARG_TYPE_DIR: case ARG_TYPE_FILE: @@ -394,7 +393,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, { if (option) { - grub_error (GRUB_ERR_BAD_ARGUMENT, + grub_error (GRUB_ERR_BAD_ARGUMENT, "A value was assigned to the argument `%s' while it " "doesn't require an argument\n", arg); goto fail; @@ -405,7 +404,7 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, } grub_free (longarg); longarg = 0; - } + } complete = 1; @@ -414,6 +413,6 @@ grub_arg_parse (grub_command_t cmd, int argc, char **argv, fail: grub_free (longarg); - + return complete; } diff --git a/loader/efi/appleloader.c b/loader/efi/appleloader.c index 97982ef48..94d501bcf 100644 --- a/loader/efi/appleloader.c +++ b/loader/efi/appleloader.c @@ -22,9 +22,9 @@ #include #include #include -#include #include #include +#include static grub_dl_t my_mod; @@ -130,7 +130,7 @@ struct devdata devs[] = }; static grub_err_t -grub_cmd_appleloader (struct grub_arg_list *state __attribute__ ((unused)), +grub_cmd_appleloader (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { grub_efi_boot_services_t *b; @@ -203,17 +203,16 @@ grub_cmd_appleloader (struct grub_arg_list *state __attribute__ ((unused)), return grub_errno; } +static grub_command_t cmd; + GRUB_MOD_INIT(appleloader) { - grub_register_command ("appleloader", grub_cmd_appleloader, - GRUB_COMMAND_FLAG_BOTH, - "appleloader [OPTS]", - "Boot legacy system.", 0); - + cmd = grub_register_command ("appleloader", grub_cmd_appleloader, + "appleloader [OPTS]", "Boot legacy system."); my_mod = mod; } GRUB_MOD_FINI(appleloader) { - grub_unregister_command ("appleloader"); + grub_unregister_command (cmd); } diff --git a/loader/efi/chainloader.c b/loader/efi/chainloader.c index 1ca5f1dd6..a467ea325 100644 --- a/loader/efi/chainloader.c +++ b/loader/efi/chainloader.c @@ -27,12 +27,11 @@ #include #include #include -#include #include #include #include #include -#include +#include static grub_dl_t my_mod; @@ -178,8 +177,9 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) return file_path; } -void -grub_rescue_cmd_chainloader (int argc, char *argv[]) +static grub_err_t +grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -192,10 +192,7 @@ grub_rescue_cmd_chainloader (int argc, char *argv[]) char *filename; if (argc == 0) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); - return; - } + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); filename = argv[0]; grub_dl_ref (my_mod); @@ -312,7 +309,7 @@ grub_rescue_cmd_chainloader (int argc, char *argv[]) } grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); - return; + return 0; fail: @@ -329,19 +326,20 @@ grub_rescue_cmd_chainloader (int argc, char *argv[]) efi_call_2 (b->free_pages, address, pages); grub_dl_unref (my_mod); + + return grub_errno; } -static const char loader_name[] = "chainloader"; +static grub_command_t cmd; GRUB_MOD_INIT(chainloader) { - grub_rescue_register_command (loader_name, - grub_rescue_cmd_chainloader, - "load another boot loader"); + cmd = grub_register_command ("chainloader", grub_cmd_chainloader, + 0, "load another boot loader"); my_mod = mod; } GRUB_MOD_FINI(chainloader) { - grub_rescue_unregister_command (loader_name); + grub_unregister_command (cmd); } diff --git a/loader/efi/chainloader_normal.c b/loader/efi/chainloader_normal.c deleted file mode 100644 index 455669e23..000000000 --- a/loader/efi/chainloader_normal.c +++ /dev/null @@ -1,48 +0,0 @@ -/* chainloader_normal.c - boot another boot loader */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2006,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static grub_err_t -chainloader_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - if (argc == 0) - grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); - else - grub_rescue_cmd_chainloader (argc, args); - return grub_errno; -} - -GRUB_MOD_INIT(chainloader_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("chainloader", chainloader_command, - GRUB_COMMAND_FLAG_BOTH, - "chainloader FILE", - "Prepare to boot another boot loader.", 0); -} - -GRUB_MOD_FINI(chainloader_normal) -{ - grub_unregister_command ("chainloader"); -} diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 25d0f5990..355cb3f7f 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -31,6 +30,7 @@ #include #include #include +#include #define ALIGN_DWORD(a) ALIGN_UP (a, 4) #define ALIGN_PAGE(a) ALIGN_UP (a, 4096) @@ -563,8 +563,9 @@ grub_bsd_parse_flags (char *str, const char *opts, return result; } -void -grub_rescue_cmd_freebsd (int argc, char *argv[]) +static grub_err_t +grub_cmd_freebsd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { kernel_type = KERNEL_TYPE_FREEBSD; bootflags = ((argc <= 1) ? 0 : @@ -576,13 +577,16 @@ grub_rescue_cmd_freebsd (int argc, char *argv[]) if ((is_elf_kernel) && (grub_freebsd_add_meta_module (1, argc, argv, kern_start, kern_end - kern_start))) - return; + return grub_errno; grub_loader_set (grub_freebsd_boot, grub_bsd_unload, 1); } + + return grub_errno; } -void -grub_rescue_cmd_openbsd (int argc, char *argv[]) +static grub_err_t +grub_cmd_openbsd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { kernel_type = KERNEL_TYPE_OPENBSD; bootflags = ((argc <= 1) ? 0 : @@ -590,10 +594,13 @@ grub_rescue_cmd_openbsd (int argc, char *argv[]) if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) grub_loader_set (grub_openbsd_boot, grub_bsd_unload, 1); + + return grub_errno; } -void -grub_rescue_cmd_netbsd (int argc, char *argv[]) +static grub_err_t +grub_cmd_netbsd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { kernel_type = KERNEL_TYPE_NETBSD; bootflags = ((argc <= 1) ? 0 : @@ -601,20 +608,21 @@ grub_rescue_cmd_netbsd (int argc, char *argv[]) if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) grub_loader_set (grub_netbsd_boot, grub_bsd_unload, 1); + + return grub_errno; } -void -grub_rescue_cmd_freebsd_loadenv (int argc, char *argv[]) +static grub_err_t +grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; char *buf = 0, *curr, *next; int len; if (kernel_type != KERNEL_TYPE_FREEBSD) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "only freebsd support environment"); - return; - } + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "only freebsd support environment"); if (argc == 0) { @@ -688,30 +696,29 @@ fail: if (file) grub_file_close (file); + + return grub_errno; } -void -grub_rescue_cmd_freebsd_module (int argc, char *argv[]) +static grub_err_t +grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; if (kernel_type != KERNEL_TYPE_FREEBSD) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "only freebsd support module"); - return; - } + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "only freebsd support module"); if (!is_elf_kernel) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "only elf kernel support module"); - return; - } + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "only elf kernel support module"); /* List the current modules if no parameter. */ if (!argc) { grub_freebsd_list_modules (); - return; + return 0; } file = grub_gzfile_open (argv[0], 1); @@ -732,37 +739,42 @@ grub_rescue_cmd_freebsd_module (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } +static grub_command_t cmd_freebsd, cmd_openbsd, cmd_netbsd; +static grub_command_t cmd_freebsd_loadenv, cmd_freebsd_module; + GRUB_MOD_INIT (bsd) { - grub_rescue_register_command ("freebsd", - grub_rescue_cmd_freebsd, - "load freebsd kernel"); - grub_rescue_register_command ("openbsd", - grub_rescue_cmd_openbsd, - "load openbsd kernel"); - grub_rescue_register_command ("netbsd", - grub_rescue_cmd_netbsd, "load netbsd kernel"); - - grub_rescue_register_command ("freebsd_loadenv", - grub_rescue_cmd_freebsd_loadenv, - "load freebsd env"); - grub_rescue_register_command ("freebsd_module", - grub_rescue_cmd_freebsd_module, - "load freebsd module"); + cmd_freebsd = + grub_register_command ("freebsd", grub_cmd_freebsd, + 0, "load freebsd kernel"); + cmd_openbsd = + grub_register_command ("openbsd", grub_cmd_openbsd, + 0, "load openbsd kernel"); + cmd_netbsd = + grub_register_command ("netbsd", grub_cmd_netbsd, + 0, "load netbsd kernel"); + cmd_freebsd_loadenv = + grub_register_command ("freebsd_loadenv", grub_cmd_freebsd_loadenv, + 0, "load freebsd env"); + cmd_freebsd_module = + grub_register_command ("freebsd_module", grub_cmd_freebsd_module, + 0, "load freebsd module"); my_mod = mod; } GRUB_MOD_FINI (bsd) { - grub_rescue_unregister_command ("freebsd"); - grub_rescue_unregister_command ("openbsd"); - grub_rescue_unregister_command ("netbsd"); + grub_unregister_command (cmd_freebsd); + grub_unregister_command (cmd_openbsd); + grub_unregister_command (cmd_netbsd); - grub_rescue_unregister_command ("freebsd_loadenv"); - grub_rescue_unregister_command ("freebsd_module"); + grub_unregister_command (cmd_freebsd_loadenv); + grub_unregister_command (cmd_freebsd_module); if (mod_buf) { diff --git a/loader/i386/bsd_normal.c b/loader/i386/bsd_normal.c deleted file mode 100644 index 73b39a6bf..000000000 --- a/loader/i386/bsd_normal.c +++ /dev/null @@ -1,102 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include -#include -#include - -static grub_err_t -grub_normal_freebsd_command (struct grub_arg_list *state - __attribute__ ((unused)), int argc, char **args) -{ - grub_rescue_cmd_freebsd (argc, args); - return grub_errno; -} - -static grub_err_t -grub_normal_openbsd_command (struct grub_arg_list *state - __attribute__ ((unused)), int argc, char **args) -{ - grub_rescue_cmd_openbsd (argc, args); - return grub_errno; -} - -static grub_err_t -grub_normal_netbsd_command (struct grub_arg_list *state - __attribute__ ((unused)), int argc, char **args) -{ - grub_rescue_cmd_netbsd (argc, args); - return grub_errno; -} - -static grub_err_t -grub_normal_freebsd_loadenv_command (struct grub_arg_list *state - __attribute__ ((unused)), int argc, - char **args) -{ - grub_rescue_cmd_freebsd_loadenv (argc, args); - return grub_errno; -} - -static grub_err_t -grub_normal_freebsd_module_command (struct grub_arg_list *state - __attribute__ ((unused)), int argc, - char **args) -{ - grub_rescue_cmd_freebsd_module (argc, args); - return grub_errno; -} - -GRUB_MOD_INIT (bsd_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("freebsd", grub_normal_freebsd_command, - GRUB_COMMAND_FLAG_BOTH, - "freebsd FILE [OPTS] [ARGS...]", - "Load freebsd kernel.", 0); - grub_register_command ("openbsd", grub_normal_openbsd_command, - GRUB_COMMAND_FLAG_BOTH, - "openbsd FILE [OPTS]", "Load openbsd kernel.", 0); - grub_register_command ("netbsd", grub_normal_netbsd_command, - GRUB_COMMAND_FLAG_BOTH, - "netbsd FILE [OPTS]", "Load netbsd kernel.", 0); - - grub_register_command ("freebsd_loadenv", - grub_normal_freebsd_loadenv_command, - GRUB_COMMAND_FLAG_BOTH, - "freebsd_loadenv FILE", "Load freebsd env.", 0); - grub_register_command ("freebsd_module", - grub_normal_freebsd_module_command, - GRUB_COMMAND_FLAG_BOTH, - "freebsd_module [FILE [type=module_type] [ARGS...]]", - "Load freebsd module.", 0); -} - -GRUB_MOD_FINI (bsd_normal) -{ - grub_unregister_command ("freebsd"); - grub_unregister_command ("openbsd"); - grub_unregister_command ("netbsd"); - - grub_unregister_command ("freebsd_loadenv"); - grub_unregister_command ("freebsd_module"); -} diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 60fa8823c..c62198a4a 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include #include @@ -31,6 +30,7 @@ #include #include #include +#include #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 @@ -609,8 +609,9 @@ grub_linux_setup_video (struct linux_kernel_params *params) return 0; } -void -grub_rescue_cmd_linux (int argc, char *argv[]) +static grub_err_t +grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; struct linux_kernel_header lh; @@ -895,10 +896,13 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_dl_unref (my_mod); loaded = 0; } + + return grub_errno; } -void -grub_rescue_cmd_initrd (int argc, char *argv[]) +static grub_err_t +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -1001,22 +1005,23 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } +static grub_command_t cmd_linux, cmd_initrd; GRUB_MOD_INIT(linux) { - grub_rescue_register_command ("linux", - grub_rescue_cmd_linux, - "load linux"); - grub_rescue_register_command ("initrd", - grub_rescue_cmd_initrd, - "load initrd"); + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, "load linux"); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + 0, "load initrd"); my_mod = mod; } GRUB_MOD_FINI(linux) { - grub_rescue_unregister_command ("linux"); - grub_rescue_unregister_command ("initrd"); + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); } diff --git a/loader/i386/ieee1275/linux.c b/loader/i386/ieee1275/linux.c index d01349b4c..2f5288099 100644 --- a/loader/i386/ieee1275/linux.c +++ b/loader/i386/ieee1275/linux.c @@ -25,13 +25,13 @@ #include #include #include -#include #include #include #include #include #include #include +#include #define GRUB_OFW_LINUX_PARAMS_ADDR 0x90000 #define GRUB_OFW_LINUX_KERNEL_ADDR 0x100000 @@ -140,8 +140,9 @@ grub_linux_boot (void) return GRUB_ERR_NONE; } -void -grub_rescue_cmd_linux (int argc, char *argv[]) +static grub_err_t +grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; struct linux_kernel_header lh; @@ -229,10 +230,13 @@ fail: grub_dl_unref (my_mod); } + + return grub_errno; } -void -grub_rescue_cmd_initrd (int argc, char *argv[]) +static grub_err_t +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; @@ -263,21 +267,23 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } +static grub_command_t cmd_linux, cmd_initrd; + GRUB_MOD_INIT(linux) { - grub_rescue_register_command ("linux", - grub_rescue_cmd_linux, - "load linux"); - grub_rescue_register_command ("initrd", - grub_rescue_cmd_initrd, - "load initrd"); + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, "load linux"); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + 0, "load initrd"); my_mod = mod; } GRUB_MOD_FINI(linux) { - grub_rescue_unregister_command ("linux"); - grub_rescue_unregister_command ("initrd"); + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); } diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 6b9aad3d9..f8b9862a4 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #include #include @@ -34,6 +33,7 @@ /* FIXME: the definition of `struct grub_video_render_target' is VBE-specific. */ #include +#include #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 @@ -345,8 +345,9 @@ grub_linux_unload (void) return GRUB_ERR_NONE; } -void -grub_rescue_cmd_linux (int argc, char *argv[]) +static grub_err_t +grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; struct linux_kernel_header lh; @@ -536,10 +537,13 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_dl_unref (my_mod); loaded = 0; } + + return grub_errno; } -void -grub_rescue_cmd_initrd (int argc, char *argv[]) +static grub_err_t +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -625,22 +629,23 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } +static grub_command_t cmd_linux, cmd_initrd; GRUB_MOD_INIT(linux) { - grub_rescue_register_command ("linux", - grub_rescue_cmd_linux, - "load linux"); - grub_rescue_register_command ("initrd", - grub_rescue_cmd_initrd, - "load initrd"); + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, "load linux"); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + 0, "load initrd"); my_mod = mod; } GRUB_MOD_FINI(linux) { - grub_rescue_unregister_command ("linux"); - grub_rescue_unregister_command ("initrd"); + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); } diff --git a/loader/i386/pc/chainloader.c b/loader/i386/pc/chainloader.c index 825dbb3b6..60a4884c1 100644 --- a/loader/i386/pc/chainloader.c +++ b/loader/i386/pc/chainloader.c @@ -29,8 +29,8 @@ #include #include #include -#include #include +#include static grub_dl_t my_mod; static int boot_drive; @@ -52,7 +52,7 @@ grub_chainloader_unload (void) return GRUB_ERR_NONE; } -void +static void grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) { grub_file_t file = 0; @@ -130,8 +130,9 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) grub_dl_unref (my_mod); } -static void -grub_rescue_cmd_chainloader (int argc, char *argv[]) +static grub_err_t +grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_chainloader_flags_t flags = 0; @@ -143,22 +144,23 @@ grub_rescue_cmd_chainloader (int argc, char *argv[]) } if (argc == 0) - grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); else grub_chainloader_cmd (argv[0], flags); + + return grub_errno; } -static const char loader_name[] = "chainloader"; +static grub_command_t cmd; GRUB_MOD_INIT(chainloader) { - grub_rescue_register_command (loader_name, - grub_rescue_cmd_chainloader, - "load another boot loader"); + cmd = grub_register_command ("chainloader", grub_cmd_chainloader, + 0, "load another boot loader"); my_mod = mod; } GRUB_MOD_FINI(chainloader) { - grub_rescue_unregister_command (loader_name); + grub_unregister_command (cmd); } diff --git a/loader/i386/pc/chainloader_normal.c b/loader/i386/pc/chainloader_normal.c deleted file mode 100644 index 106cd5630..000000000 --- a/loader/i386/pc/chainloader_normal.c +++ /dev/null @@ -1,56 +0,0 @@ -/* chainloader_normal.c - boot another boot loader */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static const struct grub_arg_option options[] = - { - {"force", 'f', 0, "skip bootsector magic number test", 0, 0}, - {0, 0, 0, 0, 0, 0} - }; - -static grub_err_t -chainloader_command (struct grub_arg_list *state, - int argc, char **args) -{ - grub_chainloader_flags_t flags = state[0].set ? GRUB_CHAINLOADER_FORCE : 0; - - if (argc == 0) - grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); - else - grub_chainloader_cmd (args[0], flags); - return grub_errno; -} - -GRUB_MOD_INIT(chainloader_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("chainloader", chainloader_command, - GRUB_COMMAND_FLAG_BOTH, - "chainloader [-f] FILE", - "Prepare to boot another boot loader.", options); -} - -GRUB_MOD_FINI(chainloader_normal) -{ - grub_unregister_command ("chainloader"); -} diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index d34b5d721..935f21ba1 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -27,9 +27,9 @@ #include #include #include -#include #include #include +#include #define GRUB_LINUX_CL_OFFSET 0x9000 #define GRUB_LINUX_CL_END_OFFSET 0x90FF @@ -47,8 +47,9 @@ grub_linux_unload (void) return GRUB_ERR_NONE; } -void -grub_rescue_cmd_linux (int argc, char *argv[]) +static grub_err_t +grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; struct linux_kernel_header lh; @@ -282,10 +283,13 @@ grub_rescue_cmd_linux (int argc, char *argv[]) grub_dl_unref (my_mod); loaded = 0; } + + return grub_errno; } -void -grub_rescue_cmd_initrd (int argc, char *argv[]) +static grub_err_t +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -368,22 +372,25 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } +static grub_command_t cmd_linux, cmd_initrd; GRUB_MOD_INIT(linux) { - grub_rescue_register_command ("linux", - grub_rescue_cmd_linux, - "load linux"); - grub_rescue_register_command ("initrd", - grub_rescue_cmd_initrd, - "load initrd"); + cmd_linux = + grub_register_command ("linux", grub_cmd_linux, + 0, "load linux"); + cmd_initrd = + grub_register_command ("initrd", grub_cmd_initrd, + 0, "load initrd"); my_mod = mod; } GRUB_MOD_FINI(linux) { - grub_rescue_unregister_command ("linux"); - grub_rescue_unregister_command ("initrd"); + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); } diff --git a/loader/i386/pc/multiboot_normal.c b/loader/i386/pc/multiboot_normal.c deleted file mode 100644 index b80568fc8..000000000 --- a/loader/i386/pc/multiboot_normal.c +++ /dev/null @@ -1,60 +0,0 @@ -/* multiboot_normal.c - boot another boot loader */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static grub_err_t -grub_normal_cmd_multiboot (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_multiboot (argc, args); - return grub_errno; -} - - -static grub_err_t -grub_normal_cmd_module (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_module (argc, args); - return grub_errno; -} - -GRUB_MOD_INIT(multiboot_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("multiboot", grub_normal_cmd_multiboot, - GRUB_COMMAND_FLAG_BOTH | GRUB_COMMAND_FLAG_NO_ARG_PARSE, - "multiboot FILE [ARGS...]", - "Load a Multiboot kernel.", 0); - - grub_register_command ("module", grub_normal_cmd_module, - GRUB_COMMAND_FLAG_BOTH | GRUB_COMMAND_FLAG_NO_ARG_PARSE, - "module FILE [ARGS...]", - "Load a Multiboot module.", 0); -} - -GRUB_MOD_FINI(multiboot_normal) -{ - grub_unregister_command ("multiboot"); - grub_unregister_command ("module"); -} diff --git a/loader/linux_normal.c b/loader/linux_normal.c deleted file mode 100644 index 0d7231ecb..000000000 --- a/loader/linux_normal.c +++ /dev/null @@ -1,60 +0,0 @@ -/* linux_normal.c - boot linux */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static grub_err_t -grub_normal_linux_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_linux (argc, args); - return grub_errno; -} - - -static grub_err_t -grub_normal_initrd_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_initrd (argc, args); - return grub_errno; -} - -GRUB_MOD_INIT(linux_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("linux", grub_normal_linux_command, - GRUB_COMMAND_FLAG_BOTH, - "linux FILE [ARGS...]", - "Load a linux kernel.", 0); - - grub_register_command ("initrd", grub_normal_initrd_command, - GRUB_COMMAND_FLAG_BOTH, - "initrd FILE", - "Load an initrd.", 0); -} - -GRUB_MOD_FINI(linux_normal) -{ - grub_unregister_command ("linux"); - grub_unregister_command ("initrd"); -} diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index abcad9bb6..f4a39330f 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -19,17 +19,16 @@ #include #include -#include #include #include #include #include #include -#include #include #include #include #include +#include grub_dl_t my_mod; @@ -99,10 +98,10 @@ find_multi_boot2_header (grub_file_t file) return found_status; } -void -grub_rescue_cmd_multiboot_loader (int argc, char *argv[]) +static grub_err_t +grub_cmd_multiboot_loader (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { - grub_file_t file = 0; int header_multi_ver_found = 0; @@ -164,10 +163,13 @@ fail: grub_file_close (file); grub_dl_unref (my_mod); + + return grub_errno; } -void -grub_rescue_cmd_module_loader (int argc, char *argv[]) +static grub_err_t +grub_cmd_module_loader (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { #if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS) @@ -184,20 +186,26 @@ grub_rescue_cmd_module_loader (int argc, char *argv[]) "Launching multiboot 2 grub_module2() function\n"); grub_module2 (argc, argv); } + + return grub_errno; } +static grub_command_t cmd_multiboot, cmd_module; + GRUB_MOD_INIT(multiboot) { - grub_rescue_register_command ("multiboot", grub_rescue_cmd_multiboot_loader, - "load a multiboot kernel"); - grub_rescue_register_command ("module", grub_rescue_cmd_module_loader, - "load a multiboot module"); + cmd_multiboot = + grub_register_command ("multiboot", grub_cmd_multiboot_loader, + 0, "load a multiboot kernel"); + cmd_module = + grub_register_command ("module", grub_cmd_module_loader, + 0, "load a multiboot module"); my_mod = mod; } GRUB_MOD_FINI(multiboot) { - grub_rescue_unregister_command ("multiboot"); - grub_rescue_unregister_command ("module"); + grub_unregister_command (cmd_multiboot); + grub_unregister_command (cmd_module); } diff --git a/loader/multiboot_loader_normal.c b/loader/multiboot_loader_normal.c deleted file mode 100644 index 4a1a029b8..000000000 --- a/loader/multiboot_loader_normal.c +++ /dev/null @@ -1,61 +0,0 @@ -/* multiboot_loader_normal.c - boot another boot loader */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include - -static grub_err_t -grub_normal_cmd_multiboot (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_multiboot_loader (argc, args); - return grub_errno; -} - -static grub_err_t -grub_normal_cmd_module (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_module_loader (argc, args); - return grub_errno; -} - -GRUB_MOD_INIT(multiboot_loader_normal) -{ - (void) mod; /* To stop warning. */ - grub_register_command ("multiboot", grub_normal_cmd_multiboot, - GRUB_COMMAND_FLAG_BOTH - | GRUB_COMMAND_FLAG_NO_ARG_PARSE, - "multiboot FILE [ARGS...]", - "Load a Multiboot kernel.", 0); - - grub_register_command ("module", grub_normal_cmd_module, - GRUB_COMMAND_FLAG_BOTH - | GRUB_COMMAND_FLAG_NO_ARG_PARSE, - "module FILE [ARGS...]", - "Load a Multiboot module.", 0); -} - -GRUB_MOD_FINI(multiboot_loader_normal) -{ - grub_unregister_command ("multiboot"); - grub_unregister_command ("module"); -} diff --git a/loader/powerpc/ieee1275/linux.c b/loader/powerpc/ieee1275/linux.c index 3b8534135..80d8b033f 100644 --- a/loader/powerpc/ieee1275/linux.c +++ b/loader/powerpc/ieee1275/linux.c @@ -22,10 +22,10 @@ #include #include #include -#include #include #include #include +#include #define ELF32_LOADMASK (0xc0000000UL) #define ELF64_LOADMASK (0xc000000000000000ULL) @@ -185,8 +185,9 @@ grub_linux_load64 (grub_elf_t elf) return grub_elf64_load (elf, offset_phdr, 0, 0); } -void -grub_rescue_cmd_linux (int argc, char *argv[]) +static grub_err_t +grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_elf_t elf = 0; int i; @@ -261,10 +262,13 @@ out: initrd_addr = 0; loaded = 1; } + + return grub_errno; } -void -grub_rescue_cmd_initrd (int argc, char *argv[]) +static grub_err_t +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -323,21 +327,23 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } - +static grub_command_t cmd_linux, cmd_initrd; GRUB_MOD_INIT(linux) { - grub_rescue_register_command ("linux", grub_rescue_cmd_linux, - "load a linux kernel"); - grub_rescue_register_command ("initrd", grub_rescue_cmd_initrd, - "load an initrd"); + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, "load a linux kernel"); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + 0, "load an initrd"); my_mod = mod; } GRUB_MOD_FINI(linux) { - grub_rescue_unregister_command ("linux"); - grub_rescue_unregister_command ("initrd"); + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); } diff --git a/loader/powerpc/ieee1275/linux_normal.c b/loader/powerpc/ieee1275/linux_normal.c deleted file mode 100644 index 619eb335d..000000000 --- a/loader/powerpc/ieee1275/linux_normal.c +++ /dev/null @@ -1,60 +0,0 @@ -/* linux_normal.c - boot Linux */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include - -static const struct grub_arg_option options[] = - { - {0, 0, 0, 0, 0, 0} - }; - -static grub_err_t -grub_cmd_linux (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_linux (argc, args); - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_cmd_initrd (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_rescue_cmd_initrd (argc, args); - return GRUB_ERR_NONE; -} - -GRUB_MOD_INIT(linux_normal) -{ - (void) mod; - grub_register_command ("linux", grub_cmd_linux, GRUB_COMMAND_FLAG_BOTH, - "linux [KERNELARGS...]", - "Loads linux", options); - grub_register_command ("initrd", grub_cmd_initrd, GRUB_COMMAND_FLAG_BOTH, - "initrd FILE", - "Loads initrd", options); -} - -GRUB_MOD_FINI(linux_normal) -{ - grub_unregister_command ("linux"); - grub_unregister_command ("initrd"); -} diff --git a/normal/command.c b/normal/command.c index 6ca56da21..863d45f59 100644 --- a/normal/command.c +++ b/normal/command.c @@ -25,163 +25,8 @@ #include #include #include - -static grub_command_t grub_command_list; - -grub_command_t -grub_register_command (const char *name, - grub_err_t (*func) (struct grub_arg_list *state, - int argc, char **args), - unsigned flags, - const char *summary, - const char *description, - const struct grub_arg_option *options) -{ - grub_command_t cmd, *p; - - cmd = (grub_command_t) grub_malloc (sizeof (*cmd)); - if (! cmd) - return 0; - - cmd->name = grub_strdup (name); - if (! cmd->name) - { - grub_free (cmd); - return 0; - } - - cmd->func = func; - cmd->flags = flags; - cmd->summary = summary; - cmd->description = description; - cmd->options = options; - cmd->module_name = 0; - - /* Keep the list sorted for simplicity. */ - p = &grub_command_list; - while (*p) - { - if (grub_strcmp ((*p)->name, name) >= 0) - break; - - p = &((*p)->next); - } - - if (*p && grub_strcmp ((*p)->name, name) == 0) - { - grub_command_t q; - - q = *p; - if (q->flags & GRUB_COMMAND_FLAG_NOT_LOADED) - { - q->func = cmd->func; - q->flags = cmd->flags; - q->summary = cmd->summary; - q->description = cmd->description; - q->options = cmd->options; - grub_free (cmd->name); - grub_free (cmd->module_name); - grub_free (cmd); - cmd = q; - } - else - { - grub_free (cmd->name); - grub_free (cmd); - cmd = 0; - } - } - else - { - cmd->next = *p; - *p = cmd; - } - - return cmd; -} - -void -grub_unregister_command (const char *name) -{ - grub_command_t *p, q; - - for (p = &grub_command_list, q = *p; q; p = &(q->next), q = q->next) - if (grub_strcmp (name, q->name) == 0) - { - *p = q->next; - grub_free (q->name); - grub_free (q->module_name); - grub_free (q); - break; - } -} - -grub_command_t -grub_command_find (char *cmdline) -{ - char *first_space; - grub_command_t cmd; - int count = 0; - - first_space = grub_strchr (cmdline, ' '); - if (first_space) - *first_space = '\0'; - - again: - - for (cmd = grub_command_list; cmd; cmd = cmd->next) - if (grub_strcmp (cmdline, cmd->name) == 0) - break; - - if (! cmd) - grub_error (GRUB_ERR_UNKNOWN_COMMAND, "unknown command `%s'", cmdline); - else if (cmd->flags & GRUB_COMMAND_FLAG_NOT_LOADED) - { - /* Automatically load the command. */ - if (count == 0) - { - grub_dl_t mod; - char *module_name; - - module_name = grub_strdup (cmd->module_name); - if (module_name) - { - mod = grub_dl_load (module_name); - if (mod) - { - grub_dl_ref (mod); - count++; - grub_free (module_name); - goto again; - } - - grub_free (module_name); - } - } - - /* This module seems broken. */ - grub_unregister_command (cmdline); - grub_error (GRUB_ERR_UNKNOWN_COMMAND, "unknown command `%s'", cmdline); - cmd = 0; - } - - if (first_space) - *first_space = ' '; - - return cmd; -} - -int -grub_iterate_commands (int (*iterate) (grub_command_t)) -{ - grub_command_t cmd; - - for (cmd = grub_command_list; cmd; cmd = cmd->next) - if (iterate (cmd)) - return 1; - - return 0; -} +#include +#include int grub_command_execute (char *cmdline, int interactive) @@ -222,173 +67,4 @@ grub_command_execute (char *cmdline, int interactive) grub_set_more (0); return ret; -} - -static grub_err_t -rescue_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char **args __attribute__ ((unused))) -{ - grub_longjmp (grub_exit_env, 0); - - /* Never reach here. */ - return 0; -} - - -static grub_err_t -set_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - char *var; - char *val; - - auto int print_env (struct grub_env_var *env); - int print_env (struct grub_env_var *env) - { - grub_printf ("%s=%s\n", env->name, env->value); - return 0; - } - - if (! argc) - { - grub_env_iterate (print_env); - return 0; - } - - var = args[0]; - val = grub_strchr (var, '='); - if (! val) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "not an assignment"); - return grub_errno; - } - - val[0] = 0; - grub_env_set (var, val + 1); - val[0] = '='; - return 0; -} - -static grub_err_t -unset_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, - "no environment variable specified"); - - grub_env_unset (args[0]); - return 0; -} - -static grub_err_t -export_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - if (argc < 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, - "no environment variable specified"); - - grub_env_export (args[0]); - return 0; -} - -static grub_err_t -insmod_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - char *p; - grub_dl_t mod; - - if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); - - p = grub_strchr (args[0], '/'); - if (! p) - mod = grub_dl_load (args[0]); - else - mod = grub_dl_load_file (args[0]); - - if (mod) - grub_dl_ref (mod); - - return 0; -} - -static grub_err_t -rmmod_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) -{ - grub_dl_t mod; - - if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no module specified"); - - mod = grub_dl_get (args[0]); - if (! mod) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "no such module"); - - if (! grub_dl_unref (mod)) - grub_dl_unload (mod); - - return 0; -} - -static grub_err_t -lsmod_command (struct grub_arg_list *state __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char **args __attribute__ ((unused))) -{ - auto int print_module (grub_dl_t mod); - - int print_module (grub_dl_t mod) - { - grub_dl_dep_t dep; - - grub_printf ("%s\t%d\t\t", mod->name, mod->ref_count); - for (dep = mod->dep; dep; dep = dep->next) - { - if (dep != mod->dep) - grub_putchar (','); - - grub_printf ("%s", dep->mod->name); - } - grub_putchar ('\n'); - grub_refresh (); - - return 0; - } - - grub_printf ("Name\tRef Count\tDependencies\n"); - grub_dl_iterate (print_module); - return 0; -} - -void -grub_command_init (void) -{ - grub_register_command ("rescue", rescue_command, GRUB_COMMAND_FLAG_BOTH, - "rescue", "Go back to the rescue mode.", 0); - - grub_register_command ("set", set_command, GRUB_COMMAND_FLAG_BOTH, - "set [ENVVAR=VALUE]", - "Set an environment variable.", 0); - - grub_register_command ("unset", unset_command, GRUB_COMMAND_FLAG_BOTH, - "unset ENVVAR", "Remove an environment variable.", 0); - - grub_register_command ("export", export_command, GRUB_COMMAND_FLAG_BOTH, - "export ENVVAR", "Export a variable.", 0); - - grub_register_command ("insmod", insmod_command, GRUB_COMMAND_FLAG_BOTH, - "insmod MODULE", - "Insert a module. The argument can be a file or a module name.", - 0); - - grub_register_command ("rmmod", rmmod_command, GRUB_COMMAND_FLAG_BOTH, - "rmmod MODULE", "Remove a module.", 0); - - grub_register_command ("lsmod", lsmod_command, GRUB_COMMAND_FLAG_BOTH, - "lsmod", "Show loaded modules.", 0); -} +} \ No newline at end of file diff --git a/normal/completion.c b/normal/completion.c index fb38f2866..39f5c1323 100644 --- a/normal/completion.c +++ b/normal/completion.c @@ -25,6 +25,7 @@ #include #include #include +#include /* The current word. */ static char *current_word; @@ -179,7 +180,7 @@ iterate_dev (const char *devname) static int iterate_command (grub_command_t cmd) { - if (grub_command_find (cmd->name)) + if (cmd->prio & GRUB_PRIO_LIST_FLAG_ACTIVE) { if (cmd->flags & GRUB_COMMAND_FLAG_CMDLINE) { @@ -318,19 +319,24 @@ static int complete_arguments (char *command) { grub_command_t cmd; + grub_extcmd_t ext; const struct grub_arg_option *option; char shortarg[] = "- "; cmd = grub_command_find (command); - if (!cmd || !cmd->options) + if (!cmd || !(cmd->flags & GRUB_COMMAND_FLAG_EXTCMD)) + return 0; + + ext = cmd->data; + if (!ext->options) return 0; if (add_completion ("-u", " ", GRUB_COMPLETION_TYPE_ARGUMENT)) return 1; /* Add the short arguments. */ - for (option = cmd->options; option->doc; option++) + for (option = ext->options; option->doc; option++) { if (! option->shortarg) continue; @@ -348,7 +354,7 @@ complete_arguments (char *command) return 1; /* Add the long arguments. */ - for (option = cmd->options; option->doc; option++) + for (option = ext->options; option->doc; option++) { char *longarg; if (!option->longarg) @@ -412,7 +418,7 @@ grub_normal_do_completion (char *buf, int *restore, if (argc == 0) { /* Complete a command. */ - if (grub_iterate_commands (iterate_command)) + if (grub_command_iterate (iterate_command)) goto fail; } else if (*current_word == '-') diff --git a/normal/execute.c b/normal/execute.c index 35b7a4be1..8bf6d1745 100644 --- a/normal/execute.c +++ b/normal/execute.c @@ -20,9 +20,9 @@ #include #include #include -#include #include #include +#include static grub_err_t grub_script_execute_cmd (struct grub_script_cmd *cmd) @@ -87,11 +87,6 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) char **args = 0; int i = 0; grub_command_t grubcmd; - struct grub_arg_list *state; - struct grub_arg_option *parser; - int maxargs = 0; - char **parsed_arglist; - int numargs; grub_err_t ret = 0; int argcount = 0; grub_script_function_t func = 0; @@ -143,27 +138,7 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) /* Execute the GRUB command or function. */ if (grubcmd) - { - /* Count the amount of options the command has. */ - parser = (struct grub_arg_option *) grubcmd->options; - while (parser && (parser++)->doc) - maxargs++; - - /* Set up the option state. */ - state = grub_malloc (sizeof (struct grub_arg_list) * maxargs); - grub_memset (state, 0, sizeof (struct grub_arg_list) * maxargs); - - /* Start the command. */ - if (! (grubcmd->flags & GRUB_COMMAND_FLAG_NO_ARG_PARSE)) - { - if (grub_arg_parse (grubcmd, argcount, args, state, &parsed_arglist, &numargs)) - ret = (grubcmd->func) (state, numargs, parsed_arglist); - } - else - ret = (grubcmd->func) (state, argcount, args); - - grub_free (state); - } + ret = (grubcmd->func) (grubcmd, argcount, args); else ret = grub_script_function_call (func, argcount, args); @@ -273,3 +248,4 @@ grub_script_execute (struct grub_script *script) return grub_script_execute_cmd (script->cmd); } + diff --git a/normal/main.c b/normal/main.c index ea60b8374..c6199ae67 100644 --- a/normal/main.c +++ b/normal/main.c @@ -407,6 +407,39 @@ grub_normal_init_page (void) #undef TITLE } +static grub_err_t +grub_dyncmd_dispatcher (struct grub_command *cmd, + int argc, char **args) +{ + char *modname = cmd->data; + grub_dl_t mod; + grub_err_t ret; + + mod = grub_dl_load (modname); + if (mod) + { + char *name; + + grub_free (modname); + grub_dl_ref (mod); + + name = (char *) cmd->name; + grub_unregister_command (cmd); + + cmd = grub_command_find (name); + if (cmd) + ret = (cmd->func) (cmd, argc, args); + else + ret = grub_errno; + + grub_free (name); + } + else + ret = grub_errno; + + return ret; +} + /* Read the file command.lst for auto-loading. */ static void read_command_list (void) @@ -427,19 +460,29 @@ read_command_list (void) file = grub_file_open (filename); if (file) { - while (1) + char *buf = 0; + for (;; grub_free(buf)) { - char *p; + char *p, *name, *modname; grub_command_t cmd; - char *buf = get_line (file); + int prio = 0; + + buf = get_line (file); if (! buf) break; - if (! grub_isgraph (buf[0])) + name = buf; + if (*name == '*') + { + name++; + prio++; + } + + if (! grub_isgraph (name[0])) continue; - p = grub_strchr (buf, ':'); + p = grub_strchr (name, ':'); if (! p) continue; @@ -450,19 +493,34 @@ read_command_list (void) if (! grub_isgraph (*p)) continue; - cmd = grub_register_command (buf, 0, - GRUB_COMMAND_FLAG_NOT_LOADED, - 0, 0, 0); - if (! cmd) + if (grub_dl_get (p)) + continue; + + name = grub_strdup (name); + if (! name) + continue; + + modname = grub_strdup (p); + if (! modname) { - grub_free (buf); + grub_free (name); continue; } - cmd->module_name = grub_strdup (p); - if (! cmd->module_name) - grub_unregister_command (buf); - grub_free (buf); + cmd = grub_register_command_prio (name, + grub_dyncmd_dispatcher, + 0, "not loaded", prio); + if (! cmd) + { + grub_free (name); + grub_free (modname); + continue; + } + cmd->flags |= GRUB_COMMAND_FLAG_DYNCMD; + cmd->data = modname; + + /* Update the active flag. */ + grub_command_find (name); } grub_file_close (file); @@ -597,10 +655,30 @@ grub_normal_execute (const char *config, int nested) grub_cmdline_run (nested); } -/* Enter normal mode from rescue mode. */ -static void -grub_rescue_cmd_normal (int argc, char *argv[]) +static grub_err_t +grub_cmd_rescue (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) { + grub_longjmp (grub_exit_env, 0); + + /* Never reach here. */ + return 0; +} + +static grub_command_t cmd_normal; + +/* Enter normal mode from rescue mode. */ +static grub_err_t +grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_command_t cmd_rescue; + + grub_unregister_command (cmd_normal); + cmd_rescue = grub_register_command ("rescue", grub_cmd_rescue, + 0, "enter rescue mode"); + if (argc == 0) { /* Guess the config filename. It is necessary to make CONFIG static, @@ -613,7 +691,7 @@ grub_rescue_cmd_normal (int argc, char *argv[]) { config = grub_malloc (grub_strlen (prefix) + sizeof ("/grub.cfg")); if (! config) - return; + goto quit; grub_sprintf (config, "%s/grub.cfg", prefix); grub_enter_normal_mode (config); @@ -624,6 +702,12 @@ grub_rescue_cmd_normal (int argc, char *argv[]) } else grub_enter_normal_mode (argv[0]); + +quit: + grub_unregister_command (cmd_rescue); + cmd_normal = grub_register_command_prio ("normal", grub_cmd_normal, + 0, "enter normal mode", 0); + return 0; } GRUB_MOD_INIT(normal) @@ -637,8 +721,8 @@ GRUB_MOD_INIT(normal) grub_set_history (GRUB_DEFAULT_HISTORY_SIZE); /* Register a command "normal" for the rescue mode. */ - grub_rescue_register_command ("normal", grub_rescue_cmd_normal, - "enter normal mode"); + cmd_normal = grub_register_command ("normal", grub_cmd_normal, + 0, "enter normal mode"); /* Reload terminal colors when these variables are written to. */ grub_register_variable_hook ("color_normal", NULL, grub_env_write_color_normal); @@ -647,14 +731,10 @@ GRUB_MOD_INIT(normal) /* Preserve hooks after context changes. */ grub_env_export ("color_normal"); grub_env_export ("color_highlight"); - - /* This registers some built-in commands. */ - grub_command_init (); } GRUB_MOD_FINI(normal) { grub_set_history (0); - grub_rescue_unregister_command ("normal"); + grub_unregister_command (cmd_normal); } - diff --git a/term/gfxterm.c b/term/gfxterm.c index b9e1eb1a9..dacecf478 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -20,13 +20,12 @@ #include #include #include -#include #include -#include #include #include #include #include +#include #define DEFAULT_VIDEO_WIDTH 640 #define DEFAULT_VIDEO_HEIGHT 480 @@ -309,7 +308,7 @@ grub_gfxterm_init (void) grub_err_t rc; /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); @@ -328,7 +327,7 @@ grub_gfxterm_init (void) grub_err_t rc; /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); @@ -347,91 +346,91 @@ grub_gfxterm_init (void) if (grub_errno != GRUB_ERR_NONE) { grub_err_t rc; - + /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); - + /* Free memory before returning. */ grub_free (modevar); - - return rc; - } + + return rc; + } } - else + else { - /* We have optional color depth value. */ - *param = 0; - param++; + /* We have optional color depth value. */ + *param = 0; + param++; - height = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - { - grub_err_t rc; - - /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, - "Invalid mode: %s\n", - current_mode); - - /* Free memory before returning. */ - grub_free (modevar); - - return rc; - } + height = grub_strtoul (value, 0, 0); + if (grub_errno != GRUB_ERR_NONE) + { + grub_err_t rc; - /* Convert color depth value. */ - value = param; - depth = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - { - grub_err_t rc; - - /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, - "Invalid mode: %s\n", - current_mode); - - /* Free memory before returning. */ - grub_free (modevar); - - return rc; - } + /* First setup error message. */ + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Invalid mode: %s\n", + current_mode); + + /* Free memory before returning. */ + grub_free (modevar); + + return rc; + } + + /* Convert color depth value. */ + value = param; + depth = grub_strtoul (value, 0, 0); + if (grub_errno != GRUB_ERR_NONE) + { + grub_err_t rc; + + /* First setup error message. */ + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Invalid mode: %s\n", + current_mode); + + /* Free memory before returning. */ + grub_free (modevar); + + return rc; + } } - - /* Try out video mode. */ - - /* If we have 8 or less bits, then assume that it is indexed color mode. */ - if ((depth <= 8) && (depth != -1)) - flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; - /* We have more than 8 bits, then assume that it is RGB color mode. */ - if (depth > 8) - flags |= GRUB_VIDEO_MODE_TYPE_RGB; + /* Try out video mode. */ - /* If user requested specific depth, forward that information to driver. */ - if (depth != -1) - flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) - & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; + /* If we have 8 or less bits, then assume that it is indexed color mode. */ + if ((depth <= 8) && (depth != -1)) + flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; - /* Try to initialize requested mode. Ignore any errors. */ - grub_error_push (); - if (grub_video_setup (width, height, flags) != GRUB_ERR_NONE) - { - grub_error_pop (); - continue; - } - - /* Figure out what mode we ended up. */ - if (grub_video_get_info (&mode_info) != GRUB_ERR_NONE) - { - /* Couldn't get video mode info, restore old mode and continue to next one. */ - grub_error_pop (); - - grub_video_restore (); - continue; - } + /* We have more than 8 bits, then assume that it is RGB color mode. */ + if (depth > 8) + flags |= GRUB_VIDEO_MODE_TYPE_RGB; + + /* If user requested specific depth, forward that information to driver. */ + if (depth != -1) + flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) + & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; + + /* Try to initialize requested mode. Ignore any errors. */ + grub_error_push (); + if (grub_video_setup (width, height, flags) != GRUB_ERR_NONE) + { + grub_error_pop (); + continue; + } + + /* Figure out what mode we ended up. */ + if (grub_video_get_info (&mode_info) != GRUB_ERR_NONE) + { + /* Couldn't get video mode info, restore old mode and continue to next one. */ + grub_error_pop (); + + grub_video_restore (); + continue; + } /* Restore state of error stack. */ grub_error_pop (); @@ -530,7 +529,7 @@ redraw_screen_rect (unsigned int x, unsigned int y, { /* Render bitmap as background. */ grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_REPLACE, x, y, - x, y, + x, y, width, height); /* If bitmap is smaller than requested blit area, use background @@ -555,7 +554,7 @@ redraw_screen_rect (unsigned int x, unsigned int y, } /* Render background layer. */ - grub_video_fill_rect (color, tx, y, w, h); + grub_video_fill_rect (color, tx, y, w, h); } /* Fill bottom side of the bitmap if needed. */ @@ -570,7 +569,7 @@ redraw_screen_rect (unsigned int x, unsigned int y, } /* Render background layer. */ - grub_video_fill_rect (color, x, ty, width, h); + grub_video_fill_rect (color, x, ty, width, h); } /* Render text layer as blended. */ @@ -589,7 +588,7 @@ redraw_screen_rect (unsigned int x, unsigned int y, grub_video_blit_render_target (text_layer, GRUB_VIDEO_BLIT_REPLACE, x, y, x - virtual_screen.offset_x, y - virtual_screen.offset_y, - width, height); + width, height); } } @@ -1086,7 +1085,7 @@ grub_gfxterm_refresh (void) } static grub_err_t -grub_gfxterm_background_image_cmd (struct grub_arg_list *state __attribute__ ((unused)), +grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { @@ -1151,21 +1150,19 @@ static struct grub_term_output grub_video_term = .next = 0 }; +static grub_command_t cmd; + GRUB_MOD_INIT(term_gfxterm) { my_mod = mod; grub_term_register_output (&grub_video_term); - - grub_register_command ("background_image", - grub_gfxterm_background_image_cmd, - GRUB_COMMAND_FLAG_BOTH, - "background_image", - "Load background image for active terminal", - 0); + cmd = grub_register_command ("background_image", + grub_gfxterm_background_image_cmd, + 0, "Load background image for active terminal"); } GRUB_MOD_FINI(term_gfxterm) { - grub_unregister_command ("background_image"); + grub_unregister_command (cmd); grub_term_unregister_output (&grub_video_term); } diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 03a46ba10..eacff0661 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -23,10 +23,9 @@ #include #include #include -#include -#include #include #include +#include #define TEXT_WIDTH 80 #define TEXT_HEIGHT 25 @@ -491,10 +490,11 @@ static struct grub_term_output grub_serial_term_output = static grub_err_t -grub_cmd_serial (struct grub_arg_list *state, +grub_cmd_serial (grub_extcmd_t cmd, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { + struct grub_arg_list *state = cmd->state; struct serial_port backup_settings = serial_settings; grub_err_t hwiniterr; @@ -603,11 +603,16 @@ grub_cmd_serial (struct grub_arg_list *state, return hwiniterr; } +static grub_extcmd_t cmd; + GRUB_MOD_INIT(serial) { (void) mod; /* To stop warning. */ - grub_register_command ("serial", grub_cmd_serial, GRUB_COMMAND_FLAG_BOTH, - "serial [OPTIONS...]", "Configure serial port.", options); + cmd = grub_register_extcmd ("serial", grub_cmd_serial, + GRUB_COMMAND_FLAG_BOTH, + "serial [OPTIONS...]", + "Configure serial port.", options); + /* Set default settings. */ serial_settings.port = serial_hw_get_port (0); serial_settings.divisor = serial_get_divisor (9600); @@ -618,7 +623,7 @@ GRUB_MOD_INIT(serial) GRUB_MOD_FINI(serial) { - grub_unregister_command ("serial"); + grub_unregister_extcmd (cmd); if (registered == 1) /* Unregister terminal only if registered. */ { grub_term_unregister_input (&grub_serial_term_input); diff --git a/term/i386/pc/vesafb.c b/term/i386/pc/vesafb.c index 730595433..75cbd75ce 100644 --- a/term/i386/pc/vesafb.c +++ b/term/i386/pc/vesafb.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include diff --git a/term/i386/pc/vga.c b/term/i386/pc/vga.c index d32c86e6b..af880d5b5 100644 --- a/term/i386/pc/vga.c +++ b/term/i386/pc/vga.c @@ -27,7 +27,6 @@ #include #include #include -#include #define DEBUG_VGA 0 diff --git a/term/terminfo.c b/term/terminfo.c index 5cbbe16ab..45dcef7e0 100644 --- a/term/terminfo.c +++ b/term/terminfo.c @@ -27,10 +27,10 @@ #include #include #include -#include #include #include #include +#include struct terminfo { @@ -159,8 +159,8 @@ grub_terminfo_cursor_off (void) /* GRUB Command. */ static grub_err_t -grub_cmd_terminfo (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args) +grub_cmd_terminfo (grub_command_t cmd __attribute__ ((unused)), + int argc, char **args) { if (argc == 0) { @@ -173,15 +173,17 @@ grub_cmd_terminfo (struct grub_arg_list *state __attribute__ ((unused)), return grub_terminfo_set_current (args[0]); } +static grub_command_t cmd; + GRUB_MOD_INIT(terminfo) { (void) mod; /* To stop warning. */ - grub_register_command ("terminfo", grub_cmd_terminfo, GRUB_COMMAND_FLAG_BOTH, - "terminfo [TERM]", "Set terminfo type.", 0); + cmd = grub_register_command ("terminfo", grub_cmd_terminfo, + "terminfo [TERM]", "Set terminfo type."); grub_terminfo_set_current ("vt100"); } GRUB_MOD_FINI(terminfo) { - grub_unregister_command ("terminfo"); + grub_unregister_command (cmd); } diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 76cefa6af..47222699f 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -28,10 +28,10 @@ #include #include #include -#include #include #include #include +#include #include @@ -62,73 +62,16 @@ grub_refresh (void) fflush (stdout); } -static struct grub_command cmd_loopback; -static struct grub_command cmd_blocklist; -static struct grub_command cmd_ls; - -grub_command_t -grub_register_command (const char *name, - grub_err_t (*func) (struct grub_arg_list * state, - int argc, char **args), - unsigned flags, - const char *summary __attribute__ ((unused)), - const char *description __attribute__ ((unused)), - const struct grub_arg_option *options) -{ - grub_command_t cmd = 0; - - if (!grub_strcmp (name, "loopback")) - cmd = &cmd_loopback; - else if (!grub_strcmp (name, "blocklist")) - cmd = &cmd_blocklist; - else if (!grub_strcmp (name, "ls")) - cmd = &cmd_ls; - - if (cmd) - { - cmd->func = func; - cmd->flags = flags; - cmd->options = options; - } - return NULL; -} - static grub_err_t -execute_command (grub_command_t cmd, int n, char **args) +execute_command (char *name, int n, char **args) { - int maxargs = 0; - grub_err_t ret = 0; - struct grub_arg_list *state; - struct grub_arg_option *parser; - char **parsed_arglist; - int numargs; + grub_command_t cmd; - /* Count the amount of options the command has. */ - parser = (struct grub_arg_option *) cmd->options; - while (parser && (parser++)->doc) - maxargs++; + cmd = grub_command_find (name); + if (! cmd) + grub_util_error ("Can\'t find command %s", name); - /* Set up the option state. */ - state = grub_malloc (sizeof (struct grub_arg_list) * maxargs); - grub_memset (state, 0, sizeof (struct grub_arg_list) * maxargs); - - /* Start the command. */ - if (!(cmd->flags & GRUB_COMMAND_FLAG_NO_ARG_PARSE)) - { - if (grub_arg_parse (cmd, n, args, state, &parsed_arglist, &numargs)) - ret = (cmd->func) (state, numargs, parsed_arglist); - } - else - ret = (cmd->func) (state, n, args); - - grub_free (state); - - return ret; -} - -void -grub_unregister_command (const char *name __attribute__ ((unused))) -{ + return (cmd->func) (cmd, n, args); } #define CMD_LS 1 @@ -346,7 +289,7 @@ fstest (char **images, int num_disks, int cmd, int n, char **args) grub_sprintf (loop_name, "loop%d", i); grub_sprintf (host_file, "(host)%s", images[i]); - if (execute_command (&cmd_loopback, 3, argv)) + if (execute_command ("loopback", 3, argv)) grub_util_error ("loopback command fails."); } @@ -354,7 +297,7 @@ fstest (char **images, int num_disks, int cmd, int n, char **args) switch (cmd) { case CMD_LS: - execute_command (&cmd_ls, n, args); + execute_command ("ls", n, args); break; case CMD_CP: cmd_cp (args[0], args[1]); @@ -369,7 +312,7 @@ fstest (char **images, int num_disks, int cmd, int n, char **args) cmd_crc (args[0]); break; case CMD_BLOCKLIST: - execute_command (&cmd_blocklist, n, args); + execute_command ("blocklist", n, args); grub_printf ("\n"); } @@ -378,7 +321,7 @@ fstest (char **images, int num_disks, int cmd, int n, char **args) for (i = 0; i < num_disks; i++) { grub_sprintf (loop_name, "loop%d", i); - execute_command (&cmd_loopback, 2, argv); + execute_command ("loopback", 2, argv); } } diff --git a/video/readers/jpeg.c b/video/readers/jpeg.c index 327c9f91c..45a54c42e 100644 --- a/video/readers/jpeg.c +++ b/video/readers/jpeg.c @@ -22,7 +22,6 @@ #include #include #include -#include #include /* Uncomment following define to enable JPEG debug. */ diff --git a/video/readers/png.c b/video/readers/png.c index 3364d56c0..f9247b1c8 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -22,7 +22,6 @@ #include #include #include -#include #include /* Uncomment following define to enable PNG debug. */ diff --git a/video/readers/tga.c b/video/readers/tga.c index de56008cb..cdaa7dda9 100644 --- a/video/readers/tga.c +++ b/video/readers/tga.c @@ -22,7 +22,6 @@ #include #include #include -#include #include /* Uncomment following define to enable TGA debug. */ From 2274cc8fc94b0d408d877175a28cd969297e8d62 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 21 Mar 2009 23:02:12 +0000 Subject: [PATCH 0576/1707] 2009-03-21 Vladimir Serbinenko Bugfixes in multiboot for bugs uncovered by solaris kernel. * loader/i386/multiboot_elfxx.c (grub_multiboot_load_elf): Corrected limit detection. Use vaddr of correct segment for entry_point. --- ChangeLog | 8 ++++++++ loader/i386/multiboot_elfxx.c | 29 +++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d4824dc26..2d317818a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-03-21 Vladimir Serbinenko + + Bugfixes in multiboot for bugs uncovered by solaris kernel. + + * loader/i386/multiboot_elfxx.c (grub_multiboot_load_elf): Corrected + limit detection. + Use vaddr of correct segment for entry_point. + 2009-03-21 Bean * commands/blocklist.c: Add include file , remove diff --git a/loader/i386/multiboot_elfxx.c b/loader/i386/multiboot_elfxx.c index 801800c55..ce9e4fe11 100644 --- a/loader/i386/multiboot_elfxx.c +++ b/loader/i386/multiboot_elfxx.c @@ -49,7 +49,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) { Elf_Ehdr *ehdr = (Elf_Ehdr *) buffer; char *phdr_base; - int lowest_segment = 0, highest_segment = 0; + int lowest_segment = -1, highest_segment = -1; int i; if (ehdr->e_ident[EI_CLASS] != ELFCLASSXX) @@ -83,11 +83,18 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) for (i = 0; i < ehdr->e_phnum; i++) if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) { - if (phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr) + /* Beware that segment 0 isn't necessarily loadable */ + if (lowest_segment == -1 + || phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr) lowest_segment = i; - if (phdr(i)->p_paddr > phdr(highest_segment)->p_paddr) + if (highest_segment == -1 + || phdr(i)->p_paddr > phdr(highest_segment)->p_paddr) highest_segment = i; } + + if (lowest_segment == -1) + return grub_error (GRUB_ERR_BAD_OS, "ELF contains no loadable segments"); + code_size = (phdr(highest_segment)->p_paddr + phdr(highest_segment)->p_memsz) - phdr(lowest_segment)->p_paddr; grub_multiboot_payload_dest = phdr(lowest_segment)->p_paddr; @@ -105,8 +112,8 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) { char *load_this_module_at = (char *) (grub_multiboot_payload_orig + (long) (phdr(i)->p_paddr - phdr(lowest_segment)->p_paddr)); - grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx\n", - i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz); + grub_dprintf ("multiboot_loader", "segment %d: paddr=0x%lx, memsz=0x%lx, vaddr=0x%lx\n", + i, (long) phdr(i)->p_paddr, (long) phdr(i)->p_memsz, (long) phdr(i)->p_vaddr); if (grub_file_seek (file, (grub_off_t) phdr(i)->p_offset) == (grub_off_t) -1) @@ -124,7 +131,17 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) } } - grub_multiboot_payload_entry_offset = ehdr->e_entry - phdr(lowest_segment)->p_vaddr; + for (i = 0; i < ehdr->e_phnum; i++) + if (phdr(i)->p_vaddr <= ehdr->e_entry + && phdr(i)->p_vaddr + phdr(i)->p_memsz > ehdr->e_entry) + { + grub_multiboot_payload_entry_offset = (ehdr->e_entry - phdr(i)->p_vaddr) + + (phdr(i)->p_paddr - phdr(lowest_segment)->p_paddr); + break; + } + + if (i == ehdr->e_phnum) + return grub_error (GRUB_ERR_BAD_OS, "entry point isn't in a segment"); #undef phdr From 41473ac27fbf2f650be516d83b98ec962a6ce377 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 22 Mar 2009 00:31:30 +0000 Subject: [PATCH 0577/1707] 2009-03-22 Pavel Roskin * aclocal.m4 (grub_CHECK_START_SYMBOL): Remove. * configure.ac: Don't call grub_CHECK_START_SYMBOL. * kern/i386/pc/startup.S: Use _start instead of START_SYMBOL. --- ChangeLog | 6 ++ aclocal.m4 | 33 ----------- config.h.in | 3 - configure | 128 ----------------------------------------- configure.ac | 1 - kern/i386/pc/startup.S | 8 +-- 6 files changed, 10 insertions(+), 169 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2d317818a..3edfedc03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-22 Pavel Roskin + + * aclocal.m4 (grub_CHECK_START_SYMBOL): Remove. + * configure.ac: Don't call grub_CHECK_START_SYMBOL. + * kern/i386/pc/startup.S: Use _start instead of START_SYMBOL. + 2009-03-21 Vladimir Serbinenko Bugfixes in multiboot for bugs uncovered by solaris kernel. diff --git a/aclocal.m4 b/aclocal.m4 index 3c72ca9ec..b54ef15db 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -224,39 +224,6 @@ fi AC_MSG_RESULT([$grub_cv_i386_asm_absolute_without_asterisk])]) -dnl Check what symbol is defined as a start symbol. -dnl Written by Yoshinori K. Okuji. -AC_DEFUN(grub_CHECK_START_SYMBOL, -[AC_REQUIRE([AC_PROG_CC]) -AC_MSG_CHECKING([if start is defined by the compiler]) -AC_CACHE_VAL(grub_cv_check_start_symbol, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], - [[asm ("incl start")]])], - [grub_cv_check_start_symbol=yes], - [grub_cv_check_start_symbol=no])]) - -AC_MSG_RESULT([$grub_cv_check_start_symbol]) - -AC_MSG_CHECKING([if _start is defined by the compiler]) -AC_CACHE_VAL(grub_cv_check_uscore_start_symbol, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], - [[asm ("incl _start")]])], - [grub_cv_check_uscore_start_symbol=yes], - [grub_cv_check_uscore_start_symbol=no])]) - -AC_MSG_RESULT([$grub_cv_check_uscore_start_symbol]) - -AH_TEMPLATE([START_SYMBOL], [Define it to either start or _start]) - -if test "x$grub_cv_check_start_symbol" = xyes; then - AC_DEFINE([START_SYMBOL], [start]) -elif test "x$grub_cv_check_uscore_start_symbol" = xyes; then - AC_DEFINE([START_SYMBOL], [_start]) -else - AC_MSG_ERROR([neither start nor _start is defined]) -fi -]) - dnl Check what symbol is defined as a bss start symbol. dnl Written by Michael Hohmoth and Yoshinori K. Okuji. AC_DEFUN(grub_CHECK_BSS_START_SYMBOL, diff --git a/config.h.in b/config.h.in index 91e9615f8..c110d6307 100644 --- a/config.h.in +++ b/config.h.in @@ -109,9 +109,6 @@ /* The size of `void *', as computed by sizeof. */ #undef SIZEOF_VOID_P -/* Define it to either start or _start */ -#undef START_SYMBOL - /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS diff --git a/configure b/configure index f77ebf839..128317982 100644 --- a/configure +++ b/configure @@ -7270,134 +7270,6 @@ if test "x$target_cpu" = xi386; then fi if test "x$platform" = xpc; then -{ echo "$as_me:$LINENO: checking if start is defined by the compiler" >&5 -echo $ECHO_N "checking if start is defined by the compiler... $ECHO_C" >&6; } -if test "${grub_cv_check_start_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -asm ("incl start") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_check_start_symbol=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_check_start_symbol=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_check_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_start_symbol" >&6; } - -{ echo "$as_me:$LINENO: checking if _start is defined by the compiler" >&5 -echo $ECHO_N "checking if _start is defined by the compiler... $ECHO_C" >&6; } -if test "${grub_cv_check_uscore_start_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -asm ("incl _start") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_check_uscore_start_symbol=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_check_uscore_start_symbol=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_start_symbol" >&6; } - - - - -if test "x$grub_cv_check_start_symbol" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define START_SYMBOL start -_ACEOF - -elif test "x$grub_cv_check_uscore_start_symbol" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define START_SYMBOL _start -_ACEOF - -else - { { echo "$as_me:$LINENO: error: neither start nor _start is defined" >&5 -echo "$as_me: error: neither start nor _start is defined" >&2;} - { (exit 1); exit 1; }; } -fi - - { echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then diff --git a/configure.ac b/configure.ac index d9f182d4a..80b499cec 100644 --- a/configure.ac +++ b/configure.ac @@ -383,7 +383,6 @@ if test "x$target_cpu" = xi386; then CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" fi if test "x$platform" = xpc; then - grub_CHECK_START_SYMBOL grub_CHECK_BSS_START_SYMBOL grub_CHECK_END_SYMBOL fi diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 18f61d801..7ebe592e4 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -202,7 +202,7 @@ codestart: #if defined(ENABLE_LZO) /* decompress the compressed part and put the result at 1MB */ movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %esi - movl $(START_SYMBOL + GRUB_KERNEL_MACHINE_RAW_SIZE), %edi + movl $(_start + GRUB_KERNEL_MACHINE_RAW_SIZE), %edi pushl %esi pushl EXT_C(grub_compressed_size) @@ -214,7 +214,7 @@ codestart: cld #elif defined(ENABLE_LZMA) movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %edi - movl $(START_SYMBOL + GRUB_KERNEL_MACHINE_RAW_SIZE), %esi + movl $(_start + GRUB_KERNEL_MACHINE_RAW_SIZE), %esi pushl %edi pushl %esi movl EXT_C(grub_kernel_image_size), %ecx @@ -239,7 +239,7 @@ codestart: movl EXT_C(grub_total_module_size), %ecx movl EXT_C(grub_kernel_image_size), %esi addl %ecx, %esi - addl $START_SYMBOL, %esi + addl $_start, %esi decl %esi movl $END_SYMBOL, %edi addl %ecx, %edi @@ -282,7 +282,7 @@ VARIABLE(grub_root_drive) .long 0 VARIABLE(grub_start_addr) - .long START_SYMBOL + .long _start VARIABLE(grub_end_addr) .long END_SYMBOL From fbc00b0ca1a728dfe79fa86a2332497705d3dcbc Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 22 Mar 2009 00:37:49 +0000 Subject: [PATCH 0578/1707] 2009-03-22 Pavel Roskin * kern/powerpc/ieee1275/startup.S: Replace EXT_C(start) with _start. * kern/i386/pc/startup.S: Likewise. * kern/i386/efi/startup.S: Likewise. * kern/i386/ieee1275/startup.S: Likewise. * kern/i386/coreboot/startup.S: Likewise. * kern/x86_64/efi/startup.S: Likewise. --- ChangeLog | 8 ++++++++ kern/i386/coreboot/startup.S | 4 ++-- kern/i386/efi/startup.S | 6 +++--- kern/i386/ieee1275/startup.S | 4 ++-- kern/i386/pc/startup.S | 10 +++++----- kern/powerpc/ieee1275/startup.S | 4 ++-- kern/x86_64/efi/startup.S | 6 +++--- 7 files changed, 25 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3edfedc03..dba06c260 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,13 @@ 2009-03-22 Pavel Roskin + * kern/powerpc/ieee1275/startup.S: Replace EXT_C(start) with + _start. + * kern/i386/pc/startup.S: Likewise. + * kern/i386/efi/startup.S: Likewise. + * kern/i386/ieee1275/startup.S: Likewise. + * kern/i386/coreboot/startup.S: Likewise. + * kern/x86_64/efi/startup.S: Likewise. + * aclocal.m4 (grub_CHECK_START_SYMBOL): Remove. * configure.ac: Don't call grub_CHECK_START_SYMBOL. * kern/i386/pc/startup.S: Use _start instead of START_SYMBOL. diff --git a/kern/i386/coreboot/startup.S b/kern/i386/coreboot/startup.S index 835978bfe..b14171e6f 100644 --- a/kern/i386/coreboot/startup.S +++ b/kern/i386/coreboot/startup.S @@ -44,7 +44,7 @@ _start: * This is a special data area at a fixed offset from the beginning. */ - . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX + . = _start + GRUB_KERNEL_CPU_PREFIX VARIABLE(grub_prefix) /* to be filled by grub-mkimage */ @@ -53,7 +53,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END + . = _start + GRUB_KERNEL_CPU_DATA_END /* * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself). diff --git a/kern/i386/efi/startup.S b/kern/i386/efi/startup.S index 4709b3f29..b88628010 100644 --- a/kern/i386/efi/startup.S +++ b/kern/i386/efi/startup.S @@ -34,14 +34,14 @@ _start: * These MUST be at byte offset 6 and 7 of the executable * DO NOT MOVE !!! */ - . = EXT_C(start) + 0x6 + . = _start + 0x6 .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR /* * This is a special data area 8 bytes from the beginning. */ - . = EXT_C(start) + 0x8 + . = _start + 0x8 VARIABLE(grub_prefix) /* to be filled by grub-mkimage */ @@ -50,7 +50,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + 0x50 + . = _start + 0x50 codestart: /* diff --git a/kern/i386/ieee1275/startup.S b/kern/i386/ieee1275/startup.S index db6ce1e62..3b030b1b4 100644 --- a/kern/i386/ieee1275/startup.S +++ b/kern/i386/ieee1275/startup.S @@ -45,7 +45,7 @@ _start: * This is a special data area at a fixed offset from the beginning. */ - . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX + . = _start + GRUB_KERNEL_CPU_PREFIX VARIABLE(grub_prefix) /* to be filled by grub-mkimage */ @@ -54,7 +54,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END + . = _start + GRUB_KERNEL_CPU_DATA_END codestart: movl %eax, EXT_C(grub_ieee1275_entry_fn) diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 7ebe592e4..8e8b66135 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -53,7 +53,7 @@ #include #include -#define ABS(x) ((x) - EXT_C(start) + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200) +#define ABS(x) ((x) - _start + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200) .file "startup.S" @@ -77,14 +77,14 @@ _start: * These MUST be at byte offset 6 and 7 of the executable * DO NOT MOVE !!! */ - . = EXT_C(start) + 0x6 + . = _start + 0x6 .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR /* * This is a special data area 8 bytes from the beginning. */ - . = EXT_C(start) + 0x8 + . = _start + 0x8 VARIABLE(grub_total_module_size) .long 0 @@ -103,7 +103,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + GRUB_KERNEL_MACHINE_DATA_END + . = _start + GRUB_KERNEL_MACHINE_DATA_END /* * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself). @@ -510,7 +510,7 @@ gate_a20_check_state: * The code beyond this point is compressed. Assert that the uncompressed * code fits GRUB_KERNEL_MACHINE_RAW_SIZE. */ - . = EXT_C(start) + GRUB_KERNEL_MACHINE_RAW_SIZE + . = _start + GRUB_KERNEL_MACHINE_RAW_SIZE /* * This call is special... it never returns... in fact it should simply diff --git a/kern/powerpc/ieee1275/startup.S b/kern/powerpc/ieee1275/startup.S index 4b18fd745..75e1ed852 100644 --- a/kern/powerpc/ieee1275/startup.S +++ b/kern/powerpc/ieee1275/startup.S @@ -30,7 +30,7 @@ start: _start: b codestart - . = EXT_C(start) + GRUB_KERNEL_CPU_PREFIX + . = _start + GRUB_KERNEL_CPU_PREFIX VARIABLE(grub_prefix) /* to be filled by grub-mkelfimage */ @@ -39,7 +39,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + GRUB_KERNEL_CPU_DATA_END + . = _start + GRUB_KERNEL_CPU_DATA_END codestart: li 2, 0 diff --git a/kern/x86_64/efi/startup.S b/kern/x86_64/efi/startup.S index 835c4fb28..2cb1fd4a5 100644 --- a/kern/x86_64/efi/startup.S +++ b/kern/x86_64/efi/startup.S @@ -36,14 +36,14 @@ _start: * These MUST be at byte offset 6 and 7 of the executable * DO NOT MOVE !!! */ - . = EXT_C(start) + 0x6 + . = _start + 0x6 .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR /* * This is a special data area 8 bytes from the beginning. */ - . = EXT_C(start) + 0x8 + . = _start + 0x8 VARIABLE(grub_prefix) /* to be filled by grub-mkimage */ @@ -52,7 +52,7 @@ VARIABLE(grub_prefix) * Leave some breathing room for the prefix. */ - . = EXT_C(start) + 0x50 + . = _start + 0x50 codestart: movq %rcx, EXT_C(grub_efi_image_handle)(%rip) From f04f02e4968de8423681a2af6c34ce07aed1ac0c Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 22 Mar 2009 10:05:31 +0000 Subject: [PATCH 0579/1707] 2009-03-22 Yoshinori K. Okuji * normal/main.c (grub_normal_execute): Added an argument BATCH to specify if an interactive interface should be provided after reading a config file. All callers updated. (read_command_list): Prevent being executed twice. (read_fs_list): Likewise. * include/grub/normal.h (grub_normal_execute): --- ChangeLog | 11 ++++++++++ commands/configfile.c | 4 ++-- include/grub/normal.h | 2 +- normal/main.c | 49 +++++++++++++++++++++++++++++-------------- 4 files changed, 47 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index dba06c260..350d44ff6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-03-22 Yoshinori K. Okuji + + * normal/main.c (grub_normal_execute): Added an argument + BATCH to specify if an interactive interface should be provided + after reading a config file. + All callers updated. + (read_command_list): Prevent being executed twice. + (read_fs_list): Likewise. + + * include/grub/normal.h (grub_normal_execute): + 2009-03-22 Pavel Roskin * kern/powerpc/ieee1275/startup.S: Replace EXT_C(start) with diff --git a/commands/configfile.c b/commands/configfile.c index 77b9c37cb..4c85d3c3f 100644 --- a/commands/configfile.c +++ b/commands/configfile.c @@ -1,7 +1,7 @@ /* configfile.c - command to manually load config file */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -39,7 +39,7 @@ grub_cmd_source (grub_command_t cmd, int argc, char **args) grub_env_context_open (); } - grub_normal_execute (args[0], 1); + grub_normal_execute (args[0], 1, ! new_env); if (new_env) grub_env_context_close (); diff --git a/include/grub/normal.h b/include/grub/normal.h index 48cd91f08..27978dc09 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -75,7 +75,7 @@ typedef struct grub_menu_execute_callback *grub_menu_execute_callback_t; void grub_enter_normal_mode (const char *config); -void grub_normal_execute (const char *config, int nested); +void grub_normal_execute (const char *config, int nested, int batch); void grub_menu_execute_with_fallback (grub_menu_t menu, grub_menu_entry_t entry, grub_menu_execute_callback_t callback, diff --git a/normal/main.c b/normal/main.c index c6199ae67..9f906d860 100644 --- a/normal/main.c +++ b/normal/main.c @@ -164,8 +164,8 @@ free_menu_entry_classes (struct grub_menu_entry_class *head) } grub_err_t -grub_normal_menu_addentry (int argc, const char **args, struct grub_script *script, - const char *sourcecode) +grub_normal_menu_addentry (int argc, const char **args, + struct grub_script *script, const char *sourcecode) { const char *menutitle = 0; const char *menusourcecode; @@ -184,7 +184,7 @@ grub_normal_menu_addentry (int argc, const char **args, struct grub_script *scri classes_head->next = 0; classes_tail = classes_head; - menu = grub_env_get_data_slot("menu"); + menu = grub_env_get_data_slot ("menu"); if (! menu) return grub_error (GRUB_ERR_MENU, "no menu context"); @@ -236,7 +236,8 @@ grub_normal_menu_addentry (int argc, const char **args, struct grub_script *scri { /* Handle invalid argument. */ failed = 1; - grub_error (GRUB_ERR_MENU, "invalid argument for menuentry: %s", args[i]); + grub_error (GRUB_ERR_MENU, + "invalid argument for menuentry: %s", args[i]); break; } } @@ -249,7 +250,8 @@ grub_normal_menu_addentry (int argc, const char **args, struct grub_script *scri else { failed = 1; - grub_error (GRUB_ERR_MENU, "too many titles for menuentry: %s", args[i]); + grub_error (GRUB_ERR_MENU, + "too many titles for menuentry: %s", args[i]); break; } } @@ -382,7 +384,7 @@ void grub_enter_normal_mode (const char *config) { if (grub_setjmp (grub_exit_env) == 0) - grub_normal_execute (config, 0); + grub_normal_execute (config, 0, 0); } /* Initialize the screen. */ @@ -445,7 +447,13 @@ static void read_command_list (void) { const char *prefix; - + static int first_time = 1; + + /* Make sure that this function does not get executed twice. */ + if (! first_time) + return; + first_time = 0; + prefix = grub_env_get ("prefix"); if (prefix) { @@ -558,6 +566,12 @@ static void read_fs_list (void) { const char *prefix; + static int first_time = 1; + + /* Make sure that this function does not get executed twice. */ + if (! first_time) + return; + first_time = 0; prefix = grub_env_get ("prefix"); if (prefix) @@ -627,10 +641,10 @@ read_fs_list (void) grub_fs_autoload_hook = autoload_fs_module; } -/* Read the config file CONFIG and execute the menu interface or - the command-line interface. */ +/* Read the config file COFIG, and execute the menu interface or + the command-line interface if BATCH is false. */ void -grub_normal_execute (const char *config, int nested) +grub_normal_execute (const char *config, int nested, int batch) { grub_menu_t menu = 0; @@ -645,14 +659,17 @@ grub_normal_execute (const char *config, int nested) grub_errno = GRUB_ERR_NONE; } - if (menu && menu->size) + if (! batch) { - grub_menu_viewer_show_menu (menu, nested); - if (nested) - free_menu (menu); + if (menu && menu->size) + { + grub_menu_viewer_show_menu (menu, nested); + if (nested) + free_menu (menu); + } + else + grub_cmdline_run (nested); } - else - grub_cmdline_run (nested); } static grub_err_t From b28bbc4ef56a6ce70481b472a4d9278761ec2e5b Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 22 Mar 2009 10:38:19 +0000 Subject: [PATCH 0580/1707] 2009-03-22 Yoshinori K. Okuji * kern/env.c (grub_env_context_close): Fix memory leaks. --- ChangeLog | 4 ++++ kern/env.c | 5 ++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 350d44ff6..36d851db2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-03-22 Yoshinori K. Okuji + + * kern/env.c (grub_env_context_close): Fix memory leaks. + 2009-03-22 Yoshinori K. Okuji * normal/main.c (grub_normal_execute): Added an argument diff --git a/kern/env.c b/kern/env.c index 6a74c70a5..5c69e280b 100644 --- a/kern/env.c +++ b/kern/env.c @@ -1,7 +1,7 @@ /* env.c - Environment variables */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -127,6 +127,9 @@ grub_env_context_close (void) for (p = current_context->vars[i]; p; p = q) { q = p->next; + grub_free (p->name); + if (p->type != GRUB_ENV_VAR_DATA) + grub_free (p->value); grub_free (p); } } From 42a5b3fcc7fefe4a003f0ea786fee1aca635d8e9 Mon Sep 17 00:00:00 2001 From: okuji Date: Sun, 22 Mar 2009 10:45:06 +0000 Subject: [PATCH 0581/1707] 2009-03-22 Yoshinori K. Okuji * kern/env.c (grub_env_context_open): Added an argument to specify whether a new context inherits exported variables from current one. This is useful when making a sandbox to interpret a config file. All callers updated. * include/grub/env.h (grub_env_context_open): Updated the prototype. --- ChangeLog | 13 ++++++++++++- commands/configfile.c | 2 +- include/grub/env.h | 4 ++-- kern/env.c | 4 ++-- 4 files changed, 17 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 36d851db2..633001594 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-03-22 Yoshinori K. Okuji + + * kern/env.c (grub_env_context_open): Added an argument to specify + whether a new context inherits exported variables from current + one. This is useful when making a sandbox to interpret a config + file. + All callers updated. + + * include/grub/env.h (grub_env_context_open): Updated the prototype. + 2009-03-22 Yoshinori K. Okuji * kern/env.c (grub_env_context_close): Fix memory leaks. @@ -11,7 +21,8 @@ (read_command_list): Prevent being executed twice. (read_fs_list): Likewise. - * include/grub/normal.h (grub_normal_execute): + * include/grub/normal.h (grub_normal_execute): Updated the + prototype. 2009-03-22 Pavel Roskin diff --git a/commands/configfile.c b/commands/configfile.c index 4c85d3c3f..37d02b6b8 100644 --- a/commands/configfile.c +++ b/commands/configfile.c @@ -36,7 +36,7 @@ grub_cmd_source (grub_command_t cmd, int argc, char **args) if (new_env) { grub_cls (); - grub_env_context_open (); + grub_env_context_open (1); } grub_normal_execute (args[0], 1, ! new_env); diff --git a/include/grub/env.h b/include/grub/env.h index 36c1e8739..440185a59 100644 --- a/include/grub/env.h +++ b/include/grub/env.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -60,7 +60,7 @@ void EXPORT_FUNC(grub_env_iterate) (int (*func) (struct grub_env_var *var)); grub_err_t EXPORT_FUNC(grub_register_variable_hook) (const char *name, grub_env_read_hook_t read_hook, grub_env_write_hook_t write_hook); -grub_err_t EXPORT_FUNC(grub_env_context_open) (void); +grub_err_t EXPORT_FUNC(grub_env_context_open) (int export); grub_err_t EXPORT_FUNC(grub_env_context_close) (void); grub_err_t EXPORT_FUNC(grub_env_export) (const char *name); diff --git a/kern/env.c b/kern/env.c index 5c69e280b..d8447b995 100644 --- a/kern/env.c +++ b/kern/env.c @@ -75,7 +75,7 @@ grub_env_find (const char *name) } grub_err_t -grub_env_context_open (void) +grub_env_context_open (int export) { struct grub_env_context *context; int i; @@ -95,7 +95,7 @@ grub_env_context_open (void) for (var = context->prev->vars[i]; var; var = var->next) { - if (var->type == GRUB_ENV_VAR_GLOBAL) + if (export && var->type == GRUB_ENV_VAR_GLOBAL) { if (grub_env_set (var->name, var->value) != GRUB_ERR_NONE) { From c04d6e05480bb86cf21e195f6fa3b953c2cdc600 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 22 Mar 2009 12:28:00 +0000 Subject: [PATCH 0582/1707] 2009-03-22 Vladimir Serbinenko Move multiboot helper out of kernel * conf/i386-pc.rmk (multiboot_mod_SOURCES): Add `loader/i386/multiboot_helper.S'. * conf/i386-coreboot.rmk: Likewise * conf/i386-ieee1275.rmk: Likewise * kern/i386/loader.S: Move multiboot helpers from here... * loader/i386/multiboot_helper.S: ...moved here * include/grub/i386/loader.h: Move declarations of multiboot helpers from here... * include/grub/i386/multiboot.h: ...moved here * loader/i386/multiboot.c: Added include of grub/cpu/multiboot.h --- ChangeLog | 16 +++++ DISTLIST | 2 + conf/i386-coreboot.mk | 29 +++++++-- conf/i386-coreboot.rmk | 2 + conf/i386-ieee1275.mk | 29 +++++++-- conf/i386-ieee1275.rmk | 2 + conf/i386-pc.mk | 29 +++++++-- conf/i386-pc.rmk | 2 + include/grub/i386/loader.h | 22 +------ include/grub/i386/multiboot.h | 42 ++++++++++++ kern/i386/coreboot/init.c | 1 + kern/i386/loader.S | 101 ----------------------------- kern/i386/pc/init.c | 1 + loader/i386/multiboot.c | 1 + loader/i386/multiboot_helper.S | 115 +++++++++++++++++++++++++++++++++ 15 files changed, 260 insertions(+), 134 deletions(-) create mode 100644 include/grub/i386/multiboot.h create mode 100644 loader/i386/multiboot_helper.S diff --git a/ChangeLog b/ChangeLog index 633001594..d06081de4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-03-22 Vladimir Serbinenko + + Move multiboot helper out of kernel + + * conf/i386-pc.rmk (multiboot_mod_SOURCES): Add + `loader/i386/multiboot_helper.S'. + * conf/i386-coreboot.rmk: Likewise + * conf/i386-ieee1275.rmk: Likewise + + * kern/i386/loader.S: Move multiboot helpers from here... + * loader/i386/multiboot_helper.S: ...moved here + * include/grub/i386/loader.h: Move declarations of multiboot + helpers from here... + * include/grub/i386/multiboot.h: ...moved here + * loader/i386/multiboot.c: Added include of grub/cpu/multiboot.h + 2009-03-22 Yoshinori K. Okuji * kern/env.c (grub_env_context_open): Added an argument to specify diff --git a/DISTLIST b/DISTLIST index 945eb17bd..6b1f798d7 100644 --- a/DISTLIST +++ b/DISTLIST @@ -214,6 +214,7 @@ include/grub/i386/io.h include/grub/i386/kernel.h include/grub/i386/linux.h include/grub/i386/loader.h +include/grub/i386/multiboot.h include/grub/i386/pci.h include/grub/i386/pit.h include/grub/i386/reboot.h @@ -393,6 +394,7 @@ loader/i386/bsd.c loader/i386/linux.c loader/i386/multiboot.c loader/i386/multiboot_elfxx.c +loader/i386/multiboot_helper.S loader/i386/efi/linux.c loader/i386/ieee1275/linux.c loader/i386/pc/chainloader.c diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 36f797f89..310f9bf05 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -1257,15 +1257,16 @@ serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For multiboot.mod. multiboot_mod_SOURCES = loader/i386/multiboot.c \ + loader/i386/multiboot_helper.S \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst +CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst ifneq ($(multiboot_mod_EXPORTS),no) CLEANFILES += def-multiboot.lst DEFSYMFILES += def-multiboot.lst endif -MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d +MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_multiboot_helper.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) @@ -1274,9 +1275,9 @@ multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o +pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< @@ -1312,6 +1313,25 @@ partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loade set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) +multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_i386_multiboot_helper.d + +CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst fs-multiboot_mod-loader_i386_multiboot_helper.lst partmap-multiboot_mod-loader_i386_multiboot_helper.lst +COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst +FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst +PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst + +cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_i386_pc_multiboot2.d @@ -1371,6 +1391,7 @@ partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(l multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For aout.mod. aout_mod_SOURCES = loader/aout.c diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 0b4f216cf..53595de8a 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -145,11 +145,13 @@ serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For multiboot.mod. multiboot_mod_SOURCES = loader/i386/multiboot.c \ + loader/i386/multiboot_helper.S \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For aout.mod. aout_mod_SOURCES = loader/aout.c diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 5c140e8b8..4f43794c2 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -1001,14 +1001,15 @@ normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For multiboot.mod. multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ + loader/i386/multiboot_helper.S \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst +CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst ifneq ($(multiboot_mod_EXPORTS),no) CLEANFILES += def-multiboot.lst DEFSYMFILES += def-multiboot.lst endif -MOSTLYCLEANFILES += multiboot_mod-loader_ieee1275_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d +MOSTLYCLEANFILES += multiboot_mod-loader_ieee1275_multiboot2.d multiboot_mod-loader_i386_multiboot_helper.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) @@ -1017,9 +1018,9 @@ multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o +pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< @@ -1055,6 +1056,25 @@ partmap-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2 set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) +multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_i386_multiboot_helper.d + +CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst fs-multiboot_mod-loader_i386_multiboot_helper.lst partmap-multiboot_mod-loader_i386_multiboot_helper.lst +COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst +FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst +PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst + +cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_multiboot2.d @@ -1095,6 +1115,7 @@ partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(l multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For aout.mod. aout_mod_SOURCES = loader/aout.c diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index dbcbb4a8e..a84b5aa97 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -127,10 +127,12 @@ normal_mod_LDFLAGS = $(COMMON_LDFLAGS) # For multiboot.mod. multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ + loader/i386/multiboot_helper.S \ loader/multiboot2.c \ loader/multiboot_loader.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For aout.mod. aout_mod_SOURCES = loader/aout.c diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index b728dacc7..652f669b2 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1720,15 +1720,16 @@ serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For multiboot.mod. multiboot_mod_SOURCES = loader/i386/multiboot.c \ + loader/i386/multiboot_helper.S \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst +CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst ifneq ($(multiboot_mod_EXPORTS),no) CLEANFILES += def-multiboot.lst DEFSYMFILES += def-multiboot.lst endif -MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d +MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_multiboot_helper.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) @@ -1737,9 +1738,9 @@ multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o +pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o mod-multiboot.o: mod-multiboot.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< @@ -1775,6 +1776,25 @@ partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loade set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) +multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -MD -c -o $@ $< +-include multiboot_mod-loader_i386_multiboot_helper.d + +CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst fs-multiboot_mod-loader_i386_multiboot_helper.lst partmap-multiboot_mod-loader_i386_multiboot_helper.lst +COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst +FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst +PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst + +cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + +fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + +partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + + multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< -include multiboot_mod-loader_i386_pc_multiboot2.d @@ -1834,6 +1854,7 @@ partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(l multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For vbe.mod. vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index cc845ed68..60d518235 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -228,11 +228,13 @@ serial_mod_LDFLAGS = $(COMMON_LDFLAGS) # For multiboot.mod. multiboot_mod_SOURCES = loader/i386/multiboot.c \ + loader/i386/multiboot_helper.S \ loader/i386/pc/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For vbe.mod. vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \ diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index df8b4e3b8..305203054 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,7 +22,6 @@ #include #include #include -#include extern grub_uint32_t EXPORT_VAR(grub_linux_prot_size); extern char *EXPORT_VAR(grub_linux_tmp_addr); @@ -33,26 +32,7 @@ extern grub_size_t EXPORT_VAR(grub_os_area_size); grub_err_t EXPORT_FUNC(grub_linux_boot) (void); -/* The asm part of the multiboot loader. */ -void EXPORT_FUNC(grub_multiboot_real_boot) (grub_addr_t entry, - struct grub_multiboot_info *mbi) - __attribute__ ((noreturn)); -void EXPORT_FUNC(grub_multiboot2_real_boot) (grub_addr_t entry, - struct grub_multiboot_info *mbi) - __attribute__ ((noreturn)); void EXPORT_FUNC(grub_unix_real_boot) (grub_addr_t entry, ...) __attribute__ ((cdecl,noreturn)); -extern grub_addr_t EXPORT_VAR(grub_multiboot_payload_orig); -extern grub_addr_t EXPORT_VAR(grub_multiboot_payload_dest); -extern grub_size_t EXPORT_VAR(grub_multiboot_payload_size); -extern grub_uint32_t EXPORT_VAR(grub_multiboot_payload_entry_offset); - -extern grub_uint8_t EXPORT_VAR(grub_multiboot_forward_relocator); -extern grub_uint8_t EXPORT_VAR(grub_multiboot_forward_relocator_end); -extern grub_uint8_t EXPORT_VAR(grub_multiboot_backward_relocator); -extern grub_uint8_t EXPORT_VAR(grub_multiboot_backward_relocator_end); - -#define RELOCATOR_SIZEOF(x) (&grub_multiboot_##x##_relocator_end - &grub_multiboot_##x##_relocator) - #endif /* ! GRUB_LOADER_CPU_HEADER */ diff --git a/include/grub/i386/multiboot.h b/include/grub/i386/multiboot.h new file mode 100644 index 000000000..2dd7ec008 --- /dev/null +++ b/include/grub/i386/multiboot.h @@ -0,0 +1,42 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MULTIBOOT_CPU_HEADER +#define GRUB_MULTIBOOT_CPU_HEADER 1 + +/* The asm part of the multiboot loader. */ +void grub_multiboot_real_boot (grub_addr_t entry, + struct grub_multiboot_info *mbi) + __attribute__ ((noreturn)); +void grub_multiboot2_real_boot (grub_addr_t entry, + struct grub_multiboot_info *mbi) + __attribute__ ((noreturn)); + +extern grub_addr_t grub_multiboot_payload_orig; +extern grub_addr_t grub_multiboot_payload_dest; +extern grub_size_t grub_multiboot_payload_size; +extern grub_uint32_t grub_multiboot_payload_entry_offset; + +extern grub_uint8_t grub_multiboot_forward_relocator; +extern grub_uint8_t grub_multiboot_forward_relocator_end; +extern grub_uint8_t grub_multiboot_backward_relocator; +extern grub_uint8_t grub_multiboot_backward_relocator_end; + +#define RELOCATOR_SIZEOF(x) (&grub_multiboot_##x##_relocator_end - &grub_multiboot_##x##_relocator) + +#endif /* ! GRUB_MULTIBOOT_CPU_HEADER */ diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 9978d4a17..13484886d 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -146,6 +146,7 @@ grub_machine_fini (void) { grub_at_keyboard_fini (); grub_vga_text_fini (); + grub_stop_floppy (); } /* Return the end of the core image. */ diff --git a/kern/i386/loader.S b/kern/i386/loader.S index cacbbea73..0e8ded68e 100644 --- a/kern/i386/loader.S +++ b/kern/i386/loader.S @@ -118,106 +118,6 @@ linux_setup_seg: .word 0 .code32 - -/* - * This starts the multiboot kernel. - */ - -VARIABLE(grub_multiboot_payload_size) - .long 0 -VARIABLE(grub_multiboot_payload_orig) - .long 0 -VARIABLE(grub_multiboot_payload_dest) - .long 0 -VARIABLE(grub_multiboot_payload_entry_offset) - .long 0 - -/* - * The relocators below understand the following parameters: - * ecx: Size of the block to be copied. - * esi: Where to copy from (always lowest address, even if we're relocating - * backwards). - * edi: Where to copy to (likewise). - * edx: Offset of the entry point (relative to the beginning of the block). - */ -VARIABLE(grub_multiboot_forward_relocator) - /* Add entry offset. */ - addl %edi, %edx - - /* Forward copy. */ - cld - rep - movsb - - jmp *%edx -VARIABLE(grub_multiboot_forward_relocator_end) - -VARIABLE(grub_multiboot_backward_relocator) - /* Add entry offset (before %edi is mangled). */ - addl %edi, %edx - - /* Backward movsb is implicitly off-by-one. compensate that. */ - decl %esi - decl %edi - - /* Backward copy. */ - std - addl %ecx, %esi - addl %ecx, %edi - rep - movsb - - jmp *%edx -VARIABLE(grub_multiboot_backward_relocator_end) - -FUNCTION(grub_multiboot_real_boot) - /* Push the entry address on the stack. */ - pushl %eax - /* Move the address of the multiboot information structure to ebx. */ - movl %edx,%ebx - - /* Unload all modules and stop the floppy driver. */ - call EXT_C(grub_dl_unload_all) - call EXT_C(grub_stop_floppy) - - /* Interrupts should be disabled. */ - cli - - /* Where do we copy what from. */ - movl EXT_C(grub_multiboot_payload_size), %ecx - movl EXT_C(grub_multiboot_payload_orig), %esi - movl EXT_C(grub_multiboot_payload_dest), %edi - movl EXT_C(grub_multiboot_payload_entry_offset), %edx - - /* Move the magic value into eax. */ - movl $MULTIBOOT_MAGIC2, %eax - - /* Jump to the relocator. */ - popl %ebp - jmp *%ebp - -/* - * This starts the multiboot 2 kernel. - */ - -FUNCTION(grub_multiboot2_real_boot) - /* Push the entry address on the stack. */ - pushl %eax - /* Move the address of the multiboot information structure to ebx. */ - movl %edx,%ebx - - /* Unload all modules and stop the floppy driver. */ - call EXT_C(grub_dl_unload_all) - call EXT_C(grub_stop_floppy) - - /* Interrupts should be disabled. */ - cli - - /* Move the magic value into eax and jump to the kernel. */ - movl $MULTIBOOT2_BOOTLOADER_MAGIC,%eax - popl %ecx - jmp *%ecx - /* * Use cdecl calling convention for *BSD kernels. */ @@ -225,7 +125,6 @@ FUNCTION(grub_multiboot2_real_boot) FUNCTION(grub_unix_real_boot) call EXT_C(grub_dl_unload_all) - call EXT_C(grub_stop_floppy) /* Interrupts should be disabled. */ cli diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 1d6d22f96..61914123f 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -223,6 +223,7 @@ void grub_machine_fini (void) { grub_console_fini (); + grub_stop_floppy (); } /* Return the end of the core image. */ diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 4c01d8714..27042a50d 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include diff --git a/loader/i386/multiboot_helper.S b/loader/i386/multiboot_helper.S new file mode 100644 index 000000000..c496ba054 --- /dev/null +++ b/loader/i386/multiboot_helper.S @@ -0,0 +1,115 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + + .p2align 2 /* force 4-byte alignment */ + +/* + * This starts the multiboot kernel. + */ + +VARIABLE(grub_multiboot_payload_size) + .long 0 +VARIABLE(grub_multiboot_payload_orig) + .long 0 +VARIABLE(grub_multiboot_payload_dest) + .long 0 +VARIABLE(grub_multiboot_payload_entry_offset) + .long 0 + +/* + * The relocators below understand the following parameters: + * ecx: Size of the block to be copied. + * esi: Where to copy from (always lowest address, even if we're relocating + * backwards). + * edi: Where to copy to (likewise). + * edx: Offset of the entry point (relative to the beginning of the block). + */ + +VARIABLE(grub_multiboot_forward_relocator) + /* Add entry offset. */ + addl %edi, %edx + + /* Forward copy. */ + cld + rep + movsb + + jmp *%edx +VARIABLE(grub_multiboot_forward_relocator_end) + +VARIABLE(grub_multiboot_backward_relocator) + /* Add entry offset (before %edi is mangled). */ + addl %edi, %edx + + /* Backward movsb is implicitly off-by-one. compensate that. */ + decl %esi + decl %edi + + /* Backward copy. */ + std + addl %ecx, %esi + addl %ecx, %edi + rep + movsb + + jmp *%edx +VARIABLE(grub_multiboot_backward_relocator_end) + +FUNCTION(grub_multiboot_real_boot) + /* Push the entry address on the stack. */ + pushl %eax + /* Move the address of the multiboot information structure to ebx. */ + movl %edx,%ebx + + /* Interrupts should be disabled. */ + cli + + /* Where do we copy what from. */ + movl EXT_C(grub_multiboot_payload_size), %ecx + movl EXT_C(grub_multiboot_payload_orig), %esi + movl EXT_C(grub_multiboot_payload_dest), %edi + movl EXT_C(grub_multiboot_payload_entry_offset), %edx + + /* Move the magic value into eax. */ + movl $MULTIBOOT_MAGIC2, %eax + + /* Jump to the relocator. */ + popl %ebp + jmp *%ebp + +/* + * This starts the multiboot 2 kernel. + */ + +FUNCTION(grub_multiboot2_real_boot) + /* Push the entry address on the stack. */ + pushl %eax + /* Move the address of the multiboot information structure to ebx. */ + movl %edx,%ebx + + /* Interrupts should be disabled. */ + cli + + /* Move the magic value into eax and jump to the kernel. */ + movl $MULTIBOOT2_BOOTLOADER_MAGIC,%eax + popl %ecx + jmp *%ecx From e4dd5a7ea95a5fe281fd0b24d4aaed240ad4bb62 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 24 Mar 2009 14:01:23 +0000 Subject: [PATCH 0583/1707] 2009-03-24 Pavel Roskin * genmk.rb: Define ASM_FILE for *.S files for *.lst generation, not just for compilation. --- ChangeLog | 5 + conf/common.mk | 420 +++++++++++++++++++-------------------- conf/i386-coreboot.mk | 228 ++++++++++----------- conf/i386-efi.mk | 360 ++++++++++++++++----------------- conf/i386-ieee1275.mk | 210 ++++++++++---------- conf/i386-pc.mk | 354 ++++++++++++++++----------------- conf/i386.mk | 24 +-- conf/powerpc-ieee1275.mk | 150 +++++++------- conf/sparc64-ieee1275.mk | 282 +++++++++++++------------- conf/x86_64-efi.mk | 366 +++++++++++++++++----------------- genmk.rb | 6 +- 11 files changed, 1205 insertions(+), 1200 deletions(-) diff --git a/ChangeLog b/ChangeLog index d06081de4..eb3f939e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-24 Pavel Roskin + + * genmk.rb: Define ASM_FILE for *.S files for *.lst generation, + not just for compilation. + 2009-03-22 Vladimir Serbinenko Move multiboot helper out of kernel diff --git a/conf/common.mk b/conf/common.mk index bcf75a879..a23573e33 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -652,13 +652,13 @@ FSFILES += fs-fshelp_mod-fs_fshelp.lst PARTMAPFILES += partmap-fshelp_mod-fs_fshelp.lst cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) partmap-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) fshelp_mod_CFLAGS = $(COMMON_CFLAGS) @@ -709,13 +709,13 @@ FSFILES += fs-fat_mod-fs_fat.lst PARTMAPFILES += partmap-fat_mod-fs_fat.lst cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) partmap-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) fat_mod_CFLAGS = $(COMMON_CFLAGS) @@ -766,13 +766,13 @@ FSFILES += fs-ufs_mod-fs_ufs.lst PARTMAPFILES += partmap-ufs_mod-fs_ufs.lst cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) partmap-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) ufs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -823,13 +823,13 @@ FSFILES += fs-ext2_mod-fs_ext2.lst PARTMAPFILES += partmap-ext2_mod-fs_ext2.lst cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) partmap-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) ext2_mod_CFLAGS = $(COMMON_CFLAGS) @@ -880,13 +880,13 @@ FSFILES += fs-ntfs_mod-fs_ntfs.lst PARTMAPFILES += partmap-ntfs_mod-fs_ntfs.lst cmd-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfs > $@ || (rm -f $@; exit 1) fs-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfs > $@ || (rm -f $@; exit 1) partmap-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfs > $@ || (rm -f $@; exit 1) ntfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -937,13 +937,13 @@ FSFILES += fs-ntfscomp_mod-fs_ntfscomp.lst PARTMAPFILES += partmap-ntfscomp_mod-fs_ntfscomp.lst cmd-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfscomp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfscomp > $@ || (rm -f $@; exit 1) fs-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfscomp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfscomp > $@ || (rm -f $@; exit 1) partmap-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfscomp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfscomp > $@ || (rm -f $@; exit 1) ntfscomp_mod_CFLAGS = $(COMMON_CFLAGS) @@ -994,13 +994,13 @@ FSFILES += fs-minix_mod-fs_minix.lst PARTMAPFILES += partmap-minix_mod-fs_minix.lst cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) partmap-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) minix_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1051,13 +1051,13 @@ FSFILES += fs-hfs_mod-fs_hfs.lst PARTMAPFILES += partmap-hfs_mod-fs_hfs.lst cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) partmap-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) hfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1108,13 +1108,13 @@ FSFILES += fs-jfs_mod-fs_jfs.lst PARTMAPFILES += partmap-jfs_mod-fs_jfs.lst cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) partmap-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) jfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1165,13 +1165,13 @@ FSFILES += fs-iso9660_mod-fs_iso9660.lst PARTMAPFILES += partmap-iso9660_mod-fs_iso9660.lst cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1) fs-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1) partmap-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh iso9660 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh iso9660 > $@ || (rm -f $@; exit 1) iso9660_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1222,13 +1222,13 @@ FSFILES += fs-xfs_mod-fs_xfs.lst PARTMAPFILES += partmap-xfs_mod-fs_xfs.lst cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) partmap-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) xfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1279,13 +1279,13 @@ FSFILES += fs-affs_mod-fs_affs.lst PARTMAPFILES += partmap-affs_mod-fs_affs.lst cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) partmap-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) affs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1336,13 +1336,13 @@ FSFILES += fs-sfs_mod-fs_sfs.lst PARTMAPFILES += partmap-sfs_mod-fs_sfs.lst cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) partmap-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) sfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1393,13 +1393,13 @@ FSFILES += fs-hfsplus_mod-fs_hfsplus.lst PARTMAPFILES += partmap-hfsplus_mod-fs_hfsplus.lst cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1) fs-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1) partmap-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfsplus > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfsplus > $@ || (rm -f $@; exit 1) hfsplus_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1450,13 +1450,13 @@ FSFILES += fs-reiserfs_mod-fs_reiserfs.lst PARTMAPFILES += partmap-reiserfs_mod-fs_reiserfs.lst cmd-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reiserfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reiserfs > $@ || (rm -f $@; exit 1) fs-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reiserfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reiserfs > $@ || (rm -f $@; exit 1) partmap-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reiserfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reiserfs > $@ || (rm -f $@; exit 1) reiserfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1507,13 +1507,13 @@ FSFILES += fs-cpio_mod-fs_cpio.lst PARTMAPFILES += partmap-cpio_mod-fs_cpio.lst cmd-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpio > $@ || (rm -f $@; exit 1) fs-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpio > $@ || (rm -f $@; exit 1) partmap-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpio > $@ || (rm -f $@; exit 1) cpio_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1564,13 +1564,13 @@ FSFILES += fs-tar_mod-fs_cpio.lst PARTMAPFILES += partmap-tar_mod-fs_cpio.lst cmd-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tar > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tar > $@ || (rm -f $@; exit 1) fs-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tar > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tar > $@ || (rm -f $@; exit 1) partmap-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tar > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tar > $@ || (rm -f $@; exit 1) tar_mod_CFLAGS = $(COMMON_CFLAGS) -DMODE_USTAR @@ -1621,13 +1621,13 @@ FSFILES += fs-udf_mod-fs_udf.lst PARTMAPFILES += partmap-udf_mod-fs_udf.lst cmd-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh udf > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh udf > $@ || (rm -f $@; exit 1) fs-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh udf > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh udf > $@ || (rm -f $@; exit 1) partmap-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh udf > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh udf > $@ || (rm -f $@; exit 1) udf_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1678,13 +1678,13 @@ FSFILES += fs-afs_mod-fs_afs.lst PARTMAPFILES += partmap-afs_mod-fs_afs.lst cmd-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh afs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh afs > $@ || (rm -f $@; exit 1) fs-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh afs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh afs > $@ || (rm -f $@; exit 1) partmap-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh afs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh afs > $@ || (rm -f $@; exit 1) afs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1738,13 +1738,13 @@ FSFILES += fs-amiga_mod-partmap_amiga.lst PARTMAPFILES += partmap-amiga_mod-partmap_amiga.lst cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) partmap-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) amiga_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1795,13 +1795,13 @@ FSFILES += fs-apple_mod-partmap_apple.lst PARTMAPFILES += partmap-apple_mod-partmap_apple.lst cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) partmap-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) apple_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1852,13 +1852,13 @@ FSFILES += fs-pc_mod-partmap_pc.lst PARTMAPFILES += partmap-pc_mod-partmap_pc.lst cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) partmap-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) pc_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1909,13 +1909,13 @@ FSFILES += fs-sun_mod-partmap_sun.lst PARTMAPFILES += partmap-sun_mod-partmap_sun.lst cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) partmap-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) sun_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1966,13 +1966,13 @@ FSFILES += fs-acorn_mod-partmap_acorn.lst PARTMAPFILES += partmap-acorn_mod-partmap_acorn.lst cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) partmap-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) acorn_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2023,13 +2023,13 @@ FSFILES += fs-gpt_mod-partmap_gpt.lst PARTMAPFILES += partmap-gpt_mod-partmap_gpt.lst cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1) fs-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1) partmap-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gpt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gpt > $@ || (rm -f $@; exit 1) gpt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2085,13 +2085,13 @@ FSFILES += fs-raid_mod-disk_raid.lst PARTMAPFILES += partmap-raid_mod-disk_raid.lst cmd-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid > $@ || (rm -f $@; exit 1) fs-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid > $@ || (rm -f $@; exit 1) partmap-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid > $@ || (rm -f $@; exit 1) raid_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2142,13 +2142,13 @@ FSFILES += fs-raid5rec_mod-disk_raid5_recover.lst PARTMAPFILES += partmap-raid5rec_mod-disk_raid5_recover.lst cmd-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid5rec > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid5rec > $@ || (rm -f $@; exit 1) fs-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid5rec > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid5rec > $@ || (rm -f $@; exit 1) partmap-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid5rec > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid5rec > $@ || (rm -f $@; exit 1) raid5rec_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2199,13 +2199,13 @@ FSFILES += fs-raid6rec_mod-disk_raid6_recover.lst PARTMAPFILES += partmap-raid6rec_mod-disk_raid6_recover.lst cmd-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid6rec > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid6rec > $@ || (rm -f $@; exit 1) fs-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid6rec > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid6rec > $@ || (rm -f $@; exit 1) partmap-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid6rec > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid6rec > $@ || (rm -f $@; exit 1) raid6rec_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2256,13 +2256,13 @@ FSFILES += fs-mdraid_mod-disk_mdraid_linux.lst PARTMAPFILES += partmap-mdraid_mod-disk_mdraid_linux.lst cmd-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh mdraid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh mdraid > $@ || (rm -f $@; exit 1) fs-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh mdraid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh mdraid > $@ || (rm -f $@; exit 1) partmap-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh mdraid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh mdraid > $@ || (rm -f $@; exit 1) mdraid_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2313,13 +2313,13 @@ FSFILES += fs-dm_nv_mod-disk_dmraid_nvidia.lst PARTMAPFILES += partmap-dm_nv_mod-disk_dmraid_nvidia.lst cmd-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh dm_nv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh dm_nv > $@ || (rm -f $@; exit 1) fs-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh dm_nv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh dm_nv > $@ || (rm -f $@; exit 1) partmap-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh dm_nv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh dm_nv > $@ || (rm -f $@; exit 1) dm_nv_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2370,13 +2370,13 @@ FSFILES += fs-lvm_mod-disk_lvm.lst PARTMAPFILES += partmap-lvm_mod-disk_lvm.lst cmd-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lvm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lvm > $@ || (rm -f $@; exit 1) fs-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lvm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lvm > $@ || (rm -f $@; exit 1) partmap-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lvm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lvm > $@ || (rm -f $@; exit 1) lvm_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2427,13 +2427,13 @@ FSFILES += fs-scsi_mod-disk_scsi.lst PARTMAPFILES += partmap-scsi_mod-disk_scsi.lst cmd-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh scsi > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh scsi > $@ || (rm -f $@; exit 1) fs-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh scsi > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh scsi > $@ || (rm -f $@; exit 1) partmap-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh scsi > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh scsi > $@ || (rm -f $@; exit 1) scsi_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2491,13 +2491,13 @@ FSFILES += fs-minicmd_mod-commands_minicmd.lst PARTMAPFILES += partmap-minicmd_mod-commands_minicmd.lst cmd-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minicmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minicmd > $@ || (rm -f $@; exit 1) fs-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minicmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minicmd > $@ || (rm -f $@; exit 1) partmap-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minicmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minicmd > $@ || (rm -f $@; exit 1) minicmd_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2548,13 +2548,13 @@ FSFILES += fs-extcmd_mod-commands_extcmd.lst PARTMAPFILES += partmap-extcmd_mod-commands_extcmd.lst cmd-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) fs-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) partmap-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) extcmd_mod-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) @@ -2567,13 +2567,13 @@ FSFILES += fs-extcmd_mod-lib_arg.lst PARTMAPFILES += partmap-extcmd_mod-lib_arg.lst cmd-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) fs-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) partmap-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) extcmd_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2624,13 +2624,13 @@ FSFILES += fs-hello_mod-hello_hello.lst PARTMAPFILES += partmap-hello_mod-hello_hello.lst cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) hello_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2681,13 +2681,13 @@ FSFILES += fs-handler_mod-commands_handler.lst PARTMAPFILES += partmap-handler_mod-commands_handler.lst cmd-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh handler > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh handler > $@ || (rm -f $@; exit 1) fs-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh handler > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh handler > $@ || (rm -f $@; exit 1) partmap-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh handler > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh handler > $@ || (rm -f $@; exit 1) handler_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2738,13 +2738,13 @@ FSFILES += fs-ls_mod-commands_ls.lst PARTMAPFILES += partmap-ls_mod-commands_ls.lst cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) partmap-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) ls_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2795,13 +2795,13 @@ FSFILES += fs-cmp_mod-commands_cmp.lst PARTMAPFILES += partmap-cmp_mod-commands_cmp.lst cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) partmap-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) cmp_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2852,13 +2852,13 @@ FSFILES += fs-cat_mod-commands_cat.lst PARTMAPFILES += partmap-cat_mod-commands_cat.lst cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) partmap-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) cat_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2909,13 +2909,13 @@ FSFILES += fs-echo_mod-commands_echo.lst PARTMAPFILES += partmap-echo_mod-commands_echo.lst cmd-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh echo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh echo > $@ || (rm -f $@; exit 1) fs-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh echo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh echo > $@ || (rm -f $@; exit 1) partmap-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh echo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh echo > $@ || (rm -f $@; exit 1) echo_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2966,13 +2966,13 @@ FSFILES += fs-help_mod-commands_help.lst PARTMAPFILES += partmap-help_mod-commands_help.lst cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) help_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3023,13 +3023,13 @@ FSFILES += fs-search_mod-commands_search.lst PARTMAPFILES += partmap-search_mod-commands_search.lst cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) partmap-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) search_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3080,13 +3080,13 @@ FSFILES += fs-test_mod-commands_test.lst PARTMAPFILES += partmap-test_mod-commands_test.lst cmd-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1) fs-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1) partmap-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh test > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh test > $@ || (rm -f $@; exit 1) test_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3137,13 +3137,13 @@ FSFILES += fs-loopback_mod-disk_loopback.lst PARTMAPFILES += partmap-loopback_mod-disk_loopback.lst cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) partmap-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) loopback_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3194,13 +3194,13 @@ FSFILES += fs-fs_uuid_mod-disk_fs_uuid.lst PARTMAPFILES += partmap-fs_uuid_mod-disk_fs_uuid.lst cmd-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fs_uuid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fs_uuid > $@ || (rm -f $@; exit 1) fs-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fs_uuid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fs_uuid > $@ || (rm -f $@; exit 1) partmap-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fs_uuid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fs_uuid > $@ || (rm -f $@; exit 1) fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3251,13 +3251,13 @@ FSFILES += fs-configfile_mod-commands_configfile.lst PARTMAPFILES += partmap-configfile_mod-commands_configfile.lst cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) partmap-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) configfile_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3308,13 +3308,13 @@ FSFILES += fs-terminfo_mod-term_terminfo.lst PARTMAPFILES += partmap-terminfo_mod-term_terminfo.lst cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) fs-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) partmap-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) terminfo_mod-term_tparm.o: term/tparm.c $(term/tparm.c_DEPENDENCIES) @@ -3327,13 +3327,13 @@ FSFILES += fs-terminfo_mod-term_tparm.lst PARTMAPFILES += partmap-terminfo_mod-term_tparm.lst cmd-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) fs-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) partmap-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) terminfo_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3384,13 +3384,13 @@ FSFILES += fs-blocklist_mod-commands_blocklist.lst PARTMAPFILES += partmap-blocklist_mod-commands_blocklist.lst cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1) fs-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1) partmap-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh blocklist > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh blocklist > $@ || (rm -f $@; exit 1) blocklist_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3441,13 +3441,13 @@ FSFILES += fs-hexdump_mod-commands_hexdump.lst PARTMAPFILES += partmap-hexdump_mod-commands_hexdump.lst cmd-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) fs-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) partmap-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) hexdump_mod-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) @@ -3460,13 +3460,13 @@ FSFILES += fs-hexdump_mod-lib_hexdump.lst PARTMAPFILES += partmap-hexdump_mod-lib_hexdump.lst cmd-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) fs-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) partmap-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) hexdump_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3517,13 +3517,13 @@ FSFILES += fs-read_mod-commands_read.lst PARTMAPFILES += partmap-read_mod-commands_read.lst cmd-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh read > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh read > $@ || (rm -f $@; exit 1) fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh read > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh read > $@ || (rm -f $@; exit 1) partmap-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh read > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh read > $@ || (rm -f $@; exit 1) read_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3574,13 +3574,13 @@ FSFILES += fs-sleep_mod-commands_sleep.lst PARTMAPFILES += partmap-sleep_mod-commands_sleep.lst cmd-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sleep > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sleep > $@ || (rm -f $@; exit 1) fs-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sleep > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sleep > $@ || (rm -f $@; exit 1) partmap-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sleep > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sleep > $@ || (rm -f $@; exit 1) sleep_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3631,13 +3631,13 @@ FSFILES += fs-loadenv_mod-commands_loadenv.lst PARTMAPFILES += partmap-loadenv_mod-commands_loadenv.lst cmd-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) fs-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) partmap-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) loadenv_mod-lib_envblk.o: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) @@ -3650,13 +3650,13 @@ FSFILES += fs-loadenv_mod-lib_envblk.lst PARTMAPFILES += partmap-loadenv_mod-lib_envblk.lst cmd-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) fs-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) partmap-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) loadenv_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3707,13 +3707,13 @@ FSFILES += fs-crc_mod-commands_crc.lst PARTMAPFILES += partmap-crc_mod-commands_crc.lst cmd-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) fs-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) partmap-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) crc_mod-lib_crc.o: lib/crc.c $(lib/crc.c_DEPENDENCIES) @@ -3726,13 +3726,13 @@ FSFILES += fs-crc_mod-lib_crc.lst PARTMAPFILES += partmap-crc_mod-lib_crc.lst cmd-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) fs-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) crc_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3787,13 +3787,13 @@ FSFILES += fs-video_mod-video_video.lst PARTMAPFILES += partmap-video_mod-video_video.lst cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) partmap-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) video_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3844,13 +3844,13 @@ FSFILES += fs-videotest_mod-commands_videotest.lst PARTMAPFILES += partmap-videotest_mod-commands_videotest.lst cmd-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1) fs-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1) partmap-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh videotest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh videotest > $@ || (rm -f $@; exit 1) videotest_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3901,13 +3901,13 @@ FSFILES += fs-bitmap_mod-video_bitmap.lst PARTMAPFILES += partmap-bitmap_mod-video_bitmap.lst cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bitmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bitmap > $@ || (rm -f $@; exit 1) fs-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bitmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bitmap > $@ || (rm -f $@; exit 1) partmap-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bitmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bitmap > $@ || (rm -f $@; exit 1) bitmap_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3958,13 +3958,13 @@ FSFILES += fs-tga_mod-video_readers_tga.lst PARTMAPFILES += partmap-tga_mod-video_readers_tga.lst cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tga > $@ || (rm -f $@; exit 1) fs-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tga > $@ || (rm -f $@; exit 1) partmap-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tga > $@ || (rm -f $@; exit 1) tga_mod_CFLAGS = $(COMMON_CFLAGS) @@ -4015,13 +4015,13 @@ FSFILES += fs-jpeg_mod-video_readers_jpeg.lst PARTMAPFILES += partmap-jpeg_mod-video_readers_jpeg.lst cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jpeg > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jpeg > $@ || (rm -f $@; exit 1) fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jpeg > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jpeg > $@ || (rm -f $@; exit 1) partmap-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jpeg > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jpeg > $@ || (rm -f $@; exit 1) jpeg_mod_CFLAGS = $(COMMON_CFLAGS) @@ -4072,13 +4072,13 @@ FSFILES += fs-png_mod-video_readers_png.lst PARTMAPFILES += partmap-png_mod-video_readers_png.lst cmd-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) fs-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) partmap-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh png > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh png > $@ || (rm -f $@; exit 1) png_mod_CFLAGS = $(COMMON_CFLAGS) @@ -4129,13 +4129,13 @@ FSFILES += fs-font_mod-font_font_cmd.lst PARTMAPFILES += partmap-font_mod-font_font_cmd.lst cmd-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) fs-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) partmap-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) font_mod-font_font.o: font/font.c $(font/font.c_DEPENDENCIES) @@ -4148,13 +4148,13 @@ FSFILES += fs-font_mod-font_font.lst PARTMAPFILES += partmap-font_mod-font_font.lst cmd-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) fs-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) partmap-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) font_mod_CFLAGS = $(COMMON_CFLAGS) @@ -4205,13 +4205,13 @@ FSFILES += fs-gfxterm_mod-term_gfxterm.lst PARTMAPFILES += partmap-gfxterm_mod-term_gfxterm.lst cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) partmap-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) @@ -4265,13 +4265,13 @@ FSFILES += fs-elf_mod-kern_elf.lst PARTMAPFILES += partmap-elf_mod-kern_elf.lst cmd-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh elf > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh elf > $@ || (rm -f $@; exit 1) fs-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh elf > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh elf > $@ || (rm -f $@; exit 1) partmap-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh elf > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh elf > $@ || (rm -f $@; exit 1) elf_mod_CFLAGS = $(COMMON_CFLAGS) @@ -4322,13 +4322,13 @@ FSFILES += fs-gzio_mod-io_gzio.lst PARTMAPFILES += partmap-gzio_mod-io_gzio.lst cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) gzio_mod_CFLAGS = $(COMMON_CFLAGS) @@ -4379,13 +4379,13 @@ FSFILES += fs-bufio_mod-io_bufio.lst PARTMAPFILES += partmap-bufio_mod-io_bufio.lst cmd-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bufio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bufio > $@ || (rm -f $@; exit 1) fs-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bufio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bufio > $@ || (rm -f $@; exit 1) partmap-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bufio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bufio > $@ || (rm -f $@; exit 1) bufio_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 310f9bf05..14fe36975 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -676,13 +676,13 @@ FSFILES += fs-linux_mod-loader_i386_linux.lst PARTMAPFILES += partmap-linux_mod-loader_i386_linux.lst cmd-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) fs-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) partmap-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -748,13 +748,13 @@ FSFILES += fs-normal_mod-normal_cmdline.lst PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) @@ -767,13 +767,13 @@ FSFILES += fs-normal_mod-normal_command.lst PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) @@ -786,13 +786,13 @@ FSFILES += fs-normal_mod-normal_completion.lst PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) @@ -805,13 +805,13 @@ FSFILES += fs-normal_mod-normal_execute.lst PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) @@ -824,13 +824,13 @@ FSFILES += fs-normal_mod-normal_function.lst PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) @@ -843,13 +843,13 @@ FSFILES += fs-normal_mod-normal_lexer.lst PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) @@ -862,13 +862,13 @@ FSFILES += fs-normal_mod-normal_main.lst PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) @@ -881,13 +881,13 @@ FSFILES += fs-normal_mod-normal_menu.lst PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) @@ -900,13 +900,13 @@ FSFILES += fs-normal_mod-normal_menu_text.lst PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) @@ -919,13 +919,13 @@ FSFILES += fs-normal_mod-normal_color.lst PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) @@ -938,13 +938,13 @@ FSFILES += fs-normal_mod-normal_menu_viewer.lst PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) @@ -957,13 +957,13 @@ FSFILES += fs-normal_mod-normal_menu_entry.lst PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) @@ -976,13 +976,13 @@ FSFILES += fs-normal_mod-normal_misc.lst PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) @@ -995,13 +995,13 @@ FSFILES += fs-normal_mod-grub_script_tab.lst PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) @@ -1014,13 +1014,13 @@ FSFILES += fs-normal_mod-normal_script.lst PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) @@ -1033,13 +1033,13 @@ FSFILES += fs-normal_mod-normal_i386_setjmp.lst PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1091,13 +1091,13 @@ FSFILES += fs-reboot_mod-commands_reboot.lst PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod-kern_i386_reboot.o: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) @@ -1110,13 +1110,13 @@ FSFILES += fs-reboot_mod-kern_i386_reboot.lst PARTMAPFILES += partmap-reboot_mod-kern_i386_reboot.lst cmd-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1167,13 +1167,13 @@ FSFILES += fs-halt_mod-commands_halt.lst PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod-kern_i386_halt.o: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) @@ -1186,13 +1186,13 @@ FSFILES += fs-halt_mod-kern_i386_halt.lst PARTMAPFILES += partmap-halt_mod-kern_i386_halt.lst cmd-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1243,13 +1243,13 @@ FSFILES += fs-serial_mod-term_i386_pc_serial.lst PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) serial_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1304,13 +1304,13 @@ FSFILES += fs-multiboot_mod-loader_i386_multiboot.lst PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot.lst cmd-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) @@ -1323,13 +1323,13 @@ FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) @@ -1342,13 +1342,13 @@ FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_i386_pc_multiboot2.lst cmd-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) @@ -1361,13 +1361,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) @@ -1380,13 +1380,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1438,13 +1438,13 @@ FSFILES += fs-aout_mod-loader_aout.lst PARTMAPFILES += partmap-aout_mod-loader_aout.lst cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) aout_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1495,13 +1495,13 @@ FSFILES += fs-play_mod-commands_i386_pc_play.lst PARTMAPFILES += partmap-play_mod-commands_i386_pc_play.lst cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) play_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1552,13 +1552,13 @@ FSFILES += fs-ata_mod-disk_ata.lst PARTMAPFILES += partmap-ata_mod-disk_ata.lst cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) partmap-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) ata_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1609,13 +1609,13 @@ FSFILES += fs-memdisk_mod-disk_memdisk.lst PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) memdisk_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1666,13 +1666,13 @@ FSFILES += fs-pci_mod-bus_pci.lst PARTMAPFILES += partmap-pci_mod-bus_pci.lst cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) pci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1723,13 +1723,13 @@ FSFILES += fs-lspci_mod-commands_lspci.lst PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) lspci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1780,13 +1780,13 @@ FSFILES += fs-datetime_mod-lib_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) @@ -1799,13 +1799,13 @@ FSFILES += fs-datetime_mod-lib_i386_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1856,13 +1856,13 @@ FSFILES += fs-date_mod-commands_date.lst PARTMAPFILES += partmap-date_mod-commands_date.lst cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) date_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1913,13 +1913,13 @@ FSFILES += fs-datehook_mod-hook_datehook.lst PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) datehook_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1970,13 +1970,13 @@ FSFILES += fs-lsmmap_mod-commands_lsmmap.lst PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index f9205a4a5..d30ea9a75 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -175,13 +175,13 @@ FSFILES += fs-kernel_mod-kern_i386_efi_startup.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_startup.lst cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) @@ -194,13 +194,13 @@ FSFILES += fs-kernel_mod-kern_main.lst PARTMAPFILES += partmap-kernel_mod-kern_main.lst cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) @@ -213,13 +213,13 @@ FSFILES += fs-kernel_mod-kern_device.lst PARTMAPFILES += partmap-kernel_mod-kern_device.lst cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) @@ -232,13 +232,13 @@ FSFILES += fs-kernel_mod-kern_disk.lst PARTMAPFILES += partmap-kernel_mod-kern_disk.lst cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) @@ -251,13 +251,13 @@ FSFILES += fs-kernel_mod-kern_dl.lst PARTMAPFILES += partmap-kernel_mod-kern_dl.lst cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) @@ -270,13 +270,13 @@ FSFILES += fs-kernel_mod-kern_file.lst PARTMAPFILES += partmap-kernel_mod-kern_file.lst cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) @@ -289,13 +289,13 @@ FSFILES += fs-kernel_mod-kern_fs.lst PARTMAPFILES += partmap-kernel_mod-kern_fs.lst cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) @@ -308,13 +308,13 @@ FSFILES += fs-kernel_mod-kern_err.lst PARTMAPFILES += partmap-kernel_mod-kern_err.lst cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) @@ -327,13 +327,13 @@ FSFILES += fs-kernel_mod-kern_misc.lst PARTMAPFILES += partmap-kernel_mod-kern_misc.lst cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) @@ -346,13 +346,13 @@ FSFILES += fs-kernel_mod-kern_mm.lst PARTMAPFILES += partmap-kernel_mod-kern_mm.lst cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) @@ -365,13 +365,13 @@ FSFILES += fs-kernel_mod-kern_loader.lst PARTMAPFILES += partmap-kernel_mod-kern_loader.lst cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) @@ -384,13 +384,13 @@ FSFILES += fs-kernel_mod-kern_rescue.lst PARTMAPFILES += partmap-kernel_mod-kern_rescue.lst cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) @@ -403,13 +403,13 @@ FSFILES += fs-kernel_mod-kern_term.lst PARTMAPFILES += partmap-kernel_mod-kern_term.lst cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) @@ -422,13 +422,13 @@ FSFILES += fs-kernel_mod-kern_i386_dl.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_dl.lst cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) @@ -441,13 +441,13 @@ FSFILES += fs-kernel_mod-kern_i386_efi_init.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_init.lst cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) @@ -460,13 +460,13 @@ FSFILES += fs-kernel_mod-kern_parser.lst PARTMAPFILES += partmap-kernel_mod-kern_parser.lst cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) @@ -479,13 +479,13 @@ FSFILES += fs-kernel_mod-kern_partition.lst PARTMAPFILES += partmap-kernel_mod-kern_partition.lst cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) @@ -498,13 +498,13 @@ FSFILES += fs-kernel_mod-kern_env.lst PARTMAPFILES += partmap-kernel_mod-kern_env.lst cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) @@ -517,13 +517,13 @@ FSFILES += fs-kernel_mod-symlist.lst PARTMAPFILES += partmap-kernel_mod-symlist.lst cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_efi_efi.o: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) @@ -536,13 +536,13 @@ FSFILES += fs-kernel_mod-kern_efi_efi.lst PARTMAPFILES += partmap-kernel_mod-kern_efi_efi.lst cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_efi_init.o: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) @@ -555,13 +555,13 @@ FSFILES += fs-kernel_mod-kern_efi_init.lst PARTMAPFILES += partmap-kernel_mod-kern_efi_init.lst cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_efi_mm.o: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) @@ -574,13 +574,13 @@ FSFILES += fs-kernel_mod-kern_efi_mm.lst PARTMAPFILES += partmap-kernel_mod-kern_efi_mm.lst cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) @@ -593,13 +593,13 @@ FSFILES += fs-kernel_mod-term_efi_console.lst PARTMAPFILES += partmap-kernel_mod-term_efi_console.lst cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) @@ -612,13 +612,13 @@ FSFILES += fs-kernel_mod-disk_efi_efidisk.lst PARTMAPFILES += partmap-kernel_mod-disk_efi_efidisk.lst cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) @@ -631,13 +631,13 @@ FSFILES += fs-kernel_mod-kern_time.lst PARTMAPFILES += partmap-kernel_mod-kern_time.lst cmd-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) @@ -650,13 +650,13 @@ FSFILES += fs-kernel_mod-kern_list.lst PARTMAPFILES += partmap-kernel_mod-kern_list.lst cmd-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) @@ -669,13 +669,13 @@ FSFILES += fs-kernel_mod-kern_handler.lst PARTMAPFILES += partmap-kernel_mod-kern_handler.lst cmd-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) @@ -688,13 +688,13 @@ FSFILES += fs-kernel_mod-kern_command.lst PARTMAPFILES += partmap-kernel_mod-kern_command.lst cmd-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) @@ -707,13 +707,13 @@ FSFILES += fs-kernel_mod-kern_corecmd.lst PARTMAPFILES += partmap-kernel_mod-kern_corecmd.lst cmd-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) @@ -726,13 +726,13 @@ FSFILES += fs-kernel_mod-kern_i386_tsc.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_tsc.lst cmd-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) @@ -745,13 +745,13 @@ FSFILES += fs-kernel_mod-kern_i386_pit.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_pit.lst cmd-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) @@ -764,13 +764,13 @@ FSFILES += fs-kernel_mod-kern_generic_rtc_get_time_ms.lst PARTMAPFILES += partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) @@ -783,13 +783,13 @@ FSFILES += fs-kernel_mod-kern_generic_millisleep.lst PARTMAPFILES += partmap-kernel_mod-kern_generic_millisleep.lst cmd-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ @@ -870,13 +870,13 @@ FSFILES += fs-normal_mod-normal_cmdline.lst PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) @@ -889,13 +889,13 @@ FSFILES += fs-normal_mod-normal_command.lst PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) @@ -908,13 +908,13 @@ FSFILES += fs-normal_mod-normal_completion.lst PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) @@ -927,13 +927,13 @@ FSFILES += fs-normal_mod-normal_execute.lst PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) @@ -946,13 +946,13 @@ FSFILES += fs-normal_mod-normal_function.lst PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) @@ -965,13 +965,13 @@ FSFILES += fs-normal_mod-normal_lexer.lst PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) @@ -984,13 +984,13 @@ FSFILES += fs-normal_mod-normal_main.lst PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) @@ -1003,13 +1003,13 @@ FSFILES += fs-normal_mod-normal_menu.lst PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) @@ -1022,13 +1022,13 @@ FSFILES += fs-normal_mod-normal_menu_text.lst PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) @@ -1041,13 +1041,13 @@ FSFILES += fs-normal_mod-normal_color.lst PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) @@ -1060,13 +1060,13 @@ FSFILES += fs-normal_mod-normal_menu_viewer.lst PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) @@ -1079,13 +1079,13 @@ FSFILES += fs-normal_mod-normal_menu_entry.lst PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) @@ -1098,13 +1098,13 @@ FSFILES += fs-normal_mod-normal_misc.lst PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) @@ -1117,13 +1117,13 @@ FSFILES += fs-normal_mod-grub_script_tab.lst PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) @@ -1136,13 +1136,13 @@ FSFILES += fs-normal_mod-normal_script.lst PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) @@ -1155,13 +1155,13 @@ FSFILES += fs-normal_mod-normal_i386_setjmp.lst PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1213,13 +1213,13 @@ FSFILES += fs-chain_mod-loader_efi_chainloader.lst PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader.lst cmd-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) fs-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) partmap-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) chain_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1270,13 +1270,13 @@ FSFILES += fs-appleldr_mod-loader_efi_appleloader.lst PARTMAPFILES += partmap-appleldr_mod-loader_efi_appleloader.lst cmd-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) fs-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) appleldr_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1327,13 +1327,13 @@ FSFILES += fs-linux_mod-loader_i386_efi_linux.lst PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux.lst cmd-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) fs-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) partmap-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1384,13 +1384,13 @@ FSFILES += fs-halt_mod-commands_halt.lst PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1441,13 +1441,13 @@ FSFILES += fs-reboot_mod-commands_reboot.lst PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1498,13 +1498,13 @@ FSFILES += fs-pci_mod-bus_pci.lst PARTMAPFILES += partmap-pci_mod-bus_pci.lst cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) pci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1555,13 +1555,13 @@ FSFILES += fs-lspci_mod-commands_lspci.lst PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) lspci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1612,13 +1612,13 @@ FSFILES += fs-datetime_mod-lib_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) @@ -1631,13 +1631,13 @@ FSFILES += fs-datetime_mod-lib_efi_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_efi_datetime.lst cmd-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1688,13 +1688,13 @@ FSFILES += fs-date_mod-commands_date.lst PARTMAPFILES += partmap-date_mod-commands_date.lst cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) date_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1745,13 +1745,13 @@ FSFILES += fs-datehook_mod-hook_datehook.lst PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) datehook_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 4f43794c2..29060d95c 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -701,13 +701,13 @@ FSFILES += fs-normal_mod-normal_cmdline.lst PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) @@ -720,13 +720,13 @@ FSFILES += fs-normal_mod-normal_command.lst PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) @@ -739,13 +739,13 @@ FSFILES += fs-normal_mod-normal_completion.lst PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) @@ -758,13 +758,13 @@ FSFILES += fs-normal_mod-normal_execute.lst PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) @@ -777,13 +777,13 @@ FSFILES += fs-normal_mod-normal_function.lst PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) @@ -796,13 +796,13 @@ FSFILES += fs-normal_mod-normal_lexer.lst PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) @@ -815,13 +815,13 @@ FSFILES += fs-normal_mod-normal_main.lst PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) @@ -834,13 +834,13 @@ FSFILES += fs-normal_mod-normal_menu.lst PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) @@ -853,13 +853,13 @@ FSFILES += fs-normal_mod-normal_menu_text.lst PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) @@ -872,13 +872,13 @@ FSFILES += fs-normal_mod-normal_color.lst PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) @@ -891,13 +891,13 @@ FSFILES += fs-normal_mod-normal_menu_viewer.lst PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) @@ -910,13 +910,13 @@ FSFILES += fs-normal_mod-normal_menu_entry.lst PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) @@ -929,13 +929,13 @@ FSFILES += fs-normal_mod-normal_misc.lst PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) @@ -948,13 +948,13 @@ FSFILES += fs-normal_mod-grub_script_tab.lst PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) @@ -967,13 +967,13 @@ FSFILES += fs-normal_mod-normal_script.lst PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) @@ -986,13 +986,13 @@ FSFILES += fs-normal_mod-normal_i386_setjmp.lst PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1047,13 +1047,13 @@ FSFILES += fs-multiboot_mod-loader_ieee1275_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_ieee1275_multiboot2.lst cmd-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) @@ -1066,13 +1066,13 @@ FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) @@ -1085,13 +1085,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) @@ -1104,13 +1104,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1162,13 +1162,13 @@ FSFILES += fs-aout_mod-loader_aout.lst PARTMAPFILES += partmap-aout_mod-loader_aout.lst cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) aout_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1219,13 +1219,13 @@ FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) suspend_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1276,13 +1276,13 @@ FSFILES += fs-reboot_mod-commands_reboot.lst PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1333,13 +1333,13 @@ FSFILES += fs-halt_mod-commands_halt.lst PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1390,13 +1390,13 @@ FSFILES += fs-serial_mod-term_i386_pc_serial.lst PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) serial_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1447,13 +1447,13 @@ FSFILES += fs-linux_mod-loader_i386_ieee1275_linux.lst PARTMAPFILES += partmap-linux_mod-loader_i386_ieee1275_linux.lst cmd-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) fs-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) partmap-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1504,13 +1504,13 @@ FSFILES += fs-nand_mod-disk_ieee1275_nand.lst PARTMAPFILES += partmap-nand_mod-disk_ieee1275_nand.lst cmd-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh nand > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh nand > $@ || (rm -f $@; exit 1) fs-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh nand > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh nand > $@ || (rm -f $@; exit 1) partmap-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh nand > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh nand > $@ || (rm -f $@; exit 1) nand_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1561,13 +1561,13 @@ FSFILES += fs-memdisk_mod-disk_memdisk.lst PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) memdisk_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1618,13 +1618,13 @@ FSFILES += fs-pci_mod-bus_pci.lst PARTMAPFILES += partmap-pci_mod-bus_pci.lst cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) pci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1675,13 +1675,13 @@ FSFILES += fs-lspci_mod-commands_lspci.lst PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) lspci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1732,13 +1732,13 @@ FSFILES += fs-datetime_mod-lib_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) @@ -1751,13 +1751,13 @@ FSFILES += fs-datetime_mod-lib_i386_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1808,13 +1808,13 @@ FSFILES += fs-date_mod-commands_date.lst PARTMAPFILES += partmap-date_mod-commands_date.lst cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) date_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1865,13 +1865,13 @@ FSFILES += fs-datehook_mod-hook_datehook.lst PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) datehook_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1922,13 +1922,13 @@ FSFILES += fs-lsmmap_mod-commands_lsmmap.lst PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 652f669b2..c78c87184 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1063,13 +1063,13 @@ FSFILES += fs-biosdisk_mod-disk_i386_pc_biosdisk.lst PARTMAPFILES += partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh biosdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh biosdisk > $@ || (rm -f $@; exit 1) fs-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh biosdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh biosdisk > $@ || (rm -f $@; exit 1) partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh biosdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh biosdisk > $@ || (rm -f $@; exit 1) biosdisk_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1120,13 +1120,13 @@ FSFILES += fs-chain_mod-loader_i386_pc_chainloader.lst PARTMAPFILES += partmap-chain_mod-loader_i386_pc_chainloader.lst cmd-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) fs-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) partmap-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) chain_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1177,13 +1177,13 @@ FSFILES += fs-linux_mod-loader_i386_pc_linux.lst PARTMAPFILES += partmap-linux_mod-loader_i386_pc_linux.lst cmd-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) fs-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) partmap-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1249,13 +1249,13 @@ FSFILES += fs-normal_mod-normal_cmdline.lst PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) @@ -1268,13 +1268,13 @@ FSFILES += fs-normal_mod-normal_command.lst PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) @@ -1287,13 +1287,13 @@ FSFILES += fs-normal_mod-normal_completion.lst PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) @@ -1306,13 +1306,13 @@ FSFILES += fs-normal_mod-normal_execute.lst PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) @@ -1325,13 +1325,13 @@ FSFILES += fs-normal_mod-normal_function.lst PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) @@ -1344,13 +1344,13 @@ FSFILES += fs-normal_mod-normal_lexer.lst PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) @@ -1363,13 +1363,13 @@ FSFILES += fs-normal_mod-normal_main.lst PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) @@ -1382,13 +1382,13 @@ FSFILES += fs-normal_mod-normal_menu.lst PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) @@ -1401,13 +1401,13 @@ FSFILES += fs-normal_mod-normal_menu_text.lst PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) @@ -1420,13 +1420,13 @@ FSFILES += fs-normal_mod-normal_color.lst PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) @@ -1439,13 +1439,13 @@ FSFILES += fs-normal_mod-normal_menu_viewer.lst PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) @@ -1458,13 +1458,13 @@ FSFILES += fs-normal_mod-normal_menu_entry.lst PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) @@ -1477,13 +1477,13 @@ FSFILES += fs-normal_mod-normal_misc.lst PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) @@ -1496,13 +1496,13 @@ FSFILES += fs-normal_mod-grub_script_tab.lst PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) @@ -1515,13 +1515,13 @@ FSFILES += fs-normal_mod-normal_script.lst PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) @@ -1534,13 +1534,13 @@ FSFILES += fs-normal_mod-normal_i386_setjmp.lst PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1592,13 +1592,13 @@ FSFILES += fs-reboot_mod-commands_reboot.lst PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1649,13 +1649,13 @@ FSFILES += fs-halt_mod-commands_i386_pc_halt.lst PARTMAPFILES += partmap-halt_mod-commands_i386_pc_halt.lst cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1706,13 +1706,13 @@ FSFILES += fs-serial_mod-term_i386_pc_serial.lst PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) serial_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1767,13 +1767,13 @@ FSFILES += fs-multiboot_mod-loader_i386_multiboot.lst PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot.lst cmd-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) @@ -1786,13 +1786,13 @@ FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) @@ -1805,13 +1805,13 @@ FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_i386_pc_multiboot2.lst cmd-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) @@ -1824,13 +1824,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) @@ -1843,13 +1843,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1902,13 +1902,13 @@ FSFILES += fs-vbe_mod-video_i386_pc_vbe.lst PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbe.lst cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) fs-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) partmap-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) vbe_mod-video_i386_pc_vbeblit.o: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) @@ -1921,13 +1921,13 @@ FSFILES += fs-vbe_mod-video_i386_pc_vbeblit.lst PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbeblit.lst cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) fs-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) partmap-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) vbe_mod-video_i386_pc_vbefill.o: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) @@ -1940,13 +1940,13 @@ FSFILES += fs-vbe_mod-video_i386_pc_vbefill.lst PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbefill.lst cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) fs-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) partmap-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) vbe_mod-video_i386_pc_vbeutil.o: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) @@ -1959,13 +1959,13 @@ FSFILES += fs-vbe_mod-video_i386_pc_vbeutil.lst PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbeutil.lst cmd-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) fs-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) partmap-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) vbe_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2016,13 +2016,13 @@ FSFILES += fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst PARTMAPFILES += partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1) fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1) partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbeinfo > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbeinfo > $@ || (rm -f $@; exit 1) vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2073,13 +2073,13 @@ FSFILES += fs-vbetest_mod-commands_i386_pc_vbetest.lst PARTMAPFILES += partmap-vbetest_mod-commands_i386_pc_vbetest.lst cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1) fs-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1) partmap-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbetest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbetest > $@ || (rm -f $@; exit 1) vbetest_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2130,13 +2130,13 @@ FSFILES += fs-play_mod-commands_i386_pc_play.lst PARTMAPFILES += partmap-play_mod-commands_i386_pc_play.lst cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) play_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2187,13 +2187,13 @@ FSFILES += fs-ata_mod-disk_ata.lst PARTMAPFILES += partmap-ata_mod-disk_ata.lst cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) partmap-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) ata_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2244,13 +2244,13 @@ FSFILES += fs-vga_mod-term_i386_pc_vga.lst PARTMAPFILES += partmap-vga_mod-term_i386_pc_vga.lst cmd-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga > $@ || (rm -f $@; exit 1) fs-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga > $@ || (rm -f $@; exit 1) partmap-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga > $@ || (rm -f $@; exit 1) vga_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2301,13 +2301,13 @@ FSFILES += fs-memdisk_mod-disk_memdisk.lst PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) memdisk_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2358,13 +2358,13 @@ FSFILES += fs-pci_mod-bus_pci.lst PARTMAPFILES += partmap-pci_mod-bus_pci.lst cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) pci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2415,13 +2415,13 @@ FSFILES += fs-lspci_mod-commands_lspci.lst PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) lspci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2472,13 +2472,13 @@ FSFILES += fs-aout_mod-loader_aout.lst PARTMAPFILES += partmap-aout_mod-loader_aout.lst cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) aout_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2529,13 +2529,13 @@ FSFILES += fs-bsd_mod-loader_i386_bsd.lst PARTMAPFILES += partmap-bsd_mod-loader_i386_bsd.lst cmd-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bsd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bsd > $@ || (rm -f $@; exit 1) fs-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bsd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bsd > $@ || (rm -f $@; exit 1) partmap-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bsd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bsd > $@ || (rm -f $@; exit 1) bsd_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2586,13 +2586,13 @@ FSFILES += fs-usb_mod-bus_usb_usb.lst PARTMAPFILES += partmap-usb_mod-bus_usb_usb.lst cmd-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) fs-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) partmap-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) usb_mod-bus_usb_usbtrans.o: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) @@ -2605,13 +2605,13 @@ FSFILES += fs-usb_mod-bus_usb_usbtrans.lst PARTMAPFILES += partmap-usb_mod-bus_usb_usbtrans.lst cmd-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) fs-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) partmap-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) usb_mod-bus_usb_usbhub.o: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) @@ -2624,13 +2624,13 @@ FSFILES += fs-usb_mod-bus_usb_usbhub.lst PARTMAPFILES += partmap-usb_mod-bus_usb_usbhub.lst cmd-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) fs-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) partmap-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) usb_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2681,13 +2681,13 @@ FSFILES += fs-usbtest_mod-commands_usbtest.lst PARTMAPFILES += partmap-usbtest_mod-commands_usbtest.lst cmd-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbtest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbtest > $@ || (rm -f $@; exit 1) fs-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbtest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbtest > $@ || (rm -f $@; exit 1) partmap-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbtest > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbtest > $@ || (rm -f $@; exit 1) usbtest_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2738,13 +2738,13 @@ FSFILES += fs-uhci_mod-bus_usb_uhci.lst PARTMAPFILES += partmap-uhci_mod-bus_usb_uhci.lst cmd-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh uhci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh uhci > $@ || (rm -f $@; exit 1) fs-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh uhci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh uhci > $@ || (rm -f $@; exit 1) partmap-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh uhci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh uhci > $@ || (rm -f $@; exit 1) uhci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2795,13 +2795,13 @@ FSFILES += fs-ohci_mod-bus_usb_ohci.lst PARTMAPFILES += partmap-ohci_mod-bus_usb_ohci.lst cmd-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ohci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ohci > $@ || (rm -f $@; exit 1) fs-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ohci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ohci > $@ || (rm -f $@; exit 1) partmap-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ohci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ohci > $@ || (rm -f $@; exit 1) ohci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2852,13 +2852,13 @@ FSFILES += fs-usbms_mod-disk_usbms.lst PARTMAPFILES += partmap-usbms_mod-disk_usbms.lst cmd-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbms > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbms > $@ || (rm -f $@; exit 1) fs-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbms > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbms > $@ || (rm -f $@; exit 1) partmap-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbms > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbms > $@ || (rm -f $@; exit 1) usbms_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2909,13 +2909,13 @@ FSFILES += fs-usb_keyboard_mod-term_usb_keyboard.lst PARTMAPFILES += partmap-usb_keyboard_mod-term_usb_keyboard.lst cmd-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb_keyboard > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb_keyboard > $@ || (rm -f $@; exit 1) fs-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb_keyboard > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb_keyboard > $@ || (rm -f $@; exit 1) partmap-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb_keyboard > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb_keyboard > $@ || (rm -f $@; exit 1) usb_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2966,13 +2966,13 @@ FSFILES += fs-pxe_mod-fs_i386_pc_pxe.lst PARTMAPFILES += partmap-pxe_mod-fs_i386_pc_pxe.lst cmd-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxe > $@ || (rm -f $@; exit 1) fs-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxe > $@ || (rm -f $@; exit 1) partmap-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxe > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxe > $@ || (rm -f $@; exit 1) pxe_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3023,13 +3023,13 @@ FSFILES += fs-pxecmd_mod-commands_i386_pc_pxecmd.lst PARTMAPFILES += partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst cmd-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxecmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxecmd > $@ || (rm -f $@; exit 1) fs-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxecmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxecmd > $@ || (rm -f $@; exit 1) partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxecmd > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxecmd > $@ || (rm -f $@; exit 1) pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3080,13 +3080,13 @@ FSFILES += fs-datetime_mod-lib_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) @@ -3099,13 +3099,13 @@ FSFILES += fs-datetime_mod-lib_i386_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3156,13 +3156,13 @@ FSFILES += fs-date_mod-commands_date.lst PARTMAPFILES += partmap-date_mod-commands_date.lst cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) date_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3213,13 +3213,13 @@ FSFILES += fs-datehook_mod-hook_datehook.lst PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) datehook_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3270,13 +3270,13 @@ FSFILES += fs-lsmmap_mod-commands_lsmmap.lst PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3327,13 +3327,13 @@ FSFILES += fs-ata_pthru_mod-disk_ata_pthru.lst PARTMAPFILES += partmap-ata_pthru_mod-disk_ata_pthru.lst cmd-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata_pthru > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata_pthru > $@ || (rm -f $@; exit 1) fs-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata_pthru > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata_pthru > $@ || (rm -f $@; exit 1) partmap-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata_pthru > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata_pthru > $@ || (rm -f $@; exit 1) ata_pthru_mod_CFLAGS = $(COMMON_CFLAGS) @@ -3384,13 +3384,13 @@ FSFILES += fs-hdparm_mod-commands_hdparm.lst PARTMAPFILES += partmap-hdparm_mod-commands_hdparm.lst cmd-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) fs-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) partmap-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) hdparm_mod-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) @@ -3403,13 +3403,13 @@ FSFILES += fs-hdparm_mod-lib_hexdump.lst PARTMAPFILES += partmap-hdparm_mod-lib_hexdump.lst cmd-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) fs-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) partmap-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) hdparm_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386.mk b/conf/i386.mk index 5cd7b4203..32b2e2f6a 100644 --- a/conf/i386.mk +++ b/conf/i386.mk @@ -46,13 +46,13 @@ FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) cpuid_mod_CFLAGS = $(COMMON_CFLAGS) @@ -103,13 +103,13 @@ FSFILES += fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst PARTMAPFILES += partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst cmd-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh at_keyboard > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh at_keyboard > $@ || (rm -f $@; exit 1) fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh at_keyboard > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh at_keyboard > $@ || (rm -f $@; exit 1) partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh at_keyboard > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh at_keyboard > $@ || (rm -f $@; exit 1) at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) @@ -160,13 +160,13 @@ FSFILES += fs-vga_text_mod-term_i386_pc_vga_text.lst PARTMAPFILES += partmap-vga_text_mod-term_i386_pc_vga_text.lst cmd-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) fs-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) partmap-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) vga_text_mod-term_i386_vga_common.o: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) @@ -179,13 +179,13 @@ FSFILES += fs-vga_text_mod-term_i386_vga_common.lst PARTMAPFILES += partmap-vga_text_mod-term_i386_vga_common.lst cmd-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) fs-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) partmap-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) vga_text_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 47c965f65..57fbf6ff0 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -686,13 +686,13 @@ FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux.lst PARTMAPFILES += partmap-linux_mod-loader_powerpc_ieee1275_linux.lst cmd-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) fs-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) partmap-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -758,13 +758,13 @@ FSFILES += fs-normal_mod-normal_cmdline.lst PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) @@ -777,13 +777,13 @@ FSFILES += fs-normal_mod-normal_command.lst PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) @@ -796,13 +796,13 @@ FSFILES += fs-normal_mod-normal_completion.lst PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) @@ -815,13 +815,13 @@ FSFILES += fs-normal_mod-normal_execute.lst PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) @@ -834,13 +834,13 @@ FSFILES += fs-normal_mod-normal_function.lst PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) @@ -853,13 +853,13 @@ FSFILES += fs-normal_mod-normal_lexer.lst PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) @@ -872,13 +872,13 @@ FSFILES += fs-normal_mod-normal_main.lst PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) @@ -891,13 +891,13 @@ FSFILES += fs-normal_mod-normal_menu.lst PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) @@ -910,13 +910,13 @@ FSFILES += fs-normal_mod-normal_menu_text.lst PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) @@ -929,13 +929,13 @@ FSFILES += fs-normal_mod-normal_color.lst PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) @@ -948,13 +948,13 @@ FSFILES += fs-normal_mod-normal_menu_viewer.lst PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) @@ -967,13 +967,13 @@ FSFILES += fs-normal_mod-normal_menu_entry.lst PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) @@ -986,13 +986,13 @@ FSFILES += fs-normal_mod-normal_misc.lst PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) @@ -1005,13 +1005,13 @@ FSFILES += fs-normal_mod-grub_script_tab.lst PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) @@ -1024,13 +1024,13 @@ FSFILES += fs-normal_mod-normal_script.lst PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) @@ -1043,13 +1043,13 @@ FSFILES += fs-normal_mod-normal_powerpc_setjmp.lst PARTMAPFILES += partmap-normal_mod-normal_powerpc_setjmp.lst cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1101,13 +1101,13 @@ FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) suspend_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1158,13 +1158,13 @@ FSFILES += fs-reboot_mod-commands_reboot.lst PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1215,13 +1215,13 @@ FSFILES += fs-halt_mod-commands_halt.lst PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1274,13 +1274,13 @@ FSFILES += fs-multiboot_mod-loader_ieee1275_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_ieee1275_multiboot2.lst cmd-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) @@ -1293,13 +1293,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot2.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) @@ -1312,13 +1312,13 @@ FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) multiboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1369,13 +1369,13 @@ FSFILES += fs-memdisk_mod-disk_memdisk.lst PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) memdisk_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1426,13 +1426,13 @@ FSFILES += fs-lsmmap_mod-commands_lsmmap.lst PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 60110aa7b..2d5030463 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -244,13 +244,13 @@ FSFILES += fs-fshelp_mod-fs_fshelp.lst PARTMAPFILES += partmap-fshelp_mod-fs_fshelp.lst cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) partmap-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) fshelp_mod_CFLAGS = $(COMMON_CFLAGS) @@ -301,13 +301,13 @@ FSFILES += fs-fat_mod-fs_fat.lst PARTMAPFILES += partmap-fat_mod-fs_fat.lst cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) partmap-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) fat_mod_CFLAGS = $(COMMON_CFLAGS) @@ -358,13 +358,13 @@ FSFILES += fs-ext2_mod-fs_ext2.lst PARTMAPFILES += partmap-ext2_mod-fs_ext2.lst cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) partmap-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) ext2_mod_CFLAGS = $(COMMON_CFLAGS) @@ -415,13 +415,13 @@ FSFILES += fs-ufs_mod-fs_ufs.lst PARTMAPFILES += partmap-ufs_mod-fs_ufs.lst cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) partmap-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) ufs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -472,13 +472,13 @@ FSFILES += fs-minix_mod-fs_minix.lst PARTMAPFILES += partmap-minix_mod-fs_minix.lst cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) partmap-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) minix_mod_CFLAGS = $(COMMON_CFLAGS) @@ -529,13 +529,13 @@ FSFILES += fs-hfs_mod-fs_hfs.lst PARTMAPFILES += partmap-hfs_mod-fs_hfs.lst cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) partmap-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) hfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -586,13 +586,13 @@ FSFILES += fs-jfs_mod-fs_jfs.lst PARTMAPFILES += partmap-jfs_mod-fs_jfs.lst cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) partmap-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) jfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -648,13 +648,13 @@ FSFILES += fs-xfs_mod-fs_xfs.lst PARTMAPFILES += partmap-xfs_mod-fs_xfs.lst cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) partmap-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) xfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -705,13 +705,13 @@ FSFILES += fs-affs_mod-fs_affs.lst PARTMAPFILES += partmap-affs_mod-fs_affs.lst cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) partmap-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) affs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -762,13 +762,13 @@ FSFILES += fs-sfs_mod-fs_sfs.lst PARTMAPFILES += partmap-sfs_mod-fs_sfs.lst cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) partmap-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) sfs_mod_CFLAGS = $(COMMON_CFLAGS) @@ -844,13 +844,13 @@ FSFILES += fs-normal_mod-normal_arg.lst PARTMAPFILES += partmap-normal_mod-normal_arg.lst cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) @@ -863,13 +863,13 @@ FSFILES += fs-normal_mod-normal_cmdline.lst PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) @@ -882,13 +882,13 @@ FSFILES += fs-normal_mod-normal_command.lst PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) @@ -901,13 +901,13 @@ FSFILES += fs-normal_mod-normal_completion.lst PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) @@ -920,13 +920,13 @@ FSFILES += fs-normal_mod-normal_execute.lst PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) @@ -939,13 +939,13 @@ FSFILES += fs-normal_mod-normal_function.lst PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) @@ -958,13 +958,13 @@ FSFILES += fs-normal_mod-normal_lexer.lst PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) @@ -977,13 +977,13 @@ FSFILES += fs-normal_mod-normal_main.lst PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) @@ -996,13 +996,13 @@ FSFILES += fs-normal_mod-normal_menu.lst PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) @@ -1015,13 +1015,13 @@ FSFILES += fs-normal_mod-normal_menu_text.lst PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) @@ -1034,13 +1034,13 @@ FSFILES += fs-normal_mod-normal_color.lst PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) @@ -1053,13 +1053,13 @@ FSFILES += fs-normal_mod-normal_menu_viewer.lst PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) @@ -1072,13 +1072,13 @@ FSFILES += fs-normal_mod-normal_menu_entry.lst PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) @@ -1091,13 +1091,13 @@ FSFILES += fs-normal_mod-normal_misc.lst PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) @@ -1110,13 +1110,13 @@ FSFILES += fs-normal_mod-grub_script_tab.lst PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) @@ -1129,13 +1129,13 @@ FSFILES += fs-normal_mod-normal_script.lst PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_sparc64_setjmp.o: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) @@ -1148,13 +1148,13 @@ FSFILES += fs-normal_mod-normal_sparc64_setjmp.lst PARTMAPFILES += partmap-normal_mod-normal_sparc64_setjmp.lst cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1206,13 +1206,13 @@ FSFILES += fs-hello_mod-hello_hello.lst PARTMAPFILES += partmap-hello_mod-hello_hello.lst cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) hello_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1263,13 +1263,13 @@ FSFILES += fs-boot_mod-commands_boot.lst PARTMAPFILES += partmap-boot_mod-commands_boot.lst cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) fs-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) partmap-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh boot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh boot > $@ || (rm -f $@; exit 1) boot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1320,13 +1320,13 @@ FSFILES += fs-terminal_mod-commands_terminal.lst PARTMAPFILES += partmap-terminal_mod-commands_terminal.lst cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) fs-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) partmap-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminal > $@ || (rm -f $@; exit 1) terminal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1377,13 +1377,13 @@ FSFILES += fs-ls_mod-commands_ls.lst PARTMAPFILES += partmap-ls_mod-commands_ls.lst cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) partmap-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) ls_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1434,13 +1434,13 @@ FSFILES += fs-cmp_mod-commands_cmp.lst PARTMAPFILES += partmap-cmp_mod-commands_cmp.lst cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) partmap-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) cmp_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1491,13 +1491,13 @@ FSFILES += fs-cat_mod-commands_cat.lst PARTMAPFILES += partmap-cat_mod-commands_cat.lst cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) partmap-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) cat_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1548,13 +1548,13 @@ FSFILES += fs-font_mod-font_manager.lst PARTMAPFILES += partmap-font_mod-font_manager.lst cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) fs-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) partmap-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) font_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1605,13 +1605,13 @@ FSFILES += fs-amiga_mod-partmap_amiga.lst PARTMAPFILES += partmap-amiga_mod-partmap_amiga.lst cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) partmap-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) amiga_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1662,13 +1662,13 @@ FSFILES += fs-apple_mod-partmap_apple.lst PARTMAPFILES += partmap-apple_mod-partmap_apple.lst cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) partmap-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) apple_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1719,13 +1719,13 @@ FSFILES += fs-pc_mod-partmap_pc.lst PARTMAPFILES += partmap-pc_mod-partmap_pc.lst cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) partmap-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) pc_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1776,13 +1776,13 @@ FSFILES += fs-sun_mod-partmap_sun.lst PARTMAPFILES += partmap-sun_mod-partmap_sun.lst cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) partmap-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) sun_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1833,13 +1833,13 @@ FSFILES += fs-acorn_mod-partmap_acorn.lst PARTMAPFILES += partmap-acorn_mod-partmap_acorn.lst cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) partmap-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) acorn_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1889,13 +1889,13 @@ FSFILES += fs-loopback_mod-disk_loopback.lst PARTMAPFILES += partmap-loopback_mod-disk_loopback.lst cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) partmap-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) loopback_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1946,13 +1946,13 @@ FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) suspend_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2003,13 +2003,13 @@ FSFILES += fs-reboot_mod-commands_reboot.lst PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2060,13 +2060,13 @@ FSFILES += fs-halt_mod-commands_halt.lst PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2117,13 +2117,13 @@ FSFILES += fs-help_mod-commands_help.lst PARTMAPFILES += partmap-help_mod-commands_help.lst cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) help_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2184,13 +2184,13 @@ FSFILES += fs-configfile_mod-commands_configfile.lst PARTMAPFILES += partmap-configfile_mod-commands_configfile.lst cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) partmap-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) configfile_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2241,13 +2241,13 @@ FSFILES += fs-search_mod-commands_search.lst PARTMAPFILES += partmap-search_mod-commands_search.lst cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) partmap-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) search_mod_CFLAGS = $(COMMON_CFLAGS) @@ -2298,13 +2298,13 @@ FSFILES += fs-gzio_mod-io_gzio.lst PARTMAPFILES += partmap-gzio_mod-io_gzio.lst cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) gzio_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index f22840caf..e845b9818 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -163,13 +163,13 @@ FSFILES += fs-kernel_mod-kern_x86_64_efi_startup.lst PARTMAPFILES += partmap-kernel_mod-kern_x86_64_efi_startup.lst cmd-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_x86_64_efi_callwrap.o: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) @@ -182,13 +182,13 @@ FSFILES += fs-kernel_mod-kern_x86_64_efi_callwrap.lst PARTMAPFILES += partmap-kernel_mod-kern_x86_64_efi_callwrap.lst cmd-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) @@ -201,13 +201,13 @@ FSFILES += fs-kernel_mod-kern_main.lst PARTMAPFILES += partmap-kernel_mod-kern_main.lst cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) @@ -220,13 +220,13 @@ FSFILES += fs-kernel_mod-kern_device.lst PARTMAPFILES += partmap-kernel_mod-kern_device.lst cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) @@ -239,13 +239,13 @@ FSFILES += fs-kernel_mod-kern_disk.lst PARTMAPFILES += partmap-kernel_mod-kern_disk.lst cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) @@ -258,13 +258,13 @@ FSFILES += fs-kernel_mod-kern_dl.lst PARTMAPFILES += partmap-kernel_mod-kern_dl.lst cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) @@ -277,13 +277,13 @@ FSFILES += fs-kernel_mod-kern_file.lst PARTMAPFILES += partmap-kernel_mod-kern_file.lst cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) @@ -296,13 +296,13 @@ FSFILES += fs-kernel_mod-kern_fs.lst PARTMAPFILES += partmap-kernel_mod-kern_fs.lst cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) @@ -315,13 +315,13 @@ FSFILES += fs-kernel_mod-kern_err.lst PARTMAPFILES += partmap-kernel_mod-kern_err.lst cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) @@ -334,13 +334,13 @@ FSFILES += fs-kernel_mod-kern_misc.lst PARTMAPFILES += partmap-kernel_mod-kern_misc.lst cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) @@ -353,13 +353,13 @@ FSFILES += fs-kernel_mod-kern_mm.lst PARTMAPFILES += partmap-kernel_mod-kern_mm.lst cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) @@ -372,13 +372,13 @@ FSFILES += fs-kernel_mod-kern_loader.lst PARTMAPFILES += partmap-kernel_mod-kern_loader.lst cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) @@ -391,13 +391,13 @@ FSFILES += fs-kernel_mod-kern_rescue.lst PARTMAPFILES += partmap-kernel_mod-kern_rescue.lst cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) @@ -410,13 +410,13 @@ FSFILES += fs-kernel_mod-kern_term.lst PARTMAPFILES += partmap-kernel_mod-kern_term.lst cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_x86_64_dl.o: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) @@ -429,13 +429,13 @@ FSFILES += fs-kernel_mod-kern_x86_64_dl.lst PARTMAPFILES += partmap-kernel_mod-kern_x86_64_dl.lst cmd-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) @@ -448,13 +448,13 @@ FSFILES += fs-kernel_mod-kern_i386_efi_init.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_init.lst cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) @@ -467,13 +467,13 @@ FSFILES += fs-kernel_mod-kern_parser.lst PARTMAPFILES += partmap-kernel_mod-kern_parser.lst cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) @@ -486,13 +486,13 @@ FSFILES += fs-kernel_mod-kern_partition.lst PARTMAPFILES += partmap-kernel_mod-kern_partition.lst cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) @@ -505,13 +505,13 @@ FSFILES += fs-kernel_mod-kern_env.lst PARTMAPFILES += partmap-kernel_mod-kern_env.lst cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) @@ -524,13 +524,13 @@ FSFILES += fs-kernel_mod-symlist.lst PARTMAPFILES += partmap-kernel_mod-symlist.lst cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_efi_efi.o: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) @@ -543,13 +543,13 @@ FSFILES += fs-kernel_mod-kern_efi_efi.lst PARTMAPFILES += partmap-kernel_mod-kern_efi_efi.lst cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_efi_init.o: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) @@ -562,13 +562,13 @@ FSFILES += fs-kernel_mod-kern_efi_init.lst PARTMAPFILES += partmap-kernel_mod-kern_efi_init.lst cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_efi_mm.o: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) @@ -581,13 +581,13 @@ FSFILES += fs-kernel_mod-kern_efi_mm.lst PARTMAPFILES += partmap-kernel_mod-kern_efi_mm.lst cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) @@ -600,13 +600,13 @@ FSFILES += fs-kernel_mod-kern_time.lst PARTMAPFILES += partmap-kernel_mod-kern_time.lst cmd-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) @@ -619,13 +619,13 @@ FSFILES += fs-kernel_mod-kern_list.lst PARTMAPFILES += partmap-kernel_mod-kern_list.lst cmd-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) @@ -638,13 +638,13 @@ FSFILES += fs-kernel_mod-kern_handler.lst PARTMAPFILES += partmap-kernel_mod-kern_handler.lst cmd-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) @@ -657,13 +657,13 @@ FSFILES += fs-kernel_mod-kern_command.lst PARTMAPFILES += partmap-kernel_mod-kern_command.lst cmd-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) @@ -676,13 +676,13 @@ FSFILES += fs-kernel_mod-kern_corecmd.lst PARTMAPFILES += partmap-kernel_mod-kern_corecmd.lst cmd-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) @@ -695,13 +695,13 @@ FSFILES += fs-kernel_mod-kern_i386_tsc.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_tsc.lst cmd-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) @@ -714,13 +714,13 @@ FSFILES += fs-kernel_mod-kern_i386_pit.lst PARTMAPFILES += partmap-kernel_mod-kern_i386_pit.lst cmd-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) @@ -733,13 +733,13 @@ FSFILES += fs-kernel_mod-kern_generic_millisleep.lst PARTMAPFILES += partmap-kernel_mod-kern_generic_millisleep.lst cmd-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) @@ -752,13 +752,13 @@ FSFILES += fs-kernel_mod-kern_generic_rtc_get_time_ms.lst PARTMAPFILES += partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) @@ -771,13 +771,13 @@ FSFILES += fs-kernel_mod-term_efi_console.lst PARTMAPFILES += partmap-kernel_mod-term_efi_console.lst cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) @@ -790,13 +790,13 @@ FSFILES += fs-kernel_mod-disk_efi_efidisk.lst PARTMAPFILES += partmap-kernel_mod-disk_efi_efidisk.lst cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ @@ -878,13 +878,13 @@ FSFILES += fs-normal_mod-normal_cmdline.lst PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) @@ -897,13 +897,13 @@ FSFILES += fs-normal_mod-normal_command.lst PARTMAPFILES += partmap-normal_mod-normal_command.lst cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) @@ -916,13 +916,13 @@ FSFILES += fs-normal_mod-normal_completion.lst PARTMAPFILES += partmap-normal_mod-normal_completion.lst cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) @@ -935,13 +935,13 @@ FSFILES += fs-normal_mod-normal_execute.lst PARTMAPFILES += partmap-normal_mod-normal_execute.lst cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) @@ -954,13 +954,13 @@ FSFILES += fs-normal_mod-normal_function.lst PARTMAPFILES += partmap-normal_mod-normal_function.lst cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) @@ -973,13 +973,13 @@ FSFILES += fs-normal_mod-normal_lexer.lst PARTMAPFILES += partmap-normal_mod-normal_lexer.lst cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) @@ -992,13 +992,13 @@ FSFILES += fs-normal_mod-normal_main.lst PARTMAPFILES += partmap-normal_mod-normal_main.lst cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) @@ -1011,13 +1011,13 @@ FSFILES += fs-normal_mod-normal_menu.lst PARTMAPFILES += partmap-normal_mod-normal_menu.lst cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) @@ -1030,13 +1030,13 @@ FSFILES += fs-normal_mod-normal_menu_text.lst PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) @@ -1049,13 +1049,13 @@ FSFILES += fs-normal_mod-normal_color.lst PARTMAPFILES += partmap-normal_mod-normal_color.lst cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) @@ -1068,13 +1068,13 @@ FSFILES += fs-normal_mod-normal_menu_viewer.lst PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) @@ -1087,13 +1087,13 @@ FSFILES += fs-normal_mod-normal_menu_entry.lst PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) @@ -1106,13 +1106,13 @@ FSFILES += fs-normal_mod-normal_misc.lst PARTMAPFILES += partmap-normal_mod-normal_misc.lst cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) @@ -1125,13 +1125,13 @@ FSFILES += fs-normal_mod-grub_script_tab.lst PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) @@ -1144,13 +1144,13 @@ FSFILES += fs-normal_mod-normal_script.lst PARTMAPFILES += partmap-normal_mod-normal_script.lst cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod-normal_x86_64_setjmp.o: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) @@ -1163,13 +1163,13 @@ FSFILES += fs-normal_mod-normal_x86_64_setjmp.lst PARTMAPFILES += partmap-normal_mod-normal_x86_64_setjmp.lst cmd-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) fs-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) partmap-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) normal_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1221,13 +1221,13 @@ FSFILES += fs-chain_mod-loader_efi_chainloader.lst PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader.lst cmd-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) fs-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) partmap-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) chain_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1278,13 +1278,13 @@ FSFILES += fs-appleldr_mod-loader_efi_appleloader.lst PARTMAPFILES += partmap-appleldr_mod-loader_efi_appleloader.lst cmd-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) fs-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) appleldr_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1335,13 +1335,13 @@ FSFILES += fs-linux_mod-loader_i386_efi_linux.lst PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux.lst cmd-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) fs-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) partmap-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1392,13 +1392,13 @@ FSFILES += fs-halt_mod-commands_halt.lst PARTMAPFILES += partmap-halt_mod-commands_halt.lst cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) halt_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1449,13 +1449,13 @@ FSFILES += fs-reboot_mod-commands_reboot.lst PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) reboot_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1506,13 +1506,13 @@ FSFILES += fs-pci_mod-bus_pci.lst PARTMAPFILES += partmap-pci_mod-bus_pci.lst cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) pci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1563,13 +1563,13 @@ FSFILES += fs-lspci_mod-commands_lspci.lst PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) lspci_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1620,13 +1620,13 @@ FSFILES += fs-datetime_mod-lib_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) @@ -1639,13 +1639,13 @@ FSFILES += fs-datetime_mod-lib_efi_datetime.lst PARTMAPFILES += partmap-datetime_mod-lib_efi_datetime.lst cmd-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) fs-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) partmap-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) datetime_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1696,13 +1696,13 @@ FSFILES += fs-date_mod-commands_date.lst PARTMAPFILES += partmap-date_mod-commands_date.lst cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) date_mod_CFLAGS = $(COMMON_CFLAGS) @@ -1753,13 +1753,13 @@ FSFILES += fs-datehook_mod-hook_datehook.lst PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) + set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) datehook_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/genmk.rb b/genmk.rb index c41872c2a..41b0752bd 100644 --- a/genmk.rb +++ b/genmk.rb @@ -159,17 +159,17 @@ PARTMAPFILES += #{partmap} #{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh set -e; \ - $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/gencmdlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) #{fs}: #{src} $(#{src}_DEPENDENCIES) genfslist.sh set -e; \ - $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) #{partmap}: #{src} $(#{src}_DEPENDENCIES) genpartmaplist.sh set -e; \ - $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genpartmaplist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) From 7d074e3ce2da67ffdeb8e2138bc07bb209521714 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 24 Mar 2009 14:15:07 +0000 Subject: [PATCH 0584/1707] typos --- ChangeLog | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index eb3f939e7..a88dd1c53 100644 --- a/ChangeLog +++ b/ChangeLog @@ -212,11 +212,11 @@ (grub_rescue_cmd_insmod): Likewise. (grub_rescue_cmd_set): Likewise. (grub_rescue_cmd_unset): Likewise. - (attemp_normal_mode): Use grub_command_find to get normal module. + (attempt_normal_mode): Use grub_command_find to get normal module. (grub_enter_rescue_mode): Use grub_register_core_commands to register - commands, remove grub_rescue_regiter_command calls. + commands, remove grub_rescue_register_command calls. - * normal/command.c (grub_regiser_command): Removed. + * normal/command.c (grub_register_command): Removed. (grub_unregister_command): Likewise. (grub_command_find): Likewise. (grub_iterate_commands): Likewise. @@ -353,9 +353,9 @@ * loader/i386/multiboot.c (code_size): New variable. (grub_multiboot): Define offsets by adding to `code_size' rather - than substracting from `grub_multiboot_payload_size'. Provide + than subtracting from `grub_multiboot_payload_size'. Provide 4-byte alignment to MBI and others by increasing - `boot_loader_name_length' appropiately. + `boot_loader_name_length' appropriately. * loader/i386/multiboot_elfxx.c (CONCAT(grub_multiboot_load_elf, XX)): Initialize `code_size'. @@ -385,7 +385,7 @@ (e.g. gfxterm with resolution higher than 640x480). * normal/main.c (grub_normal_init_page): Display title text in a - position relative to the center of the terminal instead of reliing + position relative to the center of the terminal instead of relying on a hardcoded offset. 2009-03-04 Robert Millan From a9368fd30c6d6020e367cabf338d9222374116ff Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 28 Mar 2009 12:53:16 +0000 Subject: [PATCH 0585/1707] 2009-03-28 Robert Millan * conf/i386-pc.rmk (pkglib_MODULES): Add `linux16.mod'. (linux16_mod_SOURCES, linux16_mod_CFLAGS, linux16_mod_LDFLAGS): New variables. Use 16-bit loader. (linux_mod_SOURCES, linux_mod_CFLAGS, linux_mod_LDFLAGS): Use 32-bit loader. * kern/i386/loader.S (grub_linux_boot): Rename to ... (grub_linux16_boot): ... this. Update all users. * loader/i386/linux.c (grub_linux32_boot): Rename to ... (grub_linux_boot): ... this. Update all users. * loader/i386/pc/linux.c (GRUB_MOD_INIT(linux)): Rename to ... (GRUB_MOD_INIT(linux16)): ... this. Rename `linux' and `initrd' commands to `linux16' and `initrd16'. (GRUB_MOD_FINI(linux)): Rename to ... (GRUB_MOD_FINI(linux16)): ... this. --- ChangeLog | 18 +++++++ conf/i386-pc.mk | 97 ++++++++++++++++++++++++++++++-------- conf/i386-pc.rmk | 11 +++-- include/grub/i386/loader.h | 2 +- kern/i386/loader.S | 2 +- loader/i386/linux.c | 4 +- loader/i386/pc/linux.c | 10 ++-- 7 files changed, 112 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index a88dd1c53..7d4a39db0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2009-03-28 Robert Millan + + * conf/i386-pc.rmk (pkglib_MODULES): Add `linux16.mod'. + (linux16_mod_SOURCES, linux16_mod_CFLAGS, linux16_mod_LDFLAGS): New + variables. Use 16-bit loader. + (linux_mod_SOURCES, linux_mod_CFLAGS, linux_mod_LDFLAGS): Use 32-bit + loader. + * kern/i386/loader.S (grub_linux_boot): Rename to ... + (grub_linux16_boot): ... this. Update all users. + * loader/i386/linux.c (grub_linux32_boot): Rename to ... + (grub_linux_boot): ... this. Update all users. + + * loader/i386/pc/linux.c (GRUB_MOD_INIT(linux)): Rename to ... + (GRUB_MOD_INIT(linux16)): ... this. Rename `linux' and `initrd' + commands to `linux16' and `initrd16'. + (GRUB_MOD_FINI(linux)): Rename to ... + (GRUB_MOD_FINI(linux16)): ... this. + 2009-03-24 Pavel Roskin * genmk.rb: Define ASM_FILE for *.S files for *.lst generation, diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index c78c87184..1b76550e9 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1010,7 +1010,7 @@ grub-mkrescue: util/i386/pc/grub-mkrescue.in $(util/i386/pc/grub-mkrescue.in_DEP chmod +x $@ -pkglib_MODULES = biosdisk.mod chain.mod linux.mod normal.mod \ +pkglib_MODULES = biosdisk.mod chain.mod normal.mod \ multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ @@ -1132,14 +1132,71 @@ partmap-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $ chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -linux_mod_SOURCES = loader/i386/pc/linux.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_pc_linux.o und-linux.lst +pkglib_MODULES += linux16.mod +linux16_mod_SOURCES = loader/i386/pc/linux.c +CLEANFILES += linux16.mod mod-linux16.o mod-linux16.c pre-linux16.o linux16_mod-loader_i386_pc_linux.o und-linux16.lst +ifneq ($(linux16_mod_EXPORTS),no) +CLEANFILES += def-linux16.lst +DEFSYMFILES += def-linux16.lst +endif +MOSTLYCLEANFILES += linux16_mod-loader_i386_pc_linux.d +UNDSYMFILES += und-linux16.lst + +linux16.mod: pre-linux16.o mod-linux16.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(linux16_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux16.o mod-linux16.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-linux16.o: $(linux16_mod_DEPENDENCIES) linux16_mod-loader_i386_pc_linux.o + -rm -f $@ + $(TARGET_CC) $(linux16_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux16_mod-loader_i386_pc_linux.o + +mod-linux16.o: mod-linux16.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -c -o $@ $< + +mod-linux16.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'linux16' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(linux16_mod_EXPORTS),no) +def-linux16.lst: pre-linux16.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux16/' > $@ +endif + +und-linux16.lst: pre-linux16.o + echo 'linux16' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +linux16_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -MD -c -o $@ $< +-include linux16_mod-loader_i386_pc_linux.d + +CLEANFILES += cmd-linux16_mod-loader_i386_pc_linux.lst fs-linux16_mod-loader_i386_pc_linux.lst partmap-linux16_mod-loader_i386_pc_linux.lst +COMMANDFILES += cmd-linux16_mod-loader_i386_pc_linux.lst +FSFILES += fs-linux16_mod-loader_i386_pc_linux.lst +PARTMAPFILES += partmap-linux16_mod-loader_i386_pc_linux.lst + +cmd-linux16_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux16 > $@ || (rm -f $@; exit 1) + +fs-linux16_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux16 > $@ || (rm -f $@; exit 1) + +partmap-linux16_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux16 > $@ || (rm -f $@; exit 1) + + +linux16_mod_CFLAGS = $(COMMON_CFLAGS) +linux16_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += linux.mod +linux_mod_SOURCES = loader/i386/linux.c +CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_linux.o und-linux.lst ifneq ($(linux_mod_EXPORTS),no) CLEANFILES += def-linux.lst DEFSYMFILES += def-linux.lst endif -MOSTLYCLEANFILES += linux_mod-loader_i386_pc_linux.d +MOSTLYCLEANFILES += linux_mod-loader_i386_linux.d UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) @@ -1148,9 +1205,9 @@ linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_pc_linux.o +pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_linux.o -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_pc_linux.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_linux.o mod-linux.o: mod-linux.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< @@ -1167,23 +1224,23 @@ und-linux.lst: pre-linux.o echo 'linux' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -linux_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_pc_linux.d +linux_mod-loader_i386_linux.o: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) + $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< +-include linux_mod-loader_i386_linux.d -CLEANFILES += cmd-linux_mod-loader_i386_pc_linux.lst fs-linux_mod-loader_i386_pc_linux.lst partmap-linux_mod-loader_i386_pc_linux.lst -COMMANDFILES += cmd-linux_mod-loader_i386_pc_linux.lst -FSFILES += fs-linux_mod-loader_i386_pc_linux.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_pc_linux.lst +CLEANFILES += cmd-linux_mod-loader_i386_linux.lst fs-linux_mod-loader_i386_linux.lst partmap-linux_mod-loader_i386_linux.lst +COMMANDFILES += cmd-linux_mod-loader_i386_linux.lst +FSFILES += fs-linux_mod-loader_i386_linux.lst +PARTMAPFILES += partmap-linux_mod-loader_i386_linux.lst -cmd-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) +cmd-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) -fs-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) +fs-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) -partmap-linux_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) +partmap-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 60d518235..7fa19757f 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -167,7 +167,7 @@ grub_install_SOURCES = util/i386/pc/grub-install.in # For grub-mkrescue. grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in -pkglib_MODULES = biosdisk.mod chain.mod linux.mod normal.mod \ +pkglib_MODULES = biosdisk.mod chain.mod normal.mod \ multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ @@ -185,8 +185,13 @@ chain_mod_SOURCES = loader/i386/pc/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) chain_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For _linux.mod. -linux_mod_SOURCES = loader/i386/pc/linux.c +pkglib_MODULES += linux16.mod +linux16_mod_SOURCES = loader/i386/pc/linux.c +linux16_mod_CFLAGS = $(COMMON_CFLAGS) +linux16_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += linux.mod +linux_mod_SOURCES = loader/i386/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index 305203054..afd3eb93f 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -30,7 +30,7 @@ extern grub_int32_t EXPORT_VAR(grub_linux_is_bzimage); extern grub_addr_t EXPORT_VAR(grub_os_area_addr); extern grub_size_t EXPORT_VAR(grub_os_area_size); -grub_err_t EXPORT_FUNC(grub_linux_boot) (void); +grub_err_t EXPORT_FUNC(grub_linux16_boot) (void); void EXPORT_FUNC(grub_unix_real_boot) (grub_addr_t entry, ...) __attribute__ ((cdecl,noreturn)); diff --git a/kern/i386/loader.S b/kern/i386/loader.S index 0e8ded68e..bbd2187fb 100644 --- a/kern/i386/loader.S +++ b/kern/i386/loader.S @@ -59,7 +59,7 @@ VARIABLE(grub_linux_real_addr) VARIABLE(grub_linux_is_bzimage) .long 0 -FUNCTION(grub_linux_boot) +FUNCTION(grub_linux16_boot) /* Must be done before zImage copy. */ call EXT_C(grub_dl_unload_all) diff --git a/loader/i386/linux.c b/loader/i386/linux.c index f8b9862a4..eb0a8859b 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -263,7 +263,7 @@ struct #endif static grub_err_t -grub_linux32_boot (void) +grub_linux_boot (void) { struct linux_kernel_params *params; int e820_num; @@ -522,7 +522,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (grub_errno == GRUB_ERR_NONE) { - grub_loader_set (grub_linux32_boot, grub_linux_unload, + grub_loader_set (grub_linux_boot, grub_linux_unload, 0 /* set noreturn=0 in order to avoid grub_console_fini() */); loaded = 1; } diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index 935f21ba1..8ff97f433 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -269,7 +269,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (grub_errno == GRUB_ERR_NONE) { grub_linux_prot_size = prot_size; - grub_loader_set (grub_linux_boot, grub_linux_unload, 1); + grub_loader_set (grub_linux16_boot, grub_linux_unload, 1); loaded = 1; } @@ -378,18 +378,18 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), static grub_command_t cmd_linux, cmd_initrd; -GRUB_MOD_INIT(linux) +GRUB_MOD_INIT(linux16) { cmd_linux = - grub_register_command ("linux", grub_cmd_linux, + grub_register_command ("linux16", grub_cmd_linux, 0, "load linux"); cmd_initrd = - grub_register_command ("initrd", grub_cmd_initrd, + grub_register_command ("initrd16", grub_cmd_initrd, 0, "load initrd"); my_mod = mod; } -GRUB_MOD_FINI(linux) +GRUB_MOD_FINI(linux16) { grub_unregister_command (cmd_linux); grub_unregister_command (cmd_initrd); From 5709cfc4d1620eabf4aa8d06ec8fc9eb03b18d7c Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 28 Mar 2009 19:58:15 +0000 Subject: [PATCH 0586/1707] 2009-03-29 Yoshinori K. Okuji Make the format of Environment Block plain text. The boot loader part is not tested well yet. * util/grub-editenv.c (DEFAULT_ENVBLK_SIZE): New macro. (buffer): Removed. (envblk): Likewise. (usage): Remove "info" and "clear". Add "unset". Update the description of "set", as this does not delete variables any longer. (create_envblk_file): Complete rewrite. (open_envblk_file): Likewise. (cmd_info): Removed. (cmd_list): Likewise. (cmd_set): Likewise. (cmd_clear): Likewise. (list_variables): New function. (write_envblk): Likewise. (set_variables): Likewise. (unset_variables): Likewise. (main): Complete rewrite. * commands/loadenv.c (buffer): Removed. (envblk): Likewise. (open_envblk_file): New function. (read_envblk_file): Complete rewrite. (grub_cmd_load_env): Likewise. (grub_cmd_list_env): Likewise. (struct blocklist): New struct. (free_blocklists): New function. (check_blocklists): Likewise. (write_blocklists): Likewise. (grub_cmd_save_env): Complete rewrite. * include/grub/lib/envblk.h (GRUB_ENVBLK_SIGNATURE): Replaced with a plain text signature. (GRUB_ENVBLK_MAXLEN): Removed. (struct grub_envblk): Complete rewrite. (grub_envblk_find): Removed. (grub_envblk_insert): Likewise. (grub_envblk_open): New prototype. (grub_envblk_set): Likewise. (grub_envblk_delete): Put const to VALUE. (grub_envblk_iterate): Put const to NAME and VALUE. (grub_envblk_close): New prototype. (grub_envblk_buffer): New inline function. (grub_envblk_size): Likewise. * lib/envblk.c: Include grub/mm.h. (grub_env_find): Removed. (grub_envblk_open): New function. (grub_envblk_close): Likewise. (escaped_value_len): Likewise. (find_next_line): Likewise. (grub_envblk_insert): Removed. (grub_envblk_set): New function. (grub_envblk_delete): Complete rewrite. (grub_envblk_iterate): Likewise. --- ChangeLog | 60 + commands/loadenv.c | 339 ++- config.h.in | 52 +- configure | 5280 +++++++++++++++++++++---------------- include/grub/lib/envblk.h | 38 +- lib/envblk.c | 342 ++- util/grub-editenv.c | 218 +- 7 files changed, 3685 insertions(+), 2644 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d4a39db0..1c4cefc5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,63 @@ +2009-03-29 Yoshinori K. Okuji + + Make the format of Environment Block plain text. The boot loader + part is not tested well yet. + + * util/grub-editenv.c (DEFAULT_ENVBLK_SIZE): New macro. + (buffer): Removed. + (envblk): Likewise. + (usage): Remove "info" and "clear". Add "unset". Update the + description of "set", as this does not delete variables any + longer. + (create_envblk_file): Complete rewrite. + (open_envblk_file): Likewise. + (cmd_info): Removed. + (cmd_list): Likewise. + (cmd_set): Likewise. + (cmd_clear): Likewise. + (list_variables): New function. + (write_envblk): Likewise. + (set_variables): Likewise. + (unset_variables): Likewise. + (main): Complete rewrite. + + * commands/loadenv.c (buffer): Removed. + (envblk): Likewise. + (open_envblk_file): New function. + (read_envblk_file): Complete rewrite. + (grub_cmd_load_env): Likewise. + (grub_cmd_list_env): Likewise. + (struct blocklist): New struct. + (free_blocklists): New function. + (check_blocklists): Likewise. + (write_blocklists): Likewise. + (grub_cmd_save_env): Complete rewrite. + + * include/grub/lib/envblk.h (GRUB_ENVBLK_SIGNATURE): Replaced with + a plain text signature. + (GRUB_ENVBLK_MAXLEN): Removed. + (struct grub_envblk): Complete rewrite. + (grub_envblk_find): Removed. + (grub_envblk_insert): Likewise. + (grub_envblk_open): New prototype. + (grub_envblk_set): Likewise. + (grub_envblk_delete): Put const to VALUE. + (grub_envblk_iterate): Put const to NAME and VALUE. + (grub_envblk_close): New prototype. + (grub_envblk_buffer): New inline function. + (grub_envblk_size): Likewise. + + * lib/envblk.c: Include grub/mm.h. + (grub_env_find): Removed. + (grub_envblk_open): New function. + (grub_envblk_close): Likewise. + (escaped_value_len): Likewise. + (find_next_line): Likewise. + (grub_envblk_insert): Removed. + (grub_envblk_set): New function. + (grub_envblk_delete): Complete rewrite. + (grub_envblk_iterate): Likewise. + 2009-03-28 Robert Millan * conf/i386-pc.rmk (pkglib_MODULES): Add `linux16.mod'. diff --git a/commands/loadenv.c b/commands/loadenv.c index 8d7c8c907..e7d1b06e4 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -1,7 +1,7 @@ /* loadenv.c - command to load/save environment variable. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -33,13 +33,9 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; -char buffer[GRUB_ENVBLK_MAXLEN]; -grub_envblk_t envblk; - static grub_file_t -read_envblk_file (char *filename, void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector, unsigned offset, unsigned length)) +open_envblk_file (char *filename) { - char *buf = 0; grub_file_t file; if (! filename) @@ -52,11 +48,16 @@ read_envblk_file (char *filename, void NESTED_FUNC_ATTR read_hook (grub_disk_add int len; len = grub_strlen (prefix); - buf = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG)); - grub_strcpy (buf, prefix); - buf[len] = '/'; - grub_strcpy (buf + len + 1, GRUB_ENVBLK_DEFCFG); - filename = buf; + filename = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG)); + if (! filename) + return 0; + + grub_strcpy (filename, prefix); + filename[len] = '/'; + grub_strcpy (filename + len + 1, GRUB_ENVBLK_DEFCFG); + file = grub_file_open (filename); + grub_free (filename); + return file; } else { @@ -65,66 +66,78 @@ read_envblk_file (char *filename, void NESTED_FUNC_ATTR read_hook (grub_disk_add } } - file = grub_file_open (filename); - grub_free (buf); - if (! file) - return 0; + return grub_file_open (filename); +} - if (read_hook) +static grub_envblk_t +read_envblk_file (grub_file_t file) +{ + grub_off_t offset = 0; + char *buf; + grub_size_t size = grub_file_size (file); + grub_envblk_t envblk; + + buf = grub_malloc (size); + if (! buf) + return 0; + + while (size > 0) { - if (! file->device->disk) + grub_ssize_t ret; + + ret = grub_file_read (file, buf + offset, size); + if (ret <= 0) { - grub_file_close (file); - grub_error (GRUB_ERR_BAD_DEVICE, - "this command is available only for disk devices."); + if (grub_errno == GRUB_ERR_NONE) + grub_error (GRUB_ERR_FILE_READ_ERROR, "cannot read"); + grub_free (buf); return 0; } - file->read_hook = read_hook; + + size -= ret; + offset += ret; } - if (grub_file_read (file, buffer, GRUB_ENVBLK_MAXLEN) != GRUB_ENVBLK_MAXLEN) - { - grub_file_close (file); - grub_error (GRUB_ERR_BAD_FILE_TYPE, "file too short"); - return 0; - } - - envblk = grub_envblk_find (buffer); + envblk = grub_envblk_open (buf, offset); if (! envblk) { - grub_file_close (file); - grub_error (GRUB_ERR_BAD_FILE_TYPE, "environment block not found"); + grub_free (buf); + grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block"); return 0; } - return file; + return envblk; } static grub_err_t grub_cmd_load_env (grub_extcmd_t cmd, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) - { struct grub_arg_list *state = cmd->state; grub_file_t file; + grub_envblk_t envblk; - auto int hook (char *name, char *value); - int hook (char *name, char *value) - { - grub_env_set (name, value); - - return 0; - } - - file = read_envblk_file ((state[0].set) ? state[0].arg : 0, 0); + auto int set_var (const char *name, const char *value); + int set_var (const char *name, const char *value) + { + grub_env_set (name, value); + return 0; + } + + file = open_envblk_file ((state[0].set) ? state[0].arg : 0); if (! file) return grub_errno; + envblk = read_envblk_file (file); + if (! envblk) + goto fail; + + grub_envblk_iterate (envblk, set_var); + grub_envblk_close (envblk); + + fail: grub_file_close (file); - - grub_envblk_iterate (envblk, hook); - return grub_errno; } @@ -135,83 +148,207 @@ grub_cmd_list_env (grub_extcmd_t cmd, { struct grub_arg_list *state = cmd->state; grub_file_t file; + grub_envblk_t envblk; - auto int hook (char *name, char *value); - int hook (char *name, char *value) + /* Print all variables in current context. */ + auto int print_var (const char *name, const char *value); + int print_var (const char *name, const char *value) { grub_printf ("%s=%s\n", name, value); - return 0; } - - file = read_envblk_file ((state[0].set) ? state[0].arg : 0, 0); + + file = open_envblk_file ((state[0].set) ? state[0].arg : 0); if (! file) return grub_errno; + envblk = read_envblk_file (file); + if (! envblk) + goto fail; + + grub_envblk_iterate (envblk, print_var); + grub_envblk_close (envblk); + + fail: grub_file_close (file); - - grub_envblk_iterate (envblk, hook); - return grub_errno; } +/* Used to maintain a variable length of blocklists internally. */ +struct blocklist +{ + grub_disk_addr_t sector; + unsigned offset; + unsigned length; + struct blocklist *next; +}; + +static void +free_blocklists (struct blocklist *p) +{ + struct blocklist *q; + + for (; p; p = q) + { + q = p->next; + grub_free (p); + } +} + +static int +check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, + grub_file_t file) +{ + grub_size_t total_length; + grub_size_t index; + grub_disk_t disk; + grub_disk_addr_t part_start; + struct blocklist *p; + char *buf; + + /* Sanity checks. */ + total_length = 0; + for (p = blocklists; p; p = p->next) + { + struct blocklist *q; + for (q = p->next; q; q = q->next) + { + /* Check if any pair of blocks overlap. */ + if (p->sector == q->sector) + { + /* This might be actually valid, but it is unbelievable that + any filesystem makes such a silly allocation. */ + grub_error (GRUB_ERR_BAD_FS, "malformed file"); + return 0; + } + } + + total_length += p->length; + } + + if (total_length != grub_file_size (file)) + { + /* Maybe sparse, unallocated sectors. No way in GRUB. */ + grub_error (GRUB_ERR_BAD_FILE_TYPE, "sparse file not allowed"); + return 0; + } + + /* One more sanity check. Re-read all sectors by blocklists, and compare + those with the data read via a file. */ + disk = file->device->disk; + if (disk->partition) + part_start = grub_partition_get_start (disk->partition); + else + part_start = 0; + + buf = grub_envblk_buffer (envblk); + for (p = blocklists, index = 0; p; p = p->next, index += p->length) + { + char blockbuf[GRUB_DISK_SECTOR_SIZE]; + + if (grub_disk_read (disk, p->sector - part_start, + p->offset, p->length, blockbuf)) + return 0; + + if (grub_memcmp (buf + index, blockbuf, p->length) != 0) + { + grub_error (GRUB_ERR_FILE_READ_ERROR, "invalid blocklist"); + return 0; + } + } + + return 1; +} + +static int +write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, + grub_file_t file) +{ + char *buf; + grub_disk_t disk; + grub_disk_addr_t part_start; + struct blocklist *p; + grub_size_t index; + + buf = grub_envblk_buffer (envblk); + disk = file->device->disk; + if (disk->partition) + part_start = grub_partition_get_start (disk->partition); + else + part_start = 0; + + index = 0; + for (p = blocklists; p; p = p->next, index += p->length) + { + if (grub_disk_write (disk, p->sector - part_start, + p->offset, p->length, buf + index)) + return 0; + } + + return 1; +} + static grub_err_t grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) { struct grub_arg_list *state = cmd->state; grub_file_t file; - grub_disk_t disk; - grub_disk_addr_t addr[GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS]; - char buf[GRUB_DISK_SECTOR_SIZE]; - grub_disk_addr_t part_start = 0; - int num = 0; - - auto void NESTED_FUNC_ATTR hook (grub_disk_addr_t sector, unsigned offset, - unsigned length); - - void NESTED_FUNC_ATTR hook (grub_disk_addr_t sector, - unsigned offset, unsigned length) + grub_envblk_t envblk; + struct blocklist *head = 0; + struct blocklist *tail = 0; + + /* Store blocklists in a linked list. */ + auto void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector, + unsigned offset, + unsigned length); + void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector, + unsigned offset, unsigned length) { - if ((offset != 0) || (length != GRUB_DISK_SECTOR_SIZE)) + struct blocklist *block; + + if (offset + length > GRUB_DISK_SECTOR_SIZE) + /* Seemingly a bug. */ + return; + + block = grub_malloc (sizeof (*block)); + if (! block) return; - if (num < (GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS)) - addr[num++] = sector; + block->sector = sector; + block->offset = offset; + block->length = length; + + /* Slightly complicated, because the list should be FIFO. */ + block->next = 0; + if (tail) + tail->next = block; + tail = block; + if (! head) + head = block; } if (! argc) return grub_error (GRUB_ERR_BAD_ARGUMENT, "No variable is specified"); - file = read_envblk_file ((state[0].set) ? state[0].arg : 0, hook); + file = open_envblk_file ((state[0].set) ? state[0].arg : 0); if (! file) return grub_errno; + if (! file->device->disk) + { + grub_file_close (file); + return grub_error (GRUB_ERR_BAD_DEVICE, "disk device required"); + } + + file->read_hook = read_hook; + envblk = read_envblk_file (file); file->read_hook = 0; + if (! envblk) + goto fail; - if (num != GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS) - { - grub_error (GRUB_ERR_BAD_DEVICE, "invalid blocklist"); - goto quit; - } - - disk = file->device->disk; - if (disk->partition) - part_start = grub_partition_get_start (disk->partition); - - for (num = 0; num < (GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS); num++) - { - if (grub_disk_read (disk, addr[num] - part_start, 0, - GRUB_DISK_SECTOR_SIZE, buf)) - goto quit; - - if (grub_memcmp (&buffer[num << GRUB_DISK_SECTOR_BITS], buf, - GRUB_DISK_SECTOR_SIZE)) - { - grub_error (GRUB_ERR_BAD_DEVICE, "invalid blocklist"); - goto quit; - } - } - + if (! check_blocklists (envblk, head, file)) + goto fail; + while (argc) { char *value; @@ -219,10 +356,10 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) value = grub_env_get (args[0]); if (value) { - if (grub_envblk_insert (envblk, args[0], value)) + if (! grub_envblk_set (envblk, args[0], value)) { grub_error (GRUB_ERR_BAD_ARGUMENT, "environment block too small"); - goto quit; + goto fail; } } @@ -230,15 +367,13 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) args++; } - for (num = 0; num < (GRUB_ENVBLK_MAXLEN >> GRUB_DISK_SECTOR_BITS); num++) - if (grub_disk_write (disk, addr[num] - part_start, 0, - GRUB_DISK_SECTOR_SIZE, - &buffer[num << GRUB_DISK_SECTOR_BITS])) - goto quit; - -quit: + write_blocklists (envblk, head, file); + + fail: + if (envblk) + grub_envblk_close (envblk); + free_blocklists (head); grub_file_close (file); - return grub_errno; } diff --git a/config.h.in b/config.h.in index c110d6307..a5234009b 100644 --- a/config.h.in +++ b/config.h.in @@ -4,6 +4,9 @@ prefixed with an asterisk */ #undef ABSOLUTE_WITHOUT_ASTERISK +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define it to \"addr32\" or \"addr32;\" to make GAS happy */ #undef ADDR32 @@ -112,17 +115,52 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE diff --git a/configure b/configure index 128317982..b717572bb 100644 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for GRUB 1.96. +# Generated by GNU Autoconf 2.63 for GRUB 1.96. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -39,17 +39,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -65,8 +93,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -89,7 +115,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -102,17 +128,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -134,7 +153,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -160,7 +179,7 @@ else as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -242,7 +261,7 @@ IFS=$as_save_IFS if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -263,7 +282,7 @@ _ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -343,10 +362,10 @@ fi if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -415,9 +434,10 @@ fi test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -453,7 +473,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -481,7 +501,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -494,19 +513,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -531,10 +553,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -615,104 +637,116 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -host_kernel -platform -CMP -YACC -UNIFONT_BDF -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -AWK -SET_MAKE -RUBY -HELP2MAN -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -GREP -EGREP -LIBLZO -enable_lzo -TARGET_IMG_LDSCRIPT -TARGET_IMG_LDFLAGS -TARGET_OBJ2ELF -TARGET_CC -ac_ct_TARGET_CC -OBJCOPY -STRIP -NM -TARGET_CFLAGS -TARGET_CPPFLAGS -TARGET_LDFLAGS -MODULE_LDFLAGS -LIBCURSES +ac_subst_vars='LTLIBOBJS +LIBOBJS +freetype_libs +freetype_cflags +enable_grub_mkfont +FREETYPE +enable_grub_pe2elf +enable_grub_fstest +enable_grub_emu_usb +enable_grub_emu LIBUSB +LIBCURSES +MODULE_LDFLAGS +TARGET_LDFLAGS +TARGET_CPPFLAGS +TARGET_CFLAGS +NM +STRIP +OBJCOPY +ac_ct_TARGET_CC +TARGET_CC +TARGET_OBJ2ELF +TARGET_IMG_LDFLAGS +TARGET_IMG_LDSCRIPT +enable_lzo +LIBLZO +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +HELP2MAN +RUBY +SET_MAKE +AWK +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +UNIFONT_BDF +YACC +CMP +platform +host_kernel +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_platform +enable_largefile +enable_lzo +enable_mm_debug enable_grub_emu enable_grub_emu_usb enable_grub_fstest enable_grub_pe2elf -FREETYPE enable_grub_mkfont -freetype_cflags -freetype_libs -LIBOBJS -LTLIBOBJS' -ac_subst_files='' +' ac_precious_vars='build_alias host_alias target_alias @@ -727,6 +761,8 @@ CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -825,13 +861,21 @@ do datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -844,13 +888,21 @@ do dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1041,22 +1093,38 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1076,7 +1144,7 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1085,16 +1153,16 @@ Try \`$0 --help' for more information." >&2 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1103,22 +1171,38 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1133,7 +1217,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1149,10 +1233,10 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1160,12 +1244,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" || if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1192,12 +1276,12 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1246,9 +1330,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1258,25 +1342,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/grub] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/grub] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1300,6 +1384,7 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files @@ -1341,15 +1426,17 @@ fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1385,7 +1472,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1395,10 +1482,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GRUB configure 1.96 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1409,7 +1496,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1445,7 +1532,7 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1480,7 +1567,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1532,11 +1619,12 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1566,9 +1654,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1583,9 +1671,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1601,8 +1689,8 @@ _ASBOX echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1644,21 +1732,24 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1668,16 +1759,16 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1691,29 +1782,38 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1723,10 +1823,12 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1784,8 +1886,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -1800,34 +1902,34 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -1844,27 +1946,27 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -1881,27 +1983,27 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target @@ -1931,13 +2033,10 @@ test "$program_prefix" != NONE && # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. +# Double any \ or $. # By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` case "$host_cpu" in @@ -1966,8 +2065,8 @@ if test "x$with_platform" = x; then powerpc-*) platform=ieee1275 ;; powerpc64-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; - *) { { echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 -echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 +$as_echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac else @@ -1993,8 +2092,8 @@ case "$target_cpu"-"$platform" in i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; - *) { { echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 -echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 +$as_echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -2034,10 +2133,10 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CMP"; then ac_cv_prog_CMP="$CMP" # Let the user override the test. @@ -2050,7 +2149,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CMP="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2061,11 +2160,11 @@ fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - { echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6; } + { $as_echo "$as_me:$LINENO: result: $CMP" >&5 +$as_echo "$CMP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2073,8 +2172,8 @@ fi done if test "x$CMP" = x; then - { { echo "$as_me:$LINENO: error: cmp is not found" >&5 -echo "$as_me: error: cmp is not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: cmp is not found" >&5 +$as_echo "$as_me: error: cmp is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2082,10 +2181,10 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2098,7 +2197,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2109,11 +2208,11 @@ fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } + { $as_echo "$as_me:$LINENO: result: $YACC" >&5 +$as_echo "$YACC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2121,8 +2220,8 @@ fi done if test "x$YACC" = x; then - { { echo "$as_me:$LINENO: error: bison is not found" >&5 -echo "$as_me: error: bison is not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: bison is not found" >&5 +$as_echo "$as_me: error: bison is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2147,11 +2246,12 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2180,17 +2280,29 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2203,8 +2315,8 @@ fi INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2218,10 +2330,10 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2234,7 +2346,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2245,22 +2357,23 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi test -n "$AWK" && break done -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh @@ -2277,12 +2390,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SET_MAKE= else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2290,10 +2403,10 @@ fi # These are not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_RUBY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $RUBY in [\\/]* | ?:[\\/]*) @@ -2308,7 +2421,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2320,20 +2433,20 @@ esac fi RUBY=$ac_cv_path_RUBY if test -n "$RUBY"; then - { echo "$as_me:$LINENO: result: $RUBY" >&5 -echo "${ECHO_T}$RUBY" >&6; } + { $as_echo "$as_me:$LINENO: result: $RUBY" >&5 +$as_echo "$RUBY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "help2man", so it can be a program name with args. set dummy help2man; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_HELP2MAN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $HELP2MAN in [\\/]* | ?:[\\/]*) @@ -2348,7 +2461,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2360,11 +2473,11 @@ esac fi HELP2MAN=$ac_cv_path_HELP2MAN if test -n "$HELP2MAN"; then - { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 -echo "${ECHO_T}$HELP2MAN" >&6; } + { $as_echo "$as_me:$LINENO: result: $HELP2MAN" >&5 +$as_echo "$HELP2MAN" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2381,10 +2494,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2397,7 +2510,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2408,11 +2521,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2421,10 +2534,10 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2437,7 +2550,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2448,11 +2561,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2460,12 +2573,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2478,10 +2587,10 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2494,7 +2603,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2505,11 +2614,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2518,10 +2627,10 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2539,7 +2648,7 @@ do continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2562,11 +2671,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2577,10 +2686,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2593,7 +2702,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2604,11 +2713,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2621,10 +2730,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2637,7 +2746,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2648,11 +2757,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2664,12 +2773,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2679,44 +2784,50 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2735,27 +2846,22 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2766,10 +2872,11 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2780,7 +2887,7 @@ for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2807,25 +2914,27 @@ else ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2834,49 +2943,53 @@ if test "$cross_compiling" != yes; then *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2885,31 +2998,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2932,40 +3047,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2991,20 +3109,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -3014,15 +3133,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3049,20 +3172,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3087,20 +3211,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3126,20 +3251,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3154,8 +3280,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3171,10 +3297,10 @@ else CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3245,20 +3371,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3274,15 +3401,15 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3293,383 +3420,25 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Must be GCC. -test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5 -echo "$as_me: error: GCC is required" >&2;} +test "x$GCC" = xyes || { { $as_echo "$as_me:$LINENO: error: GCC is required" >&5 +$as_echo "$as_me: error: GCC is required" >&2;} { (exit 1); exit 1; }; } -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -f conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -f conftest* - fi -fi - - -# Identify characteristics of the host architecture. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3701,20 +3470,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3738,13 +3508,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3752,7 +3523,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3777,8 +3548,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3806,20 +3577,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3843,13 +3615,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3857,7 +3630,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3873,11 +3646,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3887,42 +3662,37 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3937,74 +3707,60 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -4019,40 +3775,31 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_EGREP=$EGREP fi - fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4079,20 +3826,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -4184,37 +3932,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4236,11 +3987,11 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4258,20 +4009,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -4279,12 +4031,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -4292,28 +4047,183 @@ fi done -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + + if test "${ac_cv_header_minix_config_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } else - # See if sys/param.h defines the BYTE_ORDER macro. + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +$as_echo_n "checking minix/config.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-grub@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_minix_config_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } + +fi +if test "x$ac_cv_header_minix_config_h" = x""yes; then + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif ; return 0; @@ -4325,33 +4235,521 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + $as_echo_n "(cached) " >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + $as_echo_n "(cached) " >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi +fi + + +# Identify characteristics of the host architecture. + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif + not big endian + #endif ; return 0; @@ -4363,20 +4761,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -4384,29 +4783,31 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#include + int main () { - _ascii (); _ebcdic (); +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + ; return 0; } @@ -4417,30 +4818,139 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4459,14 +4969,14 @@ int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -4478,118 +4988,71 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} +;; #( + no) + ;; #( + universal) + +cat >>confdefs.h <<\_ACEOF +#define AC_APPLE_UNIVERSAL_BUILD 1 +_ACEOF + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac - -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } + esac # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -4600,11 +5063,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -4617,13 +5079,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4637,11 +5100,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4654,20 +5116,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -4681,7 +5144,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -4691,11 +5154,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -4708,13 +5170,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4728,11 +5191,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4745,20 +5207,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -4772,7 +5235,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -4792,11 +5255,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4809,20 +5271,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -4833,11 +5296,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -4850,9 +5315,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (void *)); } +static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int @@ -4862,20 +5326,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (void *))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -4888,43 +5354,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } @@ -4933,68 +5404,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -5005,11 +5422,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -5022,13 +5438,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5042,11 +5459,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5059,20 +5475,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -5086,7 +5503,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -5096,11 +5513,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -5113,13 +5529,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5133,11 +5550,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5150,20 +5566,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -5177,7 +5594,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -5197,11 +5614,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5214,20 +5630,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -5238,11 +5655,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi ;; @@ -5255,9 +5674,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -5267,20 +5685,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -5293,43 +5713,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } @@ -5360,10 +5785,10 @@ cat >>confdefs.h <<\_ACEOF #define ENABLE_LZO 1 _ACEOF - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +$as_echo_n "checking for __lzo_init_v2 in -llzo2... " >&6; } if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" @@ -5395,39 +5820,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lzo2___lzo_init_v2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo2___lzo_init_v2=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } -if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +$as_echo "$ac_cv_lib_lzo2___lzo_init_v2" >&6; } +if test "x$ac_cv_lib_lzo2___lzo_init_v2" = x""yes; then LIBLZO="-llzo2" else - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +$as_echo_n "checking for __lzo_init_v2 in -llzo... " >&6; } if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5459,39 +5888,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lzo___lzo_init_v2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init_v2=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } -if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +$as_echo "$ac_cv_lib_lzo___lzo_init_v2" >&6; } +if test "x$ac_cv_lib_lzo___lzo_init_v2" = x""yes; then LIBLZO="-llzo" else - { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +$as_echo_n "checking for __lzo_init2 in -llzo... " >&6; } if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5523,37 +5956,41 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lzo___lzo_init2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init2=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } -if test $ac_cv_lib_lzo___lzo_init2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +$as_echo "$ac_cv_lib_lzo___lzo_init2" >&6; } +if test "x$ac_cv_lib_lzo___lzo_init2" = x""yes; then LIBLZO="-llzo" else - { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 -echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} + { { $as_echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 +$as_echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} { (exit 1); exit 1; }; } fi @@ -5563,10 +6000,10 @@ fi LIBS="$LIBS $LIBLZO" - { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +$as_echo_n "checking for lzo1x_999_compress... " >&6; } if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5619,36 +6056,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_lzo1x_999_compress=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_lzo1x_999_compress=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } -if test $ac_cv_func_lzo1x_999_compress = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +$as_echo "$ac_cv_func_lzo1x_999_compress" >&6; } +if test "x$ac_cv_func_lzo1x_999_compress" = x""yes; then : else - { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 -echo "$as_me: error: LZO1X-999 must be enabled" >&2;} + { { $as_echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 +$as_echo "$as_me: error: LZO1X-999 must be enabled" >&2;} { (exit 1); exit 1; }; } fi @@ -5658,20 +6099,21 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5687,32 +6129,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5726,51 +6169,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -5779,21 +6223,24 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5816,11 +6263,11 @@ fi for ac_func in posix_memalign memalign asprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5873,35 +6320,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -5914,8 +6368,8 @@ done # Use linker script if present, otherwise use builtin -N script. -{ echo "$as_me:$LINENO: checking for option to link raw image" >&5 -echo $ECHO_N "checking for option to link raw image... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for option to link raw image" >&5 +$as_echo_n "checking for option to link raw image... " >&6; } if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" @@ -5927,19 +6381,19 @@ else fi -{ echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 -echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 +$as_echo "$TARGET_IMG_LDFLAGS_AC" >&6; } # For platforms where ELF is not the default link format. -{ echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 -echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 +$as_echo_n "checking for command to convert module to ELF format... " >&6; } case "${host_os}" in cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; *) ;; esac -{ echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 -echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } +{ $as_echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 +$as_echo "$TARGET_OBJ2ELF" >&6; } # For cross-compiling. if test "x$build" != "x$host"; then @@ -5952,10 +6406,10 @@ if test "x$build" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_TARGET_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$TARGET_CC"; then ac_cv_prog_TARGET_CC="$TARGET_CC" # Let the user override the test. @@ -5968,7 +6422,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5979,11 +6433,11 @@ fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +$as_echo "$TARGET_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5996,10 +6450,10 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_TARGET_CC"; then ac_cv_prog_ac_ct_TARGET_CC="$ac_ct_TARGET_CC" # Let the user override the test. @@ -6012,7 +6466,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6023,11 +6477,11 @@ fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +$as_echo "$ac_ct_TARGET_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6035,18 +6489,14 @@ fi done if test "x$ac_ct_TARGET_CC" = x; then - TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 -echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} + TARGET_CC="{ { $as_echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 +$as_echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac TARGET_CC=$ac_ct_TARGET_CC @@ -6056,10 +6506,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6072,7 +6522,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6083,11 +6533,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6096,10 +6546,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6112,7 +6562,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6123,11 +6573,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6135,12 +6585,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6152,10 +6598,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6168,7 +6614,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6179,11 +6625,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6192,10 +6638,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6208,7 +6654,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6219,11 +6665,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6231,12 +6677,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6248,10 +6690,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6264,7 +6706,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6275,11 +6717,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $NM" >&5 +$as_echo "$NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6288,10 +6730,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -6304,7 +6746,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6315,11 +6757,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -6327,12 +6769,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -6350,10 +6788,10 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6366,7 +6804,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6377,11 +6815,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6390,10 +6828,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6406,7 +6844,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6417,11 +6855,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6429,12 +6867,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6446,10 +6880,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6462,7 +6896,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6473,11 +6907,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6486,10 +6920,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6502,7 +6936,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6513,11 +6947,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6525,12 +6959,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6542,10 +6972,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6558,7 +6988,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6569,11 +6999,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $NM" >&5 +$as_echo "$NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6582,10 +7012,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -6598,7 +7028,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6609,11 +7039,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -6621,12 +7051,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -6657,10 +7083,10 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +$as_echo_n "checking whether optimization for size works... " >&6; } if test "${grub_cv_cc_Os+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS=-Os @@ -6685,20 +7111,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_Os=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_Os=no @@ -6707,8 +7134,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 -echo "${ECHO_T}$grub_cv_cc_Os" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 +$as_echo "$grub_cv_cc_Os" >&6; } if test "x$grub_cv_cc_Os" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -6717,10 +7144,10 @@ echo "${ECHO_T}$grub_cv_cc_Os" >&6; } # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +$as_echo_n "checking whether -falign-loops works... " >&6; } if test "${grub_cv_cc_falign_loop+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS="-falign-loops=1" @@ -6745,20 +7172,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_falign_loop=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_falign_loop=no @@ -6767,8 +7195,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 -echo "${ECHO_T}$grub_cv_cc_falign_loop" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 +$as_echo "$grub_cv_cc_falign_loop" >&6; } if test "x$grub_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -6792,10 +7220,10 @@ fi if test "$target_cpu"-"$platform" = x86_64-efi; then # Use large model to support 4G memory - { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 -echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 +$as_echo_n "checking whether option -mcmodel=large works... " >&6; } if test "${grub_cv_cc_mcmodel+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS="-m64 -mcmodel=large" @@ -6820,20 +7248,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_mcmodel=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_mcmodel=no @@ -6842,19 +7271,19 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 -echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 +$as_echo "$grub_cv_cc_mcmodel" >&6; } if test "x$grub_cv_cc_no_mcmodel" = xno; then - { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 -echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} + { { $as_echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 +$as_echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi # EFI writes to stack below %rsp, we must not use the red zone - { echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 -echo $ECHO_N "checking whether option -mno-red-zone works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 +$as_echo_n "checking whether option -mno-red-zone works... " >&6; } if test "${grub_cv_cc_no_red_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS="-m64 -mno-red-zone" @@ -6879,20 +7308,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_no_red_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_no_red_zone=no @@ -6901,11 +7331,11 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 -echo "${ECHO_T}$grub_cv_cc_no_red_zone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 +$as_echo "$grub_cv_cc_no_red_zone" >&6; } if test "x$grub_cv_cc_no_red_zone" = xno; then - { { echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 -echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} + { { $as_echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 +$as_echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi @@ -6918,8 +7348,8 @@ fi # Need __enable_execute_stack() for nested function trampolines? -{ echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 -echo $ECHO_N "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 +$as_echo_n "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... " >&6; } cat >conftest.$ac_ext <<_ACEOF void f (int (*p) (void)); @@ -6934,12 +7364,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then @@ -6948,11 +7378,11 @@ cat >>confdefs.h <<\_ACEOF #define NEED_ENABLE_EXECUTE_STACK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f conftest* @@ -6961,8 +7391,8 @@ rm -f conftest* # Smashing stack protector. ssp_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +$as_echo_n "checking whether \`$CC' accepts \`-fstack-protector'... " >&6; } # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -6970,14 +7400,14 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Need that, because some distributions ship compilers that include @@ -6988,20 +7418,20 @@ fi # Smashing stack arg probe. sap_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-mstack-arg-probe'... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 +$as_echo_n "checking whether \`$CC' accepts \`-mstack-arg-probe'... " >&6; } cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } _ACEOF if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else sap_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Cygwin's GCC uses alloca() to probe the stackframe on static @@ -7022,10 +7452,10 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -{ echo "$as_me:$LINENO: checking whether target compiler is working" >&5 -echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether target compiler is working" >&5 +$as_echo_n "checking whether target compiler is working... " >&6; } if test "${grub_cv_prog_target_cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7048,44 +7478,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_prog_target_cc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_target_cc=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 -echo "${ECHO_T}$grub_cv_prog_target_cc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 +$as_echo "$grub_cv_prog_target_cc" >&6; } if test "x$grub_cv_prog_target_cc" = xno; then - { { echo "$as_me:$LINENO: error: cannot compile for the target" >&5 -echo "$as_me: error: cannot compile for the target" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot compile for the target" >&5 +$as_echo "$as_me: error: cannot compile for the target" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +$as_echo_n "checking whether ${OBJCOPY} works for absolute addresses... " >&6; } if test "${grub_cv_prog_objcopy_absolute+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.c <<\EOF void @@ -7098,11 +7532,11 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest.o; then : else - { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 -echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 +$as_echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} { (exit 1); exit 1; }; } fi grub_cv_prog_objcopy_absolute=yes @@ -7111,29 +7545,29 @@ for link_addr in 2000 8000 7C00; do { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 -echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 +$as_echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} { (exit 1); exit 1; }; } fi if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 -echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 +$as_echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} { (exit 1); exit 1; }; } fi if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mv -f conftest conftest.old else @@ -7144,19 +7578,19 @@ done rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +$as_echo "$grub_cv_prog_objcopy_absolute" >&6; } if test "x$grub_cv_prog_objcopy_absolute" = xno; then - { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 -echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} + { { $as_echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 +$as_echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 -echo $ECHO_N "checking whether linker accepts --build-id=none... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 +$as_echo_n "checking whether linker accepts --build-id=none... " >&6; } if test "${grub_cv_prog_ld_build_id_none+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" @@ -7181,44 +7615,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_prog_ld_build_id_none=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_ld_build_id_none=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 -echo "${ECHO_T}$grub_cv_prog_ld_build_id_none" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 +$as_echo "$grub_cv_prog_ld_build_id_none" >&6; } if test "x$grub_cv_prog_ld_build_id_none" = xyes; then MODULE_LDFLAGS="$MODULE_LDFLAGS -Wl,--build-id=none" fi -{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +$as_echo_n "checking if C symbols get an underscore after compilation... " >&6; } if test "${grub_cv_asm_uscore+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.c <<\EOF int @@ -7233,12 +7671,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi @@ -7260,8 +7698,8 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +$as_echo "$grub_cv_asm_uscore" >&6; } if test "x$target_cpu" = xi386; then if test ! -z "$TARGET_IMG_LDSCRIPT"; then @@ -7270,10 +7708,10 @@ if test "x$target_cpu" = xi386; then fi if test "x$platform" = xpc; then -{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +$as_echo_n "checking if __bss_start is defined by the compiler... " >&6; } if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7296,38 +7734,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_uscore_bss_start_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +$as_echo "$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } -{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +$as_echo_n "checking if edata is defined by the compiler... " >&6; } if test "${grub_cv_check_edata_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7350,38 +7792,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_edata_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_edata_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +$as_echo "$grub_cv_check_edata_symbol" >&6; } -{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +$as_echo_n "checking if _edata is defined by the compiler... " >&6; } if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7404,33 +7850,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_uscore_edata_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_edata_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +$as_echo "$grub_cv_check_uscore_edata_symbol" >&6; } @@ -7451,16 +7901,16 @@ elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then _ACEOF else - { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 -echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} + { { $as_echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 +$as_echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +$as_echo_n "checking if end is defined by the compiler... " >&6; } if test "${grub_cv_check_end_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7483,38 +7933,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_end_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_end_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +$as_echo "$grub_cv_check_end_symbol" >&6; } -{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +$as_echo_n "checking if _end is defined by the compiler... " >&6; } if test "${grub_cv_check_uscore_end_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7537,33 +7991,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_uscore_end_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_end_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +$as_echo "$grub_cv_check_uscore_end_symbol" >&6; } @@ -7579,18 +8037,18 @@ elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then _ACEOF else - { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 -echo "$as_me: error: neither end nor _end is defined" >&2;} + { { $as_echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 +$as_echo "$as_me: error: neither end nor _end is defined" >&2;} { (exit 1); exit 1; }; } fi fi CFLAGS="$TARGET_CFLAGS" -{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +$as_echo_n "checking whether addr32 must be in the same line as the instruction... " >&6; } if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.s <<\EOF .code16 @@ -7601,7 +8059,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_prefix_requirement=yes else @@ -7631,14 +8089,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +$as_echo "$grub_cv_i386_asm_prefix_requirement" >&6; } -{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +$as_echo_n "checking for .code16 addr32 assembler support... " >&6; } if test "${grub_cv_i386_asm_addr32+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.s.in <<\EOF .code16 @@ -7655,7 +8113,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_addr32=yes else @@ -7666,13 +8124,13 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +$as_echo "$grub_cv_i386_asm_addr32" >&6; } -{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +$as_echo_n "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... " >&6; } if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.s <<\EOF lcall *(offset) @@ -7685,7 +8143,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_absolute_without_asterisk=no else @@ -7704,20 +8162,22 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +$as_echo "$grub_cv_i386_asm_absolute_without_asterisk" >&6; } -{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +$as_echo_n "checking if GCC has the regparm=3 bug... " >&6; } if test "${grub_cv_i386_check_nested_functions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - { { echo "$as_me:$LINENO: error: cannot run test program while cross compiling + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run test program while cross compiling +$as_echo "$as_me: error: cannot run test program while cross compiling See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7758,29 +8218,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then grub_cv_i386_check_nested_functions=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -7788,8 +8251,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +$as_echo "$grub_cv_i386_check_nested_functions" >&6; } if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -7808,7 +8271,7 @@ fi else cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR +#define NESTED_FUNC_ATTR /**/ _ACEOF fi @@ -7847,10 +8310,10 @@ fi if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +$as_echo_n "checking for wgetch in -lncurses... " >&6; } if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" @@ -7882,39 +8345,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ncurses_wgetch=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses_wgetch=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } -if test $ac_cv_lib_ncurses_wgetch = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +$as_echo "$ac_cv_lib_ncurses_wgetch" >&6; } +if test "x$ac_cv_lib_ncurses_wgetch" = x""yes; then LIBCURSES="-lncurses" else - { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +$as_echo_n "checking for wgetch in -lcurses... " >&6; } if test "${ac_cv_lib_curses_wgetch+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" @@ -7946,37 +8413,41 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_curses_wgetch=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curses_wgetch=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } -if test $ac_cv_lib_curses_wgetch = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +$as_echo "$ac_cv_lib_curses_wgetch" >&6; } +if test "x$ac_cv_lib_curses_wgetch" = x""yes; then LIBCURSES="-lcurses" else - { { echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 -echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} + { { $as_echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 +$as_echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -7988,20 +8459,21 @@ fi for ac_header in ncurses/curses.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8017,32 +8489,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8056,51 +8529,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8109,41 +8583,45 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in ncurses.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8159,32 +8637,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8198,51 +8677,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8251,41 +8731,45 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in curses.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8301,32 +8785,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8340,51 +8825,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8393,26 +8879,29 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 -echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} + { { $as_echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 +$as_echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -8429,10 +8918,10 @@ done if [ x"$enable_grub_emu_usb" = xyes ]; then # Check for libusb libraries. - { echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 -echo $ECHO_N "checking for usb_claim_interface in -lusb... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 +$as_echo_n "checking for usb_claim_interface in -lusb... " >&6; } if test "${ac_cv_lib_usb_usb_claim_interface+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusb $LIBS" @@ -8464,37 +8953,41 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_usb_usb_claim_interface=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_usb_usb_claim_interface=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 -echo "${ECHO_T}$ac_cv_lib_usb_usb_claim_interface" >&6; } -if test $ac_cv_lib_usb_usb_claim_interface = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 +$as_echo "$ac_cv_lib_usb_usb_claim_interface" >&6; } +if test "x$ac_cv_lib_usb_usb_claim_interface" = x""yes; then LIBUSB="-lusb" else - { { echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 -echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} + { { $as_echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 +$as_echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -8504,20 +8997,21 @@ fi for ac_header in usb.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8533,32 +9027,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8572,51 +9067,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8625,26 +9121,29 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 -echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} + { { $as_echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 +$as_echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -8680,10 +9179,10 @@ if test x"$enable_grub_mkfont" = xyes ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_FREETYPE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$FREETYPE"; then ac_cv_prog_FREETYPE="$FREETYPE" # Let the user override the test. @@ -8696,7 +9195,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_FREETYPE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8707,11 +9206,11 @@ fi fi FREETYPE=$ac_cv_prog_FREETYPE if test -n "$FREETYPE"; then - { echo "$as_me:$LINENO: result: $FREETYPE" >&5 -echo "${ECHO_T}$FREETYPE" >&6; } + { $as_echo "$as_me:$LINENO: result: $FREETYPE" >&5 +$as_echo "$FREETYPE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -8719,8 +9218,8 @@ fi done if test "x$FREETYPE" = x ; then - { { echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 -echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} + { { $as_echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 +$as_echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} { (exit 1); exit 1; }; } fi freetype_cflags=`freetype-config --cflags` @@ -8732,21 +9231,21 @@ fi # Output files. -{ echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 -echo $ECHO_N "checking whether ln can handle directories properly... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 +$as_echo_n "checking whether ln can handle directories properly... " >&6; } mkdir testdir 2>/dev/null case $srcdir in [\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; *) reldir=../$srcdir/include/grub/util ;; esac if ln -s $reldir testdir/util 2>/dev/null ; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } link_dir=yes else link_dir=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -rf testdir @@ -8791,11 +9290,12 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -8828,12 +9328,12 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -8849,7 +9349,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -8861,12 +9361,14 @@ LTLIBOBJS=$ac_ltlibobjs + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -8879,7 +9381,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -8889,7 +9391,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -8911,17 +9413,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -8937,8 +9467,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -8961,7 +9489,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -8974,17 +9502,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -9006,7 +9527,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -9057,7 +9578,7 @@ $as_unset CDPATH s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -9085,7 +9606,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -9098,19 +9618,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -9135,10 +9658,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -9161,7 +9684,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9174,30 +9697,40 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_links="$ac_config_links" +config_files="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" +config_links="`echo $ac_config_links`" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -9211,24 +9744,25 @@ $config_links Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -9250,30 +9784,36 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -9292,30 +9832,32 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -9329,8 +9871,8 @@ do "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -9371,159 +9913,143 @@ $debug || (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF - +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -host_kernel!$host_kernel$ac_delim -platform!$platform$ac_delim -CMP!$CMP$ac_delim -YACC!$YACC$ac_delim -UNIFONT_BDF!$UNIFONT_BDF$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -RUBY!$RUBY$ac_delim -HELP2MAN!$HELP2MAN$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LIBLZO!$LIBLZO$ac_delim -enable_lzo!$enable_lzo$ac_delim -TARGET_IMG_LDSCRIPT!$TARGET_IMG_LDSCRIPT$ac_delim -TARGET_IMG_LDFLAGS!$TARGET_IMG_LDFLAGS$ac_delim -TARGET_OBJ2ELF!$TARGET_OBJ2ELF$ac_delim -TARGET_CC!$TARGET_CC$ac_delim -ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim -OBJCOPY!$OBJCOPY$ac_delim -STRIP!$STRIP$ac_delim -NM!$NM$ac_delim -TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim -TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim -TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim -MODULE_LDFLAGS!$MODULE_LDFLAGS$ac_delim -LIBCURSES!$LIBCURSES$ac_delim -LIBUSB!$LIBUSB$ac_delim -enable_grub_emu!$enable_grub_emu$ac_delim -enable_grub_emu_usb!$enable_grub_emu_usb$ac_delim -enable_grub_fstest!$enable_grub_fstest$ac_delim -enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim -FREETYPE!$FREETYPE$ac_delim -enable_grub_mkfont!$enable_grub_mkfont$ac_delim -freetype_cflags!$freetype_cflags$ac_delim -freetype_libs!$freetype_libs$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 97; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and @@ -9540,19 +10066,133 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS " +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -9581,26 +10221,38 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -9610,7 +10262,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9636,7 +10288,7 @@ echo X"$ac_file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -9645,7 +10297,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9666,17 +10318,17 @@ echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -9716,12 +10368,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -9730,13 +10383,14 @@ case `sed -n '/datarootdir/ { /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -9750,15 +10404,16 @@ _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -9768,146 +10423,94 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; :L) # # CONFIG_LINK # - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi - if test ! -r "$srcdir/$ac_source"; then - { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 -echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} + { $as_echo "$as_me:$LINENO: linking $ac_source to $ac_file" >&5 +$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + { { $as_echo "$as_me:$LINENO: error: $ac_source: file not found" >&5 +$as_echo "$as_me: error: $ac_source: file not found" >&2;} + { (exit 1); exit 1; }; } + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $srcdir in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + { { $as_echo "$as_me:$LINENO: error: cannot link or copy $ac_source to $ac_file" >&5 +$as_echo "$as_me: error: cannot link or copy $ac_source to $ac_file" >&2;} { (exit 1); exit 1; }; } fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $srcdir in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || - cp -p "$srcdir/$ac_source" "$ac_file" || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; esac @@ -9925,6 +10528,11 @@ _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -9946,4 +10554,8 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi diff --git a/include/grub/lib/envblk.h b/include/grub/lib/envblk.h index 5c1157e8f..368ba5368 100644 --- a/include/grub/lib/envblk.h +++ b/include/grub/lib/envblk.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,27 +19,37 @@ #ifndef GRUB_ENVBLK_HEADER #define GRUB_ENVBLK_HEADER 1 -#define GRUB_ENVBLK_SIGNATURE 0x764e6547 /* GeNv */ - -#define GRUB_ENVBLK_MAXLEN 8192 - +#define GRUB_ENVBLK_SIGNATURE "# GRUB Environment Block\n" #define GRUB_ENVBLK_DEFCFG "grubenv" #ifndef ASM_FILE struct grub_envblk { - grub_uint32_t signature; - grub_uint16_t length; - char data[0]; -} __attribute__ ((packed)); + char *buf; + grub_size_t size; +}; typedef struct grub_envblk *grub_envblk_t; -grub_envblk_t grub_envblk_find (char *buf); -int grub_envblk_insert (grub_envblk_t envblk, char *name, char *value); -void grub_envblk_delete (grub_envblk_t envblk, char *name); -void grub_envblk_iterate (grub_envblk_t envblk, int hook (char *name, char *value)); +grub_envblk_t grub_envblk_open (char *buf, grub_size_t size); +int grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value); +void grub_envblk_delete (grub_envblk_t envblk, const char *name); +void grub_envblk_iterate (grub_envblk_t envblk, + int hook (const char *name, const char *value)); +void grub_envblk_close (grub_envblk_t envblk); -#endif +static inline char * +grub_envblk_buffer (const grub_envblk_t envblk) +{ + return envblk->buf; +} + +static inline grub_size_t +grub_envblk_size (const grub_envblk_t envblk) +{ + return envblk->size; +} + +#endif /* ! ASM_FILE */ #endif /* ! GRUB_ENVBLK_HEADER */ diff --git a/lib/envblk.c b/lib/envblk.c index 6618d97f6..f15c9e1e4 100644 --- a/lib/envblk.c +++ b/lib/envblk.c @@ -1,7 +1,7 @@ -/* envblk.c - Common function for environment block. */ +/* envblk.c - Common functions for environment block. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,137 +20,277 @@ #include #include #include +#include #include grub_envblk_t -grub_envblk_find (char *buf) +grub_envblk_open (char *buf, grub_size_t size) { - grub_uint32_t *pd; - int len; + grub_envblk_t envblk; - pd = (grub_uint32_t *) buf; - - for (len = GRUB_ENVBLK_MAXLEN - 6; len > 0; len -= 4, pd++) - if (*pd == GRUB_ENVBLK_SIGNATURE) - { - grub_envblk_t p; - - p = (grub_envblk_t) pd; - if (p->length <= len) - return p; - } - - return 0; -} - -int -grub_envblk_insert (grub_envblk_t envblk, char *name, char *value) -{ - char *p, *pend; - char *found = 0; - int nl; - - nl = grub_strlen (name); - p = envblk->data; - pend = p + envblk->length; - - while (*p) + if (size < sizeof (GRUB_ENVBLK_SIGNATURE) + || grub_memcmp (buf, GRUB_ENVBLK_SIGNATURE, + sizeof (GRUB_ENVBLK_SIGNATURE) - 1)) { - if ((! found) && (! grub_memcmp (name, p, nl)) && (p[nl] == '=')) - found = p + nl + 1; - - p += grub_strlen (p) + 1; - if (p >= pend) - return 1; + grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block"); + return 0; } - - if (found) + + envblk = grub_malloc (sizeof (*envblk)); + if (envblk) { - int len1, len2; - - len1 = grub_strlen (found); - len2 = grub_strlen (value); - if ((p - envblk->data) + 1 - len1 + len2 > envblk->length) - return 1; - - grub_memcpy (found + len2 + 1, found + len1 + 1, (p - found) - len1); - grub_strcpy (found, value); + envblk->buf = buf; + envblk->size = size; } - else - { - int len2 = grub_strlen (value); - - if ((p - envblk->data) + nl + 1 + len2 + 2 > envblk->length) - return 1; - - grub_strcpy (p, name); - p[nl] = '='; - grub_strcpy (p + nl + 1, value); - p[nl + 1 + len2 + 1] = 0; - } - - return 0; + + return envblk; } void -grub_envblk_delete (grub_envblk_t envblk, char *name) +grub_envblk_close (grub_envblk_t envblk) +{ + grub_free (envblk->buf); + grub_free (envblk); +} + +static int +escaped_value_len (const char *value) +{ + int n = 0; + char *p; + + for (p = (char *) value; *p; p++) + { + if (*p == '\\' || *p == '\n') + n += 2; + else + n++; + } + + return n; +} + +static char * +find_next_line (char *p, const char *pend) +{ + while (p < pend) + { + if (*p == '\\') + p += 2; + else if (*p == '\n') + break; + else + p++; + } + + return p + 1; +} + +int +grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) +{ + char *p, *pend; + char *space; + int found = 0; + int nl; + int vl; + int i; + + nl = grub_strlen (name); + vl = escaped_value_len (value); + p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1; + pend = envblk->buf + envblk->size; + + /* First, look at free space. */ + for (space = pend - 1; *space == '#'; space--) + ; + + if (*space != '\n') + /* Broken. */ + return 0; + + space++; + + while (p + nl + 1 < space) + { + if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=') + { + int len; + + /* Found the same name. */ + p += nl + 1; + + /* Check the length of the current value. */ + len = 0; + while (p + len < pend && p[len] != '\n') + { + if (p[len] == '\\') + len += 2; + else + len++; + } + + if (p + len >= pend) + /* Broken. */ + return 0; + + if (pend - space < vl - len) + /* No space. */ + return 0; + + if (vl < len) + { + /* Move the following characters backward, and fill the new + space with harmless characters. */ + grub_memmove (p + vl, p + len, pend - (p + len)); + grub_memset (space + len - vl, '#', len - vl); + } + else + /* Move the following characters forward. */ + grub_memmove (p + vl, p + len, pend - (p + vl)); + + found = 1; + break; + } + + p = find_next_line (p, pend); + } + + if (! found) + { + /* Append a new variable. */ + + if (pend - space < nl + 1 + vl + 1) + /* No space. */ + return 0; + + grub_memcpy (space, name, nl); + p = space + nl; + *p++ = '='; + } + + /* Write the value. */ + for (i = 0; value[i]; i++) + { + if (value[i] == '\\' || value[i] == '\n') + *p++ = '\\'; + + *p++ = value[i]; + } + + *p = '\n'; + return 1; +} + +void +grub_envblk_delete (grub_envblk_t envblk, const char *name) { char *p, *pend; - char *found = 0; int nl; nl = grub_strlen (name); - p = envblk->data; - pend = p + envblk->length; + p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1; + pend = envblk->buf + envblk->size; - while (*p) + while (p + nl + 1 < pend) { - if ((! found) && (! grub_memcmp (name, p, nl)) && (p[nl] == '=')) - found = p; + if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=') + { + /* Found. */ + int len = nl + 1; - p += grub_strlen (p) + 1; - if (p >= pend) - return; - } + while (p + len < pend) + { + if (p[len] == '\n') + break; + else if (p[len] == '\\') + len += 2; + else + len++; + } - if (found) - { - int len; + if (p + len >= pend) + /* Broken. */ + return; - len = grub_strlen (found); - grub_memcpy (found, found + len + 1, (p - found) - len); - } + len++; + grub_memmove (p, p + len, pend - (p + len)); + grub_memset (pend - len, '#', len); + break; + } + + p = find_next_line (p, pend); + } } void grub_envblk_iterate (grub_envblk_t envblk, - int hook (char *name, char *value)) + int hook (const char *name, const char *value)) { char *p, *pend; - p = envblk->data; - pend = p + envblk->length; + p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1; + pend = envblk->buf + envblk->size; - while (*p) + while (p < pend) { - char *v; - int r; - - v = grub_strchr (p, '='); - if (v) + if (*p != '#') { - *v = 0; - r = hook (p, v + 1); - *v = '='; + char *name; + char *value; + char *name_start, *name_end, *value_start; + char *q; + int ret; + + name_start = p; + while (p < pend && *p != '=') + p++; + if (p == pend) + /* Broken. */ + return; + name_end = p; + + p++; + value_start = p; + while (p < pend) + { + if (*p == '\n') + break; + else if (*p == '\\') + p += 2; + else + p++; + } + + if (p >= pend) + /* Broken. */ + return; + + name = grub_malloc (p - name_start + 1); + if (! name) + /* out of memory. */ + return; + + value = name + (value_start - name_start); + + grub_memcpy (name, name_start, name_end - name_start); + name[name_end - name_start] = '\0'; + + for (p = value_start, q = value; *p != '\n'; ++p) + { + if (*p == '\\') + *q++ = *++p; + else + *q++ = *p; + } + *q = '\0'; + + ret = hook (name, value); + grub_free (name); + if (ret) + return; } - else - r = hook (p, ""); - - if (r) - break; - - p += grub_strlen (p) + 1; - if (p >= pend) - break; + + p = find_next_line (p, pend); } } diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 1ffeb32ca..57f837a39 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -1,7 +1,7 @@ /* grub-editenv.c - tool to edit environment block. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,6 +29,8 @@ #include #include +#define DEFAULT_ENVBLK_SIZE 1024 + void grub_putchar (int c) { @@ -63,9 +65,6 @@ static struct option options[] = { {0, 0, 0, 0} }; -char buffer[GRUB_ENVBLK_MAXLEN]; -grub_envblk_t envblk; - static void usage (int status) { @@ -78,10 +77,9 @@ Usage: grub-editenv [OPTIONS] FILENAME COMMAND\n\ Tool to edit environment block.\n\ \nCommands:\n\ create create a blank environment block file\n\ - info show information about the environment block\n\ list list the current variables\n\ - set [name=value] ... change/delete variables\n\ - clear delete all variables\n\ + set [name=value ...] set variables\n\ + unset [name ....] delete variables\n\ \nOptions:\n\ -h, --help display this message and exit\n\ -V, --version print version information and exit\n\ @@ -92,108 +90,161 @@ Report bugs to <%s>.\n", PACKAGE_BUGREPORT); exit (status); } -int -create_envblk_file (char *name) +static void +create_envblk_file (const char *name) { - FILE *f; - grub_envblk_t p; + FILE *fp; + char *buf; + + buf = malloc (DEFAULT_ENVBLK_SIZE); + if (! buf) + grub_util_error ("out of memory"); - f = fopen (name, "wb"); - if (! f) - return 1; + fp = fopen (name, "wb"); + if (! fp) + grub_util_error ("cannot open the file %s", name); - /* Just in case OS don't save 0s. */ - memset (buffer, -1, sizeof (buffer)); + memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1); + memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#', + DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1); + + if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE) + grub_util_error ("cannot write to the file %s", name); - p = (grub_envblk_t) &buffer[0]; - p->signature = GRUB_ENVBLK_SIGNATURE; - p->length = sizeof (buffer) - sizeof (struct grub_envblk); - p->data[0] = p->data[1] = 0; - - fwrite (buffer, sizeof (buffer), 1, f); - - fclose (f); - return 0; + fsync (fileno (fp)); + free (buf); + fclose (fp); } -FILE * -open_envblk_file (char *name) +static grub_envblk_t +open_envblk_file (const char *name) { - FILE *f; + FILE *fp; + char *buf; + size_t size; + grub_envblk_t envblk; + + fp = fopen (name, "rb"); + if (! fp) + { + /* Create the file implicitly. */ + create_envblk_file (name); + fp = fopen (name, "rb"); + if (! fp) + grub_util_error ("cannot open the file %s", name); + } - f = fopen (name, "r+b"); - if (! f) - grub_util_error ("Can\'t open file %s", name); + if (fseek (fp, 0, SEEK_END) < 0) + grub_util_error ("cannot seek the file %s", name); - if (fread (buffer, 1, sizeof (buffer), f) != sizeof (buffer)) - grub_util_error ("The envblk file is too short"); + size = (size_t) ftell (fp); - envblk = grub_envblk_find (buffer); + if (fseek (fp, 0, SEEK_SET) < 0) + grub_util_error ("cannot seek the file %s", name); + + buf = malloc (size); + if (! buf) + grub_util_error ("out of memory"); + + if (fread (buf, 1, size, fp) != size) + grub_util_error ("cannot read the file %s", name); + + fclose (fp); + + envblk = grub_envblk_open (buf, size); if (! envblk) - grub_util_error ("Can\'t find environment block"); + grub_util_error ("invalid environment block"); - return f; + return envblk; } static void -cmd_info (void) +list_variables (const char *name) { - printf ("Envblk offset: %ld\n", (long) (envblk->data - buffer)); - printf ("Envblk length: %d\n", envblk->length); -} - -static void -cmd_list (void) -{ - auto int hook (char *name, char *value); - int hook (char *name, char *value) + grub_envblk_t envblk; + + auto int print_var (const char *name, const char *value); + int print_var (const char *name, const char *value) { printf ("%s=%s\n", name, value); return 0; } - grub_envblk_iterate (envblk, hook); + envblk = open_envblk_file (name); + grub_envblk_iterate (envblk, print_var); + grub_envblk_close (envblk); } static void -cmd_set (int argc, char *argv[]) +write_envblk (const char *name, grub_envblk_t envblk) { + FILE *fp; + + fp = fopen (name, "wb"); + if (! fp) + grub_util_error ("cannot open the file %s", name); + + if (fwrite (grub_envblk_buffer (envblk), 1, grub_envblk_size (envblk), fp) + != grub_envblk_size (envblk)) + grub_util_error ("cannot write to the file %s", name); + + fsync (fileno (fp)); + fclose (fp); +} + +static void +set_variables (const char *name, int argc, char *argv[]) +{ + grub_envblk_t envblk; + + envblk = open_envblk_file (name); while (argc) { char *p; p = strchr (argv[0], '='); if (! p) - grub_util_error ("Invalid parameter"); + grub_util_error ("invalid parameter %s", argv[0]); *(p++) = 0; - if (*p) - { - if (grub_envblk_insert (envblk, argv[0], p)) - grub_util_error ("Environment block too small"); - } - else - grub_envblk_delete (envblk, argv[0]); + if (! grub_envblk_set (envblk, argv[0], p)) + grub_util_error ("environment block too small"); argc--; argv++; } + + write_envblk (name, envblk); + grub_envblk_close (envblk); } static void -cmd_clear (void) +unset_variables (const char *name, int argc, char *argv[]) { - envblk->data[0] = envblk->data[1] = 0; + grub_envblk_t envblk; + + envblk = open_envblk_file (name); + while (argc) + { + grub_envblk_delete (envblk, argv[0]); + + argc--; + argv++; + } + + write_envblk (name, envblk); + grub_envblk_close (envblk); } int main (int argc, char *argv[]) { - FILE *f; - + char *filename; + char *command; + progname = "grub-editenv"; - + /* Check for options. */ while (1) { @@ -222,40 +273,35 @@ main (int argc, char *argv[]) } } - /* Obtain PATH. */ + /* Obtain the filename. */ if (optind >= argc) { - fprintf (stderr, "Filename not specified.\n"); + fprintf (stderr, "no filename specified\n"); usage (1); } if (optind + 1 >= argc) { - fprintf (stderr, "Command not specified.\n"); + fprintf (stderr, "no command specified\n"); + usage (1); + } + + filename = argv[optind]; + command = argv[optind + 1]; + + if (strcmp (command, "create") == 0) + create_envblk_file (filename); + else if (strcmp (command, "list") == 0) + list_variables (filename); + else if (strcmp (command, "set") == 0) + set_variables (filename, argc - optind - 2, argv + optind + 2); + else if (strcmp (command, "unset") == 0) + unset_variables (filename, argc - optind - 2, argv + optind + 2); + else + { + fprintf (stderr, "unknown command %s\n", command); usage (1); } - if (! strcmp (argv[optind + 1], "create")) - return create_envblk_file (argv[optind]); - - f = open_envblk_file (argv[optind]); - - optind++; - if (! strcmp (argv[optind], "info")) - cmd_info (); - else if (! strcmp (argv[optind], "list")) - cmd_list (); - else - { - if (! strcmp (argv[optind], "set")) - cmd_set (argc - optind - 1, argv + optind + 1); - else if (! strcmp (argv[optind], "clear")) - cmd_clear (); - - fseeko (f, 0, SEEK_SET); - fwrite (buffer, sizeof (buffer), 1, f); - } - fclose (f); - return 0; } From ae68f4234b0abf104df5bd20ae8cc0dbe81d93b4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 29 Mar 2009 02:23:12 +0000 Subject: [PATCH 0587/1707] 2009-03-29 Robert Millan * util/grub.d/10_linux.in (linux_entry): New function. Factorize generation of Linux boot entries. --- ChangeLog | 5 ++++ util/grub.d/10_linux.in | 54 ++++++++++++++++++----------------------- 2 files changed, 28 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c4cefc5c..f1f03f3ff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-29 Robert Millan + + * util/grub.d/10_linux.in (linux_entry): New function. + Factorize generation of Linux boot entries. + 2009-03-29 Yoshinori K. Okuji Make the format of Environment Block plain text. The boot loader diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 010660f68..c2da41380 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -93,6 +93,25 @@ find_latest () echo "$a" } +linux_entry () +{ + cat << EOF +menuentry "$1" { +EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + cat << EOF + linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2 +EOF + if test -n "${initrd}" ; then + cat << EOF + initrd ${rel_dirname}/${initrd} +EOF + fi + cat << EOF +} +EOF +} + list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` @@ -122,37 +141,10 @@ while [ "x$list" != "x" ] ; do linux_root_device_thisversion=${GRUB_DEVICE} fi - cat << EOF -menuentry "${OS}, linux ${version}" { -EOF - prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" - cat << EOF - linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro ${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT} -EOF - if test -n "${initrd}" ; then - cat << EOF - initrd ${rel_dirname}/${initrd} -EOF - fi - cat << EOF -} -EOF - - cat << EOF -menuentry "${OS}, linux ${version} (recovery mode)" { -EOF - prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" - cat << EOF - linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro single ${GRUB_CMDLINE_LINUX} -EOF - if test -n "${initrd}" ; then - cat << EOF - initrd ${rel_dirname}/${initrd} -EOF - fi - cat << EOF -} -EOF + linux_entry "${OS}, linux ${version}" \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" + linux_entry "${OS}, linux ${version} (recovery mode)" \ + "single ${GRUB_CMDLINE_LINUX}" list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` done From 9c323f09615fb9d9d72689425c59bfacdc730755 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 29 Mar 2009 19:52:35 +0000 Subject: [PATCH 0588/1707] 2009-03-29 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Parse "vga=" parameter and set `vid_mode' accordingly. (grub_linux_boot): Process `vid_mode' and set video mode. --- ChangeLog | 6 +++ loader/i386/linux.c | 126 +++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 126 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1f03f3ff..0afef5099 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-29 Robert Millan + + * loader/i386/linux.c (grub_cmd_linux): Parse "vga=" parameter and + set `vid_mode' accordingly. + (grub_linux_boot): Process `vid_mode' and set video mode. + 2009-03-29 Robert Millan * util/grub.d/10_linux.in (linux_entry): New function. diff --git a/loader/i386/linux.c b/loader/i386/linux.c index eb0a8859b..9deb40ff1 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -85,6 +85,68 @@ static struct idt_descriptor idt_desc = 0 }; +static grub_uint16_t vid_mode; + +struct linux_vesafb_res +{ + grub_uint16_t width; + grub_uint16_t height; +}; + +enum vga_modes + { + VGA_640_480, + VGA_800_600, + VGA_1024_768, + VGA_1280_1024, + }; + +struct linux_vesafb_mode +{ + grub_uint8_t res_index; + grub_uint8_t depth; +}; + +static struct linux_vesafb_res linux_vesafb_res[] = + { + { 640, 480 }, + { 800, 600 }, + { 1024, 768 }, + { 1280, 1024 } + }; + +/* This is the reverse of the table in [linux]/Documentation/fb/vesafb.txt. */ +struct linux_vesafb_mode linux_vesafb_modes[] = + { + { VGA_640_480, 8 }, /* 0x301 */ + { 0, 0 }, + { VGA_800_600, 8 }, /* 0x303 */ + { 0, 0 }, + { VGA_1024_768, 8 }, /* 0x305 */ + { 0, 0 }, + { VGA_1280_1024, 8 }, /* 0x307 */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { VGA_640_480, 15 }, /* 0x310 */ + { VGA_640_480, 16 }, /* 0x311 */ + { VGA_640_480, 24 }, /* 0x312 */ + { VGA_800_600, 15 }, /* 0x313 */ + { VGA_800_600, 16 }, /* 0x314 */ + { VGA_800_600, 24 }, /* 0x315 */ + { VGA_1024_768, 15 }, /* 0x316 */ + { VGA_1024_768, 16 }, /* 0x317 */ + { VGA_1024_768, 24 }, /* 0x318 */ + { VGA_1280_1024, 15 }, /* 0x319 */ + { VGA_1280_1024, 16 }, /* 0x31a */ + { VGA_1280_1024, 24 }, /* 0x31b */ + }; + static inline grub_size_t page_align (grub_size_t size) { @@ -270,8 +332,50 @@ grub_linux_boot (void) params = real_mode_mem; + if (vid_mode == GRUB_LINUX_VID_MODE_NORMAL || vid_mode == GRUB_LINUX_VID_MODE_EXTENDED) + grub_video_restore (); + else if (vid_mode) + { + struct linux_vesafb_mode *linux_mode; + int depth, flags; + + flags = 0; + linux_mode = &linux_vesafb_modes[vid_mode - 0x301]; + depth = linux_mode->depth; + + /* If we have 8 or less bits, then assume that it is indexed color mode. */ + if ((depth <= 8) && (depth != -1)) + flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + + /* We have more than 8 bits, then assume that it is RGB color mode. */ + if (depth > 8) + flags |= GRUB_VIDEO_MODE_TYPE_RGB; + + /* If user requested specific depth, forward that information to driver. */ + if (depth != -1) + flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) + & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; + + /* Try to initialize requested mode. */ + if (grub_video_setup (linux_vesafb_res[linux_mode->res_index].width, + linux_vesafb_res[linux_mode->res_index].height, + flags) != GRUB_ERR_NONE) + { + grub_printf ("Unable to initialize requested video mode (vga=0x%x)\n", vid_mode); + return grub_errno; + } + } + if (! grub_linux_setup_video (params)) params->have_vga = GRUB_VIDEO_TYPE_VLFB; + else + { + params->have_vga = 0; + params->video_cursor_x = grub_getxy () >> 8; + params->video_cursor_y = grub_getxy () & 0xff; + params->video_width = 80; + params->video_height = 25; + } grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", (unsigned) params->code32_start, @@ -445,14 +549,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), params->ext_mem = ((32 * 0x100000) >> 10); params->alt_mem = ((32 * 0x100000) >> 10); - params->video_cursor_x = grub_getxy () >> 8; - params->video_cursor_y = grub_getxy () & 0xff; params->video_page = 0; /* ??? */ params->video_mode = 0; - params->video_width = (grub_getwh () >> 8); params->video_ega_bx = 0; - params->video_height = (grub_getwh () & 0xff); - params->have_vga = 0; params->font_size = 16; /* XXX */ /* The other parameters are filled when booting. */ @@ -465,7 +564,22 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), /* Detect explicitly specified memory size, if any. */ linux_mem_size = 0; for (i = 1; i < argc; i++) - if (grub_memcmp (argv[i], "mem=", 4) == 0) + if (grub_memcmp (argv[i], "vga=", 4) == 0) + { + /* Video mode selection support. */ + char *val = argv[i] + 4; + + if (grub_strcmp (val, "normal") == 0) + vid_mode = GRUB_LINUX_VID_MODE_NORMAL; + else if (grub_strcmp (val, "ext") == 0) + vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; + else + vid_mode = (grub_uint16_t) grub_strtoul (val, 0, 0); + + if (grub_errno) + goto fail; + } + else if (grub_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; From a8c48fd53d9376a0b563b1238f4741709831501e Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 29 Mar 2009 21:21:19 +0000 Subject: [PATCH 0589/1707] 2009-03-29 Vladimir Serbinenko Leak fixes * kern/disk.c (grub_disk_cache_store): Invalidate previous cache in case of collision * disk/scsi.c (grub_scsi_open): free scsi in case of error --- ChangeLog | 8 ++++++++ disk/scsi.c | 6 ++++++ kern/disk.c | 7 +++++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0afef5099..950710103 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-03-29 Vladimir Serbinenko + + Leak fixes + + * kern/disk.c (grub_disk_cache_store): Invalidate previous cache + in case of collision + * disk/scsi.c (grub_scsi_open): free scsi in case of error + 2009-03-29 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Parse "vga=" parameter and diff --git a/disk/scsi.c b/disk/scsi.c index 75b92b409..319d8d672 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -255,6 +255,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) scsi->name = grub_strdup (name); if (! scsi->name) { + grub_free (scsi); return grub_errno; } @@ -263,6 +264,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) err = grub_scsi_inquiry (scsi); if (err) { + grub_free (scsi); grub_dprintf ("scsi", "inquiry failed\n"); return grub_errno; } @@ -275,6 +277,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) if (scsi->devtype != grub_scsi_devtype_direct && scsi->devtype != grub_scsi_devtype_cdrom) { + grub_free (scsi); return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown SCSI device"); } @@ -287,6 +290,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) err = grub_scsi_read_capacity (scsi); if (err) { + grub_free (scsi); grub_dprintf ("scsi", "READ CAPACITY failed\n"); return grub_errno; } @@ -303,6 +307,8 @@ grub_scsi_open (const char *name, grub_disk_t disk) } } + grub_free (scsi); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a SCSI disk"); } diff --git a/kern/disk.c b/kern/disk.c index 4ee03e0d9..8a92989ad 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -158,10 +158,13 @@ grub_disk_cache_store (unsigned long dev_id, unsigned long disk_id, unsigned index; struct grub_disk_cache *cache; - grub_disk_cache_invalidate (dev_id, disk_id, sector); - index = grub_disk_cache_get_index (dev_id, disk_id, sector); cache = grub_disk_cache_table + index; + + cache->lock = 1; + grub_free (cache->data); + cache->data = 0; + cache->lock = 0; cache->data = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS); if (! cache->data) From f968172ebf538192c38598a9db85c33b2bf22812 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 30 Mar 2009 22:20:16 +0000 Subject: [PATCH 0590/1707] Fix indentation. --- ChangeLog | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 950710103..f742c0a43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,10 @@ 2009-03-29 Vladimir Serbinenko - Leak fixes + Leak fixes - * kern/disk.c (grub_disk_cache_store): Invalidate previous cache - in case of collision - * disk/scsi.c (grub_scsi_open): free scsi in case of error + * kern/disk.c (grub_disk_cache_store): Invalidate previous cache + in case of collision + * disk/scsi.c (grub_scsi_open): free scsi in case of error 2009-03-29 Robert Millan From 92f33540d863152dda593870b1a0aa5274f44a7d Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 30 Mar 2009 22:22:31 +0000 Subject: [PATCH 0591/1707] 2009-03-30 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Check for zImage before checking for abi version. Improve error messages on BIOS to notify user about `linux16' command. --- ChangeLog | 6 ++++++ loader/i386/linux.c | 22 +++++++++++++++------- 2 files changed, 21 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index f742c0a43..03c09cf1b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-03-30 Robert Millan + + * loader/i386/linux.c (grub_cmd_linux): Check for zImage before + checking for abi version. Improve error messages on BIOS to notify + user about `linux16' command. + 2009-03-29 Vladimir Serbinenko Leak fixes diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 9deb40ff1..33b6d8659 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -492,18 +492,26 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), goto fail; } - /* FIXME: Is 2.02 recent enough for 32-bit boot? */ - if (lh.header != grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE) - || grub_le_to_cpu16 (lh.version) < 0x0203) + if (! (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL)) { - grub_error (GRUB_ERR_BAD_OS, "too old version"); + grub_error (GRUB_ERR_BAD_OS, "zImage doesn't support 32-bit boot" +#ifdef GRUB_MACHINE_PCBIOS + " (try with `linux16')" +#endif + ); goto fail; } - /* zImage doesn't support 32-bit boot. */ - if (! (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL)) + /* FIXME: 2.03 is not always good enough (Linux 2.4 can be 2.03 and + still not support 32-bit boot. */ + if (lh.header != grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE) + || grub_le_to_cpu16 (lh.version) < 0x0203) { - grub_error (GRUB_ERR_BAD_OS, "zImage is not supported"); + grub_error (GRUB_ERR_BAD_OS, "version too old for 32-bit boot" +#ifdef GRUB_MACHINE_PCBIOS + " (try with `linux16')" +#endif + ); goto fail; } From 6a003ed1be16f0ce5b22fd0b72576202d28e3d31 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 31 Mar 2009 00:22:08 +0000 Subject: [PATCH 0592/1707] 2009-03-30 Pavel Roskin * fs/hfs.c (grub_hfs_strncasecmp): Integrate into ... (grub_hfs_cmp_catkeys): ... this. Don't assume strings to be zero-terminated, rely only on the strlen value. Fix comparison of strings differing in length. --- ChangeLog | 7 +++++++ fs/hfs.c | 51 +++++++++++++++++---------------------------------- 2 files changed, 24 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 03c09cf1b..d73c7c9d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-30 Pavel Roskin + + * fs/hfs.c (grub_hfs_strncasecmp): Integrate into ... + (grub_hfs_cmp_catkeys): ... this. Don't assume strings to be + zero-terminated, rely only on the strlen value. Fix comparison + of strings differing in length. + 2009-03-30 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Check for zImage before diff --git a/fs/hfs.c b/fs/hfs.c index a923309cf..2ab3ac2fa 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -390,10 +390,10 @@ grub_hfs_mount (grub_disk_t disk) return 0; } -/* Case insensitive string comparison using HFS character ordering */ +/* Compare the K1 and K2 catalog file keys using HFS character ordering. */ static int -grub_hfs_strncasecmp (const unsigned char *s1, const unsigned char *s2, - grub_size_t n) +grub_hfs_cmp_catkeys (struct grub_hfs_catalog_key *k1, + struct grub_hfs_catalog_key *k2) { /* Taken from hfsutils 3.2.6 and converted to a readable form */ static const unsigned char hfs_charorder[256] = { @@ -614,40 +614,23 @@ grub_hfs_strncasecmp (const unsigned char *s1, const unsigned char *s2, [0xFE] = 214, [0xFF] = 215, }; + int i; + int cmp; + int minlen = (k1->strlen < k2->strlen) ? k1->strlen : k2->strlen; - if (n == 0) - return 0; - - while (*s1 && *s2 && --n) - { - if (hfs_charorder[*s1] != hfs_charorder[*s2]) - break; - - s1++; - s2++; - } - - return (int) hfs_charorder[*s1] - (int) hfs_charorder[*s2]; -} - -/* Compare the K1 and K2 catalog file keys. */ -static int -grub_hfs_cmp_catkeys (struct grub_hfs_catalog_key *k1, - struct grub_hfs_catalog_key *k2) -{ - int cmp = (grub_be_to_cpu32 (k1->parent_dir) - - grub_be_to_cpu32 (k2->parent_dir)); - + cmp = (grub_be_to_cpu32 (k1->parent_dir) - grub_be_to_cpu32 (k2->parent_dir)); if (cmp != 0) return cmp; - - cmp = grub_hfs_strncasecmp (k1->str, k2->str, k1->strlen); - - /* This is required because the compared strings are not of equal - length. */ - if (cmp == 0 && k1->strlen < k2->strlen) - return -1; - return cmp; + + for (i = 0; i < minlen; i++) + { + cmp = (hfs_charorder[k1->str[i]] - hfs_charorder[k2->str[i]]); + if (cmp != 0) + return cmp; + } + + /* Shorter strings precede long ones. */ + return (k1->strlen - k2->strlen); } From 95646d9232c1e94004dd6107e33a1dc1a8f8be22 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 1 Apr 2009 00:04:50 +0000 Subject: [PATCH 0593/1707] 2009-03-30 Robert Millan Fix i386-ieee1275 build. * include/grub/i386/ieee1275/loader.h (grub_multiboot2_real_boot): Remove declaration. --- ChangeLog | 7 +++++++ include/grub/i386/ieee1275/loader.h | 4 ---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d73c7c9d6..3d2e45764 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-03-30 Robert Millan + + Fix i386-ieee1275 build. + + * include/grub/i386/ieee1275/loader.h (grub_multiboot2_real_boot): + Remove declaration. + 2009-03-30 Pavel Roskin * fs/hfs.c (grub_hfs_strncasecmp): Integrate into ... diff --git a/include/grub/i386/ieee1275/loader.h b/include/grub/i386/ieee1275/loader.h index 942242b76..20df2e1d6 100644 --- a/include/grub/i386/ieee1275/loader.h +++ b/include/grub/i386/ieee1275/loader.h @@ -23,10 +23,6 @@ #include #include -void EXPORT_FUNC(grub_multiboot2_real_boot) (grub_addr_t entry, - struct grub_multiboot_info *mbi) - __attribute__ ((noreturn)); - void grub_rescue_cmd_linux (int argc, char *argv[]); void grub_rescue_cmd_initrd (int argc, char *argv[]); From 0d818b7e5c96c0ed70e8b7fa4952d66ed73e95ea Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Apr 2009 01:09:30 +0000 Subject: [PATCH 0594/1707] 2009-03-31 Pavel Roskin * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Provide safe default for cross-compilation. --- ChangeLog | 5 +++++ aclocal.m4 | 1 + configure | 14 ++++---------- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d2e45764..0d1cc9dac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-03-31 Pavel Roskin + + * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Provide safe default + for cross-compilation. + 2009-03-30 Robert Millan Fix i386-ieee1275 build. diff --git a/aclocal.m4 b/aclocal.m4 index b54ef15db..afd135d8f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -337,6 +337,7 @@ main (void) } ]])], [grub_cv_i386_check_nested_functions=no], + [grub_cv_i386_check_nested_functions=yes], [grub_cv_i386_check_nested_functions=yes])]) AC_MSG_RESULT([$grub_cv_i386_check_nested_functions]) diff --git a/configure b/configure index b717572bb..d1f476d44 100644 --- a/configure +++ b/configure @@ -8171,13 +8171,7 @@ if test "${grub_cv_i386_check_nested_functions+set}" = set; then $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run test program while cross compiling -See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run test program while cross compiling -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + grub_cv_i386_check_nested_functions=yes else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -9708,9 +9702,9 @@ esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="`echo $ac_config_files`" -config_headers="`echo $ac_config_headers`" -config_links="`echo $ac_config_links`" +config_files="$ac_config_files" +config_headers="$ac_config_headers" +config_links="$ac_config_links" _ACEOF From 9c3dd8544c0ab91e1e237b4a33b52ba12cc6cb37 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 1 Apr 2009 01:26:58 +0000 Subject: [PATCH 0595/1707] 2009-04-01 Robert Millan Reapply fix from 2008-07-28 which was accidentally reverted; also perform the same fix to a similar check in same function. * disk/raid.c (grub_raid_scan_device): Do not abort when two disks with the same number are found, just use issue a warning with grub_dprintf(), as this error has been reported to be non-fatal. --- ChangeLog | 9 +++++++++ disk/raid.c | 13 +++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d1cc9dac..cfd60707d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-01 Robert Millan + + Reapply fix from 2008-07-28 which was accidentally reverted; also + perform the same fix to a similar check in same function. + + * disk/raid.c (grub_raid_scan_device): Do not abort when two disks + with the same number are found, just use issue a warning with + grub_dprintf(), as this error has been reported to be non-fatal. + 2009-03-31 Pavel Roskin * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Provide safe default diff --git a/disk/raid.c b/disk/raid.c index 62cbcb5ba..4d6422236 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -495,18 +495,15 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array, if (array->total_devs == array->nr_devs) /* We found more members of the array than the array actually has according to its superblock. This shouldn't - happen normally, but what is the sanest things to do in such - a case? */ - return grub_error (GRUB_ERR_BAD_NUMBER, - "array->nr_devs > array->total_devs (%d)?!?", - array->total_devs); + happen normally. */ + grub_dprintf ("raid", "array->nr_devs > array->total_devs (%d)?!?", + array->total_devs); if (array->device[new_array->index] != NULL) /* We found multiple devices with the same number. Again, this shouldn't happen.*/ - return grub_error (GRUB_ERR_BAD_NUMBER, - "Found two disks with the number %d?!?", - new_array->number); + grub_dprintf ("raid", "Found two disks with the number %d?!?", + new_array->number); if (new_array->disk_size < array->disk_size) array->disk_size = new_array->disk_size; From 5270cec8d7aa16d5ff28431c4efdad5554536904 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 1 Apr 2009 13:01:05 +0000 Subject: [PATCH 0596/1707] 2009-04-01 David S. Miller * normal/sparc64/setjmp.S: Fix setjmp implementation. * include/grub/sparc64/setjmp.h (grub_jmp_buf): Update. (grub_setjmp): Mark with 'returns_twice' attribute. * include/grub/i386/setjmp.h (grub_setjmp): Likewise * include/grub/powerpc/setjmp.h (grub_setjmp): Likewise. * include/grub/x86_64/setjmp.h (grub_setjmp): Likewise. --- ChangeLog | 9 +++++++++ include/grub/i386/setjmp.h | 5 +++-- include/grub/powerpc/setjmp.h | 4 ++-- include/grub/sparc64/setjmp.h | 9 +++++---- include/grub/x86_64/setjmp.h | 4 ++-- normal/sparc64/setjmp.S | 21 +++++++++++++++------ 6 files changed, 36 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index cfd60707d..469968176 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-01 David S. Miller + + * normal/sparc64/setjmp.S: Fix setjmp implementation. + * include/grub/sparc64/setjmp.h (grub_jmp_buf): Update. + (grub_setjmp): Mark with 'returns_twice' attribute. + * include/grub/i386/setjmp.h (grub_setjmp): Likewise + * include/grub/powerpc/setjmp.h (grub_setjmp): Likewise. + * include/grub/x86_64/setjmp.h (grub_setjmp): Likewise. + 2009-04-01 Robert Millan Reapply fix from 2008-07-28 which was accidentally reverted; also diff --git a/include/grub/i386/setjmp.h b/include/grub/i386/setjmp.h index 02b0d8fe0..c5f94b406 100644 --- a/include/grub/i386/setjmp.h +++ b/include/grub/i386/setjmp.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,8 @@ typedef unsigned long grub_jmp_buf[6]; -int grub_setjmp (grub_jmp_buf env) __attribute__ ((cdecl, regparm (3))); +int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice, cdecl, + regparm (3))); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn, cdecl, regparm (3))); diff --git a/include/grub/powerpc/setjmp.h b/include/grub/powerpc/setjmp.h index 441e53883..fa16f73d2 100644 --- a/include/grub/powerpc/setjmp.h +++ b/include/grub/powerpc/setjmp.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2004,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ typedef unsigned long grub_jmp_buf[20]; -int grub_setjmp (grub_jmp_buf env); +int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice)); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); #endif /* ! GRUB_SETJMP_CPU_HEADER */ diff --git a/include/grub/sparc64/setjmp.h b/include/grub/sparc64/setjmp.h index 12d8e015f..6096baef1 100644 --- a/include/grub/sparc64/setjmp.h +++ b/include/grub/sparc64/setjmp.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2004,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,10 +19,11 @@ #ifndef GRUB_SETJMP_CPU_HEADER #define GRUB_SETJMP_CPU_HEADER 1 -/* FIXME (sparc64). */ -typedef unsigned long grub_jmp_buf[20]; +#include -int grub_setjmp (grub_jmp_buf env); +typedef grub_uint64_t grub_jmp_buf[3]; + +int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice)); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); #endif /* ! GRUB_SETJMP_CPU_HEADER */ diff --git a/include/grub/x86_64/setjmp.h b/include/grub/x86_64/setjmp.h index e417f65b7..4ad968ed5 100644 --- a/include/grub/x86_64/setjmp.h +++ b/include/grub/x86_64/setjmp.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,7 @@ typedef unsigned long grub_jmp_buf[8]; -int grub_setjmp (grub_jmp_buf env); +int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice)); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); #endif /* ! GRUB_SETJMP_CPU_HEADER */ diff --git a/normal/sparc64/setjmp.S b/normal/sparc64/setjmp.S index b1a9b6eef..0e23ecfa1 100644 --- a/normal/sparc64/setjmp.S +++ b/normal/sparc64/setjmp.S @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,13 +26,22 @@ * int grub_setjmp (grub_jmp_buf env) */ FUNCTION(grub_setjmp) - ret - nop + stx %o7, [%o0 + 0x00] + stx %sp, [%o0 + 0x08] + stx %fp, [%o0 + 0x10] + retl + clr %o0 /* * int grub_longjmp (grub_jmp_buf env, int val) */ FUNCTION(grub_longjmp) - ret - nop - + ldx [%o0 + 0x10], %g1 + movrz %o1, 1, %o1 + flushw + ldx [%o0 + 0x00], %o7 + ldx [%o0 + 0x08], %fp + sub %fp, 192, %sp + stx %g1, [%sp + 2047 + (14 * 8)] + retl + restore %o1, 0, %o0 From 5ec9740b69936d75700766a7a18872474952b3e2 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Apr 2009 16:08:42 +0000 Subject: [PATCH 0597/1707] 2009-04-01 Manoel Abranches * aclocal.m4: Move --build-id=none from MODULE_LDFLAGS to TARGET_LDFLAGS. This corrects a problem with grub-mkelfimage. --- ChangeLog | 5 +++++ aclocal.m4 | 2 +- configure | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 469968176..686ef0ebc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-01 Manoel Abranches + + * aclocal.m4: Move --build-id=none from MODULE_LDFLAGS to + TARGET_LDFLAGS. This corrects a problem with grub-mkelfimage. + 2009-04-01 David S. Miller * normal/sparc64/setjmp.S: Fix setjmp implementation. diff --git a/aclocal.m4 b/aclocal.m4 index afd135d8f..779df3d39 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -112,7 +112,7 @@ LDFLAGS="$save_LDFLAGS" AC_MSG_RESULT([$grub_cv_prog_ld_build_id_none]) if test "x$grub_cv_prog_ld_build_id_none" = xyes; then - MODULE_LDFLAGS="$MODULE_LDFLAGS -Wl,--build-id=none" + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" fi ]) diff --git a/configure b/configure index d1f476d44..84291ecbc 100644 --- a/configure +++ b/configure @@ -7649,7 +7649,7 @@ fi $as_echo "$grub_cv_prog_ld_build_id_none" >&6; } if test "x$grub_cv_prog_ld_build_id_none" = xyes; then - MODULE_LDFLAGS="$MODULE_LDFLAGS -Wl,--build-id=none" + TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" fi From 3fcc20834cefdb5c52a2e0ff5bae864ad6065bec Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Apr 2009 16:17:20 +0000 Subject: [PATCH 0598/1707] 2009-04-01 Pavel Roskin * Makefile.in: Remove all references to MODULE_LDFLAGS, it's unused now. * genmk.rb: Likewise. * configure.ac: Likewise. --- ChangeLog | 7 +++ Makefile.in | 1 - conf/common.mk | 128 +++++++++++++++++++-------------------- conf/i386-coreboot.mk | 32 +++++----- conf/i386-efi.mk | 24 ++++---- conf/i386-ieee1275.mk | 32 +++++----- conf/i386-pc.mk | 68 ++++++++++----------- conf/i386.mk | 6 +- conf/powerpc-ieee1275.mk | 16 ++--- conf/sparc64-ieee1275.mk | 62 +++++++++---------- conf/x86_64-efi.mk | 24 ++++---- configure | 2 - configure.ac | 1 - genmk.rb | 2 +- 14 files changed, 204 insertions(+), 201 deletions(-) diff --git a/ChangeLog b/ChangeLog index 686ef0ebc..853274146 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-01 Pavel Roskin + + * Makefile.in: Remove all references to MODULE_LDFLAGS, it's + unused now. + * genmk.rb: Likewise. + * configure.ac: Likewise. + 2009-04-01 Manoel Abranches * aclocal.m4: Move --build-id=none from MODULE_LDFLAGS to diff --git a/Makefile.in b/Makefile.in index 28aa38506..d6e55e75e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,6 @@ TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@ TARGET_OBJ2ELF = @TARGET_OBJ2ELF@ -MODULE_LDFLAGS = @MODULE_LDFLAGS@ EXEEXT = @EXEEXT@ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ diff --git a/conf/common.mk b/conf/common.mk index a23573e33..9411a59c7 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -619,7 +619,7 @@ UNDSYMFILES += und-fshelp.lst fshelp.mod: pre-fshelp.o mod-fshelp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o + $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -676,7 +676,7 @@ UNDSYMFILES += und-fat.lst fat.mod: pre-fat.o mod-fat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o + $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -733,7 +733,7 @@ UNDSYMFILES += und-ufs.lst ufs.mod: pre-ufs.o mod-ufs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o + $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -790,7 +790,7 @@ UNDSYMFILES += und-ext2.lst ext2.mod: pre-ext2.o mod-ext2.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o + $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -847,7 +847,7 @@ UNDSYMFILES += und-ntfs.lst ntfs.mod: pre-ntfs.o mod-ntfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfs.o mod-ntfs.o + $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfs.o mod-ntfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -904,7 +904,7 @@ UNDSYMFILES += und-ntfscomp.lst ntfscomp.mod: pre-ntfscomp.o mod-ntfscomp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfscomp.o mod-ntfscomp.o + $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfscomp.o mod-ntfscomp.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -961,7 +961,7 @@ UNDSYMFILES += und-minix.lst minix.mod: pre-minix.o mod-minix.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o + $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1018,7 +1018,7 @@ UNDSYMFILES += und-hfs.lst hfs.mod: pre-hfs.o mod-hfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o + $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1075,7 +1075,7 @@ UNDSYMFILES += und-jfs.lst jfs.mod: pre-jfs.o mod-jfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o + $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1132,7 +1132,7 @@ UNDSYMFILES += und-iso9660.lst iso9660.mod: pre-iso9660.o mod-iso9660.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-iso9660.o mod-iso9660.o + $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-iso9660.o mod-iso9660.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1189,7 +1189,7 @@ UNDSYMFILES += und-xfs.lst xfs.mod: pre-xfs.o mod-xfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o + $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1246,7 +1246,7 @@ UNDSYMFILES += und-affs.lst affs.mod: pre-affs.o mod-affs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o + $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1303,7 +1303,7 @@ UNDSYMFILES += und-sfs.lst sfs.mod: pre-sfs.o mod-sfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o + $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1360,7 +1360,7 @@ UNDSYMFILES += und-hfsplus.lst hfsplus.mod: pre-hfsplus.o mod-hfsplus.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hfsplus.o mod-hfsplus.o + $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hfsplus.o mod-hfsplus.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1417,7 +1417,7 @@ UNDSYMFILES += und-reiserfs.lst reiserfs.mod: pre-reiserfs.o mod-reiserfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reiserfs.o mod-reiserfs.o + $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reiserfs.o mod-reiserfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1474,7 +1474,7 @@ UNDSYMFILES += und-cpio.lst cpio.mod: pre-cpio.o mod-cpio.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpio.o mod-cpio.o + $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cpio.o mod-cpio.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1531,7 +1531,7 @@ UNDSYMFILES += und-tar.lst tar.mod: pre-tar.o mod-tar.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(tar_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-tar.o mod-tar.o + $(TARGET_CC) $(tar_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-tar.o mod-tar.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1588,7 +1588,7 @@ UNDSYMFILES += und-udf.lst udf.mod: pre-udf.o mod-udf.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-udf.o mod-udf.o + $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-udf.o mod-udf.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1645,7 +1645,7 @@ UNDSYMFILES += und-afs.lst afs.mod: pre-afs.o mod-afs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-afs.o mod-afs.o + $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-afs.o mod-afs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1705,7 +1705,7 @@ UNDSYMFILES += und-amiga.lst amiga.mod: pre-amiga.o mod-amiga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o + $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1762,7 +1762,7 @@ UNDSYMFILES += und-apple.lst apple.mod: pre-apple.o mod-apple.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o + $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1819,7 +1819,7 @@ UNDSYMFILES += und-pc.lst pc.mod: pre-pc.o mod-pc.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o + $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1876,7 +1876,7 @@ UNDSYMFILES += und-sun.lst sun.mod: pre-sun.o mod-sun.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o + $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1933,7 +1933,7 @@ UNDSYMFILES += und-acorn.lst acorn.mod: pre-acorn.o mod-acorn.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o + $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1990,7 +1990,7 @@ UNDSYMFILES += und-gpt.lst gpt.mod: pre-gpt.o mod-gpt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gpt.o mod-gpt.o + $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gpt.o mod-gpt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2052,7 +2052,7 @@ UNDSYMFILES += und-raid.lst raid.mod: pre-raid.o mod-raid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-raid.o mod-raid.o + $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-raid.o mod-raid.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2109,7 +2109,7 @@ UNDSYMFILES += und-raid5rec.lst raid5rec.mod: pre-raid5rec.o mod-raid5rec.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(raid5rec_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-raid5rec.o mod-raid5rec.o + $(TARGET_CC) $(raid5rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-raid5rec.o mod-raid5rec.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2166,7 +2166,7 @@ UNDSYMFILES += und-raid6rec.lst raid6rec.mod: pre-raid6rec.o mod-raid6rec.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(raid6rec_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-raid6rec.o mod-raid6rec.o + $(TARGET_CC) $(raid6rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-raid6rec.o mod-raid6rec.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2223,7 +2223,7 @@ UNDSYMFILES += und-mdraid.lst mdraid.mod: pre-mdraid.o mod-mdraid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(mdraid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-mdraid.o mod-mdraid.o + $(TARGET_CC) $(mdraid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-mdraid.o mod-mdraid.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2280,7 +2280,7 @@ UNDSYMFILES += und-dm_nv.lst dm_nv.mod: pre-dm_nv.o mod-dm_nv.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(dm_nv_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-dm_nv.o mod-dm_nv.o + $(TARGET_CC) $(dm_nv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-dm_nv.o mod-dm_nv.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2337,7 +2337,7 @@ UNDSYMFILES += und-lvm.lst lvm.mod: pre-lvm.o mod-lvm.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lvm.o mod-lvm.o + $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lvm.o mod-lvm.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2394,7 +2394,7 @@ UNDSYMFILES += und-scsi.lst scsi.mod: pre-scsi.o mod-scsi.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(scsi_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-scsi.o mod-scsi.o + $(TARGET_CC) $(scsi_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-scsi.o mod-scsi.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2458,7 +2458,7 @@ UNDSYMFILES += und-minicmd.lst minicmd.mod: pre-minicmd.o mod-minicmd.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(minicmd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-minicmd.o mod-minicmd.o + $(TARGET_CC) $(minicmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-minicmd.o mod-minicmd.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2515,7 +2515,7 @@ UNDSYMFILES += und-extcmd.lst extcmd.mod: pre-extcmd.o mod-extcmd.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(extcmd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-extcmd.o mod-extcmd.o + $(TARGET_CC) $(extcmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-extcmd.o mod-extcmd.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2591,7 +2591,7 @@ UNDSYMFILES += und-hello.lst hello.mod: pre-hello.o mod-hello.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o + $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2648,7 +2648,7 @@ UNDSYMFILES += und-handler.lst handler.mod: pre-handler.o mod-handler.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(handler_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-handler.o mod-handler.o + $(TARGET_CC) $(handler_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-handler.o mod-handler.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2705,7 +2705,7 @@ UNDSYMFILES += und-ls.lst ls.mod: pre-ls.o mod-ls.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o + $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2762,7 +2762,7 @@ UNDSYMFILES += und-cmp.lst cmp.mod: pre-cmp.o mod-cmp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o + $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2819,7 +2819,7 @@ UNDSYMFILES += und-cat.lst cat.mod: pre-cat.o mod-cat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o + $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2876,7 +2876,7 @@ UNDSYMFILES += und-echo.lst echo.mod: pre-echo.o mod-echo.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-echo.o mod-echo.o + $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-echo.o mod-echo.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2933,7 +2933,7 @@ UNDSYMFILES += und-help.lst help.mod: pre-help.o mod-help.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o + $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2990,7 +2990,7 @@ UNDSYMFILES += und-search.lst search.mod: pre-search.o mod-search.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o + $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3047,7 +3047,7 @@ UNDSYMFILES += und-test.lst test.mod: pre-test.o mod-test.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-test.o mod-test.o + $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-test.o mod-test.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3104,7 +3104,7 @@ UNDSYMFILES += und-loopback.lst loopback.mod: pre-loopback.o mod-loopback.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o + $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3161,7 +3161,7 @@ UNDSYMFILES += und-fs_uuid.lst fs_uuid.mod: pre-fs_uuid.o mod-fs_uuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fs_uuid.o mod-fs_uuid.o + $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fs_uuid.o mod-fs_uuid.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3218,7 +3218,7 @@ UNDSYMFILES += und-configfile.lst configfile.mod: pre-configfile.o mod-configfile.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o + $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3275,7 +3275,7 @@ UNDSYMFILES += und-terminfo.lst terminfo.mod: pre-terminfo.o mod-terminfo.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-terminfo.o mod-terminfo.o + $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-terminfo.o mod-terminfo.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3351,7 +3351,7 @@ UNDSYMFILES += und-blocklist.lst blocklist.mod: pre-blocklist.o mod-blocklist.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-blocklist.o mod-blocklist.o + $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-blocklist.o mod-blocklist.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3408,7 +3408,7 @@ UNDSYMFILES += und-hexdump.lst hexdump.mod: pre-hexdump.o mod-hexdump.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hexdump.o mod-hexdump.o + $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hexdump.o mod-hexdump.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3484,7 +3484,7 @@ UNDSYMFILES += und-read.lst read.mod: pre-read.o mod-read.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-read.o mod-read.o + $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-read.o mod-read.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3541,7 +3541,7 @@ UNDSYMFILES += und-sleep.lst sleep.mod: pre-sleep.o mod-sleep.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sleep.o mod-sleep.o + $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sleep.o mod-sleep.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3598,7 +3598,7 @@ UNDSYMFILES += und-loadenv.lst loadenv.mod: pre-loadenv.o mod-loadenv.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-loadenv.o mod-loadenv.o + $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadenv.o mod-loadenv.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3674,7 +3674,7 @@ UNDSYMFILES += und-crc.lst crc.mod: pre-crc.o mod-crc.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(crc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-crc.o mod-crc.o + $(TARGET_CC) $(crc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-crc.o mod-crc.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3754,7 +3754,7 @@ UNDSYMFILES += und-video.lst video.mod: pre-video.o mod-video.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o + $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3811,7 +3811,7 @@ UNDSYMFILES += und-videotest.lst videotest.mod: pre-videotest.o mod-videotest.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-videotest.o mod-videotest.o + $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-videotest.o mod-videotest.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3868,7 +3868,7 @@ UNDSYMFILES += und-bitmap.lst bitmap.mod: pre-bitmap.o mod-bitmap.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bitmap.o mod-bitmap.o + $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-bitmap.o mod-bitmap.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3925,7 +3925,7 @@ UNDSYMFILES += und-tga.lst tga.mod: pre-tga.o mod-tga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-tga.o mod-tga.o + $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-tga.o mod-tga.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3982,7 +3982,7 @@ UNDSYMFILES += und-jpeg.lst jpeg.mod: pre-jpeg.o mod-jpeg.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jpeg.o mod-jpeg.o + $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-jpeg.o mod-jpeg.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -4039,7 +4039,7 @@ UNDSYMFILES += und-png.lst png.mod: pre-png.o mod-png.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-png.o mod-png.o + $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-png.o mod-png.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -4096,7 +4096,7 @@ UNDSYMFILES += und-font.lst font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -4172,7 +4172,7 @@ UNDSYMFILES += und-gfxterm.lst gfxterm.mod: pre-gfxterm.o mod-gfxterm.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o + $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -4232,7 +4232,7 @@ UNDSYMFILES += und-elf.lst elf.mod: pre-elf.o mod-elf.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-elf.o mod-elf.o + $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-elf.o mod-elf.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -4289,7 +4289,7 @@ UNDSYMFILES += und-gzio.lst gzio.mod: pre-gzio.o mod-gzio.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o + $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -4346,7 +4346,7 @@ UNDSYMFILES += und-bufio.lst bufio.mod: pre-bufio.o mod-bufio.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(bufio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bufio.o mod-bufio.o + $(TARGET_CC) $(bufio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-bufio.o mod-bufio.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 14fe36975..2ea7ec4cb 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -643,7 +643,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -715,7 +715,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1058,7 +1058,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1134,7 +1134,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1210,7 +1210,7 @@ UNDSYMFILES += und-serial.lst serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1271,7 +1271,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1405,7 +1405,7 @@ UNDSYMFILES += und-aout.lst aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1462,7 +1462,7 @@ UNDSYMFILES += und-play.lst play.mod: pre-play.o mod-play.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o + $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1519,7 +1519,7 @@ UNDSYMFILES += und-ata.lst ata.mod: pre-ata.o mod-ata.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o + $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1576,7 +1576,7 @@ UNDSYMFILES += und-memdisk.lst memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1633,7 +1633,7 @@ UNDSYMFILES += und-pci.lst pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1690,7 +1690,7 @@ UNDSYMFILES += und-lspci.lst lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1747,7 +1747,7 @@ UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1823,7 +1823,7 @@ UNDSYMFILES += und-date.lst date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1880,7 +1880,7 @@ UNDSYMFILES += und-datehook.lst datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1937,7 +1937,7 @@ UNDSYMFILES += und-lsmmap.lst lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index d30ea9a75..7a71520a7 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -142,7 +142,7 @@ UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -837,7 +837,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1180,7 +1180,7 @@ UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1237,7 +1237,7 @@ UNDSYMFILES += und-appleldr.lst appleldr.mod: pre-appleldr.o mod-appleldr.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1294,7 +1294,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1351,7 +1351,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1408,7 +1408,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1465,7 +1465,7 @@ UNDSYMFILES += und-pci.lst pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1522,7 +1522,7 @@ UNDSYMFILES += und-lspci.lst lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1579,7 +1579,7 @@ UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1655,7 +1655,7 @@ UNDSYMFILES += und-date.lst date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1712,7 +1712,7 @@ UNDSYMFILES += und-datehook.lst datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 29060d95c..7b5a91589 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -668,7 +668,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1014,7 +1014,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1129,7 +1129,7 @@ UNDSYMFILES += und-aout.lst aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1186,7 +1186,7 @@ UNDSYMFILES += und-suspend.lst suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1243,7 +1243,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1300,7 +1300,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1357,7 +1357,7 @@ UNDSYMFILES += und-serial.lst serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1414,7 +1414,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1471,7 +1471,7 @@ UNDSYMFILES += und-nand.lst nand.mod: pre-nand.o mod-nand.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-nand.o mod-nand.o + $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-nand.o mod-nand.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1528,7 +1528,7 @@ UNDSYMFILES += und-memdisk.lst memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1585,7 +1585,7 @@ UNDSYMFILES += und-pci.lst pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1642,7 +1642,7 @@ UNDSYMFILES += und-lspci.lst lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1699,7 +1699,7 @@ UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1775,7 +1775,7 @@ UNDSYMFILES += und-date.lst date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1832,7 +1832,7 @@ UNDSYMFILES += und-datehook.lst datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1889,7 +1889,7 @@ UNDSYMFILES += und-lsmmap.lst lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 1b76550e9..09bc0b1cf 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -1030,7 +1030,7 @@ UNDSYMFILES += und-biosdisk.lst biosdisk.mod: pre-biosdisk.o mod-biosdisk.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-biosdisk.o mod-biosdisk.o + $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-biosdisk.o mod-biosdisk.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1087,7 +1087,7 @@ UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1144,7 +1144,7 @@ UNDSYMFILES += und-linux16.lst linux16.mod: pre-linux16.o mod-linux16.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux16_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux16.o mod-linux16.o + $(TARGET_CC) $(linux16_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux16.o mod-linux16.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1201,7 +1201,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1273,7 +1273,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1616,7 +1616,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1673,7 +1673,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1730,7 +1730,7 @@ UNDSYMFILES += und-serial.lst serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o + $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1791,7 +1791,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1926,7 +1926,7 @@ UNDSYMFILES += und-vbe.lst vbe.mod: pre-vbe.o mod-vbe.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vbe.o mod-vbe.o + $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vbe.o mod-vbe.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2040,7 +2040,7 @@ UNDSYMFILES += und-vbeinfo.lst vbeinfo.mod: pre-vbeinfo.o mod-vbeinfo.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vbeinfo.o mod-vbeinfo.o + $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vbeinfo.o mod-vbeinfo.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2097,7 +2097,7 @@ UNDSYMFILES += und-vbetest.lst vbetest.mod: pre-vbetest.o mod-vbetest.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vbetest.o mod-vbetest.o + $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vbetest.o mod-vbetest.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2154,7 +2154,7 @@ UNDSYMFILES += und-play.lst play.mod: pre-play.o mod-play.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o + $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2211,7 +2211,7 @@ UNDSYMFILES += und-ata.lst ata.mod: pre-ata.o mod-ata.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o + $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2268,7 +2268,7 @@ UNDSYMFILES += und-vga.lst vga.mod: pre-vga.o mod-vga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vga.o mod-vga.o + $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vga.o mod-vga.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2325,7 +2325,7 @@ UNDSYMFILES += und-memdisk.lst memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2382,7 +2382,7 @@ UNDSYMFILES += und-pci.lst pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2439,7 +2439,7 @@ UNDSYMFILES += und-lspci.lst lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2496,7 +2496,7 @@ UNDSYMFILES += und-aout.lst aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o + $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2553,7 +2553,7 @@ UNDSYMFILES += und-bsd.lst bsd.mod: pre-bsd.o mod-bsd.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-bsd.o mod-bsd.o + $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-bsd.o mod-bsd.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2610,7 +2610,7 @@ UNDSYMFILES += und-usb.lst usb.mod: pre-usb.o mod-usb.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(usb_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usb.o mod-usb.o + $(TARGET_CC) $(usb_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usb.o mod-usb.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2705,7 +2705,7 @@ UNDSYMFILES += und-usbtest.lst usbtest.mod: pre-usbtest.o mod-usbtest.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(usbtest_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usbtest.o mod-usbtest.o + $(TARGET_CC) $(usbtest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usbtest.o mod-usbtest.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2762,7 +2762,7 @@ UNDSYMFILES += und-uhci.lst uhci.mod: pre-uhci.o mod-uhci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(uhci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-uhci.o mod-uhci.o + $(TARGET_CC) $(uhci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-uhci.o mod-uhci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2819,7 +2819,7 @@ UNDSYMFILES += und-ohci.lst ohci.mod: pre-ohci.o mod-ohci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ohci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ohci.o mod-ohci.o + $(TARGET_CC) $(ohci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ohci.o mod-ohci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2876,7 +2876,7 @@ UNDSYMFILES += und-usbms.lst usbms.mod: pre-usbms.o mod-usbms.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(usbms_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usbms.o mod-usbms.o + $(TARGET_CC) $(usbms_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usbms.o mod-usbms.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2933,7 +2933,7 @@ UNDSYMFILES += und-usb_keyboard.lst usb_keyboard.mod: pre-usb_keyboard.o mod-usb_keyboard.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(usb_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-usb_keyboard.o mod-usb_keyboard.o + $(TARGET_CC) $(usb_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usb_keyboard.o mod-usb_keyboard.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2990,7 +2990,7 @@ UNDSYMFILES += und-pxe.lst pxe.mod: pre-pxe.o mod-pxe.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pxe_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pxe.o mod-pxe.o + $(TARGET_CC) $(pxe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pxe.o mod-pxe.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3047,7 +3047,7 @@ UNDSYMFILES += und-pxecmd.lst pxecmd.mod: pre-pxecmd.o mod-pxecmd.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pxecmd_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pxecmd.o mod-pxecmd.o + $(TARGET_CC) $(pxecmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pxecmd.o mod-pxecmd.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3104,7 +3104,7 @@ UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3180,7 +3180,7 @@ UNDSYMFILES += und-date.lst date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3237,7 +3237,7 @@ UNDSYMFILES += und-datehook.lst datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3294,7 +3294,7 @@ UNDSYMFILES += und-lsmmap.lst lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3351,7 +3351,7 @@ UNDSYMFILES += und-ata_pthru.lst ata_pthru.mod: pre-ata_pthru.o mod-ata_pthru.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ata_pthru_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ata_pthru.o mod-ata_pthru.o + $(TARGET_CC) $(ata_pthru_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ata_pthru.o mod-ata_pthru.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -3408,7 +3408,7 @@ UNDSYMFILES += und-hdparm.lst hdparm.mod: pre-hdparm.o mod-hdparm.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hdparm_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hdparm.o mod-hdparm.o + $(TARGET_CC) $(hdparm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hdparm.o mod-hdparm.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/i386.mk b/conf/i386.mk index 32b2e2f6a..8ae2621a7 100644 --- a/conf/i386.mk +++ b/conf/i386.mk @@ -13,7 +13,7 @@ UNDSYMFILES += und-cpuid.lst cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o + $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -70,7 +70,7 @@ UNDSYMFILES += und-at_keyboard.lst at_keyboard.mod: pre-at_keyboard.o mod-at_keyboard.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(at_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-at_keyboard.o mod-at_keyboard.o + $(TARGET_CC) $(at_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-at_keyboard.o mod-at_keyboard.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -127,7 +127,7 @@ UNDSYMFILES += und-vga_text.lst vga_text.mod: pre-vga_text.o mod-vga_text.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(vga_text_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-vga_text.o mod-vga_text.o + $(TARGET_CC) $(vga_text_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vga_text.o mod-vga_text.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 57fbf6ff0..c6ff70a0d 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -653,7 +653,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -725,7 +725,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1068,7 +1068,7 @@ UNDSYMFILES += und-suspend.lst suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1125,7 +1125,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1182,7 +1182,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1241,7 +1241,7 @@ UNDSYMFILES += und-multiboot.lst multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o + $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1336,7 +1336,7 @@ UNDSYMFILES += und-memdisk.lst memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o + $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1393,7 +1393,7 @@ UNDSYMFILES += und-lsmmap.lst lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o + $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 2d5030463..dc096919a 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -211,7 +211,7 @@ UNDSYMFILES += und-fshelp.lst fshelp.mod: pre-fshelp.o mod-fshelp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o + $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -268,7 +268,7 @@ UNDSYMFILES += und-fat.lst fat.mod: pre-fat.o mod-fat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o + $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -325,7 +325,7 @@ UNDSYMFILES += und-ext2.lst ext2.mod: pre-ext2.o mod-ext2.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o + $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -382,7 +382,7 @@ UNDSYMFILES += und-ufs.lst ufs.mod: pre-ufs.o mod-ufs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o + $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -439,7 +439,7 @@ UNDSYMFILES += und-minix.lst minix.mod: pre-minix.o mod-minix.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o + $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -496,7 +496,7 @@ UNDSYMFILES += und-hfs.lst hfs.mod: pre-hfs.o mod-hfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o + $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -553,7 +553,7 @@ UNDSYMFILES += und-jfs.lst jfs.mod: pre-jfs.o mod-jfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o + $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -615,7 +615,7 @@ UNDSYMFILES += und-xfs.lst xfs.mod: pre-xfs.o mod-xfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o + $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -672,7 +672,7 @@ UNDSYMFILES += und-affs.lst affs.mod: pre-affs.o mod-affs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o + $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -729,7 +729,7 @@ UNDSYMFILES += und-sfs.lst sfs.mod: pre-sfs.o mod-sfs.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o + $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -811,7 +811,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1173,7 +1173,7 @@ UNDSYMFILES += und-hello.lst hello.mod: pre-hello.o mod-hello.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o + $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1230,7 +1230,7 @@ UNDSYMFILES += und-boot.lst boot.mod: pre-boot.o mod-boot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-boot.o mod-boot.o + $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-boot.o mod-boot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1287,7 +1287,7 @@ UNDSYMFILES += und-terminal.lst terminal.mod: pre-terminal.o mod-terminal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-terminal.o mod-terminal.o + $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-terminal.o mod-terminal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1344,7 +1344,7 @@ UNDSYMFILES += und-ls.lst ls.mod: pre-ls.o mod-ls.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o + $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1401,7 +1401,7 @@ UNDSYMFILES += und-cmp.lst cmp.mod: pre-cmp.o mod-cmp.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o + $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1458,7 +1458,7 @@ UNDSYMFILES += und-cat.lst cat.mod: pre-cat.o mod-cat.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o + $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1515,7 +1515,7 @@ UNDSYMFILES += und-font.lst font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o + $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1572,7 +1572,7 @@ UNDSYMFILES += und-amiga.lst amiga.mod: pre-amiga.o mod-amiga.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o + $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1629,7 +1629,7 @@ UNDSYMFILES += und-apple.lst apple.mod: pre-apple.o mod-apple.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o + $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1686,7 +1686,7 @@ UNDSYMFILES += und-pc.lst pc.mod: pre-pc.o mod-pc.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o + $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1743,7 +1743,7 @@ UNDSYMFILES += und-sun.lst sun.mod: pre-sun.o mod-sun.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o + $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1800,7 +1800,7 @@ UNDSYMFILES += und-acorn.lst acorn.mod: pre-acorn.o mod-acorn.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o + $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1856,7 +1856,7 @@ UNDSYMFILES += und-loopback.lst loopback.mod: pre-loopback.o mod-loopback.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o + $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1913,7 +1913,7 @@ UNDSYMFILES += und-suspend.lst suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o + $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1970,7 +1970,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2027,7 +2027,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2084,7 +2084,7 @@ UNDSYMFILES += und-help.lst help.mod: pre-help.o mod-help.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o + $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2151,7 +2151,7 @@ UNDSYMFILES += und-configfile.lst configfile.mod: pre-configfile.o mod-configfile.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o + $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2208,7 +2208,7 @@ UNDSYMFILES += und-search.lst search.mod: pre-search.o mod-search.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o + $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -2265,7 +2265,7 @@ UNDSYMFILES += und-gzio.lst gzio.mod: pre-gzio.o mod-gzio.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o + $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index e845b9818..c745deb55 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -130,7 +130,7 @@ UNDSYMFILES += und-kernel.lst kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o + $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -845,7 +845,7 @@ UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1188,7 +1188,7 @@ UNDSYMFILES += und-chain.lst chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o + $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1245,7 +1245,7 @@ UNDSYMFILES += und-appleldr.lst appleldr.mod: pre-appleldr.o mod-appleldr.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o + $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1302,7 +1302,7 @@ UNDSYMFILES += und-linux.lst linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o + $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1359,7 +1359,7 @@ UNDSYMFILES += und-halt.lst halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o + $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1416,7 +1416,7 @@ UNDSYMFILES += und-reboot.lst reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o + $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1473,7 +1473,7 @@ UNDSYMFILES += und-pci.lst pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o + $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1530,7 +1530,7 @@ UNDSYMFILES += und-lspci.lst lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o + $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1587,7 +1587,7 @@ UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1663,7 +1663,7 @@ UNDSYMFILES += und-date.lst date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o + $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ @@ -1720,7 +1720,7 @@ UNDSYMFILES += und-datehook.lst datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o + $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ diff --git a/configure b/configure index 84291ecbc..dcb2365cd 100644 --- a/configure +++ b/configure @@ -649,7 +649,6 @@ enable_grub_emu_usb enable_grub_emu LIBUSB LIBCURSES -MODULE_LDFLAGS TARGET_LDFLAGS TARGET_CPPFLAGS TARGET_CFLAGS @@ -7444,7 +7443,6 @@ fi - # Set them to their new values for the tests below. CC="$TARGET_CC" CFLAGS="$TARGET_CFLAGS" diff --git a/configure.ac b/configure.ac index 80b499cec..1751bd06d 100644 --- a/configure.ac +++ b/configure.ac @@ -364,7 +364,6 @@ fi AC_SUBST(TARGET_CFLAGS) AC_SUBST(TARGET_CPPFLAGS) AC_SUBST(TARGET_LDFLAGS) -AC_SUBST(MODULE_LDFLAGS) # Set them to their new values for the tests below. CC="$TARGET_CC" diff --git a/genmk.rb b/genmk.rb index 41b0752bd..62e5066b1 100644 --- a/genmk.rb +++ b/genmk.rb @@ -114,7 +114,7 @@ UNDSYMFILES += #{undsym} #{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) -rm -f $@ - $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) $(MODULE_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj} + $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj} if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ From 7a6bf9f220292246d5ed80ef0fefefefe780faa8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 3 Apr 2009 20:03:39 +0000 Subject: [PATCH 0599/1707] 2009-04-03 Robert Millan * loader/i386/linux.c (grub_linux_setup_video): Fill `params->{red,green,blue,reserved}_{mask_size,field_pos}' with values from `mode info' structure instead of hardcoded values. --- ChangeLog | 7 +++++++ loader/i386/linux.c | 16 ++++++++-------- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 853274146..bb3b98a64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-03 Robert Millan + + * loader/i386/linux.c (grub_linux_setup_video): Fill + `params->{red,green,blue,reserved}_{mask_size,field_pos}' with + values from `mode info' structure instead of hardcoded + values. + 2009-04-01 Pavel Roskin * Makefile.in: Remove all references to MODULE_LDFLAGS, it's diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 33b6d8659..a2fff83fa 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -304,14 +304,14 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->lfb_base = (void *) render_target->data; params->lfb_size = (params->lfb_line_len * params->lfb_height + 65535) >> 16; - params->red_mask_size = 8; - params->red_field_pos = 16; - params->green_mask_size = 8; - params->green_field_pos = 8; - params->blue_mask_size = 8; - params->blue_field_pos = 0; - params->reserved_mask_size = 8; - params->reserved_field_pos = 24; + params->red_mask_size = mode_info.red_mask_size; + params->red_field_pos = mode_info.red_field_pos; + params->green_mask_size = mode_info.green_mask_size; + params->green_field_pos = mode_info.green_field_pos; + params->blue_mask_size = mode_info.blue_mask_size; + params->blue_field_pos = mode_info.blue_field_pos; + params->reserved_mask_size = mode_info.reserved_mask_size; + params->reserved_field_pos = mode_info.reserved_field_pos; return 0; } From 54ad95559eade8c0239ded2909f3191e51e2ee4d Mon Sep 17 00:00:00 2001 From: okuji Date: Fri, 3 Apr 2009 20:19:36 +0000 Subject: [PATCH 0600/1707] 2009-04-04 Yoshinori K. Okuji * loader/i386/efi/linux.c (fake_bios_data): Use grub_dprintf instead of grub_printf. --- ChangeLog | 5 +++++ loader/i386/efi/linux.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb3b98a64..12394bad6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-04 Yoshinori K. Okuji + + * loader/i386/efi/linux.c (fake_bios_data): Use grub_dprintf + instead of grub_printf. + 2009-04-03 Robert Millan * loader/i386/linux.c (grub_linux_setup_video): Fill diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index c62198a4a..d8c6a67c1 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -306,7 +306,7 @@ fake_bios_data (void) if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) { acpi = grub_efi_system_table->configuration_table[i].vendor_table; - grub_printf ("ACPI2: %p\n", acpi); + grub_dprintf ("linux", "ACPI2: %p\n", acpi); } else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) { @@ -315,7 +315,7 @@ fake_bios_data (void) t = grub_efi_system_table->configuration_table[i].vendor_table; if (! acpi) acpi = t; - grub_printf ("ACPI: %p\n", t); + grub_dprintf ("linux", "ACPI: %p\n", t); } } From da4c0bb62945bfec4ddb37b3344dc3d54babaf11 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 4 Apr 2009 07:42:13 +0000 Subject: [PATCH 0601/1707] 2009-04-04 Bean * include/grub/util/misc.h: Add dummy function fsync for mingw. * util/misc.c: Likewise. --- ChangeLog | 6 ++++++ include/grub/util/misc.h | 1 + util/misc.c | 5 +++++ 3 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 12394bad6..c94409d61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-04 Bean + + * include/grub/util/misc.h: Add dummy function fsync for mingw. + + * util/misc.c: Likewise. + 2009-04-04 Yoshinori K. Okuji * loader/i386/efi/linux.c (fake_bios_data): Use grub_dprintf diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h index 2e920c1b4..9eaef8837 100644 --- a/include/grub/util/misc.h +++ b/include/grub/util/misc.h @@ -69,6 +69,7 @@ int asprintf (char **buf, const char *fmt, ...); #define ftello ftello64 void sync (void); +int fsync (int fno); void sleep(int s); grub_int64_t grub_util_get_disk_size (char *name); diff --git a/util/misc.c b/util/misc.c index 64c35fd9f..bd162ee93 100644 --- a/util/misc.c +++ b/util/misc.c @@ -370,6 +370,11 @@ void sync (void) { } +int fsync (int fno __attribute__ ((unused))) +{ + return 0; +} + void sleep (int s) { Sleep (s * 1000); From 838c4542964a7cf14a1d2d3f76d083f8de36177b Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 4 Apr 2009 08:08:01 +0000 Subject: [PATCH 0602/1707] 2009-04-04 Bean * include/grub/efi/api.h (grub_efi_configuration_table): Add packed attribute, otherwise the size would be wrong for i386 platform. * include/grub/pci.h (grub_pci_read_word): New inline function. (grub_pci_read_byte): Likewise. (grub_pci_write): Likewise. (grub_pci_write_word): Likewise. (grub_pci_write_byte): Likewise. * include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR. * loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module. (find_framebuf): Scan pci to locate the frame buffer address. * commands/efi/fixvideo.c: New file. * commands/efi/loadbios.c: Likewise. * commands/memrw.c: Likewise. * util/grub-dumpbios.in: Likewise. * conf/common.rmk (grub-dumpbios): New utility. (pkglib_MODULES): New module memrw.mod. (memrw_mod_SOURCE): New macro. (memrw_mod_CFLAGS): Likewise. (memrw_mod_LDFLAGS): Likewise. * conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and fixvideo.mod. (loadbios_mod_SOURCE): New macro. (loadbios_mod_CFLAGS): Likewise. (loadbios_mod_LDFLAGS): Likewise. (fixvideo_mod_SOURCE): Likewise. (fixvideo_mod_CFLAGS): Likewise. (fixvideo_mod_LDFLAGS): Likewise. * conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and fixvideo.mod. (loadbios_mod_SOURCE): New macro. (loadbios_mod_CFLAGS): Likewise. (loadbios_mod_LDFLAGS): Likewise. (fixvideo_mod_SOURCE): Likewise. (fixvideo_mod_CFLAGS): Likewise. (fixvideo_mod_LDFLAGS): Likewise. --- ChangeLog | 48 + DISTLIST | 4 + commands/efi/fixvideo.c | 110 + commands/efi/loadbios.c | 210 ++ commands/memrw.c | 101 + conf/common.mk | 65 +- conf/common.rmk | 13 +- conf/i386-efi.mk | 116 +- conf/i386-efi.rmk | 12 +- conf/x86_64-efi.mk | 116 +- conf/x86_64-efi.rmk | 12 +- config.h.in | 54 +- configure | 5253 +++++++++++++++++---------------------- include/grub/efi/api.h | 2 +- include/grub/i386/pci.h | 35 + include/grub/pci.h | 4 +- loader/i386/efi/linux.c | 314 +-- util/grub-dumpbios.in | 58 + 18 files changed, 3387 insertions(+), 3140 deletions(-) create mode 100644 commands/efi/fixvideo.c create mode 100644 commands/efi/loadbios.c create mode 100644 commands/memrw.c create mode 100644 util/grub-dumpbios.in diff --git a/ChangeLog b/ChangeLog index c94409d61..83cf82af1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,51 @@ +2009-04-04 Bean + + * include/grub/efi/api.h (grub_efi_configuration_table): Add packed + attribute, otherwise the size would be wrong for i386 platform. + + * include/grub/pci.h (grub_pci_read_word): New inline function. + (grub_pci_read_byte): Likewise. + (grub_pci_write): Likewise. + (grub_pci_write_word): Likewise. + (grub_pci_write_byte): Likewise. + + * include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR. + + * loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module. + (find_framebuf): Scan pci to locate the frame buffer address. + + * commands/efi/fixvideo.c: New file. + + * commands/efi/loadbios.c: Likewise. + + * commands/memrw.c: Likewise. + + * util/grub-dumpbios.in: Likewise. + + * conf/common.rmk (grub-dumpbios): New utility. + (pkglib_MODULES): New module memrw.mod. + (memrw_mod_SOURCE): New macro. + (memrw_mod_CFLAGS): Likewise. + (memrw_mod_LDFLAGS): Likewise. + + * conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and + fixvideo.mod. + (loadbios_mod_SOURCE): New macro. + (loadbios_mod_CFLAGS): Likewise. + (loadbios_mod_LDFLAGS): Likewise. + (fixvideo_mod_SOURCE): Likewise. + (fixvideo_mod_CFLAGS): Likewise. + (fixvideo_mod_LDFLAGS): Likewise. + + * conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and + fixvideo.mod. + (loadbios_mod_SOURCE): New macro. + (loadbios_mod_CFLAGS): Likewise. + (loadbios_mod_LDFLAGS): Likewise. + (fixvideo_mod_SOURCE): Likewise. + (fixvideo_mod_CFLAGS): Likewise. + (fixvideo_mod_LDFLAGS): Likewise. + 2009-04-04 Bean * include/grub/util/misc.h: Add dummy function fsync for mingw. diff --git a/DISTLIST b/DISTLIST index 6b1f798d7..57a76165b 100644 --- a/DISTLIST +++ b/DISTLIST @@ -58,6 +58,7 @@ commands/loadenv.c commands/ls.c commands/lsmmap.c commands/lspci.c +commands/memrw.c commands/minicmd.c commands/read.c commands/reboot.c @@ -66,6 +67,8 @@ commands/sleep.c commands/test.c commands/usbtest.c commands/videotest.c +commands/efi/fixvideo.c +commands/efi/loadbios.c commands/i386/cpuid.c commands/i386/pc/halt.c commands/i386/pc/play.c @@ -442,6 +445,7 @@ term/i386/pc/vga_text.c term/ieee1275/ofconsole.c util/console.c util/getroot.c +util/grub-dumpbios.in util/grub-editenv.c util/grub-emu.c util/grub-fstest.c diff --git a/commands/efi/fixvideo.c b/commands/efi/fixvideo.c new file mode 100644 index 000000000..013c1eec6 --- /dev/null +++ b/commands/efi/fixvideo.c @@ -0,0 +1,110 @@ +/* fixvideo.c - fix video problem in efi */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +static struct grub_video_patch +{ + const char *name; + grub_uint32_t pci_id; + grub_uint32_t mmio_bar; + grub_uint32_t mmio_reg; + grub_uint32_t mmio_old; +} video_patches[] = + { + {"Intel 945GM", 0x27a28086, 0, 0x71184, 0x1000000}, /* DSPBBASE */ + {"Intel 965GM", 0x2a028086, 0, 0x7119C, 0x1000000}, /* DSPBSURF */ + {0, 0, 0, 0, 0} + }; + +static int NESTED_FUNC_ATTR +scan_card (int bus, int dev, int func, grub_pci_id_t pciid) +{ + grub_pci_address_t addr; + + addr = grub_pci_make_address (bus, dev, func, 2); + if (grub_pci_read_byte (addr + 3) == 0x3) + { + struct grub_video_patch *p = video_patches; + + while (p->name) + { + if (p->pci_id == pciid) + { + grub_target_addr_t base; + + grub_printf ("Found graphic card: %s\n", p->name); + addr += 8 + p->mmio_bar * 4; + base = grub_pci_read (addr); + if ((! base) || (base & GRUB_PCI_ADDR_SPACE_IO) || + (base & GRUB_PCI_ADDR_MEM_PREFETCH)) + grub_printf ("Invalid MMIO bar %d\n", p->mmio_bar); + else + { + base &= GRUB_PCI_ADDR_MEM_MASK; + base += p->mmio_reg; + + if (*((volatile grub_uint32_t *) base) != p->mmio_old) + grub_printf ("Old value don't match\n"); + else + { + *((volatile grub_uint32_t *) base) = 0; + if (*((volatile grub_uint32_t *) base)) + grub_printf ("Set MMIO fails\n"); + } + } + + return 1; + } + p++; + } + + grub_printf ("Unknown graphic card: %x\n", pciid); + } + + return 0; +} + +static grub_err_t +grub_cmd_fixvideo (grub_command_t cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + grub_pci_iterate (scan_card); + return 0; +} + +static grub_command_t cmd_fixvideo; + +GRUB_MOD_INIT(fixvideo) +{ + (void) mod; /* To stop warning. */ + cmd_fixvideo = grub_register_command ("fix_video", grub_cmd_fixvideo, + 0, "Fix video problem."); + +} + +GRUB_MOD_FINI(fixvideo) +{ + grub_unregister_command (cmd_fixvideo); +} diff --git a/commands/efi/loadbios.c b/commands/efi/loadbios.c new file mode 100644 index 000000000..7cb8b2c66 --- /dev/null +++ b/commands/efi/loadbios.c @@ -0,0 +1,210 @@ +/* loadbios.c - command to load a bios dump */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; +static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; +static grub_efi_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID; + +#define EBDA_SEG_ADDR 0x40e +#define LOW_MEM_ADDR 0x413 +#define FAKE_EBDA_SEG 0x9fc0 + +#define BLANK_MEM 0xffffffff +#define VBIOS_ADDR 0xc0000 +#define SBIOS_ADDR 0xf0000 + +static int +enable_rom_area (void) +{ + grub_pci_address_t addr; + grub_uint32_t *rom_ptr; + + rom_ptr = (grub_uint32_t *) VBIOS_ADDR; + if (*rom_ptr != BLANK_MEM) + { + grub_printf ("ROM image present.\n"); + return 0; + } + + addr = grub_pci_make_address (0, 0, 0, 36); + grub_pci_write_byte (addr++, 0x30); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr, 0); + + *rom_ptr = 0; + if (*rom_ptr != 0) + { + grub_printf ("Can\'t enable rom area.\n"); + return 0; + } + + return 1; +} + +static void +lock_rom_area (void) +{ + grub_pci_address_t addr; + + addr = grub_pci_make_address (0, 0, 0, 36); + grub_pci_write_byte (addr++, 0x10); + grub_pci_write_byte (addr++, 0x11); + grub_pci_write_byte (addr++, 0x11); + grub_pci_write_byte (addr++, 0x11); + grub_pci_write_byte (addr, 0x11); +} + +static void +fake_bios_data (int use_rom) +{ + unsigned i; + void *acpi, *smbios; + grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; + + ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; + low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; + if ((*ebda_seg_ptr) || (*low_mem_ptr)) + return; + + acpi = 0; + smbios = 0; + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + { + grub_efi_guid_t *guid = + &grub_efi_system_table->configuration_table[i].vendor_guid; + + if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) + { + acpi = grub_efi_system_table->configuration_table[i].vendor_table; + grub_dprintf ("efi", "ACPI2: %p\n", acpi); + } + else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) + { + void *t; + + t = grub_efi_system_table->configuration_table[i].vendor_table; + if (! acpi) + acpi = t; + grub_dprintf ("efi", "ACPI: %p\n", t); + } + else if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_efi_guid_t))) + { + smbios = grub_efi_system_table->configuration_table[i].vendor_table; + grub_dprintf ("efi", "SMBIOS: %p\n", smbios); + } + } + + *ebda_seg_ptr = FAKE_EBDA_SEG; + *low_mem_ptr = (FAKE_EBDA_SEG >> 6); + + if (acpi) + grub_memcpy ((char *) (FAKE_EBDA_SEG << 4), acpi, 1024); + + if ((use_rom) && (smbios)) + grub_memcpy ((char *) SBIOS_ADDR, (char *) smbios + 16, 16); +} + +static grub_err_t +grub_cmd_fakebios (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + if (enable_rom_area ()) + { + fake_bios_data (1); + lock_rom_area (); + } + else + fake_bios_data (0); +} + +static grub_err_t +grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_file_t file; + int size; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "No rom image specified"); + + if (argc > 1) + { + file = grub_file_open (argv[1]); + if (! file) + return grub_errno; + + if (file->size != 4) + grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid int10 dump size"); + else + grub_file_read (file, (char *) 0x40, 4); + + grub_file_close (file); + if (grub_errno) + return grub_errno; + } + + file = grub_file_open (argv[0]); + if (! file) + return grub_errno; + + size = file->size; + if ((size < 0x10000) || (size > 0x40000)) + grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid bios dump size"); + else if (enable_rom_area ()) + { + grub_file_read (file, (char *) VBIOS_ADDR, size); + fake_bios_data (size <= 0x40000); + lock_rom_area (); + } + + grub_file_close (file); + return grub_errno; +} + +static grub_command_t cmd_fakebios, cmd_loadbios; + +GRUB_MOD_INIT(loadbios) +{ + (void) mod; /* To stop warning. */ + cmd_fakebios = grub_register_command ("fakebios", grub_cmd_fakebios, + 0, "fake bios."); + + cmd_loadbios = grub_register_command ("loadbios", grub_cmd_loadbios, + "loadbios BIOS_DUMP [INT10_DUMP]", + "Load bios dump."); +} + +GRUB_MOD_FINI(loadbios) +{ + grub_unregister_command (cmd_fakebios); + grub_unregister_command (cmd_loadbios); +} diff --git a/commands/memrw.c b/commands/memrw.c new file mode 100644 index 000000000..fa04c7609 --- /dev/null +++ b/commands/memrw.c @@ -0,0 +1,101 @@ +/* memrw.c - command to read / write physical memory */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +static grub_command_t cmd_read_byte, cmd_read_word, cmd_read_dword; +static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword; + +static grub_err_t +grub_cmd_read (grub_command_t cmd, int argc, char **argv) +{ + grub_target_addr_t addr; + grub_uint32_t value; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments"); + + addr = grub_strtoul (argv[0], 0, 0); + if (cmd->name[5] == 'd') + value = *((grub_uint32_t *) addr); + else if (cmd->name[5] == 'w') + value = *((grub_uint16_t *) addr); + else + value = *((grub_uint8_t *) addr); + + grub_printf ("0x%x\n", value); + + return 0; +} + +static grub_err_t +grub_cmd_write (grub_command_t cmd, int argc, char **argv) +{ + grub_target_addr_t addr; + grub_uint32_t value; + + if (argc != 2) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments"); + + addr = grub_strtoul (argv[0], 0, 0); + value = grub_strtoul (argv[1], 0, 0); + if (cmd->name[6] == 'd') + *((grub_uint32_t *) addr) = value; + else if (cmd->name[6] == 'w') + *((grub_uint16_t *) addr) = (grub_uint16_t) value; + else + *((grub_uint8_t *) addr) = (grub_uint8_t) value; + + return 0; +} + +GRUB_MOD_INIT(memrw) +{ + (void) mod; /* To stop warning. */ + cmd_read_byte = + grub_register_command ("read_byte", grub_cmd_read, + "read_byte ADDR", "read byte."); + cmd_read_word = + grub_register_command ("read_word", grub_cmd_read, + "read_word ADDR", "read word."); + cmd_read_dword = + grub_register_command ("read_dword", grub_cmd_read, + "read_dword ADDR", "read dword."); + cmd_write_byte = + grub_register_command ("write_byte", grub_cmd_write, + "write_byte ADDR VALUE", "write byte."); + cmd_write_word = + grub_register_command ("write_word", grub_cmd_write, + "write_word ADDR VALUE", "write word."); + cmd_write_dword = + grub_register_command ("write_dword", grub_cmd_write, + "write_dword ADDR VALUE", "write dword."); +} + +GRUB_MOD_FINI(memrw) +{ + grub_unregister_command (cmd_read_byte); + grub_unregister_command (cmd_read_word); + grub_unregister_command (cmd_read_dword); + grub_unregister_command (cmd_write_byte); + grub_unregister_command (cmd_write_word); + grub_unregister_command (cmd_write_dword); +} diff --git a/conf/common.mk b/conf/common.mk index 9411a59c7..5703d5194 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -600,6 +600,12 @@ CLEANFILES += $(grub-mkconfig_SCRIPTS) grub-mkconfig_DATA += util/grub.d/README +# For grub-dumpbios +grub-dumpbios: util/grub-dumpbios.in config.status + ./config.status --file=$@:$< + chmod +x $@ +sbin_SCRIPTS += grub-dumpbios +CLEANFILES += grub-dumpbios # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ @@ -2444,7 +2450,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod + read.mod sleep.mod loadenv.mod crc.mod memrw.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -3738,6 +3744,63 @@ partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist. crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memrw.mod. +memrw_mod_SOURCES = commands/memrw.c +CLEANFILES += memrw.mod mod-memrw.o mod-memrw.c pre-memrw.o memrw_mod-commands_memrw.o und-memrw.lst +ifneq ($(memrw_mod_EXPORTS),no) +CLEANFILES += def-memrw.lst +DEFSYMFILES += def-memrw.lst +endif +MOSTLYCLEANFILES += memrw_mod-commands_memrw.d +UNDSYMFILES += und-memrw.lst + +memrw.mod: pre-memrw.o mod-memrw.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memrw.o mod-memrw.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-memrw.o: $(memrw_mod_DEPENDENCIES) memrw_mod-commands_memrw.o + -rm -f $@ + $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memrw_mod-commands_memrw.o + +mod-memrw.o: mod-memrw.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -c -o $@ $< + +mod-memrw.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'memrw' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(memrw_mod_EXPORTS),no) +def-memrw.lst: pre-memrw.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memrw/' > $@ +endif + +und-memrw.lst: pre-memrw.o + echo 'memrw' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +memrw_mod-commands_memrw.o: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -MD -c -o $@ $< +-include memrw_mod-commands_memrw.d + +CLEANFILES += cmd-memrw_mod-commands_memrw.lst fs-memrw_mod-commands_memrw.lst partmap-memrw_mod-commands_memrw.lst +COMMANDFILES += cmd-memrw_mod-commands_memrw.lst +FSFILES += fs-memrw_mod-commands_memrw.lst +PARTMAPFILES += partmap-memrw_mod-commands_memrw.lst + +cmd-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memrw > $@ || (rm -f $@; exit 1) + +fs-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memrw > $@ || (rm -f $@; exit 1) + +partmap-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memrw > $@ || (rm -f $@; exit 1) + + +memrw_mod_CFLAGS = $(COMMON_CFLAGS) +memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/common.rmk b/conf/common.rmk index 43bc683b0..ffe4ea2e6 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -155,6 +155,12 @@ CLEANFILES += $(grub-mkconfig_SCRIPTS) grub-mkconfig_DATA += util/grub.d/README +# For grub-dumpbios +grub-dumpbios: util/grub-dumpbios.in config.status + ./config.status --file=$@:$< + chmod +x $@ +sbin_SCRIPTS += grub-dumpbios +CLEANFILES += grub-dumpbios # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ @@ -335,7 +341,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod + read.mod sleep.mod loadenv.mod crc.mod memrw.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -442,6 +448,11 @@ crc_mod_SOURCES = commands/crc.c lib/crc.c crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memrw.mod. +memrw_mod_SOURCES = commands/memrw.c +memrw_mod_CFLAGS = $(COMMON_CFLAGS) +memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 7a71520a7..1eb2392ab 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -118,7 +118,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1757,5 +1757,119 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst +ifneq ($(loadbios_mod_EXPORTS),no) +CLEANFILES += def-loadbios.lst +DEFSYMFILES += def-loadbios.lst +endif +MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d +UNDSYMFILES += und-loadbios.lst + +loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o + +mod-loadbios.o: mod-loadbios.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< + +mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(loadbios_mod_EXPORTS),no) +def-loadbios.lst: pre-loadbios.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ +endif + +und-loadbios.lst: pre-loadbios.o + echo 'loadbios' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< +-include loadbios_mod-commands_efi_loadbios.d + +CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst +COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst +FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst +PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst + +cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) + +fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) + +partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) + + +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst +ifneq ($(fixvideo_mod_EXPORTS),no) +CLEANFILES += def-fixvideo.lst +DEFSYMFILES += def-fixvideo.lst +endif +MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d +UNDSYMFILES += und-fixvideo.lst + +fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o + +mod-fixvideo.o: mod-fixvideo.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< + +mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(fixvideo_mod_EXPORTS),no) +def-fixvideo.lst: pre-fixvideo.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ +endif + +und-fixvideo.lst: pre-fixvideo.o + echo 'fixvideo' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< +-include fixvideo_mod-commands_efi_fixvideo.d + +CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst +COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst +FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst +PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst + +cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) + +fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) + +partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) + + +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 18a99df7e..e2503047d 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -79,7 +79,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -182,5 +182,15 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index c745deb55..3f5397aa8 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -106,7 +106,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1765,5 +1765,119 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst +ifneq ($(loadbios_mod_EXPORTS),no) +CLEANFILES += def-loadbios.lst +DEFSYMFILES += def-loadbios.lst +endif +MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d +UNDSYMFILES += und-loadbios.lst + +loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o + +mod-loadbios.o: mod-loadbios.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< + +mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(loadbios_mod_EXPORTS),no) +def-loadbios.lst: pre-loadbios.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ +endif + +und-loadbios.lst: pre-loadbios.o + echo 'loadbios' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< +-include loadbios_mod-commands_efi_loadbios.d + +CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst +COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst +FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst +PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst + +cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) + +fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) + +partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) + + +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst +ifneq ($(fixvideo_mod_EXPORTS),no) +CLEANFILES += def-fixvideo.lst +DEFSYMFILES += def-fixvideo.lst +endif +MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d +UNDSYMFILES += und-fixvideo.lst + +fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o + +mod-fixvideo.o: mod-fixvideo.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< + +mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(fixvideo_mod_EXPORTS),no) +def-fixvideo.lst: pre-fixvideo.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ +endif + +und-fixvideo.lst: pre-fixvideo.o + echo 'fixvideo' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< +-include fixvideo_mod-commands_efi_fixvideo.d + +CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst +COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst +FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst +PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst + +cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) + +fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) + +partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) + + +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index faa59fb47..ec246eddd 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -81,7 +81,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -185,5 +185,15 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/config.h.in b/config.h.in index a5234009b..c110d6307 100644 --- a/config.h.in +++ b/config.h.in @@ -4,9 +4,6 @@ prefixed with an asterisk */ #undef ABSOLUTE_WITHOUT_ASTERISK -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - /* Define it to \"addr32\" or \"addr32;\" to make GAS happy */ #undef ADDR32 @@ -115,52 +112,17 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif + /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE diff --git a/configure b/configure index dcb2365cd..a3bde5844 100644 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for GRUB 1.96. +# Generated by GNU Autoconf 2.61 for GRUB 1.96. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -39,45 +39,17 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -93,6 +65,8 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -115,7 +89,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -128,10 +102,17 @@ PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -153,7 +134,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -179,7 +160,7 @@ else as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -261,7 +242,7 @@ IFS=$as_save_IFS if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -282,7 +263,7 @@ _ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -362,10 +343,10 @@ fi if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -434,10 +415,9 @@ fi test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message } @@ -473,7 +453,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -501,6 +481,7 @@ case `echo -n x` in *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -513,22 +494,19 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -553,10 +531,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -637,115 +615,103 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='LTLIBOBJS -LIBOBJS -freetype_libs -freetype_cflags -enable_grub_mkfont -FREETYPE -enable_grub_pe2elf -enable_grub_fstest -enable_grub_emu_usb -enable_grub_emu -LIBUSB -LIBCURSES -TARGET_LDFLAGS -TARGET_CPPFLAGS -TARGET_CFLAGS -NM -STRIP -OBJCOPY -ac_ct_TARGET_CC -TARGET_CC -TARGET_OBJ2ELF -TARGET_IMG_LDFLAGS -TARGET_IMG_LDSCRIPT -enable_lzo -LIBLZO -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -HELP2MAN -RUBY -SET_MAKE -AWK -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -UNIFONT_BDF -YACC -CMP -platform -host_kernel -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME +ac_subst_vars='SHELL PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_platform -enable_largefile +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +host_kernel +platform +CMP +YACC +UNIFONT_BDF +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +AWK +SET_MAKE +RUBY +HELP2MAN +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +LIBLZO enable_lzo -enable_mm_debug +TARGET_IMG_LDSCRIPT +TARGET_IMG_LDFLAGS +TARGET_OBJ2ELF +TARGET_CC +ac_ct_TARGET_CC +OBJCOPY +STRIP +NM +TARGET_CFLAGS +TARGET_CPPFLAGS +TARGET_LDFLAGS +LIBCURSES +LIBUSB enable_grub_emu enable_grub_emu_usb enable_grub_fstest enable_grub_pe2elf +FREETYPE enable_grub_mkfont -' +freetype_cflags +freetype_libs +LIBOBJS +LTLIBOBJS' +ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias @@ -760,8 +726,6 @@ CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -860,21 +824,13 @@ do datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -887,21 +843,13 @@ do dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1092,38 +1040,22 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -1143,7 +1075,7 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option + -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1152,16 +1084,16 @@ Try \`$0 --help' for more information." >&2 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1170,38 +1102,22 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. +# Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1216,7 +1132,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1232,10 +1148,10 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1243,12 +1159,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" || if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1275,12 +1191,12 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1329,9 +1245,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1341,25 +1257,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/grub] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/grub] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1383,7 +1299,6 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files @@ -1425,17 +1340,15 @@ fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1471,7 +1384,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1481,10 +1394,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GRUB configure 1.96 -generated by GNU Autoconf 2.63 +generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1495,7 +1408,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1531,7 +1444,7 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1566,7 +1479,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1618,12 +1531,11 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1653,9 +1565,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1670,9 +1582,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1688,8 +1600,8 @@ _ASBOX echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1731,24 +1643,21 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE +# Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + set x "$prefix/share/config.site" "$prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" +shift +for ac_site_file do - test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1758,16 +1667,16 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1781,38 +1690,29 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1822,12 +1722,10 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1885,8 +1783,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -1901,34 +1799,34 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -1945,27 +1843,27 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -1982,27 +1880,27 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -$as_echo "$as_me: error: invalid value of canonical target" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target @@ -2032,10 +1930,13 @@ test "$program_prefix" != NONE && # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. +# Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed case "$host_cpu" in @@ -2064,8 +1965,8 @@ if test "x$with_platform" = x; then powerpc-*) platform=ieee1275 ;; powerpc64-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; - *) { { $as_echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 -$as_echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} + *) { { echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 +echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac else @@ -2091,8 +1992,8 @@ case "$target_cpu"-"$platform" in i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; - *) { { $as_echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 -$as_echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} + *) { { echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 +echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -2132,10 +2033,10 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CMP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CMP"; then ac_cv_prog_CMP="$CMP" # Let the user override the test. @@ -2148,7 +2049,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CMP="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2159,11 +2060,11 @@ fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - { $as_echo "$as_me:$LINENO: result: $CMP" >&5 -$as_echo "$CMP" >&6; } + { echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2171,8 +2072,8 @@ fi done if test "x$CMP" = x; then - { { $as_echo "$as_me:$LINENO: error: cmp is not found" >&5 -$as_echo "$as_me: error: cmp is not found" >&2;} + { { echo "$as_me:$LINENO: error: cmp is not found" >&5 +echo "$as_me: error: cmp is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2180,10 +2081,10 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_YACC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2196,7 +2097,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2207,11 +2108,11 @@ fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { $as_echo "$as_me:$LINENO: result: $YACC" >&5 -$as_echo "$YACC" >&6; } + { echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2219,8 +2120,8 @@ fi done if test "x$YACC" = x; then - { { $as_echo "$as_me:$LINENO: error: bison is not found" >&5 -$as_echo "$as_me: error: bison is not found" >&2;} + { { echo "$as_me:$LINENO: error: bison is not found" >&5 +echo "$as_me: error: bison is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2245,12 +2146,11 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2279,29 +2179,17 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done done ;; esac - done IFS=$as_save_IFS -rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2314,8 +2202,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2329,10 +2217,10 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2345,7 +2233,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2356,23 +2244,22 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh @@ -2389,12 +2276,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2402,10 +2289,10 @@ fi # These are not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RUBY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RUBY in [\\/]* | ?:[\\/]*) @@ -2420,7 +2307,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2432,20 +2319,20 @@ esac fi RUBY=$ac_cv_path_RUBY if test -n "$RUBY"; then - { $as_echo "$as_me:$LINENO: result: $RUBY" >&5 -$as_echo "$RUBY" >&6; } + { echo "$as_me:$LINENO: result: $RUBY" >&5 +echo "${ECHO_T}$RUBY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "help2man", so it can be a program name with args. set dummy help2man; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_HELP2MAN+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $HELP2MAN in [\\/]* | ?:[\\/]*) @@ -2460,7 +2347,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2472,11 +2359,11 @@ esac fi HELP2MAN=$ac_cv_path_HELP2MAN if test -n "$HELP2MAN"; then - { $as_echo "$as_me:$LINENO: result: $HELP2MAN" >&5 -$as_echo "$HELP2MAN" >&6; } + { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 +echo "${ECHO_T}$HELP2MAN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2493,10 +2380,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2509,7 +2396,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2520,11 +2407,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2533,10 +2420,10 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2549,7 +2436,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2560,11 +2447,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2572,8 +2459,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2586,10 +2477,10 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2602,7 +2493,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2613,11 +2504,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2626,10 +2517,10 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2647,7 +2538,7 @@ do continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2670,11 +2561,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2685,10 +2576,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2701,7 +2592,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2712,11 +2603,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2729,10 +2620,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2745,7 +2636,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2756,11 +2647,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2772,8 +2663,12 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2783,50 +2678,44 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2845,22 +2734,27 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2871,11 +2765,10 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2886,7 +2779,7 @@ for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2913,27 +2806,25 @@ else ac_file='' fi -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables +echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2942,53 +2833,49 @@ if test "$cross_compiling" != yes; then *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. +echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi fi fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2997,33 +2884,31 @@ $as_echo "$ac_try_echo") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3046,43 +2931,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3108,21 +2990,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -3132,19 +3013,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3171,21 +3048,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3210,21 +3086,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3250,21 +3125,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3279,8 +3153,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3296,10 +3170,10 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3370,21 +3244,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3400,15 +3273,15 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3419,25 +3292,383 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Must be GCC. -test "x$GCC" = xyes || { { $as_echo "$as_me:$LINENO: error: GCC is required" >&5 -$as_echo "$as_me: error: GCC is required" >&2;} +test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5 +echo "$as_me: error: GCC is required" >&2;} { (exit 1); exit 1; }; } +cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -f conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -f conftest* + fi +fi + + +# Identify characteristics of the host architecture. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3469,21 +3700,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3507,14 +3737,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3522,7 +3751,7 @@ $as_echo "$ac_try_echo") >&5 # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3547,8 +3776,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3576,21 +3805,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3614,14 +3842,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3629,7 +3856,7 @@ $as_echo "$ac_try_echo") >&5 # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3645,13 +3872,11 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi ac_ext=c @@ -3661,37 +3886,42 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -z "$GREP"; then ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3706,60 +3936,74 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_GREP_found && break 3 - done + + $ac_path_GREP_found && break 3 done done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } - fi +fi + else ac_cv_path_GREP=$GREP fi + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - if test -z "$EGREP"; then + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3774,31 +4018,40 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_EGREP_found && break 3 - done + + $ac_path_EGREP_found && break 3 done done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } - fi +fi + else ac_cv_path_EGREP=$EGREP fi + fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3825,21 +4078,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -3931,40 +4183,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3986,11 +4235,11 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4008,21 +4257,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -4030,15 +4278,12 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -4046,670 +4291,28 @@ fi done - - if test "${ac_cv_header_minix_config_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -$as_echo_n "checking minix/config.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -$as_echo_n "checking minix/config.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to bug-grub@gnu.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } - -fi -if test "x$ac_cv_header_minix_config_h" = x""yes; then - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_SOURCE 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_1_SOURCE 2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _MINIX 1 -_ACEOF - - fi - - - - { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_safe_to_define___extensions__=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_safe_to_define___extensions__=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - cat >>confdefs.h <<\_ACEOF -#define __EXTENSIONS__ 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _TANDEM_SOURCE 1 -_ACEOF - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=1; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* - fi -fi - - -# Identify characteristics of the host architecture. - - { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif ; return 0; @@ -4721,34 +4324,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif + not big endian +#endif ; return 0; @@ -4760,21 +4362,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -4782,31 +4383,29 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF + # It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - + _ascii (); _ebcdic (); ; return 0; } @@ -4817,139 +4416,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then - # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4968,14 +4458,14 @@ int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -4987,71 +4477,118 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF -;; #( - no) - ;; #( - universal) + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +case $ac_cv_c_bigendian in + yes) cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 +#define WORDS_BIGENDIAN 1 _ACEOF - - ;; #( - *) - { { $as_echo "$as_me:$LINENO: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -$as_echo "$as_me: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; - esac +esac + +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } +if test "${ac_cv_type_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef void * ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_void_p=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -5062,10 +4599,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5078,14 +4616,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5099,10 +4636,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5115,21 +4653,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -5143,7 +4680,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -5153,10 +4690,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5169,14 +4707,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5190,10 +4727,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5206,21 +4744,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -5234,7 +4771,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -5254,10 +4791,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5270,21 +4808,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -5295,13 +4832,11 @@ done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -5314,8 +4849,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (void *)); } -static unsigned long int ulongval () { return (long int) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5325,22 +4861,20 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (void *))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (void *)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (void *)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -5353,48 +4887,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } @@ -5403,14 +4932,68 @@ cat >>confdefs.h <<_ACEOF _ACEOF +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef long ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -5421,10 +5004,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5437,14 +5021,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5458,10 +5041,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5474,21 +5058,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -5502,7 +5085,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -5512,10 +5095,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5528,14 +5112,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5549,10 +5132,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5565,21 +5149,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -5593,7 +5176,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -5613,10 +5196,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5629,21 +5213,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -5654,13 +5237,11 @@ done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; @@ -5673,8 +5254,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (long)); } -static unsigned long int ulongval () { return (long int) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5684,22 +5266,20 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (long))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -5712,48 +5292,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } @@ -5784,10 +5359,10 @@ cat >>confdefs.h <<\_ACEOF #define ENABLE_LZO 1 _ACEOF - { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -$as_echo_n "checking for __lzo_init_v2 in -llzo2... " >&6; } + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" @@ -5819,43 +5394,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo2___lzo_init_v2=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo2___lzo_init_v2=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -$as_echo "$ac_cv_lib_lzo2___lzo_init_v2" >&6; } -if test "x$ac_cv_lib_lzo2___lzo_init_v2" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } +if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then LIBLZO="-llzo2" else - { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -$as_echo_n "checking for __lzo_init_v2 in -llzo... " >&6; } + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5887,43 +5458,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init_v2=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init_v2=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -$as_echo "$ac_cv_lib_lzo___lzo_init_v2" >&6; } -if test "x$ac_cv_lib_lzo___lzo_init_v2" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } +if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then LIBLZO="-llzo" else - { $as_echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -$as_echo_n "checking for __lzo_init2 in -llzo... " >&6; } + { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5955,41 +5522,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init2=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init2=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -$as_echo "$ac_cv_lib_lzo___lzo_init2" >&6; } -if test "x$ac_cv_lib_lzo___lzo_init2" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } +if test $ac_cv_lib_lzo___lzo_init2 = yes; then LIBLZO="-llzo" else - { { $as_echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 -$as_echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} + { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 +echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} { (exit 1); exit 1; }; } fi @@ -5999,10 +5562,10 @@ fi LIBS="$LIBS $LIBLZO" - { $as_echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -$as_echo_n "checking for lzo1x_999_compress... " >&6; } + { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6055,40 +5618,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_lzo1x_999_compress=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_lzo1x_999_compress=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -$as_echo "$ac_cv_func_lzo1x_999_compress" >&6; } -if test "x$ac_cv_func_lzo1x_999_compress" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } +if test $ac_cv_func_lzo1x_999_compress = yes; then : else - { { $as_echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 -$as_echo "$as_me: error: LZO1X-999 must be enabled" >&2;} + { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 +echo "$as_me: error: LZO1X-999 must be enabled" >&2;} { (exit 1); exit 1; }; } fi @@ -6098,21 +5657,20 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6128,33 +5686,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6168,52 +5725,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -6222,24 +5778,21 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6262,11 +5815,11 @@ fi for ac_func in posix_memalign memalign asprintf do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6319,42 +5872,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -6367,8 +5913,8 @@ done # Use linker script if present, otherwise use builtin -N script. -{ $as_echo "$as_me:$LINENO: checking for option to link raw image" >&5 -$as_echo_n "checking for option to link raw image... " >&6; } +{ echo "$as_me:$LINENO: checking for option to link raw image" >&5 +echo $ECHO_N "checking for option to link raw image... $ECHO_C" >&6; } if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" @@ -6380,19 +5926,19 @@ else fi -{ $as_echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 -$as_echo "$TARGET_IMG_LDFLAGS_AC" >&6; } +{ echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 +echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } # For platforms where ELF is not the default link format. -{ $as_echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 -$as_echo_n "checking for command to convert module to ELF format... " >&6; } +{ echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 +echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } case "${host_os}" in cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; *) ;; esac -{ $as_echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 -$as_echo "$TARGET_OBJ2ELF" >&6; } +{ echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 +echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } # For cross-compiling. if test "x$build" != "x$host"; then @@ -6405,10 +5951,10 @@ if test "x$build" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_TARGET_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$TARGET_CC"; then ac_cv_prog_TARGET_CC="$TARGET_CC" # Let the user override the test. @@ -6421,7 +5967,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6432,11 +5978,11 @@ fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - { $as_echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -$as_echo "$TARGET_CC" >&6; } + { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +echo "${ECHO_T}$TARGET_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6449,10 +5995,10 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_TARGET_CC"; then ac_cv_prog_ac_ct_TARGET_CC="$ac_ct_TARGET_CC" # Let the user override the test. @@ -6465,7 +6011,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6476,11 +6022,11 @@ fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -$as_echo "$ac_ct_TARGET_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6488,14 +6034,18 @@ fi done if test "x$ac_ct_TARGET_CC" = x; then - TARGET_CC="{ { $as_echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 -$as_echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} + TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 +echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac TARGET_CC=$ac_ct_TARGET_CC @@ -6505,10 +6055,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6521,7 +6071,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6532,11 +6082,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6545,10 +6095,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6561,7 +6111,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6572,11 +6122,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6584,8 +6134,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6597,10 +6151,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6613,7 +6167,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6624,11 +6178,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6637,10 +6191,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6653,7 +6207,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6664,11 +6218,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6676,8 +6230,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6689,10 +6247,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6705,7 +6263,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6716,11 +6274,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { $as_echo "$as_me:$LINENO: result: $NM" >&5 -$as_echo "$NM" >&6; } + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6729,10 +6287,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -6745,7 +6303,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6756,11 +6314,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -6768,8 +6326,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -6787,10 +6349,10 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6803,7 +6365,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6814,11 +6376,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6827,10 +6389,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6843,7 +6405,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6854,11 +6416,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6866,8 +6428,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6879,10 +6445,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6895,7 +6461,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6906,11 +6472,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6919,10 +6485,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6935,7 +6501,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6946,11 +6512,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6958,8 +6524,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6971,10 +6541,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6987,7 +6557,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6998,11 +6568,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { $as_echo "$as_me:$LINENO: result: $NM" >&5 -$as_echo "$NM" >&6; } + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -7011,10 +6581,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -7027,7 +6597,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7038,11 +6608,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -7050,8 +6620,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -7082,10 +6656,10 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - { $as_echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -$as_echo_n "checking whether optimization for size works... " >&6; } + { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } if test "${grub_cv_cc_Os+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS=-Os @@ -7110,21 +6684,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_Os=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_Os=no @@ -7133,8 +6706,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 -$as_echo "$grub_cv_cc_Os" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 +echo "${ECHO_T}$grub_cv_cc_Os" >&6; } if test "x$grub_cv_cc_Os" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -7143,10 +6716,10 @@ $as_echo "$grub_cv_cc_Os" >&6; } # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - { $as_echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -$as_echo_n "checking whether -falign-loops works... " >&6; } + { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } if test "${grub_cv_cc_falign_loop+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="-falign-loops=1" @@ -7171,21 +6744,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_falign_loop=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_falign_loop=no @@ -7194,8 +6766,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 -$as_echo "$grub_cv_cc_falign_loop" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 +echo "${ECHO_T}$grub_cv_cc_falign_loop" >&6; } if test "x$grub_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -7219,10 +6791,10 @@ fi if test "$target_cpu"-"$platform" = x86_64-efi; then # Use large model to support 4G memory - { $as_echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 -$as_echo_n "checking whether option -mcmodel=large works... " >&6; } + { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 +echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; } if test "${grub_cv_cc_mcmodel+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="-m64 -mcmodel=large" @@ -7247,21 +6819,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_mcmodel=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_mcmodel=no @@ -7270,19 +6841,19 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 -$as_echo "$grub_cv_cc_mcmodel" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 +echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; } if test "x$grub_cv_cc_no_mcmodel" = xno; then - { { $as_echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 -$as_echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} + { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 +echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi # EFI writes to stack below %rsp, we must not use the red zone - { $as_echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 -$as_echo_n "checking whether option -mno-red-zone works... " >&6; } + { echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 +echo $ECHO_N "checking whether option -mno-red-zone works... $ECHO_C" >&6; } if test "${grub_cv_cc_no_red_zone+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="-m64 -mno-red-zone" @@ -7307,21 +6878,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_no_red_zone=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_no_red_zone=no @@ -7330,11 +6900,11 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 -$as_echo "$grub_cv_cc_no_red_zone" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 +echo "${ECHO_T}$grub_cv_cc_no_red_zone" >&6; } if test "x$grub_cv_cc_no_red_zone" = xno; then - { { $as_echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 -$as_echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} + { { echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 +echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi @@ -7347,8 +6917,8 @@ fi # Need __enable_execute_stack() for nested function trampolines? -{ $as_echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 -$as_echo_n "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... " >&6; } +{ echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 +echo $ECHO_N "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF void f (int (*p) (void)); @@ -7363,12 +6933,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then @@ -7377,11 +6947,11 @@ cat >>confdefs.h <<\_ACEOF #define NEED_ENABLE_EXECUTE_STACK 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f conftest* @@ -7390,8 +6960,8 @@ rm -f conftest* # Smashing stack protector. ssp_possible=yes -{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -$as_echo_n "checking whether \`$CC' accepts \`-fstack-protector'... " >&6; } +{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -7399,14 +6969,14 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Need that, because some distributions ship compilers that include @@ -7417,20 +6987,20 @@ fi # Smashing stack arg probe. sap_possible=yes -{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 -$as_echo_n "checking whether \`$CC' accepts \`-mstack-arg-probe'... " >&6; } +{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-mstack-arg-probe'... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } _ACEOF if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else sap_possible=no - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Cygwin's GCC uses alloca() to probe the stackframe on static @@ -7450,10 +7020,10 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -{ $as_echo "$as_me:$LINENO: checking whether target compiler is working" >&5 -$as_echo_n "checking whether target compiler is working... " >&6; } +{ echo "$as_me:$LINENO: checking whether target compiler is working" >&5 +echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; } if test "${grub_cv_prog_target_cc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7476,48 +7046,44 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_prog_target_cc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_target_cc=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 -$as_echo "$grub_cv_prog_target_cc" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 +echo "${ECHO_T}$grub_cv_prog_target_cc" >&6; } if test "x$grub_cv_prog_target_cc" = xno; then - { { $as_echo "$as_me:$LINENO: error: cannot compile for the target" >&5 -$as_echo "$as_me: error: cannot compile for the target" >&2;} + { { echo "$as_me:$LINENO: error: cannot compile for the target" >&5 +echo "$as_me: error: cannot compile for the target" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -$as_echo_n "checking whether ${OBJCOPY} works for absolute addresses... " >&6; } +{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } if test "${grub_cv_prog_objcopy_absolute+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.c <<\EOF void @@ -7530,11 +7096,11 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest.o; then : else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 -$as_echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 +echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} { (exit 1); exit 1; }; } fi grub_cv_prog_objcopy_absolute=yes @@ -7543,29 +7109,29 @@ for link_addr in 2000 8000 7C00; do { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 -$as_echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 +echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} { (exit 1); exit 1; }; } fi if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { $as_echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 -$as_echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} + { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 +echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} { (exit 1); exit 1; }; } fi if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mv -f conftest conftest.old else @@ -7576,19 +7142,19 @@ done rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -$as_echo "$grub_cv_prog_objcopy_absolute" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } if test "x$grub_cv_prog_objcopy_absolute" = xno; then - { { $as_echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 -$as_echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} + { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 +echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 -$as_echo_n "checking whether linker accepts --build-id=none... " >&6; } +{ echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 +echo $ECHO_N "checking whether linker accepts --build-id=none... $ECHO_C" >&6; } if test "${grub_cv_prog_ld_build_id_none+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" @@ -7613,48 +7179,44 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_prog_ld_build_id_none=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_ld_build_id_none=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 -$as_echo "$grub_cv_prog_ld_build_id_none" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 +echo "${ECHO_T}$grub_cv_prog_ld_build_id_none" >&6; } if test "x$grub_cv_prog_ld_build_id_none" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" fi -{ $as_echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -$as_echo_n "checking if C symbols get an underscore after compilation... " >&6; } +{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } if test "${grub_cv_asm_uscore+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.c <<\EOF int @@ -7669,12 +7231,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi @@ -7696,8 +7258,8 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -$as_echo "$grub_cv_asm_uscore" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } if test "x$target_cpu" = xi386; then if test ! -z "$TARGET_IMG_LDSCRIPT"; then @@ -7706,10 +7268,10 @@ if test "x$target_cpu" = xi386; then fi if test "x$platform" = xpc; then -{ $as_echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -$as_echo_n "checking if __bss_start is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7732,42 +7294,38 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_uscore_bss_start_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -$as_echo "$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } -{ $as_echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -$as_echo_n "checking if edata is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_edata_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7790,42 +7348,38 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_edata_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_edata_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -$as_echo "$grub_cv_check_edata_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } -{ $as_echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -$as_echo_n "checking if _edata is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7848,37 +7402,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_edata_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_edata_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -$as_echo "$grub_cv_check_uscore_edata_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } @@ -7899,16 +7449,16 @@ elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then _ACEOF else - { { $as_echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 -$as_echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} + { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 +echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -$as_echo_n "checking if end is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_end_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7931,42 +7481,38 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_end_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_end_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -$as_echo "$grub_cv_check_end_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } -{ $as_echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -$as_echo_n "checking if _end is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_end_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7989,37 +7535,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_end_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_end_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -$as_echo "$grub_cv_check_uscore_end_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } @@ -8035,18 +7577,18 @@ elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then _ACEOF else - { { $as_echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 -$as_echo "$as_me: error: neither end nor _end is defined" >&2;} + { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 +echo "$as_me: error: neither end nor _end is defined" >&2;} { (exit 1); exit 1; }; } fi fi CFLAGS="$TARGET_CFLAGS" -{ $as_echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -$as_echo_n "checking whether addr32 must be in the same line as the instruction... " >&6; } +{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.s <<\EOF .code16 @@ -8057,7 +7599,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_prefix_requirement=yes else @@ -8087,14 +7629,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -$as_echo "$grub_cv_i386_asm_prefix_requirement" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } -{ $as_echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -$as_echo_n "checking for .code16 addr32 assembler support... " >&6; } +{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_addr32+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.s.in <<\EOF .code16 @@ -8111,7 +7653,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_addr32=yes else @@ -8122,13 +7664,13 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -$as_echo "$grub_cv_i386_asm_addr32" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } -{ $as_echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -$as_echo_n "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... " >&6; } +{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.s <<\EOF lcall *(offset) @@ -8141,7 +7683,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_absolute_without_asterisk=no else @@ -8160,13 +7702,13 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -$as_echo "$grub_cv_i386_asm_absolute_without_asterisk" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } -{ $as_echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -$as_echo_n "checking if GCC has the regparm=3 bug... " >&6; } +{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } if test "${grub_cv_i386_check_nested_functions+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then grub_cv_i386_check_nested_functions=yes @@ -8210,32 +7752,29 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then grub_cv_i386_check_nested_functions=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -8243,8 +7782,8 @@ fi fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -$as_echo "$grub_cv_i386_check_nested_functions" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -8263,7 +7802,7 @@ fi else cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR /**/ +#define NESTED_FUNC_ATTR _ACEOF fi @@ -8302,10 +7841,10 @@ fi if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - { $as_echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -$as_echo_n "checking for wgetch in -lncurses... " >&6; } + { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" @@ -8337,43 +7876,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ncurses_wgetch=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses_wgetch=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -$as_echo "$ac_cv_lib_ncurses_wgetch" >&6; } -if test "x$ac_cv_lib_ncurses_wgetch" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } +if test $ac_cv_lib_ncurses_wgetch = yes; then LIBCURSES="-lncurses" else - { $as_echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -$as_echo_n "checking for wgetch in -lcurses... " >&6; } + { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } if test "${ac_cv_lib_curses_wgetch+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" @@ -8405,41 +7940,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_curses_wgetch=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curses_wgetch=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -$as_echo "$ac_cv_lib_curses_wgetch" >&6; } -if test "x$ac_cv_lib_curses_wgetch" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } +if test $ac_cv_lib_curses_wgetch = yes; then LIBCURSES="-lcurses" else - { { $as_echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 -$as_echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} + { { echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 +echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -8451,21 +7982,20 @@ fi for ac_header in ncurses/curses.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8481,33 +8011,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8521,52 +8050,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8575,45 +8103,41 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in ncurses.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8629,33 +8153,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8669,52 +8192,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8723,45 +8245,41 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in curses.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8777,33 +8295,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8817,52 +8334,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8871,29 +8387,26 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { $as_echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 -$as_echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} + { { echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 +echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -8910,10 +8423,10 @@ done if [ x"$enable_grub_emu_usb" = xyes ]; then # Check for libusb libraries. - { $as_echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 -$as_echo_n "checking for usb_claim_interface in -lusb... " >&6; } + { echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 +echo $ECHO_N "checking for usb_claim_interface in -lusb... $ECHO_C" >&6; } if test "${ac_cv_lib_usb_usb_claim_interface+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusb $LIBS" @@ -8945,41 +8458,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_usb_usb_claim_interface=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_usb_usb_claim_interface=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 -$as_echo "$ac_cv_lib_usb_usb_claim_interface" >&6; } -if test "x$ac_cv_lib_usb_usb_claim_interface" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 +echo "${ECHO_T}$ac_cv_lib_usb_usb_claim_interface" >&6; } +if test $ac_cv_lib_usb_usb_claim_interface = yes; then LIBUSB="-lusb" else - { { $as_echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 -$as_echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} + { { echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 +echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -8989,21 +8498,20 @@ fi for ac_header in usb.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9019,33 +8527,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9059,52 +8566,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -9113,29 +8619,26 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { $as_echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 -$as_echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} + { { echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 +echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -9171,10 +8674,10 @@ if test x"$enable_grub_mkfont" = xyes ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_FREETYPE+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$FREETYPE"; then ac_cv_prog_FREETYPE="$FREETYPE" # Let the user override the test. @@ -9187,7 +8690,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_FREETYPE="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9198,11 +8701,11 @@ fi fi FREETYPE=$ac_cv_prog_FREETYPE if test -n "$FREETYPE"; then - { $as_echo "$as_me:$LINENO: result: $FREETYPE" >&5 -$as_echo "$FREETYPE" >&6; } + { echo "$as_me:$LINENO: result: $FREETYPE" >&5 +echo "${ECHO_T}$FREETYPE" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -9210,8 +8713,8 @@ fi done if test "x$FREETYPE" = x ; then - { { $as_echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 -$as_echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} + { { echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 +echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} { (exit 1); exit 1; }; } fi freetype_cflags=`freetype-config --cflags` @@ -9223,21 +8726,21 @@ fi # Output files. -{ $as_echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 -$as_echo_n "checking whether ln can handle directories properly... " >&6; } +{ echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 +echo $ECHO_N "checking whether ln can handle directories properly... $ECHO_C" >&6; } mkdir testdir 2>/dev/null case $srcdir in [\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; *) reldir=../$srcdir/include/grub/util ;; esac if ln -s $reldir testdir/util 2>/dev/null ; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } link_dir=yes else link_dir=no - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -rf testdir @@ -9282,12 +8785,11 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -9320,12 +8822,12 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -9341,7 +8843,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -9353,14 +8855,12 @@ LTLIBOBJS=$ac_ltlibobjs - : ${CONFIG_STATUS=./config.status} -ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -9373,7 +8873,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -9383,7 +8883,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -9405,45 +8905,17 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -9459,6 +8931,8 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -9481,7 +8955,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -9494,10 +8968,17 @@ PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -9519,7 +9000,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -9570,7 +9051,7 @@ $as_unset CDPATH s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -9598,6 +9079,7 @@ case `echo -n x` in *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -9610,22 +9092,19 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -9650,10 +9129,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -9676,7 +9155,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9689,16 +9168,7 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -9706,23 +9176,22 @@ config_links="$ac_config_links" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -9736,25 +9205,24 @@ $config_links Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' -AWK='$AWK' -test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do @@ -9776,36 +9244,30 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 + { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 + -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -9824,32 +9286,30 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL export CONFIG_SHELL - exec "\$@" + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets @@ -9863,8 +9323,8 @@ do "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -9905,144 +9365,159 @@ $debug || (umask 077 && mkdir "$tmp") } || { - $as_echo "$as_me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then - -ac_cr=' ' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +host_kernel!$host_kernel$ac_delim +platform!$platform$ac_delim +CMP!$CMP$ac_delim +YACC!$YACC$ac_delim +UNIFONT_BDF!$UNIFONT_BDF$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +RUBY!$RUBY$ac_delim +HELP2MAN!$HELP2MAN$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LIBLZO!$LIBLZO$ac_delim +enable_lzo!$enable_lzo$ac_delim +TARGET_IMG_LDSCRIPT!$TARGET_IMG_LDSCRIPT$ac_delim +TARGET_IMG_LDFLAGS!$TARGET_IMG_LDFLAGS$ac_delim +TARGET_OBJ2ELF!$TARGET_OBJ2ELF$ac_delim +TARGET_CC!$TARGET_CC$ac_delim +ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim +OBJCOPY!$OBJCOPY$ac_delim +STRIP!$STRIP$ac_delim +NM!$NM$ac_delim +TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim +TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim +TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim +LIBCURSES!$LIBCURSES$ac_delim +LIBUSB!$LIBUSB$ac_delim +enable_grub_emu!$enable_grub_emu$ac_delim +enable_grub_emu_usb!$enable_grub_emu_usb$ac_delim +enable_grub_fstest!$enable_grub_fstest$ac_delim +enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim +FREETYPE!$FREETYPE$ac_delim +enable_grub_mkfont!$enable_grub_mkfont$ac_delim +freetype_cflags!$freetype_cflags$ac_delim +freetype_libs!$freetype_libs$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done -rm -f conf$$subs.sh -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof _ACEOF + # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -10058,133 +9533,19 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS " -shift -for ac_tag +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -10213,38 +9574,26 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac @@ -10254,7 +9603,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -10280,7 +9629,7 @@ $as_echo X"$ac_file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -10289,7 +9638,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -10310,17 +9659,17 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -10360,13 +9709,12 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { +case `sed -n '/datarootdir/ { p q } @@ -10375,14 +9723,13 @@ ac_sed_dataroot=' /@infodir@/p /@localedir@/p /@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -10396,16 +9743,15 @@ _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t +s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -10415,94 +9761,146 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac ;; :H) # # CONFIG_HEADER # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + rm -f $ac_file + mv "$tmp/config.h" $ac_file fi else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" ;; :L) # # CONFIG_LINK # - if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then - : - else - # Prefer the file from the source tree if names are identical. - if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then - ac_source=$srcdir/$ac_source - fi + { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} - { $as_echo "$as_me:$LINENO: linking $ac_source to $ac_file" >&5 -$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} - - if test ! -r "$ac_source"; then - { { $as_echo "$as_me:$LINENO: error: $ac_source: file not found" >&5 -$as_echo "$as_me: error: $ac_source: file not found" >&2;} - { (exit 1); exit 1; }; } - fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $srcdir in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$ac_source" "$ac_file" 2>/dev/null || - cp -p "$ac_source" "$ac_file" || - { { $as_echo "$as_me:$LINENO: error: cannot link or copy $ac_source to $ac_file" >&5 -$as_echo "$as_me: error: cannot link or copy $ac_source to $ac_file" >&2;} + if test ! -r "$srcdir/$ac_source"; then + { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 +echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $srcdir in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || + cp -p "$srcdir/$ac_source" "$ac_file" || + { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -10520,11 +9918,6 @@ _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -10546,8 +9939,4 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index a764b370d..598c7c359 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -933,7 +933,7 @@ struct grub_efi_configuration_table { grub_efi_guid_t vendor_guid; void *vendor_table; -}; +} __attribute__ ((packed)); typedef struct grub_efi_configuration_table grub_efi_configuration_table_t; struct grub_efi_simple_input_interface diff --git a/include/grub/i386/pci.h b/include/grub/i386/pci.h index f4f08ab11..996f64245 100644 --- a/include/grub/i386/pci.h +++ b/include/grub/i386/pci.h @@ -32,4 +32,39 @@ grub_pci_read (grub_pci_address_t addr) return grub_inl (GRUB_PCI_DATA_REG); } +static inline grub_uint16_t +grub_pci_read_word (grub_pci_address_t addr) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + return grub_inw (GRUB_PCI_DATA_REG + (addr & 3)); +} + +static inline grub_uint8_t +grub_pci_read_byte (grub_pci_address_t addr) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + return grub_inb (GRUB_PCI_DATA_REG + (addr & 3)); +} + +static inline void +grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) +{ + grub_outl (addr, GRUB_PCI_ADDR_REG); + grub_outl (data, GRUB_PCI_DATA_REG); +} + +static inline void +grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + grub_outw (data, GRUB_PCI_DATA_REG + (addr & 3)); +} + +static inline void +grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3)); +} + #endif /* GRUB_CPU_PCI_H */ diff --git a/include/grub/pci.h b/include/grub/pci.h index aceee494f..7c8b50528 100644 --- a/include/grub/pci.h +++ b/include/grub/pci.h @@ -36,8 +36,8 @@ #define GRUB_PCI_ADDR_IO_MASK ~0x03 typedef grub_uint32_t grub_pci_id_t; -typedef int (*grub_pci_iteratefunc_t) (int bus, int device, int func, - grub_pci_id_t pciid); +typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t) + (int bus, int device, int func, grub_pci_id_t pciid); typedef grub_uint32_t grub_pci_address_t; grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device, diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index d8c6a67c1..100b268be 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #define GRUB_LINUX_CL_OFFSET 0x1000 @@ -248,9 +249,9 @@ allocate_pages (grub_size_t prot_size) } grub_dprintf ("linux", "real_mode_mem = %lx, real_mode_pages = %x, " - "prot_mode_mem = %lx, prot_mode_pages = %x\n", - (unsigned long) real_mode_mem, (unsigned) real_mode_pages, - (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); + "prot_mode_mem = %lx, prot_mode_pages = %x\n", + (unsigned long) real_mode_mem, (unsigned) real_mode_pages, + (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); grub_free (mmap); return 1; @@ -263,8 +264,8 @@ allocate_pages (grub_size_t prot_size) static void grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, - grub_uint64_t start, grub_uint64_t size, - grub_uint32_t type) + grub_uint64_t start, grub_uint64_t size, + grub_uint32_t type) { int n = *e820_num; @@ -283,57 +284,6 @@ grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, } } -static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; -static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; - -#define EBDA_SEG_ADDR 0x40e -#define LOW_MEM_ADDR 0x413 -#define FAKE_EBDA_SEG 0x9fc0 - -static void -fake_bios_data (void) -{ - unsigned i; - void *acpi; - grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; - - acpi = 0; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - { - grub_efi_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; - - if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) - { - acpi = grub_efi_system_table->configuration_table[i].vendor_table; - grub_dprintf ("linux", "ACPI2: %p\n", acpi); - } - else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) - { - void *t; - - t = grub_efi_system_table->configuration_table[i].vendor_table; - if (! acpi) - acpi = t; - grub_dprintf ("linux", "ACPI: %p\n", t); - } - } - - if (acpi == 0) - return; - - ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; - low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; - - if ((*ebda_seg_ptr) || (*low_mem_ptr)) - return; - - *ebda_seg_ptr = FAKE_EBDA_SEG; - *low_mem_ptr = FAKE_EBDA_SEG >> 6; - - grub_memcpy ((char *) (FAKE_EBDA_SEG << 4), acpi, 1024); -} - #ifdef __x86_64__ struct { @@ -353,13 +303,11 @@ grub_linux_boot (void) grub_efi_memory_descriptor_t *desc; int e820_num; - fake_bios_data (); - params = real_mode_mem; grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", (unsigned) params->code32_start, - (unsigned long) &(idt_desc.limit), + (unsigned long) &(idt_desc.limit), (unsigned long) &(gdt_desc.limit)); grub_dprintf ("linux", "idt = %x:%lx, gdt = %x:%lx\n", (unsigned) idt_desc.limit, (unsigned long) idt_desc.base, @@ -376,69 +324,69 @@ grub_linux_boot (void) desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { switch (desc->type) - { - case GRUB_EFI_ACPI_RECLAIM_MEMORY: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_ACPI); - break; + { + case GRUB_EFI_ACPI_RECLAIM_MEMORY: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_ACPI); + break; - case GRUB_EFI_ACPI_MEMORY_NVS: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_NVS); - break; + case GRUB_EFI_ACPI_MEMORY_NVS: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_NVS); + break; - case GRUB_EFI_RUNTIME_SERVICES_CODE: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_EXEC_CODE); - break; + case GRUB_EFI_RUNTIME_SERVICES_CODE: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_EXEC_CODE); + break; - case GRUB_EFI_LOADER_CODE: - case GRUB_EFI_LOADER_DATA: - case GRUB_EFI_BOOT_SERVICES_CODE: - case GRUB_EFI_BOOT_SERVICES_DATA: - case GRUB_EFI_CONVENTIONAL_MEMORY: - { - grub_uint64_t start, size, end; + case GRUB_EFI_LOADER_CODE: + case GRUB_EFI_LOADER_DATA: + case GRUB_EFI_BOOT_SERVICES_CODE: + case GRUB_EFI_BOOT_SERVICES_DATA: + case GRUB_EFI_CONVENTIONAL_MEMORY: + { + grub_uint64_t start, size, end; - start = desc->physical_start; - size = desc->num_pages << 12; - end = start + size; + start = desc->physical_start; + size = desc->num_pages << 12; + end = start + size; - /* Skip A0000 - 100000 region. */ - if ((start < 0x100000ULL) && (end > 0xA0000ULL)) - { - if (start < 0xA0000ULL) - { - grub_e820_add_region (params->e820_map, &e820_num, - start, - 0xA0000ULL - start, - GRUB_E820_RAM); - } + /* Skip A0000 - 100000 region. */ + if ((start < 0x100000ULL) && (end > 0xA0000ULL)) + { + if (start < 0xA0000ULL) + { + grub_e820_add_region (params->e820_map, &e820_num, + start, + 0xA0000ULL - start, + GRUB_E820_RAM); + } - if (end <= 0x100000ULL) - continue; + if (end <= 0x100000ULL) + continue; - start = 0x100000ULL; - size = end - start; - } + start = 0x100000ULL; + size = end - start; + } - grub_e820_add_region (params->e820_map, &e820_num, - start, size, GRUB_E820_RAM); - break; - } + grub_e820_add_region (params->e820_map, &e820_num, + start, size, GRUB_E820_RAM); + break; + } - default: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_RESERVED); - } + default: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_RESERVED); + } } params->mmap_size = e820_num; @@ -520,41 +468,106 @@ static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; #define FBTEST_STEP (0x10000 >> 2) #define FBTEST_COUNT 8 -static grub_uint32_t fb_list[]= - {0x40000000, 0x80000000, 0xc0000000, 0}; +static int +find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) +{ + grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb_base; + int i; + + for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) + { + if ((*base & RGB_MASK) == RGB_MAGIC) + { + int j; + + for (j = LINE_MIN; j <= LINE_MAX; j++) + { + if ((base[j] & RGB_MASK) == RGB_MAGIC) + { + *fb_base = (grub_uint32_t) (grub_target_addr_t) base; + *line_len = j << 2; + + return 1; + } + } + + break; + } + } + + return 0; +} static int find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) { - grub_uint32_t *fb; + int found = 0; - for (fb = fb_list; *fb; fb++) + auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, + grub_pci_id_t pciid); + + int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, + grub_pci_id_t pciid) { - grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb; - int i; + grub_pci_address_t addr; - for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) - { - if ((*base & RGB_MASK) == RGB_MAGIC) + addr = grub_pci_make_address (bus, dev, func, 2); + if (grub_pci_read (addr) >> 24 == 0x3) + { + int i; + + grub_printf ("Display controller: %d:%d.%d\nDevice id: %x\n", + bus, dev, func, pciid); + addr += 8; + for (i = 0; i < 6; i++, addr += 4) { - int j; + grub_uint32_t old_bar1, old_bar2, type; + grub_uint64_t base64; - for (j = LINE_MIN; j <= LINE_MAX; j++) - { - if ((base[j] & RGB_MASK) == RGB_MAGIC) - { - *fb_base = (grub_uint32_t) (grub_target_addr_t) base; - *line_len = j << 2; + old_bar1 = grub_pci_read (addr); + if ((! old_bar1) || (old_bar1 & GRUB_PCI_ADDR_SPACE_IO)) + continue; - return 0; - } - } + type = old_bar1 & GRUB_PCI_ADDR_MEM_TYPE_MASK; + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + if (i == 5) + break; - break; - } - } + old_bar2 = grub_pci_read (addr + 4); + } + else + old_bar2 = 0; + + base64 = old_bar2; + base64 <<= 32; + base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK); + + grub_printf ("%s(%d): 0x%llx\n", + ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ? + "VMEM" : "MMIO"), i, + (unsigned long long) base64); + + if ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) && (! found)) + { + *fb_base = base64; + if (find_line_len (fb_base, line_len)) + found++; + } + + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + i++; + addr += 4; + } + } + } + + return found; } - return 1; + + grub_pci_iterate (find_card); + return found; } static int @@ -580,13 +593,13 @@ grub_linux_setup_video (struct linux_kernel_params *params) ret = find_framebuf (&fb_base, &line_len); grub_efi_set_text_mode (1); - if (ret) + if (! ret) { grub_printf ("Can\'t find frame buffer address\n"); return 1; } - grub_printf ("Video frame buffer: 0x%x\n", fb_base); + grub_printf ("Frame buffer base: 0x%x\n", fb_base); grub_printf ("Video line length: %d\n", line_len); params->lfb_width = width; @@ -606,6 +619,9 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->reserved_mask_size = 8; params->reserved_field_pos = 24; + params->have_vga = GRUB_VIDEO_TYPE_VLFB; + params->vid_mode = 0x338; /* 1024x768x32 */ + return 0; } @@ -621,7 +637,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_ssize_t len; int i; char *dest; - int video_type; grub_dl_ref (my_mod); @@ -808,9 +823,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_printf (" [Linux-bzImage, setup=0x%x, size=0x%x]\n", (unsigned) real_size, (unsigned) prot_size); + grub_linux_setup_video (params); + /* Detect explicitly specified memory size, if any. */ linux_mem_size = 0; - video_type = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "mem=", 4) == 0) { @@ -846,20 +862,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_mem_size <<= shift; } } - else if (grub_memcmp (argv[i], "video=", 6) == 0) + else if (grub_memcmp (argv[i], "video=efifb", 11) == 0) { - if (grub_memcmp (&argv[i][6], "vesafb", 6) == 0) - video_type = GRUB_VIDEO_TYPE_VLFB; - else if (grub_memcmp (&argv[i][6], "efifb", 5) == 0) - video_type = GRUB_VIDEO_TYPE_EFI; + if (params->have_vga) + params->have_vga = GRUB_VIDEO_TYPE_EFI; } - if (video_type) - { - if (! grub_linux_setup_video (params)) - params->have_vga = video_type; - } - /* Specify the boot file. */ dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, "BOOT_IMAGE="); @@ -946,7 +954,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), /* Usually, the compression ratio is about 50%. */ addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) - + page_align (size); + + page_align (size); /* Find the highest address to put the initrd. */ mmap_size = find_mmap_size (); @@ -968,7 +976,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), physical_end = addr_max; if (physical_end < page_align (size)) - continue; + continue; physical_end -= page_align (size); diff --git a/util/grub-dumpbios.in b/util/grub-dumpbios.in new file mode 100644 index 000000000..396503936 --- /dev/null +++ b/util/grub-dumpbios.in @@ -0,0 +1,58 @@ +#! /bin/sh +# +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "$0 (GNU GRUB @PACKAGE_VERSION@)" + exit 0 ;; + -o) + shift + output_dir=$1 + ;; + --output=) + output_dir=`echo "$option" | sed 's/--output=//'` + ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + esac +done + +dd if=/dev/mem of=${output_dir}vbios.bin bs=65536 skip=12 count=1 +dd if=/dev/mem of=${output_dir}int10.bin bs=4 skip=16 count=1 From 6842cec4247551c15bf60f908c2f77b125afd801 Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 4 Apr 2009 09:22:35 +0000 Subject: [PATCH 0603/1707] Undo r2063. --- ChangeLog | 48 - DISTLIST | 4 - commands/efi/fixvideo.c | 110 - commands/efi/loadbios.c | 210 -- commands/memrw.c | 101 - conf/common.mk | 65 +- conf/common.rmk | 13 +- conf/i386-efi.mk | 116 +- conf/i386-efi.rmk | 12 +- conf/x86_64-efi.mk | 116 +- conf/x86_64-efi.rmk | 12 +- config.h.in | 52 +- configure | 5263 ++++++++++++++++++++++----------------- include/grub/efi/api.h | 2 +- include/grub/i386/pci.h | 35 - include/grub/pci.h | 4 +- loader/i386/efi/linux.c | 314 ++- util/grub-dumpbios.in | 58 - 18 files changed, 3144 insertions(+), 3391 deletions(-) delete mode 100644 commands/efi/fixvideo.c delete mode 100644 commands/efi/loadbios.c delete mode 100644 commands/memrw.c delete mode 100644 util/grub-dumpbios.in diff --git a/ChangeLog b/ChangeLog index 83cf82af1..c94409d61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,51 +1,3 @@ -2009-04-04 Bean - - * include/grub/efi/api.h (grub_efi_configuration_table): Add packed - attribute, otherwise the size would be wrong for i386 platform. - - * include/grub/pci.h (grub_pci_read_word): New inline function. - (grub_pci_read_byte): Likewise. - (grub_pci_write): Likewise. - (grub_pci_write_word): Likewise. - (grub_pci_write_byte): Likewise. - - * include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR. - - * loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module. - (find_framebuf): Scan pci to locate the frame buffer address. - - * commands/efi/fixvideo.c: New file. - - * commands/efi/loadbios.c: Likewise. - - * commands/memrw.c: Likewise. - - * util/grub-dumpbios.in: Likewise. - - * conf/common.rmk (grub-dumpbios): New utility. - (pkglib_MODULES): New module memrw.mod. - (memrw_mod_SOURCE): New macro. - (memrw_mod_CFLAGS): Likewise. - (memrw_mod_LDFLAGS): Likewise. - - * conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and - fixvideo.mod. - (loadbios_mod_SOURCE): New macro. - (loadbios_mod_CFLAGS): Likewise. - (loadbios_mod_LDFLAGS): Likewise. - (fixvideo_mod_SOURCE): Likewise. - (fixvideo_mod_CFLAGS): Likewise. - (fixvideo_mod_LDFLAGS): Likewise. - - * conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and - fixvideo.mod. - (loadbios_mod_SOURCE): New macro. - (loadbios_mod_CFLAGS): Likewise. - (loadbios_mod_LDFLAGS): Likewise. - (fixvideo_mod_SOURCE): Likewise. - (fixvideo_mod_CFLAGS): Likewise. - (fixvideo_mod_LDFLAGS): Likewise. - 2009-04-04 Bean * include/grub/util/misc.h: Add dummy function fsync for mingw. diff --git a/DISTLIST b/DISTLIST index 57a76165b..6b1f798d7 100644 --- a/DISTLIST +++ b/DISTLIST @@ -58,7 +58,6 @@ commands/loadenv.c commands/ls.c commands/lsmmap.c commands/lspci.c -commands/memrw.c commands/minicmd.c commands/read.c commands/reboot.c @@ -67,8 +66,6 @@ commands/sleep.c commands/test.c commands/usbtest.c commands/videotest.c -commands/efi/fixvideo.c -commands/efi/loadbios.c commands/i386/cpuid.c commands/i386/pc/halt.c commands/i386/pc/play.c @@ -445,7 +442,6 @@ term/i386/pc/vga_text.c term/ieee1275/ofconsole.c util/console.c util/getroot.c -util/grub-dumpbios.in util/grub-editenv.c util/grub-emu.c util/grub-fstest.c diff --git a/commands/efi/fixvideo.c b/commands/efi/fixvideo.c deleted file mode 100644 index 013c1eec6..000000000 --- a/commands/efi/fixvideo.c +++ /dev/null @@ -1,110 +0,0 @@ -/* fixvideo.c - fix video problem in efi */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include - -static struct grub_video_patch -{ - const char *name; - grub_uint32_t pci_id; - grub_uint32_t mmio_bar; - grub_uint32_t mmio_reg; - grub_uint32_t mmio_old; -} video_patches[] = - { - {"Intel 945GM", 0x27a28086, 0, 0x71184, 0x1000000}, /* DSPBBASE */ - {"Intel 965GM", 0x2a028086, 0, 0x7119C, 0x1000000}, /* DSPBSURF */ - {0, 0, 0, 0, 0} - }; - -static int NESTED_FUNC_ATTR -scan_card (int bus, int dev, int func, grub_pci_id_t pciid) -{ - grub_pci_address_t addr; - - addr = grub_pci_make_address (bus, dev, func, 2); - if (grub_pci_read_byte (addr + 3) == 0x3) - { - struct grub_video_patch *p = video_patches; - - while (p->name) - { - if (p->pci_id == pciid) - { - grub_target_addr_t base; - - grub_printf ("Found graphic card: %s\n", p->name); - addr += 8 + p->mmio_bar * 4; - base = grub_pci_read (addr); - if ((! base) || (base & GRUB_PCI_ADDR_SPACE_IO) || - (base & GRUB_PCI_ADDR_MEM_PREFETCH)) - grub_printf ("Invalid MMIO bar %d\n", p->mmio_bar); - else - { - base &= GRUB_PCI_ADDR_MEM_MASK; - base += p->mmio_reg; - - if (*((volatile grub_uint32_t *) base) != p->mmio_old) - grub_printf ("Old value don't match\n"); - else - { - *((volatile grub_uint32_t *) base) = 0; - if (*((volatile grub_uint32_t *) base)) - grub_printf ("Set MMIO fails\n"); - } - } - - return 1; - } - p++; - } - - grub_printf ("Unknown graphic card: %x\n", pciid); - } - - return 0; -} - -static grub_err_t -grub_cmd_fixvideo (grub_command_t cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char *argv[] __attribute__ ((unused))) -{ - grub_pci_iterate (scan_card); - return 0; -} - -static grub_command_t cmd_fixvideo; - -GRUB_MOD_INIT(fixvideo) -{ - (void) mod; /* To stop warning. */ - cmd_fixvideo = grub_register_command ("fix_video", grub_cmd_fixvideo, - 0, "Fix video problem."); - -} - -GRUB_MOD_FINI(fixvideo) -{ - grub_unregister_command (cmd_fixvideo); -} diff --git a/commands/efi/loadbios.c b/commands/efi/loadbios.c deleted file mode 100644 index 7cb8b2c66..000000000 --- a/commands/efi/loadbios.c +++ /dev/null @@ -1,210 +0,0 @@ -/* loadbios.c - command to load a bios dump */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include -#include - -static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; -static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; -static grub_efi_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID; - -#define EBDA_SEG_ADDR 0x40e -#define LOW_MEM_ADDR 0x413 -#define FAKE_EBDA_SEG 0x9fc0 - -#define BLANK_MEM 0xffffffff -#define VBIOS_ADDR 0xc0000 -#define SBIOS_ADDR 0xf0000 - -static int -enable_rom_area (void) -{ - grub_pci_address_t addr; - grub_uint32_t *rom_ptr; - - rom_ptr = (grub_uint32_t *) VBIOS_ADDR; - if (*rom_ptr != BLANK_MEM) - { - grub_printf ("ROM image present.\n"); - return 0; - } - - addr = grub_pci_make_address (0, 0, 0, 36); - grub_pci_write_byte (addr++, 0x30); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr++, 0x33); - grub_pci_write_byte (addr, 0); - - *rom_ptr = 0; - if (*rom_ptr != 0) - { - grub_printf ("Can\'t enable rom area.\n"); - return 0; - } - - return 1; -} - -static void -lock_rom_area (void) -{ - grub_pci_address_t addr; - - addr = grub_pci_make_address (0, 0, 0, 36); - grub_pci_write_byte (addr++, 0x10); - grub_pci_write_byte (addr++, 0x11); - grub_pci_write_byte (addr++, 0x11); - grub_pci_write_byte (addr++, 0x11); - grub_pci_write_byte (addr, 0x11); -} - -static void -fake_bios_data (int use_rom) -{ - unsigned i; - void *acpi, *smbios; - grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; - - ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; - low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; - if ((*ebda_seg_ptr) || (*low_mem_ptr)) - return; - - acpi = 0; - smbios = 0; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - { - grub_efi_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; - - if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) - { - acpi = grub_efi_system_table->configuration_table[i].vendor_table; - grub_dprintf ("efi", "ACPI2: %p\n", acpi); - } - else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) - { - void *t; - - t = grub_efi_system_table->configuration_table[i].vendor_table; - if (! acpi) - acpi = t; - grub_dprintf ("efi", "ACPI: %p\n", t); - } - else if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_efi_guid_t))) - { - smbios = grub_efi_system_table->configuration_table[i].vendor_table; - grub_dprintf ("efi", "SMBIOS: %p\n", smbios); - } - } - - *ebda_seg_ptr = FAKE_EBDA_SEG; - *low_mem_ptr = (FAKE_EBDA_SEG >> 6); - - if (acpi) - grub_memcpy ((char *) (FAKE_EBDA_SEG << 4), acpi, 1024); - - if ((use_rom) && (smbios)) - grub_memcpy ((char *) SBIOS_ADDR, (char *) smbios + 16, 16); -} - -static grub_err_t -grub_cmd_fakebios (struct grub_command *cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char *argv[] __attribute__ ((unused))) -{ - if (enable_rom_area ()) - { - fake_bios_data (1); - lock_rom_area (); - } - else - fake_bios_data (0); -} - -static grub_err_t -grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)), - int argc, char *argv[]) -{ - grub_file_t file; - int size; - - if (argc == 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "No rom image specified"); - - if (argc > 1) - { - file = grub_file_open (argv[1]); - if (! file) - return grub_errno; - - if (file->size != 4) - grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid int10 dump size"); - else - grub_file_read (file, (char *) 0x40, 4); - - grub_file_close (file); - if (grub_errno) - return grub_errno; - } - - file = grub_file_open (argv[0]); - if (! file) - return grub_errno; - - size = file->size; - if ((size < 0x10000) || (size > 0x40000)) - grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid bios dump size"); - else if (enable_rom_area ()) - { - grub_file_read (file, (char *) VBIOS_ADDR, size); - fake_bios_data (size <= 0x40000); - lock_rom_area (); - } - - grub_file_close (file); - return grub_errno; -} - -static grub_command_t cmd_fakebios, cmd_loadbios; - -GRUB_MOD_INIT(loadbios) -{ - (void) mod; /* To stop warning. */ - cmd_fakebios = grub_register_command ("fakebios", grub_cmd_fakebios, - 0, "fake bios."); - - cmd_loadbios = grub_register_command ("loadbios", grub_cmd_loadbios, - "loadbios BIOS_DUMP [INT10_DUMP]", - "Load bios dump."); -} - -GRUB_MOD_FINI(loadbios) -{ - grub_unregister_command (cmd_fakebios); - grub_unregister_command (cmd_loadbios); -} diff --git a/commands/memrw.c b/commands/memrw.c deleted file mode 100644 index fa04c7609..000000000 --- a/commands/memrw.c +++ /dev/null @@ -1,101 +0,0 @@ -/* memrw.c - command to read / write physical memory */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include - -static grub_command_t cmd_read_byte, cmd_read_word, cmd_read_dword; -static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword; - -static grub_err_t -grub_cmd_read (grub_command_t cmd, int argc, char **argv) -{ - grub_target_addr_t addr; - grub_uint32_t value; - - if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments"); - - addr = grub_strtoul (argv[0], 0, 0); - if (cmd->name[5] == 'd') - value = *((grub_uint32_t *) addr); - else if (cmd->name[5] == 'w') - value = *((grub_uint16_t *) addr); - else - value = *((grub_uint8_t *) addr); - - grub_printf ("0x%x\n", value); - - return 0; -} - -static grub_err_t -grub_cmd_write (grub_command_t cmd, int argc, char **argv) -{ - grub_target_addr_t addr; - grub_uint32_t value; - - if (argc != 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments"); - - addr = grub_strtoul (argv[0], 0, 0); - value = grub_strtoul (argv[1], 0, 0); - if (cmd->name[6] == 'd') - *((grub_uint32_t *) addr) = value; - else if (cmd->name[6] == 'w') - *((grub_uint16_t *) addr) = (grub_uint16_t) value; - else - *((grub_uint8_t *) addr) = (grub_uint8_t) value; - - return 0; -} - -GRUB_MOD_INIT(memrw) -{ - (void) mod; /* To stop warning. */ - cmd_read_byte = - grub_register_command ("read_byte", grub_cmd_read, - "read_byte ADDR", "read byte."); - cmd_read_word = - grub_register_command ("read_word", grub_cmd_read, - "read_word ADDR", "read word."); - cmd_read_dword = - grub_register_command ("read_dword", grub_cmd_read, - "read_dword ADDR", "read dword."); - cmd_write_byte = - grub_register_command ("write_byte", grub_cmd_write, - "write_byte ADDR VALUE", "write byte."); - cmd_write_word = - grub_register_command ("write_word", grub_cmd_write, - "write_word ADDR VALUE", "write word."); - cmd_write_dword = - grub_register_command ("write_dword", grub_cmd_write, - "write_dword ADDR VALUE", "write dword."); -} - -GRUB_MOD_FINI(memrw) -{ - grub_unregister_command (cmd_read_byte); - grub_unregister_command (cmd_read_word); - grub_unregister_command (cmd_read_dword); - grub_unregister_command (cmd_write_byte); - grub_unregister_command (cmd_write_word); - grub_unregister_command (cmd_write_dword); -} diff --git a/conf/common.mk b/conf/common.mk index 5703d5194..9411a59c7 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -600,12 +600,6 @@ CLEANFILES += $(grub-mkconfig_SCRIPTS) grub-mkconfig_DATA += util/grub.d/README -# For grub-dumpbios -grub-dumpbios: util/grub-dumpbios.in config.status - ./config.status --file=$@:$< - chmod +x $@ -sbin_SCRIPTS += grub-dumpbios -CLEANFILES += grub-dumpbios # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ @@ -2450,7 +2444,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod memrw.mod + read.mod sleep.mod loadenv.mod crc.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -3744,63 +3738,6 @@ partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist. crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For memrw.mod. -memrw_mod_SOURCES = commands/memrw.c -CLEANFILES += memrw.mod mod-memrw.o mod-memrw.c pre-memrw.o memrw_mod-commands_memrw.o und-memrw.lst -ifneq ($(memrw_mod_EXPORTS),no) -CLEANFILES += def-memrw.lst -DEFSYMFILES += def-memrw.lst -endif -MOSTLYCLEANFILES += memrw_mod-commands_memrw.d -UNDSYMFILES += und-memrw.lst - -memrw.mod: pre-memrw.o mod-memrw.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memrw.o mod-memrw.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-memrw.o: $(memrw_mod_DEPENDENCIES) memrw_mod-commands_memrw.o - -rm -f $@ - $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memrw_mod-commands_memrw.o - -mod-memrw.o: mod-memrw.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -c -o $@ $< - -mod-memrw.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'memrw' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(memrw_mod_EXPORTS),no) -def-memrw.lst: pre-memrw.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memrw/' > $@ -endif - -und-memrw.lst: pre-memrw.o - echo 'memrw' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -memrw_mod-commands_memrw.o: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -MD -c -o $@ $< --include memrw_mod-commands_memrw.d - -CLEANFILES += cmd-memrw_mod-commands_memrw.lst fs-memrw_mod-commands_memrw.lst partmap-memrw_mod-commands_memrw.lst -COMMANDFILES += cmd-memrw_mod-commands_memrw.lst -FSFILES += fs-memrw_mod-commands_memrw.lst -PARTMAPFILES += partmap-memrw_mod-commands_memrw.lst - -cmd-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memrw > $@ || (rm -f $@; exit 1) - -fs-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memrw > $@ || (rm -f $@; exit 1) - -partmap-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memrw > $@ || (rm -f $@; exit 1) - - -memrw_mod_CFLAGS = $(COMMON_CFLAGS) -memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) - # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/common.rmk b/conf/common.rmk index ffe4ea2e6..43bc683b0 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -155,12 +155,6 @@ CLEANFILES += $(grub-mkconfig_SCRIPTS) grub-mkconfig_DATA += util/grub.d/README -# For grub-dumpbios -grub-dumpbios: util/grub-dumpbios.in config.status - ./config.status --file=$@:$< - chmod +x $@ -sbin_SCRIPTS += grub-dumpbios -CLEANFILES += grub-dumpbios # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ @@ -341,7 +335,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod memrw.mod + read.mod sleep.mod loadenv.mod crc.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -448,11 +442,6 @@ crc_mod_SOURCES = commands/crc.c lib/crc.c crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For memrw.mod. -memrw_mod_SOURCES = commands/memrw.c -memrw_mod_CFLAGS = $(COMMON_CFLAGS) -memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) - # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 1eb2392ab..7a71520a7 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -118,7 +118,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1757,119 +1757,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For loadbios.mod -loadbios_mod_SOURCES = commands/efi/loadbios.c -CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst -ifneq ($(loadbios_mod_EXPORTS),no) -CLEANFILES += def-loadbios.lst -DEFSYMFILES += def-loadbios.lst -endif -MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d -UNDSYMFILES += und-loadbios.lst - -loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o - -mod-loadbios.o: mod-loadbios.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< - -mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(loadbios_mod_EXPORTS),no) -def-loadbios.lst: pre-loadbios.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ -endif - -und-loadbios.lst: pre-loadbios.o - echo 'loadbios' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< --include loadbios_mod-commands_efi_loadbios.d - -CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst -COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst -FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst -PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst - -cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) - -fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) - -partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) - - -loadbios_mod_CFLAGS = $(COMMON_CFLAGS) -loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fixvideo.mod -fixvideo_mod_SOURCES = commands/efi/fixvideo.c -CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst -ifneq ($(fixvideo_mod_EXPORTS),no) -CLEANFILES += def-fixvideo.lst -DEFSYMFILES += def-fixvideo.lst -endif -MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d -UNDSYMFILES += und-fixvideo.lst - -fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o - -mod-fixvideo.o: mod-fixvideo.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< - -mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fixvideo_mod_EXPORTS),no) -def-fixvideo.lst: pre-fixvideo.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ -endif - -und-fixvideo.lst: pre-fixvideo.o - echo 'fixvideo' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< --include fixvideo_mod-commands_efi_fixvideo.d - -CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst -COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst -FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst -PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst - -cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) - -fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) - -partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) - - -fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) -fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index e2503047d..18a99df7e 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -79,7 +79,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -182,15 +182,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For loadbios.mod -loadbios_mod_SOURCES = commands/efi/loadbios.c -loadbios_mod_CFLAGS = $(COMMON_CFLAGS) -loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fixvideo.mod -fixvideo_mod_SOURCES = commands/efi/fixvideo.c -fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) -fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 3f5397aa8..c745deb55 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -106,7 +106,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1765,119 +1765,5 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For loadbios.mod -loadbios_mod_SOURCES = commands/efi/loadbios.c -CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst -ifneq ($(loadbios_mod_EXPORTS),no) -CLEANFILES += def-loadbios.lst -DEFSYMFILES += def-loadbios.lst -endif -MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d -UNDSYMFILES += und-loadbios.lst - -loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o - -mod-loadbios.o: mod-loadbios.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< - -mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(loadbios_mod_EXPORTS),no) -def-loadbios.lst: pre-loadbios.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ -endif - -und-loadbios.lst: pre-loadbios.o - echo 'loadbios' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< --include loadbios_mod-commands_efi_loadbios.d - -CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst -COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst -FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst -PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst - -cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) - -fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) - -partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) - - -loadbios_mod_CFLAGS = $(COMMON_CFLAGS) -loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fixvideo.mod -fixvideo_mod_SOURCES = commands/efi/fixvideo.c -CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst -ifneq ($(fixvideo_mod_EXPORTS),no) -CLEANFILES += def-fixvideo.lst -DEFSYMFILES += def-fixvideo.lst -endif -MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d -UNDSYMFILES += und-fixvideo.lst - -fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o - -mod-fixvideo.o: mod-fixvideo.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< - -mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fixvideo_mod_EXPORTS),no) -def-fixvideo.lst: pre-fixvideo.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ -endif - -und-fixvideo.lst: pre-fixvideo.o - echo 'fixvideo' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< --include fixvideo_mod-commands_efi_fixvideo.d - -CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst -COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst -FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst -PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst - -cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) - -fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) - -partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) - - -fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) -fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index ec246eddd..faa59fb47 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -81,7 +81,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod + datetime.mod date.mod datehook.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -185,15 +185,5 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For loadbios.mod -loadbios_mod_SOURCES = commands/efi/loadbios.c -loadbios_mod_CFLAGS = $(COMMON_CFLAGS) -loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fixvideo.mod -fixvideo_mod_SOURCES = commands/efi/fixvideo.c -fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) -fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/config.h.in b/config.h.in index c110d6307..a5234009b 100644 --- a/config.h.in +++ b/config.h.in @@ -4,6 +4,9 @@ prefixed with an asterisk */ #undef ABSOLUTE_WITHOUT_ASTERISK +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define it to \"addr32\" or \"addr32;\" to make GAS happy */ #undef ADDR32 @@ -112,17 +115,52 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE diff --git a/configure b/configure index a3bde5844..dcb2365cd 100644 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for GRUB 1.96. +# Generated by GNU Autoconf 2.63 for GRUB 1.96. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -39,17 +39,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -65,8 +93,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -89,7 +115,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -102,17 +128,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -134,7 +153,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -160,7 +179,7 @@ else as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -242,7 +261,7 @@ IFS=$as_save_IFS if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -263,7 +282,7 @@ _ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -343,10 +362,10 @@ fi if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -415,9 +434,10 @@ fi test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message + echo Please tell bug-autoconf@gnu.org about your system, + echo including any error possibly output before this message. + echo This can help us improve future autoconf versions. + echo Configuration will now proceed without shell functions. } @@ -453,7 +473,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -481,7 +501,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -494,19 +513,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -531,10 +553,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -615,103 +637,115 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -host_kernel -platform -CMP -YACC -UNIFONT_BDF -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -AWK -SET_MAKE -RUBY -HELP2MAN -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -GREP -EGREP -LIBLZO -enable_lzo -TARGET_IMG_LDSCRIPT -TARGET_IMG_LDFLAGS -TARGET_OBJ2ELF -TARGET_CC -ac_ct_TARGET_CC -OBJCOPY -STRIP -NM -TARGET_CFLAGS -TARGET_CPPFLAGS -TARGET_LDFLAGS -LIBCURSES +ac_subst_vars='LTLIBOBJS +LIBOBJS +freetype_libs +freetype_cflags +enable_grub_mkfont +FREETYPE +enable_grub_pe2elf +enable_grub_fstest +enable_grub_emu_usb +enable_grub_emu LIBUSB +LIBCURSES +TARGET_LDFLAGS +TARGET_CPPFLAGS +TARGET_CFLAGS +NM +STRIP +OBJCOPY +ac_ct_TARGET_CC +TARGET_CC +TARGET_OBJ2ELF +TARGET_IMG_LDFLAGS +TARGET_IMG_LDSCRIPT +enable_lzo +LIBLZO +EGREP +GREP +CPP +OBJEXT +EXEEXT +ac_ct_CC +CPPFLAGS +LDFLAGS +CFLAGS +CC +HELP2MAN +RUBY +SET_MAKE +AWK +INSTALL_DATA +INSTALL_SCRIPT +INSTALL_PROGRAM +UNIFONT_BDF +YACC +CMP +platform +host_kernel +target_os +target_vendor +target_cpu +target +host_os +host_vendor +host_cpu +host +build_os +build_vendor +build_cpu +build +target_alias +host_alias +build_alias +LIBS +ECHO_T +ECHO_N +ECHO_C +DEFS +mandir +localedir +libdir +psdir +pdfdir +dvidir +htmldir +infodir +docdir +oldincludedir +includedir +localstatedir +sharedstatedir +sysconfdir +datadir +datarootdir +libexecdir +sbindir +bindir +program_transform_name +prefix +exec_prefix +PACKAGE_BUGREPORT +PACKAGE_STRING +PACKAGE_VERSION +PACKAGE_TARNAME +PACKAGE_NAME +PATH_SEPARATOR +SHELL' +ac_subst_files='' +ac_user_opts=' +enable_option_checking +with_platform +enable_largefile +enable_lzo +enable_mm_debug enable_grub_emu enable_grub_emu_usb enable_grub_fstest enable_grub_pe2elf -FREETYPE enable_grub_mkfont -freetype_cflags -freetype_libs -LIBOBJS -LTLIBOBJS' -ac_subst_files='' +' ac_precious_vars='build_alias host_alias target_alias @@ -726,6 +760,8 @@ CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false +ac_unrecognized_opts= +ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -824,13 +860,21 @@ do datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -843,13 +887,21 @@ do dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"enable_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1040,22 +1092,38 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 + expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && + { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; + ac_useropt_orig=$ac_useropt + ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` + case $ac_user_opts in + *" +"with_$ac_useropt" +"*) ;; + *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" + ac_unrecognized_sep=', ';; + esac + eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. @@ -1075,7 +1143,7 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { echo "$as_me: error: unrecognized option: $ac_option + -*) { $as_echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1084,16 +1152,16 @@ Try \`$0 --help' for more information." >&2 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1102,22 +1170,38 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 + { $as_echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -# Be sure to have absolute directory names. +if test -n "$ac_unrecognized_opts"; then + case $enable_option_checking in + no) ;; + fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 + { (exit 1); exit 1; }; } ;; + *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; + esac +fi + +# Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var + # Remove trailing slashes. + case $ac_val in + */ ) + ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` + eval $ac_var=\$ac_val;; + esac + # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1132,7 +1216,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1148,10 +1232,10 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 + { $as_echo "$as_me: error: working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 + { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1159,12 +1243,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" || if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | + ac_confdir=`$as_dirname -- "$as_myself" || +$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$as_myself" : 'X\(//\)[^/]' \| \ + X"$as_myself" : 'X\(//\)$' \| \ + X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || +$as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1191,12 +1275,12 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1245,9 +1329,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1257,25 +1341,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/grub] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/grub] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1299,6 +1383,7 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: + --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files @@ -1340,15 +1425,17 @@ fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue + test -d "$ac_dir" || + { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || + continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1384,7 +1471,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1394,10 +1481,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GRUB configure 1.96 -generated by GNU Autoconf 2.61 +generated by GNU Autoconf 2.63 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1408,7 +1495,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was $ $0 $@ @@ -1444,7 +1531,7 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" + $as_echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1479,7 +1566,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1531,11 +1618,12 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1565,9 +1653,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1582,9 +1670,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - echo "$ac_var='\''$ac_val'\''" + $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1600,8 +1688,8 @@ _ASBOX echo fi test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" + $as_echo "$as_me: caught signal $ac_signal" + $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1643,21 +1731,24 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. +# Prefer an explicitly selected file to automatically selected ones. +ac_site_file1=NONE +ac_site_file2=NONE if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" + ac_site_file1=$CONFIG_SITE elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" + ac_site_file1=$prefix/share/config.site + ac_site_file2=$prefix/etc/config.site else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" + ac_site_file1=$ac_default_prefix/share/config.site + ac_site_file2=$ac_default_prefix/etc/config.site fi -shift -for ac_site_file +for ac_site_file in "$ac_site_file1" "$ac_site_file2" do + test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} + { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +$as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1667,16 +1758,16 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 +$as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 +$as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1690,29 +1781,38 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: + # differences in whitespace do not lead to failure. + ac_old_val_w=`echo x $ac_old_val` + ac_new_val_w=`echo x $ac_new_val` + if test "$ac_old_val_w" != "$ac_new_val_w"; then + { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + ac_cache_corrupted=: + else + { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 +$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} + eval $ac_var=\$ac_old_val + fi + { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 +$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} + { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 +$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1722,10 +1822,12 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} + { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1783,8 +1885,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -1799,34 +1901,34 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking build system type" >&5 +$as_echo_n "checking build system type... " >&6; } if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +$as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +$as_echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -1843,27 +1945,27 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking host system type" >&5 +$as_echo_n "checking host system type... " >&6; } if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +$as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +$as_echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -1880,27 +1982,27 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking target system type" >&5 +$as_echo_n "checking target system type... " >&6; } if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +$as_echo "$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} +*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +$as_echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target @@ -1930,13 +2032,10 @@ test "$program_prefix" != NONE && # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. +# Double any \ or $. # By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed +ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' +program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` case "$host_cpu" in @@ -1965,8 +2064,8 @@ if test "x$with_platform" = x; then powerpc-*) platform=ieee1275 ;; powerpc64-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; - *) { { echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 -echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 +$as_echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac else @@ -1992,8 +2091,8 @@ case "$target_cpu"-"$platform" in i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; - *) { { echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 -echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 +$as_echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -2033,10 +2132,10 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CMP"; then ac_cv_prog_CMP="$CMP" # Let the user override the test. @@ -2049,7 +2148,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CMP="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2060,11 +2159,11 @@ fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - { echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6; } + { $as_echo "$as_me:$LINENO: result: $CMP" >&5 +$as_echo "$CMP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2072,8 +2171,8 @@ fi done if test "x$CMP" = x; then - { { echo "$as_me:$LINENO: error: cmp is not found" >&5 -echo "$as_me: error: cmp is not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: cmp is not found" >&5 +$as_echo "$as_me: error: cmp is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2081,10 +2180,10 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2097,7 +2196,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2108,11 +2207,11 @@ fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } + { $as_echo "$as_me:$LINENO: result: $YACC" >&5 +$as_echo "$YACC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2120,8 +2219,8 @@ fi done if test "x$YACC" = x; then - { { echo "$as_me:$LINENO: error: bison is not found" >&5 -echo "$as_me: error: bison is not found" >&2;} + { { $as_echo "$as_me:$LINENO: error: bison is not found" >&5 +$as_echo "$as_me: error: bison is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2146,11 +2245,12 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } +# Reject install programs that cannot install multiple files. +{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +$as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2179,17 +2279,29 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 + rm -rf conftest.one conftest.two conftest.dir + echo one > conftest.one + echo two > conftest.two + mkdir conftest.dir + if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && + test -s conftest.one && test -s conftest.two && + test -s conftest.dir/conftest.one && + test -s conftest.dir/conftest.two + then + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 + fi fi fi done done ;; esac + done IFS=$as_save_IFS +rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2202,8 +2314,8 @@ fi INSTALL=$ac_install_sh fi fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } +{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 +$as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2217,10 +2329,10 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2233,7 +2345,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2244,22 +2356,23 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } + { $as_echo "$as_me:$LINENO: result: $AWK" >&5 +$as_echo "$AWK" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi test -n "$AWK" && break done -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } +set x ${MAKE-make} +ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh @@ -2276,12 +2389,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } SET_MAKE= else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2289,10 +2402,10 @@ fi # These are not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_RUBY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $RUBY in [\\/]* | ?:[\\/]*) @@ -2307,7 +2420,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2319,20 +2432,20 @@ esac fi RUBY=$ac_cv_path_RUBY if test -n "$RUBY"; then - { echo "$as_me:$LINENO: result: $RUBY" >&5 -echo "${ECHO_T}$RUBY" >&6; } + { $as_echo "$as_me:$LINENO: result: $RUBY" >&5 +$as_echo "$RUBY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Extract the first word of "help2man", so it can be a program name with args. set dummy help2man; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_path_HELP2MAN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else case $HELP2MAN in [\\/]* | ?:[\\/]*) @@ -2347,7 +2460,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2359,11 +2472,11 @@ esac fi HELP2MAN=$ac_cv_path_HELP2MAN if test -n "$HELP2MAN"; then - { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 -echo "${ECHO_T}$HELP2MAN" >&6; } + { $as_echo "$as_me:$LINENO: result: $HELP2MAN" >&5 +$as_echo "$HELP2MAN" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2380,10 +2493,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2396,7 +2509,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2407,11 +2520,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2420,10 +2533,10 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2436,7 +2549,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2447,11 +2560,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2459,12 +2572,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2477,10 +2586,10 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2493,7 +2602,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2504,11 +2613,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2517,10 +2626,10 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2538,7 +2647,7 @@ do continue fi ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2561,11 +2670,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2576,10 +2685,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2592,7 +2701,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2603,11 +2712,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $CC" >&5 +$as_echo "$CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2620,10 +2729,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2636,7 +2745,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2647,11 +2756,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +$as_echo "$ac_ct_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -2663,12 +2772,8 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2678,44 +2783,50 @@ fi fi -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH +$as_echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } # Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` +$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 +set X $ac_compile +ac_compiler=$2 { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2734,27 +2845,22 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. +{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +$as_echo_n "checking for C compiler default output file name... " >&6; } +ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` + +# The possible output files: +ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" + ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2765,10 +2871,11 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2779,7 +2886,7 @@ for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2806,25 +2913,27 @@ else ac_file='' fi -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 +$as_echo "$ac_file" >&6; } if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables +$as_echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +$as_echo_n "checking whether the C compiler works... " >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2833,49 +2942,53 @@ if test "$cross_compiling" != yes; then *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. +$as_echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi fi fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } +{ $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } -rm -f a.out a.exe conftest$ac_cv_exeext b.out +rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +$as_echo_n "checking whether we are cross compiling... " >&6; } +{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 +$as_echo "$cross_compiling" >&6; } -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 +$as_echo_n "checking for suffix of executables... " >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2884,31 +2997,33 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +$as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 +$as_echo_n "checking for suffix of object files... " >&6; } if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2931,40 +3046,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile +$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +$as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -2990,20 +3108,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -3013,15 +3132,19 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +$as_echo "$ac_cv_c_compiler_gnu" >&6; } +if test $ac_compiler_gnu = yes; then + GCC=yes +else + GCC= +fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +$as_echo_n "checking whether $CC accepts -g... " >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3048,20 +3171,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3086,20 +3210,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3125,20 +3250,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3153,8 +3279,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +$as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3170,10 +3296,10 @@ else CFLAGS= fi fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3244,20 +3370,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3273,15 +3400,15 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: none needed" >&5 +$as_echo "none needed" >&6; } ;; xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: unsupported" >&5 +$as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; + { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3292,383 +3419,25 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Must be GCC. -test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5 -echo "$as_me: error: GCC is required" >&2;} +test "x$GCC" = xyes || { { $as_echo "$as_me:$LINENO: error: GCC is required" >&5 +$as_echo "$as_me: error: GCC is required" >&2;} { (exit 1); exit 1; }; } -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -f conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -f conftest* - fi -fi - - -# Identify characteristics of the host architecture. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +$as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3700,20 +3469,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3737,13 +3507,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3751,7 +3522,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3776,8 +3547,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 +$as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3805,20 +3576,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3842,13 +3614,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3856,7 +3629,7 @@ eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 # Broken: success on invalid input. continue else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3872,11 +3645,13 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } + { (exit 1); exit 1; }; }; } fi ac_ext=c @@ -3886,42 +3661,37 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +$as_echo_n "checking for grep that handles long lines and -e... " >&6; } if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else + if test -z "$GREP"; then ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue +# Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" + $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3936,74 +3706,60 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_GREP_found && break 3 + $ac_path_GREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_GREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_GREP=$GREP fi - fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +$as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 +$as_echo_n "checking for egrep... " >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else + if test -z "$EGREP"; then ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR + # Loop through the user's path and test for each of PROGNAME-LIST + as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue +# Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" + $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" + $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -4018,40 +3774,31 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - - $ac_path_EGREP_found && break 3 + $ac_path_EGREP_found && break 3 + done done done - -done IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + if test -z "$ac_cv_path_EGREP"; then + { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } -fi - + fi else ac_cv_path_EGREP=$EGREP fi - fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +$as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +$as_echo_n "checking for ANSI C header files... " >&6; } if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4078,20 +3825,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -4183,37 +3931,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +$as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -4235,11 +3986,11 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4257,20 +4008,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -4278,12 +4030,15 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -4291,28 +4046,183 @@ fi done -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + + if test "${ac_cv_header_minix_config_h+set}" = set; then + { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } else - # See if sys/param.h defines the BYTE_ORDER macro. + # Is the header compilable? +{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 +$as_echo_n "checking minix/config.h usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include -#include +$ac_includes_default +#include +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_header_compiler=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + ac_header_compiler=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } + +# Is the header present? +{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 +$as_echo_n "checking minix/config.h presence... " >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +_ACEOF +if { (ac_try="$ac_cpp conftest.$ac_ext" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null && { + test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || + test ! -s conftest.err + }; then + ac_header_preproc=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_header_preproc=no +fi + +rm -f conftest.err conftest.$ac_ext +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } + +# So? What about this header? +case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in + yes:no: ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} + ac_header_preproc=yes + ;; + no:yes:* ) + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} + ( cat <<\_ASBOX +## ------------------------------- ## +## Report this to bug-grub@gnu.org ## +## ------------------------------- ## +_ASBOX + ) | sed "s/^/$as_me: WARNING: /" >&2 + ;; +esac +{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 +$as_echo_n "checking for minix/config.h... " >&6; } +if test "${ac_cv_header_minix_config_h+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_header_minix_config_h=$ac_header_preproc +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 +$as_echo "$ac_cv_header_minix_config_h" >&6; } + +fi +if test "x$ac_cv_header_minix_config_h" = x""yes; then + MINIX=yes +else + MINIX= +fi + + + if test "$MINIX" = yes; then + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_SOURCE 1 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _POSIX_1_SOURCE 2 +_ACEOF + + +cat >>confdefs.h <<\_ACEOF +#define _MINIX 1 +_ACEOF + + fi + + + + { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 +$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } +if test "${ac_cv_safe_to_define___extensions__+set}" = set; then + $as_echo_n "(cached) " >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ + +# define __EXTENSIONS__ 1 + $ac_includes_default int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif ; return 0; @@ -4324,33 +4234,521 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_safe_to_define___extensions__=yes +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_safe_to_define___extensions__=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 +$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } + test $ac_cv_safe_to_define___extensions__ = yes && + cat >>confdefs.h <<\_ACEOF +#define __EXTENSIONS__ 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _ALL_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _POSIX_PTHREAD_SEMANTICS 1 +_ACEOF + + cat >>confdefs.h <<\_ACEOF +#define _TANDEM_SOURCE 1 +_ACEOF + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +$as_echo_n "checking for special C compiler options needed for large files... " >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +$as_echo "$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + $as_echo_n "(cached) " >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +$as_echo "$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -rf conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + $as_echo_n "(cached) " >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +$as_echo "$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -rf conftest* + fi +fi + + +# Identify characteristics of the host architecture. + + { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +if test "${ac_cv_c_bigendian+set}" = set; then + $as_echo_n "(cached) " >&6 +else + ac_cv_c_bigendian=unknown + # See if we're dealing with a universal compiler. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#ifndef __APPLE_CC__ + not a universal capable compiler + #endif + typedef int dummy; + +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + + # Check for potential -arch flags. It is not universal unless + # there are some -arch flags. Note that *ppc* also matches + # ppc64. This check is also rather less than ideal. + case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( + *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; + esac +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + if test $ac_cv_c_bigendian = unknown; then + # See if sys/param.h defines the BYTE_ORDER macro. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + #include + +int +main () +{ +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ + && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ + && LITTLE_ENDIAN) + bogus endian macros + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include -#include + #include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif + not big endian + #endif ; return 0; @@ -4362,20 +4760,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -4383,29 +4782,31 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } +#include + int main () { - _ascii (); _ebcdic (); +#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) + bogus endian macros + #endif + ; return 0; } @@ -4416,30 +4817,139 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + # It does; now see whether it defined to _BIG_ENDIAN or not. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + +int +main () +{ +#ifndef _BIG_ENDIAN + not big endian + #endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_c_bigendian=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +else + $as_echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + fi + if test $ac_cv_c_bigendian = unknown; then + # Compile a test program. + if test "$cross_compiling" = yes; then + # Try to guess by grepping values from an object file. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +short int ascii_mm[] = + { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; + short int ascii_ii[] = + { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; + int use_ascii (int i) { + return ascii_mm[i] + ascii_ii[i]; + } + short int ebcdic_ii[] = + { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; + short int ebcdic_mm[] = + { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; + int use_ebcdic (int i) { + return ebcdic_mm[i] + ebcdic_ii[i]; + } + extern int foo; + +int +main () +{ +return use_ascii (foo) == use_ebcdic (foo); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then + ac_cv_c_bigendian=yes + fi + if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi + fi +else + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4458,14 +4968,14 @@ int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -4477,118 +4987,71 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF +{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +$as_echo "$ac_cv_c_bigendian" >&6; } + case $ac_cv_c_bigendian in #( + yes) + cat >>confdefs.h <<\_ACEOF #define WORDS_BIGENDIAN 1 _ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} +;; #( + no) + ;; #( + universal) + +cat >>confdefs.h <<\_ACEOF +#define AC_APPLE_UNIVERSAL_BUILD 1 +_ACEOF + + ;; #( + *) + { { $as_echo "$as_me:$LINENO: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +$as_echo "$as_me: error: unknown endianness + presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; -esac - -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } + esac # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 +$as_echo_n "checking size of void *... " >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -4599,11 +5062,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; test_array [0] = 0 ; @@ -4616,13 +5078,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4636,11 +5099,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4653,20 +5115,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -4680,7 +5143,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -4690,11 +5153,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; test_array [0] = 0 ; @@ -4707,13 +5169,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -4727,11 +5190,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; test_array [0] = 0 ; @@ -4744,20 +5206,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -4771,7 +5234,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -4791,11 +5254,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; test_array [0] = 0 ; @@ -4808,20 +5270,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -4832,11 +5295,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -4849,9 +5314,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (void *)); } +static unsigned long int ulongval () { return (long int) (sizeof (void *)); } #include #include int @@ -4861,20 +5325,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (void *))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (void *)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -4887,43 +5353,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) +$as_echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_void_p=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +$as_echo "$ac_cv_sizeof_void_p" >&6; } @@ -4932,68 +5403,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking size of long" >&5 +$as_echo_n "checking size of long... " >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -5004,11 +5421,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; test_array [0] = 0 ; @@ -5021,13 +5437,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5041,11 +5458,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5058,20 +5474,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -5085,7 +5502,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -5095,11 +5512,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; test_array [0] = 0 ; @@ -5112,13 +5528,14 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5132,11 +5549,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5149,20 +5565,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -5176,7 +5593,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -5196,11 +5613,10 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5213,20 +5629,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -5237,11 +5654,13 @@ done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi ;; @@ -5254,9 +5673,8 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } +static long int longval () { return (long int) (sizeof (long)); } +static unsigned long int ulongval () { return (long int) (sizeof (long)); } #include #include int @@ -5266,20 +5684,22 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) + if (((long int) (sizeof (long))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%ld\n", i); + fprintf (f, "%ld", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) + if (i != ((long int) (sizeof (long)))) return 1; - fprintf (f, "%lu\n", i); + fprintf (f, "%lu", i); } + /* Do not output a trailing newline, as this causes \r\n confusion + on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -5292,43 +5712,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 +$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} +{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) +$as_echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } + { (exit 77); exit 77; }; }; } else ac_cv_sizeof_long=0 fi fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +$as_echo "$ac_cv_sizeof_long" >&6; } @@ -5359,10 +5784,10 @@ cat >>confdefs.h <<\_ACEOF #define ENABLE_LZO 1 _ACEOF - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +$as_echo_n "checking for __lzo_init_v2 in -llzo2... " >&6; } if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" @@ -5394,39 +5819,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lzo2___lzo_init_v2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo2___lzo_init_v2=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } -if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +$as_echo "$ac_cv_lib_lzo2___lzo_init_v2" >&6; } +if test "x$ac_cv_lib_lzo2___lzo_init_v2" = x""yes; then LIBLZO="-llzo2" else - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +$as_echo_n "checking for __lzo_init_v2 in -llzo... " >&6; } if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5458,39 +5887,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lzo___lzo_init_v2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init_v2=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } -if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +$as_echo "$ac_cv_lib_lzo___lzo_init_v2" >&6; } +if test "x$ac_cv_lib_lzo___lzo_init_v2" = x""yes; then LIBLZO="-llzo" else - { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +$as_echo_n "checking for __lzo_init2 in -llzo... " >&6; } if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5522,37 +5955,41 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_lzo___lzo_init2=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init2=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } -if test $ac_cv_lib_lzo___lzo_init2 = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +$as_echo "$ac_cv_lib_lzo___lzo_init2" >&6; } +if test "x$ac_cv_lib_lzo___lzo_init2" = x""yes; then LIBLZO="-llzo" else - { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 -echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} + { { $as_echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 +$as_echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} { (exit 1); exit 1; }; } fi @@ -5562,10 +5999,10 @@ fi LIBS="$LIBS $LIBLZO" - { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +$as_echo_n "checking for lzo1x_999_compress... " >&6; } if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5618,36 +6055,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_func_lzo1x_999_compress=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_lzo1x_999_compress=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } -if test $ac_cv_func_lzo1x_999_compress = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +$as_echo "$ac_cv_func_lzo1x_999_compress" >&6; } +if test "x$ac_cv_func_lzo1x_999_compress" = x""yes; then : else - { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 -echo "$as_me: error: LZO1X-999 must be enabled" >&2;} + { { $as_echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 +$as_echo "$as_me: error: LZO1X-999 must be enabled" >&2;} { (exit 1); exit 1; }; } fi @@ -5657,20 +6098,21 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5686,32 +6128,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -5725,51 +6168,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -5778,21 +6222,24 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -5815,11 +6262,11 @@ fi for ac_func in posix_memalign memalign asprintf do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 +$as_echo_n "checking for $ac_func... " >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -5872,35 +6319,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then eval "$as_ac_var=yes" else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then +ac_res=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } +as_val=`eval 'as_val=${'$as_ac_var'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -5913,8 +6367,8 @@ done # Use linker script if present, otherwise use builtin -N script. -{ echo "$as_me:$LINENO: checking for option to link raw image" >&5 -echo $ECHO_N "checking for option to link raw image... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for option to link raw image" >&5 +$as_echo_n "checking for option to link raw image... " >&6; } if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" @@ -5926,19 +6380,19 @@ else fi -{ echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 -echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } +{ $as_echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 +$as_echo "$TARGET_IMG_LDFLAGS_AC" >&6; } # For platforms where ELF is not the default link format. -{ echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 -echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 +$as_echo_n "checking for command to convert module to ELF format... " >&6; } case "${host_os}" in cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; *) ;; esac -{ echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 -echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } +{ $as_echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 +$as_echo "$TARGET_OBJ2ELF" >&6; } # For cross-compiling. if test "x$build" != "x$host"; then @@ -5951,10 +6405,10 @@ if test "x$build" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_TARGET_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$TARGET_CC"; then ac_cv_prog_TARGET_CC="$TARGET_CC" # Let the user override the test. @@ -5967,7 +6421,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -5978,11 +6432,11 @@ fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +$as_echo "$TARGET_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -5995,10 +6449,10 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_TARGET_CC"; then ac_cv_prog_ac_ct_TARGET_CC="$ac_ct_TARGET_CC" # Let the user override the test. @@ -6011,7 +6465,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6022,11 +6476,11 @@ fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +$as_echo "$ac_ct_TARGET_CC" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6034,18 +6488,14 @@ fi done if test "x$ac_ct_TARGET_CC" = x; then - TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 -echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} + TARGET_CC="{ { $as_echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 +$as_echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac TARGET_CC=$ac_ct_TARGET_CC @@ -6055,10 +6505,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6071,7 +6521,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6082,11 +6532,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6095,10 +6545,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6111,7 +6561,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6122,11 +6572,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6134,12 +6584,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6151,10 +6597,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6167,7 +6613,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6178,11 +6624,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6191,10 +6637,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6207,7 +6653,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6218,11 +6664,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6230,12 +6676,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6247,10 +6689,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6263,7 +6705,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6274,11 +6716,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $NM" >&5 +$as_echo "$NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6287,10 +6729,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -6303,7 +6745,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6314,11 +6756,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -6326,12 +6768,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -6349,10 +6787,10 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6365,7 +6803,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6376,11 +6814,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +$as_echo "$OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6389,10 +6827,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6405,7 +6843,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6416,11 +6854,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +$as_echo "$ac_ct_OBJCOPY" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6428,12 +6866,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6445,10 +6879,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6461,7 +6895,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6472,11 +6906,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 +$as_echo "$STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6485,10 +6919,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6501,7 +6935,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6512,11 +6946,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +$as_echo "$ac_ct_STRIP" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6524,12 +6958,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6541,10 +6971,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6557,7 +6987,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6568,11 +6998,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $NM" >&5 +$as_echo "$NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -6581,10 +7011,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -6597,7 +7027,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6608,11 +7038,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } + { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +$as_echo "$ac_ct_NM" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -6620,12 +7050,8 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} +{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 +$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -6656,10 +7082,10 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +$as_echo_n "checking whether optimization for size works... " >&6; } if test "${grub_cv_cc_Os+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS=-Os @@ -6684,20 +7110,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_Os=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_Os=no @@ -6706,8 +7133,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 -echo "${ECHO_T}$grub_cv_cc_Os" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 +$as_echo "$grub_cv_cc_Os" >&6; } if test "x$grub_cv_cc_Os" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -6716,10 +7143,10 @@ echo "${ECHO_T}$grub_cv_cc_Os" >&6; } # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +$as_echo_n "checking whether -falign-loops works... " >&6; } if test "${grub_cv_cc_falign_loop+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS="-falign-loops=1" @@ -6744,20 +7171,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_falign_loop=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_falign_loop=no @@ -6766,8 +7194,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 -echo "${ECHO_T}$grub_cv_cc_falign_loop" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 +$as_echo "$grub_cv_cc_falign_loop" >&6; } if test "x$grub_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -6791,10 +7219,10 @@ fi if test "$target_cpu"-"$platform" = x86_64-efi; then # Use large model to support 4G memory - { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 -echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 +$as_echo_n "checking whether option -mcmodel=large works... " >&6; } if test "${grub_cv_cc_mcmodel+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS="-m64 -mcmodel=large" @@ -6819,20 +7247,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_mcmodel=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_mcmodel=no @@ -6841,19 +7270,19 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 -echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 +$as_echo "$grub_cv_cc_mcmodel" >&6; } if test "x$grub_cv_cc_no_mcmodel" = xno; then - { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 -echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} + { { $as_echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 +$as_echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi # EFI writes to stack below %rsp, we must not use the red zone - { echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 -echo $ECHO_N "checking whether option -mno-red-zone works... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 +$as_echo_n "checking whether option -mno-red-zone works... " >&6; } if test "${grub_cv_cc_no_red_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else CFLAGS="-m64 -mno-red-zone" @@ -6878,20 +7307,21 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_no_red_zone=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_no_red_zone=no @@ -6900,11 +7330,11 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 -echo "${ECHO_T}$grub_cv_cc_no_red_zone" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 +$as_echo "$grub_cv_cc_no_red_zone" >&6; } if test "x$grub_cv_cc_no_red_zone" = xno; then - { { echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 -echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} + { { $as_echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 +$as_echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi @@ -6917,8 +7347,8 @@ fi # Need __enable_execute_stack() for nested function trampolines? -{ echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 -echo $ECHO_N "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 +$as_echo_n "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... " >&6; } cat >conftest.$ac_ext <<_ACEOF void f (int (*p) (void)); @@ -6933,12 +7363,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then @@ -6947,11 +7377,11 @@ cat >>confdefs.h <<\_ACEOF #define NEED_ENABLE_EXECUTE_STACK 1 _ACEOF - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -f conftest* @@ -6960,8 +7390,8 @@ rm -f conftest* # Smashing stack protector. ssp_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +$as_echo_n "checking whether \`$CC' accepts \`-fstack-protector'... " >&6; } # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -6969,14 +7399,14 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Need that, because some distributions ship compilers that include @@ -6987,20 +7417,20 @@ fi # Smashing stack arg probe. sap_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-mstack-arg-probe'... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 +$as_echo_n "checking whether \`$CC' accepts \`-mstack-arg-probe'... " >&6; } cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } _ACEOF if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else sap_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi # Cygwin's GCC uses alloca() to probe the stackframe on static @@ -7020,10 +7450,10 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -{ echo "$as_me:$LINENO: checking whether target compiler is working" >&5 -echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether target compiler is working" >&5 +$as_echo_n "checking whether target compiler is working... " >&6; } if test "${grub_cv_prog_target_cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7046,44 +7476,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_prog_target_cc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_target_cc=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 -echo "${ECHO_T}$grub_cv_prog_target_cc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 +$as_echo "$grub_cv_prog_target_cc" >&6; } if test "x$grub_cv_prog_target_cc" = xno; then - { { echo "$as_me:$LINENO: error: cannot compile for the target" >&5 -echo "$as_me: error: cannot compile for the target" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot compile for the target" >&5 +$as_echo "$as_me: error: cannot compile for the target" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +$as_echo_n "checking whether ${OBJCOPY} works for absolute addresses... " >&6; } if test "${grub_cv_prog_objcopy_absolute+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.c <<\EOF void @@ -7096,11 +7530,11 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest.o; then : else - { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 -echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 +$as_echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} { (exit 1); exit 1; }; } fi grub_cv_prog_objcopy_absolute=yes @@ -7109,29 +7543,29 @@ for link_addr in 2000 8000 7C00; do { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 -echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 +$as_echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} { (exit 1); exit 1; }; } fi if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 -echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 +$as_echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} { (exit 1); exit 1; }; } fi if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mv -f conftest conftest.old else @@ -7142,19 +7576,19 @@ done rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +$as_echo "$grub_cv_prog_objcopy_absolute" >&6; } if test "x$grub_cv_prog_objcopy_absolute" = xno; then - { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 -echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} + { { $as_echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 +$as_echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 -echo $ECHO_N "checking whether linker accepts --build-id=none... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 +$as_echo_n "checking whether linker accepts --build-id=none... " >&6; } if test "${grub_cv_prog_ld_build_id_none+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" @@ -7179,44 +7613,48 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_prog_ld_build_id_none=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_ld_build_id_none=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi -{ echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 -echo "${ECHO_T}$grub_cv_prog_ld_build_id_none" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 +$as_echo "$grub_cv_prog_ld_build_id_none" >&6; } if test "x$grub_cv_prog_ld_build_id_none" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" fi -{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +$as_echo_n "checking if C symbols get an underscore after compilation... " >&6; } if test "${grub_cv_asm_uscore+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.c <<\EOF int @@ -7231,12 +7669,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi @@ -7258,8 +7696,8 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +$as_echo "$grub_cv_asm_uscore" >&6; } if test "x$target_cpu" = xi386; then if test ! -z "$TARGET_IMG_LDSCRIPT"; then @@ -7268,10 +7706,10 @@ if test "x$target_cpu" = xi386; then fi if test "x$platform" = xpc; then -{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +$as_echo_n "checking if __bss_start is defined by the compiler... " >&6; } if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7294,38 +7732,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_uscore_bss_start_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +$as_echo "$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } -{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +$as_echo_n "checking if edata is defined by the compiler... " >&6; } if test "${grub_cv_check_edata_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7348,38 +7790,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_edata_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_edata_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +$as_echo "$grub_cv_check_edata_symbol" >&6; } -{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +$as_echo_n "checking if _edata is defined by the compiler... " >&6; } if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7402,33 +7848,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_uscore_edata_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_edata_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +$as_echo "$grub_cv_check_uscore_edata_symbol" >&6; } @@ -7449,16 +7899,16 @@ elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then _ACEOF else - { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 -echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} + { { $as_echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 +$as_echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} { (exit 1); exit 1; }; } fi -{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +$as_echo_n "checking if end is defined by the compiler... " >&6; } if test "${grub_cv_check_end_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7481,38 +7931,42 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_end_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_end_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +$as_echo "$grub_cv_check_end_symbol" >&6; } -{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +$as_echo_n "checking if _end is defined by the compiler... " >&6; } if test "${grub_cv_check_uscore_end_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7535,33 +7989,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then grub_cv_check_uscore_end_symbol=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_end_symbol=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +$as_echo "$grub_cv_check_uscore_end_symbol" >&6; } @@ -7577,18 +8035,18 @@ elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then _ACEOF else - { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 -echo "$as_me: error: neither end nor _end is defined" >&2;} + { { $as_echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 +$as_echo "$as_me: error: neither end nor _end is defined" >&2;} { (exit 1); exit 1; }; } fi fi CFLAGS="$TARGET_CFLAGS" -{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +$as_echo_n "checking whether addr32 must be in the same line as the instruction... " >&6; } if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.s <<\EOF .code16 @@ -7599,7 +8057,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_prefix_requirement=yes else @@ -7629,14 +8087,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +$as_echo "$grub_cv_i386_asm_prefix_requirement" >&6; } -{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +$as_echo_n "checking for .code16 addr32 assembler support... " >&6; } if test "${grub_cv_i386_asm_addr32+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.s.in <<\EOF .code16 @@ -7653,7 +8111,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_addr32=yes else @@ -7664,13 +8122,13 @@ rm -f conftest* fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +$as_echo "$grub_cv_i386_asm_addr32" >&6; } -{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +$as_echo_n "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... " >&6; } if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else cat > conftest.s <<\EOF lcall *(offset) @@ -7683,7 +8141,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_absolute_without_asterisk=no else @@ -7702,13 +8160,13 @@ _ACEOF fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +$as_echo "$grub_cv_i386_asm_absolute_without_asterisk" >&6; } -{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +$as_echo_n "checking if GCC has the regparm=3 bug... " >&6; } if test "${grub_cv_i386_check_nested_functions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then grub_cv_i386_check_nested_functions=yes @@ -7752,29 +8210,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_try") 2>&5 ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then grub_cv_i386_check_nested_functions=no else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: program exited with status $ac_status" >&5 +$as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi +rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -7782,8 +8243,8 @@ fi fi -{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } +{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +$as_echo "$grub_cv_i386_check_nested_functions" >&6; } if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -7802,7 +8263,7 @@ fi else cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR +#define NESTED_FUNC_ATTR /**/ _ACEOF fi @@ -7841,10 +8302,10 @@ fi if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +$as_echo_n "checking for wgetch in -lncurses... " >&6; } if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" @@ -7876,39 +8337,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_ncurses_wgetch=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses_wgetch=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } -if test $ac_cv_lib_ncurses_wgetch = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +$as_echo "$ac_cv_lib_ncurses_wgetch" >&6; } +if test "x$ac_cv_lib_ncurses_wgetch" = x""yes; then LIBCURSES="-lncurses" else - { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +$as_echo_n "checking for wgetch in -lcurses... " >&6; } if test "${ac_cv_lib_curses_wgetch+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" @@ -7940,37 +8405,41 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_curses_wgetch=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curses_wgetch=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } -if test $ac_cv_lib_curses_wgetch = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +$as_echo "$ac_cv_lib_curses_wgetch" >&6; } +if test "x$ac_cv_lib_curses_wgetch" = x""yes; then LIBCURSES="-lcurses" else - { { echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 -echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} + { { $as_echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 +$as_echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -7982,20 +8451,21 @@ fi for ac_header in ncurses/curses.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8011,32 +8481,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8050,51 +8521,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8103,41 +8575,45 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in ncurses.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8153,32 +8629,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8192,51 +8669,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8245,41 +8723,45 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in curses.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8295,32 +8777,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8334,51 +8817,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8387,26 +8871,29 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 -echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} + { { $as_echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 +$as_echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -8423,10 +8910,10 @@ done if [ x"$enable_grub_emu_usb" = xyes ]; then # Check for libusb libraries. - { echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 -echo $ECHO_N "checking for usb_claim_interface in -lusb... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 +$as_echo_n "checking for usb_claim_interface in -lusb... " >&6; } if test "${ac_cv_lib_usb_usb_claim_interface+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusb $LIBS" @@ -8458,37 +8945,41 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then + } && test -s conftest$ac_exeext && { + test "$cross_compiling" = yes || + $as_test_x conftest$ac_exeext + }; then ac_cv_lib_usb_usb_claim_interface=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_usb_usb_claim_interface=no fi +rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 -echo "${ECHO_T}$ac_cv_lib_usb_usb_claim_interface" >&6; } -if test $ac_cv_lib_usb_usb_claim_interface = yes; then +{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 +$as_echo "$ac_cv_lib_usb_usb_claim_interface" >&6; } +if test "x$ac_cv_lib_usb_usb_claim_interface" = x""yes; then LIBUSB="-lusb" else - { { echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 -echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} + { { $as_echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 +$as_echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -8498,20 +8989,21 @@ fi for ac_header in usb.h do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } + { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } else # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 +$as_echo_n "checking $ac_header usability... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8527,32 +9019,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +$as_echo "$ac_header_compiler" >&6; } # Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 +$as_echo_n "checking $ac_header presence... " >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8566,51 +9059,52 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 +eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" +$as_echo "$ac_try_echo") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 + $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - echo "$as_me: failed program was:" >&5 + $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } +{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +$as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8619,26 +9113,29 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 +$as_echo_n "checking for $ac_header... " >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } +ac_res=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then +as_val=`eval 'as_val=${'$as_ac_Header'} + $as_echo "$as_val"'` + if test "x$as_val" = x""yes; then cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 -echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} + { { $as_echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 +$as_echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -8674,10 +9171,10 @@ if test x"$enable_grub_mkfont" = xyes ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 +$as_echo_n "checking for $ac_word... " >&6; } if test "${ac_cv_prog_FREETYPE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 + $as_echo_n "(cached) " >&6 else if test -n "$FREETYPE"; then ac_cv_prog_FREETYPE="$FREETYPE" # Let the user override the test. @@ -8690,7 +9187,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_FREETYPE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -8701,11 +9198,11 @@ fi fi FREETYPE=$ac_cv_prog_FREETYPE if test -n "$FREETYPE"; then - { echo "$as_me:$LINENO: result: $FREETYPE" >&5 -echo "${ECHO_T}$FREETYPE" >&6; } + { $as_echo "$as_me:$LINENO: result: $FREETYPE" >&5 +$as_echo "$FREETYPE" >&6; } else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi @@ -8713,8 +9210,8 @@ fi done if test "x$FREETYPE" = x ; then - { { echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 -echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} + { { $as_echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 +$as_echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} { (exit 1); exit 1; }; } fi freetype_cflags=`freetype-config --cflags` @@ -8726,21 +9223,21 @@ fi # Output files. -{ echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 -echo $ECHO_N "checking whether ln can handle directories properly... $ECHO_C" >&6; } +{ $as_echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 +$as_echo_n "checking whether ln can handle directories properly... " >&6; } mkdir testdir 2>/dev/null case $srcdir in [\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; *) reldir=../$srcdir/include/grub/util ;; esac if ln -s $reldir testdir/util 2>/dev/null ; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } + { $as_echo "$as_me:$LINENO: result: yes" >&5 +$as_echo "yes" >&6; } link_dir=yes else link_dir=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } + { $as_echo "$as_me:$LINENO: result: no" >&5 +$as_echo "no" >&6; } fi rm -rf testdir @@ -8785,11 +9282,12 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; + *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 +$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( + BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -8822,12 +9320,12 @@ echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 +$as_echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -8843,7 +9341,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` + ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -8855,12 +9353,14 @@ LTLIBOBJS=$ac_ltlibobjs + : ${CONFIG_STATUS=./config.status} +ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF +{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -8873,7 +9373,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -8883,7 +9383,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -8905,17 +9405,45 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits +as_nl=' +' +export as_nl +# Printing a long string crashes Solaris 7 /usr/bin/printf. +as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo +as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo +if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then + as_echo='printf %s\n' + as_echo_n='printf %s' +else + if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then + as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' + as_echo_n='/usr/ucb/echo -n' + else + as_echo_body='eval expr "X$1" : "X\\(.*\\)"' + as_echo_n_body='eval + arg=$1; + case $arg in + *"$as_nl"*) + expr "X$arg" : "X\\(.*\\)$as_nl"; + arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; + esac; + expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" + ' + export as_echo_n_body + as_echo_n='sh -c $as_echo_n_body as_echo' + fi + export as_echo_body + as_echo='sh -c $as_echo_body as_echo' +fi + # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh + PATH_SEPARATOR=: + (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { + (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || + PATH_SEPARATOR=';' + } fi # Support unset when possible. @@ -8931,8 +9459,6 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) -as_nl=' -' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -8955,7 +9481,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -8968,17 +9494,10 @@ PS2='> ' PS4='+ ' # NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done +LC_ALL=C +export LC_ALL +LANGUAGE=C +export LANGUAGE # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -9000,7 +9519,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | +$as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -9051,7 +9570,7 @@ $as_unset CDPATH s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -9079,7 +9598,6 @@ case `echo -n x` in *) ECHO_N='-n';; esac - if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -9092,19 +9610,22 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir + mkdir conf$$.dir 2>/dev/null fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || +if (echo >conf$$.file) 2>/dev/null; then + if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || + as_ln_s='cp -p' + elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln + else as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln + fi else as_ln_s='cp -p' fi @@ -9129,10 +9650,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -9155,7 +9676,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was +generated by GNU Autoconf 2.63. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9168,7 +9689,16 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +case $ac_config_files in *" +"*) set x $ac_config_files; shift; ac_config_files=$*;; +esac + +case $ac_config_headers in *" +"*) set x $ac_config_headers; shift; ac_config_headers=$*;; +esac + + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -9176,22 +9706,23 @@ config_links="$ac_config_links" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTIONS] [FILE]... +Usage: $0 [OPTION]... [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages + -q, --quiet, --silent + do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -9205,24 +9736,25 @@ $config_links Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_version="\\ GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.63, + with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2006 Free Software Foundation, Inc. +Copyright (C) 2008 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' +AWK='$AWK' +test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +# The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do @@ -9244,30 +9776,36 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; + $as_echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" + case $ac_optarg in + *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; + esac + CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 + { $as_echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; + $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 + -*) { $as_echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -9286,30 +9824,32 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL + set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + shift + \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 + CONFIG_SHELL='$SHELL' export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + exec "\$@" fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - echo "$ac_log" + $as_echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets @@ -9323,8 +9863,8 @@ do "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -9365,158 +9905,143 @@ $debug || (umask 077 && mkdir "$tmp") } || { - echo "$me: cannot create a temporary directory in ." >&2 + $as_echo "$as_me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h +# Set up the scripts for CONFIG_FILES section. +# No need to generate them if there are no CONFIG_FILES. +# This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then + +ac_cr=' ' +ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` +if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then + ac_cs_awk_cr='\\r' +else + ac_cs_awk_cr=$ac_cr +fi + +echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF - +{ + echo "cat >conf$$subs.awk <<_ACEOF" && + echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && + echo "_ACEOF" +} >conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } +ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -host_kernel!$host_kernel$ac_delim -platform!$platform$ac_delim -CMP!$CMP$ac_delim -YACC!$YACC$ac_delim -UNIFONT_BDF!$UNIFONT_BDF$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -RUBY!$RUBY$ac_delim -HELP2MAN!$HELP2MAN$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LIBLZO!$LIBLZO$ac_delim -enable_lzo!$enable_lzo$ac_delim -TARGET_IMG_LDSCRIPT!$TARGET_IMG_LDSCRIPT$ac_delim -TARGET_IMG_LDFLAGS!$TARGET_IMG_LDFLAGS$ac_delim -TARGET_OBJ2ELF!$TARGET_OBJ2ELF$ac_delim -TARGET_CC!$TARGET_CC$ac_delim -ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim -OBJCOPY!$OBJCOPY$ac_delim -STRIP!$STRIP$ac_delim -NM!$NM$ac_delim -TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim -TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim -TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim -LIBCURSES!$LIBCURSES$ac_delim -LIBUSB!$LIBUSB$ac_delim -enable_grub_emu!$enable_grub_emu$ac_delim -enable_grub_emu_usb!$enable_grub_emu_usb$ac_delim -enable_grub_fstest!$enable_grub_fstest$ac_delim -enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim -FREETYPE!$FREETYPE$ac_delim -enable_grub_mkfont!$enable_grub_mkfont$ac_delim -freetype_cflags!$freetype_cflags$ac_delim -freetype_libs!$freetype_libs$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF + . ./conf$$subs.sh || + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then + ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` + if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done +rm -f conf$$subs.sh -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>"\$tmp/subs1.awk" <<\\_ACAWK && _ACEOF +sed -n ' +h +s/^/S["/; s/!.*/"]=/ +p +g +s/^[^!]*!// +:repl +t repl +s/'"$ac_delim"'$// +t delim +:nl +h +s/\(.\{148\}\).*/\1/ +t more1 +s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ +p +n +b repl +:more1 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t nl +:delim +h +s/\(.\{148\}\).*/\1/ +t more2 +s/["\\]/\\&/g; s/^/"/; s/$/"/ +p +b +:more2 +s/["\\]/\\&/g; s/^/"/; s/$/"\\/ +p +g +s/.\{148\}// +t delim +' >$CONFIG_STATUS || ac_write_fail=1 +rm -f conf$$subs.awk +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +_ACAWK +cat >>"\$tmp/subs1.awk" <<_ACAWK && + for (key in S) S_is_set[key] = 1 + FS = "" +} +{ + line = $ 0 + nfields = split(line, field, "@") + substed = 0 + len = length(field[1]) + for (i = 2; i < nfields; i++) { + key = field[i] + keylen = length(key) + if (S_is_set[key]) { + value = S[key] + line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) + len += length(value) + length(field[++i]) + substed = 1 + } else + len += 1 + keylen + } + + print line +} + +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then + sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" +else + cat +fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ + || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 +$as_echo "$as_me: error: could not setup config files machinery" >&2;} + { (exit 1); exit 1; }; } +_ACEOF # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and @@ -9533,19 +10058,133 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" +# Set up the scripts for CONFIG_HEADERS section. +# No need to generate them if there are no CONFIG_HEADERS. +# This happens for instance with `./config.status Makefile'. +if test -n "$CONFIG_HEADERS"; then +cat >"$tmp/defines.awk" <<\_ACAWK || +BEGIN { +_ACEOF -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS +# Transform confdefs.h into an awk script `defines.awk', embedded as +# here-document in config.status, that substitutes the proper values into +# config.h.in to produce config.h. + +# Create a delimiter string that does not exist in confdefs.h, to ease +# handling of long lines. +ac_delim='%!_!# ' +for ac_last_try in false false :; do + ac_t=`sed -n "/$ac_delim/p" confdefs.h` + if test -z "$ac_t"; then + break + elif $ac_last_try; then + { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 +$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} + { (exit 1); exit 1; }; } + else + ac_delim="$ac_delim!$ac_delim _$ac_delim!! " + fi +done + +# For the awk script, D is an array of macro values keyed by name, +# likewise P contains macro parameters if any. Preserve backslash +# newline sequences. + +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +sed -n ' +s/.\{148\}/&'"$ac_delim"'/g +t rset +:rset +s/^[ ]*#[ ]*define[ ][ ]*/ / +t def +d +:def +s/\\$// +t bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3"/p +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p +d +:bsnl +s/["\\]/\\&/g +s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ +D["\1"]=" \3\\\\\\n"\\/p +t cont +s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p +t cont +d +:cont +n +s/.\{148\}/&'"$ac_delim"'/g +t clear +:clear +s/\\$// +t bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/"/p +d +:bsnlc +s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p +b cont +' >$CONFIG_STATUS || ac_write_fail=1 + +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 + for (key in D) D_is_set[key] = 1 + FS = "" +} +/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { + line = \$ 0 + split(line, arg, " ") + if (arg[1] == "#") { + defundef = arg[2] + mac1 = arg[3] + } else { + defundef = substr(arg[1], 2) + mac1 = arg[2] + } + split(mac1, mac2, "(") #) + macro = mac2[1] + prefix = substr(line, 1, index(line, defundef) - 1) + if (D_is_set[macro]) { + # Preserve the white space surrounding the "#". + print prefix "define", macro P[macro] D[macro] + next + } else { + # Replace #undef with comments. This is necessary, for example, + # in the case of _POSIX_SOURCE, which is predefined and required + # on some systems where configure will not decide to define it. + if (defundef == "undef") { + print "/*", prefix defundef, macro, "*/" + next + } + } +} +{ print } +_ACAWK +_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 + { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 +$as_echo "$as_me: error: could not setup config headers machinery" >&2;} + { (exit 1); exit 1; }; } +fi # test -n "$CONFIG_HEADERS" + + +eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS " +shift +for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} + :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 +$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -9574,26 +10213,38 @@ echo "$as_me: error: Invalid tag $ac_tag." >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - ac_file_inputs="$ac_file_inputs $ac_f" + case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac + ac_file_inputs="$ac_file_inputs '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." + configure_input='Generated from '` + $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' + `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} + { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 +$as_echo "$as_me: creating $ac_file" >&6;} fi + # Neutralize special characters interpreted by sed in replacement strings. + case $configure_input in #( + *\&* | *\|* | *\\* ) + ac_sed_conf_input=`$as_echo "$configure_input" | + sed 's/[\\\\&|]/\\\\&/g'`;; #( + *) ac_sed_conf_input=$configure_input;; + esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; + *:-:* | *:-) cat >"$tmp/stdin" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac ;; esac @@ -9603,7 +10254,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | +$as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9629,7 +10280,7 @@ echo X"$ac_file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( + *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -9638,7 +10289,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | +$as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -9659,17 +10310,17 @@ echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` + ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` + ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -9709,12 +10360,13 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -case `sed -n '/datarootdir/ { +ac_sed_dataroot=' +/datarootdir/ { p q } @@ -9723,13 +10375,14 @@ case `sed -n '/datarootdir/ { /@infodir@/p /@localedir@/p /@mandir@/p -' $ac_file_inputs` in +' +case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -9743,15 +10396,16 @@ _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +ac_sed_extra="$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF +cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t +s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t +s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -9761,146 +10415,94 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out +" +eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac + -) cat "$tmp/out" && rm -f "$tmp/out";; + *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; + esac \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; :H) # # CONFIG_HEADER # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} + { + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" + } >"$tmp/config.h" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } + if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then + { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +$as_echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f $ac_file - mv "$tmp/config.h" $ac_file + rm -f "$ac_file" + mv "$tmp/config.h" "$ac_file" \ + || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 +$as_echo "$as_me: error: could not create $ac_file" >&2;} + { (exit 1); exit 1; }; } fi else - echo "/* $configure_input */" - cat "$ac_result" + $as_echo "/* $configure_input */" \ + && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ + || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 +$as_echo "$as_me: error: could not create -" >&2;} + { (exit 1); exit 1; }; } fi - rm -f "$tmp/out12" ;; :L) # # CONFIG_LINK # - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} + if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then + : + else + # Prefer the file from the source tree if names are identical. + if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then + ac_source=$srcdir/$ac_source + fi - if test ! -r "$srcdir/$ac_source"; then - { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 -echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} + { $as_echo "$as_me:$LINENO: linking $ac_source to $ac_file" >&5 +$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} + + if test ! -r "$ac_source"; then + { { $as_echo "$as_me:$LINENO: error: $ac_source: file not found" >&5 +$as_echo "$as_me: error: $ac_source: file not found" >&2;} + { (exit 1); exit 1; }; } + fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $srcdir in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$ac_source" "$ac_file" 2>/dev/null || + cp -p "$ac_source" "$ac_file" || + { { $as_echo "$as_me:$LINENO: error: cannot link or copy $ac_source to $ac_file" >&5 +$as_echo "$as_me: error: cannot link or copy $ac_source to $ac_file" >&2;} { (exit 1); exit 1; }; } fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $srcdir in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || - cp -p "$srcdir/$ac_source" "$ac_file" || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; esac @@ -9918,6 +10520,11 @@ _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save +test $ac_write_fail = 0 || + { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 +$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} + { (exit 1); exit 1; }; } + # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -9939,4 +10546,8 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi +if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then + { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 +$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} +fi diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 598c7c359..a764b370d 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -933,7 +933,7 @@ struct grub_efi_configuration_table { grub_efi_guid_t vendor_guid; void *vendor_table; -} __attribute__ ((packed)); +}; typedef struct grub_efi_configuration_table grub_efi_configuration_table_t; struct grub_efi_simple_input_interface diff --git a/include/grub/i386/pci.h b/include/grub/i386/pci.h index 996f64245..f4f08ab11 100644 --- a/include/grub/i386/pci.h +++ b/include/grub/i386/pci.h @@ -32,39 +32,4 @@ grub_pci_read (grub_pci_address_t addr) return grub_inl (GRUB_PCI_DATA_REG); } -static inline grub_uint16_t -grub_pci_read_word (grub_pci_address_t addr) -{ - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - return grub_inw (GRUB_PCI_DATA_REG + (addr & 3)); -} - -static inline grub_uint8_t -grub_pci_read_byte (grub_pci_address_t addr) -{ - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - return grub_inb (GRUB_PCI_DATA_REG + (addr & 3)); -} - -static inline void -grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) -{ - grub_outl (addr, GRUB_PCI_ADDR_REG); - grub_outl (data, GRUB_PCI_DATA_REG); -} - -static inline void -grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) -{ - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - grub_outw (data, GRUB_PCI_DATA_REG + (addr & 3)); -} - -static inline void -grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) -{ - grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); - grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3)); -} - #endif /* GRUB_CPU_PCI_H */ diff --git a/include/grub/pci.h b/include/grub/pci.h index 7c8b50528..aceee494f 100644 --- a/include/grub/pci.h +++ b/include/grub/pci.h @@ -36,8 +36,8 @@ #define GRUB_PCI_ADDR_IO_MASK ~0x03 typedef grub_uint32_t grub_pci_id_t; -typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t) - (int bus, int device, int func, grub_pci_id_t pciid); +typedef int (*grub_pci_iteratefunc_t) (int bus, int device, int func, + grub_pci_id_t pciid); typedef grub_uint32_t grub_pci_address_t; grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device, diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 100b268be..d8c6a67c1 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #define GRUB_LINUX_CL_OFFSET 0x1000 @@ -249,9 +248,9 @@ allocate_pages (grub_size_t prot_size) } grub_dprintf ("linux", "real_mode_mem = %lx, real_mode_pages = %x, " - "prot_mode_mem = %lx, prot_mode_pages = %x\n", - (unsigned long) real_mode_mem, (unsigned) real_mode_pages, - (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); + "prot_mode_mem = %lx, prot_mode_pages = %x\n", + (unsigned long) real_mode_mem, (unsigned) real_mode_pages, + (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); grub_free (mmap); return 1; @@ -264,8 +263,8 @@ allocate_pages (grub_size_t prot_size) static void grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, - grub_uint64_t start, grub_uint64_t size, - grub_uint32_t type) + grub_uint64_t start, grub_uint64_t size, + grub_uint32_t type) { int n = *e820_num; @@ -284,6 +283,57 @@ grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, } } +static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; +static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; + +#define EBDA_SEG_ADDR 0x40e +#define LOW_MEM_ADDR 0x413 +#define FAKE_EBDA_SEG 0x9fc0 + +static void +fake_bios_data (void) +{ + unsigned i; + void *acpi; + grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; + + acpi = 0; + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + { + grub_efi_guid_t *guid = + &grub_efi_system_table->configuration_table[i].vendor_guid; + + if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) + { + acpi = grub_efi_system_table->configuration_table[i].vendor_table; + grub_dprintf ("linux", "ACPI2: %p\n", acpi); + } + else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) + { + void *t; + + t = grub_efi_system_table->configuration_table[i].vendor_table; + if (! acpi) + acpi = t; + grub_dprintf ("linux", "ACPI: %p\n", t); + } + } + + if (acpi == 0) + return; + + ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; + low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; + + if ((*ebda_seg_ptr) || (*low_mem_ptr)) + return; + + *ebda_seg_ptr = FAKE_EBDA_SEG; + *low_mem_ptr = FAKE_EBDA_SEG >> 6; + + grub_memcpy ((char *) (FAKE_EBDA_SEG << 4), acpi, 1024); +} + #ifdef __x86_64__ struct { @@ -303,11 +353,13 @@ grub_linux_boot (void) grub_efi_memory_descriptor_t *desc; int e820_num; + fake_bios_data (); + params = real_mode_mem; grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", (unsigned) params->code32_start, - (unsigned long) &(idt_desc.limit), + (unsigned long) &(idt_desc.limit), (unsigned long) &(gdt_desc.limit)); grub_dprintf ("linux", "idt = %x:%lx, gdt = %x:%lx\n", (unsigned) idt_desc.limit, (unsigned long) idt_desc.base, @@ -324,69 +376,69 @@ grub_linux_boot (void) desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { switch (desc->type) - { - case GRUB_EFI_ACPI_RECLAIM_MEMORY: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_ACPI); - break; + { + case GRUB_EFI_ACPI_RECLAIM_MEMORY: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_ACPI); + break; - case GRUB_EFI_ACPI_MEMORY_NVS: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_NVS); - break; + case GRUB_EFI_ACPI_MEMORY_NVS: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_NVS); + break; - case GRUB_EFI_RUNTIME_SERVICES_CODE: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_EXEC_CODE); - break; + case GRUB_EFI_RUNTIME_SERVICES_CODE: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_EXEC_CODE); + break; - case GRUB_EFI_LOADER_CODE: - case GRUB_EFI_LOADER_DATA: - case GRUB_EFI_BOOT_SERVICES_CODE: - case GRUB_EFI_BOOT_SERVICES_DATA: - case GRUB_EFI_CONVENTIONAL_MEMORY: - { - grub_uint64_t start, size, end; + case GRUB_EFI_LOADER_CODE: + case GRUB_EFI_LOADER_DATA: + case GRUB_EFI_BOOT_SERVICES_CODE: + case GRUB_EFI_BOOT_SERVICES_DATA: + case GRUB_EFI_CONVENTIONAL_MEMORY: + { + grub_uint64_t start, size, end; - start = desc->physical_start; - size = desc->num_pages << 12; - end = start + size; + start = desc->physical_start; + size = desc->num_pages << 12; + end = start + size; - /* Skip A0000 - 100000 region. */ - if ((start < 0x100000ULL) && (end > 0xA0000ULL)) - { - if (start < 0xA0000ULL) - { - grub_e820_add_region (params->e820_map, &e820_num, - start, - 0xA0000ULL - start, - GRUB_E820_RAM); - } + /* Skip A0000 - 100000 region. */ + if ((start < 0x100000ULL) && (end > 0xA0000ULL)) + { + if (start < 0xA0000ULL) + { + grub_e820_add_region (params->e820_map, &e820_num, + start, + 0xA0000ULL - start, + GRUB_E820_RAM); + } - if (end <= 0x100000ULL) - continue; + if (end <= 0x100000ULL) + continue; - start = 0x100000ULL; - size = end - start; - } + start = 0x100000ULL; + size = end - start; + } - grub_e820_add_region (params->e820_map, &e820_num, - start, size, GRUB_E820_RAM); - break; - } + grub_e820_add_region (params->e820_map, &e820_num, + start, size, GRUB_E820_RAM); + break; + } - default: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_RESERVED); - } + default: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_RESERVED); + } } params->mmap_size = e820_num; @@ -468,106 +520,41 @@ static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; #define FBTEST_STEP (0x10000 >> 2) #define FBTEST_COUNT 8 -static int -find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) -{ - grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb_base; - int i; - - for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) - { - if ((*base & RGB_MASK) == RGB_MAGIC) - { - int j; - - for (j = LINE_MIN; j <= LINE_MAX; j++) - { - if ((base[j] & RGB_MASK) == RGB_MAGIC) - { - *fb_base = (grub_uint32_t) (grub_target_addr_t) base; - *line_len = j << 2; - - return 1; - } - } - - break; - } - } - - return 0; -} +static grub_uint32_t fb_list[]= + {0x40000000, 0x80000000, 0xc0000000, 0}; static int find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) { - int found = 0; + grub_uint32_t *fb; - auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, - grub_pci_id_t pciid); - - int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, - grub_pci_id_t pciid) + for (fb = fb_list; *fb; fb++) { - grub_pci_address_t addr; + grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb; + int i; - addr = grub_pci_make_address (bus, dev, func, 2); - if (grub_pci_read (addr) >> 24 == 0x3) - { - int i; - - grub_printf ("Display controller: %d:%d.%d\nDevice id: %x\n", - bus, dev, func, pciid); - addr += 8; - for (i = 0; i < 6; i++, addr += 4) + for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) + { + if ((*base & RGB_MASK) == RGB_MAGIC) { - grub_uint32_t old_bar1, old_bar2, type; - grub_uint64_t base64; + int j; - old_bar1 = grub_pci_read (addr); - if ((! old_bar1) || (old_bar1 & GRUB_PCI_ADDR_SPACE_IO)) - continue; + for (j = LINE_MIN; j <= LINE_MAX; j++) + { + if ((base[j] & RGB_MASK) == RGB_MAGIC) + { + *fb_base = (grub_uint32_t) (grub_target_addr_t) base; + *line_len = j << 2; - type = old_bar1 & GRUB_PCI_ADDR_MEM_TYPE_MASK; - if (type == GRUB_PCI_ADDR_MEM_TYPE_64) - { - if (i == 5) - break; + return 0; + } + } - old_bar2 = grub_pci_read (addr + 4); - } - else - old_bar2 = 0; - - base64 = old_bar2; - base64 <<= 32; - base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK); - - grub_printf ("%s(%d): 0x%llx\n", - ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ? - "VMEM" : "MMIO"), i, - (unsigned long long) base64); - - if ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) && (! found)) - { - *fb_base = base64; - if (find_line_len (fb_base, line_len)) - found++; - } - - if (type == GRUB_PCI_ADDR_MEM_TYPE_64) - { - i++; - addr += 4; - } - } - } - - return found; + break; + } + } } - - grub_pci_iterate (find_card); - return found; + return 1; } static int @@ -593,13 +580,13 @@ grub_linux_setup_video (struct linux_kernel_params *params) ret = find_framebuf (&fb_base, &line_len); grub_efi_set_text_mode (1); - if (! ret) + if (ret) { grub_printf ("Can\'t find frame buffer address\n"); return 1; } - grub_printf ("Frame buffer base: 0x%x\n", fb_base); + grub_printf ("Video frame buffer: 0x%x\n", fb_base); grub_printf ("Video line length: %d\n", line_len); params->lfb_width = width; @@ -619,9 +606,6 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->reserved_mask_size = 8; params->reserved_field_pos = 24; - params->have_vga = GRUB_VIDEO_TYPE_VLFB; - params->vid_mode = 0x338; /* 1024x768x32 */ - return 0; } @@ -637,6 +621,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_ssize_t len; int i; char *dest; + int video_type; grub_dl_ref (my_mod); @@ -823,10 +808,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_printf (" [Linux-bzImage, setup=0x%x, size=0x%x]\n", (unsigned) real_size, (unsigned) prot_size); - grub_linux_setup_video (params); - /* Detect explicitly specified memory size, if any. */ linux_mem_size = 0; + video_type = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "mem=", 4) == 0) { @@ -862,12 +846,20 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_mem_size <<= shift; } } - else if (grub_memcmp (argv[i], "video=efifb", 11) == 0) + else if (grub_memcmp (argv[i], "video=", 6) == 0) { - if (params->have_vga) - params->have_vga = GRUB_VIDEO_TYPE_EFI; + if (grub_memcmp (&argv[i][6], "vesafb", 6) == 0) + video_type = GRUB_VIDEO_TYPE_VLFB; + else if (grub_memcmp (&argv[i][6], "efifb", 5) == 0) + video_type = GRUB_VIDEO_TYPE_EFI; } + if (video_type) + { + if (! grub_linux_setup_video (params)) + params->have_vga = video_type; + } + /* Specify the boot file. */ dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, "BOOT_IMAGE="); @@ -954,7 +946,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), /* Usually, the compression ratio is about 50%. */ addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) - + page_align (size); + + page_align (size); /* Find the highest address to put the initrd. */ mmap_size = find_mmap_size (); @@ -976,7 +968,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), physical_end = addr_max; if (physical_end < page_align (size)) - continue; + continue; physical_end -= page_align (size); diff --git a/util/grub-dumpbios.in b/util/grub-dumpbios.in deleted file mode 100644 index 396503936..000000000 --- a/util/grub-dumpbios.in +++ /dev/null @@ -1,58 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2009 Free Software Foundation, Inc. -# -# GRUB is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GRUB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GRUB. If not, see . - -# Usage: usage -# Print the usage. -usage () { - cat <. -EOF -} - -# Check the arguments. -for option in "$@"; do - case "$option" in - -h | --help) - usage - exit 0 ;; - -v | --version) - echo "$0 (GNU GRUB @PACKAGE_VERSION@)" - exit 0 ;; - -o) - shift - output_dir=$1 - ;; - --output=) - output_dir=`echo "$option" | sed 's/--output=//'` - ;; - -*) - echo "Unrecognized option \`$option'" 1>&2 - usage - exit 1 - ;; - esac -done - -dd if=/dev/mem of=${output_dir}vbios.bin bs=65536 skip=12 count=1 -dd if=/dev/mem of=${output_dir}int10.bin bs=4 skip=16 count=1 From 04186a9ce27ce736b5f6914d37e9dc743899bb3d Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 4 Apr 2009 12:28:33 +0000 Subject: [PATCH 0604/1707] 2009-04-04 Vladimir Serbinenko * conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): add list.h and command.h remove extraneous kernel_elf_HEADERS --- ChangeLog | 6 + conf/powerpc-ieee1275.mk | 5 +- conf/powerpc-ieee1275.rmk | 5 +- config.h.in | 54 +- configure | 5253 ++++++++++++++++--------------------- 5 files changed, 2339 insertions(+), 2984 deletions(-) diff --git a/ChangeLog b/ChangeLog index c94409d61..538e775a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-04 Vladimir Serbinenko + + * conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): add list.h + and command.h + remove extraneous kernel_elf_HEADERS + 2009-04-04 Bean * include/grub/util/misc.h: Add dummy function fsync for mingw. diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index c6ff70a0d..efd249e37 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -17,7 +17,8 @@ DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h + pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ + command.h symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) @@ -602,8 +603,6 @@ kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S $(kern/powerpc/cache.S_DEP $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< -include kernel_elf-kern_powerpc_cache.d -kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h list.h handler.h \ - command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 5aaaf5629..9ba298176 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -16,7 +16,8 @@ DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h + pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ + command.h symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) @@ -87,8 +88,6 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -kernel_elf_HEADERS = grub/powerpc/ieee1275/ieee1275.h list.h handler.h \ - command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ diff --git a/config.h.in b/config.h.in index a5234009b..c110d6307 100644 --- a/config.h.in +++ b/config.h.in @@ -4,9 +4,6 @@ prefixed with an asterisk */ #undef ABSOLUTE_WITHOUT_ASTERISK -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - /* Define it to \"addr32\" or \"addr32;\" to make GAS happy */ #undef ADDR32 @@ -115,52 +112,17 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif + /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE diff --git a/configure b/configure index dcb2365cd..a3bde5844 100644 --- a/configure +++ b/configure @@ -1,11 +1,11 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.63 for GRUB 1.96. +# Generated by GNU Autoconf 2.61 for GRUB 1.96. # # Report bugs to . # # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## --------------------- ## @@ -17,7 +17,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -39,45 +39,17 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -93,6 +65,8 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -115,7 +89,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -128,10 +102,17 @@ PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -153,7 +134,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -179,7 +160,7 @@ else as_have_required=no fi - if test $as_have_required = yes && (eval ": + if test $as_have_required = yes && (eval ": (as_func_return () { (exit \$1) } @@ -261,7 +242,7 @@ IFS=$as_save_IFS if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -282,7 +263,7 @@ _ASEOF if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -362,10 +343,10 @@ fi if test "x$CONFIG_SHELL" != x; then for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} + do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + done + export CONFIG_SHELL + exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} fi @@ -434,10 +415,9 @@ fi test \$exitcode = 0") || { echo No shell found that supports shell functions. - echo Please tell bug-autoconf@gnu.org about your system, - echo including any error possibly output before this message. - echo This can help us improve future autoconf versions. - echo Configuration will now proceed without shell functions. + echo Please tell autoconf@gnu.org about your system, + echo including any error possibly output before this + echo message } @@ -473,7 +453,7 @@ test \$exitcode = 0") || { s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -501,6 +481,7 @@ case `echo -n x` in *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -513,22 +494,19 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -553,10 +531,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -637,115 +615,103 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='LTLIBOBJS -LIBOBJS -freetype_libs -freetype_cflags -enable_grub_mkfont -FREETYPE -enable_grub_pe2elf -enable_grub_fstest -enable_grub_emu_usb -enable_grub_emu -LIBUSB -LIBCURSES -TARGET_LDFLAGS -TARGET_CPPFLAGS -TARGET_CFLAGS -NM -STRIP -OBJCOPY -ac_ct_TARGET_CC -TARGET_CC -TARGET_OBJ2ELF -TARGET_IMG_LDFLAGS -TARGET_IMG_LDSCRIPT -enable_lzo -LIBLZO -EGREP -GREP -CPP -OBJEXT -EXEEXT -ac_ct_CC -CPPFLAGS -LDFLAGS -CFLAGS -CC -HELP2MAN -RUBY -SET_MAKE -AWK -INSTALL_DATA -INSTALL_SCRIPT -INSTALL_PROGRAM -UNIFONT_BDF -YACC -CMP -platform -host_kernel -target_os -target_vendor -target_cpu -target -host_os -host_vendor -host_cpu -host -build_os -build_vendor -build_cpu -build -target_alias -host_alias -build_alias -LIBS -ECHO_T -ECHO_N -ECHO_C -DEFS -mandir -localedir -libdir -psdir -pdfdir -dvidir -htmldir -infodir -docdir -oldincludedir -includedir -localstatedir -sharedstatedir -sysconfdir -datadir -datarootdir -libexecdir -sbindir -bindir -program_transform_name -prefix -exec_prefix -PACKAGE_BUGREPORT -PACKAGE_STRING -PACKAGE_VERSION -PACKAGE_TARNAME -PACKAGE_NAME +ac_subst_vars='SHELL PATH_SEPARATOR -SHELL' -ac_subst_files='' -ac_user_opts=' -enable_option_checking -with_platform -enable_largefile +PACKAGE_NAME +PACKAGE_TARNAME +PACKAGE_VERSION +PACKAGE_STRING +PACKAGE_BUGREPORT +exec_prefix +prefix +program_transform_name +bindir +sbindir +libexecdir +datarootdir +datadir +sysconfdir +sharedstatedir +localstatedir +includedir +oldincludedir +docdir +infodir +htmldir +dvidir +pdfdir +psdir +libdir +localedir +mandir +DEFS +ECHO_C +ECHO_N +ECHO_T +LIBS +build_alias +host_alias +target_alias +build +build_cpu +build_vendor +build_os +host +host_cpu +host_vendor +host_os +target +target_cpu +target_vendor +target_os +host_kernel +platform +CMP +YACC +UNIFONT_BDF +INSTALL_PROGRAM +INSTALL_SCRIPT +INSTALL_DATA +AWK +SET_MAKE +RUBY +HELP2MAN +CC +CFLAGS +LDFLAGS +CPPFLAGS +ac_ct_CC +EXEEXT +OBJEXT +CPP +GREP +EGREP +LIBLZO enable_lzo -enable_mm_debug +TARGET_IMG_LDSCRIPT +TARGET_IMG_LDFLAGS +TARGET_OBJ2ELF +TARGET_CC +ac_ct_TARGET_CC +OBJCOPY +STRIP +NM +TARGET_CFLAGS +TARGET_CPPFLAGS +TARGET_LDFLAGS +LIBCURSES +LIBUSB enable_grub_emu enable_grub_emu_usb enable_grub_fstest enable_grub_pe2elf +FREETYPE enable_grub_mkfont -' +freetype_cflags +freetype_libs +LIBOBJS +LTLIBOBJS' +ac_subst_files='' ac_precious_vars='build_alias host_alias target_alias @@ -760,8 +726,6 @@ CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false -ac_unrecognized_opts= -ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null @@ -860,21 +824,13 @@ do datarootdir=$ac_optarg ;; -disable-* | --disable-*) - ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` + ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=no ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; @@ -887,21 +843,13 @@ do dvidir=$ac_optarg ;; -enable-* | --enable-*) - ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` + ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid feature name: $ac_useropt" >&2 + expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"enable_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval enable_$ac_useropt=\$ac_optarg ;; + ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` + eval enable_$ac_feature=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ @@ -1092,38 +1040,22 @@ do ac_init_version=: ;; -with-* | --with-*) - ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` + ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=\$ac_optarg ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=\$ac_optarg ;; -without-* | --without-*) - ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` + ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. - expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid package name: $ac_useropt" >&2 + expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && + { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } - ac_useropt_orig=$ac_useropt - ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` - case $ac_user_opts in - *" -"with_$ac_useropt" -"*) ;; - *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" - ac_unrecognized_sep=', ';; - esac - eval with_$ac_useropt=no ;; + ac_package=`echo $ac_package | sed 's/[-.]/_/g'` + eval with_$ac_package=no ;; --x) # Obsolete; use --with-x. @@ -1143,7 +1075,7 @@ do | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; - -*) { $as_echo "$as_me: error: unrecognized option: $ac_option + -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -1152,16 +1084,16 @@ Try \`$0 --help' for more information." >&2 ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { $as_echo "$as_me: error: invalid variable name: $ac_envvar" >&2 + { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. - $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 + echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 + echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} ;; @@ -1170,38 +1102,22 @@ done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { $as_echo "$as_me: error: missing argument to $ac_option" >&2 + { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi -if test -n "$ac_unrecognized_opts"; then - case $enable_option_checking in - no) ;; - fatal) { $as_echo "$as_me: error: unrecognized options: $ac_unrecognized_opts" >&2 - { (exit 1); exit 1; }; } ;; - *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; - esac -fi - -# Check all directory arguments for consistency. +# Be sure to have absolute directory names. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir do eval ac_val=\$$ac_var - # Remove trailing slashes. - case $ac_val in - */ ) - ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` - eval $ac_var=\$ac_val;; - esac - # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac - { $as_echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 + { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; } done @@ -1216,7 +1132,7 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. + echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes @@ -1232,10 +1148,10 @@ test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { $as_echo "$as_me: error: working directory cannot be determined" >&2 + { echo "$as_me: error: Working directory cannot be determined" >&2 { (exit 1); exit 1; }; } test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { $as_echo "$as_me: error: pwd does not report name of working directory" >&2 + { echo "$as_me: error: pwd does not report name of working directory" >&2 { (exit 1); exit 1; }; } @@ -1243,12 +1159,12 @@ test "X$ac_ls_di" = "X$ac_pwd_ls_di" || if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$as_myself" || -$as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_myself" : 'X\(//\)[^/]' \| \ - X"$as_myself" : 'X\(//\)$' \| \ - X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_myself" | + ac_confdir=`$as_dirname -- "$0" || +$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ + X"$0" : 'X\(//\)[^/]' \| \ + X"$0" : 'X\(//\)$' \| \ + X"$0" : 'X\(/\)' \| . 2>/dev/null || +echo X"$0" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -1275,12 +1191,12 @@ else fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { $as_echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 + { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 { (exit 1); exit 1; }; } fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { $as_echo "$as_me: error: $ac_msg" >&2 + cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 { (exit 1); exit 1; }; } pwd)` # When building in place, set srcdir=. @@ -1329,9 +1245,9 @@ Configuration: Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] + [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] + [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify @@ -1341,25 +1257,25 @@ for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/grub] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] + --bindir=DIR user executables [EPREFIX/bin] + --sbindir=DIR system admin executables [EPREFIX/sbin] + --libexecdir=DIR program executables [EPREFIX/libexec] + --sysconfdir=DIR read-only single-machine data [PREFIX/etc] + --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] + --localstatedir=DIR modifiable single-machine data [PREFIX/var] + --libdir=DIR object code libraries [EPREFIX/lib] + --includedir=DIR C header files [PREFIX/include] + --oldincludedir=DIR C header files for non-gcc [/usr/include] + --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] + --datadir=DIR read-only architecture-independent data [DATAROOTDIR] + --infodir=DIR info documentation [DATAROOTDIR/info] + --localedir=DIR locale-dependent data [DATAROOTDIR/locale] + --mandir=DIR man documentation [DATAROOTDIR/man] + --docdir=DIR documentation root [DATAROOTDIR/doc/grub] + --htmldir=DIR html documentation [DOCDIR] + --dvidir=DIR dvi documentation [DOCDIR] + --pdfdir=DIR pdf documentation [DOCDIR] + --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF @@ -1383,7 +1299,6 @@ if test -n "$ac_init_help"; then cat <<\_ACEOF Optional Features: - --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --disable-largefile omit support for large files @@ -1425,17 +1340,15 @@ fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || - { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || - continue + test -d "$ac_dir" || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -1471,7 +1384,7 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix echo && $SHELL "$ac_srcdir/configure" --help=recursive else - $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 + echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done @@ -1481,10 +1394,10 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF GRUB configure 1.96 -generated by GNU Autoconf 2.63 +generated by GNU Autoconf 2.61 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1495,7 +1408,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was $ $0 $@ @@ -1531,7 +1444,7 @@ for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. - $as_echo "PATH: $as_dir" + echo "PATH: $as_dir" done IFS=$as_save_IFS @@ -1566,7 +1479,7 @@ do | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) - ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; + ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; @@ -1618,12 +1531,11 @@ _ASBOX case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -1653,9 +1565,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo @@ -1670,9 +1582,9 @@ _ASBOX do eval ac_val=\$$ac_var case $ac_val in - *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; + *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac - $as_echo "$ac_var='\''$ac_val'\''" + echo "$ac_var='\''$ac_val'\''" done | sort echo fi @@ -1688,8 +1600,8 @@ _ASBOX echo fi test "$ac_signal" != 0 && - $as_echo "$as_me: caught signal $ac_signal" - $as_echo "$as_me: exit $exit_status" + echo "$as_me: caught signal $ac_signal" + echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && @@ -1731,24 +1643,21 @@ _ACEOF # Let the site file select an alternate cache file if it wants to. -# Prefer an explicitly selected file to automatically selected ones. -ac_site_file1=NONE -ac_site_file2=NONE +# Prefer explicitly selected file to automatically selected ones. if test -n "$CONFIG_SITE"; then - ac_site_file1=$CONFIG_SITE + set x "$CONFIG_SITE" elif test "x$prefix" != xNONE; then - ac_site_file1=$prefix/share/config.site - ac_site_file2=$prefix/etc/config.site + set x "$prefix/share/config.site" "$prefix/etc/config.site" else - ac_site_file1=$ac_default_prefix/share/config.site - ac_site_file2=$ac_default_prefix/etc/config.site + set x "$ac_default_prefix/share/config.site" \ + "$ac_default_prefix/etc/config.site" fi -for ac_site_file in "$ac_site_file1" "$ac_site_file2" +shift +for ac_site_file do - test "x$ac_site_file" = xNONE && continue if test -r "$ac_site_file"; then - { $as_echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -$as_echo "$as_me: loading site script $ac_site_file" >&6;} + { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" fi @@ -1758,16 +1667,16 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { $as_echo "$as_me:$LINENO: loading cache $cache_file" >&5 -$as_echo "$as_me: loading cache $cache_file" >&6;} + { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else - { $as_echo "$as_me:$LINENO: creating cache $cache_file" >&5 -$as_echo "$as_me: creating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1781,38 +1690,29 @@ for ac_var in $ac_precious_vars; do eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { $as_echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -$as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - # differences in whitespace do not lead to failure. - ac_old_val_w=`echo x $ac_old_val` - ac_new_val_w=`echo x $ac_new_val` - if test "$ac_old_val_w" != "$ac_new_val_w"; then - { $as_echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -$as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - ac_cache_corrupted=: - else - { $as_echo "$as_me:$LINENO: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 -$as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} - eval $ac_var=\$ac_old_val - fi - { $as_echo "$as_me:$LINENO: former value: \`$ac_old_val'" >&5 -$as_echo "$as_me: former value: \`$ac_old_val'" >&2;} - { $as_echo "$as_me:$LINENO: current value: \`$ac_new_val'" >&5 -$as_echo "$as_me: current value: \`$ac_new_val'" >&2;} + { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} + { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +echo "$as_me: former value: $ac_old_val" >&2;} + { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +echo "$as_me: current value: $ac_new_val" >&2;} + ac_cache_corrupted=: fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in - *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; + *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in @@ -1822,12 +1722,10 @@ $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi done if $ac_cache_corrupted; then - { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} - { $as_echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -$as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { $as_echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -$as_echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} + { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +echo "$as_me: error: changes in the environment can compromise the build" >&2;} + { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1885,8 +1783,8 @@ for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do fi done if test -z "$ac_aux_dir"; then - { { $as_echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -$as_echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} + { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 +echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} { (exit 1); exit 1; }; } fi @@ -1901,34 +1799,34 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { $as_echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -$as_echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} + { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 +echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} { (exit 1); exit 1; }; } -{ $as_echo "$as_me:$LINENO: checking build system type" >&5 -$as_echo_n "checking build system type... " >&6; } +{ echo "$as_me:$LINENO: checking build system type" >&5 +echo $ECHO_N "checking build system type... $ECHO_C" >&6; } if test "${ac_cv_build+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && - { { $as_echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -$as_echo "$as_me: error: cannot guess build type; you must specify one" >&2;} + { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 +echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -$as_echo "$ac_cv_build" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 +echo "${ECHO_T}$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -$as_echo "$as_me: error: invalid value of canonical build" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 +echo "$as_me: error: invalid value of canonical build" >&2;} { (exit 1); exit 1; }; };; esac build=$ac_cv_build @@ -1945,27 +1843,27 @@ IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking host system type" >&5 -$as_echo_n "checking host system type... " >&6; } +{ echo "$as_me:$LINENO: checking host system type" >&5 +echo $ECHO_N "checking host system type... $ECHO_C" >&6; } if test "${ac_cv_host+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -$as_echo "$ac_cv_host" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 +echo "${ECHO_T}$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -$as_echo "$as_me: error: invalid value of canonical host" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 +echo "$as_me: error: invalid value of canonical host" >&2;} { (exit 1); exit 1; }; };; esac host=$ac_cv_host @@ -1982,27 +1880,27 @@ IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac -{ $as_echo "$as_me:$LINENO: checking target system type" >&5 -$as_echo_n "checking target system type... " >&6; } +{ echo "$as_me:$LINENO: checking target system type" >&5 +echo $ECHO_N "checking target system type... $ECHO_C" >&6; } if test "${ac_cv_target+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "x$target_alias" = x; then ac_cv_target=$ac_cv_host else ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { $as_echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -$as_echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} + { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 +echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} { (exit 1); exit 1; }; } fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -$as_echo "$ac_cv_target" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 +echo "${ECHO_T}$ac_cv_target" >&6; } case $ac_cv_target in *-*-*) ;; -*) { { $as_echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -$as_echo "$as_me: error: invalid value of canonical target" >&2;} +*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 +echo "$as_me: error: invalid value of canonical target" >&2;} { (exit 1); exit 1; }; };; esac target=$ac_cv_target @@ -2032,10 +1930,13 @@ test "$program_prefix" != NONE && # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. +# Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. -ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' -program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` +cat <<\_ACEOF >conftest.sed +s/[\\$]/&&/g;s/;s,x,x,$// +_ACEOF +program_transform_name=`echo $program_transform_name | sed -f conftest.sed` +rm -f conftest.sed case "$host_cpu" in @@ -2064,8 +1965,8 @@ if test "x$with_platform" = x; then powerpc-*) platform=ieee1275 ;; powerpc64-*) platform=ieee1275 ;; sparc64-*) platform=ieee1275 ;; - *) { { $as_echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 -$as_echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} + *) { { echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 +echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac else @@ -2091,8 +1992,8 @@ case "$target_cpu"-"$platform" in i386-ieee1275) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; - *) { { $as_echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 -$as_echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} + *) { { echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 +echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} { (exit 1); exit 1; }; } ;; esac @@ -2132,10 +2033,10 @@ for ac_prog in cmp do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CMP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CMP"; then ac_cv_prog_CMP="$CMP" # Let the user override the test. @@ -2148,7 +2049,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CMP="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2159,11 +2060,11 @@ fi fi CMP=$ac_cv_prog_CMP if test -n "$CMP"; then - { $as_echo "$as_me:$LINENO: result: $CMP" >&5 -$as_echo "$CMP" >&6; } + { echo "$as_me:$LINENO: result: $CMP" >&5 +echo "${ECHO_T}$CMP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2171,8 +2072,8 @@ fi done if test "x$CMP" = x; then - { { $as_echo "$as_me:$LINENO: error: cmp is not found" >&5 -$as_echo "$as_me: error: cmp is not found" >&2;} + { { echo "$as_me:$LINENO: error: cmp is not found" >&5 +echo "$as_me: error: cmp is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2180,10 +2081,10 @@ for ac_prog in bison do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_YACC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$YACC"; then ac_cv_prog_YACC="$YACC" # Let the user override the test. @@ -2196,7 +2097,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_YACC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2207,11 +2108,11 @@ fi fi YACC=$ac_cv_prog_YACC if test -n "$YACC"; then - { $as_echo "$as_me:$LINENO: result: $YACC" >&5 -$as_echo "$YACC" >&6; } + { echo "$as_me:$LINENO: result: $YACC" >&5 +echo "${ECHO_T}$YACC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2219,8 +2120,8 @@ fi done if test "x$YACC" = x; then - { { $as_echo "$as_me:$LINENO: error: bison is not found" >&5 -$as_echo "$as_me: error: bison is not found" >&2;} + { { echo "$as_me:$LINENO: error: bison is not found" >&5 +echo "$as_me: error: bison is not found" >&2;} { (exit 1); exit 1; }; } fi @@ -2245,12 +2146,11 @@ done # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. -# Reject install programs that cannot install multiple files. -{ $as_echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -$as_echo_n "checking for a BSD-compatible install... " >&6; } +{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 +echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH @@ -2279,29 +2179,17 @@ case $as_dir/ in # program-specific install script used by HP pwplus--don't use. : else - rm -rf conftest.one conftest.two conftest.dir - echo one > conftest.one - echo two > conftest.two - mkdir conftest.dir - if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && - test -s conftest.one && test -s conftest.two && - test -s conftest.dir/conftest.one && - test -s conftest.dir/conftest.two - then - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi + ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" + break 3 fi fi done done ;; esac - done IFS=$as_save_IFS -rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then @@ -2314,8 +2202,8 @@ fi INSTALL=$ac_install_sh fi fi -{ $as_echo "$as_me:$LINENO: result: $INSTALL" >&5 -$as_echo "$INSTALL" >&6; } +{ echo "$as_me:$LINENO: result: $INSTALL" >&5 +echo "${ECHO_T}$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. @@ -2329,10 +2217,10 @@ for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_AWK+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. @@ -2345,7 +2233,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_AWK="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2356,23 +2244,22 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - { $as_echo "$as_me:$LINENO: result: $AWK" >&5 -$as_echo "$AWK" >&6; } + { echo "$as_me:$LINENO: result: $AWK" >&5 +echo "${ECHO_T}$AWK" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi test -n "$AWK" && break done -{ $as_echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -$as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } -set x ${MAKE-make} -ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` +{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 +echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } +set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh @@ -2389,12 +2276,12 @@ esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } SET_MAKE= else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi @@ -2402,10 +2289,10 @@ fi # These are not a "must". # Extract the first word of "ruby", so it can be a program name with args. set dummy ruby; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_RUBY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $RUBY in [\\/]* | ?:[\\/]*) @@ -2420,7 +2307,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2432,20 +2319,20 @@ esac fi RUBY=$ac_cv_path_RUBY if test -n "$RUBY"; then - { $as_echo "$as_me:$LINENO: result: $RUBY" >&5 -$as_echo "$RUBY" >&6; } + { echo "$as_me:$LINENO: result: $RUBY" >&5 +echo "${ECHO_T}$RUBY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Extract the first word of "help2man", so it can be a program name with args. set dummy help2man; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_path_HELP2MAN+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else case $HELP2MAN in [\\/]* | ?:[\\/]*) @@ -2460,7 +2347,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2472,11 +2359,11 @@ esac fi HELP2MAN=$ac_cv_path_HELP2MAN if test -n "$HELP2MAN"; then - { $as_echo "$as_me:$LINENO: result: $HELP2MAN" >&5 -$as_echo "$HELP2MAN" >&6; } + { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 +echo "${ECHO_T}$HELP2MAN" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2493,10 +2380,10 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2509,7 +2396,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2520,11 +2407,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2533,10 +2420,10 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2549,7 +2436,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="gcc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2560,11 +2447,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_CC" = x; then @@ -2572,8 +2459,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2586,10 +2477,10 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2602,7 +2493,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="${ac_tool_prefix}cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2613,11 +2504,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2626,10 +2517,10 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2647,7 +2538,7 @@ do continue fi ac_cv_prog_CC="cc" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2670,11 +2561,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2685,10 +2576,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. @@ -2701,7 +2592,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2712,11 +2603,11 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - { $as_echo "$as_me:$LINENO: result: $CC" >&5 -$as_echo "$CC" >&6; } + { echo "$as_me:$LINENO: result: $CC" >&5 +echo "${ECHO_T}$CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2729,10 +2620,10 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. @@ -2745,7 +2636,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -2756,11 +2647,11 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -$as_echo "$ac_ct_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +echo "${ECHO_T}$ac_ct_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -2772,8 +2663,12 @@ done else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC @@ -2783,50 +2678,44 @@ fi fi -test -z "$CC" && { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&5 -$as_echo "$as_me: error: no acceptable C compiler found in \$PATH +echo "$as_me: error: no acceptable C compiler found in \$PATH See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } # Provide some information about the compiler. -$as_echo "$as_me:$LINENO: checking for C compiler version" >&5 -set X $ac_compile -ac_compiler=$2 +echo "$as_me:$LINENO: checking for C compiler version" >&5 +ac_compiler=`set X $ac_compile; echo $2` { (ac_try="$ac_compiler --version >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler --version >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -v >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -v >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } { (ac_try="$ac_compiler -V >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compiler -V >&5") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF @@ -2845,22 +2734,27 @@ main () } _ACEOF ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" +ac_clean_files="$ac_clean_files a.out a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -{ $as_echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -$as_echo_n "checking for C compiler default output file name... " >&6; } -ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` - -# The possible output files: -ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" - +{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } +ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +# +# List of possible output files, starting from the most likely. +# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) +# only as a last resort. b.out is created by i960 compilers. +ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' +# +# The IRIX 6 linker writes into existing files which may not be +# executable, retaining their permissions. Remove them first so a +# subsequent execution test works. ac_rmfiles= for ac_file in $ac_files do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done @@ -2871,11 +2765,10 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link_default") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' @@ -2886,7 +2779,7 @@ for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most @@ -2913,27 +2806,25 @@ else ac_file='' fi -{ $as_echo "$as_me:$LINENO: result: $ac_file" >&5 -$as_echo "$ac_file" >&6; } +{ echo "$as_me:$LINENO: result: $ac_file" >&5 +echo "${ECHO_T}$ac_file" >&6; } if test -z "$ac_file"; then - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C compiler cannot create executables +{ { echo "$as_me:$LINENO: error: C compiler cannot create executables See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C compiler cannot create executables +echo "$as_me: error: C compiler cannot create executables See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -$as_echo_n "checking whether the C compiler works... " >&6; } +{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then @@ -2942,53 +2833,49 @@ if test "$cross_compiling" != yes; then *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot run C compiled programs. + { { echo "$as_me:$LINENO: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot run C compiled programs. +echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi fi fi -{ $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } +{ echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } -rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out +rm -f a.out a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -{ $as_echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -$as_echo_n "checking whether we are cross compiling... " >&6; } -{ $as_echo "$as_me:$LINENO: result: $cross_compiling" >&5 -$as_echo "$cross_compiling" >&6; } +{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } +{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 +echo "${ECHO_T}$cross_compiling" >&6; } -{ $as_echo "$as_me:$LINENO: checking for suffix of executables" >&5 -$as_echo_n "checking for suffix of executables... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 +echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } if { (ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -2997,33 +2884,31 @@ $as_echo "$ac_try_echo") >&5 for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link + { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +echo "$as_me: error: cannot compute suffix of executables: cannot compile and link See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -{ $as_echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -$as_echo "$ac_cv_exeext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +echo "${ECHO_T}$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -{ $as_echo "$as_me:$LINENO: checking for suffix of object files" >&5 -$as_echo_n "checking for suffix of object files... " >&6; } +{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 +echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } if test "${ac_cv_objext+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3046,43 +2931,40 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -{ { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute suffix of object files: cannot compile +echo "$as_me: error: cannot compute suffix of object files: cannot compile See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -$as_echo "$ac_cv_objext" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +echo "${ECHO_T}$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -{ $as_echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -$as_echo_n "checking whether we are using the GNU C compiler... " >&6; } +{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } if test "${ac_cv_c_compiler_gnu+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3108,21 +2990,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_compiler_gnu=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_compiler_gnu=no @@ -3132,19 +3013,15 @@ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -$as_echo "$ac_cv_c_compiler_gnu" >&6; } -if test $ac_compiler_gnu = yes; then - GCC=yes -else - GCC= -fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } +GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS -{ $as_echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -$as_echo_n "checking whether $CC accepts -g... " >&6; } +{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_g+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes @@ -3171,21 +3048,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 CFLAGS="" @@ -3210,21 +3086,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_c_werror_flag=$ac_save_c_werror_flag @@ -3250,21 +3125,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_g=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3279,8 +3153,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -$as_echo "$ac_cv_prog_cc_g" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then @@ -3296,10 +3170,10 @@ else CFLAGS= fi fi -{ $as_echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -$as_echo_n "checking for $CC option to accept ISO C89... " >&6; } +{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 +echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } if test "${ac_cv_prog_cc_c89+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC @@ -3370,21 +3244,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_prog_cc_c89=$ac_arg else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -3400,15 +3273,15 @@ fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) - { $as_echo "$as_me:$LINENO: result: none needed" >&5 -$as_echo "none needed" >&6; } ;; + { echo "$as_me:$LINENO: result: none needed" >&5 +echo "${ECHO_T}none needed" >&6; } ;; xno) - { $as_echo "$as_me:$LINENO: result: unsupported" >&5 -$as_echo "unsupported" >&6; } ;; + { echo "$as_me:$LINENO: result: unsupported" >&5 +echo "${ECHO_T}unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" - { $as_echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -$as_echo "$ac_cv_prog_cc_c89" >&6; } ;; + { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 +echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; esac @@ -3419,25 +3292,383 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu # Must be GCC. -test "x$GCC" = xyes || { { $as_echo "$as_me:$LINENO: error: GCC is required" >&5 -$as_echo "$as_me: error: GCC is required" >&2;} +test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5 +echo "$as_me: error: GCC is required" >&2;} { (exit 1); exit 1; }; } +cat >>confdefs.h <<\_ACEOF +#define _GNU_SOURCE 1 +_ACEOF + + + +# Check whether --enable-largefile was given. +if test "${enable_largefile+set}" = set; then + enableval=$enable_largefile; +fi + +if test "$enable_largefile" != no; then + + { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 +echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_largefile_CC+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_cv_sys_largefile_CC=no + if test "$GCC" != yes; then + ac_save_CC=$CC + while :; do + # IRIX 6.2 and later do not support large files by default, + # so use the C compiler's -n32 option if that helps. + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + CC="$CC -n32" + rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_largefile_CC=' -n32'; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext + break + done + CC=$ac_save_CC + rm -f conftest.$ac_ext + fi +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 +echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } + if test "$ac_cv_sys_largefile_CC" != no; then + CC=$CC$ac_cv_sys_largefile_CC + fi + + { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 +echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_file_offset_bits+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _FILE_OFFSET_BITS 64 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_file_offset_bits=64; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_file_offset_bits=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 +echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } +case $ac_cv_sys_file_offset_bits in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits +_ACEOF +;; +esac +rm -f conftest* + if test $ac_cv_sys_file_offset_bits = unknown; then + { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 +echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } +if test "${ac_cv_sys_large_files+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + while :; do + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=no; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#define _LARGE_FILES 1 +#include + /* Check that off_t can represent 2**63 - 1 correctly. + We can't simply define LARGE_OFF_T to be 9223372036854775807, + since some C++ compilers masquerading as C compilers + incorrectly reject 9223372036854775807. */ +#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) + int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 + && LARGE_OFF_T % 2147483647 == 1) + ? 1 : -1]; +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_sys_large_files=1; break +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + ac_cv_sys_large_files=unknown + break +done +fi +{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 +echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } +case $ac_cv_sys_large_files in #( + no | unknown) ;; + *) +cat >>confdefs.h <<_ACEOF +#define _LARGE_FILES $ac_cv_sys_large_files +_ACEOF +;; +esac +rm -f conftest* + fi +fi + + +# Identify characteristics of the host architecture. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -$as_echo_n "checking how to run the C preprocessor... " >&6; } +{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" @@ -3469,21 +3700,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3507,14 +3737,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3522,7 +3751,7 @@ $as_echo "$ac_try_echo") >&5 # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3547,8 +3776,8 @@ fi else ac_cv_prog_CPP=$CPP fi -{ $as_echo "$as_me:$LINENO: result: $CPP" >&5 -$as_echo "$CPP" >&6; } +{ echo "$as_me:$LINENO: result: $CPP" >&5 +echo "${ECHO_T}$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do @@ -3576,21 +3805,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Broken: fails on valid input. @@ -3614,14 +3842,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err @@ -3629,7 +3856,7 @@ $as_echo "$ac_try_echo") >&5 # Broken: success on invalid input. continue else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 # Passes both tests. @@ -3645,13 +3872,11 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check + { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&5 -$as_echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; }; } + { (exit 1); exit 1; }; } fi ac_ext=c @@ -3661,37 +3886,42 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ $as_echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -$as_echo_n "checking for grep that handles long lines and -e... " >&6; } +{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 +echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } if test "${ac_cv_path_GREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + # Extract the first word of "grep ggrep" to use in msg output +if test -z "$GREP"; then +set dummy grep ggrep; ac_prog_name=$2 +if test "${ac_cv_path_GREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 else - if test -z "$GREP"; then ac_path_GREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue -# Check for GNU ac_path_GREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'GREP' >> "conftest.nl" + echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3706,60 +3936,74 @@ case `"$ac_path_GREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_GREP_found && break 3 - done + + $ac_path_GREP_found && break 3 done done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_GREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + + +fi + +GREP="$ac_cv_path_GREP" +if test -z "$GREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } - fi +fi + else ac_cv_path_GREP=$GREP fi + fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -$as_echo "$ac_cv_path_GREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 +echo "${ECHO_T}$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" -{ $as_echo "$as_me:$LINENO: checking for egrep" >&5 -$as_echo_n "checking for egrep... " >&6; } +{ echo "$as_me:$LINENO: checking for egrep" >&5 +echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } if test "${ac_cv_path_EGREP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else - if test -z "$EGREP"; then + # Extract the first word of "egrep" to use in msg output +if test -z "$EGREP"; then +set dummy egrep; ac_prog_name=$2 +if test "${ac_cv_path_EGREP+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else ac_path_EGREP_found=false - # Loop through the user's path and test for each of PROGNAME-LIST - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +# Loop through the user's path and test for each of PROGNAME-LIST +as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue -# Check for GNU ac_path_EGREP and select it if it is found. + for ac_exec_ext in '' $ac_executable_extensions; do + ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" + { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 - $as_echo_n 0123456789 >"conftest.in" + echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" - $as_echo 'EGREP' >> "conftest.nl" + echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break ac_count=`expr $ac_count + 1` @@ -3774,31 +4018,40 @@ case `"$ac_path_EGREP" --version 2>&1` in rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac - $ac_path_EGREP_found && break 3 - done + + $ac_path_EGREP_found && break 3 done done + +done IFS=$as_save_IFS - if test -z "$ac_cv_path_EGREP"; then - { { $as_echo "$as_me:$LINENO: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -$as_echo "$as_me: error: no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} + + +fi + +EGREP="$ac_cv_path_EGREP" +if test -z "$EGREP"; then + { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 +echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} { (exit 1); exit 1; }; } - fi +fi + else ac_cv_path_EGREP=$EGREP fi + fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -$as_echo "$ac_cv_path_EGREP" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 +echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" -{ $as_echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -$as_echo_n "checking for ANSI C header files... " >&6; } +{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } if test "${ac_cv_header_stdc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -3825,21 +4078,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_header_stdc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_header_stdc=no @@ -3931,40 +4183,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_header_stdc=no fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -$as_echo "$ac_cv_header_stdc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +echo "${ECHO_T}$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then cat >>confdefs.h <<\_ACEOF @@ -3986,11 +4235,11 @@ fi for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -4008,21 +4257,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then eval "$as_ac_Header=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_Header=no" @@ -4030,15 +4278,12 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -4046,670 +4291,28 @@ fi done - - if test "${ac_cv_header_minix_config_h+set}" = set; then - { $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } -else - # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking minix/config.h usability" >&5 -$as_echo_n "checking minix/config.h usability... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } - -# Is the header present? -{ $as_echo "$as_me:$LINENO: checking minix/config.h presence" >&5 -$as_echo_n "checking minix/config.h presence... " >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: minix/config.h: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: minix/config.h: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: minix/config.h: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: minix/config.h: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: minix/config.h: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: minix/config.h: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: minix/config.h: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: minix/config.h: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to bug-grub@gnu.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ $as_echo "$as_me:$LINENO: checking for minix/config.h" >&5 -$as_echo_n "checking for minix/config.h... " >&6; } -if test "${ac_cv_header_minix_config_h+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_header_minix_config_h=$ac_header_preproc -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_header_minix_config_h" >&5 -$as_echo "$ac_cv_header_minix_config_h" >&6; } - -fi -if test "x$ac_cv_header_minix_config_h" = x""yes; then - MINIX=yes -else - MINIX= -fi - - - if test "$MINIX" = yes; then - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_SOURCE 1 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _POSIX_1_SOURCE 2 -_ACEOF - - -cat >>confdefs.h <<\_ACEOF -#define _MINIX 1 -_ACEOF - - fi - - - - { $as_echo "$as_me:$LINENO: checking whether it is safe to define __EXTENSIONS__" >&5 -$as_echo_n "checking whether it is safe to define __EXTENSIONS__... " >&6; } -if test "${ac_cv_safe_to_define___extensions__+set}" = set; then - $as_echo_n "(cached) " >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -# define __EXTENSIONS__ 1 - $ac_includes_default -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_safe_to_define___extensions__=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_safe_to_define___extensions__=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_safe_to_define___extensions__" >&5 -$as_echo "$ac_cv_safe_to_define___extensions__" >&6; } - test $ac_cv_safe_to_define___extensions__ = yes && - cat >>confdefs.h <<\_ACEOF -#define __EXTENSIONS__ 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _ALL_SOURCE 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _POSIX_PTHREAD_SEMANTICS 1 -_ACEOF - - cat >>confdefs.h <<\_ACEOF -#define _TANDEM_SOURCE 1 -_ACEOF - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { $as_echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -$as_echo_n "checking for special C compiler options needed for large files... " >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then - $as_echo_n "(cached) " >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -$as_echo "$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { $as_echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -$as_echo_n "checking for _FILE_OFFSET_BITS value needed for large files... " >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -$as_echo "$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -rf conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { $as_echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -$as_echo_n "checking for _LARGE_FILES value needed for large files... " >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then - $as_echo_n "(cached) " >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=1; break -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -$as_echo "$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -rf conftest* - fi -fi - - -# Identify characteristics of the host architecture. - - { $as_echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -$as_echo_n "checking whether byte ordering is bigendian... " >&6; } +{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 +echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } if test "${ac_cv_c_bigendian+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else - ac_cv_c_bigendian=unknown - # See if we're dealing with a universal compiler. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifndef __APPLE_CC__ - not a universal capable compiler - #endif - typedef int dummy; - -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - - # Check for potential -arch flags. It is not universal unless - # there are some -arch flags. Note that *ppc* also matches - # ppc64. This check is also rather less than ideal. - case "${CC} ${CFLAGS} ${CPPFLAGS} ${LDFLAGS}" in #( - *-arch*ppc*|*-arch*i386*|*-arch*x86_64*) ac_cv_c_bigendian=universal;; - esac -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - if test $ac_cv_c_bigendian = unknown; then - # See if sys/param.h defines the BYTE_ORDER macro. - cat >conftest.$ac_ext <<_ACEOF + # See if sys/param.h defines the BYTE_ORDER macro. +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN \ - && defined LITTLE_ENDIAN && BYTE_ORDER && BIG_ENDIAN \ - && LITTLE_ENDIAN) - bogus endian macros - #endif +#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ + && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) + bogus endian macros +#endif ; return 0; @@ -4721,34 +4324,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then # It does; now see whether it defined to BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF +cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ #include - #include +#include int main () { #if BYTE_ORDER != BIG_ENDIAN - not big endian - #endif + not big endian +#endif ; return 0; @@ -4760,21 +4362,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_cv_c_bigendian=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_c_bigendian=no @@ -4782,31 +4383,29 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # See if defines _LITTLE_ENDIAN or _BIG_ENDIAN (e.g., Solaris). - cat >conftest.$ac_ext <<_ACEOF + # It does not; compile a test program. +if test "$cross_compiling" = yes; then + # try to guess the endianness by grepping values into an object file + ac_cv_c_bigendian=unknown + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ -#include - +short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; +short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; +void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } +short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; +short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; +void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } int main () { -#if ! (defined _LITTLE_ENDIAN || defined _BIG_ENDIAN) - bogus endian macros - #endif - + _ascii (); _ebcdic (); ; return 0; } @@ -4817,139 +4416,30 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to _BIG_ENDIAN or not. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -int -main () -{ -#ifndef _BIG_ENDIAN - not big endian - #endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then + if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then ac_cv_c_bigendian=yes -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - $as_echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - +if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then + if test "$ac_cv_c_bigendian" = unknown; then + ac_cv_c_bigendian=no + else + # finding both strings is unlikely to happen, but who knows? + ac_cv_c_bigendian=unknown + fi fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - fi - if test $ac_cv_c_bigendian = unknown; then - # Compile a test program. - if test "$cross_compiling" = yes; then - # Try to guess by grepping values from an object file. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = - { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; - short int ascii_ii[] = - { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; - int use_ascii (int i) { - return ascii_mm[i] + ascii_ii[i]; - } - short int ebcdic_ii[] = - { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; - short int ebcdic_mm[] = - { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; - int use_ebcdic (int i) { - return ebcdic_mm[i] + ebcdic_ii[i]; - } - extern int foo; - -int -main () -{ -return use_ascii (foo) == use_ebcdic (foo); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null; then - ac_cv_c_bigendian=yes - fi - if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi - fi else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 @@ -4968,14 +4458,14 @@ int main () { - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; + /* Are we little or big endian? From Harbison&Steele. */ + union + { + long int l; + char c[sizeof (long int)]; + } u; + u.l = 1; + return u.c[sizeof (long int) - 1] == 1; ; return 0; @@ -4987,71 +4477,118 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_bigendian=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) ac_cv_c_bigendian=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi - fi fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -$as_echo "$ac_cv_c_bigendian" >&6; } - case $ac_cv_c_bigendian in #( - yes) - cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF -;; #( - no) - ;; #( - universal) + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 +echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } +case $ac_cv_c_bigendian in + yes) cat >>confdefs.h <<\_ACEOF -#define AC_APPLE_UNIVERSAL_BUILD 1 +#define WORDS_BIGENDIAN 1 _ACEOF - - ;; #( - *) - { { $as_echo "$as_me:$LINENO: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -$as_echo "$as_me: error: unknown endianness - presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} + ;; + no) + ;; + *) + { { echo "$as_me:$LINENO: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&5 +echo "$as_me: error: unknown endianness +presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} { (exit 1); exit 1; }; } ;; - esac +esac + +{ echo "$as_me:$LINENO: checking for void *" >&5 +echo $ECHO_N "checking for void *... $ECHO_C" >&6; } +if test "${ac_cv_type_void_p+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef void * ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_void_p=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_void_p=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 +echo "${ECHO_T}$ac_cv_type_void_p" >&6; } # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of void *" >&5 -$as_echo_n "checking size of void *... " >&6; } +{ echo "$as_me:$LINENO: checking size of void *" >&5 +echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } if test "${ac_cv_sizeof_void_p+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -5062,10 +4599,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5078,14 +4616,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5099,10 +4636,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5115,21 +4653,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -5143,7 +4680,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -5153,10 +4690,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5169,14 +4707,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5190,10 +4727,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5206,21 +4744,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -5234,7 +4771,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -5254,10 +4791,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef void * ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (void *))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5270,21 +4808,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -5295,13 +4832,11 @@ done case $ac_lo in ?*) ac_cv_sizeof_void_p=$ac_lo;; '') if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi ;; @@ -5314,8 +4849,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (void *)); } -static unsigned long int ulongval () { return (long int) (sizeof (void *)); } + typedef void * ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5325,22 +4861,20 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (void *))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (void *)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (void *)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -5353,48 +4887,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_void_p=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_void_p" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (void *) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (void *) +echo "$as_me: error: cannot compute sizeof (void *) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_void_p=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -$as_echo "$ac_cv_sizeof_void_p" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 +echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } @@ -5403,14 +4932,68 @@ cat >>confdefs.h <<_ACEOF _ACEOF +{ echo "$as_me:$LINENO: checking for long" >&5 +echo $ECHO_N "checking for long... $ECHO_C" >&6; } +if test "${ac_cv_type_long+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +$ac_includes_default +typedef long ac__type_new_; +int +main () +{ +if ((ac__type_new_ *) 0) + return 0; +if (sizeof (ac__type_new_)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + ac_cv_type_long=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_type_long=no +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 +echo "${ECHO_T}$ac_cv_type_long" >&6; } + # The cast to long int works around a bug in the HP C Compiler # version HP92453-01 B.11.11.23709.GP, which incorrectly rejects # declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. # This bug is HP SR number 8606223364. -{ $as_echo "$as_me:$LINENO: checking size of long" >&5 -$as_echo_n "checking size of long... " >&6; } +{ echo "$as_me:$LINENO: checking size of long" >&5 +echo $ECHO_N "checking size of long... $ECHO_C" >&6; } if test "${ac_cv_sizeof_long+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. @@ -5421,10 +5004,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; test_array [0] = 0 ; @@ -5437,14 +5021,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5458,10 +5041,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5474,21 +5058,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr $ac_mid + 1` @@ -5502,7 +5085,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF @@ -5512,10 +5095,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) < 0)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; test_array [0] = 0 ; @@ -5528,14 +5112,13 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err @@ -5549,10 +5132,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) >= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; test_array [0] = 0 ; @@ -5565,21 +5149,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_lo=$ac_mid; break else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_hi=`expr '(' $ac_mid ')' - 1` @@ -5593,7 +5176,7 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext done else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo= ac_hi= @@ -5613,10 +5196,11 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default + typedef long ac__type_sizeof_; int main () { -static int test_array [1 - 2 * !(((long int) (sizeof (long))) <= $ac_mid)]; +static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; test_array [0] = 0 ; @@ -5629,21 +5213,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_hi=$ac_mid else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_lo=`expr '(' $ac_mid ')' + 1` @@ -5654,13 +5237,11 @@ done case $ac_lo in ?*) ac_cv_sizeof_long=$ac_lo;; '') if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi ;; @@ -5673,8 +5254,9 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ $ac_includes_default -static long int longval () { return (long int) (sizeof (long)); } -static unsigned long int ulongval () { return (long int) (sizeof (long)); } + typedef long ac__type_sizeof_; +static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } +static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } #include #include int @@ -5684,22 +5266,20 @@ main () FILE *f = fopen ("conftest.val", "w"); if (! f) return 1; - if (((long int) (sizeof (long))) < 0) + if (((long int) (sizeof (ac__type_sizeof_))) < 0) { long int i = longval (); - if (i != ((long int) (sizeof (long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%ld", i); + fprintf (f, "%ld\n", i); } else { unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (long)))) + if (i != ((long int) (sizeof (ac__type_sizeof_)))) return 1; - fprintf (f, "%lu", i); + fprintf (f, "%lu\n", i); } - /* Do not output a trailing newline, as this causes \r\n confusion - on some platforms. */ return ferror (f) || fclose (f) != 0; ; @@ -5712,48 +5292,43 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_long=`cat conftest.val` else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) if test "$ac_cv_type_long" = yes; then - { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5 -$as_echo "$as_me: error: in \`$ac_pwd':" >&2;} -{ { $as_echo "$as_me:$LINENO: error: cannot compute sizeof (long) + { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) See \`config.log' for more details." >&5 -$as_echo "$as_me: error: cannot compute sizeof (long) +echo "$as_me: error: cannot compute sizeof (long) See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; }; } + { (exit 77); exit 77; }; } else ac_cv_sizeof_long=0 fi fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.val fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -$as_echo "$ac_cv_sizeof_long" >&6; } +{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 +echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } @@ -5784,10 +5359,10 @@ cat >>confdefs.h <<\_ACEOF #define ENABLE_LZO 1 _ACEOF - { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -$as_echo_n "checking for __lzo_init_v2 in -llzo2... " >&6; } + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo2 $LIBS" @@ -5819,43 +5394,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo2___lzo_init_v2=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo2___lzo_init_v2=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -$as_echo "$ac_cv_lib_lzo2___lzo_init_v2" >&6; } -if test "x$ac_cv_lib_lzo2___lzo_init_v2" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } +if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then LIBLZO="-llzo2" else - { $as_echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -$as_echo_n "checking for __lzo_init_v2 in -llzo... " >&6; } + { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5887,43 +5458,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init_v2=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init_v2=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -$as_echo "$ac_cv_lib_lzo___lzo_init_v2" >&6; } -if test "x$ac_cv_lib_lzo___lzo_init_v2" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } +if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then LIBLZO="-llzo" else - { $as_echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -$as_echo_n "checking for __lzo_init2 in -llzo... " >&6; } + { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 +echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-llzo $LIBS" @@ -5955,41 +5522,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_lzo___lzo_init2=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_lzo___lzo_init2=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -$as_echo "$ac_cv_lib_lzo___lzo_init2" >&6; } -if test "x$ac_cv_lib_lzo___lzo_init2" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 +echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } +if test $ac_cv_lib_lzo___lzo_init2 = yes; then LIBLZO="-llzo" else - { { $as_echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 -$as_echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} + { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 +echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} { (exit 1); exit 1; }; } fi @@ -5999,10 +5562,10 @@ fi LIBS="$LIBS $LIBLZO" - { $as_echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -$as_echo_n "checking for lzo1x_999_compress... " >&6; } + { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 +echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6055,40 +5618,36 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_func_lzo1x_999_compress=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_func_lzo1x_999_compress=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -$as_echo "$ac_cv_func_lzo1x_999_compress" >&6; } -if test "x$ac_cv_func_lzo1x_999_compress" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 +echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } +if test $ac_cv_func_lzo1x_999_compress = yes; then : else - { { $as_echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 -$as_echo "$as_me: error: LZO1X-999 must be enabled" >&2;} + { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 +echo "$as_me: error: LZO1X-999 must be enabled" >&2;} { (exit 1); exit 1; }; } fi @@ -6098,21 +5657,20 @@ fi for ac_header in lzo/lzo1x.h lzo1x.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6128,33 +5686,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -6168,52 +5725,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -6222,24 +5778,21 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi @@ -6262,11 +5815,11 @@ fi for ac_func in posix_memalign memalign asprintf do -as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ $as_echo "$as_me:$LINENO: checking for $ac_func" >&5 -$as_echo_n "checking for $ac_func... " >&6; } +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -6319,42 +5872,35 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then eval "$as_ac_var=yes" else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 eval "$as_ac_var=no" fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -ac_res=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } -as_val=`eval 'as_val=${'$as_ac_var'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi @@ -6367,8 +5913,8 @@ done # Use linker script if present, otherwise use builtin -N script. -{ $as_echo "$as_me:$LINENO: checking for option to link raw image" >&5 -$as_echo_n "checking for option to link raw image... " >&6; } +{ echo "$as_me:$LINENO: checking for option to link raw image" >&5 +echo $ECHO_N "checking for option to link raw image... $ECHO_C" >&6; } if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" @@ -6380,19 +5926,19 @@ else fi -{ $as_echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 -$as_echo "$TARGET_IMG_LDFLAGS_AC" >&6; } +{ echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 +echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } # For platforms where ELF is not the default link format. -{ $as_echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 -$as_echo_n "checking for command to convert module to ELF format... " >&6; } +{ echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 +echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } case "${host_os}" in cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; *) ;; esac -{ $as_echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 -$as_echo "$TARGET_OBJ2ELF" >&6; } +{ echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 +echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } # For cross-compiling. if test "x$build" != "x$host"; then @@ -6405,10 +5951,10 @@ if test "x$build" != "x$host"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_TARGET_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$TARGET_CC"; then ac_cv_prog_TARGET_CC="$TARGET_CC" # Let the user override the test. @@ -6421,7 +5967,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6432,11 +5978,11 @@ fi fi TARGET_CC=$ac_cv_prog_TARGET_CC if test -n "$TARGET_CC"; then - { $as_echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -$as_echo "$TARGET_CC" >&6; } + { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 +echo "${ECHO_T}$TARGET_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6449,10 +5995,10 @@ if test -z "$TARGET_CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_TARGET_CC"; then ac_cv_prog_ac_ct_TARGET_CC="$ac_ct_TARGET_CC" # Let the user override the test. @@ -6465,7 +6011,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6476,11 +6022,11 @@ fi fi ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC if test -n "$ac_ct_TARGET_CC"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -$as_echo "$ac_ct_TARGET_CC" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 +echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6488,14 +6034,18 @@ fi done if test "x$ac_ct_TARGET_CC" = x; then - TARGET_CC="{ { $as_echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 -$as_echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} + TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 +echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} { (exit 1); exit 1; }; }" else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac TARGET_CC=$ac_ct_TARGET_CC @@ -6505,10 +6055,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6521,7 +6071,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6532,11 +6082,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6545,10 +6095,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6561,7 +6111,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6572,11 +6122,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6584,8 +6134,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6597,10 +6151,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6613,7 +6167,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6624,11 +6178,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6637,10 +6191,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6653,7 +6207,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6664,11 +6218,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6676,8 +6230,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6689,10 +6247,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6705,7 +6263,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6716,11 +6274,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { $as_echo "$as_me:$LINENO: result: $NM" >&5 -$as_echo "$NM" >&6; } + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6729,10 +6287,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -6745,7 +6303,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6756,11 +6314,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -6768,8 +6326,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -6787,10 +6349,10 @@ else if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$OBJCOPY"; then ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. @@ -6803,7 +6365,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6814,11 +6376,11 @@ fi fi OBJCOPY=$ac_cv_prog_OBJCOPY if test -n "$OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -$as_echo "$OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 +echo "${ECHO_T}$OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6827,10 +6389,10 @@ if test -z "$ac_cv_prog_OBJCOPY"; then ac_ct_OBJCOPY=$OBJCOPY # Extract the first word of "objcopy", so it can be a program name with args. set dummy objcopy; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_OBJCOPY"; then ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. @@ -6843,7 +6405,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_OBJCOPY="objcopy" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6854,11 +6416,11 @@ fi fi ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY if test -n "$ac_ct_OBJCOPY"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -$as_echo "$ac_ct_OBJCOPY" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 +echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_OBJCOPY" = x; then @@ -6866,8 +6428,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac OBJCOPY=$ac_ct_OBJCOPY @@ -6879,10 +6445,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. @@ -6895,7 +6461,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6906,11 +6472,11 @@ fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then - { $as_echo "$as_me:$LINENO: result: $STRIP" >&5 -$as_echo "$STRIP" >&6; } + { echo "$as_me:$LINENO: result: $STRIP" >&5 +echo "${ECHO_T}$STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -6919,10 +6485,10 @@ if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. @@ -6935,7 +6501,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_STRIP="strip" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6946,11 +6512,11 @@ fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -$as_echo "$ac_ct_STRIP" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 +echo "${ECHO_T}$ac_ct_STRIP" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_STRIP" = x; then @@ -6958,8 +6524,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP @@ -6971,10 +6541,10 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # Let the user override the test. @@ -6987,7 +6557,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_NM="${ac_tool_prefix}nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -6998,11 +6568,11 @@ fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then - { $as_echo "$as_me:$LINENO: result: $NM" >&5 -$as_echo "$NM" >&6; } + { echo "$as_me:$LINENO: result: $NM" >&5 +echo "${ECHO_T}$NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -7011,10 +6581,10 @@ if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. @@ -7027,7 +6597,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_ac_ct_NM="nm" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -7038,11 +6608,11 @@ fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then - { $as_echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -$as_echo "$ac_ct_NM" >&6; } + { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 +echo "${ECHO_T}$ac_ct_NM" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi if test "x$ac_ct_NM" = x; then @@ -7050,8 +6620,12 @@ fi else case $cross_compiling:$ac_tool_warned in yes:) -{ $as_echo "$as_me:$LINENO: WARNING: using cross tools not prefixed with host triplet" >&5 -$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} +{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&5 +echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools +whose name does not start with the host triplet. If you think this +configuration is useful to you, please write to autoconf@gnu.org." >&2;} ac_tool_warned=yes ;; esac NM=$ac_ct_NM @@ -7082,10 +6656,10 @@ if test "x$TARGET_CFLAGS" = x; then -Wundef -Wstrict-prototypes -g" # optimization flags. - { $as_echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -$as_echo_n "checking whether optimization for size works... " >&6; } + { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 +echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } if test "${grub_cv_cc_Os+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS=-Os @@ -7110,21 +6684,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_Os=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_Os=no @@ -7133,8 +6706,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 -$as_echo "$grub_cv_cc_Os" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 +echo "${ECHO_T}$grub_cv_cc_Os" >&6; } if test "x$grub_cv_cc_Os" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -Os" else @@ -7143,10 +6716,10 @@ $as_echo "$grub_cv_cc_Os" >&6; } # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then - { $as_echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -$as_echo_n "checking whether -falign-loops works... " >&6; } + { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 +echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } if test "${grub_cv_cc_falign_loop+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="-falign-loops=1" @@ -7171,21 +6744,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_falign_loop=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_falign_loop=no @@ -7194,8 +6766,8 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 -$as_echo "$grub_cv_cc_falign_loop" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 +echo "${ECHO_T}$grub_cv_cc_falign_loop" >&6; } if test "x$grub_cv_cc_falign_loop" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" @@ -7219,10 +6791,10 @@ fi if test "$target_cpu"-"$platform" = x86_64-efi; then # Use large model to support 4G memory - { $as_echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 -$as_echo_n "checking whether option -mcmodel=large works... " >&6; } + { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 +echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; } if test "${grub_cv_cc_mcmodel+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="-m64 -mcmodel=large" @@ -7247,21 +6819,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_mcmodel=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_mcmodel=no @@ -7270,19 +6841,19 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 -$as_echo "$grub_cv_cc_mcmodel" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 +echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; } if test "x$grub_cv_cc_no_mcmodel" = xno; then - { { $as_echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 -$as_echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} + { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 +echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi # EFI writes to stack below %rsp, we must not use the red zone - { $as_echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 -$as_echo_n "checking whether option -mno-red-zone works... " >&6; } + { echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 +echo $ECHO_N "checking whether option -mno-red-zone works... $ECHO_C" >&6; } if test "${grub_cv_cc_no_red_zone+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else CFLAGS="-m64 -mno-red-zone" @@ -7307,21 +6878,20 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then grub_cv_cc_no_red_zone=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_cc_no_red_zone=no @@ -7330,11 +6900,11 @@ fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 -$as_echo "$grub_cv_cc_no_red_zone" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 +echo "${ECHO_T}$grub_cv_cc_no_red_zone" >&6; } if test "x$grub_cv_cc_no_red_zone" = xno; then - { { $as_echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 -$as_echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} + { { echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 +echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} { (exit 1); exit 1; }; } fi @@ -7347,8 +6917,8 @@ fi # Need __enable_execute_stack() for nested function trampolines? -{ $as_echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 -$as_echo_n "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... " >&6; } +{ echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 +echo $ECHO_N "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF void f (int (*p) (void)); @@ -7363,12 +6933,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then @@ -7377,11 +6947,11 @@ cat >>confdefs.h <<\_ACEOF #define NEED_ENABLE_EXECUTE_STACK 1 _ACEOF - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -f conftest* @@ -7390,8 +6960,8 @@ rm -f conftest* # Smashing stack protector. ssp_possible=yes -{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -$as_echo_n "checking whether \`$CC' accepts \`-fstack-protector'... " >&6; } +{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } # Is this a reliable test case? cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } @@ -7399,14 +6969,14 @@ _ACEOF # `$CC -c -o ...' might not be portable. But, oh, well... Is calling # `ac_compile' like this correct, after all? if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else ssp_possible=no - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Need that, because some distributions ship compilers that include @@ -7417,20 +6987,20 @@ fi # Smashing stack arg probe. sap_possible=yes -{ $as_echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 -$as_echo_n "checking whether \`$CC' accepts \`-mstack-arg-probe'... " >&6; } +{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 +echo $ECHO_N "checking whether \`$CC' accepts \`-mstack-arg-probe'... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF void foo (void) { volatile char a[8]; a[3]; } _ACEOF if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? rm -f conftest.s else sap_possible=no - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi # Cygwin's GCC uses alloca() to probe the stackframe on static @@ -7450,10 +7020,10 @@ CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" # Defined in aclocal.m4. -{ $as_echo "$as_me:$LINENO: checking whether target compiler is working" >&5 -$as_echo_n "checking whether target compiler is working... " >&6; } +{ echo "$as_me:$LINENO: checking whether target compiler is working" >&5 +echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; } if test "${grub_cv_prog_target_cc+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7476,48 +7046,44 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_prog_target_cc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_target_cc=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 -$as_echo "$grub_cv_prog_target_cc" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 +echo "${ECHO_T}$grub_cv_prog_target_cc" >&6; } if test "x$grub_cv_prog_target_cc" = xno; then - { { $as_echo "$as_me:$LINENO: error: cannot compile for the target" >&5 -$as_echo "$as_me: error: cannot compile for the target" >&2;} + { { echo "$as_me:$LINENO: error: cannot compile for the target" >&5 +echo "$as_me: error: cannot compile for the target" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -$as_echo_n "checking whether ${OBJCOPY} works for absolute addresses... " >&6; } +{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 +echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } if test "${grub_cv_prog_objcopy_absolute+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.c <<\EOF void @@ -7530,11 +7096,11 @@ EOF if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && test -s conftest.o; then : else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 -$as_echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 +echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} { (exit 1); exit 1; }; } fi grub_cv_prog_objcopy_absolute=yes @@ -7543,29 +7109,29 @@ for link_addr in 2000 8000 7C00; do { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 -$as_echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 +echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} { (exit 1); exit 1; }; } fi if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else - { { $as_echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 -$as_echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} + { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 +echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} { (exit 1); exit 1; }; } fi if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then mv -f conftest conftest.old else @@ -7576,19 +7142,19 @@ done rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -$as_echo "$grub_cv_prog_objcopy_absolute" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 +echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } if test "x$grub_cv_prog_objcopy_absolute" = xno; then - { { $as_echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 -$as_echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} + { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 +echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 -$as_echo_n "checking whether linker accepts --build-id=none... " >&6; } +{ echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 +echo $ECHO_N "checking whether linker accepts --build-id=none... $ECHO_C" >&6; } if test "${grub_cv_prog_ld_build_id_none+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else save_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -Wl,--build-id=none" @@ -7613,48 +7179,44 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_prog_ld_build_id_none=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_prog_ld_build_id_none=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LDFLAGS="$save_LDFLAGS" fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 -$as_echo "$grub_cv_prog_ld_build_id_none" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 +echo "${ECHO_T}$grub_cv_prog_ld_build_id_none" >&6; } if test "x$grub_cv_prog_ld_build_id_none" = xyes; then TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" fi -{ $as_echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -$as_echo_n "checking if C symbols get an underscore after compilation... " >&6; } +{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 +echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } if test "${grub_cv_asm_uscore+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.c <<\EOF int @@ -7669,12 +7231,12 @@ if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.s; then true else - { { $as_echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -$as_echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} + { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 +echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} { (exit 1); exit 1; }; } fi @@ -7696,8 +7258,8 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -$as_echo "$grub_cv_asm_uscore" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 +echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } if test "x$target_cpu" = xi386; then if test ! -z "$TARGET_IMG_LDSCRIPT"; then @@ -7706,10 +7268,10 @@ if test "x$target_cpu" = xi386; then fi if test "x$platform" = xpc; then -{ $as_echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -$as_echo_n "checking if __bss_start is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 +echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7732,42 +7294,38 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_uscore_bss_start_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_uscore_bss_start_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -$as_echo "$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } -{ $as_echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -$as_echo_n "checking if edata is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 +echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_edata_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7790,42 +7348,38 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_edata_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_edata_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -$as_echo "$grub_cv_check_edata_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } -{ $as_echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -$as_echo_n "checking if _edata is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 +echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7848,37 +7402,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_edata_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_edata_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -$as_echo "$grub_cv_check_uscore_edata_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } @@ -7899,16 +7449,16 @@ elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then _ACEOF else - { { $as_echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 -$as_echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} + { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 +echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} { (exit 1); exit 1; }; } fi -{ $as_echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -$as_echo_n "checking if end is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 +echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_end_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7931,42 +7481,38 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_end_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_end_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -$as_echo "$grub_cv_check_end_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } -{ $as_echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -$as_echo_n "checking if _end is defined by the compiler... " >&6; } +{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 +echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } if test "${grub_cv_check_uscore_end_symbol+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ @@ -7989,37 +7535,33 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then grub_cv_check_uscore_end_symbol=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 grub_cv_check_uscore_end_symbol=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -$as_echo "$grub_cv_check_uscore_end_symbol" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 +echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } @@ -8035,18 +7577,18 @@ elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then _ACEOF else - { { $as_echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 -$as_echo "$as_me: error: neither end nor _end is defined" >&2;} + { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 +echo "$as_me: error: neither end nor _end is defined" >&2;} { (exit 1); exit 1; }; } fi fi CFLAGS="$TARGET_CFLAGS" -{ $as_echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -$as_echo_n "checking whether addr32 must be in the same line as the instruction... " >&6; } +{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 +echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.s <<\EOF .code16 @@ -8057,7 +7599,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_prefix_requirement=yes else @@ -8087,14 +7629,14 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -$as_echo "$grub_cv_i386_asm_prefix_requirement" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } -{ $as_echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -$as_echo_n "checking for .code16 addr32 assembler support... " >&6; } +{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 +echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_addr32+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.s.in <<\EOF .code16 @@ -8111,7 +7653,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_addr32=yes else @@ -8122,13 +7664,13 @@ rm -f conftest* fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -$as_echo "$grub_cv_i386_asm_addr32" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } -{ $as_echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -$as_echo_n "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... " >&6; } +{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 +echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else cat > conftest.s <<\EOF lcall *(offset) @@ -8141,7 +7683,7 @@ if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; } && test -s conftest.o; then grub_cv_i386_asm_absolute_without_asterisk=no else @@ -8160,13 +7702,13 @@ _ACEOF fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -$as_echo "$grub_cv_i386_asm_absolute_without_asterisk" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 +echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } -{ $as_echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -$as_echo_n "checking if GCC has the regparm=3 bug... " >&6; } +{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 +echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } if test "${grub_cv_i386_check_nested_functions+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then grub_cv_i386_check_nested_functions=yes @@ -8210,32 +7752,29 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' { (case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_try") 2>&5 ac_status=$? - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then grub_cv_i386_check_nested_functions=no else - $as_echo "$as_me: program exited with status $ac_status" >&5 -$as_echo "$as_me: failed program was:" >&5 + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ( exit $ac_status ) grub_cv_i386_check_nested_functions=yes fi -rm -rf conftest.dSYM rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi @@ -8243,8 +7782,8 @@ fi fi -{ $as_echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -$as_echo "$grub_cv_i386_check_nested_functions" >&6; } +{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 +echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } if test "x$grub_cv_i386_check_nested_functions" = xyes; then @@ -8263,7 +7802,7 @@ fi else cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR /**/ +#define NESTED_FUNC_ATTR _ACEOF fi @@ -8302,10 +7841,10 @@ fi if [ x"$enable_grub_emu" = xyes ]; then # Check for curses libraries. - { $as_echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -$as_echo_n "checking for wgetch in -lncurses... " >&6; } + { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 +echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lncurses $LIBS" @@ -8337,43 +7876,39 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_ncurses_wgetch=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_ncurses_wgetch=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -$as_echo "$ac_cv_lib_ncurses_wgetch" >&6; } -if test "x$ac_cv_lib_ncurses_wgetch" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } +if test $ac_cv_lib_ncurses_wgetch = yes; then LIBCURSES="-lncurses" else - { $as_echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -$as_echo_n "checking for wgetch in -lcurses... " >&6; } + { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 +echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } if test "${ac_cv_lib_curses_wgetch+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcurses $LIBS" @@ -8405,41 +7940,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_curses_wgetch=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_curses_wgetch=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -$as_echo "$ac_cv_lib_curses_wgetch" >&6; } -if test "x$ac_cv_lib_curses_wgetch" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 +echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } +if test $ac_cv_lib_curses_wgetch = yes; then LIBCURSES="-lcurses" else - { { $as_echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 -$as_echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} + { { echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 +echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -8451,21 +7982,20 @@ fi for ac_header in ncurses/curses.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8481,33 +8011,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8521,52 +8050,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8575,45 +8103,41 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in ncurses.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8629,33 +8153,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8669,52 +8192,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8723,45 +8245,41 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else for ac_header in curses.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8777,33 +8295,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -8817,52 +8334,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -8871,29 +8387,26 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { $as_echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 -$as_echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} + { { echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 +echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} { (exit 1); exit 1; }; } fi @@ -8910,10 +8423,10 @@ done if [ x"$enable_grub_emu_usb" = xyes ]; then # Check for libusb libraries. - { $as_echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 -$as_echo_n "checking for usb_claim_interface in -lusb... " >&6; } + { echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 +echo $ECHO_N "checking for usb_claim_interface in -lusb... $ECHO_C" >&6; } if test "${ac_cv_lib_usb_usb_claim_interface+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lusb $LIBS" @@ -8945,41 +8458,37 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_link") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err - } && test -s conftest$ac_exeext && { - test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext - }; then + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then ac_cv_lib_usb_usb_claim_interface=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_cv_lib_usb_usb_claim_interface=no fi -rm -rf conftest.dSYM rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -{ $as_echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 -$as_echo "$ac_cv_lib_usb_usb_claim_interface" >&6; } -if test "x$ac_cv_lib_usb_usb_claim_interface" = x""yes; then +{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 +echo "${ECHO_T}$ac_cv_lib_usb_usb_claim_interface" >&6; } +if test $ac_cv_lib_usb_usb_claim_interface = yes; then LIBUSB="-lusb" else - { { $as_echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 -$as_echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} + { { echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 +echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -8989,21 +8498,20 @@ fi for ac_header in usb.h do -as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` +as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } + { echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } else # Is the header compilable? -{ $as_echo "$as_me:$LINENO: checking $ac_header usability" >&5 -$as_echo_n "checking $ac_header usability... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 +echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9019,33 +8527,32 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_compile") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then ac_header_compiler=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -$as_echo "$ac_header_compiler" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +echo "${ECHO_T}$ac_header_compiler" >&6; } # Is the header present? -{ $as_echo "$as_me:$LINENO: checking $ac_header presence" >&5 -$as_echo_n "checking $ac_header presence... " >&6; } +{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 +echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF @@ -9059,52 +8566,51 @@ case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac -eval ac_try_echo="\"\$as_me:$LINENO: $ac_try_echo\"" -$as_echo "$ac_try_echo") >&5 +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 ac_status=$? grep -v '^ *+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then ac_header_preproc=yes else - $as_echo "$as_me: failed program was:" >&5 + echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_header_preproc=no fi rm -f conftest.err conftest.$ac_ext -{ $as_echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -$as_echo "$ac_header_preproc" >&6; } +{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +echo "${ECHO_T}$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in yes:no: ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -$as_echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} ac_header_preproc=yes ;; no:yes:* ) - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -$as_echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -$as_echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -$as_echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -$as_echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -$as_echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { $as_echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -$as_echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} ( cat <<\_ASBOX ## ------------------------------- ## ## Report this to bug-grub@gnu.org ## @@ -9113,29 +8619,26 @@ _ASBOX ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac -{ $as_echo "$as_me:$LINENO: checking for $ac_header" >&5 -$as_echo_n "checking for $ac_header... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_header" >&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else eval "$as_ac_Header=\$ac_header_preproc" fi -ac_res=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - { $as_echo "$as_me:$LINENO: result: $ac_res" >&5 -$as_echo "$ac_res" >&6; } +ac_res=`eval echo '${'$as_ac_Header'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } fi -as_val=`eval 'as_val=${'$as_ac_Header'} - $as_echo "$as_val"'` - if test "x$as_val" = x""yes; then +if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <<_ACEOF -#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 +#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF else - { { $as_echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 -$as_echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} + { { echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 +echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} { (exit 1); exit 1; }; } fi @@ -9171,10 +8674,10 @@ if test x"$enable_grub_mkfont" = xyes ; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -{ $as_echo "$as_me:$LINENO: checking for $ac_word" >&5 -$as_echo_n "checking for $ac_word... " >&6; } +{ echo "$as_me:$LINENO: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } if test "${ac_cv_prog_FREETYPE+set}" = set; then - $as_echo_n "(cached) " >&6 + echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$FREETYPE"; then ac_cv_prog_FREETYPE="$FREETYPE" # Let the user override the test. @@ -9187,7 +8690,7 @@ do for ac_exec_ext in '' $ac_executable_extensions; do if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then ac_cv_prog_FREETYPE="$ac_prog" - $as_echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 + echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done @@ -9198,11 +8701,11 @@ fi fi FREETYPE=$ac_cv_prog_FREETYPE if test -n "$FREETYPE"; then - { $as_echo "$as_me:$LINENO: result: $FREETYPE" >&5 -$as_echo "$FREETYPE" >&6; } + { echo "$as_me:$LINENO: result: $FREETYPE" >&5 +echo "${ECHO_T}$FREETYPE" >&6; } else - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi @@ -9210,8 +8713,8 @@ fi done if test "x$FREETYPE" = x ; then - { { $as_echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 -$as_echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} + { { echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 +echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} { (exit 1); exit 1; }; } fi freetype_cflags=`freetype-config --cflags` @@ -9223,21 +8726,21 @@ fi # Output files. -{ $as_echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 -$as_echo_n "checking whether ln can handle directories properly... " >&6; } +{ echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 +echo $ECHO_N "checking whether ln can handle directories properly... $ECHO_C" >&6; } mkdir testdir 2>/dev/null case $srcdir in [\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; *) reldir=../$srcdir/include/grub/util ;; esac if ln -s $reldir testdir/util 2>/dev/null ; then - { $as_echo "$as_me:$LINENO: result: yes" >&5 -$as_echo "yes" >&6; } + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } link_dir=yes else link_dir=no - { $as_echo "$as_me:$LINENO: result: no" >&5 -$as_echo "no" >&6; } + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } fi rm -rf testdir @@ -9282,12 +8785,11 @@ _ACEOF case $ac_val in #( *${as_nl}*) case $ac_var in #( - *_cv_*) { $as_echo "$as_me:$LINENO: WARNING: cache variable $ac_var contains a newline" >&5 -$as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; + *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 +echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( - BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) $as_unset $ac_var ;; esac ;; esac @@ -9320,12 +8822,12 @@ $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then test "x$cache_file" != "x/dev/null" && - { $as_echo "$as_me:$LINENO: updating cache $cache_file" >&5 -$as_echo "$as_me: updating cache $cache_file" >&6;} + { echo "$as_me:$LINENO: updating cache $cache_file" >&5 +echo "$as_me: updating cache $cache_file" >&6;} cat confcache >$cache_file else - { $as_echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -$as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} + { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 +echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache @@ -9341,7 +8843,7 @@ ac_ltlibobjs= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`$as_echo "$ac_i" | sed "$ac_script"` + ac_i=`echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" @@ -9353,14 +8855,12 @@ LTLIBOBJS=$ac_ltlibobjs - : ${CONFIG_STATUS=./config.status} -ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ $as_echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +echo "$as_me: creating $CONFIG_STATUS" >&6;} +cat >$CONFIG_STATUS <<_ACEOF #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. @@ -9373,7 +8873,7 @@ ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ## --------------------- ## ## M4sh Initialization. ## ## --------------------- ## @@ -9383,7 +8883,7 @@ DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then emulate sh NULLCMD=: - # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST @@ -9405,45 +8905,17 @@ as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits -as_nl=' -' -export as_nl -# Printing a long string crashes Solaris 7 /usr/bin/printf. -as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo -as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo -if (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then - as_echo='printf %s\n' - as_echo_n='printf %s' -else - if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then - as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' - as_echo_n='/usr/ucb/echo -n' - else - as_echo_body='eval expr "X$1" : "X\\(.*\\)"' - as_echo_n_body='eval - arg=$1; - case $arg in - *"$as_nl"*) - expr "X$arg" : "X\\(.*\\)$as_nl"; - arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; - esac; - expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" - ' - export as_echo_n_body - as_echo_n='sh -c $as_echo_n_body as_echo' - fi - export as_echo_body - as_echo='sh -c $as_echo_body as_echo' -fi - # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then - PATH_SEPARATOR=: - (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { - (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || - PATH_SEPARATOR=';' - } + echo "#! /bin/sh" >conf$$.sh + echo "exit 0" >>conf$$.sh + chmod +x conf$$.sh + if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then + PATH_SEPARATOR=';' + else + PATH_SEPARATOR=: + fi + rm -f conf$$.sh fi # Support unset when possible. @@ -9459,6 +8931,8 @@ fi # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) +as_nl=' +' IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. @@ -9481,7 +8955,7 @@ if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then - $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 + echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 { (exit 1); exit 1; } fi @@ -9494,10 +8968,17 @@ PS2='> ' PS4='+ ' # NLS nuisances. -LC_ALL=C -export LC_ALL -LANGUAGE=C -export LANGUAGE +for as_var in \ + LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ + LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ + LC_TELEPHONE LC_TIME +do + if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then + eval $as_var=C; export $as_var + else + ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var + fi +done # Required to use basename. if expr a : '\(a\)' >/dev/null 2>&1 && @@ -9519,7 +9000,7 @@ as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X/"$0" | +echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q @@ -9570,7 +9051,7 @@ $as_unset CDPATH s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || - { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 + { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 { (exit 1); exit 1; }; } # Don't try to exec as it changes $[0], causing all sort of problems @@ -9598,6 +9079,7 @@ case `echo -n x` in *) ECHO_N='-n';; esac + if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr @@ -9610,22 +9092,19 @@ if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir - mkdir conf$$.dir 2>/dev/null + mkdir conf$$.dir fi -if (echo >conf$$.file) 2>/dev/null; then - if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' - elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln - else +echo >conf$$.file +if ln -s conf$$.file conf$$ 2>/dev/null; then + as_ln_s='ln -s' + # ... but there are two gotchas: + # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. + # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. + # In both cases, we have to default to `cp -p'. + ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -p' - fi +elif ln conf$$.file conf$$ 2>/dev/null; then + as_ln_s=ln else as_ln_s='cp -p' fi @@ -9650,10 +9129,10 @@ else as_test_x=' eval sh -c '\'' if test -d "$1"; then - test -d "$1/."; + test -d "$1/."; else case $1 in - -*)set "./$1";; + -*)set "./$1";; esac; case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in ???[sx]*):;;*)false;;esac;fi @@ -9676,7 +9155,7 @@ exec 6>&1 # values after options handling. ac_log=" This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.63. Invocation command line was +generated by GNU Autoconf 2.61. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -9689,16 +9168,7 @@ on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF -case $ac_config_files in *" -"*) set x $ac_config_files; shift; ac_config_files=$*;; -esac - -case $ac_config_headers in *" -"*) set x $ac_config_headers; shift; ac_config_headers=$*;; -esac - - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" @@ -9706,23 +9176,22 @@ config_links="$ac_config_links" _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF ac_cs_usage="\ \`$as_me' instantiates files from templates according to the current configuration. -Usage: $0 [OPTION]... [FILE]... +Usage: $0 [OPTIONS] [FILE]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit - -q, --quiet, --silent - do not print progress messages + -q, --quiet do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE + --file=FILE[:TEMPLATE] + instantiate the configuration file FILE + --header=FILE[:TEMPLATE] + instantiate the configuration header FILE Configuration files: $config_files @@ -9736,25 +9205,24 @@ $config_links Report bugs to ." _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_cs_version="\\ GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.63, - with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" +configured by $0, generated by GNU Autoconf 2.61, + with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" -Copyright (C) 2008 Free Software Foundation, Inc. +Copyright (C) 2006 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' -AWK='$AWK' -test -n "\$AWK" || AWK=awk _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -# The default lists apply if the user does not specify any file. +cat >>$CONFIG_STATUS <<\_ACEOF +# If no file are specified by the user, then we need to provide default +# value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do @@ -9776,36 +9244,30 @@ do -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - $as_echo "$ac_cs_version"; exit ;; + echo "$ac_cs_version"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_FILES="$CONFIG_FILES '$ac_optarg'" + CONFIG_FILES="$CONFIG_FILES $ac_optarg" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift - case $ac_optarg in - *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - CONFIG_HEADERS="$CONFIG_HEADERS '$ac_optarg'" + CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header - { $as_echo "$as_me: error: ambiguous option: $1 + { echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; };; --help | --hel | -h ) - $as_echo "$ac_cs_usage"; exit ;; + echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. - -*) { $as_echo "$as_me: error: unrecognized option: $1 + -*) { echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; @@ -9824,32 +9286,30 @@ if $ac_cs_silent; then fi _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion - shift - \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 - CONFIG_SHELL='$SHELL' + echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 + CONFIG_SHELL=$SHELL export CONFIG_SHELL - exec "\$@" + exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion fi _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX - $as_echo "$ac_log" + echo "$ac_log" } >&5 _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # Handling of arguments. for ac_config_target in $ac_config_targets @@ -9863,8 +9323,8 @@ do "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - *) { { $as_echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -$as_echo "$as_me: error: invalid argument: $ac_config_target" >&2;} + *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac done @@ -9905,144 +9365,159 @@ $debug || (umask 077 && mkdir "$tmp") } || { - $as_echo "$as_me: cannot create a temporary directory in ." >&2 + echo "$me: cannot create a temporary directory in ." >&2 { (exit 1); exit 1; } } -# Set up the scripts for CONFIG_FILES section. -# No need to generate them if there are no CONFIG_FILES. -# This happens for instance with `./config.status config.h'. +# +# Set up the sed scripts for CONFIG_FILES section. +# + +# No need to generate the scripts if there are no CONFIG_FILES. +# This happens for instance when ./config.status config.h if test -n "$CONFIG_FILES"; then - -ac_cr=' ' -ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` -if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then - ac_cs_awk_cr='\\r' -else - ac_cs_awk_cr=$ac_cr -fi - -echo 'BEGIN {' >"$tmp/subs1.awk" && _ACEOF -{ - echo "cat >conf$$subs.awk <<_ACEOF" && - echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && - echo "_ACEOF" -} >conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } -ac_delim_num=`echo "$ac_subst_vars" | grep -c '$'` + ac_delim='%!_!# ' for ac_last_try in false false false false false :; do - . ./conf$$subs.sh || - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } + cat >conf$$subs.sed <<_ACEOF +SHELL!$SHELL$ac_delim +PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim +PACKAGE_NAME!$PACKAGE_NAME$ac_delim +PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim +PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim +PACKAGE_STRING!$PACKAGE_STRING$ac_delim +PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim +exec_prefix!$exec_prefix$ac_delim +prefix!$prefix$ac_delim +program_transform_name!$program_transform_name$ac_delim +bindir!$bindir$ac_delim +sbindir!$sbindir$ac_delim +libexecdir!$libexecdir$ac_delim +datarootdir!$datarootdir$ac_delim +datadir!$datadir$ac_delim +sysconfdir!$sysconfdir$ac_delim +sharedstatedir!$sharedstatedir$ac_delim +localstatedir!$localstatedir$ac_delim +includedir!$includedir$ac_delim +oldincludedir!$oldincludedir$ac_delim +docdir!$docdir$ac_delim +infodir!$infodir$ac_delim +htmldir!$htmldir$ac_delim +dvidir!$dvidir$ac_delim +pdfdir!$pdfdir$ac_delim +psdir!$psdir$ac_delim +libdir!$libdir$ac_delim +localedir!$localedir$ac_delim +mandir!$mandir$ac_delim +DEFS!$DEFS$ac_delim +ECHO_C!$ECHO_C$ac_delim +ECHO_N!$ECHO_N$ac_delim +ECHO_T!$ECHO_T$ac_delim +LIBS!$LIBS$ac_delim +build_alias!$build_alias$ac_delim +host_alias!$host_alias$ac_delim +target_alias!$target_alias$ac_delim +build!$build$ac_delim +build_cpu!$build_cpu$ac_delim +build_vendor!$build_vendor$ac_delim +build_os!$build_os$ac_delim +host!$host$ac_delim +host_cpu!$host_cpu$ac_delim +host_vendor!$host_vendor$ac_delim +host_os!$host_os$ac_delim +target!$target$ac_delim +target_cpu!$target_cpu$ac_delim +target_vendor!$target_vendor$ac_delim +target_os!$target_os$ac_delim +host_kernel!$host_kernel$ac_delim +platform!$platform$ac_delim +CMP!$CMP$ac_delim +YACC!$YACC$ac_delim +UNIFONT_BDF!$UNIFONT_BDF$ac_delim +INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim +INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim +INSTALL_DATA!$INSTALL_DATA$ac_delim +AWK!$AWK$ac_delim +SET_MAKE!$SET_MAKE$ac_delim +RUBY!$RUBY$ac_delim +HELP2MAN!$HELP2MAN$ac_delim +CC!$CC$ac_delim +CFLAGS!$CFLAGS$ac_delim +LDFLAGS!$LDFLAGS$ac_delim +CPPFLAGS!$CPPFLAGS$ac_delim +ac_ct_CC!$ac_ct_CC$ac_delim +EXEEXT!$EXEEXT$ac_delim +OBJEXT!$OBJEXT$ac_delim +CPP!$CPP$ac_delim +GREP!$GREP$ac_delim +EGREP!$EGREP$ac_delim +LIBLZO!$LIBLZO$ac_delim +enable_lzo!$enable_lzo$ac_delim +TARGET_IMG_LDSCRIPT!$TARGET_IMG_LDSCRIPT$ac_delim +TARGET_IMG_LDFLAGS!$TARGET_IMG_LDFLAGS$ac_delim +TARGET_OBJ2ELF!$TARGET_OBJ2ELF$ac_delim +TARGET_CC!$TARGET_CC$ac_delim +ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim +OBJCOPY!$OBJCOPY$ac_delim +STRIP!$STRIP$ac_delim +NM!$NM$ac_delim +TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim +TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim +TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim +LIBCURSES!$LIBCURSES$ac_delim +LIBUSB!$LIBUSB$ac_delim +enable_grub_emu!$enable_grub_emu$ac_delim +enable_grub_emu_usb!$enable_grub_emu_usb$ac_delim +enable_grub_fstest!$enable_grub_fstest$ac_delim +enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim +FREETYPE!$FREETYPE$ac_delim +enable_grub_mkfont!$enable_grub_mkfont$ac_delim +freetype_cflags!$freetype_cflags$ac_delim +freetype_libs!$freetype_libs$ac_delim +LIBOBJS!$LIBOBJS$ac_delim +LTLIBOBJS!$LTLIBOBJS$ac_delim +_ACEOF - ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` - if test $ac_delim_n = $ac_delim_num; then + if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then break elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} + { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 +echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} { (exit 1); exit 1; }; } else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done -rm -f conf$$subs.sh -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -cat >>"\$tmp/subs1.awk" <<\\_ACAWK && +ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` +if test -n "$ac_eof"; then + ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` + ac_eof=`expr $ac_eof + 1` +fi + +cat >>$CONFIG_STATUS <<_ACEOF +cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof +/@[a-zA-Z_][a-zA-Z_0-9]*@/!b _ACEOF -sed -n ' -h -s/^/S["/; s/!.*/"]=/ -p -g -s/^[^!]*!// -:repl -t repl -s/'"$ac_delim"'$// -t delim -:nl -h -s/\(.\{148\}\).*/\1/ -t more1 -s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ -p -n -b repl -:more1 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t nl -:delim -h -s/\(.\{148\}\).*/\1/ -t more2 -s/["\\]/\\&/g; s/^/"/; s/$/"/ -p -b -:more2 -s/["\\]/\\&/g; s/^/"/; s/$/"\\/ -p -g -s/.\{148\}// -t delim -' >$CONFIG_STATUS || ac_write_fail=1 -rm -f conf$$subs.awk -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -_ACAWK -cat >>"\$tmp/subs1.awk" <<_ACAWK && - for (key in S) S_is_set[key] = 1 - FS = "" - -} -{ - line = $ 0 - nfields = split(line, field, "@") - substed = 0 - len = length(field[1]) - for (i = 2; i < nfields; i++) { - key = field[i] - keylen = length(key) - if (S_is_set[key]) { - value = S[key] - line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) - len += length(value) + length(field[++i]) - substed = 1 - } else - len += 1 + keylen - } - - print line -} - -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 -if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then - sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" -else - cat -fi < "$tmp/subs1.awk" > "$tmp/subs.awk" \ - || { { $as_echo "$as_me:$LINENO: error: could not setup config files machinery" >&5 -$as_echo "$as_me: error: could not setup config files machinery" >&2;} - { (exit 1); exit 1; }; } +sed ' +s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g +s/^/s,@/; s/!/@,|#_!!_#|/ +:n +t n +s/'"$ac_delim"'$/,g/; t +s/$/\\/; p +N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n +' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF +CEOF$ac_eof _ACEOF + # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty @@ -10058,133 +9533,19 @@ s/^[^=]*=[ ]*$// }' fi -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF fi # test -n "$CONFIG_FILES" -# Set up the scripts for CONFIG_HEADERS section. -# No need to generate them if there are no CONFIG_HEADERS. -# This happens for instance with `./config.status Makefile'. -if test -n "$CONFIG_HEADERS"; then -cat >"$tmp/defines.awk" <<\_ACAWK || -BEGIN { -_ACEOF -# Transform confdefs.h into an awk script `defines.awk', embedded as -# here-document in config.status, that substitutes the proper values into -# config.h.in to produce config.h. - -# Create a delimiter string that does not exist in confdefs.h, to ease -# handling of long lines. -ac_delim='%!_!# ' -for ac_last_try in false false :; do - ac_t=`sed -n "/$ac_delim/p" confdefs.h` - if test -z "$ac_t"; then - break - elif $ac_last_try; then - { { $as_echo "$as_me:$LINENO: error: could not make $CONFIG_HEADERS" >&5 -$as_echo "$as_me: error: could not make $CONFIG_HEADERS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -# For the awk script, D is an array of macro values keyed by name, -# likewise P contains macro parameters if any. Preserve backslash -# newline sequences. - -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -sed -n ' -s/.\{148\}/&'"$ac_delim"'/g -t rset -:rset -s/^[ ]*#[ ]*define[ ][ ]*/ / -t def -d -:def -s/\\$// -t bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3"/p -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p -d -:bsnl -s/["\\]/\\&/g -s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ -D["\1"]=" \3\\\\\\n"\\/p -t cont -s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p -t cont -d -:cont -n -s/.\{148\}/&'"$ac_delim"'/g -t clear -:clear -s/\\$// -t bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/"/p -d -:bsnlc -s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p -b cont -' >$CONFIG_STATUS || ac_write_fail=1 - -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 - for (key in D) D_is_set[key] = 1 - FS = "" -} -/^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { - line = \$ 0 - split(line, arg, " ") - if (arg[1] == "#") { - defundef = arg[2] - mac1 = arg[3] - } else { - defundef = substr(arg[1], 2) - mac1 = arg[2] - } - split(mac1, mac2, "(") #) - macro = mac2[1] - prefix = substr(line, 1, index(line, defundef) - 1) - if (D_is_set[macro]) { - # Preserve the white space surrounding the "#". - print prefix "define", macro P[macro] D[macro] - next - } else { - # Replace #undef with comments. This is necessary, for example, - # in the case of _POSIX_SOURCE, which is predefined and required - # on some systems where configure will not decide to define it. - if (defundef == "undef") { - print "/*", prefix defundef, macro, "*/" - next - } - } -} -{ print } -_ACAWK -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 - { { $as_echo "$as_me:$LINENO: error: could not setup config headers machinery" >&5 -$as_echo "$as_me: error: could not setup config headers machinery" >&2;} - { (exit 1); exit 1; }; } -fi # test -n "$CONFIG_HEADERS" - - -eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS " -shift -for ac_tag +for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; - :L* | :C*:*) { { $as_echo "$as_me:$LINENO: error: invalid tag $ac_tag" >&5 -$as_echo "$as_me: error: invalid tag $ac_tag" >&2;} + :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 +echo "$as_me: error: Invalid tag $ac_tag." >&2;} { (exit 1); exit 1; }; };; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; @@ -10213,38 +9574,26 @@ $as_echo "$as_me: error: invalid tag $ac_tag" >&2;} [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || - { { $as_echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -$as_echo "$as_me: error: cannot find input file: $ac_f" >&2;} + { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 +echo "$as_me: error: cannot find input file: $ac_f" >&2;} { (exit 1); exit 1; }; };; esac - case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac - ac_file_inputs="$ac_file_inputs '$ac_f'" + ac_file_inputs="$ac_file_inputs $ac_f" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ - configure_input='Generated from '` - $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' - `' by configure.' + configure_input="Generated from "`IFS=: + echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" - { $as_echo "$as_me:$LINENO: creating $ac_file" >&5 -$as_echo "$as_me: creating $ac_file" >&6;} + { echo "$as_me:$LINENO: creating $ac_file" >&5 +echo "$as_me: creating $ac_file" >&6;} fi - # Neutralize special characters interpreted by sed in replacement strings. - case $configure_input in #( - *\&* | *\|* | *\\* ) - ac_sed_conf_input=`$as_echo "$configure_input" | - sed 's/[\\\\&|]/\\\\&/g'`;; #( - *) ac_sed_conf_input=$configure_input;; - esac case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } ;; + *:-:* | *:-) cat >"$tmp/stdin";; esac ;; esac @@ -10254,7 +9603,7 @@ $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$ac_file" | +echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -10280,7 +9629,7 @@ $as_echo X"$ac_file" | as_dirs= while :; do case $as_dir in #( - *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( + *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" @@ -10289,7 +9638,7 @@ $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -$as_echo X"$as_dir" | +echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q @@ -10310,17 +9659,17 @@ $as_echo X"$as_dir" | test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { $as_echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -$as_echo "$as_me: error: cannot create directory $as_dir" >&2;} + } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 +echo "$as_me: error: cannot create directory $as_dir" >&2;} { (exit 1); exit 1; }; }; } ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) - ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` + ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` + ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; @@ -10360,13 +9709,12 @@ ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix esac _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= -ac_sed_dataroot=' -/datarootdir/ { +case `sed -n '/datarootdir/ { p q } @@ -10375,14 +9723,13 @@ ac_sed_dataroot=' /@infodir@/p /@localedir@/p /@mandir@/p -' -case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in +' $ac_file_inputs` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { $as_echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -$as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} + { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 +echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<_ACEOF ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g @@ -10396,16 +9743,15 @@ _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 -ac_sed_extra="$ac_vpsub +cat >>$CONFIG_STATUS <<_ACEOF + sed "$ac_vpsub $extrasub _ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 +cat >>$CONFIG_STATUS <<\_ACEOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s|@configure_input@|$ac_sed_conf_input|;t t +s&@configure_input@&$configure_input&;t t s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t @@ -10415,94 +9761,146 @@ s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t $ac_datarootdir_hack -" -eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$tmp/subs.awk" >$tmp/out \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } +" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { $as_echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' + { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&5 -$as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' +echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined." >&2;} rm -f "$tmp/stdin" case $ac_file in - -) cat "$tmp/out" && rm -f "$tmp/out";; - *) rm -f "$ac_file" && mv "$tmp/out" "$ac_file";; - esac \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + -) cat "$tmp/out"; rm -f "$tmp/out";; + *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; + esac ;; :H) # # CONFIG_HEADER # +_ACEOF + +# Transform confdefs.h into a sed script `conftest.defines', that +# substitutes the proper values into config.h.in to produce config.h. +rm -f conftest.defines conftest.tail +# First, append a space to every undef/define line, to ease matching. +echo 's/$/ /' >conftest.defines +# Then, protect against being on the right side of a sed subst, or in +# an unquoted here document, in config.status. If some macros were +# called several times there might be several #defines for the same +# symbol, which is useless. But do not sort them, since the last +# AC_DEFINE must be honored. +ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* +# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where +# NAME is the cpp macro being defined, VALUE is the value it is being given. +# PARAMS is the parameter list in the macro definition--in most cases, it's +# just an empty string. +ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' +ac_dB='\\)[ (].*,\\1define\\2' +ac_dC=' ' +ac_dD=' ,' + +uniq confdefs.h | + sed -n ' + t rset + :rset + s/^[ ]*#[ ]*define[ ][ ]*// + t ok + d + :ok + s/[\\&,]/\\&/g + s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p + s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p + ' >>conftest.defines + +# Remove the space that was appended to ease matching. +# Then replace #undef with comments. This is necessary, for +# example, in the case of _POSIX_SOURCE, which is predefined and required +# on some systems where configure will not decide to define it. +# (The regexp can be short, since the line contains either #define or #undef.) +echo 's/ $// +s,^[ #]*u.*,/* & */,' >>conftest.defines + +# Break up conftest.defines: +ac_max_sed_lines=50 + +# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" +# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" +# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" +# et cetera. +ac_in='$ac_file_inputs' +ac_out='"$tmp/out1"' +ac_nxt='"$tmp/out2"' + +while : +do + # Write a here document: + cat >>$CONFIG_STATUS <<_ACEOF + # First, check the format of the line: + cat >"\$tmp/defines.sed" <<\\CEOF +/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def +/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def +b +:def +_ACEOF + sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS + echo 'CEOF + sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS + ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in + sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail + grep . conftest.tail >/dev/null || break + rm -f conftest.defines + mv conftest.tail conftest.defines +done +rm -f conftest.defines conftest.tail + +echo "ac_result=$ac_in" >>$CONFIG_STATUS +cat >>$CONFIG_STATUS <<\_ACEOF if test x"$ac_file" != x-; then - { - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" - } >"$tmp/config.h" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } - if diff "$ac_file" "$tmp/config.h" >/dev/null 2>&1; then - { $as_echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -$as_echo "$as_me: $ac_file is unchanged" >&6;} + echo "/* $configure_input */" >"$tmp/config.h" + cat "$ac_result" >>"$tmp/config.h" + if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then + { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +echo "$as_me: $ac_file is unchanged" >&6;} else - rm -f "$ac_file" - mv "$tmp/config.h" "$ac_file" \ - || { { $as_echo "$as_me:$LINENO: error: could not create $ac_file" >&5 -$as_echo "$as_me: error: could not create $ac_file" >&2;} - { (exit 1); exit 1; }; } + rm -f $ac_file + mv "$tmp/config.h" $ac_file fi else - $as_echo "/* $configure_input */" \ - && eval '$AWK -f "$tmp/defines.awk"' "$ac_file_inputs" \ - || { { $as_echo "$as_me:$LINENO: error: could not create -" >&5 -$as_echo "$as_me: error: could not create -" >&2;} - { (exit 1); exit 1; }; } + echo "/* $configure_input */" + cat "$ac_result" fi + rm -f "$tmp/out12" ;; :L) # # CONFIG_LINK # - if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then - : - else - # Prefer the file from the source tree if names are identical. - if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then - ac_source=$srcdir/$ac_source - fi + { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} - { $as_echo "$as_me:$LINENO: linking $ac_source to $ac_file" >&5 -$as_echo "$as_me: linking $ac_source to $ac_file" >&6;} - - if test ! -r "$ac_source"; then - { { $as_echo "$as_me:$LINENO: error: $ac_source: file not found" >&5 -$as_echo "$as_me: error: $ac_source: file not found" >&2;} - { (exit 1); exit 1; }; } - fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $srcdir in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$ac_source" "$ac_file" 2>/dev/null || - cp -p "$ac_source" "$ac_file" || - { { $as_echo "$as_me:$LINENO: error: cannot link or copy $ac_source to $ac_file" >&5 -$as_echo "$as_me: error: cannot link or copy $ac_source to $ac_file" >&2;} + if test ! -r "$srcdir/$ac_source"; then + { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 +echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} { (exit 1); exit 1; }; } fi + rm -f "$ac_file" + + # Try a relative symlink, then a hard link, then a copy. + case $srcdir in + [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; + *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; + esac + ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || + ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || + cp -p "$srcdir/$ac_source" "$ac_file" || + { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 +echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} + { (exit 1); exit 1; }; } ;; esac @@ -10520,11 +9918,6 @@ _ACEOF chmod +x $CONFIG_STATUS ac_clean_files=$ac_clean_files_save -test $ac_write_fail = 0 || - { { $as_echo "$as_me:$LINENO: error: write failure creating $CONFIG_STATUS" >&5 -$as_echo "$as_me: error: write failure creating $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. @@ -10546,8 +9939,4 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then - { $as_echo "$as_me:$LINENO: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 -$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} -fi From 8a7e1a145f2c7065d62a31d8aac673f4f51b055a Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 5 Apr 2009 15:34:30 +0000 Subject: [PATCH 0605/1707] 2009-04-05 Vladimir Serbinenko Trim trailing spaces in FAT label and support mtools-like labels * fs/fat.c (grub_fat_iterate_dir): New function based on grub_fat_find_dir (grub_fat_find_dir): use grub_fat_iterate_dir (grub_fat_label): likewise --- ChangeLog | 9 ++ fs/fat.c | 241 +++++++++++++++++++++++++++--------------------------- 2 files changed, 129 insertions(+), 121 deletions(-) diff --git a/ChangeLog b/ChangeLog index 538e775a7..07e9635ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-05 Vladimir Serbinenko + + Trim trailing spaces in FAT label and support mtools-like labels + + * fs/fat.c (grub_fat_iterate_dir): New function based + on grub_fat_find_dir + (grub_fat_find_dir): use grub_fat_iterate_dir + (grub_fat_label): likewise + 2009-04-04 Vladimir Serbinenko * conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): add list.h diff --git a/fs/fat.c b/fs/fat.c index acaa0274b..d9b0fe13d 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -45,7 +45,8 @@ | GRUB_FAT_ATTR_HIDDEN \ | GRUB_FAT_ATTR_SYSTEM \ | GRUB_FAT_ATTR_DIRECTORY \ - | GRUB_FAT_ATTR_ARCHIVE) + | GRUB_FAT_ATTR_ARCHIVE \ + | GRUB_FAT_ATTR_VOLUME_ID) struct grub_fat_bpb { @@ -467,50 +468,20 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, return ret; } -/* Find the underlying directory or file in PATH and return the - next path. If there is no next path or an error occurs, return NULL. - If HOOK is specified, call it with each file name. */ -static char * -grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, - const char *path, - int (*hook) (const char *filename, int dir)) +static grub_err_t +grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, + int (*hook) (const char *filename, + struct grub_fat_dir_entry *dir)) { struct grub_fat_dir_entry dir; - char *dirname, *dirp; char *filename, *filep = 0; grub_uint16_t *unibuf; int slot = -1, slots = -1; int checksum = -1; grub_ssize_t offset = -sizeof(dir); - int call_hook; if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY)) - { - grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); - return 0; - } - - /* Extract a directory name. */ - while (*path == '/') - path++; - - dirp = grub_strchr (path, '/'); - if (dirp) - { - unsigned len = dirp - path; - - dirname = grub_malloc (len + 1); - if (! dirname) - return 0; - - grub_memcpy (dirname, path, len); - dirname[len] = '\0'; - } - else - /* This is actually a file. */ - dirname = grub_strdup (path); - - call_hook = (! dirp && hook); + return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); /* Allocate space enough to hold a long name. */ filename = grub_malloc (0x40 * 13 * 4 + 1); @@ -519,7 +490,6 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, { grub_free (filename); grub_free (unibuf); - grub_free (dirname); return 0; } @@ -533,15 +503,8 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, /* Read a directory entry. */ if ((grub_fat_read_data (disk, data, 0, offset, sizeof (dir), (char *) &dir) - != sizeof (dir)) - || dir.name[0] == 0) - { - if (grub_errno == GRUB_ERR_NONE && ! call_hook) - grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); - - break; - } - + != sizeof (dir) || dir.name[0] == 0)) + break; /* Handle long name entries. */ if (dir.attr == GRUB_FAT_ATTR_LONG_NAME) { @@ -594,22 +557,11 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, *grub_utf16_to_utf8 ((grub_uint8_t *) filename, unibuf, slots * 13) = '\0'; - if (*dirname == '\0' && call_hook) - { - if (hook (filename, dir.attr & GRUB_FAT_ATTR_DIRECTORY)) - break; - - checksum = -1; - continue; - } - - if (grub_strcmp (dirname, filename) == 0) - { - if (call_hook) - hook (filename, dir.attr & GRUB_FAT_ATTR_DIRECTORY); - - break; - } + if (hook (filename, &dir)) + break; + + checksum = -1; + continue; } checksum = -1; @@ -617,44 +569,109 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, /* Convert the 8.3 file name. */ filep = filename; + if (dir.attr & GRUB_FAT_ATTR_VOLUME_ID) + { + for (i = 0; i < sizeof (dir.name) && dir.name[i] + && ! grub_isspace (dir.name[i]); i++) + *filep++ = dir.name[i]; + } + else + { + for (i = 0; i < 8 && dir.name[i] && ! grub_isspace (dir.name[i]); i++) + *filep++ = grub_tolower (dir.name[i]); - for (i = 0; i < 8 && dir.name[i] && ! grub_isspace (dir.name[i]); i++) - *filep++ = grub_tolower (dir.name[i]); - - *filep = '.'; - - for (i = 8; i < 11 && dir.name[i] && ! grub_isspace (dir.name[i]); i++) - *++filep = grub_tolower (dir.name[i]); + *filep = '.'; + + for (i = 8; i < 11 && dir.name[i] && ! grub_isspace (dir.name[i]); i++) + *++filep = grub_tolower (dir.name[i]); - if (*filep != '.') - filep++; - + if (*filep != '.') + filep++; + } *filep = '\0'; - if (*dirname == '\0' && call_hook) - { - if (hook (filename, dir.attr & GRUB_FAT_ATTR_DIRECTORY)) - break; - } - else if (grub_strncasecmp (dirname, filename, GRUB_FAT_MAXFILE) == 0) - { - if (call_hook) - hook (filename, dir.attr & GRUB_FAT_ATTR_DIRECTORY); - - break; - } + if (hook (filename, &dir)) + break; } grub_free (filename); + + return grub_errno; +} + + +/* Find the underlying directory or file in PATH and return the + next path. If there is no next path or an error occurs, return NULL. + If HOOK is specified, call it with each file name. */ +static char * +grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, + const char *path, + int (*hook) (const char *filename, int dir)) +{ + char *dirname, *dirp; + int call_hook; + int found = 0; + + auto int iter_hook (const char *filename, struct grub_fat_dir_entry *dir); + int iter_hook (const char *filename, struct grub_fat_dir_entry *dir) + { + if (dir->attr & GRUB_FAT_ATTR_VOLUME_ID) + return 0; + if (*dirname == '\0' && call_hook) + return hook (filename, dir->attr & GRUB_FAT_ATTR_DIRECTORY); + + if (grub_strcasecmp (dirname, filename) == 0) + { + found = 1; + data->attr = dir->attr; + data->file_size = grub_le_to_cpu32 (dir->file_size); + data->file_cluster = ((grub_le_to_cpu16 (dir->first_cluster_high) << 16) + | grub_le_to_cpu16 (dir->first_cluster_low)); + data->cur_cluster_num = ~0U; + + if (call_hook) + hook (filename, dir->attr & GRUB_FAT_ATTR_DIRECTORY); + + return 1; + } + return 0; + } + + if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY)) + { + grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); + return 0; + } + + /* Extract a directory name. */ + while (*path == '/') + path++; + + dirp = grub_strchr (path, '/'); + if (dirp) + { + unsigned len = dirp - path; + + dirname = grub_malloc (len + 1); + if (! dirname) + return 0; + + grub_memcpy (dirname, path, len); + dirname[len] = '\0'; + } + else + /* This is actually a file. */ + dirname = grub_strdup (path); + + call_hook = (! dirp && hook); + + grub_fat_iterate_dir (disk, data, iter_hook); + if (grub_errno == GRUB_ERR_NONE && ! found && !call_hook) + grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); + grub_free (dirname); - data->attr = dir.attr; - data->file_size = grub_le_to_cpu32 (dir.file_size); - data->file_cluster = ((grub_le_to_cpu16 (dir.first_cluster_high) << 16) - | grub_le_to_cpu16 (dir.first_cluster_low)); - data->cur_cluster_num = ~0U; - - return dirp; + return found ? dirp : 0; } static grub_err_t @@ -773,8 +790,17 @@ grub_fat_label (grub_device_t device, char **label) { struct grub_fat_data *data; grub_disk_t disk = device->disk; - grub_ssize_t offset = -sizeof(struct grub_fat_dir_entry); + auto int iter_hook (const char *filename, struct grub_fat_dir_entry *dir); + int iter_hook (const char *filename, struct grub_fat_dir_entry *dir) + { + if (dir->attr == GRUB_FAT_ATTR_VOLUME_ID) + { + *label = grub_strdup (filename); + return 1; + } + return 0; + } #ifndef GRUB_UTIL grub_dl_ref (my_mod); @@ -790,37 +816,10 @@ grub_fat_label (grub_device_t device, char **label) return 0; } - while (1) - { - struct grub_fat_dir_entry dir; - - /* Adjust the offset. */ - offset += sizeof (dir); - - /* Read a directory entry. */ - if ((grub_fat_read_data (disk, data, 0, - offset, sizeof (dir), (char *) &dir) - != sizeof (dir)) - || dir.name[0] == 0) - { - if (grub_errno != GRUB_ERR_NONE) - goto fail; - else - { - *label = 0; - return GRUB_ERR_NONE; - } - } - - if (dir.attr == GRUB_FAT_ATTR_VOLUME_ID) - { - *label = grub_strndup ((char *) dir.name, 11); - return GRUB_ERR_NONE; - } - } - *label = 0; + grub_fat_iterate_dir (disk, data, iter_hook); + fail: #ifndef GRUB_UTIL From 05aaebfb7bc7150ce3113c621e7d65cf5ccb946d Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 5 Apr 2009 20:19:05 +0000 Subject: [PATCH 0606/1707] 2009-04-05 Vladimir Serbinenko Support for mtime and further expandability of dir command * include/grub/lib/datetime.h: moved to ... * include/grub/datetime.h: ... moved here and added declaration of grub_unixtime2datetime. All users updated * include/grub/fs.h: new syntax for dir and mtime functionin struct grub_fs * include/grub/fshelp.h: new declarations of GRUB_FSHELP_TYPE_MASK and GRUB_FSHELP_FLAGS_MASK * commands/ls.c (grub_ls_list_files): Write mtime in long format * fs/ext2.c (grub_ext2_dir): use new dir syntax and supply mtime (grub_ext2_mtime): new function * fs/hfsplus.c (grub_hfsplus_dir): use new dir syntax and supply mtime (grub_hfsplus_mtime): new function * fs/ufs.c (GRUB_UFS_ATTR_TYPE): new definition (GRUB_UFS_ATTR_FILE): likewise (GRUB_UFS_ATTR_LNK): likewise (struct grub_ufs_sblock): new fields mtime (grub_ufs_read_inode): new parameter to read inode to a separate buffer all users updated (grub_ufs_dir): mtime support (grub_ufs_mtime): new function * fs/affs.c (grub_affs_dir): use new dir syntax * fs/afs.c (grub_afs_dir): likewise * fs/cpio.c (grub_cpio_dir): likewise * fs/fat.c (grub_fat_find_dir): likewise * fs/hfs.c (grub_hfs_dir): likewise * fs/iso9660.c (grub_iso9660_dir): likewise * fs/jfs.c (grub_jfs_dir): likewise * fs/minix.c (grub_minix_dir): likewise * fs/ntfs.c (grub_ntfs_dir): likewise * fs/reiserfs.c (grub_reiserfs_dir): likewise * fs/sfs.c (grub_sfs_dir): likewise * fs/xfs.c (grub_xfs_dir): likewise * util/hostfs.c (grub_hostfs_dir): likewise * lib/datetime.c: moved to ... * normal/datetime.c: ... moved here (grub_unixtime2datetime): new function * kern/rescue.c (grub_rescue_print_files): use new dir syntax * normal/completition.c (iterate_dir): use new dir syntax * normal/misc.c (grub_normal_print_device_info): tell the last modification time of a volume * kern/fs.c (grub_fs_probe): updated dummy function to use new syntax * conf/common.rmk: added lib/datetime.c to ls.mod * conf/i386-coreboot.rmk (grub_emu_SOURCES): add normal/datetime.c (normal_mod_SOURCES): likewise (datetime_mod_SOURCES): Removed lib/datetime.c * conf/i386-efi.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise * conf/x86_64-efi.rmk: likewise --- ChangeLog | 56 +++++++++++++++++ DISTLIST | 2 + commands/date.c | 2 +- commands/ls.c | 42 +++++++++---- conf/i386-coreboot.mk | 73 ++++++++++++----------- conf/i386-coreboot.rmk | 7 ++- conf/i386-efi.mk | 61 +++++++++---------- conf/i386-efi.rmk | 7 ++- conf/i386-ieee1275.mk | 73 ++++++++++++----------- conf/i386-ieee1275.rmk | 7 ++- conf/i386-pc.mk | 73 ++++++++++++----------- conf/i386-pc.rmk | 7 ++- conf/powerpc-ieee1275.mk | 43 +++++++++---- conf/powerpc-ieee1275.rmk | 4 +- conf/sparc64-ieee1275.mk | 31 ++++++++-- conf/sparc64-ieee1275.rmk | 4 +- conf/x86_64-efi.mk | 61 +++++++++---------- conf/x86_64-efi.rmk | 7 ++- fs/affs.c | 14 ++--- fs/afs.c | 14 ++--- fs/cpio.c | 9 ++- fs/ext2.c | 56 ++++++++++++++--- fs/fat.c | 16 +++-- fs/hfs.c | 15 +++-- fs/hfsplus.c | 60 +++++++++++++++---- fs/iso9660.c | 14 ++--- fs/jfs.c | 12 ++-- fs/minix.c | 11 +++- fs/ntfs.c | 16 +++-- fs/reiserfs.c | 12 ++-- fs/sfs.c | 14 ++--- fs/udf.c | 16 +++-- fs/ufs.c | 116 ++++++++++++++++++++++++++++-------- fs/xfs.c | 14 ++--- hook/datehook.c | 2 +- include/grub/datetime.h | 48 +++++++++++++++ include/grub/fs.h | 14 ++++- include/grub/fshelp.h | 2 + include/grub/lib/datetime.h | 44 -------------- kern/corecmd.c | 5 +- kern/fs.c | 5 +- lib/datetime.c | 49 --------------- lib/efi/datetime.c | 2 +- lib/i386/datetime.c | 2 +- normal/completion.c | 4 +- normal/datetime.c | 100 +++++++++++++++++++++++++++++++ normal/misc.c | 18 ++++++ util/hostfs.c | 13 ++-- 48 files changed, 834 insertions(+), 443 deletions(-) create mode 100644 include/grub/datetime.h create mode 100644 normal/datetime.c diff --git a/ChangeLog b/ChangeLog index 07e9635ca..2da401be5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,59 @@ +2009-04-05 Vladimir Serbinenko + + Support for mtime and further expandability of dir command + + * include/grub/lib/datetime.h: moved to ... + * include/grub/datetime.h: ... moved here and added + declaration of grub_unixtime2datetime. All users updated + * include/grub/fs.h: new syntax for dir and mtime functionin + struct grub_fs + * include/grub/fshelp.h: new declarations of GRUB_FSHELP_TYPE_MASK + and GRUB_FSHELP_FLAGS_MASK + * commands/ls.c (grub_ls_list_files): Write mtime in long format + * fs/ext2.c (grub_ext2_dir): use new dir syntax and supply mtime + (grub_ext2_mtime): new function + * fs/hfsplus.c (grub_hfsplus_dir): use new dir syntax and supply mtime + (grub_hfsplus_mtime): new function + * fs/ufs.c (GRUB_UFS_ATTR_TYPE): new definition + (GRUB_UFS_ATTR_FILE): likewise + (GRUB_UFS_ATTR_LNK): likewise + (struct grub_ufs_sblock): new fields mtime + (grub_ufs_read_inode): new parameter to read inode to a separate buffer + all users updated + (grub_ufs_dir): mtime support + (grub_ufs_mtime): new function + * fs/affs.c (grub_affs_dir): use new dir syntax + * fs/afs.c (grub_afs_dir): likewise + * fs/cpio.c (grub_cpio_dir): likewise + * fs/fat.c (grub_fat_find_dir): likewise + * fs/hfs.c (grub_hfs_dir): likewise + * fs/iso9660.c (grub_iso9660_dir): likewise + * fs/jfs.c (grub_jfs_dir): likewise + * fs/minix.c (grub_minix_dir): likewise + * fs/ntfs.c (grub_ntfs_dir): likewise + * fs/reiserfs.c (grub_reiserfs_dir): likewise + * fs/sfs.c (grub_sfs_dir): likewise + * fs/xfs.c (grub_xfs_dir): likewise + * util/hostfs.c (grub_hostfs_dir): likewise + * lib/datetime.c: moved to ... + * normal/datetime.c: ... moved here + (grub_unixtime2datetime): new function + * kern/rescue.c (grub_rescue_print_files): use new dir syntax + * normal/completition.c (iterate_dir): use new dir syntax + * normal/misc.c (grub_normal_print_device_info): tell the + last modification time of a volume + * kern/fs.c (grub_fs_probe): updated dummy function to use new syntax + * conf/common.rmk: added lib/datetime.c to ls.mod + * conf/i386-coreboot.rmk (grub_emu_SOURCES): add normal/datetime.c + (normal_mod_SOURCES): likewise + (datetime_mod_SOURCES): Removed lib/datetime.c + * conf/i386-efi.rmk: likewise + * conf/i386-ieee1275.rmk: likewise + * conf/i386-pc.rmk: likewise + * conf/powerpc-ieee1275.rmk: likewise + * conf/sparc64-ieee1275.rmk: likewise + * conf/x86_64-efi.rmk: likewise + 2009-04-05 Vladimir Serbinenko Trim trailing spaces in FAT label and support mtools-like labels diff --git a/DISTLIST b/DISTLIST index 6b1f798d7..82a661000 100644 --- a/DISTLIST +++ b/DISTLIST @@ -148,6 +148,7 @@ include/grub/boot.h include/grub/bufio.h include/grub/cache.h include/grub/command.h +include/grub/datetime.h include/grub/device.h include/grub/disk.h include/grub/dl.h @@ -406,6 +407,7 @@ normal/cmdline.c normal/color.c normal/command.c normal/completion.c +normal/datetime.c normal/execute.c normal/function.c normal/lexer.c diff --git a/commands/date.c b/commands/date.c index 27010e91e..a8f19b305 100644 --- a/commands/date.c +++ b/commands/date.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include #define GRUB_DATETIME_SET_YEAR 1 diff --git a/commands/ls.c b/commands/ls.c index 40fceeb7f..8e4d2a285 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -29,6 +29,7 @@ #include #include #include +#include static const struct grub_arg_option options[] = { @@ -68,25 +69,29 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) grub_fs_t fs; const char *path; grub_device_t dev; - auto int print_files (const char *filename, int dir); - auto int print_files_long (const char *filename, int dir); + + auto int print_files (const char *filename, + const struct grub_dirhook_info *info); + auto int print_files_long (const char *filename, + const struct grub_dirhook_info *info); - int print_files (const char *filename, int dir) + int print_files (const char *filename, const struct grub_dirhook_info *info) { if (all || filename[0] != '.') - grub_printf ("%s%s ", filename, dir ? "/" : ""); + grub_printf ("%s%s ", filename, info->dir ? "/" : ""); return 0; } - int print_files_long (const char *filename, int dir) + int print_files_long (const char *filename, + const struct grub_dirhook_info *info) { char pathname[grub_strlen (dirname) + grub_strlen (filename) + 1]; if ((! all) && (filename[0] == '.')) return 0; - if (! dir) + if (! info->dir) { grub_file_t file; @@ -138,7 +143,23 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) else grub_printf ("%-12s", "DIR"); - grub_printf ("%s%s\n", filename, dir ? "/" : ""); + if (info->mtimeset) + { + struct grub_datetime datetime; + grub_unixtime2datetime (info->mtime, &datetime); + if (human) + grub_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ", + datetime.year, datetime.month, datetime.day, + datetime.hour, datetime.minute, + datetime.second, + grub_get_weekday_name (&datetime)); + else + grub_printf (" %04d%02d%02d%02d%02d%02d ", + datetime.year, datetime.month, + datetime.day, datetime.hour, + datetime.minute, datetime.second); + } + grub_printf ("%s%s\n", filename, info->dir ? "/" : ""); return 0; } @@ -181,7 +202,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) /* PATH might be a regular file. */ char *p; grub_file_t file; - + struct grub_dirhook_info info; grub_errno = 0; file = grub_file_open (dirname); @@ -196,10 +217,11 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) goto fail; all = 1; + grub_memset (&info, 0, sizeof (info)); if (longlist) - print_files_long (p, 0); + print_files_long (p, &info); else - print_files (p, 0); + print_files (p, &info); grub_free (dirname); } diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 2ea7ec4cb..09e2bcfca 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -225,7 +225,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/main.c normal/menu_text.c \ + normal/completion.c normal/datetime.c normal/main.c \ + normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ normal/color.c \ @@ -238,11 +239,11 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_datetime.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -500,6 +501,10 @@ grub_emu-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDEN $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_completion.d +grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_datetime.d + grub_emu-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_main.d @@ -697,7 +702,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -705,12 +710,12 @@ normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -719,9 +724,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -795,6 +800,25 @@ partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completio set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_datetime.d + +CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst +COMMANDFILES += cmd-normal_mod-normal_datetime.lst +FSFILES += fs-normal_mod-normal_datetime.lst +PARTMAPFILES += partmap-normal_mod-normal_datetime.lst + +cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -1736,13 +1760,13 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst +datetime_mod_SOURCES = lib/i386/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst ifneq ($(datetime_mod_EXPORTS),no) CLEANFILES += def-datetime.lst DEFSYMFILES += def-datetime.lst endif -MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_i386_datetime.d +MOSTLYCLEANFILES += datetime_mod-lib_i386_datetime.d UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) @@ -1751,9 +1775,9 @@ datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_i386_datetime.o -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_i386_datetime.o mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< @@ -1770,25 +1794,6 @@ und-datetime.lst: pre-datetime.o echo 'datetime' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_datetime.lst -FSFILES += fs-datetime_mod-lib_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst - -cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< -include datetime_mod-lib_i386_datetime.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 53595de8a..422107e28 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -76,7 +76,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/main.c normal/menu_text.c \ + normal/completion.c normal/datetime.c normal/main.c \ + normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ normal/color.c \ @@ -116,7 +117,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -184,7 +185,7 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +datetime_mod_SOURCES = lib/i386/datetime.c datetime_mod_CFLAGS = $(COMMON_CFLAGS) datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 7a71520a7..13bc1bc31 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -85,7 +85,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ + normal/function.c \ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -819,7 +820,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -827,12 +828,12 @@ normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -841,9 +842,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -917,6 +918,25 @@ partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completio set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_datetime.d + +CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst +COMMANDFILES += cmd-normal_mod-normal_datetime.lst +FSFILES += fs-normal_mod-normal_datetime.lst +PARTMAPFILES += partmap-normal_mod-normal_datetime.lst + +cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -1568,13 +1588,13 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst +datetime_mod_SOURCES = lib/efi/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst ifneq ($(datetime_mod_EXPORTS),no) CLEANFILES += def-datetime.lst DEFSYMFILES += def-datetime.lst endif -MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_efi_datetime.d +MOSTLYCLEANFILES += datetime_mod-lib_efi_datetime.d UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) @@ -1583,9 +1603,9 @@ datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_efi_datetime.o -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_efi_datetime.o mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< @@ -1602,25 +1622,6 @@ und-datetime.lst: pre-datetime.o echo 'datetime' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_datetime.lst -FSFILES += fs-datetime_mod-lib_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst - -cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< -include datetime_mod-lib_efi_datetime.d diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 18a99df7e..4fc0ea47a 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -52,7 +52,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ + normal/function.c \ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -120,7 +121,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -168,7 +169,7 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c +datetime_mod_SOURCES = lib/efi/datetime.c datetime_mod_CFLAGS = $(COMMON_CFLAGS) datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk index 7b5a91589..8c65e3bfd 100644 --- a/conf/i386-ieee1275.mk +++ b/conf/i386-ieee1275.mk @@ -224,7 +224,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ + normal/function.c\ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ @@ -238,11 +239,11 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -500,6 +501,10 @@ grub_emu-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_command.d +grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_datetime.d + grub_emu-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_function.d @@ -650,7 +655,7 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -658,12 +663,12 @@ normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -672,9 +677,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -748,6 +753,25 @@ partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completio set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_datetime.d + +CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst +COMMANDFILES += cmd-normal_mod-normal_datetime.lst +FSFILES += fs-normal_mod-normal_datetime.lst +PARTMAPFILES += partmap-normal_mod-normal_datetime.lst + +cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -1688,13 +1712,13 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst +datetime_mod_SOURCES = lib/i386/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst ifneq ($(datetime_mod_EXPORTS),no) CLEANFILES += def-datetime.lst DEFSYMFILES += def-datetime.lst endif -MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_i386_datetime.d +MOSTLYCLEANFILES += datetime_mod-lib_i386_datetime.d UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) @@ -1703,9 +1727,9 @@ datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_i386_datetime.o -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_i386_datetime.o mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< @@ -1722,25 +1746,6 @@ und-datetime.lst: pre-datetime.o echo 'datetime' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_datetime.lst -FSFILES += fs-datetime_mod-lib_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst - -cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< -include datetime_mod-lib_i386_datetime.d diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index a84b5aa97..96d9c1014 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -75,7 +75,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ + normal/function.c\ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ @@ -113,7 +114,7 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -185,7 +186,7 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +datetime_mod_SOURCES = lib/i386/datetime.c datetime_mod_CFLAGS = $(COMMON_CFLAGS) datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 09bc0b1cf..0332306a7 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -551,7 +551,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ + normal/function.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -571,11 +572,11 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -765,6 +766,10 @@ grub_emu-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_command.d +grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_datetime.d + grub_emu-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_function.d @@ -1254,7 +1259,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -1263,12 +1268,12 @@ normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_datetime.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -1277,9 +1282,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -1334,6 +1339,25 @@ partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPEN set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_datetime.d + +CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst +COMMANDFILES += cmd-normal_mod-normal_datetime.lst +FSFILES += fs-normal_mod-normal_datetime.lst +PARTMAPFILES += partmap-normal_mod-normal_datetime.lst + +cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d @@ -3093,13 +3117,13 @@ pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst +datetime_mod_SOURCES = lib/i386/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst ifneq ($(datetime_mod_EXPORTS),no) CLEANFILES += def-datetime.lst DEFSYMFILES += def-datetime.lst endif -MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_i386_datetime.d +MOSTLYCLEANFILES += datetime_mod-lib_i386_datetime.d UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) @@ -3108,9 +3132,9 @@ datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_i386_datetime.o -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_i386_datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_i386_datetime.o mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< @@ -3127,25 +3151,6 @@ und-datetime.lst: pre-datetime.o echo 'datetime' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_datetime.lst -FSFILES += fs-datetime_mod-lib_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst - -cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< -include datetime_mod-lib_i386_datetime.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 7fa19757f..1e9d65f14 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -128,7 +128,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c \ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ + normal/function.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ @@ -203,7 +204,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -338,7 +339,7 @@ pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/i386/datetime.c +datetime_mod_SOURCES = lib/i386/datetime.c datetime_mod_CFLAGS = $(COMMON_CFLAGS) datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index efd249e37..828ef96a8 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -72,7 +72,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ - lib/arg.c normal/cmdline.c normal/command.c \ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -88,11 +88,11 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -326,6 +326,10 @@ grub_emu-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_command.d +grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-normal_datetime.d + grub_emu-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-normal_completion.d @@ -705,7 +709,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -714,12 +718,12 @@ normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/powerpc/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_datetime.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -728,9 +732,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -785,6 +789,25 @@ partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPEN set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_datetime.d + +CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst +COMMANDFILES += cmd-normal_mod-normal_datetime.lst +FSFILES += fs-normal_mod-normal_datetime.lst +PARTMAPFILES += partmap-normal_mod-normal_datetime.lst + +cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 9ba298176..b62c7a10f 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -57,7 +57,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ - lib/arg.c normal/cmdline.c normal/command.c \ + lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ @@ -126,7 +126,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index dc096919a..90963647e 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -57,7 +57,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ # kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ # kern/list.c kern/handler.c \ -# normal/arg.c normal/cmdline.c normal/command.c \ +# normal/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ # normal/main.c normal/menu.c normal/menu_entry.c \ @@ -793,7 +793,7 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/datetime.c normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -801,12 +801,12 @@ normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/sparc64/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_datetime.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -815,9 +815,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -891,6 +891,25 @@ partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPEN set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_datetime.d + +CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst +COMMANDFILES += cmd-normal_mod-normal_datetime.lst +FSFILES += fs-normal_mod-normal_datetime.lst +PARTMAPFILES += partmap-normal_mod-normal_datetime.lst + +cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_completion.d diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 1658a66bb..bc563aa22 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -56,7 +56,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ # kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ # kern/list.c kern/handler.c \ -# normal/arg.c normal/cmdline.c normal/command.c \ +# normal/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ # normal/completion.c normal/context.c normal/execute.c \ # normal/function.c normal/lexer.c \ # normal/main.c normal/menu.c normal/menu_entry.c \ @@ -166,7 +166,7 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/datetime.c normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index c745deb55..d79eb168f 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -74,7 +74,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/context.c normal/main.c \ + normal/completion.c normal/datetime.c normal/context.c \ + normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ normal/misc.c normal/script.c \ @@ -827,7 +828,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -835,12 +836,12 @@ normal_mod_SOURCES = normal/cmdline.c normal/command.c \ normal/misc.c grub_script.tab.c \ normal/script.c \ normal/x86_64/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst +CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst ifneq ($(normal_mod_EXPORTS),no) CLEANFILES += def-normal.lst DEFSYMFILES += def-normal.lst endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d +MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d UNDSYMFILES += und-normal.lst normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) @@ -849,9 +850,9 @@ normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o +pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o + $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o mod-normal.o: mod-normal.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< @@ -925,6 +926,25 @@ partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completio set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) +normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< +-include normal_mod-normal_datetime.d + +CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst +COMMANDFILES += cmd-normal_mod-normal_datetime.lst +FSFILES += fs-normal_mod-normal_datetime.lst +PARTMAPFILES += partmap-normal_mod-normal_datetime.lst + +cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) + +fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) + +partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) + + normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< -include normal_mod-normal_execute.d @@ -1576,13 +1596,13 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst +datetime_mod_SOURCES = lib/efi/datetime.c +CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst ifneq ($(datetime_mod_EXPORTS),no) CLEANFILES += def-datetime.lst DEFSYMFILES += def-datetime.lst endif -MOSTLYCLEANFILES += datetime_mod-lib_datetime.d datetime_mod-lib_efi_datetime.d +MOSTLYCLEANFILES += datetime_mod-lib_efi_datetime.d UNDSYMFILES += und-datetime.lst datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) @@ -1591,9 +1611,9 @@ datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o +pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_efi_datetime.o -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_datetime.o datetime_mod-lib_efi_datetime.o + $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_efi_datetime.o mod-datetime.o: mod-datetime.c $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< @@ -1610,25 +1630,6 @@ und-datetime.lst: pre-datetime.o echo 'datetime' > $@ $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ -datetime_mod-lib_datetime.o: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_datetime.lst fs-datetime_mod-lib_datetime.lst partmap-datetime_mod-lib_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_datetime.lst -FSFILES += fs-datetime_mod-lib_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_datetime.lst - -cmd-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_datetime.lst: lib/datetime.c $(lib/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< -include datetime_mod-lib_efi_datetime.d diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index faa59fb47..8360e2e19 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -55,7 +55,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/context.c normal/main.c \ + normal/completion.c normal/datetime.c normal/context.c \ + normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ normal/misc.c normal/script.c \ @@ -123,7 +124,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ @@ -171,7 +172,7 @@ lspci_mod_CFLAGS = $(COMMON_CFLAGS) lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) # For datetime.mod -datetime_mod_SOURCES = lib/datetime.c lib/efi/datetime.c +datetime_mod_SOURCES = lib/efi/datetime.c datetime_mod_CFLAGS = $(COMMON_CFLAGS) datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/fs/affs.c b/fs/affs.c index bc7bc218b..4ddc347c8 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -456,7 +456,8 @@ grub_affs_read (grub_file_t file, char *buf, grub_size_t len) static grub_err_t grub_affs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_affs_data *data = 0; struct grub_fshelp_node *fdiro = 0; @@ -469,14 +470,11 @@ grub_affs_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + return hook (filename, &info); } #ifndef GRUB_UTIL diff --git a/fs/afs.c b/fs/afs.c index 3f7efa767..90d88644a 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -562,7 +562,8 @@ grub_afs_close (grub_file_t file) static grub_err_t grub_afs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_afs_data *data = 0;; struct grub_fshelp_node *fdiro = 0; @@ -575,14 +576,11 @@ grub_afs_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + return hook (filename, &info); } #ifndef GRUB_UTIL diff --git a/fs/cpio.c b/fs/cpio.c index 3d8078ae9..bedd65ee0 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -183,7 +183,8 @@ fail: static grub_err_t grub_cpio_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_cpio_data *data; grub_uint32_t ofs; @@ -227,7 +228,11 @@ grub_cpio_dir (grub_device_t device, const char *path, if ((!prev) || (grub_strcmp (prev, name) != 0)) { - hook (name + len, p != NULL); + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = (p != NULL); + + hook (name + len, &info); if (prev) grub_free (prev); prev = name; diff --git a/fs/ext2.c b/fs/ext2.c index 2dc79a429..ab50db010 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -791,7 +791,8 @@ grub_ext2_read (grub_file_t file, char *buf, grub_size_t len) static grub_err_t grub_ext2_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_ext2_data *data = 0;; struct grub_fshelp_node *fdiro = 0; @@ -804,14 +805,24 @@ grub_ext2_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + if (! node->inode_read) + { + grub_ext2_read_inode (data, node->ino, &node->inode); + if (!grub_errno) + node->inode_read = 1; + grub_errno = GRUB_ERR_NONE; + } + if (node->inode_read) + { + info.mtimeset = 1; + info.mtime = grub_le_to_cpu32 (node->inode.mtime); + } + + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + return hook (filename, &info); } #ifndef GRUB_UTIL @@ -898,6 +909,34 @@ grub_ext2_uuid (grub_device_t device, char **uuid) return grub_errno; } +/* Get mtime. */ +static grub_err_t +grub_ext2_mtime (grub_device_t device, grub_int32_t *tm) +{ + struct grub_ext2_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_ext2_mount (disk); + if (!data) + *tm = 0; + else + *tm = grub_le_to_cpu32 (data->sblock.utime); + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; + +} + + static struct grub_fs grub_ext2_fs = { @@ -908,6 +947,7 @@ static struct grub_fs grub_ext2_fs = .close = grub_ext2_close, .label = grub_ext2_label, .uuid = grub_ext2_uuid, + .mtime = grub_ext2_mtime, .next = 0 }; diff --git a/fs/fat.c b/fs/fat.c index d9b0fe13d..025319b3d 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -606,7 +606,8 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, static char * grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { char *dirname, *dirp; int call_hook; @@ -615,10 +616,16 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, auto int iter_hook (const char *filename, struct grub_fat_dir_entry *dir); int iter_hook (const char *filename, struct grub_fat_dir_entry *dir) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + + info.dir = !! (dir->attr & GRUB_FAT_ATTR_DIRECTORY); + info.case_insensitive = 1; + if (dir->attr & GRUB_FAT_ATTR_VOLUME_ID) return 0; if (*dirname == '\0' && call_hook) - return hook (filename, dir->attr & GRUB_FAT_ATTR_DIRECTORY); + return hook (filename, &info); if (grub_strcasecmp (dirname, filename) == 0) { @@ -630,7 +637,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, data->cur_cluster_num = ~0U; if (call_hook) - hook (filename, dir->attr & GRUB_FAT_ATTR_DIRECTORY); + hook (filename, &info); return 1; } @@ -676,7 +683,8 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, static grub_err_t grub_fat_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_fat_data *data = 0; grub_disk_t disk = device->disk; diff --git a/fs/hfs.c b/fs/hfs.c index 2ab3ac2fa..283c6bc0f 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -943,7 +943,8 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, static grub_err_t grub_hfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { int inode; @@ -954,13 +955,17 @@ grub_hfs_dir (grub_device_t device, const char *path, char fname[32] = { 0 }; char *filetype = rec->data; struct grub_hfs_catalog_key *ckey = rec->key; + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); grub_strncpy (fname, (char *) (ckey->str), ckey->strlen); - if (*filetype == GRUB_HFS_FILETYPE_DIR) - return hook (fname, 1); - else if (*filetype == GRUB_HFS_FILETYPE_FILE) - return hook (fname, 0); + if (*filetype == GRUB_HFS_FILETYPE_DIR + || *filetype == GRUB_HFS_FILETYPE_FILE) + { + info.dir = (*filetype == GRUB_HFS_FILETYPE_DIR); + return hook (fname, &info); + } return 0; } diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 7022f9897..82ec88044 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -57,9 +57,11 @@ struct grub_hfsplus_volheader grub_uint16_t magic; grub_uint16_t version; grub_uint32_t attributes; - grub_uint8_t unused[32]; + grub_uint8_t unused1[12]; + grub_uint32_t utime; + grub_uint8_t unused2[16]; grub_uint32_t blksize; - grub_uint8_t unused2[68]; + grub_uint8_t unused3[68]; struct grub_hfsplus_forkdata allocations_file; struct grub_hfsplus_forkdata extents_file; struct grub_hfsplus_forkdata catalog_file; @@ -133,9 +135,11 @@ struct grub_hfsplus_catfile grub_uint16_t flags; grub_uint32_t reserved; grub_uint32_t fileid; - grub_uint8_t unused1[30]; + grub_uint8_t unused1[4]; + grub_uint32_t mtime; + grub_uint8_t unused2[22]; grub_uint16_t mode; - grub_uint8_t unused2[44]; + grub_uint8_t unused3[44]; struct grub_hfsplus_forkdata data; struct grub_hfsplus_forkdata resource; } __attribute__ ((packed)); @@ -190,6 +194,7 @@ struct grub_fshelp_node struct grub_hfsplus_extent extents[8]; grub_uint64_t size; grub_uint32_t fileid; + grub_int32_t mtime; }; struct grub_hfsplus_btree @@ -780,6 +785,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, grub_memcpy (node->extents, fileinfo->data.extents, sizeof (node->extents)); + node->mtime = grub_be_to_cpu32 (fileinfo->mtime) - 2082844800; node->size = grub_be_to_cpu64 (fileinfo->data.size); node->fileid = grub_be_to_cpu32 (fileinfo->fileid); @@ -885,7 +891,8 @@ grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len) static grub_err_t grub_hfsplus_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_hfsplus_data *data = 0; struct grub_fshelp_node *fdiro = 0; @@ -898,14 +905,14 @@ grub_hfsplus_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + info.mtimeset = 1; + info.mtime = node->mtime; + info.case_insensitive = !! (filetype & GRUB_FSHELP_CASE_INSENSITIVE); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + return hook (filename, &info); } #ifndef GRUB_UTIL @@ -949,6 +956,34 @@ grub_hfsplus_label (grub_device_t device __attribute__((unused)) "partition is not implemented"); } +/* Get mtime. */ +static grub_err_t +grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm) +{ + struct grub_hfsplus_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_hfsplus_mount (disk); + if (!data) + *tm = 0; + else + *tm = grub_be_to_cpu32 (data->volheader.utime) - 2082844800; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; + +} + + static struct grub_fs grub_hfsplus_fs = { @@ -958,6 +993,7 @@ static struct grub_fs grub_hfsplus_fs = .read = grub_hfsplus_read, .close = grub_hfsplus_close, .label = grub_hfsplus_label, + .mtime = grub_hfsplus_mtime, .next = 0 }; diff --git a/fs/iso9660.c b/fs/iso9660.c index 6db228359..2278fdcc5 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -666,7 +666,8 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, static grub_err_t grub_iso9660_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_iso9660_data *data = 0; struct grub_fshelp_node rootnode; @@ -680,14 +681,11 @@ grub_iso9660_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + return hook (filename, &info); } #ifndef GRUB_UTIL diff --git a/fs/jfs.c b/fs/jfs.c index fc9dab8f6..3b5520fed 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -728,7 +728,8 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, int ino) static grub_err_t grub_jfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_jfs_data *data = 0; struct grub_jfs_diropen *diro = 0; @@ -752,14 +753,15 @@ grub_jfs_dir (grub_device_t device, const char *path, while (grub_jfs_getent (diro) != GRUB_ERR_OUT_OF_RANGE) { struct grub_jfs_inode inode; - int isdir; + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); if (grub_jfs_read_inode (data, diro->ino, &inode)) goto fail; - isdir = (grub_le_to_cpu32 (inode.mode) - & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR; - if (hook (diro->name, isdir)) + info.dir = (grub_le_to_cpu32 (inode.mode) + & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR; + if (hook (diro->name, &info)) goto fail; } diff --git a/fs/minix.c b/fs/minix.c index cc03d7d82..0789718a1 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -461,7 +461,8 @@ grub_minix_mount (grub_disk_t disk) static grub_err_t grub_minix_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_minix_data *data = 0; struct grub_minix_sblock *sblock; @@ -492,6 +493,9 @@ grub_minix_dir (grub_device_t device, const char *path, grub_uint16_t ino; char filename[data->filename_size + 1]; int dirino = data->ino; + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + if (grub_minix_read_file (data, 0, pos, sizeof (ino), (char *) &ino) < 0) @@ -506,8 +510,9 @@ grub_minix_dir (grub_device_t device, const char *path, /* The filetype is not stored in the dirent. Read the inode to find out the filetype. This *REALLY* sucks. */ grub_minix_read_inode (data, grub_le_to_cpu16 (ino)); - if (hook (filename, ((GRUB_MINIX_INODE_MODE (data) - & GRUB_MINIX_IFDIR) == GRUB_MINIX_IFDIR)) ? 1 : 0) + info.dir = ((GRUB_MINIX_INODE_MODE (data) + & GRUB_MINIX_IFDIR) == GRUB_MINIX_IFDIR); + if (hook (filename, &info) ? 1 : 0) break; /* Load the old inode back in. */ diff --git a/fs/ntfs.c b/fs/ntfs.c index 22477c532..5d1815927 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -864,7 +864,8 @@ fail: static grub_err_t grub_ntfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_ntfs_data *data = 0; struct grub_fshelp_node *fdiro = 0; @@ -877,14 +878,11 @@ grub_ntfs_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { - grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + grub_free (node); + return hook (filename, &info); } #ifndef GRUB_UTIL diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 8e9114934..433e89b01 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -1266,7 +1266,8 @@ grub_reiserfs_close (grub_file_t file) /* Call HOOK with each file under DIR. */ static grub_err_t grub_reiserfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_reiserfs_data *data = 0; struct grub_fshelp_node root, *found; @@ -1280,12 +1281,11 @@ grub_reiserfs_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); + return hook (filename, &info); } #ifndef GRUB_UTIL grub_dl_ref (my_mod); diff --git a/fs/sfs.c b/fs/sfs.c index d719e299e..314a6fd1d 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -519,7 +519,8 @@ grub_sfs_read (grub_file_t file, char *buf, grub_size_t len) static grub_err_t grub_sfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_sfs_data *data = 0; struct grub_fshelp_node *fdiro = 0; @@ -532,14 +533,11 @@ grub_sfs_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + return hook (filename, &info); } #ifndef GRUB_UTIL diff --git a/fs/udf.c b/fs/udf.c index 072e44fc3..abe992e0c 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -768,7 +768,8 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir, static grub_err_t grub_udf_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_udf_data *data = 0; struct grub_fshelp_node rootnode; @@ -782,14 +783,11 @@ grub_udf_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { - grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + grub_free (node); + return hook (filename, &info); } #ifndef GRUB_UTIL diff --git a/fs/ufs.c b/fs/ufs.c index 1f333b0c8..e6eacd3bd 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -36,7 +36,10 @@ #define GRUB_UFS_DIRBLKS 12 #define GRUB_UFS_INDIRBLKS 3 -#define GRUB_UFS_ATTR_DIR 040000 +#define GRUB_UFS_ATTR_TYPE 0160000 +#define GRUB_UFS_ATTR_FILE 0100000 +#define GRUB_UFS_ATTR_DIR 0040000 +#define GRUB_UFS_ATTR_LNK 0120000 #define GRUB_UFS_VOLNAME_LEN 32 @@ -71,16 +74,18 @@ struct grub_ufs_sblock /* The start of the cylinder group. */ grub_uint32_t cylg_offset; - - grub_uint8_t unused3[20]; + grub_uint8_t unused3[4]; + + grub_uint32_t mtime; + grub_uint8_t unused4[12]; /* The size of a block in bytes. */ grub_int32_t bsize; - grub_uint8_t unused4[48]; + grub_uint8_t unused5[48]; /* The size of filesystem blocks to disk blocks. */ grub_uint32_t log2_blksz; - grub_uint8_t unused5[80]; + grub_uint8_t unused6[80]; /* Inodes stored per cylinder group. */ grub_uint32_t ino_per_group; @@ -92,8 +97,10 @@ struct grub_ufs_sblock /* Volume name for UFS2. */ grub_uint8_t volume_name[GRUB_UFS_VOLNAME_LEN]; + grub_uint8_t unused8[232]; - grub_uint8_t unused8[660]; + grub_uint64_t mtime2; + grub_uint8_t unused9[420]; /* Magic value to check if this is really a UFS filesystem. */ grub_uint32_t magic; @@ -124,7 +131,7 @@ struct grub_ufs_inode grub_uint32_t gen; grub_uint32_t unused; grub_uint8_t pad[12]; -}; +} __attribute__ ((packed)); /* UFS inode. */ struct grub_ufs2_inode @@ -160,7 +167,7 @@ struct grub_ufs2_inode }; grub_uint8_t unused[24]; -}; +} __attribute__ ((packed)); /* Directory entry. */ struct grub_ufs_dirent @@ -169,7 +176,7 @@ struct grub_ufs_dirent grub_uint16_t direntlen; grub_uint8_t filetype; grub_uint8_t namelen; -}; +} __attribute__ ((packed)); /* Information about a "mounted" ufs filesystem. */ struct grub_ufs_data @@ -320,7 +327,7 @@ grub_ufs_read_file (struct grub_ufs_data *data, /* Read inode INO from the mounted filesystem described by DATA. This inode is used by default now. */ static grub_err_t -grub_ufs_read_inode (struct grub_ufs_data *data, int ino) +grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) { struct grub_ufs_sblock *sblock = &data->sblock; @@ -335,8 +342,12 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino) if (data->ufs_type == UFS1) { - struct grub_ufs_inode *inode = &data->inode; - + if (!inode) + { + inode = (char *) &data->inode; + data->ino = ino; + } + grub_disk_read (data->disk, (((grub_le_to_cpu32 (sblock->inoblk_offs) + grpblk) << grub_le_to_cpu32 (data->sblock.log2_blksz))) @@ -347,8 +358,12 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino) } else { - struct grub_ufs2_inode *inode = &data->inode2; - + if (!inode) + { + inode = (char *) &data->inode2; + data->ino = ino; + } + grub_disk_read (data->disk, (((grub_le_to_cpu32 (sblock->inoblk_offs) + grpblk) << grub_le_to_cpu32 (data->sblock.log2_blksz))) @@ -358,7 +373,6 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino) (char *) inode); } - data->ino = ino; return grub_errno; } @@ -390,7 +404,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) ino = GRUB_UFS_INODE; /* Now load in the old inode. */ - if (grub_ufs_read_inode (data, ino)) + if (grub_ufs_read_inode (data, ino, 0)) return grub_errno; grub_ufs_find_file (data, symlink); @@ -453,9 +467,10 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) if (!grub_strcmp (name, filename)) { dirino = data->ino; - grub_ufs_read_inode (data, grub_le_to_cpu32 (dirent.ino)); - - if (dirent.filetype == GRUB_UFS_FILETYPE_LNK) + grub_ufs_read_inode (data, grub_le_to_cpu32 (dirent.ino), 0); + + if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) + == GRUB_UFS_ATTR_LNK) { grub_ufs_lookup_symlink (data, dirino); if (grub_errno) @@ -475,7 +490,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) next++; } - if (!(dirent.filetype & GRUB_UFS_FILETYPE_DIR)) + if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); continue; @@ -544,7 +559,8 @@ grub_ufs_mount (grub_disk_t disk) static grub_err_t grub_ufs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_ufs_data *data; struct grub_ufs_sblock *sblock; @@ -554,7 +570,7 @@ grub_ufs_dir (grub_device_t device, const char *path, if (!data) return grub_errno; - grub_ufs_read_inode (data, GRUB_UFS_INODE); + grub_ufs_read_inode (data, GRUB_UFS_INODE, 0); if (grub_errno) return grub_errno; @@ -570,7 +586,7 @@ grub_ufs_dir (grub_device_t device, const char *path, if (grub_errno) goto fail; - if (!(INODE_MODE (data) & GRUB_UFS_ATTR_DIR)) + if ((INODE_MODE (data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); goto fail; @@ -586,13 +602,34 @@ grub_ufs_dir (grub_device_t device, const char *path, { char filename[dirent.namelen + 1]; + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); if (grub_ufs_read_file (data, 0, pos + sizeof (dirent), dirent.namelen, filename) < 0) break; filename[dirent.namelen] = '\0'; - if (hook (filename, dirent.filetype == GRUB_UFS_FILETYPE_DIR)) + if (data->ufs_type == UFS1) + { + struct grub_ufs_inode inode; + grub_ufs_read_inode (data, dirent.ino, (char *) &inode); + info.dir = ((grub_le_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE) + == GRUB_UFS_ATTR_DIR); + info.mtime = grub_le_to_cpu64 (inode.mtime); + info.mtimeset = 1; + } + else + { + struct grub_ufs2_inode inode; + grub_ufs_read_inode (data, dirent.ino, (char *) &inode); + info.dir = ((grub_le_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE) + == GRUB_UFS_ATTR_DIR); + info.mtime = grub_le_to_cpu64 (inode.mtime); + info.mtimeset = 1; + } + + if (hook (filename, &info)) break; } @@ -615,7 +652,7 @@ grub_ufs_open (struct grub_file *file, const char *name) if (!data) return grub_errno; - grub_ufs_read_inode (data, 2); + grub_ufs_read_inode (data, 2, 0); if (grub_errno) { grub_free (data); @@ -688,6 +725,34 @@ grub_ufs_label (grub_device_t device, char **label) return grub_errno; } +/* Get mtime. */ +static grub_err_t +grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) +{ + struct grub_ufs_data *data = 0; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_ufs_mount (device->disk); + if (!data) + *tm = 0; + else if (data->ufs_type == UFS1) + *tm = grub_le_to_cpu32 (data->sblock.mtime); + else + *tm = grub_le_to_cpu64 (data->sblock.mtime2); + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + + static struct grub_fs grub_ufs_fs = { @@ -697,6 +762,7 @@ static struct grub_fs grub_ufs_fs = .read = grub_ufs_read, .close = grub_ufs_close, .label = grub_ufs_label, + .mtime = grub_ufs_mtime, .next = 0 }; diff --git a/fs/xfs.c b/fs/xfs.c index 81a27714b..a5c2d42f5 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -620,7 +620,8 @@ grub_xfs_mount (grub_disk_t disk) static grub_err_t grub_xfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { struct grub_xfs_data *data = 0;; struct grub_fshelp_node *fdiro = 0; @@ -633,14 +634,11 @@ grub_xfs_dir (grub_device_t device, const char *path, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) { + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); + info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); grub_free (node); - - if (filetype == GRUB_FSHELP_DIR) - return hook (filename, 1); - else - return hook (filename, 0); - - return 0; + return hook (filename, &info); } #ifndef GRUB_UTIL diff --git a/hook/datehook.c b/hook/datehook.c index 9419d482e..0b0332871 100644 --- a/hook/datehook.c +++ b/hook/datehook.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include static char *grub_datetime_names[] = { diff --git a/include/grub/datetime.h b/include/grub/datetime.h new file mode 100644 index 000000000..f4bdae252 --- /dev/null +++ b/include/grub/datetime.h @@ -0,0 +1,48 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef KERNEL_DATETIME_HEADER +#define KERNEL_DATETIME_HEADER 1 + +#include +#include + +struct grub_datetime +{ + grub_uint16_t year; + grub_uint8_t month; + grub_uint8_t day; + grub_uint8_t hour; + grub_uint8_t minute; + grub_uint8_t second; +}; + +/* Return date and time. */ +grub_err_t grub_get_datetime (struct grub_datetime *datetime); + +/* Set date and time. */ +grub_err_t grub_set_datetime (struct grub_datetime *datetime); + +int grub_get_weekday (struct grub_datetime *datetime); +char *grub_get_weekday_name (struct grub_datetime *datetime); + +void grub_unixtime2datetime (grub_int32_t nix, + struct grub_datetime *datetime); + + +#endif /* ! KERNEL_DATETIME_HEADER */ diff --git a/include/grub/fs.h b/include/grub/fs.h index 46c74925c..fa2c07096 100644 --- a/include/grub/fs.h +++ b/include/grub/fs.h @@ -27,6 +27,14 @@ /* Forward declaration is required, because of mutual reference. */ struct grub_file; +struct grub_dirhook_info +{ + int dir:1; + int mtimeset:1; + int case_insensitive:1; + grub_int32_t mtime; +}; + /* Filesystem descriptor. */ struct grub_fs { @@ -35,7 +43,8 @@ struct grub_fs /* Call HOOK with each file under DIR. */ grub_err_t (*dir) (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)); + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)); /* Open a file named NAME and initialize FILE. */ grub_err_t (*open) (struct grub_file *file, const char *name); @@ -56,6 +65,9 @@ struct grub_fs caller. */ grub_err_t (*uuid) (grub_device_t device, char **uuid); + /* Get writing time of filesystem. */ + grub_err_t (*mtime) (grub_device_t device, grub_int32_t *timebuf); + /* The next filesystem. */ struct grub_fs *next; }; diff --git a/include/grub/fshelp.h b/include/grub/fshelp.h index 7092cac45..42d8da5f2 100644 --- a/include/grub/fshelp.h +++ b/include/grub/fshelp.h @@ -27,6 +27,8 @@ typedef struct grub_fshelp_node *grub_fshelp_node_t; #define GRUB_FSHELP_CASE_INSENSITIVE 0x100 +#define GRUB_FSHELP_TYPE_MASK 0xff +#define GRUB_FSHELP_FLAGS_MASK 0x100 enum grub_fshelp_filetype { diff --git a/include/grub/lib/datetime.h b/include/grub/lib/datetime.h index 7b140ccfe..e69de29bb 100644 --- a/include/grub/lib/datetime.h +++ b/include/grub/lib/datetime.h @@ -1,44 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef KERNEL_DATETIME_HEADER -#define KERNEL_DATETIME_HEADER 1 - -#include -#include - -struct grub_datetime -{ - grub_uint16_t year; - grub_uint8_t month; - grub_uint8_t day; - grub_uint8_t hour; - grub_uint8_t minute; - grub_uint8_t second; -}; - -/* Return date and time. */ -grub_err_t grub_get_datetime (struct grub_datetime *datetime); - -/* Set date and time. */ -grub_err_t grub_set_datetime (struct grub_datetime *datetime); - -int grub_get_weekday (struct grub_datetime *datetime); -char *grub_get_weekday_name (struct grub_datetime *datetime); - -#endif /* ! KERNEL_DATETIME_HEADER */ diff --git a/kern/corecmd.c b/kern/corecmd.c index ad2ba0967..9c189460c 100644 --- a/kern/corecmd.c +++ b/kern/corecmd.c @@ -117,9 +117,10 @@ grub_mini_print_devices (const char *name) } static int -grub_mini_print_files (const char *filename, int dir) +grub_mini_print_files (const char *filename, + const struct grub_dirhook_info *info) { - grub_printf ("%s%s ", filename, dir ? "/" : ""); + grub_printf ("%s%s ", filename, info->dir ? "/" : ""); return 0; } diff --git a/kern/fs.c b/kern/fs.c index 4e21de2f6..e2e4300ee 100644 --- a/kern/fs.c +++ b/kern/fs.c @@ -65,10 +65,11 @@ grub_fs_t grub_fs_probe (grub_device_t device) { grub_fs_t p; - auto int dummy_func (const char *filename, int dir); + auto int dummy_func (const char *filename, + const struct grub_dirhook_info *info); int dummy_func (const char *filename __attribute__ ((unused)), - int dir __attribute__ ((unused))) + const struct grub_dirhook_info *info __attribute__ ((unused))) { return 1; } diff --git a/lib/datetime.c b/lib/datetime.c index 7215a6a6d..e69de29bb 100644 --- a/lib/datetime.c +++ b/lib/datetime.c @@ -1,49 +0,0 @@ -/* datetime.c - Module for common datetime function. */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include - -static char *grub_weekday_names[] = -{ - "Sunday", - "Monday", - "Tuesday", - "Wednesday", - "Thursday", - "Friday", - "Saturday", -}; - -int -grub_get_weekday (struct grub_datetime *datetime) -{ - int a, y, m; - - a = (14 - datetime->month) / 12; - y = datetime->year - a; - m = datetime->month + 12 * a - 2; - - return (datetime->day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12)) % 7; -} - -char * -grub_get_weekday_name (struct grub_datetime *datetime) -{ - return grub_weekday_names[grub_get_weekday (datetime)]; -} diff --git a/lib/efi/datetime.c b/lib/efi/datetime.c index 9fa72fddc..0a91c345a 100644 --- a/lib/efi/datetime.c +++ b/lib/efi/datetime.c @@ -21,7 +21,7 @@ #include #include #include -#include +#include grub_err_t grub_get_datetime (struct grub_datetime *datetime) diff --git a/lib/i386/datetime.c b/lib/i386/datetime.c index 1e5974608..63858ed03 100644 --- a/lib/i386/datetime.c +++ b/lib/i386/datetime.c @@ -17,7 +17,7 @@ * along with GRUB. If not, see . */ -#include +#include #include grub_err_t diff --git a/normal/completion.c b/normal/completion.c index 39f5c1323..03effd8d6 100644 --- a/normal/completion.c +++ b/normal/completion.c @@ -124,9 +124,9 @@ iterate_partition (grub_disk_t disk, const grub_partition_t p) } static int -iterate_dir (const char *filename, int dir) +iterate_dir (const char *filename, const struct grub_dirhook_info *info) { - if (! dir) + if (! info->dir) { const char *prefix; if (cmdline_state == GRUB_PARSER_STATE_DQUOTE) diff --git a/normal/datetime.c b/normal/datetime.c new file mode 100644 index 000000000..272b716fa --- /dev/null +++ b/normal/datetime.c @@ -0,0 +1,100 @@ +/* datetime.c - Module for common datetime function. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +static char *grub_weekday_names[] = +{ + "Sunday", + "Monday", + "Tuesday", + "Wednesday", + "Thursday", + "Friday", + "Saturday", +}; + +int +grub_get_weekday (struct grub_datetime *datetime) +{ + int a, y, m; + + a = (14 - datetime->month) / 12; + y = datetime->year - a; + m = datetime->month + 12 * a - 2; + + return (datetime->day + y + y / 4 - y / 100 + y / 400 + (31 * m / 12)) % 7; +} + +char * +grub_get_weekday_name (struct grub_datetime *datetime) +{ + return grub_weekday_names[grub_get_weekday (datetime)]; +} + +#define SECPERMIN 60 +#define SECPERHOUR (60*SECPERMIN) +#define SECPERDAY (24*SECPERHOUR) +#define SECPERYEAR (365*SECPERDAY) +#define SECPER4YEARS (4*SECPERYEAR+SECPERDAY) + + +void +grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime) +{ + int i; + int div; + grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + /* In the period of validity of unixtime all years divisible by 4 + are bissextile*/ + /* Convenience: let's have 3 consecutive non-bissextile years + at the begining of the epoch. So count from 1973 instead of 1970 */ + nix -= 3*SECPERYEAR + SECPERDAY; + /* Transform C divisions and modulos to mathematical ones */ + div = nix / SECPER4YEARS; + if (nix < 0) + div--; + datetime->year = 1973 + 4 * div; + nix -= div * SECPER4YEARS; + + /* On 31st december of bissextile years 365 days from the begining + of the year elapsed but year isn't finished yet*/ + if (nix / SECPERYEAR == 4) + { + datetime->year += 3; + nix -= 3*SECPERYEAR; + } + else + { + datetime->year += nix / SECPERYEAR; + nix %= SECPERYEAR; + } + for (i = 0; i < 12 + && nix >= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 + ? 29 : months[i]))*SECPERDAY; i++) + nix -= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 + ? 29 : months[i]))*SECPERDAY; + datetime->month = i + 1; + datetime->day = 1 + (nix / SECPERDAY); + nix %= SECPERDAY; + datetime->hour = (nix / SECPERHOUR); + nix %= SECPERHOUR; + datetime->minute = nix / SECPERMIN; + datetime->second = nix % SECPERMIN; +} diff --git a/normal/misc.c b/normal/misc.c index e47ff8720..bf677db7f 100644 --- a/normal/misc.c +++ b/normal/misc.c @@ -23,6 +23,7 @@ #include #include #include +#include /* Print the information on the device NAME. */ grub_err_t @@ -63,6 +64,23 @@ grub_normal_print_device_info (const char *name) } grub_errno = GRUB_ERR_NONE; } + if (fs->mtime) + { + grub_int32_t tm; + struct grub_datetime datetime; + (fs->mtime) (dev, &tm); + if (grub_errno == GRUB_ERR_NONE) + { + grub_unixtime2datetime (tm, &datetime); + grub_printf (", Last modification time %d-%02d-%02d " + "%02d:%02d:%02d %s", + datetime.year, datetime.month, datetime.day, + datetime.hour, datetime.minute, datetime.second, + grub_get_weekday_name (&datetime)); + + } + grub_errno = GRUB_ERR_NONE; + } if (fs->uuid) { char *uuid; diff --git a/util/hostfs.c b/util/hostfs.c index d68c36fe3..de3bcd680 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with GRUB. If not, see . */ - +#define _BSD_SOURCE #include #include #include @@ -57,7 +57,8 @@ is_dir (const char *path, const char *name) static grub_err_t grub_hostfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, int dir)) + int (*hook) (const char *filename, + const struct grub_dirhook_info *info)) { DIR *dir; @@ -73,16 +74,20 @@ grub_hostfs_dir (grub_device_t device, const char *path, while (1) { struct dirent *de; + struct grub_dirhook_info info; + grub_memset (&info, 0, sizeof (info)); de = readdir (dir); if (! de) break; #ifdef DT_DIR - hook (de->d_name, de->d_type == DT_DIR); + info.dir = (de->d_type == DT_DIR); #else - hook (de->d_name, is_dir (path, de->d_name)); + info.dir = !! is_dir (path, de->d_name); #endif + hook (de->d_name, &info); + } closedir (dir); From ea761d4014e03068b4b807960749745773cc3d14 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 6 Apr 2009 09:51:01 +0000 Subject: [PATCH 0607/1707] 2009-04-06 Vladimir Serbinenko Parttool * parttool/pcpart.c: new file * commands/parttool.c: likewise * conf/common.rmk (pkglib_MODULES): Added parttool.mod and pcpart.mod (parttool_mod_SOURCES): new variable (parttool_mod_CFLAGS): likewise (parttool_mod_LDFLAGS): likewise (pcpart_mod_SOURCES): likewise (pcpart_mod_CFLAGS): likewise (pcpart_mod_LDFLAGS): likewise * conf/i386-coreboot.rmk (grub_emu_SOURCES): added commands/parttool.c and parttool/pcpart.c * conf/i386-efi.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise * conf/x86_64-ieee1275.rmk: likewise --- ChangeLog | 22 ++++ DISTLIST | 2 + commands/parttool.c | 263 ++++++++++++++++++++++++++++++++++++++ conf/common.mk | 116 ++++++++++++++++- conf/common.rmk | 12 +- conf/i386-coreboot.mk | 17 ++- conf/i386-coreboot.rmk | 1 + conf/i386-efi.mk | 1 + conf/i386-efi.rmk | 1 + conf/i386-pc.mk | 17 ++- conf/i386-pc.rmk | 1 + conf/powerpc-ieee1275.mk | 17 ++- conf/powerpc-ieee1275.rmk | 1 + conf/sparc64-ieee1275.mk | 1 + conf/sparc64-ieee1275.rmk | 1 + conf/x86_64-efi.mk | 1 + conf/x86_64-efi.rmk | 1 + include/grub/parttool.h | 58 +++++++++ parttool/pcpart.c | 152 ++++++++++++++++++++++ 19 files changed, 671 insertions(+), 14 deletions(-) create mode 100644 commands/parttool.c create mode 100644 include/grub/parttool.h create mode 100644 parttool/pcpart.c diff --git a/ChangeLog b/ChangeLog index 2da401be5..30ad96a19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2009-04-06 Vladimir Serbinenko + + Parttool + + * parttool/pcpart.c: new file + * commands/parttool.c: likewise + * conf/common.rmk (pkglib_MODULES): Added parttool.mod and pcpart.mod + (parttool_mod_SOURCES): new variable + (parttool_mod_CFLAGS): likewise + (parttool_mod_LDFLAGS): likewise + (pcpart_mod_SOURCES): likewise + (pcpart_mod_CFLAGS): likewise + (pcpart_mod_LDFLAGS): likewise + * conf/i386-coreboot.rmk (grub_emu_SOURCES): added commands/parttool.c + and parttool/pcpart.c + * conf/i386-efi.rmk: likewise + * conf/i386-ieee1275.rmk: likewise + * conf/i386-pc.rmk: likewise + * conf/powerpc-ieee1275.rmk: likewise + * conf/sparc64-ieee1275.rmk: likewise + * conf/x86_64-ieee1275.rmk: likewise + 2009-04-05 Vladimir Serbinenko Support for mtime and further expandability of dir command diff --git a/DISTLIST b/DISTLIST index 82a661000..57fb3020c 100644 --- a/DISTLIST +++ b/DISTLIST @@ -59,6 +59,7 @@ commands/ls.c commands/lsmmap.c commands/lspci.c commands/minicmd.c +commands/parttool.c commands/read.c commands/reboot.c commands/search.c @@ -181,6 +182,7 @@ include/grub/normal.h include/grub/ntfs.h include/grub/parser.h include/grub/partition.h +include/grub/parttool.h include/grub/pc_partition.h include/grub/pci.h include/grub/raid.h diff --git a/commands/parttool.c b/commands/parttool.c new file mode 100644 index 000000000..6eec13b1c --- /dev/null +++ b/commands/parttool.c @@ -0,0 +1,263 @@ +/* parttool.c - common dispatcher and parser for partition operations */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct grub_parttool *parts = 0; +static int curhandle = 0; +static grub_dl_t mymod; + +int +grub_parttool_register(const char *part_name, + const grub_parttool_function_t func, + const struct grub_parttool_argdesc *args) +{ + struct grub_parttool *cur; + int nargs = 0; + +#ifndef GRUB_UTIL + if (! parts) + grub_dl_ref (mymod); +#endif + + cur = (struct grub_parttool *) grub_malloc (sizeof (struct grub_parttool)); + cur->next = parts; + cur->name = grub_strdup (part_name); + cur->handle = curhandle++; + for (nargs = 0; args[nargs].name != 0; nargs++); + cur->nargs = nargs; + cur->args = (struct grub_parttool_argdesc *) + grub_malloc ((nargs + 1) * sizeof (struct grub_parttool_argdesc)); + grub_memcpy (cur->args, args, + (nargs + 1) * sizeof (struct grub_parttool_argdesc)); + + cur->func = func; + parts = cur; + return cur->handle; +} + +void +grub_parttool_unregister (int handle) +{ + struct grub_parttool *prev = 0, *cur, *t; + for (cur = parts; cur; ) + if (cur->handle == handle) + { + grub_free (cur->args); + grub_free (cur->name); + if (prev) + prev->next = cur->next; + else + parts = cur->next; + t = cur; + cur = cur->next; + grub_free (t); + } + else + { + prev = cur; + cur = cur->next; + } +#ifndef GRUB_UTIL + if (! parts) + grub_dl_unref (mymod); +#endif +} + +static grub_err_t +grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), + int argc, char **args) +{ + grub_device_t dev; + struct grub_parttool *cur, *ptool; + int *parsed; + int i, j; + grub_err_t err = GRUB_ERR_NONE; + + if (argc < 2) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments"); + + if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') + { + args[0][grub_strlen (args[0]) - 1] = 0; + dev = grub_device_open (args[0] + 1); + args[0][grub_strlen (args[0]) - 1] = ')'; + } + else + dev = grub_device_open (args[0]); + + if (! dev) + return grub_errno; + + if (! dev->disk) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a disk"); + } + + if (! dev->disk->partition) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a partition"); + } + + parsed = (int *) grub_malloc (argc * sizeof (int)); + grub_memset (parsed, 0, argc * sizeof (int)); + + for (i = 1; i < argc; i++) + if (!grub_strcmp (args[i], "help")) + { + int found = 0; + for (cur = parts; cur; cur = cur->next) + if (! grub_strcmp (dev->disk->partition->partmap->name, cur->name)) + { + struct grub_parttool_argdesc *curarg; + found = 1; + for (curarg = cur->args; curarg->name; curarg++) + { + int spacing = 20; + + spacing -= grub_strlen (curarg->name); + grub_printf ("%s", curarg->name); + + switch (curarg->type) + { + case GRUB_PARTTOOL_ARG_BOOL: + grub_printf ("+/-"); + spacing -= 3; + break; + + case GRUB_PARTTOOL_ARG_VAL: + grub_printf ("=VAL"); + spacing -= 4; + break; + + case GRUB_PARTTOOL_ARG_END: + break; + } + while (spacing-- > 0) + grub_printf (" "); + grub_printf ("%s\n", curarg->desc); + } + } + if (! found) + grub_printf ("Sorry no parttool is available for %s\n", + dev->disk->partition->partmap->name); + return GRUB_ERR_NONE; + } + + for (i = 1; i < argc; i++) + if (! parsed[i]) + { + struct grub_parttool_argdesc *curarg; + struct grub_parttool_args *pargs; + for (cur = parts; cur; cur = cur->next) + if (! grub_strcmp (dev->disk->partition->partmap->name, cur->name)) + { + for (curarg = cur->args; curarg->name; curarg++) + if (!grub_strncmp (curarg->name, args[i], + grub_strlen (curarg->name)) + && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL + && (args[i][grub_strlen (curarg->name)] == '+' + || args[i][grub_strlen (curarg->name)] == '-')) + || (curarg->type == GRUB_PARTTOOL_ARG_VAL + && args[i][grub_strlen (curarg->name)] == '='))) + + break; + if (curarg->name) + break; + } + if (! cur) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised argument %s", + args[i]); + ptool = cur; + pargs = (struct grub_parttool_args *) + grub_malloc (ptool->nargs * sizeof (struct grub_parttool_args)); + grub_memset (pargs, 0, + ptool->nargs * sizeof (struct grub_parttool_args)); + for (j = i; j < argc; j++) + if (!parsed[j]) + { + for (curarg = ptool->args; curarg->name; curarg++) + if (!grub_strncmp (curarg->name, args[i], + grub_strlen (curarg->name)) + && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL + && (args[j][grub_strlen (curarg->name)] == '+' + || args[j][grub_strlen (curarg->name)] == '-')) + || (curarg->type == GRUB_PARTTOOL_ARG_VAL + && args[j][grub_strlen (curarg->name)] == '='))) + { + parsed[j] = 1; + pargs[curarg - ptool->args].set = 1; + switch (curarg->type) + { + case GRUB_PARTTOOL_ARG_BOOL: + pargs[curarg - ptool->args].bool + = (args[j][grub_strlen (curarg->name)] != '-'); + break; + + case GRUB_PARTTOOL_ARG_VAL: + pargs[curarg - ptool->args].str + = (args[j] + grub_strlen (curarg->name) + 1); + break; + + case GRUB_PARTTOOL_ARG_END: + break; + } + } + } + + err = ptool->func (dev, pargs); + grub_free (pargs); + if (err) + break; + } + + grub_device_close (dev); + return err; +} + +static grub_command_t cmd; + +GRUB_MOD_INIT(parttool) +{ + (void)mod; /* To stop warning. */ + mymod = mod; + cmd = grub_register_command ("parttool", grub_cmd_parttool, + "parttool PARTITION COMMANDS", + "perform COMMANDS on partition." + " use parttool PARTITION help for the list " + " of available commands"); +} + +GRUB_MOD_FINI(parttool) +{ + grub_unregister_command (cmd); +} diff --git a/conf/common.mk b/conf/common.mk index 9411a59c7..3f052f626 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -2444,7 +2444,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod + read.mod sleep.mod loadenv.mod crc.mod parttool.mod pcpart.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -2636,6 +2636,120 @@ partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) g hello_mod_CFLAGS = $(COMMON_CFLAGS) hello_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For parttool.mod. +parttool_mod_SOURCES = commands/parttool.c +CLEANFILES += parttool.mod mod-parttool.o mod-parttool.c pre-parttool.o parttool_mod-commands_parttool.o und-parttool.lst +ifneq ($(parttool_mod_EXPORTS),no) +CLEANFILES += def-parttool.lst +DEFSYMFILES += def-parttool.lst +endif +MOSTLYCLEANFILES += parttool_mod-commands_parttool.d +UNDSYMFILES += und-parttool.lst + +parttool.mod: pre-parttool.o mod-parttool.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(parttool_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-parttool.o mod-parttool.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-parttool.o: $(parttool_mod_DEPENDENCIES) parttool_mod-commands_parttool.o + -rm -f $@ + $(TARGET_CC) $(parttool_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ parttool_mod-commands_parttool.o + +mod-parttool.o: mod-parttool.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -c -o $@ $< + +mod-parttool.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'parttool' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(parttool_mod_EXPORTS),no) +def-parttool.lst: pre-parttool.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 parttool/' > $@ +endif + +und-parttool.lst: pre-parttool.o + echo 'parttool' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +parttool_mod-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -MD -c -o $@ $< +-include parttool_mod-commands_parttool.d + +CLEANFILES += cmd-parttool_mod-commands_parttool.lst fs-parttool_mod-commands_parttool.lst partmap-parttool_mod-commands_parttool.lst +COMMANDFILES += cmd-parttool_mod-commands_parttool.lst +FSFILES += fs-parttool_mod-commands_parttool.lst +PARTMAPFILES += partmap-parttool_mod-commands_parttool.lst + +cmd-parttool_mod-commands_parttool.lst: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh parttool > $@ || (rm -f $@; exit 1) + +fs-parttool_mod-commands_parttool.lst: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh parttool > $@ || (rm -f $@; exit 1) + +partmap-parttool_mod-commands_parttool.lst: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh parttool > $@ || (rm -f $@; exit 1) + + +parttool_mod_CFLAGS = $(COMMON_CFLAGS) +parttool_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For pcpart.mod. +pcpart_mod_SOURCES = parttool/pcpart.c +CLEANFILES += pcpart.mod mod-pcpart.o mod-pcpart.c pre-pcpart.o pcpart_mod-parttool_pcpart.o und-pcpart.lst +ifneq ($(pcpart_mod_EXPORTS),no) +CLEANFILES += def-pcpart.lst +DEFSYMFILES += def-pcpart.lst +endif +MOSTLYCLEANFILES += pcpart_mod-parttool_pcpart.d +UNDSYMFILES += und-pcpart.lst + +pcpart.mod: pre-pcpart.o mod-pcpart.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(pcpart_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pcpart.o mod-pcpart.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-pcpart.o: $(pcpart_mod_DEPENDENCIES) pcpart_mod-parttool_pcpart.o + -rm -f $@ + $(TARGET_CC) $(pcpart_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pcpart_mod-parttool_pcpart.o + +mod-pcpart.o: mod-pcpart.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -c -o $@ $< + +mod-pcpart.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'pcpart' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(pcpart_mod_EXPORTS),no) +def-pcpart.lst: pre-pcpart.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pcpart/' > $@ +endif + +und-pcpart.lst: pre-pcpart.o + echo 'pcpart' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +pcpart_mod-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) + $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -MD -c -o $@ $< +-include pcpart_mod-parttool_pcpart.d + +CLEANFILES += cmd-pcpart_mod-parttool_pcpart.lst fs-pcpart_mod-parttool_pcpart.lst partmap-pcpart_mod-parttool_pcpart.lst +COMMANDFILES += cmd-pcpart_mod-parttool_pcpart.lst +FSFILES += fs-pcpart_mod-parttool_pcpart.lst +PARTMAPFILES += partmap-pcpart_mod-parttool_pcpart.lst + +cmd-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pcpart > $@ || (rm -f $@; exit 1) + +fs-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pcpart > $@ || (rm -f $@; exit 1) + +partmap-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pcpart > $@ || (rm -f $@; exit 1) + + +pcpart_mod_CFLAGS = $(COMMON_CFLAGS) +pcpart_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For handler.mod. handler_mod_SOURCES = commands/handler.c CLEANFILES += handler.mod mod-handler.o mod-handler.c pre-handler.o handler_mod-commands_handler.o und-handler.lst diff --git a/conf/common.rmk b/conf/common.rmk index 43bc683b0..e9a5b8756 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -335,7 +335,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod + read.mod sleep.mod loadenv.mod crc.mod parttool.mod pcpart.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -352,6 +352,16 @@ hello_mod_SOURCES = hello/hello.c hello_mod_CFLAGS = $(COMMON_CFLAGS) hello_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For parttool.mod. +parttool_mod_SOURCES = commands/parttool.c +parttool_mod_CFLAGS = $(COMMON_CFLAGS) +parttool_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For pcpart.mod. +pcpart_mod_SOURCES = parttool/pcpart.c +pcpart_mod_CFLAGS = $(COMMON_CFLAGS) +pcpart_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For handler.mod. handler_mod_SOURCES = commands/handler.c handler_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk index 09e2bcfca..169db9471 100644 --- a/conf/i386-coreboot.mk +++ b/conf/i386-coreboot.mk @@ -238,12 +238,13 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_datetime.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_datetime.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -613,6 +614,14 @@ grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_lvm.d +grub_emu-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_parttool.d + +grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) + $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-parttool_pcpart.d + grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-grub_emu_init.d diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 422107e28..41c45db1d 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -89,6 +89,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 13bc1bc31..400e00705 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -100,6 +100,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 4fc0ea47a..bfda86d93 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -67,6 +67,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index 0332306a7..ab14e0883 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -571,12 +571,13 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -958,6 +959,14 @@ grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_lvm.d +grub_emu-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_parttool.d + +grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) + $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-parttool_pcpart.d + grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-grub_emu_init.d diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 1e9d65f14..7dfb854e4 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -148,6 +148,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk index 828ef96a8..7e250a59a 100644 --- a/conf/powerpc-ieee1275.mk +++ b/conf/powerpc-ieee1275.mk @@ -87,12 +87,13 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d +CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o +MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) +grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o + $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< @@ -450,6 +451,14 @@ grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-disk_lvm.d +grub_emu-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) + $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-commands_parttool.d + +grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) + $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< +-include grub_emu-parttool_pcpart.d + grub_emu-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< -include grub_emu-grub_script_tab.d diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b62c7a10f..361fb8572 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -72,6 +72,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_script.tab.c grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index 90963647e..d68b40eef 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -67,6 +67,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ # util/hostdisk.c util/getroot.c \ +# commands/parttool.c parttool/pcpart.c \ # util/sparc64/ieee1275/misc.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index bc563aa22..68ae7427d 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -66,6 +66,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # partmap/acorn.c \ # util/console.c util/grub-emu.c util/misc.c \ # util/hostdisk.c util/getroot.c \ +# commands/parttool.c parttool/pcpart.c \ # util/sparc64/ieee1275/misc.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index d79eb168f..868356c9c 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -88,6 +88,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 8360e2e19..09bce5f27 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -69,6 +69,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/include/grub/parttool.h b/include/grub/parttool.h new file mode 100644 index 000000000..0e05f4cc5 --- /dev/null +++ b/include/grub/parttool.h @@ -0,0 +1,58 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_PARTTOOL_HEADER +#define GRUB_PARTTOOL_HEADER 1 + +struct grub_parttool_argdesc +{ + char *name; + char *desc; + enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL} + type; +}; + +struct grub_parttool_args +{ + int set; + union + { + int bool; + char *str; + }; +}; + +typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev, + const struct grub_parttool_args *args); + +struct grub_parttool +{ + struct grub_parttool *next; + char *name; + int handle; + int nargs; + struct grub_parttool_argdesc *args; + grub_parttool_function_t func; +}; + +int grub_parttool_register(const char *part_name, + const grub_parttool_function_t func, + const struct grub_parttool_argdesc *args); +void grub_parttool_unregister (int handle); + +#endif /* ! GRUB_PARTTOOL_HEADER*/ diff --git a/parttool/pcpart.c b/parttool/pcpart.c new file mode 100644 index 000000000..59f24bac8 --- /dev/null +++ b/parttool/pcpart.c @@ -0,0 +1,152 @@ +/* pcpart.c - manipulate fdisk partitions */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static int activate_table_handle = -1; +static int type_table_handle = -1; + +static struct grub_parttool_argdesc grub_pcpart_bootargs[] = +{ + {"boot", "Make partition active", GRUB_PARTTOOL_ARG_BOOL}, + {0, 0, 0} +}; + +static grub_err_t grub_pcpart_boot (const grub_device_t dev, + const struct grub_parttool_args *args) +{ + int i, index; + grub_partition_t part; + struct grub_pc_partition_mbr mbr; + + if (dev->disk->partition->offset) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a primary partition"); + + index = dev->disk->partition->index; + part = dev->disk->partition; + dev->disk->partition = 0; + + /* Read the MBR. */ + if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr)) + { + dev->disk->partition = part; + return grub_errno; + } + + if (args[0].set && args[0].bool) + { + for (i = 0; i < 4; i++) + mbr.entries[i].flag = 0x0; + mbr.entries[index].flag = 0x80; + } + else + mbr.entries[index].flag = 0x0; + + /* Write the MBR. */ + grub_disk_write (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr); + + dev->disk->partition = part; + + return GRUB_ERR_NONE; +} + +static struct grub_parttool_argdesc grub_pcpart_typeargs[] = +{ + {"type", "Change partition type", GRUB_PARTTOOL_ARG_VAL}, + {"hidden", "Make partition hidden", GRUB_PARTTOOL_ARG_BOOL}, + {0, 0, 0} +}; + +static grub_err_t grub_pcpart_type (const grub_device_t dev, + const struct grub_parttool_args *args) +{ + int index; + grub_uint8_t type; + grub_partition_t part; + struct grub_pc_partition_mbr mbr; + + index = dev->disk->partition->index; + part = dev->disk->partition; + dev->disk->partition = 0; + + /* Read the parttable. */ + if (grub_disk_read (dev->disk, part->offset, 0, + sizeof (mbr), (char *) &mbr)) + { + dev->disk->partition = part; + return grub_errno; + } + + if (args[0].set) + type = grub_strtoul (args[0].str, 0, 0); + else + type = mbr.entries[index].type; + + if (args[1].set) + { + if (args[1].bool) + type |= GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG; + else + type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG; + } + + if (grub_pc_partition_is_empty (type) + || grub_pc_partition_is_extended (type)) + { + dev->disk->partition = part; + return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid type"); + } + + mbr.entries[index].type = type; + + /* Write the parttable. */ + grub_disk_write (dev->disk, part->offset, 0, + sizeof (mbr), (char *) &mbr); + + dev->disk->partition = part; + + return GRUB_ERR_NONE; +} + +GRUB_MOD_INIT (pcpart) +{ + (void)mod; /* To stop warning. */ + + activate_table_handle = grub_parttool_register ("pc_partition_map", + grub_pcpart_boot, + grub_pcpart_bootargs); + type_table_handle = grub_parttool_register ("pc_partition_map", + grub_pcpart_type, + grub_pcpart_typeargs); + +} +GRUB_MOD_FINI(pcpart) +{ + grub_parttool_unregister (activate_table_handle); + grub_parttool_unregister (type_table_handle); +} From 761319cfd3d6ea826ab376592bbef15d2039b025 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 6 Apr 2009 16:15:36 +0000 Subject: [PATCH 0608/1707] 2009-04-06 Pavel Roskin * commands/help.c (print_command_help): Use cmd->prio, not cmd->flags to check for GRUB_PRIO_LIST_FLAG_ACTIVE. --- ChangeLog | 5 +++++ commands/help.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 30ad96a19..62115be13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-06 Pavel Roskin + + * commands/help.c (print_command_help): Use cmd->prio, not + cmd->flags to check for GRUB_PRIO_LIST_FLAG_ACTIVE. + 2009-04-06 Vladimir Serbinenko Parttool diff --git a/commands/help.c b/commands/help.c index 10da69ad1..02b841d05 100644 --- a/commands/help.c +++ b/commands/help.c @@ -55,7 +55,7 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc, int print_command_help (grub_command_t cmd) { - if (cmd->flags & GRUB_PRIO_LIST_FLAG_ACTIVE) + if (cmd->prio & GRUB_PRIO_LIST_FLAG_ACTIVE) { if (! grub_strncmp (cmd->name, currarg, grub_strlen (currarg))) { From 1007d1f5627be46c9ebfec12620cbbcae3960c97 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 7 Apr 2009 00:48:57 +0000 Subject: [PATCH 0609/1707] 2009-04-06 Pavel Roskin * include/grub/misc.h (ARRAY_SIZE): New macro. * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): New macro. * loader/i386/linux.c (allocate_pages): Use free_pages(). (grub_linux_unload): Don't use free_pages(). (grub_linux_boot): Prevent accessing linux_vesafb_modes with a wrong index. Treat all other modes as text modes. (grub_cmd_linux): Initialize vid_mode unconditionally to GRUB_LINUX_VID_MODE_NORMAL. Recognize and support "vga=ask". --- ChangeLog | 10 ++++++++++ include/grub/i386/linux.h | 1 + include/grub/misc.h | 1 + loader/i386/linux.c | 15 +++++++++------ 4 files changed, 21 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 62115be13..ff629413c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2009-04-06 Pavel Roskin + * include/grub/misc.h (ARRAY_SIZE): New macro. + * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): + New macro. + * loader/i386/linux.c (allocate_pages): Use free_pages(). + (grub_linux_unload): Don't use free_pages(). + (grub_linux_boot): Prevent accessing linux_vesafb_modes with a + wrong index. Treat all other modes as text modes. + (grub_cmd_linux): Initialize vid_mode unconditionally to + GRUB_LINUX_VID_MODE_NORMAL. Recognize and support "vga=ask". + * commands/help.c (print_command_help): Use cmd->prio, not cmd->flags to check for GRUB_PRIO_LIST_FLAG_ACTIVE. diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index d5b520729..dad38e545 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -38,6 +38,7 @@ #define GRUB_LINUX_VID_MODE_NORMAL 0xFFFF #define GRUB_LINUX_VID_MODE_EXTENDED 0xFFFE #define GRUB_LINUX_VID_MODE_ASK 0xFFFD +#define GRUB_LINUX_VID_MODE_VESA_START 0x0301 #define GRUB_LINUX_SETUP_MOVE_SIZE 0x9100 #define GRUB_LINUX_CL_MAGIC 0xA33F diff --git a/include/grub/misc.h b/include/grub/misc.h index c377c20a2..3490db0d5 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -26,6 +26,7 @@ #include #define ALIGN_UP(addr, align) (((grub_uint64_t)addr + align - 1) & ~(align - 1)) +#define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) #define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args); /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */ diff --git a/loader/i386/linux.c b/loader/i386/linux.c index a2fff83fa..01d10d598 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -206,8 +206,7 @@ allocate_pages (grub_size_t prot_size) prot_mode_pages = (prot_size >> 12); /* Initialize the memory pointers with NULL for convenience. */ - real_mode_mem = 0; - prot_mode_mem = 0; + free_pages (); /* FIXME: Should request low memory from the heap when this feature is implemented. */ @@ -332,7 +331,9 @@ grub_linux_boot (void) params = real_mode_mem; - if (vid_mode == GRUB_LINUX_VID_MODE_NORMAL || vid_mode == GRUB_LINUX_VID_MODE_EXTENDED) + if (vid_mode < GRUB_LINUX_VID_MODE_VESA_START || + vid_mode >= GRUB_LINUX_VID_MODE_VESA_START + + ARRAY_SIZE (linux_vesafb_modes)) grub_video_restore (); else if (vid_mode) { @@ -340,7 +341,7 @@ grub_linux_boot (void) int depth, flags; flags = 0; - linux_mode = &linux_vesafb_modes[vid_mode - 0x301]; + linux_mode = &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START]; depth = linux_mode->depth; /* If we have 8 or less bits, then assume that it is indexed color mode. */ @@ -443,7 +444,6 @@ grub_linux_boot (void) static grub_err_t grub_linux_unload (void) { - free_pages (); grub_dl_unref (my_mod); loaded = 0; return GRUB_ERR_NONE; @@ -569,7 +569,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_printf (" [Linux-bzImage, setup=0x%x, size=0x%x]\n", (unsigned) real_size, (unsigned) prot_size); - /* Detect explicitly specified memory size, if any. */ + /* Look for memory size and video mode specified on the command line. */ + vid_mode = GRUB_LINUX_VID_MODE_NORMAL; linux_mem_size = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "vga=", 4) == 0) @@ -581,6 +582,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), vid_mode = GRUB_LINUX_VID_MODE_NORMAL; else if (grub_strcmp (val, "ext") == 0) vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; + else if (grub_strcmp (val, "ask") == 0) + vid_mode = GRUB_LINUX_VID_MODE_ASK; else vid_mode = (grub_uint16_t) grub_strtoul (val, 0, 0); From c2cdde70b367924b040634a912066206bb0268f5 Mon Sep 17 00:00:00 2001 From: davem Date: Tue, 7 Apr 2009 23:48:28 +0000 Subject: [PATCH 0610/1707] * kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add support for R_SPARC_OLO10 relocations. Fix compile warning for R_SPARC_WDISP30 case. --- ChangeLog | 6 ++++++ kern/sparc64/dl.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ff629413c..c7e854ede 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-07 David S. Miller + + * kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add + support for R_SPARC_OLO10 relocations. Fix compile warning for + R_SPARC_WDISP30 case. + 2009-04-06 Pavel Roskin * include/grub/misc.h (ARRAY_SIZE): New macro. diff --git a/kern/sparc64/dl.c b/kern/sparc64/dl.c index 28ea35279..29b8c8a9a 100644 --- a/kern/sparc64/dl.c +++ b/kern/sparc64/dl.c @@ -95,7 +95,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) + entsize * ELF64_R_SYM (rel->r_info)); value = sym->st_value + rel->r_addend; - switch (ELF64_R_TYPE (rel->r_info)) + switch (ELF64_R_TYPE (rel->r_info) & 0xff) { case R_SPARC_32: /* 3 V-word32 */ if (value & 0xFFFFFFFF00000000) @@ -105,8 +105,8 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) break; case R_SPARC_WDISP30: /* 7 V-disp30 */ if (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000) && - ((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000 - != 0xFFFFFFFF00000000)) + (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000) + != 0xFFFFFFFF00000000)) return grub_error (GRUB_ERR_BAD_MODULE, "Displacement out of 30 bits range"); *addr = (*addr & 0xC0000000) | @@ -125,6 +125,12 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) case R_SPARC_64: /* 32 V-xwords64 */ *(Elf64_Xword *) addr = value; break; + case R_SPARC_OLO10: + *addr = (*addr & ~0x1fff) + | (((value & 0x3ff) + + (ELF64_R_TYPE (rel->r_info) >> 8)) + & 0x1fff); + break; default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "This relocation (%d) is not implemented yet", From ea3f72cf0eec8fb25e1577bc666ec4032755d189 Mon Sep 17 00:00:00 2001 From: davem Date: Tue, 7 Apr 2009 23:49:27 +0000 Subject: [PATCH 0611/1707] * kern/sparc64/cache.S: Fix grub_arch_sync_caches implementation. --- ChangeLog | 1 + kern/sparc64/cache.S | 26 ++++++++++++-------------- 2 files changed, 13 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7e854ede..c67998201 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add support for R_SPARC_OLO10 relocations. Fix compile warning for R_SPARC_WDISP30 case. + * kern/sparc64/cache.S: Fix grub_arch_sync_caches implementation. 2009-04-06 Pavel Roskin diff --git a/kern/sparc64/cache.S b/kern/sparc64/cache.S index 2ebb69341..1a16adde8 100644 --- a/kern/sparc64/cache.S +++ b/kern/sparc64/cache.S @@ -1,7 +1,7 @@ /* cache.S - Flush the processor cache for a specific region. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -27,17 +27,15 @@ * void grub_arch_sync_caches (void *address, grub_size_t len) */ FUNCTION(grub_arch_sync_caches) - save %o6, -0xC, %o6 ! Get a new register window, - ! reserve space on stack for - ! %i0, %i1, %i2 - brz,pn %i0, return ! Return if address == 0. - nop - brz,pn %i1, return ! Return if len == 0. - clr %i2 ! index = 0. -loop: flush %i0 + %i2 ! Flush address + index. - cmp %i1, %i2 ! Compare len & index . - bpos,a,pt %xcc, loop ! If len > index, loop. - add %i2, 8, %i2 ! Go to next doubleword. -return: ret ! Restore caller's register - restore ! window and return. + brz,pn %o1, 2f + add %o0, %o1, %o1 + add %o1, 7, %o1 + andn %o1, 7, %o1 + andn %o0, 7, %o0 + sub %o1, %o0, %o1 +1: subcc %o1, 8, %o1 + bne,pt %icc, 1b + flush %o0 + %o1 +2: retl + nop From af63ada2bd7e624261cbe9b6b9d58134bf51b6e3 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 8 Apr 2009 15:03:50 +0000 Subject: [PATCH 0612/1707] 2009-04-08 Felix Zielcke * disk/lvm.c (grub_lvm_scan_device): Add a missing NULL check. --- ChangeLog | 4 ++++ disk/lvm.c | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c67998201..c728d7b26 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-08 Felix Zielcke + + * disk/lvm.c (grub_lvm_scan_device): Add a missing NULL check. + 2009-04-07 David S. Miller * kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Add diff --git a/disk/lvm.c b/disk/lvm.c index 6ebde636f..d47d4c7b5 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -530,7 +530,8 @@ grub_lvm_scan_device (const char *name) goto fail4; } - p = grub_strchr (p, '}'); + if (p != NULL) + p = grub_strchr (p, '}'); if (p == NULL) goto lvs_fail; p += 3; From e7e6862a4cec8f0cb3feb3224d44877ba1283c16 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 10 Apr 2009 15:33:34 +0000 Subject: [PATCH 0613/1707] 2009-04-10 Bean * include/grub/efi/api.h (grub_efi_configuration_table): Add packed attribute, otherwise the size would be wrong for i386 platform. * include/grub/pci.h (grub_pci_read_word): New inline function. (grub_pci_read_byte): Likewise. (grub_pci_write): Likewise. (grub_pci_write_word): Likewise. (grub_pci_write_byte): Likewise. * include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR. * loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module. (find_framebuf): Scan pci to locate the frame buffer address. * commands/efi/fixvideo.c: New file. * commands/efi/loadbios.c: Likewise. * commands/memrw.c: Likewise. * util/grub-dumpbios.in: Likewise. * conf/common.rmk (grub-dumpbios): New utility. (pkglib_MODULES): New module memrw.mod. (memrw_mod_SOURCE): New macro. (memrw_mod_CFLAGS): Likewise. (memrw_mod_LDFLAGS): Likewise. * conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and fixvideo.mod. (loadbios_mod_SOURCE): New macro. (loadbios_mod_CFLAGS): Likewise. (loadbios_mod_LDFLAGS): Likewise. (fixvideo_mod_SOURCE): Likewise. (fixvideo_mod_CFLAGS): Likewise. (fixvideo_mod_LDFLAGS): Likewise. * conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and fixvideo.mod. (loadbios_mod_SOURCE): New macro. (loadbios_mod_CFLAGS): Likewise. (loadbios_mod_LDFLAGS): Likewise. (fixvideo_mod_SOURCE): Likewise. (fixvideo_mod_CFLAGS): Likewise. (fixvideo_mod_LDFLAGS): Likewise. --- ChangeLog | 48 ++++++ DISTLIST | 4 + commands/efi/fixvideo.c | 110 ++++++++++++++ commands/efi/loadbios.c | 212 +++++++++++++++++++++++++++ commands/memrw.c | 101 +++++++++++++ conf/common.mk | 66 ++++++++- conf/common.rmk | 14 +- conf/i386-efi.mk | 116 ++++++++++++++- conf/i386-efi.rmk | 12 +- conf/x86_64-efi.mk | 116 ++++++++++++++- conf/x86_64-efi.rmk | 12 +- include/grub/efi/api.h | 2 +- include/grub/i386/pci.h | 35 +++++ include/grub/pci.h | 4 +- loader/i386/efi/linux.c | 314 ++++++++++++++++++++-------------------- util/grub-dumpbios.in | 58 ++++++++ 16 files changed, 1062 insertions(+), 162 deletions(-) create mode 100644 commands/efi/fixvideo.c create mode 100644 commands/efi/loadbios.c create mode 100644 commands/memrw.c create mode 100644 util/grub-dumpbios.in diff --git a/ChangeLog b/ChangeLog index c728d7b26..549f223cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,51 @@ +2009-04-10 Bean + + * include/grub/efi/api.h (grub_efi_configuration_table): Add packed + attribute, otherwise the size would be wrong for i386 platform. + + * include/grub/pci.h (grub_pci_read_word): New inline function. + (grub_pci_read_byte): Likewise. + (grub_pci_write): Likewise. + (grub_pci_write_word): Likewise. + (grub_pci_write_byte): Likewise. + + * include/grub/pci.h (grub_pci_iteratefunc_t): Add NESTED_FUNC_ATTR. + + * loader/i386/efi/linux.c (fake_bios_data): Moved to loadbios module. + (find_framebuf): Scan pci to locate the frame buffer address. + + * commands/efi/fixvideo.c: New file. + + * commands/efi/loadbios.c: Likewise. + + * commands/memrw.c: Likewise. + + * util/grub-dumpbios.in: Likewise. + + * conf/common.rmk (grub-dumpbios): New utility. + (pkglib_MODULES): New module memrw.mod. + (memrw_mod_SOURCE): New macro. + (memrw_mod_CFLAGS): Likewise. + (memrw_mod_LDFLAGS): Likewise. + + * conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and + fixvideo.mod. + (loadbios_mod_SOURCE): New macro. + (loadbios_mod_CFLAGS): Likewise. + (loadbios_mod_LDFLAGS): Likewise. + (fixvideo_mod_SOURCE): Likewise. + (fixvideo_mod_CFLAGS): Likewise. + (fixvideo_mod_LDFLAGS): Likewise. + + * conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and + fixvideo.mod. + (loadbios_mod_SOURCE): New macro. + (loadbios_mod_CFLAGS): Likewise. + (loadbios_mod_LDFLAGS): Likewise. + (fixvideo_mod_SOURCE): Likewise. + (fixvideo_mod_CFLAGS): Likewise. + (fixvideo_mod_LDFLAGS): Likewise. + 2009-04-08 Felix Zielcke * disk/lvm.c (grub_lvm_scan_device): Add a missing NULL check. diff --git a/DISTLIST b/DISTLIST index 57fb3020c..889226402 100644 --- a/DISTLIST +++ b/DISTLIST @@ -58,6 +58,7 @@ commands/loadenv.c commands/ls.c commands/lsmmap.c commands/lspci.c +commands/memrw.c commands/minicmd.c commands/parttool.c commands/read.c @@ -67,6 +68,8 @@ commands/sleep.c commands/test.c commands/usbtest.c commands/videotest.c +commands/efi/fixvideo.c +commands/efi/loadbios.c commands/i386/cpuid.c commands/i386/pc/halt.c commands/i386/pc/play.c @@ -446,6 +449,7 @@ term/i386/pc/vga_text.c term/ieee1275/ofconsole.c util/console.c util/getroot.c +util/grub-dumpbios.in util/grub-editenv.c util/grub-emu.c util/grub-fstest.c diff --git a/commands/efi/fixvideo.c b/commands/efi/fixvideo.c new file mode 100644 index 000000000..013c1eec6 --- /dev/null +++ b/commands/efi/fixvideo.c @@ -0,0 +1,110 @@ +/* fixvideo.c - fix video problem in efi */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +static struct grub_video_patch +{ + const char *name; + grub_uint32_t pci_id; + grub_uint32_t mmio_bar; + grub_uint32_t mmio_reg; + grub_uint32_t mmio_old; +} video_patches[] = + { + {"Intel 945GM", 0x27a28086, 0, 0x71184, 0x1000000}, /* DSPBBASE */ + {"Intel 965GM", 0x2a028086, 0, 0x7119C, 0x1000000}, /* DSPBSURF */ + {0, 0, 0, 0, 0} + }; + +static int NESTED_FUNC_ATTR +scan_card (int bus, int dev, int func, grub_pci_id_t pciid) +{ + grub_pci_address_t addr; + + addr = grub_pci_make_address (bus, dev, func, 2); + if (grub_pci_read_byte (addr + 3) == 0x3) + { + struct grub_video_patch *p = video_patches; + + while (p->name) + { + if (p->pci_id == pciid) + { + grub_target_addr_t base; + + grub_printf ("Found graphic card: %s\n", p->name); + addr += 8 + p->mmio_bar * 4; + base = grub_pci_read (addr); + if ((! base) || (base & GRUB_PCI_ADDR_SPACE_IO) || + (base & GRUB_PCI_ADDR_MEM_PREFETCH)) + grub_printf ("Invalid MMIO bar %d\n", p->mmio_bar); + else + { + base &= GRUB_PCI_ADDR_MEM_MASK; + base += p->mmio_reg; + + if (*((volatile grub_uint32_t *) base) != p->mmio_old) + grub_printf ("Old value don't match\n"); + else + { + *((volatile grub_uint32_t *) base) = 0; + if (*((volatile grub_uint32_t *) base)) + grub_printf ("Set MMIO fails\n"); + } + } + + return 1; + } + p++; + } + + grub_printf ("Unknown graphic card: %x\n", pciid); + } + + return 0; +} + +static grub_err_t +grub_cmd_fixvideo (grub_command_t cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + grub_pci_iterate (scan_card); + return 0; +} + +static grub_command_t cmd_fixvideo; + +GRUB_MOD_INIT(fixvideo) +{ + (void) mod; /* To stop warning. */ + cmd_fixvideo = grub_register_command ("fix_video", grub_cmd_fixvideo, + 0, "Fix video problem."); + +} + +GRUB_MOD_FINI(fixvideo) +{ + grub_unregister_command (cmd_fixvideo); +} diff --git a/commands/efi/loadbios.c b/commands/efi/loadbios.c new file mode 100644 index 000000000..0b57d1bee --- /dev/null +++ b/commands/efi/loadbios.c @@ -0,0 +1,212 @@ +/* loadbios.c - command to load a bios dump */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; +static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; +static grub_efi_guid_t smbios_guid = GRUB_EFI_SMBIOS_TABLE_GUID; + +#define EBDA_SEG_ADDR 0x40e +#define LOW_MEM_ADDR 0x413 +#define FAKE_EBDA_SEG 0x9fc0 + +#define BLANK_MEM 0xffffffff +#define VBIOS_ADDR 0xc0000 +#define SBIOS_ADDR 0xf0000 + +static int +enable_rom_area (void) +{ + grub_pci_address_t addr; + grub_uint32_t *rom_ptr; + + rom_ptr = (grub_uint32_t *) VBIOS_ADDR; + if (*rom_ptr != BLANK_MEM) + { + grub_printf ("ROM image present.\n"); + return 0; + } + + addr = grub_pci_make_address (0, 0, 0, 36); + grub_pci_write_byte (addr++, 0x30); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr++, 0x33); + grub_pci_write_byte (addr, 0); + + *rom_ptr = 0; + if (*rom_ptr != 0) + { + grub_printf ("Can\'t enable rom area.\n"); + return 0; + } + + return 1; +} + +static void +lock_rom_area (void) +{ + grub_pci_address_t addr; + + addr = grub_pci_make_address (0, 0, 0, 36); + grub_pci_write_byte (addr++, 0x10); + grub_pci_write_byte (addr++, 0x11); + grub_pci_write_byte (addr++, 0x11); + grub_pci_write_byte (addr++, 0x11); + grub_pci_write_byte (addr, 0x11); +} + +static void +fake_bios_data (int use_rom) +{ + unsigned i; + void *acpi, *smbios; + grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; + + ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; + low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; + if ((*ebda_seg_ptr) || (*low_mem_ptr)) + return; + + acpi = 0; + smbios = 0; + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + { + grub_efi_guid_t *guid = + &grub_efi_system_table->configuration_table[i].vendor_guid; + + if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) + { + acpi = grub_efi_system_table->configuration_table[i].vendor_table; + grub_dprintf ("efi", "ACPI2: %p\n", acpi); + } + else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) + { + void *t; + + t = grub_efi_system_table->configuration_table[i].vendor_table; + if (! acpi) + acpi = t; + grub_dprintf ("efi", "ACPI: %p\n", t); + } + else if (! grub_memcmp (guid, &smbios_guid, sizeof (grub_efi_guid_t))) + { + smbios = grub_efi_system_table->configuration_table[i].vendor_table; + grub_dprintf ("efi", "SMBIOS: %p\n", smbios); + } + } + + *ebda_seg_ptr = FAKE_EBDA_SEG; + *low_mem_ptr = (FAKE_EBDA_SEG >> 6); + + *((grub_uint16_t *) (FAKE_EBDA_SEG << 4)) = 640 - *low_mem_ptr; + + if (acpi) + grub_memcpy ((char *) ((FAKE_EBDA_SEG << 4) + 16), acpi, 1024 - 16); + + if ((use_rom) && (smbios)) + grub_memcpy ((char *) SBIOS_ADDR, (char *) smbios + 16, 16); +} + +static grub_err_t +grub_cmd_fakebios (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + if (enable_rom_area ()) + { + fake_bios_data (1); + lock_rom_area (); + } + else + fake_bios_data (0); +} + +static grub_err_t +grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_file_t file; + int size; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "No rom image specified"); + + if (argc > 1) + { + file = grub_file_open (argv[1]); + if (! file) + return grub_errno; + + if (file->size != 4) + grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid int10 dump size"); + else + grub_file_read (file, (char *) 0x40, 4); + + grub_file_close (file); + if (grub_errno) + return grub_errno; + } + + file = grub_file_open (argv[0]); + if (! file) + return grub_errno; + + size = file->size; + if ((size < 0x10000) || (size > 0x40000)) + grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid bios dump size"); + else if (enable_rom_area ()) + { + grub_file_read (file, (char *) VBIOS_ADDR, size); + fake_bios_data (size <= 0x40000); + lock_rom_area (); + } + + grub_file_close (file); + return grub_errno; +} + +static grub_command_t cmd_fakebios, cmd_loadbios; + +GRUB_MOD_INIT(loadbios) +{ + (void) mod; /* To stop warning. */ + cmd_fakebios = grub_register_command ("fakebios", grub_cmd_fakebios, + 0, "fake bios."); + + cmd_loadbios = grub_register_command ("loadbios", grub_cmd_loadbios, + "loadbios BIOS_DUMP [INT10_DUMP]", + "Load bios dump."); +} + +GRUB_MOD_FINI(loadbios) +{ + grub_unregister_command (cmd_fakebios); + grub_unregister_command (cmd_loadbios); +} diff --git a/commands/memrw.c b/commands/memrw.c new file mode 100644 index 000000000..fa04c7609 --- /dev/null +++ b/commands/memrw.c @@ -0,0 +1,101 @@ +/* memrw.c - command to read / write physical memory */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +static grub_command_t cmd_read_byte, cmd_read_word, cmd_read_dword; +static grub_command_t cmd_write_byte, cmd_write_word, cmd_write_dword; + +static grub_err_t +grub_cmd_read (grub_command_t cmd, int argc, char **argv) +{ + grub_target_addr_t addr; + grub_uint32_t value; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments"); + + addr = grub_strtoul (argv[0], 0, 0); + if (cmd->name[5] == 'd') + value = *((grub_uint32_t *) addr); + else if (cmd->name[5] == 'w') + value = *((grub_uint16_t *) addr); + else + value = *((grub_uint8_t *) addr); + + grub_printf ("0x%x\n", value); + + return 0; +} + +static grub_err_t +grub_cmd_write (grub_command_t cmd, int argc, char **argv) +{ + grub_target_addr_t addr; + grub_uint32_t value; + + if (argc != 2) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid number of arguments"); + + addr = grub_strtoul (argv[0], 0, 0); + value = grub_strtoul (argv[1], 0, 0); + if (cmd->name[6] == 'd') + *((grub_uint32_t *) addr) = value; + else if (cmd->name[6] == 'w') + *((grub_uint16_t *) addr) = (grub_uint16_t) value; + else + *((grub_uint8_t *) addr) = (grub_uint8_t) value; + + return 0; +} + +GRUB_MOD_INIT(memrw) +{ + (void) mod; /* To stop warning. */ + cmd_read_byte = + grub_register_command ("read_byte", grub_cmd_read, + "read_byte ADDR", "read byte."); + cmd_read_word = + grub_register_command ("read_word", grub_cmd_read, + "read_word ADDR", "read word."); + cmd_read_dword = + grub_register_command ("read_dword", grub_cmd_read, + "read_dword ADDR", "read dword."); + cmd_write_byte = + grub_register_command ("write_byte", grub_cmd_write, + "write_byte ADDR VALUE", "write byte."); + cmd_write_word = + grub_register_command ("write_word", grub_cmd_write, + "write_word ADDR VALUE", "write word."); + cmd_write_dword = + grub_register_command ("write_dword", grub_cmd_write, + "write_dword ADDR VALUE", "write dword."); +} + +GRUB_MOD_FINI(memrw) +{ + grub_unregister_command (cmd_read_byte); + grub_unregister_command (cmd_read_word); + grub_unregister_command (cmd_read_dword); + grub_unregister_command (cmd_write_byte); + grub_unregister_command (cmd_write_word); + grub_unregister_command (cmd_write_dword); +} diff --git a/conf/common.mk b/conf/common.mk index 3f052f626..f707d5315 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -600,6 +600,12 @@ CLEANFILES += $(grub-mkconfig_SCRIPTS) grub-mkconfig_DATA += util/grub.d/README +# For grub-dumpbios +grub-dumpbios: util/grub-dumpbios.in config.status + ./config.status --file=$@:$< + chmod +x $@ +sbin_SCRIPTS += grub-dumpbios +CLEANFILES += grub-dumpbios # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ @@ -2444,7 +2450,8 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod parttool.mod pcpart.mod + read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ + pcpart.mod memrw.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -3852,6 +3859,63 @@ partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist. crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memrw.mod. +memrw_mod_SOURCES = commands/memrw.c +CLEANFILES += memrw.mod mod-memrw.o mod-memrw.c pre-memrw.o memrw_mod-commands_memrw.o und-memrw.lst +ifneq ($(memrw_mod_EXPORTS),no) +CLEANFILES += def-memrw.lst +DEFSYMFILES += def-memrw.lst +endif +MOSTLYCLEANFILES += memrw_mod-commands_memrw.d +UNDSYMFILES += und-memrw.lst + +memrw.mod: pre-memrw.o mod-memrw.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memrw.o mod-memrw.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-memrw.o: $(memrw_mod_DEPENDENCIES) memrw_mod-commands_memrw.o + -rm -f $@ + $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memrw_mod-commands_memrw.o + +mod-memrw.o: mod-memrw.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -c -o $@ $< + +mod-memrw.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'memrw' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(memrw_mod_EXPORTS),no) +def-memrw.lst: pre-memrw.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memrw/' > $@ +endif + +und-memrw.lst: pre-memrw.o + echo 'memrw' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +memrw_mod-commands_memrw.o: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) + $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -MD -c -o $@ $< +-include memrw_mod-commands_memrw.d + +CLEANFILES += cmd-memrw_mod-commands_memrw.lst fs-memrw_mod-commands_memrw.lst partmap-memrw_mod-commands_memrw.lst +COMMANDFILES += cmd-memrw_mod-commands_memrw.lst +FSFILES += fs-memrw_mod-commands_memrw.lst +PARTMAPFILES += partmap-memrw_mod-commands_memrw.lst + +cmd-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memrw > $@ || (rm -f $@; exit 1) + +fs-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memrw > $@ || (rm -f $@; exit 1) + +partmap-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memrw > $@ || (rm -f $@; exit 1) + + +memrw_mod_CFLAGS = $(COMMON_CFLAGS) +memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/common.rmk b/conf/common.rmk index e9a5b8756..b0a78b0d8 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -155,6 +155,12 @@ CLEANFILES += $(grub-mkconfig_SCRIPTS) grub-mkconfig_DATA += util/grub.d/README +# For grub-dumpbios +grub-dumpbios: util/grub-dumpbios.in config.status + ./config.status --file=$@:$< + chmod +x $@ +sbin_SCRIPTS += grub-dumpbios +CLEANFILES += grub-dumpbios # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ @@ -335,7 +341,8 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod parttool.mod pcpart.mod + read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ + pcpart.mod memrw.mod # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c @@ -452,6 +459,11 @@ crc_mod_SOURCES = commands/crc.c lib/crc.c crc_mod_CFLAGS = $(COMMON_CFLAGS) crc_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memrw.mod. +memrw_mod_SOURCES = commands/memrw.c +memrw_mod_CFLAGS = $(COMMON_CFLAGS) +memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk index 400e00705..455acc3a7 100644 --- a/conf/i386-efi.mk +++ b/conf/i386-efi.mk @@ -120,7 +120,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1759,5 +1759,119 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst +ifneq ($(loadbios_mod_EXPORTS),no) +CLEANFILES += def-loadbios.lst +DEFSYMFILES += def-loadbios.lst +endif +MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d +UNDSYMFILES += und-loadbios.lst + +loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o + +mod-loadbios.o: mod-loadbios.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< + +mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(loadbios_mod_EXPORTS),no) +def-loadbios.lst: pre-loadbios.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ +endif + +und-loadbios.lst: pre-loadbios.o + echo 'loadbios' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< +-include loadbios_mod-commands_efi_loadbios.d + +CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst +COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst +FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst +PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst + +cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) + +fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) + +partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) + + +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst +ifneq ($(fixvideo_mod_EXPORTS),no) +CLEANFILES += def-fixvideo.lst +DEFSYMFILES += def-fixvideo.lst +endif +MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d +UNDSYMFILES += und-fixvideo.lst + +fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o + +mod-fixvideo.o: mod-fixvideo.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< + +mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(fixvideo_mod_EXPORTS),no) +def-fixvideo.lst: pre-fixvideo.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ +endif + +und-fixvideo.lst: pre-fixvideo.o + echo 'fixvideo' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< +-include fixvideo_mod-commands_efi_fixvideo.d + +CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst +COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst +FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst +PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst + +cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) + +fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) + +partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) + + +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index bfda86d93..399376ffb 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -81,7 +81,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -184,5 +184,15 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk index 868356c9c..6cbcd15b4 100644 --- a/conf/x86_64-efi.mk +++ b/conf/x86_64-efi.mk @@ -108,7 +108,7 @@ grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPE # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -1767,5 +1767,119 @@ partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPEND datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst +ifneq ($(loadbios_mod_EXPORTS),no) +CLEANFILES += def-loadbios.lst +DEFSYMFILES += def-loadbios.lst +endif +MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d +UNDSYMFILES += und-loadbios.lst + +loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o + -rm -f $@ + $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o + +mod-loadbios.o: mod-loadbios.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< + +mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(loadbios_mod_EXPORTS),no) +def-loadbios.lst: pre-loadbios.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ +endif + +und-loadbios.lst: pre-loadbios.o + echo 'loadbios' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< +-include loadbios_mod-commands_efi_loadbios.d + +CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst +COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst +FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst +PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst + +cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) + +fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) + +partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) + + +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst +ifneq ($(fixvideo_mod_EXPORTS),no) +CLEANFILES += def-fixvideo.lst +DEFSYMFILES += def-fixvideo.lst +endif +MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d +UNDSYMFILES += und-fixvideo.lst + +fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ + +pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o + -rm -f $@ + $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o + +mod-fixvideo.o: mod-fixvideo.c + $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< + +mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh + sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) + +ifneq ($(fixvideo_mod_EXPORTS),no) +def-fixvideo.lst: pre-fixvideo.o + $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ +endif + +und-fixvideo.lst: pre-fixvideo.o + echo 'fixvideo' > $@ + $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ + +fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) + $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< +-include fixvideo_mod-commands_efi_fixvideo.d + +CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst +COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst +FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst +PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst + +cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) + +fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) + +partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh + set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) + + +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 09bce5f27..9f9f978be 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -83,7 +83,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -187,5 +187,15 @@ datehook_mod_SOURCES = hook/datehook.c datehook_mod_CFLAGS = $(COMMON_CFLAGS) datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For loadbios.mod +loadbios_mod_SOURCES = commands/efi/loadbios.c +loadbios_mod_CFLAGS = $(COMMON_CFLAGS) +loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For fixvideo.mod +fixvideo_mod_SOURCES = commands/efi/fixvideo.c +fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) +fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index a764b370d..598c7c359 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -933,7 +933,7 @@ struct grub_efi_configuration_table { grub_efi_guid_t vendor_guid; void *vendor_table; -}; +} __attribute__ ((packed)); typedef struct grub_efi_configuration_table grub_efi_configuration_table_t; struct grub_efi_simple_input_interface diff --git a/include/grub/i386/pci.h b/include/grub/i386/pci.h index f4f08ab11..996f64245 100644 --- a/include/grub/i386/pci.h +++ b/include/grub/i386/pci.h @@ -32,4 +32,39 @@ grub_pci_read (grub_pci_address_t addr) return grub_inl (GRUB_PCI_DATA_REG); } +static inline grub_uint16_t +grub_pci_read_word (grub_pci_address_t addr) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + return grub_inw (GRUB_PCI_DATA_REG + (addr & 3)); +} + +static inline grub_uint8_t +grub_pci_read_byte (grub_pci_address_t addr) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + return grub_inb (GRUB_PCI_DATA_REG + (addr & 3)); +} + +static inline void +grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) +{ + grub_outl (addr, GRUB_PCI_ADDR_REG); + grub_outl (data, GRUB_PCI_DATA_REG); +} + +static inline void +grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + grub_outw (data, GRUB_PCI_DATA_REG + (addr & 3)); +} + +static inline void +grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) +{ + grub_outl (addr & ~3, GRUB_PCI_ADDR_REG); + grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3)); +} + #endif /* GRUB_CPU_PCI_H */ diff --git a/include/grub/pci.h b/include/grub/pci.h index aceee494f..7c8b50528 100644 --- a/include/grub/pci.h +++ b/include/grub/pci.h @@ -36,8 +36,8 @@ #define GRUB_PCI_ADDR_IO_MASK ~0x03 typedef grub_uint32_t grub_pci_id_t; -typedef int (*grub_pci_iteratefunc_t) (int bus, int device, int func, - grub_pci_id_t pciid); +typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t) + (int bus, int device, int func, grub_pci_id_t pciid); typedef grub_uint32_t grub_pci_address_t; grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device, diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index d8c6a67c1..100b268be 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -30,6 +30,7 @@ #include #include #include +#include #include #define GRUB_LINUX_CL_OFFSET 0x1000 @@ -248,9 +249,9 @@ allocate_pages (grub_size_t prot_size) } grub_dprintf ("linux", "real_mode_mem = %lx, real_mode_pages = %x, " - "prot_mode_mem = %lx, prot_mode_pages = %x\n", - (unsigned long) real_mode_mem, (unsigned) real_mode_pages, - (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); + "prot_mode_mem = %lx, prot_mode_pages = %x\n", + (unsigned long) real_mode_mem, (unsigned) real_mode_pages, + (unsigned long) prot_mode_mem, (unsigned) prot_mode_pages); grub_free (mmap); return 1; @@ -263,8 +264,8 @@ allocate_pages (grub_size_t prot_size) static void grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, - grub_uint64_t start, grub_uint64_t size, - grub_uint32_t type) + grub_uint64_t start, grub_uint64_t size, + grub_uint32_t type) { int n = *e820_num; @@ -283,57 +284,6 @@ grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, } } -static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; -static grub_efi_guid_t acpi2_guid = GRUB_EFI_ACPI_20_TABLE_GUID; - -#define EBDA_SEG_ADDR 0x40e -#define LOW_MEM_ADDR 0x413 -#define FAKE_EBDA_SEG 0x9fc0 - -static void -fake_bios_data (void) -{ - unsigned i; - void *acpi; - grub_uint16_t *ebda_seg_ptr, *low_mem_ptr; - - acpi = 0; - for (i = 0; i < grub_efi_system_table->num_table_entries; i++) - { - grub_efi_guid_t *guid = - &grub_efi_system_table->configuration_table[i].vendor_guid; - - if (! grub_memcmp (guid, &acpi2_guid, sizeof (grub_efi_guid_t))) - { - acpi = grub_efi_system_table->configuration_table[i].vendor_table; - grub_dprintf ("linux", "ACPI2: %p\n", acpi); - } - else if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) - { - void *t; - - t = grub_efi_system_table->configuration_table[i].vendor_table; - if (! acpi) - acpi = t; - grub_dprintf ("linux", "ACPI: %p\n", t); - } - } - - if (acpi == 0) - return; - - ebda_seg_ptr = (grub_uint16_t *) EBDA_SEG_ADDR; - low_mem_ptr = (grub_uint16_t *) LOW_MEM_ADDR; - - if ((*ebda_seg_ptr) || (*low_mem_ptr)) - return; - - *ebda_seg_ptr = FAKE_EBDA_SEG; - *low_mem_ptr = FAKE_EBDA_SEG >> 6; - - grub_memcpy ((char *) (FAKE_EBDA_SEG << 4), acpi, 1024); -} - #ifdef __x86_64__ struct { @@ -353,13 +303,11 @@ grub_linux_boot (void) grub_efi_memory_descriptor_t *desc; int e820_num; - fake_bios_data (); - params = real_mode_mem; grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", (unsigned) params->code32_start, - (unsigned long) &(idt_desc.limit), + (unsigned long) &(idt_desc.limit), (unsigned long) &(gdt_desc.limit)); grub_dprintf ("linux", "idt = %x:%lx, gdt = %x:%lx\n", (unsigned) idt_desc.limit, (unsigned long) idt_desc.base, @@ -376,69 +324,69 @@ grub_linux_boot (void) desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { switch (desc->type) - { - case GRUB_EFI_ACPI_RECLAIM_MEMORY: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_ACPI); - break; + { + case GRUB_EFI_ACPI_RECLAIM_MEMORY: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_ACPI); + break; - case GRUB_EFI_ACPI_MEMORY_NVS: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_NVS); - break; + case GRUB_EFI_ACPI_MEMORY_NVS: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_NVS); + break; - case GRUB_EFI_RUNTIME_SERVICES_CODE: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_EXEC_CODE); - break; + case GRUB_EFI_RUNTIME_SERVICES_CODE: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_EXEC_CODE); + break; - case GRUB_EFI_LOADER_CODE: - case GRUB_EFI_LOADER_DATA: - case GRUB_EFI_BOOT_SERVICES_CODE: - case GRUB_EFI_BOOT_SERVICES_DATA: - case GRUB_EFI_CONVENTIONAL_MEMORY: - { - grub_uint64_t start, size, end; + case GRUB_EFI_LOADER_CODE: + case GRUB_EFI_LOADER_DATA: + case GRUB_EFI_BOOT_SERVICES_CODE: + case GRUB_EFI_BOOT_SERVICES_DATA: + case GRUB_EFI_CONVENTIONAL_MEMORY: + { + grub_uint64_t start, size, end; - start = desc->physical_start; - size = desc->num_pages << 12; - end = start + size; + start = desc->physical_start; + size = desc->num_pages << 12; + end = start + size; - /* Skip A0000 - 100000 region. */ - if ((start < 0x100000ULL) && (end > 0xA0000ULL)) - { - if (start < 0xA0000ULL) - { - grub_e820_add_region (params->e820_map, &e820_num, - start, - 0xA0000ULL - start, - GRUB_E820_RAM); - } + /* Skip A0000 - 100000 region. */ + if ((start < 0x100000ULL) && (end > 0xA0000ULL)) + { + if (start < 0xA0000ULL) + { + grub_e820_add_region (params->e820_map, &e820_num, + start, + 0xA0000ULL - start, + GRUB_E820_RAM); + } - if (end <= 0x100000ULL) - continue; + if (end <= 0x100000ULL) + continue; - start = 0x100000ULL; - size = end - start; - } + start = 0x100000ULL; + size = end - start; + } - grub_e820_add_region (params->e820_map, &e820_num, - start, size, GRUB_E820_RAM); - break; - } + grub_e820_add_region (params->e820_map, &e820_num, + start, size, GRUB_E820_RAM); + break; + } - default: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_RESERVED); - } + default: + grub_e820_add_region (params->e820_map, &e820_num, + desc->physical_start, + desc->num_pages << 12, + GRUB_E820_RESERVED); + } } params->mmap_size = e820_num; @@ -520,41 +468,106 @@ static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; #define FBTEST_STEP (0x10000 >> 2) #define FBTEST_COUNT 8 -static grub_uint32_t fb_list[]= - {0x40000000, 0x80000000, 0xc0000000, 0}; +static int +find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) +{ + grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb_base; + int i; + + for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) + { + if ((*base & RGB_MASK) == RGB_MAGIC) + { + int j; + + for (j = LINE_MIN; j <= LINE_MAX; j++) + { + if ((base[j] & RGB_MASK) == RGB_MAGIC) + { + *fb_base = (grub_uint32_t) (grub_target_addr_t) base; + *line_len = j << 2; + + return 1; + } + } + + break; + } + } + + return 0; +} static int find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) { - grub_uint32_t *fb; + int found = 0; - for (fb = fb_list; *fb; fb++) + auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, + grub_pci_id_t pciid); + + int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, + grub_pci_id_t pciid) { - grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb; - int i; + grub_pci_address_t addr; - for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) - { - if ((*base & RGB_MASK) == RGB_MAGIC) + addr = grub_pci_make_address (bus, dev, func, 2); + if (grub_pci_read (addr) >> 24 == 0x3) + { + int i; + + grub_printf ("Display controller: %d:%d.%d\nDevice id: %x\n", + bus, dev, func, pciid); + addr += 8; + for (i = 0; i < 6; i++, addr += 4) { - int j; + grub_uint32_t old_bar1, old_bar2, type; + grub_uint64_t base64; - for (j = LINE_MIN; j <= LINE_MAX; j++) - { - if ((base[j] & RGB_MASK) == RGB_MAGIC) - { - *fb_base = (grub_uint32_t) (grub_target_addr_t) base; - *line_len = j << 2; + old_bar1 = grub_pci_read (addr); + if ((! old_bar1) || (old_bar1 & GRUB_PCI_ADDR_SPACE_IO)) + continue; - return 0; - } - } + type = old_bar1 & GRUB_PCI_ADDR_MEM_TYPE_MASK; + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + if (i == 5) + break; - break; - } - } + old_bar2 = grub_pci_read (addr + 4); + } + else + old_bar2 = 0; + + base64 = old_bar2; + base64 <<= 32; + base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK); + + grub_printf ("%s(%d): 0x%llx\n", + ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ? + "VMEM" : "MMIO"), i, + (unsigned long long) base64); + + if ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) && (! found)) + { + *fb_base = base64; + if (find_line_len (fb_base, line_len)) + found++; + } + + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + i++; + addr += 4; + } + } + } + + return found; } - return 1; + + grub_pci_iterate (find_card); + return found; } static int @@ -580,13 +593,13 @@ grub_linux_setup_video (struct linux_kernel_params *params) ret = find_framebuf (&fb_base, &line_len); grub_efi_set_text_mode (1); - if (ret) + if (! ret) { grub_printf ("Can\'t find frame buffer address\n"); return 1; } - grub_printf ("Video frame buffer: 0x%x\n", fb_base); + grub_printf ("Frame buffer base: 0x%x\n", fb_base); grub_printf ("Video line length: %d\n", line_len); params->lfb_width = width; @@ -606,6 +619,9 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->reserved_mask_size = 8; params->reserved_field_pos = 24; + params->have_vga = GRUB_VIDEO_TYPE_VLFB; + params->vid_mode = 0x338; /* 1024x768x32 */ + return 0; } @@ -621,7 +637,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_ssize_t len; int i; char *dest; - int video_type; grub_dl_ref (my_mod); @@ -808,9 +823,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_printf (" [Linux-bzImage, setup=0x%x, size=0x%x]\n", (unsigned) real_size, (unsigned) prot_size); + grub_linux_setup_video (params); + /* Detect explicitly specified memory size, if any. */ linux_mem_size = 0; - video_type = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "mem=", 4) == 0) { @@ -846,20 +862,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_mem_size <<= shift; } } - else if (grub_memcmp (argv[i], "video=", 6) == 0) + else if (grub_memcmp (argv[i], "video=efifb", 11) == 0) { - if (grub_memcmp (&argv[i][6], "vesafb", 6) == 0) - video_type = GRUB_VIDEO_TYPE_VLFB; - else if (grub_memcmp (&argv[i][6], "efifb", 5) == 0) - video_type = GRUB_VIDEO_TYPE_EFI; + if (params->have_vga) + params->have_vga = GRUB_VIDEO_TYPE_EFI; } - if (video_type) - { - if (! grub_linux_setup_video (params)) - params->have_vga = video_type; - } - /* Specify the boot file. */ dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, "BOOT_IMAGE="); @@ -946,7 +954,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), /* Usually, the compression ratio is about 50%. */ addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) - + page_align (size); + + page_align (size); /* Find the highest address to put the initrd. */ mmap_size = find_mmap_size (); @@ -968,7 +976,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), physical_end = addr_max; if (physical_end < page_align (size)) - continue; + continue; physical_end -= page_align (size); diff --git a/util/grub-dumpbios.in b/util/grub-dumpbios.in new file mode 100644 index 000000000..396503936 --- /dev/null +++ b/util/grub-dumpbios.in @@ -0,0 +1,58 @@ +#! /bin/sh +# +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "$0 (GNU GRUB @PACKAGE_VERSION@)" + exit 0 ;; + -o) + shift + output_dir=$1 + ;; + --output=) + output_dir=`echo "$option" | sed 's/--output=//'` + ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + esac +done + +dd if=/dev/mem of=${output_dir}vbios.bin bs=65536 skip=12 count=1 +dd if=/dev/mem of=${output_dir}int10.bin bs=4 skip=16 count=1 From 6df8cc7614e47061ed5f834f0f6bfdc54c4aba7e Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 10 Apr 2009 21:47:08 +0000 Subject: [PATCH 0614/1707] 2009-04-10 Vladimir Serbinenko UFS improvements * fs/ufs.c (INODE_NBLOCKS): new definition (struct grub_ufs_dirent): added fields for non-BSD dirents (grub_ufs_get_file_block): fixed double indirect handling (grub_ufs_lookup_symlink): use more robust way to determine whether symlink is inline (grub_ufs_find_file): support for non-BSD dirents (grub_ufs_dir): support for non-BSD dirents --- ChangeLog | 12 ++++++++++++ fs/ufs.c | 43 ++++++++++++++++++++++++++++++------------- 2 files changed, 42 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 549f223cc..b07bc757e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-04-10 Vladimir Serbinenko + + UFS improvements + + * fs/ufs.c (INODE_NBLOCKS): new definition + (struct grub_ufs_dirent): added fields for non-BSD dirents + (grub_ufs_get_file_block): fixed double indirect handling + (grub_ufs_lookup_symlink): use more robust way to determine whether + symlink is inline + (grub_ufs_find_file): support for non-BSD dirents + (grub_ufs_dir): support for non-BSD dirents + 2009-04-10 Bean * include/grub/efi/api.h (grub_efi_configuration_table): Add packed diff --git a/fs/ufs.c b/fs/ufs.c index e6eacd3bd..b79944950 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -54,6 +54,8 @@ grub_le_to_cpu##bits1 (data->inode.field) : \ grub_le_to_cpu##bits2 (data->inode2.field)) #define INODE_SIZE(data) INODE_ENDIAN (data,size,32,64) +#define INODE_NBLOCKS(data) INODE_ENDIAN (data,nblocks,32,64) + #define INODE_MODE(data) INODE_ENDIAN (data,mode,16,16) #define INODE_BLKSZ(data) (data->ufs_type == UFS1 ? 4 : 8) #define INODE_DIRBLOCKS(data,blk) INODE_ENDIAN \ @@ -174,8 +176,15 @@ struct grub_ufs_dirent { grub_uint32_t ino; grub_uint16_t direntlen; - grub_uint8_t filetype; - grub_uint8_t namelen; + union + { + grub_uint16_t namelen; + struct + { + grub_uint8_t filetype_bsd; + grub_uint8_t namelen_bsd; + }; + }; } __attribute__ ((packed)); /* Information about a "mounted" ufs filesystem. */ @@ -234,15 +243,16 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) blk -= indirsz; /* Double indirect block. */ - if (blk < UFS_BLKSZ (sblock) / indirsz) + if (blk < indirsz * indirsz) { grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 1) << log2_blksz, 0, sizeof (indir), (char *) indir); grub_disk_read (data->disk, - (data->ufs_type == UFS1) ? - indir[blk / indirsz] : indir [(blk / indirsz) << 1], + ((data->ufs_type == UFS1) ? + indir[blk / indirsz] : indir [(blk / indirsz) << 1]) + << log2_blksz, 0, sizeof (indir), (char *) indir); return (data->ufs_type == UFS1) ? @@ -387,8 +397,7 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) if (++data->linknest > GRUB_UFS_MAX_SYMLNK_CNT) return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); - if (INODE_SIZE (data) < (GRUB_UFS_DIRBLKS + GRUB_UFS_INDIRBLKS - * INODE_BLKSZ (data))) + if (INODE_NBLOCKS (data) == 0) grub_strcpy (symlink, (char *) INODE (data, symlink)); else { @@ -447,6 +456,7 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) do { struct grub_ufs_dirent dirent; + int namelen; if (grub_strlen (name) == 0) return GRUB_ERR_NONE; @@ -454,15 +464,18 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) if (grub_ufs_read_file (data, 0, pos, sizeof (dirent), (char *) &dirent) < 0) return grub_errno; + + namelen = (data->ufs_type == UFS2) + ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen); { - char filename[dirent.namelen + 1]; + char filename[namelen + 1]; if (grub_ufs_read_file (data, 0, pos + sizeof (dirent), - dirent.namelen, filename) < 0) + namelen, filename) < 0) return grub_errno; - filename[dirent.namelen] = '\0'; + filename[namelen] = '\0'; if (!grub_strcmp (name, filename)) { @@ -595,21 +608,25 @@ grub_ufs_dir (grub_device_t device, const char *path, while (pos < INODE_SIZE (data)) { struct grub_ufs_dirent dirent; + int namelen; if (grub_ufs_read_file (data, 0, pos, sizeof (dirent), (char *) &dirent) < 0) break; + + namelen = (data->ufs_type == UFS2) + ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen); { - char filename[dirent.namelen + 1]; + char filename[namelen + 1]; struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); if (grub_ufs_read_file (data, 0, pos + sizeof (dirent), - dirent.namelen, filename) < 0) + namelen, filename) < 0) break; - filename[dirent.namelen] = '\0'; + filename[namelen] = '\0'; if (data->ufs_type == UFS1) { struct grub_ufs_inode inode; From d3bfb59c51d5f00d8bc9d91d29f3abed472c7b72 Mon Sep 17 00:00:00 2001 From: davem Date: Sat, 11 Apr 2009 03:07:58 +0000 Subject: [PATCH 0615/1707] * disk/ieee1275/nand.c (grub_nand_open): All ieee1275 call arg slots are of type grub_ieee1275_cell_t. (grub_nand_read): Likewise. * kern/ieee1275/ieee1275.c (IEEE1275_PHANDLE_INVALID, IEEE1275_IHANDLE_INVALID): Use grub_ieee1275_cell_t since these macros are used to compare values in arg/ret block of the call. (grub_ieee1275_finddevice, grub_ieee1275_get_property, grub_ieee1275_next_property, grub_ieee1275_get_property_length, grub_ieee1275_instance_to_package, grub_ieee1275_package_to_path, grub_ieee1275_instance_to_path, grub_ieee1275_write, grub_ieee1275_read, grub_ieee1275_seek, grub_ieee1275_peer, grub_ieee1275_child, grub_ieee1275_parent, grub_ieee1275_open, grub_ieee1275_close, grub_ieee1275_set_property, grub_ieee1275_set_color): All ieee1275 call arg slots are of type grub_ieee1275_cell_t. * kern/ieee1275/openfw.c (grub_map): Likewise. * include/grub/ieee1275/ieee1275.h (grub_ieee1275_ihandle_t, grub_ieee1275_phandle_t): Define as grub_unit32_t type. --- ChangeLog | 21 ++++++++++++++ disk/ieee1275/nand.c | 14 ++++----- include/grub/ieee1275/ieee1275.h | 4 +-- kern/ieee1275/ieee1275.c | 50 ++++++++++++++++---------------- kern/ieee1275/openfw.c | 16 +++++----- 5 files changed, 63 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index b07bc757e..cc37fce85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2009-04-10 David S. Miller + + * disk/ieee1275/nand.c (grub_nand_open): All ieee1275 call arg + slots are of type grub_ieee1275_cell_t. + (grub_nand_read): Likewise. + * kern/ieee1275/ieee1275.c (IEEE1275_PHANDLE_INVALID, + IEEE1275_IHANDLE_INVALID): Use grub_ieee1275_cell_t since these + macros are used to compare values in arg/ret block of the call. + (grub_ieee1275_finddevice, grub_ieee1275_get_property, + grub_ieee1275_next_property, grub_ieee1275_get_property_length, + grub_ieee1275_instance_to_package, grub_ieee1275_package_to_path, + grub_ieee1275_instance_to_path, grub_ieee1275_write, + grub_ieee1275_read, grub_ieee1275_seek, grub_ieee1275_peer, + grub_ieee1275_child, grub_ieee1275_parent, grub_ieee1275_open, + grub_ieee1275_close, grub_ieee1275_set_property, + grub_ieee1275_set_color): All ieee1275 call arg slots are of type + grub_ieee1275_cell_t. + * kern/ieee1275/openfw.c (grub_map): Likewise. + * include/grub/ieee1275/ieee1275.h (grub_ieee1275_ihandle_t, + grub_ieee1275_phandle_t): Define as grub_unit32_t type. + 2009-04-10 Vladimir Serbinenko UFS improvements diff --git a/disk/ieee1275/nand.c b/disk/ieee1275/nand.c index ba79faa54..ed50768a8 100644 --- a/disk/ieee1275/nand.c +++ b/disk/ieee1275/nand.c @@ -60,8 +60,8 @@ grub_nand_open (const char *name, grub_disk_t disk) struct size_args { struct grub_ieee1275_common_hdr common; - char *method; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t ihandle; grub_ieee1275_cell_t result; grub_ieee1275_cell_t size1; grub_ieee1275_cell_t size2; @@ -84,7 +84,7 @@ grub_nand_open (const char *name, grub_disk_t disk) data->handle = dev_ihandle; INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 2); - args.method = "block-size"; + args.method = (grub_ieee1275_cell_t) "block-size"; args.ihandle = dev_ihandle; args.result = 1; @@ -97,7 +97,7 @@ grub_nand_open (const char *name, grub_disk_t disk) data->block_size = (args.size1 >> GRUB_DISK_SECTOR_BITS); INIT_IEEE1275_COMMON (&args.common, "call-method", 2, 3); - args.method = "size"; + args.method = (grub_ieee1275_cell_t) "size"; args.ihandle = dev_ihandle; args.result = 1; @@ -143,8 +143,8 @@ grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, struct read_args { struct grub_ieee1275_common_hdr common; - char *method; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t ihandle; grub_ieee1275_cell_t ofs; grub_ieee1275_cell_t page; grub_ieee1275_cell_t len; @@ -153,7 +153,7 @@ grub_nand_read (grub_disk_t disk, grub_disk_addr_t sector, } args; INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); - args.method = "pio-read"; + args.method = (grub_ieee1275_cell_t) "pio-read"; args.ihandle = data->handle; args.buf = (grub_ieee1275_cell_t) buf; args.page = (grub_ieee1275_cell_t) ((grub_size_t) sector / data->block_size); diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 628d888cd..3b5139e7c 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -60,8 +60,8 @@ struct grub_ieee1275_common_hdr (p)->nr_ins = (grub_ieee1275_cell_t) xins; \ (p)->nr_outs = (grub_ieee1275_cell_t) xouts -typedef grub_ieee1275_cell_t grub_ieee1275_ihandle_t; -typedef grub_ieee1275_cell_t grub_ieee1275_phandle_t; +typedef grub_uint32_t grub_ieee1275_ihandle_t; +typedef grub_uint32_t grub_ieee1275_phandle_t; extern grub_ieee1275_phandle_t EXPORT_VAR(grub_ieee1275_chosen); extern grub_ieee1275_ihandle_t EXPORT_VAR(grub_ieee1275_mmu); diff --git a/kern/ieee1275/ieee1275.c b/kern/ieee1275/ieee1275.c index aa48e20c4..f537b11ff 100644 --- a/kern/ieee1275/ieee1275.c +++ b/kern/ieee1275/ieee1275.c @@ -20,8 +20,8 @@ #include #include -#define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_phandle_t) -1) -#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_ihandle_t) 0) +#define IEEE1275_PHANDLE_INVALID ((grub_ieee1275_cell_t) -1) +#define IEEE1275_IHANDLE_INVALID ((grub_ieee1275_cell_t) 0) #define IEEE1275_CELL_INVALID ((grub_ieee1275_cell_t) -1) @@ -33,7 +33,7 @@ grub_ieee1275_finddevice (char *name, grub_ieee1275_phandle_t *phandlep) { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t device; - grub_ieee1275_phandle_t phandle; + grub_ieee1275_cell_t phandle; } args; @@ -56,7 +56,7 @@ grub_ieee1275_get_property (grub_ieee1275_phandle_t phandle, struct get_property_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t phandle; + grub_ieee1275_cell_t phandle; grub_ieee1275_cell_t prop; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t buflen; @@ -106,7 +106,7 @@ grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop, struct get_property_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t phandle; + grub_ieee1275_cell_t phandle; grub_ieee1275_cell_t prev_prop; grub_ieee1275_cell_t next_prop; grub_ieee1275_cell_t flags; @@ -131,7 +131,7 @@ grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle, struct get_property_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t phandle; + grub_ieee1275_cell_t phandle; grub_ieee1275_cell_t prop; grub_ieee1275_cell_t length; } @@ -157,8 +157,8 @@ grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle, struct instance_to_package_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_ihandle_t ihandle; - grub_ieee1275_phandle_t phandle; + grub_ieee1275_cell_t ihandle; + grub_ieee1275_cell_t phandle; } args; @@ -181,7 +181,7 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle, struct instance_to_package_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t phandle; + grub_ieee1275_cell_t phandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t buflen; grub_ieee1275_cell_t actual; @@ -210,7 +210,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle, struct instance_to_path_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t ihandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t buflen; grub_ieee1275_cell_t actual; @@ -238,7 +238,7 @@ grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer, struct write_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t ihandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t len; grub_ieee1275_cell_t actual; @@ -264,7 +264,7 @@ grub_ieee1275_read (grub_ieee1275_ihandle_t ihandle, void *buffer, struct write_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t ihandle; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t len; grub_ieee1275_cell_t actual; @@ -290,7 +290,7 @@ grub_ieee1275_seek (grub_ieee1275_ihandle_t ihandle, int pos_hi, struct write_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t ihandle; grub_ieee1275_cell_t pos_hi; grub_ieee1275_cell_t pos_lo; grub_ieee1275_cell_t result; @@ -317,8 +317,8 @@ grub_ieee1275_peer (grub_ieee1275_phandle_t node, struct peer_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t node; - grub_ieee1275_phandle_t result; + grub_ieee1275_cell_t node; + grub_ieee1275_cell_t result; } args; @@ -340,8 +340,8 @@ grub_ieee1275_child (grub_ieee1275_phandle_t node, struct child_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t node; - grub_ieee1275_phandle_t result; + grub_ieee1275_cell_t node; + grub_ieee1275_cell_t result; } args; @@ -364,8 +364,8 @@ grub_ieee1275_parent (grub_ieee1275_phandle_t node, struct parent_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t node; - grub_ieee1275_phandle_t result; + grub_ieee1275_cell_t node; + grub_ieee1275_cell_t result; } args; @@ -441,7 +441,7 @@ grub_ieee1275_open (const char *path, grub_ieee1275_ihandle_t *result) { struct grub_ieee1275_common_hdr common; grub_ieee1275_cell_t path; - grub_ieee1275_ihandle_t result; + grub_ieee1275_cell_t result; } args; @@ -462,7 +462,7 @@ grub_ieee1275_close (grub_ieee1275_ihandle_t ihandle) struct close_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t ihandle; } args; @@ -531,7 +531,7 @@ grub_ieee1275_set_property (grub_ieee1275_phandle_t phandle, struct set_property_args { struct grub_ieee1275_common_hdr common; - grub_ieee1275_phandle_t phandle; + grub_ieee1275_cell_t phandle; grub_ieee1275_cell_t propname; grub_ieee1275_cell_t buf; grub_ieee1275_cell_t size; @@ -560,8 +560,8 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle, struct set_color_args { struct grub_ieee1275_common_hdr common; - char *method; - grub_ieee1275_ihandle_t ihandle; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t ihandle; grub_ieee1275_cell_t index; grub_ieee1275_cell_t b; grub_ieee1275_cell_t g; @@ -571,7 +571,7 @@ grub_ieee1275_set_color (grub_ieee1275_ihandle_t ihandle, args; INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); - args.method = "color!"; + args.method = (grub_ieee1275_cell_t) "color!"; args.ihandle = ihandle; args.index = index; args.r = r; diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index e88f3b338..4c8cc6a05 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -154,17 +154,17 @@ grub_map (grub_addr_t phys, grub_addr_t virt, grub_uint32_t size, { struct map_args { struct grub_ieee1275_common_hdr common; - char *method; - grub_ieee1275_ihandle_t ihandle; - grub_uint32_t mode; - grub_uint32_t size; - grub_uint32_t virt; - grub_uint32_t phys; - int catch_result; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t ihandle; + grub_ieee1275_cell_t mode; + grub_ieee1275_cell_t size; + grub_ieee1275_cell_t virt; + grub_ieee1275_cell_t phys; + grub_ieee1275_cell_t catch_result; } args; INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); - args.method = "map"; + args.method = (grub_ieee1275_cell_t) "map"; args.ihandle = grub_ieee1275_mmu; args.phys = phys; args.virt = virt; From 450e22389f940ca1b408224456f19e27534b85d9 Mon Sep 17 00:00:00 2001 From: davem Date: Sat, 11 Apr 2009 03:09:17 +0000 Subject: [PATCH 0616/1707] * kern/ieee1275/init.c (grub_machine_init): Make 'actual' grub_ssize_t. * kern/ieee1275/openfw.c (grub_children_iterate): Likewise. (grub_devalias_iterate): Likewise. --- ChangeLog | 4 ++++ kern/ieee1275/init.c | 2 +- kern/ieee1275/openfw.c | 4 ++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc37fce85..815c87f47 100644 --- a/ChangeLog +++ b/ChangeLog @@ -19,6 +19,10 @@ * include/grub/ieee1275/ieee1275.h (grub_ieee1275_ihandle_t, grub_ieee1275_phandle_t): Define as grub_unit32_t type. + * kern/ieee1275/init.c (grub_machine_init): Make 'actual' grub_ssize_t. + * kern/ieee1275/openfw.c (grub_children_iterate): Likewise. + (grub_devalias_iterate): Likewise. + 2009-04-10 Vladimir Serbinenko UFS improvements diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index d345ba2dd..27783cc83 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -213,7 +213,7 @@ void grub_machine_init (void) { char args[256]; - int actual; + grub_ssize_t actual; grub_ieee1275_init (); diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index 4c8cc6a05..d70c3ba65 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -53,7 +53,7 @@ grub_children_iterate (char *devpath, char childname[64]; char fullname[64]; struct grub_ieee1275_devalias alias; - int actual; + grub_ssize_t actual; if (grub_ieee1275_get_property (child, "device_type", &childtype, sizeof childtype, &actual)) @@ -86,7 +86,7 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) { grub_ieee1275_phandle_t aliases; char aliasname[32]; - int actual; + grub_ssize_t actual; struct grub_ieee1275_devalias alias; if (grub_ieee1275_finddevice ("/aliases", &aliases)) From a3f7515a6ece1b6841c4d1dd684f4c25900c8d24 Mon Sep 17 00:00:00 2001 From: davem Date: Sat, 11 Apr 2009 08:24:49 +0000 Subject: [PATCH 0617/1707] * conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link with static libgcc. * configure.ac: Check for __bswapsi2 and __bswapdi2 presence. * include/grub/sparc64/libgcc.h (__bswapsi2): Export libgcc function, if present. (__bswapdi2): Likewise. --- ChangeLog | 9 +++++++++ conf/sparc64-ieee1275.rmk | 2 +- configure | 4 +++- configure.ac | 2 +- include/grub/sparc64/libgcc.h | 12 ++++++++++++ 5 files changed, 26 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 815c87f47..7d11ae5f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-11 David S. Miller + + * conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link with + static libgcc. + * configure.ac: Check for __bswapsi2 and __bswapdi2 presence. + * include/grub/sparc64/libgcc.h (__bswapsi2): Export libgcc + function, if present. + (__bswapdi2): Likewise. + 2009-04-10 David S. Miller * disk/ieee1275/nand.c (grub_nand_open): All ieee1275 call arg diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 68ae7427d..45e3003c4 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -82,7 +82,7 @@ kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc +kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc # Modules. #_linux.mod linux.mod diff --git a/configure b/configure index a3bde5844..c4312f42b 100644 --- a/configure +++ b/configure @@ -5813,7 +5813,9 @@ fi -for ac_func in posix_memalign memalign asprintf + + +for ac_func in posix_memalign memalign asprintf __bswapsi2 __bswapdi2 do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 diff --git a/configure.ac b/configure.ac index 1751bd06d..c316f1784 100644 --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,7 @@ if test "$target_cpu"-"$platform" = i386-pc; then fi # Check for functions. -AC_CHECK_FUNCS(posix_memalign memalign asprintf) +AC_CHECK_FUNCS(posix_memalign memalign asprintf __bswapsi2 __bswapdi2) # # Check for target programs. diff --git a/include/grub/sparc64/libgcc.h b/include/grub/sparc64/libgcc.h index e30c71780..4a6b6194d 100644 --- a/include/grub/sparc64/libgcc.h +++ b/include/grub/sparc64/libgcc.h @@ -16,4 +16,16 @@ * along with GRUB. If not, see . */ +#include + void EXPORT_FUNC (memset) (void); + +#ifdef HAVE___BSWAPSI2 +typedef int SItype __attribute__ ((mode (SI))); +SItype EXPORT_FUNC (__bswapsi2) (SItype); +#endif + +#ifdef HAVE___BSWAPDI2 +typedef int DItype __attribute__ ((mode (DI))); +DItype EXPORT_FUNC (__bswapdi2) (DItype); +#endif From 0d44993d694f67d573821a77ea5497d13b4f6078 Mon Sep 17 00:00:00 2001 From: davem Date: Sat, 11 Apr 2009 08:31:10 +0000 Subject: [PATCH 0618/1707] * include/grub/sparc64/ieee1275/boot.h: New file. * boot/sparc64/ieee1275/boot.S: Likewise. * boot/sparc64/ieee1275/diskboot.S: Likewise. --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7d11ae5f7..7e18ca0f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,10 @@ function, if present. (__bswapdi2): Likewise. + * include/grub/sparc64/ieee1275/boot.h: New file. + * boot/sparc64/ieee1275/boot.S: Likewise. + * boot/sparc64/ieee1275/diskboot.S: Likewise. + 2009-04-10 David S. Miller * disk/ieee1275/nand.c (grub_nand_open): All ieee1275 call arg From 0f005da92ad0104d83a2d0da78ae5f28468f0c36 Mon Sep 17 00:00:00 2001 From: davem Date: Sat, 11 Apr 2009 08:33:35 +0000 Subject: [PATCH 0619/1707] Missed these in previous commits, sorry. --- boot/sparc64/ieee1275/boot.S | 196 +++++++++++++++++++++++++++ boot/sparc64/ieee1275/diskboot.S | 145 ++++++++++++++++++++ conf/sparc64-ieee1275.mk | 2 +- config.h.in | 6 + include/grub/sparc64/ieee1275/boot.h | 58 ++++++++ 5 files changed, 406 insertions(+), 1 deletion(-) create mode 100644 boot/sparc64/ieee1275/boot.S create mode 100644 boot/sparc64/ieee1275/diskboot.S create mode 100644 include/grub/sparc64/ieee1275/boot.h diff --git a/boot/sparc64/ieee1275/boot.S b/boot/sparc64/ieee1275/boot.S new file mode 100644 index 000000000..74f4ee014 --- /dev/null +++ b/boot/sparc64/ieee1275/boot.S @@ -0,0 +1,196 @@ +/* -*-Asm-*- */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + + .text + .align 4 + .globl _start +_start: + /* OF CIF entry point arrives in %o4 */ +pic_base: + call boot_continue + mov %o4, CIF_REG + + . = _start + GRUB_BOOT_MACHINE_VER_MAJ +boot_version: .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR + + /* The offsets to these locations are defined by the + * GRUB_BOOT_MACHINE_foo macros in include/grub/sparc/ieee1275/boot.h, + * and grub-setup uses this to patch these next three values as needed. + * + * The boot_path will be the OF device path of the partition where the + * rest of the GRUB kernel image resides. kernel_sector will be set to + * the location of the first block of the GRUB kernel, and + * kernel_address is the location where we should load that first block. + * + * After loading in that block we will execute it by jumping to the + * load address plus the size of the prepended A.OUT header (32 bytes). + */ +boot_path: + . = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR +kernel_sector: .xword 2 +kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR + +prom_finddev_name: .asciz "finddevice" +prom_chosen_path: .asciz "/chosen" +prom_getprop_name: .asciz "getprop" +prom_stdout_name: .asciz "stdout" +prom_write_name: .asciz "write" +prom_bootpath_name: .asciz "bootpath" +prom_open_name: .asciz "open" +prom_seek_name: .asciz "seek" +prom_read_name: .asciz "read" +prom_exit_name: .asciz "exit" +grub_name: .asciz "GRUB " +#define GRUB_NAME_LEN 5 + + .align 4 + +prom_open_error: + GET_ABS(prom_open_name, %o2) + call console_write + mov 4, %o3 + /* fallthru */ + +prom_error: + GET_ABS(prom_exit_name, %o0) + /* fallthru */ + + /* %o0: OF call name + * %o1: input arg 1 + */ +prom_call_1_1: + mov 1, %g1 + ba prom_call + mov 1, %o5 + + /* %o2: message string + * %o3: message length + */ +console_write: + GET_ABS(prom_write_name, %o0) + mov STDOUT_NODE_REG, %o1 + /* fallthru */ + + /* %o0: OF call name + * %o1: input arg 1 + * %o2: input arg 2 + * %o3: input arg 3 + */ +prom_call_3_1: + mov 3, %g1 + mov 1, %o5 + /* fallthru */ + + /* %o0: OF call name + * %g1: num inputs + * %o5: num outputs + * %o1-%o4: inputs + */ +prom_call: + stx %o0, [%l1 + 0x00] + stx %g1, [%l1 + 0x08] + stx %o5, [%l1 + 0x10] + stx %o1, [%l1 + 0x18] + stx %o2, [%l1 + 0x20] + stx %o3, [%l1 + 0x28] + stx %o4, [%l1 + 0x30] + jmpl CIF_REG, %g0 + mov %l1, %o0 + +boot_continue: + mov %o7, PIC_REG /* PIC base */ + sethi %hi(SCRATCH_PAD), %l1 /* OF argument slots */ + + /* Find the /chosen node so we can fetch the stdout handle, + * and thus perform console output. + * + * chosen_node = prom_finddevice("/chosen") + */ + GET_ABS(prom_finddev_name, %o0) + GET_ABS(prom_chosen_path, %o1) + call prom_call_1_1 + clr %o2 + + ldx [%l1 + 0x20], CHOSEN_NODE_REG + brz CHOSEN_NODE_REG, prom_error + + /* getprop(chosen_node, "stdout", &buffer, buffer_size) */ + GET_ABS(prom_getprop_name, %o0) + mov 4, %g1 + mov 1, %o5 + mov CHOSEN_NODE_REG, %o1 + GET_ABS(prom_stdout_name, %o2) + add %l1, 256, %o3 + mov 1024, %o4 + call prom_call + stx %g1, [%l1 + 256] + + lduw [%l1 + 256], STDOUT_NODE_REG + brz,pn STDOUT_NODE_REG, prom_error + + /* write(stdout_node, "GRUB ", strlen("GRUB ")) */ + GET_ABS(grub_name, %o2) + call console_write + mov GRUB_NAME_LEN, %o3 + + /* Open up the boot_path, and use that handle to read the + * first block of the GRUB kernel image. + * + * bootdev_handle = open(boot_path) + */ + GET_ABS(prom_open_name, %o0) + GET_ABS(boot_path, %o1) + call prom_call_1_1 + clr %o2 + + ldx [%l1 + 0x20], BOOTDEV_REG + brz,pn BOOTDEV_REG, prom_open_error + + /* Since we have 64-bit cells, the high cell of the seek offset + * is zero and the low cell is the entire value. + * + * seek(bootdev, 0, *kernel_sector << 9) + */ + GET_ABS(prom_seek_name, %o0) + mov BOOTDEV_REG, %o1 + clr %o2 + LDX_ABS(kernel_sector, 0x00, %o3) + call prom_call_3_1 + sllx %o3, 9, %o3 + + /* read(bootdev, *kernel_address, 512) */ + GET_ABS(prom_read_name, %o0) + mov BOOTDEV_REG, %o1 + LDUW_ABS(kernel_address, 0x00, %o2) + call prom_call_3_1 + mov 512, %o3 + + LDUW_ABS(kernel_address, 0x00, %o2) + jmpl %o2, %o7 + nop + +1: ba,a 1b + + . = _start + GRUB_BOOT_MACHINE_CODE_END + +/* the last 4 bytes in the sector 0 contain the signature */ + .word GRUB_BOOT_MACHINE_SIGNATURE diff --git a/boot/sparc64/ieee1275/diskboot.S b/boot/sparc64/ieee1275/diskboot.S new file mode 100644 index 000000000..68ed0eee0 --- /dev/null +++ b/boot/sparc64/ieee1275/diskboot.S @@ -0,0 +1,145 @@ +/* -*-Asm-*- */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + + .text + .align 4 + .globl _start +_start: + /* First stage boot block jumps to us here. */ +pic_base: + call after_info_block + mov %o7, PIC_REG + +prom_write_name: .asciz "write" +prom_seek_name: .asciz "seek" +prom_read_name: .asciz "read" +prom_close_name: .asciz "close" + +notification_string: .asciz "Loading kernel" +#define NOTIFICATION_STRING_LEN 14 + +notification_step: .asciz "." +#define NOTIFICATION_STEP_LEN 1 + +notification_done: .asciz "\r\n" +#define NOTIFICATION_DONE_LEN 2 + + .align 4 + + /* %o2: message string + * %o3: message length + */ +console_write: + GET_ABS(prom_write_name, %o0) + mov STDOUT_NODE_REG, %o1 + /* fallthru */ + + /* %o0: OF call name + * %o1: input arg 1 + * %o2: input arg 2 + * %o3: input arg 3 + */ +prom_call_3_1: + mov 3, %g1 + mov 1, %o5 + /* fallthru */ + + /* %o0: OF call name + * %g1: num inputs + * %o5: num outputs + * %o1-%o4: inputs + */ +prom_call: + stx %o0, [%l1 + 0x00] + stx %g1, [%l1 + 0x08] + stx %o5, [%l1 + 0x10] + stx %o1, [%l1 + 0x18] + stx %o2, [%l1 + 0x20] + stx %o3, [%l1 + 0x28] + stx %o4, [%l1 + 0x30] + jmpl CIF_REG, %g0 + mov %l1, %o0 + + +after_info_block: + sethi %hi(SCRATCH_PAD), %l1 /* OF argument slots */ + + GET_ABS(notification_string, %o2) + call console_write + mov NOTIFICATION_STRING_LEN, %o3 + + GET_ABS(firstlist - GRUB_BOOT_MACHINE_LIST_SIZE, %l2) + set GRUB_BOOT_MACHINE_IMAGE_ADDRESS, %l3 +bootloop: + lduw [%l2 + 0x08], %o0 + brz %o0, bootit + lduw [%l2 + 0x00], %o3 + sllx %o3, 32, %o3 + lduw [%l2 + 0x04], %o4 + or %o3, %o4, %o3 + GET_ABS(prom_seek_name, %o0) + mov BOOTDEV_REG, %o1 + clr %o2 + call prom_call_3_1 + sllx %o3, 9, %o3 + + GET_ABS(prom_read_name, %o0) + mov BOOTDEV_REG, %o1 + lduw [%l2 + 0x08], %o3 + sllx %o3, 9, %o3 + mov %l3, %o2 + call prom_call_3_1 + add %l3, %o3, %l3 + + GET_ABS(notification_step, %o2) + call console_write + mov NOTIFICATION_STEP_LEN, %o3 + + ba bootloop + sub %l2, GRUB_BOOT_MACHINE_LIST_SIZE, %l2 + +bootit: + GET_ABS(prom_close_name, %o0) + mov 1, %g1 + mov 0, %o5 + call prom_call + mov BOOTDEV_REG, %o1 + + GET_ABS(notification_done, %o2) + call console_write + mov NOTIFICATION_DONE_LEN, %o3 + sethi %hi(GRUB_BOOT_MACHINE_IMAGE_ADDRESS), %o2 + jmpl %o2 + %lo(GRUB_BOOT_MACHINE_IMAGE_ADDRESS), %o7 + mov CIF_REG, %o0 +1: ba,a 1b + +lastlist: + .word 0 + .word 0 + + . = _start + (0x200 - GRUB_BOOT_MACHINE_LIST_SIZE) +blocklist_default_start: + .word 0 + .word 2 +blocklist_default_len: + .word 0 +firstlist: diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk index d68b40eef..571b9cfe3 100644 --- a/conf/sparc64-ieee1275.mk +++ b/conf/sparc64-ieee1275.mk @@ -189,7 +189,7 @@ kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc +kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc # Modules. #_linux.mod linux.mod diff --git a/config.h.in b/config.h.in index c110d6307..e825f7c41 100644 --- a/config.h.in +++ b/config.h.in @@ -79,6 +79,12 @@ /* Define to 1 if you have the header file. */ #undef HAVE_USB_H +/* Define to 1 if you have the `__bswapdi2' function. */ +#undef HAVE___BSWAPDI2 + +/* Define to 1 if you have the `__bswapsi2' function. */ +#undef HAVE___BSWAPSI2 + /* Define to 1 if you enable memory manager debugging. */ #undef MM_DEBUG diff --git a/include/grub/sparc64/ieee1275/boot.h b/include/grub/sparc64/ieee1275/boot.h new file mode 100644 index 000000000..95f311ce5 --- /dev/null +++ b/include/grub/sparc64/ieee1275/boot.h @@ -0,0 +1,58 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_BOOT_MACHINE_HEADER +#define GRUB_BOOT_MACHINE_HEADER 1 + +#define CIF_REG %l0 +#define CHOSEN_NODE_REG %l4 +#define STDOUT_NODE_REG %l5 +#define BOOTDEV_REG %l6 +#define PIC_REG %l7 + +#define SCRATCH_PAD 0x10000 + +#define GET_ABS(symbol, reg) \ + add PIC_REG, (symbol - pic_base), reg +#define LDUW_ABS(symbol, offset, reg) \ + lduw [PIC_REG + (symbol - pic_base) + (offset)], reg +#define LDX_ABS(symbol, offset, reg) \ + ldx [PIC_REG + (symbol - pic_base) + (offset)], reg + +#define GRUB_BOOT_AOUT_HEADER_SIZE 32 + +#define GRUB_BOOT_MACHINE_SIGNATURE 0xbb44aa55 + +#define GRUB_BOOT_MACHINE_VER_MAJ 0x08 + +#define GRUB_BOOT_MACHINE_BOOT_DEVPATH 0x0a + +#define GRUB_BOOT_MACHINE_BOOT_DEVPATH_END 0x80 + +#define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x88 + +#define GRUB_BOOT_MACHINE_CODE_END \ + (0x1fc - GRUB_BOOT_AOUT_HEADER_SIZE) + +#define GRUB_BOOT_MACHINE_LIST_SIZE 12 + +#define GRUB_BOOT_MACHINE_IMAGE_ADDRESS 0x200000 + +#define GRUB_BOOT_MACHINE_KERNEL_ADDR 0x4200 + +#endif /* ! BOOT_MACHINE_HEADER */ From b1ac86445e5715814eddaa917f5594ee5ae8bacd Mon Sep 17 00:00:00 2001 From: okuji Date: Sat, 11 Apr 2009 09:40:39 +0000 Subject: [PATCH 0620/1707] 2009-04-11 Andrey Shuvikov * util/hostdisk.c [__FreeBSD__]: Include sys/disk.h. (grub_util_biosdisk_open) [__FreeBSD__]: Add support for FreeBSD. Check if a device is a character device. Use DIOCGMEDIASIZE to get the size. (convert_system_partition_to_system_disk) [__FreeBSD__]: Add support for FreeBSD. (grub_util_biosdisk_get_grub_dev) [__FreeBSD__]: Check if OS_DEV is a character device instead of a block device. Add support for FreeBSD device names. * util/getroot.c (find_root_device) [__FreeBSD__]: Check if ENT is a character device instead of a block device. (grub_util_check_char_device): New function. * util/grub-probe.c (probe) [__FreeBSD__]: Check if DEVICE_NAME is a character device instead of a block device. * include/grub/util/getroot.h (grub_util_check_char_device): New prototype. --- ChangeLog | 22 ++++++++++++ config.h.in | 52 +++++++++++++++++++++++---- include/grub/util/getroot.h | 3 +- util/getroot.c | 21 ++++++++++- util/grub-probe.c | 7 +++- util/hostdisk.c | 70 +++++++++++++++++++++++++++++++++++-- 6 files changed, 163 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7e18ca0f5..76b709dad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2009-04-11 Andrey Shuvikov + + * util/hostdisk.c [__FreeBSD__]: Include sys/disk.h. + (grub_util_biosdisk_open) [__FreeBSD__]: Add support for + FreeBSD. Check if a device is a character device. Use + DIOCGMEDIASIZE to get the size. + (convert_system_partition_to_system_disk) [__FreeBSD__]: Add + support for FreeBSD. + (grub_util_biosdisk_get_grub_dev) [__FreeBSD__]: Check if OS_DEV + is a character device instead of a block device. Add support for + FreeBSD device names. + + * util/getroot.c (find_root_device) [__FreeBSD__]: Check if ENT is + a character device instead of a block device. + (grub_util_check_char_device): New function. + + * util/grub-probe.c (probe) [__FreeBSD__]: Check if DEVICE_NAME is + a character device instead of a block device. + + * include/grub/util/getroot.h (grub_util_check_char_device): New + prototype. + 2009-04-11 David S. Miller * conf/sparc64-ieee1275.rmk (kernel_img_LDFLAGS): Link with diff --git a/config.h.in b/config.h.in index e825f7c41..1a9ed6878 100644 --- a/config.h.in +++ b/config.h.in @@ -4,6 +4,9 @@ prefixed with an asterisk */ #undef ABSOLUTE_WITHOUT_ASTERISK +/* Define if building universal (internal helper macro) */ +#undef AC_APPLE_UNIVERSAL_BUILD + /* Define it to \"addr32\" or \"addr32;\" to make GAS happy */ #undef ADDR32 @@ -118,17 +121,52 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - +/* Enable extensions on AIX 3, Interix. */ +#ifndef _ALL_SOURCE +# undef _ALL_SOURCE +#endif /* Enable GNU extensions on systems that have them. */ #ifndef _GNU_SOURCE # undef _GNU_SOURCE #endif +/* Enable threading extensions on Solaris. */ +#ifndef _POSIX_PTHREAD_SEMANTICS +# undef _POSIX_PTHREAD_SEMANTICS +#endif +/* Enable extensions on HP NonStop. */ +#ifndef _TANDEM_SOURCE +# undef _TANDEM_SOURCE +#endif +/* Enable general extensions on Solaris. */ +#ifndef __EXTENSIONS__ +# undef __EXTENSIONS__ +#endif + + +/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most + significant byte first (like Motorola and SPARC, unlike Intel). */ +#if defined AC_APPLE_UNIVERSAL_BUILD +# if defined __BIG_ENDIAN__ +# define WORDS_BIGENDIAN 1 +# endif +#else +# ifndef WORDS_BIGENDIAN +# undef WORDS_BIGENDIAN +# endif +#endif + +/* Number of bits in a file offset, on hosts where this is settable. */ +#undef _FILE_OFFSET_BITS /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES + +/* Define to 1 if on MINIX. */ +#undef _MINIX + +/* Define to 2 if the system does not provide POSIX.1 features except with + this defined. */ +#undef _POSIX_1_SOURCE + +/* Define to 1 if you need to in order for `stat' and other things to work. */ +#undef _POSIX_SOURCE diff --git a/include/grub/util/getroot.h b/include/grub/util/getroot.h index bf0c55ca4..f9f7f9baa 100644 --- a/include/grub/util/getroot.h +++ b/include/grub/util/getroot.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003, 2007, 2008 Free Software Foundation, Inc. + * Copyright (C) 2003, 2007, 2008, 2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -30,5 +30,6 @@ char *grub_get_prefix (const char *dir); int grub_util_get_dev_abstraction (const char *os_dev); char *grub_util_get_grub_dev (const char *os_dev); const char *grub_util_check_block_device (const char *blk_dev); +const char *grub_util_check_char_device (const char *blk_dev); #endif /* ! GRUB_UTIL_GETROOT_HEADER */ diff --git a/util/getroot.c b/util/getroot.c index e88354e07..daed9124a 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -1,7 +1,7 @@ /* getroot.c - Get root device */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -238,7 +238,11 @@ find_root_device (const char *dir, dev_t dev) } } +#ifdef __FreeBSD__ + if (S_ISCHR (st.st_mode) && st.st_rdev == dev) +#else if (S_ISBLK (st.st_mode) && st.st_rdev == dev) +#endif { #ifdef __linux__ /* Skip device names like /dev/dm-0, which are short-hand aliases @@ -519,3 +523,18 @@ grub_util_check_block_device (const char *blk_dev) else return 0; } + +const char * +grub_util_check_char_device (const char *blk_dev) +{ + struct stat st; + + if (stat (blk_dev, &st) < 0) + grub_util_error ("Cannot stat `%s'", blk_dev); + + if (S_ISCHR (st.st_mode)) + return (blk_dev); + else + return 0; +} + diff --git a/util/grub-probe.c b/util/grub-probe.c index 4811d7b9e..194c62bb7 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -1,7 +1,7 @@ /* grub-probe.c - probe device information for a given path */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -112,8 +112,13 @@ probe (const char *path, char *device_name) if (path == NULL) { +#if defined(__FreeBSD__) + if (! grub_util_check_char_device (device_name)) + grub_util_error ("%s is not a character device.\n", device_name); +#else if (! grub_util_check_block_device (device_name)) grub_util_error ("%s is not a block device.\n", device_name); +#endif } else device_name = grub_guess_root_device (path); diff --git a/util/hostdisk.c b/util/hostdisk.c index bea3fb98f..001777e8e 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -1,7 +1,7 @@ /* biosdisk.c - emulate biosdisk */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -86,6 +86,10 @@ struct hd_geometry # define FLOPPY_MAJOR 2 #endif +#ifdef __FreeBSD__ +# include /* DIOCGMEDIASIZE */ +#endif + struct { char *drive; @@ -179,7 +183,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) return GRUB_ERR_NONE; } -#elif defined(__linux__) || defined(__CYGWIN__) +#elif defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) { unsigned long long nr; int fd; @@ -188,13 +192,21 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) if (fd == -1) return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk size", map[drive].device); +# if defined(__FreeBSD__) + if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode)) +# else if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) +# endif { close (fd); goto fail; } +# if defined(__FreeBSD__) + if (ioctl (fd, DIOCGMEDIASIZE, &nr)) +# else if (ioctl (fd, BLKGETSIZE64, &nr)) +# endif { close (fd); goto fail; @@ -746,6 +758,22 @@ convert_system_partition_to_system_disk (const char *os_dev) path[8] = 0; return path; +#elif defined(__FreeBSD__) + char *path = xstrdup (os_dev); + if (strncmp ("/dev/", path, 5) == 0) + { + char *p; + for (p = path + 5; *p; ++p) + if (grub_isdigit(*p)) + { + p = strchr (p, 's'); + if (p) + *p = '\0'; + break; + } + } + return path; + #else # warning "The function `convert_system_partition_to_system_disk' might not work on your OS correctly." return xstrdup (os_dev); @@ -793,7 +821,11 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return 0; } +#if defined(__FreeBSD__) + if (! S_ISCHR (st.st_mode)) +#else if (! S_ISBLK (st.st_mode)) +#endif return make_device_name (drive, -1, -1); #if defined(__linux__) || defined(__CYGWIN__) @@ -938,6 +970,40 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return make_device_name (drive, dos_part, bsd_part); } +#elif defined(__FreeBSD__) + /* FreeBSD uses "/dev/[a-z]+[0-9]+(s[0-9]+[a-z]?)?". */ + { + int dos_part = -1; + int bsd_part = -1; + + if (strncmp ("/dev/", os_dev, 5) == 0) + { + char *p, *q; + long int n; + + for (p = os_dev + 5; *p; ++p) + if (grub_isdigit(*p)) + { + p = strchr (p, 's'); + if (p) + { + p++; + n = strtol (p, &q, 10); + if (p != q && n != LONG_MIN && n != LONG_MAX) + { + dos_part = (int) n - 1; + + if (*q >= 'a' && *q <= 'g') + bsd_part = *q - 'a'; + } + } + break; + } + } + + return make_device_name (drive, dos_part, bsd_part); + } + #else # warning "The function `grub_util_biosdisk_get_grub_dev' might not work on your OS correctly." return make_device_name (drive, -1, -1); From ed3d2bc23d6357d75da6a030ee682272b668bd0a Mon Sep 17 00:00:00 2001 From: davem Date: Sat, 11 Apr 2009 11:48:34 +0000 Subject: [PATCH 0621/1707] * kern/misc.c (grub_ltoa): New function. (grub_vsprintf): Use it to format 'long' integers. --- ChangeLog | 3 +++ kern/misc.c | 35 +++++++++++++++++++++++++++++++---- 2 files changed, 34 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76b709dad..6dd046f89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -33,6 +33,9 @@ * boot/sparc64/ieee1275/boot.S: Likewise. * boot/sparc64/ieee1275/diskboot.S: Likewise. + * kern/misc.c (grub_ltoa): New function. + (grub_vsprintf): Use it to format 'long' integers. + 2009-04-10 David S. Miller * disk/ieee1275/nand.c (grub_nand_open): All ieee1275 call arg diff --git a/kern/misc.c b/kern/misc.c index 23eaa14e3..85a5d9525 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -590,6 +590,31 @@ grub_itoa (char *str, int c, unsigned n) return p; } +static char * +grub_ltoa (char *str, int c, unsigned long n) +{ + unsigned long base = (c == 'x') ? 16 : 10; + char *p; + + if ((long) n < 0 && c == 'd') + { + n = (unsigned) (-((long) n)); + *str++ = '-'; + } + + p = str; + do + { + unsigned long d = n % base; + *p++ = (d > 9) ? d + 'a' - 10 : d + '0'; + } + while (n /= base); + *p = 0; + + grub_reverse (str); + return p; +} + /* Divide N by D, return the quotient, and store the remainder in *R. */ grub_uint64_t grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r) @@ -790,12 +815,14 @@ grub_vsprintf (char *str, const char *fmt, va_list args) ll = va_arg (args, long long); grub_lltoa (tmp, c, ll); } + else if (longfmt) + { + long l = va_arg (args, long); + grub_ltoa (tmp, c, l); + } else { - if (longfmt) - n = va_arg (args, long); - else - n = va_arg (args, int); + n = va_arg (args, int); grub_itoa (tmp, c, n); } if (! rightfill && grub_strlen (tmp) < format1) From c91e1793bff00a7aff881627c7fa15ce0e5a1b47 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 11 Apr 2009 18:46:12 +0000 Subject: [PATCH 0622/1707] 2009-04-11 Felix Zielcke * util/hostdisk.c [__FreeBSD_kernel__]: Include sys/disk.h. (grub_util_biosdisk_open) [__FreeBSD_kernel__]: Add support for GNU/kFreeBSD. Check if a device is a character device. Use DIOCGMEDIASIZE to get the size. (convert_system_partition_to_system_disk) [__FreeBSD_kernel__]: Add support for GNU/kFreeBSD. (grub_util_biosdisk_get_grub_dev) [__FreeBSD_kernel__]: Check if OS_DEV is a character device instead of a block device. Add support for FreeBSD device names. * util/getroot.c (find_root_device) [__FreeBSD_kernel__]: Check if ENT is a character device instead of a block device. * util/grub-probe.c (probe) [__FreeBSD_kernel__]: Check if DEVICE_NAME is a character device instead of a block device. --- ChangeLog | 18 ++++++++++++++++++ util/getroot.c | 2 +- util/grub-probe.c | 2 +- util/hostdisk.c | 14 +++++++------- 4 files changed, 27 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6dd046f89..384e2b0e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2009-04-11 Felix Zielcke + + * util/hostdisk.c [__FreeBSD_kernel__]: Include sys/disk.h. + (grub_util_biosdisk_open) [__FreeBSD_kernel__]: Add support for + GNU/kFreeBSD. Check if a device is a character device. Use + DIOCGMEDIASIZE to get the size. + (convert_system_partition_to_system_disk) [__FreeBSD_kernel__]: Add + support for GNU/kFreeBSD. + (grub_util_biosdisk_get_grub_dev) [__FreeBSD_kernel__]: Check if OS_DEV + is a character device instead of a block device. Add support for + FreeBSD device names. + + * util/getroot.c (find_root_device) [__FreeBSD_kernel__]: Check if ENT + is a character device instead of a block device. + + * util/grub-probe.c (probe) [__FreeBSD_kernel__]: Check if DEVICE_NAME + is a character device instead of a block device. + 2009-04-11 Andrey Shuvikov * util/hostdisk.c [__FreeBSD__]: Include sys/disk.h. diff --git a/util/getroot.c b/util/getroot.c index daed9124a..68e1fad58 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -238,7 +238,7 @@ find_root_device (const char *dir, dev_t dev) } } -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (S_ISCHR (st.st_mode) && st.st_rdev == dev) #else if (S_ISBLK (st.st_mode) && st.st_rdev == dev) diff --git a/util/grub-probe.c b/util/grub-probe.c index 194c62bb7..bdb915964 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -112,7 +112,7 @@ probe (const char *path, char *device_name) if (path == NULL) { -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (! grub_util_check_char_device (device_name)) grub_util_error ("%s is not a character device.\n", device_name); #else diff --git a/util/hostdisk.c b/util/hostdisk.c index 001777e8e..2ef205786 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -86,7 +86,7 @@ struct hd_geometry # define FLOPPY_MAJOR 2 #endif -#ifdef __FreeBSD__ +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include /* DIOCGMEDIASIZE */ #endif @@ -183,7 +183,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) return GRUB_ERR_NONE; } -#elif defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) +#elif defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) { unsigned long long nr; int fd; @@ -192,7 +192,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) if (fd == -1) return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk size", map[drive].device); -# if defined(__FreeBSD__) +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode)) # else if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) @@ -202,7 +202,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) goto fail; } -# if defined(__FreeBSD__) +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (ioctl (fd, DIOCGMEDIASIZE, &nr)) # else if (ioctl (fd, BLKGETSIZE64, &nr)) @@ -758,7 +758,7 @@ convert_system_partition_to_system_disk (const char *os_dev) path[8] = 0; return path; -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) char *path = xstrdup (os_dev); if (strncmp ("/dev/", path, 5) == 0) { @@ -821,7 +821,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return 0; } -#if defined(__FreeBSD__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (! S_ISCHR (st.st_mode)) #else if (! S_ISBLK (st.st_mode)) @@ -970,7 +970,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return make_device_name (drive, dos_part, bsd_part); } -#elif defined(__FreeBSD__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* FreeBSD uses "/dev/[a-z]+[0-9]+(s[0-9]+[a-z]?)?". */ { int dos_part = -1; From dab272c250c995ee7274ec3d82b5189d19832e57 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 12 Apr 2009 03:36:30 +0000 Subject: [PATCH 0623/1707] Regenerate --- DISTLIST | 3 +++ 1 file changed, 3 insertions(+) diff --git a/DISTLIST b/DISTLIST index 889226402..bec628eec 100644 --- a/DISTLIST +++ b/DISTLIST @@ -34,6 +34,8 @@ boot/i386/pc/cdboot.S boot/i386/pc/diskboot.S boot/i386/pc/lnxboot.S boot/i386/pc/pxeboot.S +boot/sparc64/ieee1275/boot.S +boot/sparc64/ieee1275/diskboot.S bus/pci.c bus/usb/ohci.c bus/usb/uhci.c @@ -297,6 +299,7 @@ include/grub/sparc64/libgcc.h include/grub/sparc64/setjmp.h include/grub/sparc64/time.h include/grub/sparc64/types.h +include/grub/sparc64/ieee1275/boot.h include/grub/sparc64/ieee1275/console.h include/grub/sparc64/ieee1275/ieee1275.h include/grub/sparc64/ieee1275/kernel.h From 0f0bdfb1991c3867723f71189490eafb623b405e Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 12 Apr 2009 03:37:35 +0000 Subject: [PATCH 0624/1707] Regenerate with Autoconf 2.61 to match configure --- config.h.in | 54 ++++++++--------------------------------------------- 1 file changed, 8 insertions(+), 46 deletions(-) diff --git a/config.h.in b/config.h.in index 1a9ed6878..e825f7c41 100644 --- a/config.h.in +++ b/config.h.in @@ -4,9 +4,6 @@ prefixed with an asterisk */ #undef ABSOLUTE_WITHOUT_ASTERISK -/* Define if building universal (internal helper macro) */ -#undef AC_APPLE_UNIVERSAL_BUILD - /* Define it to \"addr32\" or \"addr32;\" to make GAS happy */ #undef ADDR32 @@ -121,52 +118,17 @@ /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS -/* Enable extensions on AIX 3, Interix. */ -#ifndef _ALL_SOURCE -# undef _ALL_SOURCE -#endif -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif -/* Enable threading extensions on Solaris. */ -#ifndef _POSIX_PTHREAD_SEMANTICS -# undef _POSIX_PTHREAD_SEMANTICS -#endif -/* Enable extensions on HP NonStop. */ -#ifndef _TANDEM_SOURCE -# undef _TANDEM_SOURCE -#endif -/* Enable general extensions on Solaris. */ -#ifndef __EXTENSIONS__ -# undef __EXTENSIONS__ -#endif - - -/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most - significant byte first (like Motorola and SPARC, unlike Intel). */ -#if defined AC_APPLE_UNIVERSAL_BUILD -# if defined __BIG_ENDIAN__ -# define WORDS_BIGENDIAN 1 -# endif -#else -# ifndef WORDS_BIGENDIAN -# undef WORDS_BIGENDIAN -# endif -#endif +/* Define to 1 if your processor stores words with the most significant byte + first (like Motorola and SPARC, unlike Intel and VAX). */ +#undef WORDS_BIGENDIAN /* Number of bits in a file offset, on hosts where this is settable. */ #undef _FILE_OFFSET_BITS +/* Enable GNU extensions on systems that have them. */ +#ifndef _GNU_SOURCE +# undef _GNU_SOURCE +#endif + /* Define for large files, on AIX-style hosts. */ #undef _LARGE_FILES - -/* Define to 1 if on MINIX. */ -#undef _MINIX - -/* Define to 2 if the system does not provide POSIX.1 features except with - this defined. */ -#undef _POSIX_1_SOURCE - -/* Define to 1 if you need to in order for `stat' and other things to work. */ -#undef _POSIX_SOURCE From 5b5d4aa5f0713b4a9b3973759df303a909f4f9cd Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 12 Apr 2009 04:33:18 +0000 Subject: [PATCH 0625/1707] 2009-04-12 Pavel Roskin * configure.ac: Change the logic when we check for target tools. Do it when the target is specified and it's different from the specified value of the host. --- ChangeLog | 6 ++++++ configure | 5 ++--- configure.ac | 5 ++--- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 384e2b0e5..6e29e2912 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-12 Pavel Roskin + + * configure.ac: Change the logic when we check for target tools. + Do it when the target is specified and it's different from the + specified value of the host. + 2009-04-11 Felix Zielcke * util/hostdisk.c [__FreeBSD_kernel__]: Include sys/disk.h. diff --git a/configure b/configure index c4312f42b..23869ce05 100644 --- a/configure +++ b/configure @@ -5942,9 +5942,8 @@ esac { echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } -# For cross-compiling. -if test "x$build" != "x$host"; then - # XXX this depends on the implementation of autoconf! +# Find tools for the target. +if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then tmp_ac_tool_prefix="$ac_tool_prefix" ac_tool_prefix=$target_alias- diff --git a/configure.ac b/configure.ac index c316f1784..ef143de53 100644 --- a/configure.ac +++ b/configure.ac @@ -231,9 +231,8 @@ esac AC_SUBST(TARGET_OBJ2ELF) AC_MSG_RESULT([$TARGET_OBJ2ELF]) -# For cross-compiling. -if test "x$build" != "x$host"; then - # XXX this depends on the implementation of autoconf! +# Find tools for the target. +if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then tmp_ac_tool_prefix="$ac_tool_prefix" ac_tool_prefix=$target_alias- From 56bc2471ad3217649dfd2a78b3ad18c194fa86ec Mon Sep 17 00:00:00 2001 From: davem Date: Sun, 12 Apr 2009 08:06:26 +0000 Subject: [PATCH 0626/1707] * kern/misc.c (grub_ltoa): Fix cast when handling negative values. Noticed by Pavel Roskin. --- ChangeLog | 5 +++++ kern/misc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6e29e2912..237c6f493 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-12 David S. Miller + + * kern/misc.c (grub_ltoa): Fix cast when handling negative + values. Noticed by Pavel Roskin. + 2009-04-12 Pavel Roskin * configure.ac: Change the logic when we check for target tools. diff --git a/kern/misc.c b/kern/misc.c index 85a5d9525..5a1253594 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -598,7 +598,7 @@ grub_ltoa (char *str, int c, unsigned long n) if ((long) n < 0 && c == 'd') { - n = (unsigned) (-((long) n)); + n = (unsigned long) (-((long) n)); *str++ = '-'; } From df38d0bb75cb0969cc9c30e9bfeab4e7594c0857 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 06:31:05 +0000 Subject: [PATCH 0627/1707] * configure.ac: Check for __bswapsi2 and__bswapdi2 using target compiler. --- ChangeLog | 3 ++ configure | 101 +++++++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 5 ++- 3 files changed, 105 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 237c6f493..1d80c5b9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * kern/misc.c (grub_ltoa): Fix cast when handling negative values. Noticed by Pavel Roskin. + * configure.ac: Check for __bswapsi2 and__bswapdi2 using + target compiler. + 2009-04-12 Pavel Roskin * configure.ac: Change the logic when we check for target tools. diff --git a/configure b/configure index 23869ce05..496f37e5f 100644 --- a/configure +++ b/configure @@ -5813,9 +5813,7 @@ fi - - -for ac_func in posix_memalign memalign asprintf __bswapsi2 __bswapdi2 +for ac_func in posix_memalign memalign asprintf do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` { echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -7020,6 +7018,103 @@ CFLAGS="$TARGET_CFLAGS" CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" +# Check for target functions. + + +for ac_func in __bswapsi2 __bswapdi2 +do +as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +{ echo "$as_me:$LINENO: checking for $ac_func" >&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } +if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +/* Define $ac_func to an innocuous variant, in case declares $ac_func. + For example, HP-UX 11i declares gettimeofday. */ +#define $ac_func innocuous_$ac_func + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include +#else +# include +#endif + +#undef $ac_func + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char $ac_func (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined __stub_$ac_func || defined __stub___$ac_func +choke me +#endif + +int +main () +{ +return $ac_func (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + eval "$as_ac_var=no" +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext +fi +ac_res=`eval echo '${'$as_ac_var'}'` + { echo "$as_me:$LINENO: result: $ac_res" >&5 +echo "${ECHO_T}$ac_res" >&6; } +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <<_ACEOF +#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +_ACEOF + +fi +done + + # Defined in aclocal.m4. { echo "$as_me:$LINENO: checking whether target compiler is working" >&5 echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; } diff --git a/configure.ac b/configure.ac index ef143de53..1f0775bea 100644 --- a/configure.ac +++ b/configure.ac @@ -200,7 +200,7 @@ if test "$target_cpu"-"$platform" = i386-pc; then fi # Check for functions. -AC_CHECK_FUNCS(posix_memalign memalign asprintf __bswapsi2 __bswapdi2) +AC_CHECK_FUNCS(posix_memalign memalign asprintf) # # Check for target programs. @@ -370,6 +370,9 @@ CFLAGS="$TARGET_CFLAGS" CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" +# Check for target functions. +AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) + # Defined in aclocal.m4. grub_PROG_TARGET_CC grub_PROG_OBJCOPY_ABSOLUTE From e382e93a88ec9e1cf744d652f203341eb78ac70c Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 06:37:50 +0000 Subject: [PATCH 0628/1707] * genmk.rb: Add more flexible image type specification, also pass --strip-unneeded to objcopy. * conf/i386-pc.rmk: Use *_FORMAT. * conf/i386-pc.mk: Rebuilt. --- ChangeLog | 5 +++++ conf/i386-pc.mk | 18 ++++++++++++------ conf/i386-pc.rmk | 6 ++++++ genmk.rb | 2 +- 4 files changed, 24 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d80c5b9e..b4e298af8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,11 @@ * configure.ac: Check for __bswapsi2 and__bswapdi2 using target compiler. + * genmk.rb: Add more flexible image type specification, also + pass --strip-unneeded to objcopy. + * conf/i386-pc.rmk: Use *_FORMAT. + * conf/i386-pc.mk: Rebuilt. + 2009-04-12 Pavel Roskin * configure.ac: Change the logic when we check for target tools. diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk index ab14e0883..2a139894d 100644 --- a/conf/i386-pc.mk +++ b/conf/i386-pc.mk @@ -20,7 +20,7 @@ CLEANFILES += boot.img boot.exec boot_img-boot_i386_pc_boot.o MOSTLYCLEANFILES += boot_img-boot_i386_pc_boot.d boot.img: boot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(boot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ boot.exec: boot_img-boot_i386_pc_boot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS) @@ -31,6 +31,7 @@ boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S $(boot/i386/pc/boot.S_DEPENDEN boot_img_ASFLAGS = $(COMMON_ASFLAGS) boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +boot_img_FORMAT = binary # For pxeboot.img pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S @@ -38,7 +39,7 @@ CLEANFILES += pxeboot.img pxeboot.exec pxeboot_img-boot_i386_pc_pxeboot.o MOSTLYCLEANFILES += pxeboot_img-boot_i386_pc_pxeboot.d pxeboot.img: pxeboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(pxeboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS) @@ -49,6 +50,7 @@ pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S $(boot/i386/pc/pxeboo pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +pxeboot_img_FORMAT = binary # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S @@ -56,7 +58,7 @@ CLEANFILES += diskboot.img diskboot.exec diskboot_img-boot_i386_pc_diskboot.o MOSTLYCLEANFILES += diskboot_img-boot_i386_pc_diskboot.d diskboot.img: diskboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(diskboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS) @@ -67,6 +69,7 @@ diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S $(boot/i386/pc/dis diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000 +diskboot_img_FORMAT = binary # For lnxboot.img. lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S @@ -74,7 +77,7 @@ CLEANFILES += lnxboot.img lnxboot.exec lnxboot_img-boot_i386_pc_lnxboot.o MOSTLYCLEANFILES += lnxboot_img-boot_i386_pc_lnxboot.d lnxboot.img: lnxboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(lnxboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ lnxboot.exec: lnxboot_img-boot_i386_pc_lnxboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(lnxboot_img_LDFLAGS) @@ -85,6 +88,7 @@ lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S $(boot/i386/pc/lnxboo lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000 +lnxboot_img_FORMAT = binary # For cdboot.img. cdboot_img_SOURCES = boot/i386/pc/cdboot.S @@ -92,7 +96,7 @@ CLEANFILES += cdboot.img cdboot.exec cdboot_img-boot_i386_pc_cdboot.o MOSTLYCLEANFILES += cdboot_img-boot_i386_pc_cdboot.d cdboot.img: cdboot.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(cdboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS) @@ -103,6 +107,7 @@ cdboot_img-boot_i386_pc_cdboot.o: boot/i386/pc/cdboot.S $(boot/i386/pc/cdboot.S_ cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +cdboot_img_FORMAT = binary # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ @@ -121,7 +126,7 @@ CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_im MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_list.d kernel_img-kern_handler.d kernel_img-kern_command.d kernel_img-kern_corecmd.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d kernel.img: kernel.exec - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(kernel_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_command.o kernel_img-kern_corecmd.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) @@ -259,6 +264,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) +kernel_img_FORMAT = binary MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 7dfb854e4..bb783f33a 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -17,26 +17,31 @@ pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ boot_img_SOURCES = boot/i386/pc/boot.S boot_img_ASFLAGS = $(COMMON_ASFLAGS) boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +boot_img_FORMAT = binary # For pxeboot.img pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +pxeboot_img_FORMAT = binary # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000 +diskboot_img_FORMAT = binary # For lnxboot.img. lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000 +lnxboot_img_FORMAT = binary # For cdboot.img. cdboot_img_SOURCES = boot/i386/pc/cdboot.S cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +cdboot_img_FORMAT = binary # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ @@ -60,6 +65,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) +kernel_img_FORMAT = binary MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst diff --git a/genmk.rb b/genmk.rb index 62e5066b1..57fe918ab 100644 --- a/genmk.rb +++ b/genmk.rb @@ -57,7 +57,7 @@ class Image MOSTLYCLEANFILES += #{deps_str} #{@name}: #{exe} - $(OBJCOPY) -O binary -R .note -R .comment -R .note.gnu.build-id $< $@ + $(OBJCOPY) -O $(#{prefix}_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ #{exe}: #{objs_str} $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS) From f5dbbca97f5bc99f5a32ad5a7975cd58e71903b5 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 06:40:34 +0000 Subject: [PATCH 0629/1707] * disk/ieee1275/ofdisk.c (struct ofdisk_hash_ent): New struct. (OFDISK_HASH_SZ): Define. (ofdisk_hash): New hash table. (ofdisk_hash_fn, ofdisk_hash_find, ofdisk_hash_add): New functions. (grub_ofdisk_open): Use ofdisk_hash_ent address as disk->id instead of device phandle which is not unique. --- ChangeLog | 7 +++++ disk/ieee1275/ofdisk.c | 70 ++++++++++++++++++++++++++++++++++++------ 2 files changed, 68 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index b4e298af8..60e548233 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,6 +11,13 @@ * conf/i386-pc.rmk: Use *_FORMAT. * conf/i386-pc.mk: Rebuilt. + * disk/ieee1275/ofdisk.c (struct ofdisk_hash_ent): New struct. + (OFDISK_HASH_SZ): Define. + (ofdisk_hash): New hash table. + (ofdisk_hash_fn, ofdisk_hash_find, ofdisk_hash_add): New functions. + (grub_ofdisk_open): Use ofdisk_hash_ent address as disk->id + instead of device phandle which is not unique. + 2009-04-12 Pavel Roskin * configure.ac: Change the logic when we check for target tools. diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index fec56beab..a56433d3e 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -23,6 +23,53 @@ #include #include +struct ofdisk_hash_ent +{ + char *devpath; + struct ofdisk_hash_ent *next; +}; + +#define OFDISK_HASH_SZ 8 +static struct ofdisk_hash_ent *ofdisk_hash[OFDISK_HASH_SZ]; + +static int +ofdisk_hash_fn (const char *devpath) +{ + int hash = 0; + while (*devpath) + hash ^= *devpath++; + return (hash & (OFDISK_HASH_SZ - 1)); +} + +static struct ofdisk_hash_ent * +ofdisk_hash_find (const char *devpath) +{ + struct ofdisk_hash_ent *p = ofdisk_hash[ofdisk_hash_fn(devpath)]; + + while (p) + { + if (!grub_strcmp (p->devpath, devpath)) + break; + p = p->next; + } + return p; +} + +static struct ofdisk_hash_ent * +ofdisk_hash_add (char *devpath) +{ + struct ofdisk_hash_ent **head = &ofdisk_hash[ofdisk_hash_fn(devpath)]; + struct ofdisk_hash_ent *p = grub_malloc(sizeof (*p)); + + if (p) + { + p->devpath = devpath; + p->next = *head; + *head = p; + } + return p; +} + static int grub_ofdisk_iterate (int (*hook) (const char *name)) { @@ -76,6 +123,7 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) { grub_ieee1275_phandle_t dev; grub_ieee1275_ihandle_t dev_ihandle = 0; + struct ofdisk_hash_ent *op; char *devpath; /* XXX: This should be large enough for any possible case. */ char prop[64]; @@ -89,18 +137,26 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) grub_strcat (devpath, ":0"); - grub_dprintf ("disk", "Opening `%s'.\n", devpath); + op = ofdisk_hash_find (devpath); + if (!op) + op = ofdisk_hash_add (devpath); - grub_ieee1275_open (devpath, &dev_ihandle); + grub_free (devpath); + if (!op) + return grub_errno; + + grub_dprintf ("disk", "Opening `%s'.\n", op->devpath); + + grub_ieee1275_open (op->devpath, &dev_ihandle); if (! dev_ihandle) { grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device"); goto fail; } - grub_dprintf ("disk", "Opened `%s' as handle %p.\n", devpath, (void *) dev_ihandle); + grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath, (void *) dev_ihandle); - if (grub_ieee1275_finddevice (devpath, &dev)) + if (grub_ieee1275_finddevice (op->devpath, &dev)) { grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't read device properties"); goto fail; @@ -124,20 +180,16 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) is possible to use seek for this. */ disk->total_sectors = 0xFFFFFFFFUL; - /* XXX: Is it ok to use this? Perhaps it is better to use the path - or some property. */ - disk->id = dev; + disk->id = (unsigned long) op; /* XXX: Read this, somehow. */ disk->has_partitions = 1; disk->data = (void *) dev_ihandle; - grub_free (devpath); return 0; fail: if (dev_ihandle) grub_ieee1275_close (dev_ihandle); - grub_free (devpath); return grub_errno; } From 91c88b12193a99c0ae8a22ca838094b537a7cefc Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 07:02:46 +0000 Subject: [PATCH 0630/1707] * kern/sparc64/ieee1275/init.c: Delete, replace with... * kern/sparc64/ieee1275/crt0.S: assembler implementation. * include/grub/sparc64/ieee1275/kernel.h: Declare grub_prefix[]. (GRUB_MOD_ALIGN, GRUB_MOD_GAP, GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE, GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE, GRUB_KERNEL_MACHINE_COMPRESSED_SIZE, GRUB_KERNEL_MACHINE_PREFIX, GRUB_KERNEL_MACHINE_DATA_END): Define. (grub_kernel_image_size, grub_total_module_size): Declare. --- ChangeLog | 9 + DISTLIST | 2 +- include/grub/sparc64/ieee1275/kernel.h | 38 +++- kern/sparc64/ieee1275/crt0.S | 77 ++++++++ kern/sparc64/ieee1275/init.c | 237 ------------------------- 5 files changed, 122 insertions(+), 241 deletions(-) create mode 100644 kern/sparc64/ieee1275/crt0.S delete mode 100644 kern/sparc64/ieee1275/init.c diff --git a/ChangeLog b/ChangeLog index 60e548233..90864f5cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18,6 +18,15 @@ (grub_ofdisk_open): Use ofdisk_hash_ent address as disk->id instead of device phandle which is not unique. + * kern/sparc64/ieee1275/init.c: Delete, replace with... + * kern/sparc64/ieee1275/crt0.S: assembler implementation. + * include/grub/sparc64/ieee1275/kernel.h: Declare grub_prefix[]. + (GRUB_MOD_ALIGN, GRUB_MOD_GAP, GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE, + GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE, + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE, GRUB_KERNEL_MACHINE_PREFIX, + GRUB_KERNEL_MACHINE_DATA_END): Define. + (grub_kernel_image_size, grub_total_module_size): Declare. + 2009-04-12 Pavel Roskin * configure.ac: Change the logic when we check for target tools. diff --git a/DISTLIST b/DISTLIST index bec628eec..1eceb8e48 100644 --- a/DISTLIST +++ b/DISTLIST @@ -379,7 +379,7 @@ kern/powerpc/dl.c kern/powerpc/ieee1275/startup.S kern/sparc64/cache.S kern/sparc64/dl.c -kern/sparc64/ieee1275/init.c +kern/sparc64/ieee1275/crt0.S kern/sparc64/ieee1275/openfw.c kern/x86_64/dl.c kern/x86_64/efi/callwrap.S diff --git a/include/grub/sparc64/ieee1275/kernel.h b/include/grub/sparc64/ieee1275/kernel.h index 0b6bce2c5..03a631492 100644 --- a/include/grub/sparc64/ieee1275/kernel.h +++ b/include/grub/sparc64/ieee1275/kernel.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,12 +19,44 @@ #ifndef GRUB_KERNEL_MACHINE_HEADER #define GRUB_KERNEL_MACHINE_HEADER 1 +#define GRUB_MOD_ALIGN 0x2000 + +/* Non-zero value is only needed for PowerMacs. */ +#define GRUB_MOD_GAP 0x0 + +/* The offset of GRUB_TOTAL_MODULE_SIZE. */ +#define GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE 0x8 + +/* The offset of GRUB_KERNEL_IMAGE_SIZE. */ +#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE 0xc + +/* The offset of GRUB_COMPRESSED_SIZE. */ +#define GRUB_KERNEL_MACHINE_COMPRESSED_SIZE 0x10 + +/* The offset of GRUB_PREFIX. */ +#define GRUB_KERNEL_MACHINE_PREFIX 0x14 + +/* End of the data section. */ +#define GRUB_KERNEL_MACHINE_DATA_END 0x114 + +#ifndef ASM_FILE + #include +#include + +/* The size of kernel image. */ +extern grub_int32_t grub_kernel_image_size; + +/* The total size of module images following the kernel. */ +extern grub_int32_t grub_total_module_size; + +/* The prefix which points to the directory where GRUB modules and its + configuration file are located. */ +extern char grub_prefix[]; void EXPORT_FUNC (grub_reboot) (void); void EXPORT_FUNC (grub_halt) (void); -/* Where grub-mkimage places the core modules in memory. */ -#define GRUB_IEEE1275_MODULE_BASE 0x00300000 +#endif /* ! ASM_FILE */ #endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/kern/sparc64/ieee1275/crt0.S b/kern/sparc64/ieee1275/crt0.S new file mode 100644 index 000000000..4e67cbc19 --- /dev/null +++ b/kern/sparc64/ieee1275/crt0.S @@ -0,0 +1,77 @@ +/* crt0.S - Startup code for the Sparc64. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +#include +#include + + .text + .align 4 + .globl _start +_start: + ba codestart + nop + + . = EXT_C(_start) + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE + +VARIABLE(grub_total_module_size) + .word 0 +VARIABLE(grub_kernel_image_size) + .word 0 +VARIABLE(grub_compressed_size) + .word 0 +VARIABLE(grub_prefix) + /* to be filled by grub-mkimage */ + + /* + * Leave some breathing room for the prefix. + */ + + . = EXT_C(_start) + GRUB_KERNEL_MACHINE_DATA_END + +codestart: + /* Copy the modules past the end of the kernel image. + * They are currently sitting in the BSS. + */ + sethi %hi(__bss_start), %o2 + or %o2, %lo(__bss_start), %o2 + sethi %hi(_end), %o3 + or %o3, %lo(_end), %o3 + sethi %hi(grub_total_module_size), %o4 + lduw [%o4 + %lo(grub_total_module_size)], %o4 +1: lduw [%o2], %o5 + stw %o5, [%o3] + subcc %o4, 4, %o4 + add %o2, 4, %o2 + bne,pt %icc, 1b + add %o3, 4, %o3 + + /* Now it's safe to clear out the BSS. */ + sethi %hi(__bss_start), %o2 + or %o2, %lo(__bss_start), %o2 + sethi %hi(_end), %o3 + or %o3, %lo(_end), %o3 +1: stx %g0, [%o2] + add %o2, 8, %o2 + cmp %o2, %o3 + blt,pt %xcc, 1b + nop + sethi %hi(grub_ieee1275_entry_fn), %o2 + stx %o0, [%o2 + %lo(grub_ieee1275_entry_fn)] + call grub_main + nop +1: ba,a 1b diff --git a/kern/sparc64/ieee1275/init.c b/kern/sparc64/ieee1275/init.c deleted file mode 100644 index a342557af..000000000 --- a/kern/sparc64/ieee1275/init.c +++ /dev/null @@ -1,237 +0,0 @@ -/* init.c -- Initialize GRUB on the Ultra Sprac (sparc64). */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2007,2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* OpenBoot entry point. */ -int (*grub_ieee1275_entry_fn) (void *); -grub_ieee1275_phandle_t grub_ieee1275_chosen; -static grub_uint32_t grub_ieee1275_flags; -/* FIXME (sparc64). */ -static const grub_addr_t grub_heap_start = 0x40000; -static grub_addr_t grub_heap_len; - -void -_start (uint64_t r0 __attribute__((unused)), - uint64_t r1 __attribute__((unused)), - uint64_t r2 __attribute__((unused)), - uint64_t r3 __attribute__((unused)), - uint64_t r4, - uint64_t r5 __attribute__((unused))); -void -_start (uint64_t r0 __attribute__((unused)), - uint64_t r1 __attribute__((unused)), - uint64_t r2 __attribute__((unused)), - uint64_t r3 __attribute__((unused)), - uint64_t r4, - uint64_t r5 __attribute__((unused))) -{ - grub_ieee1275_entry_fn = (int (*)(void *)) r4; - - grub_ieee1275_finddevice ("/chosen", &grub_ieee1275_chosen); - - /* Now invoke the main function. */ - grub_main (); - - /* Never reached. */ -} - -int -grub_ieee1275_test_flag (enum grub_ieee1275_flag flag) -{ - return (grub_ieee1275_flags & (1 << flag)); -} - -void -grub_ieee1275_set_flag (enum grub_ieee1275_flag flag) -{ - grub_ieee1275_flags |= (1 << flag); -} - -/* Translate an OF filesystem path (separated by backslashes), into a GRUB - path (separated by forward slashes). */ -static void -grub_translate_ieee1275_path (char *filepath) -{ - char *backslash; - - backslash = grub_strchr (filepath, '\\'); - while (backslash != 0) - { - *backslash = '/'; - backslash = grub_strchr (filepath, '\\'); - } -} - -void -grub_machine_set_prefix (void) -{ - char bootpath[64]; /* XXX check length */ - char *filename; - char *prefix; - - if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", bootpath, - sizeof (bootpath), 0)) - { - /* Should never happen. */ - grub_printf ("/chosen/bootpath property missing!\n"); - grub_env_set ("prefix", ""); - return; - } - - /* Transform an OF device path to a GRUB path. */ - - prefix = grub_ieee1275_encode_devname (bootpath); - - filename = grub_ieee1275_get_filename (bootpath); - if (filename) - { - char *newprefix; - char *lastslash = grub_strrchr (filename, '\\'); - - /* Truncate at last directory. */ - if (lastslash) - { - *lastslash = '\0'; - grub_translate_ieee1275_path (filename); - - newprefix = grub_malloc (grub_strlen (prefix) - + grub_strlen (filename)); - grub_sprintf (newprefix, "%s%s", prefix, filename); - grub_free (prefix); - prefix = newprefix; - } - } - - grub_env_set ("prefix", prefix); - - grub_free (filename); - grub_free (prefix); -} - -grub_uint64_t ieee1275_get_time_ms (void); - -void -grub_machine_init (void) -{ - char *args; - grub_ssize_t length; - - grub_console_init (); - - /* FIXME (sparc64). */ - grub_heap_len = (grub_addr_t) &_start - 0x1000 - grub_heap_start; - - if (grub_ieee1275_claim (grub_heap_start, grub_heap_len, 0, 0)) - grub_fatal ("Failed to claim heap at %p, len 0x%x\n", grub_heap_start, - grub_heap_len); - grub_mm_init_region ((void *) grub_heap_start, grub_heap_len); - - grub_ofdisk_init (); - - /* Process commandline. */ - if (grub_ieee1275_get_property_length (grub_ieee1275_chosen, "bootargs", - &length) == 0 && - length > 0) - { - grub_ssize_t i = 0; - - args = grub_malloc (length); - grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", args, - length, 0); - - while (i < length) - { - char *command = &args[i]; - char *end; - char *val; - - end = grub_strchr (command, ';'); - if (end == 0) - i = length; /* No more commands after this one. */ - else - { - *end = '\0'; - i += end - command + 1; - while (grub_isspace(args[i])) - i++; - } - - /* Process command. */ - val = grub_strchr (command, '='); - if (val) - { - *val = '\0'; - grub_env_set (command, val + 1); - } - } - } - - grub_install_get_time_ms (ieee1275_get_time_ms); -} - -void -grub_machine_fini (void) -{ - grub_ofdisk_fini (); - grub_console_fini (); -} - -void -grub_exit (void) -{ - grub_ieee1275_enter (); -} - -grub_uint64_t -ieee1275_get_time_ms (void) -{ - return grub_get_rtc (); -} - -grub_uint32_t -grub_get_rtc (void) -{ - grub_uint32_t msecs; - - if (grub_ieee1275_milliseconds (&msecs)) - return 0; - - return msecs; -} - -grub_addr_t -grub_arch_modules_addr (void) -{ - return GRUB_IEEE1275_MODULE_BASE; -} From 234022fe7ba16b5542d6f9a4be574988413ca6a7 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 07:06:09 +0000 Subject: [PATCH 0631/1707] * kern/sparc64/ieee1275/ieee1275.c: New file. * include/grub/sparc64/ieee1275/ieee1275.h (IEEE1275_MAP_WRITE, IEEE1275_MAP_READ, IEEE1275_MAP_EXEC, IEEE1275_MAP_LOCKED, IEEE1275_MAP_CACHED, IEEE1275_MAP_SE, IEEE1275_MAP_GLOBAL, IEEE1275_MAP_IE, IEEE1275_MAP_DEFAULT): Define. (grub_ieee1275_map_physical, grub_ieee1275_claim_vaddr, grub_ieee1275_alloc_physmem): Declare new exported functions. --- ChangeLog | 10 ++ DISTLIST | 1 + include/grub/sparc64/ieee1275/ieee1275.h | 22 ++++ kern/sparc64/ieee1275/ieee1275.c | 124 +++++++++++++++++++++++ 4 files changed, 157 insertions(+) create mode 100644 kern/sparc64/ieee1275/ieee1275.c diff --git a/ChangeLog b/ChangeLog index 90864f5cf..0c222adda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-04-13 David S. Miller + + * kern/sparc64/ieee1275/ieee1275.c: New file. + * include/grub/sparc64/ieee1275/ieee1275.h (IEEE1275_MAP_WRITE, + IEEE1275_MAP_READ, IEEE1275_MAP_EXEC, IEEE1275_MAP_LOCKED, + IEEE1275_MAP_CACHED, IEEE1275_MAP_SE, IEEE1275_MAP_GLOBAL, + IEEE1275_MAP_IE, IEEE1275_MAP_DEFAULT): Define. + (grub_ieee1275_map_physical, grub_ieee1275_claim_vaddr, + grub_ieee1275_alloc_physmem): Declare new exported functions. + 2009-04-12 David S. Miller * kern/misc.c (grub_ltoa): Fix cast when handling negative diff --git a/DISTLIST b/DISTLIST index 1eceb8e48..461600fcf 100644 --- a/DISTLIST +++ b/DISTLIST @@ -380,6 +380,7 @@ kern/powerpc/ieee1275/startup.S kern/sparc64/cache.S kern/sparc64/dl.c kern/sparc64/ieee1275/crt0.S +kern/sparc64/ieee1275/ieee1275.c kern/sparc64/ieee1275/openfw.c kern/x86_64/dl.c kern/x86_64/efi/callwrap.S diff --git a/include/grub/sparc64/ieee1275/ieee1275.h b/include/grub/sparc64/ieee1275/ieee1275.h index 1ef95f91a..7626e93c1 100644 --- a/include/grub/sparc64/ieee1275/ieee1275.h +++ b/include/grub/sparc64/ieee1275/ieee1275.h @@ -24,4 +24,26 @@ typedef grub_uint64_t grub_ieee1275_cell_t; +/* Encoding of 'mode' argument to grub_ieee1275_map_physical() */ +#define IEEE1275_MAP_WRITE 0x0001 /* Writable */ +#define IEEE1275_MAP_READ 0x0002 /* Readable */ +#define IEEE1275_MAP_EXEC 0x0004 /* Executable */ +#define IEEE1275_MAP_LOCKED 0x0010 /* Locked in TLB */ +#define IEEE1275_MAP_CACHED 0x0020 /* Cacheable */ +#define IEEE1275_MAP_SE 0x0040 /* Side-effects */ +#define IEEE1275_MAP_GLOBAL 0x0080 /* Global */ +#define IEEE1275_MAP_IE 0x0100 /* Invert Endianness */ +#define IEEE1275_MAP_DEFAULT (IEEE1275_MAP_WRITE | IEEE1275_MAP_READ | \ + IEEE1275_MAP_EXEC | IEEE1275_MAP_CACHED) + +extern int EXPORT_FUNC(grub_ieee1275_map_physical) (grub_addr_t paddr, + grub_addr_t vaddr, + grub_size_t size, + grub_uint32_t mode); +extern int EXPORT_FUNC(grub_ieee1275_claim_vaddr) (grub_addr_t vaddr, + grub_size_t size); +extern int EXPORT_FUNC(grub_ieee1275_alloc_physmem) (grub_addr_t *paddr, + grub_size_t size, + grub_uint32_t align); + #endif /* ! GRUB_IEEE1275_MACHINE_HEADER */ diff --git a/kern/sparc64/ieee1275/ieee1275.c b/kern/sparc64/ieee1275/ieee1275.c new file mode 100644 index 000000000..438a171ca --- /dev/null +++ b/kern/sparc64/ieee1275/ieee1275.c @@ -0,0 +1,124 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +/* Sun specific ieee1275 interfaces used by GRUB. */ + +int +grub_ieee1275_map_physical (grub_addr_t paddr, grub_addr_t vaddr, + grub_size_t size, grub_uint32_t mode) +{ + struct map_physical_args + { + struct grub_ieee1275_common_hdr common; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t ihandle; + grub_ieee1275_cell_t mode; + grub_ieee1275_cell_t size; + grub_ieee1275_cell_t virt; + grub_ieee1275_cell_t phys_high; + grub_ieee1275_cell_t phys_low; + grub_ieee1275_cell_t catch_result; + } + args; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 7, 1); + args.method = (grub_ieee1275_cell_t) "map"; + args.ihandle = grub_ieee1275_mmu; + args.mode = mode; + args.size = size; + args.virt = vaddr; + args.phys_high = 0; + args.phys_low = paddr; + args.catch_result = (grub_ieee1275_cell_t) -1; + + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) + return -1; + return args.catch_result; +} + +int +grub_ieee1275_claim_vaddr (grub_addr_t vaddr, grub_size_t size) +{ + struct claim_vaddr_args + { + struct grub_ieee1275_common_hdr common; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t ihandle; + grub_ieee1275_cell_t align; + grub_ieee1275_cell_t size; + grub_ieee1275_cell_t virt; + grub_ieee1275_cell_t catch_result; + } + args; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 5, 2); + args.method = (grub_ieee1275_cell_t) "claim"; + args.ihandle = grub_ieee1275_mmu; + args.align = 0; + args.size = size; + args.virt = vaddr; + args.catch_result = (grub_ieee1275_cell_t) -1; + + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) + return -1; + return args.catch_result; +} + +int +grub_ieee1275_alloc_physmem (grub_addr_t *paddr, grub_size_t size, + grub_uint32_t align) +{ + grub_uint32_t memory_ihandle; + struct alloc_physmem_args + { + struct grub_ieee1275_common_hdr common; + grub_ieee1275_cell_t method; + grub_ieee1275_cell_t ihandle; + grub_ieee1275_cell_t align; + grub_ieee1275_cell_t size; + grub_ieee1275_cell_t catch_result; + grub_ieee1275_cell_t phys_high; + grub_ieee1275_cell_t phys_low; + } + args; + grub_ssize_t actual = 0; + + grub_ieee1275_get_property (grub_ieee1275_chosen, "memory", + &memory_ihandle, sizeof (memory_ihandle), + &actual); + if (actual != sizeof (memory_ihandle)) + return -1; + + if (!align) + align = 1; + + INIT_IEEE1275_COMMON (&args.common, "call-method", 4, 3); + args.method = (grub_ieee1275_cell_t) "claim"; + args.ihandle = memory_ihandle; + args.align = (align ? align : 1); + args.size = size; + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) + return -1; + + *paddr = args.phys_low; + + return args.catch_result; +} From d8e1836ca1a745662df9ae07c3bb87fa1d3d3bd1 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 07:08:10 +0000 Subject: [PATCH 0632/1707] * include/grub/sparc64/ieee1275/loader.h: New file. * include/grub/sparc64/ieee1275/memory.h: Likewise. * include/grub/sparc64/kernel.h: Likewise. * loader/sparc64/ieee1275/linux.c: Likewise. --- ChangeLog | 5 + DISTLIST | 4 + include/grub/sparc64/ieee1275/loader.h | 27 ++ include/grub/sparc64/ieee1275/memory.h | 24 ++ include/grub/sparc64/kernel.h | 30 ++ loader/sparc64/ieee1275/linux.c | 514 +++++++++++++++++++++++++ 6 files changed, 604 insertions(+) create mode 100644 include/grub/sparc64/ieee1275/loader.h create mode 100644 include/grub/sparc64/ieee1275/memory.h create mode 100644 include/grub/sparc64/kernel.h create mode 100644 loader/sparc64/ieee1275/linux.c diff --git a/ChangeLog b/ChangeLog index 0c222adda..916a8c2c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,11 @@ (grub_ieee1275_map_physical, grub_ieee1275_claim_vaddr, grub_ieee1275_alloc_physmem): Declare new exported functions. + * include/grub/sparc64/ieee1275/loader.h: New file. + * include/grub/sparc64/ieee1275/memory.h: Likewise. + * include/grub/sparc64/kernel.h: Likewise. + * loader/sparc64/ieee1275/linux.c: Likewise. + 2009-04-12 David S. Miller * kern/misc.c (grub_ltoa): Fix cast when handling negative diff --git a/DISTLIST b/DISTLIST index 461600fcf..da2062a57 100644 --- a/DISTLIST +++ b/DISTLIST @@ -295,6 +295,7 @@ include/grub/powerpc/ieee1275/machine.h include/grub/powerpc/ieee1275/memory.h include/grub/powerpc/ieee1275/time.h include/grub/powerpc/ieee1275/util/biosdisk.h +include/grub/sparc64/kernel.h include/grub/sparc64/libgcc.h include/grub/sparc64/setjmp.h include/grub/sparc64/time.h @@ -303,7 +304,9 @@ include/grub/sparc64/ieee1275/boot.h include/grub/sparc64/ieee1275/console.h include/grub/sparc64/ieee1275/ieee1275.h include/grub/sparc64/ieee1275/kernel.h +include/grub/sparc64/ieee1275/loader.h include/grub/sparc64/ieee1275/machine.h +include/grub/sparc64/ieee1275/memory.h include/grub/sparc64/ieee1275/time.h include/grub/util/getroot.h include/grub/util/hostdisk.h @@ -412,6 +415,7 @@ loader/i386/pc/linux.c loader/i386/pc/multiboot2.c loader/ieee1275/multiboot2.c loader/powerpc/ieee1275/linux.c +loader/sparc64/ieee1275/linux.c normal/cmdline.c normal/color.c normal/command.c diff --git a/include/grub/sparc64/ieee1275/loader.h b/include/grub/sparc64/ieee1275/loader.h new file mode 100644 index 000000000..12bb2a69b --- /dev/null +++ b/include/grub/sparc64/ieee1275/loader.h @@ -0,0 +1,27 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_LOADER_MACHINE_HEADER +#define GRUB_LOADER_MACHINE_HEADER 1 + +/* The symbol shared between the normal mode and rescue mode + loader. */ +void grub_rescue_cmd_linux (int argc, char *argv[]); +void grub_rescue_cmd_initrd (int argc, char *argv[]); + +#endif /* ! GRUB_LOADER_MACHINE_HEADER */ diff --git a/include/grub/sparc64/ieee1275/memory.h b/include/grub/sparc64/ieee1275/memory.h new file mode 100644 index 000000000..c997f66ed --- /dev/null +++ b/include/grub/sparc64/ieee1275/memory.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MEMORY_MACHINE_HEADER +#define GRUB_MEMORY_MACHINE_HEADER 1 + +#define GRUB_MACHINE_MEMORY_AVAILABLE 1 + +#endif diff --git a/include/grub/sparc64/kernel.h b/include/grub/sparc64/kernel.h new file mode 100644 index 000000000..9f404b05d --- /dev/null +++ b/include/grub/sparc64/kernel.h @@ -0,0 +1,30 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_KERNEL_CPU_HEADER +#define GRUB_KERNEL_CPU_HEADER 1 + +#define GRUB_MOD_ALIGN 0x2000 + +/* Non-zero value is only needed for PowerMacs. */ +#define GRUB_MOD_GAP 0x0 + +#define GRUB_KERNEL_CPU_PREFIX 0x2 +#define GRUB_KERNEL_CPU_DATA_END 0x42 + +#endif diff --git a/loader/sparc64/ieee1275/linux.c b/loader/sparc64/ieee1275/linux.c new file mode 100644 index 000000000..4912b9775 --- /dev/null +++ b/loader/sparc64/ieee1275/linux.c @@ -0,0 +1,514 @@ +/* linux.c - boot Linux */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2003, 2004, 2005, 2007, 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static grub_dl_t my_mod; + +static int loaded; + +/* /virtual-memory/translations property layout */ +struct grub_ieee1275_translation { + grub_uint64_t vaddr; + grub_uint64_t size; + grub_uint64_t data; +}; + +static struct grub_ieee1275_translation *of_trans; +static int of_num_trans; + +static grub_addr_t phys_base; +static grub_addr_t grub_phys_start; +static grub_addr_t grub_phys_end; + +static grub_addr_t initrd_addr; +static grub_addr_t initrd_paddr; +static grub_size_t initrd_size; + +static Elf64_Addr linux_entry; +static grub_addr_t linux_addr; +static grub_addr_t linux_paddr; +static grub_size_t linux_size; + +static char *linux_args; + +typedef void (*kernel_entry_t) (unsigned long, unsigned long, + unsigned long, unsigned long, int (void *)); + +struct linux_bootstr_info { + int len, valid; + char buf[]; +}; + +struct linux_hdrs { + /* All HdrS versions support these fields. */ + unsigned int start_insns[2]; + char magic[4]; /* "HdrS" */ + unsigned int linux_kernel_version; /* LINUX_VERSION_CODE */ + unsigned short hdrs_version; + unsigned short root_flags; + unsigned short root_dev; + unsigned short ram_flags; + unsigned int __deprecated_ramdisk_image; + unsigned int ramdisk_size; + + /* HdrS versions 0x0201 and higher only */ + char *reboot_command; + + /* HdrS versions 0x0202 and higher only */ + struct linux_bootstr_info *bootstr_info; + + /* HdrS versions 0x0301 and higher only */ + unsigned long ramdisk_image; +}; + +static grub_err_t +grub_linux_boot (void) +{ + struct linux_bootstr_info *bp; + kernel_entry_t linuxmain; + struct linux_hdrs *hp; + grub_addr_t addr; + + hp = (struct linux_hdrs *) linux_addr; + + /* Any pointer we derefence in the kernel image must be relocated + to where we actually loaded the kernel. */ + addr = (grub_addr_t) hp->bootstr_info; + addr += (linux_addr - linux_entry); + bp = (struct linux_bootstr_info *) addr; + + /* Set the command line arguments, unless the kernel has been + built with a fixed CONFIG_CMDLINE. */ + if (!bp->valid) + { + int len = grub_strlen (linux_args) + 1; + if (bp->len < len) + len = bp->len; + memcpy(bp->buf, linux_args, len); + bp->buf[len-1] = '\0'; + bp->valid = 1; + } + + if (initrd_addr) + { + /* The kernel expects the physical address, adjusted relative + to the lowest address advertised in "/memory"'s available + property. + + The history of this is that back when the kernel only supported + specifying a 32-bit ramdisk address, this was the way to still + be able to specify the ramdisk physical address even if memory + started at some place above 4GB. + + The magic 0x400000 is KERNBASE, I have no idea why SILO adds + that term into the address, but it does and thus we have to do + it too as this is what the kernel expects. */ + hp->ramdisk_image = initrd_paddr - phys_base + 0x400000; + hp->ramdisk_size = initrd_size; + } + + grub_dprintf ("loader", "Entry point: 0x%lx\n", linux_addr); + grub_dprintf ("loader", "Initrd at: 0x%lx, size 0x%lx\n", initrd_addr, + initrd_size); + grub_dprintf ("loader", "Boot arguments: %s\n", linux_args); + grub_dprintf ("loader", "Jumping to Linux...\n"); + + /* Boot the kernel. */ + linuxmain = (kernel_entry_t) linux_addr; + linuxmain (0, 0, 0, 0, grub_ieee1275_entry_fn); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_linux_release_mem (void) +{ + grub_free (linux_args); + linux_args = 0; + linux_addr = 0; + initrd_addr = 0; + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_linux_unload (void) +{ + grub_err_t err; + + err = grub_linux_release_mem (); + grub_dl_unref (my_mod); + + loaded = 0; + + return err; +} + +#define FOUR_MB (4 * 1024 * 1024) + +static grub_addr_t +align_addr(grub_addr_t val, grub_addr_t align) +{ + return (val + (align - 1)) & ~(align - 1); +} + +static grub_addr_t +alloc_phys (grub_addr_t size) +{ + grub_addr_t ret = (grub_addr_t) -1; + + auto int NESTED_FUNC_ATTR choose (grub_uint64_t addr, grub_uint64_t len __attribute__((unused)), grub_uint32_t type); + int NESTED_FUNC_ATTR choose (grub_uint64_t addr, grub_uint64_t len __attribute__((unused)), grub_uint32_t type) + { + grub_addr_t end = addr + len; + + if (type != 1) + return 0; + + addr = align_addr (addr, FOUR_MB); + if (addr >= end) + return 0; + + if (addr >= grub_phys_start && addr < grub_phys_end) + { + addr = align_addr (grub_phys_end, FOUR_MB); + if (addr >= end) + return 0; + } + if ((addr + size) >= grub_phys_start + && (addr + size) < grub_phys_end) + { + addr = align_addr (grub_phys_end, FOUR_MB); + if (addr >= end) + return 0; + } + + if (loaded) + { + grub_addr_t linux_end = align_addr (linux_paddr + linux_size, FOUR_MB); + + if (addr >= linux_paddr && addr < linux_end) + { + addr = linux_end; + if (addr >= end) + return 0; + } + if ((addr + size) >= linux_paddr + && (addr + size) < linux_end) + { + addr = linux_end; + if (addr >= end) + return 0; + } + } + + ret = addr; + return 1; + } + + grub_machine_mmap_iterate (choose); + + return ret; +} + +static grub_err_t +grub_linux_load64 (grub_elf_t elf) +{ + grub_addr_t off, paddr, base; + int ret; + + linux_entry = elf->ehdr.ehdr64.e_entry; + linux_addr = 0x40004000; + off = 0x4000; + linux_size = grub_elf64_size (elf); + if (linux_size == 0) + return grub_errno; + + grub_dprintf ("loader", "Attempting to claim at 0x%lx, size 0x%lx.\n", + linux_addr, linux_size); + + paddr = alloc_phys (linux_size + off); + if (paddr == (grub_addr_t) -1) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could not allocate physical memory."); + ret = grub_ieee1275_map_physical (paddr, linux_addr - off, + linux_size + off, IEEE1275_MAP_DEFAULT); + if (ret) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could not map physical memory."); + + grub_dprintf ("loader", "Loading linux at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n", + linux_addr, paddr, linux_size); + + linux_paddr = paddr; + + base = linux_entry - off; + + /* Now load the segments into the area we claimed. */ + auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr); + grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr) + { + /* Adjust the program load address to linux_addr. */ + *addr = (phdr->p_paddr - base) + (linux_addr - off); + return 0; + } + return grub_elf64_load (elf, offset_phdr, 0, 0); +} + +void +grub_rescue_cmd_linux (int argc, char *argv[]) +{ + grub_file_t file = 0; + grub_elf_t elf = 0; + int i; + int size; + char *dest; + + grub_dl_ref (my_mod); + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); + goto out; + } + + file = grub_gzfile_open (argv[0], 1); + if (!file) + goto out; + + elf = grub_elf_file (file); + if (! elf) + goto out; + + if (elf->ehdr.ehdr32.e_type != ET_EXEC) + { + grub_error (GRUB_ERR_UNKNOWN_OS, + "This ELF file is not of the right type\n"); + goto out; + } + + /* Release the previously used memory. */ + grub_loader_unset (); + + if (grub_elf_is_elf64 (elf)) + grub_linux_load64 (elf); + else + { + grub_error (GRUB_ERR_BAD_FILE_TYPE, "Unknown ELF class"); + goto out; + } + + size = sizeof ("BOOT_IMAGE=") + grub_strlen (argv[0]); + for (i = 0; i < argc; i++) + size += grub_strlen (argv[i]) + 1; + + linux_args = grub_malloc (size); + if (! linux_args) + goto out; + + /* Specify the boot file. */ + dest = grub_stpcpy (linux_args, "BOOT_IMAGE="); + dest = grub_stpcpy (dest, argv[0]); + + for (i = 1; i < argc; i++) + { + *dest++ = ' '; + dest = grub_stpcpy (dest, argv[i]); + } + +out: + if (elf) + grub_elf_close (elf); + else if (file) + grub_file_close (file); + + if (grub_errno != GRUB_ERR_NONE) + { + grub_linux_release_mem (); + grub_dl_unref (my_mod); + loaded = 0; + } + else + { + grub_loader_set (grub_linux_boot, grub_linux_unload, 1); + initrd_addr = 0; + loaded = 1; + } +} + +void +grub_rescue_cmd_initrd (int argc, char *argv[]) +{ + grub_file_t file = 0; + grub_ssize_t size; + grub_addr_t paddr; + grub_addr_t addr; + int ret; + + if (argc == 0) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "no initrd specified"); + goto fail; + } + + if (!loaded) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first."); + goto fail; + } + + file = grub_file_open (argv[0]); + if (! file) + goto fail; + + addr = 0x60000000; + size = grub_file_size (file); + + paddr = alloc_phys (size); + if (paddr == (grub_addr_t) -1) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could not allocate physical memory."); + goto fail; + } + ret = grub_ieee1275_map_physical (paddr, addr, size, IEEE1275_MAP_DEFAULT); + if (ret) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could not map physical memory."); + goto fail; + } + + grub_dprintf ("loader", "Loading initrd at vaddr 0x%lx, paddr 0x%lx, size 0x%lx\n", + addr, paddr, size); + + if (grub_file_read (file, (void *) addr, size) != size) + { + grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); + goto fail; + } + + initrd_addr = addr; + initrd_paddr = paddr; + initrd_size = size; + + fail: + if (file) + grub_file_close (file); +} + +static void +determine_phys_base (void) +{ + auto int NESTED_FUNC_ATTR get_physbase (grub_uint64_t addr, grub_uint64_t len __attribute__((unused)), grub_uint32_t type); + int NESTED_FUNC_ATTR get_physbase (grub_uint64_t addr, grub_uint64_t len __attribute__((unused)), grub_uint32_t type) + { + if (type != 1) + return 0; + if (addr < phys_base) + phys_base = addr; + return 0; + } + + phys_base = ~(grub_uint64_t) 0; + grub_machine_mmap_iterate (get_physbase); +} + +static void +fetch_translations (void) +{ + grub_ieee1275_phandle_t node; + grub_ssize_t actual; + int i; + + if (grub_ieee1275_finddevice ("/virtual-memory", &node)) + { + grub_printf ("Cannot find /virtual-memory node.\n"); + return; + } + + if (grub_ieee1275_get_property_length (node, "translations", &actual)) + { + grub_printf ("Cannot find /virtual-memory/translations size.\n"); + return; + } + + of_trans = grub_malloc (actual); + if (!of_trans) + { + grub_printf ("Cannot allocate translations buffer.\n"); + return; + } + + if (grub_ieee1275_get_property (node, "translations", of_trans, actual, &actual)) + { + grub_printf ("Cannot fetch /vritual-memory/translations property.\n"); + return; + } + + of_num_trans = actual / sizeof(struct grub_ieee1275_translation); + + for (i = 0; i < of_num_trans; i++) + { + struct grub_ieee1275_translation *p = &of_trans[i]; + + if (p->vaddr == 0x2000) + { + grub_addr_t phys, tte = p->data; + + phys = tte & ~(0xff00000000001fffULL); + + grub_phys_start = phys; + grub_phys_end = grub_phys_start + p->size; + grub_dprintf ("loader", "Grub lives at phys_start[%lx] phys_end[%lx]\n", + (unsigned long) grub_phys_start, + (unsigned long) grub_phys_end); + break; + } + } +} + + +GRUB_MOD_INIT(linux) +{ + determine_phys_base (); + fetch_translations (); + + grub_rescue_register_command ("linux", grub_rescue_cmd_linux, + "load a linux kernel"); + grub_rescue_register_command ("initrd", grub_rescue_cmd_initrd, + "load an initrd"); + my_mod = mod; +} + +GRUB_MOD_FINI(linux) +{ + grub_rescue_unregister_command ("linux"); + grub_rescue_unregister_command ("initrd"); +} From c301203905f834b9e7789380beb65164782fde28 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 13 Apr 2009 11:45:20 +0000 Subject: [PATCH 0633/1707] 2009-04-13 Felix Zielcke * util/i386/pc/grub-install.in (install_drive): Remove the BSD partition number. (grub_drive): Likewise. --- ChangeLog | 6 ++++++ util/i386/pc/grub-install.in | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 916a8c2c5..40b18b275 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-13 Felix Zielcke + + * util/i386/pc/grub-install.in (install_drive): Remove the BSD + partition number. + (grub_drive): Likewise. + 2009-04-13 David S. Miller * kern/sparc64/ieee1275/ieee1275.c: New file. diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index ff1ed1e75..8a7a4daef 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -262,8 +262,8 @@ if [ "x${devabstraction_module}" = "x" ] ; then grub_drive="`$grub_probe --target=drive --device ${grub_device}`" # Strip partition number - install_drive="`echo ${install_drive} | sed -e s/,[0-9]*//g`" - grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*//g`" + install_drive="`echo ${install_drive} | sed -e s/,[0-9]*[a-z]*//g`" + grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*[a-z]*//g`" if [ "${target_cpu}-${platform}" != "i386-pc" ] ; then # generic method (used on coreboot) uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" From 232a769cb204a75091c90030a75eb2952d636480 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 13 Apr 2009 13:00:59 +0000 Subject: [PATCH 0634/1707] 2009-04-13 Pavel Roskin * term/usb_keyboard.c (grub_usb_keyboard_getkey): Warning fixes. --- ChangeLog | 4 ++++ term/usb_keyboard.c | 7 +++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 40b18b275..dd519ce83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-13 Pavel Roskin + + * term/usb_keyboard.c (grub_usb_keyboard_getkey): Warning fixes. + 2009-04-13 Felix Zielcke * util/i386/pc/grub-install.in (install_drive): Remove the BSD diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index 07f7d08b4..d30e6fc7f 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -173,7 +173,6 @@ static int grub_usb_keyboard_getkey (void) { int key; - int key_release; grub_err_t err; unsigned char data[8]; grub_uint64_t currtime; @@ -192,15 +191,15 @@ grub_usb_keyboard_getkey (void) switch (repeat) { - case GRUB_HIDBOOT_REPEAT_NONE: - timeout = 100; - break; case GRUB_HIDBOOT_REPEAT_FIRST: timeout = 500; break; case GRUB_HIDBOOT_REPEAT: timeout = 50; break; + default: + timeout = 100; + break; } /* Wait until the key is released. */ From a547a745a625b4e26b2f602fcfa0683742381ca8 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 13 Apr 2009 14:14:40 +0000 Subject: [PATCH 0635/1707] 2009-04-13 Felix Zielcke * util/grub.d/10_freebsd.in: Don't exit if /boot/devices.hints doestn't exist. Check also for /boot/kernel/kernel.gz. Print `freebsd_loadenv' only when devices.hints exist. --- ChangeLog | 6 ++++++ util/grub.d/10_freebsd.in | 23 ++++++++++++++++------- 2 files changed, 22 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index dd519ce83..0220dd15a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-13 Felix Zielcke + + * util/grub.d/10_freebsd.in: Don't exit if /boot/devices.hints + doestn't exist. Check also for /boot/kernel/kernel.gz. Print + `freebsd_loadenv' only when devices.hints exist. + 2009-04-13 Pavel Roskin * term/usb_keyboard.c (grub_usb_keyboard_getkey): Warning fixes. diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 61d5450b1..34f27d488 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -21,15 +21,16 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ . ${libdir}/grub/grub-mkconfig_lib -devices=/boot/devices.hints -if ! test -e ${devices} ; then - # not FreeBSD - exit 0 +if test -e /boot/devices.hints ; then + devices=/boot/devices.hints fi if test -e /boot/kernel/kernel ; then kfreebsd=/boot/kernel/kernel fi +if test -e /boot/kernel/kernel.gz ; then + kfreebsd=/boot/kernel/kernel.gz +fi if [ "x$kfreebsd" != "x" ] ; then echo "Found kernel of FreeBSD: $kfreebsd" >&2 @@ -38,9 +39,11 @@ if [ "x$kfreebsd" != "x" ] ; then kfreebsd_dirname=`dirname $kfreebsd` kfreebsd_rel_dirname=`make_system_path_relative_to_its_root $kfreebsd_dirname` - devices_basename=`basename $devices` - devices_dirname=`dirname $devices` - devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` + if [ x"$devices" != "x" ] ; then + devices_basename=`basename $devices` + devices_dirname=`dirname $devices` + devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` + fi root_device=`basename ${GRUB_DEVICE}` @@ -53,7 +56,13 @@ EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF freebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} +EOF + + if [ x"$devices" != "x" ] ; then + cat << EOF freebsd_loadenv ${devices_rel_dirname}/${devices_basename} +EOF + cat << EOF set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${root_device} } EOF From cba416eb0d097b1c5abec163d8fd9c78dfe3ed4a Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 13 Apr 2009 14:38:10 +0000 Subject: [PATCH 0636/1707] 2009-04-13 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Don't pass `vga=ask' parameter to Linux, simply abort telling the user it's no longer supported. --- ChangeLog | 5 +++++ loader/i386/linux.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0220dd15a..d57317846 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-13 Robert Millan + + * loader/i386/linux.c (grub_cmd_linux): Don't pass `vga=ask' parameter + to Linux, simply abort telling the user it's no longer supported. + 2009-04-13 Felix Zielcke * util/grub.d/10_freebsd.in: Don't exit if /boot/devices.hints diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 01d10d598..19444f4b8 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -583,7 +583,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), else if (grub_strcmp (val, "ext") == 0) vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; else if (grub_strcmp (val, "ask") == 0) - vid_mode = GRUB_LINUX_VID_MODE_ASK; + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "Legacy `ask' parameter no longer supported."); + goto fail; + } else vid_mode = (grub_uint16_t) grub_strtoul (val, 0, 0); From d8ba3667a2ebf891c1f913c31793a7a3b960a89f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 13 Apr 2009 15:07:16 +0000 Subject: [PATCH 0637/1707] 2009-04-13 Felix Zielcke * util/grub.d/10_freebsd.in: Add a missing `fi'. --- ChangeLog | 4 ++++ util/grub.d/10_freebsd.in | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index d57317846..4c402b14e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-13 Felix Zielcke + + * util/grub.d/10_freebsd.in: Add a missing `fi'. + 2009-04-13 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Don't pass `vga=ask' parameter diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 34f27d488..c537f1710 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -61,6 +61,7 @@ EOF if [ x"$devices" != "x" ] ; then cat << EOF freebsd_loadenv ${devices_rel_dirname}/${devices_basename} +fi EOF cat << EOF set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${root_device} From fbb4848ac035100abe22a9db39d79e57a9457243 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 13 Apr 2009 15:37:38 +0000 Subject: [PATCH 0638/1707] move fi one line below --- util/grub.d/10_freebsd.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index c537f1710..24dbbd24c 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -61,8 +61,8 @@ EOF if [ x"$devices" != "x" ] ; then cat << EOF freebsd_loadenv ${devices_rel_dirname}/${devices_basename} -fi EOF + fi cat << EOF set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${root_device} } From 7ebc2d6ba68f0197edbb9efff71905e42552f223 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 13 Apr 2009 19:48:44 +0000 Subject: [PATCH 0639/1707] 2009-04-13 Robert Millan * util/grub.d/10_freebsd.in: Detect Debian GNU/kFreeBSD and use that name for menuentries when appropiate. --- ChangeLog | 5 +++++ util/grub.d/10_freebsd.in | 9 +++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c402b14e..e61d45b89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-13 Robert Millan + + * util/grub.d/10_freebsd.in: Detect Debian GNU/kFreeBSD and use + that name for menuentries when appropiate. + 2009-04-13 Felix Zielcke * util/grub.d/10_freebsd.in: Add a missing `fi'. diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 24dbbd24c..11e3a25c4 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -1,7 +1,7 @@ #! /bin/sh -e # grub-mkconfig helper script. -# Copyright (C) 2008 Free Software Foundation, Inc. +# Copyright (C) 2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -21,6 +21,11 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ . ${libdir}/grub/grub-mkconfig_lib +case "${GRUB_DISTRIBUTOR}" in + Debian) OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD" ;; + *) OS="FreeBSD" ;; +esac + if test -e /boot/devices.hints ; then devices=/boot/devices.hints fi @@ -51,7 +56,7 @@ if [ "x$kfreebsd" != "x" ] ; then kfreebsd_fs=${GRUB_FS} cat << EOF -menuentry "FreeBSD" { +menuentry "${OS}" { EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF From 96bd81ecf9d548afe5e597f9c6a3f7e64aec84eb Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 20:35:59 +0000 Subject: [PATCH 0640/1707] * conf/common.rmk (grub_probe_SOURCES): Add Sun partition module. (grub_fstest_SOURCES): Likewise. --- ChangeLog | 3 +++ conf/common.mk | 29 +++++++++++++++++++---------- conf/common.rmk | 5 +++-- 3 files changed, 25 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index e61d45b89..a0d5fdfe2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -43,6 +43,9 @@ * include/grub/sparc64/kernel.h: Likewise. * loader/sparc64/ieee1275/linux.c: Likewise. + * conf/common.rmk (grub_probe_SOURCES): Add Sun partition module. + (grub_fstest_SOURCES): Likewise. + 2009-04-12 David S. Miller * kern/misc.c (grub_ltoa): Fix cast when handling negative diff --git a/conf/common.mk b/conf/common.mk index f707d5315..8883a08fe 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -38,14 +38,14 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ + partmap/pc.c partmap/apple.c partmap/sun.c partmap/gpt.c\ kern/fs.c kern/env.c fs/fshelp.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c -CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-fs_tar.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d +CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_sun.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o +MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-fs_tar.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_sun.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) +grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_sun.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o + $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_sun.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< @@ -171,6 +171,10 @@ grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-partmap_apple.d +grub_probe-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< +-include grub_probe-partmap_sun.d + grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< -include grub_probe-partmap_gpt.d @@ -221,16 +225,17 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ - kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/partition.c partmap/pc.c partmap/apple.c partmap/sun.c \ + partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-kern_list.d grub_fstest-kern_command.d grub_fstest-lib_arg.d grub_fstest-commands_extcmd.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-kern_list.d grub_fstest-kern_command.d grub_fstest-lib_arg.d grub_fstest-commands_extcmd.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_sun.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -392,6 +397,10 @@ grub_fstest-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-partmap_apple.d +grub_fstest-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) + $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-partmap_sun.d + grub_fstest-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-partmap_gpt.d diff --git a/conf/common.rmk b/conf/common.rmk index b0a78b0d8..185779cd9 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -19,7 +19,7 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ - partmap/pc.c partmap/apple.c partmap/gpt.c \ + partmap/pc.c partmap/apple.c partmap/sun.c partmap/gpt.c\ kern/fs.c kern/env.c fs/fshelp.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c @@ -40,7 +40,8 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ - kern/partition.c partmap/pc.c partmap/apple.c partmap/gpt.c \ + kern/partition.c partmap/pc.c partmap/apple.c partmap/sun.c \ + partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ From 6a4737e5d8fb4d8a81e5b432bfa0196f30f35c97 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 23:01:54 +0000 Subject: [PATCH 0641/1707] * util/hostdisk.c (make_device_name): Do not make any assumptions about the length of drive names. --- ChangeLog | 3 +++ util/hostdisk.c | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a0d5fdfe2..9a05c38f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -46,6 +46,9 @@ * conf/common.rmk (grub_probe_SOURCES): Add Sun partition module. (grub_fstest_SOURCES): Likewise. + * util/hostdisk.c (make_device_name): Do not make any assumptions + about the length of drive names. + 2009-04-12 David S. Miller * kern/misc.c (grub_ltoa): Fix cast when handling negative diff --git a/util/hostdisk.c b/util/hostdisk.c index 2ef205786..fd01a263b 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -622,9 +622,15 @@ grub_util_biosdisk_fini (void) static char * make_device_name (int drive, int dos_part, int bsd_part) { + int len = strlen(map[drive].drive); char *p; - p = xmalloc (30); + if (dos_part >= 0) + len += 1 + ((dos_part + 1) / 10); + if (bsd_part >= 0) + len += 2; + + p = xmalloc (len); sprintf (p, "%s", map[drive].drive); if (dos_part >= 0) From 1d7a72fd8c0d45e0812cea154bef8ce5dcbbab38 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 13 Apr 2009 23:03:50 +0000 Subject: [PATCH 0642/1707] * kern/dl.c (grub_dl_load_file): Close file immediately when we are done using it. --- ChangeLog | 3 +++ kern/dl.c | 28 +++++++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9a05c38f8..14d7ec471 100644 --- a/ChangeLog +++ b/ChangeLog @@ -49,6 +49,9 @@ * util/hostdisk.c (make_device_name): Do not make any assumptions about the length of drive names. + * kern/dl.c (grub_dl_load_file): Close file immediately when + we are done using it. + 2009-04-12 David S. Miller * kern/misc.c (grub_ltoa): Fix cast when handling negative diff --git a/kern/dl.c b/kern/dl.c index bc21403a2..458ad589f 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -584,7 +584,7 @@ grub_dl_load_core (void *addr, grub_size_t size) grub_dl_t grub_dl_load_file (const char *filename) { - grub_file_t file; + grub_file_t file = NULL; grub_ssize_t size; void *core = 0; grub_dl_t mod = 0; @@ -596,21 +596,31 @@ grub_dl_load_file (const char *filename) size = grub_file_size (file); core = grub_malloc (size); if (! core) - goto failed; + { + grub_file_close (file); + return 0; + } if (grub_file_read (file, core, size) != (int) size) - goto failed; + { + grub_file_close (file); + grub_free (core); + return 0; + } + + /* We must close this before we try to process dependencies. + Some disk backends do not handle gracefully multiple concurrent + opens of the same device. */ + grub_file_close (file); mod = grub_dl_load_core (core, size); if (! mod) - goto failed; + { + grub_free (core); + return 0; + } mod->ref_count = 0; - - failed: - grub_file_close (file); - grub_free (core); - return mod; } From 1f1f580c2f40a8f5f0bf7eda17f7dfa7322ec7a7 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 14 Apr 2009 01:54:06 +0000 Subject: [PATCH 0643/1707] 2009-04-13 Pavel Roskin * conf/common.rmk (grub_fstest_SOURCES): Add normal/datetime.c. Reported by John Stanley --- ChangeLog | 5 +++++ conf/common.mk | 14 +++++++++----- conf/common.rmk | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 14d7ec471..c2fd96620 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-13 Pavel Roskin + + * conf/common.rmk (grub_fstest_SOURCES): Add normal/datetime.c. + Reported by John Stanley + 2009-04-13 Robert Millan * util/grub.d/10_freebsd.in: Detect Debian GNU/kFreeBSD and use diff --git a/conf/common.mk b/conf/common.mk index 8883a08fe..35427c396 100644 --- a/conf/common.mk +++ b/conf/common.mk @@ -217,7 +217,7 @@ util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ disk/host.c disk/loopback.c kern/list.c kern/command.c \ - lib/arg.c commands/extcmd.c normal/misc.c \ + lib/arg.c commands/extcmd.c normal/datetime.c normal/misc.c \ lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -231,11 +231,11 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-kern_list.d grub_fstest-kern_command.d grub_fstest-lib_arg.d grub_fstest-commands_extcmd.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_sun.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d +CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_datetime.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o +MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-kern_list.d grub_fstest-kern_command.d grub_fstest-lib_arg.d grub_fstest-commands_extcmd.d grub_fstest-normal_datetime.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_sun.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) +grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_datetime.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o + $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_datetime.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< @@ -293,6 +293,10 @@ grub_fstest-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIE $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-commands_extcmd.d +grub_fstest-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) + $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< +-include grub_fstest-normal_datetime.d + grub_fstest-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< -include grub_fstest-normal_misc.d diff --git a/conf/common.rmk b/conf/common.rmk index 185779cd9..1e1b0986a 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -32,7 +32,7 @@ util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ disk/host.c disk/loopback.c kern/list.c kern/command.c \ - lib/arg.c commands/extcmd.c normal/misc.c \ + lib/arg.c commands/extcmd.c normal/datetime.c normal/misc.c \ lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ From e25b5a8c6cfd14c05b1fd12ba0e5dc0e19b71f05 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 14 Apr 2009 07:01:34 +0000 Subject: [PATCH 0644/1707] 2009-04-14 Felix Zielcke * util/hostdisk.c [__FreeBSD__ || __FreeBSD_kernel__]: Include and . (open_device) [__FreeBSD__ || __FreeBSD_kernel_]: Use sysctlgetbyname() to add 0x10 to `kern.geom.debugflags' if it's not already set, before opening the device and reset them afterwards. --- ChangeLog | 8 ++++++++ util/hostdisk.c | 30 ++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) diff --git a/ChangeLog b/ChangeLog index c2fd96620..28657554d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-04-14 Felix Zielcke + + * util/hostdisk.c [__FreeBSD__ || __FreeBSD_kernel__]: Include + and . + (open_device) [__FreeBSD__ || __FreeBSD_kernel_]: Use sysctlgetbyname() + to add 0x10 to `kern.geom.debugflags' if it's not already set, before + opening the device and reset them afterwards. + 2009-04-13 Pavel Roskin * conf/common.rmk (grub_fstest_SOURCES): Add normal/datetime.c. diff --git a/util/hostdisk.c b/util/hostdisk.c index fd01a263b..1825ac07b 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -88,6 +88,8 @@ struct hd_geometry #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) # include /* DIOCGMEDIASIZE */ +# include +# include #endif struct @@ -340,7 +342,35 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) sector -= disk->partition->start; } #else /* ! __linux__ */ +#if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) + int sysctl_flags, sysctl_oldflags; + const size_t sysctl_size = sizeof (sysctl_flags); + + if (sysctlbyname ("kern.geom.debugflags", &sysctl_oldflags, &sysctl_size, NULL, 0)) + { + grub_error (GRUB_ERR_BAD_DEVICE, "cannot get current flags of sysctl kern.geom.debugflags"); + return -1; + } + sysctl_flags = sysctl_oldflags | 0x10; + if (! (sysctl_oldflags & 0x10) + && sysctlbyname ("kern.geom.debugflags", NULL , 0, &sysctl_flags, sysctl_size)) + { + grub_error (GRUB_ERR_BAD_DEVICE, "cannot set flags of sysctl kern.geom.debugflags"); + return -1; + } +#endif + fd = open (map[disk->id].device, flags); + +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) + if (! (sysctl_oldflags & 0x10) + && sysctlbyname ("kern.geom.debugflags", NULL , 0, &sysctl_oldflags, sysctl_size)) + { + grub_error (GRUB_ERR_BAD_DEVICE, "cannot set flags back to the old value for sysctl kern.geom.debugflags"); + return -1; + } +#endif + if (fd < 0) { grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' in open_device()", map[disk->id].device); From 5c5bf96ae6b56d5b6ce272b792edb7981943d848 Mon Sep 17 00:00:00 2001 From: davem Date: Tue, 14 Apr 2009 09:07:25 +0000 Subject: [PATCH 0645/1707] * util/hostdisk.c (make_device_name): Fix buffer length calculations. --- ChangeLog | 6 ++++++ util/hostdisk.c | 14 ++++++++++++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28657554d..9c51eefe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-14 John Stanley + David S. Miller + + * util/hostdisk.c (make_device_name): Fix buffer length + calculations. + 2009-04-14 Felix Zielcke * util/hostdisk.c [__FreeBSD__ || __FreeBSD_kernel__]: Include diff --git a/util/hostdisk.c b/util/hostdisk.c index 1825ac07b..2fd1010a2 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -656,11 +656,21 @@ make_device_name (int drive, int dos_part, int bsd_part) char *p; if (dos_part >= 0) - len += 1 + ((dos_part + 1) / 10); + { + /* Add in char length of dos_part+1 */ + int tmp = dos_part + 1; + len++; + while ((tmp /= 10) != 0) + len++; + } if (bsd_part >= 0) len += 2; - p = xmalloc (len); + /* Length to alloc is: char length of map[drive].drive, plus + * char length of (dos_part+1) or of bsd_part, plus + * 2 for the comma and a null/end of string (\0) + */ + p = xmalloc (len + 2); sprintf (p, "%s", map[drive].drive); if (dos_part >= 0) From 4484e01e46f7a9a32a2452251b88b5b93d1e6df2 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 14 Apr 2009 16:11:26 +0000 Subject: [PATCH 0646/1707] 2009-04-14 Felix Zielcke * configure: Remove. * config.h.in: Likewise. * DISTLIST: Likewise. * conf/common.mk: Likewise. * conf/i386-coreboot.mk: Likewise. * conf/i386-efi.mk: Likewise. * conf/i386-ieee1275.mk: Likewise. * conf/i386.mk: Likewise. * conf/i386-pc.mk: Likewise. * conf/powerpc-ieee1275.mk: Likewise. * conf/sparc64-ieee1275.mk: Likewise. * conf/x86_64-efi.mk: Likewise. * INSTALL: Remove the sentence that Ruby and autoconf are only required if you develop on GRUB. --- ChangeLog | 18 + INSTALL | 3 - conf/common.mk | 4583 ----------------- conf/i386-coreboot.mk | 2000 -------- conf/i386-efi.mk | 1877 ------- conf/i386-ieee1275.mk | 1943 ------- conf/i386-pc.mk | 3496 ------------- conf/i386.mk | 192 - conf/powerpc-ieee1275.mk | 1473 ------ conf/sparc64-ieee1275.mk | 2336 --------- conf/x86_64-efi.mk | 1885 ------- config.h.in | 134 - configure | 10038 ------------------------------------- 13 files changed, 18 insertions(+), 29960 deletions(-) delete mode 100644 conf/common.mk delete mode 100644 conf/i386-coreboot.mk delete mode 100644 conf/i386-efi.mk delete mode 100644 conf/i386-ieee1275.mk delete mode 100644 conf/i386-pc.mk delete mode 100644 conf/i386.mk delete mode 100644 conf/powerpc-ieee1275.mk delete mode 100644 conf/sparc64-ieee1275.mk delete mode 100644 conf/x86_64-efi.mk delete mode 100644 config.h.in delete mode 100644 configure diff --git a/ChangeLog b/ChangeLog index 9c51eefe1..3f7dc7bff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2009-04-14 Felix Zielcke + + * configure: Remove. + * config.h.in: Likewise. + * DISTLIST: Likewise. + * conf/common.mk: Likewise. + * conf/i386-coreboot.mk: Likewise. + * conf/i386-efi.mk: Likewise. + * conf/i386-ieee1275.mk: Likewise. + * conf/i386.mk: Likewise. + * conf/i386-pc.mk: Likewise. + * conf/powerpc-ieee1275.mk: Likewise. + * conf/sparc64-ieee1275.mk: Likewise. + * conf/x86_64-efi.mk: Likewise. + + * INSTALL: Remove the sentence that Ruby and autoconf are only required if you + develop on GRUB. + 2009-04-14 John Stanley David S. Miller diff --git a/INSTALL b/INSTALL index e2b7c00e3..fa2edfdac 100644 --- a/INSTALL +++ b/INSTALL @@ -17,9 +17,6 @@ configuring the GRUB. * GNU binutils 2.9.1.0.23 or later * Other standard GNU/Unix tools * LZO 1.02 or later (optional) - -If you'd like to develop GRUB, these below are also required. - * Ruby 1.6 or later * Autoconf 2.59 or later diff --git a/conf/common.mk b/conf/common.mk deleted file mode 100644 index 35427c396..000000000 --- a/conf/common.mk +++ /dev/null @@ -1,4583 +0,0 @@ -# -*- makefile -*- -# Generated by genmk.rb, please don't edit! - -# For grub-mkelfimage. -bin_UTILITIES += grub-mkelfimage -grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ - util/resolve.c -CLEANFILES += grub-mkelfimage$(EXEEXT) grub_mkelfimage-util_elf_grub_mkimage.o grub_mkelfimage-util_misc.o grub_mkelfimage-util_resolve.o -MOSTLYCLEANFILES += grub_mkelfimage-util_elf_grub_mkimage.d grub_mkelfimage-util_misc.d grub_mkelfimage-util_resolve.d - -grub-mkelfimage: $(grub_mkelfimage_DEPENDENCIES) grub_mkelfimage-util_elf_grub_mkimage.o grub_mkelfimage-util_misc.o grub_mkelfimage-util_resolve.o - $(CC) -o $@ grub_mkelfimage-util_elf_grub_mkimage.o grub_mkelfimage-util_misc.o grub_mkelfimage-util_resolve.o $(LDFLAGS) $(grub_mkelfimage_LDFLAGS) - -grub_mkelfimage-util_elf_grub_mkimage.o: util/elf/grub-mkimage.c $(util/elf/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/elf -I$(srcdir)/util/elf $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkelfimage_CFLAGS) -MD -c -o $@ $< --include grub_mkelfimage-util_elf_grub_mkimage.d - -grub_mkelfimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkelfimage_CFLAGS) -MD -c -o $@ $< --include grub_mkelfimage-util_misc.d - -grub_mkelfimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkelfimage_CFLAGS) -MD -c -o $@ $< --include grub_mkelfimage-util_resolve.d - -util/elf/grub-mkimage.c_DEPENDENCIES = Makefile - -# For grub-probe. -sbin_UTILITIES += grub-probe -util/grub-probe.c_DEPENDENCIES = grub_probe_init.h -grub_probe_SOURCES = util/grub-probe.c \ - util/hostdisk.c util/misc.c util/getroot.c \ - kern/device.c kern/disk.c kern/err.c kern/misc.c \ - kern/parser.c kern/partition.c kern/file.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - partmap/pc.c partmap/apple.c partmap/sun.c partmap/gpt.c\ - kern/fs.c kern/env.c fs/fshelp.c \ - disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c -CLEANFILES += grub-probe$(EXEEXT) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_sun.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o -MOSTLYCLEANFILES += grub_probe-util_grub_probe.d grub_probe-util_hostdisk.d grub_probe-util_misc.d grub_probe-util_getroot.d grub_probe-kern_device.d grub_probe-kern_disk.d grub_probe-kern_err.d grub_probe-kern_misc.d grub_probe-kern_parser.d grub_probe-kern_partition.d grub_probe-kern_file.d grub_probe-fs_affs.d grub_probe-fs_cpio.d grub_probe-fs_fat.d grub_probe-fs_ext2.d grub_probe-fs_hfs.d grub_probe-fs_hfsplus.d grub_probe-fs_iso9660.d grub_probe-fs_udf.d grub_probe-fs_jfs.d grub_probe-fs_minix.d grub_probe-fs_ntfs.d grub_probe-fs_ntfscomp.d grub_probe-fs_reiserfs.d grub_probe-fs_sfs.d grub_probe-fs_ufs.d grub_probe-fs_xfs.d grub_probe-fs_afs.d grub_probe-fs_tar.d grub_probe-partmap_pc.d grub_probe-partmap_apple.d grub_probe-partmap_sun.d grub_probe-partmap_gpt.d grub_probe-kern_fs.d grub_probe-kern_env.d grub_probe-fs_fshelp.d grub_probe-disk_raid.d grub_probe-disk_mdraid_linux.d grub_probe-disk_lvm.d grub_probe-grub_probe_init.d - -grub-probe: $(grub_probe_DEPENDENCIES) grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_sun.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o - $(CC) -o $@ grub_probe-util_grub_probe.o grub_probe-util_hostdisk.o grub_probe-util_misc.o grub_probe-util_getroot.o grub_probe-kern_device.o grub_probe-kern_disk.o grub_probe-kern_err.o grub_probe-kern_misc.o grub_probe-kern_parser.o grub_probe-kern_partition.o grub_probe-kern_file.o grub_probe-fs_affs.o grub_probe-fs_cpio.o grub_probe-fs_fat.o grub_probe-fs_ext2.o grub_probe-fs_hfs.o grub_probe-fs_hfsplus.o grub_probe-fs_iso9660.o grub_probe-fs_udf.o grub_probe-fs_jfs.o grub_probe-fs_minix.o grub_probe-fs_ntfs.o grub_probe-fs_ntfscomp.o grub_probe-fs_reiserfs.o grub_probe-fs_sfs.o grub_probe-fs_ufs.o grub_probe-fs_xfs.o grub_probe-fs_afs.o grub_probe-fs_tar.o grub_probe-partmap_pc.o grub_probe-partmap_apple.o grub_probe-partmap_sun.o grub_probe-partmap_gpt.o grub_probe-kern_fs.o grub_probe-kern_env.o grub_probe-fs_fshelp.o grub_probe-disk_raid.o grub_probe-disk_mdraid_linux.o grub_probe-disk_lvm.o grub_probe-grub_probe_init.o $(LDFLAGS) $(grub_probe_LDFLAGS) - -grub_probe-util_grub_probe.o: util/grub-probe.c $(util/grub-probe.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_grub_probe.d - -grub_probe-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_hostdisk.d - -grub_probe-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_misc.d - -grub_probe-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-util_getroot.d - -grub_probe-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_device.d - -grub_probe-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_disk.d - -grub_probe-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_err.d - -grub_probe-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_misc.d - -grub_probe-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_parser.d - -grub_probe-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_partition.d - -grub_probe-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_file.d - -grub_probe-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_affs.d - -grub_probe-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_cpio.d - -grub_probe-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fat.d - -grub_probe-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ext2.d - -grub_probe-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfs.d - -grub_probe-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_hfsplus.d - -grub_probe-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_iso9660.d - -grub_probe-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_udf.d - -grub_probe-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_jfs.d - -grub_probe-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_minix.d - -grub_probe-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfs.d - -grub_probe-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ntfscomp.d - -grub_probe-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_reiserfs.d - -grub_probe-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_sfs.d - -grub_probe-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_ufs.d - -grub_probe-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_xfs.d - -grub_probe-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_afs.d - -grub_probe-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_tar.d - -grub_probe-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_pc.d - -grub_probe-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_apple.d - -grub_probe-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_sun.d - -grub_probe-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-partmap_gpt.d - -grub_probe-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_fs.d - -grub_probe-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-kern_env.d - -grub_probe-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-fs_fshelp.d - -grub_probe-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_raid.d - -grub_probe-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_mdraid_linux.d - -grub_probe-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-disk_lvm.d - -grub_probe-grub_probe_init.o: grub_probe_init.c $(grub_probe_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_probe_CFLAGS) -MD -c -o $@ $< --include grub_probe-grub_probe_init.d - - -ifeq ($(enable_grub_fstest), yes) -bin_UTILITIES += grub-fstest -endif - -# For grub-fstest. -util/grub-fstest.c_DEPENDENCIES = grub_fstest_init.h -grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ - kern/file.c kern/device.c kern/disk.c kern/err.c kern/misc.c \ - disk/host.c disk/loopback.c kern/list.c kern/command.c \ - lib/arg.c commands/extcmd.c normal/datetime.c normal/misc.c \ - lib/hexdump.c lib/crc.c commands/blocklist.c commands/ls.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - kern/partition.c partmap/pc.c partmap/apple.c partmap/sun.c \ - partmap/gpt.c \ - kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ - disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - grub_fstest_init.c -CLEANFILES += grub-fstest$(EXEEXT) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_datetime.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o -MOSTLYCLEANFILES += grub_fstest-util_grub_fstest.d grub_fstest-util_hostfs.d grub_fstest-util_misc.d grub_fstest-kern_file.d grub_fstest-kern_device.d grub_fstest-kern_disk.d grub_fstest-kern_err.d grub_fstest-kern_misc.d grub_fstest-disk_host.d grub_fstest-disk_loopback.d grub_fstest-kern_list.d grub_fstest-kern_command.d grub_fstest-lib_arg.d grub_fstest-commands_extcmd.d grub_fstest-normal_datetime.d grub_fstest-normal_misc.d grub_fstest-lib_hexdump.d grub_fstest-lib_crc.d grub_fstest-commands_blocklist.d grub_fstest-commands_ls.d grub_fstest-fs_affs.d grub_fstest-fs_cpio.d grub_fstest-fs_fat.d grub_fstest-fs_ext2.d grub_fstest-fs_hfs.d grub_fstest-fs_hfsplus.d grub_fstest-fs_iso9660.d grub_fstest-fs_udf.d grub_fstest-fs_jfs.d grub_fstest-fs_minix.d grub_fstest-fs_ntfs.d grub_fstest-fs_ntfscomp.d grub_fstest-fs_reiserfs.d grub_fstest-fs_sfs.d grub_fstest-fs_ufs.d grub_fstest-fs_xfs.d grub_fstest-fs_afs.d grub_fstest-fs_tar.d grub_fstest-kern_partition.d grub_fstest-partmap_pc.d grub_fstest-partmap_apple.d grub_fstest-partmap_sun.d grub_fstest-partmap_gpt.d grub_fstest-kern_fs.d grub_fstest-kern_env.d grub_fstest-fs_fshelp.d grub_fstest-disk_raid.d grub_fstest-disk_raid5_recover.d grub_fstest-disk_raid6_recover.d grub_fstest-disk_mdraid_linux.d grub_fstest-disk_dmraid_nvidia.d grub_fstest-disk_lvm.d grub_fstest-grub_fstest_init.d - -grub-fstest: $(grub_fstest_DEPENDENCIES) grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_datetime.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o - $(CC) -o $@ grub_fstest-util_grub_fstest.o grub_fstest-util_hostfs.o grub_fstest-util_misc.o grub_fstest-kern_file.o grub_fstest-kern_device.o grub_fstest-kern_disk.o grub_fstest-kern_err.o grub_fstest-kern_misc.o grub_fstest-disk_host.o grub_fstest-disk_loopback.o grub_fstest-kern_list.o grub_fstest-kern_command.o grub_fstest-lib_arg.o grub_fstest-commands_extcmd.o grub_fstest-normal_datetime.o grub_fstest-normal_misc.o grub_fstest-lib_hexdump.o grub_fstest-lib_crc.o grub_fstest-commands_blocklist.o grub_fstest-commands_ls.o grub_fstest-fs_affs.o grub_fstest-fs_cpio.o grub_fstest-fs_fat.o grub_fstest-fs_ext2.o grub_fstest-fs_hfs.o grub_fstest-fs_hfsplus.o grub_fstest-fs_iso9660.o grub_fstest-fs_udf.o grub_fstest-fs_jfs.o grub_fstest-fs_minix.o grub_fstest-fs_ntfs.o grub_fstest-fs_ntfscomp.o grub_fstest-fs_reiserfs.o grub_fstest-fs_sfs.o grub_fstest-fs_ufs.o grub_fstest-fs_xfs.o grub_fstest-fs_afs.o grub_fstest-fs_tar.o grub_fstest-kern_partition.o grub_fstest-partmap_pc.o grub_fstest-partmap_apple.o grub_fstest-partmap_sun.o grub_fstest-partmap_gpt.o grub_fstest-kern_fs.o grub_fstest-kern_env.o grub_fstest-fs_fshelp.o grub_fstest-disk_raid.o grub_fstest-disk_raid5_recover.o grub_fstest-disk_raid6_recover.o grub_fstest-disk_mdraid_linux.o grub_fstest-disk_dmraid_nvidia.o grub_fstest-disk_lvm.o grub_fstest-grub_fstest_init.o $(LDFLAGS) $(grub_fstest_LDFLAGS) - -grub_fstest-util_grub_fstest.o: util/grub-fstest.c $(util/grub-fstest.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-util_grub_fstest.d - -grub_fstest-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-util_hostfs.d - -grub_fstest-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-util_misc.d - -grub_fstest-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_file.d - -grub_fstest-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_device.d - -grub_fstest-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_disk.d - -grub_fstest-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_err.d - -grub_fstest-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_misc.d - -grub_fstest-disk_host.o: disk/host.c $(disk/host.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_host.d - -grub_fstest-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_loopback.d - -grub_fstest-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_list.d - -grub_fstest-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_command.d - -grub_fstest-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-lib_arg.d - -grub_fstest-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-commands_extcmd.d - -grub_fstest-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-normal_datetime.d - -grub_fstest-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-normal_misc.d - -grub_fstest-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-lib_hexdump.d - -grub_fstest-lib_crc.o: lib/crc.c $(lib/crc.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-lib_crc.d - -grub_fstest-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-commands_blocklist.d - -grub_fstest-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-commands_ls.d - -grub_fstest-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_affs.d - -grub_fstest-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_cpio.d - -grub_fstest-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_fat.d - -grub_fstest-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ext2.d - -grub_fstest-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_hfs.d - -grub_fstest-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_hfsplus.d - -grub_fstest-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_iso9660.d - -grub_fstest-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_udf.d - -grub_fstest-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_jfs.d - -grub_fstest-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_minix.d - -grub_fstest-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ntfs.d - -grub_fstest-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ntfscomp.d - -grub_fstest-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_reiserfs.d - -grub_fstest-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_sfs.d - -grub_fstest-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_ufs.d - -grub_fstest-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_xfs.d - -grub_fstest-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_afs.d - -grub_fstest-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_tar.d - -grub_fstest-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_partition.d - -grub_fstest-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-partmap_pc.d - -grub_fstest-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-partmap_apple.d - -grub_fstest-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-partmap_sun.d - -grub_fstest-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-partmap_gpt.d - -grub_fstest-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_fs.d - -grub_fstest-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-kern_env.d - -grub_fstest-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-fs_fshelp.d - -grub_fstest-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_raid.d - -grub_fstest-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_raid5_recover.d - -grub_fstest-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_raid6_recover.d - -grub_fstest-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_mdraid_linux.d - -grub_fstest-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_dmraid_nvidia.d - -grub_fstest-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-disk_lvm.d - -grub_fstest-grub_fstest_init.o: grub_fstest_init.c $(grub_fstest_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_fstest_CFLAGS) -MD -c -o $@ $< --include grub_fstest-grub_fstest_init.d - - -# For grub-mkfont. -ifeq ($(enable_grub_mkfont), yes) -bin_UTILITIES += grub-mkfont -grub_mkfont_SOURCES = util/grub-mkfont.c util/misc.c -CLEANFILES += grub-mkfont$(EXEEXT) grub_mkfont-util_grub_mkfont.o grub_mkfont-util_misc.o -MOSTLYCLEANFILES += grub_mkfont-util_grub_mkfont.d grub_mkfont-util_misc.d - -grub-mkfont: $(grub_mkfont_DEPENDENCIES) grub_mkfont-util_grub_mkfont.o grub_mkfont-util_misc.o - $(CC) -o $@ grub_mkfont-util_grub_mkfont.o grub_mkfont-util_misc.o $(LDFLAGS) $(grub_mkfont_LDFLAGS) - -grub_mkfont-util_grub_mkfont.o: util/grub-mkfont.c $(util/grub-mkfont.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkfont_CFLAGS) -MD -c -o $@ $< --include grub_mkfont-util_grub_mkfont.d - -grub_mkfont-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkfont_CFLAGS) -MD -c -o $@ $< --include grub_mkfont-util_misc.d - -grub_mkfont_CFLAGS = $(freetype_cflags) -grub_mkfont_LDFLAGS = $(freetype_libs) -endif - -# For the parser. -grub_script.tab.c grub_script.tab.h: normal/parser.y - $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y -DISTCLEANFILES += grub_script.tab.c grub_script.tab.h - -# For grub-emu. -grub_emu_init.lst: geninit.sh $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) - rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ -DISTCLEANFILES += grub_emu_init.lst - -grub_emu_init.h: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninitheader.sh - rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ -DISTCLEANFILES += grub_emu_init.h - -grub_emu_init.c: grub_emu_init.lst $(filter-out grub_emu_init.c,$(grub_emu_SOURCES)) geninit.sh grub_emu_init.h - rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ -DISTCLEANFILES += grub_emu_init.c - -# For grub-probe. -grub_probe_init.lst: geninit.sh $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) - rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ -DISTCLEANFILES += grub_probe_init.lst - -grub_probe_init.h: grub_probe_init.lst $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) geninitheader.sh - rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ -DISTCLEANFILES += grub_probe_init.h - -grub_probe_init.c: grub_probe_init.lst $(filter-out grub_probe_init.c,$(grub_probe_SOURCES)) geninit.sh grub_probe_init.h - rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ -DISTCLEANFILES += grub_probe_init.c - -# For grub-setup. -grub_setup_init.lst: geninit.sh $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) - rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ -DISTCLEANFILES += grub_setup_init.lst - -grub_setup_init.h: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) geninitheader.sh - rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ -DISTCLEANFILES += grub_setup_init.h - -grub_setup_init.c: grub_setup_init.lst $(filter-out grub_setup_init.c,$(grub_setup_SOURCES)) geninit.sh grub_setup_init.h - rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ -DISTCLEANFILES += grub_setup_init.c - -# For grub-fstest. -grub_fstest_init.lst: geninit.sh $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) - rm -f $@; grep GRUB_MOD_INIT $(filter %.c,$^) /dev/null > $@ -DISTCLEANFILES += grub_fstest_init.lst - -grub_fstest_init.h: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninitheader.sh - rm -f $@; sh $(srcdir)/geninitheader.sh $< > $@ -DISTCLEANFILES += grub_fstest_init.h - -grub_fstest_init.c: grub_fstest_init.lst $(filter-out grub_fstest_init.c,$(grub_fstest_SOURCES)) geninit.sh grub_fstest_init.h - rm -f $@; sh $(srcdir)/geninit.sh $< $(filter %.c,$^) > $@ -DISTCLEANFILES += grub_fstest_init.c - -# for grub-editenv -bin_UTILITIES += grub-editenv -grub_editenv_SOURCES = util/grub-editenv.c lib/envblk.c util/misc.c kern/misc.c kern/err.c -CLEANFILES += grub-editenv$(EXEEXT) grub_editenv-util_grub_editenv.o grub_editenv-lib_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o -MOSTLYCLEANFILES += grub_editenv-util_grub_editenv.d grub_editenv-lib_envblk.d grub_editenv-util_misc.d grub_editenv-kern_misc.d grub_editenv-kern_err.d - -grub-editenv: $(grub_editenv_DEPENDENCIES) grub_editenv-util_grub_editenv.o grub_editenv-lib_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o - $(CC) -o $@ grub_editenv-util_grub_editenv.o grub_editenv-lib_envblk.o grub_editenv-util_misc.o grub_editenv-kern_misc.o grub_editenv-kern_err.o $(LDFLAGS) $(grub_editenv_LDFLAGS) - -grub_editenv-util_grub_editenv.o: util/grub-editenv.c $(util/grub-editenv.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< --include grub_editenv-util_grub_editenv.d - -grub_editenv-lib_envblk.o: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< --include grub_editenv-lib_envblk.d - -grub_editenv-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< --include grub_editenv-util_misc.d - -grub_editenv-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< --include grub_editenv-kern_misc.d - -grub_editenv-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_editenv_CFLAGS) -MD -c -o $@ $< --include grub_editenv-kern_err.d - -CLEANFILES += grub-editenv - -# for grub-pe2elf -ifeq ($(enable_grub_pe2elf), yes) -bin_UTILITIES += grub-pe2elf -endif - -grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c -CLEANFILES += grub-pe2elf$(EXEEXT) grub_pe2elf-util_grub_pe2elf.o grub_pe2elf-util_misc.o -MOSTLYCLEANFILES += grub_pe2elf-util_grub_pe2elf.d grub_pe2elf-util_misc.d - -grub-pe2elf: $(grub_pe2elf_DEPENDENCIES) grub_pe2elf-util_grub_pe2elf.o grub_pe2elf-util_misc.o - $(CC) -o $@ grub_pe2elf-util_grub_pe2elf.o grub_pe2elf-util_misc.o $(LDFLAGS) $(grub_pe2elf_LDFLAGS) - -grub_pe2elf-util_grub_pe2elf.o: util/grub-pe2elf.c $(util/grub-pe2elf.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_pe2elf_CFLAGS) -MD -c -o $@ $< --include grub_pe2elf-util_grub_pe2elf.d - -grub_pe2elf-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_pe2elf_CFLAGS) -MD -c -o $@ $< --include grub_pe2elf-util_misc.d - -CLEANFILES += grub-pe2elf - -# For grub-mkconfig -grub-mkconfig: util/grub-mkconfig.in config.status - ./config.status --file=$@:$< - chmod +x $@ -sbin_SCRIPTS += grub-mkconfig -CLEANFILES += grub-mkconfig - -grub-mkconfig_lib: util/grub-mkconfig_lib.in config.status - ./config.status --file=$@:$< - chmod +x $@ -lib_DATA += grub-mkconfig_lib -CLEANFILES += grub-mkconfig_lib - -update-grub_lib: util/update-grub_lib.in config.status - ./config.status --file=$@:$< - chmod +x $@ -lib_DATA += update-grub_lib -CLEANFILES += update-grub_lib - -%: util/grub.d/%.in config.status - ./config.status --file=$@:$< - chmod +x $@ -grub-mkconfig_SCRIPTS = 00_header 30_os-prober 40_custom -ifneq (, $(host_kernel)) -grub-mkconfig_SCRIPTS += 10_$(host_kernel) -endif - -CLEANFILES += $(grub-mkconfig_SCRIPTS) - -grub-mkconfig_DATA += util/grub.d/README - -# For grub-dumpbios -grub-dumpbios: util/grub-dumpbios.in config.status - ./config.status --file=$@:$< - chmod +x $@ -sbin_SCRIPTS += grub-dumpbios -CLEANFILES += grub-dumpbios - -# Filing systems. -pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ - ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ - affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod tar.mod \ - udf.mod afs.mod - -# For fshelp.mod. -fshelp_mod_SOURCES = fs/fshelp.c -CLEANFILES += fshelp.mod mod-fshelp.o mod-fshelp.c pre-fshelp.o fshelp_mod-fs_fshelp.o und-fshelp.lst -ifneq ($(fshelp_mod_EXPORTS),no) -CLEANFILES += def-fshelp.lst -DEFSYMFILES += def-fshelp.lst -endif -MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d -UNDSYMFILES += und-fshelp.lst - -fshelp.mod: pre-fshelp.o mod-fshelp.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o - -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fshelp_mod-fs_fshelp.o - -mod-fshelp.o: mod-fshelp.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $< - -mod-fshelp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fshelp_mod_EXPORTS),no) -def-fshelp.lst: pre-fshelp.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fshelp/' > $@ -endif - -und-fshelp.lst: pre-fshelp.o - echo 'fshelp' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fshelp_mod-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -MD -c -o $@ $< --include fshelp_mod-fs_fshelp.d - -CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst partmap-fshelp_mod-fs_fshelp.lst -COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst -FSFILES += fs-fshelp_mod-fs_fshelp.lst -PARTMAPFILES += partmap-fshelp_mod-fs_fshelp.lst - -cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) - -fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) - -partmap-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) - - -fshelp_mod_CFLAGS = $(COMMON_CFLAGS) -fshelp_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fat.mod. -fat_mod_SOURCES = fs/fat.c -CLEANFILES += fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o und-fat.lst -ifneq ($(fat_mod_EXPORTS),no) -CLEANFILES += def-fat.lst -DEFSYMFILES += def-fat.lst -endif -MOSTLYCLEANFILES += fat_mod-fs_fat.d -UNDSYMFILES += und-fat.lst - -fat.mod: pre-fat.o mod-fat.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o - -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fat_mod-fs_fat.o - -mod-fat.o: mod-fat.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $< - -mod-fat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fat_mod_EXPORTS),no) -def-fat.lst: pre-fat.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fat/' > $@ -endif - -und-fat.lst: pre-fat.o - echo 'fat' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fat_mod-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -MD -c -o $@ $< --include fat_mod-fs_fat.d - -CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst partmap-fat_mod-fs_fat.lst -COMMANDFILES += cmd-fat_mod-fs_fat.lst -FSFILES += fs-fat_mod-fs_fat.lst -PARTMAPFILES += partmap-fat_mod-fs_fat.lst - -cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) - -fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) - -partmap-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) - - -fat_mod_CFLAGS = $(COMMON_CFLAGS) -fat_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ufs.mod. -ufs_mod_SOURCES = fs/ufs.c -CLEANFILES += ufs.mod mod-ufs.o mod-ufs.c pre-ufs.o ufs_mod-fs_ufs.o und-ufs.lst -ifneq ($(ufs_mod_EXPORTS),no) -CLEANFILES += def-ufs.lst -DEFSYMFILES += def-ufs.lst -endif -MOSTLYCLEANFILES += ufs_mod-fs_ufs.d -UNDSYMFILES += und-ufs.lst - -ufs.mod: pre-ufs.o mod-ufs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o - -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ufs_mod-fs_ufs.o - -mod-ufs.o: mod-ufs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $< - -mod-ufs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ufs_mod_EXPORTS),no) -def-ufs.lst: pre-ufs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ufs/' > $@ -endif - -und-ufs.lst: pre-ufs.o - echo 'ufs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ufs_mod-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -MD -c -o $@ $< --include ufs_mod-fs_ufs.d - -CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst partmap-ufs_mod-fs_ufs.lst -COMMANDFILES += cmd-ufs_mod-fs_ufs.lst -FSFILES += fs-ufs_mod-fs_ufs.lst -PARTMAPFILES += partmap-ufs_mod-fs_ufs.lst - -cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) - -fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) - -partmap-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) - - -ufs_mod_CFLAGS = $(COMMON_CFLAGS) -ufs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ext2.mod. -ext2_mod_SOURCES = fs/ext2.c -CLEANFILES += ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2.o und-ext2.lst -ifneq ($(ext2_mod_EXPORTS),no) -CLEANFILES += def-ext2.lst -DEFSYMFILES += def-ext2.lst -endif -MOSTLYCLEANFILES += ext2_mod-fs_ext2.d -UNDSYMFILES += und-ext2.lst - -ext2.mod: pre-ext2.o mod-ext2.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o - -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ext2_mod-fs_ext2.o - -mod-ext2.o: mod-ext2.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $< - -mod-ext2.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ext2_mod_EXPORTS),no) -def-ext2.lst: pre-ext2.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ext2/' > $@ -endif - -und-ext2.lst: pre-ext2.o - echo 'ext2' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ext2_mod-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -MD -c -o $@ $< --include ext2_mod-fs_ext2.d - -CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst partmap-ext2_mod-fs_ext2.lst -COMMANDFILES += cmd-ext2_mod-fs_ext2.lst -FSFILES += fs-ext2_mod-fs_ext2.lst -PARTMAPFILES += partmap-ext2_mod-fs_ext2.lst - -cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) - -fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) - -partmap-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) - - -ext2_mod_CFLAGS = $(COMMON_CFLAGS) -ext2_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ntfs.mod. -ntfs_mod_SOURCES = fs/ntfs.c -CLEANFILES += ntfs.mod mod-ntfs.o mod-ntfs.c pre-ntfs.o ntfs_mod-fs_ntfs.o und-ntfs.lst -ifneq ($(ntfs_mod_EXPORTS),no) -CLEANFILES += def-ntfs.lst -DEFSYMFILES += def-ntfs.lst -endif -MOSTLYCLEANFILES += ntfs_mod-fs_ntfs.d -UNDSYMFILES += und-ntfs.lst - -ntfs.mod: pre-ntfs.o mod-ntfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfs.o mod-ntfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ntfs.o: $(ntfs_mod_DEPENDENCIES) ntfs_mod-fs_ntfs.o - -rm -f $@ - $(TARGET_CC) $(ntfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ntfs_mod-fs_ntfs.o - -mod-ntfs.o: mod-ntfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -c -o $@ $< - -mod-ntfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ntfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ntfs_mod_EXPORTS),no) -def-ntfs.lst: pre-ntfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ntfs/' > $@ -endif - -und-ntfs.lst: pre-ntfs.o - echo 'ntfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ntfs_mod-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -MD -c -o $@ $< --include ntfs_mod-fs_ntfs.d - -CLEANFILES += cmd-ntfs_mod-fs_ntfs.lst fs-ntfs_mod-fs_ntfs.lst partmap-ntfs_mod-fs_ntfs.lst -COMMANDFILES += cmd-ntfs_mod-fs_ntfs.lst -FSFILES += fs-ntfs_mod-fs_ntfs.lst -PARTMAPFILES += partmap-ntfs_mod-fs_ntfs.lst - -cmd-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfs > $@ || (rm -f $@; exit 1) - -fs-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfs > $@ || (rm -f $@; exit 1) - -partmap-ntfs_mod-fs_ntfs.lst: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfs > $@ || (rm -f $@; exit 1) - - -ntfs_mod_CFLAGS = $(COMMON_CFLAGS) -ntfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ntfscomp.mod. -ntfscomp_mod_SOURCES = fs/ntfscomp.c -CLEANFILES += ntfscomp.mod mod-ntfscomp.o mod-ntfscomp.c pre-ntfscomp.o ntfscomp_mod-fs_ntfscomp.o und-ntfscomp.lst -ifneq ($(ntfscomp_mod_EXPORTS),no) -CLEANFILES += def-ntfscomp.lst -DEFSYMFILES += def-ntfscomp.lst -endif -MOSTLYCLEANFILES += ntfscomp_mod-fs_ntfscomp.d -UNDSYMFILES += und-ntfscomp.lst - -ntfscomp.mod: pre-ntfscomp.o mod-ntfscomp.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ntfscomp.o mod-ntfscomp.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ntfscomp.o: $(ntfscomp_mod_DEPENDENCIES) ntfscomp_mod-fs_ntfscomp.o - -rm -f $@ - $(TARGET_CC) $(ntfscomp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ntfscomp_mod-fs_ntfscomp.o - -mod-ntfscomp.o: mod-ntfscomp.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -c -o $@ $< - -mod-ntfscomp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ntfscomp' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ntfscomp_mod_EXPORTS),no) -def-ntfscomp.lst: pre-ntfscomp.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ntfscomp/' > $@ -endif - -und-ntfscomp.lst: pre-ntfscomp.o - echo 'ntfscomp' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ntfscomp_mod-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -MD -c -o $@ $< --include ntfscomp_mod-fs_ntfscomp.d - -CLEANFILES += cmd-ntfscomp_mod-fs_ntfscomp.lst fs-ntfscomp_mod-fs_ntfscomp.lst partmap-ntfscomp_mod-fs_ntfscomp.lst -COMMANDFILES += cmd-ntfscomp_mod-fs_ntfscomp.lst -FSFILES += fs-ntfscomp_mod-fs_ntfscomp.lst -PARTMAPFILES += partmap-ntfscomp_mod-fs_ntfscomp.lst - -cmd-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ntfscomp > $@ || (rm -f $@; exit 1) - -fs-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ntfscomp > $@ || (rm -f $@; exit 1) - -partmap-ntfscomp_mod-fs_ntfscomp.lst: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ntfscomp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ntfscomp > $@ || (rm -f $@; exit 1) - - -ntfscomp_mod_CFLAGS = $(COMMON_CFLAGS) -ntfscomp_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For minix.mod. -minix_mod_SOURCES = fs/minix.c -CLEANFILES += minix.mod mod-minix.o mod-minix.c pre-minix.o minix_mod-fs_minix.o und-minix.lst -ifneq ($(minix_mod_EXPORTS),no) -CLEANFILES += def-minix.lst -DEFSYMFILES += def-minix.lst -endif -MOSTLYCLEANFILES += minix_mod-fs_minix.d -UNDSYMFILES += und-minix.lst - -minix.mod: pre-minix.o mod-minix.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o - -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ minix_mod-fs_minix.o - -mod-minix.o: mod-minix.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $< - -mod-minix.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(minix_mod_EXPORTS),no) -def-minix.lst: pre-minix.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 minix/' > $@ -endif - -und-minix.lst: pre-minix.o - echo 'minix' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -minix_mod-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -MD -c -o $@ $< --include minix_mod-fs_minix.d - -CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst partmap-minix_mod-fs_minix.lst -COMMANDFILES += cmd-minix_mod-fs_minix.lst -FSFILES += fs-minix_mod-fs_minix.lst -PARTMAPFILES += partmap-minix_mod-fs_minix.lst - -cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) - -fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) - -partmap-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) - - -minix_mod_CFLAGS = $(COMMON_CFLAGS) -minix_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hfs.mod. -hfs_mod_SOURCES = fs/hfs.c -CLEANFILES += hfs.mod mod-hfs.o mod-hfs.c pre-hfs.o hfs_mod-fs_hfs.o und-hfs.lst -ifneq ($(hfs_mod_EXPORTS),no) -CLEANFILES += def-hfs.lst -DEFSYMFILES += def-hfs.lst -endif -MOSTLYCLEANFILES += hfs_mod-fs_hfs.d -UNDSYMFILES += und-hfs.lst - -hfs.mod: pre-hfs.o mod-hfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o - -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hfs_mod-fs_hfs.o - -mod-hfs.o: mod-hfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $< - -mod-hfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(hfs_mod_EXPORTS),no) -def-hfs.lst: pre-hfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hfs/' > $@ -endif - -und-hfs.lst: pre-hfs.o - echo 'hfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -hfs_mod-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -MD -c -o $@ $< --include hfs_mod-fs_hfs.d - -CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst partmap-hfs_mod-fs_hfs.lst -COMMANDFILES += cmd-hfs_mod-fs_hfs.lst -FSFILES += fs-hfs_mod-fs_hfs.lst -PARTMAPFILES += partmap-hfs_mod-fs_hfs.lst - -cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) - -fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) - -partmap-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) - - -hfs_mod_CFLAGS = $(COMMON_CFLAGS) -hfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For jfs.mod. -jfs_mod_SOURCES = fs/jfs.c -CLEANFILES += jfs.mod mod-jfs.o mod-jfs.c pre-jfs.o jfs_mod-fs_jfs.o und-jfs.lst -ifneq ($(jfs_mod_EXPORTS),no) -CLEANFILES += def-jfs.lst -DEFSYMFILES += def-jfs.lst -endif -MOSTLYCLEANFILES += jfs_mod-fs_jfs.d -UNDSYMFILES += und-jfs.lst - -jfs.mod: pre-jfs.o mod-jfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o - -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ jfs_mod-fs_jfs.o - -mod-jfs.o: mod-jfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $< - -mod-jfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(jfs_mod_EXPORTS),no) -def-jfs.lst: pre-jfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 jfs/' > $@ -endif - -und-jfs.lst: pre-jfs.o - echo 'jfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -jfs_mod-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -MD -c -o $@ $< --include jfs_mod-fs_jfs.d - -CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst partmap-jfs_mod-fs_jfs.lst -COMMANDFILES += cmd-jfs_mod-fs_jfs.lst -FSFILES += fs-jfs_mod-fs_jfs.lst -PARTMAPFILES += partmap-jfs_mod-fs_jfs.lst - -cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) - -fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) - -partmap-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) - - -jfs_mod_CFLAGS = $(COMMON_CFLAGS) -jfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For iso9660.mod. -iso9660_mod_SOURCES = fs/iso9660.c -CLEANFILES += iso9660.mod mod-iso9660.o mod-iso9660.c pre-iso9660.o iso9660_mod-fs_iso9660.o und-iso9660.lst -ifneq ($(iso9660_mod_EXPORTS),no) -CLEANFILES += def-iso9660.lst -DEFSYMFILES += def-iso9660.lst -endif -MOSTLYCLEANFILES += iso9660_mod-fs_iso9660.d -UNDSYMFILES += und-iso9660.lst - -iso9660.mod: pre-iso9660.o mod-iso9660.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-iso9660.o mod-iso9660.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-iso9660.o: $(iso9660_mod_DEPENDENCIES) iso9660_mod-fs_iso9660.o - -rm -f $@ - $(TARGET_CC) $(iso9660_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ iso9660_mod-fs_iso9660.o - -mod-iso9660.o: mod-iso9660.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -c -o $@ $< - -mod-iso9660.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'iso9660' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(iso9660_mod_EXPORTS),no) -def-iso9660.lst: pre-iso9660.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 iso9660/' > $@ -endif - -und-iso9660.lst: pre-iso9660.o - echo 'iso9660' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -iso9660_mod-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -MD -c -o $@ $< --include iso9660_mod-fs_iso9660.d - -CLEANFILES += cmd-iso9660_mod-fs_iso9660.lst fs-iso9660_mod-fs_iso9660.lst partmap-iso9660_mod-fs_iso9660.lst -COMMANDFILES += cmd-iso9660_mod-fs_iso9660.lst -FSFILES += fs-iso9660_mod-fs_iso9660.lst -PARTMAPFILES += partmap-iso9660_mod-fs_iso9660.lst - -cmd-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh iso9660 > $@ || (rm -f $@; exit 1) - -fs-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh iso9660 > $@ || (rm -f $@; exit 1) - -partmap-iso9660_mod-fs_iso9660.lst: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(iso9660_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh iso9660 > $@ || (rm -f $@; exit 1) - - -iso9660_mod_CFLAGS = $(COMMON_CFLAGS) -iso9660_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For xfs.mod. -xfs_mod_SOURCES = fs/xfs.c -CLEANFILES += xfs.mod mod-xfs.o mod-xfs.c pre-xfs.o xfs_mod-fs_xfs.o und-xfs.lst -ifneq ($(xfs_mod_EXPORTS),no) -CLEANFILES += def-xfs.lst -DEFSYMFILES += def-xfs.lst -endif -MOSTLYCLEANFILES += xfs_mod-fs_xfs.d -UNDSYMFILES += und-xfs.lst - -xfs.mod: pre-xfs.o mod-xfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o - -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ xfs_mod-fs_xfs.o - -mod-xfs.o: mod-xfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $< - -mod-xfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(xfs_mod_EXPORTS),no) -def-xfs.lst: pre-xfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 xfs/' > $@ -endif - -und-xfs.lst: pre-xfs.o - echo 'xfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -xfs_mod-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -MD -c -o $@ $< --include xfs_mod-fs_xfs.d - -CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst partmap-xfs_mod-fs_xfs.lst -COMMANDFILES += cmd-xfs_mod-fs_xfs.lst -FSFILES += fs-xfs_mod-fs_xfs.lst -PARTMAPFILES += partmap-xfs_mod-fs_xfs.lst - -cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) - -fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) - -partmap-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) - - -xfs_mod_CFLAGS = $(COMMON_CFLAGS) -xfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For affs.mod. -affs_mod_SOURCES = fs/affs.c -CLEANFILES += affs.mod mod-affs.o mod-affs.c pre-affs.o affs_mod-fs_affs.o und-affs.lst -ifneq ($(affs_mod_EXPORTS),no) -CLEANFILES += def-affs.lst -DEFSYMFILES += def-affs.lst -endif -MOSTLYCLEANFILES += affs_mod-fs_affs.d -UNDSYMFILES += und-affs.lst - -affs.mod: pre-affs.o mod-affs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o - -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ affs_mod-fs_affs.o - -mod-affs.o: mod-affs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $< - -mod-affs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(affs_mod_EXPORTS),no) -def-affs.lst: pre-affs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 affs/' > $@ -endif - -und-affs.lst: pre-affs.o - echo 'affs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -affs_mod-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -MD -c -o $@ $< --include affs_mod-fs_affs.d - -CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst partmap-affs_mod-fs_affs.lst -COMMANDFILES += cmd-affs_mod-fs_affs.lst -FSFILES += fs-affs_mod-fs_affs.lst -PARTMAPFILES += partmap-affs_mod-fs_affs.lst - -cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) - -fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) - -partmap-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) - - -affs_mod_CFLAGS = $(COMMON_CFLAGS) -affs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sfs.mod. -sfs_mod_SOURCES = fs/sfs.c -CLEANFILES += sfs.mod mod-sfs.o mod-sfs.c pre-sfs.o sfs_mod-fs_sfs.o und-sfs.lst -ifneq ($(sfs_mod_EXPORTS),no) -CLEANFILES += def-sfs.lst -DEFSYMFILES += def-sfs.lst -endif -MOSTLYCLEANFILES += sfs_mod-fs_sfs.d -UNDSYMFILES += und-sfs.lst - -sfs.mod: pre-sfs.o mod-sfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o - -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sfs_mod-fs_sfs.o - -mod-sfs.o: mod-sfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $< - -mod-sfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(sfs_mod_EXPORTS),no) -def-sfs.lst: pre-sfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sfs/' > $@ -endif - -und-sfs.lst: pre-sfs.o - echo 'sfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -sfs_mod-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -MD -c -o $@ $< --include sfs_mod-fs_sfs.d - -CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst partmap-sfs_mod-fs_sfs.lst -COMMANDFILES += cmd-sfs_mod-fs_sfs.lst -FSFILES += fs-sfs_mod-fs_sfs.lst -PARTMAPFILES += partmap-sfs_mod-fs_sfs.lst - -cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) - -fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) - -partmap-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) - - -sfs_mod_CFLAGS = $(COMMON_CFLAGS) -sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hfsplus.mod. -hfsplus_mod_SOURCES = fs/hfsplus.c -CLEANFILES += hfsplus.mod mod-hfsplus.o mod-hfsplus.c pre-hfsplus.o hfsplus_mod-fs_hfsplus.o und-hfsplus.lst -ifneq ($(hfsplus_mod_EXPORTS),no) -CLEANFILES += def-hfsplus.lst -DEFSYMFILES += def-hfsplus.lst -endif -MOSTLYCLEANFILES += hfsplus_mod-fs_hfsplus.d -UNDSYMFILES += und-hfsplus.lst - -hfsplus.mod: pre-hfsplus.o mod-hfsplus.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hfsplus.o mod-hfsplus.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-hfsplus.o: $(hfsplus_mod_DEPENDENCIES) hfsplus_mod-fs_hfsplus.o - -rm -f $@ - $(TARGET_CC) $(hfsplus_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hfsplus_mod-fs_hfsplus.o - -mod-hfsplus.o: mod-hfsplus.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -c -o $@ $< - -mod-hfsplus.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'hfsplus' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(hfsplus_mod_EXPORTS),no) -def-hfsplus.lst: pre-hfsplus.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hfsplus/' > $@ -endif - -und-hfsplus.lst: pre-hfsplus.o - echo 'hfsplus' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -hfsplus_mod-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -MD -c -o $@ $< --include hfsplus_mod-fs_hfsplus.d - -CLEANFILES += cmd-hfsplus_mod-fs_hfsplus.lst fs-hfsplus_mod-fs_hfsplus.lst partmap-hfsplus_mod-fs_hfsplus.lst -COMMANDFILES += cmd-hfsplus_mod-fs_hfsplus.lst -FSFILES += fs-hfsplus_mod-fs_hfsplus.lst -PARTMAPFILES += partmap-hfsplus_mod-fs_hfsplus.lst - -cmd-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfsplus > $@ || (rm -f $@; exit 1) - -fs-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfsplus > $@ || (rm -f $@; exit 1) - -partmap-hfsplus_mod-fs_hfsplus.lst: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfsplus_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfsplus > $@ || (rm -f $@; exit 1) - - -hfsplus_mod_CFLAGS = $(COMMON_CFLAGS) -hfsplus_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reiserfs.mod. -reiserfs_mod_SOURCES = fs/reiserfs.c -CLEANFILES += reiserfs.mod mod-reiserfs.o mod-reiserfs.c pre-reiserfs.o reiserfs_mod-fs_reiserfs.o und-reiserfs.lst -ifneq ($(reiserfs_mod_EXPORTS),no) -CLEANFILES += def-reiserfs.lst -DEFSYMFILES += def-reiserfs.lst -endif -MOSTLYCLEANFILES += reiserfs_mod-fs_reiserfs.d -UNDSYMFILES += und-reiserfs.lst - -reiserfs.mod: pre-reiserfs.o mod-reiserfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reiserfs.o mod-reiserfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reiserfs.o: $(reiserfs_mod_DEPENDENCIES) reiserfs_mod-fs_reiserfs.o - -rm -f $@ - $(TARGET_CC) $(reiserfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reiserfs_mod-fs_reiserfs.o - -mod-reiserfs.o: mod-reiserfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -c -o $@ $< - -mod-reiserfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reiserfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reiserfs_mod_EXPORTS),no) -def-reiserfs.lst: pre-reiserfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reiserfs/' > $@ -endif - -und-reiserfs.lst: pre-reiserfs.o - echo 'reiserfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reiserfs_mod-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -MD -c -o $@ $< --include reiserfs_mod-fs_reiserfs.d - -CLEANFILES += cmd-reiserfs_mod-fs_reiserfs.lst fs-reiserfs_mod-fs_reiserfs.lst partmap-reiserfs_mod-fs_reiserfs.lst -COMMANDFILES += cmd-reiserfs_mod-fs_reiserfs.lst -FSFILES += fs-reiserfs_mod-fs_reiserfs.lst -PARTMAPFILES += partmap-reiserfs_mod-fs_reiserfs.lst - -cmd-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reiserfs > $@ || (rm -f $@; exit 1) - -fs-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reiserfs > $@ || (rm -f $@; exit 1) - -partmap-reiserfs_mod-fs_reiserfs.lst: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reiserfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reiserfs > $@ || (rm -f $@; exit 1) - - -reiserfs_mod_CFLAGS = $(COMMON_CFLAGS) -reiserfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For cpio.mod. -cpio_mod_SOURCES = fs/cpio.c -CLEANFILES += cpio.mod mod-cpio.o mod-cpio.c pre-cpio.o cpio_mod-fs_cpio.o und-cpio.lst -ifneq ($(cpio_mod_EXPORTS),no) -CLEANFILES += def-cpio.lst -DEFSYMFILES += def-cpio.lst -endif -MOSTLYCLEANFILES += cpio_mod-fs_cpio.d -UNDSYMFILES += und-cpio.lst - -cpio.mod: pre-cpio.o mod-cpio.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cpio.o mod-cpio.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpio.o: $(cpio_mod_DEPENDENCIES) cpio_mod-fs_cpio.o - -rm -f $@ - $(TARGET_CC) $(cpio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpio_mod-fs_cpio.o - -mod-cpio.o: mod-cpio.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -c -o $@ $< - -mod-cpio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpio' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpio_mod_EXPORTS),no) -def-cpio.lst: pre-cpio.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpio/' > $@ -endif - -und-cpio.lst: pre-cpio.o - echo 'cpio' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpio_mod-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -MD -c -o $@ $< --include cpio_mod-fs_cpio.d - -CLEANFILES += cmd-cpio_mod-fs_cpio.lst fs-cpio_mod-fs_cpio.lst partmap-cpio_mod-fs_cpio.lst -COMMANDFILES += cmd-cpio_mod-fs_cpio.lst -FSFILES += fs-cpio_mod-fs_cpio.lst -PARTMAPFILES += partmap-cpio_mod-fs_cpio.lst - -cmd-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpio > $@ || (rm -f $@; exit 1) - -fs-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpio > $@ || (rm -f $@; exit 1) - -partmap-cpio_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpio > $@ || (rm -f $@; exit 1) - - -cpio_mod_CFLAGS = $(COMMON_CFLAGS) -cpio_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For tar.mod. -tar_mod_SOURCES = fs/cpio.c -CLEANFILES += tar.mod mod-tar.o mod-tar.c pre-tar.o tar_mod-fs_cpio.o und-tar.lst -ifneq ($(tar_mod_EXPORTS),no) -CLEANFILES += def-tar.lst -DEFSYMFILES += def-tar.lst -endif -MOSTLYCLEANFILES += tar_mod-fs_cpio.d -UNDSYMFILES += und-tar.lst - -tar.mod: pre-tar.o mod-tar.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(tar_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-tar.o mod-tar.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-tar.o: $(tar_mod_DEPENDENCIES) tar_mod-fs_cpio.o - -rm -f $@ - $(TARGET_CC) $(tar_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ tar_mod-fs_cpio.o - -mod-tar.o: mod-tar.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -c -o $@ $< - -mod-tar.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'tar' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(tar_mod_EXPORTS),no) -def-tar.lst: pre-tar.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 tar/' > $@ -endif - -und-tar.lst: pre-tar.o - echo 'tar' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -tar_mod-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -MD -c -o $@ $< --include tar_mod-fs_cpio.d - -CLEANFILES += cmd-tar_mod-fs_cpio.lst fs-tar_mod-fs_cpio.lst partmap-tar_mod-fs_cpio.lst -COMMANDFILES += cmd-tar_mod-fs_cpio.lst -FSFILES += fs-tar_mod-fs_cpio.lst -PARTMAPFILES += partmap-tar_mod-fs_cpio.lst - -cmd-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tar > $@ || (rm -f $@; exit 1) - -fs-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tar > $@ || (rm -f $@; exit 1) - -partmap-tar_mod-fs_cpio.lst: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tar_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tar > $@ || (rm -f $@; exit 1) - - -tar_mod_CFLAGS = $(COMMON_CFLAGS) -DMODE_USTAR -tar_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For udf.mod. -udf_mod_SOURCES = fs/udf.c -CLEANFILES += udf.mod mod-udf.o mod-udf.c pre-udf.o udf_mod-fs_udf.o und-udf.lst -ifneq ($(udf_mod_EXPORTS),no) -CLEANFILES += def-udf.lst -DEFSYMFILES += def-udf.lst -endif -MOSTLYCLEANFILES += udf_mod-fs_udf.d -UNDSYMFILES += und-udf.lst - -udf.mod: pre-udf.o mod-udf.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-udf.o mod-udf.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-udf.o: $(udf_mod_DEPENDENCIES) udf_mod-fs_udf.o - -rm -f $@ - $(TARGET_CC) $(udf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ udf_mod-fs_udf.o - -mod-udf.o: mod-udf.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -c -o $@ $< - -mod-udf.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'udf' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(udf_mod_EXPORTS),no) -def-udf.lst: pre-udf.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 udf/' > $@ -endif - -und-udf.lst: pre-udf.o - echo 'udf' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -udf_mod-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -MD -c -o $@ $< --include udf_mod-fs_udf.d - -CLEANFILES += cmd-udf_mod-fs_udf.lst fs-udf_mod-fs_udf.lst partmap-udf_mod-fs_udf.lst -COMMANDFILES += cmd-udf_mod-fs_udf.lst -FSFILES += fs-udf_mod-fs_udf.lst -PARTMAPFILES += partmap-udf_mod-fs_udf.lst - -cmd-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh udf > $@ || (rm -f $@; exit 1) - -fs-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh udf > $@ || (rm -f $@; exit 1) - -partmap-udf_mod-fs_udf.lst: fs/udf.c $(fs/udf.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(udf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh udf > $@ || (rm -f $@; exit 1) - - -udf_mod_CFLAGS = $(COMMON_CFLAGS) -udf_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For afs.mod. -afs_mod_SOURCES = fs/afs.c -CLEANFILES += afs.mod mod-afs.o mod-afs.c pre-afs.o afs_mod-fs_afs.o und-afs.lst -ifneq ($(afs_mod_EXPORTS),no) -CLEANFILES += def-afs.lst -DEFSYMFILES += def-afs.lst -endif -MOSTLYCLEANFILES += afs_mod-fs_afs.d -UNDSYMFILES += und-afs.lst - -afs.mod: pre-afs.o mod-afs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-afs.o mod-afs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-afs.o: $(afs_mod_DEPENDENCIES) afs_mod-fs_afs.o - -rm -f $@ - $(TARGET_CC) $(afs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ afs_mod-fs_afs.o - -mod-afs.o: mod-afs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -c -o $@ $< - -mod-afs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'afs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(afs_mod_EXPORTS),no) -def-afs.lst: pre-afs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 afs/' > $@ -endif - -und-afs.lst: pre-afs.o - echo 'afs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -afs_mod-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -MD -c -o $@ $< --include afs_mod-fs_afs.d - -CLEANFILES += cmd-afs_mod-fs_afs.lst fs-afs_mod-fs_afs.lst partmap-afs_mod-fs_afs.lst -COMMANDFILES += cmd-afs_mod-fs_afs.lst -FSFILES += fs-afs_mod-fs_afs.lst -PARTMAPFILES += partmap-afs_mod-fs_afs.lst - -cmd-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh afs > $@ || (rm -f $@; exit 1) - -fs-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh afs > $@ || (rm -f $@; exit 1) - -partmap-afs_mod-fs_afs.lst: fs/afs.c $(fs/afs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(afs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh afs > $@ || (rm -f $@; exit 1) - - -afs_mod_CFLAGS = $(COMMON_CFLAGS) -afs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# Partition maps. -pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod - -# For amiga.mod -amiga_mod_SOURCES = partmap/amiga.c -CLEANFILES += amiga.mod mod-amiga.o mod-amiga.c pre-amiga.o amiga_mod-partmap_amiga.o und-amiga.lst -ifneq ($(amiga_mod_EXPORTS),no) -CLEANFILES += def-amiga.lst -DEFSYMFILES += def-amiga.lst -endif -MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d -UNDSYMFILES += und-amiga.lst - -amiga.mod: pre-amiga.o mod-amiga.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o - -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ amiga_mod-partmap_amiga.o - -mod-amiga.o: mod-amiga.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $< - -mod-amiga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(amiga_mod_EXPORTS),no) -def-amiga.lst: pre-amiga.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 amiga/' > $@ -endif - -und-amiga.lst: pre-amiga.o - echo 'amiga' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -amiga_mod-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -MD -c -o $@ $< --include amiga_mod-partmap_amiga.d - -CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst partmap-amiga_mod-partmap_amiga.lst -COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst -FSFILES += fs-amiga_mod-partmap_amiga.lst -PARTMAPFILES += partmap-amiga_mod-partmap_amiga.lst - -cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) - -fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) - -partmap-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) - - -amiga_mod_CFLAGS = $(COMMON_CFLAGS) -amiga_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For apple.mod -apple_mod_SOURCES = partmap/apple.c -CLEANFILES += apple.mod mod-apple.o mod-apple.c pre-apple.o apple_mod-partmap_apple.o und-apple.lst -ifneq ($(apple_mod_EXPORTS),no) -CLEANFILES += def-apple.lst -DEFSYMFILES += def-apple.lst -endif -MOSTLYCLEANFILES += apple_mod-partmap_apple.d -UNDSYMFILES += und-apple.lst - -apple.mod: pre-apple.o mod-apple.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o - -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ apple_mod-partmap_apple.o - -mod-apple.o: mod-apple.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $< - -mod-apple.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(apple_mod_EXPORTS),no) -def-apple.lst: pre-apple.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 apple/' > $@ -endif - -und-apple.lst: pre-apple.o - echo 'apple' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -apple_mod-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -MD -c -o $@ $< --include apple_mod-partmap_apple.d - -CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst partmap-apple_mod-partmap_apple.lst -COMMANDFILES += cmd-apple_mod-partmap_apple.lst -FSFILES += fs-apple_mod-partmap_apple.lst -PARTMAPFILES += partmap-apple_mod-partmap_apple.lst - -cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) - -fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) - -partmap-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) - - -apple_mod_CFLAGS = $(COMMON_CFLAGS) -apple_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pc.mod -pc_mod_SOURCES = partmap/pc.c -CLEANFILES += pc.mod mod-pc.o mod-pc.c pre-pc.o pc_mod-partmap_pc.o und-pc.lst -ifneq ($(pc_mod_EXPORTS),no) -CLEANFILES += def-pc.lst -DEFSYMFILES += def-pc.lst -endif -MOSTLYCLEANFILES += pc_mod-partmap_pc.d -UNDSYMFILES += und-pc.lst - -pc.mod: pre-pc.o mod-pc.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o - -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pc_mod-partmap_pc.o - -mod-pc.o: mod-pc.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $< - -mod-pc.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pc_mod_EXPORTS),no) -def-pc.lst: pre-pc.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pc/' > $@ -endif - -und-pc.lst: pre-pc.o - echo 'pc' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pc_mod-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -MD -c -o $@ $< --include pc_mod-partmap_pc.d - -CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst partmap-pc_mod-partmap_pc.lst -COMMANDFILES += cmd-pc_mod-partmap_pc.lst -FSFILES += fs-pc_mod-partmap_pc.lst -PARTMAPFILES += partmap-pc_mod-partmap_pc.lst - -cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) - -fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) - -partmap-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) - - -pc_mod_CFLAGS = $(COMMON_CFLAGS) -pc_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sun.mod -sun_mod_SOURCES = partmap/sun.c -CLEANFILES += sun.mod mod-sun.o mod-sun.c pre-sun.o sun_mod-partmap_sun.o und-sun.lst -ifneq ($(sun_mod_EXPORTS),no) -CLEANFILES += def-sun.lst -DEFSYMFILES += def-sun.lst -endif -MOSTLYCLEANFILES += sun_mod-partmap_sun.d -UNDSYMFILES += und-sun.lst - -sun.mod: pre-sun.o mod-sun.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o - -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sun_mod-partmap_sun.o - -mod-sun.o: mod-sun.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $< - -mod-sun.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(sun_mod_EXPORTS),no) -def-sun.lst: pre-sun.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sun/' > $@ -endif - -und-sun.lst: pre-sun.o - echo 'sun' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -sun_mod-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -MD -c -o $@ $< --include sun_mod-partmap_sun.d - -CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst partmap-sun_mod-partmap_sun.lst -COMMANDFILES += cmd-sun_mod-partmap_sun.lst -FSFILES += fs-sun_mod-partmap_sun.lst -PARTMAPFILES += partmap-sun_mod-partmap_sun.lst - -cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) - -fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) - -partmap-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) - - -sun_mod_CFLAGS = $(COMMON_CFLAGS) -sun_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For acorn.mod -acorn_mod_SOURCES = partmap/acorn.c -CLEANFILES += acorn.mod mod-acorn.o mod-acorn.c pre-acorn.o acorn_mod-partmap_acorn.o und-acorn.lst -ifneq ($(acorn_mod_EXPORTS),no) -CLEANFILES += def-acorn.lst -DEFSYMFILES += def-acorn.lst -endif -MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d -UNDSYMFILES += und-acorn.lst - -acorn.mod: pre-acorn.o mod-acorn.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o - -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ acorn_mod-partmap_acorn.o - -mod-acorn.o: mod-acorn.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $< - -mod-acorn.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(acorn_mod_EXPORTS),no) -def-acorn.lst: pre-acorn.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 acorn/' > $@ -endif - -und-acorn.lst: pre-acorn.o - echo 'acorn' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -acorn_mod-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -MD -c -o $@ $< --include acorn_mod-partmap_acorn.d - -CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst partmap-acorn_mod-partmap_acorn.lst -COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst -FSFILES += fs-acorn_mod-partmap_acorn.lst -PARTMAPFILES += partmap-acorn_mod-partmap_acorn.lst - -cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) - -fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) - -partmap-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) - - -acorn_mod_CFLAGS = $(COMMON_CFLAGS) -acorn_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For gpt.mod -gpt_mod_SOURCES = partmap/gpt.c -CLEANFILES += gpt.mod mod-gpt.o mod-gpt.c pre-gpt.o gpt_mod-partmap_gpt.o und-gpt.lst -ifneq ($(gpt_mod_EXPORTS),no) -CLEANFILES += def-gpt.lst -DEFSYMFILES += def-gpt.lst -endif -MOSTLYCLEANFILES += gpt_mod-partmap_gpt.d -UNDSYMFILES += und-gpt.lst - -gpt.mod: pre-gpt.o mod-gpt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gpt.o mod-gpt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-gpt.o: $(gpt_mod_DEPENDENCIES) gpt_mod-partmap_gpt.o - -rm -f $@ - $(TARGET_CC) $(gpt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gpt_mod-partmap_gpt.o - -mod-gpt.o: mod-gpt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -c -o $@ $< - -mod-gpt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'gpt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(gpt_mod_EXPORTS),no) -def-gpt.lst: pre-gpt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gpt/' > $@ -endif - -und-gpt.lst: pre-gpt.o - echo 'gpt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -gpt_mod-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -MD -c -o $@ $< --include gpt_mod-partmap_gpt.d - -CLEANFILES += cmd-gpt_mod-partmap_gpt.lst fs-gpt_mod-partmap_gpt.lst partmap-gpt_mod-partmap_gpt.lst -COMMANDFILES += cmd-gpt_mod-partmap_gpt.lst -FSFILES += fs-gpt_mod-partmap_gpt.lst -PARTMAPFILES += partmap-gpt_mod-partmap_gpt.lst - -cmd-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gpt > $@ || (rm -f $@; exit 1) - -fs-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gpt > $@ || (rm -f $@; exit 1) - -partmap-gpt_mod-partmap_gpt.lst: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gpt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gpt > $@ || (rm -f $@; exit 1) - - -gpt_mod_CFLAGS = $(COMMON_CFLAGS) -gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# Special disk structures and generic drivers - -pkglib_MODULES += raid.mod raid5rec.mod raid6rec.mod mdraid.mod dm_nv.mod \ - lvm.mod scsi.mod - -# For raid.mod -raid_mod_SOURCES = disk/raid.c -CLEANFILES += raid.mod mod-raid.o mod-raid.c pre-raid.o raid_mod-disk_raid.o und-raid.lst -ifneq ($(raid_mod_EXPORTS),no) -CLEANFILES += def-raid.lst -DEFSYMFILES += def-raid.lst -endif -MOSTLYCLEANFILES += raid_mod-disk_raid.d -UNDSYMFILES += und-raid.lst - -raid.mod: pre-raid.o mod-raid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-raid.o mod-raid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-raid.o: $(raid_mod_DEPENDENCIES) raid_mod-disk_raid.o - -rm -f $@ - $(TARGET_CC) $(raid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ raid_mod-disk_raid.o - -mod-raid.o: mod-raid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -c -o $@ $< - -mod-raid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'raid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(raid_mod_EXPORTS),no) -def-raid.lst: pre-raid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 raid/' > $@ -endif - -und-raid.lst: pre-raid.o - echo 'raid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -raid_mod-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -MD -c -o $@ $< --include raid_mod-disk_raid.d - -CLEANFILES += cmd-raid_mod-disk_raid.lst fs-raid_mod-disk_raid.lst partmap-raid_mod-disk_raid.lst -COMMANDFILES += cmd-raid_mod-disk_raid.lst -FSFILES += fs-raid_mod-disk_raid.lst -PARTMAPFILES += partmap-raid_mod-disk_raid.lst - -cmd-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid > $@ || (rm -f $@; exit 1) - -fs-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid > $@ || (rm -f $@; exit 1) - -partmap-raid_mod-disk_raid.lst: disk/raid.c $(disk/raid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid > $@ || (rm -f $@; exit 1) - - -raid_mod_CFLAGS = $(COMMON_CFLAGS) -raid_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For raid5rec.mod -raid5rec_mod_SOURCES = disk/raid5_recover.c -CLEANFILES += raid5rec.mod mod-raid5rec.o mod-raid5rec.c pre-raid5rec.o raid5rec_mod-disk_raid5_recover.o und-raid5rec.lst -ifneq ($(raid5rec_mod_EXPORTS),no) -CLEANFILES += def-raid5rec.lst -DEFSYMFILES += def-raid5rec.lst -endif -MOSTLYCLEANFILES += raid5rec_mod-disk_raid5_recover.d -UNDSYMFILES += und-raid5rec.lst - -raid5rec.mod: pre-raid5rec.o mod-raid5rec.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(raid5rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-raid5rec.o mod-raid5rec.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-raid5rec.o: $(raid5rec_mod_DEPENDENCIES) raid5rec_mod-disk_raid5_recover.o - -rm -f $@ - $(TARGET_CC) $(raid5rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ raid5rec_mod-disk_raid5_recover.o - -mod-raid5rec.o: mod-raid5rec.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -c -o $@ $< - -mod-raid5rec.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'raid5rec' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(raid5rec_mod_EXPORTS),no) -def-raid5rec.lst: pre-raid5rec.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 raid5rec/' > $@ -endif - -und-raid5rec.lst: pre-raid5rec.o - echo 'raid5rec' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -raid5rec_mod-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -MD -c -o $@ $< --include raid5rec_mod-disk_raid5_recover.d - -CLEANFILES += cmd-raid5rec_mod-disk_raid5_recover.lst fs-raid5rec_mod-disk_raid5_recover.lst partmap-raid5rec_mod-disk_raid5_recover.lst -COMMANDFILES += cmd-raid5rec_mod-disk_raid5_recover.lst -FSFILES += fs-raid5rec_mod-disk_raid5_recover.lst -PARTMAPFILES += partmap-raid5rec_mod-disk_raid5_recover.lst - -cmd-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid5rec > $@ || (rm -f $@; exit 1) - -fs-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid5rec > $@ || (rm -f $@; exit 1) - -partmap-raid5rec_mod-disk_raid5_recover.lst: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid5rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid5rec > $@ || (rm -f $@; exit 1) - - -raid5rec_mod_CFLAGS = $(COMMON_CFLAGS) -raid5rec_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For raid6rec.mod -raid6rec_mod_SOURCES = disk/raid6_recover.c -CLEANFILES += raid6rec.mod mod-raid6rec.o mod-raid6rec.c pre-raid6rec.o raid6rec_mod-disk_raid6_recover.o und-raid6rec.lst -ifneq ($(raid6rec_mod_EXPORTS),no) -CLEANFILES += def-raid6rec.lst -DEFSYMFILES += def-raid6rec.lst -endif -MOSTLYCLEANFILES += raid6rec_mod-disk_raid6_recover.d -UNDSYMFILES += und-raid6rec.lst - -raid6rec.mod: pre-raid6rec.o mod-raid6rec.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(raid6rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-raid6rec.o mod-raid6rec.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-raid6rec.o: $(raid6rec_mod_DEPENDENCIES) raid6rec_mod-disk_raid6_recover.o - -rm -f $@ - $(TARGET_CC) $(raid6rec_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ raid6rec_mod-disk_raid6_recover.o - -mod-raid6rec.o: mod-raid6rec.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -c -o $@ $< - -mod-raid6rec.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'raid6rec' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(raid6rec_mod_EXPORTS),no) -def-raid6rec.lst: pre-raid6rec.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 raid6rec/' > $@ -endif - -und-raid6rec.lst: pre-raid6rec.o - echo 'raid6rec' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -raid6rec_mod-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -MD -c -o $@ $< --include raid6rec_mod-disk_raid6_recover.d - -CLEANFILES += cmd-raid6rec_mod-disk_raid6_recover.lst fs-raid6rec_mod-disk_raid6_recover.lst partmap-raid6rec_mod-disk_raid6_recover.lst -COMMANDFILES += cmd-raid6rec_mod-disk_raid6_recover.lst -FSFILES += fs-raid6rec_mod-disk_raid6_recover.lst -PARTMAPFILES += partmap-raid6rec_mod-disk_raid6_recover.lst - -cmd-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh raid6rec > $@ || (rm -f $@; exit 1) - -fs-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh raid6rec > $@ || (rm -f $@; exit 1) - -partmap-raid6rec_mod-disk_raid6_recover.lst: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(raid6rec_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh raid6rec > $@ || (rm -f $@; exit 1) - - -raid6rec_mod_CFLAGS = $(COMMON_CFLAGS) -raid6rec_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For mdraid.mod -mdraid_mod_SOURCES = disk/mdraid_linux.c -CLEANFILES += mdraid.mod mod-mdraid.o mod-mdraid.c pre-mdraid.o mdraid_mod-disk_mdraid_linux.o und-mdraid.lst -ifneq ($(mdraid_mod_EXPORTS),no) -CLEANFILES += def-mdraid.lst -DEFSYMFILES += def-mdraid.lst -endif -MOSTLYCLEANFILES += mdraid_mod-disk_mdraid_linux.d -UNDSYMFILES += und-mdraid.lst - -mdraid.mod: pre-mdraid.o mod-mdraid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(mdraid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-mdraid.o mod-mdraid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-mdraid.o: $(mdraid_mod_DEPENDENCIES) mdraid_mod-disk_mdraid_linux.o - -rm -f $@ - $(TARGET_CC) $(mdraid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ mdraid_mod-disk_mdraid_linux.o - -mod-mdraid.o: mod-mdraid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -c -o $@ $< - -mod-mdraid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'mdraid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(mdraid_mod_EXPORTS),no) -def-mdraid.lst: pre-mdraid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 mdraid/' > $@ -endif - -und-mdraid.lst: pre-mdraid.o - echo 'mdraid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -mdraid_mod-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -MD -c -o $@ $< --include mdraid_mod-disk_mdraid_linux.d - -CLEANFILES += cmd-mdraid_mod-disk_mdraid_linux.lst fs-mdraid_mod-disk_mdraid_linux.lst partmap-mdraid_mod-disk_mdraid_linux.lst -COMMANDFILES += cmd-mdraid_mod-disk_mdraid_linux.lst -FSFILES += fs-mdraid_mod-disk_mdraid_linux.lst -PARTMAPFILES += partmap-mdraid_mod-disk_mdraid_linux.lst - -cmd-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh mdraid > $@ || (rm -f $@; exit 1) - -fs-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh mdraid > $@ || (rm -f $@; exit 1) - -partmap-mdraid_mod-disk_mdraid_linux.lst: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(mdraid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh mdraid > $@ || (rm -f $@; exit 1) - - -mdraid_mod_CFLAGS = $(COMMON_CFLAGS) -mdraid_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For dm_nv.mod -dm_nv_mod_SOURCES = disk/dmraid_nvidia.c -CLEANFILES += dm_nv.mod mod-dm_nv.o mod-dm_nv.c pre-dm_nv.o dm_nv_mod-disk_dmraid_nvidia.o und-dm_nv.lst -ifneq ($(dm_nv_mod_EXPORTS),no) -CLEANFILES += def-dm_nv.lst -DEFSYMFILES += def-dm_nv.lst -endif -MOSTLYCLEANFILES += dm_nv_mod-disk_dmraid_nvidia.d -UNDSYMFILES += und-dm_nv.lst - -dm_nv.mod: pre-dm_nv.o mod-dm_nv.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(dm_nv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-dm_nv.o mod-dm_nv.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-dm_nv.o: $(dm_nv_mod_DEPENDENCIES) dm_nv_mod-disk_dmraid_nvidia.o - -rm -f $@ - $(TARGET_CC) $(dm_nv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ dm_nv_mod-disk_dmraid_nvidia.o - -mod-dm_nv.o: mod-dm_nv.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -c -o $@ $< - -mod-dm_nv.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'dm_nv' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(dm_nv_mod_EXPORTS),no) -def-dm_nv.lst: pre-dm_nv.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 dm_nv/' > $@ -endif - -und-dm_nv.lst: pre-dm_nv.o - echo 'dm_nv' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -dm_nv_mod-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -MD -c -o $@ $< --include dm_nv_mod-disk_dmraid_nvidia.d - -CLEANFILES += cmd-dm_nv_mod-disk_dmraid_nvidia.lst fs-dm_nv_mod-disk_dmraid_nvidia.lst partmap-dm_nv_mod-disk_dmraid_nvidia.lst -COMMANDFILES += cmd-dm_nv_mod-disk_dmraid_nvidia.lst -FSFILES += fs-dm_nv_mod-disk_dmraid_nvidia.lst -PARTMAPFILES += partmap-dm_nv_mod-disk_dmraid_nvidia.lst - -cmd-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh dm_nv > $@ || (rm -f $@; exit 1) - -fs-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh dm_nv > $@ || (rm -f $@; exit 1) - -partmap-dm_nv_mod-disk_dmraid_nvidia.lst: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(dm_nv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh dm_nv > $@ || (rm -f $@; exit 1) - - -dm_nv_mod_CFLAGS = $(COMMON_CFLAGS) -dm_nv_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lvm.mod -lvm_mod_SOURCES = disk/lvm.c -CLEANFILES += lvm.mod mod-lvm.o mod-lvm.c pre-lvm.o lvm_mod-disk_lvm.o und-lvm.lst -ifneq ($(lvm_mod_EXPORTS),no) -CLEANFILES += def-lvm.lst -DEFSYMFILES += def-lvm.lst -endif -MOSTLYCLEANFILES += lvm_mod-disk_lvm.d -UNDSYMFILES += und-lvm.lst - -lvm.mod: pre-lvm.o mod-lvm.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lvm.o mod-lvm.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lvm.o: $(lvm_mod_DEPENDENCIES) lvm_mod-disk_lvm.o - -rm -f $@ - $(TARGET_CC) $(lvm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lvm_mod-disk_lvm.o - -mod-lvm.o: mod-lvm.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -c -o $@ $< - -mod-lvm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lvm' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lvm_mod_EXPORTS),no) -def-lvm.lst: pre-lvm.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lvm/' > $@ -endif - -und-lvm.lst: pre-lvm.o - echo 'lvm' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lvm_mod-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -MD -c -o $@ $< --include lvm_mod-disk_lvm.d - -CLEANFILES += cmd-lvm_mod-disk_lvm.lst fs-lvm_mod-disk_lvm.lst partmap-lvm_mod-disk_lvm.lst -COMMANDFILES += cmd-lvm_mod-disk_lvm.lst -FSFILES += fs-lvm_mod-disk_lvm.lst -PARTMAPFILES += partmap-lvm_mod-disk_lvm.lst - -cmd-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lvm > $@ || (rm -f $@; exit 1) - -fs-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lvm > $@ || (rm -f $@; exit 1) - -partmap-lvm_mod-disk_lvm.lst: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lvm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lvm > $@ || (rm -f $@; exit 1) - - -lvm_mod_CFLAGS = $(COMMON_CFLAGS) -lvm_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For scsi.mod -scsi_mod_SOURCES = disk/scsi.c -CLEANFILES += scsi.mod mod-scsi.o mod-scsi.c pre-scsi.o scsi_mod-disk_scsi.o und-scsi.lst -ifneq ($(scsi_mod_EXPORTS),no) -CLEANFILES += def-scsi.lst -DEFSYMFILES += def-scsi.lst -endif -MOSTLYCLEANFILES += scsi_mod-disk_scsi.d -UNDSYMFILES += und-scsi.lst - -scsi.mod: pre-scsi.o mod-scsi.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(scsi_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-scsi.o mod-scsi.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-scsi.o: $(scsi_mod_DEPENDENCIES) scsi_mod-disk_scsi.o - -rm -f $@ - $(TARGET_CC) $(scsi_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ scsi_mod-disk_scsi.o - -mod-scsi.o: mod-scsi.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -c -o $@ $< - -mod-scsi.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'scsi' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(scsi_mod_EXPORTS),no) -def-scsi.lst: pre-scsi.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 scsi/' > $@ -endif - -und-scsi.lst: pre-scsi.o - echo 'scsi' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -scsi_mod-disk_scsi.o: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -MD -c -o $@ $< --include scsi_mod-disk_scsi.d - -CLEANFILES += cmd-scsi_mod-disk_scsi.lst fs-scsi_mod-disk_scsi.lst partmap-scsi_mod-disk_scsi.lst -COMMANDFILES += cmd-scsi_mod-disk_scsi.lst -FSFILES += fs-scsi_mod-disk_scsi.lst -PARTMAPFILES += partmap-scsi_mod-disk_scsi.lst - -cmd-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh scsi > $@ || (rm -f $@; exit 1) - -fs-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh scsi > $@ || (rm -f $@; exit 1) - -partmap-scsi_mod-disk_scsi.lst: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(scsi_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh scsi > $@ || (rm -f $@; exit 1) - - -scsi_mod_CFLAGS = $(COMMON_CFLAGS) -scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# Commands. -pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ - ls.mod cmp.mod cat.mod help.mod search.mod \ - loopback.mod fs_uuid.mod configfile.mod echo.mod \ - terminfo.mod test.mod blocklist.mod hexdump.mod \ - read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - pcpart.mod memrw.mod - -# For minicmd.mod. -minicmd_mod_SOURCES = commands/minicmd.c -CLEANFILES += minicmd.mod mod-minicmd.o mod-minicmd.c pre-minicmd.o minicmd_mod-commands_minicmd.o und-minicmd.lst -ifneq ($(minicmd_mod_EXPORTS),no) -CLEANFILES += def-minicmd.lst -DEFSYMFILES += def-minicmd.lst -endif -MOSTLYCLEANFILES += minicmd_mod-commands_minicmd.d -UNDSYMFILES += und-minicmd.lst - -minicmd.mod: pre-minicmd.o mod-minicmd.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(minicmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-minicmd.o mod-minicmd.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-minicmd.o: $(minicmd_mod_DEPENDENCIES) minicmd_mod-commands_minicmd.o - -rm -f $@ - $(TARGET_CC) $(minicmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ minicmd_mod-commands_minicmd.o - -mod-minicmd.o: mod-minicmd.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -c -o $@ $< - -mod-minicmd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'minicmd' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(minicmd_mod_EXPORTS),no) -def-minicmd.lst: pre-minicmd.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 minicmd/' > $@ -endif - -und-minicmd.lst: pre-minicmd.o - echo 'minicmd' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -minicmd_mod-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -MD -c -o $@ $< --include minicmd_mod-commands_minicmd.d - -CLEANFILES += cmd-minicmd_mod-commands_minicmd.lst fs-minicmd_mod-commands_minicmd.lst partmap-minicmd_mod-commands_minicmd.lst -COMMANDFILES += cmd-minicmd_mod-commands_minicmd.lst -FSFILES += fs-minicmd_mod-commands_minicmd.lst -PARTMAPFILES += partmap-minicmd_mod-commands_minicmd.lst - -cmd-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minicmd > $@ || (rm -f $@; exit 1) - -fs-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minicmd > $@ || (rm -f $@; exit 1) - -partmap-minicmd_mod-commands_minicmd.lst: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minicmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minicmd > $@ || (rm -f $@; exit 1) - - -minicmd_mod_CFLAGS = $(COMMON_CFLAGS) -minicmd_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For extcmd.mod. -extcmd_mod_SOURCES = commands/extcmd.c lib/arg.c -CLEANFILES += extcmd.mod mod-extcmd.o mod-extcmd.c pre-extcmd.o extcmd_mod-commands_extcmd.o extcmd_mod-lib_arg.o und-extcmd.lst -ifneq ($(extcmd_mod_EXPORTS),no) -CLEANFILES += def-extcmd.lst -DEFSYMFILES += def-extcmd.lst -endif -MOSTLYCLEANFILES += extcmd_mod-commands_extcmd.d extcmd_mod-lib_arg.d -UNDSYMFILES += und-extcmd.lst - -extcmd.mod: pre-extcmd.o mod-extcmd.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(extcmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-extcmd.o mod-extcmd.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-extcmd.o: $(extcmd_mod_DEPENDENCIES) extcmd_mod-commands_extcmd.o extcmd_mod-lib_arg.o - -rm -f $@ - $(TARGET_CC) $(extcmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ extcmd_mod-commands_extcmd.o extcmd_mod-lib_arg.o - -mod-extcmd.o: mod-extcmd.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -c -o $@ $< - -mod-extcmd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'extcmd' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(extcmd_mod_EXPORTS),no) -def-extcmd.lst: pre-extcmd.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 extcmd/' > $@ -endif - -und-extcmd.lst: pre-extcmd.o - echo 'extcmd' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -extcmd_mod-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -MD -c -o $@ $< --include extcmd_mod-commands_extcmd.d - -CLEANFILES += cmd-extcmd_mod-commands_extcmd.lst fs-extcmd_mod-commands_extcmd.lst partmap-extcmd_mod-commands_extcmd.lst -COMMANDFILES += cmd-extcmd_mod-commands_extcmd.lst -FSFILES += fs-extcmd_mod-commands_extcmd.lst -PARTMAPFILES += partmap-extcmd_mod-commands_extcmd.lst - -cmd-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) - -fs-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) - -partmap-extcmd_mod-commands_extcmd.lst: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) - - -extcmd_mod-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -MD -c -o $@ $< --include extcmd_mod-lib_arg.d - -CLEANFILES += cmd-extcmd_mod-lib_arg.lst fs-extcmd_mod-lib_arg.lst partmap-extcmd_mod-lib_arg.lst -COMMANDFILES += cmd-extcmd_mod-lib_arg.lst -FSFILES += fs-extcmd_mod-lib_arg.lst -PARTMAPFILES += partmap-extcmd_mod-lib_arg.lst - -cmd-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh extcmd > $@ || (rm -f $@; exit 1) - -fs-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh extcmd > $@ || (rm -f $@; exit 1) - -partmap-extcmd_mod-lib_arg.lst: lib/arg.c $(lib/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(extcmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh extcmd > $@ || (rm -f $@; exit 1) - - -extcmd_mod_CFLAGS = $(COMMON_CFLAGS) -extcmd_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hello.mod. -hello_mod_SOURCES = hello/hello.c -CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o und-hello.lst -ifneq ($(hello_mod_EXPORTS),no) -CLEANFILES += def-hello.lst -DEFSYMFILES += def-hello.lst -endif -MOSTLYCLEANFILES += hello_mod-hello_hello.d -UNDSYMFILES += und-hello.lst - -hello.mod: pre-hello.o mod-hello.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o - -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hello_mod-hello_hello.o - -mod-hello.o: mod-hello.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $< - -mod-hello.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(hello_mod_EXPORTS),no) -def-hello.lst: pre-hello.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hello/' > $@ -endif - -und-hello.lst: pre-hello.o - echo 'hello' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -hello_mod-hello_hello.o: hello/hello.c $(hello/hello.c_DEPENDENCIES) - $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -MD -c -o $@ $< --include hello_mod-hello_hello.d - -CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst partmap-hello_mod-hello_hello.lst -COMMANDFILES += cmd-hello_mod-hello_hello.lst -FSFILES += fs-hello_mod-hello_hello.lst -PARTMAPFILES += partmap-hello_mod-hello_hello.lst - -cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) - -fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) - -partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) - - -hello_mod_CFLAGS = $(COMMON_CFLAGS) -hello_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For parttool.mod. -parttool_mod_SOURCES = commands/parttool.c -CLEANFILES += parttool.mod mod-parttool.o mod-parttool.c pre-parttool.o parttool_mod-commands_parttool.o und-parttool.lst -ifneq ($(parttool_mod_EXPORTS),no) -CLEANFILES += def-parttool.lst -DEFSYMFILES += def-parttool.lst -endif -MOSTLYCLEANFILES += parttool_mod-commands_parttool.d -UNDSYMFILES += und-parttool.lst - -parttool.mod: pre-parttool.o mod-parttool.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(parttool_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-parttool.o mod-parttool.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-parttool.o: $(parttool_mod_DEPENDENCIES) parttool_mod-commands_parttool.o - -rm -f $@ - $(TARGET_CC) $(parttool_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ parttool_mod-commands_parttool.o - -mod-parttool.o: mod-parttool.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -c -o $@ $< - -mod-parttool.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'parttool' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(parttool_mod_EXPORTS),no) -def-parttool.lst: pre-parttool.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 parttool/' > $@ -endif - -und-parttool.lst: pre-parttool.o - echo 'parttool' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -parttool_mod-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -MD -c -o $@ $< --include parttool_mod-commands_parttool.d - -CLEANFILES += cmd-parttool_mod-commands_parttool.lst fs-parttool_mod-commands_parttool.lst partmap-parttool_mod-commands_parttool.lst -COMMANDFILES += cmd-parttool_mod-commands_parttool.lst -FSFILES += fs-parttool_mod-commands_parttool.lst -PARTMAPFILES += partmap-parttool_mod-commands_parttool.lst - -cmd-parttool_mod-commands_parttool.lst: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh parttool > $@ || (rm -f $@; exit 1) - -fs-parttool_mod-commands_parttool.lst: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh parttool > $@ || (rm -f $@; exit 1) - -partmap-parttool_mod-commands_parttool.lst: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(parttool_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh parttool > $@ || (rm -f $@; exit 1) - - -parttool_mod_CFLAGS = $(COMMON_CFLAGS) -parttool_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pcpart.mod. -pcpart_mod_SOURCES = parttool/pcpart.c -CLEANFILES += pcpart.mod mod-pcpart.o mod-pcpart.c pre-pcpart.o pcpart_mod-parttool_pcpart.o und-pcpart.lst -ifneq ($(pcpart_mod_EXPORTS),no) -CLEANFILES += def-pcpart.lst -DEFSYMFILES += def-pcpart.lst -endif -MOSTLYCLEANFILES += pcpart_mod-parttool_pcpart.d -UNDSYMFILES += und-pcpart.lst - -pcpart.mod: pre-pcpart.o mod-pcpart.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pcpart_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pcpart.o mod-pcpart.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pcpart.o: $(pcpart_mod_DEPENDENCIES) pcpart_mod-parttool_pcpart.o - -rm -f $@ - $(TARGET_CC) $(pcpart_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pcpart_mod-parttool_pcpart.o - -mod-pcpart.o: mod-pcpart.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -c -o $@ $< - -mod-pcpart.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pcpart' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pcpart_mod_EXPORTS),no) -def-pcpart.lst: pre-pcpart.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pcpart/' > $@ -endif - -und-pcpart.lst: pre-pcpart.o - echo 'pcpart' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pcpart_mod-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) - $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -MD -c -o $@ $< --include pcpart_mod-parttool_pcpart.d - -CLEANFILES += cmd-pcpart_mod-parttool_pcpart.lst fs-pcpart_mod-parttool_pcpart.lst partmap-pcpart_mod-parttool_pcpart.lst -COMMANDFILES += cmd-pcpart_mod-parttool_pcpart.lst -FSFILES += fs-pcpart_mod-parttool_pcpart.lst -PARTMAPFILES += partmap-pcpart_mod-parttool_pcpart.lst - -cmd-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pcpart > $@ || (rm -f $@; exit 1) - -fs-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pcpart > $@ || (rm -f $@; exit 1) - -partmap-pcpart_mod-parttool_pcpart.lst: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iparttool -I$(srcdir)/parttool $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pcpart_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pcpart > $@ || (rm -f $@; exit 1) - - -pcpart_mod_CFLAGS = $(COMMON_CFLAGS) -pcpart_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For handler.mod. -handler_mod_SOURCES = commands/handler.c -CLEANFILES += handler.mod mod-handler.o mod-handler.c pre-handler.o handler_mod-commands_handler.o und-handler.lst -ifneq ($(handler_mod_EXPORTS),no) -CLEANFILES += def-handler.lst -DEFSYMFILES += def-handler.lst -endif -MOSTLYCLEANFILES += handler_mod-commands_handler.d -UNDSYMFILES += und-handler.lst - -handler.mod: pre-handler.o mod-handler.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(handler_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-handler.o mod-handler.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-handler.o: $(handler_mod_DEPENDENCIES) handler_mod-commands_handler.o - -rm -f $@ - $(TARGET_CC) $(handler_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ handler_mod-commands_handler.o - -mod-handler.o: mod-handler.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -c -o $@ $< - -mod-handler.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'handler' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(handler_mod_EXPORTS),no) -def-handler.lst: pre-handler.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 handler/' > $@ -endif - -und-handler.lst: pre-handler.o - echo 'handler' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -handler_mod-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -MD -c -o $@ $< --include handler_mod-commands_handler.d - -CLEANFILES += cmd-handler_mod-commands_handler.lst fs-handler_mod-commands_handler.lst partmap-handler_mod-commands_handler.lst -COMMANDFILES += cmd-handler_mod-commands_handler.lst -FSFILES += fs-handler_mod-commands_handler.lst -PARTMAPFILES += partmap-handler_mod-commands_handler.lst - -cmd-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh handler > $@ || (rm -f $@; exit 1) - -fs-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh handler > $@ || (rm -f $@; exit 1) - -partmap-handler_mod-commands_handler.lst: commands/handler.c $(commands/handler.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(handler_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh handler > $@ || (rm -f $@; exit 1) - - -handler_mod_CFLAGS = $(COMMON_CFLAGS) -handler_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ls.mod. -ls_mod_SOURCES = commands/ls.c -CLEANFILES += ls.mod mod-ls.o mod-ls.c pre-ls.o ls_mod-commands_ls.o und-ls.lst -ifneq ($(ls_mod_EXPORTS),no) -CLEANFILES += def-ls.lst -DEFSYMFILES += def-ls.lst -endif -MOSTLYCLEANFILES += ls_mod-commands_ls.d -UNDSYMFILES += und-ls.lst - -ls.mod: pre-ls.o mod-ls.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o - -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ls_mod-commands_ls.o - -mod-ls.o: mod-ls.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $< - -mod-ls.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ls_mod_EXPORTS),no) -def-ls.lst: pre-ls.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ls/' > $@ -endif - -und-ls.lst: pre-ls.o - echo 'ls' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ls_mod-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -MD -c -o $@ $< --include ls_mod-commands_ls.d - -CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst partmap-ls_mod-commands_ls.lst -COMMANDFILES += cmd-ls_mod-commands_ls.lst -FSFILES += fs-ls_mod-commands_ls.lst -PARTMAPFILES += partmap-ls_mod-commands_ls.lst - -cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) - -fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) - -partmap-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) - - -ls_mod_CFLAGS = $(COMMON_CFLAGS) -ls_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For cmp.mod. -cmp_mod_SOURCES = commands/cmp.c -CLEANFILES += cmp.mod mod-cmp.o mod-cmp.c pre-cmp.o cmp_mod-commands_cmp.o und-cmp.lst -ifneq ($(cmp_mod_EXPORTS),no) -CLEANFILES += def-cmp.lst -DEFSYMFILES += def-cmp.lst -endif -MOSTLYCLEANFILES += cmp_mod-commands_cmp.d -UNDSYMFILES += und-cmp.lst - -cmp.mod: pre-cmp.o mod-cmp.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o - -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cmp_mod-commands_cmp.o - -mod-cmp.o: mod-cmp.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $< - -mod-cmp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cmp_mod_EXPORTS),no) -def-cmp.lst: pre-cmp.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cmp/' > $@ -endif - -und-cmp.lst: pre-cmp.o - echo 'cmp' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cmp_mod-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -MD -c -o $@ $< --include cmp_mod-commands_cmp.d - -CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst partmap-cmp_mod-commands_cmp.lst -COMMANDFILES += cmd-cmp_mod-commands_cmp.lst -FSFILES += fs-cmp_mod-commands_cmp.lst -PARTMAPFILES += partmap-cmp_mod-commands_cmp.lst - -cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) - -fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) - -partmap-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) - - -cmp_mod_CFLAGS = $(COMMON_CFLAGS) -cmp_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For cat.mod. -cat_mod_SOURCES = commands/cat.c -CLEANFILES += cat.mod mod-cat.o mod-cat.c pre-cat.o cat_mod-commands_cat.o und-cat.lst -ifneq ($(cat_mod_EXPORTS),no) -CLEANFILES += def-cat.lst -DEFSYMFILES += def-cat.lst -endif -MOSTLYCLEANFILES += cat_mod-commands_cat.d -UNDSYMFILES += und-cat.lst - -cat.mod: pre-cat.o mod-cat.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o - -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cat_mod-commands_cat.o - -mod-cat.o: mod-cat.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $< - -mod-cat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cat_mod_EXPORTS),no) -def-cat.lst: pre-cat.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cat/' > $@ -endif - -und-cat.lst: pre-cat.o - echo 'cat' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cat_mod-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -MD -c -o $@ $< --include cat_mod-commands_cat.d - -CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst partmap-cat_mod-commands_cat.lst -COMMANDFILES += cmd-cat_mod-commands_cat.lst -FSFILES += fs-cat_mod-commands_cat.lst -PARTMAPFILES += partmap-cat_mod-commands_cat.lst - -cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) - -fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) - -partmap-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) - - -cat_mod_CFLAGS = $(COMMON_CFLAGS) -cat_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For echo.mod -echo_mod_SOURCES = commands/echo.c -CLEANFILES += echo.mod mod-echo.o mod-echo.c pre-echo.o echo_mod-commands_echo.o und-echo.lst -ifneq ($(echo_mod_EXPORTS),no) -CLEANFILES += def-echo.lst -DEFSYMFILES += def-echo.lst -endif -MOSTLYCLEANFILES += echo_mod-commands_echo.d -UNDSYMFILES += und-echo.lst - -echo.mod: pre-echo.o mod-echo.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-echo.o mod-echo.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-echo.o: $(echo_mod_DEPENDENCIES) echo_mod-commands_echo.o - -rm -f $@ - $(TARGET_CC) $(echo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ echo_mod-commands_echo.o - -mod-echo.o: mod-echo.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -c -o $@ $< - -mod-echo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'echo' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(echo_mod_EXPORTS),no) -def-echo.lst: pre-echo.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 echo/' > $@ -endif - -und-echo.lst: pre-echo.o - echo 'echo' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -echo_mod-commands_echo.o: commands/echo.c $(commands/echo.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -MD -c -o $@ $< --include echo_mod-commands_echo.d - -CLEANFILES += cmd-echo_mod-commands_echo.lst fs-echo_mod-commands_echo.lst partmap-echo_mod-commands_echo.lst -COMMANDFILES += cmd-echo_mod-commands_echo.lst -FSFILES += fs-echo_mod-commands_echo.lst -PARTMAPFILES += partmap-echo_mod-commands_echo.lst - -cmd-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh echo > $@ || (rm -f $@; exit 1) - -fs-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh echo > $@ || (rm -f $@; exit 1) - -partmap-echo_mod-commands_echo.lst: commands/echo.c $(commands/echo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(echo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh echo > $@ || (rm -f $@; exit 1) - - -echo_mod_CFLAGS = $(COMMON_CFLAGS) -echo_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For help.mod. -help_mod_SOURCES = commands/help.c -CLEANFILES += help.mod mod-help.o mod-help.c pre-help.o help_mod-commands_help.o und-help.lst -ifneq ($(help_mod_EXPORTS),no) -CLEANFILES += def-help.lst -DEFSYMFILES += def-help.lst -endif -MOSTLYCLEANFILES += help_mod-commands_help.d -UNDSYMFILES += und-help.lst - -help.mod: pre-help.o mod-help.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o - -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ help_mod-commands_help.o - -mod-help.o: mod-help.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $< - -mod-help.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(help_mod_EXPORTS),no) -def-help.lst: pre-help.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 help/' > $@ -endif - -und-help.lst: pre-help.o - echo 'help' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -help_mod-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -MD -c -o $@ $< --include help_mod-commands_help.d - -CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst partmap-help_mod-commands_help.lst -COMMANDFILES += cmd-help_mod-commands_help.lst -FSFILES += fs-help_mod-commands_help.lst -PARTMAPFILES += partmap-help_mod-commands_help.lst - -cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) - -fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) - -partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) - - -help_mod_CFLAGS = $(COMMON_CFLAGS) -help_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For search.mod. -search_mod_SOURCES = commands/search.c -CLEANFILES += search.mod mod-search.o mod-search.c pre-search.o search_mod-commands_search.o und-search.lst -ifneq ($(search_mod_EXPORTS),no) -CLEANFILES += def-search.lst -DEFSYMFILES += def-search.lst -endif -MOSTLYCLEANFILES += search_mod-commands_search.d -UNDSYMFILES += und-search.lst - -search.mod: pre-search.o mod-search.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o - -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ search_mod-commands_search.o - -mod-search.o: mod-search.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $< - -mod-search.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(search_mod_EXPORTS),no) -def-search.lst: pre-search.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 search/' > $@ -endif - -und-search.lst: pre-search.o - echo 'search' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -search_mod-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -MD -c -o $@ $< --include search_mod-commands_search.d - -CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.lst partmap-search_mod-commands_search.lst -COMMANDFILES += cmd-search_mod-commands_search.lst -FSFILES += fs-search_mod-commands_search.lst -PARTMAPFILES += partmap-search_mod-commands_search.lst - -cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) - -fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) - -partmap-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) - - -search_mod_CFLAGS = $(COMMON_CFLAGS) -search_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For test.mod. -test_mod_SOURCES = commands/test.c -CLEANFILES += test.mod mod-test.o mod-test.c pre-test.o test_mod-commands_test.o und-test.lst -ifneq ($(test_mod_EXPORTS),no) -CLEANFILES += def-test.lst -DEFSYMFILES += def-test.lst -endif -MOSTLYCLEANFILES += test_mod-commands_test.d -UNDSYMFILES += und-test.lst - -test.mod: pre-test.o mod-test.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-test.o mod-test.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-test.o: $(test_mod_DEPENDENCIES) test_mod-commands_test.o - -rm -f $@ - $(TARGET_CC) $(test_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ test_mod-commands_test.o - -mod-test.o: mod-test.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -c -o $@ $< - -mod-test.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'test' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(test_mod_EXPORTS),no) -def-test.lst: pre-test.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 test/' > $@ -endif - -und-test.lst: pre-test.o - echo 'test' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -test_mod-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -MD -c -o $@ $< --include test_mod-commands_test.d - -CLEANFILES += cmd-test_mod-commands_test.lst fs-test_mod-commands_test.lst partmap-test_mod-commands_test.lst -COMMANDFILES += cmd-test_mod-commands_test.lst -FSFILES += fs-test_mod-commands_test.lst -PARTMAPFILES += partmap-test_mod-commands_test.lst - -cmd-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh test > $@ || (rm -f $@; exit 1) - -fs-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh test > $@ || (rm -f $@; exit 1) - -partmap-test_mod-commands_test.lst: commands/test.c $(commands/test.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(test_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh test > $@ || (rm -f $@; exit 1) - - -test_mod_CFLAGS = $(COMMON_CFLAGS) -test_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For loopback.mod -loopback_mod_SOURCES = disk/loopback.c -CLEANFILES += loopback.mod mod-loopback.o mod-loopback.c pre-loopback.o loopback_mod-disk_loopback.o und-loopback.lst -ifneq ($(loopback_mod_EXPORTS),no) -CLEANFILES += def-loopback.lst -DEFSYMFILES += def-loopback.lst -endif -MOSTLYCLEANFILES += loopback_mod-disk_loopback.d -UNDSYMFILES += und-loopback.lst - -loopback.mod: pre-loopback.o mod-loopback.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o - -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loopback_mod-disk_loopback.o - -mod-loopback.o: mod-loopback.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $< - -mod-loopback.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(loopback_mod_EXPORTS),no) -def-loopback.lst: pre-loopback.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loopback/' > $@ -endif - -und-loopback.lst: pre-loopback.o - echo 'loopback' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -loopback_mod-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -MD -c -o $@ $< --include loopback_mod-disk_loopback.d - -CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.lst partmap-loopback_mod-disk_loopback.lst -COMMANDFILES += cmd-loopback_mod-disk_loopback.lst -FSFILES += fs-loopback_mod-disk_loopback.lst -PARTMAPFILES += partmap-loopback_mod-disk_loopback.lst - -cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) - -fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) - -partmap-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) - - -loopback_mod_CFLAGS = $(COMMON_CFLAGS) -loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fs_uuid.mod -fs_uuid_mod_SOURCES = disk/fs_uuid.c -CLEANFILES += fs_uuid.mod mod-fs_uuid.o mod-fs_uuid.c pre-fs_uuid.o fs_uuid_mod-disk_fs_uuid.o und-fs_uuid.lst -ifneq ($(fs_uuid_mod_EXPORTS),no) -CLEANFILES += def-fs_uuid.lst -DEFSYMFILES += def-fs_uuid.lst -endif -MOSTLYCLEANFILES += fs_uuid_mod-disk_fs_uuid.d -UNDSYMFILES += und-fs_uuid.lst - -fs_uuid.mod: pre-fs_uuid.o mod-fs_uuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fs_uuid.o mod-fs_uuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fs_uuid.o: $(fs_uuid_mod_DEPENDENCIES) fs_uuid_mod-disk_fs_uuid.o - -rm -f $@ - $(TARGET_CC) $(fs_uuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fs_uuid_mod-disk_fs_uuid.o - -mod-fs_uuid.o: mod-fs_uuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -c -o $@ $< - -mod-fs_uuid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fs_uuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fs_uuid_mod_EXPORTS),no) -def-fs_uuid.lst: pre-fs_uuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fs_uuid/' > $@ -endif - -und-fs_uuid.lst: pre-fs_uuid.o - echo 'fs_uuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fs_uuid_mod-disk_fs_uuid.o: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -MD -c -o $@ $< --include fs_uuid_mod-disk_fs_uuid.d - -CLEANFILES += cmd-fs_uuid_mod-disk_fs_uuid.lst fs-fs_uuid_mod-disk_fs_uuid.lst partmap-fs_uuid_mod-disk_fs_uuid.lst -COMMANDFILES += cmd-fs_uuid_mod-disk_fs_uuid.lst -FSFILES += fs-fs_uuid_mod-disk_fs_uuid.lst -PARTMAPFILES += partmap-fs_uuid_mod-disk_fs_uuid.lst - -cmd-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fs_uuid > $@ || (rm -f $@; exit 1) - -fs-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fs_uuid > $@ || (rm -f $@; exit 1) - -partmap-fs_uuid_mod-disk_fs_uuid.lst: disk/fs_uuid.c $(disk/fs_uuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fs_uuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fs_uuid > $@ || (rm -f $@; exit 1) - - -fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS) -fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For configfile.mod -configfile_mod_SOURCES = commands/configfile.c -CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o und-configfile.lst -ifneq ($(configfile_mod_EXPORTS),no) -CLEANFILES += def-configfile.lst -DEFSYMFILES += def-configfile.lst -endif -MOSTLYCLEANFILES += configfile_mod-commands_configfile.d -UNDSYMFILES += und-configfile.lst - -configfile.mod: pre-configfile.o mod-configfile.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configfile.o - -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ configfile_mod-commands_configfile.o - -mod-configfile.o: mod-configfile.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $< - -mod-configfile.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(configfile_mod_EXPORTS),no) -def-configfile.lst: pre-configfile.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 configfile/' > $@ -endif - -und-configfile.lst: pre-configfile.o - echo 'configfile' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -configfile_mod-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -MD -c -o $@ $< --include configfile_mod-commands_configfile.d - -CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-commands_configfile.lst partmap-configfile_mod-commands_configfile.lst -COMMANDFILES += cmd-configfile_mod-commands_configfile.lst -FSFILES += fs-configfile_mod-commands_configfile.lst -PARTMAPFILES += partmap-configfile_mod-commands_configfile.lst - -cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) - -fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) - -partmap-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) - - -configfile_mod_CFLAGS = $(COMMON_CFLAGS) -configfile_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For terminfo.mod. -terminfo_mod_SOURCES = term/terminfo.c term/tparm.c -CLEANFILES += terminfo.mod mod-terminfo.o mod-terminfo.c pre-terminfo.o terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o und-terminfo.lst -ifneq ($(terminfo_mod_EXPORTS),no) -CLEANFILES += def-terminfo.lst -DEFSYMFILES += def-terminfo.lst -endif -MOSTLYCLEANFILES += terminfo_mod-term_terminfo.d terminfo_mod-term_tparm.d -UNDSYMFILES += und-terminfo.lst - -terminfo.mod: pre-terminfo.o mod-terminfo.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-terminfo.o mod-terminfo.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-terminfo.o: $(terminfo_mod_DEPENDENCIES) terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o - -rm -f $@ - $(TARGET_CC) $(terminfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ terminfo_mod-term_terminfo.o terminfo_mod-term_tparm.o - -mod-terminfo.o: mod-terminfo.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -c -o $@ $< - -mod-terminfo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'terminfo' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(terminfo_mod_EXPORTS),no) -def-terminfo.lst: pre-terminfo.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminfo/' > $@ -endif - -und-terminfo.lst: pre-terminfo.o - echo 'terminfo' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -terminfo_mod-term_terminfo.o: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) - $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -MD -c -o $@ $< --include terminfo_mod-term_terminfo.d - -CLEANFILES += cmd-terminfo_mod-term_terminfo.lst fs-terminfo_mod-term_terminfo.lst partmap-terminfo_mod-term_terminfo.lst -COMMANDFILES += cmd-terminfo_mod-term_terminfo.lst -FSFILES += fs-terminfo_mod-term_terminfo.lst -PARTMAPFILES += partmap-terminfo_mod-term_terminfo.lst - -cmd-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) - -fs-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) - -partmap-terminfo_mod-term_terminfo.lst: term/terminfo.c $(term/terminfo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) - - -terminfo_mod-term_tparm.o: term/tparm.c $(term/tparm.c_DEPENDENCIES) - $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -MD -c -o $@ $< --include terminfo_mod-term_tparm.d - -CLEANFILES += cmd-terminfo_mod-term_tparm.lst fs-terminfo_mod-term_tparm.lst partmap-terminfo_mod-term_tparm.lst -COMMANDFILES += cmd-terminfo_mod-term_tparm.lst -FSFILES += fs-terminfo_mod-term_tparm.lst -PARTMAPFILES += partmap-terminfo_mod-term_tparm.lst - -cmd-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminfo > $@ || (rm -f $@; exit 1) - -fs-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminfo > $@ || (rm -f $@; exit 1) - -partmap-terminfo_mod-term_tparm.lst: term/tparm.c $(term/tparm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminfo > $@ || (rm -f $@; exit 1) - - -terminfo_mod_CFLAGS = $(COMMON_CFLAGS) -terminfo_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For blocklist.mod. -blocklist_mod_SOURCES = commands/blocklist.c -CLEANFILES += blocklist.mod mod-blocklist.o mod-blocklist.c pre-blocklist.o blocklist_mod-commands_blocklist.o und-blocklist.lst -ifneq ($(blocklist_mod_EXPORTS),no) -CLEANFILES += def-blocklist.lst -DEFSYMFILES += def-blocklist.lst -endif -MOSTLYCLEANFILES += blocklist_mod-commands_blocklist.d -UNDSYMFILES += und-blocklist.lst - -blocklist.mod: pre-blocklist.o mod-blocklist.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-blocklist.o mod-blocklist.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-blocklist.o: $(blocklist_mod_DEPENDENCIES) blocklist_mod-commands_blocklist.o - -rm -f $@ - $(TARGET_CC) $(blocklist_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ blocklist_mod-commands_blocklist.o - -mod-blocklist.o: mod-blocklist.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -c -o $@ $< - -mod-blocklist.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'blocklist' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(blocklist_mod_EXPORTS),no) -def-blocklist.lst: pre-blocklist.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 blocklist/' > $@ -endif - -und-blocklist.lst: pre-blocklist.o - echo 'blocklist' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -blocklist_mod-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -MD -c -o $@ $< --include blocklist_mod-commands_blocklist.d - -CLEANFILES += cmd-blocklist_mod-commands_blocklist.lst fs-blocklist_mod-commands_blocklist.lst partmap-blocklist_mod-commands_blocklist.lst -COMMANDFILES += cmd-blocklist_mod-commands_blocklist.lst -FSFILES += fs-blocklist_mod-commands_blocklist.lst -PARTMAPFILES += partmap-blocklist_mod-commands_blocklist.lst - -cmd-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh blocklist > $@ || (rm -f $@; exit 1) - -fs-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh blocklist > $@ || (rm -f $@; exit 1) - -partmap-blocklist_mod-commands_blocklist.lst: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(blocklist_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh blocklist > $@ || (rm -f $@; exit 1) - - -blocklist_mod_CFLAGS = $(COMMON_CFLAGS) -blocklist_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hexdump.mod. -hexdump_mod_SOURCES = commands/hexdump.c lib/hexdump.c -CLEANFILES += hexdump.mod mod-hexdump.o mod-hexdump.c pre-hexdump.o hexdump_mod-commands_hexdump.o hexdump_mod-lib_hexdump.o und-hexdump.lst -ifneq ($(hexdump_mod_EXPORTS),no) -CLEANFILES += def-hexdump.lst -DEFSYMFILES += def-hexdump.lst -endif -MOSTLYCLEANFILES += hexdump_mod-commands_hexdump.d hexdump_mod-lib_hexdump.d -UNDSYMFILES += und-hexdump.lst - -hexdump.mod: pre-hexdump.o mod-hexdump.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hexdump.o mod-hexdump.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-hexdump.o: $(hexdump_mod_DEPENDENCIES) hexdump_mod-commands_hexdump.o hexdump_mod-lib_hexdump.o - -rm -f $@ - $(TARGET_CC) $(hexdump_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hexdump_mod-commands_hexdump.o hexdump_mod-lib_hexdump.o - -mod-hexdump.o: mod-hexdump.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -c -o $@ $< - -mod-hexdump.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'hexdump' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(hexdump_mod_EXPORTS),no) -def-hexdump.lst: pre-hexdump.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hexdump/' > $@ -endif - -und-hexdump.lst: pre-hexdump.o - echo 'hexdump' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -hexdump_mod-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -MD -c -o $@ $< --include hexdump_mod-commands_hexdump.d - -CLEANFILES += cmd-hexdump_mod-commands_hexdump.lst fs-hexdump_mod-commands_hexdump.lst partmap-hexdump_mod-commands_hexdump.lst -COMMANDFILES += cmd-hexdump_mod-commands_hexdump.lst -FSFILES += fs-hexdump_mod-commands_hexdump.lst -PARTMAPFILES += partmap-hexdump_mod-commands_hexdump.lst - -cmd-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) - -fs-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) - -partmap-hexdump_mod-commands_hexdump.lst: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) - - -hexdump_mod-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -MD -c -o $@ $< --include hexdump_mod-lib_hexdump.d - -CLEANFILES += cmd-hexdump_mod-lib_hexdump.lst fs-hexdump_mod-lib_hexdump.lst partmap-hexdump_mod-lib_hexdump.lst -COMMANDFILES += cmd-hexdump_mod-lib_hexdump.lst -FSFILES += fs-hexdump_mod-lib_hexdump.lst -PARTMAPFILES += partmap-hexdump_mod-lib_hexdump.lst - -cmd-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hexdump > $@ || (rm -f $@; exit 1) - -fs-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hexdump > $@ || (rm -f $@; exit 1) - -partmap-hexdump_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hexdump_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hexdump > $@ || (rm -f $@; exit 1) - - -hexdump_mod_CFLAGS = $(COMMON_CFLAGS) -hexdump_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For read.mod. -read_mod_SOURCES = commands/read.c -CLEANFILES += read.mod mod-read.o mod-read.c pre-read.o read_mod-commands_read.o und-read.lst -ifneq ($(read_mod_EXPORTS),no) -CLEANFILES += def-read.lst -DEFSYMFILES += def-read.lst -endif -MOSTLYCLEANFILES += read_mod-commands_read.d -UNDSYMFILES += und-read.lst - -read.mod: pre-read.o mod-read.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-read.o mod-read.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-read.o: $(read_mod_DEPENDENCIES) read_mod-commands_read.o - -rm -f $@ - $(TARGET_CC) $(read_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ read_mod-commands_read.o - -mod-read.o: mod-read.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -c -o $@ $< - -mod-read.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'read' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(read_mod_EXPORTS),no) -def-read.lst: pre-read.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 read/' > $@ -endif - -und-read.lst: pre-read.o - echo 'read' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -read_mod-commands_read.o: commands/read.c $(commands/read.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -MD -c -o $@ $< --include read_mod-commands_read.d - -CLEANFILES += cmd-read_mod-commands_read.lst fs-read_mod-commands_read.lst partmap-read_mod-commands_read.lst -COMMANDFILES += cmd-read_mod-commands_read.lst -FSFILES += fs-read_mod-commands_read.lst -PARTMAPFILES += partmap-read_mod-commands_read.lst - -cmd-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh read > $@ || (rm -f $@; exit 1) - -fs-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh read > $@ || (rm -f $@; exit 1) - -partmap-read_mod-commands_read.lst: commands/read.c $(commands/read.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(read_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh read > $@ || (rm -f $@; exit 1) - - -read_mod_CFLAGS = $(COMMON_CFLAGS) -read_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sleep.mod. -sleep_mod_SOURCES = commands/sleep.c -CLEANFILES += sleep.mod mod-sleep.o mod-sleep.c pre-sleep.o sleep_mod-commands_sleep.o und-sleep.lst -ifneq ($(sleep_mod_EXPORTS),no) -CLEANFILES += def-sleep.lst -DEFSYMFILES += def-sleep.lst -endif -MOSTLYCLEANFILES += sleep_mod-commands_sleep.d -UNDSYMFILES += und-sleep.lst - -sleep.mod: pre-sleep.o mod-sleep.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sleep.o mod-sleep.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-sleep.o: $(sleep_mod_DEPENDENCIES) sleep_mod-commands_sleep.o - -rm -f $@ - $(TARGET_CC) $(sleep_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sleep_mod-commands_sleep.o - -mod-sleep.o: mod-sleep.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -c -o $@ $< - -mod-sleep.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'sleep' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(sleep_mod_EXPORTS),no) -def-sleep.lst: pre-sleep.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sleep/' > $@ -endif - -und-sleep.lst: pre-sleep.o - echo 'sleep' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -sleep_mod-commands_sleep.o: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -MD -c -o $@ $< --include sleep_mod-commands_sleep.d - -CLEANFILES += cmd-sleep_mod-commands_sleep.lst fs-sleep_mod-commands_sleep.lst partmap-sleep_mod-commands_sleep.lst -COMMANDFILES += cmd-sleep_mod-commands_sleep.lst -FSFILES += fs-sleep_mod-commands_sleep.lst -PARTMAPFILES += partmap-sleep_mod-commands_sleep.lst - -cmd-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sleep > $@ || (rm -f $@; exit 1) - -fs-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sleep > $@ || (rm -f $@; exit 1) - -partmap-sleep_mod-commands_sleep.lst: commands/sleep.c $(commands/sleep.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sleep_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sleep > $@ || (rm -f $@; exit 1) - - -sleep_mod_CFLAGS = $(COMMON_CFLAGS) -sleep_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For loadenv.mod. -loadenv_mod_SOURCES = commands/loadenv.c lib/envblk.c -CLEANFILES += loadenv.mod mod-loadenv.o mod-loadenv.c pre-loadenv.o loadenv_mod-commands_loadenv.o loadenv_mod-lib_envblk.o und-loadenv.lst -ifneq ($(loadenv_mod_EXPORTS),no) -CLEANFILES += def-loadenv.lst -DEFSYMFILES += def-loadenv.lst -endif -MOSTLYCLEANFILES += loadenv_mod-commands_loadenv.d loadenv_mod-lib_envblk.d -UNDSYMFILES += und-loadenv.lst - -loadenv.mod: pre-loadenv.o mod-loadenv.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadenv.o mod-loadenv.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-loadenv.o: $(loadenv_mod_DEPENDENCIES) loadenv_mod-commands_loadenv.o loadenv_mod-lib_envblk.o - -rm -f $@ - $(TARGET_CC) $(loadenv_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadenv_mod-commands_loadenv.o loadenv_mod-lib_envblk.o - -mod-loadenv.o: mod-loadenv.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -c -o $@ $< - -mod-loadenv.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'loadenv' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(loadenv_mod_EXPORTS),no) -def-loadenv.lst: pre-loadenv.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadenv/' > $@ -endif - -und-loadenv.lst: pre-loadenv.o - echo 'loadenv' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -loadenv_mod-commands_loadenv.o: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -MD -c -o $@ $< --include loadenv_mod-commands_loadenv.d - -CLEANFILES += cmd-loadenv_mod-commands_loadenv.lst fs-loadenv_mod-commands_loadenv.lst partmap-loadenv_mod-commands_loadenv.lst -COMMANDFILES += cmd-loadenv_mod-commands_loadenv.lst -FSFILES += fs-loadenv_mod-commands_loadenv.lst -PARTMAPFILES += partmap-loadenv_mod-commands_loadenv.lst - -cmd-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) - -fs-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) - -partmap-loadenv_mod-commands_loadenv.lst: commands/loadenv.c $(commands/loadenv.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) - - -loadenv_mod-lib_envblk.o: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -MD -c -o $@ $< --include loadenv_mod-lib_envblk.d - -CLEANFILES += cmd-loadenv_mod-lib_envblk.lst fs-loadenv_mod-lib_envblk.lst partmap-loadenv_mod-lib_envblk.lst -COMMANDFILES += cmd-loadenv_mod-lib_envblk.lst -FSFILES += fs-loadenv_mod-lib_envblk.lst -PARTMAPFILES += partmap-loadenv_mod-lib_envblk.lst - -cmd-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadenv > $@ || (rm -f $@; exit 1) - -fs-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadenv > $@ || (rm -f $@; exit 1) - -partmap-loadenv_mod-lib_envblk.lst: lib/envblk.c $(lib/envblk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadenv_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadenv > $@ || (rm -f $@; exit 1) - - -loadenv_mod_CFLAGS = $(COMMON_CFLAGS) -loadenv_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For crc.mod. -crc_mod_SOURCES = commands/crc.c lib/crc.c -CLEANFILES += crc.mod mod-crc.o mod-crc.c pre-crc.o crc_mod-commands_crc.o crc_mod-lib_crc.o und-crc.lst -ifneq ($(crc_mod_EXPORTS),no) -CLEANFILES += def-crc.lst -DEFSYMFILES += def-crc.lst -endif -MOSTLYCLEANFILES += crc_mod-commands_crc.d crc_mod-lib_crc.d -UNDSYMFILES += und-crc.lst - -crc.mod: pre-crc.o mod-crc.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(crc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-crc.o mod-crc.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-crc.o: $(crc_mod_DEPENDENCIES) crc_mod-commands_crc.o crc_mod-lib_crc.o - -rm -f $@ - $(TARGET_CC) $(crc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ crc_mod-commands_crc.o crc_mod-lib_crc.o - -mod-crc.o: mod-crc.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -c -o $@ $< - -mod-crc.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'crc' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(crc_mod_EXPORTS),no) -def-crc.lst: pre-crc.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 crc/' > $@ -endif - -und-crc.lst: pre-crc.o - echo 'crc' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -crc_mod-commands_crc.o: commands/crc.c $(commands/crc.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -MD -c -o $@ $< --include crc_mod-commands_crc.d - -CLEANFILES += cmd-crc_mod-commands_crc.lst fs-crc_mod-commands_crc.lst partmap-crc_mod-commands_crc.lst -COMMANDFILES += cmd-crc_mod-commands_crc.lst -FSFILES += fs-crc_mod-commands_crc.lst -PARTMAPFILES += partmap-crc_mod-commands_crc.lst - -cmd-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) - -fs-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) - -partmap-crc_mod-commands_crc.lst: commands/crc.c $(commands/crc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) - - -crc_mod-lib_crc.o: lib/crc.c $(lib/crc.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -MD -c -o $@ $< --include crc_mod-lib_crc.d - -CLEANFILES += cmd-crc_mod-lib_crc.lst fs-crc_mod-lib_crc.lst partmap-crc_mod-lib_crc.lst -COMMANDFILES += cmd-crc_mod-lib_crc.lst -FSFILES += fs-crc_mod-lib_crc.lst -PARTMAPFILES += partmap-crc_mod-lib_crc.lst - -cmd-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh crc > $@ || (rm -f $@; exit 1) - -fs-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh crc > $@ || (rm -f $@; exit 1) - -partmap-crc_mod-lib_crc.lst: lib/crc.c $(lib/crc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(crc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh crc > $@ || (rm -f $@; exit 1) - - -crc_mod_CFLAGS = $(COMMON_CFLAGS) -crc_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For memrw.mod. -memrw_mod_SOURCES = commands/memrw.c -CLEANFILES += memrw.mod mod-memrw.o mod-memrw.c pre-memrw.o memrw_mod-commands_memrw.o und-memrw.lst -ifneq ($(memrw_mod_EXPORTS),no) -CLEANFILES += def-memrw.lst -DEFSYMFILES += def-memrw.lst -endif -MOSTLYCLEANFILES += memrw_mod-commands_memrw.d -UNDSYMFILES += und-memrw.lst - -memrw.mod: pre-memrw.o mod-memrw.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memrw.o mod-memrw.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-memrw.o: $(memrw_mod_DEPENDENCIES) memrw_mod-commands_memrw.o - -rm -f $@ - $(TARGET_CC) $(memrw_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memrw_mod-commands_memrw.o - -mod-memrw.o: mod-memrw.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -c -o $@ $< - -mod-memrw.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'memrw' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(memrw_mod_EXPORTS),no) -def-memrw.lst: pre-memrw.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memrw/' > $@ -endif - -und-memrw.lst: pre-memrw.o - echo 'memrw' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -memrw_mod-commands_memrw.o: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -MD -c -o $@ $< --include memrw_mod-commands_memrw.d - -CLEANFILES += cmd-memrw_mod-commands_memrw.lst fs-memrw_mod-commands_memrw.lst partmap-memrw_mod-commands_memrw.lst -COMMANDFILES += cmd-memrw_mod-commands_memrw.lst -FSFILES += fs-memrw_mod-commands_memrw.lst -PARTMAPFILES += partmap-memrw_mod-commands_memrw.lst - -cmd-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memrw > $@ || (rm -f $@; exit 1) - -fs-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memrw > $@ || (rm -f $@; exit 1) - -partmap-memrw_mod-commands_memrw.lst: commands/memrw.c $(commands/memrw.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memrw_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memrw > $@ || (rm -f $@; exit 1) - - -memrw_mod_CFLAGS = $(COMMON_CFLAGS) -memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# Common Video Subsystem specific modules. -pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ - png.mod font.mod gfxterm.mod - -# For video.mod. -video_mod_SOURCES = video/video.c -CLEANFILES += video.mod mod-video.o mod-video.c pre-video.o video_mod-video_video.o und-video.lst -ifneq ($(video_mod_EXPORTS),no) -CLEANFILES += def-video.lst -DEFSYMFILES += def-video.lst -endif -MOSTLYCLEANFILES += video_mod-video_video.d -UNDSYMFILES += und-video.lst - -video.mod: pre-video.o mod-video.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-video.o mod-video.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-video.o: $(video_mod_DEPENDENCIES) video_mod-video_video.o - -rm -f $@ - $(TARGET_CC) $(video_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ video_mod-video_video.o - -mod-video.o: mod-video.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -c -o $@ $< - -mod-video.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'video' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(video_mod_EXPORTS),no) -def-video.lst: pre-video.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 video/' > $@ -endif - -und-video.lst: pre-video.o - echo 'video' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -video_mod-video_video.o: video/video.c $(video/video.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -MD -c -o $@ $< --include video_mod-video_video.d - -CLEANFILES += cmd-video_mod-video_video.lst fs-video_mod-video_video.lst partmap-video_mod-video_video.lst -COMMANDFILES += cmd-video_mod-video_video.lst -FSFILES += fs-video_mod-video_video.lst -PARTMAPFILES += partmap-video_mod-video_video.lst - -cmd-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh video > $@ || (rm -f $@; exit 1) - -fs-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh video > $@ || (rm -f $@; exit 1) - -partmap-video_mod-video_video.lst: video/video.c $(video/video.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(video_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh video > $@ || (rm -f $@; exit 1) - - -video_mod_CFLAGS = $(COMMON_CFLAGS) -video_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For videotest.mod. -videotest_mod_SOURCES = commands/videotest.c -CLEANFILES += videotest.mod mod-videotest.o mod-videotest.c pre-videotest.o videotest_mod-commands_videotest.o und-videotest.lst -ifneq ($(videotest_mod_EXPORTS),no) -CLEANFILES += def-videotest.lst -DEFSYMFILES += def-videotest.lst -endif -MOSTLYCLEANFILES += videotest_mod-commands_videotest.d -UNDSYMFILES += und-videotest.lst - -videotest.mod: pre-videotest.o mod-videotest.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-videotest.o mod-videotest.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-videotest.o: $(videotest_mod_DEPENDENCIES) videotest_mod-commands_videotest.o - -rm -f $@ - $(TARGET_CC) $(videotest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ videotest_mod-commands_videotest.o - -mod-videotest.o: mod-videotest.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -c -o $@ $< - -mod-videotest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'videotest' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(videotest_mod_EXPORTS),no) -def-videotest.lst: pre-videotest.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 videotest/' > $@ -endif - -und-videotest.lst: pre-videotest.o - echo 'videotest' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -videotest_mod-commands_videotest.o: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -MD -c -o $@ $< --include videotest_mod-commands_videotest.d - -CLEANFILES += cmd-videotest_mod-commands_videotest.lst fs-videotest_mod-commands_videotest.lst partmap-videotest_mod-commands_videotest.lst -COMMANDFILES += cmd-videotest_mod-commands_videotest.lst -FSFILES += fs-videotest_mod-commands_videotest.lst -PARTMAPFILES += partmap-videotest_mod-commands_videotest.lst - -cmd-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh videotest > $@ || (rm -f $@; exit 1) - -fs-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh videotest > $@ || (rm -f $@; exit 1) - -partmap-videotest_mod-commands_videotest.lst: commands/videotest.c $(commands/videotest.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(videotest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh videotest > $@ || (rm -f $@; exit 1) - - -videotest_mod_CFLAGS = $(COMMON_CFLAGS) -videotest_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For bitmap.mod -bitmap_mod_SOURCES = video/bitmap.c -CLEANFILES += bitmap.mod mod-bitmap.o mod-bitmap.c pre-bitmap.o bitmap_mod-video_bitmap.o und-bitmap.lst -ifneq ($(bitmap_mod_EXPORTS),no) -CLEANFILES += def-bitmap.lst -DEFSYMFILES += def-bitmap.lst -endif -MOSTLYCLEANFILES += bitmap_mod-video_bitmap.d -UNDSYMFILES += und-bitmap.lst - -bitmap.mod: pre-bitmap.o mod-bitmap.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-bitmap.o mod-bitmap.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-bitmap.o: $(bitmap_mod_DEPENDENCIES) bitmap_mod-video_bitmap.o - -rm -f $@ - $(TARGET_CC) $(bitmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bitmap_mod-video_bitmap.o - -mod-bitmap.o: mod-bitmap.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -c -o $@ $< - -mod-bitmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'bitmap' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(bitmap_mod_EXPORTS),no) -def-bitmap.lst: pre-bitmap.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 bitmap/' > $@ -endif - -und-bitmap.lst: pre-bitmap.o - echo 'bitmap' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -bitmap_mod-video_bitmap.o: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -MD -c -o $@ $< --include bitmap_mod-video_bitmap.d - -CLEANFILES += cmd-bitmap_mod-video_bitmap.lst fs-bitmap_mod-video_bitmap.lst partmap-bitmap_mod-video_bitmap.lst -COMMANDFILES += cmd-bitmap_mod-video_bitmap.lst -FSFILES += fs-bitmap_mod-video_bitmap.lst -PARTMAPFILES += partmap-bitmap_mod-video_bitmap.lst - -cmd-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bitmap > $@ || (rm -f $@; exit 1) - -fs-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bitmap > $@ || (rm -f $@; exit 1) - -partmap-bitmap_mod-video_bitmap.lst: video/bitmap.c $(video/bitmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo -I$(srcdir)/video $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bitmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bitmap > $@ || (rm -f $@; exit 1) - - -bitmap_mod_CFLAGS = $(COMMON_CFLAGS) -bitmap_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For tga.mod -tga_mod_SOURCES = video/readers/tga.c -CLEANFILES += tga.mod mod-tga.o mod-tga.c pre-tga.o tga_mod-video_readers_tga.o und-tga.lst -ifneq ($(tga_mod_EXPORTS),no) -CLEANFILES += def-tga.lst -DEFSYMFILES += def-tga.lst -endif -MOSTLYCLEANFILES += tga_mod-video_readers_tga.d -UNDSYMFILES += und-tga.lst - -tga.mod: pre-tga.o mod-tga.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-tga.o mod-tga.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-tga.o: $(tga_mod_DEPENDENCIES) tga_mod-video_readers_tga.o - -rm -f $@ - $(TARGET_CC) $(tga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ tga_mod-video_readers_tga.o - -mod-tga.o: mod-tga.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -c -o $@ $< - -mod-tga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'tga' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(tga_mod_EXPORTS),no) -def-tga.lst: pre-tga.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 tga/' > $@ -endif - -und-tga.lst: pre-tga.o - echo 'tga' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -tga_mod-video_readers_tga.o: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -MD -c -o $@ $< --include tga_mod-video_readers_tga.d - -CLEANFILES += cmd-tga_mod-video_readers_tga.lst fs-tga_mod-video_readers_tga.lst partmap-tga_mod-video_readers_tga.lst -COMMANDFILES += cmd-tga_mod-video_readers_tga.lst -FSFILES += fs-tga_mod-video_readers_tga.lst -PARTMAPFILES += partmap-tga_mod-video_readers_tga.lst - -cmd-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh tga > $@ || (rm -f $@; exit 1) - -fs-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh tga > $@ || (rm -f $@; exit 1) - -partmap-tga_mod-video_readers_tga.lst: video/readers/tga.c $(video/readers/tga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(tga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh tga > $@ || (rm -f $@; exit 1) - - -tga_mod_CFLAGS = $(COMMON_CFLAGS) -tga_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For jpeg.mod. -jpeg_mod_SOURCES = video/readers/jpeg.c -CLEANFILES += jpeg.mod mod-jpeg.o mod-jpeg.c pre-jpeg.o jpeg_mod-video_readers_jpeg.o und-jpeg.lst -ifneq ($(jpeg_mod_EXPORTS),no) -CLEANFILES += def-jpeg.lst -DEFSYMFILES += def-jpeg.lst -endif -MOSTLYCLEANFILES += jpeg_mod-video_readers_jpeg.d -UNDSYMFILES += und-jpeg.lst - -jpeg.mod: pre-jpeg.o mod-jpeg.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-jpeg.o mod-jpeg.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-jpeg.o: $(jpeg_mod_DEPENDENCIES) jpeg_mod-video_readers_jpeg.o - -rm -f $@ - $(TARGET_CC) $(jpeg_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ jpeg_mod-video_readers_jpeg.o - -mod-jpeg.o: mod-jpeg.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -c -o $@ $< - -mod-jpeg.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'jpeg' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(jpeg_mod_EXPORTS),no) -def-jpeg.lst: pre-jpeg.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 jpeg/' > $@ -endif - -und-jpeg.lst: pre-jpeg.o - echo 'jpeg' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -jpeg_mod-video_readers_jpeg.o: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -MD -c -o $@ $< --include jpeg_mod-video_readers_jpeg.d - -CLEANFILES += cmd-jpeg_mod-video_readers_jpeg.lst fs-jpeg_mod-video_readers_jpeg.lst partmap-jpeg_mod-video_readers_jpeg.lst -COMMANDFILES += cmd-jpeg_mod-video_readers_jpeg.lst -FSFILES += fs-jpeg_mod-video_readers_jpeg.lst -PARTMAPFILES += partmap-jpeg_mod-video_readers_jpeg.lst - -cmd-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jpeg > $@ || (rm -f $@; exit 1) - -fs-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jpeg > $@ || (rm -f $@; exit 1) - -partmap-jpeg_mod-video_readers_jpeg.lst: video/readers/jpeg.c $(video/readers/jpeg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jpeg_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jpeg > $@ || (rm -f $@; exit 1) - - -jpeg_mod_CFLAGS = $(COMMON_CFLAGS) -jpeg_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For png.mod. -png_mod_SOURCES = video/readers/png.c -CLEANFILES += png.mod mod-png.o mod-png.c pre-png.o png_mod-video_readers_png.o und-png.lst -ifneq ($(png_mod_EXPORTS),no) -CLEANFILES += def-png.lst -DEFSYMFILES += def-png.lst -endif -MOSTLYCLEANFILES += png_mod-video_readers_png.d -UNDSYMFILES += und-png.lst - -png.mod: pre-png.o mod-png.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-png.o mod-png.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-png.o: $(png_mod_DEPENDENCIES) png_mod-video_readers_png.o - -rm -f $@ - $(TARGET_CC) $(png_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ png_mod-video_readers_png.o - -mod-png.o: mod-png.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -c -o $@ $< - -mod-png.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'png' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(png_mod_EXPORTS),no) -def-png.lst: pre-png.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 png/' > $@ -endif - -und-png.lst: pre-png.o - echo 'png' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -png_mod-video_readers_png.o: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -MD -c -o $@ $< --include png_mod-video_readers_png.d - -CLEANFILES += cmd-png_mod-video_readers_png.lst fs-png_mod-video_readers_png.lst partmap-png_mod-video_readers_png.lst -COMMANDFILES += cmd-png_mod-video_readers_png.lst -FSFILES += fs-png_mod-video_readers_png.lst -PARTMAPFILES += partmap-png_mod-video_readers_png.lst - -cmd-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh png > $@ || (rm -f $@; exit 1) - -fs-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh png > $@ || (rm -f $@; exit 1) - -partmap-png_mod-video_readers_png.lst: video/readers/png.c $(video/readers/png.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/readers -I$(srcdir)/video/readers $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(png_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh png > $@ || (rm -f $@; exit 1) - - -png_mod_CFLAGS = $(COMMON_CFLAGS) -png_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For font.mod. -font_mod_SOURCES = font/font_cmd.c font/font.c -CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_font_cmd.o font_mod-font_font.o und-font.lst -ifneq ($(font_mod_EXPORTS),no) -CLEANFILES += def-font.lst -DEFSYMFILES += def-font.lst -endif -MOSTLYCLEANFILES += font_mod-font_font_cmd.d font_mod-font_font.d -UNDSYMFILES += und-font.lst - -font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_font_cmd.o font_mod-font_font.o - -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ font_mod-font_font_cmd.o font_mod-font_font.o - -mod-font.o: mod-font.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< - -mod-font.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(font_mod_EXPORTS),no) -def-font.lst: pre-font.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@ -endif - -und-font.lst: pre-font.o - echo 'font' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -font_mod-font_font_cmd.o: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) - $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< --include font_mod-font_font_cmd.d - -CLEANFILES += cmd-font_mod-font_font_cmd.lst fs-font_mod-font_font_cmd.lst partmap-font_mod-font_font_cmd.lst -COMMANDFILES += cmd-font_mod-font_font_cmd.lst -FSFILES += fs-font_mod-font_font_cmd.lst -PARTMAPFILES += partmap-font_mod-font_font_cmd.lst - -cmd-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) - -fs-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) - -partmap-font_mod-font_font_cmd.lst: font/font_cmd.c $(font/font_cmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) - - -font_mod-font_font.o: font/font.c $(font/font.c_DEPENDENCIES) - $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< --include font_mod-font_font.d - -CLEANFILES += cmd-font_mod-font_font.lst fs-font_mod-font_font.lst partmap-font_mod-font_font.lst -COMMANDFILES += cmd-font_mod-font_font.lst -FSFILES += fs-font_mod-font_font.lst -PARTMAPFILES += partmap-font_mod-font_font.lst - -cmd-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) - -fs-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) - -partmap-font_mod-font_font.lst: font/font.c $(font/font.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) - - -font_mod_CFLAGS = $(COMMON_CFLAGS) -font_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For gfxterm.mod. -gfxterm_mod_SOURCES = term/gfxterm.c -CLEANFILES += gfxterm.mod mod-gfxterm.o mod-gfxterm.c pre-gfxterm.o gfxterm_mod-term_gfxterm.o und-gfxterm.lst -ifneq ($(gfxterm_mod_EXPORTS),no) -CLEANFILES += def-gfxterm.lst -DEFSYMFILES += def-gfxterm.lst -endif -MOSTLYCLEANFILES += gfxterm_mod-term_gfxterm.d -UNDSYMFILES += und-gfxterm.lst - -gfxterm.mod: pre-gfxterm.o mod-gfxterm.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gfxterm.o mod-gfxterm.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-gfxterm.o: $(gfxterm_mod_DEPENDENCIES) gfxterm_mod-term_gfxterm.o - -rm -f $@ - $(TARGET_CC) $(gfxterm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gfxterm_mod-term_gfxterm.o - -mod-gfxterm.o: mod-gfxterm.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -c -o $@ $< - -mod-gfxterm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'gfxterm' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(gfxterm_mod_EXPORTS),no) -def-gfxterm.lst: pre-gfxterm.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gfxterm/' > $@ -endif - -und-gfxterm.lst: pre-gfxterm.o - echo 'gfxterm' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -gfxterm_mod-term_gfxterm.o: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) - $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -MD -c -o $@ $< --include gfxterm_mod-term_gfxterm.d - -CLEANFILES += cmd-gfxterm_mod-term_gfxterm.lst fs-gfxterm_mod-term_gfxterm.lst partmap-gfxterm_mod-term_gfxterm.lst -COMMANDFILES += cmd-gfxterm_mod-term_gfxterm.lst -FSFILES += fs-gfxterm_mod-term_gfxterm.lst -PARTMAPFILES += partmap-gfxterm_mod-term_gfxterm.lst - -cmd-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gfxterm > $@ || (rm -f $@; exit 1) - -fs-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gfxterm > $@ || (rm -f $@; exit 1) - -partmap-gfxterm_mod-term_gfxterm.lst: term/gfxterm.c $(term/gfxterm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gfxterm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gfxterm > $@ || (rm -f $@; exit 1) - - -gfxterm_mod_CFLAGS = $(COMMON_CFLAGS) -gfxterm_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# Misc. -pkglib_MODULES += gzio.mod bufio.mod elf.mod - -# For elf.mod. -elf_mod_SOURCES = kern/elf.c -CLEANFILES += elf.mod mod-elf.o mod-elf.c pre-elf.o elf_mod-kern_elf.o und-elf.lst -ifneq ($(elf_mod_EXPORTS),no) -CLEANFILES += def-elf.lst -DEFSYMFILES += def-elf.lst -endif -MOSTLYCLEANFILES += elf_mod-kern_elf.d -UNDSYMFILES += und-elf.lst - -elf.mod: pre-elf.o mod-elf.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-elf.o mod-elf.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-elf.o: $(elf_mod_DEPENDENCIES) elf_mod-kern_elf.o - -rm -f $@ - $(TARGET_CC) $(elf_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ elf_mod-kern_elf.o - -mod-elf.o: mod-elf.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -c -o $@ $< - -mod-elf.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'elf' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(elf_mod_EXPORTS),no) -def-elf.lst: pre-elf.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 elf/' > $@ -endif - -und-elf.lst: pre-elf.o - echo 'elf' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -elf_mod-kern_elf.o: kern/elf.c $(kern/elf.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -MD -c -o $@ $< --include elf_mod-kern_elf.d - -CLEANFILES += cmd-elf_mod-kern_elf.lst fs-elf_mod-kern_elf.lst partmap-elf_mod-kern_elf.lst -COMMANDFILES += cmd-elf_mod-kern_elf.lst -FSFILES += fs-elf_mod-kern_elf.lst -PARTMAPFILES += partmap-elf_mod-kern_elf.lst - -cmd-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh elf > $@ || (rm -f $@; exit 1) - -fs-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh elf > $@ || (rm -f $@; exit 1) - -partmap-elf_mod-kern_elf.lst: kern/elf.c $(kern/elf.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(elf_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh elf > $@ || (rm -f $@; exit 1) - - -elf_mod_CFLAGS = $(COMMON_CFLAGS) -elf_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For gzio.mod. -gzio_mod_SOURCES = io/gzio.c -CLEANFILES += gzio.mod mod-gzio.o mod-gzio.c pre-gzio.o gzio_mod-io_gzio.o und-gzio.lst -ifneq ($(gzio_mod_EXPORTS),no) -CLEANFILES += def-gzio.lst -DEFSYMFILES += def-gzio.lst -endif -MOSTLYCLEANFILES += gzio_mod-io_gzio.d -UNDSYMFILES += und-gzio.lst - -gzio.mod: pre-gzio.o mod-gzio.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o - -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gzio_mod-io_gzio.o - -mod-gzio.o: mod-gzio.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $< - -mod-gzio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(gzio_mod_EXPORTS),no) -def-gzio.lst: pre-gzio.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gzio/' > $@ -endif - -und-gzio.lst: pre-gzio.o - echo 'gzio' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -gzio_mod-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -MD -c -o $@ $< --include gzio_mod-io_gzio.d - -CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst partmap-gzio_mod-io_gzio.lst -COMMANDFILES += cmd-gzio_mod-io_gzio.lst -FSFILES += fs-gzio_mod-io_gzio.lst -PARTMAPFILES += partmap-gzio_mod-io_gzio.lst - -cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) - -fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) - -partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) - - -gzio_mod_CFLAGS = $(COMMON_CFLAGS) -gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For bufio.mod. -bufio_mod_SOURCES = io/bufio.c -CLEANFILES += bufio.mod mod-bufio.o mod-bufio.c pre-bufio.o bufio_mod-io_bufio.o und-bufio.lst -ifneq ($(bufio_mod_EXPORTS),no) -CLEANFILES += def-bufio.lst -DEFSYMFILES += def-bufio.lst -endif -MOSTLYCLEANFILES += bufio_mod-io_bufio.d -UNDSYMFILES += und-bufio.lst - -bufio.mod: pre-bufio.o mod-bufio.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(bufio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-bufio.o mod-bufio.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-bufio.o: $(bufio_mod_DEPENDENCIES) bufio_mod-io_bufio.o - -rm -f $@ - $(TARGET_CC) $(bufio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bufio_mod-io_bufio.o - -mod-bufio.o: mod-bufio.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -c -o $@ $< - -mod-bufio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'bufio' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(bufio_mod_EXPORTS),no) -def-bufio.lst: pre-bufio.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 bufio/' > $@ -endif - -und-bufio.lst: pre-bufio.o - echo 'bufio' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -bufio_mod-io_bufio.o: io/bufio.c $(io/bufio.c_DEPENDENCIES) - $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -MD -c -o $@ $< --include bufio_mod-io_bufio.d - -CLEANFILES += cmd-bufio_mod-io_bufio.lst fs-bufio_mod-io_bufio.lst partmap-bufio_mod-io_bufio.lst -COMMANDFILES += cmd-bufio_mod-io_bufio.lst -FSFILES += fs-bufio_mod-io_bufio.lst -PARTMAPFILES += partmap-bufio_mod-io_bufio.lst - -cmd-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bufio > $@ || (rm -f $@; exit 1) - -fs-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bufio > $@ || (rm -f $@; exit 1) - -partmap-bufio_mod-io_bufio.lst: io/bufio.c $(io/bufio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bufio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bufio > $@ || (rm -f $@; exit 1) - - -bufio_mod_CFLAGS = $(COMMON_CFLAGS) -bufio_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-coreboot.mk b/conf/i386-coreboot.mk deleted file mode 100644 index 169db9471..000000000 --- a/conf/i386-coreboot.mk +++ /dev/null @@ -1,2000 +0,0 @@ -# -*- makefile -*- -# Generated by genmk.rb, please don't edit! - -COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 -COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 -COMMON_LDFLAGS = -m32 -nostdlib - -# Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h - -# Images. -pkglib_PROGRAMS = kernel.elf - -# For kernel.elf. -kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ - kern/i386/coreboot/init.c \ - kern/i386/multiboot_mmap.c \ - kern/main.c kern/device.c \ - kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/i386/dl.c kern/parser.c kern/partition.c \ - kern/i386/tsc.c kern/i386/pit.c \ - kern/generic/rtc_get_time_ms.c \ - kern/generic/millisleep.c \ - kern/env.c \ - term/i386/pc/vga_text.c term/i386/vga_common.c \ - term/i386/pc/at_keyboard.c \ - symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_coreboot_startup.d kernel_elf-kern_i386_coreboot_init.d kernel_elf-kern_i386_multiboot_mmap.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_command.d kernel_elf-kern_corecmd.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_i386_tsc.d kernel_elf-kern_i386_pit.d kernel_elf-kern_generic_rtc_get_time_ms.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_env.d kernel_elf-term_i386_pc_vga_text.d kernel_elf-term_i386_vga_common.d kernel_elf-term_i386_pc_at_keyboard.d kernel_elf-symlist.d - -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_coreboot_startup.o kernel_elf-kern_i386_coreboot_init.o kernel_elf-kern_i386_multiboot_mmap.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_i386_tsc.o kernel_elf-kern_i386_pit.o kernel_elf-kern_generic_rtc_get_time_ms.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_env.o kernel_elf-term_i386_pc_vga_text.o kernel_elf-term_i386_vga_common.o kernel_elf-term_i386_pc_at_keyboard.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) - -kernel_elf-kern_i386_coreboot_startup.o: kern/i386/coreboot/startup.S $(kern/i386/coreboot/startup.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_coreboot_startup.d - -kernel_elf-kern_i386_coreboot_init.o: kern/i386/coreboot/init.c $(kern/i386/coreboot/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/coreboot -I$(srcdir)/kern/i386/coreboot $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_coreboot_init.d - -kernel_elf-kern_i386_multiboot_mmap.o: kern/i386/multiboot_mmap.c $(kern/i386/multiboot_mmap.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_multiboot_mmap.d - -kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_main.d - -kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_device.d - -kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_disk.d - -kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_dl.d - -kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_file.d - -kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_fs.d - -kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_err.d - -kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_misc.d - -kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_mm.d - -kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_loader.d - -kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_rescue.d - -kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_term.d - -kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_time.d - -kernel_elf-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_list.d - -kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_handler.d - -kernel_elf-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_command.d - -kernel_elf-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_corecmd.d - -kernel_elf-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_dl.d - -kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_parser.d - -kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_partition.d - -kernel_elf-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_tsc.d - -kernel_elf-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_pit.d - -kernel_elf-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_generic_rtc_get_time_ms.d - -kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_generic_millisleep.d - -kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_env.d - -kernel_elf-term_i386_pc_vga_text.o: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_i386_pc_vga_text.d - -kernel_elf-term_i386_vga_common.o: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_i386_vga_common.d - -kernel_elf-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_i386_pc_at_keyboard.d - -kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-symlist.d - -kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h list.h handler.h command.h -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic - -MOSTLYCLEANFILES += symlist.c kernel_syms.lst -DEFSYMFILES += kernel_syms.lst - -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh - /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh - /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# Utilities. -sbin_UTILITIES = grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif - -# For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d - -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) - -grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_grub_mkdevicemap.d - -grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_misc.d - - -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/echo.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/i386/cpuid.c \ - disk/host.c disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - fs/fshelp.c \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/datetime.c normal/main.c \ - normal/menu_text.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/misc.c normal/script.c \ - normal/color.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ - grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_datetime.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d grub_emu-grub_emu_init.d - -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_datetime.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) - -grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_minicmd.d - -grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cat.d - -grub_emu-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cmp.d - -grub_emu-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_configfile.d - -grub_emu-commands_echo.o: commands/echo.c $(commands/echo.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_echo.d - -grub_emu-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_help.d - -grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_handler.d - -grub_emu-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ls.d - -grub_emu-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_test.d - -grub_emu-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_search.d - -grub_emu-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_blocklist.d - -grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_hexdump.d - -grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_hexdump.d - -grub_emu-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_i386_cpuid.d - -grub_emu-disk_host.o: disk/host.c $(disk/host.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_host.d - -grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_loopback.d - -grub_emu-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_affs.d - -grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_cpio.d - -grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fat.d - -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - -grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfs.d - -grub_emu-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfsplus.d - -grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_iso9660.d - -grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_udf.d - -grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_jfs.d - -grub_emu-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_minix.d - -grub_emu-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfs.d - -grub_emu-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfscomp.d - -grub_emu-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_reiserfs.d - -grub_emu-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_sfs.d - -grub_emu-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ufs.d - -grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_xfs.d - -grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_afs.d - -grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_tar.d - -grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fshelp.d - -grub_emu-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-io_gzio.d - -grub_emu-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_device.d - -grub_emu-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_disk.d - -grub_emu-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_dl.d - -grub_emu-kern_elf.o: kern/elf.c $(kern/elf.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_elf.d - -grub_emu-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_env.d - -grub_emu-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_err.d - -grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_list.d - -grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_handler.d - -grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_command.d - -grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_corecmd.d - -grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_extcmd.d - -grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_execute.d - -grub_emu-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_file.d - -grub_emu-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_fs.d - -grub_emu-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_lexer.d - -grub_emu-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_loader.d - -grub_emu-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_main.d - -grub_emu-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_misc.d - -grub_emu-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_parser.d - -grub_emu-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_script_tab.d - -grub_emu-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_partition.d - -grub_emu-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_rescue.d - -grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_term.d - -grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_arg.d - -grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_cmdline.d - -grub_emu-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_command.d - -grub_emu-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_function.d - -grub_emu-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_completion.d - -grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_datetime.d - -grub_emu-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_main.d - -grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_text.d - -grub_emu-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu.d - -grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_entry.d - -grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_viewer.d - -grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_misc.d - -grub_emu-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_script.d - -grub_emu-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_color.d - -grub_emu-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_amiga.d - -grub_emu-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_apple.d - -grub_emu-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_pc.d - -grub_emu-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_sun.d - -grub_emu-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_acorn.d - -grub_emu-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_gpt.d - -grub_emu-util_console.o: util/console.c $(util/console.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_console.d - -grub_emu-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostfs.d - -grub_emu-util_grub_emu.o: util/grub-emu.c $(util/grub-emu.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_grub_emu.d - -grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_misc.d - -grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostdisk.d - -grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_getroot.d - -grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c $(util/i386/pc/misc.c_DEPENDENCIES) - $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_i386_pc_misc.d - -grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid.d - -grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid5_recover.d - -grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid6_recover.d - -grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_mdraid_linux.d - -grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_dmraid_nvidia.d - -grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_lvm.d - -grub_emu-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_parttool.d - -grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) - $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-parttool_pcpart.d - -grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_emu_init.d - - -grub_emu_LDFLAGS = $(LIBCURSES) - -sbin_SCRIPTS += grub-install -grub_install_SOURCES = util/i386/pc/grub-install.in -CLEANFILES += grub-install - -grub-install: util/i386/pc/grub-install.in $(util/i386/pc/grub-install.in_DEPENDENCIES) config.status - ./config.status --file=grub-install:util/i386/pc/grub-install.in - chmod +x $@ - - -# Modules. -pkglib_MODULES = linux.mod normal.mod multiboot.mod \ - aout.mod play.mod serial.mod ata.mod \ - memdisk.mod pci.mod lspci.mod reboot.mod \ - halt.mod datetime.mod date.mod datehook.mod \ - lsmmap.mod - -# For linux.mod. -linux_mod_SOURCES = loader/i386/linux.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_linux.o und-linux.lst -ifneq ($(linux_mod_EXPORTS),no) -CLEANFILES += def-linux.lst -DEFSYMFILES += def-linux.lst -endif -MOSTLYCLEANFILES += linux_mod-loader_i386_linux.d -UNDSYMFILES += und-linux.lst - -linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_linux.o - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_linux.o - -mod-linux.o: mod-linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< - -mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(linux_mod_EXPORTS),no) -def-linux.lst: pre-linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ -endif - -und-linux.lst: pre-linux.o - echo 'linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -linux_mod-loader_i386_linux.o: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_linux.d - -CLEANFILES += cmd-linux_mod-loader_i386_linux.lst fs-linux_mod-loader_i386_linux.lst partmap-linux_mod-loader_i386_linux.lst -COMMANDFILES += cmd-linux_mod-loader_i386_linux.lst -FSFILES += fs-linux_mod-loader_i386_linux.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_linux.lst - -cmd-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) - -fs-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) - -partmap-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) - - -linux_mod_CFLAGS = $(COMMON_CFLAGS) -linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst -ifneq ($(normal_mod_EXPORTS),no) -CLEANFILES += def-normal.lst -DEFSYMFILES += def-normal.lst -endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d -UNDSYMFILES += und-normal.lst - -normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -mod-normal.o: mod-normal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(normal_mod_EXPORTS),no) -def-normal.lst: pre-normal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ -endif - -und-normal.lst: pre-normal.o - echo 'normal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_cmdline.d - -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst -COMMANDFILES += cmd-normal_mod-normal_cmdline.lst -FSFILES += fs-normal_mod-normal_cmdline.lst -PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst - -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_command.d - -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst -COMMANDFILES += cmd-normal_mod-normal_command.lst -FSFILES += fs-normal_mod-normal_command.lst -PARTMAPFILES += partmap-normal_mod-normal_command.lst - -cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_completion.d - -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst -COMMANDFILES += cmd-normal_mod-normal_completion.lst -FSFILES += fs-normal_mod-normal_completion.lst -PARTMAPFILES += partmap-normal_mod-normal_completion.lst - -cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_datetime.d - -CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst -COMMANDFILES += cmd-normal_mod-normal_datetime.lst -FSFILES += fs-normal_mod-normal_datetime.lst -PARTMAPFILES += partmap-normal_mod-normal_datetime.lst - -cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_execute.d - -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst -COMMANDFILES += cmd-normal_mod-normal_execute.lst -FSFILES += fs-normal_mod-normal_execute.lst -PARTMAPFILES += partmap-normal_mod-normal_execute.lst - -cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_function.d - -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst -COMMANDFILES += cmd-normal_mod-normal_function.lst -FSFILES += fs-normal_mod-normal_function.lst -PARTMAPFILES += partmap-normal_mod-normal_function.lst - -cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_lexer.d - -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst -COMMANDFILES += cmd-normal_mod-normal_lexer.lst -FSFILES += fs-normal_mod-normal_lexer.lst -PARTMAPFILES += partmap-normal_mod-normal_lexer.lst - -cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_main.d - -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst -COMMANDFILES += cmd-normal_mod-normal_main.lst -FSFILES += fs-normal_mod-normal_main.lst -PARTMAPFILES += partmap-normal_mod-normal_main.lst - -cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu.d - -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst -COMMANDFILES += cmd-normal_mod-normal_menu.lst -FSFILES += fs-normal_mod-normal_menu.lst -PARTMAPFILES += partmap-normal_mod-normal_menu.lst - -cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_text.d - -CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst -COMMANDFILES += cmd-normal_mod-normal_menu_text.lst -FSFILES += fs-normal_mod-normal_menu_text.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst - -cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_viewer.d - -CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst -COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst -FSFILES += fs-normal_mod-normal_menu_viewer.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst - -cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_entry.d - -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst -COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst -FSFILES += fs-normal_mod-normal_menu_entry.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst - -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_misc.d - -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst -COMMANDFILES += cmd-normal_mod-normal_misc.lst -FSFILES += fs-normal_mod-normal_misc.lst -PARTMAPFILES += partmap-normal_mod-normal_misc.lst - -cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_script.d - -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst -COMMANDFILES += cmd-normal_mod-normal_script.lst -FSFILES += fs-normal_mod-normal_script.lst -PARTMAPFILES += partmap-normal_mod-normal_script.lst - -cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) - $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< --include normal_mod-normal_i386_setjmp.d - -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst -COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst -FSFILES += fs-normal_mod-normal_i386_setjmp.lst -PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst - -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod. -reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o reboot_mod-kern_i386_reboot.o und-reboot.lst -ifneq ($(reboot_mod_EXPORTS),no) -CLEANFILES += def-reboot.lst -DEFSYMFILES += def-reboot.lst -endif -MOSTLYCLEANFILES += reboot_mod-commands_reboot.d reboot_mod-kern_i386_reboot.d -UNDSYMFILES += und-reboot.lst - -reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o reboot_mod-kern_i386_reboot.o - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o reboot_mod-kern_i386_reboot.o - -mod-reboot.o: mod-reboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< - -mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reboot_mod_EXPORTS),no) -def-reboot.lst: pre-reboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ -endif - -und-reboot.lst: pre-reboot.o - echo 'reboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_reboot.d - -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_reboot.lst -FSFILES += fs-reboot_mod-commands_reboot.lst -PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst - -cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod-kern_i386_reboot.o: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-kern_i386_reboot.d - -CLEANFILES += cmd-reboot_mod-kern_i386_reboot.lst fs-reboot_mod-kern_i386_reboot.lst partmap-reboot_mod-kern_i386_reboot.lst -COMMANDFILES += cmd-reboot_mod-kern_i386_reboot.lst -FSFILES += fs-reboot_mod-kern_i386_reboot.lst -PARTMAPFILES += partmap-reboot_mod-kern_i386_reboot.lst - -cmd-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-kern_i386_reboot.lst: kern/i386/reboot.c $(kern/i386/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod_CFLAGS = $(COMMON_CFLAGS) -reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For halt.mod. -halt_mod_SOURCES = commands/halt.c kern/i386/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o halt_mod-kern_i386_halt.o und-halt.lst -ifneq ($(halt_mod_EXPORTS),no) -CLEANFILES += def-halt.lst -DEFSYMFILES += def-halt.lst -endif -MOSTLYCLEANFILES += halt_mod-commands_halt.d halt_mod-kern_i386_halt.d -UNDSYMFILES += und-halt.lst - -halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o halt_mod-kern_i386_halt.o - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o halt_mod-kern_i386_halt.o - -mod-halt.o: mod-halt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< - -mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(halt_mod_EXPORTS),no) -def-halt.lst: pre-halt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ -endif - -und-halt.lst: pre-halt.o - echo 'halt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_halt.d - -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst -COMMANDFILES += cmd-halt_mod-commands_halt.lst -FSFILES += fs-halt_mod-commands_halt.lst -PARTMAPFILES += partmap-halt_mod-commands_halt.lst - -cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod-kern_i386_halt.o: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-kern_i386_halt.d - -CLEANFILES += cmd-halt_mod-kern_i386_halt.lst fs-halt_mod-kern_i386_halt.lst partmap-halt_mod-kern_i386_halt.lst -COMMANDFILES += cmd-halt_mod-kern_i386_halt.lst -FSFILES += fs-halt_mod-kern_i386_halt.lst -PARTMAPFILES += partmap-halt_mod-kern_i386_halt.lst - -cmd-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-kern_i386_halt.lst: kern/i386/halt.c $(kern/i386/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod_CFLAGS = $(COMMON_CFLAGS) -halt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For serial.mod. -serial_mod_SOURCES = term/i386/pc/serial.c -CLEANFILES += serial.mod mod-serial.o mod-serial.c pre-serial.o serial_mod-term_i386_pc_serial.o und-serial.lst -ifneq ($(serial_mod_EXPORTS),no) -CLEANFILES += def-serial.lst -DEFSYMFILES += def-serial.lst -endif -MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d -UNDSYMFILES += und-serial.lst - -serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o - -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ serial_mod-term_i386_pc_serial.o - -mod-serial.o: mod-serial.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $< - -mod-serial.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(serial_mod_EXPORTS),no) -def-serial.lst: pre-serial.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 serial/' > $@ -endif - -und-serial.lst: pre-serial.o - echo 'serial' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< --include serial_mod-term_i386_pc_serial.d - -CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst partmap-serial_mod-term_i386_pc_serial.lst -COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst -FSFILES += fs-serial_mod-term_i386_pc_serial.lst -PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst - -cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) - -fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) - -partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) - - -serial_mod_CFLAGS = $(COMMON_CFLAGS) -serial_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod. -multiboot_mod_SOURCES = loader/i386/multiboot.c \ - loader/i386/multiboot_helper.S \ - loader/i386/pc/multiboot2.c \ - loader/multiboot2.c \ - loader/multiboot_loader.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst -ifneq ($(multiboot_mod_EXPORTS),no) -CLEANFILES += def-multiboot.lst -DEFSYMFILES += def-multiboot.lst -endif -MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_multiboot_helper.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-multiboot.lst - -multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -mod-multiboot.o: mod-multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< - -mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(multiboot_mod_EXPORTS),no) -def-multiboot.lst: pre-multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 multiboot/' > $@ -endif - -und-multiboot.lst: pre-multiboot.o - echo 'multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_i386_multiboot.d - -CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot.lst fs-multiboot_mod-loader_i386_multiboot.lst partmap-multiboot_mod-loader_i386_multiboot.lst -COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot.lst -FSFILES += fs-multiboot_mod-loader_i386_multiboot.lst -PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot.lst - -cmd-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_i386_multiboot_helper.d - -CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst fs-multiboot_mod-loader_i386_multiboot_helper.lst partmap-multiboot_mod-loader_i386_multiboot_helper.lst -COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst -FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst -PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst - -cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_i386_pc_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst fs-multiboot_mod-loader_i386_pc_multiboot2.lst partmap-multiboot_mod-loader_i386_pc_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_i386_pc_multiboot2.lst - -cmd-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst - -cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst - -cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) -multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) - -# For aout.mod. -aout_mod_SOURCES = loader/aout.c -CLEANFILES += aout.mod mod-aout.o mod-aout.c pre-aout.o aout_mod-loader_aout.o und-aout.lst -ifneq ($(aout_mod_EXPORTS),no) -CLEANFILES += def-aout.lst -DEFSYMFILES += def-aout.lst -endif -MOSTLYCLEANFILES += aout_mod-loader_aout.d -UNDSYMFILES += und-aout.lst - -aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o - -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ aout_mod-loader_aout.o - -mod-aout.o: mod-aout.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< - -mod-aout.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(aout_mod_EXPORTS),no) -def-aout.lst: pre-aout.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 aout/' > $@ -endif - -und-aout.lst: pre-aout.o - echo 'aout' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< --include aout_mod-loader_aout.d - -CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst partmap-aout_mod-loader_aout.lst -COMMANDFILES += cmd-aout_mod-loader_aout.lst -FSFILES += fs-aout_mod-loader_aout.lst -PARTMAPFILES += partmap-aout_mod-loader_aout.lst - -cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) - -fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) - -partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) - - -aout_mod_CFLAGS = $(COMMON_CFLAGS) -aout_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For play.mod. -play_mod_SOURCES = commands/i386/pc/play.c -CLEANFILES += play.mod mod-play.o mod-play.c pre-play.o play_mod-commands_i386_pc_play.o und-play.lst -ifneq ($(play_mod_EXPORTS),no) -CLEANFILES += def-play.lst -DEFSYMFILES += def-play.lst -endif -MOSTLYCLEANFILES += play_mod-commands_i386_pc_play.d -UNDSYMFILES += und-play.lst - -play.mod: pre-play.o mod-play.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o - -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ play_mod-commands_i386_pc_play.o - -mod-play.o: mod-play.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -c -o $@ $< - -mod-play.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'play' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(play_mod_EXPORTS),no) -def-play.lst: pre-play.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 play/' > $@ -endif - -und-play.lst: pre-play.o - echo 'play' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -MD -c -o $@ $< --include play_mod-commands_i386_pc_play.d - -CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_pc_play.lst partmap-play_mod-commands_i386_pc_play.lst -COMMANDFILES += cmd-play_mod-commands_i386_pc_play.lst -FSFILES += fs-play_mod-commands_i386_pc_play.lst -PARTMAPFILES += partmap-play_mod-commands_i386_pc_play.lst - -cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) - -fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) - -partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) - - -play_mod_CFLAGS = $(COMMON_CFLAGS) -play_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ata.mod. -ata_mod_SOURCES = disk/ata.c -CLEANFILES += ata.mod mod-ata.o mod-ata.c pre-ata.o ata_mod-disk_ata.o und-ata.lst -ifneq ($(ata_mod_EXPORTS),no) -CLEANFILES += def-ata.lst -DEFSYMFILES += def-ata.lst -endif -MOSTLYCLEANFILES += ata_mod-disk_ata.d -UNDSYMFILES += und-ata.lst - -ata.mod: pre-ata.o mod-ata.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o - -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ata_mod-disk_ata.o - -mod-ata.o: mod-ata.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -c -o $@ $< - -mod-ata.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ata' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ata_mod_EXPORTS),no) -def-ata.lst: pre-ata.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ata/' > $@ -endif - -und-ata.lst: pre-ata.o - echo 'ata' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ata_mod-disk_ata.o: disk/ata.c $(disk/ata.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $< --include ata_mod-disk_ata.d - -CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst partmap-ata_mod-disk_ata.lst -COMMANDFILES += cmd-ata_mod-disk_ata.lst -FSFILES += fs-ata_mod-disk_ata.lst -PARTMAPFILES += partmap-ata_mod-disk_ata.lst - -cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) - -fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) - -partmap-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) - - -ata_mod_CFLAGS = $(COMMON_CFLAGS) -ata_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For memdisk.mod. -memdisk_mod_SOURCES = disk/memdisk.c -CLEANFILES += memdisk.mod mod-memdisk.o mod-memdisk.c pre-memdisk.o memdisk_mod-disk_memdisk.o und-memdisk.lst -ifneq ($(memdisk_mod_EXPORTS),no) -CLEANFILES += def-memdisk.lst -DEFSYMFILES += def-memdisk.lst -endif -MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d -UNDSYMFILES += und-memdisk.lst - -memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memdisk_mod-disk_memdisk.o - -mod-memdisk.o: mod-memdisk.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< - -mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(memdisk_mod_EXPORTS),no) -def-memdisk.lst: pre-memdisk.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memdisk/' > $@ -endif - -und-memdisk.lst: pre-memdisk.o - echo 'memdisk' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< --include memdisk_mod-disk_memdisk.d - -CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst -COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst -FSFILES += fs-memdisk_mod-disk_memdisk.lst -PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst - -cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) - -fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) - -partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) - - -memdisk_mod_CFLAGS = $(COMMON_CFLAGS) -memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pci.mod -pci_mod_SOURCES = bus/pci.c -CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst -ifneq ($(pci_mod_EXPORTS),no) -CLEANFILES += def-pci.lst -DEFSYMFILES += def-pci.lst -endif -MOSTLYCLEANFILES += pci_mod-bus_pci.d -UNDSYMFILES += und-pci.lst - -pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o - -mod-pci.o: mod-pci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< - -mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pci_mod_EXPORTS),no) -def-pci.lst: pre-pci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ -endif - -und-pci.lst: pre-pci.o - echo 'pci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) - $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< --include pci_mod-bus_pci.d - -CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst -COMMANDFILES += cmd-pci_mod-bus_pci.lst -FSFILES += fs-pci_mod-bus_pci.lst -PARTMAPFILES += partmap-pci_mod-bus_pci.lst - -cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) - -fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) - -partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) - - -pci_mod_CFLAGS = $(COMMON_CFLAGS) -pci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lspci.mod -lspci_mod_SOURCES = commands/lspci.c -CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst -ifneq ($(lspci_mod_EXPORTS),no) -CLEANFILES += def-lspci.lst -DEFSYMFILES += def-lspci.lst -endif -MOSTLYCLEANFILES += lspci_mod-commands_lspci.d -UNDSYMFILES += und-lspci.lst - -lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o - -mod-lspci.o: mod-lspci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< - -mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lspci_mod_EXPORTS),no) -def-lspci.lst: pre-lspci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ -endif - -und-lspci.lst: pre-lspci.o - echo 'lspci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< --include lspci_mod-commands_lspci.d - -CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst -COMMANDFILES += cmd-lspci_mod-commands_lspci.lst -FSFILES += fs-lspci_mod-commands_lspci.lst -PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst - -cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) - -fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) - -partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) - - -lspci_mod_CFLAGS = $(COMMON_CFLAGS) -lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datetime.mod -datetime_mod_SOURCES = lib/i386/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst -ifneq ($(datetime_mod_EXPORTS),no) -CLEANFILES += def-datetime.lst -DEFSYMFILES += def-datetime.lst -endif -MOSTLYCLEANFILES += datetime_mod-lib_i386_datetime.d -UNDSYMFILES += und-datetime.lst - -datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_i386_datetime.o - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_i386_datetime.o - -mod-datetime.o: mod-datetime.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< - -mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datetime_mod_EXPORTS),no) -def-datetime.lst: pre-datetime.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ -endif - -und-datetime.lst: pre-datetime.o - echo 'datetime' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_i386_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_i386_datetime.lst fs-datetime_mod-lib_i386_datetime.lst partmap-datetime_mod-lib_i386_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_i386_datetime.lst -FSFILES += fs-datetime_mod-lib_i386_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst - -cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - -datetime_mod_CFLAGS = $(COMMON_CFLAGS) -datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For date.mod -date_mod_SOURCES = commands/date.c -CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst -ifneq ($(date_mod_EXPORTS),no) -CLEANFILES += def-date.lst -DEFSYMFILES += def-date.lst -endif -MOSTLYCLEANFILES += date_mod-commands_date.d -UNDSYMFILES += und-date.lst - -date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o - -mod-date.o: mod-date.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< - -mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(date_mod_EXPORTS),no) -def-date.lst: pre-date.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ -endif - -und-date.lst: pre-date.o - echo 'date' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< --include date_mod-commands_date.d - -CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst -COMMANDFILES += cmd-date_mod-commands_date.lst -FSFILES += fs-date_mod-commands_date.lst -PARTMAPFILES += partmap-date_mod-commands_date.lst - -cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) - -fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) - -partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) - - -date_mod_CFLAGS = $(COMMON_CFLAGS) -date_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datehook.mod -datehook_mod_SOURCES = hook/datehook.c -CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst -ifneq ($(datehook_mod_EXPORTS),no) -CLEANFILES += def-datehook.lst -DEFSYMFILES += def-datehook.lst -endif -MOSTLYCLEANFILES += datehook_mod-hook_datehook.d -UNDSYMFILES += und-datehook.lst - -datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o - -mod-datehook.o: mod-datehook.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< - -mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datehook_mod_EXPORTS),no) -def-datehook.lst: pre-datehook.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ -endif - -und-datehook.lst: pre-datehook.o - echo 'datehook' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) - $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< --include datehook_mod-hook_datehook.d - -CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst -COMMANDFILES += cmd-datehook_mod-hook_datehook.lst -FSFILES += fs-datehook_mod-hook_datehook.lst -PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst - -cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) - -fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) - -partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) - - -datehook_mod_CFLAGS = $(COMMON_CFLAGS) -datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lsmmap.mod -lsmmap_mod_SOURCES = commands/lsmmap.c -CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst -ifneq ($(lsmmap_mod_EXPORTS),no) -CLEANFILES += def-lsmmap.lst -DEFSYMFILES += def-lsmmap.lst -endif -MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d -UNDSYMFILES += und-lsmmap.lst - -lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o - -mod-lsmmap.o: mod-lsmmap.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< - -mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lsmmap_mod_EXPORTS),no) -def-lsmmap.lst: pre-lsmmap.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ -endif - -und-lsmmap.lst: pre-lsmmap.o - echo 'lsmmap' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< --include lsmmap_mod-commands_lsmmap.d - -CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst -COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst -FSFILES += fs-lsmmap_mod-commands_lsmmap.lst -PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst - -cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) - -fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) - -partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) - - -lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) -lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) - -include $(srcdir)/conf/i386.mk -include $(srcdir)/conf/common.mk diff --git a/conf/i386-efi.mk b/conf/i386-efi.mk deleted file mode 100644 index 455acc3a7..000000000 --- a/conf/i386-efi.mk +++ /dev/null @@ -1,1877 +0,0 @@ -# -*- makefile -*- -# Generated by genmk.rb, please don't edit! - -COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 -COMMON_CFLAGS = -fno-builtin -m32 -COMMON_LDFLAGS = -melf_i386 -nostdlib - -# Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h - -# Utilities. -bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-mkdevicemap -#ifeq ($(enable_grub_emu), yes) -#sbin_UTILITIES += grub-emu -#endif - -# For grub-mkimage. -grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ - util/resolve.c -CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o -MOSTLYCLEANFILES += grub_mkimage-util_i386_efi_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d - -grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o - $(CC) -o $@ grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) - -grub_mkimage-util_i386_efi_grub_mkimage.o: util/i386/efi/grub-mkimage.c $(util/i386/efi/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_i386_efi_grub_mkimage.d - -grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_misc.d - -grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_resolve.d - -util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile - -# For grub-setup. -#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ -# util/misc.c util/getroot.c kern/device.c kern/disk.c \ -# kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ -# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ -# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ -# kern/fs.c kern/env.c fs/fshelp.c - -# For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d - -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) - -grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_grub_mkdevicemap.d - -grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_misc.d - - -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c lib/hexdump.c \ - commands/halt.c commands/reboot.c \ - commands/i386/cpuid.c \ - disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c \ - normal/completion.c normal/context.c normal/main.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/menu_text.c \ - normal/misc.c normal/script.c \ - normal/color.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ - grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - -# Scripts. -sbin_SCRIPTS = grub-install - -# For grub-install. -grub_install_SOURCES = util/i386/efi/grub-install.in -CLEANFILES += grub-install - -grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPENDENCIES) config.status - ./config.status --file=grub-install:util/i386/efi/grub-install.in - chmod +x $@ - - -# Modules. -pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ - linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod - -# For kernel.mod. -kernel_mod_EXPORTS = no -kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ - kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ - kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - term/efi/console.c disk/efi/efidisk.c \ - kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/i386/tsc.c kern/i386/pit.c \ - kern/generic/rtc_get_time_ms.c \ - kern/generic/millisleep.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o und-kernel.lst -ifneq ($(kernel_mod_EXPORTS),no) -CLEANFILES += def-kernel.lst -DEFSYMFILES += def-kernel.lst -endif -MOSTLYCLEANFILES += kernel_mod-kern_i386_efi_startup.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_i386_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_command.d kernel_mod-kern_corecmd.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-kern_generic_millisleep.d -UNDSYMFILES += und-kernel.lst - -kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o - -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_i386_efi_startup.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_i386_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-kern_generic_millisleep.o - -mod-kernel.o: mod-kernel.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< - -mod-kernel.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'kernel' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(kernel_mod_EXPORTS),no) -def-kernel.lst: pre-kernel.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 kernel/' > $@ -endif - -und-kernel.lst: pre-kernel.o - echo 'kernel' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -kernel_mod-kern_i386_efi_startup.o: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_efi_startup.d - -CLEANFILES += cmd-kernel_mod-kern_i386_efi_startup.lst fs-kernel_mod-kern_i386_efi_startup.lst partmap-kernel_mod-kern_i386_efi_startup.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_efi_startup.lst -FSFILES += fs-kernel_mod-kern_i386_efi_startup.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_startup.lst - -cmd-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_efi_startup.lst: kern/i386/efi/startup.S $(kern/i386/efi/startup.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_main.d - -CLEANFILES += cmd-kernel_mod-kern_main.lst fs-kernel_mod-kern_main.lst partmap-kernel_mod-kern_main.lst -COMMANDFILES += cmd-kernel_mod-kern_main.lst -FSFILES += fs-kernel_mod-kern_main.lst -PARTMAPFILES += partmap-kernel_mod-kern_main.lst - -cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_device.d - -CLEANFILES += cmd-kernel_mod-kern_device.lst fs-kernel_mod-kern_device.lst partmap-kernel_mod-kern_device.lst -COMMANDFILES += cmd-kernel_mod-kern_device.lst -FSFILES += fs-kernel_mod-kern_device.lst -PARTMAPFILES += partmap-kernel_mod-kern_device.lst - -cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_disk.d - -CLEANFILES += cmd-kernel_mod-kern_disk.lst fs-kernel_mod-kern_disk.lst partmap-kernel_mod-kern_disk.lst -COMMANDFILES += cmd-kernel_mod-kern_disk.lst -FSFILES += fs-kernel_mod-kern_disk.lst -PARTMAPFILES += partmap-kernel_mod-kern_disk.lst - -cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_dl.d - -CLEANFILES += cmd-kernel_mod-kern_dl.lst fs-kernel_mod-kern_dl.lst partmap-kernel_mod-kern_dl.lst -COMMANDFILES += cmd-kernel_mod-kern_dl.lst -FSFILES += fs-kernel_mod-kern_dl.lst -PARTMAPFILES += partmap-kernel_mod-kern_dl.lst - -cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_file.d - -CLEANFILES += cmd-kernel_mod-kern_file.lst fs-kernel_mod-kern_file.lst partmap-kernel_mod-kern_file.lst -COMMANDFILES += cmd-kernel_mod-kern_file.lst -FSFILES += fs-kernel_mod-kern_file.lst -PARTMAPFILES += partmap-kernel_mod-kern_file.lst - -cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_fs.d - -CLEANFILES += cmd-kernel_mod-kern_fs.lst fs-kernel_mod-kern_fs.lst partmap-kernel_mod-kern_fs.lst -COMMANDFILES += cmd-kernel_mod-kern_fs.lst -FSFILES += fs-kernel_mod-kern_fs.lst -PARTMAPFILES += partmap-kernel_mod-kern_fs.lst - -cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_err.d - -CLEANFILES += cmd-kernel_mod-kern_err.lst fs-kernel_mod-kern_err.lst partmap-kernel_mod-kern_err.lst -COMMANDFILES += cmd-kernel_mod-kern_err.lst -FSFILES += fs-kernel_mod-kern_err.lst -PARTMAPFILES += partmap-kernel_mod-kern_err.lst - -cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_misc.d - -CLEANFILES += cmd-kernel_mod-kern_misc.lst fs-kernel_mod-kern_misc.lst partmap-kernel_mod-kern_misc.lst -COMMANDFILES += cmd-kernel_mod-kern_misc.lst -FSFILES += fs-kernel_mod-kern_misc.lst -PARTMAPFILES += partmap-kernel_mod-kern_misc.lst - -cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_mm.d - -CLEANFILES += cmd-kernel_mod-kern_mm.lst fs-kernel_mod-kern_mm.lst partmap-kernel_mod-kern_mm.lst -COMMANDFILES += cmd-kernel_mod-kern_mm.lst -FSFILES += fs-kernel_mod-kern_mm.lst -PARTMAPFILES += partmap-kernel_mod-kern_mm.lst - -cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_loader.d - -CLEANFILES += cmd-kernel_mod-kern_loader.lst fs-kernel_mod-kern_loader.lst partmap-kernel_mod-kern_loader.lst -COMMANDFILES += cmd-kernel_mod-kern_loader.lst -FSFILES += fs-kernel_mod-kern_loader.lst -PARTMAPFILES += partmap-kernel_mod-kern_loader.lst - -cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_rescue.d - -CLEANFILES += cmd-kernel_mod-kern_rescue.lst fs-kernel_mod-kern_rescue.lst partmap-kernel_mod-kern_rescue.lst -COMMANDFILES += cmd-kernel_mod-kern_rescue.lst -FSFILES += fs-kernel_mod-kern_rescue.lst -PARTMAPFILES += partmap-kernel_mod-kern_rescue.lst - -cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_term.d - -CLEANFILES += cmd-kernel_mod-kern_term.lst fs-kernel_mod-kern_term.lst partmap-kernel_mod-kern_term.lst -COMMANDFILES += cmd-kernel_mod-kern_term.lst -FSFILES += fs-kernel_mod-kern_term.lst -PARTMAPFILES += partmap-kernel_mod-kern_term.lst - -cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_dl.d - -CLEANFILES += cmd-kernel_mod-kern_i386_dl.lst fs-kernel_mod-kern_i386_dl.lst partmap-kernel_mod-kern_i386_dl.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_dl.lst -FSFILES += fs-kernel_mod-kern_i386_dl.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_dl.lst - -cmd-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_dl.lst: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_efi_init.d - -CLEANFILES += cmd-kernel_mod-kern_i386_efi_init.lst fs-kernel_mod-kern_i386_efi_init.lst partmap-kernel_mod-kern_i386_efi_init.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_efi_init.lst -FSFILES += fs-kernel_mod-kern_i386_efi_init.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_init.lst - -cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_parser.d - -CLEANFILES += cmd-kernel_mod-kern_parser.lst fs-kernel_mod-kern_parser.lst partmap-kernel_mod-kern_parser.lst -COMMANDFILES += cmd-kernel_mod-kern_parser.lst -FSFILES += fs-kernel_mod-kern_parser.lst -PARTMAPFILES += partmap-kernel_mod-kern_parser.lst - -cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_partition.d - -CLEANFILES += cmd-kernel_mod-kern_partition.lst fs-kernel_mod-kern_partition.lst partmap-kernel_mod-kern_partition.lst -COMMANDFILES += cmd-kernel_mod-kern_partition.lst -FSFILES += fs-kernel_mod-kern_partition.lst -PARTMAPFILES += partmap-kernel_mod-kern_partition.lst - -cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_env.d - -CLEANFILES += cmd-kernel_mod-kern_env.lst fs-kernel_mod-kern_env.lst partmap-kernel_mod-kern_env.lst -COMMANDFILES += cmd-kernel_mod-kern_env.lst -FSFILES += fs-kernel_mod-kern_env.lst -PARTMAPFILES += partmap-kernel_mod-kern_env.lst - -cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-symlist.d - -CLEANFILES += cmd-kernel_mod-symlist.lst fs-kernel_mod-symlist.lst partmap-kernel_mod-symlist.lst -COMMANDFILES += cmd-kernel_mod-symlist.lst -FSFILES += fs-kernel_mod-symlist.lst -PARTMAPFILES += partmap-kernel_mod-symlist.lst - -cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_efi_efi.o: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_efi_efi.d - -CLEANFILES += cmd-kernel_mod-kern_efi_efi.lst fs-kernel_mod-kern_efi_efi.lst partmap-kernel_mod-kern_efi_efi.lst -COMMANDFILES += cmd-kernel_mod-kern_efi_efi.lst -FSFILES += fs-kernel_mod-kern_efi_efi.lst -PARTMAPFILES += partmap-kernel_mod-kern_efi_efi.lst - -cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_efi_init.o: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_efi_init.d - -CLEANFILES += cmd-kernel_mod-kern_efi_init.lst fs-kernel_mod-kern_efi_init.lst partmap-kernel_mod-kern_efi_init.lst -COMMANDFILES += cmd-kernel_mod-kern_efi_init.lst -FSFILES += fs-kernel_mod-kern_efi_init.lst -PARTMAPFILES += partmap-kernel_mod-kern_efi_init.lst - -cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_efi_mm.o: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_efi_mm.d - -CLEANFILES += cmd-kernel_mod-kern_efi_mm.lst fs-kernel_mod-kern_efi_mm.lst partmap-kernel_mod-kern_efi_mm.lst -COMMANDFILES += cmd-kernel_mod-kern_efi_mm.lst -FSFILES += fs-kernel_mod-kern_efi_mm.lst -PARTMAPFILES += partmap-kernel_mod-kern_efi_mm.lst - -cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-term_efi_console.d - -CLEANFILES += cmd-kernel_mod-term_efi_console.lst fs-kernel_mod-term_efi_console.lst partmap-kernel_mod-term_efi_console.lst -COMMANDFILES += cmd-kernel_mod-term_efi_console.lst -FSFILES += fs-kernel_mod-term_efi_console.lst -PARTMAPFILES += partmap-kernel_mod-term_efi_console.lst - -cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-disk_efi_efidisk.d - -CLEANFILES += cmd-kernel_mod-disk_efi_efidisk.lst fs-kernel_mod-disk_efi_efidisk.lst partmap-kernel_mod-disk_efi_efidisk.lst -COMMANDFILES += cmd-kernel_mod-disk_efi_efidisk.lst -FSFILES += fs-kernel_mod-disk_efi_efidisk.lst -PARTMAPFILES += partmap-kernel_mod-disk_efi_efidisk.lst - -cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_time.d - -CLEANFILES += cmd-kernel_mod-kern_time.lst fs-kernel_mod-kern_time.lst partmap-kernel_mod-kern_time.lst -COMMANDFILES += cmd-kernel_mod-kern_time.lst -FSFILES += fs-kernel_mod-kern_time.lst -PARTMAPFILES += partmap-kernel_mod-kern_time.lst - -cmd-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_list.d - -CLEANFILES += cmd-kernel_mod-kern_list.lst fs-kernel_mod-kern_list.lst partmap-kernel_mod-kern_list.lst -COMMANDFILES += cmd-kernel_mod-kern_list.lst -FSFILES += fs-kernel_mod-kern_list.lst -PARTMAPFILES += partmap-kernel_mod-kern_list.lst - -cmd-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_handler.d - -CLEANFILES += cmd-kernel_mod-kern_handler.lst fs-kernel_mod-kern_handler.lst partmap-kernel_mod-kern_handler.lst -COMMANDFILES += cmd-kernel_mod-kern_handler.lst -FSFILES += fs-kernel_mod-kern_handler.lst -PARTMAPFILES += partmap-kernel_mod-kern_handler.lst - -cmd-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_command.d - -CLEANFILES += cmd-kernel_mod-kern_command.lst fs-kernel_mod-kern_command.lst partmap-kernel_mod-kern_command.lst -COMMANDFILES += cmd-kernel_mod-kern_command.lst -FSFILES += fs-kernel_mod-kern_command.lst -PARTMAPFILES += partmap-kernel_mod-kern_command.lst - -cmd-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_corecmd.d - -CLEANFILES += cmd-kernel_mod-kern_corecmd.lst fs-kernel_mod-kern_corecmd.lst partmap-kernel_mod-kern_corecmd.lst -COMMANDFILES += cmd-kernel_mod-kern_corecmd.lst -FSFILES += fs-kernel_mod-kern_corecmd.lst -PARTMAPFILES += partmap-kernel_mod-kern_corecmd.lst - -cmd-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_tsc.d - -CLEANFILES += cmd-kernel_mod-kern_i386_tsc.lst fs-kernel_mod-kern_i386_tsc.lst partmap-kernel_mod-kern_i386_tsc.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_tsc.lst -FSFILES += fs-kernel_mod-kern_i386_tsc.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_tsc.lst - -cmd-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_pit.d - -CLEANFILES += cmd-kernel_mod-kern_i386_pit.lst fs-kernel_mod-kern_i386_pit.lst partmap-kernel_mod-kern_i386_pit.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_pit.lst -FSFILES += fs-kernel_mod-kern_i386_pit.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_pit.lst - -cmd-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_generic_rtc_get_time_ms.d - -CLEANFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst fs-kernel_mod-kern_generic_rtc_get_time_ms.lst partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst -COMMANDFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst -FSFILES += fs-kernel_mod-kern_generic_rtc_get_time_ms.lst -PARTMAPFILES += partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst - -cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_generic_millisleep.d - -CLEANFILES += cmd-kernel_mod-kern_generic_millisleep.lst fs-kernel_mod-kern_generic_millisleep.lst partmap-kernel_mod-kern_generic_millisleep.lst -COMMANDFILES += cmd-kernel_mod-kern_generic_millisleep.lst -FSFILES += fs-kernel_mod-kern_generic_millisleep.lst -PARTMAPFILES += partmap-kernel_mod-kern_generic_millisleep.lst - -cmd-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h list.h handler.h command.h -kernel_mod_CFLAGS = $(COMMON_CFLAGS) -kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) -kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) - -MOSTLYCLEANFILES += symlist.c -MOSTLYCLEANFILES += symlist.c kernel_syms.lst -DEFSYMFILES += kernel_syms.lst - -symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh - /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh - /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst -ifneq ($(normal_mod_EXPORTS),no) -CLEANFILES += def-normal.lst -DEFSYMFILES += def-normal.lst -endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d -UNDSYMFILES += und-normal.lst - -normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -mod-normal.o: mod-normal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(normal_mod_EXPORTS),no) -def-normal.lst: pre-normal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ -endif - -und-normal.lst: pre-normal.o - echo 'normal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_cmdline.d - -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst -COMMANDFILES += cmd-normal_mod-normal_cmdline.lst -FSFILES += fs-normal_mod-normal_cmdline.lst -PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst - -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_command.d - -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst -COMMANDFILES += cmd-normal_mod-normal_command.lst -FSFILES += fs-normal_mod-normal_command.lst -PARTMAPFILES += partmap-normal_mod-normal_command.lst - -cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_completion.d - -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst -COMMANDFILES += cmd-normal_mod-normal_completion.lst -FSFILES += fs-normal_mod-normal_completion.lst -PARTMAPFILES += partmap-normal_mod-normal_completion.lst - -cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_datetime.d - -CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst -COMMANDFILES += cmd-normal_mod-normal_datetime.lst -FSFILES += fs-normal_mod-normal_datetime.lst -PARTMAPFILES += partmap-normal_mod-normal_datetime.lst - -cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_execute.d - -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst -COMMANDFILES += cmd-normal_mod-normal_execute.lst -FSFILES += fs-normal_mod-normal_execute.lst -PARTMAPFILES += partmap-normal_mod-normal_execute.lst - -cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_function.d - -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst -COMMANDFILES += cmd-normal_mod-normal_function.lst -FSFILES += fs-normal_mod-normal_function.lst -PARTMAPFILES += partmap-normal_mod-normal_function.lst - -cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_lexer.d - -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst -COMMANDFILES += cmd-normal_mod-normal_lexer.lst -FSFILES += fs-normal_mod-normal_lexer.lst -PARTMAPFILES += partmap-normal_mod-normal_lexer.lst - -cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_main.d - -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst -COMMANDFILES += cmd-normal_mod-normal_main.lst -FSFILES += fs-normal_mod-normal_main.lst -PARTMAPFILES += partmap-normal_mod-normal_main.lst - -cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu.d - -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst -COMMANDFILES += cmd-normal_mod-normal_menu.lst -FSFILES += fs-normal_mod-normal_menu.lst -PARTMAPFILES += partmap-normal_mod-normal_menu.lst - -cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_text.d - -CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst -COMMANDFILES += cmd-normal_mod-normal_menu_text.lst -FSFILES += fs-normal_mod-normal_menu_text.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst - -cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_viewer.d - -CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst -COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst -FSFILES += fs-normal_mod-normal_menu_viewer.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst - -cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_entry.d - -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst -COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst -FSFILES += fs-normal_mod-normal_menu_entry.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst - -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_misc.d - -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst -COMMANDFILES += cmd-normal_mod-normal_misc.lst -FSFILES += fs-normal_mod-normal_misc.lst -PARTMAPFILES += partmap-normal_mod-normal_misc.lst - -cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_script.d - -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst -COMMANDFILES += cmd-normal_mod-normal_script.lst -FSFILES += fs-normal_mod-normal_script.lst -PARTMAPFILES += partmap-normal_mod-normal_script.lst - -cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) - $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< --include normal_mod-normal_i386_setjmp.d - -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst -COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst -FSFILES += fs-normal_mod-normal_i386_setjmp.lst -PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst - -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For chain.mod. -chain_mod_SOURCES = loader/efi/chainloader.c -CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader.o und-chain.lst -ifneq ($(chain_mod_EXPORTS),no) -CLEANFILES += def-chain.lst -DEFSYMFILES += def-chain.lst -endif -MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader.d -UNDSYMFILES += und-chain.lst - -chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader.o - -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_efi_chainloader.o - -mod-chain.o: mod-chain.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< - -mod-chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(chain_mod_EXPORTS),no) -def-chain.lst: pre-chain.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 chain/' > $@ -endif - -und-chain.lst: pre-chain.o - echo 'chain' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< --include chain_mod-loader_efi_chainloader.d - -CLEANFILES += cmd-chain_mod-loader_efi_chainloader.lst fs-chain_mod-loader_efi_chainloader.lst partmap-chain_mod-loader_efi_chainloader.lst -COMMANDFILES += cmd-chain_mod-loader_efi_chainloader.lst -FSFILES += fs-chain_mod-loader_efi_chainloader.lst -PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader.lst - -cmd-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) - -fs-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) - -partmap-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) - - -chain_mod_CFLAGS = $(COMMON_CFLAGS) -chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For appleldr.mod. -appleldr_mod_SOURCES = loader/efi/appleloader.c -CLEANFILES += appleldr.mod mod-appleldr.o mod-appleldr.c pre-appleldr.o appleldr_mod-loader_efi_appleloader.o und-appleldr.lst -ifneq ($(appleldr_mod_EXPORTS),no) -CLEANFILES += def-appleldr.lst -DEFSYMFILES += def-appleldr.lst -endif -MOSTLYCLEANFILES += appleldr_mod-loader_efi_appleloader.d -UNDSYMFILES += und-appleldr.lst - -appleldr.mod: pre-appleldr.o mod-appleldr.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader.o - -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ appleldr_mod-loader_efi_appleloader.o - -mod-appleldr.o: mod-appleldr.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -c -o $@ $< - -mod-appleldr.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'appleldr' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(appleldr_mod_EXPORTS),no) -def-appleldr.lst: pre-appleldr.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 appleldr/' > $@ -endif - -und-appleldr.lst: pre-appleldr.o - echo 'appleldr' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -appleldr_mod-loader_efi_appleloader.o: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -MD -c -o $@ $< --include appleldr_mod-loader_efi_appleloader.d - -CLEANFILES += cmd-appleldr_mod-loader_efi_appleloader.lst fs-appleldr_mod-loader_efi_appleloader.lst partmap-appleldr_mod-loader_efi_appleloader.lst -COMMANDFILES += cmd-appleldr_mod-loader_efi_appleloader.lst -FSFILES += fs-appleldr_mod-loader_efi_appleloader.lst -PARTMAPFILES += partmap-appleldr_mod-loader_efi_appleloader.lst - -cmd-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) - -fs-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) - -partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) - - -appleldr_mod_CFLAGS = $(COMMON_CFLAGS) -appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For linux.mod. -linux_mod_SOURCES = loader/i386/efi/linux.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux.o und-linux.lst -ifneq ($(linux_mod_EXPORTS),no) -CLEANFILES += def-linux.lst -DEFSYMFILES += def-linux.lst -endif -MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux.d -UNDSYMFILES += und-linux.lst - -linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux.o - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_efi_linux.o - -mod-linux.o: mod-linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< - -mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(linux_mod_EXPORTS),no) -def-linux.lst: pre-linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ -endif - -und-linux.lst: pre-linux.o - echo 'linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_efi_linux.d - -CLEANFILES += cmd-linux_mod-loader_i386_efi_linux.lst fs-linux_mod-loader_i386_efi_linux.lst partmap-linux_mod-loader_i386_efi_linux.lst -COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux.lst -FSFILES += fs-linux_mod-loader_i386_efi_linux.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux.lst - -cmd-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) - -fs-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) - -partmap-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) - - -linux_mod_CFLAGS = $(COMMON_CFLAGS) -linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For halt.mod. -halt_mod_SOURCES = commands/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst -ifneq ($(halt_mod_EXPORTS),no) -CLEANFILES += def-halt.lst -DEFSYMFILES += def-halt.lst -endif -MOSTLYCLEANFILES += halt_mod-commands_halt.d -UNDSYMFILES += und-halt.lst - -halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o - -mod-halt.o: mod-halt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< - -mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(halt_mod_EXPORTS),no) -def-halt.lst: pre-halt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ -endif - -und-halt.lst: pre-halt.o - echo 'halt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_halt.d - -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst -COMMANDFILES += cmd-halt_mod-commands_halt.lst -FSFILES += fs-halt_mod-commands_halt.lst -PARTMAPFILES += partmap-halt_mod-commands_halt.lst - -cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod_CFLAGS = $(COMMON_CFLAGS) -halt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod. -reboot_mod_SOURCES = commands/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst -ifneq ($(reboot_mod_EXPORTS),no) -CLEANFILES += def-reboot.lst -DEFSYMFILES += def-reboot.lst -endif -MOSTLYCLEANFILES += reboot_mod-commands_reboot.d -UNDSYMFILES += und-reboot.lst - -reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o - -mod-reboot.o: mod-reboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< - -mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reboot_mod_EXPORTS),no) -def-reboot.lst: pre-reboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ -endif - -und-reboot.lst: pre-reboot.o - echo 'reboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_reboot.d - -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_reboot.lst -FSFILES += fs-reboot_mod-commands_reboot.lst -PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst - -cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod_CFLAGS = $(COMMON_CFLAGS) -reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pci.mod -pci_mod_SOURCES = bus/pci.c -CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst -ifneq ($(pci_mod_EXPORTS),no) -CLEANFILES += def-pci.lst -DEFSYMFILES += def-pci.lst -endif -MOSTLYCLEANFILES += pci_mod-bus_pci.d -UNDSYMFILES += und-pci.lst - -pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o - -mod-pci.o: mod-pci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< - -mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pci_mod_EXPORTS),no) -def-pci.lst: pre-pci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ -endif - -und-pci.lst: pre-pci.o - echo 'pci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) - $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< --include pci_mod-bus_pci.d - -CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst -COMMANDFILES += cmd-pci_mod-bus_pci.lst -FSFILES += fs-pci_mod-bus_pci.lst -PARTMAPFILES += partmap-pci_mod-bus_pci.lst - -cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) - -fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) - -partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) - - -pci_mod_CFLAGS = $(COMMON_CFLAGS) -pci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lspci.mod -lspci_mod_SOURCES = commands/lspci.c -CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst -ifneq ($(lspci_mod_EXPORTS),no) -CLEANFILES += def-lspci.lst -DEFSYMFILES += def-lspci.lst -endif -MOSTLYCLEANFILES += lspci_mod-commands_lspci.d -UNDSYMFILES += und-lspci.lst - -lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o - -mod-lspci.o: mod-lspci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< - -mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lspci_mod_EXPORTS),no) -def-lspci.lst: pre-lspci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ -endif - -und-lspci.lst: pre-lspci.o - echo 'lspci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< --include lspci_mod-commands_lspci.d - -CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst -COMMANDFILES += cmd-lspci_mod-commands_lspci.lst -FSFILES += fs-lspci_mod-commands_lspci.lst -PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst - -cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) - -fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) - -partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) - - -lspci_mod_CFLAGS = $(COMMON_CFLAGS) -lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datetime.mod -datetime_mod_SOURCES = lib/efi/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst -ifneq ($(datetime_mod_EXPORTS),no) -CLEANFILES += def-datetime.lst -DEFSYMFILES += def-datetime.lst -endif -MOSTLYCLEANFILES += datetime_mod-lib_efi_datetime.d -UNDSYMFILES += und-datetime.lst - -datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_efi_datetime.o - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_efi_datetime.o - -mod-datetime.o: mod-datetime.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< - -mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datetime_mod_EXPORTS),no) -def-datetime.lst: pre-datetime.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ -endif - -und-datetime.lst: pre-datetime.o - echo 'datetime' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_efi_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_efi_datetime.lst fs-datetime_mod-lib_efi_datetime.lst partmap-datetime_mod-lib_efi_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_efi_datetime.lst -FSFILES += fs-datetime_mod-lib_efi_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_efi_datetime.lst - -cmd-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - -datetime_mod_CFLAGS = $(COMMON_CFLAGS) -datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For date.mod -date_mod_SOURCES = commands/date.c -CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst -ifneq ($(date_mod_EXPORTS),no) -CLEANFILES += def-date.lst -DEFSYMFILES += def-date.lst -endif -MOSTLYCLEANFILES += date_mod-commands_date.d -UNDSYMFILES += und-date.lst - -date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o - -mod-date.o: mod-date.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< - -mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(date_mod_EXPORTS),no) -def-date.lst: pre-date.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ -endif - -und-date.lst: pre-date.o - echo 'date' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< --include date_mod-commands_date.d - -CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst -COMMANDFILES += cmd-date_mod-commands_date.lst -FSFILES += fs-date_mod-commands_date.lst -PARTMAPFILES += partmap-date_mod-commands_date.lst - -cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) - -fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) - -partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) - - -date_mod_CFLAGS = $(COMMON_CFLAGS) -date_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datehook.mod -datehook_mod_SOURCES = hook/datehook.c -CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst -ifneq ($(datehook_mod_EXPORTS),no) -CLEANFILES += def-datehook.lst -DEFSYMFILES += def-datehook.lst -endif -MOSTLYCLEANFILES += datehook_mod-hook_datehook.d -UNDSYMFILES += und-datehook.lst - -datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o - -mod-datehook.o: mod-datehook.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< - -mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datehook_mod_EXPORTS),no) -def-datehook.lst: pre-datehook.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ -endif - -und-datehook.lst: pre-datehook.o - echo 'datehook' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) - $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< --include datehook_mod-hook_datehook.d - -CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst -COMMANDFILES += cmd-datehook_mod-hook_datehook.lst -FSFILES += fs-datehook_mod-hook_datehook.lst -PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst - -cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) - -fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) - -partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) - - -datehook_mod_CFLAGS = $(COMMON_CFLAGS) -datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For loadbios.mod -loadbios_mod_SOURCES = commands/efi/loadbios.c -CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst -ifneq ($(loadbios_mod_EXPORTS),no) -CLEANFILES += def-loadbios.lst -DEFSYMFILES += def-loadbios.lst -endif -MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d -UNDSYMFILES += und-loadbios.lst - -loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o - -mod-loadbios.o: mod-loadbios.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< - -mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(loadbios_mod_EXPORTS),no) -def-loadbios.lst: pre-loadbios.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ -endif - -und-loadbios.lst: pre-loadbios.o - echo 'loadbios' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< --include loadbios_mod-commands_efi_loadbios.d - -CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst -COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst -FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst -PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst - -cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) - -fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) - -partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) - - -loadbios_mod_CFLAGS = $(COMMON_CFLAGS) -loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fixvideo.mod -fixvideo_mod_SOURCES = commands/efi/fixvideo.c -CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst -ifneq ($(fixvideo_mod_EXPORTS),no) -CLEANFILES += def-fixvideo.lst -DEFSYMFILES += def-fixvideo.lst -endif -MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d -UNDSYMFILES += und-fixvideo.lst - -fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o - -mod-fixvideo.o: mod-fixvideo.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< - -mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fixvideo_mod_EXPORTS),no) -def-fixvideo.lst: pre-fixvideo.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ -endif - -und-fixvideo.lst: pre-fixvideo.o - echo 'fixvideo' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< --include fixvideo_mod-commands_efi_fixvideo.d - -CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst -COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst -FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst -PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst - -cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) - -fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) - -partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) - - -fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) -fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) - -include $(srcdir)/conf/i386.mk -include $(srcdir)/conf/common.mk diff --git a/conf/i386-ieee1275.mk b/conf/i386-ieee1275.mk deleted file mode 100644 index 8c65e3bfd..000000000 --- a/conf/i386-ieee1275.mk +++ /dev/null @@ -1,1943 +0,0 @@ -# -*- makefile -*- -# Generated by genmk.rb, please don't edit! - -COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin -COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 -COMMON_LDFLAGS = -nostdlib -static -lgcc - -# Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h - -# Images. -pkglib_PROGRAMS = kernel.elf - -# For kernel.elf. -kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ - kern/ieee1275/init.c \ - kern/ieee1275/mmap.c \ - kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ - kern/main.c kern/device.c \ - kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/i386/dl.c kern/parser.c kern/partition.c \ - kern/env.c \ - kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/generic/millisleep.c \ - kern/ieee1275/ieee1275.c \ - term/ieee1275/ofconsole.c \ - disk/ieee1275/ofdisk.c \ - symlist.c -CLEANFILES += kernel.elf kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o -MOSTLYCLEANFILES += kernel_elf-kern_i386_ieee1275_startup.d kernel_elf-kern_i386_ieee1275_init.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_i386_dl.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_time.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_command.d kernel_elf-kern_corecmd.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-symlist.d - -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o - $(TARGET_CC) -o $@ kernel_elf-kern_i386_ieee1275_startup.o kernel_elf-kern_i386_ieee1275_init.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_i386_dl.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_time.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-symlist.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) - -kernel_elf-kern_i386_ieee1275_startup.o: kern/i386/ieee1275/startup.S $(kern/i386/ieee1275/startup.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_ieee1275_startup.d - -kernel_elf-kern_i386_ieee1275_init.o: kern/i386/ieee1275/init.c $(kern/i386/ieee1275/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/ieee1275 -I$(srcdir)/kern/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_ieee1275_init.d - -kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_init.d - -kernel_elf-kern_ieee1275_mmap.o: kern/ieee1275/mmap.c $(kern/ieee1275/mmap.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_mmap.d - -kernel_elf-kern_ieee1275_cmain.o: kern/ieee1275/cmain.c $(kern/ieee1275/cmain.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_cmain.d - -kernel_elf-kern_ieee1275_openfw.o: kern/ieee1275/openfw.c $(kern/ieee1275/openfw.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_openfw.d - -kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_main.d - -kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_device.d - -kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_disk.d - -kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_dl.d - -kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_file.d - -kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_fs.d - -kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_err.d - -kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_misc.d - -kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_mm.d - -kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_loader.d - -kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_rescue.d - -kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_term.d - -kernel_elf-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_i386_dl.d - -kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_parser.d - -kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_partition.d - -kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_env.d - -kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_time.d - -kernel_elf-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_list.d - -kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_handler.d - -kernel_elf-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_command.d - -kernel_elf-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_corecmd.d - -kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_generic_millisleep.d - -kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_ieee1275.d - -kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_ieee1275_ofconsole.d - -kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-disk_ieee1275_ofdisk.d - -kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-symlist.d - -kernel_elf_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ - list.h handler.h command.h -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic - -MOSTLYCLEANFILES += symlist.c kernel_syms.lst -DEFSYMFILES += kernel_syms.lst - -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh - /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh - /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# Utilities. -sbin_UTILITIES = grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif - -# For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d - -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) - -grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_grub_mkdevicemap.d - -grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_misc.d - - -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/echo.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/halt.c commands/reboot.c \ - commands/i386/cpuid.c \ - disk/host.c disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - fs/fshelp.c \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c\ - normal/completion.c normal/main.c normal/menu_text.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/misc.c normal/script.c \ - normal/color.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_menu_text.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-grub_emu_init.d - -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_menu_text.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) - -grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_minicmd.d - -grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cat.d - -grub_emu-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cmp.d - -grub_emu-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_configfile.d - -grub_emu-commands_echo.o: commands/echo.c $(commands/echo.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_echo.d - -grub_emu-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_help.d - -grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_handler.d - -grub_emu-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ls.d - -grub_emu-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_test.d - -grub_emu-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_search.d - -grub_emu-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_blocklist.d - -grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_hexdump.d - -grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_hexdump.d - -grub_emu-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_halt.d - -grub_emu-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_reboot.d - -grub_emu-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_i386_cpuid.d - -grub_emu-disk_host.o: disk/host.c $(disk/host.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_host.d - -grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_loopback.d - -grub_emu-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_affs.d - -grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_cpio.d - -grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fat.d - -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - -grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfs.d - -grub_emu-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfsplus.d - -grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_iso9660.d - -grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_udf.d - -grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_jfs.d - -grub_emu-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_minix.d - -grub_emu-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfs.d - -grub_emu-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfscomp.d - -grub_emu-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_reiserfs.d - -grub_emu-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_sfs.d - -grub_emu-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ufs.d - -grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_xfs.d - -grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_afs.d - -grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_tar.d - -grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fshelp.d - -grub_emu-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-io_gzio.d - -grub_emu-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_device.d - -grub_emu-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_disk.d - -grub_emu-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_dl.d - -grub_emu-kern_elf.o: kern/elf.c $(kern/elf.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_elf.d - -grub_emu-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_env.d - -grub_emu-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_err.d - -grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_list.d - -grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_handler.d - -grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_command.d - -grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_corecmd.d - -grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_extcmd.d - -grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_execute.d - -grub_emu-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_file.d - -grub_emu-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_fs.d - -grub_emu-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_lexer.d - -grub_emu-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_loader.d - -grub_emu-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_main.d - -grub_emu-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_misc.d - -grub_emu-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_parser.d - -grub_emu-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_script_tab.d - -grub_emu-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_partition.d - -grub_emu-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_rescue.d - -grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_term.d - -grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_arg.d - -grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_cmdline.d - -grub_emu-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_command.d - -grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_datetime.d - -grub_emu-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_function.d - -grub_emu-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_completion.d - -grub_emu-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_main.d - -grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_text.d - -grub_emu-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu.d - -grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_entry.d - -grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_viewer.d - -grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_misc.d - -grub_emu-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_script.d - -grub_emu-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_color.d - -grub_emu-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_amiga.d - -grub_emu-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_apple.d - -grub_emu-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_pc.d - -grub_emu-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_sun.d - -grub_emu-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_acorn.d - -grub_emu-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_gpt.d - -grub_emu-util_console.o: util/console.c $(util/console.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_console.d - -grub_emu-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostfs.d - -grub_emu-util_grub_emu.o: util/grub-emu.c $(util/grub-emu.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_grub_emu.d - -grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_misc.d - -grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostdisk.d - -grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_getroot.d - -grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c $(util/i386/pc/misc.c_DEPENDENCIES) - $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_i386_pc_misc.d - -grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid.d - -grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid5_recover.d - -grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid6_recover.d - -grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_mdraid_linux.d - -grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_dmraid_nvidia.d - -grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_lvm.d - -grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_emu_init.d - - -grub_emu_LDFLAGS = $(LIBCURSES) - -# Scripts. -sbin_SCRIPTS = grub-install - -# For grub-install. -grub_install_SOURCES = util/ieee1275/grub-install.in -CLEANFILES += grub-install - -grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPENDENCIES) config.status - ./config.status --file=grub-install:util/ieee1275/grub-install.in - chmod +x $@ - - -# Modules. -pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ - multiboot.mod aout.mod serial.mod linux.mod \ - nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ - date.mod datehook.mod lsmmap.mod - -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst -ifneq ($(normal_mod_EXPORTS),no) -CLEANFILES += def-normal.lst -DEFSYMFILES += def-normal.lst -endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d -UNDSYMFILES += und-normal.lst - -normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -mod-normal.o: mod-normal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(normal_mod_EXPORTS),no) -def-normal.lst: pre-normal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ -endif - -und-normal.lst: pre-normal.o - echo 'normal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_cmdline.d - -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst -COMMANDFILES += cmd-normal_mod-normal_cmdline.lst -FSFILES += fs-normal_mod-normal_cmdline.lst -PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst - -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_command.d - -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst -COMMANDFILES += cmd-normal_mod-normal_command.lst -FSFILES += fs-normal_mod-normal_command.lst -PARTMAPFILES += partmap-normal_mod-normal_command.lst - -cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_completion.d - -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst -COMMANDFILES += cmd-normal_mod-normal_completion.lst -FSFILES += fs-normal_mod-normal_completion.lst -PARTMAPFILES += partmap-normal_mod-normal_completion.lst - -cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_datetime.d - -CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst -COMMANDFILES += cmd-normal_mod-normal_datetime.lst -FSFILES += fs-normal_mod-normal_datetime.lst -PARTMAPFILES += partmap-normal_mod-normal_datetime.lst - -cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_execute.d - -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst -COMMANDFILES += cmd-normal_mod-normal_execute.lst -FSFILES += fs-normal_mod-normal_execute.lst -PARTMAPFILES += partmap-normal_mod-normal_execute.lst - -cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_function.d - -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst -COMMANDFILES += cmd-normal_mod-normal_function.lst -FSFILES += fs-normal_mod-normal_function.lst -PARTMAPFILES += partmap-normal_mod-normal_function.lst - -cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_lexer.d - -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst -COMMANDFILES += cmd-normal_mod-normal_lexer.lst -FSFILES += fs-normal_mod-normal_lexer.lst -PARTMAPFILES += partmap-normal_mod-normal_lexer.lst - -cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_main.d - -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst -COMMANDFILES += cmd-normal_mod-normal_main.lst -FSFILES += fs-normal_mod-normal_main.lst -PARTMAPFILES += partmap-normal_mod-normal_main.lst - -cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu.d - -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst -COMMANDFILES += cmd-normal_mod-normal_menu.lst -FSFILES += fs-normal_mod-normal_menu.lst -PARTMAPFILES += partmap-normal_mod-normal_menu.lst - -cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_text.d - -CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst -COMMANDFILES += cmd-normal_mod-normal_menu_text.lst -FSFILES += fs-normal_mod-normal_menu_text.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst - -cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_viewer.d - -CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst -COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst -FSFILES += fs-normal_mod-normal_menu_viewer.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst - -cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_entry.d - -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst -COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst -FSFILES += fs-normal_mod-normal_menu_entry.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst - -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_misc.d - -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst -COMMANDFILES += cmd-normal_mod-normal_misc.lst -FSFILES += fs-normal_mod-normal_misc.lst -PARTMAPFILES += partmap-normal_mod-normal_misc.lst - -cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_script.d - -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst -COMMANDFILES += cmd-normal_mod-normal_script.lst -FSFILES += fs-normal_mod-normal_script.lst -PARTMAPFILES += partmap-normal_mod-normal_script.lst - -cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) - $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< --include normal_mod-normal_i386_setjmp.d - -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst -COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst -FSFILES += fs-normal_mod-normal_i386_setjmp.lst -PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst - -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod. -multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ - loader/i386/multiboot_helper.S \ - loader/multiboot2.c \ - loader/multiboot_loader.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst -ifneq ($(multiboot_mod_EXPORTS),no) -CLEANFILES += def-multiboot.lst -DEFSYMFILES += def-multiboot.lst -endif -MOSTLYCLEANFILES += multiboot_mod-loader_ieee1275_multiboot2.d multiboot_mod-loader_i386_multiboot_helper.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-multiboot.lst - -multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -mod-multiboot.o: mod-multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< - -mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(multiboot_mod_EXPORTS),no) -def-multiboot.lst: pre-multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 multiboot/' > $@ -endif - -und-multiboot.lst: pre-multiboot.o - echo 'multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_ieee1275_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst fs-multiboot_mod-loader_ieee1275_multiboot2.lst partmap-multiboot_mod-loader_ieee1275_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_ieee1275_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_ieee1275_multiboot2.lst - -cmd-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_i386_multiboot_helper.d - -CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst fs-multiboot_mod-loader_i386_multiboot_helper.lst partmap-multiboot_mod-loader_i386_multiboot_helper.lst -COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst -FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst -PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst - -cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst - -cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst - -cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) -multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) - -# For aout.mod. -aout_mod_SOURCES = loader/aout.c -CLEANFILES += aout.mod mod-aout.o mod-aout.c pre-aout.o aout_mod-loader_aout.o und-aout.lst -ifneq ($(aout_mod_EXPORTS),no) -CLEANFILES += def-aout.lst -DEFSYMFILES += def-aout.lst -endif -MOSTLYCLEANFILES += aout_mod-loader_aout.d -UNDSYMFILES += und-aout.lst - -aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o - -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ aout_mod-loader_aout.o - -mod-aout.o: mod-aout.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< - -mod-aout.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(aout_mod_EXPORTS),no) -def-aout.lst: pre-aout.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 aout/' > $@ -endif - -und-aout.lst: pre-aout.o - echo 'aout' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< --include aout_mod-loader_aout.d - -CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst partmap-aout_mod-loader_aout.lst -COMMANDFILES += cmd-aout_mod-loader_aout.lst -FSFILES += fs-aout_mod-loader_aout.lst -PARTMAPFILES += partmap-aout_mod-loader_aout.lst - -cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) - -fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) - -partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) - - -aout_mod_CFLAGS = $(COMMON_CFLAGS) -aout_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For suspend.mod -suspend_mod_SOURCES = commands/ieee1275/suspend.c -CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o und-suspend.lst -ifneq ($(suspend_mod_EXPORTS),no) -CLEANFILES += def-suspend.lst -DEFSYMFILES += def-suspend.lst -endif -MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d -UNDSYMFILES += und-suspend.lst - -suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o - -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ suspend_mod-commands_ieee1275_suspend.o - -mod-suspend.o: mod-suspend.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $< - -mod-suspend.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(suspend_mod_EXPORTS),no) -def-suspend.lst: pre-suspend.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 suspend/' > $@ -endif - -und-suspend.lst: pre-suspend.o - echo 'suspend' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< --include suspend_mod-commands_ieee1275_suspend.d - -CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst partmap-suspend_mod-commands_ieee1275_suspend.lst -COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst -FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst -PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst - -cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) - -fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) - -partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) - - -suspend_mod_CFLAGS = $(COMMON_CFLAGS) -suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod -reboot_mod_SOURCES = commands/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst -ifneq ($(reboot_mod_EXPORTS),no) -CLEANFILES += def-reboot.lst -DEFSYMFILES += def-reboot.lst -endif -MOSTLYCLEANFILES += reboot_mod-commands_reboot.d -UNDSYMFILES += und-reboot.lst - -reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o - -mod-reboot.o: mod-reboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< - -mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reboot_mod_EXPORTS),no) -def-reboot.lst: pre-reboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ -endif - -und-reboot.lst: pre-reboot.o - echo 'reboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_reboot.d - -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_reboot.lst -FSFILES += fs-reboot_mod-commands_reboot.lst -PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst - -cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod_CFLAGS = $(COMMON_CFLAGS) -reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For halt.mod -halt_mod_SOURCES = commands/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst -ifneq ($(halt_mod_EXPORTS),no) -CLEANFILES += def-halt.lst -DEFSYMFILES += def-halt.lst -endif -MOSTLYCLEANFILES += halt_mod-commands_halt.d -UNDSYMFILES += und-halt.lst - -halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o - -mod-halt.o: mod-halt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< - -mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(halt_mod_EXPORTS),no) -def-halt.lst: pre-halt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ -endif - -und-halt.lst: pre-halt.o - echo 'halt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_halt.d - -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst -COMMANDFILES += cmd-halt_mod-commands_halt.lst -FSFILES += fs-halt_mod-commands_halt.lst -PARTMAPFILES += partmap-halt_mod-commands_halt.lst - -cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod_CFLAGS = $(COMMON_CFLAGS) -halt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For serial.mod. -serial_mod_SOURCES = term/i386/pc/serial.c -CLEANFILES += serial.mod mod-serial.o mod-serial.c pre-serial.o serial_mod-term_i386_pc_serial.o und-serial.lst -ifneq ($(serial_mod_EXPORTS),no) -CLEANFILES += def-serial.lst -DEFSYMFILES += def-serial.lst -endif -MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d -UNDSYMFILES += und-serial.lst - -serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o - -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ serial_mod-term_i386_pc_serial.o - -mod-serial.o: mod-serial.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $< - -mod-serial.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(serial_mod_EXPORTS),no) -def-serial.lst: pre-serial.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 serial/' > $@ -endif - -und-serial.lst: pre-serial.o - echo 'serial' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< --include serial_mod-term_i386_pc_serial.d - -CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst partmap-serial_mod-term_i386_pc_serial.lst -COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst -FSFILES += fs-serial_mod-term_i386_pc_serial.lst -PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst - -cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) - -fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) - -partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) - - -serial_mod_CFLAGS = $(COMMON_CFLAGS) -serial_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For linux.mod. -linux_mod_SOURCES = loader/i386/ieee1275/linux.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_ieee1275_linux.o und-linux.lst -ifneq ($(linux_mod_EXPORTS),no) -CLEANFILES += def-linux.lst -DEFSYMFILES += def-linux.lst -endif -MOSTLYCLEANFILES += linux_mod-loader_i386_ieee1275_linux.d -UNDSYMFILES += und-linux.lst - -linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_ieee1275_linux.o - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_ieee1275_linux.o - -mod-linux.o: mod-linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< - -mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(linux_mod_EXPORTS),no) -def-linux.lst: pre-linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ -endif - -und-linux.lst: pre-linux.o - echo 'linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -linux_mod-loader_i386_ieee1275_linux.o: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_ieee1275_linux.d - -CLEANFILES += cmd-linux_mod-loader_i386_ieee1275_linux.lst fs-linux_mod-loader_i386_ieee1275_linux.lst partmap-linux_mod-loader_i386_ieee1275_linux.lst -COMMANDFILES += cmd-linux_mod-loader_i386_ieee1275_linux.lst -FSFILES += fs-linux_mod-loader_i386_ieee1275_linux.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_ieee1275_linux.lst - -cmd-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) - -fs-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) - -partmap-linux_mod-loader_i386_ieee1275_linux.lst: loader/i386/ieee1275/linux.c $(loader/i386/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/ieee1275 -I$(srcdir)/loader/i386/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) - - -linux_mod_CFLAGS = $(COMMON_CFLAGS) -linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For nand.mod. -nand_mod_SOURCES = disk/ieee1275/nand.c -CLEANFILES += nand.mod mod-nand.o mod-nand.c pre-nand.o nand_mod-disk_ieee1275_nand.o und-nand.lst -ifneq ($(nand_mod_EXPORTS),no) -CLEANFILES += def-nand.lst -DEFSYMFILES += def-nand.lst -endif -MOSTLYCLEANFILES += nand_mod-disk_ieee1275_nand.d -UNDSYMFILES += und-nand.lst - -nand.mod: pre-nand.o mod-nand.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-nand.o mod-nand.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-nand.o: $(nand_mod_DEPENDENCIES) nand_mod-disk_ieee1275_nand.o - -rm -f $@ - $(TARGET_CC) $(nand_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ nand_mod-disk_ieee1275_nand.o - -mod-nand.o: mod-nand.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -c -o $@ $< - -mod-nand.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'nand' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(nand_mod_EXPORTS),no) -def-nand.lst: pre-nand.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 nand/' > $@ -endif - -und-nand.lst: pre-nand.o - echo 'nand' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -nand_mod-disk_ieee1275_nand.o: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) - $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -MD -c -o $@ $< --include nand_mod-disk_ieee1275_nand.d - -CLEANFILES += cmd-nand_mod-disk_ieee1275_nand.lst fs-nand_mod-disk_ieee1275_nand.lst partmap-nand_mod-disk_ieee1275_nand.lst -COMMANDFILES += cmd-nand_mod-disk_ieee1275_nand.lst -FSFILES += fs-nand_mod-disk_ieee1275_nand.lst -PARTMAPFILES += partmap-nand_mod-disk_ieee1275_nand.lst - -cmd-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh nand > $@ || (rm -f $@; exit 1) - -fs-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh nand > $@ || (rm -f $@; exit 1) - -partmap-nand_mod-disk_ieee1275_nand.lst: disk/ieee1275/nand.c $(disk/ieee1275/nand.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(nand_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh nand > $@ || (rm -f $@; exit 1) - - -nand_mod_CFLAGS = $(COMMON_CFLAGS) -nand_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For memdisk.mod. -memdisk_mod_SOURCES = disk/memdisk.c -CLEANFILES += memdisk.mod mod-memdisk.o mod-memdisk.c pre-memdisk.o memdisk_mod-disk_memdisk.o und-memdisk.lst -ifneq ($(memdisk_mod_EXPORTS),no) -CLEANFILES += def-memdisk.lst -DEFSYMFILES += def-memdisk.lst -endif -MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d -UNDSYMFILES += und-memdisk.lst - -memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memdisk_mod-disk_memdisk.o - -mod-memdisk.o: mod-memdisk.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< - -mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(memdisk_mod_EXPORTS),no) -def-memdisk.lst: pre-memdisk.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memdisk/' > $@ -endif - -und-memdisk.lst: pre-memdisk.o - echo 'memdisk' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< --include memdisk_mod-disk_memdisk.d - -CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst -COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst -FSFILES += fs-memdisk_mod-disk_memdisk.lst -PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst - -cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) - -fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) - -partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) - - -memdisk_mod_CFLAGS = $(COMMON_CFLAGS) -memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pci.mod -pci_mod_SOURCES = bus/pci.c -CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst -ifneq ($(pci_mod_EXPORTS),no) -CLEANFILES += def-pci.lst -DEFSYMFILES += def-pci.lst -endif -MOSTLYCLEANFILES += pci_mod-bus_pci.d -UNDSYMFILES += und-pci.lst - -pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o - -mod-pci.o: mod-pci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< - -mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pci_mod_EXPORTS),no) -def-pci.lst: pre-pci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ -endif - -und-pci.lst: pre-pci.o - echo 'pci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) - $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< --include pci_mod-bus_pci.d - -CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst -COMMANDFILES += cmd-pci_mod-bus_pci.lst -FSFILES += fs-pci_mod-bus_pci.lst -PARTMAPFILES += partmap-pci_mod-bus_pci.lst - -cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) - -fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) - -partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) - - -pci_mod_CFLAGS = $(COMMON_CFLAGS) -pci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lspci.mod -lspci_mod_SOURCES = commands/lspci.c -CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst -ifneq ($(lspci_mod_EXPORTS),no) -CLEANFILES += def-lspci.lst -DEFSYMFILES += def-lspci.lst -endif -MOSTLYCLEANFILES += lspci_mod-commands_lspci.d -UNDSYMFILES += und-lspci.lst - -lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o - -mod-lspci.o: mod-lspci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< - -mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lspci_mod_EXPORTS),no) -def-lspci.lst: pre-lspci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ -endif - -und-lspci.lst: pre-lspci.o - echo 'lspci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< --include lspci_mod-commands_lspci.d - -CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst -COMMANDFILES += cmd-lspci_mod-commands_lspci.lst -FSFILES += fs-lspci_mod-commands_lspci.lst -PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst - -cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) - -fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) - -partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) - - -lspci_mod_CFLAGS = $(COMMON_CFLAGS) -lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datetime.mod -datetime_mod_SOURCES = lib/i386/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst -ifneq ($(datetime_mod_EXPORTS),no) -CLEANFILES += def-datetime.lst -DEFSYMFILES += def-datetime.lst -endif -MOSTLYCLEANFILES += datetime_mod-lib_i386_datetime.d -UNDSYMFILES += und-datetime.lst - -datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_i386_datetime.o - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_i386_datetime.o - -mod-datetime.o: mod-datetime.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< - -mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datetime_mod_EXPORTS),no) -def-datetime.lst: pre-datetime.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ -endif - -und-datetime.lst: pre-datetime.o - echo 'datetime' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_i386_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_i386_datetime.lst fs-datetime_mod-lib_i386_datetime.lst partmap-datetime_mod-lib_i386_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_i386_datetime.lst -FSFILES += fs-datetime_mod-lib_i386_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst - -cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - -datetime_mod_CFLAGS = $(COMMON_CFLAGS) -datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For date.mod -date_mod_SOURCES = commands/date.c -CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst -ifneq ($(date_mod_EXPORTS),no) -CLEANFILES += def-date.lst -DEFSYMFILES += def-date.lst -endif -MOSTLYCLEANFILES += date_mod-commands_date.d -UNDSYMFILES += und-date.lst - -date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o - -mod-date.o: mod-date.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< - -mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(date_mod_EXPORTS),no) -def-date.lst: pre-date.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ -endif - -und-date.lst: pre-date.o - echo 'date' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< --include date_mod-commands_date.d - -CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst -COMMANDFILES += cmd-date_mod-commands_date.lst -FSFILES += fs-date_mod-commands_date.lst -PARTMAPFILES += partmap-date_mod-commands_date.lst - -cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) - -fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) - -partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) - - -date_mod_CFLAGS = $(COMMON_CFLAGS) -date_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datehook.mod -datehook_mod_SOURCES = hook/datehook.c -CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst -ifneq ($(datehook_mod_EXPORTS),no) -CLEANFILES += def-datehook.lst -DEFSYMFILES += def-datehook.lst -endif -MOSTLYCLEANFILES += datehook_mod-hook_datehook.d -UNDSYMFILES += und-datehook.lst - -datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o - -mod-datehook.o: mod-datehook.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< - -mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datehook_mod_EXPORTS),no) -def-datehook.lst: pre-datehook.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ -endif - -und-datehook.lst: pre-datehook.o - echo 'datehook' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) - $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< --include datehook_mod-hook_datehook.d - -CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst -COMMANDFILES += cmd-datehook_mod-hook_datehook.lst -FSFILES += fs-datehook_mod-hook_datehook.lst -PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst - -cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) - -fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) - -partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) - - -datehook_mod_CFLAGS = $(COMMON_CFLAGS) -datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lsmmap.mod -lsmmap_mod_SOURCES = commands/lsmmap.c -CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst -ifneq ($(lsmmap_mod_EXPORTS),no) -CLEANFILES += def-lsmmap.lst -DEFSYMFILES += def-lsmmap.lst -endif -MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d -UNDSYMFILES += und-lsmmap.lst - -lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o - -mod-lsmmap.o: mod-lsmmap.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< - -mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lsmmap_mod_EXPORTS),no) -def-lsmmap.lst: pre-lsmmap.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ -endif - -und-lsmmap.lst: pre-lsmmap.o - echo 'lsmmap' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< --include lsmmap_mod-commands_lsmmap.d - -CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst -COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst -FSFILES += fs-lsmmap_mod-commands_lsmmap.lst -PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst - -cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) - -fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) - -partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) - - -lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) -lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) - -include $(srcdir)/conf/i386.mk -include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.mk b/conf/i386-pc.mk deleted file mode 100644 index 2a139894d..000000000 --- a/conf/i386-pc.mk +++ /dev/null @@ -1,3496 +0,0 @@ -# -*- makefile -*- -# Generated by genmk.rb, please don't edit! - -GRUB_MEMORY_MACHINE_LINK_ADDR = 0x8200 - -COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 -COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 -COMMON_LDFLAGS = -m32 -nostdlib - -# Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h - -# Images. -pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ - cdboot.img - -# For boot.img. -boot_img_SOURCES = boot/i386/pc/boot.S -CLEANFILES += boot.img boot.exec boot_img-boot_i386_pc_boot.o -MOSTLYCLEANFILES += boot_img-boot_i386_pc_boot.d - -boot.img: boot.exec - $(OBJCOPY) -O $(boot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ - -boot.exec: boot_img-boot_i386_pc_boot.o - $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(boot_img_LDFLAGS) - -boot_img-boot_i386_pc_boot.o: boot/i386/pc/boot.S $(boot/i386/pc/boot.S_DEPENDENCIES) - $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(boot_img_ASFLAGS) -MD -c -o $@ $< --include boot_img-boot_i386_pc_boot.d - -boot_img_ASFLAGS = $(COMMON_ASFLAGS) -boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 -boot_img_FORMAT = binary - -# For pxeboot.img -pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S -CLEANFILES += pxeboot.img pxeboot.exec pxeboot_img-boot_i386_pc_pxeboot.o -MOSTLYCLEANFILES += pxeboot_img-boot_i386_pc_pxeboot.d - -pxeboot.img: pxeboot.exec - $(OBJCOPY) -O $(pxeboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ - -pxeboot.exec: pxeboot_img-boot_i386_pc_pxeboot.o - $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(pxeboot_img_LDFLAGS) - -pxeboot_img-boot_i386_pc_pxeboot.o: boot/i386/pc/pxeboot.S $(boot/i386/pc/pxeboot.S_DEPENDENCIES) - $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(pxeboot_img_ASFLAGS) -MD -c -o $@ $< --include pxeboot_img-boot_i386_pc_pxeboot.d - -pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) -pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 -pxeboot_img_FORMAT = binary - -# For diskboot.img. -diskboot_img_SOURCES = boot/i386/pc/diskboot.S -CLEANFILES += diskboot.img diskboot.exec diskboot_img-boot_i386_pc_diskboot.o -MOSTLYCLEANFILES += diskboot_img-boot_i386_pc_diskboot.d - -diskboot.img: diskboot.exec - $(OBJCOPY) -O $(diskboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ - -diskboot.exec: diskboot_img-boot_i386_pc_diskboot.o - $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(diskboot_img_LDFLAGS) - -diskboot_img-boot_i386_pc_diskboot.o: boot/i386/pc/diskboot.S $(boot/i386/pc/diskboot.S_DEPENDENCIES) - $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(diskboot_img_ASFLAGS) -MD -c -o $@ $< --include diskboot_img-boot_i386_pc_diskboot.d - -diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) -diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000 -diskboot_img_FORMAT = binary - -# For lnxboot.img. -lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S -CLEANFILES += lnxboot.img lnxboot.exec lnxboot_img-boot_i386_pc_lnxboot.o -MOSTLYCLEANFILES += lnxboot_img-boot_i386_pc_lnxboot.d - -lnxboot.img: lnxboot.exec - $(OBJCOPY) -O $(lnxboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ - -lnxboot.exec: lnxboot_img-boot_i386_pc_lnxboot.o - $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(lnxboot_img_LDFLAGS) - -lnxboot_img-boot_i386_pc_lnxboot.o: boot/i386/pc/lnxboot.S $(boot/i386/pc/lnxboot.S_DEPENDENCIES) - $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(lnxboot_img_ASFLAGS) -MD -c -o $@ $< --include lnxboot_img-boot_i386_pc_lnxboot.d - -lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) -lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000 -lnxboot_img_FORMAT = binary - -# For cdboot.img. -cdboot_img_SOURCES = boot/i386/pc/cdboot.S -CLEANFILES += cdboot.img cdboot.exec cdboot_img-boot_i386_pc_cdboot.o -MOSTLYCLEANFILES += cdboot_img-boot_i386_pc_cdboot.d - -cdboot.img: cdboot.exec - $(OBJCOPY) -O $(cdboot_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ - -cdboot.exec: cdboot_img-boot_i386_pc_cdboot.o - $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(cdboot_img_LDFLAGS) - -cdboot_img-boot_i386_pc_cdboot.o: boot/i386/pc/cdboot.S $(boot/i386/pc/cdboot.S_DEPENDENCIES) - $(TARGET_CC) -Iboot/i386/pc -I$(srcdir)/boot/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(cdboot_img_ASFLAGS) -MD -c -o $@ $< --include cdboot_img-boot_i386_pc_cdboot.d - -cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) -cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 -cdboot_img_FORMAT = binary - -# For kernel.img. -kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ - kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ - kern/parser.c kern/partition.c \ - kern/i386/tsc.c kern/i386/pit.c \ - kern/generic/rtc_get_time_ms.c \ - kern/generic/millisleep.c \ - kern/env.c \ - term/i386/pc/console.c term/i386/vga_common.c \ - symlist.c -CLEANFILES += kernel.img kernel.exec kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_command.o kernel_img-kern_corecmd.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o -MOSTLYCLEANFILES += kernel_img-kern_i386_pc_startup.d kernel_img-kern_main.d kernel_img-kern_device.d kernel_img-kern_disk.d kernel_img-kern_dl.d kernel_img-kern_file.d kernel_img-kern_fs.d kernel_img-kern_err.d kernel_img-kern_misc.d kernel_img-kern_mm.d kernel_img-kern_loader.d kernel_img-kern_rescue.d kernel_img-kern_term.d kernel_img-kern_time.d kernel_img-kern_list.d kernel_img-kern_handler.d kernel_img-kern_command.d kernel_img-kern_corecmd.d kernel_img-kern_i386_dl.d kernel_img-kern_i386_pc_init.d kernel_img-kern_i386_pc_mmap.d kernel_img-kern_parser.d kernel_img-kern_partition.d kernel_img-kern_i386_tsc.d kernel_img-kern_i386_pit.d kernel_img-kern_generic_rtc_get_time_ms.d kernel_img-kern_generic_millisleep.d kernel_img-kern_env.d kernel_img-term_i386_pc_console.d kernel_img-term_i386_vga_common.d kernel_img-symlist.d - -kernel.img: kernel.exec - $(OBJCOPY) -O $(kernel_img_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ - -kernel.exec: kernel_img-kern_i386_pc_startup.o kernel_img-kern_main.o kernel_img-kern_device.o kernel_img-kern_disk.o kernel_img-kern_dl.o kernel_img-kern_file.o kernel_img-kern_fs.o kernel_img-kern_err.o kernel_img-kern_misc.o kernel_img-kern_mm.o kernel_img-kern_loader.o kernel_img-kern_rescue.o kernel_img-kern_term.o kernel_img-kern_time.o kernel_img-kern_list.o kernel_img-kern_handler.o kernel_img-kern_command.o kernel_img-kern_corecmd.o kernel_img-kern_i386_dl.o kernel_img-kern_i386_pc_init.o kernel_img-kern_i386_pc_mmap.o kernel_img-kern_parser.o kernel_img-kern_partition.o kernel_img-kern_i386_tsc.o kernel_img-kern_i386_pit.o kernel_img-kern_generic_rtc_get_time_ms.o kernel_img-kern_generic_millisleep.o kernel_img-kern_env.o kernel_img-term_i386_pc_console.o kernel_img-term_i386_vga_common.o kernel_img-symlist.o - $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(kernel_img_LDFLAGS) - -kernel_img-kern_i386_pc_startup.o: kern/i386/pc/startup.S $(kern/i386/pc/startup.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_img_ASFLAGS) -MD -c -o $@ $< --include kernel_img-kern_i386_pc_startup.d - -kernel_img-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_main.d - -kernel_img-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_device.d - -kernel_img-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_disk.d - -kernel_img-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_dl.d - -kernel_img-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_file.d - -kernel_img-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_fs.d - -kernel_img-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_err.d - -kernel_img-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_misc.d - -kernel_img-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_mm.d - -kernel_img-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_loader.d - -kernel_img-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_rescue.d - -kernel_img-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_term.d - -kernel_img-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_time.d - -kernel_img-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_list.d - -kernel_img-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_handler.d - -kernel_img-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_command.d - -kernel_img-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_corecmd.d - -kernel_img-kern_i386_dl.o: kern/i386/dl.c $(kern/i386/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_i386_dl.d - -kernel_img-kern_i386_pc_init.o: kern/i386/pc/init.c $(kern/i386/pc/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_i386_pc_init.d - -kernel_img-kern_i386_pc_mmap.o: kern/i386/pc/mmap.c $(kern/i386/pc/mmap.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/pc -I$(srcdir)/kern/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_i386_pc_mmap.d - -kernel_img-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_parser.d - -kernel_img-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_partition.d - -kernel_img-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_i386_tsc.d - -kernel_img-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_i386_pit.d - -kernel_img-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_generic_rtc_get_time_ms.d - -kernel_img-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_generic_millisleep.d - -kernel_img-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-kern_env.d - -kernel_img-term_i386_pc_console.o: term/i386/pc/console.c $(term/i386/pc/console.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-term_i386_pc_console.d - -kernel_img-term_i386_vga_common.o: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-term_i386_vga_common.d - -kernel_img-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_img_CFLAGS) -MD -c -o $@ $< --include kernel_img-symlist.d - -kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ - machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ - machine/kernel.h machine/pxe.h list.h handler.h command.h -kernel_img_CFLAGS = $(COMMON_CFLAGS) -kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) -kernel_img_FORMAT = binary - -MOSTLYCLEANFILES += symlist.c kernel_syms.lst -DEFSYMFILES += kernel_syms.lst - -symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh - /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh - /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# Utilities. -bin_UTILITIES = grub-mkimage -sbin_UTILITIES = grub-setup grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif - -# For grub-mkimage. -ifeq ($(enable_lzo), yes) -grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ - util/resolve.c -CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o -MOSTLYCLEANFILES += grub_mkimage-util_i386_pc_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d - -grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o - $(CC) -o $@ grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) - -grub_mkimage-util_i386_pc_grub_mkimage.o: util/i386/pc/grub-mkimage.c $(util/i386/pc/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_i386_pc_grub_mkimage.d - -grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_misc.d - -grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_resolve.d - -grub_mkimage_LDFLAGS = $(LIBLZO) -else -grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ - util/resolve.c lib/LzmaEnc.c lib/LzFind.c -CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o -MOSTLYCLEANFILES += grub_mkimage-util_i386_pc_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d grub_mkimage-lib_LzmaEnc.d grub_mkimage-lib_LzFind.d - -grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o - $(CC) -o $@ grub_mkimage-util_i386_pc_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o grub_mkimage-lib_LzmaEnc.o grub_mkimage-lib_LzFind.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) - -grub_mkimage-util_i386_pc_grub_mkimage.o: util/i386/pc/grub-mkimage.c $(util/i386/pc/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_i386_pc_grub_mkimage.d - -grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_misc.d - -grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_resolve.d - -grub_mkimage-lib_LzmaEnc.o: lib/LzmaEnc.c $(lib/LzmaEnc.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-lib_LzmaEnc.d - -grub_mkimage-lib_LzFind.o: lib/LzFind.c $(lib/LzFind.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-lib_LzFind.d - -endif -grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) -util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile - -# For grub-setup. -util/i386/pc/grub-setup.c_DEPENDENCIES = grub_setup_init.h -grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ - util/misc.c util/getroot.c kern/device.c kern/disk.c \ - kern/err.c kern/misc.c kern/parser.c kern/partition.c \ - kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ - \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - partmap/pc.c partmap/gpt.c \ - \ - disk/raid.c disk/mdraid_linux.c disk/lvm.c \ - util/raid.c util/lvm.c \ - grub_setup_init.c -CLEANFILES += grub-setup$(EXEEXT) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-fs_tar.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o -MOSTLYCLEANFILES += grub_setup-util_i386_pc_grub_setup.d grub_setup-util_hostdisk.d grub_setup-util_misc.d grub_setup-util_getroot.d grub_setup-kern_device.d grub_setup-kern_disk.d grub_setup-kern_err.d grub_setup-kern_misc.d grub_setup-kern_parser.d grub_setup-kern_partition.d grub_setup-kern_file.d grub_setup-kern_fs.d grub_setup-kern_env.d grub_setup-fs_fshelp.d grub_setup-fs_affs.d grub_setup-fs_cpio.d grub_setup-fs_ext2.d grub_setup-fs_fat.d grub_setup-fs_hfs.d grub_setup-fs_hfsplus.d grub_setup-fs_iso9660.d grub_setup-fs_udf.d grub_setup-fs_jfs.d grub_setup-fs_minix.d grub_setup-fs_ntfs.d grub_setup-fs_ntfscomp.d grub_setup-fs_reiserfs.d grub_setup-fs_sfs.d grub_setup-fs_ufs.d grub_setup-fs_xfs.d grub_setup-fs_afs.d grub_setup-fs_tar.d grub_setup-partmap_pc.d grub_setup-partmap_gpt.d grub_setup-disk_raid.d grub_setup-disk_mdraid_linux.d grub_setup-disk_lvm.d grub_setup-util_raid.d grub_setup-util_lvm.d grub_setup-grub_setup_init.d - -grub-setup: $(grub_setup_DEPENDENCIES) grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-fs_tar.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o - $(CC) -o $@ grub_setup-util_i386_pc_grub_setup.o grub_setup-util_hostdisk.o grub_setup-util_misc.o grub_setup-util_getroot.o grub_setup-kern_device.o grub_setup-kern_disk.o grub_setup-kern_err.o grub_setup-kern_misc.o grub_setup-kern_parser.o grub_setup-kern_partition.o grub_setup-kern_file.o grub_setup-kern_fs.o grub_setup-kern_env.o grub_setup-fs_fshelp.o grub_setup-fs_affs.o grub_setup-fs_cpio.o grub_setup-fs_ext2.o grub_setup-fs_fat.o grub_setup-fs_hfs.o grub_setup-fs_hfsplus.o grub_setup-fs_iso9660.o grub_setup-fs_udf.o grub_setup-fs_jfs.o grub_setup-fs_minix.o grub_setup-fs_ntfs.o grub_setup-fs_ntfscomp.o grub_setup-fs_reiserfs.o grub_setup-fs_sfs.o grub_setup-fs_ufs.o grub_setup-fs_xfs.o grub_setup-fs_afs.o grub_setup-fs_tar.o grub_setup-partmap_pc.o grub_setup-partmap_gpt.o grub_setup-disk_raid.o grub_setup-disk_mdraid_linux.o grub_setup-disk_lvm.o grub_setup-util_raid.o grub_setup-util_lvm.o grub_setup-grub_setup_init.o $(LDFLAGS) $(grub_setup_LDFLAGS) - -grub_setup-util_i386_pc_grub_setup.o: util/i386/pc/grub-setup.c $(util/i386/pc/grub-setup.c_DEPENDENCIES) - $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-util_i386_pc_grub_setup.d - -grub_setup-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-util_hostdisk.d - -grub_setup-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-util_misc.d - -grub_setup-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-util_getroot.d - -grub_setup-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_device.d - -grub_setup-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_disk.d - -grub_setup-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_err.d - -grub_setup-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_misc.d - -grub_setup-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_parser.d - -grub_setup-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_partition.d - -grub_setup-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_file.d - -grub_setup-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_fs.d - -grub_setup-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-kern_env.d - -grub_setup-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_fshelp.d - -grub_setup-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_affs.d - -grub_setup-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_cpio.d - -grub_setup-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_ext2.d - -grub_setup-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_fat.d - -grub_setup-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_hfs.d - -grub_setup-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_hfsplus.d - -grub_setup-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_iso9660.d - -grub_setup-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_udf.d - -grub_setup-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_jfs.d - -grub_setup-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_minix.d - -grub_setup-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_ntfs.d - -grub_setup-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_ntfscomp.d - -grub_setup-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_reiserfs.d - -grub_setup-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_sfs.d - -grub_setup-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_ufs.d - -grub_setup-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_xfs.d - -grub_setup-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_afs.d - -grub_setup-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-fs_tar.d - -grub_setup-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-partmap_pc.d - -grub_setup-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-partmap_gpt.d - -grub_setup-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-disk_raid.d - -grub_setup-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-disk_mdraid_linux.d - -grub_setup-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-disk_lvm.d - -grub_setup-util_raid.o: util/raid.c $(util/raid.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-util_raid.d - -grub_setup-util_lvm.o: util/lvm.c $(util/lvm.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-util_lvm.d - -grub_setup-grub_setup_init.o: grub_setup_init.c $(grub_setup_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_setup_CFLAGS) -MD -c -o $@ $< --include grub_setup-grub_setup_init.d - - -# For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d - -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) - -grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_grub_mkdevicemap.d - -grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_misc.d - - -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/echo.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ - commands/i386/cpuid.c \ - disk/host.c disk/loopback.c disk/scsi.c \ - fs/fshelp.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c \ - normal/completion.c normal/main.c normal/color.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/menu_text.c \ - normal/misc.c normal/script.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ - grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_echo.d grub_emu-commands_help.d grub_emu-commands_handler.d grub_emu-commands_ls.d grub_emu-commands_test.d grub_emu-commands_search.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_i386_pc_halt.d grub_emu-commands_reboot.d grub_emu-commands_i386_cpuid.d grub_emu-disk_host.d grub_emu-disk_loopback.d grub_emu-disk_scsi.d grub_emu-fs_fshelp.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-normal_execute.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-normal_lexer.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-grub_script_tab.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_function.d grub_emu-normal_completion.d grub_emu-normal_main.d grub_emu-normal_color.d grub_emu-normal_menu.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_menu_text.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-partmap_gpt.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_i386_pc_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d grub_emu-grub_emu_init.d - -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_echo.o grub_emu-commands_help.o grub_emu-commands_handler.o grub_emu-commands_ls.o grub_emu-commands_test.o grub_emu-commands_search.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_i386_pc_halt.o grub_emu-commands_reboot.o grub_emu-commands_i386_cpuid.o grub_emu-disk_host.o grub_emu-disk_loopback.o grub_emu-disk_scsi.o grub_emu-fs_fshelp.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-normal_execute.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-normal_lexer.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-grub_script_tab.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_function.o grub_emu-normal_completion.o grub_emu-normal_main.o grub_emu-normal_color.o grub_emu-normal_menu.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_menu_text.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-partmap_gpt.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_i386_pc_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) - -grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_minicmd.d - -grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cat.d - -grub_emu-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cmp.d - -grub_emu-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_configfile.d - -grub_emu-commands_echo.o: commands/echo.c $(commands/echo.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_echo.d - -grub_emu-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_help.d - -grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_handler.d - -grub_emu-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ls.d - -grub_emu-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_test.d - -grub_emu-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_search.d - -grub_emu-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_blocklist.d - -grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_hexdump.d - -grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_hexdump.d - -grub_emu-commands_i386_pc_halt.o: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) - $(CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_i386_pc_halt.d - -grub_emu-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_reboot.d - -grub_emu-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_i386_cpuid.d - -grub_emu-disk_host.o: disk/host.c $(disk/host.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_host.d - -grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_loopback.d - -grub_emu-disk_scsi.o: disk/scsi.c $(disk/scsi.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_scsi.d - -grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fshelp.d - -grub_emu-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-io_gzio.d - -grub_emu-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_device.d - -grub_emu-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_disk.d - -grub_emu-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_dl.d - -grub_emu-kern_elf.o: kern/elf.c $(kern/elf.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_elf.d - -grub_emu-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_env.d - -grub_emu-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_err.d - -grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_list.d - -grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_handler.d - -grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_command.d - -grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_corecmd.d - -grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_extcmd.d - -grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_execute.d - -grub_emu-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_file.d - -grub_emu-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_fs.d - -grub_emu-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_lexer.d - -grub_emu-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_loader.d - -grub_emu-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_main.d - -grub_emu-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_misc.d - -grub_emu-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_parser.d - -grub_emu-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_script_tab.d - -grub_emu-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_partition.d - -grub_emu-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_rescue.d - -grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_term.d - -grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_arg.d - -grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_cmdline.d - -grub_emu-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_command.d - -grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_datetime.d - -grub_emu-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_function.d - -grub_emu-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_completion.d - -grub_emu-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_main.d - -grub_emu-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_color.d - -grub_emu-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu.d - -grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_entry.d - -grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_viewer.d - -grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_text.d - -grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_misc.d - -grub_emu-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_script.d - -grub_emu-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_amiga.d - -grub_emu-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_apple.d - -grub_emu-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_pc.d - -grub_emu-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_sun.d - -grub_emu-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_acorn.d - -grub_emu-partmap_gpt.o: partmap/gpt.c $(partmap/gpt.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_gpt.d - -grub_emu-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_affs.d - -grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_cpio.d - -grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fat.d - -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - -grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfs.d - -grub_emu-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfsplus.d - -grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_iso9660.d - -grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_udf.d - -grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_jfs.d - -grub_emu-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_minix.d - -grub_emu-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfs.d - -grub_emu-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfscomp.d - -grub_emu-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_reiserfs.d - -grub_emu-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_sfs.d - -grub_emu-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ufs.d - -grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_xfs.d - -grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_afs.d - -grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_tar.d - -grub_emu-util_console.o: util/console.c $(util/console.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_console.d - -grub_emu-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostfs.d - -grub_emu-util_grub_emu.o: util/grub-emu.c $(util/grub-emu.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_grub_emu.d - -grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_misc.d - -grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostdisk.d - -grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_getroot.d - -grub_emu-util_i386_pc_misc.o: util/i386/pc/misc.c $(util/i386/pc/misc.c_DEPENDENCIES) - $(CC) -Iutil/i386/pc -I$(srcdir)/util/i386/pc $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_i386_pc_misc.d - -grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid.d - -grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid5_recover.d - -grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid6_recover.d - -grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_mdraid_linux.d - -grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_dmraid_nvidia.d - -grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_lvm.d - -grub_emu-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_parttool.d - -grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) - $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-parttool_pcpart.d - -grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_emu_init.d - - -grub_emu_LDFLAGS = $(LIBCURSES) - -ifeq ($(enable_grub_emu_usb), yes) -grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \ - commands/usbtest.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-disk_usbms.o grub_emu-util_usb.o grub_emu-bus_usb_usb.o grub_emu-commands_usbtest.o -MOSTLYCLEANFILES += grub_emu-disk_usbms.d grub_emu-util_usb.d grub_emu-bus_usb_usb.d grub_emu-commands_usbtest.d - -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-disk_usbms.o grub_emu-util_usb.o grub_emu-bus_usb_usb.o grub_emu-commands_usbtest.o - $(CC) -o $@ grub_emu-disk_usbms.o grub_emu-util_usb.o grub_emu-bus_usb_usb.o grub_emu-commands_usbtest.o $(LDFLAGS) $(grub_emu_LDFLAGS) - -grub_emu-disk_usbms.o: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_usbms.d - -grub_emu-util_usb.o: util/usb.c $(util/usb.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_usb.d - -grub_emu-bus_usb_usb.o: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) - $(CC) -Ibus/usb -I$(srcdir)/bus/usb $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-bus_usb_usb.d - -grub_emu-commands_usbtest.o: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_usbtest.d - -grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB) -endif - -# Scripts. -sbin_SCRIPTS = grub-install -bin_SCRIPTS = grub-mkrescue - -# For grub-install. -grub_install_SOURCES = util/i386/pc/grub-install.in -CLEANFILES += grub-install - -grub-install: util/i386/pc/grub-install.in $(util/i386/pc/grub-install.in_DEPENDENCIES) config.status - ./config.status --file=grub-install:util/i386/pc/grub-install.in - chmod +x $@ - - -# For grub-mkrescue. -grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in -CLEANFILES += grub-mkrescue - -grub-mkrescue: util/i386/pc/grub-mkrescue.in $(util/i386/pc/grub-mkrescue.in_DEPENDENCIES) config.status - ./config.status --file=grub-mkrescue:util/i386/pc/grub-mkrescue.in - chmod +x $@ - - -pkglib_MODULES = biosdisk.mod chain.mod normal.mod \ - multiboot.mod reboot.mod halt.mod \ - vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ - ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ - aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ - datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ - usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod - -# For biosdisk.mod. -biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c -CLEANFILES += biosdisk.mod mod-biosdisk.o mod-biosdisk.c pre-biosdisk.o biosdisk_mod-disk_i386_pc_biosdisk.o und-biosdisk.lst -ifneq ($(biosdisk_mod_EXPORTS),no) -CLEANFILES += def-biosdisk.lst -DEFSYMFILES += def-biosdisk.lst -endif -MOSTLYCLEANFILES += biosdisk_mod-disk_i386_pc_biosdisk.d -UNDSYMFILES += und-biosdisk.lst - -biosdisk.mod: pre-biosdisk.o mod-biosdisk.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-biosdisk.o mod-biosdisk.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-biosdisk.o: $(biosdisk_mod_DEPENDENCIES) biosdisk_mod-disk_i386_pc_biosdisk.o - -rm -f $@ - $(TARGET_CC) $(biosdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ biosdisk_mod-disk_i386_pc_biosdisk.o - -mod-biosdisk.o: mod-biosdisk.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -c -o $@ $< - -mod-biosdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'biosdisk' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(biosdisk_mod_EXPORTS),no) -def-biosdisk.lst: pre-biosdisk.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 biosdisk/' > $@ -endif - -und-biosdisk.lst: pre-biosdisk.o - echo 'biosdisk' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -biosdisk_mod-disk_i386_pc_biosdisk.o: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -MD -c -o $@ $< --include biosdisk_mod-disk_i386_pc_biosdisk.d - -CLEANFILES += cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst fs-biosdisk_mod-disk_i386_pc_biosdisk.lst partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst -COMMANDFILES += cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst -FSFILES += fs-biosdisk_mod-disk_i386_pc_biosdisk.lst -PARTMAPFILES += partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst - -cmd-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh biosdisk > $@ || (rm -f $@; exit 1) - -fs-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh biosdisk > $@ || (rm -f $@; exit 1) - -partmap-biosdisk_mod-disk_i386_pc_biosdisk.lst: disk/i386/pc/biosdisk.c $(disk/i386/pc/biosdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/i386/pc -I$(srcdir)/disk/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(biosdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh biosdisk > $@ || (rm -f $@; exit 1) - - -biosdisk_mod_CFLAGS = $(COMMON_CFLAGS) -biosdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For chain.mod. -chain_mod_SOURCES = loader/i386/pc/chainloader.c -CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_i386_pc_chainloader.o und-chain.lst -ifneq ($(chain_mod_EXPORTS),no) -CLEANFILES += def-chain.lst -DEFSYMFILES += def-chain.lst -endif -MOSTLYCLEANFILES += chain_mod-loader_i386_pc_chainloader.d -UNDSYMFILES += und-chain.lst - -chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_i386_pc_chainloader.o - -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_i386_pc_chainloader.o - -mod-chain.o: mod-chain.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< - -mod-chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(chain_mod_EXPORTS),no) -def-chain.lst: pre-chain.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 chain/' > $@ -endif - -und-chain.lst: pre-chain.o - echo 'chain' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -chain_mod-loader_i386_pc_chainloader.o: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< --include chain_mod-loader_i386_pc_chainloader.d - -CLEANFILES += cmd-chain_mod-loader_i386_pc_chainloader.lst fs-chain_mod-loader_i386_pc_chainloader.lst partmap-chain_mod-loader_i386_pc_chainloader.lst -COMMANDFILES += cmd-chain_mod-loader_i386_pc_chainloader.lst -FSFILES += fs-chain_mod-loader_i386_pc_chainloader.lst -PARTMAPFILES += partmap-chain_mod-loader_i386_pc_chainloader.lst - -cmd-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) - -fs-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) - -partmap-chain_mod-loader_i386_pc_chainloader.lst: loader/i386/pc/chainloader.c $(loader/i386/pc/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) - - -chain_mod_CFLAGS = $(COMMON_CFLAGS) -chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - -pkglib_MODULES += linux16.mod -linux16_mod_SOURCES = loader/i386/pc/linux.c -CLEANFILES += linux16.mod mod-linux16.o mod-linux16.c pre-linux16.o linux16_mod-loader_i386_pc_linux.o und-linux16.lst -ifneq ($(linux16_mod_EXPORTS),no) -CLEANFILES += def-linux16.lst -DEFSYMFILES += def-linux16.lst -endif -MOSTLYCLEANFILES += linux16_mod-loader_i386_pc_linux.d -UNDSYMFILES += und-linux16.lst - -linux16.mod: pre-linux16.o mod-linux16.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(linux16_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux16.o mod-linux16.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-linux16.o: $(linux16_mod_DEPENDENCIES) linux16_mod-loader_i386_pc_linux.o - -rm -f $@ - $(TARGET_CC) $(linux16_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux16_mod-loader_i386_pc_linux.o - -mod-linux16.o: mod-linux16.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -c -o $@ $< - -mod-linux16.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'linux16' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(linux16_mod_EXPORTS),no) -def-linux16.lst: pre-linux16.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux16/' > $@ -endif - -und-linux16.lst: pre-linux16.o - echo 'linux16' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -linux16_mod-loader_i386_pc_linux.o: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -MD -c -o $@ $< --include linux16_mod-loader_i386_pc_linux.d - -CLEANFILES += cmd-linux16_mod-loader_i386_pc_linux.lst fs-linux16_mod-loader_i386_pc_linux.lst partmap-linux16_mod-loader_i386_pc_linux.lst -COMMANDFILES += cmd-linux16_mod-loader_i386_pc_linux.lst -FSFILES += fs-linux16_mod-loader_i386_pc_linux.lst -PARTMAPFILES += partmap-linux16_mod-loader_i386_pc_linux.lst - -cmd-linux16_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux16 > $@ || (rm -f $@; exit 1) - -fs-linux16_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux16 > $@ || (rm -f $@; exit 1) - -partmap-linux16_mod-loader_i386_pc_linux.lst: loader/i386/pc/linux.c $(loader/i386/pc/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux16_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux16 > $@ || (rm -f $@; exit 1) - - -linux16_mod_CFLAGS = $(COMMON_CFLAGS) -linux16_mod_LDFLAGS = $(COMMON_LDFLAGS) - -pkglib_MODULES += linux.mod -linux_mod_SOURCES = loader/i386/linux.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_linux.o und-linux.lst -ifneq ($(linux_mod_EXPORTS),no) -CLEANFILES += def-linux.lst -DEFSYMFILES += def-linux.lst -endif -MOSTLYCLEANFILES += linux_mod-loader_i386_linux.d -UNDSYMFILES += und-linux.lst - -linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_linux.o - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_linux.o - -mod-linux.o: mod-linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< - -mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(linux_mod_EXPORTS),no) -def-linux.lst: pre-linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ -endif - -und-linux.lst: pre-linux.o - echo 'linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -linux_mod-loader_i386_linux.o: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_linux.d - -CLEANFILES += cmd-linux_mod-loader_i386_linux.lst fs-linux_mod-loader_i386_linux.lst partmap-linux_mod-loader_i386_linux.lst -COMMANDFILES += cmd-linux_mod-loader_i386_linux.lst -FSFILES += fs-linux_mod-loader_i386_linux.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_linux.lst - -cmd-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) - -fs-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) - -partmap-linux_mod-loader_i386_linux.lst: loader/i386/linux.c $(loader/i386/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) - - -linux_mod_CFLAGS = $(COMMON_CFLAGS) -linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o und-normal.lst -ifneq ($(normal_mod_EXPORTS),no) -CLEANFILES += def-normal.lst -DEFSYMFILES += def-normal.lst -endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_datetime.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_i386_setjmp.d -UNDSYMFILES += und-normal.lst - -normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_i386_setjmp.o - -mod-normal.o: mod-normal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(normal_mod_EXPORTS),no) -def-normal.lst: pre-normal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ -endif - -und-normal.lst: pre-normal.o - echo 'normal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_cmdline.d - -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst -COMMANDFILES += cmd-normal_mod-normal_cmdline.lst -FSFILES += fs-normal_mod-normal_cmdline.lst -PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst - -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_command.d - -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst -COMMANDFILES += cmd-normal_mod-normal_command.lst -FSFILES += fs-normal_mod-normal_command.lst -PARTMAPFILES += partmap-normal_mod-normal_command.lst - -cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_datetime.d - -CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst -COMMANDFILES += cmd-normal_mod-normal_datetime.lst -FSFILES += fs-normal_mod-normal_datetime.lst -PARTMAPFILES += partmap-normal_mod-normal_datetime.lst - -cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_completion.d - -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst -COMMANDFILES += cmd-normal_mod-normal_completion.lst -FSFILES += fs-normal_mod-normal_completion.lst -PARTMAPFILES += partmap-normal_mod-normal_completion.lst - -cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_execute.d - -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst -COMMANDFILES += cmd-normal_mod-normal_execute.lst -FSFILES += fs-normal_mod-normal_execute.lst -PARTMAPFILES += partmap-normal_mod-normal_execute.lst - -cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_function.d - -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst -COMMANDFILES += cmd-normal_mod-normal_function.lst -FSFILES += fs-normal_mod-normal_function.lst -PARTMAPFILES += partmap-normal_mod-normal_function.lst - -cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_lexer.d - -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst -COMMANDFILES += cmd-normal_mod-normal_lexer.lst -FSFILES += fs-normal_mod-normal_lexer.lst -PARTMAPFILES += partmap-normal_mod-normal_lexer.lst - -cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_main.d - -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst -COMMANDFILES += cmd-normal_mod-normal_main.lst -FSFILES += fs-normal_mod-normal_main.lst -PARTMAPFILES += partmap-normal_mod-normal_main.lst - -cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu.d - -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst -COMMANDFILES += cmd-normal_mod-normal_menu.lst -FSFILES += fs-normal_mod-normal_menu.lst -PARTMAPFILES += partmap-normal_mod-normal_menu.lst - -cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_text.d - -CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst -COMMANDFILES += cmd-normal_mod-normal_menu_text.lst -FSFILES += fs-normal_mod-normal_menu_text.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst - -cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_viewer.d - -CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst -COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst -FSFILES += fs-normal_mod-normal_menu_viewer.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst - -cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_entry.d - -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst -COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst -FSFILES += fs-normal_mod-normal_menu_entry.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst - -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_misc.d - -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst -COMMANDFILES += cmd-normal_mod-normal_misc.lst -FSFILES += fs-normal_mod-normal_misc.lst -PARTMAPFILES += partmap-normal_mod-normal_misc.lst - -cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_script.d - -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst -COMMANDFILES += cmd-normal_mod-normal_script.lst -FSFILES += fs-normal_mod-normal_script.lst -PARTMAPFILES += partmap-normal_mod-normal_script.lst - -cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_i386_setjmp.o: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) - $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< --include normal_mod-normal_i386_setjmp.d - -CLEANFILES += cmd-normal_mod-normal_i386_setjmp.lst fs-normal_mod-normal_i386_setjmp.lst partmap-normal_mod-normal_i386_setjmp.lst -COMMANDFILES += cmd-normal_mod-normal_i386_setjmp.lst -FSFILES += fs-normal_mod-normal_i386_setjmp.lst -PARTMAPFILES += partmap-normal_mod-normal_i386_setjmp.lst - -cmd-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_i386_setjmp.lst: normal/i386/setjmp.S $(normal/i386/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/i386 -I$(srcdir)/normal/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod. -reboot_mod_SOURCES = commands/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst -ifneq ($(reboot_mod_EXPORTS),no) -CLEANFILES += def-reboot.lst -DEFSYMFILES += def-reboot.lst -endif -MOSTLYCLEANFILES += reboot_mod-commands_reboot.d -UNDSYMFILES += und-reboot.lst - -reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o - -mod-reboot.o: mod-reboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< - -mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reboot_mod_EXPORTS),no) -def-reboot.lst: pre-reboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ -endif - -und-reboot.lst: pre-reboot.o - echo 'reboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_reboot.d - -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_reboot.lst -FSFILES += fs-reboot_mod-commands_reboot.lst -PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst - -cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod_CFLAGS = $(COMMON_CFLAGS) -reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For halt.mod. -halt_mod_SOURCES = commands/i386/pc/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_i386_pc_halt.o und-halt.lst -ifneq ($(halt_mod_EXPORTS),no) -CLEANFILES += def-halt.lst -DEFSYMFILES += def-halt.lst -endif -MOSTLYCLEANFILES += halt_mod-commands_i386_pc_halt.d -UNDSYMFILES += und-halt.lst - -halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_i386_pc_halt.o - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_i386_pc_halt.o - -mod-halt.o: mod-halt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< - -mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(halt_mod_EXPORTS),no) -def-halt.lst: pre-halt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ -endif - -und-halt.lst: pre-halt.o - echo 'halt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -halt_mod-commands_i386_pc_halt.o: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_i386_pc_halt.d - -CLEANFILES += cmd-halt_mod-commands_i386_pc_halt.lst fs-halt_mod-commands_i386_pc_halt.lst partmap-halt_mod-commands_i386_pc_halt.lst -COMMANDFILES += cmd-halt_mod-commands_i386_pc_halt.lst -FSFILES += fs-halt_mod-commands_i386_pc_halt.lst -PARTMAPFILES += partmap-halt_mod-commands_i386_pc_halt.lst - -cmd-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-commands_i386_pc_halt.lst: commands/i386/pc/halt.c $(commands/i386/pc/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod_CFLAGS = $(COMMON_CFLAGS) -halt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For serial.mod. -serial_mod_SOURCES = term/i386/pc/serial.c -CLEANFILES += serial.mod mod-serial.o mod-serial.c pre-serial.o serial_mod-term_i386_pc_serial.o und-serial.lst -ifneq ($(serial_mod_EXPORTS),no) -CLEANFILES += def-serial.lst -DEFSYMFILES += def-serial.lst -endif -MOSTLYCLEANFILES += serial_mod-term_i386_pc_serial.d -UNDSYMFILES += und-serial.lst - -serial.mod: pre-serial.o mod-serial.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-serial.o mod-serial.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-serial.o: $(serial_mod_DEPENDENCIES) serial_mod-term_i386_pc_serial.o - -rm -f $@ - $(TARGET_CC) $(serial_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ serial_mod-term_i386_pc_serial.o - -mod-serial.o: mod-serial.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -c -o $@ $< - -mod-serial.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'serial' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(serial_mod_EXPORTS),no) -def-serial.lst: pre-serial.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 serial/' > $@ -endif - -und-serial.lst: pre-serial.o - echo 'serial' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -serial_mod-term_i386_pc_serial.o: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -MD -c -o $@ $< --include serial_mod-term_i386_pc_serial.d - -CLEANFILES += cmd-serial_mod-term_i386_pc_serial.lst fs-serial_mod-term_i386_pc_serial.lst partmap-serial_mod-term_i386_pc_serial.lst -COMMANDFILES += cmd-serial_mod-term_i386_pc_serial.lst -FSFILES += fs-serial_mod-term_i386_pc_serial.lst -PARTMAPFILES += partmap-serial_mod-term_i386_pc_serial.lst - -cmd-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh serial > $@ || (rm -f $@; exit 1) - -fs-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh serial > $@ || (rm -f $@; exit 1) - -partmap-serial_mod-term_i386_pc_serial.lst: term/i386/pc/serial.c $(term/i386/pc/serial.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(serial_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh serial > $@ || (rm -f $@; exit 1) - - -serial_mod_CFLAGS = $(COMMON_CFLAGS) -serial_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod. -multiboot_mod_SOURCES = loader/i386/multiboot.c \ - loader/i386/multiboot_helper.S \ - loader/i386/pc/multiboot2.c \ - loader/multiboot2.c \ - loader/multiboot_loader.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst -ifneq ($(multiboot_mod_EXPORTS),no) -CLEANFILES += def-multiboot.lst -DEFSYMFILES += def-multiboot.lst -endif -MOSTLYCLEANFILES += multiboot_mod-loader_i386_multiboot.d multiboot_mod-loader_i386_multiboot_helper.d multiboot_mod-loader_i386_pc_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-multiboot.lst - -multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_i386_multiboot.o multiboot_mod-loader_i386_multiboot_helper.o multiboot_mod-loader_i386_pc_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -mod-multiboot.o: mod-multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< - -mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(multiboot_mod_EXPORTS),no) -def-multiboot.lst: pre-multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 multiboot/' > $@ -endif - -und-multiboot.lst: pre-multiboot.o - echo 'multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -multiboot_mod-loader_i386_multiboot.o: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_i386_multiboot.d - -CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot.lst fs-multiboot_mod-loader_i386_multiboot.lst partmap-multiboot_mod-loader_i386_multiboot.lst -COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot.lst -FSFILES += fs-multiboot_mod-loader_i386_multiboot.lst -PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot.lst - -cmd-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_i386_multiboot.lst: loader/i386/multiboot.c $(loader/i386/multiboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_i386_multiboot_helper.o: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_i386_multiboot_helper.d - -CLEANFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst fs-multiboot_mod-loader_i386_multiboot_helper.lst partmap-multiboot_mod-loader_i386_multiboot_helper.lst -COMMANDFILES += cmd-multiboot_mod-loader_i386_multiboot_helper.lst -FSFILES += fs-multiboot_mod-loader_i386_multiboot_helper.lst -PARTMAPFILES += partmap-multiboot_mod-loader_i386_multiboot_helper.lst - -cmd-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_i386_multiboot_helper.lst: loader/i386/multiboot_helper.S $(loader/i386/multiboot_helper.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(multiboot_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_i386_pc_multiboot2.o: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_i386_pc_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst fs-multiboot_mod-loader_i386_pc_multiboot2.lst partmap-multiboot_mod-loader_i386_pc_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_i386_pc_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_i386_pc_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_i386_pc_multiboot2.lst - -cmd-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_i386_pc_multiboot2.lst: loader/i386/pc/multiboot2.c $(loader/i386/pc/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/pc -I$(srcdir)/loader/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst - -cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst - -cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) -multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) - -# For vbe.mod. -vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \ - video/i386/pc/vbefill.c video/i386/pc/vbeutil.c -CLEANFILES += vbe.mod mod-vbe.o mod-vbe.c pre-vbe.o vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o vbe_mod-video_i386_pc_vbeutil.o und-vbe.lst -ifneq ($(vbe_mod_EXPORTS),no) -CLEANFILES += def-vbe.lst -DEFSYMFILES += def-vbe.lst -endif -MOSTLYCLEANFILES += vbe_mod-video_i386_pc_vbe.d vbe_mod-video_i386_pc_vbeblit.d vbe_mod-video_i386_pc_vbefill.d vbe_mod-video_i386_pc_vbeutil.d -UNDSYMFILES += und-vbe.lst - -vbe.mod: pre-vbe.o mod-vbe.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vbe.o mod-vbe.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-vbe.o: $(vbe_mod_DEPENDENCIES) vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o vbe_mod-video_i386_pc_vbeutil.o - -rm -f $@ - $(TARGET_CC) $(vbe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ vbe_mod-video_i386_pc_vbe.o vbe_mod-video_i386_pc_vbeblit.o vbe_mod-video_i386_pc_vbefill.o vbe_mod-video_i386_pc_vbeutil.o - -mod-vbe.o: mod-vbe.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -c -o $@ $< - -mod-vbe.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'vbe' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(vbe_mod_EXPORTS),no) -def-vbe.lst: pre-vbe.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vbe/' > $@ -endif - -und-vbe.lst: pre-vbe.o - echo 'vbe' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -vbe_mod-video_i386_pc_vbe.o: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< --include vbe_mod-video_i386_pc_vbe.d - -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbe.lst fs-vbe_mod-video_i386_pc_vbe.lst partmap-vbe_mod-video_i386_pc_vbe.lst -COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbe.lst -FSFILES += fs-vbe_mod-video_i386_pc_vbe.lst -PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbe.lst - -cmd-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) - -fs-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) - -partmap-vbe_mod-video_i386_pc_vbe.lst: video/i386/pc/vbe.c $(video/i386/pc/vbe.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) - - -vbe_mod-video_i386_pc_vbeblit.o: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< --include vbe_mod-video_i386_pc_vbeblit.d - -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst fs-vbe_mod-video_i386_pc_vbeblit.lst partmap-vbe_mod-video_i386_pc_vbeblit.lst -COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeblit.lst -FSFILES += fs-vbe_mod-video_i386_pc_vbeblit.lst -PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbeblit.lst - -cmd-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) - -fs-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) - -partmap-vbe_mod-video_i386_pc_vbeblit.lst: video/i386/pc/vbeblit.c $(video/i386/pc/vbeblit.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) - - -vbe_mod-video_i386_pc_vbefill.o: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< --include vbe_mod-video_i386_pc_vbefill.d - -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst fs-vbe_mod-video_i386_pc_vbefill.lst partmap-vbe_mod-video_i386_pc_vbefill.lst -COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbefill.lst -FSFILES += fs-vbe_mod-video_i386_pc_vbefill.lst -PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbefill.lst - -cmd-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) - -fs-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) - -partmap-vbe_mod-video_i386_pc_vbefill.lst: video/i386/pc/vbefill.c $(video/i386/pc/vbefill.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) - - -vbe_mod-video_i386_pc_vbeutil.o: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) - $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -MD -c -o $@ $< --include vbe_mod-video_i386_pc_vbeutil.d - -CLEANFILES += cmd-vbe_mod-video_i386_pc_vbeutil.lst fs-vbe_mod-video_i386_pc_vbeutil.lst partmap-vbe_mod-video_i386_pc_vbeutil.lst -COMMANDFILES += cmd-vbe_mod-video_i386_pc_vbeutil.lst -FSFILES += fs-vbe_mod-video_i386_pc_vbeutil.lst -PARTMAPFILES += partmap-vbe_mod-video_i386_pc_vbeutil.lst - -cmd-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbe > $@ || (rm -f $@; exit 1) - -fs-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbe > $@ || (rm -f $@; exit 1) - -partmap-vbe_mod-video_i386_pc_vbeutil.lst: video/i386/pc/vbeutil.c $(video/i386/pc/vbeutil.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ivideo/i386/pc -I$(srcdir)/video/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbe > $@ || (rm -f $@; exit 1) - - -vbe_mod_CFLAGS = $(COMMON_CFLAGS) -vbe_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For vbeinfo.mod. -vbeinfo_mod_SOURCES = commands/i386/pc/vbeinfo.c -CLEANFILES += vbeinfo.mod mod-vbeinfo.o mod-vbeinfo.c pre-vbeinfo.o vbeinfo_mod-commands_i386_pc_vbeinfo.o und-vbeinfo.lst -ifneq ($(vbeinfo_mod_EXPORTS),no) -CLEANFILES += def-vbeinfo.lst -DEFSYMFILES += def-vbeinfo.lst -endif -MOSTLYCLEANFILES += vbeinfo_mod-commands_i386_pc_vbeinfo.d -UNDSYMFILES += und-vbeinfo.lst - -vbeinfo.mod: pre-vbeinfo.o mod-vbeinfo.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vbeinfo.o mod-vbeinfo.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-vbeinfo.o: $(vbeinfo_mod_DEPENDENCIES) vbeinfo_mod-commands_i386_pc_vbeinfo.o - -rm -f $@ - $(TARGET_CC) $(vbeinfo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ vbeinfo_mod-commands_i386_pc_vbeinfo.o - -mod-vbeinfo.o: mod-vbeinfo.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -c -o $@ $< - -mod-vbeinfo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'vbeinfo' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(vbeinfo_mod_EXPORTS),no) -def-vbeinfo.lst: pre-vbeinfo.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vbeinfo/' > $@ -endif - -und-vbeinfo.lst: pre-vbeinfo.o - echo 'vbeinfo' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -vbeinfo_mod-commands_i386_pc_vbeinfo.o: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -MD -c -o $@ $< --include vbeinfo_mod-commands_i386_pc_vbeinfo.d - -CLEANFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst -COMMANDFILES += cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst -FSFILES += fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst -PARTMAPFILES += partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst - -cmd-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbeinfo > $@ || (rm -f $@; exit 1) - -fs-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbeinfo > $@ || (rm -f $@; exit 1) - -partmap-vbeinfo_mod-commands_i386_pc_vbeinfo.lst: commands/i386/pc/vbeinfo.c $(commands/i386/pc/vbeinfo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbeinfo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbeinfo > $@ || (rm -f $@; exit 1) - - -vbeinfo_mod_CFLAGS = $(COMMON_CFLAGS) -vbeinfo_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For vbetest.mod. -vbetest_mod_SOURCES = commands/i386/pc/vbetest.c -CLEANFILES += vbetest.mod mod-vbetest.o mod-vbetest.c pre-vbetest.o vbetest_mod-commands_i386_pc_vbetest.o und-vbetest.lst -ifneq ($(vbetest_mod_EXPORTS),no) -CLEANFILES += def-vbetest.lst -DEFSYMFILES += def-vbetest.lst -endif -MOSTLYCLEANFILES += vbetest_mod-commands_i386_pc_vbetest.d -UNDSYMFILES += und-vbetest.lst - -vbetest.mod: pre-vbetest.o mod-vbetest.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vbetest.o mod-vbetest.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-vbetest.o: $(vbetest_mod_DEPENDENCIES) vbetest_mod-commands_i386_pc_vbetest.o - -rm -f $@ - $(TARGET_CC) $(vbetest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ vbetest_mod-commands_i386_pc_vbetest.o - -mod-vbetest.o: mod-vbetest.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -c -o $@ $< - -mod-vbetest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'vbetest' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(vbetest_mod_EXPORTS),no) -def-vbetest.lst: pre-vbetest.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vbetest/' > $@ -endif - -und-vbetest.lst: pre-vbetest.o - echo 'vbetest' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -vbetest_mod-commands_i386_pc_vbetest.o: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -MD -c -o $@ $< --include vbetest_mod-commands_i386_pc_vbetest.d - -CLEANFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst fs-vbetest_mod-commands_i386_pc_vbetest.lst partmap-vbetest_mod-commands_i386_pc_vbetest.lst -COMMANDFILES += cmd-vbetest_mod-commands_i386_pc_vbetest.lst -FSFILES += fs-vbetest_mod-commands_i386_pc_vbetest.lst -PARTMAPFILES += partmap-vbetest_mod-commands_i386_pc_vbetest.lst - -cmd-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vbetest > $@ || (rm -f $@; exit 1) - -fs-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vbetest > $@ || (rm -f $@; exit 1) - -partmap-vbetest_mod-commands_i386_pc_vbetest.lst: commands/i386/pc/vbetest.c $(commands/i386/pc/vbetest.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vbetest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vbetest > $@ || (rm -f $@; exit 1) - - -vbetest_mod_CFLAGS = $(COMMON_CFLAGS) -vbetest_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For play.mod. -play_mod_SOURCES = commands/i386/pc/play.c -CLEANFILES += play.mod mod-play.o mod-play.c pre-play.o play_mod-commands_i386_pc_play.o und-play.lst -ifneq ($(play_mod_EXPORTS),no) -CLEANFILES += def-play.lst -DEFSYMFILES += def-play.lst -endif -MOSTLYCLEANFILES += play_mod-commands_i386_pc_play.d -UNDSYMFILES += und-play.lst - -play.mod: pre-play.o mod-play.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-play.o mod-play.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-play.o: $(play_mod_DEPENDENCIES) play_mod-commands_i386_pc_play.o - -rm -f $@ - $(TARGET_CC) $(play_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ play_mod-commands_i386_pc_play.o - -mod-play.o: mod-play.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -c -o $@ $< - -mod-play.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'play' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(play_mod_EXPORTS),no) -def-play.lst: pre-play.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 play/' > $@ -endif - -und-play.lst: pre-play.o - echo 'play' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -play_mod-commands_i386_pc_play.o: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -MD -c -o $@ $< --include play_mod-commands_i386_pc_play.d - -CLEANFILES += cmd-play_mod-commands_i386_pc_play.lst fs-play_mod-commands_i386_pc_play.lst partmap-play_mod-commands_i386_pc_play.lst -COMMANDFILES += cmd-play_mod-commands_i386_pc_play.lst -FSFILES += fs-play_mod-commands_i386_pc_play.lst -PARTMAPFILES += partmap-play_mod-commands_i386_pc_play.lst - -cmd-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh play > $@ || (rm -f $@; exit 1) - -fs-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh play > $@ || (rm -f $@; exit 1) - -partmap-play_mod-commands_i386_pc_play.lst: commands/i386/pc/play.c $(commands/i386/pc/play.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(play_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh play > $@ || (rm -f $@; exit 1) - - -play_mod_CFLAGS = $(COMMON_CFLAGS) -play_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ata.mod. -ata_mod_SOURCES = disk/ata.c -CLEANFILES += ata.mod mod-ata.o mod-ata.c pre-ata.o ata_mod-disk_ata.o und-ata.lst -ifneq ($(ata_mod_EXPORTS),no) -CLEANFILES += def-ata.lst -DEFSYMFILES += def-ata.lst -endif -MOSTLYCLEANFILES += ata_mod-disk_ata.d -UNDSYMFILES += und-ata.lst - -ata.mod: pre-ata.o mod-ata.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ata.o mod-ata.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ata.o: $(ata_mod_DEPENDENCIES) ata_mod-disk_ata.o - -rm -f $@ - $(TARGET_CC) $(ata_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ata_mod-disk_ata.o - -mod-ata.o: mod-ata.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -c -o $@ $< - -mod-ata.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ata' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ata_mod_EXPORTS),no) -def-ata.lst: pre-ata.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ata/' > $@ -endif - -und-ata.lst: pre-ata.o - echo 'ata' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ata_mod-disk_ata.o: disk/ata.c $(disk/ata.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -MD -c -o $@ $< --include ata_mod-disk_ata.d - -CLEANFILES += cmd-ata_mod-disk_ata.lst fs-ata_mod-disk_ata.lst partmap-ata_mod-disk_ata.lst -COMMANDFILES += cmd-ata_mod-disk_ata.lst -FSFILES += fs-ata_mod-disk_ata.lst -PARTMAPFILES += partmap-ata_mod-disk_ata.lst - -cmd-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata > $@ || (rm -f $@; exit 1) - -fs-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata > $@ || (rm -f $@; exit 1) - -partmap-ata_mod-disk_ata.lst: disk/ata.c $(disk/ata.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata > $@ || (rm -f $@; exit 1) - - -ata_mod_CFLAGS = $(COMMON_CFLAGS) -ata_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For vga.mod. -vga_mod_SOURCES = term/i386/pc/vga.c -CLEANFILES += vga.mod mod-vga.o mod-vga.c pre-vga.o vga_mod-term_i386_pc_vga.o und-vga.lst -ifneq ($(vga_mod_EXPORTS),no) -CLEANFILES += def-vga.lst -DEFSYMFILES += def-vga.lst -endif -MOSTLYCLEANFILES += vga_mod-term_i386_pc_vga.d -UNDSYMFILES += und-vga.lst - -vga.mod: pre-vga.o mod-vga.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vga.o mod-vga.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-vga.o: $(vga_mod_DEPENDENCIES) vga_mod-term_i386_pc_vga.o - -rm -f $@ - $(TARGET_CC) $(vga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ vga_mod-term_i386_pc_vga.o - -mod-vga.o: mod-vga.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -c -o $@ $< - -mod-vga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'vga' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(vga_mod_EXPORTS),no) -def-vga.lst: pre-vga.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vga/' > $@ -endif - -und-vga.lst: pre-vga.o - echo 'vga' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -vga_mod-term_i386_pc_vga.o: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -MD -c -o $@ $< --include vga_mod-term_i386_pc_vga.d - -CLEANFILES += cmd-vga_mod-term_i386_pc_vga.lst fs-vga_mod-term_i386_pc_vga.lst partmap-vga_mod-term_i386_pc_vga.lst -COMMANDFILES += cmd-vga_mod-term_i386_pc_vga.lst -FSFILES += fs-vga_mod-term_i386_pc_vga.lst -PARTMAPFILES += partmap-vga_mod-term_i386_pc_vga.lst - -cmd-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga > $@ || (rm -f $@; exit 1) - -fs-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga > $@ || (rm -f $@; exit 1) - -partmap-vga_mod-term_i386_pc_vga.lst: term/i386/pc/vga.c $(term/i386/pc/vga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga > $@ || (rm -f $@; exit 1) - - -vga_mod_CFLAGS = $(COMMON_CFLAGS) -vga_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For memdisk.mod. -memdisk_mod_SOURCES = disk/memdisk.c -CLEANFILES += memdisk.mod mod-memdisk.o mod-memdisk.c pre-memdisk.o memdisk_mod-disk_memdisk.o und-memdisk.lst -ifneq ($(memdisk_mod_EXPORTS),no) -CLEANFILES += def-memdisk.lst -DEFSYMFILES += def-memdisk.lst -endif -MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d -UNDSYMFILES += und-memdisk.lst - -memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memdisk_mod-disk_memdisk.o - -mod-memdisk.o: mod-memdisk.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< - -mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(memdisk_mod_EXPORTS),no) -def-memdisk.lst: pre-memdisk.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memdisk/' > $@ -endif - -und-memdisk.lst: pre-memdisk.o - echo 'memdisk' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< --include memdisk_mod-disk_memdisk.d - -CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst -COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst -FSFILES += fs-memdisk_mod-disk_memdisk.lst -PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst - -cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) - -fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) - -partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) - - -memdisk_mod_CFLAGS = $(COMMON_CFLAGS) -memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pci.mod -pci_mod_SOURCES = bus/pci.c -CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst -ifneq ($(pci_mod_EXPORTS),no) -CLEANFILES += def-pci.lst -DEFSYMFILES += def-pci.lst -endif -MOSTLYCLEANFILES += pci_mod-bus_pci.d -UNDSYMFILES += und-pci.lst - -pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o - -mod-pci.o: mod-pci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< - -mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pci_mod_EXPORTS),no) -def-pci.lst: pre-pci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ -endif - -und-pci.lst: pre-pci.o - echo 'pci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) - $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< --include pci_mod-bus_pci.d - -CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst -COMMANDFILES += cmd-pci_mod-bus_pci.lst -FSFILES += fs-pci_mod-bus_pci.lst -PARTMAPFILES += partmap-pci_mod-bus_pci.lst - -cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) - -fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) - -partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) - - -pci_mod_CFLAGS = $(COMMON_CFLAGS) -pci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lspci.mod -lspci_mod_SOURCES = commands/lspci.c -CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst -ifneq ($(lspci_mod_EXPORTS),no) -CLEANFILES += def-lspci.lst -DEFSYMFILES += def-lspci.lst -endif -MOSTLYCLEANFILES += lspci_mod-commands_lspci.d -UNDSYMFILES += und-lspci.lst - -lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o - -mod-lspci.o: mod-lspci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< - -mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lspci_mod_EXPORTS),no) -def-lspci.lst: pre-lspci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ -endif - -und-lspci.lst: pre-lspci.o - echo 'lspci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< --include lspci_mod-commands_lspci.d - -CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst -COMMANDFILES += cmd-lspci_mod-commands_lspci.lst -FSFILES += fs-lspci_mod-commands_lspci.lst -PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst - -cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) - -fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) - -partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) - - -lspci_mod_CFLAGS = $(COMMON_CFLAGS) -lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For aout.mod -aout_mod_SOURCES = loader/aout.c -CLEANFILES += aout.mod mod-aout.o mod-aout.c pre-aout.o aout_mod-loader_aout.o und-aout.lst -ifneq ($(aout_mod_EXPORTS),no) -CLEANFILES += def-aout.lst -DEFSYMFILES += def-aout.lst -endif -MOSTLYCLEANFILES += aout_mod-loader_aout.d -UNDSYMFILES += und-aout.lst - -aout.mod: pre-aout.o mod-aout.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-aout.o mod-aout.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-aout.o: $(aout_mod_DEPENDENCIES) aout_mod-loader_aout.o - -rm -f $@ - $(TARGET_CC) $(aout_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ aout_mod-loader_aout.o - -mod-aout.o: mod-aout.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -c -o $@ $< - -mod-aout.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'aout' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(aout_mod_EXPORTS),no) -def-aout.lst: pre-aout.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 aout/' > $@ -endif - -und-aout.lst: pre-aout.o - echo 'aout' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -aout_mod-loader_aout.o: loader/aout.c $(loader/aout.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -MD -c -o $@ $< --include aout_mod-loader_aout.d - -CLEANFILES += cmd-aout_mod-loader_aout.lst fs-aout_mod-loader_aout.lst partmap-aout_mod-loader_aout.lst -COMMANDFILES += cmd-aout_mod-loader_aout.lst -FSFILES += fs-aout_mod-loader_aout.lst -PARTMAPFILES += partmap-aout_mod-loader_aout.lst - -cmd-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh aout > $@ || (rm -f $@; exit 1) - -fs-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh aout > $@ || (rm -f $@; exit 1) - -partmap-aout_mod-loader_aout.lst: loader/aout.c $(loader/aout.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(aout_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh aout > $@ || (rm -f $@; exit 1) - - -aout_mod_CFLAGS = $(COMMON_CFLAGS) -aout_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For bsd.mod -bsd_mod_SOURCES = loader/i386/bsd.c -CLEANFILES += bsd.mod mod-bsd.o mod-bsd.c pre-bsd.o bsd_mod-loader_i386_bsd.o und-bsd.lst -ifneq ($(bsd_mod_EXPORTS),no) -CLEANFILES += def-bsd.lst -DEFSYMFILES += def-bsd.lst -endif -MOSTLYCLEANFILES += bsd_mod-loader_i386_bsd.d -UNDSYMFILES += und-bsd.lst - -bsd.mod: pre-bsd.o mod-bsd.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-bsd.o mod-bsd.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-bsd.o: $(bsd_mod_DEPENDENCIES) bsd_mod-loader_i386_bsd.o - -rm -f $@ - $(TARGET_CC) $(bsd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ bsd_mod-loader_i386_bsd.o - -mod-bsd.o: mod-bsd.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -c -o $@ $< - -mod-bsd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'bsd' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(bsd_mod_EXPORTS),no) -def-bsd.lst: pre-bsd.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 bsd/' > $@ -endif - -und-bsd.lst: pre-bsd.o - echo 'bsd' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -bsd_mod-loader_i386_bsd.o: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -MD -c -o $@ $< --include bsd_mod-loader_i386_bsd.d - -CLEANFILES += cmd-bsd_mod-loader_i386_bsd.lst fs-bsd_mod-loader_i386_bsd.lst partmap-bsd_mod-loader_i386_bsd.lst -COMMANDFILES += cmd-bsd_mod-loader_i386_bsd.lst -FSFILES += fs-bsd_mod-loader_i386_bsd.lst -PARTMAPFILES += partmap-bsd_mod-loader_i386_bsd.lst - -cmd-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh bsd > $@ || (rm -f $@; exit 1) - -fs-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh bsd > $@ || (rm -f $@; exit 1) - -partmap-bsd_mod-loader_i386_bsd.lst: loader/i386/bsd.c $(loader/i386/bsd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386 -I$(srcdir)/loader/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(bsd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh bsd > $@ || (rm -f $@; exit 1) - - -bsd_mod_CFLAGS = $(COMMON_CFLAGS) -bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For usb.mod -usb_mod_SOURCES = bus/usb/usb.c bus/usb/usbtrans.c bus/usb/usbhub.c -CLEANFILES += usb.mod mod-usb.o mod-usb.c pre-usb.o usb_mod-bus_usb_usb.o usb_mod-bus_usb_usbtrans.o usb_mod-bus_usb_usbhub.o und-usb.lst -ifneq ($(usb_mod_EXPORTS),no) -CLEANFILES += def-usb.lst -DEFSYMFILES += def-usb.lst -endif -MOSTLYCLEANFILES += usb_mod-bus_usb_usb.d usb_mod-bus_usb_usbtrans.d usb_mod-bus_usb_usbhub.d -UNDSYMFILES += und-usb.lst - -usb.mod: pre-usb.o mod-usb.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(usb_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usb.o mod-usb.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-usb.o: $(usb_mod_DEPENDENCIES) usb_mod-bus_usb_usb.o usb_mod-bus_usb_usbtrans.o usb_mod-bus_usb_usbhub.o - -rm -f $@ - $(TARGET_CC) $(usb_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usb_mod-bus_usb_usb.o usb_mod-bus_usb_usbtrans.o usb_mod-bus_usb_usbhub.o - -mod-usb.o: mod-usb.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -c -o $@ $< - -mod-usb.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'usb' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(usb_mod_EXPORTS),no) -def-usb.lst: pre-usb.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usb/' > $@ -endif - -und-usb.lst: pre-usb.o - echo 'usb' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -usb_mod-bus_usb_usb.o: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) - $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -MD -c -o $@ $< --include usb_mod-bus_usb_usb.d - -CLEANFILES += cmd-usb_mod-bus_usb_usb.lst fs-usb_mod-bus_usb_usb.lst partmap-usb_mod-bus_usb_usb.lst -COMMANDFILES += cmd-usb_mod-bus_usb_usb.lst -FSFILES += fs-usb_mod-bus_usb_usb.lst -PARTMAPFILES += partmap-usb_mod-bus_usb_usb.lst - -cmd-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) - -fs-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) - -partmap-usb_mod-bus_usb_usb.lst: bus/usb/usb.c $(bus/usb/usb.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) - - -usb_mod-bus_usb_usbtrans.o: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) - $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -MD -c -o $@ $< --include usb_mod-bus_usb_usbtrans.d - -CLEANFILES += cmd-usb_mod-bus_usb_usbtrans.lst fs-usb_mod-bus_usb_usbtrans.lst partmap-usb_mod-bus_usb_usbtrans.lst -COMMANDFILES += cmd-usb_mod-bus_usb_usbtrans.lst -FSFILES += fs-usb_mod-bus_usb_usbtrans.lst -PARTMAPFILES += partmap-usb_mod-bus_usb_usbtrans.lst - -cmd-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) - -fs-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) - -partmap-usb_mod-bus_usb_usbtrans.lst: bus/usb/usbtrans.c $(bus/usb/usbtrans.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) - - -usb_mod-bus_usb_usbhub.o: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) - $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -MD -c -o $@ $< --include usb_mod-bus_usb_usbhub.d - -CLEANFILES += cmd-usb_mod-bus_usb_usbhub.lst fs-usb_mod-bus_usb_usbhub.lst partmap-usb_mod-bus_usb_usbhub.lst -COMMANDFILES += cmd-usb_mod-bus_usb_usbhub.lst -FSFILES += fs-usb_mod-bus_usb_usbhub.lst -PARTMAPFILES += partmap-usb_mod-bus_usb_usbhub.lst - -cmd-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb > $@ || (rm -f $@; exit 1) - -fs-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb > $@ || (rm -f $@; exit 1) - -partmap-usb_mod-bus_usb_usbhub.lst: bus/usb/usbhub.c $(bus/usb/usbhub.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb > $@ || (rm -f $@; exit 1) - - -usb_mod_CFLAGS = $(COMMON_CFLAGS) -usb_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For usbtest.mod -usbtest_mod_SOURCES = commands/usbtest.c -CLEANFILES += usbtest.mod mod-usbtest.o mod-usbtest.c pre-usbtest.o usbtest_mod-commands_usbtest.o und-usbtest.lst -ifneq ($(usbtest_mod_EXPORTS),no) -CLEANFILES += def-usbtest.lst -DEFSYMFILES += def-usbtest.lst -endif -MOSTLYCLEANFILES += usbtest_mod-commands_usbtest.d -UNDSYMFILES += und-usbtest.lst - -usbtest.mod: pre-usbtest.o mod-usbtest.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(usbtest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usbtest.o mod-usbtest.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-usbtest.o: $(usbtest_mod_DEPENDENCIES) usbtest_mod-commands_usbtest.o - -rm -f $@ - $(TARGET_CC) $(usbtest_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usbtest_mod-commands_usbtest.o - -mod-usbtest.o: mod-usbtest.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -c -o $@ $< - -mod-usbtest.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'usbtest' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(usbtest_mod_EXPORTS),no) -def-usbtest.lst: pre-usbtest.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usbtest/' > $@ -endif - -und-usbtest.lst: pre-usbtest.o - echo 'usbtest' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -usbtest_mod-commands_usbtest.o: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -MD -c -o $@ $< --include usbtest_mod-commands_usbtest.d - -CLEANFILES += cmd-usbtest_mod-commands_usbtest.lst fs-usbtest_mod-commands_usbtest.lst partmap-usbtest_mod-commands_usbtest.lst -COMMANDFILES += cmd-usbtest_mod-commands_usbtest.lst -FSFILES += fs-usbtest_mod-commands_usbtest.lst -PARTMAPFILES += partmap-usbtest_mod-commands_usbtest.lst - -cmd-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbtest > $@ || (rm -f $@; exit 1) - -fs-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbtest > $@ || (rm -f $@; exit 1) - -partmap-usbtest_mod-commands_usbtest.lst: commands/usbtest.c $(commands/usbtest.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbtest_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbtest > $@ || (rm -f $@; exit 1) - - -usbtest_mod_CFLAGS = $(COMMON_CFLAGS) -usbtest_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For uhci.mod -uhci_mod_SOURCES = bus/usb/uhci.c -CLEANFILES += uhci.mod mod-uhci.o mod-uhci.c pre-uhci.o uhci_mod-bus_usb_uhci.o und-uhci.lst -ifneq ($(uhci_mod_EXPORTS),no) -CLEANFILES += def-uhci.lst -DEFSYMFILES += def-uhci.lst -endif -MOSTLYCLEANFILES += uhci_mod-bus_usb_uhci.d -UNDSYMFILES += und-uhci.lst - -uhci.mod: pre-uhci.o mod-uhci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(uhci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-uhci.o mod-uhci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-uhci.o: $(uhci_mod_DEPENDENCIES) uhci_mod-bus_usb_uhci.o - -rm -f $@ - $(TARGET_CC) $(uhci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ uhci_mod-bus_usb_uhci.o - -mod-uhci.o: mod-uhci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -c -o $@ $< - -mod-uhci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'uhci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(uhci_mod_EXPORTS),no) -def-uhci.lst: pre-uhci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 uhci/' > $@ -endif - -und-uhci.lst: pre-uhci.o - echo 'uhci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -uhci_mod-bus_usb_uhci.o: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) - $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -MD -c -o $@ $< --include uhci_mod-bus_usb_uhci.d - -CLEANFILES += cmd-uhci_mod-bus_usb_uhci.lst fs-uhci_mod-bus_usb_uhci.lst partmap-uhci_mod-bus_usb_uhci.lst -COMMANDFILES += cmd-uhci_mod-bus_usb_uhci.lst -FSFILES += fs-uhci_mod-bus_usb_uhci.lst -PARTMAPFILES += partmap-uhci_mod-bus_usb_uhci.lst - -cmd-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh uhci > $@ || (rm -f $@; exit 1) - -fs-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh uhci > $@ || (rm -f $@; exit 1) - -partmap-uhci_mod-bus_usb_uhci.lst: bus/usb/uhci.c $(bus/usb/uhci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(uhci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh uhci > $@ || (rm -f $@; exit 1) - - -uhci_mod_CFLAGS = $(COMMON_CFLAGS) -uhci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ohci.mod -ohci_mod_SOURCES = bus/usb/ohci.c -CLEANFILES += ohci.mod mod-ohci.o mod-ohci.c pre-ohci.o ohci_mod-bus_usb_ohci.o und-ohci.lst -ifneq ($(ohci_mod_EXPORTS),no) -CLEANFILES += def-ohci.lst -DEFSYMFILES += def-ohci.lst -endif -MOSTLYCLEANFILES += ohci_mod-bus_usb_ohci.d -UNDSYMFILES += und-ohci.lst - -ohci.mod: pre-ohci.o mod-ohci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ohci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ohci.o mod-ohci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ohci.o: $(ohci_mod_DEPENDENCIES) ohci_mod-bus_usb_ohci.o - -rm -f $@ - $(TARGET_CC) $(ohci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ohci_mod-bus_usb_ohci.o - -mod-ohci.o: mod-ohci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -c -o $@ $< - -mod-ohci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ohci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ohci_mod_EXPORTS),no) -def-ohci.lst: pre-ohci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ohci/' > $@ -endif - -und-ohci.lst: pre-ohci.o - echo 'ohci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ohci_mod-bus_usb_ohci.o: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) - $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -MD -c -o $@ $< --include ohci_mod-bus_usb_ohci.d - -CLEANFILES += cmd-ohci_mod-bus_usb_ohci.lst fs-ohci_mod-bus_usb_ohci.lst partmap-ohci_mod-bus_usb_ohci.lst -COMMANDFILES += cmd-ohci_mod-bus_usb_ohci.lst -FSFILES += fs-ohci_mod-bus_usb_ohci.lst -PARTMAPFILES += partmap-ohci_mod-bus_usb_ohci.lst - -cmd-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ohci > $@ || (rm -f $@; exit 1) - -fs-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ohci > $@ || (rm -f $@; exit 1) - -partmap-ohci_mod-bus_usb_ohci.lst: bus/usb/ohci.c $(bus/usb/ohci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus/usb -I$(srcdir)/bus/usb $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ohci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ohci > $@ || (rm -f $@; exit 1) - - -ohci_mod_CFLAGS = $(COMMON_CFLAGS) -ohci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For usbms.mod -usbms_mod_SOURCES = disk/usbms.c -CLEANFILES += usbms.mod mod-usbms.o mod-usbms.c pre-usbms.o usbms_mod-disk_usbms.o und-usbms.lst -ifneq ($(usbms_mod_EXPORTS),no) -CLEANFILES += def-usbms.lst -DEFSYMFILES += def-usbms.lst -endif -MOSTLYCLEANFILES += usbms_mod-disk_usbms.d -UNDSYMFILES += und-usbms.lst - -usbms.mod: pre-usbms.o mod-usbms.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(usbms_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usbms.o mod-usbms.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-usbms.o: $(usbms_mod_DEPENDENCIES) usbms_mod-disk_usbms.o - -rm -f $@ - $(TARGET_CC) $(usbms_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usbms_mod-disk_usbms.o - -mod-usbms.o: mod-usbms.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -c -o $@ $< - -mod-usbms.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'usbms' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(usbms_mod_EXPORTS),no) -def-usbms.lst: pre-usbms.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usbms/' > $@ -endif - -und-usbms.lst: pre-usbms.o - echo 'usbms' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -usbms_mod-disk_usbms.o: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -MD -c -o $@ $< --include usbms_mod-disk_usbms.d - -CLEANFILES += cmd-usbms_mod-disk_usbms.lst fs-usbms_mod-disk_usbms.lst partmap-usbms_mod-disk_usbms.lst -COMMANDFILES += cmd-usbms_mod-disk_usbms.lst -FSFILES += fs-usbms_mod-disk_usbms.lst -PARTMAPFILES += partmap-usbms_mod-disk_usbms.lst - -cmd-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usbms > $@ || (rm -f $@; exit 1) - -fs-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usbms > $@ || (rm -f $@; exit 1) - -partmap-usbms_mod-disk_usbms.lst: disk/usbms.c $(disk/usbms.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usbms_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usbms > $@ || (rm -f $@; exit 1) - - -usbms_mod_CFLAGS = $(COMMON_CFLAGS) -usbms_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For usb_keyboard.mod -usb_keyboard_mod_SOURCES = term/usb_keyboard.c -CLEANFILES += usb_keyboard.mod mod-usb_keyboard.o mod-usb_keyboard.c pre-usb_keyboard.o usb_keyboard_mod-term_usb_keyboard.o und-usb_keyboard.lst -ifneq ($(usb_keyboard_mod_EXPORTS),no) -CLEANFILES += def-usb_keyboard.lst -DEFSYMFILES += def-usb_keyboard.lst -endif -MOSTLYCLEANFILES += usb_keyboard_mod-term_usb_keyboard.d -UNDSYMFILES += und-usb_keyboard.lst - -usb_keyboard.mod: pre-usb_keyboard.o mod-usb_keyboard.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(usb_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-usb_keyboard.o mod-usb_keyboard.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-usb_keyboard.o: $(usb_keyboard_mod_DEPENDENCIES) usb_keyboard_mod-term_usb_keyboard.o - -rm -f $@ - $(TARGET_CC) $(usb_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ usb_keyboard_mod-term_usb_keyboard.o - -mod-usb_keyboard.o: mod-usb_keyboard.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -c -o $@ $< - -mod-usb_keyboard.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'usb_keyboard' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(usb_keyboard_mod_EXPORTS),no) -def-usb_keyboard.lst: pre-usb_keyboard.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 usb_keyboard/' > $@ -endif - -und-usb_keyboard.lst: pre-usb_keyboard.o - echo 'usb_keyboard' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -usb_keyboard_mod-term_usb_keyboard.o: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) - $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -MD -c -o $@ $< --include usb_keyboard_mod-term_usb_keyboard.d - -CLEANFILES += cmd-usb_keyboard_mod-term_usb_keyboard.lst fs-usb_keyboard_mod-term_usb_keyboard.lst partmap-usb_keyboard_mod-term_usb_keyboard.lst -COMMANDFILES += cmd-usb_keyboard_mod-term_usb_keyboard.lst -FSFILES += fs-usb_keyboard_mod-term_usb_keyboard.lst -PARTMAPFILES += partmap-usb_keyboard_mod-term_usb_keyboard.lst - -cmd-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh usb_keyboard > $@ || (rm -f $@; exit 1) - -fs-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh usb_keyboard > $@ || (rm -f $@; exit 1) - -partmap-usb_keyboard_mod-term_usb_keyboard.lst: term/usb_keyboard.c $(term/usb_keyboard.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm -I$(srcdir)/term $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(usb_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh usb_keyboard > $@ || (rm -f $@; exit 1) - - -usb_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) -usb_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pxe.mod -pxe_mod_SOURCES = fs/i386/pc/pxe.c -CLEANFILES += pxe.mod mod-pxe.o mod-pxe.c pre-pxe.o pxe_mod-fs_i386_pc_pxe.o und-pxe.lst -ifneq ($(pxe_mod_EXPORTS),no) -CLEANFILES += def-pxe.lst -DEFSYMFILES += def-pxe.lst -endif -MOSTLYCLEANFILES += pxe_mod-fs_i386_pc_pxe.d -UNDSYMFILES += und-pxe.lst - -pxe.mod: pre-pxe.o mod-pxe.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pxe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pxe.o mod-pxe.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pxe.o: $(pxe_mod_DEPENDENCIES) pxe_mod-fs_i386_pc_pxe.o - -rm -f $@ - $(TARGET_CC) $(pxe_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pxe_mod-fs_i386_pc_pxe.o - -mod-pxe.o: mod-pxe.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -c -o $@ $< - -mod-pxe.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pxe' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pxe_mod_EXPORTS),no) -def-pxe.lst: pre-pxe.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pxe/' > $@ -endif - -und-pxe.lst: pre-pxe.o - echo 'pxe' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pxe_mod-fs_i386_pc_pxe.o: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) - $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -MD -c -o $@ $< --include pxe_mod-fs_i386_pc_pxe.d - -CLEANFILES += cmd-pxe_mod-fs_i386_pc_pxe.lst fs-pxe_mod-fs_i386_pc_pxe.lst partmap-pxe_mod-fs_i386_pc_pxe.lst -COMMANDFILES += cmd-pxe_mod-fs_i386_pc_pxe.lst -FSFILES += fs-pxe_mod-fs_i386_pc_pxe.lst -PARTMAPFILES += partmap-pxe_mod-fs_i386_pc_pxe.lst - -cmd-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxe > $@ || (rm -f $@; exit 1) - -fs-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxe > $@ || (rm -f $@; exit 1) - -partmap-pxe_mod-fs_i386_pc_pxe.lst: fs/i386/pc/pxe.c $(fs/i386/pc/pxe.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs/i386/pc -I$(srcdir)/fs/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxe_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxe > $@ || (rm -f $@; exit 1) - - -pxe_mod_CFLAGS = $(COMMON_CFLAGS) -pxe_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pxecmd.mod -pxecmd_mod_SOURCES = commands/i386/pc/pxecmd.c -CLEANFILES += pxecmd.mod mod-pxecmd.o mod-pxecmd.c pre-pxecmd.o pxecmd_mod-commands_i386_pc_pxecmd.o und-pxecmd.lst -ifneq ($(pxecmd_mod_EXPORTS),no) -CLEANFILES += def-pxecmd.lst -DEFSYMFILES += def-pxecmd.lst -endif -MOSTLYCLEANFILES += pxecmd_mod-commands_i386_pc_pxecmd.d -UNDSYMFILES += und-pxecmd.lst - -pxecmd.mod: pre-pxecmd.o mod-pxecmd.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pxecmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pxecmd.o mod-pxecmd.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pxecmd.o: $(pxecmd_mod_DEPENDENCIES) pxecmd_mod-commands_i386_pc_pxecmd.o - -rm -f $@ - $(TARGET_CC) $(pxecmd_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pxecmd_mod-commands_i386_pc_pxecmd.o - -mod-pxecmd.o: mod-pxecmd.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -c -o $@ $< - -mod-pxecmd.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pxecmd' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pxecmd_mod_EXPORTS),no) -def-pxecmd.lst: pre-pxecmd.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pxecmd/' > $@ -endif - -und-pxecmd.lst: pre-pxecmd.o - echo 'pxecmd' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pxecmd_mod-commands_i386_pc_pxecmd.o: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -MD -c -o $@ $< --include pxecmd_mod-commands_i386_pc_pxecmd.d - -CLEANFILES += cmd-pxecmd_mod-commands_i386_pc_pxecmd.lst fs-pxecmd_mod-commands_i386_pc_pxecmd.lst partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst -COMMANDFILES += cmd-pxecmd_mod-commands_i386_pc_pxecmd.lst -FSFILES += fs-pxecmd_mod-commands_i386_pc_pxecmd.lst -PARTMAPFILES += partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst - -cmd-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pxecmd > $@ || (rm -f $@; exit 1) - -fs-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pxecmd > $@ || (rm -f $@; exit 1) - -partmap-pxecmd_mod-commands_i386_pc_pxecmd.lst: commands/i386/pc/pxecmd.c $(commands/i386/pc/pxecmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386/pc -I$(srcdir)/commands/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pxecmd_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pxecmd > $@ || (rm -f $@; exit 1) - - -pxecmd_mod_CFLAGS = $(COMMON_CFLAGS) -pxecmd_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datetime.mod -datetime_mod_SOURCES = lib/i386/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_i386_datetime.o und-datetime.lst -ifneq ($(datetime_mod_EXPORTS),no) -CLEANFILES += def-datetime.lst -DEFSYMFILES += def-datetime.lst -endif -MOSTLYCLEANFILES += datetime_mod-lib_i386_datetime.d -UNDSYMFILES += und-datetime.lst - -datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_i386_datetime.o - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_i386_datetime.o - -mod-datetime.o: mod-datetime.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< - -mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datetime_mod_EXPORTS),no) -def-datetime.lst: pre-datetime.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ -endif - -und-datetime.lst: pre-datetime.o - echo 'datetime' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datetime_mod-lib_i386_datetime.o: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_i386_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_i386_datetime.lst fs-datetime_mod-lib_i386_datetime.lst partmap-datetime_mod-lib_i386_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_i386_datetime.lst -FSFILES += fs-datetime_mod-lib_i386_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_i386_datetime.lst - -cmd-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_i386_datetime.lst: lib/i386/datetime.c $(lib/i386/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/i386 -I$(srcdir)/lib/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - -datetime_mod_CFLAGS = $(COMMON_CFLAGS) -datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For date.mod -date_mod_SOURCES = commands/date.c -CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst -ifneq ($(date_mod_EXPORTS),no) -CLEANFILES += def-date.lst -DEFSYMFILES += def-date.lst -endif -MOSTLYCLEANFILES += date_mod-commands_date.d -UNDSYMFILES += und-date.lst - -date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o - -mod-date.o: mod-date.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< - -mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(date_mod_EXPORTS),no) -def-date.lst: pre-date.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ -endif - -und-date.lst: pre-date.o - echo 'date' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< --include date_mod-commands_date.d - -CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst -COMMANDFILES += cmd-date_mod-commands_date.lst -FSFILES += fs-date_mod-commands_date.lst -PARTMAPFILES += partmap-date_mod-commands_date.lst - -cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) - -fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) - -partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) - - -date_mod_CFLAGS = $(COMMON_CFLAGS) -date_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datehook.mod -datehook_mod_SOURCES = hook/datehook.c -CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst -ifneq ($(datehook_mod_EXPORTS),no) -CLEANFILES += def-datehook.lst -DEFSYMFILES += def-datehook.lst -endif -MOSTLYCLEANFILES += datehook_mod-hook_datehook.d -UNDSYMFILES += und-datehook.lst - -datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o - -mod-datehook.o: mod-datehook.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< - -mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datehook_mod_EXPORTS),no) -def-datehook.lst: pre-datehook.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ -endif - -und-datehook.lst: pre-datehook.o - echo 'datehook' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) - $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< --include datehook_mod-hook_datehook.d - -CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst -COMMANDFILES += cmd-datehook_mod-hook_datehook.lst -FSFILES += fs-datehook_mod-hook_datehook.lst -PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst - -cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) - -fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) - -partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) - - -datehook_mod_CFLAGS = $(COMMON_CFLAGS) -datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lsmmap.mod -lsmmap_mod_SOURCES = commands/lsmmap.c -CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst -ifneq ($(lsmmap_mod_EXPORTS),no) -CLEANFILES += def-lsmmap.lst -DEFSYMFILES += def-lsmmap.lst -endif -MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d -UNDSYMFILES += und-lsmmap.lst - -lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o - -mod-lsmmap.o: mod-lsmmap.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< - -mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lsmmap_mod_EXPORTS),no) -def-lsmmap.lst: pre-lsmmap.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ -endif - -und-lsmmap.lst: pre-lsmmap.o - echo 'lsmmap' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< --include lsmmap_mod-commands_lsmmap.d - -CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst -COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst -FSFILES += fs-lsmmap_mod-commands_lsmmap.lst -PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst - -cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) - -fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) - -partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) - - -lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) -lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ata_pthru.mod. -ata_pthru_mod_SOURCES = disk/ata_pthru.c -CLEANFILES += ata_pthru.mod mod-ata_pthru.o mod-ata_pthru.c pre-ata_pthru.o ata_pthru_mod-disk_ata_pthru.o und-ata_pthru.lst -ifneq ($(ata_pthru_mod_EXPORTS),no) -CLEANFILES += def-ata_pthru.lst -DEFSYMFILES += def-ata_pthru.lst -endif -MOSTLYCLEANFILES += ata_pthru_mod-disk_ata_pthru.d -UNDSYMFILES += und-ata_pthru.lst - -ata_pthru.mod: pre-ata_pthru.o mod-ata_pthru.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ata_pthru_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ata_pthru.o mod-ata_pthru.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ata_pthru.o: $(ata_pthru_mod_DEPENDENCIES) ata_pthru_mod-disk_ata_pthru.o - -rm -f $@ - $(TARGET_CC) $(ata_pthru_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ata_pthru_mod-disk_ata_pthru.o - -mod-ata_pthru.o: mod-ata_pthru.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -c -o $@ $< - -mod-ata_pthru.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ata_pthru' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ata_pthru_mod_EXPORTS),no) -def-ata_pthru.lst: pre-ata_pthru.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ata_pthru/' > $@ -endif - -und-ata_pthru.lst: pre-ata_pthru.o - echo 'ata_pthru' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ata_pthru_mod-disk_ata_pthru.o: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -MD -c -o $@ $< --include ata_pthru_mod-disk_ata_pthru.d - -CLEANFILES += cmd-ata_pthru_mod-disk_ata_pthru.lst fs-ata_pthru_mod-disk_ata_pthru.lst partmap-ata_pthru_mod-disk_ata_pthru.lst -COMMANDFILES += cmd-ata_pthru_mod-disk_ata_pthru.lst -FSFILES += fs-ata_pthru_mod-disk_ata_pthru.lst -PARTMAPFILES += partmap-ata_pthru_mod-disk_ata_pthru.lst - -cmd-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ata_pthru > $@ || (rm -f $@; exit 1) - -fs-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ata_pthru > $@ || (rm -f $@; exit 1) - -partmap-ata_pthru_mod-disk_ata_pthru.lst: disk/ata_pthru.c $(disk/ata_pthru.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ata_pthru_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ata_pthru > $@ || (rm -f $@; exit 1) - - -ata_pthru_mod_CFLAGS = $(COMMON_CFLAGS) -ata_pthru_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hdparm.mod. -hdparm_mod_SOURCES = commands/hdparm.c lib/hexdump.c -CLEANFILES += hdparm.mod mod-hdparm.o mod-hdparm.c pre-hdparm.o hdparm_mod-commands_hdparm.o hdparm_mod-lib_hexdump.o und-hdparm.lst -ifneq ($(hdparm_mod_EXPORTS),no) -CLEANFILES += def-hdparm.lst -DEFSYMFILES += def-hdparm.lst -endif -MOSTLYCLEANFILES += hdparm_mod-commands_hdparm.d hdparm_mod-lib_hexdump.d -UNDSYMFILES += und-hdparm.lst - -hdparm.mod: pre-hdparm.o mod-hdparm.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(hdparm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hdparm.o mod-hdparm.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-hdparm.o: $(hdparm_mod_DEPENDENCIES) hdparm_mod-commands_hdparm.o hdparm_mod-lib_hexdump.o - -rm -f $@ - $(TARGET_CC) $(hdparm_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hdparm_mod-commands_hdparm.o hdparm_mod-lib_hexdump.o - -mod-hdparm.o: mod-hdparm.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -c -o $@ $< - -mod-hdparm.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'hdparm' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(hdparm_mod_EXPORTS),no) -def-hdparm.lst: pre-hdparm.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hdparm/' > $@ -endif - -und-hdparm.lst: pre-hdparm.o - echo 'hdparm' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -hdparm_mod-commands_hdparm.o: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -MD -c -o $@ $< --include hdparm_mod-commands_hdparm.d - -CLEANFILES += cmd-hdparm_mod-commands_hdparm.lst fs-hdparm_mod-commands_hdparm.lst partmap-hdparm_mod-commands_hdparm.lst -COMMANDFILES += cmd-hdparm_mod-commands_hdparm.lst -FSFILES += fs-hdparm_mod-commands_hdparm.lst -PARTMAPFILES += partmap-hdparm_mod-commands_hdparm.lst - -cmd-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) - -fs-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) - -partmap-hdparm_mod-commands_hdparm.lst: commands/hdparm.c $(commands/hdparm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) - - -hdparm_mod-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) - $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -MD -c -o $@ $< --include hdparm_mod-lib_hexdump.d - -CLEANFILES += cmd-hdparm_mod-lib_hexdump.lst fs-hdparm_mod-lib_hexdump.lst partmap-hdparm_mod-lib_hexdump.lst -COMMANDFILES += cmd-hdparm_mod-lib_hexdump.lst -FSFILES += fs-hdparm_mod-lib_hexdump.lst -PARTMAPFILES += partmap-hdparm_mod-lib_hexdump.lst - -cmd-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hdparm > $@ || (rm -f $@; exit 1) - -fs-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hdparm > $@ || (rm -f $@; exit 1) - -partmap-hdparm_mod-lib_hexdump.lst: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib -I$(srcdir)/lib $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hdparm_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hdparm > $@ || (rm -f $@; exit 1) - - -hdparm_mod_CFLAGS = $(COMMON_CFLAGS) -hdparm_mod_LDFLAGS = $(COMMON_LDFLAGS) - -include $(srcdir)/conf/i386.mk -include $(srcdir)/conf/common.mk diff --git a/conf/i386.mk b/conf/i386.mk deleted file mode 100644 index 8ae2621a7..000000000 --- a/conf/i386.mk +++ /dev/null @@ -1,192 +0,0 @@ -# -*- makefile -*- -# Generated by genmk.rb, please don't edit! - -pkglib_MODULES += cpuid.mod -cpuid_mod_SOURCES = commands/i386/cpuid.c -CLEANFILES += cpuid.mod mod-cpuid.o mod-cpuid.c pre-cpuid.o cpuid_mod-commands_i386_cpuid.o und-cpuid.lst -ifneq ($(cpuid_mod_EXPORTS),no) -CLEANFILES += def-cpuid.lst -DEFSYMFILES += def-cpuid.lst -endif -MOSTLYCLEANFILES += cpuid_mod-commands_i386_cpuid.d -UNDSYMFILES += und-cpuid.lst - -cpuid.mod: pre-cpuid.o mod-cpuid.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cpuid.o mod-cpuid.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cpuid.o: $(cpuid_mod_DEPENDENCIES) cpuid_mod-commands_i386_cpuid.o - -rm -f $@ - $(TARGET_CC) $(cpuid_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cpuid_mod-commands_i386_cpuid.o - -mod-cpuid.o: mod-cpuid.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -c -o $@ $< - -mod-cpuid.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cpuid' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cpuid_mod_EXPORTS),no) -def-cpuid.lst: pre-cpuid.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cpuid/' > $@ -endif - -und-cpuid.lst: pre-cpuid.o - echo 'cpuid' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cpuid_mod-commands_i386_cpuid.o: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -MD -c -o $@ $< --include cpuid_mod-commands_i386_cpuid.d - -CLEANFILES += cmd-cpuid_mod-commands_i386_cpuid.lst fs-cpuid_mod-commands_i386_cpuid.lst partmap-cpuid_mod-commands_i386_cpuid.lst -COMMANDFILES += cmd-cpuid_mod-commands_i386_cpuid.lst -FSFILES += fs-cpuid_mod-commands_i386_cpuid.lst -PARTMAPFILES += partmap-cpuid_mod-commands_i386_cpuid.lst - -cmd-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cpuid > $@ || (rm -f $@; exit 1) - -fs-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cpuid > $@ || (rm -f $@; exit 1) - -partmap-cpuid_mod-commands_i386_cpuid.lst: commands/i386/cpuid.c $(commands/i386/cpuid.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/i386 -I$(srcdir)/commands/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cpuid_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cpuid > $@ || (rm -f $@; exit 1) - - -cpuid_mod_CFLAGS = $(COMMON_CFLAGS) -cpuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - -pkglib_MODULES += at_keyboard.mod -at_keyboard_mod_SOURCES = term/i386/pc/at_keyboard.c -CLEANFILES += at_keyboard.mod mod-at_keyboard.o mod-at_keyboard.c pre-at_keyboard.o at_keyboard_mod-term_i386_pc_at_keyboard.o und-at_keyboard.lst -ifneq ($(at_keyboard_mod_EXPORTS),no) -CLEANFILES += def-at_keyboard.lst -DEFSYMFILES += def-at_keyboard.lst -endif -MOSTLYCLEANFILES += at_keyboard_mod-term_i386_pc_at_keyboard.d -UNDSYMFILES += und-at_keyboard.lst - -at_keyboard.mod: pre-at_keyboard.o mod-at_keyboard.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(at_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-at_keyboard.o mod-at_keyboard.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-at_keyboard.o: $(at_keyboard_mod_DEPENDENCIES) at_keyboard_mod-term_i386_pc_at_keyboard.o - -rm -f $@ - $(TARGET_CC) $(at_keyboard_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ at_keyboard_mod-term_i386_pc_at_keyboard.o - -mod-at_keyboard.o: mod-at_keyboard.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -c -o $@ $< - -mod-at_keyboard.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'at_keyboard' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(at_keyboard_mod_EXPORTS),no) -def-at_keyboard.lst: pre-at_keyboard.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 at_keyboard/' > $@ -endif - -und-at_keyboard.lst: pre-at_keyboard.o - echo 'at_keyboard' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -at_keyboard_mod-term_i386_pc_at_keyboard.o: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -MD -c -o $@ $< --include at_keyboard_mod-term_i386_pc_at_keyboard.d - -CLEANFILES += cmd-at_keyboard_mod-term_i386_pc_at_keyboard.lst fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst -COMMANDFILES += cmd-at_keyboard_mod-term_i386_pc_at_keyboard.lst -FSFILES += fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst -PARTMAPFILES += partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst - -cmd-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh at_keyboard > $@ || (rm -f $@; exit 1) - -fs-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh at_keyboard > $@ || (rm -f $@; exit 1) - -partmap-at_keyboard_mod-term_i386_pc_at_keyboard.lst: term/i386/pc/at_keyboard.c $(term/i386/pc/at_keyboard.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(at_keyboard_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh at_keyboard > $@ || (rm -f $@; exit 1) - - -at_keyboard_mod_CFLAGS = $(COMMON_CFLAGS) -at_keyboard_mod_LDFLAGS = $(COMMON_LDFLAGS) - -pkglib_MODULES += vga_text.mod -vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c -CLEANFILES += vga_text.mod mod-vga_text.o mod-vga_text.c pre-vga_text.o vga_text_mod-term_i386_pc_vga_text.o vga_text_mod-term_i386_vga_common.o und-vga_text.lst -ifneq ($(vga_text_mod_EXPORTS),no) -CLEANFILES += def-vga_text.lst -DEFSYMFILES += def-vga_text.lst -endif -MOSTLYCLEANFILES += vga_text_mod-term_i386_pc_vga_text.d vga_text_mod-term_i386_vga_common.d -UNDSYMFILES += und-vga_text.lst - -vga_text.mod: pre-vga_text.o mod-vga_text.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(vga_text_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-vga_text.o mod-vga_text.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-vga_text.o: $(vga_text_mod_DEPENDENCIES) vga_text_mod-term_i386_pc_vga_text.o vga_text_mod-term_i386_vga_common.o - -rm -f $@ - $(TARGET_CC) $(vga_text_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ vga_text_mod-term_i386_pc_vga_text.o vga_text_mod-term_i386_vga_common.o - -mod-vga_text.o: mod-vga_text.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -c -o $@ $< - -mod-vga_text.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'vga_text' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(vga_text_mod_EXPORTS),no) -def-vga_text.lst: pre-vga_text.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 vga_text/' > $@ -endif - -und-vga_text.lst: pre-vga_text.o - echo 'vga_text' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -vga_text_mod-term_i386_pc_vga_text.o: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -MD -c -o $@ $< --include vga_text_mod-term_i386_pc_vga_text.d - -CLEANFILES += cmd-vga_text_mod-term_i386_pc_vga_text.lst fs-vga_text_mod-term_i386_pc_vga_text.lst partmap-vga_text_mod-term_i386_pc_vga_text.lst -COMMANDFILES += cmd-vga_text_mod-term_i386_pc_vga_text.lst -FSFILES += fs-vga_text_mod-term_i386_pc_vga_text.lst -PARTMAPFILES += partmap-vga_text_mod-term_i386_pc_vga_text.lst - -cmd-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) - -fs-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) - -partmap-vga_text_mod-term_i386_pc_vga_text.lst: term/i386/pc/vga_text.c $(term/i386/pc/vga_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386/pc -I$(srcdir)/term/i386/pc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) - - -vga_text_mod-term_i386_vga_common.o: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -MD -c -o $@ $< --include vga_text_mod-term_i386_vga_common.d - -CLEANFILES += cmd-vga_text_mod-term_i386_vga_common.lst fs-vga_text_mod-term_i386_vga_common.lst partmap-vga_text_mod-term_i386_vga_common.lst -COMMANDFILES += cmd-vga_text_mod-term_i386_vga_common.lst -FSFILES += fs-vga_text_mod-term_i386_vga_common.lst -PARTMAPFILES += partmap-vga_text_mod-term_i386_vga_common.lst - -cmd-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh vga_text > $@ || (rm -f $@; exit 1) - -fs-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh vga_text > $@ || (rm -f $@; exit 1) - -partmap-vga_text_mod-term_i386_vga_common.lst: term/i386/vga_common.c $(term/i386/vga_common.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/i386 -I$(srcdir)/term/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(vga_text_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh vga_text > $@ || (rm -f $@; exit 1) - - -vga_text_mod_CFLAGS = $(COMMON_CFLAGS) -vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/powerpc-ieee1275.mk b/conf/powerpc-ieee1275.mk deleted file mode 100644 index 7e250a59a..000000000 --- a/conf/powerpc-ieee1275.mk +++ /dev/null @@ -1,1473 +0,0 @@ - -# Generated by genmk.rb, please don't edit! -# -*- makefile -*- - -COMMON_ASFLAGS = -nostdinc -D__ASSEMBLY__ -COMMON_CFLAGS = -ffreestanding -COMMON_LDFLAGS += -nostdlib - -# Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h - -# Images. - -MOSTLYCLEANFILES += symlist.c kernel_syms.lst -DEFSYMFILES += kernel_syms.lst - -kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ - symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ - command.h - -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh - /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh - /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# Programs -pkglib_PROGRAMS = kernel.elf - -# Utilities. -sbin_UTILITIES = grub-mkdevicemap -ifeq ($(enable_grub_emu), yes) -sbin_UTILITIES += grub-emu -endif - -# For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c -CLEANFILES += grub-mkdevicemap$(EXEEXT) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o -MOSTLYCLEANFILES += grub_mkdevicemap-util_grub_mkdevicemap.d grub_mkdevicemap-util_misc.d - -grub-mkdevicemap: $(grub_mkdevicemap_DEPENDENCIES) grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o - $(CC) -o $@ grub_mkdevicemap-util_grub_mkdevicemap.o grub_mkdevicemap-util_misc.o $(LDFLAGS) $(grub_mkdevicemap_LDFLAGS) - -grub_mkdevicemap-util_grub_mkdevicemap.o: util/grub-mkdevicemap.c $(util/grub-mkdevicemap.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_grub_mkdevicemap.d - -grub_mkdevicemap-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkdevicemap_CFLAGS) -MD -c -o $@ $< --include grub_mkdevicemap-util_misc.d - - -# For grub-emu -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/help.c \ - commands/search.c commands/handler.c commands/test.c \ - commands/ls.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/halt.c commands/reboot.c \ - disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ - kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ - kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ - normal/script.c \ - normal/color.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ - partmap/acorn.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - util/powerpc/ieee1275/misc.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ - grub_script.tab.c grub_emu_init.c -CLEANFILES += grub-emu$(EXEEXT) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o -MOSTLYCLEANFILES += grub_emu-commands_minicmd.d grub_emu-commands_cat.d grub_emu-commands_cmp.d grub_emu-commands_configfile.d grub_emu-commands_help.d grub_emu-commands_search.d grub_emu-commands_handler.d grub_emu-commands_test.d grub_emu-commands_ls.d grub_emu-commands_blocklist.d grub_emu-commands_hexdump.d grub_emu-lib_hexdump.d grub_emu-commands_halt.d grub_emu-commands_reboot.d grub_emu-disk_loopback.d grub_emu-fs_affs.d grub_emu-fs_cpio.d grub_emu-fs_fat.d grub_emu-fs_ext2.d grub_emu-fs_hfs.d grub_emu-fs_hfsplus.d grub_emu-fs_iso9660.d grub_emu-fs_udf.d grub_emu-fs_jfs.d grub_emu-fs_minix.d grub_emu-fs_ntfs.d grub_emu-fs_ntfscomp.d grub_emu-fs_reiserfs.d grub_emu-fs_sfs.d grub_emu-fs_ufs.d grub_emu-fs_xfs.d grub_emu-fs_afs.d grub_emu-fs_tar.d grub_emu-io_gzio.d grub_emu-kern_device.d grub_emu-kern_disk.d grub_emu-kern_dl.d grub_emu-kern_elf.d grub_emu-kern_env.d grub_emu-kern_err.d grub_emu-kern_file.d grub_emu-kern_fs.d grub_emu-kern_loader.d grub_emu-kern_main.d grub_emu-kern_misc.d grub_emu-kern_parser.d grub_emu-kern_partition.d grub_emu-kern_rescue.d grub_emu-kern_term.d grub_emu-kern_list.d grub_emu-kern_handler.d grub_emu-fs_fshelp.d grub_emu-kern_command.d grub_emu-kern_corecmd.d grub_emu-commands_extcmd.d grub_emu-lib_arg.d grub_emu-normal_cmdline.d grub_emu-normal_command.d grub_emu-normal_datetime.d grub_emu-normal_completion.d grub_emu-normal_execute.d grub_emu-normal_function.d grub_emu-normal_lexer.d grub_emu-normal_main.d grub_emu-normal_menu.d grub_emu-normal_menu_text.d grub_emu-normal_menu_entry.d grub_emu-normal_menu_viewer.d grub_emu-normal_misc.d grub_emu-normal_script.d grub_emu-normal_color.d grub_emu-partmap_amiga.d grub_emu-partmap_apple.d grub_emu-partmap_pc.d grub_emu-partmap_sun.d grub_emu-partmap_acorn.d grub_emu-util_console.d grub_emu-util_hostfs.d grub_emu-util_grub_emu.d grub_emu-util_misc.d grub_emu-util_hostdisk.d grub_emu-util_getroot.d grub_emu-util_powerpc_ieee1275_misc.d grub_emu-disk_raid.d grub_emu-disk_raid5_recover.d grub_emu-disk_raid6_recover.d grub_emu-disk_mdraid_linux.d grub_emu-disk_dmraid_nvidia.d grub_emu-disk_lvm.d grub_emu-commands_parttool.d grub_emu-parttool_pcpart.d grub_emu-grub_script_tab.d grub_emu-grub_emu_init.d - -grub-emu: $(grub_emu_DEPENDENCIES) grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o - $(CC) -o $@ grub_emu-commands_minicmd.o grub_emu-commands_cat.o grub_emu-commands_cmp.o grub_emu-commands_configfile.o grub_emu-commands_help.o grub_emu-commands_search.o grub_emu-commands_handler.o grub_emu-commands_test.o grub_emu-commands_ls.o grub_emu-commands_blocklist.o grub_emu-commands_hexdump.o grub_emu-lib_hexdump.o grub_emu-commands_halt.o grub_emu-commands_reboot.o grub_emu-disk_loopback.o grub_emu-fs_affs.o grub_emu-fs_cpio.o grub_emu-fs_fat.o grub_emu-fs_ext2.o grub_emu-fs_hfs.o grub_emu-fs_hfsplus.o grub_emu-fs_iso9660.o grub_emu-fs_udf.o grub_emu-fs_jfs.o grub_emu-fs_minix.o grub_emu-fs_ntfs.o grub_emu-fs_ntfscomp.o grub_emu-fs_reiserfs.o grub_emu-fs_sfs.o grub_emu-fs_ufs.o grub_emu-fs_xfs.o grub_emu-fs_afs.o grub_emu-fs_tar.o grub_emu-io_gzio.o grub_emu-kern_device.o grub_emu-kern_disk.o grub_emu-kern_dl.o grub_emu-kern_elf.o grub_emu-kern_env.o grub_emu-kern_err.o grub_emu-kern_file.o grub_emu-kern_fs.o grub_emu-kern_loader.o grub_emu-kern_main.o grub_emu-kern_misc.o grub_emu-kern_parser.o grub_emu-kern_partition.o grub_emu-kern_rescue.o grub_emu-kern_term.o grub_emu-kern_list.o grub_emu-kern_handler.o grub_emu-fs_fshelp.o grub_emu-kern_command.o grub_emu-kern_corecmd.o grub_emu-commands_extcmd.o grub_emu-lib_arg.o grub_emu-normal_cmdline.o grub_emu-normal_command.o grub_emu-normal_datetime.o grub_emu-normal_completion.o grub_emu-normal_execute.o grub_emu-normal_function.o grub_emu-normal_lexer.o grub_emu-normal_main.o grub_emu-normal_menu.o grub_emu-normal_menu_text.o grub_emu-normal_menu_entry.o grub_emu-normal_menu_viewer.o grub_emu-normal_misc.o grub_emu-normal_script.o grub_emu-normal_color.o grub_emu-partmap_amiga.o grub_emu-partmap_apple.o grub_emu-partmap_pc.o grub_emu-partmap_sun.o grub_emu-partmap_acorn.o grub_emu-util_console.o grub_emu-util_hostfs.o grub_emu-util_grub_emu.o grub_emu-util_misc.o grub_emu-util_hostdisk.o grub_emu-util_getroot.o grub_emu-util_powerpc_ieee1275_misc.o grub_emu-disk_raid.o grub_emu-disk_raid5_recover.o grub_emu-disk_raid6_recover.o grub_emu-disk_mdraid_linux.o grub_emu-disk_dmraid_nvidia.o grub_emu-disk_lvm.o grub_emu-commands_parttool.o grub_emu-parttool_pcpart.o grub_emu-grub_script_tab.o grub_emu-grub_emu_init.o $(LDFLAGS) $(grub_emu_LDFLAGS) - -grub_emu-commands_minicmd.o: commands/minicmd.c $(commands/minicmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_minicmd.d - -grub_emu-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cat.d - -grub_emu-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_cmp.d - -grub_emu-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_configfile.d - -grub_emu-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_help.d - -grub_emu-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_search.d - -grub_emu-commands_handler.o: commands/handler.c $(commands/handler.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_handler.d - -grub_emu-commands_test.o: commands/test.c $(commands/test.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_test.d - -grub_emu-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_ls.d - -grub_emu-commands_blocklist.o: commands/blocklist.c $(commands/blocklist.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_blocklist.d - -grub_emu-commands_hexdump.o: commands/hexdump.c $(commands/hexdump.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_hexdump.d - -grub_emu-lib_hexdump.o: lib/hexdump.c $(lib/hexdump.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_hexdump.d - -grub_emu-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_halt.d - -grub_emu-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_reboot.d - -grub_emu-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_loopback.d - -grub_emu-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_affs.d - -grub_emu-fs_cpio.o: fs/cpio.c $(fs/cpio.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_cpio.d - -grub_emu-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fat.d - -grub_emu-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ext2.d - -grub_emu-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfs.d - -grub_emu-fs_hfsplus.o: fs/hfsplus.c $(fs/hfsplus.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_hfsplus.d - -grub_emu-fs_iso9660.o: fs/iso9660.c $(fs/iso9660.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_iso9660.d - -grub_emu-fs_udf.o: fs/udf.c $(fs/udf.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_udf.d - -grub_emu-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_jfs.d - -grub_emu-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_minix.d - -grub_emu-fs_ntfs.o: fs/ntfs.c $(fs/ntfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfs.d - -grub_emu-fs_ntfscomp.o: fs/ntfscomp.c $(fs/ntfscomp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ntfscomp.d - -grub_emu-fs_reiserfs.o: fs/reiserfs.c $(fs/reiserfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_reiserfs.d - -grub_emu-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_sfs.d - -grub_emu-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_ufs.d - -grub_emu-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_xfs.d - -grub_emu-fs_afs.o: fs/afs.c $(fs/afs.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_afs.d - -grub_emu-fs_tar.o: fs/tar.c $(fs/tar.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_tar.d - -grub_emu-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(CC) -Iio -I$(srcdir)/io $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-io_gzio.d - -grub_emu-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_device.d - -grub_emu-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_disk.d - -grub_emu-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_dl.d - -grub_emu-kern_elf.o: kern/elf.c $(kern/elf.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_elf.d - -grub_emu-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_env.d - -grub_emu-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_err.d - -grub_emu-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_file.d - -grub_emu-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_fs.d - -grub_emu-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_loader.d - -grub_emu-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_main.d - -grub_emu-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_misc.d - -grub_emu-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_parser.d - -grub_emu-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_partition.d - -grub_emu-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_rescue.d - -grub_emu-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_term.d - -grub_emu-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_list.d - -grub_emu-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_handler.d - -grub_emu-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(CC) -Ifs -I$(srcdir)/fs $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-fs_fshelp.d - -grub_emu-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_command.d - -grub_emu-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(CC) -Ikern -I$(srcdir)/kern $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-kern_corecmd.d - -grub_emu-commands_extcmd.o: commands/extcmd.c $(commands/extcmd.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_extcmd.d - -grub_emu-lib_arg.o: lib/arg.c $(lib/arg.c_DEPENDENCIES) - $(CC) -Ilib -I$(srcdir)/lib $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-lib_arg.d - -grub_emu-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_cmdline.d - -grub_emu-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_command.d - -grub_emu-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_datetime.d - -grub_emu-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_completion.d - -grub_emu-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_execute.d - -grub_emu-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_function.d - -grub_emu-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_lexer.d - -grub_emu-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_main.d - -grub_emu-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu.d - -grub_emu-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_text.d - -grub_emu-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_entry.d - -grub_emu-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_menu_viewer.d - -grub_emu-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_misc.d - -grub_emu-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_script.d - -grub_emu-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(CC) -Inormal -I$(srcdir)/normal $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-normal_color.d - -grub_emu-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_amiga.d - -grub_emu-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_apple.d - -grub_emu-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_pc.d - -grub_emu-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_sun.d - -grub_emu-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) - $(CC) -Ipartmap -I$(srcdir)/partmap $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-partmap_acorn.d - -grub_emu-util_console.o: util/console.c $(util/console.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_console.d - -grub_emu-util_hostfs.o: util/hostfs.c $(util/hostfs.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostfs.d - -grub_emu-util_grub_emu.o: util/grub-emu.c $(util/grub-emu.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_grub_emu.d - -grub_emu-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_misc.d - -grub_emu-util_hostdisk.o: util/hostdisk.c $(util/hostdisk.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_hostdisk.d - -grub_emu-util_getroot.o: util/getroot.c $(util/getroot.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_getroot.d - -grub_emu-util_powerpc_ieee1275_misc.o: util/powerpc/ieee1275/misc.c $(util/powerpc/ieee1275/misc.c_DEPENDENCIES) - $(CC) -Iutil/powerpc/ieee1275 -I$(srcdir)/util/powerpc/ieee1275 $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-util_powerpc_ieee1275_misc.d - -grub_emu-disk_raid.o: disk/raid.c $(disk/raid.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid.d - -grub_emu-disk_raid5_recover.o: disk/raid5_recover.c $(disk/raid5_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid5_recover.d - -grub_emu-disk_raid6_recover.o: disk/raid6_recover.c $(disk/raid6_recover.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_raid6_recover.d - -grub_emu-disk_mdraid_linux.o: disk/mdraid_linux.c $(disk/mdraid_linux.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_mdraid_linux.d - -grub_emu-disk_dmraid_nvidia.o: disk/dmraid_nvidia.c $(disk/dmraid_nvidia.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_dmraid_nvidia.d - -grub_emu-disk_lvm.o: disk/lvm.c $(disk/lvm.c_DEPENDENCIES) - $(CC) -Idisk -I$(srcdir)/disk $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-disk_lvm.d - -grub_emu-commands_parttool.o: commands/parttool.c $(commands/parttool.c_DEPENDENCIES) - $(CC) -Icommands -I$(srcdir)/commands $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-commands_parttool.d - -grub_emu-parttool_pcpart.o: parttool/pcpart.c $(parttool/pcpart.c_DEPENDENCIES) - $(CC) -Iparttool -I$(srcdir)/parttool $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-parttool_pcpart.d - -grub_emu-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_script_tab.d - -grub_emu-grub_emu_init.o: grub_emu_init.c $(grub_emu_init.c_DEPENDENCIES) - $(CC) -I. -I$(srcdir)/. $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_emu_CFLAGS) -MD -c -o $@ $< --include grub_emu-grub_emu_init.d - - -grub_emu_LDFLAGS = $(LIBCURSES) - -kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ - kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ - kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/ieee1275/init.c \ - kern/ieee1275/mmap.c \ - term/ieee1275/ofconsole.c \ - kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ - kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ - kern/generic/millisleep.c kern/time.c \ - symlist.c kern/powerpc/cache.S -CLEANFILES += kernel.elf kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o -MOSTLYCLEANFILES += kernel_elf-kern_powerpc_ieee1275_startup.d kernel_elf-kern_ieee1275_cmain.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_err.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-kern_list.d kernel_elf-kern_handler.d kernel_elf-kern_command.d kernel_elf-kern_corecmd.d kernel_elf-kern_ieee1275_init.d kernel_elf-kern_ieee1275_mmap.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_parser.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_powerpc_dl.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_time.d kernel_elf-symlist.d kernel_elf-kern_powerpc_cache.d - -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o - $(TARGET_CC) -o $@ kernel_elf-kern_powerpc_ieee1275_startup.o kernel_elf-kern_ieee1275_cmain.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_err.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-kern_list.o kernel_elf-kern_handler.o kernel_elf-kern_command.o kernel_elf-kern_corecmd.o kernel_elf-kern_ieee1275_init.o kernel_elf-kern_ieee1275_mmap.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_parser.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_powerpc_dl.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_time.o kernel_elf-symlist.o kernel_elf-kern_powerpc_cache.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) - -kernel_elf-kern_powerpc_ieee1275_startup.o: kern/powerpc/ieee1275/startup.S $(kern/powerpc/ieee1275/startup.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc/ieee1275 -I$(srcdir)/kern/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_ieee1275_startup.d - -kernel_elf-kern_ieee1275_cmain.o: kern/ieee1275/cmain.c $(kern/ieee1275/cmain.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_cmain.d - -kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_ieee1275.d - -kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_main.d - -kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_device.d - -kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_disk.d - -kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_dl.d - -kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_err.d - -kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_file.d - -kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_fs.d - -kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_misc.d - -kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_mm.d - -kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_loader.d - -kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_rescue.d - -kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_term.d - -kernel_elf-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_list.d - -kernel_elf-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_handler.d - -kernel_elf-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_command.d - -kernel_elf-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_corecmd.d - -kernel_elf-kern_ieee1275_init.o: kern/ieee1275/init.c $(kern/ieee1275/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_init.d - -kernel_elf-kern_ieee1275_mmap.o: kern/ieee1275/mmap.c $(kern/ieee1275/mmap.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_mmap.d - -kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_ieee1275_ofconsole.d - -kernel_elf-kern_ieee1275_openfw.o: kern/ieee1275/openfw.c $(kern/ieee1275/openfw.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_openfw.d - -kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-disk_ieee1275_ofdisk.d - -kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_parser.d - -kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_partition.d - -kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_env.d - -kernel_elf-kern_powerpc_dl.o: kern/powerpc/dl.c $(kern/powerpc/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_dl.d - -kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_generic_millisleep.d - -kernel_elf-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_time.d - -kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-symlist.d - -kernel_elf-kern_powerpc_cache.o: kern/powerpc/cache.S $(kern/powerpc/cache.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/powerpc -I$(srcdir)/kern/powerpc $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_powerpc_cache.d - -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ - -Wl,-N,-S,-Ttext,0x200000,-Bstatic - -# Scripts. -sbin_SCRIPTS = grub-install -bin_SCRIPTS = grub-mkrescue - -# For grub-install. -grub_install_SOURCES = util/ieee1275/grub-install.in -CLEANFILES += grub-install - -grub-install: util/ieee1275/grub-install.in $(util/ieee1275/grub-install.in_DEPENDENCIES) config.status - ./config.status --file=grub-install:util/ieee1275/grub-install.in - chmod +x $@ - - -# For grub-mkrescue. -grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in -CLEANFILES += grub-mkrescue - -grub-mkrescue: util/powerpc/ieee1275/grub-mkrescue.in $(util/powerpc/ieee1275/grub-mkrescue.in_DEPENDENCIES) config.status - ./config.status --file=grub-mkrescue:util/powerpc/ieee1275/grub-mkrescue.in - chmod +x $@ - - -# Modules. -pkglib_MODULES = halt.mod \ - linux.mod \ - normal.mod \ - reboot.mod \ - suspend.mod \ - multiboot.mod \ - memdisk.mod \ - lsmmap.mod - -# For linux.mod. -linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_powerpc_ieee1275_linux.o und-linux.lst -ifneq ($(linux_mod_EXPORTS),no) -CLEANFILES += def-linux.lst -DEFSYMFILES += def-linux.lst -endif -MOSTLYCLEANFILES += linux_mod-loader_powerpc_ieee1275_linux.d -UNDSYMFILES += und-linux.lst - -linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_powerpc_ieee1275_linux.o - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_powerpc_ieee1275_linux.o - -mod-linux.o: mod-linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< - -mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(linux_mod_EXPORTS),no) -def-linux.lst: pre-linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ -endif - -und-linux.lst: pre-linux.o - echo 'linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -linux_mod-loader_powerpc_ieee1275_linux.o: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_powerpc_ieee1275_linux.d - -CLEANFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux.lst fs-linux_mod-loader_powerpc_ieee1275_linux.lst partmap-linux_mod-loader_powerpc_ieee1275_linux.lst -COMMANDFILES += cmd-linux_mod-loader_powerpc_ieee1275_linux.lst -FSFILES += fs-linux_mod-loader_powerpc_ieee1275_linux.lst -PARTMAPFILES += partmap-linux_mod-loader_powerpc_ieee1275_linux.lst - -cmd-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) - -fs-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) - -partmap-linux_mod-loader_powerpc_ieee1275_linux.lst: loader/powerpc/ieee1275/linux.c $(loader/powerpc/ieee1275/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/powerpc/ieee1275 -I$(srcdir)/loader/powerpc/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) - - -linux_mod_CFLAGS = $(COMMON_CFLAGS) -linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/powerpc/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o und-normal.lst -ifneq ($(normal_mod_EXPORTS),no) -CLEANFILES += def-normal.lst -DEFSYMFILES += def-normal.lst -endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_datetime.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_powerpc_setjmp.d -UNDSYMFILES += und-normal.lst - -normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_powerpc_setjmp.o - -mod-normal.o: mod-normal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(normal_mod_EXPORTS),no) -def-normal.lst: pre-normal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ -endif - -und-normal.lst: pre-normal.o - echo 'normal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_cmdline.d - -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst -COMMANDFILES += cmd-normal_mod-normal_cmdline.lst -FSFILES += fs-normal_mod-normal_cmdline.lst -PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst - -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_command.d - -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst -COMMANDFILES += cmd-normal_mod-normal_command.lst -FSFILES += fs-normal_mod-normal_command.lst -PARTMAPFILES += partmap-normal_mod-normal_command.lst - -cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_datetime.d - -CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst -COMMANDFILES += cmd-normal_mod-normal_datetime.lst -FSFILES += fs-normal_mod-normal_datetime.lst -PARTMAPFILES += partmap-normal_mod-normal_datetime.lst - -cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_completion.d - -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst -COMMANDFILES += cmd-normal_mod-normal_completion.lst -FSFILES += fs-normal_mod-normal_completion.lst -PARTMAPFILES += partmap-normal_mod-normal_completion.lst - -cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_execute.d - -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst -COMMANDFILES += cmd-normal_mod-normal_execute.lst -FSFILES += fs-normal_mod-normal_execute.lst -PARTMAPFILES += partmap-normal_mod-normal_execute.lst - -cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_function.d - -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst -COMMANDFILES += cmd-normal_mod-normal_function.lst -FSFILES += fs-normal_mod-normal_function.lst -PARTMAPFILES += partmap-normal_mod-normal_function.lst - -cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_lexer.d - -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst -COMMANDFILES += cmd-normal_mod-normal_lexer.lst -FSFILES += fs-normal_mod-normal_lexer.lst -PARTMAPFILES += partmap-normal_mod-normal_lexer.lst - -cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_main.d - -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst -COMMANDFILES += cmd-normal_mod-normal_main.lst -FSFILES += fs-normal_mod-normal_main.lst -PARTMAPFILES += partmap-normal_mod-normal_main.lst - -cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu.d - -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst -COMMANDFILES += cmd-normal_mod-normal_menu.lst -FSFILES += fs-normal_mod-normal_menu.lst -PARTMAPFILES += partmap-normal_mod-normal_menu.lst - -cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_text.d - -CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst -COMMANDFILES += cmd-normal_mod-normal_menu_text.lst -FSFILES += fs-normal_mod-normal_menu_text.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst - -cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_viewer.d - -CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst -COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst -FSFILES += fs-normal_mod-normal_menu_viewer.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst - -cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_entry.d - -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst -COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst -FSFILES += fs-normal_mod-normal_menu_entry.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst - -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_misc.d - -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst -COMMANDFILES += cmd-normal_mod-normal_misc.lst -FSFILES += fs-normal_mod-normal_misc.lst -PARTMAPFILES += partmap-normal_mod-normal_misc.lst - -cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_script.d - -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst -COMMANDFILES += cmd-normal_mod-normal_script.lst -FSFILES += fs-normal_mod-normal_script.lst -PARTMAPFILES += partmap-normal_mod-normal_script.lst - -cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_powerpc_setjmp.o: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) - $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< --include normal_mod-normal_powerpc_setjmp.d - -CLEANFILES += cmd-normal_mod-normal_powerpc_setjmp.lst fs-normal_mod-normal_powerpc_setjmp.lst partmap-normal_mod-normal_powerpc_setjmp.lst -COMMANDFILES += cmd-normal_mod-normal_powerpc_setjmp.lst -FSFILES += fs-normal_mod-normal_powerpc_setjmp.lst -PARTMAPFILES += partmap-normal_mod-normal_powerpc_setjmp.lst - -cmd-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_powerpc_setjmp.lst: normal/powerpc/setjmp.S $(normal/powerpc/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/powerpc -I$(srcdir)/normal/powerpc $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For suspend.mod -suspend_mod_SOURCES = commands/ieee1275/suspend.c -CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o und-suspend.lst -ifneq ($(suspend_mod_EXPORTS),no) -CLEANFILES += def-suspend.lst -DEFSYMFILES += def-suspend.lst -endif -MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d -UNDSYMFILES += und-suspend.lst - -suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o - -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ suspend_mod-commands_ieee1275_suspend.o - -mod-suspend.o: mod-suspend.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $< - -mod-suspend.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(suspend_mod_EXPORTS),no) -def-suspend.lst: pre-suspend.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 suspend/' > $@ -endif - -und-suspend.lst: pre-suspend.o - echo 'suspend' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< --include suspend_mod-commands_ieee1275_suspend.d - -CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst partmap-suspend_mod-commands_ieee1275_suspend.lst -COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst -FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst -PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst - -cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) - -fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) - -partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) - - -suspend_mod_CFLAGS = $(COMMON_CFLAGS) -suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod -reboot_mod_SOURCES = commands/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst -ifneq ($(reboot_mod_EXPORTS),no) -CLEANFILES += def-reboot.lst -DEFSYMFILES += def-reboot.lst -endif -MOSTLYCLEANFILES += reboot_mod-commands_reboot.d -UNDSYMFILES += und-reboot.lst - -reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o - -mod-reboot.o: mod-reboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< - -mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reboot_mod_EXPORTS),no) -def-reboot.lst: pre-reboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ -endif - -und-reboot.lst: pre-reboot.o - echo 'reboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_reboot.d - -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_reboot.lst -FSFILES += fs-reboot_mod-commands_reboot.lst -PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst - -cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod_CFLAGS = $(COMMON_CFLAGS) -reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For halt.mod -halt_mod_SOURCES = commands/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst -ifneq ($(halt_mod_EXPORTS),no) -CLEANFILES += def-halt.lst -DEFSYMFILES += def-halt.lst -endif -MOSTLYCLEANFILES += halt_mod-commands_halt.d -UNDSYMFILES += und-halt.lst - -halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o - -mod-halt.o: mod-halt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< - -mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(halt_mod_EXPORTS),no) -def-halt.lst: pre-halt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ -endif - -und-halt.lst: pre-halt.o - echo 'halt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_halt.d - -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst -COMMANDFILES += cmd-halt_mod-commands_halt.lst -FSFILES += fs-halt_mod-commands_halt.lst -PARTMAPFILES += partmap-halt_mod-commands_halt.lst - -cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod_CFLAGS = $(COMMON_CFLAGS) -halt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For multiboot.mod -multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ - loader/multiboot2.c \ - loader/multiboot_loader.c -CLEANFILES += multiboot.mod mod-multiboot.o mod-multiboot.c pre-multiboot.o multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o und-multiboot.lst -ifneq ($(multiboot_mod_EXPORTS),no) -CLEANFILES += def-multiboot.lst -DEFSYMFILES += def-multiboot.lst -endif -MOSTLYCLEANFILES += multiboot_mod-loader_ieee1275_multiboot2.d multiboot_mod-loader_multiboot2.d multiboot_mod-loader_multiboot_loader.d -UNDSYMFILES += und-multiboot.lst - -multiboot.mod: pre-multiboot.o mod-multiboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-multiboot.o mod-multiboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-multiboot.o: $(multiboot_mod_DEPENDENCIES) multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -rm -f $@ - $(TARGET_CC) $(multiboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ multiboot_mod-loader_ieee1275_multiboot2.o multiboot_mod-loader_multiboot2.o multiboot_mod-loader_multiboot_loader.o - -mod-multiboot.o: mod-multiboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -c -o $@ $< - -mod-multiboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'multiboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(multiboot_mod_EXPORTS),no) -def-multiboot.lst: pre-multiboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 multiboot/' > $@ -endif - -und-multiboot.lst: pre-multiboot.o - echo 'multiboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -multiboot_mod-loader_ieee1275_multiboot2.o: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_ieee1275_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst fs-multiboot_mod-loader_ieee1275_multiboot2.lst partmap-multiboot_mod-loader_ieee1275_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_ieee1275_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_ieee1275_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_ieee1275_multiboot2.lst - -cmd-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_ieee1275_multiboot2.lst: loader/ieee1275/multiboot2.c $(loader/ieee1275/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/ieee1275 -I$(srcdir)/loader/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot2.o: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot2.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot2.lst fs-multiboot_mod-loader_multiboot2.lst partmap-multiboot_mod-loader_multiboot2.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot2.lst -FSFILES += fs-multiboot_mod-loader_multiboot2.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot2.lst - -cmd-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot2.lst: loader/multiboot2.c $(loader/multiboot2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod-loader_multiboot_loader.o: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -MD -c -o $@ $< --include multiboot_mod-loader_multiboot_loader.d - -CLEANFILES += cmd-multiboot_mod-loader_multiboot_loader.lst fs-multiboot_mod-loader_multiboot_loader.lst partmap-multiboot_mod-loader_multiboot_loader.lst -COMMANDFILES += cmd-multiboot_mod-loader_multiboot_loader.lst -FSFILES += fs-multiboot_mod-loader_multiboot_loader.lst -PARTMAPFILES += partmap-multiboot_mod-loader_multiboot_loader.lst - -cmd-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh multiboot > $@ || (rm -f $@; exit 1) - -fs-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh multiboot > $@ || (rm -f $@; exit 1) - -partmap-multiboot_mod-loader_multiboot_loader.lst: loader/multiboot_loader.c $(loader/multiboot_loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader -I$(srcdir)/loader $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(multiboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh multiboot > $@ || (rm -f $@; exit 1) - - -multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For memdisk.mod. -memdisk_mod_SOURCES = disk/memdisk.c -CLEANFILES += memdisk.mod mod-memdisk.o mod-memdisk.c pre-memdisk.o memdisk_mod-disk_memdisk.o und-memdisk.lst -ifneq ($(memdisk_mod_EXPORTS),no) -CLEANFILES += def-memdisk.lst -DEFSYMFILES += def-memdisk.lst -endif -MOSTLYCLEANFILES += memdisk_mod-disk_memdisk.d -UNDSYMFILES += und-memdisk.lst - -memdisk.mod: pre-memdisk.o mod-memdisk.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-memdisk.o mod-memdisk.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-memdisk.o: $(memdisk_mod_DEPENDENCIES) memdisk_mod-disk_memdisk.o - -rm -f $@ - $(TARGET_CC) $(memdisk_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ memdisk_mod-disk_memdisk.o - -mod-memdisk.o: mod-memdisk.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -c -o $@ $< - -mod-memdisk.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'memdisk' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(memdisk_mod_EXPORTS),no) -def-memdisk.lst: pre-memdisk.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 memdisk/' > $@ -endif - -und-memdisk.lst: pre-memdisk.o - echo 'memdisk' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -memdisk_mod-disk_memdisk.o: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -MD -c -o $@ $< --include memdisk_mod-disk_memdisk.d - -CLEANFILES += cmd-memdisk_mod-disk_memdisk.lst fs-memdisk_mod-disk_memdisk.lst partmap-memdisk_mod-disk_memdisk.lst -COMMANDFILES += cmd-memdisk_mod-disk_memdisk.lst -FSFILES += fs-memdisk_mod-disk_memdisk.lst -PARTMAPFILES += partmap-memdisk_mod-disk_memdisk.lst - -cmd-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh memdisk > $@ || (rm -f $@; exit 1) - -fs-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh memdisk > $@ || (rm -f $@; exit 1) - -partmap-memdisk_mod-disk_memdisk.lst: disk/memdisk.c $(disk/memdisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(memdisk_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh memdisk > $@ || (rm -f $@; exit 1) - - -memdisk_mod_CFLAGS = $(COMMON_CFLAGS) -memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lsmmap.mod -lsmmap_mod_SOURCES = commands/lsmmap.c -CLEANFILES += lsmmap.mod mod-lsmmap.o mod-lsmmap.c pre-lsmmap.o lsmmap_mod-commands_lsmmap.o und-lsmmap.lst -ifneq ($(lsmmap_mod_EXPORTS),no) -CLEANFILES += def-lsmmap.lst -DEFSYMFILES += def-lsmmap.lst -endif -MOSTLYCLEANFILES += lsmmap_mod-commands_lsmmap.d -UNDSYMFILES += und-lsmmap.lst - -lsmmap.mod: pre-lsmmap.o mod-lsmmap.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lsmmap.o mod-lsmmap.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lsmmap.o: $(lsmmap_mod_DEPENDENCIES) lsmmap_mod-commands_lsmmap.o - -rm -f $@ - $(TARGET_CC) $(lsmmap_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lsmmap_mod-commands_lsmmap.o - -mod-lsmmap.o: mod-lsmmap.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -c -o $@ $< - -mod-lsmmap.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lsmmap' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lsmmap_mod_EXPORTS),no) -def-lsmmap.lst: pre-lsmmap.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lsmmap/' > $@ -endif - -und-lsmmap.lst: pre-lsmmap.o - echo 'lsmmap' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lsmmap_mod-commands_lsmmap.o: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -MD -c -o $@ $< --include lsmmap_mod-commands_lsmmap.d - -CLEANFILES += cmd-lsmmap_mod-commands_lsmmap.lst fs-lsmmap_mod-commands_lsmmap.lst partmap-lsmmap_mod-commands_lsmmap.lst -COMMANDFILES += cmd-lsmmap_mod-commands_lsmmap.lst -FSFILES += fs-lsmmap_mod-commands_lsmmap.lst -PARTMAPFILES += partmap-lsmmap_mod-commands_lsmmap.lst - -cmd-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lsmmap > $@ || (rm -f $@; exit 1) - -fs-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lsmmap > $@ || (rm -f $@; exit 1) - -partmap-lsmmap_mod-commands_lsmmap.lst: commands/lsmmap.c $(commands/lsmmap.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lsmmap_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lsmmap > $@ || (rm -f $@; exit 1) - - -lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) -lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) - -include $(srcdir)/conf/common.mk - diff --git a/conf/sparc64-ieee1275.mk b/conf/sparc64-ieee1275.mk deleted file mode 100644 index 571b9cfe3..000000000 --- a/conf/sparc64-ieee1275.mk +++ /dev/null @@ -1,2336 +0,0 @@ - -# Generated by genmk.rb, please don't edit! -# -*- makefile -*- - -COMMON_ASFLAGS = -nostdinc -COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs -COMMON_LDFLAGS = -melf64_sparc -nostdlib - -# Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h - -# Images. - -MOSTLYCLEANFILES += symlist.c kernel_syms.lst -DEFSYMFILES += kernel_syms.lst - -kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ - symbol.h term.h time.h types.h sparc64/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h - -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh - /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# For the parser. -grub_script.tab.c grub_script.tab.h: normal/parser.y - $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh - /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# Programs -pkglib_PROGRAMS = kernel.elf - -# Utilities. -#bin_UTILITIES = grub-mkimage -#ifeq ($(enable_grub_emu), yes) -#bin_UTILITIES += grub-emu -#endif - -# For grub-mkimage. -grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ - util/resolve.c - -# For grub-emu -#grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ -# commands/configfile.c commands/default.c commands/help.c \ -# commands/search.c commands/terminal.c commands/ls.c \ -# commands/timeout.c commands/test.c \ -# commands/halt.c commands/reboot.c \ -# disk/loopback.c \ -# fs/affs.c fs/fat.c fs/ext2.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ -# fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ -# grub_script.tab.c \ -# io/gzio.c \ -# kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ -# kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ -# kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ -# kern/list.c kern/handler.c \ -# normal/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ -# normal/completion.c normal/context.c normal/execute.c \ -# normal/function.c normal/lexer.c \ -# normal/main.c normal/menu.c normal/menu_entry.c \ -# normal/menu_text.c \ -# normal/menu_viewer.c normal/misc.c \ -# partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ -# partmap/acorn.c \ -# util/console.c util/grub-emu.c util/misc.c \ -# util/hostdisk.c util/getroot.c \ -# commands/parttool.c parttool/pcpart.c \ -# util/sparc64/ieee1275/misc.c - -grub_emu_LDFLAGS = $(LIBCURSES) - -kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ - kern/main.c kern/device.c kern/disk.c kern/dl.c kern/file.c \ - kern/fs.c kern/err.c kern/misc.c kern/mm.c kern/loader.c \ - kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ - kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ - kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ - kern/generic/millisleep.c kern/generic/get_time_ms.c \ - kern/sparc64/cache.S kern/parser.c -CLEANFILES += kernel.elf kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_generic_get_time_ms.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o -MOSTLYCLEANFILES += kernel_elf-kern_sparc64_ieee1275_init.d kernel_elf-kern_ieee1275_ieee1275.d kernel_elf-kern_main.d kernel_elf-kern_device.d kernel_elf-kern_disk.d kernel_elf-kern_dl.d kernel_elf-kern_file.d kernel_elf-kern_fs.d kernel_elf-kern_err.d kernel_elf-kern_misc.d kernel_elf-kern_mm.d kernel_elf-kern_loader.d kernel_elf-kern_rescue.d kernel_elf-kern_term.d kernel_elf-term_ieee1275_ofconsole.d kernel_elf-kern_sparc64_ieee1275_openfw.d kernel_elf-disk_ieee1275_ofdisk.d kernel_elf-kern_partition.d kernel_elf-kern_env.d kernel_elf-kern_sparc64_dl.d kernel_elf-symlist.d kernel_elf-kern_generic_millisleep.d kernel_elf-kern_generic_get_time_ms.d kernel_elf-kern_sparc64_cache.d kernel_elf-kern_parser.d - -kernel.elf: $(kernel_elf_DEPENDENCIES) kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_generic_get_time_ms.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o - $(TARGET_CC) -o $@ kernel_elf-kern_sparc64_ieee1275_init.o kernel_elf-kern_ieee1275_ieee1275.o kernel_elf-kern_main.o kernel_elf-kern_device.o kernel_elf-kern_disk.o kernel_elf-kern_dl.o kernel_elf-kern_file.o kernel_elf-kern_fs.o kernel_elf-kern_err.o kernel_elf-kern_misc.o kernel_elf-kern_mm.o kernel_elf-kern_loader.o kernel_elf-kern_rescue.o kernel_elf-kern_term.o kernel_elf-term_ieee1275_ofconsole.o kernel_elf-kern_sparc64_ieee1275_openfw.o kernel_elf-disk_ieee1275_ofdisk.o kernel_elf-kern_partition.o kernel_elf-kern_env.o kernel_elf-kern_sparc64_dl.o kernel_elf-symlist.o kernel_elf-kern_generic_millisleep.o kernel_elf-kern_generic_get_time_ms.o kernel_elf-kern_sparc64_cache.o kernel_elf-kern_parser.o $(TARGET_LDFLAGS) $(kernel_elf_LDFLAGS) - -kernel_elf-kern_sparc64_ieee1275_init.o: kern/sparc64/ieee1275/init.c $(kern/sparc64/ieee1275/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_sparc64_ieee1275_init.d - -kernel_elf-kern_ieee1275_ieee1275.o: kern/ieee1275/ieee1275.c $(kern/ieee1275/ieee1275.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/ieee1275 -I$(srcdir)/kern/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_ieee1275_ieee1275.d - -kernel_elf-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_main.d - -kernel_elf-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_device.d - -kernel_elf-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_disk.d - -kernel_elf-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_dl.d - -kernel_elf-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_file.d - -kernel_elf-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_fs.d - -kernel_elf-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_err.d - -kernel_elf-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_misc.d - -kernel_elf-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_mm.d - -kernel_elf-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_loader.d - -kernel_elf-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_rescue.d - -kernel_elf-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_term.d - -kernel_elf-term_ieee1275_ofconsole.o: term/ieee1275/ofconsole.c $(term/ieee1275/ofconsole.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/ieee1275 -I$(srcdir)/term/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-term_ieee1275_ofconsole.d - -kernel_elf-kern_sparc64_ieee1275_openfw.o: kern/sparc64/ieee1275/openfw.c $(kern/sparc64/ieee1275/openfw.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/sparc64/ieee1275 -I$(srcdir)/kern/sparc64/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_sparc64_ieee1275_openfw.d - -kernel_elf-disk_ieee1275_ofdisk.o: disk/ieee1275/ofdisk.c $(disk/ieee1275/ofdisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk/ieee1275 -I$(srcdir)/disk/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-disk_ieee1275_ofdisk.d - -kernel_elf-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_partition.d - -kernel_elf-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_env.d - -kernel_elf-kern_sparc64_dl.o: kern/sparc64/dl.c $(kern/sparc64/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_sparc64_dl.d - -kernel_elf-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-symlist.d - -kernel_elf-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_generic_millisleep.d - -kernel_elf-kern_generic_get_time_ms.o: kern/generic/get_time_ms.c $(kern/generic/get_time_ms.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_generic_get_time_ms.d - -kernel_elf-kern_sparc64_cache.o: kern/sparc64/cache.S $(kern/sparc64/cache.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/sparc64 -I$(srcdir)/kern/sparc64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_sparc64_cache.d - -kernel_elf-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_elf_CFLAGS) -MD -c -o $@ $< --include kernel_elf-kern_parser.d - -kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc - -# Modules. -#_linux.mod linux.mod -pkglib_MODULES = fat.mod ufs.mod ext2.mod minix.mod \ - hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \ - boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ - pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ - configfile.mod search.mod gzio.mod xfs.mod \ - affs.mod sfs.mod acorn.mod - -# For fshelp.mod. -fshelp_mod_SOURCES = fs/fshelp.c -CLEANFILES += fshelp.mod mod-fshelp.o mod-fshelp.c pre-fshelp.o fshelp_mod-fs_fshelp.o und-fshelp.lst -ifneq ($(fshelp_mod_EXPORTS),no) -CLEANFILES += def-fshelp.lst -DEFSYMFILES += def-fshelp.lst -endif -MOSTLYCLEANFILES += fshelp_mod-fs_fshelp.d -UNDSYMFILES += und-fshelp.lst - -fshelp.mod: pre-fshelp.o mod-fshelp.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fshelp.o mod-fshelp.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fshelp.o: $(fshelp_mod_DEPENDENCIES) fshelp_mod-fs_fshelp.o - -rm -f $@ - $(TARGET_CC) $(fshelp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fshelp_mod-fs_fshelp.o - -mod-fshelp.o: mod-fshelp.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -c -o $@ $< - -mod-fshelp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fshelp' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fshelp_mod_EXPORTS),no) -def-fshelp.lst: pre-fshelp.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fshelp/' > $@ -endif - -und-fshelp.lst: pre-fshelp.o - echo 'fshelp' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fshelp_mod-fs_fshelp.o: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -MD -c -o $@ $< --include fshelp_mod-fs_fshelp.d - -CLEANFILES += cmd-fshelp_mod-fs_fshelp.lst fs-fshelp_mod-fs_fshelp.lst partmap-fshelp_mod-fs_fshelp.lst -COMMANDFILES += cmd-fshelp_mod-fs_fshelp.lst -FSFILES += fs-fshelp_mod-fs_fshelp.lst -PARTMAPFILES += partmap-fshelp_mod-fs_fshelp.lst - -cmd-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fshelp > $@ || (rm -f $@; exit 1) - -fs-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fshelp > $@ || (rm -f $@; exit 1) - -partmap-fshelp_mod-fs_fshelp.lst: fs/fshelp.c $(fs/fshelp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fshelp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fshelp > $@ || (rm -f $@; exit 1) - - -fshelp_mod_CFLAGS = $(COMMON_CFLAGS) -fshelp_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fat.mod. -fat_mod_SOURCES = fs/fat.c -CLEANFILES += fat.mod mod-fat.o mod-fat.c pre-fat.o fat_mod-fs_fat.o und-fat.lst -ifneq ($(fat_mod_EXPORTS),no) -CLEANFILES += def-fat.lst -DEFSYMFILES += def-fat.lst -endif -MOSTLYCLEANFILES += fat_mod-fs_fat.d -UNDSYMFILES += und-fat.lst - -fat.mod: pre-fat.o mod-fat.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fat.o mod-fat.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fat.o: $(fat_mod_DEPENDENCIES) fat_mod-fs_fat.o - -rm -f $@ - $(TARGET_CC) $(fat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fat_mod-fs_fat.o - -mod-fat.o: mod-fat.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -c -o $@ $< - -mod-fat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fat' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fat_mod_EXPORTS),no) -def-fat.lst: pre-fat.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fat/' > $@ -endif - -und-fat.lst: pre-fat.o - echo 'fat' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fat_mod-fs_fat.o: fs/fat.c $(fs/fat.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -MD -c -o $@ $< --include fat_mod-fs_fat.d - -CLEANFILES += cmd-fat_mod-fs_fat.lst fs-fat_mod-fs_fat.lst partmap-fat_mod-fs_fat.lst -COMMANDFILES += cmd-fat_mod-fs_fat.lst -FSFILES += fs-fat_mod-fs_fat.lst -PARTMAPFILES += partmap-fat_mod-fs_fat.lst - -cmd-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fat > $@ || (rm -f $@; exit 1) - -fs-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fat > $@ || (rm -f $@; exit 1) - -partmap-fat_mod-fs_fat.lst: fs/fat.c $(fs/fat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fat > $@ || (rm -f $@; exit 1) - - -fat_mod_CFLAGS = $(COMMON_CFLAGS) -fat_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ext2.mod. -ext2_mod_SOURCES = fs/ext2.c -CLEANFILES += ext2.mod mod-ext2.o mod-ext2.c pre-ext2.o ext2_mod-fs_ext2.o und-ext2.lst -ifneq ($(ext2_mod_EXPORTS),no) -CLEANFILES += def-ext2.lst -DEFSYMFILES += def-ext2.lst -endif -MOSTLYCLEANFILES += ext2_mod-fs_ext2.d -UNDSYMFILES += und-ext2.lst - -ext2.mod: pre-ext2.o mod-ext2.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ext2.o mod-ext2.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ext2.o: $(ext2_mod_DEPENDENCIES) ext2_mod-fs_ext2.o - -rm -f $@ - $(TARGET_CC) $(ext2_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ext2_mod-fs_ext2.o - -mod-ext2.o: mod-ext2.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -c -o $@ $< - -mod-ext2.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ext2' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ext2_mod_EXPORTS),no) -def-ext2.lst: pre-ext2.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ext2/' > $@ -endif - -und-ext2.lst: pre-ext2.o - echo 'ext2' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ext2_mod-fs_ext2.o: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -MD -c -o $@ $< --include ext2_mod-fs_ext2.d - -CLEANFILES += cmd-ext2_mod-fs_ext2.lst fs-ext2_mod-fs_ext2.lst partmap-ext2_mod-fs_ext2.lst -COMMANDFILES += cmd-ext2_mod-fs_ext2.lst -FSFILES += fs-ext2_mod-fs_ext2.lst -PARTMAPFILES += partmap-ext2_mod-fs_ext2.lst - -cmd-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ext2 > $@ || (rm -f $@; exit 1) - -fs-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ext2 > $@ || (rm -f $@; exit 1) - -partmap-ext2_mod-fs_ext2.lst: fs/ext2.c $(fs/ext2.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ext2_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ext2 > $@ || (rm -f $@; exit 1) - - -ext2_mod_CFLAGS = $(COMMON_CFLAGS) -ext2_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ufs.mod. -ufs_mod_SOURCES = fs/ufs.c -CLEANFILES += ufs.mod mod-ufs.o mod-ufs.c pre-ufs.o ufs_mod-fs_ufs.o und-ufs.lst -ifneq ($(ufs_mod_EXPORTS),no) -CLEANFILES += def-ufs.lst -DEFSYMFILES += def-ufs.lst -endif -MOSTLYCLEANFILES += ufs_mod-fs_ufs.d -UNDSYMFILES += und-ufs.lst - -ufs.mod: pre-ufs.o mod-ufs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ufs.o mod-ufs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ufs.o: $(ufs_mod_DEPENDENCIES) ufs_mod-fs_ufs.o - -rm -f $@ - $(TARGET_CC) $(ufs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ufs_mod-fs_ufs.o - -mod-ufs.o: mod-ufs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -c -o $@ $< - -mod-ufs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ufs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ufs_mod_EXPORTS),no) -def-ufs.lst: pre-ufs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ufs/' > $@ -endif - -und-ufs.lst: pre-ufs.o - echo 'ufs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ufs_mod-fs_ufs.o: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -MD -c -o $@ $< --include ufs_mod-fs_ufs.d - -CLEANFILES += cmd-ufs_mod-fs_ufs.lst fs-ufs_mod-fs_ufs.lst partmap-ufs_mod-fs_ufs.lst -COMMANDFILES += cmd-ufs_mod-fs_ufs.lst -FSFILES += fs-ufs_mod-fs_ufs.lst -PARTMAPFILES += partmap-ufs_mod-fs_ufs.lst - -cmd-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ufs > $@ || (rm -f $@; exit 1) - -fs-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ufs > $@ || (rm -f $@; exit 1) - -partmap-ufs_mod-fs_ufs.lst: fs/ufs.c $(fs/ufs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ufs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ufs > $@ || (rm -f $@; exit 1) - - -ufs_mod_CFLAGS = $(COMMON_CFLAGS) -ufs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For minix.mod. -minix_mod_SOURCES = fs/minix.c -CLEANFILES += minix.mod mod-minix.o mod-minix.c pre-minix.o minix_mod-fs_minix.o und-minix.lst -ifneq ($(minix_mod_EXPORTS),no) -CLEANFILES += def-minix.lst -DEFSYMFILES += def-minix.lst -endif -MOSTLYCLEANFILES += minix_mod-fs_minix.d -UNDSYMFILES += und-minix.lst - -minix.mod: pre-minix.o mod-minix.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-minix.o mod-minix.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-minix.o: $(minix_mod_DEPENDENCIES) minix_mod-fs_minix.o - -rm -f $@ - $(TARGET_CC) $(minix_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ minix_mod-fs_minix.o - -mod-minix.o: mod-minix.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -c -o $@ $< - -mod-minix.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'minix' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(minix_mod_EXPORTS),no) -def-minix.lst: pre-minix.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 minix/' > $@ -endif - -und-minix.lst: pre-minix.o - echo 'minix' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -minix_mod-fs_minix.o: fs/minix.c $(fs/minix.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -MD -c -o $@ $< --include minix_mod-fs_minix.d - -CLEANFILES += cmd-minix_mod-fs_minix.lst fs-minix_mod-fs_minix.lst partmap-minix_mod-fs_minix.lst -COMMANDFILES += cmd-minix_mod-fs_minix.lst -FSFILES += fs-minix_mod-fs_minix.lst -PARTMAPFILES += partmap-minix_mod-fs_minix.lst - -cmd-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh minix > $@ || (rm -f $@; exit 1) - -fs-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh minix > $@ || (rm -f $@; exit 1) - -partmap-minix_mod-fs_minix.lst: fs/minix.c $(fs/minix.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(minix_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh minix > $@ || (rm -f $@; exit 1) - - -minix_mod_CFLAGS = $(COMMON_CFLAGS) -minix_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hfs.mod. -hfs_mod_SOURCES = fs/hfs.c -CLEANFILES += hfs.mod mod-hfs.o mod-hfs.c pre-hfs.o hfs_mod-fs_hfs.o und-hfs.lst -ifneq ($(hfs_mod_EXPORTS),no) -CLEANFILES += def-hfs.lst -DEFSYMFILES += def-hfs.lst -endif -MOSTLYCLEANFILES += hfs_mod-fs_hfs.d -UNDSYMFILES += und-hfs.lst - -hfs.mod: pre-hfs.o mod-hfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hfs.o mod-hfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-hfs.o: $(hfs_mod_DEPENDENCIES) hfs_mod-fs_hfs.o - -rm -f $@ - $(TARGET_CC) $(hfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hfs_mod-fs_hfs.o - -mod-hfs.o: mod-hfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -c -o $@ $< - -mod-hfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'hfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(hfs_mod_EXPORTS),no) -def-hfs.lst: pre-hfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hfs/' > $@ -endif - -und-hfs.lst: pre-hfs.o - echo 'hfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -hfs_mod-fs_hfs.o: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -MD -c -o $@ $< --include hfs_mod-fs_hfs.d - -CLEANFILES += cmd-hfs_mod-fs_hfs.lst fs-hfs_mod-fs_hfs.lst partmap-hfs_mod-fs_hfs.lst -COMMANDFILES += cmd-hfs_mod-fs_hfs.lst -FSFILES += fs-hfs_mod-fs_hfs.lst -PARTMAPFILES += partmap-hfs_mod-fs_hfs.lst - -cmd-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hfs > $@ || (rm -f $@; exit 1) - -fs-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hfs > $@ || (rm -f $@; exit 1) - -partmap-hfs_mod-fs_hfs.lst: fs/hfs.c $(fs/hfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hfs > $@ || (rm -f $@; exit 1) - - -hfs_mod_CFLAGS = $(COMMON_CFLAGS) -hfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For jfs.mod. -jfs_mod_SOURCES = fs/jfs.c -CLEANFILES += jfs.mod mod-jfs.o mod-jfs.c pre-jfs.o jfs_mod-fs_jfs.o und-jfs.lst -ifneq ($(jfs_mod_EXPORTS),no) -CLEANFILES += def-jfs.lst -DEFSYMFILES += def-jfs.lst -endif -MOSTLYCLEANFILES += jfs_mod-fs_jfs.d -UNDSYMFILES += und-jfs.lst - -jfs.mod: pre-jfs.o mod-jfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-jfs.o mod-jfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-jfs.o: $(jfs_mod_DEPENDENCIES) jfs_mod-fs_jfs.o - -rm -f $@ - $(TARGET_CC) $(jfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ jfs_mod-fs_jfs.o - -mod-jfs.o: mod-jfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -c -o $@ $< - -mod-jfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'jfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(jfs_mod_EXPORTS),no) -def-jfs.lst: pre-jfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 jfs/' > $@ -endif - -und-jfs.lst: pre-jfs.o - echo 'jfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -jfs_mod-fs_jfs.o: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -MD -c -o $@ $< --include jfs_mod-fs_jfs.d - -CLEANFILES += cmd-jfs_mod-fs_jfs.lst fs-jfs_mod-fs_jfs.lst partmap-jfs_mod-fs_jfs.lst -COMMANDFILES += cmd-jfs_mod-fs_jfs.lst -FSFILES += fs-jfs_mod-fs_jfs.lst -PARTMAPFILES += partmap-jfs_mod-fs_jfs.lst - -cmd-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh jfs > $@ || (rm -f $@; exit 1) - -fs-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh jfs > $@ || (rm -f $@; exit 1) - -partmap-jfs_mod-fs_jfs.lst: fs/jfs.c $(fs/jfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(jfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh jfs > $@ || (rm -f $@; exit 1) - - -jfs_mod_CFLAGS = $(COMMON_CFLAGS) -jfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For iso9660.mod. -iso9660_mod_SOURCES = fs/iso9660.c -iso9660_mod_CFLAGS = $(COMMON_CFLAGS) -iso9660_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For xfs.mod. -xfs_mod_SOURCES = fs/xfs.c -CLEANFILES += xfs.mod mod-xfs.o mod-xfs.c pre-xfs.o xfs_mod-fs_xfs.o und-xfs.lst -ifneq ($(xfs_mod_EXPORTS),no) -CLEANFILES += def-xfs.lst -DEFSYMFILES += def-xfs.lst -endif -MOSTLYCLEANFILES += xfs_mod-fs_xfs.d -UNDSYMFILES += und-xfs.lst - -xfs.mod: pre-xfs.o mod-xfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-xfs.o mod-xfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-xfs.o: $(xfs_mod_DEPENDENCIES) xfs_mod-fs_xfs.o - -rm -f $@ - $(TARGET_CC) $(xfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ xfs_mod-fs_xfs.o - -mod-xfs.o: mod-xfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -c -o $@ $< - -mod-xfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'xfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(xfs_mod_EXPORTS),no) -def-xfs.lst: pre-xfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 xfs/' > $@ -endif - -und-xfs.lst: pre-xfs.o - echo 'xfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -xfs_mod-fs_xfs.o: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -MD -c -o $@ $< --include xfs_mod-fs_xfs.d - -CLEANFILES += cmd-xfs_mod-fs_xfs.lst fs-xfs_mod-fs_xfs.lst partmap-xfs_mod-fs_xfs.lst -COMMANDFILES += cmd-xfs_mod-fs_xfs.lst -FSFILES += fs-xfs_mod-fs_xfs.lst -PARTMAPFILES += partmap-xfs_mod-fs_xfs.lst - -cmd-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh xfs > $@ || (rm -f $@; exit 1) - -fs-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh xfs > $@ || (rm -f $@; exit 1) - -partmap-xfs_mod-fs_xfs.lst: fs/xfs.c $(fs/xfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(xfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh xfs > $@ || (rm -f $@; exit 1) - - -xfs_mod_CFLAGS = $(COMMON_CFLAGS) -xfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For affs.mod. -affs_mod_SOURCES = fs/affs.c -CLEANFILES += affs.mod mod-affs.o mod-affs.c pre-affs.o affs_mod-fs_affs.o und-affs.lst -ifneq ($(affs_mod_EXPORTS),no) -CLEANFILES += def-affs.lst -DEFSYMFILES += def-affs.lst -endif -MOSTLYCLEANFILES += affs_mod-fs_affs.d -UNDSYMFILES += und-affs.lst - -affs.mod: pre-affs.o mod-affs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-affs.o mod-affs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-affs.o: $(affs_mod_DEPENDENCIES) affs_mod-fs_affs.o - -rm -f $@ - $(TARGET_CC) $(affs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ affs_mod-fs_affs.o - -mod-affs.o: mod-affs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -c -o $@ $< - -mod-affs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'affs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(affs_mod_EXPORTS),no) -def-affs.lst: pre-affs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 affs/' > $@ -endif - -und-affs.lst: pre-affs.o - echo 'affs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -affs_mod-fs_affs.o: fs/affs.c $(fs/affs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -MD -c -o $@ $< --include affs_mod-fs_affs.d - -CLEANFILES += cmd-affs_mod-fs_affs.lst fs-affs_mod-fs_affs.lst partmap-affs_mod-fs_affs.lst -COMMANDFILES += cmd-affs_mod-fs_affs.lst -FSFILES += fs-affs_mod-fs_affs.lst -PARTMAPFILES += partmap-affs_mod-fs_affs.lst - -cmd-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh affs > $@ || (rm -f $@; exit 1) - -fs-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh affs > $@ || (rm -f $@; exit 1) - -partmap-affs_mod-fs_affs.lst: fs/affs.c $(fs/affs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(affs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh affs > $@ || (rm -f $@; exit 1) - - -affs_mod_CFLAGS = $(COMMON_CFLAGS) -affs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sfs.mod. -sfs_mod_SOURCES = fs/sfs.c -CLEANFILES += sfs.mod mod-sfs.o mod-sfs.c pre-sfs.o sfs_mod-fs_sfs.o und-sfs.lst -ifneq ($(sfs_mod_EXPORTS),no) -CLEANFILES += def-sfs.lst -DEFSYMFILES += def-sfs.lst -endif -MOSTLYCLEANFILES += sfs_mod-fs_sfs.d -UNDSYMFILES += und-sfs.lst - -sfs.mod: pre-sfs.o mod-sfs.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sfs.o mod-sfs.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-sfs.o: $(sfs_mod_DEPENDENCIES) sfs_mod-fs_sfs.o - -rm -f $@ - $(TARGET_CC) $(sfs_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sfs_mod-fs_sfs.o - -mod-sfs.o: mod-sfs.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -c -o $@ $< - -mod-sfs.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'sfs' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(sfs_mod_EXPORTS),no) -def-sfs.lst: pre-sfs.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sfs/' > $@ -endif - -und-sfs.lst: pre-sfs.o - echo 'sfs' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -sfs_mod-fs_sfs.o: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) - $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -MD -c -o $@ $< --include sfs_mod-fs_sfs.d - -CLEANFILES += cmd-sfs_mod-fs_sfs.lst fs-sfs_mod-fs_sfs.lst partmap-sfs_mod-fs_sfs.lst -COMMANDFILES += cmd-sfs_mod-fs_sfs.lst -FSFILES += fs-sfs_mod-fs_sfs.lst -PARTMAPFILES += partmap-sfs_mod-fs_sfs.lst - -cmd-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sfs > $@ || (rm -f $@; exit 1) - -fs-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sfs > $@ || (rm -f $@; exit 1) - -partmap-sfs_mod-fs_sfs.lst: fs/sfs.c $(fs/sfs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifs -I$(srcdir)/fs $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sfs_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sfs > $@ || (rm -f $@; exit 1) - - -sfs_mod_CFLAGS = $(COMMON_CFLAGS) -sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For _linux.mod. -#_linux_mod_SOURCES = loader/sparc64/ieee1275/linux.c -#_linux_mod_CFLAGS = $(COMMON_CFLAGS) -#_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For linux.mod. -#linux_mod_SOURCES = loader/sparc64/ieee1275/linux_normal.c -#linux_mod_CFLAGS = $(COMMON_CFLAGS) -#linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ - normal/datetime.c normal/completion.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/sparc64/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o und-normal.lst -ifneq ($(normal_mod_EXPORTS),no) -CLEANFILES += def-normal.lst -DEFSYMFILES += def-normal.lst -endif -MOSTLYCLEANFILES += normal_mod-normal_arg.d normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_datetime.d normal_mod-normal_completion.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_sparc64_setjmp.d -UNDSYMFILES += und-normal.lst - -normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_arg.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_datetime.o normal_mod-normal_completion.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_sparc64_setjmp.o - -mod-normal.o: mod-normal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(normal_mod_EXPORTS),no) -def-normal.lst: pre-normal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ -endif - -und-normal.lst: pre-normal.o - echo 'normal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -normal_mod-normal_arg.o: normal/arg.c $(normal/arg.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_arg.d - -CLEANFILES += cmd-normal_mod-normal_arg.lst fs-normal_mod-normal_arg.lst partmap-normal_mod-normal_arg.lst -COMMANDFILES += cmd-normal_mod-normal_arg.lst -FSFILES += fs-normal_mod-normal_arg.lst -PARTMAPFILES += partmap-normal_mod-normal_arg.lst - -cmd-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_arg.lst: normal/arg.c $(normal/arg.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_cmdline.d - -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst -COMMANDFILES += cmd-normal_mod-normal_cmdline.lst -FSFILES += fs-normal_mod-normal_cmdline.lst -PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst - -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_command.d - -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst -COMMANDFILES += cmd-normal_mod-normal_command.lst -FSFILES += fs-normal_mod-normal_command.lst -PARTMAPFILES += partmap-normal_mod-normal_command.lst - -cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_datetime.d - -CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst -COMMANDFILES += cmd-normal_mod-normal_datetime.lst -FSFILES += fs-normal_mod-normal_datetime.lst -PARTMAPFILES += partmap-normal_mod-normal_datetime.lst - -cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_completion.d - -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst -COMMANDFILES += cmd-normal_mod-normal_completion.lst -FSFILES += fs-normal_mod-normal_completion.lst -PARTMAPFILES += partmap-normal_mod-normal_completion.lst - -cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_execute.d - -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst -COMMANDFILES += cmd-normal_mod-normal_execute.lst -FSFILES += fs-normal_mod-normal_execute.lst -PARTMAPFILES += partmap-normal_mod-normal_execute.lst - -cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_function.d - -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst -COMMANDFILES += cmd-normal_mod-normal_function.lst -FSFILES += fs-normal_mod-normal_function.lst -PARTMAPFILES += partmap-normal_mod-normal_function.lst - -cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_lexer.d - -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst -COMMANDFILES += cmd-normal_mod-normal_lexer.lst -FSFILES += fs-normal_mod-normal_lexer.lst -PARTMAPFILES += partmap-normal_mod-normal_lexer.lst - -cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_main.d - -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst -COMMANDFILES += cmd-normal_mod-normal_main.lst -FSFILES += fs-normal_mod-normal_main.lst -PARTMAPFILES += partmap-normal_mod-normal_main.lst - -cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu.d - -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst -COMMANDFILES += cmd-normal_mod-normal_menu.lst -FSFILES += fs-normal_mod-normal_menu.lst -PARTMAPFILES += partmap-normal_mod-normal_menu.lst - -cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_text.d - -CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst -COMMANDFILES += cmd-normal_mod-normal_menu_text.lst -FSFILES += fs-normal_mod-normal_menu_text.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst - -cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_viewer.d - -CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst -COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst -FSFILES += fs-normal_mod-normal_menu_viewer.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst - -cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_entry.d - -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst -COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst -FSFILES += fs-normal_mod-normal_menu_entry.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst - -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_misc.d - -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst -COMMANDFILES += cmd-normal_mod-normal_misc.lst -FSFILES += fs-normal_mod-normal_misc.lst -PARTMAPFILES += partmap-normal_mod-normal_misc.lst - -cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_script.d - -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst -COMMANDFILES += cmd-normal_mod-normal_script.lst -FSFILES += fs-normal_mod-normal_script.lst -PARTMAPFILES += partmap-normal_mod-normal_script.lst - -cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_sparc64_setjmp.o: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) - $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< --include normal_mod-normal_sparc64_setjmp.d - -CLEANFILES += cmd-normal_mod-normal_sparc64_setjmp.lst fs-normal_mod-normal_sparc64_setjmp.lst partmap-normal_mod-normal_sparc64_setjmp.lst -COMMANDFILES += cmd-normal_mod-normal_sparc64_setjmp.lst -FSFILES += fs-normal_mod-normal_sparc64_setjmp.lst -PARTMAPFILES += partmap-normal_mod-normal_sparc64_setjmp.lst - -cmd-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_sparc64_setjmp.lst: normal/sparc64/setjmp.S $(normal/sparc64/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/sparc64 -I$(srcdir)/normal/sparc64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hello.mod. -hello_mod_SOURCES = hello/hello.c -CLEANFILES += hello.mod mod-hello.o mod-hello.c pre-hello.o hello_mod-hello_hello.o und-hello.lst -ifneq ($(hello_mod_EXPORTS),no) -CLEANFILES += def-hello.lst -DEFSYMFILES += def-hello.lst -endif -MOSTLYCLEANFILES += hello_mod-hello_hello.d -UNDSYMFILES += und-hello.lst - -hello.mod: pre-hello.o mod-hello.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-hello.o mod-hello.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-hello.o: $(hello_mod_DEPENDENCIES) hello_mod-hello_hello.o - -rm -f $@ - $(TARGET_CC) $(hello_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ hello_mod-hello_hello.o - -mod-hello.o: mod-hello.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -c -o $@ $< - -mod-hello.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'hello' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(hello_mod_EXPORTS),no) -def-hello.lst: pre-hello.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 hello/' > $@ -endif - -und-hello.lst: pre-hello.o - echo 'hello' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -hello_mod-hello_hello.o: hello/hello.c $(hello/hello.c_DEPENDENCIES) - $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -MD -c -o $@ $< --include hello_mod-hello_hello.d - -CLEANFILES += cmd-hello_mod-hello_hello.lst fs-hello_mod-hello_hello.lst partmap-hello_mod-hello_hello.lst -COMMANDFILES += cmd-hello_mod-hello_hello.lst -FSFILES += fs-hello_mod-hello_hello.lst -PARTMAPFILES += partmap-hello_mod-hello_hello.lst - -cmd-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh hello > $@ || (rm -f $@; exit 1) - -fs-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh hello > $@ || (rm -f $@; exit 1) - -partmap-hello_mod-hello_hello.lst: hello/hello.c $(hello/hello.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihello -I$(srcdir)/hello $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(hello_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh hello > $@ || (rm -f $@; exit 1) - - -hello_mod_CFLAGS = $(COMMON_CFLAGS) -hello_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For boot.mod. -boot_mod_SOURCES = commands/boot.c -CLEANFILES += boot.mod mod-boot.o mod-boot.c pre-boot.o boot_mod-commands_boot.o und-boot.lst -ifneq ($(boot_mod_EXPORTS),no) -CLEANFILES += def-boot.lst -DEFSYMFILES += def-boot.lst -endif -MOSTLYCLEANFILES += boot_mod-commands_boot.d -UNDSYMFILES += und-boot.lst - -boot.mod: pre-boot.o mod-boot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-boot.o mod-boot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-boot.o: $(boot_mod_DEPENDENCIES) boot_mod-commands_boot.o - -rm -f $@ - $(TARGET_CC) $(boot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ boot_mod-commands_boot.o - -mod-boot.o: mod-boot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -c -o $@ $< - -mod-boot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'boot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(boot_mod_EXPORTS),no) -def-boot.lst: pre-boot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 boot/' > $@ -endif - -und-boot.lst: pre-boot.o - echo 'boot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -boot_mod-commands_boot.o: commands/boot.c $(commands/boot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -MD -c -o $@ $< --include boot_mod-commands_boot.d - -CLEANFILES += cmd-boot_mod-commands_boot.lst fs-boot_mod-commands_boot.lst partmap-boot_mod-commands_boot.lst -COMMANDFILES += cmd-boot_mod-commands_boot.lst -FSFILES += fs-boot_mod-commands_boot.lst -PARTMAPFILES += partmap-boot_mod-commands_boot.lst - -cmd-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh boot > $@ || (rm -f $@; exit 1) - -fs-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh boot > $@ || (rm -f $@; exit 1) - -partmap-boot_mod-commands_boot.lst: commands/boot.c $(commands/boot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(boot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh boot > $@ || (rm -f $@; exit 1) - - -boot_mod_CFLAGS = $(COMMON_CFLAGS) -boot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For terminal.mod. -terminal_mod_SOURCES = commands/terminal.c -CLEANFILES += terminal.mod mod-terminal.o mod-terminal.c pre-terminal.o terminal_mod-commands_terminal.o und-terminal.lst -ifneq ($(terminal_mod_EXPORTS),no) -CLEANFILES += def-terminal.lst -DEFSYMFILES += def-terminal.lst -endif -MOSTLYCLEANFILES += terminal_mod-commands_terminal.d -UNDSYMFILES += und-terminal.lst - -terminal.mod: pre-terminal.o mod-terminal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-terminal.o mod-terminal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-terminal.o: $(terminal_mod_DEPENDENCIES) terminal_mod-commands_terminal.o - -rm -f $@ - $(TARGET_CC) $(terminal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ terminal_mod-commands_terminal.o - -mod-terminal.o: mod-terminal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -c -o $@ $< - -mod-terminal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'terminal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(terminal_mod_EXPORTS),no) -def-terminal.lst: pre-terminal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 terminal/' > $@ -endif - -und-terminal.lst: pre-terminal.o - echo 'terminal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -terminal_mod-commands_terminal.o: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -MD -c -o $@ $< --include terminal_mod-commands_terminal.d - -CLEANFILES += cmd-terminal_mod-commands_terminal.lst fs-terminal_mod-commands_terminal.lst partmap-terminal_mod-commands_terminal.lst -COMMANDFILES += cmd-terminal_mod-commands_terminal.lst -FSFILES += fs-terminal_mod-commands_terminal.lst -PARTMAPFILES += partmap-terminal_mod-commands_terminal.lst - -cmd-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh terminal > $@ || (rm -f $@; exit 1) - -fs-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh terminal > $@ || (rm -f $@; exit 1) - -partmap-terminal_mod-commands_terminal.lst: commands/terminal.c $(commands/terminal.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(terminal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh terminal > $@ || (rm -f $@; exit 1) - - -terminal_mod_CFLAGS = $(COMMON_CFLAGS) -terminal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ls.mod. -ls_mod_SOURCES = commands/ls.c -CLEANFILES += ls.mod mod-ls.o mod-ls.c pre-ls.o ls_mod-commands_ls.o und-ls.lst -ifneq ($(ls_mod_EXPORTS),no) -CLEANFILES += def-ls.lst -DEFSYMFILES += def-ls.lst -endif -MOSTLYCLEANFILES += ls_mod-commands_ls.d -UNDSYMFILES += und-ls.lst - -ls.mod: pre-ls.o mod-ls.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-ls.o mod-ls.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-ls.o: $(ls_mod_DEPENDENCIES) ls_mod-commands_ls.o - -rm -f $@ - $(TARGET_CC) $(ls_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ ls_mod-commands_ls.o - -mod-ls.o: mod-ls.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -c -o $@ $< - -mod-ls.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'ls' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(ls_mod_EXPORTS),no) -def-ls.lst: pre-ls.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 ls/' > $@ -endif - -und-ls.lst: pre-ls.o - echo 'ls' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -ls_mod-commands_ls.o: commands/ls.c $(commands/ls.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -MD -c -o $@ $< --include ls_mod-commands_ls.d - -CLEANFILES += cmd-ls_mod-commands_ls.lst fs-ls_mod-commands_ls.lst partmap-ls_mod-commands_ls.lst -COMMANDFILES += cmd-ls_mod-commands_ls.lst -FSFILES += fs-ls_mod-commands_ls.lst -PARTMAPFILES += partmap-ls_mod-commands_ls.lst - -cmd-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh ls > $@ || (rm -f $@; exit 1) - -fs-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh ls > $@ || (rm -f $@; exit 1) - -partmap-ls_mod-commands_ls.lst: commands/ls.c $(commands/ls.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(ls_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh ls > $@ || (rm -f $@; exit 1) - - -ls_mod_CFLAGS = $(COMMON_CFLAGS) -ls_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For cmp.mod. -cmp_mod_SOURCES = commands/cmp.c -CLEANFILES += cmp.mod mod-cmp.o mod-cmp.c pre-cmp.o cmp_mod-commands_cmp.o und-cmp.lst -ifneq ($(cmp_mod_EXPORTS),no) -CLEANFILES += def-cmp.lst -DEFSYMFILES += def-cmp.lst -endif -MOSTLYCLEANFILES += cmp_mod-commands_cmp.d -UNDSYMFILES += und-cmp.lst - -cmp.mod: pre-cmp.o mod-cmp.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cmp.o mod-cmp.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cmp.o: $(cmp_mod_DEPENDENCIES) cmp_mod-commands_cmp.o - -rm -f $@ - $(TARGET_CC) $(cmp_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cmp_mod-commands_cmp.o - -mod-cmp.o: mod-cmp.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -c -o $@ $< - -mod-cmp.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cmp' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cmp_mod_EXPORTS),no) -def-cmp.lst: pre-cmp.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cmp/' > $@ -endif - -und-cmp.lst: pre-cmp.o - echo 'cmp' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cmp_mod-commands_cmp.o: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -MD -c -o $@ $< --include cmp_mod-commands_cmp.d - -CLEANFILES += cmd-cmp_mod-commands_cmp.lst fs-cmp_mod-commands_cmp.lst partmap-cmp_mod-commands_cmp.lst -COMMANDFILES += cmd-cmp_mod-commands_cmp.lst -FSFILES += fs-cmp_mod-commands_cmp.lst -PARTMAPFILES += partmap-cmp_mod-commands_cmp.lst - -cmd-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cmp > $@ || (rm -f $@; exit 1) - -fs-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cmp > $@ || (rm -f $@; exit 1) - -partmap-cmp_mod-commands_cmp.lst: commands/cmp.c $(commands/cmp.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cmp_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cmp > $@ || (rm -f $@; exit 1) - - -cmp_mod_CFLAGS = $(COMMON_CFLAGS) -cmp_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For cat.mod. -cat_mod_SOURCES = commands/cat.c -CLEANFILES += cat.mod mod-cat.o mod-cat.c pre-cat.o cat_mod-commands_cat.o und-cat.lst -ifneq ($(cat_mod_EXPORTS),no) -CLEANFILES += def-cat.lst -DEFSYMFILES += def-cat.lst -endif -MOSTLYCLEANFILES += cat_mod-commands_cat.d -UNDSYMFILES += und-cat.lst - -cat.mod: pre-cat.o mod-cat.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-cat.o mod-cat.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-cat.o: $(cat_mod_DEPENDENCIES) cat_mod-commands_cat.o - -rm -f $@ - $(TARGET_CC) $(cat_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ cat_mod-commands_cat.o - -mod-cat.o: mod-cat.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -c -o $@ $< - -mod-cat.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'cat' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(cat_mod_EXPORTS),no) -def-cat.lst: pre-cat.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 cat/' > $@ -endif - -und-cat.lst: pre-cat.o - echo 'cat' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -cat_mod-commands_cat.o: commands/cat.c $(commands/cat.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -MD -c -o $@ $< --include cat_mod-commands_cat.d - -CLEANFILES += cmd-cat_mod-commands_cat.lst fs-cat_mod-commands_cat.lst partmap-cat_mod-commands_cat.lst -COMMANDFILES += cmd-cat_mod-commands_cat.lst -FSFILES += fs-cat_mod-commands_cat.lst -PARTMAPFILES += partmap-cat_mod-commands_cat.lst - -cmd-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh cat > $@ || (rm -f $@; exit 1) - -fs-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh cat > $@ || (rm -f $@; exit 1) - -partmap-cat_mod-commands_cat.lst: commands/cat.c $(commands/cat.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(cat_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh cat > $@ || (rm -f $@; exit 1) - - -cat_mod_CFLAGS = $(COMMON_CFLAGS) -cat_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For font.mod. -font_mod_SOURCES = font/manager.c -CLEANFILES += font.mod mod-font.o mod-font.c pre-font.o font_mod-font_manager.o und-font.lst -ifneq ($(font_mod_EXPORTS),no) -CLEANFILES += def-font.lst -DEFSYMFILES += def-font.lst -endif -MOSTLYCLEANFILES += font_mod-font_manager.d -UNDSYMFILES += und-font.lst - -font.mod: pre-font.o mod-font.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-font.o mod-font.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-font.o: $(font_mod_DEPENDENCIES) font_mod-font_manager.o - -rm -f $@ - $(TARGET_CC) $(font_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ font_mod-font_manager.o - -mod-font.o: mod-font.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -c -o $@ $< - -mod-font.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'font' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(font_mod_EXPORTS),no) -def-font.lst: pre-font.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 font/' > $@ -endif - -und-font.lst: pre-font.o - echo 'font' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -font_mod-font_manager.o: font/manager.c $(font/manager.c_DEPENDENCIES) - $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -MD -c -o $@ $< --include font_mod-font_manager.d - -CLEANFILES += cmd-font_mod-font_manager.lst fs-font_mod-font_manager.lst partmap-font_mod-font_manager.lst -COMMANDFILES += cmd-font_mod-font_manager.lst -FSFILES += fs-font_mod-font_manager.lst -PARTMAPFILES += partmap-font_mod-font_manager.lst - -cmd-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh font > $@ || (rm -f $@; exit 1) - -fs-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh font > $@ || (rm -f $@; exit 1) - -partmap-font_mod-font_manager.lst: font/manager.c $(font/manager.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ifont -I$(srcdir)/font $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(font_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh font > $@ || (rm -f $@; exit 1) - - -font_mod_CFLAGS = $(COMMON_CFLAGS) -font_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For amiga.mod -amiga_mod_SOURCES = partmap/amiga.c -CLEANFILES += amiga.mod mod-amiga.o mod-amiga.c pre-amiga.o amiga_mod-partmap_amiga.o und-amiga.lst -ifneq ($(amiga_mod_EXPORTS),no) -CLEANFILES += def-amiga.lst -DEFSYMFILES += def-amiga.lst -endif -MOSTLYCLEANFILES += amiga_mod-partmap_amiga.d -UNDSYMFILES += und-amiga.lst - -amiga.mod: pre-amiga.o mod-amiga.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-amiga.o mod-amiga.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-amiga.o: $(amiga_mod_DEPENDENCIES) amiga_mod-partmap_amiga.o - -rm -f $@ - $(TARGET_CC) $(amiga_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ amiga_mod-partmap_amiga.o - -mod-amiga.o: mod-amiga.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -c -o $@ $< - -mod-amiga.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'amiga' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(amiga_mod_EXPORTS),no) -def-amiga.lst: pre-amiga.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 amiga/' > $@ -endif - -und-amiga.lst: pre-amiga.o - echo 'amiga' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -amiga_mod-partmap_amiga.o: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -MD -c -o $@ $< --include amiga_mod-partmap_amiga.d - -CLEANFILES += cmd-amiga_mod-partmap_amiga.lst fs-amiga_mod-partmap_amiga.lst partmap-amiga_mod-partmap_amiga.lst -COMMANDFILES += cmd-amiga_mod-partmap_amiga.lst -FSFILES += fs-amiga_mod-partmap_amiga.lst -PARTMAPFILES += partmap-amiga_mod-partmap_amiga.lst - -cmd-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh amiga > $@ || (rm -f $@; exit 1) - -fs-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh amiga > $@ || (rm -f $@; exit 1) - -partmap-amiga_mod-partmap_amiga.lst: partmap/amiga.c $(partmap/amiga.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(amiga_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh amiga > $@ || (rm -f $@; exit 1) - - -amiga_mod_CFLAGS = $(COMMON_CFLAGS) -amiga_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For apple.mod -apple_mod_SOURCES = partmap/apple.c -CLEANFILES += apple.mod mod-apple.o mod-apple.c pre-apple.o apple_mod-partmap_apple.o und-apple.lst -ifneq ($(apple_mod_EXPORTS),no) -CLEANFILES += def-apple.lst -DEFSYMFILES += def-apple.lst -endif -MOSTLYCLEANFILES += apple_mod-partmap_apple.d -UNDSYMFILES += und-apple.lst - -apple.mod: pre-apple.o mod-apple.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-apple.o mod-apple.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-apple.o: $(apple_mod_DEPENDENCIES) apple_mod-partmap_apple.o - -rm -f $@ - $(TARGET_CC) $(apple_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ apple_mod-partmap_apple.o - -mod-apple.o: mod-apple.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -c -o $@ $< - -mod-apple.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'apple' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(apple_mod_EXPORTS),no) -def-apple.lst: pre-apple.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 apple/' > $@ -endif - -und-apple.lst: pre-apple.o - echo 'apple' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -apple_mod-partmap_apple.o: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -MD -c -o $@ $< --include apple_mod-partmap_apple.d - -CLEANFILES += cmd-apple_mod-partmap_apple.lst fs-apple_mod-partmap_apple.lst partmap-apple_mod-partmap_apple.lst -COMMANDFILES += cmd-apple_mod-partmap_apple.lst -FSFILES += fs-apple_mod-partmap_apple.lst -PARTMAPFILES += partmap-apple_mod-partmap_apple.lst - -cmd-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh apple > $@ || (rm -f $@; exit 1) - -fs-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh apple > $@ || (rm -f $@; exit 1) - -partmap-apple_mod-partmap_apple.lst: partmap/apple.c $(partmap/apple.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(apple_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh apple > $@ || (rm -f $@; exit 1) - - -apple_mod_CFLAGS = $(COMMON_CFLAGS) -apple_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pc.mod -pc_mod_SOURCES = partmap/pc.c -CLEANFILES += pc.mod mod-pc.o mod-pc.c pre-pc.o pc_mod-partmap_pc.o und-pc.lst -ifneq ($(pc_mod_EXPORTS),no) -CLEANFILES += def-pc.lst -DEFSYMFILES += def-pc.lst -endif -MOSTLYCLEANFILES += pc_mod-partmap_pc.d -UNDSYMFILES += und-pc.lst - -pc.mod: pre-pc.o mod-pc.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pc.o mod-pc.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pc.o: $(pc_mod_DEPENDENCIES) pc_mod-partmap_pc.o - -rm -f $@ - $(TARGET_CC) $(pc_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pc_mod-partmap_pc.o - -mod-pc.o: mod-pc.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -c -o $@ $< - -mod-pc.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pc' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pc_mod_EXPORTS),no) -def-pc.lst: pre-pc.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pc/' > $@ -endif - -und-pc.lst: pre-pc.o - echo 'pc' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pc_mod-partmap_pc.o: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -MD -c -o $@ $< --include pc_mod-partmap_pc.d - -CLEANFILES += cmd-pc_mod-partmap_pc.lst fs-pc_mod-partmap_pc.lst partmap-pc_mod-partmap_pc.lst -COMMANDFILES += cmd-pc_mod-partmap_pc.lst -FSFILES += fs-pc_mod-partmap_pc.lst -PARTMAPFILES += partmap-pc_mod-partmap_pc.lst - -cmd-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pc > $@ || (rm -f $@; exit 1) - -fs-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pc > $@ || (rm -f $@; exit 1) - -partmap-pc_mod-partmap_pc.lst: partmap/pc.c $(partmap/pc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pc_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pc > $@ || (rm -f $@; exit 1) - - -pc_mod_CFLAGS = $(COMMON_CFLAGS) -pc_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sun.mod -sun_mod_SOURCES = partmap/sun.c -CLEANFILES += sun.mod mod-sun.o mod-sun.c pre-sun.o sun_mod-partmap_sun.o und-sun.lst -ifneq ($(sun_mod_EXPORTS),no) -CLEANFILES += def-sun.lst -DEFSYMFILES += def-sun.lst -endif -MOSTLYCLEANFILES += sun_mod-partmap_sun.d -UNDSYMFILES += und-sun.lst - -sun.mod: pre-sun.o mod-sun.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-sun.o mod-sun.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-sun.o: $(sun_mod_DEPENDENCIES) sun_mod-partmap_sun.o - -rm -f $@ - $(TARGET_CC) $(sun_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ sun_mod-partmap_sun.o - -mod-sun.o: mod-sun.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -c -o $@ $< - -mod-sun.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'sun' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(sun_mod_EXPORTS),no) -def-sun.lst: pre-sun.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 sun/' > $@ -endif - -und-sun.lst: pre-sun.o - echo 'sun' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -sun_mod-partmap_sun.o: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -MD -c -o $@ $< --include sun_mod-partmap_sun.d - -CLEANFILES += cmd-sun_mod-partmap_sun.lst fs-sun_mod-partmap_sun.lst partmap-sun_mod-partmap_sun.lst -COMMANDFILES += cmd-sun_mod-partmap_sun.lst -FSFILES += fs-sun_mod-partmap_sun.lst -PARTMAPFILES += partmap-sun_mod-partmap_sun.lst - -cmd-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh sun > $@ || (rm -f $@; exit 1) - -fs-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh sun > $@ || (rm -f $@; exit 1) - -partmap-sun_mod-partmap_sun.lst: partmap/sun.c $(partmap/sun.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(sun_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh sun > $@ || (rm -f $@; exit 1) - - -sun_mod_CFLAGS = $(COMMON_CFLAGS) -sun_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For acorn.mod -acorn_mod_SOURCES = partmap/acorn.c -CLEANFILES += acorn.mod mod-acorn.o mod-acorn.c pre-acorn.o acorn_mod-partmap_acorn.o und-acorn.lst -ifneq ($(acorn_mod_EXPORTS),no) -CLEANFILES += def-acorn.lst -DEFSYMFILES += def-acorn.lst -endif -MOSTLYCLEANFILES += acorn_mod-partmap_acorn.d -UNDSYMFILES += und-acorn.lst - -acorn.mod: pre-acorn.o mod-acorn.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-acorn.o mod-acorn.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-acorn.o: $(acorn_mod_DEPENDENCIES) acorn_mod-partmap_acorn.o - -rm -f $@ - $(TARGET_CC) $(acorn_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ acorn_mod-partmap_acorn.o - -mod-acorn.o: mod-acorn.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -c -o $@ $< - -mod-acorn.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'acorn' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(acorn_mod_EXPORTS),no) -def-acorn.lst: pre-acorn.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 acorn/' > $@ -endif - -und-acorn.lst: pre-acorn.o - echo 'acorn' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -acorn_mod-partmap_acorn.o: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) - $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -MD -c -o $@ $< --include acorn_mod-partmap_acorn.d - -CLEANFILES += cmd-acorn_mod-partmap_acorn.lst fs-acorn_mod-partmap_acorn.lst partmap-acorn_mod-partmap_acorn.lst -COMMANDFILES += cmd-acorn_mod-partmap_acorn.lst -FSFILES += fs-acorn_mod-partmap_acorn.lst -PARTMAPFILES += partmap-acorn_mod-partmap_acorn.lst - -cmd-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh acorn > $@ || (rm -f $@; exit 1) - -fs-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh acorn > $@ || (rm -f $@; exit 1) - -partmap-acorn_mod-partmap_acorn.lst: partmap/acorn.c $(partmap/acorn.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ipartmap -I$(srcdir)/partmap $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(acorn_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh acorn > $@ || (rm -f $@; exit 1) - - -acorn_mod_CFLAGS = $(COMMON_CFLAGS) - -# For loopback.mod -loopback_mod_SOURCES = disk/loopback.c -CLEANFILES += loopback.mod mod-loopback.o mod-loopback.c pre-loopback.o loopback_mod-disk_loopback.o und-loopback.lst -ifneq ($(loopback_mod_EXPORTS),no) -CLEANFILES += def-loopback.lst -DEFSYMFILES += def-loopback.lst -endif -MOSTLYCLEANFILES += loopback_mod-disk_loopback.d -UNDSYMFILES += und-loopback.lst - -loopback.mod: pre-loopback.o mod-loopback.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loopback.o mod-loopback.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-loopback.o: $(loopback_mod_DEPENDENCIES) loopback_mod-disk_loopback.o - -rm -f $@ - $(TARGET_CC) $(loopback_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loopback_mod-disk_loopback.o - -mod-loopback.o: mod-loopback.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -c -o $@ $< - -mod-loopback.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'loopback' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(loopback_mod_EXPORTS),no) -def-loopback.lst: pre-loopback.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loopback/' > $@ -endif - -und-loopback.lst: pre-loopback.o - echo 'loopback' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -loopback_mod-disk_loopback.o: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) - $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -MD -c -o $@ $< --include loopback_mod-disk_loopback.d - -CLEANFILES += cmd-loopback_mod-disk_loopback.lst fs-loopback_mod-disk_loopback.lst partmap-loopback_mod-disk_loopback.lst -COMMANDFILES += cmd-loopback_mod-disk_loopback.lst -FSFILES += fs-loopback_mod-disk_loopback.lst -PARTMAPFILES += partmap-loopback_mod-disk_loopback.lst - -cmd-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loopback > $@ || (rm -f $@; exit 1) - -fs-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loopback > $@ || (rm -f $@; exit 1) - -partmap-loopback_mod-disk_loopback.lst: disk/loopback.c $(disk/loopback.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk -I$(srcdir)/disk $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loopback_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loopback > $@ || (rm -f $@; exit 1) - - -loopback_mod_CFLAGS = $(COMMON_CFLAGS) -loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For suspend.mod -suspend_mod_SOURCES = commands/ieee1275/suspend.c -CLEANFILES += suspend.mod mod-suspend.o mod-suspend.c pre-suspend.o suspend_mod-commands_ieee1275_suspend.o und-suspend.lst -ifneq ($(suspend_mod_EXPORTS),no) -CLEANFILES += def-suspend.lst -DEFSYMFILES += def-suspend.lst -endif -MOSTLYCLEANFILES += suspend_mod-commands_ieee1275_suspend.d -UNDSYMFILES += und-suspend.lst - -suspend.mod: pre-suspend.o mod-suspend.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-suspend.o mod-suspend.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-suspend.o: $(suspend_mod_DEPENDENCIES) suspend_mod-commands_ieee1275_suspend.o - -rm -f $@ - $(TARGET_CC) $(suspend_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ suspend_mod-commands_ieee1275_suspend.o - -mod-suspend.o: mod-suspend.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -c -o $@ $< - -mod-suspend.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'suspend' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(suspend_mod_EXPORTS),no) -def-suspend.lst: pre-suspend.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 suspend/' > $@ -endif - -und-suspend.lst: pre-suspend.o - echo 'suspend' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -suspend_mod-commands_ieee1275_suspend.o: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -MD -c -o $@ $< --include suspend_mod-commands_ieee1275_suspend.d - -CLEANFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst fs-suspend_mod-commands_ieee1275_suspend.lst partmap-suspend_mod-commands_ieee1275_suspend.lst -COMMANDFILES += cmd-suspend_mod-commands_ieee1275_suspend.lst -FSFILES += fs-suspend_mod-commands_ieee1275_suspend.lst -PARTMAPFILES += partmap-suspend_mod-commands_ieee1275_suspend.lst - -cmd-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh suspend > $@ || (rm -f $@; exit 1) - -fs-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh suspend > $@ || (rm -f $@; exit 1) - -partmap-suspend_mod-commands_ieee1275_suspend.lst: commands/ieee1275/suspend.c $(commands/ieee1275/suspend.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/ieee1275 -I$(srcdir)/commands/ieee1275 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(suspend_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh suspend > $@ || (rm -f $@; exit 1) - - -suspend_mod_CFLAGS = $(COMMON_CFLAGS) -suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod -reboot_mod_SOURCES = commands/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst -ifneq ($(reboot_mod_EXPORTS),no) -CLEANFILES += def-reboot.lst -DEFSYMFILES += def-reboot.lst -endif -MOSTLYCLEANFILES += reboot_mod-commands_reboot.d -UNDSYMFILES += und-reboot.lst - -reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o - -mod-reboot.o: mod-reboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< - -mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reboot_mod_EXPORTS),no) -def-reboot.lst: pre-reboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ -endif - -und-reboot.lst: pre-reboot.o - echo 'reboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_reboot.d - -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_reboot.lst -FSFILES += fs-reboot_mod-commands_reboot.lst -PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst - -cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod_CFLAGS = $(COMMON_CFLAGS) -reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For halt.mod -halt_mod_SOURCES = commands/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst -ifneq ($(halt_mod_EXPORTS),no) -CLEANFILES += def-halt.lst -DEFSYMFILES += def-halt.lst -endif -MOSTLYCLEANFILES += halt_mod-commands_halt.d -UNDSYMFILES += und-halt.lst - -halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o - -mod-halt.o: mod-halt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< - -mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(halt_mod_EXPORTS),no) -def-halt.lst: pre-halt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ -endif - -und-halt.lst: pre-halt.o - echo 'halt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_halt.d - -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst -COMMANDFILES += cmd-halt_mod-commands_halt.lst -FSFILES += fs-halt_mod-commands_halt.lst -PARTMAPFILES += partmap-halt_mod-commands_halt.lst - -cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod_CFLAGS = $(COMMON_CFLAGS) -halt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For help.mod. -help_mod_SOURCES = commands/help.c -CLEANFILES += help.mod mod-help.o mod-help.c pre-help.o help_mod-commands_help.o und-help.lst -ifneq ($(help_mod_EXPORTS),no) -CLEANFILES += def-help.lst -DEFSYMFILES += def-help.lst -endif -MOSTLYCLEANFILES += help_mod-commands_help.d -UNDSYMFILES += und-help.lst - -help.mod: pre-help.o mod-help.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-help.o mod-help.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-help.o: $(help_mod_DEPENDENCIES) help_mod-commands_help.o - -rm -f $@ - $(TARGET_CC) $(help_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ help_mod-commands_help.o - -mod-help.o: mod-help.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -c -o $@ $< - -mod-help.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'help' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(help_mod_EXPORTS),no) -def-help.lst: pre-help.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 help/' > $@ -endif - -und-help.lst: pre-help.o - echo 'help' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -help_mod-commands_help.o: commands/help.c $(commands/help.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -MD -c -o $@ $< --include help_mod-commands_help.d - -CLEANFILES += cmd-help_mod-commands_help.lst fs-help_mod-commands_help.lst partmap-help_mod-commands_help.lst -COMMANDFILES += cmd-help_mod-commands_help.lst -FSFILES += fs-help_mod-commands_help.lst -PARTMAPFILES += partmap-help_mod-commands_help.lst - -cmd-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh help > $@ || (rm -f $@; exit 1) - -fs-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh help > $@ || (rm -f $@; exit 1) - -partmap-help_mod-commands_help.lst: commands/help.c $(commands/help.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(help_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh help > $@ || (rm -f $@; exit 1) - - -help_mod_CFLAGS = $(COMMON_CFLAGS) -help_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For default.mod -default_mod_SOURCES = commands/default.c -default_mod_CFLAGS = $(COMMON_CFLAGS) -default_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For timeout.mod -timeout_mod_SOURCES = commands/timeout.c -timeout_mod_CFLAGS = $(COMMON_CFLAGS) -timeout_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For configfile.mod -configfile_mod_SOURCES = commands/configfile.c -CLEANFILES += configfile.mod mod-configfile.o mod-configfile.c pre-configfile.o configfile_mod-commands_configfile.o und-configfile.lst -ifneq ($(configfile_mod_EXPORTS),no) -CLEANFILES += def-configfile.lst -DEFSYMFILES += def-configfile.lst -endif -MOSTLYCLEANFILES += configfile_mod-commands_configfile.d -UNDSYMFILES += und-configfile.lst - -configfile.mod: pre-configfile.o mod-configfile.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-configfile.o mod-configfile.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-configfile.o: $(configfile_mod_DEPENDENCIES) configfile_mod-commands_configfile.o - -rm -f $@ - $(TARGET_CC) $(configfile_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ configfile_mod-commands_configfile.o - -mod-configfile.o: mod-configfile.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -c -o $@ $< - -mod-configfile.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'configfile' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(configfile_mod_EXPORTS),no) -def-configfile.lst: pre-configfile.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 configfile/' > $@ -endif - -und-configfile.lst: pre-configfile.o - echo 'configfile' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -configfile_mod-commands_configfile.o: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -MD -c -o $@ $< --include configfile_mod-commands_configfile.d - -CLEANFILES += cmd-configfile_mod-commands_configfile.lst fs-configfile_mod-commands_configfile.lst partmap-configfile_mod-commands_configfile.lst -COMMANDFILES += cmd-configfile_mod-commands_configfile.lst -FSFILES += fs-configfile_mod-commands_configfile.lst -PARTMAPFILES += partmap-configfile_mod-commands_configfile.lst - -cmd-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh configfile > $@ || (rm -f $@; exit 1) - -fs-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh configfile > $@ || (rm -f $@; exit 1) - -partmap-configfile_mod-commands_configfile.lst: commands/configfile.c $(commands/configfile.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(configfile_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh configfile > $@ || (rm -f $@; exit 1) - - -configfile_mod_CFLAGS = $(COMMON_CFLAGS) -configfile_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For search.mod. -search_mod_SOURCES = commands/search.c -CLEANFILES += search.mod mod-search.o mod-search.c pre-search.o search_mod-commands_search.o und-search.lst -ifneq ($(search_mod_EXPORTS),no) -CLEANFILES += def-search.lst -DEFSYMFILES += def-search.lst -endif -MOSTLYCLEANFILES += search_mod-commands_search.d -UNDSYMFILES += und-search.lst - -search.mod: pre-search.o mod-search.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-search.o mod-search.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-search.o: $(search_mod_DEPENDENCIES) search_mod-commands_search.o - -rm -f $@ - $(TARGET_CC) $(search_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ search_mod-commands_search.o - -mod-search.o: mod-search.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -c -o $@ $< - -mod-search.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'search' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(search_mod_EXPORTS),no) -def-search.lst: pre-search.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 search/' > $@ -endif - -und-search.lst: pre-search.o - echo 'search' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -search_mod-commands_search.o: commands/search.c $(commands/search.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -MD -c -o $@ $< --include search_mod-commands_search.d - -CLEANFILES += cmd-search_mod-commands_search.lst fs-search_mod-commands_search.lst partmap-search_mod-commands_search.lst -COMMANDFILES += cmd-search_mod-commands_search.lst -FSFILES += fs-search_mod-commands_search.lst -PARTMAPFILES += partmap-search_mod-commands_search.lst - -cmd-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh search > $@ || (rm -f $@; exit 1) - -fs-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh search > $@ || (rm -f $@; exit 1) - -partmap-search_mod-commands_search.lst: commands/search.c $(commands/search.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(search_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh search > $@ || (rm -f $@; exit 1) - - -search_mod_CFLAGS = $(COMMON_CFLAGS) -search_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For gzio.mod. -gzio_mod_SOURCES = io/gzio.c -CLEANFILES += gzio.mod mod-gzio.o mod-gzio.c pre-gzio.o gzio_mod-io_gzio.o und-gzio.lst -ifneq ($(gzio_mod_EXPORTS),no) -CLEANFILES += def-gzio.lst -DEFSYMFILES += def-gzio.lst -endif -MOSTLYCLEANFILES += gzio_mod-io_gzio.d -UNDSYMFILES += und-gzio.lst - -gzio.mod: pre-gzio.o mod-gzio.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-gzio.o mod-gzio.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-gzio.o: $(gzio_mod_DEPENDENCIES) gzio_mod-io_gzio.o - -rm -f $@ - $(TARGET_CC) $(gzio_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ gzio_mod-io_gzio.o - -mod-gzio.o: mod-gzio.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -c -o $@ $< - -mod-gzio.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'gzio' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(gzio_mod_EXPORTS),no) -def-gzio.lst: pre-gzio.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 gzio/' > $@ -endif - -und-gzio.lst: pre-gzio.o - echo 'gzio' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -gzio_mod-io_gzio.o: io/gzio.c $(io/gzio.c_DEPENDENCIES) - $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -MD -c -o $@ $< --include gzio_mod-io_gzio.d - -CLEANFILES += cmd-gzio_mod-io_gzio.lst fs-gzio_mod-io_gzio.lst partmap-gzio_mod-io_gzio.lst -COMMANDFILES += cmd-gzio_mod-io_gzio.lst -FSFILES += fs-gzio_mod-io_gzio.lst -PARTMAPFILES += partmap-gzio_mod-io_gzio.lst - -cmd-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh gzio > $@ || (rm -f $@; exit 1) - -fs-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh gzio > $@ || (rm -f $@; exit 1) - -partmap-gzio_mod-io_gzio.lst: io/gzio.c $(io/gzio.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iio -I$(srcdir)/io $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(gzio_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh gzio > $@ || (rm -f $@; exit 1) - - -gzio_mod_CFLAGS = $(COMMON_CFLAGS) -gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For test.mod. -test_mod_SOURCES = commands/test.c -test_mod_CFLAGS = $(COMMON_CFLAGS) -test_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/x86_64-efi.mk b/conf/x86_64-efi.mk deleted file mode 100644 index 6cbcd15b4..000000000 --- a/conf/x86_64-efi.mk +++ /dev/null @@ -1,1885 +0,0 @@ -# -*- makefile -*- -# Generated by genmk.rb, please don't edit! - -COMMON_ASFLAGS = -nostdinc -fno-builtin -m64 -COMMON_CFLAGS = -fno-builtin -m64 -COMMON_LDFLAGS = -melf_x86_64 -nostdlib - -# Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h -normal/lexer.c_DEPENDENCIES = grub_script.tab.h - -# Utilities. -bin_UTILITIES = grub-mkimage -#sbin_UTILITIES = grub-mkdevicemap -#ifeq ($(enable_grub_emu), yes) -#sbin_UTILITIES += grub-emu -#endif - -# For grub-mkimage. -grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ - util/resolve.c -CLEANFILES += grub-mkimage$(EXEEXT) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o -MOSTLYCLEANFILES += grub_mkimage-util_i386_efi_grub_mkimage.d grub_mkimage-util_misc.d grub_mkimage-util_resolve.d - -grub-mkimage: $(grub_mkimage_DEPENDENCIES) grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o - $(CC) -o $@ grub_mkimage-util_i386_efi_grub_mkimage.o grub_mkimage-util_misc.o grub_mkimage-util_resolve.o $(LDFLAGS) $(grub_mkimage_LDFLAGS) - -grub_mkimage-util_i386_efi_grub_mkimage.o: util/i386/efi/grub-mkimage.c $(util/i386/efi/grub-mkimage.c_DEPENDENCIES) - $(CC) -Iutil/i386/efi -I$(srcdir)/util/i386/efi $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_i386_efi_grub_mkimage.d - -grub_mkimage-util_misc.o: util/misc.c $(util/misc.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_misc.d - -grub_mkimage-util_resolve.o: util/resolve.c $(util/resolve.c_DEPENDENCIES) - $(CC) -Iutil -I$(srcdir)/util $(CPPFLAGS) $(CFLAGS) -DGRUB_UTIL=1 $(grub_mkimage_CFLAGS) -MD -c -o $@ $< --include grub_mkimage-util_resolve.d - - -# For grub-setup. -#grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ -# util/misc.c util/getroot.c kern/device.c kern/disk.c \ -# kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ -# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ -# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ -# kern/fs.c kern/env.c fs/fshelp.c - -# For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c - -# For grub-emu. -util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ - commands/configfile.c commands/help.c \ - commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c lib/hexdump.c \ - commands/halt.c commands/reboot.c \ - commands/i386/cpuid.c \ - disk/loopback.c \ - \ - fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ - fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ - fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ - \ - io/gzio.c \ - kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/completion.c normal/datetime.c normal/context.c \ - normal/main.c \ - normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/menu_text.c \ - normal/misc.c normal/script.c \ - normal/color.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ - partmap/acorn.c partmap/gpt.c \ - util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ - util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ - \ - disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ - disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ - grub_emu_init.c - -grub_emu_LDFLAGS = $(LIBCURSES) - -# Scripts. -sbin_SCRIPTS = grub-install - -# For grub-install. -grub_install_SOURCES = util/i386/efi/grub-install.in -CLEANFILES += grub-install - -grub-install: util/i386/efi/grub-install.in $(util/i386/efi/grub-install.in_DEPENDENCIES) config.status - ./config.status --file=grub-install:util/i386/efi/grub-install.in - chmod +x $@ - - -# Modules. -pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ - halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod - -# For kernel.mod. -kernel_mod_EXPORTS = no -kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ - kern/main.c kern/device.c \ - kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ - kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ - kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ - kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/i386/tsc.c kern/i386/pit.c \ - kern/generic/millisleep.c kern/generic/rtc_get_time_ms.c \ - term/efi/console.c disk/efi/efidisk.c -CLEANFILES += kernel.mod mod-kernel.o mod-kernel.c pre-kernel.o kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o und-kernel.lst -ifneq ($(kernel_mod_EXPORTS),no) -CLEANFILES += def-kernel.lst -DEFSYMFILES += def-kernel.lst -endif -MOSTLYCLEANFILES += kernel_mod-kern_x86_64_efi_startup.d kernel_mod-kern_x86_64_efi_callwrap.d kernel_mod-kern_main.d kernel_mod-kern_device.d kernel_mod-kern_disk.d kernel_mod-kern_dl.d kernel_mod-kern_file.d kernel_mod-kern_fs.d kernel_mod-kern_err.d kernel_mod-kern_misc.d kernel_mod-kern_mm.d kernel_mod-kern_loader.d kernel_mod-kern_rescue.d kernel_mod-kern_term.d kernel_mod-kern_x86_64_dl.d kernel_mod-kern_i386_efi_init.d kernel_mod-kern_parser.d kernel_mod-kern_partition.d kernel_mod-kern_env.d kernel_mod-symlist.d kernel_mod-kern_efi_efi.d kernel_mod-kern_efi_init.d kernel_mod-kern_efi_mm.d kernel_mod-kern_time.d kernel_mod-kern_list.d kernel_mod-kern_handler.d kernel_mod-kern_command.d kernel_mod-kern_corecmd.d kernel_mod-kern_i386_tsc.d kernel_mod-kern_i386_pit.d kernel_mod-kern_generic_millisleep.d kernel_mod-kern_generic_rtc_get_time_ms.d kernel_mod-term_efi_console.d kernel_mod-disk_efi_efidisk.d -UNDSYMFILES += und-kernel.lst - -kernel.mod: pre-kernel.o mod-kernel.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-kernel.o mod-kernel.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-kernel.o: $(kernel_mod_DEPENDENCIES) kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o - -rm -f $@ - $(TARGET_CC) $(kernel_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ kernel_mod-kern_x86_64_efi_startup.o kernel_mod-kern_x86_64_efi_callwrap.o kernel_mod-kern_main.o kernel_mod-kern_device.o kernel_mod-kern_disk.o kernel_mod-kern_dl.o kernel_mod-kern_file.o kernel_mod-kern_fs.o kernel_mod-kern_err.o kernel_mod-kern_misc.o kernel_mod-kern_mm.o kernel_mod-kern_loader.o kernel_mod-kern_rescue.o kernel_mod-kern_term.o kernel_mod-kern_x86_64_dl.o kernel_mod-kern_i386_efi_init.o kernel_mod-kern_parser.o kernel_mod-kern_partition.o kernel_mod-kern_env.o kernel_mod-symlist.o kernel_mod-kern_efi_efi.o kernel_mod-kern_efi_init.o kernel_mod-kern_efi_mm.o kernel_mod-kern_time.o kernel_mod-kern_list.o kernel_mod-kern_handler.o kernel_mod-kern_command.o kernel_mod-kern_corecmd.o kernel_mod-kern_i386_tsc.o kernel_mod-kern_i386_pit.o kernel_mod-kern_generic_millisleep.o kernel_mod-kern_generic_rtc_get_time_ms.o kernel_mod-term_efi_console.o kernel_mod-disk_efi_efidisk.o - -mod-kernel.o: mod-kernel.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -c -o $@ $< - -mod-kernel.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'kernel' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(kernel_mod_EXPORTS),no) -def-kernel.lst: pre-kernel.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 kernel/' > $@ -endif - -und-kernel.lst: pre-kernel.o - echo 'kernel' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -kernel_mod-kern_x86_64_efi_startup.o: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_x86_64_efi_startup.d - -CLEANFILES += cmd-kernel_mod-kern_x86_64_efi_startup.lst fs-kernel_mod-kern_x86_64_efi_startup.lst partmap-kernel_mod-kern_x86_64_efi_startup.lst -COMMANDFILES += cmd-kernel_mod-kern_x86_64_efi_startup.lst -FSFILES += fs-kernel_mod-kern_x86_64_efi_startup.lst -PARTMAPFILES += partmap-kernel_mod-kern_x86_64_efi_startup.lst - -cmd-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_x86_64_efi_startup.lst: kern/x86_64/efi/startup.S $(kern/x86_64/efi/startup.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_x86_64_efi_callwrap.o: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) - $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_x86_64_efi_callwrap.d - -CLEANFILES += cmd-kernel_mod-kern_x86_64_efi_callwrap.lst fs-kernel_mod-kern_x86_64_efi_callwrap.lst partmap-kernel_mod-kern_x86_64_efi_callwrap.lst -COMMANDFILES += cmd-kernel_mod-kern_x86_64_efi_callwrap.lst -FSFILES += fs-kernel_mod-kern_x86_64_efi_callwrap.lst -PARTMAPFILES += partmap-kernel_mod-kern_x86_64_efi_callwrap.lst - -cmd-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_x86_64_efi_callwrap.lst: kern/x86_64/efi/callwrap.S $(kern/x86_64/efi/callwrap.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/x86_64/efi -I$(srcdir)/kern/x86_64/efi $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(kernel_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_main.o: kern/main.c $(kern/main.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_main.d - -CLEANFILES += cmd-kernel_mod-kern_main.lst fs-kernel_mod-kern_main.lst partmap-kernel_mod-kern_main.lst -COMMANDFILES += cmd-kernel_mod-kern_main.lst -FSFILES += fs-kernel_mod-kern_main.lst -PARTMAPFILES += partmap-kernel_mod-kern_main.lst - -cmd-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_main.lst: kern/main.c $(kern/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_device.o: kern/device.c $(kern/device.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_device.d - -CLEANFILES += cmd-kernel_mod-kern_device.lst fs-kernel_mod-kern_device.lst partmap-kernel_mod-kern_device.lst -COMMANDFILES += cmd-kernel_mod-kern_device.lst -FSFILES += fs-kernel_mod-kern_device.lst -PARTMAPFILES += partmap-kernel_mod-kern_device.lst - -cmd-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_device.lst: kern/device.c $(kern/device.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_disk.o: kern/disk.c $(kern/disk.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_disk.d - -CLEANFILES += cmd-kernel_mod-kern_disk.lst fs-kernel_mod-kern_disk.lst partmap-kernel_mod-kern_disk.lst -COMMANDFILES += cmd-kernel_mod-kern_disk.lst -FSFILES += fs-kernel_mod-kern_disk.lst -PARTMAPFILES += partmap-kernel_mod-kern_disk.lst - -cmd-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_disk.lst: kern/disk.c $(kern/disk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_dl.o: kern/dl.c $(kern/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_dl.d - -CLEANFILES += cmd-kernel_mod-kern_dl.lst fs-kernel_mod-kern_dl.lst partmap-kernel_mod-kern_dl.lst -COMMANDFILES += cmd-kernel_mod-kern_dl.lst -FSFILES += fs-kernel_mod-kern_dl.lst -PARTMAPFILES += partmap-kernel_mod-kern_dl.lst - -cmd-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_dl.lst: kern/dl.c $(kern/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_file.o: kern/file.c $(kern/file.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_file.d - -CLEANFILES += cmd-kernel_mod-kern_file.lst fs-kernel_mod-kern_file.lst partmap-kernel_mod-kern_file.lst -COMMANDFILES += cmd-kernel_mod-kern_file.lst -FSFILES += fs-kernel_mod-kern_file.lst -PARTMAPFILES += partmap-kernel_mod-kern_file.lst - -cmd-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_file.lst: kern/file.c $(kern/file.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_fs.o: kern/fs.c $(kern/fs.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_fs.d - -CLEANFILES += cmd-kernel_mod-kern_fs.lst fs-kernel_mod-kern_fs.lst partmap-kernel_mod-kern_fs.lst -COMMANDFILES += cmd-kernel_mod-kern_fs.lst -FSFILES += fs-kernel_mod-kern_fs.lst -PARTMAPFILES += partmap-kernel_mod-kern_fs.lst - -cmd-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_fs.lst: kern/fs.c $(kern/fs.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_err.o: kern/err.c $(kern/err.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_err.d - -CLEANFILES += cmd-kernel_mod-kern_err.lst fs-kernel_mod-kern_err.lst partmap-kernel_mod-kern_err.lst -COMMANDFILES += cmd-kernel_mod-kern_err.lst -FSFILES += fs-kernel_mod-kern_err.lst -PARTMAPFILES += partmap-kernel_mod-kern_err.lst - -cmd-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_err.lst: kern/err.c $(kern/err.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_misc.o: kern/misc.c $(kern/misc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_misc.d - -CLEANFILES += cmd-kernel_mod-kern_misc.lst fs-kernel_mod-kern_misc.lst partmap-kernel_mod-kern_misc.lst -COMMANDFILES += cmd-kernel_mod-kern_misc.lst -FSFILES += fs-kernel_mod-kern_misc.lst -PARTMAPFILES += partmap-kernel_mod-kern_misc.lst - -cmd-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_misc.lst: kern/misc.c $(kern/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_mm.o: kern/mm.c $(kern/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_mm.d - -CLEANFILES += cmd-kernel_mod-kern_mm.lst fs-kernel_mod-kern_mm.lst partmap-kernel_mod-kern_mm.lst -COMMANDFILES += cmd-kernel_mod-kern_mm.lst -FSFILES += fs-kernel_mod-kern_mm.lst -PARTMAPFILES += partmap-kernel_mod-kern_mm.lst - -cmd-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_mm.lst: kern/mm.c $(kern/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_loader.o: kern/loader.c $(kern/loader.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_loader.d - -CLEANFILES += cmd-kernel_mod-kern_loader.lst fs-kernel_mod-kern_loader.lst partmap-kernel_mod-kern_loader.lst -COMMANDFILES += cmd-kernel_mod-kern_loader.lst -FSFILES += fs-kernel_mod-kern_loader.lst -PARTMAPFILES += partmap-kernel_mod-kern_loader.lst - -cmd-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_loader.lst: kern/loader.c $(kern/loader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_rescue.o: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_rescue.d - -CLEANFILES += cmd-kernel_mod-kern_rescue.lst fs-kernel_mod-kern_rescue.lst partmap-kernel_mod-kern_rescue.lst -COMMANDFILES += cmd-kernel_mod-kern_rescue.lst -FSFILES += fs-kernel_mod-kern_rescue.lst -PARTMAPFILES += partmap-kernel_mod-kern_rescue.lst - -cmd-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_rescue.lst: kern/rescue.c $(kern/rescue.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_term.o: kern/term.c $(kern/term.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_term.d - -CLEANFILES += cmd-kernel_mod-kern_term.lst fs-kernel_mod-kern_term.lst partmap-kernel_mod-kern_term.lst -COMMANDFILES += cmd-kernel_mod-kern_term.lst -FSFILES += fs-kernel_mod-kern_term.lst -PARTMAPFILES += partmap-kernel_mod-kern_term.lst - -cmd-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_term.lst: kern/term.c $(kern/term.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_x86_64_dl.o: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_x86_64_dl.d - -CLEANFILES += cmd-kernel_mod-kern_x86_64_dl.lst fs-kernel_mod-kern_x86_64_dl.lst partmap-kernel_mod-kern_x86_64_dl.lst -COMMANDFILES += cmd-kernel_mod-kern_x86_64_dl.lst -FSFILES += fs-kernel_mod-kern_x86_64_dl.lst -PARTMAPFILES += partmap-kernel_mod-kern_x86_64_dl.lst - -cmd-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_x86_64_dl.lst: kern/x86_64/dl.c $(kern/x86_64/dl.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/x86_64 -I$(srcdir)/kern/x86_64 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_i386_efi_init.o: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_efi_init.d - -CLEANFILES += cmd-kernel_mod-kern_i386_efi_init.lst fs-kernel_mod-kern_i386_efi_init.lst partmap-kernel_mod-kern_i386_efi_init.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_efi_init.lst -FSFILES += fs-kernel_mod-kern_i386_efi_init.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_efi_init.lst - -cmd-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_efi_init.lst: kern/i386/efi/init.c $(kern/i386/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386/efi -I$(srcdir)/kern/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_parser.o: kern/parser.c $(kern/parser.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_parser.d - -CLEANFILES += cmd-kernel_mod-kern_parser.lst fs-kernel_mod-kern_parser.lst partmap-kernel_mod-kern_parser.lst -COMMANDFILES += cmd-kernel_mod-kern_parser.lst -FSFILES += fs-kernel_mod-kern_parser.lst -PARTMAPFILES += partmap-kernel_mod-kern_parser.lst - -cmd-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_parser.lst: kern/parser.c $(kern/parser.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_partition.o: kern/partition.c $(kern/partition.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_partition.d - -CLEANFILES += cmd-kernel_mod-kern_partition.lst fs-kernel_mod-kern_partition.lst partmap-kernel_mod-kern_partition.lst -COMMANDFILES += cmd-kernel_mod-kern_partition.lst -FSFILES += fs-kernel_mod-kern_partition.lst -PARTMAPFILES += partmap-kernel_mod-kern_partition.lst - -cmd-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_partition.lst: kern/partition.c $(kern/partition.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_env.o: kern/env.c $(kern/env.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_env.d - -CLEANFILES += cmd-kernel_mod-kern_env.lst fs-kernel_mod-kern_env.lst partmap-kernel_mod-kern_env.lst -COMMANDFILES += cmd-kernel_mod-kern_env.lst -FSFILES += fs-kernel_mod-kern_env.lst -PARTMAPFILES += partmap-kernel_mod-kern_env.lst - -cmd-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_env.lst: kern/env.c $(kern/env.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-symlist.o: symlist.c $(symlist.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-symlist.d - -CLEANFILES += cmd-kernel_mod-symlist.lst fs-kernel_mod-symlist.lst partmap-kernel_mod-symlist.lst -COMMANDFILES += cmd-kernel_mod-symlist.lst -FSFILES += fs-kernel_mod-symlist.lst -PARTMAPFILES += partmap-kernel_mod-symlist.lst - -cmd-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-symlist.lst: symlist.c $(symlist.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_efi_efi.o: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_efi_efi.d - -CLEANFILES += cmd-kernel_mod-kern_efi_efi.lst fs-kernel_mod-kern_efi_efi.lst partmap-kernel_mod-kern_efi_efi.lst -COMMANDFILES += cmd-kernel_mod-kern_efi_efi.lst -FSFILES += fs-kernel_mod-kern_efi_efi.lst -PARTMAPFILES += partmap-kernel_mod-kern_efi_efi.lst - -cmd-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_efi_efi.lst: kern/efi/efi.c $(kern/efi/efi.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_efi_init.o: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_efi_init.d - -CLEANFILES += cmd-kernel_mod-kern_efi_init.lst fs-kernel_mod-kern_efi_init.lst partmap-kernel_mod-kern_efi_init.lst -COMMANDFILES += cmd-kernel_mod-kern_efi_init.lst -FSFILES += fs-kernel_mod-kern_efi_init.lst -PARTMAPFILES += partmap-kernel_mod-kern_efi_init.lst - -cmd-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_efi_init.lst: kern/efi/init.c $(kern/efi/init.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_efi_mm.o: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_efi_mm.d - -CLEANFILES += cmd-kernel_mod-kern_efi_mm.lst fs-kernel_mod-kern_efi_mm.lst partmap-kernel_mod-kern_efi_mm.lst -COMMANDFILES += cmd-kernel_mod-kern_efi_mm.lst -FSFILES += fs-kernel_mod-kern_efi_mm.lst -PARTMAPFILES += partmap-kernel_mod-kern_efi_mm.lst - -cmd-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_efi_mm.lst: kern/efi/mm.c $(kern/efi/mm.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/efi -I$(srcdir)/kern/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_time.o: kern/time.c $(kern/time.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_time.d - -CLEANFILES += cmd-kernel_mod-kern_time.lst fs-kernel_mod-kern_time.lst partmap-kernel_mod-kern_time.lst -COMMANDFILES += cmd-kernel_mod-kern_time.lst -FSFILES += fs-kernel_mod-kern_time.lst -PARTMAPFILES += partmap-kernel_mod-kern_time.lst - -cmd-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_time.lst: kern/time.c $(kern/time.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_list.o: kern/list.c $(kern/list.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_list.d - -CLEANFILES += cmd-kernel_mod-kern_list.lst fs-kernel_mod-kern_list.lst partmap-kernel_mod-kern_list.lst -COMMANDFILES += cmd-kernel_mod-kern_list.lst -FSFILES += fs-kernel_mod-kern_list.lst -PARTMAPFILES += partmap-kernel_mod-kern_list.lst - -cmd-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_list.lst: kern/list.c $(kern/list.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_handler.o: kern/handler.c $(kern/handler.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_handler.d - -CLEANFILES += cmd-kernel_mod-kern_handler.lst fs-kernel_mod-kern_handler.lst partmap-kernel_mod-kern_handler.lst -COMMANDFILES += cmd-kernel_mod-kern_handler.lst -FSFILES += fs-kernel_mod-kern_handler.lst -PARTMAPFILES += partmap-kernel_mod-kern_handler.lst - -cmd-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_handler.lst: kern/handler.c $(kern/handler.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_command.o: kern/command.c $(kern/command.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_command.d - -CLEANFILES += cmd-kernel_mod-kern_command.lst fs-kernel_mod-kern_command.lst partmap-kernel_mod-kern_command.lst -COMMANDFILES += cmd-kernel_mod-kern_command.lst -FSFILES += fs-kernel_mod-kern_command.lst -PARTMAPFILES += partmap-kernel_mod-kern_command.lst - -cmd-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_command.lst: kern/command.c $(kern/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_corecmd.o: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) - $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_corecmd.d - -CLEANFILES += cmd-kernel_mod-kern_corecmd.lst fs-kernel_mod-kern_corecmd.lst partmap-kernel_mod-kern_corecmd.lst -COMMANDFILES += cmd-kernel_mod-kern_corecmd.lst -FSFILES += fs-kernel_mod-kern_corecmd.lst -PARTMAPFILES += partmap-kernel_mod-kern_corecmd.lst - -cmd-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_corecmd.lst: kern/corecmd.c $(kern/corecmd.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern -I$(srcdir)/kern $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_i386_tsc.o: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_tsc.d - -CLEANFILES += cmd-kernel_mod-kern_i386_tsc.lst fs-kernel_mod-kern_i386_tsc.lst partmap-kernel_mod-kern_i386_tsc.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_tsc.lst -FSFILES += fs-kernel_mod-kern_i386_tsc.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_tsc.lst - -cmd-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_tsc.lst: kern/i386/tsc.c $(kern/i386/tsc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_i386_pit.o: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_i386_pit.d - -CLEANFILES += cmd-kernel_mod-kern_i386_pit.lst fs-kernel_mod-kern_i386_pit.lst partmap-kernel_mod-kern_i386_pit.lst -COMMANDFILES += cmd-kernel_mod-kern_i386_pit.lst -FSFILES += fs-kernel_mod-kern_i386_pit.lst -PARTMAPFILES += partmap-kernel_mod-kern_i386_pit.lst - -cmd-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_i386_pit.lst: kern/i386/pit.c $(kern/i386/pit.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/i386 -I$(srcdir)/kern/i386 $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_generic_millisleep.o: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_generic_millisleep.d - -CLEANFILES += cmd-kernel_mod-kern_generic_millisleep.lst fs-kernel_mod-kern_generic_millisleep.lst partmap-kernel_mod-kern_generic_millisleep.lst -COMMANDFILES += cmd-kernel_mod-kern_generic_millisleep.lst -FSFILES += fs-kernel_mod-kern_generic_millisleep.lst -PARTMAPFILES += partmap-kernel_mod-kern_generic_millisleep.lst - -cmd-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_generic_millisleep.lst: kern/generic/millisleep.c $(kern/generic/millisleep.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-kern_generic_rtc_get_time_ms.o: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) - $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-kern_generic_rtc_get_time_ms.d - -CLEANFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst fs-kernel_mod-kern_generic_rtc_get_time_ms.lst partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst -COMMANDFILES += cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst -FSFILES += fs-kernel_mod-kern_generic_rtc_get_time_ms.lst -PARTMAPFILES += partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst - -cmd-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-kern_generic_rtc_get_time_ms.lst: kern/generic/rtc_get_time_ms.c $(kern/generic/rtc_get_time_ms.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ikern/generic -I$(srcdir)/kern/generic $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-term_efi_console.o: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) - $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-term_efi_console.d - -CLEANFILES += cmd-kernel_mod-term_efi_console.lst fs-kernel_mod-term_efi_console.lst partmap-kernel_mod-term_efi_console.lst -COMMANDFILES += cmd-kernel_mod-term_efi_console.lst -FSFILES += fs-kernel_mod-term_efi_console.lst -PARTMAPFILES += partmap-kernel_mod-term_efi_console.lst - -cmd-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-term_efi_console.lst: term/efi/console.c $(term/efi/console.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iterm/efi -I$(srcdir)/term/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod-disk_efi_efidisk.o: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) - $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -MD -c -o $@ $< --include kernel_mod-disk_efi_efidisk.d - -CLEANFILES += cmd-kernel_mod-disk_efi_efidisk.lst fs-kernel_mod-disk_efi_efidisk.lst partmap-kernel_mod-disk_efi_efidisk.lst -COMMANDFILES += cmd-kernel_mod-disk_efi_efidisk.lst -FSFILES += fs-kernel_mod-disk_efi_efidisk.lst -PARTMAPFILES += partmap-kernel_mod-disk_efi_efidisk.lst - -cmd-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh kernel > $@ || (rm -f $@; exit 1) - -fs-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh kernel > $@ || (rm -f $@; exit 1) - -partmap-kernel_mod-disk_efi_efidisk.lst: disk/efi/efidisk.c $(disk/efi/efidisk.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Idisk/efi -I$(srcdir)/disk/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(kernel_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh kernel > $@ || (rm -f $@; exit 1) - - -kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h \ - command.h -kernel_mod_CFLAGS = $(COMMON_CFLAGS) -kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) -kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) - -MOSTLYCLEANFILES += symlist.c -MOSTLYCLEANFILES += symlist.c kernel_syms.lst -DEFSYMFILES += kernel_syms.lst - -symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist.sh - /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh - /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) - -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/x86_64/setjmp.S -CLEANFILES += normal.mod mod-normal.o mod-normal.c pre-normal.o normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o und-normal.lst -ifneq ($(normal_mod_EXPORTS),no) -CLEANFILES += def-normal.lst -DEFSYMFILES += def-normal.lst -endif -MOSTLYCLEANFILES += normal_mod-normal_cmdline.d normal_mod-normal_command.d normal_mod-normal_completion.d normal_mod-normal_datetime.d normal_mod-normal_execute.d normal_mod-normal_function.d normal_mod-normal_lexer.d normal_mod-normal_main.d normal_mod-normal_menu.d normal_mod-normal_menu_text.d normal_mod-normal_color.d normal_mod-normal_menu_viewer.d normal_mod-normal_menu_entry.d normal_mod-normal_misc.d normal_mod-grub_script_tab.d normal_mod-normal_script.d normal_mod-normal_x86_64_setjmp.d -UNDSYMFILES += und-normal.lst - -normal.mod: pre-normal.o mod-normal.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-normal.o mod-normal.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-normal.o: $(normal_mod_DEPENDENCIES) normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o - -rm -f $@ - $(TARGET_CC) $(normal_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ normal_mod-normal_cmdline.o normal_mod-normal_command.o normal_mod-normal_completion.o normal_mod-normal_datetime.o normal_mod-normal_execute.o normal_mod-normal_function.o normal_mod-normal_lexer.o normal_mod-normal_main.o normal_mod-normal_menu.o normal_mod-normal_menu_text.o normal_mod-normal_color.o normal_mod-normal_menu_viewer.o normal_mod-normal_menu_entry.o normal_mod-normal_misc.o normal_mod-grub_script_tab.o normal_mod-normal_script.o normal_mod-normal_x86_64_setjmp.o - -mod-normal.o: mod-normal.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -c -o $@ $< - -mod-normal.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'normal' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(normal_mod_EXPORTS),no) -def-normal.lst: pre-normal.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 normal/' > $@ -endif - -und-normal.lst: pre-normal.o - echo 'normal' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -normal_mod-normal_cmdline.o: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_cmdline.d - -CLEANFILES += cmd-normal_mod-normal_cmdline.lst fs-normal_mod-normal_cmdline.lst partmap-normal_mod-normal_cmdline.lst -COMMANDFILES += cmd-normal_mod-normal_cmdline.lst -FSFILES += fs-normal_mod-normal_cmdline.lst -PARTMAPFILES += partmap-normal_mod-normal_cmdline.lst - -cmd-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_cmdline.lst: normal/cmdline.c $(normal/cmdline.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_command.o: normal/command.c $(normal/command.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_command.d - -CLEANFILES += cmd-normal_mod-normal_command.lst fs-normal_mod-normal_command.lst partmap-normal_mod-normal_command.lst -COMMANDFILES += cmd-normal_mod-normal_command.lst -FSFILES += fs-normal_mod-normal_command.lst -PARTMAPFILES += partmap-normal_mod-normal_command.lst - -cmd-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_command.lst: normal/command.c $(normal/command.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_completion.o: normal/completion.c $(normal/completion.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_completion.d - -CLEANFILES += cmd-normal_mod-normal_completion.lst fs-normal_mod-normal_completion.lst partmap-normal_mod-normal_completion.lst -COMMANDFILES += cmd-normal_mod-normal_completion.lst -FSFILES += fs-normal_mod-normal_completion.lst -PARTMAPFILES += partmap-normal_mod-normal_completion.lst - -cmd-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_completion.lst: normal/completion.c $(normal/completion.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_datetime.o: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_datetime.d - -CLEANFILES += cmd-normal_mod-normal_datetime.lst fs-normal_mod-normal_datetime.lst partmap-normal_mod-normal_datetime.lst -COMMANDFILES += cmd-normal_mod-normal_datetime.lst -FSFILES += fs-normal_mod-normal_datetime.lst -PARTMAPFILES += partmap-normal_mod-normal_datetime.lst - -cmd-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_datetime.lst: normal/datetime.c $(normal/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_execute.o: normal/execute.c $(normal/execute.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_execute.d - -CLEANFILES += cmd-normal_mod-normal_execute.lst fs-normal_mod-normal_execute.lst partmap-normal_mod-normal_execute.lst -COMMANDFILES += cmd-normal_mod-normal_execute.lst -FSFILES += fs-normal_mod-normal_execute.lst -PARTMAPFILES += partmap-normal_mod-normal_execute.lst - -cmd-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_execute.lst: normal/execute.c $(normal/execute.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_function.o: normal/function.c $(normal/function.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_function.d - -CLEANFILES += cmd-normal_mod-normal_function.lst fs-normal_mod-normal_function.lst partmap-normal_mod-normal_function.lst -COMMANDFILES += cmd-normal_mod-normal_function.lst -FSFILES += fs-normal_mod-normal_function.lst -PARTMAPFILES += partmap-normal_mod-normal_function.lst - -cmd-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_function.lst: normal/function.c $(normal/function.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_lexer.o: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_lexer.d - -CLEANFILES += cmd-normal_mod-normal_lexer.lst fs-normal_mod-normal_lexer.lst partmap-normal_mod-normal_lexer.lst -COMMANDFILES += cmd-normal_mod-normal_lexer.lst -FSFILES += fs-normal_mod-normal_lexer.lst -PARTMAPFILES += partmap-normal_mod-normal_lexer.lst - -cmd-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_lexer.lst: normal/lexer.c $(normal/lexer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_main.o: normal/main.c $(normal/main.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_main.d - -CLEANFILES += cmd-normal_mod-normal_main.lst fs-normal_mod-normal_main.lst partmap-normal_mod-normal_main.lst -COMMANDFILES += cmd-normal_mod-normal_main.lst -FSFILES += fs-normal_mod-normal_main.lst -PARTMAPFILES += partmap-normal_mod-normal_main.lst - -cmd-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_main.lst: normal/main.c $(normal/main.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu.o: normal/menu.c $(normal/menu.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu.d - -CLEANFILES += cmd-normal_mod-normal_menu.lst fs-normal_mod-normal_menu.lst partmap-normal_mod-normal_menu.lst -COMMANDFILES += cmd-normal_mod-normal_menu.lst -FSFILES += fs-normal_mod-normal_menu.lst -PARTMAPFILES += partmap-normal_mod-normal_menu.lst - -cmd-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu.lst: normal/menu.c $(normal/menu.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_text.o: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_text.d - -CLEANFILES += cmd-normal_mod-normal_menu_text.lst fs-normal_mod-normal_menu_text.lst partmap-normal_mod-normal_menu_text.lst -COMMANDFILES += cmd-normal_mod-normal_menu_text.lst -FSFILES += fs-normal_mod-normal_menu_text.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_text.lst - -cmd-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_text.lst: normal/menu_text.c $(normal/menu_text.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_color.o: normal/color.c $(normal/color.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_color.d - -CLEANFILES += cmd-normal_mod-normal_color.lst fs-normal_mod-normal_color.lst partmap-normal_mod-normal_color.lst -COMMANDFILES += cmd-normal_mod-normal_color.lst -FSFILES += fs-normal_mod-normal_color.lst -PARTMAPFILES += partmap-normal_mod-normal_color.lst - -cmd-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_color.lst: normal/color.c $(normal/color.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_viewer.o: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_viewer.d - -CLEANFILES += cmd-normal_mod-normal_menu_viewer.lst fs-normal_mod-normal_menu_viewer.lst partmap-normal_mod-normal_menu_viewer.lst -COMMANDFILES += cmd-normal_mod-normal_menu_viewer.lst -FSFILES += fs-normal_mod-normal_menu_viewer.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_viewer.lst - -cmd-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_viewer.lst: normal/menu_viewer.c $(normal/menu_viewer.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_menu_entry.o: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_menu_entry.d - -CLEANFILES += cmd-normal_mod-normal_menu_entry.lst fs-normal_mod-normal_menu_entry.lst partmap-normal_mod-normal_menu_entry.lst -COMMANDFILES += cmd-normal_mod-normal_menu_entry.lst -FSFILES += fs-normal_mod-normal_menu_entry.lst -PARTMAPFILES += partmap-normal_mod-normal_menu_entry.lst - -cmd-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_menu_entry.lst: normal/menu_entry.c $(normal/menu_entry.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_misc.o: normal/misc.c $(normal/misc.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_misc.d - -CLEANFILES += cmd-normal_mod-normal_misc.lst fs-normal_mod-normal_misc.lst partmap-normal_mod-normal_misc.lst -COMMANDFILES += cmd-normal_mod-normal_misc.lst -FSFILES += fs-normal_mod-normal_misc.lst -PARTMAPFILES += partmap-normal_mod-normal_misc.lst - -cmd-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_misc.lst: normal/misc.c $(normal/misc.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-grub_script_tab.o: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) - $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-grub_script_tab.d - -CLEANFILES += cmd-normal_mod-grub_script_tab.lst fs-normal_mod-grub_script_tab.lst partmap-normal_mod-grub_script_tab.lst -COMMANDFILES += cmd-normal_mod-grub_script_tab.lst -FSFILES += fs-normal_mod-grub_script_tab.lst -PARTMAPFILES += partmap-normal_mod-grub_script_tab.lst - -cmd-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-grub_script_tab.lst: grub_script.tab.c $(grub_script.tab.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -I. -I$(srcdir)/. $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_script.o: normal/script.c $(normal/script.c_DEPENDENCIES) - $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -MD -c -o $@ $< --include normal_mod-normal_script.d - -CLEANFILES += cmd-normal_mod-normal_script.lst fs-normal_mod-normal_script.lst partmap-normal_mod-normal_script.lst -COMMANDFILES += cmd-normal_mod-normal_script.lst -FSFILES += fs-normal_mod-normal_script.lst -PARTMAPFILES += partmap-normal_mod-normal_script.lst - -cmd-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_script.lst: normal/script.c $(normal/script.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal -I$(srcdir)/normal $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(normal_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod-normal_x86_64_setjmp.o: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) - $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -MD -c -o $@ $< --include normal_mod-normal_x86_64_setjmp.d - -CLEANFILES += cmd-normal_mod-normal_x86_64_setjmp.lst fs-normal_mod-normal_x86_64_setjmp.lst partmap-normal_mod-normal_x86_64_setjmp.lst -COMMANDFILES += cmd-normal_mod-normal_x86_64_setjmp.lst -FSFILES += fs-normal_mod-normal_x86_64_setjmp.lst -PARTMAPFILES += partmap-normal_mod-normal_x86_64_setjmp.lst - -cmd-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh normal > $@ || (rm -f $@; exit 1) - -fs-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genfslist.sh normal > $@ || (rm -f $@; exit 1) - -partmap-normal_mod-normal_x86_64_setjmp.lst: normal/x86_64/setjmp.S $(normal/x86_64/setjmp.S_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Inormal/x86_64 -I$(srcdir)/normal/x86_64 $(TARGET_CPPFLAGS) -DASM_FILE=1 $(TARGET_ASFLAGS) $(normal_mod_ASFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh normal > $@ || (rm -f $@; exit 1) - - -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For chain.mod. -chain_mod_SOURCES = loader/efi/chainloader.c -CLEANFILES += chain.mod mod-chain.o mod-chain.c pre-chain.o chain_mod-loader_efi_chainloader.o und-chain.lst -ifneq ($(chain_mod_EXPORTS),no) -CLEANFILES += def-chain.lst -DEFSYMFILES += def-chain.lst -endif -MOSTLYCLEANFILES += chain_mod-loader_efi_chainloader.d -UNDSYMFILES += und-chain.lst - -chain.mod: pre-chain.o mod-chain.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-chain.o mod-chain.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-chain.o: $(chain_mod_DEPENDENCIES) chain_mod-loader_efi_chainloader.o - -rm -f $@ - $(TARGET_CC) $(chain_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ chain_mod-loader_efi_chainloader.o - -mod-chain.o: mod-chain.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -c -o $@ $< - -mod-chain.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'chain' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(chain_mod_EXPORTS),no) -def-chain.lst: pre-chain.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 chain/' > $@ -endif - -und-chain.lst: pre-chain.o - echo 'chain' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -chain_mod-loader_efi_chainloader.o: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -MD -c -o $@ $< --include chain_mod-loader_efi_chainloader.d - -CLEANFILES += cmd-chain_mod-loader_efi_chainloader.lst fs-chain_mod-loader_efi_chainloader.lst partmap-chain_mod-loader_efi_chainloader.lst -COMMANDFILES += cmd-chain_mod-loader_efi_chainloader.lst -FSFILES += fs-chain_mod-loader_efi_chainloader.lst -PARTMAPFILES += partmap-chain_mod-loader_efi_chainloader.lst - -cmd-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh chain > $@ || (rm -f $@; exit 1) - -fs-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh chain > $@ || (rm -f $@; exit 1) - -partmap-chain_mod-loader_efi_chainloader.lst: loader/efi/chainloader.c $(loader/efi/chainloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(chain_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh chain > $@ || (rm -f $@; exit 1) - - -chain_mod_CFLAGS = $(COMMON_CFLAGS) -chain_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For appleldr.mod. -appleldr_mod_SOURCES = loader/efi/appleloader.c -CLEANFILES += appleldr.mod mod-appleldr.o mod-appleldr.c pre-appleldr.o appleldr_mod-loader_efi_appleloader.o und-appleldr.lst -ifneq ($(appleldr_mod_EXPORTS),no) -CLEANFILES += def-appleldr.lst -DEFSYMFILES += def-appleldr.lst -endif -MOSTLYCLEANFILES += appleldr_mod-loader_efi_appleloader.d -UNDSYMFILES += und-appleldr.lst - -appleldr.mod: pre-appleldr.o mod-appleldr.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-appleldr.o mod-appleldr.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-appleldr.o: $(appleldr_mod_DEPENDENCIES) appleldr_mod-loader_efi_appleloader.o - -rm -f $@ - $(TARGET_CC) $(appleldr_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ appleldr_mod-loader_efi_appleloader.o - -mod-appleldr.o: mod-appleldr.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -c -o $@ $< - -mod-appleldr.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'appleldr' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(appleldr_mod_EXPORTS),no) -def-appleldr.lst: pre-appleldr.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 appleldr/' > $@ -endif - -und-appleldr.lst: pre-appleldr.o - echo 'appleldr' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -appleldr_mod-loader_efi_appleloader.o: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -MD -c -o $@ $< --include appleldr_mod-loader_efi_appleloader.d - -CLEANFILES += cmd-appleldr_mod-loader_efi_appleloader.lst fs-appleldr_mod-loader_efi_appleloader.lst partmap-appleldr_mod-loader_efi_appleloader.lst -COMMANDFILES += cmd-appleldr_mod-loader_efi_appleloader.lst -FSFILES += fs-appleldr_mod-loader_efi_appleloader.lst -PARTMAPFILES += partmap-appleldr_mod-loader_efi_appleloader.lst - -cmd-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh appleldr > $@ || (rm -f $@; exit 1) - -fs-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh appleldr > $@ || (rm -f $@; exit 1) - -partmap-appleldr_mod-loader_efi_appleloader.lst: loader/efi/appleloader.c $(loader/efi/appleloader.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/efi -I$(srcdir)/loader/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(appleldr_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh appleldr > $@ || (rm -f $@; exit 1) - - -appleldr_mod_CFLAGS = $(COMMON_CFLAGS) -appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For linux.mod. -linux_mod_SOURCES = loader/i386/efi/linux.c -CLEANFILES += linux.mod mod-linux.o mod-linux.c pre-linux.o linux_mod-loader_i386_efi_linux.o und-linux.lst -ifneq ($(linux_mod_EXPORTS),no) -CLEANFILES += def-linux.lst -DEFSYMFILES += def-linux.lst -endif -MOSTLYCLEANFILES += linux_mod-loader_i386_efi_linux.d -UNDSYMFILES += und-linux.lst - -linux.mod: pre-linux.o mod-linux.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-linux.o mod-linux.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-linux.o: $(linux_mod_DEPENDENCIES) linux_mod-loader_i386_efi_linux.o - -rm -f $@ - $(TARGET_CC) $(linux_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ linux_mod-loader_i386_efi_linux.o - -mod-linux.o: mod-linux.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -c -o $@ $< - -mod-linux.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'linux' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(linux_mod_EXPORTS),no) -def-linux.lst: pre-linux.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 linux/' > $@ -endif - -und-linux.lst: pre-linux.o - echo 'linux' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -linux_mod-loader_i386_efi_linux.o: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) - $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -MD -c -o $@ $< --include linux_mod-loader_i386_efi_linux.d - -CLEANFILES += cmd-linux_mod-loader_i386_efi_linux.lst fs-linux_mod-loader_i386_efi_linux.lst partmap-linux_mod-loader_i386_efi_linux.lst -COMMANDFILES += cmd-linux_mod-loader_i386_efi_linux.lst -FSFILES += fs-linux_mod-loader_i386_efi_linux.lst -PARTMAPFILES += partmap-linux_mod-loader_i386_efi_linux.lst - -cmd-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh linux > $@ || (rm -f $@; exit 1) - -fs-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh linux > $@ || (rm -f $@; exit 1) - -partmap-linux_mod-loader_i386_efi_linux.lst: loader/i386/efi/linux.c $(loader/i386/efi/linux.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Iloader/i386/efi -I$(srcdir)/loader/i386/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(linux_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh linux > $@ || (rm -f $@; exit 1) - - -linux_mod_CFLAGS = $(COMMON_CFLAGS) -linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For halt.mod. -halt_mod_SOURCES = commands/halt.c -CLEANFILES += halt.mod mod-halt.o mod-halt.c pre-halt.o halt_mod-commands_halt.o und-halt.lst -ifneq ($(halt_mod_EXPORTS),no) -CLEANFILES += def-halt.lst -DEFSYMFILES += def-halt.lst -endif -MOSTLYCLEANFILES += halt_mod-commands_halt.d -UNDSYMFILES += und-halt.lst - -halt.mod: pre-halt.o mod-halt.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-halt.o mod-halt.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-halt.o: $(halt_mod_DEPENDENCIES) halt_mod-commands_halt.o - -rm -f $@ - $(TARGET_CC) $(halt_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ halt_mod-commands_halt.o - -mod-halt.o: mod-halt.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -c -o $@ $< - -mod-halt.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'halt' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(halt_mod_EXPORTS),no) -def-halt.lst: pre-halt.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 halt/' > $@ -endif - -und-halt.lst: pre-halt.o - echo 'halt' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -halt_mod-commands_halt.o: commands/halt.c $(commands/halt.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -MD -c -o $@ $< --include halt_mod-commands_halt.d - -CLEANFILES += cmd-halt_mod-commands_halt.lst fs-halt_mod-commands_halt.lst partmap-halt_mod-commands_halt.lst -COMMANDFILES += cmd-halt_mod-commands_halt.lst -FSFILES += fs-halt_mod-commands_halt.lst -PARTMAPFILES += partmap-halt_mod-commands_halt.lst - -cmd-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh halt > $@ || (rm -f $@; exit 1) - -fs-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh halt > $@ || (rm -f $@; exit 1) - -partmap-halt_mod-commands_halt.lst: commands/halt.c $(commands/halt.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(halt_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh halt > $@ || (rm -f $@; exit 1) - - -halt_mod_CFLAGS = $(COMMON_CFLAGS) -halt_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod. -reboot_mod_SOURCES = commands/reboot.c -CLEANFILES += reboot.mod mod-reboot.o mod-reboot.c pre-reboot.o reboot_mod-commands_reboot.o und-reboot.lst -ifneq ($(reboot_mod_EXPORTS),no) -CLEANFILES += def-reboot.lst -DEFSYMFILES += def-reboot.lst -endif -MOSTLYCLEANFILES += reboot_mod-commands_reboot.d -UNDSYMFILES += und-reboot.lst - -reboot.mod: pre-reboot.o mod-reboot.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-reboot.o mod-reboot.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-reboot.o: $(reboot_mod_DEPENDENCIES) reboot_mod-commands_reboot.o - -rm -f $@ - $(TARGET_CC) $(reboot_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ reboot_mod-commands_reboot.o - -mod-reboot.o: mod-reboot.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -c -o $@ $< - -mod-reboot.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'reboot' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(reboot_mod_EXPORTS),no) -def-reboot.lst: pre-reboot.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 reboot/' > $@ -endif - -und-reboot.lst: pre-reboot.o - echo 'reboot' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -reboot_mod-commands_reboot.o: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -MD -c -o $@ $< --include reboot_mod-commands_reboot.d - -CLEANFILES += cmd-reboot_mod-commands_reboot.lst fs-reboot_mod-commands_reboot.lst partmap-reboot_mod-commands_reboot.lst -COMMANDFILES += cmd-reboot_mod-commands_reboot.lst -FSFILES += fs-reboot_mod-commands_reboot.lst -PARTMAPFILES += partmap-reboot_mod-commands_reboot.lst - -cmd-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh reboot > $@ || (rm -f $@; exit 1) - -fs-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh reboot > $@ || (rm -f $@; exit 1) - -partmap-reboot_mod-commands_reboot.lst: commands/reboot.c $(commands/reboot.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(reboot_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh reboot > $@ || (rm -f $@; exit 1) - - -reboot_mod_CFLAGS = $(COMMON_CFLAGS) -reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pci.mod -pci_mod_SOURCES = bus/pci.c -CLEANFILES += pci.mod mod-pci.o mod-pci.c pre-pci.o pci_mod-bus_pci.o und-pci.lst -ifneq ($(pci_mod_EXPORTS),no) -CLEANFILES += def-pci.lst -DEFSYMFILES += def-pci.lst -endif -MOSTLYCLEANFILES += pci_mod-bus_pci.d -UNDSYMFILES += und-pci.lst - -pci.mod: pre-pci.o mod-pci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-pci.o mod-pci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-pci.o: $(pci_mod_DEPENDENCIES) pci_mod-bus_pci.o - -rm -f $@ - $(TARGET_CC) $(pci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pci_mod-bus_pci.o - -mod-pci.o: mod-pci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -c -o $@ $< - -mod-pci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'pci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(pci_mod_EXPORTS),no) -def-pci.lst: pre-pci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 pci/' > $@ -endif - -und-pci.lst: pre-pci.o - echo 'pci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -pci_mod-bus_pci.o: bus/pci.c $(bus/pci.c_DEPENDENCIES) - $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -MD -c -o $@ $< --include pci_mod-bus_pci.d - -CLEANFILES += cmd-pci_mod-bus_pci.lst fs-pci_mod-bus_pci.lst partmap-pci_mod-bus_pci.lst -COMMANDFILES += cmd-pci_mod-bus_pci.lst -FSFILES += fs-pci_mod-bus_pci.lst -PARTMAPFILES += partmap-pci_mod-bus_pci.lst - -cmd-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh pci > $@ || (rm -f $@; exit 1) - -fs-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh pci > $@ || (rm -f $@; exit 1) - -partmap-pci_mod-bus_pci.lst: bus/pci.c $(bus/pci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ibus -I$(srcdir)/bus $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(pci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh pci > $@ || (rm -f $@; exit 1) - - -pci_mod_CFLAGS = $(COMMON_CFLAGS) -pci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For lspci.mod -lspci_mod_SOURCES = commands/lspci.c -CLEANFILES += lspci.mod mod-lspci.o mod-lspci.c pre-lspci.o lspci_mod-commands_lspci.o und-lspci.lst -ifneq ($(lspci_mod_EXPORTS),no) -CLEANFILES += def-lspci.lst -DEFSYMFILES += def-lspci.lst -endif -MOSTLYCLEANFILES += lspci_mod-commands_lspci.d -UNDSYMFILES += und-lspci.lst - -lspci.mod: pre-lspci.o mod-lspci.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-lspci.o mod-lspci.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-lspci.o: $(lspci_mod_DEPENDENCIES) lspci_mod-commands_lspci.o - -rm -f $@ - $(TARGET_CC) $(lspci_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ lspci_mod-commands_lspci.o - -mod-lspci.o: mod-lspci.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -c -o $@ $< - -mod-lspci.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'lspci' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(lspci_mod_EXPORTS),no) -def-lspci.lst: pre-lspci.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 lspci/' > $@ -endif - -und-lspci.lst: pre-lspci.o - echo 'lspci' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -lspci_mod-commands_lspci.o: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -MD -c -o $@ $< --include lspci_mod-commands_lspci.d - -CLEANFILES += cmd-lspci_mod-commands_lspci.lst fs-lspci_mod-commands_lspci.lst partmap-lspci_mod-commands_lspci.lst -COMMANDFILES += cmd-lspci_mod-commands_lspci.lst -FSFILES += fs-lspci_mod-commands_lspci.lst -PARTMAPFILES += partmap-lspci_mod-commands_lspci.lst - -cmd-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh lspci > $@ || (rm -f $@; exit 1) - -fs-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh lspci > $@ || (rm -f $@; exit 1) - -partmap-lspci_mod-commands_lspci.lst: commands/lspci.c $(commands/lspci.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(lspci_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh lspci > $@ || (rm -f $@; exit 1) - - -lspci_mod_CFLAGS = $(COMMON_CFLAGS) -lspci_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datetime.mod -datetime_mod_SOURCES = lib/efi/datetime.c -CLEANFILES += datetime.mod mod-datetime.o mod-datetime.c pre-datetime.o datetime_mod-lib_efi_datetime.o und-datetime.lst -ifneq ($(datetime_mod_EXPORTS),no) -CLEANFILES += def-datetime.lst -DEFSYMFILES += def-datetime.lst -endif -MOSTLYCLEANFILES += datetime_mod-lib_efi_datetime.d -UNDSYMFILES += und-datetime.lst - -datetime.mod: pre-datetime.o mod-datetime.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datetime.o mod-datetime.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datetime.o: $(datetime_mod_DEPENDENCIES) datetime_mod-lib_efi_datetime.o - -rm -f $@ - $(TARGET_CC) $(datetime_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datetime_mod-lib_efi_datetime.o - -mod-datetime.o: mod-datetime.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -c -o $@ $< - -mod-datetime.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datetime' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datetime_mod_EXPORTS),no) -def-datetime.lst: pre-datetime.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datetime/' > $@ -endif - -und-datetime.lst: pre-datetime.o - echo 'datetime' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datetime_mod-lib_efi_datetime.o: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) - $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -MD -c -o $@ $< --include datetime_mod-lib_efi_datetime.d - -CLEANFILES += cmd-datetime_mod-lib_efi_datetime.lst fs-datetime_mod-lib_efi_datetime.lst partmap-datetime_mod-lib_efi_datetime.lst -COMMANDFILES += cmd-datetime_mod-lib_efi_datetime.lst -FSFILES += fs-datetime_mod-lib_efi_datetime.lst -PARTMAPFILES += partmap-datetime_mod-lib_efi_datetime.lst - -cmd-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datetime > $@ || (rm -f $@; exit 1) - -fs-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datetime > $@ || (rm -f $@; exit 1) - -partmap-datetime_mod-lib_efi_datetime.lst: lib/efi/datetime.c $(lib/efi/datetime.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ilib/efi -I$(srcdir)/lib/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datetime_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datetime > $@ || (rm -f $@; exit 1) - - -datetime_mod_CFLAGS = $(COMMON_CFLAGS) -datetime_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For date.mod -date_mod_SOURCES = commands/date.c -CLEANFILES += date.mod mod-date.o mod-date.c pre-date.o date_mod-commands_date.o und-date.lst -ifneq ($(date_mod_EXPORTS),no) -CLEANFILES += def-date.lst -DEFSYMFILES += def-date.lst -endif -MOSTLYCLEANFILES += date_mod-commands_date.d -UNDSYMFILES += und-date.lst - -date.mod: pre-date.o mod-date.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-date.o mod-date.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-date.o: $(date_mod_DEPENDENCIES) date_mod-commands_date.o - -rm -f $@ - $(TARGET_CC) $(date_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ date_mod-commands_date.o - -mod-date.o: mod-date.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -c -o $@ $< - -mod-date.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'date' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(date_mod_EXPORTS),no) -def-date.lst: pre-date.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 date/' > $@ -endif - -und-date.lst: pre-date.o - echo 'date' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -date_mod-commands_date.o: commands/date.c $(commands/date.c_DEPENDENCIES) - $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -MD -c -o $@ $< --include date_mod-commands_date.d - -CLEANFILES += cmd-date_mod-commands_date.lst fs-date_mod-commands_date.lst partmap-date_mod-commands_date.lst -COMMANDFILES += cmd-date_mod-commands_date.lst -FSFILES += fs-date_mod-commands_date.lst -PARTMAPFILES += partmap-date_mod-commands_date.lst - -cmd-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh date > $@ || (rm -f $@; exit 1) - -fs-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh date > $@ || (rm -f $@; exit 1) - -partmap-date_mod-commands_date.lst: commands/date.c $(commands/date.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands -I$(srcdir)/commands $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(date_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh date > $@ || (rm -f $@; exit 1) - - -date_mod_CFLAGS = $(COMMON_CFLAGS) -date_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For datehook.mod -datehook_mod_SOURCES = hook/datehook.c -CLEANFILES += datehook.mod mod-datehook.o mod-datehook.c pre-datehook.o datehook_mod-hook_datehook.o und-datehook.lst -ifneq ($(datehook_mod_EXPORTS),no) -CLEANFILES += def-datehook.lst -DEFSYMFILES += def-datehook.lst -endif -MOSTLYCLEANFILES += datehook_mod-hook_datehook.d -UNDSYMFILES += und-datehook.lst - -datehook.mod: pre-datehook.o mod-datehook.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-datehook.o mod-datehook.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-datehook.o: $(datehook_mod_DEPENDENCIES) datehook_mod-hook_datehook.o - -rm -f $@ - $(TARGET_CC) $(datehook_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ datehook_mod-hook_datehook.o - -mod-datehook.o: mod-datehook.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -c -o $@ $< - -mod-datehook.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'datehook' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(datehook_mod_EXPORTS),no) -def-datehook.lst: pre-datehook.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 datehook/' > $@ -endif - -und-datehook.lst: pre-datehook.o - echo 'datehook' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -datehook_mod-hook_datehook.o: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) - $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -MD -c -o $@ $< --include datehook_mod-hook_datehook.d - -CLEANFILES += cmd-datehook_mod-hook_datehook.lst fs-datehook_mod-hook_datehook.lst partmap-datehook_mod-hook_datehook.lst -COMMANDFILES += cmd-datehook_mod-hook_datehook.lst -FSFILES += fs-datehook_mod-hook_datehook.lst -PARTMAPFILES += partmap-datehook_mod-hook_datehook.lst - -cmd-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh datehook > $@ || (rm -f $@; exit 1) - -fs-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh datehook > $@ || (rm -f $@; exit 1) - -partmap-datehook_mod-hook_datehook.lst: hook/datehook.c $(hook/datehook.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Ihook -I$(srcdir)/hook $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(datehook_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh datehook > $@ || (rm -f $@; exit 1) - - -datehook_mod_CFLAGS = $(COMMON_CFLAGS) -datehook_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For loadbios.mod -loadbios_mod_SOURCES = commands/efi/loadbios.c -CLEANFILES += loadbios.mod mod-loadbios.o mod-loadbios.c pre-loadbios.o loadbios_mod-commands_efi_loadbios.o und-loadbios.lst -ifneq ($(loadbios_mod_EXPORTS),no) -CLEANFILES += def-loadbios.lst -DEFSYMFILES += def-loadbios.lst -endif -MOSTLYCLEANFILES += loadbios_mod-commands_efi_loadbios.d -UNDSYMFILES += und-loadbios.lst - -loadbios.mod: pre-loadbios.o mod-loadbios.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-loadbios.o mod-loadbios.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-loadbios.o: $(loadbios_mod_DEPENDENCIES) loadbios_mod-commands_efi_loadbios.o - -rm -f $@ - $(TARGET_CC) $(loadbios_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ loadbios_mod-commands_efi_loadbios.o - -mod-loadbios.o: mod-loadbios.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -c -o $@ $< - -mod-loadbios.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'loadbios' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(loadbios_mod_EXPORTS),no) -def-loadbios.lst: pre-loadbios.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 loadbios/' > $@ -endif - -und-loadbios.lst: pre-loadbios.o - echo 'loadbios' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -loadbios_mod-commands_efi_loadbios.o: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -MD -c -o $@ $< --include loadbios_mod-commands_efi_loadbios.d - -CLEANFILES += cmd-loadbios_mod-commands_efi_loadbios.lst fs-loadbios_mod-commands_efi_loadbios.lst partmap-loadbios_mod-commands_efi_loadbios.lst -COMMANDFILES += cmd-loadbios_mod-commands_efi_loadbios.lst -FSFILES += fs-loadbios_mod-commands_efi_loadbios.lst -PARTMAPFILES += partmap-loadbios_mod-commands_efi_loadbios.lst - -cmd-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh loadbios > $@ || (rm -f $@; exit 1) - -fs-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh loadbios > $@ || (rm -f $@; exit 1) - -partmap-loadbios_mod-commands_efi_loadbios.lst: commands/efi/loadbios.c $(commands/efi/loadbios.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(loadbios_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh loadbios > $@ || (rm -f $@; exit 1) - - -loadbios_mod_CFLAGS = $(COMMON_CFLAGS) -loadbios_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fixvideo.mod -fixvideo_mod_SOURCES = commands/efi/fixvideo.c -CLEANFILES += fixvideo.mod mod-fixvideo.o mod-fixvideo.c pre-fixvideo.o fixvideo_mod-commands_efi_fixvideo.o und-fixvideo.lst -ifneq ($(fixvideo_mod_EXPORTS),no) -CLEANFILES += def-fixvideo.lst -DEFSYMFILES += def-fixvideo.lst -endif -MOSTLYCLEANFILES += fixvideo_mod-commands_efi_fixvideo.d -UNDSYMFILES += und-fixvideo.lst - -fixvideo.mod: pre-fixvideo.o mod-fixvideo.o $(TARGET_OBJ2ELF) - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ pre-fixvideo.o mod-fixvideo.o - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi - $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ - -pre-fixvideo.o: $(fixvideo_mod_DEPENDENCIES) fixvideo_mod-commands_efi_fixvideo.o - -rm -f $@ - $(TARGET_CC) $(fixvideo_mod_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ fixvideo_mod-commands_efi_fixvideo.o - -mod-fixvideo.o: mod-fixvideo.c - $(TARGET_CC) $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -c -o $@ $< - -mod-fixvideo.c: $(builddir)/moddep.lst $(srcdir)/genmodsrc.sh - sh $(srcdir)/genmodsrc.sh 'fixvideo' $< > $@ || (rm -f $@; exit 1) - -ifneq ($(fixvideo_mod_EXPORTS),no) -def-fixvideo.lst: pre-fixvideo.o - $(NM) -g --defined-only -P -p $< | sed 's/^\([^ ]*\).*/\1 fixvideo/' > $@ -endif - -und-fixvideo.lst: pre-fixvideo.o - echo 'fixvideo' > $@ - $(NM) -u -P -p $< | cut -f1 -d' ' >> $@ - -fixvideo_mod-commands_efi_fixvideo.o: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) - $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -MD -c -o $@ $< --include fixvideo_mod-commands_efi_fixvideo.d - -CLEANFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst fs-fixvideo_mod-commands_efi_fixvideo.lst partmap-fixvideo_mod-commands_efi_fixvideo.lst -COMMANDFILES += cmd-fixvideo_mod-commands_efi_fixvideo.lst -FSFILES += fs-fixvideo_mod-commands_efi_fixvideo.lst -PARTMAPFILES += partmap-fixvideo_mod-commands_efi_fixvideo.lst - -cmd-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) gencmdlist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/gencmdlist.sh fixvideo > $@ || (rm -f $@; exit 1) - -fs-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genfslist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genfslist.sh fixvideo > $@ || (rm -f $@; exit 1) - -partmap-fixvideo_mod-commands_efi_fixvideo.lst: commands/efi/fixvideo.c $(commands/efi/fixvideo.c_DEPENDENCIES) genpartmaplist.sh - set -e; $(TARGET_CC) -Icommands/efi -I$(srcdir)/commands/efi $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(fixvideo_mod_CFLAGS) -E $< | sh $(srcdir)/genpartmaplist.sh fixvideo > $@ || (rm -f $@; exit 1) - - -fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) -fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) - -include $(srcdir)/conf/i386.mk -include $(srcdir)/conf/common.mk diff --git a/config.h.in b/config.h.in deleted file mode 100644 index e825f7c41..000000000 --- a/config.h.in +++ /dev/null @@ -1,134 +0,0 @@ -/* config.h.in. Generated from configure.ac by autoheader. */ - -/* Define it if GAS requires that absolute indirect calls/jumps are not - prefixed with an asterisk */ -#undef ABSOLUTE_WITHOUT_ASTERISK - -/* Define it to \"addr32\" or \"addr32;\" to make GAS happy */ -#undef ADDR32 - -/* Define it to one of __bss_start, edata and _edata */ -#undef BSS_START_SYMBOL - -/* Define it to \"data32\" or \"data32;\" to make GAS happy */ -#undef DATA32 - -/* Use lzma compression */ -#undef ENABLE_LZMA - -/* Use lzo compression */ -#undef ENABLE_LZO - -/* Define it to either end or _end */ -#undef END_SYMBOL - -/* Define if C symbols get an underscore after compilation */ -#undef HAVE_ASM_USCORE - -/* Define to 1 if you have the `asprintf' function. */ -#undef HAVE_ASPRINTF - -/* Define to 1 if you have the header file. */ -#undef HAVE_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_INTTYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LZO1X_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_LZO_LZO1X_H - -/* Define to 1 if you have the `memalign' function. */ -#undef HAVE_MEMALIGN - -/* Define to 1 if you have the header file. */ -#undef HAVE_MEMORY_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_CURSES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_NCURSES_H - -/* Define to 1 if you have the `posix_memalign' function. */ -#undef HAVE_POSIX_MEMALIGN - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDINT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STDLIB_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRINGS_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_STRING_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_STAT_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_SYS_TYPES_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_UNISTD_H - -/* Define to 1 if you have the header file. */ -#undef HAVE_USB_H - -/* Define to 1 if you have the `__bswapdi2' function. */ -#undef HAVE___BSWAPDI2 - -/* Define to 1 if you have the `__bswapsi2' function. */ -#undef HAVE___BSWAPSI2 - -/* Define to 1 if you enable memory manager debugging. */ -#undef MM_DEBUG - -/* Define to 1 if GCC generates calls to __enable_execute_stack() */ -#undef NEED_ENABLE_EXECUTE_STACK - -/* Catch gcc bug */ -#undef NESTED_FUNC_ATTR - -/* Define to the address where bug reports for this package should be sent. */ -#undef PACKAGE_BUGREPORT - -/* Define to the full name of this package. */ -#undef PACKAGE_NAME - -/* Define to the full name and version of this package. */ -#undef PACKAGE_STRING - -/* Define to the one symbol short name of this package. */ -#undef PACKAGE_TARNAME - -/* Define to the version of this package. */ -#undef PACKAGE_VERSION - -/* The size of `long', as computed by sizeof. */ -#undef SIZEOF_LONG - -/* The size of `void *', as computed by sizeof. */ -#undef SIZEOF_VOID_P - -/* Define to 1 if you have the ANSI C header files. */ -#undef STDC_HEADERS - -/* Define to 1 if your processor stores words with the most significant byte - first (like Motorola and SPARC, unlike Intel and VAX). */ -#undef WORDS_BIGENDIAN - -/* Number of bits in a file offset, on hosts where this is settable. */ -#undef _FILE_OFFSET_BITS - -/* Enable GNU extensions on systems that have them. */ -#ifndef _GNU_SOURCE -# undef _GNU_SOURCE -#endif - -/* Define for large files, on AIX-style hosts. */ -#undef _LARGE_FILES diff --git a/configure b/configure deleted file mode 100644 index 496f37e5f..000000000 --- a/configure +++ /dev/null @@ -1,10038 +0,0 @@ -#! /bin/sh -# Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.61 for GRUB 1.96. -# -# Report bugs to . -# -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -# This configure script is free software; the Free Software Foundation -# gives unlimited permission to copy, distribute and modify it. -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - -if test "x$CONFIG_SHELL" = x; then - if (eval ":") 2>/dev/null; then - as_have_required=yes -else - as_have_required=no -fi - - if test $as_have_required = yes && (eval ": -(as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=\$LINENO - as_lineno_2=\$LINENO - test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" && - test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; } -") 2> /dev/null; then - : -else - as_candidate_shells= - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - case $as_dir in - /*) - for as_base in sh bash ksh sh5; do - as_candidate_shells="$as_candidate_shells $as_dir/$as_base" - done;; - esac -done -IFS=$as_save_IFS - - - for as_shell in $as_candidate_shells $SHELL; do - # Try only shells that exist, to save several forks. - if { test -f "$as_shell" || test -f "$as_shell.exe"; } && - { ("$as_shell") 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -_ASEOF -}; then - CONFIG_SHELL=$as_shell - as_have_required=yes - if { "$as_shell" 2> /dev/null <<\_ASEOF -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - -: -(as_func_return () { - (exit $1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = "$1" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test $exitcode = 0) || { (exit 1); exit 1; } - -( - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; } - -_ASEOF -}; then - break -fi - -fi - - done - - if test "x$CONFIG_SHELL" != x; then - for as_var in BASH_ENV ENV - do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - done - export CONFIG_SHELL - exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"} -fi - - - if test $as_have_required = no; then - echo This script requires a shell more modern than all the - echo shells that I found on your system. Please install a - echo modern shell, or manually run the script under such a - echo shell if you do have one. - { (exit 1); exit 1; } -fi - - -fi - -fi - - - -(eval "as_func_return () { - (exit \$1) -} -as_func_success () { - as_func_return 0 -} -as_func_failure () { - as_func_return 1 -} -as_func_ret_success () { - return 0 -} -as_func_ret_failure () { - return 1 -} - -exitcode=0 -if as_func_success; then - : -else - exitcode=1 - echo as_func_success failed. -fi - -if as_func_failure; then - exitcode=1 - echo as_func_failure succeeded. -fi - -if as_func_ret_success; then - : -else - exitcode=1 - echo as_func_ret_success failed. -fi - -if as_func_ret_failure; then - exitcode=1 - echo as_func_ret_failure succeeded. -fi - -if ( set x; as_func_ret_success y && test x = \"\$1\" ); then - : -else - exitcode=1 - echo positional parameters were not saved. -fi - -test \$exitcode = 0") || { - echo No shell found that supports shell functions. - echo Please tell autoconf@gnu.org about your system, - echo including any error possibly output before this - echo message -} - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - - -exec 7<&0 &1 - -# Name of the host. -# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, -# so uname gets run too. -ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` - -# -# Initializations. -# -ac_default_prefix=/usr/local -ac_clean_files= -ac_config_libobj_dir=. -LIBOBJS= -cross_compiling=no -subdirs= -MFLAGS= -MAKEFLAGS= -SHELL=${CONFIG_SHELL-/bin/sh} - -# Identity of this package. -PACKAGE_NAME='GRUB' -PACKAGE_TARNAME='grub' -PACKAGE_VERSION='1.96' -PACKAGE_STRING='GRUB 1.96' -PACKAGE_BUGREPORT='bug-grub@gnu.org' - -ac_unique_file="include/grub/dl.h" -# Factoring default headers for most tests. -ac_includes_default="\ -#include -#ifdef HAVE_SYS_TYPES_H -# include -#endif -#ifdef HAVE_SYS_STAT_H -# include -#endif -#ifdef STDC_HEADERS -# include -# include -#else -# ifdef HAVE_STDLIB_H -# include -# endif -#endif -#ifdef HAVE_STRING_H -# if !defined STDC_HEADERS && defined HAVE_MEMORY_H -# include -# endif -# include -#endif -#ifdef HAVE_STRINGS_H -# include -#endif -#ifdef HAVE_INTTYPES_H -# include -#endif -#ifdef HAVE_STDINT_H -# include -#endif -#ifdef HAVE_UNISTD_H -# include -#endif" - -ac_subst_vars='SHELL -PATH_SEPARATOR -PACKAGE_NAME -PACKAGE_TARNAME -PACKAGE_VERSION -PACKAGE_STRING -PACKAGE_BUGREPORT -exec_prefix -prefix -program_transform_name -bindir -sbindir -libexecdir -datarootdir -datadir -sysconfdir -sharedstatedir -localstatedir -includedir -oldincludedir -docdir -infodir -htmldir -dvidir -pdfdir -psdir -libdir -localedir -mandir -DEFS -ECHO_C -ECHO_N -ECHO_T -LIBS -build_alias -host_alias -target_alias -build -build_cpu -build_vendor -build_os -host -host_cpu -host_vendor -host_os -target -target_cpu -target_vendor -target_os -host_kernel -platform -CMP -YACC -UNIFONT_BDF -INSTALL_PROGRAM -INSTALL_SCRIPT -INSTALL_DATA -AWK -SET_MAKE -RUBY -HELP2MAN -CC -CFLAGS -LDFLAGS -CPPFLAGS -ac_ct_CC -EXEEXT -OBJEXT -CPP -GREP -EGREP -LIBLZO -enable_lzo -TARGET_IMG_LDSCRIPT -TARGET_IMG_LDFLAGS -TARGET_OBJ2ELF -TARGET_CC -ac_ct_TARGET_CC -OBJCOPY -STRIP -NM -TARGET_CFLAGS -TARGET_CPPFLAGS -TARGET_LDFLAGS -LIBCURSES -LIBUSB -enable_grub_emu -enable_grub_emu_usb -enable_grub_fstest -enable_grub_pe2elf -FREETYPE -enable_grub_mkfont -freetype_cflags -freetype_libs -LIBOBJS -LTLIBOBJS' -ac_subst_files='' - ac_precious_vars='build_alias -host_alias -target_alias -CC -CFLAGS -LDFLAGS -LIBS -CPPFLAGS -CPP' - - -# Initialize some variables set by options. -ac_init_help= -ac_init_version=false -# The variables have the same names as the options, with -# dashes changed to underlines. -cache_file=/dev/null -exec_prefix=NONE -no_create= -no_recursion= -prefix=NONE -program_prefix=NONE -program_suffix=NONE -program_transform_name=s,x,x, -silent= -site= -srcdir= -verbose= -x_includes=NONE -x_libraries=NONE - -# Installation directory options. -# These are left unexpanded so users can "make install exec_prefix=/foo" -# and all the variables that are supposed to be based on exec_prefix -# by default will actually change. -# Use braces instead of parens because sh, perl, etc. also accept them. -# (The list follows the same order as the GNU Coding Standards.) -bindir='${exec_prefix}/bin' -sbindir='${exec_prefix}/sbin' -libexecdir='${exec_prefix}/libexec' -datarootdir='${prefix}/share' -datadir='${datarootdir}' -sysconfdir='${prefix}/etc' -sharedstatedir='${prefix}/com' -localstatedir='${prefix}/var' -includedir='${prefix}/include' -oldincludedir='/usr/include' -docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' -infodir='${datarootdir}/info' -htmldir='${docdir}' -dvidir='${docdir}' -pdfdir='${docdir}' -psdir='${docdir}' -libdir='${exec_prefix}/lib' -localedir='${datarootdir}/locale' -mandir='${datarootdir}/man' - -ac_prev= -ac_dashdash= -for ac_option -do - # If the previous option needs an argument, assign it. - if test -n "$ac_prev"; then - eval $ac_prev=\$ac_option - ac_prev= - continue - fi - - case $ac_option in - *=*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; - *) ac_optarg=yes ;; - esac - - # Accept the important Cygnus configure options, so we can diagnose typos. - - case $ac_dashdash$ac_option in - --) - ac_dashdash=yes ;; - - -bindir | --bindir | --bindi | --bind | --bin | --bi) - ac_prev=bindir ;; - -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) - bindir=$ac_optarg ;; - - -build | --build | --buil | --bui | --bu) - ac_prev=build_alias ;; - -build=* | --build=* | --buil=* | --bui=* | --bu=*) - build_alias=$ac_optarg ;; - - -cache-file | --cache-file | --cache-fil | --cache-fi \ - | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) - ac_prev=cache_file ;; - -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ - | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) - cache_file=$ac_optarg ;; - - --config-cache | -C) - cache_file=config.cache ;; - - -datadir | --datadir | --datadi | --datad) - ac_prev=datadir ;; - -datadir=* | --datadir=* | --datadi=* | --datad=*) - datadir=$ac_optarg ;; - - -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ - | --dataroo | --dataro | --datar) - ac_prev=datarootdir ;; - -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ - | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) - datarootdir=$ac_optarg ;; - - -disable-* | --disable-*) - ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=no ;; - - -docdir | --docdir | --docdi | --doc | --do) - ac_prev=docdir ;; - -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) - docdir=$ac_optarg ;; - - -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) - ac_prev=dvidir ;; - -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) - dvidir=$ac_optarg ;; - - -enable-* | --enable-*) - ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid feature name: $ac_feature" >&2 - { (exit 1); exit 1; }; } - ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'` - eval enable_$ac_feature=\$ac_optarg ;; - - -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ - | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ - | --exec | --exe | --ex) - ac_prev=exec_prefix ;; - -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ - | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ - | --exec=* | --exe=* | --ex=*) - exec_prefix=$ac_optarg ;; - - -gas | --gas | --ga | --g) - # Obsolete; use --with-gas. - with_gas=yes ;; - - -help | --help | --hel | --he | -h) - ac_init_help=long ;; - -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) - ac_init_help=recursive ;; - -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) - ac_init_help=short ;; - - -host | --host | --hos | --ho) - ac_prev=host_alias ;; - -host=* | --host=* | --hos=* | --ho=*) - host_alias=$ac_optarg ;; - - -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) - ac_prev=htmldir ;; - -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ - | --ht=*) - htmldir=$ac_optarg ;; - - -includedir | --includedir | --includedi | --included | --include \ - | --includ | --inclu | --incl | --inc) - ac_prev=includedir ;; - -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ - | --includ=* | --inclu=* | --incl=* | --inc=*) - includedir=$ac_optarg ;; - - -infodir | --infodir | --infodi | --infod | --info | --inf) - ac_prev=infodir ;; - -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) - infodir=$ac_optarg ;; - - -libdir | --libdir | --libdi | --libd) - ac_prev=libdir ;; - -libdir=* | --libdir=* | --libdi=* | --libd=*) - libdir=$ac_optarg ;; - - -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ - | --libexe | --libex | --libe) - ac_prev=libexecdir ;; - -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ - | --libexe=* | --libex=* | --libe=*) - libexecdir=$ac_optarg ;; - - -localedir | --localedir | --localedi | --localed | --locale) - ac_prev=localedir ;; - -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) - localedir=$ac_optarg ;; - - -localstatedir | --localstatedir | --localstatedi | --localstated \ - | --localstate | --localstat | --localsta | --localst | --locals) - ac_prev=localstatedir ;; - -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ - | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) - localstatedir=$ac_optarg ;; - - -mandir | --mandir | --mandi | --mand | --man | --ma | --m) - ac_prev=mandir ;; - -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) - mandir=$ac_optarg ;; - - -nfp | --nfp | --nf) - # Obsolete; use --without-fp. - with_fp=no ;; - - -no-create | --no-create | --no-creat | --no-crea | --no-cre \ - | --no-cr | --no-c | -n) - no_create=yes ;; - - -no-recursion | --no-recursion | --no-recursio | --no-recursi \ - | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) - no_recursion=yes ;; - - -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ - | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ - | --oldin | --oldi | --old | --ol | --o) - ac_prev=oldincludedir ;; - -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ - | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ - | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) - oldincludedir=$ac_optarg ;; - - -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) - ac_prev=prefix ;; - -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) - prefix=$ac_optarg ;; - - -program-prefix | --program-prefix | --program-prefi | --program-pref \ - | --program-pre | --program-pr | --program-p) - ac_prev=program_prefix ;; - -program-prefix=* | --program-prefix=* | --program-prefi=* \ - | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) - program_prefix=$ac_optarg ;; - - -program-suffix | --program-suffix | --program-suffi | --program-suff \ - | --program-suf | --program-su | --program-s) - ac_prev=program_suffix ;; - -program-suffix=* | --program-suffix=* | --program-suffi=* \ - | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) - program_suffix=$ac_optarg ;; - - -program-transform-name | --program-transform-name \ - | --program-transform-nam | --program-transform-na \ - | --program-transform-n | --program-transform- \ - | --program-transform | --program-transfor \ - | --program-transfo | --program-transf \ - | --program-trans | --program-tran \ - | --progr-tra | --program-tr | --program-t) - ac_prev=program_transform_name ;; - -program-transform-name=* | --program-transform-name=* \ - | --program-transform-nam=* | --program-transform-na=* \ - | --program-transform-n=* | --program-transform-=* \ - | --program-transform=* | --program-transfor=* \ - | --program-transfo=* | --program-transf=* \ - | --program-trans=* | --program-tran=* \ - | --progr-tra=* | --program-tr=* | --program-t=*) - program_transform_name=$ac_optarg ;; - - -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) - ac_prev=pdfdir ;; - -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) - pdfdir=$ac_optarg ;; - - -psdir | --psdir | --psdi | --psd | --ps) - ac_prev=psdir ;; - -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) - psdir=$ac_optarg ;; - - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - silent=yes ;; - - -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) - ac_prev=sbindir ;; - -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ - | --sbi=* | --sb=*) - sbindir=$ac_optarg ;; - - -sharedstatedir | --sharedstatedir | --sharedstatedi \ - | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ - | --sharedst | --shareds | --shared | --share | --shar \ - | --sha | --sh) - ac_prev=sharedstatedir ;; - -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ - | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ - | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ - | --sha=* | --sh=*) - sharedstatedir=$ac_optarg ;; - - -site | --site | --sit) - ac_prev=site ;; - -site=* | --site=* | --sit=*) - site=$ac_optarg ;; - - -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) - ac_prev=srcdir ;; - -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) - srcdir=$ac_optarg ;; - - -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ - | --syscon | --sysco | --sysc | --sys | --sy) - ac_prev=sysconfdir ;; - -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ - | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) - sysconfdir=$ac_optarg ;; - - -target | --target | --targe | --targ | --tar | --ta | --t) - ac_prev=target_alias ;; - -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) - target_alias=$ac_optarg ;; - - -v | -verbose | --verbose | --verbos | --verbo | --verb) - verbose=yes ;; - - -version | --version | --versio | --versi | --vers | -V) - ac_init_version=: ;; - - -with-* | --with-*) - ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=\$ac_optarg ;; - - -without-* | --without-*) - ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` - # Reject names that are not valid shell variable names. - expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid package name: $ac_package" >&2 - { (exit 1); exit 1; }; } - ac_package=`echo $ac_package | sed 's/[-.]/_/g'` - eval with_$ac_package=no ;; - - --x) - # Obsolete; use --with-x. - with_x=yes ;; - - -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ - | --x-incl | --x-inc | --x-in | --x-i) - ac_prev=x_includes ;; - -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ - | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) - x_includes=$ac_optarg ;; - - -x-libraries | --x-libraries | --x-librarie | --x-librari \ - | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) - ac_prev=x_libraries ;; - -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ - | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) - x_libraries=$ac_optarg ;; - - -*) { echo "$as_me: error: unrecognized option: $ac_option -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } - ;; - - *=*) - ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` - # Reject names that are not valid shell variable names. - expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && - { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 - { (exit 1); exit 1; }; } - eval $ac_envvar=\$ac_optarg - export $ac_envvar ;; - - *) - # FIXME: should be removed in autoconf 3.0. - echo "$as_me: WARNING: you should use --build, --host, --target" >&2 - expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && - echo "$as_me: WARNING: invalid host type: $ac_option" >&2 - : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} - ;; - - esac -done - -if test -n "$ac_prev"; then - ac_option=--`echo $ac_prev | sed 's/_/-/g'` - { echo "$as_me: error: missing argument to $ac_option" >&2 - { (exit 1); exit 1; }; } -fi - -# Be sure to have absolute directory names. -for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ - datadir sysconfdir sharedstatedir localstatedir includedir \ - oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ - libdir localedir mandir -do - eval ac_val=\$$ac_var - case $ac_val in - [\\/$]* | ?:[\\/]* ) continue;; - NONE | '' ) case $ac_var in *prefix ) continue;; esac;; - esac - { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 - { (exit 1); exit 1; }; } -done - -# There might be people who depend on the old broken behavior: `$host' -# used to hold the argument of --host etc. -# FIXME: To remove some day. -build=$build_alias -host=$host_alias -target=$target_alias - -# FIXME: To remove some day. -if test "x$host_alias" != x; then - if test "x$build_alias" = x; then - cross_compiling=maybe - echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used." >&2 - elif test "x$build_alias" != "x$host_alias"; then - cross_compiling=yes - fi -fi - -ac_tool_prefix= -test -n "$host_alias" && ac_tool_prefix=$host_alias- - -test "$silent" = yes && exec 6>/dev/null - - -ac_pwd=`pwd` && test -n "$ac_pwd" && -ac_ls_di=`ls -di .` && -ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || - { echo "$as_me: error: Working directory cannot be determined" >&2 - { (exit 1); exit 1; }; } -test "X$ac_ls_di" = "X$ac_pwd_ls_di" || - { echo "$as_me: error: pwd does not report name of working directory" >&2 - { (exit 1); exit 1; }; } - - -# Find the source files, if location was not specified. -if test -z "$srcdir"; then - ac_srcdir_defaulted=yes - # Try the directory containing this script, then the parent directory. - ac_confdir=`$as_dirname -- "$0" || -$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$0" : 'X\(//\)[^/]' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X"$0" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - srcdir=$ac_confdir - if test ! -r "$srcdir/$ac_unique_file"; then - srcdir=.. - fi -else - ac_srcdir_defaulted=no -fi -if test ! -r "$srcdir/$ac_unique_file"; then - test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." - { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 - { (exit 1); exit 1; }; } -fi -ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" -ac_abs_confdir=`( - cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2 - { (exit 1); exit 1; }; } - pwd)` -# When building in place, set srcdir=. -if test "$ac_abs_confdir" = "$ac_pwd"; then - srcdir=. -fi -# Remove unnecessary trailing slashes from srcdir. -# Double slashes in file names in object file debugging info -# mess up M-x gdb in Emacs. -case $srcdir in -*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; -esac -for ac_var in $ac_precious_vars; do - eval ac_env_${ac_var}_set=\${${ac_var}+set} - eval ac_env_${ac_var}_value=\$${ac_var} - eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} - eval ac_cv_env_${ac_var}_value=\$${ac_var} -done - -# -# Report the --help message. -# -if test "$ac_init_help" = "long"; then - # Omit some internal or obsolete options to make the list less imposing. - # This message is too long to be a string in the A/UX 3.1 sh. - cat <<_ACEOF -\`configure' configures GRUB 1.96 to adapt to many kinds of systems. - -Usage: $0 [OPTION]... [VAR=VALUE]... - -To assign environment variables (e.g., CC, CFLAGS...), specify them as -VAR=VALUE. See below for descriptions of some of the useful variables. - -Defaults for the options are specified in brackets. - -Configuration: - -h, --help display this help and exit - --help=short display options specific to this package - --help=recursive display the short help of all the included packages - -V, --version display version information and exit - -q, --quiet, --silent do not print \`checking...' messages - --cache-file=FILE cache test results in FILE [disabled] - -C, --config-cache alias for \`--cache-file=config.cache' - -n, --no-create do not create output files - --srcdir=DIR find the sources in DIR [configure dir or \`..'] - -Installation directories: - --prefix=PREFIX install architecture-independent files in PREFIX - [$ac_default_prefix] - --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX - [PREFIX] - -By default, \`make install' will install all the files in -\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify -an installation prefix other than \`$ac_default_prefix' using \`--prefix', -for instance \`--prefix=\$HOME'. - -For better control, use the options below. - -Fine tuning of the installation directories: - --bindir=DIR user executables [EPREFIX/bin] - --sbindir=DIR system admin executables [EPREFIX/sbin] - --libexecdir=DIR program executables [EPREFIX/libexec] - --sysconfdir=DIR read-only single-machine data [PREFIX/etc] - --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] - --localstatedir=DIR modifiable single-machine data [PREFIX/var] - --libdir=DIR object code libraries [EPREFIX/lib] - --includedir=DIR C header files [PREFIX/include] - --oldincludedir=DIR C header files for non-gcc [/usr/include] - --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] - --datadir=DIR read-only architecture-independent data [DATAROOTDIR] - --infodir=DIR info documentation [DATAROOTDIR/info] - --localedir=DIR locale-dependent data [DATAROOTDIR/locale] - --mandir=DIR man documentation [DATAROOTDIR/man] - --docdir=DIR documentation root [DATAROOTDIR/doc/grub] - --htmldir=DIR html documentation [DOCDIR] - --dvidir=DIR dvi documentation [DOCDIR] - --pdfdir=DIR pdf documentation [DOCDIR] - --psdir=DIR ps documentation [DOCDIR] -_ACEOF - - cat <<\_ACEOF - -Program names: - --program-prefix=PREFIX prepend PREFIX to installed program names - --program-suffix=SUFFIX append SUFFIX to installed program names - --program-transform-name=PROGRAM run sed PROGRAM on installed program names - -System types: - --build=BUILD configure for building on BUILD [guessed] - --host=HOST cross-compile to build programs to run on HOST [BUILD] - --target=TARGET configure for building compilers for TARGET [HOST] -_ACEOF -fi - -if test -n "$ac_init_help"; then - case $ac_init_help in - short | recursive ) echo "Configuration of GRUB 1.96:";; - esac - cat <<\_ACEOF - -Optional Features: - --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) - --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --disable-largefile omit support for large files - --enable-lzo use lzo to compress kernel (default is lzma) - --enable-mm-debug include memory manager debugging - --enable-grub-emu build and install the `grub-emu' debugging utility - --enable-grub-emu-usb build and install the `grub-emu' debugging utility - with USB support - --enable-grub-fstest build and install the `grub-fstest' debugging - utility - --enable-grub-pe2elf build and install the `grub-pe2elf' conversion - utility - --enable-grub-mkfont build and install the `grub-mkfont' utility - -Optional Packages: - --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] - --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-platform=PLATFORM - select the host platform [guessed] - -Some influential environment variables: - CC C compiler command - CFLAGS C compiler flags - LDFLAGS linker flags, e.g. -L if you have libraries in a - nonstandard directory - LIBS libraries to pass to the linker, e.g. -l - CPPFLAGS C/C++/Objective C preprocessor flags, e.g. -I if - you have headers in a nonstandard directory - CPP C preprocessor - -Use these variables to override the choices made by `configure' or to help -it to find libraries and programs with nonstandard names/locations. - -Report bugs to . -_ACEOF -ac_status=$? -fi - -if test "$ac_init_help" = "recursive"; then - # If there are subdirs, report their specific --help. - for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue - test -d "$ac_dir" || continue - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - cd "$ac_dir" || { ac_status=$?; continue; } - # Check for guested configure. - if test -f "$ac_srcdir/configure.gnu"; then - echo && - $SHELL "$ac_srcdir/configure.gnu" --help=recursive - elif test -f "$ac_srcdir/configure"; then - echo && - $SHELL "$ac_srcdir/configure" --help=recursive - else - echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 - fi || ac_status=$? - cd "$ac_pwd" || { ac_status=$?; break; } - done -fi - -test -n "$ac_init_help" && exit $ac_status -if $ac_init_version; then - cat <<\_ACEOF -GRUB configure 1.96 -generated by GNU Autoconf 2.61 - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc. -This configure script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it. -_ACEOF - exit -fi -cat >config.log <<_ACEOF -This file contains any messages produced by compilers while -running configure, to aid debugging if configure makes a mistake. - -It was created by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was - - $ $0 $@ - -_ACEOF -exec 5>>config.log -{ -cat <<_ASUNAME -## --------- ## -## Platform. ## -## --------- ## - -hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` -uname -m = `(uname -m) 2>/dev/null || echo unknown` -uname -r = `(uname -r) 2>/dev/null || echo unknown` -uname -s = `(uname -s) 2>/dev/null || echo unknown` -uname -v = `(uname -v) 2>/dev/null || echo unknown` - -/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` -/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` - -/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` -/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` -/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` -/usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` -/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` -/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` -/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` - -_ASUNAME - -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - echo "PATH: $as_dir" -done -IFS=$as_save_IFS - -} >&5 - -cat >&5 <<_ACEOF - - -## ----------- ## -## Core tests. ## -## ----------- ## - -_ACEOF - - -# Keep a trace of the command line. -# Strip out --no-create and --no-recursion so they do not pile up. -# Strip out --silent because we don't want to record it for future runs. -# Also quote any args containing shell meta-characters. -# Make two passes to allow for proper duplicate-argument suppression. -ac_configure_args= -ac_configure_args0= -ac_configure_args1= -ac_must_keep_next=false -for ac_pass in 1 2 -do - for ac_arg - do - case $ac_arg in - -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil) - continue ;; - *\'*) - ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; - esac - case $ac_pass in - 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; - 2) - ac_configure_args1="$ac_configure_args1 '$ac_arg'" - if test $ac_must_keep_next = true; then - ac_must_keep_next=false # Got value, back to normal. - else - case $ac_arg in - *=* | --config-cache | -C | -disable-* | --disable-* \ - | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ - | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ - | -with-* | --with-* | -without-* | --without-* | --x) - case "$ac_configure_args0 " in - "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; - esac - ;; - -* ) ac_must_keep_next=true ;; - esac - fi - ac_configure_args="$ac_configure_args '$ac_arg'" - ;; - esac - done -done -$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } -$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } - -# When interrupted or exit'd, cleanup temporary files, and complete -# config.log. We remove comments because anyway the quotes in there -# would cause problems or look ugly. -# WARNING: Use '\'' to represent an apostrophe within the trap. -# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. -trap 'exit_status=$? - # Save into config.log some information that might help in debugging. - { - echo - - cat <<\_ASBOX -## ---------------- ## -## Cache variables. ## -## ---------------- ## -_ASBOX - echo - # The following way of writing the cache mishandles newlines in values, -( - for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - (set) 2>&1 | - case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - sed -n \ - "s/'\''/'\''\\\\'\'''\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" - ;; #( - *) - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) - echo - - cat <<\_ASBOX -## ----------------- ## -## Output variables. ## -## ----------------- ## -_ASBOX - echo - for ac_var in $ac_subst_vars - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - - if test -n "$ac_subst_files"; then - cat <<\_ASBOX -## ------------------- ## -## File substitutions. ## -## ------------------- ## -_ASBOX - echo - for ac_var in $ac_subst_files - do - eval ac_val=\$$ac_var - case $ac_val in - *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; - esac - echo "$ac_var='\''$ac_val'\''" - done | sort - echo - fi - - if test -s confdefs.h; then - cat <<\_ASBOX -## ----------- ## -## confdefs.h. ## -## ----------- ## -_ASBOX - echo - cat confdefs.h - echo - fi - test "$ac_signal" != 0 && - echo "$as_me: caught signal $ac_signal" - echo "$as_me: exit $exit_status" - } >&5 - rm -f core *.core core.conftest.* && - rm -f -r conftest* confdefs* conf$$* $ac_clean_files && - exit $exit_status -' 0 -for ac_signal in 1 2 13 15; do - trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal -done -ac_signal=0 - -# confdefs.h avoids OS command line length limits that DEFS can exceed. -rm -f -r conftest* confdefs.h - -# Predefined preprocessor variables. - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_NAME "$PACKAGE_NAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_TARNAME "$PACKAGE_TARNAME" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_VERSION "$PACKAGE_VERSION" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_STRING "$PACKAGE_STRING" -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" -_ACEOF - - -# Let the site file select an alternate cache file if it wants to. -# Prefer explicitly selected file to automatically selected ones. -if test -n "$CONFIG_SITE"; then - set x "$CONFIG_SITE" -elif test "x$prefix" != xNONE; then - set x "$prefix/share/config.site" "$prefix/etc/config.site" -else - set x "$ac_default_prefix/share/config.site" \ - "$ac_default_prefix/etc/config.site" -fi -shift -for ac_site_file -do - if test -r "$ac_site_file"; then - { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 -echo "$as_me: loading site script $ac_site_file" >&6;} - sed 's/^/| /' "$ac_site_file" >&5 - . "$ac_site_file" - fi -done - -if test -r "$cache_file"; then - # Some versions of bash will fail to source /dev/null (special - # files actually), so we avoid doing that. - if test -f "$cache_file"; then - { echo "$as_me:$LINENO: loading cache $cache_file" >&5 -echo "$as_me: loading cache $cache_file" >&6;} - case $cache_file in - [\\/]* | ?:[\\/]* ) . "$cache_file";; - *) . "./$cache_file";; - esac - fi -else - { echo "$as_me:$LINENO: creating cache $cache_file" >&5 -echo "$as_me: creating cache $cache_file" >&6;} - >$cache_file -fi - -# Check that the precious variables saved in the cache have kept the same -# value. -ac_cache_corrupted=false -for ac_var in $ac_precious_vars; do - eval ac_old_set=\$ac_cv_env_${ac_var}_set - eval ac_new_set=\$ac_env_${ac_var}_set - eval ac_old_val=\$ac_cv_env_${ac_var}_value - eval ac_new_val=\$ac_env_${ac_var}_value - case $ac_old_set,$ac_new_set in - set,) - { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,set) - { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 -echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} - ac_cache_corrupted=: ;; - ,);; - *) - if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 -echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 -echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 -echo "$as_me: current value: $ac_new_val" >&2;} - ac_cache_corrupted=: - fi;; - esac - # Pass precious variables to config.status. - if test "$ac_new_set" = set; then - case $ac_new_val in - *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; - *) ac_arg=$ac_var=$ac_new_val ;; - esac - case " $ac_configure_args " in - *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. - *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; - esac - fi -done -if $ac_cache_corrupted; then - { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 -echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 -echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} - { (exit 1); exit 1; }; } -fi - - - - - - - - - - - - - - - - - - - - - - - - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - - - -ac_config_headers="$ac_config_headers config.h" - - -# Checks for host and target systems. -ac_aux_dir= -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" - break - elif test -f "$ac_dir/install.sh"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install.sh -c" - break - elif test -f "$ac_dir/shtool"; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/shtool install -c" - break - fi -done -if test -z "$ac_aux_dir"; then - { { echo "$as_me:$LINENO: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&5 -echo "$as_me: error: cannot find install-sh or install.sh in \"$srcdir\" \"$srcdir/..\" \"$srcdir/../..\"" >&2;} - { (exit 1); exit 1; }; } -fi - -# These three variables are undocumented and unsupported, -# and are intended to be withdrawn in a future Autoconf release. -# They can cause serious problems if a builder's source tree is in a directory -# whose full name contains unusual characters. -ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. -ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. -ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. - - -# Make sure we can run config.sub. -$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || - { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5 -echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;} - { (exit 1); exit 1; }; } - -{ echo "$as_me:$LINENO: checking build system type" >&5 -echo $ECHO_N "checking build system type... $ECHO_C" >&6; } -if test "${ac_cv_build+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_build_alias=$build_alias -test "x$ac_build_alias" = x && - ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` -test "x$ac_build_alias" = x && - { { echo "$as_me:$LINENO: error: cannot guess build type; you must specify one" >&5 -echo "$as_me: error: cannot guess build type; you must specify one" >&2;} - { (exit 1); exit 1; }; } -ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;} - { (exit 1); exit 1; }; } - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5 -echo "${ECHO_T}$ac_cv_build" >&6; } -case $ac_cv_build in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5 -echo "$as_me: error: invalid value of canonical build" >&2;} - { (exit 1); exit 1; }; };; -esac -build=$ac_cv_build -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_build -shift -build_cpu=$1 -build_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -build_os=$* -IFS=$ac_save_IFS -case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking host system type" >&5 -echo $ECHO_N "checking host system type... $ECHO_C" >&6; } -if test "${ac_cv_host+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$host_alias" = x; then - ac_cv_host=$ac_cv_build -else - ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5 -echo "${ECHO_T}$ac_cv_host" >&6; } -case $ac_cv_host in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5 -echo "$as_me: error: invalid value of canonical host" >&2;} - { (exit 1); exit 1; }; };; -esac -host=$ac_cv_host -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_host -shift -host_cpu=$1 -host_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -host_os=$* -IFS=$ac_save_IFS -case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac - - -{ echo "$as_me:$LINENO: checking target system type" >&5 -echo $ECHO_N "checking target system type... $ECHO_C" >&6; } -if test "${ac_cv_target+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "x$target_alias" = x; then - ac_cv_target=$ac_cv_host -else - ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` || - { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5 -echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;} - { (exit 1); exit 1; }; } -fi - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5 -echo "${ECHO_T}$ac_cv_target" >&6; } -case $ac_cv_target in -*-*-*) ;; -*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5 -echo "$as_me: error: invalid value of canonical target" >&2;} - { (exit 1); exit 1; }; };; -esac -target=$ac_cv_target -ac_save_IFS=$IFS; IFS='-' -set x $ac_cv_target -shift -target_cpu=$1 -target_vendor=$2 -shift; shift -# Remember, the first character of IFS is used to create $*, -# except with old shells: -target_os=$* -IFS=$ac_save_IFS -case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac - - -# The aliases save the names the user supplied, while $host etc. -# will get canonicalized. -test -n "$target_alias" && - test "$program_prefix$program_suffix$program_transform_name" = \ - NONENONEs,x,x, && - program_prefix=${target_alias}- - -# Program name transformations -test "$program_prefix" != NONE && - program_transform_name="s&^&$program_prefix&;$program_transform_name" -# Use a double $ so make ignores it. -test "$program_suffix" != NONE && - program_transform_name="s&\$&$program_suffix&;$program_transform_name" -# Double any \ or $. echo might interpret backslashes. -# By default was `s,x,x', remove it if useless. -cat <<\_ACEOF >conftest.sed -s/[\\$]/&&/g;s/;s,x,x,$// -_ACEOF -program_transform_name=`echo $program_transform_name | sed -f conftest.sed` -rm -f conftest.sed - - -case "$host_cpu" in - powerpc64) host_m32=1 ;; -esac - -case "$target_cpu" in - i[3456]86) target_cpu=i386 ;; -esac - -# Specify the platform (such as firmware). - -# Check whether --with-platform was given. -if test "${with_platform+set}" = set; then - withval=$with_platform; -fi - - -# Guess the platform if not specified. -if test "x$with_platform" = x; then - case "$target_cpu"-"$target_vendor" in - i386-apple) platform=efi ;; - i386-*) platform=pc ;; - x86_64-apple) platform=efi ;; - x86_64-*) platform=pc ;; - powerpc-*) platform=ieee1275 ;; - powerpc64-*) platform=ieee1275 ;; - sparc64-*) platform=ieee1275 ;; - *) { { echo "$as_me:$LINENO: error: unsupported CPU: \"$target_cpu\"" >&5 -echo "$as_me: error: unsupported CPU: \"$target_cpu\"" >&2;} - { (exit 1); exit 1; }; } ;; - esac -else - platform="$with_platform" -fi - -# Adjust CPU unless target was explicitly specified. -if test -z "$target_alias"; then - case "$target_cpu"-"$platform" in - x86_64-efi) ;; - x86_64-*) target_cpu=i386 ;; - powerpc64-ieee1275) target_cpu=powerpc ;; - esac -fi - -# Check if the platform is supported, make final adjustments. -case "$target_cpu"-"$platform" in - i386-efi) ;; - x86_64-efi) ;; - i386-pc) ;; - i386-coreboot) ;; - i386-linuxbios) platform=coreboot ;; - i386-ieee1275) ;; - powerpc-ieee1275) ;; - sparc64-ieee1275) ;; - *) { { echo "$as_me:$LINENO: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&5 -echo "$as_me: error: platform \"$platform\" is not supported for target CPU \"$target_cpu\"" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -case "$target_cpu" in - i386 | powerpc) target_m32=1 ;; - x86_64 | sparc64) target_m64=1 ;; -esac - -case "$host_os" in - mingw32) host_os=cygwin ;; -esac - -# This normalizes the names, and creates a new variable ("host_kernel") -# while at it, since the mapping is not always 1:1 (e.g. different OSes -# using the same kernel type). -case "$host_os" in - gnu*) host_kernel=hurd ;; - linux*) host_kernel=linux ;; - freebsd* | kfreebsd*-gnu) host_kernel=freebsd ;; - cygwin) host_kernel=windows ;; -esac - - - - - - - - -# -# Checks for build programs. -# - -# Although cmp is listed in the GNU Coding Standards as a command which -# can used directly, OpenBSD lacks cmp in the default installation. -for ac_prog in cmp -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CMP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CMP"; then - ac_cv_prog_CMP="$CMP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CMP="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CMP=$ac_cv_prog_CMP -if test -n "$CMP"; then - { echo "$as_me:$LINENO: result: $CMP" >&5 -echo "${ECHO_T}$CMP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CMP" && break -done - -if test "x$CMP" = x; then - { { echo "$as_me:$LINENO: error: cmp is not found" >&5 -echo "$as_me: error: cmp is not found" >&2;} - { (exit 1); exit 1; }; } -fi - -for ac_prog in bison -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_YACC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$YACC"; then - ac_cv_prog_YACC="$YACC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_YACC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -YACC=$ac_cv_prog_YACC -if test -n "$YACC"; then - { echo "$as_me:$LINENO: result: $YACC" >&5 -echo "${ECHO_T}$YACC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$YACC" && break -done - -if test "x$YACC" = x; then - { { echo "$as_me:$LINENO: error: bison is not found" >&5 -echo "$as_me: error: bison is not found" >&2;} - { (exit 1); exit 1; }; } -fi - -for file in /usr/src/unifont.bdf ; do - if test -e $file ; then - UNIFONT_BDF=$file - - break - fi -done - -# Find a good install program. We prefer a C program (faster), -# so one script is as good as another. But avoid the broken or -# incompatible versions: -# SysV /etc/install, /usr/sbin/install -# SunOS /usr/etc/install -# IRIX /sbin/install -# AIX /bin/install -# AmigaOS /C/install, which installs bootblocks on floppy discs -# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag -# AFS /usr/afsws/bin/install, which mishandles nonexistent args -# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" -# OS/2's system install, which has a completely different semantic -# ./install, which can be erroneously created by make from ./install.sh. -{ echo "$as_me:$LINENO: checking for a BSD-compatible install" >&5 -echo $ECHO_N "checking for a BSD-compatible install... $ECHO_C" >&6; } -if test -z "$INSTALL"; then -if test "${ac_cv_path_install+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - # Account for people who put trailing slashes in PATH elements. -case $as_dir/ in - ./ | .// | /cC/* | \ - /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ - ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \ - /usr/ucb/* ) ;; - *) - # OSF1 and SCO ODT 3.0 have their own names for install. - # Don't use installbsd from OSF since it installs stuff as root - # by default. - for ac_prog in ginstall scoinst install; do - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then - if test $ac_prog = install && - grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # AIX install. It has an incompatible calling convention. - : - elif test $ac_prog = install && - grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then - # program-specific install script used by HP pwplus--don't use. - : - else - ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" - break 3 - fi - fi - done - done - ;; -esac -done -IFS=$as_save_IFS - - -fi - if test "${ac_cv_path_install+set}" = set; then - INSTALL=$ac_cv_path_install - else - # As a last resort, use the slow shell script. Don't cache a - # value for INSTALL within a source directory, because that will - # break other packages using the cache if that directory is - # removed, or if the value is a relative name. - INSTALL=$ac_install_sh - fi -fi -{ echo "$as_me:$LINENO: result: $INSTALL" >&5 -echo "${ECHO_T}$INSTALL" >&6; } - -# Use test -z because SunOS4 sh mishandles braces in ${var-val}. -# It thinks the first close brace ends the variable substitution. -test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' - -test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' - -test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - -for ac_prog in gawk mawk nawk awk -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_AWK+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$AWK"; then - ac_cv_prog_AWK="$AWK" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_AWK="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -AWK=$ac_cv_prog_AWK -if test -n "$AWK"; then - { echo "$as_me:$LINENO: result: $AWK" >&5 -echo "${ECHO_T}$AWK" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$AWK" && break -done - -{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5 -echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; } -set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` -if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.make <<\_ACEOF -SHELL = /bin/sh -all: - @echo '@@@%%%=$(MAKE)=@@@%%%' -_ACEOF -# GNU make sometimes prints "make[1]: Entering...", which would confuse us. -case `${MAKE-make} -f conftest.make 2>/dev/null` in - *@@@%%%=?*=@@@%%%*) - eval ac_cv_prog_make_${ac_make}_set=yes;; - *) - eval ac_cv_prog_make_${ac_make}_set=no;; -esac -rm -f conftest.make -fi -if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - SET_MAKE= -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } - SET_MAKE="MAKE=${MAKE-make}" -fi - - -# These are not a "must". -# Extract the first word of "ruby", so it can be a program name with args. -set dummy ruby; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_RUBY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $RUBY in - [\\/]* | ?:[\\/]*) - ac_cv_path_RUBY="$RUBY" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_RUBY="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -RUBY=$ac_cv_path_RUBY -if test -n "$RUBY"; then - { echo "$as_me:$LINENO: result: $RUBY" >&5 -echo "${ECHO_T}$RUBY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -# Extract the first word of "help2man", so it can be a program name with args. -set dummy help2man; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_path_HELP2MAN+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - case $HELP2MAN in - [\\/]* | ?:[\\/]*) - ac_cv_path_HELP2MAN="$HELP2MAN" # Let the user override the test with a path. - ;; - *) - as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_path_HELP2MAN="$as_dir/$ac_word$ac_exec_ext" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - - ;; -esac -fi -HELP2MAN=$ac_cv_path_HELP2MAN -if test -n "$HELP2MAN"; then - { echo "$as_me:$LINENO: result: $HELP2MAN" >&5 -echo "${ECHO_T}$HELP2MAN" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - -# -# Checks for host programs. -# - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. -set dummy ${ac_tool_prefix}gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_CC"; then - ac_ct_CC=$CC - # Extract the first word of "gcc", so it can be a program name with args. -set dummy gcc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="gcc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -else - CC="$ac_cv_prog_CC" -fi - -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. -set dummy ${ac_tool_prefix}cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="${ac_tool_prefix}cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - fi -fi -if test -z "$CC"; then - # Extract the first word of "cc", so it can be a program name with args. -set dummy cc; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else - ac_prog_rejected=no -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then - ac_prog_rejected=yes - continue - fi - ac_cv_prog_CC="cc" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -if test $ac_prog_rejected = yes; then - # We found a bogon in the path, so make sure we never use it. - set dummy $ac_cv_prog_CC - shift - if test $# != 0; then - # We chose a different compiler from the bogus one. - # However, it has the same basename, so the bogon will be chosen - # first if we set CC to just the basename; use the full file name. - shift - ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" - fi -fi -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$CC"; then - if test -n "$ac_tool_prefix"; then - for ac_prog in cl.exe - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$CC"; then - ac_cv_prog_CC="$CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -CC=$ac_cv_prog_CC -if test -n "$CC"; then - { echo "$as_me:$LINENO: result: $CC" >&5 -echo "${ECHO_T}$CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$CC" && break - done -fi -if test -z "$CC"; then - ac_ct_CC=$CC - for ac_prog in cl.exe -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_CC"; then - ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_CC=$ac_cv_prog_ac_ct_CC -if test -n "$ac_ct_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 -echo "${ECHO_T}$ac_ct_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_CC" && break -done - - if test "x$ac_ct_CC" = x; then - CC="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - CC=$ac_ct_CC - fi -fi - -fi - - -test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&5 -echo "$as_me: error: no acceptable C compiler found in \$PATH -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - -# Provide some information about the compiler. -echo "$as_me:$LINENO: checking for C compiler version" >&5 -ac_compiler=`set X $ac_compile; echo $2` -{ (ac_try="$ac_compiler --version >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler --version >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -v >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -v >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } -{ (ac_try="$ac_compiler -V >&5" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compiler -V >&5") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } - -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files a.out a.exe b.out" -# Try to create an executable without -o first, disregard a.out. -# It will help us diagnose broken compilers, and finding out an intuition -# of exeext. -{ echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 -echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; } -ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -# -# List of possible output files, starting from the most likely. -# The algorithm is not robust to junk in `.', hence go to wildcards (a.*) -# only as a last resort. b.out is created by i960 compilers. -ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out' -# -# The IRIX 6 linker writes into existing files which may not be -# executable, retaining their permissions. Remove them first so a -# subsequent execution test works. -ac_rmfiles= -for ac_file in $ac_files -do - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - * ) ac_rmfiles="$ac_rmfiles $ac_file";; - esac -done -rm -f $ac_rmfiles - -if { (ac_try="$ac_link_default" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link_default") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. -# So ignore a value of `no', otherwise this would lead to `EXEEXT = no' -# in a Makefile. We should not override ac_cv_exeext if it was cached, -# so that the user can short-circuit this test for compilers unknown to -# Autoconf. -for ac_file in $ac_files '' -do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) - ;; - [ab].out ) - # We found the default executable, but exeext='' is most - # certainly right. - break;; - *.* ) - if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; - then :; else - ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - fi - # We set ac_cv_exeext here because the later test for it is not - # safe: cross compilers may not add the suffix if given an `-o' - # argument, so we may need to know it at that point already. - # Even if this section looks crufty: it has the advantage of - # actually working. - break;; - * ) - break;; - esac -done -test "$ac_cv_exeext" = no && ac_cv_exeext= - -else - ac_file='' -fi - -{ echo "$as_me:$LINENO: result: $ac_file" >&5 -echo "${ECHO_T}$ac_file" >&6; } -if test -z "$ac_file"; then - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: C compiler cannot create executables -See \`config.log' for more details." >&5 -echo "$as_me: error: C compiler cannot create executables -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } -fi - -ac_exeext=$ac_cv_exeext - -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether the C compiler works" >&5 -echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6; } -# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 -# If not cross compiling, check that we can run a simple program. -if test "$cross_compiling" != yes; then - if { ac_try='./$ac_file' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cross_compiling=no - else - if test "$cross_compiling" = maybe; then - cross_compiling=yes - else - { { echo "$as_me:$LINENO: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot run C compiled programs. -If you meant to cross compile, use \`--host'. -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } - fi - fi -fi -{ echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - -rm -f a.out a.exe conftest$ac_cv_exeext b.out -ac_clean_files=$ac_clean_files_save -# Check that the compiler produces executables we can run. If not, either -# the compiler is broken, or we cross compile. -{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 -echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; } -{ echo "$as_me:$LINENO: result: $cross_compiling" >&5 -echo "${ECHO_T}$cross_compiling" >&6; } - -{ echo "$as_me:$LINENO: checking for suffix of executables" >&5 -echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; } -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - # If both `conftest.exe' and `conftest' are `present' (well, observable) -# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will -# work properly (i.e., refer to `conftest.exe'), while it won't with -# `rm'. -for ac_file in conftest.exe conftest conftest.*; do - test -f "$ac_file" || continue - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; - *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` - break;; - * ) break;; - esac -done -else - { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of executables: cannot compile and link -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest$ac_cv_exeext -{ echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 -echo "${ECHO_T}$ac_cv_exeext" >&6; } - -rm -f conftest.$ac_ext -EXEEXT=$ac_cv_exeext -ac_exeext=$EXEEXT -{ echo "$as_me:$LINENO: checking for suffix of object files" >&5 -echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; } -if test "${ac_cv_objext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.o conftest.obj -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; then - for ac_file in conftest.o conftest.obj conftest.*; do - test -f "$ac_file" || continue; - case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;; - *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` - break;; - esac -done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute suffix of object files: cannot compile -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -rm -f conftest.$ac_cv_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 -echo "${ECHO_T}$ac_cv_objext" >&6; } -OBJEXT=$ac_cv_objext -ac_objext=$OBJEXT -{ echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 -echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6; } -if test "${ac_cv_c_compiler_gnu+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -#ifndef __GNUC__ - choke me -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_compiler_gnu=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_compiler_gnu=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -ac_cv_c_compiler_gnu=$ac_compiler_gnu - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 -echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6; } -GCC=`test $ac_compiler_gnu = yes && echo yes` -ac_test_CFLAGS=${CFLAGS+set} -ac_save_CFLAGS=$CFLAGS -{ echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 -echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_g+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_save_c_werror_flag=$ac_c_werror_flag - ac_c_werror_flag=yes - ac_cv_prog_cc_g=no - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - CFLAGS="" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_c_werror_flag=$ac_save_c_werror_flag - CFLAGS="-g" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_g=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_c_werror_flag=$ac_save_c_werror_flag -fi -{ echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_g" >&6; } -if test "$ac_test_CFLAGS" = set; then - CFLAGS=$ac_save_CFLAGS -elif test $ac_cv_prog_cc_g = yes; then - if test "$GCC" = yes; then - CFLAGS="-g -O2" - else - CFLAGS="-g" - fi -else - if test "$GCC" = yes; then - CFLAGS="-O2" - else - CFLAGS= - fi -fi -{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5 -echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; } -if test "${ac_cv_prog_cc_c89+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_prog_cc_c89=no -ac_save_CC=$CC -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include -/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ -struct buf { int x; }; -FILE * (*rcsopen) (struct buf *, struct stat *, int); -static char *e (p, i) - char **p; - int i; -{ - return p[i]; -} -static char *f (char * (*g) (char **, int), char **p, ...) -{ - char *s; - va_list v; - va_start (v,p); - s = g (p, va_arg (v,int)); - va_end (v); - return s; -} - -/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has - function prototypes and stuff, but not '\xHH' hex character constants. - These don't provoke an error unfortunately, instead are silently treated - as 'x'. The following induces an error, until -std is added to get - proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an - array size at least. It's necessary to write '\x00'==0 to get something - that's true only with -std. */ -int osf4_cc_array ['\x00' == 0 ? 1 : -1]; - -/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters - inside strings and character constants. */ -#define FOO(x) 'x' -int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; - -int test (int i, double x); -struct s1 {int (*f) (int a);}; -struct s2 {int (*f) (double a);}; -int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); -int argc; -char **argv; -int -main () -{ -return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; - ; - return 0; -} -_ACEOF -for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ - -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" -do - CC="$ac_save_CC $ac_arg" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_prog_cc_c89=$ac_arg -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - test "x$ac_cv_prog_cc_c89" != "xno" && break -done -rm -f conftest.$ac_ext -CC=$ac_save_CC - -fi -# AC_CACHE_VAL -case "x$ac_cv_prog_cc_c89" in - x) - { echo "$as_me:$LINENO: result: none needed" >&5 -echo "${ECHO_T}none needed" >&6; } ;; - xno) - { echo "$as_me:$LINENO: result: unsupported" >&5 -echo "${ECHO_T}unsupported" >&6; } ;; - *) - CC="$CC $ac_cv_prog_cc_c89" - { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5 -echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;; -esac - - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - -# Must be GCC. -test "x$GCC" = xyes || { { echo "$as_me:$LINENO: error: GCC is required" >&5 -echo "$as_me: error: GCC is required" >&2;} - { (exit 1); exit 1; }; } - - -cat >>confdefs.h <<\_ACEOF -#define _GNU_SOURCE 1 -_ACEOF - - - -# Check whether --enable-largefile was given. -if test "${enable_largefile+set}" = set; then - enableval=$enable_largefile; -fi - -if test "$enable_largefile" != no; then - - { echo "$as_me:$LINENO: checking for special C compiler options needed for large files" >&5 -echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_largefile_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - ac_save_CC=$CC - while :; do - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - CC="$CC -n32" - rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_largefile_CC=' -n32'; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext - break - done - CC=$ac_save_CC - rm -f conftest.$ac_ext - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_largefile_CC" >&5 -echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6; } - if test "$ac_cv_sys_largefile_CC" != no; then - CC=$CC$ac_cv_sys_largefile_CC - fi - - { echo "$as_me:$LINENO: checking for _FILE_OFFSET_BITS value needed for large files" >&5 -echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_file_offset_bits+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _FILE_OFFSET_BITS 64 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_file_offset_bits=64; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_file_offset_bits=unknown - break -done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_file_offset_bits" >&5 -echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6; } -case $ac_cv_sys_file_offset_bits in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _FILE_OFFSET_BITS $ac_cv_sys_file_offset_bits -_ACEOF -;; -esac -rm -f conftest* - if test $ac_cv_sys_file_offset_bits = unknown; then - { echo "$as_me:$LINENO: checking for _LARGE_FILES value needed for large files" >&5 -echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6; } -if test "${ac_cv_sys_large_files+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=no; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#define _LARGE_FILES 1 -#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply define LARGE_OFF_T to be 9223372036854775807, - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -#define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_sys_large_files=1; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - ac_cv_sys_large_files=unknown - break -done -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sys_large_files" >&5 -echo "${ECHO_T}$ac_cv_sys_large_files" >&6; } -case $ac_cv_sys_large_files in #( - no | unknown) ;; - *) -cat >>confdefs.h <<_ACEOF -#define _LARGE_FILES $ac_cv_sys_large_files -_ACEOF -;; -esac -rm -f conftest* - fi -fi - - -# Identify characteristics of the host architecture. -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu -{ echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 -echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6; } -# On Suns, sometimes $CPP names a directory. -if test -n "$CPP" && test -d "$CPP"; then - CPP= -fi -if test -z "$CPP"; then - if test "${ac_cv_prog_CPP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Double quotes because CPP needs to be expanded - for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" - do - ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - break -fi - - done - ac_cv_prog_CPP=$CPP - -fi - CPP=$ac_cv_prog_CPP -else - ac_cv_prog_CPP=$CPP -fi -{ echo "$as_me:$LINENO: result: $CPP" >&5 -echo "${ECHO_T}$CPP" >&6; } -ac_preproc_ok=false -for ac_c_preproc_warn_flag in '' yes -do - # Use a header file that comes with gcc, so configuring glibc - # with a fresh cross-compiler works. - # Prefer to if __STDC__ is defined, since - # exists even on freestanding compilers. - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. "Syntax error" is here to catch this case. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#ifdef __STDC__ -# include -#else -# include -#endif - Syntax error -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - : -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Broken: fails on valid input. -continue -fi - -rm -f conftest.err conftest.$ac_ext - - # OK, works on sane cases. Now check whether nonexistent headers - # can be detected and how. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - # Broken: success on invalid input. -continue -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # Passes both tests. -ac_preproc_ok=: -break -fi - -rm -f conftest.err conftest.$ac_ext - -done -# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. -rm -f conftest.err conftest.$ac_ext -if $ac_preproc_ok; then - : -else - { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&5 -echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check -See \`config.log' for more details." >&2;} - { (exit 1); exit 1; }; } -fi - -ac_ext=c -ac_cpp='$CPP $CPPFLAGS' -ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' -ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' -ac_compiler_gnu=$ac_cv_c_compiler_gnu - - -{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5 -echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; } -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # Extract the first word of "grep ggrep" to use in msg output -if test -z "$GREP"; then -set dummy grep ggrep; ac_prog_name=$2 -if test "${ac_cv_path_GREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_GREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in grep ggrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue - # Check for GNU ac_path_GREP and select it if it is found. - # Check for GNU $ac_path_GREP -case `"$ac_path_GREP" --version 2>&1` in -*GNU*) - ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'GREP' >> "conftest.nl" - "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_GREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_GREP="$ac_path_GREP" - ac_path_GREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_GREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -GREP="$ac_cv_path_GREP" -if test -z "$GREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_GREP=$GREP -fi - - -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5 -echo "${ECHO_T}$ac_cv_path_GREP" >&6; } - GREP="$ac_cv_path_GREP" - - -{ echo "$as_me:$LINENO: checking for egrep" >&5 -echo $ECHO_N "checking for egrep... $ECHO_C" >&6; } -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 - then ac_cv_path_EGREP="$GREP -E" - else - # Extract the first word of "egrep" to use in msg output -if test -z "$EGREP"; then -set dummy egrep; ac_prog_name=$2 -if test "${ac_cv_path_EGREP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_path_EGREP_found=false -# Loop through the user's path and test for each of PROGNAME-LIST -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_prog in egrep; do - for ac_exec_ext in '' $ac_executable_extensions; do - ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue - # Check for GNU ac_path_EGREP and select it if it is found. - # Check for GNU $ac_path_EGREP -case `"$ac_path_EGREP" --version 2>&1` in -*GNU*) - ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; -*) - ac_count=0 - echo $ECHO_N "0123456789$ECHO_C" >"conftest.in" - while : - do - cat "conftest.in" "conftest.in" >"conftest.tmp" - mv "conftest.tmp" "conftest.in" - cp "conftest.in" "conftest.nl" - echo 'EGREP' >> "conftest.nl" - "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break - diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break - ac_count=`expr $ac_count + 1` - if test $ac_count -gt ${ac_path_EGREP_max-0}; then - # Best one so far, save it but keep looking for a better one - ac_cv_path_EGREP="$ac_path_EGREP" - ac_path_EGREP_max=$ac_count - fi - # 10*(2^10) chars as input seems more than enough - test $ac_count -gt 10 && break - done - rm -f conftest.in conftest.tmp conftest.nl conftest.out;; -esac - - - $ac_path_EGREP_found && break 3 - done -done - -done -IFS=$as_save_IFS - - -fi - -EGREP="$ac_cv_path_EGREP" -if test -z "$EGREP"; then - { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5 -echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;} - { (exit 1); exit 1; }; } -fi - -else - ac_cv_path_EGREP=$EGREP -fi - - - fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5 -echo "${ECHO_T}$ac_cv_path_EGREP" >&6; } - EGREP="$ac_cv_path_EGREP" - - -{ echo "$as_me:$LINENO: checking for ANSI C header files" >&5 -echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6; } -if test "${ac_cv_header_stdc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#include -#include - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_header_stdc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_header_stdc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "memchr" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include - -_ACEOF -if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | - $EGREP "free" >/dev/null 2>&1; then - : -else - ac_cv_header_stdc=no -fi -rm -f conftest* - -fi - -if test $ac_cv_header_stdc = yes; then - # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. - if test "$cross_compiling" = yes; then - : -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include -#if ((' ' & 0x0FF) == 0x020) -# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) -#else -# define ISLOWER(c) \ - (('a' <= (c) && (c) <= 'i') \ - || ('j' <= (c) && (c) <= 'r') \ - || ('s' <= (c) && (c) <= 'z')) -# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) -#endif - -#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) -int -main () -{ - int i; - for (i = 0; i < 256; i++) - if (XOR (islower (i), ISLOWER (i)) - || toupper (i) != TOUPPER (i)) - return 2; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - : -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_header_stdc=no -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi -fi -{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 -echo "${ECHO_T}$ac_cv_header_stdc" >&6; } -if test $ac_cv_header_stdc = yes; then - -cat >>confdefs.h <<\_ACEOF -#define STDC_HEADERS 1 -_ACEOF - -fi - -# On IRIX 5.3, sys/types and inttypes.h are conflicting. - - - - - - - - - -for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ - inttypes.h stdint.h unistd.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - eval "$as_ac_Header=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_Header=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - -{ echo "$as_me:$LINENO: checking whether byte ordering is bigendian" >&5 -echo $ECHO_N "checking whether byte ordering is bigendian... $ECHO_C" >&6; } -if test "${ac_cv_c_bigendian+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - # See if sys/param.h defines the BYTE_ORDER macro. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if ! (defined BYTE_ORDER && defined BIG_ENDIAN && defined LITTLE_ENDIAN \ - && BYTE_ORDER && BIG_ENDIAN && LITTLE_ENDIAN) - bogus endian macros -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - # It does; now see whether it defined to BIG_ENDIAN or not. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include -#include - -int -main () -{ -#if BYTE_ORDER != BIG_ENDIAN - not big endian -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_c_bigendian=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_c_bigendian=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - # It does not; compile a test program. -if test "$cross_compiling" = yes; then - # try to guess the endianness by grepping values into an object file - ac_cv_c_bigendian=unknown - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -short int ascii_mm[] = { 0x4249, 0x4765, 0x6E44, 0x6961, 0x6E53, 0x7953, 0 }; -short int ascii_ii[] = { 0x694C, 0x5454, 0x656C, 0x6E45, 0x6944, 0x6E61, 0 }; -void _ascii () { char *s = (char *) ascii_mm; s = (char *) ascii_ii; } -short int ebcdic_ii[] = { 0x89D3, 0xE3E3, 0x8593, 0x95C5, 0x89C4, 0x9581, 0 }; -short int ebcdic_mm[] = { 0xC2C9, 0xC785, 0x95C4, 0x8981, 0x95E2, 0xA8E2, 0 }; -void _ebcdic () { char *s = (char *) ebcdic_mm; s = (char *) ebcdic_ii; } -int -main () -{ - _ascii (); _ebcdic (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - if grep BIGenDianSyS conftest.$ac_objext >/dev/null ; then - ac_cv_c_bigendian=yes -fi -if grep LiTTleEnDian conftest.$ac_objext >/dev/null ; then - if test "$ac_cv_c_bigendian" = unknown; then - ac_cv_c_bigendian=no - else - # finding both strings is unlikely to happen, but who knows? - ac_cv_c_bigendian=unknown - fi -fi -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -int -main () -{ - - /* Are we little or big endian? From Harbison&Steele. */ - union - { - long int l; - char c[sizeof (long int)]; - } u; - u.l = 1; - return u.c[sizeof (long int) - 1] == 1; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_c_bigendian=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -ac_cv_c_bigendian=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_c_bigendian" >&5 -echo "${ECHO_T}$ac_cv_c_bigendian" >&6; } -case $ac_cv_c_bigendian in - yes) - -cat >>confdefs.h <<\_ACEOF -#define WORDS_BIGENDIAN 1 -_ACEOF - ;; - no) - ;; - *) - { { echo "$as_me:$LINENO: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&5 -echo "$as_me: error: unknown endianness -presetting ac_cv_c_bigendian=no (or yes) will help" >&2;} - { (exit 1); exit 1; }; } ;; -esac - -{ echo "$as_me:$LINENO: checking for void *" >&5 -echo $ECHO_N "checking for void *... $ECHO_C" >&6; } -if test "${ac_cv_type_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef void * ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_void_p=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_void_p=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_void_p" >&5 -echo "${ECHO_T}$ac_cv_type_void_p" >&6; } - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of void *" >&5 -echo $ECHO_N "checking size of void *... $ECHO_C" >&6; } -if test "${ac_cv_sizeof_void_p+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_void_p=$ac_lo;; -'') if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef void * ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%lu\n", i); - } - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_void_p=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_void_p" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (void *) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_void_p=0 - fi -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_void_p" >&5 -echo "${ECHO_T}$ac_cv_sizeof_void_p" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_VOID_P $ac_cv_sizeof_void_p -_ACEOF - - -{ echo "$as_me:$LINENO: checking for long" >&5 -echo $ECHO_N "checking for long... $ECHO_C" >&6; } -if test "${ac_cv_type_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -typedef long ac__type_new_; -int -main () -{ -if ((ac__type_new_ *) 0) - return 0; -if (sizeof (ac__type_new_)) - return 0; - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_cv_type_long=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_type_long=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_type_long" >&5 -echo "${ECHO_T}$ac_cv_type_long" >&6; } - -# The cast to long int works around a bug in the HP C Compiler -# version HP92453-01 B.11.11.23709.GP, which incorrectly rejects -# declarations like `int a3[[(sizeof (unsigned char)) >= 0]];'. -# This bug is HP SR number 8606223364. -{ echo "$as_me:$LINENO: checking size of long" >&5 -echo $ECHO_N "checking size of long... $ECHO_C" >&6; } -if test "${ac_cv_sizeof_long+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - # Depending upon the size, compute the lo and hi bounds. -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=0 ac_mid=0 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr $ac_mid + 1` - if test $ac_lo -le $ac_mid; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) < 0)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=-1 ac_mid=-1 - while :; do - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) >= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_lo=$ac_mid; break -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_hi=`expr '(' $ac_mid ')' - 1` - if test $ac_mid -le $ac_hi; then - ac_lo= ac_hi= - break - fi - ac_mid=`expr 2 '*' $ac_mid` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - done -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo= ac_hi= -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -# Binary search between lo and hi bounds. -while test "x$ac_lo" != "x$ac_hi"; do - ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -int -main () -{ -static int test_array [1 - 2 * !(((long int) (sizeof (ac__type_sizeof_))) <= $ac_mid)]; -test_array [0] = 0 - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_hi=$ac_mid -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_lo=`expr '(' $ac_mid ')' + 1` -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -done -case $ac_lo in -?*) ac_cv_sizeof_long=$ac_lo;; -'') if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi ;; -esac -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default - typedef long ac__type_sizeof_; -static long int longval () { return (long int) (sizeof (ac__type_sizeof_)); } -static unsigned long int ulongval () { return (long int) (sizeof (ac__type_sizeof_)); } -#include -#include -int -main () -{ - - FILE *f = fopen ("conftest.val", "w"); - if (! f) - return 1; - if (((long int) (sizeof (ac__type_sizeof_))) < 0) - { - long int i = longval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%ld\n", i); - } - else - { - unsigned long int i = ulongval (); - if (i != ((long int) (sizeof (ac__type_sizeof_)))) - return 1; - fprintf (f, "%lu\n", i); - } - return ferror (f) || fclose (f) != 0; - - ; - return 0; -} -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - ac_cv_sizeof_long=`cat conftest.val` -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -if test "$ac_cv_type_long" = yes; then - { { echo "$as_me:$LINENO: error: cannot compute sizeof (long) -See \`config.log' for more details." >&5 -echo "$as_me: error: cannot compute sizeof (long) -See \`config.log' for more details." >&2;} - { (exit 77); exit 77; }; } - else - ac_cv_sizeof_long=0 - fi -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi -rm -f conftest.val -fi -{ echo "$as_me:$LINENO: result: $ac_cv_sizeof_long" >&5 -echo "${ECHO_T}$ac_cv_sizeof_long" >&6; } - - - -cat >>confdefs.h <<_ACEOF -#define SIZEOF_LONG $ac_cv_sizeof_long -_ACEOF - - - -if test "x$host_m32" = x1; then - # Force 32-bit mode. - CFLAGS="$CFLAGS -m32" - LDFLAGS="$LDFLAGS -m32" -fi - -# Check LZO when compiling for the i386-pc. -if test "$target_cpu"-"$platform" = i386-pc; then - # Check whether --enable-lzo was given. -if test "${enable_lzo+set}" = set; then - enableval=$enable_lzo; -fi - - if [ x"$enable_lzo" = xyes ]; then - # There are three possibilities. LZO version 2 installed with the name - # liblzo2, with the name liblzo, and LZO version 1. - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_LZO 1 -_ACEOF - - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo2" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo2... $ECHO_C" >&6; } -if test "${ac_cv_lib_lzo2___lzo_init_v2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llzo2 $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char __lzo_init_v2 (); -int -main () -{ -return __lzo_init_v2 (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_lzo2___lzo_init_v2=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_lzo2___lzo_init_v2=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo2___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo2___lzo_init_v2" >&6; } -if test $ac_cv_lib_lzo2___lzo_init_v2 = yes; then - LIBLZO="-llzo2" -else - { echo "$as_me:$LINENO: checking for __lzo_init_v2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init_v2 in -llzo... $ECHO_C" >&6; } -if test "${ac_cv_lib_lzo___lzo_init_v2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llzo $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char __lzo_init_v2 (); -int -main () -{ -return __lzo_init_v2 (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_lzo___lzo_init_v2=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_lzo___lzo_init_v2=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init_v2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init_v2" >&6; } -if test $ac_cv_lib_lzo___lzo_init_v2 = yes; then - LIBLZO="-llzo" -else - { echo "$as_me:$LINENO: checking for __lzo_init2 in -llzo" >&5 -echo $ECHO_N "checking for __lzo_init2 in -llzo... $ECHO_C" >&6; } -if test "${ac_cv_lib_lzo___lzo_init2+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-llzo $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char __lzo_init2 (); -int -main () -{ -return __lzo_init2 (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_lzo___lzo_init2=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_lzo___lzo_init2=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_lzo___lzo_init2" >&5 -echo "${ECHO_T}$ac_cv_lib_lzo___lzo_init2" >&6; } -if test $ac_cv_lib_lzo___lzo_init2 = yes; then - LIBLZO="-llzo" -else - { { echo "$as_me:$LINENO: error: LZO library version 1.02 or later is required" >&5 -echo "$as_me: error: LZO library version 1.02 or later is required" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - -fi - - - LIBS="$LIBS $LIBLZO" - { echo "$as_me:$LINENO: checking for lzo1x_999_compress" >&5 -echo $ECHO_N "checking for lzo1x_999_compress... $ECHO_C" >&6; } -if test "${ac_cv_func_lzo1x_999_compress+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define lzo1x_999_compress to an innocuous variant, in case declares lzo1x_999_compress. - For example, HP-UX 11i declares gettimeofday. */ -#define lzo1x_999_compress innocuous_lzo1x_999_compress - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char lzo1x_999_compress (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef lzo1x_999_compress - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char lzo1x_999_compress (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_lzo1x_999_compress || defined __stub___lzo1x_999_compress -choke me -#endif - -int -main () -{ -return lzo1x_999_compress (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_func_lzo1x_999_compress=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_func_lzo1x_999_compress=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -{ echo "$as_me:$LINENO: result: $ac_cv_func_lzo1x_999_compress" >&5 -echo "${ECHO_T}$ac_cv_func_lzo1x_999_compress" >&6; } -if test $ac_cv_func_lzo1x_999_compress = yes; then - : -else - { { echo "$as_me:$LINENO: error: LZO1X-999 must be enabled" >&5 -echo "$as_me: error: LZO1X-999 must be enabled" >&2;} - { (exit 1); exit 1; }; } -fi - - - # LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h. - - -for ac_header in lzo/lzo1x.h lzo1x.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to bug-grub@gnu.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -fi - -done - - else - -cat >>confdefs.h <<\_ACEOF -#define ENABLE_LZMA 1 -_ACEOF - - fi - -fi - -# Check for functions. - - - -for ac_func in posix_memalign memalign asprintf -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# -# Check for target programs. -# - - -# Use linker script if present, otherwise use builtin -N script. -{ echo "$as_me:$LINENO: checking for option to link raw image" >&5 -echo $ECHO_N "checking for option to link raw image... $ECHO_C" >&6; } -if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then - TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" - TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" - TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" -else - TARGET_IMG_LDSCRIPT= - TARGET_IMG_LDFLAGS='-Wl,-N' - TARGET_IMG_LDFLAGS_AC='-Wl,-N' -fi - - -{ echo "$as_me:$LINENO: result: $TARGET_IMG_LDFLAGS_AC" >&5 -echo "${ECHO_T}$TARGET_IMG_LDFLAGS_AC" >&6; } - -# For platforms where ELF is not the default link format. -{ echo "$as_me:$LINENO: checking for command to convert module to ELF format" >&5 -echo $ECHO_N "checking for command to convert module to ELF format... $ECHO_C" >&6; } -case "${host_os}" in - cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; - *) ;; -esac - -{ echo "$as_me:$LINENO: result: $TARGET_OBJ2ELF" >&5 -echo "${ECHO_T}$TARGET_OBJ2ELF" >&6; } - -# Find tools for the target. -if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then - tmp_ac_tool_prefix="$ac_tool_prefix" - ac_tool_prefix=$target_alias- - - if test -n "$ac_tool_prefix"; then - for ac_prog in gcc egcs cc - do - # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. -set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_TARGET_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$TARGET_CC"; then - ac_cv_prog_TARGET_CC="$TARGET_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_TARGET_CC="$ac_tool_prefix$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -TARGET_CC=$ac_cv_prog_TARGET_CC -if test -n "$TARGET_CC"; then - { echo "$as_me:$LINENO: result: $TARGET_CC" >&5 -echo "${ECHO_T}$TARGET_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$TARGET_CC" && break - done -fi -if test -z "$TARGET_CC"; then - ac_ct_TARGET_CC=$TARGET_CC - for ac_prog in gcc egcs cc -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_TARGET_CC+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_TARGET_CC"; then - ac_cv_prog_ac_ct_TARGET_CC="$ac_ct_TARGET_CC" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_TARGET_CC="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_TARGET_CC=$ac_cv_prog_ac_ct_TARGET_CC -if test -n "$ac_ct_TARGET_CC"; then - { echo "$as_me:$LINENO: result: $ac_ct_TARGET_CC" >&5 -echo "${ECHO_T}$ac_ct_TARGET_CC" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$ac_ct_TARGET_CC" && break -done - - if test "x$ac_ct_TARGET_CC" = x; then - TARGET_CC="{ { echo "$as_me:$LINENO: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&5 -echo "$as_me: error: none of gcc, egcs and cc is found. set TARGET_CC manually." >&2;} - { (exit 1); exit 1; }; }" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - TARGET_CC=$ac_ct_TARGET_CC - fi -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. -set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - # Extract the first word of "objcopy", so it can be a program name with args. -set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJCOPY="objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -else - OBJCOPY="$ac_cv_prog_OBJCOPY" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. -set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NM="${ac_tool_prefix}nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NM"; then - ac_ct_NM=$NM - # Extract the first word of "nm", so it can be a program name with args. -set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NM="nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -else - NM="$ac_cv_prog_NM" -fi - - - ac_tool_prefix="$tmp_ac_tool_prefix" -else - if test "x$TARGET_CC" = x; then - TARGET_CC=$CC - fi - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}objcopy", so it can be a program name with args. -set dummy ${ac_tool_prefix}objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$OBJCOPY"; then - ac_cv_prog_OBJCOPY="$OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_OBJCOPY="${ac_tool_prefix}objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -OBJCOPY=$ac_cv_prog_OBJCOPY -if test -n "$OBJCOPY"; then - { echo "$as_me:$LINENO: result: $OBJCOPY" >&5 -echo "${ECHO_T}$OBJCOPY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_OBJCOPY"; then - ac_ct_OBJCOPY=$OBJCOPY - # Extract the first word of "objcopy", so it can be a program name with args. -set dummy objcopy; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_OBJCOPY+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_OBJCOPY"; then - ac_cv_prog_ac_ct_OBJCOPY="$ac_ct_OBJCOPY" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_OBJCOPY="objcopy" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_OBJCOPY=$ac_cv_prog_ac_ct_OBJCOPY -if test -n "$ac_ct_OBJCOPY"; then - { echo "$as_me:$LINENO: result: $ac_ct_OBJCOPY" >&5 -echo "${ECHO_T}$ac_ct_OBJCOPY" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_OBJCOPY" = x; then - OBJCOPY="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - OBJCOPY=$ac_ct_OBJCOPY - fi -else - OBJCOPY="$ac_cv_prog_OBJCOPY" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. -set dummy ${ac_tool_prefix}strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$STRIP"; then - ac_cv_prog_STRIP="$STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_STRIP="${ac_tool_prefix}strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -STRIP=$ac_cv_prog_STRIP -if test -n "$STRIP"; then - { echo "$as_me:$LINENO: result: $STRIP" >&5 -echo "${ECHO_T}$STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_STRIP"; then - ac_ct_STRIP=$STRIP - # Extract the first word of "strip", so it can be a program name with args. -set dummy strip; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_STRIP+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_STRIP"; then - ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_STRIP="strip" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP -if test -n "$ac_ct_STRIP"; then - { echo "$as_me:$LINENO: result: $ac_ct_STRIP" >&5 -echo "${ECHO_T}$ac_ct_STRIP" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_STRIP" = x; then - STRIP="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - STRIP=$ac_ct_STRIP - fi -else - STRIP="$ac_cv_prog_STRIP" -fi - - if test -n "$ac_tool_prefix"; then - # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. -set dummy ${ac_tool_prefix}nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$NM"; then - ac_cv_prog_NM="$NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_NM="${ac_tool_prefix}nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -NM=$ac_cv_prog_NM -if test -n "$NM"; then - { echo "$as_me:$LINENO: result: $NM" >&5 -echo "${ECHO_T}$NM" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - -fi -if test -z "$ac_cv_prog_NM"; then - ac_ct_NM=$NM - # Extract the first word of "nm", so it can be a program name with args. -set dummy nm; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_ac_ct_NM+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$ac_ct_NM"; then - ac_cv_prog_ac_ct_NM="$ac_ct_NM" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_ac_ct_NM="nm" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -ac_ct_NM=$ac_cv_prog_ac_ct_NM -if test -n "$ac_ct_NM"; then - { echo "$as_me:$LINENO: result: $ac_ct_NM" >&5 -echo "${ECHO_T}$ac_ct_NM" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - if test "x$ac_ct_NM" = x; then - NM="" - else - case $cross_compiling:$ac_tool_warned in -yes:) -{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&5 -echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools -whose name does not start with the host triplet. If you think this -configuration is useful to you, please write to autoconf@gnu.org." >&2;} -ac_tool_warned=yes ;; -esac - NM=$ac_ct_NM - fi -else - NM="$ac_cv_prog_NM" -fi - -fi - - - -# Test the C compiler for the target environment. -tmp_CC="$CC" -tmp_CFLAGS="$CFLAGS" -tmp_LDFLAGS="$LDFLAGS" -tmp_CPPFLAGS="$CPPFLAGS" -tmp_LIBS="$LIBS" -CC="$TARGET_CC" -CFLAGS="$TARGET_CFLAGS" -CPPFLAGS="$TARGET_CPPFLAGS" -LDFLAGS="$TARGET_LDFLAGS" -LIBS="" - -if test "x$TARGET_CFLAGS" = x; then - # debug flags. - TARGET_CFLAGS="-Wall -W -Wshadow -Wpointer-arith -Wmissing-prototypes \ - -Wundef -Wstrict-prototypes -g" - - # optimization flags. - { echo "$as_me:$LINENO: checking whether optimization for size works" >&5 -echo $ECHO_N "checking whether optimization for size works... $ECHO_C" >&6; } -if test "${grub_cv_cc_Os+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - CFLAGS=-Os - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - grub_cv_cc_Os=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_cc_Os=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_Os" >&5 -echo "${ECHO_T}$grub_cv_cc_Os" >&6; } - if test "x$grub_cv_cc_Os" = xyes; then - TARGET_CFLAGS="$TARGET_CFLAGS -Os" - else - TARGET_CFLAGS="$TARGET_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops" - fi - - # Force no alignment to save space on i386. - if test "x$target_cpu" = xi386; then - { echo "$as_me:$LINENO: checking whether -falign-loops works" >&5 -echo $ECHO_N "checking whether -falign-loops works... $ECHO_C" >&6; } -if test "${grub_cv_cc_falign_loop+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - CFLAGS="-falign-loops=1" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - grub_cv_cc_falign_loop=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_cc_falign_loop=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_falign_loop" >&5 -echo "${ECHO_T}$grub_cv_cc_falign_loop" >&6; } - - if test "x$grub_cv_cc_falign_loop" = xyes; then - TARGET_CFLAGS="$TARGET_CFLAGS -falign-jumps=1 -falign-loops=1 -falign-functions=1" - else - TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" - fi - fi -fi - -if test "x$target_m32" = x1; then - # Force 32-bit mode. - TARGET_CFLAGS="$TARGET_CFLAGS -m32" - TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" -fi - -if test "x$target_m64" = x1; then - # Force 64-bit mode. - TARGET_CFLAGS="$TARGET_CFLAGS -m64" - TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" -fi - -if test "$target_cpu"-"$platform" = x86_64-efi; then - # Use large model to support 4G memory - { echo "$as_me:$LINENO: checking whether option -mcmodel=large works" >&5 -echo $ECHO_N "checking whether option -mcmodel=large works... $ECHO_C" >&6; } -if test "${grub_cv_cc_mcmodel+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - CFLAGS="-m64 -mcmodel=large" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - grub_cv_cc_mcmodel=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_cc_mcmodel=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_mcmodel" >&5 -echo "${ECHO_T}$grub_cv_cc_mcmodel" >&6; } - if test "x$grub_cv_cc_no_mcmodel" = xno; then - { { echo "$as_me:$LINENO: error: -mcmodel=large not supported, upgrade your gcc" >&5 -echo "$as_me: error: -mcmodel=large not supported, upgrade your gcc" >&2;} - { (exit 1); exit 1; }; } - fi - - # EFI writes to stack below %rsp, we must not use the red zone - { echo "$as_me:$LINENO: checking whether option -mno-red-zone works" >&5 -echo $ECHO_N "checking whether option -mno-red-zone works... $ECHO_C" >&6; } -if test "${grub_cv_cc_no_red_zone+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - CFLAGS="-m64 -mno-red-zone" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - grub_cv_cc_no_red_zone=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_cc_no_red_zone=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext - -fi -{ echo "$as_me:$LINENO: result: $grub_cv_cc_no_red_zone" >&5 -echo "${ECHO_T}$grub_cv_cc_no_red_zone" >&6; } - if test "x$grub_cv_cc_no_red_zone" = xno; then - { { echo "$as_me:$LINENO: error: -mno-red-zone not supported, upgrade your gcc" >&5 -echo "$as_me: error: -mno-red-zone not supported, upgrade your gcc" >&2;} - { (exit 1); exit 1; }; } - fi - - TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large -mno-red-zone" -fi - -# -# Compiler features. -# - -# Need __enable_execute_stack() for nested function trampolines? - -{ echo "$as_me:$LINENO: checking whether \`$CC' generates calls to \`__enable_execute_stack()'" >&5 -echo $ECHO_N "checking whether \`$CC' generates calls to \`__enable_execute_stack()'... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF - -void f (int (*p) (void)); -void g (int i) -{ - int nestedfunc (void) { return i; } - f (nestedfunc); -} - -_ACEOF -if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && test -s conftest.s; then - true -else - { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} - { (exit 1); exit 1; }; } -fi -if grep __enable_execute_stack conftest.s >/dev/null 2>&1; then - -cat >>confdefs.h <<\_ACEOF -#define NEED_ENABLE_EXECUTE_STACK 1 -_ACEOF - - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -f conftest* - - -# Smashing stack protector. - -# Smashing stack protector. -ssp_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-fstack-protector'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-fstack-protector'... $ECHO_C" >&6; } -# Is this a reliable test case? -cat >conftest.$ac_ext <<_ACEOF -void foo (void) { volatile char a[8]; a[3]; } -_ACEOF -# `$CC -c -o ...' might not be portable. But, oh, well... Is calling -# `ac_compile' like this correct, after all? -if eval "$ac_compile -S -fstack-protector -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? - rm -f conftest.s -else - ssp_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - -# Need that, because some distributions ship compilers that include -# `-fstack-protector' in the default specs. -if test "x$ssp_possible" = xyes; then - TARGET_CFLAGS="$TARGET_CFLAGS -fno-stack-protector" -fi - -# Smashing stack arg probe. -sap_possible=yes -{ echo "$as_me:$LINENO: checking whether \`$CC' accepts \`-mstack-arg-probe'" >&5 -echo $ECHO_N "checking whether \`$CC' accepts \`-mstack-arg-probe'... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -void foo (void) { volatile char a[8]; a[3]; } -_ACEOF -if eval "$ac_compile -S -mstack-arg-probe -o conftest.s" 2> /dev/null; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - # Should we clear up other files as well, having called `AC_LANG_CONFTEST'? - rm -f conftest.s -else - sap_possible=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - -# Cygwin's GCC uses alloca() to probe the stackframe on static -# stack allocations above some threshold. -if test x"$sap_possible" = xyes; then - TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" -fi - - - - - -# Set them to their new values for the tests below. -CC="$TARGET_CC" -CFLAGS="$TARGET_CFLAGS" -CPPFLAGS="$TARGET_CPPFLAGS" -LDFLAGS="$TARGET_LDFLAGS" - -# Check for target functions. - - -for ac_func in __bswapsi2 __bswapdi2 -do -as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -{ echo "$as_me:$LINENO: checking for $ac_func" >&5 -echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; } -if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -/* Define $ac_func to an innocuous variant, in case declares $ac_func. - For example, HP-UX 11i declares gettimeofday. */ -#define $ac_func innocuous_$ac_func - -/* System header to define __stub macros and hopefully few prototypes, - which can conflict with char $ac_func (); below. - Prefer to if __STDC__ is defined, since - exists even on freestanding compilers. */ - -#ifdef __STDC__ -# include -#else -# include -#endif - -#undef $ac_func - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char $ac_func (); -/* The GNU C library defines this for functions which it implements - to always fail with ENOSYS. Some functions are actually named - something starting with __ and the normal name is an alias. */ -#if defined __stub_$ac_func || defined __stub___$ac_func -choke me -#endif - -int -main () -{ -return $ac_func (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - eval "$as_ac_var=yes" -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - eval "$as_ac_var=no" -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi -ac_res=`eval echo '${'$as_ac_var'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -if test `eval echo '${'$as_ac_var'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 -_ACEOF - -fi -done - - -# Defined in aclocal.m4. -{ echo "$as_me:$LINENO: checking whether target compiler is working" >&5 -echo $ECHO_N "checking whether target compiler is working... $ECHO_C" >&6; } -if test "${grub_cv_prog_target_cc+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_prog_target_cc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_prog_target_cc=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - -fi - -{ echo "$as_me:$LINENO: result: $grub_cv_prog_target_cc" >&5 -echo "${ECHO_T}$grub_cv_prog_target_cc" >&6; } - -if test "x$grub_cv_prog_target_cc" = xno; then - { { echo "$as_me:$LINENO: error: cannot compile for the target" >&5 -echo "$as_me: error: cannot compile for the target" >&2;} - { (exit 1); exit 1; }; } -fi - -{ echo "$as_me:$LINENO: checking whether ${OBJCOPY} works for absolute addresses" >&5 -echo $ECHO_N "checking whether ${OBJCOPY} works for absolute addresses... $ECHO_C" >&6; } -if test "${grub_cv_prog_objcopy_absolute+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.c <<\EOF -void -cmain (void) -{ - *((int *) 0x1000) = 2; -} -EOF - -if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && test -s conftest.o; then : -else - { { echo "$as_me:$LINENO: error: ${CC-cc} cannot compile C source code" >&5 -echo "$as_me: error: ${CC-cc} cannot compile C source code" >&2;} - { (exit 1); exit 1; }; } -fi -grub_cv_prog_objcopy_absolute=yes -for link_addr in 2000 8000 7C00; do - if { ac_try='${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then : - else - { { echo "$as_me:$LINENO: error: ${CC-cc} cannot link at address $link_addr" >&5 -echo "$as_me: error: ${CC-cc} cannot link at address $link_addr" >&2;} - { (exit 1); exit 1; }; } - fi - if { ac_try='${OBJCOPY-objcopy} --only-section=.text -O binary conftest.exec conftest' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then : - else - { { echo "$as_me:$LINENO: error: ${OBJCOPY-objcopy} cannot create binary files" >&5 -echo "$as_me: error: ${OBJCOPY-objcopy} cannot create binary files" >&2;} - { (exit 1); exit 1; }; } - fi - if test ! -f conftest.old || { ac_try='cmp -s conftest.old conftest' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - mv -f conftest conftest.old - else - grub_cv_prog_objcopy_absolute=no - break - fi -done -rm -f conftest* -fi - -{ echo "$as_me:$LINENO: result: $grub_cv_prog_objcopy_absolute" >&5 -echo "${ECHO_T}$grub_cv_prog_objcopy_absolute" >&6; } - -if test "x$grub_cv_prog_objcopy_absolute" = xno; then - { { echo "$as_me:$LINENO: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&5 -echo "$as_me: error: GRUB requires a working absolute objcopy; upgrade your binutils" >&2;} - { (exit 1); exit 1; }; } -fi - -{ echo "$as_me:$LINENO: checking whether linker accepts --build-id=none" >&5 -echo $ECHO_N "checking whether linker accepts --build-id=none... $ECHO_C" >&6; } -if test "${grub_cv_prog_ld_build_id_none+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - save_LDFLAGS="$LDFLAGS" -LDFLAGS="$LDFLAGS -Wl,--build-id=none" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_prog_ld_build_id_none=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_prog_ld_build_id_none=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LDFLAGS="$save_LDFLAGS" - -fi - -{ echo "$as_me:$LINENO: result: $grub_cv_prog_ld_build_id_none" >&5 -echo "${ECHO_T}$grub_cv_prog_ld_build_id_none" >&6; } - -if test "x$grub_cv_prog_ld_build_id_none" = xyes; then - TARGET_LDFLAGS="$TARGET_LDFLAGS -Wl,--build-id=none" -fi - - -{ echo "$as_me:$LINENO: checking if C symbols get an underscore after compilation" >&5 -echo $ECHO_N "checking if C symbols get an underscore after compilation... $ECHO_C" >&6; } -if test "${grub_cv_asm_uscore+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.c <<\EOF -int -func (int *list) -{ - *list = 0; - return *list; -} -EOF - -if { ac_try='${CC-cc} ${CFLAGS} -S conftest.c' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && test -s conftest.s; then - true -else - { { echo "$as_me:$LINENO: error: ${CC-cc} failed to produce assembly code" >&5 -echo "$as_me: error: ${CC-cc} failed to produce assembly code" >&2;} - { (exit 1); exit 1; }; } -fi - -if grep _func conftest.s >/dev/null 2>&1; then - grub_cv_asm_uscore=yes -else - grub_cv_asm_uscore=no -fi - -rm -f conftest* -fi - - -if test "x$grub_cv_asm_uscore" = xyes; then - -cat >>confdefs.h <<_ACEOF -#define HAVE_ASM_USCORE $grub_cv_asm_uscore -_ACEOF - -fi - -{ echo "$as_me:$LINENO: result: $grub_cv_asm_uscore" >&5 -echo "${ECHO_T}$grub_cv_asm_uscore" >&6; } - -if test "x$target_cpu" = xi386; then - if test ! -z "$TARGET_IMG_LDSCRIPT"; then - # Check symbols provided by linker script. - CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" - fi - if test "x$platform" = xpc; then - -{ echo "$as_me:$LINENO: checking if __bss_start is defined by the compiler" >&5 -echo $ECHO_N "checking if __bss_start is defined by the compiler... $ECHO_C" >&6; } -if test "${grub_cv_check_uscore_uscore_bss_start_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -asm ("incl __bss_start") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_check_uscore_uscore_bss_start_symbol=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_check_uscore_uscore_bss_start_symbol=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_uscore_bss_start_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_uscore_bss_start_symbol" >&6; } - -{ echo "$as_me:$LINENO: checking if edata is defined by the compiler" >&5 -echo $ECHO_N "checking if edata is defined by the compiler... $ECHO_C" >&6; } -if test "${grub_cv_check_edata_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -asm ("incl edata") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_check_edata_symbol=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_check_edata_symbol=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_check_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_edata_symbol" >&6; } - -{ echo "$as_me:$LINENO: checking if _edata is defined by the compiler" >&5 -echo $ECHO_N "checking if _edata is defined by the compiler... $ECHO_C" >&6; } -if test "${grub_cv_check_uscore_edata_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -asm ("incl _edata") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_check_uscore_edata_symbol=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_check_uscore_edata_symbol=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_edata_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_edata_symbol" >&6; } - - - - -if test "x$grub_cv_check_uscore_uscore_bss_start_symbol" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define BSS_START_SYMBOL __bss_start -_ACEOF - -elif test "x$grub_cv_check_edata_symbol" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define BSS_START_SYMBOL edata -_ACEOF - -elif test "x$grub_cv_check_uscore_edata_symbol" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define BSS_START_SYMBOL _edata -_ACEOF - -else - { { echo "$as_me:$LINENO: error: none of __bss_start, edata or _edata is defined" >&5 -echo "$as_me: error: none of __bss_start, edata or _edata is defined" >&2;} - { (exit 1); exit 1; }; } -fi - - -{ echo "$as_me:$LINENO: checking if end is defined by the compiler" >&5 -echo $ECHO_N "checking if end is defined by the compiler... $ECHO_C" >&6; } -if test "${grub_cv_check_end_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -asm ("incl end") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_check_end_symbol=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_check_end_symbol=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_check_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_end_symbol" >&6; } - -{ echo "$as_me:$LINENO: checking if _end is defined by the compiler" >&5 -echo $ECHO_N "checking if _end is defined by the compiler... $ECHO_C" >&6; } -if test "${grub_cv_check_uscore_end_symbol+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -int -main () -{ -asm ("incl _end") - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - grub_cv_check_uscore_end_symbol=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - grub_cv_check_uscore_end_symbol=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_check_uscore_end_symbol" >&5 -echo "${ECHO_T}$grub_cv_check_uscore_end_symbol" >&6; } - - - - -if test "x$grub_cv_check_end_symbol" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define END_SYMBOL end -_ACEOF - -elif test "x$grub_cv_check_uscore_end_symbol" = xyes; then - cat >>confdefs.h <<\_ACEOF -#define END_SYMBOL _end -_ACEOF - -else - { { echo "$as_me:$LINENO: error: neither end nor _end is defined" >&5 -echo "$as_me: error: neither end nor _end is defined" >&2;} - { (exit 1); exit 1; }; } -fi - - fi - CFLAGS="$TARGET_CFLAGS" - -{ echo "$as_me:$LINENO: checking whether addr32 must be in the same line as the instruction" >&5 -echo $ECHO_N "checking whether addr32 must be in the same line as the instruction... $ECHO_C" >&6; } -if test "${grub_cv_i386_asm_prefix_requirement+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.s <<\EOF - .code16 -l1: addr32 movb %al, l1 -EOF - -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && test -s conftest.o; then - grub_cv_i386_asm_prefix_requirement=yes -else - grub_cv_i386_asm_prefix_requirement=no -fi - -rm -f conftest* -fi - - -if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then - grub_tmp_addr32="addr32" - grub_tmp_data32="data32" -else - grub_tmp_addr32="addr32;" - grub_tmp_data32="data32;" -fi - - -cat >>confdefs.h <<_ACEOF -#define ADDR32 $grub_tmp_addr32 -_ACEOF - - -cat >>confdefs.h <<_ACEOF -#define DATA32 $grub_tmp_data32 -_ACEOF - - -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_prefix_requirement" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_prefix_requirement" >&6; } - - -{ echo "$as_me:$LINENO: checking for .code16 addr32 assembler support" >&5 -echo $ECHO_N "checking for .code16 addr32 assembler support... $ECHO_C" >&6; } -if test "${grub_cv_i386_asm_addr32+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.s.in <<\EOF - .code16 -l1: @ADDR32@ movb %al, l1 -EOF - -if test "x$grub_cv_i386_asm_prefix_requirement" = xyes; then - sed -e s/@ADDR32@/addr32/ < conftest.s.in > conftest.s -else - sed -e s/@ADDR32@/addr32\;/ < conftest.s.in > conftest.s -fi - -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && test -s conftest.o; then - grub_cv_i386_asm_addr32=yes -else - grub_cv_i386_asm_addr32=no -fi - -rm -f conftest* -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_addr32" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_addr32" >&6; } - -{ echo "$as_me:$LINENO: checking whether an absolute indirect call/jump must not be prefixed with an asterisk" >&5 -echo $ECHO_N "checking whether an absolute indirect call/jump must not be prefixed with an asterisk... $ECHO_C" >&6; } -if test "${grub_cv_i386_asm_absolute_without_asterisk+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - cat > conftest.s <<\EOF - lcall *(offset) -offset: - .long 0 - .word 0 -EOF - -if { ac_try='${CC-cc} ${CFLAGS} -c conftest.s' - { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; } && test -s conftest.o; then - grub_cv_i386_asm_absolute_without_asterisk=no -else - grub_cv_i386_asm_absolute_without_asterisk=yes -fi - -rm -f conftest* -fi - - -if test "x$grub_cv_i386_asm_absolute_without_asterisk" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define ABSOLUTE_WITHOUT_ASTERISK 1 -_ACEOF - -fi - -{ echo "$as_me:$LINENO: result: $grub_cv_i386_asm_absolute_without_asterisk" >&5 -echo "${ECHO_T}$grub_cv_i386_asm_absolute_without_asterisk" >&6; } - -{ echo "$as_me:$LINENO: checking if GCC has the regparm=3 bug" >&5 -echo $ECHO_N "checking if GCC has the regparm=3 bug... $ECHO_C" >&6; } -if test "${grub_cv_i386_check_nested_functions+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test "$cross_compiling" = yes; then - grub_cv_i386_check_nested_functions=yes -else - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -static int -test (int *n) -{ - return *n == -1; -} - -static int -testfunc (int __attribute__ ((__regparm__ (3))) (*hook) (int a, int b, int *c)) -{ - int a = 0; - int b = 0; - int c = -1; - return hook (a, b, &c); -} - -int -main (void) -{ - int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int *c) - { - return a == b && test (c); - } - return testfunc (nestedfunc) ? 0 : 1; -} - -_ACEOF -rm -f conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_try") 2>&5 - ac_status=$? - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - grub_cv_i386_check_nested_functions=no -else - echo "$as_me: program exited with status $ac_status" >&5 -echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - -( exit $ac_status ) -grub_cv_i386_check_nested_functions=yes -fi -rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext -fi - - -fi - - -{ echo "$as_me:$LINENO: result: $grub_cv_i386_check_nested_functions" >&5 -echo "${ECHO_T}$grub_cv_i386_check_nested_functions" >&6; } - -if test "x$grub_cv_i386_check_nested_functions" = xyes; then - -cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1))) -_ACEOF - -else - -cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1))) -_ACEOF - -fi - -else - -cat >>confdefs.h <<\_ACEOF -#define NESTED_FUNC_ATTR -_ACEOF - -fi - -# Restore the flags. -CC="$tmp_CC" -CFLAGS="$tmp_CFLAGS" -CPPFLAGS="$tmp_CPPFLAGS" -LDFLAGS="$tmp_LDFLAGS" -LIBS="$tmp_LIBS" - -# -# Check for options. -# - -# Memory manager debugging. -# Check whether --enable-mm-debug was given. -if test "${enable_mm_debug+set}" = set; then - enableval=$enable_mm_debug; -cat >>confdefs.h <<\_ACEOF -#define MM_DEBUG 1 -_ACEOF - -fi - - -# Check whether --enable-grub-emu was given. -if test "${enable_grub_emu+set}" = set; then - enableval=$enable_grub_emu; -fi - -# Check whether --enable-grub-emu-usb was given. -if test "${enable_grub_emu_usb+set}" = set; then - enableval=$enable_grub_emu_usb; -fi - -if [ x"$enable_grub_emu" = xyes ]; then - # Check for curses libraries. - { echo "$as_me:$LINENO: checking for wgetch in -lncurses" >&5 -echo $ECHO_N "checking for wgetch in -lncurses... $ECHO_C" >&6; } -if test "${ac_cv_lib_ncurses_wgetch+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lncurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char wgetch (); -int -main () -{ -return wgetch (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_ncurses_wgetch=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_ncurses_wgetch=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_ncurses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_ncurses_wgetch" >&6; } -if test $ac_cv_lib_ncurses_wgetch = yes; then - LIBCURSES="-lncurses" -else - { echo "$as_me:$LINENO: checking for wgetch in -lcurses" >&5 -echo $ECHO_N "checking for wgetch in -lcurses... $ECHO_C" >&6; } -if test "${ac_cv_lib_curses_wgetch+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lcurses $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char wgetch (); -int -main () -{ -return wgetch (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_curses_wgetch=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_curses_wgetch=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_curses_wgetch" >&5 -echo "${ECHO_T}$ac_cv_lib_curses_wgetch" >&6; } -if test $ac_cv_lib_curses_wgetch = yes; then - LIBCURSES="-lcurses" -else - { { echo "$as_me:$LINENO: error: (n)curses libraries are required to build \`grub-emu'" >&5 -echo "$as_me: error: (n)curses libraries are required to build \`grub-emu'" >&2;} - { (exit 1); exit 1; }; } -fi - -fi - - - - # Check for headers. - -for ac_header in ncurses/curses.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to bug-grub@gnu.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - -for ac_header in ncurses.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to bug-grub@gnu.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - -for ac_header in curses.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to bug-grub@gnu.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - { { echo "$as_me:$LINENO: error: (n)curses header files are required to build \`grub-emu'" >&5 -echo "$as_me: error: (n)curses header files are required to build \`grub-emu'" >&2;} - { (exit 1); exit 1; }; } -fi - -done - -fi - -done - -fi - -done - - - if [ x"$enable_grub_emu_usb" = xyes ]; then - # Check for libusb libraries. - { echo "$as_me:$LINENO: checking for usb_claim_interface in -lusb" >&5 -echo $ECHO_N "checking for usb_claim_interface in -lusb... $ECHO_C" >&6; } -if test "${ac_cv_lib_usb_usb_claim_interface+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lusb $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char usb_claim_interface (); -int -main () -{ -return usb_claim_interface (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_usb_usb_claim_interface=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_usb_usb_claim_interface=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_usb_usb_claim_interface" >&5 -echo "${ECHO_T}$ac_cv_lib_usb_usb_claim_interface" >&6; } -if test $ac_cv_lib_usb_usb_claim_interface = yes; then - LIBUSB="-lusb" -else - { { echo "$as_me:$LINENO: error: libusb libraries are required to build \`grub-emu' with USB support" >&5 -echo "$as_me: error: libusb libraries are required to build \`grub-emu' with USB support" >&2;} - { (exit 1); exit 1; }; } -fi - - - - # Check for headers. - -for ac_header in usb.h -do -as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - { echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } -else - # Is the header compilable? -{ echo "$as_me:$LINENO: checking $ac_header usability" >&5 -echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -$ac_includes_default -#include <$ac_header> -_ACEOF -rm -f conftest.$ac_objext -if { (ac_try="$ac_compile" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_compile") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest.$ac_objext; then - ac_header_compiler=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_compiler=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 -echo "${ECHO_T}$ac_header_compiler" >&6; } - -# Is the header present? -{ echo "$as_me:$LINENO: checking $ac_header presence" >&5 -echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; } -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ -#include <$ac_header> -_ACEOF -if { (ac_try="$ac_cpp conftest.$ac_ext" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } >/dev/null && { - test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || - test ! -s conftest.err - }; then - ac_header_preproc=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_header_preproc=no -fi - -rm -f conftest.err conftest.$ac_ext -{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 -echo "${ECHO_T}$ac_header_preproc" >&6; } - -# So? What about this header? -case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in - yes:no: ) - { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 -echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} - ac_header_preproc=yes - ;; - no:yes:* ) - { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 -echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 -echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 -echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 -echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 -echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} - { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 -echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} - ( cat <<\_ASBOX -## ------------------------------- ## -## Report this to bug-grub@gnu.org ## -## ------------------------------- ## -_ASBOX - ) | sed "s/^/$as_me: WARNING: /" >&2 - ;; -esac -{ echo "$as_me:$LINENO: checking for $ac_header" >&5 -echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; } -if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - eval "$as_ac_Header=\$ac_header_preproc" -fi -ac_res=`eval echo '${'$as_ac_Header'}'` - { echo "$as_me:$LINENO: result: $ac_res" >&5 -echo "${ECHO_T}$ac_res" >&6; } - -fi -if test `eval echo '${'$as_ac_Header'}'` = yes; then - cat >>confdefs.h <<_ACEOF -#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 -_ACEOF - -else - { { echo "$as_me:$LINENO: error: libusb header file is required to build \`grub-emu' with USB support" >&5 -echo "$as_me: error: libusb header file is required to build \`grub-emu' with USB support" >&2;} - { (exit 1); exit 1; }; } -fi - -done - - fi -fi - - - -# Check whether --enable-grub-fstest was given. -if test "${enable_grub_fstest+set}" = set; then - enableval=$enable_grub_fstest; -fi - - - -# Check whether --enable-grub-pe2elf was given. -if test "${enable_grub_pe2elf+set}" = set; then - enableval=$enable_grub_pe2elf; -fi - - - -# Check whether --enable-grub-mkfont was given. -if test "${enable_grub_mkfont+set}" = set; then - enableval=$enable_grub_mkfont; -fi - -if test x"$enable_grub_mkfont" = xyes ; then - # Check for freetype libraries. - for ac_prog in freetype-config -do - # Extract the first word of "$ac_prog", so it can be a program name with args. -set dummy $ac_prog; ac_word=$2 -{ echo "$as_me:$LINENO: checking for $ac_word" >&5 -echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6; } -if test "${ac_cv_prog_FREETYPE+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - if test -n "$FREETYPE"; then - ac_cv_prog_FREETYPE="$FREETYPE" # Let the user override the test. -else -as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then - ac_cv_prog_FREETYPE="$ac_prog" - echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 - break 2 - fi -done -done -IFS=$as_save_IFS - -fi -fi -FREETYPE=$ac_cv_prog_FREETYPE -if test -n "$FREETYPE"; then - { echo "$as_me:$LINENO: result: $FREETYPE" >&5 -echo "${ECHO_T}$FREETYPE" >&6; } -else - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi - - - test -n "$FREETYPE" && break -done - - if test "x$FREETYPE" = x ; then - { { echo "$as_me:$LINENO: error: freetype2 libraries are required to build \`grub-mkfont'" >&5 -echo "$as_me: error: freetype2 libraries are required to build \`grub-mkfont'" >&2;} - { (exit 1); exit 1; }; } - fi - freetype_cflags=`freetype-config --cflags` - freetype_libs=`freetype-config --libs` -fi - - - - -# Output files. - -{ echo "$as_me:$LINENO: checking whether ln can handle directories properly" >&5 -echo $ECHO_N "checking whether ln can handle directories properly... $ECHO_C" >&6; } -mkdir testdir 2>/dev/null -case $srcdir in -[\\/$]* | ?:[\\/]* ) reldir=$srcdir/include/grub/util ;; - *) reldir=../$srcdir/include/grub/util ;; -esac -if ln -s $reldir testdir/util 2>/dev/null ; then - { echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6; } - link_dir=yes -else - link_dir=no - { echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6; } -fi -rm -rf testdir - -if test x"$link_dir" = xyes ; then - ac_config_links="$ac_config_links include/grub/cpu:include/grub/$target_cpu include/grub/machine:include/grub/$target_cpu/$platform" - -else - mkdir -p include/grub 2>/dev/null - rm -rf include/grub/cpu - cp -rp $srcdir/include/grub/$target_cpu include/grub/cpu 2>/dev/null - rm -rf include/grub/machine - cp -rp $srcdir/include/grub/$target_cpu/$platform include/grub/machine 2>/dev/null -fi -ac_config_files="$ac_config_files Makefile gensymlist.sh genkernsyms.sh" - -ac_config_files="$ac_config_files stamp-h" - -cat >confcache <<\_ACEOF -# This file is a shell script that caches the results of configure -# tests run on this system so they can be shared between configure -# scripts and configure runs, see configure's option --config-cache. -# It is not useful on other systems. If it contains results you don't -# want to keep, you may remove or edit it. -# -# config.status only pays attention to the cache file if you give it -# the --recheck option to rerun configure. -# -# `ac_cv_env_foo' variables (set or unset) will be overridden when -# loading this file, other *unset* `ac_cv_foo' will be assigned the -# following values. - -_ACEOF - -# The following way of writing the cache mishandles newlines in values, -# but we know of no workaround that is simple, portable, and efficient. -# So, we kill variables containing newlines. -# Ultrix sh set writes to stderr and can't be redirected directly, -# and sets the high bit in the cache file unless we assign to the vars. -( - for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do - eval ac_val=\$$ac_var - case $ac_val in #( - *${as_nl}*) - case $ac_var in #( - *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5 -echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;; - esac - case $ac_var in #( - _ | IFS | as_nl) ;; #( - *) $as_unset $ac_var ;; - esac ;; - esac - done - - (set) 2>&1 | - case $as_nl`(ac_space=' '; set) 2>&1` in #( - *${as_nl}ac_space=\ *) - # `set' does not quote correctly, so add quotes (double-quote - # substitution turns \\\\ into \\, and sed turns \\ into \). - sed -n \ - "s/'/'\\\\''/g; - s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" - ;; #( - *) - # `set' quotes correctly as required by POSIX, so do not add quotes. - sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" - ;; - esac | - sort -) | - sed ' - /^ac_cv_env_/b end - t clear - :clear - s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ - t end - s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ - :end' >>confcache -if diff "$cache_file" confcache >/dev/null 2>&1; then :; else - if test -w "$cache_file"; then - test "x$cache_file" != "x/dev/null" && - { echo "$as_me:$LINENO: updating cache $cache_file" >&5 -echo "$as_me: updating cache $cache_file" >&6;} - cat confcache >$cache_file - else - { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5 -echo "$as_me: not updating unwritable cache $cache_file" >&6;} - fi -fi -rm -f confcache - -test "x$prefix" = xNONE && prefix=$ac_default_prefix -# Let make expand exec_prefix. -test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' - -DEFS=-DHAVE_CONFIG_H - -ac_libobjs= -ac_ltlibobjs= -for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue - # 1. Remove the extension, and $U if already installed. - ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' - ac_i=`echo "$ac_i" | sed "$ac_script"` - # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR - # will be set to the directory where LIBOBJS objects are built. - ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext" - ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo' -done -LIBOBJS=$ac_libobjs - -LTLIBOBJS=$ac_ltlibobjs - - - -: ${CONFIG_STATUS=./config.status} -ac_clean_files_save=$ac_clean_files -ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 -echo "$as_me: creating $CONFIG_STATUS" >&6;} -cat >$CONFIG_STATUS <<_ACEOF -#! $SHELL -# Generated by $as_me. -# Run this file to recreate the current configuration. -# Compiler output produced by configure, useful for debugging -# configure, is in config.log if it exists. - -debug=false -ac_cs_recheck=false -ac_cs_silent=false -SHELL=\${CONFIG_SHELL-$SHELL} -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -## --------------------- ## -## M4sh Initialization. ## -## --------------------- ## - -# Be more Bourne compatible -DUALCASE=1; export DUALCASE # for MKS sh -if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then - emulate sh - NULLCMD=: - # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which - # is contrary to our usage. Disable this feature. - alias -g '${1+"$@"}'='"$@"' - setopt NO_GLOB_SUBST -else - case `(set -o) 2>/dev/null` in - *posix*) set -o posix ;; -esac - -fi - - - - -# PATH needs CR -# Avoid depending upon Character Ranges. -as_cr_letters='abcdefghijklmnopqrstuvwxyz' -as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' -as_cr_Letters=$as_cr_letters$as_cr_LETTERS -as_cr_digits='0123456789' -as_cr_alnum=$as_cr_Letters$as_cr_digits - -# The user is always right. -if test "${PATH_SEPARATOR+set}" != set; then - echo "#! /bin/sh" >conf$$.sh - echo "exit 0" >>conf$$.sh - chmod +x conf$$.sh - if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then - PATH_SEPARATOR=';' - else - PATH_SEPARATOR=: - fi - rm -f conf$$.sh -fi - -# Support unset when possible. -if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then - as_unset=unset -else - as_unset=false -fi - - -# IFS -# We need space, tab and new line, in precisely that order. Quoting is -# there to prevent editors from complaining about space-tab. -# (If _AS_PATH_WALK were called with IFS unset, it would disable word -# splitting by setting IFS to empty value.) -as_nl=' -' -IFS=" "" $as_nl" - -# Find who we are. Look in the path if we contain no directory separator. -case $0 in - *[\\/]* ) as_myself=$0 ;; - *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR -for as_dir in $PATH -do - IFS=$as_save_IFS - test -z "$as_dir" && as_dir=. - test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break -done -IFS=$as_save_IFS - - ;; -esac -# We did not find ourselves, most probably we were run as `sh COMMAND' -# in which case we are not to be found in the path. -if test "x$as_myself" = x; then - as_myself=$0 -fi -if test ! -f "$as_myself"; then - echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 - { (exit 1); exit 1; } -fi - -# Work around bugs in pre-3.0 UWIN ksh. -for as_var in ENV MAIL MAILPATH -do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var -done -PS1='$ ' -PS2='> ' -PS4='+ ' - -# NLS nuisances. -for as_var in \ - LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ - LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ - LC_TELEPHONE LC_TIME -do - if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then - eval $as_var=C; export $as_var - else - ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var - fi -done - -# Required to use basename. -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then - as_basename=basename -else - as_basename=false -fi - - -# Name of the executable. -as_me=`$as_basename -- "$0" || -$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ - X"$0" : 'X\(//\)$' \| \ - X"$0" : 'X\(/\)' \| . 2>/dev/null || -echo X/"$0" | - sed '/^.*\/\([^/][^/]*\)\/*$/{ - s//\1/ - q - } - /^X\/\(\/\/\)$/{ - s//\1/ - q - } - /^X\/\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - -# CDPATH. -$as_unset CDPATH - - - - as_lineno_1=$LINENO - as_lineno_2=$LINENO - test "x$as_lineno_1" != "x$as_lineno_2" && - test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || { - - # Create $as_me.lineno as a copy of $as_myself, but with $LINENO - # uniformly replaced by the line number. The first 'sed' inserts a - # line-number line after each line using $LINENO; the second 'sed' - # does the real work. The second script uses 'N' to pair each - # line-number line with the line containing $LINENO, and appends - # trailing '-' during substitution so that $LINENO is not a special - # case at line end. - # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the - # scripts with optimization help from Paolo Bonzini. Blame Lee - # E. McMahon (1931-1989) for sed's syntax. :-) - sed -n ' - p - /[$]LINENO/= - ' <$as_myself | - sed ' - s/[$]LINENO.*/&-/ - t lineno - b - :lineno - N - :loop - s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ - t loop - s/-\n.*// - ' >$as_me.lineno && - chmod +x "$as_me.lineno" || - { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 - { (exit 1); exit 1; }; } - - # Don't try to exec as it changes $[0], causing all sort of problems - # (the dirname of $[0] is not the place where we might find the - # original and so on. Autoconf is especially sensitive to this). - . "./$as_me.lineno" - # Exit status is that of the last command. - exit -} - - -if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then - as_dirname=dirname -else - as_dirname=false -fi - -ECHO_C= ECHO_N= ECHO_T= -case `echo -n x` in --n*) - case `echo 'x\c'` in - *c*) ECHO_T=' ';; # ECHO_T is single tab character. - *) ECHO_C='\c';; - esac;; -*) - ECHO_N='-n';; -esac - -if expr a : '\(a\)' >/dev/null 2>&1 && - test "X`expr 00001 : '.*\(...\)'`" = X001; then - as_expr=expr -else - as_expr=false -fi - -rm -f conf$$ conf$$.exe conf$$.file -if test -d conf$$.dir; then - rm -f conf$$.dir/conf$$.file -else - rm -f conf$$.dir - mkdir conf$$.dir -fi -echo >conf$$.file -if ln -s conf$$.file conf$$ 2>/dev/null; then - as_ln_s='ln -s' - # ... but there are two gotchas: - # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. - # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. - ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' -elif ln conf$$.file conf$$ 2>/dev/null; then - as_ln_s=ln -else - as_ln_s='cp -p' -fi -rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file -rmdir conf$$.dir 2>/dev/null - -if mkdir -p . 2>/dev/null; then - as_mkdir_p=: -else - test -d ./-p && rmdir ./-p - as_mkdir_p=false -fi - -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x - -# Sed expression to map a string onto a valid CPP name. -as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" - -# Sed expression to map a string onto a valid variable name. -as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" - - -exec 6>&1 - -# Save the log message, to keep $[0] and so on meaningful, and to -# report actual input values of CONFIG_FILES etc. instead of their -# values after options handling. -ac_log=" -This file was extended by GRUB $as_me 1.96, which was -generated by GNU Autoconf 2.61. Invocation command line was - - CONFIG_FILES = $CONFIG_FILES - CONFIG_HEADERS = $CONFIG_HEADERS - CONFIG_LINKS = $CONFIG_LINKS - CONFIG_COMMANDS = $CONFIG_COMMANDS - $ $0 $@ - -on `(hostname || uname -n) 2>/dev/null | sed 1q` -" - -_ACEOF - -cat >>$CONFIG_STATUS <<_ACEOF -# Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" -config_links="$ac_config_links" - -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -ac_cs_usage="\ -\`$as_me' instantiates files from templates according to the -current configuration. - -Usage: $0 [OPTIONS] [FILE]... - - -h, --help print this help, then exit - -V, --version print version number and configuration settings, then exit - -q, --quiet do not print progress messages - -d, --debug don't remove temporary files - --recheck update $as_me by reconfiguring in the same conditions - --file=FILE[:TEMPLATE] - instantiate the configuration file FILE - --header=FILE[:TEMPLATE] - instantiate the configuration header FILE - -Configuration files: -$config_files - -Configuration headers: -$config_headers - -Configuration links: -$config_links - -Report bugs to ." - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -ac_cs_version="\\ -GRUB config.status 1.96 -configured by $0, generated by GNU Autoconf 2.61, - with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\" - -Copyright (C) 2006 Free Software Foundation, Inc. -This config.status script is free software; the Free Software Foundation -gives unlimited permission to copy, distribute and modify it." - -ac_pwd='$ac_pwd' -srcdir='$srcdir' -INSTALL='$INSTALL' -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If no file are specified by the user, then we need to provide default -# value. By we need to know if files were specified by the user. -ac_need_defaults=: -while test $# != 0 -do - case $1 in - --*=*) - ac_option=`expr "X$1" : 'X\([^=]*\)='` - ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` - ac_shift=: - ;; - *) - ac_option=$1 - ac_optarg=$2 - ac_shift=shift - ;; - esac - - case $ac_option in - # Handling of the options. - -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) - ac_cs_recheck=: ;; - --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) - echo "$ac_cs_version"; exit ;; - --debug | --debu | --deb | --de | --d | -d ) - debug=: ;; - --file | --fil | --fi | --f ) - $ac_shift - CONFIG_FILES="$CONFIG_FILES $ac_optarg" - ac_need_defaults=false;; - --header | --heade | --head | --hea ) - $ac_shift - CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" - ac_need_defaults=false;; - --he | --h) - # Conflict between --help and --header - { echo "$as_me: error: ambiguous option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; };; - --help | --hel | -h ) - echo "$ac_cs_usage"; exit ;; - -q | -quiet | --quiet | --quie | --qui | --qu | --q \ - | -silent | --silent | --silen | --sile | --sil | --si | --s) - ac_cs_silent=: ;; - - # This is an error. - -*) { echo "$as_me: error: unrecognized option: $1 -Try \`$0 --help' for more information." >&2 - { (exit 1); exit 1; }; } ;; - - *) ac_config_targets="$ac_config_targets $1" - ac_need_defaults=false ;; - - esac - shift -done - -ac_configure_extra_args= - -if $ac_cs_silent; then - exec 6>/dev/null - ac_configure_extra_args="$ac_configure_extra_args --silent" -fi - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -if \$ac_cs_recheck; then - echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 - CONFIG_SHELL=$SHELL - export CONFIG_SHELL - exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion -fi - -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -exec 5>>config.log -{ - echo - sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX -## Running $as_me. ## -_ASBOX - echo "$ac_log" -} >&5 - -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF - -# Handling of arguments. -for ac_config_target in $ac_config_targets -do - case $ac_config_target in - "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; - "include/grub/cpu") CONFIG_LINKS="$CONFIG_LINKS include/grub/cpu:include/grub/$target_cpu" ;; - "include/grub/machine") CONFIG_LINKS="$CONFIG_LINKS include/grub/machine:include/grub/$target_cpu/$platform" ;; - "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; - "gensymlist.sh") CONFIG_FILES="$CONFIG_FILES gensymlist.sh" ;; - "genkernsyms.sh") CONFIG_FILES="$CONFIG_FILES genkernsyms.sh" ;; - "stamp-h") CONFIG_FILES="$CONFIG_FILES stamp-h" ;; - - *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 -echo "$as_me: error: invalid argument: $ac_config_target" >&2;} - { (exit 1); exit 1; }; };; - esac -done - - -# If the user did not use the arguments to specify the items to instantiate, -# then the envvar interface is used. Set only those that are not. -# We use the long form for the default assignment because of an extremely -# bizarre bug on SunOS 4.1.3. -if $ac_need_defaults; then - test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files - test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers - test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links -fi - -# Have a temporary directory for convenience. Make it in the build tree -# simply because there is no reason against having it here, and in addition, -# creating and moving files from /tmp can sometimes cause problems. -# Hook for its removal unless debugging. -# Note that there is a small window in which the directory will not be cleaned: -# after its creation but before its name has been assigned to `$tmp'. -$debug || -{ - tmp= - trap 'exit_status=$? - { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status -' 0 - trap '{ (exit 1); exit 1; }' 1 2 13 15 -} -# Create a (secure) tmp directory for tmp files. - -{ - tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && - test -n "$tmp" && test -d "$tmp" -} || -{ - tmp=./conf$$-$RANDOM - (umask 077 && mkdir "$tmp") -} || -{ - echo "$me: cannot create a temporary directory in ." >&2 - { (exit 1); exit 1; } -} - -# -# Set up the sed scripts for CONFIG_FILES section. -# - -# No need to generate the scripts if there are no CONFIG_FILES. -# This happens for instance when ./config.status config.h -if test -n "$CONFIG_FILES"; then - -_ACEOF - - - -ac_delim='%!_!# ' -for ac_last_try in false false false false false :; do - cat >conf$$subs.sed <<_ACEOF -SHELL!$SHELL$ac_delim -PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim -PACKAGE_NAME!$PACKAGE_NAME$ac_delim -PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim -PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim -PACKAGE_STRING!$PACKAGE_STRING$ac_delim -PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim -exec_prefix!$exec_prefix$ac_delim -prefix!$prefix$ac_delim -program_transform_name!$program_transform_name$ac_delim -bindir!$bindir$ac_delim -sbindir!$sbindir$ac_delim -libexecdir!$libexecdir$ac_delim -datarootdir!$datarootdir$ac_delim -datadir!$datadir$ac_delim -sysconfdir!$sysconfdir$ac_delim -sharedstatedir!$sharedstatedir$ac_delim -localstatedir!$localstatedir$ac_delim -includedir!$includedir$ac_delim -oldincludedir!$oldincludedir$ac_delim -docdir!$docdir$ac_delim -infodir!$infodir$ac_delim -htmldir!$htmldir$ac_delim -dvidir!$dvidir$ac_delim -pdfdir!$pdfdir$ac_delim -psdir!$psdir$ac_delim -libdir!$libdir$ac_delim -localedir!$localedir$ac_delim -mandir!$mandir$ac_delim -DEFS!$DEFS$ac_delim -ECHO_C!$ECHO_C$ac_delim -ECHO_N!$ECHO_N$ac_delim -ECHO_T!$ECHO_T$ac_delim -LIBS!$LIBS$ac_delim -build_alias!$build_alias$ac_delim -host_alias!$host_alias$ac_delim -target_alias!$target_alias$ac_delim -build!$build$ac_delim -build_cpu!$build_cpu$ac_delim -build_vendor!$build_vendor$ac_delim -build_os!$build_os$ac_delim -host!$host$ac_delim -host_cpu!$host_cpu$ac_delim -host_vendor!$host_vendor$ac_delim -host_os!$host_os$ac_delim -target!$target$ac_delim -target_cpu!$target_cpu$ac_delim -target_vendor!$target_vendor$ac_delim -target_os!$target_os$ac_delim -host_kernel!$host_kernel$ac_delim -platform!$platform$ac_delim -CMP!$CMP$ac_delim -YACC!$YACC$ac_delim -UNIFONT_BDF!$UNIFONT_BDF$ac_delim -INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim -INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim -INSTALL_DATA!$INSTALL_DATA$ac_delim -AWK!$AWK$ac_delim -SET_MAKE!$SET_MAKE$ac_delim -RUBY!$RUBY$ac_delim -HELP2MAN!$HELP2MAN$ac_delim -CC!$CC$ac_delim -CFLAGS!$CFLAGS$ac_delim -LDFLAGS!$LDFLAGS$ac_delim -CPPFLAGS!$CPPFLAGS$ac_delim -ac_ct_CC!$ac_ct_CC$ac_delim -EXEEXT!$EXEEXT$ac_delim -OBJEXT!$OBJEXT$ac_delim -CPP!$CPP$ac_delim -GREP!$GREP$ac_delim -EGREP!$EGREP$ac_delim -LIBLZO!$LIBLZO$ac_delim -enable_lzo!$enable_lzo$ac_delim -TARGET_IMG_LDSCRIPT!$TARGET_IMG_LDSCRIPT$ac_delim -TARGET_IMG_LDFLAGS!$TARGET_IMG_LDFLAGS$ac_delim -TARGET_OBJ2ELF!$TARGET_OBJ2ELF$ac_delim -TARGET_CC!$TARGET_CC$ac_delim -ac_ct_TARGET_CC!$ac_ct_TARGET_CC$ac_delim -OBJCOPY!$OBJCOPY$ac_delim -STRIP!$STRIP$ac_delim -NM!$NM$ac_delim -TARGET_CFLAGS!$TARGET_CFLAGS$ac_delim -TARGET_CPPFLAGS!$TARGET_CPPFLAGS$ac_delim -TARGET_LDFLAGS!$TARGET_LDFLAGS$ac_delim -LIBCURSES!$LIBCURSES$ac_delim -LIBUSB!$LIBUSB$ac_delim -enable_grub_emu!$enable_grub_emu$ac_delim -enable_grub_emu_usb!$enable_grub_emu_usb$ac_delim -enable_grub_fstest!$enable_grub_fstest$ac_delim -enable_grub_pe2elf!$enable_grub_pe2elf$ac_delim -FREETYPE!$FREETYPE$ac_delim -enable_grub_mkfont!$enable_grub_mkfont$ac_delim -freetype_cflags!$freetype_cflags$ac_delim -freetype_libs!$freetype_libs$ac_delim -LIBOBJS!$LIBOBJS$ac_delim -LTLIBOBJS!$LTLIBOBJS$ac_delim -_ACEOF - - if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 96; then - break - elif $ac_last_try; then - { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5 -echo "$as_me: error: could not make $CONFIG_STATUS" >&2;} - { (exit 1); exit 1; }; } - else - ac_delim="$ac_delim!$ac_delim _$ac_delim!! " - fi -done - -ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed` -if test -n "$ac_eof"; then - ac_eof=`echo "$ac_eof" | sort -nru | sed 1q` - ac_eof=`expr $ac_eof + 1` -fi - -cat >>$CONFIG_STATUS <<_ACEOF -cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -_ACEOF -sed ' -s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g -s/^/s,@/; s/!/@,|#_!!_#|/ -:n -t n -s/'"$ac_delim"'$/,g/; t -s/$/\\/; p -N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n -' >>$CONFIG_STATUS >$CONFIG_STATUS <<_ACEOF -CEOF$ac_eof -_ACEOF - - -# VPATH may cause trouble with some makes, so we remove $(srcdir), -# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and -# trailing colons and then remove the whole line if VPATH becomes empty -# (actually we leave an empty line to preserve line numbers). -if test "x$srcdir" = x.; then - ac_vpsub='/^[ ]*VPATH[ ]*=/{ -s/:*\$(srcdir):*/:/ -s/:*\${srcdir}:*/:/ -s/:*@srcdir@:*/:/ -s/^\([^=]*=[ ]*\):*/\1/ -s/:*$// -s/^[^=]*=[ ]*$// -}' -fi - -cat >>$CONFIG_STATUS <<\_ACEOF -fi # test -n "$CONFIG_FILES" - - -for ac_tag in :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS -do - case $ac_tag in - :[FHLC]) ac_mode=$ac_tag; continue;; - esac - case $ac_mode$ac_tag in - :[FHL]*:*);; - :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5 -echo "$as_me: error: Invalid tag $ac_tag." >&2;} - { (exit 1); exit 1; }; };; - :[FH]-) ac_tag=-:-;; - :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; - esac - ac_save_IFS=$IFS - IFS=: - set x $ac_tag - IFS=$ac_save_IFS - shift - ac_file=$1 - shift - - case $ac_mode in - :L) ac_source=$1;; - :[FH]) - ac_file_inputs= - for ac_f - do - case $ac_f in - -) ac_f="$tmp/stdin";; - *) # Look for the file first in the build tree, then in the source tree - # (if the path is not absolute). The absolute path cannot be DOS-style, - # because $ac_f cannot contain `:'. - test -f "$ac_f" || - case $ac_f in - [\\/$]*) false;; - *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; - esac || - { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5 -echo "$as_me: error: cannot find input file: $ac_f" >&2;} - { (exit 1); exit 1; }; };; - esac - ac_file_inputs="$ac_file_inputs $ac_f" - done - - # Let's still pretend it is `configure' which instantiates (i.e., don't - # use $as_me), people would be surprised to read: - # /* config.h. Generated by config.status. */ - configure_input="Generated from "`IFS=: - echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure." - if test x"$ac_file" != x-; then - configure_input="$ac_file. $configure_input" - { echo "$as_me:$LINENO: creating $ac_file" >&5 -echo "$as_me: creating $ac_file" >&6;} - fi - - case $ac_tag in - *:-:* | *:-) cat >"$tmp/stdin";; - esac - ;; - esac - - ac_dir=`$as_dirname -- "$ac_file" || -$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$ac_file" : 'X\(//\)[^/]' \| \ - X"$ac_file" : 'X\(//\)$' \| \ - X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || -echo X"$ac_file" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - { as_dir="$ac_dir" - case $as_dir in #( - -*) as_dir=./$as_dir;; - esac - test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || { - as_dirs= - while :; do - case $as_dir in #( - *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #( - *) as_qdir=$as_dir;; - esac - as_dirs="'$as_qdir' $as_dirs" - as_dir=`$as_dirname -- "$as_dir" || -$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ - X"$as_dir" : 'X\(//\)[^/]' \| \ - X"$as_dir" : 'X\(//\)$' \| \ - X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || -echo X"$as_dir" | - sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ - s//\1/ - q - } - /^X\(\/\/\)[^/].*/{ - s//\1/ - q - } - /^X\(\/\/\)$/{ - s//\1/ - q - } - /^X\(\/\).*/{ - s//\1/ - q - } - s/.*/./; q'` - test -d "$as_dir" && break - done - test -z "$as_dirs" || eval "mkdir $as_dirs" - } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5 -echo "$as_me: error: cannot create directory $as_dir" >&2;} - { (exit 1); exit 1; }; }; } - ac_builddir=. - -case "$ac_dir" in -.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; -*) - ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` - # A ".." for each directory in $ac_dir_suffix. - ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'` - case $ac_top_builddir_sub in - "") ac_top_builddir_sub=. ac_top_build_prefix= ;; - *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; - esac ;; -esac -ac_abs_top_builddir=$ac_pwd -ac_abs_builddir=$ac_pwd$ac_dir_suffix -# for backward compatibility: -ac_top_builddir=$ac_top_build_prefix - -case $srcdir in - .) # We are building in place. - ac_srcdir=. - ac_top_srcdir=$ac_top_builddir_sub - ac_abs_top_srcdir=$ac_pwd ;; - [\\/]* | ?:[\\/]* ) # Absolute name. - ac_srcdir=$srcdir$ac_dir_suffix; - ac_top_srcdir=$srcdir - ac_abs_top_srcdir=$srcdir ;; - *) # Relative name. - ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix - ac_top_srcdir=$ac_top_build_prefix$srcdir - ac_abs_top_srcdir=$ac_pwd/$srcdir ;; -esac -ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix - - - case $ac_mode in - :F) - # - # CONFIG_FILE - # - - case $INSTALL in - [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; - *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; - esac -_ACEOF - -cat >>$CONFIG_STATUS <<\_ACEOF -# If the template does not know about datarootdir, expand it. -# FIXME: This hack should be removed a few years after 2.60. -ac_datarootdir_hack=; ac_datarootdir_seen= - -case `sed -n '/datarootdir/ { - p - q -} -/@datadir@/p -/@docdir@/p -/@infodir@/p -/@localedir@/p -/@mandir@/p -' $ac_file_inputs` in -*datarootdir*) ac_datarootdir_seen=yes;; -*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) - { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 -echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} -_ACEOF -cat >>$CONFIG_STATUS <<_ACEOF - ac_datarootdir_hack=' - s&@datadir@&$datadir&g - s&@docdir@&$docdir&g - s&@infodir@&$infodir&g - s&@localedir@&$localedir&g - s&@mandir@&$mandir&g - s&\\\${datarootdir}&$datarootdir&g' ;; -esac -_ACEOF - -# Neutralize VPATH when `$srcdir' = `.'. -# Shell code in configure.ac might set extrasub. -# FIXME: do we really want to maintain this feature? -cat >>$CONFIG_STATUS <<_ACEOF - sed "$ac_vpsub -$extrasub -_ACEOF -cat >>$CONFIG_STATUS <<\_ACEOF -:t -/@[a-zA-Z_][a-zA-Z_0-9]*@/!b -s&@configure_input@&$configure_input&;t t -s&@top_builddir@&$ac_top_builddir_sub&;t t -s&@srcdir@&$ac_srcdir&;t t -s&@abs_srcdir@&$ac_abs_srcdir&;t t -s&@top_srcdir@&$ac_top_srcdir&;t t -s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t -s&@builddir@&$ac_builddir&;t t -s&@abs_builddir@&$ac_abs_builddir&;t t -s&@abs_top_builddir@&$ac_abs_top_builddir&;t t -s&@INSTALL@&$ac_INSTALL&;t t -$ac_datarootdir_hack -" $ac_file_inputs | sed -f "$tmp/subs-1.sed" | sed 's/|#_!!_#|//g' >$tmp/out - -test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && - { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } && - { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } && - { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&5 -echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' -which seems to be undefined. Please make sure it is defined." >&2;} - - rm -f "$tmp/stdin" - case $ac_file in - -) cat "$tmp/out"; rm -f "$tmp/out";; - *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;; - esac - ;; - :H) - # - # CONFIG_HEADER - # -_ACEOF - -# Transform confdefs.h into a sed script `conftest.defines', that -# substitutes the proper values into config.h.in to produce config.h. -rm -f conftest.defines conftest.tail -# First, append a space to every undef/define line, to ease matching. -echo 's/$/ /' >conftest.defines -# Then, protect against being on the right side of a sed subst, or in -# an unquoted here document, in config.status. If some macros were -# called several times there might be several #defines for the same -# symbol, which is useless. But do not sort them, since the last -# AC_DEFINE must be honored. -ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* -# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where -# NAME is the cpp macro being defined, VALUE is the value it is being given. -# PARAMS is the parameter list in the macro definition--in most cases, it's -# just an empty string. -ac_dA='s,^\\([ #]*\\)[^ ]*\\([ ]*' -ac_dB='\\)[ (].*,\\1define\\2' -ac_dC=' ' -ac_dD=' ,' - -uniq confdefs.h | - sed -n ' - t rset - :rset - s/^[ ]*#[ ]*define[ ][ ]*// - t ok - d - :ok - s/[\\&,]/\\&/g - s/^\('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p - s/^\('"$ac_word_re"'\)[ ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p - ' >>conftest.defines - -# Remove the space that was appended to ease matching. -# Then replace #undef with comments. This is necessary, for -# example, in the case of _POSIX_SOURCE, which is predefined and required -# on some systems where configure will not decide to define it. -# (The regexp can be short, since the line contains either #define or #undef.) -echo 's/ $// -s,^[ #]*u.*,/* & */,' >>conftest.defines - -# Break up conftest.defines: -ac_max_sed_lines=50 - -# First sed command is: sed -f defines.sed $ac_file_inputs >"$tmp/out1" -# Second one is: sed -f defines.sed "$tmp/out1" >"$tmp/out2" -# Third one will be: sed -f defines.sed "$tmp/out2" >"$tmp/out1" -# et cetera. -ac_in='$ac_file_inputs' -ac_out='"$tmp/out1"' -ac_nxt='"$tmp/out2"' - -while : -do - # Write a here document: - cat >>$CONFIG_STATUS <<_ACEOF - # First, check the format of the line: - cat >"\$tmp/defines.sed" <<\\CEOF -/^[ ]*#[ ]*undef[ ][ ]*$ac_word_re[ ]*\$/b def -/^[ ]*#[ ]*define[ ][ ]*$ac_word_re[( ]/b def -b -:def -_ACEOF - sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS - echo 'CEOF - sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS - ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in - sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail - grep . conftest.tail >/dev/null || break - rm -f conftest.defines - mv conftest.tail conftest.defines -done -rm -f conftest.defines conftest.tail - -echo "ac_result=$ac_in" >>$CONFIG_STATUS -cat >>$CONFIG_STATUS <<\_ACEOF - if test x"$ac_file" != x-; then - echo "/* $configure_input */" >"$tmp/config.h" - cat "$ac_result" >>"$tmp/config.h" - if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then - { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 -echo "$as_me: $ac_file is unchanged" >&6;} - else - rm -f $ac_file - mv "$tmp/config.h" $ac_file - fi - else - echo "/* $configure_input */" - cat "$ac_result" - fi - rm -f "$tmp/out12" - ;; - :L) - # - # CONFIG_LINK - # - - { echo "$as_me:$LINENO: linking $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: linking $srcdir/$ac_source to $ac_file" >&6;} - - if test ! -r "$srcdir/$ac_source"; then - { { echo "$as_me:$LINENO: error: $srcdir/$ac_source: file not found" >&5 -echo "$as_me: error: $srcdir/$ac_source: file not found" >&2;} - { (exit 1); exit 1; }; } - fi - rm -f "$ac_file" - - # Try a relative symlink, then a hard link, then a copy. - case $srcdir in - [\\/$]* | ?:[\\/]* ) ac_rel_source=$srcdir/$ac_source ;; - *) ac_rel_source=$ac_top_build_prefix$srcdir/$ac_source ;; - esac - ln -s "$ac_rel_source" "$ac_file" 2>/dev/null || - ln "$srcdir/$ac_source" "$ac_file" 2>/dev/null || - cp -p "$srcdir/$ac_source" "$ac_file" || - { { echo "$as_me:$LINENO: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&5 -echo "$as_me: error: cannot link or copy $srcdir/$ac_source to $ac_file" >&2;} - { (exit 1); exit 1; }; } - ;; - - esac - - - case $ac_file$ac_mode in - "stamp-h":F) echo timestamp > stamp-h ;; - - esac -done # for ac_tag - - -{ (exit 0); exit 0; } -_ACEOF -chmod +x $CONFIG_STATUS -ac_clean_files=$ac_clean_files_save - - -# configure is writing to config.log, and then calls config.status. -# config.status does its own redirection, appending to config.log. -# Unfortunately, on DOS this fails, as config.log is still kept open -# by configure, so config.status won't be able to write to it; its -# output is simply discarded. So we exec the FD to /dev/null, -# effectively closing config.log, so it can be properly (re)opened and -# appended to by config.status. When coming back to configure, we -# need to make the FD available again. -if test "$no_create" != yes; then - ac_cs_success=: - ac_config_status_args= - test "$silent" = yes && - ac_config_status_args="$ac_config_status_args --quiet" - exec 5>/dev/null - $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false - exec 5>>config.log - # Use ||, not &&, to avoid exiting from the if with $? = 1, which - # would make configure fail if this is the last instruction. - $ac_cs_success || { (exit 1); exit 1; } -fi - From ece031d35a820d8e9674f3014cf80d86fcfb20c5 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 14 Apr 2009 16:12:01 +0000 Subject: [PATCH 0647/1707] Forgot to delete stamp-h.in --- stamp-h.in | 1 - 1 file changed, 1 deletion(-) delete mode 100644 stamp-h.in diff --git a/stamp-h.in b/stamp-h.in deleted file mode 100644 index 9788f7023..000000000 --- a/stamp-h.in +++ /dev/null @@ -1 +0,0 @@ -timestamp From f93d668e0b96963c35dfb355b4b9d42a53bfd5c0 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 14 Apr 2009 16:15:42 +0000 Subject: [PATCH 0648/1707] args changelog should mention this too --- ChangeLog | 1 + 1 file changed, 1 insertion(+) diff --git a/ChangeLog b/ChangeLog index 3f7dc7bff..7d4ca0ad4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,7 @@ * configure: Remove. * config.h.in: Likewise. + * stamp-h.in: Likewise. * DISTLIST: Likewise. * conf/common.mk: Likewise. * conf/i386-coreboot.mk: Likewise. From 9b8fd01509d8d13a28e053b4e0022f357e3e9bb8 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 14 Apr 2009 16:17:10 +0000 Subject: [PATCH 0649/1707] remove DISTLIST --- DISTLIST | 505 ------------------------------------------------------- 1 file changed, 505 deletions(-) delete mode 100644 DISTLIST diff --git a/DISTLIST b/DISTLIST deleted file mode 100644 index da2062a57..000000000 --- a/DISTLIST +++ /dev/null @@ -1,505 +0,0 @@ -AUTHORS -COPYING -ChangeLog -DISTLIST -INSTALL -NEWS -README -THANKS -TODO -Makefile.in -aclocal.m4 -autogen.sh -config.guess -config.h.in -config.sub -configure -configure.ac -gencmdlist.sh -gendistlist.sh -genfslist.sh -geninit.sh -geninitheader.sh -genkernsyms.sh.in -genmk.rb -genmoddep.awk -genmodsrc.sh -genpartmaplist.sh -gensymlist.sh.in -install-sh -mkinstalldirs -stamp-h.in -boot/i386/pc/boot.S -boot/i386/pc/cdboot.S -boot/i386/pc/diskboot.S -boot/i386/pc/lnxboot.S -boot/i386/pc/pxeboot.S -boot/sparc64/ieee1275/boot.S -boot/sparc64/ieee1275/diskboot.S -bus/pci.c -bus/usb/ohci.c -bus/usb/uhci.c -bus/usb/usb.c -bus/usb/usbhub.c -bus/usb/usbtrans.c -commands/blocklist.c -commands/boot.c -commands/cat.c -commands/cmp.c -commands/configfile.c -commands/crc.c -commands/date.c -commands/echo.c -commands/extcmd.c -commands/halt.c -commands/handler.c -commands/hdparm.c -commands/help.c -commands/hexdump.c -commands/loadenv.c -commands/ls.c -commands/lsmmap.c -commands/lspci.c -commands/memrw.c -commands/minicmd.c -commands/parttool.c -commands/read.c -commands/reboot.c -commands/search.c -commands/sleep.c -commands/test.c -commands/usbtest.c -commands/videotest.c -commands/efi/fixvideo.c -commands/efi/loadbios.c -commands/i386/cpuid.c -commands/i386/pc/halt.c -commands/i386/pc/play.c -commands/i386/pc/pxecmd.c -commands/i386/pc/vbeinfo.c -commands/i386/pc/vbetest.c -commands/ieee1275/suspend.c -conf/common.mk -conf/common.rmk -conf/i386-coreboot.mk -conf/i386-coreboot.rmk -conf/i386-efi.mk -conf/i386-efi.rmk -conf/i386-ieee1275.mk -conf/i386-ieee1275.rmk -conf/i386-pc-cygwin-img-ld.sc -conf/i386-pc.mk -conf/i386-pc.rmk -conf/i386.mk -conf/i386.rmk -conf/powerpc-ieee1275.mk -conf/powerpc-ieee1275.rmk -conf/sparc64-ieee1275.mk -conf/sparc64-ieee1275.rmk -conf/x86_64-efi.mk -conf/x86_64-efi.rmk -disk/ata.c -disk/ata_pthru.c -disk/dmraid_nvidia.c -disk/fs_uuid.c -disk/host.c -disk/loopback.c -disk/lvm.c -disk/mdraid_linux.c -disk/memdisk.c -disk/raid.c -disk/raid5_recover.c -disk/raid6_recover.c -disk/scsi.c -disk/usbms.c -disk/efi/efidisk.c -disk/i386/pc/biosdisk.c -disk/ieee1275/nand.c -disk/ieee1275/ofdisk.c -docs/fdl.texi -docs/grub.cfg -docs/grub.texi -docs/texinfo.tex -font/font.c -font/font_cmd.c -fs/affs.c -fs/afs.c -fs/cpio.c -fs/ext2.c -fs/fat.c -fs/fshelp.c -fs/hfs.c -fs/hfsplus.c -fs/iso9660.c -fs/jfs.c -fs/minix.c -fs/ntfs.c -fs/ntfscomp.c -fs/reiserfs.c -fs/sfs.c -fs/tar.c -fs/udf.c -fs/ufs.c -fs/xfs.c -fs/i386/pc/pxe.c -hello/hello.c -hook/datehook.c -include/multiboot.h -include/multiboot2.h -include/grub/acorn_filecore.h -include/grub/aout.h -include/grub/ata.h -include/grub/bitmap.h -include/grub/boot.h -include/grub/bufio.h -include/grub/cache.h -include/grub/command.h -include/grub/datetime.h -include/grub/device.h -include/grub/disk.h -include/grub/dl.h -include/grub/elf.h -include/grub/elfload.h -include/grub/env.h -include/grub/err.h -include/grub/extcmd.h -include/grub/file.h -include/grub/font.h -include/grub/fs.h -include/grub/fshelp.h -include/grub/gpt_partition.h -include/grub/gzio.h -include/grub/handler.h -include/grub/hfs.h -include/grub/kernel.h -include/grub/list.h -include/grub/loader.h -include/grub/lvm.h -include/grub/menu.h -include/grub/menu_viewer.h -include/grub/misc.h -include/grub/mm.h -include/grub/multiboot.h -include/grub/multiboot2.h -include/grub/multiboot_loader.h -include/grub/net.h -include/grub/normal.h -include/grub/ntfs.h -include/grub/parser.h -include/grub/partition.h -include/grub/parttool.h -include/grub/pc_partition.h -include/grub/pci.h -include/grub/raid.h -include/grub/rescue.h -include/grub/script.h -include/grub/scsi.h -include/grub/scsicmd.h -include/grub/setjmp.h -include/grub/symbol.h -include/grub/term.h -include/grub/terminfo.h -include/grub/time.h -include/grub/tparm.h -include/grub/types.h -include/grub/usb.h -include/grub/usbdesc.h -include/grub/usbtrans.h -include/grub/video.h -include/grub/efi/api.h -include/grub/efi/console.h -include/grub/efi/console_control.h -include/grub/efi/disk.h -include/grub/efi/efi.h -include/grub/efi/pe32.h -include/grub/efi/time.h -include/grub/efi/uga_draw.h -include/grub/i386/at_keyboard.h -include/grub/i386/bsd.h -include/grub/i386/cmos.h -include/grub/i386/halt.h -include/grub/i386/io.h -include/grub/i386/kernel.h -include/grub/i386/linux.h -include/grub/i386/loader.h -include/grub/i386/multiboot.h -include/grub/i386/pci.h -include/grub/i386/pit.h -include/grub/i386/reboot.h -include/grub/i386/setjmp.h -include/grub/i386/time.h -include/grub/i386/tsc.h -include/grub/i386/types.h -include/grub/i386/vga_common.h -include/grub/i386/coreboot/boot.h -include/grub/i386/coreboot/console.h -include/grub/i386/coreboot/init.h -include/grub/i386/coreboot/kernel.h -include/grub/i386/coreboot/loader.h -include/grub/i386/coreboot/machine.h -include/grub/i386/coreboot/memory.h -include/grub/i386/coreboot/serial.h -include/grub/i386/coreboot/time.h -include/grub/i386/efi/kernel.h -include/grub/i386/efi/loader.h -include/grub/i386/efi/machine.h -include/grub/i386/efi/time.h -include/grub/i386/ieee1275/console.h -include/grub/i386/ieee1275/ieee1275.h -include/grub/i386/ieee1275/kernel.h -include/grub/i386/ieee1275/loader.h -include/grub/i386/ieee1275/machine.h -include/grub/i386/ieee1275/memory.h -include/grub/i386/ieee1275/serial.h -include/grub/i386/ieee1275/time.h -include/grub/i386/pc/biosdisk.h -include/grub/i386/pc/boot.h -include/grub/i386/pc/chainloader.h -include/grub/i386/pc/console.h -include/grub/i386/pc/init.h -include/grub/i386/pc/kernel.h -include/grub/i386/pc/loader.h -include/grub/i386/pc/machine.h -include/grub/i386/pc/memory.h -include/grub/i386/pc/pxe.h -include/grub/i386/pc/serial.h -include/grub/i386/pc/time.h -include/grub/i386/pc/vbe.h -include/grub/i386/pc/vbeblit.h -include/grub/i386/pc/vbefill.h -include/grub/i386/pc/vbeutil.h -include/grub/i386/pc/vga.h -include/grub/ieee1275/ieee1275.h -include/grub/ieee1275/ofdisk.h -include/grub/lib/LzFind.h -include/grub/lib/LzHash.h -include/grub/lib/LzmaDec.h -include/grub/lib/LzmaEnc.h -include/grub/lib/LzmaTypes.h -include/grub/lib/arg.h -include/grub/lib/crc.h -include/grub/lib/datetime.h -include/grub/lib/envblk.h -include/grub/lib/hexdump.h -include/grub/powerpc/kernel.h -include/grub/powerpc/libgcc.h -include/grub/powerpc/setjmp.h -include/grub/powerpc/time.h -include/grub/powerpc/types.h -include/grub/powerpc/ieee1275/biosdisk.h -include/grub/powerpc/ieee1275/console.h -include/grub/powerpc/ieee1275/ieee1275.h -include/grub/powerpc/ieee1275/kernel.h -include/grub/powerpc/ieee1275/loader.h -include/grub/powerpc/ieee1275/machine.h -include/grub/powerpc/ieee1275/memory.h -include/grub/powerpc/ieee1275/time.h -include/grub/powerpc/ieee1275/util/biosdisk.h -include/grub/sparc64/kernel.h -include/grub/sparc64/libgcc.h -include/grub/sparc64/setjmp.h -include/grub/sparc64/time.h -include/grub/sparc64/types.h -include/grub/sparc64/ieee1275/boot.h -include/grub/sparc64/ieee1275/console.h -include/grub/sparc64/ieee1275/ieee1275.h -include/grub/sparc64/ieee1275/kernel.h -include/grub/sparc64/ieee1275/loader.h -include/grub/sparc64/ieee1275/machine.h -include/grub/sparc64/ieee1275/memory.h -include/grub/sparc64/ieee1275/time.h -include/grub/util/getroot.h -include/grub/util/hostdisk.h -include/grub/util/lvm.h -include/grub/util/misc.h -include/grub/util/raid.h -include/grub/util/resolve.h -include/grub/x86_64/kernel.h -include/grub/x86_64/linux.h -include/grub/x86_64/pci.h -include/grub/x86_64/setjmp.h -include/grub/x86_64/time.h -include/grub/x86_64/types.h -include/grub/x86_64/efi/kernel.h -include/grub/x86_64/efi/loader.h -include/grub/x86_64/efi/machine.h -include/grub/x86_64/efi/time.h -io/bufio.c -io/gzio.c -kern/command.c -kern/corecmd.c -kern/device.c -kern/disk.c -kern/dl.c -kern/elf.c -kern/env.c -kern/err.c -kern/file.c -kern/fs.c -kern/handler.c -kern/list.c -kern/loader.c -kern/main.c -kern/misc.c -kern/mm.c -kern/parser.c -kern/partition.c -kern/rescue.c -kern/term.c -kern/time.c -kern/efi/efi.c -kern/efi/init.c -kern/efi/mm.c -kern/generic/millisleep.c -kern/generic/rtc_get_time_ms.c -kern/i386/dl.c -kern/i386/halt.c -kern/i386/loader.S -kern/i386/multiboot_mmap.c -kern/i386/pit.c -kern/i386/realmode.S -kern/i386/reboot.c -kern/i386/tsc.c -kern/i386/coreboot/init.c -kern/i386/coreboot/mmap.c -kern/i386/coreboot/startup.S -kern/i386/efi/init.c -kern/i386/efi/startup.S -kern/i386/ieee1275/init.c -kern/i386/ieee1275/startup.S -kern/i386/pc/init.c -kern/i386/pc/lzma_decode.S -kern/i386/pc/lzo1x.S -kern/i386/pc/mmap.c -kern/i386/pc/startup.S -kern/ieee1275/cmain.c -kern/ieee1275/ieee1275.c -kern/ieee1275/init.c -kern/ieee1275/mmap.c -kern/ieee1275/openfw.c -kern/powerpc/cache.S -kern/powerpc/dl.c -kern/powerpc/ieee1275/startup.S -kern/sparc64/cache.S -kern/sparc64/dl.c -kern/sparc64/ieee1275/crt0.S -kern/sparc64/ieee1275/ieee1275.c -kern/sparc64/ieee1275/openfw.c -kern/x86_64/dl.c -kern/x86_64/efi/callwrap.S -kern/x86_64/efi/startup.S -lib/LzFind.c -lib/LzmaDec.c -lib/LzmaEnc.c -lib/arg.c -lib/crc.c -lib/datetime.c -lib/envblk.c -lib/hexdump.c -lib/efi/datetime.c -lib/i386/datetime.c -loader/aout.c -loader/multiboot2.c -loader/multiboot_loader.c -loader/efi/appleloader.c -loader/efi/chainloader.c -loader/i386/bsd.c -loader/i386/linux.c -loader/i386/multiboot.c -loader/i386/multiboot_elfxx.c -loader/i386/multiboot_helper.S -loader/i386/efi/linux.c -loader/i386/ieee1275/linux.c -loader/i386/pc/chainloader.c -loader/i386/pc/linux.c -loader/i386/pc/multiboot2.c -loader/ieee1275/multiboot2.c -loader/powerpc/ieee1275/linux.c -loader/sparc64/ieee1275/linux.c -normal/cmdline.c -normal/color.c -normal/command.c -normal/completion.c -normal/datetime.c -normal/execute.c -normal/function.c -normal/lexer.c -normal/main.c -normal/menu.c -normal/menu_entry.c -normal/menu_text.c -normal/menu_viewer.c -normal/misc.c -normal/parser.y -normal/script.c -normal/i386/setjmp.S -normal/powerpc/setjmp.S -normal/sparc64/setjmp.S -normal/x86_64/setjmp.S -partmap/acorn.c -partmap/amiga.c -partmap/apple.c -partmap/gpt.c -partmap/pc.c -partmap/sun.c -term/gfxterm.c -term/terminfo.c -term/tparm.c -term/usb_keyboard.c -term/efi/console.c -term/i386/vga_common.c -term/i386/pc/at_keyboard.c -term/i386/pc/console.c -term/i386/pc/serial.c -term/i386/pc/vesafb.c -term/i386/pc/vga.c -term/i386/pc/vga_text.c -term/ieee1275/ofconsole.c -util/console.c -util/getroot.c -util/grub-dumpbios.in -util/grub-editenv.c -util/grub-emu.c -util/grub-fstest.c -util/grub-mkconfig.in -util/grub-mkconfig_lib.in -util/grub-mkdevicemap.c -util/grub-mkfont.c -util/grub-pe2elf.c -util/grub-probe.c -util/hostdisk.c -util/hostfs.c -util/lvm.c -util/misc.c -util/raid.c -util/resolve.c -util/update-grub_lib.in -util/usb.c -util/elf/grub-mkimage.c -util/grub.d/00_header.in -util/grub.d/10_freebsd.in -util/grub.d/10_hurd.in -util/grub.d/10_linux.in -util/grub.d/10_windows.in -util/grub.d/30_os-prober.in -util/grub.d/40_custom.in -util/grub.d/README -util/i386/efi/grub-install.in -util/i386/efi/grub-mkimage.c -util/i386/pc/grub-install.in -util/i386/pc/grub-mkimage.c -util/i386/pc/grub-mkrescue.in -util/i386/pc/grub-setup.c -util/i386/pc/misc.c -util/ieee1275/grub-install.in -util/powerpc/ieee1275/grub-mkrescue.in -util/powerpc/ieee1275/misc.c -video/bitmap.c -video/video.c -video/i386/pc/vbe.c -video/i386/pc/vbeblit.c -video/i386/pc/vbefill.c -video/i386/pc/vbeutil.c -video/readers/jpeg.c -video/readers/png.c -video/readers/tga.c From 33c846be292c3177725c8f0dafebebc2202ea9c9 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 14 Apr 2009 16:56:35 +0000 Subject: [PATCH 0650/1707] 2009-04-14 Bean * util/grub-pe2elf.c (write_symbol_table): Terminate short name symbol properly with null character. --- ChangeLog | 5 +++++ util/grub-pe2elf.c | 11 +++++++++-- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7d4ca0ad4..5119013f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-14 Bean + + * util/grub-pe2elf.c (write_symbol_table): Terminate short name symbol + properly with null character. + 2009-04-14 Felix Zielcke * configure: Remove. diff --git a/util/grub-pe2elf.c b/util/grub-pe2elf.c index d703d33c3..ddcebc110 100644 --- a/util/grub-pe2elf.c +++ b/util/grub-pe2elf.c @@ -344,10 +344,17 @@ write_symbol_table (FILE* fp, char *image, } else { + char short_name[9]; char *name; - name = ((pe_symtab->long_name[0]) ? pe_symtab->short_name : - pe_strtab + pe_symtab->long_name[1]); + if (pe_symtab->long_name[0]) + { + strncpy (short_name, pe_symtab->short_name, 8); + short_name[8] = 0; + name = short_name; + } + else + name = pe_strtab + pe_symtab->long_name[1]; if ((strcmp (name, "_grub_mod_init")) && (strcmp (name, "_grub_mod_fini")) && From d05f0df3ebb5cca21005b64fe65e8cafeef974c6 Mon Sep 17 00:00:00 2001 From: bean Date: Tue, 14 Apr 2009 18:12:14 +0000 Subject: [PATCH 0651/1707] 2009-04-14 Bean * Makefile.in (pkglib_DATA): Add handler.lst. (handler.lst): New rule. * conf/i386-pc.rmk (normal_mod_SOURCES): Add normal/handler.c. * conf/i386-coreboot.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-efi.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * genhandlerlist.sh: New file. * genmk.rb: Add rules to generate handler.lst. * include/grub/normal.h (grub_file_getline): New function definition. (read_handler_list): Likewise. (free_handler_list): Likewise. * include/grub/term.h (grub_term_register_input): Add name parameter for auto generation of handler.lst. (grub_term_register_output): Likewise. * normal/handler.c: New file. * normal/main.c (get_line): Renamed to grub_file_getline. (read_config_file): Use the newly renamed grub_file_getline. (read_command_list): Likewise. (read_fs_list): Likewise. (grub_normal_execute): Call read_handler_list to parse handler.lst. (GRUB_MOD_FINI): Call free_handler_list to free handler list. * term/efi/console.c (grub_console_init): Add name parameter for auto generation of handler.lst. * term/gfxterm.c: Likewise. * term/i386/pc/at_keyboard.c: Likewise. * term/i386/pc/console.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * term/i386/pc/vga.c: Likewise. * term/i386/pc/vga_text.c: Likewise. * term/ieee1275/ofconsole.c: Likewise. * term/usb_keyboard.c: Likewise. --- ChangeLog | 46 ++++++++ Makefile.in | 5 +- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- conf/x86_64-efi.rmk | 2 +- genhandlerlist.sh | 23 ++++ genmk.rb | 8 +- include/grub/normal.h | 5 + include/grub/term.h | 6 +- normal/handler.c | 232 +++++++++++++++++++++++++++++++++++++ normal/main.c | 14 ++- term/efi/console.c | 4 +- term/gfxterm.c | 2 +- term/i386/pc/at_keyboard.c | 2 +- term/i386/pc/console.c | 4 +- term/i386/pc/serial.c | 4 +- term/i386/pc/vesafb.c | 2 +- term/i386/pc/vga.c | 3 +- term/i386/pc/vga_text.c | 2 +- term/ieee1275/ofconsole.c | 4 +- term/usb_keyboard.c | 2 +- util/console.c | 4 +- 26 files changed, 352 insertions(+), 34 deletions(-) create mode 100644 genhandlerlist.sh create mode 100644 normal/handler.c diff --git a/ChangeLog b/ChangeLog index 5119013f0..25fcf56c3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,49 @@ +2009-04-14 Bean + + * Makefile.in (pkglib_DATA): Add handler.lst. + (handler.lst): New rule. + + * conf/i386-pc.rmk (normal_mod_SOURCES): Add normal/handler.c. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-efi.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + + * genhandlerlist.sh: New file. + + * genmk.rb: Add rules to generate handler.lst. + + * include/grub/normal.h (grub_file_getline): New function definition. + (read_handler_list): Likewise. + (free_handler_list): Likewise. + + * include/grub/term.h (grub_term_register_input): Add name parameter + for auto generation of handler.lst. + (grub_term_register_output): Likewise. + + * normal/handler.c: New file. + + * normal/main.c (get_line): Renamed to grub_file_getline. + (read_config_file): Use the newly renamed grub_file_getline. + (read_command_list): Likewise. + (read_fs_list): Likewise. + (grub_normal_execute): Call read_handler_list to parse handler.lst. + (GRUB_MOD_FINI): Call free_handler_list to free handler list. + + * term/efi/console.c (grub_console_init): Add name parameter for auto + generation of handler.lst. + * term/gfxterm.c: Likewise. + * term/i386/pc/at_keyboard.c: Likewise. + * term/i386/pc/console.c: Likewise. + * term/i386/pc/serial.c: Likewise. + * term/i386/pc/vesafb.c: Likewise. + * term/i386/pc/vga.c: Likewise. + * term/i386/pc/vga_text.c: Likewise. + * term/ieee1275/ofconsole.c: Likewise. + * term/usb_keyboard.c: Likewise. + 2009-04-14 Bean * util/grub-pe2elf.c (write_symbol_table): Terminate short name symbol diff --git a/Makefile.in b/Makefile.in index d6e55e75e..b24ee2ed8 100644 --- a/Makefile.in +++ b/Makefile.in @@ -139,7 +139,7 @@ include $(srcdir)/conf/$(target_cpu)-$(platform).mk ### General targets. CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) -pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst +pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst handler.lst moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk cat $(DEFSYMFILES) /dev/null \ | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \ @@ -154,6 +154,9 @@ fs.lst: $(FSFILES) partmap.lst: $(PARTMAPFILES) cat $^ /dev/null | sort > $@ +handler.lst: $(HANDLERFILES) + cat $^ /dev/null | sort > $@ + ifeq (, $(UNIFONT_BDF)) else diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 41c45db1d..c7bf3c408 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -117,7 +117,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 399376ffb..4cdf0b5c5 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -121,7 +121,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 96d9c1014..8ee7e1d0a 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -113,7 +113,7 @@ pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index bb783f33a..b0e15efa3 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -212,7 +212,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c normal/handler.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 361fb8572..c069547f6 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -128,7 +128,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # keep it simpler to update to different architectures. # normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c \ + normal/completion.c normal/execute.c normal/handler.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ normal/color.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 45e3003c4..f5f9a8d61 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -169,7 +169,7 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ normal/datetime.c normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ + normal/handler.c normal/menu_text.c \ normal/color.c \ normal/menu_viewer.c normal/menu_entry.c \ normal/misc.c grub_script.tab.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 9f9f978be..c2acaa5b7 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -124,7 +124,7 @@ kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genke # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ normal/completion.c normal/datetime.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/menu_text.c \ diff --git a/genhandlerlist.sh b/genhandlerlist.sh new file mode 100644 index 000000000..6446a98ff --- /dev/null +++ b/genhandlerlist.sh @@ -0,0 +1,23 @@ +#! /bin/sh +# +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This script is free software; the author +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Read source code from stdin and detect command names. + +module=$1 + +grep -v "^#" | sed -n \ + -e "/grub_parser_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/parser.\1: $module/;p;}" \ + -e "/grub_reader_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/reader.\1: $module/;p;}" \ + -e "/grub_term_register_input *( *\"/{s/.*( *\"\([^\"]*\)\".*/terminal_input.\1: $module/;p;}" \ + -e "/grub_term_register_output *( *\"/{s/.*( *\"\([^\"]*\)\".*/terminal_output.\1: $module/;p;}" \ + -e "/grub_menu_viewer_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/menu_viewer.\1: $module/;p;}" diff --git a/genmk.rb b/genmk.rb index 57fe918ab..b619421e1 100644 --- a/genmk.rb +++ b/genmk.rb @@ -143,6 +143,7 @@ endif command = 'cmd-' + obj.suffix('lst') fs = 'fs-' + obj.suffix('lst') partmap = 'partmap-' + obj.suffix('lst') + handler = 'handler-' + obj.suffix('lst') dep = deps[i] flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end @@ -152,10 +153,11 @@ endif $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} -CLEANFILES += #{command} #{fs} #{partmap} +CLEANFILES += #{command} #{fs} #{partmap} #{handler} COMMANDFILES += #{command} FSFILES += #{fs} PARTMAPFILES += #{partmap} +HANDLERFILES += #{handler} #{command}: #{src} $(#{src}_DEPENDENCIES) gencmdlist.sh set -e; \ @@ -172,6 +174,10 @@ PARTMAPFILES += #{partmap} $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genpartmaplist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) +#{handler}: #{src} $(#{src}_DEPENDENCIES) genhandlerlist.sh + set -e; \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + | sh $(srcdir)/genhandlerlist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) " end.join('') diff --git a/include/grub/normal.h b/include/grub/normal.h index 27978dc09..e62e43379 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -26,6 +26,7 @@ #include #include #include +#include /* The maximum size of a command-line. */ #define GRUB_MAX_CMDLINE 1600 @@ -103,6 +104,10 @@ char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val) void grub_parse_color_name_pair (grub_uint8_t *ret, const char *name); void grub_wait_after_message (void); +char *grub_file_getline (grub_file_t file); +void read_handler_list (void); +void free_handler_list (void); + #ifdef GRUB_UTIL void grub_normal_init (void); void grub_normal_fini (void); diff --git a/include/grub/term.h b/include/grub/term.h index 6a356647f..d12d0f0d3 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -219,13 +219,15 @@ extern struct grub_handler_class EXPORT_VAR(grub_term_input_class); extern struct grub_handler_class EXPORT_VAR(grub_term_output_class); static inline void -grub_term_register_input (grub_term_input_t term) +grub_term_register_input (const char *name __attribute__ ((unused)), + grub_term_input_t term) { grub_handler_register (&grub_term_input_class, GRUB_AS_HANDLER (term)); } static inline void -grub_term_register_output (grub_term_output_t term) +grub_term_register_output (const char *name __attribute__ ((unused)), + grub_term_output_t term) { grub_handler_register (&grub_term_output_class, GRUB_AS_HANDLER (term)); } diff --git a/normal/handler.c b/normal/handler.c new file mode 100644 index 000000000..fe31478fe --- /dev/null +++ b/normal/handler.c @@ -0,0 +1,232 @@ +/* handler.c - support handler loading */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +struct grub_handler_list +{ + struct grub_handler_list *next; + char *name; + grub_command_t cmd; +}; + +static grub_list_t handler_list; + +static grub_err_t +grub_handler_cmd (struct grub_command *cmd, + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) +{ + char *p; + grub_handler_class_t class; + grub_handler_t handler; + + p = grub_strchr (cmd->name, '.'); + if (! p) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid command name"); + + if (cmd->data) + { + if (! grub_dl_get (cmd->data)) + { + grub_dl_t mod; + + mod = grub_dl_load (cmd->data); + if (mod) + grub_dl_ref (mod); + else + return grub_errno; + } + grub_free (cmd->data); + cmd->data = 0; + } + + *p = 0; + class = grub_named_list_find (GRUB_AS_NAMED_LIST (grub_handler_class_list), + cmd->name); + *p = '.'; + + if (! class) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "class not found"); + + + handler = grub_named_list_find (GRUB_AS_NAMED_LIST (class->handler_list), + p + 1); + if (! handler) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "handler not found"); + + grub_handler_set_current (class, handler); + + return 0; +} + +static void +insert_handler (char *name, char *module) +{ + struct grub_handler_list *item; + char *data; + + if (grub_command_find (name)) + return; + + item = grub_malloc (sizeof (*item)); + if (! item) + return; + + item->name = grub_strdup (name); + if (! item->name) + { + grub_free (item); + return; + } + + if (module) + { + data = grub_strdup (module); + if (! data) + { + grub_free (item->name); + grub_free (item); + return; + } + } + else + data = 0; + + item->cmd = grub_register_command (item->name, grub_handler_cmd, 0, + "Set active handler"); + if (! item->cmd) + { + grub_free (data); + grub_free (item->name); + grub_free (item); + return; + } + + item->cmd->data = data; + grub_list_push (&handler_list, GRUB_AS_LIST (item)); +} + +/* Read the file handler.lst for auto-loading. */ +void +read_handler_list (void) +{ + const char *prefix; + static int first_time = 1; + const char *class_name; + + auto int iterate_handler (grub_handler_t handler); + int iterate_handler (grub_handler_t handler) + { + char name[grub_strlen (class_name) + grub_strlen (handler->name) + 2]; + + grub_strcpy (name, class_name); + grub_strcat (name, "."); + grub_strcat (name, handler->name); + + insert_handler (name, 0); + + return 0; + } + + auto int iterate_class (grub_handler_class_t class); + int iterate_class (grub_handler_class_t class) + { + class_name = class->name; + grub_list_iterate (GRUB_AS_LIST (class->handler_list), + (grub_list_hook_t) iterate_handler); + + return 0; + } + + /* Make sure that this function does not get executed twice. */ + if (! first_time) + return; + first_time = 0; + + prefix = grub_env_get ("prefix"); + if (prefix) + { + char *filename; + + filename = grub_malloc (grub_strlen (prefix) + sizeof ("/handler.lst")); + if (filename) + { + grub_file_t file; + + grub_sprintf (filename, "%s/handler.lst", prefix); + file = grub_file_open (filename); + if (file) + { + char *buf = 0; + for (;; grub_free(buf)) + { + char *p; + + buf = grub_file_getline (file); + + if (! buf) + break; + + if (! grub_isgraph (buf[0])) + continue; + + p = grub_strchr (buf, ':'); + if (! p) + continue; + + *p = '\0'; + while (*++p == ' ') + ; + + insert_handler (buf, p); + } + grub_file_close (file); + } + grub_free (filename); + } + } + + grub_list_iterate (GRUB_AS_LIST (grub_handler_class_list), + (grub_list_hook_t) iterate_class); + + /* Ignore errors. */ + grub_errno = GRUB_ERR_NONE; +} + +void +free_handler_list (void) +{ + struct grub_handler_list *item; + + while ((item = grub_list_pop (&handler_list)) != 0) + { + grub_free (item->cmd->data); + grub_unregister_command (item->cmd); + grub_free (item->name); + grub_free (item); + } +} diff --git a/normal/main.c b/normal/main.c index 9f906d860..1a50d9553 100644 --- a/normal/main.c +++ b/normal/main.c @@ -37,8 +37,8 @@ static grub_fs_module_list_t fs_module_list = 0; #define GRUB_DEFAULT_HISTORY_SIZE 50 /* Read a line from the file FILE. */ -static char * -get_line (grub_file_t file) +char * +grub_file_getline (grub_file_t file) { char c; int pos = 0; @@ -310,7 +310,7 @@ read_config_file (const char *config, int nested) { currline++; - *line = get_line (file); + *line = grub_file_getline (file); if (! *line) return grub_errno; @@ -343,7 +343,7 @@ read_config_file (const char *config, int nested) int startline; char *cmdline; - cmdline = get_line (file); + cmdline = grub_file_getline (file); if (!cmdline) break; @@ -475,7 +475,7 @@ read_command_list (void) grub_command_t cmd; int prio = 0; - buf = get_line (file); + buf = grub_file_getline (file); if (! buf) break; @@ -594,7 +594,7 @@ read_fs_list (void) char *q; grub_fs_module_list_t fs_mod; - buf = get_line (file); + buf = grub_file_getline (file); if (! buf) break; @@ -650,6 +650,7 @@ grub_normal_execute (const char *config, int nested, int batch) read_command_list (); read_fs_list (); + read_handler_list (); if (config) { @@ -754,4 +755,5 @@ GRUB_MOD_FINI(normal) { grub_set_history (0); grub_unregister_command (cmd_normal); + free_handler_list (); } diff --git a/term/efi/console.c b/term/efi/console.c index 0bf244901..3322b8f70 100644 --- a/term/efi/console.c +++ b/term/efi/console.c @@ -366,8 +366,8 @@ grub_console_init (void) return; } - grub_term_register_input (&grub_console_term_input); - grub_term_register_output (&grub_console_term_output); + grub_term_register_input ("console", &grub_console_term_input); + grub_term_register_output ("console", &grub_console_term_output); } void diff --git a/term/gfxterm.c b/term/gfxterm.c index dacecf478..4f74346b7 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -1155,7 +1155,7 @@ static grub_command_t cmd; GRUB_MOD_INIT(term_gfxterm) { my_mod = mod; - grub_term_register_output (&grub_video_term); + grub_term_register_output ("gfxterm", &grub_video_term); cmd = grub_register_command ("background_image", grub_gfxterm_background_image_cmd, 0, "Load background image for active terminal"); diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index ff5246d1b..0b2a06d46 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -226,7 +226,7 @@ static struct grub_term_input grub_at_keyboard_term = GRUB_MOD_INIT(at_keyboard) { - grub_term_register_input (&grub_at_keyboard_term); + grub_term_register_input ("at_keyboard", &grub_at_keyboard_term); } GRUB_MOD_FINI(at_keyboard) diff --git a/term/i386/pc/console.c b/term/i386/pc/console.c index 6c6be463c..c880595e4 100644 --- a/term/i386/pc/console.c +++ b/term/i386/pc/console.c @@ -46,8 +46,8 @@ static struct grub_term_output grub_console_term_output = void grub_console_init (void) { - grub_term_register_output (&grub_console_term_output); - grub_term_register_input (&grub_console_term_input); + grub_term_register_output ("console", &grub_console_term_output); + grub_term_register_input ("console", &grub_console_term_input); } void diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index eacff0661..757a06cb4 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -577,8 +577,8 @@ grub_cmd_serial (grub_extcmd_t cmd, /* Register terminal if not yet registered. */ if (registered == 0) { - grub_term_register_input (&grub_serial_term_input); - grub_term_register_output (&grub_serial_term_output); + grub_term_register_input ("serial", &grub_serial_term_input); + grub_term_register_output ("serial", &grub_serial_term_output); registered = 1; } } diff --git a/term/i386/pc/vesafb.c b/term/i386/pc/vesafb.c index 75cbd75ce..edd0b1a63 100644 --- a/term/i386/pc/vesafb.c +++ b/term/i386/pc/vesafb.c @@ -599,7 +599,7 @@ static struct grub_term_output grub_vesafb_term = GRUB_MOD_INIT(vesafb) { my_mod = mod; - grub_term_register_output (&grub_vesafb_term); + grub_term_register_output ("vesafb", &grub_vesafb_term); } GRUB_MOD_FINI(vesafb) diff --git a/term/i386/pc/vga.c b/term/i386/pc/vga.c index af880d5b5..dd2e25c34 100644 --- a/term/i386/pc/vga.c +++ b/term/i386/pc/vga.c @@ -25,7 +25,6 @@ #include #include #include -#include #include #define DEBUG_VGA 0 @@ -509,7 +508,7 @@ GRUB_MOD_INIT(vga) #ifndef GRUB_UTIL my_mod = mod; #endif - grub_term_register_output (&grub_vga_term); + grub_term_register_output ("vga", &grub_vga_term); } GRUB_MOD_FINI(vga) diff --git a/term/i386/pc/vga_text.c b/term/i386/pc/vga_text.c index e067ed615..170f74de8 100644 --- a/term/i386/pc/vga_text.c +++ b/term/i386/pc/vga_text.c @@ -168,7 +168,7 @@ static struct grub_term_output grub_vga_text_term = GRUB_MOD_INIT(vga_text) { - grub_term_register_output (&grub_vga_text_term); + grub_term_register_output ("vga_text", &grub_vga_text_term); } GRUB_MOD_FINI(vga_text) diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index 70fda9ab4..0cc0924fc 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -420,8 +420,8 @@ static struct grub_term_output grub_ofconsole_term_output = void grub_console_init (void) { - grub_term_register_input (&grub_ofconsole_term_input); - grub_term_register_output (&grub_ofconsole_term_output); + grub_term_register_input ("ofconsole", &grub_ofconsole_term_input); + grub_term_register_output ("ofconsole", &grub_ofconsole_term_output); } void diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index d30e6fc7f..50bbdd433 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -247,7 +247,7 @@ GRUB_MOD_INIT(usb_keyboard) (void) mod; /* To stop warning. */ grub_usb_hid (); - grub_term_register_input (&grub_usb_keyboard_term); + grub_term_register_input ("usb_keyboard", &grub_usb_keyboard_term); } GRUB_MOD_FINI(usb_keyboard) diff --git a/util/console.c b/util/console.c index 718afc19f..70b0440bb 100644 --- a/util/console.c +++ b/util/console.c @@ -374,8 +374,8 @@ static struct grub_term_output grub_ncurses_term_output = void grub_console_init (void) { - grub_term_register_output (&grub_ncurses_term_output); - grub_term_register_input (&grub_ncurses_term_input); + grub_term_register_output ("console", &grub_ncurses_term_output); + grub_term_register_input ("console", &grub_ncurses_term_input); grub_term_set_current_output (&grub_ncurses_term_output); grub_term_set_current_input (&grub_ncurses_term_input); } From 20318222381b6618738ffe6afd01b3ff4f98b63e Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 15 Apr 2009 06:58:39 +0000 Subject: [PATCH 0652/1707] 2009-04-15 Felix Zielcke * INSTALL: Add that `./autogen.sh' needs to be run before `./configure.'. --- ChangeLog | 5 +++++ INSTALL | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 25fcf56c3..ad98dad85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-15 Felix Zielcke + + * INSTALL: Add that `./autogen.sh' needs to be run before + `./configure.'. + 2009-04-14 Bean * Makefile.in (pkglib_DATA): Add handler.lst. diff --git a/INSTALL b/INSTALL index fa2edfdac..dbbdb6926 100644 --- a/INSTALL +++ b/INSTALL @@ -50,10 +50,10 @@ Building the GRUB The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and - type `./configure' to configure the package for your system. If - you're using `csh' on an old version of System V, you might need - to type `sh ./configure' instead to prevent `csh' from trying to - execute `configure' itself. + type `autogen.sh' and then `./configure' to configure the package + for your system. If you're using `csh' on an old version of + System V, you might need to type `sh ./configure' instead to + prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. From 13c007813a88148ede163d2320f10df50f8a3fa0 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 15 Apr 2009 12:32:08 +0000 Subject: [PATCH 0653/1707] 2009-04-15 Vladimir Serbinenko Restore grub-emu * conf/i386-pc.rmk (grub_emu_SOURCES): add normal/handler.c * conf/i386-coreboot.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise --- ChangeLog | 9 +++++++++ conf/i386-coreboot.rmk | 1 + conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 3 ++- 5 files changed, 14 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ad98dad85..0b21f7da9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-15 Vladimir Serbinenko + + Restore grub-emu + + * conf/i386-pc.rmk (grub_emu_SOURCES): add normal/handler.c + * conf/i386-coreboot.rmk: likewise + * conf/i386-ieee1275.rmk: likewise + * conf/powerpc-ieee1275.rmk: likewise + 2009-04-15 Felix Zielcke * INSTALL: Add that `./autogen.sh' needs to be run before diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index c7bf3c408..bf6fdd05f 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -76,6 +76,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ + normal/handler.c \ normal/completion.c normal/datetime.c normal/main.c \ normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 8ee7e1d0a..9bcf9f72b 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -76,7 +76,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c\ + normal/function.c normal/handler.c \ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/misc.c normal/script.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index b0e15efa3..e885184b7 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -135,7 +135,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/loader.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c \ + normal/function.c normal/handler.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index c069547f6..e35f7639b 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -59,7 +59,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ normal/completion.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/function.c normal/handler.c normal/lexer.c normal/main.c \ + normal/menu.c \ normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ normal/script.c \ From 5999d619177020cdd6b29530fbb7b3ba87d3bead Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 15 Apr 2009 12:33:46 +0000 Subject: [PATCH 0654/1707] 2009-04-15 Vladimir Serbinenko use grub_lltoa instead of grub_itoa and grub_ltoa for all purposes * kern/misc.c (grub_itoa): Removed function (grub_ltoa): likewise (grub_vsprintf): use grub_lltoa --- ChangeLog | 8 +++++++ kern/misc.c | 69 +++++++++++++---------------------------------------- 2 files changed, 24 insertions(+), 53 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b21f7da9..13b67cc9f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-04-15 Vladimir Serbinenko + + use grub_lltoa instead of grub_itoa and grub_ltoa for all purposes + + * kern/misc.c (grub_itoa): Removed function + (grub_ltoa): likewise + (grub_vsprintf): use grub_lltoa + 2009-04-15 Vladimir Serbinenko Restore grub-emu diff --git a/kern/misc.c b/kern/misc.c index 5a1253594..4c71ca854 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -565,56 +565,6 @@ grub_reverse (char *str) } } -static char * -grub_itoa (char *str, int c, unsigned n) -{ - unsigned base = (c == 'x') ? 16 : 10; - char *p; - - if ((int) n < 0 && c == 'd') - { - n = (unsigned) (-((int) n)); - *str++ = '-'; - } - - p = str; - do - { - unsigned d = n % base; - *p++ = (d > 9) ? d + 'a' - 10 : d + '0'; - } - while (n /= base); - *p = 0; - - grub_reverse (str); - return p; -} - -static char * -grub_ltoa (char *str, int c, unsigned long n) -{ - unsigned long base = (c == 'x') ? 16 : 10; - char *p; - - if ((long) n < 0 && c == 'd') - { - n = (unsigned long) (-((long) n)); - *str++ = '-'; - } - - p = str; - do - { - unsigned long d = n % base; - *p++ = (d > 9) ? d + 'a' - 10 : d + '0'; - } - while (n /= base); - *p = 0; - - grub_reverse (str); - return p; -} - /* Divide N by D, return the quotient, and store the remainder in *R. */ grub_uint64_t grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r) @@ -746,6 +696,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) int n; int longfmt = 0; int longlongfmt = 0; + int unsig = 0; if (*fmt && *fmt =='-') { @@ -804,9 +755,11 @@ grub_vsprintf (char *str, const char *fmt, va_list args) write_str ("0x"); c = 'x'; longlongfmt |= (sizeof (void *) == sizeof (long long)); - /* fall through */ + /* Fall through. */ case 'x': case 'u': + unsig = 1; + /* Fall through. */ case 'd': if (longlongfmt) { @@ -815,15 +768,25 @@ grub_vsprintf (char *str, const char *fmt, va_list args) ll = va_arg (args, long long); grub_lltoa (tmp, c, ll); } + else if (longfmt && unsig) + { + unsigned long l = va_arg (args, unsigned long); + grub_lltoa (tmp, c, l); + } else if (longfmt) { long l = va_arg (args, long); - grub_ltoa (tmp, c, l); + grub_lltoa (tmp, c, l); + } + else if (unsig) + { + unsigned u = va_arg (args, unsigned); + grub_lltoa (tmp, c, u); } else { n = va_arg (args, int); - grub_itoa (tmp, c, n); + grub_lltoa (tmp, c, n); } if (! rightfill && grub_strlen (tmp) < format1) write_fill (zerofill, format1 - grub_strlen (tmp)); From 0d5d5653261a6b706de47a4d5ae06480548a7d0a Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 15 Apr 2009 12:45:50 +0000 Subject: [PATCH 0655/1707] 2009-04-15 Vladimir Serbinenko Move loader out of the kernel * kern/loader.c: moved to ... * commands/boot.c: ... moved here * commands/minicmd.c (grub_mini_cmd_boot): moved to ... * commands/boot.c (grub_cmd_boot): moved here. All users updated * include/grub/kernel.h (grub_machine_fini): export * include/grub/loader.h (grub_loader_is_loaded): update declaration (grub_loader_set): likewise (grub_loader_unset): likewise (grub_loader_boot): likewise * conf/common.rmk: new module boot.mod (pkglib_MODULES): add boot.mod * conf/i386-coreboot.rmk (kernel_elf_SOURCES): remove kern/loader.c (grub_emu_SOURCES): likewise * conf/i386-efi.rmk (kernel_elf_SOURCES): likewise (grub_emu_SOURCES): likewise * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): likewise (grub_emu_SOURCES): likewise * conf/i386-pc.rmk (kernel_elf_SOURCES): likewise (grub_emu_SOURCES): likewise * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): likewise (grub_emu_SOURCES): likewise * conf/sparcs64-ieee1275.rmk (kernel_elf_SOURCES): likewise (grub_emu_SOURCES): likewise * conf/x86_64-efi.rmk (kernel_elf_SOURCES): likewise (grub_emu_SOURCES): likewise --- ChangeLog | 30 ++++++++++++++++ commands/boot.c | 75 +++++++++++++++++++++++++++++++++------ commands/minicmd.c | 17 ++------- conf/common.rmk | 7 +++- conf/i386-coreboot.rmk | 4 +-- conf/i386-efi.rmk | 4 +-- conf/i386-ieee1275.rmk | 4 +-- conf/i386-pc.rmk | 4 +-- conf/powerpc-ieee1275.rmk | 4 +-- conf/sparc64-ieee1275.rmk | 4 +-- conf/x86_64-efi.rmk | 4 +-- include/grub/kernel.h | 4 +-- include/grub/loader.h | 14 ++++---- 13 files changed, 125 insertions(+), 50 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13b67cc9f..910529d36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,33 @@ +2009-04-15 Vladimir Serbinenko + + Move loader out of the kernel + + * kern/loader.c: moved to ... + * commands/boot.c: ... moved here + * commands/minicmd.c (grub_mini_cmd_boot): moved to ... + * commands/boot.c (grub_cmd_boot): moved here. All users updated + * include/grub/kernel.h (grub_machine_fini): export + * include/grub/loader.h (grub_loader_is_loaded): update declaration + (grub_loader_set): likewise + (grub_loader_unset): likewise + (grub_loader_boot): likewise + * conf/common.rmk: new module boot.mod + (pkglib_MODULES): add boot.mod + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): remove kern/loader.c + (grub_emu_SOURCES): likewise + * conf/i386-efi.rmk (kernel_elf_SOURCES): likewise + (grub_emu_SOURCES): likewise + * conf/i386-ieee1275.rmk (kernel_elf_SOURCES): likewise + (grub_emu_SOURCES): likewise + * conf/i386-pc.rmk (kernel_elf_SOURCES): likewise + (grub_emu_SOURCES): likewise + * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): likewise + (grub_emu_SOURCES): likewise + * conf/sparcs64-ieee1275.rmk (kernel_elf_SOURCES): likewise + (grub_emu_SOURCES): likewise + * conf/x86_64-efi.rmk (kernel_elf_SOURCES): likewise + (grub_emu_SOURCES): likewise + 2009-04-15 Vladimir Serbinenko use grub_lltoa instead of grub_itoa and grub_ltoa for all purposes diff --git a/commands/boot.c b/commands/boot.c index ee0a0832e..9a08feaf7 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -1,7 +1,7 @@ /* boot.c - command to boot an operating system */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,29 +21,82 @@ #include #include #include +#include -static grub_err_t -grub_cmd_boot (struct grub_arg_list *state __attribute__ ((unused)), - int argc, char **args __attribute__ ((unused))) +static grub_err_t (*grub_loader_boot_func) (void); +static grub_err_t (*grub_loader_unload_func) (void); +static int grub_loader_noreturn; + +static int grub_loader_loaded; + +int +grub_loader_is_loaded (void) { - if (argc) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "too many arguments"); + return grub_loader_loaded; +} + +void +grub_loader_set (grub_err_t (*boot) (void), + grub_err_t (*unload) (void), + int noreturn) +{ + if (grub_loader_loaded && grub_loader_unload_func) + grub_loader_unload_func (); - grub_loader_boot (); + grub_loader_boot_func = boot; + grub_loader_unload_func = unload; + grub_loader_noreturn = noreturn; - return 0; + grub_loader_loaded = 1; +} + +void +grub_loader_unset(void) +{ + if (grub_loader_loaded && grub_loader_unload_func) + grub_loader_unload_func (); + + grub_loader_boot_func = 0; + grub_loader_unload_func = 0; + + grub_loader_loaded = 0; +} + +grub_err_t +grub_loader_boot (void) +{ + if (! grub_loader_loaded) + return grub_error (GRUB_ERR_NO_KERNEL, "no loaded kernel"); + + if (grub_loader_noreturn) + grub_machine_fini (); + + return (grub_loader_boot_func) (); +} + + +/* boot */ +static grub_err_t +grub_cmd_boot (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + return grub_loader_boot (); } +static grub_command_t cmd_boot; + GRUB_MOD_INIT(boot) { (void) mod; /* To stop warning. */ - grub_register_command ("boot", grub_cmd_boot, GRUB_COMMAND_FLAG_BOTH, - "boot", "Boot an operating system.", 0); + cmd_boot = + grub_register_command ("boot", grub_cmd_boot, + 0, "boot an operating system"); } GRUB_MOD_FINI(boot) { - grub_unregister_command ("boot"); + grub_unregister_command (cmd_boot); } diff --git a/commands/minicmd.c b/commands/minicmd.c index 071c889e1..5083291f4 100644 --- a/commands/minicmd.c +++ b/commands/minicmd.c @@ -1,7 +1,7 @@ /* minicmd.c - commands for the rescue mode */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2003,2005,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,15 +28,6 @@ #include #include -/* boot */ -static grub_err_t -grub_mini_cmd_boot (struct grub_command *cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char *argv[] __attribute__ ((unused))) -{ - return grub_loader_boot (); -} - /* cat FILE */ static grub_err_t grub_mini_cmd_cat (struct grub_command *cmd __attribute__ ((unused)), @@ -345,16 +336,13 @@ grub_mini_cmd_exit (struct grub_command *cmd __attribute__ ((unused)), return 0; } -static grub_command_t cmd_boot, cmd_cat, cmd_help, cmd_root; +static grub_command_t cmd_cat, cmd_help, cmd_root; static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit; GRUB_MOD_INIT(minicmd) { (void) mod; /* To stop warning. */ - cmd_boot = - grub_register_command ("boot", grub_mini_cmd_boot, - 0, "boot an operating system"); cmd_cat = grub_register_command ("cat", grub_mini_cmd_cat, "cat FILE", "show the contents of a file"); @@ -380,7 +368,6 @@ GRUB_MOD_INIT(minicmd) GRUB_MOD_FINI(minicmd) { - grub_unregister_command (cmd_boot); grub_unregister_command (cmd_cat); grub_unregister_command (cmd_help); grub_unregister_command (cmd_root); diff --git a/conf/common.rmk b/conf/common.rmk index 1e1b0986a..0e63da6d5 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -343,7 +343,12 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - pcpart.mod memrw.mod + pcpart.mod memrw.mod boot.mod + +# For boot.mod. +boot_mod_SOURCES = commands/boot.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index bf6fdd05f..f7cb58dd8 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -16,7 +16,7 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/i386/multiboot_mmap.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ @@ -73,7 +73,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/err.c kern/list.c kern/handler.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ + commands/boot.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/handler.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 4cdf0b5c5..fdb83b825 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -50,7 +50,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/err.c kern/list.c kern/handler.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ + commands/boot.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ normal/function.c \ @@ -87,7 +87,7 @@ pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ kernel_mod_EXPORTS = no kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 9bcf9f72b..cb41cce37 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -17,7 +17,7 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ @@ -73,7 +73,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/err.c kern/list.c kern/handler.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ + commands/boot.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ normal/function.c normal/handler.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index e885184b7..265b250d8 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -46,7 +46,7 @@ cdboot_img_FORMAT = binary # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/parser.c kern/partition.c \ @@ -132,7 +132,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/err.c kern/list.c kern/handler.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ + commands/boot.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ normal/function.c normal/handler.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index e35f7639b..d8d35d5d9 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -53,7 +53,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ + kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ @@ -81,7 +81,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index f5f9a8d61..029bca2c6 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -53,7 +53,7 @@ grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ # grub_script.tab.c \ # io/gzio.c \ # kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ -# kern/file.c kern/fs.c kern/loader.c kern/main.c kern/misc.c \ +# kern/file.c kern/fs.c commands/boot.c kern/main.c kern/misc.c \ # kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ # kern/list.c kern/handler.c \ # normal/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ @@ -73,7 +73,7 @@ grub_emu_LDFLAGS = $(LIBCURSES) kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ kern/main.c kern/device.c kern/disk.c kern/dl.c kern/file.c \ - kern/fs.c kern/err.c kern/misc.c kern/mm.c kern/loader.c \ + kern/fs.c kern/err.c kern/misc.c kern/mm.c \ kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index c2acaa5b7..d7ad9a4c8 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -52,7 +52,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/err.c kern/list.c kern/handler.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - kern/loader.c kern/main.c kern/misc.c kern/parser.c \ + commands/boot.c kern/main.c kern/misc.c kern/parser.c \ grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ normal/completion.c normal/datetime.c normal/context.c \ @@ -90,7 +90,7 @@ kernel_mod_EXPORTS = no kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/loader.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ diff --git a/include/grub/kernel.h b/include/grub/kernel.h index adaee5827..74aca400f 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -64,7 +64,7 @@ void grub_main (void); void grub_machine_init (void); /* The machine-specific finalization. */ -void grub_machine_fini (void); +void EXPORT_FUNC(grub_machine_fini) (void); /* The machine-specific prefix initialization. */ void grub_machine_set_prefix (void); diff --git a/include/grub/loader.h b/include/grub/loader.h index 1ae5fddbb..185d29773 100644 --- a/include/grub/loader.h +++ b/include/grub/loader.h @@ -1,7 +1,7 @@ /* loader.h - OS loaders */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -26,19 +26,19 @@ #include /* Check if a loader is loaded. */ -int EXPORT_FUNC(grub_loader_is_loaded) (void); +int grub_loader_is_loaded (void); /* Set loader functions. NORETURN must be set to true, if BOOT won't return to the original state. */ -void EXPORT_FUNC(grub_loader_set) (grub_err_t (*boot) (void), - grub_err_t (*unload) (void), - int noreturn); +void grub_loader_set (grub_err_t (*boot) (void), + grub_err_t (*unload) (void), + int noreturn); /* Unset current loader, if any. */ -void EXPORT_FUNC(grub_loader_unset) (void); +void grub_loader_unset (void); /* Call the boot hook in current loader. This may or may not return, depending on the setting by grub_loader_set. */ -grub_err_t EXPORT_FUNC(grub_loader_boot) (void); +grub_err_t grub_loader_boot (void); #endif /* ! GRUB_LOADER_HEADER */ From 596c6970b8938d6e06088764681ceffa1d36655f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 15 Apr 2009 13:29:24 +0000 Subject: [PATCH 0656/1707] 2009-04-15 Felix Zielcke * disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages, that no multiple data or metadata areas are supported and `Unknown metadata header'. --- ChangeLog | 6 ++++++ disk/lvm.c | 6 +++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 910529d36..02e89cda8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-15 Felix Zielcke + + * disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages, + that no multiple data or metadata areas are supported and `Unknown + metadata header'. + 2009-04-15 Vladimir Serbinenko Move loader out of the kernel diff --git a/disk/lvm.c b/disk/lvm.c index d47d4c7b5..9f6c197fe 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -263,7 +263,7 @@ grub_lvm_scan_device (const char *name) if (dlocn->offset) { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "We don't support multiple data areas"); + "We don't support multiple LVM data areas"); goto fail; } @@ -276,7 +276,7 @@ grub_lvm_scan_device (const char *name) if (dlocn->offset) { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "We don't support multiple metadata areas"); + "We don't support multiple LVM metadata areas"); goto fail; } @@ -296,7 +296,7 @@ grub_lvm_scan_device (const char *name) || (grub_le_to_cpu32 (mdah->version) != GRUB_LVM_FMTT_VERSION)) { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "Unknown metadata header"); + "Unknown LVM metadata header"); goto fail2; } From 6b4c4aa38be5b81725300111705be53589c7fff9 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 15 Apr 2009 16:39:02 +0000 Subject: [PATCH 0657/1707] removed kern/loader which should have been removed by my previous commit --- kern/loader.c | 75 --------------------------------------------------- 1 file changed, 75 deletions(-) delete mode 100644 kern/loader.c diff --git a/kern/loader.c b/kern/loader.c deleted file mode 100644 index 2b67d49b9..000000000 --- a/kern/loader.c +++ /dev/null @@ -1,75 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2006,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include - -static grub_err_t (*grub_loader_boot_func) (void); -static grub_err_t (*grub_loader_unload_func) (void); -static int grub_loader_noreturn; - -static int grub_loader_loaded; - -int -grub_loader_is_loaded (void) -{ - return grub_loader_loaded; -} - -void -grub_loader_set (grub_err_t (*boot) (void), - grub_err_t (*unload) (void), - int noreturn) -{ - if (grub_loader_loaded && grub_loader_unload_func) - grub_loader_unload_func (); - - grub_loader_boot_func = boot; - grub_loader_unload_func = unload; - grub_loader_noreturn = noreturn; - - grub_loader_loaded = 1; -} - -void -grub_loader_unset(void) -{ - if (grub_loader_loaded && grub_loader_unload_func) - grub_loader_unload_func (); - - grub_loader_boot_func = 0; - grub_loader_unload_func = 0; - - grub_loader_loaded = 0; -} - -grub_err_t -grub_loader_boot (void) -{ - if (! grub_loader_loaded) - return grub_error (GRUB_ERR_NO_KERNEL, "no loaded kernel"); - - if (grub_loader_noreturn) - grub_machine_fini (); - - return (grub_loader_boot_func) (); -} - From 41bb0fe9a6b1da0d7ede3ccd01c67e78a3fab1d8 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Apr 2009 20:45:09 +0000 Subject: [PATCH 0658/1707] 2009-04-15 Pavel Roskin * include/grub/types.h: Rename ULONG_MAX to GRUB_ULONG_MAX and LONG_MAX to GRUB_LONG_MAX. Introduce GRUB_LONG_MIN. Update all users of ULONG_MAX, LONG_MAX and LONG_MIN to use the new definitions. --- ChangeLog | 7 +++++++ disk/i386/pc/biosdisk.c | 2 +- disk/raid.c | 2 +- fs/fshelp.c | 2 +- include/grub/types.h | 10 ++++++---- kern/i386/coreboot/init.c | 8 ++++---- util/hostdisk.c | 4 ++-- 7 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02e89cda8..2c9b65757 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-15 Pavel Roskin + + * include/grub/types.h: Rename ULONG_MAX to GRUB_ULONG_MAX and + LONG_MAX to GRUB_LONG_MAX. Introduce GRUB_LONG_MIN. Update all + users of ULONG_MAX, LONG_MAX and LONG_MIN to use the new + definitions. + 2009-04-15 Felix Zielcke * disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages, diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index 120d46f25..ba1eb77b8 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -120,7 +120,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) { data->flags = GRUB_BIOSDISK_FLAG_LBA | GRUB_BIOSDISK_FLAG_CDROM; data->sectors = 32; - total_sectors = ULONG_MAX; /* TODO: get the correct size. */ + total_sectors = GRUB_ULONG_MAX; /* TODO: get the correct size. */ } else if (drive & 0x80) { diff --git a/disk/raid.c b/disk/raid.c index 4d6422236..2b3130b20 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -604,7 +604,7 @@ grub_raid_scan_device (int head_only) if (!disk) return 0; - if (disk->total_sectors == ULONG_MAX) + if (disk->total_sectors == GRUB_ULONG_MAX) { grub_disk_close (disk); return 0; diff --git a/fs/fshelp.c b/fs/fshelp.c index a5eccdd68..89b62387f 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -83,7 +83,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, if (filetype == GRUB_FSHELP_UNKNOWN || (grub_strcmp (name, filename) && (! (filetype & GRUB_FSHELP_CASE_INSENSITIVE) || - grub_strncasecmp (name, filename, LONG_MAX)))) + grub_strncasecmp (name, filename, GRUB_LONG_MAX)))) { grub_free (node); return 0; diff --git a/include/grub/types.h b/include/grub/types.h index 8d51b66f7..50f8f58d5 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -93,11 +93,13 @@ typedef grub_int32_t grub_ssize_t; #endif #if GRUB_CPU_SIZEOF_VOID_P == 8 -# define ULONG_MAX 18446744073709551615UL -# define LONG_MAX 9223372036854775807UL +# define GRUB_ULONG_MAX 18446744073709551615UL +# define GRUB_LONG_MAX 9223372036854775807UL +# define GRUB_LONG_MIN -9223372036854775808UL #else -# define ULONG_MAX 4294967295UL -# define LONG_MAX 2147483647UL +# define GRUB_ULONG_MAX 4294967295UL +# define GRUB_LONG_MAX 2147483647UL +# define GRUB_LONG_MIN -2147483648UL #endif /* The type for representing a file offset. */ diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 13484886d..fdaf6fd84 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -81,13 +81,13 @@ grub_machine_init (void) { #if GRUB_CPU_SIZEOF_VOID_P == 4 /* Restrict ourselves to 32-bit memory space. */ - if (addr > ULONG_MAX) + if (addr > GRUB_ULONG_MAX) { - grub_upper_mem = ULONG_MAX; + grub_upper_mem = GRUB_ULONG_MAX; return 0; } - if (addr + size > ULONG_MAX) - size = ULONG_MAX - addr; + if (addr + size > GRUB_ULONG_MAX) + size = GRUB_ULONG_MAX - addr; #endif grub_upper_mem = grub_max (grub_upper_mem, addr + size); diff --git a/util/hostdisk.c b/util/hostdisk.c index 2fd1010a2..aa41703fe 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -1004,7 +1004,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) p++; n = strtol (p, &q, 10); - if (p != q && n != LONG_MIN && n != LONG_MAX) + if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX) { dos_part = (int) n; @@ -1035,7 +1035,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) { p++; n = strtol (p, &q, 10); - if (p != q && n != LONG_MIN && n != LONG_MAX) + if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX) { dos_part = (int) n - 1; From a96df3f24919284dce306cdc447c4f10307c81dc Mon Sep 17 00:00:00 2001 From: bean Date: Thu, 16 Apr 2009 12:18:11 +0000 Subject: [PATCH 0659/1707] 2009-04-16 Bean * commands/efi/loadbios.c (grub_cmd_fakebios): Add missing return value. --- ChangeLog | 5 +++++ commands/efi/loadbios.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2c9b65757..0c5085459 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-16 Bean + + * commands/efi/loadbios.c (grub_cmd_fakebios): Add missing return + value. + 2009-04-15 Pavel Roskin * include/grub/types.h: Rename ULONG_MAX to GRUB_ULONG_MAX and diff --git a/commands/efi/loadbios.c b/commands/efi/loadbios.c index 0b57d1bee..a0f314931 100644 --- a/commands/efi/loadbios.c +++ b/commands/efi/loadbios.c @@ -146,6 +146,8 @@ grub_cmd_fakebios (struct grub_command *cmd __attribute__ ((unused)), } else fake_bios_data (0); + + return 0; } static grub_err_t From d1a282fc83f58a34b16f5034fda5b5083815d1b0 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 17 Apr 2009 15:36:41 +0000 Subject: [PATCH 0660/1707] 2009-04-17 Pavel Roskin * disk/ata.c (grub_ata_pciinit): Use NESTED_FUNC_ATTR. * bus/usb/ohci.c (grub_ohci_pci_iter): Likewise. * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. * commands/lspci.c (grub_lspci_iter): Likewise. --- ChangeLog | 7 +++++++ bus/usb/ohci.c | 5 +++-- bus/usb/uhci.c | 5 +++-- commands/lspci.c | 2 +- disk/ata.c | 2 +- 5 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c5085459..e99fdd53b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-17 Pavel Roskin + + * disk/ata.c (grub_ata_pciinit): Use NESTED_FUNC_ATTR. + * bus/usb/ohci.c (grub_ohci_pci_iter): Likewise. + * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + * commands/lspci.c (grub_lspci_iter): Likewise. + 2009-04-16 Bean * commands/efi/loadbios.c (grub_cmd_fakebios): Add missing return diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index d2e78d4c9..488754870 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -112,8 +112,9 @@ grub_ohci_writereg32 (struct grub_ohci *o, /* Iterate over all PCI devices. Determine if a device is an OHCI controller. If this is the case, initialize it. */ -static int grub_ohci_pci_iter (int bus, int device, int func, - grub_pci_id_t pciid __attribute__((unused))) +static int NESTED_FUNC_ATTR +grub_ohci_pci_iter (int bus, int device, int func, + grub_pci_id_t pciid __attribute__((unused))) { grub_uint32_t class; grub_uint32_t subclass; diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index c59c0ca7d..8406aed28 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -137,8 +137,9 @@ grub_uhci_portstatus (grub_usb_controller_t dev, /* Iterate over all PCI devices. Determine if a device is an UHCI controller. If this is the case, initialize it. */ -static int grub_uhci_pci_iter (int bus, int device, int func, - grub_pci_id_t pciid __attribute__((unused))) +static int NESTED_FUNC_ATTR +grub_uhci_pci_iter (int bus, int device, int func, + grub_pci_id_t pciid __attribute__((unused))) { grub_uint32_t class; grub_uint32_t subclass; diff --git a/commands/lspci.c b/commands/lspci.c index a084b42d7..36bc7608f 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -114,7 +114,7 @@ grub_pci_get_class (int class, int subclass) return 0; } -static int +static int NESTED_FUNC_ATTR grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) { grub_uint32_t class; diff --git a/disk/ata.c b/disk/ata.c index ed98b0b87..fe6372011 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -375,7 +375,7 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) return 0; } -static int +static int NESTED_FUNC_ATTR grub_ata_pciinit (int bus, int device, int func, grub_pci_id_t pciid __attribute__((unused))) { From e0ff912638f922f71b5623cfdb3aefcae6154b55 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 17 Apr 2009 16:08:24 +0000 Subject: [PATCH 0661/1707] 2009-04-17 Pavel Roskin * fs/i386/pc/pxe.c (grub_pxefs_dir): Fix function prototype to match struct grub_fs. --- ChangeLog | 3 +++ fs/i386/pc/pxe.c | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e99fdd53b..5b568037c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-04-17 Pavel Roskin + * fs/i386/pc/pxe.c (grub_pxefs_dir): Fix function prototype to + match struct grub_fs. + * disk/ata.c (grub_ata_pciinit): Use NESTED_FUNC_ATTR. * bus/usb/ohci.c (grub_ohci_pci_iter): Likewise. * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index e12ca18a5..f294b89fa 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -107,9 +107,9 @@ static struct grub_disk_dev grub_pxe_dev = }; static grub_err_t -grub_pxefs_dir (grub_device_t device __attribute((unused)), - const char *path __attribute((unused)), - int (*hook) (const char *filename, int dir) __attribute((unused))) +grub_pxefs_dir (grub_device_t device UNUSED, const char *path UNUSED, + int (*hook) (const char *filename, + const struct grub_dirhook_info *info) UNUSED) { return GRUB_ERR_NONE; } From 1bc09c352c0fffacd5c0b4f388ab9079109c5691 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 17 Apr 2009 16:35:26 +0000 Subject: [PATCH 0662/1707] 2009-04-17 Pavel Roskin * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Fix return without a value. Fix inconsistent indentation. --- ChangeLog | 3 +++ loader/multiboot_loader.c | 22 +++++++++++----------- 2 files changed, 14 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b568037c..d4468e1c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-04-17 Pavel Roskin + * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Fix + return without a value. Fix inconsistent indentation. + * fs/i386/pc/pxe.c (grub_pxefs_dir): Fix function prototype to match struct grub_fs. diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index f4a39330f..11ba666b1 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -131,36 +131,36 @@ grub_cmd_multiboot_loader (grub_command_t cmd __attribute__ ((unused)), goto fail; } - /* close file before calling functions */ - if (file) - grub_file_close (file); + /* close file before calling functions */ + if (file) + grub_file_close (file); - /* Launch multi boot with header */ + /* Launch multi boot with header */ - /* XXX Find a better way to identify this. - This is for i386-pc */ + /* XXX Find a better way to identify this. + This is for i386-pc */ #if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS) if (header_multi_ver_found == 1) { grub_dprintf ("multiboot_loader", - "Launching multiboot 1 grub_multiboot() function\n"); - grub_multiboot (argc, argv); + "Launching multiboot 1 grub_multiboot() function\n"); + grub_multiboot (argc, argv); module_version_status = 1; } #endif if (header_multi_ver_found == 0 || header_multi_ver_found == 2) { grub_dprintf ("multiboot_loader", - "Launching multiboot 2 grub_multiboot2() function\n"); + "Launching multiboot 2 grub_multiboot2() function\n"); grub_multiboot2 (argc, argv); module_version_status = 2; } - return; + return grub_errno; fail: if (file) - grub_file_close (file); + grub_file_close (file); grub_dl_unref (my_mod); From b012002d59c5ffcf0a9d3f2b38aa54a47603e6ec Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 17 Apr 2009 17:09:36 +0000 Subject: [PATCH 0663/1707] 2009-04-17 Pavel Roskin * bus/usb/usbtrans.c (grub_usb_control_msg): Warning fix. --- ChangeLog | 2 ++ bus/usb/usbtrans.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d4468e1c9..a13f0353e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-04-17 Pavel Roskin + * bus/usb/usbtrans.c (grub_usb_control_msg): Warning fix. + * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Fix return without a value. Fix inconsistent indentation. diff --git a/bus/usb/usbtrans.c b/bus/usb/usbtrans.c index 8b2d5ad01..fd8295741 100644 --- a/bus/usb/usbtrans.c +++ b/bus/usb/usbtrans.c @@ -36,7 +36,7 @@ grub_usb_control_msg (grub_usb_device_t dev, int datablocks; struct grub_usb_packet_setup setupdata; grub_usb_err_t err; - int max; + unsigned int max; grub_dprintf ("usb", "control: reqtype=0x%02x req=0x%02x val=0x%02x idx=0x%02x size=%d\n", From 07c5039fda726065d8462bb980254d9a44d81683 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 17 Apr 2009 17:23:34 +0000 Subject: [PATCH 0664/1707] 2009-04-17 Pavel Roskin * bus/usb/ohci.c (grub_ohci_transaction): Fix incorrect printf format. (grub_ohci_transfer): Likewise. --- ChangeLog | 4 ++++ bus/usb/ohci.c | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index a13f0353e..7fa2dbab1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-04-17 Pavel Roskin + * bus/usb/ohci.c (grub_ohci_transaction): Fix incorrect printf + format. + (grub_ohci_transfer): Likewise. + * bus/usb/usbtrans.c (grub_usb_control_msg): Warning fix. * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Fix diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index 488754870..6ffa84bc0 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -233,9 +233,9 @@ grub_ohci_transaction (grub_ohci_td_t td, grub_uint32_t buffer; grub_uint32_t buffer_end; - grub_dprintf ("ohci", "OHCI transaction td=0x%02x type=%d, toggle=%d, size=%d\n", - td, type, toggle, size); - + grub_dprintf ("ohci", "OHCI transaction td=%p type=%d, toggle=%d, size=%d\n", + td, type, toggle, size); + switch (type) { case GRUB_USB_TRANSFER_TYPE_SETUP: @@ -295,7 +295,7 @@ grub_ohci_transfer (grub_usb_controller_t dev, return GRUB_USB_ERR_INTERNAL; } - grub_dprintf ("ohci", "alloc=0x%08x\n", td_list); + grub_dprintf ("ohci", "alloc=%p\n", td_list); /* Setup all Transfer Descriptors. */ for (i = 0; i < transfer->transcnt; i++) From 0552ff9f8121033bc4f89e9b07f709e36644be54 Mon Sep 17 00:00:00 2001 From: davem Date: Sun, 19 Apr 2009 08:51:04 +0000 Subject: [PATCH 0665/1707] * loader/sparc64/ieee1275/linux.c: Include grub/command.h (grub_rescue_cmd_linux): Rename to... (grub_cmd_linux): and fix prototype. (grub_rescue_cmd_initrd): Rename to... (grub_cmd_initrd): and fix prototype. (cmd_linux, cmd_initrd): New. (GRUB_MOD_INIT(linux)): Use grub_register_command(). (GRUB_MOD_FINI(linux): Use grub_unregister_command(). --- ChangeLog | 11 +++++++++++ loader/sparc64/ieee1275/linux.c | 29 +++++++++++++++++++---------- 2 files changed, 30 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7fa2dbab1..a1d503c04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-04-19 David S. Miller + + * loader/sparc64/ieee1275/linux.c: Include grub/command.h + (grub_rescue_cmd_linux): Rename to... + (grub_cmd_linux): and fix prototype. + (grub_rescue_cmd_initrd): Rename to... + (grub_cmd_initrd): and fix prototype. + (cmd_linux, cmd_initrd): New. + (GRUB_MOD_INIT(linux)): Use grub_register_command(). + (GRUB_MOD_FINI(linux): Use grub_unregister_command(). + 2009-04-17 Pavel Roskin * bus/usb/ohci.c (grub_ohci_transaction): Fix incorrect printf diff --git a/loader/sparc64/ieee1275/linux.c b/loader/sparc64/ieee1275/linux.c index 4912b9775..4f5b3cee8 100644 --- a/loader/sparc64/ieee1275/linux.c +++ b/loader/sparc64/ieee1275/linux.c @@ -27,6 +27,7 @@ #include #include #include +#include static grub_dl_t my_mod; @@ -281,8 +282,9 @@ grub_linux_load64 (grub_elf_t elf) return grub_elf64_load (elf, offset_phdr, 0, 0); } -void -grub_rescue_cmd_linux (int argc, char *argv[]) +static grub_err_t +grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_elf_t elf = 0; @@ -360,10 +362,13 @@ out: initrd_addr = 0; loaded = 1; } + + return grub_errno; } -void -grub_rescue_cmd_initrd (int argc, char *argv[]) +static grub_err_t +grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) { grub_file_t file = 0; grub_ssize_t size; @@ -421,6 +426,8 @@ grub_rescue_cmd_initrd (int argc, char *argv[]) fail: if (file) grub_file_close (file); + + return grub_errno; } static void @@ -495,20 +502,22 @@ fetch_translations (void) } +static grub_command_t cmd_linux, cmd_initrd; + GRUB_MOD_INIT(linux) { determine_phys_base (); fetch_translations (); - grub_rescue_register_command ("linux", grub_rescue_cmd_linux, - "load a linux kernel"); - grub_rescue_register_command ("initrd", grub_rescue_cmd_initrd, - "load an initrd"); + cmd_linux = grub_register_command ("linux", grub_cmd_linux, + 0, "load a linux kernel"); + cmd_initrd = grub_register_command ("initrd", grub_cmd_initrd, + 0, "load an initrd"); my_mod = mod; } GRUB_MOD_FINI(linux) { - grub_rescue_unregister_command ("linux"); - grub_rescue_unregister_command ("initrd"); + grub_unregister_command (cmd_linux); + grub_unregister_command (cmd_initrd); } From c6c5219fb6958820e04f50c91da4e0385b376261 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 19 Apr 2009 14:49:43 +0000 Subject: [PATCH 0666/1707] 2009-04-19 Felix Zielcke * INSTALL: Replace `autogen.sh' with `./autogen.sh'. --- ChangeLog | 4 ++++ INSTALL | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a1d503c04..ec5d64938 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-19 Felix Zielcke + + * INSTALL: Replace `autogen.sh' with `./autogen.sh'. + 2009-04-19 David S. Miller * loader/sparc64/ieee1275/linux.c: Include grub/command.h diff --git a/INSTALL b/INSTALL index dbbdb6926..47d9295fc 100644 --- a/INSTALL +++ b/INSTALL @@ -50,9 +50,9 @@ Building the GRUB The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and - type `autogen.sh' and then `./configure' to configure the package - for your system. If you're using `csh' on an old version of - System V, you might need to type `sh ./configure' instead to + type `./autogen.sh' and then `./configure' to configure the + package for your system. If you're using `csh' on an old version + of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some From 0aefc632d914b24151cf1700d749e29059e18674 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 19 Apr 2009 20:38:46 +0000 Subject: [PATCH 0667/1707] 2009-04-19 Vladimir Serbinenko Correct GPT definition * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type of "attrib" member --- ChangeLog | 7 +++++++ include/grub/gpt_partition.h | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ec5d64938..ca0ab43ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-19 Vladimir Serbinenko + + Correct GPT definition + + * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type + of "attrib" member + 2009-04-19 Felix Zielcke * INSTALL: Replace `autogen.sh' with `./autogen.sh'. diff --git a/include/grub/gpt_partition.h b/include/grub/gpt_partition.h index 0244530f7..428ceb166 100644 --- a/include/grub/gpt_partition.h +++ b/include/grub/gpt_partition.h @@ -64,7 +64,7 @@ struct grub_gpt_partentry grub_uint8_t guid[16]; grub_uint64_t start; grub_uint64_t end; - grub_uint8_t attrib; + grub_uint64_t attrib; char name[72]; } __attribute__ ((packed)); From f01005a8327daaed74509d411d62d77945f675e4 Mon Sep 17 00:00:00 2001 From: davem Date: Wed, 22 Apr 2009 09:45:43 +0000 Subject: [PATCH 0668/1707] * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): If size_cells is larger than address_cells, use that value for address_cells too. --- ChangeLog | 5 +++++ kern/ieee1275/mmap.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index ca0ab43ed..631118fc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-22 David S. Miller + + * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): If size_cells + is larger than address_cells, use that value for address_cells too. + 2009-04-19 Vladimir Serbinenko Correct GPT definition diff --git a/kern/ieee1275/mmap.c b/kern/ieee1275/mmap.c index 5b30dbb9e..317a12117 100644 --- a/kern/ieee1275/mmap.c +++ b/kern/ieee1275/mmap.c @@ -38,6 +38,9 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uin grub_ieee1275_get_integer_property (root, "#size-cells", &size_cells, sizeof size_cells, 0); + if (size_cells > address_cells) + address_cells = size_cells; + /* Load `/memory/available'. */ if (grub_ieee1275_finddevice ("/memory", &memory)) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, From 4e8269dad2c54d94776fb7d94c27511c3c5dd9b4 Mon Sep 17 00:00:00 2001 From: davem Date: Wed, 22 Apr 2009 09:46:54 +0000 Subject: [PATCH 0669/1707] * include/grub/ieee1275/ieee1275.h (IEEE1275_MAX_PROP_LEN, IEEE1275_MAX_PATH_LEN): Define. * kern/ieee1275/openfw.c (grub_children_iterate): Dynamically allocate 'childtype', 'childpath', 'childname', and 'fullname'. (grub_devalias_iterate): Dynamically allocate 'aliasname' and 'devtype'. Explicitly NULL terminate devalias expansion. --- ChangeLog | 7 ++++ include/grub/ieee1275/ieee1275.h | 3 ++ kern/ieee1275/openfw.c | 64 +++++++++++++++++++++++++++----- 3 files changed, 65 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 631118fc5..0dcc3c275 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,13 @@ * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): If size_cells is larger than address_cells, use that value for address_cells too. + * include/grub/ieee1275/ieee1275.h (IEEE1275_MAX_PROP_LEN, + IEEE1275_MAX_PATH_LEN): Define. + * kern/ieee1275/openfw.c (grub_children_iterate): Dynamically + allocate 'childtype', 'childpath', 'childname', and 'fullname'. + (grub_devalias_iterate): Dynamically allocate 'aliasname' and + 'devtype'. Explicitly NULL terminate devalias expansion. + 2009-04-19 Vladimir Serbinenko Correct GPT definition diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 3b5139e7c..ed02f5214 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -39,6 +39,9 @@ struct grub_ieee1275_mem_region unsigned int size; }; +#define IEEE1275_MAX_PROP_LEN 8192 +#define IEEE1275_MAX_PATH_LEN 256 + #ifndef IEEE1275_CALL_ENTRY_FN #define IEEE1275_CALL_ENTRY_FN(args) (*grub_ieee1275_entry_fn) (args) #endif diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index d70c3ba65..83bac6504 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -38,6 +38,8 @@ grub_children_iterate (char *devpath, { grub_ieee1275_phandle_t dev; grub_ieee1275_phandle_t child; + char *childtype, *childpath; + char *childname, *fullname; if (grub_ieee1275_finddevice (devpath, &dev)) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown device"); @@ -45,13 +47,33 @@ grub_children_iterate (char *devpath, if (grub_ieee1275_child (dev, &child)) return grub_error (GRUB_ERR_BAD_DEVICE, "Device has no children"); + childtype = grub_malloc (IEEE1275_MAX_PROP_LEN); + if (!childtype) + return grub_errno; + childpath = grub_malloc (IEEE1275_MAX_PATH_LEN); + if (!childpath) + { + grub_free (childtype); + return grub_errno; + } + childname = grub_malloc (IEEE1275_MAX_PROP_LEN); + if (!childname) + { + grub_free (childpath); + grub_free (childtype); + return grub_errno; + } + fullname = grub_malloc (IEEE1275_MAX_PATH_LEN); + if (!fullname) + { + grub_free (childname); + grub_free (childpath); + grub_free (childtype); + return grub_errno; + } + do { - /* XXX: Don't use hardcoded path lengths. */ - char childtype[64]; - char childpath[64]; - char childname[64]; - char fullname[64]; struct grub_ieee1275_devalias alias; grub_ssize_t actual; @@ -76,6 +98,11 @@ grub_children_iterate (char *devpath, } while (grub_ieee1275_peer (child, &child)); + grub_free (fullname); + grub_free (childname); + grub_free (childpath); + grub_free (childtype); + return 0; } @@ -85,13 +112,23 @@ grub_err_t grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) { grub_ieee1275_phandle_t aliases; - char aliasname[32]; + char *aliasname, *devtype; grub_ssize_t actual; struct grub_ieee1275_devalias alias; if (grub_ieee1275_finddevice ("/aliases", &aliases)) return -1; + aliasname = grub_malloc (IEEE1275_MAX_PROP_LEN); + if (!aliasname) + return grub_errno; + devtype = grub_malloc (IEEE1275_MAX_PROP_LEN); + if (!devtype) + { + grub_free (aliasname); + return grub_errno; + } + /* Find the first property. */ aliasname[0] = '\0'; @@ -100,8 +137,6 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) grub_ieee1275_phandle_t dev; grub_ssize_t pathlen; char *devpath; - /* XXX: This should be large enough for any possible case. */ - char devtype[64]; grub_dprintf ("devalias", "devalias name = %s\n", aliasname); @@ -111,9 +146,17 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) if (!grub_strcmp (aliasname, "name")) continue; + /* Sun's OpenBoot often doesn't zero terminate the device alias + strings, so we will add a NULL byte at the end explicitly. */ + pathlen += 1; + devpath = grub_malloc (pathlen); if (! devpath) - return grub_errno; + { + grub_free (devtype); + grub_free (aliasname); + return grub_errno; + } if (grub_ieee1275_get_property (aliases, aliasname, devpath, pathlen, &actual)) @@ -121,6 +164,7 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) grub_dprintf ("devalias", "get_property (%s) failed\n", aliasname); goto nextprop; } + devpath [actual] = '\0'; if (grub_ieee1275_finddevice (devpath, &dev)) { @@ -144,6 +188,8 @@ nextprop: grub_free (devpath); } + grub_free (devtype); + grub_free (aliasname); return 0; } From a1447506fef49af92b86ea67ea78a3241425178e Mon Sep 17 00:00:00 2001 From: davem Date: Wed, 22 Apr 2009 09:57:39 +0000 Subject: [PATCH 0670/1707] * util/sparc64/ieee1275/misc.c: New file. * util/sparc64/ieee1275/grub-setup.c: New file. * util/sparc64/ieee1275/grub-ofpathname.c: New file. * util/sparc64/ieee1275/grub-mkimage.c: New file. * util/sparc64/ieee1275/grub-install.in: New file. * util/ieee1275/ofpath.c: New file. * util/ieee1275/devicemap.c: New file. * util/devicemap.c: New file. * util/deviceiter.c: New file. * kern/sparc64/ieee1275/init.c: New file. * include/grub/util/ofpath.h: New file. * include/grub/util/deviceiter.h: New file. * util/grub-mkdevicemap.c: Include deviceiter.h. Implement using grub_util_emit_devicemap_entry and grub_util_iterate_devices. * conf/i386-corebook.rmk: Build util/deviceiter.c and util/devicemap.c into grub-mkdevicemap * conf/i386-efi.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Add rules to build boot block images and installation utilities. Build kernel as image instead of as elf binary. Use common rules as much as possible. --- ChangeLog | 25 + conf/i386-coreboot.rmk | 3 +- conf/i386-efi.rmk | 3 +- conf/i386-ieee1275.rmk | 3 +- conf/i386-pc.rmk | 3 +- conf/powerpc-ieee1275.rmk | 3 +- conf/sparc64-ieee1275.rmk | 366 +++++--------- include/grub/util/deviceiter.h | 11 + include/grub/util/ofpath.h | 6 + kern/sparc64/ieee1275/init.c | 161 ++++++ util/deviceiter.c | 621 +++++++++++++++++++++++ util/devicemap.c | 13 + util/grub-mkdevicemap.c | 593 +--------------------- util/ieee1275/devicemap.c | 13 + util/ieee1275/ofpath.c | 415 ++++++++++++++++ util/sparc64/ieee1275/grub-install.in | 276 +++++++++++ util/sparc64/ieee1275/grub-mkimage.c | 294 +++++++++++ util/sparc64/ieee1275/grub-ofpathname.c | 39 ++ util/sparc64/ieee1275/grub-setup.c | 625 ++++++++++++++++++++++++ util/sparc64/ieee1275/misc.c | 33 ++ 20 files changed, 2689 insertions(+), 817 deletions(-) create mode 100644 include/grub/util/deviceiter.h create mode 100644 include/grub/util/ofpath.h create mode 100644 kern/sparc64/ieee1275/init.c create mode 100644 util/deviceiter.c create mode 100644 util/devicemap.c create mode 100644 util/ieee1275/devicemap.c create mode 100644 util/ieee1275/ofpath.c create mode 100644 util/sparc64/ieee1275/grub-install.in create mode 100644 util/sparc64/ieee1275/grub-mkimage.c create mode 100644 util/sparc64/ieee1275/grub-ofpathname.c create mode 100644 util/sparc64/ieee1275/grub-setup.c create mode 100644 util/sparc64/ieee1275/misc.c diff --git a/ChangeLog b/ChangeLog index 0dcc3c275..0d4097c4d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,6 +10,31 @@ (grub_devalias_iterate): Dynamically allocate 'aliasname' and 'devtype'. Explicitly NULL terminate devalias expansion. + * util/sparc64/ieee1275/misc.c: New file. + * util/sparc64/ieee1275/grub-setup.c: New file. + * util/sparc64/ieee1275/grub-ofpathname.c: New file. + * util/sparc64/ieee1275/grub-mkimage.c: New file. + * util/sparc64/ieee1275/grub-install.in: New file. + * util/ieee1275/ofpath.c: New file. + * util/ieee1275/devicemap.c: New file. + * util/devicemap.c: New file. + * util/deviceiter.c: New file. + * kern/sparc64/ieee1275/init.c: New file. + * include/grub/util/ofpath.h: New file. + * include/grub/util/deviceiter.h: New file. + * util/grub-mkdevicemap.c: Include deviceiter.h. + Implement using grub_util_emit_devicemap_entry and + grub_util_iterate_devices. + * conf/i386-corebook.rmk: Build util/deviceiter.c and + util/devicemap.c into grub-mkdevicemap + * conf/i386-efi.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-pc.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Add rules to build boot block + images and installation utilities. Build kernel as image + instead of as elf binary. Use common rules as much as possible. + 2009-04-19 Vladimir Serbinenko Correct GPT definition diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index f7cb58dd8..1284fe4ca 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -51,7 +51,8 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ + util/devicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index fdb83b825..717683b3a 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -28,7 +28,8 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ + util/devicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index cb41cce37..cb32c73c5 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -50,7 +50,8 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ + util/devicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 265b250d8..d74a5fabf 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -114,7 +114,8 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ grub_setup_init.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ + util/devicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index d8d35d5d9..84f91d897 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -35,7 +35,8 @@ sbin_UTILITIES += grub-emu endif # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ + util/devicemap.c util/misc.c # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 029bca2c6..e1929d1e3 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -1,162 +1,156 @@ # -*- makefile -*- -COMMON_ASFLAGS = -nostdinc -COMMON_CFLAGS = -ggdb -ffreestanding -m64 -mno-app-regs -COMMON_LDFLAGS = -melf64_sparc -nostdlib +COMMON_ASFLAGS = -nostdinc -m64 +COMMON_CFLAGS = -ffreestanding -m64 -mno-app-regs +COMMON_LDFLAGS = -melf64_sparc -nostdlib -mno-relax # Used by various components. These rules need to precede them. normal/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. +pkglib_IMAGES = boot.img diskboot.img kernel.img + +# For boot.img. +boot_img_SOURCES = boot/sparc64/ieee1275/boot.S +boot_img_ASFLAGS = $(COMMON_ASFLAGS) +boot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,0x4000 +boot_img_FORMAT = a.out-sunos-big + +# For diskboot.img. +diskboot_img_SOURCES = boot/sparc64/ieee1275/diskboot.S +diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) +diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-Ttext,0x4200 +diskboot_img_FORMAT = binary MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -kernel_elf_HEADERS = arg.h boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ - symbol.h term.h time.h types.h sparc64/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h +kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ + env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ + partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + list.h handler.h command.h \ + sparc64/libgcc.h ieee1275/ieee1275.h machine/kernel.h \ + sparc64/ieee1275/ieee1275.h +kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \ + kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ + kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ + kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ + kern/sparc64/ieee1275/ieee1275.c \ + kern/sparc64/ieee1275/init.c \ + kern/ieee1275/mmap.c \ + term/ieee1275/ofconsole.c \ + kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ + kern/parser.c kern/partition.c kern/env.c kern/sparc64/dl.c \ + kern/generic/millisleep.c kern/time.c \ + symlist.c kern/sparc64/cache.S +kernel_img_CFLAGS = $(COMMON_CFLAGS) +kernel_img_ASFLAGS = $(COMMON_ASFLAGS) +kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc +kernel_img_FORMAT = binary -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# For the parser. -grub_script.tab.c grub_script.tab.h: normal/parser.y - $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y - -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# Programs -pkglib_PROGRAMS = kernel.elf - # Utilities. -#bin_UTILITIES = grub-mkimage -#ifeq ($(enable_grub_emu), yes) -#bin_UTILITIES += grub-emu -#endif +bin_UTILITIES = grub-mkimage +sbin_UTILITIES = grub-setup grub-mkdevicemap grub-ofpathname +ifeq ($(enable_grub_emu), yes) +sbin_UTILITIES += grub-emu +endif # For grub-mkimage. grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ util/resolve.c +# For grub-setup. +util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h +grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ + util/misc.c util/getroot.c kern/device.c kern/disk.c \ + kern/err.c kern/misc.c kern/parser.c kern/partition.c \ + kern/file.c kern/fs.c kern/env.c fs/fshelp.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + \ + partmap/amiga.c partmap/apple.c partmap/pc.c \ + partmap/sun.c partmap/acorn.c \ + \ + disk/raid.c disk/mdraid_linux.c disk/lvm.c \ + util/raid.c util/lvm.c \ + grub_setup_init.c + +# For grub-mkdevicemap. +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ + util/ieee1275/ofpath.c util/ieee1275/devicemap.c util/misc.c + +# For grub-ofpathname. +grub_ofpathname_SOURCES = util/sparc64/ieee1275/grub-ofpathname.c \ + util/ieee1275/ofpath.c util/misc.c + # For grub-emu -#grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ -# commands/configfile.c commands/default.c commands/help.c \ -# commands/search.c commands/terminal.c commands/ls.c \ -# commands/timeout.c commands/test.c \ -# commands/halt.c commands/reboot.c \ -# disk/loopback.c \ -# fs/affs.c fs/fat.c fs/ext2.c fs/fshelp.c fs/hfs.c fs/iso9660.c \ -# fs/jfs.c fs/minix.c fs/sfs.c fs/ufs.c fs/xfs.c \ -# grub_script.tab.c \ -# io/gzio.c \ -# kern/device.c kern/disk.c kern/dl.c kern/env.c kern/err.c \ -# kern/file.c kern/fs.c commands/boot.c kern/main.c kern/misc.c \ -# kern/parser.c kern/partition.c kern/rescue.c kern/term.c \ -# kern/list.c kern/handler.c \ -# normal/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ -# normal/completion.c normal/context.c normal/execute.c \ -# normal/function.c normal/lexer.c \ -# normal/main.c normal/menu.c normal/menu_entry.c \ -# normal/menu_text.c \ -# normal/menu_viewer.c normal/misc.c \ -# partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ -# partmap/acorn.c \ -# util/console.c util/grub-emu.c util/misc.c \ -# util/hostdisk.c util/getroot.c \ -# commands/parttool.c parttool/pcpart.c \ -# util/sparc64/ieee1275/misc.c +util/grub-emu.c_DEPENDENCIES = grub_emu_init.h +grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ + commands/configfile.c commands/help.c \ + commands/search.c commands/handler.c commands/test.c \ + commands/ls.c commands/blocklist.c commands/hexdump.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ + disk/loopback.c \ + \ + fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ + fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + \ + io/gzio.c \ + kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ + kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ + kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ + kern/term.c fs/fshelp.c \ + kern/list.c kern/handler.c \ + lib/arg.c normal/cmdline.c normal/command.c \ + normal/completion.c normal/execute.c \ + normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + normal/menu_text.c \ + normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ + normal/script.c \ + normal/color.c \ + partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/acorn.c \ + util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ + util/hostdisk.c util/getroot.c \ + util/sparc64/ieee1275/misc.c \ + \ + disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ + disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + grub_script.tab.c grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) -kernel_elf_SOURCES = kern/sparc64/ieee1275/init.c kern/ieee1275/ieee1275.c \ - kern/main.c kern/device.c kern/disk.c kern/dl.c kern/file.c \ - kern/fs.c kern/err.c kern/misc.c kern/mm.c \ - kern/rescue.c kern/term.c term/ieee1275/ofconsole.c \ - kern/sparc64/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ - kern/partition.c kern/env.c kern/sparc64/dl.c symlist.c \ - kern/generic/millisleep.c kern/generic/get_time_ms.c \ - kern/sparc64/cache.S kern/parser.c -kernel_elf_HEADERS = grub/sparc64/ieee1275/ieee1275.h -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc +# Scripts. +sbin_SCRIPTS = grub-install + +# For grub-install. +grub_install_SOURCES = util/sparc64/ieee1275/grub-install.in # Modules. -#_linux.mod linux.mod -pkglib_MODULES = fat.mod ufs.mod ext2.mod minix.mod \ - hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \ - boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ - pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ - configfile.mod search.mod gzio.mod xfs.mod \ - affs.mod sfs.mod acorn.mod +pkglib_MODULES = halt.mod \ + linux.mod \ + normal.mod \ + reboot.mod \ + memdisk.mod \ + lsmmap.mod -# For fshelp.mod. -fshelp_mod_SOURCES = fs/fshelp.c -fshelp_mod_CFLAGS = $(COMMON_CFLAGS) -fshelp_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fat.mod. -fat_mod_SOURCES = fs/fat.c -fat_mod_CFLAGS = $(COMMON_CFLAGS) -fat_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ext2.mod. -ext2_mod_SOURCES = fs/ext2.c -ext2_mod_CFLAGS = $(COMMON_CFLAGS) -ext2_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ufs.mod. -ufs_mod_SOURCES = fs/ufs.c -ufs_mod_CFLAGS = $(COMMON_CFLAGS) -ufs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For minix.mod. -minix_mod_SOURCES = fs/minix.c -minix_mod_CFLAGS = $(COMMON_CFLAGS) -minix_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For hfs.mod. -hfs_mod_SOURCES = fs/hfs.c -hfs_mod_CFLAGS = $(COMMON_CFLAGS) -hfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For jfs.mod. -jfs_mod_SOURCES = fs/jfs.c -jfs_mod_CFLAGS = $(COMMON_CFLAGS) -jfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For iso9660.mod. -iso9660_mod_SOURCES = fs/iso9660.c -iso9660_mod_CFLAGS = $(COMMON_CFLAGS) -iso9660_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For xfs.mod. -xfs_mod_SOURCES = fs/xfs.c -xfs_mod_CFLAGS = $(COMMON_CFLAGS) -xfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For affs.mod. -affs_mod_SOURCES = fs/affs.c -affs_mod_CFLAGS = $(COMMON_CFLAGS) -affs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sfs.mod. -sfs_mod_SOURCES = fs/sfs.c -sfs_mod_CFLAGS = $(COMMON_CFLAGS) -sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For _linux.mod. -#_linux_mod_SOURCES = loader/sparc64/ieee1275/linux.c -#_linux_mod_CFLAGS = $(COMMON_CFLAGS) -#_linux_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For linux.mod. -#linux_mod_SOURCES = loader/sparc64/ieee1275/linux_normal.c -#linux_mod_CFLAGS = $(COMMON_CFLAGS) -#linux_mod_LDFLAGS = $(COMMON_LDFLAGS) +linux_mod_SOURCES = loader/sparc64/ieee1275/linux.c +linux_mod_CFLAGS = $(COMMON_CFLAGS) +linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # # Only arch dependant part of normal.mod will be here. Common part for @@ -166,7 +160,7 @@ sfs_mod_LDFLAGS = $(COMMON_LDFLAGS) # Please put arch dependant part of normal.mod at the end of list to # keep it simpler to update to different architectures. # -normal_mod_SOURCES = normal/arg.c normal/cmdline.c normal/command.c \ +normal_mod_SOURCES = lib/arg.c normal/cmdline.c normal/command.c \ normal/datetime.c normal/completion.c normal/execute.c \ normal/function.c normal/lexer.c normal/main.c normal/menu.c \ normal/handler.c normal/menu_text.c \ @@ -179,116 +173,24 @@ normal_mod_CFLAGS = $(COMMON_CFLAGS) normal_mod_ASFLAGS = $(COMMON_ASFLAGS) normal_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For hello.mod. -hello_mod_SOURCES = hello/hello.c -hello_mod_CFLAGS = $(COMMON_CFLAGS) -hello_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For boot.mod. -boot_mod_SOURCES = commands/boot.c -boot_mod_CFLAGS = $(COMMON_CFLAGS) -boot_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For terminal.mod. -terminal_mod_SOURCES = commands/terminal.c -terminal_mod_CFLAGS = $(COMMON_CFLAGS) -terminal_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For ls.mod. -ls_mod_SOURCES = commands/ls.c -ls_mod_CFLAGS = $(COMMON_CFLAGS) -ls_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For cmp.mod. -cmp_mod_SOURCES = commands/cmp.c -cmp_mod_CFLAGS = $(COMMON_CFLAGS) -cmp_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For cat.mod. -cat_mod_SOURCES = commands/cat.c -cat_mod_CFLAGS = $(COMMON_CFLAGS) -cat_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For font.mod. -font_mod_SOURCES = font/manager.c -font_mod_CFLAGS = $(COMMON_CFLAGS) -font_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For amiga.mod -amiga_mod_SOURCES = partmap/amiga.c -amiga_mod_CFLAGS = $(COMMON_CFLAGS) -amiga_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For apple.mod -apple_mod_SOURCES = partmap/apple.c -apple_mod_CFLAGS = $(COMMON_CFLAGS) -apple_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For pc.mod -pc_mod_SOURCES = partmap/pc.c -pc_mod_CFLAGS = $(COMMON_CFLAGS) -pc_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For sun.mod -sun_mod_SOURCES = partmap/sun.c -sun_mod_CFLAGS = $(COMMON_CFLAGS) -sun_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For acorn.mod -acorn_mod_SOURCES = partmap/acorn.c -acorn_mod_CFLAGS = $(COMMON_CFLAGS) - -# For loopback.mod -loopback_mod_SOURCES = disk/loopback.c -loopback_mod_CFLAGS = $(COMMON_CFLAGS) -loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For suspend.mod -suspend_mod_SOURCES = commands/ieee1275/suspend.c -suspend_mod_CFLAGS = $(COMMON_CFLAGS) -suspend_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For reboot.mod +# For reboot.mod. reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) reboot_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For halt.mod +# For halt.mod. halt_mod_SOURCES = commands/halt.c halt_mod_CFLAGS = $(COMMON_CFLAGS) halt_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For help.mod. -help_mod_SOURCES = commands/help.c -help_mod_CFLAGS = $(COMMON_CFLAGS) -help_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For memdisk.mod. +memdisk_mod_SOURCES = disk/memdisk.c +memdisk_mod_CFLAGS = $(COMMON_CFLAGS) +memdisk_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For default.mod -default_mod_SOURCES = commands/default.c -default_mod_CFLAGS = $(COMMON_CFLAGS) -default_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lsmmap.mod +lsmmap_mod_SOURCES = commands/lsmmap.c +lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) +lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For timeout.mod -timeout_mod_SOURCES = commands/timeout.c -timeout_mod_CFLAGS = $(COMMON_CFLAGS) -timeout_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For configfile.mod -configfile_mod_SOURCES = commands/configfile.c -configfile_mod_CFLAGS = $(COMMON_CFLAGS) -configfile_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For search.mod. -search_mod_SOURCES = commands/search.c -search_mod_CFLAGS = $(COMMON_CFLAGS) -search_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For gzio.mod. -gzio_mod_SOURCES = io/gzio.c -gzio_mod_CFLAGS = $(COMMON_CFLAGS) -gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For test.mod. -test_mod_SOURCES = commands/test.c -test_mod_CFLAGS = $(COMMON_CFLAGS) -test_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/common.mk diff --git a/include/grub/util/deviceiter.h b/include/grub/util/deviceiter.h new file mode 100644 index 000000000..a8af03cfe --- /dev/null +++ b/include/grub/util/deviceiter.h @@ -0,0 +1,11 @@ +#ifndef GRUB_DEVICEITER_MACHINE_UTIL_HEADER +#define GRUB_DEVICEITER_MACHINE_UTIL_HEADER 1 + +#include + +void grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), + int floppy_disks); +void grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy, + int *num_fd, int *num_hd); + +#endif /* ! GRUB_DEVICEITER_MACHINE_UTIL_HEADER */ diff --git a/include/grub/util/ofpath.h b/include/grub/util/ofpath.h new file mode 100644 index 000000000..78f24d784 --- /dev/null +++ b/include/grub/util/ofpath.h @@ -0,0 +1,6 @@ +#ifndef GRUB_OFPATH_MACHINE_UTIL_HEADER +#define GRUB_OFPATH_MACHINE_UTIL_HEADER 1 + +char *grub_util_devname_to_ofpath (char *devname); + +#endif /* ! GRUB_OFPATH_MACHINE_UTIL_HEADER */ diff --git a/kern/sparc64/ieee1275/init.c b/kern/sparc64/ieee1275/init.c new file mode 100644 index 000000000..5114f7694 --- /dev/null +++ b/kern/sparc64/ieee1275/init.c @@ -0,0 +1,161 @@ +/* init.c -- Initialize GRUB on SPARC64. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +void +grub_exit (void) +{ + grub_ieee1275_exit (); +} + +static grub_uint64_t +ieee1275_get_time_ms (void) +{ + grub_uint32_t msecs = 0; + + grub_ieee1275_milliseconds (&msecs); + + return msecs; +} + +grub_uint32_t +grub_get_rtc (void) +{ + return ieee1275_get_time_ms (); +} + +grub_addr_t +grub_arch_modules_addr (void) +{ + extern char _end[]; + return (grub_addr_t) _end; +} + +void +grub_machine_set_prefix (void) +{ + if (grub_prefix[0] != '(') + { + char bootpath[IEEE1275_MAX_PATH_LEN]; + grub_ssize_t actual; + char *prefix, *path; + + if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", + &bootpath, sizeof (bootpath), &actual)) + { + /* Should never happen. */ + grub_printf ("/chosen/bootpath property missing!\n"); + grub_env_set ("prefix", ""); + return; + } + + /* Transform an OF device path to a GRUB path. */ + prefix = grub_ieee1275_encode_devname (bootpath); + + path = grub_malloc (grub_strlen (grub_prefix) + + grub_strlen (prefix) + + 2); + grub_sprintf(path, "%s%s", prefix, grub_prefix); + + grub_strcpy (grub_prefix, path); + + grub_free (path); + grub_free (prefix); + } + + grub_env_set ("prefix", grub_prefix); +} + +static void +grub_heap_init (void) +{ + grub_mm_init_region ((void *)(long)0x4000UL, 0x200000 - 0x4000); +} + +static void +grub_parse_cmdline (void) +{ + grub_ssize_t actual; + char args[256]; + + if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootargs", &args, + sizeof args, &actual) == 0 + && actual > 1) + { + int i = 0; + + while (i < actual) + { + char *command = &args[i]; + char *end; + char *val; + + end = grub_strchr (command, ';'); + if (end == 0) + i = actual; /* No more commands after this one. */ + else + { + *end = '\0'; + i += end - command + 1; + while (grub_isspace(args[i])) + i++; + } + + /* Process command. */ + val = grub_strchr (command, '='); + if (val) + { + *val = '\0'; + grub_env_set (command, val + 1); + } + } + } +} + +void +grub_machine_init (void) +{ + grub_ieee1275_init (); + grub_console_init (); + grub_heap_init (); + + grub_ieee1275_set_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0); + grub_ofdisk_init (); + + grub_parse_cmdline (); + grub_install_get_time_ms (ieee1275_get_time_ms); +} + +void +grub_machine_fini (void) +{ + grub_ofdisk_fini (); + grub_console_fini (); +} diff --git a/util/deviceiter.c b/util/deviceiter.c new file mode 100644 index 000000000..a36ad3122 --- /dev/null +++ b/util/deviceiter.c @@ -0,0 +1,621 @@ +/* deviceiter.c - iterate over system devices */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include + +#ifdef __linux__ +# if !defined(__GLIBC__) || \ + ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) +/* Maybe libc doesn't have large file support. */ +# include /* _llseek */ +# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ +# include /* ioctl */ +# ifndef HDIO_GETGEO +# define HDIO_GETGEO 0x0301 /* get device geometry */ +/* If HDIO_GETGEO is not defined, it is unlikely that hd_geometry is + defined. */ +struct hd_geometry +{ + unsigned char heads; + unsigned char sectors; + unsigned short cylinders; + unsigned long start; +}; +# endif /* ! HDIO_GETGEO */ +# ifndef FLOPPY_MAJOR +# define FLOPPY_MAJOR 2 /* the major number for floppy */ +# endif /* ! FLOPPY_MAJOR */ +# ifndef MAJOR +# define MAJOR(dev) \ + ({ \ + unsigned long long __dev = (dev); \ + (unsigned) ((__dev >> 8) & 0xfff) \ + | ((unsigned int) (__dev >> 32) & ~0xfff); \ + }) +# endif /* ! MAJOR */ +# ifndef CDROM_GET_CAPABILITY +# define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ +# endif /* ! CDROM_GET_CAPABILITY */ +# ifndef BLKGETSIZE +# define BLKGETSIZE _IO(0x12,96) /* return device size */ +# endif /* ! BLKGETSIZE */ +#endif /* __linux__ */ + +/* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with + kFreeBSD-based non-FreeBSD systems (e.g. GNU/kFreeBSD) */ +#if defined(__FreeBSD__) && ! defined(__FreeBSD_kernel__) +# define __FreeBSD_kernel__ +#endif +#ifdef __FreeBSD_kernel__ + /* Obtain version of kFreeBSD headers */ +# include +# ifndef __FreeBSD_kernel_version +# define __FreeBSD_kernel_version __FreeBSD_version +# endif + + /* Runtime detection of kernel */ +# include +int +get_kfreebsd_version (void) +{ + struct utsname uts; + int major; + int minor; + int v[2]; + + uname (&uts); + sscanf (uts.release, "%d.%d", &major, &minor); + + if (major >= 9) + major = 9; + if (major >= 5) + { + v[0] = minor/10; v[1] = minor%10; + } + else + { + v[0] = minor%10; v[1] = minor/10; + } + return major*100000+v[0]*10000+v[1]*1000; +} +#endif /* __FreeBSD_kernel__ */ + +#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) +# include /* ioctl */ +# include +# include /* CDIOCCLRDEBUG */ +# if defined(__FreeBSD_kernel__) +# include +# if __FreeBSD_kernel_version >= 500040 +# include +# endif +# endif /* __FreeBSD_kernel__ */ +#endif /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ */ + +#ifdef HAVE_OPENDISK +# include +#endif /* HAVE_OPENDISK */ + +#ifdef __linux__ +/* Check if we have devfs support. */ +static int +have_devfs (void) +{ + struct stat st; + return stat ("/dev/.devfsd", &st) == 0; +} +#endif /* __linux__ */ + +/* These three functions are quite different among OSes. */ +static void +get_floppy_disk_name (char *name, int unit) +{ +#if defined(__linux__) + /* GNU/Linux */ + if (have_devfs ()) + sprintf (name, "/dev/floppy/%d", unit); + else + sprintf (name, "/dev/fd%d", unit); +#elif defined(__GNU__) + /* GNU/Hurd */ + sprintf (name, "/dev/fd%d", unit); +#elif defined(__FreeBSD_kernel__) + /* kFreeBSD */ + if (get_kfreebsd_version () >= 400000) + sprintf (name, "/dev/fd%d", unit); + else + sprintf (name, "/dev/rfd%d", unit); +#elif defined(__NetBSD__) + /* NetBSD */ + /* opendisk() doesn't work for floppies. */ + sprintf (name, "/dev/rfd%da", unit); +#elif defined(__OpenBSD__) + /* OpenBSD */ + sprintf (name, "/dev/rfd%dc", unit); +#elif defined(__QNXNTO__) + /* QNX RTP */ + sprintf (name, "/dev/fd%d", unit); +#elif defined(__CYGWIN__) + /* Cygwin */ + sprintf (name, "/dev/fd%d", unit); +#elif defined(__MINGW32__) + (void) unit; + *name = 0; +#else +# warning "BIOS floppy drives cannot be guessed in your operating system." + /* Set NAME to a bogus string. */ + *name = 0; +#endif +} + +static void +get_ide_disk_name (char *name, int unit) +{ +#if defined(__linux__) + /* GNU/Linux */ + sprintf (name, "/dev/hd%c", unit + 'a'); +#elif defined(__GNU__) + /* GNU/Hurd */ + sprintf (name, "/dev/hd%d", unit); +#elif defined(__FreeBSD_kernel__) + /* kFreeBSD */ + if (get_kfreebsd_version () >= 400000) + sprintf (name, "/dev/ad%d", unit); + else + sprintf (name, "/dev/rwd%d", unit); +#elif defined(__NetBSD__) && defined(HAVE_OPENDISK) + /* NetBSD */ + char shortname[16]; + int fd; + + sprintf (shortname, "wd%d", unit); + fd = opendisk (shortname, O_RDONLY, name, + 16, /* length of NAME */ + 0 /* char device */ + ); + close (fd); +#elif defined(__OpenBSD__) + /* OpenBSD */ + sprintf (name, "/dev/rwd%dc", unit); +#elif defined(__QNXNTO__) + /* QNX RTP */ + /* Actually, QNX RTP doesn't distinguish IDE from SCSI, so this could + contain SCSI disks. */ + sprintf (name, "/dev/hd%d", unit); +#elif defined(__CYGWIN__) + /* Cygwin emulates all disks as /dev/sdX. */ + (void) unit; + *name = 0; +#elif defined(__MINGW32__) + sprintf (name, "//./PHYSICALDRIVE%d", unit); +#else +# warning "BIOS IDE drives cannot be guessed in your operating system." + /* Set NAME to a bogus string. */ + *name = 0; +#endif +} + +static void +get_scsi_disk_name (char *name, int unit) +{ +#if defined(__linux__) + /* GNU/Linux */ + sprintf (name, "/dev/sd%c", unit + 'a'); +#elif defined(__GNU__) + /* GNU/Hurd */ + sprintf (name, "/dev/sd%d", unit); +#elif defined(__FreeBSD_kernel__) + /* kFreeBSD */ + if (get_kfreebsd_version () >= 400000) + sprintf (name, "/dev/da%d", unit); + else + sprintf (name, "/dev/rda%d", unit); +#elif defined(__NetBSD__) && defined(HAVE_OPENDISK) + /* NetBSD */ + char shortname[16]; + int fd; + + sprintf (shortname, "sd%d", unit); + fd = opendisk (shortname, O_RDONLY, name, + 16, /* length of NAME */ + 0 /* char device */ + ); + close (fd); +#elif defined(__OpenBSD__) + /* OpenBSD */ + sprintf (name, "/dev/rsd%dc", unit); +#elif defined(__QNXNTO__) + /* QNX RTP */ + /* QNX RTP doesn't distinguish SCSI from IDE, so it is better to + disable the detection of SCSI disks here. */ + *name = 0; +#elif defined(__CYGWIN__) + /* Cygwin emulates all disks as /dev/sdX. */ + sprintf (name, "/dev/sd%c", unit + 'a'); +#elif defined(__MINGW32__) + (void) unit; + *name = 0; +#else +# warning "BIOS SCSI drives cannot be guessed in your operating system." + /* Set NAME to a bogus string. */ + *name = 0; +#endif +} + +#ifdef __linux__ +static void +get_virtio_disk_name (char *name, int unit) +{ +#ifdef __sparc__ + sprintf (name, "/dev/vdisk%c", unit + 'a'); +#else + sprintf (name, "/dev/vd%c", unit + 'a'); +#endif +} + +static void +get_dac960_disk_name (char *name, int controller, int drive) +{ + sprintf (name, "/dev/rd/c%dd%d", controller, drive); +} + +static void +get_ataraid_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/ataraid/d%c", unit + '0'); +} + +static void +get_i2o_disk_name (char *name, char unit) +{ + sprintf (name, "/dev/i2o/hd%c", unit); +} + +static void +get_cciss_disk_name (char *name, int controller, int drive) +{ + sprintf (name, "/dev/cciss/c%dd%d", controller, drive); +} + +static void +get_ida_disk_name (char *name, int controller, int drive) +{ + sprintf (name, "/dev/ida/c%dd%d", controller, drive); +} + +static void +get_mmc_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/mmcblk%d", unit); +} + +static void +get_xvd_disk_name (char *name, int unit) +{ + sprintf (name, "/dev/xvd%c", unit + 'a'); +} +#endif + +/* Check if DEVICE can be read. If an error occurs, return zero, + otherwise return non-zero. */ +static int +check_device (const char *device) +{ + char buf[512]; + FILE *fp; + + /* If DEVICE is empty, just return error. */ + if (*device == 0) + return 0; + + fp = fopen (device, "r"); + if (! fp) + { + switch (errno) + { +#ifdef ENOMEDIUM + case ENOMEDIUM: +# if 0 + /* At the moment, this finds only CDROMs, which can't be + read anyway, so leave it out. Code should be + reactivated if `removable disks' and CDROMs are + supported. */ + /* Accept it, it may be inserted. */ + return 1; +# endif + break; +#endif /* ENOMEDIUM */ + default: + /* Break case and leave. */ + break; + } + /* Error opening the device. */ + return 0; + } + + /* Make sure CD-ROMs don't get assigned a BIOS disk number + before SCSI disks! */ +#ifdef __linux__ +# ifdef CDROM_GET_CAPABILITY + if (ioctl (fileno (fp), CDROM_GET_CAPABILITY, 0) >= 0) + return 0; +# else /* ! CDROM_GET_CAPABILITY */ + /* Check if DEVICE is a CD-ROM drive by the HDIO_GETGEO ioctl. */ + { + struct hd_geometry hdg; + struct stat st; + + if (fstat (fileno (fp), &st)) + return 0; + + /* If it is a block device and isn't a floppy, check if HDIO_GETGEO + succeeds. */ + if (S_ISBLK (st.st_mode) + && MAJOR (st.st_rdev) != FLOPPY_MAJOR + && ioctl (fileno (fp), HDIO_GETGEO, &hdg)) + return 0; + } +# endif /* ! CDROM_GET_CAPABILITY */ +#endif /* __linux__ */ + +#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) +# ifdef CDIOCCLRDEBUG + if (ioctl (fileno (fp), CDIOCCLRDEBUG, 0) >= 0) + return 0; +# endif /* CDIOCCLRDEBUG */ +#endif /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ */ + + /* Attempt to read the first sector. */ + if (fread (buf, 1, 512, fp) != 512) + { + fclose (fp); + return 0; + } + + fclose (fp); + return 1; +} + +void +grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), + int floppy_disks) +{ + int i; + + /* Floppies. */ + for (i = 0; i < floppy_disks; i++) + { + char name[16]; + struct stat st; + + get_floppy_disk_name (name, i); + if (stat (name, &st) < 0) + break; + /* In floppies, write the map, whether check_device succeeds + or not, because the user just may not insert floppies. */ + if (hook (name, 1)) + return; + } + +#ifdef __linux__ + if (have_devfs ()) + { + i = 0; + while (1) + { + char discn[32]; + char name[PATH_MAX]; + struct stat st; + + /* Linux creates symlinks "/dev/discs/discN" for convenience. + The way to number disks is the same as GRUB's. */ + sprintf (discn, "/dev/discs/disc%d", i++); + if (stat (discn, &st) < 0) + break; + + if (realpath (discn, name)) + { + strcat (name, "/disc"); + if (hook (name, 0)) + return; + } + } + return; + } +#endif /* __linux__ */ + + /* IDE disks. */ + for (i = 0; i < 20; i++) + { + char name[16]; + + get_ide_disk_name (name, i); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + +#ifdef __linux__ + /* Virtio disks. */ + for (i = 0; i < 20; i++) + { + char name[16]; + + get_virtio_disk_name (name, i); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + + /* ATARAID disks. */ + for (i = 0; i < 8; i++) + { + char name[20]; + + get_ataraid_disk_name (name, i); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + + /* Xen virtual block devices. */ + for (i = 0; i < 16; i++) + { + char name[16]; + + get_xvd_disk_name (name, i); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } +#endif /* __linux__ */ + + /* The rest is SCSI disks. */ + for (i = 0; i < 16; i++) + { + char name[16]; + + get_scsi_disk_name (name, i); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + +#ifdef __linux__ + /* This is for DAC960 - we have + /dev/rd/cdp. + + DAC960 driver currently supports up to 8 controllers, 32 logical + drives, and 7 partitions. */ + { + int controller, drive; + + for (controller = 0; controller < 8; controller++) + { + for (drive = 0; drive < 15; drive++) + { + char name[24]; + + get_dac960_disk_name (name, controller, drive); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + } + } + + /* This is for CCISS - we have + /dev/cciss/cdp. */ + { + int controller, drive; + + for (controller = 0; controller < 3; controller++) + { + for (drive = 0; drive < 10; drive++) + { + char name[24]; + + get_cciss_disk_name (name, controller, drive); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + } + } + + /* This is for Compaq Intelligent Drive Array - we have + /dev/ida/cdp. */ + { + int controller, drive; + + for (controller = 0; controller < 3; controller++) + { + for (drive = 0; drive < 10; drive++) + { + char name[24]; + + get_ida_disk_name (name, controller, drive); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + } + } + + /* This is for I2O - we have /dev/i2o/hd */ + { + char unit; + + for (unit = 'a'; unit < 'f'; unit++) + { + char name[24]; + + get_i2o_disk_name (name, unit); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + } + + /* MultiMediaCard (MMC). */ + for (i = 0; i < 10; i++) + { + char name[16]; + + get_mmc_disk_name (name, i); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } +#endif /* __linux__ */ +} + diff --git a/util/devicemap.c b/util/devicemap.c new file mode 100644 index 000000000..c61864420 --- /dev/null +++ b/util/devicemap.c @@ -0,0 +1,13 @@ +#include + +#include + +void +grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy, + int *num_fd, int *num_hd) +{ + if (is_floppy) + fprintf (fp, "(fd%d)\t%s\n", (*num_fd)++, name); + else + fprintf (fp, "(hd%d)\t%s\n", (*num_hd)++, name); +} diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index fa8b158dc..4f544f878 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -30,385 +30,26 @@ #include #include +#include #define _GNU_SOURCE 1 #include -#ifdef __linux__ -# if !defined(__GLIBC__) || \ - ((__GLIBC__ < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR__ < 1))) -/* Maybe libc doesn't have large file support. */ -# include /* _llseek */ -# endif /* (GLIBC < 2) || ((__GLIBC__ == 2) && (__GLIBC_MINOR < 1)) */ -# include /* ioctl */ -# ifndef HDIO_GETGEO -# define HDIO_GETGEO 0x0301 /* get device geometry */ -/* If HDIO_GETGEO is not defined, it is unlikely that hd_geometry is - defined. */ -struct hd_geometry -{ - unsigned char heads; - unsigned char sectors; - unsigned short cylinders; - unsigned long start; -}; -# endif /* ! HDIO_GETGEO */ -# ifndef FLOPPY_MAJOR -# define FLOPPY_MAJOR 2 /* the major number for floppy */ -# endif /* ! FLOPPY_MAJOR */ -# ifndef MAJOR -# define MAJOR(dev) \ - ({ \ - unsigned long long __dev = (dev); \ - (unsigned) ((__dev >> 8) & 0xfff) \ - | ((unsigned int) (__dev >> 32) & ~0xfff); \ - }) -# endif /* ! MAJOR */ -# ifndef CDROM_GET_CAPABILITY -# define CDROM_GET_CAPABILITY 0x5331 /* get capabilities */ -# endif /* ! CDROM_GET_CAPABILITY */ -# ifndef BLKGETSIZE -# define BLKGETSIZE _IO(0x12,96) /* return device size */ -# endif /* ! BLKGETSIZE */ -#endif /* __linux__ */ - -/* Use __FreeBSD_kernel__ instead of __FreeBSD__ for compatibility with - kFreeBSD-based non-FreeBSD systems (e.g. GNU/kFreeBSD) */ -#if defined(__FreeBSD__) && ! defined(__FreeBSD_kernel__) -# define __FreeBSD_kernel__ -#endif -#ifdef __FreeBSD_kernel__ - /* Obtain version of kFreeBSD headers */ -# include -# ifndef __FreeBSD_kernel_version -# define __FreeBSD_kernel_version __FreeBSD_version -# endif - - /* Runtime detection of kernel */ -# include -int -get_kfreebsd_version (void) -{ - struct utsname uts; - int major; - int minor; - int v[2]; - - uname (&uts); - sscanf (uts.release, "%d.%d", &major, &minor); - - if (major >= 9) - major = 9; - if (major >= 5) - { - v[0] = minor/10; v[1] = minor%10; - } - else - { - v[0] = minor%10; v[1] = minor/10; - } - return major*100000+v[0]*10000+v[1]*1000; -} -#endif /* __FreeBSD_kernel__ */ - -#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) -# include /* ioctl */ -# include -# include /* CDIOCCLRDEBUG */ -# if defined(__FreeBSD_kernel__) -# include -# if __FreeBSD_kernel_version >= 500040 -# include -# endif -# endif /* __FreeBSD_kernel__ */ -#endif /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ */ - -#ifdef HAVE_OPENDISK -# include -#endif /* HAVE_OPENDISK */ - -#ifdef __linux__ -/* Check if we have devfs support. */ -static int -have_devfs (void) -{ - struct stat st; - return stat ("/dev/.devfsd", &st) == 0; -} -#endif /* __linux__ */ - -/* These three functions are quite different among OSes. */ -static void -get_floppy_disk_name (char *name, int unit) -{ -#if defined(__linux__) - /* GNU/Linux */ - if (have_devfs ()) - sprintf (name, "/dev/floppy/%d", unit); - else - sprintf (name, "/dev/fd%d", unit); -#elif defined(__GNU__) - /* GNU/Hurd */ - sprintf (name, "/dev/fd%d", unit); -#elif defined(__FreeBSD_kernel__) - /* kFreeBSD */ - if (get_kfreebsd_version () >= 400000) - sprintf (name, "/dev/fd%d", unit); - else - sprintf (name, "/dev/rfd%d", unit); -#elif defined(__NetBSD__) - /* NetBSD */ - /* opendisk() doesn't work for floppies. */ - sprintf (name, "/dev/rfd%da", unit); -#elif defined(__OpenBSD__) - /* OpenBSD */ - sprintf (name, "/dev/rfd%dc", unit); -#elif defined(__QNXNTO__) - /* QNX RTP */ - sprintf (name, "/dev/fd%d", unit); -#elif defined(__CYGWIN__) - /* Cygwin */ - sprintf (name, "/dev/fd%d", unit); -#elif defined(__MINGW32__) - (void) unit; - *name = 0; -#else -# warning "BIOS floppy drives cannot be guessed in your operating system." - /* Set NAME to a bogus string. */ - *name = 0; -#endif -} - -static void -get_ide_disk_name (char *name, int unit) -{ -#if defined(__linux__) - /* GNU/Linux */ - sprintf (name, "/dev/hd%c", unit + 'a'); -#elif defined(__GNU__) - /* GNU/Hurd */ - sprintf (name, "/dev/hd%d", unit); -#elif defined(__FreeBSD_kernel__) - /* kFreeBSD */ - if (get_kfreebsd_version () >= 400000) - sprintf (name, "/dev/ad%d", unit); - else - sprintf (name, "/dev/rwd%d", unit); -#elif defined(__NetBSD__) && defined(HAVE_OPENDISK) - /* NetBSD */ - char shortname[16]; - int fd; - - sprintf (shortname, "wd%d", unit); - fd = opendisk (shortname, O_RDONLY, name, - 16, /* length of NAME */ - 0 /* char device */ - ); - close (fd); -#elif defined(__OpenBSD__) - /* OpenBSD */ - sprintf (name, "/dev/rwd%dc", unit); -#elif defined(__QNXNTO__) - /* QNX RTP */ - /* Actually, QNX RTP doesn't distinguish IDE from SCSI, so this could - contain SCSI disks. */ - sprintf (name, "/dev/hd%d", unit); -#elif defined(__CYGWIN__) - /* Cygwin emulates all disks as /dev/sdX. */ - (void) unit; - *name = 0; -#elif defined(__MINGW32__) - sprintf (name, "//./PHYSICALDRIVE%d", unit); -#else -# warning "BIOS IDE drives cannot be guessed in your operating system." - /* Set NAME to a bogus string. */ - *name = 0; -#endif -} - -static void -get_scsi_disk_name (char *name, int unit) -{ -#if defined(__linux__) - /* GNU/Linux */ - sprintf (name, "/dev/sd%c", unit + 'a'); -#elif defined(__GNU__) - /* GNU/Hurd */ - sprintf (name, "/dev/sd%d", unit); -#elif defined(__FreeBSD_kernel__) - /* kFreeBSD */ - if (get_kfreebsd_version () >= 400000) - sprintf (name, "/dev/da%d", unit); - else - sprintf (name, "/dev/rda%d", unit); -#elif defined(__NetBSD__) && defined(HAVE_OPENDISK) - /* NetBSD */ - char shortname[16]; - int fd; - - sprintf (shortname, "sd%d", unit); - fd = opendisk (shortname, O_RDONLY, name, - 16, /* length of NAME */ - 0 /* char device */ - ); - close (fd); -#elif defined(__OpenBSD__) - /* OpenBSD */ - sprintf (name, "/dev/rsd%dc", unit); -#elif defined(__QNXNTO__) - /* QNX RTP */ - /* QNX RTP doesn't distinguish SCSI from IDE, so it is better to - disable the detection of SCSI disks here. */ - *name = 0; -#elif defined(__CYGWIN__) - /* Cygwin emulates all disks as /dev/sdX. */ - sprintf (name, "/dev/sd%c", unit + 'a'); -#elif defined(__MINGW32__) - (void) unit; - *name = 0; -#else -# warning "BIOS SCSI drives cannot be guessed in your operating system." - /* Set NAME to a bogus string. */ - *name = 0; -#endif -} - -#ifdef __linux__ -static void -get_virtio_disk_name (char *name, int unit) -{ - sprintf (name, "/dev/vd%c", unit + 'a'); -} - -static void -get_dac960_disk_name (char *name, int controller, int drive) -{ - sprintf (name, "/dev/rd/c%dd%d", controller, drive); -} - -static void -get_ataraid_disk_name (char *name, int unit) -{ - sprintf (name, "/dev/ataraid/d%c", unit + '0'); -} - -static void -get_i2o_disk_name (char *name, char unit) -{ - sprintf (name, "/dev/i2o/hd%c", unit); -} - -static void -get_cciss_disk_name (char *name, int controller, int drive) -{ - sprintf (name, "/dev/cciss/c%dd%d", controller, drive); -} - -static void -get_ida_disk_name (char *name, int controller, int drive) -{ - sprintf (name, "/dev/ida/c%dd%d", controller, drive); -} - -static void -get_mmc_disk_name (char *name, int unit) -{ - sprintf (name, "/dev/mmcblk%d", unit); -} - -static void -get_xvd_disk_name (char *name, int unit) -{ - sprintf (name, "/dev/xvd%c", unit + 'a'); -} -#endif - -/* Check if DEVICE can be read. If an error occurs, return zero, - otherwise return non-zero. */ -static int -check_device (const char *device) -{ - char buf[512]; - FILE *fp; - - /* If DEVICE is empty, just return error. */ - if (*device == 0) - return 0; - - fp = fopen (device, "r"); - if (! fp) - { - switch (errno) - { -#ifdef ENOMEDIUM - case ENOMEDIUM: -# if 0 - /* At the moment, this finds only CDROMs, which can't be - read anyway, so leave it out. Code should be - reactivated if `removable disks' and CDROMs are - supported. */ - /* Accept it, it may be inserted. */ - return 1; -# endif - break; -#endif /* ENOMEDIUM */ - default: - /* Break case and leave. */ - break; - } - /* Error opening the device. */ - return 0; - } - - /* Make sure CD-ROMs don't get assigned a BIOS disk number - before SCSI disks! */ -#ifdef __linux__ -# ifdef CDROM_GET_CAPABILITY - if (ioctl (fileno (fp), CDROM_GET_CAPABILITY, 0) >= 0) - return 0; -# else /* ! CDROM_GET_CAPABILITY */ - /* Check if DEVICE is a CD-ROM drive by the HDIO_GETGEO ioctl. */ - { - struct hd_geometry hdg; - struct stat st; - - if (fstat (fileno (fp), &st)) - return 0; - - /* If it is a block device and isn't a floppy, check if HDIO_GETGEO - succeeds. */ - if (S_ISBLK (st.st_mode) - && MAJOR (st.st_rdev) != FLOPPY_MAJOR - && ioctl (fileno (fp), HDIO_GETGEO, &hdg)) - return 0; - } -# endif /* ! CDROM_GET_CAPABILITY */ -#endif /* __linux__ */ - -#if defined(__FreeBSD_kernel__) || defined(__NetBSD__) || defined(__OpenBSD__) -# ifdef CDIOCCLRDEBUG - if (ioctl (fileno (fp), CDIOCCLRDEBUG, 0) >= 0) - return 0; -# endif /* CDIOCCLRDEBUG */ -#endif /* __FreeBSD_kernel__ || __NetBSD__ || __OpenBSD__ */ - - /* Attempt to read the first sector. */ - if (fread (buf, 1, 512, fp) != 512) - { - fclose (fp); - return 0; - } - - fclose (fp); - return 1; -} - static void make_device_map (const char *device_map, int floppy_disks) { - FILE *fp; int num_hd = 0; - int i; + int num_fd = 0; + FILE *fp; + + auto int process_device (const char *name, int is_floppy); + + int process_device (const char *name, int is_floppy) + { + grub_util_emit_devicemap_entry (fp, (char *) name, + is_floppy, &num_fd, &num_hd); + return 0; + } if (strcmp (device_map, "-") == 0) fp = stdout; @@ -418,215 +59,7 @@ make_device_map (const char *device_map, int floppy_disks) if (! fp) grub_util_error ("cannot open %s", device_map); - /* Floppies. */ - for (i = 0; i < floppy_disks; i++) - { - char name[16]; - struct stat st; - - get_floppy_disk_name (name, i); - if (stat (name, &st) < 0) - break; - /* In floppies, write the map, whether check_device succeeds - or not, because the user just may not insert floppies. */ - if (fp) - fprintf (fp, "(fd%d)\t%s\n", i, name); - } - -#ifdef __linux__ - if (have_devfs ()) - { - while (1) - { - char discn[32]; - char name[PATH_MAX]; - struct stat st; - - /* Linux creates symlinks "/dev/discs/discN" for convenience. - The way to number disks is the same as GRUB's. */ - sprintf (discn, "/dev/discs/disc%d", num_hd); - if (stat (discn, &st) < 0) - break; - - if (realpath (discn, name)) - { - strcat (name, "/disc"); - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - } - - num_hd++; - } - - goto finish; - } -#endif /* __linux__ */ - - /* IDE disks. */ - for (i = 0; i < 20; i++) - { - char name[16]; - - get_ide_disk_name (name, i); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - -#ifdef __linux__ - /* Virtio disks. */ - for (i = 0; i < 20; i++) - { - char name[16]; - - get_virtio_disk_name (name, i); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - - /* ATARAID disks. */ - for (i = 0; i < 8; i++) - { - char name[20]; - - get_ataraid_disk_name (name, i); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - - /* Xen virtual block devices. */ - for (i = 0; i < 16; i++) - { - char name[16]; - - get_xvd_disk_name (name, i); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } -#endif /* __linux__ */ - - /* The rest is SCSI disks. */ - for (i = 0; i < 16; i++) - { - char name[16]; - - get_scsi_disk_name (name, i); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - -#ifdef __linux__ - /* This is for DAC960 - we have - /dev/rd/cdp. - - DAC960 driver currently supports up to 8 controllers, 32 logical - drives, and 7 partitions. */ - { - int controller, drive; - - for (controller = 0; controller < 8; controller++) - { - for (drive = 0; drive < 15; drive++) - { - char name[24]; - - get_dac960_disk_name (name, controller, drive); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - } - } - - /* This is for CCISS - we have - /dev/cciss/cdp. */ - { - int controller, drive; - - for (controller = 0; controller < 3; controller++) - { - for (drive = 0; drive < 10; drive++) - { - char name[24]; - - get_cciss_disk_name (name, controller, drive); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - } - } - - /* This is for Compaq Intelligent Drive Array - we have - /dev/ida/cdp. */ - { - int controller, drive; - - for (controller = 0; controller < 3; controller++) - { - for (drive = 0; drive < 10; drive++) - { - char name[24]; - - get_ida_disk_name (name, controller, drive); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - } - } - - /* This is for I2O - we have /dev/i2o/hd */ - { - char unit; - - for (unit = 'a'; unit < 'f'; unit++) - { - char name[24]; - - get_i2o_disk_name (name, unit); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - } - - /* MultiMediaCard (MMC). */ - for (i = 0; i < 10; i++) - { - char name[16]; - - get_mmc_disk_name (name, i); - if (check_device (name)) - { - fprintf (fp, "(hd%d)\t%s\n", num_hd, name); - num_hd++; - } - } - - finish: -#endif /* __linux__ */ + grub_util_iterate_devices (process_device, floppy_disks); if (fp != stdout) fclose (fp); diff --git a/util/ieee1275/devicemap.c b/util/ieee1275/devicemap.c new file mode 100644 index 000000000..8e6eb39c4 --- /dev/null +++ b/util/ieee1275/devicemap.c @@ -0,0 +1,13 @@ +#include +#include +#include +#include + +void +grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy UNUSED, + int *num_fd UNUSED, int *num_hd UNUSED) +{ + const char *ofpath = grub_util_devname_to_ofpath (name); + + fprintf(fp, "(%s)\t%s\n", ofpath, name); +} diff --git a/util/ieee1275/ofpath.c b/util/ieee1275/ofpath.c new file mode 100644 index 000000000..7b464bf09 --- /dev/null +++ b/util/ieee1275/ofpath.c @@ -0,0 +1,415 @@ +/* ofpath.c - calculate OpenFirmware path names given an OS device */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#undef OFPATH_STANDALONE + +#ifndef OFPATH_STANDALONE +#include +#include +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef OFPATH_STANDALONE +#define UNUSED __attribute__((unused)) +#define xmalloc malloc +void +grub_util_error (const char *fmt, ...) +{ + va_list ap; + + fprintf (stderr, "ofpath: error: "); + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + va_end (ap); + fputc ('\n', stderr); + exit (1); +} + +#endif + +static void +kill_trailing_dir(char *path) +{ + char *end = path + strlen(path) - 1; + + while (end >= path) + { + if (*end != '/') + { + end--; + continue; + } + *end = '\0'; + break; + } +} + +static void +trim_newline (char *path) +{ + char *end = path + strlen(path) - 1; + + while (*end == '\n') + *end-- = '\0'; +} + +#define OF_PATH_MAX 256 + +static void +find_obppath(char *of_path, const char *sysfs_path_orig) +{ + char *sysfs_path, *path; + + sysfs_path = xmalloc (PATH_MAX); + path = xmalloc (PATH_MAX); + + strcpy(sysfs_path, sysfs_path_orig); + while (1) + { + int fd; + + snprintf(path, PATH_MAX, "%s/obppath", sysfs_path); +#if 0 + printf("Trying %s\n", path); +#endif + + fd = open(path, O_RDONLY); + if (fd < 0) + { + kill_trailing_dir(sysfs_path); + if (!strcmp(sysfs_path, "/sys")) + grub_util_error("'obppath' not found in parent dirs of %s", + sysfs_path_orig); + continue; + } + memset(of_path, 0, OF_PATH_MAX); + read(fd, of_path, OF_PATH_MAX); + close(fd); + + trim_newline(of_path); + break; + } + + free (path); + free (sysfs_path); +} + +static void +block_device_get_sysfs_path_and_link(const char *devicenode, + char *sysfs_path, int sysfs_path_len) +{ + char *rpath = xmalloc (PATH_MAX); + + snprintf(sysfs_path, sysfs_path_len, "/sys/block/%s", devicenode); + + if (!realpath (sysfs_path, rpath)) + grub_util_error ("Cannot get the real path of `%s'", sysfs_path); + + strcat(rpath, "/device"); + + if (!realpath (rpath, sysfs_path)) + grub_util_error ("Cannot get the real path of `%s'", rpath); + + free (rpath); +} + +static const char * +trailing_digits (const char *p) +{ + const char *end; + + end = p + strlen(p) - 1; + while (end >= p) + { + if (! isdigit(*end)) + break; + end--; + } + + return end + 1; +} + +static void +__of_path_common(char *of_path, char *sysfs_path, + const char *device, int devno) +{ + const char *digit_string; + char disk[64]; + + find_obppath(of_path, sysfs_path); + + digit_string = trailing_digits (device); + if (*digit_string == '\0') + { + sprintf(disk, "/disk@%d", devno); + } + else + { + int part; + + sscanf(digit_string, "%d", &part); + sprintf(disk, "/disk@%d:%c", devno, 'a' + (part - 1)); + } + strcat(of_path, disk); +} + +static char * +get_basename(char *p) +{ + char *ret = p; + + while (*p) + { + if (*p == '/') + ret = p + 1; + p++; + } + + return ret; +} + +static void +of_path_of_vdisk(char *of_path, + const char *devname UNUSED, const char *device, + const char *devnode UNUSED, const char *devicenode) +{ + char *sysfs_path, *p; + int devno, junk; + + sysfs_path = xmalloc (PATH_MAX); + block_device_get_sysfs_path_and_link(devicenode, + sysfs_path, PATH_MAX); + p = get_basename (sysfs_path); + sscanf(p, "vdc-port-%d-%d", &devno, &junk); + __of_path_common(of_path, sysfs_path, device, devno); + + free (sysfs_path); +} + +static void +of_path_of_ide(char *of_path, + const char *devname UNUSED, const char *device, + const char *devnode UNUSED, const char *devicenode) +{ + char *sysfs_path, *p; + int chan, devno; + + sysfs_path = xmalloc (PATH_MAX); + block_device_get_sysfs_path_and_link(devicenode, + sysfs_path, PATH_MAX); + p = get_basename (sysfs_path); + sscanf(p, "%d.%d", &chan, &devno); + + __of_path_common(of_path, sysfs_path, device, devno); + + free (sysfs_path); +} + +static int +vendor_is_ATA(const char *path) +{ + int fd, err; + char *buf; + + buf = xmalloc (PATH_MAX); + + snprintf(buf, PATH_MAX, "%s/vendor", path); + fd = open(buf, O_RDONLY); + if (fd < 0) + grub_util_error ("Cannot open 'vendor' node of `%s'", path); + + memset(buf, 0, PATH_MAX); + err = read(fd, buf, PATH_MAX); + if (err < 0) + grub_util_error ("Cannot read 'vendor' node of `%s'", path); + + close(fd); + + free (buf); + + if (!strncmp(buf, "ATA", 3)) + return 1; + return 0; +} + +static void +check_sas (char *sysfs_path, int *tgt) +{ + char *ed = strstr (sysfs_path, "end_device"); + char *p, *q, *path; + char phy[16]; + int fd; + + if (!ed) + return; + + /* SAS devices are identified using disk@$PHY_ID */ + p = strdup (sysfs_path); + ed = strstr(p, "end_device"); + + q = ed; + while (*q && *q != '/') + q++; + *q = '\0'; + + path = xmalloc (PATH_MAX); + sprintf (path, "%s/sas_device:%s/phy_identifier", p, ed); + + fd = open(path, O_RDONLY); + if (fd < 0) + grub_util_error("Cannot open SAS PHY ID '%s'\n", path); + + memset (phy, 0, sizeof (phy)); + read (fd, phy, sizeof (phy)); + + sscanf (phy, "%d", tgt); + + free (path); + free (p); +} + +static void +of_path_of_scsi(char *of_path, + const char *devname UNUSED, const char *device, + const char *devnode UNUSED, const char *devicenode) +{ + const char *p, *digit_string, *disk_name; + int host, bus, tgt, lun; + char *sysfs_path, disk[64]; + + sysfs_path = xmalloc (PATH_MAX); + + block_device_get_sysfs_path_and_link(devicenode, + sysfs_path, PATH_MAX); + p = get_basename (sysfs_path); + sscanf(p, "%d:%d:%d:%d", &host, &bus, &tgt, &lun); + check_sas (sysfs_path, &tgt); + + if (vendor_is_ATA(sysfs_path)) + { + __of_path_common(of_path, sysfs_path, device, tgt); + free (sysfs_path); + return; + } + + find_obppath(of_path, sysfs_path); + free (sysfs_path); + + if (strstr (of_path, "qlc")) + strcat (of_path, "/fp@0,0"); + + if (strstr (of_path, "sbus")) + disk_name = "sd"; + else + disk_name = "disk"; + + digit_string = trailing_digits (device); + if (*digit_string == '\0') + { + sprintf(disk, "/%s@%x,%d", disk_name, tgt, lun); + } + else + { + int part; + + sscanf(digit_string, "%d", &part); + sprintf(disk, "/%s@%x,%d:%c", disk_name, tgt, lun, 'a' + (part - 1)); + } + strcat(of_path, disk); +} + +static char * +strip_trailing_digits (const char *p) +{ + char *new, *end; + + new = strdup (p); + end = new + strlen(new) - 1; + while (end >= new) + { + if (! isdigit(*end)) + break; + *end-- = '\0'; + } + + return new; +} + +char * +grub_util_devname_to_ofpath (char *devname) +{ + char *name_buf, *device, *devnode, *devicenode, *ofpath; + + name_buf = xmalloc (PATH_MAX); + name_buf = realpath (devname, name_buf); + if (! name_buf) + grub_util_error ("Cannot get the real path of `%s'", devname); + + device = get_basename (devname); + devnode = strip_trailing_digits (devname); + devicenode = strip_trailing_digits (device); + + ofpath = xmalloc (OF_PATH_MAX); + + if (device[0] == 'h' && device[1] == 'd') + of_path_of_ide(ofpath, name_buf, device, devnode, devicenode); + else if (device[0] == 's' + && (device[1] == 'd' || device[1] == 'r')) + of_path_of_scsi(ofpath, name_buf, device, devnode, devicenode); + else if (device[0] == 'v' && device[1] == 'd' && device[2] == 'i' + && device[3] == 's' && device[4] == 'k') + of_path_of_vdisk(ofpath, name_buf, device, devnode, devicenode); + + free (devnode); + free (devicenode); + free (name_buf); + + return ofpath; +} + +#ifdef OFPATH_STANDALONE +int main(int argc, char **argv) +{ + char *of_path; + + if (argc != 2) + { + printf("Usage: grub-ofpathname DEVICE\n"); + return 1; + } + + of_path = grub_util_devname_to_ofpath (argv[1]); + printf("%s\n", of_path); + + return 0; +} +#endif diff --git a/util/sparc64/ieee1275/grub-install.in b/util/sparc64/ieee1275/grub-install.in new file mode 100644 index 000000000..e2af5e8d9 --- /dev/null +++ b/util/sparc64/ieee1275/grub-install.in @@ -0,0 +1,276 @@ +#! /bin/sh + +# Install GRUB on your drive. +# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +# Initialize some variables. +transform="@program_transform_name@" + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +sbindir=@sbindir@ +bindir=@bindir@ +libdir=@libdir@ +PACKAGE_NAME=@PACKAGE_NAME@ +PACKAGE_TARNAME=@PACKAGE_TARNAME@ +PACKAGE_VERSION=@PACKAGE_VERSION@ +target_cpu=@target_cpu@ +platform=@platform@ +pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` + +grub_setup=${sbindir}/`echo grub-setup | sed ${transform}` +grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` +grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` +rootdir= +grub_prefix=`echo /boot/grub | sed ${transform}` +modules= + +install_device= +no_floppy= +force_lba= +recheck=no +debug=no + +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "grub-install (GNU GRUB ${PACKAGE_VERSION})" + exit 0 ;; + --modules=*) + modules=`echo "$option" | sed 's/--modules=//'` ;; + --root-directory=*) + rootdir=`echo "$option" | sed 's/--root-directory=//'` ;; + --grub-setup=*) + grub_setup=`echo "$option" | sed 's/--grub-setup=//'` ;; + --grub-mkimage=*) + grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; + --grub-mkdevicemap=*) + grub_mkdevicemap=`echo "$option" | sed 's/--grub-mkdevicemap=//'` ;; + --grub-probe=*) + grub_probe=`echo "$option" | sed 's/--grub-probe=//'` ;; + --no-floppy) + no_floppy="--no-floppy" ;; + --recheck) + recheck=yes ;; + # This is an undocumented feature... + --debug) + debug=yes ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + *) + if test "x$install_device" != x; then + echo "More than one install_devices?" 1>&2 + usage + exit 1 + fi + install_device="${option}" ;; + esac +done + +# for make_system_path_relative_to_its_root() +. ${libdir}/grub/grub-mkconfig_lib + +if test "x$install_device" = x; then + echo "install_device not specified." 1>&2 + usage + exit 1 +fi + +# If the debugging feature is enabled, print commands. +setup_verbose= +if test $debug = yes; then + set -x + setup_verbose="--verbose" +fi + +# Initialize these directories here, since ROOTDIR was initialized. +bootdir=${rootdir}/boot +grubdir=${bootdir}/`echo grub | sed ${transform}` +device_map=${grubdir}/device.map + +grub_probe="${grub_probe} --device-map=${device_map}" + +# Check if GRUB is installed. +set $grub_setup dummy +if test -f "$1"; then + : +else + echo "$1: Not found." 1>&2 + exit 1 +fi + +set $grub_mkimage dummy +if test -f "$1"; then + : +else + echo "$1: Not found." 1>&2 + exit 1 +fi + +set $grub_mkdevicemap dummy +if test -f "$1"; then + : +else + echo "$1: Not found." 1>&2 + exit 1 +fi + +# Create the GRUB directory if it is not present. +test -d "$bootdir" || mkdir "$bootdir" || exit 1 +test -d "$grubdir" || mkdir "$grubdir" || exit 1 + +# If --recheck is specified, remove the device map, if present. +if test $recheck = yes; then + rm -f $device_map +fi + +# Create the device map file if it is not present. +if test -f "$device_map"; then + : +else + # Create a safe temporary file. + test -n "$mklog" && log_file=`$mklog` + + $grub_mkdevicemap --device-map=$device_map $no_floppy || exit 1 +fi + +# Make sure that there is no duplicated entry. +tmp=`sed -n '/^([fh]d[0-9]*)/s/\(^(.*)\).*/\1/p' $device_map \ + | sort | uniq -d | sed -n 1p` +if test -n "$tmp"; then + echo "The drive $tmp is defined multiple times in the device map $device_map" 1>&2 + exit 1 +fi + +# Copy the GRUB images to the GRUB directory. +for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img; do + if test -f $file && [ "`basename $file`" != menu.lst ]; then + rm -f $file || exit 1 + fi +done +for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do + cp -f $file ${grubdir} || exit 1 +done + +for file in ${pkglibdir}/*.img; do + cp -f $file ${grubdir} || exit 1 +done + +# Write device to a variable so we don't have to traverse /dev every time. +grub_device=`$grub_probe --target=device ${grubdir}` + +# Create the core image. First, auto-detect the filesystem module. +fs_module=`$grub_probe --target=fs --device ${grub_device}` +if test "x$fs_module" = x -a "x$modules" = x; then + echo "Auto-detection of a filesystem module failed." 1>&2 + echo "Please specify the module with the option \`--modules' explicitly." 1>&2 + exit 1 +fi + +# Then the partition map module. In order to support partition-less media, +# this command is allowed to fail (--target=fs already grants us that the +# filesystem will be accessible). +partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` + +# Device abstraction module, if any (lvm, raid). +devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` + +modules="$modules $fs_module $partmap_module $devabstraction_module" + +prefix_drive= +if [ "x${devabstraction_module}" = "x" ] ; then + if echo "${install_device}" | grep -qx "(.*)" ; then + install_drive="${install_device}" + else + install_drive="`$grub_probe --target=drive --device ${install_device}`" + fi + grub_drive="`$grub_probe --target=drive --device ${grub_device}`" + + # Strip partition number + install_drive="`echo ${install_drive} | sed -e s/,[0-9]*//g`" + grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*//g`" + if [ "x${grub_drive}" != "x${install_drive}" ] ; then + uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" + if [ "x${uuid}" = "x" ] ; then + echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + exit 1 + fi + prefix_drive="(UUID=${uuid})" + modules="$modules fs_uuid" + fi +else + prefix_drive=`$grub_probe --target=drive --device ${grub_device}` +fi + +relative_grubdir=`make_system_path_relative_to_its_root ${grubdir}` || exit 1 +if [ "x${relative_grubdir}" = "x" ] ; then + relative_grubdir=/ +fi + +$grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 + +# Now perform the installation. +$grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} \ + ${install_device} || exit 1 + +# Prompt the user to check if the device map is correct. +echo "Installation finished. No error reported." +echo "This is the contents of the device map $device_map." +echo "Check if this is correct or not. If any of the lines is incorrect," +echo "fix it and re-run the script \`grub-install'." +echo + +cat $device_map + +# Bye. +exit 0 diff --git a/util/sparc64/ieee1275/grub-mkimage.c b/util/sparc64/ieee1275/grub-mkimage.c new file mode 100644 index 000000000..247f13846 --- /dev/null +++ b/util/sparc64/ieee1275/grub-mkimage.c @@ -0,0 +1,294 @@ +/* grub-mkimage.c - make a bootable image */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include +#include + +#define _GNU_SOURCE 1 +#include + +static void +compress_kernel (char *kernel_img, size_t kernel_size, + char **core_img, size_t *core_size) +{ + /* No compression support yet. */ + grub_util_info ("kernel_img=%p, kernel_size=0x%x", kernel_img, kernel_size); + *core_img = xmalloc (kernel_size); + memcpy (*core_img, kernel_img, kernel_size); + *core_size = kernel_size; +} + +static void +generate_image (const char *dir, const char *prefix, FILE *out, char *mods[], char *memdisk_path) +{ + size_t kernel_size, total_module_size, memdisk_size, core_size, boot_size, offset; + char *kernel_path, *kernel_img, *core_img, *boot_path, *boot_img; + struct grub_util_path_list *path_list, *p; + struct grub_module_info *modinfo; + grub_addr_t module_addr; + unsigned int num; + + path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); + + kernel_path = grub_util_get_path (dir, "kernel.img"); + kernel_size = grub_util_get_image_size (kernel_path); + + total_module_size = sizeof (struct grub_module_info); + for (p = path_list; p; p = p->next) + total_module_size += (grub_util_get_image_size (p->name) + + sizeof (struct grub_module_header)); + + memdisk_size = 0; + if (memdisk_path) + { + memdisk_size = ALIGN_UP(grub_util_get_image_size (memdisk_path), 512); + grub_util_info ("the size of memory disk is 0x%x", memdisk_size); + total_module_size += memdisk_size + sizeof (struct grub_module_header); + } + + grub_util_info ("the total module size is 0x%x", total_module_size); + + kernel_img = xmalloc (kernel_size + total_module_size); + grub_util_load_image (kernel_path, kernel_img); + + if ((GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1) + > GRUB_KERNEL_MACHINE_DATA_END) + grub_util_error ("prefix too long"); + strcpy (kernel_img + GRUB_KERNEL_MACHINE_PREFIX, prefix); + + /* Fill in the grub_module_info structure. */ + modinfo = (struct grub_module_info *) (kernel_img + kernel_size); + modinfo->magic = GRUB_MODULE_MAGIC; + modinfo->offset = sizeof (struct grub_module_info); + modinfo->size = total_module_size; + + offset = kernel_size + sizeof (struct grub_module_info); + for (p = path_list; p; p = p->next) + { + struct grub_module_header *header; + size_t mod_size; + + mod_size = grub_util_get_image_size (p->name); + + header = (struct grub_module_header *) (kernel_img + offset); + header->type = grub_cpu_to_be32 (OBJ_TYPE_ELF); + header->size = grub_cpu_to_be32 (mod_size + sizeof (*header)); + offset += sizeof (*header); + + grub_util_load_image (p->name, kernel_img + offset); + offset += mod_size; + } + + if (memdisk_path) + { + struct grub_module_header *header; + + header = (struct grub_module_header *) (kernel_img + offset); + header->type = grub_cpu_to_be32 (OBJ_TYPE_MEMDISK); + header->size = grub_cpu_to_be32 (memdisk_size + sizeof (*header)); + offset += sizeof (*header); + + grub_util_load_image (memdisk_path, kernel_img + offset); + offset += memdisk_size; + } + + compress_kernel (kernel_img, kernel_size + total_module_size, + &core_img, &core_size); + + grub_util_info ("the core size is 0x%x", core_size); + + num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); + num <<= GRUB_DISK_SECTOR_BITS; + + boot_path = grub_util_get_path (dir, "diskboot.img"); + boot_size = grub_util_get_image_size (boot_path); + if (boot_size != GRUB_DISK_SECTOR_SIZE) + grub_util_error ("diskboot.img is not one sector size"); + + boot_img = grub_util_read_image (boot_path); + + /* sparc is a big endian architecture. */ + *((grub_uint32_t *) (boot_img + GRUB_DISK_SECTOR_SIZE + - GRUB_BOOT_MACHINE_LIST_SIZE + 8)) + = grub_cpu_to_be32 (num); + + grub_util_write_image (boot_img, boot_size, out); + free (boot_img); + free (boot_path); + + module_addr = (path_list + ? (GRUB_BOOT_MACHINE_IMAGE_ADDRESS + kernel_size) + : 0); + + grub_util_info ("the first module address is 0x%x", module_addr); + + *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE)) + = grub_cpu_to_be32 (total_module_size); + *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE)) + = grub_cpu_to_be32 (kernel_size); + + /* No compression support yet. */ + *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE)) + = grub_cpu_to_be32 (0); + + grub_util_write_image (core_img, core_size, out); + free (kernel_img); + free (core_img); + free (kernel_path); + + while (path_list) + { + struct grub_util_path_list *next = path_list->next; + free ((void *) path_list->name); + free (path_list); + path_list = next; + } +} + +static struct option options[] = + { + {"directory", required_argument, 0, 'd'}, + {"prefix", required_argument, 0, 'p'}, + {"memdisk", required_argument, 0, 'm'}, + {"output", required_argument, 0, 'o'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"verbose", no_argument, 0, 'v'}, + {0, 0, 0, 0} + }; + +static void +usage (int status) +{ + if (status) + fprintf (stderr, "Try ``grub-mkimage --help'' for more information.\n"); + else + printf ("\ +Usage: grub-mkimage [OPTION]... [MODULES]\n\ +\n\ +Make a bootable image of GRUB.\n\ +\n\ + -d, --directory=DIR use images and modules under DIR [default=%s]\n\ + -p, --prefix=DIR set grub_prefix directory [default=%s]\n\ + -m, --memdisk=FILE embed FILE as a memdisk image\n\ + -o, --output=FILE output a generated image to FILE [default=stdout]\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ +\n\ +Report bugs to <%s>.\n\ +", GRUB_LIBDIR, DEFAULT_DIRECTORY, PACKAGE_BUGREPORT); + + exit (status); +} + +int +main (int argc, char *argv[]) +{ + char *output = NULL; + char *dir = NULL; + char *prefix = NULL; + char *memdisk = NULL; + FILE *fp = stdout; + + progname = "grub-mkimage"; + while (1) + { + int c = getopt_long (argc, argv, "d:p:m:o:hVv", options, 0); + + if (c == -1) + break; + else + switch (c) + { + case 'o': + if (output) + free (output); + output = xstrdup (optarg); + break; + + case 'd': + if (dir) + free (dir); + dir = xstrdup (optarg); + break; + + case 'm': + if (memdisk) + free (memdisk); + memdisk = xstrdup (optarg); + + if (prefix) + free (prefix); + prefix = xstrdup ("(memdisk)/boot/grub"); + break; + + case 'h': + usage (0); + break; + + case 'p': + if (prefix) + free (prefix); + prefix = xstrdup (optarg); + break; + + case 'V': + printf ("grub-mkimage (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION); + return 0; + + case 'v': + verbosity++; + break; + + default: + usage (1); + break; + } + } + + if (output) + { + fp = fopen (output, "wb"); + if (! fp) + grub_util_error ("cannot open %s", output); + } + + generate_image (dir ? : GRUB_LIBDIR, + prefix ? : DEFAULT_DIRECTORY, fp, + argv + optind, memdisk); + + fclose (fp); + + if (dir) + free (dir); + + return 0; +} diff --git a/util/sparc64/ieee1275/grub-ofpathname.c b/util/sparc64/ieee1275/grub-ofpathname.c new file mode 100644 index 000000000..092826c21 --- /dev/null +++ b/util/sparc64/ieee1275/grub-ofpathname.c @@ -0,0 +1,39 @@ +/* grub-ofpathname.c - Find OpenBOOT path for a given device */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +int main(int argc, char **argv) +{ + char *of_path; + + if (argc != 2) + { + printf("Usage: grub-ofpathname DEVICE\n"); + return 1; + } + + of_path = grub_util_devname_to_ofpath (argv[1]); + printf("%s\n", of_path); + + free (of_path); + + return 0; +} diff --git a/util/sparc64/ieee1275/grub-setup.c b/util/sparc64/ieee1275/grub-setup.c new file mode 100644 index 000000000..6ca3a7aa1 --- /dev/null +++ b/util/sparc64/ieee1275/grub-setup.c @@ -0,0 +1,625 @@ +/* grub-setup.c - make GRUB usable */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +#define _GNU_SOURCE 1 +#include + +/* This program fills in various fields inside of the 'boot' and 'core' + * image files. + * + * The 'boot' image needs to know the OBP path name of the root + * device. It also needs to know the initial block number of + * 'core' (which is 'diskboot' concatenated with 'kernel' and + * all the modules, this is created by grub-mkimage). This resulting + * 'boot' image is 512 bytes in size and is placed in the first block + * of a partition. + * + * The initial 'diskboot' block acts as a loader for the actual GRUB + * kernel. It contains the loading code and then a block list. + * + * The block list of 'core' starts at the end of the 'diskboot' image + * and works it's way backwards towards the end of the code of 'diskboot'. + * + * We patch up the images with the necessary values and write out the + * result. + */ + +#define DEFAULT_BOOT_FILE "boot.img" +#define DEFAULT_CORE_FILE "core.img" + +/* This is the blocklist used in the diskboot image. */ +struct boot_blocklist +{ + grub_uint64_t start; + grub_uint32_t len; +} __attribute__ ((packed)); + +void +grub_putchar (int c) +{ + putchar (c); +} + +int +grub_getkey (void) +{ + return -1; +} + +struct grub_handler_class grub_term_input_class; +struct grub_handler_class grub_term_output_class; + +void +grub_refresh (void) +{ + fflush (stdout); +} + +static void +setup (const char *prefix, const char *dir, + const char *boot_file, const char *core_file, + const char *root, const char *dest) +{ + char *boot_path, *core_path; + char *boot_img, *core_img; + size_t boot_size, core_size; + grub_uint16_t core_sectors; + grub_device_t root_dev, dest_dev; + char *boot_devpath; + grub_disk_addr_t *kernel_sector; + struct boot_blocklist *first_block, *block; + char *tmp_img; + int i; + grub_disk_addr_t first_sector; + grub_uint16_t last_length = GRUB_DISK_SECTOR_SIZE; + grub_file_t file; + FILE *fp; + struct { grub_uint64_t start; grub_uint64_t end; } embed_region; + embed_region.start = embed_region.end = ~0UL; + + auto void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, + unsigned int offset, + unsigned int length); + auto void NESTED_FUNC_ATTR save_blocklists (grub_disk_addr_t sector, + unsigned int offset, + unsigned int length); + + void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, + unsigned int offset, + unsigned int length) + { + grub_util_info ("first sector is <%llu,%u,%u>", sector, offset, length); + + if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE) + grub_util_error ("The first sector of the core file " + "is not sector-aligned"); + + first_sector = sector; + } + + void NESTED_FUNC_ATTR save_blocklists (grub_disk_addr_t sector, + unsigned int offset, + unsigned int length) + { + struct boot_blocklist *prev = block + 1; + + grub_util_info ("saving <%llu,%u,%u>", sector, offset, length); + + if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE) + grub_util_error ("Non-sector-aligned data is found in the core file"); + + if (block != first_block + && (grub_be_to_cpu64 (prev->start) + + grub_be_to_cpu16 (prev->len)) == sector) + prev->len = grub_cpu_to_be16 (grub_be_to_cpu16 (prev->len) + 1); + else + { + block->start = grub_cpu_to_be64 (sector); + block->len = grub_cpu_to_be16 (1); + + block--; + if (block->len) + grub_util_error ("The sectors of the core file are too fragmented"); + } + + last_length = length; + } + + /* Read the boot image by the OS service. */ + boot_path = grub_util_get_path (dir, boot_file); + boot_size = grub_util_get_image_size (boot_path); + if (boot_size != GRUB_DISK_SECTOR_SIZE) + grub_util_error ("The size of `%s' is not %d", + boot_path, GRUB_DISK_SECTOR_SIZE); + boot_img = grub_util_read_image (boot_path); + free (boot_path); + + /* Set the addresses of variables in the boot image. */ + boot_devpath = (char *) (boot_img + + GRUB_BOOT_AOUT_HEADER_SIZE + + GRUB_BOOT_MACHINE_BOOT_DEVPATH); + kernel_sector = (grub_disk_addr_t *) (boot_img + + GRUB_BOOT_AOUT_HEADER_SIZE + + GRUB_BOOT_MACHINE_KERNEL_SECTOR); + + core_path = grub_util_get_path (dir, core_file); + core_size = grub_util_get_image_size (core_path); + core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) + >> GRUB_DISK_SECTOR_BITS); + if (core_size < GRUB_DISK_SECTOR_SIZE) + grub_util_error ("The size of `%s' is too small", core_path); + + core_img = grub_util_read_image (core_path); + free (core_path); + + /* Have FIRST_BLOCK to point to the first blocklist. */ + first_block = (struct boot_blocklist *) (core_img + + GRUB_DISK_SECTOR_SIZE + - sizeof (*block)); + + grub_util_info ("root is '%s' and dest is '%s'", root, dest); + + /* Open the root device and the destination device. */ + grub_util_info ("Opening root"); + root_dev = grub_device_open (root); + if (! root_dev) + grub_util_error ("%s", grub_errmsg); + + grub_util_info ("Opening dest"); + dest_dev = grub_device_open (dest); + if (! dest_dev) + grub_util_error ("%s", grub_errmsg); + + grub_util_info ("setting the root device to `%s'", root); + if (grub_env_set ("root", root) != GRUB_ERR_NONE) + grub_util_error ("%s", grub_errmsg); + + /* The core image must be put on a filesystem unfortunately. */ + grub_util_info ("will leave the core image on the filesystem"); + + /* Make sure that GRUB reads the identical image as the OS. */ + tmp_img = xmalloc (core_size); + core_path = grub_util_get_path (prefix, core_file); + + /* It is a Good Thing to sync two times. */ + sync (); + sync (); + +#define MAX_TRIES 5 + + for (i = 0; i < MAX_TRIES; i++) + { + grub_util_info ("attempting to read the core image `%s' from GRUB%s", + core_path, (i == 0) ? "" : " again"); + + grub_disk_cache_invalidate_all (); + + file = grub_file_open (core_path); + if (file) + { + if (grub_file_size (file) != core_size) + grub_util_info ("succeeded in opening the core image but the size is different (%d != %d)", + (int) grub_file_size (file), (int) core_size); + else if (grub_file_read (file, tmp_img, core_size) + != (grub_ssize_t) core_size) + grub_util_info ("succeeded in opening the core image but cannot read %d bytes", + (int) core_size); + else if (memcmp (core_img, tmp_img, core_size) != 0) + { +#if 0 + FILE *dump; + FILE *dump2; + + dump = fopen ("dump.img", "wb"); + if (dump) + { + fwrite (tmp_img, 1, core_size, dump); + fclose (dump); + } + + dump2 = fopen ("dump2.img", "wb"); + if (dump2) + { + fwrite (core_img, 1, core_size, dump2); + fclose (dump2); + } + +#endif + grub_util_info ("succeeded in opening the core image but the data is different"); + } + else + { + grub_file_close (file); + break; + } + + grub_file_close (file); + } + else + grub_util_info ("couldn't open the core image"); + + if (grub_errno) + grub_util_info ("error message = %s", grub_errmsg); + + grub_errno = GRUB_ERR_NONE; + sync (); + sleep (1); + } + + if (i == MAX_TRIES) + grub_util_error ("Cannot read `%s' correctly", core_path); + + /* Clean out the blocklists. */ + block = first_block; + while (block->len) + { + block->start = 0; + block->len = 0; + + block--; + + if ((char *) block <= core_img) + grub_util_error ("No terminator in the core image"); + } + + /* Now read the core image to determine where the sectors are. */ + file = grub_file_open (core_path); + if (! file) + grub_util_error ("%s", grub_errmsg); + + file->read_hook = save_first_sector; + if (grub_file_read (file, tmp_img, GRUB_DISK_SECTOR_SIZE) + != GRUB_DISK_SECTOR_SIZE) + grub_util_error ("Failed to read the first sector of the core image"); + + block = first_block; + file->read_hook = save_blocklists; + if (grub_file_read (file, tmp_img, core_size - GRUB_DISK_SECTOR_SIZE) + != (grub_ssize_t) core_size - GRUB_DISK_SECTOR_SIZE) + grub_util_error ("Failed to read the rest sectors of the core image"); + + grub_file_close (file); + + free (core_path); + free (tmp_img); + + *kernel_sector = grub_cpu_to_be64 (first_sector); + + strcpy(boot_devpath, dest); + + grub_util_info ("boot device path %s, prefix is %s, dest is %s", + boot_devpath, prefix, dest); + + /* Write the first two sectors of the core image onto the disk. */ + core_path = grub_util_get_path (dir, core_file); + grub_util_info ("opening the core image `%s'", core_path); + fp = fopen (core_path, "r+b"); + if (! fp) + grub_util_error ("Cannot open `%s'", core_path); + + grub_util_write_image (core_img, GRUB_DISK_SECTOR_SIZE, fp); + fclose (fp); + free (core_path); + + /* Write the boot image onto the disk. */ + if (grub_disk_write (dest_dev->disk, 1, 0, GRUB_DISK_SECTOR_SIZE, boot_img)) + grub_util_error ("%s", grub_errmsg); + + /* Sync is a Good Thing. */ + sync (); + + free (core_img); + free (boot_img); + grub_device_close (dest_dev); + grub_device_close (root_dev); +} + +static struct option options[] = + { + {"boot-image", required_argument, 0, 'b'}, + {"core-image", required_argument, 0, 'c'}, + {"directory", required_argument, 0, 'd'}, + {"device-map", required_argument, 0, 'm'}, + {"root-device", required_argument, 0, 'r'}, + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + {"verbose", no_argument, 0, 'v'}, + {0, 0, 0, 0} + }; + +static void +usage (int status) +{ + if (status) + fprintf (stderr, "Try ``grub-setup --help'' for more information.\n"); + else + printf ("\ +Usage: grub-setup [OPTION]... DEVICE\n\ +\n\ +Set up images to boot from DEVICE.\n\ +DEVICE must be a GRUB device (e.g. ``(hd0,1)'').\n\ +\n\ + -b, --boot-image=FILE use FILE as the boot image [default=%s]\n\ + -c, --core-image=FILE use FILE as the core image [default=%s]\n\ + -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n\ + -m, --device-map=FILE use FILE as the device map [default=%s]\n\ + -r, --root-device=DEV use DEV as the root device [default=guessed]\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ +\n\ +Report bugs to <%s>.\n\ +", + DEFAULT_BOOT_FILE, DEFAULT_CORE_FILE, DEFAULT_DIRECTORY, + DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT); + + exit (status); +} + +struct grub_setup_info +{ + char *boot_file; + char *core_file; + char *dir; + char *dev_map; + char *root_dev; + char *prefix; + char *dest_dev; +}; + +static void +init_info (struct grub_setup_info *gp) +{ + gp->boot_file = NULL; + gp->core_file = NULL; + gp->dir = NULL; + gp->dev_map = NULL; + gp->root_dev = NULL; + gp->prefix = NULL; + gp->dest_dev = NULL; +} + +static int +parse_options (struct grub_setup_info *gp, int argc, char *argv[]) +{ + while (1) + { + int c = getopt_long (argc, argv, "b:c:d:m:r:hVv", options, 0); + + if (c == -1) + break; + else + switch (c) + { + case 'b': + if (gp->boot_file) + free (gp->boot_file); + + gp->boot_file = xstrdup (optarg); + break; + + case 'c': + if (gp->core_file) + free (gp->core_file); + + gp->core_file = xstrdup (optarg); + break; + + case 'd': + if (gp->dir) + free (gp->dir); + + gp->dir = xstrdup (optarg); + break; + + case 'm': + if (gp->dev_map) + free (gp->dev_map); + + gp->dev_map = xstrdup (optarg); + break; + + case 'r': + if (gp->root_dev) + free (gp->root_dev); + + gp->root_dev = xstrdup (optarg); + break; + + case 'h': + usage (0); + break; + + case 'V': + printf ("grub-setup (%s) %s\n", PACKAGE_NAME, PACKAGE_VERSION); + return 0; + + case 'v': + verbosity++; + break; + + default: + usage (1); + break; + } + } + + if (verbosity > 1) + grub_env_set ("debug", "all"); + + if (optind >= argc) + { + fprintf (stderr, "No device is specified.\n"); + usage (1); + } + + if (optind + 1 != argc) + { + fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]); + usage (1); + } + return 1; +} + +static char * +get_device_name (char *dev) +{ + size_t len = strlen (dev); + + if (dev[0] != '(' || dev[len - 1] != ')') + return 0; + + dev[len - 1] = '\0'; + return dev + 1; +} + +static void +find_dest_dev (struct grub_setup_info *gp, char *argv[]) +{ + gp->dest_dev = get_device_name (argv[optind]); + if (! gp->dest_dev) + { + /* Possibly, the user specified an OS device file. */ + gp->dest_dev = grub_util_get_grub_dev (argv[optind]); + if (! gp->dest_dev) + { + fprintf (stderr, "Invalid device `%s'.\n", argv[optind]); + usage (1); + } + grub_util_info ("transformed OS device '%s' into GRUB device '%s'", + argv[optind], gp->dest_dev); + } + else + { + /* For simplicity. */ + gp->dest_dev = xstrdup (gp->dest_dev); + grub_util_info ("Using '%s' as GRUB device", gp->dest_dev); + } +} + +static void +check_root_dev (struct grub_setup_info *gp) +{ + if (gp->root_dev) + { + char *tmp = get_device_name (gp->root_dev); + + if (! tmp) + grub_util_error ("Invalid root device `%s'", gp->root_dev); + + tmp = xstrdup (tmp); + free (gp->root_dev); + gp->root_dev = tmp; + } + else + { + char *dir = gp->dir ? gp->dir : DEFAULT_DIRECTORY; + char *root_device = grub_guess_root_device (dir); + + gp->root_dev = grub_util_get_grub_dev (root_device); + if (! gp->root_dev) + { + grub_util_info ("guessing the root device failed, because of `%s'", + grub_errmsg); + grub_util_error ("Cannot guess the root device. " + "Specify the option ``--root-device''."); + } + grub_util_info ("Guessed root device '%s' and root_dev '%s' from " + "dir '%s'", root_device, gp->root_dev, dir); + } +} + +static void +free_memory (struct grub_setup_info *gp) +{ + free (gp->boot_file); + free (gp->core_file); + free (gp->dir); + free (gp->dev_map); + free (gp->root_dev); + free (gp->prefix); + free (gp->dest_dev); +} + +int +main (int argc, char *argv[]) +{ + struct grub_setup_info ginfo; + + progname = "grub-setup"; + + init_info (&ginfo); + if (!parse_options (&ginfo, argc, argv)) + return 0; + + /* Initialize the emulated biosdisk driver. */ + grub_util_biosdisk_init (ginfo.dev_map ? ginfo.dev_map : DEFAULT_DEVICE_MAP); + + /* Initialize all modules. */ + grub_init_all (); + + find_dest_dev (&ginfo, argv); + + ginfo.prefix = grub_get_prefix (ginfo.dir ? : DEFAULT_DIRECTORY); + + check_root_dev (&ginfo); + + /* Do the real work. */ + setup (ginfo.prefix, + ginfo.dir ? ginfo.dir : DEFAULT_DIRECTORY, + ginfo.boot_file ? ginfo.boot_file : DEFAULT_BOOT_FILE, + ginfo.core_file ? ginfo.core_file : DEFAULT_CORE_FILE, + ginfo.root_dev, ginfo.dest_dev); + + /* Free resources. */ + grub_fini_all (); + + free_memory (&ginfo); + + return 0; +} diff --git a/util/sparc64/ieee1275/misc.c b/util/sparc64/ieee1275/misc.c new file mode 100644 index 000000000..99b95132e --- /dev/null +++ b/util/sparc64/ieee1275/misc.c @@ -0,0 +1,33 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +#include + +void +grub_reboot (void) +{ + longjmp (main_env, 1); +} + +void +grub_halt (void) +{ + grub_reboot (); +} From c8c08833e336260b91e5ccd20a1ccbb5678333ba Mon Sep 17 00:00:00 2001 From: davem Date: Thu, 23 Apr 2009 10:03:41 +0000 Subject: [PATCH 0671/1707] * kern/sparc64/ieee1275/openfw.c: Unused, delete. --- ChangeLog | 4 + kern/sparc64/ieee1275/openfw.c | 373 --------------------------------- 2 files changed, 4 insertions(+), 373 deletions(-) delete mode 100644 kern/sparc64/ieee1275/openfw.c diff --git a/ChangeLog b/ChangeLog index 0d4097c4d..55d4f3779 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-04-23 David S. Miller + + * kern/sparc64/ieee1275/openfw.c: Unused, delete. + 2009-04-22 David S. Miller * kern/ieee1275/mmap.c (grub_machine_mmap_iterate): If size_cells diff --git a/kern/sparc64/ieee1275/openfw.c b/kern/sparc64/ieee1275/openfw.c deleted file mode 100644 index fe9ee96ce..000000000 --- a/kern/sparc64/ieee1275/openfw.c +++ /dev/null @@ -1,373 +0,0 @@ -/* openfw.c -- Open firmware support functions. */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2004,2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include /* Needed ? */ -#include - -enum grub_ieee1275_parse_type -{ - GRUB_PARSE_FILENAME, - GRUB_PARSE_PARTITION, -}; - -/* Walk children of 'devpath', calling hook for each. */ -grub_err_t -grub_children_iterate (char *devpath, - int (*hook) (struct grub_ieee1275_devalias *alias)) -{ - grub_ieee1275_phandle_t dev; - grub_ieee1275_phandle_t child; - - grub_ieee1275_finddevice (devpath, &dev); - if (((signed) dev) == -1) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown device"); - - grub_ieee1275_child (dev, &child); - if (((signed) child) == -1) - return grub_error (GRUB_ERR_BAD_DEVICE, "Device has no children"); - - do - { - /* XXX: Don't use hardcoded path lengths. */ - char childtype[64]; - char childpath[64]; - char childname[64]; - char fullname[64]; - struct grub_ieee1275_devalias alias; - grub_ssize_t actual; - - grub_ieee1275_get_property (child, "device_type", childtype, - sizeof childtype, &actual); - if (actual == -1) - continue; - - grub_ieee1275_package_to_path (child, childpath, sizeof childpath, - &actual); - if (actual == -1) - continue; - - grub_ieee1275_get_property (child, "name", childname, - sizeof childname, &actual); - if (actual == -1) - continue; - - grub_sprintf (fullname, "%s/%s", devpath, childname); - - alias.type = childtype; - alias.path = childpath; - alias.name = fullname; - hook (&alias); - } - while (grub_ieee1275_peer (child, &child)); - - return 0; -} - -/* Iterate through all device aliases. This function can be used to - find a device of a specific type. */ -grub_err_t -grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) -{ - grub_ieee1275_phandle_t devalias; - char aliasname[32]; - grub_ssize_t actual; - grub_ieee1275_cell_t flags; - struct grub_ieee1275_devalias alias; - - if (grub_ieee1275_finddevice ("/aliases", &devalias)) - return -1; - - aliasname[0] = '\0'; - - while (grub_ieee1275_next_property (devalias, aliasname, aliasname, &flags) != -1 - && ((signed) flags) != -1 ) - { - grub_ieee1275_phandle_t dev; - grub_ssize_t pathlen, typelen; - char *devpath, *devtype; - - grub_dprintf ("devalias", "devalias name = %s\n", aliasname); - - /* The property `name' is a special case we should skip. */ - if (!grub_strcmp (aliasname, "name")) - continue; - - grub_ieee1275_get_property_length (devalias, aliasname, &pathlen); - devpath = grub_malloc (pathlen); - if (! devpath) - return grub_errno; - - if (grub_ieee1275_get_property (devalias, aliasname, devpath, pathlen, - &actual)) - { - grub_dprintf ("devalias", "get_property (%s) failed\n", aliasname); - grub_free (devpath); - continue; - } - - if (grub_ieee1275_finddevice (devpath, &dev) || ((signed) dev) == -1) - { - grub_dprintf ("devalias", "finddevice (%s) failed\n", devpath); - grub_free (devpath); - continue; - } - - grub_ieee1275_get_property_length (dev, "device_type", &typelen); - devtype = grub_malloc (typelen); - if (! devtype) - { - grub_free (devpath); - return grub_errno; - } - if (grub_ieee1275_get_property (dev, "device_type", devtype, typelen, &actual)) - { - grub_dprintf ("devalias", "get device type failed\n"); - grub_free (devtype); - grub_free (devpath); - continue; - } - - alias.name = aliasname; - alias.path= devpath; - alias.type = devtype; - if((*hook) (&alias)) - { - grub_free (devtype); - grub_free (devpath); - break; - } - - grub_free (devtype); - grub_free (devpath); - } - - return 0; -} - -/* FIXME (sparc64) */ -#if 0 -/* Call the "map" method of /chosen/mmu. */ -static int -grub_map (grub_addr_t phys, grub_addr_t virt, grub_uint32_t size, - grub_uint8_t mode) -{ - struct map_args { - struct grub_ieee1275_common_hdr common; - char *method; - grub_ieee1275_ihandle_t ihandle; - grub_uint32_t mode; - grub_uint32_t size; - grub_uint32_t virt; - grub_uint32_t phys; - int catch_result; - } args; - grub_ieee1275_ihandle_t mmu; - grub_ssize_t len; - - grub_ieee1275_get_integer_property (grub_ieee1275_chosen, "mmu", &mmu, sizeof mmu, - &len); - if (len != sizeof mmu) - return -1; - - INIT_IEEE1275_COMMON (&args.common, "call-method", 6, 1); - args.method = "map"; - args.ihandle = mmu; - args.phys = phys; - args.virt = virt; - args.size = size; - args.mode = mode; /* Format is WIMG0PP. */ - - if (IEEE1275_CALL_ENTRY_FN (&args) == -1) - return -1; - - return args.catch_result; -} -#endif - -int -grub_claimmap (grub_addr_t addr, grub_size_t size) -{ - if (grub_ieee1275_claim (addr, size, 0, 0)) - return -1; - return 0; -} - -/* Get the device arguments of the Open Firmware node name `path'. */ -static char * -grub_ieee1275_get_devargs (const char *path) -{ - char *colon = grub_strchr (path, ':'); - - if (! colon) - return 0; - - return grub_strdup (colon + 1); -} - -/* Get the device path of the Open Firmware node name `path'. */ -static char * -grub_ieee1275_get_devname (const char *path) -{ - char *colon = grub_strchr (path, ':'); - char *newpath = 0; - int pathlen = grub_strlen (path); - auto int match_alias (struct grub_ieee1275_devalias *alias); - - int match_alias (struct grub_ieee1275_devalias *curalias) - { - /* briQ firmware can change capitalization in /chosen/bootpath. */ - if (! grub_strncasecmp (curalias->path, path, pathlen)) - { - newpath = grub_strndup (curalias->name, grub_strlen (curalias->name)); - return 1; - } - - return 0; - } - - if (colon) - pathlen = (int)(colon - path); - - /* Try to find an alias for this device. */ - grub_devalias_iterate (match_alias); - - if (! newpath) - newpath = grub_strdup (path); - - return newpath; -} - -static char * -grub_ieee1275_parse_args (const char *path, enum grub_ieee1275_parse_type ptype) -{ - char type[64]; /* XXX check size. */ - char *device = grub_ieee1275_get_devname (path); - char *args = grub_ieee1275_get_devargs (path); - char *ret = 0; - grub_ieee1275_phandle_t dev; - - if (!args) - /* Shouldn't happen. */ - return 0; - - /* We need to know what type of device it is in order to parse the full - file path properly. */ - if (grub_ieee1275_finddevice (device, &dev)) - { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Device %s not found\n", device); - goto fail; - } - if (grub_ieee1275_get_property (dev, "device_type", type, sizeof type, 0)) - { - grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "Device %s lacks a device_type property\n", device); - goto fail; - } - - if (!grub_strcmp ("block", type)) - { - /* The syntax of the device arguments is defined in the CHRP and PReP - IEEE1275 bindings: "[partition][,[filename]]". */ - char *comma = grub_strchr (args, ','); - - if (ptype == GRUB_PARSE_FILENAME) - { - if (comma) - { - char *filepath = comma + 1; - - ret = grub_malloc (grub_strlen (filepath) + 1); - /* Make sure filepath has leading backslash. */ - if (filepath[0] != '\\') - grub_sprintf (ret, "\\%s", filepath); - else - grub_strcpy (ret, filepath); - } - } - else if (ptype == GRUB_PARSE_PARTITION) - { - if (!comma) - ret = grub_strdup (args); - else - ret = grub_strndup (args, (grub_size_t)(comma - args)); - } - } - else - { - /* XXX Handle net devices by configuring & registering a grub_net_dev - here, then return its name? - Example path: "net:,,,,,". */ - grub_printf ("Unsupported type %s for device %s\n", type, device); - } - -fail: - grub_free (device); - grub_free (args); - return ret; -} - -char * -grub_ieee1275_get_filename (const char *path) -{ - return grub_ieee1275_parse_args (path, GRUB_PARSE_FILENAME); -} - -/* Convert a device name from IEEE1275 syntax to GRUB syntax. */ -char * -grub_ieee1275_encode_devname (const char *path) -{ - char *device = grub_ieee1275_get_devname (path); - char *partition = grub_ieee1275_parse_args (path, GRUB_PARSE_PARTITION); - char *encoding; - - if (partition) - { - unsigned int partno = grub_strtoul (partition, 0, 0); - - /* Assume partno will require less than five bytes to encode. */ - encoding = grub_malloc (grub_strlen (device) + 3 + 5); - grub_sprintf (encoding, "(%s,%d)", device, partno); - } - else - { - encoding = grub_malloc (grub_strlen (device) + 2); - grub_sprintf (encoding, "(%s)", device); - } - - grub_free (partition); - grub_free (device); - - return encoding; -} - -void -grub_reboot (void) -{ - grub_ieee1275_interpret ("reset-all", 0); -} - -void -grub_halt (void) -{ - grub_ieee1275_interpret ("power-off", 0); -} From 0d31250038439857332f9408e7304698ab171e3c Mon Sep 17 00:00:00 2001 From: davem Date: Fri, 24 Apr 2009 12:04:10 +0000 Subject: [PATCH 0672/1707] Avoiding openning same device multiple times in device iterator. * kern/device.c (grub_device_iterate): Define struct part_ent, and use it to build a list of partitions in interate_disk() and iterate_partition(). --- ChangeLog | 8 +++++++ kern/device.c | 58 ++++++++++++++++++++++++++++++++++++++------------- 2 files changed, 51 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 55d4f3779..d32bc2dfc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-04-24 David S. Miller + + Avoiding openning same device multiple times in device iterator. + + * kern/device.c: (grub_device_iterate): Define struct part_ent, + and use it to build a list of partitions in interate_disk() and + iterate_partition(). + 2009-04-23 David S. Miller * kern/sparc64/ieee1275/openfw.c: Unused, delete. diff --git a/kern/device.c b/kern/device.c index 60f25c192..184c3a27f 100644 --- a/kern/device.c +++ b/kern/device.c @@ -83,6 +83,12 @@ grub_device_iterate (int (*hook) (const char *name)) auto int iterate_partition (grub_disk_t disk, const grub_partition_t partition); + struct part_ent + { + struct part_ent *next; + char *name; + } *ents = NULL; + int iterate_disk (const char *disk_name) { grub_device_t dev; @@ -95,11 +101,28 @@ grub_device_iterate (int (*hook) (const char *name)) return 0; if (dev->disk && dev->disk->has_partitions) - if (grub_partition_iterate (dev->disk, iterate_partition)) - { - grub_device_close (dev); - return 1; - } + { + struct part_ent *p; + int ret = 0; + + (void) grub_partition_iterate (dev->disk, iterate_partition); + grub_device_close (dev); + + p = ents; + ents = NULL; + while (p != NULL) + { + struct part_ent *next = p->next; + + if (!ret) + ret = hook (p->name); + grub_free (p->name); + grub_free (p); + p = next; + } + + return ret; + } grub_device_close (dev); return 0; @@ -108,27 +131,32 @@ grub_device_iterate (int (*hook) (const char *name)) int iterate_partition (grub_disk_t disk, const grub_partition_t partition) { char *partition_name; - char *device_name; - int ret; + struct part_ent *p; partition_name = grub_partition_get_name (partition); if (! partition_name) return 1; - - device_name = grub_malloc (grub_strlen (disk->name) + 1 - + grub_strlen (partition_name) + 1); - if (! device_name) + + p = grub_malloc (sizeof (*p)); + if (!p) + return 1; + + p->name = grub_malloc (grub_strlen (disk->name) + 1 + + grub_strlen (partition_name) + 1); + if (! p->name) { + grub_free (p); grub_free (partition_name); return 1; } - grub_sprintf (device_name, "%s,%s", disk->name, partition_name); + grub_sprintf (p->name, "%s,%s", disk->name, partition_name); grub_free (partition_name); - ret = hook (device_name); - grub_free (device_name); - return ret; + p->next = ents; + ents = p; + + return 0; } /* Only disk devices are supported at the moment. */ From ac20caff547e25ea0cdbe5e79eeb86116b8d9b64 Mon Sep 17 00:00:00 2001 From: davem Date: Fri, 24 Apr 2009 12:05:14 +0000 Subject: [PATCH 0673/1707] * disk/fs_uuid.c (grub_fs_uuid_close): Call grub_disk_close() on disk->data. --- ChangeLog | 3 +++ disk/fs_uuid.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index d32bc2dfc..19e43f953 100644 --- a/ChangeLog +++ b/ChangeLog @@ -6,6 +6,9 @@ and use it to build a list of partitions in interate_disk() and iterate_partition(). + * disk/fs_uuid.c (grub_fs_uuid_close): Call grub_disk_close() + on disk->data. + 2009-04-23 David S. Miller * kern/sparc64/ieee1275/openfw.c: Unused, delete. diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c index 125d29b21..9d83bb843 100644 --- a/disk/fs_uuid.c +++ b/disk/fs_uuid.c @@ -97,6 +97,8 @@ grub_fs_uuid_open (const char *name, grub_disk_t disk) static void grub_fs_uuid_close (grub_disk_t disk __attribute((unused))) { + grub_disk_t parent = disk->data; + grub_disk_close (parent); } static grub_err_t From 0dcf7495d97963f1d4a5803754ad6986a96f4670 Mon Sep 17 00:00:00 2001 From: davem Date: Fri, 24 Apr 2009 12:05:54 +0000 Subject: [PATCH 0674/1707] * disk/ieee1275/nand.c (grub_nand_iterate): Return grub_devalias_iterate() result instead of unconditional 0. * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Likewise. Also, capture hook return value, either directly or via grub_children_iterate(), and propagate to caller. * include/grub/ieee1275/ieee1275.h (grub_devalias_iterate, grub_children_iterate): Return value is now 'int' instead of 'grub_err_t'. * kern/ieee1275/openfw.c (grub_children_iterate): Fix to behave like a proper iterator, stopping when hooks return non-zero. (grub_devalias_iterate): Likewise. --- ChangeLog | 12 ++++++++++ disk/ieee1275/nand.c | 3 +-- disk/ieee1275/ofdisk.c | 11 +++++---- include/grub/ieee1275/ieee1275.h | 4 ++-- kern/ieee1275/openfw.c | 40 ++++++++++++++++++-------------- 5 files changed, 44 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index 19e43f953..1c490ee51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -9,6 +9,18 @@ * disk/fs_uuid.c (grub_fs_uuid_close): Call grub_disk_close() on disk->data. + * disk/ieee1275/nand.c (grub_nand_iterate): Return + grub_devalias_iterate() result instead of unconditional 0. + * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Likewise. + Also, capture hook return value, either directly or via + grub_children_iterate(), and propagate to caller. + * include/grub/ieee1275/ieee1275.h (grub_devalias_iterate, + grub_children_iterate): Return value is now 'int' instead of + 'grub_err_t'. + * kern/ieee1275/openfw.c (grub_children_iterate): Fix to behave + like a proper iterator, stopping when hooks return non-zero. + (grub_devalias_iterate): Likewise. + 2009-04-23 David S. Miller * kern/sparc64/ieee1275/openfw.c: Unused, delete. diff --git a/disk/ieee1275/nand.c b/disk/ieee1275/nand.c index ed50768a8..37427f884 100644 --- a/disk/ieee1275/nand.c +++ b/disk/ieee1275/nand.c @@ -44,8 +44,7 @@ grub_nand_iterate (int (*hook) (const char *name)) return 0; } - grub_devalias_iterate (dev_iterate); - return 0; + return grub_devalias_iterate (dev_iterate); } static grub_err_t diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index a56433d3e..202be2455 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -77,6 +77,8 @@ grub_ofdisk_iterate (int (*hook) (const char *name)) int dev_iterate (struct grub_ieee1275_devalias *alias) { + int ret = 0; + grub_dprintf ("disk", "disk name = %s\n", alias->name); if (grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_OFDISK_SDCARD_ONLY)) @@ -105,17 +107,16 @@ grub_ofdisk_iterate (int (*hook) (const char *name)) } if (! grub_strcmp (alias->type, "block")) - hook (alias->name); + ret = hook (alias->name); else if ((! grub_strcmp (alias->type, "scsi")) || (! grub_strcmp (alias->type, "ide")) || (! grub_strcmp (alias->type, "ata"))) /* Search for block-type children of these bus controllers. */ - grub_children_iterate (alias->name, dev_iterate); - return 0; + ret = grub_children_iterate (alias->name, dev_iterate); + return ret; } - grub_devalias_iterate (dev_iterate); - return 0; + return grub_devalias_iterate (dev_iterate); } static grub_err_t diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index ed02f5214..751055fc1 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -166,9 +166,9 @@ int EXPORT_FUNC(grub_ieee1275_set_color) (grub_ieee1275_ihandle_t ihandle, int EXPORT_FUNC(grub_ieee1275_milliseconds) (grub_uint32_t *msecs); -grub_err_t EXPORT_FUNC(grub_devalias_iterate) +int EXPORT_FUNC(grub_devalias_iterate) (int (*hook) (struct grub_ieee1275_devalias *alias)); -grub_err_t EXPORT_FUNC(grub_children_iterate) (char *devpath, +int EXPORT_FUNC(grub_children_iterate) (char *devpath, int (*hook) (struct grub_ieee1275_devalias *alias)); grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index 83bac6504..b23149e7e 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -32,36 +32,37 @@ enum grub_ieee1275_parse_type }; /* Walk children of 'devpath', calling hook for each. */ -grub_err_t +int grub_children_iterate (char *devpath, - int (*hook) (struct grub_ieee1275_devalias *alias)) + int (*hook) (struct grub_ieee1275_devalias *alias)) { grub_ieee1275_phandle_t dev; grub_ieee1275_phandle_t child; char *childtype, *childpath; char *childname, *fullname; + int ret = 0; if (grub_ieee1275_finddevice (devpath, &dev)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Unknown device"); + return 0; if (grub_ieee1275_child (dev, &child)) - return grub_error (GRUB_ERR_BAD_DEVICE, "Device has no children"); + return 0; childtype = grub_malloc (IEEE1275_MAX_PROP_LEN); if (!childtype) - return grub_errno; + return 0; childpath = grub_malloc (IEEE1275_MAX_PATH_LEN); if (!childpath) { grub_free (childtype); - return grub_errno; + return 0; } childname = grub_malloc (IEEE1275_MAX_PROP_LEN); if (!childname) { grub_free (childpath); grub_free (childtype); - return grub_errno; + return 0; } fullname = grub_malloc (IEEE1275_MAX_PATH_LEN); if (!fullname) @@ -69,7 +70,7 @@ grub_children_iterate (char *devpath, grub_free (childname); grub_free (childpath); grub_free (childtype); - return grub_errno; + return 0; } do @@ -94,7 +95,9 @@ grub_children_iterate (char *devpath, alias.type = childtype; alias.path = childpath; alias.name = fullname; - hook (&alias); + ret = hook (&alias); + if (ret) + break; } while (grub_ieee1275_peer (child, &child)); @@ -103,30 +106,31 @@ grub_children_iterate (char *devpath, grub_free (childpath); grub_free (childtype); - return 0; + return ret; } /* Iterate through all device aliases. This function can be used to find a device of a specific type. */ -grub_err_t +int grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) { grub_ieee1275_phandle_t aliases; char *aliasname, *devtype; grub_ssize_t actual; struct grub_ieee1275_devalias alias; + int ret = 0; if (grub_ieee1275_finddevice ("/aliases", &aliases)) - return -1; + return 0; aliasname = grub_malloc (IEEE1275_MAX_PROP_LEN); if (!aliasname) - return grub_errno; + return 0; devtype = grub_malloc (IEEE1275_MAX_PROP_LEN); if (!devtype) { grub_free (aliasname); - return grub_errno; + return 0; } /* Find the first property. */ @@ -155,7 +159,7 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) { grub_free (devtype); grub_free (aliasname); - return grub_errno; + return 0; } if (grub_ieee1275_get_property (aliases, aliasname, devpath, pathlen, @@ -182,15 +186,17 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) alias.name = aliasname; alias.path = devpath; alias.type = devtype; - hook (&alias); + ret = hook (&alias); nextprop: grub_free (devpath); + if (ret) + break; } grub_free (devtype); grub_free (aliasname); - return 0; + return ret; } /* Call the "map" method of /chosen/mmu. */ From 91b72b4f42f46b700421236eda50cd190a332e47 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 24 Apr 2009 17:05:19 +0000 Subject: [PATCH 0675/1707] Really remove lib/datetime.c and include/grub/lib/datetime.h --- include/grub/lib/datetime.h | 0 lib/datetime.c | 0 2 files changed, 0 insertions(+), 0 deletions(-) delete mode 100644 include/grub/lib/datetime.h delete mode 100644 lib/datetime.c diff --git a/include/grub/lib/datetime.h b/include/grub/lib/datetime.h deleted file mode 100644 index e69de29bb..000000000 diff --git a/lib/datetime.c b/lib/datetime.c deleted file mode 100644 index e69de29bb..000000000 From e4343593581e8d3ea52f0a5c25ac73bfed0e2e43 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 25 Apr 2009 12:18:25 +0000 Subject: [PATCH 0676/1707] 2009-04-25 Vladimir Serbinenko Parttool autoloading and improvements * Makefile.in (pkglib_DATA): add parttool.lst (parttool.lst): new target * genmk.rb: generate parttool-* (CLEANFILES): add #{parttool} (PARTTOOLFILES): new variable * genparttoollist.sh: new file * parttool/pcpart.c (grub_pcpart_boot): more feedback (grub_pcpart_type): likewise * commands/parttool.c (helpmsg): new variable (grub_cmd_parttool): output help if not enough arguments are supplied autoload modules (GRUB_MOD_INIT(parttool)): use helpmsg --- ChangeLog | 17 ++++ Makefile.in | 5 +- commands/parttool.c | 185 +++++++++++++++++++++++++++++++------------- genmk.rb | 9 ++- genparttoollist.sh | 19 +++++ parttool/pcpart.c | 7 +- 6 files changed, 185 insertions(+), 57 deletions(-) create mode 100644 genparttoollist.sh diff --git a/ChangeLog b/ChangeLog index 1c490ee51..474654e68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2009-04-25 Vladimir Serbinenko + + Parttool autoloading and improvements + + * Makefile.in (pkglib_DATA): add parttool.lst + (parttool.lst): new target + * genmk.rb: generate parttool-* + (CLEANFILES): add #{parttool} + (PARTTOOLFILES): new variable + * genparttoollist.sh: new file + * parttool/pcpart.c (grub_pcpart_boot): more feedback + (grub_pcpart_type): likewise + * commands/parttool.c (helpmsg): new variable + (grub_cmd_parttool): output help if not enough arguments are supplied + autoload modules + (GRUB_MOD_INIT(parttool)): use helpmsg + 2009-04-24 David S. Miller Avoiding openning same device multiple times in device iterator. diff --git a/Makefile.in b/Makefile.in index b24ee2ed8..f73192e5e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -139,7 +139,7 @@ include $(srcdir)/conf/$(target_cpu)-$(platform).mk ### General targets. CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) -pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst handler.lst +pkglib_DATA += moddep.lst command.lst fs.lst partmap.lst parttool.lst handler.lst moddep.lst: $(DEFSYMFILES) $(UNDSYMFILES) genmoddep.awk cat $(DEFSYMFILES) /dev/null \ | $(AWK) -f $(srcdir)/genmoddep.awk $(UNDSYMFILES) > $@ \ @@ -157,6 +157,9 @@ partmap.lst: $(PARTMAPFILES) handler.lst: $(HANDLERFILES) cat $^ /dev/null | sort > $@ +parttool.lst: $(PARTTOOLFILES) + cat $^ /dev/null | sort | uniq > $@ + ifeq (, $(UNIFONT_BDF)) else diff --git a/commands/parttool.c b/commands/parttool.c index 6eec13b1c..b09a2bac0 100644 --- a/commands/parttool.c +++ b/commands/parttool.c @@ -33,6 +33,10 @@ static struct grub_parttool *parts = 0; static int curhandle = 0; static grub_dl_t mymod; +static char helpmsg[] = + "perform COMMANDS on partition.\n" + "Use \"parttool PARTITION help\" for the list " + "of available commands"; int grub_parttool_register(const char *part_name, @@ -101,8 +105,53 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), int i, j; grub_err_t err = GRUB_ERR_NONE; - if (argc < 2) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments"); + auto grub_err_t show_help (void); + grub_err_t show_help (void) + { + int found = 0; + for (cur = parts; cur; cur = cur->next) + if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0) + { + struct grub_parttool_argdesc *curarg; + found = 1; + for (curarg = cur->args; curarg->name; curarg++) + { + int spacing = 20; + + spacing -= grub_strlen (curarg->name); + grub_printf ("%s", curarg->name); + + switch (curarg->type) + { + case GRUB_PARTTOOL_ARG_BOOL: + grub_printf ("+/-"); + spacing -= 3; + break; + + case GRUB_PARTTOOL_ARG_VAL: + grub_printf ("=VAL"); + spacing -= 4; + break; + + case GRUB_PARTTOOL_ARG_END: + break; + } + while (spacing-- > 0) + grub_printf (" "); + grub_printf ("%s\n", curarg->desc); + } + } + if (! found) + grub_printf ("Sorry no parttool is available for %s\n", + dev->disk->partition->partmap->name); + return GRUB_ERR_NONE; + } + + if (argc < 1) + { + grub_printf ("%s\n", helpmsg); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "too few arguments"); + } if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') { @@ -128,50 +177,77 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a partition"); } - parsed = (int *) grub_malloc (argc * sizeof (int)); - grub_memset (parsed, 0, argc * sizeof (int)); + /* Load modules. */ +#ifndef GRUB_UTIL + { + const char *prefix; + prefix = grub_env_get ("prefix"); + if (prefix) + { + char *filename; + + filename = grub_malloc (grub_strlen (prefix) + sizeof ("/parttool.lst")); + if (filename) + { + grub_file_t file; + + grub_sprintf (filename, "%s/parttool.lst", prefix); + file = grub_file_open (filename); + if (file) + { + char *buf = 0; + for (;; grub_free(buf)) + { + char *p, *name; + + buf = grub_file_getline (file); + + if (! buf) + break; + + name = buf; + + if (! grub_isgraph (name[0])) + continue; + + p = grub_strchr (name, ':'); + if (! p) + continue; + + *p = '\0'; + while (*++p == ' ') + ; + + if (! grub_isgraph (*p)) + continue; + + if (grub_strcmp (name, dev->disk->partition->partmap->name) + != 0) + continue; + + grub_dl_load (p); + } + + grub_file_close (file); + } + + grub_free (filename); + } + } + /* Ignore errors. */ + grub_errno = GRUB_ERR_NONE; + } +#endif + + if (argc == 1) + return show_help (); for (i = 1; i < argc; i++) - if (!grub_strcmp (args[i], "help")) - { - int found = 0; - for (cur = parts; cur; cur = cur->next) - if (! grub_strcmp (dev->disk->partition->partmap->name, cur->name)) - { - struct grub_parttool_argdesc *curarg; - found = 1; - for (curarg = cur->args; curarg->name; curarg++) - { - int spacing = 20; - - spacing -= grub_strlen (curarg->name); - grub_printf ("%s", curarg->name); + if (grub_strcmp (args[i], "help") == 0) + return show_help (); - switch (curarg->type) - { - case GRUB_PARTTOOL_ARG_BOOL: - grub_printf ("+/-"); - spacing -= 3; - break; - - case GRUB_PARTTOOL_ARG_VAL: - grub_printf ("=VAL"); - spacing -= 4; - break; - - case GRUB_PARTTOOL_ARG_END: - break; - } - while (spacing-- > 0) - grub_printf (" "); - grub_printf ("%s\n", curarg->desc); - } - } - if (! found) - grub_printf ("Sorry no parttool is available for %s\n", - dev->disk->partition->partmap->name); - return GRUB_ERR_NONE; - } + parsed = (int *) grub_malloc (argc * sizeof (int)); + grub_memset (parsed, 0, argc * sizeof (int)); for (i = 1; i < argc; i++) if (! parsed[i]) @@ -179,14 +255,15 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), struct grub_parttool_argdesc *curarg; struct grub_parttool_args *pargs; for (cur = parts; cur; cur = cur->next) - if (! grub_strcmp (dev->disk->partition->partmap->name, cur->name)) + if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0) { for (curarg = cur->args; curarg->name; curarg++) - if (!grub_strncmp (curarg->name, args[i], - grub_strlen (curarg->name)) + if (grub_strncmp (curarg->name, args[i], + grub_strlen (curarg->name)) == 0 && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL && (args[i][grub_strlen (curarg->name)] == '+' - || args[i][grub_strlen (curarg->name)] == '-')) + || args[i][grub_strlen (curarg->name)] == '-' + || args[i][grub_strlen (curarg->name)] == 0)) || (curarg->type == GRUB_PARTTOOL_ARG_VAL && args[i][grub_strlen (curarg->name)] == '='))) @@ -203,14 +280,15 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), grub_memset (pargs, 0, ptool->nargs * sizeof (struct grub_parttool_args)); for (j = i; j < argc; j++) - if (!parsed[j]) + if (! parsed[j]) { for (curarg = ptool->args; curarg->name; curarg++) - if (!grub_strncmp (curarg->name, args[i], - grub_strlen (curarg->name)) + if (grub_strncmp (curarg->name, args[i], + grub_strlen (curarg->name)) == 0 && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL && (args[j][grub_strlen (curarg->name)] == '+' - || args[j][grub_strlen (curarg->name)] == '-')) + || args[j][grub_strlen (curarg->name)] == '-' + || args[j][grub_strlen (curarg->name)] == 0)) || (curarg->type == GRUB_PARTTOOL_ARG_VAL && args[j][grub_strlen (curarg->name)] == '='))) { @@ -240,6 +318,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), break; } + grub_free (parsed); grub_device_close (dev); return err; } @@ -252,9 +331,7 @@ GRUB_MOD_INIT(parttool) mymod = mod; cmd = grub_register_command ("parttool", grub_cmd_parttool, "parttool PARTITION COMMANDS", - "perform COMMANDS on partition." - " use parttool PARTITION help for the list " - " of available commands"); + helpmsg); } GRUB_MOD_FINI(parttool) diff --git a/genmk.rb b/genmk.rb index b619421e1..3532cd876 100644 --- a/genmk.rb +++ b/genmk.rb @@ -144,6 +144,7 @@ endif fs = 'fs-' + obj.suffix('lst') partmap = 'partmap-' + obj.suffix('lst') handler = 'handler-' + obj.suffix('lst') + parttool = 'parttool-' + obj.suffix('lst') dep = deps[i] flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end @@ -153,9 +154,10 @@ endif $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} -CLEANFILES += #{command} #{fs} #{partmap} #{handler} +CLEANFILES += #{command} #{fs} #{partmap} #{handler} #{parttool} COMMANDFILES += #{command} FSFILES += #{fs} +PARTTOOLFILES += #{parttool} PARTMAPFILES += #{partmap} HANDLERFILES += #{handler} @@ -169,6 +171,11 @@ HANDLERFILES += #{handler} $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ | sh $(srcdir)/genfslist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) +#{parttool}: #{src} $(#{src}_DEPENDENCIES) genparttoollist.sh + set -e; \ + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ + | sh $(srcdir)/genparttoollist.sh #{symbolic_name} > $@ || (rm -f $@; exit 1) + #{partmap}: #{src} $(#{src}_DEPENDENCIES) genpartmaplist.sh set -e; \ $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -E $< \ diff --git a/genparttoollist.sh b/genparttoollist.sh new file mode 100644 index 000000000..c7ffc81b6 --- /dev/null +++ b/genparttoollist.sh @@ -0,0 +1,19 @@ +#! /bin/sh +# +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# This gensymlist.sh is free software; the author +# gives unlimited permission to copy and/or distribute it, +# with or without modifications, as long as this notice is preserved. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A +# PARTICULAR PURPOSE. + +# Read source code from stdin and detect parttool names. + +module=$1 + +grep -v "^#" | sed -n \ + -e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" \ No newline at end of file diff --git a/parttool/pcpart.c b/parttool/pcpart.c index 59f24bac8..a2b9452d9 100644 --- a/parttool/pcpart.c +++ b/parttool/pcpart.c @@ -63,9 +63,13 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev, for (i = 0; i < 4; i++) mbr.entries[i].flag = 0x0; mbr.entries[index].flag = 0x80; + grub_printf ("Partition %d is active now. \n", index); } else - mbr.entries[index].flag = 0x0; + { + mbr.entries[index].flag = 0x0; + grub_printf ("Cleared active flag on %d. \n", index); + } /* Write the MBR. */ grub_disk_write (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr); @@ -123,6 +127,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, } mbr.entries[index].type = type; + grub_printf ("Setting partition type to 0x%x\n", type); /* Write the parttable. */ grub_disk_write (dev->disk, part->offset, 0, From 033b10a80a601a183d6ad9e95b015306f1e08d4b Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 25 Apr 2009 12:29:08 +0000 Subject: [PATCH 0677/1707] 2009-04-25 Vladimir Serbinenko Test command * commands/test.c: rewritten to use bash-like test --- ChangeLog | 6 + commands/test.c | 395 +++++++++++++++++++++++++++++++++++++++++++++--- 2 files changed, 382 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 474654e68..cb78fdba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-25 Vladimir Serbinenko + + Test command + + * commands/test.c: rewritten to use bash-like test + 2009-04-25 Vladimir Serbinenko Parttool autoloading and improvements diff --git a/commands/test.c b/commands/test.c index a9c82814d..8a15d3911 100644 --- a/commands/test.c +++ b/commands/test.c @@ -21,33 +21,390 @@ #include #include #include +#include +#include +#include #include +/* A simple implementation for signed numbers. */ +static int +grub_strtosl (char *arg, char **end, int base) +{ + if (arg[0] == '-') + return -grub_strtoul (arg + 1, end, base); + return grub_strtoul (arg, end, base); +} + +/* Parse a test expression startion from *argn. */ +static int +test_parse (char **args, int *argn, int argc) +{ + int ret = 0, discard = 0, invert = 0; + int file_exists; + struct grub_dirhook_info file_info; + + auto void update_val (int val); + auto void get_fileinfo (char *pathname); + + /* Take care of discarding and inverting. */ + void update_val (int val) + { + if (! discard) + ret = invert ? ! val : val; + invert = discard = 0; + } + + /* Check if file exists and fetch its information. */ + void get_fileinfo (char *pathname) + { + char *filename, *path; + char *device_name; + grub_fs_t fs; + grub_device_t dev; + + /* A hook for iterating directories. */ + auto int find_file (const char *cur_filename, + struct grub_dirhook_info info); + int find_file (const char *cur_filename, struct grub_dirhook_info info) + { + if ((info.case_insensitive ? grub_strcasecmp (cur_filename, filename) + : grub_strcmp (cur_filename, filename)) == 0) + { + file_info = info; + file_exists = 1; + return 1; + } + return 0; + } + + file_exists = 0; + device_name = grub_file_get_device_name (pathname); + dev = grub_device_open (device_name); + if (! dev) + { + grub_free (device_name); + return; + } + + fs = grub_fs_probe (dev); + path = grub_strchr (pathname, ')'); + if (! path) + path = pathname; + else + path++; + + /* Remove trailing '/'. */ + while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') + pathname[grub_strlen (pathname) - 1] = 0; + + /* Split into path and filename. */ + filename = grub_strrchr (pathname, '/'); + if (! filename) + { + path = grub_strdup ("/"); + filename = pathname; + } + else + { + filename++; + path = grub_strdup (pathname); + path[filename - pathname] = 0; + } + + /* It's the whole device. */ + if (! *pathname) + { + file_exists = 1; + grub_memset (&file_info, 0, sizeof (file_info)); + /* Root is always a directory. */ + file_info.dir = 1; + + /* Fetch writing time. */ + file_info.mtimeset = 0; + if (fs->mtime) + { + if (! fs->mtime (dev, &file_info.mtime)) + file_info.mtimeset = 1; + grub_errno = GRUB_ERR_NONE; + } + } + else + (fs->dir) (dev, path, find_file); + + grub_device_close (dev); + grub_free (path); + grub_free (device_name); + } + + /* Here we have the real parsing. */ + while (*argn < argc) + { + /* First try 3 argument tests. */ + if (*argn + 2 < argc) + { + /* String tests. */ + if (grub_strcmp (args[*argn + 1], "=") == 0 + || grub_strcmp (args[*argn + 1], "==") == 0) + { + update_val (grub_strcmp (args[*argn], args[*argn + 2]) == 0); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], "!=") == 0) + { + update_val (grub_strcmp (args[*argn], args[*argn + 2]) != 0); + (*argn) += 3; + continue; + } + + /* GRUB extension: lexicographical sorting. */ + if (grub_strcmp (args[*argn + 1], "<") == 0) + { + update_val (grub_strcmp (args[*argn], args[*argn + 2]) < 0); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], "<=") == 0) + { + update_val (grub_strcmp (args[*argn], args[*argn + 2]) <= 0); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], ">") == 0) + { + update_val (grub_strcmp (args[*argn], args[*argn + 2]) > 0); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], ">=") == 0) + { + update_val (grub_strcmp (args[*argn], args[*argn + 2]) >= 0); + (*argn) += 3; + continue; + } + + /* Number tests. */ + if (grub_strcmp (args[*argn + 1], "-eq") == 0) + { + update_val (grub_strtosl (args[*argn], 0, 0) + == grub_strtosl (args[*argn + 2], 0, 0)); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], "-ge") == 0) + { + update_val (grub_strtosl (args[*argn], 0, 0) + >= grub_strtosl (args[*argn + 2], 0, 0)); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], "-gt") == 0) + { + update_val (grub_strtosl (args[*argn], 0, 0) + > grub_strtosl (args[*argn + 2], 0, 0)); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], "-le") == 0) + { + update_val (grub_strtosl (args[*argn], 0, 0) + <= grub_strtosl (args[*argn + 2], 0, 0)); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], "-lt") == 0) + { + update_val (grub_strtosl (args[*argn], 0, 0) + < grub_strtosl (args[*argn + 2], 0, 0)); + (*argn) += 3; + continue; + } + + if (grub_strcmp (args[*argn + 1], "-ne") == 0) + { + update_val (grub_strtosl (args[*argn], 0, 0) + != grub_strtosl (args[*argn + 2], 0, 0)); + (*argn) += 3; + continue; + } + + /* GRUB extension: compare numbers skipping prefixes. + Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */ + if (grub_strcmp (args[*argn + 1], "-pgt") == 0 + || grub_strcmp (args[*argn + 1], "-plt") == 0) + { + int i; + /* Skip common prefix. */ + for (i = 0; args[*argn][i] == args[*argn + 2][i] + && args[*argn][i]; i++); + + /* Go the digits back. */ + i--; + while (grub_isdigit (args[*argn][i]) && i > 0) + i--; + i++; + + if (grub_strcmp (args[*argn + 1], "-pgt") == 0) + update_val (grub_strtoul (args[*argn] + i, 0, 0) + > grub_strtoul (args[*argn + 2] + i, 0, 0)); + else + update_val (grub_strtoul (args[*argn] + i, 0, 0) + < grub_strtoul (args[*argn + 2] + i, 0, 0)); + (*argn) += 3; + continue; + } + + /* -nt and -ot tests. GRUB extension: when doing -?t bias + will be added to the first mtime. */ + if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0 + || grub_memcmp (args[*argn + 1], "-ot", 3) == 0) + { + struct grub_dirhook_info file1; + int file1exists; + int bias = 0; + + /* Fetch fileinfo. */ + get_fileinfo (args[*argn]); + file1 = file_info; + file1exists = file_exists; + get_fileinfo (args[*argn + 2]); + + if (args[*argn + 1][3]) + bias = grub_strtosl (args[*argn + 1] + 3, 0, 0); + + if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0) + update_val ((file1exists && ! file_exists) + || (file1.mtimeset && file_info.mtimeset + && file1.mtime + bias > file_info.mtime)); + else + update_val ((! file1exists && file_exists) + || (file1.mtimeset && file_info.mtimeset + && file1.mtime + bias < file_info.mtime)); + (*argn) += 3; + continue; + } + } + + /* Two-argument tests. */ + if (*argn + 1 < argc) + { + /* File tests. */ + if (grub_strcmp (args[*argn], "-d") == 0) + { + get_fileinfo (args[*argn + 1]); + update_val (file_exists && file_info.dir); + (*argn) += 2; + return ret; + } + + if (grub_strcmp (args[*argn], "-e") == 0) + { + get_fileinfo (args[*argn + 1]); + update_val (file_exists); + (*argn) += 2; + return ret; + } + + if (grub_strcmp (args[*argn], "-f") == 0) + { + get_fileinfo (args[*argn + 1]); + /* FIXME: check for other types. */ + update_val (file_exists && ! file_info.dir); + (*argn) += 2; + return ret; + } + + if (grub_strcmp (args[*argn], "-s") == 0) + { + grub_file_t file; + file = grub_file_open (args[*argn + 1]); + update_val (file && (grub_file_size (file) != 0)); + if (file) + grub_file_close (file); + grub_errno = GRUB_ERR_NONE; + (*argn) += 2; + return ret; + } + + /* String tests. */ + if (grub_strcmp (args[*argn], "-n") == 0) + { + update_val (args[*argn + 1][0]); + + (*argn) += 2; + continue; + } + if (grub_strcmp (args[*argn], "-z") == 0) + { + update_val (! args[*argn + 1][0]); + (*argn) += 2; + continue; + } + } + + /* Special modifiers. */ + + /* End of expression. return to parent. */ + if (grub_strcmp (args[*argn], ")") == 0) + { + (*argn)++; + return ret; + } + /* Recursively invoke if parenthesis. */ + if (grub_strcmp (args[*argn], "(") == 0) + { + (*argn)++; + update_val (test_parse (args, argn, argc)); + continue; + } + + if (grub_strcmp (args[*argn], "!") == 0) + { + invert = ! invert; + (*argn)++; + continue; + } + if (grub_strcmp (args[*argn], "-a") == 0) + { + /* If current value is 0 second value is to be discarded. */ + discard = ! ret; + (*argn)++; + continue; + } + if (grub_strcmp (args[*argn], "-o") == 0) + { + /* If current value is 1 second value is to be discarded. */ + discard = ret; + (*argn)++; + continue; + } + + /* No test found. Interpret if as just a string. */ + update_val (args[*argn][0]); + (*argn)++; + } + return ret; +} + static grub_err_t grub_cmd_test (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { - char *eq; - char *eqis; + int argn = 0; - /* XXX: No fancy expression evaluation yet. */ - - if (argc == 0) - return 0; - - eq = grub_strdup (args[0]); - eqis = grub_strchr (eq, '='); - if (! eqis) - return 0; + if (argc >= 1 && grub_strcmp (args[argc - 1], "]") == 0) + argc--; - *eqis = '\0'; - eqis++; - /* Check an expression in the form `A=B'. */ - if (grub_strcmp (eq, eqis)) - grub_error (GRUB_ERR_TEST_FAILURE, "false"); - grub_free (eq); - - return grub_errno; + return test_parse (args, &argn, argc) ? GRUB_ERR_NONE + : grub_error (GRUB_ERR_TEST_FAILURE, "false"); } static grub_command_t cmd_1, cmd_2; From 5c77c3de651970c44391334baf5ef3a18f44093c Mon Sep 17 00:00:00 2001 From: davem Date: Sun, 26 Apr 2009 08:44:36 +0000 Subject: [PATCH 0678/1707] * util/grub-mkdevicemap.c (make_device_map): Add missing NESTED_FUNC_ATTR to process_device(). --- ChangeLog | 5 +++++ util/grub-mkdevicemap.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index cb78fdba0..e5b3086c5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-26 David S. Miller + + * util/grub-mkdevicemap.c (make_device_map): Add missing + NESTED_FUNC_ATTR to process_device(). + 2009-04-25 Vladimir Serbinenko Test command diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index 4f544f878..ac8a39059 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -42,9 +42,9 @@ make_device_map (const char *device_map, int floppy_disks) int num_fd = 0; FILE *fp; - auto int process_device (const char *name, int is_floppy); + auto int NESTED_FUNC_ATTR process_device (const char *name, int is_floppy); - int process_device (const char *name, int is_floppy) + int NESTED_FUNC_ATTR process_device (const char *name, int is_floppy) { grub_util_emit_devicemap_entry (fp, (char *) name, is_floppy, &num_fd, &num_hd); From 4006f85c89420f5fb4c16b5b2aef180ede4f5938 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 26 Apr 2009 14:14:05 +0000 Subject: [PATCH 0679/1707] 2009-04-26 Pavel Roskin * Makefile.in: Don't install empty manual pages if help2man is missing. Use help2man option for output, not shell redirection. --- ChangeLog | 5 +++++ Makefile.in | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5b3086c5..e725324a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-26 Pavel Roskin + + * Makefile.in: Don't install empty manual pages if help2man is + missing. Use help2man option for output, not shell redirection. + 2009-04-26 David S. Miller * util/grub-mkdevicemap.c (make_device_map): Add missing diff --git a/Makefile.in b/Makefile.in index f73192e5e..363708c6f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -232,26 +232,26 @@ install-local: all if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ - $(HELP2MAN) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$dest.1; \ + $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \ done $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 @list='$(sbin_UTILITIES)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ - $(HELP2MAN) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \ + $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \ done @list='$(bin_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ - $(HELP2MAN) --section=1 $(builddir)/$$file > $(DESTDIR)$(mandir)/man1/$$dest.1; \ + $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \ done @list='$(sbin_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ - $(HELP2MAN) --section=8 $(builddir)/$$file > $(DESTDIR)$(mandir)/man8/$$dest.8; \ + $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \ done $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d @list='$(grub-mkconfig_SCRIPTS)'; for file in $$list; do \ From a5562c306fda05bea22b3fd8e85d5c6baeb0efba Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 26 Apr 2009 15:09:30 +0000 Subject: [PATCH 0680/1707] 2009-04-26 Vladimir Serbinenko Bug and warning fixes * include/grub/i386/pc/init.h (grub_stop_floppy): added missing declaration * commands/test.c (test_parse): fixed bug with file tests and corrected declaration of find_file --- ChangeLog | 9 +++++++++ commands/test.c | 23 ++++++++++++----------- include/grub/i386/pc/init.h | 1 + 3 files changed, 22 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index e725324a1..39666d07e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-26 Vladimir Serbinenko + + Bug and warning fixes + + * include/grub/i386/pc/init.h (grub_stop_floppy): added missing + declaration + * commands/test.c (test_parse): fixed bug with file tests and corrected + declaration of find_file + 2009-04-26 Pavel Roskin * Makefile.in: Don't install empty manual pages if help2man is diff --git a/commands/test.c b/commands/test.c index 8a15d3911..46ee03f1c 100644 --- a/commands/test.c +++ b/commands/test.c @@ -55,22 +55,23 @@ test_parse (char **args, int *argn, int argc) } /* Check if file exists and fetch its information. */ - void get_fileinfo (char *pathname) + void get_fileinfo (char *path) { - char *filename, *path; + char *filename, *pathname; char *device_name; grub_fs_t fs; grub_device_t dev; /* A hook for iterating directories. */ auto int find_file (const char *cur_filename, - struct grub_dirhook_info info); - int find_file (const char *cur_filename, struct grub_dirhook_info info) + const struct grub_dirhook_info *info); + int find_file (const char *cur_filename, + const struct grub_dirhook_info *info) { - if ((info.case_insensitive ? grub_strcasecmp (cur_filename, filename) + if ((info->case_insensitive ? grub_strcasecmp (cur_filename, filename) : grub_strcmp (cur_filename, filename)) == 0) { - file_info = info; + file_info = *info; file_exists = 1; return 1; } @@ -78,7 +79,7 @@ test_parse (char **args, int *argn, int argc) } file_exists = 0; - device_name = grub_file_get_device_name (pathname); + device_name = grub_file_get_device_name (path); dev = grub_device_open (device_name); if (! dev) { @@ -87,11 +88,11 @@ test_parse (char **args, int *argn, int argc) } fs = grub_fs_probe (dev); - path = grub_strchr (pathname, ')'); - if (! path) - path = pathname; + pathname = grub_strchr (path, ')'); + if (! pathname) + pathname = path; else - path++; + pathname++; /* Remove trailing '/'. */ while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') diff --git a/include/grub/i386/pc/init.h b/include/grub/i386/pc/init.h index f18a0dae4..0029959ae 100644 --- a/include/grub/i386/pc/init.h +++ b/include/grub/i386/pc/init.h @@ -46,5 +46,6 @@ void EXPORT_FUNC (grub_reboot) (void); * use APM even if it is available. */ void EXPORT_FUNC (grub_halt) (int no_apm); +void EXPORT_FUNC(grub_stop_floppy) (void); #endif /* ! GRUB_INIT_MACHINE_HEADER */ From 5af922b5f15d546b32f9f5ef03cf352f431defbc Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 27 Apr 2009 15:39:39 +0000 Subject: [PATCH 0681/1707] 2009-04-27 Vladimir Serbinenko Warning fix * disk/scsi.c (grub_scsi_open): added missing cast when calling grub_dprintf --- ChangeLog | 7 +++++++ disk/scsi.c | 3 ++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 39666d07e..9893347f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-04-27 Vladimir Serbinenko + + Warning fix + + * disk/scsi.c (grub_scsi_open): added missing cast when + calling grub_dprintf + 2009-04-26 Vladimir Serbinenko Bug and warning fixes diff --git a/disk/scsi.c b/disk/scsi.c index 319d8d672..081d9c671 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -301,7 +301,8 @@ grub_scsi_open (const char *name, grub_disk_t disk) << GRUB_DISK_SECTOR_BITS); grub_dprintf ("scsi", "capacity=%llu, blksize=%d\n", - disk->total_sectors, scsi->blocksize); + (unsigned long long) disk->total_sectors, + scsi->blocksize); return GRUB_ERR_NONE; } From 75a807cf0018c72cc5851d83dd7bdfdf3b5957aa Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 27 Apr 2009 16:48:58 +0000 Subject: [PATCH 0682/1707] 2009-04-27 Vladimir Serbinenko Preboot hooks support * commands/boot.c (struct grub_preboot_t): new declaration (preboots_head): new variable (preboots_tail): likewise (grub_loader_register_preboot_hook): new function (grub_loader_unregister_preboot_hook): likewise (grub_loader_set): launch preboot hooks * include/grub/loader.h (grub_loader_preboot_hook_prio_t): new type (grub_loader_register_preboot_hook): new declaration (grub_loader_unregister_preboot_hook): likewise --- ChangeLog | 14 ++++++ commands/boot.c | 100 ++++++++++++++++++++++++++++++++++++++++-- include/grub/loader.h | 22 ++++++++++ 3 files changed, 133 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9893347f8..ae7384364 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-04-27 Vladimir Serbinenko + + Preboot hooks support + + * commands/boot.c (struct grub_preboot_t): new declaration + (preboots_head): new variable + (preboots_tail): likewise + (grub_loader_register_preboot_hook): new function + (grub_loader_unregister_preboot_hook): likewise + (grub_loader_set): launch preboot hooks + * include/grub/loader.h (grub_loader_preboot_hook_prio_t): new type + (grub_loader_register_preboot_hook): new declaration + (grub_loader_unregister_preboot_hook): likewise + 2009-04-27 Vladimir Serbinenko Warning fix diff --git a/commands/boot.c b/commands/boot.c index 9a08feaf7..c8bd030a0 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -22,12 +22,24 @@ #include #include #include +#include static grub_err_t (*grub_loader_boot_func) (void); static grub_err_t (*grub_loader_unload_func) (void); static int grub_loader_noreturn; +struct grub_preboot_t +{ + grub_err_t (*preboot_func) (int); + grub_err_t (*preboot_rest_func) (void); + grub_loader_preboot_hook_prio_t prio; + struct grub_preboot_t *next; + struct grub_preboot_t *prev; +}; + static int grub_loader_loaded; +static struct grub_preboot_t *preboots_head = 0, + *preboots_tail = 0; int grub_loader_is_loaded (void) @@ -35,6 +47,68 @@ grub_loader_is_loaded (void) return grub_loader_loaded; } +/* Register a preboot hook. */ +void * +grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noreturn), + grub_err_t (*preboot_rest_func) (void), + grub_loader_preboot_hook_prio_t prio) +{ + struct grub_preboot_t *cur, *new_preboot; + + if (! preboot_func && ! preboot_rest_func) + return 0; + + new_preboot = (struct grub_preboot_t *) + grub_malloc (sizeof (struct grub_preboot_t)); + if (! new_preboot) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "hook not added"); + return 0; + } + + new_preboot->preboot_func = preboot_func; + new_preboot->preboot_rest_func = preboot_rest_func; + new_preboot->prio = prio; + + for (cur = preboots_head; cur && cur->prio > prio; cur = cur->next); + + if (cur) + { + new_preboot->next = cur; + new_preboot->prev = cur->prev; + cur->prev = new_preboot; + } + else + { + new_preboot->next = 0; + new_preboot->prev = preboots_tail; + preboots_tail = new_preboot; + } + if (new_preboot->prev) + new_preboot->prev->next = new_preboot; + else + preboots_head = new_preboot; + + return new_preboot; +} + +void +grub_loader_unregister_preboot_hook (void *hnd) +{ + struct grub_preboot_t *preb = hnd; + + if (preb->next) + preb->next->prev = preb->prev; + else + preboots_tail = preb->prev; + if (preb->prev) + preb->prev->next = preb->next; + else + preboots_head = preb->next; + + grub_free (preb); +} + void grub_loader_set (grub_err_t (*boot) (void), grub_err_t (*unload) (void), @@ -65,15 +139,35 @@ grub_loader_unset(void) grub_err_t grub_loader_boot (void) { + grub_err_t err = GRUB_ERR_NONE; + struct grub_preboot_t *cur; + if (! grub_loader_loaded) return grub_error (GRUB_ERR_NO_KERNEL, "no loaded kernel"); if (grub_loader_noreturn) grub_machine_fini (); - - return (grub_loader_boot_func) (); -} + for (cur = preboots_head; cur; cur = cur->next) + { + err = cur->preboot_func (grub_loader_noreturn); + if (err) + { + for (cur = cur->prev; cur; cur = cur->prev) + cur->preboot_rest_func (); + return err; + } + } + err = (grub_loader_boot_func) (); + + for (cur = preboots_tail; cur; cur = cur->prev) + if (! err) + err = cur->preboot_rest_func (); + else + cur->preboot_rest_func (); + + return err; +} /* boot */ static grub_err_t diff --git a/include/grub/loader.h b/include/grub/loader.h index 185d29773..319f3c551 100644 --- a/include/grub/loader.h +++ b/include/grub/loader.h @@ -41,4 +41,26 @@ void grub_loader_unset (void); depending on the setting by grub_loader_set. */ grub_err_t grub_loader_boot (void); +/* The space between numbers is intentional for the simplicity of adding new + values even if external modules use them. */ +typedef enum { + /* A preboot hook which can use everything and turns nothing off. */ + GRUB_LOADER_PREBOOT_HOOK_PRIO_NORMAL = 400, + /* A preboot hook which can't use disks and may stop disks. */ + GRUB_LOADER_PREBOOT_HOOK_PRIO_DISK = 300, + /* A preboot hook which can't use disks or console and may stop console. */ + GRUB_LOADER_PREBOOT_HOOK_PRIO_CONSOLE = 200, + /* A preboot hook which can't use disks or console, can't modify memory map + and may stop memory services or finalize memory map. */ + GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY = 100, +} grub_loader_preboot_hook_prio_t; + +/* Register a preboot hook. */ +void *grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noret), + grub_err_t (*preboot_rest_func) (void), + grub_loader_preboot_hook_prio_t prio); + +/* Unregister given preboot hook. */ +void grub_loader_unregister_preboot_hook (void *hnd); + #endif /* ! GRUB_LOADER_HEADER */ From 136d9f8283c3fc165fbf980ec36ce9136de81761 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 28 Apr 2009 13:14:20 +0000 Subject: [PATCH 0683/1707] 2009-04-27 Pavel Roskin * disk/fs_uuid.c (grub_fs_uuid_open): Allocate memory to copy parent's partition, don't copy it by reference, as it gets freed on close. --- ChangeLog | 6 ++++++ disk/fs_uuid.c | 12 +++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ae7384364..e3d4b7005 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-04-28 Pavel Roskin + + * disk/fs_uuid.c (grub_fs_uuid_open): Allocate memory to copy + parent's partition, don't copy it by reference, as it gets freed + on close. + 2009-04-27 Vladimir Serbinenko Preboot hooks support diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c index 9d83bb843..9636ce9d3 100644 --- a/disk/fs_uuid.c +++ b/disk/fs_uuid.c @@ -25,6 +25,7 @@ #include #include +#include static grub_device_t search_fs_uuid (const char *key, unsigned long *count) @@ -88,7 +89,16 @@ grub_fs_uuid_open (const char *name, grub_disk_t disk) disk->total_sectors = dev->disk->total_sectors; disk->has_partitions = 0; - disk->partition = dev->disk->partition; + if (dev->disk->partition) + { + disk->partition = grub_malloc (sizeof (*disk->partition)); + if (disk->partition) + grub_memcpy (disk->partition, dev->disk->partition, + sizeof (*disk->partition)); + } + else + disk->partition = NULL; + disk->data = dev->disk; return GRUB_ERR_NONE; From 9459c3067cd60a4edef721c8733117ae751cba45 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 28 Apr 2009 13:23:38 +0000 Subject: [PATCH 0684/1707] 2009-04-28 Pavel Roskin * disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev, not disk. Adjust all dependencies. (grub_device_close): Use grub_device_close(), not grub_disk_close(). --- ChangeLog | 5 +++++ disk/fs_uuid.c | 14 +++++++------- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3d4b7005..bdf846cef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-04-28 Pavel Roskin + * disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev, + not disk. Adjust all dependencies. + (grub_device_close): Use grub_device_close(), not + grub_disk_close(). + * disk/fs_uuid.c (grub_fs_uuid_open): Allocate memory to copy parent's partition, don't copy it by reference, as it gets freed on close. diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c index 9636ce9d3..e9888a7e3 100644 --- a/disk/fs_uuid.c +++ b/disk/fs_uuid.c @@ -99,7 +99,7 @@ grub_fs_uuid_open (const char *name, grub_disk_t disk) else disk->partition = NULL; - disk->data = dev->disk; + disk->data = dev; return GRUB_ERR_NONE; } @@ -107,24 +107,24 @@ grub_fs_uuid_open (const char *name, grub_disk_t disk) static void grub_fs_uuid_close (grub_disk_t disk __attribute((unused))) { - grub_disk_t parent = disk->data; - grub_disk_close (parent); + grub_device_t parent = disk->data; + grub_device_close (parent); } static grub_err_t grub_fs_uuid_read (grub_disk_t disk, grub_disk_addr_t sector, grub_size_t size, char *buf) { - grub_disk_t parent = disk->data; - return parent->dev->read (parent, sector, size, buf); + grub_device_t parent = disk->data; + return parent->disk->dev->read (parent->disk, sector, size, buf); } static grub_err_t grub_fs_uuid_write (grub_disk_t disk, grub_disk_addr_t sector, grub_size_t size, const char *buf) { - grub_disk_t parent = disk->data; - return parent->dev->write (parent, sector, size, buf); + grub_device_t parent = disk->data; + return parent->disk->dev->write (parent->disk, sector, size, buf); } static struct grub_disk_dev grub_fs_uuid_dev = From 2e08a26a8eb84d74a329db1a64edf340dd6fb03f Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 28 Apr 2009 13:25:09 +0000 Subject: [PATCH 0685/1707] Fix mistake in the last description --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bdf846cef..89662be14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,7 +2,7 @@ * disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev, not disk. Adjust all dependencies. - (grub_device_close): Use grub_device_close(), not + (grub_fs_uuid_close): Use grub_device_close(), not grub_disk_close(). * disk/fs_uuid.c (grub_fs_uuid_open): Allocate memory to copy From 979b4fb4160957dd1f4b84f92fd19c11e5a91eee Mon Sep 17 00:00:00 2001 From: davem Date: Thu, 30 Apr 2009 01:18:43 +0000 Subject: [PATCH 0686/1707] * commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf warnings. * kern/ieee1275/openfw.c (grub_claimmap): Likewise. * disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close, grub_ofdisk_read): Likewise, and deal similarly with the fact that ihandles have a 32-bit type but need to be stored in a "void *". --- ChangeLog | 9 +++++++++ commands/lsmmap.c | 2 +- disk/ieee1275/ofdisk.c | 21 +++++++++++---------- kern/ieee1275/openfw.c | 3 ++- 4 files changed, 23 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 89662be14..66e9d3264 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-04-29 David S. Miller + + * commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf + warnings. + * kern/ieee1275/openfw.c (grub_claimmap): Likewise. + * disk/ieee1275/ofdisk.c (grub_ofdisk_open, grub_ofdisk_close, + grub_ofdisk_read): Likewise, and deal similarly with the fact that + ihandles have a 32-bit type but need to be stored in a "void *". + 2009-04-28 Pavel Roskin * disk/fs_uuid.c (grub_fs_uuid_open): Use parent->data for dev, diff --git a/commands/lsmmap.c b/commands/lsmmap.c index 562ba21a8..4fe9a5a7a 100644 --- a/commands/lsmmap.c +++ b/commands/lsmmap.c @@ -30,7 +30,7 @@ grub_cmd_lsmmap (grub_command_t cmd __attribute__ ((unused)), int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) { grub_printf ("base_addr = 0x%llx, length = 0x%llx, type = 0x%x\n", - addr, size, type); + (long long) addr, (long long) size, type); return 0; } grub_machine_mmap_iterate (hook); diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index 202be2455..e2c7867e6 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -155,7 +155,8 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) goto fail; } - grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath, (void *) dev_ihandle); + grub_dprintf ("disk", "Opened `%s' as handle %p.\n", op->devpath, + (void *) (unsigned long) dev_ihandle); if (grub_ieee1275_finddevice (op->devpath, &dev)) { @@ -185,7 +186,7 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) /* XXX: Read this, somehow. */ disk->has_partitions = 1; - disk->data = (void *) dev_ihandle; + disk->data = (void *) (unsigned long) dev_ihandle; return 0; fail: @@ -199,7 +200,7 @@ grub_ofdisk_close (grub_disk_t disk) { grub_dprintf ("disk", "Closing handle %p.\n", (void *) disk->data); - grub_ieee1275_close ((grub_ieee1275_ihandle_t) disk->data); + grub_ieee1275_close ((grub_ieee1275_ihandle_t) (unsigned long) disk->data); } static grub_err_t @@ -211,21 +212,21 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector, grub_dprintf ("disk", "Reading handle %p: sector 0x%llx, size 0x%lx, buf %p.\n", - (void *) disk->data, sector, (long) size, buf); + (void *) disk->data, (long long) sector, (long) size, buf); pos = sector * 512UL; - grub_ieee1275_seek ((grub_ieee1275_ihandle_t) disk->data, (int) (pos >> 32), - (int) pos & 0xFFFFFFFFUL, &status); + grub_ieee1275_seek ((grub_ieee1275_ihandle_t) (unsigned long) disk->data, + (int) (pos >> 32), (int) pos & 0xFFFFFFFFUL, &status); if (status < 0) return grub_error (GRUB_ERR_READ_ERROR, "Seek error, can't seek block %llu", - sector); - grub_ieee1275_read ((grub_ieee1275_ihandle_t) disk->data, buf, - size * 512UL, &actual); + (long long) sector); + grub_ieee1275_read ((grub_ieee1275_ihandle_t) (unsigned long) disk->data, + buf, size * 512UL, &actual); if (actual != actual) return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu", - sector); + (long long) sector); return 0; } diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index b23149e7e..7d6502379 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -238,7 +238,8 @@ grub_claimmap (grub_addr_t addr, grub_size_t size) if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_REAL_MODE) && grub_map (addr, addr, size, 0x00)) { - grub_printf ("map failed: address 0x%x, size 0x%x\n", addr, size); + grub_printf ("map failed: address 0x%llx, size 0x%llx\n", + (long long) addr, (long long) size); grub_ieee1275_release (addr, size); return -1; } From 3c64e10417c01edfd51a9b59e35f076524071562 Mon Sep 17 00:00:00 2001 From: davem Date: Thu, 30 Apr 2009 01:28:22 +0000 Subject: [PATCH 0687/1707] * normal/command.c: Add missing newline at end of file. --- ChangeLog | 2 ++ normal/command.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 66e9d3264..56f04a1d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-04-29 David S. Miller + * normal/command.c: Add missing newline at end of file. + * commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf warnings. * kern/ieee1275/openfw.c (grub_claimmap): Likewise. diff --git a/normal/command.c b/normal/command.c index 863d45f59..3296515c3 100644 --- a/normal/command.c +++ b/normal/command.c @@ -67,4 +67,4 @@ grub_command_execute (char *cmdline, int interactive) grub_set_more (0); return ret; -} \ No newline at end of file +} From e2bf39b2d715282d121aac3df2b8184caa26020d Mon Sep 17 00:00:00 2001 From: davem Date: Thu, 30 Apr 2009 01:34:38 +0000 Subject: [PATCH 0688/1707] * include/grub/powerpc/ieee1275/memory.h: Include ieee1275.h. * include/grub/sparc64/ieee1275/memory.h: Likewise. --- ChangeLog | 3 +++ include/grub/powerpc/ieee1275/memory.h | 2 ++ include/grub/sparc64/ieee1275/memory.h | 2 ++ 3 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 56f04a1d9..84a61e0fc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-04-29 David S. Miller + * include/grub/powerpc/ieee1275/memory.h: Include ieee1275.h. + * include/grub/sparc64/ieee1275/memory.h: Likewise. + * normal/command.c: Add missing newline at end of file. * commands/lsmmap.c (grub_cmd_lsmmap): Add casts to avoid printf diff --git a/include/grub/powerpc/ieee1275/memory.h b/include/grub/powerpc/ieee1275/memory.h index 23e282f93..f8f2ff08d 100644 --- a/include/grub/powerpc/ieee1275/memory.h +++ b/include/grub/powerpc/ieee1275/memory.h @@ -19,6 +19,8 @@ #ifndef GRUB_MEMORY_MACHINE_HEADER #define GRUB_MEMORY_MACHINE_HEADER 1 +#include + #define GRUB_MACHINE_MEMORY_AVAILABLE 1 #endif diff --git a/include/grub/sparc64/ieee1275/memory.h b/include/grub/sparc64/ieee1275/memory.h index c997f66ed..25e31002e 100644 --- a/include/grub/sparc64/ieee1275/memory.h +++ b/include/grub/sparc64/ieee1275/memory.h @@ -19,6 +19,8 @@ #ifndef GRUB_MEMORY_MACHINE_HEADER #define GRUB_MEMORY_MACHINE_HEADER 1 +#include + #define GRUB_MACHINE_MEMORY_AVAILABLE 1 #endif From ac8a2baae40316be141b99e8edb6cd18a36a1aeb Mon Sep 17 00:00:00 2001 From: davem Date: Thu, 30 Apr 2009 13:17:10 +0000 Subject: [PATCH 0689/1707] * kern/sparc64/ieee1275/init.c (grub_machine_set_prefix): If lettered partition specifier is found, convert to numbered. --- ChangeLog | 5 +++++ kern/sparc64/ieee1275/init.c | 13 ++++++++++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 84a61e0fc..4b170990e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-04-30 David S. Miller + + * kern/sparc64/ieee1275/init.c (grub_machine_set_prefix): If + lettered partition specifier is found, convert to numbered. + 2009-04-29 David S. Miller * include/grub/powerpc/ieee1275/memory.h: Include ieee1275.h. diff --git a/kern/sparc64/ieee1275/init.c b/kern/sparc64/ieee1275/init.c index 5114f7694..699f9631b 100644 --- a/kern/sparc64/ieee1275/init.c +++ b/kern/sparc64/ieee1275/init.c @@ -64,8 +64,8 @@ grub_machine_set_prefix (void) if (grub_prefix[0] != '(') { char bootpath[IEEE1275_MAX_PATH_LEN]; + char *prefix, *path, *colon; grub_ssize_t actual; - char *prefix, *path; if (grub_ieee1275_get_property (grub_ieee1275_chosen, "bootpath", &bootpath, sizeof (bootpath), &actual)) @@ -77,6 +77,17 @@ grub_machine_set_prefix (void) } /* Transform an OF device path to a GRUB path. */ + colon = grub_strchr (bootpath, ':'); + if (colon) + { + char *part = colon + 1; + + /* Consistently provide numbered partitions to GRUB. + OpenBOOT traditionally uses alphabetical partition + specifiers. */ + if (part[0] >= 'a' && part[0] <= 'z') + part[0] = '1' + (part[0] - 'a'); + } prefix = grub_ieee1275_encode_devname (bootpath); path = grub_malloc (grub_strlen (grub_prefix) From 6966215ddb077b7c2f93a33b53b79dd1f0ce57b2 Mon Sep 17 00:00:00 2001 From: davem Date: Thu, 30 Apr 2009 13:21:14 +0000 Subject: [PATCH 0690/1707] * util/hostdisk.c (convert_system_partition_to_system_disk): Handle virtual disk devices named /dev/vdiskX as found on sparc and powerpc. --- ChangeLog | 4 ++++ util/hostdisk.c | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 4b170990e..d0df5dc68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-04-30 David S. Miller + * util/hostdisk.c (convert_system_partition_to_system_disk): + Handle virtual disk devices named /dev/vdiskX as found on sparc + and powerpc. + * kern/sparc64/ieee1275/init.c (grub_machine_set_prefix): If lettered partition specifier is found, convert to numbered. diff --git a/util/hostdisk.c b/util/hostdisk.c index aa41703fe..af93f9759 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -767,6 +767,13 @@ convert_system_partition_to_system_disk (const char *os_dev) } /* If this is an IDE, SCSI or Virtio disk. */ + if (strncmp ("vdisk", p, 5) == 0 + && p[5] >= 'a' && p[5] <= 'z') + { + /* /dev/vdisk[a-z][0-9]* */ + p[6] = '\0'; + return path; + } if ((strncmp ("hd", p, 2) == 0 || strncmp ("vd", p, 2) == 0 || strncmp ("sd", p, 2) == 0) From ad22a610fe29cfc230b2f0d764abf1bbecd8eca7 Mon Sep 17 00:00:00 2001 From: davem Date: Thu, 30 Apr 2009 13:23:48 +0000 Subject: [PATCH 0691/1707] * util/hostdisk.c (device_is_wholedisk): New function. (grub_util_biosdisk_get_grub_dev): Shortcut when hdg.start is zero only if device_is_wholedisk() returns true. --- ChangeLog | 4 ++++ util/hostdisk.c | 12 +++++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d0df5dc68..9097f250f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-04-30 David S. Miller + * util/hostdisk.c (device_is_wholedisk): New function. + (grub_util_biosdisk_get_grub_dev): Shortcut when hdg.start is + zero only if device_is_wholedisk() returns true. + * util/hostdisk.c (convert_system_partition_to_system_disk): Handle virtual disk devices named /dev/vdiskX as found on sparc and powerpc. diff --git a/util/hostdisk.c b/util/hostdisk.c index af93f9759..eaccb73dc 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -833,6 +833,16 @@ convert_system_partition_to_system_disk (const char *os_dev) #endif } +static int +device_is_wholedisk (const char *os_dev) +{ + int len = strlen (os_dev); + + if (os_dev[len - 1] < '0' || os_dev[len - 1] > '9') + return 1; + return 0; +} + static int find_system_device (const char *os_dev) { @@ -968,7 +978,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) grub_util_info ("%s starts from %lu", os_dev, hdg.start); - if (hdg.start == 0) + if (hdg.start == 0 && device_is_wholedisk (os_dev)) return name; grub_util_info ("opening the device %s", name); From d9dc87b01b67912d8a4cf330bddb43d7c6b46ac4 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 2 May 2009 13:34:01 +0000 Subject: [PATCH 0692/1707] 2009-05-02 Vladimir Serbinenko Added missing lst to grub-mkrescue * util/i386/pc/grub-mkrescue.in: added ${input_dir}/handler.lst and ${input_dir}/parttool.lst --- ChangeLog | 7 +++++++ util/i386/pc/grub-mkrescue.in | 1 + 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9097f250f..b141d0a8a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-02 Vladimir Serbinenko + + Added missing lst to grub-mkrescue + + * util/i386/pc/grub-mkrescue.in: added ${input_dir}/handler.lst + and ${input_dir}/parttool.lst + 2009-04-30 David S. Miller * util/hostdisk.c (device_is_wholedisk): New function. diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 358b37b17..ca9af16e9 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -118,6 +118,7 @@ mkdir -p ${aux_dir}/boot/grub cp ${input_dir}/*.mod \ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ + ${input_dir}/handler.lst ${input_dir}/parttool.lst \ ${aux_dir}/boot/grub/ modules="biosdisk `cat ${input_dir}/partmap.lst` ${modules}" From 6c67de152c8f768b3cacadf8b5184d424bca2b61 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 May 2009 15:24:28 +0000 Subject: [PATCH 0693/1707] 2009-05-02 Robert Millan * normal/menu_text.c (grub_wait_after_message): Print a newline after waiting for user input. * loader/i386/linux.c: Include `'. (grub_cmd_linux): Improve the error message about `ask' mode, by waiting for user input so it's not missed (we can do this, since user requested interaction). --- ChangeLog | 10 ++++++++++ loader/i386/linux.c | 8 +++++++- normal/menu_text.c | 1 + 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b141d0a8a..f54ef2071 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-05-02 Robert Millan + + * normal/menu_text.c (grub_wait_after_message): Print a newline + after waiting for user input. + + * loader/i386/linux.c: Include `'. + (grub_cmd_linux): Improve the error message about `ask' mode, by + waiting for user input so it's not missed (we can do this, since + user requested interaction). + 2009-05-02 Vladimir Serbinenko Added missing lst to grub-mkrescue diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 19444f4b8..c71d9260b 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -20,6 +20,7 @@ #include #include #include +#include #include #include #include @@ -584,7 +585,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; else if (grub_strcmp (val, "ask") == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "Legacy `ask' parameter no longer supported."); + grub_printf ("Legacy `ask' parameter no longer supported.\n"); + + /* We usually would never do this in a loader, but "vga=ask" means user + requested interaction, so it can't hurt to request keyboard input. */ + grub_wait_after_message (); + goto fail; } else diff --git a/normal/menu_text.c b/normal/menu_text.c index cb229828e..9e97c32e9 100644 --- a/normal/menu_text.c +++ b/normal/menu_text.c @@ -41,6 +41,7 @@ grub_wait_after_message (void) { grub_printf ("\nPress any key to continue..."); (void) grub_getkey (); + grub_putchar ('\n'); } static void From 18db813d657ed227e08a96f40ee5f4d9f72eb1e5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 2 May 2009 16:55:35 +0000 Subject: [PATCH 0694/1707] 2009-05-02 Robert Millan * util/deviceiter.c (grub_util_iterate_devices): Increase max drive count to 16 for CCISS and IDA. --- ChangeLog | 5 +++++ util/deviceiter.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f54ef2071..c6adb363e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-02 Robert Millan + + * util/deviceiter.c (grub_util_iterate_devices): Increase max drive + count to 16 for CCISS and IDA. + 2009-05-02 Robert Millan * normal/menu_text.c (grub_wait_after_message): Print a newline diff --git a/util/deviceiter.c b/util/deviceiter.c index a36ad3122..b78b6a0d9 100644 --- a/util/deviceiter.c +++ b/util/deviceiter.c @@ -552,7 +552,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), for (controller = 0; controller < 3; controller++) { - for (drive = 0; drive < 10; drive++) + for (drive = 0; drive < 16; drive++) { char name[24]; @@ -573,7 +573,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), for (controller = 0; controller < 3; controller++) { - for (drive = 0; drive < 10; drive++) + for (drive = 0; drive < 16; drive++) { char name[24]; From d558e6b5acb8369fecf0b263ccb7a43ea1ba9990 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 2 May 2009 19:49:34 +0000 Subject: [PATCH 0695/1707] 2009-05-02 Bean * conf/common.rmk (grub_script.tab.c): Change normal/parser.y to script/sh/parser.y. (pkglib_MODULES): Add normal.mod and sh.mod. (normal_SOURCES): New variable. (normal_mod_CFLAGS): Likewise. (normal_mod_LDFLAGS): Likewise. (sh_mod_SOURCES): Likewise. (sh_mod_CFLAGS): Likewise. (sh_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (normal/lexer.c_DEPENDENCIES): Changed to script/sh/lexer.c_DEPENDENCIES. (kernel_img_SOURCES): Remove kern/rescue.c, and kern/reader.c, kern/rescue_reader.c and kern/rescue_parser.c. (kernel_img_HEADERS): Remove rescue.h, add reader.h. (grub_emu_SOURCES): Change source files. (pkglib_MODULES): Remove normal.mod. (normal_SOURCES): Removed. (normal_mod_CFLAGS): Likewise. (normal_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/i386-efi.rmk: Likewise. * conf/i386-ieee1276.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * include/grub/command.h (grub_command_execute): New inline function. * include/grub/menu.h (grub_menu_entry): Removed commands field. * include/grub/normal.h: Remove . (grub_fs_module_list): Moved to normal/autofs.c. (grub_exit_env): Removed. (grub_command_execute): Likewise. (grub_normal_menu_addentry): Renamed to grub_menu_addentry, removed parameter script. (read_command_list): New function declaration. (read_fs_list): Likewise. * include/parser.h: Include . (grub_parser_split_cmdline): Change type of getline parameter. (grub_parser): New structure. (grub_parser_class): New variable. (grub_parser_execute): New function declaration. (grub_register_rescue_parser): Likewise. (grub_parser_register): New inline function. (grub_parser_unregister): Likewise. (grub_parser_get_current): Likewise. (grub_parser_set_current): Likewise. * include/grub/reader.h: New file. * kern/reader.c: Likewise. * kern/rescue_parser.c: Likewise. * kern/rescue_reader.c: Likewise. * normal/autofs.c: Likewise. * normal/dyncmd.c: Likewise. * include/grub/rescue.h: Removed. * normal/command.h: Likewise. * include/grub/script.h: Moved to ... * include/grub/script_sh.h: ... Moved here. * normal/execute.c: Moved to ... * script/sh/execute.c: ... Moved here. * normal/function.c: Moved to ... * script/sh/function.c: ... Moved here. * normal/lexer.c: Moved to ... * script/sh/lexer.c: ... Moved here. * normal/parser.y: Moved to ... * script/sh/parser.y: ... Moved here. * normal/script.c: Moved to ... * script/sh/script.c: ... Moved here. * normal/main.c: Remove and , include . (grub_exit_env): Removed. (fs_module_list): Moved to normal/autofs.c. (grub_file_getline): Don't handle comment here. (free_menu): Skip removed field entry->commands. (grub_normal_menu_addentry): Removed as grub_menu_entry, removed script parameter. (read_config_file): Removed nested parameter, change getline function. (grub_enter_normal_mode): Removed. (grub_dyncmd_dispatcher): Moved to normal/dyncmd.c. (read_command_list): Likewise. (autoload_fs_module): Moved to normal/autofs.c. (read_fs_list): Likewise. (reader_nested): New variable. (grub_normal_execute): Run parser.sh to switch to sh parser. (grub_cmd_rescue): Removed. (cmd_normal): Removed. (grub_cmd_normal): Unregister itself at the beginning. Don't register rescue command. (grub_cmdline_run): New function. (grub_normal_reader_init): Likewise. (grub_normal_read_line): Likewise. (grub_env_write_pager): Likewise. (cmdline): New variable. (grub_normal_reader): Likewise. (GRUB_MOD_INIT): Register normal reader and set as current, register pager hook, register normal command with grub_register_command_prio, so that it won't show up in command.lst. (GRUB_MOD_FINI): Unregister normal reader, unhook pager, clear grub_fs_autoload_hook. * normal/menu.c: Remove , add . (grub_menu_execute_entry): Replace grub_script_execute with grub_parser_execute, change parameter to grub_command_execute. * normal/menu_text.c: Remove . * normal/menu_entry.c: Remove , add and . (run): Change editor_getline to use new parser interface. Change parameter to grub_command_execute. * kern/main.c: Remove , include , and . (grub_load_normal_mode): Execute normal command. (grub_main): Call grub_register_core_commands, grub_register_rescue_parser and grub_register_rescue_reader, use grub_reader_loop to enter input loop. * kern/parser.c (grub_parser_spli_cmdline): Change type of getline parameter. (grub_parser_class): New variable. (grub_parser_execute): New function. * loader/i386/multiboot.c: Remove . * loader/multiboot2.c: Likewise. * loader/sparc64/ieee1275/linux.c: Likewise. * util/grub-emu.c (read_command_list): New dummy function. --- ChangeLog | 137 +++++++ conf/common.rmk | 21 +- conf/i386-coreboot.rmk | 30 +- conf/i386-efi.rmk | 30 +- conf/i386-ieee1275.rmk | 32 +- conf/i386-pc.rmk | 45 +-- conf/powerpc-ieee1275.rmk | 29 +- conf/sparc64-ieee1275.rmk | 29 +- conf/x86_64-efi.rmk | 34 +- include/grub/command.h | 9 + include/grub/menu.h | 3 - include/grub/normal.h | 22 +- include/grub/parser.h | 54 ++- include/grub/reader.h | 79 ++++ include/grub/rescue.h | 27 -- include/grub/{script.h => script_sh.h} | 18 +- kern/main.c | 16 +- kern/parser.c | 48 ++- kern/reader.c | 49 +++ kern/rescue.c | 163 -------- kern/rescue_parser.c | 84 +++++ kern/rescue_reader.c | 88 +++++ loader/i386/multiboot.c | 1 - loader/multiboot2.c | 1 - loader/sparc64/ieee1275/linux.c | 1 - normal/autofs.c | 134 +++++++ normal/cmdline.c | 31 -- normal/dyncmd.c | 158 ++++++++ normal/main.c | 491 ++++++++----------------- normal/menu.c | 6 +- normal/menu_entry.c | 23 +- normal/menu_text.c | 1 - {normal => script/sh}/execute.c | 18 +- {normal => script/sh}/function.c | 12 +- {normal => script/sh}/lexer.c | 8 +- normal/command.c => script/sh/main.c | 58 ++- {normal => script/sh}/parser.y | 6 +- {normal => script/sh}/script.c | 8 +- util/grub-emu.c | 5 + 39 files changed, 1132 insertions(+), 877 deletions(-) create mode 100644 include/grub/reader.h delete mode 100644 include/grub/rescue.h rename include/grub/{script.h => script_sh.h} (96%) create mode 100644 kern/reader.c delete mode 100644 kern/rescue.c create mode 100644 kern/rescue_parser.c create mode 100644 kern/rescue_reader.c create mode 100644 normal/autofs.c create mode 100644 normal/dyncmd.c rename {normal => script/sh}/execute.c (94%) rename {normal => script/sh}/function.c (96%) rename {normal => script/sh}/lexer.c (97%) rename normal/command.c => script/sh/main.c (51%) rename {normal => script/sh}/parser.y (99%) rename {normal => script/sh}/script.c (98%) diff --git a/ChangeLog b/ChangeLog index c6adb363e..81f7f55f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,140 @@ +2009-05-02 Bean + + * conf/common.rmk (grub_script.tab.c): Change normal/parser.y to + script/sh/parser.y. + (pkglib_MODULES): Add normal.mod and sh.mod. + (normal_SOURCES): New variable. + (normal_mod_CFLAGS): Likewise. + (normal_mod_LDFLAGS): Likewise. + (sh_mod_SOURCES): Likewise. + (sh_mod_CFLAGS): Likewise. + (sh_mod_LDFLAGS): Likewise. + + * conf/i386-pc.rmk (normal/lexer.c_DEPENDENCIES): Changed to + script/sh/lexer.c_DEPENDENCIES. + (kernel_img_SOURCES): Remove kern/rescue.c, and kern/reader.c, + kern/rescue_reader.c and kern/rescue_parser.c. + (kernel_img_HEADERS): Remove rescue.h, add reader.h. + (grub_emu_SOURCES): Change source files. + (pkglib_MODULES): Remove normal.mod. + (normal_SOURCES): Removed. + (normal_mod_CFLAGS): Likewise. + (normal_mod_LDFLAGS): Likewise. + * conf/i386-coreboot.rmk: Likewise. + * conf/i386-efi.rmk: Likewise. + * conf/i386-ieee1276.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + + * include/grub/command.h (grub_command_execute): New inline function. + + * include/grub/menu.h (grub_menu_entry): Removed commands field. + + * include/grub/normal.h: Remove . + (grub_fs_module_list): Moved to normal/autofs.c. + (grub_exit_env): Removed. + (grub_command_execute): Likewise. + (grub_normal_menu_addentry): Renamed to grub_menu_addentry, removed + parameter script. + (read_command_list): New function declaration. + (read_fs_list): Likewise. + + * include/parser.h: Include . + (grub_parser_split_cmdline): Change type of getline parameter. + (grub_parser): New structure. + (grub_parser_class): New variable. + (grub_parser_execute): New function declaration. + (grub_register_rescue_parser): Likewise. + (grub_parser_register): New inline function. + (grub_parser_unregister): Likewise. + (grub_parser_get_current): Likewise. + (grub_parser_set_current): Likewise. + + * include/grub/reader.h: New file. + * kern/reader.c: Likewise. + * kern/rescue_parser.c: Likewise. + * kern/rescue_reader.c: Likewise. + * normal/autofs.c: Likewise. + * normal/dyncmd.c: Likewise. + + * include/grub/rescue.h: Removed. + * normal/command.h: Likewise. + + * include/grub/script.h: Moved to ... + * include/grub/script_sh.h: ... Moved here. + * normal/execute.c: Moved to ... + * script/sh/execute.c: ... Moved here. + * normal/function.c: Moved to ... + * script/sh/function.c: ... Moved here. + * normal/lexer.c: Moved to ... + * script/sh/lexer.c: ... Moved here. + * normal/parser.y: Moved to ... + * script/sh/parser.y: ... Moved here. + * normal/script.c: Moved to ... + * script/sh/script.c: ... Moved here. + + * normal/main.c: Remove and , include + . + (grub_exit_env): Removed. + (fs_module_list): Moved to normal/autofs.c. + (grub_file_getline): Don't handle comment here. + (free_menu): Skip removed field entry->commands. + (grub_normal_menu_addentry): Removed as grub_menu_entry, removed + script parameter. + (read_config_file): Removed nested parameter, change getline function. + (grub_enter_normal_mode): Removed. + (grub_dyncmd_dispatcher): Moved to normal/dyncmd.c. + (read_command_list): Likewise. + (autoload_fs_module): Moved to normal/autofs.c. + (read_fs_list): Likewise. + (reader_nested): New variable. + (grub_normal_execute): Run parser.sh to switch to sh parser. + (grub_cmd_rescue): Removed. + (cmd_normal): Removed. + (grub_cmd_normal): Unregister itself at the beginning. Don't register + rescue command. + (grub_cmdline_run): New function. + (grub_normal_reader_init): Likewise. + (grub_normal_read_line): Likewise. + (grub_env_write_pager): Likewise. + (cmdline): New variable. + (grub_normal_reader): Likewise. + (GRUB_MOD_INIT): Register normal reader and set as current, register + pager hook, register normal command with grub_register_command_prio, + so that it won't show up in command.lst. + (GRUB_MOD_FINI): Unregister normal reader, unhook pager, clear + grub_fs_autoload_hook. + + * normal/menu.c: Remove , add . + (grub_menu_execute_entry): Replace grub_script_execute with + grub_parser_execute, change parameter to grub_command_execute. + + * normal/menu_text.c: Remove . + + * normal/menu_entry.c: Remove , add + and . + (run): Change editor_getline to use new parser interface. Change + parameter to grub_command_execute. + + * kern/main.c: Remove , include , + and . + (grub_load_normal_mode): Execute normal command. + (grub_main): Call grub_register_core_commands, + grub_register_rescue_parser and grub_register_rescue_reader, use + grub_reader_loop to enter input loop. + + * kern/parser.c (grub_parser_spli_cmdline): Change type of getline + parameter. + (grub_parser_class): New variable. + (grub_parser_execute): New function. + + * loader/i386/multiboot.c: Remove . + * loader/multiboot2.c: Likewise. + * loader/sparc64/ieee1275/linux.c: Likewise. + + * util/grub-emu.c (read_command_list): New dummy function. + 2009-05-02 Robert Millan * util/deviceiter.c (grub_util_iterate_devices): Increase max drive diff --git a/conf/common.rmk b/conf/common.rmk index 0e63da6d5..2335d8f8e 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -56,8 +56,8 @@ grub_mkfont_LDFLAGS = $(freetype_libs) endif # For the parser. -grub_script.tab.c grub_script.tab.h: normal/parser.y - $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y +grub_script.tab.c grub_script.tab.h: script/sh/parser.y + $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/sh/parser.y DISTCLEANFILES += grub_script.tab.c grub_script.tab.h # For grub-emu. @@ -343,7 +343,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - pcpart.mod memrw.mod boot.mod + pcpart.mod memrw.mod boot.mod normal.mod sh.mod # For boot.mod. boot_mod_SOURCES = commands/boot.c @@ -470,6 +470,21 @@ memrw_mod_SOURCES = commands/memrw.c memrw_mod_CFLAGS = $(COMMON_CFLAGS) memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For normal.mod. +normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \ + normal/autofs.c normal/handler.c \ + normal/color.c normal/completion.c normal/datetime.c normal/menu.c \ + normal/menu_entry.c normal/menu_text.c normal/menu_viewer.c \ + normal/misc.c +normal_mod_CFLAGS = $(COMMON_CFLAGS) +normal_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For sh.mod. +sh_mod_SOURCES = script/sh/main.c script/sh/script.c script/sh/execute.c \ + script/sh/function.c script/sh/lexer.c grub_script.tab.c +sh_mod_CFLAGS = $(COMMON_CFLAGS) +sh_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 1284fe4ca..dbacc11ba 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -5,7 +5,7 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.elf @@ -16,7 +16,8 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/i386/multiboot_mmap.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ @@ -28,7 +29,7 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ symlist.c kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h list.h handler.h command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) @@ -100,7 +101,7 @@ sbin_SCRIPTS += grub-install grub_install_SOURCES = util/i386/pc/grub-install.in # Modules. -pkglib_MODULES = linux.mod normal.mod multiboot.mod \ +pkglib_MODULES = linux.mod multiboot.mod \ aout.mod play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod \ @@ -111,27 +112,6 @@ linux_mod_SOURCES = loader/i386/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For reboot.mod. reboot_mod_SOURCES = commands/reboot.c kern/i386/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 717683b3a..fd8957944 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -5,7 +5,7 @@ COMMON_CFLAGS = -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386 -nostdlib # Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage @@ -80,7 +80,7 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. -pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ +pkglib_MODULES = kernel.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod @@ -88,7 +88,8 @@ pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ kernel_mod_EXPORTS = no kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ @@ -98,7 +99,7 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/generic/millisleep.c kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ efi/efi.h efi/time.h efi/disk.h list.h handler.h command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) @@ -114,27 +115,6 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. chain_mod_SOURCES = loader/efi/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index cb32c73c5..35d6ec675 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -5,7 +5,7 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib -static -lgcc # Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.elf @@ -17,7 +17,8 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ kern/i386/dl.c kern/parser.c kern/partition.c \ kern/env.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ @@ -28,7 +29,7 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ symlist.c kernel_elf_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ list.h handler.h command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) @@ -101,32 +102,11 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/ieee1275/grub-install.in # Modules. -pkglib_MODULES = normal.mod halt.mod reboot.mod suspend.mod \ - multiboot.mod aout.mod serial.mod linux.mod \ +pkglib_MODULES = halt.mod reboot.mod suspend.mod \ + multiboot.mod aout.mod serial.mod linux.mod \ nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod lsmmap.mod -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For multiboot.mod. multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/i386/multiboot_helper.S \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index d74a5fabf..c4b53fc63 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -7,7 +7,7 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ @@ -46,7 +46,8 @@ cdboot_img_FORMAT = binary # For kernel.img. kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/parser.c kern/partition.c \ @@ -58,7 +59,7 @@ kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ symlist.c kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ machine/kernel.h machine/pxe.h list.h handler.h command.h @@ -131,16 +132,17 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c normal/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ + kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ + kern/partition.c kern/reader.c kern/term.c \ + kern/rescue_reader.c kern/rescue_parser.c \ + lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \ + normal/handler.c normal/autofs.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ - normal/misc.c normal/script.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c grub_script.tab.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ \ @@ -176,7 +178,7 @@ grub_install_SOURCES = util/i386/pc/grub-install.in # For grub-mkrescue. grub_mkrescue_SOURCES = util/i386/pc/grub-mkrescue.in -pkglib_MODULES = biosdisk.mod chain.mod normal.mod \ +pkglib_MODULES = biosdisk.mod chain.mod \ multiboot.mod reboot.mod halt.mod \ vbe.mod vbetest.mod vbeinfo.mod play.mod serial.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ @@ -204,27 +206,6 @@ linux_mod_SOURCES = loader/i386/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c normal/handler.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/i386/setjmp.S -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For reboot.mod. reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 84f91d897..911adc6fb 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -6,7 +6,7 @@ COMMON_CFLAGS = -ffreestanding COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. @@ -14,7 +14,7 @@ MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ - env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h rescue.h \ + env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ command.h @@ -82,7 +82,8 @@ grub_emu_LDFLAGS = $(LIBCURSES) kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ - kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ @@ -109,7 +110,6 @@ grub_mkrescue_SOURCES = util/powerpc/ieee1275/grub-mkrescue.in # Modules. pkglib_MODULES = halt.mod \ linux.mod \ - normal.mod \ reboot.mod \ suspend.mod \ multiboot.mod \ @@ -121,27 +121,6 @@ linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c normal/handler.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/powerpc/setjmp.S -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For suspend.mod suspend_mod_SOURCES = commands/ieee1275/suspend.c suspend_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index e1929d1e3..c11442abc 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -6,7 +6,7 @@ COMMON_CFLAGS = -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -nostdlib -mno-relax # Used by various components. These rules need to precede them. -normal/lexer.c_DEPENDENCIES = grub_script.tab.h +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img @@ -28,14 +28,15 @@ DEFSYMFILES += kernel_syms.lst kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ list.h handler.h command.h \ sparc64/libgcc.h ieee1275/ieee1275.h machine/kernel.h \ sparc64/ieee1275/ieee1275.h kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ - kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/sparc64/ieee1275/ieee1275.c \ kern/sparc64/ieee1275/init.c \ @@ -142,7 +143,6 @@ grub_install_SOURCES = util/sparc64/ieee1275/grub-install.in # Modules. pkglib_MODULES = halt.mod \ linux.mod \ - normal.mod \ reboot.mod \ memdisk.mod \ lsmmap.mod @@ -152,27 +152,6 @@ linux_mod_SOURCES = loader/sparc64/ieee1275/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = lib/arg.c normal/cmdline.c normal/command.c \ - normal/datetime.c normal/completion.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/handler.c normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/sparc64/setjmp.S -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For reboot.mod. reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index d7ad9a4c8..6cf9d7d79 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -5,10 +5,7 @@ COMMON_CFLAGS = -fno-builtin -m64 COMMON_LDFLAGS = -melf_x86_64 -nostdlib # Used by various components. These rules need to precede them. -normal/execute.c_DEPENDENCIES = grub_script.tab.h -normal/command.c_DEPENDENCIES = grub_script.tab.h -normal/function.c_DEPENDENCIES = grub_script.tab.h -normal/lexer.c_DEPENDENCIES = grub_script.tab.h +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage @@ -81,7 +78,7 @@ sbin_SCRIPTS = grub-install grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. -pkglib_MODULES = kernel.mod normal.mod chain.mod appleldr.mod \ +pkglib_MODULES = kernel.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod @@ -90,7 +87,8 @@ kernel_mod_EXPORTS = no kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ - kern/misc.c kern/mm.c kern/rescue.c kern/term.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ @@ -99,7 +97,7 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ term/efi/console.c disk/efi/efidisk.c kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h rescue.h symbol.h term.h time.h types.h \ + partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h \ command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) @@ -116,27 +114,6 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -# -# Only arch dependant part of normal.mod will be here. Common part for -# all architecures of normal.mod is at start and should be kept at sync -# with other makefiles. -# -# Please put arch dependant part of normal.mod at the end of list to -# keep it simpler to update to different architectures. -# -normal_mod_SOURCES = normal/cmdline.c normal/command.c normal/handler.c \ - normal/completion.c normal/datetime.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ - normal/menu_text.c \ - normal/color.c \ - normal/menu_viewer.c normal/menu_entry.c \ - normal/misc.c grub_script.tab.c \ - normal/script.c \ - normal/x86_64/setjmp.S -normal_mod_CFLAGS = $(COMMON_CFLAGS) -normal_mod_ASFLAGS = $(COMMON_ASFLAGS) -normal_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For chain.mod. chain_mod_SOURCES = loader/efi/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) @@ -197,5 +174,4 @@ fixvideo_mod_SOURCES = commands/efi/fixvideo.c fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) -include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/include/grub/command.h b/include/grub/command.h index 18f2934fa..a391cf2a9 100644 --- a/include/grub/command.h +++ b/include/grub/command.h @@ -106,6 +106,15 @@ grub_command_find (const char *name) return grub_named_list_find (GRUB_AS_NAMED_LIST (grub_command_list), name); } +static inline grub_err_t +grub_command_execute (const char *name, int argc, char **argv) +{ + grub_command_t cmd; + + cmd = grub_command_find (name); + return (cmd) ? cmd->func (cmd, argc, argv) : GRUB_ERR_FILE_NOT_FOUND; +} + static inline int grub_command_iterate (int (*func) (grub_command_t)) { diff --git a/include/grub/menu.h b/include/grub/menu.h index 6850846b4..f11e00516 100644 --- a/include/grub/menu.h +++ b/include/grub/menu.h @@ -38,9 +38,6 @@ struct grub_menu_entry E.classes->next is the first class if it is not NULL. */ struct grub_menu_entry_class *classes; - /* The commands associated with this menu entry. */ - struct grub_script *commands; - /* The sourcecode of the menu entry, used by the editor. */ const char *sourcecode; diff --git a/include/grub/normal.h b/include/grub/normal.h index e62e43379..948289aa6 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -20,7 +20,6 @@ #ifndef GRUB_NORMAL_HEADER #define GRUB_NORMAL_HEADER 1 -#include #include #include #include @@ -42,17 +41,6 @@ enum grub_completion_type }; typedef enum grub_completion_type grub_completion_type_t; -/* This is used to store the names of filesystem modules for auto-loading. */ -struct grub_fs_module_list -{ - char *name; - struct grub_fs_module_list *next; -}; -typedef struct grub_fs_module_list *grub_fs_module_list_t; - -/* To exit from the normal mode. */ -extern grub_jmp_buf grub_exit_env; - extern struct grub_menu_viewer grub_normal_text_menu_viewer; /* Callback structure menu viewers can use to provide user feedback when @@ -86,19 +74,14 @@ void grub_menu_execute_entry(grub_menu_entry_t entry); grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no); int grub_menu_get_timeout (void); void grub_menu_set_timeout (int timeout); -void grub_cmdline_run (int nested); int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, int echo_char, int readline); grub_err_t grub_set_history (int newsize); -int grub_command_execute (char *cmdline, int interactive); void grub_normal_init_page (void); void grub_menu_init_page (int nested, int edit); char *grub_normal_do_completion (char *buf, int *restore, void (*hook) (const char *item, grub_completion_type_t type, int count)); grub_err_t grub_normal_print_device_info (const char *name); -grub_err_t grub_normal_menu_addentry (int argc, const char **args, - struct grub_script *script, - const char *sourcecode); char *grub_env_write_color_normal (struct grub_env_var *var, const char *val); char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val); void grub_parse_color_name_pair (grub_uint8_t *ret, const char *name); @@ -107,6 +90,11 @@ void grub_wait_after_message (void); char *grub_file_getline (grub_file_t file); void read_handler_list (void); void free_handler_list (void); +void read_command_list (void); +void read_fs_list (void); +void grub_cmdline_run (int nested); +grub_err_t grub_menu_addentry (int argc, const char **args, + const char *sourcecode); #ifdef GRUB_UTIL void grub_normal_init (void); diff --git a/include/grub/parser.h b/include/grub/parser.h index 1a7f0a361..4ee0e8389 100644 --- a/include/grub/parser.h +++ b/include/grub/parser.h @@ -1,7 +1,7 @@ /* parser.h - prototypes for the command line parser. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -22,6 +22,7 @@ #include #include +#include /* All the states for the command line. */ typedef enum @@ -61,7 +62,56 @@ EXPORT_FUNC (grub_parser_cmdline_state) (grub_parser_state_t state, grub_err_t EXPORT_FUNC (grub_parser_split_cmdline) (const char *cmdline, - grub_err_t (*getline) (char **), + grub_reader_getline_t getline, int *argc, char ***argv); +struct grub_parser +{ + /* The next parser. */ + struct grub_parser *next; + + /* The parser name. */ + const char *name; + + /* Initialize the parser. */ + grub_err_t (*init) (void); + + /* Clean up the parser. */ + grub_err_t (*fini) (void); + + grub_err_t (*parse_line) (char *line, grub_reader_getline_t getline); +}; +typedef struct grub_parser *grub_parser_t; + +extern struct grub_handler_class EXPORT_VAR(grub_parser_class); +grub_err_t EXPORT_FUNC(grub_parser_execute) (char *source); + +static inline void +grub_parser_register (const char *name __attribute__ ((unused)), + grub_parser_t parser) +{ + grub_handler_register (&grub_parser_class, GRUB_AS_HANDLER (parser)); +} + +static inline void +grub_parser_unregister (grub_parser_t parser) +{ + grub_handler_unregister (&grub_parser_class, GRUB_AS_HANDLER (parser)); +} + +static inline grub_parser_t +grub_parser_get_current (void) +{ + return (grub_parser_t) grub_parser_class.cur_handler; +} + +static inline grub_err_t +grub_parser_set_current (grub_parser_t parser) +{ + return grub_handler_set_current (&grub_parser_class, + GRUB_AS_HANDLER (parser)); +} + +void grub_register_rescue_parser (void); + #endif /* ! GRUB_PARSER_HEADER */ diff --git a/include/grub/reader.h b/include/grub/reader.h new file mode 100644 index 000000000..c7e67bf5e --- /dev/null +++ b/include/grub/reader.h @@ -0,0 +1,79 @@ +/* reader.h - prototypes for command line reader. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_READER_HEADER +#define GRUB_READER_HEADER 1 + +#include +#include +#include + +typedef grub_err_t (*grub_reader_getline_t) (char **, int); + +struct grub_reader +{ + /* The next reader. */ + struct grub_parser *next; + + /* The reader name. */ + const char *name; + + /* Initialize the reader. */ + grub_err_t (*init) (void); + + /* Clean up the reader. */ + grub_err_t (*fini) (void); + + grub_reader_getline_t read_line; +}; +typedef struct grub_reader *grub_reader_t; + +extern struct grub_handler_class EXPORT_VAR(grub_reader_class); + +grub_err_t EXPORT_FUNC(grub_reader_loop) (grub_reader_getline_t getline); + +static inline void +grub_reader_register (const char *name __attribute__ ((unused)), + grub_reader_t reader) +{ + grub_handler_register (&grub_reader_class, GRUB_AS_HANDLER (reader)); +} + +static inline void +grub_reader_unregister (grub_reader_t reader) +{ + grub_handler_unregister (&grub_reader_class, GRUB_AS_HANDLER (reader)); +} + +static inline grub_reader_t +grub_reader_get_current (void) +{ + return (grub_reader_t) grub_reader_class.cur_handler; +} + +static inline grub_err_t +grub_reader_set_current (grub_reader_t reader) +{ + return grub_handler_set_current (&grub_reader_class, + GRUB_AS_HANDLER (reader)); +} + +void grub_register_rescue_reader (void); + +#endif /* ! GRUB_READER_HEADER */ diff --git a/include/grub/rescue.h b/include/grub/rescue.h deleted file mode 100644 index d02c83ece..000000000 --- a/include/grub/rescue.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_RESCUE_HEADER -#define GRUB_RESCUE_HEADER 1 - -#include - -/* Enter rescue mode. */ -void grub_enter_rescue_mode (void); - -#endif /* ! GRUB_RESCUE_HEADER */ diff --git a/include/grub/script.h b/include/grub/script_sh.h similarity index 96% rename from include/grub/script.h rename to include/grub/script_sh.h index 4d18b9266..188068141 100644 --- a/include/grub/script.h +++ b/include/grub/script_sh.h @@ -1,4 +1,4 @@ -/* script.h */ +/* normal_parser.h */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. @@ -17,8 +17,8 @@ * along with GRUB. If not, see . */ -#ifndef GRUB_SCRIPT_HEADER -#define GRUB_SCRIPT_HEADER 1 +#ifndef GRUB_NORMAL_PARSER_HEADER +#define GRUB_NORMAL_PARSER_HEADER 1 #include #include @@ -134,7 +134,7 @@ struct grub_lexer_param /* Function used by the lexer to get a new line when more input is expected, but not available. */ - grub_err_t (*getline) (char **); + grub_reader_getline_t getline; /* A reference counter. If this is >0 it means that the parser expects more tokens and `getline' should be called to fetch more. @@ -156,7 +156,7 @@ struct grub_lexer_param /* Points to the recording. */ char *recording; - /* index in the RECORDING. */ + /* index in the RECORDING. */ int recordpos; /* Size of RECORDING. */ @@ -218,13 +218,13 @@ grub_script_arg_add (struct grub_parser_param *state, grub_script_arg_type_t type, char *str); struct grub_script *grub_script_parse (char *script, - grub_err_t (*getline) (char **)); + grub_reader_getline_t getline); void grub_script_free (struct grub_script *script); struct grub_script *grub_script_create (struct grub_script_cmd *cmd, struct grub_script_mem *mem); struct grub_lexer_param *grub_script_lexer_init (char *s, - grub_err_t (*getline) (char **)); + grub_reader_getline_t getline); void grub_script_lexer_ref (struct grub_lexer_param *); void grub_script_lexer_deref (struct grub_lexer_param *); void grub_script_lexer_record_start (struct grub_lexer_param *); @@ -232,7 +232,7 @@ char *grub_script_lexer_record_stop (struct grub_lexer_param *); /* Functions to track allocated memory. */ struct grub_script_mem *grub_script_mem_record (struct grub_parser_param *state); -struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state, +struct grub_script_mem *grub_script_mem_record_stop (struct grub_parser_param *state, struct grub_script_mem *restore); void *grub_script_malloc (struct grub_parser_param *state, grub_size_t size); @@ -284,4 +284,4 @@ int grub_script_function_iterate (int (*iterate) (grub_script_function_t)); int grub_script_function_call (grub_script_function_t func, int argc, char **args); -#endif /* ! GRUB_SCRIPT_HEADER */ +#endif /* ! GRUB_NORMAL_PARSER_HEADER */ diff --git a/kern/main.c b/kern/main.c index 40300b24d..1d88b60f6 100644 --- a/kern/main.c +++ b/kern/main.c @@ -22,11 +22,13 @@ #include #include #include -#include #include #include #include #include +#include +#include +#include void grub_module_iterate (int (*hook) (struct grub_module_header *header)) @@ -120,6 +122,9 @@ grub_load_normal_mode (void) /* Something went wrong. Print errors here to let user know why we're entering rescue mode. */ grub_print_error (); + grub_errno = 0; + + grub_command_execute ("normal", 0, 0); } /* The main routine. */ @@ -144,9 +149,10 @@ grub_main (void) grub_env_export ("prefix"); grub_set_root_dev (); - /* Load the normal mode module. */ - grub_load_normal_mode (); + grub_register_core_commands (); + grub_register_rescue_parser (); + grub_register_rescue_reader (); - /* Enter the rescue mode. */ - grub_enter_rescue_mode (); + grub_load_normal_mode (); + grub_reader_loop (0); } diff --git a/kern/parser.c b/kern/parser.c index e93185334..685ab2250 100644 --- a/kern/parser.c +++ b/kern/parser.c @@ -1,7 +1,7 @@ /* parser.c - the part of the parser that can return partial tokens */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -100,7 +100,7 @@ grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) grub_err_t -grub_parser_split_cmdline (const char *cmdline, grub_err_t (*getline) (char **), +grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline, int *argc, char ***argv) { grub_parser_state_t state = GRUB_PARSER_STATE_TEXT; @@ -152,7 +152,7 @@ grub_parser_split_cmdline (const char *cmdline, grub_err_t (*getline) (char **), if (! *rd) { if (getline) - getline (&rd); + getline (&rd, 1); else break; } @@ -227,3 +227,45 @@ grub_parser_split_cmdline (const char *cmdline, grub_err_t (*getline) (char **), return 0; } + +struct grub_handler_class grub_parser_class = + { + .name = "parser" + }; + +grub_err_t +grub_parser_execute (char *source) +{ + auto grub_err_t getline (char **line, int cont); + grub_err_t getline (char **line, int cont __attribute__ ((unused))) + { + char *p; + + if (! source) + { + *line = 0; + return 0; + } + + p = grub_strchr (source, '\n'); + if (p) + *(p++) = 0; + + *line = grub_strdup (source); + source = p; + return 0; + } + + while (source) + { + char *line; + grub_parser_t parser; + + getline (&line, 0); + parser = grub_parser_get_current (); + parser->parse_line (line, getline); + grub_free (line); + } + + return grub_errno; +} diff --git a/kern/reader.c b/kern/reader.c new file mode 100644 index 000000000..271a90f5a --- /dev/null +++ b/kern/reader.c @@ -0,0 +1,49 @@ +/* reader.c - reader support */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +struct grub_handler_class grub_reader_class = + { + .name = "reader" + }; + +grub_err_t +grub_reader_loop (grub_reader_getline_t getline) +{ + while (1) + { + char *line; + grub_reader_getline_t func; + + /* Print an error, if any. */ + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + + func = (getline) ? : grub_reader_get_current ()->read_line; + if ((func (&line, 0)) || (! line)) + return grub_errno; + + grub_parser_get_current ()->parse_line (line, func); + grub_free (line); + } +} diff --git a/kern/rescue.c b/kern/rescue.c deleted file mode 100644 index 69a5db90e..000000000 --- a/kern/rescue.c +++ /dev/null @@ -1,163 +0,0 @@ -/* rescue.c - rescue mode */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define GRUB_RESCUE_BUF_SIZE 256 -#define GRUB_RESCUE_MAX_ARGS 20 - -static char linebuf[GRUB_RESCUE_BUF_SIZE]; - -/* Prompt to input a command and read the line. */ -static void -grub_rescue_get_command_line (const char *prompt) -{ - int c; - int pos = 0; - - grub_printf (prompt); - grub_memset (linebuf, 0, GRUB_RESCUE_BUF_SIZE); - - while ((c = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != '\n' && c != '\r') - { - if (grub_isprint (c)) - { - if (pos < GRUB_RESCUE_BUF_SIZE - 1) - { - linebuf[pos++] = c; - grub_putchar (c); - } - } - else if (c == '\b') - { - if (pos > 0) - { - linebuf[--pos] = 0; - grub_putchar (c); - grub_putchar (' '); - grub_putchar (c); - } - } - grub_refresh (); - } - - grub_putchar ('\n'); - grub_refresh (); -} - -static void -attempt_normal_mode (void) -{ - grub_command_t cmd; - - cmd = grub_command_find ("normal"); - if (cmd) - (cmd->func) (cmd, 0, 0); -} - -/* Enter the rescue mode. */ -void -grub_enter_rescue_mode (void) -{ - auto grub_err_t getline (char **line); - - grub_err_t getline (char **line) - { - grub_rescue_get_command_line ("> "); - *line = linebuf; - return 0; - } - - grub_register_core_commands (); - - /* First of all, attempt to execute the normal mode. */ - attempt_normal_mode (); - - grub_printf ("Entering rescue mode...\n"); - - while (1) - { - char *line = linebuf; - char *name; - int n; - grub_command_t cmd; - char **args; - - /* Print an error, if any. */ - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - - /* Get a command line. */ - grub_rescue_get_command_line ("grub rescue> "); - if (line[0] == 0) - continue; - - if (grub_parser_split_cmdline (line, getline, &n, &args) || n < 0) - continue; - - /* In case of an assignment set the environment accordingly - instead of calling a function. */ - if (n == 0 && grub_strchr (line, '=')) - { - char *val = grub_strchr (args[0], '='); - val[0] = 0; - grub_env_set (args[0], val + 1); - val[0] = '='; - grub_free (args[0]); - continue; - } - - /* Get the command name. */ - name = args[0]; - - /* If nothing is specified, restart. */ - if (*name == '\0') - { - grub_free (args[0]); - continue; - } - - cmd = grub_command_find (name); - if (cmd) - { - (cmd->func) (cmd, n, &args[1]); - } - else - { - grub_printf ("Unknown command `%s'\n", name); - grub_printf ("Try `help' for usage\n"); - } - - grub_free (args[0]); - } -} diff --git a/kern/rescue_parser.c b/kern/rescue_parser.c new file mode 100644 index 000000000..79f32b8fd --- /dev/null +++ b/kern/rescue_parser.c @@ -0,0 +1,84 @@ +/* rescue_parser.c - rescue mode parser */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_err_t +grub_rescue_parse_line (char *line, grub_reader_getline_t getline) +{ + char *name; + int n; + grub_command_t cmd; + char **args; + + if (grub_parser_split_cmdline (line, getline, &n, &args) || n < 0) + return grub_errno; + + /* In case of an assignment set the environment accordingly + instead of calling a function. */ + if (n == 0 && grub_strchr (line, '=')) + { + char *val = grub_strchr (args[0], '='); + val[0] = 0; + grub_env_set (args[0], val + 1); + val[0] = '='; + goto quit; + } + + /* Get the command name. */ + name = args[0]; + + /* If nothing is specified, restart. */ + if (*name == '\0') + goto quit; + + cmd = grub_command_find (name); + if (cmd) + { + (cmd->func) (cmd, n, &args[1]); + } + else + { + grub_printf ("Unknown command `%s'\n", name); + grub_printf ("Try `help' for usage\n"); + } + + quit: + grub_free (args[0]); + grub_free (args); + + return grub_errno; +} + +static struct grub_parser grub_rescue_parser = + { + .name = "rescue", + .parse_line = grub_rescue_parse_line + }; + +void +grub_register_rescue_parser (void) +{ + grub_parser_register ("rescue", &grub_rescue_parser); +} diff --git a/kern/rescue_reader.c b/kern/rescue_reader.c new file mode 100644 index 000000000..2a06f3fc2 --- /dev/null +++ b/kern/rescue_reader.c @@ -0,0 +1,88 @@ +/* rescue_reader.c - rescue mode reader */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +#define GRUB_RESCUE_BUF_SIZE 256 + +static char linebuf[GRUB_RESCUE_BUF_SIZE]; + +static grub_err_t +grub_rescue_init (void) +{ + grub_printf ("Entering rescue mode...\n"); + return 0; +} + +/* Prompt to input a command and read the line. */ +static grub_err_t +grub_rescue_read_line (char **line, int cont) +{ + int c; + int pos = 0; + + grub_printf ((cont) ? "> " : "grub rescue> "); + grub_memset (linebuf, 0, GRUB_RESCUE_BUF_SIZE); + + while ((c = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != '\n' && c != '\r') + { + if (grub_isprint (c)) + { + if (pos < GRUB_RESCUE_BUF_SIZE - 1) + { + linebuf[pos++] = c; + grub_putchar (c); + } + } + else if (c == '\b') + { + if (pos > 0) + { + linebuf[--pos] = 0; + grub_putchar (c); + grub_putchar (' '); + grub_putchar (c); + } + } + grub_refresh (); + } + + grub_putchar ('\n'); + grub_refresh (); + + *line = grub_strdup (linebuf); + + return 0; +} + +static struct grub_reader grub_rescue_reader = + { + .name = "rescue", + .init = grub_rescue_init, + .read_line = grub_rescue_read_line + }; + +void +grub_register_rescue_reader (void) +{ + grub_reader_register ("rescue", &grub_rescue_reader); +} diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 27042a50d..2f7e1e403 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #include #include diff --git a/loader/multiboot2.c b/loader/multiboot2.c index 2fb56bfdf..fd8282849 100644 --- a/loader/multiboot2.c +++ b/loader/multiboot2.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include #include diff --git a/loader/sparc64/ieee1275/linux.c b/loader/sparc64/ieee1275/linux.c index 4f5b3cee8..86e532f7f 100644 --- a/loader/sparc64/ieee1275/linux.c +++ b/loader/sparc64/ieee1275/linux.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include #include diff --git a/normal/autofs.c b/normal/autofs.c new file mode 100644 index 000000000..39f2f9ddc --- /dev/null +++ b/normal/autofs.c @@ -0,0 +1,134 @@ +/* autofs.c - support auto-loading from fs.lst */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +/* This is used to store the names of filesystem modules for auto-loading. */ +struct grub_fs_module_list +{ + char *name; + struct grub_fs_module_list *next; +}; +typedef struct grub_fs_module_list *grub_fs_module_list_t; + +static grub_fs_module_list_t fs_module_list = 0; + +/* The auto-loading hook for filesystems. */ +static int +autoload_fs_module (void) +{ + grub_fs_module_list_t p; + + while ((p = fs_module_list) != 0) + { + if (! grub_dl_get (p->name) && grub_dl_load (p->name)) + return 1; + + fs_module_list = p->next; + grub_free (p->name); + grub_free (p); + } + + return 0; +} + +/* Read the file fs.lst for auto-loading. */ +void +read_fs_list (void) +{ + const char *prefix; + static int first_time = 1; + + /* Make sure that this function does not get executed twice. */ + if (! first_time) + return; + first_time = 0; + + prefix = grub_env_get ("prefix"); + if (prefix) + { + char *filename; + + filename = grub_malloc (grub_strlen (prefix) + sizeof ("/fs.lst")); + if (filename) + { + grub_file_t file; + + grub_sprintf (filename, "%s/fs.lst", prefix); + file = grub_file_open (filename); + if (file) + { + while (1) + { + char *buf; + char *p; + char *q; + grub_fs_module_list_t fs_mod; + + buf = grub_file_getline (file); + if (! buf) + break; + + p = buf; + q = buf + grub_strlen (buf) - 1; + + /* Ignore space. */ + while (grub_isspace (*p)) + p++; + + while (p < q && grub_isspace (*q)) + *q-- = '\0'; + + /* If the line is empty, skip it. */ + if (p >= q) + continue; + + fs_mod = grub_malloc (sizeof (*fs_mod)); + if (! fs_mod) + continue; + + fs_mod->name = grub_strdup (p); + if (! fs_mod->name) + { + grub_free (fs_mod); + continue; + } + + fs_mod->next = fs_module_list; + fs_module_list = fs_mod; + } + + grub_file_close (file); + } + + grub_free (filename); + } + } + + /* Ignore errors. */ + grub_errno = GRUB_ERR_NONE; + + /* Set the hook. */ + grub_fs_autoload_hook = autoload_fs_module; +} diff --git a/normal/cmdline.c b/normal/cmdline.c index 8ca83f6bb..4ef8890fb 100644 --- a/normal/cmdline.c +++ b/normal/cmdline.c @@ -132,37 +132,6 @@ grub_history_replace (int pos, char *s) hist_lines[pos] = grub_strdup (s); } -void -grub_cmdline_run (int nested) -{ - grub_normal_init_page (); - grub_setcursor (1); - - grub_printf ("\ - [ Minimal BASH-like line editing is supported. For the first word, TAB\n\ - lists possible command completions. Anywhere else TAB lists possible\n\ - device/file completions.%s ]\n\n", - nested ? " ESC at any time exits." : ""); - - while (1) - { - static char cmdline[GRUB_MAX_CMDLINE]; - - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - cmdline[0] = '\0'; - - if (! grub_cmdline_get ("grub> ", cmdline, sizeof (cmdline), 0, 1) - && nested) - return; - - if (! *cmdline) - continue; - - grub_command_execute (cmdline, 1); - } -} - /* A completion hook to print items. */ static void print_completion (const char *item, grub_completion_type_t type, int count) diff --git a/normal/dyncmd.c b/normal/dyncmd.c new file mode 100644 index 000000000..154da6114 --- /dev/null +++ b/normal/dyncmd.c @@ -0,0 +1,158 @@ +/* dyncmd.c - support dynamic command */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_err_t +grub_dyncmd_dispatcher (struct grub_command *cmd, + int argc, char **args) +{ + char *modname = cmd->data; + grub_dl_t mod; + grub_err_t ret; + + mod = grub_dl_load (modname); + if (mod) + { + char *name; + + grub_free (modname); + grub_dl_ref (mod); + + name = (char *) cmd->name; + grub_unregister_command (cmd); + + cmd = grub_command_find (name); + if (cmd) + ret = (cmd->func) (cmd, argc, args); + else + ret = grub_errno; + + grub_free (name); + } + else + ret = grub_errno; + + return ret; +} + +/* Read the file command.lst for auto-loading. */ +void +read_command_list (void) +{ + const char *prefix; + static int first_time = 1; + + /* Make sure that this function does not get executed twice. */ + if (! first_time) + return; + first_time = 0; + + prefix = grub_env_get ("prefix"); + if (prefix) + { + char *filename; + + filename = grub_malloc (grub_strlen (prefix) + sizeof ("/command.lst")); + if (filename) + { + grub_file_t file; + + grub_sprintf (filename, "%s/command.lst", prefix); + file = grub_file_open (filename); + if (file) + { + char *buf = 0; + for (;; grub_free(buf)) + { + char *p, *name, *modname; + grub_command_t cmd; + int prio = 0; + + buf = grub_file_getline (file); + + if (! buf) + break; + + name = buf; + if (*name == '*') + { + name++; + prio++; + } + + if (! grub_isgraph (name[0])) + continue; + + p = grub_strchr (name, ':'); + if (! p) + continue; + + *p = '\0'; + while (*++p == ' ') + ; + + if (! grub_isgraph (*p)) + continue; + + if (grub_dl_get (p)) + continue; + + name = grub_strdup (name); + if (! name) + continue; + + modname = grub_strdup (p); + if (! modname) + { + grub_free (name); + continue; + } + + cmd = grub_register_command_prio (name, + grub_dyncmd_dispatcher, + 0, "not loaded", prio); + if (! cmd) + { + grub_free (name); + grub_free (modname); + continue; + } + cmd->flags |= GRUB_COMMAND_FLAG_DYNCMD; + cmd->data = modname; + + /* Update the active flag. */ + grub_command_find (name); + } + + grub_file_close (file); + } + + grub_free (filename); + } + } + + /* Ignore errors. */ + grub_errno = GRUB_ERR_NONE; +} diff --git a/normal/main.c b/normal/main.c index 1a50d9553..1c2eff4df 100644 --- a/normal/main.c +++ b/normal/main.c @@ -20,20 +20,15 @@ #include #include #include -#include #include #include #include #include #include #include -#include +#include #include -grub_jmp_buf grub_exit_env; - -static grub_fs_module_list_t fs_module_list = 0; - #define GRUB_DEFAULT_HISTORY_SIZE 50 /* Read a line from the file FILE. */ @@ -43,7 +38,6 @@ grub_file_getline (grub_file_t file) char c; int pos = 0; int literal = 0; - int comment = 0; char *cmdline; int max_len = 64; @@ -84,16 +78,9 @@ grub_file_getline (grub_file_t file) if (c == '\\') literal = 1; - if (comment) + if (pos == 0) { - if (c == '\n') - comment = 0; - } - else if (pos == 0) - { - if (c == '#') - comment = 1; - else if (! grub_isspace (c)) + if (! grub_isspace (c)) cmdline[pos++] = c; } else @@ -138,7 +125,6 @@ free_menu (grub_menu_t menu) { grub_menu_entry_t next_entry = entry->next; - grub_script_free (entry->commands); grub_free ((void *) entry->title); grub_free ((void *) entry->sourcecode); entry = next_entry; @@ -164,8 +150,8 @@ free_menu_entry_classes (struct grub_menu_entry_class *head) } grub_err_t -grub_normal_menu_addentry (int argc, const char **args, - struct grub_script *script, const char *sourcecode) +grub_menu_addentry (int argc, const char **args, + const char *sourcecode) { const char *menutitle = 0; const char *menusourcecode; @@ -237,7 +223,7 @@ grub_normal_menu_addentry (int argc, const char **args, /* Handle invalid argument. */ failed = 1; grub_error (GRUB_ERR_MENU, - "invalid argument for menuentry: %s", args[i]); + "invalid argument for menuentry: %s", args[i]); break; } } @@ -251,7 +237,7 @@ grub_normal_menu_addentry (int argc, const char **args, { failed = 1; grub_error (GRUB_ERR_MENU, - "too many titles for menuentry: %s", args[i]); + "too many titles for menuentry: %s", args[i]); break; } } @@ -287,7 +273,6 @@ grub_normal_menu_addentry (int argc, const char **args, return grub_errno; } - (*last)->commands = script; (*last)->title = menutitle; (*last)->classes = classes_head; (*last)->next = 0; @@ -299,20 +284,56 @@ grub_normal_menu_addentry (int argc, const char **args, } static grub_menu_t -read_config_file (const char *config, int nested) +read_config_file (const char *config) { grub_file_t file; - auto grub_err_t getline (char **line); - int currline = 0; - int errors = 0; + grub_parser_t old_parser = 0; - grub_err_t getline (char **line) + auto grub_err_t getline (char **line, int cont); + grub_err_t getline (char **line, int cont __attribute__ ((unused))) { - currline++; + while (1) + { + char *buf; - *line = grub_file_getline (file); - if (! *line) - return grub_errno; + *line = buf = grub_file_getline (file); + if (! buf) + return grub_errno; + + if (buf[0] == '#') + { + if (buf[1] == '!') + { + grub_parser_t parser; + grub_named_list_t list; + + buf += 2; + while (grub_isspace (*buf)) + buf++; + + if (! old_parser) + old_parser = grub_parser_get_current (); + + list = GRUB_AS_NAMED_LIST (grub_parser_class.handler_list); + parser = grub_named_list_find (list, buf); + if (parser) + grub_parser_set_current (parser); + else + { + char cmd_name[8 + grub_strlen (buf)]; + + /* Perhaps it's not loaded yet, try the autoload + command. */ + grub_strcpy (cmd_name, "parser."); + grub_strcat (cmd_name, buf); + grub_command_execute (cmd_name, 0, 0); + } + } + grub_free (*line); + } + else + break; + } return GRUB_ERR_NONE; } @@ -320,14 +341,15 @@ read_config_file (const char *config, int nested) grub_menu_t newmenu; newmenu = grub_env_get_data_slot ("menu"); - - if (nested || ! newmenu) + if (! newmenu) { newmenu = grub_malloc (sizeof (*newmenu)); if (! newmenu) return 0; newmenu->size = 0; newmenu->entry_list = 0; + + grub_env_set_data_slot ("menu", newmenu); } /* Try to open the config file. */ @@ -335,58 +357,15 @@ read_config_file (const char *config, int nested) if (! file) return 0; - grub_env_set_data_slot ("menu", newmenu); - - while (1) - { - struct grub_script *parsed_script; - int startline; - char *cmdline; - - cmdline = grub_file_getline (file); - if (!cmdline) - break; - - startline = ++currline; - - /* Execute the script, line for line. */ - parsed_script = grub_script_parse (cmdline, getline); - - grub_free (cmdline); - - if (! parsed_script) - { - grub_printf ("(line %d-%d)\n", startline, currline); - errors++; - continue; - } - - /* Execute the command(s). */ - grub_script_execute (parsed_script); - - /* Ignore errors. */ - grub_errno = GRUB_ERR_NONE; - - /* The parsed script was executed, throw it away. */ - grub_script_free (parsed_script); - } - + grub_reader_loop (getline); grub_file_close (file); - if (errors > 0) - grub_wait_after_message (); + if (old_parser) + grub_parser_set_current (old_parser); return newmenu; } -/* This starts the normal mode. */ -void -grub_enter_normal_mode (const char *config) -{ - if (grub_setjmp (grub_exit_env) == 0) - grub_normal_execute (config, 0, 0); -} - /* Initialize the screen. */ void grub_normal_init_page (void) @@ -409,237 +388,7 @@ grub_normal_init_page (void) #undef TITLE } -static grub_err_t -grub_dyncmd_dispatcher (struct grub_command *cmd, - int argc, char **args) -{ - char *modname = cmd->data; - grub_dl_t mod; - grub_err_t ret; - - mod = grub_dl_load (modname); - if (mod) - { - char *name; - - grub_free (modname); - grub_dl_ref (mod); - - name = (char *) cmd->name; - grub_unregister_command (cmd); - - cmd = grub_command_find (name); - if (cmd) - ret = (cmd->func) (cmd, argc, args); - else - ret = grub_errno; - - grub_free (name); - } - else - ret = grub_errno; - - return ret; -} - -/* Read the file command.lst for auto-loading. */ -static void -read_command_list (void) -{ - const char *prefix; - static int first_time = 1; - - /* Make sure that this function does not get executed twice. */ - if (! first_time) - return; - first_time = 0; - - prefix = grub_env_get ("prefix"); - if (prefix) - { - char *filename; - - filename = grub_malloc (grub_strlen (prefix) + sizeof ("/command.lst")); - if (filename) - { - grub_file_t file; - - grub_sprintf (filename, "%s/command.lst", prefix); - file = grub_file_open (filename); - if (file) - { - char *buf = 0; - for (;; grub_free(buf)) - { - char *p, *name, *modname; - grub_command_t cmd; - int prio = 0; - - buf = grub_file_getline (file); - - if (! buf) - break; - - name = buf; - if (*name == '*') - { - name++; - prio++; - } - - if (! grub_isgraph (name[0])) - continue; - - p = grub_strchr (name, ':'); - if (! p) - continue; - - *p = '\0'; - while (*++p == ' ') - ; - - if (! grub_isgraph (*p)) - continue; - - if (grub_dl_get (p)) - continue; - - name = grub_strdup (name); - if (! name) - continue; - - modname = grub_strdup (p); - if (! modname) - { - grub_free (name); - continue; - } - - cmd = grub_register_command_prio (name, - grub_dyncmd_dispatcher, - 0, "not loaded", prio); - if (! cmd) - { - grub_free (name); - grub_free (modname); - continue; - } - cmd->flags |= GRUB_COMMAND_FLAG_DYNCMD; - cmd->data = modname; - - /* Update the active flag. */ - grub_command_find (name); - } - - grub_file_close (file); - } - - grub_free (filename); - } - } - - /* Ignore errors. */ - grub_errno = GRUB_ERR_NONE; -} - -/* The auto-loading hook for filesystems. */ -static int -autoload_fs_module (void) -{ - grub_fs_module_list_t p; - - while ((p = fs_module_list) != 0) - { - if (! grub_dl_get (p->name) && grub_dl_load (p->name)) - return 1; - - fs_module_list = p->next; - grub_free (p->name); - grub_free (p); - } - - return 0; -} - -/* Read the file fs.lst for auto-loading. */ -static void -read_fs_list (void) -{ - const char *prefix; - static int first_time = 1; - - /* Make sure that this function does not get executed twice. */ - if (! first_time) - return; - first_time = 0; - - prefix = grub_env_get ("prefix"); - if (prefix) - { - char *filename; - - filename = grub_malloc (grub_strlen (prefix) + sizeof ("/fs.lst")); - if (filename) - { - grub_file_t file; - - grub_sprintf (filename, "%s/fs.lst", prefix); - file = grub_file_open (filename); - if (file) - { - while (1) - { - char *buf; - char *p; - char *q; - grub_fs_module_list_t fs_mod; - - buf = grub_file_getline (file); - if (! buf) - break; - - p = buf; - q = buf + grub_strlen (buf) - 1; - - /* Ignore space. */ - while (grub_isspace (*p)) - p++; - - while (p < q && grub_isspace (*q)) - *q-- = '\0'; - - /* If the line is empty, skip it. */ - if (p >= q) - continue; - - fs_mod = grub_malloc (sizeof (*fs_mod)); - if (! fs_mod) - continue; - - fs_mod->name = grub_strdup (p); - if (! fs_mod->name) - { - grub_free (fs_mod); - continue; - } - - fs_mod->next = fs_module_list; - fs_module_list = fs_mod; - } - - grub_file_close (file); - } - - grub_free (filename); - } - } - - /* Ignore errors. */ - grub_errno = GRUB_ERR_NONE; - - /* Set the hook. */ - grub_fs_autoload_hook = autoload_fs_module; -} +static int reader_nested; /* Read the config file COFIG, and execute the menu interface or the command-line interface if BATCH is false. */ @@ -651,10 +400,13 @@ grub_normal_execute (const char *config, int nested, int batch) read_command_list (); read_fs_list (); read_handler_list (); + grub_command_execute ("parser.sh", 0, 0); + + reader_nested = nested; if (config) { - menu = read_config_file (config, nested); + menu = read_config_file (config); /* Ignore any error. */ grub_errno = GRUB_ERR_NONE; @@ -663,39 +415,27 @@ grub_normal_execute (const char *config, int nested, int batch) if (! batch) { if (menu && menu->size) - { - grub_menu_viewer_show_menu (menu, nested); - if (nested) - free_menu (menu); - } - else - grub_cmdline_run (nested); + { + grub_menu_viewer_show_menu (menu, nested); + if (nested) + free_menu (menu); + } } } -static grub_err_t -grub_cmd_rescue (struct grub_command *cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char **args __attribute__ ((unused))) +/* This starts the normal mode. */ +void +grub_enter_normal_mode (const char *config) { - grub_longjmp (grub_exit_env, 0); - - /* Never reach here. */ - return 0; + grub_normal_execute (config, 0, 0); } -static grub_command_t cmd_normal; - /* Enter normal mode from rescue mode. */ static grub_err_t -grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), +grub_cmd_normal (struct grub_command *cmd, int argc, char *argv[]) { - grub_command_t cmd_rescue; - - grub_unregister_command (cmd_normal); - cmd_rescue = grub_register_command ("rescue", grub_cmd_rescue, - 0, "enter rescue mode"); + grub_unregister_command (cmd); if (argc == 0) { @@ -722,12 +462,77 @@ grub_cmd_normal (struct grub_command *cmd __attribute__ ((unused)), grub_enter_normal_mode (argv[0]); quit: - grub_unregister_command (cmd_rescue); - cmd_normal = grub_register_command_prio ("normal", grub_cmd_normal, - 0, "enter normal mode", 0); return 0; } +void +grub_cmdline_run (int nested) +{ + grub_reader_t reader = grub_reader_get_current (); + + reader_nested = nested; + if (reader->init) + reader->init (); + grub_reader_loop (0); +} + +static grub_err_t +grub_normal_reader_init (void) +{ + grub_normal_init_page (); + grub_setcursor (1); + + grub_printf ("\ + [ Minimal BASH-like line editing is supported. For the first word, TAB\n\ + lists possible command completions. Anywhere else TAB lists possible\n\ + device/file completions.%s ]\n\n", + reader_nested ? " ESC at any time exits." : ""); + + return 0; +} + +static char cmdline[GRUB_MAX_CMDLINE]; + +static grub_err_t +grub_normal_read_line (char **line, int cont) +{ + grub_parser_t parser = grub_parser_get_current (); + char prompt[8 + grub_strlen (parser->name)]; + + grub_sprintf (prompt, "%s:%s> ", parser->name, (cont) ? "" : "grub"); + + while (1) + { + cmdline[0] = 0; + if (grub_cmdline_get (prompt, cmdline, sizeof (cmdline), 0, 1)) + break; + + if ((reader_nested) || (cont)) + { + *line = 0; + return grub_errno; + } + } + + *line = grub_strdup (cmdline); + return 0; +} + +static struct grub_reader grub_normal_reader = + { + .name = "normal", + .init = grub_normal_reader_init, + .read_line = grub_normal_read_line + }; + +static char * +grub_env_write_pager (struct grub_env_var *var __attribute__ ((unused)), + const char *val) +{ + grub_set_more ((*val == '1')); + return grub_strdup (val); +} + GRUB_MOD_INIT(normal) { /* Normal mode shouldn't be unloaded. */ @@ -738,9 +543,13 @@ GRUB_MOD_INIT(normal) grub_set_history (GRUB_DEFAULT_HISTORY_SIZE); + grub_reader_register ("normal", &grub_normal_reader); + grub_reader_set_current (&grub_normal_reader); + grub_register_variable_hook ("pager", 0, grub_env_write_pager); + /* Register a command "normal" for the rescue mode. */ - cmd_normal = grub_register_command ("normal", grub_cmd_normal, - 0, "enter normal mode"); + grub_register_command_prio ("normal", grub_cmd_normal, + 0, "Enter normal mode", 0); /* Reload terminal colors when these variables are written to. */ grub_register_variable_hook ("color_normal", NULL, grub_env_write_color_normal); @@ -754,6 +563,8 @@ GRUB_MOD_INIT(normal) GRUB_MOD_FINI(normal) { grub_set_history (0); - grub_unregister_command (cmd_normal); + grub_reader_unregister (&grub_normal_reader); + grub_register_variable_hook ("pager", 0, 0); + grub_fs_autoload_hook = 0; free_handler_list (); } diff --git a/normal/menu.c b/normal/menu.c index df262096c..abf1b0f6d 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -23,8 +23,8 @@ #include #include #include -#include #include +#include /* Get a menu entry by its index in the entry list. */ grub_menu_entry_t @@ -123,11 +123,11 @@ get_and_remove_first_entry_number (const char *name) void grub_menu_execute_entry(grub_menu_entry_t entry) { - grub_script_execute (entry->commands); + grub_parser_execute ((char *) entry->sourcecode); if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ()) /* Implicit execution of boot, only if something is loaded. */ - grub_command_execute ("boot", 0); + grub_command_execute ("boot", 0, 0); } /* Execute ENTRY from the menu MENU, falling back to entries specified diff --git a/normal/menu_entry.c b/normal/menu_entry.c index a9c17886f..6ec0d632a 100644 --- a/normal/menu_entry.c +++ b/normal/menu_entry.c @@ -21,7 +21,8 @@ #include #include #include -#include +#include +#include enum update_mode { @@ -970,12 +971,11 @@ clear_completions (void) static int run (struct screen *screen) { - struct grub_script *parsed_script = 0; int currline = 0; char *nextline; - auto grub_err_t editor_getline (char **line); - grub_err_t editor_getline (char **line) + auto grub_err_t editor_getline (char **line, int cont); + grub_err_t editor_getline (char **line, int cont __attribute__ ((unused))) { struct line *linep = screen->lines + currline; char *p; @@ -1008,23 +1008,14 @@ run (struct screen *screen) /* Execute the script, line for line. */ while (currline < screen->num_lines) { - editor_getline (&nextline); - parsed_script = grub_script_parse (nextline, editor_getline); - if (parsed_script) - { - /* Execute the command(s). */ - grub_script_execute (parsed_script); - - /* The parsed script was executed, throw it away. */ - grub_script_free (parsed_script); - } - else + editor_getline (&nextline, 0); + if (grub_parser_get_current ()->parse_line (nextline, editor_getline)) break; } if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ()) /* Implicit execution of boot, only if something is loaded. */ - grub_command_execute ("boot", 0); + grub_command_execute ("boot", 0, 0); if (grub_errno != GRUB_ERR_NONE) { diff --git a/normal/menu_text.c b/normal/menu_text.c index 9e97c32e9..e0d96c47f 100644 --- a/normal/menu_text.c +++ b/normal/menu_text.c @@ -24,7 +24,6 @@ #include #include #include -#include #include /* Time to delay after displaying an error message about a default/fallback diff --git a/normal/execute.c b/script/sh/execute.c similarity index 94% rename from normal/execute.c rename to script/sh/execute.c index 8bf6d1745..3856dd95c 100644 --- a/normal/execute.c +++ b/script/sh/execute.c @@ -19,10 +19,12 @@ #include #include -#include #include -#include +#include +#include +#include #include +#include static grub_err_t grub_script_execute_cmd (struct grub_script_cmd *cmd) @@ -192,7 +194,6 @@ grub_script_execute_menuentry (struct grub_script_cmd *cmd) { struct grub_script_cmd_menuentry *cmd_menuentry; struct grub_script_arglist *arglist; - struct grub_script *script; char **args = 0; int argcount = 0; int i = 0; @@ -219,15 +220,8 @@ grub_script_execute_menuentry (struct grub_script_cmd *cmd) } } - /* Parse the menu entry *again*. */ - script = grub_script_parse ((char *) cmd_menuentry->sourcecode, 0); - - /* Add new menu entry. */ - if (script) - { - grub_normal_menu_addentry (argcount, (const char **)args, - script, cmd_menuentry->sourcecode); - } + grub_menu_addentry (argcount, (const char **) args, + cmd_menuentry->sourcecode); /* Free arguments. */ for (i = 0; i < argcount; i++) diff --git a/normal/function.c b/script/sh/function.c similarity index 96% rename from normal/function.c rename to script/sh/function.c index 4c08d1581..db6b903cd 100644 --- a/normal/function.c +++ b/script/sh/function.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,7 +17,7 @@ */ #include -#include +#include #include #include @@ -28,7 +28,7 @@ grub_script_function_create (char *functionname, struct grub_script *cmd) { grub_script_function_t func; grub_script_function_t *p; - + func = (grub_script_function_t) grub_malloc (sizeof (*func)); if (! func) return 0; @@ -39,7 +39,7 @@ grub_script_function_create (char *functionname, struct grub_script *cmd) grub_free (func); return 0; } - + func->func = cmd; /* Keep the list sorted for simplicity. */ @@ -107,11 +107,11 @@ int grub_script_function_iterate (int (*iterate) (grub_script_function_t)) { grub_script_function_t func; - + for (func = grub_script_function_list; func; func = func->next) if (iterate (func)) return 1; - + return 0; } diff --git a/normal/lexer.c b/script/sh/lexer.c similarity index 97% rename from normal/lexer.c rename to script/sh/lexer.c index f500374d5..8bae4871b 100644 --- a/normal/lexer.c +++ b/script/sh/lexer.c @@ -1,7 +1,7 @@ /* lexer.c - The scripting lexer. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -20,7 +20,7 @@ #include #include #include -#include +#include #include "grub_script.tab.h" @@ -44,7 +44,7 @@ check_textstate (grub_parser_state_t state) } struct grub_lexer_param * -grub_script_lexer_init (char *script, grub_err_t (*getline) (char **)) +grub_script_lexer_init (char *script, grub_reader_getline_t getline) { struct grub_lexer_param *param; @@ -176,7 +176,7 @@ grub_script_yylex2 (union YYSTYPE *yylval, struct grub_parser_param *parsestate) { grub_free (state->newscript); state->newscript = 0; - state->getline (&state->newscript); + state->getline (&state->newscript, 1); state->script = state->newscript; if (! state->script) return 0; diff --git a/normal/command.c b/script/sh/main.c similarity index 51% rename from normal/command.c rename to script/sh/main.c index 3296515c3..d4e342c71 100644 --- a/normal/command.c +++ b/script/sh/main.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,43 +16,17 @@ * along with GRUB. If not, see . */ -#include -#include -#include -#include -#include -#include #include #include -#include -#include -#include +#include -int -grub_command_execute (char *cmdline, int interactive) +static grub_err_t +grub_normal_parse_line (char *line, grub_reader_getline_t getline) { - auto grub_err_t cmdline_get (char **s); - grub_err_t cmdline_get (char **s) - { - *s = grub_malloc (GRUB_MAX_CMDLINE); - *s[0] = '\0'; - return grub_cmdline_get (">", *s, GRUB_MAX_CMDLINE, 0, 1); - } - - grub_err_t ret = 0; - char *pager; struct grub_script *parsed_script; - - /* Enable the pager if the environment pager is set to 1. */ - if (interactive) - pager = grub_env_get ("pager"); - else - pager = NULL; - if (pager && (! grub_strcmp (pager, "1"))) - grub_set_more (1); /* Parse the script. */ - parsed_script = grub_script_parse (cmdline, cmdline_get); + parsed_script = grub_script_parse (line, getline); if (parsed_script) { @@ -63,8 +37,22 @@ grub_command_execute (char *cmdline, int interactive) grub_script_free (parsed_script); } - if (pager && (! grub_strcmp (pager, "1"))) - grub_set_more (0); - - return ret; + return grub_errno; +} + +static struct grub_parser grub_sh_parser = + { + .name = "sh", + .parse_line = grub_normal_parse_line + }; + +GRUB_MOD_INIT(sh) +{ + (void) mod; + grub_parser_register ("sh", &grub_sh_parser); +} + +GRUB_MOD_FINI(sh) +{ + grub_parser_unregister (&grub_sh_parser); } diff --git a/normal/parser.y b/script/sh/parser.y similarity index 99% rename from normal/parser.y rename to script/sh/parser.y index eaf400b45..366f6b064 100644 --- a/normal/parser.y +++ b/script/sh/parser.y @@ -18,7 +18,7 @@ */ %{ -#include +#include #include #define YYFREE grub_free @@ -167,10 +167,10 @@ commands: command recognized after executing the `grub_script_mem_record; and before `grub_script_mem_record_stop'. */ function: "function" GRUB_PARSER_TOKEN_NAME - { + { grub_script_lexer_ref (state->lexerstate); } newlines '{' - { + { /* The first part of the function was recognized. Now start recording the memory usage to store this function. */ diff --git a/normal/script.c b/script/sh/script.c similarity index 98% rename from normal/script.c rename to script/sh/script.c index 0d5d5a8b7..3e80b8383 100644 --- a/normal/script.c +++ b/script/sh/script.c @@ -18,7 +18,7 @@ */ #include -#include +#include #include #include @@ -110,7 +110,7 @@ grub_script_arg_add (struct grub_parser_param *state, struct grub_script_arg *ar { struct grub_script_arg *argpart; struct grub_script_arg *ll; - + argpart = (struct grub_script_arg *) grub_script_malloc (state, sizeof (*arg)); argpart->type = type; argpart->str = str; @@ -121,7 +121,7 @@ grub_script_arg_add (struct grub_parser_param *state, struct grub_script_arg *ar for (ll = arg; ll->next; ll = ll->next); ll->next = argpart; - + return arg; } @@ -294,7 +294,7 @@ grub_script_create (struct grub_script_cmd *cmd, struct grub_script_mem *mem) /* Parse the script passed in SCRIPT and return the parsed datastructure that is ready to be interpreted. */ struct grub_script * -grub_script_parse (char *script, grub_err_t (*getline) (char **)) +grub_script_parse (char *script, grub_reader_getline_t getline) { struct grub_script *parsed; struct grub_script_mem *membackup; diff --git a/util/grub-emu.c b/util/grub-emu.c index 59392fe35..addbc085f 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -86,6 +86,11 @@ grub_machine_fini (void) { grub_console_fini (); } + +void +read_command_list (void) +{ +} static struct option options[] = From 09d842b9c634a10dbc63c2e66b3ef168d4e5ecfb Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 2 May 2009 21:46:34 +0000 Subject: [PATCH 0696/1707] 2009-05-02 Vladimir Serbinenko Mmap services * loader/i386/efi/linux.c (grub_linux_boot): use grub_mmap_iterate * loader/i386/linux.c (find_mmap_size): likewise (allocate_pages): likewise * loader/i386/multiboot.c (grub_get_multiboot_mmap_len): likewise (grub_fill_multiboot_mmap): likewise (grub_multiboot): use grub_mmap_get_lower and grub_mmap_get_upper * loader/i386/pc/linux.c (grub_cmd_linux): use grub_mmap_get_lower * include/grub/i386/bsd.h (OPENBSD_MMAP_AVAILABLE): new definition (OPENBSD_MMAP_RESERVED): likewise * include/grub/i386/pc/memory.h: include grub/memory.h (grub_lower_mem): removed (grub_upper_mem): likewise (GRUB_MACHINE_MEMORY_ACPI): new definition (GRUB_MACHINE_MEMORY_NVS): likewise (GRUB_MACHINE_MEMORY_MAX_TYPE): likewise (GRUB_MACHINE_MEMORY_HOLE): likewise (grub_machine_mmap_register): likewise (grub_machine_mmap_unregister): likewise (grub_machine_get_upper): likewise (grub_machine_get_lower): likewise (grub_machine_get_post64): likewise * include/grub/i386/efi/memory.h: new file * include/grub/x86_64/efi/memory.h: likewise * include/grub/efi/memory.h: likewise * conf/i386-pc.rmk (pkglib_MODULES): added mmap.mod (mmap_mod_SOURCES): new variable (mmap_mod_LDFLAGS): likewise (mmap_mod_ASFLAGS): likewise * conf/i386-coreboot.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/i386-efi.rmk: likewise * conf/x86_64-efi.rmk: likewise * include/grub/types.h (UINT_TO_PTR): new macro (PTR_TO_UINT32): likewise (PTR_TO_UINT64): likewise * include/grub/memory.h: new file * mmap/i386/pc/mmap.c: likewise * mmap/i386/pc/mmap_helper.S: likewise * mmap/i386/uppermem.c: likewise * mmap/mmap.c: likewise * mmap/efi/mmap.c: likewise * kern/i386/coreboot/init.c (grub_machine_init): don't use grub_upper_mem * kern/i386/pc/init.c (grub_lower_mem): removed variable (grub_upper_mem): likewise (grub_machine_init): don't use grub_upper_mem, make grub_lower_mem local * loader/i386/bsd.c (grub_openbsd_boot): use grub_mmap_get_lower, grub_mmap_iterate and grub_mmap_get_upper (grub_netbsd_boot): use grub_mmap_get_lower and grub_mmap_get_upper --- ChangeLog | 55 ++++ conf/i386-coreboot.rmk | 8 +- conf/i386-efi.rmk | 8 +- conf/i386-ieee1275.rmk | 8 +- conf/i386-pc.rmk | 10 +- conf/x86_64-efi.rmk | 8 +- include/grub/efi/memory.h | 48 ++++ include/grub/i386/bsd.h | 2 + include/grub/i386/efi/memory.h | 1 + include/grub/i386/pc/memory.h | 40 ++- include/grub/memory.h | 52 ++++ include/grub/types.h | 10 + include/grub/x86_64/efi/memory.h | 1 + kern/i386/coreboot/init.c | 10 +- kern/i386/pc/init.c | 3 +- loader/i386/bsd.c | 46 ++-- loader/i386/efi/linux.c | 117 ++++----- loader/i386/ieee1275/linux.c | 2 +- loader/i386/linux.c | 28 +- loader/i386/multiboot.c | 8 +- loader/i386/pc/linux.c | 11 +- mmap/efi/mmap.c | 284 +++++++++++++++++++++ mmap/i386/mmap.c | 98 +++++++ mmap/i386/pc/mmap.c | 216 ++++++++++++++++ mmap/i386/pc/mmap_helper.S | 122 +++++++++ mmap/i386/uppermem.c | 85 ++++++ mmap/mmap.c | 426 +++++++++++++++++++++++++++++++ 27 files changed, 1579 insertions(+), 128 deletions(-) create mode 100644 include/grub/efi/memory.h create mode 100644 include/grub/i386/efi/memory.h create mode 100644 include/grub/memory.h create mode 100644 include/grub/x86_64/efi/memory.h create mode 100644 mmap/efi/mmap.c create mode 100644 mmap/i386/mmap.c create mode 100644 mmap/i386/pc/mmap.c create mode 100644 mmap/i386/pc/mmap_helper.S create mode 100644 mmap/i386/uppermem.c create mode 100644 mmap/mmap.c diff --git a/ChangeLog b/ChangeLog index 81f7f55f5..c2f7dd2f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,58 @@ +2009-05-02 Vladimir Serbinenko + + Mmap services + + * loader/i386/efi/linux.c (grub_linux_boot): use grub_mmap_iterate + * loader/i386/linux.c (find_mmap_size): likewise + (allocate_pages): likewise + * loader/i386/multiboot.c (grub_get_multiboot_mmap_len): likewise + (grub_fill_multiboot_mmap): likewise + (grub_multiboot): use grub_mmap_get_lower and grub_mmap_get_upper + * loader/i386/pc/linux.c (grub_cmd_linux): use grub_mmap_get_lower + * include/grub/i386/bsd.h (OPENBSD_MMAP_AVAILABLE): new definition + (OPENBSD_MMAP_RESERVED): likewise + * include/grub/i386/pc/memory.h: include grub/memory.h + (grub_lower_mem): removed + (grub_upper_mem): likewise + (GRUB_MACHINE_MEMORY_ACPI): new definition + (GRUB_MACHINE_MEMORY_NVS): likewise + (GRUB_MACHINE_MEMORY_MAX_TYPE): likewise + (GRUB_MACHINE_MEMORY_HOLE): likewise + (grub_machine_mmap_register): likewise + (grub_machine_mmap_unregister): likewise + (grub_machine_get_upper): likewise + (grub_machine_get_lower): likewise + (grub_machine_get_post64): likewise + * include/grub/i386/efi/memory.h: new file + * include/grub/x86_64/efi/memory.h: likewise + * include/grub/efi/memory.h: likewise + * conf/i386-pc.rmk (pkglib_MODULES): added mmap.mod + (mmap_mod_SOURCES): new variable + (mmap_mod_LDFLAGS): likewise + (mmap_mod_ASFLAGS): likewise + * conf/i386-coreboot.rmk: likewise + * conf/i386-ieee1275.rmk: likewise + * conf/i386-efi.rmk: likewise + * conf/x86_64-efi.rmk: likewise + * include/grub/types.h (UINT_TO_PTR): new macro + (PTR_TO_UINT32): likewise + (PTR_TO_UINT64): likewise + * include/grub/memory.h: new file + * mmap/i386/pc/mmap.c: likewise + * mmap/i386/pc/mmap_helper.S: likewise + * mmap/i386/uppermem.c: likewise + * mmap/mmap.c: likewise + * mmap/efi/mmap.c: likewise + * kern/i386/coreboot/init.c (grub_machine_init): don't use + grub_upper_mem + * kern/i386/pc/init.c (grub_lower_mem): removed variable + (grub_upper_mem): likewise + (grub_machine_init): don't use grub_upper_mem, + make grub_lower_mem local + * loader/i386/bsd.c (grub_openbsd_boot): use grub_mmap_get_lower, + grub_mmap_iterate and grub_mmap_get_upper + (grub_netbsd_boot): use grub_mmap_get_lower and grub_mmap_get_upper + 2009-05-02 Bean * conf/common.rmk (grub_script.tab.c): Change normal/parser.y to diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index dbacc11ba..f000328ab 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -105,7 +105,13 @@ pkglib_MODULES = linux.mod multiboot.mod \ aout.mod play.mod serial.mod ata.mod \ memdisk.mod pci.mod lspci.mod reboot.mod \ halt.mod datetime.mod date.mod datehook.mod \ - lsmmap.mod + lsmmap.mod mmap.mod + +# For mmap.mod. +mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c +mmap_mod_CFLAGS = $(COMMON_CFLAGS) +mmap_mod_LDFLAGS = $(COMMON_LDFLAGS) +mmap_mod_ASFLAGS = $(COMMON_ASFLAGS) # For linux.mod. linux_mod_SOURCES = loader/i386/linux.c diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index fd8957944..4dab18c21 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -82,7 +82,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod mmap.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -115,6 +115,12 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) +# For mmap.mod. +mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \ + mmap/efi/mmap.c +mmap_mod_CFLAGS = $(COMMON_CFLAGS) +mmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For chain.mod. chain_mod_SOURCES = loader/efi/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 35d6ec675..804676b12 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -105,7 +105,13 @@ grub_install_SOURCES = util/ieee1275/grub-install.in pkglib_MODULES = halt.mod reboot.mod suspend.mod \ multiboot.mod aout.mod serial.mod linux.mod \ nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ - date.mod datehook.mod lsmmap.mod + date.mod datehook.mod lsmmap.mod mmap.mod + +# For mmap.mod. +mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c +mmap_mod_CFLAGS = $(COMMON_CFLAGS) +mmap_mod_LDFLAGS = $(COMMON_LDFLAGS) +mmap_mod_ASFLAGS = $(COMMON_ASFLAGS) # For multiboot.mod. multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index c4b53fc63..6b1f4853f 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -184,7 +184,15 @@ pkglib_MODULES = biosdisk.mod chain.mod \ ata.mod vga.mod memdisk.mod pci.mod lspci.mod \ aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ - usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod + usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \ + mmap.mod + +# For mmap.mod. +mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \ + mmap/i386/pc/mmap.c mmap/i386/pc/mmap_helper.S +mmap_mod_CFLAGS = $(COMMON_CFLAGS) +mmap_mod_LDFLAGS = $(COMMON_LDFLAGS) +mmap_mod_ASFLAGS = $(COMMON_ASFLAGS) # For biosdisk.mod. biosdisk_mod_SOURCES = disk/i386/pc/biosdisk.c diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 6cf9d7d79..38c27f32d 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -80,7 +80,7 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod + datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod mmap.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -114,6 +114,12 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) +# For mmap.mod. +mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \ + mmap/efi/mmap.c +mmap_mod_CFLAGS = $(COMMON_CFLAGS) +mmap_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For chain.mod. chain_mod_SOURCES = loader/efi/chainloader.c chain_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/include/grub/efi/memory.h b/include/grub/efi/memory.h new file mode 100644 index 000000000..e1ac47cef --- /dev/null +++ b/include/grub/efi/memory.h @@ -0,0 +1,48 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MEMORY_MACHINE_HEADER +#define GRUB_MEMORY_MACHINE_HEADER 1 + +#include +#include + +#define GRUB_MMAP_REGISTER_BY_FIRMWARE 1 + +#define GRUB_MACHINE_MEMORY_AVAILABLE 1 +#define GRUB_MACHINE_MEMORY_RESERVED 2 +#define GRUB_MACHINE_MEMORY_ACPI 3 +#define GRUB_MACHINE_MEMORY_NVS 4 +#define GRUB_MACHINE_MEMORY_CODE 5 +#define GRUB_MACHINE_MEMORY_MAX_TYPE 5 + /* This one is special: it's used internally but is never reported + by firmware. */ +#define GRUB_MACHINE_MEMORY_HOLE 6 + + +grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) +(int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); +grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, + int type, int handle); +grub_err_t grub_machine_mmap_unregister (int handle); + +grub_uint64_t grub_mmap_get_post64 (void); +grub_uint64_t grub_mmap_get_upper (void); +grub_uint64_t grub_mmap_get_lower (void); + +#endif /* ! GRUB_MEMORY_MACHINE_HEADER */ diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index f50f18e16..78fae7945 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -148,6 +148,8 @@ struct grub_openbsd_bios_mmap { grub_uint64_t addr; grub_uint64_t len; +#define OPENBSD_MMAP_AVAILABLE 1 +#define OPENBSD_MMAP_RESERVED 2 grub_uint32_t type; }; diff --git a/include/grub/i386/efi/memory.h b/include/grub/i386/efi/memory.h new file mode 100644 index 000000000..c9a61bb77 --- /dev/null +++ b/include/grub/i386/efi/memory.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index 08e92a9f2..c95eae0ce 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -25,6 +25,7 @@ #ifndef ASM_FILE #include #include +#include #endif /* The scratch buffer used in real mode code. */ @@ -79,12 +80,6 @@ #ifndef ASM_FILE -#ifndef GRUB_MACHINE_IEEE1275 -extern grub_size_t EXPORT_VAR(grub_lower_mem); -#endif - -extern grub_size_t EXPORT_VAR(grub_upper_mem); - struct grub_machine_mmap_entry { grub_uint32_t size; @@ -92,12 +87,45 @@ struct grub_machine_mmap_entry grub_uint64_t len; #define GRUB_MACHINE_MEMORY_AVAILABLE 1 #define GRUB_MACHINE_MEMORY_RESERVED 2 +#define GRUB_MACHINE_MEMORY_ACPI 3 +#define GRUB_MACHINE_MEMORY_NVS 4 +#define GRUB_MACHINE_MEMORY_MAX_TYPE 4 + /* This one is special: it's used internally but is never reported + by firmware. */ +#define GRUB_MACHINE_MEMORY_HOLE 5 + grub_uint32_t type; } __attribute__((packed)); grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); +grub_uint64_t grub_mmap_get_post64 (void); +grub_uint64_t grub_mmap_get_upper (void); +grub_uint64_t grub_mmap_get_lower (void); + +#define GRUB_MMAP_MALLOC_LOW 1 + +#ifdef GRUB_MACHINE_PCBIOS +grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, + int type, int handle); +grub_err_t grub_machine_mmap_unregister (int handle); +#else +static inline grub_err_t +grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + int type __attribute__ ((unused)), + int handle __attribute__ ((unused))) +{ + return GRUB_ERR_NONE; +} +static inline grub_err_t +grub_machine_mmap_unregister (int handle __attribute__ ((unused))) +{ + return GRUB_ERR_NONE; +} +#endif + #endif #endif /* ! GRUB_MEMORY_MACHINE_HEADER */ diff --git a/include/grub/memory.h b/include/grub/memory.h new file mode 100644 index 000000000..df64207b7 --- /dev/null +++ b/include/grub/memory.h @@ -0,0 +1,52 @@ +/* memory.h - describe the memory map */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MEMORY_HEADER +#define GRUB_MEMORY_HEADER 1 + +#include +#include +#include + +grub_err_t grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, + grub_uint32_t)); +int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type); +grub_err_t grub_mmap_unregister (int handle); + +char *grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, + int *handle, int type, int flags); + +void grub_mmap_free_and_unregister (int handle); + +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE + +struct grub_mmap_region +{ + struct grub_mmap_region *next; + grub_uint64_t start; + grub_uint64_t end; + int type; + int handle; +}; + +extern struct grub_mmap_region *grub_mmap_overlays; +#endif + +#endif /* ! GRUB_MEMORY_HEADER */ diff --git a/include/grub/types.h b/include/grub/types.h index 50f8f58d5..114b4564a 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -102,6 +102,16 @@ typedef grub_int32_t grub_ssize_t; # define GRUB_LONG_MIN -2147483648UL #endif +#if GRUB_CPU_SIZEOF_VOID_P == 4 +#define UINT_TO_PTR(x) ((void*)(grub_uint32_t)(x)) +#define PTR_TO_UINT64(x) ((grub_uint64_t)(grub_uint32_t)(x)) +#define PTR_TO_UINT32(x) ((grub_uint32_t)(x)) +#else +#define UINT_TO_PTR(x) ((void*)(grub_uint64_t)(x)) +#define PTR_TO_UINT64(x) ((grub_uint64_t)(x)) +#define PTR_TO_UINT32(x) ((grub_uint32_t)(grub_uint64_t)(x)) +#endif + /* The type for representing a file offset. */ typedef grub_uint64_t grub_off_t; diff --git a/include/grub/x86_64/efi/memory.h b/include/grub/x86_64/efi/memory.h new file mode 100644 index 000000000..c9a61bb77 --- /dev/null +++ b/include/grub/x86_64/efi/memory.h @@ -0,0 +1 @@ +#include diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index fdaf6fd84..c12af2c22 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -82,16 +82,11 @@ grub_machine_init (void) #if GRUB_CPU_SIZEOF_VOID_P == 4 /* Restrict ourselves to 32-bit memory space. */ if (addr > GRUB_ULONG_MAX) - { - grub_upper_mem = GRUB_ULONG_MAX; - return 0; - } + return 0; if (addr + size > GRUB_ULONG_MAX) size = GRUB_ULONG_MAX - addr; #endif - grub_upper_mem = grub_max (grub_upper_mem, addr + size); - if (type != GRUB_MACHINE_MEMORY_AVAILABLE) return 0; @@ -128,9 +123,6 @@ grub_machine_init (void) grub_machine_mmap_init (); grub_machine_mmap_iterate (heap_init); - /* This variable indicates size, not offset. */ - grub_upper_mem -= GRUB_MEMORY_MACHINE_UPPER_START; - grub_tsc_init (); } diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index 61914123f..c64497ed6 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -45,7 +45,6 @@ static int num_regions; grub_addr_t grub_os_area_addr; grub_size_t grub_os_area_size; -grub_size_t grub_lower_mem, grub_upper_mem; void grub_arch_sync_caches (void *address __attribute__ ((unused)), @@ -133,6 +132,7 @@ void grub_machine_init (void) { int i; + int grub_lower_mem; /* Initialize the console as early as possible. */ grub_console_init (); @@ -197,7 +197,6 @@ grub_machine_init (void) { grub_size_t quarter = mem_regions[i].size >> 2; - grub_upper_mem = mem_regions[i].size; grub_os_area_addr = mem_regions[i].addr; grub_os_area_size = mem_regions[i].size - quarter; grub_mm_init_region ((void *) (grub_os_area_addr + grub_os_area_size), diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 355cb3f7f..ea51aa220 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -313,30 +313,36 @@ static grub_err_t grub_openbsd_boot (void) { char *buf = (char *) GRUB_BSD_TEMP_BUFFER; - struct grub_machine_mmap_entry mmap; struct grub_openbsd_bios_mmap *pm; struct grub_openbsd_bootargs *pa; - grub_uint32_t bootdev, biosdev, unit, slice, part, cont; + grub_uint32_t bootdev, biosdev, unit, slice, part; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) + { + pm->addr = addr; + pm->len = size; + + switch (type) + { + case GRUB_MACHINE_MEMORY_AVAILABLE: + pm->type = OPENBSD_MMAP_AVAILABLE; + break; + + default: + pm->type = OPENBSD_MMAP_RESERVED; + break; + } + pm++; + + return 0; + } pa = (struct grub_openbsd_bootargs *) buf; pa->ba_type = OPENBSD_BOOTARG_MMAP; pm = (struct grub_openbsd_bios_mmap *) (pa + 1); - cont = grub_get_mmap_entry (&mmap, 0); - if (mmap.size) - do - { - pm->addr = mmap.addr; - pm->len = mmap.len; - pm->type = mmap.type; - pm++; - - if (!cont) - break; - - cont = grub_get_mmap_entry (&mmap, cont); - } - while (mmap.size); + grub_mmap_iterate (hook); pa->ba_size = (char *) pm - (char *) pa; pa->ba_next = (struct grub_openbsd_bootargs *) pm; @@ -349,7 +355,8 @@ grub_openbsd_boot (void) (part << OPENBSD_B_PARTSHIFT)); grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER, - 0, grub_upper_mem >> 10, grub_lower_mem >> 10, + 0, grub_mmap_get_upper () >> 10, + grub_mmap_get_lower () >> 10, (char *) pa - buf, buf); /* Not reached. */ @@ -377,7 +384,8 @@ grub_netbsd_boot (void) bootinfo->bi_data[0] = rootdev; grub_unix_real_boot (entry, bootflags, 0, bootinfo, - 0, grub_upper_mem >> 10, grub_lower_mem >> 10); + 0, grub_mmap_get_upper () >> 10, + grub_mmap_get_lower () >> 10); /* Not reached. */ return GRUB_ERR_NONE; diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 100b268be..9be88aa79 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -32,6 +32,7 @@ #include #include #include +#include #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 @@ -300,7 +301,6 @@ grub_linux_boot (void) grub_efi_uintn_t map_key; grub_efi_uintn_t desc_size; grub_efi_uint32_t desc_version; - grub_efi_memory_descriptor_t *desc; int e820_num; params = real_mode_mem; @@ -313,84 +313,53 @@ grub_linux_boot (void) (unsigned) idt_desc.limit, (unsigned long) idt_desc.base, (unsigned) gdt_desc.limit, (unsigned long) gdt_desc.base); + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) + { + switch (type) + { + case GRUB_MACHINE_MEMORY_AVAILABLE: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_RAM); + break; + +#ifdef GRUB_MACHINE_MEMORY_ACPI + case GRUB_MACHINE_MEMORY_ACPI: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_ACPI); + break; +#endif + +#ifdef GRUB_MACHINE_MEMORY_NVS + case GRUB_MACHINE_MEMORY_NVS: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_NVS); + break; +#endif + +#ifdef GRUB_MACHINE_MEMORY_CODE + case GRUB_MACHINE_MEMORY_CODE: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_EXEC_CODE); + break; +#endif + + default: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_RESERVED); + } + return 0; + } + + e820_num = 0; + grub_mmap_iterate (hook); + params->mmap_size = e820_num; + mmap_size = find_mmap_size (); if (grub_efi_get_memory_map (&mmap_size, mmap_buf, &map_key, &desc_size, &desc_version) <= 0) grub_fatal ("cannot get memory map"); - e820_num = 0; - for (desc = mmap_buf; - desc < NEXT_MEMORY_DESCRIPTOR (mmap_buf, mmap_size); - desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) - { - switch (desc->type) - { - case GRUB_EFI_ACPI_RECLAIM_MEMORY: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_ACPI); - break; - - case GRUB_EFI_ACPI_MEMORY_NVS: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_NVS); - break; - - case GRUB_EFI_RUNTIME_SERVICES_CODE: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_EXEC_CODE); - break; - - case GRUB_EFI_LOADER_CODE: - case GRUB_EFI_LOADER_DATA: - case GRUB_EFI_BOOT_SERVICES_CODE: - case GRUB_EFI_BOOT_SERVICES_DATA: - case GRUB_EFI_CONVENTIONAL_MEMORY: - { - grub_uint64_t start, size, end; - - start = desc->physical_start; - size = desc->num_pages << 12; - end = start + size; - - /* Skip A0000 - 100000 region. */ - if ((start < 0x100000ULL) && (end > 0xA0000ULL)) - { - if (start < 0xA0000ULL) - { - grub_e820_add_region (params->e820_map, &e820_num, - start, - 0xA0000ULL - start, - GRUB_E820_RAM); - } - - if (end <= 0x100000ULL) - continue; - - start = 0x100000ULL; - size = end - start; - } - - grub_e820_add_region (params->e820_map, &e820_num, - start, size, GRUB_E820_RAM); - break; - } - - default: - grub_e820_add_region (params->e820_map, &e820_num, - desc->physical_start, - desc->num_pages << 12, - GRUB_E820_RESERVED); - } - } - - params->mmap_size = e820_num; - if (! grub_efi_exit_boot_services (map_key)) grub_fatal ("cannot exit boot services"); diff --git a/loader/i386/ieee1275/linux.c b/loader/i386/ieee1275/linux.c index 2f5288099..a5635771f 100644 --- a/loader/i386/ieee1275/linux.c +++ b/loader/i386/ieee1275/linux.c @@ -100,7 +100,7 @@ grub_linux_boot (void) grub_memset ((char *) params, 0, GRUB_OFW_LINUX_CL_OFFSET); - params->alt_mem = grub_upper_mem >> 10; + params->alt_mem = grub_mmap_get_upper () >> 10; params->ext_mem = params->alt_mem; lh->cmd_line_ptr = (char *) diff --git a/loader/i386/linux.c b/loader/i386/linux.c index c71d9260b..02bade58c 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -169,7 +169,7 @@ find_mmap_size (void) return 0; } - grub_machine_mmap_iterate (hook); + grub_mmap_iterate (hook); mmap_size = count * sizeof (struct grub_e820_mmap); @@ -238,7 +238,7 @@ allocate_pages (grub_size_t prot_size) return 0; } - grub_machine_mmap_iterate (hook); + grub_mmap_iterate (hook); if (! real_mode_mem) { grub_error (GRUB_ERR_OUT_OF_MEMORY, "cannot allocate real mode pages"); @@ -397,6 +397,27 @@ grub_linux_boot (void) addr, size, GRUB_E820_RAM); break; +#ifdef GRUB_MACHINE_MEMORY_ACPI + case GRUB_MACHINE_MEMORY_ACPI: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_ACPI); + break; +#endif + +#ifdef GRUB_MACHINE_MEMORY_NVS + case GRUB_MACHINE_MEMORY_NVS: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_NVS); + break; +#endif + +#ifdef GRUB_MACHINE_MEMORY_CODE + case GRUB_MACHINE_MEMORY_CODE: + grub_e820_add_region (params->e820_map, &e820_num, + addr, size, GRUB_E820_EXEC_CODE); + break; +#endif + default: grub_e820_add_region (params->e820_map, &e820_num, addr, size, GRUB_E820_RESERVED); @@ -405,9 +426,10 @@ grub_linux_boot (void) } e820_num = 0; - grub_machine_mmap_iterate (hook); + grub_mmap_iterate (hook); params->mmap_size = e820_num; + /* Hardware interrupts are not safe any longer. */ asm volatile ("cli" : : ); diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 2f7e1e403..73dee4397 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -99,7 +99,7 @@ grub_get_multiboot_mmap_len (void) return 0; } - grub_machine_mmap_iterate (hook); + grub_mmap_iterate (hook); return count * sizeof (struct grub_multiboot_mmap_entry); } @@ -122,7 +122,7 @@ grub_fill_multiboot_mmap (struct grub_multiboot_mmap_entry *first_entry) return 0; } - grub_machine_mmap_iterate (hook); + grub_mmap_iterate (hook); } #define MULTIBOOT_LOAD_ELF64 @@ -341,8 +341,8 @@ grub_multiboot (int argc, char *argv[]) grub_multiboot_payload_entry_offset); /* Convert from bytes to kilobytes. */ - mbi->mem_lower = grub_lower_mem / 1024; - mbi->mem_upper = grub_upper_mem / 1024; + mbi->mem_lower = grub_mmap_get_lower () / 1024; + mbi->mem_upper = grub_mmap_get_upper () / 1024; mbi->flags |= MULTIBOOT_INFO_MEMORY; cmdline = p = cmdline_addr (grub_multiboot_payload_orig); diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index 8ff97f433..34a4ebcfa 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -108,8 +108,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), lh.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; /* Put the real mode part at as a high location as possible. */ - grub_linux_real_addr = (char *) (grub_lower_mem - - GRUB_LINUX_SETUP_MOVE_SIZE); + grub_linux_real_addr + = (char *) UINT_TO_PTR (grub_mmap_get_lower () + - GRUB_LINUX_SETUP_MOVE_SIZE); /* But it must not exceed the traditional area. */ if (grub_linux_real_addr > (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR) grub_linux_real_addr = (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR; @@ -159,12 +160,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } if (grub_linux_real_addr + GRUB_LINUX_SETUP_MOVE_SIZE - > (char *) grub_lower_mem) + > (char *) UINT_TO_PTR (grub_mmap_get_lower ())) { grub_error (GRUB_ERR_OUT_OF_RANGE, "too small lower memory (0x%x > 0x%x)", - grub_linux_real_addr + GRUB_LINUX_SETUP_MOVE_SIZE, - (char *) grub_lower_mem); + grub_linux_real_addr + GRUB_LINUX_SETUP_MOVE_SIZE, + (int) grub_mmap_get_lower ()); goto fail; } diff --git a/mmap/efi/mmap.c b/mmap/efi/mmap.c new file mode 100644 index 000000000..3b1a0bda8 --- /dev/null +++ b/mmap/efi/mmap.c @@ -0,0 +1,284 @@ +/* Mmap management. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#define NEXT_MEMORY_DESCRIPTOR(desc, size) \ + ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) + +grub_err_t +grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, + grub_uint32_t)) +{ + grub_efi_uintn_t mmap_size = 0; + grub_efi_memory_descriptor_t *map_buf = 0; + grub_efi_uintn_t map_key = 0; + grub_efi_uintn_t desc_size = 0; + grub_efi_uint32_t desc_version = 0; + grub_efi_memory_descriptor_t *desc; + + if (grub_efi_get_memory_map (&mmap_size, map_buf, + &map_key, &desc_size, + &desc_version) < 0) + return grub_errno; + + map_buf = grub_malloc (mmap_size); + if (! map_buf) + return grub_errno; + + if (grub_efi_get_memory_map (&mmap_size, map_buf, + &map_key, &desc_size, + &desc_version) <= 0) + { + grub_free (map_buf); + return grub_errno; + } + + for (desc = map_buf; + desc < NEXT_MEMORY_DESCRIPTOR (map_buf, mmap_size); + desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) + { + grub_dprintf ("mmap", "EFI memory region 0x%llx-0x%llx: %d\n", + (unsigned long long) desc->physical_start, + (unsigned long long) desc->physical_start + + desc->num_pages * 4096, desc->type); + switch (desc->type) + { + case GRUB_EFI_RUNTIME_SERVICES_CODE: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MACHINE_MEMORY_CODE); + break; + + default: + grub_printf ("Unknown memory type %d, considering reserved\n", + desc->type); + + case GRUB_EFI_RESERVED_MEMORY_TYPE: + case GRUB_EFI_RUNTIME_SERVICES_DATA: + case GRUB_EFI_UNUSABLE_MEMORY: + case GRUB_EFI_MEMORY_MAPPED_IO: + case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: + case GRUB_EFI_PAL_CODE: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MACHINE_MEMORY_RESERVED); + break; + + case GRUB_EFI_LOADER_CODE: + case GRUB_EFI_LOADER_DATA: + case GRUB_EFI_BOOT_SERVICES_CODE: + case GRUB_EFI_BOOT_SERVICES_DATA: + case GRUB_EFI_CONVENTIONAL_MEMORY: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MACHINE_MEMORY_AVAILABLE); + break; + + case GRUB_EFI_ACPI_RECLAIM_MEMORY: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MACHINE_MEMORY_ACPI); + break; + + case GRUB_EFI_ACPI_MEMORY_NVS: + hook (desc->physical_start, desc->num_pages * 4096, + GRUB_MACHINE_MEMORY_NVS); + break; + } + } + + return GRUB_ERR_NONE; +} + +static inline grub_efi_memory_type_t +make_efi_memtype (int type) +{ + switch (type) + { + case GRUB_MACHINE_MEMORY_CODE: + return GRUB_EFI_RUNTIME_SERVICES_CODE; + + /* No way to remove a chunk of memory from EFI mmap. + So mark it as unusable. */ + case GRUB_MACHINE_MEMORY_HOLE: + + default: + + case GRUB_MACHINE_MEMORY_RESERVED: + return GRUB_EFI_UNUSABLE_MEMORY; + + case GRUB_MACHINE_MEMORY_AVAILABLE: + return GRUB_EFI_CONVENTIONAL_MEMORY; + + case GRUB_MACHINE_MEMORY_ACPI: + return GRUB_EFI_ACPI_RECLAIM_MEMORY; + + case GRUB_MACHINE_MEMORY_NVS: + return GRUB_EFI_ACPI_RECLAIM_MEMORY; + + } + +} + +struct overlay +{ + struct overlay *next; + grub_efi_physical_address_t address; + grub_efi_uintn_t pages; + int handle; +}; + +static struct overlay *overlays = 0; +static int curhandle = 1; + +int +grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) +{ + grub_uint64_t end = start + size; + grub_efi_physical_address_t address; + grub_efi_boot_services_t *b; + grub_efi_uintn_t pages; + grub_efi_status_t status; + struct overlay *curover; + + curover = (struct overlay *) grub_malloc (sizeof (struct overlay)); + if (! curover) + return 0; + + b = grub_efi_system_table->boot_services; + address = start & (~0x3ffULL); + pages = (end - address + 0x3ff) >> 12; + status = efi_call_2 (b->free_pages, address, pages); + if (status != GRUB_EFI_SUCCESS && status != GRUB_EFI_NOT_FOUND) + { + grub_free (curover); + return 0; + } + status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS, + make_efi_memtype (type), pages, &address); + if (status != GRUB_EFI_SUCCESS) + { + grub_free (curover); + return 0; + } + curover->next = overlays; + curover->handle = curhandle++; + curover->address = address; + curover->pages = pages; + overlays = curover; + + return curover->handle; +} + +grub_err_t +grub_machine_mmap_unregister (int handle) +{ + struct overlay *curover, *prevover; + grub_efi_boot_services_t *b; + grub_efi_status_t status; + + b = grub_efi_system_table->boot_services; + + + for (curover = overlays, prevover = 0; curover; + prevover = curover, curover = curover->next) + { + if (curover->handle == handle) + { + status = efi_call_2 (b->free_pages, curover->address, curover->pages); + if (prevover != 0) + prevover->next = curover->next; + else + overlays = curover->next; + grub_free (curover); + return GRUB_ERR_NONE; + } + } + return grub_error (GRUB_ERR_BAD_ARGUMENT, "handle %d not found", handle); +} + +/* Result is always page-aligned. */ +char * +grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), + grub_uint64_t size, + int *handle, int type, + int flags __attribute__ ((unused))) +{ + grub_efi_physical_address_t address; + grub_efi_boot_services_t *b; + grub_efi_uintn_t pages; + grub_efi_status_t status; + struct overlay *curover; + grub_efi_allocate_type_t atype; + + curover = (struct overlay *) grub_malloc (sizeof (struct overlay)); + if (! curover) + return 0; + + b = grub_efi_system_table->boot_services; + + address = 0xffffffff; + +#if GRUB_TARGET_SIZEOF_VOID_P < 8 + /* Limit the memory access to less than 4GB for 32-bit platforms. */ + atype = GRUB_EFI_ALLOCATE_MAX_ADDRESS; +#else + atype = GRUB_EFI_ALLOCATE_ANY_PAGES; +#endif + + pages = (size + 0x3ff) >> 12; + status = efi_call_4 (b->allocate_pages, atype, + make_efi_memtype (type), pages, &address); + if (status != GRUB_EFI_SUCCESS) + { + grub_free (curover); + return 0; + } + + if (address == 0) + { + /* Uggh, the address 0 was allocated... This is too annoying, + so reallocate another one. */ + address = 0xffffffff; + status = efi_call_4 (b->allocate_pages, atype, + make_efi_memtype (type), pages, &address); + grub_efi_free_pages (0, pages); + if (status != GRUB_EFI_SUCCESS) + return 0; + } + + curover->next = overlays; + curover->handle = curhandle++; + curover->address = address; + curover->pages = pages; + overlays = curover; + *handle = curover->handle; + + return UINT_TO_PTR (curover->address); +} + +void +grub_mmap_free_and_unregister (int handle) +{ + grub_machine_mmap_unregister (handle); +} diff --git a/mmap/i386/mmap.c b/mmap/i386/mmap.c new file mode 100644 index 000000000..ed0c6e4ea --- /dev/null +++ b/mmap/i386/mmap.c @@ -0,0 +1,98 @@ +/* Mmap management. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + + +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE + +char * +grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, + int *handle, int type, int flags) +{ + grub_uint64_t highestlow = 0; + + auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, + grub_uint32_t); + int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t rangesize, + grub_uint32_t memtype) + { + grub_uint64_t end = start + rangesize; + if (memtype != GRUB_MACHINE_MEMORY_AVAILABLE) + return 0; + if (end > 0x100000) + end = 0x100000; + if (end > start + size + && highestlow < ((end - size) - ((end - size) & (align - 1)))) + highestlow = (end - size) - ((end - size) & (align - 1)); + return 0; + } + + char * ret; + if (flags & GRUB_MMAP_MALLOC_LOW) + { + /* FIXME: use low-memory mm allocation once it's available. */ + grub_mmap_iterate (find_hook); + ret = UINT_TO_PTR (highestlow); + } + else + ret = grub_memalign (align, size); + + if (! ret) + { + *handle = 0; + return 0; + } + + *handle = grub_mmap_register (PTR_TO_UINT64 (ret), size, type); + if (! *handle) + { + grub_free (ret); + return 0; + } + + return ret; +} + +void +grub_mmap_free_and_unregister (int handle) +{ + struct grub_mmap_region *cur; + grub_uint64_t addr; + + for (cur = grub_mmap_overlays; cur; cur = cur->next) + if (cur->handle == handle) + break; + + if (! cur) + return; + + addr = cur->start; + + grub_mmap_unregister (handle); + + if (addr >= 0x100000) + grub_free (UINT_TO_PTR (addr)); +} + +#endif diff --git a/mmap/i386/pc/mmap.c b/mmap/i386/pc/mmap.c new file mode 100644 index 000000000..ec517275e --- /dev/null +++ b/mmap/i386/pc/mmap.c @@ -0,0 +1,216 @@ +/* Mmap management. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +#define min(a,b) (((a) < (b)) ? (a) : (b)) + +static void *hooktarget = 0; + +extern grub_uint8_t grub_machine_mmaphook_start; +extern grub_uint8_t grub_machine_mmaphook_end; +extern grub_uint8_t grub_machine_mmaphook_int12; +extern grub_uint8_t grub_machine_mmaphook_int15; + +static grub_uint16_t grub_machine_mmaphook_int12offset = 0; +static grub_uint16_t grub_machine_mmaphook_int12segment = 0; +extern grub_uint16_t grub_machine_mmaphook_int15offset; +extern grub_uint16_t grub_machine_mmaphook_int15segment; + +extern grub_uint16_t grub_machine_mmaphook_mmap_num; +extern grub_uint16_t grub_machine_mmaphook_kblow; +extern grub_uint16_t grub_machine_mmaphook_kbin16mb; +extern grub_uint16_t grub_machine_mmaphook_64kbin4gb; + +struct grub_e820_mmap_entry +{ + grub_uint64_t addr; + grub_uint64_t len; + grub_uint32_t type; +} __attribute__((packed)); + + +static grub_err_t +preboot (int noreturn __attribute__ ((unused))) +{ + struct grub_e820_mmap_entry *hookmmap, *hookmmapcur; + auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, + grub_uint32_t); + int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, grub_uint64_t size, + grub_uint32_t type) + { + grub_dprintf ("mmap", "mmap chunk %llx-%llx:%x\n", addr, addr + size, type); + hookmmapcur->addr = addr; + hookmmapcur->len = size; + hookmmapcur->type = type; + hookmmapcur++; + return 0; + } + + if (! hooktarget) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "no space is allocated for memory hook"); + + grub_dprintf ("mmap", "installing preboot handlers\n"); + + hookmmapcur = hookmmap = (struct grub_e820_mmap_entry *) + ((grub_uint8_t *) hooktarget + (&grub_machine_mmaphook_end + - &grub_machine_mmaphook_start)); + + grub_mmap_iterate (fill_hook); + grub_machine_mmaphook_mmap_num = hookmmapcur - hookmmap; + + grub_machine_mmaphook_kblow = grub_mmap_get_lower () >> 10; + grub_machine_mmaphook_kbin16mb + = min (grub_mmap_get_upper (),0x3f00000ULL) >> 10; + grub_machine_mmaphook_64kbin4gb + = min (grub_mmap_get_post64 (), 0xfc000000ULL) >> 16; + + /* Correct BDA. */ + *((grub_uint16_t *) 0x413) = grub_mmap_get_lower () >> 10; + + /* Save old interrupt handlers. */ + grub_machine_mmaphook_int12offset = *((grub_uint16_t *) 0x48); + grub_machine_mmaphook_int12segment = *((grub_uint16_t *) 0x4a); + grub_machine_mmaphook_int15offset = *((grub_uint16_t *) 0x54); + grub_machine_mmaphook_int15segment = *((grub_uint16_t *) 0x56); + + grub_dprintf ("mmap", "hooktarget = %p\n", hooktarget); + + /* Install the interrupt handlers. */ + grub_memcpy (hooktarget, &grub_machine_mmaphook_start, + &grub_machine_mmaphook_end - &grub_machine_mmaphook_start); + + *((grub_uint16_t *) 0x4a) = PTR_TO_UINT32 (hooktarget) >> 4; + *((grub_uint16_t *) 0x56) = PTR_TO_UINT32 (hooktarget) >> 4; + *((grub_uint16_t *) 0x48) = &grub_machine_mmaphook_int12 + - &grub_machine_mmaphook_start; + *((grub_uint16_t *) 0x54) = &grub_machine_mmaphook_int15 + - &grub_machine_mmaphook_start; + + return GRUB_ERR_NONE; +} + +static grub_err_t +preboot_rest (void) +{ + /* Restore old interrupt handlers. */ + *((grub_uint16_t *) 0x48) = grub_machine_mmaphook_int12offset; + *((grub_uint16_t *) 0x4a) = grub_machine_mmaphook_int12segment; + *((grub_uint16_t *) 0x54) = grub_machine_mmaphook_int15offset; + *((grub_uint16_t *) 0x56) = grub_machine_mmaphook_int15segment; + + return GRUB_ERR_NONE; +} + +static grub_err_t +malloc_hook (void) +{ + static int reentry = 0; + static int mmapregion = 0; + static int slots_available = 0; + int hooksize; + int regcount = 0; + auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, + grub_uint32_t); + int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + grub_uint32_t type __attribute__ ((unused))) + { + regcount++; + return 0; + } + + if (reentry) + return GRUB_ERR_NONE; + + grub_dprintf ("mmap", "registering\n"); + + grub_mmap_iterate (count_hook); + + /* Mapping hook itself may introduce up to 2 additional regions. */ + regcount += 2; + + if (regcount <= slots_available) + return GRUB_ERR_NONE; + + if (mmapregion) + { + grub_mmap_free_and_unregister (mmapregion); + mmapregion = 0; + hooktarget = 0; + } + + hooksize = &grub_machine_mmaphook_end - &grub_machine_mmaphook_start + + regcount * sizeof (struct grub_e820_mmap_entry); + /* Allocate an integer number of KiB. */ + hooksize = ((hooksize - 1) | 0x3ff) + 1; + slots_available = (hooksize - (&grub_machine_mmaphook_end + - &grub_machine_mmaphook_start)) + / sizeof (struct grub_e820_mmap_entry); + + reentry = 1; + hooktarget + = grub_mmap_malign_and_register (16, hooksize, &mmapregion, + GRUB_MACHINE_MEMORY_RESERVED, + GRUB_MMAP_MALLOC_LOW); + reentry = 0; + + if (! hooktarget) + { + slots_available = 0; + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "No space for mmap hook"); + } + return GRUB_ERR_NONE; +} + +grub_err_t +grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + int type __attribute__ ((unused)), + int handle __attribute__ ((unused))) +{ + grub_err_t err; + static void *preb_handle = 0; + + err = malloc_hook (); + if (err) + return err; + + if (! preb_handle) + { + grub_dprintf ("mmap", "adding preboot\n"); + preb_handle + = grub_loader_register_preboot_hook (preboot, preboot_rest, + GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY); + if (! preb_handle) + return grub_errno; + } + return GRUB_ERR_NONE; +} + +grub_err_t +grub_machine_mmap_unregister (int handle __attribute__ ((unused))) +{ + return GRUB_ERR_NONE; +} diff --git a/mmap/i386/pc/mmap_helper.S b/mmap/i386/pc/mmap_helper.S new file mode 100644 index 000000000..ab7c0d22f --- /dev/null +++ b/mmap/i386/pc/mmap_helper.S @@ -0,0 +1,122 @@ +/* Mmap management. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +#define DS(x) ((x) - segstart) + +segstart: +VARIABLE(grub_machine_mmaphook_start) + .code16 +VARIABLE(grub_machine_mmaphook_int12) + push %ds + push %cs + pop %ds + movw DS (EXT_C (grub_machine_mmaphook_kblow)), %ax + pop %ds + iret + +VARIABLE(grub_machine_mmaphook_int15) + pushf + cmpw $0xe801, %ax + jz e801 + cmpw $0xe820, %ax + jz e820 + cmpb $0x88, %ah + jz h88 + popf + /* ljmp */ + .byte 0xea +VARIABLE (grub_machine_mmaphook_int15offset) + .word 0 +VARIABLE (grub_machine_mmaphook_int15segment) + .word 0 + +e801: + popf + push %ds + push %cs + pop %ds + movw DS (EXT_C (grub_machine_mmaphook_kbin16mb)), %ax + movw DS (EXT_C (grub_machine_mmaphook_64kbin4gb)), %bx + movw %ax, %cx + movw %bx, %dx + pop %ds + clc + iret + +h88: + popf + push %ds + push %cs + pop %ds + movw DS (EXT_C (grub_machine_mmaphook_kbin16mb)), %ax + pop %ds + clc + iret + +e820: + popf + push %ds + push %cs + pop %ds + cmpw $20, %cx + jb errexit + cmpw DS (EXT_C (grub_machine_mmaphook_mmap_num)), %bx + jae errexit + cmp $0x534d4150, %edx + jne errexit + push %si + push %di + movw $20, %cx + movw $(DS(mmaphook_mmap)), %si + mov %bx, %ax + imul $20, %ax + add %ax, %si + rep movsb + pop %di + pop %si + movl $20, %ecx + inc %bx + cmpw DS(EXT_C(grub_machine_mmaphook_mmap_num)), %bx + jb noclean + xor %bx, %bx +noclean: + mov $0x534d4150, %eax + pop %ds + clc + iret +errexit: + mov $0x534d4150, %eax + pop %ds + stc + xor %bx, %bx + iret + +VARIABLE(grub_machine_mmaphook_mmap_num) + .word 0 +VARIABLE(grub_machine_mmaphook_kblow) + .word 0 +VARIABLE (grub_machine_mmaphook_kbin16mb) + .word 0 +VARIABLE (grub_machine_mmaphook_64kbin4gb) + .word 0 +mmaphook_mmap: + /* Memory map is placed just after the interrupt handlers. */ +VARIABLE(grub_machine_mmaphook_end) diff --git a/mmap/i386/uppermem.c b/mmap/i386/uppermem.c new file mode 100644 index 000000000..80576cad9 --- /dev/null +++ b/mmap/i386/uppermem.c @@ -0,0 +1,85 @@ +/* Compute amount of lower and upper memory till the first hole. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +grub_uint64_t +grub_mmap_get_lower (void) +{ + grub_uint64_t lower = 0; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, + grub_uint32_t type) + { + if (type != GRUB_MACHINE_MEMORY_AVAILABLE) + return 0; + if (addr == 0) + lower = size; + return 0; + } + + grub_mmap_iterate (hook); + if (lower > 0x100000) + lower = 0x100000; + return lower; +} + +grub_uint64_t +grub_mmap_get_upper (void) +{ + grub_uint64_t upper = 0; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, + grub_uint32_t type) + { + if (type != GRUB_MACHINE_MEMORY_AVAILABLE) + return 0; + if (addr <= 0x100000 && addr + size > 0x100000) + upper = addr + size - 0x100000; + return 0; + } + + grub_mmap_iterate (hook); + return upper; +} + +/* Count the continous bytes after 64 MiB. */ +grub_uint64_t +grub_mmap_get_post64 (void) +{ + grub_uint64_t post64 = 0; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, + grub_uint32_t type) + { + if (type != GRUB_MACHINE_MEMORY_AVAILABLE) + return 0; + if (addr <= 0x4000000 && addr + size > 0x4000000) + post64 = addr + size - 0x4000000; + return 0; + } + + grub_mmap_iterate (hook); + return post64; +} diff --git a/mmap/mmap.c b/mmap/mmap.c new file mode 100644 index 000000000..1d82db7f0 --- /dev/null +++ b/mmap/mmap.c @@ -0,0 +1,426 @@ +/* Mmap management. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE + +struct grub_mmap_region *grub_mmap_overlays = 0; +static int curhandle = 1; + +#endif + +grub_err_t +grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, grub_uint32_t)) +{ + + /* This function resolves overlapping regions and sorts the memory map. + It uses scanline (sweeping) algorithm. + */ + /* If same page is used by multiple types it's resolved + according to priority: + 1 - free memory + 2 - memory usable by firmware-aware code + 3 - unusable memory + 4 - a range deliberately empty + */ + int priority[GRUB_MACHINE_MEMORY_MAX_TYPE + 2] = + { +#ifdef GRUB_MACHINE_MEMORY_AVAILABLE + [GRUB_MACHINE_MEMORY_AVAILABLE] = 1, +#endif +#ifdef GRUB_MACHINE_MEMORY_RESERVED + [GRUB_MACHINE_MEMORY_RESERVED] = 3, +#endif +#ifdef GRUB_MACHINE_MEMORY_ACPI + [GRUB_MACHINE_MEMORY_ACPI] = 2, +#endif +#ifdef GRUB_MACHINE_MEMORY_CODE + [GRUB_MACHINE_MEMORY_CODE] = 3, +#endif +#ifdef GRUB_MACHINE_MEMORY_NVS + [GRUB_MACHINE_MEMORY_NVS] = 3, +#endif + [GRUB_MACHINE_MEMORY_HOLE] = 4, + }; + + int i, k, done; + + /* Scanline events. */ + struct grub_mmap_scan + { + /* At which memory address. */ + grub_uint64_t pos; + /* 0 = region starts, 1 = region ends. */ + int type; + /* Which type of memory region? */ + int memtype; + }; + struct grub_mmap_scan *scanline_events; + struct grub_mmap_scan t; + + /* Previous scanline event. */ + grub_uint64_t lastaddr; + int lasttype; + /* Current scanline event. */ + int curtype; + /* How many regions of given type overlap at current location? */ + int present[GRUB_MACHINE_MEMORY_MAX_TYPE + 2]; + /* Number of mmap chunks. */ + int mmap_num; + +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE + struct grub_mmap_region *cur; +#endif + + auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, + grub_uint32_t); + int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + grub_uint32_t type __attribute__ ((unused))) + { + mmap_num++; + return 0; + } + + auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, + grub_uint32_t); + int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, + grub_uint64_t size, + grub_uint32_t type) + { + scanline_events[i].pos = addr; + scanline_events[i].type = 0; + if (type <= GRUB_MACHINE_MEMORY_MAX_TYPE && priority[type]) + scanline_events[i].memtype = type; + else + { + grub_dprintf ("mmap", "Unknown memory type %d. Assuming unusable\n", + type); + scanline_events[i].memtype = GRUB_MACHINE_MEMORY_RESERVED; + } + i++; + + scanline_events[i].pos = addr + size; + scanline_events[i].type = 1; + scanline_events[i].memtype = scanline_events[i - 1].memtype; + i++; + + return 0; + } + + mmap_num = 0; + +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE + for (cur = grub_mmap_overlays; cur; cur = cur->next) + mmap_num++; +#endif + + grub_machine_mmap_iterate (count_hook); + + /* Initialize variables. */ + grub_memset (present, 0, sizeof (present)); + scanline_events = (struct grub_mmap_scan *) + grub_malloc (sizeof (struct grub_mmap_scan) * 2 * mmap_num); + + if (! scanline_events) + { + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate space for new memory map"); + } + + i = 0; +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE + /* Register scanline events. */ + for (cur = grub_mmap_overlays; cur; cur = cur->next) + { + scanline_events[i].pos = cur->start; + scanline_events[i].type = 0; + if (cur->type == GRUB_MACHINE_MEMORY_HOLE + || (cur->type >= 0 && cur->type <= GRUB_MACHINE_MEMORY_MAX_TYPE + && priority[cur->type])) + scanline_events[i].memtype = cur->type; + else + scanline_events[i].memtype = GRUB_MACHINE_MEMORY_RESERVED; + i++; + + scanline_events[i].pos = cur->end; + scanline_events[i].type = 1; + scanline_events[i].memtype = scanline_events[i - 1].memtype; + i++; + } +#endif /* ! GRUB_MMAP_REGISTER_BY_FIRMWARE */ + + grub_machine_mmap_iterate (fill_hook); + + /* Primitive bubble sort. It has complexity O(n^2) but since we're + unlikely to have more than 100 chunks it's probably one of the + fastest for one purpose. */ + done = 1; + while (done) + { + done = 0; + for (i = 0; i < 2 * mmap_num - 1; i++) + if (scanline_events[i + 1].pos < scanline_events[i].pos + || (scanline_events[i + 1].pos == scanline_events[i].pos + && scanline_events[i + 1].type == 0 + && scanline_events[i].type == 1)) + { + t = scanline_events[i + 1]; + scanline_events[i + 1] = scanline_events[i]; + scanline_events[i] = t; + done = 1; + } + } + + lastaddr = scanline_events[0].pos; + lasttype = scanline_events[0].memtype; + for (i = 0; i < 2 * mmap_num; i++) + { + /* Process event. */ + if (scanline_events[i].type) + present[scanline_events[i].memtype]--; + else + present[scanline_events[i].memtype]++; + + /* Determine current region type. */ + curtype = -1; + for (k = 0; k <= GRUB_MACHINE_MEMORY_MAX_TYPE + 1; k++) + if (present[k] && (curtype == -1 || priority[k] > priority[curtype])) + curtype = k; + + /* Anounce region to the hook if necessary. */ + if ((curtype == -1 || curtype != lasttype) + && lastaddr != scanline_events[i].pos + && lasttype != -1 + && lasttype != GRUB_MACHINE_MEMORY_HOLE + && hook (lastaddr, scanline_events[i].pos - lastaddr, lasttype)) + { + grub_free (scanline_events); + return GRUB_ERR_NONE; + } + + /* Update last values if necessary. */ + if (curtype == -1 || curtype != lasttype) + { + lasttype = curtype; + lastaddr = scanline_events[i].pos; + } + } + + grub_free (scanline_events); + return GRUB_ERR_NONE; +} + +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +int +grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) +{ + struct grub_mmap_region *cur; + + grub_dprintf ("mmap", "registering\n"); + + cur = (struct grub_mmap_region *) + grub_malloc (sizeof (struct grub_mmap_region)); + if (! cur) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate memory map overlay"); + return 0; + } + + cur->next = grub_mmap_overlays; + cur->start = start; + cur->end = start + size; + cur->type = type; + cur->handle = curhandle++; + grub_mmap_overlays = cur; + + if (grub_machine_mmap_register (start, size, type, curhandle)) + { + grub_mmap_overlays = cur->next; + grub_free (cur); + return 0; + } + + return cur->handle; +} + +grub_err_t +grub_mmap_unregister (int handle) +{ + struct grub_mmap_region *cur, *prev; + + for (cur = grub_mmap_overlays, prev = 0; cur; prev= cur, cur = cur->next) + if (handle == cur->handle) + { + grub_err_t err; + if ((err = grub_machine_mmap_unregister (handle))) + return err; + + if (prev) + prev->next = cur->next; + else + grub_mmap_overlays = cur->next; + grub_free (cur); + return GRUB_ERR_NONE; + } + return grub_error (GRUB_ERR_BAD_ARGUMENT, "mmap overlay not found"); +} + +#endif /* ! GRUB_MMAP_REGISTER_BY_FIRMWARE */ + +#define CHUNK_SIZE 0x400 + +static inline grub_uint64_t +fill_mask (grub_uint64_t addr, grub_uint64_t mask, grub_uint64_t iterator) +{ + int i, j; + grub_uint64_t ret = (addr & mask); + + /* Find first fixed bit. */ + for (i = 0; i < 64; i++) + if ((mask & (1ULL << i)) != 0) + break; + j = 0; + for (; i < 64; i++) + if ((mask & (1ULL << i)) == 0) + { + if ((iterator & (1ULL << j)) != 0) + ret |= 1ULL << i; + j++; + } + return ret; +} + +static grub_err_t +grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), + int argc, char **args) +{ + char * str; + grub_uint64_t badaddr, badmask; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, + grub_uint64_t size, + grub_uint32_t type __attribute__ ((unused))) + { + grub_uint64_t iterator, low, high, cur; + int tail, var; + int i; + grub_dprintf ("badram", "hook %llx+%llx\n", (unsigned long long) addr, + (unsigned long long) size); + + /* How many trailing zeros? */ + for (tail = 0; ! (badmask & (1ULL << tail)); tail++); + + /* How many zeros in mask? */ + var = 0; + for (i = 0; i < 64; i++) + if (! (badmask & (1ULL << i))) + var++; + + if (fill_mask (badaddr, badmask, 0) >= addr) + iterator = 0; + else + { + low = 0; + high = ~0ULL; + /* Find starting value. Keep low and high such that + fill_mask (low) < addr and fill_mask (high) >= addr; + */ + while (high - low > 1) + { + cur = (low + high) / 2; + if (fill_mask (badaddr, badmask, cur) >= addr) + high = cur; + else + low = cur; + } + iterator = high; + } + + for (; iterator < (1ULL << (var - tail)) + && (cur = fill_mask (badaddr, badmask, iterator)) < addr + size; + iterator++) + { + grub_dprintf ("badram", "%llx (size %llx) is a badram range\n", + (long long) cur, (long long) (1ULL << tail) - 1); + grub_mmap_register (cur, (1ULL << tail) - 1, GRUB_MACHINE_MEMORY_HOLE); + } + return 0; + } + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "badram string required"); + + grub_dprintf ("badram", "executing badram\n"); + + str = args[0]; + + while (1) + { + /* Parse address and mask. */ + badaddr = grub_strtoull (str, &str, 16); + if (*str == ',') + str++; + badmask = grub_strtoull (str, &str, 16); + if (*str == ',') + str++; + + if (grub_errno == GRUB_ERR_BAD_NUMBER) + { + grub_errno = 0; + return GRUB_ERR_NONE; + } + + /* When part of a page is tainted, we discard the whole of it. There's + no point in providing sub-page chunks. */ + badmask &= ~(CHUNK_SIZE - 1); + + grub_dprintf ("badram", "badram %llx:%llx\n", + (unsigned long long) badaddr, (unsigned long long) badmask); + + grub_mmap_iterate (hook); + } +} + +static grub_command_t cmd; + + +GRUB_MOD_INIT(mmap) +{ + (void) mod; /* To stop warning. */ + cmd = grub_register_command ("badram", grub_cmd_badram, + "badram ADDR1,MASK1[,ADDR2,MASK2[,...]]", + "declare memory regions as badram"); +} + +GRUB_MOD_FINI(mmap) +{ + grub_unregister_command (cmd); +} + From 28a856658d7a495d62cecf28761f8c79a2b12893 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 2 May 2009 22:27:29 +0000 Subject: [PATCH 0697/1707] 2009-05-02 Vladimir Serbinenko Missing part from mmap patch * mmap/efi/mmap.c (grub_machine_mmap_unregister): renamed to (grub_mmap_unregister) (grub_mmap_free_and_unregister): use grub_mmap_register --- ChangeLog | 8 ++++++++ mmap/efi/mmap.c | 4 ++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c2f7dd2f0..b031120cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-05-02 Vladimir Serbinenko + + Missing part from mmap patch + + * mmap/efi/mmap.c (grub_machine_mmap_unregister): renamed to + (grub_mmap_unregister) + (grub_mmap_free_and_unregister): use grub_mmap_register + 2009-05-02 Vladimir Serbinenko Mmap services diff --git a/mmap/efi/mmap.c b/mmap/efi/mmap.c index 3b1a0bda8..0aa8e0920 100644 --- a/mmap/efi/mmap.c +++ b/mmap/efi/mmap.c @@ -191,7 +191,7 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) } grub_err_t -grub_machine_mmap_unregister (int handle) +grub_mmap_unregister (int handle) { struct overlay *curover, *prevover; grub_efi_boot_services_t *b; @@ -280,5 +280,5 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), void grub_mmap_free_and_unregister (int handle) { - grub_machine_mmap_unregister (handle); + grub_mmap_unregister (handle); } From f8efe3ad2d1dc2f875b4945506e006975242cf57 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 2 May 2009 22:31:29 +0000 Subject: [PATCH 0698/1707] 2009-05-02 Vladimir Serbinenko ACPI spoofing * commands/acpi.c: new file * commands/i386/pc/acpi.c: likewise * commands/efi/acpi.c: likewise * include/grub/acpi.h: likewise * conf/i386-pc.rmk (pkglib_MODULES): added acpi.mod (acpi_mod_SOURCES): new variable (acpi_mod_CFLAGS): likewise (acpi_mod_LDFLAGS): likewise * conf/i386-efi.rmk: likewise * conf/x86_64-efi.rmk: likewise --- ChangeLog | 15 + commands/acpi.c | 774 ++++++++++++++++++++++++++++++++++++++++ commands/efi/acpi.c | 59 +++ commands/i386/pc/acpi.c | 81 +++++ conf/i386-efi.rmk | 8 +- conf/i386-pc.rmk | 7 +- conf/x86_64-efi.rmk | 8 +- include/grub/acpi.h | 75 ++++ 8 files changed, 1024 insertions(+), 3 deletions(-) create mode 100644 commands/acpi.c create mode 100644 commands/efi/acpi.c create mode 100644 commands/i386/pc/acpi.c create mode 100644 include/grub/acpi.h diff --git a/ChangeLog b/ChangeLog index b031120cc..febe73b97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-05-02 Vladimir Serbinenko + + ACPI spoofing + + * commands/acpi.c: new file + * commands/i386/pc/acpi.c: likewise + * commands/efi/acpi.c: likewise + * include/grub/acpi.h: likewise + * conf/i386-pc.rmk (pkglib_MODULES): added acpi.mod + (acpi_mod_SOURCES): new variable + (acpi_mod_CFLAGS): likewise + (acpi_mod_LDFLAGS): likewise + * conf/i386-efi.rmk: likewise + * conf/x86_64-efi.rmk: likewise + 2009-05-02 Vladimir Serbinenko Missing part from mmap patch diff --git a/commands/acpi.c b/commands/acpi.c new file mode 100644 index 000000000..309228827 --- /dev/null +++ b/commands/acpi.c @@ -0,0 +1,774 @@ +/* acpi.c - modify acpi tables. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef GRUB_MACHINE_EFI +#include +#include +#endif + +static const struct grub_arg_option options[] = { + {"exclude", 'x', 0, + "Don't load host tables specified by comma-separated list", + 0, ARG_TYPE_STRING}, + {"load-only", 'n', 0, + "Load only tables specified by comma-separated list", 0, ARG_TYPE_STRING}, + {"v1", '1', 0, "Expose v1 tables", 0, ARG_TYPE_NONE}, + {"v2", '2', 0, "Expose v2 and v3 tables", 0, ARG_TYPE_NONE}, + {"oemid", 'o', 0, "Set OEMID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, + {"oemtable", 't', 0, + "Set OEMTABLE ID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, + {"oemtablerev", 'r', 0, + "Set OEMTABLE revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT}, + {"oemtablecreator", 'c', 0, + "Set creator field of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, + {"oemtablecreatorrev", 'd', 0, + "Set creator revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT}, + {"no-ebda", 'e', 0, "Don't update EBDA. May fix failures or hangs on some" + " BIOSes but makes it uneffective with OS not recieving RSDP fro GRUB", + 0, ARG_TYPE_NONE}, + {0, 0, 0, 0, 0, 0} +}; + +/* Simple checksum by summing all bytes. Used by ACPI and SMBIOS. */ +grub_uint8_t +grub_byte_checksum (void *base, grub_size_t size) +{ + grub_uint8_t *ptr; + grub_uint8_t ret = 0; + for (ptr = (grub_uint8_t *) base; ptr < ((grub_uint8_t *) base) + size; + ptr++) + ret += *ptr; + return ret; +} + +/* rev1 is 1 if ACPIv1 is to be generated, 0 otherwise. + rev2 contains the revision of ACPIv2+ to generate or 0 if none. */ +static int rev1, rev2; +static grub_dl_t my_mod; +/* OEMID of RSDP, RSDT and XSDT. */ +static char root_oemid[6]; +/* OEMTABLE of the same tables. */ +static char root_oemtable[8]; +/* OEMREVISION of the same tables. */ +static grub_uint32_t root_oemrev; +/* CreatorID of the same tables. */ +static char root_creator_id[4]; +/* CreatorRevision of the same tables. */ +static grub_uint32_t root_creator_rev; +static struct grub_acpi_rsdp_v10 *rsdpv1_new = 0; +static struct grub_acpi_rsdp_v20 *rsdpv2_new = 0; +static char *playground = 0, *playground_ptr = 0; +static int playground_size = 0; + +/* Linked list of ACPI tables. */ +struct efiemu_acpi_table +{ + void *addr; + grub_size_t size; + struct efiemu_acpi_table *next; +}; +static struct efiemu_acpi_table *acpi_tables = 0; + +/* DSDT isn't in RSDT. So treat it specially. */ +static void *table_dsdt = 0; +/* Pointer to recreated RSDT. */ +static void *rsdt_addr = 0; + +/* Allocation handles for different tables. */ +static grub_size_t dsdt_size = 0; + +/* Address of original FACS. */ +static grub_uint32_t facs_addr = 0; + +struct grub_acpi_rsdp_v20 * +grub_acpi_get_rsdpv2 (void) +{ + if (rsdpv2_new) + return rsdpv2_new; + if (rsdpv1_new) + return 0; + return grub_machine_acpi_get_rsdpv2 (); +} + +struct grub_acpi_rsdp_v10 * +grub_acpi_get_rsdpv1 (void) +{ + if (rsdpv1_new) + return rsdpv1_new; + if (rsdpv2_new) + return 0; + return grub_machine_acpi_get_rsdpv1 (); +} + +static inline int +iszero (grub_uint8_t *reg, int size) +{ + int i; + for (i = 0; i < size; i++) + if (reg[i]) + return 0; + return 1; +} + +grub_err_t +grub_acpi_create_ebda (void) +{ + int ebda_kb_len; + int ebda_len; + int mmapregion = 0; + grub_uint8_t *ebda, *v1inebda = 0, *v2inebda = 0; + grub_uint64_t highestlow = 0; + grub_uint8_t *targetebda, *target; + struct grub_acpi_rsdp_v10 *v1; + struct grub_acpi_rsdp_v20 *v2; + auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, + grub_uint32_t); + int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t size, + grub_uint32_t type) + { + grub_uint64_t end = start + size; + if (type != GRUB_MACHINE_MEMORY_AVAILABLE) + return 0; + if (end > 0x100000) + end = 0x100000; + if (end > start + ebda_len + && highestlow < ((end - ebda_len) & (~0xf)) ) + highestlow = (end - ebda_len) & (~0xf); + return 0; + } + + ebda = (grub_uint8_t *) UINT_TO_PTR ((*((grub_uint16_t *)0x40e)) << 4); + ebda_kb_len = *(grub_uint16_t *) ebda; + if (! ebda || ebda_kb_len > 16) + ebda_kb_len = 0; + ebda_len = (ebda_kb_len + 1) << 10; + + /* FIXME: use low-memory mm allocation once it's available. */ + grub_mmap_iterate (find_hook); + targetebda = (grub_uint8_t *) UINT_TO_PTR (highestlow); + grub_dprintf ("acpi", "creating ebda @%llx\n", + (unsigned long long) highestlow); + if (! highestlow) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't find space for the new EBDA"); + + mmapregion = grub_mmap_register (PTR_TO_UINT64 (targetebda), ebda_len, + GRUB_MACHINE_MEMORY_RESERVED); + if (! mmapregion) + return grub_errno; + + /* XXX: EBDA is unstandartised, so this implementation is heuristical. */ + if (ebda_kb_len) + grub_memcpy (targetebda, ebda, 0x400); + else + grub_memset (targetebda, 0, 0x400); + *((grub_uint16_t *) targetebda) = ebda_kb_len + 1; + target = targetebda; + + v1 = grub_acpi_get_rsdpv1 (); + v2 = grub_acpi_get_rsdpv2 (); + if (v2 && v2->length > 40) + v2 = 0; + + /* First try to replace already existing rsdp. */ + if (v2) + { + grub_dprintf ("acpi", "Scanning EBDA for old rsdpv2\n"); + for (; target < targetebda + 0x400 - v2->length; target += 0x10) + if (grub_memcmp (target, "RSD PTR ", 8) == 0 + && grub_byte_checksum (target, + sizeof (struct grub_acpi_rsdp_v10)) == 0 + && ((struct grub_acpi_rsdp_v10 *) target)->revision != 0 + && ((struct grub_acpi_rsdp_v20 *) target)->length <= v2->length) + { + grub_memcpy (target, v2, v2->length); + grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); + v2inebda = target; + target += v2->length; + target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + v2 = 0; + break; + } + } + + if (v1) + { + grub_dprintf ("acpi", "Scanning EBDA for old rsdpv1\n"); + for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + target += 0x10) + if (grub_memcmp (target, "RSD PTR ", 8) == 0 + && grub_byte_checksum (target, + sizeof (struct grub_acpi_rsdp_v10)) == 0) + { + grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10)); + grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); + v1inebda = target; + target += sizeof (struct grub_acpi_rsdp_v10); + target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + v1 = 0; + break; + } + } + + target = targetebda + 0x100; + + /* Try contiguous zeros. */ + if (v2) + { + grub_dprintf ("acpi", "Scanning EBDA for block of zeros\n"); + for (; target < targetebda + 0x400 - v2->length; target += 0x10) + if (iszero (target, v2->length)) + { + grub_dprintf ("acpi", "Copying rsdpv2 to %p\n", target); + grub_memcpy (target, v2, v2->length); + v2inebda = target; + target += v2->length; + target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + v2 = 0; + break; + } + } + + if (v1) + { + grub_dprintf ("acpi", "Scanning EBDA for block of zeros\n"); + for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + target += 0x10) + if (iszero (target, sizeof (struct grub_acpi_rsdp_v10))) + { + grub_dprintf ("acpi", "Copying rsdpv1 to %p\n", target); + grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10)); + v1inebda = target; + target += sizeof (struct grub_acpi_rsdp_v10); + target = (grub_uint8_t *) ((((long) target - 1) | 0xf) + 1); + v1 = 0; + break; + } + } + + if (v1 || v2) + { + grub_mmap_unregister (mmapregion); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Couldn't find suitable spot in EBDA"); + } + + /* Remove any other RSDT. */ + for (target = targetebda; + target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + target += 0x10) + if (grub_memcmp (target, "RSD PTR ", 8) == 0 + && grub_byte_checksum (target, + sizeof (struct grub_acpi_rsdp_v10)) == 0 + && target != v1inebda && target != v2inebda) + *target = 0; + + grub_dprintf ("acpi", "Switching EBDA\n"); + (*((grub_uint16_t *) 0x40e)) = ((long)targetebda) >> 4; + grub_dprintf ("acpi", "EBDA switched\n"); + + return GRUB_ERR_NONE; +} + +/* Create tables common to ACPIv1 and ACPIv2+ */ +static void +setup_common_tables (void) +{ + struct efiemu_acpi_table *cur; + struct grub_acpi_table_header *rsdt; + grub_uint32_t *rsdt_entry; + int numoftables; + + /* Treat DSDT. */ + grub_memcpy (playground_ptr, table_dsdt, dsdt_size); + grub_free (table_dsdt); + table_dsdt = playground_ptr; + playground_ptr += dsdt_size; + + /* Treat other tables. */ + for (cur = acpi_tables; cur; cur = cur->next) + { + struct grub_acpi_fadt *fadt; + + grub_memcpy (playground_ptr, cur->addr, cur->size); + grub_free (cur->addr); + cur->addr = playground_ptr; + playground_ptr += cur->size; + + /* If it's FADT correct DSDT and FACS addresses. */ + fadt = (struct grub_acpi_fadt *) cur->addr; + if (grub_memcmp (fadt->hdr.signature, "FACP", 4) == 0) + { + fadt->dsdt_addr = PTR_TO_UINT32 (table_dsdt); + fadt->facs_addr = facs_addr; + + /* Does a revision 2 exist at all? */ + if (fadt->hdr.revision >= 3) + { + fadt->dsdt_xaddr = PTR_TO_UINT64 (table_dsdt); + fadt->facs_xaddr = facs_addr; + } + + /* Recompute checksum. */ + fadt->hdr.checksum = 0; + fadt->hdr.checksum = 1 + ~grub_byte_checksum (fadt, fadt->hdr.length); + } + } + + /* Fill RSDT entries. */ + numoftables = 0; + for (cur = acpi_tables; cur; cur = cur->next) + numoftables++; + + rsdt_addr = rsdt = (struct grub_acpi_table_header *) playground_ptr; + playground_ptr += sizeof (struct grub_acpi_table_header) + 4 * numoftables; + + rsdt_entry = (grub_uint32_t *)(rsdt + 1); + + /* Fill RSDT header. */ + grub_memcpy (&(rsdt->signature), "RSDT", 4); + rsdt->length = sizeof (struct grub_acpi_table_header) + 4 * numoftables; + rsdt->revision = 1; + grub_memcpy (&(rsdt->oemid), root_oemid, 6); + grub_memcpy (&(rsdt->oemtable), root_oemtable, 4); + rsdt->oemrev = root_oemrev; + grub_memcpy (&(rsdt->creator_id), root_creator_id, 6); + rsdt->creator_rev = root_creator_rev; + + for (cur = acpi_tables; cur; cur = cur->next) + *(rsdt_entry++) = PTR_TO_UINT32 (cur->addr); + + /* Recompute checksum. */ + rsdt->checksum = 0; + rsdt->checksum = 1 + ~grub_byte_checksum (rsdt, rsdt->length); +} + +/* Regenerate ACPIv1 RSDP */ +static void +setv1table (void) +{ + /* Create RSDP. */ + rsdpv1_new = (struct grub_acpi_rsdp_v10 *) playground_ptr; + playground_ptr += sizeof (struct grub_acpi_rsdp_v10); + grub_memcpy (&(rsdpv1_new->signature), "RSD PTR ", 8); + grub_memcpy (&(rsdpv1_new->oemid), root_oemid, sizeof (rsdpv1_new->oemid)); + rsdpv1_new->revision = 0; + rsdpv1_new->rsdt_addr = PTR_TO_UINT32 (rsdt_addr); + rsdpv1_new->checksum = 0; + rsdpv1_new->checksum = 1 + ~grub_byte_checksum (rsdpv1_new, + sizeof (*rsdpv1_new)); + grub_dprintf ("acpi", "Generated ACPIv1 tables\n"); +} + +static void +setv2table (void) +{ + struct grub_acpi_table_header *xsdt; + struct efiemu_acpi_table *cur; + grub_uint64_t *xsdt_entry; + int numoftables; + + numoftables = 0; + for (cur = acpi_tables; cur; cur = cur->next) + numoftables++; + + /* Create XSDT. */ + xsdt = (struct grub_acpi_table_header *) playground_ptr; + playground_ptr += sizeof (struct grub_acpi_table_header) + 8 * numoftables; + + xsdt_entry = (grub_uint64_t *)(xsdt + 1); + for (cur = acpi_tables; cur; cur = cur->next) + *(xsdt_entry++) = PTR_TO_UINT64 (cur->addr); + grub_memcpy (&(xsdt->signature), "XSDT", 4); + xsdt->length = sizeof (struct grub_acpi_table_header) + 8 * numoftables; + xsdt->revision = 1; + grub_memcpy (&(xsdt->oemid), root_oemid, sizeof (xsdt->oemid)); + grub_memcpy (&(xsdt->oemtable), root_oemtable, sizeof (xsdt->oemtable)); + xsdt->oemrev = root_oemrev; + grub_memcpy (&(xsdt->creator_id), root_creator_id, sizeof (xsdt->creator_id)); + xsdt->creator_rev = root_creator_rev; + xsdt->checksum = 0; + xsdt->checksum = 1 + ~grub_byte_checksum (xsdt, xsdt->length); + + /* Create RSDPv2. */ + rsdpv2_new = (struct grub_acpi_rsdp_v20 *) playground_ptr; + playground_ptr += sizeof (struct grub_acpi_rsdp_v20); + grub_memcpy (&(rsdpv2_new->rsdpv1.signature), "RSD PTR ", + sizeof (rsdpv2_new->rsdpv1.signature)); + grub_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid, + sizeof (rsdpv2_new->rsdpv1.oemid)); + rsdpv2_new->rsdpv1.revision = rev2; + rsdpv2_new->rsdpv1.rsdt_addr = PTR_TO_UINT32 (rsdt_addr); + rsdpv2_new->rsdpv1.checksum = 0; + rsdpv2_new->rsdpv1.checksum = 1 + ~grub_byte_checksum + (&(rsdpv2_new->rsdpv1), sizeof (rsdpv2_new->rsdpv1)); + rsdpv2_new->length = sizeof (*rsdpv2_new); + rsdpv2_new->xsdt_addr = PTR_TO_UINT64 (xsdt); + rsdpv2_new->checksum = 0; + rsdpv2_new->checksum = 1 + ~grub_byte_checksum (rsdpv2_new, + rsdpv2_new->length); + grub_dprintf ("acpi", "Generated ACPIv2 tables\n"); +} + +static void +free_tables (void) +{ + struct efiemu_acpi_table *cur, *t; + if (table_dsdt) + grub_free (table_dsdt); + for (cur = acpi_tables; cur;) + { + t = cur; + grub_free (cur->addr); + cur = cur->next; + grub_free (t); + } + acpi_tables = 0; + table_dsdt = 0; +} + +static grub_err_t +grub_cmd_acpi (struct grub_extcmd *cmd, + int argc, char **args) +{ + struct grub_arg_list *state = cmd->state; + struct grub_acpi_rsdp_v10 *rsdp; + struct efiemu_acpi_table *cur, *t; + grub_err_t err; + int i, mmapregion; + int numoftables; + + /* Default values if no RSDP is found. */ + rev1 = 1; + rev2 = 3; + + facs_addr = 0; + playground = playground_ptr = 0; + playground_size = 0; + + rsdp = (struct grub_acpi_rsdp_v10 *) grub_machine_acpi_get_rsdpv2 (); + + if (! rsdp) + rsdp = grub_machine_acpi_get_rsdpv1 (); + + if (rsdp) + { + grub_uint32_t *entry_ptr; + char *exclude = 0; + char *load_only = 0; + char *ptr; + /* RSDT consists of header and an array of 32-bit pointers. */ + struct grub_acpi_table_header *rsdt; + + exclude = state[0].set ? grub_strdup (state[0].arg) : 0; + if (exclude) + { + for (ptr = exclude; *ptr; ptr++) + *ptr = grub_tolower (*ptr); + } + + load_only = state[1].set ? grub_strdup (state[1].arg) : 0; + if (load_only) + { + for (ptr = load_only; *ptr; ptr++) + *ptr = grub_tolower (*ptr); + } + + /* Set revision variables to replicant the same version as host. */ + rev1 = ! rsdp->revision; + rev2 = rsdp->revision; + rsdt = (struct grub_acpi_table_header *) UINT_TO_PTR (rsdp->rsdt_addr); + /* Load host tables. */ + for (entry_ptr = (grub_uint32_t *) (rsdt + 1); + entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt) + + rsdt->length); + entry_ptr++) + { + char signature[5]; + struct efiemu_acpi_table *table; + struct grub_acpi_table_header *curtable + = (struct grub_acpi_table_header *) UINT_TO_PTR (*entry_ptr); + signature[4] = 0; + for (i = 0; i < 4;i++) + signature[i] = grub_tolower (curtable->signature[i]); + + /* If it's FADT it contains addresses of DSDT and FACS. */ + if (grub_strcmp (signature, "facp") == 0) + { + struct grub_acpi_table_header *dsdt; + struct grub_acpi_fadt *fadt = (struct grub_acpi_fadt *) curtable; + + /* Set root header variables to the same values + as FACP by default. */ + grub_memcpy (&root_oemid, &(fadt->hdr.oemid), + sizeof (root_oemid)); + grub_memcpy (&root_oemtable, &(fadt->hdr.oemtable), + sizeof (root_oemtable)); + root_oemrev = fadt->hdr.oemrev; + grub_memcpy (&root_creator_id, &(fadt->hdr.creator_id), + sizeof (root_creator_id)); + root_creator_rev = fadt->hdr.creator_rev; + + /* Load DSDT if not excluded. */ + dsdt = (struct grub_acpi_table_header *) + UINT_TO_PTR (fadt->dsdt_addr); + if (dsdt && (! exclude || ! grub_strword (exclude, "dsdt")) + && (! load_only || grub_strword (load_only, "dsdt")) + && dsdt->length >= sizeof (*dsdt)) + { + dsdt_size = dsdt->length; + table_dsdt = grub_malloc (dsdt->length); + if (! table_dsdt) + { + free_tables (); + grub_free (exclude); + grub_free (load_only); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could allocate table"); + } + grub_memcpy (table_dsdt, dsdt, dsdt->length); + } + + /* Save FACS address. FACS shouldn't be overriden. */ + facs_addr = fadt->facs_addr; + } + + /* Skip excluded tables. */ + if (exclude && grub_strword (exclude, signature)) + continue; + if (load_only && ! grub_strword (load_only, signature)) + continue; + + /* Sanity check. */ + if (curtable->length < sizeof (*curtable)) + continue; + + table = (struct efiemu_acpi_table *) grub_malloc + (sizeof (struct efiemu_acpi_table)); + if (! table) + { + free_tables (); + grub_free (exclude); + grub_free (load_only); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could allocate table structure"); + } + table->size = curtable->length; + table->addr = grub_malloc (table->size); + playground_size += table->size; + if (! table->addr) + { + free_tables (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could allocate table"); + } + table->next = acpi_tables; + acpi_tables = table; + grub_memcpy (table->addr, curtable, table->size); + } + grub_free (exclude); + grub_free (load_only); + } + + /* Does user specify versions to generate? */ + if (state[2].set || state[3].set) + { + rev1 = state[2].set; + if (state[3].set) + rev2 = rev2 ? : 2; + else + rev2 = 0; + } + + /* Does user override root header information? */ + if (state[4].set) + grub_strncpy (root_oemid, state[4].arg, sizeof (root_oemid)); + if (state[5].set) + grub_strncpy (root_oemtable, state[5].arg, sizeof (root_oemtable)); + if (state[6].set) + root_oemrev = grub_strtoul (state[6].arg, 0, 0); + if (state[7].set) + grub_strncpy (root_creator_id, state[7].arg, sizeof (root_creator_id)); + if (state[8].set) + root_creator_rev = grub_strtoul (state[8].arg, 0, 0); + + /* Load user tables */ + for (i = 0; i < argc; i++) + { + grub_file_t file; + grub_size_t size; + char *buf; + + file = grub_gzfile_open (args[i], 1); + if (! file) + { + free_tables (); + return grub_error (GRUB_ERR_BAD_OS, "couldn't open file %s", args[i]); + } + + size = grub_file_size (file); + if (size < sizeof (struct grub_acpi_table_header)) + { + grub_file_close (file); + free_tables (); + return grub_error (GRUB_ERR_BAD_OS, "file %s is too small", args[i]); + } + + buf = (char *) grub_malloc (size); + if (! buf) + { + grub_file_close (file); + free_tables (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't read file %s", args[i]); + } + + if (grub_file_read (file, buf, size) != (int) size) + { + grub_file_close (file); + free_tables (); + return grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", args[i]); + } + grub_file_close (file); + + if (grub_memcmp (((struct grub_acpi_table_header *) buf)->signature, + "DSDT", 4) == 0) + { + grub_free (table_dsdt); + table_dsdt = buf; + dsdt_size = size; + } + else + { + struct efiemu_acpi_table *table; + table = (struct efiemu_acpi_table *) grub_malloc + (sizeof (struct efiemu_acpi_table)); + if (! table) + { + free_tables (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could allocate table structure"); + } + + table->size = size; + table->addr = buf; + playground_size += table->size; + } + } + + numoftables = 0; + for (cur = acpi_tables; cur; cur = cur->next) + numoftables++; + + /* DSDT. */ + playground_size += dsdt_size; + /* RSDT. */ + playground_size += sizeof (struct grub_acpi_table_header) + 4 * numoftables; + /* RSDPv1. */ + playground_size += sizeof (struct grub_acpi_rsdp_v10); + /* XSDT. */ + playground_size += sizeof (struct grub_acpi_table_header) + 8 * numoftables; + /* RSDPv2. */ + playground_size += sizeof (struct grub_acpi_rsdp_v20); + + playground = playground_ptr + = grub_mmap_malign_and_register (1, playground_size, &mmapregion, + GRUB_MACHINE_MEMORY_ACPI, 0); + + if (! playground) + { + free_tables (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Couldn't allocate space for ACPI tables"); + } + + setup_common_tables (); + + /* Request space for RSDPv1. */ + if (rev1) + setv1table (); + + /* Request space for RSDPv2+ and XSDT. */ + if (rev2) + setv2table (); + + for (cur = acpi_tables; cur;) + { + t = cur; + cur = cur->next; + grub_free (t); + } + acpi_tables = 0; + + if (! state[9].set && (err = grub_acpi_create_ebda ())) + { + rsdpv1_new = 0; + rsdpv2_new = 0; + grub_mmap_free_and_unregister (mmapregion); + return err; + } + +#ifdef GRUB_MACHINE_EFI + { + struct grub_efi_guid acpi = GRUB_EFI_ACPI_TABLE_GUID; + struct grub_efi_guid acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID; + + grub_efi_system_table->boot_services->install_configuration_table + (&acpi20, grub_acpi_get_rsdpv2 ()); + grub_efi_system_table->boot_services->install_configuration_table + (&acpi, grub_acpi_get_rsdpv1 ()); + } +#endif + + return GRUB_ERR_NONE; +} + +static grub_extcmd_t cmd; + +GRUB_MOD_INIT(acpi) +{ + (void) mod; /* To stop warning. */ + cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, + GRUB_COMMAND_FLAG_BOTH, + "acpi [-1|-2] [--exclude=table1,table2|" + "--load-only=table1,table2] filename1 " + " [filename2] [...]", + "Load host acpi tables and tables " + "specified by arguments", + options); + my_mod=mod; +} + +GRUB_MOD_FINI(acpi) +{ + grub_unregister_extcmd (cmd); +} diff --git a/commands/efi/acpi.c b/commands/efi/acpi.c new file mode 100644 index 000000000..443f74953 --- /dev/null +++ b/commands/efi/acpi.c @@ -0,0 +1,59 @@ +/* acpi.c - get acpi tables. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +struct grub_acpi_rsdp_v10 * +grub_machine_acpi_get_rsdpv1 (void) +{ + unsigned i; + static grub_efi_guid_t acpi_guid = GRUB_EFI_ACPI_TABLE_GUID; + + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + { + grub_efi_guid_t *guid = + &grub_efi_system_table->configuration_table[i].vendor_guid; + + if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) + return (struct grub_acpi_rsdp_v10 *) + grub_efi_system_table->configuration_table[i].vendor_table; + } + return 0; +} + +struct grub_acpi_rsdp_v20 * +grub_machine_acpi_get_rsdpv2 (void) +{ + unsigned i; + static grub_efi_guid_t acpi20_guid = GRUB_EFI_ACPI_20_TABLE_GUID; + + for (i = 0; i < grub_efi_system_table->num_table_entries; i++) + { + grub_efi_guid_t *guid = + &grub_efi_system_table->configuration_table[i].vendor_guid; + + if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_guid_t))) + return (struct grub_acpi_rsdp_v20 *) + grub_efi_system_table->configuration_table[i].vendor_table; + } + return 0; +} diff --git a/commands/i386/pc/acpi.c b/commands/i386/pc/acpi.c new file mode 100644 index 000000000..e02cf4960 --- /dev/null +++ b/commands/i386/pc/acpi.c @@ -0,0 +1,81 @@ +/* acpi.c - get acpi tables. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +struct grub_acpi_rsdp_v10 * +grub_machine_acpi_get_rsdpv1 (void) +{ + int ebda_len; + grub_uint8_t *ebda, *ptr; + + grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); + ebda_len = * (grub_uint16_t *) ebda; + if (! ebda_len) + return 0; + for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) + if (grub_memcmp (ptr, "RSD PTR ", 8) == 0 + && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 + && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) + return (struct grub_acpi_rsdp_v10 *) ptr; + + grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; + ptr += 16) + if (grub_memcmp (ptr, "RSD PTR ", 8) == 0 + && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 + && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) + return (struct grub_acpi_rsdp_v10 *) ptr; + return 0; +} + +struct grub_acpi_rsdp_v20 * +grub_machine_acpi_get_rsdpv2 (void) +{ + int ebda_len; + grub_uint8_t *ebda, *ptr; + + grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); + ebda_len = * (grub_uint16_t *) ebda; + if (! ebda_len) + return 0; + for (ptr = ebda; ptr < ebda + 0x400; ptr += 16) + if (grub_memcmp (ptr, "RSD PTR ", 8) == 0 + && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 + && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0 + && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024 + && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length) + == 0) + return (struct grub_acpi_rsdp_v20 *) ptr; + + grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; + ptr += 16) + if (grub_memcmp (ptr, "RSD PTR ", 8) == 0 + && grub_byte_checksum (ptr, sizeof (struct grub_acpi_rsdp_v10)) == 0 + && ((struct grub_acpi_rsdp_v10 *) ptr)->revision != 0 + && ((struct grub_acpi_rsdp_v20 *) ptr)->length < 1024 + && grub_byte_checksum (ptr, ((struct grub_acpi_rsdp_v20 *) ptr)->length) + == 0) + return (struct grub_acpi_rsdp_v20 *) ptr; + return 0; +} diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 4dab18c21..1a211e664 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -82,7 +82,8 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod chain.mod appleldr.mod \ linux.mod halt.mod reboot.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod mmap.mod + datetime.mod date.mod datehook.mod loadbios.mod \ + fixvideo.mod mmap.mod acpi.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -115,6 +116,11 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) +# For acpi.mod. +acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c +acpi_mod_CFLAGS = $(COMMON_CFLAGS) +acpi_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For mmap.mod. mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \ mmap/efi/mmap.c diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 6b1f4853f..482e78670 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -185,7 +185,12 @@ pkglib_MODULES = biosdisk.mod chain.mod \ aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \ - mmap.mod + mmap.mod acpi.mod + +# For acpi.mod. +acpi_mod_SOURCES = commands/acpi.c commands/i386/pc/acpi.c +acpi_mod_CFLAGS = $(COMMON_CFLAGS) +acpi_mod_LDFLAGS = $(COMMON_LDFLAGS) # For mmap.mod. mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 38c27f32d..0f3ce62b2 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -80,7 +80,8 @@ grub_install_SOURCES = util/i386/efi/grub-install.in # Modules. pkglib_MODULES = kernel.mod chain.mod appleldr.mod \ halt.mod reboot.mod linux.mod pci.mod lspci.mod \ - datetime.mod date.mod datehook.mod loadbios.mod fixvideo.mod mmap.mod + datetime.mod date.mod datehook.mod loadbios.mod \ + fixvideo.mod mmap.mod acpi.mod # For kernel.mod. kernel_mod_EXPORTS = no @@ -114,6 +115,11 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) +# For acpi.mod. +acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c +acpi_mod_CFLAGS = $(COMMON_CFLAGS) +acpi_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For mmap.mod. mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c \ mmap/efi/mmap.c diff --git a/include/grub/acpi.h b/include/grub/acpi.h new file mode 100644 index 000000000..26a84f8bf --- /dev/null +++ b/include/grub/acpi.h @@ -0,0 +1,75 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_ACPI_HEADER +#define GRUB_ACPI_HEADER 1 + +#include +#include + +struct grub_acpi_rsdp_v10 +{ + grub_uint8_t signature[8]; + grub_uint8_t checksum; + grub_uint8_t oemid[6]; + grub_uint8_t revision; + grub_uint32_t rsdt_addr; +} __attribute__ ((packed)); + +struct grub_acpi_rsdp_v20 +{ + struct grub_acpi_rsdp_v10 rsdpv1; + grub_uint32_t length; + grub_uint64_t xsdt_addr; + grub_uint8_t checksum; + grub_uint8_t reserved[3]; +} __attribute__ ((packed)); + +struct grub_acpi_table_header +{ + grub_uint8_t signature[4]; + grub_uint32_t length; + grub_uint8_t revision; + grub_uint8_t checksum; + grub_uint8_t oemid[6]; + grub_uint8_t oemtable[8]; + grub_uint32_t oemrev; + grub_uint8_t creator_id[4]; + grub_uint32_t creator_rev; +} __attribute__ ((packed)); + +struct grub_acpi_fadt +{ + struct grub_acpi_table_header hdr; + grub_uint32_t facs_addr; + grub_uint32_t dsdt_addr; + grub_uint8_t somefields1[88]; + grub_uint64_t facs_xaddr; + grub_uint64_t dsdt_xaddr; + grub_uint8_t somefields2[96]; +} __attribute__ ((packed)); + +struct grub_acpi_rsdp_v10 *grub_acpi_get_rsdpv1 (void); +struct grub_acpi_rsdp_v20 *grub_acpi_get_rsdpv2 (void); +struct grub_acpi_rsdp_v10 *grub_machine_acpi_get_rsdpv1 (void); +struct grub_acpi_rsdp_v20 *grub_machine_acpi_get_rsdpv2 (void); +grub_uint8_t grub_byte_checksum (void *base, grub_size_t size); + +grub_err_t grub_acpi_create_ebda (void); + +#endif /* ! GRUB_ACPI_HEADER */ From 5caf964d75379883d1c9d8d92b3497f7f7081a65 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 2 May 2009 22:40:21 +0000 Subject: [PATCH 0699/1707] 2009-05-02 Vladimir Serbinenko Efiemu * conf/i386-pc.rmk: new modules efiemu, efiemu_acpi, efiemu_pnvram, _linux_efi, linux_efi. new files in grub-emu new targets efiemu32.o and efiemu64.o * loader/linux_normal_efiemu.c: likewise * loader/i386/efi/linux.c: added preliminary efiemu support * util/i386/pc/grub-install.in: add efiemu??.o to the list of files to copy * include/grub/autoefi.h: new file * nclude/grub/i386/efiemu.h: likewise * include/grub/i386/pc/efiemu.h: likewise * include/grub/efi/api.h: add LL suffix when necessary new definitions relating to tables * include/grub/efiemu/efiemu.h: new file * include/grub/efiemu/runtime.h: likewise * efiemu/prepare.c: likewise * efiemu/loadcore_common.c: likewise * efiemu/loadcore64.c: likewise * efiemu/runtime/efiemu.sh: likewise * efiemu/runtime/efiemu.S: likewise * efiemu/runtime/efiemu.c: likewise * efiemu/runtime/config.h: likewise * efiemu/prepare32.c: likewise * efiemu/main.c: likewise * efiemu/modules/pnvram.c: likewise * efiemu/modules/i386: likewise * efiemu/modules/i386/pc: likewise * efiemu/modules/acpi.c: likewise * efiemu/i386/pc/cfgtables.c: likewise * efiemu/i386/loadcore64.c: likewise * efiemu/i386/loadcore32.c: likewise * efiemu/prepare64.c: likewise * efiemu/loadcore.c: likewise * efiemu/symbols.c: likewise * efiemu/mm.c: likewise * efiemu/loadcore32.c: likewise --- ChangeLog | 41 +++ conf/i386-pc.rmk | 26 +- efiemu/i386/coredetect.c | 60 ++++ efiemu/i386/loadcore32.c | 114 ++++++ efiemu/i386/loadcore64.c | 120 +++++++ efiemu/i386/pc/cfgtables.c | 76 ++++ efiemu/loadcore.c | 365 +++++++++++++++++++ efiemu/loadcore32.c | 27 ++ efiemu/loadcore64.c | 27 ++ efiemu/loadcore_common.c | 189 ++++++++++ efiemu/main.c | 345 ++++++++++++++++++ efiemu/mm.c | 635 ++++++++++++++++++++++++++++++++++ efiemu/pnvram.c | 402 +++++++++++++++++++++ efiemu/prepare.c | 127 +++++++ efiemu/prepare32.c | 23 ++ efiemu/prepare64.c | 23 ++ efiemu/runtime/config.h | 34 ++ efiemu/runtime/efiemu.S | 159 +++++++++ efiemu/runtime/efiemu.c | 623 +++++++++++++++++++++++++++++++++ efiemu/runtime/efiemu.sh | 4 + efiemu/symbols.c | 188 ++++++++++ include/grub/autoefi.h | 75 ++++ include/grub/efi/api.h | 23 +- include/grub/efiemu/efiemu.h | 276 +++++++++++++++ include/grub/efiemu/runtime.h | 37 ++ include/grub/i386/efiemu.h | 33 ++ include/grub/i386/pc/efiemu.h | 24 ++ util/i386/pc/grub-install.in | 4 +- util/i386/pc/grub-mkrescue.in | 2 +- 29 files changed, 4068 insertions(+), 14 deletions(-) create mode 100644 efiemu/i386/coredetect.c create mode 100644 efiemu/i386/loadcore32.c create mode 100644 efiemu/i386/loadcore64.c create mode 100644 efiemu/i386/pc/cfgtables.c create mode 100644 efiemu/loadcore.c create mode 100644 efiemu/loadcore32.c create mode 100644 efiemu/loadcore64.c create mode 100644 efiemu/loadcore_common.c create mode 100644 efiemu/main.c create mode 100644 efiemu/mm.c create mode 100644 efiemu/pnvram.c create mode 100644 efiemu/prepare.c create mode 100644 efiemu/prepare32.c create mode 100644 efiemu/prepare64.c create mode 100644 efiemu/runtime/config.h create mode 100644 efiemu/runtime/efiemu.S create mode 100644 efiemu/runtime/efiemu.c create mode 100644 efiemu/runtime/efiemu.sh create mode 100644 efiemu/symbols.c create mode 100644 include/grub/autoefi.h create mode 100644 include/grub/efiemu/efiemu.h create mode 100644 include/grub/efiemu/runtime.h create mode 100644 include/grub/i386/efiemu.h create mode 100644 include/grub/i386/pc/efiemu.h diff --git a/ChangeLog b/ChangeLog index febe73b97..967ba0b05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2009-05-02 Vladimir Serbinenko + + Efiemu + + * conf/i386-pc.rmk: new modules efiemu, efiemu_acpi, efiemu_pnvram, + _linux_efi, linux_efi. + new files in grub-emu + new targets efiemu32.o and efiemu64.o + * loader/linux_normal_efiemu.c: likewise + * loader/i386/efi/linux.c: added preliminary efiemu support + * util/i386/pc/grub-install.in: add efiemu??.o to the list of + files to copy + * include/grub/autoefi.h: new file + * nclude/grub/i386/efiemu.h: likewise + * include/grub/i386/pc/efiemu.h: likewise + * include/grub/efi/api.h: add LL suffix when necessary + new definitions relating to tables + * include/grub/efiemu/efiemu.h: new file + * include/grub/efiemu/runtime.h: likewise + * efiemu/prepare.c: likewise + * efiemu/loadcore_common.c: likewise + * efiemu/loadcore64.c: likewise + * efiemu/runtime/efiemu.sh: likewise + * efiemu/runtime/efiemu.S: likewise + * efiemu/runtime/efiemu.c: likewise + * efiemu/runtime/config.h: likewise + * efiemu/prepare32.c: likewise + * efiemu/main.c: likewise + * efiemu/modules/pnvram.c: likewise + * efiemu/modules/i386: likewise + * efiemu/modules/i386/pc: likewise + * efiemu/modules/acpi.c: likewise + * efiemu/i386/pc/cfgtables.c: likewise + * efiemu/i386/loadcore64.c: likewise + * efiemu/i386/loadcore32.c: likewise + * efiemu/prepare64.c: likewise + * efiemu/loadcore.c: likewise + * efiemu/symbols.c: likewise + * efiemu/mm.c: likewise + * efiemu/loadcore32.c: likewise + 2009-05-02 Vladimir Serbinenko ACPI spoofing diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 482e78670..ae7bbad77 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -185,7 +185,17 @@ pkglib_MODULES = biosdisk.mod chain.mod \ aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \ - mmap.mod acpi.mod + efiemu.mod mmap.mod acpi.mod + +# For efiemu.mod. +efiemu_mod_SOURCES = efiemu/main.c efiemu/i386/loadcore32.c \ + efiemu/i386/loadcore64.c efiemu/i386/pc/cfgtables.c \ + efiemu/mm.c efiemu/loadcore_common.c efiemu/symbols.c \ + efiemu/loadcore32.c efiemu/loadcore64.c \ + efiemu/prepare32.c efiemu/prepare64.c efiemu/pnvram.c \ + efiemu/i386/coredetect.c +efiemu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +efiemu_mod_LDFLAGS = $(COMMON_LDFLAGS) # For acpi.mod. acpi_mod_SOURCES = commands/acpi.c commands/i386/pc/acpi.c @@ -370,5 +380,19 @@ hdparm_mod_SOURCES = commands/hdparm.c lib/hexdump.c hdparm_mod_CFLAGS = $(COMMON_CFLAGS) hdparm_mod_LDFLAGS = $(COMMON_LDFLAGS) +efiemu32.o: efiemu/runtime/efiemu.c + $(CC) -c -m32 -DELF32 -o $@ -Wall -Werror efiemu/runtime/efiemu.c -nostdlib -O2 -Iefiemu/runtime -Iinclude +efiemu64_c.o: efiemu/runtime/efiemu.c + $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror efiemu/runtime/efiemu.c -nostdlib -mcmodel=large -O2 -Iefiemu/runtime -Iinclude + +efiemu64_s.o: efiemu/runtime/efiemu.S + $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror efiemu/runtime/efiemu.S -nostdlib -mcmodel=large -O2 -Iefiemu/runtime -Iinclude + +efiemu64.o: efiemu64_c.o efiemu64_s.o + ld -melf_x86_64 -o $@ -r efiemu64_c.o efiemu64_s.o -nostdlib + +CLEANFILES += efiemu32.o efiemu64.o efiemu64_c.o efiemu64_s.o +lib_DATA += efiemu32.o efiemu64.o + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/efiemu/i386/coredetect.c b/efiemu/i386/coredetect.c new file mode 100644 index 000000000..828508dee --- /dev/null +++ b/efiemu/i386/coredetect.c @@ -0,0 +1,60 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +#define cpuid(num,a,b,c,d) \ + asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \ + : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ + : "0" (num)) + +#define bit_LM (1 << 29) + +char * +grub_efiemu_get_default_core_name (void) +{ + + unsigned int eax, ebx, ecx, edx; + unsigned int max_level; + unsigned int ext_level; + + /* See if we can use cpuid. */ + asm volatile ("pushfl; pushfl; popl %0; movl %0,%1; xorl %2,%0;" + "pushl %0; popfl; pushfl; popl %0; popfl" + : "=&r" (eax), "=&r" (ebx) + : "i" (0x00200000)); + if (((eax ^ ebx) & 0x00200000) == 0) + return "efiemu32.o"; + + /* Check the highest input value for eax. */ + cpuid (0, eax, ebx, ecx, edx); + /* We only look at the first four characters. */ + max_level = eax; + if (max_level == 0) + return "efiemu32.o"; + + cpuid (0x80000000, eax, ebx, ecx, edx); + ext_level = eax; + if (ext_level < 0x80000000) + return "efiemu32.o"; + + cpuid (0x80000001, eax, ebx, ecx, edx); + return (edx & bit_LM) ? "efiemu64.o" : "efiemu32.o"; +} diff --git a/efiemu/i386/loadcore32.c b/efiemu/i386/loadcore32.c new file mode 100644 index 000000000..d46cd4c9a --- /dev/null +++ b/efiemu/i386/loadcore32.c @@ -0,0 +1,114 @@ +/* i386 CPU-specific part of loadcore.c for 32-bit mode */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +/* Check if EHDR is a valid ELF header. */ +int +grub_arch_efiemu_check_header32 (void *ehdr) +{ + Elf32_Ehdr *e = ehdr; + + /* Check the magic numbers. */ + return (e->e_ident[EI_CLASS] == ELFCLASS32 + && e->e_ident[EI_DATA] == ELFDATA2LSB + && e->e_machine == EM_386); +} + +/* Relocate symbols. */ +grub_err_t +grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, + struct grub_efiemu_elf_sym *elfsyms, + void *ehdr) +{ + unsigned i; + Elf32_Ehdr *e = ehdr; + Elf32_Shdr *s; + grub_err_t err; + + grub_dprintf ("efiemu", "relocating symbols %d %d\n", + e->e_shoff, e->e_shnum); + + for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_REL) + { + grub_efiemu_segment_t seg; + grub_dprintf ("efiemu", "shtrel\n"); + + /* Find the target segment. */ + for (seg = segs; seg; seg = seg->next) + if (seg->section == s->sh_info) + break; + + if (seg) + { + Elf32_Rel *rel, *max; + + for (rel = (Elf32_Rel *) ((char *) e + s->sh_offset), + max = rel + s->sh_size / s->sh_entsize; + rel < max; + rel++) + { + Elf32_Word *addr; + struct grub_efiemu_elf_sym sym; + if (seg->size < rel->r_offset) + return grub_error (GRUB_ERR_BAD_MODULE, + "reloc offset is out of the segment"); + + addr = (Elf32_Word *) + ((char *) grub_efiemu_mm_obtain_request (seg->handle) + + seg->off + rel->r_offset); + sym = elfsyms[ELF32_R_SYM (rel->r_info)]; + + switch (ELF32_R_TYPE (rel->r_info)) + { + case R_386_32: + if ((err = grub_efiemu_write_value + (addr, sym.off + *addr, sym.handle, 0, + seg->ptv_rel_needed, sizeof (grub_uint32_t)))) + return err; + + break; + + case R_386_PC32: + if ((err = grub_efiemu_write_value + (addr, sym.off + *addr - rel->r_offset + - seg->off, sym.handle, seg->handle, + seg->ptv_rel_needed, sizeof (grub_uint32_t)))) + return err; + break; + default: + return grub_error (GRUB_ERR_BAD_OS, + "unrecognised relocation"); + } + } + } + } + + return GRUB_ERR_NONE; +} + + diff --git a/efiemu/i386/loadcore64.c b/efiemu/i386/loadcore64.c new file mode 100644 index 000000000..6c0e0ca14 --- /dev/null +++ b/efiemu/i386/loadcore64.c @@ -0,0 +1,120 @@ +/* i386 CPU-specific part of loadcore.c for 32-bit mode */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +/* Check if EHDR is a valid ELF header. */ +int +grub_arch_efiemu_check_header64 (void *ehdr) +{ + Elf64_Ehdr *e = ehdr; + + return (e->e_ident[EI_CLASS] == ELFCLASS64 + && e->e_ident[EI_DATA] == ELFDATA2LSB + && e->e_machine == EM_X86_64); +} + +/* Relocate symbols. */ +grub_err_t +grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, + struct grub_efiemu_elf_sym *elfsyms, + void *ehdr) +{ + unsigned i; + Elf64_Ehdr *e = ehdr; + Elf64_Shdr *s; + grub_err_t err; + + for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_RELA) + { + grub_efiemu_segment_t seg; + grub_dprintf ("efiemu", "shtrel\n"); + + /* Find the target segment. */ + for (seg = segs; seg; seg = seg->next) + if (seg->section == s->sh_info) + break; + + if (seg) + { + Elf64_Rela *rel, *max; + + for (rel = (Elf64_Rela *) ((char *) e + s->sh_offset), + max = rel + (unsigned long) s->sh_size + / (unsigned long)s->sh_entsize; + rel < max; + rel++) + { + void *addr; + grub_uint32_t *addr32; + grub_uint64_t *addr64; + struct grub_efiemu_elf_sym sym; + if (seg->size < rel->r_offset) + return grub_error (GRUB_ERR_BAD_MODULE, + "reloc offset is out of the segment"); + + addr = + ((char *) grub_efiemu_mm_obtain_request (seg->handle) + + seg->off + rel->r_offset); + addr32 = (grub_uint32_t *) addr; + addr64 = (grub_uint64_t *) addr; + sym = elfsyms[ELF64_R_SYM (rel->r_info)]; + + switch (ELF64_R_TYPE (rel->r_info)) + { + case R_X86_64_64: + if ((err = grub_efiemu_write_value + (addr, *addr64 + rel->r_addend + sym.off, sym.handle, + 0, seg->ptv_rel_needed, sizeof (grub_uint64_t)))) + return err; + break; + + case R_X86_64_PC32: + if ((err = grub_efiemu_write_value + (addr, *addr32 + rel->r_addend + sym.off + - rel->r_offset - seg->off, sym.handle, seg->handle, + seg->ptv_rel_needed, sizeof (grub_uint32_t)))) + return err; + break; + + case R_X86_64_32: + case R_X86_64_32S: + if ((err = grub_efiemu_write_value + (addr, *addr32 + rel->r_addend + sym.off, sym.handle, + 0, seg->ptv_rel_needed, sizeof (grub_uint32_t)))) + return err; + break; + default: + return grub_error (GRUB_ERR_BAD_OS, + "unrecognised relocation"); + } + } + } + } + + return GRUB_ERR_NONE; +} diff --git a/efiemu/i386/pc/cfgtables.c b/efiemu/i386/pc/cfgtables.c new file mode 100644 index 000000000..25f8a0cfa --- /dev/null +++ b/efiemu/i386/pc/cfgtables.c @@ -0,0 +1,76 @@ +/* Register SMBIOS and ACPI tables. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +grub_err_t +grub_machine_efiemu_init_tables () +{ + grub_uint8_t *ptr; + void *table; + grub_err_t err; + grub_efi_guid_t smbios = GRUB_EFI_SMBIOS_TABLE_GUID; + grub_efi_guid_t acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID; + grub_efi_guid_t acpi = GRUB_EFI_ACPI_TABLE_GUID; + + err = grub_efiemu_unregister_configuration_table (smbios); + if (err) + return err; + err = grub_efiemu_unregister_configuration_table (acpi); + if (err) + return err; + err = grub_efiemu_unregister_configuration_table (acpi20); + if (err) + return err; + + table = grub_acpi_get_rsdpv1 (); + if (table) + { + err = grub_efiemu_register_configuration_table (acpi, 0, 0, table); + if (err) + return err; + } + table = grub_acpi_get_rsdpv2 (); + if (table) + { + err = grub_efiemu_register_configuration_table (acpi20, 0, 0, table); + if (err) + return err; + } + + for (ptr = (grub_uint8_t *) 0xf0000; ptr < (grub_uint8_t *) 0x100000; + ptr += 16) + if (grub_memcmp (ptr, "_SM_", 4) == 0 + && grub_byte_checksum (ptr, *(ptr + 5)) == 0) + break; + + if (ptr < (grub_uint8_t *) 0x100000) + { + grub_dprintf ("efiemu", "Registering SMBIOS\n"); + if ((err = grub_efiemu_register_configuration_table (smbios, 0, 0, ptr))) + return err; + } + + return GRUB_ERR_NONE; +} diff --git a/efiemu/loadcore.c b/efiemu/loadcore.c new file mode 100644 index 000000000..36f27a2ef --- /dev/null +++ b/efiemu/loadcore.c @@ -0,0 +1,365 @@ +/* Load runtime image of EFIemu. Functions specific to 32/64-bit mode */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +/* ELF symbols and their values */ +static struct grub_efiemu_elf_sym *grub_efiemu_elfsyms = 0; +static int grub_efiemu_nelfsyms = 0; + +/* Return the address of a section whose index is N. */ +static grub_err_t +grub_efiemu_get_section_addr (grub_efiemu_segment_t segs, unsigned n, + int *handle, grub_off_t *off) +{ + grub_efiemu_segment_t seg; + + for (seg = segs; seg; seg = seg->next) + if (seg->section == n) + { + *handle = seg->handle; + *off = seg->off; + return GRUB_ERR_NONE; + } + + return grub_error (GRUB_ERR_BAD_OS, "section %d not found", n); +} + +grub_err_t +SUFFIX (grub_efiemu_loadcore_unload) (void) +{ + grub_free (grub_efiemu_elfsyms); + grub_efiemu_elfsyms = 0; + return GRUB_ERR_NONE; +} + +/* Check if EHDR is a valid ELF header. */ +int +SUFFIX (grub_efiemu_check_header) (void *ehdr, grub_size_t size) +{ + Elf_Ehdr *e = ehdr; + + /* Check the header size. */ + if (size < sizeof (Elf_Ehdr)) + return 0; + + /* Check the magic numbers. */ + if (!SUFFIX (grub_arch_efiemu_check_header) (ehdr) + || e->e_ident[EI_MAG0] != ELFMAG0 + || e->e_ident[EI_MAG1] != ELFMAG1 + || e->e_ident[EI_MAG2] != ELFMAG2 + || e->e_ident[EI_MAG3] != ELFMAG3 + || e->e_ident[EI_VERSION] != EV_CURRENT + || e->e_version != EV_CURRENT) + return 0; + + return 1; +} + +/* Load all segments from memory specified by E. */ +static grub_err_t +grub_efiemu_load_segments (grub_efiemu_segment_t segs, const Elf_Ehdr *e) +{ + Elf_Shdr *s; + grub_efiemu_segment_t cur; + + grub_dprintf ("efiemu", "loading segments\n"); + + for (cur=segs; cur; cur = cur->next) + { + s = (Elf_Shdr *)cur->srcptr; + + if ((s->sh_flags & SHF_ALLOC) && s->sh_size) + { + void *addr; + + addr = (grub_uint8_t *) grub_efiemu_mm_obtain_request (cur->handle) + + cur->off; + + switch (s->sh_type) + { + case SHT_PROGBITS: + grub_memcpy (addr, (char *) e + s->sh_offset, s->sh_size); + break; + case SHT_NOBITS: + grub_memset (addr, 0, s->sh_size); + break; + } + } + } + + return GRUB_ERR_NONE; +} + +/* Get a string at offset OFFSET from strtab */ +static char * +grub_efiemu_get_string (unsigned offset, const Elf_Ehdr *e) +{ + unsigned i; + Elf_Shdr *s; + + for (i = 0, s = (Elf_Shdr *)((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_STRTAB && offset < s->sh_size) + return (char *) e + s->sh_offset + offset; + return 0; +} + +/* Request memory for segments and fill segments info */ +static grub_err_t +grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) +{ + unsigned i; + Elf_Shdr *s; + + for (i = 0, s = (Elf_Shdr *)((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize)) + { + if (s->sh_flags & SHF_ALLOC) + { + grub_efiemu_segment_t seg; + seg = (grub_efiemu_segment_t) grub_malloc (sizeof (*seg)); + if (! seg) + return grub_errno; + + if (s->sh_size) + { + seg->handle + = grub_efiemu_request_memalign + (s->sh_addralign, s->sh_size, + s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE + : GRUB_EFI_RUNTIME_SERVICES_DATA); + if (seg->handle < 0) + return grub_errno; + seg->off = 0; + } + + /* + .text-physical doesn't need to be relocated when switching to + virtual mode + */ + if (!grub_strcmp (grub_efiemu_get_string (s->sh_name, e), + ".text-physical")) + seg->ptv_rel_needed = 0; + else + seg->ptv_rel_needed = 1; + seg->size = s->sh_size; + seg->section = i; + seg->next = *segs; + seg->srcptr = s; + *segs = seg; + } + } + + return GRUB_ERR_NONE; +} + +/* Count symbols and relocators and allocate/request memory for them */ +static grub_err_t +grub_efiemu_count_symbols (const Elf_Ehdr *e) +{ + unsigned i; + Elf_Shdr *s; + int num = 0; + + /* Symbols */ + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_SYMTAB) + break; + + if (i == e->e_shnum) + return grub_error (GRUB_ERR_BAD_OS, "no symbol table"); + + grub_efiemu_nelfsyms = (unsigned) s->sh_size / (unsigned) s->sh_entsize; + grub_efiemu_elfsyms = (struct grub_efiemu_elf_sym *) + grub_malloc (sizeof (struct grub_efiemu_elf_sym) * grub_efiemu_nelfsyms); + + /* Relocators */ + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_REL || s->sh_type == SHT_RELA) + num += ((unsigned) s->sh_size) / ((unsigned) s->sh_entsize); + + grub_efiemu_request_symbols (num); + + return GRUB_ERR_NONE; +} + +/* Fill grub_efiemu_elfsyms with symbol values */ +static grub_err_t +grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) +{ + unsigned i; + Elf_Shdr *s; + Elf_Sym *sym; + const char *str; + Elf_Word size, entsize; + + grub_dprintf ("efiemu", "resolving symbols\n"); + + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); + i < e->e_shnum; + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) + if (s->sh_type == SHT_SYMTAB) + break; + + if (i == e->e_shnum) + return grub_error (GRUB_ERR_BAD_OS, "no symbol table"); + + sym = (Elf_Sym *) ((char *) e + s->sh_offset); + size = s->sh_size; + entsize = s->sh_entsize; + + s = (Elf_Shdr *) ((char *) e + e->e_shoff + e->e_shentsize * s->sh_link); + str = (char *) e + s->sh_offset; + + for (i = 0; + i < size / entsize; + i++, sym = (Elf_Sym *) ((char *) sym + entsize)) + { + unsigned char type = ELF_ST_TYPE (sym->st_info); + unsigned char bind = ELF_ST_BIND (sym->st_info); + int handle; + grub_off_t off; + grub_err_t err; + const char *name = str + sym->st_name; + grub_efiemu_elfsyms[i].section = sym->st_shndx; + switch (type) + { + case STT_NOTYPE: + /* Resolve a global symbol. */ + if (sym->st_name != 0 && sym->st_shndx == 0) + { + if ((err = grub_efiemu_resolve_symbol (name, &handle, &off))) + return err; + grub_efiemu_elfsyms[i].handle = handle; + grub_efiemu_elfsyms[i].off = off; + } + else + sym->st_value = 0; + break; + + case STT_OBJECT: + if ((err = grub_efiemu_get_section_addr + (segs, sym->st_shndx, &handle, &off))) + return err; + + off += sym->st_value; + if (bind != STB_LOCAL) + if ((err = grub_efiemu_register_symbol (name, handle, off))) + return err; + grub_efiemu_elfsyms[i].handle = handle; + grub_efiemu_elfsyms[i].off = off; + break; + + case STT_FUNC: + if ((err = grub_efiemu_get_section_addr + (segs, sym->st_shndx, &handle, &off))) + return err; + + off += sym->st_value; + if (bind != STB_LOCAL) + if ((err = grub_efiemu_register_symbol (name, handle, off))) + return err; + grub_efiemu_elfsyms[i].handle = handle; + grub_efiemu_elfsyms[i].off = off; + break; + + case STT_SECTION: + if ((err = grub_efiemu_get_section_addr + (segs, sym->st_shndx, &handle, &off))) + { + grub_efiemu_elfsyms[i].handle = 0; + grub_efiemu_elfsyms[i].off = 0; + grub_errno = GRUB_ERR_NONE; + break; + } + + grub_efiemu_elfsyms[i].handle = handle; + grub_efiemu_elfsyms[i].off = off; + break; + + case STT_FILE: + grub_efiemu_elfsyms[i].handle = 0; + grub_efiemu_elfsyms[i].off = 0; + break; + + default: + return grub_error (GRUB_ERR_BAD_MODULE, + "unknown symbol type `%d'", (int) type); + } + } + + return GRUB_ERR_NONE; +} + +/* Load runtime to the memory and request memory for definitive location*/ +grub_err_t +SUFFIX (grub_efiemu_loadcore_init) (void *core, grub_size_t core_size, + grub_efiemu_segment_t *segments) +{ + Elf_Ehdr *e = (Elf_Ehdr *) core; + grub_err_t err; + + if (e->e_type != ET_REL) + return grub_error (GRUB_ERR_BAD_MODULE, "invalid ELF file type"); + + /* Make sure that every section is within the core. */ + if ((grub_size_t) core_size < e->e_shoff + e->e_shentsize * e->e_shnum) + return grub_error (GRUB_ERR_BAD_OS, "ELF sections outside core"); + + if ((err = grub_efiemu_init_segments (segments, core))) + return err; + if ((err = grub_efiemu_count_symbols (core))) + return err; + + grub_efiemu_request_symbols (1); + return GRUB_ERR_NONE; +} + +/* Load runtime definitively */ +grub_err_t +SUFFIX (grub_efiemu_loadcore_load) (void *core, + grub_size_t core_size + __attribute__ ((unused)), + grub_efiemu_segment_t segments) +{ + grub_err_t err; + if ((err = grub_efiemu_load_segments (segments, core))) + return err; + if ((err = grub_efiemu_resolve_symbols (segments, core))) + return err; + if ((err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments, + grub_efiemu_elfsyms, + core))) + return err; + + return GRUB_ERR_NONE; +} diff --git a/efiemu/loadcore32.c b/efiemu/loadcore32.c new file mode 100644 index 000000000..b4f61c794 --- /dev/null +++ b/efiemu/loadcore32.c @@ -0,0 +1,27 @@ +/* This file contains definitions so that loadcore.c compiles for 32-bit */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#define SUFFIX(x) x ## 32 +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define Elf_Word Elf32_Word +#define ELF_ST_TYPE ELF32_ST_TYPE +#define ELF_ST_BIND ELF32_ST_BIND +#include "loadcore.c" diff --git a/efiemu/loadcore64.c b/efiemu/loadcore64.c new file mode 100644 index 000000000..097276cc8 --- /dev/null +++ b/efiemu/loadcore64.c @@ -0,0 +1,27 @@ +/* This file contains definitions so that loadcore.c compiles for 64-bit */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#define SUFFIX(x) x ## 64 +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define Elf_Word Elf64_Word +#define ELF_ST_TYPE ELF64_ST_TYPE +#define ELF_ST_BIND ELF64_ST_BIND +#include "loadcore.c" diff --git a/efiemu/loadcore_common.c b/efiemu/loadcore_common.c new file mode 100644 index 000000000..9de1b39ad --- /dev/null +++ b/efiemu/loadcore_common.c @@ -0,0 +1,189 @@ +/* Load runtime image of EFIemu. Functions common to 32/64-bit mode */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +/* Are we in 32 or 64-bit mode?*/ +static grub_efiemu_mode_t grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; +/* Runtime ELF file */ +static grub_ssize_t efiemu_core_size; +static void *efiemu_core = 0; +/* Linked list of segments */ +static grub_efiemu_segment_t efiemu_segments = 0; + +/* equivalent to sizeof (grub_efi_uintn_t) but taking the mode into account*/ +int +grub_efiemu_sizeof_uintn_t (void) +{ + if (grub_efiemu_mode == GRUB_EFIEMU32) + return 4; + if (grub_efiemu_mode == GRUB_EFIEMU64) + return 8; + return 0; +} + +/* Check the header and set mode */ +static grub_err_t +grub_efiemu_check_header (void *ehdr, grub_size_t size, + grub_efiemu_mode_t *mode) +{ + /* Check the magic numbers. */ + if ((*mode == GRUB_EFIEMU_NOTLOADED || *mode == GRUB_EFIEMU32) + && grub_efiemu_check_header32 (ehdr,size)) + { + *mode = GRUB_EFIEMU32; + return GRUB_ERR_NONE; + } + if ((*mode == GRUB_EFIEMU_NOTLOADED || *mode == GRUB_EFIEMU64) + && grub_efiemu_check_header64 (ehdr,size)) + { + *mode = GRUB_EFIEMU64; + return GRUB_ERR_NONE; + } + return grub_error (GRUB_ERR_BAD_OS, "invalid ELF magic"); +} + +/* Unload segments */ +static int +grub_efiemu_unload_segs (grub_efiemu_segment_t seg) +{ + grub_efiemu_segment_t segn; + for (; seg; seg = segn) + { + segn = seg->next; + grub_efiemu_mm_return_request (seg->handle); + grub_free (seg); + } + return 1; +} + + +grub_err_t +grub_efiemu_loadcore_unload(void) +{ + switch (grub_efiemu_mode) + { + case GRUB_EFIEMU32: + grub_efiemu_loadcore_unload32 (); + break; + + case GRUB_EFIEMU64: + grub_efiemu_loadcore_unload64 (); + break; + + default: + break; + } + + grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; + + grub_free (efiemu_core); + efiemu_core = 0; + + grub_efiemu_unload_segs (efiemu_segments); + efiemu_segments = 0; + + grub_efiemu_free_syms (); + + return GRUB_ERR_NONE; +} + +/* Load runtime file and do some initial preparations */ +grub_err_t +grub_efiemu_loadcore_init (grub_file_t file) +{ + grub_err_t err; + + efiemu_core_size = grub_file_size (file); + efiemu_core = 0; + efiemu_core = grub_malloc (efiemu_core_size); + if (! efiemu_core) + return grub_errno; + + if (grub_file_read (file, efiemu_core, efiemu_core_size) + != (int) efiemu_core_size) + { + grub_free (efiemu_core); + efiemu_core = 0; + return grub_errno; + } + + if (grub_efiemu_check_header (efiemu_core, efiemu_core_size, + &grub_efiemu_mode)) + { + grub_free (efiemu_core); + efiemu_core = 0; + return GRUB_ERR_BAD_MODULE; + } + + switch (grub_efiemu_mode) + { + case GRUB_EFIEMU32: + if ((err = grub_efiemu_loadcore_init32 (efiemu_core, efiemu_core_size, + &efiemu_segments))) + { + grub_free (efiemu_core); + efiemu_core = 0; + grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; + return err; + } + break; + + case GRUB_EFIEMU64: + if ((err = grub_efiemu_loadcore_init64 (efiemu_core, efiemu_core_size, + &efiemu_segments))) + { + grub_free (efiemu_core); + efiemu_core = 0; + grub_efiemu_mode = GRUB_EFIEMU_NOTLOADED; + return err; + } + break; + + default: + return grub_error (GRUB_ERR_BAD_OS, "unknown EFI runtime"); + } + return GRUB_ERR_NONE; +} + +grub_err_t +grub_efiemu_loadcore_load (void) +{ + grub_err_t err; + switch (grub_efiemu_mode) + { + case GRUB_EFIEMU32: + if ((err = grub_efiemu_loadcore_load32 (efiemu_core, efiemu_core_size, + efiemu_segments))) + grub_efiemu_loadcore_unload (); + return err; + case GRUB_EFIEMU64: + if ((err = grub_efiemu_loadcore_load64 (efiemu_core, efiemu_core_size, + efiemu_segments))) + grub_efiemu_loadcore_unload (); + return err; + default: + return grub_error (GRUB_ERR_BAD_OS, "unknown EFI runtime"); + } +} diff --git a/efiemu/main.c b/efiemu/main.c new file mode 100644 index 000000000..c4144390e --- /dev/null +++ b/efiemu/main.c @@ -0,0 +1,345 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* This is an emulation of EFI runtime services. + This allows a more uniform boot on i386 machines. + As it emulates only runtime service it isn't able + to chainload EFI bootloader on non-EFI system. */ + + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* System table. Two version depending on mode */ +grub_efi_system_table32_t *grub_efiemu_system_table32 = 0; +grub_efi_system_table64_t *grub_efiemu_system_table64 = 0; +/* Modules may need to execute some actions after memory allocation happens */ +static struct grub_efiemu_prepare_hook *efiemu_prepare_hooks = 0; +/* Linked list of configuration tables */ +static struct grub_efiemu_configuration_table *efiemu_config_tables = 0; + +/* Free all allocated space */ +grub_err_t +grub_efiemu_unload (void) +{ + struct grub_efiemu_configuration_table *cur, *d; + struct grub_efiemu_prepare_hook *curhook, *d2; + grub_efiemu_loadcore_unload (); + + grub_efiemu_mm_unload (); + + for (cur = efiemu_config_tables; cur;) + { + d = cur->next; + if (cur->unload) + cur->unload (cur->data); + grub_free (cur); + cur = d; + } + efiemu_config_tables = 0; + + for (curhook = efiemu_prepare_hooks; curhook;) + { + d2 = curhook->next; + if (curhook->unload) + curhook->unload (curhook->data); + grub_free (curhook); + curhook = d2; + } + efiemu_prepare_hooks = 0; + + return GRUB_ERR_NONE; +} + +/* Remove previously registered table from the list */ +grub_err_t +grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid) +{ + struct grub_efiemu_configuration_table *cur, *prev; + + /* Special treating if head is to remove */ + while (efiemu_config_tables + && !grub_memcmp (&(efiemu_config_tables->guid), &guid, sizeof (guid))) + { + if (efiemu_config_tables->unload) + efiemu_config_tables->unload (efiemu_config_tables->data); + cur = efiemu_config_tables->next; + grub_free (efiemu_config_tables); + efiemu_config_tables = cur; + } + if (!efiemu_config_tables) + return GRUB_ERR_NONE; + + /* Remove from chain */ + for (prev = efiemu_config_tables, cur = prev->next; cur;) + if (grub_memcmp (&(cur->guid), &guid, sizeof (guid)) == 0) + { + if (cur->unload) + cur->unload (cur->data); + prev->next = cur->next; + grub_free (cur); + cur = prev->next; + } + else + { + prev = cur; + cur = cur->next; + } + return GRUB_ERR_NONE; +} + +grub_err_t +grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data), + void (*unload) (void *data), + void *data) +{ + struct grub_efiemu_prepare_hook *nhook; + if (! hook) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "you must supply the hook"); + nhook = (struct grub_efiemu_prepare_hook *) grub_malloc (sizeof (*nhook)); + if (! nhook) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't prepare hook"); + nhook->hook = hook; + nhook->unload = unload; + nhook->data = data; + nhook->next = efiemu_prepare_hooks; + efiemu_prepare_hooks = nhook; + return GRUB_ERR_NONE; +} + +/* Register a configuration table either supplying the address directly + or with a hook +*/ +grub_err_t +grub_efiemu_register_configuration_table (grub_efi_guid_t guid, + void * (*get_table) (void *data), + void (*unload) (void *data), + void *data) +{ + struct grub_efiemu_configuration_table *tbl; + grub_err_t err; + + if (! get_table && ! data) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "you must set at least get_table or data"); + if ((err = grub_efiemu_unregister_configuration_table (guid))) + return err; + + tbl = (struct grub_efiemu_configuration_table *) grub_malloc (sizeof (*tbl)); + if (! tbl) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't register table"); + + tbl->guid = guid; + tbl->get_table = get_table; + tbl->unload = unload; + tbl->data = data; + tbl->next = efiemu_config_tables; + efiemu_config_tables = tbl; + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_efiemu_unload (grub_command_t cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *args[] __attribute__ ((unused))) +{ + return grub_efiemu_unload (); +} + +static grub_err_t +grub_cmd_efiemu_prepare (grub_command_t cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *args[] __attribute__ ((unused))) +{ + return grub_efiemu_prepare (); +} + + + + +int +grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key + __attribute__ ((unused))) +{ + /* Nothing to do here yet */ + return 1; +} + +int +grub_efiemu_finish_boot_services (void) +{ + /* Nothing to do here yet */ + return 1; +} + +/* Load the runtime from the file FILENAME. */ +static grub_err_t +grub_efiemu_load_file (const char *filename) +{ + grub_file_t file; + grub_err_t err; + + file = grub_file_open (filename); + if (! file) + return 0; + + err = grub_efiemu_mm_init (); + if (err) + { + grub_file_close (file); + grub_efiemu_unload (); + return grub_error (grub_errno, "Couldn't init memory management"); + } + + grub_dprintf ("efiemu", "mm inited\n"); + + err = grub_efiemu_loadcore_init (file); + if (err) + { + grub_file_close (file); + grub_efiemu_unload (); + return err; + } + + grub_file_close (file); + + /* For configuration tables entry in system table. */ + grub_efiemu_request_symbols (1); + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_efiemu_autocore (void) +{ + const char *prefix; + char *filename; + char *suffix; + grub_err_t err; + + if (grub_efiemu_sizeof_uintn_t () != 0) + return GRUB_ERR_NONE; + + prefix = grub_env_get ("prefix"); + + if (! prefix) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, + "couldn't find efiemu core because prefix " + "isn't set"); + + suffix = grub_efiemu_get_default_core_name (); + + filename = grub_malloc (grub_strlen (prefix) + grub_strlen (suffix) + 2); + if (! filename) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate temporary space"); + + grub_sprintf (filename, "%s/%s", prefix, suffix); + + err = grub_efiemu_load_file (filename); + grub_free (filename); + if (err) + return err; +#ifndef GRUB_UTIL + err = grub_machine_efiemu_init_tables (); + if (err) + return err; +#endif + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_efiemu_prepare (void) +{ + grub_err_t err; + + grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n", + 8 * grub_efiemu_sizeof_uintn_t ()); + + err = grub_efiemu_autocore (); + + /* Create NVRAM if not yet done. */ + grub_efiemu_pnvram (); + + if (grub_efiemu_sizeof_uintn_t () == 4) + return grub_efiemu_prepare32 (efiemu_prepare_hooks, efiemu_config_tables); + else + return grub_efiemu_prepare64 (efiemu_prepare_hooks, efiemu_config_tables); +} + + +static grub_err_t +grub_cmd_efiemu_load (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_err_t err; + + grub_efiemu_unload (); + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "filename required"); + + err = grub_efiemu_load_file (args[0]); + if (err) + return err; +#ifndef GRUB_UTIL + err = grub_machine_efiemu_init_tables (); + if (err) + return err; +#endif + return GRUB_ERR_NONE; +} + +static grub_command_t cmd_loadcore, cmd_prepare, cmd_unload; + +void +grub_efiemu_pnvram_cmd_register (void); + +GRUB_MOD_INIT(efiemu) +{ + (void) mod; /* To stop warning. */ + cmd_loadcore = grub_register_command ("efiemu_loadcore", + grub_cmd_efiemu_load, + "efiemu_loadcore FILE", + "Load and initialize EFI emulator"); + cmd_prepare = grub_register_command ("efiemu_prepare", + grub_cmd_efiemu_prepare, + "efiemu_prepare", + "Finalize loading of EFI emulator"); + cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload, + "efiemu_unload", + "Unload EFI emulator"); + grub_efiemu_pnvram_cmd_register (); +} + +GRUB_MOD_FINI(efiemu) +{ + grub_unregister_command (cmd_loadcore); + grub_unregister_command (cmd_prepare); + grub_unregister_command (cmd_unload); + grub_efiemu_pnvram_cmd_unregister (); +} diff --git a/efiemu/mm.c b/efiemu/mm.c new file mode 100644 index 000000000..e0364e699 --- /dev/null +++ b/efiemu/mm.c @@ -0,0 +1,635 @@ +/* Memory management for efiemu */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +/* + To keep efiemu runtime contiguous this mm is special. + It uses deffered allocation. + In the first stage you may request memory with grub_efiemu_request_memalign + It will give you a handle with which in the second phase you can access your + memory with grub_efiemu_mm_obtain_request (handle). It's guaranteed that + subsequent calls with the same handle return the same result. You can't request any additional memory once you're in the second phase +*/ + +#include +#include +#include +#include +#include +#include + +struct grub_efiemu_memrequest +{ + struct grub_efiemu_memrequest *next; + grub_efi_memory_type_t type; + grub_size_t size; + grub_size_t align_overhead; + int handle; + void *val; +}; +/* Linked list of requested memory. */ +static struct grub_efiemu_memrequest *memrequests = 0; +/* Memory map. */ +static grub_efi_memory_descriptor_t *efiemu_mmap = 0; +/* Pointer to allocated memory */ +static void *resident_memory = 0; +/* Size of requested memory per type */ +static grub_size_t requested_memory[GRUB_EFI_MAX_MEMORY_TYPE]; +/* How many slots is allocated for memory_map and how many are already used */ +static int mmap_reserved_size = 0, mmap_num = 0; + +/* Add a memory region to map*/ +static grub_err_t +grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, + grub_efi_memory_type_t type) +{ + grub_uint64_t page_start, npages; + + /* Extend map if necessary*/ + if (mmap_num >= mmap_reserved_size) + { + efiemu_mmap = (grub_efi_memory_descriptor_t *) + grub_realloc (efiemu_mmap, (++mmap_reserved_size) + * sizeof (grub_efi_memory_descriptor_t)); + if (!efiemu_mmap) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Not enough space for memory map"); + } + + /* Fill slot*/ + page_start = start - (start % GRUB_EFIEMU_PAGESIZE); + npages = (size + (start % GRUB_EFIEMU_PAGESIZE) + GRUB_EFIEMU_PAGESIZE - 1) + / GRUB_EFIEMU_PAGESIZE; + efiemu_mmap[mmap_num].physical_start = page_start; + efiemu_mmap[mmap_num].virtual_start = page_start; + efiemu_mmap[mmap_num].num_pages = npages; + efiemu_mmap[mmap_num].type = type; + mmap_num++; + + return GRUB_ERR_NONE; +} + +/* Request a resident memory of type TYPE of size SIZE aligned at ALIGN + ALIGN must be a divisor of page size (if it's a divisor of 4096 + it should be ok on all platforms) + */ +int +grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, + grub_efi_memory_type_t type) +{ + grub_size_t align_overhead; + struct grub_efiemu_memrequest *ret, *cur, *prev; + /* Check that the request is correct */ + if (type >= GRUB_EFI_MAX_MEMORY_TYPE || type <= GRUB_EFI_LOADER_CODE) + return -2; + + /* Add new size to requested size */ + align_overhead = align - (requested_memory[type]%align); + if (align_overhead == align) + align_overhead = 0; + requested_memory[type] += align_overhead + size; + + /* Remember the request */ + ret = grub_malloc (sizeof (*ret)); + if (!ret) + return -1; + ret->type = type; + ret->size = size; + ret->align_overhead = align_overhead; + ret->val = 0; + ret->next = 0; + prev = 0; + + /* Add request to the end of the chain. + It should be at the end because otherwise alignment isn't guaranteed */ + for (cur = memrequests; cur; prev = cur, cur = cur->next); + if (prev) + { + ret->handle = prev->handle + 1; + prev->next = ret; + } + else + { + ret->handle = 1; /* Avoid 0 handle*/ + memrequests = ret; + } + return ret->handle; +} + +/* Really allocate the memory */ +static grub_err_t +efiemu_alloc_requests (void) +{ + grub_size_t align_overhead = 0; + grub_uint8_t *curptr, *typestart; + struct grub_efiemu_memrequest *cur; + grub_size_t total_alloc = 0; + unsigned i; + /* Order of memory regions */ + grub_efi_memory_type_t reqorder[] = + { + /* First come regions usable by OS*/ + GRUB_EFI_LOADER_CODE, + GRUB_EFI_LOADER_DATA, + GRUB_EFI_BOOT_SERVICES_CODE, + GRUB_EFI_BOOT_SERVICES_DATA, + GRUB_EFI_CONVENTIONAL_MEMORY, + GRUB_EFI_ACPI_RECLAIM_MEMORY, + + /* Then memory used by runtime */ + /* This way all our regions are in a single block */ + GRUB_EFI_RUNTIME_SERVICES_CODE, + GRUB_EFI_RUNTIME_SERVICES_DATA, + GRUB_EFI_ACPI_MEMORY_NVS, + + /* And then unavailable memory types. This is more for a completeness. + You should double think before allocating memory of any of these types + */ + GRUB_EFI_UNUSABLE_MEMORY, + GRUB_EFI_MEMORY_MAPPED_IO, + GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, + GRUB_EFI_PAL_CODE + }; + + /* Compute total memory needed */ + for (i = 0; i < sizeof (reqorder) / sizeof (reqorder[0]); i++) + { + align_overhead = GRUB_EFIEMU_PAGESIZE + - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE); + if (align_overhead == GRUB_EFIEMU_PAGESIZE) + align_overhead = 0; + total_alloc += requested_memory[reqorder[i]] + align_overhead; + } + + /* Allocate the whole memory in one block */ + resident_memory = grub_memalign (GRUB_EFIEMU_PAGESIZE, total_alloc); + if (!resident_memory) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate resident memory"); + + /* Split the memory into blocks by type */ + curptr = resident_memory; + for (i = 0; i < sizeof (reqorder) / sizeof (reqorder[0]); i++) + { + if (!requested_memory[reqorder[i]]) + continue; + typestart = curptr; + + /* Write pointers to requests */ + for (cur = memrequests; cur; cur = cur->next) + if (cur->type == reqorder[i]) + { + curptr = ((grub_uint8_t *)curptr) + cur->align_overhead; + cur->val = curptr; + curptr = ((grub_uint8_t *)curptr) + cur->size; + } + + /* Ensure that the regions are page-aligned */ + align_overhead = GRUB_EFIEMU_PAGESIZE + - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE); + if (align_overhead == GRUB_EFIEMU_PAGESIZE) + align_overhead = 0; + curptr = ((grub_uint8_t *)curptr) + align_overhead; + + /* Add the region to memory map */ + grub_efiemu_add_to_mmap (PTR_TO_UINT64 (typestart), + curptr - typestart, reqorder[i]); + } + + return GRUB_ERR_NONE; +} + +/* Get a pointer to requested memory from handle */ +void * +grub_efiemu_mm_obtain_request (int handle) +{ + struct grub_efiemu_memrequest *cur; + for (cur = memrequests; cur; cur = cur->next) + if (cur->handle == handle) + return cur->val; + return 0; +} + +/* Get type of requested memory by handle */ +grub_efi_memory_type_t +grub_efiemu_mm_get_type (int handle) +{ + struct grub_efiemu_memrequest *cur; + for (cur = memrequests; cur; cur = cur->next) + if (cur->handle == handle) + return cur->type; + return 0; +} + +/* Free a request */ +void +grub_efiemu_mm_return_request (int handle) +{ + struct grub_efiemu_memrequest *cur, *prev; + + /* Remove head if necessary */ + while (memrequests && memrequests->handle == handle) + { + cur = memrequests->next; + grub_free (memrequests); + memrequests = cur; + } + if (!memrequests) + return; + + /* Remove request from a middle of chain*/ + for (prev = memrequests, cur = prev->next; cur;) + if (cur->handle == handle) + { + prev->next = cur->next; + grub_free (cur); + cur = prev->next; + } + else + { + prev = cur; + cur = prev->next; + } +} + +/* Reserve space for memory map */ +static grub_err_t +grub_efiemu_mmap_init (void) +{ + auto int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t, grub_uint64_t, + grub_uint32_t); + int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t addr __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + grub_uint32_t type __attribute__ ((unused))) + { + mmap_reserved_size++; + return 0; + } + + // the place for memory used by efiemu itself + mmap_reserved_size = GRUB_EFI_MAX_MEMORY_TYPE + 1; + +#ifndef GRUB_UTIL + grub_machine_mmap_iterate (bounds_hook); +#endif + + return GRUB_ERR_NONE; +} + +/* This is a drop-in replacement of grub_efi_get_memory_map */ +/* Get the memory map as defined in the EFI spec. Return 1 if successful, + return 0 if partial, or return -1 if an error occurs. */ +int +grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, + grub_efi_memory_descriptor_t *memory_map, + grub_efi_uintn_t *map_key, + grub_efi_uintn_t *descriptor_size, + grub_efi_uint32_t *descriptor_version) +{ + if (!efiemu_mmap) + { + grub_error (GRUB_ERR_INVALID_COMMAND, + "you need to first launch efiemu_prepare"); + return -1; + } + + if (*memory_map_size < mmap_num * sizeof (grub_efi_memory_descriptor_t)) + { + *memory_map_size = mmap_num * sizeof (grub_efi_memory_descriptor_t); + return 0; + } + + *memory_map_size = mmap_num * sizeof (grub_efi_memory_descriptor_t); + grub_memcpy (memory_map, efiemu_mmap, *memory_map_size); + if (descriptor_size) + *descriptor_size = sizeof (grub_efi_memory_descriptor_t); + if (descriptor_version) + *descriptor_version = 1; + if (map_key) + *map_key = 0; + + return 1; +} + +/* Free everything */ +grub_err_t +grub_efiemu_mm_unload (void) +{ + struct grub_efiemu_memrequest *cur, *d; + for (cur = memrequests; cur;) + { + d = cur->next; + grub_free (cur); + cur = d; + } + memrequests = 0; + grub_memset (&requested_memory, 0, sizeof (requested_memory)); + grub_free (resident_memory); + resident_memory = 0; + grub_free (efiemu_mmap); + efiemu_mmap = 0; + mmap_reserved_size = mmap_num = 0; + return GRUB_ERR_NONE; +} + +/* This function should be called before doing any requests */ +grub_err_t +grub_efiemu_mm_init (void) +{ + grub_err_t err; + + err = grub_efiemu_mm_unload (); + if (err) + return err; + + grub_efiemu_mmap_init (); + + return GRUB_ERR_NONE; +} + +/* Copy host memory map */ +static grub_err_t +grub_efiemu_mmap_fill (void) +{ + auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, + grub_uint64_t size, + grub_uint32_t type) + { + switch (type) + { + case GRUB_MACHINE_MEMORY_AVAILABLE: + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_CONVENTIONAL_MEMORY); + +#ifdef GRUB_MACHINE_MEMORY_ACPI + case GRUB_MACHINE_MEMORY_ACPI: + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_ACPI_RECLAIM_MEMORY); +#endif + +#ifdef GRUB_MACHINE_MEMORY_NVS + case GRUB_MACHINE_MEMORY_NVS: + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_ACPI_MEMORY_NVS); +#endif + + default: + grub_printf ("Unknown memory type %d. Marking as unusable\n", type); + case GRUB_MACHINE_MEMORY_RESERVED: + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_UNUSABLE_MEMORY); + } + } + +#ifndef GRUB_UTIL + grub_machine_mmap_iterate (fill_hook); +#endif + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, + grub_uint32_t)) +{ + unsigned i; + + for (i = 0; i < (unsigned) mmap_num; i++) + switch (efiemu_mmap[i].type) + { + case GRUB_EFI_RUNTIME_SERVICES_CODE: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_EFIEMU_MEMORY_CODE); + break; + + case GRUB_EFI_RESERVED_MEMORY_TYPE: + case GRUB_EFI_RUNTIME_SERVICES_DATA: + case GRUB_EFI_UNUSABLE_MEMORY: + case GRUB_EFI_MEMORY_MAPPED_IO: + case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: + case GRUB_EFI_PAL_CODE: + case GRUB_EFI_MAX_MEMORY_TYPE: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_EFIEMU_MEMORY_RESERVED); + break; + + case GRUB_EFI_LOADER_CODE: + case GRUB_EFI_LOADER_DATA: + case GRUB_EFI_BOOT_SERVICES_CODE: + case GRUB_EFI_BOOT_SERVICES_DATA: + case GRUB_EFI_CONVENTIONAL_MEMORY: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_EFIEMU_MEMORY_AVAILABLE); + break; + + case GRUB_EFI_ACPI_RECLAIM_MEMORY: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_EFIEMU_MEMORY_ACPI); + break; + + case GRUB_EFI_ACPI_MEMORY_NVS: + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + GRUB_EFIEMU_MEMORY_NVS); + break; + } + + return 0; +} + + +/* This function resolves overlapping regions and sorts the memory map + It uses scanline (sweeping) algorithm + */ +static grub_err_t +grub_efiemu_mmap_sort_and_uniq (void) +{ + /* If same page is used by multiple types it's resolved + according to priority + 0 - free memory + 1 - memory immediately usable after ExitBootServices + 2 - memory usable after loading ACPI tables + 3 - efiemu memory + 4 - unusable memory + */ + int priority[GRUB_EFI_MAX_MEMORY_TYPE] = + { + [GRUB_EFI_RESERVED_MEMORY_TYPE] = 4, + [GRUB_EFI_LOADER_CODE] = 1, + [GRUB_EFI_LOADER_DATA] = 1, + [GRUB_EFI_BOOT_SERVICES_CODE] = 1, + [GRUB_EFI_BOOT_SERVICES_DATA] = 1, + [GRUB_EFI_RUNTIME_SERVICES_CODE] = 3, + [GRUB_EFI_RUNTIME_SERVICES_DATA] = 3, + [GRUB_EFI_CONVENTIONAL_MEMORY] = 0, + [GRUB_EFI_UNUSABLE_MEMORY] = 4, + [GRUB_EFI_ACPI_RECLAIM_MEMORY] = 2, + [GRUB_EFI_ACPI_MEMORY_NVS] = 3, + [GRUB_EFI_MEMORY_MAPPED_IO] = 4, + [GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE] = 4, + [GRUB_EFI_PAL_CODE] = 4 + }; + + int i, j, k, done; + + /* Scanline events */ + struct grub_efiemu_mmap_scan + { + /* At which memory address*/ + grub_uint64_t pos; + /* 0 = region starts, 1 = region ends */ + int type; + /* Which type of memory region */ + grub_efi_memory_type_t memtype; + }; + struct grub_efiemu_mmap_scan *scanline_events; + struct grub_efiemu_mmap_scan t; + + /* Previous scanline event */ + grub_uint64_t lastaddr; + int lasttype; + /* Current scanline event */ + int curtype; + /* how many regions of given type overlap at current location */ + int present[GRUB_EFI_MAX_MEMORY_TYPE]; + /* Here is stored the resulting memory map*/ + grub_efi_memory_descriptor_t *result; + + /* Initialize variables*/ + grub_memset (present, 0, sizeof (int) * GRUB_EFI_MAX_MEMORY_TYPE); + scanline_events = (struct grub_efiemu_mmap_scan *) + grub_malloc (sizeof (struct grub_efiemu_mmap_scan) * 2 * mmap_num); + + /* Number of chunks can't increase more than by factor of 2 */ + result = (grub_efi_memory_descriptor_t *) + grub_malloc (sizeof (grub_efi_memory_descriptor_t) * 2 * mmap_num); + if (!result || !scanline_events) + { + grub_free (result); + grub_free (scanline_events); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate space for new memory map"); + } + + /* Register scanline events */ + for (i = 0; i < mmap_num; i++) + { + scanline_events[2 * i].pos = efiemu_mmap[i].physical_start; + scanline_events[2 * i].type = 0; + scanline_events[2 * i].memtype = efiemu_mmap[i].type; + scanline_events[2 * i + 1].pos = efiemu_mmap[i].physical_start + + efiemu_mmap[i].num_pages * GRUB_EFIEMU_PAGESIZE; + scanline_events[2 * i + 1].type = 1; + scanline_events[2 * i + 1].memtype = efiemu_mmap[i].type; + } + + /* Primitive bubble sort. It has complexity O(n^2) but since we're + unlikely to have more than 100 chunks it's probably one of the + fastest for one purpose */ + done = 1; + while (done) + { + done = 0; + for (i = 0; i < 2 * mmap_num - 1; i++) + if (scanline_events[i + 1].pos < scanline_events[i].pos) + { + t = scanline_events[i + 1]; + scanline_events[i + 1] = scanline_events[i]; + scanline_events[i] = t; + done = 1; + } + } + + /* Pointer in resulting memory map */ + j = 0; + lastaddr = scanline_events[0].pos; + lasttype = scanline_events[0].memtype; + for (i = 0; i < 2 * mmap_num; i++) + { + /* Process event */ + if (scanline_events[i].type) + present[scanline_events[i].memtype]--; + else + present[scanline_events[i].memtype]++; + + /* Determine current region type */ + curtype = -1; + for (k = 0; k < GRUB_EFI_MAX_MEMORY_TYPE; k++) + if (present[k] && (curtype == -1 || priority[k] > priority[curtype])) + curtype = k; + + /* Add memory region to resulting map if necessary */ + if ((curtype == -1 || curtype != lasttype) + && lastaddr != scanline_events[i].pos + && lasttype != -1) + { + result[j].virtual_start = result[j].physical_start = lastaddr; + result[j].num_pages = (scanline_events[i].pos - lastaddr) + / GRUB_EFIEMU_PAGESIZE; + result[j].type = lasttype; + + /* We set runtime attribute on pages we need to be mapped */ + result[j].attribute + = (lasttype == GRUB_EFI_RUNTIME_SERVICES_CODE + || lasttype == GRUB_EFI_RUNTIME_SERVICES_DATA) + ? GRUB_EFI_MEMORY_RUNTIME : 0; + grub_dprintf ("efiemu", + "mmap entry: type %d start 0x%llx 0x%llx pages\n", + result[j].type, + result[j].physical_start, result[j].num_pages); + j++; + } + + /* Update last values if necessary */ + if (curtype == -1 || curtype != lasttype) + { + lasttype = curtype; + lastaddr = scanline_events[i].pos; + } + } + + grub_free (scanline_events); + + /* Shrink resulting memory map to really used size and replace efiemu_mmap + by new value */ + grub_free (efiemu_mmap); + efiemu_mmap = grub_realloc (result, j * sizeof (*result)); + return GRUB_ERR_NONE; +} + +/* This function is called to switch from first to second phase */ +grub_err_t +grub_efiemu_mm_do_alloc (void) +{ + grub_err_t err; + + /* Preallocate mmap */ + efiemu_mmap = (grub_efi_memory_descriptor_t *) + grub_malloc (mmap_reserved_size * sizeof (grub_efi_memory_descriptor_t)); + if (!efiemu_mmap) + { + grub_efiemu_unload (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't initilaize mmap"); + } + + if ((err = efiemu_alloc_requests ())) + return err; + if ((err = grub_efiemu_mmap_fill ())) + return err; + return grub_efiemu_mmap_sort_and_uniq (); +} diff --git a/efiemu/pnvram.c b/efiemu/pnvram.c new file mode 100644 index 000000000..0cc0eb85e --- /dev/null +++ b/efiemu/pnvram.c @@ -0,0 +1,402 @@ +/* Export pnvram and some variables for runtime */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Place for final location of variables */ +static int nvram_handle = 0; +static int nvramsize_handle = 0; +static int high_monotonic_count_handle = 0; +static int timezone_handle = 0; +static int accuracy_handle = 0; +static int daylight_handle = 0; + +/* Temporary place */ +static grub_uint8_t *nvram; +static grub_size_t nvramsize; +static grub_uint32_t high_monotonic_count; +static grub_int16_t timezone; +static grub_uint8_t daylight; +static grub_uint32_t accuracy; + +static const struct grub_arg_option options[] = { + {"size", 's', 0, "number of bytes to reserve for pseudo NVRAM", 0, + ARG_TYPE_INT}, + {"high-monotonic-count", 'm', 0, + "Initial value of high monotonic count", 0, ARG_TYPE_INT}, + {"timezone", 't', 0, + "Timezone, offset in minutes from GMT", 0, ARG_TYPE_INT}, + {"accuracy", 'a', 0, + "Accuracy of clock, in 1e-12 units", 0, ARG_TYPE_INT}, + {"daylight", 'd', 0, + "Daylight value, as per EFI specifications", 0, ARG_TYPE_INT}, + {0, 0, 0, 0, 0, 0} +}; + +/* Parse signed value */ +static int +grub_strtosl (char *arg, char **end, int base) +{ + if (arg[0] == '-') + return -grub_strtoul (arg + 1, end, base); + return grub_strtoul (arg, end, base); +} + +/* Export stuff for efiemu */ +static grub_err_t +nvram_set (void * data __attribute__ ((unused))) +{ + /* Take definitive pointers */ + grub_uint8_t *nvram_def = grub_efiemu_mm_obtain_request (nvram_handle); + grub_uint32_t *nvramsize_def + = grub_efiemu_mm_obtain_request (nvramsize_handle); + grub_uint32_t *high_monotonic_count_def + = grub_efiemu_mm_obtain_request (high_monotonic_count_handle); + grub_int16_t *timezone_def + = grub_efiemu_mm_obtain_request (timezone_handle); + grub_uint8_t *daylight_def + = grub_efiemu_mm_obtain_request (daylight_handle); + grub_uint32_t *accuracy_def + = grub_efiemu_mm_obtain_request (accuracy_handle); + + /* Copy to definitive loaction */ + grub_dprintf ("efiemu", "preparing pnvram\n"); + grub_memcpy (nvram_def, nvram, nvramsize); + *nvramsize_def = nvramsize; + *high_monotonic_count_def = high_monotonic_count; + *timezone_def = timezone; + *daylight_def = daylight; + *accuracy_def = accuracy; + + /* Register symbols */ + grub_efiemu_register_symbol ("efiemu_variables", nvram_handle, 0); + grub_efiemu_register_symbol ("efiemu_varsize", nvramsize_handle, 0); + grub_efiemu_register_symbol ("efiemu_high_monotonic_count", + high_monotonic_count_handle, 0); + grub_efiemu_register_symbol ("efiemu_time_zone", timezone_handle, 0); + grub_efiemu_register_symbol ("efiemu_time_daylight", daylight_handle, 0); + grub_efiemu_register_symbol ("efiemu_time_accuracy", + accuracy_handle, 0); + + return GRUB_ERR_NONE; +} + +static void +nvram_unload (void * data __attribute__ ((unused))) +{ + grub_efiemu_mm_return_request (nvram_handle); + grub_efiemu_mm_return_request (nvramsize_handle); + grub_efiemu_mm_return_request (high_monotonic_count_handle); + grub_efiemu_mm_return_request (timezone_handle); + grub_efiemu_mm_return_request (accuracy_handle); + grub_efiemu_mm_return_request (daylight_handle); + + grub_free (nvram); + nvram = 0; +} + +/* Load the variables file It's in format + guid1:attr1:name1:data1; + guid2:attr2:name2:data2; + ... + Where all fields are in hex +*/ +static grub_err_t +read_pnvram (char *filename) +{ + char *buf, *ptr, *ptr2; + grub_file_t file; + grub_size_t size; + grub_uint8_t *nvramptr = nvram; + struct efi_variable *efivar; + grub_size_t guidlen, datalen; + unsigned i, j; + + file = grub_file_open (filename); + if (!file) + return grub_error (GRUB_ERR_BAD_OS, "couldn't read pnvram"); + size = grub_file_size (file); + buf = grub_malloc (size + 1); + if (!buf) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't read pnvram"); + if (grub_file_read (file, buf, size) != (grub_ssize_t) size) + return grub_error (GRUB_ERR_BAD_OS, "couldn't read pnvram"); + buf[size] = 0; + grub_file_close (file); + + for (ptr = buf; *ptr; ) + { + if (grub_isspace (*ptr)) + { + ptr++; + continue; + } + + efivar = (struct efi_variable *) nvramptr; + if (nvramptr - nvram + sizeof (struct efi_variable) > nvramsize) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "file is too large for reserved variable space"); + + nvramptr += sizeof (struct efi_variable); + + /* look ahow long guid field is*/ + guidlen = 0; + for (ptr2 = ptr; (grub_isspace (*ptr2) + || (*ptr2 >= '0' && *ptr2 <= '9') + || (*ptr2 >= 'a' && *ptr2 <= 'f') + || (*ptr2 >= 'A' && *ptr2 <= 'F')); + ptr2++) + if (!grub_isspace (*ptr2)) + guidlen++; + guidlen /= 2; + + /* Read guid */ + if (guidlen != sizeof (efivar->guid)) + { + grub_free (buf); + return grub_error (GRUB_ERR_BAD_OS, "can't parse %s", filename); + } + for (i = 0; i < 2 * sizeof (efivar->guid); i++) + { + int hex = 0; + while (grub_isspace (*ptr)) + ptr++; + if (*ptr >= '0' && *ptr <= '9') + hex = *ptr - '0'; + if (*ptr >= 'a' && *ptr <= 'f') + hex = *ptr - 'a' + 10; + if (*ptr >= 'A' && *ptr <= 'F') + hex = *ptr - 'A' + 10; + + if (i%2 == 0) + ((grub_uint8_t *)&(efivar->guid))[i/2] = hex << 4; + else + ((grub_uint8_t *)&(efivar->guid))[i/2] |= hex; + ptr++; + } + + while (grub_isspace (*ptr)) + ptr++; + if (*ptr != ':') + { + grub_dprintf ("efiemu", "Not colon\n"); + grub_free (buf); + return grub_error (GRUB_ERR_BAD_OS, "can't parse %s", filename); + } + ptr++; + while (grub_isspace (*ptr)) + ptr++; + + /* Attributes can be just parsed by existing functions */ + efivar->attributes = grub_strtoul (ptr, &ptr, 16); + + while (grub_isspace (*ptr)) + ptr++; + if (*ptr != ':') + { + grub_dprintf ("efiemu", "Not colon\n"); + grub_free (buf); + return grub_error (GRUB_ERR_BAD_OS, "can't parse %s", filename); + } + ptr++; + while (grub_isspace (*ptr)) + ptr++; + + /* Read name and value */ + for (j = 0; j < 2; j++) + { + /* Look the length */ + datalen = 0; + for (ptr2 = ptr; *ptr2 && (grub_isspace (*ptr2) + || (*ptr2 >= '0' && *ptr2 <= '9') + || (*ptr2 >= 'a' && *ptr2 <= 'f') + || (*ptr2 >= 'A' && *ptr2 <= 'F')); + ptr2++) + if (!grub_isspace (*ptr2)) + datalen++; + datalen /= 2; + + if (nvramptr - nvram + datalen > nvramsize) + { + grub_free (buf); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "file is too large for reserved " + " variable space"); + } + + for (i = 0; i < 2 * datalen; i++) + { + int hex = 0; + while (grub_isspace (*ptr)) + ptr++; + if (*ptr >= '0' && *ptr <= '9') + hex = *ptr - '0'; + if (*ptr >= 'a' && *ptr <= 'f') + hex = *ptr - 'a' + 10; + if (*ptr >= 'A' && *ptr <= 'F') + hex = *ptr - 'A' + 10; + + if (i%2 == 0) + nvramptr[i/2] = hex << 4; + else + nvramptr[i/2] |= hex; + ptr++; + } + nvramptr += datalen; + while (grub_isspace (*ptr)) + ptr++; + if (*ptr != (j ? ';' : ':')) + { + grub_free (buf); + grub_dprintf ("efiemu", j?"Not semicolon\n":"Not colon\n"); + return grub_error (GRUB_ERR_BAD_OS, "can't parse %s", filename); + } + if (j) + efivar->size = datalen; + else + efivar->namelen = datalen; + + ptr++; + } + } + grub_free (buf); + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_efiemu_make_nvram (void) +{ + grub_err_t err; + + err = grub_efiemu_autocore (); + if (err) + { + grub_free (nvram); + return err; + } + + err = grub_efiemu_register_prepare_hook (nvram_set, nvram_unload, 0); + if (err) + { + grub_free (nvram); + return err; + } + nvram_handle + = grub_efiemu_request_memalign (1, nvramsize, + GRUB_EFI_RUNTIME_SERVICES_DATA); + nvramsize_handle + = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), + GRUB_EFI_RUNTIME_SERVICES_DATA); + high_monotonic_count_handle + = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), + GRUB_EFI_RUNTIME_SERVICES_DATA); + timezone_handle + = grub_efiemu_request_memalign (1, sizeof (grub_uint16_t), + GRUB_EFI_RUNTIME_SERVICES_DATA); + daylight_handle + = grub_efiemu_request_memalign (1, sizeof (grub_uint8_t), + GRUB_EFI_RUNTIME_SERVICES_DATA); + accuracy_handle + = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), + GRUB_EFI_RUNTIME_SERVICES_DATA); + + grub_efiemu_request_symbols (6); + return GRUB_ERR_NONE; +} + +grub_err_t +grub_efiemu_pnvram (void) +{ + if (nvram) + return GRUB_ERR_NONE; + + nvramsize = 2048; + high_monotonic_count = 1; + timezone = GRUB_EFI_UNSPECIFIED_TIMEZONE; + accuracy = 50000000; + daylight = 0; + + nvram = grub_malloc (nvramsize); + if (!nvram) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Couldn't allocate space for temporary pnvram storage"); + grub_memset (nvram, 0, nvramsize); + + return grub_efiemu_make_nvram (); +} + +static grub_err_t +grub_cmd_efiemu_pnvram (struct grub_extcmd *cmd, + int argc, char **args) +{ + struct grub_arg_list *state = cmd->state; + grub_err_t err; + + if (argc > 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "only one argument expected"); + + nvramsize = state[0].set ? grub_strtoul (state[0].arg, 0, 0) : 2048; + high_monotonic_count = state[1].set ? grub_strtoul (state[1].arg, 0, 0) : 1; + timezone = state[2].set ? grub_strtosl (state[2].arg, 0, 0) + : GRUB_EFI_UNSPECIFIED_TIMEZONE; + accuracy = state[3].set ? grub_strtoul (state[3].arg, 0, 0) : 50000000; + daylight = state[4].set ? grub_strtoul (state[4].arg, 0, 0) : 0; + + nvram = grub_malloc (nvramsize); + if (!nvram) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Couldn't allocate space for temporary pnvram storage"); + grub_memset (nvram, 0, nvramsize); + + if (argc == 1 && (err = read_pnvram (args[0]))) + { + grub_free (nvram); + return err; + } + return grub_efiemu_make_nvram (); +} + +static grub_extcmd_t cmd; + +void grub_efiemu_pnvram_cmd_register (void); +void grub_efiemu_pnvram_cmd_unregister (void); + +void +grub_efiemu_pnvram_cmd_register (void) +{ + cmd = grub_register_extcmd ("efiemu_pnvram", grub_cmd_efiemu_pnvram, + GRUB_COMMAND_FLAG_BOTH, + "efiemu_pnvram [FILENAME]", + "Initialise pseudo-NVRAM and load variables " + "from FILE", + options); +} + +void +grub_efiemu_pnvram_cmd_unregister (void) +{ + grub_unregister_extcmd (cmd); +} diff --git a/efiemu/prepare.c b/efiemu/prepare.c new file mode 100644 index 000000000..d0787293f --- /dev/null +++ b/efiemu/prepare.c @@ -0,0 +1,127 @@ +/* Prepare efiemu. E.g. allocate memory, load the runtime + to appropriate place, etc */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +grub_err_t +SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, + struct grub_efiemu_configuration_table + *config_tables) +{ + grub_err_t err; + int conftable_handle; + struct grub_efiemu_configuration_table *cur; + struct grub_efiemu_prepare_hook *curhook; + + int cntconftables = 0; + TYPE (grub_efiemu_configuration_table) *conftables = 0; + TYPE (grub_efiemu_runtime_services) *runtime_services; + int i; + int handle; + grub_off_t off; + + grub_dprintf ("efiemu", "Preparing EfiEmu\n"); + + /* Request space for the list of configuration tables */ + for (cur = config_tables; cur; cur = cur->next) + cntconftables++; + conftable_handle + = grub_efiemu_request_memalign (GRUB_EFIEMU_PAGESIZE, + cntconftables * sizeof (*conftables), + GRUB_EFI_RUNTIME_SERVICES_DATA); + + /* Switch from phase 1 (counting) to phase 2 (real job) */ + grub_efiemu_alloc_syms (); + grub_efiemu_mm_do_alloc (); + + grub_efiemu_system_table32 = 0; + grub_efiemu_system_table64 = 0; + + /* Execute hooks */ + for (curhook = prepare_hooks; curhook; curhook = curhook->next) + curhook->hook (curhook->data); + + /* Move runtime to its due place */ + if ((err = grub_efiemu_loadcore_load ())) + { + grub_efiemu_unload (); + return err; + } + + if ((err = grub_efiemu_resolve_symbol ("efiemu_system_table", + &handle, &off))) + { + grub_efiemu_unload (); + return err; + } + + SUFFIX (grub_efiemu_system_table) + = (TYPE (grub_efi_system_table) *) + ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); + + /* compute CRC32 of runtime_services */ + if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", + &handle, &off))) + return err; + runtime_services = (TYPE (grub_efiemu_runtime_services) *) + ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); + runtime_services->hdr.crc32 = 0; + runtime_services->hdr.crc32 = grub_getcrc32 + (0, runtime_services, runtime_services->hdr.header_size); + + /* Put pointer to the list of configuration tables in system table */ + grub_efiemu_write_value + (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, + conftable_handle, 0, 1, + sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table)); + SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables; + + /* Fill the list of configuration tables */ + conftables = (TYPE (grub_efiemu_configuration_table) *) + grub_efiemu_mm_obtain_request (conftable_handle); + i = 0; + for (cur = config_tables; cur; cur = cur->next, i++) + { + grub_memcpy (&(conftables[i].vendor_guid), &(cur->guid), + sizeof (cur->guid)); + if (cur->get_table) + conftables[i].vendor_table + = PTR_TO_UINT64 (cur->get_table (cur->data)); + else + conftables[i].vendor_table = PTR_TO_UINT64 (cur->data); + } + + /* compute CRC32 of system table */ + SUFFIX (grub_efiemu_system_table)->hdr.crc32 = 0; + SUFFIX (grub_efiemu_system_table)->hdr.crc32 + = grub_getcrc32 (0, SUFFIX (grub_efiemu_system_table), + SUFFIX (grub_efiemu_system_table)->hdr.header_size); + + grub_dprintf ("efiemu","system_table = %p, runtime_services = %p," + " conftables = %p (%d entries)\n", + SUFFIX (grub_efiemu_system_table), runtime_services, + conftables, cntconftables); + + return GRUB_ERR_NONE; +} diff --git a/efiemu/prepare32.c b/efiemu/prepare32.c new file mode 100644 index 000000000..48c177f98 --- /dev/null +++ b/efiemu/prepare32.c @@ -0,0 +1,23 @@ +/* This file contains definitions so that prepare.c compiles for 32-bit */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#define SUFFIX(x) x ## 32 +#define TYPE(x) x ## 32_t + +#include "prepare.c" diff --git a/efiemu/prepare64.c b/efiemu/prepare64.c new file mode 100644 index 000000000..f1399bdfb --- /dev/null +++ b/efiemu/prepare64.c @@ -0,0 +1,23 @@ +/* This file contains definitions so that prepare.c compiles for 64-bit */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#define SUFFIX(x) x ## 64 +#define TYPE(x) x ## 64_t + +#include "prepare.c" diff --git a/efiemu/runtime/config.h b/efiemu/runtime/config.h new file mode 100644 index 000000000..26fb2ff08 --- /dev/null +++ b/efiemu/runtime/config.h @@ -0,0 +1,34 @@ +/* This is a pseudo config.h so that types.h compiles nicely */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#define GRUB_TYPES_CPU_HEADER 1 + +#ifdef ELF32 +# define SIZEOF_VOID_P 4 +# define SIZEOF_LONG 4 +# define GRUB_TARGET_SIZEOF_VOID_P 4 +# define GRUB_TARGET_SIZEOF_LONG 4 +# define EFI_FUNC(x) x +#else +# define SIZEOF_VOID_P 8 +# define SIZEOF_LONG 8 +# define GRUB_TARGET_SIZEOF_VOID_P 8 +# define GRUB_TARGET_SIZEOF_LONG 8 +# define EFI_FUNC(x) x ## _real +#endif diff --git a/efiemu/runtime/efiemu.S b/efiemu/runtime/efiemu.S new file mode 100644 index 000000000..e0923cce1 --- /dev/null +++ b/efiemu/runtime/efiemu.S @@ -0,0 +1,159 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +/* + * x86_64 uses registry to pass parameters. Unfortunately, gcc and efi use + * different call conversion, so we need to do some conversion. + * + * gcc: + * %rdi, %rsi, %rdx, %rcx, %r8, %r9, 8(%rsp), 16(%rsp), ... + * + * efi: + * %rcx, %rdx, %r8, %r9, 32(%rsp), 40(%rsp), 48(%rsp), ... + * + */ + + .file "efiemu.S" + .text + +FUNCTION (efiemu_get_time) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + call efiemu_get_time_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_set_time) + push %rdi + push %rsi + mov %rcx, %rdi + call efiemu_set_time_real + pop %rsi + pop %rdi + ret + + +FUNCTION (efiemu_get_wakeup_time) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx + call efiemu_get_wakeup_time_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_set_wakeup_time) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + call efiemu_set_wakeup_time_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_get_variable) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx + mov %r9, %rcx + mov 56(%rsp), %r8 + call efiemu_get_variable_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_get_next_variable_name) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx + call efiemu_get_next_variable_name_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_set_variable) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx + mov %r9, %rcx + mov 56(%rsp), %r8 + call efiemu_set_variable_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_get_next_high_monotonic_count) + push %rdi + push %rsi + mov %rcx, %rdi + call efiemu_get_next_high_monotonic_count_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_reset_system) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx + mov %r9, %rcx + call efiemu_reset_system_real + pop %rsi + pop %rdi + ret + + /* The following functions are always called in physical mode */ + .section ".text-physical", "ax" + +FUNCTION (efiemu_set_virtual_address_map) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + mov %r8, %rdx + mov %r9, %rcx + call efiemu_set_virtual_address_map_real + pop %rsi + pop %rdi + ret + +FUNCTION (efiemu_convert_pointer) + push %rdi + push %rsi + mov %rcx, %rdi + mov %rdx, %rsi + call efiemu_convert_pointer_real + pop %rsi + pop %rdi + ret + diff --git a/efiemu/runtime/efiemu.c b/efiemu/runtime/efiemu.c new file mode 100644 index 000000000..81fb56284 --- /dev/null +++ b/efiemu/runtime/efiemu.c @@ -0,0 +1,623 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* This is an emulation of EFI runtime services. + This allows a more uniform boot on i386 machines. + As it emulates only runtime serviceit isn't able + to chainload EFI bootloader on non-EFI system (TODO) */ + +#include +#include +#include +#include + +grub_efi_status_t +efiemu_get_time (grub_efi_time_t *time, + grub_efi_time_capabilities_t *capabilities); +grub_efi_status_t +efiemu_set_time (grub_efi_time_t *time); + +grub_efi_status_t +efiemu_get_wakeup_time (grub_efi_boolean_t *enabled, + grub_efi_boolean_t *pending, + grub_efi_time_t *time); +grub_efi_status_t +efiemu_set_wakeup_time (grub_efi_boolean_t enabled, + grub_efi_time_t *time); + + +grub_efi_status_t +efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version, + grub_efi_memory_descriptor_t *virtual_map) + __attribute__ ((section(".text-physical"))); + +grub_efi_status_t +efiemu_convert_pointer (grub_efi_uintn_t debug_disposition, + void **address) + __attribute__ ((section(".text-physical"))); + +grub_efi_status_t +efiemu_get_variable (grub_efi_char16_t *variable_name, + grub_efi_guid_t *vendor_guid, + grub_efi_uint32_t *attributes, + grub_efi_uintn_t *data_size, + void *data); + +grub_efi_status_t +efiemu_get_next_variable_name (grub_efi_uintn_t *variable_name_size, + grub_efi_char16_t *variable_name, + grub_efi_guid_t *vendor_guid); + +grub_efi_status_t +efiemu_set_variable (grub_efi_char16_t *variable_name, + grub_efi_guid_t *vendor_guid, + grub_efi_uint32_t attributes, + grub_efi_uintn_t data_size, + void *data); +grub_efi_status_t +efiemu_get_next_high_monotonic_count (grub_efi_uint32_t *high_count); +void +efiemu_reset_system (grub_efi_reset_type_t reset_type, + grub_efi_status_t reset_status, + grub_efi_uintn_t data_size, + grub_efi_char16_t *reset_data); + +grub_efi_status_t +EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t, + grub_efi_uintn_t, + grub_efi_uint32_t, + grub_efi_memory_descriptor_t *) + __attribute__ ((section(".text-physical"))); +grub_efi_status_t +EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, + void **address) + __attribute__ ((section(".text-physical"))); +static grub_uint32_t +efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) + __attribute__ ((section(".text-physical"))); +static void +init_crc32_table (void) + __attribute__ ((section(".text-physical"))); + +/* + The log. It's used when examining memory dump +*/ +static grub_uint8_t loge[1000] = "EFIEMULOG"; +static int logn = 9; +#define LOG(x) { if (logn<900) loge[logn++]=x; } + +static int ptv_relocated = 0; + +/* Interface with grub */ +struct grub_efi_runtime_services efiemu_runtime_services; +struct grub_efi_system_table efiemu_system_table; +extern struct grub_efiemu_ptv_rel efiemu_ptv_relloc[]; +extern grub_uint8_t efiemu_variables[]; +extern grub_uint32_t efiemu_varsize; +extern grub_uint32_t efiemu_high_monotonic_count; +extern grub_int16_t efiemu_time_zone; +extern grub_uint8_t efiemu_time_daylight; +extern grub_uint32_t efiemu_time_accuracy; + +/* Some standard functions because we need to be stadalone */ +static void +efiemu_memcpy (void *to, void *from, int count) +{ + int i; + for (i = 0; i < count; i++) + ((grub_uint8_t *) to)[i] = ((grub_uint8_t *) from)[i]; +} + +static int +efiemu_str16equal (grub_uint16_t *a, grub_uint16_t *b) +{ + grub_uint16_t *ptr1, *ptr2; + for (ptr1=a,ptr2=b; *ptr1 && *ptr2 == *ptr1; ptr1++, ptr2++); + return *ptr2 == *ptr1; +} + +static grub_size_t +efiemu_str16len (grub_uint16_t *a) +{ + grub_uint16_t *ptr1; + for (ptr1 = a; *ptr1; ptr1++); + return ptr1 - a; +} + +static int +efiemu_memequal (void *a, void *b, grub_size_t n) +{ + grub_uint8_t *ptr1, *ptr2; + for (ptr1 = (grub_uint8_t *) a, ptr2 = (grub_uint8_t *)b; + ptr1 < (grub_uint8_t *)a + n && *ptr2 == *ptr1; ptr1++, ptr2++); + return ptr1 == a + n; +} + +static void +efiemu_memset (grub_uint8_t *a, grub_uint8_t b, grub_size_t n) +{ + grub_uint8_t *ptr1; + for (ptr1=a; ptr1 < a + n; ptr1++) + *ptr1 = b; +} + +static inline void +write_cmos (grub_uint8_t addr, grub_uint8_t val) +{ + __asm__ __volatile__ ("outb %%al,$0x70\n" + "mov %%bl, %%al\n" + "outb %%al,$0x71": :"a" (addr), "b" (val)); +} + +static inline grub_uint8_t +read_cmos (grub_uint8_t addr) +{ + grub_uint8_t ret; + __asm__ __volatile__ ("outb %%al, $0x70\n" + "inb $0x71, %%al": "=a"(ret) :"a" (addr)); + return ret; +} + +/* Needed by some gcc versions */ +int __stack_chk_fail () +{ + return 0; +} + +/* The function that implement runtime services as specified in + EFI specification */ +static inline grub_uint8_t +bcd_to_hex (grub_uint8_t in) +{ + return 10 * ((in & 0xf0) >> 4) + (in & 0x0f); +} + +grub_efi_status_t +EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time, + grub_efi_time_capabilities_t *capabilities) +{ + LOG ('a'); + grub_uint8_t state; + state = read_cmos (0xb); + if (!(state & (1 << 2))) + { + time->year = 2000 + bcd_to_hex (read_cmos (0x9)); + time->month = bcd_to_hex (read_cmos (0x8)); + time->day = bcd_to_hex (read_cmos (0x7)); + time->hour = bcd_to_hex (read_cmos (0x4)); + if (time->hour >= 81) + time->hour -= 80 - 12; + if (time->hour == 24) + time->hour = 0; + time->minute = bcd_to_hex (read_cmos (0x2)); + time->second = bcd_to_hex (read_cmos (0x0)); + } + else + { + time->year = 2000 + read_cmos (0x9); + time->month = read_cmos (0x8); + time->day = read_cmos (0x7); + time->hour = read_cmos (0x4); + if (time->hour >= 0x81) + time->hour -= 0x80 - 12; + if (time->hour == 24) + time->hour = 0; + time->minute = read_cmos (0x2); + time->second = read_cmos (0x0); + } + time->nanosecond = 0; + time->pad1 = 0; + time->pad2 = 0; + time->time_zone = efiemu_time_zone; + time->daylight = efiemu_time_daylight; + capabilities->resolution = 1; + capabilities->accuracy = efiemu_time_accuracy; + capabilities->sets_to_zero = 0; + return GRUB_EFI_SUCCESS; +} + +grub_efi_status_t +EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time) +{ + LOG ('b'); + grub_uint8_t state; + state = read_cmos (0xb); + write_cmos (0xb, state | 0x6); + write_cmos (0x9, time->year - 2000); + write_cmos (0x8, time->month); + write_cmos (0x7, time->day); + write_cmos (0x4, time->hour); + write_cmos (0x2, time->minute); + write_cmos (0x0, time->second); + efiemu_time_zone = time->time_zone; + efiemu_time_daylight = time->daylight; + return GRUB_EFI_SUCCESS; +} + +/* Folowing 2 functions are vendor specific. So announce it as unsupported */ +grub_efi_status_t +EFI_FUNC (efiemu_get_wakeup_time) (grub_efi_boolean_t *enabled, + grub_efi_boolean_t *pending, + grub_efi_time_t *time) +{ + LOG ('c'); + return GRUB_EFI_UNSUPPORTED; +} + +grub_efi_status_t +EFI_FUNC (efiemu_set_wakeup_time) (grub_efi_boolean_t enabled, + grub_efi_time_t *time) +{ + LOG ('d'); + return GRUB_EFI_UNSUPPORTED; +} + +static grub_uint32_t crc32_table [256]; + +static void +init_crc32_table (void) +{ + auto grub_uint32_t reflect (grub_uint32_t ref, int len); + grub_uint32_t reflect (grub_uint32_t ref, int len) + { + grub_uint32_t result = 0; + int i; + + for (i = 1; i <= len; i++) + { + if (ref & 1) + result |= 1 << (len - i); + ref >>= 1; + } + + return result; + } + + grub_uint32_t polynomial = 0x04c11db7; + int i, j; + + for(i = 0; i < 256; i++) + { + crc32_table[i] = reflect(i, 8) << 24; + for (j = 0; j < 8; j++) + crc32_table[i] = (crc32_table[i] << 1) ^ + (crc32_table[i] & (1 << 31) ? polynomial : 0); + crc32_table[i] = reflect(crc32_table[i], 32); + } +} + +static grub_uint32_t +efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) +{ + int i; + grub_uint8_t *data = buf; + + if (! crc32_table[1]) + init_crc32_table (); + + crc^= 0xffffffff; + + for (i = 0; i < size; i++) + { + crc = (crc >> 8) ^ crc32_table[(crc & 0xFF) ^ *data]; + data++; + } + + return crc ^ 0xffffffff; +} + + +grub_efi_status_t EFI_FUNC +(efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version, + grub_efi_memory_descriptor_t *virtual_map) +{ + struct grub_efiemu_ptv_rel *cur_relloc; + + LOG ('e'); + + /* Ensure that we are called only once */ + if (ptv_relocated) + return GRUB_EFI_UNSUPPORTED; + ptv_relocated = 1; + + /* Correct addresses using information supplied by grub */ + for (cur_relloc = efiemu_ptv_relloc; cur_relloc->size;cur_relloc++) + { + grub_int64_t corr = 0; + grub_efi_memory_descriptor_t *descptr; + + /* Compute correction */ + for (descptr = virtual_map; + ((grub_uint8_t *) descptr - (grub_uint8_t *) virtual_map) + < memory_map_size; + descptr = (grub_efi_memory_descriptor_t *) + ((grub_uint8_t *) descptr + descriptor_size)) + { + if (descptr->type == cur_relloc->plustype) + corr += descptr->virtual_start - descptr->physical_start; + if (descptr->type == cur_relloc->minustype) + corr -= descptr->virtual_start - descptr->physical_start; + } + + /* Apply correction */ + switch (cur_relloc->size) + { + case 8: + *((grub_uint64_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + case 4: + *((grub_uint32_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + case 2: + *((grub_uint16_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + case 1: + *((grub_uint8_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + } + } + + /* Recompute crc32 of system table and runtime services */ + efiemu_system_table.hdr.crc32 = 0; + efiemu_system_table.hdr.crc32 = efiemu_getcrc32 + (0, &efiemu_system_table, sizeof (efiemu_system_table)); + + efiemu_runtime_services.hdr.crc32 = 0; + efiemu_runtime_services.hdr.crc32 = efiemu_getcrc32 + (0, &efiemu_runtime_services, sizeof (efiemu_runtime_services)); + + return GRUB_EFI_SUCCESS; +} + +/* since efiemu_set_virtual_address_map corrects all the pointers + we don't need efiemu_convert_pointer */ +grub_efi_status_t +EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, + void **address) +{ + LOG ('f'); + return GRUB_EFI_UNSUPPORTED; +} + +/* Next comes variable services. Because we have no vendor-independent + way to store these variables we have no non-volatility */ + +/* Find variable by name and GUID. */ +static struct efi_variable * +find_variable (grub_efi_guid_t *vendor_guid, + grub_efi_char16_t *variable_name) +{ + grub_uint8_t *ptr; + struct efi_variable *efivar; + + for (ptr = efiemu_variables; ptr < efiemu_variables + efiemu_varsize; ) + { + efivar = (struct efi_variable *) ptr; + if (!efivar->namelen) + return 0; + if (efiemu_str16equal((grub_efi_char16_t *)(efivar + 1), variable_name) + && efiemu_memequal (&(efivar->guid), vendor_guid, + sizeof (efivar->guid))) + return efivar; + ptr += efivar->namelen + efivar->size + sizeof (*efivar); + } + return 0; +} + +grub_efi_status_t +EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name, + grub_efi_guid_t *vendor_guid, + grub_efi_uint32_t *attributes, + grub_efi_uintn_t *data_size, + void *data) +{ + struct efi_variable *efivar; + LOG ('g'); + efivar = find_variable (vendor_guid, variable_name); + if (!efivar) + return GRUB_EFI_NOT_FOUND; + if (*data_size < efivar->size) + { + *data_size = efivar->size; + return GRUB_EFI_BUFFER_TOO_SMALL; + } + *data_size = efivar->size; + efiemu_memcpy (data, (grub_uint8_t *)(efivar + 1) + efivar->namelen, + efivar->size); + *attributes = efivar->attributes; + + return GRUB_EFI_SUCCESS; +} + +grub_efi_status_t EFI_FUNC +(efiemu_get_next_variable_name) (grub_efi_uintn_t *variable_name_size, + grub_efi_char16_t *variable_name, + grub_efi_guid_t *vendor_guid) +{ + struct efi_variable *efivar; + LOG ('l'); + + if (!variable_name_size || !variable_name || !vendor_guid) + return GRUB_EFI_INVALID_PARAMETER; + if (variable_name[0]) + { + efivar = find_variable (vendor_guid, variable_name); + if (!efivar) + return GRUB_EFI_NOT_FOUND; + efivar = (struct efi_variable *)((grub_uint8_t *)efivar + + efivar->namelen + + efivar->size + sizeof (*efivar)); + } + else + efivar = (struct efi_variable *) (efiemu_variables); + + LOG ('m'); + if ((grub_uint8_t *)efivar >= efiemu_variables + efiemu_varsize + || !efivar->namelen) + return GRUB_EFI_NOT_FOUND; + if (*variable_name_size < efivar->namelen) + { + *variable_name_size = efivar->namelen; + return GRUB_EFI_BUFFER_TOO_SMALL; + } + + efiemu_memcpy (variable_name, efivar + 1, efivar->namelen); + efiemu_memcpy (vendor_guid, &(efivar->guid), + sizeof (efivar->guid)); + + LOG('h'); + return GRUB_EFI_SUCCESS; +} + +grub_efi_status_t +EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, + grub_efi_guid_t *vendor_guid, + grub_efi_uint32_t attributes, + grub_efi_uintn_t data_size, + void *data) +{ + struct efi_variable *efivar; + grub_uint8_t *ptr; + LOG('i'); + if (!variable_name[0]) + return GRUB_EFI_INVALID_PARAMETER; + efivar = find_variable (vendor_guid, variable_name); + + /* Delete variable if any */ + if (efivar) + { + efiemu_memcpy (efivar, (grub_uint8_t *)(efivar + 1) + + efivar->namelen + efivar->size, + (efiemu_variables + efiemu_varsize) + - ((grub_uint8_t *)(efivar + 1) + + efivar->namelen + efivar->size)); + efiemu_memset (efiemu_variables + efiemu_varsize + - (sizeof (*efivar) + efivar->namelen + efivar->size), + 0, (sizeof (*efivar) + efivar->namelen + efivar->size)); + } + + if (!data_size) + return GRUB_EFI_SUCCESS; + + for (ptr = efiemu_variables; ptr < efiemu_variables + efiemu_varsize; ) + { + efivar = (struct efi_variable *) ptr; + ptr += efivar->namelen + efivar->size + sizeof (*efivar); + if (!efivar->namelen) + break; + } + if ((grub_uint8_t *)(efivar + 1) + data_size + + 2 * (efiemu_str16len (variable_name) + 1) + >= efiemu_variables + efiemu_varsize) + return GRUB_EFI_OUT_OF_RESOURCES; + + efiemu_memcpy (&(efivar->guid), vendor_guid, sizeof (efivar->guid)); + efivar->namelen = 2 * (efiemu_str16len (variable_name) + 1); + efivar->size = data_size; + efivar->attributes = attributes; + efiemu_memcpy (efivar + 1, variable_name, + 2 * (efiemu_str16len (variable_name) + 1)); + efiemu_memcpy ((grub_uint8_t *)(efivar + 1) + + 2 * (efiemu_str16len (variable_name) + 1), + data, data_size); + + return GRUB_EFI_SUCCESS; +} + +grub_efi_status_t EFI_FUNC +(efiemu_get_next_high_monotonic_count) (grub_efi_uint32_t *high_count) +{ + LOG ('j'); + if (!high_count) + return GRUB_EFI_INVALID_PARAMETER; + *high_count = ++efiemu_high_monotonic_count; + return GRUB_EFI_SUCCESS; +} + +/* To implement it with APM we need to go to real mode. It's too much hassle + Besides EFI specification says that this function shouldn't be used + on systems supporting ACPI + */ +void +EFI_FUNC (efiemu_reset_system) (grub_efi_reset_type_t reset_type, + grub_efi_status_t reset_status, + grub_efi_uintn_t data_size, + grub_efi_char16_t *reset_data) +{ + LOG ('k'); +} + +struct grub_efi_runtime_services efiemu_runtime_services = +{ + .hdr = + { + .signature = GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE, + .revision = 0x0001000a, + .header_size = sizeof (struct grub_efi_runtime_services), + .crc32 = 0, /* filled later*/ + .reserved = 0 + }, + .get_time = efiemu_get_time, + .set_time = efiemu_set_time, + .get_wakeup_time = efiemu_get_wakeup_time, + .set_wakeup_time = efiemu_set_wakeup_time, + + .set_virtual_address_map = efiemu_set_virtual_address_map, + .convert_pointer = efiemu_convert_pointer, + + .get_variable = efiemu_get_variable, + .get_next_variable_name = efiemu_get_next_variable_name, + .set_variable = efiemu_set_variable, + .get_next_high_monotonic_count = efiemu_get_next_high_monotonic_count, + + .reset_system = efiemu_reset_system +}; + + +static grub_uint16_t efiemu_vendor[] = + {'G', 'R', 'U', 'B', ' ', 'E', 'F', 'I', ' ', + 'R', 'U', 'N', 'T', 'I', 'M', 'E', 0}; + +struct grub_efi_system_table efiemu_system_table = +{ + .hdr = + { + .signature = GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE, + .revision = 0x0001000a, + .header_size = sizeof (struct grub_efi_system_table), + .crc32 = 0, /* filled later*/ + .reserved = 0 + }, + .firmware_vendor = efiemu_vendor, + .firmware_revision = 0x0001000a, + .console_in_handler = 0, + .con_in = 0, + .console_out_handler = 0, + .con_out = 0, + .standard_error_handle = 0, + .std_err = 0, + .runtime_services = &efiemu_runtime_services, + .boot_services = 0, + .num_table_entries = 0, + .configuration_table = 0 +}; + diff --git a/efiemu/runtime/efiemu.sh b/efiemu/runtime/efiemu.sh new file mode 100644 index 000000000..1ae059ad4 --- /dev/null +++ b/efiemu/runtime/efiemu.sh @@ -0,0 +1,4 @@ +gcc -c -m32 -DELF32 -o efiemu32.o ./efiemu.c -Wall -Werror -nostdlib -O2 -I. -I../../include +gcc -c -m64 -DELF64 -o efiemu64_c.o ./efiemu.c -Wall -Werror -mcmodel=large -O2 -I. -I../../include +gcc -c -m64 -DELF64 -o efiemu64_s.o ./efiemu.S -Wall -Werror -mcmodel=large -O2 -I. -I../../include +ld -o efiemu64.o -r efiemu64_s.o efiemu64_c.o -nostdlib diff --git a/efiemu/symbols.c b/efiemu/symbols.c new file mode 100644 index 000000000..b3111b616 --- /dev/null +++ b/efiemu/symbols.c @@ -0,0 +1,188 @@ +/* Code for managing symbols and pointers in efiemu */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +static int ptv_written = 0; +static int ptv_alloc = 0; +static int ptv_handle = 0; +static int ptv_requested = 0; +static struct grub_efiemu_sym *efiemu_syms = 0; + +struct grub_efiemu_sym +{ + struct grub_efiemu_sym *next; + char *name; + int handle; + grub_off_t off; +}; + +void +grub_efiemu_free_syms (void) +{ + struct grub_efiemu_sym *cur, *d; + for (cur = efiemu_syms; cur;) + { + d = cur->next; + grub_free (cur->name); + grub_free (cur); + cur = d; + } + efiemu_syms = 0; + ptv_written = 0; + ptv_alloc = 0; + ptv_requested = 0; + grub_efiemu_mm_return_request (ptv_handle); + ptv_handle = 0; +} + +/* Announce that the module will need NUM allocators */ +/* Because of deferred memory allocation all the relocators have to be + announced during phase 1*/ +grub_err_t +grub_efiemu_request_symbols (int num) +{ + if (ptv_alloc) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "symbols have already been allocated"); + if (num < 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "can't request negative symbols"); + ptv_requested += num; + return GRUB_ERR_NONE; +} + +/* Resolve the symbol name NAME and set HANDLE and OFF accordingly */ +grub_err_t +grub_efiemu_resolve_symbol (const char *name, int *handle, grub_off_t *off) +{ + struct grub_efiemu_sym *cur; + for (cur = efiemu_syms; cur; cur = cur->next) + if (!grub_strcmp (name, cur->name)) + { + *handle = cur->handle; + *off = cur->off; + return GRUB_ERR_NONE; + } + grub_dprintf ("efiemu", "%s not found\n", name); + return grub_error (GRUB_ERR_BAD_OS, "symbol %s isn't found", name); +} + +/* Register symbol named NAME in memory handle HANDLE at offset OFF */ +grub_err_t +grub_efiemu_register_symbol (const char *name, int handle, grub_off_t off) +{ + struct grub_efiemu_sym *cur; + cur = (struct grub_efiemu_sym *) grub_malloc (sizeof (*cur)); + grub_dprintf ("efiemu", "registering symbol '%s'\n", name); + if (!cur) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't register symbol"); + cur->name = grub_strdup (name); + cur->next = efiemu_syms; + cur->handle = handle; + cur->off = off; + efiemu_syms = cur; + + return 0; +} + +/* Go from phase 1 to phase 2. Must be called before similar function in mm.c */ +grub_err_t +grub_efiemu_alloc_syms (void) +{ + ptv_alloc = ptv_requested; + ptv_handle = grub_efiemu_request_memalign + (1, (ptv_requested + 1) * sizeof (struct grub_efiemu_ptv_rel), + GRUB_EFI_RUNTIME_SERVICES_DATA); + grub_efiemu_register_symbol ("efiemu_ptv_relloc", ptv_handle, 0); + return grub_errno; +} + +/* Write value (pointer to memory PLUS_HANDLE) + - (pointer to memory MINUS_HANDLE) + VALUE to ADDR assuming that the + size SIZE bytes. If PTV_NEEDED is 1 then announce it to runtime that this + value needs to be recomputed before going to virtual mode +*/ +grub_err_t +grub_efiemu_write_value (void *addr, grub_uint32_t value, int plus_handle, + int minus_handle, int ptv_needed, int size) +{ + /* Announce relocator to runtime */ + if (ptv_needed) + { + struct grub_efiemu_ptv_rel *ptv_rels + = grub_efiemu_mm_obtain_request (ptv_handle); + + if (ptv_needed && ptv_written >= ptv_alloc) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "your module didn't declare efiemu " + " relocators correctly"); + + if (minus_handle) + ptv_rels[ptv_written].minustype + = grub_efiemu_mm_get_type (minus_handle); + else + ptv_rels[ptv_written].minustype = 0; + + if (plus_handle) + ptv_rels[ptv_written].plustype + = grub_efiemu_mm_get_type (plus_handle); + else + ptv_rels[ptv_written].plustype = 0; + + ptv_rels[ptv_written].addr = PTR_TO_UINT64 (addr); + ptv_rels[ptv_written].size = size; + ptv_written++; + + /* memset next value to zero to mark the end */ + grub_memset (&ptv_rels[ptv_written], 0, sizeof (ptv_rels[ptv_written])); + } + + /* Compute the value */ + if (minus_handle) + value -= PTR_TO_UINT32 (grub_efiemu_mm_obtain_request (minus_handle)); + + if (plus_handle) + value += PTR_TO_UINT32 (grub_efiemu_mm_obtain_request (plus_handle)); + + /* Write the value */ + switch (size) + { + case 8: + *((grub_uint64_t *) addr) = value; + break; + case 4: + *((grub_uint32_t *) addr) = value; + break; + case 2: + *((grub_uint16_t *) addr) = value; + break; + case 1: + *((grub_uint8_t *) addr) = value; + break; + default: + return grub_error (GRUB_ERR_BAD_ARGUMENT, "wrong symbol size"); + } + + return GRUB_ERR_NONE; +} diff --git a/include/grub/autoefi.h b/include/grub/autoefi.h new file mode 100644 index 000000000..f9c552a9f --- /dev/null +++ b/include/grub/autoefi.h @@ -0,0 +1,75 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +/* This file provides some abstractions so that the same code compiles with + both efi and efiemu + */ +#ifndef GRUB_AUTOEFI_HEADER +#define GRUB_AUTOEFI_HEADER 1 + +#include + +#ifdef GRUB_MACHINE_EFI +# include +# define grub_autoefi_get_memory_map grub_efi_get_memory_map +# define grub_autoefi_finish_boot_services grub_efi_finish_boot_services +# define grub_autoefi_system_table grub_efi_system_table +# define grub_autoefi_mmap_iterate grub_machine_mmap_iterate +static inline grub_err_t grub_autoefi_prepare (void) +{ + return GRUB_ERR_NONE; +}; +# define GRUB_AUTOEFI_MEMORY_AVAILABLE GRUB_MACHINE_MEMORY_AVAILABLE +# define GRUB_AUTOEFI_MEMORY_RESERVED GRUB_MACHINE_MEMORY_RESERVED +# ifdef GRUB_MACHINE_MEMORY_ACPI +# define GRUB_AUTOEFI_MEMORY_ACPI GRUB_MACHINE_MEMORY_ACPI +# endif +# ifdef GRUB_MACHINE_MEMORY_NVS +# define GRUB_AUTOEFI_MEMORY_NVS GRUB_MACHINE_MEMORY_NVS +# endif +# ifdef GRUB_MACHINE_MEMORY_CODE +# define GRUB_AUTOEFI_MEMORY_CODE GRUB_MACHINE_MEMORY_CODE +# endif +# define SYSTEM_TABLE_SIZEOF(x) (sizeof(grub_efi_system_table->x)) +# define SYSTEM_TABLE_VAR(x) ((void *)&(grub_efi_system_table->x)) +# define SYSTEM_TABLE_PTR(x) ((void *)(grub_efi_system_table->x)) +# define SIZEOF_OF_UINTN sizeof (grub_efi_uintn_t) +# define SYSTEM_TABLE(x) (grub_efi_system_table->x) +# define EFI_PRESENT 1 +#else +# include +# define grub_autoefi_get_memory_map grub_efiemu_get_memory_map +# define grub_autoefi_finish_boot_services grub_efiemu_finish_boot_services +# define grub_autoefi_system_table grub_efiemu_system_table +# define grub_autoefi_mmap_iterate grub_efiemu_mmap_iterate +# define grub_autoefi_prepare grub_efiemu_prepare +# define GRUB_AUTOEFI_MEMORY_AVAILABLE GRUB_EFIEMU_MEMORY_AVAILABLE +# define GRUB_AUTOEFI_MEMORY_RESERVED GRUB_EFIEMU_MEMORY_RESERVED +# define GRUB_AUTOEFI_MEMORY_ACPI GRUB_EFIEMU_MEMORY_ACPI +# define GRUB_AUTOEFI_MEMORY_NVS GRUB_EFIEMU_MEMORY_NVS +# define GRUB_AUTOEFI_MEMORY_CODE GRUB_EFIEMU_MEMORY_CODE +# define SYSTEM_TABLE_SIZEOF GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF +# define SYSTEM_TABLE_VAR GRUB_EFIEMU_SYSTEM_TABLE_VAR +# define SYSTEM_TABLE_PTR GRUB_EFIEMU_SYSTEM_TABLE_PTR +# define SIZEOF_OF_UINTN GRUB_EFIEMU_SIZEOF_OF_UINTN +# define SYSTEM_TABLE GRUB_EFIEMU_SYSTEM_TABLE +# define grub_efi_allocate_pages(x,y) (x) +# define grub_efi_free_pages(x,y) GRUB_EFI_SUCCESS +# define EFI_PRESENT 1 +#endif + +#endif diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 598c7c359..432266bdf 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -40,15 +40,15 @@ #define GRUB_EFI_TPL_NOTIFY 16 #define GRUB_EFI_TPL_HIGH_LEVEL 31 -#define GRUB_EFI_MEMORY_UC 0x0000000000000001 -#define GRUB_EFI_MEMORY_WC 0x0000000000000002 -#define GRUB_EFI_MEMORY_WT 0x0000000000000004 -#define GRUB_EFI_MEMORY_WB 0x0000000000000008 -#define GRUB_EFI_MEMORY_UCE 0x0000000000000010 -#define GRUB_EFI_MEMORY_WP 0x0000000000001000 -#define GRUB_EFI_MEMORY_RP 0x0000000000002000 -#define GRUB_EFI_MEMORY_XP 0x0000000000004000 -#define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000 +#define GRUB_EFI_MEMORY_UC 0x0000000000000001LL +#define GRUB_EFI_MEMORY_WC 0x0000000000000002LL +#define GRUB_EFI_MEMORY_WT 0x0000000000000004LL +#define GRUB_EFI_MEMORY_WB 0x0000000000000008LL +#define GRUB_EFI_MEMORY_UCE 0x0000000000000010LL +#define GRUB_EFI_MEMORY_WP 0x0000000000001000LL +#define GRUB_EFI_MEMORY_RP 0x0000000000002000LL +#define GRUB_EFI_MEMORY_XP 0x0000000000004000LL +#define GRUB_EFI_MEMORY_RUNTIME 0x8000000000000000LL #define GRUB_EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001 #define GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002 @@ -619,7 +619,7 @@ struct grub_efi_time grub_efi_int16_t time_zone; grub_efi_uint8_t daylight; grub_efi_uint8_t pad2; -}; +} __attribute__ ((packed)); typedef struct grub_efi_time grub_efi_time_t; struct grub_efi_time_capabilities @@ -936,6 +936,9 @@ struct grub_efi_configuration_table } __attribute__ ((packed)); typedef struct grub_efi_configuration_table grub_efi_configuration_table_t; +#define GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE 0x5453595320494249LL +#define GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE 0x56524553544e5552LL + struct grub_efi_simple_input_interface { grub_efi_status_t diff --git a/include/grub/efiemu/efiemu.h b/include/grub/efiemu/efiemu.h new file mode 100644 index 000000000..1515a67df --- /dev/null +++ b/include/grub/efiemu/efiemu.h @@ -0,0 +1,276 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_EFI_EMU_HEADER +#define GRUB_EFI_EMU_HEADER 1 + +#include +#include + +#define GRUB_EFIEMU_PAGESIZE 4096 + +/* EFI api defined in 32-bit and 64-bit version*/ +struct grub_efi_system_table32 +{ + grub_efi_table_header_t hdr; + grub_efi_uint32_t firmware_vendor; + grub_efi_uint32_t firmware_revision; + grub_efi_uint32_t console_in_handler; + grub_efi_uint32_t con_in; + grub_efi_uint32_t console_out_handler; + grub_efi_uint32_t con_out; + grub_efi_uint32_t standard_error_handle; + grub_efi_uint32_t std_err; + grub_efi_uint32_t runtime_services; + grub_efi_uint32_t boot_services; + grub_efi_uint32_t num_table_entries; + grub_efi_uint32_t configuration_table; +} __attribute__ ((packed)); +typedef struct grub_efi_system_table32 grub_efi_system_table32_t; + +struct grub_efi_system_table64 +{ + grub_efi_table_header_t hdr; + grub_efi_uint64_t firmware_vendor; + grub_efi_uint32_t firmware_revision; + grub_efi_uint32_t pad; + grub_efi_uint64_t console_in_handler; + grub_efi_uint64_t con_in; + grub_efi_uint64_t console_out_handler; + grub_efi_uint64_t con_out; + grub_efi_uint64_t standard_error_handle; + grub_efi_uint64_t std_err; + grub_efi_uint64_t runtime_services; + grub_efi_uint64_t boot_services; + grub_efi_uint64_t num_table_entries; + grub_efi_uint64_t configuration_table; +} __attribute__ ((packed)); +typedef struct grub_efi_system_table64 grub_efi_system_table64_t; + +struct grub_efiemu_runtime_services32 +{ + grub_efi_table_header_t hdr; + grub_efi_uint32_t get_time; + grub_efi_uint32_t set_time; + grub_efi_uint32_t get_wakeup_time; + grub_efi_uint32_t set_wakeup_time; + grub_efi_uint32_t set_virtual_address_map; + grub_efi_uint32_t convert_pointer; + grub_efi_uint32_t get_variable; + grub_efi_uint32_t get_next_variable_name; + grub_efi_uint32_t set_variable; + grub_efi_uint32_t get_next_high_monotonic_count; + grub_efi_uint32_t reset_system; +} __attribute__ ((packed)); +typedef struct grub_efiemu_runtime_services32 grub_efiemu_runtime_services32_t; + +struct grub_efiemu_runtime_services64 +{ + grub_efi_table_header_t hdr; + grub_efi_uint64_t get_time; + grub_efi_uint64_t set_time; + grub_efi_uint64_t get_wakeup_time; + grub_efi_uint64_t set_wakeup_time; + grub_efi_uint64_t set_virtual_address_map; + grub_efi_uint64_t convert_pointer; + grub_efi_uint64_t get_variable; + grub_efi_uint64_t get_next_variable_name; + grub_efi_uint64_t set_variable; + grub_efi_uint64_t get_next_high_monotonic_count; + grub_efi_uint64_t reset_system; +} __attribute__ ((packed)); +typedef struct grub_efiemu_runtime_services64 grub_efiemu_runtime_services64_t; + +extern grub_efi_system_table32_t *grub_efiemu_system_table32; +extern grub_efi_system_table64_t *grub_efiemu_system_table64; + +/* Convenience macroses to access currently loaded efiemu */ +#define grub_efiemu_system_table ((grub_efiemu_sizeof_uintn_t () == 8) \ + ? (void *) grub_efiemu_system_table64 \ + : (void *) grub_efiemu_system_table32) +#define GRUB_EFIEMU_SIZEOF_OF_UINTN (grub_efiemu_sizeof_uintn_t ()) +#define GRUB_EFIEMU_SYSTEM_TABLE(x) ((grub_efiemu_sizeof_uintn_t () == 8) \ + ? grub_efiemu_system_table64->x \ + : grub_efiemu_system_table32->x) +#define GRUB_EFIEMU_SYSTEM_TABLE_SET(x,y) ((grub_efiemu_sizeof_uintn_t () == 8)\ + ? (grub_efiemu_system_table64->x \ + = (y)) \ + : (grub_efiemu_system_table32->x \ + = (y))) +#define GRUB_EFIEMU_SYSTEM_TABLE_PTR(x) ((grub_efiemu_sizeof_uintn_t () == 8)\ + ? UINT_TO_PTR \ + (grub_efiemu_system_table64->x) \ + : UINT_TO_PTR \ + (grub_efiemu_system_table32->x)) +#define GRUB_EFIEMU_SYSTEM_TABLE_VAR(x) ((grub_efiemu_sizeof_uintn_t () == 8) \ + ? (void *) \ + &(grub_efiemu_system_table64->x) \ + : (void *) \ + &(grub_efiemu_system_table32->x)) +#define GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF(x) \ + ((grub_efiemu_sizeof_uintn_t () == 8) \ + ? sizeof(grub_efiemu_system_table64->x)\ + : sizeof(grub_efiemu_system_table32->x)) +#define GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF_TOTAL ((grub_efiemu_sizeof_uintn_t () == 8) ? sizeof(*grub_efiemu_system_table64):sizeof(*grub_efiemu_system_table32)) + +/* ELF management definitions and functions */ + +struct grub_efiemu_segment +{ + struct grub_efiemu_segment *next; + grub_size_t size; + unsigned section; + int handle; + int ptv_rel_needed; + grub_off_t off; + void *srcptr; +}; +typedef struct grub_efiemu_segment *grub_efiemu_segment_t; + +struct grub_efiemu_elf_sym +{ + int handle; + grub_off_t off; + unsigned section; +}; + +int grub_efiemu_check_header32 (void *ehdr, grub_size_t size); +int grub_efiemu_check_header64 (void *ehdr, grub_size_t size); +grub_err_t grub_efiemu_loadcore_init32 (void *core, grub_size_t core_size, + grub_efiemu_segment_t *segments); +grub_err_t grub_efiemu_loadcore_init64 (void *core, grub_size_t core_size, + grub_efiemu_segment_t *segments); +grub_err_t grub_efiemu_loadcore_load32 (void *core, + grub_size_t core_size, + grub_efiemu_segment_t segments); +grub_err_t grub_efiemu_loadcore_load64 (void *core, + grub_size_t core_size, + grub_efiemu_segment_t segments); +grub_err_t grub_efiemu_loadcore_unload32 (void); +grub_err_t grub_efiemu_loadcore_unload64 (void); +grub_err_t grub_efiemu_loadcore_unload(void); +grub_err_t grub_efiemu_loadcore_init (grub_file_t file); +grub_err_t grub_efiemu_loadcore_load (void); + +/* Configuration tables manipulation. Definitions and functions */ +struct grub_efiemu_configuration_table +{ + struct grub_efiemu_configuration_table *next; + grub_efi_guid_t guid; + void * (*get_table) (void *data); + void (*unload) (void *data); + void *data; +}; +struct grub_efiemu_configuration_table32 +{ + grub_efi_guid_t vendor_guid; + grub_efi_uint32_t vendor_table; +} __attribute__ ((packed)); +typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table32_t; +struct grub_efiemu_configuration_table64 +{ + grub_efi_guid_t vendor_guid; + grub_efi_uint64_t vendor_table; +} __attribute__ ((packed)); +typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table64_t; +grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid); +grub_err_t +grub_efiemu_register_configuration_table (grub_efi_guid_t guid, + void * (*get_table) (void *data), + void (*unload) (void *data), + void *data); + +/* Memory management functions */ +int grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, + grub_efi_memory_type_t type); +void *grub_efiemu_mm_obtain_request (int handle); +int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, + grub_efi_memory_descriptor_t *memory_map, + grub_efi_uintn_t *map_key, + grub_efi_uintn_t *descriptor_size, + grub_efi_uint32_t *descriptor_version); +grub_err_t grub_efiemu_mm_unload (void); +grub_err_t grub_efiemu_mm_do_alloc (void); +grub_err_t grub_efiemu_mm_init (void); +void *grub_efiemu_mm_obtain_request (int handle); +void grub_efiemu_mm_return_request (int handle); +grub_efi_memory_type_t grub_efiemu_mm_get_type (int handle); + +/* Drop-in replacements for grub_efi_* and grub_machine_* */ +int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, + grub_efi_memory_descriptor_t *memory_map, + grub_efi_uintn_t *map_key, + grub_efi_uintn_t *descriptor_size, + grub_efi_uint32_t *descriptor_version); +grub_err_t +grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, + grub_uint32_t)); +int grub_efiemu_sizeof_uintn_t (void); +int grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key); +int grub_efiemu_finish_boot_services (void); +grub_err_t +grub_efiemu_get_lower_upper_memory (grub_uint64_t *lower, grub_uint64_t *upper); +#define GRUB_EFIEMU_MEMORY_AVAILABLE 1 +#define GRUB_EFIEMU_MEMORY_RESERVED 2 +#define GRUB_EFIEMU_MEMORY_ACPI 3 +#define GRUB_EFIEMU_MEMORY_NVS 4 +#define GRUB_EFIEMU_MEMORY_CODE 5 + +/* efiemu main control definitions and functions*/ +typedef enum {GRUB_EFIEMU_NOTLOADED, + GRUB_EFIEMU32, GRUB_EFIEMU64} grub_efiemu_mode_t; +struct grub_efiemu_prepare_hook +{ + struct grub_efiemu_prepare_hook *next; + grub_err_t (*hook) (void *data); + void (*unload) (void *data); + void *data; +}; +grub_err_t grub_efiemu_prepare32 (struct grub_efiemu_prepare_hook + *prepare_hooks, + struct grub_efiemu_configuration_table + *config_tables); +grub_err_t grub_efiemu_prepare64 (struct grub_efiemu_prepare_hook + *prepare_hooks, + struct grub_efiemu_configuration_table + *config_tables); +grub_err_t grub_efiemu_unload (void); +grub_err_t grub_efiemu_prepare (void); +grub_err_t +grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data), + void (*unload) (void *data), + void *data); + +/* symbols and pointers */ +grub_err_t grub_efiemu_alloc_syms (void); +grub_err_t grub_efiemu_request_symbols (int num); +grub_err_t grub_efiemu_resolve_symbol (const char *name, + int *handle, grub_off_t *off); +grub_err_t grub_efiemu_register_symbol (const char *name, + int handle, grub_off_t off); +void grub_efiemu_free_syms (void); +grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value, + int plus_handle, + int minus_handle, int ptv_needed, int size); +grub_err_t grub_efiemu_pnvram (void); +grub_err_t grub_efiemu_prepare (void); +char *grub_efiemu_get_default_core_name (void); +void grub_efiemu_pnvram_cmd_unregister (void); +grub_err_t grub_efiemu_autocore (void); +#endif /* ! GRUB_EFI_EMU_HEADER */ diff --git a/include/grub/efiemu/runtime.h b/include/grub/efiemu/runtime.h new file mode 100644 index 000000000..1eb474a5d --- /dev/null +++ b/include/grub/efiemu/runtime.h @@ -0,0 +1,37 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_EFI_EMU_RUNTIME_HEADER +#define GRUB_EFI_EMU_RUNTIME_HEADER 1 + +struct grub_efiemu_ptv_rel +{ + grub_uint64_t addr; + grub_efi_memory_type_t plustype; + grub_efi_memory_type_t minustype; + grub_uint32_t size; +} __attribute__ ((packed)); + +struct efi_variable +{ + grub_efi_guid_t guid; + grub_uint32_t namelen; + grub_uint32_t size; + grub_efi_uint32_t attributes; +} __attribute__ ((packed)); +#endif /* ! GRUB_EFI_EMU_RUNTIME_HEADER */ diff --git a/include/grub/i386/efiemu.h b/include/grub/i386/efiemu.h new file mode 100644 index 000000000..1b29f459f --- /dev/null +++ b/include/grub/i386/efiemu.h @@ -0,0 +1,33 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_ARCH_EFI_EMU_HEADER +#define GRUB_ARCH_EFI_EMU_HEADER 1 + +grub_err_t +grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, + struct grub_efiemu_elf_sym *elfsyms, + void *ehdr); +grub_err_t +grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, + struct grub_efiemu_elf_sym *elfsyms, + void *ehdr); + +int grub_arch_efiemu_check_header32 (void *ehdr); +int grub_arch_efiemu_check_header64 (void *ehdr); +#endif diff --git a/include/grub/i386/pc/efiemu.h b/include/grub/i386/pc/efiemu.h new file mode 100644 index 000000000..f269dd085 --- /dev/null +++ b/include/grub/i386/pc/efiemu.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_EFI_EMU_HEADER +#define GRUB_MACHINE_EFI_EMU_HEADER 1 + +grub_err_t grub_machine_efiemu_init_tables (void); + +#endif diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 8a7a4daef..31c2dc7fd 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -211,7 +211,7 @@ if test -n "$tmp"; then fi # Copy the GRUB images to the GRUB directory. -for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img; do +for file in ${grubdir}/*.mod ${grubdir}/*.lst ${grubdir}/*.img ${grubdir}/efiemu??.o; do if test -f $file && [ "`basename $file`" != menu.lst ]; then rm -f $file || exit 1 fi @@ -220,7 +220,7 @@ for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do cp -f $file ${grubdir} || exit 1 done if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then - for file in ${pkglibdir}/*.img; do + for file in ${pkglibdir}/*.img ${pkglibdir}/efiemu??.o; do cp -f $file ${grubdir} || exit 1 done fi diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index ca9af16e9..7d28acd51 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -116,7 +116,7 @@ fi aux_dir=`mktemp -d` mkdir -p ${aux_dir}/boot/grub -cp ${input_dir}/*.mod \ +cp ${input_dir}/*.mod ${input_dir}/efiemu??.o \ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ ${input_dir}/handler.lst ${input_dir}/parttool.lst \ ${aux_dir}/boot/grub/ From bbee0f2b56626e7dc20a69782740ad64c35f3770 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 2 May 2009 23:19:20 +0000 Subject: [PATCH 0700/1707] 2009-05-03 Vladimir Serbinenko xnu support * conf/i386-efi.rmk (kernel_mod_HEADERS): added i386/pit.h (pkglib_MODULES): add xnu.mod (xnu_mod_SOURCES): new variable (xnu_mod_CFLAGS): likewise (xnu_mod_LDFLAGS): likewise (xnu_mod_ASFLAGS): likewise * conf/i386-pc.rmk: likewise * conf/x86_64-efi.rmk: likewise * include/grub/efi/efi.h (grub_efi_finish_boot_services): new declaration * include/grub/i386/macho.h: new file * include/grub/i386/xnu.h: likewise * include/grub/macho.h: likewise * include/grub/machoload.h: likewise * include/grub/x86_64/macho.h: likewise * include/grub/x86_64/xnu.h: likewise * include/grub/xnu.h: likewise * kern/efi/efi.c (grub_efi_finish_boot_services): new function * kern/efi/mm.c (MAX_HEAP_SIZE): increase * loader/i386/efi/xnu.c: new file * loader/i386/pc/xnu.c: likewise * loader/i386/xnu.c: likewise * loader/i386/xnu_helper.S: likewise * loader/macho.c: likewise * loader/xnu.c: likewise * loader/xnu_resume.c: likewise * util/grub-dumpdevtree: likewise * include/grub/i386/pit.h: include grub/err.h (grub_pit_wait): export * util/grub.d/30_os-prober.in: support Darwin/Mac OS X --- ChangeLog | 35 + conf/i386-efi.rmk | 9 +- conf/i386-pc.rmk | 9 +- conf/x86_64-efi.rmk | 11 +- include/grub/efi/efi.h | 1 + include/grub/i386/macho.h | 11 + include/grub/i386/pit.h | 3 +- include/grub/i386/xnu.h | 60 ++ include/grub/macho.h | 107 +++ include/grub/machoload.h | 62 ++ include/grub/x86_64/macho.h | 1 + include/grub/x86_64/xnu.h | 1 + include/grub/xnu.h | 107 +++ kern/efi/efi.c | 23 + kern/efi/mm.c | 2 +- loader/i386/efi/xnu.c | 177 +++++ loader/i386/pc/xnu.c | 80 ++ loader/i386/xnu.c | 539 ++++++++++++++ loader/i386/xnu_helper.S | 192 +++++ loader/macho.c | 395 ++++++++++ loader/xnu.c | 1368 +++++++++++++++++++++++++++++++++++ loader/xnu_resume.c | 136 ++++ util/grub-dumpdevtree | 3 + util/grub.d/30_os-prober.in | 52 ++ 24 files changed, 3378 insertions(+), 6 deletions(-) create mode 100644 include/grub/i386/macho.h create mode 100644 include/grub/i386/xnu.h create mode 100644 include/grub/macho.h create mode 100644 include/grub/machoload.h create mode 100644 include/grub/x86_64/macho.h create mode 100644 include/grub/x86_64/xnu.h create mode 100644 include/grub/xnu.h create mode 100644 loader/i386/efi/xnu.c create mode 100644 loader/i386/pc/xnu.c create mode 100644 loader/i386/xnu.c create mode 100644 loader/i386/xnu_helper.S create mode 100644 loader/macho.c create mode 100644 loader/xnu.c create mode 100644 loader/xnu_resume.c create mode 100644 util/grub-dumpdevtree diff --git a/ChangeLog b/ChangeLog index 967ba0b05..077b9e58c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,38 @@ +2009-05-03 Vladimir Serbinenko + + xnu support + + * conf/i386-efi.rmk (kernel_mod_HEADERS): added i386/pit.h + (pkglib_MODULES): add xnu.mod + (xnu_mod_SOURCES): new variable + (xnu_mod_CFLAGS): likewise + (xnu_mod_LDFLAGS): likewise + (xnu_mod_ASFLAGS): likewise + * conf/i386-pc.rmk: likewise + * conf/x86_64-efi.rmk: likewise + * include/grub/efi/efi.h (grub_efi_finish_boot_services): + new declaration + * include/grub/i386/macho.h: new file + * include/grub/i386/xnu.h: likewise + * include/grub/macho.h: likewise + * include/grub/machoload.h: likewise + * include/grub/x86_64/macho.h: likewise + * include/grub/x86_64/xnu.h: likewise + * include/grub/xnu.h: likewise + * kern/efi/efi.c (grub_efi_finish_boot_services): new function + * kern/efi/mm.c (MAX_HEAP_SIZE): increase + * loader/i386/efi/xnu.c: new file + * loader/i386/pc/xnu.c: likewise + * loader/i386/xnu.c: likewise + * loader/i386/xnu_helper.S: likewise + * loader/macho.c: likewise + * loader/xnu.c: likewise + * loader/xnu_resume.c: likewise + * util/grub-dumpdevtree: likewise + * include/grub/i386/pit.h: include grub/err.h + (grub_pit_wait): export + * util/grub.d/30_os-prober.in: support Darwin/Mac OS X + 2009-05-02 Vladimir Serbinenko Efiemu diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 1a211e664..c698d3ef5 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -101,7 +101,7 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h list.h handler.h command.h + efi/efi.h efi/time.h efi/disk.h i386/pit.h list.h handler.h command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -187,5 +187,12 @@ fixvideo_mod_SOURCES = commands/efi/fixvideo.c fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += xnu.mod +xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\ + loader/macho.c loader/xnu.c loader/i386/xnu_helper.S +xnu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) +xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index ae7bbad77..2530dd28e 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -62,7 +62,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ - machine/kernel.h machine/pxe.h list.h handler.h command.h + machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) @@ -229,6 +229,13 @@ linux_mod_SOURCES = loader/i386/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += xnu.mod +xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/pc/xnu.c\ + loader/macho.c loader/xnu.c loader/i386/xnu_helper.S +xnu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) +xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) + # For reboot.mod. reboot_mod_SOURCES = commands/reboot.c reboot_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 0f3ce62b2..8cdfa8a7b 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -99,8 +99,8 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ - efi/efi.h efi/time.h efi/disk.h machine/loader.h list.h handler.h \ - command.h + efi/efi.h efi/time.h efi/disk.h machine/loader.h i386/pit.h list.h \ + handler.h command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) kernel_mod_LDFLAGS = $(COMMON_LDFLAGS) @@ -186,4 +186,11 @@ fixvideo_mod_SOURCES = commands/efi/fixvideo.c fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += xnu.mod +xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\ + loader/macho.c loader/xnu.c loader/i386/xnu_helper.S +xnu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) +xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) + include $(srcdir)/conf/common.mk diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index 8c277c00f..916f9d662 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -56,6 +56,7 @@ EXPORT_FUNC(grub_efi_get_device_path) (grub_efi_handle_t handle); int EXPORT_FUNC(grub_efi_exit_boot_services) (grub_efi_uintn_t map_key); void EXPORT_FUNC (grub_reboot) (void); void EXPORT_FUNC (grub_halt) (void); +int EXPORT_FUNC (grub_efi_finish_boot_services) (void); void grub_efi_mm_init (void); void grub_efi_mm_fini (void); diff --git a/include/grub/i386/macho.h b/include/grub/i386/macho.h new file mode 100644 index 000000000..61e72a71b --- /dev/null +++ b/include/grub/i386/macho.h @@ -0,0 +1,11 @@ +#define GRUB_MACHO_CPUTYPE_IS_HOST32(x) ((x)==0x00000007) +#define GRUB_MACHO_CPUTYPE_IS_HOST64(x) ((x)==0x01000007) + +struct grub_macho_thread32 +{ + grub_uint32_t cmd; + grub_uint32_t cmdsize; + grub_uint8_t unknown1[48]; + grub_uint32_t entry_point; + grub_uint8_t unknown2[20]; +} __attribute__ ((packed)); diff --git a/include/grub/i386/pit.h b/include/grub/i386/pit.h index 0da271dfa..ff9b9a6d7 100644 --- a/include/grub/i386/pit.h +++ b/include/grub/i386/pit.h @@ -20,7 +20,8 @@ #define KERNEL_CPU_PIT_HEADER 1 #include +#include -extern void grub_pit_wait (grub_uint16_t tics); +void EXPORT_FUNC(grub_pit_wait) (grub_uint16_t tics); #endif /* ! KERNEL_CPU_PIT_HEADER */ diff --git a/include/grub/i386/xnu.h b/include/grub/i386/xnu.h new file mode 100644 index 000000000..c4c10b0f4 --- /dev/null +++ b/include/grub/i386/xnu.h @@ -0,0 +1,60 @@ +#ifndef GRUB_CPU_XNU_H +#define GRUB_CPU_XNU_H 1 + +#define GRUB_XNU_PAGESIZE 4096 +typedef grub_uint32_t grub_xnu_ptr_t; + +struct grub_xnu_boot_params +{ + grub_uint16_t verminor; + grub_uint16_t vermajor; + /* Command line passed to xnu. */ + grub_uint8_t cmdline[1024]; + + /* Later are the same as EFI's get_memory_map (). */ + grub_xnu_ptr_t efi_mmap; + grub_uint32_t efi_mmap_size; + grub_uint32_t efi_mem_desc_size; + grub_uint32_t efi_mem_desc_version; + + /* Later are video parameters. */ + grub_xnu_ptr_t lfb_base; +#define GRUB_XNU_VIDEO_SPLASH 1 +#define GRUB_XNU_VIDEO_TEXT_IN_VIDEO 2 + grub_uint32_t lfb_mode; + grub_uint32_t lfb_line_len; + grub_uint32_t lfb_width; + grub_uint32_t lfb_height; + grub_uint32_t lfb_depth; + + /* Pointer to device tree and its len. */ + grub_xnu_ptr_t devtree; + grub_uint32_t devtreelen; + + /* First used address by kernel or boot structures. */ + grub_xnu_ptr_t heap_start; + /* Last used address by kernel or boot structures minus previous value. */ + grub_uint32_t heap_size; + + /* First memory page containing runtime code or data. */ + grub_uint32_t efi_runtime_first_page; + /* First memory page containing runtime code or data minus previous value. */ + grub_uint32_t efi_runtime_npages; + grub_uint32_t efi_system_table; + /* Size of grub_efi_uintn_t in bits. */ + grub_uint8_t efi_uintnbits; +} __attribute__ ((packed)); +#define GRUB_XNU_BOOTARGS_VERMINOR 4 +#define GRUB_XNU_BOOTARGS_VERMAJOR 1 + +extern grub_uint32_t grub_xnu_entry_point; +extern grub_uint32_t grub_xnu_stack; +extern grub_uint32_t grub_xnu_arg1; +extern char grub_xnu_cmdline[1024]; +grub_err_t grub_xnu_boot (void); +grub_err_t grub_cpu_xnu_fill_devicetree (void); +grub_err_t grub_xnu_set_video (struct grub_xnu_boot_params *bootparams_relloc); +extern grub_uint32_t grub_xnu_heap_will_be_at; +extern grub_uint8_t grub_xnu_launcher_start[]; +extern grub_uint8_t grub_xnu_launcher_end[]; +#endif diff --git a/include/grub/macho.h b/include/grub/macho.h new file mode 100644 index 000000000..7dfd54e2e --- /dev/null +++ b/include/grub/macho.h @@ -0,0 +1,107 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHO_H +#define GRUB_MACHO_H 1 +#include + +/* Multi-architecture header. Always in big-endian. */ +struct grub_macho_fat_header +{ + grub_uint32_t magic; + grub_uint32_t nfat_arch; +} __attribute__ ((packed)); +#define GRUB_MACHO_FAT_MAGIC 0xcafebabe + +typedef grub_uint32_t grub_macho_cpu_type_t; +typedef grub_uint32_t grub_macho_cpu_subtype_t; + +/* Architecture descriptor. Always in big-endian. */ +struct grub_macho_fat_arch +{ + grub_macho_cpu_type_t cputype; + grub_macho_cpu_subtype_t cpusubtype; + grub_uint32_t offset; + grub_uint32_t size; + grub_uint32_t align; +} __attribute__ ((packed));; + +/* File header for 32-bit. Always in native-endian. */ +struct grub_macho_header32 +{ +#define GRUB_MACHO_MAGIC32 0xfeedface + grub_uint32_t magic; + grub_macho_cpu_type_t cputype; + grub_macho_cpu_subtype_t cpusubtype; + grub_uint32_t filetype; + grub_uint32_t ncmds; + grub_uint32_t sizeofcmds; + grub_uint32_t flags; +} __attribute__ ((packed)); + +/* File header for 64-bit. Always in native-endian. */ +struct grub_macho_header64 +{ +#define GRUB_MACHO_MAGIC64 0xfeedfacf + grub_uint32_t magic; + grub_macho_cpu_type_t cputype; + grub_macho_cpu_subtype_t cpusubtype; + grub_uint32_t filetype; + grub_uint32_t ncmds; + grub_uint32_t sizeofcmds; + grub_uint32_t flags; + grub_uint32_t reserved; +} __attribute__ ((packed)); + +/* Convenience union. What do we need to load to identify the file type. */ +union grub_macho_filestart +{ + struct grub_macho_fat_header fat; + struct grub_macho_header32 thin32; + struct grub_macho_header64 thin64; +} __attribute__ ((packed)); + +/* Common header of Mach-O commands. */ +struct grub_macho_cmd +{ + grub_uint32_t cmd; + grub_uint32_t cmdsize; +} __attribute__ ((packed)); + +typedef grub_uint32_t grub_macho_vmprot_t; + +/* 32-bit segment command. */ +struct grub_macho_segment32 +{ +#define GRUB_MACHO_CMD_SEGMENT32 1 + grub_uint32_t cmd; + grub_uint32_t cmdsize; + grub_uint8_t segname[16]; + grub_uint32_t vmaddr; + grub_uint32_t vmsize; + grub_uint32_t fileoff; + grub_uint32_t filesize; + grub_macho_vmprot_t maxprot; + grub_macho_vmprot_t initprot; + grub_uint32_t nsects; + grub_uint32_t flags; +} __attribute__ ((packed)); + +#define GRUB_MACHO_CMD_THREAD 5 + +#endif diff --git a/include/grub/machoload.h b/include/grub/machoload.h new file mode 100644 index 000000000..572496fd3 --- /dev/null +++ b/include/grub/machoload.h @@ -0,0 +1,62 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHOLOAD_HEADER +#define GRUB_MACHOLOAD_HEADER 1 + +#include +#include +#include +#include +#include + +struct grub_macho_file +{ + grub_file_t file; + grub_ssize_t offset32; + grub_ssize_t end32; + int ncmds32; + grub_size_t cmdsize32; + grub_uint8_t *cmds32; + grub_ssize_t offset64; + grub_ssize_t end64; + int ncmds64; + grub_size_t cmdsize64; + grub_uint8_t *cmds64; +}; +typedef struct grub_macho_file *grub_macho_t; + +grub_macho_t grub_macho_open (const char *); +grub_macho_t grub_macho_file (grub_file_t); +grub_err_t grub_macho_close (grub_macho_t); + +int grub_macho_contains_macho32 (grub_macho_t); +grub_err_t grub_macho32_size (grub_macho_t macho, grub_addr_t *segments_start, + grub_addr_t *segments_end, int flags); +grub_uint32_t grub_macho32_get_entry_point (grub_macho_t macho); + +/* Ignore BSS segments when loading. */ +#define GRUB_MACHO_NOBSS 0x1 +grub_err_t grub_macho32_load (grub_macho_t macho, char *offset, int flags); + +/* Like filesize and file_read but take only 32-bit part + for current architecture. */ +grub_size_t grub_macho32_filesize (grub_macho_t macho); +grub_err_t grub_macho32_readfile (grub_macho_t macho, void *dest); + +#endif /* ! GRUB_MACHOLOAD_HEADER */ diff --git a/include/grub/x86_64/macho.h b/include/grub/x86_64/macho.h new file mode 100644 index 000000000..165b8da7a --- /dev/null +++ b/include/grub/x86_64/macho.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/x86_64/xnu.h b/include/grub/x86_64/xnu.h new file mode 100644 index 000000000..ae61733b9 --- /dev/null +++ b/include/grub/x86_64/xnu.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/xnu.h b/include/grub/xnu.h new file mode 100644 index 000000000..1462dc850 --- /dev/null +++ b/include/grub/xnu.h @@ -0,0 +1,107 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_XNU_H +#define GRUB_XNU_H 1 + +#include + +/* Header of a hibernation image. */ +struct grub_xnu_hibernate_header +{ + /* Size of the image. Notice that file containing image is usually bigger. */ + grub_uint64_t image_size; + grub_uint8_t unknown1[8]; + /* Where to copy lauchcode?*/ + grub_uint32_t launchcode_target_page; + /* How many pages of launchcode? */ + grub_uint32_t launchcode_numpages; + /* Where to jump? */ + grub_uint32_t entry_point; + /* %esp at start. */ + grub_uint32_t stack; + grub_uint8_t unknown2[44]; +#define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65 + grub_uint32_t magic; + grub_uint8_t unknown3[28]; + /* This value is non-zero if page is encrypted. Unsupported. */ + grub_uint64_t encoffset; + grub_uint8_t unknown4[360]; + /* The size of additional header used to locate image without parsing FS. + Used only to skip it. + */ + grub_uint32_t extmapsize; +} __attribute__ ((packed)); + +/* In-memory structure for temporary keeping device tree. */ +struct grub_xnu_devtree_key +{ + char *name; + int datasize; /* -1 for not leaves. */ + union + { + struct grub_xnu_devtree_key *first_child; + void *data; + }; + struct grub_xnu_devtree_key *next; +}; + +/* A structure used in memory-map values. */ +struct +grub_xnu_extdesc +{ + grub_uint32_t addr; + grub_uint32_t size; +} __attribute__ ((packed)); + +/* Header describing extension in the memory. */ +struct grub_xnu_extheader +{ + grub_uint32_t infoplistaddr; + grub_uint32_t infoplistsize; + grub_uint32_t binaryaddr; + grub_uint32_t binarysize; +} __attribute__ ((packed)); + +struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent, + char *name); + +extern struct grub_xnu_devtree_key *grub_xnu_devtree_root; + +void grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur); + +grub_err_t grub_xnu_writetree_toheap (void **start, grub_size_t *size); +struct grub_xnu_devtree_key *grub_xnu_create_value (struct grub_xnu_devtree_key **parent, + char *name); + +void grub_xnu_lock (void); +void grub_xnu_unlock (void); +grub_err_t grub_xnu_resume (char *imagename); +struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent, + char *name); +grub_err_t grub_xnu_align_heap (int align); +grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, + int maxrecursion); +grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, + int maxrecursion); +void *grub_xnu_heap_malloc (int size); +extern grub_uint32_t grub_xnu_heap_real_start; +extern grub_size_t grub_xnu_heap_size; +extern char *grub_xnu_heap_start; +extern struct grub_video_bitmap *grub_xnu_bitmap; +#endif diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 9c9a40003..25007e310 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -734,3 +734,26 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) dp = (grub_efi_device_path_t *) ((char *) dp + len); } } + +int +grub_efi_finish_boot_services (void) +{ + grub_efi_uintn_t mmap_size = 0; + grub_efi_uintn_t map_key; + grub_efi_uintn_t desc_size; + grub_efi_uint32_t desc_version; + void *mmap_buf = 0; + + if (grub_efi_get_memory_map (&mmap_size, mmap_buf, &map_key, + &desc_size, &desc_version) < 0) + return 0; + + mmap_buf = grub_malloc (mmap_size); + + if (grub_efi_get_memory_map (&mmap_size, mmap_buf, &map_key, + &desc_size, &desc_version) <= 0) + return 0; + + return grub_efi_exit_boot_services (map_key); +} + diff --git a/kern/efi/mm.c b/kern/efi/mm.c index 35b12abb0..463577616 100644 --- a/kern/efi/mm.c +++ b/kern/efi/mm.c @@ -47,7 +47,7 @@ static struct allocated_page *allocated_pages = 0; /* The minimum and maximum heap size for GRUB itself. */ #define MIN_HEAP_SIZE 0x100000 -#define MAX_HEAP_SIZE (16 * 0x100000) +#define MAX_HEAP_SIZE (1600 * 0x100000) /* Allocate pages. Return the pointer to the first of allocated pages. */ diff --git a/loader/i386/efi/xnu.c b/loader/i386/efi/xnu.c new file mode 100644 index 000000000..5085cdbea --- /dev/null +++ b/loader/i386/efi/xnu.c @@ -0,0 +1,177 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +/* Setup video for xnu. Big parts are copied from linux.c. */ + +static grub_efi_guid_t uga_draw_guid = GRUB_EFI_UGA_DRAW_GUID; + +#define RGB_MASK 0xffffff +#define RGB_MAGIC 0x121314 +#define LINE_MIN 800 +#define LINE_MAX 4096 +#define FBTEST_STEP (0x10000 >> 2) +#define FBTEST_COUNT 8 + +static int +find_line_len (grub_uint32_t *fb_base, grub_uint32_t *line_len) +{ + grub_uint32_t *base = (grub_uint32_t *) (grub_target_addr_t) *fb_base; + int i; + + for (i = 0; i < FBTEST_COUNT; i++, base += FBTEST_STEP) + { + if ((*base & RGB_MASK) == RGB_MAGIC) + { + int j; + + for (j = LINE_MIN; j <= LINE_MAX; j++) + { + if ((base[j] & RGB_MASK) == RGB_MAGIC) + { + *fb_base = (grub_uint32_t) (grub_target_addr_t) base; + *line_len = j << 2; + + return 1; + } + } + + break; + } + } + + return 0; +} + +static int +find_framebuf (grub_uint32_t *fb_base, grub_uint32_t *line_len) +{ + int found = 0; + + auto int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, + grub_pci_id_t pciid); + + int NESTED_FUNC_ATTR find_card (int bus, int dev, int func, + grub_pci_id_t pciid) + { + grub_pci_address_t addr; + + addr = grub_pci_make_address (bus, dev, func, 2); + if (grub_pci_read (addr) >> 24 == 0x3) + { + int i; + + grub_printf ("Display controller: %d:%d.%d\nDevice id: %x\n", + bus, dev, func, pciid); + addr += 8; + for (i = 0; i < 6; i++, addr += 4) + { + grub_uint32_t old_bar1, old_bar2, type; + grub_uint64_t base64; + + old_bar1 = grub_pci_read (addr); + if ((! old_bar1) || (old_bar1 & GRUB_PCI_ADDR_SPACE_IO)) + continue; + + type = old_bar1 & GRUB_PCI_ADDR_MEM_TYPE_MASK; + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + if (i == 5) + break; + + old_bar2 = grub_pci_read (addr + 4); + } + else + old_bar2 = 0; + + base64 = old_bar2; + base64 <<= 32; + base64 |= (old_bar1 & GRUB_PCI_ADDR_MEM_MASK); + + grub_printf ("%s(%d): 0x%llx\n", + ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) ? + "VMEM" : "MMIO"), i, + (unsigned long long) base64); + + if ((old_bar1 & GRUB_PCI_ADDR_MEM_PREFETCH) && (! found)) + { + *fb_base = base64; + if (find_line_len (fb_base, line_len)) + found++; + } + + if (type == GRUB_PCI_ADDR_MEM_TYPE_64) + { + i++; + addr += 4; + } + } + } + + return found; + } + + grub_pci_iterate (find_card); + return found; +} + +grub_err_t +grub_xnu_set_video (struct grub_xnu_boot_params *params) +{ + grub_efi_uga_draw_protocol_t *c; + grub_uint32_t width, height, depth, rate, pixel, fb_base, line_len; + int ret; + + c = grub_efi_locate_protocol (&uga_draw_guid, 0); + if (! c) + return grub_error (GRUB_ERR_IO, "Couldn't find UGADraw"); + + if (efi_call_5 (c->get_mode, c, &width, &height, &depth, &rate)) + return grub_error (GRUB_ERR_IO, "Couldn't retrieve video mode"); + + grub_printf ("Video mode: %ux%u-%u@%u\n", width, height, depth, rate); + + grub_efi_set_text_mode (0); + pixel = RGB_MAGIC; + efi_call_10 (c->blt, c, (struct grub_efi_uga_pixel *) &pixel, + GRUB_EFI_UGA_VIDEO_FILL, 0, 0, 0, 0, 1, height, 0); + ret = find_framebuf (&fb_base, &line_len); + grub_efi_set_text_mode (1); + + if (! ret) + return grub_error (GRUB_ERR_IO, "Can\'t find frame buffer address\n"); + + grub_printf ("Frame buffer base: 0x%x\n", fb_base); + grub_printf ("Video line length: %d\n", line_len); + + params->lfb_width = width; + params->lfb_height = height; + params->lfb_depth = depth; + params->lfb_line_len = line_len; + params->lfb_mode = GRUB_XNU_VIDEO_TEXT_IN_VIDEO; + params->lfb_base = fb_base; + return GRUB_ERR_NONE; +} diff --git a/loader/i386/pc/xnu.c b/loader/i386/pc/xnu.c new file mode 100644 index 000000000..1cca1387e --- /dev/null +++ b/loader/i386/pc/xnu.c @@ -0,0 +1,80 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +#define min(a,b) (((a) < (b)) ? (a) : (b)) +#define max(a,b) (((a) > (b)) ? (a) : (b)) + +/* Setup video for xnu. */ +grub_err_t +grub_xnu_set_video (struct grub_xnu_boot_params *params) +{ + struct grub_video_mode_info mode_info; + struct grub_video_render_target *render_target; + int ret; + int x,y; + grub_err_t err; + + ret = grub_video_get_info (&mode_info); + if (ret) + return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); + + ret = grub_video_get_active_render_target (&render_target); + if (ret) + return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); + + err = GRUB_ERR_NONE; + x = mode_info.width - grub_xnu_bitmap->mode_info.width; + x /= 2; + y = mode_info.height - grub_xnu_bitmap->mode_info.height; + y /= 2; + err = grub_video_blit_bitmap (grub_xnu_bitmap, + GRUB_VIDEO_BLIT_REPLACE, + x > 0 ? x : 0, + y > 0 ? y : 0, + x < 0 ? -x : 0, + y < 0 ? -y : 0, + min (grub_xnu_bitmap->mode_info.width, + mode_info.width), + min (grub_xnu_bitmap->mode_info.height, + mode_info.height)); + if (err) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + grub_xnu_bitmap = 0; + } + + params->lfb_width = mode_info.width; + params->lfb_height = mode_info.height; + params->lfb_depth = mode_info.bpp; + params->lfb_line_len = mode_info.pitch; + + params->lfb_base = PTR_TO_UINT32 (render_target->data); + params->lfb_mode = grub_xnu_bitmap + ? GRUB_XNU_VIDEO_SPLASH : GRUB_XNU_VIDEO_TEXT_IN_VIDEO; + + return GRUB_ERR_NONE; +} + diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c new file mode 100644 index 000000000..086016024 --- /dev/null +++ b/loader/i386/xnu.c @@ -0,0 +1,539 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +char grub_xnu_cmdline[1024]; + +/* Aliases set for some tables. */ +struct tbl_alias +{ + grub_efi_guid_t guid; + char *name; +}; + +struct tbl_alias table_aliases[] = + { + {GRUB_EFI_ACPI_20_TABLE_GUID, "ACPI_20"}, + {GRUB_EFI_ACPI_TABLE_GUID, "ACPI"}, + }; + +/* The following function is used to be able to debug xnu loader + with grub-emu. */ +#ifdef GRUB_UTIL +static grub_err_t +grub_xnu_launch (void) +{ + grub_printf ("Fake launch %x:%p:%p", grub_xnu_entry_point, grub_xnu_arg1, + grub_xnu_stack); + grub_getkey (); + return 0; +} +#else +static void (*grub_xnu_launch) (void) = 0; +#endif + +static int +utf16_strlen (grub_uint16_t *in) +{ + int i; + for (i = 0; in[i]; i++); + return i; +} + +/* Read frequency from a string in MHz and return it in Hz. */ +static grub_uint64_t +readfrequency (const char *str) +{ + grub_uint64_t num = 0; + int mul = 1000000; + int found = 0; + + while (*str) + { + unsigned long digit; + + digit = grub_tolower (*str) - '0'; + if (digit > 9) + break; + + found = 1; + + num = num * 10 + digit; + str++; + } + num *= 1000000; + if (*str == '.') + { + str++; + while (*str) + { + unsigned long digit; + + digit = grub_tolower (*str) - '0'; + if (digit > 9) + break; + + found = 1; + + mul /= 10; + num = num + mul * digit; + str++; + } + } + if (! found) + return 0; + + return num; +} + +/* Thanks to Kabyl for precious information about Intel architecture. */ +static grub_uint64_t +guessfsb (void) +{ + const grub_uint64_t sane_value = 100000000; + grub_uint32_t manufacturer[3], max_cpuid, capabilities, msrlow; + grub_uint64_t start_tsc; + grub_uint64_t end_tsc; + grub_uint64_t tsc_ticks_per_ms; + + if (! grub_cpu_is_cpuid_supported ()) + return sane_value; + asm volatile ("movl $0, %%eax\n" + "cpuid" + : "=a" (max_cpuid), "=b" (manufacturer[0]), + "=d" (manufacturer[1]), "=c" (manufacturer[2])); + + /* Only Intel for now is done. */ + if (grub_memcmp (manufacturer, "GenuineIntel", 12) != 0) + return sane_value; + + /* Check Speedstep. */ + if (max_cpuid < 1) + return sane_value; + + asm volatile ("movl $1, %%eax\n" + "cpuid" + : "=c" (capabilities): + : "%eax", "%ebx", "%edx"); + + if (! (capabilities & (1 << 7))) + return sane_value; + + /* Calibrate the TSC rate. */ + + start_tsc = grub_get_tsc (); + grub_pit_wait (0xffff); + end_tsc = grub_get_tsc (); + + tsc_ticks_per_ms = grub_divmod64 (end_tsc - start_tsc, 55, 0); + + /* Read the multiplier. */ + asm volatile ("movl $0x198, %%ecx\n" + "rdmsr" + : "=d" (msrlow) + : + : "%ecx", "%eax"); + + return grub_divmod64 (2000 * tsc_ticks_per_ms, + ((msrlow >> 7) & 0x3e) + ((msrlow >> 14) & 1), 0); +} + +/* Fill device tree. */ +/* FIXME: some entries may be platform-agnostic. Move them to loader/xnu.c. */ +grub_err_t +grub_cpu_xnu_fill_devicetree (void) +{ + struct grub_xnu_devtree_key *efikey; + struct grub_xnu_devtree_key *cfgtablekey; + struct grub_xnu_devtree_key *curval; + struct grub_xnu_devtree_key *runtimesrvkey; + struct grub_xnu_devtree_key *platformkey; + unsigned i, j; + grub_err_t err; + + err = grub_autoefi_prepare (); + if (err) + return err; + + /* The value "model". */ + /* FIXME: may this value be sometimes different? */ + curval = grub_xnu_create_value (&grub_xnu_devtree_root, "model"); + if (! curval) + return grub_errno; + curval->datasize = sizeof ("ACPI"); + curval->data = grub_strdup ("ACPI"); + curval = grub_xnu_create_value (&grub_xnu_devtree_root, "compatible"); + if (! curval) + return grub_errno; + curval->datasize = sizeof ("ACPI"); + curval->data = grub_strdup ("ACPI"); + + /* The key "efi". */ + efikey = grub_xnu_create_key (&grub_xnu_devtree_root, "efi"); + if (! efikey) + return grub_errno; + + /* Information about firmware. */ + curval = grub_xnu_create_value (&(efikey->first_child), "firmware-revision"); + if (! curval) + return grub_errno; + curval->datasize = (SYSTEM_TABLE_SIZEOF (firmware_revision)); + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + grub_memcpy (curval->data, (SYSTEM_TABLE_VAR(firmware_revision)), + curval->datasize); + + curval = grub_xnu_create_value (&(efikey->first_child), "firmware-vendor"); + if (! curval) + return grub_errno; + curval->datasize = + 2 * (utf16_strlen (SYSTEM_TABLE_PTR (firmware_vendor)) + 1); + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + grub_memcpy (curval->data, SYSTEM_TABLE_PTR (firmware_vendor), + curval->datasize); + + curval = grub_xnu_create_value (&(efikey->first_child), "firmware-abi"); + if (! curval) + return grub_errno; + curval->datasize = sizeof ("EFI32"); + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + if (SIZEOF_OF_UINTN == 4) + grub_memcpy (curval->data, "EFI32", curval->datasize); + else + grub_memcpy (curval->data, "EFI64", curval->datasize); + + /* The key "platform". */ + platformkey = grub_xnu_create_key (&(efikey->first_child), + "platform"); + if (! platformkey) + return grub_errno; + + /* Pass FSB frequency to the kernel. */ + curval = grub_xnu_create_value (&(platformkey->first_child), "FSBFrequency"); + if (! curval) + return grub_errno; + curval->datasize = sizeof (grub_uint64_t); + curval->data = grub_malloc (curval->datasize); + if (!curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + + /* First see if user supplies the value. */ + char *fsbvar = grub_env_get ("fsb"); + if (! fsbvar) + *((grub_uint64_t *) curval->data) = 0; + else + *((grub_uint64_t *) curval->data) = readfrequency (fsbvar); + /* Try autodetect. */ + if (! *((grub_uint64_t *) curval->data)) + *((grub_uint64_t *) curval->data) = guessfsb (); + grub_dprintf ("xnu", "fsb autodetected as %llu\n", + (unsigned long long) *((grub_uint64_t *) curval->data)); + + cfgtablekey = grub_xnu_create_key (&(efikey->first_child), + "configuration-table"); + if (!cfgtablekey) + return grub_errno; + + /* Fill "configuration-table" key. */ + for (i = 0; i < SYSTEM_TABLE (num_table_entries); i++) + { + void *ptr; + struct grub_xnu_devtree_key *curkey; + grub_efi_guid_t guid; + char guidbuf[64]; + + /* Retrieve current key. */ +#ifdef GRUB_MACHINE_EFI + { + ptr = (void *) + grub_efi_system_table->configuration_table[i].vendor_table; + guid = grub_efi_system_table->configuration_table[i].vendor_guid; + } +#else + if (SIZEOF_OF_UINTN == 4) + { + ptr = UINT_TO_PTR (((grub_efiemu_configuration_table32_t *) + SYSTEM_TABLE_PTR (configuration_table))[i] + .vendor_table); + guid = + ((grub_efiemu_configuration_table32_t *) + SYSTEM_TABLE_PTR (configuration_table))[i].vendor_guid; + } + else + { + ptr = UINT_TO_PTR (((grub_efiemu_configuration_table64_t *) + SYSTEM_TABLE_PTR (configuration_table))[i] + .vendor_table); + guid = + ((grub_efiemu_configuration_table64_t *) + SYSTEM_TABLE_PTR (configuration_table))[i].vendor_guid; + } +#endif + + /* The name of key for new table. */ + grub_sprintf (guidbuf, "%08x-%04x-%04x-%02x%02x-", + guid.data1, guid.data2, guid.data3, guid.data4[0], + guid.data4[1]); + for (j = 2; j < 8; j++) + grub_sprintf (guidbuf + grub_strlen (guidbuf), "%02x", guid.data4[j]); + /* For some reason GUID has to be in uppercase. */ + for (j = 0; guidbuf[j] ; j++) + if (guidbuf[j] >= 'a' && guidbuf[j] <= 'f') + guidbuf[j] += 'A' - 'a'; + curkey = grub_xnu_create_key (&(cfgtablekey->first_child), guidbuf); + if (! curkey) + return grub_errno; + + curval = grub_xnu_create_value (&(curkey->first_child), "guid"); + if (! curval) + return grub_errno; + curval->datasize = sizeof (guid); + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't create device tree"); + grub_memcpy (curval->data, &guid, curval->datasize); + + /* The value "table". */ + curval = grub_xnu_create_value (&(curkey->first_child), "table"); + if (! curval) + return grub_errno; + curval->datasize = SIZEOF_OF_UINTN; + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't create device tree"); + if (SIZEOF_OF_UINTN == 4) + *((grub_uint32_t *)curval->data) = PTR_TO_UINT32 (ptr); + else + *((grub_uint64_t *)curval->data) = PTR_TO_UINT64 (ptr); + + /* Create alias. */ + for (j = 0; j < sizeof (table_aliases) / sizeof (table_aliases[0]); j++) + if (grub_memcmp (&table_aliases[j].guid, &guid, sizeof (guid)) == 0) + break; + if (j != sizeof (table_aliases) / sizeof (table_aliases[0])) + { + curval = grub_xnu_create_value (&(curkey->first_child), "alias"); + if (!curval) + return grub_errno; + curval->datasize = grub_strlen (table_aliases[j].name) + 1; + curval->data = grub_malloc (curval->datasize); + if (!curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't create device tree"); + grub_memcpy (curval->data, table_aliases[j].name, curval->datasize); + } + } + + /* Create and fill "runtime-services" key. */ + runtimesrvkey = grub_xnu_create_key (&(efikey->first_child), + "runtime-services"); + if (! runtimesrvkey) + return grub_errno; + curval = grub_xnu_create_value (&(runtimesrvkey->first_child), "table"); + if (! curval) + return grub_errno; + curval->datasize = SIZEOF_OF_UINTN; + curval->data = grub_malloc (curval->datasize); + if (! curval->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't create device tree"); + if (SIZEOF_OF_UINTN == 4) + *((grub_uint32_t *) curval->data) + = PTR_TO_UINT32 (SYSTEM_TABLE_PTR (runtime_services)); + else + *((grub_uint64_t *) curval->data) + = PTR_TO_UINT64 (SYSTEM_TABLE_PTR (runtime_services)); + + return GRUB_ERR_NONE; +} + +/* Boot xnu. */ +grub_err_t +grub_xnu_boot (void) +{ + struct grub_xnu_boot_params *bootparams_relloc; + grub_off_t bootparams_relloc_off; + grub_off_t mmap_relloc_off; + grub_err_t err; + grub_efi_uintn_t memory_map_size = 0; + grub_efi_memory_descriptor_t *memory_map; + grub_efi_uintn_t map_key = 0; + grub_efi_uintn_t descriptor_size = 0; + grub_efi_uint32_t descriptor_version = 0; + grub_uint64_t firstruntimeaddr, lastruntimeaddr; + void *devtree; + grub_size_t devtreelen; + int i; + + /* Page-align to avoid following parts to be inadvertently freed. */ + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) + return err; + + /* Pass memory map to kernel. */ + memory_map_size = 0; + memory_map = 0; + map_key = 0; + descriptor_size = 0; + descriptor_version = 0; + + if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, + &map_key, &descriptor_size, + &descriptor_version) < 0) + return grub_errno; + + memory_map = grub_xnu_heap_malloc (memory_map_size); + if (! memory_map) + return grub_errno; + + if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, + &map_key, &descriptor_size, + &descriptor_version) <= 0) + return grub_errno; + mmap_relloc_off = (grub_uint8_t *) memory_map + - (grub_uint8_t *) grub_xnu_heap_start; + + firstruntimeaddr = (grub_uint64_t) (-1); + lastruntimeaddr = 0; + for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++) + { + grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) + ((char *) memory_map + descriptor_size * i); + + /* Some EFI implementations set physical_start to 0 which + causes XNU crash. */ + curdesc->virtual_start = curdesc->physical_start; + + if (curdesc->type == GRUB_EFI_RUNTIME_SERVICES_DATA + || curdesc->type == GRUB_EFI_RUNTIME_SERVICES_CODE) + { + if (firstruntimeaddr > curdesc->physical_start) + firstruntimeaddr = curdesc->physical_start; + if (lastruntimeaddr < curdesc->physical_start + + curdesc->num_pages * 4096) + lastruntimeaddr = curdesc->physical_start + + curdesc->num_pages * 4096; + } + } + + /* Relocate the boot parameters to heap. */ + bootparams_relloc = grub_xnu_heap_malloc (sizeof (*bootparams_relloc)); + if (! bootparams_relloc) + return grub_errno; + bootparams_relloc_off = (grub_uint8_t *) bootparams_relloc + - (grub_uint8_t *) grub_xnu_heap_start; + err = grub_xnu_writetree_toheap (&devtree, &devtreelen); + if (err) + return err; + bootparams_relloc = (struct grub_xnu_boot_params *) + (bootparams_relloc_off + (grub_uint8_t *) grub_xnu_heap_start); + + grub_memcpy (bootparams_relloc->cmdline, grub_xnu_cmdline, + sizeof (bootparams_relloc->cmdline)); + + bootparams_relloc->devtree = ((char *) devtree - grub_xnu_heap_start) + + grub_xnu_heap_will_be_at; + bootparams_relloc->devtreelen = devtreelen; + + bootparams_relloc->heap_start = grub_xnu_heap_will_be_at; + bootparams_relloc->heap_size = grub_xnu_heap_size; + + bootparams_relloc->efi_mmap = grub_xnu_heap_will_be_at + mmap_relloc_off; + bootparams_relloc->efi_mmap_size = memory_map_size; + bootparams_relloc->efi_mem_desc_size = descriptor_size; + bootparams_relloc->efi_mem_desc_version = descriptor_version; + + bootparams_relloc->efi_runtime_first_page = firstruntimeaddr + / GRUB_XNU_PAGESIZE; + bootparams_relloc->efi_runtime_npages + = ((lastruntimeaddr + GRUB_XNU_PAGESIZE - 1) / GRUB_XNU_PAGESIZE) + - (firstruntimeaddr / GRUB_XNU_PAGESIZE); + bootparams_relloc->efi_uintnbits = SIZEOF_OF_UINTN * 8; + bootparams_relloc->efi_system_table + = PTR_TO_UINT32 (grub_autoefi_system_table); + + bootparams_relloc->verminor = GRUB_XNU_BOOTARGS_VERMINOR; + bootparams_relloc->vermajor = GRUB_XNU_BOOTARGS_VERMAJOR; + + /* Parameters for asm helper. */ + grub_xnu_stack = bootparams_relloc->heap_start + + bootparams_relloc->heap_size + GRUB_XNU_PAGESIZE; + grub_xnu_arg1 = bootparams_relloc_off + grub_xnu_heap_will_be_at; +#ifndef GRUB_UTIL + grub_xnu_launch = (void (*) (void)) + (grub_xnu_heap_start + grub_xnu_heap_size); +#endif + grub_dprintf ("xnu", "eip=%x\n", grub_xnu_entry_point); + grub_dprintf ("xnu", "launch=%p\n", grub_xnu_launch); + + const char *debug = grub_env_get ("debug"); + + if (debug && (grub_strword (debug, "all") || grub_strword (debug, "xnu"))) + { + grub_printf ("Press any key to launch xnu\n"); + grub_getkey (); + } + + /* Set video. */ + err = grub_xnu_set_video (bootparams_relloc); + if (err != GRUB_ERR_NONE) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + grub_printf ("Booting in blind mode\n"); + + bootparams_relloc->lfb_mode = 0; + bootparams_relloc->lfb_width = 0; + bootparams_relloc->lfb_height = 0; + bootparams_relloc->lfb_depth = 0; + bootparams_relloc->lfb_line_len = 0; + bootparams_relloc->lfb_base = 0; + } + + grub_memcpy (grub_xnu_heap_start + grub_xnu_heap_size, + grub_xnu_launcher_start, + grub_xnu_launcher_end - grub_xnu_launcher_start); + + + if (! grub_autoefi_finish_boot_services ()) + return grub_error (GRUB_ERR_IO, "can't exit boot services"); + + grub_xnu_launch (); + + /* Never reaches here. */ + return 0; +} diff --git a/loader/i386/xnu_helper.S b/loader/i386/xnu_helper.S new file mode 100644 index 000000000..77b0a6613 --- /dev/null +++ b/loader/i386/xnu_helper.S @@ -0,0 +1,192 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + + + .p2align 4 /* force 16-byte alignment */ + +VARIABLE(grub_xnu_launcher_start) +base: + cli + +#ifndef __x86_64__ + /* mov imm32, %eax */ + .byte 0xb8 +VARIABLE(grub_xnu_heap_will_be_at) + .long 0 + mov %eax, %edi + + /* mov imm32, %eax */ + .byte 0xb8 +VARIABLE(grub_xnu_heap_start) + .long 0 + mov %eax, %esi + + /* mov imm32, %ecx */ + .byte 0xb9 +VARIABLE(grub_xnu_heap_size) + .long 0 + mov %edi, %eax + add %ecx, %eax + /* %rax now contains our starting position after relocation. */ + /* One more page to copy: ourselves. */ + add $0x403, %ecx + shr $2, %ecx + + /* Forward copy. */ + cld + rep + movsl + + mov %eax, %esi + add $(cont0-base), %eax + jmp *%eax +cont0: +#else + xorq %rax, %rax + + /* mov imm32, %eax */ + .byte 0xb8 +VARIABLE(grub_xnu_heap_will_be_at) + .long 0 + mov %rax, %rdi + + /* mov imm32, %rax */ + .byte 0x48 + .byte 0xb8 +VARIABLE(grub_xnu_heap_start) + .long 0 + .long 0 + mov %rax, %rsi + + /* mov imm32, %rcx */ + .byte 0x48 + .byte 0xb9 +VARIABLE(grub_xnu_heap_size) + .long 0 + .long 0 + mov %rdi, %rax + add %rcx, %rax + /* %rax now contains our starting position after relocation. */ + /* One more page to copy: ourselves. */ + add $0x403, %rcx + shr $2, %rcx + + /* Forward copy. */ + cld + rep + movsl + + mov %rax, %rsi + add $(cont0-base), %rax + jmp *%rax + +cont0: + + lea (cont1-base)(%rsi, 1), %rax + mov %eax, (jump_vector-base)(%rsi,1) + + lea (gdt-base)(%rsi, 1), %rax + mov %rax, (gdt_addr-base)(%rsi,1) + + /* Switch to compatibility mode. */ + + lgdt (gdtdesc-base)(%rsi,1) + + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ + ljmp *(jump_vector-base)(%rsi,1) +cont1: + .code32 + + /* Update other registers. */ + mov $0x18, %eax + mov %eax, %ds + mov %eax, %es + mov %eax, %fs + mov %eax, %gs + mov %eax, %ss + + /* Disable paging. */ + mov %cr0, %eax + and $0x7fffffff, %eax + mov %eax, %cr0 + + /* Disable amd64. */ + mov $0xc0000080, %ecx + rdmsr + and $0xfffffeff, %eax + wrmsr + + /* Turn off PAE. */ + movl %cr4, %eax + and $0xffffffcf, %eax + mov %eax, %cr4 + + jmp cont2 +cont2: +#endif + .code32 + + /* Registers on XNU boot: eip, esp and eax. */ + /* mov imm32, %ecx */ + .byte 0xb9 +VARIABLE (grub_xnu_entry_point) + .long 0 + /* mov imm32, %eax */ + .byte 0xb8 +VARIABLE (grub_xnu_arg1) + .long 0 + /* mov imm32, %ebx */ + .byte 0xbb +VARIABLE (grub_xnu_stack) + .long 0 + + movl %ebx, %esp + + jmp *%ecx + +#ifdef __x86_64__ + /* GDT. Copied from loader/i386/linux.c. */ + .p2align 4 +gdt: + /* NULL. */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* Reserved. */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* Code segment. */ + .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00 + + /* Data segment. */ + .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00 + +gdtdesc: + .word 31 +gdt_addr: + /* Filled by the code. */ + .quad 0 + + .p2align 4 +jump_vector: + /* Jump location. Is filled by the code */ + .long 0 + .long 0x10 +#endif +VARIABLE(grub_xnu_launcher_end) diff --git a/loader/macho.c b/loader/macho.c new file mode 100644 index 000000000..da081a27f --- /dev/null +++ b/loader/macho.c @@ -0,0 +1,395 @@ +/* macho.c - load Mach-O files. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* This Mach-O loader is incomplete and can load only non-relocatable segments. + This is however enough to boot xnu (otool -l and Mach-O specs for more info). +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#define min(a,b) (((a) < (b)) ? (a) : (b)) + +/* 32-bit. */ + +int +grub_macho_contains_macho32 (grub_macho_t macho) +{ + return macho->offset32 != -1; +} + +static void +grub_macho_parse32 (grub_macho_t macho) +{ + struct grub_macho_header32 head; + + /* Is there any candidate at all? */ + if (macho->offset32 == -1) + return; + + /* Read header and check magic*/ + if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1 + || grub_file_read (macho->file, (char *) &head, sizeof (head)) + != sizeof(head)) + { + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + macho->offset32 = -1; + return; + } + if (head.magic != GRUB_MACHO_MAGIC32) + { + grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header."); + macho->offset32 = -1; + return; + } + + /* Read commands. */ + macho->ncmds32 = head.ncmds; + macho->cmdsize32 = head.sizeofcmds; + macho->cmds32 = grub_malloc(macho->cmdsize32); + if (! macho->cmds32) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to read commands"); + return; + } + if (grub_file_read (macho->file, (char *) macho->cmds32, + (grub_size_t) macho->cmdsize32) + != (grub_ssize_t) macho->cmdsize32) + { + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + macho->offset32 = -1; + } +} + +typedef int NESTED_FUNC_ATTR (*grub_macho_iter_hook_t) +(grub_macho_t , struct grub_macho_cmd *, + void *); + +static grub_err_t +grub_macho32_cmds_iterate (grub_macho_t macho, + grub_macho_iter_hook_t hook, + void *hook_arg) +{ + grub_uint8_t *hdrs = macho->cmds32; + int i; + if (! macho->cmds32) + return grub_error (GRUB_ERR_BAD_OS, "Couldn't find 32-bit Mach-O"); + for (i = 0; i < macho->ncmds32; i++) + { + struct grub_macho_cmd *hdr = (struct grub_macho_cmd *) hdrs; + if (hook (macho, hdr, hook_arg)) + break; + hdrs += hdr->cmdsize; + } + + return grub_errno; +} + +grub_size_t +grub_macho32_filesize (grub_macho_t macho) +{ + if (grub_macho_contains_macho32 (macho)) + return macho->end32 - macho->offset32; + return 0; +} + +grub_err_t +grub_macho32_readfile (grub_macho_t macho, void *dest) +{ + grub_ssize_t read; + if (! grub_macho_contains_macho32 (macho)) + return grub_error (GRUB_ERR_BAD_OS, + "Couldn't read arcitecture-specific part"); + + if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1) + { + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, + "Invalid offset in program header."); + } + + read = grub_file_read (macho->file, dest, + macho->end32 - macho->offset32); + if (read != (grub_ssize_t) (macho->end32 - macho->offset32)) + { + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, + "Couldn't read arcitecture-specific part"); + } + return GRUB_ERR_NONE; +} + +/* Calculate the amount of memory spanned by the segments. */ +grub_err_t +grub_macho32_size (grub_macho_t macho, grub_addr_t *segments_start, + grub_addr_t *segments_end, int flags) +{ + int nr_phdrs = 0; + + /* Run through the program headers to calculate the total memory size we + should claim. */ + auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho, + struct grub_macho_cmd *phdr, void *_arg); + int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho, + struct grub_macho_cmd *hdr0, void UNUSED *_arg) + { + struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0; + if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT32) + return 0; + if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) + return 0; + + nr_phdrs++; + if (hdr->vmaddr < *segments_start) + *segments_start = hdr->vmaddr; + if (hdr->vmaddr + hdr->vmsize > *segments_end) + *segments_end = hdr->vmaddr + hdr->vmsize; + return 0; + } + + *segments_start = (grub_uint32_t) -1; + *segments_end = 0; + + grub_macho32_cmds_iterate (macho, calcsize, 0); + + if (nr_phdrs == 0) + return grub_error (GRUB_ERR_BAD_OS, "No program headers present"); + + if (*segments_end < *segments_start) + /* Very bad addresses. */ + return grub_error (GRUB_ERR_BAD_OS, "Bad program header load addresses"); + + return GRUB_ERR_NONE; +} + +/* Load every loadable segment into memory specified by `_load_hook'. */ +grub_err_t +grub_macho32_load (grub_macho_t macho, char *offset, int flags) +{ + grub_err_t err = 0; + auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, + struct grub_macho_cmd *hdr0, + void UNUSED *_arg); + int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, + struct grub_macho_cmd *hdr0, + void UNUSED *_arg) + { + struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0; + + if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT32) + return 0; + + if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) + return 0; + if (! hdr->vmsize) + return 0; + + if (grub_file_seek (_macho->file, hdr->fileoff + + _macho->offset32) == (grub_off_t) -1) + { + grub_error_push (); + grub_error (GRUB_ERR_BAD_OS, + "Invalid offset in program header."); + return 1; + } + + if (hdr->filesize) + { + grub_ssize_t read; + read = grub_file_read (_macho->file, offset + hdr->vmaddr, + min (hdr->filesize, hdr->vmsize)); + if (read != (grub_ssize_t) min (hdr->filesize, hdr->vmsize)) + { + /* XXX How can we free memory from `load_hook'? */ + grub_error_push (); + err=grub_error (GRUB_ERR_BAD_OS, + "Couldn't read segment from file: " + "wanted 0x%lx bytes; read 0x%lx bytes.", + hdr->filesize, read); + return 1; + } + } + + if (hdr->filesize < hdr->vmsize) + grub_memset (offset + hdr->vmaddr + hdr->filesize, + 0, hdr->vmsize - hdr->filesize); + return 0; + } + + grub_macho32_cmds_iterate (macho, do_load, 0); + + return err; +} + +grub_uint32_t +grub_macho32_get_entry_point (grub_macho_t macho) +{ + grub_uint32_t entry_point = 0; + auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho, + struct grub_macho_cmd *hdr, + void UNUSED *_arg); + int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho, + struct grub_macho_cmd *hdr, + void UNUSED *_arg) + { + if (hdr->cmd == GRUB_MACHO_CMD_THREAD) + entry_point = ((struct grub_macho_thread32 *) hdr)->entry_point; + return 0; + } + grub_macho32_cmds_iterate (macho, hook, 0); + return entry_point; +} + + +grub_err_t +grub_macho_close (grub_macho_t macho) +{ + grub_file_t file = macho->file; + + grub_free (macho->cmds32); + grub_free (macho->cmds64); + + grub_free (macho); + + if (file) + grub_file_close (file); + + return grub_errno; +} + +grub_macho_t +grub_macho_file (grub_file_t file) +{ + grub_macho_t macho; + union grub_macho_filestart filestart; + + macho = grub_malloc (sizeof (*macho)); + if (! macho) + return 0; + + macho->file = file; + macho->offset32 = -1; + macho->offset64 = -1; + macho->end32 = -1; + macho->end64 = -1; + macho->cmds32 = 0; + macho->cmds64 = 0; + + if (grub_file_seek (macho->file, 0) == (grub_off_t) -1) + goto fail; + + if (grub_file_read (macho->file, (char *) &filestart, sizeof (filestart)) + != sizeof (filestart)) + { + grub_error_push (); + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + goto fail; + } + + /* Is it a fat file? */ + if (filestart.fat.magic == grub_be_to_cpu32 (GRUB_MACHO_FAT_MAGIC)) + { + struct grub_macho_fat_arch *archs; + int i, narchs; + + /* Load architecture description. */ + narchs = grub_be_to_cpu32 (filestart.fat.nfat_arch); + if (grub_file_seek (macho->file, sizeof (struct grub_macho_fat_header)) + == (grub_off_t) -1) + goto fail; + archs = grub_malloc (sizeof (struct grub_macho_fat_arch) * narchs); + if (!archs) + goto fail; + if (grub_file_read (macho->file, (char *) archs, + sizeof (struct grub_macho_fat_arch) * narchs) + != (grub_ssize_t)sizeof(struct grub_macho_fat_arch) * narchs) + { + grub_free (archs); + grub_error_push (); + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + goto fail; + } + + for (i = 0; i < narchs; i++) + { + if (GRUB_MACHO_CPUTYPE_IS_HOST32 + (grub_be_to_cpu32 (archs[i].cputype))) + { + macho->offset32 = grub_be_to_cpu32 (archs[i].offset); + macho->end32 = grub_be_to_cpu32 (archs[i].offset) + + grub_be_to_cpu32 (archs[i].size); + } + if (GRUB_MACHO_CPUTYPE_IS_HOST64 + (grub_be_to_cpu32 (archs[i].cputype))) + { + macho->offset64 = grub_be_to_cpu32 (archs[i].offset); + macho->end64 = grub_be_to_cpu32 (archs[i].offset) + + grub_be_to_cpu32 (archs[i].size); + } + } + grub_free (archs); + } + + /* Is it a thin 32-bit file? */ + if (filestart.thin32.magic == GRUB_MACHO_MAGIC32) + { + macho->offset32 = 0; + macho->end32 = grub_file_size (file); + } + + /* Is it a thin 64-bit file? */ + if (filestart.thin64.magic == GRUB_MACHO_MAGIC64) + { + macho->offset64 = 0; + macho->end64 = grub_file_size (file); + } + + grub_macho_parse32 (macho); + /* FIXME: implement 64-bit.*/ + /* grub_macho_parse64 (macho); */ + + return macho; + +fail: + grub_macho_close (macho); + return 0; +} + +grub_macho_t +grub_macho_open (const char *name) +{ + grub_file_t file; + grub_macho_t macho; + + file = grub_gzfile_open (name, 1); + if (! file) + return 0; + + macho = grub_macho_file (file); + if (! macho) + grub_file_close (file); + + return macho; +} diff --git a/loader/xnu.c b/loader/xnu.c new file mode 100644 index 000000000..d8af485c1 --- /dev/null +++ b/loader/xnu.c @@ -0,0 +1,1368 @@ +/* xnu.c - load xnu kernel. Thanks to Florian Idelberger for all the + time he spent testing this + */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct grub_xnu_devtree_key *grub_xnu_devtree_root = 0; +static int driverspackagenum = 0; +static int driversnum = 0; + +/* Allocate heap by 32MB-blocks. */ +#define GRUB_XNU_HEAP_ALLOC_BLOCK 0x2000000 + +static grub_err_t +grub_xnu_register_memory (char *prefix, int *suffix, + void *addr, grub_size_t size); +void * +grub_xnu_heap_malloc (int size) +{ + void *val; + +#if 0 + /* This way booting is faster but less reliable. + Once we have advanced mm second way will be as fast as this one. */ + val = grub_xnu_heap_start = (char *) 0x100000; +#else + int oldblknum, newblknum; + + /* The page after the heap is used for stack. Ensure it's usable. */ + if (grub_xnu_heap_size) + oldblknum = (grub_xnu_heap_size + GRUB_XNU_PAGESIZE + + GRUB_XNU_HEAP_ALLOC_BLOCK - 1) / GRUB_XNU_HEAP_ALLOC_BLOCK; + else + oldblknum = 0; + newblknum = (grub_xnu_heap_size + size + GRUB_XNU_PAGESIZE + + GRUB_XNU_HEAP_ALLOC_BLOCK - 1) / GRUB_XNU_HEAP_ALLOC_BLOCK; + if (oldblknum != newblknum) + /* FIXME: instruct realloc to allocate at 1MB if possible once + advanced mm is ready. */ + val = grub_realloc (grub_xnu_heap_start, + newblknum * GRUB_XNU_HEAP_ALLOC_BLOCK); + else + val = grub_xnu_heap_start; + if (! val) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, + "not enough space on xnu memory heap"); + return 0; + } + grub_xnu_heap_start = val; +#endif + + val = (char *) grub_xnu_heap_start + grub_xnu_heap_size; + grub_xnu_heap_size += size; + grub_dprintf ("xnu", "val=%p\n", val); + return (char *) val; +} + +/* Make sure next block of the heap will be aligned. + Please notice: aligned are pointers AFTER relocation + and not the current ones. */ +grub_err_t +grub_xnu_align_heap (int align) +{ + int align_overhead = align - grub_xnu_heap_size % align; + if (align_overhead == align) + return GRUB_ERR_NONE; + if (! grub_xnu_heap_malloc (align_overhead)) + return grub_errno; + return GRUB_ERR_NONE; +} + +/* Free subtree pointed by CUR. */ +void +grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur) +{ + struct grub_xnu_devtree_key *d; + while (cur) + { + grub_free (cur->name); + if (cur->datasize == -1) + grub_xnu_free_devtree (cur->first_child); + else if (cur->data) + grub_free (cur->data); + d = cur->next; + grub_free (cur); + cur = d; + } +} + +/* Compute the size of device tree in xnu format. */ +static grub_size_t +grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name) +{ + grub_size_t ret; + struct grub_xnu_devtree_key *cur; + + /* Key header. */ + ret = 2 * sizeof (grub_uint32_t); + + /* "name" value. */ + ret += 32 + sizeof (grub_uint32_t) + + grub_strlen (name) + 4 + - (grub_strlen (name) % 4); + + for (cur = start; cur; cur = cur->next) + if (cur->datasize != -1) + { + int align_overhead; + + align_overhead = 4 - (cur->datasize % 4); + if (align_overhead == 4) + align_overhead = 0; + ret += 32 + sizeof (grub_uint32_t) + cur->datasize + align_overhead; + } + else + ret += grub_xnu_writetree_get_size (cur->first_child, cur->name); + return ret; +} + +/* Write devtree in XNU format at curptr assuming the head is named NAME.*/ +static void * +grub_xnu_writetree_toheap_real (void *curptr, + struct grub_xnu_devtree_key *start, char *name) +{ + struct grub_xnu_devtree_key *cur; + int nkeys = 0, nvals = 0; + for (cur = start; cur; cur = cur->next) + { + if (cur->datasize == -1) + nkeys++; + else + nvals++; + } + /* For the name. */ + nvals++; + + *((grub_uint32_t *) curptr) = nvals; + curptr = ((grub_uint32_t *) curptr) + 1; + *((grub_uint32_t *) curptr) = nkeys; + curptr = ((grub_uint32_t *) curptr) + 1; + + /* First comes "name" value. */ + grub_memset (curptr, 0, 32); + grub_memcpy (curptr, "name", 4); + curptr = ((grub_uint8_t *) curptr) + 32; + *((grub_uint32_t *)curptr) = grub_strlen (name) + 1; + curptr = ((grub_uint32_t *) curptr) + 1; + grub_memcpy (curptr, name, grub_strlen (name)); + curptr = ((grub_uint8_t *) curptr) + grub_strlen (name); + grub_memset (curptr, 0, 4 - (grub_strlen (name) % 4)); + curptr = ((grub_uint8_t *) curptr) + (4 - (grub_strlen (name) % 4)); + + /* Then the other values. */ + for (cur = start; cur; cur = cur->next) + if (cur->datasize != -1) + { + int align_overhead; + + align_overhead = 4 - (cur->datasize % 4); + if (align_overhead == 4) + align_overhead = 0; + grub_memset (curptr, 0, 32); + grub_strncpy (curptr, cur->name, 31); + curptr = ((grub_uint8_t *) curptr) + 32; + *((grub_uint32_t *) curptr) = cur->datasize; + curptr = ((grub_uint32_t *) curptr) + 1; + grub_memcpy (curptr, cur->data, cur->datasize); + curptr = ((grub_uint8_t *) curptr) + cur->datasize; + grub_memset (curptr, 0, align_overhead); + curptr = ((grub_uint8_t *) curptr) + align_overhead; + } + + /* And then the keys. Recursively use this function. */ + for (cur = start; cur; cur = cur->next) + if (cur->datasize == -1) + if (!(curptr = grub_xnu_writetree_toheap_real (curptr, + cur->first_child, + cur->name))) + return 0; + return curptr; +} + +grub_err_t +grub_xnu_writetree_toheap (void **start, grub_size_t *size) +{ + struct grub_xnu_devtree_key *chosen; + struct grub_xnu_devtree_key *memorymap; + struct grub_xnu_devtree_key *driverkey; + struct grub_xnu_extdesc *extdesc; + grub_err_t err; + + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) + return err; + + /* Device tree itself is in the memory map of device tree. */ + /* Create a dummy value in memory-map. */ + chosen = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); + if (! chosen) + return grub_errno; + memorymap = grub_xnu_create_key (&(chosen->first_child), "memory-map"); + if (! memorymap) + return grub_errno; + + driverkey = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*driverkey)); + if (! driverkey) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't write device tree"); + driverkey->name = grub_strdup ("DeviceTree"); + if (! driverkey->name) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't write device tree"); + driverkey->datasize = sizeof (*extdesc); + driverkey->next = memorymap->first_child; + memorymap->first_child = driverkey; + driverkey->data = extdesc + = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc)); + if (! driverkey->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't write device tree"); + + /* Allocate the space based on the size with dummy value. */ + *size = grub_xnu_writetree_get_size (grub_xnu_devtree_root, "/"); + *start = grub_xnu_heap_malloc (*size + GRUB_XNU_PAGESIZE + - *size % GRUB_XNU_PAGESIZE); + + /* Put real data in the dummy. */ + extdesc->addr = (char *) *start - grub_xnu_heap_start + + grub_xnu_heap_will_be_at; + extdesc->size = (grub_uint32_t) *size; + + /* Write the tree to heap. */ + grub_xnu_writetree_toheap_real (*start, grub_xnu_devtree_root, "/"); + return GRUB_ERR_NONE; +} + +/* Find a key or value in parent key. */ +struct grub_xnu_devtree_key * +grub_xnu_find_key (struct grub_xnu_devtree_key *parent, char *name) +{ + struct grub_xnu_devtree_key *cur; + for (cur = parent; cur; cur = cur->next) + if (grub_strcmp (cur->name, name) == 0) + return cur; + return 0; +} + +struct grub_xnu_devtree_key * +grub_xnu_create_key (struct grub_xnu_devtree_key **parent, char *name) +{ + struct grub_xnu_devtree_key *ret; + ret = grub_xnu_find_key (*parent, name); + if (ret) + return ret; + ret = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*ret)); + if (! ret) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't create key %s", name); + return 0; + } + ret->name = grub_strdup (name); + if (! ret->name) + { + grub_free (ret); + grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't create key %s", name); + return 0; + } + ret->datasize = -1; + ret->first_child = 0; + ret->next = *parent; + *parent = ret; + return ret; +} + +struct grub_xnu_devtree_key * +grub_xnu_create_value (struct grub_xnu_devtree_key **parent, char *name) +{ + struct grub_xnu_devtree_key *ret; + ret = grub_xnu_find_key (*parent, name); + if (ret) + { + if (ret->datasize == -1) + grub_xnu_free_devtree (ret->first_child); + else if (ret->datasize) + grub_free (ret->data); + ret->datasize = 0; + ret->data = 0; + return ret; + } + ret = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*ret)); + if (! ret) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't create value %s", name); + return 0; + } + ret->name = grub_strdup (name); + if (! ret->name) + { + grub_free (ret); + grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't create value %s", name); + return 0; + } + ret->datasize = 0; + ret->data = 0; + ret->next = *parent; + *parent = ret; + return ret; +} + +static grub_err_t +grub_xnu_unload (void) +{ + grub_xnu_free_devtree (grub_xnu_devtree_root); + grub_xnu_devtree_root = 0; + + /* Free loaded image. */ + driversnum = 0; + driverspackagenum = 0; + grub_free (grub_xnu_heap_start); + grub_xnu_heap_start = 0; + grub_xnu_heap_size = 0; + grub_xnu_unlock (); + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_err_t err; + grub_macho_t macho; + grub_addr_t startcode, endcode; + int i; + char *ptr, *loadaddr; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + grub_xnu_unload (); + + macho = grub_macho_open (args[0]); + if (! macho) + return grub_errno; + if (! grub_macho_contains_macho32 (macho)) + { + grub_macho_close (macho); + return grub_error (GRUB_ERR_BAD_OS, + "Kernel doesn't contain suitable architecture"); + } + + err = grub_macho32_size (macho, &startcode, &endcode, GRUB_MACHO_NOBSS); + if (err) + { + grub_macho_close (macho); + grub_xnu_unload (); + return err; + } + + grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", + (unsigned long) endcode, (unsigned long) startcode); + + loadaddr = grub_xnu_heap_malloc (endcode - startcode); + grub_xnu_heap_will_be_at = startcode; + + if (! loadaddr) + { + grub_macho_close (macho); + grub_xnu_unload (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "not enough memory to load kernel"); + } + + /* Load kernel. */ + err = grub_macho32_load (macho, loadaddr - startcode, GRUB_MACHO_NOBSS); + if (err) + { + grub_macho_close (macho); + grub_xnu_unload (); + return err; + } + + grub_xnu_entry_point = grub_macho32_get_entry_point (macho); + if (! grub_xnu_entry_point) + { + grub_macho_close (macho); + grub_xnu_unload (); + return grub_error (GRUB_ERR_BAD_OS, "couldn't find entry point"); + } + + grub_macho_close (macho); + + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) + { + grub_xnu_unload (); + return err; + } + + /* Copy parameters to kernel command line. */ + ptr = grub_xnu_cmdline; + for (i = 1; i < argc; i++) + { + if (ptr + grub_strlen (args[i]) + 1 + >= grub_xnu_cmdline + sizeof (grub_xnu_cmdline)) + break; + grub_memcpy (ptr, args[i], grub_strlen (args[i])); + ptr += grub_strlen (args[i]); + *ptr = ' '; + ptr++; + } + + /* Replace last space by '\0'. */ + if (ptr != grub_xnu_cmdline) + *(ptr - 1) = 0; + + err = grub_cpu_xnu_fill_devicetree (); + if (err) + return err; + + grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); + + grub_xnu_lock (); + return 0; +} + +/* Register a memory in a memory map under name PREFIXSUFFIX + and increment SUFFIX. */ +static grub_err_t +grub_xnu_register_memory (char *prefix, int *suffix, + void *addr, grub_size_t size) +{ + struct grub_xnu_devtree_key *chosen; + struct grub_xnu_devtree_key *memorymap; + struct grub_xnu_devtree_key *driverkey; + struct grub_xnu_extdesc *extdesc; + + if (! grub_xnu_heap_size) + return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); + + chosen = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); + if (! chosen) + return grub_errno; + memorymap = grub_xnu_create_key (&(chosen->first_child), "memory-map"); + if (! memorymap) + return grub_errno; + + driverkey = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*driverkey)); + if (! driverkey) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register memory"); + if (suffix) + { + driverkey->name = grub_malloc (grub_strlen (prefix) + 10); + if (!driverkey->name) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register memory"); + grub_sprintf (driverkey->name, "%s%d", prefix, (*suffix)++); + } + else + driverkey->name = grub_strdup (prefix); + if (! driverkey->name) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register extension"); + driverkey->datasize = sizeof (*extdesc); + driverkey->next = memorymap->first_child; + memorymap->first_child = driverkey; + driverkey->data = extdesc + = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc)); + if (! driverkey->data) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register extension"); + extdesc->addr = grub_xnu_heap_will_be_at + + ((grub_uint8_t *) addr - (grub_uint8_t *) grub_xnu_heap_start); + extdesc->size = (grub_uint32_t) size; + return GRUB_ERR_NONE; +} + +/* Load .kext. */ +static grub_err_t +grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) +{ + grub_macho_t macho; + grub_err_t err; + grub_file_t infoplist; + struct grub_xnu_extheader *exthead; + int neededspace = sizeof (*exthead); + char *buf; + grub_size_t infoplistsize = 0, machosize = 0; + + if (! grub_xnu_heap_size) + return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); + + /* Compute the needed space. */ + if (binaryfile) + { + macho = grub_macho_file (binaryfile); + if (! macho || ! grub_macho_contains_macho32 (macho)) + { + if (macho) + grub_macho_close (macho); + return grub_error (GRUB_ERR_BAD_OS, + "Extension doesn't contain suitable architecture"); + } + machosize = grub_macho32_filesize (macho); + neededspace += machosize; + } + else + macho = 0; + + if (infoplistname) + infoplist = grub_gzfile_open (infoplistname, 1); + else + infoplist = 0; + grub_errno = GRUB_ERR_NONE; + if (infoplist) + { + infoplistsize = grub_file_size (infoplist); + neededspace += infoplistsize + 1; + } + else + infoplistsize = 0; + + /* Allocate the space. */ + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) + return err; + buf = grub_xnu_heap_malloc (neededspace); + + exthead = (struct grub_xnu_extheader *) buf; + grub_memset (exthead, 0, sizeof (*exthead)); + buf += sizeof (*exthead); + + /* Load the binary. */ + if (macho) + { + exthead->binaryaddr = (buf - grub_xnu_heap_start) + + grub_xnu_heap_will_be_at; + exthead->binarysize = machosize; + if ((err = grub_macho32_readfile (macho, buf))) + { + grub_macho_close (macho); + return err; + } + grub_macho_close (macho); + buf += machosize; + } + grub_errno = GRUB_ERR_NONE; + + /* Load the plist. */ + if (infoplist) + { + exthead->infoplistaddr = (buf - grub_xnu_heap_start) + + grub_xnu_heap_will_be_at; + exthead->infoplistsize = infoplistsize + 1; + if (grub_file_read (infoplist, buf, infoplistsize) + != (grub_ssize_t) (infoplistsize)) + { + grub_file_close (infoplist); + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s: ", + infoplistname); + } + grub_file_close (infoplist); + buf[infoplistsize] = 0; + } + grub_errno = GRUB_ERR_NONE; + + /* Announce to kernel */ + return grub_xnu_register_memory ("Driver-", &driversnum, exthead, + neededspace); +} + +/* Load mkext. */ +static grub_err_t +grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_file_t file; + void *loadto; + grub_err_t err; + grub_off_t readoff = 0; + grub_ssize_t readlen = -1; + struct grub_macho_fat_header head; + struct grub_macho_fat_arch *archs; + int narchs, i; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + if (! grub_xnu_heap_size) + return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); + + file = grub_gzfile_open (args[0], 1); + if (! file) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, + "Couldn't load driver package"); + + /* Sometimes caches are fat binary. Errgh. */ + if (grub_file_read (file, (char *) &head, sizeof (head)) + != (grub_ssize_t) (sizeof (head))) + { + /* I don't know the internal structure of package but + can hardly imagine a valid package shorter than 20 bytes. */ + grub_file_close (file); + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]); + } + + /* Find the corresponding architecture. */ + if (grub_be_to_cpu32 (head.magic) == GRUB_MACHO_FAT_MAGIC) + { + narchs = grub_be_to_cpu32 (head.nfat_arch); + archs = grub_malloc (sizeof (struct grub_macho_fat_arch) * narchs); + if (! archs) + { + grub_file_close (file); + grub_error_push (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Couldn't read file %s", args[0]); + + } + if (grub_file_read (file, (char *) archs, + sizeof (struct grub_macho_fat_arch) * narchs) + != (grub_ssize_t) sizeof(struct grub_macho_fat_arch) * narchs) + { + grub_free (archs); + grub_error_push (); + return grub_error (GRUB_ERR_READ_ERROR, "Cannot read fat header."); + } + for (i = 0; i < narchs; i++) + { + if (GRUB_MACHO_CPUTYPE_IS_HOST32 + (grub_be_to_cpu32 (archs[i].cputype))) + { + readoff = grub_be_to_cpu32 (archs[i].offset); + readlen = grub_be_to_cpu32 (archs[i].size); + } + } + grub_free (archs); + } + else + { + /* It's a flat file. Some sane people still exist. */ + readoff = 0; + readlen = grub_file_size (file); + } + + if (readlen == -1) + { + grub_file_close (file); + return grub_error (GRUB_ERR_BAD_OS, "no suitable architecture is found"); + } + + /* Allocate space. */ + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) + { + grub_file_close (file); + return err; + } + + loadto = grub_xnu_heap_malloc (readlen); + if (! loadto) + { + grub_file_close (file); + return grub_errno; + } + + /* Read the file. */ + grub_file_seek (file, readoff); + if (grub_file_read (file, loadto, readlen) != (grub_ssize_t) (readlen)) + { + grub_file_close (file); + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]); + } + grub_file_close (file); + + /* Pass it to kernel. */ + return grub_xnu_register_memory ("DriversPackage-", &driverspackagenum, + loadto, readlen); +} + +static grub_err_t +grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_file_t file; + void *loadto; + grub_err_t err; + grub_size_t size; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + if (! grub_xnu_heap_size) + return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); + + file = grub_gzfile_open (args[0], 1); + if (! file) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, + "Couldn't load ramdisk"); + + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) + return err; + + size = grub_file_size (file); + + loadto = grub_xnu_heap_malloc (size); + if (! loadto) + return grub_errno; + if (grub_file_read (file, loadto, size) + != (grub_ssize_t) (size)) + { + grub_file_close (file); + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]); + } + return grub_xnu_register_memory ("RAMDisk", 0, loadto, size); +} + +/* Parse a devtree file. It uses the following format: + valuename:valuedata; + keyname{ + contents + } + keyname, valuename and valuedata are in hex. + */ +static char * +grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, + char *start, char *end) +{ + char *ptr, *ptr2; + char *name, *data; + int namelen, datalen, i; + for (ptr = start; ptr && ptr < end; ) + { + if (grub_isspace (*ptr)) + { + ptr++; + continue; + } + if (*ptr == '}') + return ptr + 1; + namelen = 0; + + /* Parse the name. */ + for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) + || (*ptr2 >= '0' && *ptr2 <= '9') + || (*ptr2 >= 'a' && *ptr2 <= 'f') + || (*ptr2 >= 'A' && *ptr2 <= 'F')); + ptr2++) + if (! grub_isspace (*ptr2)) + namelen++; + if (ptr2 == end) + return 0; + namelen /= 2; + name = grub_malloc (namelen + 1); + if (!name) + return 0; + for (i = 0; i < 2 * namelen; i++) + { + int hex = 0; + while (grub_isspace (*ptr)) + ptr++; + if (*ptr >= '0' && *ptr <= '9') + hex = *ptr - '0'; + if (*ptr >= 'a' && *ptr <= 'f') + hex = *ptr - 'a' + 10; + if (*ptr >= 'A' && *ptr <= 'F') + hex = *ptr - 'A' + 10; + + if (i % 2 == 0) + name[i / 2] = hex << 4; + else + name[i / 2] |= hex; + ptr++; + } + name [namelen] = 0; + while (grub_isspace (*ptr)) + ptr++; + + /* If it describes a key recursively invoke the function. */ + if (*ptr == '{') + { + struct grub_xnu_devtree_key *newkey + = grub_xnu_create_key (parent, name); + grub_free (name); + if (! newkey) + return 0; + ptr = grub_xnu_parse_devtree (&(newkey->first_child), ptr + 1, end); + continue; + } + + /* Parse the data. */ + if (*ptr != ':') + return 0; + ptr++; + datalen = 0; + for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) + || (*ptr2 >= '0' && *ptr2 <= '9') + || (*ptr2 >= 'a' && *ptr2 <= 'f') + || (*ptr2 >= 'A' && *ptr2 <= 'F')); + ptr2++) + if (! grub_isspace (*ptr2)) + datalen++; + if (ptr2 == end) + return 0; + datalen /= 2; + data = grub_malloc (datalen); + if (! data) + return 0; + for (i = 0; i < 2 * datalen; i++) + { + int hex = 0; + while (grub_isspace (*ptr)) + ptr++; + if (*ptr >= '0' && *ptr <= '9') + hex = *ptr - '0'; + if (*ptr >= 'a' && *ptr <= 'f') + hex = *ptr - 'a' + 10; + if (*ptr >= 'A' && *ptr <= 'F') + hex = *ptr - 'A' + 10; + + if (i % 2 == 0) + data[i / 2] = hex << 4; + else + data[i / 2] |= hex; + ptr++; + } + while (ptr < end && grub_isspace (*ptr)) + ptr++; + { + struct grub_xnu_devtree_key *newkey + = grub_xnu_create_value (parent, name); + grub_free (name); + if (! newkey) + return 0; + newkey->datasize = datalen; + newkey->data = data; + } + if (*ptr != ';') + return 0; + ptr++; + } + if (ptr >= end && *parent != grub_xnu_devtree_root) + return 0; + return ptr; +} + +/* Returns true if the kext should be loaded according to plist + and osbundlereq. Also fill BINNAME. */ +static int +grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq, + char **binname) +{ + grub_file_t file; + char *buf = 0, *tagstart = 0, *ptr1 = 0, *keyptr = 0; + char *stringptr = 0, *ptr2 = 0; + grub_size_t size; + int depth = 0; + int ret; + int osbundlekeyfound = 0, binnamekeyfound = 0; + if (binname) + *binname = 0; + + file = grub_gzfile_open (plistname, 1); + if (! file) + { + grub_file_close (file); + grub_error_push (); + grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname); + return 0; + } + + size = grub_file_size (file); + buf = grub_malloc (size); + if (! buf) + { + grub_file_close (file); + grub_error_push (); + grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't read file %s", plistname); + return 0; + } + if (grub_file_read (file, buf, size) != (grub_ssize_t) (size)) + { + grub_file_close (file); + grub_error_push (); + grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname); + return 0; + } + grub_file_close (file); + + /* Set the return value for the case when no OSBundleRequired tag is found. */ + if (osbundlereq) + ret = grub_strword (osbundlereq, "all") || grub_strword (osbundlereq, "-"); + else + ret = 1; + + /* Parse plist. It's quite dirty and inextensible but does its job. */ + for (ptr1 = buf; ptr1 < buf + size; ptr1++) + switch (*ptr1) + { + case '<': + tagstart = ptr1; + *ptr1 = 0; + if (keyptr && depth == 4 + && grub_strcmp (keyptr, "OSBundleRequired") == 0) + osbundlekeyfound = 1; + if (keyptr && depth == 4 && + grub_strcmp (keyptr, "CFBundleExecutable") == 0) + binnamekeyfound = 1; + if (stringptr && osbundlekeyfound && osbundlereq && depth == 4) + { + for (ptr2 = stringptr; *ptr2; ptr2++) + *ptr2 = grub_tolower (*ptr2); + ret = grub_strword (osbundlereq, stringptr) + || grub_strword (osbundlereq, "all"); + } + if (stringptr && binnamekeyfound && binname && depth == 4) + { + if (*binname) + grub_free (*binname); + *binname = grub_strdup (stringptr); + } + + *ptr1 = '<'; + keyptr = 0; + stringptr = 0; + break; + case '>': + if (! tagstart) + { + grub_free (buf); + grub_error (GRUB_ERR_BAD_OS, "can't parse %s", plistname); + return 0; + } + *ptr1 = 0; + if (tagstart[1] == '?' || ptr1[-1] == '/') + { + osbundlekeyfound = 0; + *ptr1 = '>'; + break; + } + if (depth == 3 && grub_strcmp (tagstart + 1, "key") == 0) + keyptr = ptr1 + 1; + if (depth == 3 && grub_strcmp (tagstart + 1, "string") == 0) + stringptr = ptr1 + 1; + else if (grub_strcmp (tagstart + 1, "/key") != 0) + { + osbundlekeyfound = 0; + binnamekeyfound = 0; + } + *ptr1 = '>'; + + if (tagstart[1] == '/') + depth--; + else + depth++; + break; + } + grub_free (buf); + + return ret; +} + +/* Load all loadable kexts placed under DIRNAME and matching OSBUNDLEREQUIRED */ +grub_err_t +grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, + int maxrecursion) +{ + grub_device_t dev; + char *device_name; + grub_fs_t fs; + const char *path; + + auto int load_hook (const char *filename, + const struct grub_dirhook_info *info); + int load_hook (const char *filename, const struct grub_dirhook_info *info) + { + char *newdirname; + if (! info->dir) + return 0; + if (filename[0] == '.') + return 0; + + if (grub_strlen (filename) < 5 || + grub_memcmp (filename + grub_strlen (filename) - 5, ".kext", 5) != 0) + return 0; + + newdirname + = grub_malloc (grub_strlen (dirname) + grub_strlen (filename) + 2); + + /* It's a .kext. Try to load it. */ + if (newdirname) + { + grub_strcpy (newdirname, dirname); + newdirname[grub_strlen (newdirname) + 1] = 0; + newdirname[grub_strlen (newdirname)] = '/'; + grub_strcpy (newdirname + grub_strlen (newdirname), filename); + grub_xnu_load_kext_from_dir (newdirname, osbundlerequired, + maxrecursion); + if (grub_errno == GRUB_ERR_BAD_OS) + grub_errno = GRUB_ERR_NONE; + grub_free (newdirname); + } + return 0; + } + + if (! grub_xnu_heap_size) + return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); + + device_name = grub_file_get_device_name (dirname); + dev = grub_device_open (device_name); + if (dev) + { + fs = grub_fs_probe (dev); + path = grub_strchr (dirname, ')'); + if (! path) + path = dirname; + else + path++; + + if (fs) + (fs->dir) (dev, path, load_hook); + grub_device_close (dev); + } + grub_free (device_name); + + return GRUB_ERR_NONE; +} + +/* Load extension DIRNAME. (extensions are directoris in xnu) */ +grub_err_t +grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, + int maxrecursion) +{ + grub_device_t dev; + char *plistname = 0; + char *newdirname; + char *newpath; + char *device_name; + grub_fs_t fs; + const char *path; + char *binsuffix; + int usemacos = 0; + grub_file_t binfile; + + auto int load_hook (const char *filename, + const struct grub_dirhook_info *info); + + int load_hook (const char *filename, const struct grub_dirhook_info *info) + { + if (grub_strlen (filename) > 15) + return 0; + grub_strcpy (newdirname + grub_strlen (dirname) + 1, filename); + + /* If the kext contains directory "Contents" all real stuff is in + this directory. */ + if (info->dir && grub_strcasecmp (filename, "Contents") == 0) + grub_xnu_load_kext_from_dir (newdirname, osbundlerequired, + maxrecursion - 1); + + /* Directory "Plugins" contains nested kexts. */ + if (info->dir && grub_strcasecmp (filename, "Plugins") == 0) + grub_xnu_scan_dir_for_kexts (newdirname, osbundlerequired, + maxrecursion - 1); + + /* Directory "MacOS" contains executable, otherwise executable is + on the top. */ + if (info->dir && grub_strcasecmp (filename, "MacOS") == 0) + usemacos = 1; + + /* Info.plist is the file which governs our future actions. */ + if (! info->dir && grub_strcasecmp (filename, "Info.plist") == 0 + && ! plistname) + plistname = grub_strdup (newdirname); + return 0; + } + + newdirname = grub_malloc (grub_strlen (dirname) + 20); + if (! newdirname) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate buffer"); + grub_strcpy (newdirname, dirname); + newdirname[grub_strlen (dirname)] = '/'; + newdirname[grub_strlen (dirname) + 1] = 0; + device_name = grub_file_get_device_name (dirname); + dev = grub_device_open (device_name); + if (dev) + { + fs = grub_fs_probe (dev); + path = grub_strchr (dirname, ')'); + if (! path) + path = dirname; + else + path++; + + newpath = grub_strchr (newdirname, ')'); + if (! newpath) + newpath = newdirname; + else + newpath++; + + /* Look at the directory. */ + if (fs) + (fs->dir) (dev, path, load_hook); + + if (plistname && grub_xnu_check_os_bundle_required + (plistname, osbundlerequired, &binsuffix)) + { + if (binsuffix) + { + /* Open the binary. */ + char *binname = grub_malloc (grub_strlen (dirname) + + grub_strlen (binsuffix) + + sizeof ("/MacOS/")); + grub_strcpy (binname, dirname); + if (usemacos) + grub_strcpy (binname + grub_strlen (binname), "/MacOS/"); + else + grub_strcpy (binname + grub_strlen (binname), "/"); + grub_strcpy (binname + grub_strlen (binname), binsuffix); + grub_dprintf ("xnu", "%s:%s\n", plistname, binname); + binfile = grub_gzfile_open (binname, 1); + if (! binfile) + grub_errno = GRUB_ERR_NONE; + + /* Load the extension. */ + grub_xnu_load_driver (plistname, binfile); + grub_free (binname); + grub_free (binsuffix); + } + else + { + grub_dprintf ("xnu", "%s:0\n", plistname); + grub_xnu_load_driver (plistname, 0); + } + } + grub_free (plistname); + grub_device_close (dev); + } + grub_free (device_name); + + return GRUB_ERR_NONE; +} + +/* Load devtree file. */ +static grub_err_t +grub_cmd_xnu_devtree (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_file_t file; + char *data, *endret; + grub_size_t datalen; + + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "Filename required"); + + if (! grub_xnu_heap_size) + return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); + + /* Load the file. */ + file = grub_gzfile_open (args[0], 1); + if (! file) + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load device tree"); + datalen = grub_file_size (file); + data = grub_malloc (datalen + 1); + if (! data) + { + grub_file_close (file); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Could load device tree into memory"); + } + if (grub_file_read (file, data, datalen) != (grub_ssize_t) datalen) + { + grub_file_close (file); + grub_free (data); + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]); + } + grub_file_close (file); + data[datalen] = 0; + + /* Parse the file. */ + endret = grub_xnu_parse_devtree (&grub_xnu_devtree_root, + data, data + datalen); + grub_free (data); + + if (! endret) + return grub_error (GRUB_ERR_BAD_OS, "Couldn't parse devtree"); + + return GRUB_ERR_NONE; +} + +static int locked=0; +static grub_dl_t my_mod; + +/* Load the kext. */ +static grub_err_t +grub_cmd_xnu_kext (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_file_t binfile = 0; + if (argc == 2) + { + /* User explicitely specified plist and binary. */ + if (grub_strcmp (args[1], "-") != 0) + { + binfile = grub_gzfile_open (args[1], 1); + if (! binfile) + { + grub_error (GRUB_ERR_BAD_OS, "can't open file"); + return GRUB_ERR_NONE; + } + } + return grub_xnu_load_driver (grub_strcmp (args[0], "-") ? args[0] : 0, + binfile); + } + + /* load kext normally. */ + if (argc == 1) + return grub_xnu_load_kext_from_dir (args[0], 0, 10); + + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); +} + +/* Load a directory containing kexts. */ +static grub_err_t +grub_cmd_xnu_kextdir (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + if (argc != 1 && argc != 2) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "directory name required"); + + if (argc == 1) + return grub_xnu_scan_dir_for_kexts (args[0], + "console,root,local-root,network-root", + 10); + else + { + char *osbundlerequired = grub_strdup (args[1]), *ptr; + grub_err_t err; + if (! osbundlerequired) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate string temporary space"); + for (ptr = osbundlerequired; *ptr; ptr++) + *ptr = grub_tolower (*ptr); + err = grub_xnu_scan_dir_for_kexts (args[0], osbundlerequired, 10); + grub_free (osbundlerequired); + return err; + } +} + +struct grub_video_bitmap *grub_xnu_bitmap = 0; + +static grub_err_t +grub_cmd_xnu_splash (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_err_t err; + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + err = grub_video_bitmap_load (&grub_xnu_bitmap, args[0]); + if (err) + grub_xnu_bitmap = 0; + return err; +} + + +#ifndef GRUB_UTIL +static grub_err_t +grub_cmd_xnu_resume (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + if (argc != 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + return grub_xnu_resume (args[0]); +} +#endif + +void +grub_xnu_lock () +{ +#ifndef GRUB_UTIL + if (!locked) + grub_dl_ref (my_mod); +#endif + locked = 1; +} + +void +grub_xnu_unlock () +{ +#ifndef GRUB_UTIL + if (locked) + grub_dl_unref (my_mod); +#endif + locked = 0; +} + +static grub_command_t cmd_kernel, cmd_mkext, cmd_kext, cmd_kextdir, + cmd_ramdisk, cmd_devtree, cmd_resume, cmd_splash; + +GRUB_MOD_INIT(xnu) +{ + (void) mod; /* To stop warning. */ + cmd_kernel = grub_register_command ("xnu_kernel", grub_cmd_xnu_kernel, 0, + "load a xnu kernel"); + cmd_mkext = grub_register_command ("xnu_mkext", grub_cmd_xnu_mkext, 0, + "Load XNU extension package."); + cmd_kext = grub_register_command ("xnu_kext", grub_cmd_xnu_kext, 0, + "Load XNU extension."); + cmd_kextdir = grub_register_command ("xnu_kextdir", grub_cmd_xnu_kextdir, + "xnu_kextdir DIRECTORY [OSBundleRequired]", + "Load XNU extension directory"); + cmd_ramdisk = grub_register_command ("xnu_ramdisk", grub_cmd_xnu_ramdisk, 0, + "Load XNU ramdisk. " + "It will be seen as md0"); + cmd_devtree = grub_register_command ("xnu_devtree", grub_cmd_xnu_devtree, 0, + "Load XNU devtree"); + cmd_splash = grub_register_command ("xnu_splash", grub_cmd_xnu_splash, 0, + "Load a splash image for XNU"); + +#ifndef GRUB_UTIL + cmd_resume = grub_register_command ("xnu_resume", grub_cmd_xnu_resume, + 0, "Load XNU hibernate image."); +#endif + my_mod=mod; +} + +GRUB_MOD_FINI(xnu) +{ +#ifndef GRUB_UTIL + grub_unregister_command (cmd_resume); +#endif + grub_unregister_command (cmd_mkext); + grub_unregister_command (cmd_kext); + grub_unregister_command (cmd_kextdir); + grub_unregister_command (cmd_devtree); + grub_unregister_command (cmd_ramdisk); + grub_unregister_command (cmd_kernel); + grub_unregister_command (cmd_splash); +} diff --git a/loader/xnu_resume.c b/loader/xnu_resume.c new file mode 100644 index 000000000..b501e150b --- /dev/null +++ b/loader/xnu_resume.c @@ -0,0 +1,136 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static void *grub_xnu_hibernate_image; + +static grub_err_t +grub_xnu_resume_unload (void) +{ + /* Free loaded image */ + if (grub_xnu_hibernate_image) + grub_free (grub_xnu_hibernate_image); + grub_xnu_hibernate_image = 0; + grub_xnu_unlock (); + return GRUB_ERR_NONE; +} + +grub_err_t +grub_xnu_resume (char *imagename) +{ + grub_file_t file; + grub_size_t total_header_size; + struct grub_xnu_hibernate_header hibhead; + char *buf, *codetmp; + + grub_uint32_t codedest; + grub_uint32_t codesize; + + file = grub_file_open (imagename); + if (! file) + return 0; + + /* Read the header. */ + if (grub_file_read (file, (char *) &hibhead, sizeof (hibhead)) + !=sizeof (hibhead)) + { + grub_file_close (file); + return grub_error (GRUB_ERR_READ_ERROR, + "cannot read the hibernate header"); + } + + /* Check the header. */ + if (hibhead.magic != GRUB_XNU_HIBERNATE_MAGIC) + { + grub_file_close (file); + return grub_error (GRUB_ERR_BAD_OS, + "hibernate header has incorrect magic number"); + } + if (hibhead.encoffset) + { + grub_file_close (file); + return grub_error (GRUB_ERR_BAD_OS, + "encrypted images aren't supported yet"); + } + + codedest = hibhead.launchcode_target_page; + codedest *= GRUB_XNU_PAGESIZE; + codesize = hibhead.launchcode_numpages; + codesize *= GRUB_XNU_PAGESIZE; + + /* FIXME: check that codedest..codedest+codesize is available. */ + + /* Calculate total size before pages to copy. */ + total_header_size = hibhead.extmapsize + sizeof (hibhead); + + /* Unload image if any. */ + if (grub_xnu_hibernate_image) + grub_free (grub_xnu_hibernate_image); + + /* Try to allocate necessary space. + FIXME: mm isn't good enough yet to handle huge allocations. + */ + grub_xnu_hibernate_image = buf = grub_malloc (hibhead.image_size); + if (! buf) + { + grub_file_close (file); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "not enough memory to load image"); + } + + /* Read image. */ + if (grub_file_seek (file, 0) == (grub_off_t)-1 + || grub_file_read (file, buf, hibhead.image_size) + != (grub_ssize_t) hibhead.image_size) + { + grub_file_close (file); + return grub_error (GRUB_ERR_READ_ERROR, "Cannot read resume image."); + } + grub_file_close (file); + + codetmp = grub_memalign (GRUB_XNU_PAGESIZE, codesize + GRUB_XNU_PAGESIZE); + /* Setup variables needed by asm helper. */ + grub_xnu_heap_will_be_at = codedest; + grub_xnu_heap_start = codetmp; + grub_xnu_heap_size = codesize; + grub_xnu_stack = (codedest + hibhead.stack); + grub_xnu_entry_point = (codedest + hibhead.entry_point); + grub_xnu_arg1 = (long) buf; + + /* Prepare asm helper. */ + grub_memcpy (codetmp, ((grub_uint8_t *) buf) + total_header_size, codesize); + grub_memcpy (codetmp + codesize, grub_xnu_launcher_start, + grub_xnu_launcher_end - grub_xnu_launcher_start); + + /* We're ready now. */ + grub_loader_set ((grub_err_t (*) (void)) (codetmp + codesize), + grub_xnu_resume_unload, 0); + + /* Prevent module from unloading. */ + grub_xnu_lock (); + return GRUB_ERR_NONE; +} diff --git a/util/grub-dumpdevtree b/util/grub-dumpdevtree new file mode 100644 index 000000000..ca1a6a907 --- /dev/null +++ b/util/grub-dumpdevtree @@ -0,0 +1,3 @@ +echo "656669{ 6465766963652d70726f70657274696573:" +ioreg -lw0 -p IODeviceTree -n efi -r -x |grep device-properties | sed 's/.*.*//;' +echo ";}" diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 429cc9582..a145277fc 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -82,6 +82,58 @@ EOF EOF done ;; + macosx) + OSXROOT="`grub-probe --target=drive --device ${DEVICE} 2> /dev/null`" + # FIXME: use UUID + OSXDISK=disk"`echo ${OSXROOT} | awk -F , '{ print $1 ; }' | sed 's/(hd//;'`"s"`echo ${OSXROOT} | awk -F , '{ print $2 ; }' | sed 's/)//;'`" + cat << EOF +menuentry "${LONGNAME} (on ${DEVICE})" { + set root=${OSXROOT} + insmod vbe + insmod gfxterm + gfxmode="1024x768x32;800x600x32" + terminal_output gfxterm + do_resume=0 + if [ /var/vm/sleepimage -nt10 / ]; then + if xnu_resume /var/vm/sleepimage; then + do_resume=1 + fi + fi + if [ \$do_resume == 0 ]; then + if [ -f /Extra/DSDT.aml ]; then + acpi -e /Extra/DSDT.aml + fi + xnu_kernel /mach_kernel rd=$OSXDISK + if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then + xnu_mkext /System/Library/Extensions.mkext + else + xnu_kextdir /System/Library/Extensions + fi + if [ -f /Extra/Extensions.mkext ]; then + xnu_mkext /Extra/Extensions.mkext + fi + if [ -d /Extra/Extensions ]; then + xnu_kextdir /Extra/Extensions + fi + if [ -f /Extra/devtree.txt ]; then + xnu_devtree /Extra/devtree.txt + fi + if [ -f /Extra/splash.jpg ]; then + insmod jpeg + xnu_splash /Extra/splash.jpg + fi + if [ -f /Extra/splash.png ]; then + insmod png + xnu_splash /Extra/splash.png + fi + if [ -f /Extra/splash.tga ]; then + insmod tga + xnu_splash /Extra/splash.tga + fi + fi +} +EOF + ;; hurd|*) echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2 ;; From 7dd4a573a9568fa7f778f13c61384cbea3488612 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 3 May 2009 03:23:57 +0000 Subject: [PATCH 0701/1707] Fix spacing, typos --- ChangeLog | 118 +++++++++++++++++++++++++++--------------------------- 1 file changed, 59 insertions(+), 59 deletions(-) diff --git a/ChangeLog b/ChangeLog index 077b9e58c..65d57351c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,7 +10,7 @@ (xnu_mod_ASFLAGS): likewise * conf/i386-pc.rmk: likewise * conf/x86_64-efi.rmk: likewise - * include/grub/efi/efi.h (grub_efi_finish_boot_services): + * include/grub/efi/efi.h (grub_efi_finish_boot_services): new declaration * include/grub/i386/macho.h: new file * include/grub/i386/xnu.h: likewise @@ -32,21 +32,21 @@ * include/grub/i386/pit.h: include grub/err.h (grub_pit_wait): export * util/grub.d/30_os-prober.in: support Darwin/Mac OS X - + 2009-05-02 Vladimir Serbinenko Efiemu - + * conf/i386-pc.rmk: new modules efiemu, efiemu_acpi, efiemu_pnvram, - _linux_efi, linux_efi. - new files in grub-emu + _linux_efi, linux_efi. + new files in grub-emu new targets efiemu32.o and efiemu64.o * loader/linux_normal_efiemu.c: likewise * loader/i386/efi/linux.c: added preliminary efiemu support - * util/i386/pc/grub-install.in: add efiemu??.o to the list of + * util/i386/pc/grub-install.in: add efiemu??.o to the list of files to copy * include/grub/autoefi.h: new file - * nclude/grub/i386/efiemu.h: likewise + * include/grub/i386/efiemu.h: likewise * include/grub/i386/pc/efiemu.h: likewise * include/grub/efi/api.h: add LL suffix when necessary new definitions relating to tables @@ -73,8 +73,8 @@ * efiemu/symbols.c: likewise * efiemu/mm.c: likewise * efiemu/loadcore32.c: likewise - -2009-05-02 Vladimir Serbinenko + +2009-05-02 Vladimir Serbinenko ACPI spoofing @@ -89,7 +89,7 @@ * conf/i386-efi.rmk: likewise * conf/x86_64-efi.rmk: likewise -2009-05-02 Vladimir Serbinenko +2009-05-02 Vladimir Serbinenko Missing part from mmap patch @@ -97,7 +97,7 @@ (grub_mmap_unregister) (grub_mmap_free_and_unregister): use grub_mmap_register -2009-05-02 Vladimir Serbinenko +2009-05-02 Vladimir Serbinenko Mmap services @@ -142,7 +142,7 @@ * mmap/i386/uppermem.c: likewise * mmap/mmap.c: likewise * mmap/efi/mmap.c: likewise - * kern/i386/coreboot/init.c (grub_machine_init): don't use + * kern/i386/coreboot/init.c (grub_machine_init): don't use grub_upper_mem * kern/i386/pc/init.c (grub_lower_mem): removed variable (grub_upper_mem): likewise @@ -278,8 +278,8 @@ grub_register_rescue_parser and grub_register_rescue_reader, use grub_reader_loop to enter input loop. - * kern/parser.c (grub_parser_spli_cmdline): Change type of getline - parameter. + * kern/parser.c (grub_parser_split_cmdline): Change type of + getline parameter. (grub_parser_class): New variable. (grub_parser_execute): New function. @@ -349,7 +349,7 @@ parent's partition, don't copy it by reference, as it gets freed on close. -2009-04-27 Vladimir Serbinenko +2009-04-27 Vladimir Serbinenko Preboot hooks support @@ -367,14 +367,14 @@ Warning fix - * disk/scsi.c (grub_scsi_open): added missing cast when + * disk/scsi.c (grub_scsi_open): added missing cast when calling grub_dprintf 2009-04-26 Vladimir Serbinenko Bug and warning fixes - * include/grub/i386/pc/init.h (grub_stop_floppy): added missing + * include/grub/i386/pc/init.h (grub_stop_floppy): added missing declaration * commands/test.c (test_parse): fixed bug with file tests and corrected declaration of find_file @@ -399,13 +399,13 @@ Parttool autoloading and improvements - * Makefile.in (pkglib_DATA): add parttool.lst + * Makefile.in (pkglib_DATA): add parttool.lst (parttool.lst): new target * genmk.rb: generate parttool-* (CLEANFILES): add #{parttool} (PARTTOOLFILES): new variable * genparttoollist.sh: new file - * parttool/pcpart.c (grub_pcpart_boot): more feedback + * parttool/pcpart.c (grub_pcpart_boot): more feedback (grub_pcpart_type): likewise * commands/parttool.c (helpmsg): new variable (grub_cmd_parttool): output help if not enough arguments are supplied @@ -414,10 +414,10 @@ 2009-04-24 David S. Miller - Avoiding openning same device multiple times in device iterator. + Avoiding opening same device multiple times in device iterator. * kern/device.c: (grub_device_iterate): Define struct part_ent, - and use it to build a list of partitions in interate_disk() and + and use it to build a list of partitions in iterate_disk() and iterate_partition(). * disk/fs_uuid.c (grub_fs_uuid_close): Call grub_disk_close() @@ -476,11 +476,11 @@ images and installation utilities. Build kernel as image instead of as elf binary. Use common rules as much as possible. -2009-04-19 Vladimir Serbinenko +2009-04-19 Vladimir Serbinenko Correct GPT definition - * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type + * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type of "attrib" member 2009-04-19 Felix Zielcke @@ -532,10 +532,10 @@ 2009-04-15 Felix Zielcke * disk/lvm.c (grub_lvm_scan_device): Add `LVM' to the error messages, - that no multiple data or metadata areas are supported and `Unknown + that no multiple data or metadata areas are supported and `Unknown metadata header'. -2009-04-15 Vladimir Serbinenko +2009-04-15 Vladimir Serbinenko Move loader out of the kernel @@ -560,20 +560,20 @@ (grub_emu_SOURCES): likewise * conf/powerpc-ieee1275.rmk (kernel_elf_SOURCES): likewise (grub_emu_SOURCES): likewise - * conf/sparcs64-ieee1275.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + * conf/sparc64-ieee1275.rmk (kernel_elf_SOURCES): likewise + (grub_emu_SOURCES): likewise * conf/x86_64-efi.rmk (kernel_elf_SOURCES): likewise - (grub_emu_SOURCES): likewise + (grub_emu_SOURCES): likewise -2009-04-15 Vladimir Serbinenko +2009-04-15 Vladimir Serbinenko use grub_lltoa instead of grub_itoa and grub_ltoa for all purposes - + * kern/misc.c (grub_itoa): Removed function (grub_ltoa): likewise (grub_vsprintf): use grub_lltoa -2009-04-15 Vladimir Serbinenko +2009-04-15 Vladimir Serbinenko Restore grub-emu @@ -581,7 +581,7 @@ * conf/i386-coreboot.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise - + 2009-04-15 Felix Zielcke * INSTALL: Add that `./autogen.sh' needs to be run before @@ -657,7 +657,7 @@ * INSTALL: Remove the sentence that Ruby and autoconf are only required if you develop on GRUB. -2009-04-14 John Stanley +2009-04-14 John Stanley David S. Miller * util/hostdisk.c (make_device_name): Fix buffer length @@ -679,7 +679,7 @@ 2009-04-13 Robert Millan * util/grub.d/10_freebsd.in: Detect Debian GNU/kFreeBSD and use - that name for menuentries when appropiate. + that name for menuentries when appropriate. 2009-04-13 Felix Zielcke @@ -693,7 +693,7 @@ 2009-04-13 Felix Zielcke * util/grub.d/10_freebsd.in: Don't exit if /boot/devices.hints - doestn't exist. Check also for /boot/kernel/kernel.gz. Print + doesn't exist. Check also for /boot/kernel/kernel.gz. Print `freebsd_loadenv' only when devices.hints exist. 2009-04-13 Pavel Roskin @@ -737,7 +737,7 @@ * configure.ac: Check for __bswapsi2 and__bswapdi2 using target compiler. - + * genmk.rb: Add more flexible image type specification, also pass --strip-unneeded to objcopy. * conf/i386-pc.rmk: Use *_FORMAT. @@ -761,9 +761,9 @@ 2009-04-12 Pavel Roskin - * configure.ac: Change the logic when we check for target tools. - Do it when the target is specified and it's different from the - specified value of the host. + * configure.ac: Change the logic when we check for target tools. + Do it when the target is specified and it's different from the + specified value of the host. 2009-04-11 Felix Zielcke @@ -846,7 +846,7 @@ * kern/ieee1275/openfw.c (grub_children_iterate): Likewise. (grub_devalias_iterate): Likewise. -2009-04-10 Vladimir Serbinenko +2009-04-10 Vladimir Serbinenko UFS improvements @@ -888,7 +888,7 @@ (memrw_mod_CFLAGS): Likewise. (memrw_mod_LDFLAGS): Likewise. - * conf/i386-efi.rmk (pkglig_MODULES): New module loadbios.mod and + * conf/i386-efi.rmk (pkglib_MODULES): New module loadbios.mod and fixvideo.mod. (loadbios_mod_SOURCE): New macro. (loadbios_mod_CFLAGS): Likewise. @@ -897,7 +897,7 @@ (fixvideo_mod_CFLAGS): Likewise. (fixvideo_mod_LDFLAGS): Likewise. - * conf/x86_64.rmk (pkglig_MODULES): New module loadbios.mod and + * conf/x86_64.rmk (pkglib_MODULES): New module loadbios.mod and fixvideo.mod. (loadbios_mod_SOURCE): New macro. (loadbios_mod_CFLAGS): Likewise. @@ -933,7 +933,7 @@ cmd->flags to check for GRUB_PRIO_LIST_FLAG_ACTIVE. 2009-04-06 Vladimir Serbinenko - + Parttool * parttool/pcpart.c: new file @@ -945,7 +945,7 @@ (pcpart_mod_SOURCES): likewise (pcpart_mod_CFLAGS): likewise (pcpart_mod_LDFLAGS): likewise - * conf/i386-coreboot.rmk (grub_emu_SOURCES): added commands/parttool.c + * conf/i386-coreboot.rmk (grub_emu_SOURCES): added commands/parttool.c and parttool/pcpart.c * conf/i386-efi.rmk: likewise * conf/i386-ieee1275.rmk: likewise @@ -959,10 +959,10 @@ Support for mtime and further expandability of dir command * include/grub/lib/datetime.h: moved to ... - * include/grub/datetime.h: ... moved here and added + * include/grub/datetime.h: ... moved here and added declaration of grub_unixtime2datetime. All users updated - * include/grub/fs.h: new syntax for dir and mtime functionin - struct grub_fs + * include/grub/fs.h: new syntax for dir and mtime functions in + struct grub_fs * include/grub/fshelp.h: new declarations of GRUB_FSHELP_TYPE_MASK and GRUB_FSHELP_FLAGS_MASK * commands/ls.c (grub_ls_list_files): Write mtime in long format @@ -995,33 +995,33 @@ * normal/datetime.c: ... moved here (grub_unixtime2datetime): new function * kern/rescue.c (grub_rescue_print_files): use new dir syntax - * normal/completition.c (iterate_dir): use new dir syntax - * normal/misc.c (grub_normal_print_device_info): tell the + * normal/completion.c (iterate_dir): use new dir syntax + * normal/misc.c (grub_normal_print_device_info): tell the last modification time of a volume - * kern/fs.c (grub_fs_probe): updated dummy function to use new syntax + * kern/fs.c (grub_fs_probe): updated dummy function to use new syntax * conf/common.rmk: added lib/datetime.c to ls.mod - * conf/i386-coreboot.rmk (grub_emu_SOURCES): add normal/datetime.c + * conf/i386-coreboot.rmk (grub_emu_SOURCES): add normal/datetime.c (normal_mod_SOURCES): likewise (datetime_mod_SOURCES): Removed lib/datetime.c * conf/i386-efi.rmk: likewise - * conf/i386-ieee1275.rmk: likewise + * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise - * conf/sparc64-ieee1275.rmk: likewise - * conf/x86_64-efi.rmk: likewise + * conf/sparc64-ieee1275.rmk: likewise + * conf/x86_64-efi.rmk: likewise 2009-04-05 Vladimir Serbinenko Trim trailing spaces in FAT label and support mtools-like labels - - * fs/fat.c (grub_fat_iterate_dir): New function based + + * fs/fat.c (grub_fat_iterate_dir): New function based on grub_fat_find_dir (grub_fat_find_dir): use grub_fat_iterate_dir (grub_fat_label): likewise 2009-04-04 Vladimir Serbinenko - * conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): add list.h + * conf/powerpc-ieee1275.rmk (kernel_elf_HEADERS): add list.h and command.h remove extraneous kernel_elf_HEADERS @@ -1058,7 +1058,7 @@ 2009-04-01 David S. Miller * normal/sparc64/setjmp.S: Fix setjmp implementation. - * include/grub/sparc64/setjmp.h (grub_jmp_buf): Update. + * include/grub/sparc64/setjmp.h (grub_jmp_buf): Update. (grub_setjmp): Mark with 'returns_twice' attribute. * include/grub/i386/setjmp.h (grub_setjmp): Likewise * include/grub/powerpc/setjmp.h (grub_setjmp): Likewise. @@ -1121,7 +1121,7 @@ Make the format of Environment Block plain text. The boot loader part is not tested well yet. - + * util/grub-editenv.c (DEFAULT_ENVBLK_SIZE): New macro. (buffer): Removed. (envblk): Likewise. From fc45fb586d282bf658cde046fdc6a17f5f4e4aa0 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 3 May 2009 06:39:37 +0000 Subject: [PATCH 0702/1707] 2009-05-03 Bean * Makefile.in (enable_efiemu): New variable. * conf/i386-pc.rmk: Only compile efiemu runtimes when enable_efiemu is set. (efiemu32.o): Use macro $< for source file, add $(srcdir) to include path. (efi64_c.o): Use macro $< for source file, add $(srcdir) to include path, add -mno-red-zone option. (efiemu64_s.o): Likewise. (efiemu64.o): Use macro $^ for source file. * configure.ac (--enable-efiemu): New option. --- ChangeLog | 15 +++++++++++++++ Makefile.in | 1 + conf/i386-pc.rmk | 12 ++++++++---- configure.ac | 5 +++++ 4 files changed, 29 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 65d57351c..b798fe88b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-05-03 Bean + + * Makefile.in (enable_efiemu): New variable. + + * conf/i386-pc.rmk: Only compile efiemu runtimes when enable_efiemu is + set. + (efiemu32.o): Use macro $< for source file, add $(srcdir) to include + path. + (efi64_c.o): Use macro $< for source file, add $(srcdir) to include + path, add -mno-red-zone option. + (efiemu64_s.o): Likewise. + (efiemu64.o): Use macro $^ for source file. + + * configure.ac (--enable-efiemu): New option. + 2009-05-03 Vladimir Serbinenko xnu support diff --git a/Makefile.in b/Makefile.in index 363708c6f..109aab928 100644 --- a/Makefile.in +++ b/Makefile.in @@ -101,6 +101,7 @@ enable_lzo = @enable_lzo@ enable_grub_mkfont = @enable_grub_mkfont@ freetype_cflags = @freetype_cflags@ freetype_libs = @freetype_libs@ +enable_efiemu = @enable_efiemu@ ### General variables. diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 2530dd28e..5eb50367a 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -387,19 +387,23 @@ hdparm_mod_SOURCES = commands/hdparm.c lib/hexdump.c hdparm_mod_CFLAGS = $(COMMON_CFLAGS) hdparm_mod_LDFLAGS = $(COMMON_LDFLAGS) +ifeq ($(enable_efiemu), yes) + efiemu32.o: efiemu/runtime/efiemu.c - $(CC) -c -m32 -DELF32 -o $@ -Wall -Werror efiemu/runtime/efiemu.c -nostdlib -O2 -Iefiemu/runtime -Iinclude + $(CC) -c -m32 -DELF32 -o $@ -Wall -Werror $< -nostdlib -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude efiemu64_c.o: efiemu/runtime/efiemu.c - $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror efiemu/runtime/efiemu.c -nostdlib -mcmodel=large -O2 -Iefiemu/runtime -Iinclude + $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude efiemu64_s.o: efiemu/runtime/efiemu.S - $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror efiemu/runtime/efiemu.S -nostdlib -mcmodel=large -O2 -Iefiemu/runtime -Iinclude + $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude efiemu64.o: efiemu64_c.o efiemu64_s.o - ld -melf_x86_64 -o $@ -r efiemu64_c.o efiemu64_s.o -nostdlib + ld -melf_x86_64 -o $@ -r $^ -nostdlib CLEANFILES += efiemu32.o efiemu64.o efiemu64_c.o efiemu64_s.o lib_DATA += efiemu32.o efiemu64.o +endif + include $(srcdir)/conf/i386.mk include $(srcdir)/conf/common.mk diff --git a/configure.ac b/configure.ac index 1f0775bea..d84e2b68d 100644 --- a/configure.ac +++ b/configure.ac @@ -473,6 +473,11 @@ AC_SUBST([enable_grub_mkfont]) AC_SUBST([freetype_cflags]) AC_SUBST([freetype_libs]) +AC_ARG_ENABLE([efiemu], + [AS_HELP_STRING([--enable-efiemu], + [build and install the efiemu runtimes])]) +AC_SUBST([enable_efiemu]) + # Output files. grub_CHECK_LINK_DIR if test x"$link_dir" = xyes ; then From 038c5720de1483a180e40436fbffc5aa5136984f Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 3 May 2009 06:50:20 +0000 Subject: [PATCH 0703/1707] 2009-05-03 Bean * script/sh/execute.c (grub_script_execute_cmdif): Reset grub_errno after we get the result of if statement. --- ChangeLog | 5 +++++ script/sh/execute.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index b798fe88b..42b120c2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-03 Bean + + * script/sh/execute.c (grub_script_execute_cmdif): Reset grub_errno + after we get the result of if statement. + 2009-05-03 Bean * Makefile.in (enable_efiemu): New variable. diff --git a/script/sh/execute.c b/script/sh/execute.c index 3856dd95c..123bca8b1 100644 --- a/script/sh/execute.c +++ b/script/sh/execute.c @@ -180,6 +180,8 @@ grub_script_execute_cmdif (struct grub_script_cmd *cmd) grub_script_execute_cmd (cmdif->exec_to_evaluate); result = grub_env_get ("?"); + grub_errno = GRUB_ERR_NONE; + /* Execute the `if' or the `else' part depending on the value of `?'. */ if (result && ! grub_strcmp (result, "0")) From cef17233d47e185682d72fa5b3c9e845933b9cdf Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 3 May 2009 09:03:31 +0000 Subject: [PATCH 0704/1707] 2009-05-03 Bean Vladimir Serbinenko FreeBSD 64-bit support * conf/i386-pc.rmk (bsd_mod_SOURCES): add loader/i386/bsd_helper.S and loader/i386/bsd_trampoline.S (bsd_mod_ASFLAGS): new variable * include/grub/i386/bsd.h (FREEBSD_MODINFOMD_SMAP): new definition (FREEBSD_MODTYPE_KERNEL64): likewise (grub_bsd64_trampoline_start): likewise (grub_bsd64_trampoline_end): likewise (grub_bsd64_trampoline_selfjump): likewise (grub_bsd64_trampoline_gdt): likewise * include/grub/i386/loader.h (grub_unix_real_boot): moved from here ... * include/grub/i386/bsd.h (grub_unix_real_boot): ... moved here * kern/i386/loader.S (grub_unix_real_boot): moved from here ... * loader/i386/bsd_helper.S (grub_unix_real_boot): moved here * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type of "attrib" member * loader/i386/bsd_pagetable.c: new file * loader/i386/bsd_trampoline.S: likewise * loader/i386/bsd.c (ALIGN_QWORD): new macro (ALIGN_VAR): likewise (entry_hi): new variable (kern_end_mdofs): likewise (is_64bit): likewise (grub_freebsd_add_meta): use ALIGN_VAR (grub_e820_mmap): new declaration (grub_freebsd_add_mmap): new function (grub_freebsd_add_meta_module): support 64 bit kernels (grub_freebsd_list_modules): use ALIGN_VAR (gdt_descriptor): new declaration (grub_freebsd_boot): support 64 bit kernels (grub_bsd_elf64_hook): new function (grub_bsd_load_elf): support elf64 --- ChangeLog | 36 +++++ conf/i386-pc.rmk | 3 +- include/grub/i386/bsd.h | 10 ++ include/grub/i386/loader.h | 3 - kern/i386/loader.S | 22 --- loader/i386/bsd.c | 275 +++++++++++++++++++++++++++++++++++-- 6 files changed, 310 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 42b120c2c..2cf8f8f29 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2009-05-03 Bean Vladimir Serbinenko + + FreeBSD 64-bit support + + * conf/i386-pc.rmk (bsd_mod_SOURCES): add loader/i386/bsd_helper.S + and loader/i386/bsd_trampoline.S + (bsd_mod_ASFLAGS): new variable + * include/grub/i386/bsd.h (FREEBSD_MODINFOMD_SMAP): new definition + (FREEBSD_MODTYPE_KERNEL64): likewise + (grub_bsd64_trampoline_start): likewise + (grub_bsd64_trampoline_end): likewise + (grub_bsd64_trampoline_selfjump): likewise + (grub_bsd64_trampoline_gdt): likewise + * include/grub/i386/loader.h (grub_unix_real_boot): moved from here ... + * include/grub/i386/bsd.h (grub_unix_real_boot): ... moved here + * kern/i386/loader.S (grub_unix_real_boot): moved from here ... + * loader/i386/bsd_helper.S (grub_unix_real_boot): moved here + * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type + of "attrib" member + * loader/i386/bsd_pagetable.c: new file + * loader/i386/bsd_trampoline.S: likewise + * loader/i386/bsd.c (ALIGN_QWORD): new macro + (ALIGN_VAR): likewise + (entry_hi): new variable + (kern_end_mdofs): likewise + (is_64bit): likewise + (grub_freebsd_add_meta): use ALIGN_VAR + (grub_e820_mmap): new declaration + (grub_freebsd_add_mmap): new function + (grub_freebsd_add_meta_module): support 64 bit kernels + (grub_freebsd_list_modules): use ALIGN_VAR + (gdt_descriptor): new declaration + (grub_freebsd_boot): support 64 bit kernels + (grub_bsd_elf64_hook): new function + (grub_bsd_load_elf): support elf64 + 2009-05-03 Bean * script/sh/execute.c (grub_script_execute_cmdif): Reset grub_errno diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 5eb50367a..6c9100f16 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -313,9 +313,10 @@ aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) # For bsd.mod -bsd_mod_SOURCES = loader/i386/bsd.c +bsd_mod_SOURCES = loader/i386/bsd.c loader/i386/bsd_helper.S loader/i386/bsd_trampoline.S bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) +bsd_mod_ASFLAGS = $(COMMON_ASFLAGS) # For usb.mod usb_mod_SOURCES = bus/usb/usb.c bus/usb/usbtrans.c bus/usb/usbhub.c diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index 78fae7945..321b31fdf 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -80,9 +80,12 @@ #define FREEBSD_MODINFOMD_SHDR 0x0009 /* section header table */ #define FREEBSD_MODINFOMD_NOCOPY 0x8000 /* don't copy this metadata to the kernel */ +#define FREEBSD_MODINFOMD_SMAP 0x1001 + #define FREEBSD_MODINFOMD_DEPLIST (0x4001 | FREEBSD_MODINFOMD_NOCOPY) /* depends on */ #define FREEBSD_MODTYPE_KERNEL "elf kernel" +#define FREEBSD_MODTYPE_KERNEL64 "elf64 kernel" #define FREEBSD_MODTYPE_MODULE "elf module" #define FREEBSD_MODTYPE_RAW "raw" @@ -224,4 +227,11 @@ struct grub_netbsd_btinfo_bootdisk int partition; }; +void grub_unix_real_boot (grub_addr_t entry, ...) + __attribute__ ((cdecl,noreturn)); + +extern grub_uint8_t grub_bsd64_trampoline_start, grub_bsd64_trampoline_end; +extern grub_uint32_t grub_bsd64_trampoline_selfjump; +extern grub_uint32_t grub_bsd64_trampoline_gdt; + #endif /* ! GRUB_BSD_CPU_HEADER */ diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index afd3eb93f..72a44d088 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -32,7 +32,4 @@ extern grub_size_t EXPORT_VAR(grub_os_area_size); grub_err_t EXPORT_FUNC(grub_linux16_boot) (void); -void EXPORT_FUNC(grub_unix_real_boot) (grub_addr_t entry, ...) - __attribute__ ((cdecl,noreturn)); - #endif /* ! GRUB_LOADER_CPU_HEADER */ diff --git a/kern/i386/loader.S b/kern/i386/loader.S index bbd2187fb..3e9c71327 100644 --- a/kern/i386/loader.S +++ b/kern/i386/loader.S @@ -118,25 +118,3 @@ linux_setup_seg: .word 0 .code32 -/* - * Use cdecl calling convention for *BSD kernels. - */ - -FUNCTION(grub_unix_real_boot) - - call EXT_C(grub_dl_unload_all) - - /* Interrupts should be disabled. */ - cli - - /* Discard `grub_unix_real_boot' return address. */ - popl %eax - - /* Fetch `entry' address ... */ - popl %eax - - /* - * ... and put our return address in its place. The kernel will - * ignore it, but it expects %esp to point to it. - */ - call *%eax diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index ea51aa220..db76399cd 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008, 2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,6 +21,8 @@ #include #include #include +#include +#include #include #include #include @@ -33,17 +35,19 @@ #include #define ALIGN_DWORD(a) ALIGN_UP (a, 4) +#define ALIGN_QWORD(a) ALIGN_UP (a, 8) +#define ALIGN_VAR(a) ((is_64bit) ? (ALIGN_QWORD(a)) : (ALIGN_DWORD(a))) #define ALIGN_PAGE(a) ALIGN_UP (a, 4096) #define MOD_BUF_ALLOC_UNIT 4096 static int kernel_type; static grub_dl_t my_mod; -static grub_addr_t entry, kern_start, kern_end; +static grub_addr_t entry, entry_hi, kern_start, kern_end; static grub_uint32_t bootflags; static char *mod_buf; -static grub_uint32_t mod_buf_len, mod_buf_max; -static int is_elf_kernel; +static grub_uint32_t mod_buf_len, mod_buf_max, kern_end_mdofs; +static int is_elf_kernel, is_64bit; static const char freebsd_opts[] = "DhaCcdgmnpqrsv"; static const grub_uint32_t freebsd_flags[] = @@ -135,11 +139,121 @@ grub_freebsd_add_meta (grub_uint32_t type, void *data, grub_uint32_t len) if (len) grub_memcpy (mod_buf + mod_buf_len, data, len); - mod_buf_len = ALIGN_DWORD (mod_buf_len + len); + mod_buf_len = ALIGN_VAR (mod_buf_len + len); return GRUB_ERR_NONE; } +struct grub_e820_mmap +{ + grub_uint64_t addr; + grub_uint64_t size; + grub_uint32_t type; +} __attribute__((packed)); +#define GRUB_E820_RAM 1 +#define GRUB_E820_RESERVED 2 +#define GRUB_E820_ACPI 3 +#define GRUB_E820_NVS 4 +#define GRUB_E820_EXEC_CODE 5 + +static grub_err_t +grub_freebsd_add_mmap (void) +{ + grub_size_t len = 0; + struct grub_e820_mmap *mmap_buf = 0; + struct grub_e820_mmap *mmap = 0; + int isfirstrun = 1; + + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, + grub_uint32_t type) + { + /* FreeBSD assumes that first 64KiB are available. + Not always true but try to prevent panic somehow. */ + if (isfirstrun && addr != 0) + { + if (mmap) + { + mmap->addr = 0; + mmap->size = (addr < 0x10000) ? addr : 0x10000; + mmap->type = GRUB_E820_RAM; + mmap++; + } + else + len += sizeof (struct grub_e820_mmap); + } + isfirstrun = 0; + if (mmap) + { + mmap->addr = addr; + mmap->size = size; + switch (type) + { + case GRUB_MACHINE_MEMORY_AVAILABLE: + mmap->type = GRUB_E820_RAM; + break; + +#ifdef GRUB_MACHINE_MEMORY_ACPI + case GRUB_MACHINE_MEMORY_ACPI: + mmap->type = GRUB_E820_ACPI; + break; +#endif + +#ifdef GRUB_MACHINE_MEMORY_NVS + case GRUB_MACHINE_MEMORY_NVS: + mmap->type = GRUB_E820_NVS; + break; +#endif + + default: +#ifdef GRUB_MACHINE_MEMORY_CODE + case GRUB_MACHINE_MEMORY_CODE: +#endif +#ifdef GRUB_MACHINE_MEMORY_RESERVED + case GRUB_MACHINE_MEMORY_RESERVED: +#endif + mmap->type = GRUB_E820_RESERVED; + break; + } + + /* Merge regions if possible. */ + if (mmap != mmap_buf && mmap->type == mmap[-1].type && + mmap->addr == mmap[-1].addr + mmap[-1].size) + mmap[-1].size += mmap->size; + else + mmap++; + } + else + len += sizeof (struct grub_e820_mmap); + + return 0; + } + + grub_mmap_iterate (hook); + mmap_buf = mmap = grub_malloc (len); + if (! mmap) + return grub_errno; + + isfirstrun = 1; + grub_mmap_iterate (hook); + + len = (mmap - mmap_buf) * sizeof (struct grub_e820_mmap); + int i; + for (i = 0; i < mmap - mmap_buf; i++) + grub_dprintf ("bsd", "smap %d, %d:%llx - %llx\n", i, + mmap_buf[i].type, + (unsigned long long) mmap_buf[i].addr, + (unsigned long long) mmap_buf[i].size); + + grub_dprintf ("bsd", "%d entries in smap\n", mmap - mmap_buf); + grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_SMAP, mmap_buf, len); + + grub_free (mmap_buf); + + return grub_errno; +} + static grub_err_t grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, grub_addr_t addr, grub_uint32_t size) @@ -166,13 +280,31 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, argv++; } else - type = (is_kern) ? FREEBSD_MODTYPE_KERNEL : FREEBSD_MODTYPE_RAW; + type = ((is_kern) ? + ((is_64bit) ? FREEBSD_MODTYPE_KERNEL64 : FREEBSD_MODTYPE_KERNEL) + : FREEBSD_MODTYPE_RAW); - if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, + if (is_64bit) + { + grub_uint64_t addr64 = addr, size64 = size; + if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, grub_strlen (type) + 1)) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, sizeof (addr))) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, sizeof (size)))) - return grub_errno; + (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64, + sizeof (addr64))) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size64, + sizeof (size64)))) + return grub_errno; + } + else + { + if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, + grub_strlen (type) + 1)) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, + sizeof (addr))) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, + sizeof (size)))) + return grub_errno; + } if (argc) { @@ -202,6 +334,23 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, } } + if (is_kern) + { + int len = (is_64bit) ? 8 : 4; + grub_uint64_t data = 0; + + if ((grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_HOWTO, &data, 4)) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_ENVP, &data, len)) || + (grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_KERNEND, &data, len))) + return grub_errno; + kern_end_mdofs = mod_buf_len - len; + + return grub_freebsd_add_mmap (); + } + return GRUB_ERR_NONE; } @@ -241,10 +390,19 @@ grub_freebsd_list_modules (void) } } - pos = ALIGN_DWORD (pos + size); + pos = ALIGN_VAR (pos + size); } } +/* This function would be here but it's under different licence. */ +#include "bsd_pagetable.c" + +struct gdt_descriptor +{ + grub_uint16_t limit; + void *base; +} __attribute__ ((packed)); + static grub_err_t grub_freebsd_boot (void) { @@ -291,6 +449,9 @@ grub_freebsd_boot (void) if (is_elf_kernel) { + grub_addr_t md_ofs; + int ofs; + if (grub_freebsd_add_meta (FREEBSD_MODINFO_END, 0, 0)) return grub_errno; @@ -298,12 +459,70 @@ grub_freebsd_boot (void) bi.bi_modulep = kern_end; kern_end = ALIGN_PAGE (kern_end + mod_buf_len); + + if (is_64bit) + kern_end += 4096 * 4; + + md_ofs = bi.bi_modulep + kern_end_mdofs; + ofs = (is_64bit) ? 16 : 12; + *((grub_uint32_t *) md_ofs) = kern_end; + md_ofs -= ofs; + *((grub_uint32_t *) md_ofs) = bi.bi_envp; + md_ofs -= ofs; + *((grub_uint32_t *) md_ofs) = bootflags; } bi.bi_kernend = kern_end; - grub_unix_real_boot (entry, bootflags | FREEBSD_RB_BOOTINFO, bootdev, - 0, 0, 0, &bi, bi.bi_modulep, kern_end); + if (is_64bit) + { + grub_uint32_t *gdt; + grub_uint8_t *trampoline; + void (*launch_trampoline) (grub_addr_t entry, ...) + __attribute__ ((cdecl, regparm (0))); + grub_uint8_t *pagetable; + + struct gdt_descriptor *gdtdesc; + + pagetable = (grub_uint8_t *) (kern_end - 16384); + fill_bsd64_pagetable (pagetable); + + /* Create GDT. */ + gdt = (grub_uint32_t *) (kern_end - 4096); + gdt[0] = 0; + gdt[1] = 0; + gdt[2] = 0; + gdt[3] = 0x00209800; + gdt[4] = 0; + gdt[5] = 0x00008000; + + /* Create GDT descriptor. */ + gdtdesc = (struct gdt_descriptor *) (kern_end - 4096 + 24); + gdtdesc->limit = 24; + gdtdesc->base = gdt; + + /* Prepare trampoline. */ + trampoline = (grub_uint8_t *) (kern_end - 4096 + 24 + + sizeof (struct gdt_descriptor)); + launch_trampoline = (void __attribute__ ((cdecl, regparm (0))) + (*) (grub_addr_t entry, ...)) trampoline; + grub_bsd64_trampoline_gdt = (grub_uint32_t) gdtdesc; + grub_bsd64_trampoline_selfjump + = (grub_uint32_t) (trampoline + 6 + + ((grub_uint8_t *) &grub_bsd64_trampoline_selfjump + - &grub_bsd64_trampoline_start)); + + /* Copy trampoline. */ + grub_memcpy (trampoline, &grub_bsd64_trampoline_start, + &grub_bsd64_trampoline_end - &grub_bsd64_trampoline_start); + + /* Launch trampoline. */ + launch_trampoline (entry, entry_hi, pagetable, bi.bi_modulep, + kern_end); + } + else + grub_unix_real_boot (entry, bootflags | FREEBSD_RB_BOOTINFO, bootdev, + 0, 0, 0, &bi, bi.bi_modulep, kern_end); /* Not reached. */ return GRUB_ERR_NONE; @@ -485,6 +704,29 @@ grub_bsd_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr) return GRUB_ERR_NONE; } +static grub_err_t +grub_bsd_elf64_hook (Elf64_Phdr * phdr, grub_addr_t * addr) +{ + Elf64_Addr paddr; + + paddr = phdr->p_paddr & 0xffffff; + + if ((paddr < grub_os_area_addr) + || (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size)) + return grub_error (GRUB_ERR_OUT_OF_RANGE, "Address 0x%x is out of range", + paddr); + + if ((!kern_start) || (paddr < kern_start)) + kern_start = paddr; + + if (paddr + phdr->p_memsz > kern_end) + kern_end = paddr + phdr->p_memsz; + + *addr = paddr; + + return GRUB_ERR_NONE; +} + static grub_err_t grub_bsd_load_elf (grub_elf_t elf) { @@ -495,6 +737,13 @@ grub_bsd_load_elf (grub_elf_t elf) entry = elf->ehdr.ehdr32.e_entry & 0xFFFFFF; return grub_elf32_load (elf, grub_bsd_elf32_hook, 0, 0); } + else if (grub_elf_is_elf64 (elf)) + { + is_64bit = 1; + entry = elf->ehdr.ehdr64.e_entry & 0xffffffff; + entry_hi = (elf->ehdr.ehdr64.e_entry >> 32) & 0xffffffff; + return grub_elf64_load (elf, grub_bsd_elf64_hook, 0, 0); + } else return grub_error (GRUB_ERR_BAD_OS, "invalid elf"); } From c405ba08ed6f59bc935233d61bcc72906825f822 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 3 May 2009 10:14:19 +0000 Subject: [PATCH 0705/1707] missing files from previous commit --- loader/i386/bsd_helper.S | 45 +++++++++++++ loader/i386/bsd_pagetable.c | 88 +++++++++++++++++++++++++ loader/i386/bsd_trampoline.S | 124 +++++++++++++++++++++++++++++++++++ 3 files changed, 257 insertions(+) create mode 100644 loader/i386/bsd_helper.S create mode 100644 loader/i386/bsd_pagetable.c create mode 100644 loader/i386/bsd_trampoline.S diff --git a/loader/i386/bsd_helper.S b/loader/i386/bsd_helper.S new file mode 100644 index 000000000..23c86109c --- /dev/null +++ b/loader/i386/bsd_helper.S @@ -0,0 +1,45 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008, 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + + .p2align 2 + + + .code32 + +/* + * Use cdecl calling convention for *BSD kernels. + */ + +FUNCTION(grub_unix_real_boot) + + /* Interrupts should be disabled. */ + cli + + /* Discard `grub_unix_real_boot' return address. */ + popl %eax + + /* Fetch `entry' address ... */ + popl %eax + + /* + * ... and put our return address in its place. The kernel will + * ignore it, but it expects %esp to point to it. + */ + call *%eax diff --git a/loader/i386/bsd_pagetable.c b/loader/i386/bsd_pagetable.c new file mode 100644 index 000000000..754f6f072 --- /dev/null +++ b/loader/i386/bsd_pagetable.c @@ -0,0 +1,88 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 1998 Michael Smith + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* Based on the code from FreeBSD originally distributed under the + following terms: */ + +/*- + * Copyright (c) 1998 Michael Smith + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +static void +fill_bsd64_pagetable (grub_uint8_t *target) +{ + grub_uint64_t *pt2, *pt3, *pt4; + int i; + +#define PG_V 0x001 +#define PG_RW 0x002 +#define PG_U 0x004 +#define PG_PS 0x080 + + pt4 = (grub_uint64_t *) target; + pt3 = (grub_uint64_t *) (target + 4096); + pt2 = (grub_uint64_t *) (target + 8192); + + grub_memset ((char *) target, 0, 4096 * 3); + + /* + * This is kinda brutal, but every single 1GB VM memory segment points to + * the same first 1GB of physical memory. But it is how BSD expects + * it to be. + */ + for (i = 0; i < 512; i++) + { + /* Each slot of the level 4 pages points to the same level 3 page */ + pt4[i] = (grub_addr_t) &pt3[0]; + pt4[i] |= PG_V | PG_RW | PG_U; + + /* Each slot of the level 3 pages points to the same level 2 page */ + pt3[i] = (grub_addr_t) &pt2[0]; + pt3[i] |= PG_V | PG_RW | PG_U; + + /* The level 2 page slots are mapped with 2MB pages for 1GB. */ + pt2[i] = i * (2 * 1024 * 1024); + pt2[i] |= PG_V | PG_RW | PG_PS | PG_U; + } +} diff --git a/loader/i386/bsd_trampoline.S b/loader/i386/bsd_trampoline.S new file mode 100644 index 000000000..f6bfe2c44 --- /dev/null +++ b/loader/i386/bsd_trampoline.S @@ -0,0 +1,124 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (c) 2003 Peter Wemm + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +/* Based on the code from FreeBSD originally distributed under the + following terms: */ + +/*- + * Copyright (c) 2003 Peter Wemm + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * 2. Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * + * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND + * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE + * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE + * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT + * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY + * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * + * $FreeBSD$ + */ + + +#define MSR_EFER 0xc0000080 +#define EFER_LME 0x00000100 +#define CR4_PAE 0x00000020 +#define CR4_PSE 0x00000010 +#define CR0_PG 0x80000000 + +#include + + .p2align 2 + + .code32 + + +VARIABLE(grub_bsd64_trampoline_start) + + /* Discard `grub_unix_real_boot' return address. */ + popl %eax + + /* entry */ + popl %edi + + /* entry_hi */ + popl %esi + + cli + + /* Turn on EFER.LME. */ + movl $MSR_EFER, %ecx + rdmsr + orl $EFER_LME, %eax + wrmsr + + /* Turn on PAE. */ + movl %cr4, %eax + orl $(CR4_PAE | CR4_PSE), %eax + movl %eax, %cr4 + + /* Set %cr3 for PT4. */ + popl %eax + movl %eax, %cr3 + + /* Push a dummy return address. */ + pushl %eax + + /* Turn on paging (implicitly sets EFER.LMA). */ + movl %cr0, %eax + orl $CR0_PG, %eax + movl %eax, %cr0 + + /* Now we're in compatability mode. set %cs for long mode. */ + /* lgdt */ + .byte 0x0f + .byte 0x01 + .byte 0x15 +VARIABLE (grub_bsd64_trampoline_gdt) + .long 0x0 + + /* ljmp */ + .byte 0xea +VARIABLE (grub_bsd64_trampoline_selfjump) + .long 0x0 + .word 0x08 + + .code64 + +bsd64_longmode: + /* We're still running V=P, jump to entry point. */ + movl %esi, %eax + salq $32, %rax + orq %rdi, %rax + pushq %rax + ret +VARIABLE(grub_bsd64_trampoline_end) From dfc31a22bb18221b2c7a7751e655470219ae6489 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 3 May 2009 19:04:59 +0000 Subject: [PATCH 0706/1707] 2009-05-03 Pavel Roskin * util/i386/pc/grub-mkrescue.in: Allow for the case when efiemu??.o doesn't exist. * util/i386/pc/grub-install.in: Likewise. Use "cp -f" for copying. --- ChangeLog | 7 +++++++ util/i386/pc/grub-install.in | 4 +++- util/i386/pc/grub-mkrescue.in | 9 ++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2cf8f8f29..e42bc5684 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-03 Pavel Roskin + + * util/i386/pc/grub-mkrescue.in: Allow for the case when + efiemu??.o doesn't exist. + * util/i386/pc/grub-install.in: Likewise. Use "cp -f" for + copying. + 2009-05-03 Bean Vladimir Serbinenko FreeBSD 64-bit support diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 31c2dc7fd..e4724f94e 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -221,7 +221,9 @@ for file in ${pkglibdir}/*.mod ${pkglibdir}/*.lst; do done if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then for file in ${pkglibdir}/*.img ${pkglibdir}/efiemu??.o; do - cp -f $file ${grubdir} || exit 1 + if test -f $file; then + cp -f $file ${grubdir} || exit 1 + fi done fi diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index 7d28acd51..da937768b 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -116,10 +116,13 @@ fi aux_dir=`mktemp -d` mkdir -p ${aux_dir}/boot/grub -cp ${input_dir}/*.mod ${input_dir}/efiemu??.o \ +for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \ ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ - ${input_dir}/handler.lst ${input_dir}/parttool.lst \ - ${aux_dir}/boot/grub/ + ${input_dir}/handler.lst ${input_dir}/parttool.lst; do + if test -f "$file"; then + cp -f "$file" ${aux_dir}/boot/grub/ + fi +done modules="biosdisk `cat ${input_dir}/partmap.lst` ${modules}" for i in ${modules} ; do From 2fee74f1bbdee13e0b77f039a3516c220fd8a3a5 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 3 May 2009 19:25:14 +0000 Subject: [PATCH 0707/1707] 2009-05-03 Pavel Roskin MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * mmap/efi/mmap.c (grub_mmap_malign_and_register): Return void*, not char*. * mmap/i386/mmap.c (grub_mmap_malign_and_register): Likewise. Suggested by Javier Martín --- ChangeLog | 5 +++++ include/grub/memory.h | 2 +- mmap/efi/mmap.c | 2 +- mmap/i386/mmap.c | 4 ++-- 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index e42bc5684..7cea915f0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-05-03 Pavel Roskin + * mmap/efi/mmap.c (grub_mmap_malign_and_register): Return void*, + not char*. + * mmap/i386/mmap.c (grub_mmap_malign_and_register): Likewise. + Suggested by Javier Martín + * util/i386/pc/grub-mkrescue.in: Allow for the case when efiemu??.o doesn't exist. * util/i386/pc/grub-install.in: Likewise. Use "cp -f" for diff --git a/include/grub/memory.h b/include/grub/memory.h index df64207b7..f7fe2beca 100644 --- a/include/grub/memory.h +++ b/include/grub/memory.h @@ -30,7 +30,7 @@ grub_err_t grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type); grub_err_t grub_mmap_unregister (int handle); -char *grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, +void *grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, int *handle, int type, int flags); void grub_mmap_free_and_unregister (int handle); diff --git a/mmap/efi/mmap.c b/mmap/efi/mmap.c index 0aa8e0920..d0dbc6a97 100644 --- a/mmap/efi/mmap.c +++ b/mmap/efi/mmap.c @@ -218,7 +218,7 @@ grub_mmap_unregister (int handle) } /* Result is always page-aligned. */ -char * +void * grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), grub_uint64_t size, int *handle, int type, diff --git a/mmap/i386/mmap.c b/mmap/i386/mmap.c index ed0c6e4ea..9f751d0ac 100644 --- a/mmap/i386/mmap.c +++ b/mmap/i386/mmap.c @@ -26,7 +26,7 @@ #ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE -char * +void * grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, int *handle, int type, int flags) { @@ -48,7 +48,7 @@ grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, return 0; } - char * ret; + void *ret; if (flags & GRUB_MMAP_MALLOC_LOW) { /* FIXME: use low-memory mm allocation once it's available. */ From 515b50793afec0d5b30673ec469b05807f2a7dc0 Mon Sep 17 00:00:00 2001 From: davem Date: Sun, 3 May 2009 22:05:29 +0000 Subject: [PATCH 0708/1707] * normal/menu.c: Include grub/parser.h --- ChangeLog | 4 ++++ normal/menu.c | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7cea915f0..61c89671a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-03 David S. Miller + + * normal/menu.c: Include grub/parser.h + 2009-05-03 Pavel Roskin * mmap/efi/mmap.c (grub_mmap_malign_and_register): Return void*, diff --git a/normal/menu.c b/normal/menu.c index abf1b0f6d..e1d7edcad 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -25,6 +25,7 @@ #include #include #include +#include /* Get a menu entry by its index in the entry list. */ grub_menu_entry_t From 4c402e73012b87ac946b2d63071b0c577884ecf6 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 4 May 2009 03:49:08 +0000 Subject: [PATCH 0709/1707] 2009-05-03 Pavel Roskin * disk/ata.c: Don't cast mod to void in GRUB_MOD_INIT to suppress warnings. It's no longer needed. * disk/host.c: Likewise. * disk/ata_pthru.c: Likewise. * disk/loopback.c: Likewise. * hook/datehook.c: Likewise. * parttool/pcpart.c: Likewise. * fs/i386/pc/pxe.c: Likewise. * fs/ntfscomp.c: Likewise. * efiemu/main.c: Likewise. * mmap/mmap.c: Likewise. * commands/crc.c: Likewise. * commands/hexdump.c: Likewise. * commands/hdparm.c: Likewise. * commands/acpi.c: Likewise. * commands/echo.c: Likewise. * commands/minicmd.c: Likewise. * commands/blocklist.c: Likewise. * commands/memrw.c: Likewise. * commands/loadenv.c: Likewise. * commands/usbtest.c: Likewise. * commands/lsmmap.c: Likewise. * commands/boot.c: Likewise. * commands/parttool.c: Likewise. * commands/configfile.c: Likewise. * commands/search.c: Likewise. * commands/ieee1275/suspend.c: Likewise. * commands/cat.c: Likewise. * commands/i386/pc/pxecmd.c: Likewise. * commands/i386/pc/play.c: Likewise. * commands/i386/pc/halt.c: Likewise. * commands/i386/pc/vbeinfo.c: Likewise. * commands/i386/pc/vbetest.c: Likewise. * commands/lspci.c: Likewise. * commands/date.c: Likewise. * commands/handler.c: Likewise. * commands/ls.c: Likewise. * commands/test.c: Likewise. * commands/cmp.c: Likewise. * commands/efi/loadbios.c: Likewise. * commands/efi/fixvideo.c: Likewise. * commands/halt.c: Likewise. * commands/help.c: Likewise. * commands/reboot.c: Likewise. * hello/hello.c: Likewise. * script/sh/main.c: Likewise. * loader/xnu.c: Likewise. * term/terminfo.c: Likewise. * term/i386/pc/serial.c: Likewise. * term/usb_keyboard.c: Likewise. --- ChangeLog | 53 +++++++++++++++++++++++++++++++++++++ commands/acpi.c | 1 - commands/blocklist.c | 1 - commands/boot.c | 1 - commands/cat.c | 1 - commands/cmp.c | 1 - commands/configfile.c | 1 - commands/crc.c | 1 - commands/date.c | 1 - commands/echo.c | 1 - commands/efi/fixvideo.c | 1 - commands/efi/loadbios.c | 1 - commands/halt.c | 1 - commands/handler.c | 1 - commands/hdparm.c | 2 -- commands/help.c | 1 - commands/hexdump.c | 1 - commands/i386/pc/halt.c | 1 - commands/i386/pc/play.c | 1 - commands/i386/pc/pxecmd.c | 1 - commands/i386/pc/vbeinfo.c | 1 - commands/i386/pc/vbetest.c | 1 - commands/ieee1275/suspend.c | 1 - commands/loadenv.c | 2 -- commands/ls.c | 1 - commands/lsmmap.c | 1 - commands/lspci.c | 1 - commands/memrw.c | 1 - commands/minicmd.c | 2 -- commands/parttool.c | 1 - commands/reboot.c | 1 - commands/search.c | 1 - commands/test.c | 1 - commands/usbtest.c | 1 - disk/ata.c | 2 -- disk/ata_pthru.c | 2 -- disk/host.c | 1 - disk/loopback.c | 1 - efiemu/main.c | 1 - fs/i386/pc/pxe.c | 2 -- fs/ntfscomp.c | 1 - hello/hello.c | 1 - hook/datehook.c | 1 - loader/xnu.c | 1 - mmap/mmap.c | 1 - parttool/pcpart.c | 2 -- script/sh/main.c | 1 - term/i386/pc/serial.c | 1 - term/terminfo.c | 1 - term/usb_keyboard.c | 2 -- 50 files changed, 53 insertions(+), 57 deletions(-) diff --git a/ChangeLog b/ChangeLog index 61c89671a..2f7d7908b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,56 @@ +2009-05-03 Pavel Roskin + + * disk/ata.c: Don't cast mod to void in GRUB_MOD_INIT to + suppress warnings. It's no longer needed. + * disk/host.c: Likewise. + * disk/ata_pthru.c: Likewise. + * disk/loopback.c: Likewise. + * hook/datehook.c: Likewise. + * parttool/pcpart.c: Likewise. + * fs/i386/pc/pxe.c: Likewise. + * fs/ntfscomp.c: Likewise. + * efiemu/main.c: Likewise. + * mmap/mmap.c: Likewise. + * commands/crc.c: Likewise. + * commands/hexdump.c: Likewise. + * commands/hdparm.c: Likewise. + * commands/acpi.c: Likewise. + * commands/echo.c: Likewise. + * commands/minicmd.c: Likewise. + * commands/blocklist.c: Likewise. + * commands/memrw.c: Likewise. + * commands/loadenv.c: Likewise. + * commands/usbtest.c: Likewise. + * commands/lsmmap.c: Likewise. + * commands/boot.c: Likewise. + * commands/parttool.c: Likewise. + * commands/configfile.c: Likewise. + * commands/search.c: Likewise. + * commands/ieee1275/suspend.c: Likewise. + * commands/cat.c: Likewise. + * commands/i386/pc/pxecmd.c: Likewise. + * commands/i386/pc/play.c: Likewise. + * commands/i386/pc/halt.c: Likewise. + * commands/i386/pc/vbeinfo.c: Likewise. + * commands/i386/pc/vbetest.c: Likewise. + * commands/lspci.c: Likewise. + * commands/date.c: Likewise. + * commands/handler.c: Likewise. + * commands/ls.c: Likewise. + * commands/test.c: Likewise. + * commands/cmp.c: Likewise. + * commands/efi/loadbios.c: Likewise. + * commands/efi/fixvideo.c: Likewise. + * commands/halt.c: Likewise. + * commands/help.c: Likewise. + * commands/reboot.c: Likewise. + * hello/hello.c: Likewise. + * script/sh/main.c: Likewise. + * loader/xnu.c: Likewise. + * term/terminfo.c: Likewise. + * term/i386/pc/serial.c: Likewise. + * term/usb_keyboard.c: Likewise. + 2009-05-03 David S. Miller * normal/menu.c: Include grub/parser.h diff --git a/commands/acpi.c b/commands/acpi.c index 309228827..3521c4c54 100644 --- a/commands/acpi.c +++ b/commands/acpi.c @@ -756,7 +756,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(acpi) { - (void) mod; /* To stop warning. */ cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, GRUB_COMMAND_FLAG_BOTH, "acpi [-1|-2] [--exclude=table1,table2|" diff --git a/commands/blocklist.c b/commands/blocklist.c index b8c538544..2057291af 100644 --- a/commands/blocklist.c +++ b/commands/blocklist.c @@ -109,7 +109,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(blocklist) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("blocklist", grub_cmd_blocklist, "blocklist FILE", "Print a block list."); } diff --git a/commands/boot.c b/commands/boot.c index c8bd030a0..40ee9f8c4 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -184,7 +184,6 @@ static grub_command_t cmd_boot; GRUB_MOD_INIT(boot) { - (void) mod; /* To stop warning. */ cmd_boot = grub_register_command ("boot", grub_cmd_boot, 0, "boot an operating system"); diff --git a/commands/cat.c b/commands/cat.c index 786113ec4..f2d5f1c1a 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -77,7 +77,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(cat) { - (void) mod; /* To stop warning. */ cmd = grub_register_command_p1 ("cat", grub_cmd_cat, "cat FILE", "Show the contents of a file."); } diff --git a/commands/cmp.c b/commands/cmp.c index c70690a63..b5d4f8dac 100644 --- a/commands/cmp.c +++ b/commands/cmp.c @@ -108,7 +108,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(cmp) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("cmp", grub_cmd_cmp, "cmp FILE1 FILE2", "Compare two files."); } diff --git a/commands/configfile.c b/commands/configfile.c index 37d02b6b8..852932216 100644 --- a/commands/configfile.c +++ b/commands/configfile.c @@ -51,7 +51,6 @@ static grub_command_t cmd_configfile, cmd_source, cmd_dot; GRUB_MOD_INIT(configfile) { - (void) mod; /* To stop warning. */ cmd_configfile = grub_register_command ("configfile", grub_cmd_source, "configfile FILE", "Load another config file."); diff --git a/commands/crc.c b/commands/crc.c index 71a0c065c..6b4b1d1b5 100644 --- a/commands/crc.c +++ b/commands/crc.c @@ -56,7 +56,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(crc) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("crc", grub_cmd_crc, "crc FILE", "Calculate the crc32 checksum of a file."); diff --git a/commands/date.c b/commands/date.c index a8f19b305..1d609642e 100644 --- a/commands/date.c +++ b/commands/date.c @@ -133,7 +133,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(date) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("date", grub_cmd_date, "date [[year-]month-day] [hour:minute[:second]]", diff --git a/commands/echo.c b/commands/echo.c index 55181430c..f3b5f873d 100644 --- a/commands/echo.c +++ b/commands/echo.c @@ -112,7 +112,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(echo) { - (void) mod; /* To stop warning. */ cmd = grub_register_extcmd ("echo", grub_cmd_echo, GRUB_COMMAND_FLAG_BOTH, "echo [-e|-n] FILE", "Display a line of text.", options); diff --git a/commands/efi/fixvideo.c b/commands/efi/fixvideo.c index 013c1eec6..f97d83787 100644 --- a/commands/efi/fixvideo.c +++ b/commands/efi/fixvideo.c @@ -98,7 +98,6 @@ static grub_command_t cmd_fixvideo; GRUB_MOD_INIT(fixvideo) { - (void) mod; /* To stop warning. */ cmd_fixvideo = grub_register_command ("fix_video", grub_cmd_fixvideo, 0, "Fix video problem."); diff --git a/commands/efi/loadbios.c b/commands/efi/loadbios.c index a0f314931..7b71a712d 100644 --- a/commands/efi/loadbios.c +++ b/commands/efi/loadbios.c @@ -198,7 +198,6 @@ static grub_command_t cmd_fakebios, cmd_loadbios; GRUB_MOD_INIT(loadbios) { - (void) mod; /* To stop warning. */ cmd_fakebios = grub_register_command ("fakebios", grub_cmd_fakebios, 0, "fake bios."); diff --git a/commands/halt.c b/commands/halt.c index 0ae2b36bd..b902418a8 100644 --- a/commands/halt.c +++ b/commands/halt.c @@ -43,7 +43,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(halt) { - (void)mod; /* To stop warning. */ cmd = grub_register_command ("halt", grub_cmd_halt, 0, "halts the computer. This command does not" " work on all firmware."); diff --git a/commands/handler.c b/commands/handler.c index d9ed61185..2070c391c 100644 --- a/commands/handler.c +++ b/commands/handler.c @@ -93,7 +93,6 @@ static grub_command_t cmd_handler, cmd_terminal_input, cmd_terminal_output; GRUB_MOD_INIT(handler) { - (void)mod; /* To stop warning. */ cmd_handler = grub_register_command ("handler", grub_cmd_handler, "handler [class [handler]]", diff --git a/commands/hdparm.c b/commands/hdparm.c index 8dcd6c256..389954c45 100644 --- a/commands/hdparm.c +++ b/commands/hdparm.c @@ -408,8 +408,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(hdparm) { - (void) mod; - cmd = grub_register_extcmd ("hdparm", grub_cmd_hdparm, GRUB_COMMAND_FLAG_BOTH, "hdparm [OPTIONS] DISK", diff --git a/commands/help.c b/commands/help.c index 02b841d05..6159a6333 100644 --- a/commands/help.c +++ b/commands/help.c @@ -92,7 +92,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(help) { - (void)mod; /* To stop warning. */ cmd = grub_register_extcmd ("help", grub_cmd_help, GRUB_COMMAND_FLAG_CMDLINE, "help [PATTERN ...]", diff --git a/commands/hexdump.c b/commands/hexdump.c index c4b7d323d..0e560c0ff 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -125,7 +125,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT (hexdump) { - (void) mod; /* To stop warning. */ cmd = grub_register_extcmd ("hexdump", grub_cmd_hexdump, GRUB_COMMAND_FLAG_BOTH, "hexdump [OPTIONS] FILE_OR_DEVICE", diff --git a/commands/i386/pc/halt.c b/commands/i386/pc/halt.c index 8999f5aac..add8631a8 100644 --- a/commands/i386/pc/halt.c +++ b/commands/i386/pc/halt.c @@ -45,7 +45,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(halt) { - (void)mod; /* To stop warning. */ cmd = grub_register_extcmd ("halt", grub_cmd_halt, GRUB_COMMAND_FLAG_BOTH, "halt [-n]", "Halt the system, if possible using APM", diff --git a/commands/i386/pc/play.c b/commands/i386/pc/play.c index 40ab81c0c..f9512cee5 100644 --- a/commands/i386/pc/play.c +++ b/commands/i386/pc/play.c @@ -206,7 +206,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(play) { - (void)mod; /* To stop warning. */ cmd = grub_register_command ("play", grub_cmd_play, "play FILE", "Play a tune"); } diff --git a/commands/i386/pc/pxecmd.c b/commands/i386/pc/pxecmd.c index 7a2e9e907..df538704c 100644 --- a/commands/i386/pc/pxecmd.c +++ b/commands/i386/pc/pxecmd.c @@ -88,7 +88,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(pxecmd) { - (void) mod; /* To stop warning. */ cmd = grub_register_extcmd ("pxe", grub_cmd_pxe, GRUB_COMMAND_FLAG_BOTH, "pxe [-i|-b|-u]", "Command to control the PXE device.", options); diff --git a/commands/i386/pc/vbeinfo.c b/commands/i386/pc/vbeinfo.c index bf26689f0..3c397a14d 100644 --- a/commands/i386/pc/vbeinfo.c +++ b/commands/i386/pc/vbeinfo.c @@ -173,7 +173,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(vbeinfo) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("vbeinfo", grub_cmd_vbeinfo, 0, "List compatible VESA BIOS extension video modes."); diff --git a/commands/i386/pc/vbetest.c b/commands/i386/pc/vbetest.c index f47383065..bfcf215d0 100644 --- a/commands/i386/pc/vbetest.c +++ b/commands/i386/pc/vbetest.c @@ -165,7 +165,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(vbetest) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("vbetest", grub_cmd_vbetest, 0, "Test VESA BIOS Extension 2.0+ support"); } diff --git a/commands/ieee1275/suspend.c b/commands/ieee1275/suspend.c index 01e132441..028dd3cd8 100644 --- a/commands/ieee1275/suspend.c +++ b/commands/ieee1275/suspend.c @@ -38,7 +38,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(ieee1275_suspend) { - (void)mod; /* To stop warning. */ cmd = grub_register_command ("suspend", grub_cmd_suspend, 0, "Return to Open Firmware prompt"); } diff --git a/commands/loadenv.c b/commands/loadenv.c index e7d1b06e4..1c2020b30 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -381,8 +381,6 @@ static grub_extcmd_t cmd_load, cmd_list, cmd_save; GRUB_MOD_INIT(loadenv) { - (void) mod; - cmd_load = grub_register_extcmd ("load_env", grub_cmd_load_env, GRUB_COMMAND_FLAG_BOTH, diff --git a/commands/ls.c b/commands/ls.c index 8e4d2a285..fb38fab99 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -259,7 +259,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(ls) { - (void)mod; /* To stop warning. */ cmd = grub_register_extcmd ("ls", grub_cmd_ls, GRUB_COMMAND_FLAG_BOTH, "ls [-l|-h|-a] [FILE]", "List devices and files.", options); diff --git a/commands/lsmmap.c b/commands/lsmmap.c index 4fe9a5a7a..09f141ea0 100644 --- a/commands/lsmmap.c +++ b/commands/lsmmap.c @@ -42,7 +42,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(lsmmap) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("lsmmap", grub_cmd_lsmmap, 0, "List memory map provided by firmware."); } diff --git a/commands/lspci.c b/commands/lspci.c index 36bc7608f..5b3360a37 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -158,7 +158,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(pci) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("lspci", grub_cmd_lspci, 0, "List PCI devices"); } diff --git a/commands/memrw.c b/commands/memrw.c index fa04c7609..adffb7fc8 100644 --- a/commands/memrw.c +++ b/commands/memrw.c @@ -69,7 +69,6 @@ grub_cmd_write (grub_command_t cmd, int argc, char **argv) GRUB_MOD_INIT(memrw) { - (void) mod; /* To stop warning. */ cmd_read_byte = grub_register_command ("read_byte", grub_cmd_read, "read_byte ADDR", "read byte."); diff --git a/commands/minicmd.c b/commands/minicmd.c index 5083291f4..b31438844 100644 --- a/commands/minicmd.c +++ b/commands/minicmd.c @@ -341,8 +341,6 @@ static grub_command_t cmd_dump, cmd_rmmod, cmd_lsmod, cmd_exit; GRUB_MOD_INIT(minicmd) { - (void) mod; /* To stop warning. */ - cmd_cat = grub_register_command ("cat", grub_mini_cmd_cat, "cat FILE", "show the contents of a file"); diff --git a/commands/parttool.c b/commands/parttool.c index b09a2bac0..b4cbf0051 100644 --- a/commands/parttool.c +++ b/commands/parttool.c @@ -327,7 +327,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(parttool) { - (void)mod; /* To stop warning. */ mymod = mod; cmd = grub_register_command ("parttool", grub_cmd_parttool, "parttool PARTITION COMMANDS", diff --git a/commands/reboot.c b/commands/reboot.c index b5b42cde1..11bceeb31 100644 --- a/commands/reboot.c +++ b/commands/reboot.c @@ -46,7 +46,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(reboot) { - (void)mod; /* To stop warning. */ cmd = grub_register_command ("reboot", grub_cmd_reboot, 0, "Reboot the computer"); } diff --git a/commands/search.c b/commands/search.c index ccf4d16fc..03884a9f2 100644 --- a/commands/search.c +++ b/commands/search.c @@ -220,7 +220,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(search) { - (void) mod; /* To stop warning. */ cmd = grub_register_extcmd ("search", grub_cmd_search, GRUB_COMMAND_FLAG_BOTH, diff --git a/commands/test.c b/commands/test.c index 46ee03f1c..68b5efede 100644 --- a/commands/test.c +++ b/commands/test.c @@ -412,7 +412,6 @@ static grub_command_t cmd_1, cmd_2; GRUB_MOD_INIT(test) { - (void)mod; /* To stop warning. */ cmd_1 = grub_register_command ("[", grub_cmd_test, "[ EXPRESSION ]", "Evaluate an expression"); cmd_2 = grub_register_command ("test", grub_cmd_test, diff --git a/commands/usbtest.c b/commands/usbtest.c index c05173ea8..019d3fe78 100644 --- a/commands/usbtest.c +++ b/commands/usbtest.c @@ -151,7 +151,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(usbtest) { - (void)mod; /* To stop warning. */ cmd = grub_register_command ("usb", grub_cmd_usbtest, 0, "Test USB support"); } diff --git a/disk/ata.c b/disk/ata.c index fe6372011..812537ebe 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -835,8 +835,6 @@ static struct grub_scsi_dev grub_atapi_dev = GRUB_MOD_INIT(ata) { - (void) mod; /* To stop warning. */ - /* To prevent two drivers operating on the same disks. */ grub_disk_firmware_is_tainted = 1; if (grub_disk_firmware_fini) diff --git a/disk/ata_pthru.c b/disk/ata_pthru.c index cc74eb41b..70d4f3a78 100644 --- a/disk/ata_pthru.c +++ b/disk/ata_pthru.c @@ -96,8 +96,6 @@ grub_ata_pass_through (grub_disk_t disk, GRUB_MOD_INIT(ata_pthru) { - (void) mod; - /* Register ATA pass through function. */ grub_disk_ata_pass_through = grub_ata_pass_through; } diff --git a/disk/host.c b/disk/host.c index bb8828a6c..0229278f4 100644 --- a/disk/host.c +++ b/disk/host.c @@ -87,7 +87,6 @@ static struct grub_disk_dev grub_host_dev = GRUB_MOD_INIT(host) { - (void) mod; /* To stop warning. */ grub_disk_dev_register (&grub_host_dev); } diff --git a/disk/loopback.c b/disk/loopback.c index d41a78301..3cb2bf0ab 100644 --- a/disk/loopback.c +++ b/disk/loopback.c @@ -243,7 +243,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(loop) { - (void) mod; /* To stop warning. */ cmd = grub_register_extcmd ("loopback", grub_cmd_loopback, GRUB_COMMAND_FLAG_BOTH, "loopback [-d|-p] DEVICENAME FILE", diff --git a/efiemu/main.c b/efiemu/main.c index c4144390e..e11d7c3f9 100644 --- a/efiemu/main.c +++ b/efiemu/main.c @@ -321,7 +321,6 @@ grub_efiemu_pnvram_cmd_register (void); GRUB_MOD_INIT(efiemu) { - (void) mod; /* To stop warning. */ cmd_loadcore = grub_register_command ("efiemu_loadcore", grub_cmd_efiemu_load, "efiemu_loadcore FILE", diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index f294b89fa..9676be42c 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -305,8 +305,6 @@ grub_pxe_unload (void) GRUB_MOD_INIT(pxe) { - (void) mod; /* To stop warning. */ - grub_pxe_detect (); if (grub_pxe_pxenv) { diff --git a/fs/ntfscomp.c b/fs/ntfscomp.c index db8b50621..b021c358f 100644 --- a/fs/ntfscomp.c +++ b/fs/ntfscomp.c @@ -365,7 +365,6 @@ quit: GRUB_MOD_INIT (ntfscomp) { - (void) mod; grub_ntfscomp_func = ntfscomp; } diff --git a/hello/hello.c b/hello/hello.c index e3cf3212c..be60761ec 100644 --- a/hello/hello.c +++ b/hello/hello.c @@ -38,7 +38,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(hello) { - (void)mod; /* To stop warning. */ cmd = grub_register_extcmd ("hello", grub_cmd_hello, GRUB_COMMAND_FLAG_BOTH, "hello", "Say hello", 0); } diff --git a/hook/datehook.c b/hook/datehook.c index 0b0332871..b7663cc21 100644 --- a/hook/datehook.c +++ b/hook/datehook.c @@ -86,7 +86,6 @@ grub_read_hook_datetime (struct grub_env_var *var, GRUB_MOD_INIT(datetime) { - (void)mod; /* To stop warning. */ int i; for (i = 0; i < 7; i++) diff --git a/loader/xnu.c b/loader/xnu.c index d8af485c1..45696ee5f 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -1328,7 +1328,6 @@ static grub_command_t cmd_kernel, cmd_mkext, cmd_kext, cmd_kextdir, GRUB_MOD_INIT(xnu) { - (void) mod; /* To stop warning. */ cmd_kernel = grub_register_command ("xnu_kernel", grub_cmd_xnu_kernel, 0, "load a xnu kernel"); cmd_mkext = grub_register_command ("xnu_mkext", grub_cmd_xnu_mkext, 0, diff --git a/mmap/mmap.c b/mmap/mmap.c index 1d82db7f0..86df28b1d 100644 --- a/mmap/mmap.c +++ b/mmap/mmap.c @@ -413,7 +413,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(mmap) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("badram", grub_cmd_badram, "badram ADDR1,MASK1[,ADDR2,MASK2[,...]]", "declare memory regions as badram"); diff --git a/parttool/pcpart.c b/parttool/pcpart.c index a2b9452d9..8ada0ec25 100644 --- a/parttool/pcpart.c +++ b/parttool/pcpart.c @@ -140,8 +140,6 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, GRUB_MOD_INIT (pcpart) { - (void)mod; /* To stop warning. */ - activate_table_handle = grub_parttool_register ("pc_partition_map", grub_pcpart_boot, grub_pcpart_bootargs); diff --git a/script/sh/main.c b/script/sh/main.c index d4e342c71..4eefafa18 100644 --- a/script/sh/main.c +++ b/script/sh/main.c @@ -48,7 +48,6 @@ static struct grub_parser grub_sh_parser = GRUB_MOD_INIT(sh) { - (void) mod; grub_parser_register ("sh", &grub_sh_parser); } diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 757a06cb4..ec4d61506 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -607,7 +607,6 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(serial) { - (void) mod; /* To stop warning. */ cmd = grub_register_extcmd ("serial", grub_cmd_serial, GRUB_COMMAND_FLAG_BOTH, "serial [OPTIONS...]", diff --git a/term/terminfo.c b/term/terminfo.c index 45dcef7e0..f18be9ef0 100644 --- a/term/terminfo.c +++ b/term/terminfo.c @@ -177,7 +177,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(terminfo) { - (void) mod; /* To stop warning. */ cmd = grub_register_command ("terminfo", grub_cmd_terminfo, "terminfo [TERM]", "Set terminfo type."); grub_terminfo_set_current ("vt100"); diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index 50bbdd433..4a5d75bcf 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -244,8 +244,6 @@ static struct grub_term_input grub_usb_keyboard_term = GRUB_MOD_INIT(usb_keyboard) { - (void) mod; /* To stop warning. */ - grub_usb_hid (); grub_term_register_input ("usb_keyboard", &grub_usb_keyboard_term); } From 69f853f88406aab31d43524b6d951be7e5dcf436 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 4 May 2009 15:50:44 +0000 Subject: [PATCH 0710/1707] 2009-05-04 Vladimir Serbinenko HFS+ UUID * fs/hfsplus.c (grub_hfsplus_volheader): added num_serial field in the space previously used by unused3 (grub_hfsplus_uuid): new function (grub_hfsplus_fs): added uuid field --- ChangeLog | 9 +++++++++ fs/hfsplus.c | 34 +++++++++++++++++++++++++++++++++- 2 files changed, 42 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2f7d7908b..3fc1a66d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-05-04 Vladimir Serbinenko + + HFS+ UUID + + * fs/hfsplus.c (grub_hfsplus_volheader): added num_serial field + in the space previously used by unused3 + (grub_hfsplus_uuid): new function + (grub_hfsplus_fs): added uuid field + 2009-05-03 Pavel Roskin * disk/ata.c: Don't cast mod to void in GRUB_MOD_INIT to diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 82ec88044..6ca921860 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -61,7 +61,8 @@ struct grub_hfsplus_volheader grub_uint32_t utime; grub_uint8_t unused2[16]; grub_uint32_t blksize; - grub_uint8_t unused3[68]; + grub_uint8_t unused3[60]; + grub_uint64_t num_serial; struct grub_hfsplus_forkdata allocations_file; struct grub_hfsplus_forkdata extents_file; struct grub_hfsplus_forkdata catalog_file; @@ -983,6 +984,36 @@ grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm) } +static grub_err_t +grub_hfsplus_uuid (grub_device_t device, char **uuid) +{ + struct grub_hfsplus_data *data; + grub_disk_t disk = device->disk; + +#ifndef GRUB_UTIL + grub_dl_ref (my_mod); +#endif + + data = grub_hfsplus_mount (disk); + if (data) + { + *uuid = grub_malloc (16 + sizeof ('\0')); + grub_sprintf (*uuid, "%016llx", + (unsigned long long) + grub_be_to_cpu64 (data->volheader.num_serial)); + } + else + *uuid = NULL; + +#ifndef GRUB_UTIL + grub_dl_unref (my_mod); +#endif + + grub_free (data); + + return grub_errno; +} + static struct grub_fs grub_hfsplus_fs = @@ -994,6 +1025,7 @@ static struct grub_fs grub_hfsplus_fs = .close = grub_hfsplus_close, .label = grub_hfsplus_label, .mtime = grub_hfsplus_mtime, + .uuid = grub_hfsplus_uuid, .next = 0 }; From 6d260daab7242bcd5a731d18dda2a10b02a34257 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 4 May 2009 16:08:27 +0000 Subject: [PATCH 0711/1707] 2009-05-04 Vladimir Serbinenko Updated copyright year * fs/hfsplus.c: updated copyright year --- ChangeLog | 6 ++++++ fs/hfsplus.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3fc1a66d3..20056742a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-04 Vladimir Serbinenko + + Updated copyright year + + * fs/hfsplus.c: updated copyright year + 2009-05-04 Vladimir Serbinenko HFS+ UUID diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 6ca921860..0a7bedde7 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -1,7 +1,7 @@ /* hfsplus.c - HFS+ Filesystem. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From c149b500212dbbc8f2dd6e97c56408fea7becaa5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 May 2009 16:15:21 +0000 Subject: [PATCH 0712/1707] 2009-05-04 martin f. krafft * disk/raid.c (grub_raid_scan_device): Improve debug message. --- ChangeLog | 4 ++++ disk/raid.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 20056742a..a019f7c05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-04 martin f. krafft + + * disk/raid.c (grub_raid_scan_device): Improve debug message. + 2009-05-04 Vladimir Serbinenko Updated copyright year diff --git a/disk/raid.c b/disk/raid.c index 2b3130b20..8b026cde0 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -598,7 +598,7 @@ grub_raid_scan_device (int head_only) struct grub_raid_array array; struct grub_raid *p; - grub_dprintf ("raid", "Scanning for RAID devices\n"); + grub_dprintf ("raid", "Scanning for RAID devices on disk %s\n", name); disk = grub_disk_open (name); if (!disk) From ae0c0bdca9ebd65cbdaf80a1b5372d713fa838d2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 May 2009 16:16:03 +0000 Subject: [PATCH 0713/1707] 2009-05-04 Robert Millan * util/misc.c (grub_util_warn): New function. Emmits a warning unconditionally. * include/grub/util/misc.h (grub_util_warn): New declaration. * util/i386/pc/grub-install.in: Understand --force and pass it down to grub-setup. * util/i386/pc/grub-setup.c (main): Understand --force and pass it down to setup(). (setup): Improve error messages and add warnings when requested to install in odd layouts. Refuse to install using blocklists unless --force was set. --- ChangeLog | 15 +++++++++++ include/grub/util/misc.h | 1 + util/i386/pc/grub-install.in | 5 +++- util/i386/pc/grub-setup.c | 49 +++++++++++++++++++++++++----------- util/misc.c | 13 ++++++++++ 5 files changed, 68 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index a019f7c05..4d9396e13 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-05-04 Robert Millan + + * util/misc.c (grub_util_warn): New function. Emmits a warning + unconditionally. + * include/grub/util/misc.h (grub_util_warn): New declaration. + + * util/i386/pc/grub-install.in: Understand --force and pass it down + to grub-setup. + + * util/i386/pc/grub-setup.c (main): Understand --force and pass it + down to setup(). + (setup): Improve error messages and add warnings when requested to + install in odd layouts. Refuse to install using blocklists unless + --force was set. + 2009-05-04 martin f. krafft * disk/raid.c (grub_raid_scan_device): Improve debug message. diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h index 9eaef8837..af7cb2dbd 100644 --- a/include/grub/util/misc.h +++ b/include/grub/util/misc.h @@ -40,6 +40,7 @@ extern char *progname; extern int verbosity; extern jmp_buf main_env; +void grub_util_warn (const char *fmt, ...); void grub_util_info (const char *fmt, ...); void grub_util_error (const char *fmt, ...) __attribute__ ((noreturn)); diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index e4724f94e..1558bc19a 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -67,6 +67,7 @@ Install GRUB on your drive. --grub-probe=FILE use FILE as grub-probe --no-floppy do not probe any floppy drive --recheck probe a device map even if it already exists + --force install even if problems are detected INSTALL_DEVICE can be a GRUB device name or a system device filename. @@ -106,6 +107,8 @@ for option in "$@"; do # This is an undocumented feature... --debug) debug=yes ;; + -f | --force) + setup_force="--force" ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage @@ -297,7 +300,7 @@ if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then $grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 # Now perform the installation. - $grub_setup ${setup_verbose} --directory=${grubdir} --device-map=${device_map} \ + $grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \ ${install_device} || exit 1 else $grub_mkimage -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 1421297b8..2ac8af642 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -86,7 +86,7 @@ grub_refresh (void) static void setup (const char *dir, const char *boot_file, const char *core_file, - const char *root, const char *dest, int must_embed) + const char *root, const char *dest, int must_embed, int force) { char *boot_path, *core_path, *core_path_dev; char *boot_img, *core_img; @@ -109,7 +109,7 @@ setup (const char *dir, FILE *fp; struct { grub_uint64_t start; grub_uint64_t end; } embed_region; embed_region.start = embed_region.end = ~0UL; - int able_to_embed = 1; + int embedding_area_exists = 0; auto void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset, unsigned length); @@ -304,6 +304,12 @@ setup (const char *dir, grub_util_info ("dos partition is %d, bsd partition is %d", dos_part, bsd_part); + + if (! dest_dev->disk->has_partitions) + grub_util_warn ("Attempting to install GRUB to a partitionless disk. This is a BAD idea."); + + if (dest_dev->disk->partition) + grub_util_warn ("Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea."); /* If the destination device can have partitions and it is the MBR, try to embed the core image into after the MBR. */ @@ -311,6 +317,9 @@ setup (const char *dir, { grub_partition_iterate (dest_dev->disk, find_usable_region); + if (embed_region.end != 0) + embedding_area_exists = 1; + /* If there is enough space... */ if ((unsigned long) core_sectors <= embed_region.end - embed_region.start) { @@ -349,18 +358,24 @@ setup (const char *dir, goto finish; } - else - able_to_embed = 0; } - else - able_to_embed = 0; - if (must_embed && ! able_to_embed) - grub_util_error ("Core image is too big for embedding, but this is required when\n" + /* If we reached this point, it means we were unable to embed. */ + + if (embedding_area_exists) + grub_util_warn ("Embedding area is too small for core.img."); + else + grub_util_warn ("Embedding area is not present at all!"); + + if (must_embed) + grub_util_error ("Embedding is not possible, but this is required when " "the root device is on a RAID array or LVM volume."); - /* The core image must be put on a filesystem unfortunately. */ - grub_util_info ("will leave the core image on the filesystem"); + grub_util_warn ("Embedding is not possible. GRUB can only be installed in this " + "setup by using blocklists. However, blocklists are UNRELIABLE and " + "its use is discouraged."); + if (! force) + grub_util_error ("If you really want blocklists, use --force."); /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); @@ -510,6 +525,7 @@ static struct option options[] = {"directory", required_argument, 0, 'd'}, {"device-map", required_argument, 0, 'm'}, {"root-device", required_argument, 0, 'r'}, + {"force", no_argument, 0, 'f'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {"verbose", no_argument, 0, 'v'}, @@ -533,6 +549,7 @@ DEVICE must be a GRUB device (e.g. ``(hd0,1)'').\n\ -d, --directory=DIR use GRUB files in the directory DIR [default=%s]\n\ -m, --device-map=FILE use FILE as the device map [default=%s]\n\ -r, --root-device=DEV use DEV as the root device [default=guessed]\n\ + -f, --force install even if problems are detected\n\ -h, --help display this message and exit\n\ -V, --version print version information and exit\n\ -v, --verbose print verbose messages\n\ @@ -566,14 +583,14 @@ main (int argc, char *argv[]) char *dev_map = 0; char *root_dev = 0; char *dest_dev; - int must_embed = 0; + int must_embed = 0, force = 0; progname = "grub-setup"; /* Check for options. */ while (1) { - int c = getopt_long (argc, argv, "b:c:d:m:r:hVv", options, 0); + int c = getopt_long (argc, argv, "b:c:d:m:r:hVvf", options, 0); if (c == -1) break; @@ -615,6 +632,10 @@ main (int argc, char *argv[]) root_dev = xstrdup (optarg); break; + case 'f': + force = 1; + break; + case 'h': usage (0); break; @@ -716,7 +737,7 @@ main (int argc, char *argv[]) setup (dir ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, - root_dev, grub_util_get_grub_dev (devicelist[i]), 1); + root_dev, grub_util_get_grub_dev (devicelist[i]), 1, force); } } else @@ -725,7 +746,7 @@ main (int argc, char *argv[]) setup (dir ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, - root_dev, dest_dev, must_embed); + root_dev, dest_dev, must_embed, force); /* Free resources. */ grub_fini_all (); diff --git a/util/misc.c b/util/misc.c index bd162ee93..edfcc813a 100644 --- a/util/misc.c +++ b/util/misc.c @@ -51,6 +51,19 @@ char *progname = 0; int verbosity = 0; +void +grub_util_warn (const char *fmt, ...) +{ + va_list ap; + + fprintf (stderr, "%s: warn: ", progname); + va_start (ap, fmt); + vfprintf (stderr, fmt, ap); + va_end (ap); + fputc ('\n', stderr); + fflush (stderr); +} + void grub_util_info (const char *fmt, ...) { From afd5c1152756e8e1a5142a2a5983b409a23b0362 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 4 May 2009 17:49:57 +0000 Subject: [PATCH 0714/1707] 2009-05-04 Felix Zielcke * conf/i386-efi.rmk (grub_emu_SOURCES): Remove `normal/execute.c', `normal/lexer.c', `kern/rescue.c', `normal/function.c', `normal/misc.c' and `normal/script.c'. Add `kern/rescue_reader.c', `kern/rescue_parser.c', `script/sh/main.c', `script/sh/execute.c', `script/sh/function.c', `script/sh/lexer.c', `script/sh/script.c' and `grub_script.tab.c'. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. --- ChangeLog | 15 +++++++++++++++ conf/i386-coreboot.rmk | 17 +++++++++-------- conf/i386-efi.rmk | 13 +++++++------ conf/i386-ieee1275.rmk | 15 ++++++++------- conf/powerpc-ieee1275.rmk | 15 ++++++++------- conf/sparc64-ieee1275.rmk | 12 +++++++----- conf/x86_64-efi.rmk | 12 ++++++------ 7 files changed, 60 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4d9396e13..d4eebfe58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-05-04 Felix Zielcke + + * conf/i386-efi.rmk (grub_emu_SOURCES): Remove `normal/execute.c', + `normal/lexer.c', `kern/rescue.c', `normal/function.c', `normal/misc.c' + and `normal/script.c'. Add `kern/rescue_reader.c', + `kern/rescue_parser.c', `script/sh/main.c', `script/sh/execute.c', + `script/sh/function.c', `script/sh/lexer.c', `script/sh/script.c' and + `grub_script.tab.c'. + + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + 2009-05-04 Robert Millan * util/misc.c (grub_util_warn): New function. Emmits a warning diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index f000328ab..1f212346b 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -73,17 +73,18 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ - normal/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ + kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ + kern/partition.c kern/reader.c kern/term.c \ + kern/rescue_reader.c kern/rescue_parser.c \ + lib/arg.c normal/cmdline.c normal/misc.c \ + normal/handler.c normal/autofs.c \ normal/completion.c normal/datetime.c normal/main.c \ - normal/menu_text.c \ + normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/misc.c normal/script.c \ normal/color.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c grub_script.tab.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index c698d3ef5..16ccea679 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -49,17 +49,18 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ + kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ + kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ + kern/partition.c kern/reader.c kern/term.c \ + kern/rescue_reader.c kern/rescue_parser.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c \ + normal/autofs.c \ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ - normal/misc.c normal/script.c \ normal/color.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c grub_script.tab.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 804676b12..b195f16d6 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -73,16 +73,17 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/function.c normal/handler.c \ + kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ + kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ + kern/partition.c kern/reader.c kern/term.c \ + kern/rescue_reader.c kern/rescue_parser.c \ + lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \ + normal/handler.c normal/autofs.c \ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ - normal/misc.c normal/script.c \ normal/color.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c grub_script.tab.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 911adc6fb..53bffa6de 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -55,17 +55,18 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \ - kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ + kern/misc.c kern/parser.c kern/partition.c kern/reader.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/completion.c normal/execute.c \ - normal/function.c normal/handler.c normal/lexer.c normal/main.c \ - normal/menu.c \ + lib/arg.c normal/cmdline.c normal/datetime.c \ + normal/completion.c normal/misc.c \ + normal/handler.c normal/main.c \ + normal/menu.c \ normal/menu_text.c \ - normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ - normal/script.c \ + normal/menu_entry.c normal/menu_viewer.c \ normal/color.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index c11442abc..158b9e673 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -112,16 +112,18 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ - kern/misc.c kern/parser.c kern/partition.c kern/rescue.c \ + kern/misc.c kern/parser.c kern/partition.c kern/reader.c \ + kern/rescue_reader.c kern/rescue_parser.c kern/term.c fs/fshelp.c \ kern/list.c kern/handler.c \ - lib/arg.c normal/cmdline.c normal/command.c \ - normal/completion.c normal/execute.c \ - normal/function.c normal/lexer.c normal/main.c normal/menu.c \ + lib/arg.c normal/cmdline.c \ + normal/completion.c \ + normal/main.c normal/menu.c \ normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ - normal/script.c \ normal/color.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 8cdfa8a7b..92ad9f7d4 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -47,17 +47,17 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/list.c kern/handler.c \ - kern/command.c kern/corecmd.c commands/extcmd.c \ - normal/execute.c kern/file.c kern/fs.c normal/lexer.c \ - commands/boot.c kern/main.c kern/misc.c kern/parser.c \ - grub_script.tab.c kern/partition.c kern/rescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/command.c normal/function.c\ + kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ + kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ + kern/partition.c kern/readerescue.c kern/term.c \ + lib/arg.c normal/cmdline.c normal/misc.c normal/autofs.c \ normal/completion.c normal/datetime.c normal/context.c \ normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ - normal/misc.c normal/script.c \ normal/color.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c grub_script.tab.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ From faa517ce503a3571305e566dc8d5afceedcc44bb Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 4 May 2009 17:57:31 +0000 Subject: [PATCH 0715/1707] * Makefile.in: Remove duplicated 2008 in Copyright line. --- ChangeLog | 2 ++ Makefile.in | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d4eebfe58..ed509b32b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,6 +13,8 @@ * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * Makefile.in: Remove duplicated 2008 in Copyright line. + 2009-05-04 Robert Millan * util/misc.c (grub_util_warn): New function. Emmits a warning diff --git a/Makefile.in b/Makefile.in index 109aab928..5e3d74461 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,6 +1,6 @@ # -*- makefile -*- # -# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009,2008 Free Software Foundation, Inc. +# Copyright (C) 1994,1995,1996,1997,1998,1999,2000,2001,2002,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. # # This Makefile.in is free software; the author # gives unlimited permission to copy and/or distribute it, From 112972a96d916d6070188aa16d6c9d211f4e4bce Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 May 2009 18:04:09 +0000 Subject: [PATCH 0716/1707] 2009-05-04 Robert Millan * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT): New macro. (grub_linux_boot): Don't check for `linux_vesafb_modes' bounds (this is done by grub_cmd_linux() now). [! GRUB_ASSUME_LINUX_HAS_FB_SUPPORT]: If "vga=" parameter wasn't set, restore video to text mode. (grub_cmd_linux): Default `vid_mode' initialization to 0, which indicates lack of "vga=" parameter. "vga=0" is mapped to `GRUB_LINUX_VID_MODE_NORMAL'. --- ChangeLog | 11 +++++++++++ loader/i386/linux.c | 36 ++++++++++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed509b32b..af6a735ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-05-04 Robert Millan + + * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT): New macro. + (grub_linux_boot): Don't check for `linux_vesafb_modes' bounds (this + is done by grub_cmd_linux() now). + [! GRUB_ASSUME_LINUX_HAS_FB_SUPPORT]: If "vga=" parameter wasn't set, + restore video to text mode. + (grub_cmd_linux): Default `vid_mode' initialization to 0, which + indicates lack of "vga=" parameter. "vga=0" is mapped to + `GRUB_LINUX_VID_MODE_NORMAL'. + 2009-05-04 Felix Zielcke * conf/i386-efi.rmk (grub_emu_SOURCES): Remove `normal/execute.c', diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 02bade58c..ab3b43e27 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -39,6 +39,14 @@ #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 +/* This macro is useful for distributors, who can be certain they built FB support + into Linux, and therefore can benefit from seamless mode transition between + GRUB and Linux (saving boot time and visual glitches). Official GRUB, OTOH, + needs to be conservative. */ +#ifndef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT +#define GRUB_ASSUME_LINUX_HAS_FB_SUPPORT 0 +#endif + static grub_dl_t my_mod; static grub_size_t linux_mem_size; @@ -332,9 +340,7 @@ grub_linux_boot (void) params = real_mode_mem; - if (vid_mode < GRUB_LINUX_VID_MODE_VESA_START || - vid_mode >= GRUB_LINUX_VID_MODE_VESA_START + - ARRAY_SIZE (linux_vesafb_modes)) + if (vid_mode == GRUB_LINUX_VID_MODE_NORMAL || vid_mode == GRUB_LINUX_VID_MODE_EXTENDED) grub_video_restore (); else if (vid_mode) { @@ -367,6 +373,12 @@ grub_linux_boot (void) return grub_errno; } } +#if ! GRUB_ASSUME_LINUX_HAS_FB_SUPPORT + else + /* If user didn't request a video mode, and we can't assume Linux supports FB, + then we go back to text mode. */ + grub_video_restore (); +#endif if (! grub_linux_setup_video (params)) params->have_vga = GRUB_VIDEO_TYPE_VLFB; @@ -593,7 +605,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), (unsigned) real_size, (unsigned) prot_size); /* Look for memory size and video mode specified on the command line. */ - vid_mode = GRUB_LINUX_VID_MODE_NORMAL; + vid_mode = 0; linux_mem_size = 0; for (i = 1; i < argc; i++) if (grub_memcmp (argv[i], "vga=", 4) == 0) @@ -618,6 +630,22 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), else vid_mode = (grub_uint16_t) grub_strtoul (val, 0, 0); + switch (vid_mode) + { + case 0: + vid_mode = GRUB_LINUX_VID_MODE_NORMAL; + break; + case 1: + vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; + break; + default: + /* Ignore invalid values. */ + if (vid_mode < GRUB_LINUX_VID_MODE_VESA_START || + vid_mode >= GRUB_LINUX_VID_MODE_VESA_START + + ARRAY_SIZE (linux_vesafb_modes)) + vid_mode = 0; + } + if (grub_errno) goto fail; } From ecc3eb22ee64b21ff9d43bf65d240d69b3eb5f3e Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 4 May 2009 18:06:37 +0000 Subject: [PATCH 0717/1707] 2009-05-04 Vladimir Serbinenko Removed wrong semicolon in declaration * grub/misc.h (grub_dprintf): remove semicolon --- ChangeLog | 6 ++++++ include/grub/misc.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index af6a735ee..963c84ce2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-04 Vladimir Serbinenko + + Removed wrong semicolon in declaration + + * grub/misc.h (grub_dprintf): remove semicolon + 2009-05-04 Robert Millan * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT): New macro. diff --git a/include/grub/misc.h b/include/grub/misc.h index 3490db0d5..5c8baa1aa 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -28,7 +28,7 @@ #define ALIGN_UP(addr, align) (((grub_uint64_t)addr + align - 1) & ~(align - 1)) #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) -#define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args); +#define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args) /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */ #define grub_memcpy(d,s,n) grub_memmove ((d), (s), (n)) From b01f05482b5e6050a4ab662a0907fd148eab02cd Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 May 2009 18:40:33 +0000 Subject: [PATCH 0718/1707] 2009-05-04 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Make "vga=" compatibility parameter only available on BIOS. --- ChangeLog | 5 +++++ loader/i386/linux.c | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 963c84ce2..ef10ba69e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-04 Robert Millan + + * loader/i386/linux.c (grub_cmd_linux): Make "vga=" compatibility + parameter only available on BIOS. + 2009-05-04 Vladimir Serbinenko Removed wrong semicolon in declaration diff --git a/loader/i386/linux.c b/loader/i386/linux.c index ab3b43e27..3275bc6e2 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -608,6 +608,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), vid_mode = 0; linux_mem_size = 0; for (i = 1; i < argc; i++) +#ifdef GRUB_MACHINE_PCBIOS if (grub_memcmp (argv[i], "vga=", 4) == 0) { /* Video mode selection support. */ @@ -649,6 +650,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (grub_errno) goto fail; } +#endif /* GRUB_MACHINE_PCBIOS */ else if (grub_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; From 7c1d00cdc4fbdcc554ec1a383f34ece23123a65d Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 May 2009 18:59:12 +0000 Subject: [PATCH 0719/1707] 2009-05-04 Robert Millan * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (grub_cmd_linux): Fix build error. --- ChangeLog | 5 +++++ loader/i386/linux.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ef10ba69e..961756e6d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-04 Robert Millan + + * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (grub_cmd_linux): Fix + build error. + 2009-05-04 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Make "vga=" compatibility diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 3275bc6e2..1a237108b 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -650,8 +650,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (grub_errno) goto fail; } + else #endif /* GRUB_MACHINE_PCBIOS */ - else if (grub_memcmp (argv[i], "mem=", 4) == 0) + if (grub_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; From 0cfc0083de8c7518ff13c95354d1451624af8011 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 4 May 2009 19:38:12 +0000 Subject: [PATCH 0720/1707] 2009-05-04 Felix Zielcke * conf/i386-pc.rmk (libpkg_DATA): Rename to pkglib_DATA. --- ChangeLog | 4 ++++ conf/i386-pc.rmk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 961756e6d..f3c8e1bee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-04 Felix Zielcke + + * conf/i386-pc.rmk (libpkg_DATA): Rename to pkglib_DATA. + 2009-05-04 Robert Millan * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (grub_cmd_linux): Fix diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 6c9100f16..046218cab 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -402,7 +402,7 @@ efiemu64.o: efiemu64_c.o efiemu64_s.o ld -melf_x86_64 -o $@ -r $^ -nostdlib CLEANFILES += efiemu32.o efiemu64.o efiemu64_c.o efiemu64_s.o -lib_DATA += efiemu32.o efiemu64.o +pkglib_DATA += efiemu32.o efiemu64.o endif From 4241d2b13aed8c0b7522862046ad2d3293137e48 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 4 May 2009 20:06:05 +0000 Subject: [PATCH 0721/1707] 2009-05-04 Pavel Roskin * disk/ata.c: Spelling fixes. * disk/raid.c: Likewise. * disk/usbms.c: Likewise. * disk/dmraid_nvidia.c: Likewise. * kern/ieee1275/openfw.c: Likewise. * kern/ieee1275/init.c: Likewise. * kern/ieee1275/cmain.c: Likewise. * boot/i386/pc/cdboot.S: Likewise. * video/readers/png.c: Likewise. * video/i386/pc/vbe.c: Likewise. * fs/udf.c: Likewise. * fs/hfs.c: Likewise. * fs/reiserfs.c: Likewise. * efiemu/runtime/efiemu.c: Likewise. * efiemu/main.c: Likewise. * efiemu/mm.c: Likewise. * include/grub/elf.h: Likewise. * include/grub/xnu.h: Likewise. * include/grub/usbdesc.h: Likewise. * include/grub/usb.h: Likewise. * include/grub/script_sh.h: Likewise. * include/grub/lib/LzmaEnc.h: Likewise. * include/grub/efiemu/efiemu.h: Likewise. * include/grub/command.h: Likewise. * normal/menu.c: Likewise. * normal/main.c: Likewise. * normal/datetime.c: Likewise. * bus/usb/uhci.c: Likewise. * mmap/i386/uppermem.c: Likewise. * mmap/mmap.c: Likewise. * commands/acpi.c: Likewise. * commands/test.c: Likewise. * partmap/apple.c: Likewise. * font/font.c: Likewise. * loader/sparc64/ieee1275/linux.c: Likewise. * loader/macho.c: Likewise. * loader/i386/bsd_trampoline.S: Likewise. * loader/i386/bsd.c: Likewise. * loader/xnu.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * term/usb_keyboard.c: Likewise. * util/resolve.c: Likewise. * util/getroot.c: Likewise. --- ChangeLog | 46 +++++++++++++++++++++++++++++++++ boot/i386/pc/cdboot.S | 2 +- bus/usb/uhci.c | 20 +++++++------- commands/acpi.c | 8 +++--- commands/test.c | 2 +- disk/ata.c | 4 +-- disk/dmraid_nvidia.c | 2 +- disk/raid.c | 2 +- disk/usbms.c | 10 +++---- efiemu/main.c | 2 +- efiemu/mm.c | 4 +-- efiemu/runtime/efiemu.c | 4 +-- font/font.c | 2 +- fs/hfs.c | 4 +-- fs/reiserfs.c | 2 +- fs/udf.c | 2 +- include/grub/command.h | 2 +- include/grub/efiemu/efiemu.h | 2 +- include/grub/elf.h | 16 ++++++------ include/grub/lib/LzmaEnc.h | 4 +-- include/grub/script_sh.h | 2 +- include/grub/usb.h | 2 +- include/grub/usbdesc.h | 2 +- include/grub/xnu.h | 2 +- kern/ieee1275/cmain.c | 2 +- kern/ieee1275/init.c | 2 +- kern/ieee1275/openfw.c | 2 +- loader/i386/bsd.c | 2 +- loader/i386/bsd_trampoline.S | 2 +- loader/macho.c | 4 +-- loader/sparc64/ieee1275/linux.c | 4 +-- loader/xnu.c | 4 +-- mmap/i386/uppermem.c | 2 +- mmap/mmap.c | 2 +- normal/datetime.c | 6 ++--- normal/main.c | 4 +-- normal/menu.c | 2 +- partmap/apple.c | 2 +- term/i386/pc/vesafb.c | 2 +- term/usb_keyboard.c | 2 +- util/getroot.c | 2 +- util/resolve.c | 4 +-- video/i386/pc/vbe.c | 4 +-- video/readers/png.c | 12 ++++----- 44 files changed, 130 insertions(+), 84 deletions(-) diff --git a/ChangeLog b/ChangeLog index f3c8e1bee..c6c5ca242 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,49 @@ +2009-05-04 Pavel Roskin + + * disk/ata.c: Spelling fixes. + * disk/raid.c: Likewise. + * disk/usbms.c: Likewise. + * disk/dmraid_nvidia.c: Likewise. + * kern/ieee1275/openfw.c: Likewise. + * kern/ieee1275/init.c: Likewise. + * kern/ieee1275/cmain.c: Likewise. + * boot/i386/pc/cdboot.S: Likewise. + * video/readers/png.c: Likewise. + * video/i386/pc/vbe.c: Likewise. + * fs/udf.c: Likewise. + * fs/hfs.c: Likewise. + * fs/reiserfs.c: Likewise. + * efiemu/runtime/efiemu.c: Likewise. + * efiemu/main.c: Likewise. + * efiemu/mm.c: Likewise. + * include/grub/elf.h: Likewise. + * include/grub/xnu.h: Likewise. + * include/grub/usbdesc.h: Likewise. + * include/grub/usb.h: Likewise. + * include/grub/script_sh.h: Likewise. + * include/grub/lib/LzmaEnc.h: Likewise. + * include/grub/efiemu/efiemu.h: Likewise. + * include/grub/command.h: Likewise. + * normal/menu.c: Likewise. + * normal/main.c: Likewise. + * normal/datetime.c: Likewise. + * bus/usb/uhci.c: Likewise. + * mmap/i386/uppermem.c: Likewise. + * mmap/mmap.c: Likewise. + * commands/acpi.c: Likewise. + * commands/test.c: Likewise. + * partmap/apple.c: Likewise. + * font/font.c: Likewise. + * loader/sparc64/ieee1275/linux.c: Likewise. + * loader/macho.c: Likewise. + * loader/i386/bsd_trampoline.S: Likewise. + * loader/i386/bsd.c: Likewise. + * loader/xnu.c: Likewise. + * term/i386/pc/vesafb.c: Likewise. + * term/usb_keyboard.c: Likewise. + * util/resolve.c: Likewise. + * util/getroot.c: Likewise. + 2009-05-04 Felix Zielcke * conf/i386-pc.rmk (libpkg_DATA): Rename to pkglib_DATA. diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S index 02d4fce38..133f8dee5 100644 --- a/boot/i386/pc/cdboot.S +++ b/boot/i386/pc/cdboot.S @@ -46,7 +46,7 @@ next: . = start + 8 bi_pvd: - .long 0 /* LBA of primary volume descript. */ + .long 0 /* LBA of primary volume descriptor. */ bi_file: .long 0 /* LBA of boot file. */ bi_length: diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index 8406aed28..090934998 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -56,7 +56,7 @@ struct grub_uhci_qh grub_uint8_t pad[8]; } __attribute__ ((packed)); -/* UHCI Tranfer Descriptor. */ +/* UHCI Transfer Descriptor. */ struct grub_uhci_td { /* Pointer to the next TD in the list. */ @@ -248,7 +248,7 @@ grub_uhci_pci_iter (int bus, int device, int func, grub_uhci_writereg32 (u, GRUB_UHCI_REG_FLBASEADD, (grub_uint32_t) u->framelist); - /* Make the Queue Heads point to eachother. */ + /* Make the Queue Heads point to each other. */ for (i = 0; i < 256; i++) { /* Point to the next QH. */ @@ -482,7 +482,7 @@ grub_uhci_transfer (grub_usb_controller_t dev, grub_dprintf ("uhci", "initiate transaction\n"); /* Wait until either the transaction completed or an error - occured. */ + occurred. */ for (;;) { grub_uhci_td_t errtd; @@ -507,30 +507,30 @@ grub_uhci_transfer (grub_usb_controller_t dev, if (errtd->ctrl_status & (1 << 22)) err = GRUB_USB_ERR_STALL; - /* Check if an error related to the data buffer occured. */ + /* Check if an error related to the data buffer occurred. */ if (errtd->ctrl_status & (1 << 21)) err = GRUB_USB_ERR_DATA; - /* Check if a babble error occured. */ + /* Check if a babble error occurred. */ if (errtd->ctrl_status & (1 << 20)) err = GRUB_USB_ERR_BABBLE; - /* Check if a NAK occured. */ + /* Check if a NAK occurred. */ if (errtd->ctrl_status & (1 << 19)) err = GRUB_USB_ERR_NAK; - /* Check if a timeout occured. */ + /* Check if a timeout occurred. */ if (errtd->ctrl_status & (1 << 18)) err = GRUB_USB_ERR_TIMEOUT; - /* Check if a bitstuff error occured. */ + /* Check if a bitstuff error occurred. */ if (errtd->ctrl_status & (1 << 17)) err = GRUB_USB_ERR_BITSTUFF; if (err) goto fail; - /* Fall through, no errors occured, so the QH might be + /* Fall through, no errors occurred, so the QH might be updated. */ grub_dprintf ("uhci", "transaction fallthrough\n"); } @@ -660,7 +660,7 @@ GRUB_MOD_INIT(uhci) { grub_uhci_inithw (); grub_usb_controller_dev_register (&usb_controller); - grub_dprintf ("uhci", "registed\n"); + grub_dprintf ("uhci", "registered\n"); } GRUB_MOD_FINI(uhci) diff --git a/commands/acpi.c b/commands/acpi.c index 3521c4c54..7b53343a6 100644 --- a/commands/acpi.c +++ b/commands/acpi.c @@ -53,7 +53,7 @@ static const struct grub_arg_option options[] = { {"oemtablecreatorrev", 'd', 0, "Set creator revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT}, {"no-ebda", 'e', 0, "Don't update EBDA. May fix failures or hangs on some" - " BIOSes but makes it uneffective with OS not recieving RSDP fro GRUB", + " BIOSes but makes it ineffective with OS not receiving RSDP from GRUB", 0, ARG_TYPE_NONE}, {0, 0, 0, 0, 0, 0} }; @@ -186,7 +186,7 @@ grub_acpi_create_ebda (void) if (! mmapregion) return grub_errno; - /* XXX: EBDA is unstandartised, so this implementation is heuristical. */ + /* XXX: EBDA is unstandardized, so this implementation is heuristical. */ if (ebda_kb_len) grub_memcpy (targetebda, ebda, 0x400); else @@ -503,7 +503,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, *ptr = grub_tolower (*ptr); } - /* Set revision variables to replicant the same version as host. */ + /* Set revision variables to replicate the same version as host. */ rev1 = ! rsdp->revision; rev2 = rsdp->revision; rsdt = (struct grub_acpi_table_header *) UINT_TO_PTR (rsdp->rsdt_addr); @@ -558,7 +558,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, grub_memcpy (table_dsdt, dsdt, dsdt->length); } - /* Save FACS address. FACS shouldn't be overriden. */ + /* Save FACS address. FACS shouldn't be overridden. */ facs_addr = fadt->facs_addr; } diff --git a/commands/test.c b/commands/test.c index 68b5efede..bbeeed0e8 100644 --- a/commands/test.c +++ b/commands/test.c @@ -35,7 +35,7 @@ grub_strtosl (char *arg, char **end, int base) return grub_strtoul (arg, end, base); } -/* Parse a test expression startion from *argn. */ +/* Parse a test expression starting from *argn. */ static int test_parse (char **args, int *argn, int argc) { diff --git a/disk/ata.c b/disk/ata.c index 812537ebe..ea42d5951 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -439,7 +439,7 @@ grub_ata_pciinit (int bus, int device, int func, grub_errno = GRUB_ERR_NONE; grub_ata_device_initialize (controller * 2 + i, 0, rega, regb); - /* Most errors rised by grub_ata_device_initialize() are harmless. + /* Most errors raised by grub_ata_device_initialize() are harmless. They just indicate this particular drive is not responding, most likely because it doesn't exist. We might want to ignore specific error types here, instead of printing them. */ @@ -586,7 +586,7 @@ grub_ata_readwrite (grub_disk_t disk, grub_disk_addr_t sector, grub_dprintf("ata", "rw=%d, sector=%llu, batch=%u\n", rw, sector, batch); - /* Send read/write commmand. */ + /* Send read/write command. */ if (grub_ata_setaddress (dev, addressing, sector, batch)) return grub_errno; diff --git a/disk/dmraid_nvidia.c b/disk/dmraid_nvidia.c index ee43bef54..119465109 100644 --- a/disk/dmraid_nvidia.c +++ b/disk/dmraid_nvidia.c @@ -42,7 +42,7 @@ #define NV_LEVEL_1_0 0x8180 #define NV_ARRAY_FLAG_BOOT 1 /* BIOS use only. */ -#define NV_ARRAY_FLAG_ERROR 2 /* Degraded or offling. */ +#define NV_ARRAY_FLAG_ERROR 2 /* Degraded or offline. */ #define NV_ARRAY_FLAG_PARITY_VALID 4 /* RAID-3/5 parity valid. */ struct grub_nv_array diff --git a/disk/raid.c b/disk/raid.c index 8b026cde0..5cb412bf9 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -573,7 +573,7 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array, array->next = array_list; array_list = array; - /* RAID 1 doestn't use a chunksize but code assumes one so set + /* RAID 1 doesn't use a chunksize but code assumes one so set one. */ if (array->level == 1) array->chunk_size = 64; diff --git a/disk/usbms.c b/disk/usbms.c index d08256b65..67e6ba25f 100644 --- a/disk/usbms.c +++ b/disk/usbms.c @@ -179,7 +179,7 @@ grub_usbms_finddevs (void) /* XXX: Activate the first configuration. */ grub_usb_set_configuration (usbdev, 1); - /* Bolk-Only Mass Storage Reset, after the reset commands + /* Bulk-Only Mass Storage Reset, after the reset commands will be accepted. */ grub_usbms_reset (usbdev, i); @@ -214,8 +214,8 @@ grub_usbms_iterate (int (*hook) (const char *name, int luns)) } static grub_err_t -grub_usbms_tranfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, - grub_size_t size, char *buf, int read_write) +grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, + grub_size_t size, char *buf, int read_write) { struct grub_usbms_cbw cbw; grub_usbms_dev_t dev = (grub_usbms_dev_t) scsi->data; @@ -322,14 +322,14 @@ static grub_err_t grub_usbms_read (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, grub_size_t size, char *buf) { - return grub_usbms_tranfer (scsi, cmdsize, cmd, size, buf, 0); + return grub_usbms_transfer (scsi, cmdsize, cmd, size, buf, 0); } static grub_err_t grub_usbms_write (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, grub_size_t size, char *buf) { - return grub_usbms_tranfer (scsi, cmdsize, cmd, size, buf, 1); + return grub_usbms_transfer (scsi, cmdsize, cmd, size, buf, 1); } static grub_err_t diff --git a/efiemu/main.c b/efiemu/main.c index e11d7c3f9..da5733647 100644 --- a/efiemu/main.c +++ b/efiemu/main.c @@ -214,7 +214,7 @@ grub_efiemu_load_file (const char *filename) return grub_error (grub_errno, "Couldn't init memory management"); } - grub_dprintf ("efiemu", "mm inited\n"); + grub_dprintf ("efiemu", "mm initialized\n"); err = grub_efiemu_loadcore_init (file); if (err) diff --git a/efiemu/mm.c b/efiemu/mm.c index e0364e699..e7dcf399e 100644 --- a/efiemu/mm.c +++ b/efiemu/mm.c @@ -18,7 +18,7 @@ */ /* To keep efiemu runtime contiguous this mm is special. - It uses deffered allocation. + It uses deferred allocation. In the first stage you may request memory with grub_efiemu_request_memalign It will give you a handle with which in the second phase you can access your memory with grub_efiemu_mm_obtain_request (handle). It's guaranteed that @@ -624,7 +624,7 @@ grub_efiemu_mm_do_alloc (void) if (!efiemu_mmap) { grub_efiemu_unload (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't initilaize mmap"); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't initialize mmap"); } if ((err = efiemu_alloc_requests ())) diff --git a/efiemu/runtime/efiemu.c b/efiemu/runtime/efiemu.c index 81fb56284..5887c48ab 100644 --- a/efiemu/runtime/efiemu.c +++ b/efiemu/runtime/efiemu.c @@ -116,7 +116,7 @@ extern grub_int16_t efiemu_time_zone; extern grub_uint8_t efiemu_time_daylight; extern grub_uint32_t efiemu_time_accuracy; -/* Some standard functions because we need to be stadalone */ +/* Some standard functions because we need to be standalone */ static void efiemu_memcpy (void *to, void *from, int count) { @@ -251,7 +251,7 @@ EFI_FUNC (efiemu_set_time) (grub_efi_time_t *time) return GRUB_EFI_SUCCESS; } -/* Folowing 2 functions are vendor specific. So announce it as unsupported */ +/* Following 2 functions are vendor specific. So announce it as unsupported */ grub_efi_status_t EFI_FUNC (efiemu_get_wakeup_time) (grub_efi_boolean_t *enabled, grub_efi_boolean_t *pending, diff --git a/font/font.c b/font/font.c index cfe1ee462..39d61126e 100644 --- a/font/font.c +++ b/font/font.c @@ -186,7 +186,7 @@ font_init (grub_font_t font) On success, the section name is stored in section->name and the length in section->length, and 0 is returned. On failure, 1 is returned and - grub_errno is set approriately with an error message. + grub_errno is set appropriately with an error message. If 1 is returned due to being at the end of the file, then section->eof is set to 1; otherwise, section->eof is set to 0. */ diff --git a/fs/hfs.c b/fs/hfs.c index 283c6bc0f..ef318d481 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -124,7 +124,7 @@ struct grub_hfs_extent_key grub_uint16_t first_block; } __attribute__ ((packed)); -/* A dirrect record. This is used to find out the directory ID. */ +/* A directory record. This is used to find out the directory ID. */ struct grub_hfs_dirrec { /* For a directory, type == 1. */ @@ -744,7 +744,7 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, else cmp = grub_hfs_cmp_extkeys (rec->key, (void *) key); - /* If the key is smaller or equal to the currect node, mark the + /* If the key is smaller or equal to the current node, mark the entry. In case of a non-leaf mode it will be used to lookup the rest of the tree. */ if (cmp <= 0) diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 433e89b01..16a9e0483 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -809,7 +809,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, grub_uint32_t entry_block_number; /* Order is very important here. First set the offset to 0 using current key version. - Then change the key type, which influes on key version + Then change the key type, which affects key version detection. */ grub_reiserfs_set_key_offset (&entry_key, 0); grub_reiserfs_set_key_type (&entry_key, GRUB_REISERFS_STAT, diff --git a/fs/udf.c b/fs/udf.c index abe992e0c..bbad458fc 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -570,7 +570,7 @@ grub_udf_mount (grub_disk_t disk) } data->npd = data->npm = 0; - /* Locate Partiton Descriptor (PD) and Logical Volume Descriptor (LVD). */ + /* Locate Partition Descriptor (PD) and Logical Volume Descriptor (LVD). */ while (1) { struct grub_udf_tag tag; diff --git a/include/grub/command.h b/include/grub/command.h index a391cf2a9..6e9942b60 100644 --- a/include/grub/command.h +++ b/include/grub/command.h @@ -67,7 +67,7 @@ struct grub_command /* The description of the command. */ const char *description; - /* Arbitary data. */ + /* Arbitrary data. */ void *data; }; typedef struct grub_command *grub_command_t; diff --git a/include/grub/efiemu/efiemu.h b/include/grub/efiemu/efiemu.h index 1515a67df..78373e4e1 100644 --- a/include/grub/efiemu/efiemu.h +++ b/include/grub/efiemu/efiemu.h @@ -99,7 +99,7 @@ typedef struct grub_efiemu_runtime_services64 grub_efiemu_runtime_services64_t; extern grub_efi_system_table32_t *grub_efiemu_system_table32; extern grub_efi_system_table64_t *grub_efiemu_system_table64; -/* Convenience macroses to access currently loaded efiemu */ +/* Convenience macros to access currently loaded efiemu */ #define grub_efiemu_system_table ((grub_efiemu_sizeof_uintn_t () == 8) \ ? (void *) grub_efiemu_system_table64 \ : (void *) grub_efiemu_system_table32) diff --git a/include/grub/elf.h b/include/grub/elf.h index 5d46daa0c..319bc7ce6 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -206,18 +206,18 @@ typedef struct #define EM_68HC12 53 /* Motorola M68HC12 */ #define EM_MMA 54 /* Fujitsu MMA Multimedia Accelerator*/ #define EM_PCP 55 /* Siemens PCP */ -#define EM_NCPU 56 /* Sony nCPU embeeded RISC */ +#define EM_NCPU 56 /* Sony nCPU embedded RISC */ #define EM_NDR1 57 /* Denso NDR1 microprocessor */ #define EM_STARCORE 58 /* Motorola Start*Core processor */ #define EM_ME16 59 /* Toyota ME16 processor */ -#define EM_ST100 60 /* STMicroelectronic ST100 processor */ +#define EM_ST100 60 /* STMicroelectronics ST100 processor */ #define EM_TINYJ 61 /* Advanced Logic Corp. Tinyj emb.fam*/ #define EM_X86_64 62 /* AMD x86-64 architecture */ #define EM_PDSP 63 /* Sony DSP Processor */ #define EM_FX66 66 /* Siemens FX66 microcontroller */ #define EM_ST9PLUS 67 /* STMicroelectronics ST9+ 8/16 mc */ -#define EM_ST7 68 /* STmicroelectronics ST7 8 bit mc */ +#define EM_ST7 68 /* STMicroelectronics ST7 8 bit mc */ #define EM_68HC16 69 /* Motorola MC68HC16 microcontroller */ #define EM_68HC11 70 /* Motorola MC68HC11 microcontroller */ #define EM_68HC08 71 /* Motorola MC68HC08 microcontroller */ @@ -319,7 +319,7 @@ typedef struct #define SHT_FINI_ARRAY 15 /* Array of destructors */ #define SHT_PREINIT_ARRAY 16 /* Array of pre-constructors */ #define SHT_GROUP 17 /* Section group */ -#define SHT_SYMTAB_SHNDX 18 /* Extended section indeces */ +#define SHT_SYMTAB_SHNDX 18 /* Extended section indices */ #define SHT_NUM 19 /* Number of defined types. */ #define SHT_LOOS 0x60000000 /* Start OS-specific */ #define SHT_GNU_LIBLIST 0x6ffffff7 /* Prelink library list */ @@ -1191,7 +1191,7 @@ typedef struct #define R_SPARC_LM22 36 /* Low middle 22 bits of ... */ #define R_SPARC_PC_HH22 37 /* Top 22 bits of pc rel 64 bit */ #define R_SPARC_PC_HM10 38 /* High middle 10 bit of ... */ -#define R_SPARC_PC_LM22 39 /* Low miggle 22 bits of ... */ +#define R_SPARC_PC_LM22 39 /* Low middle 22 bits of ... */ #define R_SPARC_WDISP16 40 /* PC relative 16 bit shifted */ #define R_SPARC_WDISP19 41 /* PC relative 19 bit shifted */ #define R_SPARC_7 43 /* Direct 7 bit */ @@ -1625,9 +1625,9 @@ typedef Elf32_Addr Elf32_Conflict; #define EFA_PARISC_1_1 0x0210 /* PA-RISC 1.1 big-endian. */ #define EFA_PARISC_2_0 0x0214 /* PA-RISC 2.0 big-endian. */ -/* Additional section indeces. */ +/* Additional section indices. */ -#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tenatively declared +#define SHN_PARISC_ANSI_COMMON 0xff00 /* Section for tentatively declared symbols in ANSI C. */ #define SHN_PARISC_HUGE_COMMON 0xff01 /* Common blocks in huge model. */ @@ -1784,7 +1784,7 @@ typedef Elf32_Addr Elf32_Conflict; /* Legal values for sh_type field of Elf64_Shdr. */ -/* These two are primerily concerned with ECOFF debugging info. */ +/* These two are primarily concerned with ECOFF debugging info. */ #define SHT_ALPHA_DEBUG 0x70000001 #define SHT_ALPHA_REGINFO 0x70000002 diff --git a/include/grub/lib/LzmaEnc.h b/include/grub/lib/LzmaEnc.h index c625cd0bc..fc156a448 100644 --- a/include/grub/lib/LzmaEnc.h +++ b/include/grub/lib/LzmaEnc.h @@ -60,7 +60,7 @@ UInt32 LzmaEncProps_GetDictSize(const CLzmaEncProps *props2); Returns: SZ_OK - OK SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater in props + SZ_ERROR_PARAM - Incorrect parameter in props SZ_ERROR_WRITE - Write callback error. SZ_ERROR_PROGRESS - some break from progress callback SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) @@ -83,7 +83,7 @@ SRes LzmaEnc_MemEncode(CLzmaEncHandle p, Byte *dest, SizeT *destLen, const Byte Return code: SZ_OK - OK SZ_ERROR_MEM - Memory allocation error - SZ_ERROR_PARAM - Incorrect paramater + SZ_ERROR_PARAM - Incorrect parameter SZ_ERROR_OUTPUT_EOF - output buffer overflow SZ_ERROR_THREAD - errors in multithreading functions (only for Mt version) */ diff --git a/include/grub/script_sh.h b/include/grub/script_sh.h index 188068141..159da6225 100644 --- a/include/grub/script_sh.h +++ b/include/grub/script_sh.h @@ -170,7 +170,7 @@ struct grub_parser_param function. */ struct grub_script_mem *func_mem; - /* When set to 0, no errors have occured during parsing. */ + /* When set to 0, no errors have occurred during parsing. */ int err; /* The memory that was used while parsing and scanning. */ diff --git a/include/grub/usb.h b/include/grub/usb.h index 9c9e58bcd..8dd3b6e2e 100644 --- a/include/grub/usb.h +++ b/include/grub/usb.h @@ -155,7 +155,7 @@ struct grub_usb_device /* Device speed. */ grub_usb_speed_t speed; - /* All desciptors are read if this is set to 1. */ + /* All descriptors are read if this is set to 1. */ int initialized; /* Data toggle values (used for bulk transfers only). */ diff --git a/include/grub/usbdesc.h b/include/grub/usbdesc.h index 97947dc1b..027e7ed34 100644 --- a/include/grub/usbdesc.h +++ b/include/grub/usbdesc.h @@ -62,7 +62,7 @@ struct grub_usb_desc_config } __attribute__ ((packed)); #if 0 -struct grub_usb_desc_ifassosiation +struct grub_usb_desc_if_association { grub_uint8_t length; grub_uint8_t type; diff --git a/include/grub/xnu.h b/include/grub/xnu.h index 1462dc850..c6b2e8816 100644 --- a/include/grub/xnu.h +++ b/include/grub/xnu.h @@ -27,7 +27,7 @@ struct grub_xnu_hibernate_header /* Size of the image. Notice that file containing image is usually bigger. */ grub_uint64_t image_size; grub_uint8_t unknown1[8]; - /* Where to copy lauchcode?*/ + /* Where to copy launchcode? */ grub_uint32_t launchcode_target_page; /* How many pages of launchcode? */ grub_uint32_t launchcode_numpages; diff --git a/kern/ieee1275/cmain.c b/kern/ieee1275/cmain.c index b5e2ba66b..741d47f8d 100644 --- a/kern/ieee1275/cmain.c +++ b/kern/ieee1275/cmain.c @@ -130,7 +130,7 @@ grub_ieee1275_find_options (void) - SD cards. These work fine. - To avoid brekage, we only need to skip USB probing. However, + To avoid breakage, we only need to skip USB probing. However, since detecting SD cards is more reliable, we do that instead. */ diff --git a/kern/ieee1275/init.c b/kern/ieee1275/init.c index 27783cc83..5d5d733d9 100644 --- a/kern/ieee1275/init.c +++ b/kern/ieee1275/init.c @@ -150,7 +150,7 @@ static void grub_claim_heap (void) /* In theory, firmware should already prevent this from happening by not listing our own image in /memory/available. The check below is intended - as a safegard in case that doesn't happen. It does, however, not protect + as a safeguard in case that doesn't happen. However, it doesn't protect us from corrupting our module area, which extends up to a yet-undetermined region above _end. */ if ((addr < (grub_addr_t) _end) && ((addr + len) > (grub_addr_t) _start)) diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index 7d6502379..e71256de2 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -409,7 +409,7 @@ grub_reboot (void) void grub_halt (void) { - /* Not standarized. We try both known commands. */ + /* Not standardized. We try both known commands. */ grub_ieee1275_interpret ("shut-down", 0); grub_ieee1275_interpret ("power-off", 0); diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index db76399cd..ab3a6353c 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -394,7 +394,7 @@ grub_freebsd_list_modules (void) } } -/* This function would be here but it's under different licence. */ +/* This function would be here but it's under different license. */ #include "bsd_pagetable.c" struct gdt_descriptor diff --git a/loader/i386/bsd_trampoline.S b/loader/i386/bsd_trampoline.S index f6bfe2c44..577ddb829 100644 --- a/loader/i386/bsd_trampoline.S +++ b/loader/i386/bsd_trampoline.S @@ -98,7 +98,7 @@ VARIABLE(grub_bsd64_trampoline_start) orl $CR0_PG, %eax movl %eax, %cr0 - /* Now we're in compatability mode. set %cs for long mode. */ + /* Now we're in compatibility mode. set %cs for long mode. */ /* lgdt */ .byte 0x0f .byte 0x01 diff --git a/loader/macho.c b/loader/macho.c index da081a27f..ed70caa33 100644 --- a/loader/macho.c +++ b/loader/macho.c @@ -121,7 +121,7 @@ grub_macho32_readfile (grub_macho_t macho, void *dest) grub_ssize_t read; if (! grub_macho_contains_macho32 (macho)) return grub_error (GRUB_ERR_BAD_OS, - "Couldn't read arcitecture-specific part"); + "Couldn't read architecture-specific part"); if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1) { @@ -136,7 +136,7 @@ grub_macho32_readfile (grub_macho_t macho, void *dest) { grub_error_push (); return grub_error (GRUB_ERR_BAD_OS, - "Couldn't read arcitecture-specific part"); + "Couldn't read architecture-specific part"); } return GRUB_ERR_NONE; } diff --git a/loader/sparc64/ieee1275/linux.c b/loader/sparc64/ieee1275/linux.c index 86e532f7f..288ee3add 100644 --- a/loader/sparc64/ieee1275/linux.c +++ b/loader/sparc64/ieee1275/linux.c @@ -97,7 +97,7 @@ grub_linux_boot (void) hp = (struct linux_hdrs *) linux_addr; - /* Any pointer we derefence in the kernel image must be relocated + /* Any pointer we dereference in the kernel image must be relocated to where we actually loaded the kernel. */ addr = (grub_addr_t) hp->bootstr_info; addr += (linux_addr - linux_entry); @@ -474,7 +474,7 @@ fetch_translations (void) if (grub_ieee1275_get_property (node, "translations", of_trans, actual, &actual)) { - grub_printf ("Cannot fetch /vritual-memory/translations property.\n"); + grub_printf ("Cannot fetch /virtual-memory/translations property.\n"); return; } diff --git a/loader/xnu.c b/loader/xnu.c index 45696ee5f..2b6ffa42c 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -1053,7 +1053,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, return GRUB_ERR_NONE; } -/* Load extension DIRNAME. (extensions are directoris in xnu) */ +/* Load extension DIRNAME. (extensions are directories in xnu) */ grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, int maxrecursion) @@ -1226,7 +1226,7 @@ grub_cmd_xnu_kext (grub_command_t cmd __attribute__ ((unused)), grub_file_t binfile = 0; if (argc == 2) { - /* User explicitely specified plist and binary. */ + /* User explicitly specified plist and binary. */ if (grub_strcmp (args[1], "-") != 0) { binfile = grub_gzfile_open (args[1], 1); diff --git a/mmap/i386/uppermem.c b/mmap/i386/uppermem.c index 80576cad9..5f6eece0e 100644 --- a/mmap/i386/uppermem.c +++ b/mmap/i386/uppermem.c @@ -63,7 +63,7 @@ grub_mmap_get_upper (void) return upper; } -/* Count the continous bytes after 64 MiB. */ +/* Count the continuous bytes after 64 MiB. */ grub_uint64_t grub_mmap_get_post64 (void) { diff --git a/mmap/mmap.c b/mmap/mmap.c index 86df28b1d..67f7c7b0b 100644 --- a/mmap/mmap.c +++ b/mmap/mmap.c @@ -212,7 +212,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, if (present[k] && (curtype == -1 || priority[k] > priority[curtype])) curtype = k; - /* Anounce region to the hook if necessary. */ + /* Announce region to the hook if necessary. */ if ((curtype == -1 || curtype != lasttype) && lastaddr != scanline_events[i].pos && lasttype != -1 diff --git a/normal/datetime.c b/normal/datetime.c index 272b716fa..9e667b79c 100644 --- a/normal/datetime.c +++ b/normal/datetime.c @@ -64,7 +64,7 @@ grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime) /* In the period of validity of unixtime all years divisible by 4 are bissextile*/ /* Convenience: let's have 3 consecutive non-bissextile years - at the begining of the epoch. So count from 1973 instead of 1970 */ + at the beginning of the epoch. So count from 1973 instead of 1970 */ nix -= 3*SECPERYEAR + SECPERDAY; /* Transform C divisions and modulos to mathematical ones */ div = nix / SECPER4YEARS; @@ -73,8 +73,8 @@ grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime) datetime->year = 1973 + 4 * div; nix -= div * SECPER4YEARS; - /* On 31st december of bissextile years 365 days from the begining - of the year elapsed but year isn't finished yet*/ + /* On 31st December of bissextile years 365 days from the beginning + of the year elapsed but year isn't finished yet */ if (nix / SECPERYEAR == 4) { datetime->year += 3; diff --git a/normal/main.c b/normal/main.c index 1c2eff4df..bc0808b02 100644 --- a/normal/main.c +++ b/normal/main.c @@ -390,8 +390,8 @@ grub_normal_init_page (void) static int reader_nested; -/* Read the config file COFIG, and execute the menu interface or - the command-line interface if BATCH is false. */ +/* Read the config file CONFIG and execute the menu interface or + the command line interface if BATCH is false. */ void grub_normal_execute (const char *config, int nested, int batch) { diff --git a/normal/menu.c b/normal/menu.c index e1d7edcad..59ad83fa7 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -83,7 +83,7 @@ grub_menu_set_timeout (int timeout) } /* Get the first entry number from the value of the environment variable NAME, - which is a space-separated list of nonnegative integers. The entry number + which is a space-separated list of non-negative integers. The entry number which is returned is stripped from the value of NAME. If no entry number can be found, -1 is returned. */ static int diff --git a/partmap/apple.c b/partmap/apple.c index d6ddc0b3f..2902f27d2 100644 --- a/partmap/apple.c +++ b/partmap/apple.c @@ -77,7 +77,7 @@ struct grub_apple_part /* Reserved. */ grub_uint32_t reserved2; - /* The entrypoint of the bootcode. */ + /* The entry point of the bootcode. */ grub_uint32_t bootcode_entrypoint; /* Reserved. */ diff --git a/term/i386/pc/vesafb.c b/term/i386/pc/vesafb.c index edd0b1a63..884842895 100644 --- a/term/i386/pc/vesafb.c +++ b/term/i386/pc/vesafb.c @@ -83,7 +83,7 @@ struct grub_virtual_screen struct grub_colored_char *text_buffer; }; -/* Make seure text buffer is not marked as allocated. */ +/* Make sure text buffer is not marked as allocated. */ static struct grub_virtual_screen virtual_screen = { .text_buffer = 0 diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index 4a5d75bcf..66962d8e5 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -92,7 +92,7 @@ grub_usb_hid (void) /* Place the device in boot mode. */ grub_usb_control_msg (usbdev, 0x21, 0x0B, 0, 0, 0, 0); - /* Reports everytime an event occurs and not more often than that. */ + /* Reports every time an event occurs and not more often than that. */ grub_usb_control_msg (usbdev, 0x21, 0x0A, 0<<8, 0, 0, 0); } diff --git a/util/getroot.c b/util/getroot.c index 68e1fad58..b6aae392f 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -351,7 +351,7 @@ find_cygwin_root_device (const char *path, dev_t dev) /* Cygwin returns the partition serial number in stat.st_dev. This is never identical to the device number of the emulated /dev/sdXN device, so above find_root_device () does not work. - Search the partion with the same serial in boot sector instead. */ + Search the partition with the same serial in boot sector instead. */ char devpath[sizeof ("/dev/sda15") + 13]; /* Size + Paranoia. */ int d; for (d = 'a'; d <= 'z'; d++) diff --git a/util/resolve.c b/util/resolve.c index 85aec72e9..c79f3c104 100644 --- a/util/resolve.c +++ b/util/resolve.c @@ -101,7 +101,7 @@ read_dep_list (FILE *fp) struct mod_list *mod; char *name; - /* Skip white spaces. */ + /* Skip whitespace. */ while (*p && isspace (*p)) p++; @@ -110,7 +110,7 @@ read_dep_list (FILE *fp) name = p; - /* Skip non-WSPs. */ + /* Skip non-whitespace. */ while (*p && ! isspace (*p)) p++; diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index 23f7d46f0..ae0840234 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -42,7 +42,7 @@ static struct grub_vbe_palette_data vga_colors[16] = {0x00, 0x00, 0xA8, 0x00}, // 4 = red {0xA8, 0x00, 0xA8, 0x00}, // 5 = magenta {0x00, 0x54, 0xA8, 0x00}, // 6 = brown - {0xA8, 0xA8, 0xA8, 0x00}, // 7 = ligth gray + {0xA8, 0xA8, 0xA8, 0x00}, // 7 = light gray {0x54, 0x54, 0x54, 0x00}, // 8 = dark gray {0xFE, 0x54, 0x54, 0x00}, // 9 = bright blue @@ -1552,7 +1552,7 @@ grub_video_vbe_delete_render_target (struct grub_video_render_target *target) if (! target) return GRUB_ERR_NONE; - /* TODO: Delist render target fron render target list. */ + /* TODO: Delist render target from render target list. */ /* If this is software render target, free it's memory. */ if (target->is_allocated) diff --git a/video/readers/png.c b/video/readers/png.c index f9247b1c8..dffcd8524 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -109,7 +109,7 @@ struct grub_png_data grub_uint8_t *cur_rgb; - int cur_colume, cur_filter, first_line; + int cur_column, cur_filter, first_line; }; static grub_uint32_t @@ -265,7 +265,7 @@ grub_png_decode_image_header (struct grub_png_data *data) data->raw_bytes = data->image_height * (data->image_width + 1) * data->bpp; - data->cur_colume = 0; + data->cur_column = 0; data->first_line = 1; if (grub_png_get_byte (data) != PNG_COMPRESSION_BASE) @@ -522,7 +522,7 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) if (--data->raw_bytes < 0) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "image size overflown"); - if (data->cur_colume == 0) + if (data->cur_column == 0) { if (n >= PNG_FILTER_VALUE_LAST) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid filter value"); @@ -532,9 +532,9 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) else *(data->cur_rgb++) = n; - data->cur_colume++; + data->cur_column++; row_bytes = data->image_width * data->bpp; - if (data->cur_colume == row_bytes + 1) + if (data->cur_column == row_bytes + 1) { grub_uint8_t *blank_line = NULL; grub_uint8_t *cur = data->cur_rgb - row_bytes; @@ -623,7 +623,7 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) if (blank_line) grub_free (blank_line); - data->cur_colume = 0; + data->cur_column = 0; data->first_line = 0; } From 74bfdd2f77fd05294ab7aa72dc2557d07a48feb8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 4 May 2009 20:21:33 +0000 Subject: [PATCH 0722/1707] 2009-05-04 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): Set to 0x300. * loader/i386/linux.c (vga_modes, linux_vesafb_res): Add a few resolutions. (linux_vesafb_modes): Add a lot of additional modes to the list (based on documentation from Wikipedia). --- ChangeLog | 9 +++ include/grub/i386/linux.h | 2 +- loader/i386/linux.c | 147 ++++++++++++++++++++++++++++++++------ 3 files changed, 137 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6c5ca242..6bc5f305c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-05-04 Robert Millan + + * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): Set + to 0x300. + * loader/i386/linux.c (vga_modes, linux_vesafb_res): Add a few + resolutions. + (linux_vesafb_modes): Add a lot of additional modes to the list (based + on documentation from Wikipedia). + 2009-05-04 Pavel Roskin * disk/ata.c: Spelling fixes. diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index dad38e545..70eba1da7 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -38,7 +38,7 @@ #define GRUB_LINUX_VID_MODE_NORMAL 0xFFFF #define GRUB_LINUX_VID_MODE_EXTENDED 0xFFFE #define GRUB_LINUX_VID_MODE_ASK 0xFFFD -#define GRUB_LINUX_VID_MODE_VESA_START 0x0301 +#define GRUB_LINUX_VID_MODE_VESA_START 0x0300 #define GRUB_LINUX_SETUP_MOVE_SIZE 0x9100 #define GRUB_LINUX_CL_MAGIC 0xA33F diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 1a237108b..d67a5f8e3 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -102,46 +102,65 @@ struct linux_vesafb_res grub_uint16_t height; }; -enum vga_modes - { - VGA_640_480, - VGA_800_600, - VGA_1024_768, - VGA_1280_1024, - }; - struct linux_vesafb_mode { grub_uint8_t res_index; grub_uint8_t depth; }; -static struct linux_vesafb_res linux_vesafb_res[] = +enum vga_modes { - { 640, 480 }, - { 800, 600 }, - { 1024, 768 }, - { 1280, 1024 } + VGA_320_200, + VGA_640_400, + VGA_640_480, + VGA_800_500, + VGA_800_600, + VGA_896_672, + VGA_1024_640, + VGA_1024_768, + VGA_1152_720, + VGA_1280_1024, + VGA_1440_900, + VGA_1600_1200, }; -/* This is the reverse of the table in [linux]/Documentation/fb/vesafb.txt. */ +static struct linux_vesafb_res linux_vesafb_res[] = + { + { 320, 200 }, + { 640, 400 }, + { 640, 480 }, + { 800, 500 }, + { 800, 600 }, + { 896, 672 }, + { 1024, 640 }, + { 1024, 768 }, + { 1152, 720 }, + { 1280, 1024 }, + { 1440, 900 }, + { 1600, 1200 }, + }; + +/* This is the reverse of the table in [linux]/Documentation/fb/vesafb.txt + plus a few more modes based on the table in + http://en.wikipedia.org/wiki/VESA_BIOS_Extensions */ struct linux_vesafb_mode linux_vesafb_modes[] = { + { VGA_640_400, 8 }, /* 0x300 */ { VGA_640_480, 8 }, /* 0x301 */ - { 0, 0 }, + { VGA_800_600, 4 }, /* 0x302 */ { VGA_800_600, 8 }, /* 0x303 */ - { 0, 0 }, + { VGA_1024_768, 4 }, /* 0x304 */ { VGA_1024_768, 8 }, /* 0x305 */ - { 0, 0 }, + { VGA_1280_1024, 4 }, /* 0x306 */ { VGA_1280_1024, 8 }, /* 0x307 */ { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, { 0, 0 }, - { 0, 0 }, - { 0, 0 }, - { 0, 0 }, + { VGA_320_200, 15 }, /* 0x30d */ + { VGA_320_200, 16 }, /* 0x30e */ + { VGA_320_200, 24 }, /* 0x30f */ { VGA_640_480, 15 }, /* 0x310 */ { VGA_640_480, 16 }, /* 0x311 */ { VGA_640_480, 24 }, /* 0x312 */ @@ -154,6 +173,94 @@ struct linux_vesafb_mode linux_vesafb_modes[] = { VGA_1280_1024, 15 }, /* 0x319 */ { VGA_1280_1024, 16 }, /* 0x31a */ { VGA_1280_1024, 24 }, /* 0x31b */ + { VGA_1600_1200, 8 }, /* 0x31c */ + { VGA_1600_1200, 15 }, /* 0x31d */ + { VGA_1600_1200, 16 }, /* 0x31e */ + { VGA_1600_1200, 24 }, /* 0x31f */ + { 0, 0 }, + { VGA_640_400, 15 }, /* 0x321 */ + { VGA_640_400, 16 }, /* 0x322 */ + { VGA_640_400, 24 }, /* 0x323 */ + { VGA_640_400, 32 }, /* 0x324 */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { VGA_640_480, 32 }, /* 0x329 */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { VGA_896_672, 8 }, /* 0x32f */ + { VGA_896_672, 15 }, /* 0x330 */ + { VGA_896_672, 16 }, /* 0x331 */ + { VGA_896_672, 24 }, /* 0x332 */ + { VGA_896_672, 32 }, /* 0x333 */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { VGA_1600_1200, 32 }, /* 0x342 */ + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { 0, 0 }, + { VGA_1440_900, 8 }, /* 0x360 */ + { VGA_1440_900, 15 }, /* 0x361 */ + { VGA_1440_900, 16 }, /* 0x362 */ + { VGA_1440_900, 24 }, /* 0x363 */ + { VGA_1440_900, 32 }, /* 0x364 */ + { VGA_1152_720, 8 }, /* 0x365 */ + { VGA_1152_720, 15 }, /* 0x366 */ + { VGA_1152_720, 16 }, /* 0x367 */ + { VGA_1152_720, 24 }, /* 0x368 */ + { VGA_1152_720, 32 }, /* 0x369 */ + { VGA_1024_640, 8 }, /* 0x36a */ + { VGA_1024_640, 15 }, /* 0x36b */ + { VGA_1024_640, 16 }, /* 0x36c */ + { VGA_1024_640, 24 }, /* 0x36d */ + { VGA_1024_640, 32 }, /* 0x36e */ + { VGA_800_500, 8 }, /* 0x36f */ + { VGA_800_500, 15 }, /* 0x370 */ + { VGA_800_500, 16 }, /* 0x371 */ + { VGA_800_500, 24 }, /* 0x372 */ + { VGA_800_500, 32 }, /* 0x373 */ }; static inline grub_size_t From 983598addeeda3fc796b2b055ba1769f3435f1aa Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 4 May 2009 22:46:55 +0000 Subject: [PATCH 0723/1707] * kern/ieee1275/openfw.c (grub_children_iterate): Fix string pointer args to grub_ieee1275_get_property(). --- ChangeLog | 5 +++++ kern/ieee1275/openfw.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6bc5f305c..e95759f0c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-04 David S. Miller + + * kern/ieee1275/openfw.c (grub_children_iterate): Fix string + pointer args to grub_ieee1275_get_property(). + 2009-05-04 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): Set diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index e71256de2..aff410dbf 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -78,7 +78,7 @@ grub_children_iterate (char *devpath, struct grub_ieee1275_devalias alias; grub_ssize_t actual; - if (grub_ieee1275_get_property (child, "device_type", &childtype, + if (grub_ieee1275_get_property (child, "device_type", childtype, sizeof childtype, &actual)) continue; @@ -86,7 +86,7 @@ grub_children_iterate (char *devpath, &actual)) continue; - if (grub_ieee1275_get_property (child, "name", &childname, + if (grub_ieee1275_get_property (child, "name", childname, sizeof childname, &actual)) continue; From 8aadec43eecea73c47b8aa4883729da7f46c5327 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 4 May 2009 22:53:23 +0000 Subject: [PATCH 0724/1707] * conf/sparc64-ieee1275.rmk: Fix build due to missing '\'. --- ChangeLog | 2 ++ conf/sparc64-ieee1275.rmk | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e95759f0c..46c055e35 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ * kern/ieee1275/openfw.c (grub_children_iterate): Fix string pointer args to grub_ieee1275_get_property(). + * conf/sparc64-ieee1275.rmk: Fix build due to missing '\'. + 2009-05-04 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): Set diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 158b9e673..c94b342af 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -113,12 +113,12 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/reader.c \ - kern/rescue_reader.c kern/rescue_parser.c + kern/rescue_reader.c kern/rescue_parser.c \ kern/term.c fs/fshelp.c \ kern/list.c kern/handler.c \ lib/arg.c normal/cmdline.c \ normal/completion.c \ - normal/main.c normal/menu.c \ + normal/main.c normal/menu.c \ normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ normal/color.c \ From 9554b15eac4a94a3eed461afaae8385e07992e05 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 4 May 2009 23:05:12 +0000 Subject: [PATCH 0725/1707] * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Bypass cdrom devices, and do not traverse down under controller nodes. --- ChangeLog | 3 +++ disk/ieee1275/ofdisk.c | 8 ++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46c055e35..26616ab3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,6 +5,9 @@ * conf/sparc64-ieee1275.rmk: Fix build due to missing '\'. + * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Bypass cdrom + devices, and do not traverse down under controller nodes. + 2009-05-04 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): Set diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index e2c7867e6..1620fee83 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -106,13 +106,9 @@ grub_ofdisk_iterate (int (*hook) (const char *name)) } } - if (! grub_strcmp (alias->type, "block")) + if (! grub_strcmp (alias->type, "block") && + grub_strcmp (alias->name, "cdrom")) ret = hook (alias->name); - else if ((! grub_strcmp (alias->type, "scsi")) - || (! grub_strcmp (alias->type, "ide")) - || (! grub_strcmp (alias->type, "ata"))) - /* Search for block-type children of these bus controllers. */ - ret = grub_children_iterate (alias->name, dev_iterate); return ret; } From 67e23c9004af980502b997b876da7ff3cb109cc7 Mon Sep 17 00:00:00 2001 From: davem Date: Mon, 4 May 2009 23:13:53 +0000 Subject: [PATCH 0726/1707] * disk/ieee1275/ofdisk.c (compute_dev_path): New. (grub_ofdisk_open): Use it to un-escape "," characters. * kern/disk.c (find_part_sep): New. (grub_disk_open): Use it to find the first non-escaped ',' character in the disk name. * util/ieee1275/devicemap.c (escape_of_path): New. (grub_util_emit_devicemap_entry): Use it. * util/sparc64/ieee1275/grub-install.in: Update script to strip partition specifiers properly by not triggering on '\' escaped ',' characters. --- ChangeLog | 11 ++++++++ disk/ieee1275/ofdisk.c | 38 +++++++++++++++++++++++---- kern/disk.c | 22 ++++++++++++++-- util/ieee1275/devicemap.c | 36 ++++++++++++++++++++++++- util/sparc64/ieee1275/grub-install.in | 4 +-- util/sparc64/ieee1275/grub-setup.c | 33 ++++++++++++++++++++--- 6 files changed, 130 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26616ab3b..3b3ebd5ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,17 @@ * disk/ieee1275/ofdisk.c (grub_ofdisk_iterate): Bypass cdrom devices, and do not traverse down under controller nodes. + * disk/ieee1275/ofdisk.c (compute_dev_path): New. + (grub_ofdisk_open): Use it to un-escape "," characters. + * kern/disk.c (find_part_sep): New. + (grub_disk_open): Use it to find the first non-escaped ',' + character in the disk name. + * util/ieee1275/devicemap.c (escape_of_path): New. + (grub_util_emit_devicemap_entry): Use it. + * util/sparc64/ieee1275/grub-install.in: Update script to + strip partition specifiers properly by not triggering on + '\' escaped ',' characters. + 2009-05-04 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_VID_MODE_VESA_START): Set diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index 1620fee83..7904cc0c0 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -115,6 +115,38 @@ grub_ofdisk_iterate (int (*hook) (const char *name)) return grub_devalias_iterate (dev_iterate); } +static char * +compute_dev_path (const char *name) +{ + char *devpath = grub_malloc (grub_strlen (name) + 2); + char *p, c; + + if (!devpath) + return NULL; + + /* Un-escape commas. */ + p = devpath; + while ((c = *name++) != '\0') + { + if (c == '\\' && *name == ',') + { + *p++ = ','; + name++; + } + else + *p++ = c; + } + + if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) + { + *p++ = ':'; + *p++ = '0'; + } + *p++ = '\0'; + + return devpath; +} + static grub_err_t grub_ofdisk_open (const char *name, grub_disk_t disk) { @@ -126,14 +158,10 @@ grub_ofdisk_open (const char *name, grub_disk_t disk) char prop[64]; grub_ssize_t actual; - devpath = grub_strndup (name, grub_strlen (name) + 2); + devpath = compute_dev_path (name); if (! devpath) return grub_errno; - /* To access the complete disk add `:0'. */ - if (! grub_ieee1275_test_flag (GRUB_IEEE1275_FLAG_NO_PARTITION_0)) - grub_strcat (devpath, ":0"); - op = ofdisk_hash_find (devpath); if (!op) op = ofdisk_hash_add (devpath); diff --git a/kern/disk.c b/kern/disk.c index 8a92989ad..4db3f30cd 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -215,10 +215,28 @@ grub_disk_dev_iterate (int (*hook) (const char *name)) return 0; } +/* Return the location of the first ',', if any, which is not + escaped by a '\'. */ +static const char * +find_part_sep (const char *name) +{ + const char *p = name; + char c; + + while ((c = *p++) != '\0') + { + if (c == '\\' && *p == ',') + p++; + else if (c == ',') + return p - 1; + } + return NULL; +} + grub_disk_t grub_disk_open (const char *name) { - char *p; + const char *p; grub_disk_t disk; grub_disk_dev_t dev; char *raw = (char *) name; @@ -238,7 +256,7 @@ grub_disk_open (const char *name) if (! disk->name) goto fail; - p = grub_strchr (name, ','); + p = find_part_sep (name); if (p) { grub_size_t len = p - name; diff --git a/util/ieee1275/devicemap.c b/util/ieee1275/devicemap.c index 8e6eb39c4..bddfc17e7 100644 --- a/util/ieee1275/devicemap.c +++ b/util/ieee1275/devicemap.c @@ -1,13 +1,47 @@ #include +#include #include #include #include +#include + +/* Since OF path names can have "," characters in them, and GRUB + internally uses "," to indicate partitions (unlike OF which uses + ":" for this purpose) we escape such commas. */ + +static char * +escape_of_path (const char *orig_path) +{ + char *new_path, *d, c; + const char *p; + + if (!strchr (orig_path, ',')) + return (char *) orig_path; + + new_path = xmalloc (strlen (orig_path) * 2); + + p = orig_path; + d = new_path; + while ((c = *p++) != '\0') + { + if (c == ',') + *d++ = '\\'; + *d++ = c; + } + + free ((char *) orig_path); + + return new_path; +} void grub_util_emit_devicemap_entry (FILE *fp, char *name, int is_floppy UNUSED, int *num_fd UNUSED, int *num_hd UNUSED) { - const char *ofpath = grub_util_devname_to_ofpath (name); + const char *orig_path = grub_util_devname_to_ofpath (name); + char *ofpath = escape_of_path (orig_path); fprintf(fp, "(%s)\t%s\n", ofpath, name); + + free (ofpath); } diff --git a/util/sparc64/ieee1275/grub-install.in b/util/sparc64/ieee1275/grub-install.in index e2af5e8d9..a174050b4 100644 --- a/util/sparc64/ieee1275/grub-install.in +++ b/util/sparc64/ieee1275/grub-install.in @@ -237,8 +237,8 @@ if [ "x${devabstraction_module}" = "x" ] ; then grub_drive="`$grub_probe --target=drive --device ${grub_device}`" # Strip partition number - install_drive="`echo ${install_drive} | sed -e s/,[0-9]*//g`" - grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*//g`" + install_drive="`echo ${install_drive} | sed -e s/\([^\]\),[0-9]*/\1/g`" + grub_drive="`echo ${grub_drive} | sed -e s/\([^\]\),[0-9]*/\1/g`" if [ "x${grub_drive}" != "x${install_drive}" ] ; then uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" if [ "x${uuid}" = "x" ] ; then diff --git a/util/sparc64/ieee1275/grub-setup.c b/util/sparc64/ieee1275/grub-setup.c index 6ca3a7aa1..9509eb30b 100644 --- a/util/sparc64/ieee1275/grub-setup.c +++ b/util/sparc64/ieee1275/grub-setup.c @@ -56,7 +56,7 @@ * device. It also needs to know the initial block number of * 'core' (which is 'diskboot' concatenated with 'kernel' and * all the modules, this is created by grub-mkimage). This resulting - * 'boot' image is 512 bytes in size and is placed in the first block + * 'boot' image is 512 bytes in size and is placed in the second block * of a partition. * * The initial 'diskboot' block acts as a loader for the actual GRUB @@ -100,6 +100,28 @@ grub_refresh (void) fflush (stdout); } +static char *compute_dest_ofpath (const char *dest) +{ + int len = strlen (dest); + char *res, *p, c; + + res = xmalloc (len); + p = res; + while ((c = *dest++) != '\0') + { + if (c == '\\' && *dest == ',') + { + *p++ = ','; + dest++; + } + else + *p++ = c; + } + *p++ = '\0'; + + return res; +} + static void setup (const char *prefix, const char *dir, const char *boot_file, const char *core_file, @@ -110,7 +132,7 @@ setup (const char *prefix, const char *dir, size_t boot_size, core_size; grub_uint16_t core_sectors; grub_device_t root_dev, dest_dev; - char *boot_devpath; + char *boot_devpath, *dest_ofpath; grub_disk_addr_t *kernel_sector; struct boot_blocklist *first_block, *block; char *tmp_img; @@ -170,6 +192,8 @@ setup (const char *prefix, const char *dir, last_length = length; } + dest_ofpath = compute_dest_ofpath (dest); + /* Read the boot image by the OS service. */ boot_path = grub_util_get_path (dir, boot_file); boot_size = grub_util_get_image_size (boot_path); @@ -202,7 +226,8 @@ setup (const char *prefix, const char *dir, + GRUB_DISK_SECTOR_SIZE - sizeof (*block)); - grub_util_info ("root is '%s' and dest is '%s'", root, dest); + grub_util_info ("root is '%s', dest is '%s', and dest_ofpath is '%s'", + root, dest, dest_ofpath); /* Open the root device and the destination device. */ grub_util_info ("Opening root"); @@ -330,7 +355,7 @@ setup (const char *prefix, const char *dir, *kernel_sector = grub_cpu_to_be64 (first_sector); - strcpy(boot_devpath, dest); + strcpy(boot_devpath, dest_ofpath); grub_util_info ("boot device path %s, prefix is %s, dest is %s", boot_devpath, prefix, dest); From de5fd76e95f60ce58087bf75fe37b87748b5352b Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 4 May 2009 23:33:34 +0000 Subject: [PATCH 0727/1707] 2009-05-04 Pavel Roskin * commands/acpi.c: Remove unused variable my_mod. * partmap/amiga.c: Likewise. * partmap/apple.c: Likewise. * partmap/gpt.c: Likewise. * partmap/pc.c: Likewise. * partmap/sun.c: Likewise. * term/gfxterm.c: Likewise. * term/i386/pc/vesafb.c: Likewise. * term/i386/pc/vga.c: Likewise. --- ChangeLog | 12 ++++++++++++ commands/acpi.c | 2 -- partmap/amiga.c | 7 ------- partmap/apple.c | 7 ------- partmap/gpt.c | 7 ------- partmap/pc.c | 7 ------- partmap/sun.c | 7 ------- term/gfxterm.c | 2 -- term/i386/pc/vesafb.c | 2 -- term/i386/pc/vga.c | 4 ---- 10 files changed, 12 insertions(+), 45 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b3ebd5ee..34b1a4a38 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-05-04 Pavel Roskin + + * commands/acpi.c: Remove unused variable my_mod. + * partmap/amiga.c: Likewise. + * partmap/apple.c: Likewise. + * partmap/gpt.c: Likewise. + * partmap/pc.c: Likewise. + * partmap/sun.c: Likewise. + * term/gfxterm.c: Likewise. + * term/i386/pc/vesafb.c: Likewise. + * term/i386/pc/vga.c: Likewise. + 2009-05-04 David S. Miller * kern/ieee1275/openfw.c (grub_children_iterate): Fix string diff --git a/commands/acpi.c b/commands/acpi.c index 7b53343a6..d6dce376a 100644 --- a/commands/acpi.c +++ b/commands/acpi.c @@ -73,7 +73,6 @@ grub_byte_checksum (void *base, grub_size_t size) /* rev1 is 1 if ACPIv1 is to be generated, 0 otherwise. rev2 contains the revision of ACPIv2+ to generate or 0 if none. */ static int rev1, rev2; -static grub_dl_t my_mod; /* OEMID of RSDP, RSDT and XSDT. */ static char root_oemid[6]; /* OEMTABLE of the same tables. */ @@ -764,7 +763,6 @@ GRUB_MOD_INIT(acpi) "Load host acpi tables and tables " "specified by arguments", options); - my_mod=mod; } GRUB_MOD_FINI(acpi) diff --git a/partmap/amiga.c b/partmap/amiga.c index fde3011ff..568a8588c 100644 --- a/partmap/amiga.c +++ b/partmap/amiga.c @@ -67,10 +67,6 @@ struct grub_amiga_partition static struct grub_partition_map grub_amiga_partition_map; -#ifndef GRUB_UTIL -static grub_dl_t my_mod; -#endif - static grub_err_t @@ -211,9 +207,6 @@ static struct grub_partition_map grub_amiga_partition_map = GRUB_MOD_INIT(amiga_partition_map) { grub_partition_map_register (&grub_amiga_partition_map); -#ifndef GRUB_UTIL - my_mod = mod; -#endif } GRUB_MOD_FINI(amiga_partition_map) diff --git a/partmap/apple.c b/partmap/apple.c index 2902f27d2..55d3cf585 100644 --- a/partmap/apple.c +++ b/partmap/apple.c @@ -94,10 +94,6 @@ struct grub_apple_part }; static struct grub_partition_map grub_apple_partition_map; - -#ifndef GRUB_UTIL -static grub_dl_t my_mod; -#endif static grub_err_t @@ -247,9 +243,6 @@ static struct grub_partition_map grub_apple_partition_map = GRUB_MOD_INIT(apple_partition_map) { grub_partition_map_register (&grub_apple_partition_map); -#ifndef GRUB_UTIL - my_mod = mod; -#endif } GRUB_MOD_FINI(apple_partition_map) diff --git a/partmap/gpt.c b/partmap/gpt.c index 683fcbace..ffdbed0f9 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -34,10 +34,6 @@ static const grub_gpt_part_type_t grub_gpt_partition_type_empty = GRUB_GPT_PARTI static struct grub_partition_map grub_gpt_partition_map; -#ifndef GRUB_UTIL -static grub_dl_t my_mod; -#endif - static grub_err_t @@ -189,9 +185,6 @@ static struct grub_partition_map grub_gpt_partition_map = GRUB_MOD_INIT(gpt_partition_map) { grub_partition_map_register (&grub_gpt_partition_map); -#ifndef GRUB_UTIL - my_mod = mod; -#endif } GRUB_MOD_FINI(gpt_partition_map) diff --git a/partmap/pc.c b/partmap/pc.c index 38aa75278..b86bb91fa 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -25,10 +25,6 @@ #include static struct grub_partition_map grub_pc_partition_map; - -#ifndef GRUB_UTIL -static grub_dl_t my_mod; -#endif /* Parse the partition representation in STR and return a partition. */ @@ -312,9 +308,6 @@ static struct grub_partition_map grub_pc_partition_map = GRUB_MOD_INIT(pc_partition_map) { grub_partition_map_register (&grub_pc_partition_map); -#ifndef GRUB_UTIL - my_mod = mod; -#endif } GRUB_MOD_FINI(pc_partition_map) diff --git a/partmap/sun.c b/partmap/sun.c index b05a2e2a3..6b524dbf0 100644 --- a/partmap/sun.c +++ b/partmap/sun.c @@ -67,10 +67,6 @@ struct grub_sun_block static struct grub_partition_map grub_sun_partition_map; -#ifndef GRUB_UTIL -static grub_dl_t my_mod; -#endif - /* Verify checksum (true=ok). */ static int grub_sun_is_valid (struct grub_sun_block *label) @@ -211,9 +207,6 @@ static struct grub_partition_map grub_sun_partition_map = GRUB_MOD_INIT(sun_partition_map) { grub_partition_map_register (&grub_sun_partition_map); -#ifndef GRUB_UTIL - my_mod = mod; -#endif } GRUB_MOD_FINI(sun_partition_map) diff --git a/term/gfxterm.c b/term/gfxterm.c index 4f74346b7..e6baa159f 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -106,7 +106,6 @@ struct grub_virtual_screen static struct grub_virtual_screen virtual_screen; -static grub_dl_t my_mod; static struct grub_video_mode_info mode_info; static struct grub_video_render_target *text_layer; @@ -1154,7 +1153,6 @@ static grub_command_t cmd; GRUB_MOD_INIT(term_gfxterm) { - my_mod = mod; grub_term_register_output ("gfxterm", &grub_video_term); cmd = grub_register_command ("background_image", grub_gfxterm_background_image_cmd, diff --git a/term/i386/pc/vesafb.c b/term/i386/pc/vesafb.c index 884842895..7a81f644f 100644 --- a/term/i386/pc/vesafb.c +++ b/term/i386/pc/vesafb.c @@ -89,7 +89,6 @@ static struct grub_virtual_screen virtual_screen = .text_buffer = 0 }; -static grub_dl_t my_mod; static unsigned char *vga_font = 0; static grub_uint32_t old_mode = 0; @@ -598,7 +597,6 @@ static struct grub_term_output grub_vesafb_term = GRUB_MOD_INIT(vesafb) { - my_mod = mod; grub_term_register_output ("vesafb", &grub_vesafb_term); } diff --git a/term/i386/pc/vga.c b/term/i386/pc/vga.c index dd2e25c34..59c298375 100644 --- a/term/i386/pc/vga.c +++ b/term/i386/pc/vga.c @@ -57,7 +57,6 @@ struct colored_char unsigned char index; }; -static grub_dl_t my_mod; static unsigned char text_mode; static unsigned xpos, ypos; static int cursor_state; @@ -505,9 +504,6 @@ static struct grub_term_output grub_vga_term = GRUB_MOD_INIT(vga) { -#ifndef GRUB_UTIL - my_mod = mod; -#endif grub_term_register_output ("vga", &grub_vga_term); } From 119494b506e236904a7dd69ff94feb82bb14318d Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 5 May 2009 16:36:58 +0000 Subject: [PATCH 0728/1707] 2009-05-05 Pavel Roskin * include/grub/dl.h [GRUB_UTIL]: Provide inline implementations of grub_dl_ref() and grub_dl_unref(). * commands/parttool.c: Remove preprocessor conditionals around grub_dl_ref() and grub_dl_unref(). * fs/affs.c: Likewise. * fs/afs.c: Likewise. * fs/cpio.c: Likewise. * fs/ext2.c: Likewise. * fs/fat.c: Likewise. * fs/hfs.c: Likewise. * fs/hfsplus.c: Likewise. * fs/iso9660.c: Likewise. * fs/jfs.c: Likewise. * fs/minix.c: Likewise. * fs/ntfs.c: Likewise. * fs/reiserfs.c: Likewise. * fs/sfs.c: Likewise. * fs/udf.c: Likewise. * fs/ufs.c: Likewise. * fs/xfs.c: Likewise. * include/grub/dl.h: Likewise. * loader/xnu.c: Likewise. --- ChangeLog | 25 +++++++++++++++++++++++++ commands/parttool.c | 4 ---- fs/affs.c | 18 ------------------ fs/afs.c | 14 -------------- fs/cpio.c | 14 -------------- fs/ext2.c | 26 -------------------------- fs/fat.c | 22 ---------------------- fs/hfs.c | 18 +----------------- fs/hfsplus.c | 22 ---------------------- fs/iso9660.c | 18 ------------------ fs/jfs.c | 14 -------------- fs/minix.c | 4 ---- fs/ntfs.c | 23 ----------------------- fs/reiserfs.c | 20 -------------------- fs/sfs.c | 14 -------------- fs/udf.c | 14 -------------- fs/ufs.c | 12 ------------ fs/xfs.c | 22 ---------------------- include/grub/dl.h | 15 +++++++++++++++ loader/xnu.c | 4 ---- 20 files changed, 41 insertions(+), 282 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34b1a4a38..60a10dc33 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2009-05-05 Pavel Roskin + + * include/grub/dl.h [GRUB_UTIL]: Provide inline implementations + of grub_dl_ref() and grub_dl_unref(). + * commands/parttool.c: Remove preprocessor conditionals around + grub_dl_ref() and grub_dl_unref(). + * fs/affs.c: Likewise. + * fs/afs.c: Likewise. + * fs/cpio.c: Likewise. + * fs/ext2.c: Likewise. + * fs/fat.c: Likewise. + * fs/hfs.c: Likewise. + * fs/hfsplus.c: Likewise. + * fs/iso9660.c: Likewise. + * fs/jfs.c: Likewise. + * fs/minix.c: Likewise. + * fs/ntfs.c: Likewise. + * fs/reiserfs.c: Likewise. + * fs/sfs.c: Likewise. + * fs/udf.c: Likewise. + * fs/ufs.c: Likewise. + * fs/xfs.c: Likewise. + * include/grub/dl.h: Likewise. + * loader/xnu.c: Likewise. + 2009-05-04 Pavel Roskin * commands/acpi.c: Remove unused variable my_mod. diff --git a/commands/parttool.c b/commands/parttool.c index b4cbf0051..58751ca2f 100644 --- a/commands/parttool.c +++ b/commands/parttool.c @@ -46,10 +46,8 @@ grub_parttool_register(const char *part_name, struct grub_parttool *cur; int nargs = 0; -#ifndef GRUB_UTIL if (! parts) grub_dl_ref (mymod); -#endif cur = (struct grub_parttool *) grub_malloc (sizeof (struct grub_parttool)); cur->next = parts; @@ -89,10 +87,8 @@ grub_parttool_unregister (int handle) prev = cur; cur = cur->next; } -#ifndef GRUB_UTIL if (! parts) grub_dl_unref (mymod); -#endif } static grub_err_t diff --git a/fs/affs.c b/fs/affs.c index 4ddc347c8..8b7bc022e 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -104,9 +104,7 @@ struct grub_affs_data int htsize; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static grub_disk_addr_t @@ -392,9 +390,7 @@ grub_affs_open (struct grub_file *file, const char *name) struct grub_affs_data *data; struct grub_fshelp_node *fdiro = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_affs_mount (file->device->disk); if (!data) @@ -419,9 +415,7 @@ grub_affs_open (struct grub_file *file, const char *name) grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -432,9 +426,7 @@ grub_affs_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -477,9 +469,7 @@ grub_affs_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_affs_mount (device->disk); if (!data) @@ -497,9 +487,7 @@ grub_affs_dir (grub_device_t device, const char *path, grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -512,9 +500,7 @@ grub_affs_label (grub_device_t device, char **label) struct grub_affs_file file; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_affs_mount (disk); if (data) @@ -533,9 +519,7 @@ grub_affs_label (grub_device_t device, char **label) else *label = 0; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -557,9 +541,7 @@ static struct grub_fs grub_affs_fs = GRUB_MOD_INIT(affs) { grub_fs_register (&grub_affs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(affs) diff --git a/fs/afs.c b/fs/afs.c index 90d88644a..d710095b4 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -175,9 +175,7 @@ struct grub_afs_data struct grub_fshelp_node diropen; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static grub_afs_off_t grub_afs_run_to_num (struct grub_afs_sblock *sb, @@ -505,9 +503,7 @@ grub_afs_open (struct grub_file *file, const char *name) struct grub_afs_data *data; struct grub_fshelp_node *fdiro = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_afs_mount (file->device->disk); if (! data) @@ -532,9 +528,7 @@ fail: grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -553,9 +547,7 @@ grub_afs_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -583,9 +575,7 @@ grub_afs_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_afs_mount (device->disk); if (! data) @@ -603,9 +593,7 @@ grub_afs_dir (grub_device_t device, const char *path, grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -623,9 +611,7 @@ static struct grub_fs grub_afs_fs = { GRUB_MOD_INIT (afs) { grub_fs_register (&grub_afs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI (afs) diff --git a/fs/cpio.c b/fs/cpio.c index bedd65ee0..7a49fc137 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -74,9 +74,7 @@ struct grub_cpio_data grub_uint32_t size; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static grub_err_t grub_cpio_find_file (struct grub_cpio_data *data, char **name, @@ -192,9 +190,7 @@ grub_cpio_dir (grub_device_t device, const char *path, const char *np; int len; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif prev = 0; @@ -251,9 +247,7 @@ fail: if (data) grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -266,9 +260,7 @@ grub_cpio_open (grub_file_t file, const char *name) char *fn; int i, j; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_cpio_mount (file->device->disk); if (!data) @@ -322,9 +314,7 @@ fail: if (data) grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -344,9 +334,7 @@ grub_cpio_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -370,9 +358,7 @@ GRUB_MOD_INIT (tar) #endif { grub_fs_register (&grub_cpio_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } #ifdef MODE_USTAR diff --git a/fs/ext2.c b/fs/ext2.c index ab50db010..596c85984 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -317,9 +317,7 @@ struct grub_ext2_data struct grub_fshelp_node diropen; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif @@ -725,9 +723,7 @@ grub_ext2_open (struct grub_file *file, const char *name) struct grub_ext2_data *data; struct grub_fshelp_node *fdiro = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ext2_mount (file->device->disk); if (! data) @@ -759,9 +755,7 @@ grub_ext2_open (struct grub_file *file, const char *name) grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -771,9 +765,7 @@ grub_ext2_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -825,9 +817,7 @@ grub_ext2_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ext2_mount (device->disk); if (! data) @@ -845,9 +835,7 @@ grub_ext2_dir (grub_device_t device, const char *path, grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -858,9 +846,7 @@ grub_ext2_label (grub_device_t device, char **label) struct grub_ext2_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ext2_mount (disk); if (data) @@ -868,9 +854,7 @@ grub_ext2_label (grub_device_t device, char **label) else *label = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -883,9 +867,7 @@ grub_ext2_uuid (grub_device_t device, char **uuid) struct grub_ext2_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ext2_mount (disk); if (data) @@ -900,9 +882,7 @@ grub_ext2_uuid (grub_device_t device, char **uuid) else *uuid = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -916,9 +896,7 @@ grub_ext2_mtime (grub_device_t device, grub_int32_t *tm) struct grub_ext2_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ext2_mount (disk); if (!data) @@ -926,9 +904,7 @@ grub_ext2_mtime (grub_device_t device, grub_int32_t *tm) else *tm = grub_le_to_cpu32 (data->sblock.utime); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -954,9 +930,7 @@ static struct grub_fs grub_ext2_fs = GRUB_MOD_INIT(ext2) { grub_fs_register (&grub_ext2_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(ext2) diff --git a/fs/fat.c b/fs/fat.c index 025319b3d..bd213d977 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -149,9 +149,7 @@ struct grub_fat_data grub_uint32_t uuid; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static int fat_log2 (unsigned x) @@ -692,9 +690,7 @@ grub_fat_dir (grub_device_t device, const char *path, char *dirname = 0; char *p; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_fat_mount (disk); if (! data) @@ -723,9 +719,7 @@ grub_fat_dir (grub_device_t device, const char *path, grub_free (dirname); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -736,9 +730,7 @@ grub_fat_open (grub_file_t file, const char *name) struct grub_fat_data *data = 0; char *p = (char *) name; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_fat_mount (file->device->disk); if (! data) @@ -767,9 +759,7 @@ grub_fat_open (grub_file_t file, const char *name) grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -786,9 +776,7 @@ grub_fat_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -810,9 +798,7 @@ grub_fat_label (grub_device_t device, char **label) return 0; } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_fat_mount (disk); if (! data) @@ -830,9 +816,7 @@ grub_fat_label (grub_device_t device, char **label) fail: -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -845,9 +829,7 @@ grub_fat_uuid (grub_device_t device, char **uuid) struct grub_fat_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_fat_mount (disk); if (data) @@ -859,9 +841,7 @@ grub_fat_uuid (grub_device_t device, char **uuid) else *uuid = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -883,9 +863,7 @@ static struct grub_fs grub_fat_fs = GRUB_MOD_INIT(fat) { grub_fs_register (&grub_fat_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(fat) diff --git a/fs/hfs.c b/fs/hfs.c index ef318d481..ca2e56156 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -159,9 +159,7 @@ struct grub_hfs_record int datalen; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static int grub_hfs_find_node (struct grub_hfs_data *, char *, grub_uint32_t, int, char *, int); @@ -972,9 +970,7 @@ grub_hfs_dir (grub_device_t device, const char *path, struct grub_hfs_data *data; struct grub_hfs_filerec frec; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_hfs_mount (device->disk); if (!data) @@ -995,9 +991,7 @@ grub_hfs_dir (grub_device_t device, const char *path, fail: grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -1010,18 +1004,14 @@ grub_hfs_open (struct grub_file *file, const char *name) struct grub_hfs_data *data; struct grub_hfs_filerec frec; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_hfs_mount (file->device->disk); if (grub_hfs_find_dir (data, name, &frec, 0)) { grub_free (data); -#ifndef GRUB_UTIL - grub_dl_unref (my_mod); -#endif + grub_dl_unref (my_mod); return grub_errno; } @@ -1029,9 +1019,7 @@ grub_hfs_open (struct grub_file *file, const char *name) { grub_free (data); grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a file"); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -1061,9 +1049,7 @@ grub_hfs_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return 0; } @@ -1102,9 +1088,7 @@ static struct grub_fs grub_hfs_fs = GRUB_MOD_INIT(hfs) { grub_fs_register (&grub_hfs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(hfs) diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 0a7bedde7..e74d20c06 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -226,9 +226,7 @@ struct grub_hfsplus_data int embedded_offset; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif /* Return the offset of the record with the index INDEX, in the node @@ -827,9 +825,7 @@ grub_hfsplus_open (struct grub_file *file, const char *name) struct grub_hfsplus_data *data; struct grub_fshelp_node *fdiro = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_hfsplus_mount (file->device->disk); if (!data) @@ -855,9 +851,7 @@ grub_hfsplus_open (struct grub_file *file, const char *name) grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -868,9 +862,7 @@ grub_hfsplus_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -916,9 +908,7 @@ grub_hfsplus_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_hfsplus_mount (device->disk); if (!data) @@ -939,9 +929,7 @@ grub_hfsplus_dir (grub_device_t device, const char *path, grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -964,9 +952,7 @@ grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm) struct grub_hfsplus_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_hfsplus_mount (disk); if (!data) @@ -974,9 +960,7 @@ grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm) else *tm = grub_be_to_cpu32 (data->volheader.utime) - 2082844800; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -990,9 +974,7 @@ grub_hfsplus_uuid (grub_device_t device, char **uuid) struct grub_hfsplus_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_hfsplus_mount (disk); if (data) @@ -1005,9 +987,7 @@ grub_hfsplus_uuid (grub_device_t device, char **uuid) else *uuid = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -1032,9 +1012,7 @@ static struct grub_fs grub_hfsplus_fs = GRUB_MOD_INIT(hfsplus) { grub_fs_register (&grub_hfsplus_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(hfsplus) diff --git a/fs/iso9660.c b/fs/iso9660.c index 2278fdcc5..140d8c213 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -150,9 +150,7 @@ struct grub_fshelp_node unsigned int dir_off; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif /* Iterate over the susp entries, starting with block SUA_BLOCK on the @@ -688,9 +686,7 @@ grub_iso9660_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_iso9660_mount (device->disk); if (! data) @@ -717,9 +713,7 @@ grub_iso9660_dir (grub_device_t device, const char *path, fail: grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -733,9 +727,7 @@ grub_iso9660_open (struct grub_file *file, const char *name) struct grub_fshelp_node rootnode; struct grub_fshelp_node *foundnode; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_iso9660_mount (file->device->disk); if (!data) @@ -763,9 +755,7 @@ grub_iso9660_open (struct grub_file *file, const char *name) return 0; fail: -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -796,9 +786,7 @@ grub_iso9660_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -832,9 +820,7 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) struct grub_iso9660_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_iso9660_mount (disk); if (data) @@ -868,9 +854,7 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) else *uuid = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -894,9 +878,7 @@ static struct grub_fs grub_iso9660_fs = GRUB_MOD_INIT(iso9660) { grub_fs_register (&grub_iso9660_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(iso9660) diff --git a/fs/jfs.c b/fs/jfs.c index 3b5520fed..818700552 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -229,9 +229,7 @@ struct grub_jfs_diropen } __attribute__ ((packed)); -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static grub_err_t grub_jfs_lookup_symlink (struct grub_jfs_data *data, int ino); @@ -734,9 +732,7 @@ grub_jfs_dir (grub_device_t device, const char *path, struct grub_jfs_data *data = 0; struct grub_jfs_diropen *diro = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_jfs_mount (device->disk); if (!data) @@ -773,9 +769,7 @@ grub_jfs_dir (grub_device_t device, const char *path, grub_jfs_closedir (diro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -787,9 +781,7 @@ grub_jfs_open (struct grub_file *file, const char *name) { struct grub_jfs_data *data; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_jfs_mount (file->device->disk); if (!data) @@ -814,9 +806,7 @@ grub_jfs_open (struct grub_file *file, const char *name) fail: -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -839,9 +829,7 @@ grub_jfs_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -876,9 +864,7 @@ static struct grub_fs grub_jfs_fs = GRUB_MOD_INIT(jfs) { grub_fs_register (&grub_jfs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(jfs) diff --git a/fs/minix.c b/fs/minix.c index 0789718a1..2b30c5447 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -112,9 +112,7 @@ struct grub_minix_data int filename_size; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static grub_err_t grub_minix_find_file (struct grub_minix_data *data, const char *path); @@ -607,9 +605,7 @@ static struct grub_fs grub_minix_fs = GRUB_MOD_INIT(minix) { grub_fs_register (&grub_minix_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(minix) diff --git a/fs/ntfs.c b/fs/ntfs.c index 5d1815927..e039be0f2 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -25,9 +25,7 @@ #include #include -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif ntfscomp_func_t grub_ntfscomp_func; @@ -885,10 +883,7 @@ grub_ntfs_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif - data = grub_ntfs_mount (device->disk); if (!data) @@ -915,9 +910,7 @@ fail: grub_free (data); } -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -928,9 +921,7 @@ grub_ntfs_open (grub_file_t file, const char *name) struct grub_ntfs_data *data = 0; struct grub_fshelp_node *mft = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ntfs_mount (file->device->disk); if (!data) @@ -968,9 +959,7 @@ fail: grub_free (data); } -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -1011,9 +1000,7 @@ grub_ntfs_close (grub_file_t file) grub_free (data); } -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -1025,9 +1012,7 @@ grub_ntfs_label (grub_device_t device, char **label) struct grub_fshelp_node *mft = 0; char *pa; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif *label = 0; @@ -1079,9 +1064,7 @@ fail: grub_free (data); } -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -1092,9 +1075,7 @@ grub_ntfs_uuid (grub_device_t device, char **uuid) struct grub_ntfs_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ntfs_mount (disk); if (data) @@ -1105,9 +1086,7 @@ grub_ntfs_uuid (grub_device_t device, char **uuid) else *uuid = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -1128,9 +1107,7 @@ static struct grub_fs grub_ntfs_fs = { GRUB_MOD_INIT (ntfs) { grub_fs_register (&grub_ntfs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI (ntfs) diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 16a9e0483..30bd8723d 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -60,9 +60,7 @@ #define S_IFLNK 0xA000 -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif #define assert(boolean) real_assert (boolean, __FILE__, __LINE__) static inline void @@ -986,9 +984,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name) grub_uint32_t block_number; grub_uint16_t entry_version, block_size, entry_location; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_reiserfs_mount (file->device->disk); if (! data) goto fail; @@ -1061,9 +1057,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name) assert (grub_errno != GRUB_ERR_NONE); grub_free (found); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -1257,9 +1251,7 @@ grub_reiserfs_close (grub_file_t file) grub_free (data); grub_free (node); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -1287,9 +1279,7 @@ grub_reiserfs_dir (grub_device_t device, const char *path, grub_free (node); return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_reiserfs_mount (device->disk); if (! data) goto fail; @@ -1311,16 +1301,12 @@ grub_reiserfs_dir (grub_device_t device, const char *path, goto fail; grub_reiserfs_iterate_dir (found, iterate); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; fail: grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -1347,9 +1333,7 @@ grub_reiserfs_uuid (grub_device_t device, char **uuid) struct grub_reiserfs_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_reiserfs_mount (disk); if (data) @@ -1364,9 +1348,7 @@ grub_reiserfs_uuid (grub_device_t device, char **uuid) else *uuid = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -1388,9 +1370,7 @@ static struct grub_fs grub_reiserfs_fs = GRUB_MOD_INIT(reiserfs) { grub_fs_register (&grub_reiserfs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(reiserfs) diff --git a/fs/sfs.c b/fs/sfs.c index 314a6fd1d..8dc5951df 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -135,9 +135,7 @@ struct grub_sfs_data char *label; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif /* Lookup the extent starting with BLOCK in the filesystem described @@ -454,9 +452,7 @@ grub_sfs_open (struct grub_file *file, const char *name) struct grub_sfs_data *data; struct grub_fshelp_node *fdiro = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_sfs_mount (file->device->disk); if (!data) @@ -483,9 +479,7 @@ grub_sfs_open (struct grub_file *file, const char *name) grub_free (data->label); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -496,9 +490,7 @@ grub_sfs_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -540,9 +532,7 @@ grub_sfs_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_sfs_mount (device->disk); if (!data) @@ -562,9 +552,7 @@ grub_sfs_dir (grub_device_t device, const char *path, grub_free (data->label); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -600,9 +588,7 @@ static struct grub_fs grub_sfs_fs = GRUB_MOD_INIT(sfs) { grub_fs_register (&grub_sfs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(sfs) diff --git a/fs/udf.c b/fs/udf.c index bbad458fc..53fb63b19 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -356,9 +356,7 @@ struct grub_fshelp_node int part_ref; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif static grub_uint32_t grub_udf_get_block (struct grub_udf_data *data, @@ -790,9 +788,7 @@ grub_udf_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_udf_mount (device->disk); if (!data) @@ -814,9 +810,7 @@ grub_udf_dir (grub_device_t device, const char *path, fail: grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -828,9 +822,7 @@ grub_udf_open (struct grub_file *file, const char *name) struct grub_fshelp_node rootnode; struct grub_fshelp_node *foundnode; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_udf_mount (file->device->disk); if (!data) @@ -851,9 +843,7 @@ grub_udf_open (struct grub_file *file, const char *name) return 0; fail: -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -879,9 +869,7 @@ grub_udf_close (grub_file_t file) grub_free (node); } -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -916,9 +904,7 @@ static struct grub_fs grub_udf_fs = { GRUB_MOD_INIT (udf) { grub_fs_register (&grub_udf_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI (udf) diff --git a/fs/ufs.c b/fs/ufs.c index b79944950..562bf7b25 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -207,9 +207,7 @@ struct grub_ufs_data int linknest; }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif /* Forward declaration. */ static grub_err_t grub_ufs_find_file (struct grub_ufs_data *data, @@ -720,9 +718,7 @@ grub_ufs_label (grub_device_t device, char **label) { struct grub_ufs_data *data = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif *label = 0; @@ -733,9 +729,7 @@ grub_ufs_label (grub_device_t device, char **label) *label = grub_strdup ((char *) data->sblock.volume_name); } -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -748,9 +742,7 @@ grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) { struct grub_ufs_data *data = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_ufs_mount (device->disk); if (!data) @@ -760,9 +752,7 @@ grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) else *tm = grub_le_to_cpu64 (data->sblock.mtime2); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -786,9 +776,7 @@ static struct grub_fs grub_ufs_fs = GRUB_MOD_INIT(ufs) { grub_fs_register (&grub_ufs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(ufs) diff --git a/fs/xfs.c b/fs/xfs.c index a5c2d42f5..3907abc92 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -148,9 +148,7 @@ struct grub_xfs_data }; -#ifndef GRUB_UTIL static grub_dl_t my_mod; -#endif @@ -641,9 +639,7 @@ grub_xfs_dir (grub_device_t device, const char *path, return hook (filename, &info); } -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_xfs_mount (device->disk); if (!data) @@ -661,9 +657,7 @@ grub_xfs_dir (grub_device_t device, const char *path, grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; @@ -678,9 +672,7 @@ grub_xfs_open (struct grub_file *file, const char *name) struct grub_xfs_data *data; struct grub_fshelp_node *fdiro = 0; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_xfs_mount (file->device->disk); if (!data) @@ -714,9 +706,7 @@ grub_xfs_open (struct grub_file *file, const char *name) grub_free (fdiro); grub_free (data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return grub_errno; } @@ -738,9 +728,7 @@ grub_xfs_close (grub_file_t file) { grub_free (file->data); -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif return GRUB_ERR_NONE; } @@ -752,9 +740,7 @@ grub_xfs_label (grub_device_t device, char **label) struct grub_xfs_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_xfs_mount (disk); if (data) @@ -762,9 +748,7 @@ grub_xfs_label (grub_device_t device, char **label) else *label = 0; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -777,9 +761,7 @@ grub_xfs_uuid (grub_device_t device, char **uuid) struct grub_xfs_data *data; grub_disk_t disk = device->disk; -#ifndef GRUB_UTIL grub_dl_ref (my_mod); -#endif data = grub_xfs_mount (disk); if (data) @@ -794,9 +776,7 @@ grub_xfs_uuid (grub_device_t device, char **uuid) else *uuid = NULL; -#ifndef GRUB_UTIL grub_dl_unref (my_mod); -#endif grub_free (data); @@ -820,9 +800,7 @@ static struct grub_fs grub_xfs_fs = GRUB_MOD_INIT(xfs) { grub_fs_register (&grub_xfs_fs); -#ifndef GRUB_UTIL my_mod = mod; -#endif } GRUB_MOD_FINI(xfs) diff --git a/include/grub/dl.h b/include/grub/dl.h index 5e463747b..4ff6240d8 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -82,8 +82,23 @@ grub_dl_t grub_dl_load_core (void *addr, grub_size_t size); int EXPORT_FUNC(grub_dl_unload) (grub_dl_t mod); void grub_dl_unload_unneeded (void); void grub_dl_unload_all (void); +#ifdef GRUB_UTIL +static inline int +grub_dl_ref (grub_dl_t mod) +{ + (void) mod; + return 0; +} +static inline int +grub_dl_unref (grub_dl_t mod) +{ + (void) mod; + return 0; +} +#else int EXPORT_FUNC(grub_dl_ref) (grub_dl_t mod); int EXPORT_FUNC(grub_dl_unref) (grub_dl_t mod); +#endif void EXPORT_FUNC(grub_dl_iterate) (int (*hook) (grub_dl_t mod)); grub_dl_t EXPORT_FUNC(grub_dl_get) (const char *name); grub_err_t EXPORT_FUNC(grub_dl_register_symbol) (const char *name, void *addr, diff --git a/loader/xnu.c b/loader/xnu.c index 2b6ffa42c..18264bcf0 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -1306,20 +1306,16 @@ grub_cmd_xnu_resume (grub_command_t cmd __attribute__ ((unused)), void grub_xnu_lock () { -#ifndef GRUB_UTIL if (!locked) grub_dl_ref (my_mod); -#endif locked = 1; } void grub_xnu_unlock () { -#ifndef GRUB_UTIL if (locked) grub_dl_unref (my_mod); -#endif locked = 0; } From eef73c8a731e27a1dadfe7ab000aad82ecee74a8 Mon Sep 17 00:00:00 2001 From: davem Date: Tue, 5 May 2009 18:54:36 +0000 Subject: [PATCH 0729/1707] * util/sparc64/ieee1275/grub-install.in: Fix sed arg quoting. --- ChangeLog | 4 ++++ util/sparc64/ieee1275/grub-install.in | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60a10dc33..cf9196a4a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-05 David S. Miller + + * util/sparc64/ieee1275/grub-install.in: Fix sed arg quoting. + 2009-05-05 Pavel Roskin * include/grub/dl.h [GRUB_UTIL]: Provide inline implementations diff --git a/util/sparc64/ieee1275/grub-install.in b/util/sparc64/ieee1275/grub-install.in index a174050b4..5cfb858d7 100644 --- a/util/sparc64/ieee1275/grub-install.in +++ b/util/sparc64/ieee1275/grub-install.in @@ -237,8 +237,8 @@ if [ "x${devabstraction_module}" = "x" ] ; then grub_drive="`$grub_probe --target=drive --device ${grub_device}`" # Strip partition number - install_drive="`echo ${install_drive} | sed -e s/\([^\]\),[0-9]*/\1/g`" - grub_drive="`echo ${grub_drive} | sed -e s/\([^\]\),[0-9]*/\1/g`" + install_drive="`echo ${install_drive} | sed -e 's/\([^\]\),[0-9]*/\1/g'`" + grub_drive="`echo ${grub_drive} | sed -e 's/\([^\]\),[0-9]*/\1/g'`" if [ "x${grub_drive}" != "x${install_drive}" ] ; then uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" if [ "x${uuid}" = "x" ] ; then From 96613b6258159d7cd0aead51aa351db8f5732ab9 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 5 May 2009 19:28:28 +0000 Subject: [PATCH 0730/1707] 2009-05-05 Felix Zielcke * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `kern/rescue_reader.c' and `kern/rescue_parser.c'. --- ChangeLog | 5 +++++ conf/powerpc-ieee1275.rmk | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index cf9196a4a..9c6dfb0a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-05 Felix Zielcke + + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add + `kern/rescue_reader.c' and `kern/rescue_parser.c'. + 2009-05-05 David S. Miller * util/sparc64/ieee1275/grub-install.in: Fix sed arg quoting. diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 53bffa6de..6bb836e72 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -56,6 +56,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/reader.c \ + kern/rescue_reader.c kern/rescue_parser.c \ kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ lib/arg.c normal/cmdline.c normal/datetime.c \ From 1905c57b0e6602bdb7902291499e1dd5916e7d20 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 5 May 2009 19:32:27 +0000 Subject: [PATCH 0731/1707] 2009-05-05 Felix Zielcke * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add `normal/autofs.c'. --- ChangeLog | 2 +- conf/powerpc-ieee1275.rmk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9c6dfb0a4..2203b68f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2009-05-05 Felix Zielcke * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add - `kern/rescue_reader.c' and `kern/rescue_parser.c'. + `kern/rescue_reader.c', `kern/rescue_parser.c' and `normal/autofs.c'. 2009-05-05 David S. Miller diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 6bb836e72..3c257894c 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ lib/arg.c normal/cmdline.c normal/datetime.c \ normal/completion.c normal/misc.c \ - normal/handler.c normal/main.c \ + normal/handler.c normal/autofs.c normal/main.c \ normal/menu.c \ normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c \ From 29aa5e8163ad1e91fe97030a747e3ec3ae287f9e Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 6 May 2009 11:56:17 +0000 Subject: [PATCH 0732/1707] 2009-05-06 Robert Millan * util/i386/pc/grub-setup.c (setup): Fix check for embed region existance. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2203b68f5..0675a98e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-06 Robert Millan + + * util/i386/pc/grub-setup.c (setup): Fix check for embed region + existance. + 2009-05-05 Felix Zielcke * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Add diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 2ac8af642..10ce04148 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -317,7 +317,7 @@ setup (const char *dir, { grub_partition_iterate (dest_dev->disk, find_usable_region); - if (embed_region.end != 0) + if (embed_region.end != embed_region.start) embedding_area_exists = 1; /* If there is enough space... */ From 172800ce74c9ecc2b5bc9d20c8917ae9025534ac Mon Sep 17 00:00:00 2001 From: davem Date: Fri, 8 May 2009 09:43:54 +0000 Subject: [PATCH 0733/1707] * util/sparc64/ieee1275/grub-ofpathname.c (main): Set progname. --- ChangeLog | 4 ++++ util/sparc64/ieee1275/grub-ofpathname.c | 2 ++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0675a98e8..e3ef70ade 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-08 David S. Miller + + * util/sparc64/ieee1275/grub-ofpathname.c (main): Set progname. + 2009-05-06 Robert Millan * util/i386/pc/grub-setup.c (setup): Fix check for embed region diff --git a/util/sparc64/ieee1275/grub-ofpathname.c b/util/sparc64/ieee1275/grub-ofpathname.c index 092826c21..358608b02 100644 --- a/util/sparc64/ieee1275/grub-ofpathname.c +++ b/util/sparc64/ieee1275/grub-ofpathname.c @@ -24,6 +24,8 @@ int main(int argc, char **argv) { char *of_path; + progname = "grub-ofpathname"; + if (argc != 2) { printf("Usage: grub-ofpathname DEVICE\n"); From 041b8094acbbe7c523b2e81f8ddf56329070439c Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 8 May 2009 19:21:26 +0000 Subject: [PATCH 0734/1707] 2009-05-08 Pavel Roskin * disk/raid6_recover.c (grub_raid6_recover): Fix warnings about uninitialized err[0] and err[1]. Rename them to bad1 and bad2. Initialize them with -1. Add sanity check for bad1. Eliminate nerr variable. --- ChangeLog | 7 +++++++ disk/raid6_recover.c | 24 +++++++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index e3ef70ade..724b1c3ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-08 Pavel Roskin + + * disk/raid6_recover.c (grub_raid6_recover): Fix warnings about + uninitialized err[0] and err[1]. Rename them to bad1 and bad2. + Initialize them with -1. Add sanity check for bad1. Eliminate + nerr variable. + 2009-05-08 David S. Miller * util/sparc64/ieee1275/grub-ofpathname.c (main): Set progname. diff --git a/disk/raid6_recover.c b/disk/raid6_recover.c index 3cb08abfe..3a994afeb 100644 --- a/disk/raid6_recover.c +++ b/disk/raid6_recover.c @@ -92,7 +92,7 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, char *buf, grub_disk_addr_t sector, int size) { int i, q, pos; - int err[2], nerr; + int bad1 = -1, bad2 = -1; char *pbuf = 0, *qbuf = 0; size <<= GRUB_DISK_SECTOR_BITS; @@ -115,11 +115,10 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, if (pos == (int) array->total_devs) pos = 0; - nerr = 1; for (i = 0; i < (int) array->total_devs - 2; i++) { if (pos == disknr) - err[0] = i; + bad1 = i; else { if ((array->device[pos]) && @@ -131,10 +130,11 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, } else { - if (nerr >= 2) + /* Too many bad devices */ + if (bad2 >= 0) goto quit; - err[nerr++] = i; + bad2 = i; grub_errno = GRUB_ERR_NONE; } } @@ -144,8 +144,13 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, pos = 0; } - if (nerr == 1) + /* Invalid disknr or p */ + if (bad1 < 0) + goto quit; + + if (bad2 < 0) { + /* One bad device */ if ((array->device[p]) && (! grub_disk_read (array->device[p], sector, 0, size, buf))) { @@ -164,11 +169,12 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, goto quit; grub_raid_block_xor (buf, qbuf, size); - grub_raid_block_mul (raid6_table2[255 - err[0]][255 - err[0]], buf, + grub_raid_block_mul (raid6_table2[255 - bad1][255 - bad1], buf, size); } else { + /* Two bad devices */ grub_uint8_t c; if ((! array->device[p]) || (! array->device[q])) @@ -187,10 +193,10 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, grub_raid_block_xor (qbuf, buf, size); - c = raid6_table2[err[1]][err[0]]; + c = raid6_table2[bad2][bad1]; grub_raid_block_mul (c, qbuf, size); - c = raid6_table1[raid6_table2[err[1]][err[1]]][c]; + c = raid6_table1[raid6_table2[bad2][bad2]][c]; grub_raid_block_mul (c, pbuf, size); grub_raid_block_xor (pbuf, qbuf, size); From 752473c2b04f54baa386c7007dc219856aaa22ba Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 8 May 2009 19:29:04 +0000 Subject: [PATCH 0735/1707] 2009-05-08 Pavel Roskin * disk/raid.c (grub_raid_block_xor): Make buf2 constant, it's not modified. --- ChangeLog | 3 +++ disk/raid.c | 7 ++++--- include/grub/raid.h | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 724b1c3ba..2427e107e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-05-08 Pavel Roskin + * disk/raid.c (grub_raid_block_xor): Make buf2 constant, it's + not modified. + * disk/raid6_recover.c (grub_raid6_recover): Fix warnings about uninitialized err[0] and err[1]. Rename them to bad1 and bad2. Initialize them with -1. Add sanity check for bad1. Eliminate diff --git a/disk/raid.c b/disk/raid.c index 5cb412bf9..aac0f331a 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -172,12 +172,13 @@ grub_raid_close (grub_disk_t disk __attribute ((unused))) } void -grub_raid_block_xor (char *buf1, char *buf2, int size) +grub_raid_block_xor (char *buf1, const char *buf2, int size) { - grub_size_t *p1, *p2; + grub_size_t *p1; + const grub_size_t *p2; p1 = (grub_size_t *) buf1; - p2 = (grub_size_t *) buf2; + p2 = (const grub_size_t *) buf2; size /= GRUB_CPU_SIZEOF_VOID_P; while (size) diff --git a/include/grub/raid.h b/include/grub/raid.h index a36be6d95..595ced1d6 100644 --- a/include/grub/raid.h +++ b/include/grub/raid.h @@ -68,7 +68,7 @@ void grub_raid_register (grub_raid_t raid); void grub_raid_unregister (grub_raid_t raid); void grub_raid_rescan (void); -void grub_raid_block_xor (char *buf1, char *buf2, int size); +void grub_raid_block_xor (char *buf1, const char *buf2, int size); typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_raid_array *array, int disknr, char *buf, From 317e1a44b5bcbd1a28f48b63f7f7e20eceb3288c Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 8 May 2009 19:48:54 +0000 Subject: [PATCH 0736/1707] 2009-05-08 Robert Millan * util/i386/pc/grub-setup.c (setup): Factorize find_usable_region(), split in two functions (one for msdos and one for gpt). --- ChangeLog | 5 +++ util/i386/pc/grub-setup.c | 81 +++++++++++++++++++++++---------------- 2 files changed, 54 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2427e107e..c307abe68 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-08 Robert Millan + + * util/i386/pc/grub-setup.c (setup): Factorize find_usable_region(), + split in two functions (one for msdos and one for gpt). + 2009-05-08 Pavel Roskin * disk/raid.c (grub_raid_block_xor): Make buf2 constant, it's diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 10ce04148..f0f79f419 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -93,6 +93,7 @@ setup (const char *dir, size_t boot_size, core_size; grub_uint16_t core_sectors; grub_device_t root_dev, dest_dev; + const char *dest_partmap; grub_uint8_t *boot_drive, *root_drive; grub_disk_addr_t *kernel_sector; grub_uint16_t *boot_drive_check; @@ -116,38 +117,41 @@ setup (const char *dir, auto void NESTED_FUNC_ATTR save_blocklists (grub_disk_addr_t sector, unsigned offset, unsigned length); - auto int find_usable_region (grub_disk_t disk, - const grub_partition_t p); - int find_usable_region (grub_disk_t disk __attribute__ ((unused)), - const grub_partition_t p) + auto int NESTED_FUNC_ATTR find_usable_region_msdos (grub_disk_t disk, + const grub_partition_t p); + int NESTED_FUNC_ATTR find_usable_region_msdos (grub_disk_t disk __attribute__ ((unused)), + const grub_partition_t p) { - if (! strcmp (p->partmap->name, "pc_partition_map")) + struct grub_pc_partition *pcdata = p->data; + + /* There's always an embed region, and it starts right after the MBR. */ + embed_region.start = 1; + + /* For its end offset, include as many dummy partitions as we can. */ + if (! grub_pc_partition_is_empty (pcdata->dos_type) + && ! grub_pc_partition_is_bsd (pcdata->dos_type) + && embed_region.end > p->start) + embed_region.end = p->start; + + return 1; + } + + auto int NESTED_FUNC_ATTR find_usable_region_gpt (grub_disk_t disk, + const grub_partition_t p); + int NESTED_FUNC_ATTR find_usable_region_gpt (grub_disk_t disk __attribute__ ((unused)), + const grub_partition_t p) + { + struct grub_gpt_partentry *gptdata = p->data; + + /* If there's an embed region, it is in a dedicated partition. */ + if (! memcmp (&gptdata->type, &grub_gpt_partition_type_bios_boot, 16)) { - struct grub_pc_partition *pcdata = p->data; + embed_region.start = p->start; + embed_region.end = p->start + p->len; - /* There's always an embed region, and it starts right after the MBR. */ - embed_region.start = 1; - - /* For its end offset, include as many dummy partitions as we can. */ - if (! grub_pc_partition_is_empty (pcdata->dos_type) - && ! grub_pc_partition_is_bsd (pcdata->dos_type) - && embed_region.end > p->start) - embed_region.end = p->start; + return 1; } - else - { - struct grub_gpt_partentry *gptdata = p->data; - - /* If there's an embed region, it is in a dedicated partition. */ - if (! memcmp (&gptdata->type, &grub_gpt_partition_type_bios_boot, 16)) - { - embed_region.start = p->start; - embed_region.end = p->start + p->len; - - return 1; - } - } - + return 0; } @@ -315,11 +319,24 @@ setup (const char *dir, try to embed the core image into after the MBR. */ if (dest_dev->disk->has_partitions && ! dest_dev->disk->partition) { - grub_partition_iterate (dest_dev->disk, find_usable_region); + /* Unlike root_dev, with dest_dev we're interested in the partition map even + if dest_dev itself is a whole disk. */ + auto int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk, + const grub_partition_t p); + int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk __attribute__ ((unused)), + const grub_partition_t p) + { + dest_partmap = p->partmap->name; + return 1; + } + grub_partition_iterate (dest_dev->disk, identify_partmap); + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? + find_usable_region_gpt : find_usable_region_msdos)); + if (embed_region.end != embed_region.start) embedding_area_exists = 1; - + /* If there is enough space... */ if ((unsigned long) core_sectors <= embed_region.end - embed_region.start) { @@ -359,9 +376,9 @@ setup (const char *dir, goto finish; } } - + /* If we reached this point, it means we were unable to embed. */ - + if (embedding_area_exists) grub_util_warn ("Embedding area is too small for core.img."); else From b4ba690abde76f834db0c46c7eab80fd722e64a0 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 9 May 2009 10:58:43 +0000 Subject: [PATCH 0737/1707] 2009-05-09 Vladimir Serbinenko Fixed grub-emu * kern/dl.c (grub_dl_ref): omit when compiling grub-emu (grub_dl_ref): likewise --- ChangeLog | 7 +++++++ kern/dl.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c307abe68..20a083d99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-09 Vladimir Serbinenko + + Fixed grub-emu + + * kern/dl.c (grub_dl_ref): omit when compiling grub-emu + (grub_dl_ref): likewise + 2009-05-08 Robert Millan * util/i386/pc/grub-setup.c (setup): Factorize find_usable_region(), diff --git a/kern/dl.c b/kern/dl.c index 458ad589f..84c465ccb 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -480,6 +480,7 @@ grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e) return GRUB_ERR_NONE; } +#ifndef GRUB_UTIL int grub_dl_ref (grub_dl_t mod) { @@ -501,6 +502,7 @@ grub_dl_unref (grub_dl_t mod) return --mod->ref_count; } +#endif static void grub_dl_flush_cache (grub_dl_t mod) From 2eac4c161186e3334312692b9bc9e8f5806aa694 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 9 May 2009 11:04:08 +0000 Subject: [PATCH 0738/1707] 2009-05-09 Vladimir Serbinenko gptsync * commands/gptsync.c: new file * conf/common.rmk (pkglib_MODULES): add gptsync.mod (gptsync_mod_SOURCES): new variable (gptsync_mod_CFLAGS): likewise (gptsync_mod_LDFLAGS): likewise * include/grub/pc_partition.h (GRUB_PC_PARTITION_TYPE_NTFS): new definition (GRUB_PC_PARTITION_TYPE_HFS): likewise * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/gptsync.c * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise --- ChangeLog | 17 +++ commands/gptsync.c | 255 ++++++++++++++++++++++++++++++++++++ conf/common.rmk | 7 +- conf/i386-coreboot.rmk | 1 + conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 3 +- include/grub/pc_partition.h | 2 + 8 files changed, 285 insertions(+), 4 deletions(-) create mode 100644 commands/gptsync.c diff --git a/ChangeLog b/ChangeLog index 20a083d99..b9beb6085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2009-05-09 Vladimir Serbinenko + + gptsync + + * commands/gptsync.c: new file + * conf/common.rmk (pkglib_MODULES): add gptsync.mod + (gptsync_mod_SOURCES): new variable + (gptsync_mod_CFLAGS): likewise + (gptsync_mod_LDFLAGS): likewise + * include/grub/pc_partition.h (GRUB_PC_PARTITION_TYPE_NTFS): + new definition + (GRUB_PC_PARTITION_TYPE_HFS): likewise + * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/gptsync.c + * conf/i386-ieee1275.rmk: likewise + * conf/i386-pc.rmk: likewise + * conf/powerpc-ieee1275.rmk: likewise + 2009-05-09 Vladimir Serbinenko Fixed grub-emu diff --git a/commands/gptsync.c b/commands/gptsync.c new file mode 100644 index 000000000..fed2499eb --- /dev/null +++ b/commands/gptsync.c @@ -0,0 +1,255 @@ +/* gptsync.c - fill the mbr based on gpt entries */ +/* XXX: I don't know what to do if sector size isn't 512 bytes */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +/* Convert a LBA address to a CHS address in the INT 13 format. */ +/* Taken from grub1. */ +/* XXX: use hardcoded geometry of C = 1024, H = 255, S = 63. + Is it a problem? +*/ +static void +lba_to_chs (int lba, grub_uint8_t *cl, grub_uint8_t *ch, + grub_uint8_t *dh) +{ + int cylinder, head, sector; + int sectors = 63, heads = 255, cylinders = 1024; + + sector = lba % sectors + 1; + head = (lba / sectors) % heads; + cylinder = lba / (sectors * heads); + + if (cylinder >= cylinders) + { + *cl = *ch = *dh = 0xff; + return; + } + + *cl = sector | ((cylinder & 0x300) >> 2); + *ch = cylinder & 0xFF; + *dh = head; +} + +static grub_err_t +grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), + int argc, char **args) +{ + grub_device_t dev; + struct grub_pc_partition_mbr mbr; + struct grub_partition *partition; + grub_disk_addr_t first_sector; + int numactive = 0; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + if (argc > 4) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "only 3 partitions can be " + "in hybrid MBR"); + + if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') + { + args[0][grub_strlen (args[0]) - 1] = 0; + dev = grub_device_open (args[0] + 1); + args[0][grub_strlen (args[0])] = ')'; + } + else + dev = grub_device_open (args[0]); + + if (! dev) + return grub_errno; + + if (! dev->disk) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a disk"); + } + + /* Read the protective MBR. */ + if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr)) + { + grub_device_close (dev); + return grub_errno; + } + + /* Check if it is valid. */ + if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + } + + /* Make sure the MBR is a protective MBR and not a normal MBR. */ + if (mbr.entries[0].type != GRUB_PC_PARTITION_TYPE_GPT_DISK) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found"); + } + + int i; + first_sector = dev->disk->total_sectors; + for (i = 1; i < argc; i++) + { + char *separator, csep = 0; + grub_uint8_t type; + separator = grub_strchr (args[i], '+'); + if (! separator) + separator = grub_strchr (args[i], '-'); + if (separator) + { + csep = *separator; + *separator = 0; + } + partition = grub_partition_probe (dev->disk, args[i]); + if (separator) + *separator = csep; + if (! partition) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition"); + } + + if (partition->start + partition->len > 0xffffffff) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_OUT_OF_RANGE, + "only partitions resding in the first 2TB " + "can be presen in hybrid MBR"); + } + + + if (first_sector > partition->start) + first_sector = partition->start; + + if (separator && *(separator + 1)) + type = grub_strtoul (separator + 1, 0, 0); + else + { + grub_fs_t fs = 0; + dev->disk->partition = partition; + fs = grub_fs_probe (dev); + + /* Unknown filesystem isn't fatal. */ + if (grub_errno == GRUB_ERR_UNKNOWN_FS) + { + fs = 0; + grub_errno = GRUB_ERR_NONE; + } + + if (fs && grub_strcmp (fs->name, "ntfs") == 0) + type = GRUB_PC_PARTITION_TYPE_NTFS; + else if (fs && grub_strcmp (fs->name, "fat") == 0) + /* FIXME: detect FAT16. */ + type = GRUB_PC_PARTITION_TYPE_FAT32_LBA; + else if (fs && (grub_strcmp (fs->name, "hfsplus") == 0 + || grub_strcmp (fs->name, "hfs") == 0)) + type = GRUB_PC_PARTITION_TYPE_HFS; + else + /* FIXME: detect more types. */ + type = GRUB_PC_PARTITION_TYPE_EXT2FS; + + dev->disk->partition = 0; + } + + mbr.entries[i].flag = (csep == '+') ? 0x80 : 0; + if (csep == '+') + { + numactive++; + if (numactive == 2) + { + grub_device_close (dev); + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "only one partition can be active"); + } + } + mbr.entries[i].type = type; + mbr.entries[i].start = grub_cpu_to_le32 (partition->start); + lba_to_chs (partition->start, + &(mbr.entries[i].start_sector), + &(mbr.entries[i].start_cylinder), + &(mbr.entries[i].start_head)); + lba_to_chs (partition->start + partition->len - 1, + &(mbr.entries[i].end_sector), + &(mbr.entries[i].end_cylinder), + &(mbr.entries[i].end_head)); + mbr.entries[i].length = grub_cpu_to_le32 (partition->len); + grub_free (partition); + } + for (; i < 4; i++) + grub_memset (&(mbr.entries[i]), 0, sizeof (mbr.entries[i])); + + /* The protective partition. */ + if (first_sector > 0xffffffff) + first_sector = 0xffffffff; + else + first_sector--; + mbr.entries[0].flag = 0; + mbr.entries[0].type = GRUB_PC_PARTITION_TYPE_GPT_DISK; + mbr.entries[0].start = grub_cpu_to_le32 (1); + lba_to_chs (1, + &(mbr.entries[0].start_sector), + &(mbr.entries[0].start_cylinder), + &(mbr.entries[0].start_head)); + lba_to_chs (first_sector, + &(mbr.entries[0].end_sector), + &(mbr.entries[0].end_cylinder), + &(mbr.entries[0].end_head)); + mbr.entries[0].length = grub_cpu_to_le32 (first_sector); + + mbr.signature = grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE); + + if (grub_disk_write (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr)) + { + grub_device_close (dev); + return grub_errno; + } + + grub_printf ("New MBR is written to '%s'\n", args[0]); + + return GRUB_ERR_NONE; +} + + +static grub_command_t cmd; + +GRUB_MOD_INIT(gptsync) +{ + (void) mod; /* To stop warning. */ + cmd = grub_register_command ("gptsync", grub_cmd_gptsync, + "gptsync DEVICE [PARTITION[+/-[TYPE]]] ...", + "Fill hybrid MBR of GPT drive DEVICE. " + "specified partitions will be a part " + "of hybrid mbr. Up to 3 partitions are " + "allowed. TYPE is an MBR type. " + "+ means that partition is active. " + "Only one partition can be active"); +} + +GRUB_MOD_FINI(gptsync) +{ + grub_unregister_command (cmd); +} diff --git a/conf/common.rmk b/conf/common.rmk index 2335d8f8e..bca7f7806 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -343,7 +343,12 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - pcpart.mod memrw.mod boot.mod normal.mod sh.mod + pcpart.mod memrw.mod boot.mod normal.mod sh.mod gptsync.mod + +# For gptsync.mod. +gptsync_mod_SOURCES = commands/gptsync.c +gptsync_mod_CFLAGS = $(COMMON_CFLAGS) +gptsync_mod_LDFLAGS = $(COMMON_LDFLAGS) # For boot.mod. boot_mod_SOURCES = commands/boot.c diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 1f212346b..2f768c0fd 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -61,6 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ + commands/gptsync.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index b195f16d6..961e61617 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ - commands/i386/cpuid.c \ + commands/gptsync.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 046218cab..222b66228 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -125,7 +125,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ - commands/i386/cpuid.c \ + commands/gptsync.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c disk/scsi.c \ fs/fshelp.c \ \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 3c257894c..204d54a83 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -44,7 +44,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ - lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ + commands/gptsync.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/include/grub/pc_partition.h b/include/grub/pc_partition.h index 6a815c3ea..67c312e64 100644 --- a/include/grub/pc_partition.h +++ b/include/grub/pc_partition.h @@ -35,6 +35,7 @@ #define GRUB_PC_PARTITION_TYPE_FAT16_LT32M 4 #define GRUB_PC_PARTITION_TYPE_EXTENDED 5 #define GRUB_PC_PARTITION_TYPE_FAT16_GT32M 6 +#define GRUB_PC_PARTITION_TYPE_NTFS 7 #define GRUB_PC_PARTITION_TYPE_FAT32 0xb #define GRUB_PC_PARTITION_TYPE_FAT32_LBA 0xc #define GRUB_PC_PARTITION_TYPE_FAT16_LBA 0xe @@ -48,6 +49,7 @@ #define GRUB_PC_PARTITION_TYPE_FREEBSD 0xa5 #define GRUB_PC_PARTITION_TYPE_OPENBSD 0xa6 #define GRUB_PC_PARTITION_TYPE_NETBSD 0xa9 +#define GRUB_PC_PARTITION_TYPE_HFS 0xaf #define GRUB_PC_PARTITION_TYPE_GPT_DISK 0xee #define GRUB_PC_PARTITION_TYPE_LINUX_RAID 0xfd From 901d2f0c276fba15a9b499a844cf46ac60ffe0f9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 10 May 2009 15:43:58 +0000 Subject: [PATCH 0739/1707] 2009-05-10 Robert Millan * util/i386/pc/grub-install.in: Update copyright year. --- ChangeLog | 4 ++++ util/i386/pc/grub-install.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b9beb6085..05417b063 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-10 Robert Millan + + * util/i386/pc/grub-install.in: Update copyright year. + 2009-05-09 Vladimir Serbinenko gptsync diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 1558bc19a..468a72e08 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -1,7 +1,7 @@ #! /bin/sh # Install GRUB on your drive. -# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. +# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by From 238e871fff16c2fe0d8a1a32b5fd32c98ca61f9a Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 13 May 2009 18:58:38 +0000 Subject: [PATCH 0740/1707] 2009-05-13 Pavel Roskin * kernel/disk.c (grub_disk_read): Use void pointer for the buffer. (grub_disk_write): Use const void pointer for the buffer. Adjust all callers. Remove unnecessary casts. --- ChangeLog | 7 +++++++ commands/gptsync.c | 4 ++-- disk/dmraid_nvidia.c | 2 +- disk/mdraid_linux.c | 2 +- fs/affs.c | 12 ++++++------ fs/afs.c | 12 ++++++------ fs/cpio.c | 4 ++-- fs/ext2.c | 12 ++++++------ fs/fat.c | 4 ++-- fs/hfs.c | 8 ++++---- fs/hfsplus.c | 4 ++-- fs/jfs.c | 8 ++++---- fs/minix.c | 6 +++--- fs/ntfs.c | 2 +- fs/reiserfs.c | 10 +++++----- fs/sfs.c | 2 +- fs/udf.c | 14 +++++++------- fs/ufs.c | 12 ++++++------ fs/xfs.c | 6 +++--- include/grub/disk.h | 4 ++-- kern/disk.c | 10 +++++----- loader/i386/pc/chainloader.c | 2 +- partmap/acorn.c | 4 ++-- partmap/amiga.c | 4 ++-- partmap/apple.c | 4 ++-- partmap/gpt.c | 6 +++--- partmap/pc.c | 4 ++-- partmap/sun.c | 2 +- parttool/pcpart.c | 8 ++++---- 29 files changed, 93 insertions(+), 86 deletions(-) diff --git a/ChangeLog b/ChangeLog index 05417b063..733a07c97 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-13 Pavel Roskin + + * kernel/disk.c (grub_disk_read): Use void pointer for the + buffer. + (grub_disk_write): Use const void pointer for the buffer. + Adjust all callers. Remove unnecessary casts. + 2009-05-10 Robert Millan * util/i386/pc/grub-install.in: Update copyright year. diff --git a/commands/gptsync.c b/commands/gptsync.c index fed2499eb..73dafdeb3 100644 --- a/commands/gptsync.c +++ b/commands/gptsync.c @@ -90,7 +90,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), } /* Read the protective MBR. */ - if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr)) + if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), &mbr)) { grub_device_close (dev); return grub_errno; @@ -222,7 +222,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), mbr.signature = grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE); - if (grub_disk_write (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr)) + if (grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr)) { grub_device_close (dev); return grub_errno; diff --git a/disk/dmraid_nvidia.c b/disk/dmraid_nvidia.c index 119465109..76847556a 100644 --- a/disk/dmraid_nvidia.c +++ b/disk/dmraid_nvidia.c @@ -99,7 +99,7 @@ grub_dmraid_nv_detect (grub_disk_t disk, struct grub_raid_array *array) sector = grub_disk_get_size (disk) - 2; - if (grub_disk_read (disk, sector, 0, sizeof (sb), (char *) &sb)) + if (grub_disk_read (disk, sector, 0, sizeof (sb), &sb)) return grub_errno; if (grub_memcmp (sb.vendor, NV_ID_STRING, 6)) diff --git a/disk/mdraid_linux.c b/disk/mdraid_linux.c index f5eb84ca1..25a06804c 100644 --- a/disk/mdraid_linux.c +++ b/disk/mdraid_linux.c @@ -171,7 +171,7 @@ grub_mdraid_detect (grub_disk_t disk, struct grub_raid_array *array) size = grub_disk_get_size (disk); sector = NEW_SIZE_SECTORS (size); - if (grub_disk_read (disk, sector, 0, SB_BYTES, (char *) &sb)) + if (grub_disk_read (disk, sector, 0, SB_BYTES, &sb)) return grub_errno; /* Look whether there is a RAID superblock. */ diff --git a/fs/affs.c b/fs/affs.c index 8b7bc022e..4b729c207 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -124,7 +124,7 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) grub_disk_read (data->disk, block + data->blocksize - 1, data->blocksize * (GRUB_DISK_SECTOR_SIZE - GRUB_AFFS_FILE_LOCATION), - sizeof (file), (char *) &file); + sizeof (file), &file); if (grub_errno) return 0; @@ -136,7 +136,7 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) grub_disk_read (data->disk, block, GRUB_AFFS_BLOCKPTR_OFFSET + (data->htsize - fileblock - 1) * sizeof (pos), - sizeof (pos), (char *) &pos); + sizeof (pos), &pos); if (grub_errno) return 0; @@ -175,7 +175,7 @@ grub_affs_mount (grub_disk_t disk) /* Read the bootblock. */ grub_disk_read (disk, 0, 0, sizeof (struct grub_affs_bblock), - (char *) &data->bblock); + &data->bblock); if (grub_errno) goto fail; @@ -195,7 +195,7 @@ grub_affs_mount (grub_disk_t disk) /* Read the bootblock. */ grub_disk_read (disk, 0, 0, sizeof (struct grub_affs_bblock), - (char *) &data->bblock); + &data->bblock); if (grub_errno) goto fail; @@ -209,7 +209,7 @@ grub_affs_mount (grub_disk_t disk) /* Read the rootblock. */ grub_disk_read (disk, (disk->total_sectors >> 1) + blocksize, 0, - GRUB_DISK_SECTOR_SIZE * 16, (char *) rootblock); + GRUB_DISK_SECTOR_SIZE * 16, rootblock); if (grub_errno) goto fail; @@ -510,7 +510,7 @@ grub_affs_label (grub_device_t device, char **label) grub_disk_read (data->disk, disk->total_sectors >> 1, data->blocksize * (GRUB_DISK_SECTOR_SIZE - GRUB_AFFS_FILE_LOCATION), - sizeof (file), (char *) &file); + sizeof (file), &file); if (grub_errno) return 0; diff --git a/fs/afs.c b/fs/afs.c index d710095b4..ea1de4f21 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -193,7 +193,7 @@ grub_afs_read_inode (struct grub_afs_data *data, ino * (data->sblock.block_size >> GRUB_DISK_SECTOR_BITS), 0, sizeof (struct grub_afs_inode), - (char *) inode); + inode); } static grub_disk_addr_t @@ -228,7 +228,7 @@ grub_afs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) if (grub_disk_read (node->data->disk, blk * (sb->block_size >> GRUB_DISK_SECTOR_BITS), 0, sizeof (indir), - (char *) indir)) + indir)) return 0; for (j = 0; j < ptrs_per_blk; j++) @@ -264,14 +264,14 @@ grub_afs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) + idblk) * (sb->block_size >> GRUB_DISK_SECTOR_BITS), 0, sizeof (indir), - (char *) indir)) + indir)) return 0; if (grub_disk_read (node->data->disk, (grub_afs_run_to_num (sb, &indir[idptr]) + dblk) * (sb->block_size >> GRUB_DISK_SECTOR_BITS), 0, sizeof (indir), - (char *) indir)) + indir)) return 0; return grub_afs_run_to_num (sb, &indir[dptr]) + off; @@ -466,13 +466,13 @@ grub_afs_mount (grub_disk_t disk) /* Read the superblock. */ if (grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_afs_sblock), - (char *) &data->sblock)) + &data->sblock)) goto fail; if (! grub_afs_validate_sblock (&data->sblock)) { if (grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_afs_sblock), - (char *) &data->sblock)) + &data->sblock)) goto fail; if (! grub_afs_validate_sblock (&data->sblock)) diff --git a/fs/cpio.c b/fs/cpio.c index 7a49fc137..3ae93a01d 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -84,7 +84,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, struct HEAD_BCPIO hd; if (grub_disk_read - (data->disk, 0, data->hofs, sizeof (hd), (char *) &hd)) + (data->disk, 0, data->hofs, sizeof (hd), &hd)) return grub_errno; if (hd.magic != MAGIC_BCPIO) @@ -120,7 +120,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, struct HEAD_USTAR hd; if (grub_disk_read - (data->disk, 0, data->hofs, sizeof (hd), (char *) &hd)) + (data->disk, 0, data->hofs, sizeof (hd), &hd)) return grub_errno; if (!hd.name[0]) diff --git a/fs/ext2.c b/fs/ext2.c index 596c85984..93b6db218 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -331,7 +331,7 @@ grub_ext2_blockgroup (struct grub_ext2_data *data, int group, ((grub_le_to_cpu32 (data->sblock.first_data_block) + 1) << LOG2_EXT2_BLOCK_SIZE (data)), group * sizeof (struct grub_ext2_block_group), - sizeof (struct grub_ext2_block_group), (char *) blkgrp); + sizeof (struct grub_ext2_block_group), blkgrp); } static struct grub_ext4_extent_header * @@ -438,7 +438,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) if (grub_disk_read (data->disk, grub_le_to_cpu32 (inode->blocks.indir_block) << log2_blksz, - 0, blksz, (char *) indir)) + 0, blksz, indir)) return grub_errno; blknr = grub_le_to_cpu32 (indir[fileblock - INDIRECT_BLOCKS]); @@ -454,13 +454,13 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) if (grub_disk_read (data->disk, grub_le_to_cpu32 (inode->blocks.double_indir_block) << log2_blksz, - 0, blksz, (char *) indir)) + 0, blksz, indir)) return grub_errno; if (grub_disk_read (data->disk, grub_le_to_cpu32 (indir[rblock / perblock]) << log2_blksz, - 0, blksz, (char *) indir)) + 0, blksz, indir)) return grub_errno; @@ -523,7 +523,7 @@ grub_ext2_read_inode (struct grub_ext2_data *data, ((grub_le_to_cpu32 (blkgrp.inode_table_id) + blkno) << LOG2_EXT2_BLOCK_SIZE (data)), EXT2_INODE_SIZE (data) * blkoff, - sizeof (struct grub_ext2_inode), (char *) inode)) + sizeof (struct grub_ext2_inode), inode)) return grub_errno; return 0; @@ -540,7 +540,7 @@ grub_ext2_mount (grub_disk_t disk) /* Read the superblock. */ grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_ext2_sblock), - (char *) &data->sblock); + &data->sblock); if (grub_errno) goto fail; diff --git a/fs/fat.c b/fs/fat.c index bd213d977..a7d40dc86 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -183,7 +183,7 @@ grub_fat_mount (grub_disk_t disk) goto fail; /* Read the BPB. */ - if (grub_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb)) + if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb)) goto fail; if (grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT12", 5) @@ -294,7 +294,7 @@ grub_fat_mount (grub_disk_t disk) data->fat_sector, 0, sizeof (first_fat), - (char *) &first_fat)) + &first_fat)) goto fail; first_fat = grub_le_to_cpu32 (first_fat); diff --git a/fs/hfs.c b/fs/hfs.c index ca2e56156..056fce1fb 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -319,7 +319,7 @@ grub_hfs_mount (grub_disk_t disk) /* Read the superblock. */ if (grub_disk_read (disk, GRUB_HFS_SBLOCK, 0, - sizeof (struct grub_hfs_sblock), (char *) &data->sblock)) + sizeof (struct grub_hfs_sblock), &data->sblock)) goto fail; /* Check if this is a HFS filesystem. */ @@ -345,7 +345,7 @@ grub_hfs_mount (grub_disk_t disk) + grub_be_to_cpu16 (data->sblock.first_block)); if (grub_disk_read (data->disk, first_block, 0, - sizeof (treehead), (char *) &treehead)) + sizeof (treehead), &treehead)) goto fail; data->ext_root = grub_be_to_cpu32 (treehead.head.root_node); data->ext_size = grub_be_to_cpu16 (treehead.head.node_size); @@ -355,7 +355,7 @@ grub_hfs_mount (grub_disk_t disk) * GRUB_HFS_BLKS) + grub_be_to_cpu16 (data->sblock.first_block)); if (grub_disk_read (data->disk, first_block, 0, - sizeof (treehead), (char *) &treehead)) + sizeof (treehead), &treehead)) goto fail; data->cat_root = grub_be_to_cpu32 (treehead.head.root_node); data->cat_size = grub_be_to_cpu16 (treehead.head.node_size); @@ -684,7 +684,7 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, return grub_errno; if (grub_disk_read (data->disk, blk, 0, - sizeof (node), (char *) &node)) + sizeof (node), &node)) return grub_errno; /* Iterate over all records in this node. */ diff --git a/fs/hfsplus.c b/fs/hfsplus.c index e74d20c06..69794c9ac 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -389,7 +389,7 @@ grub_hfsplus_mount (grub_disk_t disk) /* Read the bootblock. */ grub_disk_read (disk, GRUB_HFSPLUS_SBLOCK, 0, sizeof (volheader), - (char *) &volheader); + &volheader); if (grub_errno) goto fail; @@ -416,7 +416,7 @@ grub_hfsplus_mount (grub_disk_t disk) * (ablk_size >> GRUB_DISK_SECTOR_BITS)); grub_disk_read (disk, data->embedded_offset + GRUB_HFSPLUS_SBLOCK, 0, - sizeof (volheader), (char *) &volheader); + sizeof (volheader), &volheader); if (grub_errno) goto fail; } diff --git a/fs/jfs.c b/fs/jfs.c index 818700552..4bb2af962 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -309,7 +309,7 @@ grub_jfs_read_inode (struct grub_jfs_data *data, int ino, if (grub_disk_read (data->disk, iagblk << (grub_le_to_cpu16 (data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS), 0, - sizeof (struct grub_jfs_iag), (char *) &iag)) + sizeof (struct grub_jfs_iag), &iag)) return grub_errno; inoblk = grub_le_to_cpu32 (iag.inodes[inoext].blk2); @@ -318,7 +318,7 @@ grub_jfs_read_inode (struct grub_jfs_data *data, int ino, inoblk += inonum; if (grub_disk_read (data->disk, inoblk, 0, - sizeof (struct grub_jfs_inode), (char *) inode)) + sizeof (struct grub_jfs_inode), inode)) return grub_errno; return 0; @@ -336,7 +336,7 @@ grub_jfs_mount (grub_disk_t disk) /* Read the superblock. */ if (grub_disk_read (disk, GRUB_JFS_SBLOCK, 0, - sizeof (struct grub_jfs_sblock), (char *) &data->sblock)) + sizeof (struct grub_jfs_sblock), &data->sblock)) goto fail; if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4)) @@ -351,7 +351,7 @@ grub_jfs_mount (grub_disk_t disk) /* Read the inode of the first fileset. */ if (grub_disk_read (data->disk, GRUB_JFS_FS1_INODE_BLK, 0, - sizeof (struct grub_jfs_inode), (char *) &data->fileset)) + sizeof (struct grub_jfs_inode), &data->fileset)) goto fail; return data; diff --git a/fs/minix.c b/fs/minix.c index 2b30c5447..279366bd2 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -267,7 +267,7 @@ grub_minix_read_inode (struct grub_minix_data *data, int ino) * sizeof (struct grub_minix_inode)); grub_disk_read (data->disk, block, offs, - sizeof (struct grub_minix_inode), (char *) &data->inode); + sizeof (struct grub_minix_inode), &data->inode); } else { @@ -278,7 +278,7 @@ grub_minix_read_inode (struct grub_minix_data *data, int ino) * sizeof (struct grub_minix2_inode)); grub_disk_read (data->disk, block, offs, - sizeof (struct grub_minix2_inode),(char *) &data->inode2); + sizeof (struct grub_minix2_inode),&data->inode2); } return GRUB_ERR_NONE; @@ -419,7 +419,7 @@ grub_minix_mount (grub_disk_t disk) /* Read the superblock. */ grub_disk_read (disk, GRUB_MINIX_SBLOCK, 0, - sizeof (struct grub_minix_sblock),(char *) &data->sblock); + sizeof (struct grub_minix_sblock),&data->sblock); if (grub_errno) goto fail; diff --git a/fs/ntfs.c b/fs/ntfs.c index e039be0f2..709c6d9ed 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -800,7 +800,7 @@ grub_ntfs_mount (grub_disk_t disk) data->disk = disk; /* Read the BPB. */ - if (grub_disk_read (disk, 0, 0, sizeof (bpb), (char *) &bpb)) + if (grub_disk_read (disk, 0, 0, sizeof (bpb), &bpb)) goto fail; if (grub_memcmp ((char *) &bpb.oem_name, "NTFS", 4)) diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 30bd8723d..9d5e9d891 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -510,7 +510,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, block_number * (block_size >> GRUB_DISK_SECTOR_BITS), (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), - block_size, (char *) block_header); + block_size, block_header); if (grub_errno) goto fail; current_level = grub_le_to_cpu16 (block_header->level); @@ -685,7 +685,7 @@ grub_reiserfs_mount (grub_disk_t disk) if (! data) goto fail; grub_disk_read (disk, REISERFS_SUPER_BLOCK_OFFSET / GRUB_DISK_SECTOR_SIZE, - 0, sizeof (data->superblock), (char *) &(data->superblock)); + 0, sizeof (data->superblock), &(data->superblock)); if (grub_errno) goto fail; if (grub_memcmp (data->superblock.magic_string, @@ -1028,7 +1028,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name) entry_location + (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), - sizeof (entry_v1_stat), (char *) &entry_v1_stat); + sizeof (entry_v1_stat), &entry_v1_stat); if (grub_errno) goto fail; file->size = (grub_off_t) grub_le_to_cpu64 (entry_v1_stat.size); @@ -1041,7 +1041,7 @@ grub_reiserfs_open (struct grub_file *file, const char *name) entry_location + (((grub_off_t) block_number * block_size) & (GRUB_DISK_SECTOR_SIZE - 1)), - sizeof (entry_v2_stat), (char *) &entry_v2_stat); + sizeof (entry_v2_stat), &entry_v2_stat); if (grub_errno) goto fail; file->size = (grub_off_t) grub_le_to_cpu64 (entry_v2_stat.size); @@ -1139,7 +1139,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) grub_disk_read (found.data->disk, found.block_number * (block_size >> GRUB_DISK_SECTOR_BITS), grub_le_to_cpu16 (found.header.item_location), - item_size, (char *) indirect_block_ptr); + item_size, indirect_block_ptr); if (grub_errno) goto fail; found.data->disk->read_hook = file->read_hook; diff --git a/fs/sfs.c b/fs/sfs.c index 8dc5951df..4e0ef618e 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -272,7 +272,7 @@ grub_sfs_mount (grub_disk_t disk) /* Read the rootblock. */ grub_disk_read (disk, 0, 0, sizeof (struct grub_sfs_rblock), - (char *) &data->rblock); + &data->rblock); if (grub_errno) goto fail; diff --git a/fs/udf.c b/fs/udf.c index 53fb63b19..b45615de1 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -390,7 +390,7 @@ grub_udf_read_icb (struct grub_udf_data *data, if (grub_disk_read (data->disk, block << GRUB_UDF_LOG2_BLKSZ, 0, sizeof (struct grub_udf_file_entry), - (char *) &node->fe)) + &node->fe)) return grub_errno; if ((U16 (node->fe.tag.tag_ident) != GRUB_UDF_TAG_IDENT_FE) && @@ -520,7 +520,7 @@ grub_udf_mount (grub_disk_t disk) struct grub_udf_vrs vrs; if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, - sizeof (struct grub_udf_vrs), (char *) &vrs)) + sizeof (struct grub_udf_vrs), &vrs)) { grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); goto fail; @@ -547,7 +547,7 @@ grub_udf_mount (grub_disk_t disk) struct grub_udf_avdp avdp; if (grub_disk_read (disk, *sblklist << GRUB_UDF_LOG2_BLKSZ, 0, - sizeof (struct grub_udf_avdp), (char *) &avdp)) + sizeof (struct grub_udf_avdp), &avdp)) { grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); goto fail; @@ -574,7 +574,7 @@ grub_udf_mount (grub_disk_t disk) struct grub_udf_tag tag; if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, - sizeof (struct grub_udf_tag), (char *) &tag)) + sizeof (struct grub_udf_tag), &tag)) { grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); goto fail; @@ -591,7 +591,7 @@ grub_udf_mount (grub_disk_t disk) if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, sizeof (struct grub_udf_pd), - (char *) &data->pds[data->npd])) + &data->pds[data->npd])) { grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); goto fail; @@ -607,7 +607,7 @@ grub_udf_mount (grub_disk_t disk) if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, sizeof (struct grub_udf_lvd), - (char *) &data->lvd)) + &data->lvd)) { grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); goto fail; @@ -670,7 +670,7 @@ grub_udf_mount (grub_disk_t disk) goto fail; if (grub_disk_read (disk, block << GRUB_UDF_LOG2_BLKSZ, 0, - sizeof (struct grub_udf_fileset), (char *) &root_fs)) + sizeof (struct grub_udf_fileset), &root_fs)) { grub_error (GRUB_ERR_BAD_FS, "not an udf filesystem"); goto fail; diff --git a/fs/ufs.c b/fs/ufs.c index 562bf7b25..75a2d404f 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -235,7 +235,7 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) { grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 0) << log2_blksz, - 0, sizeof (indir), (char *) indir); + 0, sizeof (indir), indir); return (data->ufs_type == UFS1) ? indir[blk] : indir[blk << 1]; } blk -= indirsz; @@ -246,12 +246,12 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 1) << log2_blksz, - 0, sizeof (indir), (char *) indir); + 0, sizeof (indir), indir); grub_disk_read (data->disk, ((data->ufs_type == UFS1) ? indir[blk / indirsz] : indir [(blk / indirsz) << 1]) << log2_blksz, - 0, sizeof (indir), (char *) indir); + 0, sizeof (indir), indir); return (data->ufs_type == UFS1) ? indir[blk % indirsz] : indir[(blk % indirsz) << 1]; @@ -362,7 +362,7 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) + grpino / 4, (grpino % 4) * sizeof (struct grub_ufs_inode), sizeof (struct grub_ufs_inode), - (char *) inode); + inode); } else { @@ -378,7 +378,7 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) + grpino / 2, (grpino % 2) * sizeof (struct grub_ufs2_inode), sizeof (struct grub_ufs2_inode), - (char *) inode); + inode); } return grub_errno; @@ -532,7 +532,7 @@ grub_ufs_mount (grub_disk_t disk) while (*sblklist != -1) { grub_disk_read (disk, *sblklist, 0, sizeof (struct grub_ufs_sblock), - (char *) &data->sblock); + &data->sblock); if (grub_errno) goto fail; diff --git a/fs/xfs.c b/fs/xfs.c index 3907abc92..4ba6c67ca 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -218,7 +218,7 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, /* Read the inode. */ if (grub_disk_read (data->disk, block, offset, - sizeof (struct grub_xfs_inode), (char *) inode)) + sizeof (struct grub_xfs_inode), inode)) return grub_errno; if (grub_strncmp ((char *) inode->magic, "IN", 2)) @@ -267,7 +267,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) grub_be_to_cpu64 (keys[i - 1 + XFS_INODE_EXTENTS]) << (node->data->sblock.log2_bsize - GRUB_DISK_SECTOR_BITS), - 0, node->data->sblock.bsize, (char *) leaf)) + 0, node->data->sblock.bsize, leaf)) return 0; if (grub_strncmp ((char *) leaf->magic, "BMAP", 4)) @@ -583,7 +583,7 @@ grub_xfs_mount (grub_disk_t disk) /* Read the superblock. */ if (grub_disk_read (disk, 0, 0, - sizeof (struct grub_xfs_sblock), (char *) &data->sblock)) + sizeof (struct grub_xfs_sblock), &data->sblock)) goto fail; if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4)) diff --git a/include/grub/disk.h b/include/grub/disk.h index 1e8046a1d..efec0dd49 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -149,12 +149,12 @@ grub_err_t EXPORT_FUNC(grub_disk_read) (grub_disk_t disk, grub_disk_addr_t sector, grub_off_t offset, grub_size_t size, - char *buf); + void *buf); grub_err_t EXPORT_FUNC(grub_disk_write) (grub_disk_t disk, grub_disk_addr_t sector, grub_off_t offset, grub_size_t size, - const char *buf); + const void *buf); grub_uint64_t EXPORT_FUNC(grub_disk_get_size) (grub_disk_t disk); diff --git a/kern/disk.c b/kern/disk.c index 4db3f30cd..645d7e7e5 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -385,7 +385,7 @@ grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector, /* Read data from the disk. */ grub_err_t grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_off_t offset, grub_size_t size, char *buf) + grub_off_t offset, grub_size_t size, void *buf) { char *tmp_buf; unsigned real_offset; @@ -511,7 +511,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, } sector = start_sector + GRUB_DISK_CACHE_SIZE; - buf += len; + buf = (char *) buf + len; size -= len; real_offset = 0; } @@ -525,7 +525,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, grub_err_t grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_off_t offset, grub_size_t size, const char *buf) + grub_off_t offset, grub_size_t size, const void *buf) { unsigned real_offset; @@ -559,7 +559,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, goto finish; sector++; - buf += len; + buf = (char *) buf + len; size -= len; real_offset = 0; } @@ -577,7 +577,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, while (n--) grub_disk_cache_invalidate (disk->dev->id, disk->id, sector++); - buf += len; + buf = (char *) buf + len; size -= len; } } diff --git a/loader/i386/pc/chainloader.c b/loader/i386/pc/chainloader.c index 60a4884c1..304886b09 100644 --- a/loader/i386/pc/chainloader.c +++ b/loader/i386/pc/chainloader.c @@ -104,7 +104,7 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) if (p) { grub_disk_read (disk, p->offset, 446, 64, - (char *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR); + (void *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR); part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR + (p->index << 4)); } diff --git a/partmap/acorn.c b/partmap/acorn.c index 9db5e0e45..a861eb0ea 100644 --- a/partmap/acorn.c +++ b/partmap/acorn.c @@ -61,7 +61,7 @@ acorn_partition_map_find (grub_disk_t disk, struct linux_part *m, err = grub_disk_read (disk, 0xC00 / GRUB_DISK_SECTOR_SIZE, 0, sizeof (struct grub_acorn_boot_block), - (char *) &boot); + &boot); if (err) return err; @@ -81,7 +81,7 @@ acorn_partition_map_find (grub_disk_t disk, struct linux_part *m, return grub_disk_read (disk, *sector, 0, sizeof (struct linux_part) * LINUX_MAP_ENTRIES, - (char *) m); + m); fail: return grub_error (GRUB_ERR_BAD_PART_TABLE, diff --git a/partmap/amiga.c b/partmap/amiga.c index 568a8588c..81d95373c 100644 --- a/partmap/amiga.c +++ b/partmap/amiga.c @@ -89,7 +89,7 @@ amiga_partition_map_iterate (grub_disk_t disk, for (pos = 0; pos < 15; pos++) { /* Read the RDSK block which is a descriptor for the entire disk. */ - if (grub_disk_read (&raw, pos, 0, sizeof (rdsk), (char *) &rdsk)) + if (grub_disk_read (&raw, pos, 0, sizeof (rdsk), &rdsk)) return grub_errno; if (grub_strcmp ((char *) rdsk.magic, "RDSK") == 0) @@ -110,7 +110,7 @@ amiga_partition_map_iterate (grub_disk_t disk, struct grub_amiga_partition apart; /* Read the RDSK block which is a descriptor for the entire disk. */ - if (grub_disk_read (&raw, next, 0, sizeof (apart), (char *) &apart)) + if (grub_disk_read (&raw, next, 0, sizeof (apart), &apart)) return grub_errno; /* Calculate the first block and the size of the partition. */ diff --git a/partmap/apple.c b/partmap/apple.c index 55d3cf585..6d83f7bf3 100644 --- a/partmap/apple.c +++ b/partmap/apple.c @@ -114,7 +114,7 @@ apple_partition_map_iterate (grub_disk_t disk, part.partmap = &grub_apple_partition_map; - if (grub_disk_read (&raw, 0, 0, sizeof (aheader), (char *) &aheader)) + if (grub_disk_read (&raw, 0, 0, sizeof (aheader), &aheader)) return grub_errno; if (grub_be_to_cpu16 (aheader.magic) != GRUB_APPLE_HEADER_MAGIC) @@ -130,7 +130,7 @@ apple_partition_map_iterate (grub_disk_t disk, { if (grub_disk_read (&raw, pos / GRUB_DISK_SECTOR_SIZE, pos % GRUB_DISK_SECTOR_SIZE, - sizeof (struct grub_apple_part), (char *) &apart)) + sizeof (struct grub_apple_part), &apart)) return grub_errno; if (grub_be_to_cpu16 (apart.magic) != GRUB_APPLE_PART_MAGIC) diff --git a/partmap/gpt.c b/partmap/gpt.c index ffdbed0f9..5c89e35b3 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -55,7 +55,7 @@ gpt_partition_map_iterate (grub_disk_t disk, raw.partition = 0; /* Read the protective MBR. */ - if (grub_disk_read (&raw, 0, 0, sizeof (mbr), (char *) &mbr)) + if (grub_disk_read (&raw, 0, 0, sizeof (mbr), &mbr)) return grub_errno; /* Check if it is valid. */ @@ -67,7 +67,7 @@ gpt_partition_map_iterate (grub_disk_t disk, return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found"); /* Read the GPT header. */ - if (grub_disk_read (&raw, 1, 0, sizeof (gpt), (char *) &gpt)) + if (grub_disk_read (&raw, 1, 0, sizeof (gpt), &gpt)) return grub_errno; if (grub_memcmp (gpt.magic, grub_gpt_magic, sizeof (grub_gpt_magic))) @@ -79,7 +79,7 @@ gpt_partition_map_iterate (grub_disk_t disk, for (i = 0; i < grub_le_to_cpu32 (gpt.maxpart); i++) { if (grub_disk_read (&raw, entries, last_offset, - sizeof (entry), (char *) &entry)) + sizeof (entry), &entry)) return grub_errno; if (grub_memcmp (&grub_gpt_partition_type_empty, &entry.type, diff --git a/partmap/pc.c b/partmap/pc.c index b86bb91fa..1a110b240 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -114,7 +114,7 @@ pc_partition_map_iterate (grub_disk_t disk, struct grub_pc_partition_entry *e; /* Read the MBR. */ - if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), (char *) &mbr)) + if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr)) goto finish; /* Check if it is valid. */ @@ -166,7 +166,7 @@ pc_partition_map_iterate (grub_disk_t disk, + GRUB_PC_PARTITION_BSD_LABEL_SECTOR), 0, sizeof (label), - (char *) &label)) + &label)) goto finish; /* Check if it is valid. */ diff --git a/partmap/sun.c b/partmap/sun.c index 6b524dbf0..8598534e8 100644 --- a/partmap/sun.c +++ b/partmap/sun.c @@ -103,7 +103,7 @@ sun_partition_map_iterate (grub_disk_t disk, p->data = 0; p->partmap = &grub_sun_partition_map; if (grub_disk_read (&raw, 0, 0, sizeof (struct grub_sun_block), - (char *) &block) == GRUB_ERR_NONE) + &block) == GRUB_ERR_NONE) { if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.magic)) grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table"); diff --git a/parttool/pcpart.c b/parttool/pcpart.c index 8ada0ec25..c37a40111 100644 --- a/parttool/pcpart.c +++ b/parttool/pcpart.c @@ -52,7 +52,7 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev, dev->disk->partition = 0; /* Read the MBR. */ - if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr)) + if (grub_disk_read (dev->disk, 0, 0, sizeof (mbr), &mbr)) { dev->disk->partition = part; return grub_errno; @@ -72,7 +72,7 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev, } /* Write the MBR. */ - grub_disk_write (dev->disk, 0, 0, sizeof (mbr), (char *) &mbr); + grub_disk_write (dev->disk, 0, 0, sizeof (mbr), &mbr); dev->disk->partition = part; @@ -100,7 +100,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, /* Read the parttable. */ if (grub_disk_read (dev->disk, part->offset, 0, - sizeof (mbr), (char *) &mbr)) + sizeof (mbr), &mbr)) { dev->disk->partition = part; return grub_errno; @@ -131,7 +131,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, /* Write the parttable. */ grub_disk_write (dev->disk, part->offset, 0, - sizeof (mbr), (char *) &mbr); + sizeof (mbr), &mbr); dev->disk->partition = part; From faec96afc845f339fb5ae0e886f03abf3e98d328 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 13 May 2009 19:16:55 +0000 Subject: [PATCH 0741/1707] 2009-05-13 Pavel Roskin * fs/cpio.c: Use the same name "struct head" for tar and cpio to facilitate code reuse. (grub_cpio_mount): Use "struct head", not a char buffer. This fixes a warning reported by gcc 4.4. --- ChangeLog | 5 +++++ fs/cpio.c | 28 ++++++++++++++-------------- 2 files changed, 19 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 733a07c97..4aea4cddb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-05-13 Pavel Roskin + * fs/cpio.c: Use the same name "struct head" for tar and cpio to + facilitate code reuse. + (grub_cpio_mount): Use "struct head", not a char buffer. This + fixes a warning reported by gcc 4.4. + * kernel/disk.c (grub_disk_read): Use void pointer for the buffer. (grub_disk_write): Use const void pointer for the buffer. diff --git a/fs/cpio.c b/fs/cpio.c index 3ae93a01d..0ef263ce5 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -23,9 +23,10 @@ #include #include +#ifndef MODE_USTAR +/* cpio support */ #define MAGIC_BCPIO 070707 - -struct HEAD_BCPIO +struct head { grub_uint16_t magic; grub_uint16_t dev; @@ -41,10 +42,10 @@ struct HEAD_BCPIO grub_uint16_t filesize_1; grub_uint16_t filesize_2; } __attribute__ ((packed)); - +#else +/* tar support */ #define MAGIC_USTAR "ustar" - -struct HEAD_USTAR +struct head { char name[100]; char mode[8]; @@ -63,8 +64,7 @@ struct HEAD_USTAR char devminor[8]; char prefix[155]; } __attribute__ ((packed)); - -#define HEAD_LENG sizeof(struct HEAD_USTAR) +#endif struct grub_cpio_data { @@ -81,7 +81,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, grub_uint32_t * ofs) { #ifndef MODE_USTAR - struct HEAD_BCPIO hd; + struct head hd; if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) @@ -117,7 +117,7 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, if (data->size & 1) (*ofs)++; #else - struct HEAD_USTAR hd; + struct head hd; if (grub_disk_read (data->disk, 0, data->hofs, sizeof (hd), &hd)) @@ -146,17 +146,17 @@ grub_cpio_find_file (struct grub_cpio_data *data, char **name, static struct grub_cpio_data * grub_cpio_mount (grub_disk_t disk) { - char hd[HEAD_LENG]; + struct head hd; struct grub_cpio_data *data; - if (grub_disk_read (disk, 0, 0, sizeof (hd), hd)) + if (grub_disk_read (disk, 0, 0, sizeof (hd), &hd)) goto fail; #ifndef MODE_USTAR - if (((struct HEAD_BCPIO *) hd)->magic != MAGIC_BCPIO) + if (hd.magic != MAGIC_BCPIO) #else - if (grub_memcmp (((struct HEAD_USTAR *) hd)->magic, MAGIC_USTAR, - sizeof (MAGIC_USTAR) - 1)) + if (grub_memcmp (hd.magic, MAGIC_USTAR, + sizeof (MAGIC_USTAR) - 1)) #endif goto fail; From a2c8c5f8f6d298bb07730c331402cf19c0fdafc9 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 13 May 2009 20:09:09 +0000 Subject: [PATCH 0742/1707] 2009-05-13 Pavel Roskin * fs/iso9660.c (grub_iso9660_iterate_dir): The file mode in the PX record is always little-endian. We only need the lower 2 bytes of the mode. --- ChangeLog | 4 ++++ fs/iso9660.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4aea4cddb..65387ecf5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-05-13 Pavel Roskin + * fs/iso9660.c (grub_iso9660_iterate_dir): The file mode in the + PX record is always little-endian. We only need the lower 2 + bytes of the mode. + * fs/cpio.c: Use the same name "struct head" for tar and cpio to facilitate code reuse. (grub_cpio_mount): Use "struct head", not a char buffer. This diff --git a/fs/iso9660.c b/fs/iso9660.c index 140d8c213..32dfddbb3 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -521,8 +521,8 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, else if (grub_strncmp ((char *) entry->sig, "PX", 2) == 0) { /* At position 0 of the PX record the st_mode information is - stored. */ - grub_uint32_t mode = ((*(grub_uint32_t *) &entry->data[0]) + stored (little-endian). */ + grub_uint32_t mode = ((entry->data[0] + (entry->data[1] << 8)) & GRUB_ISO9660_FSTYPE_MASK); switch (mode) From 0ab3a9a46d6b158c13d61d5376e5196ccc043829 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 13 May 2009 20:52:35 +0000 Subject: [PATCH 0743/1707] 2009-05-13 Pavel Roskin * loader/i386/pc/multiboot2.c: Add necessary includes for grub_multiboot2_real_boot(). --- ChangeLog | 3 +++ loader/i386/pc/multiboot2.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 65387ecf5..74b1d3a32 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-05-13 Pavel Roskin + * loader/i386/pc/multiboot2.c: Add necessary includes for + grub_multiboot2_real_boot(). + * fs/iso9660.c (grub_iso9660_iterate_dir): The file mode in the PX record is always little-endian. We only need the lower 2 bytes of the mode. diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c index d5fe8e380..2c14ee254 100644 --- a/loader/i386/pc/multiboot2.c +++ b/loader/i386/pc/multiboot2.c @@ -23,6 +23,8 @@ #include #include #include +#include +#include grub_err_t grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr) From 15fbf4c4421f025b56abe6d32ac25b39fece20bd Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 13 May 2009 20:59:45 +0000 Subject: [PATCH 0744/1707] 2009-05-13 Robert Millan * util/i386/pc/grub-setup.c (setup): Restructure code flow to make it easier to understand / work with. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 45 ++++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 74b1d3a32..412d55043 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-13 Robert Millan + + * util/i386/pc/grub-setup.c (setup): Restructure code flow to make + it easier to understand / work with. + 2009-05-13 Pavel Roskin * loader/i386/pc/multiboot2.c: Add necessary includes for diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index f0f79f419..3b23446f8 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -310,17 +310,19 @@ setup (const char *dir, dos_part, bsd_part); if (! dest_dev->disk->has_partitions) + { grub_util_warn ("Attempting to install GRUB to a partitionless disk. This is a BAD idea."); + goto unable_to_embed; + } if (dest_dev->disk->partition) - grub_util_warn ("Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea."); - - /* If the destination device can have partitions and it is the MBR, - try to embed the core image into after the MBR. */ - if (dest_dev->disk->has_partitions && ! dest_dev->disk->partition) { + grub_util_warn ("Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea."); + goto unable_to_embed; + } + /* Unlike root_dev, with dest_dev we're interested in the partition map even - if dest_dev itself is a whole disk. */ + if dest_dev itself is a whole disk. */ auto int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk, const grub_partition_t p); int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk __attribute__ ((unused)), @@ -330,16 +332,22 @@ setup (const char *dir, return 1; } grub_partition_iterate (dest_dev->disk, identify_partmap); - + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? find_usable_region_gpt : find_usable_region_msdos)); - - if (embed_region.end != embed_region.start) - embedding_area_exists = 1; - - /* If there is enough space... */ - if ((unsigned long) core_sectors <= embed_region.end - embed_region.start) - { + if (embed_region.end == embed_region.start) + { + grub_util_warn ("Embedding area is not present at all!"); + goto unable_to_embed; + } + + if ((unsigned long) core_sectors > embed_region.end - embed_region.start) + { + grub_util_warn ("Embedding area is too small for core.img."); + goto unable_to_embed; + } + + grub_util_info ("will embed the core image at sector 0x%llx", embed_region.start); *install_dos_part = grub_cpu_to_le32 (dos_part); @@ -374,15 +382,8 @@ setup (const char *dir, grub_util_error ("%s", grub_errmsg); goto finish; - } - } - /* If we reached this point, it means we were unable to embed. */ - - if (embedding_area_exists) - grub_util_warn ("Embedding area is too small for core.img."); - else - grub_util_warn ("Embedding area is not present at all!"); +unable_to_embed: if (must_embed) grub_util_error ("Embedding is not possible, but this is required when " From 667712d716239d61eb4bebbb0295c1bcb8e4e1e5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 13 May 2009 21:01:26 +0000 Subject: [PATCH 0745/1707] fix indentation for previous commit --- util/i386/pc/grub-setup.c | 100 +++++++++++++++++++------------------- 1 file changed, 50 insertions(+), 50 deletions(-) diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 3b23446f8..0847130b7 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -311,30 +311,30 @@ setup (const char *dir, if (! dest_dev->disk->has_partitions) { - grub_util_warn ("Attempting to install GRUB to a partitionless disk. This is a BAD idea."); + grub_util_warn ("Attempting to install GRUB to a partitionless disk. This is a BAD idea."); goto unable_to_embed; } if (dest_dev->disk->partition) { - grub_util_warn ("Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea."); + grub_util_warn ("Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea."); goto unable_to_embed; } - /* Unlike root_dev, with dest_dev we're interested in the partition map even - if dest_dev itself is a whole disk. */ - auto int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk, - const grub_partition_t p); - int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk __attribute__ ((unused)), - const grub_partition_t p) - { - dest_partmap = p->partmap->name; - return 1; - } - grub_partition_iterate (dest_dev->disk, identify_partmap); - - grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? - find_usable_region_gpt : find_usable_region_msdos)); + /* Unlike root_dev, with dest_dev we're interested in the partition map even + if dest_dev itself is a whole disk. */ + auto int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk, + const grub_partition_t p); + int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk __attribute__ ((unused)), + const grub_partition_t p) + { + dest_partmap = p->partmap->name; + return 1; + } + grub_partition_iterate (dest_dev->disk, identify_partmap); + + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? + find_usable_region_gpt : find_usable_region_msdos)); if (embed_region.end == embed_region.start) { grub_util_warn ("Embedding area is not present at all!"); @@ -348,40 +348,40 @@ setup (const char *dir, } - grub_util_info ("will embed the core image at sector 0x%llx", embed_region.start); - - *install_dos_part = grub_cpu_to_le32 (dos_part); - *install_bsd_part = grub_cpu_to_le32 (bsd_part); - - /* The first blocklist contains the whole sectors. */ - first_block->start = grub_cpu_to_le64 (embed_region.start + 1); - first_block->len = grub_cpu_to_le16 (core_sectors - 1); - first_block->segment - = grub_cpu_to_le16 (GRUB_BOOT_MACHINE_KERNEL_SEG - + (GRUB_DISK_SECTOR_SIZE >> 4)); - - /* Make sure that the second blocklist is a terminator. */ - block = first_block - 1; - block->start = 0; - block->len = 0; - block->segment = 0; - - /* Write the core image onto the disk. */ - if (grub_disk_write (dest_dev->disk, embed_region.start, 0, core_size, core_img)) - grub_util_error ("%s", grub_errmsg); - - /* FIXME: can this be skipped? */ - *boot_drive = 0xFF; - *root_drive = 0xFF; - - *kernel_sector = grub_cpu_to_le64 (embed_region.start); - - /* Write the boot image onto the disk. */ - if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, - boot_img)) - grub_util_error ("%s", grub_errmsg); - - goto finish; + grub_util_info ("will embed the core image at sector 0x%llx", embed_region.start); + + *install_dos_part = grub_cpu_to_le32 (dos_part); + *install_bsd_part = grub_cpu_to_le32 (bsd_part); + + /* The first blocklist contains the whole sectors. */ + first_block->start = grub_cpu_to_le64 (embed_region.start + 1); + first_block->len = grub_cpu_to_le16 (core_sectors - 1); + first_block->segment + = grub_cpu_to_le16 (GRUB_BOOT_MACHINE_KERNEL_SEG + + (GRUB_DISK_SECTOR_SIZE >> 4)); + + /* Make sure that the second blocklist is a terminator. */ + block = first_block - 1; + block->start = 0; + block->len = 0; + block->segment = 0; + + /* Write the core image onto the disk. */ + if (grub_disk_write (dest_dev->disk, embed_region.start, 0, core_size, core_img)) + grub_util_error ("%s", grub_errmsg); + + /* FIXME: can this be skipped? */ + *boot_drive = 0xFF; + *root_drive = 0xFF; + + *kernel_sector = grub_cpu_to_le64 (embed_region.start); + + /* Write the boot image onto the disk. */ + if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, + boot_img)) + grub_util_error ("%s", grub_errmsg); + + goto finish; unable_to_embed: From 59978c8ae705a5e27200046485318d7979be59dc Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 13 May 2009 21:13:11 +0000 Subject: [PATCH 0746/1707] 2009-05-13 Robert Millan Improve warning messages for cases where there's no embedding area, or when it is too small (or core.img too large). --- ChangeLog | 2 ++ util/i386/pc/grub-setup.c | 12 ++++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 412d55043..3cbeab5c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * util/i386/pc/grub-setup.c (setup): Restructure code flow to make it easier to understand / work with. + Improve warning messages for cases where there's no embedding area, + or when it is too small (or core.img too large). 2009-05-13 Pavel Roskin diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 0847130b7..3b1beb74a 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -337,13 +337,21 @@ setup (const char *dir, find_usable_region_gpt : find_usable_region_msdos)); if (embed_region.end == embed_region.start) { - grub_util_warn ("Embedding area is not present at all!"); + if (! strcmp (dest_partmap, "pc_partition_map")) + grub_util_warn ("This msdos-style partition label has no post-MBR gap; embedding won't be possible!"); + else + grub_util_warn ("This GPT partition label has no BIOS Boot Partition; embedding won't be possible!"); goto unable_to_embed; } if ((unsigned long) core_sectors > embed_region.end - embed_region.start) { - grub_util_warn ("Embedding area is too small for core.img."); + if (core_sectors > 62 * 512) + grub_util_warn ("Your core.img is unusually large. It won't fit in the embedding area."); + else if (embed_region.end - embed_region.start < 62 * 512) + grub_util_warn ("Your embedding area is unusually small. core.img won't fit in it."); + else + grub_util_warn ("Embedding area is too small for core.img."); goto unable_to_embed; } From 6f6a8b2869fb3bdfabee5f7c3000cc9505b454bf Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 13 May 2009 21:28:25 +0000 Subject: [PATCH 0747/1707] 2009-05-13 Pavel Roskin * util/i386/pc/grub-setup.c (setup): Remove unused variable embedding_area_exists. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 1 - 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3cbeab5c7..919ec4ba0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-13 Pavel Roskin + + * util/i386/pc/grub-setup.c (setup): Remove unused variable + embedding_area_exists. + 2009-05-13 Robert Millan * util/i386/pc/grub-setup.c (setup): Restructure code flow to make diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 3b1beb74a..997811bb9 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -110,7 +110,6 @@ setup (const char *dir, FILE *fp; struct { grub_uint64_t start; grub_uint64_t end; } embed_region; embed_region.start = embed_region.end = ~0UL; - int embedding_area_exists = 0; auto void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset, unsigned length); From 4246b8a9e8cea3b467af836828e1d06e78cf5b94 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 14 May 2009 01:23:49 +0000 Subject: [PATCH 0748/1707] =?UTF-8?q?2009-05-13=20=20Javier=20Mart=C3=ADn?= =?UTF-8?q?=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commands/i386/pc/drivemap.c: New file - implement drivemap command. * commands/i386/pc/drivemap_int13h.S: New file - int13 handler. * conf/i386-pc.rmk: Add drivemap.c and drivemap_int13h.S. --- ChangeLog | 7 + commands/i386/pc/drivemap.c | 445 +++++++++++++++++++++++++++++ commands/i386/pc/drivemap_int13h.S | 66 +++++ conf/i386-pc.rmk | 9 +- 4 files changed, 526 insertions(+), 1 deletion(-) create mode 100644 commands/i386/pc/drivemap.c create mode 100644 commands/i386/pc/drivemap_int13h.S diff --git a/ChangeLog b/ChangeLog index 919ec4ba0..5b90c2502 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-13 Javier Martín + + * commands/i386/pc/drivemap.c: New file - implement drivemap + command. + * commands/i386/pc/drivemap_int13h.S: New file - int13 handler. + * conf/i386-pc.rmk: Add drivemap.c and drivemap_int13h.S. + 2009-05-13 Pavel Roskin * util/i386/pc/grub-setup.c (setup): Remove unused variable diff --git a/commands/i386/pc/drivemap.c b/commands/i386/pc/drivemap.c new file mode 100644 index 000000000..f9710b8d9 --- /dev/null +++ b/commands/i386/pc/drivemap.c @@ -0,0 +1,445 @@ +/* drivemap.c - command to manage the BIOS drive mappings. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008, 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + + +#define MODNAME "drivemap" + +/* Real mode IVT slot (seg:off far pointer) for interrupt 0x13. */ +static grub_uint32_t *const int13slot = UINT_TO_PTR (4 * 0x13); + +/* Remember to update enum opt_idxs accordingly. */ +static const struct grub_arg_option options[] = { + {"list", 'l', 0, "show the current mappings", 0, 0}, + {"reset", 'r', 0, "reset all mappings to the default values", 0, 0}, + {"swap", 's', 0, "perform both direct and reverse mappings", 0, 0}, + {0, 0, 0, 0, 0, 0} +}; + +/* Remember to update options[] accordingly. */ +enum opt_idxs +{ + OPTIDX_LIST = 0, + OPTIDX_RESET, + OPTIDX_SWAP, +}; + +/* Realmode far ptr (2 * 16b) to the previous INT13h handler. */ +extern grub_uint32_t grub_drivemap_oldhandler; + +/* The type "void" is used for imported assembly labels, takes no storage and + serves just to take the address with &label. */ + +/* The assembly function to replace the old INT13h handler. It does not follow + any C callspecs and returns with IRET. */ +extern const void grub_drivemap_handler; + +/* Start of the drive mappings area (space reserved at runtime). */ +extern const void grub_drivemap_mapstart; + +typedef struct drivemap_node +{ + struct drivemap_node *next; + grub_uint8_t newdrive; + grub_uint8_t redirto; +} drivemap_node_t; + +typedef struct __attribute__ ((packed)) int13map_node +{ + grub_uint8_t disknum; + grub_uint8_t mapto; +} int13map_node_t; + +#define INT13H_OFFSET(x) \ + (((grub_uint8_t *)(x)) - ((grub_uint8_t *)&grub_drivemap_handler)) + +static drivemap_node_t *map_head; +static void *drivemap_hook; +static int drivemap_mmap; + +/* Puts the specified mapping into the table, replacing an existing mapping + for newdrive or adding a new one if required. */ +static grub_err_t +drivemap_set (grub_uint8_t newdrive, grub_uint8_t redirto) +{ + drivemap_node_t *mapping = 0; + drivemap_node_t *search = map_head; + while (search) + { + if (search->newdrive == newdrive) + { + mapping = search; + break; + } + search = search->next; + } + + /* Check for pre-existing mappings to modify before creating a new one. */ + if (mapping) + mapping->redirto = redirto; + else + { + mapping = grub_malloc (sizeof (drivemap_node_t)); + if (! mapping) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "cannot allocate map entry, not enough memory"); + mapping->newdrive = newdrive; + mapping->redirto = redirto; + mapping->next = map_head; + map_head = mapping; + } + return GRUB_ERR_NONE; +} + +/* Removes the mapping for newdrive from the table. If there is no mapping, + then this function behaves like a no-op on the map. */ +static void +drivemap_remove (grub_uint8_t newdrive) +{ + drivemap_node_t *mapping = 0; + drivemap_node_t *search = map_head; + drivemap_node_t *previous = 0; + + while (search) + { + if (search->newdrive == newdrive) + { + mapping = search; + break; + } + previous = search; + search = search->next; + } + + if (mapping) + { + if (previous) + previous->next = mapping->next; + else + map_head = mapping->next; + grub_free (mapping); + } +} + +/* Given a device name, resolves its BIOS disk number and stores it in the + passed location, which should only be trusted if ERR_NONE is returned. */ +static grub_err_t +parse_biosdisk (const char *name, grub_uint8_t *disknum) +{ + grub_disk_t disk; + /* Skip the first ( in (hd0) - disk_open wants just the name. */ + if (*name == '(') + name++; + + disk = grub_disk_open (name); + if (! disk) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown device \"%s\"", + name); + const enum grub_disk_dev_id id = disk->dev->id; + /* The following assignment is only sound if the device is indeed a + biosdisk. The caller must check the return value. */ + if (disknum) + *disknum = disk->id; + grub_disk_close (disk); + if (id != GRUB_DISK_DEVICE_BIOSDISK_ID) + return grub_error (GRUB_ERR_BAD_DEVICE, "%s is not a BIOS disk", name); + return GRUB_ERR_NONE; +} + +/* Given a BIOS disk number, returns its GRUB device name if it exists. + If the call succeeds, the resulting device string must be freed. + For nonexisting BIOS disk numbers, this function returns + GRUB_ERR_UNKNOWN_DEVICE. */ +static grub_err_t +revparse_biosdisk (const grub_uint8_t dnum, const char **output) +{ + int found = 0; + auto int find (const char *name); + int find (const char *name) + { + const grub_disk_t disk = grub_disk_open (name); + if (! disk) + return 0; + if (disk->id == dnum && disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) + { + found = 1; + if (output) + *output = grub_strdup (name); + } + grub_disk_close (disk); + return found; + } + + grub_disk_dev_iterate (find); + if (found) + return GRUB_ERR_NONE; + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "BIOS disk %02x not found", + dnum); +} + +/* Given a GRUB-like device name and a convenient location, stores the + related BIOS disk number. Accepts devices like \((f|h)dN\), with + 0 <= N < 128. */ +static grub_err_t +tryparse_diskstring (const char *str, grub_uint8_t *output) +{ + /* Skip opening paren in order to allow both (hd0) and hd0. */ + if (*str == '(') + str++; + if ((str[0] == 'f' || str[0] == 'h') && str[1] == 'd') + { + grub_uint8_t bios_num = (str[0] == 'h') ? 0x80 : 0x00; + unsigned long drivenum = grub_strtoul (str + 2, 0, 0); + if (grub_errno == GRUB_ERR_NONE && drivenum < 128) + { + bios_num |= drivenum; + if (output) + *output = bios_num; + return GRUB_ERR_NONE; + } + } + return grub_error (GRUB_ERR_BAD_ARGUMENT, "device format \"%s\" " + "invalid: must be (f|h)dN, with 0 <= N < 128", str); +} + +static grub_err_t +list_mappings (void) +{ + /* Show: list mappings. */ + if (! map_head) + { + grub_printf ("No drives have been remapped\n"); + return GRUB_ERR_NONE; + } + + grub_printf ("OS disk #num ------> GRUB/BIOS device\n"); + drivemap_node_t *curnode = map_head; + while (curnode) + { + const char *dname = 0; + grub_err_t err = revparse_biosdisk (curnode->redirto, &dname); + if (err != GRUB_ERR_NONE) + return err; + grub_printf ("%cD #%-3u (0x%02x) %s\n", + (curnode->newdrive & 0x80) ? 'H' : 'F', + curnode->newdrive & 0x7F, curnode->newdrive, dname); + curnode = curnode->next; + grub_free ((char *) dname); + } + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_drivemap (struct grub_extcmd *cmd, int argc, char **args) +{ + if (cmd->state[OPTIDX_LIST].set) + { + return list_mappings (); + } + else if (cmd->state[OPTIDX_RESET].set) + { + /* Reset: just delete all mappings, freeing their memory. */ + drivemap_node_t *curnode = map_head; + drivemap_node_t *prevnode = 0; + while (curnode) + { + prevnode = curnode; + curnode = curnode->next; + grub_free (prevnode); + } + map_head = 0; + return GRUB_ERR_NONE; + } + else if (!cmd->state[OPTIDX_SWAP].set && argc == 0) + { + /* No arguments */ + return list_mappings (); + } + + /* Neither flag: put mapping. */ + grub_uint8_t mapfrom = 0; + grub_uint8_t mapto = 0xFF; + grub_err_t err; + + if (argc != 2) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "two arguments required"); + + err = parse_biosdisk (args[0], &mapfrom); + if (err != GRUB_ERR_NONE) + return err; + + /* When swapping we require both devices to be BIOS disks, but when + performing direct mappings we only require the 2nd argument to look + like a BIOS disk in order to resolve it into a BIOS disk number. */ + if (cmd->state[OPTIDX_SWAP].set) + err = parse_biosdisk (args[1], &mapto); + else + err = tryparse_diskstring (args[1], &mapto); + if (err != GRUB_ERR_NONE) + return err; + + if (mapto == mapfrom) + { + /* Reset to default. */ + grub_dprintf (MODNAME, "Removing mapping for %s (%02x)\n", + args[0], mapfrom); + drivemap_remove (mapfrom); + return GRUB_ERR_NONE; + } + /* Set the mapping for the disk (overwrites any existing mapping). */ + grub_dprintf (MODNAME, "%s %s (%02x) = %s (%02x)\n", + cmd->state[OPTIDX_SWAP].set ? "Swapping" : "Mapping", + args[1], mapto, args[0], mapfrom); + err = drivemap_set (mapto, mapfrom); + /* If -s, perform the reverse mapping too (only if the first was OK). */ + if (cmd->state[OPTIDX_SWAP].set && err == GRUB_ERR_NONE) + err = drivemap_set (mapfrom, mapto); + return err; +} + +/* Int13h handler installer - reserves conventional memory for the handler, + copies it over and sets the IVT entry for int13h. + This code rests on the assumption that GRUB does not activate any kind + of memory mapping apart from identity paging, since it accesses + realmode structures by their absolute addresses, like the IVT at 0; + and transforms a pmode pointer into a rmode seg:off far ptr. */ +static grub_err_t +install_int13_handler (int noret __attribute__ ((unused))) +{ + /* Size of the full int13 handler "bundle", including code and map. */ + grub_uint32_t total_size; + /* Base address of the space reserved for the handler bundle. */ + grub_uint8_t *handler_base = 0; + /* Address of the map within the deployed bundle. */ + int13map_node_t *handler_map; + + int i; + int entries = 0; + drivemap_node_t *curentry = map_head; + + /* Count entries to prepare a contiguous map block. */ + while (curentry) + { + entries++; + curentry = curentry->next; + } + if (entries == 0) + { + /* No need to install the int13h handler. */ + grub_dprintf (MODNAME, "No drives marked as remapped, not installing " + "our int13h handler.\n"); + return GRUB_ERR_NONE; + } + + grub_dprintf (MODNAME, "Installing our int13h handler\n"); + + /* Save the pointer to the old handler. */ + grub_drivemap_oldhandler = *int13slot; + grub_dprintf (MODNAME, "Original int13 handler: %04x:%04x\n", + (grub_drivemap_oldhandler >> 16) & 0x0ffff, + grub_drivemap_oldhandler & 0x0ffff); + + /* Find a rmode-segment-aligned zone in conventional memory big + enough to hold the handler and its data. */ + total_size = INT13H_OFFSET (&grub_drivemap_mapstart) + + (entries + 1) * sizeof (int13map_node_t); + grub_dprintf (MODNAME, "Payload is %u bytes long\n", total_size); + handler_base = grub_mmap_malign_and_register (16, total_size, + &drivemap_mmap, + GRUB_MACHINE_MEMORY_RESERVED, + GRUB_MMAP_MALLOC_LOW); + if (! handler_base) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not reserve " + "memory for the int13h handler"); + + /* Copy int13h handler bundle to reserved area. */ + grub_dprintf (MODNAME, "Reserved memory at %p, copying handler\n", + handler_base); + grub_memcpy (handler_base, &grub_drivemap_handler, + INT13H_OFFSET (&grub_drivemap_mapstart)); + + /* Copy the mappings to the reserved area. */ + curentry = map_head; + handler_map = (int13map_node_t *) (handler_base + + INT13H_OFFSET (&grub_drivemap_mapstart)); + grub_dprintf (MODNAME, "Target map at %p, copying mappings\n", handler_map); + for (i = 0; i < entries; ++i, curentry = curentry->next) + { + handler_map[i].disknum = curentry->newdrive; + handler_map[i].mapto = curentry->redirto; + grub_dprintf (MODNAME, "\t#%d: 0x%02x <- 0x%02x\n", i, + handler_map[i].disknum, handler_map[i].mapto); + } + /* Signal end-of-map. */ + handler_map[i].disknum = 0; + handler_map[i].mapto = 0; + grub_dprintf (MODNAME, "\t#%d: 0x00 <- 0x00 (end)\n", i); + + /* Install our function as the int13h handler in the IVT. */ + *int13slot = ((grub_uint32_t) handler_base) << 12; /* Segment address. */ + grub_dprintf (MODNAME, "New int13 handler: %04x:%04x\n", + (*int13slot >> 16) & 0x0ffff, *int13slot & 0x0ffff); + + return GRUB_ERR_NONE; +} + +static grub_err_t +uninstall_int13_handler (void) +{ + if (! grub_drivemap_oldhandler) + return GRUB_ERR_NONE; + + *int13slot = grub_drivemap_oldhandler; + grub_mmap_free_and_unregister (drivemap_mmap); + grub_drivemap_oldhandler = 0; + grub_dprintf (MODNAME, "Restored int13 handler: %04x:%04x\n", + (*int13slot >> 16) & 0x0ffff, *int13slot & 0x0ffff); + + return GRUB_ERR_NONE; +} + +static grub_extcmd_t cmd; + +GRUB_MOD_INIT (drivemap) +{ + cmd = grub_register_extcmd (MODNAME, grub_cmd_drivemap, + GRUB_COMMAND_FLAG_BOTH, + MODNAME + " -l | -r | [-s] grubdev osdisk", + "Manage the BIOS drive mappings", + options); + drivemap_hook = + grub_loader_register_preboot_hook (&install_int13_handler, + &uninstall_int13_handler, + GRUB_LOADER_PREBOOT_HOOK_PRIO_NORMAL); +} + +GRUB_MOD_FINI (drivemap) +{ + grub_loader_unregister_preboot_hook (drivemap_hook); + drivemap_hook = 0; + grub_unregister_extcmd (cmd); +} diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S new file mode 100644 index 000000000..7db3a6793 --- /dev/null +++ b/commands/i386/pc/drivemap_int13h.S @@ -0,0 +1,66 @@ +/* drivemap_int13h.S - interrupt handler for the BIOS drive remapper */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008, 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + +#define INT13H_OFFSET(x) ((x) - grub_drivemap_handler) + +.code16 + +/* Copy starts here. When deployed, this code must be segment-aligned. */ + +/* The replacement int13 handler. The code must be position independent. + Preserve all registers. */ +FUNCTION(grub_drivemap_handler) + /* Map the drive number (always in DL). */ + push %ax + push %bx + movw $INT13H_OFFSET(grub_drivemap_mapstart), %bx + +more_remaining: + movw %cs:(%bx), %ax + cmpb %ah, %al + jz not_found /* DRV=DST => map end - drive not remapped, keep DL. */ + cmpb %dl, %al + jz found /* Found - drive remapped, modify DL. */ + inc %bx + inc %bx + jmp more_remaining /* Not found, but more remaining, loop. */ + +found: + movb %ah, %dl + +not_found: + pop %bx + pop %ax + + /* Upon arrival to this point the stack must be exactly like at entry. + This long jump will transfer the caller's stack to the old INT13 + handler, thus making it return directly to the original caller. */ + .byte 0xea + +/* Far pointer to the old handler. Stored as a CS:IP in the style of real-mode + IVT entries (thus PI:SC in mem). */ +VARIABLE(grub_drivemap_oldhandler) + .word 0x0, 0x0 + +/* This label MUST be at the end of the copied block, since the installer code + reserves additional space for mappings at runtime and copies them over it. */ +.align 2 +VARIABLE(grub_drivemap_mapstart) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 222b66228..d51fa9b02 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -185,7 +185,14 @@ pkglib_MODULES = biosdisk.mod chain.mod \ aout.mod bsd.mod pxe.mod pxecmd.mod datetime.mod date.mod \ datehook.mod lsmmap.mod ata_pthru.mod hdparm.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \ - efiemu.mod mmap.mod acpi.mod + efiemu.mod mmap.mod acpi.mod drivemap.mod + +# For drivemap.mod. +drivemap_mod_SOURCES = commands/i386/pc/drivemap.c \ + commands/i386/pc/drivemap_int13h.S +drivemap_mod_ASFLAGS = $(COMMON_ASFLAGS) +drivemap_mod_CFLAGS = $(COMMON_CFLAGS) +drivemap_mod_LDFLAGS = $(COMMON_LDFLAGS) # For efiemu.mod. efiemu_mod_SOURCES = efiemu/main.c efiemu/i386/loadcore32.c \ From 8090fc012adcf56ae30705a90968f434f9a3c32c Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 14 May 2009 03:48:08 +0000 Subject: [PATCH 0749/1707] 2009-05-13 Pavel Roskin * loader/i386/linux.c (allocate_pages): When assigning real_mode_mem, cast through grub_size_t to fix a warning. The code already makes sure that the value would fit a pointer. (grub_linux_setup_video): Cast render_target->data to grub_size_t to fix a warning. --- ChangeLog | 8 ++++++++ loader/i386/linux.c | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5b90c2502..4f8dc787b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-05-13 Pavel Roskin + + * loader/i386/linux.c (allocate_pages): When assigning + real_mode_mem, cast through grub_size_t to fix a warning. The + code already makes sure that the value would fit a pointer. + (grub_linux_setup_video): Cast render_target->data to + grub_size_t to fix a warning. + 2009-05-13 Javier Martín * commands/i386/pc/drivemap.c: New file - implement drivemap diff --git a/loader/i386/linux.c b/loader/i386/linux.c index d67a5f8e3..8a7288ecd 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -347,7 +347,8 @@ allocate_pages (grub_size_t prot_size) if (real_size + mmap_size > size) return 0; - real_mode_mem = (void *) ((addr + size) - (real_size + mmap_size)); + real_mode_mem = + (void *) (grub_size_t) ((addr + size) - (real_size + mmap_size)); return 1; } @@ -416,7 +417,7 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->lfb_depth = mode_info.bpp; params->lfb_line_len = mode_info.pitch; - params->lfb_base = (void *) render_target->data; + params->lfb_base = (grub_size_t) render_target->data; params->lfb_size = (params->lfb_line_len * params->lfb_height + 65535) >> 16; params->red_mask_size = mode_info.red_mask_size; From ac96388340256815ce1f5e0d916d90b4dd27c5b4 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 14 May 2009 03:59:10 +0000 Subject: [PATCH 0750/1707] 2009-05-13 Pavel Roskin * loader/i386/multiboot.c (grub_multiboot): Cast mmap_addr to grub_uint32_t to avoid a warning. --- ChangeLog | 3 +++ loader/i386/multiboot.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4f8dc787b..360b73a85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-05-13 Pavel Roskin + * loader/i386/multiboot.c (grub_multiboot): Cast mmap_addr to + grub_uint32_t to avoid a warning. + * loader/i386/linux.c (allocate_pages): When assigning real_mode_mem, cast through grub_size_t to fix a warning. The code already makes sure that the value would fit a pointer. diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 73dee4397..a59085c54 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -320,7 +320,7 @@ grub_multiboot (int argc, char *argv[]) /* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated by the spec. Is there something we can do about it? */ - mbi->mmap_addr = mmap_addr (grub_multiboot_payload_dest); + mbi->mmap_addr = (grub_uint32_t) mmap_addr (grub_multiboot_payload_dest); mbi->flags |= MULTIBOOT_INFO_MEM_MAP; if (grub_multiboot_payload_dest >= grub_multiboot_payload_orig) From 3834887fb29c289638e34a1216bae7a87a2be92d Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 14 May 2009 13:43:13 +0000 Subject: [PATCH 0751/1707] 2009-05-14 Pavel Roskin * commands/i386/pc/drivemap_int13h.S: Eliminate unconditional jump. This saves two bytes, so the typical case of 2 swapped drives would fit 32 bytes. --- ChangeLog | 6 ++++++ commands/i386/pc/drivemap_int13h.S | 11 ++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 360b73a85..a488561a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-14 Pavel Roskin + + * commands/i386/pc/drivemap_int13h.S: Eliminate unconditional + jump. This saves two bytes, so the typical case of 2 swapped + drives would fit 32 bytes. + 2009-05-13 Pavel Roskin * loader/i386/multiboot.c (grub_multiboot): Cast mmap_addr to diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 7db3a6793..6513411be 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -37,14 +37,11 @@ more_remaining: movw %cs:(%bx), %ax cmpb %ah, %al jz not_found /* DRV=DST => map end - drive not remapped, keep DL. */ + inc %bx + inc %bx cmpb %dl, %al - jz found /* Found - drive remapped, modify DL. */ - inc %bx - inc %bx - jmp more_remaining /* Not found, but more remaining, loop. */ - -found: - movb %ah, %dl + jnz more_remaining /* Not found, but more remaining, loop. */ + movb %ah, %dl /* Found - drive remapped, modify DL. */ not_found: pop %bx From cf353a474255f61fe12c3ace934dfa61331b4819 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Thu, 14 May 2009 21:56:46 +0000 Subject: [PATCH 0752/1707] 2009-05-14 Christian Franke * commands/i386/pc/drivemap_int13h.S: Add missing EXT_C for symbols. This fixes build on Cygwin. --- ChangeLog | 5 +++++ commands/i386/pc/drivemap_int13h.S | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a488561a3..51c211c43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-14 Christian Franke + + * commands/i386/pc/drivemap_int13h.S: Add missing EXT_C for symbols. + This fixes build on Cygwin. + 2009-05-14 Pavel Roskin * commands/i386/pc/drivemap_int13h.S: Eliminate unconditional diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 6513411be..44f91bb56 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -19,7 +19,7 @@ #include -#define INT13H_OFFSET(x) ((x) - grub_drivemap_handler) +#define INT13H_OFFSET(x) ((x) - EXT_C(grub_drivemap_handler)) .code16 @@ -31,7 +31,7 @@ FUNCTION(grub_drivemap_handler) /* Map the drive number (always in DL). */ push %ax push %bx - movw $INT13H_OFFSET(grub_drivemap_mapstart), %bx + movw $INT13H_OFFSET(EXT_C(grub_drivemap_mapstart)), %bx more_remaining: movw %cs:(%bx), %ax From 5cb5c9c21078eeb344b1fa8b3f131615c7467732 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 15 May 2009 14:47:44 +0000 Subject: [PATCH 0753/1707] Remove incorrect comment that the code must be position independent. --- commands/i386/pc/drivemap_int13h.S | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 44f91bb56..23b7302d6 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -25,8 +25,7 @@ /* Copy starts here. When deployed, this code must be segment-aligned. */ -/* The replacement int13 handler. The code must be position independent. - Preserve all registers. */ +/* The replacement int13 handler. Preserve all registers. */ FUNCTION(grub_drivemap_handler) /* Map the drive number (always in DL). */ push %ax From 5e898c9d714881d91990fd3e6f7f29a893a6f6d3 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 16 May 2009 12:12:12 +0000 Subject: [PATCH 0754/1707] 2009-05-16 Bean * include/grub/kernel.h (grub_module_header_types): Add type OBJ_TYPE_CONFIG. * kern/main.c (grub_load_config): New function. (grub_main): Call grub_load_config to read boot config. * grub-mkimage (generate_image): New parameter config_path. (options): New option --config. (main): Parse --config option, and pass it to generate_image. --- ChangeLog | 12 +++++++++++ include/grub/kernel.h | 1 + kern/main.c | 19 +++++++++++++++++ util/i386/pc/grub-mkimage.c | 42 +++++++++++++++++++++++++++++++++---- 4 files changed, 70 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51c211c43..3ee54e586 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-05-16 Bean + + * include/grub/kernel.h (grub_module_header_types): Add type + OBJ_TYPE_CONFIG. + + * kern/main.c (grub_load_config): New function. + (grub_main): Call grub_load_config to read boot config. + + * grub-mkimage (generate_image): New parameter config_path. + (options): New option --config. + (main): Parse --config option, and pass it to generate_image. + 2009-05-14 Christian Franke * commands/i386/pc/drivemap_int13h.S: Add missing EXT_C for symbols. diff --git a/include/grub/kernel.h b/include/grub/kernel.h index 74aca400f..02bc2765a 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -31,6 +31,7 @@ struct grub_module_header { OBJ_TYPE_ELF, OBJ_TYPE_MEMDISK, + OBJ_TYPE_CONFIG } grub_module_header_types; /* The size of object (including this header). */ diff --git a/kern/main.c b/kern/main.c index 1d88b60f6..1082aad0f 100644 --- a/kern/main.c +++ b/kern/main.c @@ -74,6 +74,24 @@ grub_load_modules (void) grub_module_iterate (hook); } +static void +grub_load_config (void) +{ + auto int hook (struct grub_module_header *); + int hook (struct grub_module_header *header) + { + /* Not an ELF module, skip. */ + if (header->type != OBJ_TYPE_CONFIG) + return 0; + + grub_parser_execute ((char *) header + + sizeof (struct grub_module_header)); + return 1; + } + + grub_module_iterate (hook); +} + /* Write hook for the environment variables of root. Remove surrounding parentheses, if any. */ static char * @@ -153,6 +171,7 @@ grub_main (void) grub_register_rescue_parser (); grub_register_rescue_reader (); + grub_load_config (); grub_load_normal_mode (); grub_reader_loop (0); } diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 4625b6ddb..1bdddac4d 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -129,11 +129,13 @@ compress_kernel (char *kernel_img, size_t kernel_size, #endif static void -generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *memdisk_path) +generate_image (const char *dir, char *prefix, FILE *out, char *mods[], + char *memdisk_path, char *config_path) { grub_addr_t module_addr = 0; char *kernel_img, *boot_img, *core_img; - size_t kernel_size, boot_size, total_module_size, core_size, memdisk_size = 0; + size_t kernel_size, boot_size, total_module_size, core_size; + size_t memdisk_size = 0, config_size = 0; char *kernel_path, *boot_path; unsigned num; size_t offset; @@ -154,6 +156,13 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me total_module_size += memdisk_size + sizeof (struct grub_module_header); } + if (config_path) + { + config_size = grub_util_get_image_size (config_path) + 1; + grub_util_info ("the size of config file is 0x%x", config_size); + total_module_size += config_size + sizeof (struct grub_module_header); + } + for (p = path_list; p; p = p->next) total_module_size += (grub_util_get_image_size (p->name) + sizeof (struct grub_module_header)); @@ -203,6 +212,20 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *me offset += memdisk_size; } + if (config_path) + { + struct grub_module_header *header; + + header = (struct grub_module_header *) (kernel_img + offset); + header->type = grub_cpu_to_le32 (OBJ_TYPE_CONFIG); + header->size = grub_cpu_to_le32 (config_size + sizeof (*header)); + offset += sizeof (*header); + + grub_util_load_image (config_path, kernel_img + offset); + offset += config_size; + *(kernel_img + offset - 1) = 0; + } + compress_kernel (kernel_img, kernel_size + total_module_size, &core_img, &core_size); @@ -276,6 +299,7 @@ static struct option options[] = {"directory", required_argument, 0, 'd'}, {"prefix", required_argument, 0, 'p'}, {"memdisk", required_argument, 0, 'm'}, + {"config", required_argument, 0, 'c'}, {"output", required_argument, 0, 'o'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, @@ -297,6 +321,7 @@ Make a bootable image of GRUB.\n\ -d, --directory=DIR use images and modules under DIR [default=%s]\n\ -p, --prefix=DIR set grub_prefix directory [default=%s]\n\ -m, --memdisk=FILE embed FILE as a memdisk image\n\ + -c, --config=FILE embed FILE as boot config\n\ -o, --output=FILE output a generated image to FILE [default=stdout]\n\ -h, --help display this message and exit\n\ -V, --version print version information and exit\n\ @@ -315,13 +340,14 @@ main (int argc, char *argv[]) char *dir = NULL; char *prefix = NULL; char *memdisk = NULL; + char *config = NULL; FILE *fp = stdout; progname = "grub-mkimage"; while (1) { - int c = getopt_long (argc, argv, "d:p:m:o:hVv", options, 0); + int c = getopt_long (argc, argv, "d:p:m:c:o:hVv", options, 0); if (c == -1) break; @@ -354,6 +380,13 @@ main (int argc, char *argv[]) prefix = xstrdup ("(memdisk)/boot/grub"); break; + case 'c': + if (config) + free (config); + + config = xstrdup (optarg); + break; + case 'h': usage (0); break; @@ -386,7 +419,8 @@ main (int argc, char *argv[]) grub_util_error ("cannot open %s", output); } - generate_image (dir ? : GRUB_LIBDIR, prefix ? : DEFAULT_DIRECTORY, fp, argv + optind, memdisk); + generate_image (dir ? : GRUB_LIBDIR, prefix ? : DEFAULT_DIRECTORY, fp, + argv + optind, memdisk, config); fclose (fp); From 9d87a1ba369502b53cd46eea0df0678a141d5bb3 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 16 May 2009 12:46:24 +0000 Subject: [PATCH 0755/1707] 2009-05-16 Bean * conf/common.rmk (pkglib_MODULES): Add lua.mod. (lua_mod_SOURCES): New variable. (lua_mod_CFLAGS): Likewise. (lua_mod_LDFLAGS): Likewise. * conf/i386.rmk (pkglib_MODULES): Add setjmp.mod. (setjmp_mod_SOURCES): New variable. (setjmp_mod_CFLAGS): Likewise. (setjmp_LDFLAGS): Likewise. * conf/x86_64-efi.rmk (pkglib_MODULES): Add setjmp.mod. (setjmp_mod_SOURCES): New variable. (setjmp_mod_CFLAGS): Likewise. (setjmp_LDFLAGS): Likewise. * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod. (setjmp_mod_SOURCES): New variable. (setjmp_mod_CFLAGS): Likewise. (setjmp_LDFLAGS): Likewise. * conf/sparc64-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod. (setjmp_mod_SOURCES): New variable. (setjmp_mod_CFLAGS): Likewise. (setjmp_LDFLAGS): Likewise. * normal/i386/setjmp.S: Moved from here ... * lib/i386/setjmp.S: ... Moved here * normal/x86_64/setjmp.S: Moved from here ... * lib/x86_64/setjmp.S: ... Moved here * normal/powerpc/setjmp.S: Moved from here ... * lib/powerpc/setjmp.S: ... Moved here * normal/sparc64/setjmp.S: Moved from here ... * lib/sparc64/setjmp.S: ... Moved here * include/grub/i386/setjmp.h (grub_setjmp): Don't use attribute returns_twice in mingw. * script/lua/grub_lib.c: New file. * script/lua/grub_lib.h: Likewise. * script/lua/grub_lua.h: Likewise. * script/lua/grub_main.c: Likewise. * script/lua/lapi.c: Likewise. * script/lua/lapi.h: Likewise. * script/lua/lauxlib.c: Likewise. * script/lua/lauxlib.h: Likewise. * script/lua/lbaselib.c: Likewise. * script/lua/lcode.c: Likewise. * script/lua/lcode.h: Likewise. * script/lua/ldblib.c: Likewise. * script/lua/ldebug.c: Likewise. * script/lua/ldebug.h: Likewise. * script/lua/ldo.c: Likewise. * script/lua/ldo.h: Likewise. * script/lua/ldump.c: Likewise. * script/lua/lfunc.c: Likewise. * script/lua/lfunc.h: Likewise. * script/lua/lgc.c: Likewise. * script/lua/lgc.h: Likewise. * script/lua/linit.c: Likewise. * script/lua/liolib.c: Likewise. * script/lua/llex.c: Likewise. * script/lua/llex.h: Likewise. * script/lua/llimits.h: Likewise. * script/lua/lmathlib.c: Likewise. * script/lua/lmem.c: Likewise. * script/lua/lmem.h: Likewise. * script/lua/loadlib.c: Likewise. * script/lua/lobject.c: Likewise. * script/lua/lobject.h: Likewise. * script/lua/lopcodes.c: Likewise. * script/lua/lopcodes.h: Likewise. * script/lua/loslib.c: Likewise. * script/lua/lparser.c: Likewise. * script/lua/lparser.h: Likewise. * script/lua/lstate.c: Likewise. * script/lua/lstate.h: Likewise. * script/lua/lstring.c: Likewise. * script/lua/lstring.h: Likewise. * script/lua/lstrlib.c: Likewise. * script/lua/ltable.c: Likewise. * script/lua/ltable.h: Likewise. * script/lua/ltablib.c: Likewise. * script/lua/ltm.c: Likewise. * script/lua/ltm.h: Likewise. * script/lua/lua.h: Likewise. * script/lua/luaconf.h: Likewise. * script/lua/lualib.h: Likewise. * script/lua/lundump.c: Likewise. * script/lua/lundump.h: Likewise. * script/lua/lvm.c: Likewise. * script/lua/lvm.h: Likewise. * script/lua/lzio.c: Likewise. * script/lua/lzio.h: Likewise. --- ChangeLog | 96 ++++++++++++++++++++++++++++++++ conf/common.rmk | 21 ++++++- conf/i386.rmk | 6 ++ conf/powerpc-ieee1275.rmk | 7 ++- conf/sparc64-ieee1275.rmk | 6 ++ conf/x86_64-efi.rmk | 6 ++ include/grub/i386/setjmp.h | 4 ++ {normal => lib}/i386/setjmp.S | 0 {normal => lib}/powerpc/setjmp.S | 0 {normal => lib}/sparc64/setjmp.S | 0 {normal => lib}/x86_64/setjmp.S | 0 11 files changed, 144 insertions(+), 2 deletions(-) rename {normal => lib}/i386/setjmp.S (100%) rename {normal => lib}/powerpc/setjmp.S (100%) rename {normal => lib}/sparc64/setjmp.S (100%) rename {normal => lib}/x86_64/setjmp.S (100%) diff --git a/ChangeLog b/ChangeLog index 3ee54e586..c9495020a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,99 @@ +2009-05-16 Bean + + * conf/common.rmk (pkglib_MODULES): Add lua.mod. + (lua_mod_SOURCES): New variable. + (lua_mod_CFLAGS): Likewise. + (lua_mod_LDFLAGS): Likewise. + + * conf/i386.rmk (pkglib_MODULES): Add setjmp.mod. + (setjmp_mod_SOURCES): New variable. + (setjmp_mod_CFLAGS): Likewise. + (setjmp_LDFLAGS): Likewise. + + * conf/x86_64-efi.rmk (pkglib_MODULES): Add setjmp.mod. + (setjmp_mod_SOURCES): New variable. + (setjmp_mod_CFLAGS): Likewise. + (setjmp_LDFLAGS): Likewise. + + * conf/powerpc-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod. + (setjmp_mod_SOURCES): New variable. + (setjmp_mod_CFLAGS): Likewise. + (setjmp_LDFLAGS): Likewise. + + * conf/sparc64-ieee1275.rmk (pkglib_MODULES): Add setjmp.mod. + (setjmp_mod_SOURCES): New variable. + (setjmp_mod_CFLAGS): Likewise. + (setjmp_LDFLAGS): Likewise. + + * normal/i386/setjmp.S: Moved from here ... + * lib/i386/setjmp.S: ... Moved here + * normal/x86_64/setjmp.S: Moved from here ... + * lib/x86_64/setjmp.S: ... Moved here + * normal/powerpc/setjmp.S: Moved from here ... + * lib/powerpc/setjmp.S: ... Moved here + * normal/sparc64/setjmp.S: Moved from here ... + * lib/sparc64/setjmp.S: ... Moved here + + * include/grub/i386/setjmp.h (grub_setjmp): Don't use attribute + returns_twice in mingw. + + * script/lua/grub_lib.c: New file. + * script/lua/grub_lib.h: Likewise. + * script/lua/grub_lua.h: Likewise. + * script/lua/grub_main.c: Likewise. + * script/lua/lapi.c: Likewise. + * script/lua/lapi.h: Likewise. + * script/lua/lauxlib.c: Likewise. + * script/lua/lauxlib.h: Likewise. + * script/lua/lbaselib.c: Likewise. + * script/lua/lcode.c: Likewise. + * script/lua/lcode.h: Likewise. + * script/lua/ldblib.c: Likewise. + * script/lua/ldebug.c: Likewise. + * script/lua/ldebug.h: Likewise. + * script/lua/ldo.c: Likewise. + * script/lua/ldo.h: Likewise. + * script/lua/ldump.c: Likewise. + * script/lua/lfunc.c: Likewise. + * script/lua/lfunc.h: Likewise. + * script/lua/lgc.c: Likewise. + * script/lua/lgc.h: Likewise. + * script/lua/linit.c: Likewise. + * script/lua/liolib.c: Likewise. + * script/lua/llex.c: Likewise. + * script/lua/llex.h: Likewise. + * script/lua/llimits.h: Likewise. + * script/lua/lmathlib.c: Likewise. + * script/lua/lmem.c: Likewise. + * script/lua/lmem.h: Likewise. + * script/lua/loadlib.c: Likewise. + * script/lua/lobject.c: Likewise. + * script/lua/lobject.h: Likewise. + * script/lua/lopcodes.c: Likewise. + * script/lua/lopcodes.h: Likewise. + * script/lua/loslib.c: Likewise. + * script/lua/lparser.c: Likewise. + * script/lua/lparser.h: Likewise. + * script/lua/lstate.c: Likewise. + * script/lua/lstate.h: Likewise. + * script/lua/lstring.c: Likewise. + * script/lua/lstring.h: Likewise. + * script/lua/lstrlib.c: Likewise. + * script/lua/ltable.c: Likewise. + * script/lua/ltable.h: Likewise. + * script/lua/ltablib.c: Likewise. + * script/lua/ltm.c: Likewise. + * script/lua/ltm.h: Likewise. + * script/lua/lua.h: Likewise. + * script/lua/luaconf.h: Likewise. + * script/lua/lualib.h: Likewise. + * script/lua/lundump.c: Likewise. + * script/lua/lundump.h: Likewise. + * script/lua/lvm.c: Likewise. + * script/lua/lvm.h: Likewise. + * script/lua/lzio.c: Likewise. + * script/lua/lzio.h: Likewise. + 2009-05-16 Bean * include/grub/kernel.h (grub_module_header_types): Add type diff --git a/conf/common.rmk b/conf/common.rmk index bca7f7806..1b9a6cdb4 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -343,7 +343,8 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - pcpart.mod memrw.mod boot.mod normal.mod sh.mod gptsync.mod + pcpart.mod memrw.mod boot.mod normal.mod sh.mod lua.mod \ + gptsync.mod # For gptsync.mod. gptsync_mod_SOURCES = commands/gptsync.c @@ -490,6 +491,24 @@ sh_mod_SOURCES = script/sh/main.c script/sh/script.c script/sh/execute.c \ sh_mod_CFLAGS = $(COMMON_CFLAGS) sh_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For lua.mod. +lua_mod_SOURCES = script/lua/lapi.c script/lua/lcode.c script/lua/ldebug.c \ + script/lua/ldo.c script/lua/ldump.c script/lua/lfunc.c \ + script/lua/lgc.c script/lua/llex.c script/lua/lmem.c \ + script/lua/lobject.c script/lua/lopcodes.c script/lua/lparser.c \ + script/lua/lstate.c script/lua/lstring.c script/lua/ltable.c \ + script/lua/ltm.c script/lua/lundump.c script/lua/lvm.c \ + script/lua/lzio.c script/lua/lauxlib.c script/lua/lbaselib.c \ + script/lua/linit.c script/lua/ltablib.c \ + script/lua/grub_main.c script/lua/grub_lib.c +lua_mod_CFLAGS = $(COMMON_CFLAGS) +lua_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# Extra libraries for lua +# script/lua/lmathlib.c script/lua/loslib.c script/lua/liolib.c +# script/lua/lstrlib.c script/lua/ldblib.c script/lua/ltablib.c +# script/lua/loadlib.c + # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod diff --git a/conf/i386.rmk b/conf/i386.rmk index 93f84ce39..e8e2857cb 100644 --- a/conf/i386.rmk +++ b/conf/i386.rmk @@ -14,3 +14,9 @@ pkglib_MODULES += vga_text.mod vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c vga_text_mod_CFLAGS = $(COMMON_CFLAGS) vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For setjmp.mod +pkglib_MODULES += setjmp.mod +setjmp_mod_SOURCES = lib/i386/setjmp.S +setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 204d54a83..bf0dd49bb 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -156,5 +156,10 @@ lsmmap_mod_SOURCES = commands/lsmmap.c lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) -include $(srcdir)/conf/common.mk +# For setjmp.mod +pkglib_MODULES += setjmp.mod +setjmp_mod_SOURCES = lib/powerpc/setjmp.S +setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) +include $(srcdir)/conf/common.mk diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index c94b342af..234f80122 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -174,4 +174,10 @@ lsmmap_mod_SOURCES = commands/lsmmap.c lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For setjmp.mod +pkglib_MODULES += setjmp.mod +setjmp_mod_SOURCES = lib/sparc64/setjmp.S +setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 92ad9f7d4..d25b03a4c 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -193,4 +193,10 @@ xnu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) +# For setjmp.mod +pkglib_MODULES += setjmp.mod +setjmp_mod_SOURCES = lib/x86_64/setjmp.S +setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) + include $(srcdir)/conf/common.mk diff --git a/include/grub/i386/setjmp.h b/include/grub/i386/setjmp.h index c5f94b406..6b6b6fd15 100644 --- a/include/grub/i386/setjmp.h +++ b/include/grub/i386/setjmp.h @@ -21,8 +21,12 @@ typedef unsigned long grub_jmp_buf[6]; +#ifdef __MINGW32__ +int grub_setjmp (grub_jmp_buf env) __attribute__ ((cdecl, regparm (3))); +#else int grub_setjmp (grub_jmp_buf env) __attribute__ ((returns_twice, cdecl, regparm (3))); +#endif void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn, cdecl, regparm (3))); diff --git a/normal/i386/setjmp.S b/lib/i386/setjmp.S similarity index 100% rename from normal/i386/setjmp.S rename to lib/i386/setjmp.S diff --git a/normal/powerpc/setjmp.S b/lib/powerpc/setjmp.S similarity index 100% rename from normal/powerpc/setjmp.S rename to lib/powerpc/setjmp.S diff --git a/normal/sparc64/setjmp.S b/lib/sparc64/setjmp.S similarity index 100% rename from normal/sparc64/setjmp.S rename to lib/sparc64/setjmp.S diff --git a/normal/x86_64/setjmp.S b/lib/x86_64/setjmp.S similarity index 100% rename from normal/x86_64/setjmp.S rename to lib/x86_64/setjmp.S From 563075a52740e6037fb1af7481dd4185a800efdb Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 16 May 2009 12:53:43 +0000 Subject: [PATCH 0756/1707] 2009-05-16 Bean * script/lua: Forgot to check in lua files. --- script/lua/grub_lib.c | 108 ++++ script/lua/grub_lib.h | 24 + script/lua/grub_lua.h | 108 ++++ script/lua/grub_main.c | 120 ++++ script/lua/lapi.c | 1088 ++++++++++++++++++++++++++++++++ script/lua/lapi.h | 16 + script/lua/lauxlib.c | 668 ++++++++++++++++++++ script/lua/lauxlib.h | 175 ++++++ script/lua/lbaselib.c | 652 +++++++++++++++++++ script/lua/lcode.c | 848 +++++++++++++++++++++++++ script/lua/lcode.h | 76 +++ script/lua/ldblib.c | 398 ++++++++++++ script/lua/ldebug.c | 638 +++++++++++++++++++ script/lua/ldebug.h | 33 + script/lua/ldo.c | 519 ++++++++++++++++ script/lua/ldo.h | 57 ++ script/lua/ldump.c | 164 +++++ script/lua/lfunc.c | 174 ++++++ script/lua/lfunc.h | 34 + script/lua/lgc.c | 713 +++++++++++++++++++++ script/lua/lgc.h | 110 ++++ script/lua/linit.c | 38 ++ script/lua/liolib.c | 553 +++++++++++++++++ script/lua/llex.c | 467 ++++++++++++++ script/lua/llex.h | 81 +++ script/lua/llimits.h | 128 ++++ script/lua/lmathlib.c | 263 ++++++++ script/lua/lmem.c | 86 +++ script/lua/lmem.h | 50 ++ script/lua/loadlib.c | 665 ++++++++++++++++++++ script/lua/lobject.c | 216 +++++++ script/lua/lobject.h | 380 ++++++++++++ script/lua/lopcodes.c | 102 +++ script/lua/lopcodes.h | 268 ++++++++ script/lua/loslib.c | 243 ++++++++ script/lua/lparser.c | 1340 ++++++++++++++++++++++++++++++++++++++++ script/lua/lparser.h | 82 +++ script/lua/lstate.c | 213 +++++++ script/lua/lstate.h | 169 +++++ script/lua/lstring.c | 112 ++++ script/lua/lstring.h | 31 + script/lua/lstrlib.c | 870 ++++++++++++++++++++++++++ script/lua/ltable.c | 594 ++++++++++++++++++ script/lua/ltable.h | 40 ++ script/lua/ltablib.c | 288 +++++++++ script/lua/ltm.c | 76 +++ script/lua/ltm.h | 54 ++ script/lua/lua.h | 388 ++++++++++++ script/lua/luaconf.h | 811 ++++++++++++++++++++++++ script/lua/lualib.h | 53 ++ script/lua/lundump.c | 229 +++++++ script/lua/lundump.h | 36 ++ script/lua/lvm.c | 764 +++++++++++++++++++++++ script/lua/lvm.h | 36 ++ script/lua/lzio.c | 83 +++ script/lua/lzio.h | 67 ++ 56 files changed, 16599 insertions(+) create mode 100644 script/lua/grub_lib.c create mode 100644 script/lua/grub_lib.h create mode 100644 script/lua/grub_lua.h create mode 100644 script/lua/grub_main.c create mode 100644 script/lua/lapi.c create mode 100644 script/lua/lapi.h create mode 100644 script/lua/lauxlib.c create mode 100644 script/lua/lauxlib.h create mode 100644 script/lua/lbaselib.c create mode 100644 script/lua/lcode.c create mode 100644 script/lua/lcode.h create mode 100644 script/lua/ldblib.c create mode 100644 script/lua/ldebug.c create mode 100644 script/lua/ldebug.h create mode 100644 script/lua/ldo.c create mode 100644 script/lua/ldo.h create mode 100644 script/lua/ldump.c create mode 100644 script/lua/lfunc.c create mode 100644 script/lua/lfunc.h create mode 100644 script/lua/lgc.c create mode 100644 script/lua/lgc.h create mode 100644 script/lua/linit.c create mode 100644 script/lua/liolib.c create mode 100644 script/lua/llex.c create mode 100644 script/lua/llex.h create mode 100644 script/lua/llimits.h create mode 100644 script/lua/lmathlib.c create mode 100644 script/lua/lmem.c create mode 100644 script/lua/lmem.h create mode 100644 script/lua/loadlib.c create mode 100644 script/lua/lobject.c create mode 100644 script/lua/lobject.h create mode 100644 script/lua/lopcodes.c create mode 100644 script/lua/lopcodes.h create mode 100644 script/lua/loslib.c create mode 100644 script/lua/lparser.c create mode 100644 script/lua/lparser.h create mode 100644 script/lua/lstate.c create mode 100644 script/lua/lstate.h create mode 100644 script/lua/lstring.c create mode 100644 script/lua/lstring.h create mode 100644 script/lua/lstrlib.c create mode 100644 script/lua/ltable.c create mode 100644 script/lua/ltable.h create mode 100644 script/lua/ltablib.c create mode 100644 script/lua/ltm.c create mode 100644 script/lua/ltm.h create mode 100644 script/lua/lua.h create mode 100644 script/lua/luaconf.h create mode 100644 script/lua/lualib.h create mode 100644 script/lua/lundump.c create mode 100644 script/lua/lundump.h create mode 100644 script/lua/lvm.c create mode 100644 script/lua/lvm.h create mode 100644 script/lua/lzio.c create mode 100644 script/lua/lzio.h diff --git a/script/lua/grub_lib.c b/script/lua/grub_lib.c new file mode 100644 index 000000000..8004ca648 --- /dev/null +++ b/script/lua/grub_lib.c @@ -0,0 +1,108 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include "lua.h" +#include "lauxlib.h" +#include "lualib.h" +#include "grub_lib.h" + +#include +#include +#include + +static int +grub_lua_run (lua_State *state) +{ + int n; + char **args; + grub_err_t result; + + if (! lua_gettop(state)) + return 0; + + if ((! grub_parser_split_cmdline (lua_tostring (state, 1), 0, &n, &args)) + && (n >= 0)) + { + grub_command_t cmd; + + cmd = grub_command_find (args[0]); + if (cmd) + (cmd->func) (cmd, n, &args[1]); + else + grub_error (GRUB_ERR_FILE_NOT_FOUND, "command not found"); + + grub_free (args[0]); + grub_free (args); + } + + result = grub_errno; + grub_errno = 0; + + lua_pushinteger(state, result); + + if (result) + lua_pushstring (state, grub_errmsg); + + return (result) ? 2 : 1; +} + +static int +grub_lua_getenv (lua_State *state) +{ + int n, i; + + n = lua_gettop(state); + for (i = 1; i <= n; i++) + { + char *name, *value; + + name = lua_tostring (state, i); + value = grub_env_get (name); + if (value) + lua_pushstring (state, value); + else + lua_pushnil (state); + } + + return n; +} + +static int +grub_lua_setenv (lua_State *state) +{ + char *name, *value; + + if (lua_gettop(state) != 2) + return 0; + + name = lua_tostring (state, 1); + value = lua_tostring (state, 2); + + if (name[0]) + grub_env_set (name, value); + + return 0; +} + +luaL_Reg grub_lua_lib[] = + { + {"run", grub_lua_run}, + {"getenv", grub_lua_getenv}, + {"setenv", grub_lua_setenv}, + {0, 0} + }; diff --git a/script/lua/grub_lib.h b/script/lua/grub_lib.h new file mode 100644 index 000000000..2253a4145 --- /dev/null +++ b/script/lua/grub_lib.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_LUA_LIB_HEADER +#define GRUB_LUA_LIB_HEADER 1 + +extern luaL_Reg grub_lua_lib[]; + +#endif diff --git a/script/lua/grub_lua.h b/script/lua/grub_lua.h new file mode 100644 index 000000000..a181b52f1 --- /dev/null +++ b/script/lua/grub_lua.h @@ -0,0 +1,108 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_LUA_HEADER +#define GRUB_LUA_HEADER 1 + +#include +#include +#include +#include +#include + +#define INT_MAX GRUB_LONG_MAX +#define UCHAR_MAX 255 +#define SHRT_MAX 32767 + +#undef UNUSED +#define UNUSED (void) + +#define memcpy grub_memcpy +#define memcmp grub_memcmp +#define strcpy grub_strcpy +#define strstr grub_strstr +#define strchr grub_strchr +#define strlen grub_strlen +#define strtoul grub_strtoul +#define strtod(s,e) grub_strtoul(s,e,0) +#define sprintf grub_sprintf +#define strncpy grub_strncpy +#define strcat grub_strcat +#define strncat grub_strncat +#define strcoll grub_strcmp +#define strcmp grub_strcmp +#define tolower grub_tolower +#define toupper grub_toupper + +#define malloc grub_malloc +#define realloc grub_realloc +#define free grub_free + +#define exit(a) grub_exit() +#define jmp_buf grub_jmp_buf +#define setjmp grub_setjmp +#define longjmp grub_longjmp + +#define fputs(s,f) grub_printf(s) + +#define isdigit grub_isdigit +#define isalpha grub_isalpha +#define isspace grub_isspace + +static inline int +isalnum (int c) +{ + return (isalpha (c) || isdigit (c)); +} + +static inline int +iscntrl (int c) +{ + return ((c <= 0x1f) || (c == 0x7f)); +} + +static inline int +strcspn(const char *s1, const char *s2) +{ + int size = 0; + + while (*s1) + { + const char *p = s2; + + while (*p) + { + if (*s1 == *p) + return size; + p++; + } + + s1++; + size++; + } + + return size; +} + +static inline int +abs (int c) +{ + return (c >= 0) ? : -c; +} + +#endif diff --git a/script/lua/grub_main.c b/script/lua/grub_main.c new file mode 100644 index 000000000..f68502121 --- /dev/null +++ b/script/lua/grub_main.c @@ -0,0 +1,120 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include "lua.h" +#include "lauxlib.h" +#include "lualib.h" +#include "grub_lib.h" + +#include +#include + +static lua_State *state; + +static grub_err_t +grub_lua_parse_line (char *line, grub_reader_getline_t getline) +{ + int r; + char *old_line = 0; + + lua_settop(state, 0); + while (1) + { + r = luaL_loadbuffer (state, line, grub_strlen (line), "grub"); + if (! r) + { + r = lua_pcall (state, 0, 0, 0); + if (r) + grub_error (GRUB_ERR_BAD_ARGUMENT, "lua command fails"); + else + { + grub_free (old_line); + return grub_errno; + } + break; + } + + if (r == LUA_ERRSYNTAX) + { + int lmsg; + const char *msg = lua_tolstring(state, -1, &lmsg); + const char *tp = msg + lmsg - (sizeof(LUA_QL("")) - 1); + if (grub_strstr(msg, LUA_QL("")) == tp) + { + char *n, *t; + int len; + + lua_pop(state, 1); + if ((getline (&n, 1)) || (! n)) + { + grub_error (GRUB_ERR_BAD_ARGUMENT, "incomplete command"); + break; + } + + len = grub_strlen (line); + t = grub_malloc (len + grub_strlen (n) + 2); + if (! t) + break; + + grub_strcpy (t, line); + t[len] = '\n'; + grub_strcpy (t + len + 1, n); + grub_free (old_line); + line = old_line = t; + continue; + } + } + + break; + } + + grub_free (old_line); + lua_gc (state, LUA_GCCOLLECT, 0); + + return grub_errno; +} + +static struct grub_parser grub_lua_parser = + { + .name = "lua", + .parse_line = grub_lua_parse_line + }; + +GRUB_MOD_INIT(lua) +{ + (void) mod; + + state = lua_open (); + if (state) + { + lua_gc(state, LUA_GCSTOP, 0); + luaL_openlibs(state); + luaL_register(state, "grub", grub_lua_lib); + lua_gc(state, LUA_GCRESTART, 0); + grub_parser_register ("lua", &grub_lua_parser); + } +} + +GRUB_MOD_FINI(lua) +{ + if (state) + { + grub_parser_unregister (&grub_lua_parser); + lua_close(state); + } +} diff --git a/script/lua/lapi.c b/script/lua/lapi.c new file mode 100644 index 000000000..2eaf45c66 --- /dev/null +++ b/script/lua/lapi.c @@ -0,0 +1,1088 @@ +/* +** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $ +** Lua API +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#include +#endif + +#define lapi_c +#define LUA_CORE + +#include "lua.h" + +#include "lapi.h" +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lundump.h" +#include "lvm.h" + + + +const char lua_ident[] = + "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n" + "$Authors: " LUA_AUTHORS " $\n" + "$URL: www.lua.org $\n"; + + + +#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base)) + +#define api_checkvalidindex(L, i) api_check(L, (i) != luaO_nilobject) + +#define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;} + + + +static TValue *index2adr (lua_State *L, int idx) { + if (idx > 0) { + TValue *o = L->base + (idx - 1); + api_check(L, idx <= L->ci->top - L->base); + if (o >= L->top) return cast(TValue *, luaO_nilobject); + else return o; + } + else if (idx > LUA_REGISTRYINDEX) { + api_check(L, idx != 0 && -idx <= L->top - L->base); + return L->top + idx; + } + else switch (idx) { /* pseudo-indices */ + case LUA_REGISTRYINDEX: return registry(L); + case LUA_ENVIRONINDEX: { + Closure *func = curr_func(L); + sethvalue(L, &L->env, func->c.env); + return &L->env; + } + case LUA_GLOBALSINDEX: return gt(L); + default: { + Closure *func = curr_func(L); + idx = LUA_GLOBALSINDEX - idx; + return (idx <= func->c.nupvalues) + ? &func->c.upvalue[idx-1] + : cast(TValue *, luaO_nilobject); + } + } +} + + +static Table *getcurrenv (lua_State *L) { + if (L->ci == L->base_ci) /* no enclosing function? */ + return hvalue(gt(L)); /* use global table as environment */ + else { + Closure *func = curr_func(L); + return func->c.env; + } +} + + +void luaA_pushobject (lua_State *L, const TValue *o) { + setobj2s(L, L->top, o); + api_incr_top(L); +} + + +LUA_API int lua_checkstack (lua_State *L, int size) { + int res = 1; + lua_lock(L); + if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) + res = 0; /* stack overflow */ + else if (size > 0) { + luaD_checkstack(L, size); + if (L->ci->top < L->top + size) + L->ci->top = L->top + size; + } + lua_unlock(L); + return res; +} + + +LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { + int i; + if (from == to) return; + lua_lock(to); + api_checknelems(from, n); + api_check(from, G(from) == G(to)); + api_check(from, to->ci->top - to->top >= n); + from->top -= n; + for (i = 0; i < n; i++) { + setobj2s(to, to->top++, from->top + i); + } + lua_unlock(to); +} + + +LUA_API void lua_setlevel (lua_State *from, lua_State *to) { + to->nCcalls = from->nCcalls; +} + + +LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { + lua_CFunction old; + lua_lock(L); + old = G(L)->panic; + G(L)->panic = panicf; + lua_unlock(L); + return old; +} + + +LUA_API lua_State *lua_newthread (lua_State *L) { + lua_State *L1; + lua_lock(L); + luaC_checkGC(L); + L1 = luaE_newthread(L); + setthvalue(L, L->top, L1); + api_incr_top(L); + lua_unlock(L); + luai_userstatethread(L, L1); + return L1; +} + + + +/* +** basic stack manipulation +*/ + + +LUA_API int lua_gettop (lua_State *L) { + return cast_int(L->top - L->base); +} + + +LUA_API void lua_settop (lua_State *L, int idx) { + lua_lock(L); + if (idx >= 0) { + api_check(L, idx <= L->stack_last - L->base); + while (L->top < L->base + idx) + setnilvalue(L->top++); + L->top = L->base + idx; + } + else { + api_check(L, -(idx+1) <= (L->top - L->base)); + L->top += idx+1; /* `subtract' index (index is negative) */ + } + lua_unlock(L); +} + + +LUA_API void lua_remove (lua_State *L, int idx) { + StkId p; + lua_lock(L); + p = index2adr(L, idx); + api_checkvalidindex(L, p); + while (++p < L->top) setobjs2s(L, p-1, p); + L->top--; + lua_unlock(L); +} + + +LUA_API void lua_insert (lua_State *L, int idx) { + StkId p; + StkId q; + lua_lock(L); + p = index2adr(L, idx); + api_checkvalidindex(L, p); + for (q = L->top; q>p; q--) setobjs2s(L, q, q-1); + setobjs2s(L, p, L->top); + lua_unlock(L); +} + + +LUA_API void lua_replace (lua_State *L, int idx) { + StkId o; + lua_lock(L); + /* explicit test for incompatible code */ + if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci) + luaG_runerror(L, "no calling environment"); + api_checknelems(L, 1); + o = index2adr(L, idx); + api_checkvalidindex(L, o); + if (idx == LUA_ENVIRONINDEX) { + Closure *func = curr_func(L); + api_check(L, ttistable(L->top - 1)); + func->c.env = hvalue(L->top - 1); + luaC_barrier(L, func, L->top - 1); + } + else { + setobj(L, o, L->top - 1); + if (idx < LUA_GLOBALSINDEX) /* function upvalue? */ + luaC_barrier(L, curr_func(L), L->top - 1); + } + L->top--; + lua_unlock(L); +} + + +LUA_API void lua_pushvalue (lua_State *L, int idx) { + lua_lock(L); + setobj2s(L, L->top, index2adr(L, idx)); + api_incr_top(L); + lua_unlock(L); +} + + + +/* +** access functions (stack -> C) +*/ + + +LUA_API int lua_type (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return (o == luaO_nilobject) ? LUA_TNONE : ttype(o); +} + + +LUA_API const char *lua_typename (lua_State *L, int t) { + UNUSED(L); + return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; +} + + +LUA_API int lua_iscfunction (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return iscfunction(o); +} + + +LUA_API int lua_isnumber (lua_State *L, int idx) { + TValue n; + const TValue *o = index2adr(L, idx); + return tonumber(o, &n); +} + + +LUA_API int lua_isstring (lua_State *L, int idx) { + int t = lua_type(L, idx); + return (t == LUA_TSTRING || t == LUA_TNUMBER); +} + + +LUA_API int lua_isuserdata (lua_State *L, int idx) { + const TValue *o = index2adr(L, idx); + return (ttisuserdata(o) || ttislightuserdata(o)); +} + + +LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { + StkId o1 = index2adr(L, index1); + StkId o2 = index2adr(L, index2); + return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 + : luaO_rawequalObj(o1, o2); +} + + +LUA_API int lua_equal (lua_State *L, int index1, int index2) { + StkId o1, o2; + int i; + lua_lock(L); /* may call tag method */ + o1 = index2adr(L, index1); + o2 = index2adr(L, index2); + i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2); + lua_unlock(L); + return i; +} + + +LUA_API int lua_lessthan (lua_State *L, int index1, int index2) { + StkId o1, o2; + int i; + lua_lock(L); /* may call tag method */ + o1 = index2adr(L, index1); + o2 = index2adr(L, index2); + i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 + : luaV_lessthan(L, o1, o2); + lua_unlock(L); + return i; +} + + + +LUA_API lua_Number lua_tonumber (lua_State *L, int idx) { + TValue n; + const TValue *o = index2adr(L, idx); + if (tonumber(o, &n)) + return nvalue(o); + else + return 0; +} + + +LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) { + TValue n; + const TValue *o = index2adr(L, idx); + if (tonumber(o, &n)) { + lua_Integer res; + lua_Number num = nvalue(o); + lua_number2integer(res, num); + return res; + } + else + return 0; +} + + +LUA_API int lua_toboolean (lua_State *L, int idx) { + const TValue *o = index2adr(L, idx); + return !l_isfalse(o); +} + + +LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { + StkId o = index2adr(L, idx); + if (!ttisstring(o)) { + lua_lock(L); /* `luaV_tostring' may create a new string */ + if (!luaV_tostring(L, o)) { /* conversion failed? */ + if (len != NULL) *len = 0; + lua_unlock(L); + return NULL; + } + luaC_checkGC(L); + o = index2adr(L, idx); /* previous call may reallocate the stack */ + lua_unlock(L); + } + if (len != NULL) *len = tsvalue(o)->len; + return svalue(o); +} + + +LUA_API size_t lua_objlen (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + switch (ttype(o)) { + case LUA_TSTRING: return tsvalue(o)->len; + case LUA_TUSERDATA: return uvalue(o)->len; + case LUA_TTABLE: return luaH_getn(hvalue(o)); + case LUA_TNUMBER: { + size_t l; + lua_lock(L); /* `luaV_tostring' may create a new string */ + l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0); + lua_unlock(L); + return l; + } + default: return 0; + } +} + + +LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return (!iscfunction(o)) ? NULL : clvalue(o)->c.f; +} + + +LUA_API void *lua_touserdata (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + switch (ttype(o)) { + case LUA_TUSERDATA: return (rawuvalue(o) + 1); + case LUA_TLIGHTUSERDATA: return pvalue(o); + default: return NULL; + } +} + + +LUA_API lua_State *lua_tothread (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + return (!ttisthread(o)) ? NULL : thvalue(o); +} + + +LUA_API const void *lua_topointer (lua_State *L, int idx) { + StkId o = index2adr(L, idx); + switch (ttype(o)) { + case LUA_TTABLE: return hvalue(o); + case LUA_TFUNCTION: return clvalue(o); + case LUA_TTHREAD: return thvalue(o); + case LUA_TUSERDATA: + case LUA_TLIGHTUSERDATA: + return lua_touserdata(L, idx); + default: return NULL; + } +} + + + +/* +** push functions (C -> stack) +*/ + + +LUA_API void lua_pushnil (lua_State *L) { + lua_lock(L); + setnilvalue(L->top); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { + lua_lock(L); + setnvalue(L->top, n); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { + lua_lock(L); + setnvalue(L->top, cast_num(n)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { + lua_lock(L); + luaC_checkGC(L); + setsvalue2s(L, L->top, luaS_newlstr(L, s, len)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushstring (lua_State *L, const char *s) { + if (s == NULL) + lua_pushnil(L); + else + lua_pushlstring(L, s, strlen(s)); +} + + +LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, + va_list argp) { + const char *ret; + lua_lock(L); + luaC_checkGC(L); + ret = luaO_pushvfstring(L, fmt, argp); + lua_unlock(L); + return ret; +} + + +LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { + const char *ret; + va_list argp; + lua_lock(L); + luaC_checkGC(L); + va_start(argp, fmt); + ret = luaO_pushvfstring(L, fmt, argp); + va_end(argp); + lua_unlock(L); + return ret; +} + + +LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { + Closure *cl; + lua_lock(L); + luaC_checkGC(L); + api_checknelems(L, n); + cl = luaF_newCclosure(L, n, getcurrenv(L)); + cl->c.f = fn; + L->top -= n; + while (n--) + setobj2n(L, &cl->c.upvalue[n], L->top+n); + setclvalue(L, L->top, cl); + lua_assert(iswhite(obj2gco(cl))); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushboolean (lua_State *L, int b) { + lua_lock(L); + setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { + lua_lock(L); + setpvalue(L->top, p); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API int lua_pushthread (lua_State *L) { + lua_lock(L); + setthvalue(L, L->top, L); + api_incr_top(L); + lua_unlock(L); + return (G(L)->mainthread == L); +} + + + +/* +** get functions (Lua -> stack) +*/ + + +LUA_API void lua_gettable (lua_State *L, int idx) { + StkId t; + lua_lock(L); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + luaV_gettable(L, t, L->top - 1, L->top - 1); + lua_unlock(L); +} + + +LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { + StkId t; + TValue key; + lua_lock(L); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + setsvalue(L, &key, luaS_new(L, k)); + luaV_gettable(L, t, &key, L->top); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_rawget (lua_State *L, int idx) { + StkId t; + lua_lock(L); + t = index2adr(L, idx); + api_check(L, ttistable(t)); + setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); + lua_unlock(L); +} + + +LUA_API void lua_rawgeti (lua_State *L, int idx, int n) { + StkId o; + lua_lock(L); + o = index2adr(L, idx); + api_check(L, ttistable(o)); + setobj2s(L, L->top, luaH_getnum(hvalue(o), n)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { + lua_lock(L); + luaC_checkGC(L); + sethvalue(L, L->top, luaH_new(L, narray, nrec)); + api_incr_top(L); + lua_unlock(L); +} + + +LUA_API int lua_getmetatable (lua_State *L, int objindex) { + const TValue *obj; + Table *mt = NULL; + int res; + lua_lock(L); + obj = index2adr(L, objindex); + switch (ttype(obj)) { + case LUA_TTABLE: + mt = hvalue(obj)->metatable; + break; + case LUA_TUSERDATA: + mt = uvalue(obj)->metatable; + break; + default: + mt = G(L)->mt[ttype(obj)]; + break; + } + if (mt == NULL) + res = 0; + else { + sethvalue(L, L->top, mt); + api_incr_top(L); + res = 1; + } + lua_unlock(L); + return res; +} + + +LUA_API void lua_getfenv (lua_State *L, int idx) { + StkId o; + lua_lock(L); + o = index2adr(L, idx); + api_checkvalidindex(L, o); + switch (ttype(o)) { + case LUA_TFUNCTION: + sethvalue(L, L->top, clvalue(o)->c.env); + break; + case LUA_TUSERDATA: + sethvalue(L, L->top, uvalue(o)->env); + break; + case LUA_TTHREAD: + setobj2s(L, L->top, gt(thvalue(o))); + break; + default: + setnilvalue(L->top); + break; + } + api_incr_top(L); + lua_unlock(L); +} + + +/* +** set functions (stack -> Lua) +*/ + + +LUA_API void lua_settable (lua_State *L, int idx) { + StkId t; + lua_lock(L); + api_checknelems(L, 2); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + luaV_settable(L, t, L->top - 2, L->top - 1); + L->top -= 2; /* pop index and value */ + lua_unlock(L); +} + + +LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { + StkId t; + TValue key; + lua_lock(L); + api_checknelems(L, 1); + t = index2adr(L, idx); + api_checkvalidindex(L, t); + setsvalue(L, &key, luaS_new(L, k)); + luaV_settable(L, t, &key, L->top - 1); + L->top--; /* pop value */ + lua_unlock(L); +} + + +LUA_API void lua_rawset (lua_State *L, int idx) { + StkId t; + lua_lock(L); + api_checknelems(L, 2); + t = index2adr(L, idx); + api_check(L, ttistable(t)); + setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); + luaC_barriert(L, hvalue(t), L->top-1); + L->top -= 2; + lua_unlock(L); +} + + +LUA_API void lua_rawseti (lua_State *L, int idx, int n) { + StkId o; + lua_lock(L); + api_checknelems(L, 1); + o = index2adr(L, idx); + api_check(L, ttistable(o)); + setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1); + luaC_barriert(L, hvalue(o), L->top-1); + L->top--; + lua_unlock(L); +} + + +LUA_API int lua_setmetatable (lua_State *L, int objindex) { + TValue *obj; + Table *mt; + lua_lock(L); + api_checknelems(L, 1); + obj = index2adr(L, objindex); + api_checkvalidindex(L, obj); + if (ttisnil(L->top - 1)) + mt = NULL; + else { + api_check(L, ttistable(L->top - 1)); + mt = hvalue(L->top - 1); + } + switch (ttype(obj)) { + case LUA_TTABLE: { + hvalue(obj)->metatable = mt; + if (mt) + luaC_objbarriert(L, hvalue(obj), mt); + break; + } + case LUA_TUSERDATA: { + uvalue(obj)->metatable = mt; + if (mt) + luaC_objbarrier(L, rawuvalue(obj), mt); + break; + } + default: { + G(L)->mt[ttype(obj)] = mt; + break; + } + } + L->top--; + lua_unlock(L); + return 1; +} + + +LUA_API int lua_setfenv (lua_State *L, int idx) { + StkId o; + int res = 1; + lua_lock(L); + api_checknelems(L, 1); + o = index2adr(L, idx); + api_checkvalidindex(L, o); + api_check(L, ttistable(L->top - 1)); + switch (ttype(o)) { + case LUA_TFUNCTION: + clvalue(o)->c.env = hvalue(L->top - 1); + break; + case LUA_TUSERDATA: + uvalue(o)->env = hvalue(L->top - 1); + break; + case LUA_TTHREAD: + sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1)); + break; + default: + res = 0; + break; + } + if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); + L->top--; + lua_unlock(L); + return res; +} + + +/* +** `load' and `call' functions (run Lua code) +*/ + + +#define adjustresults(L,nres) \ + { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; } + + +#define checkresults(L,na,nr) \ + api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) + + +LUA_API void lua_call (lua_State *L, int nargs, int nresults) { + StkId func; + lua_lock(L); + api_checknelems(L, nargs+1); + checkresults(L, nargs, nresults); + func = L->top - (nargs+1); + luaD_call(L, func, nresults); + adjustresults(L, nresults); + lua_unlock(L); +} + + + +/* +** Execute a protected call. +*/ +struct CallS { /* data to `f_call' */ + StkId func; + int nresults; +}; + + +static void f_call (lua_State *L, void *ud) { + struct CallS *c = cast(struct CallS *, ud); + luaD_call(L, c->func, c->nresults); +} + + + +LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) { + struct CallS c; + int status; + ptrdiff_t func; + lua_lock(L); + api_checknelems(L, nargs+1); + checkresults(L, nargs, nresults); + if (errfunc == 0) + func = 0; + else { + StkId o = index2adr(L, errfunc); + api_checkvalidindex(L, o); + func = savestack(L, o); + } + c.func = L->top - (nargs+1); /* function to be called */ + c.nresults = nresults; + status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); + adjustresults(L, nresults); + lua_unlock(L); + return status; +} + + +/* +** Execute a protected C call. +*/ +struct CCallS { /* data to `f_Ccall' */ + lua_CFunction func; + void *ud; +}; + + +static void f_Ccall (lua_State *L, void *ud) { + struct CCallS *c = cast(struct CCallS *, ud); + Closure *cl; + cl = luaF_newCclosure(L, 0, getcurrenv(L)); + cl->c.f = c->func; + setclvalue(L, L->top, cl); /* push function */ + api_incr_top(L); + setpvalue(L->top, c->ud); /* push only argument */ + api_incr_top(L); + luaD_call(L, L->top - 2, 0); +} + + +LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) { + struct CCallS c; + int status; + lua_lock(L); + c.func = func; + c.ud = ud; + status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0); + lua_unlock(L); + return status; +} + + +LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, + const char *chunkname) { + ZIO z; + int status; + lua_lock(L); + if (!chunkname) chunkname = "?"; + luaZ_init(L, &z, reader, data); + status = luaD_protectedparser(L, &z, chunkname); + lua_unlock(L); + return status; +} + + +LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { + int status; + TValue *o; + lua_lock(L); + api_checknelems(L, 1); + o = L->top - 1; + if (isLfunction(o)) + status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0); + else + status = 1; + lua_unlock(L); + return status; +} + + +LUA_API int lua_status (lua_State *L) { + return L->status; +} + + +/* +** Garbage-collection function +*/ + +LUA_API int lua_gc (lua_State *L, int what, int data) { + int res = 0; + global_State *g; + lua_lock(L); + g = G(L); + switch (what) { + case LUA_GCSTOP: { + g->GCthreshold = MAX_LUMEM; + break; + } + case LUA_GCRESTART: { + g->GCthreshold = g->totalbytes; + break; + } + case LUA_GCCOLLECT: { + luaC_fullgc(L); + break; + } + case LUA_GCCOUNT: { + /* GC values are expressed in Kbytes: #bytes/2^10 */ + res = cast_int(g->totalbytes >> 10); + break; + } + case LUA_GCCOUNTB: { + res = cast_int(g->totalbytes & 0x3ff); + break; + } + case LUA_GCSTEP: { + lu_mem a = (cast(lu_mem, data) << 10); + if (a <= g->totalbytes) + g->GCthreshold = g->totalbytes - a; + else + g->GCthreshold = 0; + while (g->GCthreshold <= g->totalbytes) { + luaC_step(L); + if (g->gcstate == GCSpause) { /* end of cycle? */ + res = 1; /* signal it */ + break; + } + } + break; + } + case LUA_GCSETPAUSE: { + res = g->gcpause; + g->gcpause = data; + break; + } + case LUA_GCSETSTEPMUL: { + res = g->gcstepmul; + g->gcstepmul = data; + break; + } + default: res = -1; /* invalid option */ + } + lua_unlock(L); + return res; +} + + + +/* +** miscellaneous functions +*/ + + +LUA_API int lua_error (lua_State *L) { + lua_lock(L); + api_checknelems(L, 1); + luaG_errormsg(L); + lua_unlock(L); + return 0; /* to avoid warnings */ +} + + +LUA_API int lua_next (lua_State *L, int idx) { + StkId t; + int more; + lua_lock(L); + t = index2adr(L, idx); + api_check(L, ttistable(t)); + more = luaH_next(L, hvalue(t), L->top - 1); + if (more) { + api_incr_top(L); + } + else /* no more elements */ + L->top -= 1; /* remove key */ + lua_unlock(L); + return more; +} + + +LUA_API void lua_concat (lua_State *L, int n) { + lua_lock(L); + api_checknelems(L, n); + if (n >= 2) { + luaC_checkGC(L); + luaV_concat(L, n, cast_int(L->top - L->base) - 1); + L->top -= (n-1); + } + else if (n == 0) { /* push empty string */ + setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); + api_incr_top(L); + } + /* else n == 1; nothing to do */ + lua_unlock(L); +} + + +LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) { + lua_Alloc f; + lua_lock(L); + if (ud) *ud = G(L)->ud; + f = G(L)->frealloc; + lua_unlock(L); + return f; +} + + +LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) { + lua_lock(L); + G(L)->ud = ud; + G(L)->frealloc = f; + lua_unlock(L); +} + + +LUA_API void *lua_newuserdata (lua_State *L, size_t size) { + Udata *u; + lua_lock(L); + luaC_checkGC(L); + u = luaS_newudata(L, size, getcurrenv(L)); + setuvalue(L, L->top, u); + api_incr_top(L); + lua_unlock(L); + return u + 1; +} + + + + +static const char *aux_upvalue (StkId fi, int n, TValue **val) { + Closure *f; + if (!ttisfunction(fi)) return NULL; + f = clvalue(fi); + if (f->c.isC) { + if (!(1 <= n && n <= f->c.nupvalues)) return NULL; + *val = &f->c.upvalue[n-1]; + return ""; + } + else { + Proto *p = f->l.p; + if (!(1 <= n && n <= p->sizeupvalues)) return NULL; + *val = f->l.upvals[n-1]->v; + return getstr(p->upvalues[n-1]); + } +} + + +LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { + const char *name; + TValue *val; + lua_lock(L); + name = aux_upvalue(index2adr(L, funcindex), n, &val); + if (name) { + setobj2s(L, L->top, val); + api_incr_top(L); + } + lua_unlock(L); + return name; +} + + +LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { + const char *name; + TValue *val; + StkId fi; + lua_lock(L); + fi = index2adr(L, funcindex); + api_checknelems(L, 1); + name = aux_upvalue(fi, n, &val); + if (name) { + L->top--; + setobj(L, val, L->top); + luaC_barrier(L, clvalue(fi), L->top); + } + lua_unlock(L); + return name; +} + diff --git a/script/lua/lapi.h b/script/lua/lapi.h new file mode 100644 index 000000000..2c3fab244 --- /dev/null +++ b/script/lua/lapi.h @@ -0,0 +1,16 @@ +/* +** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions from Lua API +** See Copyright Notice in lua.h +*/ + +#ifndef lapi_h +#define lapi_h + + +#include "lobject.h" + + +LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); + +#endif diff --git a/script/lua/lauxlib.c b/script/lua/lauxlib.c new file mode 100644 index 000000000..f61e028d3 --- /dev/null +++ b/script/lua/lauxlib.c @@ -0,0 +1,668 @@ +/* +** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $ +** Auxiliary functions for building Lua libraries +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#include +#include +#include +#endif + +/* This file uses only the official API of Lua. +** Any function declared here could be written as an application function. +*/ + +#define lauxlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" + + +#define FREELIST_REF 0 /* free list of references */ + + +/* convert a stack index to positive */ +#define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \ + lua_gettop(L) + (i) + 1) + + +/* +** {====================================================== +** Error-report functions +** ======================================================= +*/ + + +LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { + lua_Debug ar; + if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ + return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); + lua_getinfo(L, "n", &ar); + if (strcmp(ar.namewhat, "method") == 0) { + narg--; /* do not count `self' */ + if (narg == 0) /* error is in the self argument itself? */ + return luaL_error(L, "calling " LUA_QS " on bad self (%s)", + ar.name, extramsg); + } + if (ar.name == NULL) + ar.name = "?"; + return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", + narg, ar.name, extramsg); +} + + +LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) { + const char *msg = lua_pushfstring(L, "%s expected, got %s", + tname, luaL_typename(L, narg)); + return luaL_argerror(L, narg, msg); +} + + +static void tag_error (lua_State *L, int narg, int tag) { + luaL_typerror(L, narg, lua_typename(L, tag)); +} + + +LUALIB_API void luaL_where (lua_State *L, int level) { + lua_Debug ar; + if (lua_getstack(L, level, &ar)) { /* check function at level */ + lua_getinfo(L, "Sl", &ar); /* get info about it */ + if (ar.currentline > 0) { /* is there info? */ + lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); + return; + } + } + lua_pushliteral(L, ""); /* else, no information available... */ +} + + +LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { + va_list argp; + va_start(argp, fmt); + luaL_where(L, 1); + lua_pushvfstring(L, fmt, argp); + va_end(argp); + lua_concat(L, 2); + return lua_error(L); +} + +/* }====================================================== */ + + +LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, + const char *const lst[]) { + const char *name = (def) ? luaL_optstring(L, narg, def) : + luaL_checkstring(L, narg); + int i; + for (i=0; lst[i]; i++) + if (strcmp(lst[i], name) == 0) + return i; + return luaL_argerror(L, narg, + lua_pushfstring(L, "invalid option " LUA_QS, name)); +} + + +LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { + lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */ + if (!lua_isnil(L, -1)) /* name already in use? */ + return 0; /* leave previous value on top, but return 0 */ + lua_pop(L, 1); + lua_newtable(L); /* create metatable */ + lua_pushvalue(L, -1); + lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ + return 1; +} + + +LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { + void *p = lua_touserdata(L, ud); + if (p != NULL) { /* value is a userdata? */ + if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ + lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */ + if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */ + lua_pop(L, 2); /* remove both metatables */ + return p; + } + } + } + luaL_typerror(L, ud, tname); /* else error */ + return NULL; /* to avoid warnings */ +} + + +LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) { + if (!lua_checkstack(L, space)) + luaL_error(L, "stack overflow (%s)", mes); +} + + +LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) { + if (lua_type(L, narg) != t) + tag_error(L, narg, t); +} + + +LUALIB_API void luaL_checkany (lua_State *L, int narg) { + if (lua_type(L, narg) == LUA_TNONE) + luaL_argerror(L, narg, "value expected"); +} + + +LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) { + const char *s = lua_tolstring(L, narg, len); + if (!s) tag_error(L, narg, LUA_TSTRING); + return s; +} + + +LUALIB_API const char *luaL_optlstring (lua_State *L, int narg, + const char *def, size_t *len) { + if (lua_isnoneornil(L, narg)) { + if (len) + *len = (def ? strlen(def) : 0); + return def; + } + else return luaL_checklstring(L, narg, len); +} + + +LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) { + lua_Number d = lua_tonumber(L, narg); + if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ + tag_error(L, narg, LUA_TNUMBER); + return d; +} + + +LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { + return luaL_opt(L, luaL_checknumber, narg, def); +} + + +LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) { + lua_Integer d = lua_tointeger(L, narg); + if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ + tag_error(L, narg, LUA_TNUMBER); + return d; +} + + +LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, + lua_Integer def) { + return luaL_opt(L, luaL_checkinteger, narg, def); +} + + +LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { + if (!lua_getmetatable(L, obj)) /* no metatable? */ + return 0; + lua_pushstring(L, event); + lua_rawget(L, -2); + if (lua_isnil(L, -1)) { + lua_pop(L, 2); /* remove metatable and metafield */ + return 0; + } + else { + lua_remove(L, -2); /* remove only metatable */ + return 1; + } +} + + +LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { + obj = abs_index(L, obj); + if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ + return 0; + lua_pushvalue(L, obj); + lua_call(L, 1, 1); + return 1; +} + + +LUALIB_API void (luaL_register) (lua_State *L, const char *libname, + const luaL_Reg *l) { + luaI_openlib(L, libname, l, 0); +} + + +static int libsize (const luaL_Reg *l) { + int size = 0; + for (; l->name; l++) size++; + return size; +} + + +LUALIB_API void luaI_openlib (lua_State *L, const char *libname, + const luaL_Reg *l, int nup) { + if (libname) { + int size = libsize(l); + /* check whether lib already exists */ + luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); + lua_getfield(L, -1, libname); /* get _LOADED[libname] */ + if (!lua_istable(L, -1)) { /* not found? */ + lua_pop(L, 1); /* remove previous result */ + /* try global variable (and create one if it does not exist) */ + if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL) + luaL_error(L, "name conflict for module " LUA_QS, libname); + lua_pushvalue(L, -1); + lua_setfield(L, -3, libname); /* _LOADED[libname] = new table */ + } + lua_remove(L, -2); /* remove _LOADED table */ + lua_insert(L, -(nup+1)); /* move library table to below upvalues */ + } + for (; l->name; l++) { + int i; + for (i=0; ifunc, nup); + lua_setfield(L, -(nup+2), l->name); + } + lua_pop(L, nup); /* remove upvalues */ +} + + + +/* +** {====================================================== +** getn-setn: size for arrays +** ======================================================= +*/ + +#if defined(LUA_COMPAT_GETN) + +static int checkint (lua_State *L, int topop) { + int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1; + lua_pop(L, topop); + return n; +} + + +static void getsizes (lua_State *L) { + lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); + if (lua_isnil(L, -1)) { /* no `size' table? */ + lua_pop(L, 1); /* remove nil */ + lua_newtable(L); /* create it */ + lua_pushvalue(L, -1); /* `size' will be its own metatable */ + lua_setmetatable(L, -2); + lua_pushliteral(L, "kv"); + lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ + lua_pushvalue(L, -1); + lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ + } +} + + +LUALIB_API void luaL_setn (lua_State *L, int t, int n) { + t = abs_index(L, t); + lua_pushliteral(L, "n"); + lua_rawget(L, t); + if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ + lua_pushliteral(L, "n"); /* use it */ + lua_pushinteger(L, n); + lua_rawset(L, t); + } + else { /* use `sizes' */ + getsizes(L); + lua_pushvalue(L, t); + lua_pushinteger(L, n); + lua_rawset(L, -3); /* sizes[t] = n */ + lua_pop(L, 1); /* remove `sizes' */ + } +} + + +LUALIB_API int luaL_getn (lua_State *L, int t) { + int n; + t = abs_index(L, t); + lua_pushliteral(L, "n"); /* try t.n */ + lua_rawget(L, t); + if ((n = checkint(L, 1)) >= 0) return n; + getsizes(L); /* else try sizes[t] */ + lua_pushvalue(L, t); + lua_rawget(L, -2); + if ((n = checkint(L, 2)) >= 0) return n; + return (int)lua_objlen(L, t); +} + +#endif + +/* }====================================================== */ + + + +LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, + const char *r) { + const char *wild; + size_t l = strlen(p); + luaL_Buffer b; + luaL_buffinit(L, &b); + while ((wild = strstr(s, p)) != NULL) { + luaL_addlstring(&b, s, wild - s); /* push prefix */ + luaL_addstring(&b, r); /* push replacement in place of pattern */ + s = wild + l; /* continue after `p' */ + } + luaL_addstring(&b, s); /* push last suffix */ + luaL_pushresult(&b); + return lua_tostring(L, -1); +} + + +LUALIB_API const char *luaL_findtable (lua_State *L, int idx, + const char *fname, int szhint) { + const char *e; + lua_pushvalue(L, idx); + do { + e = strchr(fname, '.'); + if (e == NULL) e = fname + strlen(fname); + lua_pushlstring(L, fname, e - fname); + lua_rawget(L, -2); + if (lua_isnil(L, -1)) { /* no such field? */ + lua_pop(L, 1); /* remove this nil */ + lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ + lua_pushlstring(L, fname, e - fname); + lua_pushvalue(L, -2); + lua_settable(L, -4); /* set new table into field */ + } + else if (!lua_istable(L, -1)) { /* field has a non-table value? */ + lua_pop(L, 2); /* remove table and value */ + return fname; /* return problematic part of the name */ + } + lua_remove(L, -2); /* remove previous table */ + fname = e + 1; + } while (*e == '.'); + return NULL; +} + + + +/* +** {====================================================== +** Generic Buffer manipulation +** ======================================================= +*/ + + +#define bufflen(B) ((B)->p - (B)->buffer) +#define bufffree(B) ((size_t)(LUAL_BUFFERSIZE - bufflen(B))) + +#define LIMIT (LUA_MINSTACK/2) + + +static int emptybuffer (luaL_Buffer *B) { + size_t l = bufflen(B); + if (l == 0) return 0; /* put nothing on stack */ + else { + lua_pushlstring(B->L, B->buffer, l); + B->p = B->buffer; + B->lvl++; + return 1; + } +} + + +static void adjuststack (luaL_Buffer *B) { + if (B->lvl > 1) { + lua_State *L = B->L; + int toget = 1; /* number of levels to concat */ + size_t toplen = lua_strlen(L, -1); + do { + size_t l = lua_strlen(L, -(toget+1)); + if (B->lvl - toget + 1 >= LIMIT || toplen > l) { + toplen += l; + toget++; + } + else break; + } while (toget < B->lvl); + lua_concat(L, toget); + B->lvl = B->lvl - toget + 1; + } +} + + +LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) { + if (emptybuffer(B)) + adjuststack(B); + return B->buffer; +} + + +LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { + while (l--) + luaL_addchar(B, *s++); +} + + +LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) { + luaL_addlstring(B, s, strlen(s)); +} + + +LUALIB_API void luaL_pushresult (luaL_Buffer *B) { + emptybuffer(B); + lua_concat(B->L, B->lvl); + B->lvl = 1; +} + + +LUALIB_API void luaL_addvalue (luaL_Buffer *B) { + lua_State *L = B->L; + size_t vl; + const char *s = lua_tolstring(L, -1, &vl); + if (vl <= bufffree(B)) { /* fit into buffer? */ + memcpy(B->p, s, vl); /* put it there */ + B->p += vl; + lua_pop(L, 1); /* remove from stack */ + } + else { + if (emptybuffer(B)) + lua_insert(L, -2); /* put buffer before new value */ + B->lvl++; /* add new value into B stack */ + adjuststack(B); + } +} + + +LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) { + B->L = L; + B->p = B->buffer; + B->lvl = 0; +} + +/* }====================================================== */ + + +LUALIB_API int luaL_ref (lua_State *L, int t) { + int ref; + t = abs_index(L, t); + if (lua_isnil(L, -1)) { + lua_pop(L, 1); /* remove from stack */ + return LUA_REFNIL; /* `nil' has a unique fixed reference */ + } + lua_rawgeti(L, t, FREELIST_REF); /* get first free element */ + ref = (int)lua_tointeger(L, -1); /* ref = t[FREELIST_REF] */ + lua_pop(L, 1); /* remove it from stack */ + if (ref != 0) { /* any free element? */ + lua_rawgeti(L, t, ref); /* remove it from list */ + lua_rawseti(L, t, FREELIST_REF); /* (t[FREELIST_REF] = t[ref]) */ + } + else { /* no free elements */ + ref = (int)lua_objlen(L, t); + ref++; /* create new reference */ + } + lua_rawseti(L, t, ref); + return ref; +} + + +LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { + if (ref >= 0) { + t = abs_index(L, t); + lua_rawgeti(L, t, FREELIST_REF); + lua_rawseti(L, t, ref); /* t[ref] = t[FREELIST_REF] */ + lua_pushinteger(L, ref); + lua_rawseti(L, t, FREELIST_REF); /* t[FREELIST_REF] = ref */ + } +} + + + +/* +** {====================================================== +** Load functions +** ======================================================= +*/ + +#if 0 + +typedef struct LoadF { + int extraline; + FILE *f; + char buff[LUAL_BUFFERSIZE]; +} LoadF; + + +static const char *getF (lua_State *L, void *ud, size_t *size) { + LoadF *lf = (LoadF *)ud; + (void)L; + if (lf->extraline) { + lf->extraline = 0; + *size = 1; + return "\n"; + } + if (feof(lf->f)) return NULL; + *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); + return (*size > 0) ? lf->buff : NULL; +} + + +static int errfile (lua_State *L, const char *what, int fnameindex) { + const char *serr = strerror(errno); + const char *filename = lua_tostring(L, fnameindex) + 1; + lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); + lua_remove(L, fnameindex); + return LUA_ERRFILE; +} + + +LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { + LoadF lf; + int status, readstatus; + int c; + int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ + lf.extraline = 0; + if (filename == NULL) { + lua_pushliteral(L, "=stdin"); + lf.f = stdin; + } + else { + lua_pushfstring(L, "@%s", filename); + lf.f = fopen(filename, "r"); + if (lf.f == NULL) return errfile(L, "open", fnameindex); + } + c = getc(lf.f); + if (c == '#') { /* Unix exec. file? */ + lf.extraline = 1; + while ((c = getc(lf.f)) != EOF && c != '\n') ; /* skip first line */ + if (c == '\n') c = getc(lf.f); + } + if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ + lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ + if (lf.f == NULL) return errfile(L, "reopen", fnameindex); + /* skip eventual `#!...' */ + while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; + lf.extraline = 0; + } + ungetc(c, lf.f); + status = lua_load(L, getF, &lf, lua_tostring(L, -1)); + readstatus = ferror(lf.f); + if (filename) fclose(lf.f); /* close file (even in case of errors) */ + if (readstatus) { + lua_settop(L, fnameindex); /* ignore results from `lua_load' */ + return errfile(L, "read", fnameindex); + } + lua_remove(L, fnameindex); + return status; +} + +#else +LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { + (void) L; + (void) filename; + + return LUA_ERRFILE; +} + +#endif + +typedef struct LoadS { + const char *s; + size_t size; +} LoadS; + + +static const char *getS (lua_State *L, void *ud, size_t *size) { + LoadS *ls = (LoadS *)ud; + (void)L; + if (ls->size == 0) return NULL; + *size = ls->size; + ls->size = 0; + return ls->s; +} + + +LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size, + const char *name) { + LoadS ls; + ls.s = buff; + ls.size = size; + return lua_load(L, getS, &ls, name); +} + + +LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) { + return luaL_loadbuffer(L, s, strlen(s), s); +} + + + +/* }====================================================== */ + + +static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { + (void)ud; + (void)osize; + if (nsize == 0) { + free(ptr); + return NULL; + } + else + return realloc(ptr, nsize); +} + + +static int panic (lua_State *L) { + (void)L; /* to avoid warnings */ +#if 0 + fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", + lua_tostring(L, -1)); +#else + grub_fatal ("PANIC: unprotected error in call to Lua API (%s)\n", + lua_tostring(L, -1)); +#endif + return 0; +} + + +LUALIB_API lua_State *luaL_newstate (void) { + lua_State *L = lua_newstate(l_alloc, NULL); + if (L) lua_atpanic(L, &panic); + return L; +} + diff --git a/script/lua/lauxlib.h b/script/lua/lauxlib.h new file mode 100644 index 000000000..f18864d6c --- /dev/null +++ b/script/lua/lauxlib.h @@ -0,0 +1,175 @@ +/* +** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions for building Lua libraries +** See Copyright Notice in lua.h +*/ + + +#ifndef lauxlib_h +#define lauxlib_h + +#if 0 +#include +#include +#endif + +#include "lua.h" + + +#if defined(LUA_COMPAT_GETN) +LUALIB_API int (luaL_getn) (lua_State *L, int t); +LUALIB_API void (luaL_setn) (lua_State *L, int t, int n); +#else +#define luaL_getn(L,i) ((int)lua_objlen(L, i)) +#define luaL_setn(L,i,j) ((void)0) /* no op! */ +#endif + +#if defined(LUA_COMPAT_OPENLIB) +#define luaI_openlib luaL_openlib +#endif + + +/* extra error code for `luaL_load' */ +#define LUA_ERRFILE (LUA_ERRERR+1) + + +typedef struct luaL_Reg { + const char *name; + lua_CFunction func; +} luaL_Reg; + + + +LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname, + const luaL_Reg *l, int nup); +LUALIB_API void (luaL_register) (lua_State *L, const char *libname, + const luaL_Reg *l); +LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); +LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); +LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); +LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); +LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, + size_t *l); +LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, + const char *def, size_t *l); +LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); +LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); + +LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); +LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, + lua_Integer def); + +LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); +LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); +LUALIB_API void (luaL_checkany) (lua_State *L, int narg); + +LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); +LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); + +LUALIB_API void (luaL_where) (lua_State *L, int lvl); +LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); + +LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, + const char *const lst[]); + +LUALIB_API int (luaL_ref) (lua_State *L, int t); +LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); + +LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); +LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, + const char *name); +LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); + +LUALIB_API lua_State *(luaL_newstate) (void); + + +LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, + const char *r); + +LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, + const char *fname, int szhint); + + + + +/* +** =============================================================== +** some useful macros +** =============================================================== +*/ + +#define luaL_argcheck(L, cond,numarg,extramsg) \ + ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) +#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) +#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) +#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) +#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) +#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) +#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) + +#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) + +#define luaL_dofile(L, fn) \ + (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) + +#define luaL_dostring(L, s) \ + (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) + +#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) + +#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) + +/* +** {====================================================== +** Generic Buffer manipulation +** ======================================================= +*/ + + + +typedef struct luaL_Buffer { + char *p; /* current position in buffer */ + int lvl; /* number of strings in the stack (level) */ + lua_State *L; + char buffer[LUAL_BUFFERSIZE]; +} luaL_Buffer; + +#define luaL_addchar(B,c) \ + ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ + (*(B)->p++ = (char)(c))) + +/* compatibility only */ +#define luaL_putchar(B,c) luaL_addchar(B,c) + +#define luaL_addsize(B,n) ((B)->p += (n)) + +LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); +LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); +LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); +LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); +LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); +LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); + + +/* }====================================================== */ + + +/* compatibility with ref system */ + +/* pre-defined references */ +#define LUA_NOREF (-2) +#define LUA_REFNIL (-1) + +#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ + (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) + +#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) + +#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) + + +#define luaL_reg luaL_Reg + +#endif + + diff --git a/script/lua/lbaselib.c b/script/lua/lbaselib.c new file mode 100644 index 000000000..1bbb126c9 --- /dev/null +++ b/script/lua/lbaselib.c @@ -0,0 +1,652 @@ +/* +** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $ +** Basic library +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#include +#endif + +#define lbaselib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + + +/* +** If your system does not support `stdout', you can just remove this function. +** If you need, you can define your own `print' function, following this +** model but changing `fputs' to put the strings at a proper place +** (a console window or a log file, for instance). +*/ +static int luaB_print (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + int i; + lua_getglobal(L, "tostring"); + for (i=1; i<=n; i++) { + const char *s; + lua_pushvalue(L, -1); /* function to be called */ + lua_pushvalue(L, i); /* value to print */ + lua_call(L, 1, 1); + s = lua_tostring(L, -1); /* get result */ + if (s == NULL) + return luaL_error(L, LUA_QL("tostring") " must return a string to " + LUA_QL("print")); + if (i>1) fputs("\t", stdout); + fputs(s, stdout); + lua_pop(L, 1); /* pop result */ + } + fputs("\n", stdout); + return 0; +} + + +static int luaB_tonumber (lua_State *L) { + int base = luaL_optint(L, 2, 10); + if (base == 10) { /* standard conversion */ + luaL_checkany(L, 1); + if (lua_isnumber(L, 1)) { + lua_pushnumber(L, lua_tonumber(L, 1)); + return 1; + } + } + else { + const char *s1 = luaL_checkstring(L, 1); + char *s2; + unsigned long n; + luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range"); + n = strtoul(s1, &s2, base); + if (s1 != s2) { /* at least one valid digit? */ + while (isspace((unsigned char)(*s2))) s2++; /* skip trailing spaces */ + if (*s2 == '\0') { /* no invalid trailing characters? */ + lua_pushnumber(L, (lua_Number)n); + return 1; + } + } + } + lua_pushnil(L); /* else not a number */ + return 1; +} + + +static int luaB_error (lua_State *L) { + int level = luaL_optint(L, 2, 1); + lua_settop(L, 1); + if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ + luaL_where(L, level); + lua_pushvalue(L, 1); + lua_concat(L, 2); + } + return lua_error(L); +} + + +static int luaB_getmetatable (lua_State *L) { + luaL_checkany(L, 1); + if (!lua_getmetatable(L, 1)) { + lua_pushnil(L); + return 1; /* no metatable */ + } + luaL_getmetafield(L, 1, "__metatable"); + return 1; /* returns either __metatable field (if present) or metatable */ +} + + +static int luaB_setmetatable (lua_State *L) { + int t = lua_type(L, 2); + luaL_checktype(L, 1, LUA_TTABLE); + luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, + "nil or table expected"); + if (luaL_getmetafield(L, 1, "__metatable")) + luaL_error(L, "cannot change a protected metatable"); + lua_settop(L, 2); + lua_setmetatable(L, 1); + return 1; +} + + +static void getfunc (lua_State *L, int opt) { + if (lua_isfunction(L, 1)) lua_pushvalue(L, 1); + else { + lua_Debug ar; + int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1); + luaL_argcheck(L, level >= 0, 1, "level must be non-negative"); + if (lua_getstack(L, level, &ar) == 0) + luaL_argerror(L, 1, "invalid level"); + lua_getinfo(L, "f", &ar); + if (lua_isnil(L, -1)) + luaL_error(L, "no function environment for tail call at level %d", + level); + } +} + + +static int luaB_getfenv (lua_State *L) { + getfunc(L, 1); + if (lua_iscfunction(L, -1)) /* is a C function? */ + lua_pushvalue(L, LUA_GLOBALSINDEX); /* return the thread's global env. */ + else + lua_getfenv(L, -1); + return 1; +} + + +static int luaB_setfenv (lua_State *L) { + luaL_checktype(L, 2, LUA_TTABLE); + getfunc(L, 0); + lua_pushvalue(L, 2); + if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) { + /* change environment of current thread */ + lua_pushthread(L); + lua_insert(L, -2); + lua_setfenv(L, -2); + return 0; + } + else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0) + luaL_error(L, + LUA_QL("setfenv") " cannot change environment of given object"); + return 1; +} + + +static int luaB_rawequal (lua_State *L) { + luaL_checkany(L, 1); + luaL_checkany(L, 2); + lua_pushboolean(L, lua_rawequal(L, 1, 2)); + return 1; +} + + +static int luaB_rawget (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + luaL_checkany(L, 2); + lua_settop(L, 2); + lua_rawget(L, 1); + return 1; +} + +static int luaB_rawset (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + luaL_checkany(L, 2); + luaL_checkany(L, 3); + lua_settop(L, 3); + lua_rawset(L, 1); + return 1; +} + + +static int luaB_gcinfo (lua_State *L) { + lua_pushinteger(L, lua_getgccount(L)); + return 1; +} + + +static int luaB_collectgarbage (lua_State *L) { + static const char *const opts[] = {"stop", "restart", "collect", + "count", "step", "setpause", "setstepmul", NULL}; + static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, + LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL}; + int o = luaL_checkoption(L, 1, "collect", opts); + int ex = luaL_optint(L, 2, 0); + int res = lua_gc(L, optsnum[o], ex); + switch (optsnum[o]) { + case LUA_GCCOUNT: { + int b = lua_gc(L, LUA_GCCOUNTB, 0); + lua_pushnumber(L, res + ((lua_Number)b/1024)); + return 1; + } + case LUA_GCSTEP: { + lua_pushboolean(L, res); + return 1; + } + default: { + lua_pushnumber(L, res); + return 1; + } + } +} + + +static int luaB_type (lua_State *L) { + luaL_checkany(L, 1); + lua_pushstring(L, luaL_typename(L, 1)); + return 1; +} + + +static int luaB_next (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + lua_settop(L, 2); /* create a 2nd argument if there isn't one */ + if (lua_next(L, 1)) + return 2; + else { + lua_pushnil(L); + return 1; + } +} + + +static int luaB_pairs (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ + lua_pushvalue(L, 1); /* state, */ + lua_pushnil(L); /* and initial value */ + return 3; +} + + +static int ipairsaux (lua_State *L) { + int i = luaL_checkint(L, 2); + luaL_checktype(L, 1, LUA_TTABLE); + i++; /* next value */ + lua_pushinteger(L, i); + lua_rawgeti(L, 1, i); + return (lua_isnil(L, -1)) ? 0 : 2; +} + + +static int luaB_ipairs (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ + lua_pushvalue(L, 1); /* state, */ + lua_pushinteger(L, 0); /* and initial value */ + return 3; +} + + +static int load_aux (lua_State *L, int status) { + if (status == 0) /* OK? */ + return 1; + else { + lua_pushnil(L); + lua_insert(L, -2); /* put before error message */ + return 2; /* return nil plus error message */ + } +} + + +static int luaB_loadstring (lua_State *L) { + size_t l; + const char *s = luaL_checklstring(L, 1, &l); + const char *chunkname = luaL_optstring(L, 2, s); + return load_aux(L, luaL_loadbuffer(L, s, l, chunkname)); +} + + +static int luaB_loadfile (lua_State *L) { + const char *fname = luaL_optstring(L, 1, NULL); + return load_aux(L, luaL_loadfile(L, fname)); +} + + +/* +** Reader for generic `load' function: `lua_load' uses the +** stack for internal stuff, so the reader cannot change the +** stack top. Instead, it keeps its resulting string in a +** reserved slot inside the stack. +*/ +static const char *generic_reader (lua_State *L, void *ud, size_t *size) { + (void)ud; /* to avoid warnings */ + luaL_checkstack(L, 2, "too many nested functions"); + lua_pushvalue(L, 1); /* get function */ + lua_call(L, 0, 1); /* call it */ + if (lua_isnil(L, -1)) { + *size = 0; + return NULL; + } + else if (lua_isstring(L, -1)) { + lua_replace(L, 3); /* save string in a reserved stack slot */ + return lua_tolstring(L, 3, size); + } + else luaL_error(L, "reader function must return a string"); + return NULL; /* to avoid warnings */ +} + + +static int luaB_load (lua_State *L) { + int status; + const char *cname = luaL_optstring(L, 2, "=(load)"); + luaL_checktype(L, 1, LUA_TFUNCTION); + lua_settop(L, 3); /* function, eventual name, plus one reserved slot */ + status = lua_load(L, generic_reader, NULL, cname); + return load_aux(L, status); +} + + +static int luaB_dofile (lua_State *L) { + const char *fname = luaL_optstring(L, 1, NULL); + int n = lua_gettop(L); + if (luaL_loadfile(L, fname) != 0) lua_error(L); + lua_call(L, 0, LUA_MULTRET); + return lua_gettop(L) - n; +} + + +static int luaB_assert (lua_State *L) { + luaL_checkany(L, 1); + if (!lua_toboolean(L, 1)) + return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!")); + return lua_gettop(L); +} + + +static int luaB_unpack (lua_State *L) { + int i, e, n; + luaL_checktype(L, 1, LUA_TTABLE); + i = luaL_optint(L, 2, 1); + e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1)); + if (i > e) return 0; /* empty range */ + n = e - i + 1; /* number of elements */ + if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ + return luaL_error(L, "too many results to unpack"); + lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ + while (i++ < e) /* push arg[i + 1...e] */ + lua_rawgeti(L, 1, i); + return n; +} + + +static int luaB_select (lua_State *L) { + int n = lua_gettop(L); + if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { + lua_pushinteger(L, n-1); + return 1; + } + else { + int i = luaL_checkint(L, 1); + if (i < 0) i = n + i; + else if (i > n) i = n; + luaL_argcheck(L, 1 <= i, 1, "index out of range"); + return n - i; + } +} + + +static int luaB_pcall (lua_State *L) { + int status; + luaL_checkany(L, 1); + status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0); + lua_pushboolean(L, (status == 0)); + lua_insert(L, 1); + return lua_gettop(L); /* return status + all results */ +} + + +static int luaB_xpcall (lua_State *L) { + int status; + luaL_checkany(L, 2); + lua_settop(L, 2); + lua_insert(L, 1); /* put error function under function to be called */ + status = lua_pcall(L, 0, LUA_MULTRET, 1); + lua_pushboolean(L, (status == 0)); + lua_replace(L, 1); + return lua_gettop(L); /* return status + all results */ +} + +static int luaB_tostring (lua_State *L) { + luaL_checkany(L, 1); + if (luaL_callmeta(L, 1, "__tostring")) /* is there a metafield? */ + return 1; /* use its value */ + switch (lua_type(L, 1)) { + case LUA_TNUMBER: + lua_pushstring(L, lua_tostring(L, 1)); + break; + case LUA_TSTRING: + lua_pushvalue(L, 1); + break; + case LUA_TBOOLEAN: + lua_pushstring(L, (lua_toboolean(L, 1) ? "true" : "false")); + break; + case LUA_TNIL: + lua_pushliteral(L, "nil"); + break; + default: + lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1)); + break; + } + return 1; +} + + +static int luaB_newproxy (lua_State *L) { + lua_settop(L, 1); + lua_newuserdata(L, 0); /* create proxy */ + if (lua_toboolean(L, 1) == 0) + return 1; /* no metatable */ + else if (lua_isboolean(L, 1)) { + lua_newtable(L); /* create a new metatable `m' ... */ + lua_pushvalue(L, -1); /* ... and mark `m' as a valid metatable */ + lua_pushboolean(L, 1); + lua_rawset(L, lua_upvalueindex(1)); /* weaktable[m] = true */ + } + else { + int validproxy = 0; /* to check if weaktable[metatable(u)] == true */ + if (lua_getmetatable(L, 1)) { + lua_rawget(L, lua_upvalueindex(1)); + validproxy = lua_toboolean(L, -1); + lua_pop(L, 1); /* remove value */ + } + luaL_argcheck(L, validproxy, 1, "boolean or proxy expected"); + lua_getmetatable(L, 1); /* metatable is valid; get it */ + } + lua_setmetatable(L, 2); + return 1; +} + + +static const luaL_Reg base_funcs[] = { + {"assert", luaB_assert}, + {"collectgarbage", luaB_collectgarbage}, + {"dofile", luaB_dofile}, + {"error", luaB_error}, + {"gcinfo", luaB_gcinfo}, + {"getfenv", luaB_getfenv}, + {"getmetatable", luaB_getmetatable}, + {"loadfile", luaB_loadfile}, + {"load", luaB_load}, + {"loadstring", luaB_loadstring}, + {"next", luaB_next}, + {"pcall", luaB_pcall}, + {"print", luaB_print}, + {"rawequal", luaB_rawequal}, + {"rawget", luaB_rawget}, + {"rawset", luaB_rawset}, + {"select", luaB_select}, + {"setfenv", luaB_setfenv}, + {"setmetatable", luaB_setmetatable}, + {"tonumber", luaB_tonumber}, + {"tostring", luaB_tostring}, + {"type", luaB_type}, + {"unpack", luaB_unpack}, + {"xpcall", luaB_xpcall}, + {NULL, NULL} +}; + + +/* +** {====================================================== +** Coroutine library +** ======================================================= +*/ + +#define CO_RUN 0 /* running */ +#define CO_SUS 1 /* suspended */ +#define CO_NOR 2 /* 'normal' (it resumed another coroutine) */ +#define CO_DEAD 3 + +static const char *const statnames[] = + {"running", "suspended", "normal", "dead"}; + +static int costatus (lua_State *L, lua_State *co) { + if (L == co) return CO_RUN; + switch (lua_status(co)) { + case LUA_YIELD: + return CO_SUS; + case 0: { + lua_Debug ar; + if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ + return CO_NOR; /* it is running */ + else if (lua_gettop(co) == 0) + return CO_DEAD; + else + return CO_SUS; /* initial state */ + } + default: /* some error occured */ + return CO_DEAD; + } +} + + +static int luaB_costatus (lua_State *L) { + lua_State *co = lua_tothread(L, 1); + luaL_argcheck(L, co, 1, "coroutine expected"); + lua_pushstring(L, statnames[costatus(L, co)]); + return 1; +} + + +static int auxresume (lua_State *L, lua_State *co, int narg) { + int status = costatus(L, co); + if (!lua_checkstack(co, narg)) + luaL_error(L, "too many arguments to resume"); + if (status != CO_SUS) { + lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]); + return -1; /* error flag */ + } + lua_xmove(L, co, narg); + lua_setlevel(L, co); + status = lua_resume(co, narg); + if (status == 0 || status == LUA_YIELD) { + int nres = lua_gettop(co); + if (!lua_checkstack(L, nres + 1)) + luaL_error(L, "too many results to resume"); + lua_xmove(co, L, nres); /* move yielded values */ + return nres; + } + else { + lua_xmove(co, L, 1); /* move error message */ + return -1; /* error flag */ + } +} + + +static int luaB_coresume (lua_State *L) { + lua_State *co = lua_tothread(L, 1); + int r; + luaL_argcheck(L, co, 1, "coroutine expected"); + r = auxresume(L, co, lua_gettop(L) - 1); + if (r < 0) { + lua_pushboolean(L, 0); + lua_insert(L, -2); + return 2; /* return false + error message */ + } + else { + lua_pushboolean(L, 1); + lua_insert(L, -(r + 1)); + return r + 1; /* return true + `resume' returns */ + } +} + + +static int luaB_auxwrap (lua_State *L) { + lua_State *co = lua_tothread(L, lua_upvalueindex(1)); + int r = auxresume(L, co, lua_gettop(L)); + if (r < 0) { + if (lua_isstring(L, -1)) { /* error object is a string? */ + luaL_where(L, 1); /* add extra info */ + lua_insert(L, -2); + lua_concat(L, 2); + } + lua_error(L); /* propagate error */ + } + return r; +} + + +static int luaB_cocreate (lua_State *L) { + lua_State *NL = lua_newthread(L); + luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, + "Lua function expected"); + lua_pushvalue(L, 1); /* move function to top */ + lua_xmove(L, NL, 1); /* move function from L to NL */ + return 1; +} + + +static int luaB_cowrap (lua_State *L) { + luaB_cocreate(L); + lua_pushcclosure(L, luaB_auxwrap, 1); + return 1; +} + + +static int luaB_yield (lua_State *L) { + return lua_yield(L, lua_gettop(L)); +} + + +static int luaB_corunning (lua_State *L) { + if (lua_pushthread(L)) + lua_pushnil(L); /* main thread is not a coroutine */ + return 1; +} + + +static const luaL_Reg co_funcs[] = { + {"create", luaB_cocreate}, + {"resume", luaB_coresume}, + {"running", luaB_corunning}, + {"status", luaB_costatus}, + {"wrap", luaB_cowrap}, + {"yield", luaB_yield}, + {NULL, NULL} +}; + +/* }====================================================== */ + + +static void auxopen (lua_State *L, const char *name, + lua_CFunction f, lua_CFunction u) { + lua_pushcfunction(L, u); + lua_pushcclosure(L, f, 1); + lua_setfield(L, -2, name); +} + + +static void base_open (lua_State *L) { + /* set global _G */ + lua_pushvalue(L, LUA_GLOBALSINDEX); + lua_setglobal(L, "_G"); + /* open lib into global table */ + luaL_register(L, "_G", base_funcs); + lua_pushliteral(L, LUA_VERSION); + lua_setglobal(L, "_VERSION"); /* set global _VERSION */ + /* `ipairs' and `pairs' need auxliliary functions as upvalues */ + auxopen(L, "ipairs", luaB_ipairs, ipairsaux); + auxopen(L, "pairs", luaB_pairs, luaB_next); + /* `newproxy' needs a weaktable as upvalue */ + lua_createtable(L, 0, 1); /* new table `w' */ + lua_pushvalue(L, -1); /* `w' will be its own metatable */ + lua_setmetatable(L, -2); + lua_pushliteral(L, "kv"); + lua_setfield(L, -2, "__mode"); /* metatable(w).__mode = "kv" */ + lua_pushcclosure(L, luaB_newproxy, 1); + lua_setglobal(L, "newproxy"); /* set global `newproxy' */ +} + + +LUALIB_API int luaopen_base (lua_State *L) { + base_open(L); + luaL_register(L, LUA_COLIBNAME, co_funcs); + return 2; +} + diff --git a/script/lua/lcode.c b/script/lua/lcode.c new file mode 100644 index 000000000..64f726b48 --- /dev/null +++ b/script/lua/lcode.c @@ -0,0 +1,848 @@ +/* +** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ +** Code generator for Lua +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#endif + +#define lcode_c +#define LUA_CORE + +#include "lua.h" + +#include "lcode.h" +#include "ldebug.h" +#include "ldo.h" +#include "lgc.h" +#include "llex.h" +#include "lmem.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" +#include "ltable.h" + + +#define hasjumps(e) ((e)->t != (e)->f) + + +static int isnumeral(expdesc *e) { + return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP); +} + + +void luaK_nil (FuncState *fs, int from, int n) { + Instruction *previous; + if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ + if (fs->pc == 0) { /* function start? */ + if (from >= fs->nactvar) + return; /* positions are already clean */ + } + else { + previous = &fs->f->code[fs->pc-1]; + if (GET_OPCODE(*previous) == OP_LOADNIL) { + int pfrom = GETARG_A(*previous); + int pto = GETARG_B(*previous); + if (pfrom <= from && from <= pto+1) { /* can connect both? */ + if (from+n-1 > pto) + SETARG_B(*previous, from+n-1); + return; + } + } + } + } + luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0); /* else no optimization */ +} + + +int luaK_jump (FuncState *fs) { + int jpc = fs->jpc; /* save list of jumps to here */ + int j; + fs->jpc = NO_JUMP; + j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP); + luaK_concat(fs, &j, jpc); /* keep them on hold */ + return j; +} + + +void luaK_ret (FuncState *fs, int first, int nret) { + luaK_codeABC(fs, OP_RETURN, first, nret+1, 0); +} + + +static int condjump (FuncState *fs, OpCode op, int A, int B, int C) { + luaK_codeABC(fs, op, A, B, C); + return luaK_jump(fs); +} + + +static void fixjump (FuncState *fs, int pc, int dest) { + Instruction *jmp = &fs->f->code[pc]; + int offset = dest-(pc+1); + lua_assert(dest != NO_JUMP); + if (abs(offset) > MAXARG_sBx) + luaX_syntaxerror(fs->ls, "control structure too long"); + SETARG_sBx(*jmp, offset); +} + + +/* +** returns current `pc' and marks it as a jump target (to avoid wrong +** optimizations with consecutive instructions not in the same basic block). +*/ +int luaK_getlabel (FuncState *fs) { + fs->lasttarget = fs->pc; + return fs->pc; +} + + +static int getjump (FuncState *fs, int pc) { + int offset = GETARG_sBx(fs->f->code[pc]); + if (offset == NO_JUMP) /* point to itself represents end of list */ + return NO_JUMP; /* end of list */ + else + return (pc+1)+offset; /* turn offset into absolute position */ +} + + +static Instruction *getjumpcontrol (FuncState *fs, int pc) { + Instruction *pi = &fs->f->code[pc]; + if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1)))) + return pi-1; + else + return pi; +} + + +/* +** check whether list has any jump that do not produce a value +** (or produce an inverted value) +*/ +static int need_value (FuncState *fs, int list) { + for (; list != NO_JUMP; list = getjump(fs, list)) { + Instruction i = *getjumpcontrol(fs, list); + if (GET_OPCODE(i) != OP_TESTSET) return 1; + } + return 0; /* not found */ +} + + +static int patchtestreg (FuncState *fs, int node, int reg) { + Instruction *i = getjumpcontrol(fs, node); + if (GET_OPCODE(*i) != OP_TESTSET) + return 0; /* cannot patch other instructions */ + if (reg != NO_REG && reg != GETARG_B(*i)) + SETARG_A(*i, reg); + else /* no register to put value or register already has the value */ + *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i)); + + return 1; +} + + +static void removevalues (FuncState *fs, int list) { + for (; list != NO_JUMP; list = getjump(fs, list)) + patchtestreg(fs, list, NO_REG); +} + + +static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, + int dtarget) { + while (list != NO_JUMP) { + int next = getjump(fs, list); + if (patchtestreg(fs, list, reg)) + fixjump(fs, list, vtarget); + else + fixjump(fs, list, dtarget); /* jump to default target */ + list = next; + } +} + + +static void dischargejpc (FuncState *fs) { + patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc); + fs->jpc = NO_JUMP; +} + + +void luaK_patchlist (FuncState *fs, int list, int target) { + if (target == fs->pc) + luaK_patchtohere(fs, list); + else { + lua_assert(target < fs->pc); + patchlistaux(fs, list, target, NO_REG, target); + } +} + + +void luaK_patchtohere (FuncState *fs, int list) { + luaK_getlabel(fs); + luaK_concat(fs, &fs->jpc, list); +} + + +void luaK_concat (FuncState *fs, int *l1, int l2) { + if (l2 == NO_JUMP) return; + else if (*l1 == NO_JUMP) + *l1 = l2; + else { + int list = *l1; + int next; + while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */ + list = next; + fixjump(fs, list, l2); + } +} + + +void luaK_checkstack (FuncState *fs, int n) { + int newstack = fs->freereg + n; + if (newstack > fs->f->maxstacksize) { + if (newstack >= MAXSTACK) + luaX_syntaxerror(fs->ls, "function or expression too complex"); + fs->f->maxstacksize = cast_byte(newstack); + } +} + + +void luaK_reserveregs (FuncState *fs, int n) { + luaK_checkstack(fs, n); + fs->freereg += n; +} + + +static void freereg (FuncState *fs, int reg) { + if (!ISK(reg) && reg >= fs->nactvar) { + fs->freereg--; + lua_assert(reg == fs->freereg); + } +} + + +static void freeexp (FuncState *fs, expdesc *e) { + if (e->k == VNONRELOC) + freereg(fs, e->u.s.info); +} + + +static int addk (FuncState *fs, TValue *k, TValue *v) { + lua_State *L = fs->L; + TValue *idx = luaH_set(L, fs->h, k); + Proto *f = fs->f; + int oldsize = f->sizek; + if (ttisnumber(idx)) { + lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v)); + return cast_int(nvalue(idx)); + } + else { /* constant not found; create a new entry */ + setnvalue(idx, cast_num(fs->nk)); + luaM_growvector(L, f->k, fs->nk, f->sizek, TValue, + MAXARG_Bx, "constant table overflow"); + while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); + setobj(L, &f->k[fs->nk], v); + luaC_barrier(L, f, v); + return fs->nk++; + } +} + + +int luaK_stringK (FuncState *fs, TString *s) { + TValue o; + setsvalue(fs->L, &o, s); + return addk(fs, &o, &o); +} + + +int luaK_numberK (FuncState *fs, lua_Number r) { + TValue o; + setnvalue(&o, r); + return addk(fs, &o, &o); +} + + +static int boolK (FuncState *fs, int b) { + TValue o; + setbvalue(&o, b); + return addk(fs, &o, &o); +} + + +static int nilK (FuncState *fs) { + TValue k, v; + setnilvalue(&v); + /* cannot use nil as key; instead use table itself to represent nil */ + sethvalue(fs->L, &k, fs->h); + return addk(fs, &k, &v); +} + + +void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { + if (e->k == VCALL) { /* expression is an open function call? */ + SETARG_C(getcode(fs, e), nresults+1); + } + else if (e->k == VVARARG) { + SETARG_B(getcode(fs, e), nresults+1); + SETARG_A(getcode(fs, e), fs->freereg); + luaK_reserveregs(fs, 1); + } +} + + +void luaK_setoneret (FuncState *fs, expdesc *e) { + if (e->k == VCALL) { /* expression is an open function call? */ + e->k = VNONRELOC; + e->u.s.info = GETARG_A(getcode(fs, e)); + } + else if (e->k == VVARARG) { + SETARG_B(getcode(fs, e), 2); + e->k = VRELOCABLE; /* can relocate its simple result */ + } +} + + +void luaK_dischargevars (FuncState *fs, expdesc *e) { + switch (e->k) { + case VLOCAL: { + e->k = VNONRELOC; + break; + } + case VUPVAL: { + e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0); + e->k = VRELOCABLE; + break; + } + case VGLOBAL: { + e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info); + e->k = VRELOCABLE; + break; + } + case VINDEXED: { + freereg(fs, e->u.s.aux); + freereg(fs, e->u.s.info); + e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux); + e->k = VRELOCABLE; + break; + } + case VVARARG: + case VCALL: { + luaK_setoneret(fs, e); + break; + } + default: break; /* there is one value available (somewhere) */ + } +} + + +static int code_label (FuncState *fs, int A, int b, int jump) { + luaK_getlabel(fs); /* those instructions may be jump targets */ + return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump); +} + + +static void discharge2reg (FuncState *fs, expdesc *e, int reg) { + luaK_dischargevars(fs, e); + switch (e->k) { + case VNIL: { + luaK_nil(fs, reg, 1); + break; + } + case VFALSE: case VTRUE: { + luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0); + break; + } + case VK: { + luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info); + break; + } + case VKNUM: { + luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval)); + break; + } + case VRELOCABLE: { + Instruction *pc = &getcode(fs, e); + SETARG_A(*pc, reg); + break; + } + case VNONRELOC: { + if (reg != e->u.s.info) + luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0); + break; + } + default: { + lua_assert(e->k == VVOID || e->k == VJMP); + return; /* nothing to do... */ + } + } + e->u.s.info = reg; + e->k = VNONRELOC; +} + + +static void discharge2anyreg (FuncState *fs, expdesc *e) { + if (e->k != VNONRELOC) { + luaK_reserveregs(fs, 1); + discharge2reg(fs, e, fs->freereg-1); + } +} + + +static void exp2reg (FuncState *fs, expdesc *e, int reg) { + discharge2reg(fs, e, reg); + if (e->k == VJMP) + luaK_concat(fs, &e->t, e->u.s.info); /* put this jump in `t' list */ + if (hasjumps(e)) { + int final; /* position after whole expression */ + int p_f = NO_JUMP; /* position of an eventual LOAD false */ + int p_t = NO_JUMP; /* position of an eventual LOAD true */ + if (need_value(fs, e->t) || need_value(fs, e->f)) { + int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); + p_f = code_label(fs, reg, 0, 1); + p_t = code_label(fs, reg, 1, 0); + luaK_patchtohere(fs, fj); + } + final = luaK_getlabel(fs); + patchlistaux(fs, e->f, final, reg, p_f); + patchlistaux(fs, e->t, final, reg, p_t); + } + e->f = e->t = NO_JUMP; + e->u.s.info = reg; + e->k = VNONRELOC; +} + + +void luaK_exp2nextreg (FuncState *fs, expdesc *e) { + luaK_dischargevars(fs, e); + freeexp(fs, e); + luaK_reserveregs(fs, 1); + exp2reg(fs, e, fs->freereg - 1); +} + + +int luaK_exp2anyreg (FuncState *fs, expdesc *e) { + luaK_dischargevars(fs, e); + if (e->k == VNONRELOC) { + if (!hasjumps(e)) return e->u.s.info; /* exp is already in a register */ + if (e->u.s.info >= fs->nactvar) { /* reg. is not a local? */ + exp2reg(fs, e, e->u.s.info); /* put value on it */ + return e->u.s.info; + } + } + luaK_exp2nextreg(fs, e); /* default */ + return e->u.s.info; +} + + +void luaK_exp2val (FuncState *fs, expdesc *e) { + if (hasjumps(e)) + luaK_exp2anyreg(fs, e); + else + luaK_dischargevars(fs, e); +} + + +int luaK_exp2RK (FuncState *fs, expdesc *e) { + luaK_exp2val(fs, e); + switch (e->k) { + case VKNUM: + case VTRUE: + case VFALSE: + case VNIL: { + if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ + e->u.s.info = (e->k == VNIL) ? nilK(fs) : + (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : + boolK(fs, (e->k == VTRUE)); + e->k = VK; + return RKASK(e->u.s.info); + } + else break; + } + case VK: { + if (e->u.s.info <= MAXINDEXRK) /* constant fit in argC? */ + return RKASK(e->u.s.info); + else break; + } + default: break; + } + /* not a constant in the right range: put it in a register */ + return luaK_exp2anyreg(fs, e); +} + + +void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { + switch (var->k) { + case VLOCAL: { + freeexp(fs, ex); + exp2reg(fs, ex, var->u.s.info); + return; + } + case VUPVAL: { + int e = luaK_exp2anyreg(fs, ex); + luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0); + break; + } + case VGLOBAL: { + int e = luaK_exp2anyreg(fs, ex); + luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info); + break; + } + case VINDEXED: { + int e = luaK_exp2RK(fs, ex); + luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e); + break; + } + default: { + lua_assert(0); /* invalid var kind to store */ + break; + } + } + freeexp(fs, ex); +} + + +void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { + int func; + luaK_exp2anyreg(fs, e); + freeexp(fs, e); + func = fs->freereg; + luaK_reserveregs(fs, 2); + luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); + freeexp(fs, key); + e->u.s.info = func; + e->k = VNONRELOC; +} + + +static void invertjump (FuncState *fs, expdesc *e) { + Instruction *pc = getjumpcontrol(fs, e->u.s.info); + lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET && + GET_OPCODE(*pc) != OP_TEST); + SETARG_A(*pc, !(GETARG_A(*pc))); +} + + +static int jumponcond (FuncState *fs, expdesc *e, int cond) { + if (e->k == VRELOCABLE) { + Instruction ie = getcode(fs, e); + if (GET_OPCODE(ie) == OP_NOT) { + fs->pc--; /* remove previous OP_NOT */ + return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond); + } + /* else go through */ + } + discharge2anyreg(fs, e); + freeexp(fs, e); + return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond); +} + + +void luaK_goiftrue (FuncState *fs, expdesc *e) { + int pc; /* pc of last jump */ + luaK_dischargevars(fs, e); + switch (e->k) { + case VK: case VKNUM: case VTRUE: { + pc = NO_JUMP; /* always true; do nothing */ + break; + } + case VFALSE: { + pc = luaK_jump(fs); /* always jump */ + break; + } + case VJMP: { + invertjump(fs, e); + pc = e->u.s.info; + break; + } + default: { + pc = jumponcond(fs, e, 0); + break; + } + } + luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */ + luaK_patchtohere(fs, e->t); + e->t = NO_JUMP; +} + + +static void luaK_goiffalse (FuncState *fs, expdesc *e) { + int pc; /* pc of last jump */ + luaK_dischargevars(fs, e); + switch (e->k) { + case VNIL: case VFALSE: { + pc = NO_JUMP; /* always false; do nothing */ + break; + } + case VTRUE: { + pc = luaK_jump(fs); /* always jump */ + break; + } + case VJMP: { + pc = e->u.s.info; + break; + } + default: { + pc = jumponcond(fs, e, 1); + break; + } + } + luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */ + luaK_patchtohere(fs, e->f); + e->f = NO_JUMP; +} + + +static void codenot (FuncState *fs, expdesc *e) { + luaK_dischargevars(fs, e); + switch (e->k) { + case VNIL: case VFALSE: { + e->k = VTRUE; + break; + } + case VK: case VKNUM: case VTRUE: { + e->k = VFALSE; + break; + } + case VJMP: { + invertjump(fs, e); + break; + } + case VRELOCABLE: + case VNONRELOC: { + discharge2anyreg(fs, e); + freeexp(fs, e); + e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0); + e->k = VRELOCABLE; + break; + } + default: { + lua_assert(0); /* cannot happen */ + break; + } + } + /* interchange true and false lists */ + { int temp = e->f; e->f = e->t; e->t = temp; } + removevalues(fs, e->f); + removevalues(fs, e->t); +} + + +void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { + t->u.s.aux = luaK_exp2RK(fs, k); + t->k = VINDEXED; +} + + +static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { + lua_Number v1, v2, r; + if (!isnumeral(e1) || !isnumeral(e2)) return 0; + v1 = e1->u.nval; + v2 = e2->u.nval; + switch (op) { + case OP_ADD: r = luai_numadd(v1, v2); break; + case OP_SUB: r = luai_numsub(v1, v2); break; + case OP_MUL: r = luai_nummul(v1, v2); break; + case OP_DIV: + if (v2 == 0) return 0; /* do not attempt to divide by 0 */ + r = luai_numdiv(v1, v2); break; + case OP_MOD: + if (v2 == 0) return 0; /* do not attempt to divide by 0 */ + r = luai_nummod(v1, v2); break; + case OP_POW: r = luai_numpow(v1, v2); break; + case OP_UNM: r = luai_numunm(v1); break; + case OP_LEN: return 0; /* no constant folding for 'len' */ + default: lua_assert(0); r = 0; break; + } + if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */ + e1->u.nval = r; + return 1; +} + + +static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { + if (constfolding(op, e1, e2)) + return; + else { + int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; + int o1 = luaK_exp2RK(fs, e1); + if (o1 > o2) { + freeexp(fs, e1); + freeexp(fs, e2); + } + else { + freeexp(fs, e2); + freeexp(fs, e1); + } + e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2); + e1->k = VRELOCABLE; + } +} + + +static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, + expdesc *e2) { + int o1 = luaK_exp2RK(fs, e1); + int o2 = luaK_exp2RK(fs, e2); + freeexp(fs, e2); + freeexp(fs, e1); + if (cond == 0 && op != OP_EQ) { + int temp; /* exchange args to replace by `<' or `<=' */ + temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ + cond = 1; + } + e1->u.s.info = condjump(fs, op, cond, o1, o2); + e1->k = VJMP; +} + + +void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { + expdesc e2; + e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; + switch (op) { + case OPR_MINUS: { + if (!isnumeral(e)) + luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ + codearith(fs, OP_UNM, e, &e2); + break; + } + case OPR_NOT: codenot(fs, e); break; + case OPR_LEN: { + luaK_exp2anyreg(fs, e); /* cannot operate on constants */ + codearith(fs, OP_LEN, e, &e2); + break; + } + default: lua_assert(0); + } +} + + +void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { + switch (op) { + case OPR_AND: { + luaK_goiftrue(fs, v); + break; + } + case OPR_OR: { + luaK_goiffalse(fs, v); + break; + } + case OPR_CONCAT: { + luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ + break; + } + case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: + case OPR_MOD: case OPR_POW: { + if (!isnumeral(v)) luaK_exp2RK(fs, v); + break; + } + default: { + luaK_exp2RK(fs, v); + break; + } + } +} + + +void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) { + switch (op) { + case OPR_AND: { + lua_assert(e1->t == NO_JUMP); /* list must be closed */ + luaK_dischargevars(fs, e2); + luaK_concat(fs, &e2->f, e1->f); +#if 0 + *e1 = *e2; +#else + memcpy (e1, e2, sizeof (*e1)); +#endif + break; + } + case OPR_OR: { + lua_assert(e1->f == NO_JUMP); /* list must be closed */ + luaK_dischargevars(fs, e2); + luaK_concat(fs, &e2->t, e1->t); +#if 0 + *e1 = *e2; +#else + memcpy (e1, e2, sizeof (*e1)); +#endif + break; + } + case OPR_CONCAT: { + luaK_exp2val(fs, e2); + if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) { + lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1); + freeexp(fs, e1); + SETARG_B(getcode(fs, e2), e1->u.s.info); + e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info; + } + else { + luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ + codearith(fs, OP_CONCAT, e1, e2); + } + break; + } + case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break; + case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break; + case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break; + case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break; + case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break; + case OPR_POW: codearith(fs, OP_POW, e1, e2); break; + case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break; + case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break; + case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break; + case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break; + case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break; + case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break; + default: lua_assert(0); + } +} + + +void luaK_fixline (FuncState *fs, int line) { + fs->f->lineinfo[fs->pc - 1] = line; +} + + +static int luaK_code (FuncState *fs, Instruction i, int line) { + Proto *f = fs->f; + dischargejpc(fs); /* `pc' will change */ + /* put new instruction in code array */ + luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, + MAX_INT, "code size overflow"); + f->code[fs->pc] = i; + /* save corresponding line information */ + luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int, + MAX_INT, "code size overflow"); + f->lineinfo[fs->pc] = line; + return fs->pc++; +} + + +int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) { + lua_assert(getOpMode(o) == iABC); + lua_assert(getBMode(o) != OpArgN || b == 0); + lua_assert(getCMode(o) != OpArgN || c == 0); + return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline); +} + + +int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) { + lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx); + lua_assert(getCMode(o) == OpArgN); + return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline); +} + + +void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { + int c = (nelems - 1)/LFIELDS_PER_FLUSH + 1; + int b = (tostore == LUA_MULTRET) ? 0 : tostore; + lua_assert(tostore != 0); + if (c <= MAXARG_C) + luaK_codeABC(fs, OP_SETLIST, base, b, c); + else { + luaK_codeABC(fs, OP_SETLIST, base, b, 0); + luaK_code(fs, cast(Instruction, c), fs->ls->lastline); + } + fs->freereg = base + 1; /* free registers with list values */ +} + diff --git a/script/lua/lcode.h b/script/lua/lcode.h new file mode 100644 index 000000000..b941c6072 --- /dev/null +++ b/script/lua/lcode.h @@ -0,0 +1,76 @@ +/* +** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $ +** Code generator for Lua +** See Copyright Notice in lua.h +*/ + +#ifndef lcode_h +#define lcode_h + +#include "llex.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" + + +/* +** Marks the end of a patch list. It is an invalid value both as an absolute +** address, and as a list link (would link an element to itself). +*/ +#define NO_JUMP (-1) + + +/* +** grep "ORDER OPR" if you change these enums +*/ +typedef enum BinOpr { + OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, + OPR_CONCAT, + OPR_NE, OPR_EQ, + OPR_LT, OPR_LE, OPR_GT, OPR_GE, + OPR_AND, OPR_OR, + OPR_NOBINOPR +} BinOpr; + + +typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; + + +#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info]) + +#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) + +#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) + +LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); +LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); +LUAI_FUNC void luaK_fixline (FuncState *fs, int line); +LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); +LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); +LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); +LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); +LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); +LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); +LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); +LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); +LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); +LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); +LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); +LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); +LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); +LUAI_FUNC int luaK_jump (FuncState *fs); +LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); +LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); +LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); +LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); +LUAI_FUNC int luaK_getlabel (FuncState *fs); +LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); +LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); +LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); +LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); + + +#endif diff --git a/script/lua/ldblib.c b/script/lua/ldblib.c new file mode 100644 index 000000000..c1c2d89db --- /dev/null +++ b/script/lua/ldblib.c @@ -0,0 +1,398 @@ +/* +** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $ +** Interface from Lua to its debug API +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#endif + +#define ldblib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + +static int db_getregistry (lua_State *L) { + lua_pushvalue(L, LUA_REGISTRYINDEX); + return 1; +} + + +static int db_getmetatable (lua_State *L) { + luaL_checkany(L, 1); + if (!lua_getmetatable(L, 1)) { + lua_pushnil(L); /* no metatable */ + } + return 1; +} + + +static int db_setmetatable (lua_State *L) { + int t = lua_type(L, 2); + luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, + "nil or table expected"); + lua_settop(L, 2); + lua_pushboolean(L, lua_setmetatable(L, 1)); + return 1; +} + + +static int db_getfenv (lua_State *L) { + lua_getfenv(L, 1); + return 1; +} + + +static int db_setfenv (lua_State *L) { + luaL_checktype(L, 2, LUA_TTABLE); + lua_settop(L, 2); + if (lua_setfenv(L, 1) == 0) + luaL_error(L, LUA_QL("setfenv") + " cannot change environment of given object"); + return 1; +} + + +static void settabss (lua_State *L, const char *i, const char *v) { + lua_pushstring(L, v); + lua_setfield(L, -2, i); +} + + +static void settabsi (lua_State *L, const char *i, int v) { + lua_pushinteger(L, v); + lua_setfield(L, -2, i); +} + + +static lua_State *getthread (lua_State *L, int *arg) { + if (lua_isthread(L, 1)) { + *arg = 1; + return lua_tothread(L, 1); + } + else { + *arg = 0; + return L; + } +} + + +static void treatstackoption (lua_State *L, lua_State *L1, const char *fname) { + if (L == L1) { + lua_pushvalue(L, -2); + lua_remove(L, -3); + } + else + lua_xmove(L1, L, 1); + lua_setfield(L, -2, fname); +} + + +static int db_getinfo (lua_State *L) { + lua_Debug ar; + int arg; + lua_State *L1 = getthread(L, &arg); + const char *options = luaL_optstring(L, arg+2, "flnSu"); + if (lua_isnumber(L, arg+1)) { + if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) { + lua_pushnil(L); /* level out of range */ + return 1; + } + } + else if (lua_isfunction(L, arg+1)) { + lua_pushfstring(L, ">%s", options); + options = lua_tostring(L, -1); + lua_pushvalue(L, arg+1); + lua_xmove(L, L1, 1); + } + else + return luaL_argerror(L, arg+1, "function or level expected"); + if (!lua_getinfo(L1, options, &ar)) + return luaL_argerror(L, arg+2, "invalid option"); + lua_createtable(L, 0, 2); + if (strchr(options, 'S')) { + settabss(L, "source", ar.source); + settabss(L, "short_src", ar.short_src); + settabsi(L, "linedefined", ar.linedefined); + settabsi(L, "lastlinedefined", ar.lastlinedefined); + settabss(L, "what", ar.what); + } + if (strchr(options, 'l')) + settabsi(L, "currentline", ar.currentline); + if (strchr(options, 'u')) + settabsi(L, "nups", ar.nups); + if (strchr(options, 'n')) { + settabss(L, "name", ar.name); + settabss(L, "namewhat", ar.namewhat); + } + if (strchr(options, 'L')) + treatstackoption(L, L1, "activelines"); + if (strchr(options, 'f')) + treatstackoption(L, L1, "func"); + return 1; /* return table */ +} + + +static int db_getlocal (lua_State *L) { + int arg; + lua_State *L1 = getthread(L, &arg); + lua_Debug ar; + const char *name; + if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ + return luaL_argerror(L, arg+1, "level out of range"); + name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2)); + if (name) { + lua_xmove(L1, L, 1); + lua_pushstring(L, name); + lua_pushvalue(L, -2); + return 2; + } + else { + lua_pushnil(L); + return 1; + } +} + + +static int db_setlocal (lua_State *L) { + int arg; + lua_State *L1 = getthread(L, &arg); + lua_Debug ar; + if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ + return luaL_argerror(L, arg+1, "level out of range"); + luaL_checkany(L, arg+3); + lua_settop(L, arg+3); + lua_xmove(L, L1, 1); + lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2))); + return 1; +} + + +static int auxupvalue (lua_State *L, int get) { + const char *name; + int n = luaL_checkint(L, 2); + luaL_checktype(L, 1, LUA_TFUNCTION); + if (lua_iscfunction(L, 1)) return 0; /* cannot touch C upvalues from Lua */ + name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); + if (name == NULL) return 0; + lua_pushstring(L, name); + lua_insert(L, -(get+1)); + return get + 1; +} + + +static int db_getupvalue (lua_State *L) { + return auxupvalue(L, 1); +} + + +static int db_setupvalue (lua_State *L) { + luaL_checkany(L, 3); + return auxupvalue(L, 0); +} + + + +static const char KEY_HOOK = 'h'; + + +static void hookf (lua_State *L, lua_Debug *ar) { + static const char *const hooknames[] = + {"call", "return", "line", "count", "tail return"}; + lua_pushlightuserdata(L, (void *)&KEY_HOOK); + lua_rawget(L, LUA_REGISTRYINDEX); + lua_pushlightuserdata(L, L); + lua_rawget(L, -2); + if (lua_isfunction(L, -1)) { + lua_pushstring(L, hooknames[(int)ar->event]); + if (ar->currentline >= 0) + lua_pushinteger(L, ar->currentline); + else lua_pushnil(L); + lua_assert(lua_getinfo(L, "lS", ar)); + lua_call(L, 2, 0); + } +} + + +static int makemask (const char *smask, int count) { + int mask = 0; + if (strchr(smask, 'c')) mask |= LUA_MASKCALL; + if (strchr(smask, 'r')) mask |= LUA_MASKRET; + if (strchr(smask, 'l')) mask |= LUA_MASKLINE; + if (count > 0) mask |= LUA_MASKCOUNT; + return mask; +} + + +static char *unmakemask (int mask, char *smask) { + int i = 0; + if (mask & LUA_MASKCALL) smask[i++] = 'c'; + if (mask & LUA_MASKRET) smask[i++] = 'r'; + if (mask & LUA_MASKLINE) smask[i++] = 'l'; + smask[i] = '\0'; + return smask; +} + + +static void gethooktable (lua_State *L) { + lua_pushlightuserdata(L, (void *)&KEY_HOOK); + lua_rawget(L, LUA_REGISTRYINDEX); + if (!lua_istable(L, -1)) { + lua_pop(L, 1); + lua_createtable(L, 0, 1); + lua_pushlightuserdata(L, (void *)&KEY_HOOK); + lua_pushvalue(L, -2); + lua_rawset(L, LUA_REGISTRYINDEX); + } +} + + +static int db_sethook (lua_State *L) { + int arg, mask, count; + lua_Hook func; + lua_State *L1 = getthread(L, &arg); + if (lua_isnoneornil(L, arg+1)) { + lua_settop(L, arg+1); + func = NULL; mask = 0; count = 0; /* turn off hooks */ + } + else { + const char *smask = luaL_checkstring(L, arg+2); + luaL_checktype(L, arg+1, LUA_TFUNCTION); + count = luaL_optint(L, arg+3, 0); + func = hookf; mask = makemask(smask, count); + } + gethooktable(L); + lua_pushlightuserdata(L, L1); + lua_pushvalue(L, arg+1); + lua_rawset(L, -3); /* set new hook */ + lua_pop(L, 1); /* remove hook table */ + lua_sethook(L1, func, mask, count); /* set hooks */ + return 0; +} + + +static int db_gethook (lua_State *L) { + int arg; + lua_State *L1 = getthread(L, &arg); + char buff[5]; + int mask = lua_gethookmask(L1); + lua_Hook hook = lua_gethook(L1); + if (hook != NULL && hook != hookf) /* external hook? */ + lua_pushliteral(L, "external hook"); + else { + gethooktable(L); + lua_pushlightuserdata(L, L1); + lua_rawget(L, -2); /* get hook */ + lua_remove(L, -2); /* remove hook table */ + } + lua_pushstring(L, unmakemask(mask, buff)); + lua_pushinteger(L, lua_gethookcount(L1)); + return 3; +} + + +static int db_debug (lua_State *L) { + for (;;) { + char buffer[250]; + fputs("lua_debug> ", stderr); + if (fgets(buffer, sizeof(buffer), stdin) == 0 || + strcmp(buffer, "cont\n") == 0) + return 0; + if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || + lua_pcall(L, 0, 0, 0)) { + fputs(lua_tostring(L, -1), stderr); + fputs("\n", stderr); + } + lua_settop(L, 0); /* remove eventual returns */ + } +} + + +#define LEVELS1 12 /* size of the first part of the stack */ +#define LEVELS2 10 /* size of the second part of the stack */ + +static int db_errorfb (lua_State *L) { + int level; + int firstpart = 1; /* still before eventual `...' */ + int arg; + lua_State *L1 = getthread(L, &arg); + lua_Debug ar; + if (lua_isnumber(L, arg+2)) { + level = (int)lua_tointeger(L, arg+2); + lua_pop(L, 1); + } + else + level = (L == L1) ? 1 : 0; /* level 0 may be this own function */ + if (lua_gettop(L) == arg) + lua_pushliteral(L, ""); + else if (!lua_isstring(L, arg+1)) return 1; /* message is not a string */ + else lua_pushliteral(L, "\n"); + lua_pushliteral(L, "stack traceback:"); + while (lua_getstack(L1, level++, &ar)) { + if (level > LEVELS1 && firstpart) { + /* no more than `LEVELS2' more levels? */ + if (!lua_getstack(L1, level+LEVELS2, &ar)) + level--; /* keep going */ + else { + lua_pushliteral(L, "\n\t..."); /* too many levels */ + while (lua_getstack(L1, level+LEVELS2, &ar)) /* find last levels */ + level++; + } + firstpart = 0; + continue; + } + lua_pushliteral(L, "\n\t"); + lua_getinfo(L1, "Snl", &ar); + lua_pushfstring(L, "%s:", ar.short_src); + if (ar.currentline > 0) + lua_pushfstring(L, "%d:", ar.currentline); + if (*ar.namewhat != '\0') /* is there a name? */ + lua_pushfstring(L, " in function " LUA_QS, ar.name); + else { + if (*ar.what == 'm') /* main? */ + lua_pushfstring(L, " in main chunk"); + else if (*ar.what == 'C' || *ar.what == 't') + lua_pushliteral(L, " ?"); /* C function or tail call */ + else + lua_pushfstring(L, " in function <%s:%d>", + ar.short_src, ar.linedefined); + } + lua_concat(L, lua_gettop(L) - arg); + } + lua_concat(L, lua_gettop(L) - arg); + return 1; +} + + +static const luaL_Reg dblib[] = { + {"debug", db_debug}, + {"getfenv", db_getfenv}, + {"gethook", db_gethook}, + {"getinfo", db_getinfo}, + {"getlocal", db_getlocal}, + {"getregistry", db_getregistry}, + {"getmetatable", db_getmetatable}, + {"getupvalue", db_getupvalue}, + {"setfenv", db_setfenv}, + {"sethook", db_sethook}, + {"setlocal", db_setlocal}, + {"setmetatable", db_setmetatable}, + {"setupvalue", db_setupvalue}, + {"traceback", db_errorfb}, + {NULL, NULL} +}; + + +LUALIB_API int luaopen_debug (lua_State *L) { + luaL_register(L, LUA_DBLIBNAME, dblib); + return 1; +} + diff --git a/script/lua/ldebug.c b/script/lua/ldebug.c new file mode 100644 index 000000000..25e790c4d --- /dev/null +++ b/script/lua/ldebug.c @@ -0,0 +1,638 @@ +/* +** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $ +** Debug Interface +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#endif + +#define ldebug_c +#define LUA_CORE + +#include "lua.h" + +#include "lapi.h" +#include "lcode.h" +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lvm.h" + + + +static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); + + +static int currentpc (lua_State *L, CallInfo *ci) { + if (!isLua(ci)) return -1; /* function is not a Lua function? */ + if (ci == L->ci) + ci->savedpc = L->savedpc; + return pcRel(ci->savedpc, ci_func(ci)->l.p); +} + + +static int currentline (lua_State *L, CallInfo *ci) { + int pc = currentpc(L, ci); + if (pc < 0) + return -1; /* only active lua functions have current-line information */ + else + return getline(ci_func(ci)->l.p, pc); +} + + +/* +** this function can be called asynchronous (e.g. during a signal) +*/ +LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { + if (func == NULL || mask == 0) { /* turn off hooks? */ + mask = 0; + func = NULL; + } + L->hook = func; + L->basehookcount = count; + resethookcount(L); + L->hookmask = cast_byte(mask); + return 1; +} + + +LUA_API lua_Hook lua_gethook (lua_State *L) { + return L->hook; +} + + +LUA_API int lua_gethookmask (lua_State *L) { + return L->hookmask; +} + + +LUA_API int lua_gethookcount (lua_State *L) { + return L->basehookcount; +} + + +LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { + int status; + CallInfo *ci; + lua_lock(L); + for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) { + level--; + if (f_isLua(ci)) /* Lua function? */ + level -= ci->tailcalls; /* skip lost tail calls */ + } + if (level == 0 && ci > L->base_ci) { /* level found? */ + status = 1; + ar->i_ci = cast_int(ci - L->base_ci); + } + else if (level < 0) { /* level is of a lost tail call? */ + status = 1; + ar->i_ci = 0; + } + else status = 0; /* no such level */ + lua_unlock(L); + return status; +} + + +static Proto *getluaproto (CallInfo *ci) { + return (isLua(ci) ? ci_func(ci)->l.p : NULL); +} + + +static const char *findlocal (lua_State *L, CallInfo *ci, int n) { + const char *name; + Proto *fp = getluaproto(ci); + if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL) + return name; /* is a local variable in a Lua function */ + else { + StkId limit = (ci == L->ci) ? L->top : (ci+1)->func; + if (limit - ci->base >= n && n > 0) /* is 'n' inside 'ci' stack? */ + return "(*temporary)"; + else + return NULL; + } +} + + +LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { + CallInfo *ci = L->base_ci + ar->i_ci; + const char *name = findlocal(L, ci, n); + lua_lock(L); + if (name) + luaA_pushobject(L, ci->base + (n - 1)); + lua_unlock(L); + return name; +} + + +LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { + CallInfo *ci = L->base_ci + ar->i_ci; + const char *name = findlocal(L, ci, n); + lua_lock(L); + if (name) + setobjs2s(L, ci->base + (n - 1), L->top - 1); + L->top--; /* pop value */ + lua_unlock(L); + return name; +} + + +static void funcinfo (lua_Debug *ar, Closure *cl) { + if (cl->c.isC) { + ar->source = "=[C]"; + ar->linedefined = -1; + ar->lastlinedefined = -1; + ar->what = "C"; + } + else { + ar->source = getstr(cl->l.p->source); + ar->linedefined = cl->l.p->linedefined; + ar->lastlinedefined = cl->l.p->lastlinedefined; + ar->what = (ar->linedefined == 0) ? "main" : "Lua"; + } + luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); +} + + +static void info_tailcall (lua_Debug *ar) { + ar->name = ar->namewhat = ""; + ar->what = "tail"; + ar->lastlinedefined = ar->linedefined = ar->currentline = -1; + ar->source = "=(tail call)"; + luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); + ar->nups = 0; +} + + +static void collectvalidlines (lua_State *L, Closure *f) { + if (f == NULL || f->c.isC) { + setnilvalue(L->top); + } + else { + Table *t = luaH_new(L, 0, 0); + int *lineinfo = f->l.p->lineinfo; + int i; + for (i=0; il.p->sizelineinfo; i++) + setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); + sethvalue(L, L->top, t); + } + incr_top(L); +} + + +static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, + Closure *f, CallInfo *ci) { + int status = 1; + if (f == NULL) { + info_tailcall(ar); + return status; + } + for (; *what; what++) { + switch (*what) { + case 'S': { + funcinfo(ar, f); + break; + } + case 'l': { + ar->currentline = (ci) ? currentline(L, ci) : -1; + break; + } + case 'u': { + ar->nups = f->c.nupvalues; + break; + } + case 'n': { + ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL; + if (ar->namewhat == NULL) { + ar->namewhat = ""; /* not found */ + ar->name = NULL; + } + break; + } + case 'L': + case 'f': /* handled by lua_getinfo */ + break; + default: status = 0; /* invalid option */ + } + } + return status; +} + + +LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { + int status; + Closure *f = NULL; + CallInfo *ci = NULL; + lua_lock(L); + if (*what == '>') { + StkId func = L->top - 1; + luai_apicheck(L, ttisfunction(func)); + what++; /* skip the '>' */ + f = clvalue(func); + L->top--; /* pop function */ + } + else if (ar->i_ci != 0) { /* no tail call? */ + ci = L->base_ci + ar->i_ci; + lua_assert(ttisfunction(ci->func)); + f = clvalue(ci->func); + } + status = auxgetinfo(L, what, ar, f, ci); + if (strchr(what, 'f')) { + if (f == NULL) setnilvalue(L->top); + else setclvalue(L, L->top, f); + incr_top(L); + } + if (strchr(what, 'L')) + collectvalidlines(L, f); + lua_unlock(L); + return status; +} + + +/* +** {====================================================== +** Symbolic Execution and code checker +** ======================================================= +*/ + +#define check(x) if (!(x)) return 0; + +#define checkjump(pt,pc) check(0 <= pc && pc < pt->sizecode) + +#define checkreg(pt,reg) check((reg) < (pt)->maxstacksize) + + + +static int precheck (const Proto *pt) { + check(pt->maxstacksize <= MAXSTACK); + check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); + check(!(pt->is_vararg & VARARG_NEEDSARG) || + (pt->is_vararg & VARARG_HASARG)); + check(pt->sizeupvalues <= pt->nups); + check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0); + check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); + return 1; +} + + +#define checkopenop(pt,pc) luaG_checkopenop((pt)->code[(pc)+1]) + +int luaG_checkopenop (Instruction i) { + switch (GET_OPCODE(i)) { + case OP_CALL: + case OP_TAILCALL: + case OP_RETURN: + case OP_SETLIST: { + check(GETARG_B(i) == 0); + return 1; + } + default: return 0; /* invalid instruction after an open call */ + } +} + + +static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) { + switch (mode) { + case OpArgN: check(r == 0); break; + case OpArgU: break; + case OpArgR: checkreg(pt, r); break; + case OpArgK: + check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize); + break; + } + return 1; +} + + +static Instruction symbexec (const Proto *pt, int lastpc, int reg) { + int pc; + int last; /* stores position of last instruction that changed `reg' */ + last = pt->sizecode-1; /* points to final return (a `neutral' instruction) */ + check(precheck(pt)); + for (pc = 0; pc < lastpc; pc++) { + Instruction i = pt->code[pc]; + OpCode op = GET_OPCODE(i); + int a = GETARG_A(i); + int b = 0; + int c = 0; + check(op < NUM_OPCODES); + checkreg(pt, a); + switch (getOpMode(op)) { + case iABC: { + b = GETARG_B(i); + c = GETARG_C(i); + check(checkArgMode(pt, b, getBMode(op))); + check(checkArgMode(pt, c, getCMode(op))); + break; + } + case iABx: { + b = GETARG_Bx(i); + if (getBMode(op) == OpArgK) check(b < pt->sizek); + break; + } + case iAsBx: { + b = GETARG_sBx(i); + if (getBMode(op) == OpArgR) { + int dest = pc+1+b; + check(0 <= dest && dest < pt->sizecode); + if (dest > 0) { + int j; + /* check that it does not jump to a setlist count; this + is tricky, because the count from a previous setlist may + have the same value of an invalid setlist; so, we must + go all the way back to the first of them (if any) */ + for (j = 0; j < dest; j++) { + Instruction d = pt->code[dest-1-j]; + if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break; + } + /* if 'j' is even, previous value is not a setlist (even if + it looks like one) */ + check((j&1) == 0); + } + } + break; + } + } + if (testAMode(op)) { + if (a == reg) last = pc; /* change register `a' */ + } + if (testTMode(op)) { + check(pc+2 < pt->sizecode); /* check skip */ + check(GET_OPCODE(pt->code[pc+1]) == OP_JMP); + } + switch (op) { + case OP_LOADBOOL: { + if (c == 1) { /* does it jump? */ + check(pc+2 < pt->sizecode); /* check its jump */ + check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST || + GETARG_C(pt->code[pc+1]) != 0); + } + break; + } + case OP_LOADNIL: { + if (a <= reg && reg <= b) + last = pc; /* set registers from `a' to `b' */ + break; + } + case OP_GETUPVAL: + case OP_SETUPVAL: { + check(b < pt->nups); + break; + } + case OP_GETGLOBAL: + case OP_SETGLOBAL: { + check(ttisstring(&pt->k[b])); + break; + } + case OP_SELF: { + checkreg(pt, a+1); + if (reg == a+1) last = pc; + break; + } + case OP_CONCAT: { + check(b < c); /* at least two operands */ + break; + } + case OP_TFORLOOP: { + check(c >= 1); /* at least one result (control variable) */ + checkreg(pt, a+2+c); /* space for results */ + if (reg >= a+2) last = pc; /* affect all regs above its base */ + break; + } + case OP_FORLOOP: + case OP_FORPREP: + checkreg(pt, a+3); + /* go through */ + case OP_JMP: { + int dest = pc+1+b; + /* not full check and jump is forward and do not skip `lastpc'? */ + if (reg != NO_REG && pc < dest && dest <= lastpc) + pc += b; /* do the jump */ + break; + } + case OP_CALL: + case OP_TAILCALL: { + if (b != 0) { + checkreg(pt, a+b-1); + } + c--; /* c = num. returns */ + if (c == LUA_MULTRET) { + check(checkopenop(pt, pc)); + } + else if (c != 0) + checkreg(pt, a+c-1); + if (reg >= a) last = pc; /* affect all registers above base */ + break; + } + case OP_RETURN: { + b--; /* b = num. returns */ + if (b > 0) checkreg(pt, a+b-1); + break; + } + case OP_SETLIST: { + if (b > 0) checkreg(pt, a + b); + if (c == 0) { + pc++; + check(pc < pt->sizecode - 1); + } + break; + } + case OP_CLOSURE: { + int nup, j; + check(b < pt->sizep); + nup = pt->p[b]->nups; + check(pc + nup < pt->sizecode); + for (j = 1; j <= nup; j++) { + OpCode op1 = GET_OPCODE(pt->code[pc + j]); + check(op1 == OP_GETUPVAL || op1 == OP_MOVE); + } + if (reg != NO_REG) /* tracing? */ + pc += nup; /* do not 'execute' these pseudo-instructions */ + break; + } + case OP_VARARG: { + check((pt->is_vararg & VARARG_ISVARARG) && + !(pt->is_vararg & VARARG_NEEDSARG)); + b--; + if (b == LUA_MULTRET) check(checkopenop(pt, pc)); + checkreg(pt, a+b-1); + break; + } + default: break; + } + } + return pt->code[last]; +} + +#undef check +#undef checkjump +#undef checkreg + +/* }====================================================== */ + + +int luaG_checkcode (const Proto *pt) { + return (symbexec(pt, pt->sizecode, NO_REG) != 0); +} + + +static const char *kname (Proto *p, int c) { + if (ISK(c) && ttisstring(&p->k[INDEXK(c)])) + return svalue(&p->k[INDEXK(c)]); + else + return "?"; +} + + +static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos, + const char **name) { + if (isLua(ci)) { /* a Lua function? */ + Proto *p = ci_func(ci)->l.p; + int pc = currentpc(L, ci); + Instruction i; + *name = luaF_getlocalname(p, stackpos+1, pc); + if (*name) /* is a local? */ + return "local"; + i = symbexec(p, pc, stackpos); /* try symbolic execution */ + lua_assert(pc != -1); + switch (GET_OPCODE(i)) { + case OP_GETGLOBAL: { + int g = GETARG_Bx(i); /* global index */ + lua_assert(ttisstring(&p->k[g])); + *name = svalue(&p->k[g]); + return "global"; + } + case OP_MOVE: { + int a = GETARG_A(i); + int b = GETARG_B(i); /* move from `b' to `a' */ + if (b < a) + return getobjname(L, ci, b, name); /* get name for `b' */ + break; + } + case OP_GETTABLE: { + int k = GETARG_C(i); /* key index */ + *name = kname(p, k); + return "field"; + } + case OP_GETUPVAL: { + int u = GETARG_B(i); /* upvalue index */ + *name = p->upvalues ? getstr(p->upvalues[u]) : "?"; + return "upvalue"; + } + case OP_SELF: { + int k = GETARG_C(i); /* key index */ + *name = kname(p, k); + return "method"; + } + default: break; + } + } + return NULL; /* no useful name found */ +} + + +static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { + Instruction i; + if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1)) + return NULL; /* calling function is not Lua (or is unknown) */ + ci--; /* calling function */ + i = ci_func(ci)->l.p->code[currentpc(L, ci)]; + if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL || + GET_OPCODE(i) == OP_TFORLOOP) + return getobjname(L, ci, GETARG_A(i), name); + else + return NULL; /* no useful name can be found */ +} + + +/* only ANSI way to check whether a pointer points to an array */ +static int isinstack (CallInfo *ci, const TValue *o) { + StkId p; + for (p = ci->base; p < ci->top; p++) + if (o == p) return 1; + return 0; +} + + +void luaG_typeerror (lua_State *L, const TValue *o, const char *op) { + const char *name = NULL; + const char *t = luaT_typenames[ttype(o)]; + const char *kind = (isinstack(L->ci, o)) ? + getobjname(L, L->ci, cast_int(o - L->base), &name) : + NULL; + if (kind) + luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)", + op, kind, name, t); + else + luaG_runerror(L, "attempt to %s a %s value", op, t); +} + + +void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { + if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; + lua_assert(!ttisstring(p1) && !ttisnumber(p1)); + luaG_typeerror(L, p1, "concatenate"); +} + + +void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) { + TValue temp; + if (luaV_tonumber(p1, &temp) == NULL) + p2 = p1; /* first operand is wrong */ + luaG_typeerror(L, p2, "perform arithmetic on"); +} + + +int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { + const char *t1 = luaT_typenames[ttype(p1)]; + const char *t2 = luaT_typenames[ttype(p2)]; + if (t1[2] == t2[2]) + luaG_runerror(L, "attempt to compare two %s values", t1); + else + luaG_runerror(L, "attempt to compare %s with %s", t1, t2); + return 0; +} + + +static void addinfo (lua_State *L, const char *msg) { + CallInfo *ci = L->ci; + if (isLua(ci)) { /* is Lua code? */ + char buff[LUA_IDSIZE]; /* add file:line information */ + int line = currentline(L, ci); + luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE); + luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); + } +} + + +void luaG_errormsg (lua_State *L) { + if (L->errfunc != 0) { /* is there an error handling function? */ + StkId errfunc = restorestack(L, L->errfunc); + if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); + setobjs2s(L, L->top, L->top - 1); /* move argument */ + setobjs2s(L, L->top - 1, errfunc); /* push function */ + incr_top(L); + luaD_call(L, L->top - 2, 1); /* call it */ + } + luaD_throw(L, LUA_ERRRUN); +} + + +void luaG_runerror (lua_State *L, const char *fmt, ...) { + va_list argp; + va_start(argp, fmt); + addinfo(L, luaO_pushvfstring(L, fmt, argp)); + va_end(argp); + luaG_errormsg(L); +} + diff --git a/script/lua/ldebug.h b/script/lua/ldebug.h new file mode 100644 index 000000000..ba28a9724 --- /dev/null +++ b/script/lua/ldebug.h @@ -0,0 +1,33 @@ +/* +** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions from Debug Interface module +** See Copyright Notice in lua.h +*/ + +#ifndef ldebug_h +#define ldebug_h + + +#include "lstate.h" + + +#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) + +#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) + +#define resethookcount(L) (L->hookcount = L->basehookcount) + + +LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o, + const char *opname); +LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2); +LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1, + const TValue *p2); +LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, + const TValue *p2); +LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); +LUAI_FUNC void luaG_errormsg (lua_State *L); +LUAI_FUNC int luaG_checkcode (const Proto *pt); +LUAI_FUNC int luaG_checkopenop (Instruction i); + +#endif diff --git a/script/lua/ldo.c b/script/lua/ldo.c new file mode 100644 index 000000000..a267e7bfe --- /dev/null +++ b/script/lua/ldo.c @@ -0,0 +1,519 @@ +/* +** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $ +** Stack and Call structure of Lua +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#endif + +#define ldo_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lundump.h" +#include "lvm.h" +#include "lzio.h" + + + + +/* +** {====================================================== +** Error-recovery functions +** ======================================================= +*/ + + +/* chain list of long jump buffers */ +struct lua_longjmp { + struct lua_longjmp *previous; + luai_jmpbuf b; + volatile int status; /* error code */ +}; + + +void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) { + switch (errcode) { + case LUA_ERRMEM: { + setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG)); + break; + } + case LUA_ERRERR: { + setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); + break; + } + case LUA_ERRSYNTAX: + case LUA_ERRRUN: { + setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ + break; + } + } + L->top = oldtop + 1; +} + + +static void restore_stack_limit (lua_State *L) { + lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); + if (L->size_ci > LUAI_MAXCALLS) { /* there was an overflow? */ + int inuse = cast_int(L->ci - L->base_ci); + if (inuse + 1 < LUAI_MAXCALLS) /* can `undo' overflow? */ + luaD_reallocCI(L, LUAI_MAXCALLS); + } +} + + +static void resetstack (lua_State *L, int status) { + L->ci = L->base_ci; + L->base = L->ci->base; + luaF_close(L, L->base); /* close eventual pending closures */ + luaD_seterrorobj(L, status, L->base); + L->nCcalls = L->baseCcalls; + L->allowhook = 1; + restore_stack_limit(L); + L->errfunc = 0; + L->errorJmp = NULL; +} + + +void luaD_throw (lua_State *L, int errcode) { + if (L->errorJmp) { + L->errorJmp->status = errcode; + LUAI_THROW(L, L->errorJmp); + } + else { + L->status = cast_byte(errcode); + if (G(L)->panic) { + resetstack(L, errcode); + lua_unlock(L); + G(L)->panic(L); + } + exit(EXIT_FAILURE); + } +} + + +int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { + struct lua_longjmp lj; + lj.status = 0; + lj.previous = L->errorJmp; /* chain new error handler */ + L->errorJmp = &lj; + LUAI_TRY(L, &lj, + (*f)(L, ud); + ); + L->errorJmp = lj.previous; /* restore old error handler */ + return lj.status; +} + +/* }====================================================== */ + + +static void correctstack (lua_State *L, TValue *oldstack) { + CallInfo *ci; + GCObject *up; + L->top = (L->top - oldstack) + L->stack; + for (up = L->openupval; up != NULL; up = up->gch.next) + gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack; + for (ci = L->base_ci; ci <= L->ci; ci++) { + ci->top = (ci->top - oldstack) + L->stack; + ci->base = (ci->base - oldstack) + L->stack; + ci->func = (ci->func - oldstack) + L->stack; + } + L->base = (L->base - oldstack) + L->stack; +} + + +void luaD_reallocstack (lua_State *L, int newsize) { + TValue *oldstack = L->stack; + int realsize = newsize + 1 + EXTRA_STACK; + lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); + luaM_reallocvector(L, L->stack, L->stacksize, realsize, TValue); + L->stacksize = realsize; + L->stack_last = L->stack+newsize; + correctstack(L, oldstack); +} + + +void luaD_reallocCI (lua_State *L, int newsize) { + CallInfo *oldci = L->base_ci; + luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo); + L->size_ci = newsize; + L->ci = (L->ci - oldci) + L->base_ci; + L->end_ci = L->base_ci + L->size_ci - 1; +} + + +void luaD_growstack (lua_State *L, int n) { + if (n <= L->stacksize) /* double size is enough? */ + luaD_reallocstack(L, 2*L->stacksize); + else + luaD_reallocstack(L, L->stacksize + n); +} + + +static CallInfo *growCI (lua_State *L) { + if (L->size_ci > LUAI_MAXCALLS) /* overflow while handling overflow? */ + luaD_throw(L, LUA_ERRERR); + else { + luaD_reallocCI(L, 2*L->size_ci); + if (L->size_ci > LUAI_MAXCALLS) + luaG_runerror(L, "stack overflow"); + } + return ++L->ci; +} + + +void luaD_callhook (lua_State *L, int event, int line) { + lua_Hook hook = L->hook; + if (hook && L->allowhook) { + ptrdiff_t top = savestack(L, L->top); + ptrdiff_t ci_top = savestack(L, L->ci->top); + lua_Debug ar; + ar.event = event; + ar.currentline = line; + if (event == LUA_HOOKTAILRET) + ar.i_ci = 0; /* tail call; no debug information about it */ + else + ar.i_ci = cast_int(L->ci - L->base_ci); + luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ + L->ci->top = L->top + LUA_MINSTACK; + lua_assert(L->ci->top <= L->stack_last); + L->allowhook = 0; /* cannot call hooks inside a hook */ + lua_unlock(L); + (*hook)(L, &ar); + lua_lock(L); + lua_assert(!L->allowhook); + L->allowhook = 1; + L->ci->top = restorestack(L, ci_top); + L->top = restorestack(L, top); + } +} + + +static StkId adjust_varargs (lua_State *L, Proto *p, int actual) { + int i; + int nfixargs = p->numparams; + Table *htab = NULL; + StkId base, fixed; + for (; actual < nfixargs; ++actual) + setnilvalue(L->top++); +#if defined(LUA_COMPAT_VARARG) + if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */ + int nvar = actual - nfixargs; /* number of extra arguments */ + lua_assert(p->is_vararg & VARARG_HASARG); + luaC_checkGC(L); + htab = luaH_new(L, nvar, 1); /* create `arg' table */ + for (i=0; itop - nvar + i); + /* store counter in field `n' */ + setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), cast_num(nvar)); + } +#endif + /* move fixed parameters to final position */ + fixed = L->top - actual; /* first fixed argument */ + base = L->top; /* final position of first argument */ + for (i=0; itop++, fixed+i); + setnilvalue(fixed+i); + } + /* add `arg' parameter */ + if (htab) { + sethvalue(L, L->top++, htab); + lua_assert(iswhite(obj2gco(htab))); + } + return base; +} + + +static StkId tryfuncTM (lua_State *L, StkId func) { + const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL); + StkId p; + ptrdiff_t funcr = savestack(L, func); + if (!ttisfunction(tm)) + luaG_typeerror(L, func, "call"); + /* Open a hole inside the stack at `func' */ + for (p = L->top; p > func; p--) setobjs2s(L, p, p-1); + incr_top(L); + func = restorestack(L, funcr); /* previous call may change stack */ + setobj2s(L, func, tm); /* tag method is the new function to be called */ + return func; +} + + + +#define inc_ci(L) \ + ((L->ci == L->end_ci) ? growCI(L) : \ + (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci)) + + +int luaD_precall (lua_State *L, StkId func, int nresults) { + LClosure *cl; + ptrdiff_t funcr; + if (!ttisfunction(func)) /* `func' is not a function? */ + func = tryfuncTM(L, func); /* check the `function' tag method */ + funcr = savestack(L, func); + cl = &clvalue(func)->l; + L->ci->savedpc = L->savedpc; + if (!cl->isC) { /* Lua function? prepare its call */ + CallInfo *ci; + StkId st, base; + Proto *p = cl->p; + luaD_checkstack(L, p->maxstacksize); + func = restorestack(L, funcr); + if (!p->is_vararg) { /* no varargs? */ + base = func + 1; + if (L->top > base + p->numparams) + L->top = base + p->numparams; + } + else { /* vararg function */ + int nargs = cast_int(L->top - func) - 1; + base = adjust_varargs(L, p, nargs); + func = restorestack(L, funcr); /* previous call may change the stack */ + } + ci = inc_ci(L); /* now `enter' new function */ + ci->func = func; + L->base = ci->base = base; + ci->top = L->base + p->maxstacksize; + lua_assert(ci->top <= L->stack_last); + L->savedpc = p->code; /* starting point */ + ci->tailcalls = 0; + ci->nresults = nresults; + for (st = L->top; st < ci->top; st++) + setnilvalue(st); + L->top = ci->top; + if (L->hookmask & LUA_MASKCALL) { + L->savedpc++; /* hooks assume 'pc' is already incremented */ + luaD_callhook(L, LUA_HOOKCALL, -1); + L->savedpc--; /* correct 'pc' */ + } + return PCRLUA; + } + else { /* if is a C function, call it */ + CallInfo *ci; + int n; + luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ + ci = inc_ci(L); /* now `enter' new function */ + ci->func = restorestack(L, funcr); + L->base = ci->base = ci->func + 1; + ci->top = L->top + LUA_MINSTACK; + lua_assert(ci->top <= L->stack_last); + ci->nresults = nresults; + if (L->hookmask & LUA_MASKCALL) + luaD_callhook(L, LUA_HOOKCALL, -1); + lua_unlock(L); + n = (*curr_func(L)->c.f)(L); /* do the actual call */ + lua_lock(L); + if (n < 0) /* yielding? */ + return PCRYIELD; + else { + luaD_poscall(L, L->top - n); + return PCRC; + } + } +} + + +static StkId callrethooks (lua_State *L, StkId firstResult) { + ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ + luaD_callhook(L, LUA_HOOKRET, -1); + if (f_isLua(L->ci)) { /* Lua function? */ + while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */ + luaD_callhook(L, LUA_HOOKTAILRET, -1); + } + return restorestack(L, fr); +} + + +int luaD_poscall (lua_State *L, StkId firstResult) { + StkId res; + int wanted, i; + CallInfo *ci; + if (L->hookmask & LUA_MASKRET) + firstResult = callrethooks(L, firstResult); + ci = L->ci--; + res = ci->func; /* res == final position of 1st result */ + wanted = ci->nresults; + L->base = (ci - 1)->base; /* restore base */ + L->savedpc = (ci - 1)->savedpc; /* restore savedpc */ + /* move results to correct place */ + for (i = wanted; i != 0 && firstResult < L->top; i--) + setobjs2s(L, res++, firstResult++); + while (i-- > 0) + setnilvalue(res++); + L->top = res; + return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ +} + + +/* +** Call a function (C or Lua). The function to be called is at *func. +** The arguments are on the stack, right after the function. +** When returns, all the results are on the stack, starting at the original +** function position. +*/ +void luaD_call (lua_State *L, StkId func, int nResults) { + if (++L->nCcalls >= LUAI_MAXCCALLS) { + if (L->nCcalls == LUAI_MAXCCALLS) + luaG_runerror(L, "C stack overflow"); + else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3))) + luaD_throw(L, LUA_ERRERR); /* error while handing stack error */ + } + if (luaD_precall(L, func, nResults) == PCRLUA) /* is a Lua function? */ + luaV_execute(L, 1); /* call it */ + L->nCcalls--; + luaC_checkGC(L); +} + + +static void resume (lua_State *L, void *ud) { + StkId firstArg = cast(StkId, ud); + CallInfo *ci = L->ci; + if (L->status == 0) { /* start coroutine? */ + lua_assert(ci == L->base_ci && firstArg > L->base); + if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA) + return; + } + else { /* resuming from previous yield */ + lua_assert(L->status == LUA_YIELD); + L->status = 0; + if (!f_isLua(ci)) { /* `common' yield? */ + /* finish interrupted execution of `OP_CALL' */ + lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || + GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL); + if (luaD_poscall(L, firstArg)) /* complete it... */ + L->top = L->ci->top; /* and correct top if not multiple results */ + } + else /* yielded inside a hook: just continue its execution */ + L->base = L->ci->base; + } + luaV_execute(L, cast_int(L->ci - L->base_ci)); +} + + +static int resume_error (lua_State *L, const char *msg) { + L->top = L->ci->base; + setsvalue2s(L, L->top, luaS_new(L, msg)); + incr_top(L); + lua_unlock(L); + return LUA_ERRRUN; +} + + +LUA_API int lua_resume (lua_State *L, int nargs) { + int status; + lua_lock(L); + if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)) + return resume_error(L, "cannot resume non-suspended coroutine"); + if (L->nCcalls >= LUAI_MAXCCALLS) + return resume_error(L, "C stack overflow"); + luai_userstateresume(L, nargs); + lua_assert(L->errfunc == 0); + L->baseCcalls = ++L->nCcalls; + status = luaD_rawrunprotected(L, resume, L->top - nargs); + if (status != 0) { /* error? */ + L->status = cast_byte(status); /* mark thread as `dead' */ + luaD_seterrorobj(L, status, L->top); + L->ci->top = L->top; + } + else { + lua_assert(L->nCcalls == L->baseCcalls); + status = L->status; + } + --L->nCcalls; + lua_unlock(L); + return status; +} + + +LUA_API int lua_yield (lua_State *L, int nresults) { + luai_userstateyield(L, nresults); + lua_lock(L); + if (L->nCcalls > L->baseCcalls) + luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); + L->base = L->top - nresults; /* protect stack slots below */ + L->status = LUA_YIELD; + lua_unlock(L); + return -1; +} + + +int luaD_pcall (lua_State *L, Pfunc func, void *u, + ptrdiff_t old_top, ptrdiff_t ef) { + int status; + unsigned short oldnCcalls = L->nCcalls; + ptrdiff_t old_ci = saveci(L, L->ci); + lu_byte old_allowhooks = L->allowhook; + ptrdiff_t old_errfunc = L->errfunc; + L->errfunc = ef; + status = luaD_rawrunprotected(L, func, u); + if (status != 0) { /* an error occurred? */ + StkId oldtop = restorestack(L, old_top); + luaF_close(L, oldtop); /* close eventual pending closures */ + luaD_seterrorobj(L, status, oldtop); + L->nCcalls = oldnCcalls; + L->ci = restoreci(L, old_ci); + L->base = L->ci->base; + L->savedpc = L->ci->savedpc; + L->allowhook = old_allowhooks; + restore_stack_limit(L); + } + L->errfunc = old_errfunc; + return status; +} + + + +/* +** Execute a protected parser. +*/ +struct SParser { /* data to `f_parser' */ + ZIO *z; + Mbuffer buff; /* buffer to be used by the scanner */ + const char *name; +}; + +static void f_parser (lua_State *L, void *ud) { + int i; + Proto *tf; + Closure *cl; + struct SParser *p = cast(struct SParser *, ud); + int c = luaZ_lookahead(p->z); + luaC_checkGC(L); + tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, + &p->buff, p->name); + cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L))); + cl->l.p = tf; + for (i = 0; i < tf->nups; i++) /* initialize eventual upvalues */ + cl->l.upvals[i] = luaF_newupval(L); + setclvalue(L, L->top, cl); + incr_top(L); +} + + +int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) { + struct SParser p; + int status; + p.z = z; p.name = name; + luaZ_initbuffer(L, &p.buff); + status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); + luaZ_freebuffer(L, &p.buff); + return status; +} + + diff --git a/script/lua/ldo.h b/script/lua/ldo.h new file mode 100644 index 000000000..98fddac59 --- /dev/null +++ b/script/lua/ldo.h @@ -0,0 +1,57 @@ +/* +** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $ +** Stack and Call structure of Lua +** See Copyright Notice in lua.h +*/ + +#ifndef ldo_h +#define ldo_h + + +#include "lobject.h" +#include "lstate.h" +#include "lzio.h" + + +#define luaD_checkstack(L,n) \ + if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ + luaD_growstack(L, n); \ + else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); + + +#define incr_top(L) {luaD_checkstack(L,1); L->top++;} + +#define savestack(L,p) ((char *)(p) - (char *)L->stack) +#define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) + +#define saveci(L,p) ((char *)(p) - (char *)L->base_ci) +#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) + + +/* results from luaD_precall */ +#define PCRLUA 0 /* initiated a call to a Lua function */ +#define PCRC 1 /* did a call to a C function */ +#define PCRYIELD 2 /* C funtion yielded */ + + +/* type of protected functions, to be ran by `runprotected' */ +typedef void (*Pfunc) (lua_State *L, void *ud); + +LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); +LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line); +LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); +LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); +LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, + ptrdiff_t oldtop, ptrdiff_t ef); +LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); +LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); +LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); +LUAI_FUNC void luaD_growstack (lua_State *L, int n); + +LUAI_FUNC void luaD_throw (lua_State *L, int errcode); +LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); + +LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); + +#endif + diff --git a/script/lua/ldump.c b/script/lua/ldump.c new file mode 100644 index 000000000..c9d3d4870 --- /dev/null +++ b/script/lua/ldump.c @@ -0,0 +1,164 @@ +/* +** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ +** save precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#include + +#define ldump_c +#define LUA_CORE + +#include "lua.h" + +#include "lobject.h" +#include "lstate.h" +#include "lundump.h" + +typedef struct { + lua_State* L; + lua_Writer writer; + void* data; + int strip; + int status; +} DumpState; + +#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) +#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) + +static void DumpBlock(const void* b, size_t size, DumpState* D) +{ + if (D->status==0) + { + lua_unlock(D->L); + D->status=(*D->writer)(D->L,b,size,D->data); + lua_lock(D->L); + } +} + +static void DumpChar(int y, DumpState* D) +{ + char x=(char)y; + DumpVar(x,D); +} + +static void DumpInt(int x, DumpState* D) +{ + DumpVar(x,D); +} + +static void DumpNumber(lua_Number x, DumpState* D) +{ + DumpVar(x,D); +} + +static void DumpVector(const void* b, int n, size_t size, DumpState* D) +{ + DumpInt(n,D); + DumpMem(b,n,size,D); +} + +static void DumpString(const TString* s, DumpState* D) +{ + if (s==NULL || getstr(s)==NULL) + { + size_t size=0; + DumpVar(size,D); + } + else + { + size_t size=s->tsv.len+1; /* include trailing '\0' */ + DumpVar(size,D); + DumpBlock(getstr(s),size,D); + } +} + +#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) + +static void DumpFunction(const Proto* f, const TString* p, DumpState* D); + +static void DumpConstants(const Proto* f, DumpState* D) +{ + int i,n=f->sizek; + DumpInt(n,D); + for (i=0; ik[i]; + DumpChar(ttype(o),D); + switch (ttype(o)) + { + case LUA_TNIL: + break; + case LUA_TBOOLEAN: + DumpChar(bvalue(o),D); + break; + case LUA_TNUMBER: + DumpNumber(nvalue(o),D); + break; + case LUA_TSTRING: + DumpString(rawtsvalue(o),D); + break; + default: + lua_assert(0); /* cannot happen */ + break; + } + } + n=f->sizep; + DumpInt(n,D); + for (i=0; ip[i],f->source,D); +} + +static void DumpDebug(const Proto* f, DumpState* D) +{ + int i,n; + n= (D->strip) ? 0 : f->sizelineinfo; + DumpVector(f->lineinfo,n,sizeof(int),D); + n= (D->strip) ? 0 : f->sizelocvars; + DumpInt(n,D); + for (i=0; ilocvars[i].varname,D); + DumpInt(f->locvars[i].startpc,D); + DumpInt(f->locvars[i].endpc,D); + } + n= (D->strip) ? 0 : f->sizeupvalues; + DumpInt(n,D); + for (i=0; iupvalues[i],D); +} + +static void DumpFunction(const Proto* f, const TString* p, DumpState* D) +{ + DumpString((f->source==p || D->strip) ? NULL : f->source,D); + DumpInt(f->linedefined,D); + DumpInt(f->lastlinedefined,D); + DumpChar(f->nups,D); + DumpChar(f->numparams,D); + DumpChar(f->is_vararg,D); + DumpChar(f->maxstacksize,D); + DumpCode(f,D); + DumpConstants(f,D); + DumpDebug(f,D); +} + +static void DumpHeader(DumpState* D) +{ + char h[LUAC_HEADERSIZE]; + luaU_header(h); + DumpBlock(h,LUAC_HEADERSIZE,D); +} + +/* +** dump Lua function as precompiled chunk +*/ +int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) +{ + DumpState D; + D.L=L; + D.writer=w; + D.data=data; + D.strip=strip; + D.status=0; + DumpHeader(&D); + DumpFunction(f,NULL,&D); + return D.status; +} diff --git a/script/lua/lfunc.c b/script/lua/lfunc.c new file mode 100644 index 000000000..813e88f58 --- /dev/null +++ b/script/lua/lfunc.c @@ -0,0 +1,174 @@ +/* +** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $ +** Auxiliary functions to manipulate prototypes and closures +** See Copyright Notice in lua.h +*/ + + +#include + +#define lfunc_c +#define LUA_CORE + +#include "lua.h" + +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" + + + +Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e) { + Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); + luaC_link(L, obj2gco(c), LUA_TFUNCTION); + c->c.isC = 1; + c->c.env = e; + c->c.nupvalues = cast_byte(nelems); + return c; +} + + +Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e) { + Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems))); + luaC_link(L, obj2gco(c), LUA_TFUNCTION); + c->l.isC = 0; + c->l.env = e; + c->l.nupvalues = cast_byte(nelems); + while (nelems--) c->l.upvals[nelems] = NULL; + return c; +} + + +UpVal *luaF_newupval (lua_State *L) { + UpVal *uv = luaM_new(L, UpVal); + luaC_link(L, obj2gco(uv), LUA_TUPVAL); + uv->v = &uv->u.value; + setnilvalue(uv->v); + return uv; +} + + +UpVal *luaF_findupval (lua_State *L, StkId level) { + global_State *g = G(L); + GCObject **pp = &L->openupval; + UpVal *p; + UpVal *uv; + while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) { + lua_assert(p->v != &p->u.value); + if (p->v == level) { /* found a corresponding upvalue? */ + if (isdead(g, obj2gco(p))) /* is it dead? */ + changewhite(obj2gco(p)); /* ressurect it */ + return p; + } + pp = &p->next; + } + uv = luaM_new(L, UpVal); /* not found: create a new one */ + uv->tt = LUA_TUPVAL; + uv->marked = luaC_white(g); + uv->v = level; /* current value lives in the stack */ + uv->next = *pp; /* chain it in the proper position */ + *pp = obj2gco(uv); + uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ + uv->u.l.next = g->uvhead.u.l.next; + uv->u.l.next->u.l.prev = uv; + g->uvhead.u.l.next = uv; + lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); + return uv; +} + + +static void unlinkupval (UpVal *uv) { + lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); + uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ + uv->u.l.prev->u.l.next = uv->u.l.next; +} + + +void luaF_freeupval (lua_State *L, UpVal *uv) { + if (uv->v != &uv->u.value) /* is it open? */ + unlinkupval(uv); /* remove from open list */ + luaM_free(L, uv); /* free upvalue */ +} + + +void luaF_close (lua_State *L, StkId level) { + UpVal *uv; + global_State *g = G(L); + while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) { + GCObject *o = obj2gco(uv); + lua_assert(!isblack(o) && uv->v != &uv->u.value); + L->openupval = uv->next; /* remove from `open' list */ + if (isdead(g, o)) + luaF_freeupval(L, uv); /* free upvalue */ + else { + unlinkupval(uv); + setobj(L, &uv->u.value, uv->v); + uv->v = &uv->u.value; /* now current value lives here */ + luaC_linkupval(L, uv); /* link upvalue into `gcroot' list */ + } + } +} + + +Proto *luaF_newproto (lua_State *L) { + Proto *f = luaM_new(L, Proto); + luaC_link(L, obj2gco(f), LUA_TPROTO); + f->k = NULL; + f->sizek = 0; + f->p = NULL; + f->sizep = 0; + f->code = NULL; + f->sizecode = 0; + f->sizelineinfo = 0; + f->sizeupvalues = 0; + f->nups = 0; + f->upvalues = NULL; + f->numparams = 0; + f->is_vararg = 0; + f->maxstacksize = 0; + f->lineinfo = NULL; + f->sizelocvars = 0; + f->locvars = NULL; + f->linedefined = 0; + f->lastlinedefined = 0; + f->source = NULL; + return f; +} + + +void luaF_freeproto (lua_State *L, Proto *f) { + luaM_freearray(L, f->code, f->sizecode, Instruction); + luaM_freearray(L, f->p, f->sizep, Proto *); + luaM_freearray(L, f->k, f->sizek, TValue); + luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); + luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); + luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *); + luaM_free(L, f); +} + + +void luaF_freeclosure (lua_State *L, Closure *c) { + int size = (c->c.isC) ? sizeCclosure(c->c.nupvalues) : + sizeLclosure(c->l.nupvalues); + luaM_freemem(L, c, size); +} + + +/* +** Look for n-th local variable at line `line' in function `func'. +** Returns NULL if not found. +*/ +const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { + int i; + for (i = 0; isizelocvars && f->locvars[i].startpc <= pc; i++) { + if (pc < f->locvars[i].endpc) { /* is variable active? */ + local_number--; + if (local_number == 0) + return getstr(f->locvars[i].varname); + } + } + return NULL; /* not found */ +} + diff --git a/script/lua/lfunc.h b/script/lua/lfunc.h new file mode 100644 index 000000000..a68cf5151 --- /dev/null +++ b/script/lua/lfunc.h @@ -0,0 +1,34 @@ +/* +** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $ +** Auxiliary functions to manipulate prototypes and closures +** See Copyright Notice in lua.h +*/ + +#ifndef lfunc_h +#define lfunc_h + + +#include "lobject.h" + + +#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ + cast(int, sizeof(TValue)*((n)-1))) + +#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ + cast(int, sizeof(TValue *)*((n)-1))) + + +LUAI_FUNC Proto *luaF_newproto (lua_State *L); +LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); +LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); +LUAI_FUNC UpVal *luaF_newupval (lua_State *L); +LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); +LUAI_FUNC void luaF_close (lua_State *L, StkId level); +LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); +LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); +LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); +LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, + int pc); + + +#endif diff --git a/script/lua/lgc.c b/script/lua/lgc.c new file mode 100644 index 000000000..1d62975ad --- /dev/null +++ b/script/lua/lgc.c @@ -0,0 +1,713 @@ +/* +** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $ +** Garbage Collector +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#endif + +#define lgc_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" + + +#define GCSTEPSIZE 1024u +#define GCSWEEPMAX 40 +#define GCSWEEPCOST 10 +#define GCFINALIZECOST 100 + + +#define maskmarks cast_byte(~(bitmask(BLACKBIT)|WHITEBITS)) + +#define makewhite(g,x) \ + ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g))) + +#define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) +#define black2gray(x) resetbit((x)->gch.marked, BLACKBIT) + +#define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) + + +#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) +#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) + + +#define KEYWEAK bitmask(KEYWEAKBIT) +#define VALUEWEAK bitmask(VALUEWEAKBIT) + + + +#define markvalue(g,o) { checkconsistency(o); \ + if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); } + +#define markobject(g,t) { if (iswhite(obj2gco(t))) \ + reallymarkobject(g, obj2gco(t)); } + + +#define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause) + + +static void removeentry (Node *n) { + lua_assert(ttisnil(gval(n))); + if (iscollectable(gkey(n))) + setttype(gkey(n), LUA_TDEADKEY); /* dead key; remove it */ +} + + +static void reallymarkobject (global_State *g, GCObject *o) { + lua_assert(iswhite(o) && !isdead(g, o)); + white2gray(o); + switch (o->gch.tt) { + case LUA_TSTRING: { + return; + } + case LUA_TUSERDATA: { + Table *mt = gco2u(o)->metatable; + gray2black(o); /* udata are never gray */ + if (mt) markobject(g, mt); + markobject(g, gco2u(o)->env); + return; + } + case LUA_TUPVAL: { + UpVal *uv = gco2uv(o); + markvalue(g, uv->v); + if (uv->v == &uv->u.value) /* closed? */ + gray2black(o); /* open upvalues are never black */ + return; + } + case LUA_TFUNCTION: { + gco2cl(o)->c.gclist = g->gray; + g->gray = o; + break; + } + case LUA_TTABLE: { + gco2h(o)->gclist = g->gray; + g->gray = o; + break; + } + case LUA_TTHREAD: { + gco2th(o)->gclist = g->gray; + g->gray = o; + break; + } + case LUA_TPROTO: { + gco2p(o)->gclist = g->gray; + g->gray = o; + break; + } + default: lua_assert(0); + } +} + + +static void marktmu (global_State *g) { + GCObject *u = g->tmudata; + if (u) { + do { + u = u->gch.next; + makewhite(g, u); /* may be marked, if left from previous GC */ + reallymarkobject(g, u); + } while (u != g->tmudata); + } +} + + +/* move `dead' udata that need finalization to list `tmudata' */ +size_t luaC_separateudata (lua_State *L, int all) { + global_State *g = G(L); + size_t deadmem = 0; + GCObject **p = &g->mainthread->next; + GCObject *curr; + while ((curr = *p) != NULL) { + if (!(iswhite(curr) || all) || isfinalized(gco2u(curr))) + p = &curr->gch.next; /* don't bother with them */ + else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { + markfinalized(gco2u(curr)); /* don't need finalization */ + p = &curr->gch.next; + } + else { /* must call its gc method */ + deadmem += sizeudata(gco2u(curr)); + markfinalized(gco2u(curr)); + *p = curr->gch.next; + /* link `curr' at the end of `tmudata' list */ + if (g->tmudata == NULL) /* list is empty? */ + g->tmudata = curr->gch.next = curr; /* creates a circular list */ + else { + curr->gch.next = g->tmudata->gch.next; + g->tmudata->gch.next = curr; + g->tmudata = curr; + } + } + } + return deadmem; +} + + +static int traversetable (global_State *g, Table *h) { + int i; + int weakkey = 0; + int weakvalue = 0; + const TValue *mode; + if (h->metatable) + markobject(g, h->metatable); + mode = gfasttm(g, h->metatable, TM_MODE); + if (mode && ttisstring(mode)) { /* is there a weak mode? */ + weakkey = (strchr(svalue(mode), 'k') != NULL); + weakvalue = (strchr(svalue(mode), 'v') != NULL); + if (weakkey || weakvalue) { /* is really weak? */ + h->marked &= ~(KEYWEAK | VALUEWEAK); /* clear bits */ + h->marked |= cast_byte((weakkey << KEYWEAKBIT) | + (weakvalue << VALUEWEAKBIT)); + h->gclist = g->weak; /* must be cleared after GC, ... */ + g->weak = obj2gco(h); /* ... so put in the appropriate list */ + } + } + if (weakkey && weakvalue) return 1; + if (!weakvalue) { + i = h->sizearray; + while (i--) + markvalue(g, &h->array[i]); + } + i = sizenode(h); + while (i--) { + Node *n = gnode(h, i); + lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n))); + if (ttisnil(gval(n))) + removeentry(n); /* remove empty entries */ + else { + lua_assert(!ttisnil(gkey(n))); + if (!weakkey) markvalue(g, gkey(n)); + if (!weakvalue) markvalue(g, gval(n)); + } + } + return weakkey || weakvalue; +} + + +/* +** All marks are conditional because a GC may happen while the +** prototype is still being created +*/ +static void traverseproto (global_State *g, Proto *f) { + int i; + if (f->source) stringmark(f->source); + for (i=0; isizek; i++) /* mark literals */ + markvalue(g, &f->k[i]); + for (i=0; isizeupvalues; i++) { /* mark upvalue names */ + if (f->upvalues[i]) + stringmark(f->upvalues[i]); + } + for (i=0; isizep; i++) { /* mark nested protos */ + if (f->p[i]) + markobject(g, f->p[i]); + } + for (i=0; isizelocvars; i++) { /* mark local-variable names */ + if (f->locvars[i].varname) + stringmark(f->locvars[i].varname); + } +} + + + +static void traverseclosure (global_State *g, Closure *cl) { + markobject(g, cl->c.env); + if (cl->c.isC) { + int i; + for (i=0; ic.nupvalues; i++) /* mark its upvalues */ + markvalue(g, &cl->c.upvalue[i]); + } + else { + int i; + lua_assert(cl->l.nupvalues == cl->l.p->nups); + markobject(g, cl->l.p); + for (i=0; il.nupvalues; i++) /* mark its upvalues */ + markobject(g, cl->l.upvals[i]); + } +} + + +static void checkstacksizes (lua_State *L, StkId max) { + int ci_used = cast_int(L->ci - L->base_ci); /* number of `ci' in use */ + int s_used = cast_int(max - L->stack); /* part of stack in use */ + if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */ + return; /* do not touch the stacks */ + if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) + luaD_reallocCI(L, L->size_ci/2); /* still big enough... */ + condhardstacktests(luaD_reallocCI(L, ci_used + 1)); + if (4*s_used < L->stacksize && + 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize) + luaD_reallocstack(L, L->stacksize/2); /* still big enough... */ + condhardstacktests(luaD_reallocstack(L, s_used)); +} + + +static void traversestack (global_State *g, lua_State *l) { + StkId o, lim; + CallInfo *ci; + markvalue(g, gt(l)); + lim = l->top; + for (ci = l->base_ci; ci <= l->ci; ci++) { + lua_assert(ci->top <= l->stack_last); + if (lim < ci->top) lim = ci->top; + } + for (o = l->stack; o < l->top; o++) + markvalue(g, o); + for (; o <= lim; o++) + setnilvalue(o); + checkstacksizes(l, lim); +} + + +/* +** traverse one gray object, turning it to black. +** Returns `quantity' traversed. +*/ +static l_mem propagatemark (global_State *g) { + GCObject *o = g->gray; + lua_assert(isgray(o)); + gray2black(o); + switch (o->gch.tt) { + case LUA_TTABLE: { + Table *h = gco2h(o); + g->gray = h->gclist; + if (traversetable(g, h)) /* table is weak? */ + black2gray(o); /* keep it gray */ + return sizeof(Table) + sizeof(TValue) * h->sizearray + + sizeof(Node) * sizenode(h); + } + case LUA_TFUNCTION: { + Closure *cl = gco2cl(o); + g->gray = cl->c.gclist; + traverseclosure(g, cl); + return (cl->c.isC) ? sizeCclosure(cl->c.nupvalues) : + sizeLclosure(cl->l.nupvalues); + } + case LUA_TTHREAD: { + lua_State *th = gco2th(o); + g->gray = th->gclist; + th->gclist = g->grayagain; + g->grayagain = o; + black2gray(o); + traversestack(g, th); + return sizeof(lua_State) + sizeof(TValue) * th->stacksize + + sizeof(CallInfo) * th->size_ci; + } + case LUA_TPROTO: { + Proto *p = gco2p(o); + g->gray = p->gclist; + traverseproto(g, p); + return sizeof(Proto) + sizeof(Instruction) * p->sizecode + + sizeof(Proto *) * p->sizep + + sizeof(TValue) * p->sizek + + sizeof(int) * p->sizelineinfo + + sizeof(LocVar) * p->sizelocvars + + sizeof(TString *) * p->sizeupvalues; + } + default: lua_assert(0); return 0; + } +} + + +static size_t propagateall (global_State *g) { + size_t m = 0; + while (g->gray) m += propagatemark(g); + return m; +} + + +/* +** The next function tells whether a key or value can be cleared from +** a weak table. Non-collectable objects are never removed from weak +** tables. Strings behave as `values', so are never removed too. for +** other objects: if really collected, cannot keep them; for userdata +** being finalized, keep them in keys, but not in values +*/ +static int iscleared (const TValue *o, int iskey) { + if (!iscollectable(o)) return 0; + if (ttisstring(o)) { + stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */ + return 0; + } + return iswhite(gcvalue(o)) || + (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o)))); +} + + +/* +** clear collected entries from weaktables +*/ +static void cleartable (GCObject *l) { + while (l) { + Table *h = gco2h(l); + int i = h->sizearray; + lua_assert(testbit(h->marked, VALUEWEAKBIT) || + testbit(h->marked, KEYWEAKBIT)); + if (testbit(h->marked, VALUEWEAKBIT)) { + while (i--) { + TValue *o = &h->array[i]; + if (iscleared(o, 0)) /* value was collected? */ + setnilvalue(o); /* remove value */ + } + } + i = sizenode(h); + while (i--) { + Node *n = gnode(h, i); + if (!ttisnil(gval(n)) && /* non-empty entry? */ + (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) { + setnilvalue(gval(n)); /* remove value ... */ + removeentry(n); /* remove entry from table */ + } + } + l = h->gclist; + } +} + + +static void freeobj (lua_State *L, GCObject *o) { + switch (o->gch.tt) { + case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break; + case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break; + case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break; + case LUA_TTABLE: luaH_free(L, gco2h(o)); break; + case LUA_TTHREAD: { + lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread); + luaE_freethread(L, gco2th(o)); + break; + } + case LUA_TSTRING: { + G(L)->strt.nuse--; + luaM_freemem(L, o, sizestring(gco2ts(o))); + break; + } + case LUA_TUSERDATA: { + luaM_freemem(L, o, sizeudata(gco2u(o))); + break; + } + default: lua_assert(0); + } +} + + + +#define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM) + + +static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { + GCObject *curr; + global_State *g = G(L); + int deadmask = otherwhite(g); + while ((curr = *p) != NULL && count-- > 0) { + if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each thread */ + sweepwholelist(L, &gco2th(curr)->openupval); + if ((curr->gch.marked ^ WHITEBITS) & deadmask) { /* not dead? */ + lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT)); + makewhite(g, curr); /* make it white (for next cycle) */ + p = &curr->gch.next; + } + else { /* must erase `curr' */ + lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT)); + *p = curr->gch.next; + if (curr == g->rootgc) /* is the first element of the list? */ + g->rootgc = curr->gch.next; /* adjust first */ + freeobj(L, curr); + } + } + return p; +} + + +static void checkSizes (lua_State *L) { + global_State *g = G(L); + /* check size of string hash */ + if (g->strt.nuse < cast(lu_int32, g->strt.size/4) && + g->strt.size > MINSTRTABSIZE*2) + luaS_resize(L, g->strt.size/2); /* table is too big */ + /* check size of buffer */ + if (luaZ_sizebuffer(&g->buff) > LUA_MINBUFFER*2) { /* buffer too big? */ + size_t newsize = luaZ_sizebuffer(&g->buff) / 2; + luaZ_resizebuffer(L, &g->buff, newsize); + } +} + + +static void GCTM (lua_State *L) { + global_State *g = G(L); + GCObject *o = g->tmudata->gch.next; /* get first element */ + Udata *udata = rawgco2u(o); + const TValue *tm; + /* remove udata from `tmudata' */ + if (o == g->tmudata) /* last element? */ + g->tmudata = NULL; + else + g->tmudata->gch.next = udata->uv.next; + udata->uv.next = g->mainthread->next; /* return it to `root' list */ + g->mainthread->next = o; + makewhite(g, o); + tm = fasttm(L, udata->uv.metatable, TM_GC); + if (tm != NULL) { + lu_byte oldah = L->allowhook; + lu_mem oldt = g->GCthreshold; + L->allowhook = 0; /* stop debug hooks during GC tag method */ + g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ + setobj2s(L, L->top, tm); + setuvalue(L, L->top+1, udata); + L->top += 2; + luaD_call(L, L->top - 2, 0); + L->allowhook = oldah; /* restore hooks */ + g->GCthreshold = oldt; /* restore threshold */ + } +} + + +/* +** Call all GC tag methods +*/ +void luaC_callGCTM (lua_State *L) { + while (G(L)->tmudata) + GCTM(L); +} + + +void luaC_freeall (lua_State *L) { + global_State *g = G(L); + int i; + g->currentwhite = WHITEBITS | bitmask(SFIXEDBIT); /* mask to collect all elements */ + sweepwholelist(L, &g->rootgc); + for (i = 0; i < g->strt.size; i++) /* free all string lists */ + sweepwholelist(L, &g->strt.hash[i]); +} + + +static void markmt (global_State *g) { + int i; + for (i=0; imt[i]) markobject(g, g->mt[i]); +} + + +/* mark root set */ +static void markroot (lua_State *L) { + global_State *g = G(L); + g->gray = NULL; + g->grayagain = NULL; + g->weak = NULL; + markobject(g, g->mainthread); + /* make global table be traversed before main stack */ + markvalue(g, gt(g->mainthread)); + markvalue(g, registry(L)); + markmt(g); + g->gcstate = GCSpropagate; +} + + +static void remarkupvals (global_State *g) { + UpVal *uv; + for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { + lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); + if (isgray(obj2gco(uv))) + markvalue(g, uv->v); + } +} + + +static void atomic (lua_State *L) { + global_State *g = G(L); + size_t udsize; /* total size of userdata to be finalized */ + /* remark occasional upvalues of (maybe) dead threads */ + remarkupvals(g); + /* traverse objects cautch by write barrier and by 'remarkupvals' */ + propagateall(g); + /* remark weak tables */ + g->gray = g->weak; + g->weak = NULL; + lua_assert(!iswhite(obj2gco(g->mainthread))); + markobject(g, L); /* mark running thread */ + markmt(g); /* mark basic metatables (again) */ + propagateall(g); + /* remark gray again */ + g->gray = g->grayagain; + g->grayagain = NULL; + propagateall(g); + udsize = luaC_separateudata(L, 0); /* separate userdata to be finalized */ + marktmu(g); /* mark `preserved' userdata */ + udsize += propagateall(g); /* remark, to propagate `preserveness' */ + cleartable(g->weak); /* remove collected objects from weak tables */ + /* flip current white */ + g->currentwhite = cast_byte(otherwhite(g)); + g->sweepstrgc = 0; + g->sweepgc = &g->rootgc; + g->gcstate = GCSsweepstring; + g->estimate = g->totalbytes - udsize; /* first estimate */ +} + + +static l_mem singlestep (lua_State *L) { + global_State *g = G(L); + /*lua_checkmemory(L);*/ + switch (g->gcstate) { + case GCSpause: { + markroot(L); /* start a new collection */ + return 0; + } + case GCSpropagate: { + if (g->gray) + return propagatemark(g); + else { /* no more `gray' objects */ + atomic(L); /* finish mark phase */ + return 0; + } + } + case GCSsweepstring: { + lu_mem old = g->totalbytes; + sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]); + if (g->sweepstrgc >= g->strt.size) /* nothing more to sweep? */ + g->gcstate = GCSsweep; /* end sweep-string phase */ + lua_assert(old >= g->totalbytes); + g->estimate -= old - g->totalbytes; + return GCSWEEPCOST; + } + case GCSsweep: { + lu_mem old = g->totalbytes; + g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); + if (*g->sweepgc == NULL) { /* nothing more to sweep? */ + checkSizes(L); + g->gcstate = GCSfinalize; /* end sweep phase */ + } + lua_assert(old >= g->totalbytes); + g->estimate -= old - g->totalbytes; + return GCSWEEPMAX*GCSWEEPCOST; + } + case GCSfinalize: { + if (g->tmudata) { + GCTM(L); + if (g->estimate > GCFINALIZECOST) + g->estimate -= GCFINALIZECOST; + return GCFINALIZECOST; + } + else { + g->gcstate = GCSpause; /* end collection */ + g->gcdept = 0; + return 0; + } + } + default: lua_assert(0); return 0; + } +} + + +void luaC_step (lua_State *L) { + global_State *g = G(L); + l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul; + if (lim == 0) + lim = (MAX_LUMEM-1)/2; /* no limit */ + g->gcdept += g->totalbytes - g->GCthreshold; + do { + lim -= singlestep(L); + if (g->gcstate == GCSpause) + break; + } while (lim > 0); + if (g->gcstate != GCSpause) { + if (g->gcdept < GCSTEPSIZE) + g->GCthreshold = g->totalbytes + GCSTEPSIZE; /* - lim/g->gcstepmul;*/ + else { + g->gcdept -= GCSTEPSIZE; + g->GCthreshold = g->totalbytes; + } + } + else { + lua_assert(g->totalbytes >= g->estimate); + setthreshold(g); + } +} + + +void luaC_fullgc (lua_State *L) { + global_State *g = G(L); + if (g->gcstate <= GCSpropagate) { + /* reset sweep marks to sweep all elements (returning them to white) */ + g->sweepstrgc = 0; + g->sweepgc = &g->rootgc; + /* reset other collector lists */ + g->gray = NULL; + g->grayagain = NULL; + g->weak = NULL; + g->gcstate = GCSsweepstring; + } + lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate); + /* finish any pending sweep phase */ + while (g->gcstate != GCSfinalize) { + lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep); + singlestep(L); + } + markroot(L); + while (g->gcstate != GCSpause) { + singlestep(L); + } + setthreshold(g); +} + + +void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) { + global_State *g = G(L); + lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); + lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); + lua_assert(ttype(&o->gch) != LUA_TTABLE); + /* must keep invariant? */ + if (g->gcstate == GCSpropagate) + reallymarkobject(g, v); /* restore invariant */ + else /* don't mind */ + makewhite(g, o); /* mark as white just to avoid other barriers */ +} + + +void luaC_barrierback (lua_State *L, Table *t) { + global_State *g = G(L); + GCObject *o = obj2gco(t); + lua_assert(isblack(o) && !isdead(g, o)); + lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); + black2gray(o); /* make table gray (again) */ + t->gclist = g->grayagain; + g->grayagain = o; +} + + +void luaC_link (lua_State *L, GCObject *o, lu_byte tt) { + global_State *g = G(L); + o->gch.next = g->rootgc; + g->rootgc = o; + o->gch.marked = luaC_white(g); + o->gch.tt = tt; +} + + +void luaC_linkupval (lua_State *L, UpVal *uv) { + global_State *g = G(L); + GCObject *o = obj2gco(uv); + o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ + g->rootgc = o; + if (isgray(o)) { + if (g->gcstate == GCSpropagate) { + gray2black(o); /* closed upvalues need barrier */ + luaC_barrier(L, uv, uv->v); + } + else { /* sweep phase: sweep it (turning it into white) */ + makewhite(g, o); + lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); + } + } +} + diff --git a/script/lua/lgc.h b/script/lua/lgc.h new file mode 100644 index 000000000..5a8dc605b --- /dev/null +++ b/script/lua/lgc.h @@ -0,0 +1,110 @@ +/* +** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $ +** Garbage Collector +** See Copyright Notice in lua.h +*/ + +#ifndef lgc_h +#define lgc_h + + +#include "lobject.h" + + +/* +** Possible states of the Garbage Collector +*/ +#define GCSpause 0 +#define GCSpropagate 1 +#define GCSsweepstring 2 +#define GCSsweep 3 +#define GCSfinalize 4 + + +/* +** some userful bit tricks +*/ +#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) +#define setbits(x,m) ((x) |= (m)) +#define testbits(x,m) ((x) & (m)) +#define bitmask(b) (1<<(b)) +#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2)) +#define l_setbit(x,b) setbits(x, bitmask(b)) +#define resetbit(x,b) resetbits(x, bitmask(b)) +#define testbit(x,b) testbits(x, bitmask(b)) +#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2))) +#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2))) +#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2))) + + + +/* +** Layout for bit use in `marked' field: +** bit 0 - object is white (type 0) +** bit 1 - object is white (type 1) +** bit 2 - object is black +** bit 3 - for userdata: has been finalized +** bit 3 - for tables: has weak keys +** bit 4 - for tables: has weak values +** bit 5 - object is fixed (should not be collected) +** bit 6 - object is "super" fixed (only the main thread) +*/ + + +#define WHITE0BIT 0 +#define WHITE1BIT 1 +#define BLACKBIT 2 +#define FINALIZEDBIT 3 +#define KEYWEAKBIT 3 +#define VALUEWEAKBIT 4 +#define FIXEDBIT 5 +#define SFIXEDBIT 6 +#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) + + +#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) +#define isblack(x) testbit((x)->gch.marked, BLACKBIT) +#define isgray(x) (!isblack(x) && !iswhite(x)) + +#define otherwhite(g) (g->currentwhite ^ WHITEBITS) +#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS) + +#define changewhite(x) ((x)->gch.marked ^= WHITEBITS) +#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) + +#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) + +#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) + + +#define luaC_checkGC(L) { \ + condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \ + if (G(L)->totalbytes >= G(L)->GCthreshold) \ + luaC_step(L); } + + +#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ + luaC_barrierf(L,obj2gco(p),gcvalue(v)); } + +#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \ + luaC_barrierback(L,t); } + +#define luaC_objbarrier(L,p,o) \ + { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ + luaC_barrierf(L,obj2gco(p),obj2gco(o)); } + +#define luaC_objbarriert(L,t,o) \ + { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); } + +LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all); +LUAI_FUNC void luaC_callGCTM (lua_State *L); +LUAI_FUNC void luaC_freeall (lua_State *L); +LUAI_FUNC void luaC_step (lua_State *L); +LUAI_FUNC void luaC_fullgc (lua_State *L); +LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); +LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); +LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); +LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t); + + +#endif diff --git a/script/lua/linit.c b/script/lua/linit.c new file mode 100644 index 000000000..d034a2fbe --- /dev/null +++ b/script/lua/linit.c @@ -0,0 +1,38 @@ +/* +** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $ +** Initialization of libraries for lua.c +** See Copyright Notice in lua.h +*/ + + +#define linit_c +#define LUA_LIB + +#include "lua.h" + +#include "lualib.h" +#include "lauxlib.h" + + +static const luaL_Reg lualibs[] = { + {"", luaopen_base}, +// {LUA_LOADLIBNAME, luaopen_package}, + {LUA_TABLIBNAME, luaopen_table}, +// {LUA_IOLIBNAME, luaopen_io}, +// {LUA_OSLIBNAME, luaopen_os}, +// {LUA_STRLIBNAME, luaopen_string}, +// {LUA_MATHLIBNAME, luaopen_math}, +// {LUA_DBLIBNAME, luaopen_debug}, + {NULL, NULL} +}; + + +LUALIB_API void luaL_openlibs (lua_State *L) { + const luaL_Reg *lib = lualibs; + for (; lib->func; lib++) { + lua_pushcfunction(L, lib->func); + lua_pushstring(L, lib->name); + lua_call(L, 1, 0); + } +} + diff --git a/script/lua/liolib.c b/script/lua/liolib.c new file mode 100644 index 000000000..e79ed1cb2 --- /dev/null +++ b/script/lua/liolib.c @@ -0,0 +1,553 @@ +/* +** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $ +** Standard I/O (and system) library +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include + +#define liolib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + + +#define IO_INPUT 1 +#define IO_OUTPUT 2 + + +static const char *const fnames[] = {"input", "output"}; + + +static int pushresult (lua_State *L, int i, const char *filename) { + int en = errno; /* calls to Lua API may change this value */ + if (i) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + if (filename) + lua_pushfstring(L, "%s: %s", filename, strerror(en)); + else + lua_pushfstring(L, "%s", strerror(en)); + lua_pushinteger(L, en); + return 3; + } +} + + +static void fileerror (lua_State *L, int arg, const char *filename) { + lua_pushfstring(L, "%s: %s", filename, strerror(errno)); + luaL_argerror(L, arg, lua_tostring(L, -1)); +} + + +#define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) + + +static int io_type (lua_State *L) { + void *ud; + luaL_checkany(L, 1); + ud = lua_touserdata(L, 1); + lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE); + if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1)) + lua_pushnil(L); /* not a file */ + else if (*((FILE **)ud) == NULL) + lua_pushliteral(L, "closed file"); + else + lua_pushliteral(L, "file"); + return 1; +} + + +static FILE *tofile (lua_State *L) { + FILE **f = tofilep(L); + if (*f == NULL) + luaL_error(L, "attempt to use a closed file"); + return *f; +} + + + +/* +** When creating file handles, always creates a `closed' file handle +** before opening the actual file; so, if there is a memory error, the +** file is not left opened. +*/ +static FILE **newfile (lua_State *L) { + FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *)); + *pf = NULL; /* file handle is currently `closed' */ + luaL_getmetatable(L, LUA_FILEHANDLE); + lua_setmetatable(L, -2); + return pf; +} + + +/* +** function to (not) close the standard files stdin, stdout, and stderr +*/ +static int io_noclose (lua_State *L) { + lua_pushnil(L); + lua_pushliteral(L, "cannot close standard file"); + return 2; +} + + +/* +** function to close 'popen' files +*/ +static int io_pclose (lua_State *L) { + FILE **p = tofilep(L); + int ok = lua_pclose(L, *p); + *p = NULL; + return pushresult(L, ok, NULL); +} + + +/* +** function to close regular files +*/ +static int io_fclose (lua_State *L) { + FILE **p = tofilep(L); + int ok = (fclose(*p) == 0); + *p = NULL; + return pushresult(L, ok, NULL); +} + + +static int aux_close (lua_State *L) { + lua_getfenv(L, 1); + lua_getfield(L, -1, "__close"); + return (lua_tocfunction(L, -1))(L); +} + + +static int io_close (lua_State *L) { + if (lua_isnone(L, 1)) + lua_rawgeti(L, LUA_ENVIRONINDEX, IO_OUTPUT); + tofile(L); /* make sure argument is a file */ + return aux_close(L); +} + + +static int io_gc (lua_State *L) { + FILE *f = *tofilep(L); + /* ignore closed files */ + if (f != NULL) + aux_close(L); + return 0; +} + + +static int io_tostring (lua_State *L) { + FILE *f = *tofilep(L); + if (f == NULL) + lua_pushliteral(L, "file (closed)"); + else + lua_pushfstring(L, "file (%p)", f); + return 1; +} + + +static int io_open (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + const char *mode = luaL_optstring(L, 2, "r"); + FILE **pf = newfile(L); + *pf = fopen(filename, mode); + return (*pf == NULL) ? pushresult(L, 0, filename) : 1; +} + + +/* +** this function has a separated environment, which defines the +** correct __close for 'popen' files +*/ +static int io_popen (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + const char *mode = luaL_optstring(L, 2, "r"); + FILE **pf = newfile(L); + *pf = lua_popen(L, filename, mode); + return (*pf == NULL) ? pushresult(L, 0, filename) : 1; +} + + +static int io_tmpfile (lua_State *L) { + FILE **pf = newfile(L); + *pf = tmpfile(); + return (*pf == NULL) ? pushresult(L, 0, NULL) : 1; +} + + +static FILE *getiofile (lua_State *L, int findex) { + FILE *f; + lua_rawgeti(L, LUA_ENVIRONINDEX, findex); + f = *(FILE **)lua_touserdata(L, -1); + if (f == NULL) + luaL_error(L, "standard %s file is closed", fnames[findex - 1]); + return f; +} + + +static int g_iofile (lua_State *L, int f, const char *mode) { + if (!lua_isnoneornil(L, 1)) { + const char *filename = lua_tostring(L, 1); + if (filename) { + FILE **pf = newfile(L); + *pf = fopen(filename, mode); + if (*pf == NULL) + fileerror(L, 1, filename); + } + else { + tofile(L); /* check that it's a valid file handle */ + lua_pushvalue(L, 1); + } + lua_rawseti(L, LUA_ENVIRONINDEX, f); + } + /* return current value */ + lua_rawgeti(L, LUA_ENVIRONINDEX, f); + return 1; +} + + +static int io_input (lua_State *L) { + return g_iofile(L, IO_INPUT, "r"); +} + + +static int io_output (lua_State *L) { + return g_iofile(L, IO_OUTPUT, "w"); +} + + +static int io_readline (lua_State *L); + + +static void aux_lines (lua_State *L, int idx, int toclose) { + lua_pushvalue(L, idx); + lua_pushboolean(L, toclose); /* close/not close file when finished */ + lua_pushcclosure(L, io_readline, 2); +} + + +static int f_lines (lua_State *L) { + tofile(L); /* check that it's a valid file handle */ + aux_lines(L, 1, 0); + return 1; +} + + +static int io_lines (lua_State *L) { + if (lua_isnoneornil(L, 1)) { /* no arguments? */ + /* will iterate over default input */ + lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT); + return f_lines(L); + } + else { + const char *filename = luaL_checkstring(L, 1); + FILE **pf = newfile(L); + *pf = fopen(filename, "r"); + if (*pf == NULL) + fileerror(L, 1, filename); + aux_lines(L, lua_gettop(L), 1); + return 1; + } +} + + +/* +** {====================================================== +** READ +** ======================================================= +*/ + + +static int read_number (lua_State *L, FILE *f) { + lua_Number d; + if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { + lua_pushnumber(L, d); + return 1; + } + else return 0; /* read fails */ +} + + +static int test_eof (lua_State *L, FILE *f) { + int c = getc(f); + ungetc(c, f); + lua_pushlstring(L, NULL, 0); + return (c != EOF); +} + + +static int read_line (lua_State *L, FILE *f) { + luaL_Buffer b; + luaL_buffinit(L, &b); + for (;;) { + size_t l; + char *p = luaL_prepbuffer(&b); + if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ + luaL_pushresult(&b); /* close buffer */ + return (lua_objlen(L, -1) > 0); /* check whether read something */ + } + l = strlen(p); + if (l == 0 || p[l-1] != '\n') + luaL_addsize(&b, l); + else { + luaL_addsize(&b, l - 1); /* do not include `eol' */ + luaL_pushresult(&b); /* close buffer */ + return 1; /* read at least an `eol' */ + } + } +} + + +static int read_chars (lua_State *L, FILE *f, size_t n) { + size_t rlen; /* how much to read */ + size_t nr; /* number of chars actually read */ + luaL_Buffer b; + luaL_buffinit(L, &b); + rlen = LUAL_BUFFERSIZE; /* try to read that much each time */ + do { + char *p = luaL_prepbuffer(&b); + if (rlen > n) rlen = n; /* cannot read more than asked */ + nr = fread(p, sizeof(char), rlen, f); + luaL_addsize(&b, nr); + n -= nr; /* still have to read `n' chars */ + } while (n > 0 && nr == rlen); /* until end of count or eof */ + luaL_pushresult(&b); /* close buffer */ + return (n == 0 || lua_objlen(L, -1) > 0); +} + + +static int g_read (lua_State *L, FILE *f, int first) { + int nargs = lua_gettop(L) - 1; + int success; + int n; + clearerr(f); + if (nargs == 0) { /* no arguments? */ + success = read_line(L, f); + n = first+1; /* to return 1 result */ + } + else { /* ensure stack space for all results and for auxlib's buffer */ + luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); + success = 1; + for (n = first; nargs-- && success; n++) { + if (lua_type(L, n) == LUA_TNUMBER) { + size_t l = (size_t)lua_tointeger(L, n); + success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); + } + else { + const char *p = lua_tostring(L, n); + luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); + switch (p[1]) { + case 'n': /* number */ + success = read_number(L, f); + break; + case 'l': /* line */ + success = read_line(L, f); + break; + case 'a': /* file */ + read_chars(L, f, ~((size_t)0)); /* read MAX_SIZE_T chars */ + success = 1; /* always success */ + break; + default: + return luaL_argerror(L, n, "invalid format"); + } + } + } + } + if (ferror(f)) + return pushresult(L, 0, NULL); + if (!success) { + lua_pop(L, 1); /* remove last result */ + lua_pushnil(L); /* push nil instead */ + } + return n - first; +} + + +static int io_read (lua_State *L) { + return g_read(L, getiofile(L, IO_INPUT), 1); +} + + +static int f_read (lua_State *L) { + return g_read(L, tofile(L), 2); +} + + +static int io_readline (lua_State *L) { + FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1)); + int sucess; + if (f == NULL) /* file is already closed? */ + luaL_error(L, "file is already closed"); + sucess = read_line(L, f); + if (ferror(f)) + return luaL_error(L, "%s", strerror(errno)); + if (sucess) return 1; + else { /* EOF */ + if (lua_toboolean(L, lua_upvalueindex(2))) { /* generator created file? */ + lua_settop(L, 0); + lua_pushvalue(L, lua_upvalueindex(1)); + aux_close(L); /* close it */ + } + return 0; + } +} + +/* }====================================================== */ + + +static int g_write (lua_State *L, FILE *f, int arg) { + int nargs = lua_gettop(L) - 1; + int status = 1; + for (; nargs--; arg++) { + if (lua_type(L, arg) == LUA_TNUMBER) { + /* optimization: could be done exactly as for strings */ + status = status && + fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; + } + else { + size_t l; + const char *s = luaL_checklstring(L, arg, &l); + status = status && (fwrite(s, sizeof(char), l, f) == l); + } + } + return pushresult(L, status, NULL); +} + + +static int io_write (lua_State *L) { + return g_write(L, getiofile(L, IO_OUTPUT), 1); +} + + +static int f_write (lua_State *L) { + return g_write(L, tofile(L), 2); +} + + +static int f_seek (lua_State *L) { + static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; + static const char *const modenames[] = {"set", "cur", "end", NULL}; + FILE *f = tofile(L); + int op = luaL_checkoption(L, 2, "cur", modenames); + long offset = luaL_optlong(L, 3, 0); + op = fseek(f, offset, mode[op]); + if (op) + return pushresult(L, 0, NULL); /* error */ + else { + lua_pushinteger(L, ftell(f)); + return 1; + } +} + + +static int f_setvbuf (lua_State *L) { + static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; + static const char *const modenames[] = {"no", "full", "line", NULL}; + FILE *f = tofile(L); + int op = luaL_checkoption(L, 2, NULL, modenames); + lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); + int res = setvbuf(f, NULL, mode[op], sz); + return pushresult(L, res == 0, NULL); +} + + + +static int io_flush (lua_State *L) { + return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); +} + + +static int f_flush (lua_State *L) { + return pushresult(L, fflush(tofile(L)) == 0, NULL); +} + + +static const luaL_Reg iolib[] = { + {"close", io_close}, + {"flush", io_flush}, + {"input", io_input}, + {"lines", io_lines}, + {"open", io_open}, + {"output", io_output}, + {"popen", io_popen}, + {"read", io_read}, + {"tmpfile", io_tmpfile}, + {"type", io_type}, + {"write", io_write}, + {NULL, NULL} +}; + + +static const luaL_Reg flib[] = { + {"close", io_close}, + {"flush", f_flush}, + {"lines", f_lines}, + {"read", f_read}, + {"seek", f_seek}, + {"setvbuf", f_setvbuf}, + {"write", f_write}, + {"__gc", io_gc}, + {"__tostring", io_tostring}, + {NULL, NULL} +}; + + +static void createmeta (lua_State *L) { + luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ + lua_pushvalue(L, -1); /* push metatable */ + lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ + luaL_register(L, NULL, flib); /* file methods */ +} + + +static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { + *newfile(L) = f; + if (k > 0) { + lua_pushvalue(L, -1); + lua_rawseti(L, LUA_ENVIRONINDEX, k); + } + lua_pushvalue(L, -2); /* copy environment */ + lua_setfenv(L, -2); /* set it */ + lua_setfield(L, -3, fname); +} + + +static void newfenv (lua_State *L, lua_CFunction cls) { + lua_createtable(L, 0, 1); + lua_pushcfunction(L, cls); + lua_setfield(L, -2, "__close"); +} + + +LUALIB_API int luaopen_io (lua_State *L) { + createmeta(L); + /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */ + newfenv(L, io_fclose); + lua_replace(L, LUA_ENVIRONINDEX); + /* open library */ + luaL_register(L, LUA_IOLIBNAME, iolib); + /* create (and set) default files */ + newfenv(L, io_noclose); /* close function for default files */ + createstdfile(L, stdin, IO_INPUT, "stdin"); + createstdfile(L, stdout, IO_OUTPUT, "stdout"); + createstdfile(L, stderr, 0, "stderr"); + lua_pop(L, 1); /* pop environment for default files */ + lua_getfield(L, -1, "popen"); + newfenv(L, io_pclose); /* create environment for 'popen' */ + lua_setfenv(L, -2); /* set fenv for 'popen' */ + lua_pop(L, 1); /* pop 'popen' */ + return 1; +} + diff --git a/script/lua/llex.c b/script/lua/llex.c new file mode 100644 index 000000000..cb08e8928 --- /dev/null +++ b/script/lua/llex.c @@ -0,0 +1,467 @@ +/* +** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lexical Analyzer +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#endif + +#define llex_c +#define LUA_CORE + +#include "lua.h" + +#include "ldo.h" +#include "llex.h" +#include "lobject.h" +#include "lparser.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "lzio.h" + + + +#define next(ls) (ls->current = zgetc(ls->z)) + + + + +#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') + + +/* ORDER RESERVED */ +const char *const luaX_tokens [] = { + "and", "break", "do", "else", "elseif", + "end", "false", "for", "function", "if", + "in", "local", "nil", "not", "or", "repeat", + "return", "then", "true", "until", "while", + "..", "...", "==", ">=", "<=", "~=", + "", "", "", "", + NULL +}; + + +#define save_and_next(ls) (save(ls, ls->current), next(ls)) + + +static void save (LexState *ls, int c) { + Mbuffer *b = ls->buff; + if (b->n + 1 > b->buffsize) { + size_t newsize; + if (b->buffsize >= MAX_SIZET/2) + luaX_lexerror(ls, "lexical element too long", 0); + newsize = b->buffsize * 2; + luaZ_resizebuffer(ls->L, b, newsize); + } + b->buffer[b->n++] = cast(char, c); +} + + +void luaX_init (lua_State *L) { + int i; + for (i=0; itsv.reserved = cast_byte(i+1); /* reserved word */ + } +} + + +#define MAXSRC 80 + + +const char *luaX_token2str (LexState *ls, int token) { + if (token < FIRST_RESERVED) { + lua_assert(token == cast(unsigned char, token)); + return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) : + luaO_pushfstring(ls->L, "%c", token); + } + else + return luaX_tokens[token-FIRST_RESERVED]; +} + + +static const char *txtToken (LexState *ls, int token) { + switch (token) { + case TK_NAME: + case TK_STRING: + case TK_NUMBER: + save(ls, '\0'); + return luaZ_buffer(ls->buff); + default: + return luaX_token2str(ls, token); + } +} + + +void luaX_lexerror (LexState *ls, const char *msg, int token) { + char buff[MAXSRC]; + luaO_chunkid(buff, getstr(ls->source), MAXSRC); + msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); + if (token) + luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token)); + luaD_throw(ls->L, LUA_ERRSYNTAX); +} + + +void luaX_syntaxerror (LexState *ls, const char *msg) { + luaX_lexerror(ls, msg, ls->t.token); +} + + +TString *luaX_newstring (LexState *ls, const char *str, size_t l) { + lua_State *L = ls->L; + TString *ts = luaS_newlstr(L, str, l); + TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */ + if (ttisnil(o)) + setbvalue(o, 1); /* make sure `str' will not be collected */ + return ts; +} + + +static void inclinenumber (LexState *ls) { + int old = ls->current; + lua_assert(currIsNewline(ls)); + next(ls); /* skip `\n' or `\r' */ + if (currIsNewline(ls) && ls->current != old) + next(ls); /* skip `\n\r' or `\r\n' */ + if (++ls->linenumber >= MAX_INT) + luaX_syntaxerror(ls, "chunk has too many lines"); +} + + +void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) { + ls->decpoint = '.'; + ls->L = L; + ls->lookahead.token = TK_EOS; /* no look-ahead token */ + ls->z = z; + ls->fs = NULL; + ls->linenumber = 1; + ls->lastline = 1; + ls->source = source; + luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ + next(ls); /* read first char */ +} + + + +/* +** ======================================================= +** LEXICAL ANALYZER +** ======================================================= +*/ + + + +static int check_next (LexState *ls, const char *set) { + if (!strchr(set, ls->current)) + return 0; + save_and_next(ls); + return 1; +} + + +static void buffreplace (LexState *ls, char from, char to) { + size_t n = luaZ_bufflen(ls->buff); + char *p = luaZ_buffer(ls->buff); + while (n--) + if (p[n] == from) p[n] = to; +} + + +static void trydecpoint (LexState *ls, SemInfo *seminfo) { + /* format error: try to update decimal point separator */ +#if 0 + struct lconv *cv = localeconv(); + char old = ls->decpoint; + ls->decpoint = (cv ? cv->decimal_point[0] : '.'); +#else + char old = ls->decpoint; + ls->decpoint = '.'; +#endif + buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */ + if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) { + /* format error with correct decimal point: no more options */ + buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ + luaX_lexerror(ls, "malformed number", TK_NUMBER); + } +} + + +/* LUA_NUMBER */ +static void read_numeral (LexState *ls, SemInfo *seminfo) { + lua_assert(isdigit(ls->current)); + do { + save_and_next(ls); + } while (isdigit(ls->current) || ls->current == '.'); + if (check_next(ls, "Ee")) /* `E'? */ + check_next(ls, "+-"); /* optional exponent sign */ + while (isalnum(ls->current) || ls->current == '_') + save_and_next(ls); + save(ls, '\0'); + buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ + if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */ + trydecpoint(ls, seminfo); /* try to update decimal point separator */ +} + + +static int skip_sep (LexState *ls) { + int count = 0; + int s = ls->current; + lua_assert(s == '[' || s == ']'); + save_and_next(ls); + while (ls->current == '=') { + save_and_next(ls); + count++; + } + return (ls->current == s) ? count : (-count) - 1; +} + + +static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { + int cont = 0; + (void)(cont); /* avoid warnings when `cont' is not used */ + save_and_next(ls); /* skip 2nd `[' */ + if (currIsNewline(ls)) /* string starts with a newline? */ + inclinenumber(ls); /* skip it */ + for (;;) { + switch (ls->current) { + case EOZ: + luaX_lexerror(ls, (seminfo) ? "unfinished long string" : + "unfinished long comment", TK_EOS); + break; /* to avoid warnings */ +#if defined(LUA_COMPAT_LSTR) + case '[': { + if (skip_sep(ls) == sep) { + save_and_next(ls); /* skip 2nd `[' */ + cont++; +#if LUA_COMPAT_LSTR == 1 + if (sep == 0) + luaX_lexerror(ls, "nesting of [[...]] is deprecated", '['); +#endif + } + break; + } +#endif + case ']': { + if (skip_sep(ls) == sep) { + save_and_next(ls); /* skip 2nd `]' */ +#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2 + cont--; + if (sep == 0 && cont >= 0) break; +#endif + goto endloop; + } + break; + } + case '\n': + case '\r': { + save(ls, '\n'); + inclinenumber(ls); + if (!seminfo) luaZ_resetbuffer(ls->buff); /* avoid wasting space */ + break; + } + default: { + if (seminfo) save_and_next(ls); + else next(ls); + } + } + } endloop: + if (seminfo) + seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), + luaZ_bufflen(ls->buff) - 2*(2 + sep)); +} + + +static void read_string (LexState *ls, int del, SemInfo *seminfo) { + save_and_next(ls); + while (ls->current != del) { + switch (ls->current) { + case EOZ: + luaX_lexerror(ls, "unfinished string", TK_EOS); + continue; /* to avoid warnings */ + case '\n': + case '\r': + luaX_lexerror(ls, "unfinished string", TK_STRING); + continue; /* to avoid warnings */ + case '\\': { + int c; + next(ls); /* do not save the `\' */ + switch (ls->current) { + case 'a': c = '\a'; break; + case 'b': c = '\b'; break; + case 'f': c = '\f'; break; + case 'n': c = '\n'; break; + case 'r': c = '\r'; break; + case 't': c = '\t'; break; + case 'v': c = '\v'; break; + case '\n': /* go through */ + case '\r': save(ls, '\n'); inclinenumber(ls); continue; + case EOZ: continue; /* will raise an error next loop */ + default: { + if (!isdigit(ls->current)) + save_and_next(ls); /* handles \\, \", \', and \? */ + else { /* \xxx */ + int i = 0; + c = 0; + do { + c = 10*c + (ls->current-'0'); + next(ls); + } while (++i<3 && isdigit(ls->current)); + if (c > UCHAR_MAX) + luaX_lexerror(ls, "escape sequence too large", TK_STRING); + save(ls, c); + } + continue; + } + } + save(ls, c); + next(ls); + continue; + } + default: + save_and_next(ls); + } + } + save_and_next(ls); /* skip delimiter */ + seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1, + luaZ_bufflen(ls->buff) - 2); +} + + +static int llex (LexState *ls, SemInfo *seminfo) { + luaZ_resetbuffer(ls->buff); + for (;;) { + switch (ls->current) { + case '\n': + case '\r': { + inclinenumber(ls); + continue; + } + case '-': { + next(ls); + if (ls->current != '-') return '-'; + /* else is a comment */ + next(ls); + if (ls->current == '[') { + int sep = skip_sep(ls); + luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */ + if (sep >= 0) { + read_long_string(ls, NULL, sep); /* long comment */ + luaZ_resetbuffer(ls->buff); + continue; + } + } + /* else short comment */ + while (!currIsNewline(ls) && ls->current != EOZ) + next(ls); + continue; + } + case '[': { + int sep = skip_sep(ls); + if (sep >= 0) { + read_long_string(ls, seminfo, sep); + return TK_STRING; + } + else if (sep == -1) return '['; + else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING); + } + case '=': { + next(ls); + if (ls->current != '=') return '='; + else { next(ls); return TK_EQ; } + } + case '<': { + next(ls); + if (ls->current != '=') return '<'; + else { next(ls); return TK_LE; } + } + case '>': { + next(ls); + if (ls->current != '=') return '>'; + else { next(ls); return TK_GE; } + } + case '~': { + next(ls); + if (ls->current != '=') return '~'; + else { next(ls); return TK_NE; } + } + case '"': + case '\'': { + read_string(ls, ls->current, seminfo); + return TK_STRING; + } + case '.': { + save_and_next(ls); + if (check_next(ls, ".")) { + if (check_next(ls, ".")) + return TK_DOTS; /* ... */ + else return TK_CONCAT; /* .. */ + } + else if (!isdigit(ls->current)) return '.'; + else { + read_numeral(ls, seminfo); + return TK_NUMBER; + } + } + case EOZ: { + return TK_EOS; + } + default: { + if (isspace(ls->current)) { + lua_assert(!currIsNewline(ls)); + next(ls); + continue; + } + else if (isdigit(ls->current)) { + read_numeral(ls, seminfo); + return TK_NUMBER; + } + else if (isalpha(ls->current) || ls->current == '_') { + /* identifier or reserved word */ + TString *ts; + do { + save_and_next(ls); + } while (isalnum(ls->current) || ls->current == '_'); + ts = luaX_newstring(ls, luaZ_buffer(ls->buff), + luaZ_bufflen(ls->buff)); + if (ts->tsv.reserved > 0) /* reserved word? */ + return ts->tsv.reserved - 1 + FIRST_RESERVED; + else { + seminfo->ts = ts; + return TK_NAME; + } + } + else { + int c = ls->current; + next(ls); + return c; /* single-char tokens (+ - / ...) */ + } + } + } + } +} + + +void luaX_next (LexState *ls) { + ls->lastline = ls->linenumber; + if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */ + ls->t = ls->lookahead; /* use this one */ + ls->lookahead.token = TK_EOS; /* and discharge it */ + } + else + ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */ +} + + +void luaX_lookahead (LexState *ls) { + lua_assert(ls->lookahead.token == TK_EOS); + ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); +} + diff --git a/script/lua/llex.h b/script/lua/llex.h new file mode 100644 index 000000000..a9201cee4 --- /dev/null +++ b/script/lua/llex.h @@ -0,0 +1,81 @@ +/* +** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lexical Analyzer +** See Copyright Notice in lua.h +*/ + +#ifndef llex_h +#define llex_h + +#include "lobject.h" +#include "lzio.h" + + +#define FIRST_RESERVED 257 + +/* maximum length of a reserved word */ +#define TOKEN_LEN (sizeof("function")/sizeof(char)) + + +/* +* WARNING: if you change the order of this enumeration, +* grep "ORDER RESERVED" +*/ +enum RESERVED { + /* terminal symbols denoted by reserved words */ + TK_AND = FIRST_RESERVED, TK_BREAK, + TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION, + TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, + TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, + /* other terminal symbols */ + TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER, + TK_NAME, TK_STRING, TK_EOS +}; + +/* number of reserved words */ +#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) + + +/* array with token `names' */ +LUAI_DATA const char *const luaX_tokens []; + + +typedef union { + lua_Number r; + TString *ts; +} SemInfo; /* semantics information */ + + +typedef struct Token { + int token; + SemInfo seminfo; +} Token; + + +typedef struct LexState { + int current; /* current character (charint) */ + int linenumber; /* input line counter */ + int lastline; /* line of last token `consumed' */ + Token t; /* current token */ + Token lookahead; /* look ahead token */ + struct FuncState *fs; /* `FuncState' is private to the parser */ + struct lua_State *L; + ZIO *z; /* input stream */ + Mbuffer *buff; /* buffer for tokens */ + TString *source; /* current source name */ + char decpoint; /* locale decimal point */ +} LexState; + + +LUAI_FUNC void luaX_init (lua_State *L); +LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, + TString *source); +LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); +LUAI_FUNC void luaX_next (LexState *ls); +LUAI_FUNC void luaX_lookahead (LexState *ls); +LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token); +LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s); +LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); + + +#endif diff --git a/script/lua/llimits.h b/script/lua/llimits.h new file mode 100644 index 000000000..5612e8a42 --- /dev/null +++ b/script/lua/llimits.h @@ -0,0 +1,128 @@ +/* +** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $ +** Limits, basic types, and some other `installation-dependent' definitions +** See Copyright Notice in lua.h +*/ + +#ifndef llimits_h +#define llimits_h + +#if 0 +#include +#include +#endif + +#include "lua.h" + + +typedef LUAI_UINT32 lu_int32; + +typedef LUAI_UMEM lu_mem; + +typedef LUAI_MEM l_mem; + + + +/* chars used as small naturals (so that `char' is reserved for characters) */ +typedef unsigned char lu_byte; + + +#define MAX_SIZET ((size_t)(~(size_t)0)-2) + +#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) + + +#define MAX_INT (int)(INT_MAX-2) /* maximum value of an int (-2 for safety) */ + +/* +** conversion of pointer to integer +** this is for hashing only; there is no problem if the integer +** cannot hold the whole pointer value +*/ +#define IntPoint(p) ((unsigned int)(lu_mem)(p)) + + + +/* type to ensure maximum alignment */ +typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; + + +/* result of a `usual argument conversion' over lua_Number */ +typedef LUAI_UACNUMBER l_uacNumber; + + +/* internal assertions for in-house debugging */ +#ifdef lua_assert + +#define check_exp(c,e) (lua_assert(c), (e)) +#define api_check(l,e) lua_assert(e) + +#else + +#define lua_assert(c) ((void)0) +#define check_exp(c,e) (e) +#define api_check luai_apicheck + +#endif + + +#ifndef UNUSED +#define UNUSED(x) ((void)(x)) /* to avoid warnings */ +#endif + + +#ifndef cast +#define cast(t, exp) ((t)(exp)) +#endif + +#define cast_byte(i) cast(lu_byte, (i)) +#define cast_num(i) cast(lua_Number, (i)) +#define cast_int(i) cast(int, (i)) + + + +/* +** type for virtual-machine instructions +** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) +*/ +typedef lu_int32 Instruction; + + + +/* maximum stack for a Lua function */ +#define MAXSTACK 250 + + + +/* minimum size for the string table (must be power of 2) */ +#ifndef MINSTRTABSIZE +#define MINSTRTABSIZE 32 +#endif + + +/* minimum size for string buffer */ +#ifndef LUA_MINBUFFER +#define LUA_MINBUFFER 32 +#endif + + +#ifndef lua_lock +#define lua_lock(L) ((void) 0) +#define lua_unlock(L) ((void) 0) +#endif + +#ifndef luai_threadyield +#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} +#endif + + +/* +** macro to control inclusion of some hard tests on stack reallocation +*/ +#ifndef HARDSTACKTESTS +#define condhardstacktests(x) ((void)0) +#else +#define condhardstacktests(x) x +#endif + +#endif diff --git a/script/lua/lmathlib.c b/script/lua/lmathlib.c new file mode 100644 index 000000000..441fbf736 --- /dev/null +++ b/script/lua/lmathlib.c @@ -0,0 +1,263 @@ +/* +** $Id: lmathlib.c,v 1.67.1.1 2007/12/27 13:02:25 roberto Exp $ +** Standard mathematical library +** See Copyright Notice in lua.h +*/ + + +#include +#include + +#define lmathlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +#undef PI +#define PI (3.14159265358979323846) +#define RADIANS_PER_DEGREE (PI/180.0) + + + +static int math_abs (lua_State *L) { + lua_pushnumber(L, fabs(luaL_checknumber(L, 1))); + return 1; +} + +static int math_sin (lua_State *L) { + lua_pushnumber(L, sin(luaL_checknumber(L, 1))); + return 1; +} + +static int math_sinh (lua_State *L) { + lua_pushnumber(L, sinh(luaL_checknumber(L, 1))); + return 1; +} + +static int math_cos (lua_State *L) { + lua_pushnumber(L, cos(luaL_checknumber(L, 1))); + return 1; +} + +static int math_cosh (lua_State *L) { + lua_pushnumber(L, cosh(luaL_checknumber(L, 1))); + return 1; +} + +static int math_tan (lua_State *L) { + lua_pushnumber(L, tan(luaL_checknumber(L, 1))); + return 1; +} + +static int math_tanh (lua_State *L) { + lua_pushnumber(L, tanh(luaL_checknumber(L, 1))); + return 1; +} + +static int math_asin (lua_State *L) { + lua_pushnumber(L, asin(luaL_checknumber(L, 1))); + return 1; +} + +static int math_acos (lua_State *L) { + lua_pushnumber(L, acos(luaL_checknumber(L, 1))); + return 1; +} + +static int math_atan (lua_State *L) { + lua_pushnumber(L, atan(luaL_checknumber(L, 1))); + return 1; +} + +static int math_atan2 (lua_State *L) { + lua_pushnumber(L, atan2(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); + return 1; +} + +static int math_ceil (lua_State *L) { + lua_pushnumber(L, ceil(luaL_checknumber(L, 1))); + return 1; +} + +static int math_floor (lua_State *L) { + lua_pushnumber(L, floor(luaL_checknumber(L, 1))); + return 1; +} + +static int math_fmod (lua_State *L) { + lua_pushnumber(L, fmod(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); + return 1; +} + +static int math_modf (lua_State *L) { + double ip; + double fp = modf(luaL_checknumber(L, 1), &ip); + lua_pushnumber(L, ip); + lua_pushnumber(L, fp); + return 2; +} + +static int math_sqrt (lua_State *L) { + lua_pushnumber(L, sqrt(luaL_checknumber(L, 1))); + return 1; +} + +static int math_pow (lua_State *L) { + lua_pushnumber(L, pow(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); + return 1; +} + +static int math_log (lua_State *L) { + lua_pushnumber(L, log(luaL_checknumber(L, 1))); + return 1; +} + +static int math_log10 (lua_State *L) { + lua_pushnumber(L, log10(luaL_checknumber(L, 1))); + return 1; +} + +static int math_exp (lua_State *L) { + lua_pushnumber(L, exp(luaL_checknumber(L, 1))); + return 1; +} + +static int math_deg (lua_State *L) { + lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); + return 1; +} + +static int math_rad (lua_State *L) { + lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); + return 1; +} + +static int math_frexp (lua_State *L) { + int e; + lua_pushnumber(L, frexp(luaL_checknumber(L, 1), &e)); + lua_pushinteger(L, e); + return 2; +} + +static int math_ldexp (lua_State *L) { + lua_pushnumber(L, ldexp(luaL_checknumber(L, 1), luaL_checkint(L, 2))); + return 1; +} + + + +static int math_min (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + lua_Number dmin = luaL_checknumber(L, 1); + int i; + for (i=2; i<=n; i++) { + lua_Number d = luaL_checknumber(L, i); + if (d < dmin) + dmin = d; + } + lua_pushnumber(L, dmin); + return 1; +} + + +static int math_max (lua_State *L) { + int n = lua_gettop(L); /* number of arguments */ + lua_Number dmax = luaL_checknumber(L, 1); + int i; + for (i=2; i<=n; i++) { + lua_Number d = luaL_checknumber(L, i); + if (d > dmax) + dmax = d; + } + lua_pushnumber(L, dmax); + return 1; +} + + +static int math_random (lua_State *L) { + /* the `%' avoids the (rare) case of r==1, and is needed also because on + some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ + lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; + switch (lua_gettop(L)) { /* check number of arguments */ + case 0: { /* no arguments */ + lua_pushnumber(L, r); /* Number between 0 and 1 */ + break; + } + case 1: { /* only upper limit */ + int u = luaL_checkint(L, 1); + luaL_argcheck(L, 1<=u, 1, "interval is empty"); + lua_pushnumber(L, floor(r*u)+1); /* int between 1 and `u' */ + break; + } + case 2: { /* lower and upper limits */ + int l = luaL_checkint(L, 1); + int u = luaL_checkint(L, 2); + luaL_argcheck(L, l<=u, 2, "interval is empty"); + lua_pushnumber(L, floor(r*(u-l+1))+l); /* int between `l' and `u' */ + break; + } + default: return luaL_error(L, "wrong number of arguments"); + } + return 1; +} + + +static int math_randomseed (lua_State *L) { + srand(luaL_checkint(L, 1)); + return 0; +} + + +static const luaL_Reg mathlib[] = { + {"abs", math_abs}, + {"acos", math_acos}, + {"asin", math_asin}, + {"atan2", math_atan2}, + {"atan", math_atan}, + {"ceil", math_ceil}, + {"cosh", math_cosh}, + {"cos", math_cos}, + {"deg", math_deg}, + {"exp", math_exp}, + {"floor", math_floor}, + {"fmod", math_fmod}, + {"frexp", math_frexp}, + {"ldexp", math_ldexp}, + {"log10", math_log10}, + {"log", math_log}, + {"max", math_max}, + {"min", math_min}, + {"modf", math_modf}, + {"pow", math_pow}, + {"rad", math_rad}, + {"random", math_random}, + {"randomseed", math_randomseed}, + {"sinh", math_sinh}, + {"sin", math_sin}, + {"sqrt", math_sqrt}, + {"tanh", math_tanh}, + {"tan", math_tan}, + {NULL, NULL} +}; + + +/* +** Open math library +*/ +LUALIB_API int luaopen_math (lua_State *L) { + luaL_register(L, LUA_MATHLIBNAME, mathlib); + lua_pushnumber(L, PI); + lua_setfield(L, -2, "pi"); + lua_pushnumber(L, HUGE_VAL); + lua_setfield(L, -2, "huge"); +#if defined(LUA_COMPAT_MOD) + lua_getfield(L, -1, "fmod"); + lua_setfield(L, -2, "mod"); +#endif + return 1; +} + diff --git a/script/lua/lmem.c b/script/lua/lmem.c new file mode 100644 index 000000000..ae7d8c965 --- /dev/null +++ b/script/lua/lmem.c @@ -0,0 +1,86 @@ +/* +** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $ +** Interface to Memory Manager +** See Copyright Notice in lua.h +*/ + + +#include + +#define lmem_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" + + + +/* +** About the realloc function: +** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); +** (`osize' is the old size, `nsize' is the new size) +** +** Lua ensures that (ptr == NULL) iff (osize == 0). +** +** * frealloc(ud, NULL, 0, x) creates a new block of size `x' +** +** * frealloc(ud, p, x, 0) frees the block `p' +** (in this specific case, frealloc must return NULL). +** particularly, frealloc(ud, NULL, 0, 0) does nothing +** (which is equivalent to free(NULL) in ANSI C) +** +** frealloc returns NULL if it cannot create or reallocate the area +** (any reallocation to an equal or smaller size cannot fail!) +*/ + + + +#define MINSIZEARRAY 4 + + +void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, + int limit, const char *errormsg) { + void *newblock; + int newsize; + if (*size >= limit/2) { /* cannot double it? */ + if (*size >= limit) /* cannot grow even a little? */ + luaG_runerror(L, errormsg); + newsize = limit; /* still have at least one free place */ + } + else { + newsize = (*size)*2; + if (newsize < MINSIZEARRAY) + newsize = MINSIZEARRAY; /* minimum size */ + } + newblock = luaM_reallocv(L, block, *size, newsize, size_elems); + *size = newsize; /* update only when everything else is OK */ + return newblock; +} + + +void *luaM_toobig (lua_State *L) { + luaG_runerror(L, "memory allocation error: block too big"); + return NULL; /* to avoid warnings */ +} + + + +/* +** generic allocation routine. +*/ +void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { + global_State *g = G(L); + lua_assert((osize == 0) == (block == NULL)); + block = (*g->frealloc)(g->ud, block, osize, nsize); + if (block == NULL && nsize > 0) + luaD_throw(L, LUA_ERRMEM); + lua_assert((nsize == 0) == (block == NULL)); + g->totalbytes = (g->totalbytes - osize) + nsize; + return block; +} + diff --git a/script/lua/lmem.h b/script/lua/lmem.h new file mode 100644 index 000000000..d33084d16 --- /dev/null +++ b/script/lua/lmem.h @@ -0,0 +1,50 @@ +/* +** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ +** Interface to Memory Manager +** See Copyright Notice in lua.h +*/ + +#ifndef lmem_h +#define lmem_h + +#if 0 +#include +#endif + +#include "llimits.h" +#include "lua.h" + +#define MEMERRMSG "not enough memory" + + +#define luaM_reallocv(L,b,on,n,e) \ + ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ + luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ + luaM_toobig(L)) + +#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) +#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) +#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) + +#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) +#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) +#define luaM_newvector(L,n,t) \ + cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) + +#define luaM_growvector(L,v,nelems,size,t,limit,e) \ + if ((nelems)+1 > (size)) \ + ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) + +#define luaM_reallocvector(L, v,oldn,n,t) \ + ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) + + +LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, + size_t size); +LUAI_FUNC void *luaM_toobig (lua_State *L); +LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, + size_t size_elem, int limit, + const char *errormsg); + +#endif + diff --git a/script/lua/loadlib.c b/script/lua/loadlib.c new file mode 100644 index 000000000..25e07d1bc --- /dev/null +++ b/script/lua/loadlib.c @@ -0,0 +1,665 @@ +/* +** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $ +** Dynamic library loader for Lua +** See Copyright Notice in lua.h +** +** This module contains an implementation of loadlib for Unix systems +** that have dlfcn, an implementation for Darwin (Mac OS X), an +** implementation for Windows, and a stub for other systems. +*/ + + +#include +#include + + +#define loadlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +/* prefix for open functions in C libraries */ +#define LUA_POF "luaopen_" + +/* separator for open functions in C libraries */ +#define LUA_OFSEP "_" + + +#define LIBPREFIX "LOADLIB: " + +#define POF LUA_POF +#define LIB_FAIL "open" + + +/* error codes for ll_loadfunc */ +#define ERRLIB 1 +#define ERRFUNC 2 + +#define setprogdir(L) ((void)0) + + +static void ll_unloadlib (void *lib); +static void *ll_load (lua_State *L, const char *path); +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); + + + +#if defined(LUA_DL_DLOPEN) +/* +** {======================================================================== +** This is an implementation of loadlib based on the dlfcn interface. +** The dlfcn interface is available in Linux, SunOS, Solaris, IRIX, FreeBSD, +** NetBSD, AIX 4.2, HPUX 11, and probably most other Unix flavors, at least +** as an emulation layer on top of native functions. +** ========================================================================= +*/ + +#include + +static void ll_unloadlib (void *lib) { + dlclose(lib); +} + + +static void *ll_load (lua_State *L, const char *path) { + void *lib = dlopen(path, RTLD_NOW); + if (lib == NULL) lua_pushstring(L, dlerror()); + return lib; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + lua_CFunction f = (lua_CFunction)dlsym(lib, sym); + if (f == NULL) lua_pushstring(L, dlerror()); + return f; +} + +/* }====================================================== */ + + + +#elif defined(LUA_DL_DLL) +/* +** {====================================================================== +** This is an implementation of loadlib for Windows using native functions. +** ======================================================================= +*/ + +#include + + +#undef setprogdir + +static void setprogdir (lua_State *L) { + char buff[MAX_PATH + 1]; + char *lb; + DWORD nsize = sizeof(buff)/sizeof(char); + DWORD n = GetModuleFileNameA(NULL, buff, nsize); + if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) + luaL_error(L, "unable to get ModuleFileName"); + else { + *lb = '\0'; + luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff); + lua_remove(L, -2); /* remove original string */ + } +} + + +static void pusherror (lua_State *L) { + int error = GetLastError(); + char buffer[128]; + if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, + NULL, error, 0, buffer, sizeof(buffer), NULL)) + lua_pushstring(L, buffer); + else + lua_pushfstring(L, "system error %d\n", error); +} + +static void ll_unloadlib (void *lib) { + FreeLibrary((HINSTANCE)lib); +} + + +static void *ll_load (lua_State *L, const char *path) { + HINSTANCE lib = LoadLibraryA(path); + if (lib == NULL) pusherror(L); + return lib; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym); + if (f == NULL) pusherror(L); + return f; +} + +/* }====================================================== */ + + + +#elif defined(LUA_DL_DYLD) +/* +** {====================================================================== +** Native Mac OS X / Darwin Implementation +** ======================================================================= +*/ + +#include + + +/* Mac appends a `_' before C function names */ +#undef POF +#define POF "_" LUA_POF + + +static void pusherror (lua_State *L) { + const char *err_str; + const char *err_file; + NSLinkEditErrors err; + int err_num; + NSLinkEditError(&err, &err_num, &err_file, &err_str); + lua_pushstring(L, err_str); +} + + +static const char *errorfromcode (NSObjectFileImageReturnCode ret) { + switch (ret) { + case NSObjectFileImageInappropriateFile: + return "file is not a bundle"; + case NSObjectFileImageArch: + return "library is for wrong CPU type"; + case NSObjectFileImageFormat: + return "bad format"; + case NSObjectFileImageAccess: + return "cannot access file"; + case NSObjectFileImageFailure: + default: + return "unable to load library"; + } +} + + +static void ll_unloadlib (void *lib) { + NSUnLinkModule((NSModule)lib, NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES); +} + + +static void *ll_load (lua_State *L, const char *path) { + NSObjectFileImage img; + NSObjectFileImageReturnCode ret; + /* this would be a rare case, but prevents crashing if it happens */ + if(!_dyld_present()) { + lua_pushliteral(L, "dyld not present"); + return NULL; + } + ret = NSCreateObjectFileImageFromFile(path, &img); + if (ret == NSObjectFileImageSuccess) { + NSModule mod = NSLinkModule(img, path, NSLINKMODULE_OPTION_PRIVATE | + NSLINKMODULE_OPTION_RETURN_ON_ERROR); + NSDestroyObjectFileImage(img); + if (mod == NULL) pusherror(L); + return mod; + } + lua_pushstring(L, errorfromcode(ret)); + return NULL; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + NSSymbol nss = NSLookupSymbolInModule((NSModule)lib, sym); + if (nss == NULL) { + lua_pushfstring(L, "symbol " LUA_QS " not found", sym); + return NULL; + } + return (lua_CFunction)NSAddressOfSymbol(nss); +} + +/* }====================================================== */ + + + +#else +/* +** {====================================================== +** Fallback for other systems +** ======================================================= +*/ + +#undef LIB_FAIL +#define LIB_FAIL "absent" + + +#define DLMSG "dynamic libraries not enabled; check your Lua installation" + + +static void ll_unloadlib (void *lib) { + (void)lib; /* to avoid warnings */ +} + + +static void *ll_load (lua_State *L, const char *path) { + (void)path; /* to avoid warnings */ + lua_pushliteral(L, DLMSG); + return NULL; +} + + +static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { + (void)lib; (void)sym; /* to avoid warnings */ + lua_pushliteral(L, DLMSG); + return NULL; +} + +/* }====================================================== */ +#endif + + + +static void **ll_register (lua_State *L, const char *path) { + void **plib; + lua_pushfstring(L, "%s%s", LIBPREFIX, path); + lua_gettable(L, LUA_REGISTRYINDEX); /* check library in registry? */ + if (!lua_isnil(L, -1)) /* is there an entry? */ + plib = (void **)lua_touserdata(L, -1); + else { /* no entry yet; create one */ + lua_pop(L, 1); + plib = (void **)lua_newuserdata(L, sizeof(const void *)); + *plib = NULL; + luaL_getmetatable(L, "_LOADLIB"); + lua_setmetatable(L, -2); + lua_pushfstring(L, "%s%s", LIBPREFIX, path); + lua_pushvalue(L, -2); + lua_settable(L, LUA_REGISTRYINDEX); + } + return plib; +} + + +/* +** __gc tag method: calls library's `ll_unloadlib' function with the lib +** handle +*/ +static int gctm (lua_State *L) { + void **lib = (void **)luaL_checkudata(L, 1, "_LOADLIB"); + if (*lib) ll_unloadlib(*lib); + *lib = NULL; /* mark library as closed */ + return 0; +} + + +static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { + void **reg = ll_register(L, path); + if (*reg == NULL) *reg = ll_load(L, path); + if (*reg == NULL) + return ERRLIB; /* unable to load library */ + else { + lua_CFunction f = ll_sym(L, *reg, sym); + if (f == NULL) + return ERRFUNC; /* unable to find function */ + lua_pushcfunction(L, f); + return 0; /* return function */ + } +} + + +static int ll_loadlib (lua_State *L) { + const char *path = luaL_checkstring(L, 1); + const char *init = luaL_checkstring(L, 2); + int stat = ll_loadfunc(L, path, init); + if (stat == 0) /* no errors? */ + return 1; /* return the loaded function */ + else { /* error; error message is on stack top */ + lua_pushnil(L); + lua_insert(L, -2); + lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); + return 3; /* return nil, error message, and where */ + } +} + + + +/* +** {====================================================== +** 'require' function +** ======================================================= +*/ + + +static int readable (const char *filename) { + FILE *f = fopen(filename, "r"); /* try to open file */ + if (f == NULL) return 0; /* open failed */ + fclose(f); + return 1; +} + + +static const char *pushnexttemplate (lua_State *L, const char *path) { + const char *l; + while (*path == *LUA_PATHSEP) path++; /* skip separators */ + if (*path == '\0') return NULL; /* no more templates */ + l = strchr(path, *LUA_PATHSEP); /* find next separator */ + if (l == NULL) l = path + strlen(path); + lua_pushlstring(L, path, l - path); /* template */ + return l; +} + + +static const char *findfile (lua_State *L, const char *name, + const char *pname) { + const char *path; + name = luaL_gsub(L, name, ".", LUA_DIRSEP); + lua_getfield(L, LUA_ENVIRONINDEX, pname); + path = lua_tostring(L, -1); + if (path == NULL) + luaL_error(L, LUA_QL("package.%s") " must be a string", pname); + lua_pushliteral(L, ""); /* error accumulator */ + while ((path = pushnexttemplate(L, path)) != NULL) { + const char *filename; + filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name); + lua_remove(L, -2); /* remove path template */ + if (readable(filename)) /* does file exist and is readable? */ + return filename; /* return that file name */ + lua_pushfstring(L, "\n\tno file " LUA_QS, filename); + lua_remove(L, -2); /* remove file name */ + lua_concat(L, 2); /* add entry to possible error message */ + } + return NULL; /* not found */ +} + + +static void loaderror (lua_State *L, const char *filename) { + luaL_error(L, "error loading module " LUA_QS " from file " LUA_QS ":\n\t%s", + lua_tostring(L, 1), filename, lua_tostring(L, -1)); +} + + +static int loader_Lua (lua_State *L) { + const char *filename; + const char *name = luaL_checkstring(L, 1); + filename = findfile(L, name, "path"); + if (filename == NULL) return 1; /* library not found in this path */ + if (luaL_loadfile(L, filename) != 0) + loaderror(L, filename); + return 1; /* library loaded successfully */ +} + + +static const char *mkfuncname (lua_State *L, const char *modname) { + const char *funcname; + const char *mark = strchr(modname, *LUA_IGMARK); + if (mark) modname = mark + 1; + funcname = luaL_gsub(L, modname, ".", LUA_OFSEP); + funcname = lua_pushfstring(L, POF"%s", funcname); + lua_remove(L, -2); /* remove 'gsub' result */ + return funcname; +} + + +static int loader_C (lua_State *L) { + const char *funcname; + const char *name = luaL_checkstring(L, 1); + const char *filename = findfile(L, name, "cpath"); + if (filename == NULL) return 1; /* library not found in this path */ + funcname = mkfuncname(L, name); + if (ll_loadfunc(L, filename, funcname) != 0) + loaderror(L, filename); + return 1; /* library loaded successfully */ +} + + +static int loader_Croot (lua_State *L) { + const char *funcname; + const char *filename; + const char *name = luaL_checkstring(L, 1); + const char *p = strchr(name, '.'); + int stat; + if (p == NULL) return 0; /* is root */ + lua_pushlstring(L, name, p - name); + filename = findfile(L, lua_tostring(L, -1), "cpath"); + if (filename == NULL) return 1; /* root not found */ + funcname = mkfuncname(L, name); + if ((stat = ll_loadfunc(L, filename, funcname)) != 0) { + if (stat != ERRFUNC) loaderror(L, filename); /* real error */ + lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, + name, filename); + return 1; /* function not found */ + } + return 1; +} + + +static int loader_preload (lua_State *L) { + const char *name = luaL_checkstring(L, 1); + lua_getfield(L, LUA_ENVIRONINDEX, "preload"); + if (!lua_istable(L, -1)) + luaL_error(L, LUA_QL("package.preload") " must be a table"); + lua_getfield(L, -1, name); + if (lua_isnil(L, -1)) /* not found? */ + lua_pushfstring(L, "\n\tno field package.preload['%s']", name); + return 1; +} + + +static const int sentinel_ = 0; +#define sentinel ((void *)&sentinel_) + + +static int ll_require (lua_State *L) { + const char *name = luaL_checkstring(L, 1); + int i; + lua_settop(L, 1); /* _LOADED table will be at index 2 */ + lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + lua_getfield(L, 2, name); + if (lua_toboolean(L, -1)) { /* is it there? */ + if (lua_touserdata(L, -1) == sentinel) /* check loops */ + luaL_error(L, "loop or previous error loading module " LUA_QS, name); + return 1; /* package is already loaded */ + } + /* else must load it; iterate over available loaders */ + lua_getfield(L, LUA_ENVIRONINDEX, "loaders"); + if (!lua_istable(L, -1)) + luaL_error(L, LUA_QL("package.loaders") " must be a table"); + lua_pushliteral(L, ""); /* error message accumulator */ + for (i=1; ; i++) { + lua_rawgeti(L, -2, i); /* get a loader */ + if (lua_isnil(L, -1)) + luaL_error(L, "module " LUA_QS " not found:%s", + name, lua_tostring(L, -2)); + lua_pushstring(L, name); + lua_call(L, 1, 1); /* call it */ + if (lua_isfunction(L, -1)) /* did it find module? */ + break; /* module loaded successfully */ + else if (lua_isstring(L, -1)) /* loader returned error message? */ + lua_concat(L, 2); /* accumulate it */ + else + lua_pop(L, 1); + } + lua_pushlightuserdata(L, sentinel); + lua_setfield(L, 2, name); /* _LOADED[name] = sentinel */ + lua_pushstring(L, name); /* pass name as argument to module */ + lua_call(L, 1, 1); /* run loaded module */ + if (!lua_isnil(L, -1)) /* non-nil return? */ + lua_setfield(L, 2, name); /* _LOADED[name] = returned value */ + lua_getfield(L, 2, name); + if (lua_touserdata(L, -1) == sentinel) { /* module did not set a value? */ + lua_pushboolean(L, 1); /* use true as result */ + lua_pushvalue(L, -1); /* extra copy to be returned */ + lua_setfield(L, 2, name); /* _LOADED[name] = true */ + } + return 1; +} + +/* }====================================================== */ + + + +/* +** {====================================================== +** 'module' function +** ======================================================= +*/ + + +static void setfenv (lua_State *L) { + lua_Debug ar; + if (lua_getstack(L, 1, &ar) == 0 || + lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ + lua_iscfunction(L, -1)) + luaL_error(L, LUA_QL("module") " not called from a Lua function"); + lua_pushvalue(L, -2); + lua_setfenv(L, -2); + lua_pop(L, 1); +} + + +static void dooptions (lua_State *L, int n) { + int i; + for (i = 2; i <= n; i++) { + lua_pushvalue(L, i); /* get option (a function) */ + lua_pushvalue(L, -2); /* module */ + lua_call(L, 1, 0); + } +} + + +static void modinit (lua_State *L, const char *modname) { + const char *dot; + lua_pushvalue(L, -1); + lua_setfield(L, -2, "_M"); /* module._M = module */ + lua_pushstring(L, modname); + lua_setfield(L, -2, "_NAME"); + dot = strrchr(modname, '.'); /* look for last dot in module name */ + if (dot == NULL) dot = modname; + else dot++; + /* set _PACKAGE as package name (full module name minus last part) */ + lua_pushlstring(L, modname, dot - modname); + lua_setfield(L, -2, "_PACKAGE"); +} + + +static int ll_module (lua_State *L) { + const char *modname = luaL_checkstring(L, 1); + int loaded = lua_gettop(L) + 1; /* index of _LOADED table */ + lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); + lua_getfield(L, loaded, modname); /* get _LOADED[modname] */ + if (!lua_istable(L, -1)) { /* not found? */ + lua_pop(L, 1); /* remove previous result */ + /* try global variable (and create one if it does not exist) */ + if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1) != NULL) + return luaL_error(L, "name conflict for module " LUA_QS, modname); + lua_pushvalue(L, -1); + lua_setfield(L, loaded, modname); /* _LOADED[modname] = new table */ + } + /* check whether table already has a _NAME field */ + lua_getfield(L, -1, "_NAME"); + if (!lua_isnil(L, -1)) /* is table an initialized module? */ + lua_pop(L, 1); + else { /* no; initialize it */ + lua_pop(L, 1); + modinit(L, modname); + } + lua_pushvalue(L, -1); + setfenv(L); + dooptions(L, loaded - 1); + return 0; +} + + +static int ll_seeall (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + if (!lua_getmetatable(L, 1)) { + lua_createtable(L, 0, 1); /* create new metatable */ + lua_pushvalue(L, -1); + lua_setmetatable(L, 1); + } + lua_pushvalue(L, LUA_GLOBALSINDEX); + lua_setfield(L, -2, "__index"); /* mt.__index = _G */ + return 0; +} + + +/* }====================================================== */ + + + +/* auxiliary mark (for internal use) */ +#define AUXMARK "\1" + +static void setpath (lua_State *L, const char *fieldname, const char *envname, + const char *def) { + const char *path = getenv(envname); + if (path == NULL) /* no environment variable? */ + lua_pushstring(L, def); /* use default */ + else { + /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */ + path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP, + LUA_PATHSEP AUXMARK LUA_PATHSEP); + luaL_gsub(L, path, AUXMARK, def); + lua_remove(L, -2); + } + setprogdir(L); + lua_setfield(L, -2, fieldname); +} + + +static const luaL_Reg pk_funcs[] = { + {"loadlib", ll_loadlib}, + {"seeall", ll_seeall}, + {NULL, NULL} +}; + + +static const luaL_Reg ll_funcs[] = { + {"module", ll_module}, + {"require", ll_require}, + {NULL, NULL} +}; + + +static const lua_CFunction loaders[] = + {loader_preload, loader_Lua, loader_C, loader_Croot, NULL}; + + +LUALIB_API int luaopen_package (lua_State *L) { + int i; + /* create new type _LOADLIB */ + luaL_newmetatable(L, "_LOADLIB"); + lua_pushcfunction(L, gctm); + lua_setfield(L, -2, "__gc"); + /* create `package' table */ + luaL_register(L, LUA_LOADLIBNAME, pk_funcs); +#if defined(LUA_COMPAT_LOADLIB) + lua_getfield(L, -1, "loadlib"); + lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); +#endif + lua_pushvalue(L, -1); + lua_replace(L, LUA_ENVIRONINDEX); + /* create `loaders' table */ + lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); + /* fill it with pre-defined loaders */ + for (i=0; loaders[i] != NULL; i++) { + lua_pushcfunction(L, loaders[i]); + lua_rawseti(L, -2, i+1); + } + lua_setfield(L, -2, "loaders"); /* put it in field `loaders' */ + setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */ + setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */ + /* store config information */ + lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" + LUA_EXECDIR "\n" LUA_IGMARK); + lua_setfield(L, -2, "config"); + /* set field `loaded' */ + luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2); + lua_setfield(L, -2, "loaded"); + /* set field `preload' */ + lua_newtable(L); + lua_setfield(L, -2, "preload"); + lua_pushvalue(L, LUA_GLOBALSINDEX); + luaL_register(L, NULL, ll_funcs); /* open lib into global table */ + lua_pop(L, 1); + return 1; /* return 'package' table */ +} diff --git a/script/lua/lobject.c b/script/lua/lobject.c new file mode 100644 index 000000000..1e181d284 --- /dev/null +++ b/script/lua/lobject.c @@ -0,0 +1,216 @@ +/* +** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $ +** Some generic functions over Lua objects +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#include +#include +#endif + +#define lobject_c +#define LUA_CORE + +#include "lua.h" + +#include "ldo.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "lvm.h" + + + +const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL}; + + +/* +** converts an integer to a "floating point byte", represented as +** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if +** eeeee != 0 and (xxx) otherwise. +*/ +int luaO_int2fb (unsigned int x) { + int e = 0; /* expoent */ + while (x >= 16) { + x = (x+1) >> 1; + e++; + } + if (x < 8) return x; + else return ((e+1) << 3) | (cast_int(x) - 8); +} + + +/* converts back */ +int luaO_fb2int (int x) { + int e = (x >> 3) & 31; + if (e == 0) return x; + else return ((x & 7)+8) << (e - 1); +} + + +int luaO_log2 (unsigned int x) { + static const lu_byte log_2[256] = { + 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, + 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, + 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 + }; + int l = -1; + while (x >= 256) { l += 8; x >>= 8; } + return l + log_2[x]; + +} + + +int luaO_rawequalObj (const TValue *t1, const TValue *t2) { + if (ttype(t1) != ttype(t2)) return 0; + else switch (ttype(t1)) { + case LUA_TNIL: + return 1; + case LUA_TNUMBER: + return luai_numeq(nvalue(t1), nvalue(t2)); + case LUA_TBOOLEAN: + return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ + case LUA_TLIGHTUSERDATA: + return pvalue(t1) == pvalue(t2); + default: + lua_assert(iscollectable(t1)); + return gcvalue(t1) == gcvalue(t2); + } +} + + +int luaO_str2d (const char *s, lua_Number *result) { + char *endptr; + *result = lua_str2number(s, &endptr); + if (endptr == s) return 0; /* conversion failed */ + if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */ + *result = cast_num(strtoul(s, &endptr, 16)); + if (*endptr == '\0') return 1; /* most common case */ + while (isspace(cast(unsigned char, *endptr))) endptr++; + if (*endptr != '\0') return 0; /* invalid trailing characters? */ + return 1; +} + + + +static void pushstr (lua_State *L, const char *str) { + setsvalue2s(L, L->top, luaS_new(L, str)); + incr_top(L); +} + + +/* this function handles only `%d', `%c', %f, %p, and `%s' formats */ +const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { + int n = 1; + pushstr(L, ""); + for (;;) { + const char *e = strchr(fmt, '%'); + if (e == NULL) break; + setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt)); + incr_top(L); + switch (*(e+1)) { + case 's': { + const char *s = va_arg(argp, char *); + if (s == NULL) s = "(null)"; + pushstr(L, s); + break; + } + case 'c': { + char buff[2]; + buff[0] = cast(char, va_arg(argp, int)); + buff[1] = '\0'; + pushstr(L, buff); + break; + } + case 'd': { + setnvalue(L->top, cast_num(va_arg(argp, int))); + incr_top(L); + break; + } + case 'f': { + setnvalue(L->top, cast_num(va_arg(argp, l_uacNumber))); + incr_top(L); + break; + } + case 'p': { + char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ + sprintf(buff, "%p", va_arg(argp, void *)); + pushstr(L, buff); + break; + } + case '%': { + pushstr(L, "%"); + break; + } + default: { + char buff[3]; + buff[0] = '%'; + buff[1] = *(e+1); + buff[2] = '\0'; + pushstr(L, buff); + break; + } + } + n += 2; + fmt = e+2; + } + pushstr(L, fmt); + luaV_concat(L, n+1, cast_int(L->top - L->base) - 1); + L->top -= n; + return svalue(L->top - 1); +} + + +const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { + const char *msg; + va_list argp; + va_start(argp, fmt); + msg = luaO_pushvfstring(L, fmt, argp); + va_end(argp); + return msg; +} + + +void luaO_chunkid (char *out, const char *source, size_t bufflen) { + if (*source == '=') { + strncpy(out, source+1, bufflen); /* remove first char */ + out[bufflen-1] = '\0'; /* ensures null termination */ + } + else { /* out = "source", or "...source" */ + if (*source == '@') { + size_t l; + source++; /* skip the `@' */ + bufflen -= sizeof(" '...' "); + l = strlen(source); + strcpy(out, ""); + if (l > bufflen) { + source += (l-bufflen); /* get last part of file name */ + strcat(out, "..."); + } + strcat(out, source); + } + else { /* out = [string "string"] */ + size_t len = strcspn(source, "\n\r"); /* stop at first newline */ + bufflen -= sizeof(" [string \"...\"] "); + if (len > bufflen) len = bufflen; + strcpy(out, "[string \""); + if (source[len] != '\0') { /* must truncate? */ + strncat(out, source, len); + strcat(out, "..."); + } + else + strcat(out, source); + strcat(out, "\"]"); + } + } +} diff --git a/script/lua/lobject.h b/script/lua/lobject.h new file mode 100644 index 000000000..6234d507c --- /dev/null +++ b/script/lua/lobject.h @@ -0,0 +1,380 @@ +/* +** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $ +** Type definitions for Lua objects +** See Copyright Notice in lua.h +*/ + + +#ifndef lobject_h +#define lobject_h + + +#include + + +#include "llimits.h" +#include "lua.h" + + +/* tags for values visible from Lua */ +#define LAST_TAG LUA_TTHREAD + +#define NUM_TAGS (LAST_TAG+1) + + +/* +** Extra tags for non-values +*/ +#define LUA_TPROTO (LAST_TAG+1) +#define LUA_TUPVAL (LAST_TAG+2) +#define LUA_TDEADKEY (LAST_TAG+3) + + +/* +** Union of all collectable objects +*/ +typedef union GCObject GCObject; + + +/* +** Common Header for all collectable objects (in macro form, to be +** included in other objects) +*/ +#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked + + +/* +** Common header in struct form +*/ +typedef struct GCheader { + CommonHeader; +} GCheader; + + + + +/* +** Union of all Lua values +*/ +typedef union { + GCObject *gc; + void *p; + lua_Number n; + int b; +} Value; + + +/* +** Tagged Values +*/ + +#define TValuefields Value value; int tt + +typedef struct lua_TValue { + TValuefields; +} TValue; + + +/* Macros to test type */ +#define ttisnil(o) (ttype(o) == LUA_TNIL) +#define ttisnumber(o) (ttype(o) == LUA_TNUMBER) +#define ttisstring(o) (ttype(o) == LUA_TSTRING) +#define ttistable(o) (ttype(o) == LUA_TTABLE) +#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION) +#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN) +#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA) +#define ttisthread(o) (ttype(o) == LUA_TTHREAD) +#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA) + +/* Macros to access values */ +#define ttype(o) ((o)->tt) +#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc) +#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p) +#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n) +#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts) +#define tsvalue(o) (&rawtsvalue(o)->tsv) +#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u) +#define uvalue(o) (&rawuvalue(o)->uv) +#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl) +#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h) +#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b) +#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th) + +#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0)) + +/* +** for internal debug only +*/ +#define checkconsistency(obj) \ + lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt)) + +#define checkliveness(g,obj) \ + lua_assert(!iscollectable(obj) || \ + ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc))) + + +/* Macros to set values */ +#define setnilvalue(obj) ((obj)->tt=LUA_TNIL) + +#define setnvalue(obj,x) \ + { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; } + +#define setpvalue(obj,x) \ + { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; } + +#define setbvalue(obj,x) \ + { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; } + +#define setsvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \ + checkliveness(G(L),i_o); } + +#define setuvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \ + checkliveness(G(L),i_o); } + +#define setthvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \ + checkliveness(G(L),i_o); } + +#define setclvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \ + checkliveness(G(L),i_o); } + +#define sethvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \ + checkliveness(G(L),i_o); } + +#define setptvalue(L,obj,x) \ + { TValue *i_o=(obj); \ + i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \ + checkliveness(G(L),i_o); } + + + + +#define setobj(L,obj1,obj2) \ + { const TValue *o2=(obj2); TValue *o1=(obj1); \ + o1->value = o2->value; o1->tt=o2->tt; \ + checkliveness(G(L),o1); } + + +/* +** different types of sets, according to destination +*/ + +/* from stack to (same) stack */ +#define setobjs2s setobj +/* to stack (not from same stack) */ +#define setobj2s setobj +#define setsvalue2s setsvalue +#define sethvalue2s sethvalue +#define setptvalue2s setptvalue +/* from table to same table */ +#define setobjt2t setobj +/* to table */ +#define setobj2t setobj +/* to new object */ +#define setobj2n setobj +#define setsvalue2n setsvalue + +#define setttype(obj, tt) (ttype(obj) = (tt)) + + +#define iscollectable(o) (ttype(o) >= LUA_TSTRING) + + + +typedef TValue *StkId; /* index to stack elements */ + + +/* +** String headers for string table +*/ +typedef union TString { + L_Umaxalign dummy; /* ensures maximum alignment for strings */ + struct { + CommonHeader; + lu_byte reserved; + unsigned int hash; + size_t len; + } tsv; +} TString; + + +#define getstr(ts) cast(const char *, (ts) + 1) +#define svalue(o) getstr(rawtsvalue(o)) + + + +typedef union Udata { + L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */ + struct { + CommonHeader; + struct Table *metatable; + struct Table *env; + size_t len; + } uv; +} Udata; + + + + +/* +** Function Prototypes +*/ +typedef struct Proto { + CommonHeader; + TValue *k; /* constants used by the function */ + Instruction *code; + struct Proto **p; /* functions defined inside the function */ + int *lineinfo; /* map from opcodes to source lines */ + struct LocVar *locvars; /* information about local variables */ + TString **upvalues; /* upvalue names */ + TString *source; + int sizeupvalues; + int sizek; /* size of `k' */ + int sizecode; + int sizelineinfo; + int sizep; /* size of `p' */ + int sizelocvars; + int linedefined; + int lastlinedefined; + GCObject *gclist; + lu_byte nups; /* number of upvalues */ + lu_byte numparams; + lu_byte is_vararg; + lu_byte maxstacksize; +} Proto; + + +/* masks for new-style vararg */ +#define VARARG_HASARG 1 +#define VARARG_ISVARARG 2 +#define VARARG_NEEDSARG 4 + + +typedef struct LocVar { + TString *varname; + int startpc; /* first point where variable is active */ + int endpc; /* first point where variable is dead */ +} LocVar; + + + +/* +** Upvalues +*/ + +typedef struct UpVal { + CommonHeader; + TValue *v; /* points to stack or to its own value */ + union { + TValue value; /* the value (when closed) */ + struct { /* double linked list (when open) */ + struct UpVal *prev; + struct UpVal *next; + } l; + } u; +} UpVal; + + +/* +** Closures +*/ + +#define ClosureHeader \ + CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \ + struct Table *env + +typedef struct CClosure { + ClosureHeader; + lua_CFunction f; + TValue upvalue[1]; +} CClosure; + + +typedef struct LClosure { + ClosureHeader; + struct Proto *p; + UpVal *upvals[1]; +} LClosure; + + +typedef union Closure { + CClosure c; + LClosure l; +} Closure; + + +#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC) +#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC) + + +/* +** Tables +*/ + +typedef union TKey { + struct { + TValuefields; + struct Node *next; /* for chaining */ + } nk; + TValue tvk; +} TKey; + + +typedef struct Node { + TValue i_val; + TKey i_key; +} Node; + + +typedef struct Table { + CommonHeader; + lu_byte flags; /* 1<

lsizenode)) + + +#define luaO_nilobject (&luaO_nilobject_) + +LUAI_DATA const TValue luaO_nilobject_; + +#define ceillog2(x) (luaO_log2((x)-1) + 1) + +LUAI_FUNC int luaO_log2 (unsigned int x); +LUAI_FUNC int luaO_int2fb (unsigned int x); +LUAI_FUNC int luaO_fb2int (int x); +LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); +LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result); +LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, + va_list argp); +LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); +LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len); + + +#endif diff --git a/script/lua/lopcodes.c b/script/lua/lopcodes.c new file mode 100644 index 000000000..4cc745230 --- /dev/null +++ b/script/lua/lopcodes.c @@ -0,0 +1,102 @@ +/* +** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ +** See Copyright Notice in lua.h +*/ + + +#define lopcodes_c +#define LUA_CORE + + +#include "lopcodes.h" + + +/* ORDER OP */ + +const char *const luaP_opnames[NUM_OPCODES+1] = { + "MOVE", + "LOADK", + "LOADBOOL", + "LOADNIL", + "GETUPVAL", + "GETGLOBAL", + "GETTABLE", + "SETGLOBAL", + "SETUPVAL", + "SETTABLE", + "NEWTABLE", + "SELF", + "ADD", + "SUB", + "MUL", + "DIV", + "MOD", + "POW", + "UNM", + "NOT", + "LEN", + "CONCAT", + "JMP", + "EQ", + "LT", + "LE", + "TEST", + "TESTSET", + "CALL", + "TAILCALL", + "RETURN", + "FORLOOP", + "FORPREP", + "TFORLOOP", + "SETLIST", + "CLOSE", + "CLOSURE", + "VARARG", + NULL +}; + + +#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) + +const lu_byte luaP_opmodes[NUM_OPCODES] = { +/* T A B C mode opcode */ + opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ + ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ + ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ + ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */ + ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ + ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */ + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ + ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ + ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ + ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ + ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ + ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ + ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ + ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ + ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */ + ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ + ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ + ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ + ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ + ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ + ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ + ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ + ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ + ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ + ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ +}; + diff --git a/script/lua/lopcodes.h b/script/lua/lopcodes.h new file mode 100644 index 000000000..ad66eea98 --- /dev/null +++ b/script/lua/lopcodes.h @@ -0,0 +1,268 @@ +/* +** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $ +** Opcodes for Lua virtual machine +** See Copyright Notice in lua.h +*/ + +#ifndef lopcodes_h +#define lopcodes_h + +#include "llimits.h" + + +/*=========================================================================== + We assume that instructions are unsigned numbers. + All instructions have an opcode in the first 6 bits. + Instructions can have the following fields: + `A' : 8 bits + `B' : 9 bits + `C' : 9 bits + `Bx' : 18 bits (`B' and `C' together) + `sBx' : signed Bx + + A signed argument is represented in excess K; that is, the number + value is the unsigned value minus K. K is exactly the maximum value + for that argument (so that -max is represented by 0, and +max is + represented by 2*max), which is half the maximum for the corresponding + unsigned argument. +===========================================================================*/ + + +enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ + + +/* +** size and position of opcode arguments. +*/ +#define SIZE_C 9 +#define SIZE_B 9 +#define SIZE_Bx (SIZE_C + SIZE_B) +#define SIZE_A 8 + +#define SIZE_OP 6 + +#define POS_OP 0 +#define POS_A (POS_OP + SIZE_OP) +#define POS_C (POS_A + SIZE_A) +#define POS_B (POS_C + SIZE_C) +#define POS_Bx POS_C + + +/* +** limits for opcode arguments. +** we use (signed) int to manipulate most arguments, +** so they must fit in LUAI_BITSINT-1 bits (-1 for sign) +*/ +#if SIZE_Bx < LUAI_BITSINT-1 +#define MAXARG_Bx ((1<>1) /* `sBx' is signed */ +#else +#define MAXARG_Bx MAX_INT +#define MAXARG_sBx MAX_INT +#endif + + +#define MAXARG_A ((1<>POS_OP) & MASK1(SIZE_OP,0))) +#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \ + ((cast(Instruction, o)<>POS_A) & MASK1(SIZE_A,0))) +#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ + ((cast(Instruction, u)<>POS_B) & MASK1(SIZE_B,0))) +#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \ + ((cast(Instruction, b)<>POS_C) & MASK1(SIZE_C,0))) +#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \ + ((cast(Instruction, b)<>POS_Bx) & MASK1(SIZE_Bx,0))) +#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \ + ((cast(Instruction, b)< C) then pc++ */ +OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ + +OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ +OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ +OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */ + +OP_FORLOOP,/* A sBx R(A)+=R(A+2); + if R(A) =) R(A)*/ +OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ + +OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ +} OpCode; + + +#define NUM_OPCODES (cast(int, OP_VARARG) + 1) + + + +/*=========================================================================== + Notes: + (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1, + and can be 0: OP_CALL then sets `top' to last_result+1, so + next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. + + (*) In OP_VARARG, if (B == 0) then use actual number of varargs and + set top (like in OP_CALL with C == 0). + + (*) In OP_RETURN, if (B == 0) then return up to `top' + + (*) In OP_SETLIST, if (B == 0) then B = `top'; + if (C == 0) then next `instruction' is real C + + (*) For comparisons, A specifies what condition the test should accept + (true or false). + + (*) All `skips' (pc++) assume that next instruction is a jump +===========================================================================*/ + + +/* +** masks for instruction properties. The format is: +** bits 0-1: op mode +** bits 2-3: C arg mode +** bits 4-5: B arg mode +** bit 6: instruction set register A +** bit 7: operator is a test +*/ + +enum OpArgMask { + OpArgN, /* argument is not used */ + OpArgU, /* argument is used */ + OpArgR, /* argument is a register or a jump offset */ + OpArgK /* argument is a constant or register/constant */ +}; + +LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES]; + +#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) +#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) +#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3)) +#define testAMode(m) (luaP_opmodes[m] & (1 << 6)) +#define testTMode(m) (luaP_opmodes[m] & (1 << 7)) + + +LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ + + +/* number of list items to accumulate before a SETLIST instruction */ +#define LFIELDS_PER_FLUSH 50 + + +#endif diff --git a/script/lua/loslib.c b/script/lua/loslib.c new file mode 100644 index 000000000..da06a572a --- /dev/null +++ b/script/lua/loslib.c @@ -0,0 +1,243 @@ +/* +** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $ +** Standard Operating System library +** See Copyright Notice in lua.h +*/ + + +#include +#include +#include +#include +#include + +#define loslib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +static int os_pushresult (lua_State *L, int i, const char *filename) { + int en = errno; /* calls to Lua API may change this value */ + if (i) { + lua_pushboolean(L, 1); + return 1; + } + else { + lua_pushnil(L); + lua_pushfstring(L, "%s: %s", filename, strerror(en)); + lua_pushinteger(L, en); + return 3; + } +} + + +static int os_execute (lua_State *L) { + lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); + return 1; +} + + +static int os_remove (lua_State *L) { + const char *filename = luaL_checkstring(L, 1); + return os_pushresult(L, remove(filename) == 0, filename); +} + + +static int os_rename (lua_State *L) { + const char *fromname = luaL_checkstring(L, 1); + const char *toname = luaL_checkstring(L, 2); + return os_pushresult(L, rename(fromname, toname) == 0, fromname); +} + + +static int os_tmpname (lua_State *L) { + char buff[LUA_TMPNAMBUFSIZE]; + int err; + lua_tmpnam(buff, err); + if (err) + return luaL_error(L, "unable to generate a unique filename"); + lua_pushstring(L, buff); + return 1; +} + + +static int os_getenv (lua_State *L) { + lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ + return 1; +} + + +static int os_clock (lua_State *L) { + lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC); + return 1; +} + + +/* +** {====================================================== +** Time/Date operations +** { year=%Y, month=%m, day=%d, hour=%H, min=%M, sec=%S, +** wday=%w+1, yday=%j, isdst=? } +** ======================================================= +*/ + +static void setfield (lua_State *L, const char *key, int value) { + lua_pushinteger(L, value); + lua_setfield(L, -2, key); +} + +static void setboolfield (lua_State *L, const char *key, int value) { + if (value < 0) /* undefined? */ + return; /* does not set field */ + lua_pushboolean(L, value); + lua_setfield(L, -2, key); +} + +static int getboolfield (lua_State *L, const char *key) { + int res; + lua_getfield(L, -1, key); + res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); + lua_pop(L, 1); + return res; +} + + +static int getfield (lua_State *L, const char *key, int d) { + int res; + lua_getfield(L, -1, key); + if (lua_isnumber(L, -1)) + res = (int)lua_tointeger(L, -1); + else { + if (d < 0) + return luaL_error(L, "field " LUA_QS " missing in date table", key); + res = d; + } + lua_pop(L, 1); + return res; +} + + +static int os_date (lua_State *L) { + const char *s = luaL_optstring(L, 1, "%c"); + time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL)); + struct tm *stm; + if (*s == '!') { /* UTC? */ + stm = gmtime(&t); + s++; /* skip `!' */ + } + else + stm = localtime(&t); + if (stm == NULL) /* invalid date? */ + lua_pushnil(L); + else if (strcmp(s, "*t") == 0) { + lua_createtable(L, 0, 9); /* 9 = number of fields */ + setfield(L, "sec", stm->tm_sec); + setfield(L, "min", stm->tm_min); + setfield(L, "hour", stm->tm_hour); + setfield(L, "day", stm->tm_mday); + setfield(L, "month", stm->tm_mon+1); + setfield(L, "year", stm->tm_year+1900); + setfield(L, "wday", stm->tm_wday+1); + setfield(L, "yday", stm->tm_yday+1); + setboolfield(L, "isdst", stm->tm_isdst); + } + else { + char cc[3]; + luaL_Buffer b; + cc[0] = '%'; cc[2] = '\0'; + luaL_buffinit(L, &b); + for (; *s; s++) { + if (*s != '%' || *(s + 1) == '\0') /* no conversion specifier? */ + luaL_addchar(&b, *s); + else { + size_t reslen; + char buff[200]; /* should be big enough for any conversion result */ + cc[1] = *(++s); + reslen = strftime(buff, sizeof(buff), cc, stm); + luaL_addlstring(&b, buff, reslen); + } + } + luaL_pushresult(&b); + } + return 1; +} + + +static int os_time (lua_State *L) { + time_t t; + if (lua_isnoneornil(L, 1)) /* called without args? */ + t = time(NULL); /* get current time */ + else { + struct tm ts; + luaL_checktype(L, 1, LUA_TTABLE); + lua_settop(L, 1); /* make sure table is at the top */ + ts.tm_sec = getfield(L, "sec", 0); + ts.tm_min = getfield(L, "min", 0); + ts.tm_hour = getfield(L, "hour", 12); + ts.tm_mday = getfield(L, "day", -1); + ts.tm_mon = getfield(L, "month", -1) - 1; + ts.tm_year = getfield(L, "year", -1) - 1900; + ts.tm_isdst = getboolfield(L, "isdst"); + t = mktime(&ts); + } + if (t == (time_t)(-1)) + lua_pushnil(L); + else + lua_pushnumber(L, (lua_Number)t); + return 1; +} + + +static int os_difftime (lua_State *L) { + lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), + (time_t)(luaL_optnumber(L, 2, 0)))); + return 1; +} + +/* }====================================================== */ + + +static int os_setlocale (lua_State *L) { + static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, + LC_NUMERIC, LC_TIME}; + static const char *const catnames[] = {"all", "collate", "ctype", "monetary", + "numeric", "time", NULL}; + const char *l = luaL_optstring(L, 1, NULL); + int op = luaL_checkoption(L, 2, "all", catnames); + lua_pushstring(L, setlocale(cat[op], l)); + return 1; +} + + +static int os_exit (lua_State *L) { + exit(luaL_optint(L, 1, EXIT_SUCCESS)); +} + +static const luaL_Reg syslib[] = { + {"clock", os_clock}, + {"date", os_date}, + {"difftime", os_difftime}, + {"execute", os_execute}, + {"exit", os_exit}, + {"getenv", os_getenv}, + {"remove", os_remove}, + {"rename", os_rename}, + {"setlocale", os_setlocale}, + {"time", os_time}, + {"tmpname", os_tmpname}, + {NULL, NULL} +}; + +/* }====================================================== */ + + + +LUALIB_API int luaopen_os (lua_State *L) { + luaL_register(L, LUA_OSLIBNAME, syslib); + return 1; +} + diff --git a/script/lua/lparser.c b/script/lua/lparser.c new file mode 100644 index 000000000..309f51891 --- /dev/null +++ b/script/lua/lparser.c @@ -0,0 +1,1340 @@ +/* +** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $ +** Lua Parser +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#endif + +#define lparser_c +#define LUA_CORE + +#include "lua.h" + +#include "lcode.h" +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "llex.h" +#include "lmem.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lparser.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" + + + +#define hasmultret(k) ((k) == VCALL || (k) == VVARARG) + +#define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]]) + +#define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) + + +/* +** nodes for block list (list of active blocks) +*/ +typedef struct BlockCnt { + struct BlockCnt *previous; /* chain */ + int breaklist; /* list of jumps out of this loop */ + lu_byte nactvar; /* # active locals outside the breakable structure */ + lu_byte upval; /* true if some variable in the block is an upvalue */ + lu_byte isbreakable; /* true if `block' is a loop */ +} BlockCnt; + + + +/* +** prototypes for recursive non-terminal functions +*/ +static void chunk (LexState *ls); +static void expr (LexState *ls, expdesc *v); + + +static void anchor_token (LexState *ls) { + if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) { + TString *ts = ls->t.seminfo.ts; + luaX_newstring(ls, getstr(ts), ts->tsv.len); + } +} + + +static void error_expected (LexState *ls, int token) { + luaX_syntaxerror(ls, + luaO_pushfstring(ls->L, LUA_QS " expected", luaX_token2str(ls, token))); +} + + +static void errorlimit (FuncState *fs, int limit, const char *what) { + const char *msg = (fs->f->linedefined == 0) ? + luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) : + luaO_pushfstring(fs->L, "function at line %d has more than %d %s", + fs->f->linedefined, limit, what); + luaX_lexerror(fs->ls, msg, 0); +} + + +static int testnext (LexState *ls, int c) { + if (ls->t.token == c) { + luaX_next(ls); + return 1; + } + else return 0; +} + + +static void check (LexState *ls, int c) { + if (ls->t.token != c) + error_expected(ls, c); +} + +static void checknext (LexState *ls, int c) { + check(ls, c); + luaX_next(ls); +} + + +#define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); } + + + +static void check_match (LexState *ls, int what, int who, int where) { + if (!testnext(ls, what)) { + if (where == ls->linenumber) + error_expected(ls, what); + else { + luaX_syntaxerror(ls, luaO_pushfstring(ls->L, + LUA_QS " expected (to close " LUA_QS " at line %d)", + luaX_token2str(ls, what), luaX_token2str(ls, who), where)); + } + } +} + + +static TString *str_checkname (LexState *ls) { + TString *ts; + check(ls, TK_NAME); + ts = ls->t.seminfo.ts; + luaX_next(ls); + return ts; +} + + +static void init_exp (expdesc *e, expkind k, int i) { + e->f = e->t = NO_JUMP; + e->k = k; + e->u.s.info = i; +} + + +static void codestring (LexState *ls, expdesc *e, TString *s) { + init_exp(e, VK, luaK_stringK(ls->fs, s)); +} + + +static void checkname(LexState *ls, expdesc *e) { + codestring(ls, e, str_checkname(ls)); +} + + +static int registerlocalvar (LexState *ls, TString *varname) { + FuncState *fs = ls->fs; + Proto *f = fs->f; + int oldsize = f->sizelocvars; + luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars, + LocVar, SHRT_MAX, "too many local variables"); + while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; + f->locvars[fs->nlocvars].varname = varname; + luaC_objbarrier(ls->L, f, varname); + return fs->nlocvars++; +} + + +#define new_localvarliteral(ls,v,n) \ + new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1), n) + + +static void new_localvar (LexState *ls, TString *name, int n) { + FuncState *fs = ls->fs; + luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables"); + fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name)); +} + + +static void adjustlocalvars (LexState *ls, int nvars) { + FuncState *fs = ls->fs; + fs->nactvar = cast_byte(fs->nactvar + nvars); + for (; nvars; nvars--) { + getlocvar(fs, fs->nactvar - nvars).startpc = fs->pc; + } +} + + +static void removevars (LexState *ls, int tolevel) { + FuncState *fs = ls->fs; + while (fs->nactvar > tolevel) + getlocvar(fs, --fs->nactvar).endpc = fs->pc; +} + + +static int indexupvalue (FuncState *fs, TString *name, expdesc *v) { + int i; + Proto *f = fs->f; + int oldsize = f->sizeupvalues; + for (i=0; inups; i++) { + if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) { + lua_assert(f->upvalues[i] == name); + return i; + } + } + /* new one */ + luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues"); + luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues, + TString *, MAX_INT, ""); + while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL; + f->upvalues[f->nups] = name; + luaC_objbarrier(fs->L, f, name); + lua_assert(v->k == VLOCAL || v->k == VUPVAL); + fs->upvalues[f->nups].k = cast_byte(v->k); + fs->upvalues[f->nups].info = cast_byte(v->u.s.info); + return f->nups++; +} + + +static int searchvar (FuncState *fs, TString *n) { + int i; + for (i=fs->nactvar-1; i >= 0; i--) { + if (n == getlocvar(fs, i).varname) + return i; + } + return -1; /* not found */ +} + + +static void markupval (FuncState *fs, int level) { + BlockCnt *bl = fs->bl; + while (bl && bl->nactvar > level) bl = bl->previous; + if (bl) bl->upval = 1; +} + + +static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) { + if (fs == NULL) { /* no more levels? */ + init_exp(var, VGLOBAL, NO_REG); /* default is global variable */ + return VGLOBAL; + } + else { + int v = searchvar(fs, n); /* look up at current level */ + if (v >= 0) { + init_exp(var, VLOCAL, v); + if (!base) + markupval(fs, v); /* local will be used as an upval */ + return VLOCAL; + } + else { /* not found at current level; try upper one */ + if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL) + return VGLOBAL; + var->u.s.info = indexupvalue(fs, n, var); /* else was LOCAL or UPVAL */ + var->k = VUPVAL; /* upvalue in this level */ + return VUPVAL; + } + } +} + + +static void singlevar (LexState *ls, expdesc *var) { + TString *varname = str_checkname(ls); + FuncState *fs = ls->fs; + if (singlevaraux(fs, varname, var, 1) == VGLOBAL) + var->u.s.info = luaK_stringK(fs, varname); /* info points to global name */ +} + + +static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { + FuncState *fs = ls->fs; + int extra = nvars - nexps; + if (hasmultret(e->k)) { + extra++; /* includes call itself */ + if (extra < 0) extra = 0; + luaK_setreturns(fs, e, extra); /* last exp. provides the difference */ + if (extra > 1) luaK_reserveregs(fs, extra-1); + } + else { + if (e->k != VVOID) luaK_exp2nextreg(fs, e); /* close last expression */ + if (extra > 0) { + int reg = fs->freereg; + luaK_reserveregs(fs, extra); + luaK_nil(fs, reg, extra); + } + } +} + + +static void enterlevel (LexState *ls) { + if (++ls->L->nCcalls > LUAI_MAXCCALLS) + luaX_lexerror(ls, "chunk has too many syntax levels", 0); +} + + +#define leavelevel(ls) ((ls)->L->nCcalls--) + + +static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) { + bl->breaklist = NO_JUMP; + bl->isbreakable = isbreakable; + bl->nactvar = fs->nactvar; + bl->upval = 0; + bl->previous = fs->bl; + fs->bl = bl; + lua_assert(fs->freereg == fs->nactvar); +} + + +static void leaveblock (FuncState *fs) { + BlockCnt *bl = fs->bl; + fs->bl = bl->previous; + removevars(fs->ls, bl->nactvar); + if (bl->upval) + luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); + /* a block either controls scope or breaks (never both) */ + lua_assert(!bl->isbreakable || !bl->upval); + lua_assert(bl->nactvar == fs->nactvar); + fs->freereg = fs->nactvar; /* free registers */ + luaK_patchtohere(fs, bl->breaklist); +} + + +static void pushclosure (LexState *ls, FuncState *func, expdesc *v) { + FuncState *fs = ls->fs; + Proto *f = fs->f; + int oldsize = f->sizep; + int i; + luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *, + MAXARG_Bx, "constant table overflow"); + while (oldsize < f->sizep) f->p[oldsize++] = NULL; + f->p[fs->np++] = func->f; + luaC_objbarrier(ls->L, f, func->f); + init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1)); + for (i=0; if->nups; i++) { + OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL; + luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0); + } +} + + +static void open_func (LexState *ls, FuncState *fs) { + lua_State *L = ls->L; + Proto *f = luaF_newproto(L); + fs->f = f; + fs->prev = ls->fs; /* linked list of funcstates */ + fs->ls = ls; + fs->L = L; + ls->fs = fs; + fs->pc = 0; + fs->lasttarget = -1; + fs->jpc = NO_JUMP; + fs->freereg = 0; + fs->nk = 0; + fs->np = 0; + fs->nlocvars = 0; + fs->nactvar = 0; + fs->bl = NULL; + f->source = ls->source; + f->maxstacksize = 2; /* registers 0/1 are always valid */ + fs->h = luaH_new(L, 0, 0); + /* anchor table of constants and prototype (to avoid being collected) */ + sethvalue2s(L, L->top, fs->h); + incr_top(L); + setptvalue2s(L, L->top, f); + incr_top(L); +} + + +static void close_func (LexState *ls) { + lua_State *L = ls->L; + FuncState *fs = ls->fs; + Proto *f = fs->f; + removevars(ls, 0); + luaK_ret(fs, 0, 0); /* final return */ + luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); + f->sizecode = fs->pc; + luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); + f->sizelineinfo = fs->pc; + luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); + f->sizek = fs->nk; + luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); + f->sizep = fs->np; + luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); + f->sizelocvars = fs->nlocvars; + luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); + f->sizeupvalues = f->nups; + lua_assert(luaG_checkcode(f)); + lua_assert(fs->bl == NULL); + ls->fs = fs->prev; + L->top -= 2; /* remove table and prototype from the stack */ + /* last token read was anchored in defunct function; must reanchor it */ + if (fs) anchor_token(ls); +} + + +Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { + struct LexState lexstate; + struct FuncState funcstate; + lexstate.buff = buff; + luaX_setinput(L, &lexstate, z, luaS_new(L, name)); + open_func(&lexstate, &funcstate); + funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */ + luaX_next(&lexstate); /* read first token */ + chunk(&lexstate); + check(&lexstate, TK_EOS); + close_func(&lexstate); + lua_assert(funcstate.prev == NULL); + lua_assert(funcstate.f->nups == 0); + lua_assert(lexstate.fs == NULL); + return funcstate.f; +} + + + +/*============================================================*/ +/* GRAMMAR RULES */ +/*============================================================*/ + + +static void field (LexState *ls, expdesc *v) { + /* field -> ['.' | ':'] NAME */ + FuncState *fs = ls->fs; + expdesc key; + luaK_exp2anyreg(fs, v); + luaX_next(ls); /* skip the dot or colon */ + checkname(ls, &key); + luaK_indexed(fs, v, &key); +} + + +static void yindex (LexState *ls, expdesc *v) { + /* index -> '[' expr ']' */ + luaX_next(ls); /* skip the '[' */ + expr(ls, v); + luaK_exp2val(ls->fs, v); + checknext(ls, ']'); +} + + +/* +** {====================================================================== +** Rules for Constructors +** ======================================================================= +*/ + + +struct ConsControl { + expdesc v; /* last list item read */ + expdesc *t; /* table descriptor */ + int nh; /* total number of `record' elements */ + int na; /* total number of array elements */ + int tostore; /* number of array elements pending to be stored */ +}; + + +static void recfield (LexState *ls, struct ConsControl *cc) { + /* recfield -> (NAME | `['exp1`]') = exp1 */ + FuncState *fs = ls->fs; + int reg = ls->fs->freereg; + expdesc key, val; + int rkkey; + if (ls->t.token == TK_NAME) { + luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); + checkname(ls, &key); + } + else /* ls->t.token == '[' */ + yindex(ls, &key); + cc->nh++; + checknext(ls, '='); + rkkey = luaK_exp2RK(fs, &key); + expr(ls, &val); + luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val)); + fs->freereg = reg; /* free registers */ +} + + +static void closelistfield (FuncState *fs, struct ConsControl *cc) { + if (cc->v.k == VVOID) return; /* there is no list item */ + luaK_exp2nextreg(fs, &cc->v); + cc->v.k = VVOID; + if (cc->tostore == LFIELDS_PER_FLUSH) { + luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); /* flush */ + cc->tostore = 0; /* no more items pending */ + } +} + + +static void lastlistfield (FuncState *fs, struct ConsControl *cc) { + if (cc->tostore == 0) return; + if (hasmultret(cc->v.k)) { + luaK_setmultret(fs, &cc->v); + luaK_setlist(fs, cc->t->u.s.info, cc->na, LUA_MULTRET); + cc->na--; /* do not count last expression (unknown number of elements) */ + } + else { + if (cc->v.k != VVOID) + luaK_exp2nextreg(fs, &cc->v); + luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); + } +} + + +static void listfield (LexState *ls, struct ConsControl *cc) { + expr(ls, &cc->v); + luaY_checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor"); + cc->na++; + cc->tostore++; +} + + +static void constructor (LexState *ls, expdesc *t) { + /* constructor -> ?? */ + FuncState *fs = ls->fs; + int line = ls->linenumber; + int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0); + struct ConsControl cc; + cc.na = cc.nh = cc.tostore = 0; + cc.t = t; + init_exp(t, VRELOCABLE, pc); + init_exp(&cc.v, VVOID, 0); /* no value (yet) */ + luaK_exp2nextreg(ls->fs, t); /* fix it at stack top (for gc) */ + checknext(ls, '{'); + do { + lua_assert(cc.v.k == VVOID || cc.tostore > 0); + if (ls->t.token == '}') break; + closelistfield(fs, &cc); + switch(ls->t.token) { + case TK_NAME: { /* may be listfields or recfields */ + luaX_lookahead(ls); + if (ls->lookahead.token != '=') /* expression? */ + listfield(ls, &cc); + else + recfield(ls, &cc); + break; + } + case '[': { /* constructor_item -> recfield */ + recfield(ls, &cc); + break; + } + default: { /* constructor_part -> listfield */ + listfield(ls, &cc); + break; + } + } + } while (testnext(ls, ',') || testnext(ls, ';')); + check_match(ls, '}', '{', line); + lastlistfield(fs, &cc); + SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */ + SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh)); /* set initial table size */ +} + +/* }====================================================================== */ + + + +static void parlist (LexState *ls) { + /* parlist -> [ param { `,' param } ] */ + FuncState *fs = ls->fs; + Proto *f = fs->f; + int nparams = 0; + f->is_vararg = 0; + if (ls->t.token != ')') { /* is `parlist' not empty? */ + do { + switch (ls->t.token) { + case TK_NAME: { /* param -> NAME */ + new_localvar(ls, str_checkname(ls), nparams++); + break; + } + case TK_DOTS: { /* param -> `...' */ + luaX_next(ls); +#if defined(LUA_COMPAT_VARARG) + /* use `arg' as default name */ + new_localvarliteral(ls, "arg", nparams++); + f->is_vararg = VARARG_HASARG | VARARG_NEEDSARG; +#endif + f->is_vararg |= VARARG_ISVARARG; + break; + } + default: luaX_syntaxerror(ls, " or " LUA_QL("...") " expected"); + } + } while (!f->is_vararg && testnext(ls, ',')); + } + adjustlocalvars(ls, nparams); + f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG)); + luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */ +} + + +static void body (LexState *ls, expdesc *e, int needself, int line) { + /* body -> `(' parlist `)' chunk END */ + FuncState new_fs; + open_func(ls, &new_fs); + new_fs.f->linedefined = line; + checknext(ls, '('); + if (needself) { + new_localvarliteral(ls, "self", 0); + adjustlocalvars(ls, 1); + } + parlist(ls); + checknext(ls, ')'); + chunk(ls); + new_fs.f->lastlinedefined = ls->linenumber; + check_match(ls, TK_END, TK_FUNCTION, line); + close_func(ls); + pushclosure(ls, &new_fs, e); +} + + +static int explist1 (LexState *ls, expdesc *v) { + /* explist1 -> expr { `,' expr } */ + int n = 1; /* at least one expression */ + expr(ls, v); + while (testnext(ls, ',')) { + luaK_exp2nextreg(ls->fs, v); + expr(ls, v); + n++; + } + return n; +} + + +static void funcargs (LexState *ls, expdesc *f) { + FuncState *fs = ls->fs; + expdesc args; + int base, nparams; + int line = ls->linenumber; + switch (ls->t.token) { + case '(': { /* funcargs -> `(' [ explist1 ] `)' */ + if (line != ls->lastline) + luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)"); + luaX_next(ls); + if (ls->t.token == ')') /* arg list is empty? */ + args.k = VVOID; + else { + explist1(ls, &args); + luaK_setmultret(fs, &args); + } + check_match(ls, ')', '(', line); + break; + } + case '{': { /* funcargs -> constructor */ + constructor(ls, &args); + break; + } + case TK_STRING: { /* funcargs -> STRING */ + codestring(ls, &args, ls->t.seminfo.ts); + luaX_next(ls); /* must use `seminfo' before `next' */ + break; + } + default: { + luaX_syntaxerror(ls, "function arguments expected"); + return; + } + } + lua_assert(f->k == VNONRELOC); + base = f->u.s.info; /* base register for call */ + if (hasmultret(args.k)) + nparams = LUA_MULTRET; /* open call */ + else { + if (args.k != VVOID) + luaK_exp2nextreg(fs, &args); /* close last argument */ + nparams = fs->freereg - (base+1); + } + init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); + luaK_fixline(fs, line); + fs->freereg = base+1; /* call remove function and arguments and leaves + (unless changed) one result */ +} + + + + +/* +** {====================================================================== +** Expression parsing +** ======================================================================= +*/ + + +static void prefixexp (LexState *ls, expdesc *v) { + /* prefixexp -> NAME | '(' expr ')' */ + switch (ls->t.token) { + case '(': { + int line = ls->linenumber; + luaX_next(ls); + expr(ls, v); + check_match(ls, ')', '(', line); + luaK_dischargevars(ls->fs, v); + return; + } + case TK_NAME: { + singlevar(ls, v); + return; + } + default: { + luaX_syntaxerror(ls, "unexpected symbol"); + return; + } + } +} + + +static void primaryexp (LexState *ls, expdesc *v) { + /* primaryexp -> + prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */ + FuncState *fs = ls->fs; + prefixexp(ls, v); + for (;;) { + switch (ls->t.token) { + case '.': { /* field */ + field(ls, v); + break; + } + case '[': { /* `[' exp1 `]' */ + expdesc key; + luaK_exp2anyreg(fs, v); + yindex(ls, &key); + luaK_indexed(fs, v, &key); + break; + } + case ':': { /* `:' NAME funcargs */ + expdesc key; + luaX_next(ls); + checkname(ls, &key); + luaK_self(fs, v, &key); + funcargs(ls, v); + break; + } + case '(': case TK_STRING: case '{': { /* funcargs */ + luaK_exp2nextreg(fs, v); + funcargs(ls, v); + break; + } + default: return; + } + } +} + + +static void simpleexp (LexState *ls, expdesc *v) { + /* simpleexp -> NUMBER | STRING | NIL | true | false | ... | + constructor | FUNCTION body | primaryexp */ + switch (ls->t.token) { + case TK_NUMBER: { + init_exp(v, VKNUM, 0); + v->u.nval = ls->t.seminfo.r; + break; + } + case TK_STRING: { + codestring(ls, v, ls->t.seminfo.ts); + break; + } + case TK_NIL: { + init_exp(v, VNIL, 0); + break; + } + case TK_TRUE: { + init_exp(v, VTRUE, 0); + break; + } + case TK_FALSE: { + init_exp(v, VFALSE, 0); + break; + } + case TK_DOTS: { /* vararg */ + FuncState *fs = ls->fs; + check_condition(ls, fs->f->is_vararg, + "cannot use " LUA_QL("...") " outside a vararg function"); + fs->f->is_vararg &= ~VARARG_NEEDSARG; /* don't need 'arg' */ + init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); + break; + } + case '{': { /* constructor */ + constructor(ls, v); + return; + } + case TK_FUNCTION: { + luaX_next(ls); + body(ls, v, 0, ls->linenumber); + return; + } + default: { + primaryexp(ls, v); + return; + } + } + luaX_next(ls); +} + + +static UnOpr getunopr (int op) { + switch (op) { + case TK_NOT: return OPR_NOT; + case '-': return OPR_MINUS; + case '#': return OPR_LEN; + default: return OPR_NOUNOPR; + } +} + + +static BinOpr getbinopr (int op) { + switch (op) { + case '+': return OPR_ADD; + case '-': return OPR_SUB; + case '*': return OPR_MUL; + case '/': return OPR_DIV; + case '%': return OPR_MOD; + case '^': return OPR_POW; + case TK_CONCAT: return OPR_CONCAT; + case TK_NE: return OPR_NE; + case TK_EQ: return OPR_EQ; + case '<': return OPR_LT; + case TK_LE: return OPR_LE; + case '>': return OPR_GT; + case TK_GE: return OPR_GE; + case TK_AND: return OPR_AND; + case TK_OR: return OPR_OR; + default: return OPR_NOBINOPR; + } +} + + +static const struct { + lu_byte left; /* left priority for each binary operator */ + lu_byte right; /* right priority */ +} priority[] = { /* ORDER OPR */ + {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `/' `%' */ + {10, 9}, {5, 4}, /* power and concat (right associative) */ + {3, 3}, {3, 3}, /* equality and inequality */ + {3, 3}, {3, 3}, {3, 3}, {3, 3}, /* order */ + {2, 2}, {1, 1} /* logical (and/or) */ +}; + +#define UNARY_PRIORITY 8 /* priority for unary operators */ + + +/* +** subexpr -> (simpleexp | unop subexpr) { binop subexpr } +** where `binop' is any binary operator with a priority higher than `limit' +*/ +static BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) { + BinOpr op; + UnOpr uop; + enterlevel(ls); + uop = getunopr(ls->t.token); + if (uop != OPR_NOUNOPR) { + luaX_next(ls); + subexpr(ls, v, UNARY_PRIORITY); + luaK_prefix(ls->fs, uop, v); + } + else simpleexp(ls, v); + /* expand while operators have priorities higher than `limit' */ + op = getbinopr(ls->t.token); + while (op != OPR_NOBINOPR && priority[op].left > limit) { + expdesc v2; + BinOpr nextop; + luaX_next(ls); + luaK_infix(ls->fs, op, v); + /* read sub-expression with higher priority */ + nextop = subexpr(ls, &v2, priority[op].right); + luaK_posfix(ls->fs, op, v, &v2); + op = nextop; + } + leavelevel(ls); + return op; /* return first untreated operator */ +} + + +static void expr (LexState *ls, expdesc *v) { + subexpr(ls, v, 0); +} + +/* }==================================================================== */ + + + +/* +** {====================================================================== +** Rules for Statements +** ======================================================================= +*/ + + +static int block_follow (int token) { + switch (token) { + case TK_ELSE: case TK_ELSEIF: case TK_END: + case TK_UNTIL: case TK_EOS: + return 1; + default: return 0; + } +} + + +static void block (LexState *ls) { + /* block -> chunk */ + FuncState *fs = ls->fs; + BlockCnt bl; + enterblock(fs, &bl, 0); + chunk(ls); + lua_assert(bl.breaklist == NO_JUMP); + leaveblock(fs); +} + + +/* +** structure to chain all variables in the left-hand side of an +** assignment +*/ +struct LHS_assign { + struct LHS_assign *prev; + expdesc v; /* variable (global, local, upvalue, or indexed) */ +}; + + +/* +** check whether, in an assignment to a local variable, the local variable +** is needed in a previous assignment (to a table). If so, save original +** local value in a safe place and use this safe copy in the previous +** assignment. +*/ +static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) { + FuncState *fs = ls->fs; + int extra = fs->freereg; /* eventual position to save local variable */ + int conflict = 0; + for (; lh; lh = lh->prev) { + if (lh->v.k == VINDEXED) { + if (lh->v.u.s.info == v->u.s.info) { /* conflict? */ + conflict = 1; + lh->v.u.s.info = extra; /* previous assignment will use safe copy */ + } + if (lh->v.u.s.aux == v->u.s.info) { /* conflict? */ + conflict = 1; + lh->v.u.s.aux = extra; /* previous assignment will use safe copy */ + } + } + } + if (conflict) { + luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0); /* make copy */ + luaK_reserveregs(fs, 1); + } +} + + +static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { + expdesc e; + check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED, + "syntax error"); + if (testnext(ls, ',')) { /* assignment -> `,' primaryexp assignment */ + struct LHS_assign nv; + nv.prev = lh; + primaryexp(ls, &nv.v); + if (nv.v.k == VLOCAL) + check_conflict(ls, lh, &nv.v); + luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls, + "variables in assignment"); + assignment(ls, &nv, nvars+1); + } + else { /* assignment -> `=' explist1 */ + int nexps; + checknext(ls, '='); + nexps = explist1(ls, &e); + if (nexps != nvars) { + adjust_assign(ls, nvars, nexps, &e); + if (nexps > nvars) + ls->fs->freereg -= nexps - nvars; /* remove extra values */ + } + else { + luaK_setoneret(ls->fs, &e); /* close last expression */ + luaK_storevar(ls->fs, &lh->v, &e); + return; /* avoid default */ + } + } + init_exp(&e, VNONRELOC, ls->fs->freereg-1); /* default assignment */ + luaK_storevar(ls->fs, &lh->v, &e); +} + + +static int cond (LexState *ls) { + /* cond -> exp */ + expdesc v; + expr(ls, &v); /* read condition */ + if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ + luaK_goiftrue(ls->fs, &v); + return v.f; +} + + +static void breakstat (LexState *ls) { + FuncState *fs = ls->fs; + BlockCnt *bl = fs->bl; + int upval = 0; + while (bl && !bl->isbreakable) { + upval |= bl->upval; + bl = bl->previous; + } + if (!bl) + luaX_syntaxerror(ls, "no loop to break"); + if (upval) + luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); + luaK_concat(fs, &bl->breaklist, luaK_jump(fs)); +} + + +static void whilestat (LexState *ls, int line) { + /* whilestat -> WHILE cond DO block END */ + FuncState *fs = ls->fs; + int whileinit; + int condexit; + BlockCnt bl; + luaX_next(ls); /* skip WHILE */ + whileinit = luaK_getlabel(fs); + condexit = cond(ls); + enterblock(fs, &bl, 1); + checknext(ls, TK_DO); + block(ls); + luaK_patchlist(fs, luaK_jump(fs), whileinit); + check_match(ls, TK_END, TK_WHILE, line); + leaveblock(fs); + luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ +} + + +static void repeatstat (LexState *ls, int line) { + /* repeatstat -> REPEAT block UNTIL cond */ + int condexit; + FuncState *fs = ls->fs; + int repeat_init = luaK_getlabel(fs); + BlockCnt bl1, bl2; + enterblock(fs, &bl1, 1); /* loop block */ + enterblock(fs, &bl2, 0); /* scope block */ + luaX_next(ls); /* skip REPEAT */ + chunk(ls); + check_match(ls, TK_UNTIL, TK_REPEAT, line); + condexit = cond(ls); /* read condition (inside scope block) */ + if (!bl2.upval) { /* no upvalues? */ + leaveblock(fs); /* finish scope */ + luaK_patchlist(ls->fs, condexit, repeat_init); /* close the loop */ + } + else { /* complete semantics when there are upvalues */ + breakstat(ls); /* if condition then break */ + luaK_patchtohere(ls->fs, condexit); /* else... */ + leaveblock(fs); /* finish scope... */ + luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init); /* and repeat */ + } + leaveblock(fs); /* finish loop */ +} + + +static int exp1 (LexState *ls) { + expdesc e; + int k; + expr(ls, &e); + k = e.k; + luaK_exp2nextreg(ls->fs, &e); + return k; +} + + +static void forbody (LexState *ls, int base, int line, int nvars, int isnum) { + /* forbody -> DO block */ + BlockCnt bl; + FuncState *fs = ls->fs; + int prep, endfor; + adjustlocalvars(ls, 3); /* control variables */ + checknext(ls, TK_DO); + prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs); + enterblock(fs, &bl, 0); /* scope for declared variables */ + adjustlocalvars(ls, nvars); + luaK_reserveregs(fs, nvars); + block(ls); + leaveblock(fs); /* end of scope for declared variables */ + luaK_patchtohere(fs, prep); + endfor = (isnum) ? luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP) : + luaK_codeABC(fs, OP_TFORLOOP, base, 0, nvars); + luaK_fixline(fs, line); /* pretend that `OP_FOR' starts the loop */ + luaK_patchlist(fs, (isnum ? endfor : luaK_jump(fs)), prep + 1); +} + + +static void fornum (LexState *ls, TString *varname, int line) { + /* fornum -> NAME = exp1,exp1[,exp1] forbody */ + FuncState *fs = ls->fs; + int base = fs->freereg; + new_localvarliteral(ls, "(for index)", 0); + new_localvarliteral(ls, "(for limit)", 1); + new_localvarliteral(ls, "(for step)", 2); + new_localvar(ls, varname, 3); + checknext(ls, '='); + exp1(ls); /* initial value */ + checknext(ls, ','); + exp1(ls); /* limit */ + if (testnext(ls, ',')) + exp1(ls); /* optional step */ + else { /* default step = 1 */ + luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1)); + luaK_reserveregs(fs, 1); + } + forbody(ls, base, line, 1, 1); +} + + +static void forlist (LexState *ls, TString *indexname) { + /* forlist -> NAME {,NAME} IN explist1 forbody */ + FuncState *fs = ls->fs; + expdesc e; + int nvars = 0; + int line; + int base = fs->freereg; + /* create control variables */ + new_localvarliteral(ls, "(for generator)", nvars++); + new_localvarliteral(ls, "(for state)", nvars++); + new_localvarliteral(ls, "(for control)", nvars++); + /* create declared variables */ + new_localvar(ls, indexname, nvars++); + while (testnext(ls, ',')) + new_localvar(ls, str_checkname(ls), nvars++); + checknext(ls, TK_IN); + line = ls->linenumber; + adjust_assign(ls, 3, explist1(ls, &e), &e); + luaK_checkstack(fs, 3); /* extra space to call generator */ + forbody(ls, base, line, nvars - 3, 0); +} + + +static void forstat (LexState *ls, int line) { + /* forstat -> FOR (fornum | forlist) END */ + FuncState *fs = ls->fs; + TString *varname; + BlockCnt bl; + enterblock(fs, &bl, 1); /* scope for loop and control variables */ + luaX_next(ls); /* skip `for' */ + varname = str_checkname(ls); /* first variable name */ + switch (ls->t.token) { + case '=': fornum(ls, varname, line); break; + case ',': case TK_IN: forlist(ls, varname); break; + default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected"); + } + check_match(ls, TK_END, TK_FOR, line); + leaveblock(fs); /* loop scope (`break' jumps to this point) */ +} + + +static int test_then_block (LexState *ls) { + /* test_then_block -> [IF | ELSEIF] cond THEN block */ + int condexit; + luaX_next(ls); /* skip IF or ELSEIF */ + condexit = cond(ls); + checknext(ls, TK_THEN); + block(ls); /* `then' part */ + return condexit; +} + + +static void ifstat (LexState *ls, int line) { + /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ + FuncState *fs = ls->fs; + int flist; + int escapelist = NO_JUMP; + flist = test_then_block(ls); /* IF cond THEN block */ + while (ls->t.token == TK_ELSEIF) { + luaK_concat(fs, &escapelist, luaK_jump(fs)); + luaK_patchtohere(fs, flist); + flist = test_then_block(ls); /* ELSEIF cond THEN block */ + } + if (ls->t.token == TK_ELSE) { + luaK_concat(fs, &escapelist, luaK_jump(fs)); + luaK_patchtohere(fs, flist); + luaX_next(ls); /* skip ELSE (after patch, for correct line info) */ + block(ls); /* `else' part */ + } + else + luaK_concat(fs, &escapelist, flist); + luaK_patchtohere(fs, escapelist); + check_match(ls, TK_END, TK_IF, line); +} + + +static void localfunc (LexState *ls) { + expdesc v, b; + FuncState *fs = ls->fs; + new_localvar(ls, str_checkname(ls), 0); + init_exp(&v, VLOCAL, fs->freereg); + luaK_reserveregs(fs, 1); + adjustlocalvars(ls, 1); + body(ls, &b, 0, ls->linenumber); + luaK_storevar(fs, &v, &b); + /* debug information will only see the variable after this point! */ + getlocvar(fs, fs->nactvar - 1).startpc = fs->pc; +} + + +static void localstat (LexState *ls) { + /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */ + int nvars = 0; + int nexps; + expdesc e; + do { + new_localvar(ls, str_checkname(ls), nvars++); + } while (testnext(ls, ',')); + if (testnext(ls, '=')) + nexps = explist1(ls, &e); + else { + e.k = VVOID; + nexps = 0; + } + adjust_assign(ls, nvars, nexps, &e); + adjustlocalvars(ls, nvars); +} + + +static int funcname (LexState *ls, expdesc *v) { + /* funcname -> NAME {field} [`:' NAME] */ + int needself = 0; + singlevar(ls, v); + while (ls->t.token == '.') + field(ls, v); + if (ls->t.token == ':') { + needself = 1; + field(ls, v); + } + return needself; +} + + +static void funcstat (LexState *ls, int line) { + /* funcstat -> FUNCTION funcname body */ + int needself; + expdesc v, b; + luaX_next(ls); /* skip FUNCTION */ + needself = funcname(ls, &v); + body(ls, &b, needself, line); + luaK_storevar(ls->fs, &v, &b); + luaK_fixline(ls->fs, line); /* definition `happens' in the first line */ +} + + +static void exprstat (LexState *ls) { + /* stat -> func | assignment */ + FuncState *fs = ls->fs; + struct LHS_assign v; + primaryexp(ls, &v.v); + if (v.v.k == VCALL) /* stat -> func */ + SETARG_C(getcode(fs, &v.v), 1); /* call statement uses no results */ + else { /* stat -> assignment */ + v.prev = NULL; + assignment(ls, &v, 1); + } +} + + +static void retstat (LexState *ls) { + /* stat -> RETURN explist */ + FuncState *fs = ls->fs; + expdesc e; + int first, nret; /* registers with returned values */ + luaX_next(ls); /* skip RETURN */ + if (block_follow(ls->t.token) || ls->t.token == ';') + first = nret = 0; /* return no values */ + else { + nret = explist1(ls, &e); /* optional return values */ + if (hasmultret(e.k)) { + luaK_setmultret(fs, &e); + if (e.k == VCALL && nret == 1) { /* tail call? */ + SET_OPCODE(getcode(fs,&e), OP_TAILCALL); + lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar); + } + first = fs->nactvar; + nret = LUA_MULTRET; /* return all values */ + } + else { + if (nret == 1) /* only one single value? */ + first = luaK_exp2anyreg(fs, &e); + else { + luaK_exp2nextreg(fs, &e); /* values must go to the `stack' */ + first = fs->nactvar; /* return all `active' values */ + lua_assert(nret == fs->freereg - first); + } + } + } + luaK_ret(fs, first, nret); +} + + +static int statement (LexState *ls) { + int line = ls->linenumber; /* may be needed for error messages */ + switch (ls->t.token) { + case TK_IF: { /* stat -> ifstat */ + ifstat(ls, line); + return 0; + } + case TK_WHILE: { /* stat -> whilestat */ + whilestat(ls, line); + return 0; + } + case TK_DO: { /* stat -> DO block END */ + luaX_next(ls); /* skip DO */ + block(ls); + check_match(ls, TK_END, TK_DO, line); + return 0; + } + case TK_FOR: { /* stat -> forstat */ + forstat(ls, line); + return 0; + } + case TK_REPEAT: { /* stat -> repeatstat */ + repeatstat(ls, line); + return 0; + } + case TK_FUNCTION: { + funcstat(ls, line); /* stat -> funcstat */ + return 0; + } + case TK_LOCAL: { /* stat -> localstat */ + luaX_next(ls); /* skip LOCAL */ + if (testnext(ls, TK_FUNCTION)) /* local function? */ + localfunc(ls); + else + localstat(ls); + return 0; + } + case TK_RETURN: { /* stat -> retstat */ + retstat(ls); + return 1; /* must be last statement */ + } + case TK_BREAK: { /* stat -> breakstat */ + luaX_next(ls); /* skip BREAK */ + breakstat(ls); + return 1; /* must be last statement */ + } + default: { + exprstat(ls); + return 0; /* to avoid warnings */ + } + } +} + + +static void chunk (LexState *ls) { + /* chunk -> { stat [`;'] } */ + int islast = 0; + enterlevel(ls); + while (!islast && !block_follow(ls->t.token)) { + islast = statement(ls); + testnext(ls, ';'); + lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg && + ls->fs->freereg >= ls->fs->nactvar); + ls->fs->freereg = ls->fs->nactvar; /* free registers */ + } + leavelevel(ls); +} + +/* }====================================================================== */ diff --git a/script/lua/lparser.h b/script/lua/lparser.h new file mode 100644 index 000000000..18836afd1 --- /dev/null +++ b/script/lua/lparser.h @@ -0,0 +1,82 @@ +/* +** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua Parser +** See Copyright Notice in lua.h +*/ + +#ifndef lparser_h +#define lparser_h + +#include "llimits.h" +#include "lobject.h" +#include "lzio.h" + + +/* +** Expression descriptor +*/ + +typedef enum { + VVOID, /* no value */ + VNIL, + VTRUE, + VFALSE, + VK, /* info = index of constant in `k' */ + VKNUM, /* nval = numerical value */ + VLOCAL, /* info = local register */ + VUPVAL, /* info = index of upvalue in `upvalues' */ + VGLOBAL, /* info = index of table; aux = index of global name in `k' */ + VINDEXED, /* info = table register; aux = index register (or `k') */ + VJMP, /* info = instruction pc */ + VRELOCABLE, /* info = instruction pc */ + VNONRELOC, /* info = result register */ + VCALL, /* info = instruction pc */ + VVARARG /* info = instruction pc */ +} expkind; + +typedef struct expdesc { + expkind k; + union { + struct { int info, aux; } s; + lua_Number nval; + } u; + int t; /* patch list of `exit when true' */ + int f; /* patch list of `exit when false' */ +} expdesc; + + +typedef struct upvaldesc { + lu_byte k; + lu_byte info; +} upvaldesc; + + +struct BlockCnt; /* defined in lparser.c */ + + +/* state needed to generate code for a given function */ +typedef struct FuncState { + Proto *f; /* current function header */ + Table *h; /* table to find (and reuse) elements in `k' */ + struct FuncState *prev; /* enclosing function */ + struct LexState *ls; /* lexical state */ + struct lua_State *L; /* copy of the Lua state */ + struct BlockCnt *bl; /* chain of current blocks */ + int pc; /* next position to code (equivalent to `ncode') */ + int lasttarget; /* `pc' of last `jump target' */ + int jpc; /* list of pending jumps to `pc' */ + int freereg; /* first free register */ + int nk; /* number of elements in `k' */ + int np; /* number of elements in `p' */ + short nlocvars; /* number of elements in `locvars' */ + lu_byte nactvar; /* number of active local variables */ + upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */ + unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */ +} FuncState; + + +LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, + const char *name); + + +#endif diff --git a/script/lua/lstate.c b/script/lua/lstate.c new file mode 100644 index 000000000..0c1b97f19 --- /dev/null +++ b/script/lua/lstate.c @@ -0,0 +1,213 @@ +/* +** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $ +** Global State +** See Copyright Notice in lua.h +*/ + + +#include + +#define lstate_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "llex.h" +#include "lmem.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" + + +#define state_size(x) (sizeof(x) + LUAI_EXTRASPACE) +#define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE) +#define tostate(l) (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE)) + + +/* +** Main thread combines a thread state and the global state +*/ +typedef struct LG { + lua_State l; + global_State g; +} LG; + + + +static void stack_init (lua_State *L1, lua_State *L) { + /* initialize CallInfo array */ + L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo); + L1->ci = L1->base_ci; + L1->size_ci = BASIC_CI_SIZE; + L1->end_ci = L1->base_ci + L1->size_ci - 1; + /* initialize stack array */ + L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue); + L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK; + L1->top = L1->stack; + L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1; + /* initialize first ci */ + L1->ci->func = L1->top; + setnilvalue(L1->top++); /* `function' entry for this `ci' */ + L1->base = L1->ci->base = L1->top; + L1->ci->top = L1->top + LUA_MINSTACK; +} + + +static void freestack (lua_State *L, lua_State *L1) { + luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo); + luaM_freearray(L, L1->stack, L1->stacksize, TValue); +} + + +/* +** open parts that may cause memory-allocation errors +*/ +static void f_luaopen (lua_State *L, void *ud) { + global_State *g = G(L); + UNUSED(ud); + stack_init(L, L); /* init stack */ + sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */ + sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */ + luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ + luaT_init(L); + luaX_init(L); + luaS_fix(luaS_newliteral(L, MEMERRMSG)); + g->GCthreshold = 4*g->totalbytes; +} + + +static void preinit_state (lua_State *L, global_State *g) { + G(L) = g; + L->stack = NULL; + L->stacksize = 0; + L->errorJmp = NULL; + L->hook = NULL; + L->hookmask = 0; + L->basehookcount = 0; + L->allowhook = 1; + resethookcount(L); + L->openupval = NULL; + L->size_ci = 0; + L->nCcalls = L->baseCcalls = 0; + L->status = 0; + L->base_ci = L->ci = NULL; + L->savedpc = NULL; + L->errfunc = 0; + setnilvalue(gt(L)); +} + + +static void close_state (lua_State *L) { + global_State *g = G(L); + luaF_close(L, L->stack); /* close all upvalues for this thread */ + luaC_freeall(L); /* collect all objects */ + lua_assert(g->rootgc == obj2gco(L)); + lua_assert(g->strt.nuse == 0); + luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); + luaZ_freebuffer(L, &g->buff); + freestack(L, L); + lua_assert(g->totalbytes == sizeof(LG)); + (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); +} + + +lua_State *luaE_newthread (lua_State *L) { + lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); + luaC_link(L, obj2gco(L1), LUA_TTHREAD); + preinit_state(L1, G(L)); + stack_init(L1, L); /* init stack */ + setobj2n(L, gt(L1), gt(L)); /* share table of globals */ + L1->hookmask = L->hookmask; + L1->basehookcount = L->basehookcount; + L1->hook = L->hook; + resethookcount(L1); + lua_assert(iswhite(obj2gco(L1))); + return L1; +} + + +void luaE_freethread (lua_State *L, lua_State *L1) { + luaF_close(L1, L1->stack); /* close all upvalues for this thread */ + lua_assert(L1->openupval == NULL); + luai_userstatefree(L1); + freestack(L, L1); + luaM_freemem(L, fromstate(L1), state_size(lua_State)); +} + + +LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { + int i; + lua_State *L; + global_State *g; + void *l = (*f)(ud, NULL, 0, state_size(LG)); + if (l == NULL) return NULL; + L = tostate(l); + g = &((LG *)L)->g; + L->next = NULL; + L->tt = LUA_TTHREAD; + g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); + L->marked = luaC_white(g); + set2bits(L->marked, FIXEDBIT, SFIXEDBIT); + preinit_state(L, g); + g->frealloc = f; + g->ud = ud; + g->mainthread = L; + g->uvhead.u.l.prev = &g->uvhead; + g->uvhead.u.l.next = &g->uvhead; + g->GCthreshold = 0; /* mark it as unfinished state */ + g->strt.size = 0; + g->strt.nuse = 0; + g->strt.hash = NULL; + setnilvalue(registry(L)); + luaZ_initbuffer(L, &g->buff); + g->panic = NULL; + g->gcstate = GCSpause; + g->rootgc = obj2gco(L); + g->sweepstrgc = 0; + g->sweepgc = &g->rootgc; + g->gray = NULL; + g->grayagain = NULL; + g->weak = NULL; + g->tmudata = NULL; + g->totalbytes = sizeof(LG); + g->gcpause = LUAI_GCPAUSE; + g->gcstepmul = LUAI_GCMUL; + g->gcdept = 0; + for (i=0; imt[i] = NULL; + if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { + /* memory allocation error: free partial state */ + close_state(L); + L = NULL; + } + else + luai_userstateopen(L); + return L; +} + + +static void callallgcTM (lua_State *L, void *ud) { + UNUSED(ud); + luaC_callGCTM(L); /* call GC metamethods for all udata */ +} + + +LUA_API void lua_close (lua_State *L) { + L = G(L)->mainthread; /* only the main thread can be closed */ + lua_lock(L); + luaF_close(L, L->stack); /* close all upvalues for this thread */ + luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ + L->errfunc = 0; /* no error function during GC metamethods */ + do { /* repeat until no more errors */ + L->ci = L->base_ci; + L->base = L->top = L->ci->base; + L->nCcalls = L->baseCcalls = 0; + } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); + lua_assert(G(L)->tmudata == NULL); + luai_userstateclose(L); + close_state(L); +} diff --git a/script/lua/lstate.h b/script/lua/lstate.h new file mode 100644 index 000000000..3bc575b6b --- /dev/null +++ b/script/lua/lstate.h @@ -0,0 +1,169 @@ +/* +** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $ +** Global State +** See Copyright Notice in lua.h +*/ + +#ifndef lstate_h +#define lstate_h + +#include "lua.h" + +#include "lobject.h" +#include "ltm.h" +#include "lzio.h" + + + +struct lua_longjmp; /* defined in ldo.c */ + + +/* table of globals */ +#define gt(L) (&L->l_gt) + +/* registry */ +#define registry(L) (&G(L)->l_registry) + + +/* extra stack space to handle TM calls and some other extras */ +#define EXTRA_STACK 5 + + +#define BASIC_CI_SIZE 8 + +#define BASIC_STACK_SIZE (2*LUA_MINSTACK) + + + +typedef struct stringtable { + GCObject **hash; + lu_int32 nuse; /* number of elements */ + int size; +} stringtable; + + +/* +** informations about a call +*/ +typedef struct CallInfo { + StkId base; /* base for this function */ + StkId func; /* function index in the stack */ + StkId top; /* top for this function */ + const Instruction *savedpc; + int nresults; /* expected number of results from this function */ + int tailcalls; /* number of tail calls lost under this entry */ +} CallInfo; + + + +#define curr_func(L) (clvalue(L->ci->func)) +#define ci_func(ci) (clvalue((ci)->func)) +#define f_isLua(ci) (!ci_func(ci)->c.isC) +#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci)) + + +/* +** `global state', shared by all threads of this state +*/ +typedef struct global_State { + stringtable strt; /* hash table for strings */ + lua_Alloc frealloc; /* function to reallocate memory */ + void *ud; /* auxiliary data to `frealloc' */ + lu_byte currentwhite; + lu_byte gcstate; /* state of garbage collector */ + int sweepstrgc; /* position of sweep in `strt' */ + GCObject *rootgc; /* list of all collectable objects */ + GCObject **sweepgc; /* position of sweep in `rootgc' */ + GCObject *gray; /* list of gray objects */ + GCObject *grayagain; /* list of objects to be traversed atomically */ + GCObject *weak; /* list of weak tables (to be cleared) */ + GCObject *tmudata; /* last element of list of userdata to be GC */ + Mbuffer buff; /* temporary buffer for string concatentation */ + lu_mem GCthreshold; + lu_mem totalbytes; /* number of bytes currently allocated */ + lu_mem estimate; /* an estimate of number of bytes actually in use */ + lu_mem gcdept; /* how much GC is `behind schedule' */ + int gcpause; /* size of pause between successive GCs */ + int gcstepmul; /* GC `granularity' */ + lua_CFunction panic; /* to be called in unprotected errors */ + TValue l_registry; + struct lua_State *mainthread; + UpVal uvhead; /* head of double-linked list of all open upvalues */ + struct Table *mt[NUM_TAGS]; /* metatables for basic types */ + TString *tmname[TM_N]; /* array with tag-method names */ +} global_State; + + +/* +** `per thread' state +*/ +struct lua_State { + CommonHeader; + lu_byte status; + StkId top; /* first free slot in the stack */ + StkId base; /* base of current function */ + global_State *l_G; + CallInfo *ci; /* call info for current function */ + const Instruction *savedpc; /* `savedpc' of current function */ + StkId stack_last; /* last free slot in the stack */ + StkId stack; /* stack base */ + CallInfo *end_ci; /* points after end of ci array*/ + CallInfo *base_ci; /* array of CallInfo's */ + int stacksize; + int size_ci; /* size of array `base_ci' */ + unsigned short nCcalls; /* number of nested C calls */ + unsigned short baseCcalls; /* nested C calls when resuming coroutine */ + lu_byte hookmask; + lu_byte allowhook; + int basehookcount; + int hookcount; + lua_Hook hook; + TValue l_gt; /* table of globals */ + TValue env; /* temporary place for environments */ + GCObject *openupval; /* list of open upvalues in this stack */ + GCObject *gclist; + struct lua_longjmp *errorJmp; /* current error recover point */ + ptrdiff_t errfunc; /* current error handling function (stack index) */ +}; + + +#define G(L) (L->l_G) + + +/* +** Union of all collectable objects +*/ +union GCObject { + GCheader gch; + union TString ts; + union Udata u; + union Closure cl; + struct Table h; + struct Proto p; + struct UpVal uv; + struct lua_State th; /* thread */ +}; + + +/* macros to convert a GCObject into a specific value */ +#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts)) +#define gco2ts(o) (&rawgco2ts(o)->tsv) +#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u)) +#define gco2u(o) (&rawgco2u(o)->uv) +#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl)) +#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h)) +#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p)) +#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) +#define ngcotouv(o) \ + check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv)) +#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th)) + +/* macro to convert any Lua object into a GCObject */ +#define obj2gco(v) (cast(GCObject *, (v))) + + +LUAI_FUNC lua_State *luaE_newthread (lua_State *L); +LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); + +#endif + diff --git a/script/lua/lstring.c b/script/lua/lstring.c new file mode 100644 index 000000000..bfdf1908a --- /dev/null +++ b/script/lua/lstring.c @@ -0,0 +1,112 @@ +/* +** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ +** String table (keeps all strings handled by Lua) +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#endif + +#define lstring_c +#define LUA_CORE + +#include "lua.h" + +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" + + + +void luaS_resize (lua_State *L, int newsize) { + GCObject **newhash; + stringtable *tb; + int i; + if (G(L)->gcstate == GCSsweepstring) + return; /* cannot resize during GC traverse */ + newhash = luaM_newvector(L, newsize, GCObject *); + tb = &G(L)->strt; + for (i=0; isize; i++) { + GCObject *p = tb->hash[i]; + while (p) { /* for each node in the list */ + GCObject *next = p->gch.next; /* save next */ + unsigned int h = gco2ts(p)->hash; + int h1 = lmod(h, newsize); /* new position */ + lua_assert(cast_int(h%newsize) == lmod(h, newsize)); + p->gch.next = newhash[h1]; /* chain it */ + newhash[h1] = p; + p = next; + } + } + luaM_freearray(L, tb->hash, tb->size, TString *); + tb->size = newsize; + tb->hash = newhash; +} + + +static TString *newlstr (lua_State *L, const char *str, size_t l, + unsigned int h) { + TString *ts; + stringtable *tb; + if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) + luaM_toobig(L); + ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString))); + ts->tsv.len = l; + ts->tsv.hash = h; + ts->tsv.marked = luaC_white(G(L)); + ts->tsv.tt = LUA_TSTRING; + ts->tsv.reserved = 0; + memcpy(ts+1, str, l*sizeof(char)); + ((char *)(ts+1))[l] = '\0'; /* ending 0 */ + tb = &G(L)->strt; + h = lmod(h, tb->size); + ts->tsv.next = tb->hash[h]; /* chain new entry */ + tb->hash[h] = obj2gco(ts); + tb->nuse++; + if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) + luaS_resize(L, tb->size*2); /* too crowded */ + return ts; +} + + +TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { + GCObject *o; + unsigned int h = cast(unsigned int, l); /* seed */ + size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ + size_t l1; + for (l1=l; l1>=step; l1-=step) /* compute hash */ + h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1])); + for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)]; + o != NULL; + o = o->gch.next) { + TString *ts = rawgco2ts(o); + if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { + /* string may be dead */ + if (isdead(G(L), o)) changewhite(o); + return ts; + } + } + return newlstr(L, str, l, h); /* not found */ +} + + +Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { + Udata *u; + if (s > MAX_SIZET - sizeof(Udata)) + luaM_toobig(L); + u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata))); + u->uv.marked = luaC_white(G(L)); /* is not finalized */ + u->uv.tt = LUA_TUSERDATA; + u->uv.len = s; + u->uv.metatable = NULL; + u->uv.env = e; + /* chain it on udata list (after main thread) */ + u->uv.next = G(L)->mainthread->next; + G(L)->mainthread->next = obj2gco(u); + return u; +} + diff --git a/script/lua/lstring.h b/script/lua/lstring.h new file mode 100644 index 000000000..73a2ff8b3 --- /dev/null +++ b/script/lua/lstring.h @@ -0,0 +1,31 @@ +/* +** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $ +** String table (keep all strings handled by Lua) +** See Copyright Notice in lua.h +*/ + +#ifndef lstring_h +#define lstring_h + + +#include "lgc.h" +#include "lobject.h" +#include "lstate.h" + + +#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) + +#define sizeudata(u) (sizeof(union Udata)+(u)->len) + +#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) +#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ + (sizeof(s)/sizeof(char))-1)) + +#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) + +LUAI_FUNC void luaS_resize (lua_State *L, int newsize); +LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); +LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); + + +#endif diff --git a/script/lua/lstrlib.c b/script/lua/lstrlib.c new file mode 100644 index 000000000..a9abb493e --- /dev/null +++ b/script/lua/lstrlib.c @@ -0,0 +1,870 @@ +/* +** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $ +** Standard library for string operations and pattern-matching +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#include +#include +#endif + +#define lstrlib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +/* macro to `unsign' a character */ +#define uchar(c) ((unsigned char)(c)) + + + +static int str_len (lua_State *L) { + size_t l; + luaL_checklstring(L, 1, &l); + lua_pushinteger(L, l); + return 1; +} + + +static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) { + /* relative string position: negative means back from end */ + if (pos < 0) pos += (ptrdiff_t)len + 1; + return (pos >= 0) ? pos : 0; +} + + +static int str_sub (lua_State *L) { + size_t l; + const char *s = luaL_checklstring(L, 1, &l); + ptrdiff_t start = posrelat(luaL_checkinteger(L, 2), l); + ptrdiff_t end = posrelat(luaL_optinteger(L, 3, -1), l); + if (start < 1) start = 1; + if (end > (ptrdiff_t)l) end = (ptrdiff_t)l; + if (start <= end) + lua_pushlstring(L, s+start-1, end-start+1); + else lua_pushliteral(L, ""); + return 1; +} + + +static int str_reverse (lua_State *L) { + size_t l; + luaL_Buffer b; + const char *s = luaL_checklstring(L, 1, &l); + luaL_buffinit(L, &b); + while (l--) luaL_addchar(&b, s[l]); + luaL_pushresult(&b); + return 1; +} + + +static int str_lower (lua_State *L) { + size_t l; + size_t i; + luaL_Buffer b; + const char *s = luaL_checklstring(L, 1, &l); + luaL_buffinit(L, &b); + for (i=0; i 0) + luaL_addlstring(&b, s, l); + luaL_pushresult(&b); + return 1; +} + + +static int str_byte (lua_State *L) { + size_t l; + const char *s = luaL_checklstring(L, 1, &l); + ptrdiff_t posi = posrelat(luaL_optinteger(L, 2, 1), l); + ptrdiff_t pose = posrelat(luaL_optinteger(L, 3, posi), l); + int n, i; + if (posi <= 0) posi = 1; + if ((size_t)pose > l) pose = l; + if (posi > pose) return 0; /* empty interval; return no values */ + n = (int)(pose - posi + 1); + if (posi + n <= pose) /* overflow? */ + luaL_error(L, "string slice too long"); + luaL_checkstack(L, n, "string slice too long"); + for (i=0; i= ms->level || ms->capture[l].len == CAP_UNFINISHED) + return luaL_error(ms->L, "invalid capture index"); + return l; +} + + +static int capture_to_close (MatchState *ms) { + int level = ms->level; + for (level--; level>=0; level--) + if (ms->capture[level].len == CAP_UNFINISHED) return level; + return luaL_error(ms->L, "invalid pattern capture"); +} + + +static const char *classend (MatchState *ms, const char *p) { + switch (*p++) { + case L_ESC: { + if (*p == '\0') + luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); + return p+1; + } + case '[': { + if (*p == '^') p++; + do { /* look for a `]' */ + if (*p == '\0') + luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); + if (*(p++) == L_ESC && *p != '\0') + p++; /* skip escapes (e.g. `%]') */ + } while (*p != ']'); + return p+1; + } + default: { + return p; + } + } +} + + +static int match_class (int c, int cl) { + int res; + switch (tolower(cl)) { + case 'a' : res = isalpha(c); break; + case 'c' : res = iscntrl(c); break; + case 'd' : res = isdigit(c); break; + case 'l' : res = islower(c); break; + case 'p' : res = ispunct(c); break; + case 's' : res = isspace(c); break; + case 'u' : res = isupper(c); break; + case 'w' : res = isalnum(c); break; + case 'x' : res = isxdigit(c); break; + case 'z' : res = (c == 0); break; + default: return (cl == c); + } + return (islower(cl) ? res : !res); +} + + +static int matchbracketclass (int c, const char *p, const char *ec) { + int sig = 1; + if (*(p+1) == '^') { + sig = 0; + p++; /* skip the `^' */ + } + while (++p < ec) { + if (*p == L_ESC) { + p++; + if (match_class(c, uchar(*p))) + return sig; + } + else if ((*(p+1) == '-') && (p+2 < ec)) { + p+=2; + if (uchar(*(p-2)) <= c && c <= uchar(*p)) + return sig; + } + else if (uchar(*p) == c) return sig; + } + return !sig; +} + + +static int singlematch (int c, const char *p, const char *ep) { + switch (*p) { + case '.': return 1; /* matches any char */ + case L_ESC: return match_class(c, uchar(*(p+1))); + case '[': return matchbracketclass(c, p, ep-1); + default: return (uchar(*p) == c); + } +} + + +static const char *match (MatchState *ms, const char *s, const char *p); + + +static const char *matchbalance (MatchState *ms, const char *s, + const char *p) { + if (*p == 0 || *(p+1) == 0) + luaL_error(ms->L, "unbalanced pattern"); + if (*s != *p) return NULL; + else { + int b = *p; + int e = *(p+1); + int cont = 1; + while (++s < ms->src_end) { + if (*s == e) { + if (--cont == 0) return s+1; + } + else if (*s == b) cont++; + } + } + return NULL; /* string ends out of balance */ +} + + +static const char *max_expand (MatchState *ms, const char *s, + const char *p, const char *ep) { + ptrdiff_t i = 0; /* counts maximum expand for item */ + while ((s+i)src_end && singlematch(uchar(*(s+i)), p, ep)) + i++; + /* keeps trying to match with the maximum repetitions */ + while (i>=0) { + const char *res = match(ms, (s+i), ep+1); + if (res) return res; + i--; /* else didn't match; reduce 1 repetition to try again */ + } + return NULL; +} + + +static const char *min_expand (MatchState *ms, const char *s, + const char *p, const char *ep) { + for (;;) { + const char *res = match(ms, s, ep+1); + if (res != NULL) + return res; + else if (ssrc_end && singlematch(uchar(*s), p, ep)) + s++; /* try with one more repetition */ + else return NULL; + } +} + + +static const char *start_capture (MatchState *ms, const char *s, + const char *p, int what) { + const char *res; + int level = ms->level; + if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); + ms->capture[level].init = s; + ms->capture[level].len = what; + ms->level = level+1; + if ((res=match(ms, s, p)) == NULL) /* match failed? */ + ms->level--; /* undo capture */ + return res; +} + + +static const char *end_capture (MatchState *ms, const char *s, + const char *p) { + int l = capture_to_close(ms); + const char *res; + ms->capture[l].len = s - ms->capture[l].init; /* close capture */ + if ((res = match(ms, s, p)) == NULL) /* match failed? */ + ms->capture[l].len = CAP_UNFINISHED; /* undo capture */ + return res; +} + + +static const char *match_capture (MatchState *ms, const char *s, int l) { + size_t len; + l = check_capture(ms, l); + len = ms->capture[l].len; + if ((size_t)(ms->src_end-s) >= len && + memcmp(ms->capture[l].init, s, len) == 0) + return s+len; + else return NULL; +} + + +static const char *match (MatchState *ms, const char *s, const char *p) { + init: /* using goto's to optimize tail recursion */ + switch (*p) { + case '(': { /* start capture */ + if (*(p+1) == ')') /* position capture? */ + return start_capture(ms, s, p+2, CAP_POSITION); + else + return start_capture(ms, s, p+1, CAP_UNFINISHED); + } + case ')': { /* end capture */ + return end_capture(ms, s, p+1); + } + case L_ESC: { + switch (*(p+1)) { + case 'b': { /* balanced string? */ + s = matchbalance(ms, s, p+2); + if (s == NULL) return NULL; + p+=4; goto init; /* else return match(ms, s, p+4); */ + } + case 'f': { /* frontier? */ + const char *ep; char previous; + p += 2; + if (*p != '[') + luaL_error(ms->L, "missing " LUA_QL("[") " after " + LUA_QL("%%f") " in pattern"); + ep = classend(ms, p); /* points to what is next */ + previous = (s == ms->src_init) ? '\0' : *(s-1); + if (matchbracketclass(uchar(previous), p, ep-1) || + !matchbracketclass(uchar(*s), p, ep-1)) return NULL; + p=ep; goto init; /* else return match(ms, s, ep); */ + } + default: { + if (isdigit(uchar(*(p+1)))) { /* capture results (%0-%9)? */ + s = match_capture(ms, s, uchar(*(p+1))); + if (s == NULL) return NULL; + p+=2; goto init; /* else return match(ms, s, p+2) */ + } + goto dflt; /* case default */ + } + } + } + case '\0': { /* end of pattern */ + return s; /* match succeeded */ + } + case '$': { + if (*(p+1) == '\0') /* is the `$' the last char in pattern? */ + return (s == ms->src_end) ? s : NULL; /* check end of string */ + else goto dflt; + } + default: dflt: { /* it is a pattern item */ + const char *ep = classend(ms, p); /* points to what is next */ + int m = ssrc_end && singlematch(uchar(*s), p, ep); + switch (*ep) { + case '?': { /* optional */ + const char *res; + if (m && ((res=match(ms, s+1, ep+1)) != NULL)) + return res; + p=ep+1; goto init; /* else return match(ms, s, ep+1); */ + } + case '*': { /* 0 or more repetitions */ + return max_expand(ms, s, p, ep); + } + case '+': { /* 1 or more repetitions */ + return (m ? max_expand(ms, s+1, p, ep) : NULL); + } + case '-': { /* 0 or more repetitions (minimum) */ + return min_expand(ms, s, p, ep); + } + default: { + if (!m) return NULL; + s++; p=ep; goto init; /* else return match(ms, s+1, ep); */ + } + } + } + } +} + + + +static const char *lmemfind (const char *s1, size_t l1, + const char *s2, size_t l2) { + if (l2 == 0) return s1; /* empty strings are everywhere */ + else if (l2 > l1) return NULL; /* avoids a negative `l1' */ + else { + const char *init; /* to search for a `*s2' inside `s1' */ + l2--; /* 1st char will be checked by `memchr' */ + l1 = l1-l2; /* `s2' cannot be found after that */ + while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { + init++; /* 1st char is already checked */ + if (memcmp(init, s2+1, l2) == 0) + return init-1; + else { /* correct `l1' and `s1' to try again */ + l1 -= init-s1; + s1 = init; + } + } + return NULL; /* not found */ + } +} + + +static void push_onecapture (MatchState *ms, int i, const char *s, + const char *e) { + if (i >= ms->level) { + if (i == 0) /* ms->level == 0, too */ + lua_pushlstring(ms->L, s, e - s); /* add whole match */ + else + luaL_error(ms->L, "invalid capture index"); + } + else { + ptrdiff_t l = ms->capture[i].len; + if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture"); + if (l == CAP_POSITION) + lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1); + else + lua_pushlstring(ms->L, ms->capture[i].init, l); + } +} + + +static int push_captures (MatchState *ms, const char *s, const char *e) { + int i; + int nlevels = (ms->level == 0 && s) ? 1 : ms->level; + luaL_checkstack(ms->L, nlevels, "too many captures"); + for (i = 0; i < nlevels; i++) + push_onecapture(ms, i, s, e); + return nlevels; /* number of strings pushed */ +} + + +static int str_find_aux (lua_State *L, int find) { + size_t l1, l2; + const char *s = luaL_checklstring(L, 1, &l1); + const char *p = luaL_checklstring(L, 2, &l2); + ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1; + if (init < 0) init = 0; + else if ((size_t)(init) > l1) init = (ptrdiff_t)l1; + if (find && (lua_toboolean(L, 4) || /* explicit request? */ + strpbrk(p, SPECIALS) == NULL)) { /* or no special characters? */ + /* do a plain search */ + const char *s2 = lmemfind(s+init, l1-init, p, l2); + if (s2) { + lua_pushinteger(L, s2-s+1); + lua_pushinteger(L, s2-s+l2); + return 2; + } + } + else { + MatchState ms; + int anchor = (*p == '^') ? (p++, 1) : 0; + const char *s1=s+init; + ms.L = L; + ms.src_init = s; + ms.src_end = s+l1; + do { + const char *res; + ms.level = 0; + if ((res=match(&ms, s1, p)) != NULL) { + if (find) { + lua_pushinteger(L, s1-s+1); /* start */ + lua_pushinteger(L, res-s); /* end */ + return push_captures(&ms, NULL, 0) + 2; + } + else + return push_captures(&ms, s1, res); + } + } while (s1++ < ms.src_end && !anchor); + } + lua_pushnil(L); /* not found */ + return 1; +} + + +static int str_find (lua_State *L) { + return str_find_aux(L, 1); +} + + +static int str_match (lua_State *L) { + return str_find_aux(L, 0); +} + + +static int gmatch_aux (lua_State *L) { + MatchState ms; + size_t ls; + const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls); + const char *p = lua_tostring(L, lua_upvalueindex(2)); + const char *src; + ms.L = L; + ms.src_init = s; + ms.src_end = s+ls; + for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3)); + src <= ms.src_end; + src++) { + const char *e; + ms.level = 0; + if ((e = match(&ms, src, p)) != NULL) { + lua_Integer newstart = e-s; + if (e == src) newstart++; /* empty match? go at least one position */ + lua_pushinteger(L, newstart); + lua_replace(L, lua_upvalueindex(3)); + return push_captures(&ms, src, e); + } + } + return 0; /* not found */ +} + + +static int gmatch (lua_State *L) { + luaL_checkstring(L, 1); + luaL_checkstring(L, 2); + lua_settop(L, 2); + lua_pushinteger(L, 0); + lua_pushcclosure(L, gmatch_aux, 3); + return 1; +} + + +static int gfind_nodef (lua_State *L) { + return luaL_error(L, LUA_QL("string.gfind") " was renamed to " + LUA_QL("string.gmatch")); +} + + +static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, + const char *e) { + size_t l, i; + const char *news = lua_tolstring(ms->L, 3, &l); + for (i = 0; i < l; i++) { + if (news[i] != L_ESC) + luaL_addchar(b, news[i]); + else { + i++; /* skip ESC */ + if (!isdigit(uchar(news[i]))) + luaL_addchar(b, news[i]); + else if (news[i] == '0') + luaL_addlstring(b, s, e - s); + else { + push_onecapture(ms, news[i] - '1', s, e); + luaL_addvalue(b); /* add capture to accumulated result */ + } + } + } +} + + +static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, + const char *e) { + lua_State *L = ms->L; + switch (lua_type(L, 3)) { + case LUA_TNUMBER: + case LUA_TSTRING: { + add_s(ms, b, s, e); + return; + } + case LUA_TFUNCTION: { + int n; + lua_pushvalue(L, 3); + n = push_captures(ms, s, e); + lua_call(L, n, 1); + break; + } + case LUA_TTABLE: { + push_onecapture(ms, 0, s, e); + lua_gettable(L, 3); + break; + } + } + if (!lua_toboolean(L, -1)) { /* nil or false? */ + lua_pop(L, 1); + lua_pushlstring(L, s, e - s); /* keep original text */ + } + else if (!lua_isstring(L, -1)) + luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); + luaL_addvalue(b); /* add result to accumulator */ +} + + +static int str_gsub (lua_State *L) { + size_t srcl; + const char *src = luaL_checklstring(L, 1, &srcl); + const char *p = luaL_checkstring(L, 2); + int tr = lua_type(L, 3); + int max_s = luaL_optint(L, 4, srcl+1); + int anchor = (*p == '^') ? (p++, 1) : 0; + int n = 0; + MatchState ms; + luaL_Buffer b; + luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING || + tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3, + "string/function/table expected"); + luaL_buffinit(L, &b); + ms.L = L; + ms.src_init = src; + ms.src_end = src+srcl; + while (n < max_s) { + const char *e; + ms.level = 0; + e = match(&ms, src, p); + if (e) { + n++; + add_value(&ms, &b, src, e); + } + if (e && e>src) /* non empty match? */ + src = e; /* skip it */ + else if (src < ms.src_end) + luaL_addchar(&b, *src++); + else break; + if (anchor) break; + } + luaL_addlstring(&b, src, ms.src_end-src); + luaL_pushresult(&b); + lua_pushinteger(L, n); /* number of substitutions */ + return 2; +} + +/* }====================================================== */ + + +/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ +#define MAX_ITEM 512 +/* valid flags in a format specification */ +#define FLAGS "-+ #0" +/* +** maximum size of each format specification (such as '%-099.99d') +** (+10 accounts for %99.99x plus margin of error) +*/ +#define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10) + + +static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { + size_t l; + const char *s = luaL_checklstring(L, arg, &l); + luaL_addchar(b, '"'); + while (l--) { + switch (*s) { + case '"': case '\\': case '\n': { + luaL_addchar(b, '\\'); + luaL_addchar(b, *s); + break; + } + case '\r': { + luaL_addlstring(b, "\\r", 2); + break; + } + case '\0': { + luaL_addlstring(b, "\\000", 4); + break; + } + default: { + luaL_addchar(b, *s); + break; + } + } + s++; + } + luaL_addchar(b, '"'); +} + +static const char *scanformat (lua_State *L, const char *strfrmt, char *form) { + const char *p = strfrmt; + while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */ + if ((size_t)(p - strfrmt) >= sizeof(FLAGS)) + luaL_error(L, "invalid format (repeated flags)"); + if (isdigit(uchar(*p))) p++; /* skip width */ + if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ + if (*p == '.') { + p++; + if (isdigit(uchar(*p))) p++; /* skip precision */ + if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ + } + if (isdigit(uchar(*p))) + luaL_error(L, "invalid format (width or precision too long)"); + *(form++) = '%'; + strncpy(form, strfrmt, p - strfrmt + 1); + form += p - strfrmt + 1; + *form = '\0'; + return p; +} + + +static void addintlen (char *form) { + size_t l = strlen(form); + char spec = form[l - 1]; + strcpy(form + l - 1, LUA_INTFRMLEN); + form[l + sizeof(LUA_INTFRMLEN) - 2] = spec; + form[l + sizeof(LUA_INTFRMLEN) - 1] = '\0'; +} + + +static int str_format (lua_State *L) { + int arg = 1; + size_t sfl; + const char *strfrmt = luaL_checklstring(L, arg, &sfl); + const char *strfrmt_end = strfrmt+sfl; + luaL_Buffer b; + luaL_buffinit(L, &b); + while (strfrmt < strfrmt_end) { + if (*strfrmt != L_ESC) + luaL_addchar(&b, *strfrmt++); + else if (*++strfrmt == L_ESC) + luaL_addchar(&b, *strfrmt++); /* %% */ + else { /* format item */ + char form[MAX_FORMAT]; /* to store the format (`%...') */ + char buff[MAX_ITEM]; /* to store the formatted item */ + arg++; + strfrmt = scanformat(L, strfrmt, form); + switch (*strfrmt++) { + case 'c': { + sprintf(buff, form, (int)luaL_checknumber(L, arg)); + break; + } + case 'd': case 'i': { + addintlen(form); + sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg)); + break; + } + case 'o': case 'u': case 'x': case 'X': { + addintlen(form); + sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg)); + break; + } + case 'e': case 'E': case 'f': + case 'g': case 'G': { + sprintf(buff, form, (double)luaL_checknumber(L, arg)); + break; + } + case 'q': { + addquoted(L, &b, arg); + continue; /* skip the 'addsize' at the end */ + } + case 's': { + size_t l; + const char *s = luaL_checklstring(L, arg, &l); + if (!strchr(form, '.') && l >= 100) { + /* no precision and string is too long to be formatted; + keep original string */ + lua_pushvalue(L, arg); + luaL_addvalue(&b); + continue; /* skip the `addsize' at the end */ + } + else { + sprintf(buff, form, s); + break; + } + } + default: { /* also treat cases `pnLlh' */ + return luaL_error(L, "invalid option " LUA_QL("%%%c") " to " + LUA_QL("format"), *(strfrmt - 1)); + } + } + luaL_addlstring(&b, buff, strlen(buff)); + } + } + luaL_pushresult(&b); + return 1; +} + + +static const luaL_Reg strlib[] = { + {"byte", str_byte}, + {"char", str_char}, + {"dump", str_dump}, + {"find", str_find}, + {"format", str_format}, + {"gfind", gfind_nodef}, + {"gmatch", gmatch}, + {"gsub", str_gsub}, + {"len", str_len}, + {"lower", str_lower}, + {"match", str_match}, + {"rep", str_rep}, + {"reverse", str_reverse}, + {"sub", str_sub}, + {"upper", str_upper}, + {NULL, NULL} +}; + + +static void createmetatable (lua_State *L) { + lua_createtable(L, 0, 1); /* create metatable for strings */ + lua_pushliteral(L, ""); /* dummy string */ + lua_pushvalue(L, -2); + lua_setmetatable(L, -2); /* set string metatable */ + lua_pop(L, 1); /* pop dummy string */ + lua_pushvalue(L, -2); /* string library... */ + lua_setfield(L, -2, "__index"); /* ...is the __index metamethod */ + lua_pop(L, 1); /* pop metatable */ +} + + +/* +** Open string library +*/ +LUALIB_API int luaopen_string (lua_State *L) { + luaL_register(L, LUA_STRLIBNAME, strlib); +#if defined(LUA_COMPAT_GFIND) + lua_getfield(L, -1, "gmatch"); + lua_setfield(L, -2, "gfind"); +#endif + createmetatable(L); + return 1; +} + diff --git a/script/lua/ltable.c b/script/lua/ltable.c new file mode 100644 index 000000000..f6501f8d5 --- /dev/null +++ b/script/lua/ltable.c @@ -0,0 +1,594 @@ +/* +** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $ +** Lua tables (hash) +** See Copyright Notice in lua.h +*/ + + +/* +** Implementation of tables (aka arrays, objects, or hash tables). +** Tables keep its elements in two parts: an array part and a hash part. +** Non-negative integer keys are all candidates to be kept in the array +** part. The actual size of the array is the largest `n' such that at +** least half the slots between 0 and n are in use. +** Hash uses a mix of chained scatter table with Brent's variation. +** A main invariant of these tables is that, if an element is not +** in its main position (i.e. the `original' position that its hash gives +** to it), then the colliding element is in its own main position. +** Hence even when the load factor reaches 100%, performance remains good. +*/ + +#if 0 +#include +#include +#endif + +#define ltable_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lgc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstate.h" +#include "ltable.h" + + +/* +** max size of array part is 2^MAXBITS +*/ +#if LUAI_BITSINT > 26 +#define MAXBITS 26 +#else +#define MAXBITS (LUAI_BITSINT-2) +#endif + +#define MAXASIZE (1 << MAXBITS) + + +#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) + +#define hashstr(t,str) hashpow2(t, (str)->tsv.hash) +#define hashboolean(t,p) hashpow2(t, p) + + +/* +** for some types, it is better to avoid modulus by power of 2, as +** they tend to have many 2 factors. +*/ +#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) + + +#define hashpointer(t,p) hashmod(t, IntPoint(p)) + + +/* +** number of ints inside a lua_Number +*/ +#define numints cast_int(sizeof(lua_Number)/sizeof(int)) + + + +#define dummynode (&dummynode_) + +static const Node dummynode_ = { + {{NULL}, LUA_TNIL}, /* value */ + {{{NULL}, LUA_TNIL, NULL}} /* key */ +}; + + +/* +** hash for lua_Numbers +*/ +static Node *hashnum (const Table *t, lua_Number n) { + unsigned int a[numints]; + int i; + if (luai_numeq(n, 0)) /* avoid problems with -0 */ + return gnode(t, 0); + memcpy(a, &n, sizeof(a)); + for (i = 1; i < numints; i++) a[0] += a[i]; + return hashmod(t, a[0]); +} + + + +/* +** returns the `main' position of an element in a table (that is, the index +** of its hash value) +*/ +static Node *mainposition (const Table *t, const TValue *key) { + switch (ttype(key)) { + case LUA_TNUMBER: + return hashnum(t, nvalue(key)); + case LUA_TSTRING: + return hashstr(t, rawtsvalue(key)); + case LUA_TBOOLEAN: + return hashboolean(t, bvalue(key)); + case LUA_TLIGHTUSERDATA: + return hashpointer(t, pvalue(key)); + default: + return hashpointer(t, gcvalue(key)); + } +} + + +/* +** returns the index for `key' if `key' is an appropriate key to live in +** the array part of the table, -1 otherwise. +*/ +static int arrayindex (const TValue *key) { + if (ttisnumber(key)) { + lua_Number n = nvalue(key); + int k; + lua_number2int(k, n); + if (luai_numeq(cast_num(k), n)) + return k; + } + return -1; /* `key' did not match some condition */ +} + + +/* +** returns the index of a `key' for table traversals. First goes all +** elements in the array part, then elements in the hash part. The +** beginning of a traversal is signalled by -1. +*/ +static int findindex (lua_State *L, Table *t, StkId key) { + int i; + if (ttisnil(key)) return -1; /* first iteration */ + i = arrayindex(key); + if (0 < i && i <= t->sizearray) /* is `key' inside array part? */ + return i-1; /* yes; that's the index (corrected to C) */ + else { + Node *n = mainposition(t, key); + do { /* check whether `key' is somewhere in the chain */ + /* key may be dead already, but it is ok to use it in `next' */ + if (luaO_rawequalObj(key2tval(n), key) || + (ttype(gkey(n)) == LUA_TDEADKEY && iscollectable(key) && + gcvalue(gkey(n)) == gcvalue(key))) { + i = cast_int(n - gnode(t, 0)); /* key index in hash table */ + /* hash elements are numbered after array ones */ + return i + t->sizearray; + } + else n = gnext(n); + } while (n); + luaG_runerror(L, "invalid key to " LUA_QL("next")); /* key not found */ + return 0; /* to avoid warnings */ + } +} + + +int luaH_next (lua_State *L, Table *t, StkId key) { + int i = findindex(L, t, key); /* find original element */ + for (i++; i < t->sizearray; i++) { /* try first array part */ + if (!ttisnil(&t->array[i])) { /* a non-nil value? */ + setnvalue(key, cast_num(i+1)); + setobj2s(L, key+1, &t->array[i]); + return 1; + } + } + for (i -= t->sizearray; i < sizenode(t); i++) { /* then hash part */ + if (!ttisnil(gval(gnode(t, i)))) { /* a non-nil value? */ + setobj2s(L, key, key2tval(gnode(t, i))); + setobj2s(L, key+1, gval(gnode(t, i))); + return 1; + } + } + return 0; /* no more elements */ +} + + +/* +** {============================================================= +** Rehash +** ============================================================== +*/ + + +static int computesizes (int nums[], int *narray) { + int i; + int twotoi; /* 2^i */ + int a = 0; /* number of elements smaller than 2^i */ + int na = 0; /* number of elements to go to array part */ + int n = 0; /* optimal size for array part */ + for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) { + if (nums[i] > 0) { + a += nums[i]; + if (a > twotoi/2) { /* more than half elements present? */ + n = twotoi; /* optimal size (till now) */ + na = a; /* all elements smaller than n will go to array part */ + } + } + if (a == *narray) break; /* all elements already counted */ + } + *narray = n; + lua_assert(*narray/2 <= na && na <= *narray); + return na; +} + + +static int countint (const TValue *key, int *nums) { + int k = arrayindex(key); + if (0 < k && k <= MAXASIZE) { /* is `key' an appropriate array index? */ + nums[ceillog2(k)]++; /* count as such */ + return 1; + } + else + return 0; +} + + +static int numusearray (const Table *t, int *nums) { + int lg; + int ttlg; /* 2^lg */ + int ause = 0; /* summation of `nums' */ + int i = 1; /* count to traverse all array keys */ + for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) { /* for each slice */ + int lc = 0; /* counter */ + int lim = ttlg; + if (lim > t->sizearray) { + lim = t->sizearray; /* adjust upper limit */ + if (i > lim) + break; /* no more elements to count */ + } + /* count elements in range (2^(lg-1), 2^lg] */ + for (; i <= lim; i++) { + if (!ttisnil(&t->array[i-1])) + lc++; + } + nums[lg] += lc; + ause += lc; + } + return ause; +} + + +static int numusehash (const Table *t, int *nums, int *pnasize) { + int totaluse = 0; /* total number of elements */ + int ause = 0; /* summation of `nums' */ + int i = sizenode(t); + while (i--) { + Node *n = &t->node[i]; + if (!ttisnil(gval(n))) { + ause += countint(key2tval(n), nums); + totaluse++; + } + } + *pnasize += ause; + return totaluse; +} + + +static void setarrayvector (lua_State *L, Table *t, int size) { + int i; + luaM_reallocvector(L, t->array, t->sizearray, size, TValue); + for (i=t->sizearray; iarray[i]); + t->sizearray = size; +} + + +static void setnodevector (lua_State *L, Table *t, int size) { + int lsize; + if (size == 0) { /* no elements to hash part? */ + t->node = cast(Node *, dummynode); /* use common `dummynode' */ + lsize = 0; + } + else { + int i; + lsize = ceillog2(size); + if (lsize > MAXBITS) + luaG_runerror(L, "table overflow"); + size = twoto(lsize); + t->node = luaM_newvector(L, size, Node); + for (i=0; ilsizenode = cast_byte(lsize); + t->lastfree = gnode(t, size); /* all positions are free */ +} + + +static void resize (lua_State *L, Table *t, int nasize, int nhsize) { + int i; + int oldasize = t->sizearray; + int oldhsize = t->lsizenode; + Node *nold = t->node; /* save old hash ... */ + if (nasize > oldasize) /* array part must grow? */ + setarrayvector(L, t, nasize); + /* create new hash part with appropriate size */ + setnodevector(L, t, nhsize); + if (nasize < oldasize) { /* array part must shrink? */ + t->sizearray = nasize; + /* re-insert elements from vanishing slice */ + for (i=nasize; iarray[i])) + setobjt2t(L, luaH_setnum(L, t, i+1), &t->array[i]); + } + /* shrink array */ + luaM_reallocvector(L, t->array, oldasize, nasize, TValue); + } + /* re-insert elements from hash part */ + for (i = twoto(oldhsize) - 1; i >= 0; i--) { + Node *old = nold+i; + if (!ttisnil(gval(old))) + setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old)); + } + if (nold != dummynode) + luaM_freearray(L, nold, twoto(oldhsize), Node); /* free old array */ +} + + +void luaH_resizearray (lua_State *L, Table *t, int nasize) { + int nsize = (t->node == dummynode) ? 0 : sizenode(t); + resize(L, t, nasize, nsize); +} + + +static void rehash (lua_State *L, Table *t, const TValue *ek) { + int nasize, na; + int nums[MAXBITS+1]; /* nums[i] = number of keys between 2^(i-1) and 2^i */ + int i; + int totaluse; + for (i=0; i<=MAXBITS; i++) nums[i] = 0; /* reset counts */ + nasize = numusearray(t, nums); /* count keys in array part */ + totaluse = nasize; /* all those keys are integer keys */ + totaluse += numusehash(t, nums, &nasize); /* count keys in hash part */ + /* count extra key */ + nasize += countint(ek, nums); + totaluse++; + /* compute new size for array part */ + na = computesizes(nums, &nasize); + /* resize the table to new computed sizes */ + resize(L, t, nasize, totaluse - na); +} + + + +/* +** }============================================================= +*/ + + +Table *luaH_new (lua_State *L, int narray, int nhash) { + Table *t = luaM_new(L, Table); + luaC_link(L, obj2gco(t), LUA_TTABLE); + t->metatable = NULL; + t->flags = cast_byte(~0); + /* temporary values (kept only if some malloc fails) */ + t->array = NULL; + t->sizearray = 0; + t->lsizenode = 0; + t->node = cast(Node *, dummynode); + setarrayvector(L, t, narray); + setnodevector(L, t, nhash); + return t; +} + + +void luaH_free (lua_State *L, Table *t) { + if (t->node != dummynode) + luaM_freearray(L, t->node, sizenode(t), Node); + luaM_freearray(L, t->array, t->sizearray, TValue); + luaM_free(L, t); +} + + +static Node *getfreepos (Table *t) { + while (t->lastfree-- > t->node) { + if (ttisnil(gkey(t->lastfree))) + return t->lastfree; + } + return NULL; /* could not find a free place */ +} + + + +/* +** inserts a new key into a hash table; first, check whether key's main +** position is free. If not, check whether colliding node is in its main +** position or not: if it is not, move colliding node to an empty place and +** put new key in its main position; otherwise (colliding node is in its main +** position), new key goes to an empty position. +*/ +static TValue *newkey (lua_State *L, Table *t, const TValue *key) { + Node *mp = mainposition(t, key); + if (!ttisnil(gval(mp)) || mp == dummynode) { + Node *othern; + Node *n = getfreepos(t); /* get a free place */ + if (n == NULL) { /* cannot find a free place? */ + rehash(L, t, key); /* grow table */ + return luaH_set(L, t, key); /* re-insert key into grown table */ + } + lua_assert(n != dummynode); + othern = mainposition(t, key2tval(mp)); + if (othern != mp) { /* is colliding node out of its main position? */ + /* yes; move colliding node into free position */ + while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ + gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ +#if 0 + *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ +#else + memcpy (n, mp, sizeof (*n)); +#endif + gnext(mp) = NULL; /* now `mp' is free */ + setnilvalue(gval(mp)); + } + else { /* colliding node is in its own main position */ + /* new node will go into free position */ + gnext(n) = gnext(mp); /* chain new position */ + gnext(mp) = n; + mp = n; + } + } + gkey(mp)->value = key->value; gkey(mp)->tt = key->tt; + luaC_barriert(L, t, key); + lua_assert(ttisnil(gval(mp))); + return gval(mp); +} + + +/* +** search function for integers +*/ +const TValue *luaH_getnum (Table *t, int key) { + /* (1 <= key && key <= t->sizearray) */ + if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray)) + return &t->array[key-1]; + else { + lua_Number nk = cast_num(key); + Node *n = hashnum(t, nk); + do { /* check whether `key' is somewhere in the chain */ + if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) + return gval(n); /* that's it */ + else n = gnext(n); + } while (n); + return luaO_nilobject; + } +} + + +/* +** search function for strings +*/ +const TValue *luaH_getstr (Table *t, TString *key) { + Node *n = hashstr(t, key); + do { /* check whether `key' is somewhere in the chain */ + if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key) + return gval(n); /* that's it */ + else n = gnext(n); + } while (n); + return luaO_nilobject; +} + + +/* +** main search function +*/ +const TValue *luaH_get (Table *t, const TValue *key) { + switch (ttype(key)) { + case LUA_TNIL: return luaO_nilobject; + case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); + case LUA_TNUMBER: { + int k; + lua_Number n = nvalue(key); + lua_number2int(k, n); + if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */ + return luaH_getnum(t, k); /* use specialized version */ + /* else go through */ + } + default: { + Node *n = mainposition(t, key); + do { /* check whether `key' is somewhere in the chain */ + if (luaO_rawequalObj(key2tval(n), key)) + return gval(n); /* that's it */ + else n = gnext(n); + } while (n); + return luaO_nilobject; + } + } +} + + +TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { + const TValue *p = luaH_get(t, key); + t->flags = 0; + if (p != luaO_nilobject) + return cast(TValue *, p); + else { + if (ttisnil(key)) luaG_runerror(L, "table index is nil"); + else if (ttisnumber(key) && luai_numisnan(nvalue(key))) + luaG_runerror(L, "table index is NaN"); + return newkey(L, t, key); + } +} + + +TValue *luaH_setnum (lua_State *L, Table *t, int key) { + const TValue *p = luaH_getnum(t, key); + if (p != luaO_nilobject) + return cast(TValue *, p); + else { + TValue k; + setnvalue(&k, cast_num(key)); + return newkey(L, t, &k); + } +} + + +TValue *luaH_setstr (lua_State *L, Table *t, TString *key) { + const TValue *p = luaH_getstr(t, key); + if (p != luaO_nilobject) + return cast(TValue *, p); + else { + TValue k; + setsvalue(L, &k, key); + return newkey(L, t, &k); + } +} + + +static int unbound_search (Table *t, unsigned int j) { + unsigned int i = j; /* i is zero or a present index */ + j++; + /* find `i' and `j' such that i is present and j is not */ + while (!ttisnil(luaH_getnum(t, j))) { + i = j; + j *= 2; + if (j > cast(unsigned int, MAX_INT)) { /* overflow? */ + /* table was built with bad purposes: resort to linear search */ + i = 1; + while (!ttisnil(luaH_getnum(t, i))) i++; + return i - 1; + } + } + /* now do a binary search between them */ + while (j - i > 1) { + unsigned int m = (i+j)/2; + if (ttisnil(luaH_getnum(t, m))) j = m; + else i = m; + } + return i; +} + + +/* +** Try to find a boundary in table `t'. A `boundary' is an integer index +** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). +*/ +int luaH_getn (Table *t) { + unsigned int j = t->sizearray; + if (j > 0 && ttisnil(&t->array[j - 1])) { + /* there is a boundary in the array part: (binary) search for it */ + unsigned int i = 0; + while (j - i > 1) { + unsigned int m = (i+j)/2; + if (ttisnil(&t->array[m - 1])) j = m; + else i = m; + } + return i; + } + /* else must find a boundary in hash part */ + else if (t->node == dummynode) /* hash part is empty? */ + return j; /* that is easy... */ + else return unbound_search(t, j); +} + + + +#if defined(LUA_DEBUG) + +Node *luaH_mainposition (const Table *t, const TValue *key) { + return mainposition(t, key); +} + +int luaH_isdummy (Node *n) { return n == dummynode; } + +#endif diff --git a/script/lua/ltable.h b/script/lua/ltable.h new file mode 100644 index 000000000..f5b9d5ead --- /dev/null +++ b/script/lua/ltable.h @@ -0,0 +1,40 @@ +/* +** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua tables (hash) +** See Copyright Notice in lua.h +*/ + +#ifndef ltable_h +#define ltable_h + +#include "lobject.h" + + +#define gnode(t,i) (&(t)->node[i]) +#define gkey(n) (&(n)->i_key.nk) +#define gval(n) (&(n)->i_val) +#define gnext(n) ((n)->i_key.nk.next) + +#define key2tval(n) (&(n)->i_key.tvk) + + +LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); +LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); +LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); +LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); +LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); +LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); +LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); +LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); +LUAI_FUNC void luaH_free (lua_State *L, Table *t); +LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); +LUAI_FUNC int luaH_getn (Table *t); + + +#if defined(LUA_DEBUG) +LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); +LUAI_FUNC int luaH_isdummy (Node *n); +#endif + + +#endif diff --git a/script/lua/ltablib.c b/script/lua/ltablib.c new file mode 100644 index 000000000..34a346744 --- /dev/null +++ b/script/lua/ltablib.c @@ -0,0 +1,288 @@ +/* +** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $ +** Library for Table Manipulation +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#endif + +#define ltablib_c +#define LUA_LIB + +#include "lua.h" + +#include "lauxlib.h" +#include "lualib.h" + + +#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n)) + + +static int foreachi (lua_State *L) { + int i; + int n = aux_getn(L, 1); + luaL_checktype(L, 2, LUA_TFUNCTION); + for (i=1; i <= n; i++) { + lua_pushvalue(L, 2); /* function */ + lua_pushinteger(L, i); /* 1st argument */ + lua_rawgeti(L, 1, i); /* 2nd argument */ + lua_call(L, 2, 1); + if (!lua_isnil(L, -1)) + return 1; + lua_pop(L, 1); /* remove nil result */ + } + return 0; +} + + +static int foreach (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); + luaL_checktype(L, 2, LUA_TFUNCTION); + lua_pushnil(L); /* first key */ + while (lua_next(L, 1)) { + lua_pushvalue(L, 2); /* function */ + lua_pushvalue(L, -3); /* key */ + lua_pushvalue(L, -3); /* value */ + lua_call(L, 2, 1); + if (!lua_isnil(L, -1)) + return 1; + lua_pop(L, 2); /* remove value and result */ + } + return 0; +} + + +static int maxn (lua_State *L) { + lua_Number max = 0; + luaL_checktype(L, 1, LUA_TTABLE); + lua_pushnil(L); /* first key */ + while (lua_next(L, 1)) { + lua_pop(L, 1); /* remove value */ + if (lua_type(L, -1) == LUA_TNUMBER) { + lua_Number v = lua_tonumber(L, -1); + if (v > max) max = v; + } + } + lua_pushnumber(L, max); + return 1; +} + + +static int getn (lua_State *L) { + lua_pushinteger(L, aux_getn(L, 1)); + return 1; +} + + +static int setn (lua_State *L) { + luaL_checktype(L, 1, LUA_TTABLE); +#ifndef luaL_setn + luaL_setn(L, 1, luaL_checkint(L, 2)); +#else + luaL_error(L, LUA_QL("setn") " is obsolete"); +#endif + lua_pushvalue(L, 1); + return 1; +} + + +static int tinsert (lua_State *L) { + int e = aux_getn(L, 1) + 1; /* first empty element */ + int pos; /* where to insert new element */ + switch (lua_gettop(L)) { + case 2: { /* called with only 2 arguments */ + pos = e; /* insert new element at the end */ + break; + } + case 3: { + int i; + pos = luaL_checkint(L, 2); /* 2nd argument is the position */ + if (pos > e) e = pos; /* `grow' array if necessary */ + for (i = e; i > pos; i--) { /* move up elements */ + lua_rawgeti(L, 1, i-1); + lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ + } + break; + } + default: { + return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); + } + } + luaL_setn(L, 1, e); /* new size */ + lua_rawseti(L, 1, pos); /* t[pos] = v */ + return 0; +} + + +static int tremove (lua_State *L) { + int e = aux_getn(L, 1); + int pos = luaL_optint(L, 2, e); + if (!(1 <= pos && pos <= e)) /* position is outside bounds? */ + return 0; /* nothing to remove */ + luaL_setn(L, 1, e - 1); /* t.n = n-1 */ + lua_rawgeti(L, 1, pos); /* result = t[pos] */ + for ( ;pos= P */ + while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { + if (i>u) luaL_error(L, "invalid order function for sorting"); + lua_pop(L, 1); /* remove a[i] */ + } + /* repeat --j until a[j] <= P */ + while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { + if (j +#endif + +#define ltm_c +#define LUA_CORE + +#include "lua.h" + +#include "lobject.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" + + + +const char *const luaT_typenames[] = { + "nil", "boolean", "userdata", "number", + "string", "table", "function", "userdata", "thread", + "proto", "upval" +}; + + +void luaT_init (lua_State *L) { + static const char *const luaT_eventname[] = { /* ORDER TM */ + "__index", "__newindex", + "__gc", "__mode", "__eq", + "__add", "__sub", "__mul", "__div", "__mod", + "__pow", "__unm", "__len", "__lt", "__le", + "__concat", "__call" + }; + int i; + for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]); + luaS_fix(G(L)->tmname[i]); /* never collect these names */ + } +} + + +/* +** function to be used with macro "fasttm": optimized for absence of +** tag methods +*/ +const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { + const TValue *tm = luaH_getstr(events, ename); + lua_assert(event <= TM_EQ); + if (ttisnil(tm)) { /* no tag method? */ + events->flags |= cast_byte(1u<metatable; + break; + case LUA_TUSERDATA: + mt = uvalue(o)->metatable; + break; + default: + mt = G(L)->mt[ttype(o)]; + } + return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); +} + diff --git a/script/lua/ltm.h b/script/lua/ltm.h new file mode 100644 index 000000000..64343b781 --- /dev/null +++ b/script/lua/ltm.h @@ -0,0 +1,54 @@ +/* +** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $ +** Tag methods +** See Copyright Notice in lua.h +*/ + +#ifndef ltm_h +#define ltm_h + + +#include "lobject.h" + + +/* +* WARNING: if you change the order of this enumeration, +* grep "ORDER TM" +*/ +typedef enum { + TM_INDEX, + TM_NEWINDEX, + TM_GC, + TM_MODE, + TM_EQ, /* last tag method with `fast' access */ + TM_ADD, + TM_SUB, + TM_MUL, + TM_DIV, + TM_MOD, + TM_POW, + TM_UNM, + TM_LEN, + TM_LT, + TM_LE, + TM_CONCAT, + TM_CALL, + TM_N /* number of elements in the enum */ +} TMS; + + + +#define gfasttm(g,et,e) ((et) == NULL ? NULL : \ + ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) + +#define fasttm(l,et,e) gfasttm(G(l), et, e) + +LUAI_DATA const char *const luaT_typenames[]; + + +LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); +LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, + TMS event); +LUAI_FUNC void luaT_init (lua_State *L); + +#endif diff --git a/script/lua/lua.h b/script/lua/lua.h new file mode 100644 index 000000000..91aa410e8 --- /dev/null +++ b/script/lua/lua.h @@ -0,0 +1,388 @@ +/* +** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ +** Lua - An Extensible Extension Language +** Lua.org, PUC-Rio, Brazil (http://www.lua.org) +** See Copyright Notice at the end of this file +*/ + + +#ifndef lua_h +#define lua_h + +#include +#include + + +#include "luaconf.h" + + +#define LUA_VERSION "Lua 5.1" +#define LUA_RELEASE "Lua 5.1.4" +#define LUA_VERSION_NUM 501 +#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" +#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" + + +/* mark for precompiled code (`Lua') */ +#define LUA_SIGNATURE "\033Lua" + +/* option for multiple returns in `lua_pcall' and `lua_call' */ +#define LUA_MULTRET (-1) + + +/* +** pseudo-indices +*/ +#define LUA_REGISTRYINDEX (-10000) +#define LUA_ENVIRONINDEX (-10001) +#define LUA_GLOBALSINDEX (-10002) +#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) + + +/* thread status; 0 is OK */ +#define LUA_YIELD 1 +#define LUA_ERRRUN 2 +#define LUA_ERRSYNTAX 3 +#define LUA_ERRMEM 4 +#define LUA_ERRERR 5 + + +typedef struct lua_State lua_State; + +typedef int (*lua_CFunction) (lua_State *L); + + +/* +** functions that read/write blocks when loading/dumping Lua chunks +*/ +typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); + +typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); + + +/* +** prototype for memory-allocation functions +*/ +typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); + + +/* +** basic types +*/ +#define LUA_TNONE (-1) + +#define LUA_TNIL 0 +#define LUA_TBOOLEAN 1 +#define LUA_TLIGHTUSERDATA 2 +#define LUA_TNUMBER 3 +#define LUA_TSTRING 4 +#define LUA_TTABLE 5 +#define LUA_TFUNCTION 6 +#define LUA_TUSERDATA 7 +#define LUA_TTHREAD 8 + + + +/* minimum Lua stack available to a C function */ +#define LUA_MINSTACK 20 + + +/* +** generic extra include file +*/ +#if defined(LUA_USER_H) +#include LUA_USER_H +#endif + + +/* type of numbers in Lua */ +typedef LUA_NUMBER lua_Number; + + +/* type for integer functions */ +typedef LUA_INTEGER lua_Integer; + + + +/* +** state manipulation +*/ +LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); +LUA_API void (lua_close) (lua_State *L); +LUA_API lua_State *(lua_newthread) (lua_State *L); + +LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); + + +/* +** basic stack manipulation +*/ +LUA_API int (lua_gettop) (lua_State *L); +LUA_API void (lua_settop) (lua_State *L, int idx); +LUA_API void (lua_pushvalue) (lua_State *L, int idx); +LUA_API void (lua_remove) (lua_State *L, int idx); +LUA_API void (lua_insert) (lua_State *L, int idx); +LUA_API void (lua_replace) (lua_State *L, int idx); +LUA_API int (lua_checkstack) (lua_State *L, int sz); + +LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); + + +/* +** access functions (stack -> C) +*/ + +LUA_API int (lua_isnumber) (lua_State *L, int idx); +LUA_API int (lua_isstring) (lua_State *L, int idx); +LUA_API int (lua_iscfunction) (lua_State *L, int idx); +LUA_API int (lua_isuserdata) (lua_State *L, int idx); +LUA_API int (lua_type) (lua_State *L, int idx); +LUA_API const char *(lua_typename) (lua_State *L, int tp); + +LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); +LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); +LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); + +LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); +LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); +LUA_API int (lua_toboolean) (lua_State *L, int idx); +LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); +LUA_API size_t (lua_objlen) (lua_State *L, int idx); +LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); +LUA_API void *(lua_touserdata) (lua_State *L, int idx); +LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); +LUA_API const void *(lua_topointer) (lua_State *L, int idx); + + +/* +** push functions (C -> stack) +*/ +LUA_API void (lua_pushnil) (lua_State *L); +LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); +LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); +LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); +LUA_API void (lua_pushstring) (lua_State *L, const char *s); +LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, + va_list argp); +LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); +LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); +LUA_API void (lua_pushboolean) (lua_State *L, int b); +LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); +LUA_API int (lua_pushthread) (lua_State *L); + + +/* +** get functions (Lua -> stack) +*/ +LUA_API void (lua_gettable) (lua_State *L, int idx); +LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); +LUA_API void (lua_rawget) (lua_State *L, int idx); +LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); +LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); +LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); +LUA_API int (lua_getmetatable) (lua_State *L, int objindex); +LUA_API void (lua_getfenv) (lua_State *L, int idx); + + +/* +** set functions (stack -> Lua) +*/ +LUA_API void (lua_settable) (lua_State *L, int idx); +LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); +LUA_API void (lua_rawset) (lua_State *L, int idx); +LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); +LUA_API int (lua_setmetatable) (lua_State *L, int objindex); +LUA_API int (lua_setfenv) (lua_State *L, int idx); + + +/* +** `load' and `call' functions (load and run Lua code) +*/ +LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); +LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); +LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); +LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, + const char *chunkname); + +LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); + + +/* +** coroutine functions +*/ +LUA_API int (lua_yield) (lua_State *L, int nresults); +LUA_API int (lua_resume) (lua_State *L, int narg); +LUA_API int (lua_status) (lua_State *L); + +/* +** garbage-collection function and options +*/ + +#define LUA_GCSTOP 0 +#define LUA_GCRESTART 1 +#define LUA_GCCOLLECT 2 +#define LUA_GCCOUNT 3 +#define LUA_GCCOUNTB 4 +#define LUA_GCSTEP 5 +#define LUA_GCSETPAUSE 6 +#define LUA_GCSETSTEPMUL 7 + +LUA_API int (lua_gc) (lua_State *L, int what, int data); + + +/* +** miscellaneous functions +*/ + +LUA_API int (lua_error) (lua_State *L); + +LUA_API int (lua_next) (lua_State *L, int idx); + +LUA_API void (lua_concat) (lua_State *L, int n); + +LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); +LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); + + + +/* +** =============================================================== +** some useful macros +** =============================================================== +*/ + +#define lua_pop(L,n) lua_settop(L, -(n)-1) + +#define lua_newtable(L) lua_createtable(L, 0, 0) + +#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) + +#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) + +#define lua_strlen(L,i) lua_objlen(L, (i)) + +#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) +#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) +#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) +#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) +#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) +#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) +#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) +#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) + +#define lua_pushliteral(L, s) \ + lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) + +#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) +#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) + +#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) + + + +/* +** compatibility macros and functions +*/ + +#define lua_open() luaL_newstate() + +#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) + +#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) + +#define lua_Chunkreader lua_Reader +#define lua_Chunkwriter lua_Writer + + +/* hack */ +LUA_API void lua_setlevel (lua_State *from, lua_State *to); + + +/* +** {====================================================================== +** Debug API +** ======================================================================= +*/ + + +/* +** Event codes +*/ +#define LUA_HOOKCALL 0 +#define LUA_HOOKRET 1 +#define LUA_HOOKLINE 2 +#define LUA_HOOKCOUNT 3 +#define LUA_HOOKTAILRET 4 + + +/* +** Event masks +*/ +#define LUA_MASKCALL (1 << LUA_HOOKCALL) +#define LUA_MASKRET (1 << LUA_HOOKRET) +#define LUA_MASKLINE (1 << LUA_HOOKLINE) +#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) + +typedef struct lua_Debug lua_Debug; /* activation record */ + + +/* Functions to be called by the debuger in specific events */ +typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); + + +LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); +LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); +LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); +LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); +LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n); +LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n); + +LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); +LUA_API lua_Hook lua_gethook (lua_State *L); +LUA_API int lua_gethookmask (lua_State *L); +LUA_API int lua_gethookcount (lua_State *L); + + +struct lua_Debug { + int event; + const char *name; /* (n) */ + const char *namewhat; /* (n) `global', `local', `field', `method' */ + const char *what; /* (S) `Lua', `C', `main', `tail' */ + const char *source; /* (S) */ + int currentline; /* (l) */ + int nups; /* (u) number of upvalues */ + int linedefined; /* (S) */ + int lastlinedefined; /* (S) */ + char short_src[LUA_IDSIZE]; /* (S) */ + /* private part */ + int i_ci; /* active function */ +}; + +/* }====================================================================== */ + + +/****************************************************************************** +* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. +* +* Permission is hereby granted, free of charge, to any person obtaining +* a copy of this software and associated documentation files (the +* "Software"), to deal in the Software without restriction, including +* without limitation the rights to use, copy, modify, merge, publish, +* distribute, sublicense, and/or sell copies of the Software, and to +* permit persons to whom the Software is furnished to do so, subject to +* the following conditions: +* +* The above copyright notice and this permission notice shall be +* included in all copies or substantial portions of the Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +******************************************************************************/ + + +#endif diff --git a/script/lua/luaconf.h b/script/lua/luaconf.h new file mode 100644 index 000000000..c7f73c3c8 --- /dev/null +++ b/script/lua/luaconf.h @@ -0,0 +1,811 @@ +/* +** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $ +** Configuration file for Lua +** See Copyright Notice in lua.h +*/ + + +#ifndef lconfig_h +#define lconfig_h + +#if 0 +#include +#include +#endif + +#include "grub_lua.h" + +/* +** ================================================================== +** Search for "@@" to find all configurable definitions. +** =================================================================== +*/ + + +/* +@@ LUA_ANSI controls the use of non-ansi features. +** CHANGE it (define it) if you want Lua to avoid the use of any +** non-ansi feature or library. +*/ +#if defined(__STRICT_ANSI__) +#define LUA_ANSI +#endif + + +#if !defined(LUA_ANSI) && defined(_WIN32) +#define LUA_WIN +#endif + +#if defined(LUA_USE_LINUX) +#define LUA_USE_POSIX +#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ +#define LUA_USE_READLINE /* needs some extra libraries */ +#endif + +#if defined(LUA_USE_MACOSX) +#define LUA_USE_POSIX +#define LUA_DL_DYLD /* does not need extra library */ +#endif + + + +/* +@@ LUA_USE_POSIX includes all functionallity listed as X/Open System +@* Interfaces Extension (XSI). +** CHANGE it (define it) if your system is XSI compatible. +*/ +#if 0 +#if defined(LUA_USE_POSIX) +#define LUA_USE_MKSTEMP +#define LUA_USE_ISATTY +#define LUA_USE_POPEN +#define LUA_USE_ULONGJMP +#endif +#endif + +/* +@@ LUA_PATH and LUA_CPATH are the names of the environment variables that +@* Lua check to set its paths. +@@ LUA_INIT is the name of the environment variable that Lua +@* checks for initialization code. +** CHANGE them if you want different names. +*/ +#define LUA_PATH "LUA_PATH" +#define LUA_CPATH "LUA_CPATH" +#define LUA_INIT "LUA_INIT" + + +/* +@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for +@* Lua libraries. +@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for +@* C libraries. +** CHANGE them if your machine has a non-conventional directory +** hierarchy or if you want to install your libraries in +** non-conventional directories. +*/ +#if defined(_WIN32) +/* +** In Windows, any exclamation mark ('!') in the path is replaced by the +** path of the directory of the executable file of the current process. +*/ +#define LUA_LDIR "!\\lua\\" +#define LUA_CDIR "!\\" +#define LUA_PATH_DEFAULT \ + ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua" +#define LUA_CPATH_DEFAULT \ + ".\\?.dll;" ".\\?51.dll;" LUA_CDIR"?.dll;" LUA_CDIR"?51.dll;" LUA_CDIR"clibs\\?.dll;" LUA_CDIR"clibs\\?51.dll;" LUA_CDIR"loadall.dll;" LUA_CDIR"clibs\\loadall.dll" + +#else +#define LUA_ROOT "/usr/local/" +#define LUA_LDIR LUA_ROOT "share/lua/5.1/" +#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" +#define LUA_PATH_DEFAULT \ + "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ + LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" +#define LUA_CPATH_DEFAULT \ + "./?.so;" "./lib?51.so;" LUA_CDIR"?.so;" LUA_CDIR"lib?51.so;" LUA_CDIR"loadall.so" +#endif + + +/* +@@ LUA_DIRSEP is the directory separator (for submodules). +** CHANGE it if your machine does not use "/" as the directory separator +** and is not Windows. (On Windows Lua automatically uses "\".) +*/ +#if defined(_WIN32) +#define LUA_DIRSEP "\\" +#else +#define LUA_DIRSEP "/" +#endif + + +/* +@@ LUA_PATHSEP is the character that separates templates in a path. +@@ LUA_PATH_MARK is the string that marks the substitution points in a +@* template. +@@ LUA_EXECDIR in a Windows path is replaced by the executable's +@* directory. +@@ LUA_IGMARK is a mark to ignore all before it when bulding the +@* luaopen_ function name. +** CHANGE them if for some reason your system cannot use those +** characters. (E.g., if one of those characters is a common character +** in file/directory names.) Probably you do not need to change them. +*/ +#define LUA_PATHSEP ";" +#define LUA_PATH_MARK "?" +#define LUA_EXECDIR "!" +#define LUA_IGMARK "-" + + +/* +@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger. +** CHANGE that if ptrdiff_t is not adequate on your machine. (On most +** machines, ptrdiff_t gives a good choice between int or long.) +*/ +#define LUA_INTEGER ptrdiff_t + + +/* +@@ LUA_API is a mark for all core API functions. +@@ LUALIB_API is a mark for all standard library functions. +** CHANGE them if you need to define those functions in some special way. +** For instance, if you want to create one Windows DLL with the core and +** the libraries, you may want to use the following definition (define +** LUA_BUILD_AS_DLL to get it). +*/ +#if defined(LUA_BUILD_AS_DLL) + +#if defined(LUA_CORE) || defined(LUA_LIB) +#define LUA_API __declspec(dllexport) +#else +#define LUA_API __declspec(dllimport) +#endif + +#else + +#define LUA_API extern + +#endif + +/* more often than not the libs go together with the core */ +#define LUALIB_API LUA_API + + +/* +@@ LUAI_FUNC is a mark for all extern functions that are not to be +@* exported to outside modules. +@@ LUAI_DATA is a mark for all extern (const) variables that are not to +@* be exported to outside modules. +** CHANGE them if you need to mark them in some special way. Elf/gcc +** (versions 3.2 and later) mark them as "hidden" to optimize access +** when Lua is compiled as a shared library. +*/ +#if defined(luaall_c) +#define LUAI_FUNC static +#define LUAI_DATA /* empty */ + +#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ + defined(__ELF__) +#define LUAI_FUNC __attribute__((visibility("hidden"))) extern +#define LUAI_DATA LUAI_FUNC + +#else +#define LUAI_FUNC extern +#define LUAI_DATA extern +#endif + + + +/* +@@ LUA_QL describes how error messages quote program elements. +** CHANGE it if you want a different appearance. +*/ +#define LUA_QL(x) "'" x "'" +#define LUA_QS LUA_QL("%s") + + +/* +@@ LUA_IDSIZE gives the maximum size for the description of the source +@* of a function in debug information. +** CHANGE it if you want a different size. +*/ +#define LUA_IDSIZE 60 + + +/* +** {================================================================== +** Stand-alone configuration +** =================================================================== +*/ + +#if defined(lua_c) || defined(luaall_c) + +/* +@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that +@* is, whether we're running lua interactively). +** CHANGE it if you have a better definition for non-POSIX/non-Windows +** systems. +*/ +#if defined(LUA_USE_ISATTY) +#include +#define lua_stdin_is_tty() isatty(0) +#elif defined(LUA_WIN) +#include +#include +#define lua_stdin_is_tty() _isatty(_fileno(stdin)) +#else +#define lua_stdin_is_tty() 1 /* assume stdin is a tty */ +#endif + + +/* +@@ LUA_PROMPT is the default prompt used by stand-alone Lua. +@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua. +** CHANGE them if you want different prompts. (You can also change the +** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.) +*/ +#define LUA_PROMPT "> " +#define LUA_PROMPT2 ">> " + + +/* +@@ LUA_PROGNAME is the default name for the stand-alone Lua program. +** CHANGE it if your stand-alone interpreter has a different name and +** your system is not able to detect that name automatically. +*/ +#define LUA_PROGNAME "lua" + + +/* +@@ LUA_MAXINPUT is the maximum length for an input line in the +@* stand-alone interpreter. +** CHANGE it if you need longer lines. +*/ +#define LUA_MAXINPUT 512 + + +/* +@@ lua_readline defines how to show a prompt and then read a line from +@* the standard input. +@@ lua_saveline defines how to "save" a read line in a "history". +@@ lua_freeline defines how to free a line read by lua_readline. +** CHANGE them if you want to improve this functionality (e.g., by using +** GNU readline and history facilities). +*/ +#if defined(LUA_USE_READLINE) +#include +#include +#include +#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) +#define lua_saveline(L,idx) \ + if (lua_strlen(L,idx) > 0) /* non-empty line? */ \ + add_history(lua_tostring(L, idx)); /* add it to history */ +#define lua_freeline(L,b) ((void)L, free(b)) +#else +#define lua_readline(L,b,p) \ + ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ + fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ +#define lua_saveline(L,idx) { (void)L; (void)idx; } +#define lua_freeline(L,b) { (void)L; (void)b; } +#endif + +#endif + +/* }================================================================== */ + + +/* +@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles +@* as a percentage. +** CHANGE it if you want the GC to run faster or slower (higher values +** mean larger pauses which mean slower collection.) You can also change +** this value dynamically. +*/ +#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */ + + +/* +@@ LUAI_GCMUL defines the default speed of garbage collection relative to +@* memory allocation as a percentage. +** CHANGE it if you want to change the granularity of the garbage +** collection. (Higher values mean coarser collections. 0 represents +** infinity, where each step performs a full collection.) You can also +** change this value dynamically. +*/ +#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ + + + +/* +@@ LUA_COMPAT_GETN controls compatibility with old getn behavior. +** CHANGE it (define it) if you want exact compatibility with the +** behavior of setn/getn in Lua 5.0. +*/ +#undef LUA_COMPAT_GETN + +/* +@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib. +** CHANGE it to undefined as soon as you do not need a global 'loadlib' +** function (the function is still available as 'package.loadlib'). +*/ +#undef LUA_COMPAT_LOADLIB + +/* +@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature. +** CHANGE it to undefined as soon as your programs use only '...' to +** access vararg parameters (instead of the old 'arg' table). +*/ +#define LUA_COMPAT_VARARG + +/* +@@ LUA_COMPAT_MOD controls compatibility with old math.mod function. +** CHANGE it to undefined as soon as your programs use 'math.fmod' or +** the new '%' operator instead of 'math.mod'. +*/ +#define LUA_COMPAT_MOD + +/* +@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting +@* facility. +** CHANGE it to 2 if you want the old behaviour, or undefine it to turn +** off the advisory error when nesting [[...]]. +*/ +#define LUA_COMPAT_LSTR 1 + +/* +@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name. +** CHANGE it to undefined as soon as you rename 'string.gfind' to +** 'string.gmatch'. +*/ +#define LUA_COMPAT_GFIND + +/* +@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib' +@* behavior. +** CHANGE it to undefined as soon as you replace to 'luaL_register' +** your uses of 'luaL_openlib' +*/ +#define LUA_COMPAT_OPENLIB + + + +/* +@@ luai_apicheck is the assert macro used by the Lua-C API. +** CHANGE luai_apicheck if you want Lua to perform some checks in the +** parameters it gets from API calls. This may slow down the interpreter +** a bit, but may be quite useful when debugging C code that interfaces +** with Lua. A useful redefinition is to use assert.h. +*/ +#if defined(LUA_USE_APICHECK) +#include +#define luai_apicheck(L,o) { (void)L; assert(o); } +#else +#define luai_apicheck(L,o) { (void)L; } +#endif + + +/* +@@ LUAI_BITSINT defines the number of bits in an int. +** CHANGE here if Lua cannot automatically detect the number of bits of +** your machine. Probably you do not need to change this. +*/ +/* avoid overflows in comparison */ +#if INT_MAX-20 < 32760 +#define LUAI_BITSINT 16 +#elif INT_MAX > 2147483640L +/* int has at least 32 bits */ +#define LUAI_BITSINT 32 +#else +#error "you must define LUA_BITSINT with number of bits in an integer" +#endif + + +/* +@@ LUAI_UINT32 is an unsigned integer with at least 32 bits. +@@ LUAI_INT32 is an signed integer with at least 32 bits. +@@ LUAI_UMEM is an unsigned integer big enough to count the total +@* memory used by Lua. +@@ LUAI_MEM is a signed integer big enough to count the total memory +@* used by Lua. +** CHANGE here if for some weird reason the default definitions are not +** good enough for your machine. (The definitions in the 'else' +** part always works, but may waste space on machines with 64-bit +** longs.) Probably you do not need to change this. +*/ +#if LUAI_BITSINT >= 32 +#define LUAI_UINT32 unsigned int +#define LUAI_INT32 int +#define LUAI_MAXINT32 INT_MAX +#define LUAI_UMEM size_t +#define LUAI_MEM ptrdiff_t +#else +/* 16-bit ints */ +#define LUAI_UINT32 unsigned long +#define LUAI_INT32 long +#define LUAI_MAXINT32 LONG_MAX +#define LUAI_UMEM unsigned long +#define LUAI_MEM long +#endif + + +/* +@@ LUAI_MAXCALLS limits the number of nested calls. +** CHANGE it if you need really deep recursive calls. This limit is +** arbitrary; its only purpose is to stop infinite recursion before +** exhausting memory. +*/ +#define LUAI_MAXCALLS 20000 + + +/* +@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function +@* can use. +** CHANGE it if you need lots of (Lua) stack space for your C +** functions. This limit is arbitrary; its only purpose is to stop C +** functions to consume unlimited stack space. (must be smaller than +** -LUA_REGISTRYINDEX) +*/ +#define LUAI_MAXCSTACK 8000 + + + +/* +** {================================================================== +** CHANGE (to smaller values) the following definitions if your system +** has a small C stack. (Or you may want to change them to larger +** values if your system has a large C stack and these limits are +** too rigid for you.) Some of these constants control the size of +** stack-allocated arrays used by the compiler or the interpreter, while +** others limit the maximum number of recursive calls that the compiler +** or the interpreter can perform. Values too large may cause a C stack +** overflow for some forms of deep constructs. +** =================================================================== +*/ + + +/* +@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and +@* syntactical nested non-terminals in a program. +*/ +#define LUAI_MAXCCALLS 200 + + +/* +@@ LUAI_MAXVARS is the maximum number of local variables per function +@* (must be smaller than 250). +*/ +#define LUAI_MAXVARS 200 + + +/* +@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function +@* (must be smaller than 250). +*/ +#define LUAI_MAXUPVALUES 60 + + +/* +@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. +*/ +#if 0 +#define LUAL_BUFFERSIZE BUFSIZ +#else +#define LUAL_BUFFERSIZE 512 +#endif + +/* }================================================================== */ + + + + +/* +** {================================================================== +@@ LUA_NUMBER is the type of numbers in Lua. +** CHANGE the following definitions only if you want to build Lua +** with a number type different from double. You may also need to +** change lua_number2int & lua_number2integer. +** =================================================================== +*/ + +#if 0 +#define LUA_NUMBER_DOUBLE +#define LUA_NUMBER double + +/* +@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' +@* over a number. +*/ +#define LUAI_UACNUMBER double +#else + +#define LUA_NUMBER int +#define LUAI_UACNUMBER int + +#endif + +/* +@@ LUA_NUMBER_SCAN is the format for reading numbers. +@@ LUA_NUMBER_FMT is the format for writing numbers. +@@ lua_number2str converts a number to a string. +@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion. +@@ lua_str2number converts a string to a number. +*/ +#if 0 +#define LUA_NUMBER_SCAN "%lf" +#define LUA_NUMBER_FMT "%.14g" +#else +#define LUA_NUMBER_SCAN "%d" +#define LUA_NUMBER_FMT "%d" +#endif +#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) +#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ +#define lua_str2number(s,p) strtod((s), (p)) + + +/* +@@ The luai_num* macros define the primitive operations over numbers. +*/ +#if defined(LUA_CORE) +#if 0 +#include +#endif +#define luai_numadd(a,b) ((a)+(b)) +#define luai_numsub(a,b) ((a)-(b)) +#define luai_nummul(a,b) ((a)*(b)) +#define luai_numdiv(a,b) ((a)/(b)) +#if 0 +#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) +#define luai_numpow(a,b) (pow(a,b)) +#else + +#define luai_nummod(a,b) ((a) % (b)) + +static inline LUA_NUMBER +luai_numpow (LUA_NUMBER a, LUA_NUMBER b) +{ + LUA_NUMBER c; + + c = 1; + while (b > 0) + { + c *= a; + b--; + } + + return c; +} + +#endif +#define luai_numunm(a) (-(a)) +#define luai_numeq(a,b) ((a)==(b)) +#define luai_numlt(a,b) ((a)<(b)) +#define luai_numle(a,b) ((a)<=(b)) +#define luai_numisnan(a) (!luai_numeq((a), (a))) +#endif + + +/* +@@ lua_number2int is a macro to convert lua_Number to int. +@@ lua_number2integer is a macro to convert lua_Number to lua_Integer. +** CHANGE them if you know a faster way to convert a lua_Number to +** int (with any rounding method and without throwing errors) in your +** system. In Pentium machines, a naive typecast from double to int +** in C is extremely slow, so any alternative is worth trying. +*/ + +#if 0 +/* On a Pentium, resort to a trick */ +#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \ + (defined(__i386) || defined (_M_IX86) || defined(__i386__)) + +/* On a Microsoft compiler, use assembler */ +#if defined(_MSC_VER) + +#define lua_number2int(i,d) __asm fld d __asm fistp i +#define lua_number2integer(i,n) lua_number2int(i, n) + +/* the next trick should work on any Pentium, but sometimes clashes + with a DirectX idiosyncrasy */ +#else + +union luai_Cast { double l_d; long l_l; }; +#define lua_number2int(i,d) \ + { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; } +#define lua_number2integer(i,n) lua_number2int(i, n) + +#endif + + +/* this option always works, but may be slow */ +#else +#define lua_number2int(i,d) ((i)=(int)(d)) +#define lua_number2integer(i,d) ((i)=(lua_Integer)(d)) + +#endif + +#else +#define lua_number2int(i,d) ((i)=(int)(d)) +#define lua_number2integer(i,d) ((i)=(lua_Integer)(d)) +#endif + +/* }================================================================== */ + + +/* +@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. +** CHANGE it if your system requires alignments larger than double. (For +** instance, if your system supports long doubles and they must be +** aligned in 16-byte boundaries, then you should add long double in the +** union.) Probably you do not need to change this. +*/ +#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } + + +/* +@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling. +** CHANGE them if you prefer to use longjmp/setjmp even with C++ +** or if want/don't to use _longjmp/_setjmp instead of regular +** longjmp/setjmp. By default, Lua handles errors with exceptions when +** compiling as C++ code, with _longjmp/_setjmp when asked to use them, +** and with longjmp/setjmp otherwise. +*/ +#if defined(__cplusplus) +/* C++ exceptions */ +#define LUAI_THROW(L,c) throw(c) +#define LUAI_TRY(L,c,a) try { a } catch(...) \ + { if ((c)->status == 0) (c)->status = -1; } +#define luai_jmpbuf int /* dummy variable */ + +#elif defined(LUA_USE_ULONGJMP) +/* in Unix, try _longjmp/_setjmp (more efficient) */ +#define LUAI_THROW(L,c) _longjmp((c)->b, 1) +#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } +#define luai_jmpbuf jmp_buf + +#else +/* default handling with long jumps */ +#define LUAI_THROW(L,c) longjmp((c)->b, 1) +#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } +#define luai_jmpbuf jmp_buf + +#endif + + +/* +@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern +@* can do during pattern-matching. +** CHANGE it if you need more captures. This limit is arbitrary. +*/ +#define LUA_MAXCAPTURES 32 + + +/* +@@ lua_tmpnam is the function that the OS library uses to create a +@* temporary name. +@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam. +** CHANGE them if you have an alternative to tmpnam (which is considered +** insecure) or if you want the original tmpnam anyway. By default, Lua +** uses tmpnam except when POSIX is available, where it uses mkstemp. +*/ +#if defined(loslib_c) || defined(luaall_c) + +#if defined(LUA_USE_MKSTEMP) +#include +#define LUA_TMPNAMBUFSIZE 32 +#define lua_tmpnam(b,e) { \ + strcpy(b, "/tmp/lua_XXXXXX"); \ + e = mkstemp(b); \ + if (e != -1) close(e); \ + e = (e == -1); } + +#else +#define LUA_TMPNAMBUFSIZE L_tmpnam +#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } +#endif + +#endif + + +/* +@@ lua_popen spawns a new process connected to the current one through +@* the file streams. +** CHANGE it if you have a way to implement it in your system. +*/ +#if defined(LUA_USE_POPEN) + +#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) +#define lua_pclose(L,file) ((void)L, (pclose(file) != -1)) + +#elif defined(LUA_WIN) + +#define lua_popen(L,c,m) ((void)L, _popen(c,m)) +#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1)) + +#else + +#define lua_popen(L,c,m) ((void)((void)c, m), \ + luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) +#define lua_pclose(L,file) ((void)((void)L, file), 0) + +#endif + +/* +@@ LUA_DL_* define which dynamic-library system Lua should use. +** CHANGE here if Lua has problems choosing the appropriate +** dynamic-library system for your platform (either Windows' DLL, Mac's +** dyld, or Unix's dlopen). If your system is some kind of Unix, there +** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for +** it. To use dlopen you also need to adapt the src/Makefile (probably +** adding -ldl to the linker options), so Lua does not select it +** automatically. (When you change the makefile to add -ldl, you must +** also add -DLUA_USE_DLOPEN.) +** If you do not want any kind of dynamic library, undefine all these +** options. +** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD. +*/ +#if 0 +#if defined(LUA_USE_DLOPEN) +#define LUA_DL_DLOPEN +#endif + +#if defined(LUA_WIN) +#define LUA_DL_DLL +#endif +#endif + +/* +@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State +@* (the data goes just *before* the lua_State pointer). +** CHANGE (define) this if you really need that. This value must be +** a multiple of the maximum alignment required for your machine. +*/ +#define LUAI_EXTRASPACE 0 + + +/* +@@ luai_userstate* allow user-specific actions on threads. +** CHANGE them if you defined LUAI_EXTRASPACE and need to do something +** extra when a thread is created/deleted/resumed/yielded. +*/ +#define luai_userstateopen(L) ((void)L) +#define luai_userstateclose(L) ((void)L) +#define luai_userstatethread(L,L1) ((void)L) +#define luai_userstatefree(L) ((void)L) +#define luai_userstateresume(L,n) ((void)L) +#define luai_userstateyield(L,n) ((void)L) + + +/* +@@ LUA_INTFRMLEN is the length modifier for integer conversions +@* in 'string.format'. +@@ LUA_INTFRM_T is the integer type correspoding to the previous length +@* modifier. +** CHANGE them if your system supports long long or does not support long. +*/ + +#if defined(LUA_USELONGLONG) + +#define LUA_INTFRMLEN "ll" +#define LUA_INTFRM_T long long + +#else + +#define LUA_INTFRMLEN "l" +#define LUA_INTFRM_T long + +#endif + + + +/* =================================================================== */ + +/* +** Local configuration. You can use this space to add your redefinitions +** without modifying the main part of the file. +*/ + + + +#endif diff --git a/script/lua/lualib.h b/script/lua/lualib.h new file mode 100644 index 000000000..e9ff9ba97 --- /dev/null +++ b/script/lua/lualib.h @@ -0,0 +1,53 @@ +/* +** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua standard libraries +** See Copyright Notice in lua.h +*/ + + +#ifndef lualib_h +#define lualib_h + +#include "lua.h" + + +/* Key to file-handle type */ +#define LUA_FILEHANDLE "FILE*" + + +#define LUA_COLIBNAME "coroutine" +LUALIB_API int (luaopen_base) (lua_State *L); + +#define LUA_TABLIBNAME "table" +LUALIB_API int (luaopen_table) (lua_State *L); + +#define LUA_IOLIBNAME "io" +LUALIB_API int (luaopen_io) (lua_State *L); + +#define LUA_OSLIBNAME "os" +LUALIB_API int (luaopen_os) (lua_State *L); + +#define LUA_STRLIBNAME "string" +LUALIB_API int (luaopen_string) (lua_State *L); + +#define LUA_MATHLIBNAME "math" +LUALIB_API int (luaopen_math) (lua_State *L); + +#define LUA_DBLIBNAME "debug" +LUALIB_API int (luaopen_debug) (lua_State *L); + +#define LUA_LOADLIBNAME "package" +LUALIB_API int (luaopen_package) (lua_State *L); + + +/* open all previous libraries */ +LUALIB_API void (luaL_openlibs) (lua_State *L); + + + +#ifndef lua_assert +#define lua_assert(x) ((void)0) +#endif + + +#endif diff --git a/script/lua/lundump.c b/script/lua/lundump.c new file mode 100644 index 000000000..637d84237 --- /dev/null +++ b/script/lua/lundump.c @@ -0,0 +1,229 @@ +/* +** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $ +** load precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#endif + +#define lundump_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lmem.h" +#include "lobject.h" +#include "lstring.h" +#include "lundump.h" +#include "lzio.h" + +typedef struct { + lua_State* L; + ZIO* Z; + Mbuffer* b; + const char* name; +} LoadState; + +#ifdef LUAC_TRUST_BINARIES +#define IF(c,s) +#define error(S,s) +#else +#define IF(c,s) if (c) error(S,s) + +static void error(LoadState* S, const char* why) +{ + luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why); + luaD_throw(S->L,LUA_ERRSYNTAX); +} +#endif + +#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) +#define LoadByte(S) (lu_byte)LoadChar(S) +#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) +#define LoadVector(S,b,n,size) LoadMem(S,b,n,size) + +static void LoadBlock(LoadState* S, void* b, size_t size) +{ + size_t r=luaZ_read(S->Z,b,size); + IF (r!=0, "unexpected end"); +} + +static int LoadChar(LoadState* S) +{ + char x; + LoadVar(S,x); + return x; +} + +static int LoadInt(LoadState* S) +{ + int x; + LoadVar(S,x); + IF (x<0, "bad integer"); + return x; +} + +static lua_Number LoadNumber(LoadState* S) +{ + lua_Number x; + LoadVar(S,x); + return x; +} + +static TString* LoadString(LoadState* S) +{ + size_t size; + LoadVar(S,size); + if (size==0) + return NULL; + else + { + char* s=luaZ_openspace(S->L,S->b,size); + LoadBlock(S,s,size); + return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ + } +} + +static void LoadCode(LoadState* S, Proto* f) +{ + int n=LoadInt(S); + f->code=luaM_newvector(S->L,n,Instruction); + f->sizecode=n; + LoadVector(S,f->code,n,sizeof(Instruction)); +} + +static Proto* LoadFunction(LoadState* S, TString* p); + +static void LoadConstants(LoadState* S, Proto* f) +{ + int i,n; + n=LoadInt(S); + f->k=luaM_newvector(S->L,n,TValue); + f->sizek=n; + for (i=0; ik[i]); + for (i=0; ik[i]; + int t=LoadChar(S); + switch (t) + { + case LUA_TNIL: + setnilvalue(o); + break; + case LUA_TBOOLEAN: + setbvalue(o,LoadChar(S)!=0); + break; + case LUA_TNUMBER: + setnvalue(o,LoadNumber(S)); + break; + case LUA_TSTRING: + setsvalue2n(S->L,o,LoadString(S)); + break; + default: + error(S,"bad constant"); + break; + } + } + n=LoadInt(S); + f->p=luaM_newvector(S->L,n,Proto*); + f->sizep=n; + for (i=0; ip[i]=NULL; + for (i=0; ip[i]=LoadFunction(S,f->source); +} + +static void LoadDebug(LoadState* S, Proto* f) +{ + int i,n; + n=LoadInt(S); + f->lineinfo=luaM_newvector(S->L,n,int); + f->sizelineinfo=n; + LoadVector(S,f->lineinfo,n,sizeof(int)); + n=LoadInt(S); + f->locvars=luaM_newvector(S->L,n,LocVar); + f->sizelocvars=n; + for (i=0; ilocvars[i].varname=NULL; + for (i=0; ilocvars[i].varname=LoadString(S); + f->locvars[i].startpc=LoadInt(S); + f->locvars[i].endpc=LoadInt(S); + } + n=LoadInt(S); + f->upvalues=luaM_newvector(S->L,n,TString*); + f->sizeupvalues=n; + for (i=0; iupvalues[i]=NULL; + for (i=0; iupvalues[i]=LoadString(S); +} + +static Proto* LoadFunction(LoadState* S, TString* p) +{ + Proto* f; + if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep"); + f=luaF_newproto(S->L); + setptvalue2s(S->L,S->L->top,f); incr_top(S->L); + f->source=LoadString(S); if (f->source==NULL) f->source=p; + f->linedefined=LoadInt(S); + f->lastlinedefined=LoadInt(S); + f->nups=LoadByte(S); + f->numparams=LoadByte(S); + f->is_vararg=LoadByte(S); + f->maxstacksize=LoadByte(S); + LoadCode(S,f); + LoadConstants(S,f); + LoadDebug(S,f); + IF (!luaG_checkcode(f), "bad code"); + S->L->top--; + S->L->nCcalls--; + return f; +} + +static void LoadHeader(LoadState* S) +{ + char h[LUAC_HEADERSIZE]; + char s[LUAC_HEADERSIZE]; + luaU_header(h); + LoadBlock(S,s,LUAC_HEADERSIZE); + IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header"); +} + +/* +** load precompiled chunk +*/ +Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) +{ + LoadState S; + if (*name=='@' || *name=='=') + S.name=name+1; + else if (*name==LUA_SIGNATURE[0]) + S.name="binary string"; + else + S.name=name; + S.L=L; + S.Z=Z; + S.b=buff; + LoadHeader(&S); + return LoadFunction(&S,luaS_newliteral(L,"=?")); +} + +/* +* make header +*/ +void luaU_header (char* h) +{ + int x=1; + memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); + h+=sizeof(LUA_SIGNATURE)-1; + *h++=(char)LUAC_VERSION; + *h++=(char)LUAC_FORMAT; + *h++=(char)*(char*)&x; /* endianness */ + *h++=(char)sizeof(int); + *h++=(char)sizeof(size_t); + *h++=(char)sizeof(Instruction); + *h++=(char)sizeof(lua_Number); + *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */ +} diff --git a/script/lua/lundump.h b/script/lua/lundump.h new file mode 100644 index 000000000..c80189dbf --- /dev/null +++ b/script/lua/lundump.h @@ -0,0 +1,36 @@ +/* +** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ +** load precompiled Lua chunks +** See Copyright Notice in lua.h +*/ + +#ifndef lundump_h +#define lundump_h + +#include "lobject.h" +#include "lzio.h" + +/* load one chunk; from lundump.c */ +LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); + +/* make header; from lundump.c */ +LUAI_FUNC void luaU_header (char* h); + +/* dump one chunk; from ldump.c */ +LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); + +#ifdef luac_c +/* print one chunk; from print.c */ +LUAI_FUNC void luaU_print (const Proto* f, int full); +#endif + +/* for header of binary files -- this is Lua 5.1 */ +#define LUAC_VERSION 0x51 + +/* for header of binary files -- this is the official format */ +#define LUAC_FORMAT 0 + +/* size of header of binary files */ +#define LUAC_HEADERSIZE 12 + +#endif diff --git a/script/lua/lvm.c b/script/lua/lvm.c new file mode 100644 index 000000000..0ff1fa048 --- /dev/null +++ b/script/lua/lvm.c @@ -0,0 +1,764 @@ +/* +** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $ +** Lua virtual machine +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#include +#include +#endif + +#define lvm_c +#define LUA_CORE + +#include "lua.h" + +#include "ldebug.h" +#include "ldo.h" +#include "lfunc.h" +#include "lgc.h" +#include "lobject.h" +#include "lopcodes.h" +#include "lstate.h" +#include "lstring.h" +#include "ltable.h" +#include "ltm.h" +#include "lvm.h" + + + +/* limit for table tag-method chains (to avoid loops) */ +#define MAXTAGLOOP 100 + + +const TValue *luaV_tonumber (const TValue *obj, TValue *n) { + lua_Number num; + if (ttisnumber(obj)) return obj; + if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) { + setnvalue(n, num); + return n; + } + else + return NULL; +} + + +int luaV_tostring (lua_State *L, StkId obj) { + if (!ttisnumber(obj)) + return 0; + else { + char s[LUAI_MAXNUMBER2STR]; + lua_Number n = nvalue(obj); + lua_number2str(s, n); + setsvalue2s(L, obj, luaS_new(L, s)); + return 1; + } +} + + +static void traceexec (lua_State *L, const Instruction *pc) { + lu_byte mask = L->hookmask; + const Instruction *oldpc = L->savedpc; + L->savedpc = pc; + if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { + resethookcount(L); + luaD_callhook(L, LUA_HOOKCOUNT, -1); + } + if (mask & LUA_MASKLINE) { + Proto *p = ci_func(L->ci)->l.p; + int npc = pcRel(pc, p); + int newline = getline(p, npc); + /* call linehook when enter a new function, when jump back (loop), + or when enter a new line */ + if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) + luaD_callhook(L, LUA_HOOKLINE, newline); + } +} + + +static void callTMres (lua_State *L, StkId res, const TValue *f, + const TValue *p1, const TValue *p2) { + ptrdiff_t result = savestack(L, res); + setobj2s(L, L->top, f); /* push function */ + setobj2s(L, L->top+1, p1); /* 1st argument */ + setobj2s(L, L->top+2, p2); /* 2nd argument */ + luaD_checkstack(L, 3); + L->top += 3; + luaD_call(L, L->top - 3, 1); + res = restorestack(L, result); + L->top--; + setobjs2s(L, res, L->top); +} + + + +static void callTM (lua_State *L, const TValue *f, const TValue *p1, + const TValue *p2, const TValue *p3) { + setobj2s(L, L->top, f); /* push function */ + setobj2s(L, L->top+1, p1); /* 1st argument */ + setobj2s(L, L->top+2, p2); /* 2nd argument */ + setobj2s(L, L->top+3, p3); /* 3th argument */ + luaD_checkstack(L, 4); + L->top += 4; + luaD_call(L, L->top - 4, 0); +} + + +void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { + int loop; + for (loop = 0; loop < MAXTAGLOOP; loop++) { + const TValue *tm; + if (ttistable(t)) { /* `t' is a table? */ + Table *h = hvalue(t); + const TValue *res = luaH_get(h, key); /* do a primitive get */ + if (!ttisnil(res) || /* result is no nil? */ + (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ + setobj2s(L, val, res); + return; + } + /* else will try the tag method */ + } + else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) + luaG_typeerror(L, t, "index"); + if (ttisfunction(tm)) { + callTMres(L, val, tm, t, key); + return; + } + t = tm; /* else repeat with `tm' */ + } + luaG_runerror(L, "loop in gettable"); +} + + +void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { + int loop; + for (loop = 0; loop < MAXTAGLOOP; loop++) { + const TValue *tm; + if (ttistable(t)) { /* `t' is a table? */ + Table *h = hvalue(t); + TValue *oldval = luaH_set(L, h, key); /* do a primitive set */ + if (!ttisnil(oldval) || /* result is no nil? */ + (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ + setobj2t(L, oldval, val); + luaC_barriert(L, h, val); + return; + } + /* else will try the tag method */ + } + else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) + luaG_typeerror(L, t, "index"); + if (ttisfunction(tm)) { + callTM(L, tm, t, key, val); + return; + } + t = tm; /* else repeat with `tm' */ + } + luaG_runerror(L, "loop in settable"); +} + + +static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, + StkId res, TMS event) { + const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ + if (ttisnil(tm)) + tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ + if (ttisnil(tm)) return 0; + callTMres(L, res, tm, p1, p2); + return 1; +} + + +static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2, + TMS event) { + const TValue *tm1 = fasttm(L, mt1, event); + const TValue *tm2; + if (tm1 == NULL) return NULL; /* no metamethod */ + if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ + tm2 = fasttm(L, mt2, event); + if (tm2 == NULL) return NULL; /* no metamethod */ + if (luaO_rawequalObj(tm1, tm2)) /* same metamethods? */ + return tm1; + return NULL; +} + + +static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, + TMS event) { + const TValue *tm1 = luaT_gettmbyobj(L, p1, event); + const TValue *tm2; + if (ttisnil(tm1)) return -1; /* no metamethod? */ + tm2 = luaT_gettmbyobj(L, p2, event); + if (!luaO_rawequalObj(tm1, tm2)) /* different metamethods? */ + return -1; + callTMres(L, L->top, tm1, p1, p2); + return !l_isfalse(L->top); +} + + +static int l_strcmp (const TString *ls, const TString *rs) { + const char *l = getstr(ls); + size_t ll = ls->tsv.len; + const char *r = getstr(rs); + size_t lr = rs->tsv.len; + for (;;) { + int temp = strcoll(l, r); + if (temp != 0) return temp; + else { /* strings are equal up to a `\0' */ + size_t len = strlen(l); /* index of first `\0' in both strings */ + if (len == lr) /* r is finished? */ + return (len == ll) ? 0 : 1; + else if (len == ll) /* l is finished? */ + return -1; /* l is smaller than r (because r is not finished) */ + /* both strings longer than `len'; go on comparing (after the `\0') */ + len++; + l += len; ll -= len; r += len; lr -= len; + } + } +} + + +int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { + int res; + if (ttype(l) != ttype(r)) + return luaG_ordererror(L, l, r); + else if (ttisnumber(l)) + return luai_numlt(nvalue(l), nvalue(r)); + else if (ttisstring(l)) + return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; + else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) + return res; + return luaG_ordererror(L, l, r); +} + + +static int lessequal (lua_State *L, const TValue *l, const TValue *r) { + int res; + if (ttype(l) != ttype(r)) + return luaG_ordererror(L, l, r); + else if (ttisnumber(l)) + return luai_numle(nvalue(l), nvalue(r)); + else if (ttisstring(l)) + return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; + else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ + return res; + else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */ + return !res; + return luaG_ordererror(L, l, r); +} + + +int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) { + const TValue *tm; + lua_assert(ttype(t1) == ttype(t2)); + switch (ttype(t1)) { + case LUA_TNIL: return 1; + case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); + case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ + case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); + case LUA_TUSERDATA: { + if (uvalue(t1) == uvalue(t2)) return 1; + tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, + TM_EQ); + break; /* will try TM */ + } + case LUA_TTABLE: { + if (hvalue(t1) == hvalue(t2)) return 1; + tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); + break; /* will try TM */ + } + default: return gcvalue(t1) == gcvalue(t2); + } + if (tm == NULL) return 0; /* no TM? */ + callTMres(L, L->top, tm, t1, t2); /* call TM */ + return !l_isfalse(L->top); +} + + +void luaV_concat (lua_State *L, int total, int last) { + do { + StkId top = L->base + last + 1; + int n = 2; /* number of elements handled in this pass (at least 2) */ + if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { + if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) + luaG_concaterror(L, top-2, top-1); + } else if (tsvalue(top-1)->len == 0) /* second op is empty? */ + (void)tostring(L, top - 2); /* result is first op (as string) */ + else { + /* at least two string values; get as many as possible */ + size_t tl = tsvalue(top-1)->len; + char *buffer; + int i; + /* collect total length */ + for (n = 1; n < total && tostring(L, top-n-1); n++) { + size_t l = tsvalue(top-n-1)->len; + if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow"); + tl += l; + } + buffer = luaZ_openspace(L, &G(L)->buff, tl); + tl = 0; + for (i=n; i>0; i--) { /* concat all strings */ + size_t l = tsvalue(top-i)->len; + memcpy(buffer+tl, svalue(top-i), l); + tl += l; + } + setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); + } + total -= n-1; /* got `n' strings to create 1 new */ + last -= n-1; + } while (total > 1); /* repeat until only 1 result left */ +} + + +static void Arith (lua_State *L, StkId ra, const TValue *rb, + const TValue *rc, TMS op) { + TValue tempb, tempc; + const TValue *b, *c; + if ((b = luaV_tonumber(rb, &tempb)) != NULL && + (c = luaV_tonumber(rc, &tempc)) != NULL) { + lua_Number nb = nvalue(b), nc = nvalue(c); + switch (op) { + case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break; + case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break; + case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break; + case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break; + case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break; + case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break; + case TM_UNM: setnvalue(ra, luai_numunm(nb)); break; + default: lua_assert(0); break; + } + } + else if (!call_binTM(L, rb, rc, ra, op)) + luaG_aritherror(L, rb, rc); +} + + + +/* +** some macros for common tasks in `luaV_execute' +*/ + +#define runtime_check(L, c) { if (!(c)) break; } + +#define RA(i) (base+GETARG_A(i)) +/* to be used after possible stack reallocation */ +#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) +#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) +#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ + ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) +#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ + ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) +#define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i)) + + +#define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} + + +#define Protect(x) { L->savedpc = pc; {x;}; base = L->base; } + + +#define arith_op(op,tm) { \ + TValue *rb = RKB(i); \ + TValue *rc = RKC(i); \ + if (ttisnumber(rb) && ttisnumber(rc)) { \ + lua_Number nb = nvalue(rb), nc = nvalue(rc); \ + setnvalue(ra, op(nb, nc)); \ + } \ + else \ + Protect(Arith(L, ra, rb, rc, tm)); \ + } + + + +void luaV_execute (lua_State *L, int nexeccalls) { + LClosure *cl; + StkId base; + TValue *k; + const Instruction *pc; + reentry: /* entry point */ + lua_assert(isLua(L->ci)); + pc = L->savedpc; + cl = &clvalue(L->ci->func)->l; + base = L->base; + k = cl->p->k; + /* main loop of interpreter */ + for (;;) { + const Instruction i = *pc++; + StkId ra; + if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && + (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { + traceexec(L, pc); + if (L->status == LUA_YIELD) { /* did hook yield? */ + L->savedpc = pc - 1; + return; + } + base = L->base; + } + /* warning!! several calls may realloc the stack and invalidate `ra' */ + ra = RA(i); + lua_assert(base == L->base && L->base == L->ci->base); + lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); + lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); + switch (GET_OPCODE(i)) { + case OP_MOVE: { + setobjs2s(L, ra, RB(i)); + continue; + } + case OP_LOADK: { + setobj2s(L, ra, KBx(i)); + continue; + } + case OP_LOADBOOL: { + setbvalue(ra, GETARG_B(i)); + if (GETARG_C(i)) pc++; /* skip next instruction (if C) */ + continue; + } + case OP_LOADNIL: { + TValue *rb = RB(i); + do { + setnilvalue(rb--); + } while (rb >= ra); + continue; + } + case OP_GETUPVAL: { + int b = GETARG_B(i); + setobj2s(L, ra, cl->upvals[b]->v); + continue; + } + case OP_GETGLOBAL: { + TValue g; + TValue *rb = KBx(i); + sethvalue(L, &g, cl->env); + lua_assert(ttisstring(rb)); + Protect(luaV_gettable(L, &g, rb, ra)); + continue; + } + case OP_GETTABLE: { + Protect(luaV_gettable(L, RB(i), RKC(i), ra)); + continue; + } + case OP_SETGLOBAL: { + TValue g; + sethvalue(L, &g, cl->env); + lua_assert(ttisstring(KBx(i))); + Protect(luaV_settable(L, &g, KBx(i), ra)); + continue; + } + case OP_SETUPVAL: { + UpVal *uv = cl->upvals[GETARG_B(i)]; + setobj(L, uv->v, ra); + luaC_barrier(L, uv, ra); + continue; + } + case OP_SETTABLE: { + Protect(luaV_settable(L, ra, RKB(i), RKC(i))); + continue; + } + case OP_NEWTABLE: { + int b = GETARG_B(i); + int c = GETARG_C(i); + sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c))); + Protect(luaC_checkGC(L)); + continue; + } + case OP_SELF: { + StkId rb = RB(i); + setobjs2s(L, ra+1, rb); + Protect(luaV_gettable(L, rb, RKC(i), ra)); + continue; + } + case OP_ADD: { + arith_op(luai_numadd, TM_ADD); + continue; + } + case OP_SUB: { + arith_op(luai_numsub, TM_SUB); + continue; + } + case OP_MUL: { + arith_op(luai_nummul, TM_MUL); + continue; + } + case OP_DIV: { + arith_op(luai_numdiv, TM_DIV); + continue; + } + case OP_MOD: { + arith_op(luai_nummod, TM_MOD); + continue; + } + case OP_POW: { + arith_op(luai_numpow, TM_POW); + continue; + } + case OP_UNM: { + TValue *rb = RB(i); + if (ttisnumber(rb)) { + lua_Number nb = nvalue(rb); + setnvalue(ra, luai_numunm(nb)); + } + else { + Protect(Arith(L, ra, rb, rb, TM_UNM)); + } + continue; + } + case OP_NOT: { + int res = l_isfalse(RB(i)); /* next assignment may change this value */ + setbvalue(ra, res); + continue; + } + case OP_LEN: { + const TValue *rb = RB(i); + switch (ttype(rb)) { + case LUA_TTABLE: { + setnvalue(ra, cast_num(luaH_getn(hvalue(rb)))); + break; + } + case LUA_TSTRING: { + setnvalue(ra, cast_num(tsvalue(rb)->len)); + break; + } + default: { /* try metamethod */ + Protect( + if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)) + luaG_typeerror(L, rb, "get length of"); + ) + } + } + continue; + } + case OP_CONCAT: { + int b = GETARG_B(i); + int c = GETARG_C(i); + Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L)); + setobjs2s(L, RA(i), base+b); + continue; + } + case OP_JMP: { + dojump(L, pc, GETARG_sBx(i)); + continue; + } + case OP_EQ: { + TValue *rb = RKB(i); + TValue *rc = RKC(i); + Protect( + if (equalobj(L, rb, rc) == GETARG_A(i)) + dojump(L, pc, GETARG_sBx(*pc)); + ) + pc++; + continue; + } + case OP_LT: { + Protect( + if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) + dojump(L, pc, GETARG_sBx(*pc)); + ) + pc++; + continue; + } + case OP_LE: { + Protect( + if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) + dojump(L, pc, GETARG_sBx(*pc)); + ) + pc++; + continue; + } + case OP_TEST: { + if (l_isfalse(ra) != GETARG_C(i)) + dojump(L, pc, GETARG_sBx(*pc)); + pc++; + continue; + } + case OP_TESTSET: { + TValue *rb = RB(i); + if (l_isfalse(rb) != GETARG_C(i)) { + setobjs2s(L, ra, rb); + dojump(L, pc, GETARG_sBx(*pc)); + } + pc++; + continue; + } + case OP_CALL: { + int b = GETARG_B(i); + int nresults = GETARG_C(i) - 1; + if (b != 0) L->top = ra+b; /* else previous instruction set top */ + L->savedpc = pc; + switch (luaD_precall(L, ra, nresults)) { + case PCRLUA: { + nexeccalls++; + goto reentry; /* restart luaV_execute over new Lua function */ + } + case PCRC: { + /* it was a C function (`precall' called it); adjust results */ + if (nresults >= 0) L->top = L->ci->top; + base = L->base; + continue; + } + default: { + return; /* yield */ + } + } + } + case OP_TAILCALL: { + int b = GETARG_B(i); + if (b != 0) L->top = ra+b; /* else previous instruction set top */ + L->savedpc = pc; + lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); + switch (luaD_precall(L, ra, LUA_MULTRET)) { + case PCRLUA: { + /* tail call: put new frame in place of previous one */ + CallInfo *ci = L->ci - 1; /* previous frame */ + int aux; + StkId func = ci->func; + StkId pfunc = (ci+1)->func; /* previous function index */ + if (L->openupval) luaF_close(L, ci->base); + L->base = ci->base = ci->func + ((ci+1)->base - pfunc); + for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ + setobjs2s(L, func+aux, pfunc+aux); + ci->top = L->top = func+aux; /* correct top */ + lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize); + ci->savedpc = L->savedpc; + ci->tailcalls++; /* one more call lost */ + L->ci--; /* remove new frame */ + goto reentry; + } + case PCRC: { /* it was a C function (`precall' called it) */ + base = L->base; + continue; + } + default: { + return; /* yield */ + } + } + } + case OP_RETURN: { + int b = GETARG_B(i); + if (b != 0) L->top = ra+b-1; + if (L->openupval) luaF_close(L, base); + L->savedpc = pc; + b = luaD_poscall(L, ra); + if (--nexeccalls == 0) /* was previous function running `here'? */ + return; /* no: return */ + else { /* yes: continue its execution */ + if (b) L->top = L->ci->top; + lua_assert(isLua(L->ci)); + lua_assert(GET_OPCODE(*((L->ci)->savedpc - 1)) == OP_CALL); + goto reentry; + } + } + case OP_FORLOOP: { + lua_Number step = nvalue(ra+2); + lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */ + lua_Number limit = nvalue(ra+1); + if (luai_numlt(0, step) ? luai_numle(idx, limit) + : luai_numle(limit, idx)) { + dojump(L, pc, GETARG_sBx(i)); /* jump back */ + setnvalue(ra, idx); /* update internal index... */ + setnvalue(ra+3, idx); /* ...and external index */ + } + continue; + } + case OP_FORPREP: { + const TValue *init = ra; + const TValue *plimit = ra+1; + const TValue *pstep = ra+2; + L->savedpc = pc; /* next steps may throw errors */ + if (!tonumber(init, ra)) + luaG_runerror(L, LUA_QL("for") " initial value must be a number"); + else if (!tonumber(plimit, ra+1)) + luaG_runerror(L, LUA_QL("for") " limit must be a number"); + else if (!tonumber(pstep, ra+2)) + luaG_runerror(L, LUA_QL("for") " step must be a number"); + setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep))); + dojump(L, pc, GETARG_sBx(i)); + continue; + } + case OP_TFORLOOP: { + StkId cb = ra + 3; /* call base */ + setobjs2s(L, cb+2, ra+2); + setobjs2s(L, cb+1, ra+1); + setobjs2s(L, cb, ra); + L->top = cb+3; /* func. + 2 args (state and index) */ + Protect(luaD_call(L, cb, GETARG_C(i))); + L->top = L->ci->top; + cb = RA(i) + 3; /* previous call may change the stack */ + if (!ttisnil(cb)) { /* continue loop? */ + setobjs2s(L, cb-1, cb); /* save control variable */ + dojump(L, pc, GETARG_sBx(*pc)); /* jump back */ + } + pc++; + continue; + } + case OP_SETLIST: { + int n = GETARG_B(i); + int c = GETARG_C(i); + int last; + Table *h; + if (n == 0) { + n = cast_int(L->top - ra) - 1; + L->top = L->ci->top; + } + if (c == 0) c = cast_int(*pc++); + runtime_check(L, ttistable(ra)); + h = hvalue(ra); + last = ((c-1)*LFIELDS_PER_FLUSH) + n; + if (last > h->sizearray) /* needs more space? */ + luaH_resizearray(L, h, last); /* pre-alloc it at once */ + for (; n > 0; n--) { + TValue *val = ra+n; + setobj2t(L, luaH_setnum(L, h, last--), val); + luaC_barriert(L, h, val); + } + continue; + } + case OP_CLOSE: { + luaF_close(L, ra); + continue; + } + case OP_CLOSURE: { + Proto *p; + Closure *ncl; + int nup, j; + p = cl->p->p[GETARG_Bx(i)]; + nup = p->nups; + ncl = luaF_newLclosure(L, nup, cl->env); + ncl->l.p = p; + for (j=0; jl.upvals[j] = cl->upvals[GETARG_B(*pc)]; + else { + lua_assert(GET_OPCODE(*pc) == OP_MOVE); + ncl->l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc)); + } + } + setclvalue(L, ra, ncl); + Protect(luaC_checkGC(L)); + continue; + } + case OP_VARARG: { + int b = GETARG_B(i) - 1; + int j; + CallInfo *ci = L->ci; + int n = cast_int(ci->base - ci->func) - cl->p->numparams - 1; + if (b == LUA_MULTRET) { + Protect(luaD_checkstack(L, n)); + ra = RA(i); /* previous call may change the stack */ + b = n; + L->top = ra + n; + } + for (j = 0; j < b; j++) { + if (j < n) { + setobjs2s(L, ra + j, ci->base - n + j); + } + else { + setnilvalue(ra + j); + } + } + continue; + } + } + } +} + diff --git a/script/lua/lvm.h b/script/lua/lvm.h new file mode 100644 index 000000000..bfe4f5678 --- /dev/null +++ b/script/lua/lvm.h @@ -0,0 +1,36 @@ +/* +** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $ +** Lua virtual machine +** See Copyright Notice in lua.h +*/ + +#ifndef lvm_h +#define lvm_h + + +#include "ldo.h" +#include "lobject.h" +#include "ltm.h" + + +#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) + +#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ + (((o) = luaV_tonumber(o,n)) != NULL)) + +#define equalobj(L,o1,o2) \ + (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) + + +LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); +LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); +LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); +LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); +LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, + StkId val); +LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, + StkId val); +LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls); +LUAI_FUNC void luaV_concat (lua_State *L, int total, int last); + +#endif diff --git a/script/lua/lzio.c b/script/lua/lzio.c new file mode 100644 index 000000000..3ccba193c --- /dev/null +++ b/script/lua/lzio.c @@ -0,0 +1,83 @@ +/* +** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ +** a generic input stream interface +** See Copyright Notice in lua.h +*/ + +#if 0 +#include +#endif + +#define lzio_c +#define LUA_CORE + +#include "lua.h" + +#include "llimits.h" +#include "lmem.h" +#include "lstate.h" +#include "lzio.h" + + +int luaZ_fill (ZIO *z) { + size_t size; + lua_State *L = z->L; + const char *buff; + lua_unlock(L); + buff = z->reader(L, z->data, &size); + lua_lock(L); + if (buff == NULL || size == 0) return EOZ; + z->n = size - 1; + z->p = buff; + return char2int(*(z->p++)); +} + + +int luaZ_lookahead (ZIO *z) { + if (z->n == 0) { + if (luaZ_fill(z) == EOZ) + return EOZ; + else { + z->n++; /* luaZ_fill removed first byte; put back it */ + z->p--; + } + } + return char2int(*z->p); +} + + +void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { + z->L = L; + z->reader = reader; + z->data = data; + z->n = 0; + z->p = NULL; +} + + +/* --------------------------------------------------------------- read --- */ +size_t luaZ_read (ZIO *z, void *b, size_t n) { + while (n) { + size_t m; + if (luaZ_lookahead(z) == EOZ) + return n; /* return number of missing bytes */ + m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ + memcpy(b, z->p, m); + z->n -= m; + z->p += m; + b = (char *)b + m; + n -= m; + } + return 0; +} + +/* ------------------------------------------------------------------------ */ +char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) { + if (n > buff->buffsize) { + if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; + luaZ_resizebuffer(L, buff, n); + } + return buff->buffer; +} + + diff --git a/script/lua/lzio.h b/script/lua/lzio.h new file mode 100644 index 000000000..51d695d8c --- /dev/null +++ b/script/lua/lzio.h @@ -0,0 +1,67 @@ +/* +** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $ +** Buffered streams +** See Copyright Notice in lua.h +*/ + + +#ifndef lzio_h +#define lzio_h + +#include "lua.h" + +#include "lmem.h" + + +#define EOZ (-1) /* end of stream */ + +typedef struct Zio ZIO; + +#define char2int(c) cast(int, cast(unsigned char, (c))) + +#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) + +typedef struct Mbuffer { + char *buffer; + size_t n; + size_t buffsize; +} Mbuffer; + +#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) + +#define luaZ_buffer(buff) ((buff)->buffer) +#define luaZ_sizebuffer(buff) ((buff)->buffsize) +#define luaZ_bufflen(buff) ((buff)->n) + +#define luaZ_resetbuffer(buff) ((buff)->n = 0) + + +#define luaZ_resizebuffer(L, buff, size) \ + (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ + (buff)->buffsize = size) + +#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) + + +LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); +LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, + void *data); +LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ +LUAI_FUNC int luaZ_lookahead (ZIO *z); + + + +/* --------- Private Part ------------------ */ + +struct Zio { + size_t n; /* bytes still unread */ + const char *p; /* current position in buffer */ + lua_Reader reader; + void* data; /* additional data */ + lua_State *L; /* Lua state (for reader) */ +}; + + +LUAI_FUNC int luaZ_fill (ZIO *z); + +#endif From 59e5d3ec80b6b7466bd874e8eba98049aedac6bd Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 16 May 2009 13:58:07 +0000 Subject: [PATCH 0757/1707] 2009-05-16 Felix Zielcke * util/grub-mkconfig.in: Export GRUB_TERMINAL_INPUT. --- ChangeLog | 4 ++++ util/grub-mkconfig.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c9495020a..c79817c22 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-16 Felix Zielcke + + * util/grub-mkconfig.in: Export GRUB_TERMINAL_INPUT. + 2009-05-16 Bean * conf/common.rmk (pkglib_MODULES): Add lua.mod. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 106476322..f73def2a6 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -173,7 +173,7 @@ esac export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES # These are optional, user-defined variables. -export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE +export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE if test "x${grub_cfg}" != "x"; then rm -f ${grub_cfg}.new From 334f2c28580e2ec196162ee13232f1305cbf719e Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 16 May 2009 17:22:32 +0000 Subject: [PATCH 0758/1707] 2009-05-16 Felix Zielcke * conf/i386.rmk (setjmp_mod_CFLAGS): Rename to ... (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS) --- ChangeLog | 5 +++++ conf/i386.rmk | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c79817c22..7ef795336 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-16 Felix Zielcke + + * conf/i386.rmk (setjmp_mod_CFLAGS): Rename to ... + (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS) + 2009-05-16 Felix Zielcke * util/grub-mkconfig.in: Export GRUB_TERMINAL_INPUT. diff --git a/conf/i386.rmk b/conf/i386.rmk index e8e2857cb..89496aef8 100644 --- a/conf/i386.rmk +++ b/conf/i386.rmk @@ -18,5 +18,5 @@ vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) # For setjmp.mod pkglib_MODULES += setjmp.mod setjmp_mod_SOURCES = lib/i386/setjmp.S -setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) From 7dd10fceb437bcab2520ae929c9b75e6b9b74b0c Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 16 May 2009 17:32:32 +0000 Subject: [PATCH 0759/1707] * conf/x86_64-efi.rmk (setjmp_mod_CFLAGS): Rename to ... (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS). * conf/powerpc-ieee1275.rmk (setjmp_mod_CFLAGS): Rename to ... (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS). * conf/sparc64-ieee1275.rmk (setjmp_mod_CFLAGS): Rename to ... (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS). --- ChangeLog | 8 +++++++- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- conf/x86_64-efi.rmk | 2 +- 4 files changed, 10 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7ef795336..7b33c38f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,13 @@ 2009-05-16 Felix Zielcke * conf/i386.rmk (setjmp_mod_CFLAGS): Rename to ... - (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS) + (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS). + * conf/x86_64-efi.rmk (setjmp_mod_CFLAGS): Rename to ... + (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS). + * conf/powerpc-ieee1275.rmk (setjmp_mod_CFLAGS): Rename to ... + (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS). + * conf/sparc64-ieee1275.rmk (setjmp_mod_CFLAGS): Rename to ... + (setjmp_mod_ASFLAGS): ... this. Set to $(COMMON_ASFLAGS). 2009-05-16 Felix Zielcke diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index bf0dd49bb..8b5be2bba 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -159,7 +159,7 @@ lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) # For setjmp.mod pkglib_MODULES += setjmp.mod setjmp_mod_SOURCES = lib/powerpc/setjmp.S -setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) include $(srcdir)/conf/common.mk diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 234f80122..d16501bdc 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -177,7 +177,7 @@ lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) # For setjmp.mod pkglib_MODULES += setjmp.mod setjmp_mod_SOURCES = lib/sparc64/setjmp.S -setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index d25b03a4c..391cda312 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -196,7 +196,7 @@ xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) # For setjmp.mod pkglib_MODULES += setjmp.mod setjmp_mod_SOURCES = lib/x86_64/setjmp.S -setjmp_mod_CFLAGS = $(COMMON_CFLAGS) +setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) include $(srcdir)/conf/common.mk From cb5a0f40a30c1d78aeeb79901963446c880c02a0 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 17 May 2009 00:37:10 +0000 Subject: [PATCH 0760/1707] 2009-05-16 Pavel Roskin * script/lua/grub_lib.c (grub_lua_getenv): Make name and value const to avoid a warning. (grub_lua_setenv): Likewise. * script/lua/grub_main.c (grub_lua_parse_line): Use size_t for lmsg to fix a warning. --- ChangeLog | 8 ++++++++ script/lua/grub_lib.c | 4 ++-- script/lua/grub_main.c | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7b33c38f1..371a7ed3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-05-16 Pavel Roskin + + * script/lua/grub_lib.c (grub_lua_getenv): Make name and value + const to avoid a warning. + (grub_lua_setenv): Likewise. + * script/lua/grub_main.c (grub_lua_parse_line): Use size_t for + lmsg to fix a warning. + 2009-05-16 Felix Zielcke * conf/i386.rmk (setjmp_mod_CFLAGS): Rename to ... diff --git a/script/lua/grub_lib.c b/script/lua/grub_lib.c index 8004ca648..0295f0dcc 100644 --- a/script/lua/grub_lib.c +++ b/script/lua/grub_lib.c @@ -69,7 +69,7 @@ grub_lua_getenv (lua_State *state) n = lua_gettop(state); for (i = 1; i <= n; i++) { - char *name, *value; + const char *name, *value; name = lua_tostring (state, i); value = grub_env_get (name); @@ -85,7 +85,7 @@ grub_lua_getenv (lua_State *state) static int grub_lua_setenv (lua_State *state) { - char *name, *value; + const char *name, *value; if (lua_gettop(state) != 2) return 0; diff --git a/script/lua/grub_main.c b/script/lua/grub_main.c index f68502121..2de59205c 100644 --- a/script/lua/grub_main.c +++ b/script/lua/grub_main.c @@ -51,7 +51,7 @@ grub_lua_parse_line (char *line, grub_reader_getline_t getline) if (r == LUA_ERRSYNTAX) { - int lmsg; + size_t lmsg; const char *msg = lua_tolstring(state, -1, &lmsg); const char *tp = msg + lmsg - (sizeof(LUA_QL("")) - 1); if (grub_strstr(msg, LUA_QL("")) == tp) From 22f53a96fd632d91e47e061c70ff4271038089ef Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 17 May 2009 11:27:08 +0000 Subject: [PATCH 0761/1707] 2009-05-17 Vladimir Serbinenko trampoline for linux on 64-bit platform * conf/x86_64-efi.rmk (linux_mod_SOURCES): added loader/i386/efi/linux_trampoline.S * include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed declration * kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here * loader/i386/linux_trampoline.S: moved here * loader/i386/efi/linux.c (allocate_pages): reserve space for trampoline (jumpvector): removed (grub_linux_trampoline_start): new declaration (grub_linux_trampoline_end): likewise (grub_linux_boot): use trampoline when on 64-bit platform * loader/i386/linux.c: likewise --- ChangeLog | 17 +++++ conf/x86_64-efi.rmk | 2 +- include/grub/x86_64/efi/loader.h | 1 - kern/x86_64/efi/startup.S | 23 ------- loader/i386/efi/linux.c | 33 +++++---- loader/i386/linux.c | 29 ++++---- loader/i386/linux_trampoline.S | 112 +++++++++++++++++++++++++++++++ 7 files changed, 157 insertions(+), 60 deletions(-) create mode 100644 loader/i386/linux_trampoline.S diff --git a/ChangeLog b/ChangeLog index 371a7ed3b..191ce8a34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2009-05-17 Vladimir Serbinenko + + trampoline for linux on 64-bit platform + + * conf/x86_64-efi.rmk (linux_mod_SOURCES): added + loader/i386/efi/linux_trampoline.S + * include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed + declration + * kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here + * loader/i386/linux_trampoline.S: moved here + * loader/i386/efi/linux.c (allocate_pages): reserve space for trampoline + (jumpvector): removed + (grub_linux_trampoline_start): new declaration + (grub_linux_trampoline_end): likewise + (grub_linux_boot): use trampoline when on 64-bit platform + * loader/i386/linux.c: likewise + 2009-05-16 Pavel Roskin * script/lua/grub_lib.c (grub_lua_getenv): Make name and value diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 391cda312..5d342b37f 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -137,7 +137,7 @@ appleldr_mod_CFLAGS = $(COMMON_CFLAGS) appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. -linux_mod_SOURCES = loader/i386/efi/linux.c +linux_mod_SOURCES = loader/i386/efi/linux.c loader/i386/linux_trampoline.S linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/x86_64/efi/loader.h b/include/grub/x86_64/efi/loader.h index fac67463b..7c302e8a5 100644 --- a/include/grub/x86_64/efi/loader.h +++ b/include/grub/x86_64/efi/loader.h @@ -22,6 +22,5 @@ #include #include -void EXPORT_FUNC(grub_linux_real_boot) (void); #endif /* ! GRUB_LOADER_MACHINE_HEADER */ diff --git a/kern/x86_64/efi/startup.S b/kern/x86_64/efi/startup.S index 2cb1fd4a5..fb4fc7b64 100644 --- a/kern/x86_64/efi/startup.S +++ b/kern/x86_64/efi/startup.S @@ -61,26 +61,3 @@ codestart: call EXT_C(grub_main) ret - .code32 - -FUNCTION(grub_linux_real_boot) - /* Turn off PG bit in CR0 and set CR3 to zero. */ - movl %cr0, %eax - andl $0x7FFFFFFF, %eax - movl %eax, %cr0 - - /* Setup EFER (Extended Feature Enable Register). */ - movl $0xc0000080, %ecx - rdmsr - - /* Disable Long Mode. */ - andl $0xFFFFFEFF, %eax - - /* Make changes effective. */ - wrmsr - - /* Disable PAE. */ - xorl %eax, %eax - movl %eax, %cr4 - - jmp *%ebx diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 9be88aa79..dae0f6dcd 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -241,7 +241,7 @@ allocate_pages (grub_size_t prot_size) /* Next, find free pages for the protected mode code. */ /* XXX what happens if anything is using this address? */ - prot_mode_mem = grub_efi_allocate_pages (0x100000, prot_mode_pages); + prot_mode_mem = grub_efi_allocate_pages (0x100000, prot_mode_pages + 1); if (! prot_mode_mem) { grub_error (GRUB_ERR_OUT_OF_MEMORY, @@ -286,11 +286,8 @@ grub_e820_add_region (struct grub_e820_mmap *e820_map, int *e820_num, } #ifdef __x86_64__ -struct -{ - grub_uint32_t kernel_entry; - grub_uint32_t kernel_cs; -} jumpvector; +extern grub_uint8_t grub_linux_trampoline_start[]; +extern grub_uint8_t grub_linux_trampoline_end[]; #endif static grub_err_t @@ -384,6 +381,18 @@ grub_linux_boot (void) params->v0204.efi_mmap_size = mmap_size; } +#ifdef __x86_64__ + + grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), + grub_linux_trampoline_start, + grub_linux_trampoline_end - grub_linux_trampoline_start); + + ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem + + (prot_mode_pages << 12))) + (params->code32_start, real_mode_mem); + +#else + /* Hardware interrupts are not safe any longer. */ asm volatile ("cli" : : ); @@ -391,18 +400,6 @@ grub_linux_boot (void) asm volatile ("lidt %0" : : "m" (idt_desc)); asm volatile ("lgdt %0" : : "m" (gdt_desc)); -#ifdef __x86_64__ - - jumpvector.kernel_entry = (grub_uint64_t) grub_linux_real_boot; - jumpvector.kernel_cs = 0x10; - - asm volatile ( "mov %0, %%rbx" : : "m" (params->code32_start)); - asm volatile ( "mov %0, %%rsi" : : "m" (real_mode_mem)); - - asm volatile ( "ljmp *%0" : : "m" (jumpvector)); - -#else - /* Pass parameters. */ asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem)); diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 8a7288ecd..ca44fb46f 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -433,11 +433,8 @@ grub_linux_setup_video (struct linux_kernel_params *params) } #ifdef __x86_64__ -struct -{ - grub_uint32_t kernel_entry; - grub_uint32_t kernel_cs; -} jumpvector; +extern grub_uint8_t grub_linux_trampoline_start[]; +extern grub_uint8_t grub_linux_trampoline_end[]; #endif static grub_err_t @@ -549,6 +546,16 @@ grub_linux_boot (void) grub_mmap_iterate (hook); params->mmap_size = e820_num; +#ifdef __x86_64__ + + grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), + grub_linux_trampoline_start, + grub_linux_trampoline_end - grub_linux_trampoline_start); + + ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem + + (prot_mode_pages << 12))) + (params->code32_start, real_mode_mem); +#else /* Hardware interrupts are not safe any longer. */ asm volatile ("cli" : : ); @@ -557,18 +564,6 @@ grub_linux_boot (void) asm volatile ("lidt %0" : : "m" (idt_desc)); asm volatile ("lgdt %0" : : "m" (gdt_desc)); -#ifdef __x86_64__ - - jumpvector.kernel_entry = (grub_uint64_t) grub_linux_real_boot; - jumpvector.kernel_cs = 0x10; - - asm volatile ( "mov %0, %%rbx" : : "m" (params->code32_start)); - asm volatile ( "mov %0, %%rsi" : : "m" (real_mode_mem)); - - asm volatile ( "ljmp *%0" : : "m" (jumpvector)); - -#else - /* Pass parameters. */ asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem)); diff --git a/loader/i386/linux_trampoline.S b/loader/i386/linux_trampoline.S new file mode 100644 index 000000000..39821e1d3 --- /dev/null +++ b/loader/i386/linux_trampoline.S @@ -0,0 +1,112 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + + + .p2align 4 /* force 16-byte alignment */ +VARIABLE(grub_linux_trampoline_start) + cli + /* %rdi contains protected memory start and %rsi + contains real memory start. */ + + mov %rsi, %rbx + + call base +base: + pop %rsi + + lea (cont1-base)(%rsi, 1), %rax + mov %eax, (jump_vector-base)(%rsi,1) + + lea (gdt-base)(%rsi, 1), %rax + mov %rax, (gdtaddr-base)(%rsi,1) + + /* Switch to compatibility mode. */ + + lidt (idtdesc-base)(%rsi,1) + lgdt (gdtdesc-base)(%rsi,1) + + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ + ljmp *(jump_vector-base)(%rsi,1) +cont1: + .code32 + + /* Update other registers. */ + mov $0x18, %eax + mov %eax, %ds + mov %eax, %es + mov %eax, %fs + mov %eax, %gs + mov %eax, %ss + + /* Disable paging. */ + mov %cr0, %eax + and $0x7fffffff, %eax + mov %eax, %cr0 + + /* Disable amd64. */ + mov $0xc0000080, %ecx + rdmsr + and $0xfffffeff, %eax + wrmsr + + /* Turn off PAE. */ + movl %cr4, %eax + and $0xffffffcf, %eax + mov %eax, %cr4 + + jmp cont2 +cont2: + .code32 + + mov %ebx, %esi + + jmp *%edi + + /* GDT. */ + .p2align 4 +gdt: + /* NULL. */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* Reserved. */ + .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 + + /* Code segment. */ + .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00 + + /* Data segment. */ + .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00 + +gdtdesc: + .word 31 +gdtaddr: + .quad gdt + +idtdesc: + .word 0 +idtaddr: + .quad 0 + + .p2align 4 +jump_vector: + /* Jump location. Is filled by the code */ + .long 0 + .long 0x10 +VARIABLE(grub_linux_trampoline_end) From 46422c891eb034502e195f5c2c3c7f043da9f29f Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 17 May 2009 11:33:20 +0000 Subject: [PATCH 0762/1707] 2009-05-17 Vladimir Serbinenko Remove -Werror which causes build to fail on some systems * conf/i386-pc.rmk (xnu_mod_CFLAGS): Remove -Werror -Wall * conf/i386-efi.rmk (xnu_mod_CFLAGS): Likewise * conf/x86_64-efi.rmk (xnu_mod_CFLAGS): Likewise --- ChangeLog | 8 ++++++++ conf/i386-efi.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/x86_64-efi.rmk | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 191ce8a34..8ce849620 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-05-17 Vladimir Serbinenko + + Remove -Werror which causes build to fail on some systems + + * conf/i386-pc.rmk (xnu_mod_CFLAGS): Remove -Werror -Wall + * conf/i386-efi.rmk (xnu_mod_CFLAGS): Likewise + * conf/x86_64-efi.rmk (xnu_mod_CFLAGS): Likewise + 2009-05-17 Vladimir Serbinenko trampoline for linux on 64-bit platform diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 16ccea679..91e271d8c 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -191,7 +191,7 @@ fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += xnu.mod xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\ loader/macho.c loader/xnu.c loader/i386/xnu_helper.S -xnu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index d51fa9b02..a72d2d246 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -239,7 +239,7 @@ linux_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += xnu.mod xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/pc/xnu.c\ loader/macho.c loader/xnu.c loader/i386/xnu_helper.S -xnu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 5d342b37f..ef36057ff 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -189,7 +189,7 @@ fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += xnu.mod xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\ loader/macho.c loader/xnu.c loader/i386/xnu_helper.S -xnu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) From 18f547ad4dca52a149edfceb2df6fc2b27e5031e Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 18 May 2009 13:52:36 +0000 Subject: [PATCH 0763/1707] Spacing fixes --- ChangeLog | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ce849620..c26b09ced 100644 --- a/ChangeLog +++ b/ChangeLog @@ -5,14 +5,14 @@ * conf/i386-pc.rmk (xnu_mod_CFLAGS): Remove -Werror -Wall * conf/i386-efi.rmk (xnu_mod_CFLAGS): Likewise * conf/x86_64-efi.rmk (xnu_mod_CFLAGS): Likewise - + 2009-05-17 Vladimir Serbinenko trampoline for linux on 64-bit platform - * conf/x86_64-efi.rmk (linux_mod_SOURCES): added - loader/i386/efi/linux_trampoline.S - * include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed + * conf/x86_64-efi.rmk (linux_mod_SOURCES): added + loader/i386/efi/linux_trampoline.S + * include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed declration * kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here * loader/i386/linux_trampoline.S: moved here @@ -176,7 +176,7 @@ (grub_linux_setup_video): Cast render_target->data to grub_size_t to fix a warning. -2009-05-13 Javier Martín +2009-05-13 Javier Martín * commands/i386/pc/drivemap.c: New file - implement drivemap command. @@ -218,7 +218,7 @@ * util/i386/pc/grub-install.in: Update copyright year. -2009-05-09 Vladimir Serbinenko +2009-05-09 Vladimir Serbinenko gptsync @@ -227,7 +227,7 @@ (gptsync_mod_SOURCES): new variable (gptsync_mod_CFLAGS): likewise (gptsync_mod_LDFLAGS): likewise - * include/grub/pc_partition.h (GRUB_PC_PARTITION_TYPE_NTFS): + * include/grub/pc_partition.h (GRUB_PC_PARTITION_TYPE_NTFS): new definition (GRUB_PC_PARTITION_TYPE_HFS): likewise * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/gptsync.c @@ -424,7 +424,7 @@ * conf/i386-efi.rmk (grub_emu_SOURCES): Remove `normal/execute.c', `normal/lexer.c', `kern/rescue.c', `normal/function.c', `normal/misc.c' and `normal/script.c'. Add `kern/rescue_reader.c', - `kern/rescue_parser.c', `script/sh/main.c', `script/sh/execute.c', + `kern/rescue_parser.c', `script/sh/main.c', `script/sh/execute.c', `script/sh/function.c', `script/sh/lexer.c', `script/sh/script.c' and `grub_script.tab.c'. @@ -451,7 +451,7 @@ install in odd layouts. Refuse to install using blocklists unless --force was set. -2009-05-04 martin f. krafft +2009-05-04 martin f. krafft * disk/raid.c (grub_raid_scan_device): Improve debug message. @@ -460,12 +460,12 @@ Updated copyright year * fs/hfsplus.c: updated copyright year - + 2009-05-04 Vladimir Serbinenko HFS+ UUID - * fs/hfsplus.c (grub_hfsplus_volheader): added num_serial field + * fs/hfsplus.c (grub_hfsplus_volheader): added num_serial field in the space previously used by unused3 (grub_hfsplus_uuid): new function (grub_hfsplus_fs): added uuid field @@ -539,11 +539,11 @@ * util/i386/pc/grub-install.in: Likewise. Use "cp -f" for copying. -2009-05-03 Bean Vladimir Serbinenko +2009-05-03 Bean Vladimir Serbinenko FreeBSD 64-bit support - * conf/i386-pc.rmk (bsd_mod_SOURCES): add loader/i386/bsd_helper.S + * conf/i386-pc.rmk (bsd_mod_SOURCES): add loader/i386/bsd_helper.S and loader/i386/bsd_trampoline.S (bsd_mod_ASFLAGS): new variable * include/grub/i386/bsd.h (FREEBSD_MODINFOMD_SMAP): new definition @@ -556,7 +556,7 @@ * include/grub/i386/bsd.h (grub_unix_real_boot): ... moved here * kern/i386/loader.S (grub_unix_real_boot): moved from here ... * loader/i386/bsd_helper.S (grub_unix_real_boot): moved here - * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type + * include/grub/gpt_partition.h (grub_gpt_partentry): Corrected the type of "attrib" member * loader/i386/bsd_pagetable.c: new file * loader/i386/bsd_trampoline.S: likewise From 33db90156a4f42301309f47cc826f7dcb5254629 Mon Sep 17 00:00:00 2001 From: cbennett Date: Mon, 18 May 2009 21:53:09 +0000 Subject: [PATCH 0764/1707] 2009-05-18 Colin D Bennett Display error messages when parsing a Lua statement fails. Previously, executing a syntactically invalid statement like ")foo" or "bar;" would silently fail. * script/lua/grub_main.c (handle_lua_error): New function. (grub_lua_parse_line): Improved reporting of Lua parser and execution errors. --- ChangeLog | 10 ++++++++ script/lua/grub_main.c | 58 +++++++++++++++++++++++++++++++++--------- 2 files changed, 56 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index c26b09ced..abd465164 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-05-18 Colin D Bennett + + Display error messages when parsing a Lua statement fails. Previously, + executing a syntactically invalid statement like ")foo" or "bar;" would + silently fail. + + * script/lua/grub_main.c (handle_lua_error): New function. + (grub_lua_parse_line): Improved reporting of Lua parser and execution + errors. + 2009-05-17 Vladimir Serbinenko Remove -Werror which causes build to fail on some systems diff --git a/script/lua/grub_main.c b/script/lua/grub_main.c index 2de59205c..03f890a9a 100644 --- a/script/lua/grub_main.c +++ b/script/lua/grub_main.c @@ -26,6 +26,21 @@ static lua_State *state; +/* Call `grub_error' to report a Lua error. The error message string must be + on the top of the Lua stack (at index -1). The error message is popped off + the Lua stack before this function returns. */ +static void +handle_lua_error (const char *error_type) +{ + const char *error_msg; + error_msg = lua_tostring (state, -1); + if (error_msg == NULL) + error_msg = "(error message not a string)"; + grub_error (GRUB_ERR_BAD_ARGUMENT, "%s: %s", error_type, error_msg); + /* Pop the error message. */ + lua_pop (state, 1); +} + static grub_err_t grub_lua_parse_line (char *line, grub_reader_getline_t getline) { @@ -35,37 +50,47 @@ grub_lua_parse_line (char *line, grub_reader_getline_t getline) lua_settop(state, 0); while (1) { - r = luaL_loadbuffer (state, line, grub_strlen (line), "grub"); + r = luaL_loadbuffer (state, line, grub_strlen (line), "=grub"); if (! r) { + /* No error: Execute the statement. */ r = lua_pcall (state, 0, 0, 0); if (r) - grub_error (GRUB_ERR_BAD_ARGUMENT, "lua command fails"); + { + handle_lua_error ("Lua"); + break; + } else { grub_free (old_line); return grub_errno; } - break; } if (r == LUA_ERRSYNTAX) { + /* Check whether the syntax error is a result of an incomplete + statement. If it is, then try to complete the statement by + reading more lines. */ size_t lmsg; - const char *msg = lua_tolstring(state, -1, &lmsg); - const char *tp = msg + lmsg - (sizeof(LUA_QL("")) - 1); - if (grub_strstr(msg, LUA_QL("")) == tp) + const char *msg = lua_tolstring (state, -1, &lmsg); + const char *tp = msg + lmsg - (sizeof (LUA_QL ("")) - 1); + if (grub_strstr (msg, LUA_QL ("")) == tp) { char *n, *t; int len; - lua_pop(state, 1); + /* Discard the error message. */ + lua_pop (state, 1); + /* Try to read another line to complete the statement. */ if ((getline (&n, 1)) || (! n)) { grub_error (GRUB_ERR_BAD_ARGUMENT, "incomplete command"); break; } + /* More input was available: Add it to the current statement + contents. */ len = grub_strlen (line); t = grub_malloc (len + grub_strlen (n) + 2); if (! t) @@ -76,8 +101,17 @@ grub_lua_parse_line (char *line, grub_reader_getline_t getline) grub_strcpy (t + len + 1, n); grub_free (old_line); line = old_line = t; + /* Try again to execute the statement now that more input has + been appended. */ continue; } + /* The syntax error was not the result of an incomplete line. */ + handle_lua_error ("Lua syntax error"); + } + else + { + /* Handle errors other than syntax errors (out of memory, etc.). */ + handle_lua_error ("Lua parser failed"); } break; @@ -102,10 +136,10 @@ GRUB_MOD_INIT(lua) state = lua_open (); if (state) { - lua_gc(state, LUA_GCSTOP, 0); - luaL_openlibs(state); - luaL_register(state, "grub", grub_lua_lib); - lua_gc(state, LUA_GCRESTART, 0); + lua_gc (state, LUA_GCSTOP, 0); + luaL_openlibs (state); + luaL_register (state, "grub", grub_lua_lib); + lua_gc (state, LUA_GCRESTART, 0); grub_parser_register ("lua", &grub_lua_parser); } } @@ -115,6 +149,6 @@ GRUB_MOD_FINI(lua) if (state) { grub_parser_unregister (&grub_lua_parser); - lua_close(state); + lua_close (state); } } From 76f3b6e6b9c184d24544e4b75c323f6c5c8db544 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 19 May 2009 15:24:48 +0000 Subject: [PATCH 0765/1707] ident --- conf/x86_64-efi.rmk | 1 + loader/i386/linux_trampoline.S | 14 +++++++------- loader/i386/xnu_helper.S | 12 ++++++------ 3 files changed, 14 insertions(+), 13 deletions(-) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index ef36057ff..175f8cca4 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -139,6 +139,7 @@ appleldr_mod_LDFLAGS = $(COMMON_LDFLAGS) # For linux.mod. linux_mod_SOURCES = loader/i386/efi/linux.c loader/i386/linux_trampoline.S linux_mod_CFLAGS = $(COMMON_CFLAGS) +linux_mod_ASFLAGS = $(COMMON_ASFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) # For halt.mod. diff --git a/loader/i386/linux_trampoline.S b/loader/i386/linux_trampoline.S index 39821e1d3..eddaaf28f 100644 --- a/loader/i386/linux_trampoline.S +++ b/loader/i386/linux_trampoline.S @@ -31,19 +31,19 @@ VARIABLE(grub_linux_trampoline_start) base: pop %rsi - lea (cont1-base)(%rsi, 1), %rax - mov %eax, (jump_vector-base)(%rsi,1) + lea (cont1 - base) (%rsi, 1), %rax + mov %eax, (jump_vector - base) (%rsi, 1) - lea (gdt-base)(%rsi, 1), %rax - mov %rax, (gdtaddr-base)(%rsi,1) + lea (gdt - base) (%rsi, 1), %rax + mov %rax, (gdtaddr - base) (%rsi, 1) /* Switch to compatibility mode. */ - lidt (idtdesc-base)(%rsi,1) - lgdt (gdtdesc-base)(%rsi,1) + lidt (idtdesc - base) (%rsi, 1) + lgdt (gdtdesc - base) (%rsi, 1) /* Update %cs. Thanks to David Miller for pointing this mistake out. */ - ljmp *(jump_vector-base)(%rsi,1) + ljmp *(jump_vector - base) (%rsi, 1) cont1: .code32 diff --git a/loader/i386/xnu_helper.S b/loader/i386/xnu_helper.S index 77b0a6613..ad9c8f631 100644 --- a/loader/i386/xnu_helper.S +++ b/loader/i386/xnu_helper.S @@ -99,18 +99,18 @@ VARIABLE(grub_xnu_heap_size) cont0: - lea (cont1-base)(%rsi, 1), %rax - mov %eax, (jump_vector-base)(%rsi,1) + lea (cont1 - base) (%rsi, 1), %rax + mov %eax, (jump_vector - base) (%rsi, 1) - lea (gdt-base)(%rsi, 1), %rax - mov %rax, (gdt_addr-base)(%rsi,1) + lea (gdt - base) (%rsi, 1), %rax + mov %rax, (gdt_addr - base) (%rsi, 1) /* Switch to compatibility mode. */ - lgdt (gdtdesc-base)(%rsi,1) + lgdt (gdtdesc - base) (%rsi, 1) /* Update %cs. Thanks to David Miller for pointing this mistake out. */ - ljmp *(jump_vector-base)(%rsi,1) + ljmp *(jump_vector - base) (%rsi, 1) cont1: .code32 From 0a15ce802c27d64c28b19761e0e255f2a8a66b5e Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 19 May 2009 15:24:51 +0000 Subject: [PATCH 0766/1707] changelog --- ChangeLog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index abd465164..36a064aca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-19 Vladimir Serbinenko + + * conf/x86_64-efi.rmk (linux_mod_ASFLAGS): Add missing variable + * loader/i386/linux_trampoline.S: Fix identation + * loader/i386/xnu_helper.S: Likewise + 2009-05-18 Colin D Bennett Display error messages when parsing a Lua statement fails. Previously, From d6da58e631a5e490c84db5b501541c71f0071f2f Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 19 May 2009 22:51:50 +0000 Subject: [PATCH 0767/1707] Fix spacing and excessively long lines --- ChangeLog | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 36a064aca..9e5f87647 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,16 +3,16 @@ * conf/x86_64-efi.rmk (linux_mod_ASFLAGS): Add missing variable * loader/i386/linux_trampoline.S: Fix identation * loader/i386/xnu_helper.S: Likewise - + 2009-05-18 Colin D Bennett - Display error messages when parsing a Lua statement fails. Previously, - executing a syntactically invalid statement like ")foo" or "bar;" would - silently fail. + Display error messages when parsing a Lua statement fails. + Previously, executing a syntactically invalid statement like + ")foo" or "bar;" would silently fail. * script/lua/grub_main.c (handle_lua_error): New function. - (grub_lua_parse_line): Improved reporting of Lua parser and execution - errors. + (grub_lua_parse_line): Improved reporting of Lua parser and + execution errors. 2009-05-17 Vladimir Serbinenko @@ -30,9 +30,11 @@ loader/i386/efi/linux_trampoline.S * include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed declration - * kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here + * kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from + here * loader/i386/linux_trampoline.S: moved here - * loader/i386/efi/linux.c (allocate_pages): reserve space for trampoline + * loader/i386/efi/linux.c (allocate_pages): reserve space for + trampoline (jumpvector): removed (grub_linux_trampoline_start): new declaration (grub_linux_trampoline_end): likewise From b729776bfc245642576dddedc2be120dc3b19820 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 21 May 2009 20:36:52 +0000 Subject: [PATCH 0768/1707] 2009-05-21 Felix Zielcke * normal/i386: Remove. * normal/powerpc: Likewise. * normal/sparc64: Likewise. * normal/x86_64: Likewise. --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9e5f87647..577c82008 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-05-21 Felix Zielcke + + * normal/i386: Remove. + * normal/powerpc: Likewise. + * normal/sparc64: Likewise. + * normal/x86_64: Likewise. + 2009-05-19 Vladimir Serbinenko * conf/x86_64-efi.rmk (linux_mod_ASFLAGS): Add missing variable From 96b1619a75637b92ac84eb7ec63a62b1e615ebec Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 22 May 2009 19:52:43 +0000 Subject: [PATCH 0769/1707] 2009-05-22 Pavel Roskin * include/grub/i386/pc/kernel.h (grub_boot_drive): Change type to grub_uint8_t. (grub_root_drive): Likewise. * kern/i386/pc/startup.S (grub_boot_drive): Change size to byte, remove alignment. (grub_root_drive): Change size to byte. (grub_start_addr): Remove. (grub_end_addr): Likewise. (grub_apm_bios_info): Likewise. --- ChangeLog | 12 ++++++++++++ include/grub/i386/pc/kernel.h | 7 ++----- kern/i386/pc/startup.S | 22 ++-------------------- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/ChangeLog b/ChangeLog index 577c82008..9d1476cd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-05-22 Pavel Roskin + + * include/grub/i386/pc/kernel.h (grub_boot_drive): Change type + to grub_uint8_t. + (grub_root_drive): Likewise. + * kern/i386/pc/startup.S (grub_boot_drive): Change size to byte, + remove alignment. + (grub_root_drive): Change size to byte. + (grub_start_addr): Remove. + (grub_end_addr): Likewise. + (grub_apm_bios_info): Likewise. + 2009-05-21 Felix Zielcke * normal/i386: Remove. diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index b6650bc89..5acc883f5 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -69,13 +69,10 @@ extern grub_int32_t grub_install_bsd_part; extern char grub_prefix[]; /* The boot BIOS drive number. */ -extern grub_int32_t EXPORT_VAR(grub_boot_drive); +extern grub_uint8_t EXPORT_VAR(grub_boot_drive); /* The root BIOS drive number. */ -extern grub_int32_t grub_root_drive; - -/* The end address of the kernel. */ -extern grub_addr_t grub_end_addr; +extern grub_uint8_t grub_root_drive; #endif /* ! ASM_FILE */ diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 8e8b66135..fc83c4c0d 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -273,30 +273,12 @@ codestart: * This is the area for all of the special variables. */ - .p2align 2 /* force 4-byte alignment */ - VARIABLE(grub_boot_drive) - .long 0 + .byte 0 VARIABLE(grub_root_drive) - .long 0 + .byte 0 -VARIABLE(grub_start_addr) - .long _start - -VARIABLE(grub_end_addr) - .long END_SYMBOL - -VARIABLE(grub_apm_bios_info) - .word 0 /* version */ - .word 0 /* cseg */ - .long 0 /* offset */ - .word 0 /* cseg_16 */ - .word 0 /* dseg_16 */ - .word 0 /* cseg_len */ - .word 0 /* cseg_16_len */ - .word 0 /* dseg_16_len */ - .p2align 2 /* force 4-byte alignment */ /* From bf6a5fb2a842238e8aa4a1888106b4a875d44f88 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 22 May 2009 21:15:31 +0000 Subject: [PATCH 0770/1707] 2009-05-22 Pavel Roskin * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Remove. * configure.ac: Don't call grub_I386_CHECK_REGPARM_BUG. Define NESTED_FUNC_ATTR using AH_BOTTOM. Use regparm(1) only when compiling for the i386 targets, but not for the utilities. --- ChangeLog | 5 +++++ aclocal.m4 | 54 ---------------------------------------------------- configure.ac | 7 ++++++- 3 files changed, 11 insertions(+), 55 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d1476cd2..bff419ef4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-05-22 Pavel Roskin + * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Remove. + * configure.ac: Don't call grub_I386_CHECK_REGPARM_BUG. Define + NESTED_FUNC_ATTR using AH_BOTTOM. Use regparm(1) only when + compiling for the i386 targets, but not for the utilities. + * include/grub/i386/pc/kernel.h (grub_boot_drive): Change type to grub_uint8_t. (grub_root_drive): Likewise. diff --git a/aclocal.m4 b/aclocal.m4 index 779df3d39..38a9a4a7a 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -301,60 +301,6 @@ else fi ]) -dnl Check if the C compiler has a bug while using nested functions when -dnl mregparm is used on the i386. Some gcc versions do not pass the third -dnl parameter correctly to the nested function. -dnl Written by Marco Gerards. -AC_DEFUN(grub_I386_CHECK_REGPARM_BUG, -[AC_REQUIRE([AC_PROG_CC]) -AC_MSG_CHECKING([if GCC has the regparm=3 bug]) -AC_CACHE_VAL(grub_cv_i386_check_nested_functions, -[AC_RUN_IFELSE([AC_LANG_SOURCE( -[[ -static int -test (int *n) -{ - return *n == -1; -} - -static int -testfunc (int __attribute__ ((__regparm__ (3))) (*hook) (int a, int b, int *c)) -{ - int a = 0; - int b = 0; - int c = -1; - return hook (a, b, &c); -} - -int -main (void) -{ - int __attribute__ ((__regparm__ (3))) nestedfunc (int a, int b, int *c) - { - return a == b && test (c); - } - return testfunc (nestedfunc) ? 0 : 1; -} -]])], - [grub_cv_i386_check_nested_functions=no], - [grub_cv_i386_check_nested_functions=yes], - [grub_cv_i386_check_nested_functions=yes])]) - -AC_MSG_RESULT([$grub_cv_i386_check_nested_functions]) - -if test "x$grub_cv_i386_check_nested_functions" = xyes; then - AC_DEFINE([NESTED_FUNC_ATTR], - [__attribute__ ((__regparm__ (1)))], - [Catch gcc bug]) -else -dnl Unfortunately, the above test does not detect a bug in gcc-4.0. -dnl So use regparm 2 until a better test is found. - AC_DEFINE([NESTED_FUNC_ATTR], - [__attribute__ ((__regparm__ (1)))], - [Catch gcc bug]) -fi -]) - dnl Check if the C compiler generates calls to `__enable_execute_stack()'. AC_DEFUN(grub_CHECK_ENABLE_EXECUTE_STACK,[ AC_MSG_CHECKING([whether `$CC' generates calls to `__enable_execute_stack()']) diff --git a/configure.ac b/configure.ac index d84e2b68d..98cd84161 100644 --- a/configure.ac +++ b/configure.ac @@ -391,11 +391,16 @@ if test "x$target_cpu" = xi386; then grub_I386_ASM_PREFIX_REQUIREMENT grub_I386_ASM_ADDR32 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK - grub_I386_CHECK_REGPARM_BUG else AC_DEFINE([NESTED_FUNC_ATTR], [], [Catch gcc bug]) fi +AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL) +#define NESTED_FUNC_ATTR __attribute__ ((__regparm__ (1))) +#else +#define NESTED_FUNC_ATTR +#endif]) + # Restore the flags. CC="$tmp_CC" CFLAGS="$tmp_CFLAGS" From 861f03a5b99faa3f68d95a3669c2ac0c23c4ce9d Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 23 May 2009 20:51:09 +0000 Subject: [PATCH 0771/1707] 2009-05-23 Felix Zielcke * commands/i386/pc/drivemap.c (MODNAME): Remove. Update all users. --- ChangeLog | 4 ++++ commands/i386/pc/drivemap.c | 29 ++++++++++++++--------------- 2 files changed, 18 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index bff419ef4..15a116564 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-05-23 Felix Zielcke + + * commands/i386/pc/drivemap.c (MODNAME): Remove. Update all users. + 2009-05-22 Pavel Roskin * aclocal.m4 (grub_I386_CHECK_REGPARM_BUG): Remove. diff --git a/commands/i386/pc/drivemap.c b/commands/i386/pc/drivemap.c index f9710b8d9..98f4378d5 100644 --- a/commands/i386/pc/drivemap.c +++ b/commands/i386/pc/drivemap.c @@ -26,7 +26,6 @@ #include -#define MODNAME "drivemap" /* Real mode IVT slot (seg:off far pointer) for interrupt 0x13. */ static grub_uint32_t *const int13slot = UINT_TO_PTR (4 * 0x13); @@ -304,13 +303,13 @@ grub_cmd_drivemap (struct grub_extcmd *cmd, int argc, char **args) if (mapto == mapfrom) { /* Reset to default. */ - grub_dprintf (MODNAME, "Removing mapping for %s (%02x)\n", + grub_dprintf ("drivemap", "Removing mapping for %s (%02x)\n", args[0], mapfrom); drivemap_remove (mapfrom); return GRUB_ERR_NONE; } /* Set the mapping for the disk (overwrites any existing mapping). */ - grub_dprintf (MODNAME, "%s %s (%02x) = %s (%02x)\n", + grub_dprintf ("drivemap", "%s %s (%02x) = %s (%02x)\n", cmd->state[OPTIDX_SWAP].set ? "Swapping" : "Mapping", args[1], mapto, args[0], mapfrom); err = drivemap_set (mapto, mapfrom); @@ -349,16 +348,16 @@ install_int13_handler (int noret __attribute__ ((unused))) if (entries == 0) { /* No need to install the int13h handler. */ - grub_dprintf (MODNAME, "No drives marked as remapped, not installing " + grub_dprintf ("drivemap", "No drives marked as remapped, not installing " "our int13h handler.\n"); return GRUB_ERR_NONE; } - grub_dprintf (MODNAME, "Installing our int13h handler\n"); + grub_dprintf ("drivemap", "Installing our int13h handler\n"); /* Save the pointer to the old handler. */ grub_drivemap_oldhandler = *int13slot; - grub_dprintf (MODNAME, "Original int13 handler: %04x:%04x\n", + grub_dprintf ("drivemap", "Original int13 handler: %04x:%04x\n", (grub_drivemap_oldhandler >> 16) & 0x0ffff, grub_drivemap_oldhandler & 0x0ffff); @@ -366,7 +365,7 @@ install_int13_handler (int noret __attribute__ ((unused))) enough to hold the handler and its data. */ total_size = INT13H_OFFSET (&grub_drivemap_mapstart) + (entries + 1) * sizeof (int13map_node_t); - grub_dprintf (MODNAME, "Payload is %u bytes long\n", total_size); + grub_dprintf ("drivemap", "Payload is %u bytes long\n", total_size); handler_base = grub_mmap_malign_and_register (16, total_size, &drivemap_mmap, GRUB_MACHINE_MEMORY_RESERVED, @@ -376,7 +375,7 @@ install_int13_handler (int noret __attribute__ ((unused))) "memory for the int13h handler"); /* Copy int13h handler bundle to reserved area. */ - grub_dprintf (MODNAME, "Reserved memory at %p, copying handler\n", + grub_dprintf ("drivemap", "Reserved memory at %p, copying handler\n", handler_base); grub_memcpy (handler_base, &grub_drivemap_handler, INT13H_OFFSET (&grub_drivemap_mapstart)); @@ -385,22 +384,22 @@ install_int13_handler (int noret __attribute__ ((unused))) curentry = map_head; handler_map = (int13map_node_t *) (handler_base + INT13H_OFFSET (&grub_drivemap_mapstart)); - grub_dprintf (MODNAME, "Target map at %p, copying mappings\n", handler_map); + grub_dprintf ("drivemap", "Target map at %p, copying mappings\n", handler_map); for (i = 0; i < entries; ++i, curentry = curentry->next) { handler_map[i].disknum = curentry->newdrive; handler_map[i].mapto = curentry->redirto; - grub_dprintf (MODNAME, "\t#%d: 0x%02x <- 0x%02x\n", i, + grub_dprintf ("drivemap", "\t#%d: 0x%02x <- 0x%02x\n", i, handler_map[i].disknum, handler_map[i].mapto); } /* Signal end-of-map. */ handler_map[i].disknum = 0; handler_map[i].mapto = 0; - grub_dprintf (MODNAME, "\t#%d: 0x00 <- 0x00 (end)\n", i); + grub_dprintf ("drivemap", "\t#%d: 0x00 <- 0x00 (end)\n", i); /* Install our function as the int13h handler in the IVT. */ *int13slot = ((grub_uint32_t) handler_base) << 12; /* Segment address. */ - grub_dprintf (MODNAME, "New int13 handler: %04x:%04x\n", + grub_dprintf ("drivemap", "New int13 handler: %04x:%04x\n", (*int13slot >> 16) & 0x0ffff, *int13slot & 0x0ffff); return GRUB_ERR_NONE; @@ -415,7 +414,7 @@ uninstall_int13_handler (void) *int13slot = grub_drivemap_oldhandler; grub_mmap_free_and_unregister (drivemap_mmap); grub_drivemap_oldhandler = 0; - grub_dprintf (MODNAME, "Restored int13 handler: %04x:%04x\n", + grub_dprintf ("drivemap", "Restored int13 handler: %04x:%04x\n", (*int13slot >> 16) & 0x0ffff, *int13slot & 0x0ffff); return GRUB_ERR_NONE; @@ -425,9 +424,9 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT (drivemap) { - cmd = grub_register_extcmd (MODNAME, grub_cmd_drivemap, + cmd = grub_register_extcmd ("drivemap", grub_cmd_drivemap, GRUB_COMMAND_FLAG_BOTH, - MODNAME + "drivemap" " -l | -r | [-s] grubdev osdisk", "Manage the BIOS drive mappings", options); From 230c0ad633d7720629af693f68ff8ad6831edc90 Mon Sep 17 00:00:00 2001 From: cbennett Date: Sun, 24 May 2009 08:39:29 +0000 Subject: [PATCH 0772/1707] 2009-05-23 Colin D Bennett Cleaned up `include/grub/normal.h'. Grouped prototypes by definition file, and functions defined in `normal/menu.c' have had their prototypes moved to `include/grub/menu.h' for consistency. * include/grub/menu.h (grub_menu_execute_callback): Added; moved from normal.h. (grub_menu_get_entry): Likewise. (grub_menu_get_timeout): Likewise. (grub_menu_set_timeout): Likewise. (grub_menu_execute_entry): Likewise. (grub_menu_execute_with_fallback): Likewise. (grub_menu_entry_run): Likewise. * include/grub/normal.h: Re-ordered and grouped function prototypes by file that the function is defined in. (grub_menu_execute_callback): Removed; moved to menu.h. (grub_menu_get_entry): Likewise. (grub_menu_get_timeout): Likewise. (grub_menu_set_timeout): Likewise. (grub_menu_execute_entry): Likewise. (grub_menu_execute_with_fallback): Likewise. (grub_menu_entry_run): Likewise. (grub_menu_addentry): Renamed from this ... (grub_normal_add_menu_entry): ... to this. * normal/main.c (grub_menu_addentry): Renamed from this ... (grub_normal_add_menu_entry): ... to this. * script/sh/execute.c (grub_script_execute_menuentry): Update reference to renamed grub_menu_addentry function. --- ChangeLog | 33 +++++++++++++++++++++++++ include/grub/menu.h | 33 ++++++++++++++++++++++++- include/grub/normal.h | 57 +++++++++++++++++-------------------------- normal/main.c | 7 ++++-- script/sh/execute.c | 4 +-- 5 files changed, 95 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 15a116564..eac7ca707 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,36 @@ +2009-05-23 Colin D Bennett + + Cleaned up `include/grub/normal.h'. Grouped prototypes by + definition file, and functions defined in `normal/menu.c' have had + their prototypes moved to `include/grub/menu.h' for consistency. + + * include/grub/menu.h (grub_menu_execute_callback): Added; moved + from normal.h. + (grub_menu_get_entry): Likewise. + (grub_menu_get_timeout): Likewise. + (grub_menu_set_timeout): Likewise. + (grub_menu_execute_entry): Likewise. + (grub_menu_execute_with_fallback): Likewise. + (grub_menu_entry_run): Likewise. + + * include/grub/normal.h: Re-ordered and grouped function + prototypes by file that the function is defined in. + (grub_menu_execute_callback): Removed; moved to menu.h. + (grub_menu_get_entry): Likewise. + (grub_menu_get_timeout): Likewise. + (grub_menu_set_timeout): Likewise. + (grub_menu_execute_entry): Likewise. + (grub_menu_execute_with_fallback): Likewise. + (grub_menu_entry_run): Likewise. + (grub_menu_addentry): Renamed from this ... + (grub_normal_add_menu_entry): ... to this. + + * normal/main.c (grub_menu_addentry): Renamed from this ... + (grub_normal_add_menu_entry): ... to this. + + * script/sh/execute.c (grub_script_execute_menuentry): Update + reference to renamed grub_menu_addentry function. + 2009-05-23 Felix Zielcke * commands/i386/pc/drivemap.c (MODNAME): Remove. Update all users. diff --git a/include/grub/menu.h b/include/grub/menu.h index f11e00516..3bd25e875 100644 --- a/include/grub/menu.h +++ b/include/grub/menu.h @@ -1,4 +1,4 @@ -/* menu.h - Menu and menu entry model declarations. */ +/* menu.h - Menu model function prototypes and data structures. */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2009 Free Software Foundation, Inc. @@ -57,4 +57,35 @@ struct grub_menu }; typedef struct grub_menu *grub_menu_t; +/* Callback structure menu viewers can use to provide user feedback when + default entries are executed, possibly including fallback entries. */ +typedef struct grub_menu_execute_callback +{ + /* Called immediately before ENTRY is booted. */ + void (*notify_booting) (grub_menu_entry_t entry, void *userdata); + + /* Called when executing one entry has failed, and another entry, ENTRY, will + be executed as a fallback. The implementation of this function should + delay for a period of at least 2 seconds before returning in order to + allow the user time to read the information before it can be lost by + executing ENTRY. */ + void (*notify_fallback) (grub_menu_entry_t entry, void *userdata); + + /* Called when an entry has failed to execute and there is no remaining + fallback entry to attempt. */ + void (*notify_failure) (void *userdata); +} +*grub_menu_execute_callback_t; + + +grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no); +int grub_menu_get_timeout (void); +void grub_menu_set_timeout (int timeout); +void grub_menu_execute_entry (grub_menu_entry_t entry); +void grub_menu_execute_with_fallback (grub_menu_t menu, + grub_menu_entry_t entry, + grub_menu_execute_callback_t callback, + void *callback_data); +void grub_menu_entry_run (grub_menu_entry_t entry); + #endif /* GRUB_MENU_HEADER */ diff --git a/include/grub/normal.h b/include/grub/normal.h index 948289aa6..7d8122a2b 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -43,58 +43,47 @@ typedef enum grub_completion_type grub_completion_type_t; extern struct grub_menu_viewer grub_normal_text_menu_viewer; -/* Callback structure menu viewers can use to provide user feedback when - default entries are executed, possibly including fallback entries. */ -typedef struct grub_menu_execute_callback -{ - /* Called immediately before ENTRY is booted. */ - void (*notify_booting) (grub_menu_entry_t entry, void *userdata); - - /* Called when executing one entry has failed, and another entry, ENTRY, will - be executed as a fallback. The implementation of this function should - delay for a period of at least 2 seconds before returning in order to - allow the user time to read the information before it can be lost by - executing ENTRY. */ - void (*notify_fallback) (grub_menu_entry_t entry, void *userdata); - - /* Called when an entry has failed to execute and there is no remaining - fallback entry to attempt. */ - void (*notify_failure) (void *userdata); -} -*grub_menu_execute_callback_t; +/* Defined in `main.c'. */ void grub_enter_normal_mode (const char *config); void grub_normal_execute (const char *config, int nested, int batch); -void grub_menu_execute_with_fallback (grub_menu_t menu, - grub_menu_entry_t entry, - grub_menu_execute_callback_t callback, - void *callback_data); -void grub_menu_entry_run (grub_menu_entry_t entry); -void grub_menu_execute_entry(grub_menu_entry_t entry); -grub_menu_entry_t grub_menu_get_entry (grub_menu_t menu, int no); -int grub_menu_get_timeout (void); -void grub_menu_set_timeout (int timeout); +void grub_normal_init_page (void); +void grub_menu_init_page (int nested, int edit); +grub_err_t grub_normal_add_menu_entry (int argc, const char **args, + const char *sourcecode); +char *grub_file_getline (grub_file_t file); +void grub_cmdline_run (int nested); + +/* Defined in `cmdline.c'. */ int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, int echo_char, int readline); grub_err_t grub_set_history (int newsize); -void grub_normal_init_page (void); -void grub_menu_init_page (int nested, int edit); + +/* Defined in `completion.c'. */ char *grub_normal_do_completion (char *buf, int *restore, void (*hook) (const char *item, grub_completion_type_t type, int count)); + +/* Defined in `misc.c'. */ grub_err_t grub_normal_print_device_info (const char *name); + +/* Defined in `color.c'. */ char *grub_env_write_color_normal (struct grub_env_var *var, const char *val); char *grub_env_write_color_highlight (struct grub_env_var *var, const char *val); void grub_parse_color_name_pair (grub_uint8_t *ret, const char *name); + +/* Defined in `menu_text.c'. */ void grub_wait_after_message (void); -char *grub_file_getline (grub_file_t file); +/* Defined in `handler.c'. */ void read_handler_list (void); void free_handler_list (void); + +/* Defined in `dyncmd.c'. */ void read_command_list (void); + +/* Defined in `autofs.c'. */ void read_fs_list (void); -void grub_cmdline_run (int nested); -grub_err_t grub_menu_addentry (int argc, const char **args, - const char *sourcecode); + #ifdef GRUB_UTIL void grub_normal_init (void); diff --git a/normal/main.c b/normal/main.c index bc0808b02..9c5a82731 100644 --- a/normal/main.c +++ b/normal/main.c @@ -149,9 +149,12 @@ free_menu_entry_classes (struct grub_menu_entry_class *head) } } +/* Add a menu entry to the current menu context (as given by the environment + variable data slot `menu'). As the configuration file is read, the script + parser calls this when a menu entry is to be created. */ grub_err_t -grub_menu_addentry (int argc, const char **args, - const char *sourcecode) +grub_normal_add_menu_entry (int argc, const char **args, + const char *sourcecode) { const char *menutitle = 0; const char *menusourcecode; diff --git a/script/sh/execute.c b/script/sh/execute.c index 123bca8b1..0989f7917 100644 --- a/script/sh/execute.c +++ b/script/sh/execute.c @@ -222,8 +222,8 @@ grub_script_execute_menuentry (struct grub_script_cmd *cmd) } } - grub_menu_addentry (argcount, (const char **) args, - cmd_menuentry->sourcecode); + grub_normal_add_menu_entry (argcount, (const char **) args, + cmd_menuentry->sourcecode); /* Free arguments. */ for (i = 0; i < argcount; i++) From 8c2cab51066412fc9b524fcfc7f97722f1490dab Mon Sep 17 00:00:00 2001 From: chrfranke Date: Mon, 25 May 2009 19:36:50 +0000 Subject: [PATCH 0773/1707] 2009-05-25 Christian Franke * disk/ata.c (grub_ata_wait_not_busy): Add debug output of status register. (grub_atapi_identify): Add wait after drive select. (grub_ata_identify): Do more strict status register check before calling grub_atapi_identify (). Suppress error message if status register is 0x00 after command failure. Add status register check after PIO read to avoid bogus identify due to stuck DRQ. Thanks to Pavel Roskin for testing. (grub_device_initialize): Remove unsafe status register check. Thanks to 'phcoder' for problem report and patch. Prevent sign extension in debug message. --- ChangeLog | 14 +++++++++++ disk/ata.c | 74 +++++++++++++++++++++++++++++++----------------------- 2 files changed, 57 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index eac7ca707..60eb17dd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-05-25 Christian Franke + + * disk/ata.c (grub_ata_wait_not_busy): Add debug output of status + register. + (grub_atapi_identify): Add wait after drive select. + (grub_ata_identify): Do more strict status register check before + calling grub_atapi_identify (). Suppress error message if status + register is 0x00 after command failure. Add status register + check after PIO read to avoid bogus identify due to stuck DRQ. + Thanks to Pavel Roskin for testing. + (grub_device_initialize): Remove unsafe status register check. + Thanks to 'phcoder' for problem report and patch. + Prevent sign extension in debug message. + 2009-05-23 Colin D Bennett Cleaned up `include/grub/normal.h'. Grouped prototypes by diff --git a/disk/ata.c b/disk/ata.c index ea42d5951..b186f6dc9 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -41,11 +41,14 @@ grub_ata_wait_not_busy (struct grub_ata_device *dev, int milliseconds) grub_millisleep (1); int i = 1; - while (grub_ata_regget (dev, GRUB_ATA_REG_STATUS) & GRUB_ATA_STATUS_BUSY) + grub_uint8_t sts; + while ((sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS)) + & GRUB_ATA_STATUS_BUSY) { if (i >= milliseconds) { - grub_dprintf ("ata", "timeout: %dms\n", milliseconds); + grub_dprintf ("ata", "timeout: %dms, status=0x%x\n", + milliseconds, sts); return grub_error (GRUB_ERR_TIMEOUT, "ATA timeout"); } @@ -151,6 +154,7 @@ grub_atapi_identify (struct grub_ata_device *dev) return grub_errno; grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4); + grub_ata_wait (); if (grub_ata_check_ready (dev)) { grub_free (info); @@ -248,6 +252,7 @@ grub_ata_identify (struct grub_ata_device *dev) info16 = (grub_uint16_t *) info; grub_ata_regset (dev, GRUB_ATA_REG_DISK, 0xE0 | dev->device << 4); + grub_ata_wait (); if (grub_ata_check_ready (dev)) { grub_free (info); @@ -259,24 +264,39 @@ grub_ata_identify (struct grub_ata_device *dev) if (grub_ata_wait_drq (dev, 0, GRUB_ATA_TOUT_STD)) { - if (grub_ata_regget (dev, GRUB_ATA_REG_ERROR) & 0x04) /* ABRT */ - { - /* Device without ATA IDENTIFY, try ATAPI. */ - grub_free(info); - grub_errno = GRUB_ERR_NONE; - return grub_atapi_identify (dev); - } + grub_free (info); + grub_errno = GRUB_ERR_NONE; + grub_uint8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + + if ((sts & (GRUB_ATA_STATUS_BUSY | GRUB_ATA_STATUS_DRQ + | GRUB_ATA_STATUS_ERR)) == GRUB_ATA_STATUS_ERR + && (grub_ata_regget (dev, GRUB_ATA_REG_ERROR) & 0x04 /* ABRT */)) + /* Device without ATA IDENTIFY, try ATAPI. */ + return grub_atapi_identify (dev); + + else if (sts == 0x00) + /* No device, return error but don't print message. */ + return GRUB_ERR_UNKNOWN_DEVICE; + else - { - /* Error. */ - grub_free(info); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "device can not be identified"); - } + /* Other Error. */ + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "device can not be identified"); } grub_ata_pio_read (dev, info, GRUB_DISK_SECTOR_SIZE); + /* Re-check status to avoid bogus identify data due to stuck DRQ. */ + grub_uint8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); + if (sts & (GRUB_ATA_STATUS_BUSY | GRUB_ATA_STATUS_DRQ | GRUB_ATA_STATUS_ERR)) + { + grub_dprintf ("ata", "bad status=0x%x\n", sts); + grub_free (info); + /* No device, return error but don't print message. */ + grub_errno = GRUB_ERR_NONE; + return GRUB_ERR_UNKNOWN_DEVICE; + } + /* Now it is certain that this is not an ATAPI device. */ dev->atapi = 0; @@ -334,26 +354,12 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) grub_ata_regset (dev, GRUB_ATA_REG_DISK, dev->device << 4); grub_ata_wait (); - /* If status is 0x00, it is safe to assume that there - is no device (or only a !READY) device connected. */ - grub_int8_t sts = grub_ata_regget (dev, GRUB_ATA_REG_STATUS); - grub_dprintf ("ata", "status=0x%x\n", sts); - if (sts == 0x00) - { - grub_free(dev); - return 0; - } - /* Try to detect if the port is in use by writing to it, waiting for a while and reading it again. If the value - was preserved, there is a device connected. - But this tests often detects a second (slave) device - connected to a SATA controller which supports only one - (master) device. In this case, the status register - check above usually works. */ + was preserved, there is a device connected. */ grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A); grub_ata_wait (); - grub_int8_t sec = grub_ata_regget (dev, GRUB_ATA_REG_SECTORS); + grub_uint8_t sec = grub_ata_regget (dev, GRUB_ATA_REG_SECTORS); grub_dprintf ("ata", "sectors=0x%x\n", sec); if (sec != 0x5A) { @@ -361,6 +367,12 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) return 0; } + /* The above test may detect a second (slave) device + connected to a SATA controller which supports only one + (master) device. It is not safe to use the status register + READY bit to check for controller channel existence. Some + ATAPI commands (RESET, DIAGNOSTIC) may clear this bit. */ + /* Use the IDENTIFY DEVICE command to query the device. */ if (grub_ata_identify (dev)) { From cd0d5e30407db038dd8c06fc38f2a89a8f4158b6 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 26 May 2009 20:47:00 +0000 Subject: [PATCH 0774/1707] 2009-05-26 Pavel Roskin * util/getroot.c (grub_util_get_dev_abstraction): Mark os_dev as possibly unused. --- ChangeLog | 5 +++++ util/getroot.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 60eb17dd3..ec0c2a1c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-26 Pavel Roskin + + * util/getroot.c (grub_util_get_dev_abstraction): Mark os_dev as + possibly unused. + 2009-05-25 Christian Franke * disk/ata.c (grub_ata_wait_not_busy): Add debug output of status diff --git a/util/getroot.c b/util/getroot.c index b6aae392f..5f892afa6 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -398,7 +398,7 @@ grub_guess_root_device (const char *dir) } int -grub_util_get_dev_abstraction (const char *os_dev) +grub_util_get_dev_abstraction (const char *os_dev UNUSED) { #ifdef __linux__ /* Check for LVM. */ From f0f8bbe243b74bf5b9318a41c6e7ac9c61c6abd6 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 26 May 2009 23:19:42 +0000 Subject: [PATCH 0775/1707] 2009-05-26 Pavel Roskin * genmk.rb: Avoid shadowing variable `s', rename the outer `s' to `str'. --- ChangeLog | 3 +++ genmk.rb | 10 +++++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ec0c2a1c7..893a21c06 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-05-26 Pavel Roskin + * genmk.rb: Avoid shadowing variable `s', rename the outer `s' + to `str'. + * util/getroot.c (grub_util_get_dev_abstraction): Mark os_dev as possibly unused. diff --git a/genmk.rb b/genmk.rb index 3532cd876..abdb8ca6b 100644 --- a/genmk.rb +++ b/genmk.rb @@ -304,20 +304,20 @@ print l print "# Generated by genmk.rb, please don't edit!\n" cont = false -s = nil +str = nil while l = gets if cont - s += l + str += l else - s = l + str = l end print l cont = (/\\$/ =~ l) unless cont - s.gsub!(/\\\n/, ' ') + str.gsub!(/\\\n/, ' ') - if /^([a-zA-Z0-9_]+)\s*\+?=\s*(.*?)\s*$/ =~ s + if /^([a-zA-Z0-9_]+)\s*\+?=\s*(.*?)\s*$/ =~ str var, args = $1, $2 if var =~ /^([a-zA-Z0-9_]+)_([A-Z]+)$/ From cbb3c83ee456cbe30c0d4d68af57d05f829426bf Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 3 Jun 2009 13:49:27 +0000 Subject: [PATCH 0776/1707] 2009-05-28 Pavel Roskin * fs/hfs.c (grub_hfs_find_dir): Skip sequences of slashes, not just one slash. That's how grub_fshelp_find_file() does it. --- ChangeLog | 5 +++++ fs/hfs.c | 7 ++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 893a21c06..7a184c0e4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-28 Pavel Roskin + + * fs/hfs.c (grub_hfs_find_dir): Skip sequences of slashes, not + just one slash. That's how grub_fshelp_find_file() does it. + 2009-05-26 Pavel Roskin * genmk.rb: Avoid shadowing variable `s', rename the outer `s' diff --git a/fs/hfs.c b/fs/hfs.c index 056fce1fb..fe5d2694f 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -887,7 +887,8 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, return grub_errno; path = origpath; - path++; + while (*path == '/') + path++; while (path && grub_strlen (path)) { @@ -901,8 +902,8 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, next = grub_strchr (path, '/'); if (next) { - next[0] = '\0'; - next++; + while (*next == '/') + *(next++) = '\0'; } struct grub_hfs_catalog_key key; From 57788cfdf6da9d3d1bc32281ba47961574dba3b9 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 3 Jun 2009 13:49:52 +0000 Subject: [PATCH 0777/1707] 2009-05-28 Pavel Roskin * Makefile.in: Don't use "cp -d", it doesn't work on FreeBSD. Remove the original symlink explicitly. * fs/hfs.c (grub_hfs_find_dir): Skip sequences of slashes, not just one slash. That's how grub_fshelp_find_file() does it. --- ChangeLog | 3 +++ Makefile.in | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7a184c0e4..524b57e85 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-05-28 Pavel Roskin + * Makefile.in: Don't use "cp -d", it doesn't work on FreeBSD. + Remove the original symlink explicitly. + * fs/hfs.c (grub_hfs_find_dir): Skip sequences of slashes, not just one slash. That's how grub_fshelp_find_file() does it. diff --git a/Makefile.in b/Makefile.in index 5e3d74461..cd79b0b05 100644 --- a/Makefile.in +++ b/Makefile.in @@ -218,7 +218,8 @@ install-local: all if test -f "$$dir$$file"; then \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ elif test -L "$$dir$$file"; then \ - cp -d $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ + rm -rf $(DESTDIR)$(includedir)/$$dest && \ + cp -fP $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ fi; \ done $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) From f6fd460a40badf7ce32f238a3ba164e93980ae19 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 3 Jun 2009 13:53:10 +0000 Subject: [PATCH 0778/1707] 2009-06-03 Felix Zielcke * util/grub-mkconfig.in (update_grub_dir): Rename to grub_mkconfig_dir. --- ChangeLog | 4 ++++ util/grub-mkconfig.in | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 524b57e85..cc11a9875 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-03 Felix Zielcke + + * util/grub-mkconfig.in (update_grub_dir): Rename to grub_mkconfig_dir. + 2009-05-28 Pavel Roskin * Makefile.in: Don't use "cp -d", it doesn't work on FreeBSD. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index f73def2a6..ff9259002 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -1,7 +1,7 @@ #! /bin/sh -e # Generate grub.cfg by inspecting /boot contents. -# Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. +# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -190,7 +190,7 @@ cat << EOF # DO NOT EDIT THIS FILE # # It is automatically generated by $0 using templates -# from ${update_grub_dir} and settings from ${sysconfdir}/default/grub +# from ${grub_mkconfig_dir} and settings from ${sysconfdir}/default/grub # EOF From 2bf5885a3da47b2d90b0a7979fc78a6378247efb Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 4 Jun 2009 11:18:18 +0000 Subject: [PATCH 0779/1707] 2009-06-04 Robert Millan Simplify the code duplication in commands/search.c. * commands/search.c (search_label, search_fs_uuid): Merge into ... (search_fs): ... this. Update all users. --- ChangeLog | 7 ++++ commands/search.c | 81 +++++++++-------------------------------------- 2 files changed, 22 insertions(+), 66 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc11a9875..d79342f8e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-04 Robert Millan + + Simplify the code duplication in commands/search.c. + + * commands/search.c (search_label, search_fs_uuid): Merge into ... + (search_fs): ... this. Update all users. + 2009-06-03 Felix Zielcke * util/grub-mkconfig.in (update_grub_dir): Rename to grub_mkconfig_dir. diff --git a/commands/search.c b/commands/search.c index 03884a9f2..5f8d1b51d 100644 --- a/commands/search.c +++ b/commands/search.c @@ -1,7 +1,7 @@ /* search.c - search devices based on a file or a filesystem label */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -37,11 +37,11 @@ static const struct grub_arg_option options[] = }; static void -search_label (const char *key, const char *var) +search_fs (const char *key, const char *var, int is_uuid) { int count = 0; auto int iterate_device (const char *name); - + int iterate_device (const char *name) { grub_device_t dev; @@ -53,14 +53,17 @@ search_label (const char *key, const char *var) grub_fs_t fs; fs = grub_fs_probe (dev); - if (fs && fs->label) + +#define QUID(x) (is_uuid ? (x)->uuid : (x)->label) + + if (fs && QUID(fs)) { - char *label; + char *quid; - (fs->label) (dev, &label); - if (grub_errno == GRUB_ERR_NONE && label) + (QUID(fs)) (dev, &quid); + if (grub_errno == GRUB_ERR_NONE && quid) { - if (grub_strcmp (label, key) == 0) + if (grub_strcmp (quid, key) == 0) { /* Found! */ count++; @@ -73,67 +76,13 @@ search_label (const char *key, const char *var) grub_printf (" %s", name); } - grub_free (label); + grub_free (quid); } } grub_device_close (dev); } - - grub_errno = GRUB_ERR_NONE; - return abort; - } - - grub_device_iterate (iterate_device); - - if (count == 0) - grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key); -} - -static void -search_fs_uuid (const char *key, const char *var) -{ - int count = 0; - auto int iterate_device (const char *name); - - int iterate_device (const char *name) - { - grub_device_t dev; - int abort = 0; - - dev = grub_device_open (name); - if (dev) - { - grub_fs_t fs; - - fs = grub_fs_probe (dev); - if (fs && fs->uuid) - { - char *uuid; - - (fs->uuid) (dev, &uuid); - if (grub_errno == GRUB_ERR_NONE && uuid) - { - if (grub_strcasecmp (uuid, key) == 0) - { - /* Found! */ - count++; - if (var) - { - grub_env_set (var, name); - abort = 1; - } - else - grub_printf (" %s", name); - } - - grub_free (uuid); - } - } - - grub_device_close (dev); - } - + grub_errno = GRUB_ERR_NONE; return abort; } @@ -207,9 +156,9 @@ grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) var = state[3].arg ? state[3].arg : "root"; if (state[1].set) - search_label (args[0], var); + search_fs (args[0], var, 0); else if (state[2].set) - search_fs_uuid (args[0], var); + search_fs (args[0], var, 1); else search_file (args[0], var); From f4448a07923d0b4000f7d8d2d690863e38668ae4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 4 Jun 2009 11:37:44 +0000 Subject: [PATCH 0780/1707] 2009-06-04 Robert Millan Prevent GRUB from probing floppies during boot. * conf/common.rmk (search_mod_CFLAGS): Use `-Werror -Wall'. * commands/search.c (options): Add --no-floppy. (search_fs, search_file, grub_cmd_search): Support --no-floppy. * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Use --no-floppy when searching for UUIDs. --- ChangeLog | 10 ++++++++++ commands/search.c | 31 ++++++++++++++++++++++--------- conf/common.rmk | 2 +- util/grub-mkconfig_lib.in | 2 +- 4 files changed, 34 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d79342f8e..30d9c7969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-06-04 Robert Millan + + Prevent GRUB from probing floppies during boot. + + * conf/common.rmk (search_mod_CFLAGS): Use `-Werror -Wall'. + * commands/search.c (options): Add --no-floppy. + (search_fs, search_file, grub_cmd_search): Support --no-floppy. + * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Use + --no-floppy when searching for UUIDs. + 2009-06-04 Robert Millan Simplify the code duplication in commands/search.c. diff --git a/commands/search.c b/commands/search.c index 5f8d1b51d..301b663e5 100644 --- a/commands/search.c +++ b/commands/search.c @@ -29,15 +29,16 @@ static const struct grub_arg_option options[] = { - {"file", 'f', 0, "search devices by a file (default)", 0, 0}, - {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, - {"fs-uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, - {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, + {"file", 'f', 0, "search devices by a file (default)", 0, 0}, + {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, + {"fs-uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, + {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, + {"no-floppy", 'n', 0, "do not probe any floppy drive", 0, 0}, {0, 0, 0, 0, 0, 0} }; static void -search_fs (const char *key, const char *var, int is_uuid) +search_fs (const char *key, const char *var, int no_floppy, int is_uuid) { int count = 0; auto int iterate_device (const char *name); @@ -46,6 +47,12 @@ search_fs (const char *key, const char *var, int is_uuid) { grub_device_t dev; int abort = 0; + + /* Skip floppy drives when requested. */ + if (no_floppy && + name[0] == 'f' && name[1] == 'd' && + name[2] >= '0' && name[2] <= '9') + return 0; dev = grub_device_open (name); if (dev) @@ -94,7 +101,7 @@ search_fs (const char *key, const char *var, int is_uuid) } static void -search_file (const char *key, const char *var) +search_file (const char *key, const char *var, int no_floppy) { int count = 0; char *buf = 0; @@ -107,6 +114,12 @@ search_file (const char *key, const char *var) grub_file_t file; int abort = 0; + /* Skip floppy drives when requested. */ + if (no_floppy && + name[0] == 'f' && name[1] == 'd' && + name[2] >= '0' && name[2] <= '9') + return 0; + len = grub_strlen (name) + 2 + grub_strlen (key) + 1; p = grub_realloc (buf, len); if (! p) @@ -156,11 +169,11 @@ grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) var = state[3].arg ? state[3].arg : "root"; if (state[1].set) - search_fs (args[0], var, 0); + search_fs (args[0], var, state[4].set, 0); else if (state[2].set) - search_fs (args[0], var, 1); + search_fs (args[0], var, state[4].set, 1); else - search_file (args[0], var); + search_file (args[0], var, state[4].set); return grub_errno; } diff --git a/conf/common.rmk b/conf/common.rmk index 1b9a6cdb4..ca18c534a 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -413,7 +413,7 @@ help_mod_LDFLAGS = $(COMMON_LDFLAGS) # For search.mod. search_mod_SOURCES = commands/search.c -search_mod_CFLAGS = $(COMMON_CFLAGS) +search_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall search_mod_LDFLAGS = $(COMMON_LDFLAGS) # For test.mod. diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 0c5c45621..9afbd3b1f 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -144,7 +144,7 @@ prepare_grub_to_access_device () # otherwise set root as per value in device.map. echo "set root=`${grub_probe} --device ${device} --target=drive`" if fs_uuid="`${grub_probe} --device ${device} --target=fs_uuid 2> /dev/null`" ; then - echo "search --fs-uuid --set ${fs_uuid}" + echo "search --no-floppy --fs-uuid --set ${fs_uuid}" fi } From fda6cb987feaddeddddf439fa4204a2a0c40d541 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 16:18:35 +0000 Subject: [PATCH 0781/1707] 2009-06-04 Vladimir Serbinenko Script fixes * include/grub/script_sh.h (grub_script_cmdline): remove cmdline (grub_lexer_param): add tokenonhold (grub_script_create_cmdline): remove cmdline. All callers updated (grub_script_function_create): make functionname grub_script_arg. All callers updated (grub_script_execute_argument_to_string): new prototype * kern/parser.c (state_transitions): reorder (grub_parser_cmdline_state): fix a bug and make more compact * script/sh/execute.c (grub_script_execute_argument_to_string): make global (grub_script_execute_cmdline): use new format * script/sh/function.c (grub_script_function_create): make functionname grub_script_arg. All callers updated * script/sh/lexer.c (grub_script_lexer_init): initilaize tokenonhold (grub_script_yylex): remove (grub_script_yylex2): renamed to ... (grub_script_yylex): ...renamed parse the expressions like a${b}c * script/sh/parser.y (GRUB_PARSER_TOKEN_ARG): new typed terminal (GRUB_PARSER_TOKEN_VAR): remove (GRUB_PARSER_TOKEN_NAME): likewise ("if"): declare as typeless ("while"): likewise ("function"): likewise ("else"): likewise ("then"): likewise ("fi"): likewise (text): remove (argument): likewise (script): accept empty scripts and make exit on error (arguments): use GRUB_PARSER_TOKEN_ARG (function): likewise (command): move error handling to script (menuentry): move grub_script_lexer_ref before * script/sh/script.c (grub_script_create_cmdline): remove cmdline argument. All callers updated --- ChangeLog | 41 +++++ include/grub/script_sh.h | 14 +- kern/parser.c | 30 ++- script/sh/execute.c | 17 +- script/sh/function.c | 9 +- script/sh/lexer.c | 389 +++++++++++++++++++++------------------ script/sh/parser.y | 81 ++------ script/sh/script.c | 3 +- 8 files changed, 304 insertions(+), 280 deletions(-) diff --git a/ChangeLog b/ChangeLog index 30d9c7969..e4e24cbaa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2009-06-04 Vladimir Serbinenko + + Script fixes + + * include/grub/script_sh.h (grub_script_cmdline): remove cmdline + (grub_lexer_param): add tokenonhold + (grub_script_create_cmdline): remove cmdline. All callers updated + (grub_script_function_create): make functionname + grub_script_arg. All callers updated + (grub_script_execute_argument_to_string): new prototype + * kern/parser.c (state_transitions): reorder + (grub_parser_cmdline_state): fix a bug and make more compact + * script/sh/execute.c (grub_script_execute_argument_to_string): + make global + (grub_script_execute_cmdline): use new format + * script/sh/function.c (grub_script_function_create): make functionname + grub_script_arg. All callers updated + * script/sh/lexer.c (grub_script_lexer_init): initilaize tokenonhold + (grub_script_yylex): remove + (grub_script_yylex2): renamed to ... + (grub_script_yylex): ...renamed + parse the expressions like a${b}c + * script/sh/parser.y (GRUB_PARSER_TOKEN_ARG): new typed terminal + (GRUB_PARSER_TOKEN_VAR): remove + (GRUB_PARSER_TOKEN_NAME): likewise + ("if"): declare as typeless + ("while"): likewise + ("function"): likewise + ("else"): likewise + ("then"): likewise + ("fi"): likewise + (text): remove + (argument): likewise + (script): accept empty scripts and make exit on error + (arguments): use GRUB_PARSER_TOKEN_ARG + (function): likewise + (command): move error handling to script + (menuentry): move grub_script_lexer_ref before + * script/sh/script.c (grub_script_create_cmdline): remove cmdline + argument. All callers updated + 2009-06-04 Robert Millan Prevent GRUB from probing floppies during boot. diff --git a/include/grub/script_sh.h b/include/grub/script_sh.h index 159da6225..ab5bf431a 100644 --- a/include/grub/script_sh.h +++ b/include/grub/script_sh.h @@ -77,11 +77,6 @@ struct grub_script_cmdline /* The arguments for this command. */ struct grub_script_arglist *arglist; - - /* The command name of this command. XXX: Perhaps an argument - should be used for this so we can use variables as command - name. */ - char *cmdname; }; /* A block of commands, this can be used to group commands. */ @@ -161,6 +156,9 @@ struct grub_lexer_param /* Size of RECORDING. */ int recordlen; + + /* The token that is already parsed but not yet returned. */ + int tokenonhold; }; /* State of the parser as passes to the parser. */ @@ -191,7 +189,6 @@ grub_script_add_arglist (struct grub_parser_param *state, struct grub_script_arg *arg); struct grub_script_cmd * grub_script_create_cmdline (struct grub_parser_param *state, - char *cmdname, struct grub_script_arglist *arglist); struct grub_script_cmd * grub_script_create_cmdblock (struct grub_parser_param *state); @@ -276,7 +273,7 @@ struct grub_script_function }; typedef struct grub_script_function *grub_script_function_t; -grub_script_function_t grub_script_function_create (char *functionname, +grub_script_function_t grub_script_function_create (struct grub_script_arg *functionname, struct grub_script *cmd); void grub_script_function_remove (const char *name); grub_script_function_t grub_script_function_find (char *functionname); @@ -284,4 +281,7 @@ int grub_script_function_iterate (int (*iterate) (grub_script_function_t)); int grub_script_function_call (grub_script_function_t func, int argc, char **args); +char * +grub_script_execute_argument_to_string (struct grub_script_arg *arg); + #endif /* ! GRUB_NORMAL_PARSER_HEADER */ diff --git a/kern/parser.c b/kern/parser.c index 685ab2250..ee6b169da 100644 --- a/kern/parser.c +++ b/kern/parser.c @@ -47,8 +47,8 @@ static struct grub_parser_state_transition state_transitions[] = { GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME2, '{', 0}, { GRUB_PARSER_STATE_QVAR, GRUB_PARSER_STATE_QVARNAME, 0, 1}, - { GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_DQUOTE, ' ', 1}, { GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_TEXT, '\"', 0}, + { GRUB_PARSER_STATE_QVARNAME, GRUB_PARSER_STATE_DQUOTE, ' ', 1}, { GRUB_PARSER_STATE_QVARNAME2, GRUB_PARSER_STATE_DQUOTE, '}', 0}, { 0, 0, 0, 0} @@ -60,9 +60,7 @@ grub_parser_state_t grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) { struct grub_parser_state_transition *transition; - struct grub_parser_state_transition *next_match = 0; struct grub_parser_state_transition default_transition; - int found = 0; default_transition.to_state = state; default_transition.keep_value = 1; @@ -70,26 +68,24 @@ grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) /* Look for a good translation. */ for (transition = state_transitions; transition->from_state; transition++) { + if (transition->from_state != state) + continue; /* An exact match was found, use it. */ - if (transition->from_state == state && transition->input == c) - { - found = 1; - break; - } + if (transition->input == c) + break; + + if (transition->input == ' ' && ! grub_isalpha (c) + && ! grub_isdigit (c) && c != '_') + break; /* A less perfect match was found, use this one if no exact match can be found. */ - if (transition->from_state == state && transition->input == 0) - next_match = transition; + if (transition->input == 0) + break; } - if (! found) - { - if (next_match) - transition = next_match; - else - transition = &default_transition; - } + if (! transition->from_state) + transition = &default_transition; if (transition->keep_value) *result = c; diff --git a/script/sh/execute.c b/script/sh/execute.c index 0989f7917..e0b7b2ebf 100644 --- a/script/sh/execute.c +++ b/script/sh/execute.c @@ -37,7 +37,7 @@ grub_script_execute_cmd (struct grub_script_cmd *cmd) /* Parse ARG and return the textual representation. Add strings are concatenated and all values of the variables are filled in. */ -static char * +char * grub_script_execute_argument_to_string (struct grub_script_arg *arg) { int size = 0; @@ -93,20 +93,22 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) int argcount = 0; grub_script_function_t func = 0; char errnobuf[6]; + char *cmdname; /* Lookup the command. */ - grubcmd = grub_command_find (cmdline->cmdname); + cmdname = grub_script_execute_argument_to_string (cmdline->arglist->arg); + grubcmd = grub_command_find (cmdname); if (! grubcmd) { /* Ignore errors. */ grub_errno = GRUB_ERR_NONE; /* It's not a GRUB command, try all functions. */ - func = grub_script_function_find (cmdline->cmdname); + func = grub_script_function_find (cmdname); if (! func) { /* As a last resort, try if it is an assignment. */ - char *assign = grub_strdup (cmdline->cmdname); + char *assign = grub_strdup (cmdname); char *eq = grub_strchr (assign, '='); if (eq) @@ -123,14 +125,15 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) return 0; } } + grub_free (cmdname); - if (cmdline->arglist) + if (cmdline->arglist->next) { - argcount = cmdline->arglist->argcount; + argcount = cmdline->arglist->argcount - 1; /* Create argv from the arguments. */ args = grub_malloc (sizeof (char *) * argcount); - for (arglist = cmdline->arglist; arglist; arglist = arglist->next) + for (arglist = cmdline->arglist->next; arglist; arglist = arglist->next) { char *str; str = grub_script_execute_argument_to_string (arglist->arg); diff --git a/script/sh/function.c b/script/sh/function.c index db6b903cd..dc411cc1f 100644 --- a/script/sh/function.c +++ b/script/sh/function.c @@ -24,7 +24,8 @@ static grub_script_function_t grub_script_function_list; grub_script_function_t -grub_script_function_create (char *functionname, struct grub_script *cmd) +grub_script_function_create (struct grub_script_arg *functionname_arg, + struct grub_script *cmd) { grub_script_function_t func; grub_script_function_t *p; @@ -33,7 +34,7 @@ grub_script_function_create (char *functionname, struct grub_script *cmd) if (! func) return 0; - func->name = grub_strdup (functionname); + func->name = grub_script_execute_argument_to_string (functionname_arg); if (! func->name) { grub_free (func); @@ -46,14 +47,14 @@ grub_script_function_create (char *functionname, struct grub_script *cmd) p = &grub_script_function_list; while (*p) { - if (grub_strcmp ((*p)->name, functionname) >= 0) + if (grub_strcmp ((*p)->name, func->name) >= 0) break; p = &((*p)->next); } /* If the function already exists, overwrite the old function. */ - if (*p && grub_strcmp ((*p)->name, functionname) == 0) + if (*p && grub_strcmp ((*p)->name, func->name) == 0) { grub_script_function_t q; diff --git a/script/sh/lexer.c b/script/sh/lexer.c index 8bae4871b..3ec78278d 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -62,6 +62,7 @@ grub_script_lexer_init (char *script, grub_reader_getline_t getline) param->recording = 0; param->recordpos = 0; param->recordlen = 0; + param->tokenonhold = 0; return param; } @@ -135,225 +136,249 @@ nextchar (struct grub_lexer_param *state) state->script++; } -int -grub_script_yylex2 (union YYSTYPE *yylval, - struct grub_parser_param *parsestate); - int grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) -{ - int r = -1; - - while (r == -1) - { - r = grub_script_yylex2 (yylval, parsestate); - if (r == ' ') - r = -1; - } - return r; -} - -int -grub_script_yylex2 (union YYSTYPE *yylval, struct grub_parser_param *parsestate) { grub_parser_state_t newstate; char use; char *buffer; char *bp; struct grub_lexer_param *state = parsestate->lexerstate; + int firstrun = 1; - if (state->done) - return 0; + yylval->arg = 0; - if (! *state->script) + if (state->tokenonhold) { - /* Check if more tokens are requested by the parser. */ - if ((state->refs - || state->state == GRUB_PARSER_STATE_ESC) - && state->getline) + int token = state->tokenonhold; + state->tokenonhold = 0; + return token; + } + + for (;! state->done && (*state->script || firstrun); firstrun = 0) + { + + if (! *state->script) { - while (!state->script || ! grub_strlen (state->script)) + /* Check if more tokens are requested by the parser. */ + if (((state->refs && ! parsestate->err) + || state->state == GRUB_PARSER_STATE_ESC) + && state->getline) + { + int doexit = 0; + while (!state->script || ! grub_strlen (state->script)) + { + grub_free (state->newscript); + state->newscript = 0; + state->getline (&state->newscript, 1); + state->script = state->newscript; + if (! state->script) + { + doexit = 1; + break; + } + } + if (doexit) + break; + grub_dprintf ("scripting", "token=`\\n'\n"); + recordchar (state, '\n'); + if (state->state != GRUB_PARSER_STATE_ESC) + { + state->tokenonhold = '\n'; + break; + } + } + else { grub_free (state->newscript); state->newscript = 0; - state->getline (&state->newscript, 1); - state->script = state->newscript; - if (! state->script) - return 0; - } - grub_dprintf ("scripting", "token=`\\n'\n"); - recordchar (state, '\n'); - if (state->state != GRUB_PARSER_STATE_ESC) - return '\n'; - } - else - { - grub_free (state->newscript); - state->newscript = 0; - state->done = 1; - grub_dprintf ("scripting", "token=`\\n'\n"); - return '\n'; - } - } - - newstate = grub_parser_cmdline_state (state->state, *state->script, &use); - - /* Check if it is a text. */ - if (check_textstate (newstate)) - { - /* In case the string is not quoted, this can be a one char - length symbol. */ - if (newstate == GRUB_PARSER_STATE_TEXT) - { - switch (*state->script) - { - case ' ': - while (*state->script) - { - newstate = grub_parser_cmdline_state (state->state, - *state->script, &use); - if (! (state->state == GRUB_PARSER_STATE_TEXT - && *state->script == ' ')) - { - grub_dprintf ("scripting", "token=` '\n"); - return ' '; - } - state->state = newstate; - nextchar (state); - } - grub_dprintf ("scripting", "token=` '\n"); - return ' '; - case '{': - case '}': - case ';': - case '\n': - { - char c; - grub_dprintf ("scripting", "token=`%c'\n", *state->script); - c = *state->script;; - nextchar (state); - return c; - } + state->done = 1; + grub_dprintf ("scripting", "token=`\\n'\n"); + state->tokenonhold = '\n'; + break; } } - /* XXX: Use a better size. */ - buffer = grub_script_malloc (parsestate, 2048); - if (! buffer) - return 0; - - bp = buffer; - - /* Read one token, possible quoted. */ - while (*state->script) + newstate = grub_parser_cmdline_state (state->state, *state->script, &use); + + /* Check if it is a text. */ + if (check_textstate (newstate)) { - newstate = grub_parser_cmdline_state (state->state, - *state->script, &use); - - /* Check if a variable name starts. */ - if (check_varstate (newstate)) - break; - - /* If the string is not quoted or escaped, stop processing - when a special token was found. It will be recognized - next time when this function is called. */ - if (newstate == GRUB_PARSER_STATE_TEXT - && state->state != GRUB_PARSER_STATE_ESC) + /* In case the string is not quoted, this can be a one char + length symbol. */ + if (newstate == GRUB_PARSER_STATE_TEXT) { - int breakout = 0; - - switch (use) + int doexit = 0; + switch (*state->script) { case ' ': + while (*state->script) + { + newstate = grub_parser_cmdline_state (state->state, + *state->script, &use); + if (! (state->state == GRUB_PARSER_STATE_TEXT + && *state->script == ' ')) + { + grub_dprintf ("scripting", "token=` '\n"); + if (! firstrun) + doexit = 1; + break; + } + state->state = newstate; + nextchar (state); + } + grub_dprintf ("scripting", "token=` '\n"); + if (! firstrun) + doexit = 1; + break; case '{': case '}': case ';': case '\n': - breakout = 1; + { + char c; + grub_dprintf ("scripting", "token=`%c'\n", *state->script); + c = *state->script;; + nextchar (state); + state->tokenonhold = c; + doexit = 1; + break; + } } - if (breakout) + if (doexit) break; - *(bp++) = use; } - else if (use) - *(bp++) = use; - state->state = newstate; - nextchar (state); - } - - /* A string of text was read in. */ - *bp = '\0'; - grub_dprintf ("scripting", "token=`%s'\n", buffer); - yylval->string = buffer; - - /* Detect some special tokens. */ - if (! grub_strcmp (buffer, "while")) - return GRUB_PARSER_TOKEN_WHILE; - else if (! grub_strcmp (buffer, "if")) - return GRUB_PARSER_TOKEN_IF; - else if (! grub_strcmp (buffer, "function")) - return GRUB_PARSER_TOKEN_FUNCTION; - else if (! grub_strcmp (buffer, "menuentry")) - return GRUB_PARSER_TOKEN_MENUENTRY; - else if (! grub_strcmp (buffer, "@")) - return GRUB_PARSER_TOKEN_MENUENTRY; - else if (! grub_strcmp (buffer, "else")) - return GRUB_PARSER_TOKEN_ELSE; - else if (! grub_strcmp (buffer, "then")) - return GRUB_PARSER_TOKEN_THEN; - else if (! grub_strcmp (buffer, "fi")) - return GRUB_PARSER_TOKEN_FI; - else - return GRUB_PARSER_TOKEN_NAME; - } - else if (newstate == GRUB_PARSER_STATE_VAR - || newstate == GRUB_PARSER_STATE_QVAR) - { - /* XXX: Use a better size. */ - buffer = grub_script_malloc (parsestate, 2096); - if (! buffer) - return 0; - - bp = buffer; - - /* This is a variable, read the variable name. */ - while (*state->script) - { - newstate = grub_parser_cmdline_state (state->state, - *state->script, &use); - - /* Check if this character is not part of the variable name - anymore. */ - if (! (check_varstate (newstate))) + /* XXX: Use a better size. */ + buffer = grub_script_malloc (parsestate, 2048); + if (! buffer) + return 0; + + bp = buffer; + + /* Read one token, possible quoted. */ + while (*state->script) { - if (state->state == GRUB_PARSER_STATE_VARNAME2 - || state->state == GRUB_PARSER_STATE_QVARNAME2) - nextchar (state); + newstate = grub_parser_cmdline_state (state->state, + *state->script, &use); + + /* Check if a variable name starts. */ + if (check_varstate (newstate)) + break; + + /* If the string is not quoted or escaped, stop processing + when a special token was found. It will be recognized + next time when this function is called. */ + if (newstate == GRUB_PARSER_STATE_TEXT + && state->state != GRUB_PARSER_STATE_ESC) + { + int breakout = 0; + + switch (use) + { + case ' ': + case '{': + case '}': + case ';': + case '\n': + breakout = 1; + } + if (breakout) + break; + if (use) + *(bp++) = use; + } + else if (use) + *(bp++) = use; + state->state = newstate; - break; + nextchar (state); } - if (use) - *(bp++) = use; - nextchar (state); - state->state = newstate; + /* A string of text was read in. */ + *bp = '\0'; + grub_dprintf ("scripting", "token=`%s'\n", buffer); + yylval->arg = grub_script_arg_add (parsestate, yylval->arg, + GRUB_SCRIPT_ARG_TYPE_STR, buffer); + } - - *bp = '\0'; - state->state = newstate; - yylval->string = buffer; - grub_dprintf ("scripting", "vartoken=`%s'\n", buffer); - - return GRUB_PARSER_TOKEN_VAR; - } - else - { - /* There is either text or a variable name. In the case you + else if (newstate == GRUB_PARSER_STATE_VAR + || newstate == GRUB_PARSER_STATE_QVAR) + { + /* XXX: Use a better size. */ + buffer = grub_script_malloc (parsestate, 2096); + if (! buffer) + return 0; + + bp = buffer; + + /* This is a variable, read the variable name. */ + while (*state->script) + { + newstate = grub_parser_cmdline_state (state->state, + *state->script, &use); + + /* Check if this character is not part of the variable name + anymore. */ + if (! (check_varstate (newstate))) + { + if (state->state == GRUB_PARSER_STATE_VARNAME2 + || state->state == GRUB_PARSER_STATE_QVARNAME2) + nextchar (state); + state->state = newstate; + break; + } + + if (use) + *(bp++) = use; + nextchar (state); + state->state = newstate; + } + + *bp = '\0'; + state->state = newstate; + yylval->arg = grub_script_arg_add (parsestate, yylval->arg, + GRUB_SCRIPT_ARG_TYPE_VAR, buffer); + grub_dprintf ("scripting", "vartoken=`%s'\n", buffer); + } + else + { + /* There is either text or a variable name. In the case you arrive here there is a serious problem with the lexer. */ - grub_error (GRUB_ERR_BAD_ARGUMENT, "Internal error\n"); - return 0; + grub_error (GRUB_ERR_BAD_ARGUMENT, "Internal error\n"); + return 0; + } } + + if (yylval->arg == 0) + { + int token = state->tokenonhold; + state->tokenonhold = 0; + return token; + } + + if (yylval->arg->next == 0 && yylval->arg->type == GRUB_SCRIPT_ARG_TYPE_STR) + { + /* Detect some special tokens. */ + if (! grub_strcmp (yylval->arg->str, "while")) + return GRUB_PARSER_TOKEN_WHILE; + else if (! grub_strcmp (yylval->arg->str, "if")) + return GRUB_PARSER_TOKEN_IF; + else if (! grub_strcmp (yylval->arg->str, "function")) + return GRUB_PARSER_TOKEN_FUNCTION; + else if (! grub_strcmp (yylval->arg->str, "menuentry")) + return GRUB_PARSER_TOKEN_MENUENTRY; + else if (! grub_strcmp (yylval->arg->str, "@")) + return GRUB_PARSER_TOKEN_MENUENTRY; + else if (! grub_strcmp (yylval->arg->str, "else")) + return GRUB_PARSER_TOKEN_ELSE; + else if (! grub_strcmp (yylval->arg->str, "then")) + return GRUB_PARSER_TOKEN_THEN; + else if (! grub_strcmp (yylval->arg->str, "fi")) + return GRUB_PARSER_TOKEN_FI; + } + + return GRUB_PARSER_TOKEN_ARG; } void diff --git a/script/sh/parser.y b/script/sh/parser.y index 366f6b064..094a8856e 100644 --- a/script/sh/parser.y +++ b/script/sh/parser.y @@ -42,13 +42,10 @@ %token GRUB_PARSER_TOKEN_ELSE "else" %token GRUB_PARSER_TOKEN_THEN "then" %token GRUB_PARSER_TOKEN_FI "fi" -%token GRUB_PARSER_TOKEN_NAME -%token GRUB_PARSER_TOKEN_VAR +%token GRUB_PARSER_TOKEN_ARG %type script_init script grubcmd command commands commandblock menuentry if %type arguments; -%type argument; -%type "if" "while" "function" "else" "then" "fi" -%type text GRUB_PARSER_TOKEN_NAME GRUB_PARSER_TOKEN_VAR +%type GRUB_PARSER_TOKEN_ARG; %pure-parser %lex-param { struct grub_parser_param *state }; @@ -62,9 +59,18 @@ script_init: { state->err = 0; } script } ; -script: commands { $$ = $1; } +script: { $$ = 0; } + | '\n' { $$ = 0; } + | commands { $$ = $1; } | function '\n' { $$ = 0; } | menuentry '\n' { $$ = $1; } + | error + { + $$ = 0; + yyerror (state, "Incorrect command"); + state->err = 1; + yyerrok; + } ; delimiter: '\n' @@ -76,61 +82,21 @@ newlines: /* Empty */ | newlines '\n' ; -/* Some tokens are both used as token or as plain text. XXX: Add all - tokens without causing conflicts. */ -text: GRUB_PARSER_TOKEN_NAME - { - $$ = $1; - } - | "if" - { - $$ = $1; - } - | "while" - { - $$ = $1; - } -; -/* An argument can consist of some static text mixed with variables, - for example: `foo${bar}baz'. */ -argument: GRUB_PARSER_TOKEN_VAR - { - $$ = grub_script_arg_add (state, 0, GRUB_SCRIPT_ARG_TYPE_VAR, $1); - } - | text - { - $$ = grub_script_arg_add (state, 0, GRUB_SCRIPT_ARG_TYPE_STR, $1); - } -/* XXX: Currently disabled to simplify the parser. This should be - parsed by yet another parser for readability. */ -/* | argument GRUB_PARSER_TOKEN_VAR */ -/* { */ -/* $$ = grub_script_arg_add ($1, GRUB_SCRIPT_ARG_TYPE_VAR, $2); */ -/* } */ -/* | argument text */ -/* { */ -/* $$ = grub_script_arg_add ($1, GRUB_SCRIPT_ARG_TYPE_STR, $2); */ -/* } */ -; -arguments: argument +arguments: GRUB_PARSER_TOKEN_ARG { $$ = grub_script_add_arglist (state, 0, $1); } - | arguments argument + | arguments GRUB_PARSER_TOKEN_ARG { $$ = grub_script_add_arglist (state, $1, $2); } ; -grubcmd: GRUB_PARSER_TOKEN_NAME arguments +grubcmd: arguments { - $$ = grub_script_create_cmdline (state, $1, $2); - } - | GRUB_PARSER_TOKEN_NAME - { - $$ = grub_script_create_cmdline (state, $1, 0); + $$ = grub_script_create_cmdline (state, $1); } ; @@ -138,13 +104,6 @@ grubcmd: GRUB_PARSER_TOKEN_NAME arguments command: grubcmd delimiter { $$ = $1; } | if delimiter { $$ = $1; } | commandblock delimiter { $$ = $1; } - | error delimiter - { - $$ = 0; - yyerror (state, "Incorrect command"); - state->err = 1; - yyerrok; - } ; /* A block of commands. */ @@ -166,7 +125,7 @@ commands: command executed on the right moment. So the `commands' rule should be recognized after executing the `grub_script_mem_record; and before `grub_script_mem_record_stop'. */ -function: "function" GRUB_PARSER_TOKEN_NAME +function: "function" GRUB_PARSER_TOKEN_ARG { grub_script_lexer_ref (state->lexerstate); } newlines '{' @@ -204,10 +163,10 @@ commandblock: '{' ; /* A menu entry. Carefully save the memory that is allocated. */ -menuentry: "menuentry" arguments +menuentry: "menuentry" { grub_script_lexer_ref (state->lexerstate); - } newlines '{' + } arguments newlines '{' { grub_script_lexer_record_start (state->lexerstate); } newlines commands '}' @@ -215,7 +174,7 @@ menuentry: "menuentry" arguments char *menu_entry; menu_entry = grub_script_lexer_record_stop (state->lexerstate); grub_script_lexer_deref (state->lexerstate); - $$ = grub_script_create_cmdmenu (state, $2, menu_entry, 0); + $$ = grub_script_create_cmdmenu (state, $3, menu_entry, 0); } ; diff --git a/script/sh/script.c b/script/sh/script.c index 3e80b8383..89fa9474d 100644 --- a/script/sh/script.c +++ b/script/sh/script.c @@ -161,7 +161,7 @@ grub_script_add_arglist (struct grub_parser_param *state, holds all arguments for this command. */ struct grub_script_cmd * grub_script_create_cmdline (struct grub_parser_param *state, - char *cmdname, struct grub_script_arglist *arglist) + struct grub_script_arglist *arglist) { struct grub_script_cmdline *cmd; @@ -171,7 +171,6 @@ grub_script_create_cmdline (struct grub_parser_param *state, cmd->cmd.exec = grub_script_execute_cmdline; cmd->cmd.next = 0; cmd->arglist = arglist; - cmd->cmdname = cmdname; return (struct grub_script_cmd *) cmd; } From 4b0e1143bbe96394d1cf9b726a041036a29d3c9a Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 16:56:29 +0000 Subject: [PATCH 0782/1707] 2009-06-04 Vladimir Serbinenko Avoid calling biosdisk in drivemap * commands/i386/pc/drivemap.c (parse_biosdisk): remove (revparse_biosdisk): likewise (list_mappings): derive name from id directly (grub_cmd_drivemap): use tryparse_diskstring --- ChangeLog | 9 +++++ commands/i386/pc/drivemap.c | 78 ++++--------------------------------- 2 files changed, 16 insertions(+), 71 deletions(-) diff --git a/ChangeLog b/ChangeLog index e4e24cbaa..45e92c8cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-04 Vladimir Serbinenko + + Avoid calling biosdisk in drivemap + + * commands/i386/pc/drivemap.c (parse_biosdisk): remove + (revparse_biosdisk): likewise + (list_mappings): derive name from id directly + (grub_cmd_drivemap): use tryparse_diskstring + 2009-06-04 Vladimir Serbinenko Script fixes diff --git a/commands/i386/pc/drivemap.c b/commands/i386/pc/drivemap.c index 98f4378d5..898fb5167 100644 --- a/commands/i386/pc/drivemap.c +++ b/commands/i386/pc/drivemap.c @@ -143,62 +143,6 @@ drivemap_remove (grub_uint8_t newdrive) } } -/* Given a device name, resolves its BIOS disk number and stores it in the - passed location, which should only be trusted if ERR_NONE is returned. */ -static grub_err_t -parse_biosdisk (const char *name, grub_uint8_t *disknum) -{ - grub_disk_t disk; - /* Skip the first ( in (hd0) - disk_open wants just the name. */ - if (*name == '(') - name++; - - disk = grub_disk_open (name); - if (! disk) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "unknown device \"%s\"", - name); - const enum grub_disk_dev_id id = disk->dev->id; - /* The following assignment is only sound if the device is indeed a - biosdisk. The caller must check the return value. */ - if (disknum) - *disknum = disk->id; - grub_disk_close (disk); - if (id != GRUB_DISK_DEVICE_BIOSDISK_ID) - return grub_error (GRUB_ERR_BAD_DEVICE, "%s is not a BIOS disk", name); - return GRUB_ERR_NONE; -} - -/* Given a BIOS disk number, returns its GRUB device name if it exists. - If the call succeeds, the resulting device string must be freed. - For nonexisting BIOS disk numbers, this function returns - GRUB_ERR_UNKNOWN_DEVICE. */ -static grub_err_t -revparse_biosdisk (const grub_uint8_t dnum, const char **output) -{ - int found = 0; - auto int find (const char *name); - int find (const char *name) - { - const grub_disk_t disk = grub_disk_open (name); - if (! disk) - return 0; - if (disk->id == dnum && disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) - { - found = 1; - if (output) - *output = grub_strdup (name); - } - grub_disk_close (disk); - return found; - } - - grub_disk_dev_iterate (find); - if (found) - return GRUB_ERR_NONE; - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "BIOS disk %02x not found", - dnum); -} - /* Given a GRUB-like device name and a convenient location, stores the related BIOS disk number. Accepts devices like \((f|h)dN\), with 0 <= N < 128. */ @@ -238,15 +182,13 @@ list_mappings (void) drivemap_node_t *curnode = map_head; while (curnode) { - const char *dname = 0; - grub_err_t err = revparse_biosdisk (curnode->redirto, &dname); - if (err != GRUB_ERR_NONE) - return err; - grub_printf ("%cD #%-3u (0x%02x) %s\n", + grub_printf ("%cD #%-3u (0x%02x) %cd%d\n", (curnode->newdrive & 0x80) ? 'H' : 'F', - curnode->newdrive & 0x7F, curnode->newdrive, dname); + curnode->newdrive & 0x7F, curnode->newdrive, + (curnode->redirto & 0x80) ? 'h' : 'f', + curnode->redirto & 0x7F + ); curnode = curnode->next; - grub_free ((char *) dname); } return GRUB_ERR_NONE; } @@ -286,17 +228,11 @@ grub_cmd_drivemap (struct grub_extcmd *cmd, int argc, char **args) if (argc != 2) return grub_error (GRUB_ERR_BAD_ARGUMENT, "two arguments required"); - err = parse_biosdisk (args[0], &mapfrom); + err = tryparse_diskstring (args[0], &mapfrom); if (err != GRUB_ERR_NONE) return err; - /* When swapping we require both devices to be BIOS disks, but when - performing direct mappings we only require the 2nd argument to look - like a BIOS disk in order to resolve it into a BIOS disk number. */ - if (cmd->state[OPTIDX_SWAP].set) - err = parse_biosdisk (args[1], &mapto); - else - err = tryparse_diskstring (args[1], &mapto); + err = tryparse_diskstring (args[1], &mapto); if (err != GRUB_ERR_NONE) return err; From fd8c967c29752219d27e63c36cfa9eb0c825a413 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 4 Jun 2009 17:58:25 +0000 Subject: [PATCH 0783/1707] Update NEWS: * Add `hdparm' command. * Add support for getting the current date and time from CMOS as variables. * Add `drivemap' command. * Add support for RAID levels 4,6 and 10. * Add support for lua scripts. --- NEWS | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/NEWS b/NEWS index e223cdbff..ec10abce4 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,15 @@ New in 1.97 - : +* Add `hdparm' command. + +* Add support for getting the current date and time from CMOS as variables. + +* Add `drivemap' command. + +* Add support for RAID levels 4,6 and 10. + +* Add support for lua scripts. + * update-grub is renamed to grub-mkconfig. * When booting from PXE, PXE can be used to load files. From 3eb5ed4ec066441b01eca5868a3870e22446719d Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 18:22:45 +0000 Subject: [PATCH 0784/1707] 2009-06-04 Vladimir Serbinenko gfxpayload support * commands/videotest.c (grub_cmd_videotest): use grub_video_set_mode * include/grub/video.h (GRUB_VIDEO_MODE_TYPE_PURE_TEXT): new definition (grub_video_setup): remove (grub_video_set_mode): new prototype * loader/i386/linux.c (DEFAULT_VIDEO_MODE): new definition (vid_mode): remove (linux_vesafb_res): compile only on PCBIOS (grub_linux_boot): support gfxpayload * loader/i386/pc/xnu.c (video_hook): new function (grub_xnu_set_video): support gfxpayload * term/gfxterm.c (DEFAULT_VIDEO_WIDTH): removed (DEFAULT_VIDEO_HEIGHT): likewise (DEFAULT_VIDEO_FLAGS): likewise (DEFAULT_VIDEO_MODE): new definition (video_hook): new function (grub_gfxterm_init): use grub_video_set_mode * util/grub.d/30_os-prober.in: remove explicit modesetting before loading xnu * video/video.c (grub_video_setup): removed (grub_video_set_mode): new function based on grub_gfxterm_init and grub_video_setup --- ChangeLog | 26 +++ commands/videotest.c | 3 +- include/grub/video.h | 8 +- loader/i386/linux.c | 123 +++++++----- loader/i386/pc/xnu.c | 31 +++ term/gfxterm.c | 256 +++---------------------- util/grub.d/30_os-prober.in | 3 - video/video.c | 368 ++++++++++++++++++++++++++++++------ 8 files changed, 480 insertions(+), 338 deletions(-) diff --git a/ChangeLog b/ChangeLog index 45e92c8cc..23f629638 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,29 @@ +2009-06-04 Vladimir Serbinenko + + gfxpayload support + + * commands/videotest.c (grub_cmd_videotest): use grub_video_set_mode + * include/grub/video.h (GRUB_VIDEO_MODE_TYPE_PURE_TEXT): new definition + (grub_video_setup): remove + (grub_video_set_mode): new prototype + * loader/i386/linux.c (DEFAULT_VIDEO_MODE): new definition + (vid_mode): remove + (linux_vesafb_res): compile only on PCBIOS + (grub_linux_boot): support gfxpayload + * loader/i386/pc/xnu.c (video_hook): new function + (grub_xnu_set_video): support gfxpayload + * term/gfxterm.c (DEFAULT_VIDEO_WIDTH): removed + (DEFAULT_VIDEO_HEIGHT): likewise + (DEFAULT_VIDEO_FLAGS): likewise + (DEFAULT_VIDEO_MODE): new definition + (video_hook): new function + (grub_gfxterm_init): use grub_video_set_mode + * util/grub.d/30_os-prober.in: remove explicit modesetting before + loading xnu + * video/video.c (grub_video_setup): removed + (grub_video_set_mode): new function based on grub_gfxterm_init and + grub_video_setup + 2009-06-04 Vladimir Serbinenko Avoid calling biosdisk in drivemap diff --git a/commands/videotest.c b/commands/videotest.c index db7f704ed..6fe4b9bd1 100644 --- a/commands/videotest.c +++ b/commands/videotest.c @@ -30,8 +30,7 @@ grub_cmd_videotest (grub_command_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - if (grub_video_setup (1024, 768, - GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != GRUB_ERR_NONE) + if (grub_video_set_mode ("1024x768;800x600;640x480", 0) != GRUB_ERR_NONE) return grub_errno; grub_video_color_t color; diff --git a/include/grub/video.h b/include/grub/video.h index cb73dae21..3b276553c 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -34,6 +34,7 @@ struct grub_video_render_target; struct grub_video_bitmap; /* Defines used to describe video mode or rendering target. */ +#define GRUB_VIDEO_MODE_TYPE_PURE_TEXT 0x00000040 #define GRUB_VIDEO_MODE_TYPE_ALPHA 0x00000020 #define GRUB_VIDEO_MODE_TYPE_DOUBLE_BUFFERED 0x00000010 #define GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP 0x00000004 @@ -236,9 +237,6 @@ void grub_video_register (grub_video_adapter_t adapter); void grub_video_unregister (grub_video_adapter_t adapter); void grub_video_iterate (int (*hook) (grub_video_adapter_t adapter)); -grub_err_t grub_video_setup (unsigned int width, unsigned int height, - unsigned int mode_type); - grub_err_t grub_video_restore (void); grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info); @@ -299,4 +297,8 @@ grub_err_t grub_video_set_active_render_target (struct grub_video_render_target grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); +grub_err_t grub_video_set_mode (char *modestring, + int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p, + struct grub_video_mode_info *mode_info)); + #endif /* ! GRUB_VIDEO_HEADER */ diff --git a/loader/i386/linux.c b/loader/i386/linux.c index ca44fb46f..e3726ec81 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -43,8 +43,10 @@ into Linux, and therefore can benefit from seamless mode transition between GRUB and Linux (saving boot time and visual glitches). Official GRUB, OTOH, needs to be conservative. */ -#ifndef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT -#define GRUB_ASSUME_LINUX_HAS_FB_SUPPORT 0 +#ifdef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT +#define DEFAULT_VIDEO_MODE "keep,1024x768,800x600,640x480" +#else +#define DEFAULT_VIDEO_MODE "text" #endif static grub_dl_t my_mod; @@ -94,8 +96,7 @@ static struct idt_descriptor idt_desc = 0 }; -static grub_uint16_t vid_mode; - +#ifdef GRUB_MACHINE_PCBIOS struct linux_vesafb_res { grub_uint16_t width; @@ -262,6 +263,7 @@ struct linux_vesafb_mode linux_vesafb_modes[] = { VGA_800_500, 24 }, /* 0x372 */ { VGA_800_500, 32 }, /* 0x373 */ }; +#endif static inline grub_size_t page_align (grub_size_t size) @@ -442,49 +444,37 @@ grub_linux_boot (void) { struct linux_kernel_params *params; int e820_num; - + grub_err_t err; + char *modevar, *tmp; + params = real_mode_mem; - if (vid_mode == GRUB_LINUX_VID_MODE_NORMAL || vid_mode == GRUB_LINUX_VID_MODE_EXTENDED) - grub_video_restore (); - else if (vid_mode) + modevar = grub_env_get ("gfxpayload"); + + /* Now all graphical modes are acceptable. + May change in future if we have modes without framebuffer. */ + if (modevar && *modevar != 0) { - struct linux_vesafb_mode *linux_mode; - int depth, flags; - - flags = 0; - linux_mode = &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START]; - depth = linux_mode->depth; - - /* If we have 8 or less bits, then assume that it is indexed color mode. */ - if ((depth <= 8) && (depth != -1)) - flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; - - /* We have more than 8 bits, then assume that it is RGB color mode. */ - if (depth > 8) - flags |= GRUB_VIDEO_MODE_TYPE_RGB; - - /* If user requested specific depth, forward that information to driver. */ - if (depth != -1) - flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) - & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; - - /* Try to initialize requested mode. */ - if (grub_video_setup (linux_vesafb_res[linux_mode->res_index].width, - linux_vesafb_res[linux_mode->res_index].height, - flags) != GRUB_ERR_NONE) - { - grub_printf ("Unable to initialize requested video mode (vga=0x%x)\n", vid_mode); - return grub_errno; - } + tmp = grub_malloc (grub_strlen (modevar) + + sizeof (DEFAULT_VIDEO_MODE) + 1); + if (! tmp) + return grub_errno; + grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); + err = grub_video_set_mode (tmp, 0); + grub_free (tmp); } -#if ! GRUB_ASSUME_LINUX_HAS_FB_SUPPORT +#ifndef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT else - /* If user didn't request a video mode, and we can't assume Linux supports FB, - then we go back to text mode. */ - grub_video_restore (); + err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0); #endif + if (err) + { + grub_print_error (); + grub_printf ("Booting however\n"); + grub_errno = GRUB_ERR_NONE; + } + if (! grub_linux_setup_video (params)) params->have_vga = GRUB_VIDEO_TYPE_VLFB; else @@ -708,7 +698,6 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), (unsigned) real_size, (unsigned) prot_size); /* Look for memory size and video mode specified on the command line. */ - vid_mode = 0; linux_mem_size = 0; for (i = 1; i < argc; i++) #ifdef GRUB_MACHINE_PCBIOS @@ -716,6 +705,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), { /* Video mode selection support. */ char *val = argv[i] + 4; + unsigned vid_mode = GRUB_LINUX_VID_MODE_NORMAL; + struct linux_vesafb_mode *linux_mode; + grub_err_t err; + char *buf; if (grub_strcmp (val, "normal") == 0) vid_mode = GRUB_LINUX_VID_MODE_NORMAL; @@ -737,21 +730,57 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), switch (vid_mode) { case 0: - vid_mode = GRUB_LINUX_VID_MODE_NORMAL; + case GRUB_LINUX_VID_MODE_NORMAL: + grub_env_set ("gfxpayload", "text"); + grub_printf ("%s is deprecated. " + "Use set gfxpayload=text before " + "linux command instead.\n", + argv[i]); break; + case 1: - vid_mode = GRUB_LINUX_VID_MODE_EXTENDED; + case GRUB_LINUX_VID_MODE_EXTENDED: + /* FIXME: support 80x50 text. */ + grub_env_set ("gfxpayload", "text"); + grub_printf ("%s is deprecated. " + "Use set gfxpayload=text before " + "linux command instead.\n", + argv[i]); break; default: /* Ignore invalid values. */ if (vid_mode < GRUB_LINUX_VID_MODE_VESA_START || vid_mode >= GRUB_LINUX_VID_MODE_VESA_START + ARRAY_SIZE (linux_vesafb_modes)) - vid_mode = 0; - } + { + grub_env_set ("gfxpayload", "text"); + grub_printf ("%s is deprecated. Mode %d isn't recognized. " + "Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] before " + "linux command instead.\n", + argv[i], vid_mode); + break; + } - if (grub_errno) - goto fail; + buf = grub_malloc (20); + if (! buf) + goto fail; + + linux_mode + = &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START]; + + grub_sprintf (buf, "%dx%dx%d", + linux_vesafb_res[linux_mode->res_index].width, + linux_vesafb_res[linux_mode->res_index].height, + linux_mode->depth); + grub_printf ("%s is deprecated. " + "Use set gfxpayload=%s before " + "linux command instead.\n", + argv[i], buf); + err = grub_env_set ("gfxpayload", buf); + grub_free (buf); + if (err) + goto fail; + } } else #endif /* GRUB_MACHINE_PCBIOS */ diff --git a/loader/i386/pc/xnu.c b/loader/i386/pc/xnu.c index 1cca1387e..d32f6793b 100644 --- a/loader/i386/pc/xnu.c +++ b/loader/i386/pc/xnu.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -26,6 +27,17 @@ #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b)) +#define DEFAULT_VIDEO_MODE "1024x768x32,800x600x32,640x480x32" + +static int NESTED_FUNC_ATTR video_hook (grub_video_adapter_t p __attribute__ ((unused)), + struct grub_video_mode_info *info) +{ + if (info->mode_type & GRUB_VIDEO_MODE_TYPE_PURE_TEXT) + return 0; + + return 1; +} + /* Setup video for xnu. */ grub_err_t grub_xnu_set_video (struct grub_xnu_boot_params *params) @@ -34,8 +46,27 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) struct grub_video_render_target *render_target; int ret; int x,y; + char *tmp, *modevar; grub_err_t err; + modevar = grub_env_get ("gfxpayload"); + if (! modevar || *modevar == 0) + err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook); + else + { + tmp = grub_malloc (grub_strlen (modevar) + + sizeof (DEFAULT_VIDEO_MODE) + 1); + if (! tmp) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate temporary storag"); + grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); + err = grub_video_set_mode (tmp, video_hook); + grub_free (tmp); + } + + if (err) + return err; + ret = grub_video_get_info (&mode_info); if (ret) return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); diff --git a/term/gfxterm.c b/term/gfxterm.c index e6baa159f..5da678846 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -27,10 +27,7 @@ #include #include -#define DEFAULT_VIDEO_WIDTH 640 -#define DEFAULT_VIDEO_HEIGHT 480 -#define DEFAULT_VIDEO_FLAGS 0 - +#define DEFAULT_VIDEO_MODE "1024x768,800x600,640x480" #define DEFAULT_BORDER_WIDTH 10 #define DEFAULT_STANDARD_COLOR 0x07 @@ -231,16 +228,22 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, return grub_errno; } +static int NESTED_FUNC_ATTR video_hook (grub_video_adapter_t p __attribute__ ((unused)), + struct grub_video_mode_info *info) +{ + return ! (info->mode_type & GRUB_VIDEO_MODE_TYPE_PURE_TEXT); +} + static grub_err_t grub_gfxterm_init (void) { char *font_name; char *modevar; - int width = DEFAULT_VIDEO_WIDTH; - int height = DEFAULT_VIDEO_HEIGHT; - int depth = -1; - int flags = DEFAULT_VIDEO_FLAGS; + char *tmp; grub_video_color_t color; + int width; + int height; + grub_err_t err; /* Select the font to use. */ font_name = grub_env_get ("gfxterm_font"); @@ -249,232 +252,25 @@ grub_gfxterm_init (void) /* Parse gfxmode environment variable if set. */ modevar = grub_env_get ("gfxmode"); - if (modevar) - { - char *tmp; - char *next_mode; - char *current_mode; - char *param; - char *value; - int mode_found = 0; - - /* Take copy of env.var. as we don't want to modify that. */ - tmp = grub_strdup (modevar); - modevar = tmp; - - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; - - /* Initialize next mode. */ - next_mode = modevar; - - /* Loop until all modes has been tested out. */ - while (next_mode != NULL) - { - /* Use last next_mode as current mode. */ - tmp = next_mode; - - /* Reset video mode settings. */ - width = DEFAULT_VIDEO_WIDTH; - height = DEFAULT_VIDEO_HEIGHT; - depth = -1; - flags = DEFAULT_VIDEO_FLAGS; - - /* Save position of next mode and separate modes. */ - next_mode = grub_strchr(next_mode, ';'); - if (next_mode) - { - *next_mode = 0; - next_mode++; - } - - /* Skip whitespace. */ - while (grub_isspace (*tmp)) - tmp++; - - /* Initialize token holders. */ - current_mode = tmp; - param = tmp; - value = NULL; - - /* Parse x[x]*/ - - /* Find width value. */ - value = param; - param = grub_strchr(param, 'x'); - if (param == NULL) - { - grub_err_t rc; - - /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, - "Invalid mode: %s\n", - current_mode); - - /* Free memory before returning. */ - grub_free (modevar); - - return rc; - } - - *param = 0; - param++; - - width = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - { - grub_err_t rc; - - /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, - "Invalid mode: %s\n", - current_mode); - - /* Free memory before returning. */ - grub_free (modevar); - - return rc; - } - - /* Find height value. */ - value = param; - param = grub_strchr(param, 'x'); - if (param == NULL) - { - height = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - { - grub_err_t rc; - - /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, - "Invalid mode: %s\n", - current_mode); - - /* Free memory before returning. */ - grub_free (modevar); - - return rc; - } - } - else - { - /* We have optional color depth value. */ - *param = 0; - param++; - - height = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - { - grub_err_t rc; - - /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, - "Invalid mode: %s\n", - current_mode); - - /* Free memory before returning. */ - grub_free (modevar); - - return rc; - } - - /* Convert color depth value. */ - value = param; - depth = grub_strtoul (value, 0, 0); - if (grub_errno != GRUB_ERR_NONE) - { - grub_err_t rc; - - /* First setup error message. */ - rc = grub_error (GRUB_ERR_BAD_ARGUMENT, - "Invalid mode: %s\n", - current_mode); - - /* Free memory before returning. */ - grub_free (modevar); - - return rc; - } - } - - /* Try out video mode. */ - - /* If we have 8 or less bits, then assume that it is indexed color mode. */ - if ((depth <= 8) && (depth != -1)) - flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; - - /* We have more than 8 bits, then assume that it is RGB color mode. */ - if (depth > 8) - flags |= GRUB_VIDEO_MODE_TYPE_RGB; - - /* If user requested specific depth, forward that information to driver. */ - if (depth != -1) - flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) - & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; - - /* Try to initialize requested mode. Ignore any errors. */ - grub_error_push (); - if (grub_video_setup (width, height, flags) != GRUB_ERR_NONE) - { - grub_error_pop (); - continue; - } - - /* Figure out what mode we ended up. */ - if (grub_video_get_info (&mode_info) != GRUB_ERR_NONE) - { - /* Couldn't get video mode info, restore old mode and continue to next one. */ - grub_error_pop (); - - grub_video_restore (); - continue; - } - - /* Restore state of error stack. */ - grub_error_pop (); - - /* Mode found! Exit loop. */ - mode_found = 1; - break; - } - - /* Free memory. */ - grub_free (modevar); - - if (!mode_found) - return grub_error (GRUB_ERR_BAD_ARGUMENT, - "No suitable mode found."); - } + if (! modevar || *modevar == 0) + err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook); else { - /* No gfxmode variable set, use defaults. */ - - /* If we have 8 or less bits, then assume that it is indexed color mode. */ - if ((depth <= 8) && (depth != -1)) - flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; - - /* We have more than 8 bits, then assume that it is RGB color mode. */ - if (depth > 8) - flags |= GRUB_VIDEO_MODE_TYPE_RGB; - - /* If user requested specific depth, forward that information to driver. */ - if (depth != -1) - flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) - & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; - - /* Initialize user requested mode. */ - if (grub_video_setup (width, height, flags) != GRUB_ERR_NONE) - return grub_errno; - - /* Figure out what mode we ended up. */ - if (grub_video_get_info (&mode_info) != GRUB_ERR_NONE) - { - grub_video_restore (); - return grub_errno; - } + tmp = grub_malloc (grub_strlen (modevar) + + sizeof (DEFAULT_VIDEO_MODE) + 1); + grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); + err = grub_video_set_mode (tmp, video_hook); + grub_free (tmp); } + if (err) + return err; + + err = grub_video_get_info (&mode_info); + /* Figure out what mode we ended up. */ + if (err) + return err; + /* Make sure screen is black. */ color = grub_video_map_rgb (0, 0, 0); grub_video_fill_rect (color, 0, 0, mode_info.width, mode_info.height); diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index a145277fc..7d4d17e95 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -90,9 +90,6 @@ EOF menuentry "${LONGNAME} (on ${DEVICE})" { set root=${OSXROOT} insmod vbe - insmod gfxterm - gfxmode="1024x768x32;800x600x32" - terminal_output gfxterm do_resume=0 if [ /var/vm/sleepimage -nt10 / ]; then if xnu_resume /var/vm/sleepimage; then diff --git a/video/video.c b/video/video.c index 49e6cb95e..2c7f12b9e 100644 --- a/video/video.c +++ b/video/video.c @@ -19,6 +19,8 @@ #include #include #include +#include +#include /* The list of video adapters registered to system. */ static grub_video_adapter_t grub_video_adapter_list; @@ -59,59 +61,6 @@ grub_video_iterate (int (*hook) (grub_video_adapter_t adapter)) break; } -/* Setup specified video mode. */ -grub_err_t -grub_video_setup (unsigned int width, unsigned int height, - unsigned int mode_type) -{ - grub_video_adapter_t p; - - /* De-activate last set video adapter. */ - if (grub_video_adapter_active) - { - /* Finalize adapter. */ - grub_video_adapter_active->fini (); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; - - /* Mark active adapter as not set. */ - grub_video_adapter_active = 0; - } - - /* Loop thru all possible video adapter trying to find requested mode. */ - for (p = grub_video_adapter_list; p; p = p->next) - { - /* Try to initialize adapter, if it fails, skip to next adapter. */ - p->init (); - if (grub_errno != GRUB_ERR_NONE) - { - grub_errno = GRUB_ERR_NONE; - continue; - } - - /* Try to initialize video mode. */ - p->setup (width, height, mode_type); - if (grub_errno == GRUB_ERR_NONE) - { - /* Valid mode found from adapter, and it has been activated. - Specify it as active adapter. */ - grub_video_adapter_active = p; - return GRUB_ERR_NONE; - } - else - grub_errno = GRUB_ERR_NONE; - - /* No valid mode found in this adapter, finalize adapter. */ - p->fini (); - if (grub_errno != GRUB_ERR_NONE) - return grub_errno; - } - - /* We couldn't find suitable adapter for specified mode. */ - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "Can't locate valid adapter for mode"); -} - /* Restore back to initial mode (where applicable). */ grub_err_t grub_video_restore (void) @@ -430,6 +379,319 @@ grub_video_get_active_render_target (struct grub_video_render_target **target) return grub_video_adapter_active->get_active_render_target (target); } +grub_err_t +grub_video_set_mode (char *modestring, + int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p, + struct grub_video_mode_info *mode_info)) +{ + char *tmp; + char *next_mode; + char *current_mode; + char *param; + char *value; + char *modevar; + int width = -1; + int height = -1; + int depth = -1; + int flags = 0; + + /* Take copy of env.var. as we don't want to modify that. */ + modevar = grub_strdup (modestring); + + /* Initialize next mode. */ + next_mode = modevar; + + if (! modevar) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "couldn't allocate space for local modevar copy"); + + if (grub_memcmp (next_mode, "keep", sizeof ("keep")) == 0 + || grub_memcmp (next_mode, "keep,", sizeof ("keep,") - 1) == 0 + || grub_memcmp (next_mode, "keep;", sizeof ("keep;") - 1) == 0) + { + struct grub_video_mode_info mode_info; + int suitable = 1; + grub_err_t err; + + grub_memset (&mode_info, 0, sizeof (mode_info)); + + if (grub_video_adapter_active) + { + err = grub_video_get_info (&mode_info); + if (err) + { + suitable = 0; + grub_errno = GRUB_ERR_NONE; + } + } + else + mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_PURE_TEXT; + + if (suitable && hook) + suitable = hook (grub_video_adapter_active, &mode_info); + if (suitable) + { + grub_free (modevar); + return GRUB_ERR_NONE; + } + next_mode += sizeof ("keep") - 1; + if (! *next_mode) + { + grub_free (modevar); + + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "No suitable mode found."); + } + + /* Skip separator. */ + next_mode++; + } + + /* De-activate last set video adapter. */ + if (grub_video_adapter_active) + { + /* Finalize adapter. */ + grub_video_adapter_active->fini (); + if (grub_errno != GRUB_ERR_NONE) + grub_errno = GRUB_ERR_NONE; + + /* Mark active adapter as not set. */ + grub_video_adapter_active = 0; + } + + /* Loop until all modes has been tested out. */ + while (next_mode != NULL) + { + /* Use last next_mode as current mode. */ + tmp = next_mode; + + /* Reset video mode settings. */ + width = -1; + height = -1; + depth = -1; + flags = 0; + + /* Save position of next mode and separate modes. */ + for (; *next_mode; next_mode++) + if (*next_mode == ',' || *next_mode == ';') + break; + if (*next_mode) + { + *next_mode = 0; + next_mode++; + } + else + next_mode = 0; + + /* Skip whitespace. */ + while (grub_isspace (*tmp)) + tmp++; + + /* Initialize token holders. */ + current_mode = tmp; + param = tmp; + value = NULL; + + /* XXX: we assume that we're in pure text mode if + no video mode is initialized. Is it always true? */ + if (grub_strcmp (param, "text") == 0) + { + struct grub_video_mode_info mode_info; + + grub_memset (&mode_info, 0, sizeof (mode_info)); + mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_PURE_TEXT; + + if (! hook || hook (0, &mode_info)) + { + /* Valid mode found from adapter, and it has been activated. + Specify it as active adapter. */ + grub_video_adapter_active = NULL; + + /* Free memory. */ + grub_free (modevar); + + return GRUB_ERR_NONE; + } + } + + /* Parse x[x]*/ + + /* Find width value. */ + value = param; + param = grub_strchr(param, 'x'); + if (param == NULL) + { + grub_err_t rc; + + /* First setup error message. */ + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Invalid mode: %s\n", + current_mode); + + /* Free memory before returning. */ + grub_free (modevar); + + return rc; + } + + *param = 0; + param++; + + width = grub_strtoul (value, 0, 0); + if (grub_errno != GRUB_ERR_NONE) + { + grub_err_t rc; + + /* First setup error message. */ + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Invalid mode: %s\n", + current_mode); + + /* Free memory before returning. */ + grub_free (modevar); + + return rc; + } + + /* Find height value. */ + value = param; + param = grub_strchr(param, 'x'); + if (param == NULL) + { + height = grub_strtoul (value, 0, 0); + if (grub_errno != GRUB_ERR_NONE) + { + grub_err_t rc; + + /* First setup error message. */ + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Invalid mode: %s\n", + current_mode); + + /* Free memory before returning. */ + grub_free (modevar); + + return rc; + } + } + else + { + /* We have optional color depth value. */ + *param = 0; + param++; + + height = grub_strtoul (value, 0, 0); + if (grub_errno != GRUB_ERR_NONE) + { + grub_err_t rc; + + /* First setup error message. */ + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Invalid mode: %s\n", + current_mode); + + /* Free memory before returning. */ + grub_free (modevar); + + return rc; + } + + /* Convert color depth value. */ + value = param; + depth = grub_strtoul (value, 0, 0); + if (grub_errno != GRUB_ERR_NONE) + { + grub_err_t rc; + + /* First setup error message. */ + rc = grub_error (GRUB_ERR_BAD_ARGUMENT, + "Invalid mode: %s\n", + current_mode); + + /* Free memory before returning. */ + grub_free (modevar); + + return rc; + } + } + + /* Try out video mode. */ + + /* If we have 8 or less bits, then assume that it is indexed color mode. */ + if ((depth <= 8) && (depth != -1)) + flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + + /* We have more than 8 bits, then assume that it is RGB color mode. */ + if (depth > 8) + flags |= GRUB_VIDEO_MODE_TYPE_RGB; + + /* If user requested specific depth, forward that information to driver. */ + if (depth != -1) + flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) + & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; + + /* Try to initialize requested mode. Ignore any errors. */ + grub_video_adapter_t p; + + /* Loop thru all possible video adapter trying to find requested mode. */ + for (p = grub_video_adapter_list; p; p = p->next) + { + grub_err_t err; + struct grub_video_mode_info mode_info; + + grub_memset (&mode_info, 0, sizeof (mode_info)); + + /* Try to initialize adapter, if it fails, skip to next adapter. */ + err = p->init (); + if (err != GRUB_ERR_NONE) + { + grub_errno = GRUB_ERR_NONE; + continue; + } + + /* Try to initialize video mode. */ + err = p->setup (width, height, flags); + if (err != GRUB_ERR_NONE) + { + p->fini (); + grub_errno = GRUB_ERR_NONE; + continue; + } + + err = p->get_info (&mode_info); + if (err != GRUB_ERR_NONE) + { + p->fini (); + grub_errno = GRUB_ERR_NONE; + continue; + } + + if (hook && ! hook (p, &mode_info)) + { + p->fini (); + grub_errno = GRUB_ERR_NONE; + continue; + } + + /* Valid mode found from adapter, and it has been activated. + Specify it as active adapter. */ + grub_video_adapter_active = p; + + /* Free memory. */ + grub_free (modevar); + + return GRUB_ERR_NONE; + } + + } + + /* Free memory. */ + grub_free (modevar); + + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "No suitable mode found."); +} + /* Initialize Video API module. */ GRUB_MOD_INIT(video_video) { From 5389763d12502820dff1e428f000cd2c77b50d12 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 19:28:02 +0000 Subject: [PATCH 0785/1707] 2009-06-04 Vladimir Serbinenko Use .asciz instead of .string * i386/pc/diskboot.S: use .asciz instead of .string * i386/pc/boot.S: likewise * include/grub/dl.h (GRUB_MOD_DEP): likewise (GRUB_MOD_NAME): likewise --- ChangeLog | 9 +++++++++ boot/i386/pc/boot.S | 13 +++++++------ boot/i386/pc/diskboot.S | 12 ++++++------ include/grub/dl.h | 4 ++-- 4 files changed, 24 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23f629638..836e0c16e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-04 Vladimir Serbinenko + + Use .asciz instead of .string + + * i386/pc/diskboot.S: use .asciz instead of .string + * i386/pc/boot.S: likewise + * include/grub/dl.h (GRUB_MOD_DEP): likewise + (GRUB_MOD_NAME): likewise + 2009-06-04 Vladimir Serbinenko gfxpayload support diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 805673121..9ccfbcaa4 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -390,11 +390,11 @@ general_error: int $0x18 stop: jmp stop -notification_string: .string "GRUB " -geometry_error_string: .string "Geom" -hd_probe_error_string: .string "Hard Disk" -read_error_string: .string "Read" -general_error_string: .string " Error" +notification_string: .asciz "GRUB " +geometry_error_string: .asciz "Geom" +hd_probe_error_string: .asciz "Hard Disk" +read_error_string: .asciz "Read" +general_error_string: .asciz " Error" /* * message: write the string pointed to by %si @@ -464,7 +464,8 @@ probe_loop: MSG(fd_probe_error_string) jmp general_error -fd_probe_error_string: .string "Floppy" +/* "Floppy" */ +fd_probe_error_string: .asciz "Floppy" 1: /* perform read */ diff --git a/boot/i386/pc/diskboot.S b/boot/i386/pc/diskboot.S index 95f87a035..0c8e75df0 100644 --- a/boot/i386/pc/diskboot.S +++ b/boot/i386/pc/diskboot.S @@ -326,14 +326,14 @@ general_error: /* go here when you need to stop the machine hard after an error condition */ stop: jmp stop -notification_string: .string "loading" +notification_string: .asciz "loading" -notification_step: .string "." -notification_done: .string "\r\n" +notification_step: .asciz "." +notification_done: .asciz "\r\n" -geometry_error_string: .string "Geom" -read_error_string: .string "Read" -general_error_string: .string " Error" +geometry_error_string: .asciz "Geom" +read_error_string: .asciz "Read" +general_error_string: .asciz " Error" /* * message: write the string pointed to by %si diff --git a/include/grub/dl.h b/include/grub/dl.h index 4ff6240d8..55f5d4e22 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -41,10 +41,10 @@ static void \ grub_mod_fini (void) #define GRUB_MOD_NAME(name) \ -__asm__ (".section .modname\n.string \"" #name "\"\n") +__asm__ (".section .modname\n.asciz \"" #name "\"\n") #define GRUB_MOD_DEP(name) \ -__asm__ (".section .moddeps\n.string \"" #name "\"\n") +__asm__ (".section .moddeps\n.asciz \"" #name "\"\n") struct grub_dl_segment { From fd2bf2e388014a3d7f834cce6b19d00a83d7b476 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 19:32:46 +0000 Subject: [PATCH 0786/1707] 2009-06-04 Vladimir Serbinenko Fix wrong assumptions with grub-mkimage on EFI * i386/efi/grub-mkimage.c (read_kernel_module): don't write prefox here (relocate_addresses): consider both r_addend and value at offset (make_mods_section): zerofill modinfo and header (convert_elf): write prefix here --- ChangeLog | 9 ++++++ util/i386/efi/grub-mkimage.c | 55 +++++++++++++++++++++++------------- 2 files changed, 45 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 836e0c16e..02008382d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-04 Vladimir Serbinenko + + Fix wrong assumptions with grub-mkimage on EFI + + * i386/efi/grub-mkimage.c (read_kernel_module): don't write prefox here + (relocate_addresses): consider both r_addend and value at offset + (make_mods_section): zerofill modinfo and header + (convert_elf): write prefix here + 2009-06-04 Vladimir Serbinenko Use .asciz instead of .string diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index db88a0fff..8b8796360 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -88,7 +88,7 @@ align_pe32_section (Elf_Addr addr) /* Read the whole kernel image. Return the pointer to a read image, and store the size in bytes in *SIZE. */ static char * -read_kernel_module (const char *dir, char *prefix, size_t *size) +read_kernel_module (const char *dir, size_t *size) { char *kernel_image; char *kernel_path; @@ -98,11 +98,6 @@ read_kernel_module (const char *dir, char *prefix, size_t *size) kernel_image = grub_util_read_image (kernel_path); free (kernel_path); - if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END) - grub_util_error ("prefix too long"); - - strcpy (kernel_image + sizeof (Elf_Ehdr) + GRUB_KERNEL_MACHINE_PREFIX, prefix); - return kernel_image; } @@ -378,7 +373,8 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Addr info; Elf_Addr offset; Elf_Addr sym_addr; - Elf_Addr *target, *value; + Elf_Addr *target; + Elf_Addr addend; offset = grub_le_to_cpu (r->r_offset); target = get_target_address (e, target_section, offset); @@ -386,8 +382,8 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, sym_addr = get_symbol_address (e, symtab_section, ELF_R_SYM (info)); - value = (s->sh_type == grub_cpu_to_le32 (SHT_RELA)) ? - (Elf_Addr *) &r->r_addend : target; + addend = (s->sh_type == grub_cpu_to_le32 (SHT_RELA)) ? + r->r_addend : 0; switch (ELF_R_TYPE (info)) { @@ -397,16 +393,16 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, case R_386_32: /* This is absolute. */ - *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*value) - + sym_addr); + *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*target) + + addend + sym_addr); grub_util_info ("relocating an R_386_32 entry to 0x%x at the offset 0x%x", *target, offset); break; case R_386_PC32: /* This is relative. */ - *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*value) - + sym_addr + *target = grub_cpu_to_le32 (grub_le_to_cpu32 (*target) + + addend + sym_addr - target_section_addr - offset); grub_util_info ("relocating an R_386_PC32 entry to 0x%x at the offset 0x%x", *target, offset); @@ -418,7 +414,8 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, break; case R_X86_64_64: - *target = grub_cpu_to_le64 (grub_le_to_cpu64 (*value) + sym_addr); + *target = grub_cpu_to_le64 (grub_le_to_cpu64 (*target) + + addend + sym_addr); grub_util_info ("relocating an R_X86_64_64 entry to 0x%llx at the offset 0x%llx", *target, offset); break; @@ -426,8 +423,8 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, case R_X86_64_PC32: { grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_cpu_to_le64 (grub_le_to_cpu64 (*value) - + sym_addr + *t32 = grub_cpu_to_le64 (grub_le_to_cpu32 (*t32) + + addend + sym_addr - target_section_addr - offset); grub_util_info ("relocating an R_X86_64_PC32 entry to 0x%x at the offset 0x%llx", *t32, offset); @@ -438,8 +435,8 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, case R_X86_64_32S: { grub_uint32_t *t32 = (grub_uint32_t *) target; - *t32 = grub_cpu_to_le64 (grub_le_to_cpu64 (*value) - + sym_addr); + *t32 = grub_cpu_to_le64 (grub_le_to_cpu32 (*t32) + + addend + sym_addr); grub_util_info ("relocating an R_X86_64_32(S) entry to 0x%x at the offset 0x%llx", *t32, offset); break; @@ -689,6 +686,8 @@ make_mods_section (FILE *out, Elf_Addr current_address, struct grub_module_info modinfo; Elf_Addr addr; + memset (&modinfo, 0, sizeof (modinfo)); + path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); total_module_size = sizeof (struct grub_module_info); @@ -713,6 +712,8 @@ make_mods_section (FILE *out, Elf_Addr current_address, size_t mod_size; char *mod_image; + memset (&header, 0, sizeof (header)); + grub_util_info ("adding module %s", p->name); mod_size = grub_util_get_image_size (p->name); @@ -973,9 +974,11 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[]) Elf_Addr start_address; Elf_Addr text_address, data_address, reloc_address, mods_address; Elf_Addr end_address; + Elf_Shdr *s; + int i; /* Get the kernel image and check the format. */ - kernel_image = read_kernel_module (dir, prefix, &kernel_size); + kernel_image = read_kernel_module (dir, &kernel_size); e = (Elf_Ehdr *) kernel_image; if (! check_elf_header (e, kernel_size)) grub_util_error ("invalid ELF header"); @@ -990,6 +993,20 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[]) sections = (Elf_Shdr *) (kernel_image + section_offset); strtab = find_strtab (e, sections, section_entsize); + for (i = 0, s = sections; + i < num_sections; + i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) + if (is_text_section (s)) + { + Elf_Off offset = grub_le_to_cpu32 (s->sh_offset); + + if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END) + grub_util_error ("prefix too long"); + + strcpy (kernel_image + offset + GRUB_KERNEL_MACHINE_PREFIX, prefix); + break; + } + /* Relocate sections then symbols in the virtual address space. */ section_addresses = locate_sections (sections, section_entsize, num_sections, strtab); From 5b889789b15b8f9594dd569c35dacc4589aa3f52 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 19:35:31 +0000 Subject: [PATCH 0787/1707] 2009-06-04 Vladimir Serbinenko Add missing start symbols * boot/i386/pc/boot.S: add start boot/i386/pc/pxeboot.S: likewise --- ChangeLog | 7 +++++++ boot/i386/pc/boot.S | 4 +++- boot/i386/pc/pxeboot.S | 4 +++- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02008382d..1e53ca4b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-04 Vladimir Serbinenko + + Add missing start symbols + + * boot/i386/pc/boot.S: add start + boot/i386/pc/pxeboot.S: likewise + 2009-06-04 Vladimir Serbinenko Fix wrong assumptions with grub-mkimage on EFI diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 9ccfbcaa4..fc31f5a61 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -40,7 +40,9 @@ in real mode. */ .code16 -.globl _start; _start: +.globl _start, start; +_start: +start: /* * _start is loaded at 0x7c00 and is jumped to with CS:IP 0:0x7c00 */ diff --git a/boot/i386/pc/pxeboot.S b/boot/i386/pc/pxeboot.S index 4fdff764f..b62c1447b 100644 --- a/boot/i386/pc/pxeboot.S +++ b/boot/i386/pc/pxeboot.S @@ -23,7 +23,9 @@ .code16 /* Let's go */ -.globl _start; _start: +.globl start, _start; +_start: +start: /* Root drive will default to boot drive */ movb $0xFF, %dh From fb14123e015f80cc03e0b01783457cf713063dc3 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 19:39:51 +0000 Subject: [PATCH 0788/1707] 2009-06-04 Vladimir Serbinenko Simplify sed expressions and improve awk * Makefile.in (install-local): simplify sed expression * gencmdlist.sh: likewise * genmoddep.awk: avoid adding module as a dependency of itself --- ChangeLog | 10 +++++++++- Makefile.in | 2 +- gencmdlist.sh | 4 +++- genmoddep.awk | 2 +- 4 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1e53ca4b5..c1675f6f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,17 @@ +2009-06-04 Vladimir Serbinenko + + Simplify sed expressions and improve awk + + * Makefile.in (install-local): simplify sed expression + * gencmdlist.sh: likewise + * genmoddep.awk: avoid adding module as a dependency of itself + 2009-06-04 Vladimir Serbinenko Add missing start symbols * boot/i386/pc/boot.S: add start - boot/i386/pc/pxeboot.S: likewise + * boot/i386/pc/pxeboot.S: likewise 2009-06-04 Vladimir Serbinenko diff --git a/Makefile.in b/Makefile.in index cd79b0b05..e00f9c38f 100644 --- a/Makefile.in +++ b/Makefile.in @@ -213,7 +213,7 @@ install-local: all for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,include/,,'`"; \ - destdir="`echo $$dest | sed 's,\(^\|/\)[^/]*$$,,g'`"; \ + destdir="`echo $$dest | sed 's,[^/]*$$,,g'`"; \ $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \ if test -f "$$dir$$file"; then \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ diff --git a/gencmdlist.sh b/gencmdlist.sh index 5d3897c7d..7f2549099 100644 --- a/gencmdlist.sh +++ b/gencmdlist.sh @@ -17,4 +17,6 @@ module=$1 grep -v "^#" | sed -n \ -e "/grub_register_command *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" \ - -e "/\(grub_register_extcmd\|grub_register_command_p1\) *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" + -e "/grub_register_extcmd *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" \ + -e "/grub_register_command_p1 *( *\"/{s/.*( *\"\([^\"]*\)\".*/*\1: $module/;p;}" + diff --git a/genmoddep.awk b/genmoddep.awk index c079b3672..5b9bc621d 100644 --- a/genmoddep.awk +++ b/genmoddep.awk @@ -50,7 +50,7 @@ END { for (i in depmods) { depmod = depmods[i]; # Ignore kernel, as always loaded. - if (depmod != "kernel") + if (depmod != "kernel" && depmod != mod) uniqmods[depmod] = 1; } modlist = "" From 2b167a721805856e1d5f9c019b9a83e6cebd5654 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 19:53:52 +0000 Subject: [PATCH 0789/1707] 2009-06-04 Vladimir Serbinenko Check if compiler is apple cc * Makefile.in (ASFLAGS): new variable (TARGET_ASFLAGS): likewise (TARGET_MODULE_FORMAT): likewise (TARGET_APPLE_CC): likewise (OBJCONV): likewise (TARGET_IMG_CFLAGS): likewise (TARGET_CPPFLAGS): add includedir * configure.ac: call grub_apple_cc and grub_apple_target_cc (TARGET_IMG_LDFLAGS): Add -Wl,-Ttext,. All users updated Check for linker script only if compiler isn't Apple's CC (TARGET_MODULE_FORMAT): set (TARGET_APPLE_CC): likewise (TARGET_ASFLAGS): likewise (ASFLAGS): likewise Check for objcopy only if compiler isn't Apple's CC Check for BSS symbol only if compiler isn't Apple's CC * genmk.rb: adapt nm options if we use Apple's utils * aclocal.m4 (grub_apple_cc): new test (grub_apple_target_cc): likewise --- ChangeLog | 24 ++++++++++++++ Makefile.in | 12 ++++++- aclocal.m4 | 30 +++++++++++++++++ conf/i386-pc.rmk | 14 ++++---- configure.ac | 83 ++++++++++++++++++++++++++++++++---------------- genmk.rb | 5 +++ 6 files changed, 133 insertions(+), 35 deletions(-) diff --git a/ChangeLog b/ChangeLog index c1675f6f8..def6591d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2009-06-04 Vladimir Serbinenko + + Check if compiler is apple cc + + * Makefile.in (ASFLAGS): new variable + (TARGET_ASFLAGS): likewise + (TARGET_MODULE_FORMAT): likewise + (TARGET_APPLE_CC): likewise + (OBJCONV): likewise + (TARGET_IMG_CFLAGS): likewise + (TARGET_CPPFLAGS): add includedir + * configure.ac: call grub_apple_cc and grub_apple_target_cc + (TARGET_IMG_LDFLAGS): Add -Wl,-Ttext,. All users updated + Check for linker script only if compiler isn't Apple's CC + (TARGET_MODULE_FORMAT): set + (TARGET_APPLE_CC): likewise + (TARGET_ASFLAGS): likewise + (ASFLAGS): likewise + Check for objcopy only if compiler isn't Apple's CC + Check for BSS symbol only if compiler isn't Apple's CC + * genmk.rb: adapt nm options if we use Apple's utils + * aclocal.m4 (grub_apple_cc): new test + (grub_apple_target_cc): likewise + 2009-06-04 Vladimir Serbinenko Simplify sed expressions and improve awk diff --git a/Makefile.in b/Makefile.in index e00f9c38f..da2ec4803 100644 --- a/Makefile.in +++ b/Makefile.in @@ -64,16 +64,22 @@ mkinstalldirs = $(srcdir)/mkinstalldirs CC = @CC@ CFLAGS = @CFLAGS@ +ASFLAGS = @ASFLAGS@ LDFLAGS = @LDFLAGS@ CPPFLAGS = @CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include -Wall -W \ -DGRUB_LIBDIR=\"$(pkglibdir)\" TARGET_CC = @TARGET_CC@ TARGET_CFLAGS = @TARGET_CFLAGS@ +TARGET_ASFLAGS = @TARGET_ASFLAGS@ +TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ +TARGET_APPLE_CC = @TARGET_APPLE_CC@ +OBJCONV = @OBJCONV@ TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ TARGET_IMG_LDFLAGS = @TARGET_IMG_LDFLAGS@ +TARGET_IMG_CFLAGS = @TARGET_IMG_CFLAGS@ TARGET_OBJ2ELF = @TARGET_OBJ2ELF@ EXEEXT = @EXEEXT@ OBJCOPY = @OBJCOPY@ @@ -186,8 +192,12 @@ build_env.mk: Makefile (\ echo "TARGET_CC=$(TARGET_CC)" ; \ echo "TARGET_CFLAGS=$(TARGET_CFLAGS)" ; \ - echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir)" ; \ + echo "TARGET_ASFLAGS=$(TARGET_ASFLAGS)" ; \ + echo "TARGET_CPPFLAGS=$(TARGET_CPPFLAGS) -I$(pkglibdir) -I$(includedir)" ; \ echo "STRIP=$(STRIP)" ; \ + echo "OBJCONV=$(OBJCONV)" ; \ + echo "TARGET_MODULE_FORMAT=$(TARGET_MODULE_FORMAT)" ; \ + echo "TARGET_APPLE_CC=$(TARGET_APPLE_CC)" ; \ echo "COMMON_ASFLAGS=$(COMMON_ASFLAGS)" ; \ echo "COMMON_CFLAGS=$(COMMON_CFLAGS)" ; \ echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\ diff --git a/aclocal.m4 b/aclocal.m4 index 38a9a4a7a..10e0ca514 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -156,6 +156,36 @@ rm -f conftest*]) AC_MSG_RESULT([$grub_cv_i386_asm_addr32])]) +dnl check if our compiler is apple cc +dnl because it requires numerous workarounds +AC_DEFUN(grub_apple_cc, +[AC_REQUIRE([AC_PROG_CC]) +AC_MSG_CHECKING([whether our compiler is apple cc]) +AC_CACHE_VAL(grub_cv_apple_cc, +[if $CC -v 2>&1 | grep "Apple Inc." > /dev/null; then + grub_cv_apple_cc=yes +else + grub_cv_apple_cc=no +fi +]) + +AC_MSG_RESULT([$grub_cv_apple_cc])]) + +dnl check if our target compiler is apple cc +dnl because it requires numerous workarounds +AC_DEFUN(grub_apple_target_cc, +[AC_REQUIRE([AC_PROG_CC]) +AC_MSG_CHECKING([whether our target compiler is apple cc]) +AC_CACHE_VAL(grub_cv_apple_target_cc, +[if $CC -v 2>&1 | grep "Apple Inc." > /dev/null; then + grub_cv_apple_target_cc=yes +else + grub_cv_apple_target_cc=no +fi +]) + +AC_MSG_RESULT([$grub_cv_apple_target_cc])]) + dnl Later versions of GAS requires that addr32 and data32 prefixes dnl appear in the same lines as the instructions they modify, while diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index a72d2d246..83857672f 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -16,31 +16,31 @@ pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S boot_img_ASFLAGS = $(COMMON_ASFLAGS) -boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 boot_img_FORMAT = binary # For pxeboot.img pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) -pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 pxeboot_img_FORMAT = binary # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) -diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,8000 +diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)8000 diskboot_img_FORMAT = binary # For lnxboot.img. lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) -lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,6000 +lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)6000 lnxboot_img_FORMAT = binary # For cdboot.img. cdboot_img_SOURCES = boot/i386/pc/cdboot.S cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) -cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,7C00 +cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 cdboot_img_FORMAT = binary # For kernel.img. @@ -63,9 +63,9 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h -kernel_img_CFLAGS = $(COMMON_CFLAGS) +kernel_img_CFLAGS = $(COMMON_CFLAGS) $(TARGET_IMG_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS) -Wl,-Ttext,$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) kernel_img_FORMAT = binary MOSTLYCLEANFILES += symlist.c kernel_syms.lst diff --git a/configure.ac b/configure.ac index 98cd84161..6649cb90a 100644 --- a/configure.ac +++ b/configure.ac @@ -167,6 +167,11 @@ AC_C_BIGENDIAN AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long) +grub_apple_cc +if test x$grub_cv_apple_cc == xyes ; then + CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions" + ASFLAGS="$ASFLAGS -DAPPLE_CC=1" +fi if test "x$host_m32" = x1; then # Force 32-bit mode. CFLAGS="$CFLAGS -m32" @@ -206,31 +211,6 @@ AC_CHECK_FUNCS(posix_memalign memalign asprintf) # Check for target programs. # - -# Use linker script if present, otherwise use builtin -N script. -AC_MSG_CHECKING([for option to link raw image]) -if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then - TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" - TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT}" - TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" -else - TARGET_IMG_LDSCRIPT= - TARGET_IMG_LDFLAGS='-Wl,-N' - TARGET_IMG_LDFLAGS_AC='-Wl,-N' -fi -AC_SUBST(TARGET_IMG_LDSCRIPT) -AC_SUBST(TARGET_IMG_LDFLAGS) -AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) - -# For platforms where ELF is not the default link format. -AC_MSG_CHECKING([for command to convert module to ELF format]) -case "${host_os}" in - cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; - *) ;; -esac -AC_SUBST(TARGET_OBJ2ELF) -AC_MSG_RESULT([$TARGET_OBJ2ELF]) - # Find tools for the target. if test "x$target_alias" != x && test "x$host_alias" != "x$target_alias"; then tmp_ac_tool_prefix="$ac_tool_prefix" @@ -287,7 +267,7 @@ if test "x$TARGET_CFLAGS" = x; then # Force no alignment to save space on i386. if test "x$target_cpu" = xi386; then AC_CACHE_CHECK([whether -falign-loops works], [grub_cv_cc_falign_loop], [ - CFLAGS="-falign-loops=1" + CFLAGS="$CFLAGS -falign-loops=1" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_falign_loop=yes], [grub_cv_cc_falign_loop=no]) @@ -301,16 +281,59 @@ if test "x$TARGET_CFLAGS" = x; then fi fi +grub_apple_target_cc +if test x$grub_cv_apple_target_cc == xyes ; then + TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions" + CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions" + TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1" + TARGET_APPLE_CC=1 + TARGET_IMG_LDSCRIPT= + TARGET_IMG_CFLAGS="-static" + TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,' + TARGET_IMG_LDFLAGS_AC='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,' +else + TARGET_APPLE_CC=0 +# Use linker script if present, otherwise use builtin -N script. +AC_MSG_CHECKING([for option to link raw image]) +if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then + TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" + TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT} -Wl,-Ttext," + TARGET_IMG_LDFLAGS_AC="-Wl,-T${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" +else + TARGET_IMG_LDSCRIPT= + TARGET_IMG_LDFLAGS='-Wl,-N -Wl,-Ttext,' + TARGET_IMG_LDFLAGS_AC='-Wl,-N -Wl,-Ttext,' +fi +TARGET_IMG_CFLAGS= +fi + +AC_SUBST(TARGET_IMG_LDSCRIPT) +AC_SUBST(TARGET_IMG_LDFLAGS) +AC_SUBST(TARGET_IMG_CFLAGS) +AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) + +# For platforms where ELF is not the default link format. +AC_MSG_CHECKING([for command to convert module to ELF format]) +case "${host_os}" in + cygwin) TARGET_OBJ2ELF='grub-pe2elf' ;; + *) ;; +esac +AC_SUBST(TARGET_OBJ2ELF) +AC_MSG_RESULT([$TARGET_OBJ2ELF]) + + if test "x$target_m32" = x1; then # Force 32-bit mode. TARGET_CFLAGS="$TARGET_CFLAGS -m32" TARGET_LDFLAGS="$TARGET_LDFLAGS -m32" + TARGET_MODULE_FORMAT="elf32" fi if test "x$target_m64" = x1; then # Force 64-bit mode. TARGET_CFLAGS="$TARGET_CFLAGS -m64" TARGET_LDFLAGS="$TARGET_LDFLAGS -m64" + TARGET_MODULE_FORMAT="elf64" fi if test "$target_cpu"-"$platform" = x86_64-efi; then @@ -361,6 +384,9 @@ if test x"$sap_possible" = xyes; then fi AC_SUBST(TARGET_CFLAGS) +AC_SUBST(TARGET_MODULE_FORMAT) +AC_SUBST(TARGET_APPLE_CC) +AC_SUBST(TARGET_ASFLAGS) AC_SUBST(TARGET_CPPFLAGS) AC_SUBST(TARGET_LDFLAGS) @@ -375,7 +401,9 @@ AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) # Defined in aclocal.m4. grub_PROG_TARGET_CC +if test "x$TARGET_APPLE_CC" != x1 ; then grub_PROG_OBJCOPY_ABSOLUTE +fi grub_PROG_LD_BUILD_ID_NONE grub_ASM_USCORE if test "x$target_cpu" = xi386; then @@ -383,7 +411,7 @@ if test "x$target_cpu" = xi386; then # Check symbols provided by linker script. CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" fi - if test "x$platform" = xpc; then + if test "x$platform" = xpc && test "x$TARGET_APPLE_CC" != x1 ; then grub_CHECK_BSS_START_SYMBOL grub_CHECK_END_SYMBOL fi @@ -482,6 +510,7 @@ AC_ARG_ENABLE([efiemu], [AS_HELP_STRING([--enable-efiemu], [build and install the efiemu runtimes])]) AC_SUBST([enable_efiemu]) +AC_SUBST(ASFLAGS) # Output files. grub_CHECK_LINK_DIR diff --git a/genmk.rb b/genmk.rb index abdb8ca6b..cfe120ad0 100644 --- a/genmk.rb +++ b/genmk.rb @@ -129,8 +129,13 @@ UNDSYMFILES += #{undsym} sh $(srcdir)/genmodsrc.sh '#{mod_name}' $< > $@ || (rm -f $@; exit 1) ifneq ($(#{prefix}_EXPORTS),no) +ifneq ($(TARGET_APPLE_CC),1) #{defsym}: #{pre_obj} $(NM) -g --defined-only -P -p $< | sed 's/^\\([^ ]*\\).*/\\1 #{mod_name}/' > $@ +else +#{defsym}: #{pre_obj} + $(NM) -g -P -p $< | grep -E '^[a-zA-Z0-9_]* [TDS]' | sed 's/^\\([^ ]*\\).*/\\1 #{mod_name}/' > $@ +endif endif #{undsym}: #{pre_obj} From 3e32590112d00ee79689033a3acb8bdd61f074bc Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 20:01:19 +0000 Subject: [PATCH 0790/1707] 2009-06-04 Vladimir Serbinenko Absolute addressing through constant with Apple's cc * kern/i386/pc/startup.S: Define necessary constants and address through it when using ABS with Apple's CC * boot/i386/pc/diskboot.S: likewise * boot/i386/pc/boot.S: likewise * boot/i386/pc/lnxboot.S: likewise * boot/i386/pc/cdboot.S: likewise * mmap/i386/pc/mmap_helper.S: likewise * commands/i386/pc/drivemap_int13h.S: likewise --- ChangeLog | 13 +++++++ boot/i386/pc/boot.S | 54 +++++++++++++++++++++++++- boot/i386/pc/cdboot.S | 12 ++++++ boot/i386/pc/diskboot.S | 9 +++++ boot/i386/pc/lnxboot.S | 62 ++++++++++++++++++++++++++++++ commands/i386/pc/drivemap_int13h.S | 5 +++ kern/i386/pc/startup.S | 28 ++++++++++++++ mmap/i386/pc/mmap_helper.S | 32 +++++++++++++++ 8 files changed, 214 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index def6591d4..4c63b3107 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-06-04 Vladimir Serbinenko + + Absolute addressing through constant with Apple's cc + + * kern/i386/pc/startup.S: Define necessary constants + and address through it when using ABS with Apple's CC + * boot/i386/pc/diskboot.S: likewise + * boot/i386/pc/boot.S: likewise + * boot/i386/pc/lnxboot.S: likewise + * boot/i386/pc/cdboot.S: likewise + * mmap/i386/pc/mmap_helper.S: likewise + * commands/i386/pc/drivemap_int13h.S: likewise + 2009-06-04 Vladimir Serbinenko Check if compiler is apple cc diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index fc31f5a61..c22dccd79 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -30,7 +30,11 @@ #define ABS(x) (x-_start+0x7c00) /* Print message string */ +#ifdef APPLE_CC +#define MSG(x) x ## _abs = ABS(x); movw $x ## _abs, %si; call message +#else #define MSG(x) movw $ABS(x), %si; call message +#endif .file "boot.S" @@ -125,7 +129,12 @@ boot_drive_check: * ljmp to the next instruction because some bogus BIOSes * jump to 07C0:0000 instead of 0000:7C00. */ +#ifdef APPLE_CC + real_start_abs = ABS(real_start) + ljmp $0, $(real_start_abs) +#else ljmp $0, $ABS(real_start) +#endif real_start: @@ -143,7 +152,12 @@ real_start: * Check if we have a forced disk reference here */ /* assign root_drive at the same time */ - movw ABS(boot_drive), %ax +#ifdef APPLE_CC + boot_drive_abs = ABS (boot_drive) + movw boot_drive_abs, %ax +#else + movw ABS(boot_drive), %ax +#endif movb %ah, %dh cmpb $0xff, %al je 1f @@ -156,7 +170,12 @@ real_start: MSG(notification_string) /* set %si to the disk address packet */ +#ifdef APPLE_CC + disk_address_packet_abs = ABS (disk_address_packet) + movw $disk_address_packet_abs, %si +#else movw $ABS(disk_address_packet), %si +#endif /* do not probe LBA if the drive is a floppy */ testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl @@ -197,10 +216,18 @@ lba_mode: movw $0x0010, (%si) /* the absolute address */ +#ifdef APPLE_CC + kernel_sector_abs = ABS (kernel_sector) + movl (kernel_sector_abs), %ebx + movl %ebx, 8(%si) + movl (kernel_sector_abs + 4), %ebx + movl %ebx, 12(%si) +#else movl ABS(kernel_sector), %ebx movl %ebx, 8(%si) movl ABS(kernel_sector + 4), %ebx movl %ebx, 12(%si) +#endif /* the segment of buffer address */ movw $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si) @@ -267,12 +294,22 @@ final_init: setup_sectors: /* load logical sector start (top half) */ +#ifdef APPLE_CC + kernel_sector_abs = ABS (kernel_sector) + movl (kernel_sector_abs + 4), %eax +#else movl ABS(kernel_sector + 4), %eax +#endif + orl %eax, %eax jnz geometry_error /* load logical sector start (bottom half) */ +#ifdef APPLE_CC + movl (kernel_sector_abs), %eax +#else movl ABS(kernel_sector), %eax +#endif /* zero %edx */ xorl %edx, %edx @@ -336,7 +373,12 @@ setup_sectors: movw %es, %bx copy_buffer: +#ifdef APPLE_CC + kernel_segment_abs = ABS (kernel_segment) + movw (kernel_segment_abs), %es +#else movw ABS(kernel_segment), %es +#endif /* * We need to save %cx and %si because the startup code in @@ -360,7 +402,12 @@ copy_buffer: popw %dx /* boot kernel */ +#ifdef APPLE_CC + kernel_address_abs = ABS (kernel_address) + jmp *(kernel_address_abs) +#else jmp *(kernel_address) +#endif /* END OF MAIN LOOP */ @@ -446,7 +493,12 @@ floppy_probe: * Perform floppy probe. */ +#ifdef APPLE_CC + probe_values_abs = ABS (probe_values) + movw $(probe_values_abs-1), %si +#else movw $ABS(probe_values-1), %si +#endif probe_loop: /* reset floppy controller INT 13h AH=0 */ diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S index 133f8dee5..b32f82ce8 100644 --- a/boot/i386/pc/cdboot.S +++ b/boot/i386/pc/cdboot.S @@ -67,8 +67,15 @@ bi_reserved: movw %ax, %ds movw %ax, %es +#ifdef APPLE_CC + err_noboot_msg_abs = 0x7C00 + err_noboot_msg - start + movw $err_noboot_msg_abs, %si + bi_length_dif = bi_length - next + movl %cs:bi_length_dif(%bx), %ecx +#else movw $(0x7C00 + err_noboot_msg - start), %si movl %cs: bi_length - next(%bx), %ecx +#endif orl %ecx, %ecx jz fail @@ -152,7 +159,12 @@ read_cdrom: ret cdrom_fail: +#ifdef APPLE_CC + err_cdfail_msg_abs = 0x7C00 + err_cdfail_msg - start + movw $(err_cdfail_msg_abs), %si +#else movw $(0x7C00 + err_cdfail_msg - start), %si +#endif fail: movb $0x0e, %ah diff --git a/boot/i386/pc/diskboot.S b/boot/i386/pc/diskboot.S index 0c8e75df0..f29ddaa15 100644 --- a/boot/i386/pc/diskboot.S +++ b/boot/i386/pc/diskboot.S @@ -28,7 +28,11 @@ #define ABS(x) (x-_start+GRUB_BOOT_MACHINE_KERNEL_ADDR) /* Print message string */ +#ifdef APPLE_CC +#define MSG(x) x ## _abs = ABS(x); mov $x ## _abs, %esi; call message +#else #define MSG(x) movw $ABS(x), %si; call message +#endif .file "diskboot.S" @@ -61,7 +65,12 @@ _start: popw %si /* this sets up for the first run through "bootloop" */ +#ifdef APPLE_CC + firstlist_off_abs = ABS (firstlist - GRUB_BOOT_MACHINE_LIST_SIZE) + movl $firstlist_off_abs, %edi +#else movw $ABS(firstlist - GRUB_BOOT_MACHINE_LIST_SIZE), %di +#endif /* save the sector number of the second sector in %ebp */ movl (%di), %ebp diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index e7f55df86..0db6826d7 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -123,8 +123,15 @@ data_leng: linux_init: +#ifdef APPLE_CC + reg_edx_rel = reg_edx - start + code32_start_rel = code32_start - start + movw %cs:(reg_edx_rel), %dx + movl %cs:(code32_start_rel), %ebp +#else movw %cs:(reg_edx - start), %dx movl %cs:(code32_start - start), %ebp +#endif linux_next: @@ -132,12 +139,22 @@ linux_next: normalize: popw %bx +#ifdef APPLE_CC + normalize_rel = normalize - start + subw $(normalize_rel), %bx +#else subw $(normalize - start), %bx +#endif shrw $4, %bx movw %cs, %ax addw %bx, %ax pushw %ax +#ifdef APPLE_CC + real_code_rel = real_code - start + pushw $(real_code_rel) +#else pushw $(real_code - start) +#endif lret /* Jump to real_code. */ real_code: @@ -164,7 +181,12 @@ real_code: rep movsl +#ifdef APPLE_CC + real_code_2_rel = real_code_2 - start + ljmp $(CODE_ADDR >> 4), $(real_code_2_rel) +#else ljmp $(CODE_ADDR >> 4), $(real_code_2 - start) +#endif real_code_2: @@ -189,8 +211,15 @@ real_code_2: cmpl $MULTIBOOT_MAGIC, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_DATA_END) jz 1f +#ifdef APPLE_CC + ramdisk_image_rel = ramdisk_image - start + ramdisk_size_rel = ramdisk_size - start + movl (ramdisk_image_rel), %esi + movl (ramdisk_size_rel), %ecx +#else movl (ramdisk_image - start), %esi movl (ramdisk_size - start), %ecx +#endif movl $(DATA_ADDR - 0x200), %edi jmp 2f @@ -205,7 +234,12 @@ real_code_2: movsbl %dh, %eax movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART) +#ifdef APPLE_CC + reg_edx_rel = reg_edx - start + movsbl (reg_edx_rel + 2), %eax +#else movsbl (reg_edx + 2 - start), %eax +#endif movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART) movb $0xFF, %dh @@ -234,6 +268,28 @@ move_memory: pushl %ecx movl %esi, %eax +#ifdef APPLE_CC + gdt_src1_rel = gdt_src1 - start + gdt_src2_rel = gdt_src2 - start + gdt_dst1_rel = gdt_dst1 - start + gdt_dst2_rel = gdt_dst2 - start + gdt_rel = gdt - start + + movw %si, (gdt_src1_rel) + shrl $16, %eax + movb %al, (gdt_src1_rel + 2) + movb %ah, (gdt_src2_rel) + + movl %edi, %eax + movw %di, (gdt_dst1_rel) + shrl $16, %eax + movb %al, (gdt_dst1_rel + 2) + movb %ah, (gdt_dst2_rel) + + movw $(gdt_rel), %si + movb $0x87, %ah + shrw $1, %cx +#else movw %si, (gdt_src1 - start) shrl $16, %eax movb %al, (gdt_src1 + 2 - start) @@ -248,6 +304,7 @@ move_memory: movw $(gdt - start), %si movb $0x87, %ah shrw $1, %cx +#endif int $0x15 @@ -257,7 +314,12 @@ move_memory: popl %esi jnc 2f +#ifdef APPLE_CC + err_int15_msg_rel = err_int15_msg - start + movw $(err_int15_msg_rel), %si +#else movw $(err_int15_msg - start), %si +#endif jmp fail 2: diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 23b7302d6..7a3e8e73f 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -30,7 +30,12 @@ FUNCTION(grub_drivemap_handler) /* Map the drive number (always in DL). */ push %ax push %bx +#ifdef APPLE_CC + grub_drivemap_mapstart_ofs = INT13H_OFFSET(EXT_C(grub_drivemap_mapstart)) + movw $grub_drivemap_mapstart_ofs, %bx +#else movw $INT13H_OFFSET(EXT_C(grub_drivemap_mapstart)), %bx +#endif more_remaining: movw %cs:(%bx), %ax diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index fc83c4c0d..23f84ede6 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -69,7 +69,12 @@ _start: /* * Guarantee that "main" is loaded at 0x0:0x8200. */ +#ifdef APPLE_CC + codestart_abs = ABS(codestart) - 0x10000 + ljmp $0, $(codestart_abs) +#else ljmp $0, $ABS(codestart) +#endif /* * Compatibility version number @@ -249,12 +254,24 @@ codestart: movsb #endif +#ifdef APPLE_CC + /* clean out the bss */ + bss_start_abs = ABS (bss_start) + bss_end_abs = ABS (bss_end) + + movl bss_start_abs, %edi + + /* compute the bss length */ + movl bss_end_abs, %ecx + subl %edi, %ecx +#else /* clean out the bss */ movl $BSS_START_SYMBOL, %edi /* compute the bss length */ movl $END_SYMBOL, %ecx subl %edi, %ecx +#endif /* clean out */ xorl %eax, %eax @@ -293,7 +310,13 @@ real_to_prot: cli /* load the GDT register */ +#ifdef APPLE_CC + mov %cs, %ax + mov %ax, %ds + DATA32 ADDR32 lgdt gdtdesc +#else DATA32 ADDR32 lgdt %cs:gdtdesc +#endif /* turn on protected mode */ movl %cr0, %eax @@ -1223,7 +1246,12 @@ translate_keycode: pushw %bx pushw %si +#ifdef APPLE_CC + translation_table_abs = ABS (translation_table) - 0x10000 + movw $(translation_table_abs), %si +#else movw $ABS(translation_table), %si +#endif 1: lodsw /* check if this is the end */ diff --git a/mmap/i386/pc/mmap_helper.S b/mmap/i386/pc/mmap_helper.S index ab7c0d22f..f153f1c98 100644 --- a/mmap/i386/pc/mmap_helper.S +++ b/mmap/i386/pc/mmap_helper.S @@ -28,7 +28,12 @@ VARIABLE(grub_machine_mmaphook_int12) push %ds push %cs pop %ds +#ifdef APPLE_CC + grub_machine_mmaphook_kblow_rel = DS (EXT_C (grub_machine_mmaphook_kblow)) + movw (grub_machine_mmaphook_kblow_rel), %ax +#else movw DS (EXT_C (grub_machine_mmaphook_kblow)), %ax +#endif pop %ds iret @@ -53,8 +58,15 @@ e801: push %ds push %cs pop %ds +#ifdef APPLE_CC + grub_machine_mmaphook_kbin16mb_rel = DS (EXT_C (grub_machine_mmaphook_kbin16mb)) + grub_machine_mmaphook_64kbin4gb_rel = DS (EXT_C (grub_machine_mmaphook_64kbin4gb)) + movw (grub_machine_mmaphook_kbin16mb_rel), %ax + movw (grub_machine_mmaphook_64kbin4gb_rel), %bx +#else movw DS (EXT_C (grub_machine_mmaphook_kbin16mb)), %ax movw DS (EXT_C (grub_machine_mmaphook_64kbin4gb)), %bx +#endif movw %ax, %cx movw %bx, %dx pop %ds @@ -66,26 +78,42 @@ h88: push %ds push %cs pop %ds +#ifdef APPLE_CC + movw (grub_machine_mmaphook_kbin16mb_rel), %ax +#else movw DS (EXT_C (grub_machine_mmaphook_kbin16mb)), %ax +#endif pop %ds clc iret e820: +#ifdef APPLE_CC + mmaphook_mmap_rel = DS(mmaphook_mmap) + mmaphook_mmap_num_rel = DS(EXT_C(grub_machine_mmaphook_mmap_num)) +#endif popf push %ds push %cs pop %ds cmpw $20, %cx jb errexit +#ifdef APPLE_CC + cmpw (mmaphook_mmap_num_rel), %bx +#else cmpw DS (EXT_C (grub_machine_mmaphook_mmap_num)), %bx +#endif jae errexit cmp $0x534d4150, %edx jne errexit push %si push %di movw $20, %cx +#ifdef APPLE_CC + movl $(mmaphook_mmap_rel), %esi +#else movw $(DS(mmaphook_mmap)), %si +#endif mov %bx, %ax imul $20, %ax add %ax, %si @@ -94,7 +122,11 @@ e820: pop %si movl $20, %ecx inc %bx +#ifdef APPLE_CC + cmpw (mmaphook_mmap_num_rel), %bx +#else cmpw DS(EXT_C(grub_machine_mmaphook_mmap_num)), %bx +#endif jb noclean xor %bx, %bx noclean: From cc6c3ac1bf1f4304ab7169b59a17c5af704a0de5 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 20:10:51 +0000 Subject: [PATCH 0791/1707] 2009-06-04 Vladimir Serbinenko Avoid clobbering %ebx/%rbx in inline assembly with Apple's CC * efiemu/runtime/efiemu.c (write_cmos): use %cl instead of %bl as temporary storage * include/grub/i386/tsc.h (grub_get_tsc): restore %rbx/%ebx when using Apple's CC (grub_cpu_is_tsc_supported): likewise * loader/i386/xnu.c (guessfsb): restore %rbx/%ebx in inline assembly --- ChangeLog | 11 +++++++++++ efiemu/runtime/efiemu.c | 4 ++-- include/grub/i386/tsc.h | 38 +++++++++++++++++++++++++++++++++++-- loader/i386/xnu.c | 42 ++++++++++++++++++++++++++++++++++++++++- 4 files changed, 90 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4c63b3107..01fc3a232 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-06-04 Vladimir Serbinenko + + Avoid clobbering %ebx/%rbx in inline assembly with Apple's CC + + * efiemu/runtime/efiemu.c (write_cmos): use %cl instead of %bl as + temporary storage + * include/grub/i386/tsc.h (grub_get_tsc): restore %rbx/%ebx when + using Apple's CC + (grub_cpu_is_tsc_supported): likewise + * loader/i386/xnu.c (guessfsb): restore %rbx/%ebx in inline assembly + 2009-06-04 Vladimir Serbinenko Absolute addressing through constant with Apple's cc diff --git a/efiemu/runtime/efiemu.c b/efiemu/runtime/efiemu.c index 5887c48ab..f73f843ea 100644 --- a/efiemu/runtime/efiemu.c +++ b/efiemu/runtime/efiemu.c @@ -162,8 +162,8 @@ static inline void write_cmos (grub_uint8_t addr, grub_uint8_t val) { __asm__ __volatile__ ("outb %%al,$0x70\n" - "mov %%bl, %%al\n" - "outb %%al,$0x71": :"a" (addr), "b" (val)); + "mov %%cl, %%al\n" + "outb %%al,$0x71": :"a" (addr), "c" (val)); } static inline grub_uint8_t diff --git a/include/grub/i386/tsc.h b/include/grub/i386/tsc.h index 963370113..aa4014575 100644 --- a/include/grub/i386/tsc.h +++ b/include/grub/i386/tsc.h @@ -29,8 +29,24 @@ grub_get_tsc (void) /* The CPUID instruction is a 'serializing' instruction, and avoids out-of-order execution of the RDTSC instruction. */ +#ifdef APPLE_CC __asm__ __volatile__ ("xorl %%eax, %%eax\n\t" - "cpuid":::"%rax", "%rbx", "%rcx", "%rdx"); +#ifdef __x86_64__ + "push %%rbx\n" +#else + "push %%ebx\n" +#endif + "cpuid\n" +#ifdef __x86_64__ + "pop %%rbx\n" +#else + "pop %%ebx\n" +#endif + :::"%rax", "%rcx", "%rdx"); +#else + __asm__ __volatile__ ("xorl %%eax, %%eax\n\t" + "cpuid":::"%rax", "%rbx", "%rcx", "%rdx"); +#endif /* Read TSC value. We cannot use "=A", since this would use %rax on x86_64. */ __asm__ __volatile__ ("rdtsc":"=a" (lo), "=d" (hi)); @@ -93,11 +109,29 @@ grub_cpu_is_tsc_supported (void) return 0; grub_uint32_t features; +#ifdef APPLE_CC __asm__ ("movl $1, %%eax\n\t" - "cpuid" +#ifdef __x86_64__ + "push %%rbx\n" +#else + "push %%ebx\n" +#endif + "cpuid\n" +#ifdef __x86_64__ + "pop %%rbx\n" +#else + "pop %%ebx\n" +#endif + : "=d" (features) + : /* No inputs. */ + : /* Clobbered: */ "%rax", "%rcx"); +#else + __asm__ ("movl $1, %%eax\n\t" + "cpuid\n" : "=d" (features) : /* No inputs. */ : /* Clobbered: */ "%rax", "%rbx", "%rcx"); +#endif return (features & (1 << 4)) != 0; } diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index 086016024..c0e731c09 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -125,6 +125,28 @@ guessfsb (void) if (! grub_cpu_is_cpuid_supported ()) return sane_value; + +#ifdef APPLE_CC + asm volatile ("movl $0, %%eax\n" +#ifdef __x86_64__ + "push %%rbx\n" +#else + "push %%ebx\n" +#endif + "cpuid\n" +#ifdef __x86_64__ + "pop %%rbx\n" +#else + "pop %%ebx\n" +#endif + : "=a" (max_cpuid), + "=d" (manufacturer[1]), "=c" (manufacturer[2])); + + /* Only Intel for now is done. */ + if (grub_memcmp (manufacturer + 1, "ineIntel", 12) != 0) + return sane_value; + +#else asm volatile ("movl $0, %%eax\n" "cpuid" : "=a" (max_cpuid), "=b" (manufacturer[0]), @@ -133,15 +155,33 @@ guessfsb (void) /* Only Intel for now is done. */ if (grub_memcmp (manufacturer, "GenuineIntel", 12) != 0) return sane_value; +#endif /* Check Speedstep. */ if (max_cpuid < 1) return sane_value; +#ifdef APPLE_CC + asm volatile ("movl $1, %%eax\n" +#ifdef __x86_64__ + "push %%rbx\n" +#else + "push %%ebx\n" +#endif + "cpuid\n" +#ifdef __x86_64__ + "pop %%rbx\n" +#else + "pop %%ebx\n" +#endif + : "=c" (capabilities): + : "%rax", "%rdx"); +#else asm volatile ("movl $1, %%eax\n" "cpuid" : "=c" (capabilities): - : "%eax", "%ebx", "%edx"); + : "%rax", "%rbx", "%rdx"); +#endif if (! (capabilities & (1 << 7))) return sane_value; From e8df1d4eb30934a0b57ca327451e390ad4efb412 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 20:16:13 +0000 Subject: [PATCH 0792/1707] 2009-06-04 Vladimir Serbinenko Remove nested functions in efiemu core * efiemu/runtime/efiemu.c (reflect): make static instead of nested --- ChangeLog | 6 ++++++ efiemu/runtime/efiemu.c | 32 ++++++++++++++++---------------- 2 files changed, 22 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 01fc3a232..26bb5e5d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-04 Vladimir Serbinenko + + Remove nested functions in efiemu core + + * efiemu/runtime/efiemu.c (reflect): make static instead of nested + 2009-06-04 Vladimir Serbinenko Avoid clobbering %ebx/%rbx in inline assembly with Apple's CC diff --git a/efiemu/runtime/efiemu.c b/efiemu/runtime/efiemu.c index f73f843ea..71188130d 100644 --- a/efiemu/runtime/efiemu.c +++ b/efiemu/runtime/efiemu.c @@ -271,25 +271,25 @@ EFI_FUNC (efiemu_set_wakeup_time) (grub_efi_boolean_t enabled, static grub_uint32_t crc32_table [256]; +static grub_uint32_t +reflect (grub_uint32_t ref, int len) +{ + grub_uint32_t result = 0; + int i; + + for (i = 1; i <= len; i++) + { + if (ref & 1) + result |= 1 << (len - i); + ref >>= 1; + } + + return result; +} + static void init_crc32_table (void) { - auto grub_uint32_t reflect (grub_uint32_t ref, int len); - grub_uint32_t reflect (grub_uint32_t ref, int len) - { - grub_uint32_t result = 0; - int i; - - for (i = 1; i <= len; i++) - { - if (ref & 1) - result |= 1 << (len - i); - ref >>= 1; - } - - return result; - } - grub_uint32_t polynomial = 0x04c11db7; int i, j; From c8600122db6742bb52e1f77b873cac9a0d370e0a Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 20:25:11 +0000 Subject: [PATCH 0793/1707] 2009-06-04 Vladimir Serbinenko Allow a compilation without -mcmodel=large * kern/efi/mm.c (grub_efi_allocate_pages): don't allocate >4GiB when compiled without -mcmodel=large (filter_memory_map): remove memory post 4 GiB when compiled without -mcmodel=large * configure.ac: fail gracefully and add -DMCMODEL_SMALL=1 to TARGET_CFLAGS when -mcmodel=large isn't supported --- ChangeLog | 11 +++++++++++ configure.ac | 15 ++++++++++----- kern/efi/mm.c | 6 ++++-- 3 files changed, 25 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26bb5e5d8..71193d1b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-06-04 Vladimir Serbinenko + + Allow a compilation without -mcmodel=large + + * kern/efi/mm.c (grub_efi_allocate_pages): don't allocate >4GiB + when compiled without -mcmodel=large + (filter_memory_map): remove memory post 4 GiB when compiled + without -mcmodel=large + * configure.ac: fail gracefully and add -DMCMODEL_SMALL=1 to + TARGET_CFLAGS when -mcmodel=large isn't supported + 2009-06-04 Vladimir Serbinenko Remove nested functions in efiemu core diff --git a/configure.ac b/configure.ac index 6649cb90a..bd89e4ecb 100644 --- a/configure.ac +++ b/configure.ac @@ -339,18 +339,23 @@ fi if test "$target_cpu"-"$platform" = x86_64-efi; then # Use large model to support 4G memory AC_CACHE_CHECK([whether option -mcmodel=large works], grub_cv_cc_mcmodel, [ - CFLAGS="-m64 -mcmodel=large" + SAVED_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -m64 -mcmodel=large" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_mcmodel=yes], [grub_cv_cc_mcmodel=no]) ]) - if test "x$grub_cv_cc_no_mcmodel" = xno; then - AC_MSG_ERROR([-mcmodel=large not supported, upgrade your gcc]) + if test "x$grub_cv_cc_mcmodel" = xno; then + CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1" + TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1" + AC_MSG_WARN([-mcmodel=large not supported. You wan't be able to use the memory over 4GiB. Upgrade your gcc]) + else + TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" fi # EFI writes to stack below %rsp, we must not use the red zone AC_CACHE_CHECK([whether option -mno-red-zone works], grub_cv_cc_no_red_zone, [ - CFLAGS="-m64 -mno-red-zone" + CFLAGS="$CFLAGS -m64 -mno-red-zone" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_no_red_zone=yes], [grub_cv_cc_no_red_zone=no]) @@ -359,7 +364,7 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then AC_MSG_ERROR([-mno-red-zone not supported, upgrade your gcc]) fi - TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large -mno-red-zone" + TARGET_CFLAGS="$TARGET_CFLAGS -mno-red-zone" fi # diff --git a/kern/efi/mm.c b/kern/efi/mm.c index 463577616..30b5ab4ad 100644 --- a/kern/efi/mm.c +++ b/kern/efi/mm.c @@ -63,7 +63,9 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, /* Limit the memory access to less than 4GB for 32-bit platforms. */ if (address > 0xffffffff) return 0; +#endif +#if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL) if (address == 0) { type = GRUB_EFI_ALLOCATE_MAX_ADDRESS; @@ -218,7 +220,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { if (desc->type == GRUB_EFI_CONVENTIONAL_MEMORY -#if GRUB_TARGET_SIZEOF_VOID_P < 8 +#if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL) && desc->physical_start <= 0xffffffff #endif && desc->physical_start + PAGES_TO_BYTES (desc->num_pages) > 0x100000 @@ -234,7 +236,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, desc->physical_start = 0x100000; } -#if GRUB_TARGET_SIZEOF_VOID_P < 8 +#if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL) if (BYTES_TO_PAGES (filtered_desc->physical_start) + filtered_desc->num_pages > BYTES_TO_PAGES (0x100000000LL)) From d119a20ce545596702d07bb0477f25f06092c4d6 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 20:40:51 +0000 Subject: [PATCH 0794/1707] 2009-06-04 Vladimir Serbinenko Define segment as well as section when compiling with Apple's CC * efiemu/runtime/efiemu.c (PHYSICAL_ATTRIBUTE): new definition (efiemu_set_virtual_address_map): declare with PHYSICAL_ATTRIBUTE (efiemu_convert_pointer): likewise (efiemu_set_virtual_address_map): likewise (efiemu_convert_pointer): likewise (efiemu_getcrc32): likewise (init_crc32_table): likewise (reflect): likewise * include/grub/dl.h (GRUB_MOD_NAME): define segment with Apple's CC (GRUB_MOD_DEP): likewise --- ChangeLog | 16 ++++++++++++++++ efiemu/runtime/efiemu.c | 20 ++++++++++++++------ include/grub/dl.h | 8 ++++++++ 3 files changed, 38 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 71193d1b4..fdf61bbda 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-06-04 Vladimir Serbinenko + + Define segment as well as section when compiling with + Apple's CC + + * efiemu/runtime/efiemu.c (PHYSICAL_ATTRIBUTE): new definition + (efiemu_set_virtual_address_map): declare with PHYSICAL_ATTRIBUTE + (efiemu_convert_pointer): likewise + (efiemu_set_virtual_address_map): likewise + (efiemu_convert_pointer): likewise + (efiemu_getcrc32): likewise + (init_crc32_table): likewise + (reflect): likewise + * include/grub/dl.h (GRUB_MOD_NAME): define segment with Apple's CC + (GRUB_MOD_DEP): likewise + 2009-06-04 Vladimir Serbinenko Allow a compilation without -mcmodel=large diff --git a/efiemu/runtime/efiemu.c b/efiemu/runtime/efiemu.c index 71188130d..0316e4957 100644 --- a/efiemu/runtime/efiemu.c +++ b/efiemu/runtime/efiemu.c @@ -40,18 +40,23 @@ grub_efi_status_t efiemu_set_wakeup_time (grub_efi_boolean_t enabled, grub_efi_time_t *time); +#ifdef APPLE_CC +#define PHYSICAL_ATTRIBUTE __attribute__ ((section("_text-physical, _text-physical"))); +#else +#define PHYSICAL_ATTRIBUTE __attribute__ ((section(".text-physical"))); +#endif grub_efi_status_t efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, grub_efi_uintn_t descriptor_size, grub_efi_uint32_t descriptor_version, grub_efi_memory_descriptor_t *virtual_map) - __attribute__ ((section(".text-physical"))); + PHYSICAL_ATTRIBUTE; grub_efi_status_t efiemu_convert_pointer (grub_efi_uintn_t debug_disposition, void **address) - __attribute__ ((section(".text-physical"))); + PHYSICAL_ATTRIBUTE; grub_efi_status_t efiemu_get_variable (grub_efi_char16_t *variable_name, @@ -84,17 +89,20 @@ EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t, grub_efi_uintn_t, grub_efi_uint32_t, grub_efi_memory_descriptor_t *) - __attribute__ ((section(".text-physical"))); + PHYSICAL_ATTRIBUTE; grub_efi_status_t EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, void **address) - __attribute__ ((section(".text-physical"))); + PHYSICAL_ATTRIBUTE; static grub_uint32_t efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) - __attribute__ ((section(".text-physical"))); + PHYSICAL_ATTRIBUTE; static void init_crc32_table (void) - __attribute__ ((section(".text-physical"))); + PHYSICAL_ATTRIBUTE; +static grub_uint32_t +reflect (grub_uint32_t ref, int len) + PHYSICAL_ATTRIBUTE; /* The log. It's used when examining memory dump diff --git a/include/grub/dl.h b/include/grub/dl.h index 55f5d4e22..894da1d33 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -40,11 +40,19 @@ grub_##name##_fini (void) { grub_mod_fini (); } \ static void \ grub_mod_fini (void) +#ifdef APPLE_CC +#define GRUB_MOD_NAME(name) \ +static char grub_modname[] __attribute__ ((section ("_modname, _modname"), used)) = #name; + +#define GRUB_MOD_DEP(name) \ +__asm__ (".section _moddeps, _moddeps\n.asciz \"" #name "\"\n") +#else #define GRUB_MOD_NAME(name) \ __asm__ (".section .modname\n.asciz \"" #name "\"\n") #define GRUB_MOD_DEP(name) \ __asm__ (".section .moddeps\n.asciz \"" #name "\"\n") +#endif struct grub_dl_segment { From cf00df31670f11a16773347713e595a204b99b2b Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 20:54:14 +0000 Subject: [PATCH 0795/1707] 2009-06-04 Vladimir Serbinenko Use objconv when compiling with Apple's CC * conf/i386-pc.rmk (efiemu32.o): use OBJCONV if defined (efiemu64.o): likewise (efiemu64_c.o): omit -mcmodel=large and add -DAPPLE_CC=1 when compiling with Apple's CC (efiemu64_s.o): likewise * configure.ac: check for objconv when compiling with Apple's CC * genmk.rb: use objconv for modules when compiled with Apple's CC --- ChangeLog | 12 ++++++++++++ conf/i386-pc.rmk | 40 ++++++++++++++++++++++++++++++++++------ configure.ac | 8 ++++++++ genmk.rb | 9 +++++++++ 4 files changed, 63 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index fdf61bbda..f26936e8b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-06-04 Vladimir Serbinenko + + Use objconv when compiling with Apple's CC + + * conf/i386-pc.rmk (efiemu32.o): use OBJCONV if defined + (efiemu64.o): likewise + (efiemu64_c.o): omit -mcmodel=large and add -DAPPLE_CC=1 + when compiling with Apple's CC + (efiemu64_s.o): likewise + * configure.ac: check for objconv when compiling with Apple's CC + * genmk.rb: use objconv for modules when compiled with Apple's CC + 2009-06-04 Vladimir Serbinenko Define segment as well as section when compiling with diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 83857672f..066b50625 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -397,16 +397,44 @@ hdparm_mod_LDFLAGS = $(COMMON_LDFLAGS) ifeq ($(enable_efiemu), yes) -efiemu32.o: efiemu/runtime/efiemu.c - $(CC) -c -m32 -DELF32 -o $@ -Wall -Werror $< -nostdlib -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude +efiemu32.o: efiemu/runtime/efiemu.c $(TARGET_OBJ2ELF) + -rm -f $@ +ifeq ($(TARGET_APPLE_CC), 1) + -rm -f $@.bin + $(TARGET_CC) -c -m32 -DELF32 -DAPPLE_CC -o $@.bin -Wall -Werror $< -nostdlib -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude + $(OBJCONV) -felf32 -nu -nd $@.bin $@ + -rm -f $@.bin +else + $(TARGET_CC) -c -m32 -DELF32 -o $@ -Wall -Werror $< -nostdlib -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi +endif + efiemu64_c.o: efiemu/runtime/efiemu.c - $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude +ifeq ($(TARGET_APPLE_CC), 1) + $(TARGET_CC) -c -m64 -DAPPLE_CC=1 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude +else + $(TARGET_CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude +endif efiemu64_s.o: efiemu/runtime/efiemu.S - $(CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude + -rm -f $@ +ifeq ($(TARGET_APPLE_CC), 1) + $(TARGET_CC) -c -m64 -DAPPLE_CC=1 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude +else + $(TARGET_CC) -c -m64 -DELF64 -o $@ -Wall -Werror $< -nostdlib -mcmodel=large -mno-red-zone -O2 -I$(srcdir)/efiemu/runtime -I$(srcdir)/include -Iinclude +endif -efiemu64.o: efiemu64_c.o efiemu64_s.o - ld -melf_x86_64 -o $@ -r $^ -nostdlib +efiemu64.o: efiemu64_c.o efiemu64_s.o $(TARGET_OBJ2ELF) + -rm -f $@ +ifeq ($(TARGET_APPLE_CC), 1) + -rm -f $@.bin + $(TARGET_CC) -m64 -o $@.bin -Wl,-r $^ -nostdlib + $(OBJCONV) -felf64 -nu -nd $@.bin $@ + -rm -f $@.bin +else + $(TARGET_CC) -m64 -o $@ -Wl,-r $^ -nostdlib + if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi +endif CLEANFILES += efiemu32.o efiemu64.o efiemu64_c.o efiemu64_s.o pkglib_DATA += efiemu32.o efiemu64.o diff --git a/configure.ac b/configure.ac index bd89e4ecb..e448c2fd1 100644 --- a/configure.ac +++ b/configure.ac @@ -287,6 +287,13 @@ if test x$grub_cv_apple_target_cc == xyes ; then CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions" TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1" TARGET_APPLE_CC=1 + AC_CHECK_PROG([OBJCONV], [objconv], [objconv], []) + if test "x$OBJCONV" = x ; then + AC_CHECK_PROG([OBJCONV], [objconv], [./objconv], [], [.]) + fi + if test "x$OBJCONV" = x ; then + AC_MSG_ERROR([objconv not found which is required when building with apple compiler]) + fi TARGET_IMG_LDSCRIPT= TARGET_IMG_CFLAGS="-static" TARGET_IMG_LDFLAGS='-nostdlib -static -Wl,-preload -Wl,-segalign,20 -Wl,-image_base,' @@ -390,6 +397,7 @@ fi AC_SUBST(TARGET_CFLAGS) AC_SUBST(TARGET_MODULE_FORMAT) +AC_SUBST(OBJCONV) AC_SUBST(TARGET_APPLE_CC) AC_SUBST(TARGET_ASFLAGS) AC_SUBST(TARGET_CPPFLAGS) diff --git a/genmk.rb b/genmk.rb index cfe120ad0..249dcb5f7 100644 --- a/genmk.rb +++ b/genmk.rb @@ -112,11 +112,20 @@ endif MOSTLYCLEANFILES += #{deps_str} UNDSYMFILES += #{undsym} +ifneq ($(TARGET_APPLE_CC),1) #{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) -rm -f $@ $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj} if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ +else +#{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) + -rm -f $@ + -rm -f $@.bin + $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@.bin #{pre_obj} #{mod_obj} + $(OBJCONV) -f$(TARGET_MODULE_FORMAT) -nr:_grub_mod_init:grub_mod_init -nr:_grub_mod_fini:grub_mod_fini -wd1106 -nu -nd $@.bin $@ + -rm -f $@.bin +endif #{pre_obj}: $(#{prefix}_DEPENDENCIES) #{objs_str} -rm -f $@ From e37ffc5cf6dd4989e8c490edd01125566082ac85 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 21:01:11 +0000 Subject: [PATCH 0796/1707] 2009-06-04 Vladimir Serbinenko Use grub-macho2img when compiling with Apple's CC for PCBIOS machine * conf/common.rmk (bin_UTILITIES): add (on false on condition) grub-macho2img (CLEANFILES): add grub-macho2img (grub_macho2img_SOURCES): new variable * kern/i386/pc/startup.S (bss_start): new variable (bss_end): likewise * genmk.rb: use grub-macho2img for *.img when compiled with Apple's CC * util/grub-macho2img.c: new file --- ChangeLog | 13 +++++ conf/common.rmk | 10 ++++ genmk.rb | 10 ++++ kern/i386/pc/startup.S | 7 +++ util/grub-macho2img.c | 116 +++++++++++++++++++++++++++++++++++++++++ 5 files changed, 156 insertions(+) create mode 100644 util/grub-macho2img.c diff --git a/ChangeLog b/ChangeLog index f26936e8b..f2abef9dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-06-04 Vladimir Serbinenko + + Use grub-macho2img when compiling with Apple's CC for PCBIOS machine + + * conf/common.rmk (bin_UTILITIES): add (on false on condition) + grub-macho2img + (CLEANFILES): add grub-macho2img + (grub_macho2img_SOURCES): new variable + * kern/i386/pc/startup.S (bss_start): new variable + (bss_end): likewise + * genmk.rb: use grub-macho2img for *.img when compiled with Apple's CC + * util/grub-macho2img.c: new file + 2009-06-04 Vladimir Serbinenko Use objconv when compiling with Apple's CC diff --git a/conf/common.rmk b/conf/common.rmk index ca18c534a..3e59c3aac 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -125,6 +125,16 @@ endif grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c CLEANFILES += grub-pe2elf +# grub_macho2img assumes a lot about source file. +# So installing it definitively is useless +# But adding to bin_UTILITIES is needed for +# genmk.rb to work +ifeq (0,1) +bin_UTILITIES += grub-macho2img +endif +grub_macho2img_SOURCES = util/grub-macho2img.c +CLEANFILES += grub-macho2img + # For grub-mkconfig grub-mkconfig: util/grub-mkconfig.in config.status ./config.status --file=$@:$< diff --git a/genmk.rb b/genmk.rb index 249dcb5f7..05ecc9662 100644 --- a/genmk.rb +++ b/genmk.rb @@ -56,8 +56,18 @@ class Image "CLEANFILES += #{@name} #{exe} #{objs_str} MOSTLYCLEANFILES += #{deps_str} +ifneq ($(TARGET_APPLE_CC),1) #{@name}: #{exe} $(OBJCOPY) -O $(#{prefix}_FORMAT) --strip-unneeded -R .note -R .comment -R .note.gnu.build-id $< $@ +else +ifneq (#{exe},kernel.exec) +#{@name}: #{exe} ./grub-macho2img + ./grub-macho2img $< $@ +else +#{@name}: #{exe} ./grub-macho2img + ./grub-macho2img --bss $< $@ +endif +endif #{exe}: #{objs_str} $(TARGET_CC) -o $@ $^ $(TARGET_LDFLAGS) $(#{prefix}_LDFLAGS) diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 23f84ede6..6cdc79a1d 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -110,6 +110,13 @@ VARIABLE(grub_prefix) . = _start + GRUB_KERNEL_MACHINE_DATA_END +#ifdef APPLE_CC +bss_start: + .long 0 +bss_end: + .long 0 +#endif + /* * Support for booting GRUB from a Multiboot boot loader (e.g. GRUB itself). * This uses the a.out kludge to load raw binary to the area starting at 1MB, diff --git a/util/grub-macho2img.c b/util/grub-macho2img.c new file mode 100644 index 000000000..63c94c742 --- /dev/null +++ b/util/grub-macho2img.c @@ -0,0 +1,116 @@ +/* macho2img.c - tool to convert Mach-O to raw imagw. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + +/* XXX: this file assumes particular Mach-O layout and does no checks. */ +/* However as build system ensures correct usage of this tool this + shouldn't be a problem. */ + +int +main (int argc, char **argv) +{ + FILE *in, *out; + int do_bss = 0; + char *buf; + int bufsize; + struct grub_macho_header32 *head; + struct grub_macho_segment32 *curcmd; + unsigned i; + unsigned bssstart = 0; + unsigned bssend = 0; + + if (argc && strcmp (argv[1], "--bss") == 0) + do_bss = 1; + if (argc < 2 + do_bss) + { + printf ("Usage: %s [--bss] filename.exec filename.img\n" + "Convert Mach-O into raw image\n", argv[0]); + return 0; + } + in = fopen (argv[1 + do_bss], "rb"); + if (! in) + { + printf ("Couldn't open %s\n", argv[1 + do_bss]); + return 1; + } + out = fopen (argv[2 + do_bss], "wb"); + if (! out) + { + fclose (in); + printf ("Couldn't open %s\n", argv[2 + do_bss]); + return 2; + } + fseek (in, 0, SEEK_END); + bufsize = ftell (in); + fseek (in, 0, SEEK_SET); + buf = malloc (bufsize); + if (! buf) + { + fclose (in); + fclose (out); + printf ("Couldn't allocate buffer\n"); + return 3; + } + fread (buf, 1, bufsize, in); + head = (struct grub_macho_header32 *) buf; + if (grub_le_to_cpu32 (head->magic) != GRUB_MACHO_MAGIC32) + { + fclose (in); + fclose (out); + free (buf); + printf ("Invalid Mach-O fle\n"); + return 4; + } + curcmd = (struct grub_macho_segment32 *) (buf + sizeof (*head)); + for (i = 0; i < grub_le_to_cpu32 (head->ncmds); i++, + curcmd = (struct grub_macho_segment32 *) + (((char *) curcmd) + curcmd->cmdsize)) + { + if (curcmd->cmd != GRUB_MACHO_CMD_SEGMENT32) + continue; + fwrite (buf + grub_le_to_cpu32 (curcmd->fileoff), 1, + grub_le_to_cpu32 (curcmd->filesize), out); + if (grub_le_to_cpu32 (curcmd->vmsize) + > grub_le_to_cpu32 (curcmd->filesize)) + { + bssstart = grub_le_to_cpu32 (curcmd->vmaddr) + + grub_le_to_cpu32 (curcmd->filesize) ; + bssend = grub_le_to_cpu32 (curcmd->vmaddr) + + grub_le_to_cpu32 (curcmd->vmsize) ; + } + } + if (do_bss) + { + grub_uint32_t tmp; + fseek (out, 0x5c, SEEK_SET); + tmp = grub_cpu_to_le32 (bssstart); + fwrite (&tmp, 4, 1, out); + tmp = grub_cpu_to_le32 (bssend); + fwrite (&tmp, 4, 1, out); + } + fclose (in); + fclose (out); + printf("macho2img complete\n"); + return 0; +} From 6c6884771273b3b3864670051f749872dccc70c3 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 21:17:05 +0000 Subject: [PATCH 0797/1707] 2009-06-04 Vladimir Serbinenko Avoid aliases when compiling with Apple's CC for PCBIOS machine * kern/misc.c [APPLE_CC] (memcpy): new function [APPLE_CC] (memmove): likewise [APPLE_CC && !GRUB_UTIL] (grub_err_printf): likewise (memcpy): define alias conditionaly on !APPLE_CC (memset): likewise (abort): likewise * include/grub/misc.h (memove): don't define when both GRUB_UTIL and APPLE_CC are defined * include/grub/list.h [APPLE_CC] (grub_assert_fail): new function (grub_assert_fail): make prototype conditional --- ChangeLog | 15 +++++++++++++++ include/grub/list.h | 11 +++++++++++ include/grub/misc.h | 2 ++ kern/misc.c | 36 +++++++++++++++++++++++++++++++++++- 4 files changed, 63 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f2abef9dd..03b8f64c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-06-04 Vladimir Serbinenko + + Avoid aliases when compiling with Apple's CC for PCBIOS machine + + * kern/misc.c [APPLE_CC] (memcpy): new function + [APPLE_CC] (memmove): likewise + [APPLE_CC && !GRUB_UTIL] (grub_err_printf): likewise + (memcpy): define alias conditionaly on !APPLE_CC + (memset): likewise + (abort): likewise + * include/grub/misc.h (memove): don't define when both GRUB_UTIL and + APPLE_CC are defined + * include/grub/list.h [APPLE_CC] (grub_assert_fail): new function + (grub_assert_fail): make prototype conditional + 2009-06-04 Vladimir Serbinenko Use grub-macho2img when compiling with Apple's CC for PCBIOS machine diff --git a/include/grub/list.h b/include/grub/list.h index eba12371b..6e034928a 100644 --- a/include/grub/list.h +++ b/include/grub/list.h @@ -41,7 +41,18 @@ void EXPORT_FUNC(grub_list_insert) (grub_list_t *head, grub_list_t item, /* This function doesn't exist, so if assertion is false for some reason, the linker would fail. */ +#ifdef APPLE_CC +/* This approach fails with Apple's gcc. Use grub_abort. */ +#include +static inline void * +grub_assert_fail (void) +{ + grub_abort (); + return 0; +} +#else extern void* grub_assert_fail (void); +#endif #define GRUB_FIELD_MATCH(ptr, type, field) \ ((char *) &(ptr)->field == (char *) &((type) (ptr))->field) diff --git a/include/grub/misc.h b/include/grub/misc.h index 5c8baa1aa..23e0ce60d 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -40,8 +40,10 @@ char *EXPORT_FUNC(grub_strcat) (char *dest, const char *src); char *EXPORT_FUNC(grub_strncat) (char *dest, const char *src, int c); /* Prototypes for aliases. */ +#if !defined (GRUB_UTIL) || !defined (APPLE_CC) void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); +#endif int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2); diff --git a/kern/misc.c b/kern/misc.c index 4c71ca854..4b46c6762 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -44,11 +44,23 @@ grub_memmove (void *dest, const void *src, grub_size_t n) return dest; } + +#ifndef APPLE_CC void *memmove (void *dest, const void *src, grub_size_t n) __attribute__ ((alias ("grub_memmove"))); /* GCC emits references to memcpy() for struct copies etc. */ void *memcpy (void *dest, const void *src, grub_size_t n) __attribute__ ((alias ("grub_memmove"))); +#else +void *memcpy (void *dest, const void *src, grub_size_t n) +{ + return grub_memmove (dest, src, n); +} +void *memmove (void *dest, const void *src, grub_size_t n) +{ + return grub_memmove (dest, src, n); +} +#endif char * grub_strcpy (char *dest, const char *src) @@ -134,7 +146,22 @@ grub_printf (const char *fmt, ...) return ret; } -#ifndef GRUB_UTIL +#if defined (APPLE_CC) && ! defined (GRUB_UTIL) +int +grub_err_printf (const char *fmt, ...) +{ + va_list ap; + int ret; + + va_start (ap, fmt); + ret = grub_vprintf (fmt, ap); + va_end (ap); + + return ret; +} +#endif + +#if ! defined (APPLE_CC) && ! defined (GRUB_UTIL) int grub_err_printf (const char *fmt, ...) __attribute__ ((alias("grub_printf"))); #endif @@ -185,8 +212,10 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n) return 0; } +#ifndef APPLE_CC int memcmp (const void *s1, const void *s2, grub_size_t n) __attribute__ ((alias ("grub_memcmp"))); +#endif int grub_strcmp (const char *s1, const char *s2) @@ -534,8 +563,10 @@ grub_memset (void *s, int c, grub_size_t n) return s; } +#ifndef APPLE_CC void *memset (void *s, int c, grub_size_t n) __attribute__ ((alias ("grub_memset"))); +#endif grub_size_t grub_strlen (const char *s) @@ -1066,8 +1097,11 @@ grub_abort (void) grub_exit (); } + +#ifndef APPLE_CC /* GCC emits references to abort(). */ void abort (void) __attribute__ ((alias ("grub_abort"))); +#endif #ifdef NEED_ENABLE_EXECUTE_STACK /* Some gcc versions generate a call to this function From e93cdc3db12f630eea47d0ffa163c012d1cb6cca Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 21:21:31 +0000 Subject: [PATCH 0798/1707] 2009-06-04 Vladimir Serbinenko Address in trampolines based on 32-bit registers when compiled with Apple's CC * loader/i386/xnu_helper.S [APPLE_CC]: use 32-bit registers for addresses * loader/i386/linux_trampoline.S [APPLE_CC]: likewise --- ChangeLog | 9 +++++++++ loader/i386/linux_trampoline.S | 17 +++++++++++++++++ loader/i386/xnu_helper.S | 19 +++++++++++++++++++ 3 files changed, 45 insertions(+) diff --git a/ChangeLog b/ChangeLog index 03b8f64c8..63ef8c2e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-04 Vladimir Serbinenko + + Address in trampolines based on 32-bit registers when compiled + with Apple's CC + + * loader/i386/xnu_helper.S [APPLE_CC]: use 32-bit registers + for addresses + * loader/i386/linux_trampoline.S [APPLE_CC]: likewise + 2009-06-04 Vladimir Serbinenko Avoid aliases when compiling with Apple's CC for PCBIOS machine diff --git a/loader/i386/linux_trampoline.S b/loader/i386/linux_trampoline.S index eddaaf28f..e2cd6ec27 100644 --- a/loader/i386/linux_trampoline.S +++ b/loader/i386/linux_trampoline.S @@ -30,7 +30,22 @@ VARIABLE(grub_linux_trampoline_start) call base base: pop %rsi + +#ifdef APPLE_CC + lea (cont1 - base) (%esi, 1), %rax + mov %eax, (jump_vector - base) (%esi, 1) + + lea (gdt - base) (%esi, 1), %rax + mov %rax, (gdtaddr - base) (%esi, 1) + /* Switch to compatibility mode. */ + + lidt (idtdesc - base) (%esi, 1) + lgdt (gdtdesc - base) (%esi, 1) + + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ + ljmp *(jump_vector - base) (%esi, 1) +#else lea (cont1 - base) (%rsi, 1), %rax mov %eax, (jump_vector - base) (%rsi, 1) @@ -44,6 +59,8 @@ base: /* Update %cs. Thanks to David Miller for pointing this mistake out. */ ljmp *(jump_vector - base) (%rsi, 1) +#endif + cont1: .code32 diff --git a/loader/i386/xnu_helper.S b/loader/i386/xnu_helper.S index ad9c8f631..229c8fe43 100644 --- a/loader/i386/xnu_helper.S +++ b/loader/i386/xnu_helper.S @@ -94,11 +94,28 @@ VARIABLE(grub_xnu_heap_size) movsl mov %rax, %rsi +#ifdef APPLE_CC + add $(cont0-base), %eax +#else add $(cont0-base), %rax +#endif jmp *%rax cont0: +#ifdef APPLE_CC + lea (cont1 - base) (%esi, 1), %eax + mov %eax, (jump_vector - base) (%esi, 1) + lea (gdt - base) (%esi, 1), %eax + mov %eax, (gdt_addr - base) (%esi, 1) + + /* Switch to compatibility mode. */ + + lgdt (gdtdesc - base) (%esi, 1) + + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ + ljmp *(jump_vector - base) (%esi,1) +#else lea (cont1 - base) (%rsi, 1), %rax mov %eax, (jump_vector - base) (%rsi, 1) @@ -111,6 +128,8 @@ cont0: /* Update %cs. Thanks to David Miller for pointing this mistake out. */ ljmp *(jump_vector - base) (%rsi, 1) +#endif + cont1: .code32 From 9dbf765337c8606a1e07428618beee7d1f559a4c Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 21:25:58 +0000 Subject: [PATCH 0799/1707] 2009-06-04 Vladimir Serbinenko Disable lnxboot.img when compiled with Apple's CC * conf/i386-pc.rmk (pkglib_IMAGES): remove lnxboot.img pkglib_IMAGES [! TARGET_APPLE_CC] (pkglib_IMAGES): add lnxboot.img * boot/i386/pc/lnxboot.S [APPLE_CC]: define an #error [! APPLE_CC] (CODE_LENG): skip [! APPLE_CC] (setup_sects): likewise [! APPLE_CC]: skip filling --- ChangeLog | 12 ++++++++++++ boot/i386/pc/lnxboot.S | 14 ++++++++++++++ conf/i386-pc.rmk | 6 ++++-- 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63ef8c2e5..0c13d6089 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-06-04 Vladimir Serbinenko + + Disable lnxboot.img when compiled + with Apple's CC + + * conf/i386-pc.rmk (pkglib_IMAGES): remove lnxboot.img + pkglib_IMAGES [! TARGET_APPLE_CC] (pkglib_IMAGES): add lnxboot.img + * boot/i386/pc/lnxboot.S [APPLE_CC]: define an #error + [! APPLE_CC] (CODE_LENG): skip + [! APPLE_CC] (setup_sects): likewise + [! APPLE_CC]: skip filling + 2009-06-04 Vladimir Serbinenko Address in trampolines based on 32-bit registers when compiled diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index 0db6826d7..f244feccf 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -24,9 +24,15 @@ #include .file "lnxboot.S" + +#ifdef APPLE_CC +#error Building lnxboot.img with Apple's as results in an unusable image +#endif #define CODE_ADDR 0x6000 +#ifndef APPLE_CC #define CODE_LENG (code_end - start) +#endif #define DATA_ADDR ((GRUB_BOOT_MACHINE_KERNEL_ADDR) + 0x200) #define BLCK_LENG 0x4000 @@ -44,7 +50,12 @@ data_start: . = data_start + 0x1F1 setup_sects: +/* Apple's cc can't fill this value. */ +#ifdef APPLE_CC + .byte 0 +#else .byte (CODE_LENG >> 9) +#endif root_flags: .word 0 syssize: @@ -351,7 +362,10 @@ fail: err_int15_msg: .ascii "move memory fails\0" + /* Unsupported feature in Apple's cc. */ +#ifndef APPLE_CC . = (. & (~0x1FF)) + 0x1FF +#endif .byte 0 diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 066b50625..fe67a8f60 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -10,8 +10,7 @@ COMMON_LDFLAGS = -m32 -nostdlib script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img lnxboot.img \ - cdboot.img +pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img cdboot.img # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S @@ -32,6 +31,9 @@ diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)8000 diskboot_img_FORMAT = binary # For lnxboot.img. +ifeq ($(TARGET_APPLE_CC), 0) +pkglib_IMAGES += lnxboot.img +endif lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)6000 From ede21d714803e5b3fe81152ab715351ac165ed81 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 21:38:17 +0000 Subject: [PATCH 0800/1707] 2009-06-04 Vladimir Serbinenko Definitions for creating asm symbols with Apple's CC * include/grub/symbol.h [APPLE_CC] (FUNCTION): new macro [APPLE_CC] (VARIABLE): likewise --- ChangeLog | 7 +++++++ include/grub/symbol.h | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0c13d6089..6193c812c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-04 Vladimir Serbinenko + + Definitions for creating asm symbols with Apple's CC + + * include/grub/symbol.h [APPLE_CC] (FUNCTION): new macro + [APPLE_CC] (VARIABLE): likewise + 2009-06-04 Vladimir Serbinenko Disable lnxboot.img when compiled diff --git a/include/grub/symbol.h b/include/grub/symbol.h index ef19a739d..68d9f00e9 100644 --- a/include/grub/symbol.h +++ b/include/grub/symbol.h @@ -28,7 +28,10 @@ # define EXT_C(sym) sym #endif -#if ! defined (__CYGWIN__) && ! defined (__MINGW32__) +#if defined (APPLE_CC) +#define FUNCTION(x) .globl EXT_C(x) ; EXT_C(x): +#define VARIABLE(x) .globl EXT_C(x) ; EXT_C(x): +#elif ! defined (__CYGWIN__) && ! defined (__MINGW32__) #define FUNCTION(x) .globl EXT_C(x) ; .type EXT_C(x), "function" ; EXT_C(x): #define VARIABLE(x) .globl EXT_C(x) ; .type EXT_C(x), "object" ; EXT_C(x): #else From 9e7100fb5c4aad872932404117c457fedda0b7ef Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 21:42:58 +0000 Subject: [PATCH 0801/1707] 2009-06-04 Vladimir Serbinenko * include/grub/term.h (GRUB_TERM_BACKSPACE): explicitely define as 8 instead of '\b' --- ChangeLog | 5 +++++ include/grub/term.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6193c812c..2e6fde625 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-04 Vladimir Serbinenko + + * include/grub/term.h (GRUB_TERM_BACKSPACE): explicitely define as 8 + instead of '\b' + 2009-06-04 Vladimir Serbinenko Definitions for creating asm symbols with Apple's CC diff --git a/include/grub/term.h b/include/grub/term.h index d12d0f0d3..3251e36ba 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -31,7 +31,7 @@ #define GRUB_TERM_NPAGE 3 #define GRUB_TERM_ESC '\e' #define GRUB_TERM_TAB '\t' -#define GRUB_TERM_BACKSPACE '\b' +#define GRUB_TERM_BACKSPACE 8 #ifndef ASM_FILE From a9966eb11f5d52431d645d514bbbf4a7bf0cbc81 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 4 Jun 2009 21:45:32 +0000 Subject: [PATCH 0802/1707] 2009-06-04 Vladimir Serbinenko * kern/i386/pc/startup.S [APPLE_CC]: block of nops to compensate a compiler bug --- ChangeLog | 5 +++++ kern/i386/pc/startup.S | 11 +++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2e6fde625..83322bb10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-04 Vladimir Serbinenko + + * kern/i386/pc/startup.S [APPLE_CC]: block of nops to + compensate a compiler bug + 2009-06-04 Vladimir Serbinenko * include/grub/term.h (GRUB_TERM_BACKSPACE): explicitely define as 8 diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 6cdc79a1d..cd323125f 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -1120,6 +1120,17 @@ FUNCTION(grub_get_mmap_entry) xnosmap: xorl %ecx, %ecx +/* Apple's cc jumps few bytes before the correct + label in this context. Hence nops. */ +#ifdef APPLE_CC + nop + nop + nop + nop + nop + nop +#endif + xsmap: DATA32 call real_to_prot .code32 From 8ee1e0d939299c5e50453348a2b0b0b6a21f4196 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 5 Jun 2009 01:28:18 +0000 Subject: [PATCH 0803/1707] 2009-06-05 Vladimir Serbinenko * conf/i386-pc.rmk (efiemu_mod_CFLAGS): remove -Werror -Wall * conf/common.rmk (search_mod_CFLAGS): likewise --- ChangeLog | 5 +++++ conf/common.rmk | 2 +- conf/i386-pc.rmk | 2 +- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83322bb10..60ed1a6b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-05 Vladimir Serbinenko + + * conf/i386-pc.rmk (efiemu_mod_CFLAGS): remove -Werror -Wall + * conf/common.rmk (search_mod_CFLAGS): likewise + 2009-06-04 Vladimir Serbinenko * kern/i386/pc/startup.S [APPLE_CC]: block of nops to diff --git a/conf/common.rmk b/conf/common.rmk index 3e59c3aac..1d0427d94 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -423,7 +423,7 @@ help_mod_LDFLAGS = $(COMMON_LDFLAGS) # For search.mod. search_mod_SOURCES = commands/search.c -search_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +search_mod_CFLAGS = $(COMMON_CFLAGS) search_mod_LDFLAGS = $(COMMON_LDFLAGS) # For test.mod. diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index fe67a8f60..0af07f994 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -203,7 +203,7 @@ efiemu_mod_SOURCES = efiemu/main.c efiemu/i386/loadcore32.c \ efiemu/loadcore32.c efiemu/loadcore64.c \ efiemu/prepare32.c efiemu/prepare64.c efiemu/pnvram.c \ efiemu/i386/coredetect.c -efiemu_mod_CFLAGS = $(COMMON_CFLAGS) -Werror -Wall +efiemu_mod_CFLAGS = $(COMMON_CFLAGS) efiemu_mod_LDFLAGS = $(COMMON_LDFLAGS) # For acpi.mod. From 408305be7a79c948b69f34b2b5ff45924b43b53b Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 5 Jun 2009 21:00:43 +0000 Subject: [PATCH 0804/1707] 2009-06-05 Michael Scherer * fs/hfsplus.c (grub_hfsplus_mount): Determine if the filesystem uses case sensitive btree. (grub_hfsplus_iterate_dir): Use GRUB_FSHELP_CASE_INSENSITIVE only for case insensitive filesystems. --- ChangeLog | 7 +++++++ fs/hfsplus.c | 21 ++++++++++++++++++--- 2 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60ed1a6b3..604a8ba70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-05 Michael Scherer + + * fs/hfsplus.c (grub_hfsplus_mount): Determine if the filesystem + uses case sensitive btree. + (grub_hfsplus_iterate_dir): Use GRUB_FSHELP_CASE_INSENSITIVE + only for case insensitive filesystems. + 2009-06-05 Vladimir Serbinenko * conf/i386-pc.rmk (efiemu_mod_CFLAGS): remove -Werror -Wall diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 69794c9ac..8bcaa3c7d 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -99,6 +99,13 @@ struct grub_hfsplus_btheader grub_uint32_t last_leaf_node; grub_uint16_t nodesize; grub_uint16_t keysize; + grub_uint32_t total_nodes; + grub_uint32_t free_nodes; + grub_uint16_t reserved1; + grub_uint32_t clump_size; /* ignored */ + grub_uint8_t btree_type; + grub_uint8_t key_compare; + grub_uint32_t attributes; } __attribute__ ((packed)); /* The on disk layout of a catalog key. */ @@ -164,6 +171,9 @@ enum grub_hfsplus_filetype GRUB_HFSPLUS_FILETYPE_REG_THREAD = 4 }; +#define GRUB_HFSPLUSX_BINARYCOMPARE 0xBC +#define GRUB_HFSPLUSX_CASEFOLDING 0xCF + /* Internal representation of a catalog key. */ struct grub_hfsplus_catkey_internal { @@ -224,6 +234,7 @@ struct grub_hfsplus_data /* This is the offset into the physical disk for an embedded HFS+ filesystem (one inside a plain HFS wrapper). */ int embedded_offset; + int case_sensitive; }; static grub_dl_t my_mod; @@ -376,6 +387,7 @@ grub_hfsplus_mount (grub_disk_t disk) struct grub_hfsplus_data *data; struct grub_hfsplus_btheader header; struct grub_hfsplus_btnode node; + grub_uint16_t magic; union { struct grub_hfs_sblock hfs; struct grub_hfsplus_volheader hfsplus; @@ -423,8 +435,8 @@ grub_hfsplus_mount (grub_disk_t disk) /* Make sure this is an HFS+ filesystem. XXX: Do we really support HFX? */ - if ((grub_be_to_cpu16 (volheader.hfsplus.magic) != GRUB_HFSPLUS_MAGIC) - && (grub_be_to_cpu16 (volheader.hfsplus.magic) != GRUB_HFSPLUSX_MAGIC)) + magic = grub_be_to_cpu16 (volheader.hfsplus.magic); + if ((magic != GRUB_HFSPLUS_MAGIC) && (magic != GRUB_HFSPLUSX_MAGIC)) { grub_error (GRUB_ERR_BAD_FS, "not a HFS+ filesystem"); goto fail; @@ -464,6 +476,8 @@ grub_hfsplus_mount (grub_disk_t disk) data->catalog_tree.root = grub_be_to_cpu32 (header.root); data->catalog_tree.nodesize = grub_be_to_cpu16 (header.nodesize); + data->case_sensitive = ((magic == GRUB_HFSPLUSX_MAGIC) && + (header.key_compare == GRUB_HFSPLUSX_BINARYCOMPARE)); if (! grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, sizeof (struct grub_hfsplus_btnode), @@ -772,7 +786,8 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, catkey->name[i] = grub_be_to_cpu16 (catkey->name[i]); /* hfs+ is case insensitive. */ - type |= GRUB_FSHELP_CASE_INSENSITIVE; + if (! dir->data->case_sensitive) + type |= GRUB_FSHELP_CASE_INSENSITIVE; /* Only accept valid nodes. */ if (grub_strlen (filename) == grub_be_to_cpu16 (catkey->namelen)) From c8048e32d6adf830610ae75a12c011d5ec669ff5 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 5 Jun 2009 21:22:14 +0000 Subject: [PATCH 0805/1707] 2009-06-05 Colin D Bennett Optimized font character lookup using binary search instead of linear search. Fonts now are required to have the character index ordered by code point. * font/font.c (load_font_index): Verify that fonts have ordered character indices. (find_glyph): Use binary search instead of linear search to find a character in a font. --- ChangeLog | 11 +++++++++++ font/font.c | 38 +++++++++++++++++++++++++++++++------- 2 files changed, 42 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 604a8ba70..c7f7c068d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-06-05 Colin D Bennett + + Optimized font character lookup using binary search instead of linear + search. Fonts now are required to have the character index ordered by + code point. + + * font/font.c (load_font_index): Verify that fonts have ordered + character indices. + (find_glyph): Use binary search instead of linear search to find a + character in a font. + 2009-06-05 Michael Scherer * fs/hfsplus.c (grub_hfsplus_mount): Determine if the filesystem diff --git a/font/font.c b/font/font.c index 39d61126e..9d788a9f8 100644 --- a/font/font.c +++ b/font/font.c @@ -249,6 +249,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct grub_font *font) { unsigned i; + grub_uint32_t last_code; #if FONT_DEBUG >= 2 grub_printf("load_font_index(sect_length=%d)\n", sect_length); @@ -277,6 +278,8 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct grub_printf("num_chars=%d)\n", font->num_chars); #endif + last_code = 0; + /* Load the character index data from the file. */ for (i = 0; i < font->num_chars; i++) { @@ -287,6 +290,17 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct return 1; entry->code = grub_be_to_cpu32 (entry->code); + /* Verify that characters are in ascending order. */ + if (i != 0 && entry->code <= last_code) + { + grub_error (GRUB_ERR_BAD_FONT, + "Font characters not in ascending order: %u <= %u", + entry->code, last_code); + return 1; + } + + last_code = entry->code; + /* Read storage flags byte. */ if (grub_file_read (file, (char *) &entry->storage_flags, 1) != 1) return 1; @@ -583,15 +597,25 @@ read_be_int16 (grub_file_t file, grub_int16_t * value) static struct char_index_entry * find_glyph (const grub_font_t font, grub_uint32_t code) { - grub_uint32_t i; - grub_uint32_t len = font->num_chars; - struct char_index_entry *table = font->char_index; + struct char_index_entry *table; + grub_size_t lo; + grub_size_t hi; + grub_size_t mid; - /* Do a linear search. */ - for (i = 0; i < len; i++) + /* Do a binary search in `char_index', which is ordered by code point. */ + table = font->char_index; + lo = 0; + hi = font->num_chars - 1; + + while (lo <= hi) { - if (table[i].code == code) - return &table[i]; + mid = lo + (hi - lo) / 2; + if (code < table[mid].code) + hi = mid - 1; + else if (code > table[mid].code) + lo = mid + 1; + else + return &table[mid]; } return 0; From ba5a0d059bf13e742aecabefb268d0d7f302643e Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 8 Jun 2009 07:32:14 +0000 Subject: [PATCH 0806/1707] 2009-06-08 Felix Zielcke * commands/true.c: New file. Implement the true and false commands. * conf/common.rmk.c (pkglib_MODULES): Add `true.mod'. (true_mod_SOURCES): New variable. (true_mod_CFLAGS): Likewise. (true_mod_LDFLAGS): Likewise. --- ChangeLog | 8 +++++++ commands/true.c | 56 +++++++++++++++++++++++++++++++++++++++++++++++++ conf/common.rmk | 7 ++++++- 3 files changed, 70 insertions(+), 1 deletion(-) create mode 100644 commands/true.c diff --git a/ChangeLog b/ChangeLog index c7f7c068d..cb6fe3f2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-06-08 Felix Zielcke + + * commands/true.c: New file. Implement the true and false commands. + * conf/common.rmk.c (pkglib_MODULES): Add `true.mod'. + (true_mod_SOURCES): New variable. + (true_mod_CFLAGS): Likewise. + (true_mod_LDFLAGS): Likewise. + 2009-06-05 Colin D Bennett Optimized font character lookup using binary search instead of linear diff --git a/commands/true.c b/commands/true.c new file mode 100644 index 000000000..16ca31579 --- /dev/null +++ b/commands/true.c @@ -0,0 +1,56 @@ +/* true.c - true and false commands. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +static grub_err_t +grub_cmd_true (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + return 0; +} + +static grub_err_t +grub_cmd_false (struct grub_command *cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char *argv[] __attribute__ ((unused))) +{ + return grub_error (GRUB_ERR_TEST_FAILURE, "false"); +} + +static grub_command_t cmd_true, cmd_false; + + +GRUB_MOD_INIT(true) +{ + cmd_true = + grub_register_command ("true", grub_cmd_true, + 0, "do nothing, successfully"); + cmd_false = + grub_register_command ("false", grub_cmd_false, + 0, "do nothing, unsuccessfully"); +} + +GRUB_MOD_FINI(true) +{ + grub_unregister_command (cmd_true); + grub_unregister_command (cmd_false); +} diff --git a/conf/common.rmk b/conf/common.rmk index 1d0427d94..978034161 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -354,7 +354,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ pcpart.mod memrw.mod boot.mod normal.mod sh.mod lua.mod \ - gptsync.mod + gptsync.mod true.mod # For gptsync.mod. gptsync_mod_SOURCES = commands/gptsync.c @@ -486,6 +486,11 @@ memrw_mod_SOURCES = commands/memrw.c memrw_mod_CFLAGS = $(COMMON_CFLAGS) memrw_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For true.mod +true_mod_SOURCES = commands/true.c +true_mod_CFLAGS = $(COMMON_CFLAGS) +true_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For normal.mod. normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \ normal/autofs.c normal/handler.c \ From e76fc9241995b17c033d58598947b219cf3582cc Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 8 Jun 2009 12:16:58 +0000 Subject: [PATCH 0807/1707] 2009-06-08 Felix Zielcke * Makefile.in (uninstall): Remove all $include_DATA files. --- ChangeLog | 4 ++++ Makefile.in | 7 +++++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index cb6fe3f2a..ddc838998 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-08 Felix Zielcke + + * Makefile.in (uninstall): Remove all $include_DATA files. + 2009-06-08 Felix Zielcke * commands/true.c: New file. Implement the true and false commands. diff --git a/Makefile.in b/Makefile.in index da2ec4803..0be40f57e 100644 --- a/Makefile.in +++ b/Makefile.in @@ -310,6 +310,13 @@ uninstall: dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ rm -f $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ done + @list='$(include_DATA)'; \ + for file in $$list; do \ + echo $$file; \ + dest="`echo $$file | sed 's,include/,,'`"; \ + echo $$dest; \ + rm -f $(DESTDIR)$(includedir)/$$dest; \ + done clean: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) From dd1a6caefa2b2a2529439d5557e9c8325a028f39 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 8 Jun 2009 12:45:04 +0000 Subject: [PATCH 0808/1707] remove 2 echo's accidentally introduced in previous commit --- Makefile.in | 2 -- 1 file changed, 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 0be40f57e..2a4f38615 100644 --- a/Makefile.in +++ b/Makefile.in @@ -312,9 +312,7 @@ uninstall: done @list='$(include_DATA)'; \ for file in $$list; do \ - echo $$file; \ dest="`echo $$file | sed 's,include/,,'`"; \ - echo $$dest; \ rm -f $(DESTDIR)$(includedir)/$$dest; \ done From 4c9ec6b3fcf61dd7152cadaeb6ee3e1f35a13a12 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 8 Jun 2009 13:04:02 +0000 Subject: [PATCH 0809/1707] 2009-06-08 Vladimir Serbinenko Bugfix: install on partitionless device * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): check if os_dev is a whole disk --- ChangeLog | 7 +++++++ util/hostdisk.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index ddc838998..2d90923e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-08 Vladimir Serbinenko + + Bugfix: install on partitionless device + + * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): check if os_dev + is a whole disk + 2009-06-08 Felix Zielcke * Makefile.in (uninstall): Remove all $include_DATA files. diff --git a/util/hostdisk.c b/util/hostdisk.c index eaccb73dc..a7262dd8f 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -883,6 +883,10 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) "no mapping exists for `%s'", os_dev); return 0; } + + if (grub_strcmp (os_dev, convert_system_partition_to_system_disk (os_dev)) + == 0) + return make_device_name (drive, -1, -1); #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (! S_ISCHR (st.st_mode)) From af3612634da3cb692c0b9be9b86921dcecd11fe8 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 8 Jun 2009 13:11:58 +0000 Subject: [PATCH 0810/1707] 2009-06-08 Felix Zielcke * Makefile.in (uninstall): Remove all $lib_DATA files. --- ChangeLog | 4 ++++ Makefile.in | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2d90923e8..92dd90c90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-08 Felix Zielcke + + * Makefile.in (uninstall): Remove all $lib_DATA files. + 2009-06-08 Vladimir Serbinenko Bugfix: install on partitionless device diff --git a/Makefile.in b/Makefile.in index 2a4f38615..5a4965a84 100644 --- a/Makefile.in +++ b/Makefile.in @@ -315,6 +315,12 @@ uninstall: dest="`echo $$file | sed 's,include/,,'`"; \ rm -f $(DESTDIR)$(includedir)/$$dest; \ done + @list='$(lib_DATA)'; \ + for file in $$list; do \ + dest="`echo $$file | sed 's,.*/,,'`"; \ + echo rm -f $(DESTDIR)$(libdir)/$$dest; \ + rm -f $(DESTDIR)$(libdir)/grub/$$dest; \ + done clean: -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) From b57ea2c975d52aa19201642d3c008abf2f0556ff Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 8 Jun 2009 13:25:54 +0000 Subject: [PATCH 0811/1707] 2009-06-08 Pavel Roskin * fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning about aliasing. --- ChangeLog | 5 +++++ fs/hfs.c | 17 ++++++++++------- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 92dd90c90..b9ef1ba40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-08 Pavel Roskin + + * fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning + about aliasing. + 2009-06-08 Felix Zielcke * Makefile.in (uninstall): Remove all $lib_DATA files. diff --git a/fs/hfs.c b/fs/hfs.c index fe5d2694f..e8821e092 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -872,9 +872,12 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, int inode = data->rootdir; char *next; char *origpath; - struct grub_hfs_filerec frec; - struct grub_hfs_dirrec *dir = (struct grub_hfs_dirrec *) &frec; - frec.type = GRUB_HFS_FILETYPE_DIR; + union { + struct grub_hfs_filerec frec; + struct grub_hfs_dirrec dir; + } fdrec; + + fdrec.frec.type = GRUB_HFS_FILETYPE_DIR; if (path[0] != '/') { @@ -892,7 +895,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, while (path && grub_strlen (path)) { - if (frec.type != GRUB_HFS_FILETYPE_DIR) + if (fdrec.frec.type != GRUB_HFS_FILETYPE_DIR) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); goto fail; @@ -914,7 +917,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, /* Lookup this node. */ if (! grub_hfs_find_node (data, (char *) &key, data->cat_root, - 0, (char *) &frec, sizeof (frec))) + 0, (char *) &fdrec.frec, sizeof (fdrec.frec))) { grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); goto fail; @@ -923,12 +926,12 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, if (grub_errno) goto fail; - inode = grub_be_to_cpu32 (dir->dirid); + inode = grub_be_to_cpu32 (fdrec.dir.dirid); path = next; } if (retdata) - grub_memcpy (retdata, &frec, sizeof (frec)); + grub_memcpy (retdata, &fdrec.frec, sizeof (fdrec.frec)); if (retinode) *retinode = inode; From de65ee2b2c9ba22b5b89a643ecf6299a0e0016f2 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 8 Jun 2009 13:29:05 +0000 Subject: [PATCH 0812/1707] 2009-06-08 Vladimir Serbinenko Not fail if unable to retrieve C/H/S on LBA disks * disk/i386/pc/biosdisk.c (grub_biosdisk_open): behave gracefully if unable to retrieve C/H/S on LBA disks --- ChangeLog | 7 +++++++ disk/i386/pc/biosdisk.c | 16 ++++++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9ef1ba40..6eb19f8a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-08 Vladimir Serbinenko + + Not fail if unable to retrieve C/H/S on LBA disks + + * disk/i386/pc/biosdisk.c (grub_biosdisk_open): behave gracefully + if unable to retrieve C/H/S on LBA disks + 2009-06-08 Pavel Roskin * fs/hfs.c (grub_hfs_find_dir): Use union to avoid a warning diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index ba1eb77b8..f9663305a 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -158,8 +158,20 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) &data->heads, &data->sectors) != 0) { - grub_free (data); - return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get C/H/S values"); + if (total_sectors && (data->flags & GRUB_BIOSDISK_FLAG_LBA)) + { + data->sectors = 63; + data->heads = 255; + data->cylinders + = grub_divmod64 (total_sectors + + data->heads * data->sectors - 1, + data->heads * data->sectors, 0); + } + else + { + grub_free (data); + return grub_error (GRUB_ERR_BAD_DEVICE, "cannot get C/H/S values"); + } } if (! total_sectors) From 9e172e3066599484eb7d8e0b13f25ef4f3388c51 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 8 Jun 2009 16:12:58 +0000 Subject: [PATCH 0813/1707] 2009-06-08 Robert Millan * loader/i386/linux.c (grub_cmd_linux): When processing `vga=', use as fallback an equivalent option without depth. --- ChangeLog | 5 +++++ loader/i386/linux.c | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6eb19f8a4..4ccdefe03 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-08 Robert Millan + + * loader/i386/linux.c (grub_cmd_linux): When processing `vga=', use + as fallback an equivalent option without depth. + 2009-06-08 Vladimir Serbinenko Not fail if unable to retrieve C/H/S on LBA disks diff --git a/loader/i386/linux.c b/loader/i386/linux.c index e3726ec81..3b1f2f08d 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -761,17 +761,19 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), break; } - buf = grub_malloc (20); + buf = grub_malloc (sizeof ("WWWWxHHHHxDD;WWWWxHHHH")); if (! buf) goto fail; linux_mode = &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START]; - grub_sprintf (buf, "%dx%dx%d", + grub_sprintf (buf, "%ux%ux%u;%ux%u", linux_vesafb_res[linux_mode->res_index].width, linux_vesafb_res[linux_mode->res_index].height, - linux_mode->depth); + linux_mode->depth, + linux_vesafb_res[linux_mode->res_index].width, + linux_vesafb_res[linux_mode->res_index].height); grub_printf ("%s is deprecated. " "Use set gfxpayload=%s before " "linux command instead.\n", From 69da88778866f94d246094ac646a0e007cb6891e Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 8 Jun 2009 20:08:59 +0000 Subject: [PATCH 0814/1707] 2009-06-08 Oliver Henshaw * bus/usb/uhci.c: Remove unneeded doubled lines. * bus/usb/ohci.c: Likewise. Change interf to grub_uint32_t. Remove whitespace inside comment. --- ChangeLog | 6 ++++++ bus/usb/ohci.c | 7 ++----- bus/usb/uhci.c | 2 -- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4ccdefe03..fb44b35c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-08 Oliver Henshaw + + * bus/usb/uhci.c: Remove unneeded doubled lines. + * bus/usb/ohci.c: Likewise. Change interf to grub_uint32_t. + Remove whitespace inside comment. + 2009-06-08 Robert Millan * loader/i386/linux.c (grub_cmd_linux): When processing `vga=', use diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index 6ffa84bc0..55df96ea2 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -118,15 +118,13 @@ grub_ohci_pci_iter (int bus, int device, int func, { grub_uint32_t class; grub_uint32_t subclass; - int interf; + grub_uint32_t interf; grub_uint32_t base; grub_pci_address_t addr; struct grub_ohci *o; grub_uint32_t revision; grub_uint32_t frame_interval; - addr = grub_pci_make_address (bus, device, func, 2); - class = grub_pci_read (addr); addr = grub_pci_make_address (bus, device, func, 2); class = grub_pci_read (addr); @@ -171,8 +169,7 @@ grub_ohci_pci_iter (int bus, int device, int func, frame_interval = grub_ohci_readreg32 (o, GRUB_OHCI_REG_FRAME_INTERVAL); /* Suspend the OHCI by issuing a reset. */ - grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1); /* XXX: Magic. - */ + grub_ohci_writereg32 (o, GRUB_OHCI_REG_CMDSTATUS, 1); /* XXX: Magic. */ grub_millisleep (1); grub_dprintf ("ohci", "OHCI reset\n"); diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index 090934998..b9d63eba7 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -149,8 +149,6 @@ grub_uhci_pci_iter (int bus, int device, int func, struct grub_uhci *u; int i; - addr = grub_pci_make_address (bus, device, func, 2); - class = grub_pci_read (addr); addr = grub_pci_make_address (bus, device, func, 2); class = grub_pci_read (addr); From c0947beba630fd39fff617bbe06671d7659ac75a Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 8 Jun 2009 20:10:27 +0000 Subject: [PATCH 0815/1707] 2009-06-08 Oliver Henshaw * bus/usb/ohci.c: Set interf with correct field. --- ChangeLog | 2 ++ bus/usb/ohci.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fb44b35c6..c6a355f1f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-06-08 Oliver Henshaw + * bus/usb/ohci.c: Set interf with correct field. + * bus/usb/uhci.c: Remove unneeded doubled lines. * bus/usb/ohci.c: Likewise. Change interf to grub_uint32_t. Remove whitespace inside comment. diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index 55df96ea2..180f4dd41 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -128,7 +128,7 @@ grub_ohci_pci_iter (int bus, int device, int func, addr = grub_pci_make_address (bus, device, func, 2); class = grub_pci_read (addr); - interf = class & 0xFF; + interf = (class >> 8) & 0xFF; subclass = (class >> 16) & 0xFF; class >>= 24; From fa5db0b1207973040342f0fa9f4f69172388f05a Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 8 Jun 2009 20:20:13 +0000 Subject: [PATCH 0816/1707] 2009-06-08 Oliver Henshaw * bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming interface is OHCI. Add grub_dprintf for symmetry with bus/usb/uhci.c. * bus/usb/uhci.c (grub_uhci_pci_iter): Check that programming interface is UHCI. Add interf variable for programming interface. Print interface with class/subclass. --- ChangeLog | 7 +++++++ bus/usb/ohci.c | 5 ++++- bus/usb/uhci.c | 8 +++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index c6a355f1f..8ddd746bd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-06-08 Oliver Henshaw + * bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming + interface is OHCI. Add grub_dprintf for symmetry with + bus/usb/uhci.c. + * bus/usb/uhci.c (grub_uhci_pci_iter): Check that programming + interface is UHCI. Add interf variable for programming + interface. Print interface with class/subclass. + * bus/usb/ohci.c: Set interf with correct field. * bus/usb/uhci.c: Remove unneeded doubled lines. diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index 180f4dd41..146862bde 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -133,7 +133,7 @@ grub_ohci_pci_iter (int bus, int device, int func, class >>= 24; /* If this is not an OHCI controller, just return. */ - if (class != 0x0c || subclass != 0x03) + if (class != 0x0c || subclass != 0x03 || interf != 0x10) return 0; /* Determine IO base address. */ @@ -159,6 +159,9 @@ grub_ohci_pci_iter (int bus, int device, int func, /* Reserve memory for the HCCA. */ o->hcca = (struct grub_ohci_hcca *) grub_memalign (256, 256); + grub_dprintf ("ohci", "class=0x%02x 0x%02x interface 0x%02x base=%p\n", + class, subclass, interf, o->iobase); + /* Check if the OHCI revision is actually 1.0 as supported. */ revision = grub_ohci_readreg32 (o, GRUB_OHCI_REG_REVISION); grub_dprintf ("ohci", "OHCI revision=0x%02x\n", revision & 0xFF); diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index b9d63eba7..f59d26b43 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -143,6 +143,7 @@ grub_uhci_pci_iter (int bus, int device, int func, { grub_uint32_t class; grub_uint32_t subclass; + grub_uint32_t interf; grub_uint32_t base; grub_uint32_t fp; grub_pci_address_t addr; @@ -152,11 +153,12 @@ grub_uhci_pci_iter (int bus, int device, int func, addr = grub_pci_make_address (bus, device, func, 2); class = grub_pci_read (addr); + interf = (class >> 8) & 0xFF; subclass = (class >> 16) & 0xFF; class >>= 24; /* If this is not an UHCI controller, just return. */ - if (class != 0x0c || subclass != 0x03) + if (class != 0x0c || subclass != 0x03 || interf != 0x00) return 0; /* Determine IO base address. */ @@ -177,8 +179,8 @@ grub_uhci_pci_iter (int bus, int device, int func, u->framelist = 0; u->qh = 0; u->td = 0; - grub_dprintf ("uhci", "class=0x%02x 0x%02x base=0x%x\n", - class, subclass, u->iobase); + grub_dprintf ("uhci", "class=0x%02x 0x%02x interface 0x%02x base=0x%x\n", + class, subclass, interf, u->iobase); /* Reserve a page for the frame list. */ u->framelist = grub_memalign (4096, 4096); From d55842d81e7ecfdf7f200b1671ad2ae173fe847d Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 8 Jun 2009 20:23:09 +0000 Subject: [PATCH 0817/1707] 2009-06-08 Oliver Henshaw * bus/usb/ohci.c (grub_ohci_pci_iter): Define the Class, Subclass and Programming Interface fields in terms of the 3 byte Class Code register. * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. --- ChangeLog | 5 +++++ bus/usb/ohci.c | 9 +++++---- bus/usb/uhci.c | 9 +++++---- 3 files changed, 15 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ddd746bd..4f0fbb587 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-08 Oliver Henshaw + * bus/usb/ohci.c (grub_ohci_pci_iter): Define the Class, + Subclass and Programming Interface fields in terms of the 3 byte + Class Code register. + * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + * bus/usb/ohci.c (grub_ohci_pci_iter): Check that programming interface is OHCI. Add grub_dprintf for symmetry with bus/usb/uhci.c. diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index 146862bde..ce7ea6efd 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -116,6 +116,7 @@ static int NESTED_FUNC_ATTR grub_ohci_pci_iter (int bus, int device, int func, grub_pci_id_t pciid __attribute__((unused))) { + grub_uint32_t class_code; grub_uint32_t class; grub_uint32_t subclass; grub_uint32_t interf; @@ -126,11 +127,11 @@ grub_ohci_pci_iter (int bus, int device, int func, grub_uint32_t frame_interval; addr = grub_pci_make_address (bus, device, func, 2); - class = grub_pci_read (addr); + class_code = grub_pci_read (addr) >> 8; - interf = (class >> 8) & 0xFF; - subclass = (class >> 16) & 0xFF; - class >>= 24; + interf = class_code & 0xFF; + subclass = (class_code >> 8) & 0xFF; + class = class_code >> 16; /* If this is not an OHCI controller, just return. */ if (class != 0x0c || subclass != 0x03 || interf != 0x10) diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index f59d26b43..a0836f805 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -141,6 +141,7 @@ static int NESTED_FUNC_ATTR grub_uhci_pci_iter (int bus, int device, int func, grub_pci_id_t pciid __attribute__((unused))) { + grub_uint32_t class_code; grub_uint32_t class; grub_uint32_t subclass; grub_uint32_t interf; @@ -151,11 +152,11 @@ grub_uhci_pci_iter (int bus, int device, int func, int i; addr = grub_pci_make_address (bus, device, func, 2); - class = grub_pci_read (addr); + class_code = grub_pci_read (addr) >> 8; - interf = (class >> 8) & 0xFF; - subclass = (class >> 16) & 0xFF; - class >>= 24; + interf = class_code & 0xFF; + subclass = (class_code >> 8) & 0xFF; + class = class_code >> 16; /* If this is not an UHCI controller, just return. */ if (class != 0x0c || subclass != 0x03 || interf != 0x00) From 255a27d434b9d30189bc07e20f596cd5da1547e9 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 8 Jun 2009 20:51:16 +0000 Subject: [PATCH 0818/1707] 2009-06-08 Felix Zielcke * util/i386/pc/grub-install.in: Add a parameter --disk-module to choose between ata and biosdisk module on i386-pc. --- ChangeLog | 5 +++++ util/i386/pc/grub-install.in | 29 +++++++++++++++++++++-------- 2 files changed, 26 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f0fbb587..bb9415004 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-08 Felix Zielcke + + * util/i386/pc/grub-install.in: Add a parameter --disk-module + to choose between ata and biosdisk module on i386-pc. + 2009-06-08 Oliver Henshaw * bus/usb/ohci.c (grub_ohci_pci_iter): Define the Class, diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 468a72e08..5f6e55676 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -49,6 +49,12 @@ force_lba= recheck=no debug=no +if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then + disk_module=biosdisk +else + disk_module=ata +fi + # Usage: usage # Print the usage. usage () { @@ -68,6 +74,13 @@ Install GRUB on your drive. --no-floppy do not probe any floppy drive --recheck probe a device map even if it already exists --force install even if problems are detected +EOF +if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then + cat < /dev/nul devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` # The order in this list is critical. Be careful when modifying it. -if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then - modules="$modules biosdisk" -else - modules="$modules ata" -fi +modules="$modules $disk_module" modules="$modules $fs_module $partmap_module $devabstraction_module" prefix_drive= @@ -269,11 +282,11 @@ if [ "x${devabstraction_module}" = "x" ] ; then # Strip partition number install_drive="`echo ${install_drive} | sed -e s/,[0-9]*[a-z]*//g`" grub_drive="`echo ${grub_drive} | sed -e s/,[0-9]*[a-z]*//g`" - if [ "${target_cpu}-${platform}" != "i386-pc" ] ; then - # generic method (used on coreboot) + if [ "$disk_module" = ata ] ; then + # generic method (used on coreboot and ata mod) uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" if [ "x${uuid}" = "x" ] ; then - echo "UUID needed on this platform, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + echo "UUID needed on this platform and with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 exit 1 fi prefix_drive="(UUID=${uuid})" From e23721e8aff16d2152315c7660d0ef57b2eec5b5 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 8 Jun 2009 23:56:06 +0000 Subject: [PATCH 0819/1707] 2009-06-09 Oliver Henshaw * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after initialising controller. * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. --- ChangeLog | 6 ++++++ bus/usb/ohci.c | 7 ++++--- bus/usb/uhci.c | 6 ++++-- 3 files changed, 14 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bb9415004..34c5bc18f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-09 Oliver Henshaw + + * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after + initialising controller. + * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + 2009-06-08 Felix Zielcke * util/i386/pc/grub-install.in: Add a parameter --disk-module diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index ce7ea6efd..53356dc69 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -152,9 +152,6 @@ grub_ohci_pci_iter (int bus, int device, int func, if (! o) return 1; - /* Link in the OHCI. */ - o->next = ohci; - ohci = o; o->iobase = (grub_uint32_t *) base; /* Reserve memory for the HCCA. */ @@ -190,6 +187,10 @@ grub_ohci_pci_iter (int bus, int device, int func, grub_dprintf ("ohci", "OHCI enable: 0x%02x\n", (grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) >> 6) & 3); + /* Link to ohci now that initialisation is successful. */ + o->next = ohci; + ohci = o; + return 0; fail: diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index a0836f805..1c7b8d965 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -174,8 +174,6 @@ grub_uhci_pci_iter (int bus, int device, int func, if (! u) return 1; - u->next = uhci; - uhci = u; u->iobase = base & GRUB_UHCI_IOMASK; u->framelist = 0; u->qh = 0; @@ -288,6 +286,10 @@ grub_uhci_pci_iter (int bus, int device, int func, } #endif + /* Link to uhci now that initialisation is successful. */ + u->next = uhci; + uhci = u; + return 0; fail: From 8ec4a6d0e050f99053c2d0236f6cb5daa1a2d79b Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 9 Jun 2009 13:22:31 +0000 Subject: [PATCH 0820/1707] 2009-06-09 Felix Zielcke * util/i386/pc/grub-install.in: Change the error message if UUIDs aren't avaible if ata.mod gets used. --- ChangeLog | 9 +++++++-- util/i386/pc/grub-install.in | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 34c5bc18f..5262635b5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,13 @@ +2009-06-09 Felix Zielcke + + * util/i386/pc/grub-install.in: Change the error message if UUIDs + aren't avaible if ata.mod gets used. + 2009-06-09 Oliver Henshaw - * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after + * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after initialising controller. - * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. 2009-06-08 Felix Zielcke diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 5f6e55676..5c3ffcdde 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -286,7 +286,7 @@ if [ "x${devabstraction_module}" = "x" ] ; then # generic method (used on coreboot and ata mod) uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" if [ "x${uuid}" = "x" ] ; then - echo "UUID needed on this platform and with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 + echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 exit 1 fi prefix_drive="(UUID=${uuid})" From 87b8f28cc11723a8a2b1210bb0b16ab0ff9e918f Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 9 Jun 2009 14:42:37 +0000 Subject: [PATCH 0821/1707] 2009-06-09 Robert Millan * util/deviceiter.c (grub_util_iterate_devices): Increase number of disk limit to 26 for IDE, Virtio, Xen and SCSI. --- ChangeLog | 5 +++++ util/deviceiter.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5262635b5..64328ce90 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-09 Robert Millan + + * util/deviceiter.c (grub_util_iterate_devices): Increase number of + disk limit to 26 for IDE, Virtio, Xen and SCSI. + 2009-06-09 Felix Zielcke * util/i386/pc/grub-install.in: Change the error message if UUIDs diff --git a/util/deviceiter.c b/util/deviceiter.c index b78b6a0d9..6443afa5e 100644 --- a/util/deviceiter.c +++ b/util/deviceiter.c @@ -454,7 +454,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), #endif /* __linux__ */ /* IDE disks. */ - for (i = 0; i < 20; i++) + for (i = 0; i < 26; i++) { char name[16]; @@ -468,7 +468,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), #ifdef __linux__ /* Virtio disks. */ - for (i = 0; i < 20; i++) + for (i = 0; i < 26; i++) { char name[16]; @@ -494,7 +494,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), } /* Xen virtual block devices. */ - for (i = 0; i < 16; i++) + for (i = 0; i < 26; i++) { char name[16]; @@ -508,7 +508,7 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), #endif /* __linux__ */ /* The rest is SCSI disks. */ - for (i = 0; i < 16; i++) + for (i = 0; i < 26; i++) { char name[16]; From afd22553a6a096e2bcf49c836730c9e13d0e8b08 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 9 Jun 2009 19:08:36 +0000 Subject: [PATCH 0822/1707] 2009-06-09 Michel Hermier * fs/i386/pc/pxe.c (grub_pxefs_read): Fix returned values. --- ChangeLog | 14 ++++---------- fs/i386/pc/pxe.c | 12 +++++++++--- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64328ce90..a84ef433f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,18 +1,12 @@ -2009-06-09 Robert Millan +2009-06-09 Michel Hermier - * util/deviceiter.c (grub_util_iterate_devices): Increase number of - disk limit to 26 for IDE, Virtio, Xen and SCSI. - -2009-06-09 Felix Zielcke - - * util/i386/pc/grub-install.in: Change the error message if UUIDs - aren't avaible if ata.mod gets used. + * fs/i386/pc/pxe.c (grub_pxefs_read): Fix returned values. 2009-06-09 Oliver Henshaw - * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after + * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after initialising controller. - * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. 2009-06-08 Felix Zielcke diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index 9676be42c..1fc5680cf 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -189,8 +189,11 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) pn = grub_divmod64 (file->offset, data->block_size, &r); if (r) - return grub_error (GRUB_ERR_BAD_FS, - "read access must be aligned to packet size"); + { + grub_error (GRUB_ERR_BAD_FS, + "read access must be aligned to packet size"); + return -1; + } if ((curr_file != file) || (data->packet_number > pn)) { @@ -206,7 +209,10 @@ grub_pxefs_read (grub_file_t file, char *buf, grub_size_t len) o.packet_size = data->block_size; grub_pxe_call (GRUB_PXENV_TFTP_OPEN, &o); if (o.status) - return grub_error (GRUB_ERR_BAD_FS, "open fails"); + { + grub_error (GRUB_ERR_BAD_FS, "open fails"); + return -1; + } data->packet_number = 0; curr_file = file; } From 6b787c4fc44190145f1132255ad29026a6494175 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 9 Jun 2009 19:14:21 +0000 Subject: [PATCH 0823/1707] Put back lost ChangeLog entries --- ChangeLog | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index a84ef433f..3eb4bfda3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,16 @@ * fs/i386/pc/pxe.c (grub_pxefs_read): Fix returned values. +2009-06-09 Robert Millan + + * util/deviceiter.c (grub_util_iterate_devices): Increase number of + disk limit to 26 for IDE, Virtio, Xen and SCSI. + +2009-06-09 Felix Zielcke + + * util/i386/pc/grub-install.in: Change the error message if UUIDs + aren't avaible if ata.mod gets used. + 2009-06-09 Oliver Henshaw * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after From 473d1e458b6427ec9853c30ed636663efb9eed58 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 9 Jun 2009 19:45:18 +0000 Subject: [PATCH 0824/1707] Fix typos, spacing --- ChangeLog | 78 +++++++++++++++++++++++++++---------------------------- 1 file changed, 39 insertions(+), 39 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3eb4bfda3..fb215605f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -10,20 +10,20 @@ 2009-06-09 Felix Zielcke * util/i386/pc/grub-install.in: Change the error message if UUIDs - aren't avaible if ata.mod gets used. + aren't available if ata.mod gets used. -2009-06-09 Oliver Henshaw +2009-06-09 Oliver Henshaw - * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after + * bus/usb/ohci.c (grub_ohci_pci_iter): Link struct only after initialising controller. - * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. + * bus/usb/uhci.c (grub_uhci_pci_iter): Likewise. 2009-06-08 Felix Zielcke * util/i386/pc/grub-install.in: Add a parameter --disk-module to choose between ata and biosdisk module on i386-pc. -2009-06-08 Oliver Henshaw +2009-06-08 Oliver Henshaw * bus/usb/ohci.c (grub_ohci_pci_iter): Define the Class, Subclass and Programming Interface fields in terms of the 3 byte @@ -52,7 +52,7 @@ Not fail if unable to retrieve C/H/S on LBA disks - * disk/i386/pc/biosdisk.c (grub_biosdisk_open): behave gracefully + * disk/i386/pc/biosdisk.c (grub_biosdisk_open): behave gracefully if unable to retrieve C/H/S on LBA disks 2009-06-08 Pavel Roskin @@ -108,14 +108,14 @@ 2009-06-04 Vladimir Serbinenko - * kern/i386/pc/startup.S [APPLE_CC]: block of nops to + * kern/i386/pc/startup.S [APPLE_CC]: block of nops to compensate a compiler bug 2009-06-04 Vladimir Serbinenko - * include/grub/term.h (GRUB_TERM_BACKSPACE): explicitely define as 8 + * include/grub/term.h (GRUB_TERM_BACKSPACE): explicitly define as 8 instead of '\b' - + 2009-06-04 Vladimir Serbinenko Definitions for creating asm symbols with Apple's CC @@ -134,13 +134,13 @@ [! APPLE_CC] (CODE_LENG): skip [! APPLE_CC] (setup_sects): likewise [! APPLE_CC]: skip filling - + 2009-06-04 Vladimir Serbinenko Address in trampolines based on 32-bit registers when compiled with Apple's CC - * loader/i386/xnu_helper.S [APPLE_CC]: use 32-bit registers + * loader/i386/xnu_helper.S [APPLE_CC]: use 32-bit registers for addresses * loader/i386/linux_trampoline.S [APPLE_CC]: likewise @@ -151,7 +151,7 @@ * kern/misc.c [APPLE_CC] (memcpy): new function [APPLE_CC] (memmove): likewise [APPLE_CC && !GRUB_UTIL] (grub_err_printf): likewise - (memcpy): define alias conditionaly on !APPLE_CC + (memcpy): define alias conditionally on !APPLE_CC (memset): likewise (abort): likewise * include/grub/misc.h (memove): don't define when both GRUB_UTIL and @@ -163,8 +163,8 @@ Use grub-macho2img when compiling with Apple's CC for PCBIOS machine - * conf/common.rmk (bin_UTILITIES): add (on false on condition) - grub-macho2img + * conf/common.rmk (bin_UTILITIES): add (on false on condition) + grub-macho2img (CLEANFILES): add grub-macho2img (grub_macho2img_SOURCES): new variable * kern/i386/pc/startup.S (bss_start): new variable @@ -183,7 +183,7 @@ (efiemu64_s.o): likewise * configure.ac: check for objconv when compiling with Apple's CC * genmk.rb: use objconv for modules when compiled with Apple's CC - + 2009-06-04 Vladimir Serbinenko Define segment as well as section when compiling with @@ -199,35 +199,35 @@ (reflect): likewise * include/grub/dl.h (GRUB_MOD_NAME): define segment with Apple's CC (GRUB_MOD_DEP): likewise - + 2009-06-04 Vladimir Serbinenko Allow a compilation without -mcmodel=large * kern/efi/mm.c (grub_efi_allocate_pages): don't allocate >4GiB when compiled without -mcmodel=large - (filter_memory_map): remove memory post 4 GiB when compiled + (filter_memory_map): remove memory post 4 GiB when compiled without -mcmodel=large - * configure.ac: fail gracefully and add -DMCMODEL_SMALL=1 to + * configure.ac: fail gracefully and add -DMCMODEL_SMALL=1 to TARGET_CFLAGS when -mcmodel=large isn't supported - + 2009-06-04 Vladimir Serbinenko Remove nested functions in efiemu core * efiemu/runtime/efiemu.c (reflect): make static instead of nested - + 2009-06-04 Vladimir Serbinenko Avoid clobbering %ebx/%rbx in inline assembly with Apple's CC * efiemu/runtime/efiemu.c (write_cmos): use %cl instead of %bl as temporary storage - * include/grub/i386/tsc.h (grub_get_tsc): restore %rbx/%ebx when - using Apple's CC + * include/grub/i386/tsc.h (grub_get_tsc): restore %rbx/%ebx when + using Apple's CC (grub_cpu_is_tsc_supported): likewise * loader/i386/xnu.c (guessfsb): restore %rbx/%ebx in inline assembly - + 2009-06-04 Vladimir Serbinenko Absolute addressing through constant with Apple's cc @@ -264,7 +264,7 @@ * genmk.rb: adapt nm options if we use Apple's utils * aclocal.m4 (grub_apple_cc): new test (grub_apple_target_cc): likewise - + 2009-06-04 Vladimir Serbinenko Simplify sed expressions and improve awk @@ -279,16 +279,16 @@ * boot/i386/pc/boot.S: add start * boot/i386/pc/pxeboot.S: likewise - + 2009-06-04 Vladimir Serbinenko Fix wrong assumptions with grub-mkimage on EFI - - * i386/efi/grub-mkimage.c (read_kernel_module): don't write prefox here + + * i386/efi/grub-mkimage.c (read_kernel_module): don't write prefix here (relocate_addresses): consider both r_addend and value at offset (make_mods_section): zerofill modinfo and header (convert_elf): write prefix here - + 2009-06-04 Vladimir Serbinenko Use .asciz instead of .string @@ -297,7 +297,7 @@ * i386/pc/boot.S: likewise * include/grub/dl.h (GRUB_MOD_DEP): likewise (GRUB_MOD_NAME): likewise - + 2009-06-04 Vladimir Serbinenko gfxpayload support @@ -318,10 +318,10 @@ (DEFAULT_VIDEO_MODE): new definition (video_hook): new function (grub_gfxterm_init): use grub_video_set_mode - * util/grub.d/30_os-prober.in: remove explicit modesetting before + * util/grub.d/30_os-prober.in: remove explicit modesetting before loading xnu * video/video.c (grub_video_setup): removed - (grub_video_set_mode): new function based on grub_gfxterm_init and + (grub_video_set_mode): new function based on grub_gfxterm_init and grub_video_setup 2009-06-04 Vladimir Serbinenko @@ -332,7 +332,7 @@ (revparse_biosdisk): likewise (list_mappings): derive name from id directly (grub_cmd_drivemap): use tryparse_diskstring - + 2009-06-04 Vladimir Serbinenko Script fixes @@ -345,12 +345,12 @@ (grub_script_execute_argument_to_string): new prototype * kern/parser.c (state_transitions): reorder (grub_parser_cmdline_state): fix a bug and make more compact - * script/sh/execute.c (grub_script_execute_argument_to_string): + * script/sh/execute.c (grub_script_execute_argument_to_string): make global (grub_script_execute_cmdline): use new format * script/sh/function.c (grub_script_function_create): make functionname grub_script_arg. All callers updated - * script/sh/lexer.c (grub_script_lexer_init): initilaize tokenonhold + * script/sh/lexer.c (grub_script_lexer_init): initialize tokenonhold (grub_script_yylex): remove (grub_script_yylex2): renamed to ... (grub_script_yylex): ...renamed @@ -371,7 +371,7 @@ (function): likewise (command): move error handling to script (menuentry): move grub_script_lexer_ref before - * script/sh/script.c (grub_script_create_cmdline): remove cmdline + * script/sh/script.c (grub_script_create_cmdline): remove cmdline argument. All callers updated 2009-06-04 Robert Millan @@ -489,7 +489,7 @@ 2009-05-19 Vladimir Serbinenko * conf/x86_64-efi.rmk (linux_mod_ASFLAGS): Add missing variable - * loader/i386/linux_trampoline.S: Fix identation + * loader/i386/linux_trampoline.S: Fix indentation * loader/i386/xnu_helper.S: Likewise 2009-05-18 Colin D Bennett @@ -517,7 +517,7 @@ * conf/x86_64-efi.rmk (linux_mod_SOURCES): added loader/i386/efi/linux_trampoline.S * include/grub/x86_64/efi/loader.h (grub_linux_real_boot): removed - declration + declaration * kern/x86_64/efi/startup.S (grub_linux_real_boot): moved from here * loader/i386/linux_trampoline.S: moved here @@ -770,7 +770,7 @@ 2009-05-06 Robert Millan * util/i386/pc/grub-setup.c (setup): Fix check for embed region - existance. + existence. 2009-05-05 Felix Zielcke @@ -944,7 +944,7 @@ 2009-05-04 Robert Millan - * util/misc.c (grub_util_warn): New function. Emmits a warning + * util/misc.c (grub_util_warn): New function. Emits a warning unconditionally. * include/grub/util/misc.h (grub_util_warn): New declaration. From fe052e37780d9368ba476edddc537c775a942f44 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 10 Jun 2009 17:02:15 +0000 Subject: [PATCH 0825/1707] 2009-06-10 Pavel Roskin * conf/common.rmk: Compile tar.mod from tar.c, not cpio.c. The build system doesn't need to be aware of the tar.c internals. --- ChangeLog | 5 +++++ conf/common.rmk | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index fb215605f..46782e973 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-10 Pavel Roskin + + * conf/common.rmk: Compile tar.mod from tar.c, not cpio.c. The + build system doesn't need to be aware of the tar.c internals. + 2009-06-09 Michel Hermier * fs/i386/pc/pxe.c (grub_pxefs_read): Fix returned values. diff --git a/conf/common.rmk b/conf/common.rmk index 978034161..027eff2f8 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -260,8 +260,8 @@ cpio_mod_CFLAGS = $(COMMON_CFLAGS) cpio_mod_LDFLAGS = $(COMMON_LDFLAGS) # For tar.mod. -tar_mod_SOURCES = fs/cpio.c -tar_mod_CFLAGS = $(COMMON_CFLAGS) -DMODE_USTAR +tar_mod_SOURCES = fs/tar.c +tar_mod_CFLAGS = $(COMMON_CFLAGS) tar_mod_LDFLAGS = $(COMMON_LDFLAGS) # For udf.mod. From 06a6836c58cd59bd36243e308def5536cca03108 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 10 Jun 2009 18:26:50 +0000 Subject: [PATCH 0826/1707] 2009-06-10 Pavel Roskin * configure.ac: Remove checks for __bswapsi2 and __bswapdi2, they fail without libc headers for the target. * include/grub/powerpc/libgcc.h: Use weak attribute for all exports. * include/grub/sparc64/libgcc.h: Likewise. Don't use preprocessor conditionals. --- ChangeLog | 7 +++++++ configure.ac | 3 --- include/grub/powerpc/libgcc.h | 10 +++++----- include/grub/sparc64/libgcc.h | 8 ++------ 4 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 46782e973..7b7d61962 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2009-06-10 Pavel Roskin + * configure.ac: Remove checks for __bswapsi2 and __bswapdi2, + they fail without libc headers for the target. + * include/grub/powerpc/libgcc.h: Use weak attribute for all + exports. + * include/grub/sparc64/libgcc.h: Likewise. Don't use + preprocessor conditionals. + * conf/common.rmk: Compile tar.mod from tar.c, not cpio.c. The build system doesn't need to be aware of the tar.c internals. diff --git a/configure.ac b/configure.ac index e448c2fd1..8ece3592b 100644 --- a/configure.ac +++ b/configure.ac @@ -409,9 +409,6 @@ CFLAGS="$TARGET_CFLAGS" CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" -# Check for target functions. -AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) - # Defined in aclocal.m4. grub_PROG_TARGET_CC if test "x$TARGET_APPLE_CC" != x1 ; then diff --git a/include/grub/powerpc/libgcc.h b/include/grub/powerpc/libgcc.h index acdd1467c..bed937767 100644 --- a/include/grub/powerpc/libgcc.h +++ b/include/grub/powerpc/libgcc.h @@ -16,8 +16,8 @@ * along with GRUB. If not, see . */ -void EXPORT_FUNC (memset) (void); -void EXPORT_FUNC (__ashldi3) (void); -void EXPORT_FUNC (__lshrdi3) (void); -void EXPORT_FUNC (__trampoline_setup) (void); -void EXPORT_FUNC (__ucmpdi2) (void); +void EXPORT_FUNC (memset) (void) __attribute__ ((weak)); +void EXPORT_FUNC (__ashldi3) (void) __attribute__ ((weak)); +void EXPORT_FUNC (__lshrdi3) (void) __attribute__ ((weak)); +void EXPORT_FUNC (__trampoline_setup) (void) __attribute__ ((weak)); +void EXPORT_FUNC (__ucmpdi2) (void) __attribute__ ((weak)); diff --git a/include/grub/sparc64/libgcc.h b/include/grub/sparc64/libgcc.h index 4a6b6194d..5d18c5c81 100644 --- a/include/grub/sparc64/libgcc.h +++ b/include/grub/sparc64/libgcc.h @@ -20,12 +20,8 @@ void EXPORT_FUNC (memset) (void); -#ifdef HAVE___BSWAPSI2 typedef int SItype __attribute__ ((mode (SI))); -SItype EXPORT_FUNC (__bswapsi2) (SItype); -#endif +SItype EXPORT_FUNC (__bswapsi2) (SItype) __attribute__ ((weak)); -#ifdef HAVE___BSWAPDI2 typedef int DItype __attribute__ ((mode (DI))); -DItype EXPORT_FUNC (__bswapdi2) (DItype); -#endif +DItype EXPORT_FUNC (__bswapdi2) (DItype) __attribute__ ((weak)); From 437e6adcb4263d2d543c473b4a970113456750cc Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 10 Jun 2009 18:32:13 +0000 Subject: [PATCH 0827/1707] 2009-06-10 Pavel Roskin * configure.ac: Use -nostdlib when probing for the target. It should not be required to have libc for the target. --- ChangeLog | 3 +++ configure.ac | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7b7d61962..bbc2262fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-10 Pavel Roskin + * configure.ac: Use -nostdlib when probing for the target. It + should not be required to have libc for the target. + * configure.ac: Remove checks for __bswapsi2 and __bswapdi2, they fail without libc headers for the target. * include/grub/powerpc/libgcc.h: Use weak attribute for all diff --git a/configure.ac b/configure.ac index 8ece3592b..e29495a97 100644 --- a/configure.ac +++ b/configure.ac @@ -405,7 +405,7 @@ AC_SUBST(TARGET_LDFLAGS) # Set them to their new values for the tests below. CC="$TARGET_CC" -CFLAGS="$TARGET_CFLAGS" +CFLAGS="$TARGET_CFLAGS -nostdlib" CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" From 2763ac183d5a6be9b97a0c1aee0b8933bd4fed97 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 10 Jun 2009 20:11:12 +0000 Subject: [PATCH 0828/1707] 2009-06-10 Pavel Roskin * include/grub/multiboot2.h: Provide compatibility defines for multiboot2.h. * include/multiboot2.h: Include stdint.h only if needed, using angle brackets. * loader/i386/pc/multiboot2.c: Include multiboot2.h after grub/multiboot2.h. * loader/ieee1275/multiboot2.c: Likewise. * loader/multiboot2.c: Likewise. * loader/multiboot_loader.c: Likewise. --- ChangeLog | 10 ++++++++++ include/grub/multiboot2.h | 6 ++++++ include/multiboot2.h | 4 +++- loader/i386/pc/multiboot2.c | 2 +- loader/ieee1275/multiboot2.c | 2 +- loader/multiboot2.c | 2 +- loader/multiboot_loader.c | 2 +- 7 files changed, 23 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bbc2262fe..ce7330e78 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,15 @@ 2009-06-10 Pavel Roskin + * include/grub/multiboot2.h: Provide compatibility defines for + multiboot2.h. + * include/multiboot2.h: Include stdint.h only if needed, using + angle brackets. + * loader/i386/pc/multiboot2.c: Include multiboot2.h after + grub/multiboot2.h. + * loader/ieee1275/multiboot2.c: Likewise. + * loader/multiboot2.c: Likewise. + * loader/multiboot_loader.c: Likewise. + * configure.ac: Use -nostdlib when probing for the target. It should not be required to have libc for the target. diff --git a/include/grub/multiboot2.h b/include/grub/multiboot2.h index bfbffcc06..0d53f8ff7 100644 --- a/include/grub/multiboot2.h +++ b/include/grub/multiboot2.h @@ -24,6 +24,12 @@ #include #include +#ifndef GRUB_UTIL +typedef grub_uint32_t uint32_t; +typedef grub_uint64_t uint64_t; +#define __WORDSIZE (8 * GRUB_TARGET_SIZEOF_VOID_P) +#endif + struct multiboot_tag_header; grub_err_t diff --git a/include/multiboot2.h b/include/multiboot2.h index 0f2b0cf2d..c87c3d175 100644 --- a/include/multiboot2.h +++ b/include/multiboot2.h @@ -34,7 +34,9 @@ #ifndef ASM_FILE -#include "stdint.h" +#ifndef __WORDSIZE +#include +#endif /* XXX not portable? */ #if __WORDSIZE == 64 diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c index 2c14ee254..7d7c685ee 100644 --- a/loader/i386/pc/multiboot2.c +++ b/loader/i386/pc/multiboot2.c @@ -17,8 +17,8 @@ * along with GRUB. If not, see . */ -#include #include +#include #include #include #include diff --git a/loader/ieee1275/multiboot2.c b/loader/ieee1275/multiboot2.c index c253fc938..61f21b0e5 100644 --- a/loader/ieee1275/multiboot2.c +++ b/loader/ieee1275/multiboot2.c @@ -17,10 +17,10 @@ * along with GRUB. If not, see . */ -#include #include #include #include +#include #include #include #include diff --git a/loader/multiboot2.c b/loader/multiboot2.c index fd8282849..6f8a6795b 100644 --- a/loader/multiboot2.c +++ b/loader/multiboot2.c @@ -17,10 +17,10 @@ * along with GRUB. If not, see . */ -#include #include #include #include +#include #include #include #include diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index 11ba666b1..707f55e34 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -17,10 +17,10 @@ * along with GRUB. If not, see . */ -#include #include #include #include +#include #include #include #include From d2d4966571bf1a889f144bcff842ca68c8b2fe20 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 10 Jun 2009 21:01:29 +0000 Subject: [PATCH 0829/1707] 2009-06-10 Felix Zielcke * gendistlist.sh (EXTRA_DISTFILES): Add `genhandlerlist.sh' and `genparttoollist.sh'. (DISTDIRS): Add `efiemu', `mmap', `parttool' and `script'. Add `*.sh' to the list find searches for and change `mdate.sh' to `mdate-sh'. --- ChangeLog | 8 ++++++++ gendistlist.sh | 15 ++++++++------- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce7330e78..b67ed2cc7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-06-10 Felix Zielcke + + * gendistlist.sh (EXTRA_DISTFILES): Add `genhandlerlist.sh' and + `genparttoollist.sh'. + (DISTDIRS): Add `efiemu', `mmap', `parttool' and `script'. + Add `*.sh' to the list find searches for and change `mdate.sh' + to `mdate-sh'. + 2009-06-10 Pavel Roskin * include/grub/multiboot2.h: Provide compatibility defines for diff --git a/gendistlist.sh b/gendistlist.sh index 011554ddf..5fe5d186b 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -16,12 +16,13 @@ EXTRA_DISTFILES="AUTHORS COPYING ChangeLog DISTLIST INSTALL NEWS README \ THANKS TODO Makefile.in aclocal.m4 autogen.sh config.guess \ config.h.in config.sub configure configure.ac gencmdlist.sh \ - gendistlist.sh genfslist.sh geninit.sh geninitheader.sh genkernsyms.sh.in \ - genmk.rb genmoddep.awk genmodsrc.sh genpartmaplist.sh gensymlist.sh.in - install-sh mkinstalldirs stamp-h.in" + gendistlist.sh genfslist.sh genhandlerlist.sh geninit.sh \ + geninitheader.sh genkernsyms.sh.in genmk.rb genmoddep.awk \ + genmodsrc.sh genpartmaplist.sh genparttoollist.sh \ + gensymlist.sh.in install-sh mkinstalldirs stamp-h.in" -DISTDIRS="boot bus commands conf disk docs font fs hello hook include io kern lib \ - loader normal partmap term util video" +DISTDIRS="boot bus commands conf disk docs efiemu font fs hello hook include io \ + kern lib loader mmap normal partmap parttool script term util video" LC_COLLATE=C export LC_COLLATE @@ -37,7 +38,7 @@ for dir in $DISTDIRS; do for d in `find $dir -type d | sed '/\/\.svn$/d;\/\.svn\//d' | sort`; do find $d -maxdepth 1 -name '*.[chSy]' -o -name '*.mk' -o -name '*.rmk' \ -o -name '*.rb' -o -name '*.in' -o -name '*.tex' -o -name '*.texi' \ - -o -name 'grub.cfg' -o -name 'README' -o -name '*.sc' -o -name 'mdate.sh' \ - | sort + -o -name 'grub.cfg' -o -name 'README' -o -name '*.sc' -o -name 'mdate-sh' \ + -o -name '*.sh' | sort done done From b39f9d20a938bb55da56457b31fa076619653f00 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 10 Jun 2009 21:04:23 +0000 Subject: [PATCH 0830/1707] remove all trailing whitespace --- Makefile.in | 2 +- aclocal.m4 | 2 +- boot/i386/pc/boot.S | 46 +++---- boot/i386/pc/cdboot.S | 2 +- boot/i386/pc/diskboot.S | 36 +++--- boot/i386/pc/lnxboot.S | 8 +- boot/i386/pc/pxeboot.S | 8 +- bus/usb/ohci.c | 10 +- bus/usb/uhci.c | 4 +- bus/usb/usb.c | 2 +- bus/usb/usbtrans.c | 6 +- commands/acpi.c | 134 ++++++++++---------- commands/blocklist.c | 12 +- commands/boot.c | 14 +-- commands/cat.c | 8 +- commands/cmp.c | 14 +-- commands/echo.c | 2 +- commands/efi/acpi.c | 4 +- commands/gptsync.c | 44 +++---- commands/help.c | 10 +- commands/i386/pc/acpi.c | 8 +- commands/i386/pc/drivemap.c | 2 +- commands/i386/pc/play.c | 2 +- commands/i386/pc/vbeinfo.c | 10 +- commands/i386/pc/vbetest.c | 4 +- commands/loadenv.c | 30 ++--- commands/ls.c | 42 +++---- commands/parttool.c | 72 +++++------ commands/search.c | 36 +++--- commands/test.c | 70 +++++------ commands/usbtest.c | 4 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 4 +- conf/sparc64-ieee1275.rmk | 2 +- configure.ac | 4 +- disk/ata.c | 12 +- disk/efi/efidisk.c | 98 +++++++-------- disk/fs_uuid.c | 10 +- disk/host.c | 2 +- disk/i386/pc/biosdisk.c | 26 ++-- disk/ieee1275/ofdisk.c | 2 +- disk/loopback.c | 58 ++++----- disk/lvm.c | 86 ++++++------- disk/memdisk.c | 2 +- disk/raid.c | 26 ++-- disk/scsi.c | 2 +- disk/usbms.c | 4 +- docs/grub.texi | 14 +-- docs/texinfo.tex | 118 +++++++++--------- efiemu/i386/loadcore32.c | 24 ++-- efiemu/i386/loadcore64.c | 26 ++-- efiemu/i386/pc/cfgtables.c | 2 +- efiemu/loadcore.c | 46 +++---- efiemu/loadcore_common.c | 12 +- efiemu/main.c | 60 ++++----- efiemu/mm.c | 114 ++++++++--------- efiemu/pnvram.c | 78 ++++++------ efiemu/prepare.c | 30 ++--- efiemu/runtime/efiemu.S | 10 +- efiemu/runtime/efiemu.c | 94 +++++++------- efiemu/runtime/efiemu.sh | 2 +- efiemu/symbols.c | 24 ++-- font/font.c | 22 ++-- font/font_cmd.c | 2 +- fs/affs.c | 32 ++--- fs/afs.c | 2 +- fs/cpio.c | 10 +- fs/ext2.c | 92 +++++++------- fs/fat.c | 92 +++++++------- fs/fshelp.c | 66 +++++----- fs/hfs.c | 200 +++++++++++++++--------------- fs/hfsplus.c | 48 ++++---- fs/iso9660.c | 158 ++++++++++++------------ fs/jfs.c | 186 ++++++++++++++-------------- fs/minix.c | 140 ++++++++++----------- fs/ntfs.c | 2 +- fs/reiserfs.c | 48 ++++---- fs/sfs.c | 24 ++-- fs/udf.c | 2 +- fs/ufs.c | 154 +++++++++++------------ fs/xfs.c | 46 +++---- genmk.rb | 18 +-- genmoddep.awk | 2 +- include/grub/acpi.h | 2 +- include/grub/autoefi.h | 4 +- include/grub/datetime.h | 2 +- include/grub/disk.h | 4 +- include/grub/efi/api.h | 40 +++--- include/grub/efi/memory.h | 6 +- include/grub/efi/pe32.h | 6 +- include/grub/efiemu/efiemu.h | 32 ++--- include/grub/fs.h | 10 +- include/grub/hfs.h | 2 +- include/grub/i386/efiemu.h | 4 +- include/grub/i386/linux.h | 28 ++--- include/grub/i386/pc/biosdisk.h | 2 +- include/grub/i386/pc/memory.h | 14 +-- include/grub/i386/pc/vbe.h | 6 +- include/grub/i386/tsc.h | 2 +- include/grub/i386/xnu.h | 22 ++-- include/grub/ieee1275/ieee1275.h | 14 +-- include/grub/lvm.h | 2 +- include/grub/macho.h | 2 +- include/grub/machoload.h | 2 +- include/grub/memory.h | 4 +- include/grub/multiboot.h | 26 ++-- include/grub/multiboot2.h | 12 +- include/grub/net.h | 4 +- include/grub/partition.h | 14 +-- include/grub/parttool.h | 6 +- include/grub/term.h | 20 +-- include/grub/usbdesc.h | 2 +- include/grub/video.h | 2 +- include/grub/xnu.h | 10 +- include/multiboot.h | 2 +- io/gzio.c | 38 +++--- kern/corecmd.c | 2 +- kern/device.c | 16 +-- kern/disk.c | 58 ++++----- kern/dl.c | 62 +++++----- kern/efi/efi.c | 32 ++--- kern/efi/init.c | 8 +- kern/efi/mm.c | 38 +++--- kern/env.c | 44 +++---- kern/err.c | 14 +-- kern/file.c | 20 +-- kern/fs.c | 20 +-- kern/generic/millisleep.c | 4 +- kern/generic/rtc_get_time_ms.c | 4 +- kern/i386/dl.c | 10 +- kern/i386/ieee1275/init.c | 2 +- kern/i386/pc/init.c | 32 ++--- kern/i386/pc/lzo1x.S | 8 +- kern/i386/pc/mmap.c | 2 +- kern/i386/pc/startup.S | 164 ++++++++++++------------- kern/i386/realmode.S | 4 +- kern/i386/tsc.c | 2 +- kern/ieee1275/ieee1275.c | 12 +- kern/main.c | 12 +- kern/misc.c | 84 ++++++------- kern/parser.c | 10 +- kern/partition.c | 8 +- kern/powerpc/dl.c | 28 ++--- kern/sparc64/dl.c | 14 +-- kern/term.c | 18 +-- lib/envblk.c | 32 ++--- lib/i386/setjmp.S | 8 +- loader/efi/chainloader.c | 42 +++---- loader/i386/bsd.c | 36 +++--- loader/i386/bsd_helper.S | 4 +- loader/i386/bsd_pagetable.c | 8 +- loader/i386/bsd_trampoline.S | 12 +- loader/i386/efi/linux.c | 82 ++++++------- loader/i386/linux.c | 94 +++++++------- loader/i386/linux_trampoline.S | 42 +++---- loader/i386/multiboot.c | 18 +-- loader/i386/multiboot_elfxx.c | 8 +- loader/i386/multiboot_helper.S | 4 +- loader/i386/pc/chainloader.c | 16 +-- loader/i386/pc/linux.c | 40 +++--- loader/i386/pc/multiboot2.c | 4 +- loader/i386/pc/xnu.c | 14 +-- loader/i386/xnu.c | 106 ++++++++-------- loader/i386/xnu_helper.S | 52 ++++---- loader/macho.c | 64 +++++----- loader/multiboot_loader.c | 10 +- loader/powerpc/ieee1275/linux.c | 6 +- loader/xnu.c | 204 +++++++++++++++---------------- loader/xnu_resume.c | 20 +-- mmap/efi/mmap.c | 48 ++++---- mmap/i386/mmap.c | 8 +- mmap/i386/pc/mmap.c | 42 +++---- mmap/i386/pc/mmap_helper.S | 12 +- mmap/i386/uppermem.c | 6 +- mmap/mmap.c | 66 +++++----- normal/cmdline.c | 38 +++--- normal/completion.c | 52 ++++---- normal/datetime.c | 16 +-- normal/main.c | 8 +- normal/menu_entry.c | 174 +++++++++++++------------- normal/menu_viewer.c | 2 +- normal/misc.c | 4 +- partmap/acorn.c | 2 +- partmap/amiga.c | 34 +++--- partmap/apple.c | 12 +- partmap/gpt.c | 8 +- partmap/pc.c | 38 +++--- partmap/sun.c | 28 ++--- parttool/pcpart.c | 16 +-- script/sh/function.c | 2 +- script/sh/lexer.c | 32 ++--- term/efi/console.c | 24 ++-- term/gfxterm.c | 62 +++++----- term/i386/pc/serial.c | 54 ++++---- term/i386/pc/vesafb.c | 18 +-- term/i386/pc/vga.c | 58 ++++----- term/ieee1275/ofconsole.c | 18 +-- term/terminfo.c | 4 +- term/usb_keyboard.c | 2 +- util/console.c | 14 +-- util/getroot.c | 22 ++-- util/grub-editenv.c | 26 ++-- util/grub-emu.c | 10 +- util/grub-macho2img.c | 18 +-- util/grub-mkconfig.in | 2 +- util/grub-mkdevicemap.c | 14 +-- util/grub-probe.c | 38 +++--- util/grub.d/10_hurd.in | 2 +- util/grub.d/30_os-prober.in | 2 +- util/hostdisk.c | 138 ++++++++++----------- util/hostfs.c | 4 +- util/i386/efi/grub-mkimage.c | 106 ++++++++-------- util/i386/pc/grub-mkimage.c | 26 ++-- util/i386/pc/grub-setup.c | 108 ++++++++-------- util/lvm.c | 2 +- util/misc.c | 42 +++---- util/raid.c | 6 +- util/resolve.c | 18 +-- util/usb.c | 2 +- video/bitmap.c | 8 +- video/readers/tga.c | 4 +- video/video.c | 80 ++++++------ 222 files changed, 3286 insertions(+), 3286 deletions(-) diff --git a/Makefile.in b/Makefile.in index 5a4965a84..3ccb26518 100644 --- a/Makefile.in +++ b/Makefile.in @@ -124,7 +124,7 @@ PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) CLEANFILES = -MOSTLYCLEANFILES = +MOSTLYCLEANFILES = DISTCLEANFILES = config.status config.cache config.log config.h \ Makefile stamp-h include/grub/cpu include/grub/machine \ gensymlist.sh genkernsyms.sh build_env.mk diff --git a/aclocal.m4 b/aclocal.m4 index 10e0ca514..b421c72a3 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -232,7 +232,7 @@ AC_MSG_CHECKING(dnl [whether an absolute indirect call/jump must not be prefixed with an asterisk]) AC_CACHE_VAL(grub_cv_i386_asm_absolute_without_asterisk, [cat > conftest.s <<\EOF - lcall *(offset) + lcall *(offset) offset: .long 0 .word 0 diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index c22dccd79..2cd505e6a 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -19,7 +19,7 @@ #include #include - + /* * defines for the code go here */ @@ -44,7 +44,7 @@ in real mode. */ .code16 -.globl _start, start; +.globl _start, start; _start: start: /* @@ -70,7 +70,7 @@ start: /* scratch space */ mode: .byte 0 -disk_address_packet: +disk_address_packet: sectors: .long 0 heads: @@ -91,7 +91,7 @@ cylinder_start: * End of BIOS parameter block. */ -boot_version: +boot_version: .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR @@ -99,7 +99,7 @@ kernel_segment: .word GRUB_BOOT_MACHINE_KERNEL_SEG kernel_sector: .long 1, 0 -boot_drive: +boot_drive: .byte 0xff /* the disk to load kernel from */ /* 0xff means use the boot drive */ root_drive: @@ -124,7 +124,7 @@ boot_drive_check: jnz 1f movb $0x80, %dl 1: - + /* * ljmp to the next instruction because some bogus BIOSes * jump to 07C0:0000 instead of 0000:7C00. @@ -136,7 +136,7 @@ boot_drive_check: ljmp $0, $ABS(real_start) #endif -real_start: +real_start: /* set up %ds and %ss as offset from 0 */ xorw %ax, %ax @@ -176,17 +176,17 @@ real_start: #else movw $ABS(disk_address_packet), %si #endif - + /* do not probe LBA if the drive is a floppy */ testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl jz chs_mode - + /* check if LBA is supported */ movb $0x41, %ah movw $0x55aa, %bx int $0x13 - /* + /* * %dl may have been clobbered by INT 13, AH=41H. * This happens, for example, with AST BIOS 1.04. */ @@ -200,15 +200,15 @@ real_start: andw $1, %cx jz chs_mode - + lba_mode: xorw %ax, %ax movw %ax, 4(%si) - incw %ax + incw %ax /* set the mode to non-zero */ movb %al, -1(%si) - + /* the blocks */ movw %ax, 2(%si) @@ -249,8 +249,8 @@ lba_mode: movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx jmp copy_buffer - -chs_mode: + +chs_mode: /* * Determine the hard disk geometry from the BIOS! * We do this first, so that LS-120 IDE floppies work correctly. @@ -272,7 +272,7 @@ final_init: /* set the mode to zero */ movzbl %dh, %eax movb %ah, -1(%si) - + /* save number of heads */ incw %ax movl %eax, 4(%si) @@ -303,7 +303,7 @@ setup_sectors: orl %eax, %eax jnz geometry_error - + /* load logical sector start (bottom half) */ #ifdef APPLE_CC movl (kernel_sector_abs), %eax @@ -371,7 +371,7 @@ setup_sectors: jc read_error movw %es, %bx - + copy_buffer: #ifdef APPLE_CC kernel_segment_abs = ABS (kernel_segment) @@ -386,14 +386,14 @@ copy_buffer: */ pusha pushw %ds - + movw $0x100, %cx movw %bx, %ds xorw %si, %si xorw %di, %di - + cld - + rep movsw @@ -472,7 +472,7 @@ message: */ . = _start + GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC -nt_magic: +nt_magic: .long 0 .word 0 @@ -482,7 +482,7 @@ nt_magic: * sneaky, huh? */ -part_start: +part_start: . = _start + GRUB_BOOT_MACHINE_PART_START probe_values: diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S index b32f82ce8..688b26c7d 100644 --- a/boot/i386/pc/cdboot.S +++ b/boot/i386/pc/cdboot.S @@ -88,7 +88,7 @@ bi_reserved: /* Root drive will default to boot drive */ movb $0xFF, %dh - + ljmp $(DATA_ADDR >> 4), $0 /* diff --git a/boot/i386/pc/diskboot.S b/boot/i386/pc/diskboot.S index f29ddaa15..1e817df27 100644 --- a/boot/i386/pc/diskboot.S +++ b/boot/i386/pc/diskboot.S @@ -17,7 +17,7 @@ */ #include - + /* * defines for the code go here */ @@ -26,7 +26,7 @@ This makes the assembler generate the address without support from the linker. (ELF can't relocate 16-bit addresses!) */ #define ABS(x) (x-_start+GRUB_BOOT_MACHINE_KERNEL_ADDR) - + /* Print message string */ #ifdef APPLE_CC #define MSG(x) x ## _abs = ABS(x); mov $x ## _abs, %esi; call message @@ -44,18 +44,18 @@ .globl start, _start start: -_start: +_start: /* * _start is loaded at 0x2000 and is jumped to with * CS:IP 0:0x2000 in kernel. */ - /* + /* * we continue to use the stack for boot.img and assume that * some registers are set to correct values. See boot.S * for more information. */ - + /* save drive reference first thing! */ pushw %dx @@ -63,7 +63,7 @@ _start: pushw %si MSG(notification_string) popw %si - + /* this sets up for the first run through "bootloop" */ #ifdef APPLE_CC firstlist_off_abs = ABS (firstlist - GRUB_BOOT_MACHINE_LIST_SIZE) @@ -84,14 +84,14 @@ bootloop: /* if zero, go to the start function */ je bootit -setup_sectors: +setup_sectors: /* check if we use LBA or CHS */ cmpb $0, -1(%si) /* jump to chs_mode if zero */ je chs_mode -lba_mode: +lba_mode: /* load logical sector start */ movl (%di), %ebx movl 4(%di), %ecx @@ -109,7 +109,7 @@ lba_mode: /* if less than, set to total */ movw 8(%di), %ax -1: +1: /* subtract from total */ subw %ax, 8(%di) @@ -154,8 +154,8 @@ lba_mode: movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx jmp copy_buffer - -chs_mode: + +chs_mode: /* load logical sector start (top half) */ movl 4(%di), %eax orl %eax, %eax @@ -202,7 +202,7 @@ chs_mode: /* if less than, set to total */ movw 8(%di), %ax -2: +2: /* subtract from total */ subw %ax, 8(%di) @@ -258,8 +258,8 @@ chs_mode: /* save source segment */ movw %es, %bx - -copy_buffer: + +copy_buffer: /* load addresses for copy from disk buffer to destination */ movw 10(%di), %es /* load destination segment */ @@ -291,7 +291,7 @@ copy_buffer: rep /* sets a repeat */ movsw /* this runs the actual copy */ - /* restore addressing regs and print a dot with correct DS + /* restore addressing regs and print a dot with correct DS (MSG modifies SI, which is saved, and unused AX and BX) */ popw %ds MSG(notification_step) @@ -339,7 +339,7 @@ notification_string: .asciz "loading" notification_step: .asciz "." notification_done: .asciz "\r\n" - + geometry_error_string: .asciz "Geom" read_error_string: .asciz "Read" general_error_string: .asciz " Error" @@ -379,7 +379,7 @@ lastlist: .word 0 . = _start + 0x200 - GRUB_BOOT_MACHINE_LIST_SIZE - + /* fill the first data listing with the default */ blocklist_default_start: /* this is the sector start parameter, in logical sectors from @@ -392,5 +392,5 @@ blocklist_default_len: blocklist_default_seg: /* this is the segment of the starting address to load the data into */ .word (GRUB_BOOT_MACHINE_KERNEL_SEG + 0x20) - + firstlist: /* this label has to be after the list data!!! */ diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index f244feccf..14bd0415e 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -24,7 +24,7 @@ #include .file "lnxboot.S" - + #ifdef APPLE_CC #error Building lnxboot.img with Apple's as results in an unusable image #endif @@ -50,7 +50,7 @@ data_start: . = data_start + 0x1F1 setup_sects: -/* Apple's cc can't fill this value. */ +/* Apple's cc can't fill this value. */ #ifdef APPLE_CC .byte 0 #else @@ -135,8 +135,8 @@ data_leng: linux_init: #ifdef APPLE_CC - reg_edx_rel = reg_edx - start - code32_start_rel = code32_start - start + reg_edx_rel = reg_edx - start + code32_start_rel = code32_start - start movw %cs:(reg_edx_rel), %dx movl %cs:(code32_start_rel), %ebp #else diff --git a/boot/i386/pc/pxeboot.S b/boot/i386/pc/pxeboot.S index b62c1447b..1b51127f6 100644 --- a/boot/i386/pc/pxeboot.S +++ b/boot/i386/pc/pxeboot.S @@ -21,16 +21,16 @@ /* Start with the prehistoric environment... */ .code16 - + /* Let's go */ -.globl start, _start; +.globl start, _start; _start: -start: +start: /* Root drive will default to boot drive */ movb $0xFF, %dh movb $0x7F, %dl - + /* Jump to the real world */ ljmp $0, $0x8200 diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index 53356dc69..32fb7cf91 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -180,13 +180,13 @@ grub_ohci_pci_iter (int bus, int device, int func, /* Setup the HCCA. */ grub_ohci_writereg32 (o, GRUB_OHCI_REG_HCCA, (grub_uint32_t) o->hcca); grub_dprintf ("ohci", "OHCI HCCA\n"); - + /* Enable the OHCI. */ grub_ohci_writereg32 (o, GRUB_OHCI_REG_CONTROL, (2 << 6)); grub_dprintf ("ohci", "OHCI enable: 0x%02x\n", (grub_ohci_readreg32 (o, GRUB_OHCI_REG_CONTROL) >> 6) & 3); - + /* Link to ohci now that initialisation is successful. */ o->next = ohci; ohci = o; @@ -227,7 +227,7 @@ grub_ohci_iterate (int (*hook) (grub_usb_controller_t dev)) } static void -grub_ohci_transaction (grub_ohci_td_t td, +grub_ohci_transaction (grub_ohci_td_t td, grub_transfer_type_t type, unsigned int toggle, grub_size_t size, char *data) { @@ -305,7 +305,7 @@ grub_ohci_transfer (grub_usb_controller_t dev, grub_usb_transaction_t tr = &transfer->transactions[i]; grub_ohci_transaction (&td_list[i], tr->pid, tr->toggle, - tr->size, tr->data); + tr->size, tr->data); td_list[i].next_td = grub_cpu_to_le32 (&td_list[i + 1]); } @@ -607,5 +607,5 @@ GRUB_MOD_INIT(ohci) GRUB_MOD_FINI(ohci) { - grub_usb_controller_dev_unregister (&usb_controller); + grub_usb_controller_dev_unregister (&usb_controller); } diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index 1c7b8d965..84cd48daf 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -450,7 +450,7 @@ grub_uhci_transfer (grub_usb_controller_t dev, td = grub_uhci_transaction (u, transfer->endpoint, tr->pid, transfer->devaddr, tr->toggle, - tr->size, tr->data); + tr->size, tr->data); if (! td) { /* Terminate and free. */ @@ -517,7 +517,7 @@ grub_uhci_transfer (grub_usb_controller_t dev, /* Check if a babble error occurred. */ if (errtd->ctrl_status & (1 << 20)) err = GRUB_USB_ERR_BABBLE; - + /* Check if a NAK occurred. */ if (errtd->ctrl_status & (1 << 19)) err = GRUB_USB_ERR_NAK; diff --git a/bus/usb/usb.c b/bus/usb/usb.c index a30598f00..310b8cc6a 100644 --- a/bus/usb/usb.c +++ b/bus/usb/usb.c @@ -236,7 +236,7 @@ grub_usb_device_initialize (grub_usb_device_t dev) /* Skip the configuration descriptor. */ pos = sizeof (struct grub_usb_desc_config); - + /* Read all interfaces. */ for (currif = 0; currif < dev->config[i].descconf->numif; currif++) { diff --git a/bus/usb/usbtrans.c b/bus/usb/usbtrans.c index fd8295741..e4beb4550 100644 --- a/bus/usb/usbtrans.c +++ b/bus/usb/usbtrans.c @@ -54,7 +54,7 @@ grub_usb_control_msg (grub_usb_device_t dev, max = 64; datablocks = (size + max - 1) / max; - + /* XXX: Discriminate between different types of control messages. */ transfer->transcnt = datablocks + 2; @@ -110,7 +110,7 @@ grub_usb_control_msg (grub_usb_device_t dev, transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_OUT; else transfer->transactions[datablocks + 1].pid = GRUB_USB_TRANSFER_TYPE_IN; - + transfer->transactions[datablocks + 1].toggle = 1; err = dev->controller.dev->transfer (&dev->controller, transfer); @@ -184,7 +184,7 @@ grub_usb_bulk_readwrite (grub_usb_device_t dev, tr->data = &data[i * max]; size -= tr->size; } - + err = dev->controller.dev->transfer (&dev->controller, transfer); grub_dprintf ("usb", "toggle=%d\n", toggle); dev->toggle[endpoint] = toggle; diff --git a/commands/acpi.c b/commands/acpi.c index d6dce376a..d903d446d 100644 --- a/commands/acpi.c +++ b/commands/acpi.c @@ -36,22 +36,22 @@ #endif static const struct grub_arg_option options[] = { - {"exclude", 'x', 0, - "Don't load host tables specified by comma-separated list", + {"exclude", 'x', 0, + "Don't load host tables specified by comma-separated list", 0, ARG_TYPE_STRING}, - {"load-only", 'n', 0, + {"load-only", 'n', 0, "Load only tables specified by comma-separated list", 0, ARG_TYPE_STRING}, {"v1", '1', 0, "Expose v1 tables", 0, ARG_TYPE_NONE}, {"v2", '2', 0, "Expose v2 and v3 tables", 0, ARG_TYPE_NONE}, {"oemid", 'o', 0, "Set OEMID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, - {"oemtable", 't', 0, - "Set OEMTABLE ID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, - {"oemtablerev", 'r', 0, - "Set OEMTABLE revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT}, - {"oemtablecreator", 'c', 0, - "Set creator field of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, - {"oemtablecreatorrev", 'd', 0, - "Set creator revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT}, + {"oemtable", 't', 0, + "Set OEMTABLE ID of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, + {"oemtablerev", 'r', 0, + "Set OEMTABLE revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT}, + {"oemtablecreator", 'c', 0, + "Set creator field of RSDP, XSDT and RSDT", 0, ARG_TYPE_STRING}, + {"oemtablecreatorrev", 'd', 0, + "Set creator revision of RSDP, XSDT and RSDT", 0, ARG_TYPE_INT}, {"no-ebda", 'e', 0, "Don't update EBDA. May fix failures or hangs on some" " BIOSes but makes it ineffective with OS not receiving RSDP from GRUB", 0, ARG_TYPE_NONE}, @@ -59,7 +59,7 @@ static const struct grub_arg_option options[] = { }; /* Simple checksum by summing all bytes. Used by ACPI and SMBIOS. */ -grub_uint8_t +grub_uint8_t grub_byte_checksum (void *base, grub_size_t size) { grub_uint8_t *ptr; @@ -70,7 +70,7 @@ grub_byte_checksum (void *base, grub_size_t size) return ret; } -/* rev1 is 1 if ACPIv1 is to be generated, 0 otherwise. +/* rev1 is 1 if ACPIv1 is to be generated, 0 otherwise. rev2 contains the revision of ACPIv2+ to generate or 0 if none. */ static int rev1, rev2; /* OEMID of RSDP, RSDT and XSDT. */ @@ -128,7 +128,7 @@ grub_acpi_get_rsdpv1 (void) return grub_machine_acpi_get_rsdpv1 (); } -static inline int +static inline int iszero (grub_uint8_t *reg, int size) { int i; @@ -138,7 +138,7 @@ iszero (grub_uint8_t *reg, int size) return 1; } -grub_err_t +grub_err_t grub_acpi_create_ebda (void) { int ebda_kb_len; @@ -149,9 +149,9 @@ grub_acpi_create_ebda (void) grub_uint8_t *targetebda, *target; struct grub_acpi_rsdp_v10 *v1; struct grub_acpi_rsdp_v20 *v2; - auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, + auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); - int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t size, + int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t size, grub_uint32_t type) { grub_uint64_t end = start + size; @@ -164,7 +164,7 @@ grub_acpi_create_ebda (void) highestlow = (end - ebda_len) & (~0xf); return 0; } - + ebda = (grub_uint8_t *) UINT_TO_PTR ((*((grub_uint16_t *)0x40e)) << 4); ebda_kb_len = *(grub_uint16_t *) ebda; if (! ebda || ebda_kb_len > 16) @@ -177,10 +177,10 @@ grub_acpi_create_ebda (void) grub_dprintf ("acpi", "creating ebda @%llx\n", (unsigned long long) highestlow); if (! highestlow) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't find space for the new EBDA"); - mmapregion = grub_mmap_register (PTR_TO_UINT64 (targetebda), ebda_len, + mmapregion = grub_mmap_register (PTR_TO_UINT64 (targetebda), ebda_len, GRUB_MACHINE_MEMORY_RESERVED); if (! mmapregion) return grub_errno; @@ -198,13 +198,13 @@ grub_acpi_create_ebda (void) if (v2 && v2->length > 40) v2 = 0; - /* First try to replace already existing rsdp. */ + /* First try to replace already existing rsdp. */ if (v2) { grub_dprintf ("acpi", "Scanning EBDA for old rsdpv2\n"); for (; target < targetebda + 0x400 - v2->length; target += 0x10) if (grub_memcmp (target, "RSD PTR ", 8) == 0 - && grub_byte_checksum (target, + && grub_byte_checksum (target, sizeof (struct grub_acpi_rsdp_v10)) == 0 && ((struct grub_acpi_rsdp_v10 *) target)->revision != 0 && ((struct grub_acpi_rsdp_v20 *) target)->length <= v2->length) @@ -222,10 +222,10 @@ grub_acpi_create_ebda (void) if (v1) { grub_dprintf ("acpi", "Scanning EBDA for old rsdpv1\n"); - for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); target += 0x10) if (grub_memcmp (target, "RSD PTR ", 8) == 0 - && grub_byte_checksum (target, + && grub_byte_checksum (target, sizeof (struct grub_acpi_rsdp_v10)) == 0) { grub_memcpy (target, v1, sizeof (struct grub_acpi_rsdp_v10)); @@ -260,7 +260,7 @@ grub_acpi_create_ebda (void) if (v1) { grub_dprintf ("acpi", "Scanning EBDA for block of zeros\n"); - for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + for (; target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); target += 0x10) if (iszero (target, sizeof (struct grub_acpi_rsdp_v10))) { @@ -277,16 +277,16 @@ grub_acpi_create_ebda (void) if (v1 || v2) { grub_mmap_unregister (mmapregion); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't find suitable spot in EBDA"); } /* Remove any other RSDT. */ - for (target = targetebda; - target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); + for (target = targetebda; + target < targetebda + 0x400 - sizeof (struct grub_acpi_rsdp_v10); target += 0x10) if (grub_memcmp (target, "RSD PTR ", 8) == 0 - && grub_byte_checksum (target, + && grub_byte_checksum (target, sizeof (struct grub_acpi_rsdp_v10)) == 0 && target != v1inebda && target != v2inebda) *target = 0; @@ -312,7 +312,7 @@ setup_common_tables (void) grub_free (table_dsdt); table_dsdt = playground_ptr; playground_ptr += dsdt_size; - + /* Treat other tables. */ for (cur = acpi_tables; cur; cur = cur->next) { @@ -342,7 +342,7 @@ setup_common_tables (void) fadt->hdr.checksum = 1 + ~grub_byte_checksum (fadt, fadt->hdr.length); } } - + /* Fill RSDT entries. */ numoftables = 0; for (cur = acpi_tables; cur; cur = cur->next) @@ -365,7 +365,7 @@ setup_common_tables (void) for (cur = acpi_tables; cur; cur = cur->next) *(rsdt_entry++) = PTR_TO_UINT32 (cur->addr); - + /* Recompute checksum. */ rsdt->checksum = 0; rsdt->checksum = 1 + ~grub_byte_checksum (rsdt, rsdt->length); @@ -383,8 +383,8 @@ setv1table (void) rsdpv1_new->revision = 0; rsdpv1_new->rsdt_addr = PTR_TO_UINT32 (rsdt_addr); rsdpv1_new->checksum = 0; - rsdpv1_new->checksum = 1 + ~grub_byte_checksum (rsdpv1_new, - sizeof (*rsdpv1_new)); + rsdpv1_new->checksum = 1 + ~grub_byte_checksum (rsdpv1_new, + sizeof (*rsdpv1_new)); grub_dprintf ("acpi", "Generated ACPIv1 tables\n"); } @@ -421,19 +421,19 @@ setv2table (void) /* Create RSDPv2. */ rsdpv2_new = (struct grub_acpi_rsdp_v20 *) playground_ptr; playground_ptr += sizeof (struct grub_acpi_rsdp_v20); - grub_memcpy (&(rsdpv2_new->rsdpv1.signature), "RSD PTR ", + grub_memcpy (&(rsdpv2_new->rsdpv1.signature), "RSD PTR ", sizeof (rsdpv2_new->rsdpv1.signature)); - grub_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid, + grub_memcpy (&(rsdpv2_new->rsdpv1.oemid), root_oemid, sizeof (rsdpv2_new->rsdpv1.oemid)); rsdpv2_new->rsdpv1.revision = rev2; rsdpv2_new->rsdpv1.rsdt_addr = PTR_TO_UINT32 (rsdt_addr); rsdpv2_new->rsdpv1.checksum = 0; - rsdpv2_new->rsdpv1.checksum = 1 + ~grub_byte_checksum + rsdpv2_new->rsdpv1.checksum = 1 + ~grub_byte_checksum (&(rsdpv2_new->rsdpv1), sizeof (rsdpv2_new->rsdpv1)); rsdpv2_new->length = sizeof (*rsdpv2_new); rsdpv2_new->xsdt_addr = PTR_TO_UINT64 (xsdt); rsdpv2_new->checksum = 0; - rsdpv2_new->checksum = 1 + ~grub_byte_checksum (rsdpv2_new, + rsdpv2_new->checksum = 1 + ~grub_byte_checksum (rsdpv2_new, rsdpv2_new->length); grub_dprintf ("acpi", "Generated ACPIv2 tables\n"); } @@ -465,7 +465,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, grub_err_t err; int i, mmapregion; int numoftables; - + /* Default values if no RSDP is found. */ rev1 = 1; rev2 = 3; @@ -473,7 +473,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, facs_addr = 0; playground = playground_ptr = 0; playground_size = 0; - + rsdp = (struct grub_acpi_rsdp_v10 *) grub_machine_acpi_get_rsdpv2 (); if (! rsdp) @@ -508,37 +508,37 @@ grub_cmd_acpi (struct grub_extcmd *cmd, rsdt = (struct grub_acpi_table_header *) UINT_TO_PTR (rsdp->rsdt_addr); /* Load host tables. */ for (entry_ptr = (grub_uint32_t *) (rsdt + 1); - entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt) + entry_ptr < (grub_uint32_t *) (((grub_uint8_t *) rsdt) + rsdt->length); entry_ptr++) { char signature[5]; struct efiemu_acpi_table *table; - struct grub_acpi_table_header *curtable + struct grub_acpi_table_header *curtable = (struct grub_acpi_table_header *) UINT_TO_PTR (*entry_ptr); signature[4] = 0; for (i = 0; i < 4;i++) signature[i] = grub_tolower (curtable->signature[i]); - + /* If it's FADT it contains addresses of DSDT and FACS. */ if (grub_strcmp (signature, "facp") == 0) { struct grub_acpi_table_header *dsdt; struct grub_acpi_fadt *fadt = (struct grub_acpi_fadt *) curtable; - /* Set root header variables to the same values + /* Set root header variables to the same values as FACP by default. */ - grub_memcpy (&root_oemid, &(fadt->hdr.oemid), + grub_memcpy (&root_oemid, &(fadt->hdr.oemid), sizeof (root_oemid)); - grub_memcpy (&root_oemtable, &(fadt->hdr.oemtable), + grub_memcpy (&root_oemtable, &(fadt->hdr.oemtable), sizeof (root_oemtable)); root_oemrev = fadt->hdr.oemrev; - grub_memcpy (&root_creator_id, &(fadt->hdr.creator_id), + grub_memcpy (&root_creator_id, &(fadt->hdr.creator_id), sizeof (root_creator_id)); root_creator_rev = fadt->hdr.creator_rev; /* Load DSDT if not excluded. */ - dsdt = (struct grub_acpi_table_header *) + dsdt = (struct grub_acpi_table_header *) UINT_TO_PTR (fadt->dsdt_addr); if (dsdt && (! exclude || ! grub_strword (exclude, "dsdt")) && (! load_only || grub_strword (load_only, "dsdt")) @@ -551,7 +551,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, free_tables (); grub_free (exclude); grub_free (load_only); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could allocate table"); } grub_memcpy (table_dsdt, dsdt, dsdt->length); @@ -560,7 +560,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, /* Save FACS address. FACS shouldn't be overridden. */ facs_addr = fadt->facs_addr; } - + /* Skip excluded tables. */ if (exclude && grub_strword (exclude, signature)) continue; @@ -570,15 +570,15 @@ grub_cmd_acpi (struct grub_extcmd *cmd, /* Sanity check. */ if (curtable->length < sizeof (*curtable)) continue; - - table = (struct efiemu_acpi_table *) grub_malloc + + table = (struct efiemu_acpi_table *) grub_malloc (sizeof (struct efiemu_acpi_table)); if (! table) { free_tables (); grub_free (exclude); grub_free (load_only); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could allocate table structure"); } table->size = curtable->length; @@ -587,7 +587,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, if (! table->addr) { free_tables (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could allocate table"); } table->next = acpi_tables; @@ -595,7 +595,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, grub_memcpy (table->addr, curtable, table->size); } grub_free (exclude); - grub_free (load_only); + grub_free (load_only); } /* Does user specify versions to generate? */ @@ -647,7 +647,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, { grub_file_close (file); free_tables (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't read file %s", args[i]); } @@ -657,9 +657,9 @@ grub_cmd_acpi (struct grub_extcmd *cmd, free_tables (); return grub_error (GRUB_ERR_BAD_OS, "couldn't read file %s", args[i]); } - grub_file_close (file); + grub_file_close (file); - if (grub_memcmp (((struct grub_acpi_table_header *) buf)->signature, + if (grub_memcmp (((struct grub_acpi_table_header *) buf)->signature, "DSDT", 4) == 0) { grub_free (table_dsdt); @@ -669,12 +669,12 @@ grub_cmd_acpi (struct grub_extcmd *cmd, else { struct efiemu_acpi_table *table; - table = (struct efiemu_acpi_table *) grub_malloc + table = (struct efiemu_acpi_table *) grub_malloc (sizeof (struct efiemu_acpi_table)); if (! table) { free_tables (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could allocate table structure"); } @@ -698,15 +698,15 @@ grub_cmd_acpi (struct grub_extcmd *cmd, playground_size += sizeof (struct grub_acpi_table_header) + 8 * numoftables; /* RSDPv2. */ playground_size += sizeof (struct grub_acpi_rsdp_v20); - - playground = playground_ptr + + playground = playground_ptr = grub_mmap_malign_and_register (1, playground_size, &mmapregion, GRUB_MACHINE_MEMORY_ACPI, 0); if (! playground) { free_tables (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't allocate space for ACPI tables"); } @@ -741,9 +741,9 @@ grub_cmd_acpi (struct grub_extcmd *cmd, struct grub_efi_guid acpi = GRUB_EFI_ACPI_TABLE_GUID; struct grub_efi_guid acpi20 = GRUB_EFI_ACPI_20_TABLE_GUID; - grub_efi_system_table->boot_services->install_configuration_table + grub_efi_system_table->boot_services->install_configuration_table (&acpi20, grub_acpi_get_rsdpv2 ()); - grub_efi_system_table->boot_services->install_configuration_table + grub_efi_system_table->boot_services->install_configuration_table (&acpi, grub_acpi_get_rsdpv1 ()); } #endif @@ -755,13 +755,13 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(acpi) { - cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, + cmd = grub_register_extcmd ("acpi", grub_cmd_acpi, GRUB_COMMAND_FLAG_BOTH, "acpi [-1|-2] [--exclude=table1,table2|" "--load-only=table1,table2] filename1 " " [filename2] [...]", "Load host acpi tables and tables " - "specified by arguments", + "specified by arguments", options); } diff --git a/commands/blocklist.c b/commands/blocklist.c index 2057291af..b457b7c39 100644 --- a/commands/blocklist.c +++ b/commands/blocklist.c @@ -39,7 +39,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), unsigned length); auto void NESTED_FUNC_ATTR print_blocklist (grub_disk_addr_t sector, unsigned num, unsigned offset, unsigned length); - + void NESTED_FUNC_ATTR read_blocklist (grub_disk_addr_t sector, unsigned offset, unsigned length) { @@ -51,7 +51,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), num_sectors++; return; } - + print_blocklist (start_sector, num_sectors, 0, 0); num_sectors = 0; } @@ -64,7 +64,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), else print_blocklist (sector, 0, offset, length); } - + void NESTED_FUNC_ATTR print_blocklist (grub_disk_addr_t sector, unsigned num, unsigned offset, unsigned length) { @@ -77,7 +77,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), if (offset != 0 || length != 0) grub_printf ("[%u-%u]", offset, offset + length); } - + if (argc < 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); @@ -91,7 +91,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), if (file->device->disk->partition) part_start = grub_partition_get_start (file->device->disk->partition); - + file->read_hook = read_blocklist; while (grub_file_read (file, buf, sizeof (buf)) > 0) @@ -99,7 +99,7 @@ grub_cmd_blocklist (grub_command_t cmd __attribute__ ((unused)), if (num_sectors > 0) print_blocklist (start_sector, num_sectors, 0, 0); - + grub_file_close (file); return grub_errno; diff --git a/commands/boot.c b/commands/boot.c index 40ee9f8c4..e77b5ceb8 100644 --- a/commands/boot.c +++ b/commands/boot.c @@ -38,7 +38,7 @@ struct grub_preboot_t }; static int grub_loader_loaded; -static struct grub_preboot_t *preboots_head = 0, +static struct grub_preboot_t *preboots_head = 0, *preboots_tail = 0; int @@ -58,7 +58,7 @@ grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noreturn), if (! preboot_func && ! preboot_rest_func) return 0; - new_preboot = (struct grub_preboot_t *) + new_preboot = (struct grub_preboot_t *) grub_malloc (sizeof (struct grub_preboot_t)); if (! new_preboot) { @@ -92,7 +92,7 @@ grub_loader_register_preboot_hook (grub_err_t (*preboot_func) (int noreturn), return new_preboot; } -void +void grub_loader_unregister_preboot_hook (void *hnd) { struct grub_preboot_t *preb = hnd; @@ -116,11 +116,11 @@ grub_loader_set (grub_err_t (*boot) (void), { if (grub_loader_loaded && grub_loader_unload_func) grub_loader_unload_func (); - + grub_loader_boot_func = boot; grub_loader_unload_func = unload; grub_loader_noreturn = noreturn; - + grub_loader_loaded = 1; } @@ -129,7 +129,7 @@ grub_loader_unset(void) { if (grub_loader_loaded && grub_loader_unload_func) grub_loader_unload_func (); - + grub_loader_boot_func = 0; grub_loader_unload_func = 0; @@ -161,7 +161,7 @@ grub_loader_boot (void) err = (grub_loader_boot_func) (); for (cur = preboots_tail; cur; cur = cur->prev) - if (! err) + if (! err) err = cur->preboot_rest_func (); else cur->preboot_rest_func (); diff --git a/commands/cat.c b/commands/cat.c index f2d5f1c1a..1a2374360 100644 --- a/commands/cat.c +++ b/commands/cat.c @@ -41,16 +41,16 @@ grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)), file = grub_gzfile_open (args[0], 1); if (! file) return 0; - + while ((size = grub_file_read (file, buf, sizeof (buf))) > 0 && key != GRUB_TERM_ESC) { int i; - + for (i = 0; i < size; i++) { unsigned char c = buf[i]; - + if ((grub_isprint (c) || grub_isspace (c)) && c != '\r') grub_putchar (c); else @@ -69,7 +69,7 @@ grub_cmd_cat (grub_command_t cmd __attribute__ ((unused)), grub_putchar ('\n'); grub_refresh (); grub_file_close (file); - + return 0; } diff --git a/commands/cmp.c b/commands/cmp.c index b5d4f8dac..1258b1d63 100644 --- a/commands/cmp.c +++ b/commands/cmp.c @@ -49,7 +49,7 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), goto cleanup; if (grub_file_size (file1) != grub_file_size (file2)) - grub_printf ("Differ in size: %llu [%s], %llu [%s]\n", + grub_printf ("Differ in size: %llu [%s], %llu [%s]\n", (unsigned long long) grub_file_size (file1), args[0], (unsigned long long) grub_file_size (file2), args[1]); else @@ -58,14 +58,14 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), buf1 = grub_malloc (BUFFER_SIZE); buf2 = grub_malloc (BUFFER_SIZE); - + if (! buf1 || ! buf2) goto cleanup; - + do { int i; - + rd1 = grub_file_read (file1, buf1, BUFFER_SIZE); rd2 = grub_file_read (file2, buf2, BUFFER_SIZE); @@ -83,15 +83,15 @@ grub_cmd_cmp (grub_command_t cmd __attribute__ ((unused)), } } pos += BUFFER_SIZE; - + } while (rd2); - + grub_printf ("The files are identical.\n"); } cleanup: - + if (buf1) grub_free (buf1); if (buf2) diff --git a/commands/echo.c b/commands/echo.c index f3b5f873d..eb250052f 100644 --- a/commands/echo.c +++ b/commands/echo.c @@ -90,7 +90,7 @@ grub_cmd_echo (grub_extcmd_t cmd, int argc, char **args) arg++; continue; } - + /* This was not an escaped character, or escaping is not enabled. */ grub_printf ("%c", *arg); diff --git a/commands/efi/acpi.c b/commands/efi/acpi.c index 443f74953..93a560d9c 100644 --- a/commands/efi/acpi.c +++ b/commands/efi/acpi.c @@ -34,7 +34,7 @@ grub_machine_acpi_get_rsdpv1 (void) &grub_efi_system_table->configuration_table[i].vendor_guid; if (! grub_memcmp (guid, &acpi_guid, sizeof (grub_efi_guid_t))) - return (struct grub_acpi_rsdp_v10 *) + return (struct grub_acpi_rsdp_v10 *) grub_efi_system_table->configuration_table[i].vendor_table; } return 0; @@ -52,7 +52,7 @@ grub_machine_acpi_get_rsdpv2 (void) &grub_efi_system_table->configuration_table[i].vendor_guid; if (! grub_memcmp (guid, &acpi20_guid, sizeof (grub_efi_guid_t))) - return (struct grub_acpi_rsdp_v20 *) + return (struct grub_acpi_rsdp_v20 *) grub_efi_system_table->configuration_table[i].vendor_table; } return 0; diff --git a/commands/gptsync.c b/commands/gptsync.c index 73dafdeb3..600309f70 100644 --- a/commands/gptsync.c +++ b/commands/gptsync.c @@ -30,33 +30,33 @@ /* Convert a LBA address to a CHS address in the INT 13 format. */ /* Taken from grub1. */ -/* XXX: use hardcoded geometry of C = 1024, H = 255, S = 63. +/* XXX: use hardcoded geometry of C = 1024, H = 255, S = 63. Is it a problem? */ -static void -lba_to_chs (int lba, grub_uint8_t *cl, grub_uint8_t *ch, +static void +lba_to_chs (int lba, grub_uint8_t *cl, grub_uint8_t *ch, grub_uint8_t *dh) { int cylinder, head, sector; int sectors = 63, heads = 255, cylinders = 1024; - + sector = lba % sectors + 1; head = (lba / sectors) % heads; cylinder = lba / (sectors * heads); - + if (cylinder >= cylinders) { *cl = *ch = *dh = 0xff; return; } - + *cl = sector | ((cylinder & 0x300) >> 2); *ch = cylinder & 0xFF; *dh = head; } static grub_err_t -grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), +grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { grub_device_t dev; @@ -74,11 +74,11 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') { args[0][grub_strlen (args[0]) - 1] = 0; - dev = grub_device_open (args[0] + 1); + dev = grub_device_open (args[0] + 1); args[0][grub_strlen (args[0])] = ')'; } else - dev = grub_device_open (args[0]); + dev = grub_device_open (args[0]); if (! dev) return grub_errno; @@ -99,7 +99,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), /* Check if it is valid. */ if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) { - grub_device_close (dev); + grub_device_close (dev); return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); } @@ -109,7 +109,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), grub_device_close (dev); return grub_error (GRUB_ERR_BAD_PART_TABLE, "no GPT partition map found"); } - + int i; first_sector = dev->disk->total_sectors; for (i = 1; i < argc; i++) @@ -128,19 +128,19 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), if (separator) *separator = csep; if (! partition) - { + { grub_device_close (dev); return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no such partition"); } if (partition->start + partition->len > 0xffffffff) - { + { grub_device_close (dev); - return grub_error (GRUB_ERR_OUT_OF_RANGE, + return grub_error (GRUB_ERR_OUT_OF_RANGE, "only partitions resding in the first 2TB " "can be presen in hybrid MBR"); } - + if (first_sector > partition->start) first_sector = partition->start; @@ -182,17 +182,17 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), if (numactive == 2) { grub_device_close (dev); - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return grub_error (GRUB_ERR_BAD_ARGUMENT, "only one partition can be active"); } } mbr.entries[i].type = type; mbr.entries[i].start = grub_cpu_to_le32 (partition->start); - lba_to_chs (partition->start, + lba_to_chs (partition->start, &(mbr.entries[i].start_sector), &(mbr.entries[i].start_cylinder), &(mbr.entries[i].start_head)); - lba_to_chs (partition->start + partition->len - 1, + lba_to_chs (partition->start + partition->len - 1, &(mbr.entries[i].end_sector), &(mbr.entries[i].end_cylinder), &(mbr.entries[i].end_head)); @@ -210,11 +210,11 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), mbr.entries[0].flag = 0; mbr.entries[0].type = GRUB_PC_PARTITION_TYPE_GPT_DISK; mbr.entries[0].start = grub_cpu_to_le32 (1); - lba_to_chs (1, + lba_to_chs (1, &(mbr.entries[0].start_sector), &(mbr.entries[0].start_cylinder), &(mbr.entries[0].start_head)); - lba_to_chs (first_sector, + lba_to_chs (first_sector, &(mbr.entries[0].end_sector), &(mbr.entries[0].end_cylinder), &(mbr.entries[0].end_head)); @@ -239,8 +239,8 @@ static grub_command_t cmd; GRUB_MOD_INIT(gptsync) { (void) mod; /* To stop warning. */ - cmd = grub_register_command ("gptsync", grub_cmd_gptsync, - "gptsync DEVICE [PARTITION[+/-[TYPE]]] ...", + cmd = grub_register_command ("gptsync", grub_cmd_gptsync, + "gptsync DEVICE [PARTITION[+/-[TYPE]]] ...", "Fill hybrid MBR of GPT drive DEVICE. " "specified partitions will be a part " "of hybrid mbr. Up to 3 partitions are " diff --git a/commands/help.c b/commands/help.c index 6159a6333..c18ec6b83 100644 --- a/commands/help.c +++ b/commands/help.c @@ -28,7 +28,7 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc, { int cnt = 0; char *currarg; - + auto int print_command_info (grub_command_t cmd); auto int print_command_help (grub_command_t cmd); @@ -61,7 +61,7 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc, { if (cnt++ > 0) grub_printf ("\n\n"); - + if (cmd->flags & GRUB_COMMAND_FLAG_EXTCMD) grub_arg_show_help ((grub_extcmd_t) cmd->data); else @@ -71,20 +71,20 @@ grub_cmd_help (grub_extcmd_t ext __attribute__ ((unused)), int argc, } return 0; } - + if (argc == 0) grub_command_iterate (print_command_info); else { int i; - + for (i = 0; i < argc; i++) { currarg = args[i]; grub_command_iterate (print_command_help); } } - + return 0; } diff --git a/commands/i386/pc/acpi.c b/commands/i386/pc/acpi.c index e02cf4960..88e4f55cf 100644 --- a/commands/i386/pc/acpi.c +++ b/commands/i386/pc/acpi.c @@ -26,7 +26,7 @@ grub_machine_acpi_get_rsdpv1 (void) int ebda_len; grub_uint8_t *ebda, *ptr; - grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); ebda_len = * (grub_uint16_t *) ebda; if (! ebda_len) @@ -37,7 +37,7 @@ grub_machine_acpi_get_rsdpv1 (void) && ((struct grub_acpi_rsdp_v10 *) ptr)->revision == 0) return (struct grub_acpi_rsdp_v10 *) ptr; - grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; ptr += 16) if (grub_memcmp (ptr, "RSD PTR ", 8) == 0 @@ -53,7 +53,7 @@ grub_machine_acpi_get_rsdpv2 (void) int ebda_len; grub_uint8_t *ebda, *ptr; - grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); + grub_dprintf ("acpi", "Looking for RSDP. Scanning EBDA\n"); ebda = (grub_uint8_t *) ((* ((grub_uint16_t *) 0x40e)) << 4); ebda_len = * (grub_uint16_t *) ebda; if (! ebda_len) @@ -67,7 +67,7 @@ grub_machine_acpi_get_rsdpv2 (void) == 0) return (struct grub_acpi_rsdp_v20 *) ptr; - grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); + grub_dprintf ("acpi", "Looking for RSDP. Scanning BIOS\n"); for (ptr = (grub_uint8_t *) 0xe0000; ptr < (grub_uint8_t *) 0x100000; ptr += 16) if (grub_memcmp (ptr, "RSD PTR ", 8) == 0 diff --git a/commands/i386/pc/drivemap.c b/commands/i386/pc/drivemap.c index 898fb5167..aeb354f1b 100644 --- a/commands/i386/pc/drivemap.c +++ b/commands/i386/pc/drivemap.c @@ -184,7 +184,7 @@ list_mappings (void) { grub_printf ("%cD #%-3u (0x%02x) %cd%d\n", (curnode->newdrive & 0x80) ? 'H' : 'F', - curnode->newdrive & 0x7F, curnode->newdrive, + curnode->newdrive & 0x7F, curnode->newdrive, (curnode->redirto & 0x80) ? 'h' : 'f', curnode->redirto & 0x7F ); diff --git a/commands/i386/pc/play.c b/commands/i386/pc/play.c index f9512cee5..0c0301aab 100644 --- a/commands/i386/pc/play.c +++ b/commands/i386/pc/play.c @@ -171,7 +171,7 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), sizeof (struct note)) == sizeof (struct note) && buf.pitch != T_FINE && grub_checkkey () < 0) { - + grub_dprintf ("play", "pitch = %d, duration = %d\n", buf.pitch, buf.duration); diff --git a/commands/i386/pc/vbeinfo.c b/commands/i386/pc/vbeinfo.c index 3c397a14d..ee9f3c186 100644 --- a/commands/i386/pc/vbeinfo.c +++ b/commands/i386/pc/vbeinfo.c @@ -66,14 +66,14 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)), p = video_mode_list = real2pm (controller_info.video_mode_ptr); while (*p++ != 0xFFFF) ; - + video_mode_list_size = (grub_addr_t) p - (grub_addr_t) video_mode_list; saved_video_mode_list = grub_malloc (video_mode_list_size); if (! saved_video_mode_list) return grub_errno; grub_memcpy (saved_video_mode_list, video_mode_list, video_mode_list_size); - + grub_printf ("List of compatible video modes:\n"); grub_printf ("Legend: P=Packed pixel, D=Direct color, " "mask/pos=R/G/B/reserved\n"); @@ -83,7 +83,7 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)), { const char *memory_model = 0; grub_uint32_t mode = (grub_uint32_t) *p; - + err = grub_vbe_get_video_mode_info (mode, &mode_info_tmp); if (err != GRUB_ERR_NONE) { @@ -127,7 +127,7 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)), if (! memory_model) continue; - grub_printf ("0x%03x: %4d x %4d x %2d %s", + grub_printf ("0x%03x: %4d x %4d x %2d %s", mode, mode_info_tmp.x_resolution, mode_info_tmp.y_resolution, @@ -149,7 +149,7 @@ grub_cmd_vbeinfo (grub_command_t cmd __attribute__ ((unused)), } grub_free (saved_video_mode_list); - + /* Check existence of vbe_mode environment variable. */ modevar = grub_env_get ("vbe_mode"); diff --git a/commands/i386/pc/vbetest.c b/commands/i386/pc/vbetest.c index bfcf215d0..3cbc3014c 100644 --- a/commands/i386/pc/vbetest.c +++ b/commands/i386/pc/vbetest.c @@ -73,7 +73,7 @@ grub_cmd_vbetest (grub_command_t cmd __attribute__ ((unused)), grub_printf ("Old video mode = %04x\n", old_mode); else grub_errno = GRUB_ERR_NONE; - + /* Check existence of vbe_mode environment variable. */ modevar = grub_env_get ("vbe_mode"); if (modevar != 0) @@ -90,7 +90,7 @@ grub_cmd_vbetest (grub_command_t cmd __attribute__ ((unused)), err = grub_vbe_get_video_mode_info (use_mode, &mode_info); if (err != GRUB_ERR_NONE) return err; - + /* Dump out details about the mode being tested. */ grub_printf ("mode: 0x%03x\n", use_mode); diff --git a/commands/loadenv.c b/commands/loadenv.c index 1c2020b30..22665f9fe 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -51,7 +51,7 @@ open_envblk_file (char *filename) filename = grub_malloc (len + 1 + sizeof (GRUB_ENVBLK_DEFCFG)); if (! filename) return 0; - + grub_strcpy (filename, prefix); filename[len] = '/'; grub_strcpy (filename + len + 1, GRUB_ENVBLK_DEFCFG); @@ -80,7 +80,7 @@ read_envblk_file (grub_file_t file) buf = grub_malloc (size); if (! buf) return 0; - + while (size > 0) { grub_ssize_t ret; @@ -124,7 +124,7 @@ grub_cmd_load_env (grub_extcmd_t cmd, grub_env_set (name, value); return 0; } - + file = open_envblk_file ((state[0].set) ? state[0].arg : 0); if (! file) return grub_errno; @@ -135,7 +135,7 @@ grub_cmd_load_env (grub_extcmd_t cmd, grub_envblk_iterate (envblk, set_var); grub_envblk_close (envblk); - + fail: grub_file_close (file); return grub_errno; @@ -157,7 +157,7 @@ grub_cmd_list_env (grub_extcmd_t cmd, grub_printf ("%s=%s\n", name, value); return 0; } - + file = open_envblk_file ((state[0].set) ? state[0].arg : 0); if (! file) return grub_errno; @@ -168,7 +168,7 @@ grub_cmd_list_env (grub_extcmd_t cmd, grub_envblk_iterate (envblk, print_var); grub_envblk_close (envblk); - + fail: grub_file_close (file); return grub_errno; @@ -205,7 +205,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, grub_disk_addr_t part_start; struct blocklist *p; char *buf; - + /* Sanity checks. */ total_length = 0; for (p = blocklists; p; p = p->next) @@ -222,10 +222,10 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, return 0; } } - + total_length += p->length; } - + if (total_length != grub_file_size (file)) { /* Maybe sparse, unallocated sectors. No way in GRUB. */ @@ -245,7 +245,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, for (p = blocklists, index = 0; p; p = p->next, index += p->length) { char blockbuf[GRUB_DISK_SECTOR_SIZE]; - + if (grub_disk_read (disk, p->sector - part_start, p->offset, p->length, blockbuf)) return 0; @@ -269,7 +269,7 @@ write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, grub_disk_addr_t part_start; struct blocklist *p; grub_size_t index; - + buf = grub_envblk_buffer (envblk); disk = file->device->disk; if (disk->partition) @@ -296,7 +296,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) grub_envblk_t envblk; struct blocklist *head = 0; struct blocklist *tail = 0; - + /* Store blocklists in a linked list. */ auto void NESTED_FUNC_ATTR read_hook (grub_disk_addr_t sector, unsigned offset, @@ -309,7 +309,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) if (offset + length > GRUB_DISK_SECTOR_SIZE) /* Seemingly a bug. */ return; - + block = grub_malloc (sizeof (*block)); if (! block) return; @@ -348,7 +348,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) if (! check_blocklists (envblk, head, file)) goto fail; - + while (argc) { char *value; @@ -368,7 +368,7 @@ grub_cmd_save_env (grub_extcmd_t cmd, int argc, char **args) } write_blocklists (envblk, head, file); - + fail: if (envblk) grub_envblk_close (envblk); diff --git a/commands/ls.c b/commands/ls.c index fb38fab99..15b4c6bab 100644 --- a/commands/ls.c +++ b/commands/ls.c @@ -51,10 +51,10 @@ grub_ls_list_devices (int longlist) grub_normal_print_device_info (name); else grub_printf ("(%s) ", name); - + return 0; } - + grub_device_iterate (grub_ls_print_devices); grub_putchar ('\n'); grub_refresh (); @@ -70,20 +70,20 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) const char *path; grub_device_t dev; - auto int print_files (const char *filename, + auto int print_files (const char *filename, const struct grub_dirhook_info *info); - auto int print_files_long (const char *filename, + auto int print_files_long (const char *filename, const struct grub_dirhook_info *info); - + int print_files (const char *filename, const struct grub_dirhook_info *info) { if (all || filename[0] != '.') grub_printf ("%s%s ", filename, info->dir ? "/" : ""); - + return 0; } - - int print_files_long (const char *filename, + + int print_files_long (const char *filename, const struct grub_dirhook_info *info) { char pathname[grub_strlen (dirname) + grub_strlen (filename) + 1]; @@ -94,7 +94,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) if (! info->dir) { grub_file_t file; - + if (dirname[grub_strlen (dirname) - 1] == '/') grub_sprintf (pathname, "%s%s", dirname, filename); else @@ -117,7 +117,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) int fsz = file->size; int units = 0; char buf[20]; - + while (fsz / 1024) { fsize = (fsize + 512) / 1024; @@ -136,7 +136,7 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) } else grub_printf ("%-12llu", (unsigned long long) file->size); - + } grub_file_close (file); } @@ -150,13 +150,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) if (human) grub_printf (" %d-%02d-%02d %02d:%02d:%02d %-11s ", datetime.year, datetime.month, datetime.day, - datetime.hour, datetime.minute, + datetime.hour, datetime.minute, datetime.second, grub_get_weekday_name (&datetime)); else grub_printf (" %04d%02d%02d%02d%02d%02d ", - datetime.year, datetime.month, - datetime.day, datetime.hour, + datetime.year, datetime.month, + datetime.day, datetime.hour, datetime.minute, datetime.second); } grub_printf ("%s%s\n", filename, info->dir ? "/" : ""); @@ -175,13 +175,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) path = dirname; else path++; - + if (! path && ! device_name) { grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid argument"); goto fail; } - + if (! *path) { if (grub_errno == GRUB_ERR_UNKNOWN_FS) @@ -204,13 +204,13 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) grub_file_t file; struct grub_dirhook_info info; grub_errno = 0; - + file = grub_file_open (dirname); if (! file) goto fail; - + grub_file_close (file); - + p = grub_strrchr (dirname, '/') + 1; dirname = grub_strndup (dirname, p - dirname); if (! dirname) @@ -228,14 +228,14 @@ grub_ls_list_files (char *dirname, int longlist, int all, int human) if (grub_errno == GRUB_ERR_NONE) grub_putchar ('\n'); - + grub_refresh (); } fail: if (dev) grub_device_close (dev); - + grub_free (device_name); return 0; diff --git a/commands/parttool.c b/commands/parttool.c index 58751ca2f..c807f066b 100644 --- a/commands/parttool.c +++ b/commands/parttool.c @@ -38,8 +38,8 @@ static char helpmsg[] = "Use \"parttool PARTITION help\" for the list " "of available commands"; -int -grub_parttool_register(const char *part_name, +int +grub_parttool_register(const char *part_name, const grub_parttool_function_t func, const struct grub_parttool_argdesc *args) { @@ -55,11 +55,11 @@ grub_parttool_register(const char *part_name, cur->handle = curhandle++; for (nargs = 0; args[nargs].name != 0; nargs++); cur->nargs = nargs; - cur->args = (struct grub_parttool_argdesc *) + cur->args = (struct grub_parttool_argdesc *) grub_malloc ((nargs + 1) * sizeof (struct grub_parttool_argdesc)); - grub_memcpy (cur->args, args, + grub_memcpy (cur->args, args, (nargs + 1) * sizeof (struct grub_parttool_argdesc)); - + cur->func = func; parts = cur; return cur->handle; @@ -113,22 +113,22 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), for (curarg = cur->args; curarg->name; curarg++) { int spacing = 20; - + spacing -= grub_strlen (curarg->name); grub_printf ("%s", curarg->name); - + switch (curarg->type) { case GRUB_PARTTOOL_ARG_BOOL: grub_printf ("+/-"); spacing -= 3; break; - - case GRUB_PARTTOOL_ARG_VAL: + + case GRUB_PARTTOOL_ARG_VAL: grub_printf ("=VAL"); spacing -= 4; break; - + case GRUB_PARTTOOL_ARG_END: break; } @@ -138,7 +138,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), } } if (! found) - grub_printf ("Sorry no parttool is available for %s\n", + grub_printf ("Sorry no parttool is available for %s\n", dev->disk->partition->partmap->name); return GRUB_ERR_NONE; } @@ -152,11 +152,11 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), if (args[0][0] == '(' && args[0][grub_strlen (args[0]) - 1] == ')') { args[0][grub_strlen (args[0]) - 1] = 0; - dev = grub_device_open (args[0] + 1); + dev = grub_device_open (args[0] + 1); args[0][grub_strlen (args[0]) - 1] = ')'; } else - dev = grub_device_open (args[0]); + dev = grub_device_open (args[0]); if (! dev) return grub_errno; @@ -186,7 +186,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), if (filename) { grub_file_t file; - + grub_sprintf (filename, "%s/parttool.lst", prefix); file = grub_file_open (filename); if (file) @@ -197,36 +197,36 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), char *p, *name; buf = grub_file_getline (file); - + if (! buf) break; - + name = buf; if (! grub_isgraph (name[0])) continue; - + p = grub_strchr (name, ':'); if (! p) continue; - + *p = '\0'; while (*++p == ' ') ; if (! grub_isgraph (*p)) continue; - + if (grub_strcmp (name, dev->disk->partition->partmap->name) != 0) continue; - + grub_dl_load (p); } - + grub_file_close (file); } - + grub_free (filename); } } @@ -254,15 +254,15 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), if (grub_strcmp (dev->disk->partition->partmap->name, cur->name) == 0) { for (curarg = cur->args; curarg->name; curarg++) - if (grub_strncmp (curarg->name, args[i], + if (grub_strncmp (curarg->name, args[i], grub_strlen (curarg->name)) == 0 - && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL - && (args[i][grub_strlen (curarg->name)] == '+' + && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL + && (args[i][grub_strlen (curarg->name)] == '+' || args[i][grub_strlen (curarg->name)] == '-' || args[i][grub_strlen (curarg->name)] == 0)) || (curarg->type == GRUB_PARTTOOL_ARG_VAL && args[i][grub_strlen (curarg->name)] == '='))) - + break; if (curarg->name) break; @@ -271,18 +271,18 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised argument %s", args[i]); ptool = cur; - pargs = (struct grub_parttool_args *) + pargs = (struct grub_parttool_args *) grub_malloc (ptool->nargs * sizeof (struct grub_parttool_args)); - grub_memset (pargs, 0, + grub_memset (pargs, 0, ptool->nargs * sizeof (struct grub_parttool_args)); for (j = i; j < argc; j++) if (! parsed[j]) { for (curarg = ptool->args; curarg->name; curarg++) - if (grub_strncmp (curarg->name, args[i], + if (grub_strncmp (curarg->name, args[i], grub_strlen (curarg->name)) == 0 - && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL - && (args[j][grub_strlen (curarg->name)] == '+' + && ((curarg->type == GRUB_PARTTOOL_ARG_BOOL + && (args[j][grub_strlen (curarg->name)] == '+' || args[j][grub_strlen (curarg->name)] == '-' || args[j][grub_strlen (curarg->name)] == 0)) || (curarg->type == GRUB_PARTTOOL_ARG_VAL @@ -293,15 +293,15 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), switch (curarg->type) { case GRUB_PARTTOOL_ARG_BOOL: - pargs[curarg - ptool->args].bool + pargs[curarg - ptool->args].bool = (args[j][grub_strlen (curarg->name)] != '-'); break; case GRUB_PARTTOOL_ARG_VAL: - pargs[curarg - ptool->args].str + pargs[curarg - ptool->args].str = (args[j] + grub_strlen (curarg->name) + 1); break; - + case GRUB_PARTTOOL_ARG_END: break; } @@ -324,8 +324,8 @@ static grub_command_t cmd; GRUB_MOD_INIT(parttool) { mymod = mod; - cmd = grub_register_command ("parttool", grub_cmd_parttool, - "parttool PARTITION COMMANDS", + cmd = grub_register_command ("parttool", grub_cmd_parttool, + "parttool PARTITION COMMANDS", helpmsg); } diff --git a/commands/search.c b/commands/search.c index 301b663e5..cfcc6b959 100644 --- a/commands/search.c +++ b/commands/search.c @@ -42,7 +42,7 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) { int count = 0; auto int iterate_device (const char *name); - + int iterate_device (const char *name) { grub_device_t dev; @@ -53,12 +53,12 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') return 0; - + dev = grub_device_open (name); if (dev) { grub_fs_t fs; - + fs = grub_fs_probe (dev); #define QUID(x) (is_uuid ? (x)->uuid : (x)->label) @@ -66,7 +66,7 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) if (fs && QUID(fs)) { char *quid; - + (QUID(fs)) (dev, &quid); if (grub_errno == GRUB_ERR_NONE && quid) { @@ -82,20 +82,20 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) else grub_printf (" %s", name); } - + grub_free (quid); } } - + grub_device_close (dev); } - + grub_errno = GRUB_ERR_NONE; return abort; } - + grub_device_iterate (iterate_device); - + if (count == 0) grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key); } @@ -113,13 +113,13 @@ search_file (const char *key, const char *var, int no_floppy) char *p; grub_file_t file; int abort = 0; - + /* Skip floppy drives when requested. */ if (no_floppy && name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') return 0; - + len = grub_strlen (name) + 2 + grub_strlen (key) + 1; p = grub_realloc (buf, len); if (! p) @@ -127,7 +127,7 @@ search_file (const char *key, const char *var, int no_floppy) buf = p; grub_sprintf (buf, "(%s)%s", name, key); - + file = grub_file_open (buf); if (file) { @@ -143,15 +143,15 @@ search_file (const char *key, const char *var, int no_floppy) grub_file_close (file); } - + grub_errno = GRUB_ERR_NONE; return abort; } - + grub_device_iterate (iterate_device); - + grub_free (buf); - + if (grub_errno == GRUB_ERR_NONE && count == 0) grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device"); } @@ -161,13 +161,13 @@ grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) { struct grub_arg_list *state = cmd->state; const char *var = 0; - + if (argc == 0) return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified"); if (state[3].set) var = state[3].arg ? state[3].arg : "root"; - + if (state[1].set) search_fs (args[0], var, state[4].set, 0); else if (state[2].set) diff --git a/commands/test.c b/commands/test.c index bbeeed0e8..26df8b5c5 100644 --- a/commands/test.c +++ b/commands/test.c @@ -63,9 +63,9 @@ test_parse (char **args, int *argn, int argc) grub_device_t dev; /* A hook for iterating directories. */ - auto int find_file (const char *cur_filename, + auto int find_file (const char *cur_filename, const struct grub_dirhook_info *info); - int find_file (const char *cur_filename, + int find_file (const char *cur_filename, const struct grub_dirhook_info *info) { if ((info->case_insensitive ? grub_strcasecmp (cur_filename, filename) @@ -77,7 +77,7 @@ test_parse (char **args, int *argn, int argc) } return 0; } - + file_exists = 0; device_name = grub_file_get_device_name (path); dev = grub_device_open (device_name); @@ -93,7 +93,7 @@ test_parse (char **args, int *argn, int argc) pathname = path; else pathname++; - + /* Remove trailing '/'. */ while (*pathname && pathname[grub_strlen (pathname) - 1] == '/') pathname[grub_strlen (pathname) - 1] = 0; @@ -132,7 +132,7 @@ test_parse (char **args, int *argn, int argc) else (fs->dir) (dev, path, find_file); - grub_device_close (dev); + grub_device_close (dev); grub_free (path); grub_free (device_name); } @@ -158,7 +158,7 @@ test_parse (char **args, int *argn, int argc) (*argn) += 3; continue; } - + /* GRUB extension: lexicographical sorting. */ if (grub_strcmp (args[*argn + 1], "<") == 0) { @@ -166,21 +166,21 @@ test_parse (char **args, int *argn, int argc) (*argn) += 3; continue; } - + if (grub_strcmp (args[*argn + 1], "<=") == 0) { update_val (grub_strcmp (args[*argn], args[*argn + 2]) <= 0); (*argn) += 3; continue; } - + if (grub_strcmp (args[*argn + 1], ">") == 0) { update_val (grub_strcmp (args[*argn], args[*argn + 2]) > 0); (*argn) += 3; continue; } - + if (grub_strcmp (args[*argn + 1], ">=") == 0) { update_val (grub_strcmp (args[*argn], args[*argn + 2]) >= 0); @@ -191,7 +191,7 @@ test_parse (char **args, int *argn, int argc) /* Number tests. */ if (grub_strcmp (args[*argn + 1], "-eq") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) + update_val (grub_strtosl (args[*argn], 0, 0) == grub_strtosl (args[*argn + 2], 0, 0)); (*argn) += 3; continue; @@ -199,15 +199,15 @@ test_parse (char **args, int *argn, int argc) if (grub_strcmp (args[*argn + 1], "-ge") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) + update_val (grub_strtosl (args[*argn], 0, 0) >= grub_strtosl (args[*argn + 2], 0, 0)); (*argn) += 3; continue; } - + if (grub_strcmp (args[*argn + 1], "-gt") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) + update_val (grub_strtosl (args[*argn], 0, 0) > grub_strtosl (args[*argn + 2], 0, 0)); (*argn) += 3; continue; @@ -215,55 +215,55 @@ test_parse (char **args, int *argn, int argc) if (grub_strcmp (args[*argn + 1], "-le") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) + update_val (grub_strtosl (args[*argn], 0, 0) <= grub_strtosl (args[*argn + 2], 0, 0)); (*argn) += 3; continue; } - + if (grub_strcmp (args[*argn + 1], "-lt") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) + update_val (grub_strtosl (args[*argn], 0, 0) < grub_strtosl (args[*argn + 2], 0, 0)); (*argn) += 3; continue; } - + if (grub_strcmp (args[*argn + 1], "-ne") == 0) { - update_val (grub_strtosl (args[*argn], 0, 0) + update_val (grub_strtosl (args[*argn], 0, 0) != grub_strtosl (args[*argn + 2], 0, 0)); (*argn) += 3; continue; } - /* GRUB extension: compare numbers skipping prefixes. + /* GRUB extension: compare numbers skipping prefixes. Useful for comparing versions. E.g. vmlinuz-2 -plt vmlinuz-11. */ if (grub_strcmp (args[*argn + 1], "-pgt") == 0 || grub_strcmp (args[*argn + 1], "-plt") == 0) { int i; /* Skip common prefix. */ - for (i = 0; args[*argn][i] == args[*argn + 2][i] + for (i = 0; args[*argn][i] == args[*argn + 2][i] && args[*argn][i]; i++); - + /* Go the digits back. */ i--; while (grub_isdigit (args[*argn][i]) && i > 0) i--; i++; - + if (grub_strcmp (args[*argn + 1], "-pgt") == 0) - update_val (grub_strtoul (args[*argn] + i, 0, 0) + update_val (grub_strtoul (args[*argn] + i, 0, 0) > grub_strtoul (args[*argn + 2] + i, 0, 0)); else - update_val (grub_strtoul (args[*argn] + i, 0, 0) + update_val (grub_strtoul (args[*argn] + i, 0, 0) < grub_strtoul (args[*argn + 2] + i, 0, 0)); (*argn) += 3; continue; } - /* -nt and -ot tests. GRUB extension: when doing -?t bias + /* -nt and -ot tests. GRUB extension: when doing -?t bias will be added to the first mtime. */ if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0 || grub_memcmp (args[*argn + 1], "-ot", 3) == 0) @@ -271,16 +271,16 @@ test_parse (char **args, int *argn, int argc) struct grub_dirhook_info file1; int file1exists; int bias = 0; - + /* Fetch fileinfo. */ get_fileinfo (args[*argn]); file1 = file_info; file1exists = file_exists; get_fileinfo (args[*argn + 2]); - + if (args[*argn + 1][3]) bias = grub_strtosl (args[*argn + 1] + 3, 0, 0); - + if (grub_memcmp (args[*argn + 1], "-nt", 3) == 0) update_val ((file1exists && ! file_exists) || (file1.mtimeset && file_info.mtimeset @@ -305,7 +305,7 @@ test_parse (char **args, int *argn, int argc) (*argn) += 2; return ret; } - + if (grub_strcmp (args[*argn], "-e") == 0) { get_fileinfo (args[*argn + 1]); @@ -322,7 +322,7 @@ test_parse (char **args, int *argn, int argc) (*argn) += 2; return ret; } - + if (grub_strcmp (args[*argn], "-s") == 0) { grub_file_t file; @@ -334,12 +334,12 @@ test_parse (char **args, int *argn, int argc) (*argn) += 2; return ret; } - + /* String tests. */ if (grub_strcmp (args[*argn], "-n") == 0) { update_val (args[*argn + 1][0]); - + (*argn) += 2; continue; } @@ -352,7 +352,7 @@ test_parse (char **args, int *argn, int argc) } /* Special modifiers. */ - + /* End of expression. return to parent. */ if (grub_strcmp (args[*argn], ")") == 0) { @@ -366,7 +366,7 @@ test_parse (char **args, int *argn, int argc) update_val (test_parse (args, argn, argc)); continue; } - + if (grub_strcmp (args[*argn], "!") == 0) { invert = ! invert; @@ -404,7 +404,7 @@ grub_cmd_test (grub_command_t cmd __attribute__ ((unused)), if (argc >= 1 && grub_strcmp (args[argc - 1], "]") == 0) argc--; - return test_parse (args, &argn, argc) ? GRUB_ERR_NONE + return test_parse (args, &argn, argc) ? GRUB_ERR_NONE : grub_error (GRUB_ERR_TEST_FAILURE, "false"); } diff --git a/commands/usbtest.c b/commands/usbtest.c index 019d3fe78..018c1a25b 100644 --- a/commands/usbtest.c +++ b/commands/usbtest.c @@ -51,7 +51,7 @@ static const char *usb_endp_type[] = "Interrupt" }; -static const char *usb_devspeed[] = +static const char *usb_devspeed[] = { "", "Low", @@ -84,7 +84,7 @@ usb_iterate (grub_usb_device_t dev) usb_print_str ("Product", dev, descdev->strprod); usb_print_str ("Vendor", dev, descdev->strvendor); usb_print_str ("Serial", dev, descdev->strserial); - + if (descdev->class > 0 && descdev->class <= 0x0E) grub_printf ("Class: (0x%02x) %s, Subclass: 0x%02x, Protocol: 0x%02x\n", descdev->class, usb_classes[descdev->class], diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 0af07f994..4a94443b6 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -162,7 +162,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/parttool.c parttool/pcpart.c \ grub_emu_init.c -grub_emu_LDFLAGS = $(LIBCURSES) +grub_emu_LDFLAGS = $(LIBCURSES) ifeq ($(enable_grub_emu_usb), yes) grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 8b5be2bba..6411111b4 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -33,7 +33,7 @@ sbin_UTILITIES = grub-mkdevicemap ifeq ($(enable_grub_emu), yes) sbin_UTILITIES += grub-emu endif - + # For grub-mkdevicemap. grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/devicemap.c util/misc.c @@ -144,7 +144,7 @@ multiboot_mod_SOURCES = loader/ieee1275/multiboot2.c \ loader/multiboot2.c \ loader/multiboot_loader.c multiboot_mod_CFLAGS = $(COMMON_CFLAGS) -multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) +multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) # For memdisk.mod. memdisk_mod_SOURCES = disk/memdisk.c diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index d16501bdc..d061416a2 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -66,7 +66,7 @@ endif # For grub-mkimage. grub_mkimage_SOURCES = util/sparc64/ieee1275/grub-mkimage.c util/misc.c \ - util/resolve.c + util/resolve.c # For grub-setup. util/sparc64/ieee1275/grub-setup.c_DEPENDENCIES = grub_setup_init.h diff --git a/configure.ac b/configure.ac index e29495a97..6757d4f1c 100644 --- a/configure.ac +++ b/configure.ac @@ -354,7 +354,7 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then ]) if test "x$grub_cv_cc_mcmodel" = xno; then CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1" - TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1" + TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1" AC_MSG_WARN([-mcmodel=large not supported. You wan't be able to use the memory over 4GiB. Upgrade your gcc]) else TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" @@ -451,7 +451,7 @@ LIBS="$tmp_LIBS" # # Memory manager debugging. -AC_ARG_ENABLE([mm-debug], +AC_ARG_ENABLE([mm-debug], AS_HELP_STRING([--enable-mm-debug], [include memory manager debugging]), [AC_DEFINE([MM_DEBUG], [1], diff --git a/disk/ata.c b/disk/ata.c index b186f6dc9..78d396526 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -357,7 +357,7 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) /* Try to detect if the port is in use by writing to it, waiting for a while and reading it again. If the value was preserved, there is a device connected. */ - grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A); + grub_ata_regset (dev, GRUB_ATA_REG_SECTORS, 0x5A); grub_ata_wait (); grub_uint8_t sec = grub_ata_regget (dev, GRUB_ATA_REG_SECTORS); grub_dprintf ("ata", "sectors=0x%x\n", sec); @@ -435,7 +435,7 @@ grub_ata_pciinit (int bus, int device, int func, bar2 = grub_pci_read (addr); /* Check if the BARs describe an IO region. */ - if ((bar1 & 1) && (bar2 & 1)) + if ((bar1 & 1) && (bar2 & 1)) { rega = bar1 & ~3; regb = bar2 & ~3; @@ -682,7 +682,7 @@ grub_ata_open (const char *name, grub_disk_t disk) disk->total_sectors = dev->size; disk->id = (unsigned long) dev; - + disk->has_partitions = 1; disk->data = dev; @@ -692,7 +692,7 @@ grub_ata_open (const char *name, grub_disk_t disk) static void grub_ata_close (grub_disk_t disk __attribute__((unused))) { - + } static grub_err_t @@ -841,7 +841,7 @@ static struct grub_scsi_dev grub_atapi_dev = .close = grub_atapi_close, .read = grub_atapi_read, .write = grub_atapi_write - }; + }; @@ -854,7 +854,7 @@ GRUB_MOD_INIT(ata) grub_disk_firmware_fini (); grub_disk_firmware_fini = NULL; } - + /* ATA initialization. */ grub_ata_initialize (); diff --git a/disk/efi/efidisk.c b/disk/efi/efidisk.c index 767ebf8ce..de848594a 100644 --- a/disk/efi/efidisk.c +++ b/disk/efi/efidisk.c @@ -51,7 +51,7 @@ duplicate_device_path (const grub_efi_device_path_t *dp) { grub_efi_device_path_t *p; grub_size_t total_size = 0; - + for (p = (grub_efi_device_path_t *) dp; ; p = GRUB_EFI_NEXT_DEVICE_PATH (p)) @@ -94,14 +94,14 @@ compare_device_paths (const grub_efi_device_path_t *dp1, if (! dp1 || ! dp2) /* Return non-zero. */ return 1; - + while (1) { grub_efi_uint8_t type1, type2; grub_efi_uint8_t subtype1, subtype2; grub_efi_uint16_t len1, len2; int ret; - + type1 = GRUB_EFI_DEVICE_PATH_TYPE (dp1); type2 = GRUB_EFI_DEVICE_PATH_TYPE (dp2); @@ -110,7 +110,7 @@ compare_device_paths (const grub_efi_device_path_t *dp1, subtype1 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp1); subtype2 = GRUB_EFI_DEVICE_PATH_SUBTYPE (dp2); - + if (subtype1 != subtype2) return (int) subtype1 - (int) subtype2; @@ -141,7 +141,7 @@ make_devices (void) grub_efi_handle_t *handles; grub_efi_handle_t *handle; struct grub_efidisk_data *devices = 0; - + /* Find handles which support the disk io interface. */ handles = grub_efi_locate_handle (GRUB_EFI_BY_PROTOCOL, &disk_io_guid, 0, &num_handles); @@ -156,7 +156,7 @@ make_devices (void) struct grub_efidisk_data *d; grub_efi_block_io_t *bio; grub_efi_disk_io_t *dio; - + dp = grub_efi_get_device_path (*handle); if (! dp) continue; @@ -165,7 +165,7 @@ make_devices (void) if (! ldp) /* This is empty. Why? */ continue; - + bio = grub_efi_open_protocol (*handle, &block_io_guid, GRUB_EFI_OPEN_PROTOCOL_GET_PROTOCOL); dio = grub_efi_open_protocol (*handle, &disk_io_guid, @@ -173,7 +173,7 @@ make_devices (void) if (! bio || ! dio) /* This should not happen... Why? */ continue; - + d = grub_malloc (sizeof (*d)); if (! d) { @@ -192,7 +192,7 @@ make_devices (void) } grub_free (handles); - + return devices; } @@ -203,7 +203,7 @@ find_parent_device (struct grub_efidisk_data *devices, { grub_efi_device_path_t *dp, *ldp; struct grub_efidisk_data *parent; - + dp = duplicate_device_path (d->device_path); if (! dp) return 0; @@ -219,13 +219,13 @@ find_parent_device (struct grub_efidisk_data *devices, /* Ignore itself. */ if (parent == d) continue; - + if (compare_device_paths (parent->device_path, dp) == 0) { /* Found. */ if (! parent->last_device_path) parent = 0; - + break; } } @@ -240,7 +240,7 @@ iterate_child_devices (struct grub_efidisk_data *devices, int (*hook) (struct grub_efidisk_data *child)) { struct grub_efidisk_data *p; - + for (p = devices; p; p = p->next) { grub_efi_device_path_t *dp, *ldp; @@ -248,13 +248,13 @@ iterate_child_devices (struct grub_efidisk_data *devices, dp = duplicate_device_path (p->device_path); if (! dp) return 0; - + ldp = find_last_device_path (dp); ldp->type = GRUB_EFI_END_DEVICE_PATH_TYPE; ldp->subtype = GRUB_EFI_END_ENTIRE_DEVICE_PATH_SUBTYPE; ldp->length[0] = sizeof (*ldp); ldp->length[1] = 0; - + if (compare_device_paths (dp, d->device_path) == 0) if (hook (p)) { @@ -304,7 +304,7 @@ static void name_devices (struct grub_efidisk_data *devices) { struct grub_efidisk_data *d; - + /* First, identify devices by media device paths. */ for (d = devices; d; d = d->next) { @@ -313,11 +313,11 @@ name_devices (struct grub_efidisk_data *devices) dp = d->last_device_path; if (! dp) continue; - + if (GRUB_EFI_DEVICE_PATH_TYPE (dp) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE) { int is_hard_drive = 0; - + switch (GRUB_EFI_DEVICE_PATH_SUBTYPE (dp)) { case GRUB_EFI_HARD_DRIVE_DEVICE_PATH_SUBTYPE: @@ -346,7 +346,7 @@ name_devices (struct grub_efidisk_data *devices) #endif add_device (&cd_devices, parent); } - + /* Mark the parent as used. */ parent->last_device_path = 0; } @@ -367,7 +367,7 @@ name_devices (struct grub_efidisk_data *devices) { grub_efi_device_path_t *dp; grub_efi_block_io_media_t *m; - + dp = d->last_device_path; if (! dp) continue; @@ -409,7 +409,7 @@ static void free_devices (struct grub_efidisk_data *devices) { struct grub_efidisk_data *p, *q; - + for (p = devices; p; p = q) { q = p->next; @@ -422,11 +422,11 @@ static void enumerate_disks (void) { struct grub_efidisk_data *devices; - + devices = make_devices (); if (! devices) return; - + name_devices (devices); free_devices (devices); } @@ -437,7 +437,7 @@ grub_efidisk_iterate (int (*hook) (const char *name)) struct grub_efidisk_data *d; char buf[16]; int count; - + for (d = fd_devices, count = 0; d; d = d->next, count++) { grub_sprintf (buf, "fd%d", count); @@ -445,7 +445,7 @@ grub_efidisk_iterate (int (*hook) (const char *name)) if (hook (buf)) return 1; } - + for (d = hd_devices, count = 0; d; d = d->next, count++) { grub_sprintf (buf, "hd%d", count); @@ -453,7 +453,7 @@ grub_efidisk_iterate (int (*hook) (const char *name)) if (hook (buf)) return 1; } - + for (d = cd_devices, count = 0; d; d = d->next, count++) { grub_sprintf (buf, "cd%d", count); @@ -506,7 +506,7 @@ grub_efidisk_open (const char *name, struct grub_disk *disk) grub_efi_block_io_media_t *m; grub_dprintf ("efidisk", "opening %s\n", name); - + num = get_drive_number (name); if (num < 0) return grub_errno; @@ -565,7 +565,7 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, grub_efi_disk_io_t *dio; grub_efi_block_io_t *bio; grub_efi_status_t status; - + d = disk->data; dio = d->disk_io; bio = d->block_io; @@ -573,14 +573,14 @@ grub_efidisk_read (struct grub_disk *disk, grub_disk_addr_t sector, grub_dprintf ("efidisk", "reading 0x%lx sectors at the sector 0x%llx from %s\n", (unsigned long) size, (unsigned long long) sector, disk->name); - + status = efi_call_5 (dio->read, dio, bio->media->media_id, (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS, (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS, buf); if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_READ_ERROR, "efidisk read error"); - + return GRUB_ERR_NONE; } @@ -593,22 +593,22 @@ grub_efidisk_write (struct grub_disk *disk, grub_disk_addr_t sector, grub_efi_disk_io_t *dio; grub_efi_block_io_t *bio; grub_efi_status_t status; - + d = disk->data; dio = d->disk_io; bio = d->block_io; - + grub_dprintf ("efidisk", "writing 0x%lx sectors at the sector 0x%llx to %s\n", (unsigned long) size, (unsigned long long) sector, disk->name); - + status = efi_call_5 (dio->write, dio, bio->media->media_id, (grub_efi_uint64_t) sector << GRUB_DISK_SECTOR_BITS, (grub_efi_uintn_t) size << GRUB_DISK_SECTOR_BITS, (void *) buf); if (status != GRUB_EFI_SUCCESS) return grub_error (GRUB_ERR_WRITE_ERROR, "efidisk write error"); - + return GRUB_ERR_NONE; } @@ -646,13 +646,13 @@ grub_efidisk_get_device_handle (grub_disk_t disk) { struct grub_efidisk_data *d; char type; - + if (disk->dev->id != GRUB_DISK_DEVICE_EFIDISK_ID) return 0; - + d = disk->data; type = disk->name[0]; - + switch (type) { case 'f': @@ -679,7 +679,7 @@ grub_efidisk_get_device_handle (grub_disk_t disk) grub_efi_hard_drive_device_path_t hd; grub_memcpy (&hd, c->last_device_path, sizeof (hd)); - + if ((GRUB_EFI_DEVICE_PATH_TYPE (c->last_device_path) == GRUB_EFI_MEDIA_DEVICE_PATH_TYPE) && (GRUB_EFI_DEVICE_PATH_SUBTYPE (c->last_device_path) @@ -692,14 +692,14 @@ grub_efidisk_get_device_handle (grub_disk_t disk) handle = c->handle; return 1; } - + return 0; } - + devices = make_devices (); iterate_child_devices (devices, d, find_partition); free_devices (devices); - + if (handle != 0) return handle; } @@ -708,7 +708,7 @@ grub_efidisk_get_device_handle (grub_disk_t disk) default: break; } - + return 0; } @@ -750,7 +750,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) if (disk->dev->id == GRUB_DISK_DEVICE_EFIDISK_ID) { struct grub_efidisk_data *d; - + d = disk->data; if (compare_device_paths (d->device_path, dup_dp) == 0) { @@ -798,7 +798,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) /* Find a partition which matches the hard drive device path. */ grub_memcpy (&hd, ldp, sizeof (hd)); grub_partition_iterate (parent, find_partition); - + if (! partition_name) { grub_disk_close (parent); @@ -824,11 +824,11 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) /* This should be an entire disk. */ auto int find_disk (const char *name); char *device_name = 0; - + int find_disk (const char *name) { grub_disk_t disk; - + disk = grub_disk_open (name); if (! disk) return 1; @@ -836,7 +836,7 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) if (disk->id == GRUB_DISK_DEVICE_EFIDISK_ID) { struct grub_efidisk_data *d; - + d = disk->data; if (compare_device_paths (d->device_path, dp) == 0) { @@ -848,9 +848,9 @@ grub_efidisk_get_device_name (grub_efi_handle_t *handle) grub_disk_close (disk); return 0; - + } - + grub_efidisk_iterate (find_disk); return device_name; } diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c index e9888a7e3..6901dbacf 100644 --- a/disk/fs_uuid.c +++ b/disk/fs_uuid.c @@ -42,12 +42,12 @@ search_fs_uuid (const char *key, unsigned long *count) if (dev) { grub_fs_t fs; - + fs = grub_fs_probe (dev); if (fs && fs->uuid) { char *uuid; - + (fs->uuid) (dev, &uuid); if (grub_errno == GRUB_ERR_NONE && uuid) { @@ -62,16 +62,16 @@ search_fs_uuid (const char *key, unsigned long *count) grub_free (uuid); } } - + grub_device_close (dev); } grub_errno = GRUB_ERR_NONE; return 0; } - + grub_device_iterate (iterate_device); - + return ret; } diff --git a/disk/host.c b/disk/host.c index 0229278f4..c4f3e7150 100644 --- a/disk/host.c +++ b/disk/host.c @@ -42,7 +42,7 @@ grub_host_open (const char *name, grub_disk_t disk) disk->total_sectors = 0; disk->id = (unsigned long) "host"; - + disk->has_partitions = 0; disk->data = 0; diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index f9663305a..09f0ce739 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -36,14 +36,14 @@ grub_biosdisk_get_drive (const char *name) if ((name[0] != 'f' && name[0] != 'h') || name[1] != 'd') goto fail; - + drive = grub_strtoul (name + 2, 0, 10); if (grub_errno != GRUB_ERR_NONE) goto fail; if (name[0] == 'h') drive += 0x80; - + return (int) drive ; fail: @@ -75,7 +75,7 @@ grub_biosdisk_iterate (int (*hook) (const char *name)) grub_dprintf ("disk", "Read error when probing drive 0x%2x\n", drive); break; } - + if (grub_biosdisk_call_hook (hook, drive)) return 1; } @@ -108,11 +108,11 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) disk->has_partitions = ((drive & 0x80) && (drive != cd_drive)); disk->id = drive; - + data = (struct grub_biosdisk_data *) grub_malloc (sizeof (*data)); if (! data) return grub_errno; - + data->drive = drive; data->flags = 0; @@ -126,7 +126,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) { /* HDD */ int version; - + version = grub_biosdisk_check_int13_extensions (drive); if (version) { @@ -162,9 +162,9 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) { data->sectors = 63; data->heads = 255; - data->cylinders - = grub_divmod64 (total_sectors - + data->heads * data->sectors - 1, + data->cylinders + = grub_divmod64 (total_sectors + + data->heads * data->sectors - 1, data->heads * data->sectors, 0); } else @@ -180,7 +180,7 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) disk->total_sectors = total_sectors; disk->data = data; - + return GRUB_ERR_NONE; } @@ -202,11 +202,11 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, unsigned segment) { struct grub_biosdisk_data *data = disk->data; - + if (data->flags & GRUB_BIOSDISK_FLAG_LBA) { struct grub_biosdisk_dap *dap; - + dap = (struct grub_biosdisk_dap *) (GRUB_MEMORY_MACHINE_SCRATCH_ADDR + (data->sectors << GRUB_DISK_SECTOR_BITS)); @@ -246,7 +246,7 @@ grub_biosdisk_rw (int cmd, grub_disk_t disk, { unsigned coff, hoff, soff; unsigned head; - + /* It is impossible to reach over 8064 MiB (a bit less than LBA24) with the traditional CHS access. */ if (sector > diff --git a/disk/ieee1275/ofdisk.c b/disk/ieee1275/ofdisk.c index 7904cc0c0..ca257d6d1 100644 --- a/disk/ieee1275/ofdisk.c +++ b/disk/ieee1275/ofdisk.c @@ -251,7 +251,7 @@ grub_ofdisk_read (grub_disk_t disk, grub_disk_addr_t sector, if (actual != actual) return grub_error (GRUB_ERR_READ_ERROR, "Read error on block: %llu", (long long) sector); - + return 0; } diff --git a/disk/loopback.c b/disk/loopback.c index 3cb2bf0ab..29805182e 100644 --- a/disk/loopback.c +++ b/disk/loopback.c @@ -32,7 +32,7 @@ struct grub_loopback struct grub_loopback *next; }; -static struct grub_loopback *loopback_list; +static struct grub_loopback *loopback_list; static const struct grub_arg_option options[] = { @@ -54,17 +54,17 @@ delete_loopback (const char *name) prev = &dev->next, dev = dev->next) if (grub_strcmp (dev->devname, name) == 0) break; - + if (! dev) return grub_error (GRUB_ERR_BAD_DEVICE, "Device not found"); - + /* Remove the device from the list. */ *prev = dev->next; grub_free (dev->devname); grub_free (dev->filename); grub_free (dev); - + return 0; } @@ -75,56 +75,56 @@ grub_cmd_loopback (grub_extcmd_t cmd, int argc, char **args) struct grub_arg_list *state = state = cmd->state; grub_file_t file; struct grub_loopback *newdev; - + if (argc < 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); - + /* Check if `-d' was used. */ if (state[0].set) return delete_loopback (args[0]); - + if (argc < 2) return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); file = grub_file_open (args[1]); if (! file) return grub_errno; - + /* Close the file, the only reason for opening it is validation. */ grub_file_close (file); - + /* First try to replace the old device. */ for (newdev = loopback_list; newdev; newdev = newdev->next) if (grub_strcmp (newdev->devname, args[0]) == 0) break; - + if (newdev) { char *newname = grub_strdup (args[1]); if (! newname) return grub_errno; - + grub_free (newdev->filename); newdev->filename = newname; - + /* Set has_partitions when `--partitions' was used. */ newdev->has_partitions = state[1].set; - + return 0; } - + /* Unable to replace it, make a new entry. */ newdev = grub_malloc (sizeof (struct grub_loopback)); if (! newdev) return grub_errno; - + newdev->devname = grub_strdup (args[0]); if (! newdev->devname) { grub_free (newdev); return grub_errno; } - + newdev->filename = grub_strdup (args[1]); if (! newdev->filename) { @@ -132,14 +132,14 @@ grub_cmd_loopback (grub_extcmd_t cmd, int argc, char **args) grub_free (newdev); return grub_errno; } - + /* Set has_partitions when `--partitions' was used. */ newdev->has_partitions = state[1].set; - + /* Add the new entry to the list. */ newdev->next = loopback_list; loopback_list = newdev; - + return 0; } @@ -161,26 +161,26 @@ grub_loopback_open (const char *name, grub_disk_t disk) { grub_file_t file; struct grub_loopback *dev; - + for (dev = loopback_list; dev; dev = dev->next) if (grub_strcmp (dev->devname, name) == 0) break; - + if (! dev) return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Can't open device"); file = grub_file_open (dev->filename); if (! file) return grub_errno; - + /* Use the filesize for the disk size, round up to a complete sector. */ disk->total_sectors = ((file->size + GRUB_DISK_SECTOR_SIZE - 1) / GRUB_DISK_SECTOR_SIZE); disk->id = (unsigned long) dev; - + disk->has_partitions = dev->has_partitions; disk->data = file; - + return 0; } @@ -188,7 +188,7 @@ static void grub_loopback_close (grub_disk_t disk) { grub_file_t file = (grub_file_t) disk->data; - + grub_file_close (file); } @@ -198,13 +198,13 @@ grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector, { grub_file_t file = (grub_file_t) disk->data; grub_off_t pos; - + grub_file_seek (file, sector << GRUB_DISK_SECTOR_BITS); - + grub_file_read (file, buf, size << GRUB_DISK_SECTOR_BITS); if (grub_errno) return grub_errno; - + /* In case there is more data read than there is available, in case of files that are not a multiple of GRUB_DISK_SECTOR_SIZE, fill the rest with zeros. */ @@ -214,7 +214,7 @@ grub_loopback_read (grub_disk_t disk, grub_disk_addr_t sector, grub_size_t amount = pos - file->size; grub_memset (buf + (size << GRUB_DISK_SECTOR_BITS) - amount, 0, amount); } - + return 0; } diff --git a/disk/lvm.c b/disk/lvm.c index 9f6c197fe..6707a4068 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -101,7 +101,7 @@ grub_lvm_open (const char *name, grub_disk_t disk) disk->id = lv->number; disk->data = lv; disk->total_sectors = lv->size; - + return 0; } @@ -174,7 +174,7 @@ grub_lvm_read (grub_disk_t disk, grub_disk_addr_t sector, stripe += stripenr; pv = stripe->pv; - + seg_offset = ((grub_uint64_t) stripe->start * (grub_uint64_t) vg->extent_size) + pv->start; @@ -189,7 +189,7 @@ grub_lvm_read (grub_disk_t disk, grub_disk_addr_t sector, else err = grub_error (GRUB_ERR_UNKNOWN_DEVICE, "Physical volume %s not found", pv->name); - + return err; } @@ -220,7 +220,7 @@ grub_lvm_scan_device (const char *name) unsigned int i, j, vgname_len; struct grub_lvm_vg *vg; struct grub_lvm_pv *pv; - + disk = grub_disk_open (name); if (!disk) return 0; @@ -231,7 +231,7 @@ grub_lvm_scan_device (const char *name) err = grub_disk_read (disk, i, 0, sizeof(buf), buf); if (err) goto fail; - + if ((! grub_strncmp ((char *)lh->id, GRUB_LVM_LABEL_ID, sizeof (lh->id))) && (! grub_strncmp ((char *)lh->type, GRUB_LVM_LVM2_LABEL, @@ -242,7 +242,7 @@ grub_lvm_scan_device (const char *name) /* Return if we didn't find a label. */ if (i == GRUB_LVM_LABEL_SCAN_SECTORS) goto fail; - + pvh = (struct grub_lvm_pv_header *) (buf + grub_le_to_cpu32(lh->offset_xl)); for (i = 0, j = 0; i < GRUB_LVM_ID_LEN; i++) @@ -264,7 +264,7 @@ grub_lvm_scan_device (const char *name) { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "We don't support multiple LVM data areas"); - + goto fail; } @@ -272,12 +272,12 @@ grub_lvm_scan_device (const char *name) mda_offset = grub_le_to_cpu64 (dlocn->offset); mda_size = grub_le_to_cpu64 (dlocn->size); dlocn++; - + if (dlocn->offset) { grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "We don't support multiple LVM metadata areas"); - + goto fail; } @@ -361,39 +361,39 @@ grub_lvm_scan_device (const char *name) if (p) { p += sizeof ("physical_volumes {") - 1; - + /* Add all the pvs to the volume group. */ while (1) { int s; while (grub_isspace (*p)) p++; - + if (*p == '}') break; - + pv = grub_malloc (sizeof (*pv)); q = p; while (*q != ' ') q++; - + s = q - p; pv->name = grub_malloc (s + 1); grub_memcpy (pv->name, p, s); pv->name[s] = '\0'; - + p = grub_strstr (p, "id = \""); if (p == NULL) goto pvs_fail; p += sizeof("id = \"") - 1; - + grub_memcpy (pv->id, p, GRUB_LVM_ID_STRLEN); pv->id[GRUB_LVM_ID_STRLEN] = '\0'; - + pv->start = grub_lvm_getvalue (&p, "pe_start = "); if (p == NULL) goto pvs_fail; - + p = grub_strchr (p, '}'); if (p == NULL) goto pvs_fail; @@ -402,7 +402,7 @@ grub_lvm_scan_device (const char *name) pv->disk = NULL; pv->next = vg->pvs; vg->pvs = pv; - + continue; pvs_fail: grub_free (pv->name); @@ -415,49 +415,49 @@ grub_lvm_scan_device (const char *name) if (p) { p += 18; - + /* And add all the lvs to the volume group. */ while (1) { int s; struct grub_lvm_lv *lv; struct grub_lvm_segment *seg; - + while (grub_isspace (*p)) p++; - + if (*p == '}') break; - + lv = grub_malloc (sizeof (*lv)); - + q = p; while (*q != ' ') q++; - + s = q - p; lv->name = grub_malloc (vgname_len + 1 + s + 1); grub_memcpy (lv->name, vgname, vgname_len); lv->name[vgname_len] = '-'; grub_memcpy (lv->name + vgname_len + 1, p, s); lv->name[vgname_len + 1 + s] = '\0'; - + lv->size = 0; - + lv->segment_count = grub_lvm_getvalue (&p, "segment_count = "); if (p == NULL) goto lvs_fail; lv->segments = grub_malloc (sizeof (*seg) * lv->segment_count); seg = lv->segments; - + for (i = 0; i < lv->segment_count; i++) { struct grub_lvm_stripe *stripe; - + p = grub_strstr (p, "segment"); if (p == NULL) goto lvs_segment_fail; - + seg->start_extent = grub_lvm_getvalue (&p, "start_extent = "); if (p == NULL) goto lvs_segment_fail; @@ -467,25 +467,25 @@ grub_lvm_scan_device (const char *name) seg->stripe_count = grub_lvm_getvalue (&p, "stripe_count = "); if (p == NULL) goto lvs_segment_fail; - + lv->size += seg->extent_count * vg->extent_size; - + if (seg->stripe_count != 1) seg->stripe_size = grub_lvm_getvalue (&p, "stripe_size = "); - + seg->stripes = grub_malloc (sizeof (*stripe) * seg->stripe_count); stripe = seg->stripes; - + p = grub_strstr (p, "stripes = ["); if (p == NULL) goto lvs_segment_fail2; p += sizeof("stripes = [") - 1; - + for (j = 0; j < seg->stripe_count; j++) { char *pvname; - + p = grub_strchr (p, '"'); if (p == NULL) continue; @@ -494,14 +494,14 @@ grub_lvm_scan_device (const char *name) q++; s = q - p; - + pvname = grub_malloc (s + 1); if (pvname == NULL) goto lvs_segment_fail2; - + grub_memcpy (pvname, p, s); pvname[s] = '\0'; - + if (vg->pvs) for (pv = vg->pvs; pv; pv = pv->next) { @@ -511,16 +511,16 @@ grub_lvm_scan_device (const char *name) break; } } - + grub_free(pvname); - + stripe->start = grub_lvm_getvalue (&p, ","); if (p == NULL) continue; - + stripe++; } - + seg++; continue; @@ -535,7 +535,7 @@ grub_lvm_scan_device (const char *name) if (p == NULL) goto lvs_fail; p += 3; - + lv->number = lv_count++; lv->vg = vg; lv->next = vg->lvs; diff --git a/disk/memdisk.c b/disk/memdisk.c index 978eae553..4a0470837 100644 --- a/disk/memdisk.c +++ b/disk/memdisk.c @@ -104,7 +104,7 @@ GRUB_MOD_INIT(memdisk) return 0; } - + grub_module_iterate (hook); } diff --git a/disk/raid.c b/disk/raid.c index aac0f331a..c4d0857fd 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -77,7 +77,7 @@ static int grub_raid_iterate (int (*hook) (const char *name)) { struct grub_raid_array *array; - + for (array = array_list; array != NULL; array = array->next) { if (grub_is_array_readable (array)) @@ -95,7 +95,7 @@ grub_raid_memberlist (grub_disk_t disk) struct grub_raid_array *array = disk->data; grub_disk_memberlist_t list = NULL, tmp; unsigned int i; - + for (i = 0; i < array->total_devs; i++) if (array->device[i]) { @@ -104,7 +104,7 @@ grub_raid_memberlist (grub_disk_t disk) tmp->next = list; list = tmp; } - + return list; } #endif @@ -114,7 +114,7 @@ grub_raid_open (const char *name, grub_disk_t disk) { struct grub_raid_array *array; unsigned n; - + for (array = array_list; array != NULL; array = array->next) { if (!grub_strcmp (array->name, name)) @@ -161,7 +161,7 @@ grub_raid_open (const char *name, grub_disk_t disk) grub_dprintf ("raid", "%s: level=%d, total_sectors=%lld\n", name, array->level, (unsigned long long) disk->total_sectors); - + return 0; } @@ -348,7 +348,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, p = array->total_devs - n; read_sector *= array->chunk_size; - + while (1) { grub_size_t read_size; @@ -405,7 +405,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, if (err) break; } - + buf += read_size << GRUB_DISK_SECTOR_BITS; size -= read_size; if (! size) @@ -460,7 +460,7 @@ grub_raid_read (grub_disk_t disk, grub_disk_addr_t sector, } break; } - + return err; } @@ -478,7 +478,7 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array, const char *scanner_name) { struct grub_raid_array *array = 0, *p; - + /* See whether the device is part of an array we have already seen a device from. */ for (p = array_list; p != NULL; p = p->next) @@ -524,7 +524,7 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array, *array = *new_array; array->nr_devs = 0; grub_memset (&array->device, 0, sizeof (array->device)); - + /* Check whether we don't have multiple arrays with the same number. */ for (p = array_list; p != NULL; p = p->next) { @@ -635,7 +635,7 @@ grub_raid_scan_device (int head_only) return 0; } - + grub_device_iterate (&hook); } @@ -649,7 +649,7 @@ free_array (void) { struct grub_raid_array *p; int i; - + p = array; array = array->next; @@ -664,7 +664,7 @@ free_array (void) array_list = 0; } - + void grub_raid_register (grub_raid_t raid) { diff --git a/disk/scsi.c b/disk/scsi.c index 081d9c671..046dcb8eb 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -301,7 +301,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) << GRUB_DISK_SECTOR_BITS); grub_dprintf ("scsi", "capacity=%llu, blksize=%d\n", - (unsigned long long) disk->total_sectors, + (unsigned long long) disk->total_sectors, scsi->blocksize); return GRUB_ERR_NONE; diff --git a/disk/usbms.c b/disk/usbms.c index 67e6ba25f..147891956 100644 --- a/disk/usbms.c +++ b/disk/usbms.c @@ -267,7 +267,7 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, "can't read from USB Mass Storage device"); } } - else + else { err = grub_usb_bulk_write (dev->dev, dev->in->endp_addr & 15, size, buf); grub_dprintf ("usb", "write: %d %d\n", err, GRUB_USB_ERR_STALL); @@ -379,7 +379,7 @@ static struct grub_scsi_dev grub_usbms_dev = .close = grub_usbms_close, .read = grub_usbms_read, .write = grub_usbms_write - }; + }; GRUB_MOD_INIT(usbms) { diff --git a/docs/grub.texi b/docs/grub.texi index b8f74a039..11603930e 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -664,7 +664,7 @@ from GRUB and you don't have to make a floppy or hard disk image file, which can cause compatibility problems. For booting from a CD-ROM, GRUB uses a special Stage 2 called -@file{stage2_eltorito}. The only GRUB files you need to have in your +@file{stage2_eltorito}. The only GRUB files you need to have in your bootable CD-ROM are this @file{stage2_eltorito} and optionally a config file @file{menu.lst}. You don't need to use @file{stage1} or @file{stage2}, because El Torito is quite different from the standard boot process. @@ -702,13 +702,13 @@ $ @kbd{mkisofs -R -b boot/grub/stage2_eltorito -no-emul-boot \ This produces a file named @file{grub.iso}, which then can be burned into a CD (or a DVD). @kbd{mkisofs} has already set up the disc to boot -from the @kbd{boot/grub/stage2_eltorito} file, so there is no need to +from the @kbd{boot/grub/stage2_eltorito} file, so there is no need to setup GRUB on the disc. (Note that the @kbd{-boot-load-size 4} bit is required for compatibility with the BIOS on many older machines.) You can use the device @samp{(cd)} to access a CD-ROM in your -config file. This is not required; GRUB automatically sets the root device -to @samp{(cd)} when booted from a CD-ROM. It is only necessary to refer to +config file. This is not required; GRUB automatically sets the root device +to @samp{(cd)} when booted from a CD-ROM. It is only necessary to refer to @samp{(cd)} if you want to access other drives as well. @@ -2414,7 +2414,7 @@ is to be found; if specified it takes precedence over @var{unit}. be in the range 5-8 and stop bits must be 1 or 2. Default is 8 data bits and one stop bit. @var{parity} is one of @samp{no}, @samp{odd}, @samp{even} and defaults to @samp{no}. The option @option{--device} -can only be used in the grub shell and is used to specify the +can only be used in the grub shell and is used to specify the tty device to be used in the host operating system (@pxref{Invoking the grub shell}). @@ -2431,8 +2431,8 @@ support. See also @ref{Serial terminal}. @deffn Command setkey [to_key from_key] Change the keyboard map. The key @var{from_key} is mapped to the key -@var{to_key}. If no argument is specified, reset key mappings. Note that -this command @emph{does not} exchange the keys. If you want to exchange +@var{to_key}. If no argument is specified, reset key mappings. Note that +this command @emph{does not} exchange the keys. If you want to exchange the keys, run this command again with the arguments exchanged, like this: @example diff --git a/docs/texinfo.tex b/docs/texinfo.tex index c49e670b0..0135d0c7c 100644 --- a/docs/texinfo.tex +++ b/docs/texinfo.tex @@ -354,7 +354,7 @@ % We don't want .vr (or whatever) entries like this: % \entry{{\tt \indexbackslash }acronym}{32}{\code {\acronym}} % "\acronym" won't work when it's read back in; - % it needs to be + % it needs to be % {\code {{\tt \backslashcurfont }acronym} \shipout\vbox{% % Do this early so pdf references go to the beginning of the page. @@ -705,7 +705,7 @@ \def\?{?\spacefactor=\endofsentencespacefactor\space} % @frenchspacing on|off says whether to put extra space after punctuation. -% +% \def\onword{on} \def\offword{off} % @@ -1260,7 +1260,7 @@ where each line of input produces a line of output.} % that's what we do). % double active backslashes. -% +% {\catcode`\@=0 \catcode`\\=\active @gdef@activebackslashdouble{% @catcode`@\=@active @@ -1272,11 +1272,11 @@ where each line of input produces a line of output.} % us) handles it with this amazing macro to replace tokens, with minor % changes for Texinfo. It is included here under the GPL by permission % from the author, Heiko Oberdiek. -% +% % #1 is the tokens to replace. % #2 is the replacement. % #3 is the control sequence with the string. -% +% \def\HyPsdSubst#1#2#3{% \def\HyPsdReplace##1#1##2\END{% ##1% @@ -1542,7 +1542,7 @@ output) for that.)} % tried to figure out what each command should do in the context % of @url. for now, just make @/ a no-op, that's the only one % people have actually reported a problem with. - % + % \normalturnoffactive \def\@{@}% \let\/=\empty @@ -1939,7 +1939,7 @@ end % Definitions for a main text size of 11pt. This is the default in % Texinfo. -% +% \def\definetextfontsizexi{% % Text fonts (11.2pt, magstep1). \def\textnominalsize{11pt} @@ -2072,7 +2072,7 @@ end % section, chapter, etc., sizes following suit. This is for the GNU % Press printing of the Emacs 22 manual. Maybe other manuals in the % future. Used with @smallbook, which sets the leading to 12pt. -% +% \def\definetextfontsizex{% % Text fonts (10pt). \def\textnominalsize{10pt} @@ -2163,7 +2163,7 @@ end \setfont\secsf\sfbshape{12}{1000}{OT1} \let\secbf\secrm \setfont\secsc\scbshape{10}{\magstep1}{OT1} -\font\seci=cmmi12 +\font\seci=cmmi12 \font\secsy=cmsy10 scaled \magstep1 \def\sececsize{1200} @@ -2207,7 +2207,7 @@ end % We provide the user-level command % @fonttextsize 10 % (or 11) to redefine the text font size. pt is assumed. -% +% \def\xword{10} \def\xiword{11} % @@ -2217,7 +2217,7 @@ end % % Set \globaldefs so that documents can use this inside @tex, since % makeinfo 4.8 does not support it, but we need it nonetheless. - % + % \begingroup \globaldefs=1 \ifx\textsizearg\xword \definetextfontsizex \else \ifx\textsizearg\xiword \definetextfontsizexi @@ -2503,7 +2503,7 @@ end % each of the four underscores in __typeof__. This is undesirable in % some manuals, especially if they don't have long identifiers in % general. @allowcodebreaks provides a way to control this. -% +% \newif\ifallowcodebreaks \allowcodebreakstrue \def\keywordtrue{true} @@ -2634,7 +2634,7 @@ end % @acronym for "FBI", "NATO", and the like. % We print this one point size smaller, since it's intended for % all-uppercase. -% +% \def\acronym#1{\doacronym #1,,\finish} \def\doacronym#1,#2,#3\finish{% {\selectfonts\lsize #1}% @@ -2646,7 +2646,7 @@ end % @abbr for "Comput. J." and the like. % No font change, but don't do end-of-sentence spacing. -% +% \def\abbr#1{\doabbr #1,,\finish} \def\doabbr#1,#2,#3\finish{% {\plainfrenchspacing #1}% @@ -2665,43 +2665,43 @@ end % Theiling, which support regular, slanted, bold and bold slanted (and % "outlined" (blackboard board, sort of) versions, which we don't need). % It is available from http://www.ctan.org/tex-archive/fonts/eurosym. -% +% % Although only regular is the truly official Euro symbol, we ignore % that. The Euro is designed to be slightly taller than the regular % font height. -% +% % feymr - regular % feymo - slanted % feybr - bold % feybo - bold slanted -% +% % There is no good (free) typewriter version, to my knowledge. % A feymr10 euro is ~7.3pt wide, while a normal cmtt10 char is ~5.25pt wide. % Hmm. -% +% % Also doesn't work in math. Do we need to do math with euro symbols? % Hope not. -% -% +% +% \def\euro{{\eurofont e}} \def\eurofont{% % We set the font at each command, rather than predefining it in % \textfonts and the other font-switching commands, so that % installations which never need the symbol don't have to have the % font installed. - % + % % There is only one designed size (nominal 10pt), so we always scale % that to the current nominal size. - % + % % By the way, simply using "at 1em" works for cmr10 and the like, but % does not work for cmbx10 and other extended/shrunken fonts. - % + % \def\eurosize{\csname\curfontsize nominalsize\endcsname}% % - \ifx\curfontstyle\bfstylename + \ifx\curfontstyle\bfstylename % bold: \font\thiseurofont = \ifusingit{feybo10}{feybr10} at \eurosize - \else + \else % regular: \font\thiseurofont = \ifusingit{feymo10}{feymr10} at \eurosize \fi @@ -2754,7 +2754,7 @@ end % Laurent Siebenmann reports \Orb undefined with: % Textures 1.7.7 (preloaded format=plain 93.10.14) (68K) 16 APR 2004 02:38 % so we'll define it if necessary. -% +% \ifx\Orb\undefined \def\Orb{\mathhexbox20D} \fi @@ -3102,7 +3102,7 @@ end % cause the example and the item to crash together. So we use this % bizarre value of 10001 as a signal to \aboveenvbreak to insert % \parskip glue after all. Section titles are handled this way also. - % + % \penalty 10001 \endgroup \itemxneedsnegativevskipfalse @@ -3898,7 +3898,7 @@ end % processing continues to some further point. On the other hand, it % seems \endinput does not hurt in the printed index arg, since that % is still getting written without apparent harm. - % + % % Sample source (mac-idx3.tex, reported by Graham Percival to % help-texinfo, 22may06): % @macro funindex {WORD} @@ -3906,12 +3906,12 @@ end % @end macro % ... % @funindex commtest - % + % % The above is not enough to reproduce the bug, but it gives the flavor. - % + % % Sample whatsit resulting: % .@write3{\entry{xyz}{@folio }{@code {xyz@endinput }}} - % + % % So: \let\endinput = \empty % @@ -4167,11 +4167,11 @@ end % makeinfo does not expand macros in the argument to @deffn, which ends up % writing an index entry, and texindex isn't prepared for an index sort entry % that starts with \. - % + % % Since macro invocations are followed by braces, we can just redefine them % to take a single TeX argument. The case of a macro invocation that % goes to end-of-line is not handled. - % + % \macrolist } @@ -4299,7 +4299,7 @@ end % to re-insert the same penalty (values >10000 are used for various % signals); since we just inserted a non-discardable item, any % following glue (such as a \parskip) would be a breakpoint. For example: - % + % % @deffn deffn-whatever % @vindex index-whatever % Description. @@ -5365,11 +5365,11 @@ end % glue accumulate. (Not a breakpoint because it's preceded by a % discardable item.) \vskip-\parskip - % + % % This is purely so the last item on the list is a known \penalty > % 10000. This is so \startdefun can avoid allowing breakpoints after % section headings. Otherwise, it would insert a valid breakpoint between: - % + % % @section sec-whatever % @deffn def-whatever \penalty 10001 @@ -5427,7 +5427,7 @@ end % These characters do not print properly in the Computer Modern roman % fonts, so we must take special care. This is more or less redundant % with the Texinfo input format setup at the end of this file. -% +% \def\activecatcodes{% \catcode`\"=\active \catcode`\$=\active @@ -5477,7 +5477,7 @@ end % redefined for the two-volume lispref. We always output on % \jobname.toc even if this is redefined. -% +% \def\tocreadfilename{\jobname.toc} % Normal (long) toc. @@ -6032,8 +6032,8 @@ end % from cmtt (char 0x0d). The undirected quote is ugly, so don't make it % the default, but it works for pasting with more pdf viewers (at least % evince), the lilypond developers report. xpdf does work with the -% regular 0x27. -% +% regular 0x27. +% \def\codequoteright{% \expandafter\ifx\csname SETtxicodequoteundirected\endcsname\relax \expandafter\ifx\csname SETcodequoteundirected\endcsname\relax @@ -6045,7 +6045,7 @@ end % and a similar option for the left quote char vs. a grave accent. % Modern fonts display ASCII 0x60 as a grave accent, so some people like % the code environments to do likewise. -% +% \def\codequoteleft{% \expandafter\ifx\csname SETtxicodequotebacktick\endcsname\relax \expandafter\ifx\csname SETcodequotebacktick\endcsname\relax @@ -6576,7 +6576,7 @@ end % This does \let #1 = #2, with \csnames; that is, % \let \csname#1\endcsname = \csname#2\endcsname % (except of course we have to play expansion games). -% +% \def\cslet#1#2{% \expandafter\let \csname#1\expandafter\endcsname @@ -7734,7 +7734,7 @@ end % % If they passed de_DE, and txi-de_DE.tex doesn't exist, % try txi-de.tex. -% +% \def\documentlanguagetrywithoutunderscore#1_#2\finish{% \openin 1 txi-#1.tex \ifeof 1 @@ -7790,7 +7790,7 @@ should work if nowhere else does.} \setnonasciicharscatcode\active \lattwochardefs % - \else \ifx \declaredencoding \latone + \else \ifx \declaredencoding \latone \setnonasciicharscatcode\active \latonechardefs % @@ -7802,7 +7802,7 @@ should work if nowhere else does.} \setnonasciicharscatcode\active \utfeightchardefs % - \else + \else \message{Unknown document encoding #1, ignoring.}% % \fi % utfeight @@ -7814,7 +7814,7 @@ should work if nowhere else does.} % A message to be logged when using a character that isn't available % the default font encoding (OT1). -% +% \def\missingcharmsg#1{\message{Character missing in OT1 encoding: #1.}} % Take account of \c (plain) vs. \, (Texinfo) difference. @@ -7827,21 +7827,21 @@ should work if nowhere else does.} % % Latin1 (ISO-8859-1) character definitions. \def\latonechardefs{% - \gdef^^a0{~} + \gdef^^a0{~} \gdef^^a1{\exclamdown} - \gdef^^a2{\missingcharmsg{CENT SIGN}} + \gdef^^a2{\missingcharmsg{CENT SIGN}} \gdef^^a3{{\pounds}} \gdef^^a4{\missingcharmsg{CURRENCY SIGN}} \gdef^^a5{\missingcharmsg{YEN SIGN}} - \gdef^^a6{\missingcharmsg{BROKEN BAR}} + \gdef^^a6{\missingcharmsg{BROKEN BAR}} \gdef^^a7{\S} - \gdef^^a8{\"{}} - \gdef^^a9{\copyright} + \gdef^^a8{\"{}} + \gdef^^a9{\copyright} \gdef^^aa{\ordf} - \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} + \gdef^^ab{\missingcharmsg{LEFT-POINTING DOUBLE ANGLE QUOTATION MARK}} \gdef^^ac{$\lnot$} - \gdef^^ad{\-} - \gdef^^ae{\registeredsymbol} + \gdef^^ad{\-} + \gdef^^ae{\registeredsymbol} \gdef^^af{\={}} % \gdef^^b0{\textdegree} @@ -7868,7 +7868,7 @@ should work if nowhere else does.} \gdef^^c2{\^A} \gdef^^c3{\~A} \gdef^^c4{\"A} - \gdef^^c5{\ringaccent A} + \gdef^^c5{\ringaccent A} \gdef^^c6{\AE} \gdef^^c7{\cedilla C} \gdef^^c8{\`E} @@ -8009,7 +8009,7 @@ should work if nowhere else does.} \gdef^^d6{\"O} \gdef^^d7{$\times$} \gdef^^d8{\v R} - \gdef^^d9{\ringaccent U} + \gdef^^d9{\ringaccent U} \gdef^^da{\'U} \gdef^^db{\H U} \gdef^^dc{\"U} @@ -8053,11 +8053,11 @@ should work if nowhere else does.} } % UTF-8 character definitions. -% +% % This code to support UTF-8 is based on LaTeX's utf8.def, with some % changes for Texinfo conventions. It is included here under the GPL by % permission from Frank Mittelbach and the LaTeX team. -% +% \newcount\countUTFx \newcount\countUTFy \newcount\countUTFz @@ -8897,7 +8897,7 @@ should work if nowhere else does.} % Same as @turnoffactive except outputs \ as {\tt\char`\\} instead of % the literal character `\'. -% +% @def@normalturnoffactive{% @let\=@normalbackslash @let"=@normaldoublequote diff --git a/efiemu/i386/loadcore32.c b/efiemu/i386/loadcore32.c index d46cd4c9a..24b63ec98 100644 --- a/efiemu/i386/loadcore32.c +++ b/efiemu/i386/loadcore32.c @@ -38,7 +38,7 @@ grub_arch_efiemu_check_header32 (void *ehdr) /* Relocate symbols. */ grub_err_t -grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, +grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, struct grub_efiemu_elf_sym *elfsyms, void *ehdr) { @@ -66,7 +66,7 @@ grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, if (seg) { Elf32_Rel *rel, *max; - + for (rel = (Elf32_Rel *) ((char *) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; @@ -77,31 +77,31 @@ grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - - addr = (Elf32_Word *) - ((char *) grub_efiemu_mm_obtain_request (seg->handle) + + addr = (Elf32_Word *) + ((char *) grub_efiemu_mm_obtain_request (seg->handle) + seg->off + rel->r_offset); sym = elfsyms[ELF32_R_SYM (rel->r_info)]; - + switch (ELF32_R_TYPE (rel->r_info)) { case R_386_32: - if ((err = grub_efiemu_write_value - (addr, sym.off + *addr, sym.handle, 0, + if ((err = grub_efiemu_write_value + (addr, sym.off + *addr, sym.handle, 0, seg->ptv_rel_needed, sizeof (grub_uint32_t)))) return err; - + break; case R_386_PC32: if ((err = grub_efiemu_write_value - (addr, sym.off + *addr - rel->r_offset - - seg->off, sym.handle, seg->handle, + (addr, sym.off + *addr - rel->r_offset + - seg->off, sym.handle, seg->handle, seg->ptv_rel_needed, sizeof (grub_uint32_t)))) return err; break; default: - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "unrecognised relocation"); } } diff --git a/efiemu/i386/loadcore64.c b/efiemu/i386/loadcore64.c index 6c0e0ca14..a69279077 100644 --- a/efiemu/i386/loadcore64.c +++ b/efiemu/i386/loadcore64.c @@ -37,7 +37,7 @@ grub_arch_efiemu_check_header64 (void *ehdr) /* Relocate symbols. */ grub_err_t -grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, +grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, struct grub_efiemu_elf_sym *elfsyms, void *ehdr) { @@ -62,9 +62,9 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, if (seg) { Elf64_Rela *rel, *max; - + for (rel = (Elf64_Rela *) ((char *) e + s->sh_offset), - max = rel + (unsigned long) s->sh_size + max = rel + (unsigned long) s->sh_size / (unsigned long)s->sh_entsize; rel < max; rel++) @@ -76,40 +76,40 @@ grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - + addr = - ((char *) grub_efiemu_mm_obtain_request (seg->handle) + ((char *) grub_efiemu_mm_obtain_request (seg->handle) + seg->off + rel->r_offset); addr32 = (grub_uint32_t *) addr; addr64 = (grub_uint64_t *) addr; sym = elfsyms[ELF64_R_SYM (rel->r_info)]; - + switch (ELF64_R_TYPE (rel->r_info)) { case R_X86_64_64: - if ((err = grub_efiemu_write_value - (addr, *addr64 + rel->r_addend + sym.off, sym.handle, + if ((err = grub_efiemu_write_value + (addr, *addr64 + rel->r_addend + sym.off, sym.handle, 0, seg->ptv_rel_needed, sizeof (grub_uint64_t)))) return err; break; case R_X86_64_PC32: if ((err = grub_efiemu_write_value - (addr, *addr32 + rel->r_addend + sym.off - - rel->r_offset - seg->off, sym.handle, seg->handle, + (addr, *addr32 + rel->r_addend + sym.off + - rel->r_offset - seg->off, sym.handle, seg->handle, seg->ptv_rel_needed, sizeof (grub_uint32_t)))) return err; break; case R_X86_64_32: case R_X86_64_32S: - if ((err = grub_efiemu_write_value - (addr, *addr32 + rel->r_addend + sym.off, sym.handle, + if ((err = grub_efiemu_write_value + (addr, *addr32 + rel->r_addend + sym.off, sym.handle, 0, seg->ptv_rel_needed, sizeof (grub_uint32_t)))) return err; break; default: - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "unrecognised relocation"); } } diff --git a/efiemu/i386/pc/cfgtables.c b/efiemu/i386/pc/cfgtables.c index 25f8a0cfa..9c6b4e55e 100644 --- a/efiemu/i386/pc/cfgtables.c +++ b/efiemu/i386/pc/cfgtables.c @@ -59,7 +59,7 @@ grub_machine_efiemu_init_tables () return err; } - for (ptr = (grub_uint8_t *) 0xf0000; ptr < (grub_uint8_t *) 0x100000; + for (ptr = (grub_uint8_t *) 0xf0000; ptr < (grub_uint8_t *) 0x100000; ptr += 16) if (grub_memcmp (ptr, "_SM_", 4) == 0 && grub_byte_checksum (ptr, *(ptr + 5)) == 0) diff --git a/efiemu/loadcore.c b/efiemu/loadcore.c index 36f27a2ef..ee4c80649 100644 --- a/efiemu/loadcore.c +++ b/efiemu/loadcore.c @@ -40,7 +40,7 @@ grub_efiemu_get_section_addr (grub_efiemu_segment_t segs, unsigned n, if (seg->section == n) { *handle = seg->handle; - *off = seg->off; + *off = seg->off; return GRUB_ERR_NONE; } @@ -86,7 +86,7 @@ grub_efiemu_load_segments (grub_efiemu_segment_t segs, const Elf_Ehdr *e) grub_efiemu_segment_t cur; grub_dprintf ("efiemu", "loading segments\n"); - + for (cur=segs; cur; cur = cur->next) { s = (Elf_Shdr *)cur->srcptr; @@ -94,10 +94,10 @@ grub_efiemu_load_segments (grub_efiemu_segment_t segs, const Elf_Ehdr *e) if ((s->sh_flags & SHF_ALLOC) && s->sh_size) { void *addr; - - addr = (grub_uint8_t *) grub_efiemu_mm_obtain_request (cur->handle) + + addr = (grub_uint8_t *) grub_efiemu_mm_obtain_request (cur->handle) + cur->off; - + switch (s->sh_type) { case SHT_PROGBITS: @@ -145,11 +145,11 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) seg = (grub_efiemu_segment_t) grub_malloc (sizeof (*seg)); if (! seg) return grub_errno; - + if (s->sh_size) { - seg->handle - = grub_efiemu_request_memalign + seg->handle + = grub_efiemu_request_memalign (s->sh_addralign, s->sh_size, s->sh_flags & SHF_EXECINSTR ? GRUB_EFI_RUNTIME_SERVICES_CODE : GRUB_EFI_RUNTIME_SERVICES_DATA); @@ -157,12 +157,12 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) return grub_errno; seg->off = 0; } - - /* + + /* .text-physical doesn't need to be relocated when switching to virtual mode */ - if (!grub_strcmp (grub_efiemu_get_string (s->sh_name, e), + if (!grub_strcmp (grub_efiemu_get_string (s->sh_name, e), ".text-physical")) seg->ptv_rel_needed = 0; else @@ -174,7 +174,7 @@ grub_efiemu_init_segments (grub_efiemu_segment_t *segs, const Elf_Ehdr *e) *segs = seg; } } - + return GRUB_ERR_NONE; } @@ -185,7 +185,7 @@ grub_efiemu_count_symbols (const Elf_Ehdr *e) unsigned i; Elf_Shdr *s; int num = 0; - + /* Symbols */ for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; @@ -197,7 +197,7 @@ grub_efiemu_count_symbols (const Elf_Ehdr *e) return grub_error (GRUB_ERR_BAD_OS, "no symbol table"); grub_efiemu_nelfsyms = (unsigned) s->sh_size / (unsigned) s->sh_entsize; - grub_efiemu_elfsyms = (struct grub_efiemu_elf_sym *) + grub_efiemu_elfsyms = (struct grub_efiemu_elf_sym *) grub_malloc (sizeof (struct grub_efiemu_elf_sym) * grub_efiemu_nelfsyms); /* Relocators */ @@ -221,7 +221,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) Elf_Sym *sym; const char *str; Elf_Word size, entsize; - + grub_dprintf ("efiemu", "resolving symbols\n"); for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); @@ -267,7 +267,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) break; case STT_OBJECT: - if ((err = grub_efiemu_get_section_addr + if ((err = grub_efiemu_get_section_addr (segs, sym->st_shndx, &handle, &off))) return err; @@ -280,7 +280,7 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) break; case STT_FUNC: - if ((err = grub_efiemu_get_section_addr + if ((err = grub_efiemu_get_section_addr (segs, sym->st_shndx, &handle, &off))) return err; @@ -293,12 +293,12 @@ grub_efiemu_resolve_symbols (grub_efiemu_segment_t segs, Elf_Ehdr *e) break; case STT_SECTION: - if ((err = grub_efiemu_get_section_addr + if ((err = grub_efiemu_get_section_addr (segs, sym->st_shndx, &handle, &off))) { grub_efiemu_elfsyms[i].handle = 0; grub_efiemu_elfsyms[i].off = 0; - grub_errno = GRUB_ERR_NONE; + grub_errno = GRUB_ERR_NONE; break; } @@ -346,8 +346,8 @@ SUFFIX (grub_efiemu_loadcore_init) (void *core, grub_size_t core_size, /* Load runtime definitively */ grub_err_t -SUFFIX (grub_efiemu_loadcore_load) (void *core, - grub_size_t core_size +SUFFIX (grub_efiemu_loadcore_load) (void *core, + grub_size_t core_size __attribute__ ((unused)), grub_efiemu_segment_t segments) { @@ -356,10 +356,10 @@ SUFFIX (grub_efiemu_loadcore_load) (void *core, return err; if ((err = grub_efiemu_resolve_symbols (segments, core))) return err; - if ((err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments, + if ((err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments, grub_efiemu_elfsyms, core))) return err; - + return GRUB_ERR_NONE; } diff --git a/efiemu/loadcore_common.c b/efiemu/loadcore_common.c index 9de1b39ad..a4db0ee9b 100644 --- a/efiemu/loadcore_common.c +++ b/efiemu/loadcore_common.c @@ -45,7 +45,7 @@ grub_efiemu_sizeof_uintn_t (void) /* Check the header and set mode */ static grub_err_t -grub_efiemu_check_header (void *ehdr, grub_size_t size, +grub_efiemu_check_header (void *ehdr, grub_size_t size, grub_efiemu_mode_t *mode) { /* Check the magic numbers. */ @@ -91,7 +91,7 @@ grub_efiemu_loadcore_unload(void) case GRUB_EFIEMU64: grub_efiemu_loadcore_unload64 (); break; - + default: break; } @@ -109,7 +109,7 @@ grub_efiemu_loadcore_unload(void) return GRUB_ERR_NONE; } -/* Load runtime file and do some initial preparations */ +/* Load runtime file and do some initial preparations */ grub_err_t grub_efiemu_loadcore_init (grub_file_t file) { @@ -121,7 +121,7 @@ grub_efiemu_loadcore_init (grub_file_t file) if (! efiemu_core) return grub_errno; - if (grub_file_read (file, efiemu_core, efiemu_core_size) + if (grub_file_read (file, efiemu_core, efiemu_core_size) != (int) efiemu_core_size) { grub_free (efiemu_core); @@ -129,7 +129,7 @@ grub_efiemu_loadcore_init (grub_file_t file) return grub_errno; } - if (grub_efiemu_check_header (efiemu_core, efiemu_core_size, + if (grub_efiemu_check_header (efiemu_core, efiemu_core_size, &grub_efiemu_mode)) { grub_free (efiemu_core); @@ -160,7 +160,7 @@ grub_efiemu_loadcore_init (grub_file_t file) return err; } break; - + default: return grub_error (GRUB_ERR_BAD_OS, "unknown EFI runtime"); } diff --git a/efiemu/main.c b/efiemu/main.c index da5733647..b5608e666 100644 --- a/efiemu/main.c +++ b/efiemu/main.c @@ -17,8 +17,8 @@ */ /* This is an emulation of EFI runtime services. - This allows a more uniform boot on i386 machines. - As it emulates only runtime service it isn't able + This allows a more uniform boot on i386 machines. + As it emulates only runtime service it isn't able to chainload EFI bootloader on non-EFI system. */ @@ -112,7 +112,7 @@ grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid) grub_err_t grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data), - void (*unload) (void *data), + void (*unload) (void *data), void *data) { struct grub_efiemu_prepare_hook *nhook; @@ -129,20 +129,20 @@ grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data), return GRUB_ERR_NONE; } -/* Register a configuration table either supplying the address directly +/* Register a configuration table either supplying the address directly or with a hook */ grub_err_t -grub_efiemu_register_configuration_table (grub_efi_guid_t guid, +grub_efiemu_register_configuration_table (grub_efi_guid_t guid, void * (*get_table) (void *data), - void (*unload) (void *data), + void (*unload) (void *data), void *data) { struct grub_efiemu_configuration_table *tbl; grub_err_t err; - + if (! get_table && ! data) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return grub_error (GRUB_ERR_BAD_ARGUMENT, "you must set at least get_table or data"); if ((err = grub_efiemu_unregister_configuration_table (guid))) return err; @@ -163,7 +163,7 @@ grub_efiemu_register_configuration_table (grub_efi_guid_t guid, static grub_err_t grub_cmd_efiemu_unload (grub_command_t cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), + int argc __attribute__ ((unused)), char *args[] __attribute__ ((unused))) { return grub_efiemu_unload (); @@ -171,7 +171,7 @@ grub_cmd_efiemu_unload (grub_command_t cmd __attribute__ ((unused)), static grub_err_t grub_cmd_efiemu_prepare (grub_command_t cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), + int argc __attribute__ ((unused)), char *args[] __attribute__ ((unused))) { return grub_efiemu_prepare (); @@ -180,15 +180,15 @@ grub_cmd_efiemu_prepare (grub_command_t cmd __attribute__ ((unused)), -int -grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key +int +grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key __attribute__ ((unused))) { /* Nothing to do here yet */ return 1; } -int +int grub_efiemu_finish_boot_services (void) { /* Nothing to do here yet */ @@ -201,11 +201,11 @@ grub_efiemu_load_file (const char *filename) { grub_file_t file; grub_err_t err; - + file = grub_file_open (filename); if (! file) return 0; - + err = grub_efiemu_mm_init (); if (err) { @@ -244,19 +244,19 @@ grub_efiemu_autocore (void) return GRUB_ERR_NONE; prefix = grub_env_get ("prefix"); - + if (! prefix) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "couldn't find efiemu core because prefix " "isn't set"); - + suffix = grub_efiemu_get_default_core_name (); - + filename = grub_malloc (grub_strlen (prefix) + grub_strlen (suffix) + 2); if (! filename) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate temporary space"); - + grub_sprintf (filename, "%s/%s", prefix, suffix); err = grub_efiemu_load_file (filename); @@ -277,7 +277,7 @@ grub_efiemu_prepare (void) { grub_err_t err; - grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n", + grub_dprintf ("efiemu", "Preparing %d-bit efiemu\n", 8 * grub_efiemu_sizeof_uintn_t ()); err = grub_efiemu_autocore (); @@ -321,16 +321,16 @@ grub_efiemu_pnvram_cmd_register (void); GRUB_MOD_INIT(efiemu) { - cmd_loadcore = grub_register_command ("efiemu_loadcore", - grub_cmd_efiemu_load, - "efiemu_loadcore FILE", + cmd_loadcore = grub_register_command ("efiemu_loadcore", + grub_cmd_efiemu_load, + "efiemu_loadcore FILE", "Load and initialize EFI emulator"); - cmd_prepare = grub_register_command ("efiemu_prepare", - grub_cmd_efiemu_prepare, - "efiemu_prepare", + cmd_prepare = grub_register_command ("efiemu_prepare", + grub_cmd_efiemu_prepare, + "efiemu_prepare", "Finalize loading of EFI emulator"); - cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload, - "efiemu_unload", + cmd_unload = grub_register_command ("efiemu_unload", grub_cmd_efiemu_unload, + "efiemu_unload", "Unload EFI emulator"); grub_efiemu_pnvram_cmd_register (); } diff --git a/efiemu/mm.c b/efiemu/mm.c index e7dcf399e..7d6a5d466 100644 --- a/efiemu/mm.c +++ b/efiemu/mm.c @@ -17,10 +17,10 @@ * along with GRUB. If not, see . */ /* - To keep efiemu runtime contiguous this mm is special. + To keep efiemu runtime contiguous this mm is special. It uses deferred allocation. In the first stage you may request memory with grub_efiemu_request_memalign - It will give you a handle with which in the second phase you can access your + It will give you a handle with which in the second phase you can access your memory with grub_efiemu_mm_obtain_request (handle). It's guaranteed that subsequent calls with the same handle return the same result. You can't request any additional memory once you're in the second phase */ @@ -32,7 +32,7 @@ #include #include -struct grub_efiemu_memrequest +struct grub_efiemu_memrequest { struct grub_efiemu_memrequest *next; grub_efi_memory_type_t type; @@ -54,7 +54,7 @@ static int mmap_reserved_size = 0, mmap_num = 0; /* Add a memory region to map*/ static grub_err_t -grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, +grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, grub_efi_memory_type_t type) { grub_uint64_t page_start, npages; @@ -63,10 +63,10 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, if (mmap_num >= mmap_reserved_size) { efiemu_mmap = (grub_efi_memory_descriptor_t *) - grub_realloc (efiemu_mmap, (++mmap_reserved_size) + grub_realloc (efiemu_mmap, (++mmap_reserved_size) * sizeof (grub_efi_memory_descriptor_t)); if (!efiemu_mmap) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Not enough space for memory map"); } @@ -74,9 +74,9 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, page_start = start - (start % GRUB_EFIEMU_PAGESIZE); npages = (size + (start % GRUB_EFIEMU_PAGESIZE) + GRUB_EFIEMU_PAGESIZE - 1) / GRUB_EFIEMU_PAGESIZE; - efiemu_mmap[mmap_num].physical_start = page_start; - efiemu_mmap[mmap_num].virtual_start = page_start; - efiemu_mmap[mmap_num].num_pages = npages; + efiemu_mmap[mmap_num].physical_start = page_start; + efiemu_mmap[mmap_num].virtual_start = page_start; + efiemu_mmap[mmap_num].num_pages = npages; efiemu_mmap[mmap_num].type = type; mmap_num++; @@ -84,11 +84,11 @@ grub_efiemu_add_to_mmap (grub_uint64_t start, grub_uint64_t size, } /* Request a resident memory of type TYPE of size SIZE aligned at ALIGN - ALIGN must be a divisor of page size (if it's a divisor of 4096 + ALIGN must be a divisor of page size (if it's a divisor of 4096 it should be ok on all platforms) */ int -grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, +grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, grub_efi_memory_type_t type) { grub_size_t align_overhead; @@ -113,8 +113,8 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, ret->val = 0; ret->next = 0; prev = 0; - - /* Add request to the end of the chain. + + /* Add request to the end of the chain. It should be at the end because otherwise alignment isn't guaranteed */ for (cur = memrequests; cur; prev = cur, cur = cur->next); if (prev) @@ -155,20 +155,20 @@ efiemu_alloc_requests (void) GRUB_EFI_RUNTIME_SERVICES_CODE, GRUB_EFI_RUNTIME_SERVICES_DATA, GRUB_EFI_ACPI_MEMORY_NVS, - - /* And then unavailable memory types. This is more for a completeness. + + /* And then unavailable memory types. This is more for a completeness. You should double think before allocating memory of any of these types */ GRUB_EFI_UNUSABLE_MEMORY, GRUB_EFI_MEMORY_MAPPED_IO, GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE, - GRUB_EFI_PAL_CODE + GRUB_EFI_PAL_CODE }; /* Compute total memory needed */ for (i = 0; i < sizeof (reqorder) / sizeof (reqorder[0]); i++) { - align_overhead = GRUB_EFIEMU_PAGESIZE + align_overhead = GRUB_EFIEMU_PAGESIZE - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE); if (align_overhead == GRUB_EFIEMU_PAGESIZE) align_overhead = 0; @@ -178,7 +178,7 @@ efiemu_alloc_requests (void) /* Allocate the whole memory in one block */ resident_memory = grub_memalign (GRUB_EFIEMU_PAGESIZE, total_alloc); if (!resident_memory) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate resident memory"); /* Split the memory into blocks by type */ @@ -199,14 +199,14 @@ efiemu_alloc_requests (void) } /* Ensure that the regions are page-aligned */ - align_overhead = GRUB_EFIEMU_PAGESIZE + align_overhead = GRUB_EFIEMU_PAGESIZE - (requested_memory[reqorder[i]] % GRUB_EFIEMU_PAGESIZE); if (align_overhead == GRUB_EFIEMU_PAGESIZE) align_overhead = 0; curptr = ((grub_uint8_t *)curptr) + align_overhead; - + /* Add the region to memory map */ - grub_efiemu_add_to_mmap (PTR_TO_UINT64 (typestart), + grub_efiemu_add_to_mmap (PTR_TO_UINT64 (typestart), curptr - typestart, reqorder[i]); } @@ -270,7 +270,7 @@ grub_efiemu_mm_return_request (int handle) static grub_err_t grub_efiemu_mmap_init (void) { - auto int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t, grub_uint64_t, + auto int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR bounds_hook (grub_uint64_t addr __attribute__ ((unused)), grub_uint64_t size __attribute__ ((unused)), @@ -302,7 +302,7 @@ grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, { if (!efiemu_mmap) { - grub_error (GRUB_ERR_INVALID_COMMAND, + grub_error (GRUB_ERR_INVALID_COMMAND, "you need to first launch efiemu_prepare"); return -1; } @@ -373,26 +373,26 @@ grub_efiemu_mmap_fill (void) switch (type) { case GRUB_MACHINE_MEMORY_AVAILABLE: - return grub_efiemu_add_to_mmap (addr, size, + return grub_efiemu_add_to_mmap (addr, size, GRUB_EFI_CONVENTIONAL_MEMORY); #ifdef GRUB_MACHINE_MEMORY_ACPI case GRUB_MACHINE_MEMORY_ACPI: - return grub_efiemu_add_to_mmap (addr, size, + return grub_efiemu_add_to_mmap (addr, size, GRUB_EFI_ACPI_RECLAIM_MEMORY); #endif #ifdef GRUB_MACHINE_MEMORY_NVS case GRUB_MACHINE_MEMORY_NVS: - return grub_efiemu_add_to_mmap (addr, size, + return grub_efiemu_add_to_mmap (addr, size, GRUB_EFI_ACPI_MEMORY_NVS); #endif default: grub_printf ("Unknown memory type %d. Marking as unusable\n", type); case GRUB_MACHINE_MEMORY_RESERVED: - return grub_efiemu_add_to_mmap (addr, size, - GRUB_EFI_UNUSABLE_MEMORY); + return grub_efiemu_add_to_mmap (addr, size, + GRUB_EFI_UNUSABLE_MEMORY); } } @@ -404,8 +404,8 @@ grub_efiemu_mmap_fill (void) } grub_err_t -grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, - grub_uint64_t, +grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, grub_uint32_t)) { unsigned i; @@ -414,10 +414,10 @@ grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, switch (efiemu_mmap[i].type) { case GRUB_EFI_RUNTIME_SERVICES_CODE: - hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_EFIEMU_MEMORY_CODE); break; - + case GRUB_EFI_RESERVED_MEMORY_TYPE: case GRUB_EFI_RUNTIME_SERVICES_DATA: case GRUB_EFI_UNUSABLE_MEMORY: @@ -425,30 +425,30 @@ grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: case GRUB_EFI_PAL_CODE: case GRUB_EFI_MAX_MEMORY_TYPE: - hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_EFIEMU_MEMORY_RESERVED); break; - + case GRUB_EFI_LOADER_CODE: case GRUB_EFI_LOADER_DATA: case GRUB_EFI_BOOT_SERVICES_CODE: case GRUB_EFI_BOOT_SERVICES_DATA: case GRUB_EFI_CONVENTIONAL_MEMORY: - hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_EFIEMU_MEMORY_AVAILABLE); break; - + case GRUB_EFI_ACPI_RECLAIM_MEMORY: - hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_EFIEMU_MEMORY_ACPI); break; - + case GRUB_EFI_ACPI_MEMORY_NVS: - hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, + hook (efiemu_mmap[i].physical_start, efiemu_mmap[i].num_pages * 4096, GRUB_EFIEMU_MEMORY_NVS); break; } - + return 0; } @@ -459,8 +459,8 @@ grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, static grub_err_t grub_efiemu_mmap_sort_and_uniq (void) { - /* If same page is used by multiple types it's resolved - according to priority + /* If same page is used by multiple types it's resolved + according to priority 0 - free memory 1 - memory immediately usable after ExitBootServices 2 - memory usable after loading ACPI tables @@ -512,20 +512,20 @@ grub_efiemu_mmap_sort_and_uniq (void) /* Initialize variables*/ grub_memset (present, 0, sizeof (int) * GRUB_EFI_MAX_MEMORY_TYPE); - scanline_events = (struct grub_efiemu_mmap_scan *) + scanline_events = (struct grub_efiemu_mmap_scan *) grub_malloc (sizeof (struct grub_efiemu_mmap_scan) * 2 * mmap_num); /* Number of chunks can't increase more than by factor of 2 */ - result = (grub_efi_memory_descriptor_t *) + result = (grub_efi_memory_descriptor_t *) grub_malloc (sizeof (grub_efi_memory_descriptor_t) * 2 * mmap_num); if (!result || !scanline_events) { grub_free (result); grub_free (scanline_events); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate space for new memory map"); } - + /* Register scanline events */ for (i = 0; i < mmap_num; i++) { @@ -538,8 +538,8 @@ grub_efiemu_mmap_sort_and_uniq (void) scanline_events[2 * i + 1].memtype = efiemu_mmap[i].type; } - /* Primitive bubble sort. It has complexity O(n^2) but since we're - unlikely to have more than 100 chunks it's probably one of the + /* Primitive bubble sort. It has complexity O(n^2) but since we're + unlikely to have more than 100 chunks it's probably one of the fastest for one purpose */ done = 1; while (done) @@ -574,29 +574,29 @@ grub_efiemu_mmap_sort_and_uniq (void) curtype = k; /* Add memory region to resulting map if necessary */ - if ((curtype == -1 || curtype != lasttype) + if ((curtype == -1 || curtype != lasttype) && lastaddr != scanline_events[i].pos && lasttype != -1) { result[j].virtual_start = result[j].physical_start = lastaddr; - result[j].num_pages = (scanline_events[i].pos - lastaddr) + result[j].num_pages = (scanline_events[i].pos - lastaddr) / GRUB_EFIEMU_PAGESIZE; result[j].type = lasttype; /* We set runtime attribute on pages we need to be mapped */ - result[j].attribute + result[j].attribute = (lasttype == GRUB_EFI_RUNTIME_SERVICES_CODE || lasttype == GRUB_EFI_RUNTIME_SERVICES_DATA) ? GRUB_EFI_MEMORY_RUNTIME : 0; - grub_dprintf ("efiemu", - "mmap entry: type %d start 0x%llx 0x%llx pages\n", + grub_dprintf ("efiemu", + "mmap entry: type %d start 0x%llx 0x%llx pages\n", result[j].type, result[j].physical_start, result[j].num_pages); j++; } /* Update last values if necessary */ - if (curtype == -1 || curtype != lasttype) + if (curtype == -1 || curtype != lasttype) { lasttype = curtype; lastaddr = scanline_events[i].pos; @@ -605,7 +605,7 @@ grub_efiemu_mmap_sort_and_uniq (void) grub_free (scanline_events); - /* Shrink resulting memory map to really used size and replace efiemu_mmap + /* Shrink resulting memory map to really used size and replace efiemu_mmap by new value */ grub_free (efiemu_mmap); efiemu_mmap = grub_realloc (result, j * sizeof (*result)); @@ -619,7 +619,7 @@ grub_efiemu_mm_do_alloc (void) grub_err_t err; /* Preallocate mmap */ - efiemu_mmap = (grub_efi_memory_descriptor_t *) + efiemu_mmap = (grub_efi_memory_descriptor_t *) grub_malloc (mmap_reserved_size * sizeof (grub_efi_memory_descriptor_t)); if (!efiemu_mmap) { @@ -632,4 +632,4 @@ grub_efiemu_mm_do_alloc (void) if ((err = grub_efiemu_mmap_fill ())) return err; return grub_efiemu_mmap_sort_and_uniq (); -} +} diff --git a/efiemu/pnvram.c b/efiemu/pnvram.c index 0cc0eb85e..d5daaabb8 100644 --- a/efiemu/pnvram.c +++ b/efiemu/pnvram.c @@ -45,13 +45,13 @@ static grub_uint32_t accuracy; static const struct grub_arg_option options[] = { {"size", 's', 0, "number of bytes to reserve for pseudo NVRAM", 0, ARG_TYPE_INT}, - {"high-monotonic-count", 'm', 0, + {"high-monotonic-count", 'm', 0, "Initial value of high monotonic count", 0, ARG_TYPE_INT}, - {"timezone", 't', 0, + {"timezone", 't', 0, "Timezone, offset in minutes from GMT", 0, ARG_TYPE_INT}, - {"accuracy", 'a', 0, + {"accuracy", 'a', 0, "Accuracy of clock, in 1e-12 units", 0, ARG_TYPE_INT}, - {"daylight", 'd', 0, + {"daylight", 'd', 0, "Daylight value, as per EFI specifications", 0, ARG_TYPE_INT}, {0, 0, 0, 0, 0, 0} }; @@ -68,14 +68,14 @@ grub_strtosl (char *arg, char **end, int base) /* Export stuff for efiemu */ static grub_err_t nvram_set (void * data __attribute__ ((unused))) -{ +{ /* Take definitive pointers */ grub_uint8_t *nvram_def = grub_efiemu_mm_obtain_request (nvram_handle); - grub_uint32_t *nvramsize_def + grub_uint32_t *nvramsize_def = grub_efiemu_mm_obtain_request (nvramsize_handle); grub_uint32_t *high_monotonic_count_def = grub_efiemu_mm_obtain_request (high_monotonic_count_handle); - grub_int16_t *timezone_def + grub_int16_t *timezone_def = grub_efiemu_mm_obtain_request (timezone_handle); grub_uint8_t *daylight_def = grub_efiemu_mm_obtain_request (daylight_handle); @@ -94,11 +94,11 @@ nvram_set (void * data __attribute__ ((unused))) /* Register symbols */ grub_efiemu_register_symbol ("efiemu_variables", nvram_handle, 0); grub_efiemu_register_symbol ("efiemu_varsize", nvramsize_handle, 0); - grub_efiemu_register_symbol ("efiemu_high_monotonic_count", + grub_efiemu_register_symbol ("efiemu_high_monotonic_count", high_monotonic_count_handle, 0); grub_efiemu_register_symbol ("efiemu_time_zone", timezone_handle, 0); grub_efiemu_register_symbol ("efiemu_time_daylight", daylight_handle, 0); - grub_efiemu_register_symbol ("efiemu_time_accuracy", + grub_efiemu_register_symbol ("efiemu_time_accuracy", accuracy_handle, 0); return GRUB_ERR_NONE; @@ -134,7 +134,7 @@ read_pnvram (char *filename) struct efi_variable *efivar; grub_size_t guidlen, datalen; unsigned i, j; - + file = grub_file_open (filename); if (!file) return grub_error (GRUB_ERR_BAD_OS, "couldn't read pnvram"); @@ -157,17 +157,17 @@ read_pnvram (char *filename) efivar = (struct efi_variable *) nvramptr; if (nvramptr - nvram + sizeof (struct efi_variable) > nvramsize) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "file is too large for reserved variable space"); nvramptr += sizeof (struct efi_variable); /* look ahow long guid field is*/ - guidlen = 0; - for (ptr2 = ptr; (grub_isspace (*ptr2) + guidlen = 0; + for (ptr2 = ptr; (grub_isspace (*ptr2) || (*ptr2 >= '0' && *ptr2 <= '9') || (*ptr2 >= 'a' && *ptr2 <= 'f') - || (*ptr2 >= 'A' && *ptr2 <= 'F')); + || (*ptr2 >= 'A' && *ptr2 <= 'F')); ptr2++) if (!grub_isspace (*ptr2)) guidlen++; @@ -175,7 +175,7 @@ read_pnvram (char *filename) /* Read guid */ if (guidlen != sizeof (efivar->guid)) - { + { grub_free (buf); return grub_error (GRUB_ERR_BAD_OS, "can't parse %s", filename); } @@ -190,14 +190,14 @@ read_pnvram (char *filename) hex = *ptr - 'a' + 10; if (*ptr >= 'A' && *ptr <= 'F') hex = *ptr - 'A' + 10; - + if (i%2 == 0) ((grub_uint8_t *)&(efivar->guid))[i/2] = hex << 4; else ((grub_uint8_t *)&(efivar->guid))[i/2] |= hex; ptr++; } - + while (grub_isspace (*ptr)) ptr++; if (*ptr != ':') @@ -230,23 +230,23 @@ read_pnvram (char *filename) { /* Look the length */ datalen = 0; - for (ptr2 = ptr; *ptr2 && (grub_isspace (*ptr2) + for (ptr2 = ptr; *ptr2 && (grub_isspace (*ptr2) || (*ptr2 >= '0' && *ptr2 <= '9') || (*ptr2 >= 'a' && *ptr2 <= 'f') - || (*ptr2 >= 'A' && *ptr2 <= 'F')); + || (*ptr2 >= 'A' && *ptr2 <= 'F')); ptr2++) if (!grub_isspace (*ptr2)) datalen++; datalen /= 2; - + if (nvramptr - nvram + datalen > nvramsize) { grub_free (buf); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "file is too large for reserved " " variable space"); } - + for (i = 0; i < 2 * datalen; i++) { int hex = 0; @@ -258,7 +258,7 @@ read_pnvram (char *filename) hex = *ptr - 'a' + 10; if (*ptr >= 'A' && *ptr <= 'F') hex = *ptr - 'A' + 10; - + if (i%2 == 0) nvramptr[i/2] = hex << 4; else @@ -278,7 +278,7 @@ read_pnvram (char *filename) efivar->size = datalen; else efivar->namelen = datalen; - + ptr++; } } @@ -304,23 +304,23 @@ grub_efiemu_make_nvram (void) grub_free (nvram); return err; } - nvram_handle - = grub_efiemu_request_memalign (1, nvramsize, + nvram_handle + = grub_efiemu_request_memalign (1, nvramsize, GRUB_EFI_RUNTIME_SERVICES_DATA); - nvramsize_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), + nvramsize_handle + = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), GRUB_EFI_RUNTIME_SERVICES_DATA); high_monotonic_count_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), + = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), GRUB_EFI_RUNTIME_SERVICES_DATA); timezone_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint16_t), + = grub_efiemu_request_memalign (1, sizeof (grub_uint16_t), GRUB_EFI_RUNTIME_SERVICES_DATA); daylight_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint8_t), + = grub_efiemu_request_memalign (1, sizeof (grub_uint8_t), GRUB_EFI_RUNTIME_SERVICES_DATA); accuracy_handle - = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), + = grub_efiemu_request_memalign (1, sizeof (grub_uint32_t), GRUB_EFI_RUNTIME_SERVICES_DATA); grub_efiemu_request_symbols (6); @@ -341,7 +341,7 @@ grub_efiemu_pnvram (void) nvram = grub_malloc (nvramsize); if (!nvram) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't allocate space for temporary pnvram storage"); grub_memset (nvram, 0, nvramsize); @@ -360,16 +360,16 @@ grub_cmd_efiemu_pnvram (struct grub_extcmd *cmd, nvramsize = state[0].set ? grub_strtoul (state[0].arg, 0, 0) : 2048; high_monotonic_count = state[1].set ? grub_strtoul (state[1].arg, 0, 0) : 1; - timezone = state[2].set ? grub_strtosl (state[2].arg, 0, 0) + timezone = state[2].set ? grub_strtosl (state[2].arg, 0, 0) : GRUB_EFI_UNSPECIFIED_TIMEZONE; accuracy = state[3].set ? grub_strtoul (state[3].arg, 0, 0) : 50000000; daylight = state[4].set ? grub_strtoul (state[4].arg, 0, 0) : 0; - + nvram = grub_malloc (nvramsize); if (!nvram) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't allocate space for temporary pnvram storage"); - grub_memset (nvram, 0, nvramsize); + grub_memset (nvram, 0, nvramsize); if (argc == 1 && (err = read_pnvram (args[0]))) { @@ -387,11 +387,11 @@ void grub_efiemu_pnvram_cmd_unregister (void); void grub_efiemu_pnvram_cmd_register (void) { - cmd = grub_register_extcmd ("efiemu_pnvram", grub_cmd_efiemu_pnvram, + cmd = grub_register_extcmd ("efiemu_pnvram", grub_cmd_efiemu_pnvram, GRUB_COMMAND_FLAG_BOTH, "efiemu_pnvram [FILENAME]", "Initialise pseudo-NVRAM and load variables " - "from FILE", + "from FILE", options); } diff --git a/efiemu/prepare.c b/efiemu/prepare.c index d0787293f..048893317 100644 --- a/efiemu/prepare.c +++ b/efiemu/prepare.c @@ -1,4 +1,4 @@ -/* Prepare efiemu. E.g. allocate memory, load the runtime +/* Prepare efiemu. E.g. allocate memory, load the runtime to appropriate place, etc */ /* * GRUB -- GRand Unified Bootloader @@ -26,7 +26,7 @@ grub_err_t SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, - struct grub_efiemu_configuration_table + struct grub_efiemu_configuration_table *config_tables) { grub_err_t err; @@ -46,8 +46,8 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, /* Request space for the list of configuration tables */ for (cur = config_tables; cur; cur = cur->next) cntconftables++; - conftable_handle - = grub_efiemu_request_memalign (GRUB_EFIEMU_PAGESIZE, + conftable_handle + = grub_efiemu_request_memalign (GRUB_EFIEMU_PAGESIZE, cntconftables * sizeof (*conftables), GRUB_EFI_RUNTIME_SERVICES_DATA); @@ -69,31 +69,31 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, return err; } - if ((err = grub_efiemu_resolve_symbol ("efiemu_system_table", + if ((err = grub_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off))) { grub_efiemu_unload (); return err; } - SUFFIX (grub_efiemu_system_table) - = (TYPE (grub_efi_system_table) *) + SUFFIX (grub_efiemu_system_table) + = (TYPE (grub_efi_system_table) *) ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); /* compute CRC32 of runtime_services */ - if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", + if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", &handle, &off))) return err; runtime_services = (TYPE (grub_efiemu_runtime_services) *) ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); runtime_services->hdr.crc32 = 0; - runtime_services->hdr.crc32 = grub_getcrc32 + runtime_services->hdr.crc32 = grub_getcrc32 (0, runtime_services, runtime_services->hdr.header_size); /* Put pointer to the list of configuration tables in system table */ grub_efiemu_write_value - (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, - conftable_handle, 0, 1, + (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, + conftable_handle, 0, 1, sizeof (SUFFIX (grub_efiemu_system_table)->configuration_table)); SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables; @@ -103,7 +103,7 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, i = 0; for (cur = config_tables; cur; cur = cur->next, i++) { - grub_memcpy (&(conftables[i].vendor_guid), &(cur->guid), + grub_memcpy (&(conftables[i].vendor_guid), &(cur->guid), sizeof (cur->guid)); if (cur->get_table) conftables[i].vendor_table @@ -114,13 +114,13 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, /* compute CRC32 of system table */ SUFFIX (grub_efiemu_system_table)->hdr.crc32 = 0; - SUFFIX (grub_efiemu_system_table)->hdr.crc32 - = grub_getcrc32 (0, SUFFIX (grub_efiemu_system_table), + SUFFIX (grub_efiemu_system_table)->hdr.crc32 + = grub_getcrc32 (0, SUFFIX (grub_efiemu_system_table), SUFFIX (grub_efiemu_system_table)->hdr.header_size); grub_dprintf ("efiemu","system_table = %p, runtime_services = %p," " conftables = %p (%d entries)\n", - SUFFIX (grub_efiemu_system_table), runtime_services, + SUFFIX (grub_efiemu_system_table), runtime_services, conftables, cntconftables); return GRUB_ERR_NONE; diff --git a/efiemu/runtime/efiemu.S b/efiemu/runtime/efiemu.S index e0923cce1..b502314ee 100644 --- a/efiemu/runtime/efiemu.S +++ b/efiemu/runtime/efiemu.S @@ -29,10 +29,10 @@ * %rcx, %rdx, %r8, %r9, 32(%rsp), 40(%rsp), 48(%rsp), ... * */ - + .file "efiemu.S" .text - + FUNCTION (efiemu_get_time) push %rdi push %rsi @@ -104,7 +104,7 @@ FUNCTION (efiemu_set_variable) mov %rcx, %rdi mov %rdx, %rsi mov %r8, %rdx - mov %r9, %rcx + mov %r9, %rcx mov 56(%rsp), %r8 call efiemu_set_variable_real pop %rsi @@ -133,8 +133,8 @@ FUNCTION (efiemu_reset_system) ret /* The following functions are always called in physical mode */ - .section ".text-physical", "ax" - + .section ".text-physical", "ax" + FUNCTION (efiemu_set_virtual_address_map) push %rdi push %rsi diff --git a/efiemu/runtime/efiemu.c b/efiemu/runtime/efiemu.c index 0316e4957..085e75d0c 100644 --- a/efiemu/runtime/efiemu.c +++ b/efiemu/runtime/efiemu.c @@ -17,8 +17,8 @@ */ /* This is an emulation of EFI runtime services. - This allows a more uniform boot on i386 machines. - As it emulates only runtime serviceit isn't able + This allows a more uniform boot on i386 machines. + As it emulates only runtime serviceit isn't able to chainload EFI bootloader on non-EFI system (TODO) */ #include @@ -26,7 +26,7 @@ #include #include -grub_efi_status_t +grub_efi_status_t efiemu_get_time (grub_efi_time_t *time, grub_efi_time_capabilities_t *capabilities); grub_efi_status_t @@ -54,7 +54,7 @@ efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, PHYSICAL_ATTRIBUTE; grub_efi_status_t -efiemu_convert_pointer (grub_efi_uintn_t debug_disposition, +efiemu_convert_pointer (grub_efi_uintn_t debug_disposition, void **address) PHYSICAL_ATTRIBUTE; @@ -84,14 +84,14 @@ efiemu_reset_system (grub_efi_reset_type_t reset_type, grub_efi_uintn_t data_size, grub_efi_char16_t *reset_data); -grub_efi_status_t +grub_efi_status_t EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t, grub_efi_uintn_t, grub_efi_uint32_t, grub_efi_memory_descriptor_t *) PHYSICAL_ATTRIBUTE; grub_efi_status_t -EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, +EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, void **address) PHYSICAL_ATTRIBUTE; static grub_uint32_t @@ -100,15 +100,15 @@ efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) static void init_crc32_table (void) PHYSICAL_ATTRIBUTE; -static grub_uint32_t +static grub_uint32_t reflect (grub_uint32_t ref, int len) PHYSICAL_ATTRIBUTE; - + /* The log. It's used when examining memory dump -*/ +*/ static grub_uint8_t loge[1000] = "EFIEMULOG"; -static int logn = 9; +static int logn = 9; #define LOG(x) { if (logn<900) loge[logn++]=x; } static int ptv_relocated = 0; @@ -189,7 +189,7 @@ int __stack_chk_fail () return 0; } -/* The function that implement runtime services as specified in +/* The function that implement runtime services as specified in EFI specification */ static inline grub_uint8_t bcd_to_hex (grub_uint8_t in) @@ -197,7 +197,7 @@ bcd_to_hex (grub_uint8_t in) return 10 * ((in & 0xf0) >> 4) + (in & 0x0f); } -grub_efi_status_t +grub_efi_status_t EFI_FUNC (efiemu_get_time) (grub_efi_time_t *time, grub_efi_time_capabilities_t *capabilities) { @@ -279,19 +279,19 @@ EFI_FUNC (efiemu_set_wakeup_time) (grub_efi_boolean_t enabled, static grub_uint32_t crc32_table [256]; -static grub_uint32_t +static grub_uint32_t reflect (grub_uint32_t ref, int len) { grub_uint32_t result = 0; int i; - + for (i = 1; i <= len; i++) { if (ref & 1) result |= 1 << (len - i); ref >>= 1; } - + return result; } @@ -332,7 +332,7 @@ efiemu_getcrc32 (grub_uint32_t crc, void *buf, int size) } -grub_efi_status_t EFI_FUNC +grub_efi_status_t EFI_FUNC (efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, grub_efi_uintn_t descriptor_size, grub_efi_uint32_t descriptor_version, @@ -341,12 +341,12 @@ grub_efi_status_t EFI_FUNC struct grub_efiemu_ptv_rel *cur_relloc; LOG ('e'); - + /* Ensure that we are called only once */ if (ptv_relocated) return GRUB_EFI_UNSUPPORTED; ptv_relocated = 1; - + /* Correct addresses using information supplied by grub */ for (cur_relloc = efiemu_ptv_relloc; cur_relloc->size;cur_relloc++) { @@ -354,8 +354,8 @@ grub_efi_status_t EFI_FUNC grub_efi_memory_descriptor_t *descptr; /* Compute correction */ - for (descptr = virtual_map; - ((grub_uint8_t *) descptr - (grub_uint8_t *) virtual_map) + for (descptr = virtual_map; + ((grub_uint8_t *) descptr - (grub_uint8_t *) virtual_map) < memory_map_size; descptr = (grub_efi_memory_descriptor_t *) ((grub_uint8_t *) descptr + descriptor_size)) @@ -386,27 +386,27 @@ grub_efi_status_t EFI_FUNC /* Recompute crc32 of system table and runtime services */ efiemu_system_table.hdr.crc32 = 0; - efiemu_system_table.hdr.crc32 = efiemu_getcrc32 + efiemu_system_table.hdr.crc32 = efiemu_getcrc32 (0, &efiemu_system_table, sizeof (efiemu_system_table)); efiemu_runtime_services.hdr.crc32 = 0; - efiemu_runtime_services.hdr.crc32 = efiemu_getcrc32 + efiemu_runtime_services.hdr.crc32 = efiemu_getcrc32 (0, &efiemu_runtime_services, sizeof (efiemu_runtime_services)); return GRUB_EFI_SUCCESS; } -/* since efiemu_set_virtual_address_map corrects all the pointers +/* since efiemu_set_virtual_address_map corrects all the pointers we don't need efiemu_convert_pointer */ grub_efi_status_t -EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, +EFI_FUNC (efiemu_convert_pointer) (grub_efi_uintn_t debug_disposition, void **address) { LOG ('f'); return GRUB_EFI_UNSUPPORTED; } -/* Next comes variable services. Because we have no vendor-independent +/* Next comes variable services. Because we have no vendor-independent way to store these variables we have no non-volatility */ /* Find variable by name and GUID. */ @@ -423,7 +423,7 @@ find_variable (grub_efi_guid_t *vendor_guid, if (!efivar->namelen) return 0; if (efiemu_str16equal((grub_efi_char16_t *)(efivar + 1), variable_name) - && efiemu_memequal (&(efivar->guid), vendor_guid, + && efiemu_memequal (&(efivar->guid), vendor_guid, sizeof (efivar->guid))) return efivar; ptr += efivar->namelen + efivar->size + sizeof (*efivar); @@ -452,11 +452,11 @@ EFI_FUNC (efiemu_get_variable) (grub_efi_char16_t *variable_name, efiemu_memcpy (data, (grub_uint8_t *)(efivar + 1) + efivar->namelen, efivar->size); *attributes = efivar->attributes; - + return GRUB_EFI_SUCCESS; } -grub_efi_status_t EFI_FUNC +grub_efi_status_t EFI_FUNC (efiemu_get_next_variable_name) (grub_efi_uintn_t *variable_name_size, grub_efi_char16_t *variable_name, grub_efi_guid_t *vendor_guid) @@ -471,15 +471,15 @@ grub_efi_status_t EFI_FUNC efivar = find_variable (vendor_guid, variable_name); if (!efivar) return GRUB_EFI_NOT_FOUND; - efivar = (struct efi_variable *)((grub_uint8_t *)efivar - + efivar->namelen + efivar = (struct efi_variable *)((grub_uint8_t *)efivar + + efivar->namelen + efivar->size + sizeof (*efivar)); } else efivar = (struct efi_variable *) (efiemu_variables); LOG ('m'); - if ((grub_uint8_t *)efivar >= efiemu_variables + efiemu_varsize + if ((grub_uint8_t *)efivar >= efiemu_variables + efiemu_varsize || !efivar->namelen) return GRUB_EFI_NOT_FOUND; if (*variable_name_size < efivar->namelen) @@ -489,7 +489,7 @@ grub_efi_status_t EFI_FUNC } efiemu_memcpy (variable_name, efivar + 1, efivar->namelen); - efiemu_memcpy (vendor_guid, &(efivar->guid), + efiemu_memcpy (vendor_guid, &(efivar->guid), sizeof (efivar->guid)); LOG('h'); @@ -513,12 +513,12 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, /* Delete variable if any */ if (efivar) { - efiemu_memcpy (efivar, (grub_uint8_t *)(efivar + 1) - + efivar->namelen + efivar->size, + efiemu_memcpy (efivar, (grub_uint8_t *)(efivar + 1) + + efivar->namelen + efivar->size, (efiemu_variables + efiemu_varsize) - - ((grub_uint8_t *)(efivar + 1) + - ((grub_uint8_t *)(efivar + 1) + efivar->namelen + efivar->size)); - efiemu_memset (efiemu_variables + efiemu_varsize + efiemu_memset (efiemu_variables + efiemu_varsize - (sizeof (*efivar) + efivar->namelen + efivar->size), 0, (sizeof (*efivar) + efivar->namelen + efivar->size)); } @@ -533,8 +533,8 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, if (!efivar->namelen) break; } - if ((grub_uint8_t *)(efivar + 1) + data_size - + 2 * (efiemu_str16len (variable_name) + 1) + if ((grub_uint8_t *)(efivar + 1) + data_size + + 2 * (efiemu_str16len (variable_name) + 1) >= efiemu_variables + efiemu_varsize) return GRUB_EFI_OUT_OF_RESOURCES; @@ -542,16 +542,16 @@ EFI_FUNC (efiemu_set_variable) (grub_efi_char16_t *variable_name, efivar->namelen = 2 * (efiemu_str16len (variable_name) + 1); efivar->size = data_size; efivar->attributes = attributes; - efiemu_memcpy (efivar + 1, variable_name, + efiemu_memcpy (efivar + 1, variable_name, 2 * (efiemu_str16len (variable_name) + 1)); - efiemu_memcpy ((grub_uint8_t *)(efivar + 1) - + 2 * (efiemu_str16len (variable_name) + 1), + efiemu_memcpy ((grub_uint8_t *)(efivar + 1) + + 2 * (efiemu_str16len (variable_name) + 1), data, data_size); return GRUB_EFI_SUCCESS; } -grub_efi_status_t EFI_FUNC +grub_efi_status_t EFI_FUNC (efiemu_get_next_high_monotonic_count) (grub_efi_uint32_t *high_count) { LOG ('j'); @@ -574,9 +574,9 @@ EFI_FUNC (efiemu_reset_system) (grub_efi_reset_type_t reset_type, LOG ('k'); } -struct grub_efi_runtime_services efiemu_runtime_services = +struct grub_efi_runtime_services efiemu_runtime_services = { - .hdr = + .hdr = { .signature = GRUB_EFIEMU_RUNTIME_SERVICES_SIGNATURE, .revision = 0x0001000a, @@ -596,18 +596,18 @@ struct grub_efi_runtime_services efiemu_runtime_services = .get_next_variable_name = efiemu_get_next_variable_name, .set_variable = efiemu_set_variable, .get_next_high_monotonic_count = efiemu_get_next_high_monotonic_count, - + .reset_system = efiemu_reset_system }; -static grub_uint16_t efiemu_vendor[] = +static grub_uint16_t efiemu_vendor[] = {'G', 'R', 'U', 'B', ' ', 'E', 'F', 'I', ' ', 'R', 'U', 'N', 'T', 'I', 'M', 'E', 0}; struct grub_efi_system_table efiemu_system_table = { - .hdr = + .hdr = { .signature = GRUB_EFIEMU_SYSTEM_TABLE_SIGNATURE, .revision = 0x0001000a, diff --git a/efiemu/runtime/efiemu.sh b/efiemu/runtime/efiemu.sh index 1ae059ad4..5a492dc2f 100644 --- a/efiemu/runtime/efiemu.sh +++ b/efiemu/runtime/efiemu.sh @@ -1,4 +1,4 @@ gcc -c -m32 -DELF32 -o efiemu32.o ./efiemu.c -Wall -Werror -nostdlib -O2 -I. -I../../include gcc -c -m64 -DELF64 -o efiemu64_c.o ./efiemu.c -Wall -Werror -mcmodel=large -O2 -I. -I../../include gcc -c -m64 -DELF64 -o efiemu64_s.o ./efiemu.S -Wall -Werror -mcmodel=large -O2 -I. -I../../include -ld -o efiemu64.o -r efiemu64_s.o efiemu64_c.o -nostdlib +ld -o efiemu64.o -r efiemu64_s.o efiemu64_c.o -nostdlib diff --git a/efiemu/symbols.c b/efiemu/symbols.c index b3111b616..ec508d975 100644 --- a/efiemu/symbols.c +++ b/efiemu/symbols.c @@ -57,16 +57,16 @@ grub_efiemu_free_syms (void) } /* Announce that the module will need NUM allocators */ -/* Because of deferred memory allocation all the relocators have to be +/* Because of deferred memory allocation all the relocators have to be announced during phase 1*/ grub_err_t grub_efiemu_request_symbols (int num) { if (ptv_alloc) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return grub_error (GRUB_ERR_BAD_ARGUMENT, "symbols have already been allocated"); if (num < 0) - return grub_error (GRUB_ERR_BAD_ARGUMENT, + return grub_error (GRUB_ERR_BAD_ARGUMENT, "can't request negative symbols"); ptv_requested += num; return GRUB_ERR_NONE; @@ -111,15 +111,15 @@ grub_err_t grub_efiemu_alloc_syms (void) { ptv_alloc = ptv_requested; - ptv_handle = grub_efiemu_request_memalign - (1, (ptv_requested + 1) * sizeof (struct grub_efiemu_ptv_rel), + ptv_handle = grub_efiemu_request_memalign + (1, (ptv_requested + 1) * sizeof (struct grub_efiemu_ptv_rel), GRUB_EFI_RUNTIME_SERVICES_DATA); grub_efiemu_register_symbol ("efiemu_ptv_relloc", ptv_handle, 0); return grub_errno; } -/* Write value (pointer to memory PLUS_HANDLE) - - (pointer to memory MINUS_HANDLE) + VALUE to ADDR assuming that the +/* Write value (pointer to memory PLUS_HANDLE) + - (pointer to memory MINUS_HANDLE) + VALUE to ADDR assuming that the size SIZE bytes. If PTV_NEEDED is 1 then announce it to runtime that this value needs to be recomputed before going to virtual mode */ @@ -130,22 +130,22 @@ grub_efiemu_write_value (void *addr, grub_uint32_t value, int plus_handle, /* Announce relocator to runtime */ if (ptv_needed) { - struct grub_efiemu_ptv_rel *ptv_rels + struct grub_efiemu_ptv_rel *ptv_rels = grub_efiemu_mm_obtain_request (ptv_handle); if (ptv_needed && ptv_written >= ptv_alloc) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "your module didn't declare efiemu " " relocators correctly"); if (minus_handle) - ptv_rels[ptv_written].minustype + ptv_rels[ptv_written].minustype = grub_efiemu_mm_get_type (minus_handle); else ptv_rels[ptv_written].minustype = 0; if (plus_handle) - ptv_rels[ptv_written].plustype + ptv_rels[ptv_written].plustype = grub_efiemu_mm_get_type (plus_handle); else ptv_rels[ptv_written].plustype = 0; @@ -153,7 +153,7 @@ grub_efiemu_write_value (void *addr, grub_uint32_t value, int plus_handle, ptv_rels[ptv_written].addr = PTR_TO_UINT64 (addr); ptv_rels[ptv_written].size = size; ptv_written++; - + /* memset next value to zero to mark the end */ grub_memset (&ptv_rels[ptv_written], 0, sizeof (ptv_rels[ptv_written])); } diff --git a/font/font.c b/font/font.c index 9d788a9f8..f0a01af2d 100644 --- a/font/font.c +++ b/font/font.c @@ -36,7 +36,7 @@ struct char_index_entry grub_uint32_t code; grub_uint8_t storage_flags; grub_uint32_t offset; - + /* Glyph if loaded, or NULL otherwise. */ struct grub_font_glyph *glyph; }; @@ -72,13 +72,13 @@ struct font_file_section { /* The file this section is in. */ grub_file_t file; - + /* FOURCC name of the section. */ char name[4]; - + /* Length of the section contents. */ grub_uint32_t length; - + /* Set by open_section() on EOF. */ int eof; }; @@ -170,10 +170,10 @@ font_init (grub_font_t font) font->family = 0; font->point_size = 0; font->weight = 0; - + /* Default leading value, not in font file yet. */ font->leading = 1; - + font->max_char_width = 0; font->max_char_height = 0; font->ascent = 0; @@ -646,7 +646,7 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) if (! font->file) /* No open file, can't load any glyphs. */ - return 0; + return 0; /* Make sure we can find glyphs for error messages. Push active error message to error stack and reset error message. */ @@ -900,7 +900,7 @@ get_font_diversity(grub_font_t a, grub_font_t b) else /* Penalty for missing attributes. */ d += 50; - + /* Weight is a minor factor. */ d += (a->weight != b->weight) ? 5 : 0; @@ -991,13 +991,13 @@ grub_font_draw_glyph (struct grub_font_glyph *glyph, | GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP; glyph_bitmap.mode_info.blit_format = GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED; glyph_bitmap.mode_info.bpp = 1; - + /* Really 1 bit per pixel. */ glyph_bitmap.mode_info.bytes_per_pixel = 0; - + /* Packed densely as bits. */ glyph_bitmap.mode_info.pitch = glyph->width; - + glyph_bitmap.mode_info.number_of_colors = 2; glyph_bitmap.mode_info.bg_red = 0; glyph_bitmap.mode_info.bg_green = 0; diff --git a/font/font_cmd.c b/font/font_cmd.c index c3f428316..0402b8d77 100644 --- a/font/font_cmd.c +++ b/font/font_cmd.c @@ -71,7 +71,7 @@ GRUB_MOD_INIT(font_manager) GRUB_MOD_FINI(font_manager) { - /* TODO: Determine way to free allocated resources. + /* TODO: Determine way to free allocated resources. Warning: possible pointer references could be in use. */ grub_unregister_command (cmd_loadfont); diff --git a/fs/affs.c b/fs/affs.c index 4b729c207..286b99f9a 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -127,7 +127,7 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) sizeof (file), &file); if (grub_errno) return 0; - + block = grub_be_to_cpu32 (file.extension); } @@ -139,7 +139,7 @@ grub_affs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) sizeof (pos), &pos); if (grub_errno) return 0; - + return grub_be_to_cpu32 (pos); } @@ -353,7 +353,7 @@ grub_affs_iterate_dir (grub_fshelp_node_t dir, sizeof (file), (char *) &file); if (grub_errno) goto fail; - + file.name[file.namelen] = '\0'; if ((int) grub_be_to_cpu32 (file.type) == GRUB_AFFS_FILETYPE_DIR) @@ -370,7 +370,7 @@ grub_affs_iterate_dir (grub_fshelp_node_t dir, return 1; next = grub_be_to_cpu32 (file.next); - } + } } grub_free (hashtable); @@ -389,18 +389,18 @@ grub_affs_open (struct grub_file *file, const char *name) { struct grub_affs_data *data; struct grub_fshelp_node *fdiro = 0; - + grub_dl_ref (my_mod); - + data = grub_affs_mount (file->device->disk); if (!data) goto fail; - + grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_affs_iterate_dir, grub_affs_read_symlink, GRUB_FSHELP_REG); if (grub_errno) goto fail; - + file->size = fdiro->size; data->diropen = *fdiro; grub_free (fdiro); @@ -414,7 +414,7 @@ grub_affs_open (struct grub_file *file, const char *name) if (data && fdiro != &data->diropen) grub_free (fdiro); grub_free (data); - + grub_dl_unref (my_mod); return grub_errno; @@ -436,7 +436,7 @@ grub_affs_close (grub_file_t file) static grub_ssize_t grub_affs_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_affs_data *data = + struct grub_affs_data *data = (struct grub_affs_data *) file->data; int size = grub_affs_read_file (&data->diropen, file->read_hook, @@ -447,13 +447,13 @@ grub_affs_read (grub_file_t file, char *buf, grub_size_t len) static grub_err_t -grub_affs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_affs_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_affs_data *data = 0; struct grub_fshelp_node *fdiro = 0; - + auto int NESTED_FUNC_ATTR iterate (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node); @@ -470,18 +470,18 @@ grub_affs_dir (grub_device_t device, const char *path, } grub_dl_ref (my_mod); - + data = grub_affs_mount (device->disk); if (!data) goto fail; - + grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_affs_iterate_dir, grub_affs_read_symlink, GRUB_FSHELP_DIR); if (grub_errno) goto fail; grub_affs_iterate_dir (fdiro, iterate); - + fail: if (data && fdiro != &data->diropen) grub_free (fdiro); diff --git a/fs/afs.c b/fs/afs.c index ea1de4f21..1f6e1633c 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -554,7 +554,7 @@ grub_afs_close (grub_file_t file) static grub_err_t grub_afs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_afs_data *data = 0;; diff --git a/fs/cpio.c b/fs/cpio.c index 0ef263ce5..1ec4ebeaf 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -181,7 +181,7 @@ fail: static grub_err_t grub_cpio_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_cpio_data *data; @@ -286,13 +286,13 @@ grub_cpio_open (grub_file_t file, const char *name) { if (name[i] != fn[j]) goto no_match; - + if (name[i] == '\0') break; - + if (name[i] == '/' && name[i+1] == '/') i++; - + i++; j++; } @@ -304,7 +304,7 @@ grub_cpio_open (grub_file_t file, const char *name) return GRUB_ERR_NONE; no_match: - + grub_free (fn); data->hofs = ofs; } diff --git a/fs/ext2.c b/fs/ext2.c index 93b6db218..0fff2fef8 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -54,7 +54,7 @@ /* Log2 size of ext2 block in 512 blocks. */ #define LOG2_EXT2_BLOCK_SIZE(data) \ (grub_le_to_cpu32 (data->sblock.log2_block_size) + 1) - + /* Log2 size of ext2 block in bytes. */ #define LOG2_BLOCK_SIZE(data) \ (grub_le_to_cpu32 (data->sblock.log2_block_size) + 10) @@ -324,7 +324,7 @@ static grub_dl_t my_mod; /* Read into BLKGRP the blockgroup descriptor of blockgroup GROUP of the mounted filesystem DATA. */ inline static grub_err_t -grub_ext2_blockgroup (struct grub_ext2_data *data, int group, +grub_ext2_blockgroup (struct grub_ext2_data *data, int group, struct grub_ext2_block_group *blkgrp) { return grub_disk_read (data->disk, @@ -382,7 +382,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) int blknr = -1; unsigned int blksz = EXT2_BLOCK_SIZE (data); int log2_blksz = LOG2_EXT2_BLOCK_SIZE (data); - + if (grub_le_to_cpu32(inode->flags) & EXT4_EXTENTS_FLAG) { char buf[EXT2_BLOCK_SIZE(data)]; @@ -440,14 +440,14 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) << log2_blksz, 0, blksz, indir)) return grub_errno; - + blknr = grub_le_to_cpu32 (indir[fileblock - INDIRECT_BLOCKS]); } /* Double indirect. */ else if (fileblock < INDIRECT_BLOCKS + blksz / 4 * (blksz / 4 + 1)) { unsigned int perblock = blksz / 4; - unsigned int rblock = fileblock - (INDIRECT_BLOCKS + unsigned int rblock = fileblock - (INDIRECT_BLOCKS + blksz / 4); grub_uint32_t indir[blksz / 4]; @@ -463,7 +463,7 @@ grub_ext2_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) 0, blksz, indir)) return grub_errno; - + blknr = grub_le_to_cpu32 (indir[rblock % perblock]); } /* triple indirect. */ @@ -488,7 +488,7 @@ grub_ext2_read_file (grub_fshelp_node_t node, pos, len, buf, grub_ext2_read_block, node->inode.size, LOG2_EXT2_BLOCK_SIZE (node->data)); - + } @@ -505,7 +505,7 @@ grub_ext2_read_inode (struct grub_ext2_data *data, /* It is easier to calculate if the first inode is 0. */ ino--; - + grub_ext2_blockgroup (data, ino / grub_le_to_cpu32 (sblock->inodes_per_group), &blkgrp); @@ -525,7 +525,7 @@ grub_ext2_read_inode (struct grub_ext2_data *data, EXT2_INODE_SIZE (data) * blkoff, sizeof (struct grub_ext2_inode), inode)) return grub_errno; - + return 0; } @@ -550,7 +550,7 @@ grub_ext2_mount (grub_disk_t disk) grub_error (GRUB_ERR_BAD_FS, "not an ext2 filesystem"); goto fail; } - + /* Check the FS doesn't have feature bits enabled that we don't support. */ if (grub_le_to_cpu32 (data->sblock.feature_incompat) & ~(EXT2_DRIVER_SUPPORTED_INCOMPAT | EXT2_DRIVER_IGNORED_INCOMPAT)) @@ -558,8 +558,8 @@ grub_ext2_mount (grub_disk_t disk) grub_error (GRUB_ERR_BAD_FS, "filesystem has unsupported incompatible features"); goto fail; } - - + + data->disk = disk; data->diropen.data = data; @@ -571,7 +571,7 @@ grub_ext2_mount (grub_disk_t disk) grub_ext2_read_inode (data, 2, data->inode); if (grub_errno) goto fail; - + return data; fail: @@ -587,23 +587,23 @@ grub_ext2_read_symlink (grub_fshelp_node_t node) { char *symlink; struct grub_fshelp_node *diro = node; - + if (! diro->inode_read) { grub_ext2_read_inode (diro->data, diro->ino, &diro->inode); if (grub_errno) return 0; } - + symlink = grub_malloc (grub_le_to_cpu32 (diro->inode.size) + 1); if (! symlink) return 0; - + /* If the filesize of the symlink is bigger than 60 the symlink is stored in a separate block, otherwise it is stored in the inode. */ if (grub_le_to_cpu32 (diro->inode.size) <= 60) - grub_strncpy (symlink, + grub_strncpy (symlink, diro->inode.symlink, grub_le_to_cpu32 (diro->inode.size)); else @@ -617,7 +617,7 @@ grub_ext2_read_symlink (grub_fshelp_node_t node) return 0; } } - + symlink[grub_le_to_cpu32 (diro->inode.size)] = '\0'; return symlink; } @@ -631,14 +631,14 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir, { unsigned int fpos = 0; struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; - + if (! diro->inode_read) { grub_ext2_read_inode (diro->data, diro->ino, &diro->inode); if (grub_errno) return 0; } - + /* Search the file. */ while (fpos < grub_le_to_cpu32 (diro->inode.size)) { @@ -648,25 +648,25 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir, (char *) &dirent); if (grub_errno) return 0; - + if (dirent.namelen != 0) { char filename[dirent.namelen + 1]; struct grub_fshelp_node *fdiro; enum grub_fshelp_filetype type = GRUB_FSHELP_UNKNOWN; - + grub_ext2_read_file (diro, 0, fpos + sizeof (struct ext2_dirent), dirent.namelen, filename); if (grub_errno) return 0; - + fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); if (! fdiro) return 0; - + fdiro->data = diro->data; fdiro->ino = grub_le_to_cpu32 (dirent.inode); - + filename[dirent.namelen] = '\0'; if (dirent.filetype != FILETYPE_UNKNOWN) @@ -692,9 +692,9 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir, grub_free (fdiro); return 0; } - + fdiro->inode_read = 1; - + if ((grub_le_to_cpu16 (fdiro->inode.mode) & FILETYPE_INO_MASK) == FILETYPE_INO_DIRECTORY) type = GRUB_FSHELP_DIR; @@ -705,14 +705,14 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir, & FILETYPE_INO_MASK) == FILETYPE_INO_REG) type = GRUB_FSHELP_REG; } - + if (hook (filename, type, fdiro)) return 1; } - + fpos += grub_le_to_cpu16 (dirent.direntlen); } - + return 0; } @@ -722,25 +722,25 @@ grub_ext2_open (struct grub_file *file, const char *name) { struct grub_ext2_data *data; struct grub_fshelp_node *fdiro = 0; - + grub_dl_ref (my_mod); - + data = grub_ext2_mount (file->device->disk); if (! data) goto fail; - + grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_ext2_iterate_dir, grub_ext2_read_symlink, GRUB_FSHELP_REG); if (grub_errno) goto fail; - + if (! fdiro->inode_read) { grub_ext2_read_inode (data, fdiro->ino, &fdiro->inode); if (grub_errno) goto fail; } - + grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_ext2_inode)); grub_free (fdiro); @@ -754,7 +754,7 @@ grub_ext2_open (struct grub_file *file, const char *name) if (fdiro != &data->diropen) grub_free (fdiro); grub_free (data); - + grub_dl_unref (my_mod); return grub_errno; @@ -775,20 +775,20 @@ static grub_ssize_t grub_ext2_read (grub_file_t file, char *buf, grub_size_t len) { struct grub_ext2_data *data = (struct grub_ext2_data *) file->data; - + return grub_ext2_read_file (&data->diropen, file->read_hook, file->offset, len, buf); } static grub_err_t -grub_ext2_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_ext2_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_ext2_data *data = 0;; struct grub_fshelp_node *fdiro = 0; - + auto int NESTED_FUNC_ATTR iterate (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node); @@ -818,18 +818,18 @@ grub_ext2_dir (grub_device_t device, const char *path, } grub_dl_ref (my_mod); - + data = grub_ext2_mount (device->disk); if (! data) goto fail; - + grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_ext2_iterate_dir, grub_ext2_read_symlink, GRUB_FSHELP_DIR); if (grub_errno) goto fail; - + grub_ext2_iterate_dir (fdiro, iterate); - + fail: if (fdiro != &data->diropen) grub_free (fdiro); @@ -890,7 +890,7 @@ grub_ext2_uuid (grub_device_t device, char **uuid) } /* Get mtime. */ -static grub_err_t +static grub_err_t grub_ext2_mtime (grub_device_t device, grub_int32_t *tm) { struct grub_ext2_data *data; @@ -901,7 +901,7 @@ grub_ext2_mtime (grub_device_t device, grub_int32_t *tm) data = grub_ext2_mount (disk); if (!data) *tm = 0; - else + else *tm = grub_le_to_cpu32 (data->sblock.utime); grub_dl_unref (my_mod); diff --git a/fs/fat.c b/fs/fat.c index a7d40dc86..cc733362f 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -126,15 +126,15 @@ struct grub_fat_data { int logical_sector_bits; grub_uint32_t num_sectors; - + grub_uint16_t fat_sector; grub_uint32_t sectors_per_fat; int fat_size; - + grub_uint32_t root_cluster; grub_uint32_t root_sector; grub_uint32_t num_root_sectors; - + int cluster_bits; grub_uint32_t cluster_eof_mark; grub_uint32_t cluster_sector; @@ -155,7 +155,7 @@ static int fat_log2 (unsigned x) { int i; - + if (x == 0) return -1; @@ -190,14 +190,14 @@ grub_fat_mount (grub_disk_t disk) && grub_strncmp((const char *) bpb.version_specific.fat12_or_fat16.fstype, "FAT16", 5) && grub_strncmp((const char *) bpb.version_specific.fat32.fstype, "FAT32", 5)) goto fail; - + /* Get the sizes of logical sectors and clusters. */ data->logical_sector_bits = fat_log2 (grub_le_to_cpu16 (bpb.bytes_per_sector)); if (data->logical_sector_bits < GRUB_DISK_SECTOR_BITS) goto fail; data->logical_sector_bits -= GRUB_DISK_SECTOR_BITS; - + data->cluster_bits = fat_log2 (bpb.sectors_per_cluster); if (data->cluster_bits < 0) goto fail; @@ -248,16 +248,16 @@ grub_fat_mount (grub_disk_t disk) { /* FAT32. */ grub_uint16_t flags = grub_le_to_cpu16 (bpb.version_specific.fat32.extended_flags); - + data->root_cluster = grub_le_to_cpu32 (bpb.version_specific.fat32.root_cluster); data->fat_size = 32; data->cluster_eof_mark = 0x0ffffff8; - + if (flags & 0x80) { /* Get an active FAT. */ unsigned active_fat = flags & 0xf; - + if (active_fat > bpb.num_fats) goto fail; @@ -320,7 +320,7 @@ grub_fat_mount (grub_disk_t disk) data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat12_or_fat16.num_serial); else data->uuid = grub_le_to_cpu32 (bpb.version_specific.fat32.num_serial); - + /* Ignore the 3rd bit, because some BIOSes assigns 0xF0 to the media descriptor, even if it is a so-called superfloppy (e.g. an USB key). The check may be too strict for this kind of stupid BIOSes, as @@ -352,7 +352,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, unsigned logical_cluster_bits; grub_ssize_t ret = 0; unsigned long sector; - + /* This is a special case. FAT12 and FAT16 doesn't have the root directory in clusters. */ if (data->file_cluster == ~0U) @@ -417,7 +417,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, case 12: if (data->cur_cluster & 1) next_cluster >>= 4; - + next_cluster &= 0x0FFF; break; } @@ -426,7 +426,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, grub_printf ("%s:%d: fat_size=%d, next_cluster=%u\n", __FILE__, __LINE__, data->fat_size, next_cluster); #endif - + /* Check the end. */ if (next_cluster >= data->cluster_eof_mark) return ret; @@ -468,7 +468,7 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, static grub_err_t grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, - int (*hook) (const char *filename, + int (*hook) (const char *filename, struct grub_fat_dir_entry *dir)) { struct grub_fat_dir_entry dir; @@ -477,10 +477,10 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, int slot = -1, slots = -1; int checksum = -1; grub_ssize_t offset = -sizeof(dir); - + if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY)) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); - + /* Allocate space enough to hold a long name. */ filename = grub_malloc (0x40 * 13 * 4 + 1); unibuf = (grub_uint16_t *) grub_malloc (0x40 * 13 * 2); @@ -490,7 +490,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, grub_free (unibuf); return 0; } - + while (1) { unsigned i; @@ -509,7 +509,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, struct grub_fat_long_name_entry *long_name = (struct grub_fat_long_name_entry *) &dir; grub_uint8_t id = long_name->id; - + if (id & 0x40) { id &= 0x3f; @@ -537,11 +537,11 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, /* This is a workaround for Japanese. */ if (dir.name[0] == 0x05) dir.name[0] = 0xe5; - + if (checksum != -1 && slot == 0) { grub_uint8_t sum; - + for (sum = 0, i = 0; i < sizeof (dir.name); i++) sum = ((sum >> 1) | (sum << 7)) + dir.name[i]; @@ -551,13 +551,13 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, for (u = 0; u < slots * 13; u++) unibuf[u] = grub_le_to_cpu16 (unibuf[u]); - + *grub_utf16_to_utf8 ((grub_uint8_t *) filename, unibuf, slots * 13) = '\0'; - + if (hook (filename, &dir)) break; - + checksum = -1; continue; } @@ -569,7 +569,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, filep = filename; if (dir.attr & GRUB_FAT_ATTR_VOLUME_ID) { - for (i = 0; i < sizeof (dir.name) && dir.name[i] + for (i = 0; i < sizeof (dir.name) && dir.name[i] && ! grub_isspace (dir.name[i]); i++) *filep++ = dir.name[i]; } @@ -577,9 +577,9 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, { for (i = 0; i < 8 && dir.name[i] && ! grub_isspace (dir.name[i]); i++) *filep++ = grub_tolower (dir.name[i]); - + *filep = '.'; - + for (i = 8; i < 11 && dir.name[i] && ! grub_isspace (dir.name[i]); i++) *++filep = grub_tolower (dir.name[i]); @@ -604,7 +604,7 @@ grub_fat_iterate_dir (grub_disk_t disk, struct grub_fat_data *data, static char * grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { char *dirname, *dirp; @@ -636,18 +636,18 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, if (call_hook) hook (filename, &info); - + return 1; } return 0; } - + if (! (data->attr & GRUB_FAT_ATTR_DIRECTORY)) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); return 0; } - + /* Extract a directory name. */ while (*path == '/') path++; @@ -656,7 +656,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, if (dirp) { unsigned len = dirp - path; - + dirname = grub_malloc (len + 1); if (! dirname) return 0; @@ -669,7 +669,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, dirname = grub_strdup (path); call_hook = (! dirp && hook); - + grub_fat_iterate_dir (disk, data, iter_hook); if (grub_errno == GRUB_ERR_NONE && ! found && !call_hook) grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); @@ -681,7 +681,7 @@ grub_fat_find_dir (grub_disk_t disk, struct grub_fat_data *data, static grub_err_t grub_fat_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_fat_data *data = 0; @@ -691,7 +691,7 @@ grub_fat_dir (grub_device_t device, const char *path, char *p; grub_dl_ref (my_mod); - + data = grub_fat_mount (disk); if (! data) goto fail; @@ -707,7 +707,7 @@ grub_fat_dir (grub_device_t device, const char *path, *p++ = '/'; *p = '\0'; p = dirname; - + do { p = grub_fat_find_dir (disk, data, p, hook); @@ -718,9 +718,9 @@ grub_fat_dir (grub_device_t device, const char *path, grub_free (dirname); grub_free (data); - + grub_dl_unref (my_mod); - + return grub_errno; } @@ -731,7 +731,7 @@ grub_fat_open (grub_file_t file, const char *name) char *p = (char *) name; grub_dl_ref (my_mod); - + data = grub_fat_mount (file->device->disk); if (! data) goto fail; @@ -752,15 +752,15 @@ grub_fat_open (grub_file_t file, const char *name) file->data = data; file->size = data->file_size; - + return GRUB_ERR_NONE; fail: - + grub_free (data); - + grub_dl_unref (my_mod); - + return grub_errno; } @@ -775,9 +775,9 @@ static grub_err_t grub_fat_close (grub_file_t file) { grub_free (file->data); - + grub_dl_unref (my_mod); - + return grub_errno; } @@ -799,7 +799,7 @@ grub_fat_label (grub_device_t device, char **label) } grub_dl_ref (my_mod); - + data = grub_fat_mount (disk); if (! data) goto fail; @@ -811,7 +811,7 @@ grub_fat_label (grub_device_t device, char **label) } *label = 0; - + grub_fat_iterate_dir (disk, data, iter_hook); fail: diff --git a/fs/fshelp.c b/fs/fshelp.c index 89b62387f..d0b1e493e 100644 --- a/fs/fshelp.c +++ b/fs/fshelp.c @@ -47,7 +47,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, grub_err_t err; enum grub_fshelp_filetype foundtype = GRUB_FSHELP_DIR; int symlinknest = 0; - + auto grub_err_t NESTED_FUNC_ATTR find_file (const char *currpath, grub_fshelp_node_t currroot, grub_fshelp_node_t *currfound); @@ -69,13 +69,13 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, grub_fshelp_node_t node); auto void free_node (grub_fshelp_node_t node); - + void free_node (grub_fshelp_node_t node) { if (node != rootnode && node != currroot) grub_free (node); } - + int NESTED_FUNC_ATTR iterate (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node) @@ -88,31 +88,31 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, grub_free (node); return 0; } - + /* The node is found, stop iterating over the nodes. */ type = filetype & ~GRUB_FSHELP_CASE_INSENSITIVE; oldnode = currnode; currnode = node; - + return 1; } - + grub_strncpy (fpath, currpath, grub_strlen (currpath) + 1); - + /* Remove all leading slashes. */ while (*name == '/') name++; - + if (! *name) { *currfound = currnode; return 0; } - + for (;;) { int found; - + /* Extract the actual part from the pathname. */ next = grub_strchr (name, '/'); if (next) @@ -121,7 +121,7 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, while (*next == '/') *(next++) = '\0'; } - + /* At this point it is expected that the current node is a directory, check if this is true. */ if (type != GRUB_FSHELP_DIR) @@ -129,22 +129,22 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, free_node (currnode); return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); } - + /* Iterate over the directory. */ found = iterate_dir (currnode, iterate); if (! found) { if (grub_errno) return grub_errno; - + break; } - + /* Read in the symlink and follow it. */ if (type == GRUB_FSHELP_SYMLINK) { char *symlink; - + /* Test if the symlink does not loop. */ if (++symlinknest == 8) { @@ -153,37 +153,37 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); } - + symlink = read_symlink (currnode); free_node (currnode); - + if (!symlink) { free_node (oldnode); return grub_errno; } - + /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') { free_node (oldnode); oldnode = rootnode; - } - + } + /* Lookup the node the symlink points to. */ find_file (symlink, oldnode, &currnode); type = foundtype; grub_free (symlink); - + if (grub_errno) { free_node (oldnode); return grub_errno; } } - + free_node (oldnode); - + /* Found the node! */ if (! next || *next == '\0') { @@ -191,10 +191,10 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, foundtype = type; return 0; } - + name = next; } - + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); } @@ -203,17 +203,17 @@ grub_fshelp_find_file (const char *path, grub_fshelp_node_t rootnode, grub_error (GRUB_ERR_BAD_FILENAME, "bad filename"); return grub_errno; } - + err = find_file (path, rootnode, foundnode); if (err) return err; - + /* Check if the node that was found was of the expected type. */ if (expecttype == GRUB_FSHELP_REG && foundtype != expecttype) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file"); else if (expecttype == GRUB_FSHELP_DIR && foundtype != expecttype) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); - + return 0; } @@ -252,14 +252,14 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, blknr = get_block (node, i); if (grub_errno) return -1; - + blknr = blknr << log2blocksize; /* Last block. */ if (i == blockcnt - 1) { blockend = (len + pos) & (blocksize - 1); - + /* The last portion is exactly blocksize. */ if (! blockend) blockend = blocksize; @@ -271,12 +271,12 @@ grub_fshelp_read_file (grub_disk_t disk, grub_fshelp_node_t node, skipfirst = blockoff; blockend -= skipfirst; } - + /* If the block number is 0 this block is not stored on disk but is zero filled instead. */ if (blknr) { - disk->read_hook = read_hook; + disk->read_hook = read_hook; grub_disk_read (disk, blknr, skipfirst, blockend, buf); @@ -297,7 +297,7 @@ unsigned int grub_fshelp_log2blksize (unsigned int blksize, unsigned int *pow) { int mod; - + *pow = 0; while (blksize > 1) { diff --git a/fs/hfs.c b/fs/hfs.c index e8821e092..2f0702cbb 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -103,7 +103,7 @@ struct grub_hfs_catalog_key { grub_uint8_t unused; grub_uint32_t parent_dir; - + /* Filename length. */ grub_uint8_t strlen; @@ -174,28 +174,28 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat, grub_hfs_datarecord_t dr; int pos = 0; struct grub_hfs_extent_key key; - + int tree = 0; static int cache_file = 0; - static int cache_pos = 0; + static int cache_pos = 0; static grub_hfs_datarecord_t cache_dr; - + grub_memcpy (dr, dat, sizeof (dr)); - + key.forktype = 0; key.fileid = grub_cpu_to_be32 (file); - + if (cache && cache_file == file && block > cache_pos) { pos = cache_pos; key.first_block = grub_cpu_to_be16 (pos); grub_memcpy (dr, cache_dr, sizeof (cache_dr)); } - + for (;;) { int i; - + /* Try all 3 extents. */ for (i = 0; i < 3; i++) { @@ -203,7 +203,7 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat, if (grub_be_to_cpu16 (dr[i].count) + pos > block) { int first = grub_be_to_cpu16 (dr[i].first_block); - + /* If the cache is enabled, store the current position in the tree. */ if (tree && cache) @@ -212,15 +212,15 @@ grub_hfs_block (struct grub_hfs_data *data, grub_hfs_datarecord_t dat, cache_pos = pos; grub_memcpy (cache_dr, dr, sizeof (cache_dr)); } - + return (grub_be_to_cpu16 (data->sblock.first_block) + (first + block - pos) * GRUB_HFS_BLKS); } - + /* Try the next extent. */ pos += grub_be_to_cpu16 (dr[i].count); } - + /* Lookup the block in the extent overflow file. */ key.first_block = grub_cpu_to_be16 (pos); tree = 1; @@ -247,7 +247,7 @@ grub_hfs_read_file (struct grub_hfs_data *data, if (len > grub_le_to_cpu32 (data->size)) len = grub_le_to_cpu32 (data->size); - blockcnt = ((len + pos) + blockcnt = ((len + pos) + data->blksz - 1) / data->blksz; for (i = pos / data->blksz; i < blockcnt; i++) @@ -257,16 +257,16 @@ grub_hfs_read_file (struct grub_hfs_data *data, int blockend = data->blksz; int skipfirst = 0; - + blknr = grub_hfs_block (data, data->extents, data->fileid, i, 1); if (grub_errno) return -1; - + /* Last block. */ if (i == blockcnt - 1) { blockend = (len + pos) % data->blksz; - + /* The last portion is exactly EXT2_BLOCK_SIZE (data). */ if (! blockend) blockend = data->blksz; @@ -283,17 +283,17 @@ grub_hfs_read_file (struct grub_hfs_data *data, is zero filled instead. */ if (blknr) { - data->disk->read_hook = read_hook; + data->disk->read_hook = read_hook; grub_disk_read (data->disk, blknr, skipfirst, blockend, buf); data->disk->read_hook = 0; if (grub_errno) return -1; } - + buf += data->blksz - skipfirst; } - + return len; } @@ -306,13 +306,13 @@ grub_hfs_mount (grub_disk_t disk) struct grub_hfs_catalog_key key; struct grub_hfs_dirrec dir; int first_block; - + struct { struct grub_hfs_node node; struct grub_hfs_treeheader head; } treehead; - + data = grub_malloc (sizeof (struct grub_hfs_data)); if (!data) return 0; @@ -321,7 +321,7 @@ grub_hfs_mount (grub_disk_t disk) if (grub_disk_read (disk, GRUB_HFS_SBLOCK, 0, sizeof (struct grub_hfs_sblock), &data->sblock)) goto fail; - + /* Check if this is a HFS filesystem. */ if (grub_be_to_cpu16 (data->sblock.magic) != GRUB_HFS_MAGIC) { @@ -335,23 +335,23 @@ grub_hfs_mount (grub_disk_t disk) grub_error (GRUB_ERR_BAD_FS, "embedded HFS+ filesystem"); goto fail; } - + data->blksz = grub_be_to_cpu32 (data->sblock.blksz); data->disk = disk; - + /* Lookup the root node of the extent overflow tree. */ - first_block = ((grub_be_to_cpu16 (data->sblock.extent_recs[0].first_block) + first_block = ((grub_be_to_cpu16 (data->sblock.extent_recs[0].first_block) * GRUB_HFS_BLKS) + grub_be_to_cpu16 (data->sblock.first_block)); - + if (grub_disk_read (data->disk, first_block, 0, sizeof (treehead), &treehead)) goto fail; data->ext_root = grub_be_to_cpu32 (treehead.head.root_node); data->ext_size = grub_be_to_cpu16 (treehead.head.node_size); - + /* Lookup the root node of the catalog tree. */ - first_block = ((grub_be_to_cpu16 (data->sblock.catalog_recs[0].first_block) + first_block = ((grub_be_to_cpu16 (data->sblock.catalog_recs[0].first_block) * GRUB_HFS_BLKS) + grub_be_to_cpu16 (data->sblock.first_block)); if (grub_disk_read (data->disk, first_block, 0, @@ -359,32 +359,32 @@ grub_hfs_mount (grub_disk_t disk) goto fail; data->cat_root = grub_be_to_cpu32 (treehead.head.root_node); data->cat_size = grub_be_to_cpu16 (treehead.head.node_size); - + /* Lookup the root directory node in the catalog tree using the volume name. */ key.parent_dir = grub_cpu_to_be32 (1); key.strlen = data->sblock.volname[0]; grub_strcpy ((char *) key.str, (char *) (data->sblock.volname + 1)); - + if (grub_hfs_find_node (data, (char *) &key, data->cat_root, 0, (char *) &dir, sizeof (dir)) == 0) { grub_error (GRUB_ERR_BAD_FS, "can not find the hfs root directory"); goto fail; } - + if (grub_errno) goto fail; data->rootdir = grub_be_to_cpu32 (dir.dirid); - + return data; fail: grub_free (data); - + if (grub_errno == GRUB_ERR_OUT_OF_RANGE) grub_error (GRUB_ERR_BAD_FS, "not a hfs filesystem"); - + return 0; } @@ -641,7 +641,7 @@ grub_hfs_cmp_extkeys (struct grub_hfs_extent_key *k1, if (cmp == 0) cmp = grub_be_to_cpu32 (k1->fileid) - grub_be_to_cpu32 (k2->fileid); if (cmp == 0) - cmp = (grub_be_to_cpu16 (k1->first_block) + cmp = (grub_be_to_cpu16 (k1->first_block) - grub_be_to_cpu16 (k2->first_block)); return cmp; } @@ -657,24 +657,24 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, struct grub_hfs_record *)) { int nodesize = type == 0 ? data->cat_size : data->ext_size; - + union { struct grub_hfs_node node; char rawnode[nodesize]; grub_uint16_t offsets[nodesize / 2]; } node; - + do { int i; struct grub_hfs_extent *dat; int blk; - - dat = (struct grub_hfs_extent *) (type == 0 + + dat = (struct grub_hfs_extent *) (type == 0 ? (&data->sblock.catalog_recs) : (&data->sblock.extent_recs)); - + /* Read the node into memory. */ blk = grub_hfs_block (data, dat, (type == 0) ? GRUB_HFS_CNID_CAT : GRUB_HFS_CNID_EXT, @@ -682,11 +682,11 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, blk += (idx % (data->blksz / nodesize)); if (grub_errno) return grub_errno; - + if (grub_disk_read (data->disk, blk, 0, sizeof (node), &node)) return grub_errno; - + /* Iterate over all records in this node. */ for (i = 0; i < grub_be_to_cpu16 (node.node.reccnt); i++) { @@ -698,23 +698,23 @@ grub_hfs_iterate_records (struct grub_hfs_data *data, int type, int idx, } __attribute__ ((packed)) *pnt; pnt = (struct pointer *) (grub_be_to_cpu16 (node.offsets[pos]) + node.rawnode); - - struct grub_hfs_record rec = + + struct grub_hfs_record rec = { &pnt->key, pnt->keylen, &pnt->key + pnt->keylen +(pnt->keylen + 1) % 2, - nodesize - grub_be_to_cpu16 (node.offsets[pos]) + nodesize - grub_be_to_cpu16 (node.offsets[pos]) - pnt->keylen - 1 }; - + if (node_hook (&node.node, &rec)) return 0; } - + idx = grub_be_to_cpu32 (node.node.next); } while (idx && this); - + return 0; } @@ -730,18 +730,18 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, int found = -1; int isleaf = 0; int done = 0; - + auto int node_found (struct grub_hfs_node *, struct grub_hfs_record *); - + int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) { int cmp = 1; - + if (type == 0) cmp = grub_hfs_cmp_catkeys (rec->key, (void *) key); else cmp = grub_hfs_cmp_extkeys (rec->key, (void *) key); - + /* If the key is smaller or equal to the current node, mark the entry. In case of a non-leaf mode it will be used to lookup the rest of the tree. */ @@ -752,12 +752,12 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, } else /* The key can not be found in the tree. */ return 1; - + /* Check if this node is a leaf node. */ if (hnd->type == GRUB_HFS_NODE_LEAF) { isleaf = 1; - + /* Found it!!!! */ if (cmp == 0) { @@ -768,23 +768,23 @@ grub_hfs_find_node (struct grub_hfs_data *data, char *key, return 1; } } - + return 0; } - + do { found = -1; if (grub_hfs_iterate_records (data, type, idx, 0, node_found)) return 0; - + if (found == -1) return 0; idx = found; } while (! isleaf); - + return done; } @@ -799,7 +799,7 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, int found = -1; int isleaf = 0; int next = 0; - + /* The lowest key possible with DIR as root directory. */ struct grub_hfs_catalog_key key = {0, grub_cpu_to_be32 (dir), 0, ""}; @@ -807,51 +807,51 @@ grub_hfs_iterate_dir (struct grub_hfs_data *data, grub_uint32_t root_idx, auto int it_dir (struct grub_hfs_node * __attribute ((unused)), struct grub_hfs_record *); - + int node_found (struct grub_hfs_node *hnd, struct grub_hfs_record *rec) { struct grub_hfs_catalog_key *ckey = rec->key; - + if (grub_hfs_cmp_catkeys (rec->key, (void *) &key) <= 0) found = grub_be_to_cpu32 (*(grub_uint32_t *) rec->data); - + if (hnd->type == 0xFF && ckey->strlen > 0) { isleaf = 1; next = grub_be_to_cpu32 (hnd->next); - + /* An entry was found. */ if (grub_be_to_cpu32 (ckey->parent_dir) == dir) return hook (rec); } - + return 0; } - + int it_dir (struct grub_hfs_node *hnd __attribute ((unused)), struct grub_hfs_record *rec) { struct grub_hfs_catalog_key *ckey = rec->key; struct grub_hfs_catalog_key *origkey = &key; - + /* Stop when the entries do not match anymore. */ - if (grub_be_to_cpu32 (ckey->parent_dir) + if (grub_be_to_cpu32 (ckey->parent_dir) != grub_be_to_cpu32 ((origkey)->parent_dir)) return 1; - + return hook (rec); } - + do { found = -1; if (grub_hfs_iterate_records (data, 0, root_idx, 0, node_found)) return grub_errno; - + if (found == -1) return 0; - + root_idx = found; } while (! isleaf); @@ -878,21 +878,21 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, } fdrec; fdrec.frec.type = GRUB_HFS_FILETYPE_DIR; - + if (path[0] != '/') { grub_error (GRUB_ERR_BAD_FILENAME, "bad filename"); return 0; } - + origpath = grub_strdup (path); if (!origpath) return grub_errno; - + path = origpath; while (*path == '/') path++; - + while (path && grub_strlen (path)) { if (fdrec.frec.type != GRUB_HFS_FILETYPE_DIR) @@ -900,7 +900,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); goto fail; } - + /* Isolate a part of the path. */ next = grub_strchr (path, '/'); if (next) @@ -908,13 +908,13 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, while (*next == '/') *(next++) = '\0'; } - + struct grub_hfs_catalog_key key; - + key.parent_dir = grub_cpu_to_be32 (inode); key.strlen = grub_strlen (path); grub_strcpy ((char *) (key.str), path); - + /* Lookup this node. */ if (! grub_hfs_find_node (data, (char *) &key, data->cat_root, 0, (char *) &fdrec.frec, sizeof (fdrec.frec))) @@ -925,17 +925,17 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, if (grub_errno) goto fail; - + inode = grub_be_to_cpu32 (fdrec.dir.dirid); path = next; } if (retdata) grub_memcpy (retdata, &fdrec.frec, sizeof (fdrec.frec)); - + if (retinode) *retinode = inode; - + fail: grub_free (origpath); return grub_errno; @@ -944,7 +944,7 @@ grub_hfs_find_dir (struct grub_hfs_data *data, const char *path, static grub_err_t -grub_hfs_dir (grub_device_t device, const char *path, +grub_hfs_dir (grub_device_t device, const char *path, int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { @@ -959,10 +959,10 @@ grub_hfs_dir (grub_device_t device, const char *path, struct grub_hfs_catalog_key *ckey = rec->key; struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); - + grub_strncpy (fname, (char *) (ckey->str), ckey->strlen); - - if (*filetype == GRUB_HFS_FILETYPE_DIR + + if (*filetype == GRUB_HFS_FILETYPE_DIR || *filetype == GRUB_HFS_FILETYPE_FILE) { info.dir = (*filetype == GRUB_HFS_FILETYPE_DIR); @@ -970,16 +970,16 @@ grub_hfs_dir (grub_device_t device, const char *path, } return 0; } - + struct grub_hfs_data *data; struct grub_hfs_filerec frec; grub_dl_ref (my_mod); - + data = grub_hfs_mount (device->disk); if (!data) goto fail; - + /* First the directory ID for the directory. */ if (grub_hfs_find_dir (data, path, &frec, &inode)) goto fail; @@ -989,14 +989,14 @@ grub_hfs_dir (grub_device_t device, const char *path, grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); goto fail; } - + grub_hfs_iterate_dir (data, data->cat_root, inode, dir_hook); - + fail: grub_free (data); grub_dl_unref (my_mod); - + return grub_errno; } @@ -1007,18 +1007,18 @@ grub_hfs_open (struct grub_file *file, const char *name) { struct grub_hfs_data *data; struct grub_hfs_filerec frec; - + grub_dl_ref (my_mod); data = grub_hfs_mount (file->device->disk); - + if (grub_hfs_find_dir (data, name, &frec, 0)) { grub_free (data); grub_dl_unref (my_mod); return grub_errno; } - + if (frec.type != GRUB_HFS_FILETYPE_FILE) { grub_free (data); @@ -1026,7 +1026,7 @@ grub_hfs_open (struct grub_file *file, const char *name) grub_dl_unref (my_mod); return grub_errno; } - + grub_memcpy (data->extents, frec.extents, sizeof (grub_hfs_datarecord_t)); file->size = grub_be_to_cpu32 (frec.size); data->size = grub_be_to_cpu32 (frec.size); @@ -1034,16 +1034,16 @@ grub_hfs_open (struct grub_file *file, const char *name) file->offset = 0; file->data = data; - + return 0; } static grub_ssize_t grub_hfs_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_hfs_data *data = + struct grub_hfs_data *data = (struct grub_hfs_data *) file->data; - + return grub_hfs_read_file (data, file->read_hook, file->offset, len, buf); } @@ -1065,7 +1065,7 @@ grub_hfs_label (grub_device_t device, char **label) struct grub_hfs_data *data; data = grub_hfs_mount (device->disk); - + if (data) *label = grub_strndup ((char *) (data->sblock.volname + 1), *data->sblock.volname); diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 8bcaa3c7d..31bb54014 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -321,7 +321,7 @@ grub_hfsplus_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) code above used this memory, it can be freed now. */ grub_free (nnode); nnode = 0; - + if (blk != -1) return (blk + (node->data->embedded_offset >> (node->data->log2blksize @@ -455,7 +455,7 @@ grub_hfsplus_mount (grub_disk_t disk) grub_memcpy (&data->catalog_tree.file.extents, data->volheader.catalog_file.extents, sizeof data->volheader.catalog_file.extents); - data->catalog_tree.file.size = + data->catalog_tree.file.size = grub_be_to_cpu64 (data->volheader.catalog_file.size); /* Make a new node for the extent overflow file. */ @@ -465,7 +465,7 @@ grub_hfsplus_mount (grub_disk_t disk) data->volheader.extents_file.extents, sizeof data->volheader.catalog_file.extents); - data->extoverflow_tree.file.size = + data->extoverflow_tree.file.size = grub_be_to_cpu64 (data->volheader.extents_file.size); /* Read the essential information about the trees. */ @@ -518,10 +518,10 @@ grub_hfsplus_cmp_catkey (struct grub_hfsplus_key *keya, char *filename; int i; int diff; - + diff = grub_be_to_cpu32 (catkey_a->parent) - catkey_b->parent; if (diff) - return diff; + return diff; /* Change the filename in keya so the endianness is correct. */ for (i = 0; i < grub_be_to_cpu16 (catkey_a->namelen); i++) @@ -592,7 +592,7 @@ grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree, int first_rec, int (*hook) (void *record)) { - int rec; + int rec; for (;;) { @@ -661,8 +661,8 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, for (rec = 0; rec < grub_be_to_cpu16 (nodedesc->count); rec++) { struct grub_hfsplus_key *currkey; - currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec); - + currkey = grub_hfsplus_btree_recptr (btree, nodedesc, rec); + /* The action that has to be taken depend on the type of record. */ if (nodedesc->type == GRUB_HFSPLUS_BTNODE_TYPE_LEAF @@ -716,7 +716,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, grub_fshelp_node_t node)) { int ret = 0; - + auto int list_nodes (void *record); int list_nodes (void *record) { @@ -730,7 +730,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, catkey = (struct grub_hfsplus_catkey *) record; fileinfo = - (struct grub_hfsplus_catfile *) ((char *) record + (struct grub_hfsplus_catfile *) ((char *) record + grub_be_to_cpu16 (catkey->keylen) + 2 + (grub_be_to_cpu16(catkey->keylen) % 2)); @@ -796,7 +796,7 @@ grub_hfsplus_iterate_dir (grub_fshelp_node_t dir, callback function. */ node = grub_malloc (sizeof (*node)); node->data = dir->data; - + grub_memcpy (node->extents, fileinfo->data.extents, sizeof (node->extents)); node->mtime = grub_be_to_cpu32 (fileinfo->mtime) - 2082844800; @@ -839,9 +839,9 @@ grub_hfsplus_open (struct grub_file *file, const char *name) { struct grub_hfsplus_data *data; struct grub_fshelp_node *fdiro = 0; - + grub_dl_ref (my_mod); - + data = grub_hfsplus_mount (file->device->disk); if (!data) goto fail; @@ -865,7 +865,7 @@ grub_hfsplus_open (struct grub_file *file, const char *name) if (data && fdiro != &data->dirroot) grub_free (fdiro); grub_free (data); - + grub_dl_unref (my_mod); return grub_errno; @@ -887,7 +887,7 @@ grub_hfsplus_close (grub_file_t file) static grub_ssize_t grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_hfsplus_data *data = + struct grub_hfsplus_data *data = (struct grub_hfsplus_data *) file->data; int size = grub_hfsplus_read_file (&data->opened_file, file->read_hook, @@ -898,13 +898,13 @@ grub_hfsplus_read (grub_file_t file, char *buf, grub_size_t len) static grub_err_t -grub_hfsplus_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_hfsplus_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_hfsplus_data *data = 0; struct grub_fshelp_node *fdiro = 0; - + auto int NESTED_FUNC_ATTR iterate (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node); @@ -924,7 +924,7 @@ grub_hfsplus_dir (grub_device_t device, const char *path, } grub_dl_ref (my_mod); - + data = grub_hfsplus_mount (device->disk); if (!data) goto fail; @@ -938,7 +938,7 @@ grub_hfsplus_dir (grub_device_t device, const char *path, /* Iterate over all entries in this directory. */ grub_hfsplus_iterate_dir (fdiro, iterate); - + fail: if (data && fdiro != &data->dirroot) grub_free (fdiro); @@ -961,7 +961,7 @@ grub_hfsplus_label (grub_device_t device __attribute__((unused)) } /* Get mtime. */ -static grub_err_t +static grub_err_t grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm) { struct grub_hfsplus_data *data; @@ -972,7 +972,7 @@ grub_hfsplus_mtime (grub_device_t device, grub_int32_t *tm) data = grub_hfsplus_mount (disk); if (!data) *tm = 0; - else + else *tm = grub_be_to_cpu32 (data->volheader.utime) - 2082844800; grub_dl_unref (my_mod); @@ -995,8 +995,8 @@ grub_hfsplus_uuid (grub_device_t device, char **uuid) if (data) { *uuid = grub_malloc (16 + sizeof ('\0')); - grub_sprintf (*uuid, "%016llx", - (unsigned long long) + grub_sprintf (*uuid, "%016llx", + (unsigned long long) grub_be_to_cpu64 (data->volheader.num_serial)); } else diff --git a/fs/iso9660.c b/fs/iso9660.c index 32dfddbb3..c79ad4f33 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -164,27 +164,27 @@ grub_iso9660_susp_iterate (struct grub_iso9660_data *data, { char *sua; struct grub_iso9660_susp_entry *entry; - + auto grub_err_t load_sua (void); - + /* Load a part of the System Usage Area. */ grub_err_t load_sua (void) { sua = grub_malloc (sua_size); if (!sua) return grub_errno; - + if (grub_disk_read (data->disk, sua_block, sua_pos, sua_size, sua)) return grub_errno; - + entry = (struct grub_iso9660_susp_entry *) sua; return 0; } - + if (load_sua ()) return grub_errno; - + for (; (char *) entry < (char *) sua + sua_size - 1; entry = (struct grub_iso9660_susp_entry *) ((char *) entry + entry->len)) @@ -192,29 +192,29 @@ grub_iso9660_susp_iterate (struct grub_iso9660_data *data, /* The last entry. */ if (grub_strncmp ((char *) entry->sig, "ST", 2) == 0) break; - + /* Additional entries are stored elsewhere. */ if (grub_strncmp ((char *) entry->sig, "CE", 2) == 0) { struct grub_iso9660_susp_ce *ce; - + ce = (struct grub_iso9660_susp_ce *) entry; sua_size = grub_le_to_cpu32 (ce->len); sua_pos = grub_le_to_cpu32 (ce->off); sua_block = grub_le_to_cpu32 (ce->blk) << GRUB_ISO9660_LOG2_BLKSZ; - + grub_free (sua); if (load_sua ()) return grub_errno; } - + if (hook (entry)) { grub_free (sua); return 0; } } - + grub_free (sua); return 0; } @@ -248,9 +248,9 @@ grub_iso9660_mount (grub_disk_t disk) struct grub_iso9660_susp_entry *entry; struct grub_iso9660_primary_voldesc voldesc; int block; - + auto grub_err_t susp_iterate (struct grub_iso9660_susp_entry *); - + grub_err_t susp_iterate (struct grub_iso9660_susp_entry *susp_entry) { /* The "ER" entry is used to detect extensions. The @@ -262,11 +262,11 @@ grub_iso9660_mount (grub_disk_t disk) } return 0; } - + data = grub_malloc (sizeof (struct grub_iso9660_data)); if (! data) return 0; - + data->disk = disk; data->rockridge = 0; data->joliet = 0; @@ -319,7 +319,7 @@ grub_iso9660_mount (grub_disk_t disk) grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem"); goto fail; } - + sua_pos = (sizeof (rootdir) + rootdir.namelen + (rootdir.namelen % 2) - 1); sua_size = rootdir.len - sua_pos; @@ -327,7 +327,7 @@ grub_iso9660_mount (grub_disk_t disk) sua = grub_malloc (sua_size); if (! sua) goto fail; - + if (grub_disk_read (disk, (grub_le_to_cpu32 (data->voldesc.rootdir.first_sector) << GRUB_ISO9660_LOG2_BLKSZ), sua_pos, sua_size, sua)) @@ -335,9 +335,9 @@ grub_iso9660_mount (grub_disk_t disk) grub_error (GRUB_ERR_BAD_FS, "not a iso9660 filesystem"); goto fail; } - + entry = (struct grub_iso9660_susp_entry *) sua; - + /* Test if the SUSP protocol is used on this filesystem. */ if (grub_strncmp ((char *) entry->sig, "SP", 2) == 0) { @@ -345,7 +345,7 @@ grub_iso9660_mount (grub_disk_t disk) to get to the SUA (System Usage Area). */ data->susp_skip = entry->data[2]; entry = (struct grub_iso9660_susp_entry *) ((char *) entry + entry->len); - + /* Iterate over the entries in the SUA area to detect extensions. */ if (grub_iso9660_susp_iterate (data, @@ -354,9 +354,9 @@ grub_iso9660_mount (grub_disk_t disk) sua_pos, sua_size, susp_iterate)) goto fail; } - + return data; - + fail: grub_free (data); return 0; @@ -371,7 +371,7 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node) int sua_size; char *symlink = 0; int addslash = 0; - + auto void add_part (const char *part, int len); auto grub_err_t susp_iterate_sl (struct grub_iso9660_susp_entry *); @@ -379,14 +379,14 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node) void add_part (const char *part, int len) { int size = grub_strlen (symlink); - + symlink = grub_realloc (symlink, size + len + 1); if (! symlink) return; - + grub_strncat (symlink, part, len); } - + /* Read in a symlink. */ grub_err_t susp_iterate_sl (struct grub_iso9660_susp_entry *entry) { @@ -402,7 +402,7 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node) add_part ("/", 1); addslash = 0; } - + /* The current position is the `Component Flag'. */ switch (entry->data[pos] & 30) { @@ -418,15 +418,15 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node) break; } - + case 2: add_part ("./", 2); break; - + case 4: add_part ("../", 3); break; - + case 8: add_part ("/", 1); break; @@ -435,29 +435,29 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node) stored. */ pos += entry->data[pos + 1] + 2; } - + /* Check if `grub_realloc' failed. */ if (grub_errno) return grub_errno; } - + return 0; } - + if (grub_disk_read (node->data->disk, node->dir_blk, node->dir_off, sizeof (dirent), (char *) &dirent)) return 0; - + sua_off = (sizeof (dirent) + dirent.namelen + 1 - (dirent.namelen % 2) + node->data->susp_skip); sua_size = dirent.len - sua_off; - + symlink = grub_malloc (1); if (!symlink) return 0; - + *symlink = '\0'; - + if (grub_iso9660_susp_iterate (node->data, node->dir_blk, node->dir_off + sua_off, sua_size, susp_iterate_sl)) @@ -465,7 +465,7 @@ grub_iso9660_read_symlink (grub_fshelp_node_t node) grub_free (symlink); return 0; } - + return symlink; } @@ -482,7 +482,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, char *filename; int filename_alloc = 0; enum grub_fshelp_filetype type; - + auto grub_err_t susp_iterate_dir (struct grub_iso9660_susp_entry *); grub_err_t susp_iterate_dir (struct grub_iso9660_susp_entry *entry) @@ -540,7 +540,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, type = GRUB_FSHELP_UNKNOWN; } } - + return 0; } @@ -552,14 +552,14 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, offset % GRUB_DISK_SECTOR_SIZE, sizeof (dirent), (char *) &dirent)) return 0; - + /* The end of the block, skip to the next one. */ if (!dirent.len) { offset = (offset / GRUB_ISO9660_BLKSZ + 1) * GRUB_ISO9660_BLKSZ; continue; } - + { char name[dirent.namelen + 1]; int nameoffset = offset + sizeof (dirent); @@ -567,9 +567,9 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, int sua_off = (sizeof (dirent) + dirent.namelen + 1 - (dirent.namelen % 2));; int sua_size = dirent.len - sua_off; - + sua_off += offset + dir->data->susp_skip; - + filename = 0; filename_alloc = 0; type = GRUB_FSHELP_UNKNOWN; @@ -582,7 +582,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, sua_off % GRUB_DISK_SECTOR_SIZE, sua_size, susp_iterate_dir)) return 0; - + /* Read the name. */ if (grub_disk_read (dir->data->disk, (dir->blk << GRUB_ISO9660_LOG2_BLKSZ) @@ -590,11 +590,11 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, nameoffset % GRUB_DISK_SECTOR_SIZE, dirent.namelen, (char *) name)) return 0; - + node = grub_malloc (sizeof (struct grub_fshelp_node)); if (!node) return 0; - + /* Setup a new node. */ node->data = dir->data; node->size = grub_le_to_cpu32 (dirent.size); @@ -602,7 +602,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, node->dir_blk = ((dir->blk << GRUB_ISO9660_LOG2_BLKSZ) + offset / GRUB_DISK_SECTOR_SIZE); node->dir_off = offset % GRUB_DISK_SECTOR_SIZE; - + /* If the filetype was not stored using rockridge, use whatever is stored in the iso9660 filesystem. */ if (type == GRUB_FSHELP_UNKNOWN) @@ -612,7 +612,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, else type = GRUB_FSHELP_REG; } - + /* The filename was not stored in a rock ridge entry. Read it from the iso9660 filesystem. */ if (!filename) @@ -621,7 +621,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, filename = grub_strrchr (name, ';'); if (filename) *filename = '\0'; - + if (dirent.namelen == 1 && name[0] == 0) filename = "."; else if (dirent.namelen == 1 && name[0] == 1) @@ -629,7 +629,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, else filename = name; } - + if (dir->data->joliet) { char *oldname; @@ -653,24 +653,24 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, if (filename_alloc) grub_free (filename); } - + offset += dirent.len; } - + return 0; } static grub_err_t -grub_iso9660_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_iso9660_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_iso9660_data *data = 0; struct grub_fshelp_node rootnode; struct grub_fshelp_node *foundnode; - + auto int NESTED_FUNC_ATTR iterate (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node); @@ -691,11 +691,11 @@ grub_iso9660_dir (grub_device_t device, const char *path, data = grub_iso9660_mount (device->disk); if (! data) goto fail; - + rootnode.data = data; rootnode.blk = grub_le_to_cpu32 (data->voldesc.rootdir.first_sector); rootnode.size = grub_le_to_cpu32 (data->voldesc.rootdir.size); - + /* Use the fshelp function to traverse the path. */ if (grub_fshelp_find_file (path, &rootnode, &foundnode, @@ -703,13 +703,13 @@ grub_iso9660_dir (grub_device_t device, const char *path, grub_iso9660_read_symlink, GRUB_FSHELP_DIR)) goto fail; - + /* List the files in the directory. */ grub_iso9660_iterate_dir (foundnode, iterate); - + if (foundnode != &rootnode) grub_free (foundnode); - + fail: grub_free (data); @@ -726,17 +726,17 @@ grub_iso9660_open (struct grub_file *file, const char *name) struct grub_iso9660_data *data; struct grub_fshelp_node rootnode; struct grub_fshelp_node *foundnode; - + grub_dl_ref (my_mod); data = grub_iso9660_mount (file->device->disk); if (!data) goto fail; - + rootnode.data = data; rootnode.blk = grub_le_to_cpu32 (data->voldesc.rootdir.first_sector); rootnode.size = grub_le_to_cpu32 (data->voldesc.rootdir.size); - + /* Use the fshelp function to traverse the path. */ if (grub_fshelp_find_file (name, &rootnode, &foundnode, @@ -744,21 +744,21 @@ grub_iso9660_open (struct grub_file *file, const char *name) grub_iso9660_read_symlink, GRUB_FSHELP_REG)) goto fail; - + data->first_sector = foundnode->blk; data->length = foundnode->size; - + file->data = data; file->size = foundnode->size; file->offset = 0; - + return 0; - + fail: grub_dl_unref (my_mod); - + grub_free (data); - + return grub_errno;; } @@ -766,17 +766,17 @@ grub_iso9660_open (struct grub_file *file, const char *name) static grub_ssize_t grub_iso9660_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_iso9660_data *data = + struct grub_iso9660_data *data = (struct grub_iso9660_data *) file->data; - + /* XXX: The file is stored in as a single extent. */ - data->disk->read_hook = file->read_hook; + data->disk->read_hook = file->read_hook; grub_disk_read (data->disk, data->first_sector << GRUB_ISO9660_LOG2_BLKSZ, file->offset, len, buf); data->disk->read_hook = 0; - + return len; } @@ -785,9 +785,9 @@ static grub_err_t grub_iso9660_close (grub_file_t file) { grub_free (file->data); - + grub_dl_unref (my_mod); - + return GRUB_ERR_NONE; } @@ -797,7 +797,7 @@ grub_iso9660_label (grub_device_t device, char **label) { struct grub_iso9660_data *data; data = grub_iso9660_mount (device->disk); - + if (data) { if (data->joliet) @@ -837,11 +837,11 @@ grub_iso9660_uuid (grub_device_t device, char **uuid) grub_error (GRUB_ERR_BAD_NUMBER, "No creation date in filesystem to generate UUID."); *uuid = NULL; } - else + else { *uuid = grub_malloc (sizeof ("YYYY-MM-DD-HH-mm-ss-hh")); grub_sprintf (*uuid, "%c%c%c%c-%c%c-%c%c-%c%c-%c%c-%c%c-%c%c", - data->voldesc.modified.year[0], data->voldesc.modified.year[1], + data->voldesc.modified.year[0], data->voldesc.modified.year[1], data->voldesc.modified.year[2], data->voldesc.modified.year[3], data->voldesc.modified.month[0], data->voldesc.modified.month[1], data->voldesc.modified.day[0], data->voldesc.modified.day[1], diff --git a/fs/jfs.c b/fs/jfs.c index 4bb2af962..4f9182576 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -43,14 +43,14 @@ struct grub_jfs_sblock grub_uint8_t magic[4]; grub_uint32_t version; grub_uint64_t ag_size; - + /* The size of a filesystem block in bytes. XXX: currently only 4096 was tested. */ grub_uint32_t blksz; grub_uint16_t log2_blksz; - + grub_uint8_t unused[71]; - grub_uint8_t volname[11]; + grub_uint8_t volname[11]; }; struct grub_jfs_extent @@ -58,7 +58,7 @@ struct grub_jfs_extent /* The length of the extent in filesystem blocks. */ grub_uint16_t length; grub_uint8_t length2; - + /* The physical offset of the first block on the disk. */ grub_uint8_t blk1; grub_uint32_t blk2; @@ -76,10 +76,10 @@ struct grub_jfs_treehead { grub_uint64_t next; grub_uint64_t prev; - - grub_uint8_t flags; + + grub_uint8_t flags; grub_uint8_t unused; - + grub_uint16_t count; grub_uint16_t max; grub_uint8_t unused2[10]; @@ -94,7 +94,7 @@ struct grub_jfs_tree_extent /* The offset is the key used to lookup an extent. */ grub_uint8_t offset1; grub_uint32_t offset2; - + struct grub_jfs_extent extent; } __attribute__ ((packed)); @@ -105,15 +105,15 @@ struct grub_jfs_tree_dir this level. */ grub_uint64_t nextb; grub_uint64_t prevb; - + grub_uint8_t flags; - + /* The amount of dirents in this node. */ grub_uint8_t count; grub_uint8_t freecnt; grub_uint8_t freelist; grub_uint8_t maxslot; - + /* The location of the sorted array of pointers to dirents. */ grub_uint8_t sindex; grub_uint8_t unused[10]; @@ -161,7 +161,7 @@ struct grub_jfs_inode grub_uint32_t mode; grub_uint8_t unused3[72]; grub_uint8_t unused4[96]; - + union { /* The tree describing the extents of the file. */ @@ -177,7 +177,7 @@ struct grub_jfs_inode { grub_uint8_t unused[16]; grub_uint8_t flags; - + /* Amount of dirents in this node. */ grub_uint8_t count; grub_uint8_t freecnt; @@ -222,7 +222,7 @@ struct grub_jfs_diropen char *sorted; struct grub_jfs_leaf_dirent *leaf; struct grub_jfs_leaf_next_dirent *next_leaf; - + /* The filename and inode of the last read dirent. */ char name[255]; grub_uint32_t ino; @@ -241,19 +241,19 @@ grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode, { auto int getblk (struct grub_jfs_treehead *treehead, struct grub_jfs_tree_extent *extents); - + int getblk (struct grub_jfs_treehead *treehead, struct grub_jfs_tree_extent *extents) { int found = -1; int i; - + for (i = 0; i < grub_le_to_cpu16 (treehead->count) - 2; i++) { if (treehead->flags & GRUB_JFS_TREE_LEAF) { /* Read the leafnode. */ - if (grub_le_to_cpu32 (extents[i].offset2) <= blk + if (grub_le_to_cpu32 (extents[i].offset2) <= blk && ((grub_le_to_cpu16 (extents[i].extent.length)) + (extents[i].extent.length2 << 8) + grub_le_to_cpu32 (extents[i].offset2)) > blk) @@ -264,7 +264,7 @@ grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode, if (blk >= grub_le_to_cpu32 (extents[i].offset2)) found = i; } - + if (found != -1) { struct @@ -272,20 +272,20 @@ grub_jfs_blkno (struct grub_jfs_data *data, struct grub_jfs_inode *inode, struct grub_jfs_treehead treehead; struct grub_jfs_tree_extent extents[254]; } tree; - + if (grub_disk_read (data->disk, grub_le_to_cpu32 (extents[found].extent.blk2) << (grub_le_to_cpu16 (data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS), 0, sizeof (tree), (char *) &tree)) return -1; - + return getblk (&tree.treehead, &tree.extents[0]); } - + return -1; } - + return getblk (&inode->file.tree, &inode->file.extents[0]); } @@ -311,12 +311,12 @@ grub_jfs_read_inode (struct grub_jfs_data *data, int ino, - GRUB_DISK_SECTOR_BITS), 0, sizeof (struct grub_jfs_iag), &iag)) return grub_errno; - + inoblk = grub_le_to_cpu32 (iag.inodes[inoext].blk2); inoblk <<= (grub_le_to_cpu16 (data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS); inoblk += inonum; - + if (grub_disk_read (data->disk, inoblk, 0, sizeof (struct grub_jfs_inode), inode)) return grub_errno; @@ -338,13 +338,13 @@ grub_jfs_mount (grub_disk_t disk) if (grub_disk_read (disk, GRUB_JFS_SBLOCK, 0, sizeof (struct grub_jfs_sblock), &data->sblock)) goto fail; - + if (grub_strncmp ((char *) (data->sblock.magic), "JFS1", 4)) { grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem"); goto fail; } - + data->disk = disk; data->pos = 0; data->linknest = 0; @@ -353,15 +353,15 @@ grub_jfs_mount (grub_disk_t disk) if (grub_disk_read (data->disk, GRUB_JFS_FS1_INODE_BLK, 0, sizeof (struct grub_jfs_inode), &data->fileset)) goto fail; - + return data; - + fail: grub_free (data); - + if (grub_errno == GRUB_ERR_OUT_OF_RANGE) grub_error (GRUB_ERR_BAD_FS, "not a jfs filesystem"); - + return 0; } @@ -372,20 +372,20 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) struct grub_jfs_internal_dirent *de; struct grub_jfs_diropen *diro; int blk; - + de = (struct grub_jfs_internal_dirent *) inode->dir.dirents; - + if (!((grub_le_to_cpu32 (inode->mode) & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR)) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); return 0; } - + diro = grub_malloc (sizeof (struct grub_jfs_diropen)); if (!diro) return 0; - + diro->index = 0; diro->data = data; diro->inode = inode; @@ -408,10 +408,10 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) grub_free (diro); return 0; } - + blk = grub_le_to_cpu32 (de[inode->dir.header.sorted[0]].ex.blk2); blk <<= (grub_le_to_cpu16 (data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS); - + /* Read in the nodes until we are on the leaf node level. */ do { @@ -436,7 +436,7 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) diro->next_leaf = diro->dirpage->next_dirent; diro->sorted = &diro->dirpage->sorted[diro->dirpage->header.sindex * 32]; diro->count = diro->dirpage->header.count; - + return diro; } @@ -461,31 +461,31 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) int len; int nextent; grub_uint16_t filename[255]; - + auto void addstr (grub_uint16_t *uname, int ulen); - + /* Add the unicode string to the utf16 filename buffer. */ void addstr (grub_uint16_t *name, int ulen) { while (ulen--) filename[strpos++] = *(name++); } - + /* The last node, read in more. */ if (diro->index == diro->count) { unsigned int next; - + /* If the inode contains the entry tree or if this was the last node, there is nothing to read. */ if ((diro->inode->file.tree.flags & GRUB_JFS_TREE_LEAF) || !grub_le_to_cpu64 (diro->dirpage->header.nextb)) return GRUB_ERR_OUT_OF_RANGE; - + next = grub_le_to_cpu64 (diro->dirpage->header.nextb); next <<= (grub_le_to_cpu16 (diro->data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS); - + if (grub_disk_read (diro->data->disk, next, 0, grub_le_to_cpu32 (diro->data->sblock.blksz), diro->dirpage->sorted)) @@ -500,18 +500,18 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) leaf = &diro->leaf[(int) diro->sorted[diro->index]]; next_leaf = &diro->next_leaf[diro->index]; - + len = leaf->len; if (!len) { diro->index++; return grub_jfs_getent (diro); } - + addstr (leaf->namepart, len < 11 ? len : 11); diro->ino = grub_le_to_cpu32 (leaf->inode); len -= 11; - + /* Move down to the leaf level. */ nextent = leaf->next; if (leaf->next != 255) @@ -519,7 +519,7 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) { next_leaf = &diro->next_leaf[nextent]; addstr (next_leaf->namepart, len < 15 ? len : 15 ); - + len -= 15; nextent = next_leaf->next; } while (next_leaf->next != 255 && len > 0); @@ -528,7 +528,7 @@ grub_jfs_getent (struct grub_jfs_diropen *diro) /* Convert the temporary UTF16 filename to UTF8. */ *grub_utf16_to_utf8 ((grub_uint8_t *) (diro->name), filename, strpos) = '\0'; - + return 0; } @@ -550,15 +550,15 @@ grub_jfs_read_file (struct grub_jfs_data *data, blockcnt = ((len + pos + grub_le_to_cpu32 (data->sblock.blksz) - 1) / grub_le_to_cpu32 (data->sblock.blksz)); - + for (i = pos / grub_le_to_cpu32 (data->sblock.blksz); i < blockcnt; i++) { int blknr; int blockoff = pos % grub_le_to_cpu32 (data->sblock.blksz); int blockend = grub_le_to_cpu32 (data->sblock.blksz); - + int skipfirst = 0; - + blknr = grub_jfs_blkno (data, &data->currinode, i); if (grub_errno) return -1; @@ -567,31 +567,31 @@ grub_jfs_read_file (struct grub_jfs_data *data, if (i == blockcnt - 1) { blockend = (len + pos) % grub_le_to_cpu32 (data->sblock.blksz); - + if (!blockend) blockend = grub_le_to_cpu32 (data->sblock.blksz); } - + /* First block. */ if (i == (pos / (int) grub_le_to_cpu32 (data->sblock.blksz))) { skipfirst = blockoff; blockend -= skipfirst; } - + data->disk->read_hook = read_hook; grub_disk_read (data->disk, blknr << (grub_le_to_cpu16 (data->sblock.log2_blksz) - GRUB_DISK_SECTOR_BITS), skipfirst, blockend, buf); - + data->disk->read_hook = 0; if (grub_errno) return -1; - + buf += grub_le_to_cpu32 (data->sblock.blksz) - skipfirst; } - + return len; } @@ -606,9 +606,9 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) char *next; unsigned int pos = 0; struct grub_jfs_diropen *diro; - + grub_strncpy (fpath, path, grub_strlen (path) + 1); - + if (grub_jfs_read_inode (data, GRUB_JFS_AGGR_INODE, &data->currinode)) return grub_errno; @@ -633,28 +633,28 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) diro = grub_jfs_opendir (data, &data->currinode); if (!diro) return grub_errno; - + for (;;) { if (grub_strlen (name) == 0) return GRUB_ERR_NONE; - + if (grub_jfs_getent (diro) == GRUB_ERR_OUT_OF_RANGE) break; - + /* Check if the current direntry matches the current part of the pathname. */ if (!grub_strcmp (name, diro->name)) { int ino = diro->ino; int dirino = grub_le_to_cpu32 (data->currinode.inode); - + grub_jfs_closedir (diro); diro = 0; - + if (grub_jfs_read_inode (data, ino, &data->currinode)) break; - + /* Check if this is a symlink. */ if ((grub_le_to_cpu32 (data->currinode.mode) & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_LNK) @@ -663,12 +663,12 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) if (grub_errno) return grub_errno; } - + if (!next) return 0; pos = 0; - + name = next; next = grub_strchr (name, '/'); if (next) @@ -676,12 +676,12 @@ grub_jfs_find_file (struct grub_jfs_data *data, const char *path) next[0] = '\0'; next++; } - + /* Open this directory for reading dirents. */ diro = grub_jfs_opendir (data, &data->currinode); if (!diro) return grub_errno; - + continue; } } @@ -700,33 +700,33 @@ grub_jfs_lookup_symlink (struct grub_jfs_data *data, int ino) if (++data->linknest > GRUB_JFS_MAX_SYMLNK_CNT) return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); - + if (size <= 128) grub_strncpy (symlink, (char *) (data->currinode.symlink.path), 128); else if (grub_jfs_read_file (data, 0, 0, size, symlink) < 0) return grub_errno; symlink[size] = '\0'; - + /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') ino = 2; - + /* Now load in the old inode. */ if (grub_jfs_read_inode (data, ino, &data->currinode)) return grub_errno; - + grub_jfs_find_file (data, symlink); if (grub_errno) grub_error (grub_errno, "Can not follow symlink `%s'.", symlink); - + return grub_errno; } static grub_err_t -grub_jfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_jfs_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_jfs_data *data = 0; @@ -740,7 +740,7 @@ grub_jfs_dir (grub_device_t device, const char *path, if (grub_jfs_find_file (data, path)) goto fail; - + diro = grub_jfs_opendir (data, &data->currinode); if (!diro) goto fail; @@ -751,16 +751,16 @@ grub_jfs_dir (grub_device_t device, const char *path, struct grub_jfs_inode inode; struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); - + if (grub_jfs_read_inode (data, diro->ino, &inode)) goto fail; - + info.dir = (grub_le_to_cpu32 (inode.mode) & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_DIR; if (hook (diro->name, &info)) goto fail; } - + /* XXX: GRUB_ERR_OUT_OF_RANGE is used for the last dirent. */ if (grub_errno == GRUB_ERR_OUT_OF_RANGE) grub_errno = 0; @@ -786,11 +786,11 @@ grub_jfs_open (struct grub_file *file, const char *name) data = grub_jfs_mount (file->device->disk); if (!data) goto fail; - + grub_jfs_find_file (data, name); if (grub_errno) goto fail; - + /* It is only possible for open regular files. */ if (! ((grub_le_to_cpu32 (data->currinode.mode) & GRUB_JFS_FILETYPE_MASK) == GRUB_JFS_FILETYPE_REG)) @@ -798,18 +798,18 @@ grub_jfs_open (struct grub_file *file, const char *name) grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a regular file"); goto fail; } - + file->data = data; file->size = grub_le_to_cpu64 (data->currinode.size); - + return 0; - + fail: grub_dl_unref (my_mod); - + grub_free (data); - + return grub_errno;; } @@ -817,9 +817,9 @@ grub_jfs_open (struct grub_file *file, const char *name) static grub_ssize_t grub_jfs_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_jfs_data *data = + struct grub_jfs_data *data = (struct grub_jfs_data *) file->data; - + return grub_jfs_read_file (data, file->read_hook, file->offset, len, buf); } @@ -828,9 +828,9 @@ static grub_err_t grub_jfs_close (grub_file_t file) { grub_free (file->data); - + grub_dl_unref (my_mod); - + return GRUB_ERR_NONE; } @@ -840,12 +840,12 @@ grub_jfs_label (grub_device_t device, char **label) { struct grub_jfs_data *data; data = grub_jfs_mount (device->disk); - + if (data) *label = grub_strndup ((char *) (data->sblock.volname), 11); else *label = 0; - + return grub_errno; } diff --git a/fs/minix.c b/fs/minix.c index 279366bd2..44218fb89 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -96,7 +96,7 @@ struct grub_minix2_inode grub_uint32_t indir_zone; grub_uint32_t double_indir_zone; grub_uint32_t unused; - + }; /* Information about a "mounted" minix filesystem. */ @@ -147,11 +147,11 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk) return grub_le_to_cpu32 (indir32); } } - + /* Direct block. */ if (blk < 7) return GRUB_MINIX_INODE_DIR_ZONES (data, blk); - + /* Indirect block. */ blk -= 7; if (blk < GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data)) @@ -159,23 +159,23 @@ grub_minix_get_file_block (struct grub_minix_data *data, unsigned int blk) indir = grub_get_indir (GRUB_MINIX_INODE_INDIR_ZONE (data), blk); return indir; } - + /* Double indirect block. */ blk -= GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data); if (blk < (GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data)) * (GRUB_MINIX_ZONESZ / GRUB_MINIX_INODE_BLKSZ (data))) { - indir = grub_get_indir (GRUB_MINIX_INODE_DINDIR_ZONE (data), + indir = grub_get_indir (GRUB_MINIX_INODE_DINDIR_ZONE (data), blk / GRUB_MINIX_ZONESZ); - + indir = grub_get_indir (indir, blk % GRUB_MINIX_ZONESZ); - + return indir; } - + /* This should never happen. */ grub_error (GRUB_ERR_OUT_OF_RANGE, "file bigger than maximum size"); - + return 0; } @@ -197,46 +197,46 @@ grub_minix_read_file (struct grub_minix_data *data, len = GRUB_MINIX_INODE_SIZE (data); blockcnt = (len + pos + GRUB_MINIX_BSIZE - 1) / GRUB_MINIX_BSIZE; - + for (i = pos / GRUB_MINIX_BSIZE; i < blockcnt; i++) { int blknr; int blockoff = pos % GRUB_MINIX_BSIZE; int blockend = GRUB_MINIX_BSIZE; - + int skipfirst = 0; - + blknr = grub_minix_get_file_block (data, i); if (grub_errno) return -1; - + /* Last block. */ if (i == blockcnt - 1) { blockend = (len + pos) % GRUB_MINIX_BSIZE; - + if (!blockend) blockend = GRUB_MINIX_BSIZE; } - + /* First block. */ if (i == (pos / (int) GRUB_MINIX_BSIZE)) { skipfirst = blockoff; blockend -= skipfirst; } - + data->disk->read_hook = read_hook; grub_disk_read (data->disk, blknr << GRUB_MINIX_LOG2_ZONESZ, skipfirst, blockend, buf); - + data->disk->read_hook = 0; if (grub_errno) return -1; - + buf += GRUB_MINIX_BSIZE - skipfirst; } - + return len; } @@ -254,33 +254,33 @@ grub_minix_read_inode (struct grub_minix_data *data, int ino) /* The first inode in minix is inode 1. */ ino--; - + block = ((2 + grub_le_to_cpu16 (sblock->inode_bmap_size) + grub_le_to_cpu16 (sblock->zone_bmap_size)) << GRUB_MINIX_LOG2_BSIZE); - + if (data->version == 1) { block += ino / (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix_inode)); - int offs = (ino % (GRUB_DISK_SECTOR_SIZE + int offs = (ino % (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix_inode)) * sizeof (struct grub_minix_inode)); - + grub_disk_read (data->disk, block, offs, sizeof (struct grub_minix_inode), &data->inode); } else { - block += ino / (GRUB_DISK_SECTOR_SIZE + block += ino / (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix2_inode)); - int offs = (ino + int offs = (ino % (GRUB_DISK_SECTOR_SIZE / sizeof (struct grub_minix2_inode)) * sizeof (struct grub_minix2_inode)); - + grub_disk_read (data->disk, block, offs, sizeof (struct grub_minix2_inode),&data->inode2); } - + return GRUB_ERR_NONE; } @@ -291,28 +291,28 @@ static grub_err_t grub_minix_lookup_symlink (struct grub_minix_data *data, int ino) { char symlink[GRUB_MINIX_INODE_SIZE (data) + 1]; - + if (++data->linknest > GRUB_MINIX_MAX_SYMLNK_CNT) return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); - + if (grub_minix_read_file (data, 0, 0, GRUB_MINIX_INODE_SIZE (data), symlink) < 0) return grub_errno; symlink[GRUB_MINIX_INODE_SIZE (data)] = '\0'; - + /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') ino = GRUB_MINIX_ROOT_INODE; - + /* Now load in the old inode. */ if (grub_minix_read_inode (data, ino)) return grub_errno; - + grub_minix_find_file (data, symlink); if (grub_errno) grub_error (grub_errno, "Can not follow symlink `%s'.", symlink); - + return grub_errno; } @@ -327,9 +327,9 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path) char *next; unsigned int pos = 0; int dirino; - + grub_strcpy (fpath, path); - + /* Skip the first slash. */ if (name[0] == '/') { @@ -345,15 +345,15 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path) next[0] = '\0'; next++; } - + do { grub_uint16_t ino; char filename[data->filename_size + 1]; - + if (grub_strlen (name) == 0) return GRUB_ERR_NONE; - + if (grub_minix_read_file (data, 0, pos, sizeof (ino), (char *) &ino) < 0) return grub_errno; @@ -362,28 +362,28 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path) return grub_errno; filename[data->filename_size] = '\0'; - + /* Check if the current direntry matches the current part of the pathname. */ if (!grub_strcmp (name, filename)) { dirino = data->ino; grub_minix_read_inode (data, grub_le_to_cpu16 (ino)); - + /* Follow the symlink. */ - if ((GRUB_MINIX_INODE_MODE (data) + if ((GRUB_MINIX_INODE_MODE (data) & GRUB_MINIX_IFLNK) == GRUB_MINIX_IFLNK) { grub_minix_lookup_symlink (data, dirino); if (grub_errno) return grub_errno; } - + if (!next) return 0; - + pos = 0; - + name = next; next = grub_strchr (name, '/'); if (next) @@ -391,17 +391,17 @@ grub_minix_find_file (struct grub_minix_data *data, const char *path) next[0] = '\0'; next++; } - + if ((GRUB_MINIX_INODE_MODE (data) & GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); - + continue; } - + pos += sizeof (ino) + data->filename_size; } while (pos < GRUB_MINIX_INODE_SIZE (data)); - + grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); return grub_errno; } @@ -412,11 +412,11 @@ static struct grub_minix_data * grub_minix_mount (grub_disk_t disk) { struct grub_minix_data *data; - + data = grub_malloc (sizeof (struct grub_minix_data)); if (!data) return 0; - + /* Read the superblock. */ grub_disk_read (disk, GRUB_MINIX_SBLOCK, 0, sizeof (struct grub_minix_sblock),&data->sblock); @@ -458,34 +458,34 @@ grub_minix_mount (grub_disk_t disk) } static grub_err_t -grub_minix_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_minix_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_minix_data *data = 0; struct grub_minix_sblock *sblock; unsigned int pos = 0; - + data = grub_minix_mount (device->disk); if (!data) return grub_errno; - + grub_minix_read_inode (data, GRUB_MINIX_ROOT_INODE); if (grub_errno) goto fail; - + sblock = &data->sblock; grub_minix_find_file (data, path); if (grub_errno) goto fail; - + if ((GRUB_MINIX_INODE_MODE (data) & GRUB_MINIX_IFDIR) != GRUB_MINIX_IFDIR) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); goto fail; } - + while (pos < GRUB_MINIX_INODE_SIZE (data)) { grub_uint16_t ino; @@ -494,31 +494,31 @@ grub_minix_dir (grub_device_t device, const char *path, struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); - + if (grub_minix_read_file (data, 0, pos, sizeof (ino), (char *) &ino) < 0) return grub_errno; - + if (grub_minix_read_file (data, 0, pos + sizeof (ino), data->filename_size, (char *) filename) < 0) return grub_errno; filename[data->filename_size] = '\0'; - + /* The filetype is not stored in the dirent. Read the inode to find out the filetype. This *REALLY* sucks. */ grub_minix_read_inode (data, grub_le_to_cpu16 (ino)); - info.dir = ((GRUB_MINIX_INODE_MODE (data) + info.dir = ((GRUB_MINIX_INODE_MODE (data) & GRUB_MINIX_IFDIR) == GRUB_MINIX_IFDIR); if (hook (filename, &info) ? 1 : 0) break; - + /* Load the old inode back in. */ grub_minix_read_inode (data, dirino); pos += sizeof (ino) + data->filename_size; } - + fail: grub_free (data); return grub_errno; @@ -541,13 +541,13 @@ grub_minix_open (struct grub_file *file, const char *name) grub_free (data); return grub_errno; } - + if (!name || name[0] != '/') { grub_error (GRUB_ERR_BAD_FILENAME, "bad filename"); return grub_errno; } - + /* Traverse the directory tree to the node that should be opened. */ grub_minix_find_file (data, name); @@ -556,10 +556,10 @@ grub_minix_open (struct grub_file *file, const char *name) grub_free (data); return grub_errno; } - + file->data = data; file->size = GRUB_MINIX_INODE_SIZE (data); - + return GRUB_ERR_NONE; } @@ -567,9 +567,9 @@ grub_minix_open (struct grub_file *file, const char *name) static grub_ssize_t grub_minix_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_minix_data *data = + struct grub_minix_data *data = (struct grub_minix_data *) file->data; - + return grub_minix_read_file (data, file->read_hook, file->offset, len, buf); } @@ -578,7 +578,7 @@ static grub_err_t grub_minix_close (grub_file_t file) { grub_free (file->data); - + return GRUB_ERR_NONE; } diff --git a/fs/ntfs.c b/fs/ntfs.c index 709c6d9ed..c312b8b62 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -862,7 +862,7 @@ fail: static grub_err_t grub_ntfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_ntfs_data *data = 0; diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 9d5e9d891..04d33150f 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -319,7 +319,7 @@ grub_reiserfs_print_key (const struct grub_reiserfs_key *key) "any ", "unknown " }; - + for (a = 0; a < sizeof (struct grub_reiserfs_key); a++) grub_printf ("%02x ", ((unsigned int) ((unsigned char *) key)[a]) & 0xFF); grub_printf ("parent id = 0x%08x, self id = 0x%08x, type = %s, offset = ", @@ -376,7 +376,7 @@ grub_reiserfs_set_key_type (struct grub_reiserfs_key *key, int version) { grub_uint32_t type; - + switch (grub_type) { case GRUB_REISERFS_STAT: @@ -397,14 +397,14 @@ grub_reiserfs_set_key_type (struct grub_reiserfs_key *key, default: return; } - + if (version == 1) key->u.v1.type = grub_cpu_to_le32 (type); else key->u.v2.offset_type = ((key->u.v2.offset_type & grub_cpu_to_le64 (~0ULL >> 4)) | grub_cpu_to_le64 ((grub_uint64_t) type << 60)); - + assert (grub_reiserfs_get_key_type (key) == grub_type); } @@ -418,31 +418,31 @@ grub_reiserfs_compare_keys (const struct grub_reiserfs_key *key1, grub_uint64_t offset1, offset2; enum grub_reiserfs_item_type type1, type2; grub_uint32_t id1, id2; - + if (! key1 || ! key2) return -2; - + id1 = grub_le_to_cpu32 (key1->directory_id); id2 = grub_le_to_cpu32 (key2->directory_id); if (id1 < id2) return -1; if (id1 > id2) return 1; - + id1 = grub_le_to_cpu32 (key1->object_id); id2 = grub_le_to_cpu32 (key2->object_id); if (id1 < id2) return -1; if (id1 > id2) return 1; - + offset1 = grub_reiserfs_get_key_offset (key1); offset2 = grub_reiserfs_get_key_offset (key2); if (offset1 < offset2) return -1; if (offset1 > offset2) return 1; - + type1 = grub_reiserfs_get_key_type (key1); type2 = grub_reiserfs_get_key_type (key2); if ((type1 == GRUB_REISERFS_ANY @@ -456,7 +456,7 @@ grub_reiserfs_compare_keys (const struct grub_reiserfs_key *key1, return -1; if (type1 > type2) return 1; - + return 0; } @@ -474,7 +474,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, grub_uint16_t i; grub_uint16_t previous_level = ~0; struct grub_reiserfs_item_header *item_headers = 0; - + if (! data) { grub_error (GRUB_ERR_TEST_FAILURE, "data is NULL"); @@ -492,7 +492,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, grub_error (GRUB_ERR_TEST_FAILURE, "item is NULL"); goto fail; } - + block_size = grub_le_to_cpu16 (data->superblock.block_size); block_number = grub_le_to_cpu32 (data->superblock.root_block); #ifdef GRUB_REISERFS_DEBUG @@ -502,7 +502,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, block_header = grub_malloc (block_size); if (! block_header) goto fail; - + item->next_offset = 0; do { @@ -534,7 +534,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, struct grub_reiserfs_disk_child *children = ((struct grub_reiserfs_disk_child *) (keys + item_count)); - + for (i = 0; i < item_count && grub_reiserfs_compare_keys (key, &(keys[i])) >= 0; @@ -620,7 +620,7 @@ grub_reiserfs_get_item (struct grub_reiserfs_data *data, grub_reiserfs_print_key (block_key); #endif } - + assert (grub_errno == GRUB_ERR_NONE); grub_free (block_header); return GRUB_ERR_NONE; @@ -740,7 +740,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, struct grub_fshelp_node directory_item; grub_uint16_t entry_count, entry_number; struct grub_reiserfs_item_header *item_headers; - + grub_disk_read (data->disk, block_number * (block_size >> GRUB_DISK_SECTOR_BITS), (((grub_off_t) block_number * block_size) @@ -758,7 +758,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, goto fail; } #endif - + item_headers = (struct grub_reiserfs_item_header *) (block_header + 1); directory_headers = ((struct grub_reiserfs_directory_header *) @@ -772,7 +772,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, = &directory_headers[entry_number]; grub_uint16_t entry_state = grub_le_to_cpu16 (directory_header->state); - + if (entry_state & GRUB_REISERFS_VISIBLE_MASK) { grub_fshelp_node_t entry_item; @@ -792,14 +792,14 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, entry_item = grub_malloc (sizeof (*entry_item)); if (! entry_item) goto fail; - + if (grub_reiserfs_get_item (data, &entry_key, entry_item) != GRUB_ERR_NONE) { grub_free (entry_item); goto fail; } - + if (entry_item->type == GRUB_REISERFS_DIRECTORY) entry_type = GRUB_FSHELP_DIR; else @@ -945,7 +945,7 @@ grub_reiserfs_iterate_dir (grub_fshelp_node_t item, the current one. */ } } - + if (next_offset == 0) break; @@ -1096,7 +1096,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) while (current_position < final_position) { grub_reiserfs_set_key_offset (&key, current_key_offset); - + if (grub_reiserfs_get_item (data, &key, &found) != GRUB_ERR_NONE) goto fail; if (found.block_number == 0) @@ -1186,7 +1186,7 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) } current_key_offset = current_position + 1; } - + grub_dprintf ("reiserfs", "Have successfully read %lld bytes (%ld requested)\n", (unsigned long long) (current_position - initial_position), @@ -1258,7 +1258,7 @@ grub_reiserfs_close (grub_file_t file) /* Call HOOK with each file under DIR. */ static grub_err_t grub_reiserfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_reiserfs_data *data = 0; diff --git a/fs/sfs.c b/fs/sfs.c index 4e0ef618e..ec59b73ca 100644 --- a/fs/sfs.c +++ b/fs/sfs.c @@ -194,7 +194,7 @@ grub_sfs_read_extent (struct grub_sfs_data *data, unsigned int block, /* We found a correct leaf. */ *size = grub_be_to_cpu16 (extent->size); *nextext = grub_be_to_cpu32 (extent->next); - + grub_free (treeblock); return 0; } @@ -370,7 +370,7 @@ grub_sfs_iterate_dir (grub_fshelp_node_t dir, node->data = data; node->size = size; node->block = block; - + return hook (name, type, node); } @@ -451,18 +451,18 @@ grub_sfs_open (struct grub_file *file, const char *name) { struct grub_sfs_data *data; struct grub_fshelp_node *fdiro = 0; - + grub_dl_ref (my_mod); - + data = grub_sfs_mount (file->device->disk); if (!data) goto fail; - + grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_sfs_iterate_dir, grub_sfs_read_symlink, GRUB_FSHELP_REG); if (grub_errno) goto fail; - + file->size = fdiro->size; data->diropen = *fdiro; grub_free (fdiro); @@ -478,7 +478,7 @@ grub_sfs_open (struct grub_file *file, const char *name) if (data) grub_free (data->label); grub_free (data); - + grub_dl_unref (my_mod); return grub_errno; @@ -510,13 +510,13 @@ grub_sfs_read (grub_file_t file, char *buf, grub_size_t len) static grub_err_t -grub_sfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_sfs_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_sfs_data *data = 0; struct grub_fshelp_node *fdiro = 0; - + auto int NESTED_FUNC_ATTR iterate (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node); @@ -533,7 +533,7 @@ grub_sfs_dir (grub_device_t device, const char *path, } grub_dl_ref (my_mod); - + data = grub_sfs_mount (device->disk); if (!data) goto fail; @@ -544,7 +544,7 @@ grub_sfs_dir (grub_device_t device, const char *path, goto fail; grub_sfs_iterate_dir (fdiro, iterate); - + fail: if (data && fdiro != &data->diropen) grub_free (fdiro); diff --git a/fs/udf.c b/fs/udf.c index b45615de1..7741d45e7 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -766,7 +766,7 @@ grub_udf_iterate_dir (grub_fshelp_node_t dir, static grub_err_t grub_udf_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_udf_data *data = 0; diff --git a/fs/ufs.c b/fs/ufs.c index 75a2d404f..7a2d21f25 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -71,30 +71,30 @@ struct grub_ufs_sblock grub_uint8_t unused[16]; /* The offset of the inodes in the cylinder group. */ grub_uint32_t inoblk_offs; - + grub_uint8_t unused2[4]; - + /* The start of the cylinder group. */ grub_uint32_t cylg_offset; grub_uint8_t unused3[4]; grub_uint32_t mtime; grub_uint8_t unused4[12]; - + /* The size of a block in bytes. */ grub_int32_t bsize; grub_uint8_t unused5[48]; - + /* The size of filesystem blocks to disk blocks. */ grub_uint32_t log2_blksz; grub_uint8_t unused6[80]; - + /* Inodes stored per cylinder group. */ grub_uint32_t ino_per_group; - + /* The frags per cylinder group. */ grub_uint32_t frags_per_group; - + grub_uint8_t unused7[488]; /* Volume name for UFS2. */ @@ -103,7 +103,7 @@ struct grub_ufs_sblock grub_uint64_t mtime2; grub_uint8_t unused9[420]; - + /* Magic value to check if this is really a UFS filesystem. */ grub_uint32_t magic; }; @@ -182,7 +182,7 @@ struct grub_ufs_dirent struct { grub_uint8_t filetype_bsd; - grub_uint8_t namelen_bsd; + grub_uint8_t namelen_bsd; }; }; } __attribute__ ((packed)); @@ -219,16 +219,16 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) { struct grub_ufs_sblock *sblock = &data->sblock; unsigned int indirsz; - int log2_blksz; - + int log2_blksz; + /* Direct. */ if (blk < GRUB_UFS_DIRBLKS) return INODE_DIRBLOCKS (data, blk); - + log2_blksz = grub_le_to_cpu32 (data->sblock.log2_blksz); - + blk -= GRUB_UFS_DIRBLKS; - + indirsz = UFS_BLKSZ (sblock) / INODE_BLKSZ (data); /* Single indirect block. */ if (blk < indirsz) @@ -239,20 +239,20 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) return (data->ufs_type == UFS1) ? indir[blk] : indir[blk << 1]; } blk -= indirsz; - + /* Double indirect block. */ if (blk < indirsz * indirsz) { grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; - + grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 1) << log2_blksz, 0, sizeof (indir), indir); grub_disk_read (data->disk, ((data->ufs_type == UFS1) ? - indir[blk / indirsz] : indir [(blk / indirsz) << 1]) + indir[blk / indirsz] : indir [(blk / indirsz) << 1]) << log2_blksz, 0, sizeof (indir), indir); - + return (data->ufs_type == UFS1) ? indir[blk % indirsz] : indir[(blk % indirsz) << 1]; } @@ -281,35 +281,35 @@ grub_ufs_read_file (struct grub_ufs_data *data, len = INODE_SIZE (data); blockcnt = (len + pos + UFS_BLKSZ (sblock) - 1) / UFS_BLKSZ (sblock); - + for (i = pos / UFS_BLKSZ (sblock); i < blockcnt; i++) { int blknr; int blockoff = pos % UFS_BLKSZ (sblock); int blockend = UFS_BLKSZ (sblock); - + int skipfirst = 0; - + blknr = grub_ufs_get_file_block (data, i); if (grub_errno) return -1; - + /* Last block. */ if (i == blockcnt - 1) { blockend = (len + pos) % UFS_BLKSZ (sblock); - + if (!blockend) blockend = UFS_BLKSZ (sblock); } - + /* First block. */ if (i == (pos / (int) UFS_BLKSZ (sblock))) { skipfirst = blockoff; blockend -= skipfirst; } - + /* XXX: If the block number is 0 this block is not stored on disk but is zero filled instead. */ if (blknr) @@ -327,7 +327,7 @@ grub_ufs_read_file (struct grub_ufs_data *data, buf += UFS_BLKSZ (sblock) - skipfirst; } - + return len; } @@ -338,16 +338,16 @@ static grub_err_t grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) { struct grub_ufs_sblock *sblock = &data->sblock; - + /* Determine the group the inode is in. */ int group = ino / grub_le_to_cpu32 (sblock->ino_per_group); - + /* Determine the inode within the group. */ int grpino = ino % grub_le_to_cpu32 (sblock->ino_per_group); - + /* The first block of the group. */ int grpblk = group * (grub_le_to_cpu32 (sblock->frags_per_group)); - + if (data->ufs_type == UFS1) { if (!inode) @@ -380,7 +380,7 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) sizeof (struct grub_ufs2_inode), inode); } - + return grub_errno; } @@ -391,16 +391,16 @@ static grub_err_t grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) { char symlink[INODE_SIZE (data)]; - + if (++data->linknest > GRUB_UFS_MAX_SYMLNK_CNT) return grub_error (GRUB_ERR_SYMLINK_LOOP, "too deep nesting of symlinks"); - + if (INODE_NBLOCKS (data) == 0) grub_strcpy (symlink, (char *) INODE (data, symlink)); else { - grub_disk_read (data->disk, - (INODE_DIRBLOCKS (data, 0) + grub_disk_read (data->disk, + (INODE_DIRBLOCKS (data, 0) << grub_le_to_cpu32 (data->sblock.log2_blksz)), 0, INODE_SIZE (data), symlink); symlink[INODE_SIZE (data)] = '\0'; @@ -409,15 +409,15 @@ grub_ufs_lookup_symlink (struct grub_ufs_data *data, int ino) /* The symlink is an absolute path, go back to the root inode. */ if (symlink[0] == '/') ino = GRUB_UFS_INODE; - + /* Now load in the old inode. */ if (grub_ufs_read_inode (data, ino, 0)) return grub_errno; - + grub_ufs_find_file (data, symlink); if (grub_errno) grub_error (grub_errno, "Can not follow symlink `%s'.", symlink); - + return grub_errno; } @@ -432,9 +432,9 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) char *next; unsigned int pos = 0; int dirino; - + grub_strcpy (fpath, path); - + /* Skip the first slash. */ if (name[0] == '/') { @@ -450,31 +450,31 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) next[0] = '\0'; next++; } - + do { struct grub_ufs_dirent dirent; int namelen; - + if (grub_strlen (name) == 0) return GRUB_ERR_NONE; - + if (grub_ufs_read_file (data, 0, pos, sizeof (dirent), (char *) &dirent) < 0) return grub_errno; namelen = (data->ufs_type == UFS2) ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen); - + { char filename[namelen + 1]; if (grub_ufs_read_file (data, 0, pos + sizeof (dirent), namelen, filename) < 0) return grub_errno; - + filename[namelen] = '\0'; - + if (!grub_strcmp (name, filename)) { dirino = data->ino; @@ -500,17 +500,17 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) next[0] = '\0'; next++; } - + if ((INODE_MODE(data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); - + continue; } } - + pos += grub_le_to_cpu16 (dirent.direntlen); } while (pos < INODE_SIZE (data)); - + grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); return grub_errno; } @@ -522,11 +522,11 @@ grub_ufs_mount (grub_disk_t disk) { struct grub_ufs_data *data; int *sblklist = sblocklist; - + data = grub_malloc (sizeof (struct grub_ufs_data)); if (!data) return 0; - + /* Find a UFS1 or UFS2 sblock. */ data->ufs_type = UNKNOWN; while (*sblklist != -1) @@ -535,7 +535,7 @@ grub_ufs_mount (grub_disk_t disk) &data->sblock); if (grub_errno) goto fail; - + if (grub_le_to_cpu32 (data->sblock.magic) == GRUB_UFS_MAGIC) { data->ufs_type = UFS1; @@ -560,17 +560,17 @@ grub_ufs_mount (grub_disk_t disk) fail: grub_free (data); - + if (grub_errno == GRUB_ERR_OUT_OF_RANGE) grub_error (GRUB_ERR_BAD_FS, "not a ufs filesystem"); - + return 0; } static grub_err_t -grub_ufs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_ufs_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_ufs_data *data; @@ -580,50 +580,50 @@ grub_ufs_dir (grub_device_t device, const char *path, data = grub_ufs_mount (device->disk); if (!data) return grub_errno; - + grub_ufs_read_inode (data, GRUB_UFS_INODE, 0); if (grub_errno) return grub_errno; - + sblock = &data->sblock; - + if (!path || path[0] != '/') { grub_error (GRUB_ERR_BAD_FILENAME, "bad filename"); return grub_errno; } - + grub_ufs_find_file (data, path); if (grub_errno) - goto fail; - + goto fail; + if ((INODE_MODE (data) & GRUB_UFS_ATTR_TYPE) != GRUB_UFS_ATTR_DIR) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "not a directory"); goto fail; } - + while (pos < INODE_SIZE (data)) { struct grub_ufs_dirent dirent; int namelen; - + if (grub_ufs_read_file (data, 0, pos, sizeof (dirent), (char *) &dirent) < 0) break; namelen = (data->ufs_type == UFS2) ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen); - + { char filename[namelen + 1]; struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); - + if (grub_ufs_read_file (data, 0, pos + sizeof (dirent), namelen, filename) < 0) break; - + filename[namelen] = '\0'; if (data->ufs_type == UFS1) { @@ -647,7 +647,7 @@ grub_ufs_dir (grub_device_t device, const char *path, if (hook (filename, &info)) break; } - + pos += grub_le_to_cpu16 (dirent.direntlen); } @@ -666,27 +666,27 @@ grub_ufs_open (struct grub_file *file, const char *name) data = grub_ufs_mount (file->device->disk); if (!data) return grub_errno; - + grub_ufs_read_inode (data, 2, 0); if (grub_errno) { grub_free (data); return grub_errno; } - + if (!name || name[0] != '/') { grub_error (GRUB_ERR_BAD_FILENAME, "bad filename"); return grub_errno; } - + grub_ufs_find_file (data, name); if (grub_errno) { grub_free (data); return grub_errno; } - + file->data = data; file->size = INODE_SIZE (data); @@ -697,9 +697,9 @@ grub_ufs_open (struct grub_file *file, const char *name) static grub_ssize_t grub_ufs_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_ufs_data *data = + struct grub_ufs_data *data = (struct grub_ufs_data *) file->data; - + return grub_ufs_read_file (data, file->read_hook, file->offset, len, buf); } @@ -708,7 +708,7 @@ static grub_err_t grub_ufs_close (grub_file_t file) { grub_free (file->data); - + return GRUB_ERR_NONE; } @@ -737,7 +737,7 @@ grub_ufs_label (grub_device_t device, char **label) } /* Get mtime. */ -static grub_err_t +static grub_err_t grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) { struct grub_ufs_data *data = 0; diff --git a/fs/xfs.c b/fs/xfs.c index 4ba6c67ca..68a4b4f56 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -42,7 +42,7 @@ struct grub_xfs_sblock grub_uint8_t unused2[8]; grub_uint64_t rootino; grub_uint8_t unused3[20]; - grub_uint32_t agsize; + grub_uint32_t agsize; grub_uint8_t unused4[20]; grub_uint8_t label[12]; grub_uint8_t log2_bsize; @@ -395,7 +395,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, { struct grub_fshelp_node *diro = (struct grub_fshelp_node *) dir; auto int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename); - + int NESTED_FUNC_ATTR call_hook (grub_uint64_t ino, char *filename) { struct grub_fshelp_node *fdiro; @@ -403,7 +403,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); if (!fdiro) return 0; - + /* The inode should be read, otherwise the filetype can not be determined. */ fdiro->ino = ino; @@ -415,7 +415,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, grub_xfs_mode_to_filetype (fdiro->inode.mode), fdiro); } - + switch (diro->inode.format) { case XFS_INODE_FORMAT_INO: @@ -453,7 +453,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, + sizeof (struct grub_xfs_dir_entry) + de->len - 1); char name[de->len + 1]; - + if (smallino) { ino = grub_be_to_cpu32 (*(grub_uint32_t *) inopos); @@ -467,7 +467,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, if (call_hook (ino, name)) return 1; - de = ((struct grub_xfs_dir_entry *) + de = ((struct grub_xfs_dir_entry *) (((char *) de)+ sizeof (struct grub_xfs_dir_entry) + de->len + ((smallino ? sizeof (grub_uint32_t) : sizeof (grub_uint64_t))) - 1)); @@ -493,7 +493,7 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, /* Iterate over every block the directory has. */ for (blk = 0; - blk < (grub_be_to_cpu64 (dir->inode.size) + blk < (grub_be_to_cpu64 (dir->inode.size) >> dirblk_log2); blk++) { @@ -585,7 +585,7 @@ grub_xfs_mount (grub_disk_t disk) if (grub_disk_read (disk, 0, 0, sizeof (struct grub_xfs_sblock), &data->sblock)) goto fail; - + if (grub_strncmp ((char *) (data->sblock.magic), "XFSB", 4)) { grub_error (GRUB_ERR_BAD_FS, "not a xfs filesystem"); @@ -606,24 +606,24 @@ grub_xfs_mount (grub_disk_t disk) return data; fail: - + if (grub_errno == GRUB_ERR_OUT_OF_RANGE) grub_error (GRUB_ERR_BAD_FS, "not an xfs filesystem"); grub_free (data); - + return 0; } static grub_err_t -grub_xfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_xfs_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { struct grub_xfs_data *data = 0;; struct grub_fshelp_node *fdiro = 0; - + auto int NESTED_FUNC_ATTR iterate (const char *filename, enum grub_fshelp_filetype filetype, grub_fshelp_node_t node); @@ -640,18 +640,18 @@ grub_xfs_dir (grub_device_t device, const char *path, } grub_dl_ref (my_mod); - + data = grub_xfs_mount (device->disk); if (!data) goto fail; - + grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_xfs_iterate_dir, grub_xfs_read_symlink, GRUB_FSHELP_DIR); if (grub_errno) goto fail; grub_xfs_iterate_dir (fdiro, iterate); - + fail: if (fdiro != &data->diropen) grub_free (fdiro); @@ -671,25 +671,25 @@ grub_xfs_open (struct grub_file *file, const char *name) { struct grub_xfs_data *data; struct grub_fshelp_node *fdiro = 0; - + grub_dl_ref (my_mod); - + data = grub_xfs_mount (file->device->disk); if (!data) goto fail; - + grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_xfs_iterate_dir, grub_xfs_read_symlink, GRUB_FSHELP_REG); if (grub_errno) goto fail; - + if (!fdiro->inode_read) { grub_xfs_read_inode (data, fdiro->ino, &fdiro->inode); if (grub_errno) goto fail; } - + grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_xfs_inode)); @@ -705,7 +705,7 @@ grub_xfs_open (struct grub_file *file, const char *name) if (fdiro != &data->diropen) grub_free (fdiro); grub_free (data); - + grub_dl_unref (my_mod); return grub_errno; @@ -715,7 +715,7 @@ grub_xfs_open (struct grub_file *file, const char *name) static grub_ssize_t grub_xfs_read (grub_file_t file, char *buf, grub_size_t len) { - struct grub_xfs_data *data = + struct grub_xfs_data *data = (struct grub_xfs_data *) file->data; return grub_xfs_read_file (&data->diropen, file->read_hook, diff --git a/genmk.rb b/genmk.rb index 05ecc9662..36f40201c 100644 --- a/genmk.rb +++ b/genmk.rb @@ -52,7 +52,7 @@ class Image objs_str = objs.join(' ') deps = objs.collect {|obj| obj.suffix('d')} deps_str = deps.join(' ') - + "CLEANFILES += #{@name} #{exe} #{objs_str} MOSTLYCLEANFILES += #{deps_str} @@ -79,7 +79,7 @@ endif flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end dir = File.dirname(src) - + "#{obj}: #{src} $(#{src}_DEPENDENCIES) $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} @@ -113,7 +113,7 @@ class PModule undsym = 'und-' + @name.suffix('lst') mod_name = File.basename(@name, '.mod') symbolic_name = mod_name.sub(/\.[^\.]*$/, '') - + "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym} ifneq ($(#{prefix}_EXPORTS),no) CLEANFILES += #{defsym} @@ -304,7 +304,7 @@ class Script end src = sources[0] if /\.in$/ !~ src - raise "unknown source file `#{src}'" + raise "unknown source file `#{src}'" end "CLEANFILES += #{@name} @@ -340,7 +340,7 @@ while l = gets cont = (/\\$/ =~ l) unless cont str.gsub!(/\\\n/, ' ') - + if /^([a-zA-Z0-9_]+)\s*\+?=\s*(.*?)\s*$/ =~ str var, args = $1, $2 @@ -357,7 +357,7 @@ while l = gets pmodules += args.split(/\s+/).collect do |pmod| PModule.new(prefix, pmod) end - + when 'UTILITIES' utils += args.split(/\s+/).collect do |util| Utility.new(prefix, util) @@ -387,10 +387,10 @@ while l = gets end end end - + end - + end - + end diff --git a/genmoddep.awk b/genmoddep.awk index 5b9bc621d..f7f085e99 100644 --- a/genmoddep.awk +++ b/genmoddep.awk @@ -40,7 +40,7 @@ FNR == 1 { END { if (error == 1) exit 1; - + for (mod in modtab) { # Remove duplications. split(modtab[mod], depmods, " "); diff --git a/include/grub/acpi.h b/include/grub/acpi.h index 26a84f8bf..7933db824 100644 --- a/include/grub/acpi.h +++ b/include/grub/acpi.h @@ -50,7 +50,7 @@ struct grub_acpi_table_header grub_uint8_t oemtable[8]; grub_uint32_t oemrev; grub_uint8_t creator_id[4]; - grub_uint32_t creator_rev; + grub_uint32_t creator_rev; } __attribute__ ((packed)); struct grub_acpi_fadt diff --git a/include/grub/autoefi.h b/include/grub/autoefi.h index f9c552a9f..4acd43965 100644 --- a/include/grub/autoefi.h +++ b/include/grub/autoefi.h @@ -65,8 +65,8 @@ static inline grub_err_t grub_autoefi_prepare (void) # define SYSTEM_TABLE_SIZEOF GRUB_EFIEMU_SYSTEM_TABLE_SIZEOF # define SYSTEM_TABLE_VAR GRUB_EFIEMU_SYSTEM_TABLE_VAR # define SYSTEM_TABLE_PTR GRUB_EFIEMU_SYSTEM_TABLE_PTR -# define SIZEOF_OF_UINTN GRUB_EFIEMU_SIZEOF_OF_UINTN -# define SYSTEM_TABLE GRUB_EFIEMU_SYSTEM_TABLE +# define SIZEOF_OF_UINTN GRUB_EFIEMU_SIZEOF_OF_UINTN +# define SYSTEM_TABLE GRUB_EFIEMU_SYSTEM_TABLE # define grub_efi_allocate_pages(x,y) (x) # define grub_efi_free_pages(x,y) GRUB_EFI_SUCCESS # define EFI_PRESENT 1 diff --git a/include/grub/datetime.h b/include/grub/datetime.h index f4bdae252..2dbba55e2 100644 --- a/include/grub/datetime.h +++ b/include/grub/datetime.h @@ -41,7 +41,7 @@ grub_err_t grub_set_datetime (struct grub_datetime *datetime); int grub_get_weekday (struct grub_datetime *datetime); char *grub_get_weekday_name (struct grub_datetime *datetime); -void grub_unixtime2datetime (grub_int32_t nix, +void grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime); diff --git a/include/grub/disk.h b/include/grub/disk.h index efec0dd49..a0cc6427d 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -56,7 +56,7 @@ struct grub_disk_dev /* The device id used by the cache manager. */ unsigned long id; - + /* Call HOOK with each device name, until HOOK returns non-zero. */ int (*iterate) (int (*hook) (const char *name)); @@ -102,7 +102,7 @@ struct grub_disk /* The id used by the disk cache manager. */ unsigned long id; - + /* The partition information. This is machine-specific. */ struct grub_partition *partition; diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index 432266bdf..e870eab41 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -662,38 +662,38 @@ typedef struct grub_efi_table_header grub_efi_table_header_t; struct grub_efi_boot_services { grub_efi_table_header_t hdr; - + grub_efi_tpl_t (*raise_tpl) (grub_efi_tpl_t new_tpl); - + void (*restore_tpl) (grub_efi_tpl_t old_tpl); - + grub_efi_status_t (*allocate_pages) (grub_efi_allocate_type_t type, grub_efi_memory_type_t memory_type, grub_efi_uintn_t pages, grub_efi_physical_address_t *memory); - + grub_efi_status_t (*free_pages) (grub_efi_physical_address_t memory, grub_efi_uintn_t pages); - + grub_efi_status_t (*get_memory_map) (grub_efi_uintn_t *memory_map_size, grub_efi_memory_descriptor_t *memory_map, grub_efi_uintn_t *map_key, grub_efi_uintn_t *descriptor_size, grub_efi_uint32_t *descriptor_version); - + grub_efi_status_t (*allocate_pool) (grub_efi_memory_type_t pool_type, grub_efi_uintn_t size, void **buffer); - + grub_efi_status_t (*free_pool) (void *buffer); - + grub_efi_status_t (*create_event) (grub_efi_uint32_t type, grub_efi_tpl_t notify_tpl, @@ -706,7 +706,7 @@ struct grub_efi_boot_services (*set_timer) (grub_efi_event_t event, grub_efi_timer_delay_t type, grub_efi_uint64_t trigger_time); - + grub_efi_status_t (*wait_for_event) (grub_efi_uintn_t num_events, grub_efi_event_t *event, @@ -714,10 +714,10 @@ struct grub_efi_boot_services grub_efi_status_t (*signal_event) (grub_efi_event_t event); - + grub_efi_status_t (*close_event) (grub_efi_event_t event); - + grub_efi_status_t (*check_event) (grub_efi_event_t event); @@ -726,13 +726,13 @@ struct grub_efi_boot_services grub_efi_guid_t *protocol, grub_efi_interface_type_t interface_type, void *interface); - + grub_efi_status_t (*reinstall_protocol_interface) (grub_efi_handle_t handle, grub_efi_guid_t *protocol, void *old_interface, void *new_interface); - + grub_efi_status_t (*uninstall_protocol_interface) (grub_efi_handle_t handle, grub_efi_guid_t *protocol, @@ -742,9 +742,9 @@ struct grub_efi_boot_services (*handle_protocol) (grub_efi_handle_t handle, grub_efi_guid_t *protocol, void **interface); - + void *reserved; - + grub_efi_status_t (*register_protocol_notify) (grub_efi_guid_t *protocol, grub_efi_event_t event, @@ -874,7 +874,7 @@ struct grub_efi_runtime_services { grub_efi_table_header_t hdr; - grub_efi_status_t + grub_efi_status_t (*get_time) (grub_efi_time_t *time, grub_efi_time_capabilities_t *capabilities); @@ -944,11 +944,11 @@ struct grub_efi_simple_input_interface grub_efi_status_t (*reset) (struct grub_efi_simple_input_interface *this, grub_efi_boolean_t extended_verification); - + grub_efi_status_t (*read_key_stroke) (struct grub_efi_simple_input_interface *this, grub_efi_input_key_t *key); - + grub_efi_event_t wait_for_key; }; typedef struct grub_efi_simple_input_interface grub_efi_simple_input_interface_t; @@ -973,7 +973,7 @@ struct grub_efi_simple_text_output_interface grub_efi_uintn_t *columns, grub_efi_uintn_t *rows); - grub_efi_status_t + grub_efi_status_t (*set_mode) (struct grub_efi_simple_text_output_interface *this, grub_efi_uintn_t mode_number); @@ -992,7 +992,7 @@ struct grub_efi_simple_text_output_interface grub_efi_status_t (*enable_cursor) (struct grub_efi_simple_text_output_interface *this, grub_efi_boolean_t visible); - + grub_efi_simple_text_output_mode_t *mode; }; typedef struct grub_efi_simple_text_output_interface grub_efi_simple_text_output_interface_t; diff --git a/include/grub/efi/memory.h b/include/grub/efi/memory.h index e1ac47cef..e5ea58d67 100644 --- a/include/grub/efi/memory.h +++ b/include/grub/efi/memory.h @@ -30,14 +30,14 @@ #define GRUB_MACHINE_MEMORY_NVS 4 #define GRUB_MACHINE_MEMORY_CODE 5 #define GRUB_MACHINE_MEMORY_MAX_TYPE 5 - /* This one is special: it's used internally but is never reported + /* This one is special: it's used internally but is never reported by firmware. */ #define GRUB_MACHINE_MEMORY_HOLE 6 -grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) +grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); -grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, +grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, int type, int handle); grub_err_t grub_machine_mmap_unregister (int handle); diff --git a/include/grub/efi/pe32.h b/include/grub/efi/pe32.h index 15de7906e..4fb8d098c 100644 --- a/include/grub/efi/pe32.h +++ b/include/grub/efi/pe32.h @@ -98,7 +98,7 @@ struct grub_pe32_optional_header grub_uint32_t bss_size; grub_uint32_t entry_addr; grub_uint32_t code_base; - + #if GRUB_TARGET_SIZEOF_VOID_P == 4 grub_uint32_t data_base; grub_uint32_t image_base; @@ -139,7 +139,7 @@ struct grub_pe32_optional_header grub_uint32_t loader_flags; grub_uint32_t num_data_directories; - + /* Data directories. */ struct grub_pe32_data_directory export_table; struct grub_pe32_data_directory import_table; @@ -210,7 +210,7 @@ struct grub_pe32_header { /* This should be filled in with GRUB_PE32_MSDOS_STUB. */ grub_uint8_t msdos_stub[GRUB_PE32_MSDOS_STUB_SIZE]; - + /* This is always PE\0\0. */ char signature[4]; diff --git a/include/grub/efiemu/efiemu.h b/include/grub/efiemu/efiemu.h index 78373e4e1..ed934a228 100644 --- a/include/grub/efiemu/efiemu.h +++ b/include/grub/efiemu/efiemu.h @@ -155,10 +155,10 @@ grub_err_t grub_efiemu_loadcore_init32 (void *core, grub_size_t core_size, grub_efiemu_segment_t *segments); grub_err_t grub_efiemu_loadcore_init64 (void *core, grub_size_t core_size, grub_efiemu_segment_t *segments); -grub_err_t grub_efiemu_loadcore_load32 (void *core, +grub_err_t grub_efiemu_loadcore_load32 (void *core, grub_size_t core_size, grub_efiemu_segment_t segments); -grub_err_t grub_efiemu_loadcore_load64 (void *core, +grub_err_t grub_efiemu_loadcore_load64 (void *core, grub_size_t core_size, grub_efiemu_segment_t segments); grub_err_t grub_efiemu_loadcore_unload32 (void); @@ -189,14 +189,14 @@ struct grub_efiemu_configuration_table64 } __attribute__ ((packed)); typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table64_t; grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid); -grub_err_t -grub_efiemu_register_configuration_table (grub_efi_guid_t guid, +grub_err_t +grub_efiemu_register_configuration_table (grub_efi_guid_t guid, void * (*get_table) (void *data), - void (*unload) (void *data), + void (*unload) (void *data), void *data); /* Memory management functions */ -int grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, +int grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, grub_efi_memory_type_t type); void *grub_efiemu_mm_obtain_request (int handle); int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, @@ -218,8 +218,8 @@ int grub_efiemu_get_memory_map (grub_efi_uintn_t *memory_map_size, grub_efi_uintn_t *descriptor_size, grub_efi_uint32_t *descriptor_version); grub_err_t -grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, - grub_uint64_t, +grub_efiemu_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, grub_uint32_t)); int grub_efiemu_sizeof_uintn_t (void); int grub_efiemu_exit_boot_services (grub_efi_uintn_t map_key); @@ -242,30 +242,30 @@ struct grub_efiemu_prepare_hook void (*unload) (void *data); void *data; }; -grub_err_t grub_efiemu_prepare32 (struct grub_efiemu_prepare_hook +grub_err_t grub_efiemu_prepare32 (struct grub_efiemu_prepare_hook *prepare_hooks, - struct grub_efiemu_configuration_table + struct grub_efiemu_configuration_table *config_tables); -grub_err_t grub_efiemu_prepare64 (struct grub_efiemu_prepare_hook +grub_err_t grub_efiemu_prepare64 (struct grub_efiemu_prepare_hook *prepare_hooks, - struct grub_efiemu_configuration_table + struct grub_efiemu_configuration_table *config_tables); grub_err_t grub_efiemu_unload (void); grub_err_t grub_efiemu_prepare (void); grub_err_t grub_efiemu_register_prepare_hook (grub_err_t (*hook) (void *data), - void (*unload) (void *data), + void (*unload) (void *data), void *data); /* symbols and pointers */ grub_err_t grub_efiemu_alloc_syms (void); grub_err_t grub_efiemu_request_symbols (int num); -grub_err_t grub_efiemu_resolve_symbol (const char *name, +grub_err_t grub_efiemu_resolve_symbol (const char *name, int *handle, grub_off_t *off); -grub_err_t grub_efiemu_register_symbol (const char *name, +grub_err_t grub_efiemu_register_symbol (const char *name, int handle, grub_off_t off); void grub_efiemu_free_syms (void); -grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value, +grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value, int plus_handle, int minus_handle, int ptv_needed, int size); grub_err_t grub_efiemu_pnvram (void); diff --git a/include/grub/fs.h b/include/grub/fs.h index fa2c07096..41732e48d 100644 --- a/include/grub/fs.h +++ b/include/grub/fs.h @@ -43,18 +43,18 @@ struct grub_fs /* Call HOOK with each file under DIR. */ grub_err_t (*dir) (grub_device_t device, const char *path, - int (*hook) (const char *filename, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)); - + /* Open a file named NAME and initialize FILE. */ grub_err_t (*open) (struct grub_file *file, const char *name); - + /* Read LEN bytes data from FILE into BUF. */ grub_ssize_t (*read) (struct grub_file *file, char *buf, grub_size_t len); - + /* Close the file FILE. */ grub_err_t (*close) (struct grub_file *file); - + /* Return the label of the device DEVICE in LABEL. The label is returned in a grub_malloc'ed buffer and should be freed by the caller. */ diff --git a/include/grub/hfs.h b/include/grub/hfs.h index 311b998f6..08b947ccb 100644 --- a/include/grub/hfs.h +++ b/include/grub/hfs.h @@ -47,7 +47,7 @@ struct grub_hfs_sblock /* A pascal style string that holds the volumename. */ grub_uint8_t volname[28]; - + grub_uint8_t unused5[60]; grub_uint16_t embed_sig; struct grub_hfs_extent embed_extent; diff --git a/include/grub/i386/efiemu.h b/include/grub/i386/efiemu.h index 1b29f459f..edb13ff37 100644 --- a/include/grub/i386/efiemu.h +++ b/include/grub/i386/efiemu.h @@ -20,11 +20,11 @@ #define GRUB_ARCH_EFI_EMU_HEADER 1 grub_err_t -grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, +grub_arch_efiemu_relocate_symbols32 (grub_efiemu_segment_t segs, struct grub_efiemu_elf_sym *elfsyms, void *ehdr); grub_err_t -grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, +grub_arch_efiemu_relocate_symbols64 (grub_efiemu_segment_t segs, struct grub_efiemu_elf_sym *elfsyms, void *ehdr); diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 70eba1da7..1e601955c 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -83,7 +83,7 @@ struct grub_e820_mmap /* For the Linux/i386 boot protocol version 2.03. */ struct linux_kernel_header -{ +{ grub_uint8_t code1[0x0020]; grub_uint16_t cl_magic; /* Magic number 0xA33F */ grub_uint16_t cl_offset; /* The offset of command line */ @@ -135,21 +135,21 @@ struct linux_kernel_params grub_uint8_t video_cursor_y; grub_uint16_t ext_mem; /* 2 */ - + grub_uint16_t video_page; /* 4 */ grub_uint8_t video_mode; /* 6 */ grub_uint8_t video_width; /* 7 */ - + grub_uint8_t padding1[0xa - 0x8]; - + grub_uint16_t video_ega_bx; /* a */ - + grub_uint8_t padding2[0xe - 0xc]; - + grub_uint8_t video_height; /* e */ grub_uint8_t have_vga; /* f */ grub_uint16_t font_size; /* 10 */ - + grub_uint16_t lfb_width; /* 12 */ grub_uint16_t lfb_height; /* 14 */ grub_uint16_t lfb_depth; /* 16 */ @@ -183,16 +183,16 @@ struct linux_kernel_params grub_uint16_t apm_flags; /* 4c */ grub_uint32_t apm_code_len; /* 4e */ grub_uint16_t apm_data_len; /* 52 */ - + grub_uint8_t padding4[0x60 - 0x54]; - + grub_uint32_t ist_signature; /* 60 */ grub_uint32_t ist_command; /* 64 */ grub_uint32_t ist_event; /* 68 */ grub_uint32_t ist_perf_level; /* 6c */ grub_uint8_t padding5[0x80 - 0x70]; - + grub_uint8_t hd0_drive_info[0x10]; /* 80 */ grub_uint8_t hd1_drive_info[0x10]; /* 90 */ grub_uint16_t rom_config_len; /* a0 */ @@ -232,15 +232,15 @@ struct linux_kernel_params grub_uint32_t efi_mmap_hi; /* 1dc */ } v0206; }; - + grub_uint32_t alt_mem; /* 1e0 */ - + grub_uint8_t padding8[0x1e8 - 0x1e4]; - + grub_uint32_t mmap_size; /* 1e8 */ grub_uint8_t padding9[0x1f1 - 0x1ec]; - + grub_uint8_t setup_sects; /* The size of the setup in sectors */ grub_uint16_t root_flags; /* If the root is mounted readonly */ grub_uint16_t syssize; /* obsolete */ diff --git a/include/grub/i386/pc/biosdisk.h b/include/grub/i386/pc/biosdisk.h index 64d4f217f..b87e0e433 100644 --- a/include/grub/i386/pc/biosdisk.h +++ b/include/grub/i386/pc/biosdisk.h @@ -72,7 +72,7 @@ struct grub_biosdisk_drp grub_uint8_t device_path[8]; grub_uint8_t reserved2; grub_uint8_t checksum; - + /* XXX: This is necessary, because the BIOS of Thinkpad X20 writes a garbage to the tail of drive parameters, regardless of a size specified in a caller. */ diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index c95eae0ce..d7910ab15 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -90,7 +90,7 @@ struct grub_machine_mmap_entry #define GRUB_MACHINE_MEMORY_ACPI 3 #define GRUB_MACHINE_MEMORY_NVS 4 #define GRUB_MACHINE_MEMORY_MAX_TYPE 4 - /* This one is special: it's used internally but is never reported + /* This one is special: it's used internally but is never reported by firmware. */ #define GRUB_MACHINE_MEMORY_HOLE 5 @@ -107,19 +107,19 @@ grub_uint64_t grub_mmap_get_lower (void); #define GRUB_MMAP_MALLOC_LOW 1 #ifdef GRUB_MACHINE_PCBIOS -grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, +grub_err_t grub_machine_mmap_register (grub_uint64_t start, grub_uint64_t size, int type, int handle); grub_err_t grub_machine_mmap_unregister (int handle); #else -static inline grub_err_t -grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), - int type __attribute__ ((unused)), +static inline grub_err_t +grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + int type __attribute__ ((unused)), int handle __attribute__ ((unused))) { return GRUB_ERR_NONE; } -static inline grub_err_t +static inline grub_err_t grub_machine_mmap_unregister (int handle __attribute__ ((unused))) { return GRUB_ERR_NONE; diff --git a/include/grub/i386/pc/vbe.h b/include/grub/i386/pc/vbe.h index 9a8cb954d..bd6ecd7e4 100644 --- a/include/grub/i386/pc/vbe.h +++ b/include/grub/i386/pc/vbe.h @@ -143,9 +143,9 @@ struct grub_vbe_mode_info_block grub_uint8_t lin_rsvd_field_position; grub_uint32_t max_pixel_clock; - /* Reserved field to make structure to be 256 bytes long, VESA BIOS - Extension 3.0 Specification says to reserve 189 bytes here but - that doesn't make structure to be 256 bytes. So additional one is + /* Reserved field to make structure to be 256 bytes long, VESA BIOS + Extension 3.0 Specification says to reserve 189 bytes here but + that doesn't make structure to be 256 bytes. So additional one is added here. */ grub_uint8_t reserved4[189 + 1]; } __attribute__ ((packed)); diff --git a/include/grub/i386/tsc.h b/include/grub/i386/tsc.h index aa4014575..46041c2b2 100644 --- a/include/grub/i386/tsc.h +++ b/include/grub/i386/tsc.h @@ -41,7 +41,7 @@ grub_get_tsc (void) "pop %%rbx\n" #else "pop %%ebx\n" -#endif +#endif :::"%rax", "%rcx", "%rdx"); #else __asm__ __volatile__ ("xorl %%eax, %%eax\n\t" diff --git a/include/grub/i386/xnu.h b/include/grub/i386/xnu.h index c4c10b0f4..ebc38eb61 100644 --- a/include/grub/i386/xnu.h +++ b/include/grub/i386/xnu.h @@ -6,22 +6,22 @@ typedef grub_uint32_t grub_xnu_ptr_t; struct grub_xnu_boot_params { - grub_uint16_t verminor; - grub_uint16_t vermajor; + grub_uint16_t verminor; + grub_uint16_t vermajor; /* Command line passed to xnu. */ - grub_uint8_t cmdline[1024]; + grub_uint8_t cmdline[1024]; /* Later are the same as EFI's get_memory_map (). */ - grub_xnu_ptr_t efi_mmap; - grub_uint32_t efi_mmap_size; - grub_uint32_t efi_mem_desc_size; - grub_uint32_t efi_mem_desc_version; + grub_xnu_ptr_t efi_mmap; + grub_uint32_t efi_mmap_size; + grub_uint32_t efi_mem_desc_size; + grub_uint32_t efi_mem_desc_version; /* Later are video parameters. */ grub_xnu_ptr_t lfb_base; #define GRUB_XNU_VIDEO_SPLASH 1 #define GRUB_XNU_VIDEO_TEXT_IN_VIDEO 2 - grub_uint32_t lfb_mode; + grub_uint32_t lfb_mode; grub_uint32_t lfb_line_len; grub_uint32_t lfb_width; grub_uint32_t lfb_height; @@ -30,12 +30,12 @@ struct grub_xnu_boot_params /* Pointer to device tree and its len. */ grub_xnu_ptr_t devtree; grub_uint32_t devtreelen; - + /* First used address by kernel or boot structures. */ grub_xnu_ptr_t heap_start; - /* Last used address by kernel or boot structures minus previous value. */ + /* Last used address by kernel or boot structures minus previous value. */ grub_uint32_t heap_size; - + /* First memory page containing runtime code or data. */ grub_uint32_t efi_runtime_first_page; /* First memory page containing runtime code or data minus previous value. */ diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 751055fc1..818046fa0 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -33,7 +33,7 @@ struct grub_ieee1275_devalias char *type; }; -struct grub_ieee1275_mem_region +struct grub_ieee1275_mem_region { unsigned int start; unsigned int size; @@ -46,9 +46,9 @@ struct grub_ieee1275_mem_region #define IEEE1275_CALL_ENTRY_FN(args) (*grub_ieee1275_entry_fn) (args) #endif -/* All backcalls to the firmware is done by calling an entry function - which was passed to us from the bootloader. When doing the backcall, - a structure is passed which specifies what the firmware should do. +/* All backcalls to the firmware is done by calling an entry function + which was passed to us from the bootloader. When doing the backcall, + a structure is passed which specifies what the firmware should do. NAME is the requested service. NR_INS and NR_OUTS is the number of passed arguments and the expected number of return values, resp. */ struct grub_ieee1275_common_hdr @@ -122,14 +122,14 @@ int EXPORT_FUNC(grub_ieee1275_get_integer_property) (grub_ieee1275_phandle_t pha grub_ssize_t *actual); int EXPORT_FUNC(grub_ieee1275_next_property) (grub_ieee1275_phandle_t phandle, char *prev_prop, char *prop); -int EXPORT_FUNC(grub_ieee1275_get_property_length) +int EXPORT_FUNC(grub_ieee1275_get_property_length) (grub_ieee1275_phandle_t phandle, const char *prop, grub_ssize_t *length); -int EXPORT_FUNC(grub_ieee1275_instance_to_package) +int EXPORT_FUNC(grub_ieee1275_instance_to_package) (grub_ieee1275_ihandle_t ihandle, grub_ieee1275_phandle_t *phandlep); int EXPORT_FUNC(grub_ieee1275_package_to_path) (grub_ieee1275_phandle_t phandle, char *path, grub_size_t len, grub_ssize_t *actual); -int EXPORT_FUNC(grub_ieee1275_instance_to_path) +int EXPORT_FUNC(grub_ieee1275_instance_to_path) (grub_ieee1275_ihandle_t ihandle, char *path, grub_size_t len, grub_ssize_t *actual); int EXPORT_FUNC(grub_ieee1275_write) (grub_ieee1275_ihandle_t ihandle, diff --git a/include/grub/lvm.h b/include/grub/lvm.h index dd91cc672..a4bf3b288 100644 --- a/include/grub/lvm.h +++ b/include/grub/lvm.h @@ -121,7 +121,7 @@ struct grub_lvm_mda_header { grub_uint32_t version; grub_uint64_t start; /* Absolute start byte of mda_header */ grub_uint64_t size; /* Size of metadata area */ - + struct grub_lvm_raw_locn raw_locns[0]; /* NULL-terminated list */ } __attribute__ ((packed)); diff --git a/include/grub/macho.h b/include/grub/macho.h index 7dfd54e2e..0463d3753 100644 --- a/include/grub/macho.h +++ b/include/grub/macho.h @@ -73,7 +73,7 @@ union grub_macho_filestart { struct grub_macho_fat_header fat; struct grub_macho_header32 thin32; - struct grub_macho_header64 thin64; + struct grub_macho_header64 thin64; } __attribute__ ((packed)); /* Common header of Mach-O commands. */ diff --git a/include/grub/machoload.h b/include/grub/machoload.h index 572496fd3..a80bac68c 100644 --- a/include/grub/machoload.h +++ b/include/grub/machoload.h @@ -54,7 +54,7 @@ grub_uint32_t grub_macho32_get_entry_point (grub_macho_t macho); #define GRUB_MACHO_NOBSS 0x1 grub_err_t grub_macho32_load (grub_macho_t macho, char *offset, int flags); -/* Like filesize and file_read but take only 32-bit part +/* Like filesize and file_read but take only 32-bit part for current architecture. */ grub_size_t grub_macho32_filesize (grub_macho_t macho); grub_err_t grub_macho32_readfile (grub_macho_t macho, void *dest); diff --git a/include/grub/memory.h b/include/grub/memory.h index f7fe2beca..43f90e1dd 100644 --- a/include/grub/memory.h +++ b/include/grub/memory.h @@ -24,8 +24,8 @@ #include #include -grub_err_t grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, - grub_uint64_t, +grub_err_t grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, grub_uint32_t)); int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type); grub_err_t grub_mmap_unregister (int handle); diff --git a/include/grub/multiboot.h b/include/grub/multiboot.h index 5285ea2f5..2cb00a06d 100644 --- a/include/grub/multiboot.h +++ b/include/grub/multiboot.h @@ -30,7 +30,7 @@ void grub_module (int argc, char *argv[]); #include struct grub_multiboot_header -{ +{ /* Must be MULTIBOOT_MAGIC - see above. */ grub_uint32_t magic; @@ -39,7 +39,7 @@ struct grub_multiboot_header /* The above fields plus this one must equal 0 mod 2^32. */ grub_uint32_t checksum; - + /* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */ grub_uint32_t header_addr; grub_uint32_t load_addr; @@ -58,34 +58,34 @@ struct grub_multiboot_info { /* Multiboot info version number */ grub_uint32_t flags; - + /* Available memory from BIOS */ grub_uint32_t mem_lower; grub_uint32_t mem_upper; - + /* "root" partition */ grub_uint32_t boot_device; - + /* Kernel command line */ grub_uint32_t cmdline; - + /* Boot-Module list */ grub_uint32_t mods_count; grub_uint32_t mods_addr; - + grub_uint32_t syms[4]; - + /* Memory Mapping buffer */ grub_uint32_t mmap_length; grub_uint32_t mmap_addr; - + /* Drive Info buffer */ grub_uint32_t drives_length; grub_uint32_t drives_addr; - + /* ROM configuration table */ grub_uint32_t config_table; - + /* Boot Loader Name */ grub_uint32_t boot_loader_name; @@ -116,10 +116,10 @@ struct grub_mod_list /* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */ grub_uint32_t mod_start; grub_uint32_t mod_end; - + /* Module command line */ grub_uint32_t cmdline; - + /* padding to take it to 16 bytes (must be zero) */ grub_uint32_t pad; }; diff --git a/include/grub/multiboot2.h b/include/grub/multiboot2.h index 0d53f8ff7..69d939344 100644 --- a/include/grub/multiboot2.h +++ b/include/grub/multiboot2.h @@ -35,19 +35,19 @@ struct multiboot_tag_header; grub_err_t grub_mb2_tag_alloc (grub_addr_t *addr, int key, grub_size_t len); -grub_err_t +grub_err_t grub_mb2_tags_arch_create (void); -void +void grub_mb2_arch_boot (grub_addr_t entry, void *tags); -void +void grub_mb2_arch_unload (struct multiboot_tag_header *tags); grub_err_t grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, grub_addr_t *addr); -grub_err_t +grub_err_t grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, grub_addr_t *addr); grub_err_t @@ -56,10 +56,10 @@ grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr); grub_err_t grub_mb2_arch_module_free (grub_addr_t addr, grub_size_t size); -void +void grub_multiboot2 (int argc, char *argv[]); -void +void grub_module2 (int argc, char *argv[]); #define for_each_tag(tag, tags) \ diff --git a/include/grub/net.h b/include/grub/net.h index 2eac431cc..c6d71d5b6 100644 --- a/include/grub/net.h +++ b/include/grub/net.h @@ -49,7 +49,7 @@ struct grub_net { /* The net name. */ const char *name; - + /* The underlying disk device. */ grub_net_dev_t dev; @@ -58,7 +58,7 @@ struct grub_net /* FIXME: More data would be required, such as an IP address, a mask, a gateway, etc. */ - + /* Device-specific data. */ void *data; }; diff --git a/include/grub/partition.h b/include/grub/partition.h index 6e74cd506..37c5f2403 100644 --- a/include/grub/partition.h +++ b/include/grub/partition.h @@ -30,19 +30,19 @@ struct grub_partition_map { /* The name of the partition map type. */ const char *name; - + /* Call HOOK with each partition, until HOOK returns non-zero. */ grub_err_t (*iterate) (struct grub_disk *disk, int (*hook) (struct grub_disk *disk, const grub_partition_t partition)); - + /* Return the partition named STR on the disk DISK. */ grub_partition_t (*probe) (struct grub_disk *disk, const char *str); - + /* Return the name of the partition PARTITION. */ char *(*get_name) (const grub_partition_t partition); - + /* The next partition map type. */ struct grub_partition_map *next; }; @@ -62,10 +62,10 @@ struct grub_partition /* The index of this partition in the partition table. */ int index; - + /* Partition map type specific data. */ void *data; - + /* The type partition map. */ grub_partition_map_t partmap; }; @@ -78,7 +78,7 @@ int EXPORT_FUNC(grub_partition_iterate) (struct grub_disk *disk, char *EXPORT_FUNC(grub_partition_get_name) (const grub_partition_t partition); int EXPORT_FUNC(grub_partition_map_iterate) (int (*hook) (const grub_partition_map_t partmap)); - + void EXPORT_FUNC(grub_partition_map_register) (grub_partition_map_t partmap); void EXPORT_FUNC(grub_partition_map_unregister) (grub_partition_map_t partmap); diff --git a/include/grub/parttool.h b/include/grub/parttool.h index 0e05f4cc5..8291e1161 100644 --- a/include/grub/parttool.h +++ b/include/grub/parttool.h @@ -23,7 +23,7 @@ struct grub_parttool_argdesc { char *name; char *desc; - enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL} + enum {GRUB_PARTTOOL_ARG_END, GRUB_PARTTOOL_ARG_BOOL, GRUB_PARTTOOL_ARG_VAL} type; }; @@ -37,7 +37,7 @@ struct grub_parttool_args }; }; -typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev, +typedef grub_err_t (*grub_parttool_function_t) (const grub_device_t dev, const struct grub_parttool_args *args); struct grub_parttool @@ -50,7 +50,7 @@ struct grub_parttool grub_parttool_function_t func; }; -int grub_parttool_register(const char *part_name, +int grub_parttool_register(const char *part_name, const grub_parttool_function_t func, const struct grub_parttool_argdesc *args); void grub_parttool_unregister (int handle); diff --git a/include/grub/term.h b/include/grub/term.h index 3251e36ba..9ce3be7d1 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -151,10 +151,10 @@ struct grub_term_input /* Clean up the terminal. */ grub_err_t (*fini) (void); - + /* Check if any input character is available. */ int (*checkkey) (void); - + /* Get a character. */ int (*getkey) (void); }; @@ -173,37 +173,37 @@ struct grub_term_output /* Clean up the terminal. */ grub_err_t (*fini) (void); - + /* Put a character. C is encoded in Unicode. */ void (*putchar) (grub_uint32_t c); /* Get the number of columns occupied by a given character C. C is encoded in Unicode. */ grub_ssize_t (*getcharwidth) (grub_uint32_t c); - + /* Get the screen size. The return value is ((Width << 8) | Height). */ grub_uint16_t (*getwh) (void); /* Get the cursor position. The return value is ((X << 8) | Y). */ grub_uint16_t (*getxy) (void); - + /* Go to the position (X, Y). */ void (*gotoxy) (grub_uint8_t x, grub_uint8_t y); - + /* Clear the screen. */ void (*cls) (void); - + /* Set the current color to be used */ void (*setcolorstate) (grub_term_color_state state); - + /* Set the normal color and the highlight color. The format of each color is VGA's. */ void (*setcolor) (grub_uint8_t normal_color, grub_uint8_t highlight_color); - + /* Get the normal color and the highlight color. The format of each color is VGA's. */ void (*getcolor) (grub_uint8_t *normal_color, grub_uint8_t *highlight_color); - + /* Turn on/off the cursor. */ void (*setcursor) (int on); diff --git a/include/grub/usbdesc.h b/include/grub/usbdesc.h index 027e7ed34..2f711d755 100644 --- a/include/grub/usbdesc.h +++ b/include/grub/usbdesc.h @@ -46,7 +46,7 @@ struct grub_usb_desc_device grub_uint8_t strvendor; grub_uint8_t strprod; grub_uint8_t strserial; - grub_uint8_t configcnt; + grub_uint8_t configcnt; } __attribute__ ((packed)); struct grub_usb_desc_config diff --git a/include/grub/video.h b/include/grub/video.h index 3b276553c..c98731ddf 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -74,7 +74,7 @@ enum grub_video_blit_format /* When needed, decode color or just use value as is. */ GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR, - + /* Two color bitmap; bits packed: rows are not padded to byte boundary. */ GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED }; diff --git a/include/grub/xnu.h b/include/grub/xnu.h index c6b2e8816..c3902e670 100644 --- a/include/grub/xnu.h +++ b/include/grub/xnu.h @@ -36,7 +36,7 @@ struct grub_xnu_hibernate_header /* %esp at start. */ grub_uint32_t stack; grub_uint8_t unknown2[44]; -#define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65 +#define GRUB_XNU_HIBERNATE_MAGIC 0x73696d65 grub_uint32_t magic; grub_uint8_t unknown3[28]; /* This value is non-zero if page is encrypted. Unsupported. */ @@ -51,7 +51,7 @@ struct grub_xnu_hibernate_header /* In-memory structure for temporary keeping device tree. */ struct grub_xnu_devtree_key { - char *name; + char *name; int datasize; /* -1 for not leaves. */ union { @@ -62,7 +62,7 @@ struct grub_xnu_devtree_key }; /* A structure used in memory-map values. */ -struct +struct grub_xnu_extdesc { grub_uint32_t addr; @@ -95,9 +95,9 @@ grub_err_t grub_xnu_resume (char *imagename); struct grub_xnu_devtree_key *grub_xnu_find_key (struct grub_xnu_devtree_key *parent, char *name); grub_err_t grub_xnu_align_heap (int align); -grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, +grub_err_t grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, int maxrecursion); -grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, +grub_err_t grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, int maxrecursion); void *grub_xnu_heap_malloc (int size); extern grub_uint32_t grub_xnu_heap_real_start; diff --git a/include/multiboot.h b/include/multiboot.h index 2298fa200..110ad2f17 100644 --- a/include/multiboot.h +++ b/include/multiboot.h @@ -38,7 +38,7 @@ /* Alignment of the multiboot info structure. */ #define MULTIBOOT_INFO_ALIGN 0x00000004 -/* +/* * Flags set in the 'flags' member of the multiboot header. */ diff --git a/io/gzio.c b/io/gzio.c index 0fada6cc5..f3b71183c 100644 --- a/io/gzio.c +++ b/io/gzio.c @@ -169,7 +169,7 @@ test_header (grub_file_t file) if (grub_file_tell (gzio->file) != 0) grub_file_seek (gzio->file, 0); - + /* * This checks if the file is gzipped. If a problem occurs here * (other than a real error with the disk) then we don't think it @@ -202,9 +202,9 @@ test_header (grub_file_t file) } gzio->data_offset = grub_file_tell (gzio->file); - + grub_file_seek (gzio->file, grub_file_size (gzio->file) - 8); - + if (grub_file_read (gzio->file, (char *) buf, 8) != 8) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format"); @@ -362,7 +362,7 @@ static int get_byte (grub_file_t file) { grub_gzio_t gzio = file->data; - + if (grub_file_tell (gzio->file) == (grub_off_t) gzio->data_offset || gzio->inbuf_d == INBUFSIZ) { @@ -614,7 +614,7 @@ inflate_codes_in_window (grub_file_t file) register ulg b; /* bit buffer */ register unsigned k; /* number of bits in bit buffer */ grub_gzio_t gzio = file->data; - + /* make local copies of globals */ d = gzio->inflate_d; n = gzio->inflate_n; @@ -746,7 +746,7 @@ init_stored_block (grub_file_t file) register ulg b; /* bit buffer */ register unsigned k; /* number of bits in bit buffer */ grub_gzio_t gzio = file->data; - + /* make local copies of globals */ b = gzio->bb; /* initialize bit buffer */ k = gzio->bk; @@ -780,7 +780,7 @@ init_fixed_block (grub_file_t file) int i; /* temporary variable */ unsigned l[288]; /* length list for huft_build */ grub_gzio_t gzio = file->data; - + /* set up literal table */ for (i = 0; i < 144; i++) l[i] = 8; @@ -836,7 +836,7 @@ init_dynamic_block (grub_file_t file) register ulg b; /* bit buffer */ register unsigned k; /* number of bits in bit buffer */ grub_gzio_t gzio = file->data; - + /* make local bit buffer */ b = gzio->bb; k = gzio->bk; @@ -971,7 +971,7 @@ get_new_block (grub_file_t file) register ulg b; /* bit buffer */ register unsigned k; /* number of bits in bit buffer */ grub_gzio_t gzio = file->data; - + /* make local bit buffer */ b = gzio->bb; k = gzio->bk; @@ -1011,7 +1011,7 @@ static void inflate_window (grub_file_t file) { grub_gzio_t gzio = file->data; - + /* initialize window */ gzio->wp = 0; @@ -1081,7 +1081,7 @@ static void initialize_tables (grub_file_t file) { grub_gzio_t gzio = file->data; - + gzio->saved_offset = 0; grub_file_seek (gzio->file, gzio->data_offset); @@ -1107,7 +1107,7 @@ grub_gzio_open (grub_file_t io, int transparent) { grub_file_t file; grub_gzio_t gzio = 0; - + file = (grub_file_t) grub_malloc (sizeof (*file)); if (! file) return 0; @@ -1118,10 +1118,10 @@ grub_gzio_open (grub_file_t io, int transparent) grub_free (file); return 0; } - + grub_memset (gzio, 0, sizeof (*gzio)); gzio->file = io; - + file->device = io->device; file->offset = 0; file->data = gzio; @@ -1142,7 +1142,7 @@ grub_gzio_open (grub_file_t io, int transparent) else return 0; } - + return file; } @@ -1151,7 +1151,7 @@ grub_file_t grub_gzfile_open (const char *name, int transparent) { grub_file_t io, file; - + io = grub_file_open (name); if (! io) return 0; @@ -1172,7 +1172,7 @@ grub_gzio_read (grub_file_t file, char *buf, grub_size_t len) grub_ssize_t ret = 0; grub_gzio_t gzio = file->data; grub_off_t offset; - + /* Do we reset decompression to the beginning of the file? */ if (gzio->saved_offset > file->offset + WSIZE) initialize_tables (file); @@ -1184,7 +1184,7 @@ grub_gzio_read (grub_file_t file, char *buf, grub_size_t len) */ offset = file->offset; - + while (len > 0 && grub_errno == GRUB_ERR_NONE) { register grub_size_t size; @@ -1217,7 +1217,7 @@ static grub_err_t grub_gzio_close (grub_file_t file) { grub_gzio_t gzio = file->data; - + grub_file_close (gzio->file); huft_free (gzio->tl); huft_free (gzio->td); diff --git a/kern/corecmd.c b/kern/corecmd.c index 9c189460c..03944f2df 100644 --- a/kern/corecmd.c +++ b/kern/corecmd.c @@ -117,7 +117,7 @@ grub_mini_print_devices (const char *name) } static int -grub_mini_print_files (const char *filename, +grub_mini_print_files (const char *filename, const struct grub_dirhook_info *info) { grub_printf ("%s%s ", filename, info->dir ? "/" : ""); diff --git a/kern/device.c b/kern/device.c index 184c3a27f..55c750bfc 100644 --- a/kern/device.c +++ b/kern/device.c @@ -41,11 +41,11 @@ grub_device_open (const char *name) goto fail; } } - + dev = grub_malloc (sizeof (*dev)); if (! dev) goto fail; - + /* Try to open a disk. */ disk = grub_disk_open (name); if (! disk) @@ -59,7 +59,7 @@ grub_device_open (const char *name) fail: if (disk) grub_disk_close (disk); - + grub_free (dev); return 0; @@ -82,7 +82,7 @@ grub_device_iterate (int (*hook) (const char *name)) auto int iterate_disk (const char *disk_name); auto int iterate_partition (grub_disk_t disk, const grub_partition_t partition); - + struct part_ent { struct part_ent *next; @@ -95,11 +95,11 @@ grub_device_iterate (int (*hook) (const char *name)) if (hook (disk_name)) return 1; - + dev = grub_device_open (disk_name); if (! dev) return 0; - + if (dev->disk && dev->disk->has_partitions) { struct part_ent *p; @@ -127,12 +127,12 @@ grub_device_iterate (int (*hook) (const char *name)) grub_device_close (dev); return 0; } - + int iterate_partition (grub_disk_t disk, const grub_partition_t partition) { char *partition_name; struct part_ent *p; - + partition_name = grub_partition_get_name (partition); if (! partition_name) return 1; diff --git a/kern/disk.c b/kern/disk.c index 645d7e7e5..ad778d44e 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -132,7 +132,7 @@ grub_disk_cache_fetch (unsigned long dev_id, unsigned long disk_id, #if 0 grub_disk_cache_misses++; #endif - + return 0; } @@ -157,19 +157,19 @@ grub_disk_cache_store (unsigned long dev_id, unsigned long disk_id, { unsigned index; struct grub_disk_cache *cache; - + index = grub_disk_cache_get_index (dev_id, disk_id, sector); cache = grub_disk_cache_table + index; - + cache->lock = 1; grub_free (cache->data); cache->data = 0; cache->lock = 0; - + cache->data = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS); if (! cache->data) return grub_errno; - + grub_memcpy (cache->data, data, GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS); cache->dev_id = dev_id; @@ -194,7 +194,7 @@ void grub_disk_dev_unregister (grub_disk_dev_t dev) { grub_disk_dev_t *p, q; - + for (p = &grub_disk_dev_list, q = *p; q; p = &(q->next), q = q->next) if (q == dev) { @@ -255,12 +255,12 @@ grub_disk_open (const char *name) disk->name = grub_strdup (name); if (! disk->name) goto fail; - + p = find_part_sep (name); if (p) { grub_size_t len = p - name; - + raw = grub_malloc (len + 1); if (! raw) goto fail; @@ -290,7 +290,7 @@ grub_disk_open (const char *name) grub_error (GRUB_ERR_BAD_DEVICE, "no partition on this disk"); goto fail; } - + disk->dev = dev; if (p) @@ -310,11 +310,11 @@ grub_disk_open (const char *name) if (current_time > (grub_last_time + GRUB_CACHE_TIMEOUT * 1000)) grub_disk_cache_invalidate_all (); - + grub_last_time = current_time; - + fail: - + if (raw && raw != name) grub_free (raw); @@ -357,7 +357,7 @@ grub_disk_adjust_range (grub_disk_t disk, grub_disk_addr_t *sector, { *sector += *offset >> GRUB_DISK_SECTOR_BITS; *offset &= GRUB_DISK_SECTOR_SIZE - 1; - + if (disk->partition) { grub_disk_addr_t start; @@ -391,7 +391,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, unsigned real_offset; grub_dprintf ("disk", "Reading `%s'...\n", disk->name); - + /* First of all, check if the region is within the disk. */ if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE) { @@ -403,7 +403,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, } real_offset = offset; - + /* Allocate a temporary buffer. */ tmp_buf = grub_malloc (GRUB_DISK_SECTOR_SIZE << GRUB_DISK_CACHE_BITS); if (! tmp_buf) @@ -454,7 +454,7 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, goto finish; tmp_buf = p; - + if ((disk->dev->read) (disk, sector, num, tmp_buf)) { grub_error_push (); @@ -493,33 +493,33 @@ grub_disk_read (grub_disk_t disk, grub_disk_addr_t sector, { grub_disk_addr_t s = sector; grub_size_t l = len; - + while (l) { (disk->read_hook) (s, real_offset, ((l > GRUB_DISK_SECTOR_SIZE) ? GRUB_DISK_SECTOR_SIZE : l)); - + if (l < GRUB_DISK_SECTOR_SIZE - real_offset) break; - + s++; l -= GRUB_DISK_SECTOR_SIZE - real_offset; real_offset = 0; } } - + sector = start_sector + GRUB_DISK_CACHE_SIZE; buf = (char *) buf + len; size -= len; real_offset = 0; } - + finish: - + grub_free (tmp_buf); - + return grub_errno; } @@ -528,21 +528,21 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, grub_off_t offset, grub_size_t size, const void *buf) { unsigned real_offset; - + grub_dprintf ("disk", "Writing `%s'...\n", disk->name); if (grub_disk_adjust_range (disk, §or, &offset, size) != GRUB_ERR_NONE) return -1; real_offset = offset; - + while (size) { if (real_offset != 0 || (size < GRUB_DISK_SECTOR_SIZE && size != 0)) { char tmp_buf[GRUB_DISK_SECTOR_SIZE]; grub_size_t len; - + if (grub_disk_read (disk, sector, 0, GRUB_DISK_SECTOR_SIZE, tmp_buf) != GRUB_ERR_NONE) goto finish; @@ -550,7 +550,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, len = GRUB_DISK_SECTOR_SIZE - real_offset; if (len > size) len = size; - + grub_memcpy (tmp_buf + real_offset, buf, len); grub_disk_cache_invalidate (disk->dev->id, disk->id, sector); @@ -570,7 +570,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, len = size & ~(GRUB_DISK_SECTOR_SIZE - 1); n = size >> GRUB_DISK_SECTOR_BITS; - + if ((disk->dev->write) (disk, sector, n, buf) != GRUB_ERR_NONE) goto finish; @@ -587,7 +587,7 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, return grub_errno; } -grub_uint64_t +grub_uint64_t grub_disk_get_size (grub_disk_t disk) { if (disk->partition) diff --git a/kern/dl.c b/kern/dl.c index 84c465ccb..d729c0874 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -72,7 +72,7 @@ grub_dl_add (grub_dl_t mod) if (grub_dl_get (mod->name)) return grub_error (GRUB_ERR_BAD_MODULE, "`%s' is already loaded", mod->name); - + l = (grub_dl_list_t) grub_malloc (sizeof (*l)); if (! l) return grub_errno; @@ -169,7 +169,7 @@ grub_dl_register_symbol (const char *name, void *addr, grub_dl_t mod) { grub_symbol_t sym; unsigned k; - + sym = (grub_symbol_t) grub_malloc (sizeof (*sym)); if (! sym) return grub_errno; @@ -185,10 +185,10 @@ grub_dl_register_symbol (const char *name, void *addr, grub_dl_t mod) } else sym->name = name; - + sym->addr = addr; sym->mod = mod; - + k = grub_symbol_hash (name); sym->next = grub_symtab[k]; grub_symtab[k] = sym; @@ -204,7 +204,7 @@ grub_dl_unregister_symbols (grub_dl_t mod) if (! mod) grub_fatal ("core symbols cannot be unregistered"); - + for (i = 0; i < GRUB_SYMTAB_SIZE; i++) { grub_symbol_t sym, *p, q; @@ -266,7 +266,7 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) { unsigned i; Elf_Shdr *s; - + for (i = 0, s = (Elf_Shdr *)((char *) e + e->e_shoff); i < e->e_shnum; i++, s = (Elf_Shdr *)((char *) s + e->e_shentsize)) @@ -278,7 +278,7 @@ grub_dl_load_segments (grub_dl_t mod, const Elf_Ehdr *e) seg = (grub_dl_segment_t) grub_malloc (sizeof (*seg)); if (! seg) return grub_errno; - + if (s->sh_size) { void *addr; @@ -323,7 +323,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) Elf_Sym *sym; const char *str; Elf_Word size, entsize; - + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) @@ -336,7 +336,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) sym = (Elf_Sym *) ((char *) e + s->sh_offset); size = s->sh_size; entsize = s->sh_entsize; - + s = (Elf_Shdr *) ((char *) e + e->e_shoff + e->e_shentsize * s->sh_link); str = (char *) e + s->sh_offset; @@ -347,7 +347,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) unsigned char type = ELF_ST_TYPE (sym->st_info); unsigned char bind = ELF_ST_BIND (sym->st_info); const char *name = str + sym->st_name; - + switch (type) { case STT_NOTYPE: @@ -377,7 +377,7 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) if (bind != STB_LOCAL) if (grub_dl_register_symbol (name, (void *) sym->st_value, mod)) return grub_errno; - + if (grub_strcmp (name, "grub_mod_init") == 0) mod->init = (void (*) (grub_dl_t)) sym->st_value; else if (grub_strcmp (name, "grub_mod_fini") == 0) @@ -445,7 +445,7 @@ grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e) s = (Elf_Shdr *) ((char *) e + e->e_shoff + e->e_shstrndx * e->e_shentsize); str = (char *) e + s->sh_offset; - + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) @@ -458,21 +458,21 @@ grub_dl_resolve_dependencies (grub_dl_t mod, Elf_Ehdr *e) { grub_dl_t m; grub_dl_dep_t dep; - + m = grub_dl_load (name); if (! m) return grub_errno; grub_dl_ref (m); - + dep = (grub_dl_dep_t) grub_malloc (sizeof (*dep)); if (! dep) return grub_errno; - + dep->mod = m; dep->next = mod->dep; mod->dep = dep; - + name += grub_strlen (name) + 1; } } @@ -488,7 +488,7 @@ grub_dl_ref (grub_dl_t mod) for (dep = mod->dep; dep; dep = dep->next) grub_dl_ref (dep->mod); - + return ++mod->ref_count; } @@ -499,7 +499,7 @@ grub_dl_unref (grub_dl_t mod) for (dep = mod->dep; dep; dep = dep->next) grub_dl_unref (dep->mod); - + return --mod->ref_count; } #endif @@ -590,7 +590,7 @@ grub_dl_load_file (const char *filename) grub_ssize_t size; void *core = 0; grub_dl_t mod = 0; - + file = grub_file_open (filename); if (! file) return 0; @@ -621,7 +621,7 @@ grub_dl_load_file (const char *filename) grub_free (core); return 0; } - + mod->ref_count = 0; return mod; } @@ -637,7 +637,7 @@ grub_dl_load (const char *name) mod = grub_dl_get (name); if (mod) return mod; - + if (! grub_dl_dir) { grub_error (GRUB_ERR_FILE_NOT_FOUND, "\"prefix\" is not set"); return 0; @@ -647,17 +647,17 @@ grub_dl_load (const char *name) + grub_strlen (name) + 4 + 1); if (! filename) return 0; - + grub_sprintf (filename, "%s/%s.mod", grub_dl_dir, name); mod = grub_dl_load_file (filename); grub_free (filename); if (! mod) return 0; - + if (grub_strcmp (mod->name, name) != 0) grub_error (GRUB_ERR_BAD_MODULE, "mismatched names"); - + return mod; } @@ -673,17 +673,17 @@ grub_dl_unload (grub_dl_t mod) if (mod->fini) (mod->fini) (); - + grub_dl_remove (mod); grub_dl_unregister_symbols (mod); - + for (dep = mod->dep; dep; dep = depn) { depn = dep->next; - + if (! grub_dl_unref (dep->mod)) grub_dl_unload (dep->mod); - + grub_free (dep); } @@ -693,7 +693,7 @@ grub_dl_unload (grub_dl_t mod) grub_free (seg->addr); grub_free (seg); } - + grub_free (mod->name); grub_free (mod); return 1; @@ -706,7 +706,7 @@ grub_dl_unload_unneeded (void) /* Because grub_dl_remove modifies the list of modules, this implementation is tricky. */ grub_dl_list_t p = grub_dl_head; - + while (p) { if (grub_dl_unload (p->mod)) @@ -726,7 +726,7 @@ grub_dl_unload_all (void) while (grub_dl_head) { grub_dl_list_t p; - + grub_dl_unload_unneeded (); /* Force to decrement the ref count. This will purge pre-loaded diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 25007e310..3da2beba3 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -42,12 +42,12 @@ grub_efi_locate_protocol (grub_efi_guid_t *protocol, void *registration) { void *interface; grub_efi_status_t status; - + status = efi_call_3 (grub_efi_system_table->boot_services->locate_protocol, protocol, registration, &interface); if (status != GRUB_EFI_SUCCESS) return 0; - + return interface; } @@ -64,11 +64,11 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type, grub_efi_status_t status; grub_efi_handle_t *buffer; grub_efi_uintn_t buffer_size = 8 * sizeof (grub_efi_handle_t); - + buffer = grub_malloc (buffer_size); if (! buffer) return 0; - + b = grub_efi_system_table->boot_services; status = efi_call_5 (b->locate_handle, search_type, protocol, search_key, &buffer_size, buffer); @@ -78,7 +78,7 @@ grub_efi_locate_handle (grub_efi_locate_search_type_t search_type, buffer = grub_malloc (buffer_size); if (! buffer) return 0; - + status = efi_call_5 (b->locate_handle, search_type, protocol, search_key, &buffer_size, buffer); } @@ -101,7 +101,7 @@ grub_efi_open_protocol (grub_efi_handle_t handle, grub_efi_boot_services_t *b; grub_efi_status_t status; void *interface; - + b = grub_efi_system_table->boot_services; status = efi_call_6 (b->open_protocol, handle, protocol, @@ -126,7 +126,7 @@ grub_efi_set_text_mode (int on) /* No console control protocol instance available, assume it is already in text mode. */ return 1; - + if (efi_call_4 (c->get_mode, c, &mode, 0, 0) != GRUB_EFI_SUCCESS) return 0; @@ -181,7 +181,7 @@ grub_efi_exit_boot_services (grub_efi_uintn_t map_key) { grub_efi_boot_services_t *b; grub_efi_status_t status; - + b = grub_efi_system_table->boot_services; status = efi_call_2 (b->exit_boot_services, grub_efi_image_handle, map_key); return status == GRUB_EFI_SUCCESS; @@ -215,7 +215,7 @@ grub_arch_modules_addr (void) struct grub_pe32_section_table *section; struct grub_module_info *info; grub_uint16_t i; - + image = grub_efi_get_loaded_image (grub_efi_image_handle); if (! image) return 0; @@ -250,7 +250,7 @@ char * grub_efi_get_filename (grub_efi_device_path_t *dp) { char *name = 0; - + while (1) { grub_efi_uint8_t type = GRUB_EFI_DEVICE_PATH_TYPE (dp); @@ -274,7 +274,7 @@ grub_efi_get_filename (grub_efi_device_path_t *dp) } else size = 0; - + len = ((GRUB_EFI_DEVICE_PATH_LENGTH (dp) - 4) / sizeof (grub_efi_char16_t)); p = grub_realloc (name, size + len * 4 + 1); @@ -420,17 +420,17 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) grub_efi_expanded_acpi_device_path_t eacpi; grub_memcpy (&eacpi, dp, sizeof (eacpi)); grub_printf ("/ACPI("); - + if (GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp)[0] == '\0') grub_printf ("%x,", (unsigned) eacpi.hid); else grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_HIDSTR (dp)); - + if (GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp)[0] == '\0') grub_printf ("%x,", (unsigned) eacpi.uid); else grub_printf ("%s,", GRUB_EFI_EXPANDED_ACPI_UIDSTR (dp)); - + if (GRUB_EFI_EXPANDED_ACPI_CIDSTR (dp)[0] == '\0') grub_printf ("%x)", (unsigned) eacpi.cid); else @@ -727,7 +727,7 @@ grub_efi_print_device_path (grub_efi_device_path_t *dp) return; break; } - + if (GRUB_EFI_END_ENTIRE_DEVICE_PATH (dp)) break; @@ -749,7 +749,7 @@ grub_efi_finish_boot_services (void) return 0; mmap_buf = grub_malloc (mmap_size); - + if (grub_efi_get_memory_map (&mmap_size, mmap_buf, &map_key, &desc_size, &desc_version) <= 0) return 0; diff --git a/kern/efi/init.c b/kern/efi/init.c index 115a087fa..f9ba03852 100644 --- a/kern/efi/init.c +++ b/kern/efi/init.c @@ -43,7 +43,7 @@ void grub_efi_set_prefix (void) { grub_efi_loaded_image_t *image; - + image = grub_efi_get_loaded_image (grub_efi_image_handle); if (image) { @@ -52,12 +52,12 @@ grub_efi_set_prefix (void) device = grub_efidisk_get_device_name (image->device_handle); file = grub_efi_get_filename (image->file_path); - + if (device && file) { char *p; char *prefix; - + /* Get the directory. */ p = grub_strrchr (file, '/'); if (p) @@ -72,7 +72,7 @@ grub_efi_set_prefix (void) grub_free (prefix); } } - + grub_free (device); grub_free (file); } diff --git a/kern/efi/mm.c b/kern/efi/mm.c index 30b5ab4ad..e1fca81f3 100644 --- a/kern/efi/mm.c +++ b/kern/efi/mm.c @@ -64,7 +64,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, if (address > 0xffffffff) return 0; #endif - + #if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL) if (address == 0) { @@ -95,7 +95,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, if (status != GRUB_EFI_SUCCESS) return 0; } - + if (allocated_pages) { unsigned i; @@ -111,7 +111,7 @@ grub_efi_allocate_pages (grub_efi_physical_address_t address, if (i == MAX_ALLOCATED_PAGES) grub_fatal ("too many page allocations"); } - + return (void *) ((grub_addr_t) address); } @@ -127,7 +127,7 @@ grub_efi_free_pages (grub_efi_physical_address_t address, != address)) { unsigned i; - + for (i = 0; i < MAX_ALLOCATED_PAGES; i++) if (allocated_pages[i].addr == address) { @@ -135,7 +135,7 @@ grub_efi_free_pages (grub_efi_physical_address_t address, break; } } - + b = grub_efi_system_table->boot_services; efi_call_2 (b->free_pages, address, pages); } @@ -159,7 +159,7 @@ grub_efi_get_memory_map (grub_efi_uintn_t *memory_map_size, map_key = &key; if (! descriptor_version) descriptor_version = &version; - + b = grub_efi_system_table->boot_services; status = efi_call_5 (b->get_memory_map, memory_map_size, memory_map, map_key, descriptor_size, descriptor_version); @@ -179,13 +179,13 @@ sort_memory_map (grub_efi_memory_descriptor_t *memory_map, { grub_efi_memory_descriptor_t *d1; grub_efi_memory_descriptor_t *d2; - + for (d1 = memory_map; d1 < memory_map_end; d1 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size)) { grub_efi_memory_descriptor_t *max_desc = d1; - + for (d2 = NEXT_MEMORY_DESCRIPTOR (d1, desc_size); d2 < memory_map_end; d2 = NEXT_MEMORY_DESCRIPTOR (d2, desc_size)) @@ -227,7 +227,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, && desc->num_pages != 0) { grub_memcpy (filtered_desc, desc, desc_size); - + /* Avoid less than 1MB, because some loaders seem to be confused. */ if (desc->physical_start < 0x100000) { @@ -235,7 +235,7 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, - desc->physical_start); desc->physical_start = 0x100000; } - + #if GRUB_TARGET_SIZEOF_VOID_P < 8 || defined (MCMODEL_SMALL) if (BYTES_TO_PAGES (filtered_desc->physical_start) + filtered_desc->num_pages @@ -244,10 +244,10 @@ filter_memory_map (grub_efi_memory_descriptor_t *memory_map, = (BYTES_TO_PAGES (0x100000000LL) - BYTES_TO_PAGES (filtered_desc->physical_start)); #endif - + if (filtered_desc->num_pages == 0) continue; - + filtered_desc = NEXT_MEMORY_DESCRIPTOR (filtered_desc, desc_size); } } @@ -263,7 +263,7 @@ get_total_pages (grub_efi_memory_descriptor_t *memory_map, { grub_efi_memory_descriptor_t *desc; grub_efi_uint64_t total = 0; - + for (desc = memory_map; desc < memory_map_end; desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) @@ -280,7 +280,7 @@ add_memory_regions (grub_efi_memory_descriptor_t *memory_map, grub_efi_uint64_t required_pages) { grub_efi_memory_descriptor_t *desc; - + for (desc = memory_map; desc < memory_map_end; desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) @@ -323,7 +323,7 @@ print_memory_map (grub_efi_memory_descriptor_t *memory_map, { grub_efi_memory_descriptor_t *desc; int i; - + for (desc = memory_map, i = 0; desc < memory_map_end; desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size), i++) @@ -354,7 +354,7 @@ grub_efi_mm_init (void) grub_fatal ("cannot allocate memory"); grub_memset (allocated_pages, 0, ALLOCATED_PAGES_SIZE); - + /* Prepare a memory region to store two memory maps. */ memory_map = grub_efi_allocate_pages (0, 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); @@ -370,10 +370,10 @@ grub_efi_mm_init (void) grub_fatal ("cannot get memory map"); memory_map_end = NEXT_MEMORY_DESCRIPTOR (memory_map, map_size); - + filtered_memory_map_end = filter_memory_map (memory_map, filtered_memory_map, desc_size, memory_map_end); - + /* By default, request a quarter of the available memory. */ total_pages = get_total_pages (filtered_memory_map, desc_size, filtered_memory_map_end); @@ -403,7 +403,7 @@ grub_efi_mm_init (void) NEXT_MEMORY_DESCRIPTOR (memory_map, map_size)); grub_abort (); #endif - + /* Release the memory maps. */ grub_efi_free_pages ((grub_addr_t) memory_map, 2 * BYTES_TO_PAGES (MEMORY_MAP_SIZE)); diff --git a/kern/env.c b/kern/env.c index d8447b995..e85627b0b 100644 --- a/kern/env.c +++ b/kern/env.c @@ -29,7 +29,7 @@ struct grub_env_context { /* A hash table for variables. */ struct grub_env_var *vars[HASHSZ]; - + /* One level deeper on the stack. */ struct grub_env_context *prev; }; @@ -92,7 +92,7 @@ grub_env_context_open (int export) for (i = 0; i < HASHSZ; i++) { struct grub_env_var *var; - + for (var = context->prev->vars[i]; var; var = var->next) { if (export && var->type == GRUB_ENV_VAR_GLOBAL) @@ -106,7 +106,7 @@ grub_env_context_open (int export) } } } - + return GRUB_ERR_NONE; } @@ -118,12 +118,12 @@ grub_env_context_close (void) if (! current_context->prev) grub_fatal ("cannot close the initial context"); - + /* Free the variables associated with this context. */ for (i = 0; i < HASHSZ; i++) { struct grub_env_var *p, *q; - + for (p = current_context->vars[i]; p; p = q) { q = p->next; @@ -192,7 +192,7 @@ grub_env_set (const char *name, const char *val) var->value = var->write_hook (var, val); else var->value = grub_strdup (val); - + if (! var->value) { var->value = old; @@ -207,17 +207,17 @@ grub_env_set (const char *name, const char *val) var = grub_malloc (sizeof (*var)); if (! var) return grub_errno; - + grub_memset (var, 0, sizeof (*var)); /* This is not necessary, because GRUB_ENV_VAR_LOCAL == 0. But leave this for readability. */ var->type = GRUB_ENV_VAR_LOCAL; - + var->name = grub_strdup (name); if (! var->name) goto fail; - + var->value = grub_strdup (val); if (! var->value) goto fail; @@ -238,7 +238,7 @@ char * grub_env_get (const char *name) { struct grub_env_var *var; - + var = grub_env_find (name); if (! var) return 0; @@ -253,7 +253,7 @@ void grub_env_unset (const char *name) { struct grub_env_var *var; - + var = grub_env_find (name); if (! var) return; @@ -277,12 +277,12 @@ grub_env_iterate (int (*func) (struct grub_env_var *var)) struct grub_env_sorted_var *sorted_list = 0; struct grub_env_sorted_var *sorted_var; int i; - + /* Add variables associated with this context into a sorted list. */ for (i = 0; i < HASHSZ; i++) { struct grub_env_var *var; - + for (var = current_context->vars[i]; var; var = var->next) { struct grub_env_sorted_var *p, **q; @@ -290,7 +290,7 @@ grub_env_iterate (int (*func) (struct grub_env_var *var)) /* Ignore data slots. */ if (var->type == GRUB_ENV_VAR_DATA) continue; - + sorted_var = grub_malloc (sizeof (*sorted_var)); if (! sorted_var) goto fail; @@ -302,7 +302,7 @@ grub_env_iterate (int (*func) (struct grub_env_var *var)) if (grub_strcmp (p->var->name, var->name) > 0) break; } - + sorted_var->next = *q; *q = sorted_var; } @@ -336,11 +336,11 @@ grub_register_variable_hook (const char *name, { if (grub_env_set (name, "") != GRUB_ERR_NONE) return grub_errno; - + var = grub_env_find (name); /* XXX Insert an assertion? */ } - + var->read_hook = read_hook; var->write_hook = write_hook; @@ -355,7 +355,7 @@ mangle_data_slot_name (const char *name) mangled_name = grub_malloc (grub_strlen (name) + 2); if (! mangled_name) return 0; - + grub_sprintf (mangled_name, "\e%s", name); return mangled_name; } @@ -382,7 +382,7 @@ grub_env_set_data_slot (const char *name, const void *ptr) var = grub_malloc (sizeof (*var)); if (! var) goto fail; - + grub_memset (var, 0, sizeof (*var)); var->type = GRUB_ENV_VAR_DATA; @@ -404,7 +404,7 @@ grub_env_get_data_slot (const char *name) { char *mangled_name; void *ptr = 0; - + mangled_name = mangle_data_slot_name (name); if (! mangled_name) goto fail; @@ -413,7 +413,7 @@ grub_env_get_data_slot (const char *name) grub_free (mangled_name); fail: - + return ptr; } @@ -421,7 +421,7 @@ void grub_env_unset_data_slot (const char *name) { char *mangled_name; - + mangled_name = mangle_data_slot_name (name); if (! mangled_name) return; diff --git a/kern/err.c b/kern/err.c index 8c78cb7b0..311130154 100644 --- a/kern/err.c +++ b/kern/err.c @@ -40,7 +40,7 @@ grub_err_t grub_error (grub_err_t n, const char *fmt, ...) { va_list ap; - + grub_errno = n; va_start (ap, fmt); @@ -73,7 +73,7 @@ grub_error_push (void) grub_memcpy (grub_error_stack_items[grub_error_stack_pos].errmsg, grub_errmsg, sizeof (grub_errmsg)); - + /* Advance to next error stack position. */ grub_error_stack_pos++; } @@ -96,19 +96,19 @@ grub_error_pop (void) { /* Pop error message from error stack to current active error. */ grub_error_stack_pos--; - + grub_errno = grub_error_stack_items[grub_error_stack_pos].errno; grub_memcpy (grub_errmsg, grub_error_stack_items[grub_error_stack_pos].errmsg, sizeof (grub_errmsg)); - + return 1; } else { /* There is no more items on error stack, reset to no error state. */ grub_errno = GRUB_ERR_NONE; - + return 0; } } @@ -122,9 +122,9 @@ grub_print_error (void) { if (grub_errno != GRUB_ERR_NONE) grub_err_printf ("error: %s\n", grub_errmsg); - } + } while (grub_error_pop ()); - + /* If there was an assert while using error stack, report about it. */ if (grub_error_stack_assert) { diff --git a/kern/file.c b/kern/file.c index adf55daf3..17e6e781b 100644 --- a/kern/file.c +++ b/kern/file.c @@ -32,7 +32,7 @@ grub_file_get_device_name (const char *name) { char *p = grub_strchr (name, ')'); char *ret; - + if (! p) { grub_error (GRUB_ERR_BAD_FILENAME, "missing `)'"); @@ -42,7 +42,7 @@ grub_file_get_device_name (const char *name) ret = (char *) grub_malloc (p - name); if (! ret) return 0; - + grub_memcpy (ret, name + 1, p - name - 1); ret[p - name - 1] = '\0'; return ret; @@ -74,16 +74,16 @@ grub_file_open (const char *name) grub_free (device_name); if (! device) goto fail; - + file = (grub_file_t) grub_malloc (sizeof (*file)); if (! file) goto fail; - + file->device = device; file->offset = 0; file->data = 0; file->read_hook = 0; - + if (device->disk && file_name[0] != '/') /* This is a block list. */ file->fs = &grub_fs_blocklist; @@ -106,7 +106,7 @@ grub_file_open (const char *name) /* if (net) grub_net_close (net); */ grub_free (file); - + return 0; } @@ -114,17 +114,17 @@ grub_ssize_t grub_file_read (grub_file_t file, char *buf, grub_size_t len) { grub_ssize_t res; - + if (len == 0 || len > file->size - file->offset) len = file->size - file->offset; /* Prevent an overflow. */ if ((grub_ssize_t) len < 0) len >>= 1; - + if (len == 0) return 0; - + res = (file->fs->read) (file, buf, len); if (res > 0) file->offset += res; @@ -155,7 +155,7 @@ grub_file_seek (grub_file_t file, grub_off_t offset) "attempt to seek outside of the file"); return -1; } - + old = file->offset; file->offset = offset; return old; diff --git a/kern/fs.c b/kern/fs.c index e2e4300ee..c8f4970b9 100644 --- a/kern/fs.c +++ b/kern/fs.c @@ -65,7 +65,7 @@ grub_fs_t grub_fs_probe (grub_device_t device) { grub_fs_t p; - auto int dummy_func (const char *filename, + auto int dummy_func (const char *filename, const struct grub_dirhook_info *info); int dummy_func (const char *filename __attribute__ ((unused)), @@ -100,24 +100,24 @@ grub_fs_probe (grub_device_t device) if (grub_fs_autoload_hook && count == 0) { count++; - + while (grub_fs_autoload_hook ()) { p = grub_fs_list; - + (p->dir) (device, "/", dummy_func); if (grub_errno == GRUB_ERR_NONE) { count--; return p; } - + if (grub_errno != GRUB_ERR_BAD_FS) { count--; return 0; } - + grub_errno = GRUB_ERR_NONE; } @@ -149,7 +149,7 @@ grub_fs_blocklist_open (grub_file_t file, const char *name) unsigned i; grub_disk_t disk = file->device->disk; struct grub_fs_block *blocks; - + /* First, count the number of blocks. */ do { @@ -198,14 +198,14 @@ grub_fs_blocklist_open (grub_file_t file, const char *name) grub_error (GRUB_ERR_BAD_FILENAME, "beyond the total sectors"); goto fail; } - + file->size += (blocks[i].length << GRUB_DISK_SECTOR_BITS); p++; } blocks[i].length = 0; file->data = blocks; - + return GRUB_ERR_NONE; fail: @@ -236,11 +236,11 @@ grub_fs_blocklist_read (grub_file_t file, char *buf, grub_size_t len) if (((size + offset + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS) > p->length - sector) size = ((p->length - sector) << GRUB_DISK_SECTOR_BITS) - offset; - + if (grub_disk_read (file->device->disk, p->offset + sector, offset, size, buf) != GRUB_ERR_NONE) return -1; - + ret += size; len -= size; sector -= ((size + offset) >> GRUB_DISK_SECTOR_BITS); diff --git a/kern/generic/millisleep.c b/kern/generic/millisleep.c index 20d883d44..9d5971f21 100644 --- a/kern/generic/millisleep.c +++ b/kern/generic/millisleep.c @@ -29,9 +29,9 @@ grub_millisleep (grub_uint32_t ms) start = grub_get_time_ms (); - /* Instead of setting an end time and looping while the current time is + /* Instead of setting an end time and looping while the current time is less than that, comparing the elapsed sleep time with the desired sleep - time handles the (unlikely!) case that the timer would wrap around + time handles the (unlikely!) case that the timer would wrap around during the sleep. */ while (grub_get_time_ms () - start < ms) diff --git a/kern/generic/rtc_get_time_ms.c b/kern/generic/rtc_get_time_ms.c index 74979e7fd..359233628 100644 --- a/kern/generic/rtc_get_time_ms.c +++ b/kern/generic/rtc_get_time_ms.c @@ -26,8 +26,8 @@ grub_uint64_t grub_rtc_get_time_ms (void) { - /* By dimensional analysis: - + /* By dimensional analysis: + 1000 ms N rtc ticks 1 s ------- * ----------- * ----------- = 1000*N/T ms 1 s 1 T rtc ticks diff --git a/kern/i386/dl.c b/kern/i386/dl.c index e9e43e513..978bfb166 100644 --- a/kern/i386/dl.c +++ b/kern/i386/dl.c @@ -56,7 +56,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); - + symtab = (Elf32_Sym *) ((char *) e + s->sh_offset); entsize = s->sh_entsize; @@ -75,7 +75,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { Elf32_Rel *rel, *max; - + for (rel = (Elf32_Rel *) ((char *) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; @@ -83,15 +83,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { Elf32_Word *addr; Elf32_Sym *sym; - + if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - + addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset); sym = (Elf32_Sym *) ((char *) symtab + entsize * ELF32_R_SYM (rel->r_info)); - + switch (ELF32_R_TYPE (rel->r_info)) { case R_386_32: diff --git a/kern/i386/ieee1275/init.c b/kern/i386/ieee1275/init.c index 066373e2e..2289f9b24 100644 --- a/kern/i386/ieee1275/init.c +++ b/kern/i386/ieee1275/init.c @@ -25,7 +25,7 @@ grub_stop_floppy (void) { } -void +void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) { diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index c64497ed6..b5339214e 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -46,7 +46,7 @@ static int num_regions; grub_addr_t grub_os_area_addr; grub_size_t grub_os_area_size; -void +void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) { @@ -64,20 +64,20 @@ make_install_device (void) to the boot drive. */ if (grub_root_drive == 0xFF) grub_root_drive = grub_boot_drive; - + grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f', grub_root_drive & 0x7f); - + if (grub_install_dos_part >= 0) grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1); - + if (grub_install_bsd_part >= 0) grub_sprintf (dev + grub_strlen (dev), ",%c", grub_install_bsd_part + 'a'); - + grub_sprintf (dev + grub_strlen (dev), ")%s", grub_prefix); grub_strcpy (grub_prefix, dev); } - + return grub_prefix; } @@ -115,7 +115,7 @@ compact_mem_regions (void) if (mem_regions[i].addr + mem_regions[i].size >= mem_regions[i + 1].addr) { j = i + 1; - + if (mem_regions[i].addr + mem_regions[i].size < mem_regions[j].addr + mem_regions[j].size) mem_regions[i].size = (mem_regions[j].addr + mem_regions[j].size @@ -133,12 +133,12 @@ grub_machine_init (void) { int i; int grub_lower_mem; - + /* Initialize the console as early as possible. */ grub_console_init (); - + grub_lower_mem = grub_get_memsize (0) << 10; - + /* Sanity check. */ if (grub_lower_mem < GRUB_MEMORY_MACHINE_RESERVED_END) grub_fatal ("too small memory"); @@ -157,7 +157,7 @@ grub_machine_init (void) add_mem_region (GRUB_MEMORY_MACHINE_RESERVED_END, grub_lower_mem - GRUB_MEMORY_MACHINE_RESERVED_END); #endif - + auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) { @@ -166,16 +166,16 @@ grub_machine_init (void) { if (size <= 0x100000 - addr) return 0; - + size -= 0x100000 - addr; addr = 0x100000; } - + /* Ignore >4GB. */ if (addr <= 0xFFFFFFFF && type == GRUB_MACHINE_MEMORY_AVAILABLE) { grub_size_t len; - + len = (grub_size_t) ((addr + size > 0xFFFFFFFF) ? 0xFFFFFFFF - addr : size); @@ -186,7 +186,7 @@ grub_machine_init (void) } grub_machine_mmap_iterate (hook); - + compact_mem_regions (); /* Add the memory regions to free memory, except for the region starting @@ -204,7 +204,7 @@ grub_machine_init (void) } else grub_mm_init_region ((void *) mem_regions[i].addr, mem_regions[i].size); - + if (! grub_os_area_addr) grub_fatal ("no upper memory"); diff --git a/kern/i386/pc/lzo1x.S b/kern/i386/pc/lzo1x.S index e942e98d6..49ba8cc1a 100644 --- a/kern/i386/pc/lzo1x.S +++ b/kern/i386/pc/lzo1x.S @@ -16,7 +16,7 @@ * You should have received a copy of the GNU General Public License * along with GRUB. If not, see . */ - + /* * This code was stolen from the files enter.sh, leave.sh, lzo1x_d.sh, * lzo1x_f.s and lzo_asm.h in LZO version 1.08, and was heavily modified @@ -37,7 +37,7 @@ #define MOVSL(r1,r2,x) movl (r1), x ; addl $4, r1 ; movl x, (r2) ; addl $4, r2 #define COPYL_C(r1,r2,x,rc) 9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b #define COPYL(r1,r2,x) COPYL_C(r1,r2,x,%ecx) - + lzo1x_decompress: pushl %ebp pushl %edi @@ -50,7 +50,7 @@ lzo1x_decompress: movl OUTP, %edi movl $3, %ebp - + xorl %eax, %eax xorl %ebx, %ebx /* high bits 9-32 stay 0 */ lodsb @@ -283,7 +283,7 @@ lzo1x_decompress: .L_leave: negl %eax jnz 1f - + subl OUTP, %edi /* write back the uncompressed size */ movl %edi, %eax diff --git a/kern/i386/pc/mmap.c b/kern/i386/pc/mmap.c index d289c731d..52d8fd597 100644 --- a/kern/i386/pc/mmap.c +++ b/kern/i386/pc/mmap.c @@ -27,7 +27,7 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uin grub_uint32_t cont; struct grub_machine_mmap_entry *entry = (struct grub_machine_mmap_entry *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; - + /* Check if grub_get_mmap_entry works. */ cont = grub_get_mmap_entry (entry, 0); diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index cd323125f..0f80e8ab8 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -21,7 +21,7 @@ * Note: These functions defined in this file may be called from C. * Be careful of that you must not modify some registers. Quote * from gcc-2.95.2/gcc/config/i386/i386.h: - + 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any registers that can be used without being saved. @@ -52,9 +52,9 @@ #include #include #include - + #define ABS(x) ((x) - _start + GRUB_BOOT_MACHINE_KERNEL_ADDR + 0x200) - + .file "startup.S" .text @@ -140,7 +140,7 @@ multiboot_header: .long 0 /* entry addr */ .long multiboot_entry - _start + 0x100000 + 0x200 - + multiboot_entry: .code32 /* obtain the boot device */ @@ -157,7 +157,7 @@ multiboot_entry: /* jump to the real address */ movl $multiboot_trampoline, %eax jmp *%eax - + multiboot_trampoline: /* fill the boot information */ movl %edx, %eax @@ -178,7 +178,7 @@ multiboot_trampoline: /* enter the usual booting */ call prot_to_real .code16 - + /* the real mode code continues... */ codestart: cli /* we're not safe here! */ @@ -201,7 +201,7 @@ codestart: /* reset disk system (%ah = 0) */ int $0x13 - + /* transition to protected mode */ DATA32 call real_to_prot @@ -210,7 +210,7 @@ codestart: incl %eax call EXT_C(grub_gate_a20) - + #if defined(ENABLE_LZO) /* decompress the compressed part and put the result at 1MB */ movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %esi @@ -260,7 +260,7 @@ codestart: rep movsb #endif - + #ifdef APPLE_CC /* clean out the bss */ bss_start_abs = ABS (bss_start) @@ -279,13 +279,13 @@ codestart: movl $END_SYMBOL, %ecx subl %edi, %ecx #endif - + /* clean out */ xorl %eax, %eax cld rep stosb - + /* * Call the start of main body of C code. */ @@ -304,7 +304,7 @@ VARIABLE(grub_root_drive) .byte 0 .p2align 2 /* force 4-byte alignment */ - + /* * These next two routines, "real_to_prot" and "prot_to_real" are structured * in a very specific way. Be very careful when changing them. @@ -375,7 +375,7 @@ protcseg: FUNCTION(grub_gate_a20) movl %eax, %edx -gate_a20_test_current_state: +gate_a20_test_current_state: /* first of all, test if already in a good state */ call gate_a20_check_state cmpb %al, %dl @@ -402,7 +402,7 @@ gate_a20_try_bios: cmpb %al, %dl jnz gate_a20_try_system_control_port_a ret - + gate_a20_try_system_control_port_a: /* * In macbook, the keyboard test would hang the machine, so we move @@ -430,7 +430,7 @@ gate_a20_flush_keyboard_buffer: inb $0x64 andb $0x02, %al jnz gate_a20_flush_keyboard_buffer -2: +2: inb $0x64 andb $0x01, %al jz 3f @@ -438,14 +438,14 @@ gate_a20_flush_keyboard_buffer: jmp 2b 3: ret - -gate_a20_try_keyboard_controller: + +gate_a20_try_keyboard_controller: /* third, try the keyboard controller */ call gate_a20_flush_keyboard_buffer movb $0xd1, %al outb $0x64 -4: +4: inb $0x64 andb $0x02, %al jnz 4b @@ -467,18 +467,18 @@ gate_a20_try_keyboard_controller: /* everything failed, so restart from the beginning */ jnz gate_a20_try_bios ret - + gate_a20_check_state: /* iterate the checking for a while */ movl $100, %ecx -1: +1: call 3f cmpb %al, %dl jz 2f loop 1b 2: ret -3: +3: pushl %ebx pushl %ecx xorl %eax, %eax @@ -567,7 +567,7 @@ FUNCTION(grub_exit) int $0x18 jmp cold_reboot .code32 - + /* * grub_reboot() * @@ -576,13 +576,13 @@ FUNCTION(grub_exit) FUNCTION(grub_reboot) call prot_to_real .code16 -cold_reboot: +cold_reboot: /* cold boot */ movw $0x0472, %di movw %ax, (%di) ljmp $0xFFFF, $0x0000 .code32 - + /* * grub_halt(int no_apm) * @@ -596,7 +596,7 @@ FUNCTION(grub_halt) call prot_to_real .code16 - + /* detect APM */ movw $0x5300, %ax xorw %bx, %bx @@ -621,7 +621,7 @@ FUNCTION(grub_halt) movw $0x0101, %cx int $0x15 jc EXT_C(grub_hard_stop) - + /* set the power state to off */ movw $0x5307, %ax movw $1, %bx @@ -631,8 +631,8 @@ FUNCTION(grub_halt) /* shouldn't reach here */ jmp EXT_C(grub_hard_stop) .code32 - - + + /* * void grub_chainloader_real_boot (int drive, void *part_addr) * @@ -683,7 +683,7 @@ FUNCTION(grub_biosdisk_rw_int13_extensions) movb %al, %dh /* enter real mode */ call prot_to_real - + .code16 movb %dh, %ah movw %cx, %ds @@ -699,7 +699,7 @@ FUNCTION(grub_biosdisk_rw_int13_extensions) popl %ebp ret - + /* * int grub_biosdisk_rw_standard (int ah, int drive, int coff, int hoff, * int soff, int nsec, int segment) @@ -735,7 +735,7 @@ FUNCTION(grub_biosdisk_rw_standard) movw %ax, %di /* save SEGMENT in %bx */ movw 0x14(%ebp), %bx - + /* enter real mode */ call prot_to_real @@ -744,7 +744,7 @@ FUNCTION(grub_biosdisk_rw_standard) xorw %bx, %bx movw $3, %si /* attempt at least three times */ -1: +1: movw %di, %ax int $0x13 /* do the operation */ jnc 2f /* check if successful */ @@ -753,19 +753,19 @@ FUNCTION(grub_biosdisk_rw_standard) /* if fail, reset the disk system */ xorw %ax, %ax int $0x13 - + decw %si cmpw $0, %si je 2f xorb %bl, %bl jmp 1b /* retry */ -2: +2: /* back to protected mode */ DATA32 call real_to_prot .code32 movb %bl, %al /* return value in %eax */ - + popl %esi popl %edi popl %ebx @@ -794,7 +794,7 @@ FUNCTION(grub_biosdisk_check_int13_extensions) movb $0x41, %ah movw $0x55aa, %bx int $0x13 /* do the operation */ - + /* check the result */ jc 1f cmpw $0xaa55, %bx @@ -805,7 +805,7 @@ FUNCTION(grub_biosdisk_check_int13_extensions) /* check if AH=0x42 is supported */ andw $1, %cx jnz 2f - + 1: xorb %bl, %bl 2: @@ -870,13 +870,13 @@ FUNCTION(grub_biosdisk_get_diskinfo_int13_extensions) popl %esi popl %ebx popl %ebp - + ret /* * int grub_biosdisk_get_diskinfo_standard (int drive, - * unsigned long *cylinders, + * unsigned long *cylinders, * unsigned long *heads, * unsigned long *sectors) * @@ -894,7 +894,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_standard) /* push HEADS */ pushl %ecx /* SECTORS is on the stack */ - + /* drive */ movb %al, %dl /* enter real mode */ @@ -936,7 +936,7 @@ FUNCTION(grub_biosdisk_get_diskinfo_standard) andb $0x3f, %cl movzbl %cl, %eax movl %eax, (%edi) - + xorl %eax, %eax movb %bl, %al /* return value in %eax */ @@ -955,20 +955,20 @@ FUNCTION(grub_biosdisk_get_num_floppies) xorl %edx, %edx call prot_to_real - + .code16 /* reset the disk system first */ int $0x13 1: stc - + /* call GET DISK TYPE */ movb $0x15, %ah int $0x13 jc 2f - /* check if this drive exists */ + /* check if this drive exists */ testb $0x3, %ah jz 2f @@ -982,8 +982,8 @@ FUNCTION(grub_biosdisk_get_num_floppies) movl %edx, %eax popl %ebp ret - - + + /* * * grub_get_memsize(i) : return the memory size in KB. i == 0 for conventional @@ -1080,7 +1080,7 @@ FUNCTION(grub_get_mmap_entry) /* push ADDR */ pushl %eax - + /* place address (+4) in ES:DI */ addl $4, %eax movl %eax, %edi @@ -1148,7 +1148,7 @@ xsmap: popl %ebp ret - + /* * void grub_console_real_putchar (int c) * @@ -1167,7 +1167,7 @@ FUNCTION(grub_console_real_putchar) movl %eax, %edx pusha movb EXT_C(grub_console_cur_color), %bl - + call prot_to_real .code16 movb %dl, %al @@ -1186,7 +1186,7 @@ FUNCTION(grub_console_real_putchar) /* save the character and the attribute on the stack */ pushw %ax pushw %bx - + /* get the current position */ movb $0x3, %ah int $0x10 @@ -1194,22 +1194,22 @@ FUNCTION(grub_console_real_putchar) /* check the column with the width */ cmpb $79, %dl jl 2f - - /* print CR and LF, if next write will exceed the width */ + + /* print CR and LF, if next write will exceed the width */ movw $0x0e0d, %ax int $0x10 movb $0x0a, %al int $0x10 - + /* get the current position */ movb $0x3, %ah int $0x10 -2: +2: /* restore the character and the attribute */ popw %bx popw %ax - + /* write the character with the attribute */ movb $0x9, %ah movw $1, %cx @@ -1225,13 +1225,13 @@ FUNCTION(grub_console_real_putchar) 1: movw $1, %bx movb $0xe, %ah int $0x10 - + 3: DATA32 call real_to_prot .code32 - + popa ret - + /* * int grub_console_getkey (void) @@ -1254,7 +1254,7 @@ translation_table: .word GRUB_CONSOLE_KEY_PPAGE, GRUB_TERM_PPAGE .word GRUB_CONSOLE_KEY_NPAGE, GRUB_TERM_NPAGE .word 0 - + /* * translate_keycode translates the key code %dx to an ascii code. */ @@ -1263,14 +1263,14 @@ translation_table: translate_keycode: pushw %bx pushw %si - + #ifdef APPLE_CC translation_table_abs = ABS (translation_table) - 0x10000 movw $(translation_table_abs), %si #else movw $ABS(translation_table), %si #endif - + 1: lodsw /* check if this is the end */ testw %ax, %ax @@ -1289,7 +1289,7 @@ translate_keycode: ret .code32 - + FUNCTION(grub_console_getkey) pushl %ebp @@ -1317,7 +1317,7 @@ FUNCTION(grub_console_getkey) movw %ax, %dx /* real_to_prot uses %eax */ call translate_keycode - + DATA32 call real_to_prot .code32 @@ -1343,7 +1343,7 @@ FUNCTION(grub_console_getkey) FUNCTION(grub_console_checkkey) pushl %ebp xorl %edx, %edx - + call prot_to_real /* enter real mode */ .code16 @@ -1351,7 +1351,7 @@ FUNCTION(grub_console_checkkey) int $0x16 jz notpending - + movw %ax, %dx DATA32 jmp pending @@ -1367,7 +1367,7 @@ pending: popl %ebp ret - + /* * grub_uint16_t grub_console_getxy (void) * BIOS call "INT 10H Function 03h" to get cursor position @@ -1433,7 +1433,7 @@ FUNCTION(grub_console_gotoxy) popl %ebp ret - + /* * void grub_console_cls (void) * BIOS call "INT 10H Function 09h" to write character and attribute @@ -1474,7 +1474,7 @@ FUNCTION(grub_console_cls) popl %ebp ret - + /* * void grub_console_setcursor (int on) * BIOS call "INT 10H Function 01h" to set cursor type @@ -1487,14 +1487,14 @@ console_cursor_state: .byte 1 console_cursor_shape: .word 0 - + FUNCTION(grub_console_setcursor) pushl %ebp pushl %ebx /* push ON */ pushl %eax - + /* check if the standard cursor shape has already been saved */ movw console_cursor_shape, %ax testw %ax, %ax @@ -1518,12 +1518,12 @@ FUNCTION(grub_console_setcursor) testl %eax, %eax jz 2f movw console_cursor_shape, %cx -2: +2: call prot_to_real .code16 movb $0x1, %ah - int $0x10 + int $0x10 DATA32 call real_to_prot .code32 @@ -1531,7 +1531,7 @@ FUNCTION(grub_console_setcursor) popl %ebx popl %ebp ret - + /* * grub_getrtsecs() * if a seconds value can be read, read it and return it (BCD), @@ -1572,7 +1572,7 @@ gottime: popl %ebp ret - + /* * grub_get_rtc() * return the real time in ticks, of which there are about @@ -1669,7 +1669,7 @@ FUNCTION(grub_vbe_bios_get_controller_info) xorw %ax, %ax shrl $4, %eax mov %eax, %edx /* prot_to_real destroys %eax. */ - + call prot_to_real .code16 @@ -1688,7 +1688,7 @@ FUNCTION(grub_vbe_bios_get_controller_info) movl %edx, %eax andl $0x0FFFF, %eax /* Return value in %eax. */ - + pop %edx popl %edi popl %ebp @@ -1770,7 +1770,7 @@ FUNCTION(grub_vbe_bios_set_mode) DATA32 call real_to_prot .code32 - + movw %dx, %ax andl $0xFFFF, %eax /* Return value in %eax. */ @@ -1841,7 +1841,7 @@ FUNCTION(grub_vbe_bios_set_memory_window) DATA32 call real_to_prot .code32 - + movw %dx, %ax andl $0xFFFF, %eax /* Return value in %eax. */ @@ -1914,7 +1914,7 @@ FUNCTION(grub_vbe_bios_set_scanline_length) DATA32 call real_to_prot .code32 - + movw %dx, %ax andl $0xFFFF, %eax /* Return value in %eax. */ @@ -1977,7 +1977,7 @@ FUNCTION(grub_vbe_bios_set_display_start) .code16 movw $0x4f07, %ax - movw $0x0080, %bx /* BL = 80h, Set Display Start + movw $0x0080, %bx /* BL = 80h, Set Display Start during Vertical Retrace. */ int $0x10 @@ -1985,7 +1985,7 @@ FUNCTION(grub_vbe_bios_set_display_start) DATA32 call real_to_prot .code32 - + movw %dx, %ax andl $0xFFFF, %eax /* Return value in %eax. */ @@ -2075,7 +2075,7 @@ FUNCTION(grub_vbe_bios_set_palette_data) DATA32 call real_to_prot .code32 - + movw %dx, %ax andl $0xFFFF, %eax /* Return value in %eax. */ diff --git a/kern/i386/realmode.S b/kern/i386/realmode.S index 680353e58..d28c5ca56 100644 --- a/kern/i386/realmode.S +++ b/kern/i386/realmode.S @@ -21,7 +21,7 @@ * Note: These functions defined in this file may be called from C. * Be careful of that you must not modify some registers. Quote * from gcc-2.95.2/gcc/config/i386/i386.h: - + 1 for registers not available across function calls. These must include the FIXED_REGISTERS and also any registers that can be used without being saved. @@ -84,7 +84,7 @@ gdt: /* -- data segment -- * base = 0x00000000, limit 0xFFFFF (4 KiB Granularity), present - * type = 32 bit data read/write, DPL = 0 + * type = 32 bit data read/write, DPL = 0 */ .word 0xFFFF, 0 .byte 0, 0x92, 0xCF, 0 diff --git a/kern/i386/tsc.c b/kern/i386/tsc.c index 4d3f05a26..36b35e27f 100644 --- a/kern/i386/tsc.c +++ b/kern/i386/tsc.c @@ -1,6 +1,6 @@ /* kern/i386/tsc.c - x86 TSC time source implementation * Requires Pentium or better x86 CPU that supports the RDTSC instruction. - * This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to + * This module uses the RTC (via grub_get_rtc()) to calibrate the TSC to * real time. * * GRUB -- GRand Unified Bootloader diff --git a/kern/ieee1275/ieee1275.c b/kern/ieee1275/ieee1275.c index f537b11ff..37a98071c 100644 --- a/kern/ieee1275/ieee1275.c +++ b/kern/ieee1275/ieee1275.c @@ -125,7 +125,7 @@ grub_ieee1275_next_property (grub_ieee1275_phandle_t phandle, char *prev_prop, } int -grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle, +grub_ieee1275_get_property_length (grub_ieee1275_phandle_t phandle, const char *prop, grub_ssize_t *length) { struct get_property_args @@ -164,7 +164,7 @@ grub_ieee1275_instance_to_package (grub_ieee1275_ihandle_t ihandle, INIT_IEEE1275_COMMON (&args.common, "instance-to-package", 1, 1); args.ihandle = ihandle; - + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; *phandlep = args.phandle; @@ -192,7 +192,7 @@ grub_ieee1275_package_to_path (grub_ieee1275_phandle_t phandle, args.phandle = phandle; args.buf = (grub_ieee1275_cell_t) path; args.buflen = (grub_ieee1275_cell_t) len; - + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; if (actual) @@ -221,7 +221,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle, args.ihandle = ihandle; args.buf = (grub_ieee1275_cell_t) path; args.buflen = (grub_ieee1275_cell_t) len; - + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; if (actual) @@ -232,7 +232,7 @@ grub_ieee1275_instance_to_path (grub_ieee1275_ihandle_t ihandle, } int -grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer, +grub_ieee1275_write (grub_ieee1275_ihandle_t ihandle, void *buffer, grub_size_t len, grub_ssize_t *actualp) { struct write_args @@ -517,7 +517,7 @@ grub_ieee1275_release (grub_addr_t addr, grub_size_t size) INIT_IEEE1275_COMMON (&args.common, "release", 2, 0); args.addr = addr; args.size = size; - + if (IEEE1275_CALL_ENTRY_FN (&args) == -1) return -1; return 0; diff --git a/kern/main.c b/kern/main.c index 1082aad0f..9215d55e7 100644 --- a/kern/main.c +++ b/kern/main.c @@ -39,7 +39,7 @@ grub_module_iterate (int (*hook) (struct grub_module_header *header)) modbase = grub_arch_modules_addr (); modinfo = (struct grub_module_info *) modbase; - + /* Check if there are any modules. */ if ((modinfo == 0) || modinfo->magic != GRUB_MODULE_MAGIC) return; @@ -100,7 +100,7 @@ grub_env_write_root (struct grub_env_var *var __attribute__ ((unused)), { /* XXX Is it better to check the existence of the device? */ grub_size_t len = grub_strlen (val); - + if (val[0] == '(' && val[len - 1] == ')') return grub_strndup (val + 1, len - 2); @@ -115,9 +115,9 @@ grub_set_root_dev (void) grub_register_variable_hook ("root", 0, grub_env_write_root); grub_env_export ("root"); - + prefix = grub_env_get ("prefix"); - + if (prefix) { char *dev; @@ -137,7 +137,7 @@ grub_load_normal_mode (void) { /* Load the module. */ grub_dl_load ("normal"); - + /* Something went wrong. Print errors here to let user know why we're entering rescue mode. */ grub_print_error (); grub_errno = 0; @@ -170,7 +170,7 @@ grub_main (void) grub_register_core_commands (); grub_register_rescue_parser (); grub_register_rescue_reader (); - + grub_load_config (); grub_load_normal_mode (); grub_reader_loop (0); diff --git a/kern/misc.c b/kern/misc.c index 4b46c6762..d8eff6883 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -37,11 +37,11 @@ grub_memmove (void *dest, const void *src, grub_size_t n) { d += n; s += n; - + while (n--) *--d = *--s; } - + return dest; } @@ -77,7 +77,7 @@ char * grub_strncpy (char *dest, const char *src, int c) { char *p = dest; - + while ((*p++ = *src++) != '\0' && --c) ; @@ -138,13 +138,13 @@ grub_printf (const char *fmt, ...) { va_list ap; int ret; - + va_start (ap, fmt); ret = grub_vprintf (fmt, ap); va_end (ap); return ret; -} +} #if defined (APPLE_CC) && ! defined (GRUB_UTIL) int @@ -152,13 +152,13 @@ grub_err_printf (const char *fmt, ...) { va_list ap; int ret; - + va_start (ap, fmt); ret = grub_vprintf (fmt, ap); va_end (ap); - + return ret; -} +} #endif #if ! defined (APPLE_CC) && ! defined (GRUB_UTIL) @@ -172,10 +172,10 @@ grub_real_dprintf (const char *file, const int line, const char *condition, { va_list args; const char *debug = grub_env_get ("debug"); - + if (! debug) return; - + if (grub_strword (debug, "all") || grub_strword (debug, condition)) { grub_printf ("%s:%d: ", file, line); @@ -200,7 +200,7 @@ grub_memcmp (const void *s1, const void *s2, grub_size_t n) { const char *t1 = s1; const char *t2 = s2; - + while (n--) { if (*t1 != *t2) @@ -224,7 +224,7 @@ grub_strcmp (const char *s1, const char *s2) { if (*s1 != *s2) break; - + s1++; s2++; } @@ -237,12 +237,12 @@ grub_strncmp (const char *s1, const char *s2, grub_size_t n) { if (n == 0) return 0; - + while (*s1 && *s2 && --n) { if (*s1 != *s2) break; - + s1++; s2++; } @@ -275,7 +275,7 @@ grub_strncasecmp (const char *s1, const char *s2, grub_size_t n) { if (grub_tolower (*s1) != grub_tolower (*s2)) break; - + s1++; s2++; } @@ -326,7 +326,7 @@ grub_strstr (const char *haystack, const char *needle) /* Speed up the following searches of needle by caching its first character. */ char b = *needle++; - + for (;; haystack++) { if (*haystack == '\0') @@ -460,11 +460,11 @@ grub_strtoull (const char *str, char **end, int base) { unsigned long long num = 0; int found = 0; - + /* Skip white spaces. */ while (*str && grub_isspace (*str)) str++; - + /* Guess the base, if not specified. The prefix `0x' means 16, and the prefix `0' means 8. */ if (str[0] == '0') @@ -480,7 +480,7 @@ grub_strtoull (const char *str, char **end, int base) else if (base == 0 && str[1] >= '0' && str[1] <= '7') base = 8; } - + if (base == 0) base = 10; @@ -514,7 +514,7 @@ grub_strtoull (const char *str, char **end, int base) grub_error (GRUB_ERR_BAD_NUMBER, "unrecognized number"); return 0; } - + if (end) *end = (char *) str; @@ -526,7 +526,7 @@ grub_strdup (const char *s) { grub_size_t len; char *p; - + len = grub_strlen (s) + 1; p = (char *) grub_malloc (len); if (! p) @@ -540,14 +540,14 @@ grub_strndup (const char *s, grub_size_t n) { grub_size_t len; char *p; - + len = grub_strlen (s); if (len > n) len = n; p = (char *) grub_malloc (len + 1); if (! p) return 0; - + grub_memcpy (p, s, len); p[len] = '\0'; return p; @@ -616,17 +616,17 @@ grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r) return ((grub_uint32_t) n) / d; } - + while (bits--) { m <<= 1; - + if (n & (1ULL << 63)) m |= 1; - + q <<= 1; n <<= 1; - + if (m >= d) { q |= 1; @@ -636,7 +636,7 @@ grub_divmod64 (grub_uint64_t n, grub_uint32_t d, grub_uint32_t *r) if (r) *r = m; - + return q; } @@ -647,7 +647,7 @@ grub_lltoa (char *str, int c, unsigned long long n) { unsigned base = (c == 'x') ? 16 : 10; char *p; - + if ((long long) n < 0 && c == 'd') { n = (unsigned long long) (-((long long) n)); @@ -668,12 +668,12 @@ grub_lltoa (char *str, int c, unsigned long long n) do { unsigned m; - + n = grub_divmod64 (n, 10, &m); *p++ = m + '0'; } while (n); - + *p = 0; grub_reverse (str); @@ -688,7 +688,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) auto void write_char (unsigned char ch); auto void write_str (const char *s); auto void write_fill (const char ch, int n); - + void write_char (unsigned char ch) { if (str) @@ -711,7 +711,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) for (i = 0; i < n; i++) write_char (ch); } - + while ((c = *fmt++) != 0) { if (c != '%') @@ -825,7 +825,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) if (rightfill && grub_strlen (tmp) < format1) write_fill (zerofill, format1 - grub_strlen (tmp)); break; - + case 'c': n = va_arg (args, int); write_char (n & 0xff); @@ -836,7 +836,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) grub_uint32_t code = va_arg (args, grub_uint32_t); int shift; unsigned mask; - + if (code <= 0x7f) { shift = 0; @@ -875,7 +875,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) } write_char (mask | (code >> shift)); - + for (shift -= 6; shift >= 0; shift -= 6) write_char (0x80 | (0x3f & (code >> shift))); } @@ -901,7 +901,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) } else write_str ("(null)"); - + break; default: @@ -916,7 +916,7 @@ grub_vsprintf (char *str, const char *fmt, va_list args) if (count && !str) grub_refresh (); - + return count; } @@ -925,7 +925,7 @@ grub_sprintf (char *str, const char *fmt, ...) { va_list ap; int ret; - + va_start (ap, fmt); ret = grub_vsprintf (str, fmt, ap); va_end (ap); @@ -950,7 +950,7 @@ grub_utf16_to_utf8 (grub_uint8_t *dest, grub_uint16_t *src, { /* Surrogate pair. */ code = ((code_high - 0xD800) << 12) + (code - 0xDC00) + 0x10000; - + *dest++ = (code >> 18) | 0xF0; *dest++ = ((code >> 12) & 0x3F) | 0x80; *dest++ = ((code >> 6) & 0x3F) | 0x80; @@ -1009,7 +1009,7 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, grub_uint32_t *p = dest; int count = 0; grub_uint32_t code = 0; - + if (srcend) *srcend = src; @@ -1036,7 +1036,7 @@ grub_utf8_to_ucs4 (grub_uint32_t *dest, grub_size_t destsize, { if (c == 0) break; - + if ((c & 0x80) == 0x00) code = c; else if ((c & 0xe0) == 0xc0) diff --git a/kern/parser.c b/kern/parser.c index ee6b169da..5e56ede91 100644 --- a/kern/parser.c +++ b/kern/parser.c @@ -74,7 +74,7 @@ grub_parser_cmdline_state (grub_parser_state_t state, char c, char *result) if (transition->input == c) break; - if (transition->input == ' ' && ! grub_isalpha (c) + if (transition->input == ' ' && ! grub_isalpha (c) && ! grub_isdigit (c) && c != '_') break; @@ -136,7 +136,7 @@ grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline, vp = varname; if (! val) return; - + /* Insert the contents of the variable in the buffer. */ for (; *val; val++) *(bp++) = *val; @@ -156,7 +156,7 @@ grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline, { grub_parser_state_t newstate; char use; - + newstate = grub_parser_cmdline_state (state, *rd, &use); /* If a variable was being processed and this character does @@ -193,14 +193,14 @@ grub_parser_split_cmdline (const char *cmdline, grub_reader_getline_t getline, /* A special case for when the last character was part of a variable. */ add_var (GRUB_PARSER_STATE_TEXT); - + /* Reserve memory for the return values. */ args = grub_malloc (bp - buffer); if (! args) return grub_errno; grub_memcpy (args, buffer, bp - buffer); - + *argv = grub_malloc (sizeof (char *) * (*argc + 1)); if (! *argv) { diff --git a/kern/partition.c b/kern/partition.c index cb0e4f7b8..4d5c63a95 100644 --- a/kern/partition.c +++ b/kern/partition.c @@ -33,7 +33,7 @@ void grub_partition_map_unregister (grub_partition_map_t partmap) { grub_partition_map_t *p, q; - + for (p = &grub_partition_map_list, q = *p; q; p = &(q->next), q = q->next) if (q == partmap) { @@ -90,7 +90,7 @@ grub_partition_iterate (struct grub_disk *disk, { grub_partition_map_t partmap = 0; int ret = 0; - + auto int part_map_iterate (const grub_partition_map_t p); auto int part_map_iterate_hook (grub_disk_t d, const grub_partition_t partition); @@ -100,7 +100,7 @@ grub_partition_iterate (struct grub_disk *disk, { return 1; } - + int part_map_iterate (const grub_partition_map_t p) { grub_dprintf ("partition", "Detecting %s...\n", p->name); @@ -122,7 +122,7 @@ grub_partition_iterate (struct grub_disk *disk, grub_partition_map_iterate (part_map_iterate); if (partmap) ret = partmap->iterate (disk, hook); - + return ret; } diff --git a/kern/powerpc/dl.c b/kern/powerpc/dl.c index 0663a9634..ae987c087 100644 --- a/kern/powerpc/dl.c +++ b/kern/powerpc/dl.c @@ -47,7 +47,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) Elf32_Sym *symtab; Elf32_Word entsize; unsigned i; - + /* Find a symbol table. */ for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; @@ -57,10 +57,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); - + symtab = (Elf32_Sym *) ((char *) e + s->sh_offset); entsize = s->sh_entsize; - + for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize)) @@ -76,7 +76,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { Elf32_Rela *rel, *max; - + for (rel = (Elf32_Rela *) ((char *) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; @@ -85,15 +85,15 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) Elf32_Word *addr; Elf32_Sym *sym; grub_uint32_t value; - + if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - + addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset); sym = (Elf32_Sym *) ((char *) symtab + entsize * ELF32_R_SYM (rel->r_info)); - + /* On the PPC the value does not have an explicit addend, add it. */ value = sym->st_value + rel->r_addend; @@ -102,29 +102,29 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) case R_PPC_ADDR16_LO: *(Elf32_Half *) addr = value; break; - + case R_PPC_REL24: { Elf32_Sword delta = value - (Elf32_Word) addr; - + if (delta << 6 >> 6 != delta) return grub_error (GRUB_ERR_BAD_MODULE, "Relocation overflow"); *addr = (*addr & 0xfc000003) | (delta & 0x3fffffc); break; } - + case R_PPC_ADDR16_HA: *(Elf32_Half *) addr = (value + 0x8000) >> 16; break; - + case R_PPC_ADDR32: *addr = value; break; - + case R_PPC_REL32: *addr = value - (Elf32_Word) addr; break; - + default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "This relocation (%d) is not implemented yet", @@ -133,6 +133,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) } } } - + return GRUB_ERR_NONE; } diff --git a/kern/sparc64/dl.c b/kern/sparc64/dl.c index 29b8c8a9a..d998dafe8 100644 --- a/kern/sparc64/dl.c +++ b/kern/sparc64/dl.c @@ -47,7 +47,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) Elf64_Sym *symtab; Elf64_Word entsize; unsigned i; - + /* Find a symbol table. */ for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; @@ -57,10 +57,10 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); - + symtab = (Elf64_Sym *) ((char *) e + s->sh_offset); entsize = s->sh_entsize; - + for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize)) @@ -76,7 +76,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { Elf64_Rela *rel, *max; - + for (rel = (Elf64_Rela *) ((char *) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; @@ -85,11 +85,11 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) Elf64_Word *addr; Elf64_Sym *sym; Elf64_Addr value; - + if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - + addr = (Elf64_Word *) ((char *) seg->addr + rel->r_offset); sym = (Elf64_Sym *) ((char *) symtab + entsize * ELF64_R_SYM (rel->r_info)); @@ -139,6 +139,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) } } } - + return GRUB_ERR_NONE; } diff --git a/kern/term.c b/kern/term.c index c7c46cf94..3583a301d 100644 --- a/kern/term.c +++ b/kern/term.c @@ -35,12 +35,12 @@ struct grub_handler_class grub_term_input_class = { .name = "terminal_input" }; - + struct grub_handler_class grub_term_output_class = { .name = "terminal_output" }; - + #define grub_cur_term_input grub_term_get_current_input () #define grub_cur_term_output grub_term_get_current_output () @@ -53,16 +53,16 @@ grub_putcode (grub_uint32_t code) if (code == '\t' && grub_cur_term_output->getxy) { int n; - + n = 8 - ((grub_getxy () >> 8) & 7); while (n--) grub_putcode (' '); return; } - + (grub_cur_term_output->putchar) (code); - + if (code == '\n') { grub_putcode ('\r'); @@ -81,12 +81,12 @@ grub_putcode (grub_uint32_t code) grub_setcolorstate (GRUB_TERM_COLOR_STANDARD); key = grub_getkey (); - + /* Remove the message. */ grub_gotoxy (1, height - 1); grub_printf (" "); grub_gotoxy (pos >> 8, pos & 0xFF); - + /* Scroll one lines or an entire page, depending on the key. */ if (key == '\r' || key =='\n') grub_more_lines--; @@ -108,7 +108,7 @@ grub_putchar (int c) buf[size++] = c; ret = grub_utf8_to_ucs4 (&code, 1, buf, size, 0); - + if (ret > 0) { size = 0; @@ -201,7 +201,7 @@ grub_setcursor (int on) (grub_cur_term_output->setcursor) (on); cursor_state = on; } - + return ret; } diff --git a/lib/envblk.c b/lib/envblk.c index f15c9e1e4..311927bd8 100644 --- a/lib/envblk.c +++ b/lib/envblk.c @@ -35,14 +35,14 @@ grub_envblk_open (char *buf, grub_size_t size) grub_error (GRUB_ERR_BAD_FILE_TYPE, "invalid environment block"); return 0; } - + envblk = grub_malloc (sizeof (*envblk)); if (envblk) { envblk->buf = buf; envblk->size = size; } - + return envblk; } @@ -58,7 +58,7 @@ escaped_value_len (const char *value) { int n = 0; char *p; - + for (p = (char *) value; *p; p++) { if (*p == '\\' || *p == '\n') @@ -66,7 +66,7 @@ escaped_value_len (const char *value) else n++; } - + return n; } @@ -82,7 +82,7 @@ find_next_line (char *p, const char *pend) else p++; } - + return p + 1; } @@ -100,7 +100,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) vl = escaped_value_len (value); p = envblk->buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1; pend = envblk->buf + envblk->size; - + /* First, look at free space. */ for (space = pend - 1; *space == '#'; space--) ; @@ -116,10 +116,10 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) if (grub_memcmp (p, name, nl) == 0 && p[nl] == '=') { int len; - + /* Found the same name. */ p += nl + 1; - + /* Check the length of the current value. */ len = 0; while (p + len < pend && p[len] != '\n') @@ -159,7 +159,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) if (! found) { /* Append a new variable. */ - + if (pend - space < nl + 1 + vl + 1) /* No space. */ return 0; @@ -174,7 +174,7 @@ grub_envblk_set (grub_envblk_t envblk, const char *name, const char *value) { if (value[i] == '\\' || value[i] == '\n') *p++ = '\\'; - + *p++ = value[i]; } @@ -220,7 +220,7 @@ grub_envblk_delete (grub_envblk_t envblk, const char *name) } p = find_next_line (p, pend); - } + } } void @@ -261,7 +261,7 @@ grub_envblk_iterate (grub_envblk_t envblk, else p++; } - + if (p >= pend) /* Broken. */ return; @@ -272,10 +272,10 @@ grub_envblk_iterate (grub_envblk_t envblk, return; value = name + (value_start - name_start); - + grub_memcpy (name, name_start, name_end - name_start); name[name_end - name_start] = '\0'; - + for (p = value_start, q = value; *p != '\n'; ++p) { if (*p == '\\') @@ -284,13 +284,13 @@ grub_envblk_iterate (grub_envblk_t envblk, *q++ = *p; } *q = '\0'; - + ret = hook (name, value); grub_free (name); if (ret) return; } - + p = find_next_line (p, pend); } } diff --git a/lib/i386/setjmp.S b/lib/i386/setjmp.S index ba38bd2a8..a2002ae3d 100644 --- a/lib/i386/setjmp.S +++ b/lib/i386/setjmp.S @@ -19,9 +19,9 @@ #include .file "setjmp.S" - + .text - + /* * int grub_setjmp (grub_jmp_buf env) */ @@ -36,7 +36,7 @@ FUNCTION(grub_setjmp) xorl %eax, %eax jmp *%ecx - + /* * int grub_longjmp (grub_jmp_buf env, int val) */ @@ -53,4 +53,4 @@ FUNCTION(grub_longjmp) jnz 1f incl %eax 1: jmp *%ecx - + diff --git a/loader/efi/chainloader.c b/loader/efi/chainloader.c index a467ea325..01acc4135 100644 --- a/loader/efi/chainloader.c +++ b/loader/efi/chainloader.c @@ -45,7 +45,7 @@ static grub_err_t grub_chainloader_unload (void) { grub_efi_boot_services_t *b; - + b = grub_efi_system_table->boot_services; efi_call_1 (b->unload_image, image_handle); efi_call_2 (b->free_pages, address, pages); @@ -53,7 +53,7 @@ grub_chainloader_unload (void) grub_free (file_path); grub_free (cmdline); cmdline = 0; - + grub_dl_unref (my_mod); return GRUB_ERR_NONE; } @@ -65,7 +65,7 @@ grub_chainloader_boot (void) grub_efi_status_t status; grub_efi_uintn_t exit_data_size; grub_efi_char16_t *exit_data; - + b = grub_efi_system_table->boot_services; status = efi_call_3 (b->start_image, image_handle, &exit_data_size, &exit_data); if (status != GRUB_EFI_SUCCESS) @@ -73,13 +73,13 @@ grub_chainloader_boot (void) if (exit_data) { char *buf; - + buf = grub_malloc (exit_data_size * 4 + 1); if (buf) { *grub_utf16_to_utf8 ((grub_uint8_t *) buf, exit_data, exit_data_size) = 0; - + grub_error (GRUB_ERR_BAD_OS, buf); grub_free (buf); } @@ -92,7 +92,7 @@ grub_chainloader_boot (void) efi_call_1 (b->free_pool, exit_data); grub_chainloader_unload (); - + return grub_errno; } @@ -102,7 +102,7 @@ copy_file_path (grub_efi_file_path_device_path_t *fp, { grub_efi_char16_t *p; grub_efi_uint16_t size; - + fp->header.type = GRUB_EFI_MEDIA_DEVICE_PATH_TYPE; fp->header.subtype = GRUB_EFI_FILE_PATH_DEVICE_PATH_SUBTYPE; size = len * sizeof (grub_efi_char16_t) + sizeof (*fp); @@ -135,7 +135,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) grub_error (GRUB_ERR_BAD_FILENAME, "invalid EFI file path"); return 0; } - + size = 0; d = dp; while (1) @@ -145,7 +145,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) break; d = GRUB_EFI_NEXT_DEVICE_PATH (d); } - + file_path = grub_malloc (size + ((grub_strlen (dir_start) + 1) * sizeof (grub_efi_char16_t)) @@ -154,7 +154,7 @@ make_file_path (grub_efi_device_path_t *dp, const char *filename) return 0; grub_memcpy (file_path, dp, size); - + /* Fill the file path for the directory. */ d = (grub_efi_device_path_t *) ((char *) file_path + ((char *) d - (char *) dp)); @@ -194,14 +194,14 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); filename = argv[0]; - + grub_dl_ref (my_mod); /* Initialize some global variables. */ address = 0; image_handle = 0; file_path = 0; - + b = grub_efi_system_table->boot_services; file = grub_file_open (filename); @@ -219,7 +219,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), if (dev_handle) dp = grub_efi_get_device_path (dev_handle); } - + if (! dev->disk || ! dev_handle || ! dp) { grub_error (GRUB_ERR_BAD_DEVICE, "not a valid root device"); @@ -232,10 +232,10 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_printf ("file path: "); grub_efi_print_device_path (file_path); - + size = grub_file_size (file); pages = (((grub_efi_uintn_t) size + ((1 << 12) - 1)) >> 12); - + status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ANY_PAGES, GRUB_EFI_LOADER_CODE, pages, &address); @@ -262,7 +262,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_error (GRUB_ERR_OUT_OF_MEMORY, "out of resources"); else grub_error (GRUB_ERR_BAD_OS, "cannot load image"); - + goto fail; } @@ -276,7 +276,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), goto fail; } loaded_image->device_handle = dev_handle; - + grub_file_close (file); if (argc > 1) @@ -310,21 +310,21 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 0); return 0; - + fail: if (dev) grub_device_close (dev); - + if (file) grub_file_close (file); if (file_path) grub_free (file_path); - + if (address) efi_call_2 (b->free_pages, address, pages); - + grub_dl_unref (my_mod); return grub_errno; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index ab3a6353c..729cc880a 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -168,7 +168,7 @@ grub_freebsd_add_mmap (void) int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) { - /* FreeBSD assumes that first 64KiB are available. + /* FreeBSD assumes that first 64KiB are available. Not always true but try to prevent panic somehow. */ if (isfirstrun && addr != 0) { @@ -180,7 +180,7 @@ grub_freebsd_add_mmap (void) mmap++; } else - len += sizeof (struct grub_e820_mmap); + len += sizeof (struct grub_e820_mmap); } isfirstrun = 0; if (mmap) @@ -242,9 +242,9 @@ grub_freebsd_add_mmap (void) for (i = 0; i < mmap - mmap_buf; i++) grub_dprintf ("bsd", "smap %d, %d:%llx - %llx\n", i, mmap_buf[i].type, - (unsigned long long) mmap_buf[i].addr, + (unsigned long long) mmap_buf[i].addr, (unsigned long long) mmap_buf[i].size); - + grub_dprintf ("bsd", "%d entries in smap\n", mmap - mmap_buf); grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | FREEBSD_MODINFOMD_SMAP, mmap_buf, len); @@ -286,12 +286,12 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, if (is_64bit) { - grub_uint64_t addr64 = addr, size64 = size; + grub_uint64_t addr64 = addr, size64 = size; if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, grub_strlen (type) + 1)) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64, + (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr64, sizeof (addr64))) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size64, + (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size64, sizeof (size64)))) return grub_errno; } @@ -299,9 +299,9 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, { if ((grub_freebsd_add_meta (FREEBSD_MODINFO_TYPE, type, grub_strlen (type) + 1)) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, + (grub_freebsd_add_meta (FREEBSD_MODINFO_ADDR, &addr, sizeof (addr))) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, + (grub_freebsd_add_meta (FREEBSD_MODINFO_SIZE, &size, sizeof (size)))) return grub_errno; } @@ -502,22 +502,22 @@ grub_freebsd_boot (void) gdtdesc->base = gdt; /* Prepare trampoline. */ - trampoline = (grub_uint8_t *) (kern_end - 4096 + 24 + trampoline = (grub_uint8_t *) (kern_end - 4096 + 24 + sizeof (struct gdt_descriptor)); - launch_trampoline = (void __attribute__ ((cdecl, regparm (0))) + launch_trampoline = (void __attribute__ ((cdecl, regparm (0))) (*) (grub_addr_t entry, ...)) trampoline; grub_bsd64_trampoline_gdt = (grub_uint32_t) gdtdesc; - grub_bsd64_trampoline_selfjump + grub_bsd64_trampoline_selfjump = (grub_uint32_t) (trampoline + 6 - + ((grub_uint8_t *) &grub_bsd64_trampoline_selfjump + + ((grub_uint8_t *) &grub_bsd64_trampoline_selfjump - &grub_bsd64_trampoline_start)); /* Copy trampoline. */ - grub_memcpy (trampoline, &grub_bsd64_trampoline_start, + grub_memcpy (trampoline, &grub_bsd64_trampoline_start, &grub_bsd64_trampoline_end - &grub_bsd64_trampoline_start); /* Launch trampoline. */ - launch_trampoline (entry, entry_hi, pagetable, bi.bi_modulep, + launch_trampoline (entry, entry_hi, pagetable, bi.bi_modulep, kern_end); } else @@ -547,7 +547,7 @@ grub_openbsd_boot (void) case GRUB_MACHINE_MEMORY_AVAILABLE: pm->type = OPENBSD_MMAP_AVAILABLE; break; - + default: pm->type = OPENBSD_MMAP_RESERVED; break; @@ -574,7 +574,7 @@ grub_openbsd_boot (void) (part << OPENBSD_B_PARTSHIFT)); grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER, - 0, grub_mmap_get_upper () >> 10, + 0, grub_mmap_get_upper () >> 10, grub_mmap_get_lower () >> 10, (char *) pa - buf, buf); @@ -603,7 +603,7 @@ grub_netbsd_boot (void) bootinfo->bi_data[0] = rootdev; grub_unix_real_boot (entry, bootflags, 0, bootinfo, - 0, grub_mmap_get_upper () >> 10, + 0, grub_mmap_get_upper () >> 10, grub_mmap_get_lower () >> 10); /* Not reached. */ diff --git a/loader/i386/bsd_helper.S b/loader/i386/bsd_helper.S index 23c86109c..25aee3a80 100644 --- a/loader/i386/bsd_helper.S +++ b/loader/i386/bsd_helper.S @@ -17,9 +17,9 @@ */ #include - + .p2align 2 - + .code32 diff --git a/loader/i386/bsd_pagetable.c b/loader/i386/bsd_pagetable.c index 754f6f072..0fd393707 100644 --- a/loader/i386/bsd_pagetable.c +++ b/loader/i386/bsd_pagetable.c @@ -17,7 +17,7 @@ * along with GRUB. If not, see . */ -/* Based on the code from FreeBSD originally distributed under the +/* Based on the code from FreeBSD originally distributed under the following terms: */ /*- @@ -63,12 +63,12 @@ fill_bsd64_pagetable (grub_uint8_t *target) pt4 = (grub_uint64_t *) target; pt3 = (grub_uint64_t *) (target + 4096); pt2 = (grub_uint64_t *) (target + 8192); - + grub_memset ((char *) target, 0, 4096 * 3); /* * This is kinda brutal, but every single 1GB VM memory segment points to - * the same first 1GB of physical memory. But it is how BSD expects + * the same first 1GB of physical memory. But it is how BSD expects * it to be. */ for (i = 0; i < 512; i++) @@ -80,7 +80,7 @@ fill_bsd64_pagetable (grub_uint8_t *target) /* Each slot of the level 3 pages points to the same level 2 page */ pt3[i] = (grub_addr_t) &pt2[0]; pt3[i] |= PG_V | PG_RW | PG_U; - + /* The level 2 page slots are mapped with 2MB pages for 1GB. */ pt2[i] = i * (2 * 1024 * 1024); pt2[i] |= PG_V | PG_RW | PG_PS | PG_U; diff --git a/loader/i386/bsd_trampoline.S b/loader/i386/bsd_trampoline.S index 577ddb829..a568fff4d 100644 --- a/loader/i386/bsd_trampoline.S +++ b/loader/i386/bsd_trampoline.S @@ -17,7 +17,7 @@ * along with GRUB. If not, see . */ -/* Based on the code from FreeBSD originally distributed under the +/* Based on the code from FreeBSD originally distributed under the following terms: */ /*- @@ -48,7 +48,7 @@ * $FreeBSD$ */ - + #define MSR_EFER 0xc0000080 #define EFER_LME 0x00000100 #define CR4_PAE 0x00000020 @@ -58,10 +58,10 @@ #include .p2align 2 - - .code32 - + .code32 + + VARIABLE(grub_bsd64_trampoline_start) /* Discard `grub_unix_real_boot' return address. */ @@ -105,7 +105,7 @@ VARIABLE(grub_bsd64_trampoline_start) .byte 0x15 VARIABLE (grub_bsd64_trampoline_gdt) .long 0x0 - + /* ljmp */ .byte 0xea VARIABLE (grub_bsd64_trampoline_selfjump) diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index dae0f6dcd..97a693e96 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -103,21 +103,21 @@ find_mmap_size (void) if (mmap_size != 0) return mmap_size; - + mmap_size = (1 << 12); while (1) { int ret; grub_efi_memory_descriptor_t *mmap; grub_efi_uintn_t desc_size; - + mmap = grub_malloc (mmap_size); if (! mmap) return 0; ret = grub_efi_get_memory_map (&mmap_size, mmap, 0, &desc_size, 0); grub_free (mmap); - + if (ret < 0) grub_fatal ("cannot get memory map"); else if (ret > 0) @@ -147,7 +147,7 @@ free_pages (void) grub_efi_free_pages ((grub_addr_t) prot_mode_mem, prot_mode_pages); prot_mode_mem = 0; } - + if (initrd_mem) { grub_efi_free_pages ((grub_addr_t) initrd_mem, initrd_pages); @@ -165,7 +165,7 @@ allocate_pages (grub_size_t prot_size) grub_efi_uintn_t mmap_size, tmp_mmap_size; grub_efi_memory_descriptor_t *desc; grub_size_t real_size; - + /* Make sure that each size is aligned to a page boundary. */ real_size = GRUB_LINUX_CL_END_OFFSET; prot_size = page_align (prot_size); @@ -173,16 +173,16 @@ allocate_pages (grub_size_t prot_size) grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n", (unsigned) real_size, (unsigned) prot_size, (unsigned) mmap_size); - + /* Calculate the number of pages; Combine the real mode code with the memory map buffer for simplicity. */ real_mode_pages = ((real_size + mmap_size) >> 12); prot_mode_pages = (prot_size >> 12); - + /* Initialize the memory pointers with NULL for convenience. */ real_mode_mem = 0; prot_mode_mem = 0; - + /* Read the memory map temporarily, to find free space. */ mmap = grub_malloc (mmap_size); if (! mmap) @@ -193,7 +193,7 @@ allocate_pages (grub_size_t prot_size) grub_fatal ("cannot get memory map"); mmap_end = NEXT_MEMORY_DESCRIPTOR (mmap, tmp_mmap_size); - + /* First, find free pages for the real mode code and the memory map buffer. */ for (desc = mmap; @@ -208,7 +208,7 @@ allocate_pages (grub_size_t prot_size) { grub_efi_physical_address_t physical_end; grub_efi_physical_address_t addr; - + physical_end = desc->physical_start + (desc->num_pages << 12); if (physical_end > 0x90000) physical_end = 0x90000; @@ -225,7 +225,7 @@ allocate_pages (grub_size_t prot_size) real_mode_mem = grub_efi_allocate_pages (addr, real_mode_pages); if (! real_mode_mem) grub_fatal ("cannot allocate pages"); - + desc->num_pages -= real_mode_pages; break; } @@ -238,7 +238,7 @@ allocate_pages (grub_size_t prot_size) } mmap_buf = (void *) ((char *) real_mode_mem + real_size); - + /* Next, find free pages for the protected mode code. */ /* XXX what happens if anything is using this address? */ prot_mode_mem = grub_efi_allocate_pages (0x100000, prot_mode_pages + 1); @@ -299,7 +299,7 @@ grub_linux_boot (void) grub_efi_uintn_t desc_size; grub_efi_uint32_t desc_version; int e820_num; - + params = real_mode_mem; grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", @@ -382,12 +382,12 @@ grub_linux_boot (void) } #ifdef __x86_64__ - - grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), - grub_linux_trampoline_start, + + grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), + grub_linux_trampoline_start, grub_linux_trampoline_end - grub_linux_trampoline_start); - - ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem + + ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem + (prot_mode_pages << 12))) (params->code32_start, real_mode_mem); @@ -395,7 +395,7 @@ grub_linux_boot (void) /* Hardware interrupts are not safe any longer. */ asm volatile ("cli" : : ); - + /* Load the IDT and the GDT for the bootstrap. */ asm volatile ("lidt %0" : : "m" (idt_desc)); asm volatile ("lgdt %0" : : "m" (gdt_desc)); @@ -408,7 +408,7 @@ grub_linux_boot (void) /* Enter Linux. */ asm volatile ("jmp *%%ecx" : : ); - + #endif /* Never reach here. */ @@ -605,7 +605,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), char *dest; grub_dl_ref (my_mod); - + if (argc == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); @@ -650,17 +650,17 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } setup_sects = lh.setup_sects; - + /* If SETUP_SECTS is not set, set it to the default (4). */ if (! setup_sects) setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; real_size = setup_sects << GRUB_DISK_SECTOR_BITS; prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE; - + if (! allocate_pages (prot_size)) goto fail; - + params = (struct linux_kernel_params *) real_mode_mem; grub_memset (params, 0, GRUB_LINUX_CL_END_OFFSET); grub_memcpy (¶ms->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); @@ -691,7 +691,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), space. */ params->ext_mem = ((32 * 0x100000) >> 10); params->alt_mem = ((32 * 0x100000) >> 10); - + params->video_cursor_x = grub_getxy () >> 8; params->video_cursor_y = grub_getxy () & 0xff; params->video_page = 0; /* ??? */ @@ -778,7 +778,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_memset (params->padding7, 0, sizeof (params->padding7)); grub_memset (params->padding8, 0, sizeof (params->padding8)); grub_memset (params->padding9, 0, sizeof (params->padding9)); - + #endif /* The other EFI parameters are filled when booting. */ @@ -797,9 +797,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (grub_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; - + linux_mem_size = grub_strtoul (val, &val, 0); - + if (grub_errno) { grub_errno = GRUB_ERR_NONE; @@ -808,7 +808,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), else { int shift = 0; - + switch (grub_tolower (val[0])) { case 'g': @@ -838,7 +838,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, "BOOT_IMAGE="); dest = grub_stpcpy (dest, argv[0]); - + /* Copy kernel parameters. */ for (i = 1; i < argc @@ -861,7 +861,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } fail: - + if (file) grub_file_close (file); @@ -886,13 +886,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_efi_memory_descriptor_t *desc; grub_efi_uintn_t desc_size; struct linux_kernel_header *lh; - + if (argc == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified"); goto fail; } - + if (! loaded) { grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first."); @@ -907,11 +907,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), initrd_pages = (page_align (size) >> 12); lh = (struct linux_kernel_header *) real_mode_mem; - + addr_max = (grub_cpu_to_le32 (lh->initrd_addr_max) << 10); if (linux_mem_size != 0 && linux_mem_size < addr_max) addr_max = linux_mem_size; - + /* Linux 2.3.xx has a bug in the memory range check, so avoid the last page. Linux 2.2.xx has a bug in the memory range check, which is @@ -921,7 +921,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), /* Usually, the compression ratio is about 50%. */ addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) + page_align (size); - + /* Find the highest address to put the initrd. */ mmap_size = find_mmap_size (); if (grub_efi_get_memory_map (&mmap_size, mmap_buf, 0, &desc_size, 0) <= 0) @@ -936,7 +936,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), && desc->num_pages >= initrd_pages) { grub_efi_physical_address_t physical_end; - + physical_end = desc->physical_start + (desc->num_pages << 12); if (physical_end > addr_max) physical_end = addr_max; @@ -958,11 +958,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_error (GRUB_ERR_OUT_OF_MEMORY, "no free pages available"); goto fail; } - + initrd_mem = grub_efi_allocate_pages (addr, initrd_pages); if (! initrd_mem) grub_fatal ("cannot allocate pages"); - + if (grub_file_read (file, initrd_mem, size) != size) { grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); @@ -971,11 +971,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_printf (" [Initrd, addr=0x%x, size=0x%x]\n", (unsigned) addr, (unsigned) size); - + lh->ramdisk_image = addr; lh->ramdisk_size = size; lh->root_dev = 0x0100; /* XXX */ - + fail: if (file) grub_file_close (file); diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 3b1f2f08d..4ef88cb8f 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -285,15 +285,15 @@ find_mmap_size (void) count++; return 0; } - + grub_mmap_iterate (hook); - + mmap_size = count * sizeof (struct grub_e820_mmap); /* Increase the size a bit for safety, because GRUB allocates more on later. */ mmap_size += (1 << 12); - + return page_align (mmap_size); } @@ -317,15 +317,15 @@ allocate_pages (grub_size_t prot_size) grub_dprintf ("linux", "real_size = %x, prot_size = %x, mmap_size = %x\n", (unsigned) real_size, (unsigned) prot_size, (unsigned) mmap_size); - + /* Calculate the number of pages; Combine the real mode code with the memory map buffer for simplicity. */ real_mode_pages = ((real_size + mmap_size) >> 12); prot_mode_pages = (prot_size >> 12); - + /* Initialize the memory pointers with NULL for convenience. */ free_pages (); - + /* FIXME: Should request low memory from the heap when this feature is implemented. */ @@ -451,11 +451,11 @@ grub_linux_boot (void) modevar = grub_env_get ("gfxpayload"); - /* Now all graphical modes are acceptable. + /* Now all graphical modes are acceptable. May change in future if we have modes without framebuffer. */ if (modevar && *modevar != 0) { - tmp = grub_malloc (grub_strlen (modevar) + tmp = grub_malloc (grub_strlen (modevar) + sizeof (DEFAULT_VIDEO_MODE) + 1); if (! tmp) return grub_errno; @@ -485,7 +485,7 @@ grub_linux_boot (void) params->video_width = 80; params->video_height = 25; } - + grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", (unsigned) params->code32_start, (unsigned long) &(idt_desc.limit), @@ -538,18 +538,18 @@ grub_linux_boot (void) #ifdef __x86_64__ - grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), - grub_linux_trampoline_start, + grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), + grub_linux_trampoline_start, grub_linux_trampoline_end - grub_linux_trampoline_start); - - ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem + + ((void (*) (unsigned long, void *)) ((char *) prot_mode_mem + (prot_mode_pages << 12))) (params->code32_start, real_mode_mem); #else /* Hardware interrupts are not safe any longer. */ asm volatile ("cli" : : ); - + /* Load the IDT and the GDT for the bootstrap. */ asm volatile ("lidt %0" : : "m" (idt_desc)); asm volatile ("lgdt %0" : : "m" (gdt_desc)); @@ -562,7 +562,7 @@ grub_linux_boot (void) /* Enter Linux. */ asm volatile ("jmp *%%ecx" : : ); - + #endif /* Never reach here. */ @@ -591,7 +591,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), char *dest; grub_dl_ref (my_mod); - + if (argc == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); @@ -644,17 +644,17 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } setup_sects = lh.setup_sects; - + /* If SETUP_SECTS is not set, set it to the default (4). */ if (! setup_sects) setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; real_size = setup_sects << GRUB_DISK_SECTOR_BITS; prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE; - + if (! allocate_pages (prot_size)) goto fail; - + params = (struct linux_kernel_params *) real_mode_mem; grub_memset (params, 0, GRUB_LINUX_CL_END_OFFSET); grub_memcpy (¶ms->setup_sects, &lh.setup_sects, sizeof (lh) - 0x1F1); @@ -684,7 +684,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), space. */ params->ext_mem = ((32 * 0x100000) >> 10); params->alt_mem = ((32 * 0x100000) >> 10); - + params->video_page = 0; /* ??? */ params->video_mode = 0; params->video_ega_bx = 0; @@ -734,8 +734,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_env_set ("gfxpayload", "text"); grub_printf ("%s is deprecated. " "Use set gfxpayload=text before " - "linux command instead.\n", - argv[i]); + "linux command instead.\n", + argv[i]); break; case 1: @@ -744,8 +744,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_env_set ("gfxpayload", "text"); grub_printf ("%s is deprecated. " "Use set gfxpayload=text before " - "linux command instead.\n", - argv[i]); + "linux command instead.\n", + argv[i]); break; default: /* Ignore invalid values. */ @@ -756,19 +756,19 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_env_set ("gfxpayload", "text"); grub_printf ("%s is deprecated. Mode %d isn't recognized. " "Use set gfxpayload=WIDTHxHEIGHT[xDEPTH] before " - "linux command instead.\n", - argv[i], vid_mode); + "linux command instead.\n", + argv[i], vid_mode); break; } buf = grub_malloc (sizeof ("WWWWxHHHHxDD;WWWWxHHHH")); if (! buf) goto fail; - - linux_mode + + linux_mode = &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START]; - - grub_sprintf (buf, "%ux%ux%u;%ux%u", + + grub_sprintf (buf, "%ux%ux%u;%ux%u", linux_vesafb_res[linux_mode->res_index].width, linux_vesafb_res[linux_mode->res_index].height, linux_mode->depth, @@ -776,8 +776,8 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_vesafb_res[linux_mode->res_index].height); grub_printf ("%s is deprecated. " "Use set gfxpayload=%s before " - "linux command instead.\n", - argv[i], buf); + "linux command instead.\n", + argv[i], buf); err = grub_env_set ("gfxpayload", buf); grub_free (buf); if (err) @@ -789,9 +789,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (grub_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; - + linux_mem_size = grub_strtoul (val, &val, 0); - + if (grub_errno) { grub_errno = GRUB_ERR_NONE; @@ -800,7 +800,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), else { int shift = 0; - + switch (grub_tolower (val[0])) { case 'g': @@ -820,12 +820,12 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_mem_size <<= shift; } } - + /* Specify the boot file. */ dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, "BOOT_IMAGE="); dest = grub_stpcpy (dest, argv[0]); - + /* Copy kernel parameters. */ for (i = 1; i < argc @@ -849,7 +849,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } fail: - + if (file) grub_file_close (file); @@ -871,13 +871,13 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_addr_t addr_min, addr_max; grub_addr_t addr; struct linux_kernel_header *lh; - + if (argc == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified"); goto fail; } - + if (! loaded) { grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first."); @@ -906,10 +906,10 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), } else addr_max = GRUB_LINUX_INITRD_MAX_ADDRESS; - + if (linux_mem_size != 0 && linux_mem_size < addr_max) addr_max = linux_mem_size; - + /* Linux 2.3.xx has a bug in the memory range check, so avoid the last page. Linux 2.2.xx has a bug in the memory range check, which is @@ -919,7 +919,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), /* Usually, the compression ratio is about 50%. */ addr_min = (grub_addr_t) prot_mode_mem + ((prot_mode_pages * 3) << 12) + page_align (size); - + if (addr_max > grub_os_area_addr + grub_os_area_size) addr_max = grub_os_area_addr + grub_os_area_size; @@ -931,9 +931,9 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_error (GRUB_ERR_OUT_OF_RANGE, "The initrd is too big"); goto fail; } - + initrd_mem = (void *) addr; - + if (grub_file_read (file, initrd_mem, size) != size) { grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); @@ -942,11 +942,11 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_printf (" [Initrd, addr=0x%x, size=0x%x]\n", (unsigned) addr, (unsigned) size); - + lh->ramdisk_image = addr; lh->ramdisk_size = size; lh->root_dev = 0x0100; /* XXX */ - + fail: if (file) grub_file_close (file); diff --git a/loader/i386/linux_trampoline.S b/loader/i386/linux_trampoline.S index e2cd6ec27..4acea7b11 100644 --- a/loader/i386/linux_trampoline.S +++ b/loader/i386/linux_trampoline.S @@ -17,7 +17,7 @@ */ #include - + .p2align 4 /* force 16-byte alignment */ VARIABLE(grub_linux_trampoline_start) @@ -26,23 +26,23 @@ VARIABLE(grub_linux_trampoline_start) contains real memory start. */ mov %rsi, %rbx - + call base -base: +base: pop %rsi -#ifdef APPLE_CC +#ifdef APPLE_CC lea (cont1 - base) (%esi, 1), %rax mov %eax, (jump_vector - base) (%esi, 1) lea (gdt - base) (%esi, 1), %rax mov %rax, (gdtaddr - base) (%esi, 1) - + /* Switch to compatibility mode. */ lidt (idtdesc - base) (%esi, 1) lgdt (gdtdesc - base) (%esi, 1) - + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ ljmp *(jump_vector - base) (%esi, 1) #else @@ -51,22 +51,22 @@ base: lea (gdt - base) (%rsi, 1), %rax mov %rax, (gdtaddr - base) (%rsi, 1) - + /* Switch to compatibility mode. */ lidt (idtdesc - base) (%rsi, 1) lgdt (gdtdesc - base) (%rsi, 1) - + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ ljmp *(jump_vector - base) (%rsi, 1) #endif - + cont1: .code32 /* Update other registers. */ mov $0x18, %eax - mov %eax, %ds + mov %eax, %ds mov %eax, %es mov %eax, %fs mov %eax, %gs @@ -89,41 +89,41 @@ cont1: mov %eax, %cr4 jmp cont2 -cont2: +cont2: .code32 - + mov %ebx, %esi jmp *%edi /* GDT. */ .p2align 4 -gdt: +gdt: /* NULL. */ .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - + /* Reserved. */ .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - + /* Code segment. */ .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00 - + /* Data segment. */ .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00 -gdtdesc: +gdtdesc: .word 31 -gdtaddr: +gdtaddr: .quad gdt -idtdesc: +idtdesc: .word 0 -idtaddr: +idtaddr: .quad 0 .p2align 4 jump_vector: /* Jump location. Is filled by the code */ .long 0 - .long 0x10 + .long 0x10 VARIABLE(grub_linux_trampoline_end) diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index a59085c54..cc45a4e97 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -76,7 +76,7 @@ grub_multiboot_unload (void) grub_free ((void *) mbi->cmdline); grub_free (mbi); } - + mbi = 0; grub_dl_unref (my_mod); @@ -98,9 +98,9 @@ grub_get_multiboot_mmap_len (void) count++; return 0; } - + grub_mmap_iterate (hook); - + return count * sizeof (struct grub_multiboot_mmap_entry); } @@ -297,11 +297,11 @@ grub_multiboot (int argc, char *argv[]) grub_file_read (file, (void *) grub_multiboot_payload_orig, load_size); if (grub_errno) goto fail; - + if (header->bss_end_addr) grub_memset ((void *) (grub_multiboot_payload_orig + load_size), 0, header->bss_end_addr - header->load_addr - load_size); - + grub_multiboot_payload_entry_offset = header->entry_addr - header->load_addr; } @@ -315,7 +315,7 @@ grub_multiboot (int argc, char *argv[]) mbi_dest = mbi_addr (grub_multiboot_payload_dest); grub_memset (mbi, 0, sizeof (struct grub_multiboot_info)); mbi->mmap_length = mmap_length; - + grub_fill_multiboot_mmap (mmap_addr (grub_multiboot_payload_orig)); /* FIXME: grub_uint32_t will break for addresses above 4 GiB, but is mandated @@ -334,7 +334,7 @@ grub_multiboot (int argc, char *argv[]) &grub_multiboot_backward_relocator, RELOCATOR_SIZEOF(backward)); entry = (grub_addr_t) grub_multiboot_payload_orig + grub_multiboot_payload_size; } - + grub_dprintf ("multiboot_loader", "dest=%p, size=0x%x, entry_offset=0x%x\n", (void *) grub_multiboot_payload_dest, grub_multiboot_payload_size, @@ -360,8 +360,8 @@ grub_multiboot (int argc, char *argv[]) mbi->flags |= MULTIBOOT_INFO_CMDLINE; mbi->cmdline = (grub_uint32_t) cmdline_addr (grub_multiboot_payload_dest); - - + + grub_strcpy (boot_loader_name_addr (grub_multiboot_payload_orig), PACKAGE_STRING); mbi->flags |= MULTIBOOT_INFO_BOOT_LOADER_NAME; mbi->boot_loader_name = (grub_uint32_t) boot_loader_name_addr (grub_multiboot_payload_dest); diff --git a/loader/i386/multiboot_elfxx.c b/loader/i386/multiboot_elfxx.c index ce9e4fe11..77c47118c 100644 --- a/loader/i386/multiboot_elfxx.c +++ b/loader/i386/multiboot_elfxx.c @@ -63,10 +63,10 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) || ehdr->e_ident[EI_DATA] != ELFDATA2LSB || ehdr->e_machine != E_MACHINE) return grub_error(GRUB_ERR_UNKNOWN_OS, "no valid ELF header found"); - + if (ehdr->e_type != ET_EXEC && ehdr->e_type != ET_DYN) return grub_error (GRUB_ERR_UNKNOWN_OS, "invalid ELF file type"); - + /* FIXME: Should we support program headers at strange locations? */ if (ehdr->e_phoff + ehdr->e_phnum * ehdr->e_phentsize > MULTIBOOT_SEARCH) return grub_error (GRUB_ERR_BAD_OS, "program header at a too high offset"); @@ -84,7 +84,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) if (phdr(i)->p_type == PT_LOAD && phdr(i)->p_filesz != 0) { /* Beware that segment 0 isn't necessarily loadable */ - if (lowest_segment == -1 + if (lowest_segment == -1 || phdr(i)->p_paddr < phdr(lowest_segment)->p_paddr) lowest_segment = i; if (highest_segment == -1 @@ -132,7 +132,7 @@ CONCAT(grub_multiboot_load_elf, XX) (grub_file_t file, void *buffer) } for (i = 0; i < ehdr->e_phnum; i++) - if (phdr(i)->p_vaddr <= ehdr->e_entry + if (phdr(i)->p_vaddr <= ehdr->e_entry && phdr(i)->p_vaddr + phdr(i)->p_memsz > ehdr->e_entry) { grub_multiboot_payload_entry_offset = (ehdr->e_entry - phdr(i)->p_vaddr) diff --git a/loader/i386/multiboot_helper.S b/loader/i386/multiboot_helper.S index c496ba054..d7539f193 100644 --- a/loader/i386/multiboot_helper.S +++ b/loader/i386/multiboot_helper.S @@ -19,7 +19,7 @@ #include #include #include - + .p2align 2 /* force 4-byte alignment */ /* @@ -91,7 +91,7 @@ FUNCTION(grub_multiboot_real_boot) /* Move the magic value into eax. */ movl $MULTIBOOT_MAGIC2, %eax - + /* Jump to the relocator. */ popl %ebp jmp *%ebp diff --git a/loader/i386/pc/chainloader.c b/loader/i386/pc/chainloader.c index 304886b09..1b96ca8aa 100644 --- a/loader/i386/pc/chainloader.c +++ b/loader/i386/pc/chainloader.c @@ -62,7 +62,7 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) void *part_addr = 0; grub_dl_ref (my_mod); - + file = grub_file_open (filename); if (! file) goto fail; @@ -93,11 +93,11 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) if (dev) { grub_disk_t disk = dev->disk; - + if (disk) { grub_partition_t p = disk->partition; - + /* In i386-pc, the id is equal to the BIOS drive number. */ drive = (int) disk->id; @@ -112,21 +112,21 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) grub_device_close (dev); } - + /* Ignore errors. Perhaps it's not fatal. */ grub_errno = GRUB_ERR_NONE; boot_drive = drive; boot_part_addr = part_addr; - + grub_loader_set (grub_chainloader_boot, grub_chainloader_unload, 1); return; - + fail: if (file) grub_file_close (file); - + grub_dl_unref (my_mod); } @@ -142,7 +142,7 @@ grub_cmd_chainloader (grub_command_t cmd __attribute__ ((unused)), argc--; argv++; } - + if (argc == 0) return grub_error (GRUB_ERR_BAD_ARGUMENT, "no file specified"); else diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index 34a4ebcfa..148cb7777 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -60,7 +60,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), char *dest; grub_dl_ref (my_mod); - + if (argc == 0) { grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); @@ -100,27 +100,27 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), grub_linux_is_bzimage = 0; setup_sects = lh.setup_sects; linux_mem_size = 0; - + if (lh.header == grub_cpu_to_le32 (GRUB_LINUX_MAGIC_SIGNATURE) && grub_le_to_cpu16 (lh.version) >= 0x0200) { grub_linux_is_bzimage = (lh.loadflags & GRUB_LINUX_FLAG_BIG_KERNEL); lh.type_of_loader = GRUB_LINUX_BOOT_LOADER_TYPE; - + /* Put the real mode part at as a high location as possible. */ - grub_linux_real_addr + grub_linux_real_addr = (char *) UINT_TO_PTR (grub_mmap_get_lower () - GRUB_LINUX_SETUP_MOVE_SIZE); /* But it must not exceed the traditional area. */ if (grub_linux_real_addr > (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR) grub_linux_real_addr = (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR; - + if (grub_le_to_cpu16 (lh.version) >= 0x0201) { lh.heap_end_ptr = grub_cpu_to_le16 (GRUB_LINUX_HEAP_END_OFFSET); lh.loadflags |= GRUB_LINUX_FLAG_CAN_USE_HEAP; } - + if (grub_le_to_cpu16 (lh.version) >= 0x0202) lh.cmd_line_ptr = grub_linux_real_addr + GRUB_LINUX_CL_OFFSET; else @@ -135,19 +135,19 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), /* Your kernel is quite old... */ lh.cl_magic = grub_cpu_to_le16 (GRUB_LINUX_CL_MAGIC); lh.cl_offset = grub_cpu_to_le16 (GRUB_LINUX_CL_OFFSET); - + setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; - + grub_linux_real_addr = (char *) GRUB_LINUX_OLD_REAL_MODE_ADDR; } - + /* If SETUP_SECTS is not set, set it to the default (4). */ if (! setup_sects) setup_sects = GRUB_LINUX_DEFAULT_SETUP_SECTS; - + real_size = setup_sects << GRUB_DISK_SECTOR_BITS; prot_size = grub_file_size (file) - real_size - GRUB_DISK_SECTOR_SIZE; - + grub_linux_tmp_addr = (char *) GRUB_LINUX_BZIMAGE_ADDR + prot_size; if (! grub_linux_is_bzimage @@ -158,7 +158,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), (grub_size_t) grub_linux_real_addr); goto fail; } - + if (grub_linux_real_addr + GRUB_LINUX_SETUP_MOVE_SIZE > (char *) UINT_TO_PTR (grub_mmap_get_lower ())) { @@ -196,9 +196,9 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), else if (grub_memcmp (argv[i], "mem=", 4) == 0) { char *val = argv[i] + 4; - + linux_mem_size = grub_strtoul (val, &val, 0); - + if (grub_errno) { grub_errno = GRUB_ERR_NONE; @@ -207,7 +207,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), else { int shift = 0; - + switch (grub_tolower (val[0])) { case 'g': @@ -251,7 +251,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), dest = grub_stpcpy (grub_linux_tmp_addr + GRUB_LINUX_CL_OFFSET, "BOOT_IMAGE="); dest = grub_stpcpy (dest, argv[0]); - + /* Copy kernel parameters. */ for (i = 1; i < argc @@ -266,7 +266,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), len = prot_size; if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); - + if (grub_errno == GRUB_ERR_NONE) { grub_linux_prot_size = prot_size; @@ -275,7 +275,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } fail: - + if (file) grub_file_close (file); @@ -302,7 +302,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), grub_error (GRUB_ERR_BAD_ARGUMENT, "No module specified"); goto fail; } - + if (!loaded) { grub_error (GRUB_ERR_BAD_ARGUMENT, "You need to load the kernel first."); @@ -369,7 +369,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), lh->ramdisk_image = addr; lh->ramdisk_size = size; - + fail: if (file) grub_file_close (file); diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c index 7d7c685ee..dadbccd35 100644 --- a/loader/i386/pc/multiboot2.c +++ b/loader/i386/pc/multiboot2.c @@ -33,7 +33,7 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr) if ((paddr < grub_os_area_addr) || (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size)) - return grub_error(GRUB_ERR_OUT_OF_RANGE,"Address 0x%x is out of range", + return grub_error(GRUB_ERR_OUT_OF_RANGE,"Address 0x%x is out of range", paddr); return GRUB_ERR_NONE; @@ -82,7 +82,7 @@ void grub_mb2_arch_unload (struct multiboot_tag_header *tags) { struct multiboot_tag_header *tag; - + /* Free all module memory in the tag list. */ for_each_tag (tag, tags) { diff --git a/loader/i386/pc/xnu.c b/loader/i386/pc/xnu.c index d32f6793b..037a7134f 100644 --- a/loader/i386/pc/xnu.c +++ b/loader/i386/pc/xnu.c @@ -54,10 +54,10 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook); else { - tmp = grub_malloc (grub_strlen (modevar) + tmp = grub_malloc (grub_strlen (modevar) + sizeof (DEFAULT_VIDEO_MODE) + 1); if (! tmp) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate temporary storag"); grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); err = grub_video_set_mode (tmp, video_hook); @@ -86,9 +86,9 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) y > 0 ? y : 0, x < 0 ? -x : 0, y < 0 ? -y : 0, - min (grub_xnu_bitmap->mode_info.width, - mode_info.width), - min (grub_xnu_bitmap->mode_info.height, + min (grub_xnu_bitmap->mode_info.width, + mode_info.width), + min (grub_xnu_bitmap->mode_info.height, mode_info.height)); if (err) { @@ -103,8 +103,8 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) params->lfb_line_len = mode_info.pitch; params->lfb_base = PTR_TO_UINT32 (render_target->data); - params->lfb_mode = grub_xnu_bitmap - ? GRUB_XNU_VIDEO_SPLASH : GRUB_XNU_VIDEO_TEXT_IN_VIDEO; + params->lfb_mode = grub_xnu_bitmap + ? GRUB_XNU_VIDEO_SPLASH : GRUB_XNU_VIDEO_TEXT_IN_VIDEO; return GRUB_ERR_NONE; } diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index c0e731c09..06e375c69 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -44,10 +44,10 @@ struct tbl_alias table_aliases[] = {GRUB_EFI_ACPI_TABLE_GUID, "ACPI"}, }; -/* The following function is used to be able to debug xnu loader +/* The following function is used to be able to debug xnu loader with grub-emu. */ #ifdef GRUB_UTIL -static grub_err_t +static grub_err_t grub_xnu_launch (void) { grub_printf ("Fake launch %x:%p:%p", grub_xnu_entry_point, grub_xnu_arg1, @@ -78,7 +78,7 @@ readfrequency (const char *str) while (*str) { unsigned long digit; - + digit = grub_tolower (*str) - '0'; if (digit > 9) break; @@ -95,7 +95,7 @@ readfrequency (const char *str) while (*str) { unsigned long digit; - + digit = grub_tolower (*str) - '0'; if (digit > 9) break; @@ -125,7 +125,7 @@ guessfsb (void) if (! grub_cpu_is_cpuid_supported ()) return sane_value; - + #ifdef APPLE_CC asm volatile ("movl $0, %%eax\n" #ifdef __x86_64__ @@ -138,18 +138,18 @@ guessfsb (void) "pop %%rbx\n" #else "pop %%ebx\n" -#endif - : "=a" (max_cpuid), +#endif + : "=a" (max_cpuid), "=d" (manufacturer[1]), "=c" (manufacturer[2])); - + /* Only Intel for now is done. */ if (grub_memcmp (manufacturer + 1, "ineIntel", 12) != 0) return sane_value; - + #else asm volatile ("movl $0, %%eax\n" "cpuid" - : "=a" (max_cpuid), "=b" (manufacturer[0]), + : "=a" (max_cpuid), "=b" (manufacturer[0]), "=d" (manufacturer[1]), "=c" (manufacturer[2])); /* Only Intel for now is done. */ @@ -167,7 +167,7 @@ guessfsb (void) "push %%rbx\n" #else "push %%ebx\n" -#endif +#endif "cpuid\n" #ifdef __x86_64__ "pop %%rbx\n" @@ -175,7 +175,7 @@ guessfsb (void) "pop %%ebx\n" #endif : "=c" (capabilities): - : "%rax", "%rdx"); + : "%rax", "%rdx"); #else asm volatile ("movl $1, %%eax\n" "cpuid" @@ -201,7 +201,7 @@ guessfsb (void) : : "%ecx", "%eax"); - return grub_divmod64 (2000 * tsc_ticks_per_ms, + return grub_divmod64 (2000 * tsc_ticks_per_ms, ((msrlow >> 7) & 0x3e) + ((msrlow >> 14) & 1), 0); } @@ -254,7 +254,7 @@ grub_cpu_xnu_fill_devicetree (void) curval = grub_xnu_create_value (&(efikey->first_child), "firmware-vendor"); if (! curval) return grub_errno; - curval->datasize = + curval->datasize = 2 * (utf16_strlen (SYSTEM_TABLE_PTR (firmware_vendor)) + 1); curval->data = grub_malloc (curval->datasize); if (! curval->data) @@ -275,7 +275,7 @@ grub_cpu_xnu_fill_devicetree (void) grub_memcpy (curval->data, "EFI64", curval->datasize); /* The key "platform". */ - platformkey = grub_xnu_create_key (&(efikey->first_child), + platformkey = grub_xnu_create_key (&(efikey->first_child), "platform"); if (! platformkey) return grub_errno; @@ -292,16 +292,16 @@ grub_cpu_xnu_fill_devicetree (void) /* First see if user supplies the value. */ char *fsbvar = grub_env_get ("fsb"); if (! fsbvar) - *((grub_uint64_t *) curval->data) = 0; + *((grub_uint64_t *) curval->data) = 0; else *((grub_uint64_t *) curval->data) = readfrequency (fsbvar); /* Try autodetect. */ if (! *((grub_uint64_t *) curval->data)) - *((grub_uint64_t *) curval->data) = guessfsb (); - grub_dprintf ("xnu", "fsb autodetected as %llu\n", + *((grub_uint64_t *) curval->data) = guessfsb (); + grub_dprintf ("xnu", "fsb autodetected as %llu\n", (unsigned long long) *((grub_uint64_t *) curval->data)); - cfgtablekey = grub_xnu_create_key (&(efikey->first_child), + cfgtablekey = grub_xnu_create_key (&(efikey->first_child), "configuration-table"); if (!cfgtablekey) return grub_errno; @@ -317,11 +317,11 @@ grub_cpu_xnu_fill_devicetree (void) /* Retrieve current key. */ #ifdef GRUB_MACHINE_EFI { - ptr = (void *) + ptr = (void *) grub_efi_system_table->configuration_table[i].vendor_table; guid = grub_efi_system_table->configuration_table[i].vendor_guid; } -#else +#else if (SIZEOF_OF_UINTN == 4) { ptr = UINT_TO_PTR (((grub_efiemu_configuration_table32_t *) @@ -336,7 +336,7 @@ grub_cpu_xnu_fill_devicetree (void) ptr = UINT_TO_PTR (((grub_efiemu_configuration_table64_t *) SYSTEM_TABLE_PTR (configuration_table))[i] .vendor_table); - guid = + guid = ((grub_efiemu_configuration_table64_t *) SYSTEM_TABLE_PTR (configuration_table))[i].vendor_guid; } @@ -362,7 +362,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = sizeof (guid); curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); grub_memcpy (curval->data, &guid, curval->datasize); @@ -373,7 +373,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = SIZEOF_OF_UINTN; curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); if (SIZEOF_OF_UINTN == 4) *((grub_uint32_t *)curval->data) = PTR_TO_UINT32 (ptr); @@ -392,14 +392,14 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = grub_strlen (table_aliases[j].name) + 1; curval->data = grub_malloc (curval->datasize); if (!curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); grub_memcpy (curval->data, table_aliases[j].name, curval->datasize); } } - + /* Create and fill "runtime-services" key. */ - runtimesrvkey = grub_xnu_create_key (&(efikey->first_child), + runtimesrvkey = grub_xnu_create_key (&(efikey->first_child), "runtime-services"); if (! runtimesrvkey) return grub_errno; @@ -409,20 +409,20 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = SIZEOF_OF_UINTN; curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); if (SIZEOF_OF_UINTN == 4) - *((grub_uint32_t *) curval->data) + *((grub_uint32_t *) curval->data) = PTR_TO_UINT32 (SYSTEM_TABLE_PTR (runtime_services)); else - *((grub_uint64_t *) curval->data) + *((grub_uint64_t *) curval->data) = PTR_TO_UINT64 (SYSTEM_TABLE_PTR (runtime_services)); - + return GRUB_ERR_NONE; } /* Boot xnu. */ -grub_err_t +grub_err_t grub_xnu_boot (void) { struct grub_xnu_boot_params *bootparams_relloc; @@ -464,17 +464,17 @@ grub_xnu_boot (void) &map_key, &descriptor_size, &descriptor_version) <= 0) return grub_errno; - mmap_relloc_off = (grub_uint8_t *) memory_map + mmap_relloc_off = (grub_uint8_t *) memory_map - (grub_uint8_t *) grub_xnu_heap_start; - firstruntimeaddr = (grub_uint64_t) (-1); + firstruntimeaddr = (grub_uint64_t) (-1); lastruntimeaddr = 0; for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++) { - grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) + grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) ((char *) memory_map + descriptor_size * i); - /* Some EFI implementations set physical_start to 0 which + /* Some EFI implementations set physical_start to 0 which causes XNU crash. */ curdesc->virtual_start = curdesc->physical_start; @@ -494,7 +494,7 @@ grub_xnu_boot (void) bootparams_relloc = grub_xnu_heap_malloc (sizeof (*bootparams_relloc)); if (! bootparams_relloc) return grub_errno; - bootparams_relloc_off = (grub_uint8_t *) bootparams_relloc + bootparams_relloc_off = (grub_uint8_t *) bootparams_relloc - (grub_uint8_t *) grub_xnu_heap_start; err = grub_xnu_writetree_toheap (&devtree, &devtreelen); if (err) @@ -502,10 +502,10 @@ grub_xnu_boot (void) bootparams_relloc = (struct grub_xnu_boot_params *) (bootparams_relloc_off + (grub_uint8_t *) grub_xnu_heap_start); - grub_memcpy (bootparams_relloc->cmdline, grub_xnu_cmdline, + grub_memcpy (bootparams_relloc->cmdline, grub_xnu_cmdline, sizeof (bootparams_relloc->cmdline)); - bootparams_relloc->devtree = ((char *) devtree - grub_xnu_heap_start) + bootparams_relloc->devtree = ((char *) devtree - grub_xnu_heap_start) + grub_xnu_heap_will_be_at; bootparams_relloc->devtreelen = devtreelen; @@ -513,41 +513,41 @@ grub_xnu_boot (void) bootparams_relloc->heap_size = grub_xnu_heap_size; bootparams_relloc->efi_mmap = grub_xnu_heap_will_be_at + mmap_relloc_off; - bootparams_relloc->efi_mmap_size = memory_map_size; - bootparams_relloc->efi_mem_desc_size = descriptor_size; - bootparams_relloc->efi_mem_desc_version = descriptor_version; + bootparams_relloc->efi_mmap_size = memory_map_size; + bootparams_relloc->efi_mem_desc_size = descriptor_size; + bootparams_relloc->efi_mem_desc_version = descriptor_version; - bootparams_relloc->efi_runtime_first_page = firstruntimeaddr + bootparams_relloc->efi_runtime_first_page = firstruntimeaddr / GRUB_XNU_PAGESIZE; - bootparams_relloc->efi_runtime_npages - = ((lastruntimeaddr + GRUB_XNU_PAGESIZE - 1) / GRUB_XNU_PAGESIZE) + bootparams_relloc->efi_runtime_npages + = ((lastruntimeaddr + GRUB_XNU_PAGESIZE - 1) / GRUB_XNU_PAGESIZE) - (firstruntimeaddr / GRUB_XNU_PAGESIZE); bootparams_relloc->efi_uintnbits = SIZEOF_OF_UINTN * 8; - bootparams_relloc->efi_system_table + bootparams_relloc->efi_system_table = PTR_TO_UINT32 (grub_autoefi_system_table); - bootparams_relloc->verminor = GRUB_XNU_BOOTARGS_VERMINOR; + bootparams_relloc->verminor = GRUB_XNU_BOOTARGS_VERMINOR; bootparams_relloc->vermajor = GRUB_XNU_BOOTARGS_VERMAJOR; /* Parameters for asm helper. */ - grub_xnu_stack = bootparams_relloc->heap_start + grub_xnu_stack = bootparams_relloc->heap_start + bootparams_relloc->heap_size + GRUB_XNU_PAGESIZE; grub_xnu_arg1 = bootparams_relloc_off + grub_xnu_heap_will_be_at; #ifndef GRUB_UTIL - grub_xnu_launch = (void (*) (void)) + grub_xnu_launch = (void (*) (void)) (grub_xnu_heap_start + grub_xnu_heap_size); #endif grub_dprintf ("xnu", "eip=%x\n", grub_xnu_entry_point); grub_dprintf ("xnu", "launch=%p\n", grub_xnu_launch); const char *debug = grub_env_get ("debug"); - + if (debug && (grub_strword (debug, "all") || grub_strword (debug, "xnu"))) { grub_printf ("Press any key to launch xnu\n"); grub_getkey (); } - + /* Set video. */ err = grub_xnu_set_video (bootparams_relloc); if (err != GRUB_ERR_NONE) @@ -564,8 +564,8 @@ grub_xnu_boot (void) bootparams_relloc->lfb_base = 0; } - grub_memcpy (grub_xnu_heap_start + grub_xnu_heap_size, - grub_xnu_launcher_start, + grub_memcpy (grub_xnu_heap_start + grub_xnu_heap_size, + grub_xnu_launcher_start, grub_xnu_launcher_end - grub_xnu_launcher_start); diff --git a/loader/i386/xnu_helper.S b/loader/i386/xnu_helper.S index 229c8fe43..4250c58ad 100644 --- a/loader/i386/xnu_helper.S +++ b/loader/i386/xnu_helper.S @@ -17,27 +17,27 @@ */ #include - + .p2align 4 /* force 16-byte alignment */ VARIABLE(grub_xnu_launcher_start) -base: +base: cli - + #ifndef __x86_64__ /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_xnu_heap_will_be_at) .long 0 mov %eax, %edi - + /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_xnu_heap_start) .long 0 mov %eax, %esi - + /* mov imm32, %ecx */ .byte 0xb9 VARIABLE(grub_xnu_heap_size) @@ -57,16 +57,16 @@ VARIABLE(grub_xnu_heap_size) mov %eax, %esi add $(cont0-base), %eax jmp *%eax -cont0: +cont0: #else xorq %rax, %rax - + /* mov imm32, %eax */ .byte 0xb8 VARIABLE(grub_xnu_heap_will_be_at) .long 0 mov %rax, %rdi - + /* mov imm32, %rax */ .byte 0x48 .byte 0xb8 @@ -74,7 +74,7 @@ VARIABLE(grub_xnu_heap_start) .long 0 .long 0 mov %rax, %rsi - + /* mov imm32, %rcx */ .byte 0x48 .byte 0xb9 @@ -101,18 +101,18 @@ VARIABLE(grub_xnu_heap_size) #endif jmp *%rax -cont0: +cont0: #ifdef APPLE_CC lea (cont1 - base) (%esi, 1), %eax mov %eax, (jump_vector - base) (%esi, 1) lea (gdt - base) (%esi, 1), %eax mov %eax, (gdt_addr - base) (%esi, 1) - + /* Switch to compatibility mode. */ lgdt (gdtdesc - base) (%esi, 1) - + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ ljmp *(jump_vector - base) (%esi,1) #else @@ -121,21 +121,21 @@ cont0: lea (gdt - base) (%rsi, 1), %rax mov %rax, (gdt_addr - base) (%rsi, 1) - + /* Switch to compatibility mode. */ lgdt (gdtdesc - base) (%rsi, 1) - + /* Update %cs. Thanks to David Miller for pointing this mistake out. */ ljmp *(jump_vector - base) (%rsi, 1) #endif - + cont1: .code32 /* Update other registers. */ mov $0x18, %eax - mov %eax, %ds + mov %eax, %ds mov %eax, %es mov %eax, %fs mov %eax, %gs @@ -158,10 +158,10 @@ cont1: mov %eax, %cr4 jmp cont2 -cont2: +cont2: #endif .code32 - + /* Registers on XNU boot: eip, esp and eax. */ /* mov imm32, %ecx */ .byte 0xb9 @@ -183,29 +183,29 @@ VARIABLE (grub_xnu_stack) #ifdef __x86_64__ /* GDT. Copied from loader/i386/linux.c. */ .p2align 4 -gdt: +gdt: /* NULL. */ .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - + /* Reserved. */ .byte 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 - + /* Code segment. */ .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x9A, 0xCF, 0x00 - + /* Data segment. */ .byte 0xFF, 0xFF, 0x00, 0x00, 0x00, 0x92, 0xCF, 0x00 -gdtdesc: +gdtdesc: .word 31 -gdt_addr: +gdt_addr: /* Filled by the code. */ .quad 0 - + .p2align 4 jump_vector: /* Jump location. Is filled by the code */ .long 0 - .long 0x10 + .long 0x10 #endif VARIABLE(grub_xnu_launcher_end) diff --git a/loader/macho.c b/loader/macho.c index ed70caa33..3a5144e7c 100644 --- a/loader/macho.c +++ b/loader/macho.c @@ -51,16 +51,16 @@ grub_macho_parse32 (grub_macho_t macho) /* Read header and check magic*/ if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1 - || grub_file_read (macho->file, (char *) &head, sizeof (head)) + || grub_file_read (macho->file, (char *) &head, sizeof (head)) != sizeof(head)) { - grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); macho->offset32 = -1; return; } if (head.magic != GRUB_MACHO_MAGIC32) { - grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header."); + grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header."); macho->offset32 = -1; return; } @@ -74,17 +74,17 @@ grub_macho_parse32 (grub_macho_t macho) grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to read commands"); return; } - if (grub_file_read (macho->file, (char *) macho->cmds32, - (grub_size_t) macho->cmdsize32) + if (grub_file_read (macho->file, (char *) macho->cmds32, + (grub_size_t) macho->cmdsize32) != (grub_ssize_t) macho->cmdsize32) { - grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); macho->offset32 = -1; } } typedef int NESTED_FUNC_ATTR (*grub_macho_iter_hook_t) -(grub_macho_t , struct grub_macho_cmd *, +(grub_macho_t , struct grub_macho_cmd *, void *); static grub_err_t @@ -120,7 +120,7 @@ grub_macho32_readfile (grub_macho_t macho, void *dest) { grub_ssize_t read; if (! grub_macho_contains_macho32 (macho)) - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "Couldn't read architecture-specific part"); if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1) @@ -130,12 +130,12 @@ grub_macho32_readfile (grub_macho_t macho, void *dest) "Invalid offset in program header."); } - read = grub_file_read (macho->file, dest, + read = grub_file_read (macho->file, dest, macho->end32 - macho->offset32); if (read != (grub_ssize_t) (macho->end32 - macho->offset32)) { grub_error_push (); - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "Couldn't read architecture-specific part"); } return GRUB_ERR_NONE; @@ -150,9 +150,9 @@ grub_macho32_size (grub_macho_t macho, grub_addr_t *segments_start, /* Run through the program headers to calculate the total memory size we should claim. */ - auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho, + auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho, struct grub_macho_cmd *phdr, void *_arg); - int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho, + int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho, struct grub_macho_cmd *hdr0, void UNUSED *_arg) { struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0; @@ -189,24 +189,24 @@ grub_err_t grub_macho32_load (grub_macho_t macho, char *offset, int flags) { grub_err_t err = 0; - auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, - struct grub_macho_cmd *hdr0, + auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, + struct grub_macho_cmd *hdr0, void UNUSED *_arg); - int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, - struct grub_macho_cmd *hdr0, + int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, + struct grub_macho_cmd *hdr0, void UNUSED *_arg) { struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0; if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT32) return 0; - + if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) return 0; if (! hdr->vmsize) return 0; - - if (grub_file_seek (_macho->file, hdr->fileoff + + if (grub_file_seek (_macho->file, hdr->fileoff + _macho->offset32) == (grub_off_t) -1) { grub_error_push (); @@ -214,11 +214,11 @@ grub_macho32_load (grub_macho_t macho, char *offset, int flags) "Invalid offset in program header."); return 1; } - + if (hdr->filesize) { grub_ssize_t read; - read = grub_file_read (_macho->file, offset + hdr->vmaddr, + read = grub_file_read (_macho->file, offset + hdr->vmaddr, min (hdr->filesize, hdr->vmsize)); if (read != (grub_ssize_t) min (hdr->filesize, hdr->vmsize)) { @@ -231,7 +231,7 @@ grub_macho32_load (grub_macho_t macho, char *offset, int flags) return 1; } } - + if (hdr->filesize < hdr->vmsize) grub_memset (offset + hdr->vmaddr + hdr->filesize, 0, hdr->vmsize - hdr->filesize); @@ -247,11 +247,11 @@ grub_uint32_t grub_macho32_get_entry_point (grub_macho_t macho) { grub_uint32_t entry_point = 0; - auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho, - struct grub_macho_cmd *hdr, + auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho, + struct grub_macho_cmd *hdr, void UNUSED *_arg); - int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho, - struct grub_macho_cmd *hdr, + int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho, + struct grub_macho_cmd *hdr, void UNUSED *_arg) { if (hdr->cmd == GRUB_MACHO_CMD_THREAD) @@ -316,13 +316,13 @@ grub_macho_file (grub_file_t file) /* Load architecture description. */ narchs = grub_be_to_cpu32 (filestart.fat.nfat_arch); - if (grub_file_seek (macho->file, sizeof (struct grub_macho_fat_header)) + if (grub_file_seek (macho->file, sizeof (struct grub_macho_fat_header)) == (grub_off_t) -1) goto fail; archs = grub_malloc (sizeof (struct grub_macho_fat_arch) * narchs); if (!archs) goto fail; - if (grub_file_read (macho->file, (char *) archs, + if (grub_file_read (macho->file, (char *) archs, sizeof (struct grub_macho_fat_arch) * narchs) != (grub_ssize_t)sizeof(struct grub_macho_fat_arch) * narchs) { @@ -334,18 +334,18 @@ grub_macho_file (grub_file_t file) for (i = 0; i < narchs; i++) { - if (GRUB_MACHO_CPUTYPE_IS_HOST32 + if (GRUB_MACHO_CPUTYPE_IS_HOST32 (grub_be_to_cpu32 (archs[i].cputype))) { macho->offset32 = grub_be_to_cpu32 (archs[i].offset); - macho->end32 = grub_be_to_cpu32 (archs[i].offset) + macho->end32 = grub_be_to_cpu32 (archs[i].offset) + grub_be_to_cpu32 (archs[i].size); } if (GRUB_MACHO_CPUTYPE_IS_HOST64 (grub_be_to_cpu32 (archs[i].cputype))) { macho->offset64 = grub_be_to_cpu32 (archs[i].offset); - macho->end64 = grub_be_to_cpu32 (archs[i].offset) + macho->end64 = grub_be_to_cpu32 (archs[i].offset) + grub_be_to_cpu32 (archs[i].size); } } @@ -369,7 +369,7 @@ grub_macho_file (grub_file_t file) grub_macho_parse32 (macho); /* FIXME: implement 64-bit.*/ /* grub_macho_parse64 (macho); */ - + return macho; fail: diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index 707f55e34..29c34d9f8 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -35,11 +35,11 @@ grub_dl_t my_mod; /* This tracks which version of multiboot to use when using * the module command. By default use multiboot version 1. * values: - * 1 - Multiboot version 1 + * 1 - Multiboot version 1 * 2 - Multiboot version 2 */ -static unsigned int module_version_status = 1; +static unsigned int module_version_status = 1; static int find_multi_boot1_header (grub_file_t file) @@ -48,7 +48,7 @@ find_multi_boot1_header (grub_file_t file) char buffer[MULTIBOOT_SEARCH]; int found_status = 0; grub_ssize_t len; - + len = grub_file_read (file, buffer, MULTIBOOT_SEARCH); if (len < 32) return found_status; @@ -77,7 +77,7 @@ find_multi_boot2_header (grub_file_t file) char buffer[MULTIBOOT_SEARCH]; int found_status = 0; grub_ssize_t len; - + len = grub_file_read (file, buffer, MULTIBOOT_SEARCH); if (len < 32) return found_status; @@ -137,7 +137,7 @@ grub_cmd_multiboot_loader (grub_command_t cmd __attribute__ ((unused)), /* Launch multi boot with header */ - /* XXX Find a better way to identify this. + /* XXX Find a better way to identify this. This is for i386-pc */ #if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS) if (header_multi_ver_found == 1) diff --git a/loader/powerpc/ieee1275/linux.c b/loader/powerpc/ieee1275/linux.c index 80d8b033f..04c9b0197 100644 --- a/loader/powerpc/ieee1275/linux.c +++ b/loader/powerpc/ieee1275/linux.c @@ -238,7 +238,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), /* Specify the boot file. */ dest = grub_stpcpy (linux_args, "BOOT_IMAGE="); dest = grub_stpcpy (dest, argv[0]); - + for (i = 1; i < argc; i++) { *dest++ = ' '; @@ -297,9 +297,9 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), /* Attempt to claim at a series of addresses until successful in the same way that grub_rescue_cmd_linux does. */ - for (addr = first_addr; addr < first_addr + 200 * 0x100000; addr += 0x100000) + for (addr = first_addr; addr < first_addr + 200 * 0x100000; addr += 0x100000) { - grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n", + grub_dprintf ("loader", "Attempting to claim at 0x%x, size 0x%x.\n", addr, size); found_addr = grub_claimmap (addr, size); if (found_addr != -1) diff --git a/loader/xnu.c b/loader/xnu.c index 18264bcf0..5b5f77e8e 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -1,4 +1,4 @@ -/* xnu.c - load xnu kernel. Thanks to Florian Idelberger for all the +/* xnu.c - load xnu kernel. Thanks to Florian Idelberger for all the time he spent testing this */ /* @@ -40,7 +40,7 @@ static int driversnum = 0; #define GRUB_XNU_HEAP_ALLOC_BLOCK 0x2000000 static grub_err_t -grub_xnu_register_memory (char *prefix, int *suffix, +grub_xnu_register_memory (char *prefix, int *suffix, void *addr, grub_size_t size); void * grub_xnu_heap_malloc (int size) @@ -48,7 +48,7 @@ grub_xnu_heap_malloc (int size) void *val; #if 0 - /* This way booting is faster but less reliable. + /* This way booting is faster but less reliable. Once we have advanced mm second way will be as fast as this one. */ val = grub_xnu_heap_start = (char *) 0x100000; #else @@ -56,22 +56,22 @@ grub_xnu_heap_malloc (int size) /* The page after the heap is used for stack. Ensure it's usable. */ if (grub_xnu_heap_size) - oldblknum = (grub_xnu_heap_size + GRUB_XNU_PAGESIZE + oldblknum = (grub_xnu_heap_size + GRUB_XNU_PAGESIZE + GRUB_XNU_HEAP_ALLOC_BLOCK - 1) / GRUB_XNU_HEAP_ALLOC_BLOCK; else oldblknum = 0; - newblknum = (grub_xnu_heap_size + size + GRUB_XNU_PAGESIZE + newblknum = (grub_xnu_heap_size + size + GRUB_XNU_PAGESIZE + GRUB_XNU_HEAP_ALLOC_BLOCK - 1) / GRUB_XNU_HEAP_ALLOC_BLOCK; if (oldblknum != newblknum) - /* FIXME: instruct realloc to allocate at 1MB if possible once + /* FIXME: instruct realloc to allocate at 1MB if possible once advanced mm is ready. */ - val = grub_realloc (grub_xnu_heap_start, + val = grub_realloc (grub_xnu_heap_start, newblknum * GRUB_XNU_HEAP_ALLOC_BLOCK); else val = grub_xnu_heap_start; if (! val) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough space on xnu memory heap"); return 0; } @@ -84,8 +84,8 @@ grub_xnu_heap_malloc (int size) return (char *) val; } -/* Make sure next block of the heap will be aligned. - Please notice: aligned are pointers AFTER relocation +/* Make sure next block of the heap will be aligned. + Please notice: aligned are pointers AFTER relocation and not the current ones. */ grub_err_t grub_xnu_align_heap (int align) @@ -111,9 +111,9 @@ grub_xnu_free_devtree (struct grub_xnu_devtree_key *cur) else if (cur->data) grub_free (cur->data); d = cur->next; - grub_free (cur); + grub_free (cur); cur = d; - } + } } /* Compute the size of device tree in xnu format. */ @@ -122,20 +122,20 @@ grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name) { grub_size_t ret; struct grub_xnu_devtree_key *cur; - + /* Key header. */ ret = 2 * sizeof (grub_uint32_t); /* "name" value. */ ret += 32 + sizeof (grub_uint32_t) - + grub_strlen (name) + 4 + + grub_strlen (name) + 4 - (grub_strlen (name) % 4); for (cur = start; cur; cur = cur->next) if (cur->datasize != -1) { int align_overhead; - + align_overhead = 4 - (cur->datasize % 4); if (align_overhead == 4) align_overhead = 0; @@ -148,7 +148,7 @@ grub_xnu_writetree_get_size (struct grub_xnu_devtree_key *start, char *name) /* Write devtree in XNU format at curptr assuming the head is named NAME.*/ static void * -grub_xnu_writetree_toheap_real (void *curptr, +grub_xnu_writetree_toheap_real (void *curptr, struct grub_xnu_devtree_key *start, char *name) { struct grub_xnu_devtree_key *cur; @@ -161,8 +161,8 @@ grub_xnu_writetree_toheap_real (void *curptr, nvals++; } /* For the name. */ - nvals++; - + nvals++; + *((grub_uint32_t *) curptr) = nvals; curptr = ((grub_uint32_t *) curptr) + 1; *((grub_uint32_t *) curptr) = nkeys; @@ -184,7 +184,7 @@ grub_xnu_writetree_toheap_real (void *curptr, if (cur->datasize != -1) { int align_overhead; - + align_overhead = 4 - (cur->datasize % 4); if (align_overhead == 4) align_overhead = 0; @@ -198,12 +198,12 @@ grub_xnu_writetree_toheap_real (void *curptr, grub_memset (curptr, 0, align_overhead); curptr = ((grub_uint8_t *) curptr) + align_overhead; } - + /* And then the keys. Recursively use this function. */ for (cur = start; cur; cur = cur->next) if (cur->datasize == -1) if (!(curptr = grub_xnu_writetree_toheap_real (curptr, - cur->first_child, + cur->first_child, cur->name))) return 0; return curptr; @@ -217,11 +217,11 @@ grub_xnu_writetree_toheap (void **start, grub_size_t *size) struct grub_xnu_devtree_key *driverkey; struct grub_xnu_extdesc *extdesc; grub_err_t err; - + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); if (err) return err; - + /* Device tree itself is in the memory map of device tree. */ /* Create a dummy value in memory-map. */ chosen = grub_xnu_create_key (&grub_xnu_devtree_root, "chosen"); @@ -240,18 +240,18 @@ grub_xnu_writetree_toheap (void **start, grub_size_t *size) driverkey->datasize = sizeof (*extdesc); driverkey->next = memorymap->first_child; memorymap->first_child = driverkey; - driverkey->data = extdesc + driverkey->data = extdesc = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc)); if (! driverkey->data) return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't write device tree"); /* Allocate the space based on the size with dummy value. */ *size = grub_xnu_writetree_get_size (grub_xnu_devtree_root, "/"); - *start = grub_xnu_heap_malloc (*size + GRUB_XNU_PAGESIZE + *start = grub_xnu_heap_malloc (*size + GRUB_XNU_PAGESIZE - *size % GRUB_XNU_PAGESIZE); /* Put real data in the dummy. */ - extdesc->addr = (char *) *start - grub_xnu_heap_start + extdesc->addr = (char *) *start - grub_xnu_heap_start + grub_xnu_heap_will_be_at; extdesc->size = (grub_uint32_t) *size; @@ -370,7 +370,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), if (! grub_macho_contains_macho32 (macho)) { grub_macho_close (macho); - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "Kernel doesn't contain suitable architecture"); } @@ -382,7 +382,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), return err; } - grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", + grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", (unsigned long) endcode, (unsigned long) startcode); loadaddr = grub_xnu_heap_malloc (endcode - startcode); @@ -392,7 +392,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), { grub_macho_close (macho); grub_xnu_unload (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to load kernel"); } @@ -426,7 +426,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), ptr = grub_xnu_cmdline; for (i = 1; i < argc; i++) { - if (ptr + grub_strlen (args[i]) + 1 + if (ptr + grub_strlen (args[i]) + 1 >= grub_xnu_cmdline + sizeof (grub_xnu_cmdline)) break; grub_memcpy (ptr, args[i], grub_strlen (args[i])); @@ -437,22 +437,22 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), /* Replace last space by '\0'. */ if (ptr != grub_xnu_cmdline) - *(ptr - 1) = 0; + *(ptr - 1) = 0; err = grub_cpu_xnu_fill_devicetree (); if (err) return err; - grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); + grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); grub_xnu_lock (); return 0; } -/* Register a memory in a memory map under name PREFIXSUFFIX +/* Register a memory in a memory map under name PREFIXSUFFIX and increment SUFFIX. */ static grub_err_t -grub_xnu_register_memory (char *prefix, int *suffix, +grub_xnu_register_memory (char *prefix, int *suffix, void *addr, grub_size_t size) { struct grub_xnu_devtree_key *chosen; @@ -487,11 +487,11 @@ grub_xnu_register_memory (char *prefix, int *suffix, driverkey->datasize = sizeof (*extdesc); driverkey->next = memorymap->first_child; memorymap->first_child = driverkey; - driverkey->data = extdesc + driverkey->data = extdesc = (struct grub_xnu_extdesc *) grub_malloc (sizeof (*extdesc)); if (! driverkey->data) return grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't register extension"); - extdesc->addr = grub_xnu_heap_will_be_at + + extdesc->addr = grub_xnu_heap_will_be_at + ((grub_uint8_t *) addr - (grub_uint8_t *) grub_xnu_heap_start); extdesc->size = (grub_uint32_t) size; return GRUB_ERR_NONE; @@ -511,7 +511,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) if (! grub_xnu_heap_size) return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); - + /* Compute the needed space. */ if (binaryfile) { @@ -520,7 +520,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) { if (macho) grub_macho_close (macho); - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "Extension doesn't contain suitable architecture"); } machosize = grub_macho32_filesize (macho); @@ -571,7 +571,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) /* Load the plist. */ if (infoplist) { - exthead->infoplistaddr = (buf - grub_xnu_heap_start) + exthead->infoplistaddr = (buf - grub_xnu_heap_start) + grub_xnu_heap_will_be_at; exthead->infoplistsize = infoplistsize + 1; if (grub_file_read (infoplist, buf, infoplistsize) @@ -589,7 +589,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) /* Announce to kernel */ return grub_xnu_register_memory ("Driver-", &driversnum, exthead, - neededspace); + neededspace); } /* Load mkext. */ @@ -614,14 +614,14 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), file = grub_gzfile_open (args[0], 1); if (! file) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load driver package"); /* Sometimes caches are fat binary. Errgh. */ if (grub_file_read (file, (char *) &head, sizeof (head)) != (grub_ssize_t) (sizeof (head))) { - /* I don't know the internal structure of package but + /* I don't know the internal structure of package but can hardly imagine a valid package shorter than 20 bytes. */ grub_file_close (file); grub_error_push (); @@ -637,11 +637,11 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), { grub_file_close (file); grub_error_push (); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't read file %s", args[0]); - + } - if (grub_file_read (file, (char *) archs, + if (grub_file_read (file, (char *) archs, sizeof (struct grub_macho_fat_arch) * narchs) != (grub_ssize_t) sizeof(struct grub_macho_fat_arch) * narchs) { @@ -651,7 +651,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), } for (i = 0; i < narchs; i++) { - if (GRUB_MACHO_CPUTYPE_IS_HOST32 + if (GRUB_MACHO_CPUTYPE_IS_HOST32 (grub_be_to_cpu32 (archs[i].cputype))) { readoff = grub_be_to_cpu32 (archs[i].offset); @@ -700,7 +700,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), /* Pass it to kernel. */ return grub_xnu_register_memory ("DriversPackage-", &driverspackagenum, - loadto, readlen); + loadto, readlen); } static grub_err_t @@ -720,7 +720,7 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)), file = grub_gzfile_open (args[0], 1); if (! file) - return grub_error (GRUB_ERR_FILE_NOT_FOUND, + return grub_error (GRUB_ERR_FILE_NOT_FOUND, "Couldn't load ramdisk"); err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); @@ -728,7 +728,7 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)), return err; size = grub_file_size (file); - + loadto = grub_xnu_heap_malloc (size); if (! loadto) return grub_errno; @@ -739,10 +739,10 @@ grub_cmd_xnu_ramdisk (grub_command_t cmd __attribute__ ((unused)), grub_error_push (); return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]); } - return grub_xnu_register_memory ("RAMDisk", 0, loadto, size); + return grub_xnu_register_memory ("RAMDisk", 0, loadto, size); } -/* Parse a devtree file. It uses the following format: +/* Parse a devtree file. It uses the following format: valuename:valuedata; keyname{ contents @@ -766,12 +766,12 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, if (*ptr == '}') return ptr + 1; namelen = 0; - + /* Parse the name. */ - for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) + for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) || (*ptr2 >= '0' && *ptr2 <= '9') || (*ptr2 >= 'a' && *ptr2 <= 'f') - || (*ptr2 >= 'A' && *ptr2 <= 'F')); + || (*ptr2 >= 'A' && *ptr2 <= 'F')); ptr2++) if (! grub_isspace (*ptr2)) namelen++; @@ -792,7 +792,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, hex = *ptr - 'a' + 10; if (*ptr >= 'A' && *ptr <= 'F') hex = *ptr - 'A' + 10; - + if (i % 2 == 0) name[i / 2] = hex << 4; else @@ -806,7 +806,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, /* If it describes a key recursively invoke the function. */ if (*ptr == '{') { - struct grub_xnu_devtree_key *newkey + struct grub_xnu_devtree_key *newkey = grub_xnu_create_key (parent, name); grub_free (name); if (! newkey) @@ -820,10 +820,10 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, return 0; ptr++; datalen = 0; - for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) + for (ptr2 = ptr; ptr2 < end && (grub_isspace (*ptr2) || (*ptr2 >= '0' && *ptr2 <= '9') || (*ptr2 >= 'a' && *ptr2 <= 'f') - || (*ptr2 >= 'A' && *ptr2 <= 'F')); + || (*ptr2 >= 'A' && *ptr2 <= 'F')); ptr2++) if (! grub_isspace (*ptr2)) datalen++; @@ -844,7 +844,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, hex = *ptr - 'a' + 10; if (*ptr >= 'A' && *ptr <= 'F') hex = *ptr - 'A' + 10; - + if (i % 2 == 0) data[i / 2] = hex << 4; else @@ -854,7 +854,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, while (ptr < end && grub_isspace (*ptr)) ptr++; { - struct grub_xnu_devtree_key *newkey + struct grub_xnu_devtree_key *newkey = grub_xnu_create_value (parent, name); grub_free (name); if (! newkey) @@ -871,7 +871,7 @@ grub_xnu_parse_devtree (struct grub_xnu_devtree_key **parent, return ptr; } -/* Returns true if the kext should be loaded according to plist +/* Returns true if the kext should be loaded according to plist and osbundlereq. Also fill BINNAME. */ static int grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq, @@ -890,7 +890,7 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq, file = grub_gzfile_open (plistname, 1); if (! file) { - grub_file_close (file); + grub_file_close (file); grub_error_push (); grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname); return 0; @@ -900,26 +900,26 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq, buf = grub_malloc (size); if (! buf) { - grub_file_close (file); + grub_file_close (file); grub_error_push (); grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't read file %s", plistname); return 0; } if (grub_file_read (file, buf, size) != (grub_ssize_t) (size)) { - grub_file_close (file); + grub_file_close (file); grub_error_push (); grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", plistname); return 0; } - grub_file_close (file); + grub_file_close (file); /* Set the return value for the case when no OSBundleRequired tag is found. */ if (osbundlereq) ret = grub_strword (osbundlereq, "all") || grub_strword (osbundlereq, "-"); else ret = 1; - + /* Parse plist. It's quite dirty and inextensible but does its job. */ for (ptr1 = buf; ptr1 < buf + size; ptr1++) switch (*ptr1) @@ -927,17 +927,17 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq, case '<': tagstart = ptr1; *ptr1 = 0; - if (keyptr && depth == 4 + if (keyptr && depth == 4 && grub_strcmp (keyptr, "OSBundleRequired") == 0) osbundlekeyfound = 1; - if (keyptr && depth == 4 && + if (keyptr && depth == 4 && grub_strcmp (keyptr, "CFBundleExecutable") == 0) binnamekeyfound = 1; if (stringptr && osbundlekeyfound && osbundlereq && depth == 4) { for (ptr2 = stringptr; *ptr2; ptr2++) *ptr2 = grub_tolower (*ptr2); - ret = grub_strword (osbundlereq, stringptr) + ret = grub_strword (osbundlereq, stringptr) || grub_strword (osbundlereq, "all"); } if (stringptr && binnamekeyfound && binname && depth == 4) @@ -968,14 +968,14 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq, if (depth == 3 && grub_strcmp (tagstart + 1, "key") == 0) keyptr = ptr1 + 1; if (depth == 3 && grub_strcmp (tagstart + 1, "string") == 0) - stringptr = ptr1 + 1; + stringptr = ptr1 + 1; else if (grub_strcmp (tagstart + 1, "/key") != 0) { osbundlekeyfound = 0; binnamekeyfound = 0; } *ptr1 = '>'; - + if (tagstart[1] == '/') depth--; else @@ -984,12 +984,12 @@ grub_xnu_check_os_bundle_required (char *plistname, char *osbundlereq, } grub_free (buf); - return ret; + return ret; } /* Load all loadable kexts placed under DIRNAME and matching OSBUNDLEREQUIRED */ grub_err_t -grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, +grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, int maxrecursion) { grub_device_t dev; @@ -997,7 +997,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, grub_fs_t fs; const char *path; - auto int load_hook (const char *filename, + auto int load_hook (const char *filename, const struct grub_dirhook_info *info); int load_hook (const char *filename, const struct grub_dirhook_info *info) { @@ -1011,7 +1011,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, grub_memcmp (filename + grub_strlen (filename) - 5, ".kext", 5) != 0) return 0; - newdirname + newdirname = grub_malloc (grub_strlen (dirname) + grub_strlen (filename) + 2); /* It's a .kext. Try to load it. */ @@ -1021,7 +1021,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, newdirname[grub_strlen (newdirname) + 1] = 0; newdirname[grub_strlen (newdirname)] = '/'; grub_strcpy (newdirname + grub_strlen (newdirname), filename); - grub_xnu_load_kext_from_dir (newdirname, osbundlerequired, + grub_xnu_load_kext_from_dir (newdirname, osbundlerequired, maxrecursion); if (grub_errno == GRUB_ERR_BAD_OS) grub_errno = GRUB_ERR_NONE; @@ -1055,7 +1055,7 @@ grub_xnu_scan_dir_for_kexts (char *dirname, char *osbundlerequired, /* Load extension DIRNAME. (extensions are directories in xnu) */ grub_err_t -grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, +grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, int maxrecursion) { grub_device_t dev; @@ -1069,16 +1069,16 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, int usemacos = 0; grub_file_t binfile; - auto int load_hook (const char *filename, + auto int load_hook (const char *filename, const struct grub_dirhook_info *info); int load_hook (const char *filename, const struct grub_dirhook_info *info) { if (grub_strlen (filename) > 15) return 0; - grub_strcpy (newdirname + grub_strlen (dirname) + 1, filename); + grub_strcpy (newdirname + grub_strlen (dirname) + 1, filename); - /* If the kext contains directory "Contents" all real stuff is in + /* If the kext contains directory "Contents" all real stuff is in this directory. */ if (info->dir && grub_strcasecmp (filename, "Contents") == 0) grub_xnu_load_kext_from_dir (newdirname, osbundlerequired, @@ -1086,16 +1086,16 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, /* Directory "Plugins" contains nested kexts. */ if (info->dir && grub_strcasecmp (filename, "Plugins") == 0) - grub_xnu_scan_dir_for_kexts (newdirname, osbundlerequired, + grub_xnu_scan_dir_for_kexts (newdirname, osbundlerequired, maxrecursion - 1); - /* Directory "MacOS" contains executable, otherwise executable is + /* Directory "MacOS" contains executable, otherwise executable is on the top. */ if (info->dir && grub_strcasecmp (filename, "MacOS") == 0) usemacos = 1; - + /* Info.plist is the file which governs our future actions. */ - if (! info->dir && grub_strcasecmp (filename, "Info.plist") == 0 + if (! info->dir && grub_strcasecmp (filename, "Info.plist") == 0 && ! plistname) plistname = grub_strdup (newdirname); return 0; @@ -1106,7 +1106,7 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate buffer"); grub_strcpy (newdirname, dirname); newdirname[grub_strlen (dirname)] = '/'; - newdirname[grub_strlen (dirname) + 1] = 0; + newdirname[grub_strlen (dirname) + 1] = 0; device_name = grub_file_get_device_name (dirname); dev = grub_device_open (device_name); if (dev) @@ -1123,19 +1123,19 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, newpath = newdirname; else newpath++; - + /* Look at the directory. */ if (fs) (fs->dir) (dev, path, load_hook); - if (plistname && grub_xnu_check_os_bundle_required + if (plistname && grub_xnu_check_os_bundle_required (plistname, osbundlerequired, &binsuffix)) { if (binsuffix) { /* Open the binary. */ - char *binname = grub_malloc (grub_strlen (dirname) - + grub_strlen (binsuffix) + char *binname = grub_malloc (grub_strlen (dirname) + + grub_strlen (binsuffix) + sizeof ("/MacOS/")); grub_strcpy (binname, dirname); if (usemacos) @@ -1145,10 +1145,10 @@ grub_xnu_load_kext_from_dir (char *dirname, char *osbundlerequired, grub_strcpy (binname + grub_strlen (binname), binsuffix); grub_dprintf ("xnu", "%s:%s\n", plistname, binname); binfile = grub_gzfile_open (binname, 1); - if (! binfile) + if (! binfile) grub_errno = GRUB_ERR_NONE; - /* Load the extension. */ + /* Load the extension. */ grub_xnu_load_driver (plistname, binfile); grub_free (binname); grub_free (binsuffix); @@ -1191,12 +1191,12 @@ grub_cmd_xnu_devtree (grub_command_t cmd __attribute__ ((unused)), if (! data) { grub_file_close (file); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could load device tree into memory"); } if (grub_file_read (file, data, datalen) != (grub_ssize_t) datalen) { - grub_file_close (file); + grub_file_close (file); grub_free (data); grub_error_push (); return grub_error (GRUB_ERR_BAD_OS, "Couldn't read file %s", args[0]); @@ -1237,7 +1237,7 @@ grub_cmd_xnu_kext (grub_command_t cmd __attribute__ ((unused)), } } return grub_xnu_load_driver (grub_strcmp (args[0], "-") ? args[0] : 0, - binfile); + binfile); } /* load kext normally. */ @@ -1256,7 +1256,7 @@ grub_cmd_xnu_kextdir (grub_command_t cmd __attribute__ ((unused)), return grub_error (GRUB_ERR_BAD_ARGUMENT, "directory name required"); if (argc == 1) - return grub_xnu_scan_dir_for_kexts (args[0], + return grub_xnu_scan_dir_for_kexts (args[0], "console,root,local-root,network-root", 10); else @@ -1264,7 +1264,7 @@ grub_cmd_xnu_kextdir (grub_command_t cmd __attribute__ ((unused)), char *osbundlerequired = grub_strdup (args[1]), *ptr; grub_err_t err; if (! osbundlerequired) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate string temporary space"); for (ptr = osbundlerequired; *ptr; ptr++) *ptr = grub_tolower (*ptr); @@ -1282,8 +1282,8 @@ grub_cmd_xnu_splash (grub_command_t cmd __attribute__ ((unused)), { grub_err_t err; if (argc != 1) - return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); - + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + err = grub_video_bitmap_load (&grub_xnu_bitmap, args[0]); if (err) grub_xnu_bitmap = 0; @@ -1298,7 +1298,7 @@ grub_cmd_xnu_resume (grub_command_t cmd __attribute__ ((unused)), { if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); - + return grub_xnu_resume (args[0]); } #endif @@ -1319,7 +1319,7 @@ grub_xnu_unlock () locked = 0; } -static grub_command_t cmd_kernel, cmd_mkext, cmd_kext, cmd_kextdir, +static grub_command_t cmd_kernel, cmd_mkext, cmd_kext, cmd_kextdir, cmd_ramdisk, cmd_devtree, cmd_resume, cmd_splash; GRUB_MOD_INIT(xnu) @@ -1330,7 +1330,7 @@ GRUB_MOD_INIT(xnu) "Load XNU extension package."); cmd_kext = grub_register_command ("xnu_kext", grub_cmd_xnu_kext, 0, "Load XNU extension."); - cmd_kextdir = grub_register_command ("xnu_kextdir", grub_cmd_xnu_kextdir, + cmd_kextdir = grub_register_command ("xnu_kextdir", grub_cmd_xnu_kextdir, "xnu_kextdir DIRECTORY [OSBundleRequired]", "Load XNU extension directory"); cmd_ramdisk = grub_register_command ("xnu_ramdisk", grub_cmd_xnu_ramdisk, 0, @@ -1342,7 +1342,7 @@ GRUB_MOD_INIT(xnu) "Load a splash image for XNU"); #ifndef GRUB_UTIL - cmd_resume = grub_register_command ("xnu_resume", grub_cmd_xnu_resume, + cmd_resume = grub_register_command ("xnu_resume", grub_cmd_xnu_resume, 0, "Load XNU hibernate image."); #endif my_mod=mod; diff --git a/loader/xnu_resume.c b/loader/xnu_resume.c index b501e150b..69453eab0 100644 --- a/loader/xnu_resume.c +++ b/loader/xnu_resume.c @@ -53,13 +53,13 @@ grub_xnu_resume (char *imagename) file = grub_file_open (imagename); if (! file) return 0; - + /* Read the header. */ if (grub_file_read (file, (char *) &hibhead, sizeof (hibhead)) !=sizeof (hibhead)) { grub_file_close (file); - return grub_error (GRUB_ERR_READ_ERROR, + return grub_error (GRUB_ERR_READ_ERROR, "cannot read the hibernate header"); } @@ -67,13 +67,13 @@ grub_xnu_resume (char *imagename) if (hibhead.magic != GRUB_XNU_HIBERNATE_MAGIC) { grub_file_close (file); - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "hibernate header has incorrect magic number"); } if (hibhead.encoffset) { grub_file_close (file); - return grub_error (GRUB_ERR_BAD_OS, + return grub_error (GRUB_ERR_BAD_OS, "encrypted images aren't supported yet"); } @@ -91,19 +91,19 @@ grub_xnu_resume (char *imagename) if (grub_xnu_hibernate_image) grub_free (grub_xnu_hibernate_image); - /* Try to allocate necessary space. + /* Try to allocate necessary space. FIXME: mm isn't good enough yet to handle huge allocations. */ grub_xnu_hibernate_image = buf = grub_malloc (hibhead.image_size); if (! buf) { grub_file_close (file); - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to load image"); } /* Read image. */ - if (grub_file_seek (file, 0) == (grub_off_t)-1 + if (grub_file_seek (file, 0) == (grub_off_t)-1 || grub_file_read (file, buf, hibhead.image_size) != (grub_ssize_t) hibhead.image_size) { @@ -123,11 +123,11 @@ grub_xnu_resume (char *imagename) /* Prepare asm helper. */ grub_memcpy (codetmp, ((grub_uint8_t *) buf) + total_header_size, codesize); - grub_memcpy (codetmp + codesize, grub_xnu_launcher_start, - grub_xnu_launcher_end - grub_xnu_launcher_start); + grub_memcpy (codetmp + codesize, grub_xnu_launcher_start, + grub_xnu_launcher_end - grub_xnu_launcher_start); /* We're ready now. */ - grub_loader_set ((grub_err_t (*) (void)) (codetmp + codesize), + grub_loader_set ((grub_err_t (*) (void)) (codetmp + codesize), grub_xnu_resume_unload, 0); /* Prevent module from unloading. */ diff --git a/mmap/efi/mmap.c b/mmap/efi/mmap.c index d0dbc6a97..316c997c7 100644 --- a/mmap/efi/mmap.c +++ b/mmap/efi/mmap.c @@ -29,8 +29,8 @@ ((grub_efi_memory_descriptor_t *) ((char *) (desc) + (size))) grub_err_t -grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, - grub_uint64_t, +grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, + grub_uint64_t, grub_uint32_t)) { grub_efi_uintn_t mmap_size = 0; @@ -62,13 +62,13 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, desc = NEXT_MEMORY_DESCRIPTOR (desc, desc_size)) { grub_dprintf ("mmap", "EFI memory region 0x%llx-0x%llx: %d\n", - (unsigned long long) desc->physical_start, + (unsigned long long) desc->physical_start, (unsigned long long) desc->physical_start + desc->num_pages * 4096, desc->type); switch (desc->type) { case GRUB_EFI_RUNTIME_SERVICES_CODE: - hook (desc->physical_start, desc->num_pages * 4096, + hook (desc->physical_start, desc->num_pages * 4096, GRUB_MACHINE_MEMORY_CODE); break; @@ -82,7 +82,7 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, case GRUB_EFI_MEMORY_MAPPED_IO: case GRUB_EFI_MEMORY_MAPPED_IO_PORT_SPACE: case GRUB_EFI_PAL_CODE: - hook (desc->physical_start, desc->num_pages * 4096, + hook (desc->physical_start, desc->num_pages * 4096, GRUB_MACHINE_MEMORY_RESERVED); break; @@ -91,17 +91,17 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, case GRUB_EFI_BOOT_SERVICES_CODE: case GRUB_EFI_BOOT_SERVICES_DATA: case GRUB_EFI_CONVENTIONAL_MEMORY: - hook (desc->physical_start, desc->num_pages * 4096, + hook (desc->physical_start, desc->num_pages * 4096, GRUB_MACHINE_MEMORY_AVAILABLE); break; case GRUB_EFI_ACPI_RECLAIM_MEMORY: - hook (desc->physical_start, desc->num_pages * 4096, + hook (desc->physical_start, desc->num_pages * 4096, GRUB_MACHINE_MEMORY_ACPI); break; case GRUB_EFI_ACPI_MEMORY_NVS: - hook (desc->physical_start, desc->num_pages * 4096, + hook (desc->physical_start, desc->num_pages * 4096, GRUB_MACHINE_MEMORY_NVS); break; } @@ -110,7 +110,7 @@ grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, return GRUB_ERR_NONE; } -static inline grub_efi_memory_type_t +static inline grub_efi_memory_type_t make_efi_memtype (int type) { switch (type) @@ -118,10 +118,10 @@ make_efi_memtype (int type) case GRUB_MACHINE_MEMORY_CODE: return GRUB_EFI_RUNTIME_SERVICES_CODE; - /* No way to remove a chunk of memory from EFI mmap. + /* No way to remove a chunk of memory from EFI mmap. So mark it as unusable. */ case GRUB_MACHINE_MEMORY_HOLE: - + default: case GRUB_MACHINE_MEMORY_RESERVED: @@ -135,7 +135,7 @@ make_efi_memtype (int type) case GRUB_MACHINE_MEMORY_NVS: return GRUB_EFI_ACPI_RECLAIM_MEMORY; - + } } @@ -164,7 +164,7 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) curover = (struct overlay *) grub_malloc (sizeof (struct overlay)); if (! curover) return 0; - + b = grub_efi_system_table->boot_services; address = start & (~0x3ffULL); pages = (end - address + 0x3ff) >> 12; @@ -174,7 +174,7 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) grub_free (curover); return 0; } - status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS, + status = efi_call_4 (b->allocate_pages, GRUB_EFI_ALLOCATE_ADDRESS, make_efi_memtype (type), pages, &address); if (status != GRUB_EFI_SUCCESS) { @@ -190,7 +190,7 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) return curover->handle; } -grub_err_t +grub_err_t grub_mmap_unregister (int handle) { struct overlay *curover, *prevover; @@ -199,8 +199,8 @@ grub_mmap_unregister (int handle) b = grub_efi_system_table->boot_services; - - for (curover = overlays, prevover = 0; curover; + + for (curover = overlays, prevover = 0; curover; prevover = curover, curover = curover->next) { if (curover->handle == handle) @@ -219,9 +219,9 @@ grub_mmap_unregister (int handle) /* Result is always page-aligned. */ void * -grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), +grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), grub_uint64_t size, - int *handle, int type, + int *handle, int type, int flags __attribute__ ((unused))) { grub_efi_physical_address_t address; @@ -234,7 +234,7 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), curover = (struct overlay *) grub_malloc (sizeof (struct overlay)); if (! curover) return 0; - + b = grub_efi_system_table->boot_services; address = 0xffffffff; @@ -247,7 +247,7 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), #endif pages = (size + 0x3ff) >> 12; - status = efi_call_4 (b->allocate_pages, atype, + status = efi_call_4 (b->allocate_pages, atype, make_efi_memtype (type), pages, &address); if (status != GRUB_EFI_SUCCESS) { @@ -260,13 +260,13 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), /* Uggh, the address 0 was allocated... This is too annoying, so reallocate another one. */ address = 0xffffffff; - status = efi_call_4 (b->allocate_pages, atype, + status = efi_call_4 (b->allocate_pages, atype, make_efi_memtype (type), pages, &address); grub_efi_free_pages (0, pages); if (status != GRUB_EFI_SUCCESS) return 0; } - + curover->next = overlays; curover->handle = curhandle++; curover->address = address; @@ -277,7 +277,7 @@ grub_mmap_malign_and_register (grub_uint64_t align __attribute__ ((unused)), return UINT_TO_PTR (curover->address); } -void +void grub_mmap_free_and_unregister (int handle) { grub_mmap_unregister (handle); diff --git a/mmap/i386/mmap.c b/mmap/i386/mmap.c index 9f751d0ac..f6e16129e 100644 --- a/mmap/i386/mmap.c +++ b/mmap/i386/mmap.c @@ -32,9 +32,9 @@ grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, { grub_uint64_t highestlow = 0; - auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, + auto int NESTED_FUNC_ATTR find_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); - int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t rangesize, + int NESTED_FUNC_ATTR find_hook (grub_uint64_t start, grub_uint64_t rangesize, grub_uint32_t memtype) { grub_uint64_t end = start + rangesize; @@ -69,7 +69,7 @@ grub_mmap_malign_and_register (grub_uint64_t align, grub_uint64_t size, { grub_free (ret); return 0; - } + } return ret; } @@ -88,7 +88,7 @@ grub_mmap_free_and_unregister (int handle) return; addr = cur->start; - + grub_mmap_unregister (handle); if (addr >= 0x100000) diff --git a/mmap/i386/pc/mmap.c b/mmap/i386/pc/mmap.c index ec517275e..0e2dfe6a6 100644 --- a/mmap/i386/pc/mmap.c +++ b/mmap/i386/pc/mmap.c @@ -50,13 +50,13 @@ struct grub_e820_mmap_entry } __attribute__((packed)); -static grub_err_t +static grub_err_t preboot (int noreturn __attribute__ ((unused))) { struct grub_e820_mmap_entry *hookmmap, *hookmmapcur; - auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, + auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); - int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, grub_uint64_t size, + int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) { grub_dprintf ("mmap", "mmap chunk %llx-%llx:%x\n", addr, addr + size, type); @@ -68,22 +68,22 @@ preboot (int noreturn __attribute__ ((unused))) } if (! hooktarget) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "no space is allocated for memory hook"); grub_dprintf ("mmap", "installing preboot handlers\n"); - hookmmapcur = hookmmap = (struct grub_e820_mmap_entry *) - ((grub_uint8_t *) hooktarget + (&grub_machine_mmaphook_end + hookmmapcur = hookmmap = (struct grub_e820_mmap_entry *) + ((grub_uint8_t *) hooktarget + (&grub_machine_mmaphook_end - &grub_machine_mmaphook_start)); - grub_mmap_iterate (fill_hook); + grub_mmap_iterate (fill_hook); grub_machine_mmaphook_mmap_num = hookmmapcur - hookmmap; grub_machine_mmaphook_kblow = grub_mmap_get_lower () >> 10; - grub_machine_mmaphook_kbin16mb + grub_machine_mmaphook_kbin16mb = min (grub_mmap_get_upper (),0x3f00000ULL) >> 10; - grub_machine_mmaphook_64kbin4gb + grub_machine_mmaphook_64kbin4gb = min (grub_mmap_get_post64 (), 0xfc000000ULL) >> 16; /* Correct BDA. */ @@ -103,7 +103,7 @@ preboot (int noreturn __attribute__ ((unused))) *((grub_uint16_t *) 0x4a) = PTR_TO_UINT32 (hooktarget) >> 4; *((grub_uint16_t *) 0x56) = PTR_TO_UINT32 (hooktarget) >> 4; - *((grub_uint16_t *) 0x48) = &grub_machine_mmaphook_int12 + *((grub_uint16_t *) 0x48) = &grub_machine_mmaphook_int12 - &grub_machine_mmaphook_start; *((grub_uint16_t *) 0x54) = &grub_machine_mmaphook_int15 - &grub_machine_mmaphook_start; @@ -123,7 +123,7 @@ preboot_rest (void) return GRUB_ERR_NONE; } -static grub_err_t +static grub_err_t malloc_hook (void) { static int reentry = 0; @@ -131,10 +131,10 @@ malloc_hook (void) static int slots_available = 0; int hooksize; int regcount = 0; - auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, + auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); - int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), + int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), grub_uint32_t type __attribute__ ((unused))) { regcount++; @@ -165,13 +165,13 @@ malloc_hook (void) + regcount * sizeof (struct grub_e820_mmap_entry); /* Allocate an integer number of KiB. */ hooksize = ((hooksize - 1) | 0x3ff) + 1; - slots_available = (hooksize - (&grub_machine_mmaphook_end + slots_available = (hooksize - (&grub_machine_mmaphook_end - &grub_machine_mmaphook_start)) / sizeof (struct grub_e820_mmap_entry); reentry = 1; - hooktarget - = grub_mmap_malign_and_register (16, hooksize, &mmapregion, + hooktarget + = grub_mmap_malign_and_register (16, hooksize, &mmapregion, GRUB_MACHINE_MEMORY_RESERVED, GRUB_MMAP_MALLOC_LOW); reentry = 0; @@ -185,8 +185,8 @@ malloc_hook (void) } grub_err_t -grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), - grub_uint64_t size __attribute__ ((unused)), +grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), int type __attribute__ ((unused)), int handle __attribute__ ((unused))) { @@ -200,8 +200,8 @@ grub_machine_mmap_register (grub_uint64_t start __attribute__ ((unused)), if (! preb_handle) { grub_dprintf ("mmap", "adding preboot\n"); - preb_handle - = grub_loader_register_preboot_hook (preboot, preboot_rest, + preb_handle + = grub_loader_register_preboot_hook (preboot, preboot_rest, GRUB_LOADER_PREBOOT_HOOK_PRIO_MEMORY); if (! preb_handle) return grub_errno; diff --git a/mmap/i386/pc/mmap_helper.S b/mmap/i386/pc/mmap_helper.S index f153f1c98..c6d12fd6c 100644 --- a/mmap/i386/pc/mmap_helper.S +++ b/mmap/i386/pc/mmap_helper.S @@ -21,7 +21,7 @@ #define DS(x) ((x) - segstart) -segstart: +segstart: VARIABLE(grub_machine_mmaphook_start) .code16 VARIABLE(grub_machine_mmaphook_int12) @@ -52,7 +52,7 @@ VARIABLE (grub_machine_mmaphook_int15offset) .word 0 VARIABLE (grub_machine_mmaphook_int15segment) .word 0 - + e801: popf push %ds @@ -128,8 +128,8 @@ e820: cmpw DS(EXT_C(grub_machine_mmaphook_mmap_num)), %bx #endif jb noclean - xor %bx, %bx -noclean: + xor %bx, %bx +noclean: mov $0x534d4150, %eax pop %ds clc @@ -139,8 +139,8 @@ errexit: pop %ds stc xor %bx, %bx - iret - + iret + VARIABLE(grub_machine_mmaphook_mmap_num) .word 0 VARIABLE(grub_machine_mmaphook_kblow) diff --git a/mmap/i386/uppermem.c b/mmap/i386/uppermem.c index 5f6eece0e..cd1a45239 100644 --- a/mmap/i386/uppermem.c +++ b/mmap/i386/uppermem.c @@ -21,7 +21,7 @@ #include #include -grub_uint64_t +grub_uint64_t grub_mmap_get_lower (void) { grub_uint64_t lower = 0; @@ -43,7 +43,7 @@ grub_mmap_get_lower (void) return lower; } -grub_uint64_t +grub_uint64_t grub_mmap_get_upper (void) { grub_uint64_t upper = 0; @@ -64,7 +64,7 @@ grub_mmap_get_upper (void) } /* Count the continuous bytes after 64 MiB. */ -grub_uint64_t +grub_uint64_t grub_mmap_get_post64 (void) { grub_uint64_t post64 = 0; diff --git a/mmap/mmap.c b/mmap/mmap.c index 67f7c7b0b..f2407c0bd 100644 --- a/mmap/mmap.c +++ b/mmap/mmap.c @@ -33,14 +33,14 @@ static int curhandle = 1; #endif grub_err_t -grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, +grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) { /* This function resolves overlapping regions and sorts the memory map. It uses scanline (sweeping) algorithm. */ - /* If same page is used by multiple types it's resolved + /* If same page is used by multiple types it's resolved according to priority: 1 - free memory 2 - memory usable by firmware-aware code @@ -92,11 +92,11 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, /* Number of mmap chunks. */ int mmap_num; -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE struct grub_mmap_region *cur; #endif - - auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, + + auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)), grub_uint64_t size __attribute__ ((unused)), @@ -106,7 +106,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, return 0; } - auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, + auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, grub_uint64_t size, @@ -131,35 +131,35 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, return 0; } - + mmap_num = 0; -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE for (cur = grub_mmap_overlays; cur; cur = cur->next) mmap_num++; #endif grub_machine_mmap_iterate (count_hook); - + /* Initialize variables. */ grub_memset (present, 0, sizeof (present)); - scanline_events = (struct grub_mmap_scan *) + scanline_events = (struct grub_mmap_scan *) grub_malloc (sizeof (struct grub_mmap_scan) * 2 * mmap_num); - + if (! scanline_events) { - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate space for new memory map"); } i = 0; -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE /* Register scanline events. */ for (cur = grub_mmap_overlays; cur; cur = cur->next) { scanline_events[i].pos = cur->start; scanline_events[i].type = 0; - if (cur->type == GRUB_MACHINE_MEMORY_HOLE + if (cur->type == GRUB_MACHINE_MEMORY_HOLE || (cur->type >= 0 && cur->type <= GRUB_MACHINE_MEMORY_MAX_TYPE && priority[cur->type])) scanline_events[i].memtype = cur->type; @@ -176,8 +176,8 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_machine_mmap_iterate (fill_hook); - /* Primitive bubble sort. It has complexity O(n^2) but since we're - unlikely to have more than 100 chunks it's probably one of the + /* Primitive bubble sort. It has complexity O(n^2) but since we're + unlikely to have more than 100 chunks it's probably one of the fastest for one purpose. */ done = 1; while (done) @@ -186,7 +186,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, for (i = 0; i < 2 * mmap_num - 1; i++) if (scanline_events[i + 1].pos < scanline_events[i].pos || (scanline_events[i + 1].pos == scanline_events[i].pos - && scanline_events[i + 1].type == 0 + && scanline_events[i + 1].type == 0 && scanline_events[i].type == 1)) { t = scanline_events[i + 1]; @@ -213,7 +213,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, curtype = k; /* Announce region to the hook if necessary. */ - if ((curtype == -1 || curtype != lasttype) + if ((curtype == -1 || curtype != lasttype) && lastaddr != scanline_events[i].pos && lasttype != -1 && lasttype != GRUB_MACHINE_MEMORY_HOLE @@ -224,7 +224,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, } /* Update last values if necessary. */ - if (curtype == -1 || curtype != lasttype) + if (curtype == -1 || curtype != lasttype) { lasttype = curtype; lastaddr = scanline_events[i].pos; @@ -235,7 +235,7 @@ grub_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, return GRUB_ERR_NONE; } -#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE +#ifndef GRUB_MMAP_REGISTER_BY_FIRMWARE int grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) { @@ -243,11 +243,11 @@ grub_mmap_register (grub_uint64_t start, grub_uint64_t size, int type) grub_dprintf ("mmap", "registering\n"); - cur = (struct grub_mmap_region *) + cur = (struct grub_mmap_region *) grub_malloc (sizeof (struct grub_mmap_region)); if (! cur) { - grub_error (GRUB_ERR_OUT_OF_MEMORY, + grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate memory map overlay"); return 0; } @@ -295,7 +295,7 @@ grub_mmap_unregister (int handle) #define CHUNK_SIZE 0x400 -static inline grub_uint64_t +static inline grub_uint64_t fill_mask (grub_uint64_t addr, grub_uint64_t mask, grub_uint64_t iterator) { int i, j; @@ -324,15 +324,15 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), grub_uint64_t badaddr, badmask; auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); - int NESTED_FUNC_ATTR hook (grub_uint64_t addr, - grub_uint64_t size, + int NESTED_FUNC_ATTR hook (grub_uint64_t addr, + grub_uint64_t size, grub_uint32_t type __attribute__ ((unused))) { grub_uint64_t iterator, low, high, cur; int tail, var; int i; - grub_dprintf ("badram", "hook %llx+%llx\n", (unsigned long long) addr, - (unsigned long long) size); + grub_dprintf ("badram", "hook %llx+%llx\n", (unsigned long long) addr, + (unsigned long long) size); /* How many trailing zeros? */ for (tail = 0; ! (badmask & (1ULL << tail)); tail++); @@ -349,7 +349,7 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), { low = 0; high = ~0ULL; - /* Find starting value. Keep low and high such that + /* Find starting value. Keep low and high such that fill_mask (low) < addr and fill_mask (high) >= addr; */ while (high - low > 1) @@ -364,11 +364,11 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), } for (; iterator < (1ULL << (var - tail)) - && (cur = fill_mask (badaddr, badmask, iterator)) < addr + size; + && (cur = fill_mask (badaddr, badmask, iterator)) < addr + size; iterator++) { - grub_dprintf ("badram", "%llx (size %llx) is a badram range\n", - (long long) cur, (long long) (1ULL << tail) - 1); + grub_dprintf ("badram", "%llx (size %llx) is a badram range\n", + (long long) cur, (long long) (1ULL << tail) - 1); grub_mmap_register (cur, (1ULL << tail) - 1, GRUB_MACHINE_MEMORY_HOLE); } return 0; @@ -401,7 +401,7 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), no point in providing sub-page chunks. */ badmask &= ~(CHUNK_SIZE - 1); - grub_dprintf ("badram", "badram %llx:%llx\n", + grub_dprintf ("badram", "badram %llx:%llx\n", (unsigned long long) badaddr, (unsigned long long) badmask); grub_mmap_iterate (hook); @@ -414,7 +414,7 @@ static grub_command_t cmd; GRUB_MOD_INIT(mmap) { cmd = grub_register_command ("badram", grub_cmd_badram, - "badram ADDR1,MASK1[,ADDR2,MASK2[,...]]", + "badram ADDR1,MASK1[,ADDR2,MASK2[,...]]", "declare memory regions as badram"); } diff --git a/normal/cmdline.c b/normal/cmdline.c index 4ef8890fb..9a07d7d59 100644 --- a/normal/cmdline.c +++ b/normal/cmdline.c @@ -72,7 +72,7 @@ grub_set_history (int newsize) /* Copy the older part. */ grub_memmove (hist_lines, old_hist_lines + hist_pos, (hist_size - hist_pos) * sizeof (char *)); - + /* Copy the newer part. */ grub_memmove (hist_lines + hist_size - hist_pos, old_hist_lines, hist_end * sizeof (char *)); @@ -162,7 +162,7 @@ print_completion (const char *item, grub_completion_type_t type, int count) what = "things"; break; } - + grub_printf ("\nPossible %s are:\n", what); } @@ -199,10 +199,10 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, xpos = (plen + lpos) % 79; ypos = ystart + (plen + lpos) / 79; grub_gotoxy (xpos, ypos); - + grub_refresh (); } - + void cl_print (int pos, int c) { char *p; @@ -212,7 +212,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, if (xpos++ > 78) { grub_putchar ('\n'); - + xpos = 1; if (ypos == (unsigned) (grub_getxy () & 0xFF)) ystart--; @@ -226,7 +226,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, grub_putchar (*p); } } - + void cl_insert (const char *str) { grub_size_t len = grub_strlen (str); @@ -241,7 +241,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, cl_print (lpos - len, echo_char); cl_set_pos (); } - + grub_refresh (); } @@ -256,28 +256,28 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, cl_print (lpos, ' '); lpos = saved_lpos; cl_set_pos (); - + grub_memmove (buf + lpos, buf + lpos + len, llen - lpos + 1); llen -= len; cl_print (lpos, echo_char); cl_set_pos (); } - + grub_refresh (); } - + plen = grub_strlen (prompt); lpos = llen = 0; buf[0] = '\0'; if ((grub_getxy () >> 8) != 0) grub_putchar ('\n'); - + grub_printf (prompt); - + xpos = plen; ystart = ypos = (grub_getxy () & 0xFF); - + cl_insert (cmdline); if (hist_used == 0) @@ -319,18 +319,18 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, { char *insert; int restore; - + /* Backup the next character and make it 0 so it will be easy to use string functions. */ char backup = buf[lpos]; buf[lpos] = '\0'; - + insert = grub_normal_do_completion (buf, &restore, print_completion); /* Restore the original string. */ buf[lpos] = backup; - + if (restore) { /* Restore the prompt. */ @@ -401,7 +401,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, if (lpos > 0) { grub_size_t n = lpos; - + if (kill_buf) grub_free (kill_buf); @@ -440,7 +440,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, else break; /* fall through */ - + case 4: /* Ctrl-d */ if (lpos < llen) cl_delete (1); @@ -474,7 +474,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, grub_history_replace (histpos, buf); grub_history_add (""); } - + grub_memcpy (cmdline, buf + lpos, llen - lpos + 1); return 1; diff --git a/normal/completion.c b/normal/completion.c index 03effd8d6..4b38e334d 100644 --- a/normal/completion.c +++ b/normal/completion.c @@ -69,7 +69,7 @@ add_completion (const char *completion, const char *extra, case 2: if (print_func) print_func (match, type, 0); - + /* Fall through. */ default: @@ -79,7 +79,7 @@ add_completion (const char *completion, const char *extra, if (print_func) print_func (completion, type, num_found - 1); - + /* Detect the matched portion. */ while (*s && *t && *s == *t) { @@ -92,7 +92,7 @@ add_completion (const char *completion, const char *extra, break; } } - + return 0; } @@ -103,7 +103,7 @@ iterate_partition (grub_disk_t disk, const grub_partition_t p) char *partition_name = grub_partition_get_name (p); char *name; int ret; - + if (! partition_name) return 1; @@ -117,7 +117,7 @@ iterate_partition (grub_disk_t disk, const grub_partition_t p) grub_sprintf (name, "%s,%s", disk_name, partition_name); grub_free (partition_name); - + ret = add_completion (name, ")", GRUB_COMPLETION_TYPE_PARTITION); grub_free (name); return ret; @@ -147,7 +147,7 @@ iterate_dir (const char *filename, const struct grub_dirhook_info *info) if (add_completion (fname, "", GRUB_COMPLETION_TYPE_FILE)) return 1; } - + return 0; } @@ -155,10 +155,10 @@ static int iterate_dev (const char *devname) { grub_device_t dev; - + /* Complete the partition part. */ dev = grub_device_open (devname); - + if (dev) { if (dev->disk && dev->disk->has_partitions) @@ -172,7 +172,7 @@ iterate_dev (const char *devname) return 1; } } - + grub_errno = GRUB_ERR_NONE; return 0; } @@ -188,7 +188,7 @@ iterate_command (grub_command_t cmd) return 1; } } - + return 0; } @@ -199,7 +199,7 @@ complete_device (void) /* Check if this is a device or a partition. */ char *p = grub_strchr (++current_word, ','); grub_device_t dev; - + if (! p) { /* Complete the disk part. */ @@ -213,7 +213,7 @@ complete_device (void) dev = grub_device_open (current_word); *p = ','; grub_errno = GRUB_ERR_NONE; - + if (dev) { if (dev->disk && dev->disk->has_partitions) @@ -224,7 +224,7 @@ complete_device (void) return 1; } } - + grub_device_close (dev); } else @@ -244,18 +244,18 @@ complete_file (void) grub_fs_t fs; grub_device_t dev; int ret = 0; - + device = grub_file_get_device_name (current_word); if (grub_errno != GRUB_ERR_NONE) return 1; - + dev = grub_device_open (device); if (! dev) { ret = 1; goto fail; } - + fs = grub_fs_probe (dev); if (! fs) { @@ -268,25 +268,25 @@ complete_file (void) if (dir) { char *dirfile; - + current_word = last_dir + 1; - + dir = grub_strdup (dir); if (! dir) { ret = 1; goto fail; } - + /* Cut away the filename part. */ dirfile = grub_strrchr (dir, '/'); dirfile[1] = '\0'; - + /* Iterate the directory. */ (fs->dir) (dev, dir, iterate_dir); - + grub_free (dir); - + if (grub_errno) { ret = 1; @@ -302,7 +302,7 @@ complete_file (void) ret = 1; goto fail; } - + suffix = ""; num_found = 1; } @@ -323,7 +323,7 @@ complete_arguments (char *command) const struct grub_arg_option *option; char shortarg[] = "- "; - cmd = grub_command_find (command); + cmd = grub_command_find (command); if (!cmd || !(cmd->flags & GRUB_COMMAND_FLAG_EXTCMD)) return 0; @@ -478,13 +478,13 @@ grub_normal_do_completion (char *buf, int *restore, if (num_found == 1) grub_strcat (ret, suffix); - + if (*ret == '\0') { grub_free (ret); goto fail; } - + grub_free (argv[0]); grub_free (match); return ret; diff --git a/normal/datetime.c b/normal/datetime.c index 9e667b79c..44791e18c 100644 --- a/normal/datetime.c +++ b/normal/datetime.c @@ -60,10 +60,10 @@ grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime) { int i; int div; - grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - /* In the period of validity of unixtime all years divisible by 4 + grub_uint8_t months[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; + /* In the period of validity of unixtime all years divisible by 4 are bissextile*/ - /* Convenience: let's have 3 consecutive non-bissextile years + /* Convenience: let's have 3 consecutive non-bissextile years at the beginning of the epoch. So count from 1973 instead of 1970 */ nix -= 3*SECPERYEAR + SECPERDAY; /* Transform C divisions and modulos to mathematical ones */ @@ -85,15 +85,15 @@ grub_unixtime2datetime (grub_int32_t nix, struct grub_datetime *datetime) datetime->year += nix / SECPERYEAR; nix %= SECPERYEAR; } - for (i = 0; i < 12 - && nix >= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 + for (i = 0; i < 12 + && nix >= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 ? 29 : months[i]))*SECPERDAY; i++) - nix -= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 + nix -= ((grub_int32_t) (i==1 && datetime->year % 4 == 0 ? 29 : months[i]))*SECPERDAY; - datetime->month = i + 1; + datetime->month = i + 1; datetime->day = 1 + (nix / SECPERDAY); nix %= SECPERDAY; - datetime->hour = (nix / SECPERHOUR); + datetime->hour = (nix / SECPERHOUR); nix %= SECPERHOUR; datetime->minute = nix / SECPERMIN; datetime->second = nix % SECPERMIN; diff --git a/normal/main.c b/normal/main.c index 9c5a82731..7f6336eeb 100644 --- a/normal/main.c +++ b/normal/main.c @@ -112,7 +112,7 @@ grub_file_getline (grub_file_t file) grub_free (cmdline); cmdline = 0; } - + return cmdline; } @@ -291,7 +291,7 @@ read_config_file (const char *config) { grub_file_t file; grub_parser_t old_parser = 0; - + auto grub_err_t getline (char **line, int cont); grub_err_t getline (char **line, int cont __attribute__ ((unused))) { @@ -406,7 +406,7 @@ grub_normal_execute (const char *config, int nested, int batch) grub_command_execute ("parser.sh", 0, 0); reader_nested = nested; - + if (config) { menu = read_config_file (config); @@ -446,7 +446,7 @@ grub_cmd_normal (struct grub_command *cmd, so that it won't get broken by longjmp. */ static char *config; const char *prefix; - + prefix = grub_env_get ("prefix"); if (prefix) { diff --git a/normal/menu_entry.c b/normal/menu_entry.c index 6ec0d632a..86e581e80 100644 --- a/normal/menu_entry.c +++ b/normal/menu_entry.c @@ -107,7 +107,7 @@ print_line (struct line *linep, int offset, int start, int y) { int i; char *p; - + grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + start + 1, y + GRUB_TERM_FIRST_ENTRY_Y); @@ -130,7 +130,7 @@ static void print_empty_line (int y) { int i; - + grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1, y + GRUB_TERM_FIRST_ENTRY_Y); @@ -144,26 +144,26 @@ print_up (int flag) { grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH, GRUB_TERM_FIRST_ENTRY_Y); - + if (flag) grub_putcode (GRUB_TERM_DISP_UP); else grub_putchar (' '); } - + /* Print a down arrow. */ static void print_down (int flag) { grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_BORDER_WIDTH, GRUB_TERM_TOP_BORDER_Y + GRUB_TERM_NUM_ENTRIES); - + if (flag) grub_putcode (GRUB_TERM_DISP_DOWN); else grub_putchar (' '); } - + /* Draw the lines of the screen SCREEN. */ static void update_screen (struct screen *screen, int region_start, int region_column, @@ -174,7 +174,7 @@ update_screen (struct screen *screen, int region_start, int region_column, int y; int i; struct line *linep; - + /* Check if scrolling is necessary. */ if (screen->y < 0 || screen->y >= GRUB_TERM_NUM_ENTRIES) { @@ -182,7 +182,7 @@ update_screen (struct screen *screen, int region_start, int region_column, screen->y = 0; else screen->y = GRUB_TERM_NUM_ENTRIES - 1; - + region_start = 0; region_column = 0; up = 1; @@ -203,21 +203,21 @@ update_screen (struct screen *screen, int region_start, int region_column, linep--; y -= get_logical_num_lines (linep); } - + if (y < 0 || i > 0) up_flag = 1; - + do { int column; - + for (column = 0; column <= linep->len && y < GRUB_TERM_NUM_ENTRIES; column += GRUB_TERM_ENTRY_WIDTH, y++) { if (y < 0) continue; - + if (i == region_start) { if (region_column >= column @@ -229,34 +229,34 @@ update_screen (struct screen *screen, int region_start, int region_column, else if (i > region_start && mode == ALL_LINES) print_line (linep, column, 0, y); } - + if (y == GRUB_TERM_NUM_ENTRIES) { if (column <= linep->len || i + 1 < screen->num_lines) down_flag = 1; } - + linep++; i++; if (mode == ALL_LINES && i == screen->num_lines) for (; y < GRUB_TERM_NUM_ENTRIES; y++) print_empty_line (y); - + } while (y < GRUB_TERM_NUM_ENTRIES); - + /* Draw up and down arrows. */ if (up) print_up (up_flag); if (down) print_down (down_flag); } - + /* Place the cursor. */ grub_gotoxy (GRUB_TERM_LEFT_BORDER_X + GRUB_TERM_MARGIN + 1 + screen->x, GRUB_TERM_FIRST_ENTRY_Y + screen->y); - + grub_refresh (); } @@ -278,7 +278,7 @@ insert_string (struct screen *screen, char *s, int update) struct line *current_linep; struct line *next_linep; int size; - + /* Make a new line. */ screen->num_lines++; screen->lines = grub_realloc (screen->lines, @@ -295,15 +295,15 @@ insert_string (struct screen *screen, char *s, int update) if (! init_line (screen->lines + screen->line + 1)) return 0; - + /* Fold the line. */ current_linep = screen->lines + screen->line; next_linep = current_linep + 1; size = current_linep->len - screen->column; - + if (! ensure_space (next_linep, size)) return 0; - + grub_memmove (next_linep->buf, current_linep->buf + screen->column, size); @@ -319,7 +319,7 @@ insert_string (struct screen *screen, char *s, int update) mode = ALL_LINES; down = 1; /* XXX not optimal. */ - + /* Move the cursor. */ screen->column = screen->real_column = 0; screen->line++; @@ -363,7 +363,7 @@ insert_string (struct screen *screen, char *s, int update) region_start = screen->line; region_column = screen->column; } - + if (orig_num != new_num) { mode = ALL_LINES; @@ -378,14 +378,14 @@ insert_string (struct screen *screen, char *s, int update) screen->x += size; screen->y += screen->x / GRUB_TERM_ENTRY_WIDTH; screen->x %= GRUB_TERM_ENTRY_WIDTH; - + s = p; } } if (update) update_screen (screen, region_start, region_column, 0, down, mode); - + return 1; } @@ -399,7 +399,7 @@ destroy_screen (struct screen *screen) for (i = 0; i < screen->num_lines; i++) { struct line *linep = screen->lines + i; - + if (linep) grub_free (linep->buf); } @@ -456,7 +456,7 @@ static int forward_char (struct screen *screen, int update) { struct line *linep; - + linep = screen->lines + screen->line; if (screen->column < linep->len) { @@ -499,7 +499,7 @@ backward_char (struct screen *screen, int update) else if (screen->line > 0) { struct line *linep; - + screen->line--; linep = screen->lines + screen->line; screen->column = linep->len; @@ -511,7 +511,7 @@ backward_char (struct screen *screen, int update) if (update) update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE); - + return 1; } @@ -522,24 +522,24 @@ previous_line (struct screen *screen, int update) { struct line *linep; int dy; - + /* How many physical lines from the current position to the first physical line? */ dy = screen->column / GRUB_TERM_ENTRY_WIDTH; - + screen->line--; - + linep = screen->lines + screen->line; if (linep->len < screen->real_column) screen->column = linep->len; else screen->column = screen->real_column; - + /* How many physical lines from the current position to the last physical line? */ dy += (linep->len / GRUB_TERM_ENTRY_WIDTH - screen->column / GRUB_TERM_ENTRY_WIDTH); - + screen->y -= dy + 1; screen->x = screen->column % GRUB_TERM_ENTRY_WIDTH; } @@ -552,7 +552,7 @@ previous_line (struct screen *screen, int update) if (update) update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE); - + return 1; } @@ -563,25 +563,25 @@ next_line (struct screen *screen, int update) { struct line *linep; int dy; - + /* How many physical lines from the current position to the last physical line? */ linep = screen->lines + screen->line; dy = (linep->len / GRUB_TERM_ENTRY_WIDTH - screen->column / GRUB_TERM_ENTRY_WIDTH); - + screen->line++; - + linep++; if (linep->len < screen->real_column) screen->column = linep->len; else screen->column = screen->real_column; - + /* How many physical lines from the current position to the first physical line? */ dy += screen->column / GRUB_TERM_ENTRY_WIDTH; - + screen->y += dy + 1; screen->x = screen->column % GRUB_TERM_ENTRY_WIDTH; } @@ -598,7 +598,7 @@ next_line (struct screen *screen, int update) if (update) update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE); - + return 1; } @@ -611,7 +611,7 @@ beginning_of_line (struct screen *screen, int update) if (update) update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE); - + return 1; } @@ -619,7 +619,7 @@ static int end_of_line (struct screen *screen, int update) { struct line *linep; - + linep = screen->lines + screen->line; screen->y += (linep->len / GRUB_TERM_ENTRY_WIDTH - screen->column / GRUB_TERM_ENTRY_WIDTH); @@ -628,7 +628,7 @@ end_of_line (struct screen *screen, int update) if (update) update_screen (screen, screen->num_lines, 0, 0, 0, NO_LINE); - + return 1; } @@ -640,14 +640,14 @@ delete_char (struct screen *screen, int update) int start = screen->num_lines; int column = 0; int down = 0; - + linep = screen->lines + screen->line; if (linep->len > screen->column) { int orig_num, new_num; orig_num = get_logical_num_lines (linep); - + grub_memmove (linep->buf + screen->column, linep->buf + screen->column + 1, linep->len - screen->column - 1); @@ -680,7 +680,7 @@ delete_char (struct screen *screen, int update) (screen->num_lines - screen->line - 2) * sizeof (struct line)); screen->num_lines--; - + mode = ALL_LINES; start = screen->line; column = screen->column; @@ -703,7 +703,7 @@ backward_delete_char (struct screen *screen, int update) saved_column = screen->column; saved_line = screen->line; - + if (! backward_char (screen, 0)) return 0; @@ -721,25 +721,25 @@ kill_line (struct screen *screen, int continuous, int update) char *p; int size; int offset; - + p = screen->killed_text; if (! continuous && p) p[0] = '\0'; - + linep = screen->lines + screen->line; size = linep->len - screen->column; - + if (p) offset = grub_strlen (p); else offset = 0; - + if (size > 0) { enum update_mode mode = SINGLE_LINE; int down = 0; int orig_num, new_num; - + p = grub_realloc (p, offset + size + 1); if (! p) return 0; @@ -748,7 +748,7 @@ kill_line (struct screen *screen, int continuous, int update) p[offset + size - 1] = '\0'; screen->killed_text = p; - + orig_num = get_logical_num_lines (linep); linep->len = screen->column; new_num = get_logical_num_lines (linep); @@ -772,10 +772,10 @@ kill_line (struct screen *screen, int continuous, int update) p[offset + 1] = '\0'; screen->killed_text = p; - + return delete_char (screen, update); } - + return 1; } @@ -792,7 +792,7 @@ static int open_line (struct screen *screen, int update) { int saved_y = screen->y; - + if (! insert_string (screen, "\n", 0)) return 0; @@ -812,7 +812,7 @@ static void store_completion (const char *item, grub_completion_type_t type, int count) { char *p; - + if (count == 0) { /* If this is the first time, print a label. */ @@ -839,7 +839,7 @@ store_completion (const char *item, grub_completion_type_t type, int count) what = "things"; break; } - + grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); grub_printf (" Possible %s are:\n ", what); } @@ -849,7 +849,7 @@ store_completion (const char *item, grub_completion_type_t type, int count) + (int) grub_strlen (item) + 1 + 1)) { grub_size_t new_len; - + new_len = completion_buffer.len + grub_strlen (item) + 80; p = grub_realloc (completion_buffer.buf, new_len); if (! p) @@ -887,10 +887,10 @@ complete (struct screen *screen, int continuous, int update) count++; else count = 0; - + pos = grub_getxy (); grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); - + completion_buffer.buf = 0; completion_buffer.len = 0; completion_buffer.max_len = 0; @@ -902,13 +902,13 @@ complete (struct screen *screen, int continuous, int update) insert = grub_normal_do_completion (linep->buf, &restore, store_completion); linep->buf[screen->column] = saved_char; - + if (restore) { char *p = completion_buffer.buf; screen->completion_shown = 1; - + if (p) { int num_sections = ((completion_buffer.len + GRUB_TERM_WIDTH - 8 - 1) @@ -922,17 +922,17 @@ complete (struct screen *screen, int continuous, int update) grub_putcode (GRUB_TERM_DISP_LEFT); else grub_putchar (' '); - + while (*p && p < endp) grub_putchar (*p++); - + if (*p) grub_putcode (GRUB_TERM_DISP_RIGHT); } } grub_gotoxy (pos >> 8, pos & 0xFF); - + if (insert) { insert_string (screen, insert, update); @@ -941,7 +941,7 @@ complete (struct screen *screen, int continuous, int update) } else if (update) grub_refresh (); - + grub_free (completion_buffer.buf); return 1; } @@ -952,17 +952,17 @@ clear_completions (void) { grub_uint16_t pos; int i, j; - + pos = grub_getxy (); grub_gotoxy (0, GRUB_TERM_HEIGHT - 3); - + for (i = 0; i < 2; i++) { for (j = 0; j < GRUB_TERM_WIDTH - 1; j++) grub_putchar (' '); grub_putchar ('\n'); } - + grub_gotoxy (pos >> 8, pos & 0xFF); grub_refresh (); } @@ -1000,7 +1000,7 @@ run (struct screen *screen) currline++; return 0; } - + grub_cls (); grub_printf (" Booting a command list\n\n"); @@ -1033,7 +1033,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) { struct screen *screen; int prev_c; - + screen = make_screen (entry); if (! screen) return; @@ -1044,7 +1044,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) update_screen (screen, 0, 0, 1, 1, ALL_LINES); grub_setcursor (1); prev_c = '\0'; - + while (1) { int c = GRUB_TERM_ASCII_CHAR (grub_getkey ()); @@ -1054,7 +1054,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) clear_completions (); screen->completion_shown = 0; } - + switch (c) { case 16: /* C-p */ @@ -1071,7 +1071,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) if (! forward_char (screen, 1)) goto fail; break; - + case 2: /* C-b */ if (! backward_char (screen, 1)) goto fail; @@ -1086,12 +1086,12 @@ grub_menu_entry_run (grub_menu_entry_t entry) if (! end_of_line (screen, 1)) goto fail; break; - + case '\t': /* C-i */ if (! complete (screen, prev_c == c, 1)) goto fail; break; - + case 4: /* C-d */ if (! delete_char (screen, 1)) goto fail; @@ -1101,16 +1101,16 @@ grub_menu_entry_run (grub_menu_entry_t entry) if (! backward_delete_char (screen, 1)) goto fail; break; - + case 11: /* C-k */ if (! kill_line (screen, prev_c == c, 1)) goto fail; break; - + case 21: /* C-u */ /* FIXME: What behavior is good for this key? */ break; - + case 25: /* C-y */ if (! yank (screen, 1)) goto fail; @@ -1119,7 +1119,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) case 12: /* C-l */ /* FIXME: centering. */ goto refresh; - + case 15: /* C-o */ if (! open_line (screen, 1)) goto fail; @@ -1134,11 +1134,11 @@ grub_menu_entry_run (grub_menu_entry_t entry) case '\e': destroy_screen (screen); return; - + case 3: /* C-c */ grub_cmdline_run (1); goto refresh; - + case 24: /* C-x */ if (! run (screen)) goto fail; @@ -1149,7 +1149,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) case 20: /* C-t */ /* FIXME */ break; - + default: if (grub_isprint (c)) { @@ -1168,7 +1168,7 @@ grub_menu_entry_run (grub_menu_entry_t entry) fail: destroy_screen (screen); - + grub_cls (); grub_print_error (); grub_errno = GRUB_ERR_NONE; diff --git a/normal/menu_viewer.c b/normal/menu_viewer.c index f7047c7fc..37d317b0b 100644 --- a/normal/menu_viewer.c +++ b/normal/menu_viewer.c @@ -55,7 +55,7 @@ grub_err_t grub_menu_viewer_show_menu (grub_menu_t menu, int nested) { grub_menu_viewer_t cur = get_current_menu_viewer (); - if (!cur) + if (!cur) return grub_error (GRUB_ERR_BAD_ARGUMENT, "No menu viewer available."); return cur->show_menu (menu, nested); diff --git a/normal/misc.c b/normal/misc.c index bf677db7f..0a1a2f052 100644 --- a/normal/misc.c +++ b/normal/misc.c @@ -37,7 +37,7 @@ grub_normal_print_device_info (const char *name) grub_printf ("\tPartition %s: ", name); else grub_printf ("Device %s: ", name); - + dev = grub_device_open (name); if (! dev) grub_printf ("Filesystem cannot be accessed"); @@ -98,7 +98,7 @@ grub_normal_print_device_info (const char *name) grub_printf ("Unknown filesystem"); else grub_printf ("Partition table"); - + grub_device_close (dev); } diff --git a/partmap/acorn.c b/partmap/acorn.c index a861eb0ea..42fd61f4a 100644 --- a/partmap/acorn.c +++ b/partmap/acorn.c @@ -140,7 +140,7 @@ acorn_partition_map_probe (grub_disk_t disk, const char *str) grub_disk_addr_t sector; grub_err_t err; grub_partition_t p; - + /* Enforce raw disk access. */ raw.partition = 0; diff --git a/partmap/amiga.c b/partmap/amiga.c index 81d95373c..ffb807f5a 100644 --- a/partmap/amiga.c +++ b/partmap/amiga.c @@ -35,7 +35,7 @@ struct grub_amiga_rdsk grub_uint32_t badblcklst; grub_uint32_t partitionlst; grub_uint32_t fslst; - + /* The other information is not important for us. */ } __attribute__ ((packed)); @@ -61,7 +61,7 @@ struct grub_amiga_partition grub_uint32_t unused5[3]; grub_uint32_t lowcyl; grub_uint32_t highcyl; - + grub_uint32_t firstcyl; } __attribute__ ((packed)); @@ -80,18 +80,18 @@ amiga_partition_map_iterate (grub_disk_t disk, int partno = 0; int next = -1; unsigned pos; - + /* Enforce raw disk access. */ raw = *disk; raw.partition = 0; - + /* The RDSK block is one of the first 15 blocks. */ for (pos = 0; pos < 15; pos++) { /* Read the RDSK block which is a descriptor for the entire disk. */ if (grub_disk_read (&raw, pos, 0, sizeof (rdsk), &rdsk)) return grub_errno; - + if (grub_strcmp ((char *) rdsk.magic, "RDSK") == 0) { /* Found the first PART block. */ @@ -103,36 +103,36 @@ amiga_partition_map_iterate (grub_disk_t disk, if (next == -1) return grub_error (GRUB_ERR_BAD_PART_TABLE, "Amiga partition map not found."); - + /* The end of the partition list is marked using "-1". */ while (next != -1) { struct grub_amiga_partition apart; - + /* Read the RDSK block which is a descriptor for the entire disk. */ if (grub_disk_read (&raw, next, 0, sizeof (apart), &apart)) return grub_errno; - + /* Calculate the first block and the size of the partition. */ - part.start = (grub_be_to_cpu32 (apart.lowcyl) + part.start = (grub_be_to_cpu32 (apart.lowcyl) * grub_be_to_cpu32 (apart.heads) * grub_be_to_cpu32 (apart.block_per_track)); part.len = ((grub_be_to_cpu32 (apart.highcyl) - grub_be_to_cpu32 (apart.lowcyl) + 1) * grub_be_to_cpu32 (apart.heads) * grub_be_to_cpu32 (apart.block_per_track)); - + part.offset = (grub_off_t) next * 512; part.index = partno; part.partmap = &grub_amiga_partition_map; - + if (hook (disk, &part)) return grub_errno; - + next = grub_be_to_cpu32 (apart.next); partno++; } - + return 0; } @@ -145,7 +145,7 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str) char *s = (char *) str; auto int find_func (grub_disk_t d, const grub_partition_t partition); - + int find_func (grub_disk_t d __attribute__ ((unused)), const grub_partition_t partition) { @@ -154,14 +154,14 @@ amiga_partition_map_probe (grub_disk_t disk, const char *str) p = (grub_partition_t) grub_malloc (sizeof (*p)); if (! p) return 1; - + grub_memcpy (p, partition, sizeof (*p)); return 1; } - + return 0; } - + /* Get the partition number. */ partnum = grub_strtoul (s, 0, 10) - 1; if (grub_errno) diff --git a/partmap/apple.c b/partmap/apple.c index 6d83f7bf3..fce2f2c5f 100644 --- a/partmap/apple.c +++ b/partmap/apple.c @@ -76,7 +76,7 @@ struct grub_apple_part /* Reserved. */ grub_uint32_t reserved2; - + /* The entry point of the bootcode. */ grub_uint32_t bootcode_entrypoint; @@ -181,7 +181,7 @@ apple_partition_map_probe (grub_disk_t disk, const char *str) char *s = (char *) str; auto int find_func (grub_disk_t d, const grub_partition_t partition); - + int find_func (grub_disk_t d __attribute__ ((unused)), const grub_partition_t partition) { @@ -190,14 +190,14 @@ apple_partition_map_probe (grub_disk_t disk, const char *str) p = (grub_partition_t) grub_malloc (sizeof (*p)); if (! p) return 1; - + grub_memcpy (p, partition, sizeof (*p)); return 1; } - + return 0; } - + /* Get the partition number. */ partnum = grub_strtoul (s, 0, 10) - 1; if (grub_errno) @@ -205,7 +205,7 @@ apple_partition_map_probe (grub_disk_t disk, const char *str) grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition"); return 0; } - + if (apple_partition_map_iterate (disk, find_func)) goto fail; diff --git a/partmap/gpt.c b/partmap/gpt.c index 5c89e35b3..d646d41b8 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -122,7 +122,7 @@ gpt_partition_map_probe (grub_disk_t disk, const char *str) char *s = (char *) str; auto int find_func (grub_disk_t d, const grub_partition_t partition); - + int find_func (grub_disk_t d __attribute__ ((unused)), const grub_partition_t partition) { @@ -131,14 +131,14 @@ gpt_partition_map_probe (grub_disk_t disk, const char *str) p = (grub_partition_t) grub_malloc (sizeof (*p)); if (! p) return 1; - + grub_memcpy (p, partition, sizeof (*p)); return 1; } - + return 0; } - + /* Get the partition number. */ partnum = grub_strtoul (s, 0, 10) - 1; if (grub_errno) diff --git a/partmap/pc.c b/partmap/pc.c index 1a110b240..6f68ecf93 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -33,27 +33,27 @@ grub_partition_parse (const char *str) { grub_partition_t p; struct grub_pc_partition *pcdata; - + char *s = (char *) str; - + p = (grub_partition_t) grub_malloc (sizeof (*p)); if (! p) return 0; - + pcdata = (struct grub_pc_partition *) grub_malloc (sizeof (*pcdata)); if (! pcdata) goto fail; - + p->data = pcdata; p->partmap = &grub_pc_partition_map; - + /* Initialize some of the fields with invalid values. */ pcdata->bsd_part = pcdata->dos_type = pcdata->bsd_type = p->index = -1; /* Get the DOS partition number. The number is counted from one for the user interface, and from zero internally. */ pcdata->dos_part = grub_strtoul (s, &s, 0) - 1; - + if (grub_errno) { /* Not found. Maybe only a BSD label is specified. */ @@ -79,7 +79,7 @@ grub_partition_parse (const char *str) goto fail; return p; - + fail: grub_free (p); grub_free (pcdata); @@ -101,18 +101,18 @@ pc_partition_map_iterate (grub_disk_t disk, /* Enforce raw disk access. */ raw = *disk; raw.partition = 0; - + p.offset = 0; pcdata.ext_offset = 0; pcdata.dos_part = -1; p.data = &pcdata; p.partmap = &grub_pc_partition_map; - + while (1) { int i; struct grub_pc_partition_entry *e; - + /* Read the MBR. */ if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr)) goto finish; @@ -125,7 +125,7 @@ pc_partition_map_iterate (grub_disk_t disk, for (p.index = 0; p.index < 4; p.index++) { e = mbr.entries + p.index; - + p.start = p.offset + grub_le_to_cpu32 (e->start); p.len = grub_le_to_cpu32 (e->length); pcdata.bsd_part = -1; @@ -147,7 +147,7 @@ pc_partition_map_iterate (grub_disk_t disk, && ! grub_pc_partition_is_extended (e->type)) { pcdata.dos_part++; - + if (hook (disk, &p)) return 1; @@ -188,7 +188,7 @@ pc_partition_map_iterate (grub_disk_t disk, p.start = grub_le_to_cpu32 (be->offset); p.len = grub_le_to_cpu32 (be->size); pcdata.bsd_type = be->fs_type; - + if (be->fs_type != GRUB_PC_PARTITION_BSD_TYPE_UNUSED) if (hook (disk, &p)) return 1; @@ -205,7 +205,7 @@ pc_partition_map_iterate (grub_disk_t disk, for (i = 0; i < 4; i++) { e = mbr.entries + i; - + if (grub_pc_partition_is_extended (e->type)) { p.offset = pcdata.ext_offset + grub_le_to_cpu32 (e->start); @@ -231,7 +231,7 @@ pc_partition_map_probe (grub_disk_t disk, const char *str) { grub_partition_t p; struct grub_pc_partition *pcdata; - + auto int find_func (grub_disk_t d, const grub_partition_t partition); int find_func (grub_disk_t d __attribute__ ((unused)), @@ -247,14 +247,14 @@ pc_partition_map_probe (grub_disk_t disk, const char *str) grub_memcpy (pcdata, partdata, sizeof (*pcdata)); return 1; } - + return 0; } - + p = grub_partition_parse (str); if (! p) return 0; - + pcdata = p->data; pc_partition_map_iterate (disk, find_func); if (grub_errno) @@ -280,7 +280,7 @@ pc_partition_map_get_name (const grub_partition_t p) { char *name; struct grub_pc_partition *pcdata = p->data; - + name = grub_malloc (13); if (! name) return 0; diff --git a/partmap/sun.c b/partmap/sun.c index 8598534e8..60947774f 100644 --- a/partmap/sun.c +++ b/partmap/sun.c @@ -73,12 +73,12 @@ grub_sun_is_valid (struct grub_sun_block *label) { grub_uint16_t *pos; grub_uint16_t sum = 0; - + for (pos = (grub_uint16_t *) label; pos < (grub_uint16_t *) (label + 1); pos++) sum ^= *pos; - + return ! sum; } @@ -91,10 +91,10 @@ sun_partition_map_iterate (grub_disk_t disk, struct grub_disk raw; struct grub_sun_block block; int partnum; - + raw = *disk; raw.partition = 0; - + p = (grub_partition_t) grub_malloc (sizeof (struct grub_partition)); if (! p) return grub_errno; @@ -107,16 +107,16 @@ sun_partition_map_iterate (grub_disk_t disk, { if (GRUB_PARTMAP_SUN_MAGIC != grub_be_to_cpu16 (block.magic)) grub_error (GRUB_ERR_BAD_PART_TABLE, "not a sun partition table"); - + if (! grub_sun_is_valid (&block)) grub_error (GRUB_ERR_BAD_PART_TABLE, "invalid checksum"); - + /* Maybe another error value would be better, because partition table _is_ recognized but invalid. */ for (partnum = 0; partnum < GRUB_PARTMAP_SUN_MAX_PARTS; partnum++) { struct grub_sun_partition_descriptor *desc; - + if (block.infos[partnum].id == 0 || block.infos[partnum].id == GRUB_PARTMAP_SUN_WHOLE_DISK_ID) continue; @@ -134,7 +134,7 @@ sun_partition_map_iterate (grub_disk_t disk, } } } - + grub_free (p); return grub_errno; @@ -148,7 +148,7 @@ sun_partition_map_probe (grub_disk_t disk, const char *str) char *s = (char *) str; auto int find_func (grub_disk_t d, const grub_partition_t partition); - + int find_func (grub_disk_t d __attribute__ ((unused)), const grub_partition_t partition) { @@ -157,10 +157,10 @@ sun_partition_map_probe (grub_disk_t disk, const char *str) p = (grub_partition_t) grub_malloc (sizeof (*p)); if (p) grub_memcpy (p, partition, sizeof (*p)); - + return 1; } - + return 0; } @@ -179,7 +179,7 @@ sun_partition_map_probe (grub_disk_t disk, const char *str) grub_error (GRUB_ERR_BAD_FILENAME, "invalid partition"); p = 0; } - + return p; } @@ -187,11 +187,11 @@ static char * sun_partition_map_get_name (const grub_partition_t p) { char *name; - + name = grub_malloc (13); if (name) grub_sprintf (name, "%d", p->index + 1); - + return name; } diff --git a/parttool/pcpart.c b/parttool/pcpart.c index c37a40111..6876d0d58 100644 --- a/parttool/pcpart.c +++ b/parttool/pcpart.c @@ -37,7 +37,7 @@ static struct grub_parttool_argdesc grub_pcpart_bootargs[] = {0, 0, 0} }; -static grub_err_t grub_pcpart_boot (const grub_device_t dev, +static grub_err_t grub_pcpart_boot (const grub_device_t dev, const struct grub_parttool_args *args) { int i, index; @@ -86,7 +86,7 @@ static struct grub_parttool_argdesc grub_pcpart_typeargs[] = {0, 0, 0} }; -static grub_err_t grub_pcpart_type (const grub_device_t dev, +static grub_err_t grub_pcpart_type (const grub_device_t dev, const struct grub_parttool_args *args) { int index; @@ -99,7 +99,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, dev->disk->partition = 0; /* Read the parttable. */ - if (grub_disk_read (dev->disk, part->offset, 0, + if (grub_disk_read (dev->disk, part->offset, 0, sizeof (mbr), &mbr)) { dev->disk->partition = part; @@ -119,7 +119,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG; } - if (grub_pc_partition_is_empty (type) + if (grub_pc_partition_is_empty (type) || grub_pc_partition_is_extended (type)) { dev->disk->partition = part; @@ -130,7 +130,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, grub_printf ("Setting partition type to 0x%x\n", type); /* Write the parttable. */ - grub_disk_write (dev->disk, part->offset, 0, + grub_disk_write (dev->disk, part->offset, 0, sizeof (mbr), &mbr); dev->disk->partition = part; @@ -140,13 +140,13 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, GRUB_MOD_INIT (pcpart) { - activate_table_handle = grub_parttool_register ("pc_partition_map", + activate_table_handle = grub_parttool_register ("pc_partition_map", grub_pcpart_boot, grub_pcpart_bootargs); - type_table_handle = grub_parttool_register ("pc_partition_map", + type_table_handle = grub_parttool_register ("pc_partition_map", grub_pcpart_type, grub_pcpart_typeargs); - + } GRUB_MOD_FINI(pcpart) { diff --git a/script/sh/function.c b/script/sh/function.c index dc411cc1f..1e49c709f 100644 --- a/script/sh/function.c +++ b/script/sh/function.c @@ -24,7 +24,7 @@ static grub_script_function_t grub_script_function_list; grub_script_function_t -grub_script_function_create (struct grub_script_arg *functionname_arg, +grub_script_function_create (struct grub_script_arg *functionname_arg, struct grub_script *cmd) { grub_script_function_t func; diff --git a/script/sh/lexer.c b/script/sh/lexer.c index 3ec78278d..aa8ac35aa 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -157,7 +157,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) for (;! state->done && (*state->script || firstrun); firstrun = 0) { - + if (! *state->script) { /* Check if more tokens are requested by the parser. */ @@ -200,7 +200,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) } newstate = grub_parser_cmdline_state (state->state, *state->script, &use); - + /* Check if it is a text. */ if (check_textstate (newstate)) { @@ -253,19 +253,19 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) buffer = grub_script_malloc (parsestate, 2048); if (! buffer) return 0; - + bp = buffer; - + /* Read one token, possible quoted. */ while (*state->script) { newstate = grub_parser_cmdline_state (state->state, *state->script, &use); - + /* Check if a variable name starts. */ if (check_varstate (newstate)) break; - + /* If the string is not quoted or escaped, stop processing when a special token was found. It will be recognized next time when this function is called. */ @@ -273,7 +273,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) && state->state != GRUB_PARSER_STATE_ESC) { int breakout = 0; - + switch (use) { case ' ': @@ -290,7 +290,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) } else if (use) *(bp++) = use; - + state->state = newstate; nextchar (state); } @@ -300,7 +300,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) grub_dprintf ("scripting", "token=`%s'\n", buffer); yylval->arg = grub_script_arg_add (parsestate, yylval->arg, GRUB_SCRIPT_ARG_TYPE_STR, buffer); - + } else if (newstate == GRUB_PARSER_STATE_VAR || newstate == GRUB_PARSER_STATE_QVAR) @@ -309,15 +309,15 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) buffer = grub_script_malloc (parsestate, 2096); if (! buffer) return 0; - + bp = buffer; - + /* This is a variable, read the variable name. */ while (*state->script) { newstate = grub_parser_cmdline_state (state->state, *state->script, &use); - + /* Check if this character is not part of the variable name anymore. */ if (! (check_varstate (newstate))) @@ -328,18 +328,18 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) state->state = newstate; break; } - + if (use) *(bp++) = use; nextchar (state); state->state = newstate; } - + *bp = '\0'; state->state = newstate; yylval->arg = grub_script_arg_add (parsestate, yylval->arg, GRUB_SCRIPT_ARG_TYPE_VAR, buffer); - grub_dprintf ("scripting", "vartoken=`%s'\n", buffer); + grub_dprintf ("scripting", "vartoken=`%s'\n", buffer); } else { @@ -349,7 +349,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) return 0; } } - + if (yylval->arg == 0) { int token = state->tokenonhold; diff --git a/term/efi/console.c b/term/efi/console.c index 3322b8f70..f3845089c 100644 --- a/term/efi/console.c +++ b/term/efi/console.c @@ -89,9 +89,9 @@ grub_console_putchar (grub_uint32_t c) { grub_efi_char16_t str[2]; grub_efi_simple_text_output_interface_t *o; - + o = grub_efi_system_table->con_out; - + /* For now, do not try to use a surrogate pair. */ if (c > 0xffff) c = '?'; @@ -102,7 +102,7 @@ grub_console_putchar (grub_uint32_t c) /* Should this test be cached? */ if (c > 0x7f && efi_call_2 (o->test_string, o, str) != GRUB_EFI_SUCCESS) return; - + efi_call_2 (o->output_string, o, str); } @@ -119,7 +119,7 @@ grub_console_checkkey (void) grub_efi_simple_input_interface_t *i; grub_efi_input_key_t key; grub_efi_status_t status; - + if (read_key >= 0) return 1; @@ -131,7 +131,7 @@ grub_console_checkkey (void) case GRUB_EFI_SUCCESS: { grub_uint16_t xy; - + xy = grub_getxy (); grub_gotoxy (0, 0); grub_printf ("scan_code=%x,unicode_char=%x ", @@ -150,7 +150,7 @@ grub_console_checkkey (void) break; } #endif - + if (status == GRUB_EFI_SUCCESS) { switch (key.scan_code) @@ -229,11 +229,11 @@ grub_console_getkey (void) status = efi_call_3 (b->wait_for_event, 1, &(i->wait_for_key), &index); if (status != GRUB_EFI_SUCCESS) return -1; - + grub_console_checkkey (); } while (read_key < 0); - + key = read_key; read_key = -1; return key; @@ -244,7 +244,7 @@ grub_console_getwh (void) { grub_efi_simple_text_output_interface_t *o; grub_efi_uintn_t columns, rows; - + o = grub_efi_system_table->con_out; if (efi_call_4 (o->query_mode, o, o->mode->mode, &columns, &rows) != GRUB_EFI_SUCCESS) { @@ -260,7 +260,7 @@ static grub_uint16_t grub_console_getxy (void) { grub_efi_simple_text_output_interface_t *o; - + o = grub_efi_system_table->con_out; return ((o->mode->cursor_column << 8) | o->mode->cursor_row); } @@ -269,7 +269,7 @@ static void grub_console_gotoxy (grub_uint8_t x, grub_uint8_t y) { grub_efi_simple_text_output_interface_t *o; - + o = grub_efi_system_table->con_out; efi_call_3 (o->set_cursor_position, o, x, y); } @@ -279,7 +279,7 @@ grub_console_cls (void) { grub_efi_simple_text_output_interface_t *o; grub_efi_int32_t orig_attr; - + o = grub_efi_system_table->con_out; orig_attr = o->mode->attribute; efi_call_2 (o->set_attributes, o, GRUB_EFI_BACKGROUND_BLACK); diff --git a/term/gfxterm.c b/term/gfxterm.c index 5da678846..ef93bb70f 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -91,7 +91,7 @@ struct grub_virtual_screen grub_uint8_t normal_color_setting; grub_uint8_t highlight_color_setting; grub_uint8_t term_color; - + /* Color settings. */ grub_video_color_t fg_color; grub_video_color_t bg_color; @@ -117,7 +117,7 @@ static void dirty_region_reset (void); static int dirty_region_is_empty (void); -static void dirty_region_add (int x, int y, +static void dirty_region_add (int x, int y, unsigned int width, unsigned int height); static unsigned int calculate_normal_character_width (grub_font_t font); @@ -135,12 +135,12 @@ set_term_color (grub_uint8_t term_color) /* Map terminal color to text layer compatible video colors. */ virtual_screen.fg_color = grub_video_map_color(term_color & 0x0f); - + /* Special case: use black as transparent color. */ if (((term_color >> 4) & 0x0f) == 0) { virtual_screen.bg_color = grub_video_map_rgba(0, 0, 0, 0); - } + } else { virtual_screen.bg_color = grub_video_map_color((term_color >> 4) & 0x0f); @@ -218,9 +218,9 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, virtual_screen.standard_color_setting = DEFAULT_STANDARD_COLOR; virtual_screen.normal_color_setting = DEFAULT_NORMAL_COLOR; virtual_screen.highlight_color_setting = DEFAULT_HIGHLIGHT_COLOR; - + virtual_screen.term_color = virtual_screen.normal_color_setting; - + set_term_color (virtual_screen.term_color); grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); @@ -256,7 +256,7 @@ grub_gfxterm_init (void) err = grub_video_set_mode (DEFAULT_VIDEO_MODE, video_hook); else { - tmp = grub_malloc (grub_strlen (modevar) + tmp = grub_malloc (grub_strlen (modevar) + sizeof (DEFAULT_VIDEO_MODE) + 1); grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); err = grub_video_set_mode (tmp, video_hook); @@ -312,7 +312,7 @@ grub_gfxterm_fini (void) } static void -redraw_screen_rect (unsigned int x, unsigned int y, +redraw_screen_rect (unsigned int x, unsigned int y, unsigned int width, unsigned int height) { grub_video_color_t color; @@ -323,11 +323,11 @@ redraw_screen_rect (unsigned int x, unsigned int y, if (bitmap) { /* Render bitmap as background. */ - grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_REPLACE, x, y, + grub_video_blit_bitmap (bitmap, GRUB_VIDEO_BLIT_REPLACE, x, y, x, y, width, height); - - /* If bitmap is smaller than requested blit area, use background + + /* If bitmap is smaller than requested blit area, use background color. */ color = virtual_screen.bg_color; @@ -342,27 +342,27 @@ redraw_screen_rect (unsigned int x, unsigned int y, { h = bitmap_height - y; } - + if (bitmap_width > tx) { tx = bitmap_width; } - + /* Render background layer. */ grub_video_fill_rect (color, tx, y, w, h); } - + /* Fill bottom side of the bitmap if needed. */ if (y + height >= bitmap_height) { int h = (y + height) - bitmap_height; unsigned int ty = y; - + if (bitmap_height > ty) { ty = bitmap_height; } - + /* Render background layer. */ grub_video_fill_rect (color, x, ty, width, h); } @@ -419,7 +419,7 @@ dirty_region_add (int x, int y, unsigned int width, unsigned int height) dirty_region.top_left_y = y; dirty_region.bottom_right_x = x + width - 1; dirty_region.bottom_right_y = y + height - 1; - } + } else { if (x < dirty_region.top_left_x) @@ -431,7 +431,7 @@ dirty_region_add (int x, int y, unsigned int width, unsigned int height) if ((y + (int)height - 1) > dirty_region.bottom_right_y) dirty_region.bottom_right_y = y + height - 1; } -} +} static void dirty_region_add_virtualscreen (void) @@ -487,10 +487,10 @@ write_char (void) /* Get glyph for character. */ glyph = grub_font_get_glyph (virtual_screen.font, p->code); ascent = grub_font_get_ascent (virtual_screen.font); - + width = virtual_screen.normal_char_width * calculate_character_width(glyph); height = virtual_screen.normal_char_height; - + color = p->fg_color; bgcolor = p->bg_color; @@ -556,7 +556,7 @@ scroll_up (void) /* Redraw only changed regions. */ dirty_region_redraw (); } - + /* Scroll text buffer with one line to up. */ grub_memmove (virtual_screen.text_buffer, virtual_screen.text_buffer + virtual_screen.columns, @@ -581,7 +581,7 @@ scroll_up (void) color = virtual_screen.bg_color; grub_video_scroll (color, 0, -virtual_screen.normal_char_height); grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); - + /* If we have bitmap, re-draw screen, otherwise scroll physical screen too. */ if (bitmap) { @@ -589,7 +589,7 @@ scroll_up (void) dirty_region_add_virtualscreen (); } else - { + { /* Clear new border area. */ grub_video_fill_rect (color, virtual_screen.offset_x, virtual_screen.offset_y, @@ -825,15 +825,15 @@ grub_virtual_screen_setcolorstate (grub_term_color_state state) case GRUB_TERM_COLOR_STANDARD: virtual_screen.term_color = virtual_screen.standard_color_setting; break; - + case GRUB_TERM_COLOR_NORMAL: virtual_screen.term_color = virtual_screen.normal_color_setting; break; - + case GRUB_TERM_COLOR_HIGHLIGHT: virtual_screen.term_color = virtual_screen.highlight_color_setting; break; - + default: break; } @@ -887,13 +887,13 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)), /* Check that we have video adapter active. */ if (grub_video_get_info(NULL) != GRUB_ERR_NONE) return grub_errno; - + /* Destroy existing background bitmap if loaded. */ if (bitmap) { grub_video_bitmap_destroy (bitmap); bitmap = 0; - + /* Mark whole screen as dirty. */ dirty_region_reset (); dirty_region_add (0, 0, mode_info.width, mode_info.height); @@ -903,7 +903,7 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)), if (argc >= 1) { /* Try to load new one. */ - grub_video_bitmap_load (&bitmap, args[0]); + grub_video_bitmap_load (&bitmap, args[0]); if (grub_errno != GRUB_ERR_NONE) return grub_errno; @@ -913,13 +913,13 @@ grub_gfxterm_background_image_cmd (grub_command_t cmd __attribute__ ((unused)), /* Determine bitmap dimensions. */ bitmap_width = grub_video_bitmap_get_width (bitmap); bitmap_height = grub_video_bitmap_get_width (bitmap); - + /* Mark whole screen as dirty. */ dirty_region_reset (); dirty_region_add (0, 0, mode_info.width, mode_info.height); } } - + /* All was ok. */ grub_errno = GRUB_ERR_NONE; return grub_errno; diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index ec4d61506..6105e223a 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -127,7 +127,7 @@ serial_translate_key_sequence (void) {'H', 1}, {'4', 4} }; - + static struct { short key; @@ -148,7 +148,7 @@ serial_translate_key_sequence (void) if (npending >= 3) { unsigned int i; - + for (i = 0; i < sizeof (three_code_table) / sizeof (three_code_table[0]); i++) @@ -165,7 +165,7 @@ serial_translate_key_sequence (void) { unsigned int i; short key = *((short *) (input_buf + 2)); - + for (i = 0; i < sizeof (four_code_table) / sizeof (four_code_table[0]); i++) @@ -187,16 +187,16 @@ fill_input_buf (const int nowait) for (i = 0; i < 10000 && npending < sizeof (input_buf); i++) { int c; - + c = serial_hw_fetch (); if (c >= 0) { input_buf[npending++] = c; - + /* Reset the counter to zero, to wait for the same interval. */ i = 0; } - + if (nowait) break; } @@ -324,60 +324,60 @@ grub_serial_putchar (grub_uint32_t c) case GRUB_TERM_DISP_LEFT: c = '<'; break; - + case GRUB_TERM_DISP_UP: c = '^'; break; - + case GRUB_TERM_DISP_RIGHT: c = '>'; break; - + case GRUB_TERM_DISP_DOWN: c = 'v'; break; - + case GRUB_TERM_DISP_HLINE: c = '-'; break; - + case GRUB_TERM_DISP_VLINE: c = '|'; break; - + case GRUB_TERM_DISP_UL: case GRUB_TERM_DISP_UR: case GRUB_TERM_DISP_LL: case GRUB_TERM_DISP_LR: c = '+'; break; - + default: c = '?'; break; } } - + switch (c) { case '\a': break; - + case '\b': case 127: if (xpos > 0) xpos--; break; - + case '\n': if (ypos < TEXT_HEIGHT) ypos++; break; - + case '\r': xpos = 0; break; - + default: if (xpos >= TEXT_WIDTH) { @@ -388,7 +388,7 @@ grub_serial_putchar (grub_uint32_t c) break; } } - + serial_hw_put (c); } @@ -422,7 +422,7 @@ grub_serial_gotoxy (grub_uint8_t x, grub_uint8_t y) keep_track = 0; grub_terminfo_gotoxy (x, y); keep_track = 1; - + xpos = x; ypos = y; } @@ -507,10 +507,10 @@ grub_cmd_serial (grub_extcmd_t cmd, if (!serial_settings.port) return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad unit number."); } - + if (state[1].set) serial_settings.port = (unsigned short) grub_strtoul (state[1].arg, 0, 0); - + if (state[2].set) { unsigned long speed; @@ -523,7 +523,7 @@ grub_cmd_serial (grub_extcmd_t cmd, return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad speed"); } } - + if (state[3].set) { if (! grub_strcmp (state[3].arg, "5")) @@ -540,7 +540,7 @@ grub_cmd_serial (grub_extcmd_t cmd, return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad word length"); } } - + if (state[4].set) { if (! grub_strcmp (state[4].arg, "no")) @@ -555,7 +555,7 @@ grub_cmd_serial (grub_extcmd_t cmd, return grub_error (GRUB_ERR_BAD_ARGUMENT, "bad parity"); } } - + if (state[5].set) { if (! grub_strcmp (state[5].arg, "1")) @@ -571,7 +571,7 @@ grub_cmd_serial (grub_extcmd_t cmd, /* Initialize with new settings. */ hwiniterr = serial_hw_init (); - + if (hwiniterr == GRUB_ERR_NONE) { /* Register terminal if not yet registered. */ @@ -599,7 +599,7 @@ grub_cmd_serial (grub_extcmd_t cmd, } } } - + return hwiniterr; } diff --git a/term/i386/pc/vesafb.c b/term/i386/pc/vesafb.c index 7a81f644f..52694ed10 100644 --- a/term/i386/pc/vesafb.c +++ b/term/i386/pc/vesafb.c @@ -267,7 +267,7 @@ static void grub_virtual_screen_invalidate_char (struct grub_colored_char *p) { p->code = 0xFFFF; - + if (p->width) { struct grub_colored_char *q; @@ -411,14 +411,14 @@ grub_vesafb_putchar (grub_uint32_t c) if (virtual_screen.cursor_x > 0) virtual_screen.cursor_x--; break; - + case '\n': if (virtual_screen.cursor_y >= virtual_screen.rows - 1) scroll_up (); else virtual_screen.cursor_y++; break; - + case '\r': virtual_screen.cursor_x = 0; break; @@ -431,7 +431,7 @@ grub_vesafb_putchar (grub_uint32_t c) { unsigned width; struct grub_colored_char *p; - + grub_virtual_screen_get_glyph (c, 0, &width); if (virtual_screen.cursor_x + width > virtual_screen.columns) @@ -457,14 +457,14 @@ grub_vesafb_putchar (grub_uint32_t c) p[i].index = i; } } - + write_char (); - + virtual_screen.cursor_x += width; if (virtual_screen.cursor_x >= virtual_screen.columns) { virtual_screen.cursor_x = 0; - + if (virtual_screen.cursor_y >= virtual_screen.rows - 1) scroll_up (); else @@ -480,7 +480,7 @@ static grub_ssize_t grub_vesafb_getcharwidth (grub_uint32_t c) { unsigned width; - + if (! grub_virtual_screen_get_glyph (c, 0, &width)) return 0; @@ -542,7 +542,7 @@ grub_vesafb_cls (void) grub_virtual_screen_cls (); grub_memset (framebuffer, - 0, + 0, mode_info.y_resolution * bytes_per_scan_line); } diff --git a/term/i386/pc/vga.c b/term/i386/pc/vga.c index 59c298375..9deb6a6d7 100644 --- a/term/i386/pc/vga.c +++ b/term/i386/pc/vga.c @@ -95,12 +95,12 @@ get_map_mask (void) { unsigned char old_addr; unsigned char old_data; - + old_addr = grub_inb (SEQUENCER_ADDR_PORT); grub_outb (MAP_MASK_REGISTER, SEQUENCER_ADDR_PORT); - + old_data = grub_inb (SEQUENCER_DATA_PORT); - + grub_outb (old_addr, SEQUENCER_ADDR_PORT); return old_data; @@ -111,12 +111,12 @@ static void set_map_mask (unsigned char mask) { unsigned char old_addr; - + old_addr = grub_inb (SEQUENCER_ADDR_PORT); grub_outb (MAP_MASK_REGISTER, SEQUENCER_ADDR_PORT); - + grub_outb (mask, SEQUENCER_DATA_PORT); - + grub_outb (old_addr, SEQUENCER_ADDR_PORT); } @@ -125,7 +125,7 @@ static void set_read_map (unsigned char map) { unsigned char old_addr; - + old_addr = grub_inb (GRAPHICS_ADDR_PORT); grub_outb (READ_MAP_REGISTER, GRAPHICS_ADDR_PORT); @@ -139,12 +139,12 @@ static void set_start_address (unsigned int start) { unsigned char old_addr; - + old_addr = grub_inb (CRTC_ADDR_PORT); - + grub_outb (START_ADDR_LOW_REGISTER, CRTC_ADDR_PORT); grub_outb (start & 0xFF, CRTC_DATA_PORT); - + grub_outb (START_ADDR_HIGH_REGISTER, CRTC_ADDR_PORT); grub_outb (start >> 8, CRTC_DATA_PORT); @@ -164,7 +164,7 @@ grub_vga_mod_init (void) font = grub_font_get (""); /* Choose any font, for now. */ if (!font) return grub_error (GRUB_ERR_BAD_FONT, "No font loaded."); - + return GRUB_ERR_NONE; } @@ -192,13 +192,13 @@ write_char (void) unsigned char *mem_base; unsigned plane; - mem_base = (VGA_MEM + xpos + + mem_base = (VGA_MEM + xpos + ypos * CHAR_HEIGHT * TEXT_WIDTH + PAGE_OFFSET (page)) - p->index; p -= p->index; /* Get glyph for character. */ glyph = grub_font_get_glyph (font, p->code); - + for (plane = 0x01; plane <= 0x08; plane <<= 1) { unsigned y; @@ -219,7 +219,7 @@ write_char (void) for (i = 0; i < char_width && offset < 32; i++) { unsigned char fg_mask, bg_mask; - + fg_mask = (p->fg_color & plane) ? glyph->bitmap[offset] : 0; bg_mask = (p->bg_color & plane) ? ~(glyph->bitmap[offset]) : 0; offset++; @@ -227,7 +227,7 @@ write_char (void) if (check_vga_mem (mem + i)) mem[i] = (fg_mask | bg_mask); } -#endif /* 0 */ +#endif /* 0 */ } } @@ -241,7 +241,7 @@ write_cursor (void) + (ypos * CHAR_HEIGHT + CHAR_HEIGHT - 3) * TEXT_WIDTH); if (check_vga_mem (mem)) *mem = 0xff; - + mem += TEXT_WIDTH; if (check_vga_mem (mem)) *mem = 0xff; @@ -252,11 +252,11 @@ scroll_up (void) { unsigned i; unsigned plane; - + /* Do all the work in the other page. */ grub_memmove (text_buf, text_buf + TEXT_WIDTH, sizeof (struct colored_char) * TEXT_WIDTH * (TEXT_HEIGHT - 1)); - + for (i = TEXT_WIDTH * (TEXT_HEIGHT - 1); i < TEXT_WIDTH * TEXT_HEIGHT; i++) { text_buf[i].code = ' '; @@ -279,7 +279,7 @@ scroll_up (void) grub_memset (VGA_MEM + PAGE_OFFSET (1 - page) + VGA_WIDTH * (VGA_HEIGHT - CHAR_HEIGHT) / 8, 0, VGA_WIDTH * CHAR_HEIGHT / 8); - + /* Activate the other page. */ page = 1 - page; wait_vretrace (); @@ -292,7 +292,7 @@ grub_vga_putchar (grub_uint32_t c) #if DEBUG_VGA static int show = 1; #endif - + if (c == '\a') /* FIXME */ return; @@ -302,21 +302,21 @@ grub_vga_putchar (grub_uint32_t c) /* Erase current cursor, if any. */ if (cursor_state) write_char (); - + switch (c) { case '\b': if (xpos > 0) xpos--; break; - + case '\n': if (ypos >= TEXT_HEIGHT - 1) scroll_up (); else ypos++; break; - + case '\r': xpos = 0; break; @@ -330,7 +330,7 @@ grub_vga_putchar (grub_uint32_t c) struct grub_font_glyph *glyph; struct colored_char *p; unsigned char_width = 1; - + glyph = grub_font_get_glyph(font, c); if (xpos + char_width > TEXT_WIDTH) @@ -354,14 +354,14 @@ grub_vga_putchar (grub_uint32_t c) p[i].index = i; } } - + write_char (); - + xpos += char_width; if (xpos >= TEXT_WIDTH) { xpos = 0; - + if (ypos >= TEXT_HEIGHT - 1) scroll_up (); else @@ -391,9 +391,9 @@ grub_vga_getcharwidth (grub_uint32_t c) { #if 0 struct grub_font_glyph glyph; - + glyph = grub_font_get_glyph (c); - + return glyph.char_width; #else (void) c; /* Prevent warning. */ diff --git a/term/ieee1275/ofconsole.c b/term/ieee1275/ofconsole.c index 0cc0924fc..c61e16eb7 100644 --- a/term/ieee1275/ofconsole.c +++ b/term/ieee1275/ofconsole.c @@ -71,7 +71,7 @@ grub_ofconsole_writeesc (const char *str) char chr = *(str++); grub_ieee1275_write (stdout_ihandle, &chr, 1, 0); } - + } static void @@ -158,19 +158,19 @@ grub_ofconsole_readkey (int *key) *key = '\e'; return 1; } - + if (c != 91) return 0; - + grub_ieee1275_read (stdin_ihandle, &c, 1, &actual); if (actual <= 0) return 0; - + switch (c) { case 65: /* Up: Ctrl-p. */ - c = 16; + c = 16; break; case 66: /* Down: Ctrl-n. */ @@ -186,7 +186,7 @@ grub_ofconsole_readkey (int *key) break; } } - + *key = c; return actual > 0; } @@ -196,7 +196,7 @@ grub_ofconsole_checkkey (void) { int key; int read; - + if (grub_buflen) return 1; @@ -207,7 +207,7 @@ grub_ofconsole_checkkey (void) grub_buflen = 1; return 1; } - + return -1; } @@ -223,7 +223,7 @@ grub_ofconsole_getkey (void) } while (! grub_ofconsole_readkey (&key)); - + return key; } diff --git a/term/terminfo.c b/term/terminfo.c index f18be9ef0..80ae9b100 100644 --- a/term/terminfo.c +++ b/term/terminfo.c @@ -90,7 +90,7 @@ grub_terminfo_set_current (const char *str) grub_terminfo_free (&term.reverse_video_off); grub_terminfo_free (&term.cursor_on); grub_terminfo_free (&term.cursor_off); - + if (grub_strcmp ("vt100", str) == 0) { term.name = grub_strdup ("vt100"); @@ -102,7 +102,7 @@ grub_terminfo_set_current (const char *str) term.cursor_off = grub_strdup ("\e[?25l"); return grub_errno; } - + return grub_error (GRUB_ERR_BAD_ARGUMENT, "unknown terminfo type."); } diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index 66962d8e5..c827955ab 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -67,7 +67,7 @@ grub_usb_hid (void) int usb_iterate (grub_usb_device_t dev) { descdev = &dev->descdev; - + grub_dprintf ("usb_keyboard", "%x %x %x\n", descdev->class, descdev->subclass, descdev->protocol); diff --git a/util/console.c b/util/console.c index 70b0440bb..04bb56dbb 100644 --- a/util/console.c +++ b/util/console.c @@ -106,7 +106,7 @@ grub_ncurses_putchar (grub_uint32_t c) c = '?'; break; } - + addch (c | grub_console_attr); } @@ -119,7 +119,7 @@ grub_ncurses_getcharwidth (grub_uint32_t code __attribute__ ((unused))) static void grub_ncurses_setcolorstate (grub_term_color_state state) { - switch (state) + switch (state) { case GRUB_TERM_COLOR_STANDARD: grub_console_cur_color = grub_console_standard_color; @@ -170,12 +170,12 @@ static int grub_ncurses_checkkey (void) { int c; - + /* Check for SAVED_CHAR. This should not be true, because this means checkkey is called twice continuously. */ if (saved_char != ERR) return saved_char; - + wtimeout (stdscr, 100); c = getch (); /* If C is not ERR, then put it back in the input queue. */ @@ -192,7 +192,7 @@ static int grub_ncurses_getkey (void) { int c; - + /* If checkkey has already got a character, then return it. */ if (saved_char != ERR) { @@ -214,7 +214,7 @@ grub_ncurses_getkey (void) case KEY_RIGHT: c = 6; break; - + case KEY_UP: c = 16; break; @@ -234,7 +234,7 @@ grub_ncurses_getkey (void) case KEY_BACKSPACE: /* XXX: For some reason ncurses on xterm does not return KEY_BACKSPACE. */ - case 127: + case 127: c = 8; break; diff --git a/util/getroot.c b/util/getroot.c index 5f892afa6..b50979d65 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -52,7 +52,7 @@ strip_extra_slashes (char *dir) p[0] = '\0'; break; } - + p++; } } @@ -104,7 +104,7 @@ grub_get_prefix (const char *dir) char *abs_dir, *prev_dir; char *prefix; struct stat st, prev_st; - + /* Save the current directory. */ saved_cwd = xgetcwd (); @@ -114,7 +114,7 @@ grub_get_prefix (const char *dir) abs_dir = xgetcwd (); strip_extra_slashes (abs_dir); prev_dir = xstrdup (abs_dir); - + if (stat (".", &prev_st) < 0) grub_util_error ("Cannot stat `%s'", dir); @@ -187,7 +187,7 @@ find_root_device (const char *dir, dev_t dev) DIR *dp; char *saved_cwd; struct dirent *ent; - + dp = opendir (dir); if (! dp) return 0; @@ -201,11 +201,11 @@ find_root_device (const char *dir, dev_t dev) closedir (dp); return 0; } - + while ((ent = readdir (dp)) != 0) { struct stat st; - + /* Avoid: - dotfiles (like "/dev/.tmp.md0") since they could be duplicates. - dotdirs (like "/dev/.static") since they could contain duplicates. */ @@ -219,7 +219,7 @@ find_root_device (const char *dir, dev_t dev) if (S_ISLNK (st.st_mode)) /* Don't follow symbolic links. */ continue; - + if (S_ISDIR (st.st_mode)) { /* Find it recursively. */ @@ -231,7 +231,7 @@ find_root_device (const char *dir, dev_t dev) { if (chdir (saved_cwd) < 0) grub_util_error ("Cannot restore the original directory"); - + free (saved_cwd); closedir (dp); return res; @@ -380,7 +380,7 @@ grub_guess_root_device (const char *dir) { struct stat st; char *os_dev; - + if (stat (dir, &st) < 0) grub_util_error ("Cannot stat `%s'", dir); @@ -437,7 +437,7 @@ grub_util_get_grub_dev (const char *os_dev) offset++; } } - + break; case GRUB_DEV_ABSTRACTION_RAID: @@ -500,7 +500,7 @@ grub_util_get_grub_dev (const char *os_dev) } else grub_util_error ("Unknown kind of RAID device `%s'", os_dev); - + break; default: /* GRUB_DEV_ABSTRACTION_NONE */ diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 57f837a39..6d1234050 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -95,7 +95,7 @@ create_envblk_file (const char *name) { FILE *fp; char *buf; - + buf = malloc (DEFAULT_ENVBLK_SIZE); if (! buf) grub_util_error ("out of memory"); @@ -107,7 +107,7 @@ create_envblk_file (const char *name) memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1); memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#', DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1); - + if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE) grub_util_error ("cannot write to the file %s", name); @@ -123,7 +123,7 @@ open_envblk_file (const char *name) char *buf; size_t size; grub_envblk_t envblk; - + fp = fopen (name, "rb"); if (! fp) { @@ -145,12 +145,12 @@ open_envblk_file (const char *name) buf = malloc (size); if (! buf) grub_util_error ("out of memory"); - + if (fread (buf, 1, size, fp) != size) grub_util_error ("cannot read the file %s", name); fclose (fp); - + envblk = grub_envblk_open (buf, size); if (! envblk) grub_util_error ("invalid environment block"); @@ -162,7 +162,7 @@ static void list_variables (const char *name) { grub_envblk_t envblk; - + auto int print_var (const char *name, const char *value); int print_var (const char *name, const char *value) { @@ -179,11 +179,11 @@ static void write_envblk (const char *name, grub_envblk_t envblk) { FILE *fp; - + fp = fopen (name, "wb"); if (! fp) grub_util_error ("cannot open the file %s", name); - + if (fwrite (grub_envblk_buffer (envblk), 1, grub_envblk_size (envblk), fp) != grub_envblk_size (envblk)) grub_util_error ("cannot write to the file %s", name); @@ -196,7 +196,7 @@ static void set_variables (const char *name, int argc, char *argv[]) { grub_envblk_t envblk; - + envblk = open_envblk_file (name); while (argc) { @@ -223,7 +223,7 @@ static void unset_variables (const char *name, int argc, char *argv[]) { grub_envblk_t envblk; - + envblk = open_envblk_file (name); while (argc) { @@ -242,9 +242,9 @@ main (int argc, char *argv[]) { char *filename; char *command; - + progname = "grub-editenv"; - + /* Check for options. */ while (1) { @@ -285,7 +285,7 @@ main (int argc, char *argv[]) fprintf (stderr, "no command specified\n"); usage (1); } - + filename = argv[optind]; command = argv[optind + 1]; diff --git a/util/grub-emu.c b/util/grub-emu.c index addbc085f..c133dbead 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -105,7 +105,7 @@ static struct option options[] = { 0, 0, 0, 0 } }; -static int +static int usage (int status) { if (status) @@ -138,7 +138,7 @@ main (int argc, char *argv[]) char *dev_map = DEFAULT_DEVICE_MAP; volatile int hold = 0; int opt; - + progname = "grub-emu"; while ((opt = getopt_long (argc, argv, "r:d:m:vH:hV", options, 0)) != -1) @@ -185,7 +185,7 @@ main (int argc, char *argv[]) sleep (1); } - + signal (SIGINT, SIG_IGN); grub_console_init (); @@ -218,7 +218,7 @@ main (int argc, char *argv[]) prefix = xmalloc (strlen (root_dev) + 2 + strlen (dir) + 1); sprintf (prefix, "(%s)%s", root_dev, dir); free (dir); - + /* Start GRUB! */ if (setjmp (main_env) == 0) grub_main (); @@ -226,6 +226,6 @@ main (int argc, char *argv[]) grub_fini_all (); grub_machine_fini (); - + return 0; } diff --git a/util/grub-macho2img.c b/util/grub-macho2img.c index 63c94c742..8683587be 100644 --- a/util/grub-macho2img.c +++ b/util/grub-macho2img.c @@ -24,7 +24,7 @@ #include /* XXX: this file assumes particular Mach-O layout and does no checks. */ -/* However as build system ensures correct usage of this tool this +/* However as build system ensures correct usage of this tool this shouldn't be a problem. */ int @@ -71,7 +71,7 @@ main (int argc, char **argv) fclose (out); printf ("Couldn't allocate buffer\n"); return 3; - } + } fread (buf, 1, bufsize, in); head = (struct grub_macho_header32 *) buf; if (grub_le_to_cpu32 (head->magic) != GRUB_MACHO_MAGIC32) @@ -81,22 +81,22 @@ main (int argc, char **argv) free (buf); printf ("Invalid Mach-O fle\n"); return 4; - } + } curcmd = (struct grub_macho_segment32 *) (buf + sizeof (*head)); - for (i = 0; i < grub_le_to_cpu32 (head->ncmds); i++, - curcmd = (struct grub_macho_segment32 *) + for (i = 0; i < grub_le_to_cpu32 (head->ncmds); i++, + curcmd = (struct grub_macho_segment32 *) (((char *) curcmd) + curcmd->cmdsize)) { if (curcmd->cmd != GRUB_MACHO_CMD_SEGMENT32) continue; - fwrite (buf + grub_le_to_cpu32 (curcmd->fileoff), 1, + fwrite (buf + grub_le_to_cpu32 (curcmd->fileoff), 1, grub_le_to_cpu32 (curcmd->filesize), out); - if (grub_le_to_cpu32 (curcmd->vmsize) + if (grub_le_to_cpu32 (curcmd->vmsize) > grub_le_to_cpu32 (curcmd->filesize)) { - bssstart = grub_le_to_cpu32 (curcmd->vmaddr) + bssstart = grub_le_to_cpu32 (curcmd->vmaddr) + grub_le_to_cpu32 (curcmd->filesize) ; - bssend = grub_le_to_cpu32 (curcmd->vmaddr) + bssend = grub_le_to_cpu32 (curcmd->vmaddr) + grub_le_to_cpu32 (curcmd->vmsize) ; } } diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index ff9259002..aad0683d8 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -60,7 +60,7 @@ for option in "$@"; do ;; --output=) grub_cfg=`echo "$option" | sed 's/--output=//'` - ;; + ;; -*) echo "Unrecognized option \`$option'" 1>&2 usage diff --git a/util/grub-mkdevicemap.c b/util/grub-mkdevicemap.c index ac8a39059..ec43b34b4 100644 --- a/util/grub-mkdevicemap.c +++ b/util/grub-mkdevicemap.c @@ -55,7 +55,7 @@ make_device_map (const char *device_map, int floppy_disks) fp = stdout; else fp = fopen (device_map, "w"); - + if (! fp) grub_util_error ("cannot open %s", device_map); @@ -98,7 +98,7 @@ Generate a device map file automatically.\n\ Report bugs to <%s>.\n\ ", DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT); - + exit (status); } @@ -107,14 +107,14 @@ main (int argc, char *argv[]) { char *dev_map = 0; int floppy_disks = 1; - + progname = "grub-mkdevicemap"; - + /* Check for options. */ while (1) { int c = getopt_long (argc, argv, "snm:r:hVv", options, 0); - + if (c == -1) break; else @@ -134,7 +134,7 @@ main (int argc, char *argv[]) case 's': floppy_disks = 2; break; - + case 'h': usage (0); break; @@ -156,6 +156,6 @@ main (int argc, char *argv[]) make_device_map (dev_map ? : DEFAULT_DEVICE_MAP, floppy_disks); free (dev_map); - + return 0; } diff --git a/util/grub-probe.c b/util/grub-probe.c index bdb915964..97d386051 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -80,21 +80,21 @@ probe_partmap (grub_disk_t disk) { char *name; char *underscore; - + if (disk->partition == NULL) { grub_util_info ("No partition map found for %s", disk->name); return; } - + name = strdup (disk->partition->partmap->name); if (! name) grub_util_error ("Not enough memory"); - + underscore = strchr (name, '_'); if (! underscore) grub_util_error ("Invalid partition map %s", name); - + *underscore = '\0'; printf ("%s\n", name); free (name); @@ -109,7 +109,7 @@ probe (const char *path, char *device_name) int abstraction_type; grub_device_t dev = NULL; grub_fs_t fs; - + if (path == NULL) { #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) @@ -134,7 +134,7 @@ probe (const char *path, char *device_name) abstraction_type = grub_util_get_dev_abstraction (device_name); /* No need to check for errors; lack of abstraction is permissible. */ - + if (print == PRINT_ABSTRACTION) { char *abstraction_name; @@ -157,7 +157,7 @@ probe (const char *path, char *device_name) drive_name = grub_util_get_grub_dev (device_name); if (! drive_name) grub_util_error ("Cannot find a GRUB drive for %s. Check your device.map.\n", device_name); - + if (print == PRINT_DRIVE) { printf ("(%s)\n", drive_name); @@ -206,15 +206,15 @@ probe (const char *path, char *device_name) grub_file_t file; grub_util_info ("reading %s via OS facilities", path); filebuf_via_sys = grub_util_read_image (path); - + grub_util_info ("reading %s via GRUB facilities", path); asprintf (&grub_path, "(%s)%s", drive_name, path); file = grub_file_open (grub_path); filebuf_via_grub = xmalloc (file->size); grub_file_read (file, filebuf_via_grub, file->size); - + grub_util_info ("comparing"); - + if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size)) grub_util_error ("files differ"); } @@ -275,7 +275,7 @@ Probe device information for a given path (or device, if the -d option is given) Report bugs to <%s>.\n\ ", DEFAULT_DEVICE_MAP, PACKAGE_BUGREPORT); - + exit (status); } @@ -284,14 +284,14 @@ main (int argc, char *argv[]) { char *dev_map = 0; char *argument; - + progname = "grub-probe"; - + /* Check for options. */ while (1) { int c = getopt_long (argc, argv, "dm:t:hVv", options, 0); - + if (c == -1) break; else @@ -360,10 +360,10 @@ main (int argc, char *argv[]) } argument = argv[optind]; - + /* Initialize the emulated biosdisk driver. */ grub_util_biosdisk_init (dev_map ? : DEFAULT_DEVICE_MAP); - + /* Initialize all modules. */ grub_init_all (); @@ -372,12 +372,12 @@ main (int argc, char *argv[]) probe (NULL, argument); else probe (argument, NULL); - + /* Free resources. */ grub_fini_all (); grub_util_biosdisk_fini (); - + free (dev_map); - + return 0; } diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index 12d61b039..e72198da6 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -50,7 +50,7 @@ case "${GRUB_FS}" in esac for i in /hurd/${hurd_fs}.static /hurd/exec ; do - if test -e "$i" ; then + if test -e "$i" ; then echo "Found Hurd module: $i" >&2 at_least_one=true else diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 7d4d17e95..cb7f6428c 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -52,7 +52,7 @@ EOF ;; linux) LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`" - + for LINUX in ${LINUXPROBED} ; do LROOT="`echo ${LINUX} | cut -d ':' -f 1`" LBOOT="`echo ${LINUX} | cut -d ':' -f 2`" diff --git a/util/hostdisk.c b/util/hostdisk.c index a7262dd8f..1844a7e55 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -160,12 +160,12 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) { int drive; struct stat st; - + drive = find_grub_drive (name); if (drive < 0) return grub_error (GRUB_ERR_BAD_DEVICE, "no mapping exists for `%s'", name); - + disk->has_partitions = 1; disk->id = drive; @@ -203,7 +203,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) close (fd); goto fail; } - + # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (ioctl (fd, DIOCGMEDIASIZE, &nr)) # else @@ -219,9 +219,9 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) if (nr % 512) grub_util_error ("unaligned device size"); - + grub_util_info ("the size of %s is %llu", name, disk->total_sectors); - + return GRUB_ERR_NONE; } @@ -234,9 +234,9 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) return grub_error (GRUB_ERR_BAD_DEVICE, "cannot stat `%s'", map[drive].device); disk->total_sectors = st.st_size >> GRUB_DISK_SECTOR_BITS; - + grub_util_info ("the size of %s is %lu", name, disk->total_sectors); - + return GRUB_ERR_NONE; } @@ -314,18 +314,18 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) #ifdef O_BINARY flags |= O_BINARY; #endif - + #ifdef __linux__ /* Linux has a bug that the disk cache for a whole disk is not consistent with the one for a partition of the disk. */ { int is_partition = 0; char dev[PATH_MAX]; - + strcpy (dev, map[disk->id].device); if (disk->partition && strncmp (map[disk->id].device, "/dev/", 5) == 0) is_partition = linux_find_partition (dev, disk->partition->start); - + /* Open the partition. */ grub_dprintf ("hostdisk", "opening the device `%s' in open_device()", dev); fd = open (dev, flags); @@ -411,18 +411,18 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) return fd; } - + /* Read LEN bytes from FD in BUF. Return less than or equal to zero if an error occurs, otherwise return LEN. */ static ssize_t nread (int fd, char *buf, size_t len) { ssize_t size = len; - + while (len) { ssize_t ret = read (fd, buf, len); - + if (ret <= 0) { if (errno == EINTR) @@ -430,11 +430,11 @@ nread (int fd, char *buf, size_t len) else return ret; } - + len -= ret; buf += ret; } - + return size; } @@ -444,11 +444,11 @@ static ssize_t nwrite (int fd, const char *buf, size_t len) { ssize_t size = len; - + while (len) { ssize_t ret = write (fd, buf, len); - + if (ret <= 0) { if (errno == EINTR) @@ -456,11 +456,11 @@ nwrite (int fd, const char *buf, size_t len) else return ret; } - + len -= ret; buf += ret; } - + return size; } @@ -473,13 +473,13 @@ grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, fd = open_device (disk, sector, O_RDONLY); if (fd < 0) return grub_errno; - + #ifdef __linux__ if (sector == 0 && size > 1) { /* Work around a bug in Linux ez remapping. Linux remaps all sectors that are read together with the MBR in one read. It - should only remap the MBR, so we split the read in two + should only remap the MBR, so we split the read in two parts. -jochen */ if (nread (fd, buf, GRUB_DISK_SECTOR_SIZE) != GRUB_DISK_SECTOR_SIZE) { @@ -487,12 +487,12 @@ grub_util_biosdisk_read (grub_disk_t disk, grub_disk_addr_t sector, close (fd); return grub_errno; } - + buf += GRUB_DISK_SECTOR_SIZE; size--; } #endif /* __linux__ */ - + if (nread (fd, buf, size << GRUB_DISK_SECTOR_BITS) != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) grub_error (GRUB_ERR_READ_ERROR, "cannot read from `%s'", map[disk->id].device); @@ -510,7 +510,7 @@ grub_util_biosdisk_write (grub_disk_t disk, grub_disk_addr_t sector, fd = open_device (disk, sector, O_WRONLY); if (fd < 0) return grub_errno; - + if (nwrite (fd, buf, size << GRUB_DISK_SECTOR_BITS) != (ssize_t) (size << GRUB_DISK_SECTOR_BITS)) grub_error (GRUB_ERR_WRITE_ERROR, "cannot write to `%s'", map[disk->id].device); @@ -544,7 +544,7 @@ read_device_map (const char *dev_map) { grub_util_error ("%s:%d: %s", dev_map, lineno, msg); } - + fp = fopen (dev_map, "r"); if (! fp) grub_util_error ("Cannot open `%s'", dev_map); @@ -554,9 +554,9 @@ read_device_map (const char *dev_map) char *p = buf; char *e; int drive; - + lineno++; - + /* Skip leading spaces. */ while (*p && isspace (*p)) p++; @@ -636,7 +636,7 @@ void grub_util_biosdisk_fini (void) { unsigned i; - + for (i = 0; i < sizeof (map) / sizeof (map[0]); i++) { if (map[i].drive) @@ -645,7 +645,7 @@ grub_util_biosdisk_fini (void) free (map[i].device); map[i].drive = map[i].device = NULL; } - + grub_disk_dev_unregister (&grub_util_biosdisk_dev); } @@ -672,13 +672,13 @@ make_device_name (int drive, int dos_part, int bsd_part) */ p = xmalloc (len + 2); sprintf (p, "%s", map[drive].drive); - + if (dos_part >= 0) sprintf (p + strlen (p), ",%d", dos_part + 1); - + if (bsd_part >= 0) sprintf (p + strlen (p), ",%c", bsd_part + 'a'); - + return p; } @@ -689,7 +689,7 @@ convert_system_partition_to_system_disk (const char *os_dev) char *path = xmalloc (PATH_MAX); if (! realpath (os_dev, path)) return 0; - + if (strncmp ("/dev/", path, 5) == 0) { char *p = path + 5; @@ -700,20 +700,20 @@ convert_system_partition_to_system_disk (const char *os_dev) p = strstr (p, "part"); if (p) strcpy (p, "disc"); - + return path; } - + /* If this is a SCSI disk. */ if (strncmp ("scsi/", p, 5) == 0) { p = strstr (p, "part"); if (p) strcpy (p, "disc"); - + return path; } - + /* If this is a DAC960 disk. */ if (strncmp ("rd/c", p, 4) == 0) { @@ -724,7 +724,7 @@ convert_system_partition_to_system_disk (const char *os_dev) return path; } - + /* If this is a CCISS disk. */ if (strncmp ("cciss/c", p, sizeof ("cciss/c") - 1) == 0) { @@ -735,7 +735,7 @@ convert_system_partition_to_system_disk (const char *os_dev) return path; } - + /* If this is a Compaq Intelligent Drive Array. */ if (strncmp ("ida/c", p, sizeof ("ida/c") - 1) == 0) { @@ -746,7 +746,7 @@ convert_system_partition_to_system_disk (const char *os_dev) return path; } - + /* If this is an I2O disk. */ if (strncmp ("i2o/hd", p, sizeof ("i2o/hd") - 1) == 0) { @@ -754,7 +754,7 @@ convert_system_partition_to_system_disk (const char *os_dev) p[sizeof ("i2o/hda") - 1] = '\0'; return path; } - + /* If this is a MultiMediaCard (MMC). */ if (strncmp ("mmcblk", p, sizeof ("mmcblk") - 1) == 0) { @@ -765,7 +765,7 @@ convert_system_partition_to_system_disk (const char *os_dev) return path; } - + /* If this is an IDE, SCSI or Virtio disk. */ if (strncmp ("vdisk", p, 5) == 0 && p[5] >= 'a' && p[5] <= 'z') @@ -794,7 +794,7 @@ convert_system_partition_to_system_disk (const char *os_dev) } return path; - + #elif defined(__GNU__) char *path = xstrdup (os_dev); if (strncmp ("/dev/sd", path, 7) == 0 || strncmp ("/dev/hd", path, 7) == 0) @@ -852,7 +852,7 @@ find_system_device (const char *os_dev) os_disk = convert_system_partition_to_system_disk (os_dev); if (! os_disk) return -1; - + for (i = 0; i < (int) (sizeof (map) / sizeof (map[0])); i++) if (map[i].device && strcmp (map[i].device, os_disk) == 0) { @@ -884,17 +884,17 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return 0; } - if (grub_strcmp (os_dev, convert_system_partition_to_system_disk (os_dev)) + if (grub_strcmp (os_dev, convert_system_partition_to_system_disk (os_dev)) == 0) return make_device_name (drive, -1, -1); - + #if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (! S_ISCHR (st.st_mode)) #else if (! S_ISBLK (st.st_mode)) #endif return make_device_name (drive, -1, -1); - + #if defined(__linux__) || defined(__CYGWIN__) /* Linux counts partitions uniformly, whether a BSD partition or a DOS partition, so mapping them to GRUB devices is not trivial. @@ -913,7 +913,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) int bsd_part = -1; auto int find_partition (grub_disk_t disk, const grub_partition_t partition); - + int find_partition (grub_disk_t disk __attribute__ ((unused)), const grub_partition_t partition) { @@ -921,7 +921,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) if (strcmp (partition->partmap->name, "pc_partition_map") == 0) pcdata = partition->data; - + if (pcdata) { if (pcdata->bsd_part < 0) @@ -937,7 +937,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) grub_util_info ("Partition %d starts from %lu", partition->index, partition->start); } - + if (hdg.start == partition->start) { if (pcdata) @@ -952,15 +952,15 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) } return 1; } - + return 0; } - + name = make_device_name (drive, -1, -1); - + if (MAJOR (st.st_rdev) == FLOPPY_MAJOR) return name; - + fd = open (os_dev, O_RDONLY); if (fd == -1) { @@ -968,7 +968,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) free (name); return 0; } - + if (ioctl (fd, HDIO_GETGEO, &hdg)) { grub_error (GRUB_ERR_BAD_DEVICE, @@ -977,28 +977,28 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) free (name); return 0; } - + close (fd); grub_util_info ("%s starts from %lu", os_dev, hdg.start); - + if (hdg.start == 0 && device_is_wholedisk (os_dev)) return name; grub_util_info ("opening the device %s", name); disk = grub_disk_open (name); free (name); - + if (! disk) return 0; - + grub_partition_iterate (disk, find_partition); if (grub_errno != GRUB_ERR_NONE) { grub_disk_close (disk); return 0; } - + if (dos_part < 0) { grub_disk_close (disk); @@ -1006,43 +1006,43 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) "cannot find the partition of `%s'", os_dev); return 0; } - + return make_device_name (drive, dos_part, bsd_part); } - + #elif defined(__GNU__) /* GNU uses "/dev/[hs]d[0-9]+(s[0-9]+[a-z]?)?". */ { char *p; int dos_part = -1; int bsd_part = -1; - + p = strrchr (os_dev, 's'); if (p) { long int n; char *q; - + p++; n = strtol (p, &q, 10); if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX) { dos_part = (int) n; - + if (*q >= 'a' && *q <= 'g') bsd_part = *q - 'a'; } } - + return make_device_name (drive, dos_part, bsd_part); } - + #elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) /* FreeBSD uses "/dev/[a-z]+[0-9]+(s[0-9]+[a-z]?)?". */ { int dos_part = -1; int bsd_part = -1; - + if (strncmp ("/dev/", os_dev, 5) == 0) { char *p, *q; @@ -1067,7 +1067,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) break; } } - + return make_device_name (drive, dos_part, bsd_part); } diff --git a/util/hostfs.c b/util/hostfs.c index de3bcd680..1b963bb67 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -56,8 +56,8 @@ is_dir (const char *path, const char *name) #endif static grub_err_t -grub_hostfs_dir (grub_device_t device, const char *path, - int (*hook) (const char *filename, +grub_hostfs_dir (grub_device_t device, const char *path, + int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { DIR *dir; diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index 8b8796360..f4203b5a3 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -92,7 +92,7 @@ read_kernel_module (const char *dir, size_t *size) { char *kernel_image; char *kernel_path; - + kernel_path = grub_util_get_path (dir, "kernel.mod"); *size = grub_util_get_image_size (kernel_path); kernel_image = grub_util_read_image (kernel_path); @@ -162,7 +162,7 @@ locate_sections (Elf_Shdr *sections, Elf_Half section_entsize, Elf_Addr current_address; Elf_Addr *section_addresses; Elf_Shdr *s; - + section_addresses = xmalloc (sizeof (*section_addresses) * num_sections); memset (section_addresses, 0, sizeof (*section_addresses) * num_sections); @@ -176,10 +176,10 @@ locate_sections (Elf_Shdr *sections, Elf_Half section_entsize, { Elf_Word align = grub_le_to_cpu32 (s->sh_addralign); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); - + if (align) current_address = align_address (current_address, align); - + grub_util_info ("locating the section %s at 0x%x", name, current_address); section_addresses[i] = current_address; @@ -196,10 +196,10 @@ locate_sections (Elf_Shdr *sections, Elf_Half section_entsize, { Elf_Word align = grub_le_to_cpu32 (s->sh_addralign); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); - + if (align) current_address = align_address (current_address, align); - + grub_util_info ("locating the section %s at 0x%x", name, current_address); section_addresses[i] = current_address; @@ -216,7 +216,7 @@ find_symtab_section (Elf_Shdr *sections, { int i; Elf_Shdr *s; - + for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -232,7 +232,7 @@ find_strtab (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Half section_entsize) { Elf_Shdr *s; char *strtab; - + s = (Elf_Shdr *) ((char *) sections + grub_le_to_cpu16 (e->e_shstrndx) * section_entsize); strtab = (char *) e + grub_le_to_cpu32 (s->sh_offset); @@ -253,13 +253,13 @@ relocate_symbols (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Word i; Elf_Shdr *strtab_section; const char *strtab; - + strtab_section = (Elf_Shdr *) ((char *) sections + (grub_le_to_cpu32 (symtab_section->sh_link) * section_entsize)); strtab = (char *) e + grub_le_to_cpu32 (strtab_section->sh_offset); - + symtab_size = grub_le_to_cpu32 (symtab_section->sh_size); sym_size = grub_le_to_cpu32 (symtab_section->sh_entsize); symtab_offset = grub_le_to_cpu32 (symtab_section->sh_offset); @@ -271,9 +271,9 @@ relocate_symbols (Elf_Ehdr *e, Elf_Shdr *sections, { Elf_Section index; const char *name; - + name = strtab + grub_le_to_cpu32 (sym->st_name); - + index = grub_le_to_cpu16 (sym->st_shndx); if (index == STN_ABS) { @@ -288,7 +288,7 @@ relocate_symbols (Elf_Ehdr *e, Elf_Shdr *sections, } else if (index >= num_sections) grub_util_error ("section %d does not exist", index); - + sym->st_value = (grub_le_to_cpu32 (sym->st_value) + section_addresses[index]); grub_util_info ("locating %s at 0x%x", name, sym->st_value); @@ -306,7 +306,7 @@ static Elf_Addr get_symbol_address (Elf_Ehdr *e, Elf_Shdr *s, Elf_Word i) { Elf_Sym *sym; - + sym = (Elf_Sym *) ((char *) e + grub_le_to_cpu32 (s->sh_offset) + i * grub_le_to_cpu32 (s->sh_entsize)); @@ -332,7 +332,7 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, { Elf_Half i; Elf_Shdr *s; - + for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -375,7 +375,7 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, Elf_Addr sym_addr; Elf_Addr *target; Elf_Addr addend; - + offset = grub_le_to_cpu (r->r_offset); target = get_target_address (e, target_section, offset); info = grub_le_to_cpu (r->r_info); @@ -414,7 +414,7 @@ relocate_addresses (Elf_Ehdr *e, Elf_Shdr *sections, break; case R_X86_64_64: - *target = grub_cpu_to_le64 (grub_le_to_cpu64 (*target) + *target = grub_cpu_to_le64 (grub_le_to_cpu64 (*target) + addend + sym_addr); grub_util_info ("relocating an R_X86_64_64 entry to 0x%llx at the offset 0x%llx", *target, offset); @@ -470,7 +470,7 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type, FILE *out) { struct grub_pe32_fixup_block *b = *block; - + /* First, check if it is necessary to write out the current block. */ if (b) { @@ -485,7 +485,7 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type, Elf_Addr next_address; unsigned padding_size; size_t index; - + next_address = current_address + b->block_size; padding_size = ((align_pe32_section (next_address) - next_address) @@ -528,7 +528,7 @@ add_fixup_entry (struct grub_pe32_fixup_block **block, grub_uint16_t type, { grub_uint16_t entry; size_t index; - + /* If not allocated yet, allocate a block with enough entries. */ if (! b) { @@ -559,7 +559,7 @@ static Elf_Addr make_header_space (FILE *out) { Elf_Addr addr; - + addr = get_starting_section_address (); write_padding (out, addr); @@ -576,7 +576,7 @@ write_text_sections (FILE *out, Elf_Addr current_address, Elf_Half i; Elf_Shdr *s; Elf_Addr addr; - + for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -586,7 +586,7 @@ write_text_sections (FILE *out, Elf_Addr current_address, Elf_Off offset = grub_le_to_cpu32 (s->sh_offset); Elf_Word size = grub_le_to_cpu32 (s->sh_size); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); - + if (align) { addr = align_address (current_address, align); @@ -598,13 +598,13 @@ write_text_sections (FILE *out, Elf_Addr current_address, current_address = addr; } } - + grub_util_info ("writing the text section %s at 0x%x", name, current_address); - + if (fwrite ((char *) e + offset, size, 1, out) != 1) grub_util_error ("write failed"); - + current_address += size; } @@ -615,7 +615,7 @@ write_text_sections (FILE *out, Elf_Addr current_address, addr - current_address); write_padding (out, addr - current_address); } - + return addr; } @@ -629,7 +629,7 @@ write_data_sections (FILE *out, Elf_Addr current_address, Elf_Half i; Elf_Shdr *s; Elf_Addr addr; - + for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -639,7 +639,7 @@ write_data_sections (FILE *out, Elf_Addr current_address, Elf_Off offset = grub_le_to_cpu32 (s->sh_offset); Elf_Word size = grub_le_to_cpu32 (s->sh_size); const char *name = strtab + grub_le_to_cpu32 (s->sh_name); - + if (align) { addr = align_address (current_address, align); @@ -651,19 +651,19 @@ write_data_sections (FILE *out, Elf_Addr current_address, current_address = addr; } } - + grub_util_info ("writing the data section %s at 0x%x", name, current_address); - + if (s->sh_type == grub_cpu_to_le32 (SHT_NOBITS)) write_padding (out, size); else if (fwrite ((char *) e + offset, size, 1, out) != 1) grub_util_error ("write failed"); - + current_address += size; } - + addr = align_pe32_section (current_address); if (addr != current_address) { @@ -671,7 +671,7 @@ write_data_sections (FILE *out, Elf_Addr current_address, addr - current_address); write_padding (out, addr - current_address); } - + return addr; } @@ -689,7 +689,7 @@ make_mods_section (FILE *out, Elf_Addr current_address, memset (&modinfo, 0, sizeof (modinfo)); path_list = grub_util_resolve_dependencies (dir, "moddep.lst", mods); - + total_module_size = sizeof (struct grub_module_info); for (p = path_list; p; p = p->next) { @@ -711,15 +711,15 @@ make_mods_section (FILE *out, Elf_Addr current_address, struct grub_module_header header; size_t mod_size; char *mod_image; - + memset (&header, 0, sizeof (header)); - + grub_util_info ("adding module %s", p->name); - + mod_size = grub_util_get_image_size (p->name); header.type = grub_cpu_to_le32 (OBJ_TYPE_ELF); header.size = grub_cpu_to_le32 (mod_size + sizeof (header)); - + mod_image = grub_util_read_image (p->name); if (fwrite (&header, sizeof (header), 1, out) != 1 @@ -728,7 +728,7 @@ make_mods_section (FILE *out, Elf_Addr current_address, free (mod_image); } - + for (p = path_list; p; ) { struct grub_util_path_list *q; @@ -737,9 +737,9 @@ make_mods_section (FILE *out, Elf_Addr current_address, free (p); p = q; } - + current_address += total_module_size; - + addr = align_pe32_section (current_address); if (addr != current_address) { @@ -761,7 +761,7 @@ make_reloc_section (FILE *out, Elf_Addr current_address, Elf_Ehdr *e, Elf_Half i; Elf_Shdr *s; struct grub_pe32_fixup_block *fixup_block = 0; - + for (i = 0, s = sections; i < num_sections; i++, s = (Elf_Shdr *) ((char *) s + section_entsize)) @@ -773,15 +773,15 @@ make_reloc_section (FILE *out, Elf_Addr current_address, Elf_Ehdr *e, Elf_Off rtab_offset; Elf_Addr section_address; Elf_Word j; - + grub_util_info ("translating the relocation section %s", strtab + grub_le_to_cpu32 (s->sh_name)); - + rtab_size = grub_le_to_cpu32 (s->sh_size); r_size = grub_le_to_cpu32 (s->sh_entsize); rtab_offset = grub_le_to_cpu32 (s->sh_offset); num_rs = rtab_size / r_size; - + section_address = section_addresses[grub_le_to_cpu32 (s->sh_info)]; for (j = 0, r = (Elf_Rel *) ((char *) e + rtab_offset); @@ -888,7 +888,7 @@ make_header (FILE *out, Elf_Addr text_address, Elf_Addr data_address, o->image_size = grub_cpu_to_le32 (end_address); o->header_size = grub_cpu_to_le32 (text_address); o->subsystem = grub_cpu_to_le16 (GRUB_PE32_SUBSYSTEM_EFI_APPLICATION); - + /* Do these really matter? */ o->stack_reserve_size = grub_cpu_to_le32 (0x10000); o->stack_commit_size = grub_cpu_to_le32 (0x10000); @@ -896,7 +896,7 @@ make_header (FILE *out, Elf_Addr text_address, Elf_Addr data_address, o->heap_commit_size = grub_cpu_to_le32 (0x10000); o->num_data_directories = grub_cpu_to_le32 (GRUB_PE32_NUM_DATA_DIRECTORIES); - + o->base_relocation_table.rva = grub_cpu_to_le32 (reloc_address); o->base_relocation_table.size = grub_cpu_to_le32 (end_address - reloc_address); @@ -982,7 +982,7 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[]) e = (Elf_Ehdr *) kernel_image; if (! check_elf_header (e, kernel_size)) grub_util_error ("invalid ELF header"); - + section_offset = grub_cpu_to_le32 (e->e_shoff); section_entsize = grub_cpu_to_le16 (e->e_shentsize); num_sections = grub_cpu_to_le16 (e->e_shnum); @@ -1002,20 +1002,20 @@ convert_elf (const char *dir, char *prefix, FILE *out, char *mods[]) if (GRUB_KERNEL_MACHINE_PREFIX + strlen (prefix) + 1 > GRUB_KERNEL_MACHINE_DATA_END) grub_util_error ("prefix too long"); - + strcpy (kernel_image + offset + GRUB_KERNEL_MACHINE_PREFIX, prefix); break; } - + /* Relocate sections then symbols in the virtual address space. */ section_addresses = locate_sections (sections, section_entsize, num_sections, strtab); - + symtab_section = find_symtab_section (sections, section_entsize, num_sections); if (! symtab_section) grub_util_error ("no symbol table"); - + start_address = relocate_symbols (e, sections, symtab_section, section_addresses, section_entsize, num_sections); diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 1bdddac4d..b10768eef 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -58,11 +58,11 @@ compress_kernel (char *kernel_img, size_t kernel_size, { lzo_uint size; char *wrkmem; - + grub_util_info ("kernel_img=%p, kernel_size=0x%x", kernel_img, kernel_size); if (kernel_size < GRUB_KERNEL_MACHINE_RAW_SIZE) grub_util_error ("the core image is too small"); - + if (lzo_init () != LZO_E_OK) grub_util_error ("cannot initialize LZO"); @@ -70,7 +70,7 @@ compress_kernel (char *kernel_img, size_t kernel_size, wrkmem = xmalloc (LZO1X_999_MEM_COMPRESS); memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE); - + grub_util_info ("compressing the core image"); if (lzo1x_999_compress ((const lzo_byte *) (kernel_img + GRUB_KERNEL_MACHINE_RAW_SIZE), @@ -189,7 +189,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], size_t mod_size; mod_size = grub_util_get_image_size (p->name); - + header = (struct grub_module_header *) (kernel_img + offset); header->type = grub_cpu_to_le32 (OBJ_TYPE_ELF); header->size = grub_cpu_to_le32 (mod_size + sizeof (*header)); @@ -202,7 +202,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], if (memdisk_path) { struct grub_module_header *header; - + header = (struct grub_module_header *) (kernel_img + offset); header->type = grub_cpu_to_le32 (OBJ_TYPE_MEMDISK); header->size = grub_cpu_to_le32 (memdisk_size + sizeof (*header)); @@ -230,7 +230,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], &core_img, &core_size); grub_util_info ("the core size is 0x%x", core_size); - + num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); if (num > 0xffff) grub_util_error ("the core image is too big"); @@ -239,9 +239,9 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], boot_size = grub_util_get_image_size (boot_path); if (boot_size != GRUB_DISK_SECTOR_SIZE) grub_util_error ("diskboot.img is not one sector size"); - + boot_img = grub_util_read_image (boot_path); - + /* i386 is a little endian architecture. */ *((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE - GRUB_BOOT_MACHINE_LIST_SIZE + 8)) @@ -250,7 +250,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], grub_util_write_image (boot_img, boot_size, out); free (boot_img); free (boot_path); - + module_addr = (path_list ? (GRUB_BOOT_MACHINE_KERNEL_ADDR + GRUB_DISK_SECTOR_SIZE + kernel_size) @@ -277,7 +277,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], if (core_size > GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR) grub_util_error ("Core image is too big (%p > %p)\n", core_size, GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR); - + grub_util_write_image (core_img, core_size, out); free (kernel_img); free (core_img); @@ -344,7 +344,7 @@ main (int argc, char *argv[]) FILE *fp = stdout; progname = "grub-mkimage"; - + while (1) { int c = getopt_long (argc, argv, "d:p:m:c:o:hVv", options, 0); @@ -357,7 +357,7 @@ main (int argc, char *argv[]) case 'o': if (output) free (output); - + output = xstrdup (optarg); break; @@ -373,7 +373,7 @@ main (int argc, char *argv[]) free (memdisk); memdisk = xstrdup (optarg); - + if (prefix) free (prefix); diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 997811bb9..bdf234c64 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -110,7 +110,7 @@ setup (const char *dir, FILE *fp; struct { grub_uint64_t start; grub_uint64_t end; } embed_region; embed_region.start = embed_region.end = ~0UL; - + auto void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset, unsigned length); auto void NESTED_FUNC_ATTR save_blocklists (grub_disk_addr_t sector, unsigned offset, @@ -122,44 +122,44 @@ setup (const char *dir, const grub_partition_t p) { struct grub_pc_partition *pcdata = p->data; - + /* There's always an embed region, and it starts right after the MBR. */ embed_region.start = 1; - + /* For its end offset, include as many dummy partitions as we can. */ if (! grub_pc_partition_is_empty (pcdata->dos_type) && ! grub_pc_partition_is_bsd (pcdata->dos_type) && embed_region.end > p->start) embed_region.end = p->start; - + return 1; } - + auto int NESTED_FUNC_ATTR find_usable_region_gpt (grub_disk_t disk, const grub_partition_t p); int NESTED_FUNC_ATTR find_usable_region_gpt (grub_disk_t disk __attribute__ ((unused)), const grub_partition_t p) { struct grub_gpt_partentry *gptdata = p->data; - + /* If there's an embed region, it is in a dedicated partition. */ if (! memcmp (&gptdata->type, &grub_gpt_partition_type_bios_boot, 16)) { embed_region.start = p->start; embed_region.end = p->start + p->len; - + return 1; } - + return 0; } - + void NESTED_FUNC_ATTR save_first_sector (grub_disk_addr_t sector, unsigned offset, unsigned length) { grub_util_info ("the first sector is <%llu,%u,%u>", sector, offset, length); - + if (offset != 0 || length != GRUB_DISK_SECTOR_SIZE) grub_util_error ("The first sector of the core file is not sector-aligned"); @@ -173,7 +173,7 @@ setup (const char *dir, grub_util_info ("saving <%llu,%u,%u> with the segment 0x%x", sector, offset, length, (unsigned) current_segment); - + if (offset != 0 || last_length != GRUB_DISK_SECTOR_SIZE) grub_util_error ("Non-sector-aligned data is found in the core file"); @@ -191,11 +191,11 @@ setup (const char *dir, if (block->len) grub_util_error ("The sectors of the core file are too fragmented"); } - + last_length = length; current_segment += GRUB_DISK_SECTOR_SIZE >> 4; } - + /* Read the boot image by the OS service. */ boot_path = grub_util_get_path (dir, boot_file); boot_size = grub_util_get_image_size (boot_path); @@ -212,7 +212,7 @@ setup (const char *dir, + GRUB_BOOT_MACHINE_KERNEL_SECTOR); boot_drive_check = (grub_uint16_t *) (boot_img + GRUB_BOOT_MACHINE_DRIVE_CHECK); - + core_path = grub_util_get_path (dir, core_file); core_size = grub_util_get_image_size (core_path); core_sectors = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) @@ -221,7 +221,7 @@ setup (const char *dir, grub_util_error ("The size of `%s' is too small", core_path); else if (core_size > 0xFFFF * GRUB_DISK_SECTOR_SIZE) grub_util_error ("The size of `%s' is too large", core_path); - + core_img = grub_util_read_image (core_path); /* Have FIRST_BLOCK to point to the first blocklist. */ @@ -264,7 +264,7 @@ setup (const char *dir, GRUB_BOOT_MACHINE_PART_END - GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC); free (tmp_img); - + /* If DEST_DRIVE is a hard disk, enable the workaround, which is for buggy BIOSes which don't pass boot drive correctly. Instead, they pass 0x00 or 0x01 even when booted from 0x80. */ @@ -304,7 +304,7 @@ setup (const char *dir, dos_part = grub_le_to_cpu32 (*install_dos_part); bsd_part = grub_le_to_cpu32 (*install_bsd_part); } - + grub_util_info ("dos partition is %d, bsd partition is %d", dos_part, bsd_part); @@ -319,7 +319,7 @@ setup (const char *dir, grub_util_warn ("Attempting to install GRUB to a partition instead of the MBR. This is a BAD idea."); goto unable_to_embed; } - + /* Unlike root_dev, with dest_dev we're interested in the partition map even if dest_dev itself is a whole disk. */ auto int NESTED_FUNC_ATTR identify_partmap (grub_disk_t disk, @@ -331,7 +331,7 @@ setup (const char *dir, return 1; } grub_partition_iterate (dest_dev->disk, identify_partmap); - + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? find_usable_region_gpt : find_usable_region_msdos)); if (embed_region.end == embed_region.start) @@ -356,69 +356,69 @@ setup (const char *dir, grub_util_info ("will embed the core image at sector 0x%llx", embed_region.start); - + *install_dos_part = grub_cpu_to_le32 (dos_part); *install_bsd_part = grub_cpu_to_le32 (bsd_part); - + /* The first blocklist contains the whole sectors. */ first_block->start = grub_cpu_to_le64 (embed_region.start + 1); first_block->len = grub_cpu_to_le16 (core_sectors - 1); first_block->segment = grub_cpu_to_le16 (GRUB_BOOT_MACHINE_KERNEL_SEG + (GRUB_DISK_SECTOR_SIZE >> 4)); - + /* Make sure that the second blocklist is a terminator. */ block = first_block - 1; block->start = 0; block->len = 0; block->segment = 0; - + /* Write the core image onto the disk. */ if (grub_disk_write (dest_dev->disk, embed_region.start, 0, core_size, core_img)) grub_util_error ("%s", grub_errmsg); - + /* FIXME: can this be skipped? */ *boot_drive = 0xFF; *root_drive = 0xFF; - + *kernel_sector = grub_cpu_to_le64 (embed_region.start); - + /* Write the boot image onto the disk. */ if (grub_disk_write (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, boot_img)) grub_util_error ("%s", grub_errmsg); - + goto finish; - + unable_to_embed: - + if (must_embed) grub_util_error ("Embedding is not possible, but this is required when " "the root device is on a RAID array or LVM volume."); - + grub_util_warn ("Embedding is not possible. GRUB can only be installed in this " "setup by using blocklists. However, blocklists are UNRELIABLE and " "its use is discouraged."); if (! force) grub_util_error ("If you really want blocklists, use --force."); - + /* Make sure that GRUB reads the identical image as the OS. */ tmp_img = xmalloc (core_size); core_path_dev = grub_util_get_path (dir, core_file); - + /* It is a Good Thing to sync two times. */ sync (); sync (); #define MAX_TRIES 5 - + for (i = 0; i < MAX_TRIES; i++) { grub_util_info ("attempting to read the core image `%s' from GRUB%s", core_path_dev, (i == 0) ? "" : " again"); - + grub_disk_cache_invalidate_all (); - + file = grub_file_open (core_path_dev); if (file) { @@ -434,7 +434,7 @@ unable_to_embed: #if 0 FILE *dump; FILE *dump2; - + dump = fopen ("dump.img", "wb"); if (dump) { @@ -448,8 +448,8 @@ unable_to_embed: fwrite (core_img, 1, core_size, dump2); fclose (dump2); } - -#endif + +#endif grub_util_info ("succeeded in opening the core image but the data is different"); } else @@ -465,7 +465,7 @@ unable_to_embed: if (grub_errno) grub_util_info ("error message = %s", grub_errmsg); - + grub_errno = GRUB_ERR_NONE; sync (); sleep (1); @@ -483,16 +483,16 @@ unable_to_embed: block->segment = 0; block--; - + if ((char *) block <= core_img) grub_util_error ("No terminator in the core image"); } - + /* Now read the core image to determine where the sectors are. */ file = grub_file_open (core_path_dev); if (! file) grub_util_error ("%s", grub_errmsg); - + file->read_hook = save_first_sector; if (grub_file_read (file, tmp_img, GRUB_DISK_SECTOR_SIZE) != GRUB_DISK_SECTOR_SIZE) @@ -505,10 +505,10 @@ unable_to_embed: grub_util_error ("Failed to read the rest sectors of the core image"); grub_file_close (file); - + free (core_path_dev); free (tmp_img); - + *kernel_sector = grub_cpu_to_le64 (first_sector); /* FIXME: can this be skipped? */ @@ -535,7 +535,7 @@ unable_to_embed: /* Sync is a Good Thing. */ sync (); - + free (core_path); free (core_img); free (boot_img); @@ -591,7 +591,7 @@ static char * get_device_name (char *dev) { size_t len = strlen (dev); - + if (dev[0] != '(' || dev[len - 1] != ')') return 0; @@ -609,7 +609,7 @@ main (int argc, char *argv[]) char *root_dev = 0; char *dest_dev; int must_embed = 0, force = 0; - + progname = "grub-setup"; /* Check for options. */ @@ -642,7 +642,7 @@ main (int argc, char *argv[]) dir = xstrdup (optarg); break; - + case 'm': if (dev_map) free (dev_map); @@ -656,7 +656,7 @@ main (int argc, char *argv[]) root_dev = xstrdup (optarg); break; - + case 'f': force = 1; break; @@ -700,7 +700,7 @@ main (int argc, char *argv[]) /* Initialize all modules. */ grub_init_all (); - + dest_dev = get_device_name (argv[optind]); if (! dest_dev) { @@ -722,7 +722,7 @@ main (int argc, char *argv[]) if (! tmp) grub_util_error ("Invalid root device `%s'", root_dev); - + tmp = xstrdup (tmp); free (root_dev); root_dev = tmp; @@ -741,7 +741,7 @@ main (int argc, char *argv[]) #ifdef __linux__ if (grub_util_lvm_isvolume (root_dev)) must_embed = 1; - + if (root_dev[0] == 'm' && root_dev[1] == 'd' && root_dev[2] >= '0' && root_dev[2] <= '9') { @@ -776,13 +776,13 @@ main (int argc, char *argv[]) /* Free resources. */ grub_fini_all (); grub_util_biosdisk_fini (); - + free (boot_file); free (core_file); free (dir); free (dev_map); free (root_dev); free (dest_dev); - + return 0; } diff --git a/util/lvm.c b/util/lvm.c index edd31b0a4..8a8ed1e4c 100644 --- a/util/lvm.c +++ b/util/lvm.c @@ -32,7 +32,7 @@ grub_util_lvm_isvolume (char *name) char *devname; struct stat st; int err; - + devname = xmalloc (strlen (name) + 13); strcpy (devname, "/dev/mapper/"); diff --git a/util/misc.c b/util/misc.c index edfcc813a..939867b7f 100644 --- a/util/misc.c +++ b/util/misc.c @@ -55,7 +55,7 @@ void grub_util_warn (const char *fmt, ...) { va_list ap; - + fprintf (stderr, "%s: warn: ", progname); va_start (ap, fmt); vfprintf (stderr, fmt, ap); @@ -70,7 +70,7 @@ grub_util_info (const char *fmt, ...) if (verbosity > 0) { va_list ap; - + fprintf (stderr, "%s: info: ", progname); va_start (ap, fmt); vfprintf (stderr, fmt, ap); @@ -84,7 +84,7 @@ void grub_util_error (const char *fmt, ...) { va_list ap; - + fprintf (stderr, "%s: error: ", progname); va_start (ap, fmt); vfprintf (stderr, fmt, ap); @@ -98,7 +98,7 @@ grub_err_printf (const char *fmt, ...) { va_list ap; int ret; - + va_start (ap, fmt); ret = vfprintf (stderr, fmt, ap); va_end (ap); @@ -110,7 +110,7 @@ void * xmalloc (size_t size) { void *p; - + p = malloc (size); if (! p) grub_util_error ("out of memory"); @@ -133,7 +133,7 @@ xstrdup (const char *str) { size_t len; char *dup; - + len = strlen (str); dup = (char *) xmalloc (len + 1); memcpy (dup, str, len + 1); @@ -145,7 +145,7 @@ char * grub_util_get_path (const char *dir, const char *file) { char *path; - + path = (char *) xmalloc (strlen (dir) + 1 + strlen (file) + 1); sprintf (path, "%s/%s", dir, file); return path; @@ -155,13 +155,13 @@ size_t grub_util_get_fp_size (FILE *fp) { struct stat st; - + if (fflush (fp) == EOF) grub_util_error ("fflush failed"); if (fstat (fileno (fp), &st) == -1) grub_util_error ("fstat failed"); - + return st.st_size; } @@ -169,12 +169,12 @@ size_t grub_util_get_image_size (const char *path) { struct stat st; - + grub_util_info ("getting the size of %s", path); - + if (stat (path, &st) == -1) grub_util_error ("cannot stat %s", path); - + return st.st_size; } @@ -194,7 +194,7 @@ grub_util_read_image (const char *path) char *img; FILE *fp; size_t size; - + grub_util_info ("reading %s", path); size = grub_util_get_image_size (path); @@ -207,7 +207,7 @@ grub_util_read_image (const char *path) grub_util_read_at (img, size, 0, fp); fclose (fp); - + return img; } @@ -216,11 +216,11 @@ grub_util_load_image (const char *path, char *buf) { FILE *fp; size_t size; - + grub_util_info ("reading %s", path); size = grub_util_get_image_size (path); - + fp = fopen (path, "rb"); if (! fp) grub_util_error ("cannot open %s", path); @@ -282,10 +282,10 @@ grub_memalign (grub_size_t align, grub_size_t size) (void) size; grub_util_error ("grub_memalign is not supported"); #endif - + if (! p) grub_util_error ("out of memory"); - + return p; } @@ -313,7 +313,7 @@ grub_get_rtc (void) struct timeval tv; gettimeofday (&tv, 0); - + return (tv.tv_sec * GRUB_TICKS_PER_SECOND + (((tv.tv_sec % GRUB_TICKS_PER_SECOND) * 1000000 + tv.tv_usec) * GRUB_TICKS_PER_SECOND / 1000000)); @@ -325,7 +325,7 @@ grub_get_time_ms (void) struct timeval tv; gettimeofday (&tv, 0); - + return (tv.tv_sec * 1000 + tv.tv_usec / 1000); } @@ -351,7 +351,7 @@ grub_millisleep (grub_uint32_t ms) #endif -void +void grub_arch_sync_caches (void *address __attribute__ ((unused)), grub_size_t len __attribute__ ((unused))) { diff --git a/util/raid.c b/util/raid.c index ad6e407f2..83a0ee6e2 100644 --- a/util/raid.c +++ b/util/raid.c @@ -51,7 +51,7 @@ grub_util_getdiskname (int major, int minor) sprintf (name, "/dev/sd%c", 'a' + minor / 16); else grub_util_error ("Unknown device number: %d, %d", major, minor); - + return name; } @@ -83,7 +83,7 @@ grub_util_raid_getmembers (char *name) if (version.major != 0 || version.minor != 90) grub_util_error ("Unsupported RAID version: %d.%d", version.major, version.minor); - + ret = ioctl (fd, GET_ARRAY_INFO, &info); if (ret != 0) grub_util_error ("ioctl GET_ARRAY_INFO error: %s", strerror (errno)); @@ -105,7 +105,7 @@ grub_util_raid_getmembers (char *name) } devicelist[j] = NULL; - + return devicelist; } diff --git a/util/resolve.c b/util/resolve.c index c79f3c104..8b33beba0 100644 --- a/util/resolve.c +++ b/util/resolve.c @@ -75,7 +75,7 @@ static struct dep_list * read_dep_list (FILE *fp) { struct dep_list *dep_list = 0; - + while (fgets (buf, sizeof (buf), fp)) { char *p; @@ -91,7 +91,7 @@ read_dep_list (FILE *fp) dep = xmalloc (sizeof (*dep)); dep->name = xstrdup (buf); dep->list = 0; - + dep->next = dep_list; dep_list = dep; @@ -115,7 +115,7 @@ read_dep_list (FILE *fp) p++; *p++ = '\0'; - + mod = (struct mod_list *) xmalloc (sizeof (*mod)); mod->name = xstrdup (name); mod->next = dep->list; @@ -131,7 +131,7 @@ get_module_name (const char *str) { char *base; char *ext; - + base = strrchr (str, '/'); if (! base) base = (char *) str; @@ -142,13 +142,13 @@ get_module_name (const char *str) if (ext && strcmp (ext, ".mod") == 0) { char *name; - + name = xmalloc (ext - base + 1); memcpy (name, base, ext - base); name[ext - base] = '\0'; return name; } - + return xstrdup (base); } @@ -159,7 +159,7 @@ get_module_path (const char *prefix, const char *str) char *base; char *ext; char *ret; - + ext = strrchr (str, '.'); if (ext && strcmp (ext, ".mod") == 0) base = xstrdup (str); @@ -168,7 +168,7 @@ get_module_path (const char *prefix, const char *str) base = xmalloc (strlen (str) + 4 + 1); sprintf (base, "%s.mod", str); } - + dir = strchr (str, '/'); if (dir) return base; @@ -189,7 +189,7 @@ add_module (const char *dir, struct grub_util_path_list *path; struct mod_list *mod; struct dep_list *dep; - + mod_name = get_module_name (name); /* Check if the module has already been added. */ diff --git a/util/usb.c b/util/usb.c index 744ad86c9..e1d8c71bb 100644 --- a/util/usb.c +++ b/util/usb.c @@ -82,7 +82,7 @@ grub_libusb_init (void) if (grub_libusb_devices ()) return grub_errno; - grub_usb_controller_dev_register (&usb_controller); + grub_usb_controller_dev_register (&usb_controller); return 0; } diff --git a/video/bitmap.c b/video/bitmap.c index 8fda51166..d399fd72b 100644 --- a/video/bitmap.c +++ b/video/bitmap.c @@ -50,7 +50,7 @@ grub_video_bitmap_reader_unregister (grub_video_bitmap_reader_t reader) /* Creates new bitmap, saves created bitmap on success to *bitmap. */ grub_err_t -grub_video_bitmap_create (struct grub_video_bitmap **bitmap, +grub_video_bitmap_create (struct grub_video_bitmap **bitmap, unsigned int width, unsigned int height, enum grub_video_blit_format blit_format) { @@ -79,7 +79,7 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, switch (blit_format) { case GRUB_VIDEO_BLIT_FORMAT_RGBA_8888: - mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB + mode_info->mode_type = GRUB_VIDEO_MODE_TYPE_RGB | GRUB_VIDEO_MODE_TYPE_ALPHA; mode_info->bpp = 32; mode_info->bytes_per_pixel = 4; @@ -137,7 +137,7 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, /* Calculate size needed for the data. */ size = (width * mode_info->bytes_per_pixel) * height; - (*bitmap)->data = grub_malloc (size); + (*bitmap)->data = grub_malloc (size); if (! (*bitmap)->data) { grub_free (*bitmap); @@ -185,7 +185,7 @@ match_extension (const char *filename, const char *ext) /* Loads bitmap using registered bitmap readers. */ grub_err_t -grub_video_bitmap_load (struct grub_video_bitmap **bitmap, +grub_video_bitmap_load (struct grub_video_bitmap **bitmap, const char *filename) { grub_video_bitmap_reader_t reader = bitmap_readers_list; diff --git a/video/readers/tga.c b/video/readers/tga.c index cdaa7dda9..3e31e4477 100644 --- a/video/readers/tga.c +++ b/video/readers/tga.c @@ -327,7 +327,7 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, not going to support developer area & extensions at this point. */ /* Read TGA header from beginning of file. */ - if (grub_file_read (file, (char*)&header, sizeof (header)) + if (grub_file_read (file, (char*)&header, sizeof (header)) != sizeof (header)) { grub_file_close (file); @@ -460,7 +460,7 @@ grub_cmd_tgatest (struct grub_arg_list *state __attribute__ ((unused)), if (argc != 1) return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); - grub_video_reader_tga (&bitmap, args[0]); + grub_video_reader_tga (&bitmap, args[0]); if (grub_errno != GRUB_ERR_NONE) return grub_errno; diff --git a/video/video.c b/video/video.c index 2c7f12b9e..c22947b63 100644 --- a/video/video.c +++ b/video/video.c @@ -402,7 +402,7 @@ grub_video_set_mode (char *modestring, next_mode = modevar; if (! modevar) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't allocate space for local modevar copy"); if (grub_memcmp (next_mode, "keep", sizeof ("keep")) == 0 @@ -412,7 +412,7 @@ grub_video_set_mode (char *modestring, struct grub_video_mode_info mode_info; int suitable = 1; grub_err_t err; - + grub_memset (&mode_info, 0, sizeof (mode_info)); if (grub_video_adapter_active) @@ -438,11 +438,11 @@ grub_video_set_mode (char *modestring, if (! *next_mode) { grub_free (modevar); - + return grub_error (GRUB_ERR_BAD_ARGUMENT, "No suitable mode found."); } - + /* Skip separator. */ next_mode++; } @@ -454,23 +454,23 @@ grub_video_set_mode (char *modestring, grub_video_adapter_active->fini (); if (grub_errno != GRUB_ERR_NONE) grub_errno = GRUB_ERR_NONE; - + /* Mark active adapter as not set. */ grub_video_adapter_active = 0; } - + /* Loop until all modes has been tested out. */ while (next_mode != NULL) { /* Use last next_mode as current mode. */ tmp = next_mode; - + /* Reset video mode settings. */ width = -1; height = -1; depth = -1; flags = 0; - + /* Save position of next mode and separate modes. */ for (; *next_mode; next_mode++) if (*next_mode == ',' || *next_mode == ';') @@ -482,22 +482,22 @@ grub_video_set_mode (char *modestring, } else next_mode = 0; - + /* Skip whitespace. */ while (grub_isspace (*tmp)) tmp++; - + /* Initialize token holders. */ current_mode = tmp; param = tmp; value = NULL; - /* XXX: we assume that we're in pure text mode if + /* XXX: we assume that we're in pure text mode if no video mode is initialized. Is it always true? */ if (grub_strcmp (param, "text") == 0) { struct grub_video_mode_info mode_info; - + grub_memset (&mode_info, 0, sizeof (mode_info)); mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_PURE_TEXT; @@ -515,44 +515,44 @@ grub_video_set_mode (char *modestring, } /* Parse x[x]*/ - + /* Find width value. */ value = param; param = grub_strchr(param, 'x'); if (param == NULL) { grub_err_t rc; - + /* First setup error message. */ rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); - + /* Free memory before returning. */ grub_free (modevar); - + return rc; } - + *param = 0; param++; - + width = grub_strtoul (value, 0, 0); if (grub_errno != GRUB_ERR_NONE) { grub_err_t rc; - + /* First setup error message. */ rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); - + /* Free memory before returning. */ grub_free (modevar); - + return rc; } - + /* Find height value. */ value = param; param = grub_strchr(param, 'x'); @@ -562,15 +562,15 @@ grub_video_set_mode (char *modestring, if (grub_errno != GRUB_ERR_NONE) { grub_err_t rc; - + /* First setup error message. */ rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); - + /* Free memory before returning. */ grub_free (modevar); - + return rc; } } @@ -579,35 +579,35 @@ grub_video_set_mode (char *modestring, /* We have optional color depth value. */ *param = 0; param++; - + height = grub_strtoul (value, 0, 0); if (grub_errno != GRUB_ERR_NONE) { grub_err_t rc; - + /* First setup error message. */ rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); - + /* Free memory before returning. */ grub_free (modevar); - + return rc; } - + /* Convert color depth value. */ value = param; depth = grub_strtoul (value, 0, 0); if (grub_errno != GRUB_ERR_NONE) { grub_err_t rc; - + /* First setup error message. */ rc = grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid mode: %s\n", current_mode); - + /* Free memory before returning. */ grub_free (modevar); @@ -616,7 +616,7 @@ grub_video_set_mode (char *modestring, } /* Try out video mode. */ - + /* If we have 8 or less bits, then assume that it is indexed color mode. */ if ((depth <= 8) && (depth != -1)) flags |= GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; @@ -624,12 +624,12 @@ grub_video_set_mode (char *modestring, /* We have more than 8 bits, then assume that it is RGB color mode. */ if (depth > 8) flags |= GRUB_VIDEO_MODE_TYPE_RGB; - + /* If user requested specific depth, forward that information to driver. */ if (depth != -1) flags |= (depth << GRUB_VIDEO_MODE_TYPE_DEPTH_POS) & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK; - + /* Try to initialize requested mode. Ignore any errors. */ grub_video_adapter_t p; @@ -638,7 +638,7 @@ grub_video_set_mode (char *modestring, { grub_err_t err; struct grub_video_mode_info mode_info; - + grub_memset (&mode_info, 0, sizeof (mode_info)); /* Try to initialize adapter, if it fails, skip to next adapter. */ @@ -672,14 +672,14 @@ grub_video_set_mode (char *modestring, grub_errno = GRUB_ERR_NONE; continue; } - + /* Valid mode found from adapter, and it has been activated. Specify it as active adapter. */ grub_video_adapter_active = p; - + /* Free memory. */ grub_free (modevar); - + return GRUB_ERR_NONE; } @@ -687,7 +687,7 @@ grub_video_set_mode (char *modestring, /* Free memory. */ grub_free (modevar); - + return grub_error (GRUB_ERR_BAD_ARGUMENT, "No suitable mode found."); } From 33abf7ae90bd7dcc102f3be2507bc2674232c10b Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 10 Jun 2009 22:25:47 +0000 Subject: [PATCH 0831/1707] 2009-06-10 Pavel Roskin * kern/i386/coreboot/init.c: Include grub/cpu/tsc.h to fix compiler warnings. --- ChangeLog | 5 +++++ kern/i386/coreboot/init.c | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index b67ed2cc7..d0663631b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-10 Pavel Roskin + + * kern/i386/coreboot/init.c: Include grub/cpu/tsc.h to fix + compiler warnings. + 2009-06-10 Felix Zielcke * gendistlist.sh (EXTRA_DISTFILES): Add `genhandlerlist.sh' and diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index c12af2c22..6549a17e9 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -34,6 +34,7 @@ #include #include #include +#include #define GRUB_FLOPPY_REG_DIGITAL_OUTPUT 0x3f2 From 27d5fef7178ae1177f9c4371ebe416dff995ebb8 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 10 Jun 2009 23:25:10 +0000 Subject: [PATCH 0832/1707] 2009-06-10 Pavel Roskin * kern/ieee1275/openfw.c: Remove libc includes. * kern/ieee1275/cmain.c: Likewise. * include/grub/ieee1275/ieee1275.h: Likewise. --- ChangeLog | 4 ++++ include/grub/ieee1275/ieee1275.h | 1 - kern/ieee1275/cmain.c | 2 -- kern/ieee1275/openfw.c | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d0663631b..9d702bef7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-06-10 Pavel Roskin + * kern/ieee1275/openfw.c: Remove libc includes. + * kern/ieee1275/cmain.c: Likewise. + * include/grub/ieee1275/ieee1275.h: Likewise. + * kern/i386/coreboot/init.c: Include grub/cpu/tsc.h to fix compiler warnings. diff --git a/include/grub/ieee1275/ieee1275.h b/include/grub/ieee1275/ieee1275.h index 818046fa0..0e6aae548 100644 --- a/include/grub/ieee1275/ieee1275.h +++ b/include/grub/ieee1275/ieee1275.h @@ -20,7 +20,6 @@ #ifndef GRUB_IEEE1275_HEADER #define GRUB_IEEE1275_HEADER 1 -#include #include #include #include diff --git a/kern/ieee1275/cmain.c b/kern/ieee1275/cmain.c index 741d47f8d..c1185f82c 100644 --- a/kern/ieee1275/cmain.c +++ b/kern/ieee1275/cmain.c @@ -17,8 +17,6 @@ * along with GRUB. If not, see . */ -#include -#include #include #include #include diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index aff410dbf..e7979f4ad 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -17,7 +17,6 @@ * along with GRUB. If not, see . */ -#include #include #include #include From 5c5215d5e20f39aee1117974aa178e5aa95ba353 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 10 Jun 2009 23:47:49 +0000 Subject: [PATCH 0833/1707] 2009-06-10 Pavel Roskin * kern/file.c (grub_file_read): Use void pointer for the buffer. Adjust all callers. --- ChangeLog | 3 +++ commands/efi/loadbios.c | 4 ++-- commands/i386/pc/play.c | 4 ++-- font/font.c | 14 +++++++------- include/grub/file.h | 2 +- io/gzio.c | 8 ++++---- kern/elf.c | 2 +- kern/file.c | 2 +- loader/aout.c | 2 +- loader/i386/bsd.c | 4 ++-- loader/i386/efi/linux.c | 4 ++-- loader/i386/ieee1275/linux.c | 4 ++-- loader/i386/linux.c | 4 ++-- loader/i386/pc/chainloader.c | 2 +- loader/i386/pc/linux.c | 6 +++--- loader/macho.c | 8 ++++---- loader/multiboot2.c | 2 +- loader/xnu.c | 4 ++-- loader/xnu_resume.c | 2 +- video/readers/jpeg.c | 10 +++++----- video/readers/png.c | 6 +++--- video/readers/tga.c | 18 +++++++++--------- 22 files changed, 59 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9d702bef7..8e469a984 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-10 Pavel Roskin + * kern/file.c (grub_file_read): Use void pointer for the buffer. + Adjust all callers. + * kern/ieee1275/openfw.c: Remove libc includes. * kern/ieee1275/cmain.c: Likewise. * include/grub/ieee1275/ieee1275.h: Likewise. diff --git a/commands/efi/loadbios.c b/commands/efi/loadbios.c index 7b71a712d..9967bb122 100644 --- a/commands/efi/loadbios.c +++ b/commands/efi/loadbios.c @@ -169,7 +169,7 @@ grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)), if (file->size != 4) grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid int10 dump size"); else - grub_file_read (file, (char *) 0x40, 4); + grub_file_read (file, (void *) 0x40, 4); grub_file_close (file); if (grub_errno) @@ -185,7 +185,7 @@ grub_cmd_loadbios (grub_command_t cmd __attribute__ ((unused)), grub_error (GRUB_ERR_BAD_ARGUMENT, "Invalid bios dump size"); else if (enable_rom_area ()) { - grub_file_read (file, (char *) VBIOS_ADDR, size); + grub_file_read (file, (void *) VBIOS_ADDR, size); fake_bios_data (size <= 0x40000); lock_rom_area (); } diff --git a/commands/i386/pc/play.c b/commands/i386/pc/play.c index 0c0301aab..23150ea1f 100644 --- a/commands/i386/pc/play.c +++ b/commands/i386/pc/play.c @@ -158,7 +158,7 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), if (! file) return grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); - if (grub_file_read (file, (void *) &tempo, sizeof(tempo)) != sizeof(tempo)) + if (grub_file_read (file, &tempo, sizeof(tempo)) != sizeof(tempo)) { grub_file_close (file); return grub_error (GRUB_ERR_FILE_READ_ERROR, @@ -167,7 +167,7 @@ grub_cmd_play (grub_command_t cmd __attribute__ ((unused)), grub_dprintf ("play","tempo = %d\n", tempo); - while (grub_file_read (file, (void *) &buf, + while (grub_file_read (file, &buf, sizeof (struct note)) == sizeof (struct note) && buf.pitch != T_FINE && grub_checkkey () < 0) { diff --git a/font/font.c b/font/font.c index f0a01af2d..84f0a4260 100644 --- a/font/font.c +++ b/font/font.c @@ -215,7 +215,7 @@ open_section (grub_file_t file, struct font_file_section *section) } /* Read the big-endian 32-bit section length. */ - retval = grub_file_read (file, (char *) &raw_length, 4); + retval = grub_file_read (file, &raw_length, 4); if (retval >= 0 && retval < 4) { /* EOF encountered. */ @@ -286,7 +286,7 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct struct char_index_entry *entry = &font->char_index[i]; /* Read code point value; convert to native byte order. */ - if (grub_file_read (file, (char *) &entry->code, 4) != 4) + if (grub_file_read (file, &entry->code, 4) != 4) return 1; entry->code = grub_be_to_cpu32 (entry->code); @@ -302,11 +302,11 @@ load_font_index (grub_file_t file, grub_uint32_t sect_length, struct last_code = entry->code; /* Read storage flags byte. */ - if (grub_file_read (file, (char *) &entry->storage_flags, 1) != 1) + if (grub_file_read (file, &entry->storage_flags, 1) != 1) return 1; /* Read glyph data offset; convert to native byte order. */ - if (grub_file_read (file, (char *) &entry->offset, 4) != 4) + if (grub_file_read (file, &entry->offset, 4) != 4) return 1; entry->offset = grub_be_to_cpu32 (entry->offset); @@ -364,7 +364,7 @@ read_section_as_short (struct font_file_section *section, grub_int16_t *value) section->length); return 1; } - if (grub_file_read (section->file, (char *) &raw_value, 2) != 2) + if (grub_file_read (section->file, &raw_value, 2) != 2) return 1; *value = grub_be_to_cpu16 (raw_value); @@ -579,7 +579,7 @@ fail: static int read_be_uint16 (grub_file_t file, grub_uint16_t * value) { - if (grub_file_read (file, (char *) value, 2) != 2) + if (grub_file_read (file, value, 2) != 2) return 1; *value = grub_be_to_cpu16 (*value); return 0; @@ -683,7 +683,7 @@ grub_font_get_glyph_internal (grub_font_t font, grub_uint32_t code) /* Don't try to read empty bitmaps (e.g., space characters). */ if (len != 0) { - if (grub_file_read (font->file, (char *) glyph->bitmap, len) != len) + if (grub_file_read (font->file, glyph->bitmap, len) != len) { remove_font (font); return 0; diff --git a/include/grub/file.h b/include/grub/file.h index df2e9e470..2aacf936f 100644 --- a/include/grub/file.h +++ b/include/grub/file.h @@ -52,7 +52,7 @@ typedef struct grub_file *grub_file_t; char *EXPORT_FUNC(grub_file_get_device_name) (const char *name); grub_file_t EXPORT_FUNC(grub_file_open) (const char *name); -grub_ssize_t EXPORT_FUNC(grub_file_read) (grub_file_t file, char *buf, +grub_ssize_t EXPORT_FUNC(grub_file_read) (grub_file_t file, void *buf, grub_size_t len); grub_off_t EXPORT_FUNC(grub_file_seek) (grub_file_t file, grub_off_t offset); grub_err_t EXPORT_FUNC(grub_file_close) (grub_file_t file); diff --git a/io/gzio.c b/io/gzio.c index f3b71183c..e46ac1b08 100644 --- a/io/gzio.c +++ b/io/gzio.c @@ -175,7 +175,7 @@ test_header (grub_file_t file) * (other than a real error with the disk) then we don't think it * is a compressed file, and simply mark it as such. */ - if (grub_file_read (gzio->file, (char *) buf, 10) != 10 + if (grub_file_read (gzio->file, buf, 10) != 10 || ((*((grub_uint16_t *) buf) != GZIP_MAGIC) && (*((grub_uint16_t *) buf) != OLD_GZIP_MAGIC))) { @@ -191,7 +191,7 @@ test_header (grub_file_t file) if (buf[2] != DEFLATED || (buf[3] & UNSUPPORTED_FLAGS) || ((buf[3] & EXTRA_FIELD) - && (grub_file_read (gzio->file, (char *) buf, 2) != 2 + && (grub_file_read (gzio->file, buf, 2) != 2 || eat_field (gzio->file, grub_le_to_cpu16 (*((grub_uint16_t *) buf))))) || ((buf[3] & ORIG_NAME) && eat_field (gzio->file, -1)) @@ -205,7 +205,7 @@ test_header (grub_file_t file) grub_file_seek (gzio->file, grub_file_size (gzio->file) - 8); - if (grub_file_read (gzio->file, (char *) buf, 8) != 8) + if (grub_file_read (gzio->file, buf, 8) != 8) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format"); return 0; @@ -367,7 +367,7 @@ get_byte (grub_file_t file) || gzio->inbuf_d == INBUFSIZ) { gzio->inbuf_d = 0; - grub_file_read (gzio->file, (char *) gzio->inbuf, INBUFSIZ); + grub_file_read (gzio->file, gzio->inbuf, INBUFSIZ); } return gzio->inbuf[gzio->inbuf_d++]; diff --git a/kern/elf.c b/kern/elf.c index 8ddf9e540..82e24846d 100644 --- a/kern/elf.c +++ b/kern/elf.c @@ -71,7 +71,7 @@ grub_elf_file (grub_file_t file) if (grub_file_seek (elf->file, 0) == (grub_off_t) -1) goto fail; - if (grub_file_read (elf->file, (char *) &elf->ehdr, sizeof (elf->ehdr)) + if (grub_file_read (elf->file, &elf->ehdr, sizeof (elf->ehdr)) != sizeof (elf->ehdr)) { grub_error_push (); diff --git a/kern/file.c b/kern/file.c index 17e6e781b..5d5e640b1 100644 --- a/kern/file.c +++ b/kern/file.c @@ -111,7 +111,7 @@ grub_file_open (const char *name) } grub_ssize_t -grub_file_read (grub_file_t file, char *buf, grub_size_t len) +grub_file_read (grub_file_t file, void *buf, grub_size_t len) { grub_ssize_t res; diff --git a/loader/aout.c b/loader/aout.c index 58b399204..0254b6ae0 100644 --- a/loader/aout.c +++ b/loader/aout.c @@ -49,7 +49,7 @@ grub_aout_load (grub_file_t file, int offset, if (!load_size) load_size = file->size - offset; - grub_file_read (file, (char *) load_addr, load_size); + grub_file_read (file, (void *) load_addr, load_size); if (grub_errno) return grub_errno; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 729cc880a..81d45a0eb 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -636,7 +636,7 @@ grub_bsd_load_aout (grub_file_t file) if ((grub_file_seek (file, 0)) == (grub_off_t) - 1) return grub_errno; - if (grub_file_read (file, (char *) &ah, sizeof (ah)) != sizeof (ah)) + if (grub_file_read (file, &ah, sizeof (ah)) != sizeof (ah)) return grub_error (GRUB_ERR_READ_ERROR, "cannot read the a.out header"); if (grub_aout_get_type (&ah) != AOUT_TYPE_AOUT32) @@ -988,7 +988,7 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), goto fail; } - grub_file_read (file, (char *) kern_end, file->size); + grub_file_read (file, (void *) kern_end, file->size); if ((!grub_errno) && (!grub_freebsd_add_meta_module (0, argc, argv, kern_end, file->size))) kern_end = ALIGN_PAGE (kern_end + file->size); diff --git a/loader/i386/efi/linux.c b/loader/i386/efi/linux.c index 97a693e96..f96c60e11 100644 --- a/loader/i386/efi/linux.c +++ b/loader/i386/efi/linux.c @@ -616,7 +616,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (! file) goto fail; - if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh)) + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) { grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header"); goto fail; @@ -851,7 +851,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } len = prot_size; - if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) + if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); if (grub_errno == GRUB_ERR_NONE) diff --git a/loader/i386/ieee1275/linux.c b/loader/i386/ieee1275/linux.c index a5635771f..529d1590a 100644 --- a/loader/i386/ieee1275/linux.c +++ b/loader/i386/ieee1275/linux.c @@ -163,7 +163,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (! file) goto fail; - if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh)) + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) { grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header"); goto fail; @@ -257,7 +257,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; initrd_size = grub_file_size (file); - if (grub_file_read (file, (char *) GRUB_OFW_LINUX_INITRD_ADDR, + if (grub_file_read (file, (void *) GRUB_OFW_LINUX_INITRD_ADDR, initrd_size) != (int) initrd_size) { grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 4ef88cb8f..6510db670 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -602,7 +602,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), if (! file) goto fail; - if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh)) + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) { grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header"); goto fail; @@ -838,7 +838,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } len = prot_size; - if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) + if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); if (grub_errno == GRUB_ERR_NONE) diff --git a/loader/i386/pc/chainloader.c b/loader/i386/pc/chainloader.c index 1b96ca8aa..3befd5e59 100644 --- a/loader/i386/pc/chainloader.c +++ b/loader/i386/pc/chainloader.c @@ -68,7 +68,7 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) goto fail; /* Read the first block. */ - if (grub_file_read (file, (char *) 0x7C00, GRUB_DISK_SECTOR_SIZE) + if (grub_file_read (file, (void *) 0x7C00, GRUB_DISK_SECTOR_SIZE) != GRUB_DISK_SECTOR_SIZE) { if (grub_errno == GRUB_ERR_NONE) diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index 148cb7777..c5279f6ce 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -79,7 +79,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), goto fail; } - if (grub_file_read (file, (char *) &lh, sizeof (lh)) != sizeof (lh)) + if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) { grub_error (GRUB_ERR_READ_ERROR, "cannot read the linux header"); goto fail; @@ -264,7 +264,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), } len = prot_size; - if (grub_file_read (file, (char *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) + if (grub_file_read (file, (void *) GRUB_LINUX_BZIMAGE_ADDR, len) != len) grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); if (grub_errno == GRUB_ERR_NONE) @@ -361,7 +361,7 @@ grub_cmd_initrd (grub_command_t cmd __attribute__ ((unused)), goto fail; } - if (grub_file_read (file, (void *)addr, size) != size) + if (grub_file_read (file, (void *) addr, size) != size) { grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); goto fail; diff --git a/loader/macho.c b/loader/macho.c index 3a5144e7c..bd460b810 100644 --- a/loader/macho.c +++ b/loader/macho.c @@ -51,7 +51,7 @@ grub_macho_parse32 (grub_macho_t macho) /* Read header and check magic*/ if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1 - || grub_file_read (macho->file, (char *) &head, sizeof (head)) + || grub_file_read (macho->file, &head, sizeof (head)) != sizeof(head)) { grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); @@ -74,7 +74,7 @@ grub_macho_parse32 (grub_macho_t macho) grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to read commands"); return; } - if (grub_file_read (macho->file, (char *) macho->cmds32, + if (grub_file_read (macho->file, macho->cmds32, (grub_size_t) macho->cmdsize32) != (grub_ssize_t) macho->cmdsize32) { @@ -300,7 +300,7 @@ grub_macho_file (grub_file_t file) if (grub_file_seek (macho->file, 0) == (grub_off_t) -1) goto fail; - if (grub_file_read (macho->file, (char *) &filestart, sizeof (filestart)) + if (grub_file_read (macho->file, &filestart, sizeof (filestart)) != sizeof (filestart)) { grub_error_push (); @@ -322,7 +322,7 @@ grub_macho_file (grub_file_t file) archs = grub_malloc (sizeof (struct grub_macho_fat_arch) * narchs); if (!archs) goto fail; - if (grub_file_read (macho->file, (char *) archs, + if (grub_file_read (macho->file, archs, sizeof (struct grub_macho_fat_arch) * narchs) != (grub_ssize_t)sizeof(struct grub_macho_fat_arch) * narchs) { diff --git a/loader/multiboot2.c b/loader/multiboot2.c index 6f8a6795b..62f923a9b 100644 --- a/loader/multiboot2.c +++ b/loader/multiboot2.c @@ -434,7 +434,7 @@ grub_module2 (int argc, char *argv[]) grub_dprintf ("loader", "Loading module at 0x%x - 0x%x\n", modaddr, modaddr + modsize); - if (grub_file_read (file, (char *) modaddr, modsize) != modsize) + if (grub_file_read (file, (void *) modaddr, modsize) != modsize) { grub_error (GRUB_ERR_FILE_READ_ERROR, "Couldn't read file"); goto out; diff --git a/loader/xnu.c b/loader/xnu.c index 5b5f77e8e..b2c6c059e 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -618,7 +618,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), "Couldn't load driver package"); /* Sometimes caches are fat binary. Errgh. */ - if (grub_file_read (file, (char *) &head, sizeof (head)) + if (grub_file_read (file, &head, sizeof (head)) != (grub_ssize_t) (sizeof (head))) { /* I don't know the internal structure of package but @@ -641,7 +641,7 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), "Couldn't read file %s", args[0]); } - if (grub_file_read (file, (char *) archs, + if (grub_file_read (file, archs, sizeof (struct grub_macho_fat_arch) * narchs) != (grub_ssize_t) sizeof(struct grub_macho_fat_arch) * narchs) { diff --git a/loader/xnu_resume.c b/loader/xnu_resume.c index 69453eab0..77f688726 100644 --- a/loader/xnu_resume.c +++ b/loader/xnu_resume.c @@ -55,7 +55,7 @@ grub_xnu_resume (char *imagename) return 0; /* Read the header. */ - if (grub_file_read (file, (char *) &hibhead, sizeof (hibhead)) + if (grub_file_read (file, &hibhead, sizeof (hibhead)) !=sizeof (hibhead)) { grub_file_close (file); diff --git a/video/readers/jpeg.c b/video/readers/jpeg.c index 45a54c42e..b64bf3f87 100644 --- a/video/readers/jpeg.c +++ b/video/readers/jpeg.c @@ -88,7 +88,7 @@ grub_jpeg_get_byte (struct grub_jpeg_data *data) grub_uint8_t r; r = 0; - grub_file_read (data->file, (char *) &r, 1); + grub_file_read (data->file, &r, 1); return r; } @@ -99,7 +99,7 @@ grub_jpeg_get_word (struct grub_jpeg_data *data) grub_uint16_t r; r = 0; - grub_file_read (data->file, (char *) &r, sizeof (grub_uint16_t)); + grub_file_read (data->file, &r, sizeof (grub_uint16_t)); return grub_be_to_cpu16 (r); } @@ -181,7 +181,7 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: too many huffman tables"); - if (grub_file_read (data->file, (char *) &count, sizeof (count)) != + if (grub_file_read (data->file, &count, sizeof (count)) != sizeof (count)) return grub_errno; @@ -194,7 +194,7 @@ grub_jpeg_decode_huff_table (struct grub_jpeg_data *data) if (grub_errno) return grub_errno; - if (grub_file_read (data->file, (char *) data->huff_value[id], n) != n) + if (grub_file_read (data->file, data->huff_value[id], n) != n) return grub_errno; base = 0; @@ -234,7 +234,7 @@ grub_jpeg_decode_quan_table (struct grub_jpeg_data *data) return grub_error (GRUB_ERR_BAD_FILE_TYPE, "jpeg: too many quantization tables"); - if (grub_file_read (data->file, (char *) &data->quan_table[id], 64) != 64) + if (grub_file_read (data->file, &data->quan_table[id], 64) != 64) return grub_errno; if (data->file->offset != next_marker) diff --git a/video/readers/png.c b/video/readers/png.c index dffcd8524..733fa7305 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -118,7 +118,7 @@ grub_png_get_dword (struct grub_png_data *data) grub_uint32_t r; r = 0; - grub_file_read (data->file, (char *) &r, sizeof (grub_uint32_t)); + grub_file_read (data->file, &r, sizeof (grub_uint32_t)); return grub_be_to_cpu32 (r); } @@ -160,7 +160,7 @@ grub_png_get_byte (struct grub_png_data *data) } r = 0; - grub_file_read (data->file, (char *) &r, 1); + grub_file_read (data->file, &r, 1); if (data->inside_idat) data->idat_remain--; @@ -781,7 +781,7 @@ grub_png_decode_png (struct grub_png_data *data) { grub_uint8_t magic[8]; - if (grub_file_read (data->file, (char *) &magic[0], 8) != 8) + if (grub_file_read (data->file, &magic[0], 8) != 8) return grub_errno; if (grub_memcmp (magic, png_magic, sizeof (png_magic))) diff --git a/video/readers/tga.c b/video/readers/tga.c index 3e31e4477..d0ca2770f 100644 --- a/video/readers/tga.c +++ b/video/readers/tga.c @@ -98,7 +98,7 @@ tga_load_truecolor_rle_R8G8B8 (struct grub_video_bitmap *bitmap, for (x = 0; x < header->image_width;) { - if (grub_file_read (file, (char *)&type, sizeof (type)) != sizeof(type)) + if (grub_file_read (file, &type, sizeof (type)) != sizeof(type)) return grub_errno; if (type & 0x80) @@ -107,7 +107,7 @@ tga_load_truecolor_rle_R8G8B8 (struct grub_video_bitmap *bitmap, type &= 0x7f; type++; - if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel) + if (grub_file_read (file, &tmp[0], bytes_per_pixel) != bytes_per_pixel) return grub_errno; @@ -132,7 +132,7 @@ tga_load_truecolor_rle_R8G8B8 (struct grub_video_bitmap *bitmap, while (type) { - if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel) + if (grub_file_read (file, &tmp[0], bytes_per_pixel) != bytes_per_pixel) return grub_errno; @@ -177,7 +177,7 @@ tga_load_truecolor_rle_R8G8B8A8 (struct grub_video_bitmap *bitmap, for (x = 0; x < header->image_width;) { - if (grub_file_read (file, (char *)&type, sizeof (type)) != sizeof(type)) + if (grub_file_read (file, &type, sizeof (type)) != sizeof(type)) return grub_errno; if (type & 0x80) @@ -186,7 +186,7 @@ tga_load_truecolor_rle_R8G8B8A8 (struct grub_video_bitmap *bitmap, type &= 0x7f; type++; - if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel) + if (grub_file_read (file, &tmp[0], bytes_per_pixel) != bytes_per_pixel) return grub_errno; @@ -212,7 +212,7 @@ tga_load_truecolor_rle_R8G8B8A8 (struct grub_video_bitmap *bitmap, while (type) { - if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel) + if (grub_file_read (file, &tmp[0], bytes_per_pixel) != bytes_per_pixel) return grub_errno; @@ -257,7 +257,7 @@ tga_load_truecolor_R8G8B8 (struct grub_video_bitmap *bitmap, for (x = 0; x < header->image_width; x++) { - if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel) + if (grub_file_read (file, &tmp[0], bytes_per_pixel) != bytes_per_pixel) return grub_errno; @@ -294,7 +294,7 @@ tga_load_truecolor_R8G8B8A8 (struct grub_video_bitmap *bitmap, for (x = 0; x < header->image_width; x++) { - if (grub_file_read (file, (char *)&tmp[0], bytes_per_pixel) + if (grub_file_read (file, &tmp[0], bytes_per_pixel) != bytes_per_pixel) return grub_errno; @@ -327,7 +327,7 @@ grub_video_reader_tga (struct grub_video_bitmap **bitmap, not going to support developer area & extensions at this point. */ /* Read TGA header from beginning of file. */ - if (grub_file_read (file, (char*)&header, sizeof (header)) + if (grub_file_read (file, &header, sizeof (header)) != sizeof (header)) { grub_file_close (file); From 5ac35b35b05e9844f5340dea858e24daf15ff124 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 01:06:39 +0000 Subject: [PATCH 0834/1707] 2009-06-10 Pavel Roskin * io/gzio.c (test_header): Don't reuse one buffer for all data. Use separate variables. Read only the file size at the end, but not the checksum that we don't use. --- ChangeLog | 4 ++++ io/gzio.c | 37 +++++++++++++++++++++++-------------- 2 files changed, 27 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8e469a984..9802e0e39 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-06-10 Pavel Roskin + * io/gzio.c (test_header): Don't reuse one buffer for all data. + Use separate variables. Read only the file size at the end, but + not the checksum that we don't use. + * kern/file.c (grub_file_read): Use void pointer for the buffer. Adjust all callers. diff --git a/io/gzio.c b/io/gzio.c index e46ac1b08..a38bfb372 100644 --- a/io/gzio.c +++ b/io/gzio.c @@ -164,7 +164,16 @@ typedef unsigned long ulg; static int test_header (grub_file_t file) { - unsigned char buf[10] __attribute__ ((aligned)); + struct { + grub_uint16_t magic; + grub_uint8_t method; + grub_uint8_t flags; + grub_uint32_t timestamp; + grub_uint8_t extra_flags; + grub_uint8_t os_type; + } hdr; + grub_uint16_t extra_len; + grub_uint32_t orig_len; grub_gzio_t gzio = file->data; if (grub_file_tell (gzio->file) != 0) @@ -175,9 +184,9 @@ test_header (grub_file_t file) * (other than a real error with the disk) then we don't think it * is a compressed file, and simply mark it as such. */ - if (grub_file_read (gzio->file, buf, 10) != 10 - || ((*((grub_uint16_t *) buf) != GZIP_MAGIC) - && (*((grub_uint16_t *) buf) != OLD_GZIP_MAGIC))) + if (grub_file_read (gzio->file, &hdr, 10) != 10 + || ((hdr.magic != GZIP_MAGIC) + && (hdr.magic != OLD_GZIP_MAGIC))) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "no gzip magic found"); return 0; @@ -188,14 +197,14 @@ test_header (grub_file_t file) * problem occurs from here on, then we have corrupt or otherwise * bad data, and the error should be reported to the user. */ - if (buf[2] != DEFLATED - || (buf[3] & UNSUPPORTED_FLAGS) - || ((buf[3] & EXTRA_FIELD) - && (grub_file_read (gzio->file, buf, 2) != 2 + if (hdr.method != DEFLATED + || (hdr.flags & UNSUPPORTED_FLAGS) + || ((hdr.flags & EXTRA_FIELD) + && (grub_file_read (gzio->file, &extra_len, 2) != 2 || eat_field (gzio->file, - grub_le_to_cpu16 (*((grub_uint16_t *) buf))))) - || ((buf[3] & ORIG_NAME) && eat_field (gzio->file, -1)) - || ((buf[3] & COMMENT) && eat_field (gzio->file, -1))) + grub_le_to_cpu16 (extra_len)))) + || ((hdr.flags & ORIG_NAME) && eat_field (gzio->file, -1)) + || ((hdr.flags & COMMENT) && eat_field (gzio->file, -1))) { grub_error (GRUB_ERR_BAD_GZIP_DATA, "unsupported gzip format"); return 0; @@ -203,9 +212,9 @@ test_header (grub_file_t file) gzio->data_offset = grub_file_tell (gzio->file); - grub_file_seek (gzio->file, grub_file_size (gzio->file) - 8); + grub_file_seek (gzio->file, grub_file_size (gzio->file) - 4); - if (grub_file_read (gzio->file, buf, 8) != 8) + if (grub_file_read (gzio->file, &orig_len, 4) != 4) { grub_error (GRUB_ERR_BAD_FILE_TYPE, "unsupported gzip format"); return 0; @@ -213,7 +222,7 @@ test_header (grub_file_t file) /* FIXME: this does not handle files whose original size is over 4GB. But how can we know the real original size? */ - file->size = grub_le_to_cpu32 (*((grub_uint32_t *) (buf + 4))); + file->size = grub_le_to_cpu32 (orig_len); initialize_tables (file); From 63963d17d0d20e558da667bd295b6bbd828919d5 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 11 Jun 2009 16:13:39 +0000 Subject: [PATCH 0835/1707] 2009-06-11 Vladimir Serbinenko Drivemap fixes * commands/i386/pc/drivemap.c (grub_get_root_biosnumber_drivemap): new function (grub_get_root_biosnumber_saved): new variable (GRUB_MOD_INIT): register grub_get_root_biosnumber_drivemap (GRUB_MOD_FINI): unregister grub_get_root_biosnumber_drivemap * commands/i386/pc/drivemap_int13h.S (grub_drivemap_handler): restore %dx after the call if necessary * conf/common.rmk (pkglib_MODULES): remove boot.mod (boot_mod_SOURCES): remove (boot_mod_CFLAGS): remove (boot_mod_LDFLAGS): remove * conf/i386-coreboot.rmk (pkglib_MODULES): add boot.mod (boot_mod_SOURCES): new variable (boot_mod_CFLAGS): likewise (boot_mod_LDFLAGS): likewise * conf/i386-efi.rmk: likewise * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise * conf/x86_64-efi.rmk: likewise * include/grub/i386/pc/biosnum.h: new file * lib/i386/pc/biosnum.c: likewise * loader/i386/bsd.c (grub_bsd_get_device): use grub_get_root_biosnumber * loader/i386/multiboot.c (grub_multiboot_get_bootdev): likewise * loader/i386/pc/chainloader.c (grub_chainloader_cmd): likewise --- ChangeLog | 31 ++++++++++++++++++ commands/i386/pc/drivemap.c | 43 ++++++++++++++++++++++++- commands/i386/pc/drivemap_int13h.S | 50 +++++++++++++++++++++++++++--- conf/common.rmk | 7 +---- conf/i386-coreboot.rmk | 6 ++++ conf/i386-efi.rmk | 6 ++++ conf/i386-ieee1275.rmk | 6 ++++ conf/i386-pc.rmk | 6 ++++ conf/powerpc-ieee1275.rmk | 6 ++++ conf/sparc64-ieee1275.rmk | 6 ++++ conf/x86_64-efi.rmk | 6 ++++ include/grub/i386/pc/biosnum.h | 6 ++++ lib/i386/pc/biosnum.c | 46 +++++++++++++++++++++++++++ loader/i386/bsd.c | 31 +++++++++++------- loader/i386/multiboot.c | 50 ++++++++++++++++-------------- loader/i386/pc/chainloader.c | 30 ++++++------------ 16 files changed, 269 insertions(+), 67 deletions(-) create mode 100644 include/grub/i386/pc/biosnum.h create mode 100644 lib/i386/pc/biosnum.c diff --git a/ChangeLog b/ChangeLog index 9802e0e39..f93ec8ca5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2009-06-11 Vladimir Serbinenko + + Drivemap fixes + + * commands/i386/pc/drivemap.c (grub_get_root_biosnumber_drivemap): + new function + (grub_get_root_biosnumber_saved): new variable + (GRUB_MOD_INIT): register grub_get_root_biosnumber_drivemap + (GRUB_MOD_FINI): unregister grub_get_root_biosnumber_drivemap + * commands/i386/pc/drivemap_int13h.S (grub_drivemap_handler): restore + %dx after the call if necessary + * conf/common.rmk (pkglib_MODULES): remove boot.mod + (boot_mod_SOURCES): remove + (boot_mod_CFLAGS): remove + (boot_mod_LDFLAGS): remove + * conf/i386-coreboot.rmk (pkglib_MODULES): add boot.mod + (boot_mod_SOURCES): new variable + (boot_mod_CFLAGS): likewise + (boot_mod_LDFLAGS): likewise + * conf/i386-efi.rmk: likewise + * conf/i386-ieee1275.rmk: likewise + * conf/i386-pc.rmk: likewise + * conf/powerpc-ieee1275.rmk: likewise + * conf/sparc64-ieee1275.rmk: likewise + * conf/x86_64-efi.rmk: likewise + * include/grub/i386/pc/biosnum.h: new file + * lib/i386/pc/biosnum.c: likewise + * loader/i386/bsd.c (grub_bsd_get_device): use grub_get_root_biosnumber + * loader/i386/multiboot.c (grub_multiboot_get_bootdev): likewise + * loader/i386/pc/chainloader.c (grub_chainloader_cmd): likewise + 2009-06-10 Pavel Roskin * io/gzio.c (test_header): Don't reuse one buffer for all data. diff --git a/commands/i386/pc/drivemap.c b/commands/i386/pc/drivemap.c index aeb354f1b..52424c3d1 100644 --- a/commands/i386/pc/drivemap.c +++ b/commands/i386/pc/drivemap.c @@ -23,8 +23,9 @@ #include #include #include +#include #include - +#include /* Real mode IVT slot (seg:off far pointer) for interrupt 0x13. */ @@ -356,10 +357,49 @@ uninstall_int13_handler (void) return GRUB_ERR_NONE; } +static int +grub_get_root_biosnumber_drivemap (void) +{ + char *biosnum; + int ret = -1; + grub_device_t dev; + + biosnum = grub_env_get ("biosnum"); + + if (biosnum) + return grub_strtoul (biosnum, 0, 0); + + dev = grub_device_open (0); + if (dev && dev->disk && dev->disk->dev + && dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) + { + drivemap_node_t *curnode = map_head; + ret = (int) dev->disk->id; + while (curnode) + { + if (curnode->redirto == ret) + { + ret = curnode->newdrive; + break; + } + curnode = curnode->next; + } + + } + + if (dev) + grub_device_close (dev); + + return ret; +} + static grub_extcmd_t cmd; +static int (*grub_get_root_biosnumber_saved) (void); GRUB_MOD_INIT (drivemap) { + grub_get_root_biosnumber_saved = grub_get_root_biosnumber; + grub_get_root_biosnumber = grub_get_root_biosnumber_drivemap; cmd = grub_register_extcmd ("drivemap", grub_cmd_drivemap, GRUB_COMMAND_FLAG_BOTH, "drivemap" @@ -374,6 +414,7 @@ GRUB_MOD_INIT (drivemap) GRUB_MOD_FINI (drivemap) { + grub_get_root_biosnumber = grub_get_root_biosnumber_saved; grub_loader_unregister_preboot_hook (drivemap_hook); drivemap_hook = 0; grub_unregister_extcmd (cmd); diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 7a3e8e73f..96848fb65 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -27,6 +27,11 @@ /* The replacement int13 handler. Preserve all registers. */ FUNCTION(grub_drivemap_handler) + /* Save %dx for future restore. */ + push %dx + /* Push flags. Used to simulate interrupt with original flags. */ + pushf + /* Map the drive number (always in DL). */ push %ax push %bx @@ -51,11 +56,48 @@ not_found: pop %bx pop %ax - /* Upon arrival to this point the stack must be exactly like at entry. - This long jump will transfer the caller's stack to the old INT13 - handler, thus making it return directly to the original caller. */ - .byte 0xea + cmpb $0x8, %ah + jz norestore + cmpb $0x15, %ah + jz norestore + /* Restore flags. */ + popf + pushf + + lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler)) + + push %bp + mov %sp, %bp + +tail: + + pushf + pop %dx + mov %dx, 8(%bp) + + pop %bp + + /* Restore %dx. */ + pop %dx + iret + +norestore: + + /* Restore flags. */ + popf + pushf + + lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler)) + + push %bp + mov %sp, %bp + + /* Save %dx. */ + mov %dx, 2(%bp) + + jmp tail + /* Far pointer to the old handler. Stored as a CS:IP in the style of real-mode IVT entries (thus PI:SC in mem). */ VARIABLE(grub_drivemap_oldhandler) diff --git a/conf/common.rmk b/conf/common.rmk index 027eff2f8..2dcf2d628 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -353,7 +353,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ loopback.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - pcpart.mod memrw.mod boot.mod normal.mod sh.mod lua.mod \ + pcpart.mod memrw.mod normal.mod sh.mod lua.mod \ gptsync.mod true.mod # For gptsync.mod. @@ -361,11 +361,6 @@ gptsync_mod_SOURCES = commands/gptsync.c gptsync_mod_CFLAGS = $(COMMON_CFLAGS) gptsync_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For boot.mod. -boot_mod_SOURCES = commands/boot.c -boot_mod_CFLAGS = $(COMMON_CFLAGS) -boot_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For minicmd.mod. minicmd_mod_SOURCES = commands/minicmd.c minicmd_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 2f768c0fd..483f279ad 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -109,6 +109,12 @@ pkglib_MODULES = linux.mod multiboot.mod \ halt.mod datetime.mod date.mod datehook.mod \ lsmmap.mod mmap.mod +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For mmap.mod. mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c mmap_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 91e271d8c..d14673382 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -117,6 +117,12 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For acpi.mod. acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c acpi_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 961e61617..6e91b420c 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -108,6 +108,12 @@ pkglib_MODULES = halt.mod reboot.mod suspend.mod \ nand.mod memdisk.mod pci.mod lspci.mod datetime.mod \ date.mod datehook.mod lsmmap.mod mmap.mod +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For mmap.mod. mmap_mod_SOURCES = mmap/mmap.c mmap/i386/uppermem.c mmap/i386/mmap.c mmap_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 4a94443b6..abb6fd565 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -189,6 +189,12 @@ pkglib_MODULES = biosdisk.mod chain.mod \ usb.mod uhci.mod ohci.mod usbtest.mod usbms.mod usb_keyboard.mod \ efiemu.mod mmap.mod acpi.mod drivemap.mod +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For drivemap.mod. drivemap_mod_SOURCES = commands/i386/pc/drivemap.c \ commands/i386/pc/drivemap_int13h.S diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 6411111b4..157b6e2c3 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -119,6 +119,12 @@ pkglib_MODULES = halt.mod \ memdisk.mod \ lsmmap.mod +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For linux.mod. linux_mod_SOURCES = loader/powerpc/ieee1275/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index d061416a2..3a8cbe260 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -149,6 +149,12 @@ pkglib_MODULES = halt.mod \ memdisk.mod \ lsmmap.mod +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For linux.mod. linux_mod_SOURCES = loader/sparc64/ieee1275/linux.c linux_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 175f8cca4..82d000506 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -115,6 +115,12 @@ symlist.c: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h gensymlist. kernel_syms.lst: $(addprefix include/grub/,$(kernel_mod_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) +# For boot.mod. +pkglib_MODULES += boot.mod +boot_mod_SOURCES = commands/boot.c lib/i386/pc/biosnum.c +boot_mod_CFLAGS = $(COMMON_CFLAGS) +boot_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For acpi.mod. acpi_mod_SOURCES = commands/acpi.c commands/efi/acpi.c acpi_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/include/grub/i386/pc/biosnum.h b/include/grub/i386/pc/biosnum.h new file mode 100644 index 000000000..29c8ecc88 --- /dev/null +++ b/include/grub/i386/pc/biosnum.h @@ -0,0 +1,6 @@ +#ifndef GRUB_BIOSNUM_MACHINE_HEADER +#define GRUB_BIOSNUM_MACHINE_HEADER 1 + +extern int (*grub_get_root_biosnumber) (void); + +#endif diff --git a/lib/i386/pc/biosnum.c b/lib/i386/pc/biosnum.c new file mode 100644 index 000000000..1f9b5f3fc --- /dev/null +++ b/lib/i386/pc/biosnum.c @@ -0,0 +1,46 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include + +static int +grub_get_root_biosnumber_default (void) +{ + char *biosnum; + int ret = -1; + grub_device_t dev; + + biosnum = grub_env_get ("biosnum"); + + if (biosnum) + return grub_strtoul (biosnum, 0, 0); + + dev = grub_device_open (0); + if (dev && dev->disk && dev->disk->dev + && dev->disk->dev->id == GRUB_DISK_DEVICE_BIOSDISK_ID) + ret = (int) dev->disk->id; + + if (dev) + grub_device_close (dev); + + return ret; +} + +int (*grub_get_root_biosnumber) (void) = grub_get_root_biosnumber_default; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 81d45a0eb..c6a97724d 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -33,6 +33,12 @@ #include #include #include +#ifdef GRUB_MACHINE_PCBIOS +#include +#include +#include +#include +#endif #define ALIGN_DWORD(a) ALIGN_UP (a, 4) #define ALIGN_QWORD(a) ALIGN_UP (a, 8) @@ -81,23 +87,22 @@ grub_bsd_get_device (grub_uint32_t * biosdev, grub_uint32_t * slice, grub_uint32_t * part) { char *p; + grub_device_t dev; - *biosdev = *unit = *slice = *part = 0; - p = grub_env_get ("root"); - if ((p) && ((p[0] == 'h') || (p[0] == 'f')) && (p[1] == 'd') && - (p[2] >= '0') && (p[2] <= '9')) + *biosdev = grub_get_root_biosnumber () & 0xff; + *unit = (*biosdev & 0x7f); + *slice = 0xff; + *part = 0xff; + dev = grub_device_open (0); + if (dev && dev->disk && dev->disk->partition) { - if (p[0] == 'h') - *biosdev = 0x80; - *unit = grub_strtoul (p + 2, &p, 0); - *biosdev += *unit; - - if ((p) && (p[0] == ',')) + p = dev->disk->partition->partmap->get_name (dev->disk->partition); + if (p) { - if ((p[1] >= '0') && (p[1] <= '9')) + if ((p[0] >= '0') && (p[0] <= '9')) { - *slice = grub_strtoul (p + 1, &p, 0); + *slice = grub_strtoul (p, &p, 0); if ((p) && (p[0] == ',')) p++; @@ -107,6 +112,8 @@ grub_bsd_get_device (grub_uint32_t * biosdev, *part = p[0] - 'a'; } } + if (dev) + grub_device_close (dev); } static grub_err_t diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index cc45a4e97..efca6511c 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -42,6 +42,12 @@ #include #include #include +#ifdef GRUB_MACHINE_PCBIOS +#include +#include +#include +#include +#endif extern grub_dl_t my_mod; static struct grub_multiboot_info *mbi, *mbi_dest; @@ -148,46 +154,42 @@ grub_multiboot_load_elf (grub_file_t file, void *buffer) static int grub_multiboot_get_bootdev (grub_uint32_t *bootdev) { +#ifdef GRUB_MACHINE_PCBIOS char *p; + grub_uint32_t biosdev, slice = ~0, part = ~0; + grub_device_t dev; - p = grub_env_get ("root"); - if ((p) && ((p[0] == 'h') || (p[0] == 'f')) && (p[1] == 'd') && - (p[2] >= '0') && (p[2] <= '9')) + biosdev = grub_get_root_biosnumber (); + + dev = grub_device_open (0); + if (dev && dev->disk && dev->disk->partition) { - grub_uint32_t bd; - bd = (p[0] == 'h') ? 0x80 : 0; - bd += grub_strtoul (p + 2, &p, 0); - bd <<= 24; - - if ((p) && (p[0] == ',')) + p = dev->disk->partition->partmap->get_name (dev->disk->partition); + if (p) { - if ((p[1] >= '0') && (p[1] <= '9')) + if ((p[0] >= '0') && (p[0] <= '9')) { - - bd += ((grub_strtoul (p + 1, &p, 0) - 1) & 0xFF) << 16; + slice = grub_strtoul (p, &p, 0); if ((p) && (p[0] == ',')) p++; } - else - bd += 0xFF0000; if ((p[0] >= 'a') && (p[0] <= 'z')) - bd += (p[0] - 'a') << 8; - else - bd += 0xFF00; + part = p[0] - 'a'; } - else - bd += 0xFFFF00; - - bd += 0xFF; - - *bootdev = bd; - return 1; } + if (dev) + grub_device_close (dev); + *bootdev = ((biosdev & 0xff) << 24) | ((slice & 0xff) << 16) + | ((part & 0xff) << 16) | 0xff; + return (biosdev != ~0UL); +#else + *bootdev = 0xffffffff; return 0; +#endif } void diff --git a/loader/i386/pc/chainloader.c b/loader/i386/pc/chainloader.c index 3befd5e59..caf1450e4 100644 --- a/loader/i386/pc/chainloader.c +++ b/loader/i386/pc/chainloader.c @@ -31,6 +31,7 @@ #include #include #include +#include static grub_dl_t my_mod; static int boot_drive; @@ -89,30 +90,19 @@ grub_chainloader_cmd (const char *filename, grub_chainloader_flags_t flags) grub_file_close (file); /* Obtain the partition table from the root device. */ + drive = grub_get_root_biosnumber (); dev = grub_device_open (0); - if (dev) + if (dev && dev->disk && dev->disk->partition) { - grub_disk_t disk = dev->disk; - - if (disk) - { - grub_partition_t p = disk->partition; - - /* In i386-pc, the id is equal to the BIOS drive number. */ - drive = (int) disk->id; - - if (p) - { - grub_disk_read (disk, p->offset, 446, 64, - (void *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR); - part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR - + (p->index << 4)); - } - } - - grub_device_close (dev); + grub_disk_read (dev->disk, dev->disk->partition->offset, 446, 64, + (void *) GRUB_MEMORY_MACHINE_PART_TABLE_ADDR); + part_addr = (void *) (GRUB_MEMORY_MACHINE_PART_TABLE_ADDR + + (dev->disk->partition->index << 4)); } + if (dev) + grub_device_close (dev); + /* Ignore errors. Perhaps it's not fatal. */ grub_errno = GRUB_ERR_NONE; From a0c62e4e28c04d29c20734815bb0fd65fa9970d9 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 16:17:45 +0000 Subject: [PATCH 0836/1707] 2009-06-11 Pavel Roskin * term/i386/pc/serial.c (serial_translate_key_sequence): Avoid casts to short - they are not portable and cause warnings. Fix use of uninitialized values in input_buf. Use ARRAY_SIZE. --- ChangeLog | 6 ++++++ term/i386/pc/serial.c | 36 +++++++++++++++--------------------- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index f93ec8ca5..29a50817f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-11 Pavel Roskin + + * term/i386/pc/serial.c (serial_translate_key_sequence): Avoid + casts to short - they are not portable and cause warnings. Fix + use of uninitialized values in input_buf. Use ARRAY_SIZE. + 2009-06-11 Vladimir Serbinenko Drivemap fixes diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 6105e223a..195f73670 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -112,6 +112,7 @@ serial_hw_put (const int c) static void serial_translate_key_sequence (void) { + unsigned int i; static struct { char key; @@ -141,34 +142,27 @@ serial_translate_key_sequence (void) {('6' | ('~' << 8)), 3} }; - /* The buffer must start with "ESC [". */ - if (*((unsigned short *) input_buf) != ('\e' | ('[' << 8))) + if (npending < 3) return; - if (npending >= 3) - { - unsigned int i; + /* The buffer must start with "ESC [". */ + if (input_buf[0] != '\e' || input_buf[1] != '[') + return; - for (i = 0; - i < sizeof (three_code_table) / sizeof (three_code_table[0]); - i++) - if (three_code_table[i].key == input_buf[2]) - { - input_buf[0] = three_code_table[i].ascii; - npending -= 2; - grub_memmove (input_buf + 1, input_buf + 3, npending - 1); - return; - } - } + for (i = 0; ARRAY_SIZE (three_code_table); i++) + if (three_code_table[i].key == input_buf[2]) + { + input_buf[0] = three_code_table[i].ascii; + npending -= 2; + grub_memmove (input_buf + 1, input_buf + 3, npending - 1); + return; + } if (npending >= 4) { - unsigned int i; - short key = *((short *) (input_buf + 2)); + short key = input_buf[3] | (input_buf[4] << 8); - for (i = 0; - i < sizeof (four_code_table) / sizeof (four_code_table[0]); - i++) + for (i = 0; i < ARRAY_SIZE (four_code_table); i++) if (four_code_table[i].key == key) { input_buf[0] = four_code_table[i].ascii; From 775dbc4d08574ba5ebb4f593ec5387f521b2f3a7 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 16:18:47 +0000 Subject: [PATCH 0837/1707] Remove trailing spaces --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 29a50817f..2053f2d59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -13,7 +13,7 @@ (grub_get_root_biosnumber_saved): new variable (GRUB_MOD_INIT): register grub_get_root_biosnumber_drivemap (GRUB_MOD_FINI): unregister grub_get_root_biosnumber_drivemap - * commands/i386/pc/drivemap_int13h.S (grub_drivemap_handler): restore + * commands/i386/pc/drivemap_int13h.S (grub_drivemap_handler): restore %dx after the call if necessary * conf/common.rmk (pkglib_MODULES): remove boot.mod (boot_mod_SOURCES): remove @@ -34,7 +34,7 @@ * loader/i386/bsd.c (grub_bsd_get_device): use grub_get_root_biosnumber * loader/i386/multiboot.c (grub_multiboot_get_bootdev): likewise * loader/i386/pc/chainloader.c (grub_chainloader_cmd): likewise - + 2009-06-10 Pavel Roskin * io/gzio.c (test_header): Don't reuse one buffer for all data. From 22cd079d3b188265c89ae3add12ffdfe25303d5c Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 16:41:24 +0000 Subject: [PATCH 0838/1707] 2009-06-11 Pavel Roskin * loader/ieee1275/multiboot2.c [__i386__]: Include grub/cpu/multiboot.h. --- ChangeLog | 3 +++ loader/ieee1275/multiboot2.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2053f2d59..78378f597 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-11 Pavel Roskin + * loader/ieee1275/multiboot2.c [__i386__]: Include + grub/cpu/multiboot.h. + * term/i386/pc/serial.c (serial_translate_key_sequence): Avoid casts to short - they are not portable and cause warnings. Fix use of uninitialized values in input_buf. Use ARRAY_SIZE. diff --git a/loader/ieee1275/multiboot2.c b/loader/ieee1275/multiboot2.c index 61f21b0e5..d1444ceff 100644 --- a/loader/ieee1275/multiboot2.c +++ b/loader/ieee1275/multiboot2.c @@ -27,6 +27,9 @@ #include #include #include +#ifdef __i386__ +#include +#endif typedef void (*kernel_entry_t) (unsigned long, void *, int (void *), unsigned long, unsigned long); From dde032e8036752ed38f9ba8701844d316a111770 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 16:49:51 +0000 Subject: [PATCH 0839/1707] 2009-06-11 Pavel Roskin * kern/i386/ieee1275/init.c: Add missing prototype for grub_stop_floppy(). --- ChangeLog | 3 +++ kern/i386/ieee1275/init.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 78378f597..1df378d5f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-11 Pavel Roskin + * kern/i386/ieee1275/init.c: Add missing prototype for + grub_stop_floppy(). + * loader/ieee1275/multiboot2.c [__i386__]: Include grub/cpu/multiboot.h. diff --git a/kern/i386/ieee1275/init.c b/kern/i386/ieee1275/init.c index 2289f9b24..7658ee1a7 100644 --- a/kern/i386/ieee1275/init.c +++ b/kern/i386/ieee1275/init.c @@ -20,6 +20,8 @@ #include #include +void grub_stop_floppy (void); + void grub_stop_floppy (void) { From b6783cb2ee3774ac8effceec014dd92813960b40 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 16:54:52 +0000 Subject: [PATCH 0840/1707] 2009-06-11 Pavel Roskin * kern/efi/efi.c (grub_exit): Add infinite loop at the end to fix a gcc warning and ensure that the function won't ever exit. --- ChangeLog | 3 +++ kern/efi/efi.c | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 1df378d5f..26d5adb64 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-11 Pavel Roskin + * kern/efi/efi.c (grub_exit): Add infinite loop at the end to + fix a gcc warning and ensure that the function won't ever exit. + * kern/i386/ieee1275/init.c: Add missing prototype for grub_stop_floppy(). diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 3da2beba3..8e09a90c0 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -158,6 +158,7 @@ grub_exit (void) grub_efi_fini (); efi_call_4 (grub_efi_system_table->boot_services->exit, grub_efi_image_handle, GRUB_EFI_SUCCESS, 0, 0); + for (;;) ; } void From f285fe2d539ab32043588d55d2be2f9349bd5815 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 17:02:26 +0000 Subject: [PATCH 0841/1707] 2009-06-11 Colin Watson * util/grub-pe2elf.c (usage): Fix references to grub-editenv. --- ChangeLog | 4 ++++ util/grub-pe2elf.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26d5adb64..63b41e1cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-11 Colin Watson + + * util/grub-pe2elf.c (usage): Fix references to grub-editenv. + 2009-06-11 Pavel Roskin * kern/efi/efi.c (grub_exit): Add infinite loop at the end to diff --git a/util/grub-pe2elf.c b/util/grub-pe2elf.c index ddcebc110..2b2a43ab7 100644 --- a/util/grub-pe2elf.c +++ b/util/grub-pe2elf.c @@ -40,10 +40,10 @@ static void usage (int status) { if (status) - fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n"); + fprintf (stderr, "Try ``grub-pe2elf --help'' for more information.\n"); else printf ("\ -Usage: grub-editenv [OPTIONS] input [output]\n\ +Usage: grub-pe2elf [OPTIONS] input [output]\n\ \n\ Tool to convert pe image to elf.\n\ \nOptions:\n\ From bd47b0b5c787fe56909db86176dfd33bcddc7019 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 17:06:35 +0000 Subject: [PATCH 0842/1707] 2009-06-11 Colin Watson * util/grub.d/10_linux.in: Capitalise "Linux". --- ChangeLog | 2 ++ util/grub.d/10_linux.in | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 63b41e1cd..354072e56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-06-11 Colin Watson + * util/grub.d/10_linux.in: Capitalise "Linux". + * util/grub-pe2elf.c (usage): Fix references to grub-editenv. 2009-06-11 Pavel Roskin diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index c2da41380..ce87cd6e4 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -141,9 +141,9 @@ while [ "x$list" != "x" ] ; do linux_root_device_thisversion=${GRUB_DEVICE} fi - linux_entry "${OS}, linux ${version}" \ + linux_entry "${OS}, Linux ${version}" \ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" - linux_entry "${OS}, linux ${version} (recovery mode)" \ + linux_entry "${OS}, Linux ${version} (recovery mode)" \ "single ${GRUB_CMDLINE_LINUX}" list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` From e65acb0ca87e80fbe6c75eca311bb0a096b72d11 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 17:31:38 +0000 Subject: [PATCH 0843/1707] 2009-06-11 Pavel Roskin * configure.ac: Remove host_m32. Issues with 64-bit utilities have long been resolved. --- ChangeLog | 5 +++++ configure.ac | 9 --------- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 354072e56..ba8e1afb8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-11 Pavel Roskin + + * configure.ac: Remove host_m32. Issues with 64-bit utilities + have long been resolved. + 2009-06-11 Colin Watson * util/grub.d/10_linux.in: Capitalise "Linux". diff --git a/configure.ac b/configure.ac index 6757d4f1c..ca8c265d1 100644 --- a/configure.ac +++ b/configure.ac @@ -43,10 +43,6 @@ AC_CANONICAL_TARGET # Program name transformations AC_ARG_PROGRAM -case "$host_cpu" in - powerpc64) host_m32=1 ;; -esac - case "$target_cpu" in i[[3456]]86) target_cpu=i386 ;; esac @@ -172,11 +168,6 @@ if test x$grub_cv_apple_cc == xyes ; then CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions" ASFLAGS="$ASFLAGS -DAPPLE_CC=1" fi -if test "x$host_m32" = x1; then - # Force 32-bit mode. - CFLAGS="$CFLAGS -m32" - LDFLAGS="$LDFLAGS -m32" -fi # Check LZO when compiling for the i386-pc. if test "$target_cpu"-"$platform" = i386-pc; then From 25ad23236f67b3af86ec74b2ad9703b0eecb47ec Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 11 Jun 2009 19:00:49 +0000 Subject: [PATCH 0844/1707] 2009-06-11 Felix Zielcke * util/grub.d/30_os-prober.in: Fix a comment. Source ${libdir}/grub/grub-mkconfig_lib. Use prepare_grub_to_access_device to set the root device. Place drivemap command in the generated chain entry. --- ChangeLog | 8 ++++++++ util/grub.d/30_os-prober.in | 26 +++++++++++++++++++------- 2 files changed, 27 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ba8e1afb8..a2b0ae1ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-11 Felix Zielcke + + * util/grub.d/30_os-prober.in: Fix a comment. Source + ${libdir}/grub/grub-mkconfig_lib. Use prepare_grub_to_access_device + to set the root device. Place drivemap command in the generated + chain entry. + 2009-06-11 Pavel Roskin * configure.ac: Remove host_m32. Issues with 64-bit utilities @@ -55,6 +62,7 @@ * loader/i386/multiboot.c (grub_multiboot_get_bootdev): likewise * loader/i386/pc/chainloader.c (grub_chainloader_cmd): likewise +>>>>>>> .r2306 2009-06-10 Pavel Roskin * io/gzio.c (test_header): Don't reuse one buffer for all data. diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index cb7f6428c..c042005d1 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -1,7 +1,7 @@ #! /bin/sh -e -# update-grub helper script. -# Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. +# grub-mkconfig helper script. +# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -16,6 +16,12 @@ # You should have received a copy of the GNU General Public License # along with GRUB. If not, see . +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ + +. ${libdir}/grub/grub-mkconfig_lib + if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then # missing os-prober and/or linux-boot-prober exit 0 @@ -45,7 +51,11 @@ for OS in ${OSPROBED} ; do cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" { - set root=${CHAINROOT} +EOF + prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + + cat << EOF + drivemap -s (hd0) \$root chainloader +1 } EOF @@ -61,15 +71,15 @@ EOF LINITRD="`echo ${LINUX} | cut -d ':' -f 5`" LPARAMS="`echo ${LINUX} | cut -d ':' -f 6- | tr '^' ' '`" - LINUXROOT="`grub-probe --target=drive --device ${LBOOT} 2> /dev/null`" - if [ -z "${LLABEL}" ] ; then LLABEL="${LONGNAME}" fi cat << EOF menuentry "${LLABEL} (on ${DEVICE})" { - set root=${LINUXROOT} +EOF + prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + cat << EOF linux ${LKERNEL} ${LPARAMS} EOF if [ -n "${LINITRD}" ] ; then @@ -88,7 +98,9 @@ EOF OSXDISK=disk"`echo ${OSXROOT} | awk -F , '{ print $1 ; }' | sed 's/(hd//;'`"s"`echo ${OSXROOT} | awk -F , '{ print $2 ; }' | sed 's/)//;'`" cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" { - set root=${OSXROOT} +EOF + prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + cat << EOF insmod vbe do_resume=0 if [ /var/vm/sleepimage -nt10 / ]; then From 8ada9bc12e7257974358d11c840ae52ca24379b6 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 19:11:25 +0000 Subject: [PATCH 0845/1707] 2009-06-11 Pavel Roskin * kern/i386/halt.c (grub_halt): Make `i' unsigned to fix a warning. --- ChangeLog | 5 +++++ kern/i386/halt.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a2b0ae1ae..b9a417cc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-11 Pavel Roskin + + * kern/i386/halt.c (grub_halt): Make `i' unsigned to fix a + warning. + 2009-06-11 Felix Zielcke * util/grub.d/30_os-prober.in: Fix a comment. Source diff --git a/kern/i386/halt.c b/kern/i386/halt.c index 3895ae113..41d3906e6 100644 --- a/kern/i386/halt.c +++ b/kern/i386/halt.c @@ -25,7 +25,7 @@ const char bochs_shutdown[] = "Shutdown"; void grub_halt (void) { - int i; + unsigned int i; /* Disable interrupts. */ __asm__ __volatile__ ("cli"); From 948f48e73124fec37d7400b4e7caaa67271884dc Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 11 Jun 2009 19:32:13 +0000 Subject: [PATCH 0846/1707] 2009-06-11 Giuseppe Caizzone UDF fix * fs/udf.c (grub_udf_read_block): handle the fact that ad->length is in bytes and not in blocks --- ChangeLog | 7 +++++++ fs/udf.c | 15 +++++++++------ 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index b9a417cc4..ed7c06d5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-11 Giuseppe Caizzone + + UDF fix + + * fs/udf.c (grub_udf_read_block): handle the fact that ad->length + is in bytes and not in blocks + 2009-06-11 Pavel Roskin * kern/i386/halt.c (grub_halt): Make `i' unsigned to fix a diff --git a/fs/udf.c b/fs/udf.c index 7741d45e7..9dfe431f6 100644 --- a/fs/udf.c +++ b/fs/udf.c @@ -407,6 +407,7 @@ grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) { char *ptr; int len; + grub_disk_addr_t filebytes; if (U16 (node->fe.tag.tag_ident) == GRUB_UDF_TAG_IDENT_FE) { @@ -425,16 +426,17 @@ grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) struct grub_udf_short_ad *ad = (struct grub_udf_short_ad *) ptr; len /= sizeof (struct grub_udf_short_ad); + filebytes = fileblock * GRUB_UDF_BLKSZ; while (len > 0) { - if (fileblock < U32 (ad->length)) + if (filebytes < U32 (ad->length)) return ((U32 (ad->position) & GRUB_UDF_EXT_MASK) ? 0 : (grub_udf_get_block (node->data, node->part_ref, ad->position) - + fileblock)); + + (filebytes / GRUB_UDF_BLKSZ))); - fileblock -= U32 (ad->length); + filebytes -= U32 (ad->length); ad++; len--; } @@ -444,16 +446,17 @@ grub_udf_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) struct grub_udf_long_ad *ad = (struct grub_udf_long_ad *) ptr; len /= sizeof (struct grub_udf_long_ad); + filebytes = fileblock * GRUB_UDF_BLKSZ; while (len > 0) { - if (fileblock < U32 (ad->length)) + if (filebytes < U32 (ad->length)) return ((U32 (ad->block.block_num) & GRUB_UDF_EXT_MASK) ? 0 : (grub_udf_get_block (node->data, ad->block.part_ref, ad->block.block_num) - + fileblock)); + + (filebytes / GRUB_UDF_BLKSZ))); - fileblock -= U32 (ad->length); + filebytes -= U32 (ad->length); ad++; len--; } From 7d83bd47b70779a8b065d094bd9f02a3029842d2 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 20:45:58 +0000 Subject: [PATCH 0847/1707] 2009-06-11 Pavel Roskin * configure.ac: Always define ___main if using -nostdlib. This fixes tests on Cygwin. --- ChangeLog | 9 +++++++-- configure.ac | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed7c06d5c..aa2299c8f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,10 +1,15 @@ +2009-06-11 Pavel Roskin + + * configure.ac: Always define ___main if using -nostdlib. This + fixes tests on Cygwin. + 2009-06-11 Giuseppe Caizzone UDF fix - * fs/udf.c (grub_udf_read_block): handle the fact that ad->length + * fs/udf.c (grub_udf_read_block): handle the fact that ad->length is in bytes and not in blocks - + 2009-06-11 Pavel Roskin * kern/i386/halt.c (grub_halt): Make `i' unsigned to fix a diff --git a/configure.ac b/configure.ac index ca8c265d1..b0f7bb728 100644 --- a/configure.ac +++ b/configure.ac @@ -396,7 +396,7 @@ AC_SUBST(TARGET_LDFLAGS) # Set them to their new values for the tests below. CC="$TARGET_CC" -CFLAGS="$TARGET_CFLAGS -nostdlib" +CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100" CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" From c1cb63ba4ec73a96cc537403c0c5258468ffa0d0 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 21:00:57 +0000 Subject: [PATCH 0848/1707] 2009-06-11 Pavel Roskin * Makefile.in: Don't rely on any scripts being executable. Always use $(SHELL) to run shell scripts. --- ChangeLog | 3 +++ Makefile.in | 34 +++++++++++++++++----------------- 2 files changed, 20 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index aa2299c8f..5c9d61d99 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-11 Pavel Roskin + * Makefile.in: Don't rely on any scripts being executable. + Always use $(SHELL) to run shell scripts. + * configure.ac: Always define ___main if using -nostdlib. This fixes tests on Cygwin. diff --git a/Makefile.in b/Makefile.in index 3ccb26518..677417443 100644 --- a/Makefile.in +++ b/Makefile.in @@ -211,20 +211,20 @@ all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) install: install-local install-local: all - $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) @list='$(PKGLIB)'; \ for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \ done - $(mkinstalldirs) $(DESTDIR)$(includedir) + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_DATA)'; \ for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,include/,,'`"; \ destdir="`echo $$dest | sed 's,[^/]*$$,,g'`"; \ - $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \ + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \ if test -f "$$dir$$file"; then \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ elif test -L "$$dir$$file"; then \ @@ -232,21 +232,21 @@ install-local: all cp -fP $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ fi; \ done - $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @list='$(PKGDATA)'; \ for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkgdatadir)/$$dest; \ done - $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(bindir) $(DESTDIR)$(mandir)/man1 @list='$(bin_UTILITIES)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_PROGRAM) $$dir$$file $(DESTDIR)$(bindir)/$$dest; \ $(HELP2MAN) --section=1 -o $(DESTDIR)$(mandir)/man1/$$dest.1 $(builddir)/$$file; \ done - $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sbindir) $(DESTDIR)$(mandir)/man8 @list='$(sbin_UTILITIES)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ @@ -265,7 +265,7 @@ install-local: all $(INSTALL_SCRIPT) $$dir$$file $(DESTDIR)$(sbindir)/$$dest; \ $(HELP2MAN) --section=8 -o $(DESTDIR)$(mandir)/man8/$$dest.8 $(builddir)/$$file; \ done - $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(sysconfdir)/grub.d @list='$(grub-mkconfig_SCRIPTS)'; for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ @@ -276,7 +276,7 @@ install-local: all dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ done - $(mkinstalldirs) $(DESTDIR)$(libdir)/grub + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(libdir)/grub @list='$(lib_DATA)'; \ for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ @@ -342,15 +342,15 @@ dvi: distdir=$(PACKAGE_TARNAME)-$(PACKAGE_VERSION) DISTLIST: gendistlist.sh - sh $(srcdir)/gendistlist.sh > $(srcdir)/DISTLIST + $(SHELL) $(srcdir)/gendistlist.sh > $(srcdir)/DISTLIST distdir: DISTLIST -chmod -R a+w $(distdir) >/dev/null 2>&1; rm -rf $(distdir) - $(mkinstalldirs) $(distdir) + $(SHELL) $(mkinstalldirs) $(distdir) for i in `cat $(srcdir)/DISTLIST`; do \ dir=`echo "$$i" | sed 's:/[^/]*$$::'`; \ if test -d $(srcdir)/$$dir; then \ - $(mkinstalldirs) $(distdir)/$$dir; \ + $(SHELL) $(mkinstalldirs) $(distdir)/$$dir; \ fi; \ cp -p $(srcdir)/$$i $(distdir)/$$i || exit 1; \ done @@ -372,7 +372,7 @@ distcheck: dist chmod a-w $(distdir) dc_instdir=`CDPATH=: && cd $(distdir)/=inst && pwd` \ && cd $(distdir)/=build \ - && ../configure --srcdir=.. --prefix=$$dc_instdir \ + && $(SHELL) ../configure --srcdir=.. --prefix=$$dc_instdir \ && $(MAKE) all dvi check install && $(MAKE) uninstall \ && (test `find $$dc_instdir -type f -print | wc -l` -le 1 \ || (echo "Error: files left after uninstall" 1>&2; \ @@ -402,19 +402,19 @@ $(srcdir)/stamp-h.in: configure.ac aclocal.m4 config.h: stamp-h stamp-h: config.h.in config.status - ./config.status + $(SHELL) ./config.status Makefile: Makefile.in config.status - ./config.status + $(SHELL) ./config.status config.status: configure - ./config.status --recheck + $(SHELL) ./config.status --recheck gensymlist.sh: gensymlist.sh.in config.status - ./config.status + $(SHELL) ./config.status genkernsyms.sh: genkernsyms.sh.in config.status - ./config.status + $(SHELL) ./config.status .PHONY: all install install-strip uninstall clean mostlyclean distclean .PHONY: maintainer-clean info dvi dist check From 5225e649b158094a9911a66f5871ea937119ac56 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 11 Jun 2009 21:28:11 +0000 Subject: [PATCH 0849/1707] 2009-06-11 Felix Zielcke * conf/i386-ieee1275.rmk (COMMON_LDFLAGS): Remove `-static -lgcc'. --- ChangeLog | 4 ++++ conf/i386-ieee1275.rmk | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5c9d61d99..9809b4f34 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-11 Felix Zielcke + + * conf/i386-ieee1275.rmk (COMMON_LDFLAGS): Remove `-static -lgcc'. + 2009-06-11 Pavel Roskin * Makefile.in: Don't rely on any scripts being executable. diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 6e91b420c..5a336995f 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -2,7 +2,7 @@ COMMON_ASFLAGS = -m32 -nostdinc -fno-builtin COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 -COMMON_LDFLAGS = -nostdlib -static -lgcc +COMMON_LDFLAGS = -nostdlib # Used by various components. These rules need to precede them. script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h From af1f4f55f8e995b22cb09d772480de6edeef5f92 Mon Sep 17 00:00:00 2001 From: chrfranke Date: Thu, 11 Jun 2009 21:39:03 +0000 Subject: [PATCH 0850/1707] 2009-06-11 Christian Franke * kern/misc.c (__enable_execute_stack): Add missing return type to prevent gcc warning. --- ChangeLog | 5 +++++ kern/misc.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9809b4f34..5863073b7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-11 Christian Franke + + * kern/misc.c (__enable_execute_stack): Add missing return type + to prevent gcc warning. + 2009-06-11 Felix Zielcke * conf/i386-ieee1275.rmk (COMMON_LDFLAGS): Remove `-static -lgcc'. diff --git a/kern/misc.c b/kern/misc.c index d8eff6883..d797f1781 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -1106,7 +1106,7 @@ void abort (void) __attribute__ ((alias ("grub_abort"))); #ifdef NEED_ENABLE_EXECUTE_STACK /* Some gcc versions generate a call to this function in trampolines for nested functions. */ -__enable_execute_stack (void *addr __attribute__ ((unused))) +void __enable_execute_stack (void *addr __attribute__ ((unused))) { } #endif From 3a4575d4ea56c41583216ed74ed698c708104853 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 21:48:48 +0000 Subject: [PATCH 0851/1707] 2009-06-11 Pavel Roskin * loader/i386/bsd.c (grub_freebsd_boot): Rename `entry' to `entry_lo' to fix variable shadowing. --- ChangeLog | 5 +++++ loader/i386/bsd.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5863073b7..5c2378dd7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-11 Pavel Roskin + + * loader/i386/bsd.c (grub_freebsd_boot): Rename `entry' to + `entry_lo' to fix variable shadowing. + 2009-06-11 Christian Franke * kern/misc.c (__enable_execute_stack): Add missing return type diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index c6a97724d..6214b001c 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -485,7 +485,7 @@ grub_freebsd_boot (void) { grub_uint32_t *gdt; grub_uint8_t *trampoline; - void (*launch_trampoline) (grub_addr_t entry, ...) + void (*launch_trampoline) (grub_addr_t entry_lo, ...) __attribute__ ((cdecl, regparm (0))); grub_uint8_t *pagetable; @@ -512,7 +512,7 @@ grub_freebsd_boot (void) trampoline = (grub_uint8_t *) (kern_end - 4096 + 24 + sizeof (struct gdt_descriptor)); launch_trampoline = (void __attribute__ ((cdecl, regparm (0))) - (*) (grub_addr_t entry, ...)) trampoline; + (*) (grub_addr_t entry_lo, ...)) trampoline; grub_bsd64_trampoline_gdt = (grub_uint32_t) gdtdesc; grub_bsd64_trampoline_selfjump = (grub_uint32_t) (trampoline + 6 From e3b27c39fc3fb21b32e03b66b887255bd5b567bb Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 11 Jun 2009 22:14:54 +0000 Subject: [PATCH 0852/1707] 2009-06-11 Pavel Roskin * disk/usbms.c (grub_usbms_transfer): Initialize `err' to fix a compiler warning. --- ChangeLog | 3 +++ disk/usbms.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5c2378dd7..d99396d93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-11 Pavel Roskin + * disk/usbms.c (grub_usbms_transfer): Initialize `err' to fix + a compiler warning. + * loader/i386/bsd.c (grub_freebsd_boot): Rename `entry' to `entry_lo' to fix variable shadowing. diff --git a/disk/usbms.c b/disk/usbms.c index 147891956..3c7ebaf94 100644 --- a/disk/usbms.c +++ b/disk/usbms.c @@ -221,7 +221,7 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, grub_usbms_dev_t dev = (grub_usbms_dev_t) scsi->data; struct grub_usbms_csw status; static grub_uint32_t tag = 0; - grub_usb_err_t err; + grub_usb_err_t err = GRUB_USB_ERR_NONE; int retrycnt = 3; retry: From ca0388f08492bf19641fd7149d66df7b1e6dedb0 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 12 Jun 2009 02:10:21 +0000 Subject: [PATCH 0853/1707] 2009-06-11 Pavel Roskin * Makefile.in: Rename lib_DATA to lib_SCRIPTS, move it from PKGLIB to SCRIPTS. This fixes installation of grub-mkconfig_lib and update-grub_lib in two places. * conf/common.rmk: Rename lib_DATA to lib_SCRIPTS. --- ChangeLog | 5 +++++ Makefile.in | 9 +++++---- conf/common.rmk | 4 ++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index d99396d93..9c69b13b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-06-11 Pavel Roskin + * Makefile.in: Rename lib_DATA to lib_SCRIPTS, move it from + PKGLIB to SCRIPTS. This fixes installation of grub-mkconfig_lib + and update-grub_lib in two places. + * conf/common.rmk: Rename lib_DATA to lib_SCRIPTS. + * disk/usbms.c (grub_usbms_transfer): Initialize `err' to fix a compiler warning. diff --git a/Makefile.in b/Makefile.in index 677417443..40bc140fa 100644 --- a/Makefile.in +++ b/Makefile.in @@ -118,10 +118,11 @@ RMKFILES = $(addprefix conf/,common.rmk i386-coreboot.rmk i386-efi.rmk \ MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ - $(pkglib_DATA) $(lib_DATA) $(pkglib_BUILDDIR) + $(pkglib_DATA) $(pkglib_BUILDDIR) PKGDATA = $(pkgdata_DATA) $(pkgdata_SRCDIR) PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) -SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) +SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) \ + $(lib_SCRIPTS) CLEANFILES = MOSTLYCLEANFILES = @@ -277,7 +278,7 @@ install-local: all $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ done $(SHELL) $(mkinstalldirs) $(DESTDIR)$(libdir)/grub - @list='$(lib_DATA)'; \ + @list='$(lib_SCRIPTS)'; \ for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,.*/,,'`"; \ @@ -315,7 +316,7 @@ uninstall: dest="`echo $$file | sed 's,include/,,'`"; \ rm -f $(DESTDIR)$(includedir)/$$dest; \ done - @list='$(lib_DATA)'; \ + @list='$(lib_SCRIPTS)'; \ for file in $$list; do \ dest="`echo $$file | sed 's,.*/,,'`"; \ echo rm -f $(DESTDIR)$(libdir)/$$dest; \ diff --git a/conf/common.rmk b/conf/common.rmk index 2dcf2d628..3d74f902d 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -145,13 +145,13 @@ CLEANFILES += grub-mkconfig grub-mkconfig_lib: util/grub-mkconfig_lib.in config.status ./config.status --file=$@:$< chmod +x $@ -lib_DATA += grub-mkconfig_lib +lib_SCRIPTS += grub-mkconfig_lib CLEANFILES += grub-mkconfig_lib update-grub_lib: util/update-grub_lib.in config.status ./config.status --file=$@:$< chmod +x $@ -lib_DATA += update-grub_lib +lib_SCRIPTS += update-grub_lib CLEANFILES += update-grub_lib %: util/grub.d/%.in config.status From 0658e928cfe8c1455b6f3078cc480e7ba8ca3ccc Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 12 Jun 2009 02:42:26 +0000 Subject: [PATCH 0854/1707] 2009-06-11 Pavel Roskin * Makefile.in (uninstall): Uninstall manuals. --- ChangeLog | 2 ++ Makefile.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9c69b13b9..a16d5392c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-06-11 Pavel Roskin + * Makefile.in (uninstall): Uninstall manuals. + * Makefile.in: Rename lib_DATA to lib_SCRIPTS, move it from PKGLIB to SCRIPTS. This fixes installation of grub-mkconfig_lib and update-grub_lib in two places. diff --git a/Makefile.in b/Makefile.in index 40bc140fa..35e24aee0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -302,10 +302,12 @@ uninstall: @list='$(bin_UTILITIES) $(bin_SCRIPTS)'; for file in $$list; do \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ rm -f $(DESTDIR)$(bindir)/$$dest; \ + rm -f $(DESTDIR)$(mandir)/man1/$$dest.1; \ done @list='$(sbin_UTILITIES) $(sbin_SCRIPTS)'; for file in $$list; do \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ rm -f $(DESTDIR)$(sbindir)/$$dest; \ + rm -f $(DESTDIR)$(mandir)/man8/$$dest.8; \ done @list='$(grub-mkconfig_SCRIPTS) $(grub-mkconfig_DATA)'; for file in $$list; do \ dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ From 3daba08cfa461b712d4e1525645be8d905e74524 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 12 Jun 2009 06:12:38 +0000 Subject: [PATCH 0855/1707] Fix spacing --- commands/i386/pc/drivemap_int13h.S | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 96848fb65..8d360e752 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -28,7 +28,7 @@ /* The replacement int13 handler. Preserve all registers. */ FUNCTION(grub_drivemap_handler) /* Save %dx for future restore. */ - push %dx + push %dx /* Push flags. Used to simulate interrupt with original flags. */ pushf @@ -56,9 +56,9 @@ not_found: pop %bx pop %ax - cmpb $0x8, %ah + cmpb $0x8, %ah jz norestore - cmpb $0x15, %ah + cmpb $0x15, %ah jz norestore /* Restore flags. */ @@ -66,20 +66,20 @@ not_found: pushf lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler)) - - push %bp - mov %sp, %bp + + push %bp + mov %sp, %bp tail: - + pushf - pop %dx - mov %dx, 8(%bp) + pop %dx + mov %dx, 8(%bp) pop %bp - + /* Restore %dx. */ - pop %dx + pop %dx iret norestore: @@ -90,14 +90,14 @@ norestore: lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler)) - push %bp - mov %sp, %bp - + push %bp + mov %sp, %bp + /* Save %dx. */ - mov %dx, 2(%bp) + mov %dx, 2(%bp) jmp tail - + /* Far pointer to the old handler. Stored as a CS:IP in the style of real-mode IVT entries (thus PI:SC in mem). */ VARIABLE(grub_drivemap_oldhandler) From 3a1acfe21ddbf3edd5b3168aad6703c59003c393 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 12 Jun 2009 18:22:38 +0000 Subject: [PATCH 0856/1707] 2009-06-12 Vladimir Serbinenko * commands/i386/pc/drivemap_int13h.S: add more comments --- ChangeLog | 4 ++++ commands/i386/pc/drivemap_int13h.S | 5 +++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a16d5392c..c0f0ba472 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-12 Vladimir Serbinenko + + * commands/i386/pc/drivemap_int13h.S: add more comments + 2009-06-11 Pavel Roskin * Makefile.in (uninstall): Uninstall manuals. diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 8d360e752..542da0900 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -56,6 +56,7 @@ not_found: pop %bx pop %ax + /* If the call isn't ah=0x8 or ah=0x15 we must restore %dx. */ cmpb $0x8, %ah jz norestore cmpb $0x15, %ah @@ -71,7 +72,7 @@ not_found: mov %sp, %bp tail: - + /* Save new flags below %esp so the caller will recieve new flags. */ pushf pop %dx mov %dx, 8(%bp) @@ -93,7 +94,7 @@ norestore: push %bp mov %sp, %bp - /* Save %dx. */ + /* Save %dx. So it won't be restored to original value. */ mov %dx, 2(%bp) jmp tail From e40893c365ae499a9dfa625c43bd27961d02ac68 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 12 Jun 2009 20:11:19 +0000 Subject: [PATCH 0857/1707] 2009-06-12 Pavel Roskin * Makefile.in (pkgdata_SRCDIR): Remove. genmodsrc.sh and genmk.rb don't need to be generated or installed. --- ChangeLog | 5 +++++ Makefile.in | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0f0ba472..b41dd6c48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-12 Pavel Roskin + + * Makefile.in (pkgdata_SRCDIR): Remove. genmodsrc.sh and + genmk.rb don't need to be generated or installed. + 2009-06-12 Vladimir Serbinenko * commands/i386/pc/drivemap_int13h.S: add more comments diff --git a/Makefile.in b/Makefile.in index 35e24aee0..f82566a70 100644 --- a/Makefile.in +++ b/Makefile.in @@ -119,7 +119,7 @@ MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) PKGLIB = $(pkglib_IMAGES) $(pkglib_MODULES) $(pkglib_PROGRAMS) \ $(pkglib_DATA) $(pkglib_BUILDDIR) -PKGDATA = $(pkgdata_DATA) $(pkgdata_SRCDIR) +PKGDATA = $(pkgdata_DATA) PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) \ $(lib_SCRIPTS) @@ -204,7 +204,6 @@ build_env.mk: Makefile echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\ ) > $@ pkglib_BUILDDIR += config.h grub_script.tab.h -pkgdata_SRCDIR += genmodsrc.sh genmk.rb include_DATA += $(shell find $(srcdir)/include -name \*.h | sed -e "s,^$(srcdir)/,,g") include/grub/cpu all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) From 880fc3c4f0a1e5d1d15ceffc6677c16c4267b182 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 13 Jun 2009 09:23:54 +0000 Subject: [PATCH 0858/1707] 2009-06-13 Jun Inoue * util/grub-mkconfig.in: Fix parsing of --output option. --- ChangeLog | 4 ++++ util/grub-mkconfig.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b41dd6c48..95c6ad243 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-13 Jun Inoue + + * util/grub-mkconfig.in: Fix parsing of --output option. + 2009-06-12 Pavel Roskin * Makefile.in (pkgdata_SRCDIR): Remove. genmodsrc.sh and diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index aad0683d8..6c18f6ac1 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -58,7 +58,7 @@ for option in "$@"; do shift grub_cfg=$1 ;; - --output=) + --output=*) grub_cfg=`echo "$option" | sed 's/--output=//'` ;; -*) From 71c79a6b3bce360ee053bb3abec82773f4ca022d Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 13 Jun 2009 21:09:11 +0000 Subject: [PATCH 0859/1707] 2009-06-13 Vladimir Serbinenko * loader/i386/multiboot.c (grub_multiboot_get_bootdev): fix partition handling --- ChangeLog | 5 +++++ loader/i386/multiboot.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95c6ad243..557a33a19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-13 Vladimir Serbinenko + + * loader/i386/multiboot.c (grub_multiboot_get_bootdev): fix partition + handling + 2009-06-13 Jun Inoue * util/grub-mkconfig.in: Fix parsing of --output option. diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index efca6511c..8ce315eab 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -170,7 +170,7 @@ grub_multiboot_get_bootdev (grub_uint32_t *bootdev) { if ((p[0] >= '0') && (p[0] <= '9')) { - slice = grub_strtoul (p, &p, 0); + slice = grub_strtoul (p, &p, 0) - 1; if ((p) && (p[0] == ',')) p++; @@ -184,7 +184,7 @@ grub_multiboot_get_bootdev (grub_uint32_t *bootdev) grub_device_close (dev); *bootdev = ((biosdev & 0xff) << 24) | ((slice & 0xff) << 16) - | ((part & 0xff) << 16) | 0xff; + | ((part & 0xff) << 8) | 0xff; return (biosdev != ~0UL); #else *bootdev = 0xffffffff; From 70b7f9fd5760cbac89caf3b4ff626fa014033821 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 15 Jun 2009 20:59:55 +0000 Subject: [PATCH 0860/1707] 2009-06-15 Vladimir Serbinenko Fix handling of string like \"hello\" and "a b" * script/sh/lexer.c (check_textstate): accept GRUB_PARSER_STATE_ESC --- ChangeLog | 8 ++++++++ script/sh/lexer.c | 1 + 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 557a33a19..df404336e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-06-15 Vladimir Serbinenko + + Fix handling of string like \"hello\" and "a + b" + + * script/sh/lexer.c (check_textstate): accept GRUB_PARSER_STATE_ESC + (grub_script_yylex): fix parsing of quoting, escaping and newline + 2009-06-13 Vladimir Serbinenko * loader/i386/multiboot.c (grub_multiboot_get_bootdev): fix partition diff --git a/script/sh/lexer.c b/script/sh/lexer.c index aa8ac35aa..f21430fe1 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -39,6 +39,7 @@ static int check_textstate (grub_parser_state_t state) { return (state == GRUB_PARSER_STATE_TEXT + || state == GRUB_PARSER_STATE_ESC || state == GRUB_PARSER_STATE_QUOTE || state == GRUB_PARSER_STATE_DQUOTE); } From 3148bc1cbd9e440728b49004943b68235324752b Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 15 Jun 2009 21:04:17 +0000 Subject: [PATCH 0861/1707] 2009-06-15 Vladimir Serbinenko Fix handling of string like \"hello\" and "a b" * script/sh/lexer.c (grub_script_yylex): fix parsing of quoting, escaping and newline --- script/sh/lexer.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/script/sh/lexer.c b/script/sh/lexer.c index f21430fe1..d3577d44c 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -156,18 +156,20 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) return token; } - for (;! state->done && (*state->script || firstrun); firstrun = 0) + for (;! state->done; firstrun = 0) { if (! *state->script) { /* Check if more tokens are requested by the parser. */ if (((state->refs && ! parsestate->err) - || state->state == GRUB_PARSER_STATE_ESC) + || state->state == GRUB_PARSER_STATE_ESC + || state->state == GRUB_PARSER_STATE_QUOTE + || state->state == GRUB_PARSER_STATE_DQUOTE) && state->getline) { int doexit = 0; - while (!state->script || ! grub_strlen (state->script)) + while (!state->script || ! *state->script) { grub_free (state->newscript); state->newscript = 0; From f3880eaf5e07f5a32273f3f346fbc530e7b0aba4 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 15 Jun 2009 21:05:50 +0000 Subject: [PATCH 0862/1707] 2009-06-15 Vladimir Serbinenko Fix handling of string like \"hello\" and "a b" * script/sh/lexer.c (check_textstate): accept GRUB_PARSER_STATE_ESC (grub_script_yylex): fix parsing of quoting, escaping and newline --- script/sh/lexer.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/script/sh/lexer.c b/script/sh/lexer.c index d3577d44c..47939c96d 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -185,11 +185,18 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) break; grub_dprintf ("scripting", "token=`\\n'\n"); recordchar (state, '\n'); - if (state->state != GRUB_PARSER_STATE_ESC) + if (state->state != GRUB_PARSER_STATE_ESC + && state->state != GRUB_PARSER_STATE_DQUOTE + && state->state != GRUB_PARSER_STATE_QUOTE) { state->tokenonhold = '\n'; break; } + if (state->state == GRUB_PARSER_STATE_DQUOTE + || state->state == GRUB_PARSER_STATE_QUOTE) + yylval->arg = grub_script_arg_add (parsestate, yylval->arg, + GRUB_SCRIPT_ARG_TYPE_STR, + "\n"); } else { From 15a0c03ead7144c5bbc78e5399d7f34387330206 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 15 Jun 2009 21:06:58 +0000 Subject: [PATCH 0863/1707] 2009-06-15 Vladimir Serbinenko Fix handling of string like \"hello\" and "a b" * script/sh/lexer.c (grub_script_yylex): fix parsing of quoting, escaping and newline --- script/sh/lexer.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/script/sh/lexer.c b/script/sh/lexer.c index 47939c96d..99bd3baac 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -280,7 +280,9 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) when a special token was found. It will be recognized next time when this function is called. */ if (newstate == GRUB_PARSER_STATE_TEXT - && state->state != GRUB_PARSER_STATE_ESC) + && state->state != GRUB_PARSER_STATE_ESC + && state->state != GRUB_PARSER_STATE_QUOTE + && state->state != GRUB_PARSER_STATE_DQUOTE) { int breakout = 0; From ebc621eac9b7e5c226cecf621d663347f4bb7070 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 15 Jun 2009 21:09:41 +0000 Subject: [PATCH 0864/1707] Removed bogus >>>> from ChangeLog --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index df404336e..893bfdf16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -132,7 +132,6 @@ * loader/i386/multiboot.c (grub_multiboot_get_bootdev): likewise * loader/i386/pc/chainloader.c (grub_chainloader_cmd): likewise ->>>>>>> .r2306 2009-06-10 Pavel Roskin * io/gzio.c (test_header): Don't reuse one buffer for all data. From 9c6f45968864ac50f372fb8ee4fb9ebf1cdddb29 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 15 Jun 2009 22:41:42 +0000 Subject: [PATCH 0865/1707] 2009-06-16 Vladimir Serbinenko Probe command * commands/probe.c: new file * conf/common.rmk (pkglib_MODULES): add probe.mod (probe_mod_SOURCES): new variable (probe_mod_CFLAGS): likewise (probe_mod_LDFLAGS): likewise * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise --- ChangeLog | 15 ++++ commands/probe.c | 160 ++++++++++++++++++++++++++++++++++++++ conf/common.rmk | 8 +- conf/i386-coreboot.rmk | 2 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 1 + 8 files changed, 187 insertions(+), 5 deletions(-) create mode 100644 commands/probe.c diff --git a/ChangeLog b/ChangeLog index 893bfdf16..e86f95237 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-06-16 Vladimir Serbinenko + + Probe command + + * commands/probe.c: new file + * conf/common.rmk (pkglib_MODULES): add probe.mod + (probe_mod_SOURCES): new variable + (probe_mod_CFLAGS): likewise + (probe_mod_LDFLAGS): likewise + * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c + * conf/i386-ieee1275.rmk: likewise + * conf/i386-pc.rmk: likewise + * conf/powerpc-ieee1275.rmk: likewise + * conf/sparc64-ieee1275.rmk: likewise + 2009-06-15 Vladimir Serbinenko Fix handling of string like \"hello\" and "a diff --git a/commands/probe.c b/commands/probe.c new file mode 100644 index 000000000..463190788 --- /dev/null +++ b/commands/probe.c @@ -0,0 +1,160 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static const struct grub_arg_option options[] = + { + {"set", 's', GRUB_ARG_OPTION_OPTIONAL, + "set a variable to return value", "VAR", ARG_TYPE_STRING}, + {"driver", 'd', 0, "determine driver", 0, 0}, + {"partmap", 'p', 0, "determine partion map type", 0, 0}, + {"fs", 'f', 0, "determine filesystem type", 0, 0}, + {"fs-uuid", 'u', 0, "determine filesystem UUID", 0, 0}, + {"label", 'l', 0, "determine filesystem label", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + +static grub_err_t +grub_cmd_probe (grub_extcmd_t cmd, int argc, char **args) +{ + struct grub_arg_list *state = cmd->state; + grub_device_t dev; + grub_fs_t fs; + char *ptr; + grub_err_t err; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "device name required"); + + ptr = args[0] + grub_strlen (args[0]) - 1; + if (args[0][0] == '(' && *ptr == ')') + { + *ptr = 0; + dev = grub_device_open (args[0] + 1); + *ptr = ')'; + } + else + dev = grub_device_open (args[0]); + if (! dev) + return grub_error (GRUB_ERR_BAD_DEVICE, "couldn't open device"); + + if (state[1].set) + { + const char *val = "none"; + if (dev->net) + val = dev->net->dev->name; + if (dev->disk) + val = dev->disk->dev->name; + if (state[0].set) + grub_env_set (state[0].arg, val); + else + grub_printf ("%s", val); + return GRUB_ERR_NONE; + } + if (state[2].set) + { + const char *val = "none"; + if (dev->disk && dev->disk->partition) + val = dev->disk->partition->partmap->name; + if (state[0].set) + grub_env_set (state[0].arg, val); + else + grub_printf ("%s", val); + return GRUB_ERR_NONE; + } + fs = grub_fs_probe (dev); + if (! fs) + return grub_error (GRUB_ERR_UNKNOWN_FS, "unrecognised fs"); + if (state[3].set) + { + if (state[0].set) + grub_env_set (state[0].arg, fs->name); + else + grub_printf ("%s", fs->name); + return GRUB_ERR_NONE; + } + if (state[4].set) + { + char *uuid; + if (! fs->uuid) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "uuid for this FS isn't supported yet"); + err = fs->uuid (dev, &uuid); + if (err) + return err; + if (! uuid) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "uuid for this FS isn't supported yet"); + + if (state[0].set) + grub_env_set (state[0].arg, uuid); + else + grub_printf ("%s", uuid); + grub_free (uuid); + return GRUB_ERR_NONE; + } + if (state[5].set) + { + char *label; + if (! fs->label) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "label for this FS isn't supported yet"); + err = fs->label (dev, &label); + if (err) + return err; + if (! label) + return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, + "uuid for this FS isn't supported yet"); + + if (state[0].set) + grub_env_set (state[0].arg, label); + else + grub_printf ("%s", label); + grub_free (label); + return GRUB_ERR_NONE; + } + return grub_error (GRUB_ERR_BAD_ARGUMENT, "unrecognised target"); +} + +static grub_extcmd_t cmd; + +GRUB_MOD_INIT (probe) +{ + cmd = grub_register_extcmd ("probe", grub_cmd_probe, GRUB_COMMAND_FLAG_BOTH, + "probe [--target=target] [DEVICE]", + "Retrieve device info.", options); +} + +GRUB_MOD_FINI (probe) +{ + grub_unregister_extcmd (cmd); +} diff --git a/conf/common.rmk b/conf/common.rmk index 3d74f902d..765bdbe5c 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -354,7 +354,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ pcpart.mod memrw.mod normal.mod sh.mod lua.mod \ - gptsync.mod true.mod + gptsync.mod true.mod probe.mod # For gptsync.mod. gptsync_mod_SOURCES = commands/gptsync.c @@ -486,6 +486,11 @@ true_mod_SOURCES = commands/true.c true_mod_CFLAGS = $(COMMON_CFLAGS) true_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For probe.mod. +probe_mod_SOURCES = commands/probe.c +probe_mod_CFLAGS = $(COMMON_CFLAGS) +probe_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For normal.mod. normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \ normal/autofs.c normal/handler.c \ @@ -580,3 +585,4 @@ gzio_mod_LDFLAGS = $(COMMON_LDFLAGS) bufio_mod_SOURCES = io/bufio.c bufio_mod_CFLAGS = $(COMMON_CFLAGS) bufio_mod_LDFLAGS = $(COMMON_LDFLAGS) + diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 483f279ad..0709aacb8 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/gptsync.c \ + commands/gptsync.c commands/probe.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 5a336995f..aa260abe5 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ - commands/gptsync.c commands/i386/cpuid.c \ + commands/gptsync.c commands/probe.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index abb6fd565..e00009720 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -127,7 +127,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ - commands/gptsync.c commands/i386/cpuid.c \ + commands/gptsync.c commands/probe.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c disk/scsi.c \ fs/fshelp.c \ \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 157b6e2c3..0e0f01a03 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -45,7 +45,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ - commands/gptsync.c \ + commands/gptsync.c commands/probe.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 3a8cbe260..ce5e98165 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -101,6 +101,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ + commands/probe.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ From c9da87d0f3c8507f5a30d2ca3850007bb2ce4399 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 15 Jun 2009 22:45:17 +0000 Subject: [PATCH 0866/1707] 2009-06-16 Pavel Roskin * configure.ac: Avoid '==' in test command, it's not portable. --- ChangeLog | 4 ++++ configure.ac | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e86f95237..5549c4cfd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-16 Pavel Roskin + + * configure.ac: Avoid '==' in test command, it's not portable. + 2009-06-16 Vladimir Serbinenko Probe command diff --git a/configure.ac b/configure.ac index b0f7bb728..371c32d03 100644 --- a/configure.ac +++ b/configure.ac @@ -164,7 +164,7 @@ AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long) grub_apple_cc -if test x$grub_cv_apple_cc == xyes ; then +if test x$grub_cv_apple_cc = xyes ; then CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions" ASFLAGS="$ASFLAGS -DAPPLE_CC=1" fi @@ -273,7 +273,7 @@ if test "x$TARGET_CFLAGS" = x; then fi grub_apple_target_cc -if test x$grub_cv_apple_target_cc == xyes ; then +if test x$grub_cv_apple_target_cc = xyes ; then TARGET_CFLAGS="$TARGET_CFLAGS -DAPPLE_CC=1 -fnested-functions" CFLAGS="$CFLAGS -DAPPLE_CC=1 -fnested-functions" TARGET_ASFLAGS="$TARGET_ASFLAGS -DAPPLE_CC=1" From 693fe63766861df2e88bfacc5efe059983657bfe Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 15 Jun 2009 22:57:39 +0000 Subject: [PATCH 0867/1707] 2009-06-16 Vladimir Serbinenko xnu_uuid command * commands/xnu_uuid.c: new file * conf/common.rmk (pkglib_MODULES): add xnu_uuid.mod (xnu_uuid_mod_SOURCES): new variable (xnu_uuid_mod_CFLAGS): likewise (xnu_uuid_mod_LDFLAGS): likewise * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c * conf/i386-ieee1275.rmk: likewise * conf/i386-pc.rmk: likewise * conf/powerpc-ieee1275.rmk: likewise * conf/sparc64-ieee1275.rmk: likewise * util/grub.d/30_os-prober.in: use UUID for Mac OS X/Darwin --- ChangeLog | 16 ++ commands/xnu_uuid.c | 399 ++++++++++++++++++++++++++++++++++++ conf/common.rmk | 7 + conf/i386-coreboot.rmk | 2 +- conf/i386-ieee1275.rmk | 3 +- conf/i386-pc.rmk | 3 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- include/grub/misc.h | 9 + util/grub.d/30_os-prober.in | 7 +- 10 files changed, 441 insertions(+), 9 deletions(-) create mode 100644 commands/xnu_uuid.c diff --git a/ChangeLog b/ChangeLog index 5549c4cfd..27c0eec5c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-06-16 Vladimir Serbinenko + + xnu_uuid command + + * commands/xnu_uuid.c: new file + * conf/common.rmk (pkglib_MODULES): add xnu_uuid.mod + (xnu_uuid_mod_SOURCES): new variable + (xnu_uuid_mod_CFLAGS): likewise + (xnu_uuid_mod_LDFLAGS): likewise + * conf/i386-coreboot.rmk (grub_emu_SOURCES): add commands/probe.c + * conf/i386-ieee1275.rmk: likewise + * conf/i386-pc.rmk: likewise + * conf/powerpc-ieee1275.rmk: likewise + * conf/sparc64-ieee1275.rmk: likewise + * util/grub.d/30_os-prober.in: use UUID for Mac OS X/Darwin + 2009-06-16 Pavel Roskin * configure.ac: Avoid '==' in test command, it's not portable. diff --git a/commands/xnu_uuid.c b/commands/xnu_uuid.c new file mode 100644 index 000000000..1302881fa --- /dev/null +++ b/commands/xnu_uuid.c @@ -0,0 +1,399 @@ +/* xnu_uuid.c - transform 64-bit serial number + to 128-bit uuid suitable for xnu. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1995,1996,1998,1999,2001,2002, + * 2003, 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +struct tohash +{ + grub_uint8_t prefix[16]; + grub_uint64_t serial; +} __attribute__ ((packed)); + +/* This prefix is used by xnu and boot-132 to hash + together with volume serial. */ +static grub_uint8_t hash_prefix[16] + = {0xB3, 0xE2, 0x0F, 0x39, 0xF2, 0x92, 0x11, 0xD6, + 0x97, 0xA4, 0x00, 0x30, 0x65, 0x43, 0xEC, 0xAC}; + +#define rol(x,n) ( ((x) << (n)) | ((x) >> (32-(n))) ) +#define ror(x,n) ( ((x) >> (n)) | ((x) << (32-(n))) ) + +typedef struct { + grub_uint32_t A,B,C,D; /* chaining variables */ + grub_uint32_t nblocks; + grub_uint8_t buf[64]; + int count; +} MD5_CONTEXT; + +static void +md5_init( void *context ) +{ + MD5_CONTEXT *ctx = context; + + ctx->A = 0x67452301; + ctx->B = 0xefcdab89; + ctx->C = 0x98badcfe; + ctx->D = 0x10325476; + + ctx->nblocks = 0; + ctx->count = 0; +} + +/* These are the four functions used in the four steps of the MD5 algorithm + and defined in the RFC 1321. The first function is a little bit optimized + (as found in Colin Plumbs public domain implementation). */ +/* #define FF(b, c, d) ((b & c) | (~b & d)) */ +#define FF(b, c, d) (d ^ (b & (c ^ d))) +#define FG(b, c, d) FF (d, b, c) +#define FH(b, c, d) (b ^ c ^ d) +#define FI(b, c, d) (c ^ (b | ~d)) + + +/**************** + * transform n*64 grub_uint8_ts + */ +static void +transform ( MD5_CONTEXT *ctx, const unsigned char *data ) +{ + grub_uint32_t correct_words[16]; + register grub_uint32_t A = ctx->A; + register grub_uint32_t B = ctx->B; + register grub_uint32_t C = ctx->C; + register grub_uint32_t D = ctx->D; + grub_uint32_t *cwp = correct_words; + +#ifdef WORDS_BIGENDIAN + { + int i; + grub_uint8_t *p2, *p1; + for(i=0, p1=data, p2=(grub_uint8_t*)correct_words; i < 16; i++, p2 += 4 ) + { + p2[3] = *p1++; + p2[2] = *p1++; + p2[1] = *p1++; + p2[0] = *p1++; + } + } +#else + memcpy( correct_words, data, 64 ); +#endif + +#define OP(a, b, c, d, s, T) \ + do \ + { \ + a += FF (b, c, d) + (*cwp++) + T; \ + a = rol(a, s); \ + a += b; \ + } \ + while (0) + + /* Before we start, one word about the strange constants. + They are defined in RFC 1321 as + + T[i] = (int) (4294967296.0 * fabs (sin (i))), i=1..64 + */ + + /* Round 1. */ + OP (A, B, C, D, 7, 0xd76aa478); + OP (D, A, B, C, 12, 0xe8c7b756); + OP (C, D, A, B, 17, 0x242070db); + OP (B, C, D, A, 22, 0xc1bdceee); + OP (A, B, C, D, 7, 0xf57c0faf); + OP (D, A, B, C, 12, 0x4787c62a); + OP (C, D, A, B, 17, 0xa8304613); + OP (B, C, D, A, 22, 0xfd469501); + OP (A, B, C, D, 7, 0x698098d8); + OP (D, A, B, C, 12, 0x8b44f7af); + OP (C, D, A, B, 17, 0xffff5bb1); + OP (B, C, D, A, 22, 0x895cd7be); + OP (A, B, C, D, 7, 0x6b901122); + OP (D, A, B, C, 12, 0xfd987193); + OP (C, D, A, B, 17, 0xa679438e); + OP (B, C, D, A, 22, 0x49b40821); + +#undef OP +#define OP(f, a, b, c, d, k, s, T) \ + do \ + { \ + a += f (b, c, d) + correct_words[k] + T; \ + a = rol(a, s); \ + a += b; \ + } \ + while (0) + + /* Round 2. */ + OP (FG, A, B, C, D, 1, 5, 0xf61e2562); + OP (FG, D, A, B, C, 6, 9, 0xc040b340); + OP (FG, C, D, A, B, 11, 14, 0x265e5a51); + OP (FG, B, C, D, A, 0, 20, 0xe9b6c7aa); + OP (FG, A, B, C, D, 5, 5, 0xd62f105d); + OP (FG, D, A, B, C, 10, 9, 0x02441453); + OP (FG, C, D, A, B, 15, 14, 0xd8a1e681); + OP (FG, B, C, D, A, 4, 20, 0xe7d3fbc8); + OP (FG, A, B, C, D, 9, 5, 0x21e1cde6); + OP (FG, D, A, B, C, 14, 9, 0xc33707d6); + OP (FG, C, D, A, B, 3, 14, 0xf4d50d87); + OP (FG, B, C, D, A, 8, 20, 0x455a14ed); + OP (FG, A, B, C, D, 13, 5, 0xa9e3e905); + OP (FG, D, A, B, C, 2, 9, 0xfcefa3f8); + OP (FG, C, D, A, B, 7, 14, 0x676f02d9); + OP (FG, B, C, D, A, 12, 20, 0x8d2a4c8a); + + /* Round 3. */ + OP (FH, A, B, C, D, 5, 4, 0xfffa3942); + OP (FH, D, A, B, C, 8, 11, 0x8771f681); + OP (FH, C, D, A, B, 11, 16, 0x6d9d6122); + OP (FH, B, C, D, A, 14, 23, 0xfde5380c); + OP (FH, A, B, C, D, 1, 4, 0xa4beea44); + OP (FH, D, A, B, C, 4, 11, 0x4bdecfa9); + OP (FH, C, D, A, B, 7, 16, 0xf6bb4b60); + OP (FH, B, C, D, A, 10, 23, 0xbebfbc70); + OP (FH, A, B, C, D, 13, 4, 0x289b7ec6); + OP (FH, D, A, B, C, 0, 11, 0xeaa127fa); + OP (FH, C, D, A, B, 3, 16, 0xd4ef3085); + OP (FH, B, C, D, A, 6, 23, 0x04881d05); + OP (FH, A, B, C, D, 9, 4, 0xd9d4d039); + OP (FH, D, A, B, C, 12, 11, 0xe6db99e5); + OP (FH, C, D, A, B, 15, 16, 0x1fa27cf8); + OP (FH, B, C, D, A, 2, 23, 0xc4ac5665); + + /* Round 4. */ + OP (FI, A, B, C, D, 0, 6, 0xf4292244); + OP (FI, D, A, B, C, 7, 10, 0x432aff97); + OP (FI, C, D, A, B, 14, 15, 0xab9423a7); + OP (FI, B, C, D, A, 5, 21, 0xfc93a039); + OP (FI, A, B, C, D, 12, 6, 0x655b59c3); + OP (FI, D, A, B, C, 3, 10, 0x8f0ccc92); + OP (FI, C, D, A, B, 10, 15, 0xffeff47d); + OP (FI, B, C, D, A, 1, 21, 0x85845dd1); + OP (FI, A, B, C, D, 8, 6, 0x6fa87e4f); + OP (FI, D, A, B, C, 15, 10, 0xfe2ce6e0); + OP (FI, C, D, A, B, 6, 15, 0xa3014314); + OP (FI, B, C, D, A, 13, 21, 0x4e0811a1); + OP (FI, A, B, C, D, 4, 6, 0xf7537e82); + OP (FI, D, A, B, C, 11, 10, 0xbd3af235); + OP (FI, C, D, A, B, 2, 15, 0x2ad7d2bb); + OP (FI, B, C, D, A, 9, 21, 0xeb86d391); + + /* Put checksum in context given as argument. */ + ctx->A += A; + ctx->B += B; + ctx->C += C; + ctx->D += D; +} + +/* The routine updates the message-digest context to + * account for the presence of each of the characters inBuf[0..inLen-1] + * in the message whose digest is being computed. + */ +static void +md5_write( void *context, const void *inbuf_arg , grub_size_t inlen) +{ + const unsigned char *inbuf = inbuf_arg; + MD5_CONTEXT *hd = context; + + if( hd->count == 64 ) /* flush the buffer */ + { + transform( hd, hd->buf ); + // _gcry_burn_stack (80+6*sizeof(void*)); + hd->count = 0; + hd->nblocks++; + } + if( !inbuf ) + return; + + if( hd->count ) + { + for( ; inlen && hd->count < 64; inlen-- ) + hd->buf[hd->count++] = *inbuf++; + md5_write( hd, NULL, 0 ); + if( !inlen ) + return; + } + // _gcry_burn_stack (80+6*sizeof(void*)); + + while( inlen >= 64 ) + { + transform( hd, inbuf ); + hd->count = 0; + hd->nblocks++; + inlen -= 64; + inbuf += 64; + } + for( ; inlen && hd->count < 64; inlen-- ) + hd->buf[hd->count++] = *inbuf++; + +} + + + +/* The routine final terminates the message-digest computation and + * ends with the desired message digest in mdContext->digest[0...15]. + * The handle is prepared for a new MD5 cycle. + * Returns 16 grub_uint8_ts representing the digest. + */ +static void +md5_final( void *context) +{ + MD5_CONTEXT *hd = context; + grub_uint32_t t, msb, lsb; + grub_uint8_t *p; + + md5_write(hd, NULL, 0); /* flush */; + + t = hd->nblocks; + /* multiply by 64 to make a grub_uint8_t count */ + lsb = t << 6; + msb = t >> 26; + /* add the count */ + t = lsb; + if( (lsb += hd->count) < t ) + msb++; + /* multiply by 8 to make a bit count */ + t = lsb; + lsb <<= 3; + msb <<= 3; + msb |= t >> 29; + + if( hd->count < 56 ) /* enough room */ + { + hd->buf[hd->count++] = 0x80; /* pad */ + while( hd->count < 56 ) + hd->buf[hd->count++] = 0; /* pad */ + } + else /* need one extra block */ + { + hd->buf[hd->count++] = 0x80; /* pad character */ + while( hd->count < 64 ) + hd->buf[hd->count++] = 0; + md5_write(hd, NULL, 0); /* flush */; + grub_memset(hd->buf, 0, 56 ); /* fill next block with zeroes */ + } + /* append the 64 bit count */ + hd->buf[56] = lsb ; + hd->buf[57] = lsb >> 8; + hd->buf[58] = lsb >> 16; + hd->buf[59] = lsb >> 24; + hd->buf[60] = msb ; + hd->buf[61] = msb >> 8; + hd->buf[62] = msb >> 16; + hd->buf[63] = msb >> 24; + transform( hd, hd->buf ); + // _gcry_burn_stack (80+6*sizeof(void*)); + + p = hd->buf; +#ifdef WORDS_BIGENDIAN +#define X(a) do { *p++ = hd->a ; *p++ = hd->a >> 8; \ + *p++ = hd->a >> 16; *p++ = hd->a >> 24; } while(0) +#else /* little endian */ +#define X(a) do { *(grub_uint32_t*)p = (*hd).a ; p += 4; } while(0) +#endif + X(A); + X(B); + X(C); + X(D); +#undef X + +} + +/** + * GRUB2 Crypto Interface + * Written by Michael Gorven + */ +static grub_err_t +md5 (const char *in, grub_size_t insize, char *out) +{ + MD5_CONTEXT hd; + + md5_init (&hd); + md5_write (&hd, in, insize); + md5_final (&hd); + grub_memcpy (out, hd.buf, 16); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_xnu_uuid (grub_command_t cmd __attribute__ ((unused)), + int argc, char **args) +{ + struct tohash hashme; + grub_uint8_t xnu_uuid[16]; + char uuid_string[sizeof ("xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx")]; + char *ptr; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "UUID required"); + + hashme.serial = grub_cpu_to_be64 (grub_strtoull (args[0], 0, 16)); + grub_memcpy (hashme.prefix, hash_prefix, sizeof (hashme.prefix)); + + md5 ((char *) &hashme, sizeof (hashme), (char *) xnu_uuid); + xnu_uuid[6] = (xnu_uuid[6] & 0xf) | 0x30; + xnu_uuid[8] = (xnu_uuid[8] & 0x3f) | 0x80; + grub_sprintf (uuid_string, + "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + (unsigned int) xnu_uuid[0], (unsigned int) xnu_uuid[1], + (unsigned int) xnu_uuid[2], (unsigned int) xnu_uuid[3], + (unsigned int) xnu_uuid[4], (unsigned int) xnu_uuid[5], + (unsigned int) ((xnu_uuid[6] & 0xf) | 0x30), + (unsigned int) xnu_uuid[7], + (unsigned int) ((xnu_uuid[8] & 0x3f) | 0x80), + (unsigned int) xnu_uuid[9], + (unsigned int) xnu_uuid[10], (unsigned int) xnu_uuid[11], + (unsigned int) xnu_uuid[12], (unsigned int) xnu_uuid[13], + (unsigned int) xnu_uuid[14], (unsigned int) xnu_uuid[15]); + for (ptr = uuid_string; *ptr; ptr++) + *ptr = grub_toupper (*ptr); + if (argc == 1) + grub_printf ("%s", uuid_string); + if (argc > 1) + grub_env_set (args[1], uuid_string); + + return GRUB_ERR_NONE; +} + +static grub_command_t cmd; + + +GRUB_MOD_INIT (xnu_uuid) +{ + cmd = grub_register_command ("xnu_uuid", grub_cmd_xnu_uuid, + "xnu_uuid GRUBUUID [VARNAME]", + "Transform 64-bit UUID to format " + "suitable for xnu."); +} + +GRUB_MOD_FINI (xnu_uuid) +{ + grub_unregister_command (cmd); +} diff --git a/conf/common.rmk b/conf/common.rmk index 765bdbe5c..d0c142be9 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -586,3 +586,10 @@ bufio_mod_SOURCES = io/bufio.c bufio_mod_CFLAGS = $(COMMON_CFLAGS) bufio_mod_LDFLAGS = $(COMMON_LDFLAGS) +# Misc. +pkglib_MODULES += xnu_uuid.mod + +# For elf.mod. +xnu_uuid_mod_SOURCES = commands/xnu_uuid.c +xnu_uuid_mod_CFLAGS = $(COMMON_CFLAGS) +xnu_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 0709aacb8..b3c75ca18 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -61,7 +61,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ - commands/gptsync.c commands/probe.c \ + commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index aa260abe5..d1128de87 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -61,7 +61,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ - commands/gptsync.c commands/probe.c commands/i386/cpuid.c \ + commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ + commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index e00009720..20c31efa0 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -127,7 +127,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ - commands/gptsync.c commands/probe.c commands/i386/cpuid.c \ + commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ + commands/i386/cpuid.c \ disk/host.c disk/loopback.c disk/scsi.c \ fs/fshelp.c \ \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 0e0f01a03..2f8b35a09 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -45,7 +45,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ - commands/gptsync.c commands/probe.c \ + commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index ce5e98165..2a05f23df 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -101,7 +101,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ - commands/probe.c \ + commands/probe.c commands/xnu_uuid.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ disk/loopback.c \ \ diff --git a/include/grub/misc.h b/include/grub/misc.h index 23e0ce60d..e229062ac 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -61,6 +61,15 @@ int EXPORT_FUNC(grub_isalpha) (int c); int EXPORT_FUNC(grub_isgraph) (int c); int EXPORT_FUNC(grub_isdigit) (int c); int EXPORT_FUNC(grub_tolower) (int c); +static inline int +grub_toupper (int c) +{ + if (c >= 'a' && c <= 'z') + return c - 'a' + 'A'; + + return c; +} + unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int base); unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, int base); char *EXPORT_FUNC(grub_strdup) (const char *s); diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index c042005d1..88c36ce6a 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -93,9 +93,7 @@ EOF done ;; macosx) - OSXROOT="`grub-probe --target=drive --device ${DEVICE} 2> /dev/null`" - # FIXME: use UUID - OSXDISK=disk"`echo ${OSXROOT} | awk -F , '{ print $1 ; }' | sed 's/(hd//;'`"s"`echo ${OSXROOT} | awk -F , '{ print $2 ; }' | sed 's/)//;'`" + OSXUUID="`grub-probe --target=fs_uuid --device ${DEVICE} 2> /dev/null`" cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" { EOF @@ -109,10 +107,11 @@ EOF fi fi if [ \$do_resume == 0 ]; then + xnu_uuid ${OSXUUID} uuid if [ -f /Extra/DSDT.aml ]; then acpi -e /Extra/DSDT.aml fi - xnu_kernel /mach_kernel rd=$OSXDISK + xnu_kernel /mach_kernel boot-uuid=\${uuid} rd=*uuid if [ /System/Library/Extensions.mkext -nt /System/Library/Extensions ]; then xnu_mkext /System/Library/Extensions.mkext else From 3ef17a2ebf4ef28b4aec10bc146e60763480fa61 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 15 Jun 2009 23:25:38 +0000 Subject: [PATCH 0868/1707] 2009-06-16 Pavel Roskin * boot/i386/pc/boot.S: Remove root_drive. Assert offset of boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK. Don't save %dx, we only need %dl and we never change it. * boot/i386/pc/cdboot.S: Don't set the root drive. * boot/i386/pc/pxeboot.S: Likewise. * include/grub/i386/pc/boot.h: Remove GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust GRUB_BOOT_MACHINE_DRIVE_CHECK. * include/grub/i386/pc/kernel.h: Remove grub_root_drive. * kern/i386/pc/init.c (make_install_device): Remove references to grub_root_drive. * kern/i386/pc/startup.S: Likewise. * util/i386/pc/grub-setup.c (setup): Don't set root_drive. --- ChangeLog | 16 ++++++++++++++++ boot/i386/pc/boot.S | 11 +++-------- boot/i386/pc/cdboot.S | 3 --- boot/i386/pc/pxeboot.S | 3 +-- include/grub/i386/pc/boot.h | 5 +---- include/grub/i386/pc/kernel.h | 3 --- kern/i386/pc/init.c | 11 ++++------- kern/i386/pc/startup.S | 6 +----- util/i386/pc/grub-setup.c | 5 +---- 9 files changed, 27 insertions(+), 36 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27c0eec5c..64153e0e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-06-16 Pavel Roskin + + * boot/i386/pc/boot.S: Remove root_drive. Assert offset of + boot_drive_check by using GRUB_BOOT_MACHINE_DRIVE_CHECK. Don't + save %dx, we only need %dl and we never change it. + * boot/i386/pc/cdboot.S: Don't set the root drive. + * boot/i386/pc/pxeboot.S: Likewise. + * include/grub/i386/pc/boot.h: Remove + GRUB_BOOT_MACHINE_ROOT_DRIVE, adjust + GRUB_BOOT_MACHINE_DRIVE_CHECK. + * include/grub/i386/pc/kernel.h: Remove grub_root_drive. + * kern/i386/pc/init.c (make_install_device): Remove references + to grub_root_drive. + * kern/i386/pc/startup.S: Likewise. + * util/i386/pc/grub-setup.c (setup): Don't set root_drive. + 2009-06-16 Vladimir Serbinenko xnu_uuid command diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 2cd505e6a..8d8c27c82 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -102,8 +102,6 @@ kernel_sector: boot_drive: .byte 0xff /* the disk to load kernel from */ /* 0xff means use the boot drive */ -root_drive: - .byte 0xff after_BPB: @@ -118,6 +116,7 @@ after_BPB: * possible boot drive. If GRUB is installed into a floppy, * this does nothing (only jump). */ + . = _start + GRUB_BOOT_MACHINE_DRIVE_CHECK boot_drive_check: jmp 1f /* grub-setup may overwrite this jump */ testb $0x80, %dl @@ -151,14 +150,12 @@ real_start: /* * Check if we have a forced disk reference here */ - /* assign root_drive at the same time */ #ifdef APPLE_CC boot_drive_abs = ABS (boot_drive) - movw boot_drive_abs, %ax + movb boot_drive_abs, %al #else - movw ABS(boot_drive), %ax + movb ABS(boot_drive), %al #endif - movb %ah, %dh cmpb $0xff, %al je 1f movb %al, %dl @@ -343,7 +340,6 @@ setup_sectors: /* restore %dl */ popw %dx - pushw %dx /* head start */ movb %al, %dh @@ -399,7 +395,6 @@ copy_buffer: popw %ds popa - popw %dx /* boot kernel */ #ifdef APPLE_CC diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S index 688b26c7d..efa65f511 100644 --- a/boot/i386/pc/cdboot.S +++ b/boot/i386/pc/cdboot.S @@ -86,9 +86,6 @@ bi_reserved: call read_cdrom - /* Root drive will default to boot drive */ - movb $0xFF, %dh - ljmp $(DATA_ADDR >> 4), $0 /* diff --git a/boot/i386/pc/pxeboot.S b/boot/i386/pc/pxeboot.S index 1b51127f6..2fc53bc81 100644 --- a/boot/i386/pc/pxeboot.S +++ b/boot/i386/pc/pxeboot.S @@ -27,8 +27,7 @@ _start: start: - /* Root drive will default to boot drive */ - movb $0xFF, %dh + /* Use drive number 0x7F for PXE */ movb $0x7F, %dl /* Jump to the real world */ diff --git a/include/grub/i386/pc/boot.h b/include/grub/i386/pc/boot.h index 386221414..f35cb3a27 100644 --- a/include/grub/i386/pc/boot.h +++ b/include/grub/i386/pc/boot.h @@ -34,9 +34,6 @@ /* The offset of BOOT_DRIVE. */ #define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c -/* The offset of ROOT_DRIVE. */ -#define GRUB_BOOT_MACHINE_ROOT_DRIVE 0x4d - /* The offset of KERNEL_ADDRESS. */ #define GRUB_BOOT_MACHINE_KERNEL_ADDRESS 0x40 @@ -47,7 +44,7 @@ #define GRUB_BOOT_MACHINE_KERNEL_SEGMENT 0x42 /* The offset of BOOT_DRIVE_CHECK. */ -#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4f +#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4e /* The offset of a magic number used by Windows NT. */ #define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8 diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index 5acc883f5..5b9d8dcb5 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -71,9 +71,6 @@ extern char grub_prefix[]; /* The boot BIOS drive number. */ extern grub_uint8_t EXPORT_VAR(grub_boot_drive); -/* The root BIOS drive number. */ -extern grub_uint8_t grub_root_drive; - #endif /* ! ASM_FILE */ #endif /* ! KERNEL_MACHINE_HEADER */ diff --git a/kern/i386/pc/init.c b/kern/i386/pc/init.c index b5339214e..ebe4bb6ea 100644 --- a/kern/i386/pc/init.c +++ b/kern/i386/pc/init.c @@ -60,13 +60,10 @@ make_install_device (void) if (grub_prefix[0] != '(') { - /* If the root drive is not set explicitly, assume that it is identical - to the boot drive. */ - if (grub_root_drive == 0xFF) - grub_root_drive = grub_boot_drive; - - grub_sprintf (dev, "(%cd%u", (grub_root_drive & 0x80) ? 'h' : 'f', - grub_root_drive & 0x7f); + /* No hardcoded root partition - make it from the boot drive and the + partition number encoded at the install time. */ + grub_sprintf (dev, "(%cd%u", (grub_boot_drive & 0x80) ? 'h' : 'f', + grub_boot_drive & 0x7f); if (grub_install_dos_part >= 0) grub_sprintf (dev + grub_strlen (dev), ",%u", grub_install_dos_part + 1); diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 0f80e8ab8..f77d7dbe3 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -195,9 +195,8 @@ codestart: sti /* we're safe again */ - /* save boot and root drive references */ + /* save the boot drive */ ADDR32 movb %dl, EXT_C(grub_boot_drive) - ADDR32 movb %dh, EXT_C(grub_root_drive) /* reset disk system (%ah = 0) */ int $0x13 @@ -300,9 +299,6 @@ codestart: VARIABLE(grub_boot_drive) .byte 0 -VARIABLE(grub_root_drive) - .byte 0 - .p2align 2 /* force 4-byte alignment */ /* diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index bdf234c64..5a519645b 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -94,7 +94,7 @@ setup (const char *dir, grub_uint16_t core_sectors; grub_device_t root_dev, dest_dev; const char *dest_partmap; - grub_uint8_t *boot_drive, *root_drive; + grub_uint8_t *boot_drive; grub_disk_addr_t *kernel_sector; grub_uint16_t *boot_drive_check; struct boot_blocklist *first_block, *block; @@ -207,7 +207,6 @@ setup (const char *dir, /* Set the addresses of variables in the boot image. */ boot_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_BOOT_DRIVE); - root_drive = (grub_uint8_t *) (boot_img + GRUB_BOOT_MACHINE_ROOT_DRIVE); kernel_sector = (grub_disk_addr_t *) (boot_img + GRUB_BOOT_MACHINE_KERNEL_SECTOR); boot_drive_check = (grub_uint16_t *) (boot_img @@ -379,7 +378,6 @@ setup (const char *dir, /* FIXME: can this be skipped? */ *boot_drive = 0xFF; - *root_drive = 0xFF; *kernel_sector = grub_cpu_to_le64 (embed_region.start); @@ -513,7 +511,6 @@ unable_to_embed: /* FIXME: can this be skipped? */ *boot_drive = 0xFF; - *root_drive = 0xFF; *install_dos_part = grub_cpu_to_le32 (dos_part); *install_bsd_part = grub_cpu_to_le32 (bsd_part); From 0644f96c9f18a70af3b91c48ec5a772a3770de95 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 16 Jun 2009 16:06:49 +0000 Subject: [PATCH 0869/1707] 2009-06-16 James Jarvis * commands/help.c GRUB_MOD_INIT(echo): Fix the help output of `echo' command. --- ChangeLog | 7 ++++++- commands/echo.c | 2 +- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64153e0e3..f3e631c1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-16 James Jarvis + + * commands/help.c GRUB_MOD_INIT(echo): Fix the help output of + `echo' command. + 2009-06-16 Pavel Roskin * boot/i386/pc/boot.S: Remove root_drive. Assert offset of @@ -62,7 +67,7 @@ * loader/i386/multiboot.c (grub_multiboot_get_bootdev): fix partition handling -2009-06-13 Jun Inoue +2009-06-13 Jun Inoue * util/grub-mkconfig.in: Fix parsing of --output option. diff --git a/commands/echo.c b/commands/echo.c index eb250052f..69aa3be3c 100644 --- a/commands/echo.c +++ b/commands/echo.c @@ -113,7 +113,7 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT(echo) { cmd = grub_register_extcmd ("echo", grub_cmd_echo, GRUB_COMMAND_FLAG_BOTH, - "echo [-e|-n] FILE", "Display a line of text.", + "echo [-e|-n] STRING", "Display a line of text.", options); } From b97bcb19530a254fdcd48c5c2d9458488078b23f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 16 Jun 2009 16:59:32 +0000 Subject: [PATCH 0870/1707] 2009-06-16 Felix Zielcke * util/grub.d/30_os-prober.in: Use ${root} in the generated drivemap menuentry. --- ChangeLog | 5 +++++ util/grub.d/30_os-prober.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f3e631c1d..26af878f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-16 Felix Zielcke + + * util/grub.d/30_os-prober.in: Use ${root} in the generated + drivemap menuentry. + 2009-06-16 James Jarvis * commands/help.c GRUB_MOD_INIT(echo): Fix the help output of diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 88c36ce6a..552ad8e28 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -55,7 +55,7 @@ EOF prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" cat << EOF - drivemap -s (hd0) \$root + drivemap -s (hd0) \${root} chainloader +1 } EOF From a2d08c06c38b8777e0e920fbc0f8c63cbaf25d39 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 16 Jun 2009 20:55:53 +0000 Subject: [PATCH 0871/1707] 2009-06-16 Pavel Roskin * kern/i386/halt.c: Include grub/machine/init.h. * kern/i386/reboot.c: Include grub/cpu/reboot.h. --- ChangeLog | 5 +++++ kern/i386/halt.c | 1 + kern/i386/reboot.c | 1 + 3 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 26af878f8..9430c0f04 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-16 Pavel Roskin + + * kern/i386/halt.c: Include grub/machine/init.h. + * kern/i386/reboot.c: Include grub/cpu/reboot.h. + 2009-06-16 Felix Zielcke * util/grub.d/30_os-prober.in: Use ${root} in the generated diff --git a/kern/i386/halt.c b/kern/i386/halt.c index 41d3906e6..2f0043539 100644 --- a/kern/i386/halt.c +++ b/kern/i386/halt.c @@ -18,6 +18,7 @@ #include #include +#include #include const char bochs_shutdown[] = "Shutdown"; diff --git a/kern/i386/reboot.c b/kern/i386/reboot.c index d2b0060bb..6d562f827 100644 --- a/kern/i386/reboot.c +++ b/kern/i386/reboot.c @@ -18,6 +18,7 @@ #include #include +#include #include void From 1bd265f306172713a2679856b289c22b7fb8ae67 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 17 Jun 2009 06:07:36 +0000 Subject: [PATCH 0872/1707] 2009-06-17 Colin Watson * util/elf/grub-mkimage.c (usage): Prefix each option line with two spaces, for the benefit of help2man. * util/i386/efi/grub-mkimage.c (usage): Likewise. --- ChangeLog | 6 ++++++ util/elf/grub-mkimage.c | 16 ++++++++-------- util/i386/efi/grub-mkimage.c | 12 ++++++------ 3 files changed, 20 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9430c0f04..6707e3ae9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-17 Colin Watson + + * util/elf/grub-mkimage.c (usage): Prefix each option line with two + spaces, for the benefit of help2man. + * util/i386/efi/grub-mkimage.c (usage): Likewise. + 2009-06-16 Pavel Roskin * kern/i386/halt.c: Include grub/machine/init.h. diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index f841035c2..3ef763fcb 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -332,14 +332,14 @@ Usage: grub-mkimage -o FILE [OPTION]... [MODULES]\n\ \n\ Make a bootable image of GRUB.\n\ \n\ --d, --directory=DIR use images and modules under DIR [default=%s]\n\ --p, --prefix=DIR set grub_prefix directory\n\ --m, --memdisk=FILE embed FILE as a memdisk image\n\ --o, --output=FILE output a generated image to FILE\n\ --h, --help display this message and exit\n\ --n, --note add NOTE segment for CHRP Open Firmware\n\ --V, --version print version information and exit\n\ --v, --verbose print verbose messages\n\ + -d, --directory=DIR use images and modules under DIR [default=%s]\n\ + -p, --prefix=DIR set grub_prefix directory\n\ + -m, --memdisk=FILE embed FILE as a memdisk image\n\ + -o, --output=FILE output a generated image to FILE\n\ + -h, --help display this message and exit\n\ + -n, --note add NOTE segment for CHRP Open Firmware\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ \n\ Report bugs to <%s>.\n\ ", GRUB_LIBDIR, PACKAGE_BUGREPORT); diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index f4203b5a3..2813e799d 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -1069,12 +1069,12 @@ Usage: grub-mkimage -o FILE [OPTION]... [MODULES]\n\ \n\ Make a bootable image of GRUB.\n\ \n\ --d, --directory=DIR use images and modules under DIR [default=%s]\n\ --p, --prefix=DIR set grub_prefix directory [default=%s]\n\ --o, --output=FILE output a generated image to FILE\n\ --h, --help display this message and exit\n\ --V, --version print version information and exit\n\ --v, --verbose print verbose messages\n\ + -d, --directory=DIR use images and modules under DIR [default=%s]\n\ + -p, --prefix=DIR set grub_prefix directory [default=%s]\n\ + -o, --output=FILE output a generated image to FILE\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ + -v, --verbose print verbose messages\n\ \n\ Report bugs to <%s>.\n\ ", GRUB_LIBDIR, DEFAULT_DIRECTORY, PACKAGE_BUGREPORT); From 74aa8e4bf8a5c91b5989b861005587bd5eea0e97 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 17 Jun 2009 13:15:33 +0000 Subject: [PATCH 0873/1707] 2009-06-17 Vladimir Serbinenko avoid double grub_adjust_range call. Bug reported by David Simner * kern/disk.c (grub_disk_write): change to raw disk access before calling disk_read --- ChangeLog | 7 +++++++ kern/disk.c | 9 ++++++++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 6707e3ae9..2254e5956 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-17 Vladimir Serbinenko + + avoid double grub_adjust_range call. Bug reported by David Simner + + * kern/disk.c (grub_disk_write): change to raw disk access before + calling disk_read + 2009-06-17 Colin Watson * util/elf/grub-mkimage.c (usage): Prefix each option line with two diff --git a/kern/disk.c b/kern/disk.c index ad778d44e..0c54ed467 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -542,10 +542,17 @@ grub_disk_write (grub_disk_t disk, grub_disk_addr_t sector, { char tmp_buf[GRUB_DISK_SECTOR_SIZE]; grub_size_t len; + grub_partition_t part; + part = disk->partition; + disk->partition = 0; if (grub_disk_read (disk, sector, 0, GRUB_DISK_SECTOR_SIZE, tmp_buf) != GRUB_ERR_NONE) - goto finish; + { + disk->partition = part; + goto finish; + } + disk->partition = part; len = GRUB_DISK_SECTOR_SIZE - real_offset; if (len > size) From cf24ed9e2a49a90cbdea466047f88cf097b8f181 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 17 Jun 2009 13:47:37 +0000 Subject: [PATCH 0874/1707] 2009-06-17 Vladimir Serbinenko Fix newline handling * include/grub/script_sh.h (grub_lexer_param): new field was_newline * script/sh/lexer.c (grub_script_lexer_init): initilaise was_newline (grub_script_yylex): don't segfault on unterminated script newline terminates command and variable --- ChangeLog | 9 +++++++++ include/grub/script_sh.h | 3 +++ script/sh/lexer.c | 27 +++++++++++++++++---------- 3 files changed, 29 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2254e5956..1a7a1c46b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-17 Vladimir Serbinenko + + Fix newline handling + + * include/grub/script_sh.h (grub_lexer_param): new field was_newline + * script/sh/lexer.c (grub_script_lexer_init): initilaise was_newline + (grub_script_yylex): don't segfault on unterminated script + newline terminates command and variable + 2009-06-17 Vladimir Serbinenko avoid double grub_adjust_range call. Bug reported by David Simner diff --git a/include/grub/script_sh.h b/include/grub/script_sh.h index ab5bf431a..f6177b02a 100644 --- a/include/grub/script_sh.h +++ b/include/grub/script_sh.h @@ -159,6 +159,9 @@ struct grub_lexer_param /* The token that is already parsed but not yet returned. */ int tokenonhold; + + /* Was the last token a newline? */ + int was_newline; }; /* State of the parser as passes to the parser. */ diff --git a/script/sh/lexer.c b/script/sh/lexer.c index 99bd3baac..17f18e203 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -64,6 +64,7 @@ grub_script_lexer_init (char *script, grub_reader_getline_t getline) param->recordpos = 0; param->recordlen = 0; param->tokenonhold = 0; + param->was_newline = 0; return param; } @@ -158,8 +159,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) for (;! state->done; firstrun = 0) { - - if (! *state->script) + if (! state->script || ! *state->script) { /* Check if more tokens are requested by the parser. */ if (((state->refs && ! parsestate->err) @@ -169,7 +169,16 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) && state->getline) { int doexit = 0; - while (!state->script || ! *state->script) + if (state->state != GRUB_PARSER_STATE_ESC + && state->state != GRUB_PARSER_STATE_QUOTE + && state->state != GRUB_PARSER_STATE_DQUOTE + && ! state->was_newline) + { + state->was_newline = 1; + state->tokenonhold = '\n'; + break; + } + while (! state->script || ! *state->script) { grub_free (state->newscript); state->newscript = 0; @@ -185,13 +194,10 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) break; grub_dprintf ("scripting", "token=`\\n'\n"); recordchar (state, '\n'); - if (state->state != GRUB_PARSER_STATE_ESC - && state->state != GRUB_PARSER_STATE_DQUOTE - && state->state != GRUB_PARSER_STATE_QUOTE) - { - state->tokenonhold = '\n'; - break; - } + if (state->state == GRUB_PARSER_STATE_VARNAME) + state->state = GRUB_PARSER_STATE_TEXT; + if (state->state == GRUB_PARSER_STATE_QVARNAME) + state->state = GRUB_PARSER_STATE_DQUOTE; if (state->state == GRUB_PARSER_STATE_DQUOTE || state->state == GRUB_PARSER_STATE_QUOTE) yylval->arg = grub_script_arg_add (parsestate, yylval->arg, @@ -208,6 +214,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) break; } } + state->was_newline = 0; newstate = grub_parser_cmdline_state (state->state, *state->script, &use); From 05b129e0d3a48bbce2e8393c3afb1e541568a26b Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 17 Jun 2009 17:19:23 +0000 Subject: [PATCH 0875/1707] 2009-06-17 Felix Zielcke * loader/i386/linux.c (grub_cmd_linux): Set grub_error if the file can't be found. * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. --- ChangeLog | 6 ++++++ loader/i386/linux.c | 5 ++++- loader/i386/pc/linux.c | 5 ++++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1a7a1c46b..90265d0af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-17 Felix Zielcke + + * loader/i386/linux.c (grub_cmd_linux): Set grub_error if the + file can't be found. + * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. + 2009-06-17 Vladimir Serbinenko Fix newline handling diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 6510db670..86f584c57 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -600,7 +600,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), file = grub_file_open (argv[0]); if (! file) - goto fail; + { + grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); + goto fail; + } if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) { diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index c5279f6ce..97df54dee 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -69,7 +69,10 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), file = grub_file_open (argv[0]); if (! file) - goto fail; + { + grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); + goto fail; + } if ((grub_size_t) grub_file_size (file) > grub_os_area_size) { From c22a006a07191b4b9ebcd5d1b3d827f80a23479a Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 17 Jun 2009 19:39:36 +0000 Subject: [PATCH 0876/1707] 2009-06-17 Pavel Roskin * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Remove term/i386/pc/at_keyboard.c, it doesn't need to be compiled into the kernel. * kern/i386/coreboot/init.c: Don't call grub_at_keyboard_init() and grub_at_keyboard_fini(), it's done on module load and unload. --- ChangeLog | 9 +++++++++ conf/i386-coreboot.rmk | 1 - kern/i386/coreboot/init.c | 2 -- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 90265d0af..e96652ba2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-17 Pavel Roskin + + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Remove + term/i386/pc/at_keyboard.c, it doesn't need to be compiled into + the kernel. + * kern/i386/coreboot/init.c: Don't call grub_at_keyboard_init() + and grub_at_keyboard_fini(), it's done on module load and + unload. + 2009-06-17 Felix Zielcke * loader/i386/linux.c (grub_cmd_linux): Set grub_error if the diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index b3c75ca18..c21e75938 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -25,7 +25,6 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/generic/millisleep.c \ kern/env.c \ term/i386/pc/vga_text.c term/i386/vga_common.c \ - term/i386/pc/at_keyboard.c \ symlist.c kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 6549a17e9..611e9d1b4 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -75,7 +75,6 @@ grub_machine_init (void) { /* Initialize the console as early as possible. */ grub_vga_text_init (); - grub_at_keyboard_init (); auto int NESTED_FUNC_ATTR heap_init (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR heap_init (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) @@ -137,7 +136,6 @@ grub_machine_set_prefix (void) void grub_machine_fini (void) { - grub_at_keyboard_fini (); grub_vga_text_fini (); grub_stop_floppy (); } From d363867871ea8140a6902d77bd07708bbd75e3aa Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 17 Jun 2009 19:42:06 +0000 Subject: [PATCH 0877/1707] 2009-06-17 Pavel Roskin * include/grub/i386/coreboot/console.h: Don't use the i386-pc version, use declarations needed to use vga_text as the startup console. --- ChangeLog | 4 ++++ include/grub/i386/coreboot/console.h | 26 +++++++++++++++++++++++++- 2 files changed, 29 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e96652ba2..e582d91ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-06-17 Pavel Roskin + * include/grub/i386/coreboot/console.h: Don't use the i386-pc + version, use declarations needed to use vga_text as the startup + console. + * conf/i386-coreboot.rmk (kernel_elf_SOURCES): Remove term/i386/pc/at_keyboard.c, it doesn't need to be compiled into the kernel. diff --git a/include/grub/i386/coreboot/console.h b/include/grub/i386/coreboot/console.h index 305a46d8e..2ffef7300 100644 --- a/include/grub/i386/coreboot/console.h +++ b/include/grub/i386/coreboot/console.h @@ -1 +1,25 @@ -#include +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_CONSOLE_HEADER +#define GRUB_MACHINE_CONSOLE_HEADER 1 + +void grub_vga_text_init (void); +void grub_vga_text_fini (void); + +#endif /* ! GRUB_MACHINE_CONSOLE_HEADER */ From 09b3490b9d3f57fed992edb456e9fb023b5c5396 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 18 Jun 2009 13:51:06 +0000 Subject: [PATCH 0878/1707] 2009-06-18 Vladimir Serbinenko Fix warnings * fs/ntfscomp.c (decomp_get16): initialize c1 and c2 (decomp_block): initialize ch use grub_memcpy instead of memcpy --- ChangeLog | 8 ++++++++ fs/ntfscomp.c | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index e582d91ba..589fad1f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-06-18 Vladimir Serbinenko + + Fix warnings + + * fs/ntfscomp.c (decomp_get16): initialize c1 and c2 + (decomp_block): initialize ch + use grub_memcpy instead of memcpy + 2009-06-17 Pavel Roskin * include/grub/i386/coreboot/console.h: Don't use the i386-pc diff --git a/fs/ntfscomp.c b/fs/ntfscomp.c index b021c358f..20c79ac07 100644 --- a/fs/ntfscomp.c +++ b/fs/ntfscomp.c @@ -57,7 +57,7 @@ decomp_getch (struct grub_ntfs_comp *cc, unsigned char *res) static grub_err_t decomp_get16 (struct grub_ntfs_comp *cc, grub_uint16_t * res) { - unsigned char c1, c2; + unsigned char c1 = 0, c2 = 0; if ((decomp_getch (cc, &c1)) || (decomp_getch (cc, &c2))) return grub_errno; @@ -134,7 +134,7 @@ decomp_block (struct grub_ntfs_comp *cc, char *dest) } else { - unsigned char ch; + unsigned char ch = 0; if (decomp_getch (cc, &ch)) return grub_errno; @@ -163,7 +163,7 @@ decomp_block (struct grub_ntfs_comp *cc, char *dest) n = cnt; if ((dest) && (n)) { - memcpy (dest, &cc->cbuf[cc->cbuf_ofs], n); + grub_memcpy (dest, &cc->cbuf[cc->cbuf_ofs], n); dest += n; } cnt -= n; From 26de2bcdf2391270c3e467115c3efa4688a1837b Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 18 Jun 2009 14:02:23 +0000 Subject: [PATCH 0879/1707] 2009-06-18 Vladimir Serbinenko Fix build with Apple's toolchain. Part 1 * commands/i386/pc/drivemap_int13h.S: use assembly-time constants for long calls * configure.ac: remove a leftover AC_MSG_RESULT (CFLAGS): don't add -Wl,--defsym,___main=0x8100 when building with Apple's toolchain --- ChangeLog | 10 ++++++++++ commands/i386/pc/drivemap_int13h.S | 9 +++++++++ configure.ac | 5 ++++- 3 files changed, 23 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 589fad1f6..94109604a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-06-18 Vladimir Serbinenko + + Fix build with Apple's toolchain. Part 1 + + * commands/i386/pc/drivemap_int13h.S: use assembly-time constants + for long calls + * configure.ac: remove a leftover AC_MSG_RESULT + (CFLAGS): don't add -Wl,--defsym,___main=0x8100 when building with + Apple's toolchain + 2009-06-18 Vladimir Serbinenko Fix warnings diff --git a/commands/i386/pc/drivemap_int13h.S b/commands/i386/pc/drivemap_int13h.S index 542da0900..440349685 100644 --- a/commands/i386/pc/drivemap_int13h.S +++ b/commands/i386/pc/drivemap_int13h.S @@ -66,7 +66,12 @@ not_found: popf pushf +#ifdef APPLE_CC + grub_drivemap_oldhandler_ofs = INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler)) + lcall *%cs:grub_drivemap_oldhandler_ofs +#else lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler)) +#endif push %bp mov %sp, %bp @@ -89,7 +94,11 @@ norestore: popf pushf +#ifdef APPLE_CC + lcall *%cs:grub_drivemap_oldhandler_ofs +#else lcall *%cs:INT13H_OFFSET (EXT_C (grub_drivemap_oldhandler)) +#endif push %bp mov %sp, %bp diff --git a/configure.ac b/configure.ac index 371c32d03..a8cb23468 100644 --- a/configure.ac +++ b/configure.ac @@ -308,7 +308,6 @@ fi AC_SUBST(TARGET_IMG_LDSCRIPT) AC_SUBST(TARGET_IMG_LDFLAGS) AC_SUBST(TARGET_IMG_CFLAGS) -AC_MSG_RESULT([$TARGET_IMG_LDFLAGS_AC]) # For platforms where ELF is not the default link format. AC_MSG_CHECKING([for command to convert module to ELF format]) @@ -396,7 +395,11 @@ AC_SUBST(TARGET_LDFLAGS) # Set them to their new values for the tests below. CC="$TARGET_CC" +if test "x$TARGET_APPLE_CC" = x1 ; then +CFLAGS="$TARGET_CFLAGS -nostdlib" +else CFLAGS="$TARGET_CFLAGS -nostdlib -Wl,--defsym,___main=0x8100" +fi CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" From 26586d9875d9086b5545005f306d6b880cf77ec6 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 18 Jun 2009 14:25:51 +0000 Subject: [PATCH 0880/1707] 2009-06-18 Vladimir Serbinenko Fix build with Apple's toolchain. Part 2 * aclocal.m4 (grub_PROG_TARGET_CC): add missing prototype for main and a fake start --- ChangeLog | 7 +++++++ aclocal.m4 | 5 ++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 94109604a..2d872b60b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-18 Vladimir Serbinenko + + Fix build with Apple's toolchain. Part 2 + + * aclocal.m4 (grub_PROG_TARGET_CC): add missing prototype for main and + a fake start + 2009-06-18 Vladimir Serbinenko Fix build with Apple's toolchain. Part 1 diff --git a/aclocal.m4 b/aclocal.m4 index b421c72a3..bde935dc9 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -2,7 +2,10 @@ dnl Check whether target compiler is working AC_DEFUN(grub_PROG_TARGET_CC, [AC_MSG_CHECKING([whether target compiler is working]) AC_CACHE_VAL(grub_cv_prog_target_cc, -[AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])], +[AC_LINK_IFELSE([AC_LANG_PROGRAM([[ +asm (".globl start; start: nop"); +int main (void); +]], [[]])], [grub_cv_prog_target_cc=yes], [grub_cv_prog_target_cc=no]) ]) From e14cd81437a2b019dde36591e71775e6b34f82f3 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 18 Jun 2009 20:00:34 +0000 Subject: [PATCH 0881/1707] 2009-06-18 Pavel Roskin * conf/common.rmk: Add fs_file.mod. * disk/fs_file.c: New file. * include/grub/disk.h (enum grub_disk_dev_id): Add GRUB_DISK_DEVICE_FILE_ID. --- ChangeLog | 7 +++ conf/common.rmk | 9 ++- disk/fs_file.c | 136 ++++++++++++++++++++++++++++++++++++++++++++ include/grub/disk.h | 1 + 4 files changed, 151 insertions(+), 2 deletions(-) create mode 100644 disk/fs_file.c diff --git a/ChangeLog b/ChangeLog index 2d872b60b..982c8bc72 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-18 Pavel Roskin + + * conf/common.rmk: Add fs_file.mod. + * disk/fs_file.c: New file. + * include/grub/disk.h (enum grub_disk_dev_id): Add + GRUB_DISK_DEVICE_FILE_ID. + 2009-06-18 Vladimir Serbinenko Fix build with Apple's toolchain. Part 2 diff --git a/conf/common.rmk b/conf/common.rmk index d0c142be9..fbca2e4be 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -349,8 +349,8 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ - ls.mod cmp.mod cat.mod help.mod search.mod \ - loopback.mod fs_uuid.mod configfile.mod echo.mod \ + ls.mod cmp.mod cat.mod help.mod search.mod loopback.mod \ + fs_file.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ pcpart.mod memrw.mod normal.mod sh.mod lua.mod \ @@ -431,6 +431,11 @@ loopback_mod_SOURCES = disk/loopback.c loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For fs_file.mod +fs_file_mod_SOURCES = disk/fs_file.c +fs_file_mod_CFLAGS = $(COMMON_CFLAGS) +fs_file_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For fs_uuid.mod fs_uuid_mod_SOURCES = disk/fs_uuid.c fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/disk/fs_file.c b/disk/fs_file.c new file mode 100644 index 000000000..e09568250 --- /dev/null +++ b/disk/fs_file.c @@ -0,0 +1,136 @@ +/* fs_file.c - Access partition by a file it contains. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +static grub_device_t +search_fs_file (const char *key, unsigned long *count) +{ + char *filename = NULL; + grub_device_t ret = NULL; + *count = 0; + + auto int iterate_device (const char *name); + int iterate_device (const char *name) + { + int len; + grub_file_t file; + + (*count)++; + + len = grub_strlen (name) + 2 + grub_strlen (key) + 1; + filename = grub_realloc (filename, len); + if (! filename) + return 1; + + grub_sprintf (filename, "(%s)%s", name, key); + file = grub_file_open (filename); + if (file) + { + grub_file_close (file); + ret = grub_device_open (name); + return 1; + } + + grub_errno = GRUB_ERR_NONE; + return 0; + } + + grub_device_iterate (iterate_device); + grub_free (filename); + + return ret; +} + +static grub_err_t +grub_fs_file_open (const char *name, grub_disk_t disk) +{ + grub_device_t dev; + + if (grub_strncmp (name, "FILE=", sizeof ("FILE=") - 1)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a FILE virtual volume"); + + dev = search_fs_file (name + sizeof ("FILE=") - 1, &disk->id); + if (! dev) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching file found"); + + disk->total_sectors = dev->disk->total_sectors; + disk->has_partitions = 0; + if (dev->disk->partition) + { + disk->partition = grub_malloc (sizeof (*disk->partition)); + if (disk->partition) + grub_memcpy (disk->partition, dev->disk->partition, + sizeof (*disk->partition)); + } + else + disk->partition = NULL; + + disk->data = dev; + + return GRUB_ERR_NONE; +} + +static void +grub_fs_file_close (grub_disk_t disk) +{ + grub_device_t parent = disk->data; + grub_device_close (parent); +} + +static grub_err_t +grub_fs_file_read (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, char *buf) +{ + grub_device_t parent = disk->data; + return parent->disk->dev->read (parent->disk, sector, size, buf); +} + +static grub_err_t +grub_fs_file_write (grub_disk_t disk, grub_disk_addr_t sector, + grub_size_t size, const char *buf) +{ + grub_device_t parent = disk->data; + return parent->disk->dev->write (parent->disk, sector, size, buf); +} + +static struct grub_disk_dev grub_fs_file_dev = { + .name = "fs_file", + .id = GRUB_DISK_DEVICE_FILE_ID, + .open = grub_fs_file_open, + .close = grub_fs_file_close, + .read = grub_fs_file_read, + .write = grub_fs_file_write, + .next = 0 +}; + +GRUB_MOD_INIT (fs_file) +{ + grub_disk_dev_register (&grub_fs_file_dev); +} + +GRUB_MOD_FINI (fs_file) +{ + grub_disk_dev_unregister (&grub_fs_file_dev); +} diff --git a/include/grub/disk.h b/include/grub/disk.h index a0cc6427d..a47e11337 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -41,6 +41,7 @@ enum grub_disk_dev_id GRUB_DISK_DEVICE_UUID_ID, GRUB_DISK_DEVICE_PXE_ID, GRUB_DISK_DEVICE_SCSI_ID, + GRUB_DISK_DEVICE_FILE_ID, }; struct grub_disk; From 3ac72b51318f703868290bf251a8185924ce51cb Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 19 Jun 2009 17:38:27 +0000 Subject: [PATCH 0882/1707] 2009-06-19 Vladimir Serbinenko * disk/scsi.c (grub_scsi_open): use continue instead of big if --- ChangeLog | 4 ++ disk/scsi.c | 115 ++++++++++++++++++++++++++-------------------------- 2 files changed, 61 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index 982c8bc72..48e505f3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-19 Vladimir Serbinenko + + * disk/scsi.c (grub_scsi_open): use continue instead of big if + 2009-06-18 Pavel Roskin * conf/common.rmk: Add fs_file.mod. diff --git a/disk/scsi.c b/disk/scsi.c index 046dcb8eb..353e63912 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -246,66 +246,65 @@ grub_scsi_open (const char *name, grub_disk_t disk) for (p = grub_scsi_dev_list; p; p = p->next) { - if (! p->open (name, scsi)) + if (p->open (name, scsi)) + continue; + disk->id = (unsigned long) "scsi"; /* XXX */ + disk->data = scsi; + scsi->dev = p; + scsi->lun = lun; + scsi->name = grub_strdup (name); + if (! scsi->name) { - disk->id = (unsigned long) "scsi"; /* XXX */ - disk->data = scsi; - scsi->dev = p; - scsi->lun = lun; - scsi->name = grub_strdup (name); - if (! scsi->name) - { - grub_free (scsi); - return grub_errno; - } - - grub_dprintf ("scsi", "dev opened\n"); - - err = grub_scsi_inquiry (scsi); - if (err) - { - grub_free (scsi); - grub_dprintf ("scsi", "inquiry failed\n"); - return grub_errno; - } - - grub_dprintf ("scsi", "inquiry: devtype=0x%02x removable=%d\n", - scsi->devtype, scsi->removable); - - /* Try to be conservative about the device types - supported. */ - if (scsi->devtype != grub_scsi_devtype_direct - && scsi->devtype != grub_scsi_devtype_cdrom) - { - grub_free (scsi); - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, - "unknown SCSI device"); - } - - if (scsi->devtype == grub_scsi_devtype_cdrom) - disk->has_partitions = 0; - else - disk->has_partitions = 1; - - err = grub_scsi_read_capacity (scsi); - if (err) - { - grub_free (scsi); - grub_dprintf ("scsi", "READ CAPACITY failed\n"); - return grub_errno; - } - - /* SCSI blocks can be something else than 512, although GRUB - wants 512 byte blocks. */ - disk->total_sectors = ((scsi->size * scsi->blocksize) - << GRUB_DISK_SECTOR_BITS); - - grub_dprintf ("scsi", "capacity=%llu, blksize=%d\n", - (unsigned long long) disk->total_sectors, - scsi->blocksize); - - return GRUB_ERR_NONE; + grub_free (scsi); + return grub_errno; } + + grub_dprintf ("scsi", "dev opened\n"); + + err = grub_scsi_inquiry (scsi); + if (err) + { + grub_free (scsi); + grub_dprintf ("scsi", "inquiry failed\n"); + return grub_errno; + } + + grub_dprintf ("scsi", "inquiry: devtype=0x%02x removable=%d\n", + scsi->devtype, scsi->removable); + + /* Try to be conservative about the device types + supported. */ + if (scsi->devtype != grub_scsi_devtype_direct + && scsi->devtype != grub_scsi_devtype_cdrom) + { + grub_free (scsi); + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "unknown SCSI device"); + } + + if (scsi->devtype == grub_scsi_devtype_cdrom) + disk->has_partitions = 0; + else + disk->has_partitions = 1; + + err = grub_scsi_read_capacity (scsi); + if (err) + { + grub_free (scsi); + grub_dprintf ("scsi", "READ CAPACITY failed\n"); + return grub_errno; + } + + /* SCSI blocks can be something else than 512, although GRUB + wants 512 byte blocks. */ + disk->total_sectors = ((scsi->size * scsi->blocksize) + << GRUB_DISK_SECTOR_BITS); + + grub_dprintf ("scsi", "capacity=%llu, blksize=%d\n", + (unsigned long long) disk->total_sectors, + scsi->blocksize); + + return GRUB_ERR_NONE; } grub_free (scsi); From dd74360c7d3888007fab1de10891db4b15d56466 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 19 Jun 2009 20:35:38 +0000 Subject: [PATCH 0883/1707] Fix a typo, spacing --- ChangeLog | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 48e505f3f..3048dba7d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2009-06-19 Vladimir Serbinenko * disk/scsi.c (grub_scsi_open): use continue instead of big if - + 2009-06-18 Pavel Roskin * conf/common.rmk: Add fs_file.mod. @@ -23,7 +23,7 @@ * commands/i386/pc/drivemap_int13h.S: use assembly-time constants for long calls * configure.ac: remove a leftover AC_MSG_RESULT - (CFLAGS): don't add -Wl,--defsym,___main=0x8100 when building with + (CFLAGS): don't add -Wl,--defsym,___main=0x8100 when building with Apple's toolchain 2009-06-18 Vladimir Serbinenko @@ -58,7 +58,7 @@ Fix newline handling * include/grub/script_sh.h (grub_lexer_param): new field was_newline - * script/sh/lexer.c (grub_script_lexer_init): initilaise was_newline + * script/sh/lexer.c (grub_script_lexer_init): initialize was_newline (grub_script_yylex): don't segfault on unterminated script newline terminates command and variable @@ -151,9 +151,9 @@ 2009-06-13 Vladimir Serbinenko - * loader/i386/multiboot.c (grub_multiboot_get_bootdev): fix partition + * loader/i386/multiboot.c (grub_multiboot_get_bootdev): fix partition handling - + 2009-06-13 Jun Inoue * util/grub-mkconfig.in: Fix parsing of --output option. From 024ef597abe337645f8a60382530edc359f0efca Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 19 Jun 2009 21:33:07 +0000 Subject: [PATCH 0884/1707] 2009-06-19 Pavel Roskin * configure.ac: Remove stray AC_MSG_CHECKING. --- ChangeLog | 4 ++++ configure.ac | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3048dba7d..2cd7cf2b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-19 Pavel Roskin + + * configure.ac: Remove stray AC_MSG_CHECKING. + 2009-06-19 Vladimir Serbinenko * disk/scsi.c (grub_scsi_open): use continue instead of big if diff --git a/configure.ac b/configure.ac index a8cb23468..6a6d8453f 100644 --- a/configure.ac +++ b/configure.ac @@ -292,7 +292,6 @@ if test x$grub_cv_apple_target_cc = xyes ; then else TARGET_APPLE_CC=0 # Use linker script if present, otherwise use builtin -N script. -AC_MSG_CHECKING([for option to link raw image]) if test -f "${srcdir}/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc"; then TARGET_IMG_LDSCRIPT='$(top_srcdir)'"/conf/${target_cpu}-${platform}-${host_os}-img-ld.sc" TARGET_IMG_LDFLAGS="-Wl,-T${TARGET_IMG_LDSCRIPT} -Wl,-Ttext," From ab32d3b5fe277c9acb7498779cf212173c7b1887 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 20 Jun 2009 03:06:50 +0000 Subject: [PATCH 0885/1707] 2009-06-20 Vladimir Serbinenko * disk/mdraid_linux.c (GRUB_MOD_FINI): use grub_raid_unregister and not grub_raid_register * disk/dmraid_nvidia.c (GRUB_MOD_FINI): likewise --- ChangeLog | 6 ++++++ disk/dmraid_nvidia.c | 2 +- disk/mdraid_linux.c | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2cd7cf2b3..4a1e7b702 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-20 Vladimir Serbinenko + + * disk/mdraid_linux.c (GRUB_MOD_FINI): use grub_raid_unregister and not + grub_raid_register + * disk/dmraid_nvidia.c (GRUB_MOD_FINI): likewise + 2009-06-19 Pavel Roskin * configure.ac: Remove stray AC_MSG_CHECKING. diff --git a/disk/dmraid_nvidia.c b/disk/dmraid_nvidia.c index 76847556a..84dfad8c4 100644 --- a/disk/dmraid_nvidia.c +++ b/disk/dmraid_nvidia.c @@ -161,5 +161,5 @@ GRUB_MOD_INIT(dm_nv) GRUB_MOD_FINI(dm_nv) { - grub_raid_register (&grub_dmraid_nv_dev); + grub_raid_unregister (&grub_dmraid_nv_dev); } diff --git a/disk/mdraid_linux.c b/disk/mdraid_linux.c index 25a06804c..29a21b4c7 100644 --- a/disk/mdraid_linux.c +++ b/disk/mdraid_linux.c @@ -229,5 +229,5 @@ GRUB_MOD_INIT (mdraid) GRUB_MOD_FINI (mdraid) { - grub_raid_register (&grub_mdraid_dev); + grub_raid_unregister (&grub_mdraid_dev); } From cd7310d5d5ff15e79b4b9e3515f3d4d629f5a2c0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 20 Jun 2009 14:11:45 +0000 Subject: [PATCH 0886/1707] 2009-06-20 Robert Millan * include/grub/i386/loader.h (grub_linux_prot_size) (grub_linux_tmp_addr, grub_linux_real_addr) (grub_linux_is_bzimage, grub_linux16_boot): Declare only on GRUB_MACHINE_PCBIOS. * util/i386/pc/grub-mkimage.c (compress_kernel): Move common grub_util_info() call to ... (generate_image): ... here. Fix use of uninitialized memory, comparison of signed with unsigned integers and memory leak. Remove bogus module address message. --- ChangeLog | 13 +++++++++++++ include/grub/i386/loader.h | 9 ++++++--- util/i386/pc/grub-mkimage.c | 23 ++++++++++------------- 3 files changed, 29 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4a1e7b702..4e48c3f18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-06-20 Robert Millan + + * include/grub/i386/loader.h (grub_linux_prot_size) + (grub_linux_tmp_addr, grub_linux_real_addr) + (grub_linux_is_bzimage, grub_linux16_boot): Declare only on + GRUB_MACHINE_PCBIOS. + * util/i386/pc/grub-mkimage.c (compress_kernel): Move + common grub_util_info() call to ... + (generate_image): ... here. + Fix use of uninitialized memory, comparison of signed with + unsigned integers and memory leak. + Remove bogus module address message. + 2009-06-20 Vladimir Serbinenko * disk/mdraid_linux.c (GRUB_MOD_FINI): use grub_raid_unregister and not diff --git a/include/grub/i386/loader.h b/include/grub/i386/loader.h index 72a44d088..b7fa413f1 100644 --- a/include/grub/i386/loader.h +++ b/include/grub/i386/loader.h @@ -22,14 +22,17 @@ #include #include #include +#include +extern grub_addr_t EXPORT_VAR(grub_os_area_addr); +extern grub_size_t EXPORT_VAR(grub_os_area_size); + +#ifdef GRUB_MACHINE_PCBIOS extern grub_uint32_t EXPORT_VAR(grub_linux_prot_size); extern char *EXPORT_VAR(grub_linux_tmp_addr); extern char *EXPORT_VAR(grub_linux_real_addr); extern grub_int32_t EXPORT_VAR(grub_linux_is_bzimage); -extern grub_addr_t EXPORT_VAR(grub_os_area_addr); -extern grub_size_t EXPORT_VAR(grub_os_area_size); - grub_err_t EXPORT_FUNC(grub_linux16_boot) (void); +#endif #endif /* ! GRUB_LOADER_CPU_HEADER */ diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index b10768eef..19adc55a7 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -1,7 +1,7 @@ /* grub-mkimage.c - make a bootable image */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -59,7 +59,6 @@ compress_kernel (char *kernel_img, size_t kernel_size, lzo_uint size; char *wrkmem; - grub_util_info ("kernel_img=%p, kernel_size=0x%x", kernel_img, kernel_size); if (kernel_size < GRUB_KERNEL_MACHINE_RAW_SIZE) grub_util_error ("the core image is too small"); @@ -107,7 +106,6 @@ compress_kernel (char *kernel_img, size_t kernel_size, props.pb = 2; props.numThreads = 1; - grub_util_info ("kernel_img=%p, kernel_size=0x%x", kernel_img, kernel_size); if (kernel_size < GRUB_KERNEL_MACHINE_RAW_SIZE) grub_util_error ("the core image is too small"); @@ -132,7 +130,6 @@ static void generate_image (const char *dir, char *prefix, FILE *out, char *mods[], char *memdisk_path, char *config_path) { - grub_addr_t module_addr = 0; char *kernel_img, *boot_img, *core_img; size_t kernel_size, boot_size, total_module_size, core_size; size_t memdisk_size = 0, config_size = 0; @@ -178,6 +175,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], /* Fill in the grub_module_info structure. */ modinfo = (struct grub_module_info *) (kernel_img + kernel_size); + memset (modinfo, 0, sizeof (struct grub_module_info)); modinfo->magic = GRUB_MODULE_MAGIC; modinfo->offset = sizeof (struct grub_module_info); modinfo->size = total_module_size; @@ -191,6 +189,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], mod_size = grub_util_get_image_size (p->name); header = (struct grub_module_header *) (kernel_img + offset); + memset (header, 0, sizeof (struct grub_module_header)); header->type = grub_cpu_to_le32 (OBJ_TYPE_ELF); header->size = grub_cpu_to_le32 (mod_size + sizeof (*header)); offset += sizeof (*header); @@ -204,6 +203,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], struct grub_module_header *header; header = (struct grub_module_header *) (kernel_img + offset); + memset (header, 0, sizeof (struct grub_module_header)); header->type = grub_cpu_to_le32 (OBJ_TYPE_MEMDISK); header->size = grub_cpu_to_le32 (memdisk_size + sizeof (*header)); offset += sizeof (*header); @@ -217,6 +217,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], struct grub_module_header *header; header = (struct grub_module_header *) (kernel_img + offset); + memset (header, 0, sizeof (struct grub_module_header)); header->type = grub_cpu_to_le32 (OBJ_TYPE_CONFIG); header->size = grub_cpu_to_le32 (config_size + sizeof (*header)); offset += sizeof (*header); @@ -226,6 +227,7 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], *(kernel_img + offset - 1) = 0; } + grub_util_info ("kernel_img=%p, kernel_size=0x%x", kernel_img, kernel_size); compress_kernel (kernel_img, kernel_size + total_module_size, &core_img, &core_size); @@ -251,12 +253,6 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], free (boot_img); free (boot_path); - module_addr = (path_list - ? (GRUB_BOOT_MACHINE_KERNEL_ADDR + GRUB_DISK_SECTOR_SIZE - + kernel_size) - : 0); - - grub_util_info ("the first module address is 0x%x", module_addr); *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE)) = grub_cpu_to_le32 (total_module_size); *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE)) @@ -274,9 +270,9 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], = grub_cpu_to_le32 (-2); } - if (core_size > GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR) - grub_util_error ("Core image is too big (%p > %p)\n", core_size, - GRUB_MEMORY_MACHINE_UPPER - GRUB_MEMORY_MACHINE_LINK_ADDR); + if (GRUB_MEMORY_MACHINE_LINK_ADDR + core_size > GRUB_MEMORY_MACHINE_UPPER) + grub_util_error ("Core image is too big (%p > %p)\n", + GRUB_MEMORY_MACHINE_LINK_ADDR + core_size, GRUB_MEMORY_MACHINE_UPPER); grub_util_write_image (core_img, core_size, out); free (kernel_img); @@ -415,6 +411,7 @@ main (int argc, char *argv[]) if (output) { fp = fopen (output, "wb"); + free (output); if (! fp) grub_util_error ("cannot open %s", output); } From 546796c1d7be34f64171c9a5ad1f9d4e2e348d4e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 20 Jun 2009 14:32:53 +0000 Subject: [PATCH 0887/1707] 2009-06-20 Robert Millan * util/i386/pc/grub-mkimage.c (main): Oops, free `output' only after it's no longer needed. --- ChangeLog | 5 +++++ util/i386/pc/grub-mkimage.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 4e48c3f18..630829b89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-20 Robert Millan + + * util/i386/pc/grub-mkimage.c (main): Oops, free `output' only + after it's no longer needed. + 2009-06-20 Robert Millan * include/grub/i386/loader.h (grub_linux_prot_size) diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 19adc55a7..86bfd653f 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -411,9 +411,9 @@ main (int argc, char *argv[]) if (output) { fp = fopen (output, "wb"); - free (output); if (! fp) grub_util_error ("cannot open %s", output); + free (output); } generate_image (dir ? : GRUB_LIBDIR, prefix ? : DEFAULT_DIRECTORY, fp, From 0db15301d1ce3700e50ba15cae02249aa2dcb530 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 21 Jun 2009 11:21:59 +0000 Subject: [PATCH 0888/1707] 2009-06-21 Colin Watson * util/grub-mkconfig.in (GRUB_DISABLE_LINUX_RECOVERY): Export variable. * util/grub.d/10_linux.in: If GRUB_DISABLE_LINUX_RECOVERY is true, don't write a menu entry for recovery mode. --- ChangeLog | 7 +++++++ util/grub-mkconfig.in | 2 +- util/grub.d/10_linux.in | 6 ++++-- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 630829b89..fbcfa7159 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-21 Colin Watson + + * util/grub-mkconfig.in (GRUB_DISABLE_LINUX_RECOVERY): Export + variable. + * util/grub.d/10_linux.in: If GRUB_DISABLE_LINUX_RECOVERY is true, + don't write a menu entry for recovery mode. + 2009-06-20 Robert Millan * util/i386/pc/grub-mkimage.c (main): Oops, free `output' only diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 6c18f6ac1..4eb7dd2ae 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -173,7 +173,7 @@ esac export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES # These are optional, user-defined variables. -export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_GFXMODE +export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_DISABLE_LINUX_RECOVERY GRUB_GFXMODE if test "x${grub_cfg}" != "x"; then rm -f ${grub_cfg}.new diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index ce87cd6e4..e36b5b006 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -143,8 +143,10 @@ while [ "x$list" != "x" ] ; do linux_entry "${OS}, Linux ${version}" \ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" - linux_entry "${OS}, Linux ${version} (recovery mode)" \ - "single ${GRUB_CMDLINE_LINUX}" + if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then + linux_entry "${OS}, Linux ${version} (recovery mode)" \ + "single ${GRUB_CMDLINE_LINUX}" + fi list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` done From 3f3ec72b38be5ce07d56d4a30a2c8241b11de7dc Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 21 Jun 2009 15:48:10 +0000 Subject: [PATCH 0889/1707] 2009-06-21 Vladimir Serbinenko Load BSD ELF modules * conf/i386-pc.rmk (bsd_mod_SOURCES): Add loader/i386/bsd32.c and loader/i386/bsd64.c * include/grub/i386/bsd.h (FREEBSD_MODTYPE_MODULE): Remove (FREEBSD_MODTYPE_ELF_MODULE): New definition (FREEBSD_MODTYPE_ELF_MODULE_OBJ): Likewise (grub_freebsd_load_elfmodule32): New declaration (grub_freebsd_load_elfmoduleobj64): Likewise (grub_freebsd_load_elf_meta32): Likewise (grub_freebsd_load_elf_meta64): Likewise (grub_freebsd_add_meta): Likewise (grub_freebsd_add_meta_module): Likewise * loader/i386/bsd.c (grub_freebsd_add_meta): Make global (grub_freebsd_add_meta_module): Likewise and move module-specific parts to grub_cmd_freebsd and grub_cmd_freebsd_module (grub_cmd_freebsd): Add elf-kernel specific parts based on grub_freebsd_add_meta_module (grub_cmd_freebsd_module): Add type parsing moved from grub_freebsd_add_meta_module (grub_cmd_freebsd_module_elf): New function (cmd_freebsd_module_elf): New variable (GRUB_MOD_INIT): Register freebsd_module_elf * loader/i386/bsd32.c: New file * loader/i386/bsd64.c: Likewise * loader/i386/bsdXX.c: Likewise * kern/elf.c (grub_elf32_load): Let hook decide which pheaders to load (grub_elf64_load): Likewise * include/grub/elfload.h (grub_elf32_load_hook_t): New parameter do_load All users updated (grub_elf64_load_hook_t): Likewise --- ChangeLog | 34 ++++ conf/i386-pc.rmk | 2 +- include/grub/elfload.h | 4 +- include/grub/i386/bsd.h | 18 +- include/grub/multiboot2.h | 4 +- kern/elf.c | 18 +- loader/i386/bsd.c | 190 +++++++++++++----- loader/i386/bsd32.c | 8 + loader/i386/bsd64.c | 8 + loader/i386/bsdXX.c | 329 ++++++++++++++++++++++++++++++++ loader/i386/pc/multiboot2.c | 20 +- loader/ieee1275/multiboot2.c | 20 +- loader/powerpc/ieee1275/linux.c | 17 +- loader/sparc64/ieee1275/linux.c | 9 +- 14 files changed, 613 insertions(+), 68 deletions(-) create mode 100644 loader/i386/bsd32.c create mode 100644 loader/i386/bsd64.c create mode 100644 loader/i386/bsdXX.c diff --git a/ChangeLog b/ChangeLog index fbcfa7159..c9bfe50f5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,37 @@ +2009-06-21 Vladimir Serbinenko + + Load BSD ELF modules + + * conf/i386-pc.rmk (bsd_mod_SOURCES): Add loader/i386/bsd32.c + and loader/i386/bsd64.c + * include/grub/i386/bsd.h (FREEBSD_MODTYPE_MODULE): Remove + (FREEBSD_MODTYPE_ELF_MODULE): New definition + (FREEBSD_MODTYPE_ELF_MODULE_OBJ): Likewise + (grub_freebsd_load_elfmodule32): New declaration + (grub_freebsd_load_elfmoduleobj64): Likewise + (grub_freebsd_load_elf_meta32): Likewise + (grub_freebsd_load_elf_meta64): Likewise + (grub_freebsd_add_meta): Likewise + (grub_freebsd_add_meta_module): Likewise + * loader/i386/bsd.c (grub_freebsd_add_meta): Make global + (grub_freebsd_add_meta_module): Likewise and move module-specific + parts to grub_cmd_freebsd and grub_cmd_freebsd_module + (grub_cmd_freebsd): Add elf-kernel specific parts + based on grub_freebsd_add_meta_module + (grub_cmd_freebsd_module): Add type parsing moved from + grub_freebsd_add_meta_module + (grub_cmd_freebsd_module_elf): New function + (cmd_freebsd_module_elf): New variable + (GRUB_MOD_INIT): Register freebsd_module_elf + * loader/i386/bsd32.c: New file + * loader/i386/bsd64.c: Likewise + * loader/i386/bsdXX.c: Likewise + * kern/elf.c (grub_elf32_load): Let hook decide which pheaders to load + (grub_elf64_load): Likewise + * include/grub/elfload.h (grub_elf32_load_hook_t): New parameter do_load + All users updated + (grub_elf64_load_hook_t): Likewise + 2009-06-21 Colin Watson * util/grub-mkconfig.in (GRUB_DISABLE_LINUX_RECOVERY): Export diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 20c31efa0..ae4feafbf 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -329,7 +329,7 @@ aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) # For bsd.mod -bsd_mod_SOURCES = loader/i386/bsd.c loader/i386/bsd_helper.S loader/i386/bsd_trampoline.S +bsd_mod_SOURCES = loader/i386/bsd.c loader/i386/bsd32.c loader/i386/bsd64.c loader/i386/bsd_helper.S loader/i386/bsd_trampoline.S bsd_mod_CFLAGS = $(COMMON_CFLAGS) bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) bsd_mod_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/include/grub/elfload.h b/include/grub/elfload.h index 5d611daf0..6e09e0d05 100644 --- a/include/grub/elfload.h +++ b/include/grub/elfload.h @@ -37,9 +37,9 @@ struct grub_elf_file typedef struct grub_elf_file *grub_elf_t; typedef grub_err_t (*grub_elf32_load_hook_t) - (Elf32_Phdr *phdr, grub_addr_t *addr); + (Elf32_Phdr *phdr, grub_addr_t *addr, int *load); typedef grub_err_t (*grub_elf64_load_hook_t) - (Elf64_Phdr *phdr, grub_addr_t *addr); + (Elf64_Phdr *phdr, grub_addr_t *addr, int *load); grub_elf_t grub_elf_open (const char *); grub_elf_t grub_elf_file (grub_file_t); diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index 321b31fdf..3130697af 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -86,7 +86,8 @@ #define FREEBSD_MODTYPE_KERNEL "elf kernel" #define FREEBSD_MODTYPE_KERNEL64 "elf64 kernel" -#define FREEBSD_MODTYPE_MODULE "elf module" +#define FREEBSD_MODTYPE_ELF_MODULE "elf module" +#define FREEBSD_MODTYPE_ELF_MODULE_OBJ "elf obj module" #define FREEBSD_MODTYPE_RAW "raw" struct grub_freebsd_bootinfo @@ -229,6 +230,21 @@ struct grub_netbsd_btinfo_bootdisk void grub_unix_real_boot (grub_addr_t entry, ...) __attribute__ ((cdecl,noreturn)); +grub_err_t grub_freebsd_load_elfmodule32 (grub_file_t file, int argc, + char *argv[], grub_addr_t *kern_end); +grub_err_t grub_freebsd_load_elfmodule_obj64 (grub_file_t file, int argc, + char *argv[], + grub_addr_t *kern_end); +grub_err_t grub_freebsd_load_elf_meta32 (grub_file_t file, + grub_addr_t *kern_end); +grub_err_t grub_freebsd_load_elf_meta64 (grub_file_t file, + grub_addr_t *kern_end); + +grub_err_t grub_freebsd_add_meta (grub_uint32_t type, void *data, + grub_uint32_t len); +grub_err_t grub_freebsd_add_meta_module (char *filename, char *type, + int argc, char **argv, + grub_addr_t addr, grub_uint32_t size); extern grub_uint8_t grub_bsd64_trampoline_start, grub_bsd64_trampoline_end; extern grub_uint32_t grub_bsd64_trampoline_selfjump; diff --git a/include/grub/multiboot2.h b/include/grub/multiboot2.h index 69d939344..1d2324a53 100644 --- a/include/grub/multiboot2.h +++ b/include/grub/multiboot2.h @@ -45,10 +45,10 @@ void grub_mb2_arch_unload (struct multiboot_tag_header *tags); grub_err_t -grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, grub_addr_t *addr); +grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load); grub_err_t -grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, grub_addr_t *addr); +grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load); grub_err_t grub_mb2_arch_module_alloc (grub_size_t size, grub_addr_t *addr); diff --git a/kern/elf.c b/kern/elf.c index 82e24846d..259055238 100644 --- a/kern/elf.c +++ b/kern/elf.c @@ -228,14 +228,15 @@ grub_elf32_load (grub_elf_t _elf, grub_elf32_load_hook_t _load_hook, { grub_elf32_load_hook_t load_hook = (grub_elf32_load_hook_t) hook; grub_addr_t load_addr; - - if (phdr->p_type != PT_LOAD) - return 0; + int do_load = 1; load_addr = phdr->p_paddr; - if (load_hook && load_hook (phdr, &load_addr)) + if (load_hook && load_hook (phdr, &load_addr, &do_load)) return 1; + if (! do_load) + return 0; + if (load_addr < load_base) load_base = load_addr; @@ -407,14 +408,15 @@ grub_elf64_load (grub_elf_t _elf, grub_elf64_load_hook_t _load_hook, { grub_elf64_load_hook_t load_hook = (grub_elf64_load_hook_t) hook; grub_addr_t load_addr; - - if (phdr->p_type != PT_LOAD) - return 0; + int do_load = 1; load_addr = phdr->p_paddr; - if (load_hook && load_hook (phdr, &load_addr)) + if (load_hook && load_hook (phdr, &load_addr, &do_load)) return 1; + if (! do_load) + return 0; + if (load_addr < load_base) load_base = load_addr; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 6214b001c..b76cfb549 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -116,7 +116,7 @@ grub_bsd_get_device (grub_uint32_t * biosdev, grub_device_close (dev); } -static grub_err_t +grub_err_t grub_freebsd_add_meta (grub_uint32_t type, void *data, grub_uint32_t len) { if (mod_buf_max < mod_buf_len + len + 8) @@ -261,36 +261,21 @@ grub_freebsd_add_mmap (void) return grub_errno; } -static grub_err_t -grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, +grub_err_t +grub_freebsd_add_meta_module (char *filename, char *type, int argc, char **argv, grub_addr_t addr, grub_uint32_t size) { - char *name, *type; - - name = grub_strrchr (argv[0], '/'); + char *name; + name = grub_strrchr (filename, '/'); if (name) name++; else - name = argv[0]; + name = filename; if (grub_freebsd_add_meta (FREEBSD_MODINFO_NAME, name, grub_strlen (name) + 1)) return grub_errno; - argc--; - argv++; - - if ((argc) && (!grub_memcmp (argv[0], "type=", 5))) - { - type = &argv[0][5]; - argc--; - argv++; - } - else - type = ((is_kern) ? - ((is_64bit) ? FREEBSD_MODTYPE_KERNEL64 : FREEBSD_MODTYPE_KERNEL) - : FREEBSD_MODTYPE_RAW); - if (is_64bit) { grub_uint64_t addr64 = addr, size64 = size; @@ -341,23 +326,6 @@ grub_freebsd_add_meta_module (int is_kern, int argc, char **argv, } } - if (is_kern) - { - int len = (is_64bit) ? 8 : 4; - grub_uint64_t data = 0; - - if ((grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | - FREEBSD_MODINFOMD_HOWTO, &data, 4)) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | - FREEBSD_MODINFOMD_ENVP, &data, len)) || - (grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | - FREEBSD_MODINFOMD_KERNEND, &data, len))) - return grub_errno; - kern_end_mdofs = mod_buf_len - len; - - return grub_freebsd_add_mmap (); - } - return GRUB_ERR_NONE; } @@ -688,10 +656,18 @@ grub_bsd_load_aout (grub_file_t file) } static grub_err_t -grub_bsd_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr) +grub_bsd_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr, int *do_load) { Elf32_Addr paddr; + if (phdr->p_type != PT_LOAD + && phdr->p_type != PT_DYNAMIC) + { + *do_load = 0; + return 0; + } + + *do_load = 1; phdr->p_paddr &= 0xFFFFFF; paddr = phdr->p_paddr; @@ -712,10 +688,18 @@ grub_bsd_elf32_hook (Elf32_Phdr * phdr, grub_addr_t * addr) } static grub_err_t -grub_bsd_elf64_hook (Elf64_Phdr * phdr, grub_addr_t * addr) +grub_bsd_elf64_hook (Elf64_Phdr * phdr, grub_addr_t * addr, int *do_load) { Elf64_Addr paddr; + if (phdr->p_type != PT_LOAD + && phdr->p_type != PT_DYNAMIC) + { + *do_load = 0; + return 0; + } + + *do_load = 1; paddr = phdr->p_paddr & 0xffffff; if ((paddr < grub_os_area_addr) @@ -838,10 +822,54 @@ grub_cmd_freebsd (grub_command_t cmd __attribute__ ((unused)), if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) { kern_end = ALIGN_PAGE (kern_end); - if ((is_elf_kernel) && - (grub_freebsd_add_meta_module (1, argc, argv, kern_start, - kern_end - kern_start))) - return grub_errno; + if (is_elf_kernel) + { + grub_err_t err; + grub_uint64_t data = 0; + grub_file_t file; + int len = is_64bit ? 8 : 4; + + err = grub_freebsd_add_meta_module (argv[0], is_64bit + ? FREEBSD_MODTYPE_KERNEL64 + : FREEBSD_MODTYPE_KERNEL, + argc - 1, argv + 1, + kern_start, + kern_end - kern_start); + if (err) + return err; + + file = grub_gzfile_open (argv[0], 1); + if (! file) + return grub_errno; + + if (is_64bit) + err = grub_freebsd_load_elf_meta64 (file, &kern_end); + else + err = grub_freebsd_load_elf_meta32 (file, &kern_end); + if (err) + return err; + + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_HOWTO, &data, 4); + if (err) + return err; + + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_ENVP, &data, len); + if (err) + return err; + + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_KERNEND, &data, len); + if (err) + return err; + + kern_end_mdofs = mod_buf_len - len; + + err = grub_freebsd_add_mmap (); + if (err) + return err; + } grub_loader_set (grub_freebsd_boot, grub_bsd_unload, 1); } @@ -969,6 +997,10 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { grub_file_t file = 0; + grub_err_t err; + int modargc; + char **modargv; + char *type; if (kernel_type != KERNEL_TYPE_FREEBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, @@ -996,9 +1028,27 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), } grub_file_read (file, (void *) kern_end, file->size); - if ((!grub_errno) && - (!grub_freebsd_add_meta_module (0, argc, argv, kern_end, file->size))) - kern_end = ALIGN_PAGE (kern_end + file->size); + if (grub_errno) + goto fail; + + modargc = argc - 1; + modargv = argv + 1; + + if (modargc && (! grub_memcmp (modargv[0], "type=", 5))) + { + type = &modargv[0][5]; + modargc--; + modargv++; + } + else + type = FREEBSD_MODTYPE_RAW; + + err = grub_freebsd_add_meta_module (argv[0], type, modargc, modargv, + kern_end, file->size); + if (err) + goto fail; + + kern_end = ALIGN_PAGE (kern_end + file->size); fail: if (file) @@ -1007,8 +1057,50 @@ fail: return grub_errno; } +static grub_err_t +grub_cmd_freebsd_module_elf (grub_command_t cmd __attribute__ ((unused)), + int argc, char *argv[]) +{ + grub_file_t file = 0; + grub_err_t err; + + if (kernel_type != KERNEL_TYPE_FREEBSD) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "only freebsd support module"); + + if (! is_elf_kernel) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "only elf kernel support module"); + + /* List the current modules if no parameter. */ + if (! argc) + { + grub_freebsd_list_modules (); + return 0; + } + + file = grub_gzfile_open (argv[0], 1); + if (!file) + return grub_errno; + if (!file->size) + { + grub_file_close (file); + return grub_errno; + } + + if (is_64bit) + err = grub_freebsd_load_elfmodule_obj64 (file, argc, argv, &kern_end); + else + err = grub_freebsd_load_elfmodule32 (file, argc, argv, &kern_end); + grub_file_close (file); + + return err; +} + + static grub_command_t cmd_freebsd, cmd_openbsd, cmd_netbsd; static grub_command_t cmd_freebsd_loadenv, cmd_freebsd_module; +static grub_command_t cmd_freebsd_module_elf; GRUB_MOD_INIT (bsd) { @@ -1027,6 +1119,9 @@ GRUB_MOD_INIT (bsd) cmd_freebsd_module = grub_register_command ("freebsd_module", grub_cmd_freebsd_module, 0, "load freebsd module"); + cmd_freebsd_module_elf = + grub_register_command ("freebsd_module_elf", grub_cmd_freebsd_module_elf, + 0, "load freebsd ELF module"); my_mod = mod; } @@ -1039,6 +1134,7 @@ GRUB_MOD_FINI (bsd) grub_unregister_command (cmd_freebsd_loadenv); grub_unregister_command (cmd_freebsd_module); + grub_unregister_command (cmd_freebsd_module_elf); if (mod_buf) { diff --git a/loader/i386/bsd32.c b/loader/i386/bsd32.c new file mode 100644 index 000000000..24dab6cf4 --- /dev/null +++ b/loader/i386/bsd32.c @@ -0,0 +1,8 @@ +#define SUFFIX(x) x ## 32 +#define Elf_Ehdr Elf32_Ehdr +#define Elf_Shdr Elf32_Shdr +#define Elf_Sym Elf32_Sym +#define OBJSYM 0 +#include +typedef grub_uint32_t grub_freebsd_addr_t; +#include "bsdXX.c" diff --git a/loader/i386/bsd64.c b/loader/i386/bsd64.c new file mode 100644 index 000000000..f4ff8b233 --- /dev/null +++ b/loader/i386/bsd64.c @@ -0,0 +1,8 @@ +#define SUFFIX(x) x ## 64 +#define Elf_Ehdr Elf64_Ehdr +#define Elf_Shdr Elf64_Shdr +#define Elf_Sym Elf64_Sym +#define OBJSYM 1 +#include +typedef grub_uint64_t grub_freebsd_addr_t; +#include "bsdXX.c" diff --git a/loader/i386/bsdXX.c b/loader/i386/bsdXX.c new file mode 100644 index 000000000..3f15579dd --- /dev/null +++ b/loader/i386/bsdXX.c @@ -0,0 +1,329 @@ +#include +#include +#include +#include +#include +#include + +#define ALIGN_PAGE(a) ALIGN_UP (a, 4096) + +static inline grub_err_t +load (grub_file_t file, void *where, grub_off_t off, grub_size_t size) +{ + if (PTR_TO_UINT32 (where) + size > grub_os_area_addr + grub_os_area_size) + return grub_error (GRUB_ERR_OUT_OF_RANGE, + "Not enough memory for the module"); + if (grub_file_seek (file, off) == (grub_off_t) -1) + return grub_errno; + if (grub_file_read (file, where, size) + != (grub_ssize_t) size) + { + if (grub_errno) + return grub_errno; + else + return grub_error (GRUB_ERR_BAD_OS, "file is truncated"); + } + return GRUB_ERR_NONE; +} + +static inline grub_err_t +read_headers (grub_file_t file, Elf_Ehdr *e, char **shdr) +{ + if (grub_file_seek (file, 0) == (grub_off_t) -1) + return grub_errno; + + if (grub_file_read (file, (char *) e, sizeof (*e)) != sizeof (*e)) + { + if (grub_errno) + return grub_errno; + else + return grub_error (GRUB_ERR_BAD_OS, "file is too short"); + } + + if (e->e_ident[EI_MAG0] != ELFMAG0 + || e->e_ident[EI_MAG1] != ELFMAG1 + || e->e_ident[EI_MAG2] != ELFMAG2 + || e->e_ident[EI_MAG3] != ELFMAG3 + || e->e_ident[EI_VERSION] != EV_CURRENT + || e->e_version != EV_CURRENT) + return grub_error (GRUB_ERR_BAD_OS, "invalid arch independent ELF magic"); + + if (e->e_ident[EI_CLASS] != SUFFIX (ELFCLASS)) + return grub_error (GRUB_ERR_BAD_OS, "invalid arch dependent ELF magic"); + + *shdr = grub_malloc (e->e_shnum * e->e_shentsize); + if (! *shdr) + return grub_errno; + + if (grub_file_seek (file, e->e_shoff) == (grub_off_t) -1) + return grub_errno; + + if (grub_file_read (file, *shdr, e->e_shnum * e->e_shentsize) + != e->e_shnum * e->e_shentsize) + { + if (grub_errno) + return grub_errno; + else + return grub_error (GRUB_ERR_BAD_OS, "file is truncated"); + } + + return GRUB_ERR_NONE; +} + +/* On i386 FreeBSD uses "elf module" approarch for 32-bit variant + and "elf obj module" for 64-bit variant. However it may differ on other + platforms. So I keep both versions. */ +#if OBJSYM +grub_err_t +SUFFIX (grub_freebsd_load_elfmodule_obj) (grub_file_t file, int argc, + char *argv[], grub_addr_t *kern_end) +{ + Elf_Ehdr e; + Elf_Shdr *s; + char *shdr; + grub_addr_t curload, module; + grub_err_t err; + + err = read_headers (file, &e, &shdr); + if (err) + return err; + + curload = module = ALIGN_PAGE (*kern_end); + + for (s = (Elf_Shdr *) shdr; s < (Elf_Shdr *) ((char *) shdr + + e.e_shnum * e.e_shentsize); + s = (Elf_Shdr *) ((char *) s + e.e_shentsize)) + { + if (s->sh_size == 0) + continue; + + if (s->sh_addralign) + curload = ALIGN_UP (curload, s->sh_addralign); + s->sh_addr = curload; + + grub_dprintf ("bsd", "loading section to %x, size %d, align %d\n", + (unsigned) curload, (int) s->sh_size, + (int) s->sh_addralign); + + switch (s->sh_type) + { + default: + case SHT_PROGBITS: + err = load (file, UINT_TO_PTR (curload), s->sh_offset, s->sh_size); + if (err) + return err; + break; + case SHT_NOBITS: + if (curload + s->sh_size > grub_os_area_addr + grub_os_area_size) + return grub_error (GRUB_ERR_OUT_OF_RANGE, + "Not enough memory for the module"); + grub_memset (UINT_TO_PTR (curload), 0, s->sh_size); + break; + } + curload += s->sh_size; + } + + *kern_end = ALIGN_PAGE (curload); + + err = grub_freebsd_add_meta_module (argv[0], FREEBSD_MODTYPE_ELF_MODULE_OBJ, + argc - 1, argv + 1, module, + curload - module); + if (! err) + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA + | FREEBSD_MODINFOMD_ELFHDR, + &e, sizeof (e)); + if (! err) + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA + | FREEBSD_MODINFOMD_SHDR, + shdr, e.e_shnum * e.e_shentsize); + + return err; +} + +#else + +grub_err_t +SUFFIX (grub_freebsd_load_elfmodule) (grub_file_t file, int argc, char *argv[], + grub_addr_t *kern_end) +{ + Elf_Ehdr e; + Elf_Shdr *s; + char *shdr; + grub_addr_t curload, module; + grub_err_t err; + + err = read_headers (file, &e, &shdr); + if (err) + return err; + + curload = module = ALIGN_PAGE (*kern_end); + + for (s = (Elf_Shdr *) shdr; s < (Elf_Shdr *) ((char *) shdr + + e.e_shnum * e.e_shentsize); + s = (Elf_Shdr *) ((char *) s + e.e_shentsize)) + { + if (s->sh_size == 0) + continue; + + if (! (s->sh_flags & SHF_ALLOC)) + continue; + + grub_dprintf ("bsd", "loading section to %x, size %d, align %d\n", + (unsigned) curload, (int) s->sh_size, + (int) s->sh_addralign); + + switch (s->sh_type) + { + default: + case SHT_PROGBITS: + err = load (file, UINT_TO_PTR (module + s->sh_addr), + s->sh_offset, s->sh_size); + if (err) + return err; + break; + case SHT_NOBITS: + if (module + s->sh_addr + s->sh_size + > grub_os_area_addr + grub_os_area_size) + return grub_error (GRUB_ERR_OUT_OF_RANGE, + "Not enough memory for the module"); + grub_memset (UINT_TO_PTR (module + s->sh_addr), 0, s->sh_size); + break; + } + if (curload < module + s->sh_addr + s->sh_size) + curload = module + s->sh_addr + s->sh_size; + } + + load (file, UINT_TO_PTR (module), 0, sizeof (e)); + if (curload < module + sizeof (e)) + curload = module + sizeof (e); + + load (file, UINT_TO_PTR (module + e.e_shoff), e.e_shoff, + e.e_shnum * e.e_shentsize); + if (curload < module + e.e_shoff + e.e_shnum * e.e_shentsize) + curload = module + e.e_shoff + e.e_shnum * e.e_shentsize; + + load (file, UINT_TO_PTR (module + e.e_phoff), e.e_phoff, + e.e_phnum * e.e_phentsize); + if (curload < module + e.e_phoff + e.e_phnum * e.e_phentsize) + curload = module + e.e_phoff + e.e_phnum * e.e_phentsize; + + *kern_end = curload; + + grub_freebsd_add_meta_module (argv[0], FREEBSD_MODTYPE_ELF_MODULE, + argc - 1, argv + 1, module, + curload - module); + return SUFFIX (grub_freebsd_load_elf_meta) (file, kern_end); +} + +#endif + +grub_err_t +SUFFIX (grub_freebsd_load_elf_meta) (grub_file_t file, grub_addr_t *kern_end) +{ + grub_err_t err; + Elf_Ehdr e; + Elf_Shdr *s; + char *shdr; + unsigned symoff, stroff, symsize, strsize; + grub_addr_t curload; + grub_freebsd_addr_t symstart, symend, symentsize, dynamic; + Elf_Sym *sym; + const char *str; + unsigned i; + + err = read_headers (file, &e, &shdr); + if (err) + return err; + + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_ELFHDR, &e, + sizeof (e)); + if (err) + return err; + + for (s = (Elf_Shdr *) shdr; s < (Elf_Shdr *) (shdr + + e.e_shnum * e.e_shentsize); + s = (Elf_Shdr *) ((char *) s + e.e_shentsize)) + if (s->sh_type == SHT_SYMTAB) + break; + if (s >= (Elf_Shdr *) ((char *) shdr + + e.e_shnum * e.e_shentsize)) + return grub_error (GRUB_ERR_BAD_OS, "no symbol table"); + symoff = s->sh_offset; + symsize = s->sh_size; + symentsize = s->sh_entsize; + s = (Elf_Shdr *) (shdr + e.e_shentsize * s->sh_link); + stroff = s->sh_offset; + strsize = s->sh_size; + + if (*kern_end + 4 * sizeof (grub_freebsd_addr_t) + symsize + strsize + > grub_os_area_addr + grub_os_area_size) + return grub_error (GRUB_ERR_OUT_OF_RANGE, + "Not enough memory for kernel symbols"); + + symstart = curload = ALIGN_UP (*kern_end, sizeof (grub_freebsd_addr_t)); + *((grub_freebsd_addr_t *) UINT_TO_PTR (curload)) = symsize; + curload += sizeof (grub_freebsd_addr_t); + if (grub_file_seek (file, symoff) == (grub_off_t) -1) + return grub_errno; + sym = (Elf_Sym *) UINT_TO_PTR (curload); + if (grub_file_read (file, UINT_TO_PTR (curload), symsize) != + (grub_ssize_t) symsize) + { + if (! grub_errno) + return grub_error (GRUB_ERR_BAD_OS, "invalid elf"); + return grub_errno; + } + curload += symsize; + + *((grub_freebsd_addr_t *) UINT_TO_PTR (curload)) = strsize; + curload += sizeof (grub_freebsd_addr_t); + if (grub_file_seek (file, stroff) == (grub_off_t) -1) + return grub_errno; + str = (char *) UINT_TO_PTR (curload); + if (grub_file_read (file, UINT_TO_PTR (curload), strsize) + != (grub_ssize_t) strsize) + { + if (! grub_errno) + return grub_error (GRUB_ERR_BAD_OS, "invalid elf"); + return grub_errno; + } + curload += strsize; + curload = ALIGN_UP (curload, sizeof (grub_freebsd_addr_t)); + symend = curload; + + for (i = 0; + i * symentsize < symsize; + i++, sym = (Elf_Sym *) ((char *) sym + symentsize)) + { + const char *name = str + sym->st_name; + if (grub_strcmp (name, "_DYNAMIC") == 0) + break; + } + + if (i * symentsize < symsize) + { + dynamic = sym->st_value; + grub_dprintf ("bsd", "dynamic = %llx\n", (unsigned long long) dynamic); + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_DYNAMIC, &dynamic, + sizeof (dynamic)); + if (err) + return err; + } + + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_SSYM, &symstart, + sizeof (symstart)); + if (err) + return err; + + err = grub_freebsd_add_meta (FREEBSD_MODINFO_METADATA | + FREEBSD_MODINFOMD_ESYM, &symend, + sizeof (symend)); + if (err) + return err; + *kern_end = ALIGN_PAGE (curload); + + return GRUB_ERR_NONE; +} diff --git a/loader/i386/pc/multiboot2.c b/loader/i386/pc/multiboot2.c index dadbccd35..3baf4883b 100644 --- a/loader/i386/pc/multiboot2.c +++ b/loader/i386/pc/multiboot2.c @@ -27,10 +27,18 @@ #include grub_err_t -grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr) +grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr, + int *do_load) { Elf32_Addr paddr = phdr->p_paddr; + if (phdr->p_type != PT_LOAD) + { + *do_load = 0; + return 0; + } + *do_load = 1; + if ((paddr < grub_os_area_addr) || (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size)) return grub_error(GRUB_ERR_OUT_OF_RANGE,"Address 0x%x is out of range", @@ -40,10 +48,18 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr) } grub_err_t -grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, UNUSED grub_addr_t *addr) +grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, UNUSED grub_addr_t *addr, + int *do_load) { Elf64_Addr paddr = phdr->p_paddr; + if (phdr->p_type != PT_LOAD) + { + *do_load = 0; + return 0; + } + *do_load = 1; + if ((paddr < grub_os_area_addr) || (paddr + phdr->p_memsz > grub_os_area_addr + grub_os_area_size)) return grub_error (GRUB_ERR_OUT_OF_RANGE, "Address 0x%x is out of range", diff --git a/loader/ieee1275/multiboot2.c b/loader/ieee1275/multiboot2.c index d1444ceff..fda62fc4b 100644 --- a/loader/ieee1275/multiboot2.c +++ b/loader/ieee1275/multiboot2.c @@ -36,10 +36,18 @@ typedef void (*kernel_entry_t) (unsigned long, void *, int (void *), /* Claim the memory occupied by the multiboot kernel. */ grub_err_t -grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr) +grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr, + int *do_load) { int rc; + if (phdr->p_type != PT_LOAD) + { + *do_load = 0; + return 0; + } + *do_load = 1; + rc = grub_claimmap (phdr->p_paddr, phdr->p_memsz); if (rc) return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Couldn't claim %x - %x", @@ -53,10 +61,18 @@ grub_mb2_arch_elf32_hook (Elf32_Phdr *phdr, UNUSED grub_addr_t *addr) /* Claim the memory occupied by the multiboot kernel. */ grub_err_t -grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, UNUSED grub_addr_t *addr) +grub_mb2_arch_elf64_hook (Elf64_Phdr *phdr, UNUSED grub_addr_t *addr, + int *do_load) { int rc; + if (phdr->p_type != PT_LOAD) + { + *do_load = 0; + return 0; + } + *do_load = 1; + rc = grub_claimmap (phdr->p_paddr, phdr->p_memsz); if (rc) return grub_error(GRUB_ERR_OUT_OF_MEMORY, "Couldn't claim 0x%lx - 0x%lx", diff --git a/loader/powerpc/ieee1275/linux.c b/loader/powerpc/ieee1275/linux.c index 04c9b0197..f183c8625 100644 --- a/loader/powerpc/ieee1275/linux.c +++ b/loader/powerpc/ieee1275/linux.c @@ -132,8 +132,15 @@ grub_linux_load32 (grub_elf_t elf) /* Now load the segments into the area we claimed. */ auto grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr); - grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr) + grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load) { + if (phdr->p_type != PT_LOAD) + { + *do_load = 0; + return 0; + } + *do_load = 1; + /* Linux's program headers incorrectly contain virtual addresses. * Translate those to physical, and offset to the area we claimed. */ *addr = (phdr->p_paddr & ~ELF32_LOADMASK) + linux_addr; @@ -175,8 +182,14 @@ grub_linux_load64 (grub_elf_t elf) /* Now load the segments into the area we claimed. */ auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr); - grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr) + grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load) { + if (phdr->p_type != PT_LOAD) + { + *do_load = 0; + return 0; + } + *do_load = 1; /* Linux's program headers incorrectly contain virtual addresses. * Translate those to physical, and offset to the area we claimed. */ *addr = (phdr->p_paddr & ~ELF64_LOADMASK) + linux_addr; diff --git a/loader/sparc64/ieee1275/linux.c b/loader/sparc64/ieee1275/linux.c index 288ee3add..d0623f347 100644 --- a/loader/sparc64/ieee1275/linux.c +++ b/loader/sparc64/ieee1275/linux.c @@ -272,8 +272,15 @@ grub_linux_load64 (grub_elf_t elf) /* Now load the segments into the area we claimed. */ auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr); - grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr) + grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load) { + if (phdr->p_type != PT_LOAD) + { + *do_load = 0; + return 0; + } + *do_load = 1; + /* Adjust the program load address to linux_addr. */ *addr = (phdr->p_paddr - base) + (linux_addr - off); return 0; From 15355c7d2f740c3ebe9ba9127b694d6a3ec2328e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 21 Jun 2009 17:24:30 +0000 Subject: [PATCH 0890/1707] 2009-06-21 Robert Millan Fix asm file handling on ELF, and remove workarounds. * genmk.rb (class Programs): Detect assembly files, and set ASFLAGS and -DASM_FILE=1 appropiately (copied from `class Images' stanza). * kern/i386/ieee1275/startup.S (ASM_FILE): Remove macro. * kern/i386/coreboot/startup.S (ASM_FILE): Likewise. --- ChangeLog | 9 +++++++++ genmk.rb | 4 +++- kern/i386/coreboot/startup.S | 2 -- kern/i386/ieee1275/startup.S | 2 -- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c9bfe50f5..0a580763e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-21 Robert Millan + + Fix asm file handling on ELF, and remove workarounds. + + * genmk.rb (class Programs): Detect assembly files, and set ASFLAGS + and -DASM_FILE=1 appropiately (copied from `class Images' stanza). + * kern/i386/ieee1275/startup.S (ASM_FILE): Remove macro. + * kern/i386/coreboot/startup.S (ASM_FILE): Likewise. + 2009-06-21 Vladimir Serbinenko Load BSD ELF modules diff --git a/genmk.rb b/genmk.rb index 36f40201c..e3866c150 100644 --- a/genmk.rb +++ b/genmk.rb @@ -280,10 +280,12 @@ MOSTLYCLEANFILES += #{deps_str} src = sources[i] fake_obj = File.basename(src).suffix('o') dep = deps[i] + flag = if /\.c$/ =~ src then 'CFLAGS' else 'ASFLAGS' end + extra_flags = if /\.S$/ =~ src then '-DASM_FILE=1' else '' end dir = File.dirname(src) "#{obj}: #{src} $(#{src}_DEPENDENCIES) - $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) $(#{prefix}_CFLAGS) -MD -c -o $@ $< + $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} " diff --git a/kern/i386/coreboot/startup.S b/kern/i386/coreboot/startup.S index b14171e6f..fc53a8542 100644 --- a/kern/i386/coreboot/startup.S +++ b/kern/i386/coreboot/startup.S @@ -16,8 +16,6 @@ * along with GRUB. If not, see . */ -#define ASM_FILE 1 - #include #include #include diff --git a/kern/i386/ieee1275/startup.S b/kern/i386/ieee1275/startup.S index 3b030b1b4..dfbfab594 100644 --- a/kern/i386/ieee1275/startup.S +++ b/kern/i386/ieee1275/startup.S @@ -16,8 +16,6 @@ * along with GRUB. If not, see . */ -#define ASM_FILE 1 - #include #include #include From 58750afcbaafbeba014e94ea99c7378f39b293e4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 21 Jun 2009 20:10:44 +0000 Subject: [PATCH 0891/1707] 2009-06-21 Robert Millan * configure.ac: Enable `END_SYMBOL' / `BSS_START_SYMBOL' test on all i386 platforms. --- ChangeLog | 5 +++++ configure.ac | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0a580763e..6a0a4a257 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-21 Robert Millan + + * configure.ac: Enable `END_SYMBOL' / `BSS_START_SYMBOL' test on + all i386 platforms. + 2009-06-21 Robert Millan Fix asm file handling on ELF, and remove workarounds. diff --git a/configure.ac b/configure.ac index 6a6d8453f..9032ee3f0 100644 --- a/configure.ac +++ b/configure.ac @@ -414,7 +414,7 @@ if test "x$target_cpu" = xi386; then # Check symbols provided by linker script. CFLAGS="$TARGET_CFLAGS -nostdlib $TARGET_IMG_LDFLAGS_AC -Wl,-Ttext,8000,--defsym,___main=0x8100" fi - if test "x$platform" = xpc && test "x$TARGET_APPLE_CC" != x1 ; then + if test "x$TARGET_APPLE_CC" != x1 ; then grub_CHECK_BSS_START_SYMBOL grub_CHECK_END_SYMBOL fi From f52196ff3af803e3a1158e2ad93f73dcaeb8b435 Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 21 Jun 2009 23:53:30 +0000 Subject: [PATCH 0892/1707] 2009-06-21 Pavel Roskin * conf/i386-ieee1275.rmk: Define kernel_elf_ASFLAGS. --- ChangeLog | 4 ++++ conf/i386-ieee1275.rmk | 1 + 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6a0a4a257..bef575951 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-21 Pavel Roskin + + * conf/i386-ieee1275.rmk: Define kernel_elf_ASFLAGS. + 2009-06-21 Robert Millan * configure.ac: Enable `END_SYMBOL' / `BSS_START_SYMBOL' test on diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index d1128de87..10f55594f 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -33,6 +33,7 @@ kernel_elf_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ list.h handler.h command.h kernel_elf_CFLAGS = $(COMMON_CFLAGS) +kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic MOSTLYCLEANFILES += symlist.c kernel_syms.lst From c3cee413316a388b294d8a50fa22ced65c6be01b Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 21 Jun 2009 23:55:23 +0000 Subject: [PATCH 0893/1707] 2009-06-21 Pavel Roskin * loader/powerpc/ieee1275/linux.c (offset_phdr): Fix prototypes to match nested functions. * loader/sparc64/ieee1275/linux.c: Likewise. --- ChangeLog | 4 ++++ loader/powerpc/ieee1275/linux.c | 4 ++-- loader/sparc64/ieee1275/linux.c | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bef575951..2b1e27340 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-06-21 Pavel Roskin + * loader/powerpc/ieee1275/linux.c (offset_phdr): Fix prototypes + to match nested functions. + * loader/sparc64/ieee1275/linux.c: Likewise. + * conf/i386-ieee1275.rmk: Define kernel_elf_ASFLAGS. 2009-06-21 Robert Millan diff --git a/loader/powerpc/ieee1275/linux.c b/loader/powerpc/ieee1275/linux.c index f183c8625..79fbf0b02 100644 --- a/loader/powerpc/ieee1275/linux.c +++ b/loader/powerpc/ieee1275/linux.c @@ -131,7 +131,7 @@ grub_linux_load32 (grub_elf_t elf) return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not claim memory."); /* Now load the segments into the area we claimed. */ - auto grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr); + auto grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load); grub_err_t offset_phdr (Elf32_Phdr *phdr, grub_addr_t *addr, int *do_load) { if (phdr->p_type != PT_LOAD) @@ -181,7 +181,7 @@ grub_linux_load64 (grub_elf_t elf) return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Could not claim memory."); /* Now load the segments into the area we claimed. */ - auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr); + auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load); grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load) { if (phdr->p_type != PT_LOAD) diff --git a/loader/sparc64/ieee1275/linux.c b/loader/sparc64/ieee1275/linux.c index d0623f347..df420d8a0 100644 --- a/loader/sparc64/ieee1275/linux.c +++ b/loader/sparc64/ieee1275/linux.c @@ -271,7 +271,7 @@ grub_linux_load64 (grub_elf_t elf) base = linux_entry - off; /* Now load the segments into the area we claimed. */ - auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr); + auto grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load); grub_err_t offset_phdr (Elf64_Phdr *phdr, grub_addr_t *addr, int *do_load) { if (phdr->p_type != PT_LOAD) From bf3372349ca10704fcf270346b78e5ce76c2bfd5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 10:27:26 +0000 Subject: [PATCH 0894/1707] 2009-06-22 Robert Millan * conf/i386-ieee1275.rmk (pkglib_PROGRAMS): Replace `kernel.elf' with `kernel.img'. (kernel_elf_SOURCES): Rename to ... (kernel_img_SOURCES): ... this. (kernel_elf_HEADERS): Rename to ... (kernel_img_HEADERS): ... this. Update all users. (kernel_elf_ASFLAGS): Rename to ... (kernel_img_ASFLAGS): ... this. (kernel_elf_CFLAGS): Rename to ... (kernel_img_CFLAGS): ... this. (kernel_elf_LDFLAGS): Rename to ... (kernel_img_LDFLAGS): ... this. * conf/i386-coreboot.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * util/elf/grub-mkimage.c (add_segments): Replace "kernel.elf" with "kernel.img". --- ChangeLog | 20 ++++++++++++++++++++ conf/i386-coreboot.rmk | 18 +++++++++--------- conf/i386-ieee1275.rmk | 18 +++++++++--------- conf/powerpc-ieee1275.rmk | 16 ++++++++-------- util/elf/grub-mkimage.c | 2 +- 5 files changed, 47 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2b1e27340..b8d3afaf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2009-06-22 Robert Millan + + * conf/i386-ieee1275.rmk (pkglib_PROGRAMS): Replace `kernel.elf' + with `kernel.img'. + (kernel_elf_SOURCES): Rename to ... + (kernel_img_SOURCES): ... this. + (kernel_elf_HEADERS): Rename to ... + (kernel_img_HEADERS): ... this. Update all users. + (kernel_elf_ASFLAGS): Rename to ... + (kernel_img_ASFLAGS): ... this. + (kernel_elf_CFLAGS): Rename to ... + (kernel_img_CFLAGS): ... this. + (kernel_elf_LDFLAGS): Rename to ... + (kernel_img_LDFLAGS): ... this. + * conf/i386-coreboot.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + + * util/elf/grub-mkimage.c (add_segments): Replace "kernel.elf" + with "kernel.img". + 2009-06-21 Pavel Roskin * loader/powerpc/ieee1275/linux.c (offset_phdr): Fix prototypes diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index c21e75938..39e290e16 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -8,10 +8,10 @@ COMMON_LDFLAGS = -m32 -nostdlib script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -pkglib_PROGRAMS = kernel.elf +pkglib_PROGRAMS = kernel.img -# For kernel.elf. -kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ +# For kernel.img. +kernel_img_SOURCES = kern/i386/coreboot/startup.S \ kern/i386/coreboot/init.c \ kern/i386/multiboot_mmap.c \ kern/main.c kern/device.c \ @@ -26,22 +26,22 @@ kernel_elf_SOURCES = kern/i386/coreboot/startup.S \ kern/env.c \ term/i386/pc/vga_text.c term/i386/vga_common.c \ symlist.c -kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h list.h handler.h command.h -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic +kernel_img_CFLAGS = $(COMMON_CFLAGS) +kernel_img_ASFLAGS = $(COMMON_ASFLAGS) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 10f55594f..f3225abbe 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -8,10 +8,10 @@ COMMON_LDFLAGS = -nostdlib script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -pkglib_PROGRAMS = kernel.elf +pkglib_PROGRAMS = kernel.img -# For kernel.elf. -kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ +# For kernel.img. +kernel_img_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ @@ -27,22 +27,22 @@ kernel_elf_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ term/ieee1275/ofconsole.c \ disk/ieee1275/ofdisk.c \ symlist.c -kernel_elf_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_img_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ list.h handler.h command.h -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic +kernel_img_CFLAGS = $(COMMON_CFLAGS) +kernel_img_ASFLAGS = $(COMMON_ASFLAGS) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x10000,-Bstatic MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Utilities. diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 2f8b35a09..bc672ac25 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -13,20 +13,20 @@ script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst -kernel_elf_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ +kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ command.h -symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h gensymlist.sh +symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) -kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h genkernsyms.sh +kernel_syms.lst: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) # Programs -pkglib_PROGRAMS = kernel.elf +pkglib_PROGRAMS = kernel.img # Utilities. sbin_UTILITIES = grub-mkdevicemap @@ -82,7 +82,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ grub_emu_LDFLAGS = $(LIBCURSES) -kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ +kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/ieee1275.c kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/err.c kern/file.c kern/fs.c \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ @@ -95,9 +95,9 @@ kernel_elf_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ kern/generic/millisleep.c kern/time.c \ symlist.c kern/powerpc/cache.S -kernel_elf_CFLAGS = $(COMMON_CFLAGS) -kernel_elf_ASFLAGS = $(COMMON_ASFLAGS) -kernel_elf_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ +kernel_img_CFLAGS = $(COMMON_CFLAGS) +kernel_img_ASFLAGS = $(COMMON_ASFLAGS) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ -Wl,-N,-S,-Ttext,0x200000,-Bstatic # Scripts. diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index 3ef763fcb..52bb6397d 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -193,7 +193,7 @@ add_segments (char *dir, char *prefix, FILE *out, int chrp, char *mods[], char * int i, phdr_size; /* Read ELF header. */ - kernel_path = grub_util_get_path (dir, "kernel.elf"); + kernel_path = grub_util_get_path (dir, "kernel.img"); in = fopen (kernel_path, "rb"); if (! in) grub_util_error ("cannot open %s", kernel_path); From 41da966565a8020acea77b70dd0a3fef4965d398 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 10:42:37 +0000 Subject: [PATCH 0895/1707] 2009-06-22 Robert Millan * kern/i386/pc/startup.S (real_to_prot): Move from here ... * kern/i386/realmode.S (real_to_prot): ... to here. --- ChangeLog | 5 ++++ kern/i386/pc/startup.S | 59 +----------------------------------------- kern/i386/realmode.S | 56 ++++++++++++++++++++++++++++++++++++--- 3 files changed, 59 insertions(+), 61 deletions(-) diff --git a/ChangeLog b/ChangeLog index b8d3afaf1..ea303ce19 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-22 Robert Millan + + * kern/i386/pc/startup.S (real_to_prot): Move from here ... + * kern/i386/realmode.S (real_to_prot): ... to here. + 2009-06-22 Robert Millan * conf/i386-ieee1275.rmk (pkglib_PROGRAMS): Replace `kernel.elf' diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index f77d7dbe3..cb3fec6ba 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -290,8 +290,6 @@ codestart: */ call EXT_C(grub_main) -#include "../realmode.S" - /* * This is the area for all of the special variables. */ @@ -301,62 +299,7 @@ VARIABLE(grub_boot_drive) .p2align 2 /* force 4-byte alignment */ -/* - * These next two routines, "real_to_prot" and "prot_to_real" are structured - * in a very specific way. Be very careful when changing them. - * - * NOTE: Use of either one messes up %eax and %ebp. - */ - -real_to_prot: - .code16 - cli - - /* load the GDT register */ -#ifdef APPLE_CC - mov %cs, %ax - mov %ax, %ds - DATA32 ADDR32 lgdt gdtdesc -#else - DATA32 ADDR32 lgdt %cs:gdtdesc -#endif - - /* turn on protected mode */ - movl %cr0, %eax - orl $GRUB_MEMORY_MACHINE_CR0_PE_ON, %eax - movl %eax, %cr0 - - /* jump to relocation, flush prefetch queue, and reload %cs */ - DATA32 ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg - - .code32 -protcseg: - /* reload other segment registers */ - movw $GRUB_MEMORY_MACHINE_PROT_MODE_DSEG, %ax - movw %ax, %ds - movw %ax, %es - movw %ax, %fs - movw %ax, %gs - movw %ax, %ss - - /* put the return address in a known safe location */ - movl (%esp), %eax - movl %eax, GRUB_MEMORY_MACHINE_REAL_STACK - - /* get protected mode stack */ - movl protstack, %eax - movl %eax, %esp - movl %eax, %ebp - - /* get return address onto the right stack */ - movl GRUB_MEMORY_MACHINE_REAL_STACK, %eax - movl %eax, (%esp) - - /* zero %eax */ - xorl %eax, %eax - - /* return on the old (or initialized) stack! */ - ret +#include "../realmode.S" /* * grub_gate_a20(int on) diff --git a/kern/i386/realmode.S b/kern/i386/realmode.S index d28c5ca56..075aa57e9 100644 --- a/kern/i386/realmode.S +++ b/kern/i386/realmode.S @@ -110,12 +110,62 @@ gdtdesc: .long gdt /* addr */ /* - * These next routine, "prot_to_real" is structured in a very - * specific way. Be very careful when changing it. + * These next two routines, "real_to_prot" and "prot_to_real" are structured + * in a very specific way. Be very careful when changing them. * - * NOTE: Use of it messes up %eax and %ebp. + * NOTE: Use of either one messes up %eax and %ebp. */ +real_to_prot: + .code16 + cli + + /* load the GDT register */ +#ifdef APPLE_CC + mov %cs, %ax + mov %ax, %ds + DATA32 ADDR32 lgdt gdtdesc +#else + DATA32 ADDR32 lgdt %cs:gdtdesc +#endif + + /* turn on protected mode */ + movl %cr0, %eax + orl $GRUB_MEMORY_MACHINE_CR0_PE_ON, %eax + movl %eax, %cr0 + + /* jump to relocation, flush prefetch queue, and reload %cs */ + DATA32 ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $protcseg + + .code32 +protcseg: + /* reload other segment registers */ + movw $GRUB_MEMORY_MACHINE_PROT_MODE_DSEG, %ax + movw %ax, %ds + movw %ax, %es + movw %ax, %fs + movw %ax, %gs + movw %ax, %ss + + /* put the return address in a known safe location */ + movl (%esp), %eax + movl %eax, GRUB_MEMORY_MACHINE_REAL_STACK + + /* get protected mode stack */ + movl protstack, %eax + movl %eax, %esp + movl %eax, %ebp + + /* get return address onto the right stack */ + movl GRUB_MEMORY_MACHINE_REAL_STACK, %eax + movl %eax, (%esp) + + /* zero %eax */ + xorl %eax, %eax + + /* return on the old (or initialized) stack! */ + ret + prot_to_real: /* just in case, set GDT */ lgdt gdtdesc From 387a140ce624df121057f6d3fe5fcd830a62888d Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 18:04:37 +0000 Subject: [PATCH 0896/1707] 2009-06-22 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/misc.S'. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. * kern/i386/pc/startup.S (grub_stop): Remove function. * kern/i386/ieee1275/startup.S: Likewise. * kern/i386/coreboot/startup.S: Likewise. * kern/i386/misc.S (grub_stop): New function. --- ChangeLog | 11 +++++++++++ conf/i386-coreboot.rmk | 1 + conf/i386-ieee1275.rmk | 4 +++- conf/i386-pc.rmk | 4 +++- kern/i386/coreboot/startup.S | 8 -------- kern/i386/ieee1275/startup.S | 8 -------- kern/i386/misc.S | 29 +++++++++++++++++++++++++++++ kern/i386/pc/startup.S | 8 -------- 8 files changed, 47 insertions(+), 26 deletions(-) create mode 100644 kern/i386/misc.S diff --git a/ChangeLog b/ChangeLog index ea303ce19..3b6f5aedc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-06-22 Robert Millan + + * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/misc.S'. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-coreboot.rmk: Likewise. + + * kern/i386/pc/startup.S (grub_stop): Remove function. + * kern/i386/ieee1275/startup.S: Likewise. + * kern/i386/coreboot/startup.S: Likewise. + * kern/i386/misc.S (grub_stop): New function. + 2009-06-22 Robert Millan * kern/i386/pc/startup.S (real_to_prot): Move from here ... diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 39e290e16..a76f42507 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -12,6 +12,7 @@ pkglib_PROGRAMS = kernel.img # For kernel.img. kernel_img_SOURCES = kern/i386/coreboot/startup.S \ + kern/i386/misc.S \ kern/i386/coreboot/init.c \ kern/i386/multiboot_mmap.c \ kern/main.c kern/device.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index f3225abbe..5024dad50 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -11,7 +11,9 @@ script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h pkglib_PROGRAMS = kernel.img # For kernel.img. -kernel_img_SOURCES = kern/i386/ieee1275/startup.S kern/i386/ieee1275/init.c \ +kernel_img_SOURCES = kern/i386/ieee1275/startup.S \ + kern/i386/misc.S \ + kern/i386/ieee1275/init.c \ kern/ieee1275/init.c \ kern/ieee1275/mmap.c \ kern/ieee1275/cmain.c kern/ieee1275/openfw.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index ae4feafbf..50a70bf24 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -46,7 +46,9 @@ cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 cdboot_img_FORMAT = binary # For kernel.img. -kernel_img_SOURCES = kern/i386/pc/startup.S kern/main.c kern/device.c \ +kernel_img_SOURCES = kern/i386/pc/startup.S \ + kern/i386/misc.S \ + kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ kern/rescue_parser.c kern/rescue_reader.c \ diff --git a/kern/i386/coreboot/startup.S b/kern/i386/coreboot/startup.S index fc53a8542..3f2dd5f50 100644 --- a/kern/i386/coreboot/startup.S +++ b/kern/i386/coreboot/startup.S @@ -77,14 +77,6 @@ codestart: /* jump to the main body of C code */ jmp EXT_C(grub_main) -/* - * This call is special... it never returns... in fact it should simply - * hang at this point! - */ -FUNCTION(grub_stop) - hlt - jmp EXT_C(grub_stop) - /* * prot_to_real and associated structures (but NOT real_to_prot, that is * only needed for BIOS gates). diff --git a/kern/i386/ieee1275/startup.S b/kern/i386/ieee1275/startup.S index dfbfab594..35258adb6 100644 --- a/kern/i386/ieee1275/startup.S +++ b/kern/i386/ieee1275/startup.S @@ -58,14 +58,6 @@ codestart: movl %eax, EXT_C(grub_ieee1275_entry_fn) jmp EXT_C(grub_main) -/* - * This call is special... it never returns... in fact it should simply - * hang at this point! - */ -FUNCTION(grub_stop) - hlt - jmp EXT_C(grub_stop) - /* * prot_to_real and associated structures (but NOT real_to_prot, that is * only needed for BIOS gates). diff --git a/kern/i386/misc.S b/kern/i386/misc.S new file mode 100644 index 000000000..7d57df9b9 --- /dev/null +++ b/kern/i386/misc.S @@ -0,0 +1,29 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include + + .text +/* + * This call is special... it never returns... in fact it should simply + * hang at this point! + */ +FUNCTION(grub_stop) + cli +1: hlt + jmp 1b diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index cb3fec6ba..171fbeabe 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -463,14 +463,6 @@ gate_a20_check_state: */ . = _start + GRUB_KERNEL_MACHINE_RAW_SIZE -/* - * This call is special... it never returns... in fact it should simply - * hang at this point! - */ - -FUNCTION(grub_stop) - call prot_to_real - /* * This next part is sort of evil. It takes advantage of the * byte ordering on the x86 to work in either 16-bit or 32-bit From 132a0a595f758e0c56500fe311465b73bec3b0ee Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 19:23:22 +0000 Subject: [PATCH 0897/1707] 2009-06-22 Robert Millan * conf/i386-pc.rmk (GRUB_MEMORY_MACHINE_LINK_ADDR): Rename to ... (GRUB_KERNEL_MACHINE_LINK_ADDR): ... this. Update all users. --- ChangeLog | 5 +++++ conf/i386-pc.rmk | 6 +++--- util/i386/pc/grub-mkimage.c | 4 ++-- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b6f5aedc..00f7e65a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-22 Robert Millan + + * conf/i386-pc.rmk (GRUB_MEMORY_MACHINE_LINK_ADDR): Rename to ... + (GRUB_KERNEL_MACHINE_LINK_ADDR): ... this. Update all users. + 2009-06-22 Robert Millan * conf/i386-pc.rmk (kernel_img_SOURCES): Add `kern/i386/misc.S'. diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 50a70bf24..714e8172d 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -1,6 +1,6 @@ # -*- makefile -*- -GRUB_MEMORY_MACHINE_LINK_ADDR = 0x8200 +GRUB_KERNEL_MACHINE_LINK_ADDR = 0x8200 COMMON_ASFLAGS = -nostdinc -fno-builtin -m32 COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 @@ -69,7 +69,7 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) $(TARGET_IMG_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_MEMORY_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR) $(COMMON_CFLAGS) kernel_img_FORMAT = binary MOSTLYCLEANFILES += symlist.c kernel_syms.lst @@ -97,7 +97,7 @@ else grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c lib/LzmaEnc.c lib/LzFind.c endif -grub_mkimage_CFLAGS = -DGRUB_MEMORY_MACHINE_LINK_ADDR=$(GRUB_MEMORY_MACHINE_LINK_ADDR) +grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR) util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile # For grub-setup. diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index 86bfd653f..f9c74cd16 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -270,9 +270,9 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], = grub_cpu_to_le32 (-2); } - if (GRUB_MEMORY_MACHINE_LINK_ADDR + core_size > GRUB_MEMORY_MACHINE_UPPER) + if (GRUB_KERNEL_MACHINE_LINK_ADDR + core_size > GRUB_MEMORY_MACHINE_UPPER) grub_util_error ("Core image is too big (%p > %p)\n", - GRUB_MEMORY_MACHINE_LINK_ADDR + core_size, GRUB_MEMORY_MACHINE_UPPER); + GRUB_KERNEL_MACHINE_LINK_ADDR + core_size, GRUB_MEMORY_MACHINE_UPPER); grub_util_write_image (core_img, core_size, out); free (kernel_img); From c952cf92a183be5a4e49fd5d9a2687f2bfde0a85 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 19:44:38 +0000 Subject: [PATCH 0898/1707] 2009-06-22 Robert Millan * commands/search.c (grub_cmd_search): Macroify hardcoded args[] indexes. Check for -f explicitly. --- ChangeLog | 5 +++++ commands/search.c | 25 ++++++++++++++++++------- 2 files changed, 23 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 00f7e65a0..f78766a5e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-22 Robert Millan + + * commands/search.c (grub_cmd_search): Macroify hardcoded args[] + indexes. Check for -f explicitly. + 2009-06-22 Robert Millan * conf/i386-pc.rmk (GRUB_MEMORY_MACHINE_LINK_ADDR): Rename to ... diff --git a/commands/search.c b/commands/search.c index cfcc6b959..5b1c0b03b 100644 --- a/commands/search.c +++ b/commands/search.c @@ -37,6 +37,15 @@ static const struct grub_arg_option options[] = {0, 0, 0, 0, 0, 0} }; +enum options + { + SEARCH_FILE, + SEARCH_LABEL, + SEARCH_FS_UUID, + SEARCH_SET, + SEARCH_NO_FLOPPY, + }; + static void search_fs (const char *key, const char *var, int no_floppy, int is_uuid) { @@ -165,15 +174,17 @@ grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) if (argc == 0) return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified"); - if (state[3].set) - var = state[3].arg ? state[3].arg : "root"; + if (state[SEARCH_SET].set) + var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root"; - if (state[1].set) - search_fs (args[0], var, state[4].set, 0); - else if (state[2].set) - search_fs (args[0], var, state[4].set, 1); + if (state[SEARCH_LABEL].set) + search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, 0); + else if (state[SEARCH_FS_UUID].set) + search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, 1); + else if (state[SEARCH_FILE].set) + search_file (args[0], var, state[SEARCH_NO_FLOPPY].set); else - search_file (args[0], var, state[4].set); + return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type"); return grub_errno; } From cc3752ad7374594dda88655a0cf57f9299c452d2 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 20:19:13 +0000 Subject: [PATCH 0899/1707] (search_file): Improve error message. (GRUB_MOD_INIT(search)): Add missing `-n' to help output. --- ChangeLog | 2 ++ commands/search.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f78766a5e..ccebcf1e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,8 @@ * commands/search.c (grub_cmd_search): Macroify hardcoded args[] indexes. Check for -f explicitly. + (search_file): Improve error message. + (GRUB_MOD_INIT(search)): Add missing `-n' to help output. 2009-06-22 Robert Millan diff --git a/commands/search.c b/commands/search.c index 5b1c0b03b..647f40839 100644 --- a/commands/search.c +++ b/commands/search.c @@ -162,7 +162,7 @@ search_file (const char *key, const char *var, int no_floppy) grub_free (buf); if (grub_errno == GRUB_ERR_NONE && count == 0) - grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device"); + grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such file: %s", key); } static grub_err_t @@ -196,7 +196,7 @@ GRUB_MOD_INIT(search) cmd = grub_register_extcmd ("search", grub_cmd_search, GRUB_COMMAND_FLAG_BOTH, - "search [-f|-l|-u|-s] NAME", + "search [-f|-l|-u|-s|-n] NAME", "Search devices by file, filesystem label or filesystem UUID." " If --set is specified, the first device found is" " set to a variable. If no variable name is" From a42ce6e9620065ca718477bbe006dcc73bc94bbc Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 20:40:28 +0000 Subject: [PATCH 0900/1707] 2009-06-22 Robert Millan * include/grub/i386/kernel.h: Include `'. [! GRUB_MACHINE_IEEE1275]: Set `GRUB_MOD_ALIGN' to 0x1. --- ChangeLog | 5 +++++ include/grub/i386/kernel.h | 10 ++++++++-- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ccebcf1e0..375663f2c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-22 Robert Millan + + * include/grub/i386/kernel.h: Include `'. + [! GRUB_MACHINE_IEEE1275]: Set `GRUB_MOD_ALIGN' to 0x1. + 2009-06-22 Robert Millan * commands/search.c (grub_cmd_search): Macroify hardcoded args[] diff --git a/include/grub/i386/kernel.h b/include/grub/i386/kernel.h index 0dfab05b2..74715e178 100644 --- a/include/grub/i386/kernel.h +++ b/include/grub/i386/kernel.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -19,7 +19,13 @@ #ifndef GRUB_KERNEL_CPU_HEADER #define GRUB_KERNEL_CPU_HEADER 1 -#define GRUB_MOD_ALIGN 0x1000 +#include + +#ifdef GRUB_MACHINE_IEEE1275 +#define GRUB_MOD_ALIGN 0x1000 +#else +#define GRUB_MOD_ALIGN 0x1 +#endif /* Non-zero value is only needed for PowerMacs. */ #define GRUB_MOD_GAP 0x0 From 9bbdfd4d3bd059c6f5e9edb8b9a88728d0120d06 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 22 Jun 2009 22:48:20 +0000 Subject: [PATCH 0901/1707] 2009-06-23 Robert Millan * kern/i386/pc/startup.S (real_to_prot): Access `gdtdesc' using segment 0x0 unconditionally, because the reference generated by GAS is an absolute address. --- ChangeLog | 6 ++++++ kern/i386/realmode.S | 10 +++------- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 375663f2c..bdb177d75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-23 Robert Millan + + * kern/i386/pc/startup.S (real_to_prot): Access `gdtdesc' using + segment 0x0 unconditionally, because the reference generated by + GAS is an absolute address. + 2009-06-22 Robert Millan * include/grub/i386/kernel.h: Include `'. diff --git a/kern/i386/realmode.S b/kern/i386/realmode.S index 075aa57e9..11f4d5347 100644 --- a/kern/i386/realmode.S +++ b/kern/i386/realmode.S @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -121,13 +121,9 @@ real_to_prot: cli /* load the GDT register */ -#ifdef APPLE_CC - mov %cs, %ax - mov %ax, %ds + xorw %ax, %ax + movw %ax, %ds DATA32 ADDR32 lgdt gdtdesc -#else - DATA32 ADDR32 lgdt %cs:gdtdesc -#endif /* turn on protected mode */ movl %cr0, %eax From c402ab1734dcc6fbb9252a7c6ce818ba5cf80142 Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 27 Jun 2009 03:01:42 +0000 Subject: [PATCH 0902/1707] 2009-06-26 Pavel Roskin * include/grub/types.h: Define GRUB_TARGET_WORDSIZE. * include/grub/elf.h: Define symbols without "32" or "64" based on GRUB_TARGET_WORDSIZE. * include/grub/multiboot2.h: Use GRUB_TARGET_WORDSIZE. * efiemu/loadcore32.c: Redefine GRUB_TARGET_WORDSIZE, remove own ELF definitions. * efiemu/loadcore64.c: Likewise. * loader/i386/bsd32.c: Likewise. * loader/i386/bsd64.c: Likewise. * kern/dl.c: Remove own ELF definitions. * util/i386/efi/grub-mkimage.c: Likewise. --- ChangeLog | 14 ++++++++++++ efiemu/loadcore32.c | 7 +----- efiemu/loadcore64.c | 7 +----- include/grub/elf.h | 40 ++++++++++++++++++++++++++++++++++ include/grub/multiboot2.h | 2 +- include/grub/types.h | 8 +++++++ kern/dl.c | 24 --------------------- loader/i386/bsd32.c | 4 +--- loader/i386/bsd64.c | 4 +--- util/i386/efi/grub-mkimage.c | 42 ++++-------------------------------- 10 files changed, 71 insertions(+), 81 deletions(-) diff --git a/ChangeLog b/ChangeLog index bdb177d75..6596c16d2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-06-26 Pavel Roskin + + * include/grub/types.h: Define GRUB_TARGET_WORDSIZE. + * include/grub/elf.h: Define symbols without "32" or "64" based + on GRUB_TARGET_WORDSIZE. + * include/grub/multiboot2.h: Use GRUB_TARGET_WORDSIZE. + * efiemu/loadcore32.c: Redefine GRUB_TARGET_WORDSIZE, remove own + ELF definitions. + * efiemu/loadcore64.c: Likewise. + * loader/i386/bsd32.c: Likewise. + * loader/i386/bsd64.c: Likewise. + * kern/dl.c: Remove own ELF definitions. + * util/i386/efi/grub-mkimage.c: Likewise. + 2009-06-23 Robert Millan * kern/i386/pc/startup.S (real_to_prot): Access `gdtdesc' using diff --git a/efiemu/loadcore32.c b/efiemu/loadcore32.c index b4f61c794..c1e033b78 100644 --- a/efiemu/loadcore32.c +++ b/efiemu/loadcore32.c @@ -18,10 +18,5 @@ */ #define SUFFIX(x) x ## 32 -#define Elf_Ehdr Elf32_Ehdr -#define Elf_Shdr Elf32_Shdr -#define Elf_Sym Elf32_Sym -#define Elf_Word Elf32_Word -#define ELF_ST_TYPE ELF32_ST_TYPE -#define ELF_ST_BIND ELF32_ST_BIND +#define GRUB_TARGET_WORDSIZE 32 #include "loadcore.c" diff --git a/efiemu/loadcore64.c b/efiemu/loadcore64.c index 097276cc8..ce7284fea 100644 --- a/efiemu/loadcore64.c +++ b/efiemu/loadcore64.c @@ -18,10 +18,5 @@ */ #define SUFFIX(x) x ## 64 -#define Elf_Ehdr Elf64_Ehdr -#define Elf_Shdr Elf64_Shdr -#define Elf_Sym Elf64_Sym -#define Elf_Word Elf64_Word -#define ELF_ST_TYPE ELF64_ST_TYPE -#define ELF_ST_BIND ELF64_ST_BIND +#define GRUB_TARGET_WORDSIZE 64 #include "loadcore.c" diff --git a/include/grub/elf.h b/include/grub/elf.h index 319bc7ce6..49570a60e 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -2330,4 +2330,44 @@ typedef Elf32_Addr Elf32_Conflict; #define R_X86_64_NUM 24 +#if GRUB_TARGET_WORDSIZE == 32 + +typedef Elf32_Addr Elf_Addr; +typedef Elf32_Ehdr Elf_Ehdr; +typedef Elf32_Half Elf_Half; +typedef Elf32_Off Elf_Off; +typedef Elf32_Rel Elf_Rel; +typedef Elf32_Rela Elf_Rela; +typedef Elf32_Section Elf_Section; +typedef Elf32_Shdr Elf_Shdr; +typedef Elf32_Sym Elf_Sym; +typedef Elf32_Word Elf_Word; + +#define ELF_ST_BIND(val) ELF32_ST_BIND(val) +#define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) +#define ELF_R_SYM(val) ELF32_R_SYM(val) +#define ELF_R_TYPE(val) ELF32_R_TYPE(val) +#define ELF_R_INFO(sym, type) ELF32_R_INFO(sym, type) + +#elif GRUB_TARGET_WORDSIZE == 64 + +typedef Elf64_Addr Elf_Addr; +typedef Elf64_Ehdr Elf_Ehdr; +typedef Elf64_Half Elf_Half; +typedef Elf64_Off Elf_Off; +typedef Elf64_Rel Elf_Rel; +typedef Elf64_Rela Elf_Rela; +typedef Elf64_Section Elf_Section; +typedef Elf64_Shdr Elf_Shdr; +typedef Elf64_Sym Elf_Sym; +typedef Elf64_Word Elf_Word; + +#define ELF_ST_BIND(val) ELF64_ST_BIND (val) +#define ELF_ST_TYPE(val) ELF64_ST_TYPE (val) +#define ELF_R_SYM(val) ELF64_R_SYM(val) +#define ELF_R_TYPE(val) ELF64_R_TYPE(val) +#define ELF_R_INFO(sym, type) ELF64_R_INFO(sym, type) + +#endif /* GRUB_TARGET_WORDSIZE == 64 */ + #endif /* ! GRUB_ELF_H */ diff --git a/include/grub/multiboot2.h b/include/grub/multiboot2.h index 1d2324a53..2c9780996 100644 --- a/include/grub/multiboot2.h +++ b/include/grub/multiboot2.h @@ -27,7 +27,7 @@ #ifndef GRUB_UTIL typedef grub_uint32_t uint32_t; typedef grub_uint64_t uint64_t; -#define __WORDSIZE (8 * GRUB_TARGET_SIZEOF_VOID_P) +#define __WORDSIZE GRUB_TARGET_WORDSIZE #endif struct multiboot_tag_header; diff --git a/include/grub/types.h b/include/grub/types.h index 114b4564a..3eb8290af 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -50,6 +50,14 @@ # error "This architecture is not supported because sizeof(void *) != 4 and sizeof(void *) != 8" #endif +#ifndef GRUB_TARGET_WORDSIZE +# if GRUB_TARGET_SIZEOF_VOID_P == 4 +# define GRUB_TARGET_WORDSIZE 32 +# elif GRUB_TARGET_SIZEOF_VOID_P == 8 +# define GRUB_TARGET_WORDSIZE 64 +# endif +#endif + /* Define various wide integers. */ typedef signed char grub_int8_t; typedef short grub_int16_t; diff --git a/kern/dl.c b/kern/dl.c index d729c0874..cd34e3178 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -29,30 +29,6 @@ #include #include -#if GRUB_CPU_SIZEOF_VOID_P == 4 - -typedef Elf32_Word Elf_Word; -typedef Elf32_Addr Elf_Addr; -typedef Elf32_Ehdr Elf_Ehdr; -typedef Elf32_Shdr Elf_Shdr; -typedef Elf32_Sym Elf_Sym; - -# define ELF_ST_BIND(val) ELF32_ST_BIND (val) -# define ELF_ST_TYPE(val) ELF32_ST_TYPE (val) - -#elif GRUB_CPU_SIZEOF_VOID_P == 8 - -typedef Elf64_Word Elf_Word; -typedef Elf64_Addr Elf_Addr; -typedef Elf64_Ehdr Elf_Ehdr; -typedef Elf64_Shdr Elf_Shdr; -typedef Elf64_Sym Elf_Sym; - -# define ELF_ST_BIND(val) ELF64_ST_BIND (val) -# define ELF_ST_TYPE(val) ELF64_ST_TYPE (val) - -#endif - struct grub_dl_list diff --git a/loader/i386/bsd32.c b/loader/i386/bsd32.c index 24dab6cf4..26704c486 100644 --- a/loader/i386/bsd32.c +++ b/loader/i386/bsd32.c @@ -1,7 +1,5 @@ #define SUFFIX(x) x ## 32 -#define Elf_Ehdr Elf32_Ehdr -#define Elf_Shdr Elf32_Shdr -#define Elf_Sym Elf32_Sym +#define GRUB_TARGET_WORDSIZE 32 #define OBJSYM 0 #include typedef grub_uint32_t grub_freebsd_addr_t; diff --git a/loader/i386/bsd64.c b/loader/i386/bsd64.c index f4ff8b233..f8aad1ca7 100644 --- a/loader/i386/bsd64.c +++ b/loader/i386/bsd64.c @@ -1,7 +1,5 @@ #define SUFFIX(x) x ## 64 -#define Elf_Ehdr Elf64_Ehdr -#define Elf_Shdr Elf64_Shdr -#define Elf_Sym Elf64_Sym +#define GRUB_TARGET_WORDSIZE 64 #define OBJSYM 1 #include typedef grub_uint64_t grub_freebsd_addr_t; diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index 2813e799d..466aa9f87 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -31,44 +31,10 @@ #include #include -#if GRUB_TARGET_SIZEOF_VOID_P == 4 - -typedef Elf32_Word Elf_Word; -typedef Elf32_Addr Elf_Addr; -typedef Elf32_Ehdr Elf_Ehdr; -typedef Elf32_Shdr Elf_Shdr; -typedef Elf32_Sym Elf_Sym; -typedef Elf32_Half Elf_Half; -typedef Elf32_Off Elf_Off; -typedef Elf32_Section Elf_Section; -typedef Elf32_Rel Elf_Rel; -typedef Elf32_Rela Elf_Rela; - -#define ELF_R_SYM ELF32_R_SYM -#define ELF_R_TYPE ELF32_R_TYPE -#define ELF_R_INFO ELF32_R_INFO - -#define grub_le_to_cpu grub_le_to_cpu32 - -#elif GRUB_TARGET_SIZEOF_VOID_P == 8 - -typedef Elf64_Word Elf_Word; -typedef Elf64_Addr Elf_Addr; -typedef Elf64_Ehdr Elf_Ehdr; -typedef Elf64_Shdr Elf_Shdr; -typedef Elf64_Sym Elf_Sym; -typedef Elf64_Half Elf_Half; -typedef Elf64_Off Elf_Off; -typedef Elf64_Section Elf_Section; -typedef Elf64_Rel Elf_Rel; -typedef Elf64_Rela Elf_Rela; - -#define ELF_R_SYM ELF64_R_SYM -#define ELF_R_TYPE ELF64_R_TYPE -#define ELF_R_INFO ELF64_R_INFO - -#define grub_le_to_cpu grub_le_to_cpu64 - +#if GRUB_TARGET_WORDSIZE == 32 +# define grub_le_to_cpu(val) grub_le_to_cpu32(val) +#elif GRUB_TARGET_WORDSIZE == 64 +# define grub_le_to_cpu(val) grub_le_to_cpu64(val) #endif static const grub_uint8_t stub[] = GRUB_PE32_MSDOS_STUB; From 97fe384ecb6cff06de5cd25e86a10ae886b2b76f Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 27 Jun 2009 06:10:33 +0000 Subject: [PATCH 0903/1707] 2009-06-27 Pavel Roskin * efiemu/prepare.c: Eliminate TYPE macro, it makes code hard to read. * efiemu/prepare32.c: Likewise. * efiemu/prepare64.c: Likewise. --- ChangeLog | 7 +++++++ efiemu/prepare.c | 10 +++++----- efiemu/prepare32.c | 1 - efiemu/prepare64.c | 1 - 4 files changed, 12 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6596c16d2..0cab9cd94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-27 Pavel Roskin + + * efiemu/prepare.c: Eliminate TYPE macro, it makes code hard to + read. + * efiemu/prepare32.c: Likewise. + * efiemu/prepare64.c: Likewise. + 2009-06-26 Pavel Roskin * include/grub/types.h: Define GRUB_TARGET_WORDSIZE. diff --git a/efiemu/prepare.c b/efiemu/prepare.c index 048893317..e1dc4180d 100644 --- a/efiemu/prepare.c +++ b/efiemu/prepare.c @@ -35,8 +35,8 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, struct grub_efiemu_prepare_hook *curhook; int cntconftables = 0; - TYPE (grub_efiemu_configuration_table) *conftables = 0; - TYPE (grub_efiemu_runtime_services) *runtime_services; + struct SUFFIX (grub_efiemu_configuration_table) *conftables = 0; + struct SUFFIX (grub_efiemu_runtime_services) *runtime_services; int i; int handle; grub_off_t off; @@ -77,14 +77,14 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, } SUFFIX (grub_efiemu_system_table) - = (TYPE (grub_efi_system_table) *) + = (struct SUFFIX (grub_efi_system_table) *) ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); /* compute CRC32 of runtime_services */ if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", &handle, &off))) return err; - runtime_services = (TYPE (grub_efiemu_runtime_services) *) + runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *) ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); runtime_services->hdr.crc32 = 0; runtime_services->hdr.crc32 = grub_getcrc32 @@ -98,7 +98,7 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, SUFFIX(grub_efiemu_system_table)->num_table_entries = cntconftables; /* Fill the list of configuration tables */ - conftables = (TYPE (grub_efiemu_configuration_table) *) + conftables = (struct SUFFIX (grub_efiemu_configuration_table) *) grub_efiemu_mm_obtain_request (conftable_handle); i = 0; for (cur = config_tables; cur; cur = cur->next, i++) diff --git a/efiemu/prepare32.c b/efiemu/prepare32.c index 48c177f98..fd6109ea3 100644 --- a/efiemu/prepare32.c +++ b/efiemu/prepare32.c @@ -18,6 +18,5 @@ */ #define SUFFIX(x) x ## 32 -#define TYPE(x) x ## 32_t #include "prepare.c" diff --git a/efiemu/prepare64.c b/efiemu/prepare64.c index f1399bdfb..811f55896 100644 --- a/efiemu/prepare64.c +++ b/efiemu/prepare64.c @@ -18,6 +18,5 @@ */ #define SUFFIX(x) x ## 64 -#define TYPE(x) x ## 64_t #include "prepare.c" From 8231fb77c63188c47b00107ab576a41c1ef81f9e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 27 Jun 2009 11:18:10 +0000 Subject: [PATCH 0904/1707] 2009-06-27 Pavel Roskin 2009-06-27 Robert Millan * include/grub/dl.h: Include grub/elf.h. (struct grub_dl): Add symtab field. * kern/dl.c [GRUB_MACHINE_QEMU]: Define GRUB_MODULES_MACHINE_READONLY. (grub_dl_resolve_symbols): Populate mod->symtab, making a copy of the header for read-only modules. (grub_dl_unload): Free mod->symtab for read-only modules. * kern/i386/dl.c: Use mod->symtab. * kern/powerpc/dl.c: Likewise. * kern/sparc64/dl.c: Likewise. * kern/x86_64/dl.c: Likewise. * conf/i386-qemu.rmk: New file. * kern/i386/qemu/startup.S: Likewise. * kern/i386/qemu/mmap.c: Likewise. * boot/i386/qemu/boot.S: Likewise. * include/grub/i386/qemu/time.h: Likewise. * include/grub/i386/qemu/serial.h: Likewise. * include/grub/i386/qemu/kernel.h: Likewise. * include/grub/i386/qemu/console.h: Likewise. * include/grub/i386/qemu/boot.h: Likewise. * include/grub/i386/qemu/init.h: Likewise. * include/grub/i386/qemu/machine.h: Likewise. * include/grub/i386/qemu/loader.h: Likewise. * include/grub/i386/qemu/memory.h: Likewise. * conf/i386-coreboot.rmk (GRUB_BOOT_MACHINE_LINK_ADDR) (GRUB_KERNEL_MACHINE_LINK_ADDR): New variables. [qemu] (pkglib_IMAGES): Add `boot.img'. [qemu] (boot_img_SOURCES, boot_img_ASFLAGS, boot_img_LDFLAGS) [qemu] (boot_img_FORMAT): New variables. [qemu] (bin_UTILITIES): Add `grub-mkimage'. [qemu] (grub_mkimage_SOURCES, grub_mkimage_CFLAGS): New variables. [qemu] (kernel_img_SOURCES, kernel_img_HEADERS, kernel_img_CFLAGS) [qemu] (kernel_img_ASFLAGS, kernel_img_LDFLAGS) [qemu] (kernel_img_FORMAT): New variables. * configure.ac: Recognise `i386-qemu'. * util/i386/pc/grub-mkimage.c (compress_kernel): Add dummy variant (for no compression). [GRUB_MACHINE_QEMU] (generate_image): Misc adjustments to produce a valid i386 ROM image. Make `GRUB_KERNEL_MACHINE_COMPRESSED_SIZE', `GRUB_KERNEL_MACHINE_INSTALL_DOS_PART' and `GRUB_KERNEL_MACHINE_INSTALL_BSD_PART' optional features (with ifdefs). --- ChangeLog | 50 ++++++++++++++++ boot/i386/qemu/boot.S | 67 ++++++++++++++++++++++ conf/i386-coreboot.rmk | 54 +++++++++++++++++- conf/i386-qemu.rmk | 2 + configure.ac | 1 + include/grub/dl.h | 4 +- include/grub/i386/qemu/boot.h | 28 +++++++++ include/grub/i386/qemu/console.h | 1 + include/grub/i386/qemu/init.h | 1 + include/grub/i386/qemu/kernel.h | 53 +++++++++++++++++ include/grub/i386/qemu/loader.h | 1 + include/grub/i386/qemu/machine.h | 24 ++++++++ include/grub/i386/qemu/memory.h | 45 +++++++++++++++ include/grub/i386/qemu/serial.h | 1 + include/grub/i386/qemu/time.h | 1 + kern/dl.c | 19 ++++++- kern/i386/coreboot/init.c | 7 ++- kern/i386/dl.c | 4 +- kern/i386/qemu/mmap.c | 74 ++++++++++++++++++++++++ kern/i386/qemu/startup.S | 97 ++++++++++++++++++++++++++++++++ kern/powerpc/dl.c | 4 +- kern/sparc64/dl.c | 4 +- kern/x86_64/dl.c | 4 +- util/i386/pc/grub-mkimage.c | 57 +++++++++++++++++++ 24 files changed, 584 insertions(+), 19 deletions(-) create mode 100644 boot/i386/qemu/boot.S create mode 100644 conf/i386-qemu.rmk create mode 100644 include/grub/i386/qemu/boot.h create mode 100644 include/grub/i386/qemu/console.h create mode 100644 include/grub/i386/qemu/init.h create mode 100644 include/grub/i386/qemu/kernel.h create mode 100644 include/grub/i386/qemu/loader.h create mode 100644 include/grub/i386/qemu/machine.h create mode 100644 include/grub/i386/qemu/memory.h create mode 100644 include/grub/i386/qemu/serial.h create mode 100644 include/grub/i386/qemu/time.h create mode 100644 kern/i386/qemu/mmap.c create mode 100644 kern/i386/qemu/startup.S diff --git a/ChangeLog b/ChangeLog index 0cab9cd94..5bd20acd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,53 @@ +2009-06-27 Pavel Roskin +2009-06-27 Robert Millan + + * include/grub/dl.h: Include grub/elf.h. + (struct grub_dl): Add symtab field. + * kern/dl.c [GRUB_MACHINE_QEMU]: Define + GRUB_MODULES_MACHINE_READONLY. + (grub_dl_resolve_symbols): Populate mod->symtab, making a copy + of the header for read-only modules. + (grub_dl_unload): Free mod->symtab for read-only modules. + * kern/i386/dl.c: Use mod->symtab. + * kern/powerpc/dl.c: Likewise. + * kern/sparc64/dl.c: Likewise. + * kern/x86_64/dl.c: Likewise. + + * conf/i386-qemu.rmk: New file. + * kern/i386/qemu/startup.S: Likewise. + * kern/i386/qemu/mmap.c: Likewise. + * boot/i386/qemu/boot.S: Likewise. + * include/grub/i386/qemu/time.h: Likewise. + * include/grub/i386/qemu/serial.h: Likewise. + * include/grub/i386/qemu/kernel.h: Likewise. + * include/grub/i386/qemu/console.h: Likewise. + * include/grub/i386/qemu/boot.h: Likewise. + * include/grub/i386/qemu/init.h: Likewise. + * include/grub/i386/qemu/machine.h: Likewise. + * include/grub/i386/qemu/loader.h: Likewise. + * include/grub/i386/qemu/memory.h: Likewise. + + * conf/i386-coreboot.rmk (GRUB_BOOT_MACHINE_LINK_ADDR) + (GRUB_KERNEL_MACHINE_LINK_ADDR): New variables. + [qemu] (pkglib_IMAGES): Add `boot.img'. + [qemu] (boot_img_SOURCES, boot_img_ASFLAGS, boot_img_LDFLAGS) + [qemu] (boot_img_FORMAT): New variables. + [qemu] (bin_UTILITIES): Add `grub-mkimage'. + [qemu] (grub_mkimage_SOURCES, grub_mkimage_CFLAGS): New variables. + [qemu] (kernel_img_SOURCES, kernel_img_HEADERS, kernel_img_CFLAGS) + [qemu] (kernel_img_ASFLAGS, kernel_img_LDFLAGS) + [qemu] (kernel_img_FORMAT): New variables. + + * configure.ac: Recognise `i386-qemu'. + + * util/i386/pc/grub-mkimage.c (compress_kernel): Add dummy variant + (for no compression). + [GRUB_MACHINE_QEMU] (generate_image): Misc adjustments to produce + a valid i386 ROM image. Make `GRUB_KERNEL_MACHINE_COMPRESSED_SIZE', + `GRUB_KERNEL_MACHINE_INSTALL_DOS_PART' and + `GRUB_KERNEL_MACHINE_INSTALL_BSD_PART' optional features (with + ifdefs). + 2009-06-27 Pavel Roskin * efiemu/prepare.c: Eliminate TYPE macro, it makes code hard to diff --git a/boot/i386/qemu/boot.S b/boot/i386/qemu/boot.S new file mode 100644 index 000000000..a93fe3943 --- /dev/null +++ b/boot/i386/qemu/boot.S @@ -0,0 +1,67 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include + + .text + .code16 + .globl _start +_start: + /* Disable interrupts. */ + cli + + jmp 1f + + . = _start + GRUB_BOOT_MACHINE_CORE_ENTRY_ADDR +VARIABLE(grub_core_entry_addr) + .long 0 +1: + + /* Process VGA rom. */ + call $0xc000, $0x3 + + /* Set up %ds, %ss, and %es. */ + xorw %ax, %ax + movw %ax, %ds + movw %ax, %ss + movw %ax, %es + + /* Set up the real mode stack. */ + movl $GRUB_MEMORY_MACHINE_REAL_STACK, %esp + + /* Transition to protected mode. We use pushl to force generation + of a flat return address. */ + pushl $1f + DATA32 jmp real_to_prot + .code32 +1: + movl grub_core_entry_addr, %edx + jmp *%edx + +#include "../../../kern/i386/realmode.S" + + /* Intel, in its infinite wisdom, decided to put the i8086 entry point + *right here* and this is why we need this kludge. */ + + . = GRUB_BOOT_MACHINE_SIZE - 16 + jmp _start + . = GRUB_BOOT_MACHINE_SIZE diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index a76f42507..119e116da 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -8,9 +8,12 @@ COMMON_LDFLAGS = -m32 -nostdlib script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -pkglib_PROGRAMS = kernel.img -# For kernel.img. +GRUB_KERNEL_MACHINE_LINK_ADDR = 0x8200 + +ifeq ($(platform), coreboot) + +pkglib_PROGRAMS += kernel.img kernel_img_SOURCES = kern/i386/coreboot/startup.S \ kern/i386/misc.S \ kern/i386/coreboot/init.c \ @@ -34,7 +37,52 @@ kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ machine/memory.h machine/loader.h list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,0x8200,-Bstatic +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -Wl,-N,-S,-Ttext,$(GRUB_KERNEL_MACHINE_LINK_ADDR),-Bstatic + +endif + +ifeq ($(platform), qemu) + +GRUB_BOOT_MACHINE_LINK_ADDR = 0xffe00 + +pkglib_IMAGES += boot.img +boot_img_SOURCES = boot/i386/qemu/boot.S +boot_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR) +boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_BOOT_MACHINE_LINK_ADDR) +boot_img_FORMAT = binary + +bin_UTILITIES += grub-mkimage +grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ + util/resolve.c +grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR) + +pkglib_IMAGES += kernel.img +kernel_img_SOURCES = kern/i386/qemu/startup.S \ + kern/i386/misc.S \ + kern/i386/coreboot/init.c \ + kern/i386/qemu/mmap.c \ + kern/main.c kern/device.c \ + kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ + kern/misc.c kern/mm.c kern/reader.c kern/term.c \ + kern/rescue_parser.c kern/rescue_reader.c \ + kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ + kern/i386/dl.c kern/parser.c kern/partition.c \ + kern/i386/tsc.c kern/i386/pit.c \ + kern/generic/rtc_get_time_ms.c \ + kern/generic/millisleep.c \ + kern/env.c \ + term/i386/pc/vga_text.c term/i386/vga_common.c \ + symlist.c +kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ + env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ + partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + machine/boot.h machine/console.h machine/init.h \ + machine/memory.h machine/loader.h list.h handler.h command.h +kernel_img_CFLAGS = $(COMMON_CFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR) +kernel_img_ASFLAGS = $(COMMON_ASFLAGS) -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR) +kernel_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)$(GRUB_KERNEL_MACHINE_LINK_ADDR) +kernel_img_FORMAT = binary +endif MOSTLYCLEANFILES += symlist.c kernel_syms.lst DEFSYMFILES += kernel_syms.lst diff --git a/conf/i386-qemu.rmk b/conf/i386-qemu.rmk new file mode 100644 index 000000000..573a5d0f3 --- /dev/null +++ b/conf/i386-qemu.rmk @@ -0,0 +1,2 @@ +# -*- makefile -*- +include $(srcdir)/conf/i386-coreboot.mk diff --git a/configure.ac b/configure.ac index 9032ee3f0..cf1b197a5 100644 --- a/configure.ac +++ b/configure.ac @@ -85,6 +85,7 @@ case "$target_cpu"-"$platform" in i386-coreboot) ;; i386-linuxbios) platform=coreboot ;; i386-ieee1275) ;; + i386-qemu) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; *) AC_MSG_ERROR([platform "$platform" is not supported for target CPU "$target_cpu"]) ;; diff --git a/include/grub/dl.h b/include/grub/dl.h index 894da1d33..bebb810a8 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -1,7 +1,7 @@ /* dl.h - types and prototypes for loadable module support */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include #include #include +#include #define GRUB_MOD_INIT(name) \ static void grub_mod_init (grub_dl_t mod __attribute__ ((unused))) __attribute__ ((used)); \ @@ -78,6 +79,7 @@ struct grub_dl int ref_count; grub_dl_dep_t dep; grub_dl_segment_t segment; + Elf_Sym *symtab; void (*init) (struct grub_dl *mod); void (*fini) (void); }; diff --git a/include/grub/i386/qemu/boot.h b/include/grub/i386/qemu/boot.h new file mode 100644 index 000000000..6fbb57750 --- /dev/null +++ b/include/grub/i386/qemu/boot.h @@ -0,0 +1,28 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_BOOT_MACHINE_HEADER +#define GRUB_BOOT_MACHINE_HEADER 1 + +/* The size of boot.img. */ +#define GRUB_BOOT_MACHINE_SIZE (0x100000 - GRUB_BOOT_MACHINE_LINK_ADDR) + +/* The offset of GRUB_CORE_ENTRY_ADDR. */ +#define GRUB_BOOT_MACHINE_CORE_ENTRY_ADDR 0x4 + +#endif diff --git a/include/grub/i386/qemu/console.h b/include/grub/i386/qemu/console.h new file mode 100644 index 000000000..774399a4e --- /dev/null +++ b/include/grub/i386/qemu/console.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/qemu/init.h b/include/grub/i386/qemu/init.h new file mode 100644 index 000000000..fd935c3a2 --- /dev/null +++ b/include/grub/i386/qemu/init.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/qemu/kernel.h b/include/grub/i386/qemu/kernel.h new file mode 100644 index 000000000..bc0b93d4f --- /dev/null +++ b/include/grub/i386/qemu/kernel.h @@ -0,0 +1,53 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_KERNEL_MACHINE_HEADER +#define GRUB_KERNEL_MACHINE_HEADER 1 + +/* The offset of GRUB_CORE_ENTRY_ADDR. */ +#define GRUB_KERNEL_MACHINE_CORE_ENTRY_ADDR 0x8 + +/* The offset of GRUB_KERNEL_IMAGE_SIZE. */ +#define GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE 0xc + +/* The offset of GRUB_PREFIX. */ +#define GRUB_KERNEL_MACHINE_PREFIX 0x10 + +/* End of the data section. */ +#define GRUB_KERNEL_MACHINE_DATA_END 0x50 + +#ifndef ASM_FILE + +#include +#include + +extern grub_addr_t grub_core_entry_addr; + +/* The size of kernel image. */ +extern grub_int32_t grub_kernel_image_size; + +/* The total size of module images following the kernel. */ +extern grub_int32_t grub_total_module_size; + +/* The prefix which points to the directory where GRUB modules and its + configuration file are located. */ +extern char grub_prefix[]; + +#endif /* ! ASM_FILE */ + +#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ diff --git a/include/grub/i386/qemu/loader.h b/include/grub/i386/qemu/loader.h new file mode 100644 index 000000000..d3f36bba5 --- /dev/null +++ b/include/grub/i386/qemu/loader.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/qemu/machine.h b/include/grub/i386/qemu/machine.h new file mode 100644 index 000000000..b57932b49 --- /dev/null +++ b/include/grub/i386/qemu/machine.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_QEMU 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/include/grub/i386/qemu/memory.h b/include/grub/i386/qemu/memory.h new file mode 100644 index 000000000..de559443d --- /dev/null +++ b/include/grub/i386/qemu/memory.h @@ -0,0 +1,45 @@ +/* memory.h - describe the memory map */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2002,2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef _GRUB_MEMORY_MACHINE_HEADER +#define _GRUB_MEMORY_MACHINE_HEADER 1 + +#include +#include + +#ifndef ASM_FILE +#include +#include +#endif + +#define GRUB_MEMORY_MACHINE_LOWER_USABLE 0x9fc00 /* 640 kiB - 1 kiB */ + +#define GRUB_MEMORY_MACHINE_UPPER_START 0x100000 /* 1 MiB */ +#define GRUB_MEMORY_MACHINE_LOWER_SIZE GRUB_MEMORY_MACHINE_UPPER_START + +#ifndef ASM_FILE + +void grub_machine_mmap_init (void); + +grub_err_t EXPORT_FUNC(grub_machine_mmap_iterate) + (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)); + +#endif + +#endif /* ! _GRUB_MEMORY_MACHINE_HEADER */ diff --git a/include/grub/i386/qemu/serial.h b/include/grub/i386/qemu/serial.h new file mode 100644 index 000000000..2d8563414 --- /dev/null +++ b/include/grub/i386/qemu/serial.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/qemu/time.h b/include/grub/i386/qemu/time.h new file mode 100644 index 000000000..7177c7488 --- /dev/null +++ b/include/grub/i386/qemu/time.h @@ -0,0 +1 @@ +#include diff --git a/kern/dl.c b/kern/dl.c index cd34e3178..af4e5aa89 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -1,7 +1,7 @@ /* dl.c - loadable module support */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -28,6 +28,12 @@ #include #include #include +#include + +/* Platforms where modules are in a readonly area of memory. */ +#if defined(GRUB_MACHINE_QEMU) +#define GRUB_MODULES_MACHINE_READONLY +#endif @@ -309,7 +315,13 @@ grub_dl_resolve_symbols (grub_dl_t mod, Elf_Ehdr *e) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symbol table"); - sym = (Elf_Sym *) ((char *) e + s->sh_offset); +#ifdef GRUB_MODULES_MACHINE_READONLY + mod->symtab = grub_malloc (s->sh_size); + memcpy (mod->symtab, (char *) e + s->sh_offset, s->sh_size); +#else + mod->symtab = (Elf_Sym *) ((char *) e + s->sh_offset); +#endif + sym = mod->symtab; size = s->sh_size; entsize = s->sh_entsize; @@ -671,6 +683,9 @@ grub_dl_unload (grub_dl_t mod) } grub_free (mod->name); +#ifdef GRUB_MODULES_MACHINE_READONLY + grub_free (mod->symtab); +#endif grub_free (mod); return 1; } diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 611e9d1b4..1b9ca3815 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -144,5 +145,9 @@ grub_machine_fini (void) grub_addr_t grub_arch_modules_addr (void) { +#ifdef GRUB_MACHINE_QEMU + return grub_core_entry_addr + grub_kernel_image_size; +#else return ALIGN_UP((grub_addr_t) _end, GRUB_MOD_ALIGN); +#endif } diff --git a/kern/i386/dl.c b/kern/i386/dl.c index 978bfb166..a17f17576 100644 --- a/kern/i386/dl.c +++ b/kern/i386/dl.c @@ -43,7 +43,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { Elf32_Ehdr *e = ehdr; Elf32_Shdr *s; - Elf32_Sym *symtab; Elf32_Word entsize; unsigned i; @@ -57,7 +56,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); - symtab = (Elf32_Sym *) ((char *) e + s->sh_offset); entsize = s->sh_entsize; for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); @@ -89,7 +87,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) "reloc offset is out of the segment"); addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset); - sym = (Elf32_Sym *) ((char *) symtab + sym = (Elf32_Sym *) ((char *) mod->symtab + entsize * ELF32_R_SYM (rel->r_info)); switch (ELF32_R_TYPE (rel->r_info)) diff --git a/kern/i386/qemu/mmap.c b/kern/i386/qemu/mmap.c new file mode 100644 index 000000000..736457eea --- /dev/null +++ b/kern/i386/qemu/mmap.c @@ -0,0 +1,74 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +#define QEMU_CMOS_MEMSIZE_HIGH 0x35 +#define QEMU_CMOS_MEMSIZE_LOW 0x34 + +#define min(a,b) ((a) > (b) ? (b) : (a)) + +extern char _start[]; +extern char _end[]; + +grub_size_t grub_lower_mem, grub_upper_mem; +grub_uint64_t mem_size; + +void +grub_machine_mmap_init () +{ + mem_size = grub_cmos_read (QEMU_CMOS_MEMSIZE_HIGH) << 24 | grub_cmos_read (QEMU_CMOS_MEMSIZE_LOW) << 16; + + /* Don't ask... */ + mem_size += (16 * 1024 * 1024); +} + +grub_err_t +grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) +{ + if (hook (0x0, + _start, + GRUB_MACHINE_MEMORY_AVAILABLE)) + return 1; + + if (hook (GRUB_MEMORY_MACHINE_UPPER, + 0x100000 - GRUB_MEMORY_MACHINE_UPPER, + GRUB_MACHINE_MEMORY_RESERVED)) + return 1; + + /* Protect boot.img, which contains the gdt. It is mapped at the top of memory + (it is also mapped below 0x100000, but we already reserved that area). */ + if (hook ((grub_uint32_t) -GRUB_BOOT_MACHINE_SIZE, + GRUB_BOOT_MACHINE_SIZE, + GRUB_MACHINE_MEMORY_RESERVED)) + return 1; + + /* Everything else is free. */ + if (hook (0x100000, + min (mem_size, (grub_uint32_t) -GRUB_BOOT_MACHINE_SIZE) - 0x100000, + GRUB_MACHINE_MEMORY_AVAILABLE)) + return 1; + + return 0; +} diff --git a/kern/i386/qemu/startup.S b/kern/i386/qemu/startup.S new file mode 100644 index 000000000..0be5ae84f --- /dev/null +++ b/kern/i386/qemu/startup.S @@ -0,0 +1,97 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + + .text + .code32 + .globl _start +_start: + jmp codestart + + . = _start + GRUB_KERNEL_MACHINE_CORE_ENTRY_ADDR +VARIABLE(grub_core_entry_addr) + .long 0 +VARIABLE(grub_kernel_image_size) + .long 0 +VARIABLE(grub_prefix) + /* to be filled by grub-mkimage */ + + /* + * Leave some breathing room for the prefix. + */ + + . = _start + GRUB_KERNEL_MACHINE_DATA_END + +codestart: + /* Relocate to low memory. First we figure out our location. + We will derive the rom start address from it. */ + call 1f +1: popl %esi + + /* Rom size is a multiple of 64 kiB. With this we get the + value of `grub_core_entry_addr' in %esi. */ + xorw %si, %si + + /* ... which allows us to access `grub_kernel_image_size' + before relocation. */ + movl (grub_kernel_image_size - _start)(%esi), %ecx + + + movl $_start, %edi + cld + rep + movsb + ljmp $GRUB_MEMORY_MACHINE_PROT_MODE_CSEG, $1f +1: + +#ifdef APPLE_CC + /* clean out the bss */ + bss_start_abs = ABS (bss_start) + bss_end_abs = ABS (bss_end) + + movl bss_start_abs, %edi + + /* compute the bss length */ + movl bss_end_abs, %ecx + subl %edi, %ecx +#else + /* clean out the bss */ + movl $BSS_START_SYMBOL, %edi + + /* compute the bss length */ + movl $END_SYMBOL, %ecx + subl %edi, %ecx +#endif + + /* clean out */ + xorl %eax, %eax + cld + rep + stosb + + /* + * Call the start of main body of C code. + */ + call EXT_C(grub_main) + + /* This should never happen. */ + jmp EXT_C(grub_stop) diff --git a/kern/powerpc/dl.c b/kern/powerpc/dl.c index ae987c087..9b1cb1407 100644 --- a/kern/powerpc/dl.c +++ b/kern/powerpc/dl.c @@ -44,7 +44,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { Elf32_Ehdr *e = ehdr; Elf32_Shdr *s; - Elf32_Sym *symtab; Elf32_Word entsize; unsigned i; @@ -58,7 +57,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); - symtab = (Elf32_Sym *) ((char *) e + s->sh_offset); entsize = s->sh_entsize; for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); @@ -91,7 +89,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) "reloc offset is out of the segment"); addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset); - sym = (Elf32_Sym *) ((char *) symtab + sym = (Elf32_Sym *) ((char *) mod->symtab + entsize * ELF32_R_SYM (rel->r_info)); /* On the PPC the value does not have an explicit diff --git a/kern/sparc64/dl.c b/kern/sparc64/dl.c index d998dafe8..533489677 100644 --- a/kern/sparc64/dl.c +++ b/kern/sparc64/dl.c @@ -44,7 +44,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { Elf64_Ehdr *e = ehdr; Elf64_Shdr *s; - Elf64_Sym *symtab; Elf64_Word entsize; unsigned i; @@ -58,7 +57,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); - symtab = (Elf64_Sym *) ((char *) e + s->sh_offset); entsize = s->sh_entsize; for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); @@ -91,7 +89,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) "reloc offset is out of the segment"); addr = (Elf64_Word *) ((char *) seg->addr + rel->r_offset); - sym = (Elf64_Sym *) ((char *) symtab + sym = (Elf64_Sym *) ((char *) mod->symtab + entsize * ELF64_R_SYM (rel->r_info)); value = sym->st_value + rel->r_addend; diff --git a/kern/x86_64/dl.c b/kern/x86_64/dl.c index a60690148..9e5de6e09 100644 --- a/kern/x86_64/dl.c +++ b/kern/x86_64/dl.c @@ -43,7 +43,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { Elf64_Ehdr *e = ehdr; Elf64_Shdr *s; - Elf64_Sym *symtab; Elf64_Word entsize; unsigned i; @@ -57,7 +56,6 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (i == e->e_shnum) return grub_error (GRUB_ERR_BAD_MODULE, "no symtab found"); - symtab = (Elf64_Sym *) ((char *) e + s->sh_offset); entsize = s->sh_entsize; for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); @@ -91,7 +89,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) addr32 = (Elf64_Word *) ((char *) seg->addr + rel->r_offset); addr64 = (Elf64_Xword *) addr32; - sym = (Elf64_Sym *) ((char *) symtab + sym = (Elf64_Sym *) ((char *) mod->symtab + entsize * ELF64_R_SYM (rel->r_info)); switch (ELF64_R_TYPE (rel->r_info)) diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index f9c74cd16..ee1af822a 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -124,6 +124,17 @@ compress_kernel (char *kernel_img, size_t kernel_size, *core_size += GRUB_KERNEL_MACHINE_RAW_SIZE; } +#else + +static void +compress_kernel (char *kernel_img, size_t kernel_size, + char **core_img, size_t *core_size) +{ + *core_img = xmalloc (kernel_size); + memcpy (*core_img, kernel_img, kernel_size); + *core_size = kernel_size; +} + #endif static void @@ -237,6 +248,8 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], if (num > 0xffff) grub_util_error ("the core image is too big"); +#if defined(GRUB_MACHINE_PCBIOS) + boot_path = grub_util_get_path (dir, "diskboot.img"); boot_size = grub_util_get_image_size (boot_path); if (boot_size != GRUB_DISK_SECTOR_SIZE) @@ -253,13 +266,54 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], free (boot_img); free (boot_path); +#elif defined(GRUB_MACHINE_QEMU) + + { + char *rom_img; + size_t rom_size; + + boot_path = grub_util_get_path (dir, "boot.img"); + boot_size = grub_util_get_image_size (boot_path); + boot_img = grub_util_read_image (boot_path); + + /* Rom sizes must be 64k-aligned. */ + rom_size = ALIGN_UP (core_size + boot_size, 64 * 1024); + + rom_img = xmalloc (rom_size); + memset (rom_img, 0, rom_size); + + *((grub_int32_t *) (core_img + GRUB_KERNEL_MACHINE_CORE_ENTRY_ADDR)) + = grub_cpu_to_le32 ((grub_uint32_t) -rom_size); + + memcpy (rom_img, core_img, core_size); + + *((grub_int32_t *) (boot_img + GRUB_BOOT_MACHINE_CORE_ENTRY_ADDR)) + = grub_cpu_to_le32 ((grub_uint32_t) -rom_size); + + memcpy (rom_img + rom_size - boot_size, boot_img, boot_size); + + free (core_img); + core_img = rom_img; + core_size = rom_size; + + free (boot_img); + free (boot_path); + } + +#endif + +#ifdef GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_TOTAL_MODULE_SIZE)) = grub_cpu_to_le32 (total_module_size); +#endif *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_KERNEL_IMAGE_SIZE)) = grub_cpu_to_le32 (kernel_size); +#ifdef GRUB_KERNEL_MACHINE_COMPRESSED_SIZE *((grub_uint32_t *) (core_img + GRUB_KERNEL_MACHINE_COMPRESSED_SIZE)) = grub_cpu_to_le32 (core_size - GRUB_KERNEL_MACHINE_RAW_SIZE); +#endif +#if defined(GRUB_KERNEL_MACHINE_INSTALL_DOS_PART) && defined(GRUB_KERNEL_MACHINE_INSTALL_BSD_PART) /* If we included a drive in our prefix, let GRUB know it doesn't have to prepend the drive told by BIOS. */ if (prefix[0] == '(') @@ -269,10 +323,13 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], *((grub_int32_t *) (core_img + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART)) = grub_cpu_to_le32 (-2); } +#endif +#ifdef GRUB_MACHINE_PCBIOS if (GRUB_KERNEL_MACHINE_LINK_ADDR + core_size > GRUB_MEMORY_MACHINE_UPPER) grub_util_error ("Core image is too big (%p > %p)\n", GRUB_KERNEL_MACHINE_LINK_ADDR + core_size, GRUB_MEMORY_MACHINE_UPPER); +#endif grub_util_write_image (core_img, core_size, out); free (kernel_img); From 87a4623bda50569041bd4ad2e47f1759128525bd Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 27 Jun 2009 12:21:18 +0000 Subject: [PATCH 0905/1707] 2009-06-27 Robert Millan Revert r2338. * loader/i386/linux.c (grub_cmd_linux): Don't call grub_error when file can't be opened. grub_file_open() is already supposed to set grub_errno / grub_errmsg appropiately. * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. --- ChangeLog | 9 +++++++++ loader/i386/linux.c | 5 +---- loader/i386/pc/linux.c | 5 +---- 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5bd20acd2..53774cdb5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-06-27 Robert Millan + + Revert r2338. + + * loader/i386/linux.c (grub_cmd_linux): Don't call grub_error when + file can't be opened. grub_file_open() is already supposed to set + grub_errno / grub_errmsg appropiately. + * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. + 2009-06-27 Pavel Roskin 2009-06-27 Robert Millan diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 86f584c57..6510db670 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -600,10 +600,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), file = grub_file_open (argv[0]); if (! file) - { - grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); - goto fail; - } + goto fail; if (grub_file_read (file, &lh, sizeof (lh)) != sizeof (lh)) { diff --git a/loader/i386/pc/linux.c b/loader/i386/pc/linux.c index 97df54dee..c5279f6ce 100644 --- a/loader/i386/pc/linux.c +++ b/loader/i386/pc/linux.c @@ -69,10 +69,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), file = grub_file_open (argv[0]); if (! file) - { - grub_error (GRUB_ERR_FILE_NOT_FOUND, "file not found"); - goto fail; - } + goto fail; if ((grub_size_t) grub_file_size (file) > grub_os_area_size) { From ad760f81b0ea5d56adfbe6a55898b8a23943244c Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 27 Jun 2009 17:37:07 +0000 Subject: [PATCH 0906/1707] 2009-06-27 Robert Millan * loader/i386/linux.c (grub_linux_boot): Fix uninitialized use of `err'. --- ChangeLog | 5 +++++ loader/i386/linux.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 53774cdb5..c1814fac7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-27 Robert Millan + + * loader/i386/linux.c (grub_linux_boot): Fix uninitialized use of + `err'. + 2009-06-27 Robert Millan Revert r2338. diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 6510db670..8737d4a7d 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -444,7 +444,7 @@ grub_linux_boot (void) { struct linux_kernel_params *params; int e820_num; - grub_err_t err; + grub_err_t err = 0; char *modevar, *tmp; params = real_mode_mem; From 18b6c557fd725600faa1d32aba213a71993b60a6 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 29 Jun 2009 02:59:53 +0000 Subject: [PATCH 0907/1707] 2009-06-28 Pavel Roskin * util/grub.d/10_linux.in: Match SUSE style initrd names. --- ChangeLog | 4 ++++ util/grub.d/10_linux.in | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c1814fac7..c29d28e5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-06-28 Pavel Roskin + + * util/grub.d/10_linux.in: Match SUSE style initrd names. + 2009-06-27 Robert Millan * loader/i386/linux.c (grub_linux_boot): Fix uninitialized use of diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index e36b5b006..3d130609a 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -128,7 +128,8 @@ while [ "x$list" != "x" ] ; do initrd= for i in "initrd.img-${version}" "initrd-${version}.img" \ - "initrd.img-${alt_version}" "initrd-${alt_version}.img"; do + "initrd-${version}" "initrd.img-${alt_version}" \ + "initrd-${alt_version}.img" "initrd-${alt_version}"; do if test -e "${dirname}/${i}" ; then initrd="$i" break From 85f2aab6f7e1ad75ffa143a8b5f8589ac8535fb3 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 29 Jun 2009 03:37:42 +0000 Subject: [PATCH 0908/1707] 2009-06-28 Pavel Roskin * kern/i386/qemu/mmap.c (grub_machine_mmap_iterate): Use cast to fix a warning. --- ChangeLog | 3 +++ kern/i386/qemu/mmap.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c29d28e5a..0de7af810 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-06-28 Pavel Roskin + * kern/i386/qemu/mmap.c (grub_machine_mmap_iterate): Use cast to + fix a warning. + * util/grub.d/10_linux.in: Match SUSE style initrd names. 2009-06-27 Robert Millan diff --git a/kern/i386/qemu/mmap.c b/kern/i386/qemu/mmap.c index 736457eea..4ccae023a 100644 --- a/kern/i386/qemu/mmap.c +++ b/kern/i386/qemu/mmap.c @@ -48,7 +48,7 @@ grub_err_t grub_machine_mmap_iterate (int NESTED_FUNC_ATTR (*hook) (grub_uint64_t, grub_uint64_t, grub_uint32_t)) { if (hook (0x0, - _start, + (grub_addr_t) _start, GRUB_MACHINE_MEMORY_AVAILABLE)) return 1; From 02164e1bb7ef9f6685907d0c8877707d39823d20 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 29 Jun 2009 12:19:08 +0000 Subject: [PATCH 0909/1707] 2009-06-29 Robert Millan Fix build on Debian / sparc. * configure.ac: Recognize `sparc' target_cpu (as sparc64). --- ChangeLog | 6 ++++++ configure.ac | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0de7af810..e95431249 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-29 Robert Millan + + Fix build on Debian / sparc. + + * configure.ac: Recognize `sparc' target_cpu (as sparc64). + 2009-06-28 Pavel Roskin * kern/i386/qemu/mmap.c (grub_machine_mmap_iterate): Use cast to diff --git a/configure.ac b/configure.ac index cf1b197a5..8b12c582c 100644 --- a/configure.ac +++ b/configure.ac @@ -44,7 +44,8 @@ AC_CANONICAL_TARGET AC_ARG_PROGRAM case "$target_cpu" in - i[[3456]]86) target_cpu=i386 ;; + i[[3456]]86) target_cpu=i386 ;; + sparc) target_cpu=sparc64 ;; esac # Specify the platform (such as firmware). From 28333ad04fe7040727b7ebc68487ec824e7de65a Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 29 Jun 2009 12:20:56 +0000 Subject: [PATCH 0910/1707] 2009-06-29 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro. * loader/i386/linux.c (grub_cmd_linux): Recognize "quiet" option, and set GRUB_LINUX_FLAG_QUIET appropiately. --- ChangeLog | 6 ++++++ include/grub/i386/linux.h | 5 +++-- loader/i386/linux.c | 5 +++++ 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e95431249..cd45a3b9b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-06-29 Robert Millan + + * include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro. + * loader/i386/linux.c (grub_cmd_linux): Recognize "quiet" option, + and set GRUB_LINUX_FLAG_QUIET appropiately. + 2009-06-29 Robert Millan Fix build on Debian / sparc. diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 1e601955c..dc6c02e1b 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 1999,2000,2001,2002,2003,2004,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 1999,2000,2001,2002,2003,2004,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,7 +21,6 @@ #define GRUB_LINUX_MAGIC_SIGNATURE 0x53726448 /* "HdrS" */ #define GRUB_LINUX_DEFAULT_SETUP_SECTS 4 -#define GRUB_LINUX_FLAG_CAN_USE_HEAP 0x80 #define GRUB_LINUX_INITRD_MAX_ADDRESS 0x37FFFFFF #define GRUB_LINUX_MAX_SETUP_SECTS 64 #define GRUB_LINUX_BOOT_LOADER_TYPE 0x72 @@ -33,6 +32,8 @@ #define GRUB_LINUX_SETUP_STACK 0x9000 #define GRUB_LINUX_FLAG_BIG_KERNEL 0x1 +#define GRUB_LINUX_FLAG_QUIET 0x20 +#define GRUB_LINUX_FLAG_CAN_USE_HEAP 0x80 /* Linux's video mode selection support. Actually I hate it! */ #define GRUB_LINUX_VID_MODE_NORMAL 0xFFFF diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 8737d4a7d..e89baaadc 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -820,6 +820,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_mem_size <<= shift; } } + else if (grub_memcmp (argv[i], "quiet", sizeof ("quiet") - 1) == 0) + { + params->loadflags |= GRUB_LINUX_FLAG_QUIET; + } + /* Specify the boot file. */ dest = grub_stpcpy ((char *) real_mode_mem + GRUB_LINUX_CL_OFFSET, From c6fe4d532866e74a71ca4040350d5722babf9cc7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 29 Jun 2009 15:55:42 +0000 Subject: [PATCH 0911/1707] 2009-06-29 Robert Millan * loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline assembly in final jump, using register constraints. --- ChangeLog | 5 +++++ loader/i386/linux.c | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd45a3b9b..ab44fb5d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-06-29 Robert Millan + + * loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline + assembly in final jump, using register constraints. + 2009-06-29 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro. diff --git a/loader/i386/linux.c b/loader/i386/linux.c index e89baaadc..da2e34c4f 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -554,14 +554,8 @@ grub_linux_boot (void) asm volatile ("lidt %0" : : "m" (idt_desc)); asm volatile ("lgdt %0" : : "m" (gdt_desc)); - /* Pass parameters. */ - asm volatile ("movl %0, %%ecx" : : "m" (params->code32_start)); - asm volatile ("movl %0, %%esi" : : "m" (real_mode_mem)); - - asm volatile ("xorl %%ebx, %%ebx" : : ); - /* Enter Linux. */ - asm volatile ("jmp *%%ecx" : : ); + asm volatile ("jmp *%2" : : "b" (0), "S" (real_mode_mem), "g" (params->code32_start)); #endif From b09db61dddd7de15b7354513051ae2e8730119c9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 29 Jun 2009 17:19:35 +0000 Subject: [PATCH 0912/1707] 2009-06-29 Robert Millan * include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): New macro. * loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline assembly in final jump, using register constraints. (grub_linux_boot): For text mode, initialize `have_vga' using GRUB_VIDEO_TYPE_TEXT rather than 0 (this changes its value to 1). Initialize `video_cursor_x' and `video_cursor_y' as late as possible, right before the final jump. Set `video_mode' to 0x3. Document initialization of `video_page', `video_mode' and `video_ega_bx'. --- ChangeLog | 13 +++++++++++++ include/grub/i386/linux.h | 1 + loader/i386/linux.c | 24 +++++++++++++++++++----- 3 files changed, 33 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab44fb5d9..844f603b0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,21 @@ 2009-06-29 Robert Millan + * include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): New macro. + * loader/i386/linux.c [__i386__] (grub_linux_boot): Simplify inline assembly in final jump, using register constraints. + (grub_linux_boot): For text mode, initialize `have_vga' using + GRUB_VIDEO_TYPE_TEXT rather than 0 (this changes its value to 1). + + Initialize `video_cursor_x' and `video_cursor_y' as late as possible, + right before the final jump. + + Set `video_mode' to 0x3. + + Document initialization of `video_page', `video_mode' and + `video_ega_bx'. + 2009-06-29 Robert Millan * include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro. diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index dc6c02e1b..641c09016 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -79,6 +79,7 @@ struct grub_e820_mmap grub_uint32_t type; } __attribute__((packed)); +#define GRUB_VIDEO_TYPE_TEXT 0x01 #define GRUB_VIDEO_TYPE_VLFB 0x23 /* VESA VGA in graphic mode */ #define GRUB_VIDEO_TYPE_EFI 0x70 diff --git a/loader/i386/linux.c b/loader/i386/linux.c index da2e34c4f..78fa84822 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -479,9 +479,7 @@ grub_linux_boot (void) params->have_vga = GRUB_VIDEO_TYPE_VLFB; else { - params->have_vga = 0; - params->video_cursor_x = grub_getxy () >> 8; - params->video_cursor_y = grub_getxy () & 0xff; + params->have_vga = GRUB_VIDEO_TYPE_TEXT; params->video_width = 80; params->video_height = 25; } @@ -536,6 +534,13 @@ grub_linux_boot (void) grub_mmap_iterate (hook); params->mmap_size = e820_num; + /* Initialize these last, because terminal position could be affected by printfs above. */ + if (params->have_vga == GRUB_VIDEO_TYPE_TEXT) + { + params->video_cursor_x = grub_getxy () >> 8; + params->video_cursor_y = grub_getxy () & 0xff; + } + #ifdef __x86_64__ grub_memcpy ((char *) prot_mode_mem + (prot_mode_pages << 12), @@ -664,8 +669,11 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), params->type_of_loader = (LINUX_LOADER_ID_GRUB << 4); + /* These two are used (instead of cmd_line_ptr) by older versions of Linux, + and otherwise ignored. */ params->cl_magic = GRUB_LINUX_CL_MAGIC; params->cl_offset = 0x1000; + params->cmd_line_ptr = (unsigned long) real_mode_mem + 0x1000; params->ramdisk_image = 0; params->ramdisk_size = 0; @@ -679,9 +687,15 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), params->ext_mem = ((32 * 0x100000) >> 10); params->alt_mem = ((32 * 0x100000) >> 10); - params->video_page = 0; /* ??? */ - params->video_mode = 0; + /* Ignored by Linux. */ + params->video_page = 0; + + /* Must be non-zero even in text mode, or Linux will think there's no VGA. */ + params->video_mode = 0x3; + + /* Only used when `video_mode == 0x7', otherwise ignored. */ params->video_ega_bx = 0; + params->font_size = 16; /* XXX */ /* The other parameters are filled when booting. */ From a337130b25848b74c81bd2a0aee7f8d42278c82e Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 1 Jul 2009 01:04:12 +0000 Subject: [PATCH 0913/1707] 2009-07-01 Robert Millan * include/grub/i386/linux.h (linux_kernel_params): Change `mmap_size' type to `grub_uint8_t', and adjust `padding9' accordingly. --- ChangeLog | 5 +++++ include/grub/i386/linux.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 844f603b0..0053575cb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-01 Robert Millan + + * include/grub/i386/linux.h (linux_kernel_params): Change `mmap_size' + type to `grub_uint8_t', and adjust `padding9' accordingly. + 2009-06-29 Robert Millan * include/grub/i386/linux.h (GRUB_VIDEO_TYPE_TEXT): New macro. diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index 641c09016..cf110973e 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -239,9 +239,9 @@ struct linux_kernel_params grub_uint8_t padding8[0x1e8 - 0x1e4]; - grub_uint32_t mmap_size; /* 1e8 */ + grub_uint8_t mmap_size; /* 1e8 */ - grub_uint8_t padding9[0x1f1 - 0x1ec]; + grub_uint8_t padding9[0x1f1 - 0x1e9]; grub_uint8_t setup_sects; /* The size of the setup in sectors */ grub_uint16_t root_flags; /* If the root is mounted readonly */ From aaf53e3ce36f53d67eebec0b39d89a47f788ae94 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 1 Jul 2009 12:59:47 +0000 Subject: [PATCH 0914/1707] 2009-07-01 Robert Millan * conf/i386.rmk (setjmp_mod_SOURCES) (setjmp_mod_ASFLAGS, setjmp_mod_LDFLAGS): Move to ... * conf/common.rmk (setjmp_mod_SOURCES) (setjmp_mod_ASFLAGS, setjmp_mod_LDFLAGS): ... here, and modify to use $(target_cpu). * conf/x86_64-efi.rmk (setjmp_mod_SOURCES) (setjmp_mod_ASFLAGS, setjmp_mod_LDFLAGS): Remove. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/i386-pc.rmk (kernel_img_SOURCES): Use $(target_cpu) for kern/$(target_cpu)/dl.c. * conf/i386-efi.rmk: Likewise. * conf/i386-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. * conf/i386-coreboot.rmk: Likewise. * conf/powerpc-ieee1275.rmk (kernel_img_SOURCES): Use $(target_cpu) for kern/$(target_cpu)/dl.c and for kern/$(target_cpu)/cache.S. * conf/sparc64-ieee1275.rmk: Likewise. --- ChangeLog | 23 +++++++++++++++++++++++ conf/common.rmk | 5 +++++ conf/i386-coreboot.rmk | 4 ++-- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/i386.rmk | 6 ------ conf/powerpc-ieee1275.rmk | 10 ++-------- conf/sparc64-ieee1275.rmk | 10 ++-------- conf/x86_64-efi.rmk | 8 +------- 10 files changed, 38 insertions(+), 34 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0053575cb..cf230ba25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,26 @@ +2009-07-01 Robert Millan + + * conf/i386.rmk (setjmp_mod_SOURCES) + (setjmp_mod_ASFLAGS, setjmp_mod_LDFLAGS): Move to ... + * conf/common.rmk (setjmp_mod_SOURCES) + (setjmp_mod_ASFLAGS, setjmp_mod_LDFLAGS): ... here, and modify + to use $(target_cpu). + * conf/x86_64-efi.rmk (setjmp_mod_SOURCES) + (setjmp_mod_ASFLAGS, setjmp_mod_LDFLAGS): Remove. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + + * conf/i386-pc.rmk (kernel_img_SOURCES): Use + $(target_cpu) for kern/$(target_cpu)/dl.c. + * conf/i386-efi.rmk: Likewise. + * conf/i386-ieee1275.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + * conf/i386-coreboot.rmk: Likewise. + * conf/powerpc-ieee1275.rmk (kernel_img_SOURCES): Use + $(target_cpu) for kern/$(target_cpu)/dl.c and for + kern/$(target_cpu)/cache.S. + * conf/sparc64-ieee1275.rmk: Likewise. + 2009-07-01 Robert Millan * include/grub/i386/linux.h (linux_kernel_params): Change `mmap_size' diff --git a/conf/common.rmk b/conf/common.rmk index fbca2e4be..9cd4b93a4 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -598,3 +598,8 @@ pkglib_MODULES += xnu_uuid.mod xnu_uuid_mod_SOURCES = commands/xnu_uuid.c xnu_uuid_mod_CFLAGS = $(COMMON_CFLAGS) xnu_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + +pkglib_MODULES += setjmp.mod +setjmp_mod_SOURCES = lib/$(target_cpu)/setjmp.S +setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) +setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 119e116da..fb65322fc 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -23,7 +23,7 @@ kernel_img_SOURCES = kern/i386/coreboot/startup.S \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ kern/rescue_parser.c kern/rescue_reader.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/i386/dl.c kern/parser.c kern/partition.c \ + kern/$(target_cpu)/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ @@ -66,7 +66,7 @@ kernel_img_SOURCES = kern/i386/qemu/startup.S \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ kern/rescue_parser.c kern/rescue_reader.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/i386/dl.c kern/parser.c kern/partition.c \ + kern/$(target_cpu)/dl.c kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ kern/generic/millisleep.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index d14673382..4e898068d 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -92,7 +92,7 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ kern/rescue_parser.c kern/rescue_reader.c \ - kern/i386/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ + kern/$(target_cpu)/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ term/efi/console.c disk/efi/efidisk.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 5024dad50..a7b8e07f8 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -21,7 +21,7 @@ kernel_img_SOURCES = kern/i386/ieee1275/startup.S \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ kern/rescue_parser.c kern/rescue_reader.c \ - kern/i386/dl.c kern/parser.c kern/partition.c \ + kern/$(target_cpu)/dl.c kern/parser.c kern/partition.c \ kern/env.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/generic/millisleep.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 714e8172d..6ae167c6d 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -53,7 +53,7 @@ kernel_img_SOURCES = kern/i386/pc/startup.S \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ kern/rescue_parser.c kern/rescue_reader.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ - kern/i386/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ + kern/$(target_cpu)/dl.c kern/i386/pc/init.c kern/i386/pc/mmap.c \ kern/parser.c kern/partition.c \ kern/i386/tsc.c kern/i386/pit.c \ kern/generic/rtc_get_time_ms.c \ diff --git a/conf/i386.rmk b/conf/i386.rmk index 89496aef8..93f84ce39 100644 --- a/conf/i386.rmk +++ b/conf/i386.rmk @@ -14,9 +14,3 @@ pkglib_MODULES += vga_text.mod vga_text_mod_SOURCES = term/i386/pc/vga_text.c term/i386/vga_common.c vga_text_mod_CFLAGS = $(COMMON_CFLAGS) vga_text_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For setjmp.mod -pkglib_MODULES += setjmp.mod -setjmp_mod_SOURCES = lib/i386/setjmp.S -setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) -setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index bc672ac25..b424b0a3c 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -92,9 +92,9 @@ kernel_img_SOURCES = kern/powerpc/ieee1275/startup.S kern/ieee1275/cmain.c \ kern/ieee1275/mmap.c \ term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ - kern/parser.c kern/partition.c kern/env.c kern/powerpc/dl.c \ + kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \ kern/generic/millisleep.c kern/time.c \ - symlist.c kern/powerpc/cache.S + symlist.c kern/$(target_cpu)/cache.S kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = $(COMMON_LDFLAGS) -static-libgcc -lgcc \ @@ -162,10 +162,4 @@ lsmmap_mod_SOURCES = commands/lsmmap.c lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For setjmp.mod -pkglib_MODULES += setjmp.mod -setjmp_mod_SOURCES = lib/powerpc/setjmp.S -setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) -setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/common.mk diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 2a05f23df..4a2fb6698 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -43,9 +43,9 @@ kernel_img_SOURCES = kern/sparc64/ieee1275/crt0.S kern/ieee1275/cmain.c \ kern/ieee1275/mmap.c \ term/ieee1275/ofconsole.c \ kern/ieee1275/openfw.c disk/ieee1275/ofdisk.c \ - kern/parser.c kern/partition.c kern/env.c kern/sparc64/dl.c \ + kern/parser.c kern/partition.c kern/env.c kern/$(target_cpu)/dl.c \ kern/generic/millisleep.c kern/time.c \ - symlist.c kern/sparc64/cache.S + symlist.c kern/$(target_cpu)/cache.S kernel_img_CFLAGS = $(COMMON_CFLAGS) kernel_img_ASFLAGS = $(COMMON_ASFLAGS) kernel_img_LDFLAGS = -nostdlib -Wl,-N,-Ttext,0x200000,-Bstatic,-melf64_sparc -static-libgcc -lgcc @@ -181,10 +181,4 @@ lsmmap_mod_SOURCES = commands/lsmmap.c lsmmap_mod_CFLAGS = $(COMMON_CFLAGS) lsmmap_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For setjmp.mod -pkglib_MODULES += setjmp.mod -setjmp_mod_SOURCES = lib/sparc64/setjmp.S -setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) -setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/common.mk diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 82d000506..95e5ac610 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -90,7 +90,7 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ kern/disk.c kern/dl.c kern/file.c kern/fs.c kern/err.c \ kern/misc.c kern/mm.c kern/reader.c kern/term.c \ kern/rescue_parser.c kern/rescue_reader.c \ - kern/x86_64/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ + kern/$(target_cpu)/dl.c kern/i386/efi/init.c kern/parser.c kern/partition.c \ kern/env.c symlist.c kern/efi/efi.c kern/efi/init.c kern/efi/mm.c \ kern/time.c kern/list.c kern/handler.c kern/command.c kern/corecmd.c \ kern/i386/tsc.c kern/i386/pit.c \ @@ -200,10 +200,4 @@ xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) -# For setjmp.mod -pkglib_MODULES += setjmp.mod -setjmp_mod_SOURCES = lib/x86_64/setjmp.S -setjmp_mod_ASFLAGS = $(COMMON_ASFLAGS) -setjmp_mod_LDFLAGS = $(COMMON_LDFLAGS) - include $(srcdir)/conf/common.mk From 211d06b54be54809c5e5072a2da849a7d2cd48b7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 1 Jul 2009 13:01:33 +0000 Subject: [PATCH 0915/1707] 2009-07-01 Robert Millan * util/misc.c: Include `' and `'. (grub_reboot, grub_halt): New functions. * util/i386/pc/misc.c: Delete. Update all users. * util/sparc64/ieee1275/misc.c: Likewise. * util/powerpc/ieee1275/misc.c: Likewise. --- ChangeLog | 9 +++++++++ conf/i386-coreboot.rmk | 1 - conf/i386-efi.rmk | 1 - conf/i386-ieee1275.rmk | 1 - conf/i386-pc.rmk | 1 - conf/powerpc-ieee1275.rmk | 1 - conf/sparc64-ieee1275.rmk | 1 - conf/x86_64-efi.rmk | 1 - util/i386/pc/misc.c | 33 --------------------------------- util/misc.c | 18 ++++++++++++++++++ util/powerpc/ieee1275/misc.c | 33 --------------------------------- util/sparc64/ieee1275/misc.c | 33 --------------------------------- 12 files changed, 27 insertions(+), 106 deletions(-) delete mode 100644 util/i386/pc/misc.c delete mode 100644 util/powerpc/ieee1275/misc.c delete mode 100644 util/sparc64/ieee1275/misc.c diff --git a/ChangeLog b/ChangeLog index cf230ba25..6e6b598a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-07-01 Robert Millan + + * util/misc.c: Include `' and `'. + (grub_reboot, grub_halt): New functions. + + * util/i386/pc/misc.c: Delete. Update all users. + * util/sparc64/ieee1275/misc.c: Likewise. + * util/powerpc/ieee1275/misc.c: Likewise. + 2009-07-01 Robert Millan * conf/i386.rmk (setjmp_mod_SOURCES) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index fb65322fc..c70f7d2a0 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -138,7 +138,6 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 4e898068d..75aa611e7 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -65,7 +65,6 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index a7b8e07f8..513e1b7bc 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -92,7 +92,6 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 6ae167c6d..f1915b646 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -158,7 +158,6 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b424b0a3c..b12635ebd 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -73,7 +73,6 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/powerpc/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 4a2fb6698..c3c10ef2e 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -129,7 +129,6 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/sparc64/ieee1275/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 95e5ac610..21da0e1cf 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -62,7 +62,6 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ - util/i386/pc/misc.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ diff --git a/util/i386/pc/misc.c b/util/i386/pc/misc.c deleted file mode 100644 index 8490fbf70..000000000 --- a/util/i386/pc/misc.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include - -#include - -void -grub_reboot (void) -{ - longjmp (main_env, 1); -} - -void -grub_halt (int no_apm __attribute__ ((unused))) -{ - grub_reboot (); -} diff --git a/util/misc.c b/util/misc.c index 939867b7f..2d0039028 100644 --- a/util/misc.c +++ b/util/misc.c @@ -18,6 +18,7 @@ #include +#include #include #include #include @@ -36,6 +37,7 @@ #include #include #include +#include /* Include malloc.h, only if memalign is available. It is known that memalign is declared in malloc.h in all systems, if present. */ @@ -436,4 +438,20 @@ fail: return size; } +#endif /* __MINGW32__ */ + +void +grub_reboot (void) +{ + longjmp (main_env, 1); +} + +void +grub_halt ( +#ifdef GRUB_MACHINE_PCBIOS + int no_apm __attribute__ ((unused)) #endif + ) +{ + grub_reboot (); +} diff --git a/util/powerpc/ieee1275/misc.c b/util/powerpc/ieee1275/misc.c deleted file mode 100644 index b0ce83bd2..000000000 --- a/util/powerpc/ieee1275/misc.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include - -#include - -void -grub_reboot (void) -{ - longjmp (main_env, 1); -} - -void -grub_halt (void) -{ - grub_reboot (); -} diff --git a/util/sparc64/ieee1275/misc.c b/util/sparc64/ieee1275/misc.c deleted file mode 100644 index 99b95132e..000000000 --- a/util/sparc64/ieee1275/misc.c +++ /dev/null @@ -1,33 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include - -#include - -void -grub_reboot (void) -{ - longjmp (main_env, 1); -} - -void -grub_halt (void) -{ - grub_reboot (); -} From 3f7f0cd0030ea193a9c5edc29aa7d39aa269677f Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 1 Jul 2009 13:04:38 +0000 Subject: [PATCH 0916/1707] 2009-07-01 Robert Millan Fix grub-emu build on sparc64-ieee1275. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Syncronize with ... * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): ... this. --- ChangeLog | 7 +++++++ conf/sparc64-ieee1275.rmk | 28 +++++++++++++++------------- 2 files changed, 22 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e6b598a8..cc94058c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-01 Robert Millan + + Fix grub-emu build on sparc64-ieee1275. + + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Syncronize with ... + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): ... this. + 2009-07-01 Robert Millan * util/misc.c: Include `' and `'. diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index c3c10ef2e..8183cbc05 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -97,34 +97,35 @@ grub_ofpathname_SOURCES = util/sparc64/ieee1275/grub-ofpathname.c \ # For grub-emu util/grub-emu.c_DEPENDENCIES = grub_emu_init.h -grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ +grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ - commands/probe.c commands/xnu_uuid.c \ - lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/hexdump.c commands/halt.c commands/reboot.c \ + commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ disk/loopback.c \ \ - fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ + fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ - kern/err.c kern/file.c kern/fs.c kern/loader.c kern/main.c \ + kern/err.c kern/file.c kern/fs.c commands/boot.c kern/main.c \ kern/misc.c kern/parser.c kern/partition.c kern/reader.c \ kern/rescue_reader.c kern/rescue_parser.c \ - kern/term.c fs/fshelp.c \ - kern/list.c kern/handler.c \ - lib/arg.c normal/cmdline.c \ - normal/completion.c \ - normal/main.c normal/menu.c \ + kern/term.c kern/list.c kern/handler.c fs/fshelp.c \ + kern/command.c kern/corecmd.c commands/extcmd.c \ + lib/arg.c normal/cmdline.c normal/datetime.c \ + normal/completion.c normal/misc.c \ + normal/handler.c normal/autofs.c normal/main.c \ + normal/menu.c \ normal/menu_text.c \ - normal/menu_entry.c normal/menu_viewer.c normal/misc.c \ + normal/menu_entry.c normal/menu_viewer.c \ normal/color.c \ - script/sh/main.c script/sh/execute.c script/sh/function.c \ - script/sh/lexer.c script/sh/script.c \ + script/sh/main.c script/sh/execute.c script/sh/function.c \ + script/sh/lexer.c script/sh/script.c \ partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ @@ -132,6 +133,7 @@ grub_emu_SOURCES = commands/boot.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ + commands/parttool.c parttool/pcpart.c \ grub_script.tab.c grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) From 3262295617e261750f25f580fc8d0fedbb0f4de5 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 14:49:22 +0000 Subject: [PATCH 0917/1707] 2009-07-01 Pavel Roskin * include/grub/elf.h: Define Elf_Sword and Elf_Xword. * kern/i386/dl.c: Use ELF symbols without "32" or "64". * kern/powerpc/dl.c: Likewise. * kern/sparc64/dl.c: Likewise. * kern/x86_64/dl.c: Likewise. --- ChangeLog | 8 ++++++++ include/grub/elf.h | 4 ++++ kern/i386/dl.c | 34 +++++++++++++++++----------------- kern/powerpc/dl.c | 42 +++++++++++++++++++++--------------------- kern/sparc64/dl.c | 46 +++++++++++++++++++++++----------------------- kern/x86_64/dl.c | 6 +++--- 6 files changed, 76 insertions(+), 64 deletions(-) diff --git a/ChangeLog b/ChangeLog index cc94058c4..757f1bbe5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-07-01 Pavel Roskin + + * include/grub/elf.h: Define Elf_Sword and Elf_Xword. + * kern/i386/dl.c: Use ELF symbols without "32" or "64". + * kern/powerpc/dl.c: Likewise. + * kern/sparc64/dl.c: Likewise. + * kern/x86_64/dl.c: Likewise. + 2009-07-01 Robert Millan Fix grub-emu build on sparc64-ieee1275. diff --git a/include/grub/elf.h b/include/grub/elf.h index 49570a60e..1a1ec1310 100644 --- a/include/grub/elf.h +++ b/include/grub/elf.h @@ -2340,8 +2340,10 @@ typedef Elf32_Rel Elf_Rel; typedef Elf32_Rela Elf_Rela; typedef Elf32_Section Elf_Section; typedef Elf32_Shdr Elf_Shdr; +typedef Elf32_Sword Elf_Sword; typedef Elf32_Sym Elf_Sym; typedef Elf32_Word Elf_Word; +typedef Elf32_Xword Elf_Xword; #define ELF_ST_BIND(val) ELF32_ST_BIND(val) #define ELF_ST_TYPE(val) ELF32_ST_TYPE(val) @@ -2359,8 +2361,10 @@ typedef Elf64_Rel Elf_Rel; typedef Elf64_Rela Elf_Rela; typedef Elf64_Section Elf_Section; typedef Elf64_Shdr Elf_Shdr; +typedef Elf64_Sword Elf_Sword; typedef Elf64_Sym Elf_Sym; typedef Elf64_Word Elf_Word; +typedef Elf64_Xword Elf_Xword; #define ELF_ST_BIND(val) ELF64_ST_BIND (val) #define ELF_ST_TYPE(val) ELF64_ST_TYPE (val) diff --git a/kern/i386/dl.c b/kern/i386/dl.c index a17f17576..91121f614 100644 --- a/kern/i386/dl.c +++ b/kern/i386/dl.c @@ -26,7 +26,7 @@ grub_err_t grub_arch_dl_check_header (void *ehdr) { - Elf32_Ehdr *e = ehdr; + Elf_Ehdr *e = ehdr; /* Check the magic numbers. */ if (e->e_ident[EI_CLASS] != ELFCLASS32 @@ -41,15 +41,15 @@ grub_arch_dl_check_header (void *ehdr) grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { - Elf32_Ehdr *e = ehdr; - Elf32_Shdr *s; - Elf32_Word entsize; + Elf_Ehdr *e = ehdr; + Elf_Shdr *s; + Elf_Word entsize; unsigned i; /* Find a symbol table. */ - for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; - i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize)) + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_SYMTAB) break; @@ -58,9 +58,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) entsize = s->sh_entsize; - for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; - i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize)) + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_REL) { grub_dl_segment_t seg; @@ -72,32 +72,32 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { - Elf32_Rel *rel, *max; + Elf_Rel *rel, *max; - for (rel = (Elf32_Rel *) ((char *) e + s->sh_offset), + for (rel = (Elf_Rel *) ((char *) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; rel++) { - Elf32_Word *addr; - Elf32_Sym *sym; + Elf_Word *addr; + Elf_Sym *sym; if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset); - sym = (Elf32_Sym *) ((char *) mod->symtab - + entsize * ELF32_R_SYM (rel->r_info)); + addr = (Elf_Word *) ((char *) seg->addr + rel->r_offset); + sym = (Elf_Sym *) ((char *) mod->symtab + + entsize * ELF_R_SYM (rel->r_info)); - switch (ELF32_R_TYPE (rel->r_info)) + switch (ELF_R_TYPE (rel->r_info)) { case R_386_32: *addr += sym->st_value; break; case R_386_PC32: - *addr += (sym->st_value - (Elf32_Word) seg->addr + *addr += (sym->st_value - (Elf_Word) seg->addr - rel->r_offset); break; } diff --git a/kern/powerpc/dl.c b/kern/powerpc/dl.c index 9b1cb1407..2891b0dbb 100644 --- a/kern/powerpc/dl.c +++ b/kern/powerpc/dl.c @@ -26,7 +26,7 @@ grub_err_t grub_arch_dl_check_header (void *ehdr) { - Elf32_Ehdr *e = ehdr; + Elf_Ehdr *e = ehdr; /* Check the magic numbers. */ if (e->e_ident[EI_CLASS] != ELFCLASS32 @@ -42,15 +42,15 @@ grub_arch_dl_check_header (void *ehdr) grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { - Elf32_Ehdr *e = ehdr; - Elf32_Shdr *s; - Elf32_Word entsize; + Elf_Ehdr *e = ehdr; + Elf_Shdr *s; + Elf_Word entsize; unsigned i; /* Find a symbol table. */ - for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; - i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize)) + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_SYMTAB) break; @@ -59,9 +59,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) entsize = s->sh_entsize; - for (i = 0, s = (Elf32_Shdr *) ((char *) e + e->e_shoff); + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; - i++, s = (Elf32_Shdr *) ((char *) s + e->e_shentsize)) + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_RELA) { grub_dl_segment_t seg; @@ -73,37 +73,37 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { - Elf32_Rela *rel, *max; + Elf_Rela *rel, *max; - for (rel = (Elf32_Rela *) ((char *) e + s->sh_offset), + for (rel = (Elf_Rela *) ((char *) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; rel++) { - Elf32_Word *addr; - Elf32_Sym *sym; + Elf_Word *addr; + Elf_Sym *sym; grub_uint32_t value; if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - addr = (Elf32_Word *) ((char *) seg->addr + rel->r_offset); - sym = (Elf32_Sym *) ((char *) mod->symtab - + entsize * ELF32_R_SYM (rel->r_info)); + addr = (Elf_Word *) ((char *) seg->addr + rel->r_offset); + sym = (Elf_Sym *) ((char *) mod->symtab + + entsize * ELF_R_SYM (rel->r_info)); /* On the PPC the value does not have an explicit addend, add it. */ value = sym->st_value + rel->r_addend; - switch (ELF32_R_TYPE (rel->r_info)) + switch (ELF_R_TYPE (rel->r_info)) { case R_PPC_ADDR16_LO: - *(Elf32_Half *) addr = value; + *(Elf_Half *) addr = value; break; case R_PPC_REL24: { - Elf32_Sword delta = value - (Elf32_Word) addr; + Elf_Sword delta = value - (Elf_Word) addr; if (delta << 6 >> 6 != delta) return grub_error (GRUB_ERR_BAD_MODULE, "Relocation overflow"); @@ -112,7 +112,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) } case R_PPC_ADDR16_HA: - *(Elf32_Half *) addr = (value + 0x8000) >> 16; + *(Elf_Half *) addr = (value + 0x8000) >> 16; break; case R_PPC_ADDR32: @@ -120,13 +120,13 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) break; case R_PPC_REL32: - *addr = value - (Elf32_Word) addr; + *addr = value - (Elf_Word) addr; break; default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "This relocation (%d) is not implemented yet", - ELF32_R_TYPE (rel->r_info)); + ELF_R_TYPE (rel->r_info)); } } } diff --git a/kern/sparc64/dl.c b/kern/sparc64/dl.c index 533489677..a4d99ff08 100644 --- a/kern/sparc64/dl.c +++ b/kern/sparc64/dl.c @@ -26,7 +26,7 @@ grub_err_t grub_arch_dl_check_header (void *ehdr) { - Elf64_Ehdr *e = ehdr; + Elf_Ehdr *e = ehdr; /* Check the magic numbers. */ if (e->e_ident[EI_CLASS] != ELFCLASS64 @@ -42,15 +42,15 @@ grub_arch_dl_check_header (void *ehdr) grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) { - Elf64_Ehdr *e = ehdr; - Elf64_Shdr *s; - Elf64_Word entsize; + Elf_Ehdr *e = ehdr; + Elf_Shdr *s; + Elf_Word entsize; unsigned i; /* Find a symbol table. */ - for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; - i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize)) + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_SYMTAB) break; @@ -59,9 +59,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) entsize = s->sh_entsize; - for (i = 0, s = (Elf64_Shdr *) ((char *) e + e->e_shoff); + for (i = 0, s = (Elf_Shdr *) ((char *) e + e->e_shoff); i < e->e_shnum; - i++, s = (Elf64_Shdr *) ((char *) s + e->e_shentsize)) + i++, s = (Elf_Shdr *) ((char *) s + e->e_shentsize)) if (s->sh_type == SHT_RELA) { grub_dl_segment_t seg; @@ -73,27 +73,27 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) if (seg) { - Elf64_Rela *rel, *max; + Elf_Rela *rel, *max; - for (rel = (Elf64_Rela *) ((char *) e + s->sh_offset), + for (rel = (Elf_Rela *) ((char *) e + s->sh_offset), max = rel + s->sh_size / s->sh_entsize; rel < max; rel++) { - Elf64_Word *addr; - Elf64_Sym *sym; - Elf64_Addr value; + Elf_Word *addr; + Elf_Sym *sym; + Elf_Addr value; if (seg->size < rel->r_offset) return grub_error (GRUB_ERR_BAD_MODULE, "reloc offset is out of the segment"); - addr = (Elf64_Word *) ((char *) seg->addr + rel->r_offset); - sym = (Elf64_Sym *) ((char *) mod->symtab - + entsize * ELF64_R_SYM (rel->r_info)); + addr = (Elf_Word *) ((char *) seg->addr + rel->r_offset); + sym = (Elf_Sym *) ((char *) mod->symtab + + entsize * ELF_R_SYM (rel->r_info)); value = sym->st_value + rel->r_addend; - switch (ELF64_R_TYPE (rel->r_info) & 0xff) + switch (ELF_R_TYPE (rel->r_info) & 0xff) { case R_SPARC_32: /* 3 V-word32 */ if (value & 0xFFFFFFFF00000000) @@ -102,13 +102,13 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) *addr = value; break; case R_SPARC_WDISP30: /* 7 V-disp30 */ - if (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000) && - (((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000) + if (((value - (Elf_Addr) addr) & 0xFFFFFFFF00000000) && + (((value - (Elf_Addr) addr) & 0xFFFFFFFF00000000) != 0xFFFFFFFF00000000)) return grub_error (GRUB_ERR_BAD_MODULE, "Displacement out of 30 bits range"); *addr = (*addr & 0xC0000000) | - (((grub_int32_t) ((value - (Elf64_Addr) addr) >> 2)) & + (((grub_int32_t) ((value - (Elf_Addr) addr) >> 2)) & 0x3FFFFFFF); break; case R_SPARC_HI22: /* 9 V-imm22 */ @@ -121,18 +121,18 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) *addr = (*addr & 0xFFFFFC00) | (value & 0x3FF); break; case R_SPARC_64: /* 32 V-xwords64 */ - *(Elf64_Xword *) addr = value; + *(Elf_Xword *) addr = value; break; case R_SPARC_OLO10: *addr = (*addr & ~0x1fff) | (((value & 0x3ff) + - (ELF64_R_TYPE (rel->r_info) >> 8)) + (ELF_R_TYPE (rel->r_info) >> 8)) & 0x1fff); break; default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "This relocation (%d) is not implemented yet", - ELF64_R_TYPE (rel->r_info)); + ELF_R_TYPE (rel->r_info)); } } } diff --git a/kern/x86_64/dl.c b/kern/x86_64/dl.c index 9e5de6e09..73a7337e7 100644 --- a/kern/x86_64/dl.c +++ b/kern/x86_64/dl.c @@ -90,9 +90,9 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) addr32 = (Elf64_Word *) ((char *) seg->addr + rel->r_offset); addr64 = (Elf64_Xword *) addr32; sym = (Elf64_Sym *) ((char *) mod->symtab - + entsize * ELF64_R_SYM (rel->r_info)); + + entsize * ELF_R_SYM (rel->r_info)); - switch (ELF64_R_TYPE (rel->r_info)) + switch (ELF_R_TYPE (rel->r_info)) { case R_X86_64_64: *addr64 += rel->r_addend + sym->st_value; @@ -109,7 +109,7 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) break; default: - grub_fatal ("Unrecognized relocation: %d\n", ELF64_R_TYPE (rel->r_info)); + grub_fatal ("Unrecognized relocation: %d\n", ELF_R_TYPE (rel->r_info)); } } } From 2ef0084d8065a40dfab5d35881ea558880bc41c6 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 15:39:21 +0000 Subject: [PATCH 0918/1707] 2009-07-01 Pavel Roskin * kern/mm.c: Use correct format to print size_t. --- ChangeLog | 2 ++ kern/mm.c | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 757f1bbe5..38d3a8a98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-01 Pavel Roskin + * kern/mm.c: Use correct format to print size_t. + * include/grub/elf.h: Define Elf_Sword and Elf_Xword. * kern/i386/dl.c: Use ELF symbols without "32" or "64". * kern/powerpc/dl.c: Likewise. diff --git a/kern/mm.c b/kern/mm.c index a31dc2efd..9a0ae56ed 100644 --- a/kern/mm.c +++ b/kern/mm.c @@ -515,7 +515,7 @@ grub_debug_malloc (const char *file, int line, grub_size_t size) void *ptr; if (grub_mm_debug) - grub_printf ("%s:%d: malloc (0x%x) = ", file, line, size); + grub_printf ("%s:%d: malloc (0x%zx) = ", file, line, size); ptr = grub_malloc (size); if (grub_mm_debug) grub_printf ("%p\n", ptr); @@ -534,7 +534,7 @@ void * grub_debug_realloc (const char *file, int line, void *ptr, grub_size_t size) { if (grub_mm_debug) - grub_printf ("%s:%d: realloc (%p, 0x%x) = ", file, line, ptr, size); + grub_printf ("%s:%d: realloc (%p, 0x%zx) = ", file, line, ptr, size); ptr = grub_realloc (ptr, size); if (grub_mm_debug) grub_printf ("%p\n", ptr); @@ -548,7 +548,7 @@ grub_debug_memalign (const char *file, int line, grub_size_t align, void *ptr; if (grub_mm_debug) - grub_printf ("%s:%d: memalign (0x%x, 0x%x) = ", + grub_printf ("%s:%d: memalign (0x%zx, 0x%zx) = ", file, line, align, size); ptr = grub_memalign (align, size); if (grub_mm_debug) From 1b96e952494e36b91b4e927001a96fae9c0c60e5 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 15:59:05 +0000 Subject: [PATCH 0919/1707] 2009-07-01 Pavel Roskin * util/misc.c: Move grub_reboot() and grub_halt() ... * util/grub-emu.c: ... here. Make main_env static. * include/grub/util/misc.h: Remove main_env. --- ChangeLog | 4 ++++ include/grub/util/misc.h | 1 - util/grub-emu.c | 18 +++++++++++++++++- util/misc.c | 16 ---------------- 4 files changed, 21 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38d3a8a98..d1772af1d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-01 Pavel Roskin + * util/misc.c: Move grub_reboot() and grub_halt() ... + * util/grub-emu.c: ... here. Make main_env static. + * include/grub/util/misc.h: Remove main_env. + * kern/mm.c: Use correct format to print size_t. * include/grub/elf.h: Define Elf_Sword and Elf_Xword. diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h index af7cb2dbd..6a93ab044 100644 --- a/include/grub/util/misc.h +++ b/include/grub/util/misc.h @@ -38,7 +38,6 @@ extern char *progname; extern int verbosity; -extern jmp_buf main_env; void grub_util_warn (const char *fmt, ...); void grub_util_info (const char *fmt, ...); diff --git a/util/grub-emu.c b/util/grub-emu.c index c133dbead..31365f3e0 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -40,7 +40,7 @@ #include /* Used for going back to the main function. */ -jmp_buf main_env; +static jmp_buf main_env; /* Store the prefix specified by an argument. */ static char *prefix = 0; @@ -68,6 +68,22 @@ grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr) return GRUB_ERR_BAD_MODULE; } +void +grub_reboot (void) +{ + longjmp (main_env, 1); +} + +void +grub_halt ( +#ifdef GRUB_MACHINE_PCBIOS + int no_apm __attribute__ ((unused)) +#endif + ) +{ + grub_reboot (); +} + void grub_machine_init (void) { diff --git a/util/misc.c b/util/misc.c index 2d0039028..f615a42c7 100644 --- a/util/misc.c +++ b/util/misc.c @@ -439,19 +439,3 @@ fail: } #endif /* __MINGW32__ */ - -void -grub_reboot (void) -{ - longjmp (main_env, 1); -} - -void -grub_halt ( -#ifdef GRUB_MACHINE_PCBIOS - int no_apm __attribute__ ((unused)) -#endif - ) -{ - grub_reboot (); -} From c8d229882a472be288de144555bbec4ec8eed20b Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 16:00:34 +0000 Subject: [PATCH 0920/1707] 2009-07-01 Pavel Roskin * kern/dl.c (grub_dl_resolve_symbol): Make static. * include/grub/dl.h: Remove grub_dl_resolve_symbol(). --- ChangeLog | 3 +++ include/grub/dl.h | 1 - kern/dl.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index d1772af1d..589d1ae18 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-01 Pavel Roskin + * kern/dl.c (grub_dl_resolve_symbol): Make static. + * include/grub/dl.h: Remove grub_dl_resolve_symbol(). + * util/misc.c: Move grub_reboot() and grub_halt() ... * util/grub-emu.c: ... here. Make main_env static. * include/grub/util/misc.h: Remove main_env. diff --git a/include/grub/dl.h b/include/grub/dl.h index bebb810a8..e24b832d0 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -113,7 +113,6 @@ void EXPORT_FUNC(grub_dl_iterate) (int (*hook) (grub_dl_t mod)); grub_dl_t EXPORT_FUNC(grub_dl_get) (const char *name); grub_err_t EXPORT_FUNC(grub_dl_register_symbol) (const char *name, void *addr, grub_dl_t mod); -void *EXPORT_FUNC(grub_dl_resolve_symbol) (const char *name); grub_err_t grub_arch_dl_check_header (void *ehdr); grub_err_t grub_arch_dl_relocate_symbols (grub_dl_t mod, void *ehdr); diff --git a/kern/dl.c b/kern/dl.c index af4e5aa89..6c863be6f 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -133,7 +133,7 @@ grub_symbol_hash (const char *s) /* Resolve the symbol name NAME and return the address. Return NULL, if not found. */ -void * +static void * grub_dl_resolve_symbol (const char *name) { grub_symbol_t sym; From 6f41557fb130de069035c0f40ac6ac9fcb166ff8 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 22:47:28 +0000 Subject: [PATCH 0921/1707] 2009-07-01 Pavel Roskin * Makefile.in: When installing symlinks, use "cp -fR", which works on FreeBSD and MacOSX. From Yves Blusseau --- ChangeLog | 4 ++++ Makefile.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 589d1ae18..b45015b75 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-01 Pavel Roskin + * Makefile.in: When installing symlinks, use "cp -fR", which + works on FreeBSD and MacOSX. + From Yves Blusseau + * kern/dl.c (grub_dl_resolve_symbol): Make static. * include/grub/dl.h: Remove grub_dl_resolve_symbol(). diff --git a/Makefile.in b/Makefile.in index f82566a70..54a05d629 100644 --- a/Makefile.in +++ b/Makefile.in @@ -229,7 +229,7 @@ install-local: all $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ elif test -L "$$dir$$file"; then \ rm -rf $(DESTDIR)$(includedir)/$$dest && \ - cp -fP $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ + cp -fR $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ fi; \ done $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) From 999577f13ccab554a2adb36264df2b23e968c594 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 22:48:38 +0000 Subject: [PATCH 0922/1707] 2009-07-01 Pavel Roskin * Makefile.in: Install include/grub/machine symlink. --- ChangeLog | 2 ++ Makefile.in | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b45015b75..7bd06b149 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-01 Pavel Roskin + * Makefile.in: Install include/grub/machine symlink. + * Makefile.in: When installing symlinks, use "cp -fR", which works on FreeBSD and MacOSX. From Yves Blusseau diff --git a/Makefile.in b/Makefile.in index 54a05d629..3d208e777 100644 --- a/Makefile.in +++ b/Makefile.in @@ -204,7 +204,8 @@ build_env.mk: Makefile echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\ ) > $@ pkglib_BUILDDIR += config.h grub_script.tab.h -include_DATA += $(shell find $(srcdir)/include -name \*.h | sed -e "s,^$(srcdir)/,,g") include/grub/cpu +include_DATA += $(shell find $(srcdir)/include -name \*.h | sed -e "s,^$(srcdir)/,,g") \ + include/grub/cpu include/grub/machine all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) From 0df634200a77048e5d738f3f7a7e65d114453a17 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 22:56:51 +0000 Subject: [PATCH 0923/1707] 2009-07-01 Pavel Roskin * util/hostdisk.c (device_is_wholedisk): Compile only on systems where it's needed. --- ChangeLog | 3 +++ util/hostdisk.c | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index 7bd06b149..f64edf44e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-01 Pavel Roskin + * util/hostdisk.c (device_is_wholedisk): Compile only on systems + where it's needed. + * Makefile.in: Install include/grub/machine symlink. * Makefile.in: When installing symlinks, use "cp -fR", which diff --git a/util/hostdisk.c b/util/hostdisk.c index 1844a7e55..46afc3882 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -833,6 +833,7 @@ convert_system_partition_to_system_disk (const char *os_dev) #endif } +#if defined(__linux__) || defined(__CYGWIN__) static int device_is_wholedisk (const char *os_dev) { @@ -842,6 +843,7 @@ device_is_wholedisk (const char *os_dev) return 1; return 0; } +#endif static int find_system_device (const char *os_dev) From c6cd3ef02218938b4df7a0cd72b4b0415e211583 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 23:07:17 +0000 Subject: [PATCH 0924/1707] 2009-07-01 Pavel Roskin * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Make `p' constant to avoid a warning on FreeBSD. --- ChangeLog | 3 +++ util/hostdisk.c | 3 ++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f64edf44e..d151d9b42 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-01 Pavel Roskin + * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Make `p' + constant to avoid a warning on FreeBSD. + * util/hostdisk.c (device_is_wholedisk): Compile only on systems where it's needed. diff --git a/util/hostdisk.c b/util/hostdisk.c index 46afc3882..40052653a 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -1047,7 +1047,8 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) if (strncmp ("/dev/", os_dev, 5) == 0) { - char *p, *q; + const char *p; + char *q; long int n; for (p = os_dev + 5; *p; ++p) From c94b18a9e575aa5bfafd25e3473e665abc8b41f7 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 23:38:40 +0000 Subject: [PATCH 0925/1707] 2009-07-01 Pavel Roskin * include/grub/types.h: Define GRUB_LONG_MAX and GRUB_LONG_MIN using signed long int constants. --- ChangeLog | 3 +++ include/grub/types.h | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index d151d9b42..8af6cd441 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-01 Pavel Roskin + * include/grub/types.h: Define GRUB_LONG_MAX and GRUB_LONG_MIN + using signed long int constants. + * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Make `p' constant to avoid a warning on FreeBSD. diff --git a/include/grub/types.h b/include/grub/types.h index 3eb8290af..8e2ad15ef 100644 --- a/include/grub/types.h +++ b/include/grub/types.h @@ -102,12 +102,12 @@ typedef grub_int32_t grub_ssize_t; #if GRUB_CPU_SIZEOF_VOID_P == 8 # define GRUB_ULONG_MAX 18446744073709551615UL -# define GRUB_LONG_MAX 9223372036854775807UL -# define GRUB_LONG_MIN -9223372036854775808UL +# define GRUB_LONG_MAX 9223372036854775807L +# define GRUB_LONG_MIN (-9223372036854775807L - 1) #else # define GRUB_ULONG_MAX 4294967295UL -# define GRUB_LONG_MAX 2147483647UL -# define GRUB_LONG_MIN -2147483648UL +# define GRUB_LONG_MAX 2147483647L +# define GRUB_LONG_MIN (-2147483647L - 1) #endif #if GRUB_CPU_SIZEOF_VOID_P == 4 From d23af54ef462a98a74a284f398a42ba519d02cf7 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 1 Jul 2009 23:58:30 +0000 Subject: [PATCH 0926/1707] 2009-07-01 Pavel Roskin * util/hostdisk.c (open_device): Remove `const' from `sysctl_size', as sysctlbyname() can change it (in this case it doesn't actually happen). --- ChangeLog | 4 ++++ util/hostdisk.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8af6cd441..3ea8033a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-01 Pavel Roskin + * util/hostdisk.c (open_device): Remove `const' from + `sysctl_size', as sysctlbyname() can change it (in this case it + doesn't actually happen). + * include/grub/types.h: Define GRUB_LONG_MAX and GRUB_LONG_MIN using signed long int constants. diff --git a/util/hostdisk.c b/util/hostdisk.c index 40052653a..d84e7f3bf 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -344,7 +344,7 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) #else /* ! __linux__ */ #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) int sysctl_flags, sysctl_oldflags; - const size_t sysctl_size = sizeof (sysctl_flags); + size_t sysctl_size = sizeof (sysctl_flags); if (sysctlbyname ("kern.geom.debugflags", &sysctl_oldflags, &sysctl_size, NULL, 0)) { From 87a7339e7a47885132cf39ba306447ff0be82ab0 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 2 Jul 2009 00:21:07 +0000 Subject: [PATCH 0927/1707] 2009-07-01 Pavel Roskin * kern/x86_64/efi/callwrap.S: Add missing newline at the end. --- ChangeLog | 2 ++ kern/x86_64/efi/callwrap.S | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 3ea8033a9..e6a3c06e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-01 Pavel Roskin + * kern/x86_64/efi/callwrap.S: Add missing newline at the end. + * util/hostdisk.c (open_device): Remove `const' from `sysctl_size', as sysctlbyname() can change it (in this case it doesn't actually happen). diff --git a/kern/x86_64/efi/callwrap.S b/kern/x86_64/efi/callwrap.S index 558d28061..1946732ae 100644 --- a/kern/x86_64/efi/callwrap.S +++ b/kern/x86_64/efi/callwrap.S @@ -113,4 +113,4 @@ FUNCTION(efi_wrap_10) mov %rsi, %rcx call *%rdi addq $88, %rsp - ret \ No newline at end of file + ret From b2582ec99ceb1970131e2f526f2837ce356ab4c4 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 2 Jul 2009 04:12:23 +0000 Subject: [PATCH 0928/1707] 2009-07-02 Pavel Roskin * genparttoollist.sh: Add missing newline at the end. --- ChangeLog | 4 ++++ genparttoollist.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e6a3c06e0..60ca2d8ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-07-02 Pavel Roskin + + * genparttoollist.sh: Add missing newline at the end. + 2009-07-01 Pavel Roskin * kern/x86_64/efi/callwrap.S: Add missing newline at the end. diff --git a/genparttoollist.sh b/genparttoollist.sh index c7ffc81b6..48a0efe55 100644 --- a/genparttoollist.sh +++ b/genparttoollist.sh @@ -16,4 +16,4 @@ module=$1 grep -v "^#" | sed -n \ - -e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" \ No newline at end of file + -e "/grub_parttool_register *( *\"/{s/.*( *\"\([^\"]*\)\".*/\1: $module/;p;}" From 2da922955011aed47033f62f13f823883743d362 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 4 Jul 2009 16:29:01 +0000 Subject: [PATCH 0929/1707] 2009-07-04 Robert Millan * include/grub/i386/linux.h (struct linux_kernel_params): Add `capabilities' member. --- ChangeLog | 5 +++++ include/grub/i386/linux.h | 3 +-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 60ca2d8ee..b7fb17535 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-04 Robert Millan + + * include/grub/i386/linux.h (struct linux_kernel_params): Add + `capabilities' member. + 2009-07-02 Pavel Roskin * genparttoollist.sh: Add missing newline at the end. diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index cf110973e..cee46c63d 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -174,8 +174,7 @@ struct linux_kernel_params grub_uint16_t vesapm_offset; /* 30 */ grub_uint16_t lfb_pages; /* 32 */ grub_uint16_t vesa_attrib; /* 34 */ - - grub_uint8_t padding3[0x40 - 0x36]; + grub_uint32_t capabilities; /* 36 */ grub_uint16_t apm_version; /* 40 */ grub_uint16_t apm_code_segment; /* 42 */ From b4a1dc7990388721c2603581c51092981e31a5e3 Mon Sep 17 00:00:00 2001 From: bean Date: Sun, 5 Jul 2009 09:59:27 +0000 Subject: [PATCH 0930/1707] 2009-07-05 Bean * conf/common.rmk (lua_mode_SOURCES): Add script/lua/lstrlib.c. * script/lua/grub_lib.c (grub_lua_run): Check input parameter. (grub_lua_getenv): Likewise. (grub_lua_setenv): Likewise. (save_errno): New function. (push_result): Likewise. (grub_lua_enum_device): Likewise. (grub_lua_enum_file): Likewise. (grub_lua_file_open): Likewise. (grub_lua_file_close): Likewise. (grub_lua_file_seek): Likewise. (grub_lua_file_read): Likewise. (grub_lua_file_getline): Likewise. (grub_lua_file_getsize): Likewise. (grub_lua_file_getpos): Likewise. (grub_lua_file_eof): Likewise. (grub_lua_file_exist): Likewise. (grub_lua_add_menu): Likewise. * script/lua/grub_lua.h (isupper): New inline function. (islower): Likewise. (ispunct): Likewise. (isxdigit): Likewise. (strcspn): Change to normal function. (strpbkr): New function declaration. (memchr): Likewise. * script/lua/grub_main.c (scan_str): New function. (strcspn): Likewise. (strpbrk): Likewise. (memchr): Likewise. * script/lua/linit.c (lualibs): Enable the string library. * util/osdetect.lua: New file. --- ChangeLog | 39 +++++ conf/common.rmk | 5 +- script/lua/grub_lib.c | 372 ++++++++++++++++++++++++++++++++++++++--- script/lua/grub_lua.h | 38 +++-- script/lua/grub_main.c | 55 ++++++ script/lua/linit.c | 2 +- util/osdetect.lua | 111 ++++++++++++ 7 files changed, 581 insertions(+), 41 deletions(-) create mode 100644 util/osdetect.lua diff --git a/ChangeLog b/ChangeLog index b7fb17535..d081eccd0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,42 @@ +2009-07-05 Bean + + * conf/common.rmk (lua_mode_SOURCES): Add script/lua/lstrlib.c. + + * script/lua/grub_lib.c (grub_lua_run): Check input parameter. + (grub_lua_getenv): Likewise. + (grub_lua_setenv): Likewise. + (save_errno): New function. + (push_result): Likewise. + (grub_lua_enum_device): Likewise. + (grub_lua_enum_file): Likewise. + (grub_lua_file_open): Likewise. + (grub_lua_file_close): Likewise. + (grub_lua_file_seek): Likewise. + (grub_lua_file_read): Likewise. + (grub_lua_file_getline): Likewise. + (grub_lua_file_getsize): Likewise. + (grub_lua_file_getpos): Likewise. + (grub_lua_file_eof): Likewise. + (grub_lua_file_exist): Likewise. + (grub_lua_add_menu): Likewise. + + * script/lua/grub_lua.h (isupper): New inline function. + (islower): Likewise. + (ispunct): Likewise. + (isxdigit): Likewise. + (strcspn): Change to normal function. + (strpbkr): New function declaration. + (memchr): Likewise. + + * script/lua/grub_main.c (scan_str): New function. + (strcspn): Likewise. + (strpbrk): Likewise. + (memchr): Likewise. + + * script/lua/linit.c (lualibs): Enable the string library. + + * util/osdetect.lua: New file. + 2009-07-04 Robert Millan * include/grub/i386/linux.h (struct linux_kernel_params): Add diff --git a/conf/common.rmk b/conf/common.rmk index 9cd4b93a4..07ff04e4d 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -519,15 +519,14 @@ lua_mod_SOURCES = script/lua/lapi.c script/lua/lcode.c script/lua/ldebug.c \ script/lua/lstate.c script/lua/lstring.c script/lua/ltable.c \ script/lua/ltm.c script/lua/lundump.c script/lua/lvm.c \ script/lua/lzio.c script/lua/lauxlib.c script/lua/lbaselib.c \ - script/lua/linit.c script/lua/ltablib.c \ + script/lua/linit.c script/lua/ltablib.c script/lua/lstrlib.c \ script/lua/grub_main.c script/lua/grub_lib.c lua_mod_CFLAGS = $(COMMON_CFLAGS) lua_mod_LDFLAGS = $(COMMON_LDFLAGS) # Extra libraries for lua # script/lua/lmathlib.c script/lua/loslib.c script/lua/liolib.c -# script/lua/lstrlib.c script/lua/ldblib.c script/lua/ltablib.c -# script/lua/loadlib.c +# script/lua/ldblib.c script/lua/loadlib.c # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ diff --git a/script/lua/grub_lib.c b/script/lua/grub_lib.c index 0295f0dcc..d26f19337 100644 --- a/script/lua/grub_lib.c +++ b/script/lua/grub_lib.c @@ -24,18 +24,47 @@ #include #include #include +#include +#include +#include + +static int +save_errno (lua_State *state) +{ + int saved_errno; + + saved_errno = grub_errno; + grub_errno = 0; + + lua_pushinteger (state, saved_errno); + lua_setfield (state, LUA_GLOBALSINDEX, "grub_errno"); + + if (saved_errno) + lua_pushstring (state, grub_errmsg); + else + lua_pushnil (state); + + lua_setfield (state, LUA_GLOBALSINDEX, "grub_errmsg"); + + return saved_errno; +} + +static int +push_result (lua_State *state) +{ + lua_pushinteger (state, save_errno (state)); + return 1; +} static int grub_lua_run (lua_State *state) { int n; char **args; - grub_err_t result; + const char *s; - if (! lua_gettop(state)) - return 0; - - if ((! grub_parser_split_cmdline (lua_tostring (state, 1), 0, &n, &args)) + s = luaL_checkstring (state, 1); + if ((! grub_parser_split_cmdline (s, 0, &n, &args)) && (n >= 0)) { grub_command_t cmd; @@ -50,15 +79,7 @@ grub_lua_run (lua_State *state) grub_free (args); } - result = grub_errno; - grub_errno = 0; - - lua_pushinteger(state, result); - - if (result) - lua_pushstring (state, grub_errmsg); - - return (result) ? 2 : 1; + return push_result (state); } static int @@ -66,12 +87,12 @@ grub_lua_getenv (lua_State *state) { int n, i; - n = lua_gettop(state); + n = lua_gettop (state); for (i = 1; i <= n; i++) { const char *name, *value; - name = lua_tostring (state, i); + name = luaL_checkstring (state, i); value = grub_env_get (name); if (value) lua_pushstring (state, value); @@ -87,11 +108,8 @@ grub_lua_setenv (lua_State *state) { const char *name, *value; - if (lua_gettop(state) != 2) - return 0; - - name = lua_tostring (state, 1); - value = lua_tostring (state, 2); + name = luaL_checkstring (state, 1); + value = luaL_checkstring (state, 2); if (name[0]) grub_env_set (name, value); @@ -99,10 +117,322 @@ grub_lua_setenv (lua_State *state) return 0; } +static int +grub_lua_enum_device (lua_State *state) +{ + auto int enum_device (const char *name); + int enum_device (const char *name) + { + int result; + grub_device_t dev; + + result = 0; + dev = grub_device_open (name); + if (dev) + { + grub_fs_t fs; + + fs = grub_fs_probe (dev); + if (fs) + { + lua_pushvalue (state, 1); + lua_pushstring (state, name); + lua_pushstring (state, fs->name); + if (! fs->uuid) + lua_pushnil (state); + else + { + int err; + char *uuid; + + err = fs->uuid (dev, &uuid); + if (err) + { + grub_errno = 0; + lua_pushnil (state); + } + else + { + lua_pushstring (state, uuid); + grub_free (uuid); + } + } + + lua_call (state, 3, 1); + result = lua_tointeger (state, -1); + lua_pop (state, 1); + } + else + grub_errno = 0; + grub_device_close (dev); + } + else + grub_errno = 0; + + return result; + } + + luaL_checktype (state, 1, LUA_TFUNCTION); + grub_device_iterate (enum_device); + return push_result (state); +} + +static int +grub_lua_enum_file (lua_State *state) +{ + char *device_name; + const char *arg; + grub_device_t dev; + + auto int enum_file (const char *name, const struct grub_dirhook_info *info); + int enum_file (const char *name, const struct grub_dirhook_info *info) + { + int result; + + lua_pushvalue (state, 1); + lua_pushstring (state, name); + lua_pushinteger (state, info->dir != 0); + lua_call (state, 2, 1); + result = lua_tointeger (state, -1); + lua_pop (state, 1); + + return result; + } + + luaL_checktype (state, 1, LUA_TFUNCTION); + arg = luaL_checkstring (state, 2); + device_name = grub_file_get_device_name (arg); + dev = grub_device_open (device_name); + if (dev) + { + grub_fs_t fs; + const char *path; + + fs = grub_fs_probe (dev); + path = grub_strchr (arg, ')'); + if (! path) + path = arg; + else + path++; + + if (fs) + { + (fs->dir) (dev, path, enum_file); + } + + grub_device_close (dev); + } + + grub_free (device_name); + + return push_result (state); +} + +static int +grub_lua_file_open (lua_State *state) +{ + grub_file_t file; + const char *name; + + name = luaL_checkstring (state, 1); + file = grub_file_open (name); + save_errno (state); + + if (! file) + return 0; + + lua_pushlightuserdata (state, file); + return 1; +} + +static int +grub_lua_file_close (lua_State *state) +{ + grub_file_t file; + + luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); + file = lua_touserdata (state, 1); + grub_file_close (file); + + return push_result (state); +} + +static int +grub_lua_file_seek (lua_State *state) +{ + grub_file_t file; + grub_off_t offset; + + luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); + file = lua_touserdata (state, 1); + offset = luaL_checkinteger (state, 2); + + offset = grub_file_seek (file, offset); + save_errno (state); + + lua_pushinteger (state, offset); + return 1; +} + +static int +grub_lua_file_read (lua_State *state) +{ + grub_file_t file; + luaL_Buffer b; + int n; + + luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); + file = lua_touserdata (state, 1); + n = luaL_checkinteger (state, 2); + + luaL_buffinit (state, &b); + while (n) + { + char *p; + int nr; + + nr = (n > LUAL_BUFFERSIZE) ? LUAL_BUFFERSIZE : n; + p = luaL_prepbuffer (&b); + + nr = grub_file_read (file, p, nr); + if (nr <= 0) + break; + + luaL_addsize (&b, nr); + n -= nr; + } + + save_errno (state); + luaL_pushresult (&b); + return 1; +} + +static int +grub_lua_file_getline (lua_State *state) +{ + grub_file_t file; + char *line; + + luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); + file = lua_touserdata (state, 1); + + line = grub_file_getline (file); + save_errno (state); + + if (! line) + return 0; + + lua_pushstring (state, line); + grub_free (line); + return 1; +} + +static int +grub_lua_file_getsize (lua_State *state) +{ + grub_file_t file; + + luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); + file = lua_touserdata (state, 1); + + lua_pushinteger (state, file->size); + return 1; +} + +static int +grub_lua_file_getpos (lua_State *state) +{ + grub_file_t file; + + luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); + file = lua_touserdata (state, 1); + + lua_pushinteger (state, file->offset); + return 1; +} + +static int +grub_lua_file_eof (lua_State *state) +{ + grub_file_t file; + + luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); + file = lua_touserdata (state, 1); + + lua_pushboolean (state, file->offset >= file->size); + return 1; +} + +static int +grub_lua_file_exist (lua_State *state) +{ + grub_file_t file; + const char *name; + int result; + + result = 0; + name = luaL_checkstring (state, 1); + file = grub_file_open (name); + if (file) + { + result++; + grub_file_close (file); + } + else + grub_errno = 0; + + lua_pushboolean (state, result); + return 1; +} + +static int +grub_lua_add_menu (lua_State *state) +{ + int n; + const char *source; + + source = luaL_checklstring (state, 1, 0); + n = lua_gettop (state) - 1; + if (n > 0) + { + const char *args[sizeof (char *) * n]; + char *p; + int i; + + for (i = 0; i < n; i++) + args[i] = luaL_checkstring (state, 2 + i); + + p = grub_strdup (source); + if (! p) + return push_result (state); + + grub_normal_add_menu_entry (n, args, p); + } + else + { + lua_pushstring (state, "not enough parameter"); + lua_error (state); + } + + return push_result (state); +} + luaL_Reg grub_lua_lib[] = { {"run", grub_lua_run}, {"getenv", grub_lua_getenv}, {"setenv", grub_lua_setenv}, + {"enum_device", grub_lua_enum_device}, + {"enum_file", grub_lua_enum_file}, + {"file_open", grub_lua_file_open}, + {"file_close", grub_lua_file_close}, + {"file_seek", grub_lua_file_seek}, + {"file_read", grub_lua_file_read}, + {"file_getline", grub_lua_file_getline}, + {"file_getsize", grub_lua_file_getsize}, + {"file_getpos", grub_lua_file_getpos}, + {"file_eof", grub_lua_file_eof}, + {"file_exist", grub_lua_file_exist}, + {"add_menu", grub_lua_add_menu}, {0, 0} }; diff --git a/script/lua/grub_lua.h b/script/lua/grub_lua.h index a181b52f1..d5181f147 100644 --- a/script/lua/grub_lua.h +++ b/script/lua/grub_lua.h @@ -77,26 +77,28 @@ iscntrl (int c) } static inline int -strcspn(const char *s1, const char *s2) +isupper (int c) { - int size = 0; + return ((c >= 'A') && (c <= 'Z')); +} - while (*s1) - { - const char *p = s2; +static inline int +islower (int c) +{ + return ((c >= 'a') && (c <= 'z')); +} - while (*p) - { - if (*s1 == *p) - return size; - p++; - } +static inline int +ispunct (int c) +{ + return ((! isspace (c)) && (! isalnum (c))); +} - s1++; - size++; - } - - return size; +static inline int +isxdigit (int c) +{ + return (isdigit (c) || ((c >= 'a') && (c <= 'f')) || + ((c >= 'A') && (c <= 'F'))); } static inline int @@ -105,4 +107,8 @@ abs (int c) return (c >= 0) ? : -c; } +int strcspn (const char *s1, const char *s2); +char *strpbrk (const char *s1, const char *s2); +void *memchr (const void *s, int c, size_t n); + #endif diff --git a/script/lua/grub_main.c b/script/lua/grub_main.c index 03f890a9a..b39141f75 100644 --- a/script/lua/grub_main.c +++ b/script/lua/grub_main.c @@ -24,6 +24,61 @@ #include #include +static const char * +scan_str (const char *s1, const char *s2) +{ + while (*s1) + { + const char *p = s2; + + while (*p) + { + if (*s1 == *p) + return s1; + p++; + } + + s1++; + } + + return s1; +} + +int +strcspn (const char *s1, const char *s2) +{ + const char *r; + + r = scan_str (s1, s2); + return r - s1; +} + +char * +strpbrk (const char *s1, const char *s2) +{ + const char *r; + + r = scan_str (s1, s2); + return (*r) ? (char *) r : 0; +} + +void * +memchr (const void *s, int c, size_t n) +{ + const unsigned char *p = s; + + while (n) + { + if (*p == c) + return (void *) p; + + n--; + p++; + } + + return 0; +} + static lua_State *state; /* Call `grub_error' to report a Lua error. The error message string must be diff --git a/script/lua/linit.c b/script/lua/linit.c index d034a2fbe..f920a0b08 100644 --- a/script/lua/linit.c +++ b/script/lua/linit.c @@ -20,7 +20,7 @@ static const luaL_Reg lualibs[] = { {LUA_TABLIBNAME, luaopen_table}, // {LUA_IOLIBNAME, luaopen_io}, // {LUA_OSLIBNAME, luaopen_os}, -// {LUA_STRLIBNAME, luaopen_string}, + {LUA_STRLIBNAME, luaopen_string}, // {LUA_MATHLIBNAME, luaopen_math}, // {LUA_DBLIBNAME, luaopen_debug}, {NULL, NULL} diff --git a/util/osdetect.lua b/util/osdetect.lua new file mode 100644 index 000000000..c57d61224 --- /dev/null +++ b/util/osdetect.lua @@ -0,0 +1,111 @@ +#!lua +-- +-- Copyright (C) 2009 Free Software Foundation, Inc. +-- +-- GRUB is free software: you can redistribute it and/or modify +-- it under the terms of the GNU General Public License as published by +-- the Free Software Foundation, either version 3 of the License, or +-- (at your option) any later version. +-- +-- GRUB is distributed in the hope that it will be useful, +-- but WITHOUT ANY WARRANTY; without even the implied warranty of +-- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-- GNU General Public License for more details. +-- +-- You should have received a copy of the GNU General Public License +-- along with GRUB. If not, see . +-- + +function enum_device (device, fs, uuid) + local root + local title + local source + local kernels = {} + local kernel_num = 0 + + local function enum_file (name) + local version + + version = string.match (name, "vmlinuz%-(.*)") + if (version ~= nil) then + table.insert (kernels, version) + kernel_num = kernel_num + 1 + end + end + + local function sort_kernel (first, second) + local a1, a2, a3, a4, b1, b2, b3, b4 + + a1, a2, a3, a4 = string.match (first, "(%d+)%.?(%d*).?(%d*)%-?(%d*)") + b1, b2, b3, b4 = string.match (second, "(%d+)%.?(%d*).?(%d*)%-?(%d*)") + return (a1 > b1) or (a2 > b2) or (a3 > b3) or (a4 < b4); + end + + root = "(" .. device .. ")/" + source = "root (" .. device .. ")\nchainloader +1" + title = nil + if (grub.file_exist (root .. "bootmgr") and + grub.file_exist (root .. "boot/bcd")) then + title = "Windows Vista bootmgr" + elseif (grub.file_exist (root .. "ntldr") and + grub.file_exist (root .. "ntdetect.com") and + grub.file_exist (root .. "boot.ini")) then + title = "Windows NT/2000/XP loader" + elseif (grub.file_exist (root .. "windows/win.com")) then + title = "Windows 98/ME" + elseif (grub.file_exist (root .. "io.sys") and + grub.file_exist (root .. "command.com")) then + title = "MS-DOS" + elseif (grub.file_exist (root .. "kernel.sys")) then + title = "FreeDOS" + elseif (grub.file_exist (root .. "boot/loader") and + grub.file_exist (root .. "boot/devices.hints")) then + source = "root (" .. device .. ")\nfreebsd /boot/loader" .. + "\nfreebsd_loadenv /boot/device.hints" + title = "FreeBSD" + else + grub.enum_file (enum_file, root .. "boot") + if kernel_num ~= 0 then + table.sort (kernels, sort_kernel) + for i = 1, kernel_num do + local initrd + + title = "Linux " .. kernels[i] + source = "root (" .. device .. + ")\nlinux /boot/vmlinuz-" .. kernels[i] .. + " root=UUID=" .. uuid .. " ro" + + if grub.file_exist (root .. "boot/initrd-" .. + kernels[i] .. ".img") then + initrd = "\ninitrd /boot/initrd-" .. kernels[i] .. ".img" + elseif grub.file_exist (root .. "boot/initrd.img-" .. kernels[i]) then + initrd = "\ninitrd /boot/initrd.img-" .. kernels[i] + elseif grub.file_exist (root .. "boot/initrd-" .. kernels[i]) then + initrd = "\ninitrd /boot/initrd-" .. kernels[i] + else + initrd = "" + end + + grub.add_menu (source .. initrd, title) + grub.add_menu (source .. " single" .. initrd, + title .. " (single-user mode)") + end + return 0 + end + end + + if title == nil then + local partition = string.match (device, ".*,(%d+)") + + if (partition ~= nil) and (tonumber (partition) > 4) then + return 0 + end + + title = "Other OS" + end + + grub.add_menu (source, title) + return 0 +end + +grub.enum_device (enum_device) From 46eeb6a26401a4c9a99f04eec1fd5283b1175c3b Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 5 Jul 2009 22:51:05 +0000 Subject: [PATCH 0931/1707] 2009-07-05 Pavel Roskin * util/grub.d/10_freebsd.in: Fix spelling of `device.hints' on FreeBSD. * util/osdetect.lua: Likewise. --- ChangeLog | 6 ++++++ util/grub.d/10_freebsd.in | 4 ++-- util/osdetect.lua | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index d081eccd0..e72f8cd31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-05 Pavel Roskin + + * util/grub.d/10_freebsd.in: Fix spelling of `device.hints' on + FreeBSD. + * util/osdetect.lua: Likewise. + 2009-07-05 Bean * conf/common.rmk (lua_mode_SOURCES): Add script/lua/lstrlib.c. diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 11e3a25c4..2addf03a1 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -26,8 +26,8 @@ case "${GRUB_DISTRIBUTOR}" in *) OS="FreeBSD" ;; esac -if test -e /boot/devices.hints ; then - devices=/boot/devices.hints +if test -e /boot/device.hints ; then + devices=/boot/device.hints fi if test -e /boot/kernel/kernel ; then diff --git a/util/osdetect.lua b/util/osdetect.lua index c57d61224..38a90993d 100644 --- a/util/osdetect.lua +++ b/util/osdetect.lua @@ -59,7 +59,7 @@ function enum_device (device, fs, uuid) elseif (grub.file_exist (root .. "kernel.sys")) then title = "FreeDOS" elseif (grub.file_exist (root .. "boot/loader") and - grub.file_exist (root .. "boot/devices.hints")) then + grub.file_exist (root .. "boot/device.hints")) then source = "root (" .. device .. ")\nfreebsd /boot/loader" .. "\nfreebsd_loadenv /boot/device.hints" title = "FreeBSD" From bab7495862f01aece16d88e70f0fc3e8fcfe6b24 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 6 Jul 2009 02:10:57 +0000 Subject: [PATCH 0932/1707] 2009-07-05 Pavel Roskin * include/grub/i386/linux.h (struct linux_kernel_params): Restore padding3, it's still needed. --- ChangeLog | 3 +++ include/grub/i386/linux.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/ChangeLog b/ChangeLog index e72f8cd31..db77c5d6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-05 Pavel Roskin + * include/grub/i386/linux.h (struct linux_kernel_params): + Restore padding3, it's still needed. + * util/grub.d/10_freebsd.in: Fix spelling of `device.hints' on FreeBSD. * util/osdetect.lua: Likewise. diff --git a/include/grub/i386/linux.h b/include/grub/i386/linux.h index cee46c63d..8a5a84da3 100644 --- a/include/grub/i386/linux.h +++ b/include/grub/i386/linux.h @@ -176,6 +176,8 @@ struct linux_kernel_params grub_uint16_t vesa_attrib; /* 34 */ grub_uint32_t capabilities; /* 36 */ + grub_uint8_t padding3[0x40 - 0x3a]; + grub_uint16_t apm_version; /* 40 */ grub_uint16_t apm_code_segment; /* 42 */ grub_uint32_t apm_entry; /* 44 */ From e110f4dea79c5f1e934b9686e39ada893608d876 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 6 Jul 2009 20:07:58 +0000 Subject: [PATCH 0933/1707] 2009-07-06 Daniel Mierswa * commands/search.c (search_fs): Use grub_strcasecmp() for UUID comparison. --- ChangeLog | 5 +++++ commands/search.c | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index db77c5d6b..521a32c54 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-06 Daniel Mierswa + + * commands/search.c (search_fs): Use grub_strcasecmp() for UUID + comparison. + 2009-07-05 Pavel Roskin * include/grub/i386/linux.h (struct linux_kernel_params): diff --git a/commands/search.c b/commands/search.c index 647f40839..d749bca11 100644 --- a/commands/search.c +++ b/commands/search.c @@ -67,8 +67,10 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) if (dev) { grub_fs_t fs; + int (*compare_fn) (const char *, const char *); fs = grub_fs_probe (dev); + compare_fn = is_uuid ? grub_strcasecmp : grub_strcmp; #define QUID(x) (is_uuid ? (x)->uuid : (x)->label) @@ -79,7 +81,7 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) (QUID(fs)) (dev, &quid); if (grub_errno == GRUB_ERR_NONE && quid) { - if (grub_strcmp (quid, key) == 0) + if (compare_fn (quid, key) == 0) { /* Found! */ count++; From 4a11b60f1054d7524f2b4ed96fa40298314077d9 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 6 Jul 2009 20:13:06 +0000 Subject: [PATCH 0934/1707] 2009-07-06 Pavel Roskin * commands/search.c (search_fs): Replace QUID macro with quid_fn function pointer. --- ChangeLog | 5 +++++ commands/search.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 521a32c54..fd741626a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-06 Pavel Roskin + + * commands/search.c (search_fs): Replace QUID macro with quid_fn + function pointer. + 2009-07-06 Daniel Mierswa * commands/search.c (search_fs): Use grub_strcasecmp() for UUID diff --git a/commands/search.c b/commands/search.c index d749bca11..b29eefb41 100644 --- a/commands/search.c +++ b/commands/search.c @@ -68,17 +68,17 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) { grub_fs_t fs; int (*compare_fn) (const char *, const char *); + grub_err_t (*quid_fn) (grub_device_t, char **); fs = grub_fs_probe (dev); compare_fn = is_uuid ? grub_strcasecmp : grub_strcmp; + quid_fn = is_uuid ? fs->uuid : fs->label; -#define QUID(x) (is_uuid ? (x)->uuid : (x)->label) - - if (fs && QUID(fs)) + if (fs && quid_fn) { char *quid; - (QUID(fs)) (dev, &quid); + quid_fn (dev, &quid); if (grub_errno == GRUB_ERR_NONE && quid) { if (compare_fn (quid, key) == 0) From 99f680416797718dc4fc209c05c5d95526d78f2f Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 7 Jul 2009 03:05:01 +0000 Subject: [PATCH 0935/1707] 2009-07-06 Pavel Roskin * commands/search.c (search_fs): Fix potential NULL pointer dereference. --- ChangeLog | 3 +++ commands/search.c | 10 ++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index fd741626a..ed6b63780 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-06 Pavel Roskin + * commands/search.c (search_fs): Fix potential NULL pointer + dereference. + * commands/search.c (search_fs): Replace QUID macro with quid_fn function pointer. diff --git a/commands/search.c b/commands/search.c index b29eefb41..68ec8ccd6 100644 --- a/commands/search.c +++ b/commands/search.c @@ -68,17 +68,19 @@ search_fs (const char *key, const char *var, int no_floppy, int is_uuid) { grub_fs_t fs; int (*compare_fn) (const char *, const char *); - grub_err_t (*quid_fn) (grub_device_t, char **); fs = grub_fs_probe (dev); compare_fn = is_uuid ? grub_strcasecmp : grub_strcmp; - quid_fn = is_uuid ? fs->uuid : fs->label; - if (fs && quid_fn) + if (fs && (is_uuid ? fs->uuid : fs->label)) { char *quid; - quid_fn (dev, &quid); + if (is_uuid) + fs->uuid (dev, &quid); + else + fs->label (dev, &quid); + if (grub_errno == GRUB_ERR_NONE && quid) { if (compare_fn (quid, key) == 0) From 8279cade2316eb30837c95a49b35d9be203f4524 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 7 Jul 2009 19:54:19 +0000 Subject: [PATCH 0936/1707] 2009-07-07 Pavel Roskin * lib/arg.c (find_long_option): Remove. (find_long): Add `len' argument, make `s' const char *. (grub_arg_parse): Parse long options in place, not in a temporary buffer. --- ChangeLog | 7 +++++++ lib/arg.c | 38 +++++++++++--------------------------- 2 files changed, 18 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index ed6b63780..b8145c5a0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-07 Pavel Roskin + + * lib/arg.c (find_long_option): Remove. + (find_long): Add `len' argument, make `s' const char *. + (grub_arg_parse): Parse long options in place, not in a + temporary buffer. + 2009-07-06 Pavel Roskin * commands/search.c (search_fs): Fix potential NULL pointer diff --git a/lib/arg.c b/lib/arg.c index e61404856..ed37986b6 100644 --- a/lib/arg.c +++ b/lib/arg.c @@ -76,21 +76,8 @@ find_short (const struct grub_arg_option *options, char c) return found; } -static char * -find_long_option (char *s) -{ - char *argpos = grub_strchr (s, '='); - - if (argpos) - { - *argpos = '\0'; - return ++argpos; - } - return 0; -} - static struct grub_arg_option * -find_long (const struct grub_arg_option *options, char *s) +find_long (const struct grub_arg_option *options, const char *s, int len) { struct grub_arg_option *found = 0; auto struct grub_arg_option *fnd_long (const struct grub_arg_option *opt); @@ -99,7 +86,8 @@ find_long (const struct grub_arg_option *options, char *s) { while (opt->doc) { - if (opt->longarg && ! grub_strcmp (opt->longarg, s)) + if (opt->longarg && ! grub_strncmp (opt->longarg, s, len) && + opt->longarg[len] == '\0') return (struct grub_arg_option *) opt; opt++; } @@ -244,7 +232,7 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, struct grub_arg_list *usr, char ***args, int *argnum) { int curarg; - char *longarg = 0; + int arglen; int complete = 0; char **argl = 0; int num = 0; @@ -328,14 +316,14 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, break; } - longarg = (char *) grub_strdup (arg); - if (! longarg) - goto fail; + option = grub_strchr (arg, '='); + if (option) { + arglen = option - arg - 2; + option++; + } else + arglen = grub_strlen (arg) - 2; - option = find_long_option (longarg); - arg = longarg; - - opt = find_long (cmd->options, arg + 2); + opt = find_long (cmd->options, arg + 2, arglen); if (! opt) { grub_error (GRUB_ERR_BAD_ARGUMENT, "Unknown argument `%s'\n", arg); @@ -402,8 +390,6 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, if (parse_option (cmd, opt->shortarg, 0, usr) || grub_errno) goto fail; } - grub_free (longarg); - longarg = 0; } complete = 1; @@ -412,7 +398,5 @@ grub_arg_parse (grub_extcmd_t cmd, int argc, char **argv, *argnum = num; fail: - grub_free (longarg); - return complete; } From 25f9a05a0362ea68a7d988650c4eeecfb583e0a8 Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 7 Jul 2009 20:03:03 +0000 Subject: [PATCH 0937/1707] 2009-07-07 Pavel Roskin * include/grub/util/console.h: New file. * util/console.c: Use it instead of grub/machine/console.h. * util/grub-emu.c: Likewise. --- ChangeLog | 4 ++++ include/grub/util/console.h | 28 ++++++++++++++++++++++++++++ util/console.c | 2 +- util/grub-emu.c | 2 +- 4 files changed, 34 insertions(+), 2 deletions(-) create mode 100644 include/grub/util/console.h diff --git a/ChangeLog b/ChangeLog index b8145c5a0..e16ae1cff 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-07 Pavel Roskin + * include/grub/util/console.h: New file. + * util/console.c: Use it instead of grub/machine/console.h. + * util/grub-emu.c: Likewise. + * lib/arg.c (find_long_option): Remove. (find_long): Add `len' argument, make `s' const char *. (grub_arg_parse): Parse long options in place, not in a diff --git a/include/grub/util/console.h b/include/grub/util/console.h new file mode 100644 index 000000000..1e5568282 --- /dev/null +++ b/include/grub/util/console.h @@ -0,0 +1,28 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CONSOLE_UTIL_HEADER +#define GRUB_CONSOLE_UTIL_HEADER 1 + +/* Initialize the console system. */ +void grub_console_init (void); + +/* Finish the console system. */ +void grub_console_fini (void); + +#endif /* ! GRUB_CONSOLE_UTIL_HEADER */ diff --git a/util/console.c b/util/console.c index 04bb56dbb..9d8bb1a63 100644 --- a/util/console.c +++ b/util/console.c @@ -35,7 +35,7 @@ # define A_STANDOUT 0 #endif /* ! A_STANDOUT */ -#include +#include #include #include diff --git a/util/grub-emu.c b/util/grub-emu.c index 31365f3e0..664a0b197 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -29,7 +29,7 @@ #include #include #include -#include +#include #include #include #include From 7d8a52d3a25c05f96cccce56cd1e8830e729d02a Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 7 Jul 2009 20:13:39 +0000 Subject: [PATCH 0938/1707] 2009-07-07 Pavel Roskin * commands/search.c (search_file): Merge into ... (search_fs): ... this. Accept search type as argument. (grub_cmd_search): Pass search type to search_fs(). --- ChangeLog | 4 ++ commands/search.c | 172 +++++++++++++++++++--------------------------- 2 files changed, 75 insertions(+), 101 deletions(-) diff --git a/ChangeLog b/ChangeLog index e16ae1cff..3fe273f63 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-07 Pavel Roskin + * commands/search.c (search_file): Merge into ... + (search_fs): ... this. Accept search type as argument. + (grub_cmd_search): Pass search type to search_fs(). + * include/grub/util/console.h: New file. * util/console.c: Use it instead of grub/machine/console.h. * util/grub-emu.c: Likewise. diff --git a/commands/search.c b/commands/search.c index 68ec8ccd6..4ac7429eb 100644 --- a/commands/search.c +++ b/commands/search.c @@ -47,126 +47,96 @@ enum options }; static void -search_fs (const char *key, const char *var, int no_floppy, int is_uuid) +search_fs (const char *key, const char *var, int no_floppy, enum options type) { int count = 0; + char *buf = NULL; + auto int iterate_device (const char *name); - int iterate_device (const char *name) - { - grub_device_t dev; - int abort = 0; + { + int found = 0; - /* Skip floppy drives when requested. */ - if (no_floppy && - name[0] == 'f' && name[1] == 'd' && - name[2] >= '0' && name[2] <= '9') - return 0; + /* Skip floppy drives when requested. */ + if (no_floppy && + name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') + return 0; - dev = grub_device_open (name); - if (dev) - { - grub_fs_t fs; - int (*compare_fn) (const char *, const char *); + if (type == SEARCH_FILE) + { + grub_size_t len; + char *p; + grub_file_t file; - fs = grub_fs_probe (dev); - compare_fn = is_uuid ? grub_strcasecmp : grub_strcmp; + len = grub_strlen (name) + 2 + grub_strlen (key) + 1; + p = grub_realloc (buf, len); + if (! p) + return 1; - if (fs && (is_uuid ? fs->uuid : fs->label)) - { - char *quid; + buf = p; + grub_sprintf (buf, "(%s)%s", name, key); - if (is_uuid) - fs->uuid (dev, &quid); - else - fs->label (dev, &quid); + file = grub_file_open (buf); + if (file) + { + found = 1; + grub_file_close (file); + } + } + else + { + /* type is SEARCH_FS_UUID or SEARCH_LABEL */ + grub_device_t dev; + grub_fs_t fs; + int (*compare_fn) (const char *, const char *); + char *quid; - if (grub_errno == GRUB_ERR_NONE && quid) - { - if (compare_fn (quid, key) == 0) - { - /* Found! */ - count++; - if (var) - { - grub_env_set (var, name); - abort = 1; - } - else - grub_printf (" %s", name); - } + dev = grub_device_open (name); + if (dev) + { + fs = grub_fs_probe (dev); + compare_fn = + (type == SEARCH_FS_UUID) ? grub_strcasecmp : grub_strcmp; - grub_free (quid); - } - } + if (fs && ((type == SEARCH_FS_UUID) ? fs->uuid : fs->label)) + { + if (type == SEARCH_FS_UUID) + fs->uuid (dev, &quid); + else + fs->label (dev, &quid); - grub_device_close (dev); - } + if (grub_errno == GRUB_ERR_NONE && quid) + { + if (compare_fn (quid, key) == 0) + found = 1; - grub_errno = GRUB_ERR_NONE; - return abort; - } + grub_free (quid); + } + } - grub_device_iterate (iterate_device); + grub_device_close (dev); + } + } - if (count == 0) - grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key); -} + if (found) + { + count++; + if (var) + grub_env_set (var, name); + else + grub_printf (" %s", name); + } -static void -search_file (const char *key, const char *var, int no_floppy) -{ - int count = 0; - char *buf = 0; - auto int iterate_device (const char *name); - - int iterate_device (const char *name) - { - grub_size_t len; - char *p; - grub_file_t file; - int abort = 0; - - /* Skip floppy drives when requested. */ - if (no_floppy && - name[0] == 'f' && name[1] == 'd' && - name[2] >= '0' && name[2] <= '9') - return 0; - - len = grub_strlen (name) + 2 + grub_strlen (key) + 1; - p = grub_realloc (buf, len); - if (! p) - return 1; - - buf = p; - grub_sprintf (buf, "(%s)%s", name, key); - - file = grub_file_open (buf); - if (file) - { - /* Found! */ - count++; - if (var) - { - grub_env_set (var, name); - abort = 1; - } - else - grub_printf (" %s", name); - - grub_file_close (file); - } - - grub_errno = GRUB_ERR_NONE; - return abort; - } + grub_errno = GRUB_ERR_NONE; + return (found && var); + } grub_device_iterate (iterate_device); grub_free (buf); if (grub_errno == GRUB_ERR_NONE && count == 0) - grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such file: %s", key); + grub_error (GRUB_ERR_FILE_NOT_FOUND, "no such device: %s", key); } static grub_err_t @@ -182,11 +152,11 @@ grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root"; if (state[SEARCH_LABEL].set) - search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, 0); + search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_LABEL); else if (state[SEARCH_FS_UUID].set) - search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, 1); + search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FS_UUID); else if (state[SEARCH_FILE].set) - search_file (args[0], var, state[SEARCH_NO_FLOPPY].set); + search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FILE); else return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type"); From 0ae1bf88be5627dab6e1810e8e634da8fe32edf1 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 10 Jul 2009 20:19:08 +0000 Subject: [PATCH 0939/1707] 2009-07-10 Bean 2009-07-10 Robert Millan * kern/ieee1275/openfw.c (grub_children_iterate) (grub_devalias_iterate): Fix size evaluation for property or path strings, which was broken since r2132. --- ChangeLog | 7 +++++++ kern/ieee1275/openfw.c | 10 +++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fe273f63..23c15d4c4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-10 Bean +2009-07-10 Robert Millan + + * kern/ieee1275/openfw.c (grub_children_iterate) + (grub_devalias_iterate): Fix size evaluation for property or path + strings, which was broken since r2132. + 2009-07-07 Pavel Roskin * commands/search.c (search_file): Merge into ... diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index e7979f4ad..a952fe597 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -78,15 +78,15 @@ grub_children_iterate (char *devpath, grub_ssize_t actual; if (grub_ieee1275_get_property (child, "device_type", childtype, - sizeof childtype, &actual)) + IEEE1275_MAX_PROP_LEN, &actual)) continue; - if (grub_ieee1275_package_to_path (child, childpath, sizeof childpath, - &actual)) + if (grub_ieee1275_package_to_path (child, childpath, + IEEE1275_MAX_PATH_LEN, &actual)) continue; if (grub_ieee1275_get_property (child, "name", childname, - sizeof childname, &actual)) + IEEE1275_MAX_PATH_LEN, &actual)) continue; grub_sprintf (fullname, "%s/%s", devpath, childname); @@ -176,7 +176,7 @@ grub_devalias_iterate (int (*hook) (struct grub_ieee1275_devalias *alias)) } if (grub_ieee1275_get_property (dev, "device_type", devtype, - sizeof devtype, &actual)) + IEEE1275_MAX_PROP_LEN, &actual)) { /* NAND device don't have device_type property. */ devtype[0] = 0; From 75c59f59e73f3563cc28a54dd982d18016ebf955 Mon Sep 17 00:00:00 2001 From: bean Date: Sat, 11 Jul 2009 03:59:15 +0000 Subject: [PATCH 0940/1707] 2009-07-11 Bean * kern/ieee1275/openfw.c (grub_children_iterate): Fix size of childname. --- ChangeLog | 5 +++++ kern/ieee1275/openfw.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 23c15d4c4..0b72b37be 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-11 Bean + + * kern/ieee1275/openfw.c (grub_children_iterate): Fix size of + childname. + 2009-07-10 Bean 2009-07-10 Robert Millan diff --git a/kern/ieee1275/openfw.c b/kern/ieee1275/openfw.c index a952fe597..20ef730e0 100644 --- a/kern/ieee1275/openfw.c +++ b/kern/ieee1275/openfw.c @@ -86,7 +86,7 @@ grub_children_iterate (char *devpath, continue; if (grub_ieee1275_get_property (child, "name", childname, - IEEE1275_MAX_PATH_LEN, &actual)) + IEEE1275_MAX_PROP_LEN, &actual)) continue; grub_sprintf (fullname, "%s/%s", devpath, childname); From 2df32b2c4a49101000d39ec8d9736790d7b28728 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 13 Jul 2009 22:21:49 +0000 Subject: [PATCH 0941/1707] 2009-07-13 Pavel Roskin * kern/device.c (grub_device_iterate): Change struct part_ent to hold the name, not a pointer to it. Use one grub_malloc() per partition, not two. Free partition_name if grub_malloc() fails. Set ents to NULL only before grub_partition_iterate() is called. --- ChangeLog | 7 +++++++ kern/device.c | 16 +++++----------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0b72b37be..a8bd9ad94 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-13 Pavel Roskin + + * kern/device.c (grub_device_iterate): Change struct part_ent to + hold the name, not a pointer to it. Use one grub_malloc() per + partition, not two. Free partition_name if grub_malloc() fails. + Set ents to NULL only before grub_partition_iterate() is called. + 2009-07-11 Bean * kern/ieee1275/openfw.c (grub_children_iterate): Fix size of diff --git a/kern/device.c b/kern/device.c index 55c750bfc..83ae3dcc8 100644 --- a/kern/device.c +++ b/kern/device.c @@ -86,8 +86,8 @@ grub_device_iterate (int (*hook) (const char *name)) struct part_ent { struct part_ent *next; - char *name; - } *ents = NULL; + char name[0]; + } *ents; int iterate_disk (const char *disk_name) { @@ -105,18 +105,17 @@ grub_device_iterate (int (*hook) (const char *name)) struct part_ent *p; int ret = 0; + ents = NULL; (void) grub_partition_iterate (dev->disk, iterate_partition); grub_device_close (dev); p = ents; - ents = NULL; while (p != NULL) { struct part_ent *next = p->next; if (!ret) ret = hook (p->name); - grub_free (p->name); grub_free (p); p = next; } @@ -137,15 +136,10 @@ grub_device_iterate (int (*hook) (const char *name)) if (! partition_name) return 1; - p = grub_malloc (sizeof (*p)); + p = grub_malloc (sizeof (p->next) + grub_strlen (disk->name) + 1 + + grub_strlen (partition_name) + 1); if (!p) - return 1; - - p->name = grub_malloc (grub_strlen (disk->name) + 1 - + grub_strlen (partition_name) + 1); - if (! p->name) { - grub_free (p); grub_free (partition_name); return 1; } From 17dc3751c22d898695c8a7f688acf3ac35ff863c Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 13 Jul 2009 23:04:31 +0000 Subject: [PATCH 0942/1707] 2009-07-13 Pavel Roskin * kern/dl.c: Force native word size to suppress warnings when compiling grub-emu. --- ChangeLog | 3 +++ kern/dl.c | 3 +++ 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index a8bd9ad94..edb717377 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-13 Pavel Roskin + * kern/dl.c: Force native word size to suppress warnings when + compiling grub-emu. + * kern/device.c (grub_device_iterate): Change struct part_ent to hold the name, not a pointer to it. Use one grub_malloc() per partition, not two. Free partition_name if grub_malloc() fails. diff --git a/kern/dl.c b/kern/dl.c index 6c863be6f..122b6b90e 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -17,6 +17,9 @@ * along with GRUB. If not, see . */ +/* Force native word size */ +#define GRUB_TARGET_WORDSIZE (8 * GRUB_CPU_SIZEOF_VOID_P) + #include #include #include From 44b5d879731c500fe796f5958b44eb43b9945a52 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 13 Jul 2009 23:57:11 +0000 Subject: [PATCH 0943/1707] 2009-07-13 Pavel Roskin * include/grub/i386/coreboot/machine.h: Rename GRUB_MACHINE_LINUXBIOS to GRUB_MACHINE_COREBOOT. * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Allow multiboot 1 for GRUB_MACHINE_COREBOOT and GRUB_MACHINE_QEMU. --- ChangeLog | 5 +++++ include/grub/i386/coreboot/machine.h | 24 ++++++++++++++++++++++++ loader/multiboot_loader.c | 6 ++++-- 3 files changed, 33 insertions(+), 2 deletions(-) create mode 100644 include/grub/i386/coreboot/machine.h diff --git a/ChangeLog b/ChangeLog index edb717377..44e4e6fe1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-07-13 Pavel Roskin + * include/grub/i386/coreboot/machine.h: Rename + GRUB_MACHINE_LINUXBIOS to GRUB_MACHINE_COREBOOT. + * loader/multiboot_loader.c (grub_cmd_multiboot_loader): Allow + multiboot 1 for GRUB_MACHINE_COREBOOT and GRUB_MACHINE_QEMU. + * kern/dl.c: Force native word size to suppress warnings when compiling grub-emu. diff --git a/include/grub/i386/coreboot/machine.h b/include/grub/i386/coreboot/machine.h new file mode 100644 index 000000000..8b7059005 --- /dev/null +++ b/include/grub/i386/coreboot/machine.h @@ -0,0 +1,24 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_MACHINE_MACHINE_HEADER +#define GRUB_MACHINE_MACHINE_HEADER 1 + +#define GRUB_MACHINE_COREBOOT 1 + +#endif /* ! GRUB_MACHINE_MACHINE_HEADER */ diff --git a/loader/multiboot_loader.c b/loader/multiboot_loader.c index 29c34d9f8..986ee0b04 100644 --- a/loader/multiboot_loader.c +++ b/loader/multiboot_loader.c @@ -139,7 +139,8 @@ grub_cmd_multiboot_loader (grub_command_t cmd __attribute__ ((unused)), /* XXX Find a better way to identify this. This is for i386-pc */ -#if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS) +#if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_COREBOOT) || \ + defined(GRUB_MACHINE_QEMU) if (header_multi_ver_found == 1) { grub_dprintf ("multiboot_loader", @@ -172,7 +173,8 @@ grub_cmd_module_loader (grub_command_t cmd __attribute__ ((unused)), int argc, char *argv[]) { -#if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_LINUXBIOS) +#if defined(GRUB_MACHINE_PCBIOS) || defined(GRUB_MACHINE_COREBOOT) || \ + defined(GRUB_MACHINE_QEMU) if (module_version_status == 1) { grub_dprintf("multiboot_loader", From 2059157753ffb3d4123e98890a87f8d928493931 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Jul 2009 14:54:18 +0000 Subject: [PATCH 0944/1707] 2009-07-15 Pavel Roskin * include/grub/i386/pc/boot.h: Sort all offsets. (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Remove, it's unused. (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Likewise. * boot/i386/pc/boot.S: Assert location of every offset listed in include/grub/i386/pc/boot.h. --- ChangeLog | 8 ++++++++ boot/i386/pc/boot.S | 8 +++++++- include/grub/i386/pc/boot.h | 10 ++-------- 3 files changed, 17 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44e4e6fe1..ca4891699 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-07-15 Pavel Roskin + + * include/grub/i386/pc/boot.h: Sort all offsets. + (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Remove, it's unused. + (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Likewise. + * boot/i386/pc/boot.S: Assert location of every offset listed in + include/grub/i386/pc/boot.h. + 2009-07-13 Pavel Roskin * include/grub/i386/coreboot/machine.h: Rename diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 8d8c27c82..fb9094743 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -65,6 +65,7 @@ start: * this area. */ + . = _start + GRUB_BOOT_MACHINE_BPB_START . = _start + 4 /* scratch space */ @@ -91,14 +92,19 @@ cylinder_start: * End of BIOS parameter block. */ + . = _start + GRUB_BOOT_MACHINE_VER_MAJ boot_version: .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR kernel_segment: .word GRUB_BOOT_MACHINE_KERNEL_SEG + + . = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR kernel_sector: .long 1, 0 + + . = _start + GRUB_BOOT_MACHINE_BOOT_DRIVE boot_drive: .byte 0xff /* the disk to load kernel from */ /* 0xff means use the boot drive */ @@ -477,8 +483,8 @@ nt_magic: * sneaky, huh? */ -part_start: . = _start + GRUB_BOOT_MACHINE_PART_START +part_start: probe_values: .byte 36, 18, 15, 9, 0 diff --git a/include/grub/i386/pc/boot.h b/include/grub/i386/pc/boot.h index f35cb3a27..221ed3882 100644 --- a/include/grub/i386/pc/boot.h +++ b/include/grub/i386/pc/boot.h @@ -31,17 +31,11 @@ /* The offset of the major version. */ #define GRUB_BOOT_MACHINE_VER_MAJ 0x3e -/* The offset of BOOT_DRIVE. */ -#define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c - -/* The offset of KERNEL_ADDRESS. */ -#define GRUB_BOOT_MACHINE_KERNEL_ADDRESS 0x40 - /* The offset of KERNEL_SECTOR. */ #define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x44 -/* The offset of KERNEL_SEGMENT. */ -#define GRUB_BOOT_MACHINE_KERNEL_SEGMENT 0x42 +/* The offset of BOOT_DRIVE. */ +#define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c /* The offset of BOOT_DRIVE_CHECK. */ #define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4e From 40b132c56243d9a3993a90fcbfd0db952e146f1a Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Jul 2009 14:55:24 +0000 Subject: [PATCH 0945/1707] 2009-07-15 Pavel Roskin * boot/i386/pc/boot.S (boot_version): Remove. * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_VER_MAJ): Remove. --- ChangeLog | 4 ++++ boot/i386/pc/boot.S | 3 --- include/grub/i386/pc/boot.h | 3 --- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index ca4891699..37aabfb92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-15 Pavel Roskin + * boot/i386/pc/boot.S (boot_version): Remove. + * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_VER_MAJ): + Remove. + * include/grub/i386/pc/boot.h: Sort all offsets. (GRUB_BOOT_MACHINE_KERNEL_ADDRESS): Remove, it's unused. (GRUB_BOOT_MACHINE_KERNEL_SEGMENT): Likewise. diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index fb9094743..e5685dc5e 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -92,9 +92,6 @@ cylinder_start: * End of BIOS parameter block. */ - . = _start + GRUB_BOOT_MACHINE_VER_MAJ -boot_version: - .byte GRUB_BOOT_VERSION_MAJOR, GRUB_BOOT_VERSION_MINOR kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR kernel_segment: diff --git a/include/grub/i386/pc/boot.h b/include/grub/i386/pc/boot.h index 221ed3882..a91f55abb 100644 --- a/include/grub/i386/pc/boot.h +++ b/include/grub/i386/pc/boot.h @@ -28,9 +28,6 @@ /* The offset of the end of BPB (BIOS Parameter Block). */ #define GRUB_BOOT_MACHINE_BPB_END 0x3e -/* The offset of the major version. */ -#define GRUB_BOOT_MACHINE_VER_MAJ 0x3e - /* The offset of KERNEL_SECTOR. */ #define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x44 From 7bd8f5bfe12497f7eac22d1c6c5533ce1e7e1cc0 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Jul 2009 14:58:07 +0000 Subject: [PATCH 0946/1707] 2009-07-15 Pavel Roskin * boot/i386/pc/boot.S (kernel_segment): Remove. (copy_buffer): Use GRUB_BOOT_MACHINE_KERNEL_ADDR in segment 0 for destination. --- ChangeLog | 4 ++++ boot/i386/pc/boot.S | 12 ++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 37aabfb92..0e216e470 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-07-15 Pavel Roskin + * boot/i386/pc/boot.S (kernel_segment): Remove. + (copy_buffer): Use GRUB_BOOT_MACHINE_KERNEL_ADDR in segment 0 + for destination. + * boot/i386/pc/boot.S (boot_version): Remove. * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_VER_MAJ): Remove. diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index e5685dc5e..15d02e503 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -94,8 +94,6 @@ cylinder_start: kernel_address: .word GRUB_BOOT_MACHINE_KERNEL_ADDR -kernel_segment: - .word GRUB_BOOT_MACHINE_KERNEL_SEG . = _start + GRUB_BOOT_MACHINE_KERNEL_SECTOR kernel_sector: @@ -372,13 +370,6 @@ setup_sectors: movw %es, %bx copy_buffer: -#ifdef APPLE_CC - kernel_segment_abs = ABS (kernel_segment) - movw (kernel_segment_abs), %es -#else - movw ABS(kernel_segment), %es -#endif - /* * We need to save %cx and %si because the startup code in * kernel uses them without initializing them. @@ -389,7 +380,8 @@ copy_buffer: movw $0x100, %cx movw %bx, %ds xorw %si, %si - xorw %di, %di + movw $GRUB_BOOT_MACHINE_KERNEL_ADDR, %di + movw %si, %es cld From 379c54c1b351324b4d083cbe0a6b97c2720d301e Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Jul 2009 15:00:26 +0000 Subject: [PATCH 0947/1707] 2009-07-15 Pavel Roskin * boot/i386/pc/boot.S (general_error_string): Add DOS newline at the end of "Error" to make the message more readable. --- ChangeLog | 3 +++ boot/i386/pc/boot.S | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0e216e470..889bbd3ca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-15 Pavel Roskin + * boot/i386/pc/boot.S (general_error_string): Add DOS newline at + the end of "Error" to make the message more readable. + * boot/i386/pc/boot.S (kernel_segment): Remove. (copy_buffer): Use GRUB_BOOT_MACHINE_KERNEL_ADDR in segment 0 for destination. diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 15d02e503..1fb5f7416 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -433,7 +433,7 @@ notification_string: .asciz "GRUB " geometry_error_string: .asciz "Geom" hd_probe_error_string: .asciz "Hard Disk" read_error_string: .asciz "Read" -general_error_string: .asciz " Error" +general_error_string: .asciz " Error\r\n" /* * message: write the string pointed to by %si From fde24e10a86263cadf274facbe61de1add166078 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Jul 2009 15:06:12 +0000 Subject: [PATCH 0948/1707] 2009-07-15 Pavel Roskin * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_BPB_END): Increase to 0x5a to accommodate FAT32. Adjust other offsets accordingly. Original patch by Yves Blusseau --- ChangeLog | 5 +++++ include/grub/i386/pc/boot.h | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 889bbd3ca..fd9b9e41e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-07-15 Pavel Roskin + * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_BPB_END): + Increase to 0x5a to accommodate FAT32. Adjust other offsets + accordingly. + Original patch by Yves Blusseau + * boot/i386/pc/boot.S (general_error_string): Add DOS newline at the end of "Error" to make the message more readable. diff --git a/include/grub/i386/pc/boot.h b/include/grub/i386/pc/boot.h index a91f55abb..f45fe6da0 100644 --- a/include/grub/i386/pc/boot.h +++ b/include/grub/i386/pc/boot.h @@ -26,16 +26,16 @@ #define GRUB_BOOT_MACHINE_BPB_START 0x3 /* The offset of the end of BPB (BIOS Parameter Block). */ -#define GRUB_BOOT_MACHINE_BPB_END 0x3e +#define GRUB_BOOT_MACHINE_BPB_END 0x5a /* The offset of KERNEL_SECTOR. */ -#define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x44 +#define GRUB_BOOT_MACHINE_KERNEL_SECTOR 0x5c /* The offset of BOOT_DRIVE. */ -#define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x4c +#define GRUB_BOOT_MACHINE_BOOT_DRIVE 0x64 /* The offset of BOOT_DRIVE_CHECK. */ -#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x4e +#define GRUB_BOOT_MACHINE_DRIVE_CHECK 0x66 /* The offset of a magic number used by Windows NT. */ #define GRUB_BOOT_MACHINE_WINDOWS_NT_MAGIC 0x1b8 From e8e8e4fd889c9b777663acf6e65fb30b601437f3 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Jul 2009 19:30:34 +0000 Subject: [PATCH 0949/1707] 2009-07-15 Pavel Roskin * commands/probe.c (options): Typo fix. --- ChangeLog | 2 ++ commands/probe.c | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index fd9b9e41e..3f6ace353 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-15 Pavel Roskin + * commands/probe.c (options): Typo fix. + * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_BPB_END): Increase to 0x5a to accommodate FAT32. Adjust other offsets accordingly. diff --git a/commands/probe.c b/commands/probe.c index 463190788..9e95e6aaf 100644 --- a/commands/probe.c +++ b/commands/probe.c @@ -36,7 +36,7 @@ static const struct grub_arg_option options[] = {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to return value", "VAR", ARG_TYPE_STRING}, {"driver", 'd', 0, "determine driver", 0, 0}, - {"partmap", 'p', 0, "determine partion map type", 0, 0}, + {"partmap", 'p', 0, "determine partition map type", 0, 0}, {"fs", 'f', 0, "determine filesystem type", 0, 0}, {"fs-uuid", 'u', 0, "determine filesystem UUID", 0, 0}, {"label", 'l', 0, "determine filesystem label", 0, 0}, From 560ca572fa6a0ff6eefa704c1275bcfe29ae6678 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 15 Jul 2009 19:45:44 +0000 Subject: [PATCH 0950/1707] 2009-07-15 Pavel Roskin * include/grub/disk.h (struct grub_disk_dev): Use enum for id. * kern/disk.c (struct grub_disk_cache): Likewise. --- ChangeLog | 3 +++ include/grub/disk.h | 2 +- kern/disk.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3f6ace353..a12621577 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-15 Pavel Roskin + * include/grub/disk.h (struct grub_disk_dev): Use enum for id. + * kern/disk.c (struct grub_disk_cache): Likewise. + * commands/probe.c (options): Typo fix. * include/grub/i386/pc/boot.h (GRUB_BOOT_MACHINE_BPB_END): diff --git a/include/grub/disk.h b/include/grub/disk.h index a47e11337..5899e9425 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -56,7 +56,7 @@ struct grub_disk_dev const char *name; /* The device id used by the cache manager. */ - unsigned long id; + enum grub_disk_dev_id id; /* Call HOOK with each device name, until HOOK returns non-zero. */ int (*iterate) (int (*hook) (const char *name)); diff --git a/kern/disk.c b/kern/disk.c index 0c54ed467..e167fb630 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -34,7 +34,7 @@ static grub_uint64_t grub_last_time = 0; /* Disk cache. */ struct grub_disk_cache { - unsigned long dev_id; + enum grub_disk_dev_id dev_id; unsigned long disk_id; grub_disk_addr_t sector; char *data; From a58da8c77bef4b08e31684c3ba0d928779815977 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 15 Jul 2009 22:04:41 +0000 Subject: [PATCH 0951/1707] 2009-07-16 Vladimir Serbinenko Fix 64-bit efiemu * include/grub/efiemu/efiemu.h (grub_efiemu_configuration_table64_t): correct wrong typedef * efiemu/prepare.c (SUFFIX (grub_efiemu_prepare)): minor style fixes --- ChangeLog | 8 ++++++++ efiemu/prepare.c | 11 ++++++----- include/grub/efiemu/efiemu.h | 2 +- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index a12621577..9d5e2f6cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-07-16 Vladimir Serbinenko + + Fix 64-bit efiemu + + * include/grub/efiemu/efiemu.h (grub_efiemu_configuration_table64_t): + correct wrong typedef + * efiemu/prepare.c (SUFFIX (grub_efiemu_prepare)): minor style fixes + 2009-07-15 Pavel Roskin * include/grub/disk.h (struct grub_disk_dev): Use enum for id. diff --git a/efiemu/prepare.c b/efiemu/prepare.c index e1dc4180d..9e6d46fa1 100644 --- a/efiemu/prepare.c +++ b/efiemu/prepare.c @@ -63,14 +63,15 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, curhook->hook (curhook->data); /* Move runtime to its due place */ - if ((err = grub_efiemu_loadcore_load ())) + err = grub_efiemu_loadcore_load (); + if (err) { grub_efiemu_unload (); return err; } - if ((err = grub_efiemu_resolve_symbol ("efiemu_system_table", - &handle, &off))) + err = grub_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off); + if (err) { grub_efiemu_unload (); return err; @@ -78,14 +79,14 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, SUFFIX (grub_efiemu_system_table) = (struct SUFFIX (grub_efi_system_table) *) - ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); + ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); /* compute CRC32 of runtime_services */ if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", &handle, &off))) return err; runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *) - ((grub_uint8_t *)grub_efiemu_mm_obtain_request (handle) + off); + ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); runtime_services->hdr.crc32 = 0; runtime_services->hdr.crc32 = grub_getcrc32 (0, runtime_services, runtime_services->hdr.header_size); diff --git a/include/grub/efiemu/efiemu.h b/include/grub/efiemu/efiemu.h index ed934a228..20163dd61 100644 --- a/include/grub/efiemu/efiemu.h +++ b/include/grub/efiemu/efiemu.h @@ -187,7 +187,7 @@ struct grub_efiemu_configuration_table64 grub_efi_guid_t vendor_guid; grub_efi_uint64_t vendor_table; } __attribute__ ((packed)); -typedef struct grub_efiemu_configuration_table32 grub_efiemu_configuration_table64_t; +typedef struct grub_efiemu_configuration_table64 grub_efiemu_configuration_table64_t; grub_err_t grub_efiemu_unregister_configuration_table (grub_efi_guid_t guid); grub_err_t grub_efiemu_register_configuration_table (grub_efi_guid_t guid, From 59ade63d27dae4d2fc7e3e0df6bb8b68003ec5ed Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 15 Jul 2009 22:51:47 +0000 Subject: [PATCH 0952/1707] 2009-07-16 Vladimir Serbinenko Make FreeBSD accept zpool.cache * loader/i386/bsd.c (grub_freebsd_add_meta_module): spoof filename if type is /boot/zfs/zpool.cache --- ChangeLog | 7 +++++++ loader/i386/bsd.c | 2 ++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 9d5e2f6cd..80bd3a68a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-16 Vladimir Serbinenko + + Make FreeBSD accept zpool.cache + + * loader/i386/bsd.c (grub_freebsd_add_meta_module): spoof filename if + type is /boot/zfs/zpool.cache + 2009-07-16 Vladimir Serbinenko Fix 64-bit efiemu diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index b76cfb549..468e6d0cf 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -271,6 +271,8 @@ grub_freebsd_add_meta_module (char *filename, char *type, int argc, char **argv, name++; else name = filename; + if (grub_strcmp (type, "/boot/zfs/zpool.cache") == 0) + name = "/boot/zfs/zpool.cache"; if (grub_freebsd_add_meta (FREEBSD_MODINFO_NAME, name, grub_strlen (name) + 1)) From 94414221cfc69936bfa30954ab8fa97254258301 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 16 Jul 2009 14:53:33 +0000 Subject: [PATCH 0953/1707] 2009-07-16 Vladimir Serbinenko Fix libusb * Makefile.in (LIBUSB): new macro * genmk.rb (Utility/print_tail): new method (Utility/rule): use intermediary variable #{prefix}_OBJECTS (top level): call util.print_tail at the end. --- ChangeLog | 9 +++++++++ Makefile.in | 1 + genmk.rb | 12 +++++++++--- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80bd3a68a..d6c793ff5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-07-16 Vladimir Serbinenko + + Fix libusb + + * Makefile.in (LIBUSB): new macro + * genmk.rb (Utility/print_tail): new method + (Utility/rule): use intermediary variable #{prefix}_OBJECTS + (top level): call util.print_tail at the end. + 2009-07-16 Vladimir Serbinenko Make FreeBSD accept zpool.cache diff --git a/Makefile.in b/Makefile.in index 3d208e777..436db63ca 100644 --- a/Makefile.in +++ b/Makefile.in @@ -95,6 +95,7 @@ endif AWK = @AWK@ LIBCURSES = @LIBCURSES@ LIBLZO = @LIBLZO@ +LIBUSB = @LIBUSB@ YACC = @YACC@ UNIFONT_BDF = @UNIFONT_BDF@ diff --git a/genmk.rb b/genmk.rb index e3866c150..9574ce98d 100644 --- a/genmk.rb +++ b/genmk.rb @@ -220,6 +220,13 @@ class Utility @dir = dir @name = name end + def print_tail() + prefix = @name.to_var + print "#{@name}: $(#{prefix}_DEPENDENCIES) $(#{prefix}_OBJECTS) + $(CC) -o $@ $(#{prefix}_OBJECTS) $(LDFLAGS) $(#{prefix}_LDFLAGS) + +" + end attr_reader :dir, :name def rule(sources) @@ -234,9 +241,7 @@ class Utility "CLEANFILES += #{@name}$(EXEEXT) #{objs_str} MOSTLYCLEANFILES += #{deps_str} - -#{@name}: $(#{prefix}_DEPENDENCIES) #{objs_str} - $(CC) -o $@ #{objs_str} $(LDFLAGS) $(#{prefix}_LDFLAGS) +#{prefix}_OBJECTS += #{objs_str} " + objs.collect_with_index do |obj, i| src = sources[i] @@ -395,4 +400,5 @@ while l = gets end end +utils.each {|util| util.print_tail()} From ee293aee1b13d9c1d1124226ecf95e1a70e4a936 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 16 Jul 2009 15:36:43 +0000 Subject: [PATCH 0954/1707] 2009-07-16 Vladimir Serbinenko Fix hang and segmentation fault in grub-emu-usb * disk/scsi.c (grub_scsi_open): return err and not grub_errno * util/usb.c (grub_libusb_devices): likewise (grub_libusb_init): rename to ... (GRUB_MOD_INIT (libusb)):...this (grub_libusb_fini): rename to .. (GRUB_MOD_FINI (libusb)):...this * disk/usbms.c (grub_usbms_transfer): fix retry logic * include/grub/disk.h (grub_raid_init): removed, it's useless (grub_raid_fini): likewise (grub_lvm_init): likewise (grub_lvm_fini): likewise * util/grub-emu.c (main): don't call grub_libusb_init, it's done by grub_init_all --- ChangeLog | 18 +++++++++++++++++ disk/scsi.c | 5 +++-- disk/usbms.c | 9 ++++----- include/grub/disk.h | 7 ------- util/grub-emu.c | 4 ---- util/usb.c | 48 ++++++++++++++++++++++++--------------------- 6 files changed, 51 insertions(+), 40 deletions(-) diff --git a/ChangeLog b/ChangeLog index d6c793ff5..a6aca15ac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,21 @@ +2009-07-16 Vladimir Serbinenko + + Fix hang and segmentation fault in grub-emu-usb + + * disk/scsi.c (grub_scsi_open): return err and not grub_errno + * util/usb.c (grub_libusb_devices): likewise + (grub_libusb_init): rename to ... + (GRUB_MOD_INIT (libusb)):...this + (grub_libusb_fini): rename to .. + (GRUB_MOD_FINI (libusb)):...this + * disk/usbms.c (grub_usbms_transfer): fix retry logic + * include/grub/disk.h (grub_raid_init): removed, it's useless + (grub_raid_fini): likewise + (grub_lvm_init): likewise + (grub_lvm_fini): likewise + * util/grub-emu.c (main): don't call grub_libusb_init, it's done + by grub_init_all + 2009-07-16 Vladimir Serbinenko Fix libusb diff --git a/disk/scsi.c b/disk/scsi.c index 353e63912..24ebdb6cd 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -248,6 +248,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) { if (p->open (name, scsi)) continue; + disk->id = (unsigned long) "scsi"; /* XXX */ disk->data = scsi; scsi->dev = p; @@ -266,7 +267,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) { grub_free (scsi); grub_dprintf ("scsi", "inquiry failed\n"); - return grub_errno; + return err; } grub_dprintf ("scsi", "inquiry: devtype=0x%02x removable=%d\n", @@ -292,7 +293,7 @@ grub_scsi_open (const char *name, grub_disk_t disk) { grub_free (scsi); grub_dprintf ("scsi", "READ CAPACITY failed\n"); - return grub_errno; + return err; } /* SCSI blocks can be something else than 512, although GRUB diff --git a/disk/usbms.c b/disk/usbms.c index 3c7ebaf94..403ed1913 100644 --- a/disk/usbms.c +++ b/disk/usbms.c @@ -222,11 +222,12 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, struct grub_usbms_csw status; static grub_uint32_t tag = 0; grub_usb_err_t err = GRUB_USB_ERR_NONE; - int retrycnt = 3; + int retrycnt = 3 + 1; retry: + retrycnt--; if (retrycnt == 0) - return err; + return grub_error (GRUB_ERR_IO, "USB Mass Storage stalled"); /* Setup the request. */ grub_memset (&cbw, 0, sizeof (cbw)); @@ -305,9 +306,7 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, grub_usb_clear_halt (dev->dev, dev->in->endp_addr); grub_usb_clear_halt (dev->dev, dev->out->endp_addr); - retrycnt--; - if (retrycnt) - goto retry; + goto retry; } if (status.status) diff --git a/include/grub/disk.h b/include/grub/disk.h index 5899e9425..de71bb588 100644 --- a/include/grub/disk.h +++ b/include/grub/disk.h @@ -173,11 +173,4 @@ struct grub_disk_ata_pass_through_parms extern grub_err_t (* EXPORT_VAR(grub_disk_ata_pass_through)) (grub_disk_t, struct grub_disk_ata_pass_through_parms *); -#ifdef GRUB_UTIL -void grub_raid_init (void); -void grub_raid_fini (void); -void grub_lvm_init (void); -void grub_lvm_fini (void); -#endif - #endif /* ! GRUB_DISK_HEADER */ diff --git a/util/grub-emu.c b/util/grub-emu.c index 664a0b197..97f18865b 100644 --- a/util/grub-emu.c +++ b/util/grub-emu.c @@ -208,10 +208,6 @@ main (int argc, char *argv[]) /* XXX: This is a bit unportable. */ grub_util_biosdisk_init (dev_map); -#if HAVE_USB_H - grub_libusb_init (); -#endif - grub_init_all (); /* Make sure that there is a root device. */ diff --git a/util/usb.c b/util/usb.c index e1d8c71bb..a687eea9b 100644 --- a/util/usb.c +++ b/util/usb.c @@ -51,6 +51,7 @@ grub_libusb_devices (void) for (usbdev = bus->devices; usbdev; usbdev = usbdev->next) { struct usb_device_descriptor *desc = &usbdev->descriptor; + grub_err_t err; if (! desc->bcdUSB) continue; @@ -62,7 +63,12 @@ grub_libusb_devices (void) dev->data = usbdev; /* Fill in all descriptors. */ - grub_usb_device_initialize (dev); + err = grub_usb_device_initialize (dev); + if (err) + { + grub_errno = GRUB_ERR_NONE; + continue; + } /* Register the device. */ grub_usb_devs[last++] = dev; @@ -72,27 +78,6 @@ grub_libusb_devices (void) return GRUB_USB_ERR_NONE; } -grub_err_t -grub_libusb_init (void) -{ - usb_init(); - usb_find_busses(); - usb_find_devices(); - - if (grub_libusb_devices ()) - return grub_errno; - - grub_usb_controller_dev_register (&usb_controller); - - return 0; -} - -grub_err_t -grub_libusb_fini (void) -{ - return 0; -} - int grub_usb_iterate (int (*hook) (grub_usb_device_t dev)) @@ -189,3 +174,22 @@ grub_usb_bulk_write (grub_usb_device_t dev, usb_close (devh); return GRUB_USB_ERR_STALL; } + +GRUB_MOD_INIT (libusb) +{ + usb_init(); + usb_find_busses(); + usb_find_devices(); + + if (grub_libusb_devices ()) + return; + + grub_usb_controller_dev_register (&usb_controller); + + return; +} + +GRUB_MOD_FINI (libusb) +{ + return; +} From 5ce5507f1cac0bdd2dd0f80c7a04612c0c92f932 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 16 Jul 2009 16:37:18 +0000 Subject: [PATCH 0955/1707] Merge branch 'mainline' into newconf --- ChangeLog | 7 +++ configure.ac | 173 +++++++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 154 insertions(+), 26 deletions(-) diff --git a/ChangeLog b/ChangeLog index a6aca15ac..07c9aada7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-06-17 Vladimir Serbinenko + + Enable all targets that can be built by default + + * configure.c: enable efiemu runtime, grub-emu, grub-emu-usb, + grub-mkfont and grub-fstest if they can be built + 2009-07-16 Vladimir Serbinenko Fix hang and segmentation fault in grub-emu-usb diff --git a/configure.ac b/configure.ac index 8b12c582c..473eb9de6 100644 --- a/configure.ac +++ b/configure.ac @@ -434,6 +434,34 @@ AH_BOTTOM([#if defined(__i386__) && !defined(GRUB_UTIL) #define NESTED_FUNC_ATTR #endif]) +AC_ARG_ENABLE([efiemu], + [AS_HELP_STRING([--enable-efiemu], + [build and install the efiemu runtimes (default=guessed)])]) +if test x"$enable_efiemu" = xno ; then + efiemu_excuse="explicitely disabled" +fi +if test x"$efiemu_excuse" = x ; then + AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_no_red_zone, [ + CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib -c" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_efiemu=yes], + [grub_cv_cc_efiemu=no]) + ]) + if test x$grub_cv_cc_efiemu = x$no; then + efiemu_excuse="compiler doesn't support compiling with -m64 -mcmodel=large -mno-red-zone -nostdlib -c" + fi +fi +if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then + AC_MSG_ERROR([efiemu runtime was explicitely requested but can't be compiled]) +fi +if test x"$efiemu_excuse" = x ; then +enable_efiemu=yes +else +enable_efiemu=no +fi +AC_SUBST([enable_efiemu]) + + # Restore the flags. CC="$tmp_CC" CFLAGS="$tmp_CFLAGS" @@ -454,40 +482,75 @@ AC_ARG_ENABLE([mm-debug], AC_ARG_ENABLE([grub-emu], [AS_HELP_STRING([--enable-grub-emu], - [build and install the `grub-emu' debugging utility])]) + [build and install the `grub-emu' debugging utility (default=guessed)])]) AC_ARG_ENABLE([grub-emu-usb], [AS_HELP_STRING([--enable-grub-emu-usb], - [build and install the `grub-emu' debugging utility with USB support])]) -[if [ x"$enable_grub_emu" = xyes ]; then - # Check for curses libraries.] + [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) +if test x"$enable_grub_emu" = xno ; then + grub_emu_excuse="explicitely disabled" +fi + + [# Check for curses libraries.] +[if [ x"$grub_emu_excuse" = x ]; then ] AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"], [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"], - [AC_MSG_ERROR([(n)curses libraries are required to build `grub-emu'])])]) + [grub_emu_excuse=["(n)curses libraries are required to build \`grub-emu'"]])]) AC_SUBST([LIBCURSES]) - +[fi] +[if [ x"$grub_emu_excuse" = x ]; then ] [# Check for headers.] AC_CHECK_HEADERS([ncurses/curses.h], [], [AC_CHECK_HEADERS([ncurses.h], [], [AC_CHECK_HEADERS([curses.h], [], - [AC_MSG_ERROR([(n)curses header files are required to build `grub-emu'])])])]) - - [if [ x"$enable_grub_emu_usb" = xyes ]; then - # Check for libusb libraries.] - AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], - [AC_MSG_ERROR([libusb libraries are required to build `grub-emu' with USB support])]) - AC_SUBST([LIBUSB]) - - [# Check for headers.] - AC_CHECK_HEADERS([usb.h], [], - [AC_MSG_ERROR([libusb header file is required to build `grub-emu' with USB support])]) - [fi] + [grub_emu_excuse=["(n)curses header files are required to build \`grub-emu'"]])])]) [fi] + +if test x"$enable_grub_emu" = xyes && test x"$grub_emu_excuse" != x ; then + AC_MSG_ERROR([grub-emu was explicitely requested but can't be compiled]) +fi +if test x"$grub_emu_excuse" = x ; then +enable_grub_emu=yes +else +enable_grub_emu=no +grub_emu_usb_excuse="grub-emu isn't built" +fi +if test x"$enable_grub_emu_usb" = xno ; then + grub_emu_usb_excuse="explicitely disabled" +fi +[if [ x"$grub_emu_usb_excuse" = x ]; then + # Check for libusb libraries.] +AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], + [grub_emu_usb_excuse=["libusb libraries are required to build \`grub-emu' with USB support"]]) + AC_SUBST([LIBUSB]) +[fi] +[if [ x"$grub_emu_usb_excuse" = x ]; then + # Check for headers.] + AC_CHECK_HEADERS([usb.h], [], + [grub_emu_usb_excuse=["libusb header file is required to build \`grub-emu' with USB support"]]) +[fi] +if test x"enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then + AC_MSG_ERROR([USB support for grub-emu was explicitely requested but can't be compiled]) +fi +if test x"$grub_emu_usb_excuse" = x ; then +enable_grub_emu_usb=yes +else +enable_grub_emu_usb=no +fi + AC_SUBST([enable_grub_emu]) AC_SUBST([enable_grub_emu_usb]) AC_ARG_ENABLE([grub-fstest], [AS_HELP_STRING([--enable-grub-fstest], - [build and install the `grub-fstest' debugging utility])]) + [build and install the `grub-fstest' debugging utility (default=guessed)])]) +if test x"$enable_grub_fstest" = xno ; then + grub_fstest_excuse="explicitely disabled" +fi +if test x"$grub_fstest_excuse" = x ; then +enable_grub_fstest=yes +else +enable_grub_fstest=no +fi AC_SUBST([enable_grub_fstest]) AC_ARG_ENABLE([grub-pe2elf], @@ -497,24 +560,32 @@ AC_SUBST([enable_grub_pe2elf]) AC_ARG_ENABLE([grub-mkfont], [AS_HELP_STRING([--enable-grub-mkfont], - [build and install the `grub-mkfont' utility])]) -if test x"$enable_grub_mkfont" = xyes ; then + [build and install the `grub-mkfont' utility (default=guessed)])]) +if test x"$enable_grub_mkfont" = xno ; then + grub_mkfont_excuse="explicitely disabled" +fi + +if test x"$grub_mkfont_excuse" = x ; then # Check for freetype libraries. AC_CHECK_PROGS([FREETYPE], [freetype-config]) if test "x$FREETYPE" = x ; then - AC_MSG_ERROR([freetype2 libraries are required to build `grub-mkfont']) + grub_mkfont_excuse=["freetype2 libraries are required to build \`grub-mkfont'"] fi freetype_cflags=`freetype-config --cflags` freetype_libs=`freetype-config --libs` fi +if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then + AC_MSG_ERROR([grub-mkfont was explicitely requested but can't be compiled]) +fi +if test x"$grub_mkfont_excuse" = x ; then +enable_grub_mkfont=yes +else +enable_grub_mkfont=no +fi AC_SUBST([enable_grub_mkfont]) AC_SUBST([freetype_cflags]) AC_SUBST([freetype_libs]) -AC_ARG_ENABLE([efiemu], - [AS_HELP_STRING([--enable-efiemu], - [build and install the efiemu runtimes])]) -AC_SUBST([enable_efiemu]) AC_SUBST(ASFLAGS) # Output files. @@ -532,3 +603,53 @@ fi AC_CONFIG_FILES([Makefile gensymlist.sh genkernsyms.sh]) AC_CONFIG_FILES([stamp-h], [echo timestamp > stamp-h]) AC_OUTPUT +[ +echo "*******************************************************" +echo GRUB2 will be compiled with following components: +echo Platform: "$target_cpu"-"$platform" +if test "$target_cpu"-"$platform" = i386-pc; then +if [ x"$enable_lzo" = xyes ]; then +echo Compression: LZO +else +echo Compression: LZMA +fi +fi +if [ x"$grub_emu_excuse" = x ]; then +echo grub-emu: Yes +else +echo grub-emu: No "($grub_emu_excuse)" +fi +if [ x"$grub_emu_usb_excuse" = x ]; then +echo USB support for grub-emu: Yes +else +echo USB support for grub-emu: No "($grub_emu_usb_excuse)" +fi +if [ x"$enable_mm_debug" = xyes ]; then +echo With memory debugging: Yes +else +echo With memory debugging: No +fi +if [ x"$enable_grub_pe2elf" = xyes ]; then +echo grub-pe2elf will be built and installed +elif [ x$TARGET_OBJ2ELF = xgrub-pe2elf ]; then +echo grub-pe2elf will be built but not installed +else +echo grub-pe2elf will not be built +fi +if [ x"$efiemu_excuse" = x ]; then +echo efiemu runtime: Yes +else +echo efiemu runtime: No "($efiemu_excuse)" +fi +if [ x"$grub_fstest_excuse" = x ]; then +echo grub-fstest: Yes +else +echo grub-fstest: No "($grub_fstest_excuse)" +fi +if [ x"$grub_mkfont_excuse" = x ]; then +echo grub-mkfont: Yes +else +echo grub-mkfont: No "($grub_mkfont_excuse)" +fi +echo "*******************************************************" +] From 830afef7c2f913361192c542f488a5b7f0690a96 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 16 Jul 2009 16:38:19 +0000 Subject: [PATCH 0956/1707] 2009-07-16 Vladimir Serbinenko Enable all targets that can be built by default * configure.ac: enable efiemu runtime, grub-emu, grub-emu-usb, grub-mkfont and grub-fstest if they can be built --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 07c9aada7..e61783106 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,8 +1,8 @@ -2009-06-17 Vladimir Serbinenko +2009-07-16 Vladimir Serbinenko Enable all targets that can be built by default - * configure.c: enable efiemu runtime, grub-emu, grub-emu-usb, + * configure.ac: enable efiemu runtime, grub-emu, grub-emu-usb, grub-mkfont and grub-fstest if they can be built 2009-07-16 Vladimir Serbinenko From eab58da22c9133cfd8de06692d076ecd06154e8e Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 16 Jul 2009 22:14:09 +0000 Subject: [PATCH 0957/1707] 2009-07-16 Pavel Roskin * kern/mm.c (grub_zalloc): New function. (grub_debug_zalloc): Likewise. * include/grub/mm.h: Declare grub_zalloc() and grub_debug_zalloc(). * util/misc.c (grub_zalloc): New function. * bus/usb/uhci.c (grub_uhci_pci_iter): Use grub_zalloc() instead of grub_malloc(), remove unneeded initializations. * bus/usb/usbhub.c (grub_usb_hub_add_dev): Likewise. * commands/extcmd.c (grub_extcmd_dispatcher): Likewise. * commands/parttool.c (grub_cmd_parttool): Likewise. * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Likewise. * disk/raid5_recover.c (grub_raid5_recover): Likewise. * disk/raid6_recover.c (grub_raid6_recover): Likewise. * disk/usbms.c (grub_usbms_finddevs): Likewise. * efiemu/mm.c (grub_efiemu_request_memalign): Likewise. * efiemu/pnvram.c (grub_efiemu_pnvram): Likewise. (grub_cmd_efiemu_pnvram): Likewise. * fs/i386/pc/pxe.c (grub_pxefs_open): Likewise. * fs/iso9660.c (grub_iso9660_mount): Likewise. (grub_iso9660_iterate_dir): Likewise. * fs/jfs.c (grub_jfs_opendir): Likewise. * fs/ntfs.c (list_file): Likewise. (grub_ntfs_mount): Likewise. * kern/disk.c (grub_disk_open): Likewise. * kern/dl.c (grub_dl_load_core): Likewise. * kern/elf.c (grub_elf_file): Likewise. * kern/env.c (grub_env_context_open): Likewise. (grub_env_set): Likewise. (grub_env_set_data_slot): Likewise. * kern/file.c (grub_file_open): Likewise. * kern/fs.c (grub_fs_blocklist_open): Likewise. * loader/i386/multiboot.c (grub_module): Likewise. * loader/xnu.c (grub_xnu_create_key): Likewise. (grub_xnu_create_value): Likewise. * normal/main.c (grub_normal_add_menu_entry): Likewise. (read_config_file): Likewise. * normal/menu_entry.c (make_screen): Likewise. * partmap/sun.c (sun_partition_map_iterate): Likewise. * script/sh/lexer.c (grub_script_lexer_init): Likewise. * script/sh/script.c (grub_script_parse): Likewise. * video/bitmap.c (grub_video_bitmap_create): Likewise. * video/readers/jpeg.c (grub_video_reader_jpeg): Likewise. * video/readers/png.c (grub_png_output_byte): Likewise. (grub_video_reader_png): Likewise. --- ChangeLog | 47 +++++++++++++++++++++++++++++++++++++++++ bus/usb/uhci.c | 5 +---- bus/usb/usbhub.c | 4 +--- commands/extcmd.c | 3 +-- commands/parttool.c | 7 ++---- disk/i386/pc/biosdisk.c | 3 +-- disk/raid5_recover.c | 4 +--- disk/raid6_recover.c | 7 ++---- disk/usbms.c | 4 +--- efiemu/mm.c | 4 +--- efiemu/pnvram.c | 6 ++---- fs/i386/pc/pxe.c | 3 +-- fs/iso9660.c | 7 ++---- fs/jfs.c | 4 +--- fs/ntfs.c | 7 ++---- include/grub/mm.h | 6 ++++++ kern/disk.c | 6 +----- kern/dl.c | 7 +----- kern/elf.c | 3 +-- kern/env.c | 11 +++------- kern/file.c | 5 +---- kern/fs.c | 5 +---- kern/mm.c | 27 +++++++++++++++++++++++ loader/i386/multiboot.c | 3 +-- loader/xnu.c | 7 ++---- normal/main.c | 14 ++++-------- normal/menu_entry.c | 9 +------- partmap/sun.c | 4 +--- script/sh/lexer.c | 11 +--------- script/sh/script.c | 7 +----- util/misc.c | 10 +++++++++ video/bitmap.c | 5 +---- video/readers/jpeg.c | 3 +-- video/readers/png.c | 6 ++---- 34 files changed, 132 insertions(+), 132 deletions(-) diff --git a/ChangeLog b/ChangeLog index e61783106..3b85d3ad1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,50 @@ +2009-07-16 Pavel Roskin + + * kern/mm.c (grub_zalloc): New function. + (grub_debug_zalloc): Likewise. + * include/grub/mm.h: Declare grub_zalloc() and + grub_debug_zalloc(). + * util/misc.c (grub_zalloc): New function. + * bus/usb/uhci.c (grub_uhci_pci_iter): Use grub_zalloc() + instead of grub_malloc(), remove unneeded initializations. + * bus/usb/usbhub.c (grub_usb_hub_add_dev): Likewise. + * commands/extcmd.c (grub_extcmd_dispatcher): Likewise. + * commands/parttool.c (grub_cmd_parttool): Likewise. + * disk/i386/pc/biosdisk.c (grub_biosdisk_open): Likewise. + * disk/raid5_recover.c (grub_raid5_recover): Likewise. + * disk/raid6_recover.c (grub_raid6_recover): Likewise. + * disk/usbms.c (grub_usbms_finddevs): Likewise. + * efiemu/mm.c (grub_efiemu_request_memalign): Likewise. + * efiemu/pnvram.c (grub_efiemu_pnvram): Likewise. + (grub_cmd_efiemu_pnvram): Likewise. + * fs/i386/pc/pxe.c (grub_pxefs_open): Likewise. + * fs/iso9660.c (grub_iso9660_mount): Likewise. + (grub_iso9660_iterate_dir): Likewise. + * fs/jfs.c (grub_jfs_opendir): Likewise. + * fs/ntfs.c (list_file): Likewise. + (grub_ntfs_mount): Likewise. + * kern/disk.c (grub_disk_open): Likewise. + * kern/dl.c (grub_dl_load_core): Likewise. + * kern/elf.c (grub_elf_file): Likewise. + * kern/env.c (grub_env_context_open): Likewise. + (grub_env_set): Likewise. + (grub_env_set_data_slot): Likewise. + * kern/file.c (grub_file_open): Likewise. + * kern/fs.c (grub_fs_blocklist_open): Likewise. + * loader/i386/multiboot.c (grub_module): Likewise. + * loader/xnu.c (grub_xnu_create_key): Likewise. + (grub_xnu_create_value): Likewise. + * normal/main.c (grub_normal_add_menu_entry): Likewise. + (read_config_file): Likewise. + * normal/menu_entry.c (make_screen): Likewise. + * partmap/sun.c (sun_partition_map_iterate): Likewise. + * script/sh/lexer.c (grub_script_lexer_init): Likewise. + * script/sh/script.c (grub_script_parse): Likewise. + * video/bitmap.c (grub_video_bitmap_create): Likewise. + * video/readers/jpeg.c (grub_video_reader_jpeg): Likewise. + * video/readers/png.c (grub_png_output_byte): Likewise. + (grub_video_reader_png): Likewise. + 2009-07-16 Vladimir Serbinenko Enable all targets that can be built by default diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index 84cd48daf..88ff5b3d8 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -170,14 +170,11 @@ grub_uhci_pci_iter (int bus, int device, int func, return 0; /* Allocate memory for the controller and register it. */ - u = grub_malloc (sizeof (*u)); + u = grub_zalloc (sizeof (*u)); if (! u) return 1; u->iobase = base & GRUB_UHCI_IOMASK; - u->framelist = 0; - u->qh = 0; - u->td = 0; grub_dprintf ("uhci", "class=0x%02x 0x%02x interface 0x%02x base=0x%x\n", class, subclass, interf, u->iobase); diff --git a/bus/usb/usbhub.c b/bus/usb/usbhub.c index ba0925a33..6881ce000 100644 --- a/bus/usb/usbhub.c +++ b/bus/usb/usbhub.c @@ -33,13 +33,11 @@ grub_usb_hub_add_dev (grub_usb_controller_t controller, grub_usb_speed_t speed) grub_usb_device_t dev; int i; - dev = grub_malloc (sizeof (struct grub_usb_device)); + dev = grub_zalloc (sizeof (struct grub_usb_device)); if (! dev) return NULL; dev->controller = *controller; - dev->addr = 0; - dev->initialized = 0; dev->speed = speed; grub_usb_device_initialize (dev); diff --git a/commands/extcmd.c b/commands/extcmd.c index a6053872a..16796febf 100644 --- a/commands/extcmd.c +++ b/commands/extcmd.c @@ -40,8 +40,7 @@ grub_extcmd_dispatcher (struct grub_command *cmd, maxargs++; /* Set up the option state. */ - state = grub_malloc (sizeof (struct grub_arg_list) * maxargs); - grub_memset (state, 0, sizeof (struct grub_arg_list) * maxargs); + state = grub_zalloc (sizeof (struct grub_arg_list) * maxargs); if (grub_arg_parse (ext, argc, args, state, &new_args, &new_argc)) { diff --git a/commands/parttool.c b/commands/parttool.c index c807f066b..8c985fc4b 100644 --- a/commands/parttool.c +++ b/commands/parttool.c @@ -242,8 +242,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), if (grub_strcmp (args[i], "help") == 0) return show_help (); - parsed = (int *) grub_malloc (argc * sizeof (int)); - grub_memset (parsed, 0, argc * sizeof (int)); + parsed = (int *) grub_zalloc (argc * sizeof (int)); for (i = 1; i < argc; i++) if (! parsed[i]) @@ -272,9 +271,7 @@ grub_cmd_parttool (grub_command_t cmd __attribute__ ((unused)), args[i]); ptool = cur; pargs = (struct grub_parttool_args *) - grub_malloc (ptool->nargs * sizeof (struct grub_parttool_args)); - grub_memset (pargs, 0, - ptool->nargs * sizeof (struct grub_parttool_args)); + grub_zalloc (ptool->nargs * sizeof (struct grub_parttool_args)); for (j = i; j < argc; j++) if (! parsed[j]) { diff --git a/disk/i386/pc/biosdisk.c b/disk/i386/pc/biosdisk.c index 09f0ce739..0a6137fad 100644 --- a/disk/i386/pc/biosdisk.c +++ b/disk/i386/pc/biosdisk.c @@ -109,12 +109,11 @@ grub_biosdisk_open (const char *name, grub_disk_t disk) disk->has_partitions = ((drive & 0x80) && (drive != cd_drive)); disk->id = drive; - data = (struct grub_biosdisk_data *) grub_malloc (sizeof (*data)); + data = (struct grub_biosdisk_data *) grub_zalloc (sizeof (*data)); if (! data) return grub_errno; data->drive = drive; - data->flags = 0; if ((cd_drive) && (drive == cd_drive)) { diff --git a/disk/raid5_recover.c b/disk/raid5_recover.c index 31cef88b1..a280be1ac 100644 --- a/disk/raid5_recover.c +++ b/disk/raid5_recover.c @@ -32,12 +32,10 @@ grub_raid5_recover (struct grub_raid_array *array, int disknr, int i; size <<= GRUB_DISK_SECTOR_BITS; - buf2 = grub_malloc (size); + buf2 = grub_zalloc (size); if (!buf2) return grub_errno; - grub_memset (buf, 0, size); - for (i = 0; i < (int) array->total_devs; i++) { grub_err_t err; diff --git a/disk/raid6_recover.c b/disk/raid6_recover.c index 3a994afeb..7bbf8eaef 100644 --- a/disk/raid6_recover.c +++ b/disk/raid6_recover.c @@ -96,11 +96,11 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, char *pbuf = 0, *qbuf = 0; size <<= GRUB_DISK_SECTOR_BITS; - pbuf = grub_malloc (size); + pbuf = grub_zalloc (size); if (!pbuf) goto quit; - qbuf = grub_malloc (size); + qbuf = grub_zalloc (size); if (!qbuf) goto quit; @@ -108,9 +108,6 @@ grub_raid6_recover (struct grub_raid_array *array, int disknr, int p, if (q == (int) array->total_devs) q = 0; - grub_memset (pbuf, 0, size); - grub_memset (qbuf, 0, size); - pos = q + 1; if (pos == (int) array->total_devs) pos = 0; diff --git a/disk/usbms.c b/disk/usbms.c index 403ed1913..671e145e6 100644 --- a/disk/usbms.c +++ b/disk/usbms.c @@ -107,14 +107,12 @@ grub_usbms_finddevs (void) } devcnt++; - usbms = grub_malloc (sizeof (struct grub_usbms_dev)); + usbms = grub_zalloc (sizeof (struct grub_usbms_dev)); if (! usbms) return 1; usbms->dev = usbdev; usbms->interface = i; - usbms->in = NULL; - usbms->out = NULL; /* Iterate over all endpoints of this interface, at least a IN and OUT bulk endpoint are required. */ diff --git a/efiemu/mm.c b/efiemu/mm.c index 7d6a5d466..8b0322942 100644 --- a/efiemu/mm.c +++ b/efiemu/mm.c @@ -104,14 +104,12 @@ grub_efiemu_request_memalign (grub_size_t align, grub_size_t size, requested_memory[type] += align_overhead + size; /* Remember the request */ - ret = grub_malloc (sizeof (*ret)); + ret = grub_zalloc (sizeof (*ret)); if (!ret) return -1; ret->type = type; ret->size = size; ret->align_overhead = align_overhead; - ret->val = 0; - ret->next = 0; prev = 0; /* Add request to the end of the chain. diff --git a/efiemu/pnvram.c b/efiemu/pnvram.c index d5daaabb8..04ad6e284 100644 --- a/efiemu/pnvram.c +++ b/efiemu/pnvram.c @@ -339,11 +339,10 @@ grub_efiemu_pnvram (void) accuracy = 50000000; daylight = 0; - nvram = grub_malloc (nvramsize); + nvram = grub_zalloc (nvramsize); if (!nvram) return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't allocate space for temporary pnvram storage"); - grub_memset (nvram, 0, nvramsize); return grub_efiemu_make_nvram (); } @@ -365,11 +364,10 @@ grub_cmd_efiemu_pnvram (struct grub_extcmd *cmd, accuracy = state[3].set ? grub_strtoul (state[3].arg, 0, 0) : 50000000; daylight = state[4].set ? grub_strtoul (state[4].arg, 0, 0) : 0; - nvram = grub_malloc (nvramsize); + nvram = grub_zalloc (nvramsize); if (!nvram) return grub_error (GRUB_ERR_OUT_OF_MEMORY, "Couldn't allocate space for temporary pnvram storage"); - grub_memset (nvram, 0, nvramsize); if (argc == 1 && (err = read_pnvram (args[0]))) { diff --git a/fs/i386/pc/pxe.c b/fs/i386/pc/pxe.c index 1fc5680cf..4032e1254 100644 --- a/fs/i386/pc/pxe.c +++ b/fs/i386/pc/pxe.c @@ -146,11 +146,10 @@ grub_pxefs_open (struct grub_file *file, const char *name) if (c.c2.status) return grub_error (GRUB_ERR_BAD_FS, "open fails"); - data = grub_malloc (sizeof (struct grub_pxe_data) + grub_strlen (name) + 1); + data = grub_zalloc (sizeof (struct grub_pxe_data) + grub_strlen (name) + 1); if (! data) return grub_errno; - data->packet_number = 0; data->block_size = grub_pxe_blksize; grub_strcpy (data->filename, name); diff --git a/fs/iso9660.c b/fs/iso9660.c index c79ad4f33..63d43b047 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -263,13 +263,11 @@ grub_iso9660_mount (grub_disk_t disk) return 0; } - data = grub_malloc (sizeof (struct grub_iso9660_data)); + data = grub_zalloc (sizeof (struct grub_iso9660_data)); if (! data) return 0; data->disk = disk; - data->rockridge = 0; - data->joliet = 0; block = 16; do @@ -509,8 +507,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, else { size = entry->len - 5; - filename = grub_malloc (size + 1); - filename[0] = '\0'; + filename = grub_zalloc (size + 1); } filename_alloc = 1; grub_strncpy (filename, (char *) &entry->data[1], size); diff --git a/fs/jfs.c b/fs/jfs.c index 4f9182576..4ec03d6aa 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -382,11 +382,10 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) return 0; } - diro = grub_malloc (sizeof (struct grub_jfs_diropen)); + diro = grub_zalloc (sizeof (struct grub_jfs_diropen)); if (!diro) return 0; - diro->index = 0; diro->data = data; diro->inode = inode; @@ -397,7 +396,6 @@ grub_jfs_opendir (struct grub_jfs_data *data, struct grub_jfs_inode *inode) diro->next_leaf = (struct grub_jfs_leaf_next_dirent *) de; diro->sorted = (char *) (inode->dir.header.sorted); diro->count = inode->dir.header.count; - diro->dirpage = 0; return diro; } diff --git a/fs/ntfs.c b/fs/ntfs.c index c312b8b62..d03a94016 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -601,11 +601,10 @@ list_file (struct grub_ntfs_file *diro, char *pos, (u32at (pos, 0x48) & ATTR_DIRECTORY) ? GRUB_FSHELP_DIR : GRUB_FSHELP_REG; - fdiro = grub_malloc (sizeof (struct grub_ntfs_file)); + fdiro = grub_zalloc (sizeof (struct grub_ntfs_file)); if (!fdiro) return 0; - grub_memset (fdiro, 0, sizeof (*fdiro)); fdiro->data = diro->data; fdiro->ino = u32at (pos, 0); @@ -791,12 +790,10 @@ grub_ntfs_mount (grub_disk_t disk) if (!disk) goto fail; - data = (struct grub_ntfs_data *) grub_malloc (sizeof (*data)); + data = (struct grub_ntfs_data *) grub_zalloc (sizeof (*data)); if (!data) goto fail; - grub_memset (data, 0, sizeof (*data)); - data->disk = disk; /* Read the BPB. */ diff --git a/include/grub/mm.h b/include/grub/mm.h index 4dd136321..4caf80511 100644 --- a/include/grub/mm.h +++ b/include/grub/mm.h @@ -30,6 +30,7 @@ void grub_mm_init_region (void *addr, grub_size_t size); void *EXPORT_FUNC(grub_malloc) (grub_size_t size); +void *EXPORT_FUNC(grub_zalloc) (grub_size_t size); void EXPORT_FUNC(grub_free) (void *ptr); void *EXPORT_FUNC(grub_realloc) (void *ptr, grub_size_t size); void *EXPORT_FUNC(grub_memalign) (grub_size_t align, grub_size_t size); @@ -45,6 +46,9 @@ void grub_mm_dump (unsigned lineno); #define grub_malloc(size) \ grub_debug_malloc (__FILE__, __LINE__, size) +#define grub_zalloc(size) \ + grub_debug_zalloc (__FILE__, __LINE__, size) + #define grub_realloc(ptr,size) \ grub_debug_realloc (__FILE__, __LINE__, ptr, size) @@ -56,6 +60,8 @@ void grub_mm_dump (unsigned lineno); void *EXPORT_FUNC(grub_debug_malloc) (const char *file, int line, grub_size_t size); +void *EXPORT_FUNC(grub_debug_zalloc) (const char *file, int line, + grub_size_t size); void EXPORT_FUNC(grub_debug_free) (const char *file, int line, void *ptr); void *EXPORT_FUNC(grub_debug_realloc) (const char *file, int line, void *ptr, grub_size_t size); diff --git a/kern/disk.c b/kern/disk.c index e167fb630..e463626fb 100644 --- a/kern/disk.c +++ b/kern/disk.c @@ -244,14 +244,10 @@ grub_disk_open (const char *name) grub_dprintf ("disk", "Opening `%s'...\n", name); - disk = (grub_disk_t) grub_malloc (sizeof (*disk)); + disk = (grub_disk_t) grub_zalloc (sizeof (*disk)); if (! disk) return 0; - disk->dev = 0; - disk->read_hook = 0; - disk->partition = 0; - disk->data = 0; disk->name = grub_strdup (name); if (! disk->name) goto fail; diff --git a/kern/dl.c b/kern/dl.c index 122b6b90e..1fe82e789 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -535,16 +535,11 @@ grub_dl_load_core (void *addr, grub_size_t size) return 0; } - mod = (grub_dl_t) grub_malloc (sizeof (*mod)); + mod = (grub_dl_t) grub_zalloc (sizeof (*mod)); if (! mod) return 0; - mod->name = 0; mod->ref_count = 1; - mod->dep = 0; - mod->segment = 0; - mod->init = 0; - mod->fini = 0; grub_dprintf ("modules", "relocating to %p\n", mod); if (grub_dl_resolve_name (mod, e) diff --git a/kern/elf.c b/kern/elf.c index 259055238..f14161060 100644 --- a/kern/elf.c +++ b/kern/elf.c @@ -61,12 +61,11 @@ grub_elf_file (grub_file_t file) { grub_elf_t elf; - elf = grub_malloc (sizeof (*elf)); + elf = grub_zalloc (sizeof (*elf)); if (! elf) return 0; elf->file = file; - elf->phdrs = 0; if (grub_file_seek (elf->file, 0) == (grub_off_t) -1) goto fail; diff --git a/kern/env.c b/kern/env.c index e85627b0b..750902af8 100644 --- a/kern/env.c +++ b/kern/env.c @@ -80,11 +80,10 @@ grub_env_context_open (int export) struct grub_env_context *context; int i; - context = grub_malloc (sizeof (*context)); + context = grub_zalloc (sizeof (*context)); if (! context) return grub_errno; - grub_memset (context, 0, sizeof (*context)); context->prev = current_context; current_context = context; @@ -204,12 +203,10 @@ grub_env_set (const char *name, const char *val) } /* The variable does not exist, so create a new one. */ - var = grub_malloc (sizeof (*var)); + var = grub_zalloc (sizeof (*var)); if (! var) return grub_errno; - grub_memset (var, 0, sizeof (*var)); - /* This is not necessary, because GRUB_ENV_VAR_LOCAL == 0. But leave this for readability. */ var->type = GRUB_ENV_VAR_LOCAL; @@ -379,12 +376,10 @@ grub_env_set_data_slot (const char *name, const void *ptr) } /* The variable does not exist, so create a new one. */ - var = grub_malloc (sizeof (*var)); + var = grub_zalloc (sizeof (*var)); if (! var) goto fail; - grub_memset (var, 0, sizeof (*var)); - var->type = GRUB_ENV_VAR_DATA; var->name = mangled_name; var->value = (char *) ptr; diff --git a/kern/file.c b/kern/file.c index 5d5e640b1..9b56b88e4 100644 --- a/kern/file.c +++ b/kern/file.c @@ -75,14 +75,11 @@ grub_file_open (const char *name) if (! device) goto fail; - file = (grub_file_t) grub_malloc (sizeof (*file)); + file = (grub_file_t) grub_zalloc (sizeof (*file)); if (! file) goto fail; file->device = device; - file->offset = 0; - file->data = 0; - file->read_hook = 0; if (device->disk && file_name[0] != '/') /* This is a block list. */ diff --git a/kern/fs.c b/kern/fs.c index c8f4970b9..0c456377f 100644 --- a/kern/fs.c +++ b/kern/fs.c @@ -161,7 +161,7 @@ grub_fs_blocklist_open (grub_file_t file, const char *name) while (p); /* Allocate a block list. */ - blocks = grub_malloc (sizeof (struct grub_fs_block) * (num + 1)); + blocks = grub_zalloc (sizeof (struct grub_fs_block) * (num + 1)); if (! blocks) return 0; @@ -179,8 +179,6 @@ grub_fs_blocklist_open (grub_file_t file, const char *name) goto fail; } } - else - blocks[i].offset = 0; p++; blocks[i].length = grub_strtoul (p, &p, 0); @@ -203,7 +201,6 @@ grub_fs_blocklist_open (grub_file_t file, const char *name) p++; } - blocks[i].length = 0; file->data = blocks; return GRUB_ERR_NONE; diff --git a/kern/mm.c b/kern/mm.c index 9a0ae56ed..cbcb99560 100644 --- a/kern/mm.c +++ b/kern/mm.c @@ -68,6 +68,7 @@ #ifdef MM_DEBUG # undef grub_malloc +# undef grub_zalloc # undef grub_realloc # undef grub_free # undef grub_memalign @@ -348,6 +349,19 @@ grub_malloc (grub_size_t size) return grub_memalign (0, size); } +/* Allocate SIZE bytes, clear them and return the pointer. */ +void * +grub_zalloc (grub_size_t size) +{ + void *ret; + + ret = grub_memalign (0, size); + if (ret) + grub_memset (ret, 0, size); + + return ret; +} + /* Deallocate the pointer PTR. */ void grub_free (void *ptr) @@ -522,6 +536,19 @@ grub_debug_malloc (const char *file, int line, grub_size_t size) return ptr; } +void * +grub_debug_zalloc (const char *file, int line, grub_size_t size) +{ + void *ptr; + + if (grub_mm_debug) + grub_printf ("%s:%d: zalloc (0x%zx) = ", file, line, size); + ptr = grub_zalloc (size); + if (grub_mm_debug) + grub_printf ("%p\n", ptr); + return ptr; +} + void grub_debug_free (const char *file, int line, void *ptr) { diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 8ce315eab..87ffcae8d 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -456,13 +456,12 @@ grub_module (int argc, char *argv[]) } else { - struct grub_mod_list *modlist = grub_malloc (sizeof (struct grub_mod_list)); + struct grub_mod_list *modlist = grub_zalloc (sizeof (struct grub_mod_list)); if (! modlist) goto fail; modlist->mod_start = (grub_uint32_t) module; modlist->mod_end = (grub_uint32_t) module + size; modlist->cmdline = (grub_uint32_t) cmdline; - modlist->pad = 0; mbi->mods_count = 1; mbi->mods_addr = (grub_uint32_t) modlist; mbi->flags |= MULTIBOOT_INFO_MODS; diff --git a/loader/xnu.c b/loader/xnu.c index b2c6c059e..aac4ae372 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -278,7 +278,7 @@ grub_xnu_create_key (struct grub_xnu_devtree_key **parent, char *name) ret = grub_xnu_find_key (*parent, name); if (ret) return ret; - ret = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*ret)); + ret = (struct grub_xnu_devtree_key *) grub_zalloc (sizeof (*ret)); if (! ret) { grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't create key %s", name); @@ -292,7 +292,6 @@ grub_xnu_create_key (struct grub_xnu_devtree_key **parent, char *name) return 0; } ret->datasize = -1; - ret->first_child = 0; ret->next = *parent; *parent = ret; return ret; @@ -313,7 +312,7 @@ grub_xnu_create_value (struct grub_xnu_devtree_key **parent, char *name) ret->data = 0; return ret; } - ret = (struct grub_xnu_devtree_key *) grub_malloc (sizeof (*ret)); + ret = (struct grub_xnu_devtree_key *) grub_zalloc (sizeof (*ret)); if (! ret) { grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't create value %s", name); @@ -326,8 +325,6 @@ grub_xnu_create_value (struct grub_xnu_devtree_key **parent, char *name) grub_error (GRUB_ERR_OUT_OF_MEMORY, "can't create value %s", name); return 0; } - ret->datasize = 0; - ret->data = 0; ret->next = *parent; *parent = ret; return ret; diff --git a/normal/main.c b/normal/main.c index 7f6336eeb..66d841867 100644 --- a/normal/main.c +++ b/normal/main.c @@ -166,11 +166,9 @@ grub_normal_add_menu_entry (int argc, const char **args, struct grub_menu_entry_class *classes_tail; /* Allocate dummy head node for class list. */ - classes_head = grub_malloc (sizeof (struct grub_menu_entry_class)); + classes_head = grub_zalloc (sizeof (struct grub_menu_entry_class)); if (! classes_head) return grub_errno; - classes_head->name = 0; - classes_head->next = 0; classes_tail = classes_head; menu = grub_env_get_data_slot ("menu"); @@ -206,7 +204,7 @@ grub_normal_add_menu_entry (int argc, const char **args, } /* Create a new class and add it at the tail of the list. */ - new_class = grub_malloc (sizeof (struct grub_menu_entry_class)); + new_class = grub_zalloc (sizeof (struct grub_menu_entry_class)); if (! new_class) { grub_free (class_name); @@ -215,7 +213,6 @@ grub_normal_add_menu_entry (int argc, const char **args, } /* Fill in the new class node. */ new_class->name = class_name; - new_class->next = 0; /* Link the tail to it, and make it the new tail. */ classes_tail->next = new_class; classes_tail = new_class; @@ -267,7 +264,7 @@ grub_normal_add_menu_entry (int argc, const char **args, while (*last) last = &(*last)->next; - *last = grub_malloc (sizeof (**last)); + *last = grub_zalloc (sizeof (**last)); if (! *last) { free_menu_entry_classes (classes_head); @@ -278,7 +275,6 @@ grub_normal_add_menu_entry (int argc, const char **args, (*last)->title = menutitle; (*last)->classes = classes_head; - (*last)->next = 0; (*last)->sourcecode = menusourcecode; menu->size++; @@ -346,11 +342,9 @@ read_config_file (const char *config) newmenu = grub_env_get_data_slot ("menu"); if (! newmenu) { - newmenu = grub_malloc (sizeof (*newmenu)); + newmenu = grub_zalloc (sizeof (*newmenu)); if (! newmenu) return 0; - newmenu->size = 0; - newmenu->entry_list = 0; grub_env_set_data_slot ("menu", newmenu); } diff --git a/normal/menu_entry.c b/normal/menu_entry.c index 86e581e80..f7662ff75 100644 --- a/normal/menu_entry.c +++ b/normal/menu_entry.c @@ -416,18 +416,11 @@ make_screen (grub_menu_entry_t entry) struct screen *screen; /* Initialize the screen. */ - screen = grub_malloc (sizeof (*screen)); + screen = grub_zalloc (sizeof (*screen)); if (! screen) return 0; screen->num_lines = 1; - screen->column = 0; - screen->real_column = 0; - screen->line = 0; - screen->x = 0; - screen->y = 0; - screen->killed_text = 0; - screen->completion_shown = 0; screen->lines = grub_malloc (sizeof (struct line)); if (! screen->lines) goto fail; diff --git a/partmap/sun.c b/partmap/sun.c index 60947774f..ce6d58899 100644 --- a/partmap/sun.c +++ b/partmap/sun.c @@ -95,12 +95,10 @@ sun_partition_map_iterate (grub_disk_t disk, raw = *disk; raw.partition = 0; - p = (grub_partition_t) grub_malloc (sizeof (struct grub_partition)); + p = (grub_partition_t) grub_zalloc (sizeof (struct grub_partition)); if (! p) return grub_errno; - p->offset = 0; - p->data = 0; p->partmap = &grub_sun_partition_map; if (grub_disk_read (&raw, 0, 0, sizeof (struct grub_sun_block), &block) == GRUB_ERR_NONE) diff --git a/script/sh/lexer.c b/script/sh/lexer.c index 17f18e203..2a56c30a6 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -49,22 +49,13 @@ grub_script_lexer_init (char *script, grub_reader_getline_t getline) { struct grub_lexer_param *param; - param = grub_malloc (sizeof (*param)); + param = grub_zalloc (sizeof (*param)); if (! param) return 0; param->state = GRUB_PARSER_STATE_TEXT; param->getline = getline; - param->refs = 0; - param->done = 0; - param->newscript = 0; param->script = script; - param->record = 0; - param->recording = 0; - param->recordpos = 0; - param->recordlen = 0; - param->tokenonhold = 0; - param->was_newline = 0; return param; } diff --git a/script/sh/script.c b/script/sh/script.c index 89fa9474d..cefafe605 100644 --- a/script/sh/script.c +++ b/script/sh/script.c @@ -304,15 +304,10 @@ grub_script_parse (char *script, grub_reader_getline_t getline) if (! parsed) return 0; - parsestate = grub_malloc (sizeof (*parsestate)); + parsestate = grub_zalloc (sizeof (*parsestate)); if (! parsestate) return 0; - parsestate->err = 0; - parsestate->func_mem = 0; - parsestate->memused = 0; - parsestate->parsed = 0; - /* Initialize the lexer. */ lexstate = grub_script_lexer_init (script, getline); if (! lexstate) diff --git a/util/misc.c b/util/misc.c index f615a42c7..37e75311e 100644 --- a/util/misc.c +++ b/util/misc.c @@ -257,6 +257,16 @@ grub_malloc (grub_size_t size) return xmalloc (size); } +void * +grub_zalloc (grub_size_t size) +{ + void *ret; + + ret = xmalloc (size); + memset (ret, 0, size); + return ret; +} + void grub_free (void *ptr) { diff --git a/video/bitmap.c b/video/bitmap.c index d399fd72b..7b135a5dc 100644 --- a/video/bitmap.c +++ b/video/bitmap.c @@ -137,7 +137,7 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, /* Calculate size needed for the data. */ size = (width * mode_info->bytes_per_pixel) * height; - (*bitmap)->data = grub_malloc (size); + (*bitmap)->data = grub_zalloc (size); if (! (*bitmap)->data) { grub_free (*bitmap); @@ -146,9 +146,6 @@ grub_video_bitmap_create (struct grub_video_bitmap **bitmap, return grub_errno; } - /* Clear bitmap. */ - grub_memset ((*bitmap)->data, 0, size); - return GRUB_ERR_NONE; } diff --git a/video/readers/jpeg.c b/video/readers/jpeg.c index b64bf3f87..460a52872 100644 --- a/video/readers/jpeg.c +++ b/video/readers/jpeg.c @@ -667,12 +667,11 @@ grub_video_reader_jpeg (struct grub_video_bitmap **bitmap, if (!file) return grub_errno; - data = grub_malloc (sizeof (*data)); + data = grub_zalloc (sizeof (*data)); if (data != NULL) { int i; - grub_memset (data, 0, sizeof (*data)); data->file = file; data->bitmap = bitmap; grub_jpeg_decode_jpeg (data); diff --git a/video/readers/png.c b/video/readers/png.c index 733fa7305..c2008aeb2 100644 --- a/video/readers/png.c +++ b/video/readers/png.c @@ -543,11 +543,10 @@ grub_png_output_byte (struct grub_png_data *data, grub_uint8_t n) if (data->first_line) { - blank_line = grub_malloc (row_bytes); + blank_line = grub_zalloc (row_bytes); if (blank_line == NULL) return grub_errno; - grub_memset (blank_line, 0, row_bytes); up = blank_line; } else @@ -843,10 +842,9 @@ grub_video_reader_png (struct grub_video_bitmap **bitmap, if (!file) return grub_errno; - data = grub_malloc (sizeof (*data)); + data = grub_zalloc (sizeof (*data)); if (data != NULL) { - grub_memset (data, 0, sizeof (*data)); data->file = file; data->bitmap = bitmap; From ce7a733d47e9bd90364384453f0ab32cc5b23c40 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 16 Jul 2009 22:22:02 +0000 Subject: [PATCH 0958/1707] 2009-07-16 Pavel Roskin * configure.ac: Typo fixes. --- ChangeLog | 2 ++ configure.ac | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3b85d3ad1..f82851910 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-16 Pavel Roskin + * configure.ac: Typo fixes. + * kern/mm.c (grub_zalloc): New function. (grub_debug_zalloc): Likewise. * include/grub/mm.h: Declare grub_zalloc() and diff --git a/configure.ac b/configure.ac index 473eb9de6..85605149c 100644 --- a/configure.ac +++ b/configure.ac @@ -346,7 +346,7 @@ if test "$target_cpu"-"$platform" = x86_64-efi; then if test "x$grub_cv_cc_mcmodel" = xno; then CFLAGS="$SAVED_CFLAGS -m64 -DMCMODEL_SMALL=1" TARGET_CFLAGS="$TARGET_CFLAGS -DMCMODEL_SMALL=1" - AC_MSG_WARN([-mcmodel=large not supported. You wan't be able to use the memory over 4GiB. Upgrade your gcc]) + AC_MSG_WARN([-mcmodel=large not supported. You won't be able to use the memory over 4GiB. Upgrade your gcc]) else TARGET_CFLAGS="$TARGET_CFLAGS -mcmodel=large" fi @@ -438,7 +438,7 @@ AC_ARG_ENABLE([efiemu], [AS_HELP_STRING([--enable-efiemu], [build and install the efiemu runtimes (default=guessed)])]) if test x"$enable_efiemu" = xno ; then - efiemu_excuse="explicitely disabled" + efiemu_excuse="explicitly disabled" fi if test x"$efiemu_excuse" = x ; then AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_no_red_zone, [ @@ -452,7 +452,7 @@ if test x"$efiemu_excuse" = x ; then fi fi if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then - AC_MSG_ERROR([efiemu runtime was explicitely requested but can't be compiled]) + AC_MSG_ERROR([efiemu runtime was explicitly requested but can't be compiled]) fi if test x"$efiemu_excuse" = x ; then enable_efiemu=yes @@ -487,7 +487,7 @@ AC_ARG_ENABLE([grub-emu-usb], [AS_HELP_STRING([--enable-grub-emu-usb], [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) if test x"$enable_grub_emu" = xno ; then - grub_emu_excuse="explicitely disabled" + grub_emu_excuse="explicitly disabled" fi [# Check for curses libraries.] @@ -506,7 +506,7 @@ fi [fi] if test x"$enable_grub_emu" = xyes && test x"$grub_emu_excuse" != x ; then - AC_MSG_ERROR([grub-emu was explicitely requested but can't be compiled]) + AC_MSG_ERROR([grub-emu was explicitly requested but can't be compiled]) fi if test x"$grub_emu_excuse" = x ; then enable_grub_emu=yes @@ -515,7 +515,7 @@ enable_grub_emu=no grub_emu_usb_excuse="grub-emu isn't built" fi if test x"$enable_grub_emu_usb" = xno ; then - grub_emu_usb_excuse="explicitely disabled" + grub_emu_usb_excuse="explicitly disabled" fi [if [ x"$grub_emu_usb_excuse" = x ]; then # Check for libusb libraries.] @@ -529,7 +529,7 @@ AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], [grub_emu_usb_excuse=["libusb header file is required to build \`grub-emu' with USB support"]]) [fi] if test x"enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then - AC_MSG_ERROR([USB support for grub-emu was explicitely requested but can't be compiled]) + AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled]) fi if test x"$grub_emu_usb_excuse" = x ; then enable_grub_emu_usb=yes @@ -544,7 +544,7 @@ AC_ARG_ENABLE([grub-fstest], [AS_HELP_STRING([--enable-grub-fstest], [build and install the `grub-fstest' debugging utility (default=guessed)])]) if test x"$enable_grub_fstest" = xno ; then - grub_fstest_excuse="explicitely disabled" + grub_fstest_excuse="explicitly disabled" fi if test x"$grub_fstest_excuse" = x ; then enable_grub_fstest=yes @@ -562,7 +562,7 @@ AC_ARG_ENABLE([grub-mkfont], [AS_HELP_STRING([--enable-grub-mkfont], [build and install the `grub-mkfont' utility (default=guessed)])]) if test x"$enable_grub_mkfont" = xno ; then - grub_mkfont_excuse="explicitely disabled" + grub_mkfont_excuse="explicitly disabled" fi if test x"$grub_mkfont_excuse" = x ; then @@ -575,7 +575,7 @@ if test x"$grub_mkfont_excuse" = x ; then freetype_libs=`freetype-config --libs` fi if test x"$enable_grub_mkfont" = xyes && test x"$grub_mkfont_excuse" != x ; then - AC_MSG_ERROR([grub-mkfont was explicitely requested but can't be compiled]) + AC_MSG_ERROR([grub-mkfont was explicitly requested but can't be compiled]) fi if test x"$grub_mkfont_excuse" = x ; then enable_grub_mkfont=yes From 43e6200c7361668540863746338a21172c66f5b6 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 16 Jul 2009 22:33:20 +0000 Subject: [PATCH 0959/1707] 2009-07-16 Pavel Roskin * configure.ac: Fix wrong use of grub_cv_cc_no_red_zone where grub_cv_cc_efiemu should be used. --- ChangeLog | 3 +++ configure.ac | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f82851910..56099da61 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-07-16 Pavel Roskin + * configure.ac: Fix wrong use of grub_cv_cc_no_red_zone where + grub_cv_cc_efiemu should be used. + * configure.ac: Typo fixes. * kern/mm.c (grub_zalloc): New function. diff --git a/configure.ac b/configure.ac index 85605149c..8da8a0a4f 100644 --- a/configure.ac +++ b/configure.ac @@ -441,7 +441,7 @@ if test x"$enable_efiemu" = xno ; then efiemu_excuse="explicitly disabled" fi if test x"$efiemu_excuse" = x ; then - AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_no_red_zone, [ + AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib -c" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_efiemu=yes], From 55c7090456ac38ff174924a90424fdcceebdf3d9 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 16 Jul 2009 22:43:58 +0000 Subject: [PATCH 0960/1707] 2009-07-16 Pavel Roskin * configure.ac: Fix incorrect comparison for grub_cv_cc_efiemu. --- ChangeLog | 2 ++ configure.ac | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 56099da61..ac76fc091 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-16 Pavel Roskin + * configure.ac: Fix incorrect comparison for grub_cv_cc_efiemu. + * configure.ac: Fix wrong use of grub_cv_cc_no_red_zone where grub_cv_cc_efiemu should be used. diff --git a/configure.ac b/configure.ac index 8da8a0a4f..34af5f58e 100644 --- a/configure.ac +++ b/configure.ac @@ -447,7 +447,7 @@ if test x"$efiemu_excuse" = x ; then [grub_cv_cc_efiemu=yes], [grub_cv_cc_efiemu=no]) ]) - if test x$grub_cv_cc_efiemu = x$no; then + if test x$grub_cv_cc_efiemu = xno; then efiemu_excuse="compiler doesn't support compiling with -m64 -mcmodel=large -mno-red-zone -nostdlib -c" fi fi From d2838156470655d905388e992da77e33bbf92b4f Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 16 Jul 2009 23:00:59 +0000 Subject: [PATCH 0961/1707] 2009-07-16 Pavel Roskin * configure.ac: Never add "-c" to CFLAGS. --- ChangeLog | 2 ++ configure.ac | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac76fc091..e38ebc5f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,7 @@ 2009-07-16 Pavel Roskin + * configure.ac: Never add "-c" to CFLAGS. + * configure.ac: Fix incorrect comparison for grub_cv_cc_efiemu. * configure.ac: Fix wrong use of grub_cv_cc_no_red_zone where diff --git a/configure.ac b/configure.ac index 34af5f58e..90464036c 100644 --- a/configure.ac +++ b/configure.ac @@ -442,13 +442,13 @@ if test x"$enable_efiemu" = xno ; then fi if test x"$efiemu_excuse" = x ; then AC_CACHE_CHECK([whether options required for efiemu work], grub_cv_cc_efiemu, [ - CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib -c" + CFLAGS="$CFLAGS -m64 -mcmodel=large -mno-red-zone -nostdlib" AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], [grub_cv_cc_efiemu=yes], [grub_cv_cc_efiemu=no]) ]) if test x$grub_cv_cc_efiemu = xno; then - efiemu_excuse="compiler doesn't support compiling with -m64 -mcmodel=large -mno-red-zone -nostdlib -c" + efiemu_excuse="compiler doesn't support compiling with -m64 -mcmodel=large -mno-red-zone -nostdlib" fi fi if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then From ac70fa32dd01482b1ce09d31ac83d0ae61fef81e Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 19 Jul 2009 13:59:21 +0000 Subject: [PATCH 0962/1707] 2009-07-19 Vladimir Serbinenko * disk/usbms.c (grub_usbms_transfer): Fix double semicolon. * fs/xfs.c (grub_xfs_dir): Likewise. * fs/afs.c (grub_afs_dir): Likewise. * fs/iso9660.c (grub_iso9660_iterate_dir): Likewise. (grub_iso9660_open): Likewise. * fs/jfs.c (grub_jfs_open): Likewise. * fs/ext2.c (grub_ext2_dir): Likewise. * include/grub/macho.h (grub_macho_fat_arch): Likewise. * script/sh/lexer.c (grub_script_yylex): Likewise. --- ChangeLog | 12 ++++++++++++ disk/usbms.c | 2 +- fs/afs.c | 2 +- fs/ext2.c | 2 +- fs/iso9660.c | 4 ++-- fs/jfs.c | 2 +- fs/xfs.c | 2 +- include/grub/macho.h | 2 +- script/sh/lexer.c | 2 +- 9 files changed, 21 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index e38ebc5f7..bfceb2356 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-07-19 Vladimir Serbinenko + + * disk/usbms.c (grub_usbms_transfer): Fix double semicolon. + * fs/xfs.c (grub_xfs_dir): Likewise. + * fs/afs.c (grub_afs_dir): Likewise. + * fs/iso9660.c (grub_iso9660_iterate_dir): Likewise. + (grub_iso9660_open): Likewise. + * fs/jfs.c (grub_jfs_open): Likewise. + * fs/ext2.c (grub_ext2_dir): Likewise. + * include/grub/macho.h (grub_macho_fat_arch): Likewise. + * script/sh/lexer.c (grub_script_yylex): Likewise. + 2009-07-16 Pavel Roskin * configure.ac: Never add "-c" to CFLAGS. diff --git a/disk/usbms.c b/disk/usbms.c index 671e145e6..51e886520 100644 --- a/disk/usbms.c +++ b/disk/usbms.c @@ -247,7 +247,7 @@ grub_usbms_transfer (struct grub_scsi *scsi, grub_size_t cmdsize, char *cmd, grub_usb_clear_halt (dev->dev, dev->out->endp_addr); goto retry; } - return grub_error (GRUB_ERR_IO, "USB Mass Storage request failed");; + return grub_error (GRUB_ERR_IO, "USB Mass Storage request failed"); } /* Read/write the data. */ diff --git a/fs/afs.c b/fs/afs.c index 1f6e1633c..832a95c38 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -557,7 +557,7 @@ grub_afs_dir (grub_device_t device, const char *path, int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { - struct grub_afs_data *data = 0;; + struct grub_afs_data *data = 0; struct grub_fshelp_node *fdiro = 0; auto int NESTED_FUNC_ATTR iterate (const char *filename, diff --git a/fs/ext2.c b/fs/ext2.c index 0fff2fef8..0341680ea 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -786,7 +786,7 @@ grub_ext2_dir (grub_device_t device, const char *path, int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { - struct grub_ext2_data *data = 0;; + struct grub_ext2_data *data = 0; struct grub_fshelp_node *fdiro = 0; auto int NESTED_FUNC_ATTR iterate (const char *filename, diff --git a/fs/iso9660.c b/fs/iso9660.c index 63d43b047..9b7ce765b 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -562,7 +562,7 @@ grub_iso9660_iterate_dir (grub_fshelp_node_t dir, int nameoffset = offset + sizeof (dirent); struct grub_fshelp_node *node; int sua_off = (sizeof (dirent) + dirent.namelen + 1 - - (dirent.namelen % 2));; + - (dirent.namelen % 2)); int sua_size = dirent.len - sua_off; sua_off += offset + dir->data->susp_skip; @@ -756,7 +756,7 @@ grub_iso9660_open (struct grub_file *file, const char *name) grub_free (data); - return grub_errno;; + return grub_errno; } diff --git a/fs/jfs.c b/fs/jfs.c index 4ec03d6aa..ae7486a2f 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -808,7 +808,7 @@ grub_jfs_open (struct grub_file *file, const char *name) grub_free (data); - return grub_errno;; + return grub_errno; } diff --git a/fs/xfs.c b/fs/xfs.c index 68a4b4f56..ddaba5720 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -621,7 +621,7 @@ grub_xfs_dir (grub_device_t device, const char *path, int (*hook) (const char *filename, const struct grub_dirhook_info *info)) { - struct grub_xfs_data *data = 0;; + struct grub_xfs_data *data = 0; struct grub_fshelp_node *fdiro = 0; auto int NESTED_FUNC_ATTR iterate (const char *filename, diff --git a/include/grub/macho.h b/include/grub/macho.h index 0463d3753..0604100e9 100644 --- a/include/grub/macho.h +++ b/include/grub/macho.h @@ -39,7 +39,7 @@ struct grub_macho_fat_arch grub_uint32_t offset; grub_uint32_t size; grub_uint32_t align; -} __attribute__ ((packed));; +} __attribute__ ((packed)); /* File header for 32-bit. Always in native-endian. */ struct grub_macho_header32 diff --git a/script/sh/lexer.c b/script/sh/lexer.c index 2a56c30a6..44d7da2ad 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -246,7 +246,7 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) { char c; grub_dprintf ("scripting", "token=`%c'\n", *state->script); - c = *state->script;; + c = *state->script; nextchar (state); state->tokenonhold = c; doexit = 1; From 5680109e00d7d0ec289220207c411ac7bd0d605b Mon Sep 17 00:00:00 2001 From: proski Date: Sun, 19 Jul 2009 20:23:33 +0000 Subject: [PATCH 0963/1707] 2009-07-19 Pavel Roskin * Makefile.in: Remove LIBLZO and enable_lzo. * conf/i386-pc.rmk: Remove lzo support. * configure.ac: Remove checks for lzo, don't define ENABLE_LZMA. * include/grub/i386/pc/kernel.h: Define ENABLE_LZMA. Remove lzo support. * kern/i386/pc/lzo1x.S: Remove. * kern/i386/pc/startup.S: Remove lzo support. * util/i386/pc/grub-mkimage.c: Likewise. --- ChangeLog | 11 ++ INSTALL | 1 - Makefile.in | 2 - NEWS | 2 +- THANKS | 2 +- conf/i386-pc.rmk | 6 - configure.ac | 33 ---- include/grub/i386/pc/kernel.h | 7 +- kern/i386/pc/lzo1x.S | 315 ---------------------------------- kern/i386/pc/startup.S | 19 +- util/i386/pc/grub-mkimage.c | 54 +----- 11 files changed, 21 insertions(+), 431 deletions(-) delete mode 100644 kern/i386/pc/lzo1x.S diff --git a/ChangeLog b/ChangeLog index bfceb2356..5a2effbd3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-07-19 Pavel Roskin + + * Makefile.in: Remove LIBLZO and enable_lzo. + * conf/i386-pc.rmk: Remove lzo support. + * configure.ac: Remove checks for lzo, don't define ENABLE_LZMA. + * include/grub/i386/pc/kernel.h: Define ENABLE_LZMA. Remove lzo + support. + * kern/i386/pc/lzo1x.S: Remove. + * kern/i386/pc/startup.S: Remove lzo support. + * util/i386/pc/grub-mkimage.c: Likewise. + 2009-07-19 Vladimir Serbinenko * disk/usbms.c (grub_usbms_transfer): Fix double semicolon. diff --git a/INSTALL b/INSTALL index 47d9295fc..6048b1d6e 100644 --- a/INSTALL +++ b/INSTALL @@ -16,7 +16,6 @@ configuring the GRUB. * GNU Bison * GNU binutils 2.9.1.0.23 or later * Other standard GNU/Unix tools -* LZO 1.02 or later (optional) * Ruby 1.6 or later * Autoconf 2.59 or later diff --git a/Makefile.in b/Makefile.in index 436db63ca..25acce7b1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -94,7 +94,6 @@ HELP2MAN := LANG=C $(HELP2MAN) --no-info --source=FSF endif AWK = @AWK@ LIBCURSES = @LIBCURSES@ -LIBLZO = @LIBLZO@ LIBUSB = @LIBUSB@ YACC = @YACC@ UNIFONT_BDF = @UNIFONT_BDF@ @@ -104,7 +103,6 @@ enable_grub_emu = @enable_grub_emu@ enable_grub_emu_usb = @enable_grub_emu_usb@ enable_grub_fstest = @enable_grub_fstest@ enable_grub_pe2elf = @enable_grub_pe2elf@ -enable_lzo = @enable_lzo@ enable_grub_mkfont = @enable_grub_mkfont@ freetype_cflags = @freetype_cflags@ freetype_libs = @freetype_libs@ diff --git a/NEWS b/NEWS index ec10abce4..c54095e9b 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ New in 1.97 - : * Add x86_64 EFI support. -* Add support for LZMA compression. +* Use LZMA compression instead of LZO. * Support for saving the environment from and loading the environment from a file. diff --git a/THANKS b/THANKS index 445bb6f0d..5ce190944 100644 --- a/THANKS +++ b/THANKS @@ -30,7 +30,7 @@ Vincent Guffens Vincent Pelletier Vladimir Serbinenko -Also, we thank the projects GNU Automake and LZO. Some code +Also, we thank the projects GNU Automake and LZMA. Some code was stolen from them. This project was supported by Information-technology Promotion Agency, diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index f1915b646..f5bded28a 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -89,14 +89,8 @@ sbin_UTILITIES += grub-emu endif # For grub-mkimage. -ifeq ($(enable_lzo), yes) -grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ - util/resolve.c -grub_mkimage_LDFLAGS = $(LIBLZO) -else grub_mkimage_SOURCES = util/i386/pc/grub-mkimage.c util/misc.c \ util/resolve.c lib/LzmaEnc.c lib/LzFind.c -endif grub_mkimage_CFLAGS = -DGRUB_KERNEL_MACHINE_LINK_ADDR=$(GRUB_KERNEL_MACHINE_LINK_ADDR) util/i386/pc/grub-mkimage.c_DEPENDENCIES = Makefile diff --git a/configure.ac b/configure.ac index 90464036c..b5c8acbb6 100644 --- a/configure.ac +++ b/configure.ac @@ -171,32 +171,6 @@ if test x$grub_cv_apple_cc = xyes ; then ASFLAGS="$ASFLAGS -DAPPLE_CC=1" fi -# Check LZO when compiling for the i386-pc. -if test "$target_cpu"-"$platform" = i386-pc; then - AC_ARG_ENABLE([lzo], - [AS_HELP_STRING([--enable-lzo], - [use lzo to compress kernel (default is lzma)])]) - [if [ x"$enable_lzo" = xyes ]; then - # There are three possibilities. LZO version 2 installed with the name - # liblzo2, with the name liblzo, and LZO version 1.] - AC_DEFINE([ENABLE_LZO], [1], [Use lzo compression]) - AC_CHECK_LIB([lzo2], [__lzo_init_v2], [LIBLZO="-llzo2"], - [AC_CHECK_LIB([lzo], [__lzo_init_v2], [LIBLZO="-llzo"], - [AC_CHECK_LIB([lzo], [__lzo_init2], [LIBLZO="-llzo"], - [AC_MSG_ERROR([LZO library version 1.02 or later is required])])])]) - AC_SUBST([LIBLZO]) - [LIBS="$LIBS $LIBLZO"] - AC_CHECK_FUNC([lzo1x_999_compress], , - [AC_MSG_ERROR([LZO1X-999 must be enabled])]) - - [# LZO version 2 uses lzo/lzo1x.h, while LZO version 1 uses lzo1x.h.] - AC_CHECK_HEADERS([lzo/lzo1x.h lzo1x.h]) - [else] - AC_DEFINE([ENABLE_LZMA], [1], [Use lzma compression]) - [fi] - AC_SUBST([enable_lzo]) -fi - # Check for functions. AC_CHECK_FUNCS(posix_memalign memalign asprintf) @@ -607,13 +581,6 @@ AC_OUTPUT echo "*******************************************************" echo GRUB2 will be compiled with following components: echo Platform: "$target_cpu"-"$platform" -if test "$target_cpu"-"$platform" = i386-pc; then -if [ x"$enable_lzo" = xyes ]; then -echo Compression: LZO -else -echo Compression: LZMA -fi -fi if [ x"$grub_emu_excuse" = x ]; then echo grub-emu: Yes else diff --git a/include/grub/i386/pc/kernel.h b/include/grub/i386/pc/kernel.h index 5b9d8dcb5..e830afae2 100644 --- a/include/grub/i386/pc/kernel.h +++ b/include/grub/i386/pc/kernel.h @@ -41,11 +41,10 @@ #define GRUB_KERNEL_MACHINE_DATA_END 0x5c /* The size of the first region which won't be compressed. */ -#if defined(ENABLE_LZO) -#define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x450) -#elif defined(ENABLE_LZMA) #define GRUB_KERNEL_MACHINE_RAW_SIZE (GRUB_KERNEL_MACHINE_DATA_END + 0x5F0) -#endif + +/* Enable LZMA compression */ +#define ENABLE_LZMA 1 #ifndef ASM_FILE diff --git a/kern/i386/pc/lzo1x.S b/kern/i386/pc/lzo1x.S deleted file mode 100644 index 49ba8cc1a..000000000 --- a/kern/i386/pc/lzo1x.S +++ /dev/null @@ -1,315 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 1996-2002 Markus Franz Xaver Johannes Oberhumer - * Copyright (C) 2003,2007 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -/* - * This code was stolen from the files enter.sh, leave.sh, lzo1x_d.sh, - * lzo1x_f.s and lzo_asm.h in LZO version 1.08, and was heavily modified - * to adapt it to GRUB's requirement. - * - * See , for more information - * about LZO. - */ - -#define INP 4+16(%esp) -#define INS 8+16(%esp) -#define OUTP 12+16(%esp) -#define NN 3 -#define N_3 %ebp -#define N_255 $255 -#define LODSB movb (%esi), %al ; incl %esi -#define NOTL_3(r) xorl N_3, r -#define MOVSL(r1,r2,x) movl (r1), x ; addl $4, r1 ; movl x, (r2) ; addl $4, r2 -#define COPYL_C(r1,r2,x,rc) 9: MOVSL(r1,r2,x) ; decl rc ; jnz 9b -#define COPYL(r1,r2,x) COPYL_C(r1,r2,x,%ecx) - -lzo1x_decompress: - pushl %ebp - pushl %edi - pushl %esi - pushl %ebx - - cld - - movl INP, %esi - movl OUTP, %edi - movl $3, %ebp - - - xorl %eax, %eax - xorl %ebx, %ebx /* high bits 9-32 stay 0 */ - lodsb - cmpb $17, %al - jbe .L01 - subb $17-NN, %al - jmp .LFLR - - -/*********************************************************************** -// literal run -************************************************************************/ - -0: addl N_255, %eax -1: movb (%esi), %bl - incl %esi - orb %bl, %bl - jz 0b - leal 18+NN(%eax,%ebx), %eax - jmp 3f - - -.L00: - LODSB -.L01: - cmpb $16, %al - jae .LMATCH - - /* a literal run */ - orb %al, %al - jz 1b - addl $3+NN, %eax -3: -.LFLR: - movl %eax, %ecx - NOTL_3(%eax) - shrl $2, %ecx - andl N_3, %eax - COPYL(%esi,%edi,%edx) - subl %eax, %esi - subl %eax, %edi - - LODSB - cmpb $16, %al - jae .LMATCH - - -/*********************************************************************** -// R1 -************************************************************************/ - - shrl $2, %eax - movb (%esi), %bl - leal -0x801(%edi), %edx - leal (%eax,%ebx,4), %eax - incl %esi - subl %eax, %edx - movl (%edx), %ecx - movl %ecx, (%edi) - addl N_3, %edi - jmp .LMDONE - - -/*********************************************************************** -// M2 -************************************************************************/ - -.LMATCH: - cmpb $64, %al - jb .LM3MATCH - - /* a M2 match */ - movl %eax, %ecx - shrl $2, %eax - leal -1(%edi), %edx - andl $7, %eax - movb (%esi), %bl - shrl $5, %ecx - leal (%eax,%ebx,8), %eax - incl %esi - subl %eax, %edx - - addl $1+3, %ecx - - cmpl N_3, %eax - jae .LCOPYLONG - jmp .LCOPYBYTE - - -/*********************************************************************** -// M3 -************************************************************************/ - -0: addl N_255, %eax -1: movb (%esi), %bl - incl %esi - orb %bl, %bl - jz 0b - leal 33+NN(%eax,%ebx), %ecx - xorl %eax, %eax - jmp 3f - - -.LM3MATCH: - cmpb $32, %al - jb .LM4MATCH - - /* a M3 match */ - andl $31, %eax - jz 1b - lea 2+NN(%eax), %ecx -3: - movw (%esi), %ax - leal -1(%edi), %edx - shrl $2, %eax - addl $2, %esi - subl %eax, %edx - - cmpl N_3, %eax - jb .LCOPYBYTE - - -/*********************************************************************** -// copy match -************************************************************************/ - -.LCOPYLONG: /* copy match using longwords */ - leal -3(%edi,%ecx), %eax - shrl $2, %ecx - COPYL(%edx,%edi,%ebx) - movl %eax, %edi - xorl %ebx, %ebx - -.LMDONE: - movb -2(%esi), %al - andl N_3, %eax - jz .L00 -.LFLR3: - movl (%esi), %edx - addl %eax, %esi - movl %edx, (%edi) - addl %eax, %edi - - LODSB - jmp .LMATCH - - -.LCOPYBYTE: /* copy match using bytes */ - xchgl %edx,%esi - subl N_3,%ecx - - rep - movsb - movl %edx, %esi - jmp .LMDONE - - -/*********************************************************************** -// M4 -************************************************************************/ - -0: addl N_255, %ecx -1: movb (%esi), %bl - incl %esi - orb %bl, %bl - jz 0b - leal 9+NN(%ebx,%ecx), %ecx - jmp 3f - - -.LM4MATCH: - cmpb $16, %al - jb .LM1MATCH - - /* a M4 match */ - movl %eax, %ecx - andl $8, %eax - shll $13, %eax /* save in bit 16 */ - andl $7, %ecx - jz 1b - addl $2+NN, %ecx -3: - movw (%esi), %ax - addl $2, %esi - leal -0x4000(%edi), %edx - shrl $2, %eax - jz .LEOF - subl %eax, %edx - jmp .LCOPYLONG - - -/*********************************************************************** -// M1 -************************************************************************/ - -.LM1MATCH: - /* a M1 match */ - shrl $2, %eax - movb (%esi), %bl - leal -1(%edi), %edx - leal (%eax,%ebx,4), %eax - incl %esi - subl %eax, %edx - - movb (%edx), %al /* we must use this because edx can be edi-1 */ - movb %al, (%edi) - movb 1(%edx), %bl - movb %bl, 1(%edi) - addl $2, %edi - jmp .LMDONE - - -/*********************************************************************** -// -************************************************************************/ - -.LEOF: -/**** xorl %eax,%eax eax=0 from above */ - - cmpl $3+NN, %ecx /* ecx must be 3/6 */ - setnz %al - - /* check compressed size */ - movl INP, %edx - addl INS, %edx - cmpl %edx, %esi /* check compressed size */ - ja .L_input_overrun - jb .L_input_not_consumed - -.L_leave: - negl %eax - jnz 1f - - subl OUTP, %edi /* write back the uncompressed size */ - movl %edi, %eax - -1: popl %ebx - popl %esi - popl %edi - popl %ebp - ret - -.L_input_not_consumed: - movl $8, %eax /* LZO_E_INPUT_NOT_CONSUMED */ - jmp .L_leave - -.L_input_overrun: - movl $4, %eax /* LZO_E_INPUT_OVERRUN */ - jmp .L_leave - -#undef INP -#undef INS -#undef OUTP -#undef NN -#undef NN -#undef N_3 -#undef N_255 -#undef LODSB -#undef NOTL_3 -#undef MOVSL -#undef COPYL_C -#undef COPYL diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 171fbeabe..be258fb08 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -210,20 +210,7 @@ codestart: incl %eax call EXT_C(grub_gate_a20) -#if defined(ENABLE_LZO) - /* decompress the compressed part and put the result at 1MB */ - movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %esi - movl $(_start + GRUB_KERNEL_MACHINE_RAW_SIZE), %edi - - pushl %esi - pushl EXT_C(grub_compressed_size) - pushl %edi - call lzo1x_decompress - addl $12, %esp - - movl %eax, %ecx - cld -#elif defined(ENABLE_LZMA) +#ifdef ENABLE_LZMA movl $GRUB_MEMORY_MACHINE_DECOMPRESSION_ADDR, %edi movl $(_start + GRUB_KERNEL_MACHINE_RAW_SIZE), %esi pushl %edi @@ -451,9 +438,7 @@ gate_a20_check_state: popl %ebx ret -#if defined(ENABLE_LZO) -#include "lzo1x.S" -#elif defined(ENABLE_LZMA) +#ifdef ENABLE_LZMA #include "lzma_decode.S" #endif diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index ee1af822a..b81392ce8 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -36,57 +36,9 @@ #define _GNU_SOURCE 1 #include -#if defined(ENABLE_LZO) - -#if defined(HAVE_LZO_LZO1X_H) -# include -#elif defined(HAVE_LZO1X_H) -# include -#endif - -#elif defined(ENABLE_LZMA) - +#ifdef ENABLE_LZMA #include -#endif - -#if defined(ENABLE_LZO) - -static void -compress_kernel (char *kernel_img, size_t kernel_size, - char **core_img, size_t *core_size) -{ - lzo_uint size; - char *wrkmem; - - if (kernel_size < GRUB_KERNEL_MACHINE_RAW_SIZE) - grub_util_error ("the core image is too small"); - - if (lzo_init () != LZO_E_OK) - grub_util_error ("cannot initialize LZO"); - - *core_img = xmalloc (kernel_size + kernel_size / 64 + 16 + 3); - wrkmem = xmalloc (LZO1X_999_MEM_COMPRESS); - - memcpy (*core_img, kernel_img, GRUB_KERNEL_MACHINE_RAW_SIZE); - - grub_util_info ("compressing the core image"); - if (lzo1x_999_compress ((const lzo_byte *) (kernel_img - + GRUB_KERNEL_MACHINE_RAW_SIZE), - kernel_size - GRUB_KERNEL_MACHINE_RAW_SIZE, - (lzo_byte *) (*core_img - + GRUB_KERNEL_MACHINE_RAW_SIZE), - &size, wrkmem) - != LZO_E_OK) - grub_util_error ("cannot compress the kernel image"); - - free (wrkmem); - - *core_size = (size_t) size + GRUB_KERNEL_MACHINE_RAW_SIZE; -} - -#elif defined(ENABLE_LZMA) - static void *SzAlloc(void *p, size_t size) { p = p; return xmalloc(size); } static void SzFree(void *p, void *address) { p = p; free(address); } static ISzAlloc g_Alloc = { SzAlloc, SzFree }; @@ -124,7 +76,7 @@ compress_kernel (char *kernel_img, size_t kernel_size, *core_size += GRUB_KERNEL_MACHINE_RAW_SIZE; } -#else +#else /* No lzma compression */ static void compress_kernel (char *kernel_img, size_t kernel_size, @@ -135,7 +87,7 @@ compress_kernel (char *kernel_img, size_t kernel_size, *core_size = kernel_size; } -#endif +#endif /* No lzma compression */ static void generate_image (const char *dir, char *prefix, FILE *out, char *mods[], From 186f3189a1a06518ec53bda3f5e3b743d583ea2b Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 20 Jul 2009 09:48:25 +0000 Subject: [PATCH 0964/1707] 2009-07-20 Vladimir Serbinenko Fix AtheFS support. * fs/afs.c: Fix comments style. (grub_afs_blockrun): Declare as packed. (grub_afs_datastream): Likewise. (grub_afs_bnode): Likewise. (grub_afs_btree): Likewise. (grub_afs_sblock): Likewise. Declare `name' as char. (grub_afs_inode): Declare as packed. Change void *vnode to grub_uint32_t unused. (grub_afs_iterate_dir): Check that key_size is positive. (grub_afs_mount): Don't read superblock twice. (grub_afs_dir): Don't free node in case of errorx grub_fshelp_find_file already handles this. (grub_afs_open): Likewise. --- ChangeLog | 19 +++++++++++++++++++ fs/afs.c | 53 ++++++++++++++++++++++++----------------------------- 2 files changed, 43 insertions(+), 29 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5a2effbd3..374b35f55 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2009-07-20 Vladimir Serbinenko + + Fix AtheFS support. + + * fs/afs.c: Fix comments style. + (grub_afs_blockrun): Declare as packed. + (grub_afs_datastream): Likewise. + (grub_afs_bnode): Likewise. + (grub_afs_btree): Likewise. + (grub_afs_sblock): Likewise. + Declare `name' as char. + (grub_afs_inode): Declare as packed. + Change void *vnode to grub_uint32_t unused. + (grub_afs_iterate_dir): Check that key_size is positive. + (grub_afs_mount): Don't read superblock twice. + (grub_afs_dir): Don't free node in case of errorx + grub_fshelp_find_file already handles this. + (grub_afs_open): Likewise. + 2009-07-19 Pavel Roskin * Makefile.in: Remove LIBLZO and enable_lzo. diff --git a/fs/afs.c b/fs/afs.c index 832a95c38..41aebb45d 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -1,7 +1,7 @@ /* afs.c - The native AtheOS file-system. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -29,7 +29,7 @@ #define GRUB_AFS_DIRECT_BLOCK_COUNT 12 #define GRUB_AFS_BLOCKS_PER_DI_RUN 4 -#define GRUB_AFS_SBLOCK_MAGIC1 0x41465331 /* AFS1 */ +#define GRUB_AFS_SBLOCK_MAGIC1 0x41465331 /* AFS1. */ #define GRUB_AFS_SBLOCK_MAGIC2 0xdd121031 #define GRUB_AFS_SBLOCK_MAGIC3 0x15b6830e @@ -81,7 +81,7 @@ struct grub_afs_blockrun grub_uint32_t group; grub_uint16_t start; grub_uint16_t len; -}; +} __attribute__ ((packed)); struct grub_afs_datastream { @@ -92,7 +92,7 @@ struct grub_afs_datastream struct grub_afs_blockrun double_indirect; grub_afs_off_t max_double_indirect_range; grub_afs_off_t size; -}; +} __attribute__ ((packed)); struct grub_afs_bnode { @@ -102,7 +102,7 @@ struct grub_afs_bnode grub_uint32_t key_count; grub_uint32_t key_size; char key_data[0]; -}; +} __attribute__ ((packed)); struct grub_afs_btree { @@ -111,7 +111,7 @@ struct grub_afs_btree grub_uint32_t tree_depth; grub_afs_bvalue_t last_node; grub_afs_bvalue_t first_free; -} ; +} __attribute__ ((packed)); struct grub_afs_sblock { @@ -124,8 +124,10 @@ struct grub_afs_sblock grub_afs_off_t used_blocks; grub_uint32_t inode_size; grub_uint32_t magic2; - grub_uint32_t block_per_group; // Number of blocks per allocation group (Max 65536) - grub_uint32_t alloc_group_shift; // Number of bits to shift a group number to get a byte address. + grub_uint32_t block_per_group; /* Number of blocks per allocation + group. (Max 65536) */ + grub_uint32_t alloc_group_shift; /* Number of bits to shift a group + number to get a byte address. */ grub_uint32_t alloc_group_count; grub_uint32_t flags; struct grub_afs_blockrun log_block; @@ -133,12 +135,13 @@ struct grub_afs_sblock grub_uint32_t valid_log_blocks; grub_uint32_t log_size; grub_uint32_t magic3; - struct grub_afs_blockrun root_dir; // Root dir inode. - struct grub_afs_blockrun deleted_files; // Directory containing files scheduled for deletion. - struct grub_afs_blockrun index_dir; // Directory of index files. + struct grub_afs_blockrun root_dir; /* Root dir inode. */ + struct grub_afs_blockrun deleted_files; /* Directory containing files + scheduled for deletion. */ + struct grub_afs_blockrun index_dir; /* Directory of index files. */ grub_uint32_t boot_loader_size; grub_uint32_t pad[7]; -}; +} __attribute__ ((packed)); struct grub_afs_inode { @@ -153,13 +156,13 @@ struct grub_afs_inode grub_afs_bigtime modified_time; struct grub_afs_blockrun parent; struct grub_afs_blockrun attrib_dir; - grub_uint32_t index_type; /* Key data-key only used for index files */ + grub_uint32_t index_type; /* Key data-key only used for index files. */ grub_uint32_t inode_size; - void* vnode; + grub_uint32_t unused; struct grub_afs_datastream stream; grub_uint32_t pad[4]; grub_uint32_t small_data[1]; -}; +} __attribute__ ((packed)); struct grub_fshelp_node { @@ -307,8 +310,8 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, struct grub_afs_sblock *sb = &dir->data->sblock; int i; - if ((! dir->inode.stream.size) || - ((U32 (sb, dir->inode.mode) & GRUB_AFS_S_IFMT) != GRUB_AFS_S_IFDIR)) + if ((dir->inode.stream.size == 0) + || ((U32 (sb, dir->inode.mode) & GRUB_AFS_S_IFMT) != GRUB_AFS_S_IFDIR)) return 0; grub_afs_read_file (dir, 0, 0, sizeof (head), (char *) &head); @@ -343,7 +346,7 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, key_start = U16 (sb, (cur_key > 0) ? index[cur_key - 1] : 0); key_size = U16 (sb, index[cur_key]) - key_start; - if (key_size) + if (key_size > 0) { char filename [key_size + 1]; struct grub_fshelp_node *fdiro; @@ -470,14 +473,7 @@ grub_afs_mount (grub_disk_t disk) goto fail; if (! grub_afs_validate_sblock (&data->sblock)) - { - if (grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_afs_sblock), - &data->sblock)) - goto fail; - - if (! grub_afs_validate_sblock (&data->sblock)) - goto fail; - } + goto fail; data->diropen.data = data; data->inode = &data->diropen.inode; @@ -524,8 +520,6 @@ grub_afs_open (struct grub_file *file, const char *name) return 0; fail: - if (fdiro != &data->diropen) - grub_free (fdiro); grub_free (data); grub_dl_unref (my_mod); @@ -588,9 +582,10 @@ grub_afs_dir (grub_device_t device, const char *path, grub_afs_iterate_dir (fdiro, iterate); - fail: if (fdiro != &data->diropen) grub_free (fdiro); + + fail: grub_free (data); grub_dl_unref (my_mod); From 1d2d169ace8de5b33ea9fc28a5a4a96ddfac0f67 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 20 Jul 2009 10:01:44 +0000 Subject: [PATCH 0965/1707] 2009-07-20 Vladimir Serbinenko Add symlink, mtime and label support to AtheFS. * fs/afs.c (grub_afs_sblock): Declare `name' as char. (grub_afs_iterate_dir): Handle symlinks. (grub_afs_open): Use grub_afs_read_symlink. (grub_afs_dir): Likewise. Pass mtime. (grub_afs_label): New function. (grub_afs_fs): Add grub_afs_label. (grub_afs_read_symlink): New function. --- ChangeLog | 13 ++++++++++++ fs/afs.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 68 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 374b35f55..cd66c863d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-07-20 Vladimir Serbinenko + + Add symlink, mtime and label support to AtheFS. + + * fs/afs.c (grub_afs_sblock): Declare `name' as char. + (grub_afs_iterate_dir): Handle symlinks. + (grub_afs_open): Use grub_afs_read_symlink. + (grub_afs_dir): Likewise. + Pass mtime. + (grub_afs_label): New function. + (grub_afs_fs): Add grub_afs_label. + (grub_afs_read_symlink): New function. + 2009-07-20 Vladimir Serbinenko Fix AtheFS support. diff --git a/fs/afs.c b/fs/afs.c index 41aebb45d..a036cd3da 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -115,7 +115,7 @@ struct grub_afs_btree struct grub_afs_sblock { - grub_uint8_t name[32]; + char name[32]; grub_uint32_t magic1; grub_uint32_t byte_order; grub_uint32_t block_size; @@ -297,6 +297,30 @@ grub_afs_read_file (grub_fshelp_node_t node, - GRUB_DISK_SECTOR_BITS); } +static char * +grub_afs_read_symlink (grub_fshelp_node_t node) +{ + char *ret; + struct grub_afs_sblock *sb = &node->data->sblock; + grub_afs_off_t size = U64 (sb, node->inode.stream.size); + + if (size == 0) + { + size = sizeof (node->inode.stream); + ret = grub_zalloc (size + 1); + if (! ret) + return 0; + grub_memcpy (ret, (char *) &(node->inode.stream), + sizeof (node->inode.stream)); + return ret; + } + ret = grub_zalloc (size + 1); + if (! ret) + return 0; + grub_afs_read_file (node, 0, 0, size, ret); + return ret; +} + static int grub_afs_iterate_dir (grub_fshelp_node_t dir, int NESTED_FUNC_ATTR @@ -370,6 +394,8 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, type = GRUB_FSHELP_DIR; else if (mode == GRUB_AFS_S_IFREG) type = GRUB_FSHELP_REG; + else if (mode == GRUB_AFS_S_IFLNK) + type = GRUB_FSHELP_SYMLINK; else type = GRUB_FSHELP_UNKNOWN; @@ -506,7 +532,7 @@ grub_afs_open (struct grub_file *file, const char *name) goto fail; grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_afs_iterate_dir, - 0, GRUB_FSHELP_REG); + grub_afs_read_symlink, GRUB_FSHELP_REG); if (grub_errno) goto fail; @@ -565,6 +591,9 @@ grub_afs_dir (grub_device_t device, const char *path, struct grub_dirhook_info info; grub_memset (&info, 0, sizeof (info)); info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); + info.mtimeset = 1; + info.mtime = grub_divmod64 (U64 (&data->sblock, + node->inode.modified_time), 1000000, 0); grub_free (node); return hook (filename, &info); } @@ -576,7 +605,7 @@ grub_afs_dir (grub_device_t device, const char *path, goto fail; grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_afs_iterate_dir, - 0, GRUB_FSHELP_DIR); + grub_afs_read_symlink, GRUB_FSHELP_DIR); if (grub_errno) goto fail; @@ -593,13 +622,35 @@ grub_afs_dir (grub_device_t device, const char *path, return grub_errno; } +static grub_err_t +grub_afs_label (grub_device_t device, char **label) +{ + struct grub_afs_data *data; + grub_disk_t disk = device->disk; + + grub_dl_ref (my_mod); + + data = grub_afs_mount (disk); + if (data) + *label = grub_strndup (data->sblock.name, sizeof (data->sblock.name)); + else + *label = NULL; + + grub_dl_unref (my_mod); + + grub_free (data); + + return grub_errno; +} + + static struct grub_fs grub_afs_fs = { .name = "afs", .dir = grub_afs_dir, .open = grub_afs_open, .read = grub_afs_read, .close = grub_afs_close, - .label = 0, + .label = grub_afs_label, .next = 0 }; From e98cd0c2fbd6f85b1433f32f8fc7da58b6d9b584 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 20 Jul 2009 13:48:41 +0000 Subject: [PATCH 0966/1707] 2009-07-20 Pavel Roskin * configure.ac: Trim excessively wordy excuses. --- ChangeLog | 4 ++++ configure.ac | 12 ++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd66c863d..3a9ed7072 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-07-20 Pavel Roskin + + * configure.ac: Trim excessively wordy excuses. + 2009-07-20 Vladimir Serbinenko Add symlink, mtime and label support to AtheFS. diff --git a/configure.ac b/configure.ac index b5c8acbb6..549b35c9b 100644 --- a/configure.ac +++ b/configure.ac @@ -422,7 +422,7 @@ if test x"$efiemu_excuse" = x ; then [grub_cv_cc_efiemu=no]) ]) if test x$grub_cv_cc_efiemu = xno; then - efiemu_excuse="compiler doesn't support compiling with -m64 -mcmodel=large -mno-red-zone -nostdlib" + efiemu_excuse="cannot compile with -m64 -mcmodel=large -mno-red-zone -nostdlib" fi fi if test x"$enable_efiemu" = xyes && test x"$efiemu_excuse" != x ; then @@ -468,7 +468,7 @@ fi [if [ x"$grub_emu_excuse" = x ]; then ] AC_CHECK_LIB([ncurses], [wgetch], [LIBCURSES="-lncurses"], [AC_CHECK_LIB([curses], [wgetch], [LIBCURSES="-lcurses"], - [grub_emu_excuse=["(n)curses libraries are required to build \`grub-emu'"]])]) + [grub_emu_excuse=["need (n)curses libraries"]])]) AC_SUBST([LIBCURSES]) [fi] [if [ x"$grub_emu_excuse" = x ]; then ] @@ -476,7 +476,7 @@ fi AC_CHECK_HEADERS([ncurses/curses.h], [], [AC_CHECK_HEADERS([ncurses.h], [], [AC_CHECK_HEADERS([curses.h], [], - [grub_emu_excuse=["(n)curses header files are required to build \`grub-emu'"]])])]) + [grub_emu_excuse=["need (n)curses headers"]])])]) [fi] if test x"$enable_grub_emu" = xyes && test x"$grub_emu_excuse" != x ; then @@ -494,13 +494,13 @@ fi [if [ x"$grub_emu_usb_excuse" = x ]; then # Check for libusb libraries.] AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], - [grub_emu_usb_excuse=["libusb libraries are required to build \`grub-emu' with USB support"]]) + [grub_emu_usb_excuse=["need libusb library"]]) AC_SUBST([LIBUSB]) [fi] [if [ x"$grub_emu_usb_excuse" = x ]; then # Check for headers.] AC_CHECK_HEADERS([usb.h], [], - [grub_emu_usb_excuse=["libusb header file is required to build \`grub-emu' with USB support"]]) + [grub_emu_usb_excuse=["need libusb headers"]]) [fi] if test x"enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled]) @@ -543,7 +543,7 @@ if test x"$grub_mkfont_excuse" = x ; then # Check for freetype libraries. AC_CHECK_PROGS([FREETYPE], [freetype-config]) if test "x$FREETYPE" = x ; then - grub_mkfont_excuse=["freetype2 libraries are required to build \`grub-mkfont'"] + grub_mkfont_excuse=["need freetype2 library"] fi freetype_cflags=`freetype-config --cflags` freetype_libs=`freetype-config --libs` From 04c7c42969047283ebba75b4ee59fb5db47de1b0 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 20 Jul 2009 16:46:36 +0000 Subject: [PATCH 0967/1707] 2009-07-20 Joe Auricchio * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. --- ChangeLog | 4 ++++ term/gfxterm.c | 12 ++++++++++++ 2 files changed, 16 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3a9ed7072..c9616e25c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-07-20 Joe Auricchio + + * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. + 2009-07-20 Pavel Roskin * configure.ac: Trim excessively wordy excuses. diff --git a/term/gfxterm.c b/term/gfxterm.c index ef93bb70f..61cf0e750 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -170,6 +170,8 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, unsigned int width, unsigned int height, const char *font_name) { + unsigned int i; + /* Free old virtual screen. */ grub_virtual_screen_free (); @@ -225,6 +227,16 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); + /* Clear out text buffer. */ + for(i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) + { + virtual_screen.text_buffer[i].code = ' '; + virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color; + virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color; + virtual_screen.text_buffer[i].width = 0; + virtual_screen.text_buffer[i].index = 0; + } + return grub_errno; } From 57a55913e0edfee615c6007e44ae8a9def785d95 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 20 Jul 2009 17:37:37 +0000 Subject: [PATCH 0968/1707] 2009-07-20 Vladimir Serbinenko * font/font.c (find_glyph): Check whether a font is present to avoid segmentation fault. --- ChangeLog | 5 +++++ font/font.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index c9616e25c..cd29ffcb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-20 Vladimir Serbinenko + + * font/font.c (find_glyph): Check whether a font is present to avoid + segmentation fault. + 2009-07-20 Joe Auricchio * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. diff --git a/font/font.c b/font/font.c index 84f0a4260..a81291916 100644 --- a/font/font.c +++ b/font/font.c @@ -607,6 +607,9 @@ find_glyph (const grub_font_t font, grub_uint32_t code) lo = 0; hi = font->num_chars - 1; + if (! table) + return 0; + while (lo <= hi) { mid = lo + (hi - lo) / 2; From 75421ca9eac6c31d364e7fb2efa2d6604c9a3fb6 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 20 Jul 2009 18:46:46 +0000 Subject: [PATCH 0969/1707] Fix typos, spacing --- ChangeLog | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd29ffcb7..75263655a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,8 @@ * font/font.c (find_glyph): Check whether a font is present to avoid segmentation fault. - -2009-07-20 Joe Auricchio + +2009-07-20 Joe Auricchio * term/gfxterm.c (grub_virtual_screen_setup): Clear virtual_screen. @@ -39,7 +39,7 @@ Change void *vnode to grub_uint32_t unused. (grub_afs_iterate_dir): Check that key_size is positive. (grub_afs_mount): Don't read superblock twice. - (grub_afs_dir): Don't free node in case of errorx + (grub_afs_dir): Don't free node in case of error, grub_fshelp_find_file already handles this. (grub_afs_open): Likewise. @@ -65,7 +65,7 @@ * fs/ext2.c (grub_ext2_dir): Likewise. * include/grub/macho.h (grub_macho_fat_arch): Likewise. * script/sh/lexer.c (grub_script_yylex): Likewise. - + 2009-07-16 Pavel Roskin * configure.ac: Never add "-c" to CFLAGS. @@ -354,7 +354,7 @@ Fix grub-emu build on sparc64-ieee1275. - * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Syncronize with ... + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Synchronize with ... * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): ... this. 2009-07-01 Robert Millan @@ -416,7 +416,7 @@ * include/grub/i386/linux.h (GRUB_LINUX_FLAG_QUIET): New macro. * loader/i386/linux.c (grub_cmd_linux): Recognize "quiet" option, - and set GRUB_LINUX_FLAG_QUIET appropiately. + and set GRUB_LINUX_FLAG_QUIET appropriately. 2009-06-29 Robert Millan @@ -442,7 +442,7 @@ * loader/i386/linux.c (grub_cmd_linux): Don't call grub_error when file can't be opened. grub_file_open() is already supposed to set - grub_errno / grub_errmsg appropiately. + grub_errno / grub_errmsg appropriately. * loader/i386/pc/linux.c (grub_cmd_linux): Likewise. 2009-06-27 Pavel Roskin @@ -593,7 +593,7 @@ Fix asm file handling on ELF, and remove workarounds. * genmk.rb (class Programs): Detect assembly files, and set ASFLAGS - and -DASM_FILE=1 appropiately (copied from `class Images' stanza). + and -DASM_FILE=1 appropriately (copied from `class Images' stanza). * kern/i386/ieee1275/startup.S (ASM_FILE): Remove macro. * kern/i386/coreboot/startup.S (ASM_FILE): Likewise. From 4f253044eccc5369e0e9fb3db8abe822f9f931a2 Mon Sep 17 00:00:00 2001 From: proski Date: Mon, 20 Jul 2009 20:03:18 +0000 Subject: [PATCH 0970/1707] 2009-07-19 Yves BLUSSEAU * util/getroot.c (find_root_device): Add support for MacOSX. * util/hostdisk.c: Likewise. --- ChangeLog | 5 +++++ util/getroot.c | 2 +- util/hostdisk.c | 28 +++++++++++++++++++++++----- 3 files changed, 29 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 75263655a..072652fce 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-19 Yves BLUSSEAU + + * util/getroot.c (find_root_device): Add support for MacOSX. + * util/hostdisk.c: Likewise. + 2009-07-20 Vladimir Serbinenko * font/font.c (find_glyph): Check whether a font is present to avoid diff --git a/util/getroot.c b/util/getroot.c index b50979d65..120ab13b1 100644 --- a/util/getroot.c +++ b/util/getroot.c @@ -238,7 +238,7 @@ find_root_device (const char *dir, dev_t dev) } } -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) if (S_ISCHR (st.st_mode) && st.st_rdev == dev) #else if (S_ISBLK (st.st_mode) && st.st_rdev == dev) diff --git a/util/hostdisk.c b/util/hostdisk.c index d84e7f3bf..584269809 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -92,6 +92,10 @@ struct hd_geometry # include #endif +#if defined(__APPLE__) +# include +#endif + struct { char *drive; @@ -185,7 +189,8 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) return GRUB_ERR_NONE; } -#elif defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#elif defined(__linux__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \ + defined(__FreeBSD_kernel__) || defined(__APPLE__) { unsigned long long nr; int fd; @@ -194,7 +199,7 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) if (fd == -1) return grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' while attempting to get disk size", map[drive].device); -# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +# if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) if (fstat (fd, &st) < 0 || ! S_ISCHR (st.st_mode)) # else if (fstat (fd, &st) < 0 || ! S_ISBLK (st.st_mode)) @@ -206,6 +211,8 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) if (ioctl (fd, DIOCGMEDIASIZE, &nr)) +# elif defined(__APPLE__) + if (ioctl (fd, DKIOCGETBLOCKCOUNT, &nr)) # else if (ioctl (fd, BLKGETSIZE64, &nr)) # endif @@ -215,10 +222,15 @@ grub_util_biosdisk_open (const char *name, grub_disk_t disk) } close (fd); + +#if defined (__APPLE__) + disk->total_sectors = nr; +#else disk->total_sectors = nr / 512; if (nr % 512) grub_util_error ("unaligned device size"); +#endif grub_util_info ("the size of %s is %llu", name, disk->total_sectors); @@ -371,6 +383,12 @@ open_device (const grub_disk_t disk, grub_disk_addr_t sector, int flags) } #endif +#if defined(__APPLE__) + /* If we can't have exclusive access, try shared access */ + if (fd < 0) + fd = open(map[disk->id].device, flags | O_SHLOCK); +#endif + if (fd < 0) { grub_error (GRUB_ERR_BAD_DEVICE, "cannot open `%s' in open_device()", map[disk->id].device); @@ -811,7 +829,7 @@ convert_system_partition_to_system_disk (const char *os_dev) path[8] = 0; return path; -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) char *path = xstrdup (os_dev); if (strncmp ("/dev/", path, 5) == 0) { @@ -890,7 +908,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) == 0) return make_device_name (drive, -1, -1); -#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) if (! S_ISCHR (st.st_mode)) #else if (! S_ISBLK (st.st_mode)) @@ -1039,7 +1057,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) return make_device_name (drive, dos_part, bsd_part); } -#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) +#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__APPLE__) /* FreeBSD uses "/dev/[a-z]+[0-9]+(s[0-9]+[a-z]?)?". */ { int dos_part = -1; From 1ef44b802b1743a0aca609c5a5920726be24c0b0 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 20 Jul 2009 21:18:59 +0000 Subject: [PATCH 0971/1707] 2009-07-20 Vladimir Serbinenko Add BFS support * conf/common.rmk (grub_probe_SOURCES): Add fs/befs.c. (grub_fstest_SOURCES): Likewise. (pkglib_MODULES): Add befs.mod. (befs_mod_SOURCES): New variable. (befs_mod_CFLAGS): Likewise. (befs_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. (grub_setup_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. (grub_setup_SOURCES): Likewise. * fs/befs.c: New file. * fs/afs.c (GRUB_AFS_FSNAME): New declaration. (GRUB_AFS_SBLOCK_SECTOR): Likewise. (GRUB_AFS_SBLOCK_MAGIC1) [MODE_BFS]: New conditional declaration. (GRUB_AFS_BTREE_MAGIC) [MODE_BFS]: Likewise (B_KEY_INDEX_ALIGN): New declaration. (B_KEY_INDEX_OFFSET): Use B_KEY_INDEX_ALIGN. (grub_afs_bnode) [MODE_BFS]: Make key_count and key_size 16-bit (grub_afs_btree) [MODE_BFS]: New conditional declaration. (grub_afs_sblock) [MODE_BFS]: Remove link_count. (grub_afs_validate_sblock) [MODE_BFS]: Support BFS (grub_afs_mount) [MODE_BFS]: Likewise. (grub_afs_dir) [MODE_BFS]: Divide mtime by 65536 and not 1000000. (grub_afs_fs): Use GRUB_AFS_FSNAME (GRUB_MOD_INIT (afs)) [MODE_BFS]: Rename to ... (GRUB_MOD_INIT (befs)) [MODE_BFS]: ... this (GRUB_MOD_FINI (afs)) [MODE_BFS]: Rename to ... (GRUB_MOD_FINI (befs)) [MODE_BFS]: ... this --- ChangeLog | 37 +++++++++++++++ conf/common.rmk | 11 +++-- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 4 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 4 +- fs/afs.c | 99 ++++++++++++++++++++++++++++++++------- fs/befs.c | 3 ++ 10 files changed, 139 insertions(+), 27 deletions(-) create mode 100644 fs/befs.c diff --git a/ChangeLog b/ChangeLog index 072652fce..6cfc6dd3c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,40 @@ +2009-07-20 Vladimir Serbinenko + + Add BFS support + + * conf/common.rmk (grub_probe_SOURCES): Add fs/befs.c. + (grub_fstest_SOURCES): Likewise. + (pkglib_MODULES): Add befs.mod. + (befs_mod_SOURCES): New variable. + (befs_mod_CFLAGS): Likewise. + (befs_mod_LDFLAGS): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + (grub_setup_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + (grub_setup_SOURCES): Likewise. + * fs/befs.c: New file. + * fs/afs.c (GRUB_AFS_FSNAME): New declaration. + (GRUB_AFS_SBLOCK_SECTOR): Likewise. + (GRUB_AFS_SBLOCK_MAGIC1) [MODE_BFS]: New conditional declaration. + (GRUB_AFS_BTREE_MAGIC) [MODE_BFS]: Likewise + (B_KEY_INDEX_ALIGN): New declaration. + (B_KEY_INDEX_OFFSET): Use B_KEY_INDEX_ALIGN. + (grub_afs_bnode) [MODE_BFS]: Make key_count and key_size 16-bit + (grub_afs_btree) [MODE_BFS]: New conditional declaration. + (grub_afs_sblock) [MODE_BFS]: Remove link_count. + (grub_afs_validate_sblock) [MODE_BFS]: Support BFS + (grub_afs_mount) [MODE_BFS]: Likewise. + (grub_afs_dir) [MODE_BFS]: Divide mtime by 65536 and not 1000000. + (grub_afs_fs): Use GRUB_AFS_FSNAME + (GRUB_MOD_INIT (afs)) [MODE_BFS]: Rename to ... + (GRUB_MOD_INIT (befs)) [MODE_BFS]: ... this + (GRUB_MOD_FINI (afs)) [MODE_BFS]: Rename to ... + (GRUB_MOD_FINI (befs)) [MODE_BFS]: ... this + 2009-07-19 Yves BLUSSEAU * util/getroot.c (find_root_device): Add support for MacOSX. diff --git a/conf/common.rmk b/conf/common.rmk index 07ff04e4d..032517ffb 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -17,7 +17,7 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ partmap/pc.c partmap/apple.c partmap/sun.c partmap/gpt.c\ kern/fs.c kern/env.c fs/fshelp.c \ @@ -38,7 +38,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/sun.c \ partmap/gpt.c \ @@ -177,7 +177,7 @@ CLEANFILES += grub-dumpbios pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod tar.mod \ - udf.mod afs.mod + udf.mod afs.mod befs.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -274,6 +274,11 @@ afs_mod_SOURCES = fs/afs.c afs_mod_CFLAGS = $(COMMON_CFLAGS) afs_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For befs.mod. +befs_mod_SOURCES = fs/befs.c +befs_mod_CFLAGS = $(COMMON_CFLAGS) +befs_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Partition maps. pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index c70f7d2a0..7ba573795 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -116,7 +116,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 75aa611e7..9177b9d44 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -44,7 +44,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 513e1b7bc..032197906 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -71,7 +71,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index f5bded28a..798aee231 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -104,7 +104,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ partmap/pc.c partmap/gpt.c \ \ @@ -148,7 +148,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b12635ebd..af29d23ad 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -51,7 +51,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 8183cbc05..aabccee5f 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -78,7 +78,7 @@ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ partmap/amiga.c partmap/apple.c partmap/pc.c \ partmap/sun.c partmap/acorn.c \ @@ -108,7 +108,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/tar.c \ + fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/fs/afs.c b/fs/afs.c index a036cd3da..971c8bd2e 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -26,16 +26,33 @@ #include #include +#ifdef MODE_BFS +#define GRUB_AFS_FSNAME "befs" +#else +#define GRUB_AFS_FSNAME "afs" +#endif + #define GRUB_AFS_DIRECT_BLOCK_COUNT 12 #define GRUB_AFS_BLOCKS_PER_DI_RUN 4 +#ifdef MODE_BFS +#define GRUB_AFS_SBLOCK_SECTOR 1 +#define GRUB_AFS_SBLOCK_MAGIC1 0x42465331 /* BFS1. */ +#else +#define GRUB_AFS_SBLOCK_SECTOR 2 #define GRUB_AFS_SBLOCK_MAGIC1 0x41465331 /* AFS1. */ +#endif + #define GRUB_AFS_SBLOCK_MAGIC2 0xdd121031 #define GRUB_AFS_SBLOCK_MAGIC3 0x15b6830e #define GRUB_AFS_INODE_MAGIC 0x64358428 +#ifdef MODE_BFS +#define GRUB_AFS_BTREE_MAGIC 0x69f6c2e8 +#else #define GRUB_AFS_BTREE_MAGIC 0x65768995 +#endif #define GRUB_AFS_BNODE_SIZE 1024 @@ -57,10 +74,17 @@ #define U64(sb, u) (((sb)->byte_order == GRUB_AFS_BO_LITTLE_ENDIAN) ? \ grub_le_to_cpu64 (u) : grub_be_to_cpu64 (u)) +#ifdef MODE_BFS +#define B_KEY_INDEX_ALIGN 8 +#else +#define B_KEY_INDEX_ALIGN 4 +#endif + #define B_KEY_INDEX_OFFSET(node) ((grub_uint16_t *) \ - ((char *) (node) + \ - sizeof (struct grub_afs_bnode) + \ - ((node->key_size + 3) & ~3))) + ((char *) (node) \ + + ALIGN_UP (sizeof (struct grub_afs_bnode) \ + + node->key_size, \ + B_KEY_INDEX_ALIGN))) #define B_KEY_VALUE_OFFSET(node) ((grub_afs_bvalue_t *) \ ((char *) B_KEY_INDEX_OFFSET (node) + \ @@ -99,11 +123,27 @@ struct grub_afs_bnode grub_afs_bvalue_t left; grub_afs_bvalue_t right; grub_afs_bvalue_t overflow; +#ifdef MODE_BFS + grub_uint16_t key_count; + grub_uint16_t key_size; +#else grub_uint32_t key_count; grub_uint32_t key_size; +#endif char key_data[0]; } __attribute__ ((packed)); +#ifdef MODE_BFS +struct grub_afs_btree +{ + grub_uint32_t magic; + grub_uint32_t unused1; + grub_uint32_t tree_depth; + grub_uint32_t unused2; + grub_afs_bvalue_t root; + grub_uint32_t unused3[4]; +} __attribute__ ((packed)); +#else struct grub_afs_btree { grub_uint32_t magic; @@ -112,6 +152,7 @@ struct grub_afs_btree grub_afs_bvalue_t last_node; grub_afs_bvalue_t first_free; } __attribute__ ((packed)); +#endif struct grub_afs_sblock { @@ -151,7 +192,9 @@ struct grub_afs_inode grub_uint32_t gid; grub_uint32_t mode; grub_uint32_t flags; +#ifndef MODE_BFS grub_uint32_t link_count; +#endif grub_afs_bigtime create_time; grub_afs_bigtime modified_time; struct grub_afs_blockrun parent; @@ -427,8 +470,10 @@ grub_afs_validate_sblock (struct grub_afs_sblock *sb) { if (grub_le_to_cpu32 (sb->magic1) == GRUB_AFS_SBLOCK_MAGIC1) { +#ifndef MODE_BFS if (grub_le_to_cpu32 (sb->byte_order) != GRUB_AFS_BO_LITTLE_ENDIAN) return 0; +#endif sb->byte_order = GRUB_AFS_BO_LITTLE_ENDIAN; sb->magic2 = grub_le_to_cpu32 (sb->magic2); @@ -446,8 +491,10 @@ grub_afs_validate_sblock (struct grub_afs_sblock *sb) } else if (grub_be_to_cpu32 (sb->magic1) == GRUB_AFS_SBLOCK_MAGIC1) { +#ifndef MODE_BFS if (grub_be_to_cpu32 (sb->byte_order) != GRUB_AFS_BO_BIG_ENDIAN) return 0; +#endif sb->byte_order = GRUB_AFS_BO_BIG_ENDIAN; sb->magic2 = grub_be_to_cpu32 (sb->magic2); @@ -470,15 +517,22 @@ grub_afs_validate_sblock (struct grub_afs_sblock *sb) (sb->magic3 != GRUB_AFS_SBLOCK_MAGIC3)) return 0; - if (((grub_uint32_t) (1 << sb->block_shift) != sb->block_size) || - (sb->used_blocks > sb->num_blocks ) || - (sb->inode_size != sb->block_size) || - (0 == sb->block_size) || - ((grub_uint32_t) (1 << sb->alloc_group_shift) != - sb->block_per_group * sb->block_size) || - (sb->alloc_group_count * sb->block_per_group < sb->num_blocks) || - (U16 (sb, sb->log_block.len) != sb->log_size) || - (U32 (sb, sb->valid_log_blocks) > sb->log_size)) +#ifdef MODE_BFS + sb->block_per_group = 1 << (sb->alloc_group_shift); +#endif + + if (((grub_uint32_t) (1 << sb->block_shift) != sb->block_size) + || (sb->used_blocks > sb->num_blocks ) + || (sb->inode_size != sb->block_size) + || (0 == sb->block_size) +#ifndef MODE_BFS + || ((grub_uint32_t) (1 << sb->alloc_group_shift) != + sb->block_per_group * sb->block_size) + || (sb->alloc_group_count * sb->block_per_group < sb->num_blocks) + || (U16 (sb, sb->log_block.len) != sb->log_size) + || (U32 (sb, sb->valid_log_blocks) > sb->log_size) +#endif + ) return 0; return 1; @@ -494,8 +548,8 @@ grub_afs_mount (grub_disk_t disk) return 0; /* Read the superblock. */ - if (grub_disk_read (disk, 1 * 2, 0, sizeof (struct grub_afs_sblock), - &data->sblock)) + if (grub_disk_read (disk, GRUB_AFS_SBLOCK_SECTOR, 0, + sizeof (struct grub_afs_sblock), &data->sblock)) goto fail; if (! grub_afs_validate_sblock (&data->sblock)) @@ -514,7 +568,8 @@ grub_afs_mount (grub_disk_t disk) return data; fail: - grub_error (GRUB_ERR_BAD_FS, "not an afs filesystem"); + grub_error (GRUB_ERR_BAD_FS, "not an " GRUB_AFS_FSNAME " filesystem"); + grub_free (data); return 0; } @@ -592,8 +647,12 @@ grub_afs_dir (grub_device_t device, const char *path, grub_memset (&info, 0, sizeof (info)); info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); info.mtimeset = 1; +#ifdef MODE_BFS + info.mtime = U64 (&data->sblock, node->inode.modified_time) >> 16; +#else info.mtime = grub_divmod64 (U64 (&data->sblock, node->inode.modified_time), 1000000, 0); +#endif grub_free (node); return hook (filename, &info); } @@ -645,7 +704,7 @@ grub_afs_label (grub_device_t device, char **label) static struct grub_fs grub_afs_fs = { - .name = "afs", + .name = GRUB_AFS_FSNAME, .dir = grub_afs_dir, .open = grub_afs_open, .read = grub_afs_read, @@ -654,13 +713,21 @@ static struct grub_fs grub_afs_fs = { .next = 0 }; +#ifdef MODE_BFS +GRUB_MOD_INIT (befs) +#else GRUB_MOD_INIT (afs) +#endif { grub_fs_register (&grub_afs_fs); my_mod = mod; } +#ifdef MODE_BFS +GRUB_MOD_FINI (befs) +#else GRUB_MOD_FINI (afs) +#endif { grub_fs_unregister (&grub_afs_fs); } diff --git a/fs/befs.c b/fs/befs.c new file mode 100644 index 000000000..c54d8e1cc --- /dev/null +++ b/fs/befs.c @@ -0,0 +1,3 @@ +/* befs.c - The native BeOS/Haiku file-system. */ +#define MODE_BFS 1 +#include "afs.c" From cffcddb2b53dad52e21334e4c591411fbed89aec Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 21 Jul 2009 12:58:41 +0000 Subject: [PATCH 0972/1707] 2009-07-21 Vladimir Serbinenko * fs/ufs.c (grub_ufs_sblock): Fix offset of mtime2 which was off by 128 bytes --- ChangeLog | 5 +++++ fs/ufs.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6cfc6dd3c..02d5af132 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-21 Vladimir Serbinenko + + * fs/ufs.c (grub_ufs_sblock): Fix offset of mtime2 which was off by + 128 bytes + 2009-07-20 Vladimir Serbinenko Add BFS support diff --git a/fs/ufs.c b/fs/ufs.c index 7a2d21f25..c9531b5a7 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -99,10 +99,10 @@ struct grub_ufs_sblock /* Volume name for UFS2. */ grub_uint8_t volume_name[GRUB_UFS_VOLNAME_LEN]; - grub_uint8_t unused8[232]; + grub_uint8_t unused8[360]; grub_uint64_t mtime2; - grub_uint8_t unused9[420]; + grub_uint8_t unused9[292]; /* Magic value to check if this is really a UFS filesystem. */ grub_uint32_t magic; From 6a6cbcaf5e0b42bb822a23838e70d2c23398db4e Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 21 Jul 2009 13:37:43 +0000 Subject: [PATCH 0973/1707] 2009-07-21 Felix Zielcke * util/grub.d/30_os-prober.in: Remove unused CHAINROOT. Don't add drivemap for Vista. It breaks Windows 7. --- ChangeLog | 5 +++++ util/grub.d/30_os-prober.in | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 02d5af132..c7502a323 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-21 Felix Zielcke + + * util/grub.d/30_os-prober.in: Remove unused CHAINROOT. Don't + add drivemap for Vista. It breaks Windows 7. + 2009-07-21 Vladimir Serbinenko * fs/ufs.c (grub_ufs_sblock): Fix offset of mtime2 which was off by diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 552ad8e28..b36c2a366 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -47,15 +47,18 @@ for OS in ${OSPROBED} ; do case ${BOOT} in chain) - CHAINROOT="`grub-probe --target=drive --device ${DEVICE} 2> /dev/null`" cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" { EOF prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" - cat << EOF + if [ "${LONGNAME}" != "Windows Vista (loader)" ] ; then + cat << EOF drivemap -s (hd0) \${root} +EOF + fi + cat < Date: Tue, 21 Jul 2009 20:18:44 +0000 Subject: [PATCH 0974/1707] 2009-07-21 Pavel Roskin * kern/dl.c (grub_dl_check_header): Make static. --- ChangeLog | 4 ++++ include/grub/dl.h | 1 - kern/dl.c | 2 +- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index c7502a323..0ba332469 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-07-21 Pavel Roskin + + * kern/dl.c (grub_dl_check_header): Make static. + 2009-07-21 Felix Zielcke * util/grub.d/30_os-prober.in: Remove unused CHAINROOT. Don't diff --git a/include/grub/dl.h b/include/grub/dl.h index e24b832d0..3f8b328da 100644 --- a/include/grub/dl.h +++ b/include/grub/dl.h @@ -85,7 +85,6 @@ struct grub_dl }; typedef struct grub_dl *grub_dl_t; -grub_err_t EXPORT_FUNC(grub_dl_check_header) (void *ehdr, grub_size_t size); grub_dl_t EXPORT_FUNC(grub_dl_load_file) (const char *filename); grub_dl_t EXPORT_FUNC(grub_dl_load) (const char *name); grub_dl_t grub_dl_load_core (void *addr, grub_size_t size); diff --git a/kern/dl.c b/kern/dl.c index 1fe82e789..78ebc1e38 100644 --- a/kern/dl.c +++ b/kern/dl.c @@ -223,7 +223,7 @@ grub_dl_get_section_addr (grub_dl_t mod, unsigned n) } /* Check if EHDR is a valid ELF header. */ -grub_err_t +static grub_err_t grub_dl_check_header (void *ehdr, grub_size_t size) { Elf_Ehdr *e = ehdr; From 260c9a8957dc82126ca95c4c99c70ec1a05e7e4c Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 22 Jul 2009 11:16:11 +0000 Subject: [PATCH 0975/1707] 2009-07-21 Vladimir Serbinenko UUID support for UFS * fs/ufs.c (grub_ufs_sblock): Add uuidhi and uuidlow. (grub_ufs_uuid): New function. (grub_ufs_fs): add .uuid --- ChangeLog | 8 ++++++++ fs/ufs.c | 39 +++++++++++++++++++++++++++++++++++---- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ba332469..a0780abed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-07-21 Vladimir Serbinenko + + UUID support for UFS + + * fs/ufs.c (grub_ufs_sblock): Add uuidhi and uuidlow. + (grub_ufs_uuid): New function. + (grub_ufs_fs): add .uuid + 2009-07-21 Pavel Roskin * kern/dl.c (grub_dl_check_header): Make static. diff --git a/fs/ufs.c b/fs/ufs.c index c9531b5a7..336507c6d 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -87,7 +87,10 @@ struct grub_ufs_sblock /* The size of filesystem blocks to disk blocks. */ grub_uint32_t log2_blksz; - grub_uint8_t unused6[80]; + grub_uint8_t unused6[40]; + grub_uint32_t uuidhi; + grub_uint32_t uuidlow; + grub_uint8_t unused7[32]; /* Inodes stored per cylinder group. */ grub_uint32_t ino_per_group; @@ -95,14 +98,14 @@ struct grub_ufs_sblock /* The frags per cylinder group. */ grub_uint32_t frags_per_group; - grub_uint8_t unused7[488]; + grub_uint8_t unused8[488]; /* Volume name for UFS2. */ grub_uint8_t volume_name[GRUB_UFS_VOLNAME_LEN]; - grub_uint8_t unused8[360]; + grub_uint8_t unused9[360]; grub_uint64_t mtime2; - grub_uint8_t unused9[292]; + grub_uint8_t unused10[292]; /* Magic value to check if this is really a UFS filesystem. */ grub_uint32_t magic; @@ -736,6 +739,33 @@ grub_ufs_label (grub_device_t device, char **label) return grub_errno; } +static grub_err_t +grub_ufs_uuid (grub_device_t device, char **uuid) +{ + struct grub_ufs_data *data; + grub_disk_t disk = device->disk; + + grub_dl_ref (my_mod); + + data = grub_ufs_mount (disk); + if (data) + { + *uuid = grub_malloc (16 + sizeof ('\0')); + grub_sprintf (*uuid, "%08x%08x", + (unsigned) grub_le_to_cpu32 (data->sblock.uuidhi), + (unsigned) grub_le_to_cpu32 (data->sblock.uuidlow)); + } + else + *uuid = NULL; + + grub_dl_unref (my_mod); + + grub_free (data); + + return grub_errno; +} + + /* Get mtime. */ static grub_err_t grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) @@ -769,6 +799,7 @@ static struct grub_fs grub_ufs_fs = .read = grub_ufs_read, .close = grub_ufs_close, .label = grub_ufs_label, + .uuid = grub_ufs_uuid, .mtime = grub_ufs_mtime, .next = 0 }; From 48904cd1a99b7643c2fae32fb54b07cad88a5767 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 23 Jul 2009 16:41:29 +0000 Subject: [PATCH 0976/1707] 2009-07-23 Pavel Roskin * include/grub/misc.h (ALIGN_UP): Cast align to the type of addr to avoid loss of upper bits if align is unsigned and shorter than addr. --- ChangeLog | 6 ++++++ include/grub/misc.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a0780abed..3ceeb08f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-23 Pavel Roskin + + * include/grub/misc.h (ALIGN_UP): Cast align to the type of addr + to avoid loss of upper bits if align is unsigned and shorter + than addr. + 2009-07-21 Vladimir Serbinenko UUID support for UFS diff --git a/include/grub/misc.h b/include/grub/misc.h index e229062ac..769ec5cd8 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -25,7 +25,8 @@ #include #include -#define ALIGN_UP(addr, align) (((grub_uint64_t)addr + align - 1) & ~(align - 1)) +#define ALIGN_UP(addr, align) \ + ((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1)) #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) #define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args) From ef3c317f6f8a8d67e41552cdd6e5c12a40a84053 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 24 Jul 2009 01:43:10 +0000 Subject: [PATCH 0977/1707] 2009-07-23 Pavel Roskin * commands/xnu_uuid.c (transform): Use GRUB_CPU_WORDS_BIGENDIAN instead of WORDS_BIGENDIAN. Use grub_le_to_cpu32(), so that the case of little endian words becomes just an optimization. Respect const modifier. (md5_final): Use code that doesn't depend on endianess. --- ChangeLog | 6 ++++++ commands/xnu_uuid.c | 29 ++++++++++------------------- 2 files changed, 16 insertions(+), 19 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3ceeb08f8..2e7a4f3a5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,11 @@ 2009-07-23 Pavel Roskin + * commands/xnu_uuid.c (transform): Use GRUB_CPU_WORDS_BIGENDIAN + instead of WORDS_BIGENDIAN. Use grub_le_to_cpu32(), so that the + case of little endian words becomes just an optimization. + Respect const modifier. + (md5_final): Use code that doesn't depend on endianess. + * include/grub/misc.h (ALIGN_UP): Cast align to the type of addr to avoid loss of upper bits if align is unsigned and shorter than addr. diff --git a/commands/xnu_uuid.c b/commands/xnu_uuid.c index 1302881fa..e8e12b072 100644 --- a/commands/xnu_uuid.c +++ b/commands/xnu_uuid.c @@ -91,20 +91,16 @@ transform ( MD5_CONTEXT *ctx, const unsigned char *data ) register grub_uint32_t D = ctx->D; grub_uint32_t *cwp = correct_words; -#ifdef WORDS_BIGENDIAN - { +#ifdef GRUB_CPU_WORDS_BIGENDIAN + { int i; - grub_uint8_t *p2, *p1; - for(i=0, p1=data, p2=(grub_uint8_t*)correct_words; i < 16; i++, p2 += 4 ) - { - p2[3] = *p1++; - p2[2] = *p1++; - p2[1] = *p1++; - p2[0] = *p1++; - } + const grub_uint32_t *p = (const grub_uint32_t *) data; + + for (i = 0; i < 16; i++) + correct_words[i] = grub_le_to_cpu32 (p[i]); } #else - memcpy( correct_words, data, 64 ); + memcpy (correct_words, data, 64); #endif #define OP(a, b, c, d, s, T) \ @@ -266,7 +262,7 @@ md5_final( void *context) { MD5_CONTEXT *hd = context; grub_uint32_t t, msb, lsb; - grub_uint8_t *p; + grub_uint32_t *p; md5_write(hd, NULL, 0); /* flush */; @@ -310,13 +306,8 @@ md5_final( void *context) transform( hd, hd->buf ); // _gcry_burn_stack (80+6*sizeof(void*)); - p = hd->buf; -#ifdef WORDS_BIGENDIAN -#define X(a) do { *p++ = hd->a ; *p++ = hd->a >> 8; \ - *p++ = hd->a >> 16; *p++ = hd->a >> 24; } while(0) -#else /* little endian */ -#define X(a) do { *(grub_uint32_t*)p = (*hd).a ; p += 4; } while(0) -#endif + p = (grub_uint32_t *) hd->buf; +#define X(a) do { *p = grub_le_to_cpu32 (hd->a); p++; } while (0) X(A); X(B); X(C); From fcaa8b2177235031133583e7be7c9a2b7bfa6314 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 24 Jul 2009 20:41:31 +0000 Subject: [PATCH 0978/1707] 2009-07-24 Vladimir Serbinenko * util/i386/pc/grub-setup.c (setup): Fix bug when installing on partionless disk. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2e7a4f3a5..1ac7a70a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-24 Vladimir Serbinenko + + * util/i386/pc/grub-setup.c (setup): Fix bug when + installing on partionless disk. + 2009-07-23 Pavel Roskin * commands/xnu_uuid.c (transform): Use GRUB_CPU_WORDS_BIGENDIAN diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 5a519645b..852b49894 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -329,10 +329,18 @@ setup (const char *dir, dest_partmap = p->partmap->name; return 1; } + dest_partmap = 0; grub_partition_iterate (dest_dev->disk, identify_partmap); + if (! dest_partmap) + { + grub_util_warn ("Attempting to install GRUB to a partitionless disk. This is a BAD idea."); + goto unable_to_embed; + } + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? find_usable_region_gpt : find_usable_region_msdos)); + if (embed_region.end == embed_region.start) { if (! strcmp (dest_partmap, "pc_partition_map")) From 35d16c74b28511fd68f2c9c76a06b043714ecac7 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 24 Jul 2009 21:22:30 +0000 Subject: [PATCH 0979/1707] Improved Changelog as suggested by Pavel Roskin. --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1ac7a70a9..4381e3cc4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ 2009-07-24 Vladimir Serbinenko - * util/i386/pc/grub-setup.c (setup): Fix bug when - installing on partionless disk. + * util/i386/pc/grub-setup.c (setup): Fix segmentation fault when + partition map couldn't be identified. 2009-07-23 Pavel Roskin From 7743527799ed8acc18feef8dfe97961aec0cc5c2 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 25 Jul 2009 09:30:25 +0000 Subject: [PATCH 0980/1707] 2009-07-25 Felix Zielcke * kern/file.c (grub_file_open): Fix an error check. --- ChangeLog | 4 ++++ kern/file.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4381e3cc4..bffd6c16c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-07-25 Felix Zielcke + + * kern/file.c (grub_file_open): Fix an error check. + 2009-07-24 Vladimir Serbinenko * util/i386/pc/grub-setup.c (setup): Fix segmentation fault when diff --git a/kern/file.c b/kern/file.c index 9b56b88e4..362cf1d7f 100644 --- a/kern/file.c +++ b/kern/file.c @@ -60,8 +60,8 @@ grub_file_open (const char *name) char *file_name; device_name = grub_file_get_device_name (name); - if (grub_errno) - return 0; + if (! device_name) + goto fail; /* Get the file part of NAME. */ file_name = grub_strchr (name, ')'); From 72b9658be2bd3ed7d5e65d3cdb6fd9ad29c9cf33 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 25 Jul 2009 15:13:07 +0000 Subject: [PATCH 0981/1707] 2009-07-25 Vladimir Serbinenko * kern/parser.c (grub_parser_execute): Fix a bug causing truncated entries on failed boot. --- ChangeLog | 5 +++++ kern/parser.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index bffd6c16c..9986929d3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-25 Vladimir Serbinenko + + * kern/parser.c (grub_parser_execute): Fix a bug causing truncated + entries on failed boot. + 2009-07-25 Felix Zielcke * kern/file.c (grub_file_open): Fix an error check. diff --git a/kern/parser.c b/kern/parser.c index 5e56ede91..db59af056 100644 --- a/kern/parser.c +++ b/kern/parser.c @@ -245,10 +245,12 @@ grub_parser_execute (char *source) p = grub_strchr (source, '\n'); if (p) - *(p++) = 0; + *p = 0; *line = grub_strdup (source); - source = p; + if (p) + *p = '\n'; + source = p ? p + 1 : 0; return 0; } From 7ad8c80ee8787a8eab79cd7c9eeb3561a51c2b93 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 25 Jul 2009 17:46:38 +0000 Subject: [PATCH 0982/1707] 2009-07-25 Vladimir Serbinenko * commands/probe.c (GRUB_MOD_INIT (probe)): Remove "[--target=target]" from help line. It's out of sync with code. --- ChangeLog | 5 +++++ commands/probe.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9986929d3..f1deeecef 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-25 Vladimir Serbinenko + + * commands/probe.c (GRUB_MOD_INIT (probe)): Remove "[--target=target]" + from help line. It's out of sync with code. + 2009-07-25 Vladimir Serbinenko * kern/parser.c (grub_parser_execute): Fix a bug causing truncated diff --git a/commands/probe.c b/commands/probe.c index 9e95e6aaf..fabdb2a4a 100644 --- a/commands/probe.c +++ b/commands/probe.c @@ -150,7 +150,7 @@ static grub_extcmd_t cmd; GRUB_MOD_INIT (probe) { cmd = grub_register_extcmd ("probe", grub_cmd_probe, GRUB_COMMAND_FLAG_BOTH, - "probe [--target=target] [DEVICE]", + "probe [DEVICE]", "Retrieve device info.", options); } From 2366e356ce186bd7a5ab8c2d8954a19fd40a3cc6 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 25 Jul 2009 18:28:58 +0000 Subject: [PATCH 0983/1707] 2009-07-25 Felix Zielcke * kern/file.c (grub_file_open): Revert to previous check with grub_errno. --- ChangeLog | 5 +++++ kern/file.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f1deeecef..752bde8aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-25 Felix Zielcke + + * kern/file.c (grub_file_open): Revert to previous check with + grub_errno. + 2009-07-25 Vladimir Serbinenko * commands/probe.c (GRUB_MOD_INIT (probe)): Remove "[--target=target]" diff --git a/kern/file.c b/kern/file.c index 362cf1d7f..9b56b88e4 100644 --- a/kern/file.c +++ b/kern/file.c @@ -60,8 +60,8 @@ grub_file_open (const char *name) char *file_name; device_name = grub_file_get_device_name (name); - if (! device_name) - goto fail; + if (grub_errno) + return 0; /* Get the file part of NAME. */ file_name = grub_strchr (name, ')'); From 880e0a0c700668d29a2d932edac24fc29f19c4df Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 26 Jul 2009 11:03:57 +0000 Subject: [PATCH 0984/1707] 2009-07-26 Felix Zielcke * util/grub-mkconfig.in (package_version): New variable. Use it do display the version. --- ChangeLog | 5 +++++ util/grub-mkconfig.in | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 752bde8aa..433417826 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-26 Felix Zielcke + + * util/grub-mkconfig.in (package_version): New variable. + Use it do display the version. + 2009-07-25 Felix Zielcke * kern/file.c (grub_file_open): Revert to previous check with diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 4eb7dd2ae..75a07e698 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -23,6 +23,7 @@ exec_prefix=@exec_prefix@ sbindir=@sbindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ +package_version=@PACKAGE_VERSION@ grub_prefix=`echo /boot/grub | sed ${transform}` grub_cfg="" grub_mkconfig_dir=${sysconfdir}/grub.d @@ -52,7 +53,7 @@ for option in "$@"; do usage exit 0 ;; -v | --version) - echo "$0 (GNU GRUB ${PACKAGE_VERSION})" + echo "$0 (GNU GRUB ${package_version})" exit 0 ;; -o) shift From c521b62b6c02291ff3a5d043663c6a70df71a4a6 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 28 Jul 2009 15:58:40 +0000 Subject: [PATCH 0985/1707] 2009-07-28 Felix Zielcke * util/i386/pc/grub-setup.c (setup): Fix 2 incorrect checks when embedding. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 433417826..2f83512a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-28 Felix Zielcke + + * util/i386/pc/grub-setup.c (setup): Fix 2 incorrect checks + when embedding. + 2009-07-26 Felix Zielcke * util/grub-mkconfig.in (package_version): New variable. diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 852b49894..38547e534 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -352,9 +352,9 @@ setup (const char *dir, if ((unsigned long) core_sectors > embed_region.end - embed_region.start) { - if (core_sectors > 62 * 512) + if (core_sectors > 62) grub_util_warn ("Your core.img is unusually large. It won't fit in the embedding area."); - else if (embed_region.end - embed_region.start < 62 * 512) + else if (embed_region.end - embed_region.start < 62) grub_util_warn ("Your embedding area is unusually small. core.img won't fit in it."); else grub_util_warn ("Embedding area is too small for core.img."); From 2ddd36d7a9583267fca6a73104d60bc5fe31b641 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 28 Jul 2009 18:32:28 +0000 Subject: [PATCH 0986/1707] 2009-07-28 Felix Zielcke * util/i386/pc/grub-install: Fix parsing of --disk-module option. --- ChangeLog | 5 +++++ util/i386/pc/grub-install.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2f83512a3..e4ec9862a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-28 Felix Zielcke + + * util/i386/pc/grub-install: Fix parsing of --disk-module + option. + 2009-07-28 Felix Zielcke * util/i386/pc/grub-setup.c (setup): Fix 2 incorrect checks diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 5c3ffcdde..8ceb811dd 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -119,7 +119,7 @@ for option in "$@"; do recheck=yes ;; --disk-module=*) if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then - disk_module=`echo "$option" | sed 's/--disk-module//'` + disk_module=`echo "$option" | sed 's/--disk-module=//'` fi ;; # This is an undocumented feature... --debug) From 3bb7abcfbfb1f195d2d617ec102ac7607e8a533a Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 28 Jul 2009 21:32:20 +0000 Subject: [PATCH 0987/1707] 2009-07-28 Vladimir Serbinenko * loader/i386/multiboot_helper.S (grub_multiboot_backward_relocator): Clear direction flag before jumping to OS. (grub_multiboot2_real_boot): Likewise. --- ChangeLog | 6 ++++++ loader/i386/multiboot_helper.S | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index e4ec9862a..23c288e98 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-28 Vladimir Serbinenko + + * loader/i386/multiboot_helper.S (grub_multiboot_backward_relocator): + Clear direction flag before jumping to OS. + (grub_multiboot2_real_boot): Likewise. + 2009-07-28 Felix Zielcke * util/i386/pc/grub-install: Fix parsing of --disk-module diff --git a/loader/i386/multiboot_helper.S b/loader/i386/multiboot_helper.S index d7539f193..d1094588b 100644 --- a/loader/i386/multiboot_helper.S +++ b/loader/i386/multiboot_helper.S @@ -71,6 +71,7 @@ VARIABLE(grub_multiboot_backward_relocator) rep movsb + cld jmp *%edx VARIABLE(grub_multiboot_backward_relocator_end) @@ -112,4 +113,6 @@ FUNCTION(grub_multiboot2_real_boot) /* Move the magic value into eax and jump to the kernel. */ movl $MULTIBOOT2_BOOTLOADER_MAGIC,%eax popl %ecx + + cld jmp *%ecx From 388a7c759375444d824faf072d81e3a5a1615a3e Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 28 Jul 2009 21:40:34 +0000 Subject: [PATCH 0988/1707] 2009-07-28 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Use ',' rather than ';' as separator for the suggested gfxpayload string (';' collides with the parser and needs escaping). --- ChangeLog | 6 ++++++ loader/i386/linux.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 23c288e98..c0bbc3197 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-28 Robert Millan + + * loader/i386/linux.c (grub_cmd_linux): Use ',' rather than ';' as + separator for the suggested gfxpayload string (';' collides with the + parser and needs escaping). + 2009-07-28 Vladimir Serbinenko * loader/i386/multiboot_helper.S (grub_multiboot_backward_relocator): diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 78fa84822..d76e7fbd0 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -776,7 +776,7 @@ grub_cmd_linux (grub_command_t cmd __attribute__ ((unused)), linux_mode = &linux_vesafb_modes[vid_mode - GRUB_LINUX_VID_MODE_VESA_START]; - grub_sprintf (buf, "%ux%ux%u;%ux%u", + grub_sprintf (buf, "%ux%ux%u,%ux%u", linux_vesafb_res[linux_mode->res_index].width, linux_vesafb_res[linux_mode->res_index].height, linux_mode->depth, From 67bb323a1c4f5587fa5e572bd537f3fe64c344be Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 29 Jul 2009 14:11:50 +0000 Subject: [PATCH 0989/1707] 2009-07-29 Felix Zielcke * util/deviceiter.c (get_acceleraid_disk_name): New static function. (grub_util_iterate_devices): Handle Accelraid devices. * util/hostdisk.c (convert_system_partition_to_system_disk): Likewise. --- ChangeLog | 7 +++++++ util/deviceiter.c | 27 +++++++++++++++++++++++++++ util/hostdisk.c | 10 ++++++++++ 3 files changed, 44 insertions(+) diff --git a/ChangeLog b/ChangeLog index c0bbc3197..206370368 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-29 Felix Zielcke + + * util/deviceiter.c (get_acceleraid_disk_name): New static + function. + (grub_util_iterate_devices): Handle Accelraid devices. + * util/hostdisk.c (convert_system_partition_to_system_disk): Likewise. + 2009-07-28 Robert Millan * loader/i386/linux.c (grub_cmd_linux): Use ',' rather than ';' as diff --git a/util/deviceiter.c b/util/deviceiter.c index 6443afa5e..b0a9e1388 100644 --- a/util/deviceiter.c +++ b/util/deviceiter.c @@ -288,6 +288,12 @@ get_dac960_disk_name (char *name, int controller, int drive) sprintf (name, "/dev/rd/c%dd%d", controller, drive); } +static void +get_acceleraid_disk_name (char *name, int controller, int drive) +{ + sprintf (name, "/dev/rs/c%dd%d", controller, drive); +} + static void get_ataraid_disk_name (char *name, int unit) { @@ -545,6 +551,27 @@ grub_util_iterate_devices (int NESTED_FUNC_ATTR (*hook) (const char *, int), } } + /* This is for Mylex Acceleraid - we have + /dev/rd/cdp. */ + { + int controller, drive; + + for (controller = 0; controller < 8; controller++) + { + for (drive = 0; drive < 15; drive++) + { + char name[24]; + + get_acceleraid_disk_name (name, controller, drive); + if (check_device (name)) + { + if (hook (name, 0)) + return; + } + } + } + } + /* This is for CCISS - we have /dev/cciss/cdp. */ { diff --git a/util/hostdisk.c b/util/hostdisk.c index 584269809..fdf35148f 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -743,6 +743,16 @@ convert_system_partition_to_system_disk (const char *os_dev) return path; } + /* If this is a Mylex AcceleRAID Array. */ + if (strncmp ("rs/c", p, 4) == 0) + { + /* /dev/rd/c[0-9]+d[0-9]+(p[0-9]+)? */ + p = strchr (p, 'p'); + if (p) + *p = '\0'; + + return path; + } /* If this is a CCISS disk. */ if (strncmp ("cciss/c", p, sizeof ("cciss/c") - 1) == 0) { From 56c5a47f430946861c5c56f68edf5a5fc955524e Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 29 Jul 2009 22:12:00 +0000 Subject: [PATCH 0990/1707] 2009-07-29 Joe Auricchio * term/gfxterm.c (clear_char): New function. (grub_virtual_screen_setup): Use clear_char. (scroll_up): Likewise. (grub_virtual_screen_cls): Likewise. --- ChangeLog | 7 +++++++ term/gfxterm.c | 36 ++++++++++++++---------------------- 2 files changed, 21 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 206370368..962e82153 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-07-29 Joe Auricchio + + * term/gfxterm.c (clear_char): New function. + (grub_virtual_screen_setup): Use clear_char. + (scroll_up): Likewise. + (grub_virtual_screen_cls): Likewise. + 2009-07-29 Felix Zielcke * util/deviceiter.c (get_acceleraid_disk_name): New static diff --git a/term/gfxterm.c b/term/gfxterm.c index 61cf0e750..f161499e6 100644 --- a/term/gfxterm.c +++ b/term/gfxterm.c @@ -150,6 +150,16 @@ set_term_color (grub_uint8_t term_color) grub_video_set_active_render_target (old_target); } +static void +clear_char (struct grub_colored_char *c) +{ + c->code = ' '; + c->fg_color = virtual_screen.fg_color; + c->bg_color = virtual_screen.bg_color; + c->width = 0; + c->index = 0; +} + static void grub_virtual_screen_free (void) { @@ -228,14 +238,8 @@ grub_virtual_screen_setup (unsigned int x, unsigned int y, grub_video_set_active_render_target (GRUB_VIDEO_RENDER_TARGET_DISPLAY); /* Clear out text buffer. */ - for(i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) - { - virtual_screen.text_buffer[i].code = ' '; - virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color; - virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color; - virtual_screen.text_buffer[i].width = 0; - virtual_screen.text_buffer[i].index = 0; - } + for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) + clear_char (&(virtual_screen.text_buffer[i])); return grub_errno; } @@ -580,13 +584,7 @@ scroll_up (void) for (i = virtual_screen.columns * (virtual_screen.rows - 1); i < virtual_screen.columns * virtual_screen.rows; i++) - { - virtual_screen.text_buffer[i].code = ' '; - virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color; - virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color; - virtual_screen.text_buffer[i].width = 0; - virtual_screen.text_buffer[i].index = 0; - } + clear_char (&(virtual_screen.text_buffer[i])); /* Scroll physical screen. */ grub_video_set_active_render_target (text_layer); @@ -800,13 +798,7 @@ grub_virtual_screen_cls (void) grub_uint32_t i; for (i = 0; i < virtual_screen.columns * virtual_screen.rows; i++) - { - virtual_screen.text_buffer[i].code = ' '; - virtual_screen.text_buffer[i].fg_color = virtual_screen.fg_color; - virtual_screen.text_buffer[i].bg_color = virtual_screen.bg_color; - virtual_screen.text_buffer[i].width = 0; - virtual_screen.text_buffer[i].index = 0; - } + clear_char (&(virtual_screen.text_buffer[i])); virtual_screen.cursor_x = virtual_screen.cursor_y = 0; } From a275d9e7c0c407c30fb3256c660065a290986258 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 29 Jul 2009 22:50:38 +0000 Subject: [PATCH 0991/1707] 2009-07-30 Vladimir Serbinenko * util/i386/pc/grub-setup.c (setup): Check that no partition is in embeding zone, not only the first one. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 962e82153..5183b55e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-30 Vladimir Serbinenko + + * util/i386/pc/grub-setup.c (setup): Check that no partition is in + embeding zone, not only the first one. + 2009-07-29 Joe Auricchio * term/gfxterm.c (clear_char): New function. diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 38547e534..92c69ef15 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -132,7 +132,7 @@ setup (const char *dir, && embed_region.end > p->start) embed_region.end = p->start; - return 1; + return 0; } auto int NESTED_FUNC_ATTR find_usable_region_gpt (grub_disk_t disk, From 24443b5a47315c6850564c61bdb8f51469d52f3d Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 31 Jul 2009 04:38:20 +0000 Subject: [PATCH 0992/1707] 2009-07-31 Pavel Roskin * disk/raid5_recover.c (grub_raid5_recover): Revert conversion to grub_zalloc(), it was erroneous. Reported by Bean --- ChangeLog | 6 ++++++ disk/raid5_recover.c | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5183b55e0..0ac713c7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-07-31 Pavel Roskin + + * disk/raid5_recover.c (grub_raid5_recover): Revert conversion + to grub_zalloc(), it was erroneous. + Reported by Bean + 2009-07-30 Vladimir Serbinenko * util/i386/pc/grub-setup.c (setup): Check that no partition is in diff --git a/disk/raid5_recover.c b/disk/raid5_recover.c index a280be1ac..31cef88b1 100644 --- a/disk/raid5_recover.c +++ b/disk/raid5_recover.c @@ -32,10 +32,12 @@ grub_raid5_recover (struct grub_raid_array *array, int disknr, int i; size <<= GRUB_DISK_SECTOR_BITS; - buf2 = grub_zalloc (size); + buf2 = grub_malloc (size); if (!buf2) return grub_errno; + grub_memset (buf, 0, size); + for (i = 0; i < (int) array->total_devs; i++) { grub_err_t err; From f45d6cfc48715cdd72b0c32baed97b669a30e642 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 31 Jul 2009 14:25:19 +0000 Subject: [PATCH 0993/1707] 2009-07-31 Bean * disk/lvm.c (grub_lvm_scan_device): Ignore extra copy of metadata. Don't change pv->disk if it's already set. * disk/raid.c (grub_raid_scan_device): Merge this function into ... (grub_raid_register): ... here. (grub_raid_rescan): Removed. * include/grub/raid.h (grub_raid_rescan): Removed. * util/grub-fstest.c: Remove include file . (fstest): Replace grub_raid_rescan with module fini function followed by init function. * util/grub-probe.c: Add include file . (probe_raid_level): New function. (probe): Detect abstraction by walking the disk device, support two level of abstraction (LVM on RAID) when detecting partition map. --- ChangeLog | 20 +++++++++ disk/lvm.c | 15 +++---- disk/raid.c | 88 ++++++++++++++-------------------------- include/grub/raid.h | 1 - util/grub-fstest.c | 9 ++++- util/grub-probe.c | 99 ++++++++++++++++++++++++++++++++++----------- 6 files changed, 139 insertions(+), 93 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ac713c7c..6e8b257d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2009-07-31 Bean + + * disk/lvm.c (grub_lvm_scan_device): Ignore extra copy of metadata. + Don't change pv->disk if it's already set. + + * disk/raid.c (grub_raid_scan_device): Merge this function into ... + (grub_raid_register): ... here. + (grub_raid_rescan): Removed. + + * include/grub/raid.h (grub_raid_rescan): Removed. + + * util/grub-fstest.c: Remove include file . + (fstest): Replace grub_raid_rescan with module fini function followed + by init function. + + * util/grub-probe.c: Add include file . + (probe_raid_level): New function. + (probe): Detect abstraction by walking the disk device, support two + level of abstraction (LVM on RAID) when detecting partition map. + 2009-07-31 Pavel Roskin * disk/raid5_recover.c (grub_raid5_recover): Revert conversion diff --git a/disk/lvm.c b/disk/lvm.c index 6707a4068..126b49439 100644 --- a/disk/lvm.c +++ b/disk/lvm.c @@ -271,15 +271,9 @@ grub_lvm_scan_device (const char *name) dlocn++; mda_offset = grub_le_to_cpu64 (dlocn->offset); mda_size = grub_le_to_cpu64 (dlocn->size); - dlocn++; - if (dlocn->offset) - { - grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "We don't support multiple LVM metadata areas"); - - goto fail; - } + /* It's possible to have multiple copies of metadata areas, we just use the + first one. */ /* Allocate buffer space for the circular worst-case scenario. */ metadatabuf = grub_malloc (2 * mda_size); @@ -564,7 +558,10 @@ grub_lvm_scan_device (const char *name) { if (! grub_memcmp (pv->id, pv_id, GRUB_LVM_ID_STRLEN)) { - pv->disk = grub_disk_open (name); + /* This could happen to LVM on RAID, pv->disk points to the + raid device, we shouldn't change it. */ + if (! pv->disk) + pv->disk = grub_disk_open (name); break; } } diff --git a/disk/raid.c b/disk/raid.c index c4d0857fd..c720fb36c 100644 --- a/disk/raid.c +++ b/disk/raid.c @@ -589,56 +589,6 @@ insert_array (grub_disk_t disk, struct grub_raid_array *new_array, static grub_raid_t grub_raid_list; -static void -grub_raid_scan_device (int head_only) -{ - auto int hook (const char *name); - int hook (const char *name) - { - grub_disk_t disk; - struct grub_raid_array array; - struct grub_raid *p; - - grub_dprintf ("raid", "Scanning for RAID devices on disk %s\n", name); - - disk = grub_disk_open (name); - if (!disk) - return 0; - - if (disk->total_sectors == GRUB_ULONG_MAX) - { - grub_disk_close (disk); - return 0; - } - - for (p = grub_raid_list; p; p = p->next) - { - if (! p->detect (disk, &array)) - { - if (! insert_array (disk, &array, p->name)) - return 0; - - break; - } - - /* This error usually means it's not raid, no need to display - it. */ - if (grub_errno != GRUB_ERR_OUT_OF_RANGE) - grub_print_error (); - - grub_errno = GRUB_ERR_NONE; - if (head_only) - break; - } - - grub_disk_close (disk); - - return 0; - } - - grub_device_iterate (&hook); -} - static void free_array (void) { @@ -668,9 +618,38 @@ free_array (void) void grub_raid_register (grub_raid_t raid) { + auto int hook (const char *name); + int hook (const char *name) + { + grub_disk_t disk; + struct grub_raid_array array; + + grub_dprintf ("raid", "Scanning for RAID devices on disk %s\n", name); + + disk = grub_disk_open (name); + if (!disk) + return 0; + + if ((disk->total_sectors != GRUB_ULONG_MAX) && + (! grub_raid_list->detect (disk, &array)) && + (! insert_array (disk, &array, grub_raid_list->name))) + return 0; + + /* This error usually means it's not raid, no need to display + it. */ + if (grub_errno != GRUB_ERR_OUT_OF_RANGE) + grub_print_error (); + + grub_errno = GRUB_ERR_NONE; + + grub_disk_close (disk); + + return 0; + } + raid->next = grub_raid_list; grub_raid_list = raid; - grub_raid_scan_device (1); + grub_device_iterate (&hook); } void @@ -686,13 +665,6 @@ grub_raid_unregister (grub_raid_t raid) } } -void -grub_raid_rescan (void) -{ - free_array (); - grub_raid_scan_device (0); -} - static struct grub_disk_dev grub_raid_dev = { .name = "raid", diff --git a/include/grub/raid.h b/include/grub/raid.h index 595ced1d6..8fa4c3814 100644 --- a/include/grub/raid.h +++ b/include/grub/raid.h @@ -67,7 +67,6 @@ typedef struct grub_raid *grub_raid_t; void grub_raid_register (grub_raid_t raid); void grub_raid_unregister (grub_raid_t raid); -void grub_raid_rescan (void); void grub_raid_block_xor (char *buf1, const char *buf2, int size); typedef grub_err_t (*grub_raid5_recover_func_t) (struct grub_raid_array *array, diff --git a/util/grub-fstest.c b/util/grub-fstest.c index 47222699f..1bb37066f 100644 --- a/util/grub-fstest.c +++ b/util/grub-fstest.c @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -293,7 +292,13 @@ fstest (char **images, int num_disks, int cmd, int n, char **args) grub_util_error ("loopback command fails."); } - grub_raid_rescan (); + grub_lvm_fini (); + grub_mdraid_fini (); + grub_raid_fini (); + grub_raid_init (); + grub_mdraid_init (); + grub_lvm_init (); + switch (cmd) { case CMD_LS: diff --git a/util/grub-probe.c b/util/grub-probe.c index 97d386051..0088028f5 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -30,6 +30,7 @@ #include #include #include +#include #include @@ -100,13 +101,21 @@ probe_partmap (grub_disk_t disk) free (name); } +static int +probe_raid_level (grub_disk_t disk) +{ + if (disk->dev->id != GRUB_DISK_DEVICE_RAID_ID) + return -1; + + return ((struct grub_raid_array *) disk->data)->level; +} + static void probe (const char *path, char *device_name) { char *drive_name = NULL; char *grub_path = NULL; char *filebuf_via_grub = NULL, *filebuf_via_sys = NULL; - int abstraction_type; grub_device_t dev = NULL; grub_fs_t fs; @@ -132,28 +141,6 @@ probe (const char *path, char *device_name) goto end; } - abstraction_type = grub_util_get_dev_abstraction (device_name); - /* No need to check for errors; lack of abstraction is permissible. */ - - if (print == PRINT_ABSTRACTION) - { - char *abstraction_name; - switch (abstraction_type) - { - case GRUB_DEV_ABSTRACTION_LVM: - abstraction_name = "lvm"; - break; - case GRUB_DEV_ABSTRACTION_RAID: - abstraction_name = "raid mdraid"; - break; - default: - grub_util_info ("did not find LVM/RAID in %s, assuming raw device", device_name); - goto end; - } - printf ("%s\n", abstraction_name); - goto end; - } - drive_name = grub_util_get_grub_dev (device_name); if (! drive_name) grub_util_error ("Cannot find a GRUB drive for %s. Check your device.map.\n", device_name); @@ -169,6 +156,58 @@ probe (const char *path, char *device_name) if (! dev) grub_util_error ("%s", grub_errmsg); + if (print == PRINT_ABSTRACTION) + { + grub_disk_memberlist_t list = NULL, tmp; + const int is_lvm = (dev->disk->dev->id == GRUB_DISK_DEVICE_LVM_ID); + int is_raid = 0; + int is_raid5 = 0; + int is_raid6 = 0; + int raid_level; + + raid_level = probe_raid_level (dev->disk); + if (raid_level >= 0) + { + is_raid = 1; + is_raid5 |= (raid_level == 5); + is_raid6 |= (raid_level == 6); + } + + if ((is_lvm) && (dev->disk->dev->memberlist)) + list = dev->disk->dev->memberlist (dev->disk); + while (list) + { + raid_level = probe_raid_level (list->disk); + if (raid_level >= 0) + { + is_raid = 1; + is_raid5 |= (raid_level == 5); + is_raid6 |= (raid_level == 6); + } + + tmp = list->next; + free (list); + list = tmp; + } + + if (is_raid) + { + printf ("raid "); + if (is_raid5) + printf ("raid5rec "); + if (is_raid6) + printf ("raid6rec "); + printf ("mdraid "); + } + + if (is_lvm) + printf ("lvm "); + + printf ("\n"); + + goto end; + } + if (print == PRINT_PARTMAP) { grub_disk_memberlist_t list = NULL, tmp; @@ -182,6 +221,20 @@ probe (const char *path, char *device_name) while (list) { probe_partmap (list->disk); + /* LVM on RAID */ + if (list->disk->dev->memberlist) + { + grub_disk_memberlist_t sub_list; + + sub_list = list->disk->dev->memberlist (list->disk); + while (sub_list) + { + probe_partmap (sub_list->disk); + tmp = sub_list->next; + free (sub_list); + sub_list = tmp; + } + } tmp = list->next; free (list); list = tmp; From fbc6ab545ec22f42e6ea4ae70738509472167ab6 Mon Sep 17 00:00:00 2001 From: bean Date: Fri, 31 Jul 2009 14:58:04 +0000 Subject: [PATCH 0994/1707] 2009-07-31 Bean * fs/xfs.c (grub_xfs_sblock): Change unused5 field to log2_sect and log2_inode. (grub_fshelp_node): Move inode field to the end. (grub_xfs_data): Remove inode field. (grub_xfs_inode_block): Calculate inode size using sblock. (grub_xfs_inode_offset): Likewise. (grub_xfs_read_inode): Calculate inode size using sblock. (grub_xfs_read_block): Replace XFS_INODE_EXTENTS with nrec. (grub_xfs_iterate_dir): Calculate inode size using sblock. (grub_xfs_mount): Use grub_zalloc instead of grub_malloc. Realloc data to match inode size. (grub_xfs_dir): goto mount_fail when mount fails, as data->diropen is not accessible when data is null. (grub_xfs_open): Likewise. --- ChangeLog | 17 +++++++++++++++++ fs/xfs.c | 53 ++++++++++++++++++++++++++++++++--------------------- 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6e8b257d4..6ac2c9bd2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,20 @@ +2009-07-31 Bean + + * fs/xfs.c (grub_xfs_sblock): Change unused5 field to log2_sect and + log2_inode. + (grub_fshelp_node): Move inode field to the end. + (grub_xfs_data): Remove inode field. + (grub_xfs_inode_block): Calculate inode size using sblock. + (grub_xfs_inode_offset): Likewise. + (grub_xfs_read_inode): Calculate inode size using sblock. + (grub_xfs_read_block): Replace XFS_INODE_EXTENTS with nrec. + (grub_xfs_iterate_dir): Calculate inode size using sblock. + (grub_xfs_mount): Use grub_zalloc instead of grub_malloc. Realloc data + to match inode size. + (grub_xfs_dir): goto mount_fail when mount fails, as data->diropen is + not accessible when data is null. + (grub_xfs_open): Likewise. + 2009-07-31 Bean * disk/lvm.c (grub_lvm_scan_device): Ignore extra copy of metadata. diff --git a/fs/xfs.c b/fs/xfs.c index ddaba5720..a143b55a0 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -46,7 +46,8 @@ struct grub_xfs_sblock grub_uint8_t unused4[20]; grub_uint8_t label[12]; grub_uint8_t log2_bsize; - grub_uint8_t unused5[2]; + grub_uint8_t log2_sect; + grub_uint8_t log2_inode; grub_uint8_t log2_inop; grub_uint8_t log2_agblk; grub_uint8_t unused6[67]; @@ -131,21 +132,19 @@ struct grub_xfs_dirblock_tail struct grub_fshelp_node { struct grub_xfs_data *data; - struct grub_xfs_inode inode; grub_uint64_t ino; int inode_read; + struct grub_xfs_inode inode; }; struct grub_xfs_data { struct grub_xfs_sblock sblock; - struct grub_xfs_inode *inode; grub_disk_t disk; int pos; int bsize; int agsize; struct grub_fshelp_node diropen; - }; static grub_dl_t my_mod; @@ -194,7 +193,7 @@ grub_xfs_inode_block (struct grub_xfs_data *data, long long ag = GRUB_XFS_INO_AG (data, ino); long long block; - block = (inoinag >> 4) + ag * data->agsize; + block = (inoinag >> data->sblock.log2_inop) + ag * data->agsize; block <<= (data->sblock.log2_bsize - GRUB_DISK_SECTOR_BITS); return block; } @@ -205,7 +204,8 @@ grub_xfs_inode_offset (struct grub_xfs_data *data, grub_uint64_t ino) { int inoag = GRUB_XFS_INO_INOINAG (data, ino); - return (inoag & ((1 << 4) - 1)) << 8; + return ((inoag & ((1 << data->sblock.log2_inop) - 1)) << + data->sblock.log2_inode); } @@ -218,7 +218,7 @@ grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, /* Read the inode. */ if (grub_disk_read (data->disk, block, offset, - sizeof (struct grub_xfs_inode), inode)) + 1 << data->sblock.log2_inode, inode)) return grub_errno; if (grub_strncmp ((char *) inode->magic, "IN", 2)) @@ -264,7 +264,7 @@ grub_xfs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) } if (grub_disk_read (node->data->disk, - grub_be_to_cpu64 (keys[i - 1 + XFS_INODE_EXTENTS]) + grub_be_to_cpu64 (keys[i - 1 + nrec]) << (node->data->sblock.log2_bsize - GRUB_DISK_SECTOR_BITS), 0, node->data->sblock.bsize, leaf)) @@ -400,7 +400,9 @@ grub_xfs_iterate_dir (grub_fshelp_node_t dir, { struct grub_fshelp_node *fdiro; - fdiro = grub_malloc (sizeof (struct grub_fshelp_node)); + fdiro = grub_malloc (sizeof (struct grub_fshelp_node) + - sizeof (struct grub_xfs_inode) + + (1 << diro->data->sblock.log2_inode)); if (!fdiro) return 0; @@ -577,7 +579,7 @@ grub_xfs_mount (grub_disk_t disk) { struct grub_xfs_data *data = 0; - data = grub_malloc (sizeof (struct grub_xfs_data)); + data = grub_zalloc (sizeof (struct grub_xfs_data)); if (!data) return 0; @@ -592,6 +594,14 @@ grub_xfs_mount (grub_disk_t disk) goto fail; } + data = grub_realloc (data, + sizeof (struct grub_xfs_data) + - sizeof (struct grub_xfs_inode) + + (1 << data->sblock.log2_inode)); + + if (! data) + goto fail; + data->diropen.data = data; data->diropen.ino = data->sblock.rootino; data->diropen.inode_read = 1; @@ -599,10 +609,9 @@ grub_xfs_mount (grub_disk_t disk) data->agsize = grub_be_to_cpu32 (data->sblock.agsize); data->disk = disk; - data->inode = &data->diropen.inode; data->pos = 0; - grub_xfs_read_inode (data, data->diropen.ino, data->inode); + grub_xfs_read_inode (data, data->diropen.ino, &data->diropen.inode); return data; fail: @@ -643,7 +652,7 @@ grub_xfs_dir (grub_device_t device, const char *path, data = grub_xfs_mount (device->disk); if (!data) - goto fail; + goto mount_fail; grub_fshelp_find_file (path, &data->diropen, &fdiro, grub_xfs_iterate_dir, grub_xfs_read_symlink, GRUB_FSHELP_DIR); @@ -657,11 +666,11 @@ grub_xfs_dir (grub_device_t device, const char *path, grub_free (fdiro); grub_free (data); + mount_fail: + grub_dl_unref (my_mod); return grub_errno; - - return 0; } @@ -676,7 +685,7 @@ grub_xfs_open (struct grub_file *file, const char *name) data = grub_xfs_mount (file->device->disk); if (!data) - goto fail; + goto mount_fail; grub_fshelp_find_file (name, &data->diropen, &fdiro, grub_xfs_iterate_dir, grub_xfs_read_symlink, GRUB_FSHELP_REG); @@ -690,12 +699,13 @@ grub_xfs_open (struct grub_file *file, const char *name) goto fail; } - grub_memcpy (data->inode, - &fdiro->inode, - sizeof (struct grub_xfs_inode)); - grub_free (fdiro); + if (fdiro != &data->diropen) + grub_memcpy (&data->diropen, fdiro, + sizeof (struct grub_fshelp_node) + - sizeof (struct grub_xfs_inode) + + (1 << data->sblock.log2_inode)); - file->size = grub_be_to_cpu64 (data->inode->size); + file->size = grub_be_to_cpu64 (data->diropen.inode.size); file->data = data; file->offset = 0; @@ -706,6 +716,7 @@ grub_xfs_open (struct grub_file *file, const char *name) grub_free (fdiro); grub_free (data); + mount_fail: grub_dl_unref (my_mod); return grub_errno; From 19d50c2be8e526dd1872ccafaef52e131015a0ff Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 31 Jul 2009 16:01:49 +0000 Subject: [PATCH 0995/1707] Add missing ChangeLog entry for -r2293 --- ChangeLog | 227 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 227 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6ac2c9bd2..0ca68bac1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1148,6 +1148,231 @@ * kern/i386/coreboot/init.c: Include grub/cpu/tsc.h to fix compiler warnings. +2009-06-10 Felix Zielcke + + * Makefile.in: Remove all trailing whitespace. + * conf/i386-pc.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + * docs/grub.texi: Likewise. + * docs/texinfo.tex: Likewise. + * disk/fs_uuid.c: Likewise. + * disk/lvm.c: Likewise. + * disk/scsi.c: Likewise. + * disk/ata.c: Likewise. + * disk/ieee1275/ofdisk.c: Likewise. + * disk/i386/pc/biosdisk.c: Likewise. + * disk/host.c: Likewise. + * disk/raid.c: Likewise. + * disk/efi/efidisk.c: Likewise. + * disk/usbms.c: Likewise. + * disk/memdisk.c: Likewise. + * disk/loopback.c: Likewise. + * kern/powerpc/dl.c: Likewise. + * kern/device.c: Likewise. + * kern/dl.c: Likewise. + * kern/sparc64/dl.c: Likewise. + * kern/ieee1275/ieee1275.c: Likewise. + * kern/term.c: Likewise. + * kern/fs.c: Likewise. + * kern/i386/dl.c: Likewise. + * kern/i386/pc/startup.S: Likewise. + * kern/i386/pc/init.c: Likewise. + * kern/i386/pc/mmap.c: Likewise. + * kern/i386/pc/lzo1x.S: Likewise. + * kern/i386/ieee1275/init.c: Likewise. + * kern/i386/realmode.S: Likewise. + * kern/i386/tsc.c: Likewise. + * kern/partition.c: Likewise. + * kern/corecmd.c: Likewise. + * kern/file.c: Likewise. + * kern/efi/efi.c: Likewise. + * kern/efi/init.c: Likewise. + * kern/efi/mm.c: Likewise. + * kern/main.c: Likewise. + * kern/err.c: Likewise. + * kern/env.c: Likewise. + * kern/disk.c: Likewise. + * kern/generic/millisleep.c: Likewise. + * kern/generic/rtc_get_time_ms.c: Likewise. + * kern/misc.c: Likewise. + * kern/parser.c: Likewise. + * genmk.rb: Likewise. + * configure.ac: Likewise. + * boot/i386/pc/diskboot.S: Likewise. + * boot/i386/pc/pxeboot.S: Likewise. + * boot/i386/pc/boot.S: Likewise. + * boot/i386/pc/lnxboot.S: Likewise. + * boot/i386/pc/cdboot.S: Likewise. + * parttool/pcpart.c: Likewise. + * video/readers/tga.c: Likewise. + * video/video.c: Likewise. + * video/bitmap.c: Likewise. + * lib/envblk.c: Likewise. + * lib/i386/setjmp.S: Likewise. + * fs/xfs.c: Likewise. + * fs/afs.c: Likewise. + * fs/fat.c: Likewise. + * fs/ntfs.c: Likewise. + * fs/udf.c: Likewise. + * fs/affs.c: Likewise. + * fs/iso9660.c: Likewise. + * fs/hfs.c: Likewise. + * fs/fshelp.c: Likewise. + * fs/ext2.c: Likewise. + * fs/jfs.c: Likewise. + * fs/reiserfs.c: Likewise. + * fs/hfsplus.c: Likewise. + * fs/minix.c: Likewise. + * fs/cpio.c: Likewise. + * fs/sfs.c: Likewise. + * fs/ufs.c: Likewise. + * efiemu/prepare.c: Likewise. + * efiemu/loadcore_common.c: Likewise. + * efiemu/runtime/efiemu.sh: Likewise. + * efiemu/runtime/efiemu.S: Likewise. + * efiemu/runtime/efiemu.c: Likewise. + * efiemu/pnvram.c: Likewise. + * efiemu/main.c: Likewise. + * efiemu/i386/pc/cfgtables.c: Likewise. + * efiemu/i386/loadcore64.c: Likewise. + * efiemu/i386/loadcore32.c: Likewise. + * efiemu/loadcore.c: Likewise. + * efiemu/symbols.c: Likewise. + * efiemu/mm.c: Likewise. + * include/grub/autoefi.h: Likewise. + * include/grub/datetime.h: Likewise. + * include/grub/term.h: Likewise. + * include/grub/hfs.h: Likewise. + * include/grub/lvm.h: Likewise. + * include/grub/i386/tsc.h: Likewise. + * include/grub/i386/linux.h: Likewise. + * include/grub/i386/xnu.h: Likewise. + * include/grub/i386/efiemu.h: Likewise. + * include/grub/i386/pc/biosdisk.h: Likewise. + * include/grub/i386/pc/memory.h: Likewise. + * include/grub/i386/pc/vbe.h: Likewise. + * include/grub/parttool.h: Likewise. + * include/grub/video.h: Likewise. + * include/grub/memory.h: Likewise. + * include/grub/fs.h: Likewise. + * include/grub/partition.h: Likewise. + * include/grub/xnu.h: Likewise. + * include/grub/efi/api.h: Likewise. + * include/grub/efi/pe32.h: Likewise. + * include/grub/efi/memory.h: Likewise. + * include/grub/multiboot.h: Likewise. + * include/grub/usbdesc.h: Likewise. + * include/grub/multiboot2.h: Likewise. + * include/grub/acpi.h: Likewise. + * include/grub/efiemu/efiemu.h: Likewise. + * include/grub/disk.h: Likewise. + * include/grub/ieee1275/ieee1275.h: Likewise. + * include/grub/net.h: Likewise. + * include/grub/machoload.h: Likewise. + * include/grub/macho.h: Likewise. + * include/multiboot.h: Likewise. + * genmoddep.awk: Likewise. + * normal/main.c: Likewise. + * normal/menu_entry.c: Likewise. + * normal/menu_viewer.c: Likewise. + * normal/completion.c: Likewise. + * normal/cmdline.c: Likewise. + * normal/misc.c: Likewise. + * normal/datetime.c: Likewise. + * bus/usb/usbtrans.c: Likewise. + * bus/usb/ohci.c: Likewise. + * bus/usb/uhci.c: Likewise. + * bus/usb/usb.c: Likewise. + * mmap/efi/mmap.c: Likewise. + * mmap/i386/pc/mmap_helper.S: Likewise. + * mmap/i386/pc/mmap.c: Likewise. + * mmap/i386/mmap.c: Likewise. + * mmap/i386/uppermem.c: Likewise. + * mmap/mmap.c: Likewise. + * commands/acpi.c: Likewise. + * commands/echo.c: Likewise. + * commands/blocklist.c: Likewise. + * commands/loadenv.c: Likewise. + * commands/usbtest.c: Likewise. + * commands/boot.c: Likewise. + * commands/parttool.c: Likewise. + * commands/search.c: Likewise. + * commands/cat.c: Likewise. + * commands/i386/pc/play.c: Likewise. + * commands/i386/pc/drivemap.c: Likewise. + * commands/i386/pc/vbeinfo.c: Likewise. + * commands/i386/pc/acpi.c: Likewise. + * commands/i386/pc/vbetest.c: Likewise. + * commands/ls.c: Likewise. + * commands/cmp.c: Likewise. + * commands/test.c: Likewise. + * commands/efi/acpi.c: Likewise. + * commands/gptsync.c: Likewise. + * commands/help.c: Likewise. + * partmap/amiga.c: Likewise. + * partmap/apple.c: Likewise. + * partmap/acorn.c: Likewise. + * partmap/pc.c: Likewise. + * partmap/sun.c: Likewise. + * partmap/gpt.c: Likewise. + * script/sh/lexer.c: Likewise. + * script/sh/function.c: Likewise. + * font/font.c: Likewise. + * font/font_cmd.c: Likewise. + * loader/powerpc/ieee1275/linux.c: Likewise. + * loader/efi/chainloader.c: Likewise. + * loader/multiboot_loader.c: Likewise. + * loader/macho.c: Likewise. + * loader/i386/multiboot.c: Likewise. + * loader/i386/linux.c: Likewise. + * loader/i386/pc/linux.c: Likewise. + * loader/i386/pc/multiboot2.c: Likewise. + * loader/i386/pc/chainloader.c: Likewise. + * loader/i386/pc/xnu.c: Likewise. + * loader/i386/bsd_trampoline.S: Likewise. + * loader/i386/efi/linux.c: Likewise. + * loader/i386/multiboot_elfxx.c: Likewise. + * loader/i386/bsd_helper.S: Likewise. + * loader/i386/bsd.c: Likewise. + * loader/i386/linux_trampoline.S: Likewise. + * loader/i386/xnu_helper.S: Likewise. + * loader/i386/xnu.c: Likewise. + * loader/i386/bsd_pagetable.c: Likewise. + * loader/i386/multiboot_helper.S: Likewise. + * loader/xnu.c: Likewise. + * loader/xnu_resume.c: Likewise. + * io/gzio.c: Likewise. + * term/efi/console.c: Likewise. + * term/terminfo.c: Likewise. + * term/ieee1275/ofconsole.c: Likewise. + * term/i386/pc/serial.c: Likewise. + * term/i386/pc/vesafb.c: Likewise. + * term/i386/pc/vga.c: Likewise. + * term/usb_keyboard.c: Likewise. + * term/gfxterm.c: Likewise. + * aclocal.m4: Likewise. + * util/lvm.c: Likewise. + * util/grub.d/30_os-prober.in: Likewise. + * util/grub.d/10_hurd.in: Likewise. + * util/console.c: Likewise. + * util/grub-macho2img.c: Likewise. + * util/grub-probe.c: Likewise. + * util/hostfs.c: Likewise. + * util/i386/pc/grub-mkimage.c: Likewise. + * util/i386/pc/grub-setup.c: Likewise. + * util/i386/efi/grub-mkimage.c: Likewise. + * util/grub-mkconfig.in: Likewise. + * util/raid.c: Likewise. + * util/resolve.c: Likewise. + * util/grub-mkdevicemap.c: Likewise. + * util/grub-emu.c: Likewise. + * util/getroot.c: Likewise. + * util/hostdisk.c: Likewise. + * util/usb.c: Likewise. + * util/grub-editenv.c: Likewise. + * util/misc.c: Likewise. + 2009-06-10 Felix Zielcke * gendistlist.sh (EXTRA_DISTFILES): Add `genhandlerlist.sh' and @@ -18564,3 +18789,5 @@ * Changelog: New file. + + From 67459bc69db4af76ba0f8a32ee3ebd99df25275f Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 31 Jul 2009 16:04:27 +0000 Subject: [PATCH 0996/1707] 2009-07-31 Vladimir Serbinenko * partmap/pc.c (pc_partition_map_iterate): Check that boot flags are valid. --- ChangeLog | 5 +++++ partmap/pc.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0ca68bac1..e55382872 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-31 Vladimir Serbinenko + + * partmap/pc.c (pc_partition_map_iterate): Check that boot flags are + valid. + 2009-07-31 Bean * fs/xfs.c (grub_xfs_sblock): Change unused5 field to log2_sect and diff --git a/partmap/pc.c b/partmap/pc.c index 6f68ecf93..6a2efd21e 100644 --- a/partmap/pc.c +++ b/partmap/pc.c @@ -121,6 +121,10 @@ pc_partition_map_iterate (grub_disk_t disk, if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); + for (i = 0; i < 4; i++) + if (mbr.entries[i].flag & 0x7f) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "bad boot flag"); + /* Analyze DOS partitions. */ for (p.index = 0; p.index < 4; p.index++) { From 8fc6ffc62c95f65c680c45ec4a6a416bf5d43337 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 31 Jul 2009 16:14:03 +0000 Subject: [PATCH 0997/1707] Remove 2 empty lines in ChangeLog accidently added by r2459 commit --- ChangeLog | 2 -- 1 file changed, 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index e55382872..84b24256f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -18794,5 +18794,3 @@ * Changelog: New file. - - From 6ad6258a28bbb383f17643de55784f30e73badca Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 1 Aug 2009 14:30:59 +0000 Subject: [PATCH 0998/1707] 2009-08-01 Vladimir Serbinenko 2009-08-01 Robert Millan Fix cpuid command. * commands/i386/cpuid.c (options): New variable. (grub_cmd_cpuid): Return real error. (GRUB_MOD_INIT(cpuid)): Declare options. --- ChangeLog | 9 +++++++++ commands/i386/cpuid.c | 24 ++++++++++++++++-------- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 84b24256f..23c68d25c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-08-01 Vladimir Serbinenko +2009-08-01 Robert Millan + + Fix cpuid command. + + * commands/i386/cpuid.c (options): New variable. + (grub_cmd_cpuid): Return real error. + (GRUB_MOD_INIT(cpuid)): Declare options. + 2009-07-31 Vladimir Serbinenko * partmap/pc.c (pc_partition_map_iterate): Check that boot flags are diff --git a/commands/i386/cpuid.c b/commands/i386/cpuid.c index b80b14c10..71f33efb3 100644 --- a/commands/i386/cpuid.c +++ b/commands/i386/cpuid.c @@ -23,25 +23,33 @@ #include #include #include +#include #define cpuid(num,a,b,c,d) \ asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \ : "=a" (a), "=r" (b), "=c" (c), "=d" (d) \ : "0" (num)) +static const struct grub_arg_option options[] = + { + {"long-mode", 'l', 0, "check for long mode flag (default)", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + #define bit_LM (1 << 29) static unsigned char has_longmode = 0; static grub_err_t -grub_cmd_cpuid (struct grub_command *cmd __attribute__ ((unused)), - int argc __attribute__ ((unused)), - char **args __attribute__ ((unused))) +grub_cmd_cpuid (grub_extcmd_t cmd __attribute__ ((unused)), + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) { - return !has_longmode; + return has_longmode ? GRUB_ERR_NONE + : grub_error (GRUB_ERR_TEST_FAILURE, "false"); } -static grub_command_t cmd; +static grub_extcmd_t cmd; GRUB_MOD_INIT(cpuid) { @@ -78,11 +86,11 @@ GRUB_MOD_INIT(cpuid) done: #endif - cmd = grub_register_command ("cpuid", grub_cmd_cpuid, - 0, "Check for CPU features"); + cmd = grub_register_extcmd ("cpuid", grub_cmd_cpuid, GRUB_COMMAND_FLAG_BOTH, + "cpuid [-l]", "Check for CPU features", options); } GRUB_MOD_FINI(cpuid) { - grub_unregister_command (cmd); + grub_unregister_extcmd (cmd); } From 8aab5e25a1ee3fa11b7d19f1e015b68fa654206e Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 1 Aug 2009 14:40:30 +0000 Subject: [PATCH 0999/1707] 2009-08-01 Vladimir Serbinenko Support Apple partition map with sector size different from 512 bytes. * partmap/apple.c (grub_apple_header): New field 'blocksize'. (apple_partition_map_iterate): Respect 'aheader.blocksize' and 'apart.partmap_size'. --- ChangeLog | 8 ++++++++ partmap/apple.c | 29 ++++++++++++++++++----------- 2 files changed, 26 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 23c68d25c..76e8c680c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-01 Vladimir Serbinenko + + Support Apple partition map with sector size different from 512 bytes. + + * partmap/apple.c (grub_apple_header): New field 'blocksize'. + (apple_partition_map_iterate): Respect 'aheader.blocksize' + and 'apart.partmap_size'. + 2009-08-01 Vladimir Serbinenko 2009-08-01 Robert Millan diff --git a/partmap/apple.c b/partmap/apple.c index fce2f2c5f..04ccff146 100644 --- a/partmap/apple.c +++ b/partmap/apple.c @@ -30,6 +30,7 @@ struct grub_apple_header /* The magic number to identify the partition map, it should have the value `0x4552'. */ grub_uint16_t magic; + grub_uint16_t blocksize; }; struct grub_apple_part @@ -105,8 +106,8 @@ apple_partition_map_iterate (grub_disk_t disk, struct grub_apple_header aheader; struct grub_apple_part apart; struct grub_disk raw; - int partno = 0; - unsigned pos = GRUB_DISK_SECTOR_SIZE; + int partno = 0, partnum = 0; + unsigned pos; /* Enforce raw disk access. */ raw = *disk; @@ -126,7 +127,9 @@ apple_partition_map_iterate (grub_disk_t disk, goto fail; } - for (;;) + pos = grub_be_to_cpu16 (aheader.blocksize); + + do { if (grub_disk_read (&raw, pos / GRUB_DISK_SECTOR_SIZE, pos % GRUB_DISK_SECTOR_SIZE, @@ -142,8 +145,15 @@ apple_partition_map_iterate (grub_disk_t disk, break; } - part.start = grub_be_to_cpu32 (apart.first_phys_block); - part.len = grub_be_to_cpu32 (apart.blockcnt); + if (partnum == 0) + partnum = grub_be_to_cpu32 (apart.partmap_size); + + part.start = ((grub_disk_addr_t) grub_be_to_cpu32 (apart.first_phys_block) + * grub_be_to_cpu16 (aheader.blocksize)) + / GRUB_DISK_SECTOR_SIZE; + part.len = ((grub_disk_addr_t) grub_be_to_cpu32 (apart.blockcnt) + * grub_be_to_cpu16 (aheader.blocksize)) + / GRUB_DISK_SECTOR_SIZE; part.offset = pos; part.index = partno; @@ -156,15 +166,12 @@ apple_partition_map_iterate (grub_disk_t disk, if (hook (disk, &part)) return grub_errno; - if (grub_be_to_cpu32 (apart.first_phys_block) - == GRUB_DISK_SECTOR_SIZE * 2) - return 0; - - pos += sizeof (struct grub_apple_part); + pos += grub_be_to_cpu16 (aheader.blocksize); partno++; } + while (partno < partnum); - if (pos != GRUB_DISK_SECTOR_SIZE) + if (partno != 0) return 0; fail: From e768b77068a0b030a07576852bd0f121c9a077eb Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 1 Aug 2009 14:44:15 +0000 Subject: [PATCH 1000/1707] --- ChangeLog | 5 +++++ util/hostfs.c | 6 ------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 76e8c680c..f104a7c49 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-07-23 Vladimir Serbinenko + + * util/hostfs.c (grub_hostfs_dir): Don't use DT_DIR: It doesn't work + on XFS or ReiserFS. + 2009-08-01 Vladimir Serbinenko Support Apple partition map with sector size different from 512 bytes. diff --git a/util/hostfs.c b/util/hostfs.c index 1b963bb67..83db2f1a9 100644 --- a/util/hostfs.c +++ b/util/hostfs.c @@ -28,7 +28,6 @@ #include -#ifndef DT_DIR /* dirent.d_type is a BSD extension, not part of POSIX */ #include #include @@ -53,7 +52,6 @@ is_dir (const char *path, const char *name) return 0; return S_ISDIR (st.st_mode); } -#endif static grub_err_t grub_hostfs_dir (grub_device_t device, const char *path, @@ -81,11 +79,7 @@ grub_hostfs_dir (grub_device_t device, const char *path, if (! de) break; -#ifdef DT_DIR - info.dir = (de->d_type == DT_DIR); -#else info.dir = !! is_dir (path, de->d_name); -#endif hook (de->d_name, &info); } From bd288a205f7d8f9444430418c7427462ae84f92d Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 1 Aug 2009 14:47:11 +0000 Subject: [PATCH 1001/1707] 2009-08-01 Vladimir Serbinenko * util/hostfs.c (grub_hostfs_dir): Don't use DT_DIR: It doesn't work on XFS or ReiserFS. --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f104a7c49..d7f219b46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2009-07-23 Vladimir Serbinenko +2009-08-01 Vladimir Serbinenko * util/hostfs.c (grub_hostfs_dir): Don't use DT_DIR: It doesn't work on XFS or ReiserFS. From f84114f583a4ed1f6040b43133a9c074a45d918d Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 2 Aug 2009 21:57:26 +0000 Subject: [PATCH 1002/1707] 2009-08-02 Vladimir Serbinenko * commands/hexdump.c (grub_cmd_hexdump): Use grub_disk_read instead of homegrown code. --- ChangeLog | 5 +++++ commands/hexdump.c | 16 +++++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index d7f219b46..670d7258b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-02 Vladimir Serbinenko + + * commands/hexdump.c (grub_cmd_hexdump): Use grub_disk_read instead + of homegrown code. + 2009-08-01 Vladimir Serbinenko * util/hostfs.c (grub_hostfs_dir): Don't use DT_DIR: It doesn't work diff --git a/commands/hexdump.c b/commands/hexdump.c index 0e560c0ff..f59ba363c 100644 --- a/commands/hexdump.c +++ b/commands/hexdump.c @@ -22,7 +22,6 @@ #include #include #include -#include #include #include @@ -62,25 +61,20 @@ grub_cmd_hexdump (grub_extcmd_t cmd, int argc, char **args) if (! disk) return 0; - if (disk->partition) - skip += grub_partition_get_start (disk->partition) << GRUB_DISK_SECTOR_BITS; - sector = (skip >> (GRUB_DISK_SECTOR_BITS + 2)) * 4; ofs = skip & (GRUB_DISK_SECTOR_SIZE * 4 - 1); while (length) { - grub_size_t len, n; + grub_size_t len; len = length; - if (ofs + len > sizeof (buf)) - len = sizeof (buf) - ofs; + if (len > sizeof (buf)) + len = sizeof (buf); - n = ((ofs + len + GRUB_DISK_SECTOR_SIZE - 1) - >> GRUB_DISK_SECTOR_BITS); - if (disk->dev->read (disk, sector, n, buf)) + if (grub_disk_read (disk, sector, ofs, len, buf)) break; - hexdump (skip, &buf[ofs], len); + hexdump (skip, buf, len); ofs = 0; skip += len; From 222671b22ea7a95e6bc812bd42d6d3ba78381a3d Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 4 Aug 2009 20:10:28 +0000 Subject: [PATCH 1003/1707] 2009-08-04 Felix Zielcke * commands/search.c: Fix help output to match actual code. --- ChangeLog | 4 ++++ commands/search.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 670d7258b..71ad4afca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-04 Felix Zielcke + + * commands/search.c: Fix help output to match actual code. + 2009-08-02 Vladimir Serbinenko * commands/hexdump.c (grub_cmd_hexdump): Use grub_disk_read instead diff --git a/commands/search.c b/commands/search.c index 4ac7429eb..d10b51abf 100644 --- a/commands/search.c +++ b/commands/search.c @@ -29,7 +29,7 @@ static const struct grub_arg_option options[] = { - {"file", 'f', 0, "search devices by a file (default)", 0, 0}, + {"file", 'f', 0, "search devices by a file", 0, 0}, {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, {"fs-uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, From ecb1a6d9e9fabb3f858a8127950e4f60da43b0a8 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 4 Aug 2009 21:23:11 +0000 Subject: [PATCH 1004/1707] Fix last ChangeLog entry. --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 71ad4afca..2437c7cac 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2009-08-04 Felix Zielcke - * commands/search.c: Fix help output to match actual code. + * commands/search.c (options): Fix help output to match actual code. 2009-08-02 Vladimir Serbinenko From f56a875639c8deacaa40b953602f489aa9ab0881 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 4 Aug 2009 21:28:19 +0000 Subject: [PATCH 1005/1707] 2009-08-04 Robert Millan Fix a bug resulting in black screen when loading Linux using a packed video mode. * kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette_width): New function. * include/grub/i386/pc/vbe.h (GRUB_VBE_CAPABILITY_DACWIDTH): New macro. (grub_vbe_bios_getset_dac_palette_width): New function. (grub_vbe_bios_get_dac_palette_width) (grub_vbe_bios_set_dac_palette_width): New macros (act as wrappers for grub_vbe_bios_getset_dac_palette_width()). * video/i386/pc/vbe.c (grub_vbe_probe): Use `GRUB_VBE_STATUS_OK' to check for return status. (grub_vbe_get_video_mode_info): When getting information for a packed mode (<= 8 bpp), obtain DAC palette width using grub_vbe_bios_getset_dac_palette_width(), and use that for initializing {red,green,blue}_mark_size. --- ChangeLog | 21 +++++++++++++++++ include/grub/i386/pc/vbe.h | 7 ++++++ kern/i386/pc/startup.S | 46 ++++++++++++++++++++++++++++++++++++++ video/i386/pc/vbe.c | 20 ++++++++++++++++- 4 files changed, 93 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 2437c7cac..44f14a0d4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,24 @@ +2009-08-04 Robert Millan + + Fix a bug resulting in black screen when loading Linux using a + packed video mode. + + * kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette_width): New + function. + + * include/grub/i386/pc/vbe.h (GRUB_VBE_CAPABILITY_DACWIDTH): New macro. + (grub_vbe_bios_getset_dac_palette_width): New function. + (grub_vbe_bios_get_dac_palette_width) + (grub_vbe_bios_set_dac_palette_width): New macros (act as wrappers for + grub_vbe_bios_getset_dac_palette_width()). + + * video/i386/pc/vbe.c (grub_vbe_probe): Use `GRUB_VBE_STATUS_OK' to + check for return status. + (grub_vbe_get_video_mode_info): When getting information for a packed + mode (<= 8 bpp), obtain DAC palette width using + grub_vbe_bios_getset_dac_palette_width(), and use that for initializing + {red,green,blue}_mark_size. + 2009-08-04 Felix Zielcke * commands/search.c (options): Fix help output to match actual code. diff --git a/include/grub/i386/pc/vbe.h b/include/grub/i386/pc/vbe.h index bd6ecd7e4..fad3c6c36 100644 --- a/include/grub/i386/pc/vbe.h +++ b/include/grub/i386/pc/vbe.h @@ -30,6 +30,8 @@ /* VBE status codes. */ #define GRUB_VBE_STATUS_OK 0x004f +#define GRUB_VBE_CAPABILITY_DACWIDTH (1 << 0) + /* Bits from the GRUB_VBE "mode_attributes" field in the mode info struct. */ #define GRUB_VBE_MODEATTR_SUPPORTED (1 << 0) #define GRUB_VBE_MODEATTR_RESERVED_1 (1 << 1) @@ -181,6 +183,11 @@ grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_controller_info) (struct grub_vb grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_get_mode_info) (grub_uint32_t mode, struct grub_vbe_mode_info_block *mode_info); +grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_getset_dac_palette_width) (int set, int *width); + +#define grub_vbe_bios_get_dac_palette_width(width) grub_vbe_bios_getset_dac_palette_width(0, (width)) +#define grub_vbe_bios_set_dac_palette_width(width) grub_vbe_bios_getset_dac_palette_width(1, (width)) + /* Call VESA BIOS 0x4f02 to set video mode, return status. */ grub_vbe_status_t EXPORT_FUNC(grub_vbe_bios_set_mode) (grub_uint32_t mode, struct grub_vbe_crtc_info_block *crtc_info); diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index be258fb08..1a896eda1 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -1732,6 +1732,52 @@ FUNCTION(grub_vbe_bios_get_mode) popl %ebp ret +/* + * grub_vbe_status_t grub_vbe_bios_getset_dac_palette_width (int set, int *dac_mask_size) + * + * Register allocations for parameters: + * %eax set + * %edx *dac_mask_size + */ +FUNCTION(grub_vbe_bios_getset_dac_palette_width) + pushl %ebp + pushl %ebx + + xorl %ebx, %ebx + + /* If we only want to fetch the value, set %bl to 1. */ + testl %eax, %eax + jne 1f + incb %bl +1: + + /* Put desired width in %bh. */ + movl (%edx), %eax + movb %al, %bh + + call prot_to_real + .code16 + + movw $0x4f08, %ax + int $0x10 + + movw %ax, %dx /* real_to_prot destroys %eax. */ + + DATA32 call real_to_prot + .code32 + + /* Move result back to *dac_mask_size. */ + movb %bh, %al + movl %eax, (%edx) + + /* Return value in %eax. */ + xorl %eax, %eax + movw %dx, %ax + + popl %ebx + popl %ebp + ret + /* * grub_vbe_status_t grub_vbe_bios_set_memory_window (grub_uint32_t window, * grub_uint32_t position); diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index ae0840234..1670a737d 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -116,7 +116,7 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) /* Try to get controller info block. */ status = grub_vbe_bios_get_controller_info (vbe_ib); - if (status == 0x004F) + if (status == GRUB_VBE_STATUS_OK) { /* Copy it for later usage. */ grub_memcpy (&controller_info, vbe_ib, sizeof (controller_info)); @@ -300,6 +300,24 @@ grub_vbe_get_video_mode_info (grub_uint32_t mode, /* Make copy of mode info block. */ grub_memcpy (mode_info, mi_tmp, sizeof (*mode_info)); + + /* Packed mode. Query DAC Palette width for color sizes. */ + if (mode_info->bits_per_pixel <= 8) + { + int width = 8; + status = 0; + + if (controller_info.capabilities & GRUB_VBE_CAPABILITY_DACWIDTH) + status = grub_vbe_bios_set_dac_palette_width (& width); + + if (status != GRUB_VBE_STATUS_OK) + /* 6 is default after mode reset. */ + width = 6; + + mode_info->red_mask_size = mode_info->green_mask_size + = mode_info->blue_mask_size = width; + mode_info->rsvd_mask_size = 0; + } } else /* Just clear mode info block if it isn't a VESA mode. */ From 6dcfcb3291f885d9c9229aac985d69f6c205131d Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 6 Aug 2009 07:05:48 +0000 Subject: [PATCH 1006/1707] 2009-08-06 Felix Zielcke * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Fix handling of multiple abstraction modules. --- ChangeLog | 5 +++++ util/grub-mkconfig_lib.in | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 44f14a0d4..68134df3e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-06 Felix Zielcke + + * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Fix + handling of multiple abstraction modules. + 2009-08-04 Robert Millan Fix a bug resulting in black screen when loading Linux using a diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 9afbd3b1f..d27b72ea1 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -136,9 +136,9 @@ prepare_grub_to_access_device () # Abstraction modules aren't auto-loaded. abstraction="`${grub_probe} --device ${device} --target=abstraction`" - if [ "x${abstraction}" = "x" ] ; then : ; else - echo "insmod ${abstraction}" - fi + for module in ${abstraction} ; do + echo "insmod ${module}" + done # If there's a filesystem UUID that GRUB is capable of identifying, use it; # otherwise set root as per value in device.map. From 4e2171f866615f25038a506a5986541b025a11f5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Aug 2009 11:55:36 +0000 Subject: [PATCH 1007/1707] 2009-08-07 Robert Millan * util/grub.d/10_freebsd.in: Use an absolute device path for `vfs.root.mountfrom'. Set `vfs.root.mountfrom.options=rw'. --- ChangeLog | 5 +++++ util/grub.d/10_freebsd.in | 5 ++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 68134df3e..2632d0509 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-07 Robert Millan + + * util/grub.d/10_freebsd.in: Use an absolute device path for + `vfs.root.mountfrom'. Set `vfs.root.mountfrom.options=rw'. + 2009-08-06 Felix Zielcke * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Fix diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 2addf03a1..64d2cc4c0 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -50,8 +50,6 @@ if [ "x$kfreebsd" != "x" ] ; then devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` fi - root_device=`basename ${GRUB_DEVICE}` - # For "ufs" it's the same. Do we care about the others? kfreebsd_fs=${GRUB_FS} @@ -69,7 +67,8 @@ EOF EOF fi cat << EOF - set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${root_device} + set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} + set FreeBSD.vfs.root.mountfrom.options=rw } EOF fi From 7a4894cc9991e1e50501bbd63eca14405c8b8b15 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Aug 2009 12:02:54 +0000 Subject: [PATCH 1008/1707] Split in two commits. This one's the first. 2009-08-07 Robert Millan * util/grub.d/10_linux.in (test_numeric): Moved from here ... * util/grub-mkconfig_lib.in (version_test_numeric): ... to here. Update all users. * util/grub.d/10_linux.in (test_gt): Strip any basename prefix, not just "vmlinu[zx]". Moved from here ... * util/grub-mkconfig_lib.in (version_test_gt): ... to here. Update all users. * util/grub.d/10_linux.in (find_latest): Moved from here ... * util/grub-mkconfig_lib.in (version_find_latest): ... to here. Update all users. --- ChangeLog | 16 ++++++++++++++++ util/grub.d/10_linux.in | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2632d0509..78a212ff1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,19 @@ +2009-08-07 Robert Millan + + * util/grub.d/10_linux.in (test_numeric): Moved from here ... + * util/grub-mkconfig_lib.in (version_test_numeric): ... to here. + Update all users. + + * util/grub.d/10_linux.in (test_gt): Strip any basename prefix, + not just "vmlinu[zx]". + Moved from here ... + * util/grub-mkconfig_lib.in (version_test_gt): ... to here. Update + all users. + + * util/grub.d/10_linux.in (find_latest): Moved from here ... + * util/grub-mkconfig_lib.in (version_find_latest): ... to here. Update + all users. + 2009-08-07 Robert Millan * util/grub.d/10_freebsd.in: Use an absolute device path for diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 3d130609a..637bf3e94 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -67,8 +67,8 @@ test_numeric () test_gt () { - local a=`echo $1 | sed -e "s/vmlinu[zx]-//g"` - local b=`echo $2 | sed -e "s/vmlinu[zx]-//g"` + local a=`echo $1 | sed -e "s/[^-]*-//g"` + local b=`echo $2 | sed -e "s/[^-]*-//g"` local cmp=gt if [ "x$b" = "x" ] ; then return 0 From 9d5bdd2cf697b4421e1cc203271a8cc7e0f0ea4d Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Aug 2009 12:05:06 +0000 Subject: [PATCH 1009/1707] Split in two commits. This one's the second. 2009-08-07 Robert Millan * util/grub.d/10_linux.in (test_numeric): Moved from here ... * util/grub-mkconfig_lib.in (version_test_numeric): ... to here. Update all users. * util/grub.d/10_linux.in (test_gt): Strip any basename prefix, not just "vmlinu[zx]". Moved from here ... * util/grub-mkconfig_lib.in (version_test_gt): ... to here. Update all users. * util/grub.d/10_linux.in (find_latest): Moved from here ... * util/grub-mkconfig_lib.in (version_find_latest): ... to here. Update all users. --- util/grub-mkconfig_lib.in | 51 +++++++++++++++++++++++++++++++++++++ util/grub.d/10_linux.in | 53 +-------------------------------------- 2 files changed, 52 insertions(+), 52 deletions(-) diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index d27b72ea1..52dac00fe 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -176,3 +176,54 @@ grub_file_is_not_garbage () fi return 0 } + +version_test_numeric () +{ + local a=$1 + local cmp=$2 + local b=$3 + if [ "$a" = "$b" ] ; then + case $cmp in + ge|eq|le) return 0 ;; + gt|lt) return 1 ;; + esac + fi + if [ "$cmp" = "lt" ] ; then + c=$a + a=$b + b=$c + fi + if (echo $a ; echo $b) | sort -n | head -n 1 | grep -qx $b ; then + return 0 + else + return 1 + fi +} + +version_test_gt () +{ + local a=`echo $1 | sed -e "s/[^-]*-//g"` + local b=`echo $2 | sed -e "s/[^-]*-//g"` + local cmp=gt + if [ "x$b" = "x" ] ; then + return 0 + fi + case $a:$b in + *.old:*.old) ;; + *.old:*) a=`echo -n $a | sed -e s/\.old$//g` ; cmp=gt ;; + *:*.old) b=`echo -n $b | sed -e s/\.old$//g` ; cmp=ge ;; + esac + version_test_numeric $a $cmp $b + return $? +} + +version_find_latest () +{ + local a="" + for i in $@ ; do + if version_test_gt "$i" "$a" ; then + a="$i" + fi + done + echo "$a" +} diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 637bf3e94..4df078e8f 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -42,57 +42,6 @@ else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} fi -test_numeric () -{ - local a=$1 - local cmp=$2 - local b=$3 - if [ "$a" = "$b" ] ; then - case $cmp in - ge|eq|le) return 0 ;; - gt|lt) return 1 ;; - esac - fi - if [ "$cmp" = "lt" ] ; then - c=$a - a=$b - b=$c - fi - if (echo $a ; echo $b) | sort -n | head -n 1 | grep -qx $b ; then - return 0 - else - return 1 - fi -} - -test_gt () -{ - local a=`echo $1 | sed -e "s/[^-]*-//g"` - local b=`echo $2 | sed -e "s/[^-]*-//g"` - local cmp=gt - if [ "x$b" = "x" ] ; then - return 0 - fi - case $a:$b in - *.old:*.old) ;; - *.old:*) a=`echo -n $a | sed -e s/\.old$//g` ; cmp=gt ;; - *:*.old) b=`echo -n $b | sed -e s/\.old$//g` ; cmp=ge ;; - esac - test_numeric $a $cmp $b - return $? -} - -find_latest () -{ - local a="" - for i in $@ ; do - if test_gt "$i" "$a" ; then - a="$i" - fi - done - echo "$a" -} - linux_entry () { cat << EOF @@ -117,7 +66,7 @@ list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do done` while [ "x$list" != "x" ] ; do - linux=`find_latest $list` + linux=`version_find_latest $list` echo "Found linux image: $linux" >&2 basename=`basename $linux` dirname=`dirname $linux` From b969c52f6b500bdc643ff6698162b7ba1dd6a54f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 7 Aug 2009 12:18:03 +0000 Subject: [PATCH 1010/1707] 2009-08-07 Felix Zielcke * util/grub-mkconfig_lib.in (font_path): Move the functionality of it to ... * util/grub-mkconfig.in: ... here. Prefer unicode.pf2 and unifont.pf2 over ascii.pf2. Export LANG=C in case ascii.pf2 gets used. --- ChangeLog | 7 +++++++ util/grub-mkconfig.in | 32 +++++++++++++++++++++----------- util/grub-mkconfig_lib.in | 17 ----------------- 3 files changed, 28 insertions(+), 28 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78a212ff1..b149b540c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-07 Felix Zielcke + + * util/grub-mkconfig_lib.in (font_path): Move the functionality + of it to ... + * util/grub-mkconfig.in: ... here. Prefer unicode.pf2 and + unifont.pf2 over ascii.pf2. Export LANG=C in case ascii.pf2 gets used. + 2009-08-07 Robert Millan * util/grub.d/10_linux.in (test_numeric): Moved from here ... diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 75a07e698..98726f144 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -24,6 +24,8 @@ sbindir=@sbindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ package_version=@PACKAGE_VERSION@ +datadir=@datadir@ +pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` grub_prefix=`echo /boot/grub | sed ${transform}` grub_cfg="" grub_mkconfig_dir=${sysconfdir}/grub.d @@ -151,22 +153,30 @@ esac # check for terminals that require fonts case ${GRUB_TERMINAL_OUTPUT} in gfxterm) - if path=`font_path` ; then - GRUB_FONT_PATH="${path}" - else - # fallback to the native terminal for this platform - unset GRUB_TERMINAL_OUTPUT + for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do + for basename in unicode unifont ascii; do + path="${dir}/${basename}.pf2" + if is_path_readable_by_grub ${path} > /dev/null ; then + GRUB_FONT_PATH=${path} + else + continue + fi + if [ "${basename}" = "ascii"] ; then + # make sure all our children behave in conformance with ascii.. + export LANG=C + fi + break 2 + done + done + if [ -z "${GRUB_FONT_PATH}" ] ; then + # fallback to the native terminal for this platform + unset GRUB_TERMINAL_OUTPUT + fi fi ;; -esac - -# does our terminal support utf-8 ? -case ${GRUB_TERMINAL_OUTPUT} in - gfxterm) ;; *) # make sure all our children behave in conformance with ascii.. export LANG=C - ;; esac # These are defined in this script, export them here so that user can diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 52dac00fe..99b3c9c6f 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -148,23 +148,6 @@ prepare_grub_to_access_device () fi } -font_path () -{ - for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do - # FIXME: We prefer ascii because loading complete fonts is too slow (and - # we don't yet provide the gettext magic that would make unicode useful). - for basename in ascii unicode unifont ; do - path="${dir}/${basename}.pf2" - if is_path_readable_by_grub ${path} > /dev/null ; then - echo "${path}" - return 0 - fi - done - done - - return 1 -} - grub_file_is_not_garbage () { if test -f "$1" ; then From 818e094a040e00beab7ea410294fd07a641b6281 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 7 Aug 2009 13:37:52 +0000 Subject: [PATCH 1011/1707] 2009-08-07 Felix Zielcke * fs/uuid.c (grub_jfs_superblock): New fields unused2 and uuid. (grub_jfs_uuid): New function. (grub_jfs_fs): Set uuid field to grub_jfs_uuid. --- ChangeLog | 6 ++++++ fs/jfs.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/ChangeLog b/ChangeLog index b149b540c..9475494cd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-07 Felix Zielcke + + * fs/uuid.c (grub_jfs_superblock): New fields unused2 and uuid. + (grub_jfs_uuid): New function. + (grub_jfs_fs): Set uuid field to grub_jfs_uuid. + 2009-08-07 Felix Zielcke * util/grub-mkconfig_lib.in (font_path): Move the functionality diff --git a/fs/jfs.c b/fs/jfs.c index ae7486a2f..7b361c065 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -51,6 +51,8 @@ struct grub_jfs_sblock grub_uint8_t unused[71]; grub_uint8_t volname[11]; + grub_uint8_t unused2[32]; + grub_uint8_t uuid[16]; }; struct grub_jfs_extent @@ -832,6 +834,38 @@ grub_jfs_close (grub_file_t file) return GRUB_ERR_NONE; } +static grub_err_t +grub_jfs_uuid (grub_device_t device, char **uuid) +{ + struct grub_jfs_data *data; + grub_disk_t disk = device->disk; + + grub_dl_ref (my_mod); + + data = grub_jfs_mount (disk); + if (data) + { + *uuid = grub_malloc (40 + sizeof ('\0')); + + grub_sprintf (*uuid, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", + data->sblock.uuid[0], data->sblock.uuid[1], + data->sblock.uuid[2], data->sblock.uuid[3], + data->sblock.uuid[4], data->sblock.uuid[5], + data->sblock.uuid[6], data->sblock.uuid[7], + data->sblock.uuid[8], data->sblock.uuid[9], + data->sblock.uuid[10], data->sblock.uuid[11], + data->sblock.uuid[12], data->sblock.uuid[13], + data->sblock.uuid[14], data->sblock.uuid[15]); + } + else + *uuid = NULL; + + grub_dl_unref (my_mod); + + grub_free (data); + + return grub_errno; +} static grub_err_t grub_jfs_label (grub_device_t device, char **label) @@ -856,6 +890,7 @@ static struct grub_fs grub_jfs_fs = .read = grub_jfs_read, .close = grub_jfs_close, .label = grub_jfs_label, + .uuid = grub_jfs_uuid, .next = 0 }; From 0ded14361d48d0ac21a9a3b8d1492a0ae6dbceac Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 7 Aug 2009 13:40:43 +0000 Subject: [PATCH 1012/1707] use \t instead of spaces to indent --- fs/jfs.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/fs/jfs.c b/fs/jfs.c index 7b361c065..b38efed59 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -852,10 +852,10 @@ grub_jfs_uuid (grub_device_t device, char **uuid) data->sblock.uuid[2], data->sblock.uuid[3], data->sblock.uuid[4], data->sblock.uuid[5], data->sblock.uuid[6], data->sblock.uuid[7], - data->sblock.uuid[8], data->sblock.uuid[9], - data->sblock.uuid[10], data->sblock.uuid[11], - data->sblock.uuid[12], data->sblock.uuid[13], - data->sblock.uuid[14], data->sblock.uuid[15]); + data->sblock.uuid[8], data->sblock.uuid[9], + data->sblock.uuid[10], data->sblock.uuid[11], + data->sblock.uuid[12], data->sblock.uuid[13], + data->sblock.uuid[14], data->sblock.uuid[15]); } else *uuid = NULL; From 998b5aa9ae66590d661b95a91fe99edc92991f8b Mon Sep 17 00:00:00 2001 From: fzielcke Date: Fri, 7 Aug 2009 14:06:24 +0000 Subject: [PATCH 1013/1707] 2009-08-07 Felix Zielcke * util/grub-mkconfig.in: Remove a wrong `fi'. --- ChangeLog | 4 ++++ util/grub-mkconfig.in | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 9475494cd..102ed46a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-07 Felix Zielcke + + * util/grub-mkconfig.in: Remove a wrong `fi'. + 2009-08-07 Felix Zielcke * fs/uuid.c (grub_jfs_superblock): New fields unused2 and uuid. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 98726f144..4ddb7beae 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -172,7 +172,6 @@ case ${GRUB_TERMINAL_OUTPUT} in # fallback to the native terminal for this platform unset GRUB_TERMINAL_OUTPUT fi - fi ;; *) # make sure all our children behave in conformance with ascii.. From 126d66289217abaefe05a13f1ebdec82ab36fef6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Aug 2009 16:51:13 +0000 Subject: [PATCH 1014/1707] 2009-08-07 Robert Millan * docs/grub.texi: Update CVS information to SVN. Replace outdated "GRUB 2 will include" phrase with "GRUB 2 includes". --- ChangeLog | 5 +++++ docs/grub.texi | 11 +++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 102ed46a3..63b2d49b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-07 Robert Millan + + * docs/grub.texi: Update CVS information to SVN. + Replace outdated "GRUB 2 will include" phrase with "GRUB 2 includes". + 2009-08-07 Felix Zielcke * util/grub-mkconfig.in: Remove a wrong `fi'. diff --git a/docs/grub.texi b/docs/grub.texi index 11603930e..1abeb242c 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -3854,13 +3854,8 @@ just do: @end group @end example -This will install the grub shell @file{grub} (@pxref{Invoking the grub -shell}), the Multiboot checker @file{mbchk} (@pxref{Invoking mbchk}), -and the GRUB images. This will also install the GRUB manual. - -Also, the latest version is available from the CVS. See -@uref{http://savannah.gnu.org/cvs/?group=grub} for more information. - +Also, the latest version is available from the SVN. See +@uref{http://savannah.gnu.org/svn/?group=grub} for more information. @node Reporting bugs @appendix Reporting bugs @@ -3932,7 +3927,7 @@ Once we get your report, we will try to fix the bugs. @node Future @appendix Where GRUB will go -We started the next generation of GRUB, GRUB 2. This will include +We started the next generation of GRUB, GRUB 2. GRUB 2 includes internationalization, dynamic module loading, real memory management, multiple architecture support, a scripting language, and many other nice feature. If you are interested in the development of GRUB 2, take From ed94253fbff5f37828b526845e658b408ea3d98c Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Aug 2009 17:14:16 +0000 Subject: [PATCH 1015/1707] 2009-08-07 Robert Millan * docs/version.texi: New file. Provides version information for grub.texi. --- ChangeLog | 5 +++++ docs/version.texi | 4 ++++ 2 files changed, 9 insertions(+) create mode 100644 docs/version.texi diff --git a/ChangeLog b/ChangeLog index 63b2d49b6..4767763e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-07 Robert Millan + + * docs/version.texi: New file. Provides version information for + grub.texi. + 2009-08-07 Robert Millan * docs/grub.texi: Update CVS information to SVN. diff --git a/docs/version.texi b/docs/version.texi new file mode 100644 index 000000000..5a03fa3c9 --- /dev/null +++ b/docs/version.texi @@ -0,0 +1,4 @@ +@set UPDATED 7 Ago 2009 +@set UPDATED-MONTH Ago 2009 +@set EDITION 1.97~snapshot +@set VERSION 1.97~snapshot From 892a3d98052232e30e004a7b870463acf7cc8b21 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 7 Aug 2009 17:18:12 +0000 Subject: [PATCH 1016/1707] 2009-08-07 Robert Millan * docs/grub.texi: Major overhaul. Remove all sections that are specific to GRUB Legacy, or mostly composed of Legacy-specific information. --- ChangeLog | 6 + docs/grub.texi | 2576 +----------------------------------------------- 2 files changed, 16 insertions(+), 2566 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4767763e3..a47abd4a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-07 Robert Millan + + * docs/grub.texi: Major overhaul. Remove all sections that are + specific to GRUB Legacy, or mostly composed of Legacy-specific + information. + 2009-08-07 Robert Millan * docs/version.texi: New file. Provides version information for diff --git a/docs/grub.texi b/docs/grub.texi index 1abeb242c..e3f412565 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -34,14 +34,9 @@ Invariant Sections. @direntry * GRUB: (grub). The GRand Unified Bootloader * grub-install: (grub)Invoking grub-install. Install GRUB on your drive -* grub-md5-crypt: (grub)Invoking grub-md5-crypt. Encrypt a password - in MD5 format * grub-terminfo: (grub)Invoking grub-terminfo. Generate a terminfo command from a terminfo name -* grub-set-default: (grub)Invoking grub-set-default. Set a default boot - entry -* mbchk: (grub)Invoking mbchk. Check for the format of a Multiboot kernel @end direntry @setchapternewpage odd @@ -86,7 +81,6 @@ This edition documents version @value{VERSION}. * Network:: Downloading OS images from a network * Serial terminal:: Using GRUB via a serial line * Preset Menu:: Embedding a configuration file into GRUB -* Security:: Improving the security * Images:: GRUB image files * Filesystem:: Filesystem syntax and semantics * Interface:: The menu and the command-line @@ -94,10 +88,7 @@ This edition documents version @value{VERSION}. * Troubleshooting:: Error messages produced by GRUB * Invoking the grub shell:: How to use the grub shell * Invoking grub-install:: How to use the GRUB installer -* Invoking grub-md5-crypt:: How to generate a cryptic password * Invoking grub-terminfo:: How to generate a terminfo command -* Invoking grub-set-default:: How to set a default boot entry -* Invoking mbchk:: How to use the Multiboot checker * Obtaining and Building GRUB:: How to obtain and build GRUB * Reporting bugs:: Where you should send a bug report * Future:: Some future plans on GRUB @@ -158,11 +149,6 @@ partition, and a file name (@pxref{Naming convention}) to GRUB, how to install GRUB on your drive (@pxref{Installation}), and how to boot your OSes (@pxref{Booting}), step by step. -Besides the GRUB boot loader itself, there is a @dfn{grub shell} -@command{grub} (@pxref{Invoking the grub shell}) which can be run when -you are in your operating system. It emulates the boot loader and can -be used for installing the boot loader. - @node History @section History of GRUB @@ -458,119 +444,17 @@ have an emergency boot disk ready, so that you can rescue your computer if, by any chance, your hard drive becomes unusable (unbootable). GRUB comes with boot images, which are normally put in the directory -@file{/usr/lib/grub/i386-pc}. If you do not use grub-install, then -you need to copy the files @file{stage1}, @file{stage2}, and -@file{*stage1_5} to the directory @file{/boot/grub}, and run the -@command{grub-set-default} (@pxref{Invoking grub-set-default}) if you -intend to use @samp{default saved} (@pxref{default}) in your -configuration file. Hereafter, the directory where GRUB images are +@file{/usr/lib/grub/i386-pc}. Hereafter, the directory where GRUB images are initially placed (normally @file{/usr/lib/grub/i386-pc}) will be called the @dfn{image directory}, and the directory where the boot loader needs to find them (usually @file{/boot/grub}) will be called the @dfn{boot directory}. @menu -* Creating a GRUB boot floppy:: -* Installing GRUB natively:: * Installing GRUB using grub-install:: -* Making a GRUB bootable CD-ROM:: @end menu -@node Creating a GRUB boot floppy -@section Creating a GRUB boot floppy - -To create a GRUB boot floppy, you need to take the files @file{stage1} -and @file{stage2} from the image directory, and write them to the first -and the second block of the floppy disk, respectively. - -@strong{Caution:} This procedure will destroy any data currently stored -on the floppy. - -On a UNIX-like operating system, that is done with the following -commands: - -@example -@group -# @kbd{cd /usr/lib/grub/i386-pc} -# @kbd{dd if=stage1 of=/dev/fd0 bs=512 count=1} -1+0 records in -1+0 records out -# @kbd{dd if=stage2 of=/dev/fd0 bs=512 seek=1} -153+1 records in -153+1 records out -# -@end group -@end example - -The device file name may be different. Consult the manual for your OS. - - -@node Installing GRUB natively -@section Installing GRUB natively - -@strong{Caution:} Installing GRUB's stage1 in this manner will erase the -normal boot-sector used by an OS. - -GRUB can currently boot GNU Mach, Linux, FreeBSD, NetBSD, and OpenBSD -directly, so using it on a boot sector (the first sector of a -partition) should be okay. But generally, it would be a good idea to -back up the first sector of the partition on which you are installing -GRUB's stage1. This isn't as important if you are installing GRUB on -the first sector of a hard disk, since it's easy to reinitialize it -(e.g. by running @samp{FDISK /MBR} from DOS). - -If you decide to install GRUB in the native environment, which is -definitely desirable, you'll need to create a GRUB boot disk, and -reboot your computer with it. Otherwise, see @ref{Installing GRUB using -grub-install}. - -Once started, GRUB will show the command-line interface -(@pxref{Command-line interface}). First, set the GRUB's @dfn{root -device}@footnote{Note that GRUB's root device doesn't necessarily mean -your OS's root partition; if you need to specify a root partition for -your OS, add the argument into the command @command{kernel}.} to the -partition containing the boot directory, like this: - -@example -grub> @kbd{root (hd0,0)} -@end example - -If you are not sure which partition actually holds this directory, use the -command @command{find} (@pxref{find}), like this: - -@example -grub> @kbd{find /boot/grub/stage1} -@end example - -This will search for the file name @file{/boot/grub/stage1} and show the -devices which contain the file. - -Once you've set the root device correctly, run the command -@command{setup} (@pxref{setup}): - -@example -grub> @kbd{setup (hd0)} -@end example - -This command will install the GRUB boot loader on the Master Boot -Record (MBR) of the first drive. If you want to put GRUB into the boot -sector of a partition instead of putting it in the MBR, specify the -partition into which you want to install GRUB: - -@example -grub> @kbd{setup (hd0,0)} -@end example - -If you install GRUB into a partition or a drive other than the first -one, you must chain-load GRUB from another boot loader. Refer to the -manual for the boot loader to know how to chain-load GRUB. - -After using the setup command, you will boot into GRUB without the -GRUB floppy. See the chapter @ref{Booting} to find out how to boot -your operating systems from GRUB. - - @node Installing GRUB using grub-install @section Installing GRUB using grub-install @@ -722,7 +606,6 @@ magic. @menu * General boot methods:: How to boot OSes with GRUB generally * OS-specific notes:: Notes on some operating systems -* Making your system robust:: How to make your system robust @end menu @@ -753,71 +636,9 @@ For the sake of convenience, there is also support for Linux, FreeBSD, NetBSD and OpenBSD. If you want to boot other operating systems, you will have to chain-load them (@pxref{Chain-loading}). -Generally, GRUB can boot any Multiboot-compliant OS in the following -steps: +FIXME: this section is incomplete. @enumerate -@item -Set GRUB's root device to the drive where the OS images are stored with -the command @command{root} (@pxref{root}). - -@item -Load the kernel image with the command @command{kernel} (@pxref{kernel}). - -@item -If you need modules, load them with the command @command{module} -(@pxref{module}) or @command{modulenounzip} (@pxref{modulenounzip}). - -@item -Run the command @command{boot} (@pxref{boot}). -@end enumerate - -Linux, FreeBSD, NetBSD and OpenBSD can be booted in a similar -manner. You load a kernel image with the command @command{kernel} and -then run the command @command{boot}. If the kernel requires some -parameters, just append the parameters to @command{kernel}, after the -file name of the kernel. Also, please refer to @ref{OS-specific notes}, -for information on your OS-specific issues. - - -@node Chain-loading -@subsection Load another boot loader to boot unsupported operating systems - -If you want to boot an unsupported operating system (e.g. Windows 95), -chain-load a boot loader for the operating system. Normally, the boot -loader is embedded in the @dfn{boot sector} of the partition on which -the operating system is installed. - -@enumerate -@item -Set GRUB's root device to the partition by the command -@command{rootnoverify} (@pxref{rootnoverify}): - -@example -grub> @kbd{rootnoverify (hd0,0)} -@end example - -@item -Set the @dfn{active} flag in the partition using the command -@command{makeactive}@footnote{This is not necessary for most of the -modern operating systems.} (@pxref{makeactive}): - -@example -grub> @kbd{makeactive} -@end example - -@item -Load the boot loader with the command @command{chainloader} -(@pxref{chainloader}): - -@example -grub> @kbd{chainloader +1} -@end example - -@samp{+1} indicates that GRUB should read one sector from the start of -the partition. The complete description about this syntax can be found -in @ref{Block list syntax}. - @item Run the command @command{boot} (@pxref{boot}). @end enumerate @@ -835,12 +656,6 @@ Here, we describe some caveats on several operating systems. @menu * GNU/Hurd:: * GNU/Linux:: -* FreeBSD:: -* NetBSD:: -* OpenBSD:: -* DOS/Windows:: -* SCO UnixWare:: -* QNX:: @end menu @@ -851,22 +666,9 @@ Since GNU/Hurd is Multiboot-compliant, it is easy to boot it; there is nothing special about it. But do not forget that you have to specify a root partition to the kernel. +FIXME: this section is incomplete. + @enumerate -@item -Set GRUB's root device to the same drive as GNU/Hurd's. Probably the -command @code{find /boot/gnumach} or similar can help you -(@pxref{find}). - -@item -Load the kernel and the module, like this: - -@example -@group -grub> @kbd{kernel /boot/gnumach root=hd0s1} -grub> @kbd{module /boot/serverboot} -@end group -@end example - @item Run the command @command{boot} (@pxref{boot}). @end enumerate @@ -878,35 +680,11 @@ Run the command @command{boot} (@pxref{boot}). It is relatively easy to boot GNU/Linux from GRUB, because it somewhat resembles to boot a Multiboot-compliant OS. +FIXME: this section is incomplete. + @enumerate @item -Set GRUB's root device to the same drive as GNU/Linux's. Probably the -command @code{find /vmlinuz} or similar can help you (@pxref{find}). - -@item -Load the kernel: - -@example -grub> @kbd{kernel /vmlinuz root=/dev/hda1} -@end example - -If you need to specify some kernel parameters, just append them to the -command. For example, to set @option{vga} to @samp{ext}, do this: - -@example -grub> @kbd{kernel /vmlinuz root=/dev/hda1 vga=ext} -@end example - -See the documentation in the Linux source tree for complete -information on the available options. - -@item -If you use an initrd, execute the command @command{initrd} -(@pxref{initrd}) after @command{kernel}: - -@example -grub> @kbd{initrd /initrd} -@end example +Set GRUB's root device to the same drive as GNU/Linux's. @item Finally, run the command @command{boot} (@pxref{boot}). @@ -919,617 +697,6 @@ the size, run the command @command{uppermem} @emph{before} loading the kernel. @xref{uppermem}, for more information. -@node FreeBSD -@subsection FreeBSD - -GRUB can load the kernel directly, either in ELF or a.out format. But -this is not recommended, since FreeBSD's bootstrap interface sometimes -changes heavily, so GRUB can't guarantee to pass kernel parameters -correctly. - -Thus, we'd recommend loading the very flexible loader -@file{/boot/loader} instead. See this example: - -@example -@group -grub> @kbd{root (hd0,a)} -grub> @kbd{kernel /boot/loader} -grub> @kbd{boot} -@end group -@end example - - -@node NetBSD -@subsection NetBSD - -GRUB can load NetBSD a.out and ELF directly, follow these steps: - -@enumerate -@item -Set GRUB's root device with @command{root} (@pxref{root}). - -@item -Load the kernel with @command{kernel} (@pxref{kernel}). You should -append the ugly option @option{--type=netbsd}, if you want to load an -ELF kernel, like this: - -@example -grub> @kbd{kernel --type=netbsd /netbsd-elf} -@end example - -@item -Run @command{boot} (@pxref{boot}). -@end enumerate - -For now, however, GRUB doesn't allow you to pass kernel parameters, so -it may be better to chain-load it instead. For more information, please -see @ref{Chain-loading}. - - -@node OpenBSD -@subsection OpenBSD - -The booting instruction is exactly the same as for NetBSD -(@pxref{NetBSD}). - - -@node DOS/Windows -@subsection DOS/Windows - -GRUB cannot boot DOS or Windows directly, so you must chain-load them -(@pxref{Chain-loading}). However, their boot loaders have some critical -deficiencies, so it may not work to just chain-load them. To overcome -the problems, GRUB provides you with two helper functions. - -If you have installed DOS (or Windows) on a non-first hard disk, you -have to use the disk swapping technique, because that OS cannot boot -from any disks but the first one. The workaround used in GRUB is the -command @command{map} (@pxref{map}), like this: - -@example -@group -grub> @kbd{map (hd0) (hd1)} -grub> @kbd{map (hd1) (hd0)} -@end group -@end example - -This performs a @dfn{virtual} swap between your first and second hard -drive. - -@strong{Caution:} This is effective only if DOS (or Windows) uses BIOS -to access the swapped disks. If that OS uses a special driver for the -disks, this probably won't work. - -Another problem arises if you installed more than one set of DOS/Windows -onto one disk, because they could be confused if there are more than one -primary partitions for DOS/Windows. Certainly you should avoid doing -this, but there is a solution if you do want to do so. Use the partition -hiding/unhiding technique. - -If GRUB @dfn{hide}s a DOS (or Windows) partition (@pxref{hide}), DOS (or -Windows) will ignore the partition. If GRUB @dfn{unhide}s a DOS (or -Windows) partition (@pxref{unhide}), DOS (or Windows) will detect the -partition. Thus, if you have installed DOS (or Windows) on the first -and the second partition of the first hard disk, and you want to boot -the copy on the first partition, do the following: - -@example -@group -grub> @kbd{unhide (hd0,0)} -grub> @kbd{hide (hd0,1)} -grub> @kbd{rootnoverify (hd0,0)} -grub> @kbd{chainloader +1} -grub> @kbd{makeactive} -grub> @kbd{boot} -@end group -@end example - - -@node SCO UnixWare -@subsection SCO UnixWare - -It is known that the signature in the boot loader for SCO UnixWare is -wrong, so you will have to specify the option @option{--force} to -@command{chainloader} (@pxref{chainloader}), like this: - -@example -@group -grub> @kbd{rootnoverify (hd1,0)} -grub> @kbd{chainloader --force +1} -grub> @kbd{makeactive} -grub> @kbd{boot} -@end group -@end example - - -@node QNX -@subsection QNX - -QNX seems to use a bigger boot loader, so you need to boot it up, like -this: - -@example -@group -grub> @kbd{rootnoverify (hd1,1)} -grub> @kbd{chainloader +4} -grub> @kbd{boot} -@end group -@end example - - -@node Making your system robust -@section How to make your system robust - -When you test a new kernel or a new OS, it is important to make sure -that your computer can boot even if the new system is unbootable. This -is crucial especially if you maintain servers or remote systems. To -accomplish this goal, you need to set up two things: - -@enumerate -@item -You must maintain a system which is always bootable. For instance, if -you test a new kernel, you need to keep a working kernel in a -different place. And, it would sometimes be very nice to even have a -complete copy of a working system in a different partition or disk. - -@item -You must direct GRUB to boot a working system when the new system -fails. This is possible with the @dfn{fallback} system in GRUB. -@end enumerate - -The former requirement is very specific to each OS, so this -documentation does not cover that topic. It is better to consult some -backup tools. - -So let's see the GRUB part. There are two possibilities: one of them -is quite simple but not very robust, and the other is a bit complex to -set up but probably the best solution to make sure that your system -can start as long as GRUB itself is bootable. - -@menu -* Booting once-only:: -* Booting fallback systems:: -@end menu - - -@node Booting once-only -@subsection Booting once-only - -You can teach GRUB to boot an entry only at next boot time. Suppose -that your have an old kernel @file{old_kernel} and a new kernel -@file{new_kernel}. You know that @file{old_kernel} can boot -your system correctly, and you want to test @file{new_kernel}. - -To ensure that your system will go back to the old kernel even if the -new kernel fails (e.g. it panics), you can specify that GRUB should -try the new kernel only once and boot the old kernel after that. - -First, modify your configuration file. Here is an example: - -@example -@group -default saved # This is important!!! -timeout 10 - -title the old kernel -root (hd0,0) -kernel /old_kernel -savedefault - -title the new kernel -root (hd0,0) -kernel /new_kernel -savedefault 0 # This is important!!! -@end group -@end example - -Note that this configuration file uses @samp{default saved} -(@pxref{default}) at the head and @samp{savedefault 0} -(@pxref{savedefault}) in the entry for the new kernel. This means -that GRUB boots a saved entry by default, and booting the entry for the -new kernel saves @samp{0} as the saved entry. - -With this configuration file, after all, GRUB always tries to boot the -old kernel after it booted the new one, because @samp{0} is the entry -of @code{the old kernel}. - -The next step is to tell GRUB to boot the new kernel at next boot -time. For this, execute @command{grub-set-default} (@pxref{Invoking -grub-set-default}): - -@example -# @kbd{grub-set-default 1} -@end example - -This command sets the saved entry to @samp{1}, that is, to the new -kernel. - -This method is useful, but still not very robust, because GRUB stops -booting, if there is any error in the boot entry, such that the new -kernel has an invalid executable format. Thus, it it even better to -use the @dfn{fallback} mechanism of GRUB. Look at next subsection for -this feature. - - -@node Booting fallback systems -@subsection Booting fallback systems - -GRUB supports a fallback mechanism of booting one or more other -entries if a default boot entry fails. You can specify multiple -fallback entries if you wish. - -Suppose that you have three systems, @samp{A}, @samp{B} and -@samp{C}. @samp{A} is a system which you want to boot by -default. @samp{B} is a backup system which is supposed to boot -safely. @samp{C} is another backup system which is used in case where -@samp{B} is broken. - -Then you may want GRUB to boot the first system which is bootable -among @samp{A}, @samp{B} and @samp{C}. A configuration file can be -written in this way: - -@example -@group -default saved # This is important!!! -timeout 10 -fallback 1 2 # This is important!!! - -title A -root (hd0,0) -kernel /kernel -savedefault fallback # This is important!!! - -title B -root (hd1,0) -kernel /kernel -savedefault fallback # This is important!!! - -title C -root (hd2,0) -kernel /kernel -savedefault -@end group -@end example - -Note that @samp{default saved} (@pxref{default}), @samp{fallback 1 2} -and @samp{savedefault fallback} are used. GRUB will boot a saved entry -by default and save a fallback entry as next boot entry with this -configuration. - -When GRUB tries to boot @samp{A}, GRUB saves @samp{1} as next boot -entry, because the command @command{fallback} specifies that @samp{1} -is the first fallback entry. The entry @samp{1} is @samp{B}, so GRUB -will try to boot @samp{B} at next boot time. - -Likewise, when GRUB tries to boot @samp{B}, GRUB saves @samp{2} as -next boot entry, because @command{fallback} specifies @samp{2} as next -fallback entry. This makes sure that GRUB will boot @samp{C} after -booting @samp{B}. - -It is noteworthy that GRUB uses fallback entries both when GRUB -itself fails in booting an entry and when @samp{A} or @samp{B} fails -in starting up your system. So this solution ensures that your system -is started even if GRUB cannot find your kernel or if your kernel -panics. - -However, you need to run @command{grub-set-default} (@pxref{Invoking -grub-set-default}) when @samp{A} starts correctly or you fix @samp{A} -after it crashes, since GRUB always sets next boot entry to a fallback -entry. You should run this command in a startup script such as -@file{rc.local} to boot @samp{A} by default: - -@example -# @kbd{grub-set-default 0} -@end example - -where @samp{0} is the number of the boot entry for the system -@samp{A}. - -If you want to see what is current default entry, you can look at the -file @file{/boot/grub/default} (or @file{/grub/default} in -some systems). Because this file is plain-text, you can just -@command{cat} this file. But it is strongly recommended @strong{not to -modify this file directly}, because GRUB may fail in saving a default -entry in this file, if you change this file in an unintended -manner. Therefore, you should use @command{grub-set-default} when you -need to change the default entry. - - -@node Configuration -@chapter Configuration - -You've probably noticed that you need to type several commands to boot your -OS. There's a solution to that - GRUB provides a menu interface -(@pxref{Menu interface}) from which you can select an item (using arrow -keys) that will do everything to boot an OS. - -To enable the menu, you need a configuration file, -@file{menu.lst} under the boot directory. We'll analyze an example -file. - -The file first contains some general settings, the menu interface -related options. You can put these commands (@pxref{Menu-specific -commands}) before any of the items (starting with @command{title} -(@pxref{title})). - -@example -@group -# -# Sample boot menu configuration file -# -@end group -@end example - -As you may have guessed, these lines are comments. Lines starting with a -hash character (@samp{#}), and blank lines, are ignored by GRUB. - -@example -@group -# By default, boot the first entry. -default 0 -@end group -@end example - -The first entry (here, counting starts with number zero, not one!) will -be the default choice. - -@example -@group -# Boot automatically after 30 secs. -timeout 30 -@end group -@end example - -As the comment says, GRUB will boot automatically in 30 seconds, unless -interrupted with a keypress. - -@example -@group -# Fallback to the second entry. -fallback 1 -@end group -@end example - -If, for any reason, the default entry doesn't work, fall back to the -second one (this is rarely used, for obvious reasons). - -Note that the complete descriptions of these commands, which are menu -interface specific, can be found in @ref{Menu-specific -commands}. Other descriptions can be found in @ref{Commands}. - -Now, on to the actual OS definitions. You will see that each entry -begins with a special command, @command{title} (@pxref{title}), and the -action is described after it. Note that there is no command -@command{boot} (@pxref{boot}) at the end of each item. That is because -GRUB automatically executes @command{boot} if it loads other commands -successfully. - -The argument for the command @command{title} is used to display a short -title/description of the entry in the menu. Since @command{title} -displays the argument as is, you can write basically anything there. - -@example -@group -# For booting GNU/Hurd -title GNU/Hurd -root (hd0,0) -kernel /boot/gnumach.gz root=hd0s1 -module /boot/serverboot.gz -@end group -@end example - -This boots GNU/Hurd from the first hard disk. - -@example -@group -# For booting GNU/Linux -title GNU/Linux -kernel (hd1,0)/vmlinuz root=/dev/hdb1 -@end group -@end example - -This boots GNU/Linux, but from the second hard disk. - -@example -@group -# For booting Mach (getting kernel from floppy) -title Utah Mach4 multiboot -root (hd0,2) -pause Insert the diskette now^G!! -kernel (fd0)/boot/kernel root=hd0s3 -module (fd0)/boot/bootstrap -@end group -@end example - -This boots Mach with a kernel on a floppy, but the root filesystem at -hd0s3. It also contains a @command{pause} line (@pxref{pause}), which -will cause GRUB to display a prompt and delay, before actually executing -the rest of the commands and booting. - -@example -@group -# For booting FreeBSD -title FreeBSD -root (hd0,2,a) -kernel /boot/loader -@end group -@end example - -This item will boot FreeBSD kernel loaded from the @samp{a} partition of -the third @sc{pc} slice of the first hard disk. - -@example -@group -# For booting OS/2 -title OS/2 -root (hd0,1) -makeactive -# chainload OS/2 bootloader from the first sector -chainloader +1 -# This is similar to "chainload", but loads a specific file -#chainloader /boot/chain.os2 -@end group -@end example - -This will boot OS/2, using a chain-loader (@pxref{Chain-loading}). - -@example -@group -# For booting Windows NT or Windows95 -title Windows NT / Windows 95 boot menu -root (hd0,0) -makeactive -chainloader +1 -# For loading DOS if Windows NT is installed -# chainload /bootsect.dos -@end group -@end example - -The same as the above, but for Windows. - -@example -@group -# For installing GRUB into the hard disk -title Install GRUB into the hard disk -root (hd0,0) -setup (hd0) -@end group -@end example - -This will just (re)install GRUB onto the hard disk. - -@example -# Change the colors. -title Change the colors -color light-green/brown blink-red/blue -@end example - -In the last entry, the command @command{color} is used (@pxref{color}), -to change the menu colors (try it!). This command is somewhat special, -because it can be used both in the command-line and in the menu. GRUB -has several such commands, see @ref{General commands}. - -We hope that you now understand how to use the basic features of -GRUB. To learn more about GRUB, see the following chapters. - - -@node Network -@chapter Downloading OS images from a network - -Although GRUB is a disk-based boot loader, it does provide network -support. To use the network support, you need to enable at least one -network driver in the GRUB build process. For more information please -see @file{netboot/README.netboot} in the source distribution. - -@menu -* General usage of network support:: -* Diskless:: -@end menu - - -@node General usage of network support -@section How to set up your network - -GRUB requires a file server and optionally a server that will assign an -IP address to the machine on which GRUB is running. For the former, only -TFTP is supported at the moment. The latter is either BOOTP, DHCP or a -RARP server@footnote{RARP is not advised, since it cannot serve much -information}. It is not necessary to run both the servers on one -computer. How to configure these servers is beyond the scope of this -document, so please refer to the manuals specific to those -protocols/servers. - -If you decided to use a server to assign an IP address, set up the -server and run @command{bootp} (@pxref{bootp}), @command{dhcp} -(@pxref{dhcp}) or @command{rarp} (@pxref{rarp}) for BOOTP, DHCP or RARP, -respectively. Each command will show an assigned IP address, a netmask, -an IP address for your TFTP server and a gateway. If any of the -addresses is wrong or it causes an error, probably the configuration of -your servers isn't set up properly. - -Otherwise, run @command{ifconfig}, like this: - -@example -grub> @kbd{ifconfig --address=192.168.110.23 --server=192.168.110.14} -@end example - -You can also use @command{ifconfig} in conjuction with @command{bootp}, -@command{dhcp} or @command{rarp} (e.g. to reassign the server address -manually). @xref{ifconfig}, for more details. - -Finally, download your OS images from your network. The network can be -accessed using the network drive @samp{(nd)}. Everything else is very -similar to the normal instructions (@pxref{Booting}). - -Here is an example: - -@example -@group -grub> @kbd{bootp} -Probing... [NE*000] -NE2000 base ... -Address: 192.168.110.23 Netmask: 255.255.255.0 -Server: 192.168.110.14 Gateway: 192.168.110.1 - -grub> @kbd{root (nd)} -grub> @kbd{kernel /tftproot/gnumach.gz root=sd0s1} -grub> @kbd{module /tftproot/serverboot.gz} -grub> @kbd{boot} -@end group -@end example - - -@node Diskless -@section Booting from a network - -It is sometimes very useful to boot from a network, especially when you -use a machine which has no local disk. In this case, you need to obtain -a kind of Net Boot @sc{rom}, such as a PXE @sc{rom} or a free software -package like Etherboot. Such a Boot @sc{rom} first boots the machine, -sets up the network card installed into the machine, and downloads a -second stage boot image from the network. Then, the second image will -try to boot an operating system actually from the network. - -GRUB provides two second stage images, @file{nbgrub} and -@file{pxegrub} (@pxref{Images}). These images are the same as the -normal Stage 2, except that they set up a network automatically, and try -to load a configuration file from the network, if specified. The usage -is very simple: If the machine has a PXE @sc{rom}, use -@file{pxegrub}. If the machine has an NBI loader such as Etherboot, use -@file{nbgrub}. There is no difference between them except their -formats. Since the way to load a second stage image you want to use -should be described in the manual on your Net Boot @sc{rom}, please -refer to the manual, for more information. - -However, there is one thing specific to GRUB. Namely, how to specify a -configuration file in a BOOTP/DHCP server. For now, GRUB uses the tag -@samp{150}, to get the name of a configuration file. The following is an -example with a BOOTP configuration: - -@example -@group -.allhost:hd=/tmp:bf=null:\ - :ds=145.71.35.1 145.71.32.1:\ - :sm=255.255.254.0:\ - :gw=145.71.35.1:\ - :sa=145.71.35.5: - -foo:ht=1:ha=63655d0334a7:ip=145.71.35.127:\ - :bf=/nbgrub:\ - :tc=.allhost:\ - :T150="(nd)/tftpboot/menu.lst.foo": -@end group -@end example - -Note that you should specify the drive name @code{(nd)} in the name of -the configuration file. This is because you might change the root drive -before downloading the configuration from the TFTP server when the -preset menu feature is used (@pxref{Preset Menu}). - -See the manual of your BOOTP/DHCP server for more information. The -exact syntax should differ a little from the example. - - @node Serial terminal @chapter Using GRUB via a serial line @@ -1581,214 +748,6 @@ GRUB provides you with an alternative menu interface, because the normal menu requires several fancy features of your terminal. -@node Preset Menu -@chapter Embedding a configuration file into GRUB - -GRUB supports a @dfn{preset menu} which is to be always loaded before -starting. The preset menu feature is useful, for example, when your -computer has no console but a serial cable. In this case, it is -critical to set up the serial terminal as soon as possible, since you -cannot see any message until the serial terminal begins to work. So it -is good to run the commands @command{serial} (@pxref{serial}) and -@command{terminal} (@pxref{terminal}) before anything else at the -start-up time. - -How the preset menu works is slightly complicated: - -@enumerate -@item -GRUB checks if the preset menu feature is used, and loads the preset -menu, if available. This includes running commands and reading boot -entries, like an ordinary configuration file. - -@item -GRUB checks if the configuration file is available. Note that this check -is performed @strong{regardless of the existence of the preset -menu}. The configuration file is loaded even if the preset menu was -loaded. - -@item -If the preset menu includes any boot entries, they are cleared when -the configuration file is loaded. It doesn't matter whether the -configuration file has any entries or no entry. The boot entries in the -preset menu are used only when GRUB fails in loading the configuration -file. -@end enumerate - -To enable the preset menu feature, you must rebuild GRUB specifying a -file to the configure script with the option -@option{--enable-preset-menu}. The file has the same semantics as -normal configuration files (@pxref{Configuration}). - -Another point you should take care is that the diskless support -(@pxref{Diskless}) diverts the preset menu. Diskless images embed a -preset menu to execute the command @command{bootp} (@pxref{bootp}) -automatically, unless you specify your own preset menu to the configure -script. This means that you must put commands to initialize a network in -the preset menu yourself, because diskless images don't set it up -implicitly, when you use the preset menu explicitly. - -Therefore, a typical preset menu used with diskless support would be -like this: - -@example -@group -# Set up the serial terminal, first of all. -serial --unit=0 --speed=19200 -terminal --timeout=0 serial - -# Initialize the network. -dhcp -@end group -@end example - - -@node Security -@chapter Protecting your computer from cracking - -You may be interested in how to prevent ordinary users from doing -whatever they like, if you share your computer with other people. So -this chapter describes how to improve the security of GRUB. - -One thing which could be a security hole is that the user can do too -many things with GRUB, because GRUB allows one to modify its configuration -and run arbitrary commands at run-time. For example, the user can even -read @file{/etc/passwd} in the command-line interface by the command -@command{cat} (@pxref{cat}). So it is necessary to disable all the -interactive operations. - -Thus, GRUB provides a @dfn{password} feature, so that only administrators -can start the interactive operations (i.e. editing menu entries and -entering the command-line interface). To use this feature, you need to -run the command @command{password} in your configuration file -(@pxref{password}), like this: - -@example -password --md5 PASSWORD -@end example - -If this is specified, GRUB disallows any interactive control, until you -press the key @key{p} and enter a correct password. The option -@option{--md5} tells GRUB that @samp{PASSWORD} is in MD5 format. If it -is omitted, GRUB assumes the @samp{PASSWORD} is in clear text. - -You can encrypt your password with the command @command{md5crypt} -(@pxref{md5crypt}). For example, run the grub shell (@pxref{Invoking the -grub shell}), and enter your password: - -@example -@group -grub> md5crypt -Password: ********** -Encrypted: $1$U$JK7xFegdxWH6VuppCUSIb. -@end group -@end example - -Then, cut and paste the encrypted password to your configuration file. - -Also, you can specify an optional argument to @command{password}. See -this example: - -@example -password PASSWORD /boot/grub/menu-admin.lst -@end example - -In this case, GRUB will load @file{/boot/grub/menu-admin.lst} as a -configuration file when you enter the valid password. - -Another thing which may be dangerous is that any user can choose any -menu entry. Usually, this wouldn't be problematic, but you might want to -permit only administrators to run some of your menu entries, such as an -entry for booting an insecure OS like DOS. - -GRUB provides the command @command{lock} (@pxref{lock}). This command -always fails until you enter the valid password, so you can use it, like -this: - -@example -@group -title Boot DOS -lock -rootnoverify (hd0,1) -makeactive -chainload +1 -@end group -@end example - -You should insert @command{lock} right after @command{title}, because -any user can execute commands in an entry until GRUB encounters -@command{lock}. - -You can also use the command @command{password} instead of -@command{lock}. In this case the boot process will ask for the password -and stop if it was entered incorrectly. Since the @command{password} -takes its own @var{PASSWORD} argument this is useful if you want -different passwords for different entries. - - -@node Images -@chapter GRUB image files - -GRUB consists of several images: two essential stages, optional stages -called @dfn{Stage 1.5}, one image for bootable CD-ROM, and two network -boot images. Here is a short overview of them. @xref{Internals}, for -more details. - -@table @file -@item stage1 -This is an essential image used for booting up GRUB. Usually, this is -embedded in an MBR or the boot sector of a partition. Because a PC boot -sector is 512 bytes, the size of this image is exactly 512 bytes. - -All @file{stage1} must do is to load Stage 2 or Stage 1.5 from a local -disk. Because of the size restriction, @file{stage1} encodes the -location of Stage 2 (or Stage 1.5) in a block list format, so it never -understand any filesystem structure. - -@item stage2 -This is the core image of GRUB. It does everything but booting up -itself. Usually, this is put in a filesystem, but that is not required. - -@item e2fs_stage1_5 -@itemx fat_stage1_5 -@itemx ffs_stage1_5 -@itemx jfs_stage1_5 -@itemx minix_stage1_5 -@itemx reiserfs_stage1_5 -@itemx vstafs_stage1_5 -@itemx xfs_stage1_5 - -These are called @dfn{Stage 1.5}, because they serve as a bridge -between @file{stage1} and @file{stage2}, that is to say, Stage 1.5 is -loaded by Stage 1 and Stage 1.5 loads Stage 2. The difference between -@file{stage1} and @file{*_stage1_5} is that the former doesn't -understand any filesystem while the latter understands one filesystem -(e.g. @file{e2fs_stage1_5} understands ext2fs). So you can move the -Stage 2 image to another location safely, even after GRUB has been -installed. - -While Stage 2 cannot generally be embedded in a fixed area as the size -is so large, Stage 1.5 can be installed into the area right after an MBR, -or the boot loader area of a ReiserFS or a FFS. - -@item stage2_eltorito -This is a boot image for CD-ROMs using the @dfn{no emulation mode} in -El Torito specification. This is identical to Stage 2, except that -this boots up without Stage 1 and sets up a special drive @samp{(cd)}. - -@item nbgrub -This is a network boot image for the Network Image Proposal used by some -network boot loaders, such as Etherboot. This is mostly the same as -Stage 2, but it also sets up a network and loads a configuration file -from the network. - -@item pxegrub -This is another network boot image for the Preboot Execution Environment -used by several Netboot ROMs. This is identical to @file{nbgrub}, except -for the format. -@end table - - @node Filesystem @chapter Filesystem syntax and semantics @@ -1907,8 +866,6 @@ the command-line interface. @menu * Command-line interface:: The flexible command-line interface * Menu interface:: The simple menu interface -* Menu entry editor:: Editing a menu entry -* Hidden menu interface:: The hidden menu interface @end menu @@ -2029,19 +986,6 @@ does not support @dfn{undo}, you can do almost the same thing by just returning to the main menu. -@node Hidden menu interface -@section The hidden menu interface - -When your terminal is dumb or you request GRUB to hide the menu -interface explicitly with the command @command{hiddenmenu} -(@pxref{hiddenmenu}), GRUB doesn't show the menu interface (@pxref{Menu -interface}) and automatically boots the default entry, unless -interrupted by pressing @key{ESC}. - -When you interrupt the timeout and your terminal is dumb, GRUB falls -back to the command-line interface (@pxref{Command-line interface}). - - @node Commands @chapter The list of available commands @@ -2094,64 +1038,12 @@ start, where they are ignored. These commands can only be used in the menu: @menu -* default:: Set the default entry -* fallback:: Set the fallback entry -* hiddenmenu:: Hide the menu interface -* timeout:: Set the timeout -* title:: Start a menu entry +* menuentry:: Start a menu entry @end menu -@node default -@subsection default - -@deffn Command default num -Set the default entry to the entry number @var{num}. Numbering starts -from 0, and the entry number 0 is the default if the command is not -used. - -You can specify @samp{saved} instead of a number. In this case, the -default entry is the entry saved with the command -@command{savedefault}. @xref{savedefault}, for more information. -@end deffn - - -@node fallback -@subsection fallback - -@deffn Command fallback num... -Go into unattended boot mode: if the default boot entry has any errors, -instead of waiting for the user to do something, immediately start -over using the @var{num} entry (same numbering as the @code{default} -command (@pxref{default})). This obviously won't help if the machine was -rebooted by a kernel that GRUB loaded. You can specify multiple -fallback entry numbers. -@end deffn - - -@node hiddenmenu -@subsection hiddenmenu - -@deffn Command hiddenmenu -Don't display the menu. If the command is used, no menu will be -displayed on the control terminal, and the default entry will be -booted after the timeout expired. The user can still request the -menu to be displayed by pressing @key{ESC} before the timeout -expires. See also @ref{Hidden menu interface}. -@end deffn - - -@node timeout -@subsection timeout - -@deffn Command timeout sec -Set a timeout, in @var{sec} seconds, before automatically booting the -default entry (normally the first entry defined). -@end deffn - - -@node title -@subsection title +@node menuentry +@subsection menuentry @deffn Command title name @dots{} Start a new boot entry, and set its name to the contents of the rest of @@ -2165,242 +1057,11 @@ the line, starting with the first non-space character. Commands usable anywhere in the menu and in the command-line. @menu -* bootp:: Initialize a network device via BOOTP -* color:: Color the menu interface -* device:: Specify a file as a drive -* dhcp:: Initialize a network device via DHCP -* hide:: Hide a partition -* ifconfig:: Configure a network device manually -* pager:: Change the state of the internal pager -* partnew:: Make a primary partition -* parttype:: Change the type of a partition -* password:: Set a password for the menu interface -* rarp:: Initialize a network device via RARP * serial:: Set up a serial device -* setkey:: Configure the key map -* terminal:: Choose a terminal * terminfo:: Define escape sequences for a terminal -* tftpserver:: Specify a TFTP server -* unhide:: Unhide a partition @end menu -@node bootp -@subsection bootp - -@deffn Command bootp [@option{--with-configfile}] -Initialize a network device via the @dfn{BOOTP} protocol. This command -is only available if GRUB is compiled with netboot support. See also -@ref{Network}. - -If you specify @option{--with-configfile} to this command, GRUB will -fetch and load a configuration file specified by your BOOTP server -with the vendor tag @samp{150}. -@end deffn - - -@node color -@subsection color - -@deffn Command color normal [highlight] -Change the menu colors. The color @var{normal} is used for most -lines in the menu (@pxref{Menu interface}), and the color -@var{highlight} is used to highlight the line where the cursor -points. If you omit @var{highlight}, then the inverted color of -@var{normal} is used for the highlighted line. The format of a color is -@code{@var{foreground}/@var{background}}. @var{foreground} and -@var{background} are symbolic color names. A symbolic color name must be -one of these: - -@itemize @bullet -@item -black - -@item -blue - -@item -green - -@item -cyan - -@item -red - -@item -magenta - -@item -brown - -@item -light-gray - -@strong{These below can be specified only for the foreground.} - -@item -dark-gray - -@item -light-blue - -@item -light-green - -@item -light-cyan - -@item -light-red - -@item -light-magenta - -@item -yellow - -@item -white -@end itemize - -But only the first eight names can be used for @var{background}. You can -prefix @code{blink-} to @var{foreground} if you want a blinking -foreground color. - -This command can be used in the configuration file and on the command -line, so you may write something like this in your configuration file: - -@example -@group -# Set default colors. -color light-gray/blue black/light-gray - -# Change the colors. -title OS-BS like -color magenta/blue black/magenta -@end group -@end example -@end deffn - - -@node device -@subsection device - -@deffn Command device drive file -In the grub shell, specify the file @var{file} as the actual drive for a -@sc{bios} drive @var{drive}. You can use this command to create a disk -image, and/or to fix the drives guessed by GRUB when GRUB fails to -determine them correctly, like this: - -@example -@group -grub> @kbd{device (fd0) /floppy-image} -grub> @kbd{device (hd0) /dev/sd0} -@end group -@end example - -This command can be used only in the grub shell (@pxref{Invoking the -grub shell}). -@end deffn - - -@node dhcp -@subsection dhcp - -@deffn Command dhcp [--with-configfile] -Initialize a network device via the @dfn{DHCP} protocol. Currently, -this command is just an alias for @command{bootp}, since the two -protocols are very similar. This command is only available if GRUB is -compiled with netboot support. See also @ref{Network}. - -If you specify @option{--with-configfile} to this command, GRUB will -fetch and load a configuration file specified by your DHCP server -with the vendor tag @samp{150}. -@end deffn - - -@node hide -@subsection hide - -@deffn Command hide partition -Hide the partition @var{partition} by setting the @dfn{hidden} bit in -its partition type code. This is useful only when booting DOS or Windows -and multiple primary FAT partitions exist in one disk. See also -@ref{DOS/Windows}. -@end deffn - - -@node ifconfig -@subsection ifconfig - -@deffn Command ifconfig [@option{--server=server}] [@option{--gateway=gateway}] [@option{--mask=mask}] [@option{--address=address}] -Configure the IP address, the netmask, the gateway, and the server -address of a network device manually. The values must be in dotted -decimal format, like @samp{192.168.11.178}. The order of the options is -not important. This command shows current network configuration, if no -option is specified. See also @ref{Network}. -@end deffn - - -@node pager -@subsection pager - -@deffn Command pager [flag] -Toggle or set the state of the internal pager. If @var{flag} is -@samp{on}, the internal pager is enabled. If @var{flag} is @samp{off}, -it is disabled. If no argument is given, the state is toggled. -@end deffn - - -@node partnew -@subsection partnew - -@deffn Command partnew part type from len -Create a new primary partition. @var{part} is a partition specification -in GRUB syntax (@pxref{Naming convention}); @var{type} is the partition -type and must be a number in the range @code{0-0xff}; @var{from} is -the starting address and @var{len} is the length, both in sector units. -@end deffn - - -@node parttype -@subsection parttype - -@deffn Command parttype part type -Change the type of an existing partition. @var{part} is a partition -specification in GRUB syntax (@pxref{Naming convention}); @var{type} -is the new partition type and must be a number in the range 0-0xff. -@end deffn - - -@node password -@subsection password - -@deffn Command password [@option{--md5}] passwd [new-config-file] -If used in the first section of a menu file, disable all interactive -editing control (menu entry editor and command-line) and entries -protected by the command @command{lock}. If the password @var{passwd} is -entered, it loads the @var{new-config-file} as a new config file and -restarts the GRUB Stage 2, if @var{new-config-file} is -specified. Otherwise, GRUB will just unlock the privileged instructions. -You can also use this command in the script section, in which case it -will ask for the password, before continuing. The option -@option{--md5} tells GRUB that @var{passwd} is encrypted with -@command{md5crypt} (@pxref{md5crypt}). -@end deffn - - -@node rarp -@subsection rarp - -@deffn Command rarp -Initialize a network device via the @dfn{RARP} protocol. This command -is only available if GRUB is compiled with netboot support. See also -@ref{Network}. -@end deffn - - @node serial @subsection serial @@ -2426,169 +1087,6 @@ support. See also @ref{Serial terminal}. @end deffn -@node setkey -@subsection setkey - -@deffn Command setkey [to_key from_key] -Change the keyboard map. The key @var{from_key} is mapped to the key -@var{to_key}. If no argument is specified, reset key mappings. Note that -this command @emph{does not} exchange the keys. If you want to exchange -the keys, run this command again with the arguments exchanged, like this: - -@example -grub> @kbd{setkey capslock control} -grub> @kbd{setkey control capslock} -@end example - -A key must be an alphabet letter, a digit, or one of these symbols: -@samp{escape}, @samp{exclam}, @samp{at}, @samp{numbersign}, -@samp{dollar}, @samp{percent}, @samp{caret}, @samp{ampersand}, -@samp{asterisk}, @samp{parenleft}, @samp{parenright}, @samp{minus}, -@samp{underscore}, @samp{equal}, @samp{plus}, @samp{backspace}, -@samp{tab}, @samp{bracketleft}, @samp{braceleft}, @samp{bracketright}, -@samp{braceright}, @samp{enter}, @samp{control}, @samp{semicolon}, -@samp{colon}, @samp{quote}, @samp{doublequote}, @samp{backquote}, -@samp{tilde}, @samp{shift}, @samp{backslash}, @samp{bar}, @samp{comma}, -@samp{less}, @samp{period}, @samp{greater}, @samp{slash}, -@samp{question}, @samp{alt}, @samp{space}, @samp{capslock}, @samp{FX} -(@samp{X} is a digit), and @samp{delete}. This table describes to which -character each of the symbols corresponds: - -@table @samp -@item exclam -@samp{!} - -@item at -@samp{@@} - -@item numbersign -@samp{#} - -@item dollar -@samp{$} - -@item percent -@samp{%} - -@item caret -@samp{^} - -@item ampersand -@samp{&} - -@item asterisk -@samp{*} - -@item parenleft -@samp{(} - -@item parenright -@samp{)} - -@item minus -@samp{-} - -@item underscore -@samp{_} - -@item equal -@samp{=} - -@item plus -@samp{+} - -@item bracketleft -@samp{[} - -@item braceleft -@samp{@{} - -@item bracketright -@samp{]} - -@item braceright -@samp{@}} - -@item semicolon -@samp{;} - -@item colon -@samp{:} - -@item quote -@samp{'} - -@item doublequote -@samp{"} - -@item backquote -@samp{`} - -@item tilde -@samp{~} - -@item backslash -@samp{\} - -@item bar -@samp{|} - -@item comma -@samp{,} - -@item less -@samp{<} - -@item period -@samp{.} - -@item greater -@samp{>} - -@item slash -@samp{/} - -@item question -@samp{?} - -@item space -@samp{ } -@end table -@end deffn - - -@node terminal -@subsection terminal - -@deffn Command terminal [@option{--dumb}] [@option{--no-echo}] [@option{--no-edit}] [@option{--timeout=secs}] [@option{--lines=lines}] [@option{--silent}] [@option{console}] [@option{serial}] [@option{hercules}] -Select a terminal for user interaction. The terminal is assumed to be -VT100-compatible unless @option{--dumb} is specified. If both -@option{console} and @option{serial} are specified, then GRUB will use -the one where a key is entered first or the first when the timeout -expires. If neither are specified, the current setting is -reported. This command is only available if GRUB is compiled with serial -support. See also @ref{Serial terminal}. - -This may not make sense for most users, but GRUB supports Hercules -console as well. Hercules console is usable like the ordinary console, -and the usage is quite similar to that for serial terminals: specify -@option{hercules} as the argument. - -The option @option{--lines} defines the number of lines in your -terminal, and it is used for the internal pager function. If you don't -specify this option, the number is assumed as 24. - -The option @option{--silent} suppresses the message to prompt you to -hit any key. This might be useful if your system has no terminal -device. - -The option @option{--no-echo} has GRUB not to echo back input -characters. This implies the option @option{--no-edit}. - -The option @option{--no-edit} disables the BASH-like editing feature. -@end deffn - - @node terminfo @subsection terminfo @@ -2604,31 +1102,6 @@ If no option is specified, the current settings are printed. @end deffn -@node tftpserver -@subsection tftpserver - -@deffn Command tftpserver ipaddr -@strong{Caution:} This command exists only for backward -compatibility. Use @command{ifconfig} (@pxref{ifconfig}) instead. - -Override a TFTP server address returned by a BOOTP/DHCP/RARP server. The -argument @var{ipaddr} must be in dotted decimal format, like -@samp{192.168.0.15}. This command is only available if GRUB is compiled -with netboot support. See also @ref{Network}. -@end deffn - - -@node unhide -@subsection unhide - -@deffn Command unhide partition -Unhide the partition @var{partition} by clearing the @dfn{hidden} bit in -its partition type code. This is useful only when booting DOS or Windows -and multiple primary partitions exist on one disk. See also -@ref{DOS/Windows}. -@end deffn - - @node Command-line and menu entry commands @section The list of command-line and menu entry commands @@ -2637,56 +1110,17 @@ you forget a command, you can run the command @command{help} (@pxref{help}). @menu -* blocklist:: Get the block list notation of a file * boot:: Start up your operating system * cat:: Show the contents of a file * chainloader:: Chain-load another boot loader * cmp:: Compare two files * configfile:: Load a configuration file -* debug:: Toggle the debug flag -* displayapm:: Display APM information -* displaymem:: Display memory configuration -* embed:: Embed Stage 1.5 -* find:: Find a file -* fstest:: Test a filesystem -* geometry:: Manipulate the geometry of a drive * halt:: Shut down your computer * help:: Show help messages -* impsprobe:: Probe SMP -* initrd:: Load an initrd -* install:: Install GRUB -* ioprobe:: Probe I/O ports used for a drive -* kernel:: Load a kernel -* lock:: Lock a menu entry -* makeactive:: Make a partition active -* map:: Map a drive to another -* md5crypt:: Encrypt a password in MD5 format -* module:: Load a module -* modulenounzip:: Load a module without decompression -* pause:: Wait for a key press -* quit:: Exit from the grub shell * reboot:: Reboot your computer -* read:: Read data from memory -* root:: Set GRUB's root device -* rootnoverify:: Set GRUB's root device without mounting -* savedefault:: Save current entry as the default entry -* setup:: Set up GRUB's installation automatically -* testload:: Load a file for testing a filesystem -* testvbe:: Test VESA BIOS EXTENSION -* uppermem:: Set the upper memory size -* vbeprobe:: Probe VESA BIOS EXTENSION @end menu -@node blocklist -@subsection blocklist - -@deffn Command blocklist file -Print the block list notation of the file @var{file}. @xref{Block list -syntax}. -@end deffn - - @node boot @subsection boot @@ -2753,93 +1187,6 @@ Load @var{file} as a configuration file. @end deffn -@node debug -@subsection debug - -@deffn Command debug -Toggle debug mode (by default it is off). When debug mode is on, some -extra messages are printed to show disk activity. This global debug flag -is mainly useful for GRUB developers when testing new code. -@end deffn - - -@node displayapm -@subsection displayapm - -@deffn Command displayapm -Display APM BIOS information. -@end deffn - - -@node displaymem -@subsection displaymem - -@deffn Command displaymem -Display what GRUB thinks the system address space map of the machine is, -including all regions of physical @sc{ram} installed. GRUB's -@dfn{upper/lower memory} display uses the standard BIOS interface for -the available memory in the first megabyte, or @dfn{lower memory}, and a -synthesized number from various BIOS interfaces of the memory starting -at 1MB and going up to the first chipset hole for @dfn{upper memory} -(the standard PC @dfn{upper memory} interface is limited to reporting a -maximum of 64MB). -@end deffn - - -@node embed -@subsection embed - -@deffn Command embed stage1_5 device -Embed the Stage 1.5 @var{stage1_5} in the sectors after the MBR if -@var{device} is a drive, or in the @dfn{boot loader} area if @var{device} -is a FFS partition or a ReiserFS partition.@footnote{The latter feature -has not been implemented yet.} Print the number of sectors which -@var{stage1_5} occupies, if successful. - -Usually, you don't need to run this command directly. @xref{setup}. -@end deffn - - -@node find -@subsection find - -@deffn Command find filename -Search for the file name @var{filename} in all mountable partitions -and print the list of the devices which contain the file. The file -name @var{filename} should be an absolute file name like -@code{/boot/grub/stage1}. -@end deffn - - -@node fstest -@subsection fstest - -@deffn Command fstest -Toggle filesystem test mode. -Filesystem test mode, when turned on, prints out data corresponding to -all the device reads and what values are being sent to the low-level -routines. The format is @samp{<@var{partition-offset-sector}, -@var{byte-offset}, @var{byte-length}>} for high-level reads inside a -partition, and @samp{[@var{disk-offset-sector}]} for low-level sector -requests from the disk. -Filesystem test mode is turned off by any use of the @command{install} -(@pxref{install}) or @command{testload} (@pxref{testload}) commands. -@end deffn - - -@node geometry -@subsection geometry - -@deffn Command geometry drive [cylinder head sector [total_sector]] -Print the information for the drive @var{drive}. In the grub shell, you -can set the geometry of the drive arbitrarily. The number of -cylinders, the number of heads, the number of sectors and the number of -total sectors are set to CYLINDER, HEAD, SECTOR and TOTAL_SECTOR, -respectively. If you omit TOTAL_SECTOR, then it will be calculated -based on the C/H/S values automatically. -@end deffn - - @node halt @subsection halt @@ -2865,220 +1212,6 @@ about each of the commands which match those @var{patterns}. @end deffn -@node impsprobe -@subsection impsprobe - -@deffn Command impsprobe -Probe the Intel Multiprocessor Specification 1.1 or 1.4 configuration -table and boot the various CPUs which are found into a tight loop. This -command can be used only in the Stage 2, but not in the grub shell. -@end deffn - - -@node initrd -@subsection initrd - -@deffn Command initrd file @dots{} -Load an initial ramdisk for a Linux format boot image and set the -appropriate parameters in the Linux setup area in memory. See also -@ref{GNU/Linux}. -@end deffn - - -@node install -@subsection install - -@deffn Command install [@option{--force-lba}] [@option{--stage2=os_stage2_file}] stage1_file [@option{d}] dest_dev stage2_file [addr] [@option{p}] [config_file] [real_config_file] -This command is fairly complex, and you should not use this command -unless you are familiar with GRUB. Use @command{setup} (@pxref{setup}) -instead. - -In short, it will perform a full install presuming the Stage 2 or Stage -1.5@footnote{They're loaded the same way, so we will refer to the Stage -1.5 as a Stage 2 from now on.} is in its final install location. - -In slightly more detail, it will load @var{stage1_file}, validate that -it is a GRUB Stage 1 of the right version number, install in it a -blocklist for loading @var{stage2_file} as a Stage 2. If the option -@option{d} is present, the Stage 1 will always look for the actual -disk @var{stage2_file} was installed on, rather than using the booting -drive. The Stage 2 will be loaded at address @var{addr}, which must be -@samp{0x8000} for a true Stage 2, and @samp{0x2000} for a Stage 1.5. If -@var{addr} is not present, GRUB will determine the address -automatically. It then writes the completed Stage 1 to the first block -of the device @var{dest_dev}. If the options @option{p} or -@var{config_file} are present, then it reads the first block of stage2, -modifies it with the values of the partition @var{stage2_file} was found -on (for @option{p}) or places the string @var{config_file} into the area -telling the stage2 where to look for a configuration file at boot -time. Likewise, if @var{real_config_file} is present and -@var{stage2_file} is a Stage 1.5, then the Stage 2 @var{config_file} is -patched with the configuration file name @var{real_config_file}. This -command preserves the DOS BPB (and for hard disks, the partition table) -of the sector the Stage 1 is to be installed into. - -@strong{Caution:} Several buggy BIOSes don't pass a booting drive -properly when booting from a hard disk drive. Therefore, you will -unfortunately have to specify the option @option{d}, whether your -Stage2 resides at the booting drive or not, if you have such a -BIOS. We know these are defective in this way: - -@table @asis -@item -Fujitsu LifeBook 400 BIOS version 31J0103A - -@item -HP Vectra XU 6/200 BIOS version GG.06.11 -@end table - -@strong{Caution2:} A number of BIOSes don't return a correct LBA support -bitmap even if they do have the support. So GRUB provides a solution to -ignore the wrong bitmap, that is, the option @option{--force-lba}. Don't -use this option if you know that your BIOS doesn't have LBA support. - -@strong{Caution3:} You must specify the option @option{--stage2} in the -grub shell, if you cannot unmount the filesystem where your stage2 file -resides. The argument should be the file name in your operating system. -@end deffn - - -@node ioprobe -@subsection ioprobe - -@deffn Command ioprobe drive -Probe I/O ports used for the drive @var{drive}. This command will list -the I/O ports on the screen. For technical information, -@xref{Internals}. -@end deffn - - -@node kernel -@subsection kernel - -@deffn Command kernel [@option{--type=type}] [@option{--no-mem-option}] file @dots{} -Attempt to load the primary boot image (Multiboot a.out or @sc{elf}, -Linux zImage or bzImage, FreeBSD a.out, NetBSD a.out, etc.) from -@var{file}. The rest of the line is passed verbatim as the @dfn{kernel -command-line}. Any modules must be reloaded after using this command. - -This command also accepts the option @option{--type} so that you can -specify the kernel type of @var{file} explicitly. The argument -@var{type} must be one of these: @samp{netbsd}, @samp{freebsd}, -@samp{openbsd}, @samp{linux}, @samp{biglinux}, and -@samp{multiboot}. However, you need to specify it only if you want to -load a NetBSD @sc{elf} kernel, because GRUB can automatically determine -a kernel type in the other cases, quite safely. - -The option @option{--no-mem-option} is effective only for Linux. If the -option is specified, GRUB doesn't pass the option @option{mem=} to the -kernel. This option is implied for Linux kernels 2.4.18 and newer. -@end deffn - - -@node lock -@subsection lock - -@deffn Command lock -Prevent normal users from executing arbitrary menu entries. You must use -the command @command{password} if you really want this command to be -useful (@pxref{password}). - -This command is used in a menu, as shown in this example: - -@example -@group -title This entry is too dangerous to be executed by normal users -lock -root (hd0,a) -kernel /no-security-os -@end group -@end example - -See also @ref{Security}. -@end deffn - - -@node makeactive -@subsection makeactive - -@deffn Command makeactive -Set the active partition on the root disk to GRUB's root device. -This command is limited to @emph{primary} PC partitions on a hard disk. -@end deffn - - -@node map -@subsection map - -@deffn Command map to_drive from_drive -Map the drive @var{from_drive} to the drive @var{to_drive}. This is -necessary when you chain-load some operating systems, such as DOS, if -such an OS resides at a non-first drive. Here is an example: - -@example -@group -grub> @kbd{map (hd0) (hd1)} -grub> @kbd{map (hd1) (hd0)} -@end group -@end example - -The example exchanges the order between the first hard disk and the -second hard disk. See also @ref{DOS/Windows}. -@end deffn - - -@node md5crypt -@subsection md5crypt - -@deffn Command md5crypt -Prompt to enter a password, and encrypt it in MD5 format. The encrypted -password can be used with the command @command{password} -(@pxref{password}). See also @ref{Security}. -@end deffn - - -@node module -@subsection module - -@deffn Command module file @dots{} -Load a boot module @var{file} for a Multiboot format boot image (no -interpretation of the file contents are made, so the user of this -command must know what the kernel in question expects). The rest of the -line is passed as the @dfn{module command-line}, like the -@command{kernel} command. You must load a Multiboot kernel image before -loading any module. See also @ref{modulenounzip}. -@end deffn - - -@node modulenounzip -@subsection modulenounzip - -@deffn Command modulenounzip file @dots{} -The same as @command{module} (@pxref{module}), except that automatic -decompression is disabled. -@end deffn - - -@node pause -@subsection pause - -@deffn Command pause message @dots{} -Print the @var{message}, then wait until a key is pressed. Note that -placing @key{^G} (ASCII code 7) in the message will cause the speaker to -emit the standard beep sound, which is useful when prompting the user to -change floppies. -@end deffn - - -@node quit -@subsection quit - -@deffn Command quit -Exit from the grub shell @command{grub} (@pxref{Invoking the grub -shell}). This command can be used only in the grub shell. -@end deffn - - @node reboot @subsection reboot @@ -3087,551 +1220,6 @@ Reboot the computer. @end deffn -@node read -@subsection read - -@deffn Command read addr -Read a 32-bit value from memory at address @var{addr} and display it in -hex format. -@end deffn - - -@node root -@subsection root - -@deffn Command root device [hdbias] -Set the current @dfn{root device} to the device @var{device}, then -attempt to mount it to get the partition size (for passing the partition -descriptor in @code{ES:ESI}, used by some chain-loaded boot loaders), the -BSD drive-type (for booting BSD kernels using their native boot format), -and correctly determine the PC partition where a BSD sub-partition is -located. The optional @var{hdbias} parameter is a number to tell a BSD -kernel how many BIOS drive numbers are on controllers before the current -one. For example, if there is an IDE disk and a SCSI disk, and your -FreeBSD root partition is on the SCSI disk, then use a @samp{1} for -@var{hdbias}. - -See also @ref{rootnoverify}. -@end deffn - - -@node rootnoverify -@subsection rootnoverify - -@deffn Command rootnoverify device [hdbias] -Similar to @command{root} (@pxref{root}), but don't attempt to mount the -partition. This is useful for when an OS is outside of the area of the -disk that GRUB can read, but setting the correct root device is still -desired. Note that the items mentioned in @command{root} above which -derived from attempting the mount will @emph{not} work correctly. -@end deffn - - -@node savedefault -@subsection savedefault - -@deffn Command savedefault num -Save the current menu entry or @var{num} if specified as a default -entry. Here is an example: - -@example -@group -default saved -timeout 10 - -title GNU/Linux -root (hd0,0) -kernel /boot/vmlinuz root=/dev/sda1 vga=ext -initrd /boot/initrd -savedefault - -title FreeBSD -root (hd0,a) -kernel /boot/loader -savedefault -@end group -@end example - -With this configuration, GRUB will choose the entry booted previously as -the default entry. - -You can specify @samp{fallback} instead of a number. Then, next -fallback entry is saved. Next fallback entry is chosen from fallback -entries. Normally, this will be the first entry in fallback ones. - -See also @ref{default} and @ref{Invoking grub-set-default}. -@end deffn - - -@node setup -@subsection setup - -@deffn Command setup [@option{--force-lba}] [@option{--stage2=os_stage2_file}] [@option{--prefix=dir}] install_device [image_device] -Set up the installation of GRUB automatically. This command uses the -more flexible command @command{install} (@pxref{install}) in the backend -and installs GRUB into the device @var{install_device}. If -@var{image_device} is specified, then find the GRUB images -(@pxref{Images}) in the device @var{image_device}, otherwise use the -current @dfn{root device}, which can be set by the command -@command{root}. If @var{install_device} is a hard disk, then embed a -Stage 1.5 in the disk if possible. - -The option @option{--prefix} specifies the directory under which GRUB -images are put. If it is not specified, GRUB automatically searches them -in @file{/boot/grub} and @file{/grub}. - -The options @option{--force-lba} and @option{--stage2} are just passed -to @command{install} if specified. @xref{install}, for more -information. -@end deffn - - -@node testload -@subsection testload - -@deffn Command testload file -Read the entire contents of @var{file} in several different ways and -compare them, to test the filesystem code. The output is somewhat -cryptic, but if no errors are reported and the final @samp{i=@var{X}, -filepos=@var{Y}} reading has @var{X} and @var{Y} equal, then it is -definitely consistent, and very likely works correctly subject to a -consistent offset error. If this test succeeds, then a good next step is -to try loading a kernel. -@end deffn - - -@node testvbe -@subsection testvbe - -@deffn Command testvbe mode -Test the VESA BIOS EXTENSION mode @var{mode}. This command will switch -your video card to the graphics mode, and show an endless animation. Hit -any key to return. See also @ref{vbeprobe}. -@end deffn - - -@node uppermem -@subsection uppermem - -@deffn Command uppermem kbytes -Force GRUB to assume that only @var{kbytes} kilobytes of upper memory -are installed. Any system address range maps are discarded. - -@strong{Caution:} This should be used with great caution, and should -only be necessary on some old machines. GRUB's BIOS probe can pick up -all @sc{ram} on all new machines the author has ever heard of. It can -also be used for debugging purposes to lie to an OS. -@end deffn - - -@node vbeprobe -@subsection vbeprobe - -@deffn Command vbeprobe [mode] -Probe VESA BIOS EXTENSION information. If the mode @var{mode} is -specified, show only the information about @var{mode}. Otherwise, this -command lists up available VBE modes on the screen. See also -@ref{testvbe}. -@end deffn - - -@node Troubleshooting -@chapter Error messages reported by GRUB - -This chapter describes error messages reported by GRUB when you -encounter trouble. @xref{Invoking the grub shell}, if your problem is -specific to the grub shell. - -@menu -* Stage1 errors:: Errors reported by the Stage 1 -* Stage1.5 errors:: Errors reported by the Stage 1.5 -* Stage2 errors:: Errors reported by the Stage 2 -@end menu - - -@node Stage1 errors -@section Errors reported by the Stage 1 - -The general way that the Stage 1 handles errors is to print an error -string and then halt. Pressing @kbd{@key{CTRL}-@key{ALT}-@key{DEL}} will -reboot. - -The following is a comprehensive list of error messages for the Stage 1: - -@table @asis -@item Hard Disk Error -The stage2 or stage1.5 is being read from a hard disk, and the attempt -to determine the size and geometry of the hard disk failed. - -@item Floppy Error -The stage2 or stage1.5 is being read from a floppy disk, and the attempt -to determine the size and geometry of the floppy disk failed. It's listed -as a separate error since the probe sequence is different than for hard -disks. - -@item Read Error -A disk read error happened while trying to read the stage2 or stage1.5. - -@item Geom Error -The location of the stage2 or stage1.5 is not in the portion of the disk -supported directly by the BIOS read calls. This could occur because the -BIOS translated geometry has been changed by the user or the disk is -moved to another machine or controller after installation, or GRUB was -not installed using itself (if it was, the Stage 2 version of this error -would have been seen during that process and it would not have completed -the install). -@end table - - -@node Stage1.5 errors -@section Errors reported by the Stage 1.5 - -The general way that the Stage 1.5 handles errors is to print an error -number in the form @code{Error @var{num}} and then halt. Pressing -@kbd{@key{CTRL}-@key{ALT}-@key{DEL}} will reboot. - -The error numbers correspond to the errors reported by Stage -2. @xref{Stage2 errors}. - - -@node Stage2 errors -@section Errors reported by the Stage 2 - -The general way that the Stage 2 handles errors is to abort the -operation in question, print an error string, then (if possible) either -continue based on the fact that an error occurred or wait for the user to -deal with the error. - -The following is a comprehensive list of error messages for the Stage 2 -(error numbers for the Stage 1.5 are listed before the colon in each -description): - -@table @asis -@item 1 : Filename must be either an absolute filename or blocklist -This error is returned if a file name is requested which doesn't fit the -syntax/rules listed in the @ref{Filesystem}. - -@item 2 : Bad file or directory type -This error is returned if a file requested is not a regular file, but -something like a symbolic link, directory, or FIFO. - -@item 3 : Bad or corrupt data while decompressing file -This error is returned if the run-length decompression code gets an -internal error. This is usually from a corrupt file. - -@item 4 : Bad or incompatible header in compressed file -This error is returned if the file header for a supposedly compressed -file is bad. - -@item 5 : Partition table invalid or corrupt -This error is returned if the sanity checks on the integrity of the -partition table fail. This is a bad sign. - -@item 6 : Mismatched or corrupt version of stage1/stage2 -This error is returned if the install command points to incompatible -or corrupt versions of the stage1 or stage2. It can't detect corruption -in general, but this is a sanity check on the version numbers, which -should be correct. - -@item 7 : Loading below 1MB is not supported -This error is returned if the lowest address in a kernel is below the -1MB boundary. The Linux zImage format is a special case and can be -handled since it has a fixed loading address and maximum size. - -@item 8 : Kernel must be loaded before booting -This error is returned if GRUB is told to execute the boot sequence -without having a kernel to start. - -@item 9 : Unknown boot failure -This error is returned if the boot attempt did not succeed for reasons -which are unknown. - -@item 10 : Unsupported Multiboot features requested -This error is returned when the Multiboot features word in the Multiboot -header requires a feature that is not recognized. The point of this is -that the kernel requires special handling which GRUB is probably -unable to provide. - -@item 11 : Unrecognized device string -This error is returned if a device string was expected, and the string -encountered didn't fit the syntax/rules listed in the @ref{Filesystem}. - -@item 12 : Invalid device requested -This error is returned if a device string is recognizable but does not -fall under the other device errors. - -@item 13 : Invalid or unsupported executable format -This error is returned if the kernel image being loaded is not -recognized as Multiboot or one of the supported native formats (Linux -zImage or bzImage, FreeBSD, or NetBSD). - -@item 14 : Filesystem compatibility error, cannot read whole file -Some of the filesystem reading code in GRUB has limits on the length of -the files it can read. This error is returned when the user runs into -such a limit. - -@item 15 : File not found -This error is returned if the specified file name cannot be found, but -everything else (like the disk/partition info) is OK. - -@item 16 : Inconsistent filesystem structure -This error is returned by the filesystem code to denote an internal -error caused by the sanity checks of the filesystem structure on disk -not matching what it expects. This is usually caused by a corrupt -filesystem or bugs in the code handling it in GRUB. - -@item 17 : Cannot mount selected partition -This error is returned if the partition requested exists, but the -filesystem type cannot be recognized by GRUB. - -@item 18 : Selected cylinder exceeds maximum supported by BIOS -This error is returned when a read is attempted at a linear block -address beyond the end of the BIOS translated area. This generally -happens if your disk is larger than the BIOS can handle (512MB for -(E)IDE disks on older machines or larger than 8GB in general). - -@item 19 : Linux kernel must be loaded before initrd -This error is returned if the initrd command is used before loading a -Linux kernel. - -@item 20 : Multiboot kernel must be loaded before modules -This error is returned if the module load command is used before loading -a Multiboot kernel. It only makes sense in this case anyway, as GRUB has -no idea how to communicate the presence of such modules to a -non-Multiboot-aware kernel. - -@item 21 : Selected disk does not exist -This error is returned if the device part of a device- or full file name -refers to a disk or BIOS device that is not present or not recognized by -the BIOS in the system. - -@item 22 : No such partition -This error is returned if a partition is requested in the device part of -a device- or full file name which isn't on the selected disk. - -@item 23 : Error while parsing number -This error is returned if GRUB was expecting to read a number and -encountered bad data. - -@item 24 : Attempt to access block outside partition -This error is returned if a linear block address is outside of the disk -partition. This generally happens because of a corrupt filesystem on the -disk or a bug in the code handling it in GRUB (it's a great debugging -tool). - -@item 25 : Disk read error -This error is returned if there is a disk read error when trying to -probe or read data from a particular disk. - -@item 26 : Too many symbolic links -This error is returned if the link count is beyond the maximum -(currently 5), possibly the symbolic links are looped. - -@item 27 : Unrecognized command -This error is returned if an unrecognized command is entered on the -command-line or in a boot sequence section of a configuration file and -that entry is selected. - -@item 28 : Selected item cannot fit into memory -This error is returned if a kernel, module, or raw file load command is -either trying to load its data such that it won't fit into memory or it -is simply too big. - -@item 29 : Disk write error -This error is returned if there is a disk write error when trying to -write to a particular disk. This would generally only occur during an -install of set active partition command. - -@item 30 : Invalid argument -This error is returned if an argument specified to a command is invalid. - -@item 31 : File is not sector aligned -This error may occur only when you access a ReiserFS partition by -block-lists (e.g. the command @command{install}). In this case, you -should mount the partition with the @samp{-o notail} option. - -@item 32 : Must be authenticated -This error is returned if you try to run a locked entry. You should -enter a correct password before running such an entry. - -@item 33 : Serial device not configured -This error is returned if you try to change your terminal to a serial -one before initializing any serial device. - -@item 34 : No spare sectors on the disk -This error is returned if a disk doesn't have enough spare space. This -happens when you try to embed Stage 1.5 into the unused sectors after -the MBR, but the first partition starts right after the MBR or they are -used by EZ-BIOS. -@end table - - -@node Invoking the grub shell -@chapter Invoking the grub shell - -This chapter documents the grub shell @command{grub}. Note that the grub -shell is an emulator; it doesn't run under the native environment, so it -sometimes does something wrong. Therefore, you shouldn't trust it too -much. If there is anything wrong with it, don't hesitate to try the -native GRUB environment, especially when it guesses a wrong map between -BIOS drives and OS devices. - -@menu -* Basic usage:: How to use the grub shell -* Installation under UNIX:: How to install GRUB via @command{grub} -* Device map:: The map between BIOS drives and OS devices -@end menu - - -@node Basic usage -@section Introduction into the grub shell - -You can use the command @command{grub} for installing GRUB under your -operating systems and for a testbed when you add a new feature into GRUB -or when fixing a bug. @command{grub} is almost the same as the Stage 2, -and, in fact, it shares the source code with the Stage 2 and you can use -the same commands (@pxref{Commands}) in @command{grub}. It is emulated by -replacing BIOS calls with UNIX system calls and libc functions. - -The command @command{grub} accepts the following options: - -@table @option -@item --help -Print a summary of the command-line options and exit. - -@item --version -Print the version number of GRUB and exit. - -@item --verbose -Print some verbose messages for debugging purpose. - -@item --device-map=@var{file} -Use the device map file @var{file}. The format is described in -@ref{Device map}. - -@item --no-floppy -Do not probe any floppy drive. This option has no effect if the option -@option{--device-map} is specified (@pxref{Device map}). - -@item --probe-second-floppy -Probe the second floppy drive. If this option is not specified, the grub -shell does not probe it, as that sometimes takes a long time. If you -specify the device map file (@pxref{Device map}), the grub shell just -ignores this option. - -@item --config-file=@var{file} -Read the configuration file @var{file} instead of -@file{/boot/grub/menu.lst}. The format is the same as the normal GRUB -syntax. See @ref{Filesystem}, for more information. - -@item --boot-drive=@var{drive} -Set the stage2 @var{boot_drive} to @var{drive}. This argument should be -an integer (decimal, octal or hexadecimal). - -@item --install-partition=@var{par} -Set the stage2 @var{install_partition} to @var{par}. This argument -should be an integer (decimal, octal or hexadecimal). - -@item --no-config-file -Do not use the configuration file even if it can be read. - -@item --no-curses -Do not use the screen handling interface by the curses even if it is -available. - -@item --batch -This option has the same meaning as @samp{--no-config-file --no-curses}. - -@item --read-only -Disable writing to any disk. - -@item --hold -Wait until a debugger will attach. This option is useful when you want -to debug the startup code. -@end table - - -@node Installation under UNIX -@section How to install GRUB via @command{grub} - -The installation procedure is the same as under the @dfn{native} Stage -2. @xref{Installation}, for more information. The command -@command{grub}-specific information is described here. - -What you should be careful about is @dfn{buffer cache}. @command{grub} -makes use of raw devices instead of filesystems that your operating -systems serve, so there exists a potential problem that some cache -inconsistency may corrupt your filesystems. What we recommend is: - -@itemize @bullet -@item -If you can unmount drives to which GRUB may write any amount of data, -unmount them before running @command{grub}. - -@item -If a drive cannot be unmounted but can be mounted with the read-only -flag, mount it in read-only mode. That should be secure. - -@item -If a drive must be mounted with the read-write flag, make sure that no -activity is being done on it while the command @command{grub} is -running. - -@item -Reboot your operating system as soon as possible. This is probably not -required if you follow the rules above, but reboot is the most secure -way. -@end itemize - -In addition, enter the command @command{quit} when you finish the -installation. That is @emph{very important} because @command{quit} makes -the buffer cache consistent. Do not push @key{C-c}. - -If you want to install GRUB non-interactively, specify @samp{--batch} -option in the command-line. This is a simple example: - -@example -@group -#!/bin/sh - -# Use /usr/sbin/grub if you are on an older system. -/sbin/grub --batch </dev/null 2>/dev/null -root (hd0,0) -setup (hd0) -quit -EOT -@end group -@end example - - -@node Device map -@section The map between BIOS drives and OS devices - -When you specify the option @option{--device-map} (@pxref{Basic usage}), -the grub shell creates the @dfn{device map file} automatically unless it -already exists. The file name @file{/boot/grub/device.map} is preferred. - -If the device map file exists, the grub shell reads it to map BIOS -drives to OS devices. This file consists of lines like this: - -@example -@var{device} @var{file} -@end example - -@var{device} is a drive specified in the GRUB syntax (@pxref{Device -syntax}), and @var{file} is an OS file, which is normally a device -file. - -The reason why the grub shell gives you the device map file is that it -cannot guess the map between BIOS drives and OS devices correctly in -some environments. For example, if you exchange the boot sequence -between IDE and SCSI in your BIOS, it gets the order wrong. - -Thus, edit the file if the grub shell makes a mistake. You can put any -comments in the file if needed, as the grub shell assumes that a line is -just a comment if the first character is @samp{#}. - - @node Invoking grub-install @chapter Invoking grub-install @@ -3655,11 +1243,6 @@ Print a summary of the command-line options and exit. @item --version Print the version number of GRUB and exit. -@item --force-lba -Force GRUB to use LBA mode even for a buggy BIOS. Use this option only -if your BIOS doesn't work properly in LBA mode even though it supports -LBA mode. - @item --root-directory=@var{dir} Install GRUB images under the directory @var{dir} instead of the root directory. This option is useful when you want to install GRUB into a @@ -3671,14 +1254,6 @@ you have a separate @dfn{boot} partition which is mounted on @kbd{grub-install --root-directory=/boot hd0} @end example -@item --grub-shell=@var{file} -Use @var{file} as the grub shell. You can append arbitrary options to -@var{file} after the file name, like this: - -@example -@kbd{grub-install --grub-shell="grub --read-only" /dev/fd0} -@end example - @item --recheck Recheck the device map, even if @file{/boot/grub/device.map} already exists. You should use this option whenever you add/remove a disk @@ -3686,137 +1261,6 @@ into/from your computer. @end table -@node Invoking grub-md5-crypt -@chapter Invoking grub-md5-crypt - -The program @command{grub-md5-crypt} encrypts a password in MD5 format. -This is just a frontend of the grub shell (@pxref{Invoking the grub -shell}). Passwords encrypted by this program can be used with the -command @command{password} (@pxref{password}). - -@command{grub-md5-crypt} accepts the following options: - -@table @option -@item --help -Print a summary of the command-line options and exit. - -@item --version -Print the version information and exit. - -@item --grub-shell=@var{file} -Use @var{file} as the grub shell. -@end table - - -@node Invoking grub-terminfo -@chapter Invoking grub-terminfo - -The program @command{grub-terminfo} generates a terminfo command from -a terminfo name (@pxref{terminfo}). The result can be used in the -configuration file, to define escape sequences. Because GRUB assumes -that your terminal is vt100-compatible by default, this would be -useful only if your terminal is uncommon (such as vt52). - -@command{grub-terminfo} accepts the following options: - -@table @option -@item --help -Print a summary of the command-line options and exit. - -@item --version -Print the version information and exit. -@end table - -You must specify one argument to this command. For example: - -@example -@kbd{grub-terminfo vt52} -@end example - - -@node Invoking grub-set-default -@chapter Invoking grub-set-default - -The program @command{grub-set-default} sets the default boot entry for -GRUB. This automatically creates a file named @file{default} under -your GRUB directory (i.e. @file{/boot/grub}), if it is not -present. This file is used to determine the default boot entry when -GRUB boots up your system when you use @samp{default saved} in your -configuration file (@pxref{default}), and to save next default boot -entry when you use @samp{savedefault} in a boot entry -(@pxref{savedefault}). - -@command{grub-set-default} accepts the following options: - -@table @option -@item --help -Print a summary of the command-line options and exit. - -@item --version -Print the version information and exit. - -@item --root-directory=@var{dir} -Use the directory @var{dir} instead of the root directory -(i.e. @file{/}) to define the location of the default file. This -is useful when you mount a disk which is used for another system. -@end table - -You must specify a single argument to @command{grub-set-default}. This -argument is normally the number of a default boot entry. For example, -if you have this configuration file: - -@example -@group -default saved -timeout 10 - -title GNU/Hurd -root (hd0,0) -... - -title GNU/Linux -root (hd0,1) -... -@end group -@end example - -and if you want to set the next default boot entry to GNU/Linux, you -may execute this command: - -@example -@kbd{grub-set-default 1} -@end example - -Because the entry for GNU/Linux is @samp{1}. Note that entries are -counted from zero. So, if you want to specify GNU/Hurd here, then you -should specify @samp{0}. - -This feature is very useful if you want to test a new kernel or to -make your system quite robust. @xref{Making your system robust}, for -more hints about how to set up a robust system. - - -@node Invoking mbchk -@chapter Invoking mbchk - -The program @command{mbchk} checks for the format of a Multiboot -kernel. We recommend using this program before booting your own kernel -by GRUB. - -@command{mbchk} accepts the following options: - -@table @option -@item --help -Print a summary of the command-line options and exit. - -@item --version -Print the version number of GRUB and exit. - -@item --quiet -Suppress all normal output. -@end table - - @node Obtaining and Building GRUB @appendix How to obtain and build GRUB From 29a6b9e8fadf353862ea4a579e5753fa2ddfc0b3 Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 8 Aug 2009 04:28:12 +0000 Subject: [PATCH 1017/1707] 2009-08-08 Pavel Roskin * util/grub-mkconfig.in: Define datarootdir, datadir may depend on it. Add missing space before closing bracket. Fix misleading formatting. --- ChangeLog | 6 ++++++ util/grub-mkconfig.in | 11 ++++++----- 2 files changed, 12 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index a47abd4a3..1c8a14664 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-08 Pavel Roskin + + * util/grub-mkconfig.in: Define datarootdir, datadir may depend + on it. Add missing space before closing bracket. Fix + misleading formatting. + 2009-08-07 Robert Millan * docs/grub.texi: Major overhaul. Remove all sections that are diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 4ddb7beae..7756b492a 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -24,6 +24,7 @@ sbindir=@sbindir@ libdir=@libdir@ sysconfdir=@sysconfdir@ package_version=@PACKAGE_VERSION@ +datarootdir=@datarootdir@ datadir=@datadir@ pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` grub_prefix=`echo /boot/grub | sed ${transform}` @@ -161,17 +162,17 @@ case ${GRUB_TERMINAL_OUTPUT} in else continue fi - if [ "${basename}" = "ascii"] ; then + if [ "${basename}" = "ascii" ] ; then # make sure all our children behave in conformance with ascii.. export LANG=C fi break 2 done done - if [ -z "${GRUB_FONT_PATH}" ] ; then - # fallback to the native terminal for this platform - unset GRUB_TERMINAL_OUTPUT - fi + if [ -z "${GRUB_FONT_PATH}" ] ; then + # fallback to the native terminal for this platform + unset GRUB_TERMINAL_OUTPUT + fi ;; *) # make sure all our children behave in conformance with ascii.. From 2f5cb8278a707c3b047aace9c8c778a4c7c231e7 Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 8 Aug 2009 05:37:49 +0000 Subject: [PATCH 1018/1707] 2009-08-08 Pavel Roskin * util/grub-mkconfig_lib.in (version_test_numeric): Don't use the "g" modifier in sed when the intention is to strip something once. This fixes comparison of kernels with multiple dashes. --- ChangeLog | 4 ++++ util/grub-mkconfig_lib.in | 8 ++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c8a14664..3b252ee6b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2009-08-08 Pavel Roskin + * util/grub-mkconfig_lib.in (version_test_numeric): Don't use + the "g" modifier in sed when the intention is to strip something + once. This fixes comparison of kernels with multiple dashes. + * util/grub-mkconfig.in: Define datarootdir, datadir may depend on it. Add missing space before closing bracket. Fix misleading formatting. diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 99b3c9c6f..3585a68ef 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -185,16 +185,16 @@ version_test_numeric () version_test_gt () { - local a=`echo $1 | sed -e "s/[^-]*-//g"` - local b=`echo $2 | sed -e "s/[^-]*-//g"` + local a=`echo $1 | sed -e "s/[^-]*-//"` + local b=`echo $2 | sed -e "s/[^-]*-//"` local cmp=gt if [ "x$b" = "x" ] ; then return 0 fi case $a:$b in *.old:*.old) ;; - *.old:*) a=`echo -n $a | sed -e s/\.old$//g` ; cmp=gt ;; - *:*.old) b=`echo -n $b | sed -e s/\.old$//g` ; cmp=ge ;; + *.old:*) a=`echo -n $a | sed -e s/\.old$//` ; cmp=gt ;; + *:*.old) b=`echo -n $b | sed -e s/\.old$//` ; cmp=ge ;; esac version_test_numeric $a $cmp $b return $? From b5f16cc4cf838fa4c1b0b01ab045fdb5eef9df4e Mon Sep 17 00:00:00 2001 From: proski Date: Sat, 8 Aug 2009 05:58:23 +0000 Subject: [PATCH 1019/1707] 2009-08-08 Pavel Roskin * include/grub/powerpc/libgcc.h: Export __ashrdi3() if available, xfs.mod needs it now. --- ChangeLog | 3 +++ include/grub/powerpc/libgcc.h | 1 + 2 files changed, 4 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3b252ee6b..202e76b80 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-08-08 Pavel Roskin + * include/grub/powerpc/libgcc.h: Export __ashrdi3() if + available, xfs.mod needs it now. + * util/grub-mkconfig_lib.in (version_test_numeric): Don't use the "g" modifier in sed when the intention is to strip something once. This fixes comparison of kernels with multiple dashes. diff --git a/include/grub/powerpc/libgcc.h b/include/grub/powerpc/libgcc.h index bed937767..ea4b073a0 100644 --- a/include/grub/powerpc/libgcc.h +++ b/include/grub/powerpc/libgcc.h @@ -18,6 +18,7 @@ void EXPORT_FUNC (memset) (void) __attribute__ ((weak)); void EXPORT_FUNC (__ashldi3) (void) __attribute__ ((weak)); +void EXPORT_FUNC (__ashrdi3) (void) __attribute__ ((weak)); void EXPORT_FUNC (__lshrdi3) (void) __attribute__ ((weak)); void EXPORT_FUNC (__trampoline_setup) (void) __attribute__ ((weak)); void EXPORT_FUNC (__ucmpdi2) (void) __attribute__ ((weak)); From a78c8d240bbb261b3c93732835e59d54557f470d Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 8 Aug 2009 06:41:54 +0000 Subject: [PATCH 1020/1707] 2009-08-08 Felix Zielcke * util/grub-mkconfig.in: Allow the user to specify the used font with GRUB_FONT. --- ChangeLog | 5 +++++ util/grub-mkconfig.in | 33 +++++++++++++++++++++------------ 2 files changed, 26 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 202e76b80..cd782a218 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-08 Felix Zielcke + + * util/grub-mkconfig.in: Allow the user to specify the used font + with GRUB_FONT. + 2009-08-08 Pavel Roskin * include/grub/powerpc/libgcc.h: Export __ashrdi3() if diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 7756b492a..f20c9de69 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -154,21 +154,30 @@ esac # check for terminals that require fonts case ${GRUB_TERMINAL_OUTPUT} in gfxterm) - for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do - for basename in unicode unifont ascii; do - path="${dir}/${basename}.pf2" - if is_path_readable_by_grub ${path} > /dev/null ; then - GRUB_FONT_PATH=${path} + if [ -n "$GRUB_FONT" ] ; then + if is_path_readable_by_grub ${GRUB_FONT} > /dev/null ; then + GRUB_FONT_PATH=${GRUB_FONT} else - continue + echo "No such font or not readable by grub: ${GRUB_FONT}" >&2 + exit 1 fi - if [ "${basename}" = "ascii" ] ; then - # make sure all our children behave in conformance with ascii.. - export LANG=C - fi - break 2 + else + for dir in ${pkgdatadir} /boot/grub /usr/share/grub ; do + for basename in unicode unifont ascii; do + path="${dir}/${basename}.pf2" + if is_path_readable_by_grub ${path} > /dev/null ; then + GRUB_FONT_PATH=${path} + else + continue + fi + if [ "${basename}" = "ascii" ] ; then + # make sure all our children behave in conformance with ascii.. + export LANG=C + fi + break 2 + done done - done + fi if [ -z "${GRUB_FONT_PATH}" ] ; then # fallback to the native terminal for this platform unset GRUB_TERMINAL_OUTPUT From 1ebbe064d1ed74dabf28fa4e1db92d939608a9e7 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 8 Aug 2009 17:59:19 +0000 Subject: [PATCH 1021/1707] 2009-08-08 Felix Zielcke * util/grub.d/00_header.in: Fix a comment. * util/grub.d/10_linux.in: Likewise. * util/grub.d/10_windows.in: Likewise. * util/grub.d/10_hurd.in: Likewise. --- ChangeLog | 7 +++++++ util/grub.d/00_header.in | 2 +- util/grub.d/10_hurd.in | 2 +- util/grub.d/10_linux.in | 2 +- util/grub.d/10_windows.in | 2 +- 5 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index cd782a218..cf9d5db83 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-08 Felix Zielcke + + * util/grub.d/00_header.in: Fix a comment. + * util/grub.d/10_linux.in: Likewise. + * util/grub.d/10_windows.in: Likewise. + * util/grub.d/10_hurd.in: Likewise. + 2009-08-08 Felix Zielcke * util/grub-mkconfig.in: Allow the user to specify the used font diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index d8fa4165d..a273213f3 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -1,6 +1,6 @@ #! /bin/sh -e -# update-grub helper script. +# grub-mkconfig helper script. # Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index e72198da6..ec78a3532 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -1,6 +1,6 @@ #! /bin/sh -e -# update-grub helper script. +# grub-mkconfig helper script. # Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 4df078e8f..381a0c3d5 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -1,6 +1,6 @@ #! /bin/sh -e -# update-grub helper script. +# grub-mkconfig helper script. # Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify diff --git a/util/grub.d/10_windows.in b/util/grub.d/10_windows.in index 8877b15d5..055258e29 100644 --- a/util/grub.d/10_windows.in +++ b/util/grub.d/10_windows.in @@ -1,6 +1,6 @@ #! /bin/sh -e -# update-grub helper script. +# grub-mkconfig helper script. # Copyright (C) 2008 Free Software Foundation, Inc. # # GRUB is free software: you can redistribute it and/or modify From d1e1d52774dd005d8f1670283ecd86719db10e05 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 8 Aug 2009 18:53:49 +0000 Subject: [PATCH 1022/1707] 2009-08-08 Robert Millan * fs/jfs.c: Update copyright year. --- ChangeLog | 4 ++++ fs/jfs.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index cf9d5db83..f0b1781f6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-08 Robert Millan + + * fs/jfs.c: Update copyright year. + 2009-08-08 Felix Zielcke * util/grub.d/00_header.in: Fix a comment. diff --git a/fs/jfs.c b/fs/jfs.c index b38efed59..51ca91ad0 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -1,7 +1,7 @@ /* jfs.c - JFS. */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by From f5d35e7a4bb92ad1c76c24b10944480b3e44b364 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 8 Aug 2009 19:24:58 +0000 Subject: [PATCH 1023/1707] 2009-08-08 Robert Millan * util/grub-dumpdevtree: Moved from here ... * util/i386/efi/grub-dumpdevtree: ... to here. (hexify): New function. Converts a string to its hex version. Generate hex versions of "efi" and "device-properties" by calling hexify() on the ASCII strings rather than by hardcoding numbers. --- ChangeLog | 8 ++++++++ util/grub-dumpdevtree | 3 --- util/i386/efi/grub-dumpdevtree | 25 +++++++++++++++++++++++++ 3 files changed, 33 insertions(+), 3 deletions(-) delete mode 100644 util/grub-dumpdevtree create mode 100644 util/i386/efi/grub-dumpdevtree diff --git a/ChangeLog b/ChangeLog index f0b1781f6..6ffa0d779 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-08 Robert Millan + + * util/grub-dumpdevtree: Moved from here ... + * util/i386/efi/grub-dumpdevtree: ... to here. + (hexify): New function. Converts a string to its hex version. + Generate hex versions of "efi" and "device-properties" by calling + hexify() on the ASCII strings rather than by hardcoding numbers. + 2009-08-08 Robert Millan * fs/jfs.c: Update copyright year. diff --git a/util/grub-dumpdevtree b/util/grub-dumpdevtree deleted file mode 100644 index ca1a6a907..000000000 --- a/util/grub-dumpdevtree +++ /dev/null @@ -1,3 +0,0 @@ -echo "656669{ 6465766963652d70726f70657274696573:" -ioreg -lw0 -p IODeviceTree -n efi -r -x |grep device-properties | sed 's/.*.*//;' -echo ";}" diff --git a/util/i386/efi/grub-dumpdevtree b/util/i386/efi/grub-dumpdevtree new file mode 100644 index 000000000..bc13e3c35 --- /dev/null +++ b/util/i386/efi/grub-dumpdevtree @@ -0,0 +1,25 @@ +#!/bin/sh +# +# Copyright (C) 2009 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +hexify() +{ + echo -n "$@" | od -A n -t x1 - | sed -e 's/ //g' | tr '\n' '\0' +} + +echo "`hexify efi`{ `hexify device-properties`:" +ioreg -lw0 -p IODeviceTree -n efi -r -x |grep device-properties | sed 's/.*.*//;' +echo ";}" From 81623db67750b0e476c2d4809307bfb7839d351a Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 10 Aug 2009 15:42:39 +0000 Subject: [PATCH 1024/1707] 2009-08-10 Robert Millan * include/grub/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD) (KERNEL_TYPE_OPENBSD, KERNEL_TYPE_NETBSD): Convert to ... (bsd_kernel_types): ... this enum. * loader/i386/bsd.c (grub_cmd_freebsd_loadenv, grub_cmd_freebsd_module) (grub_cmd_freebsd_module_elf): Abort with "You need to load the kernel first." when `kernel_type' is set to KERNEL_TYPE_NONE. (grub_bsd_load_aout, grub_bsd_load, grub_cmd_freebsd_loadenv) (grub_cmd_freebsd_module, grub_cmd_freebsd_module_elf) (GRUB_MOD_INIT (bsd)): Fix capitalization in a few error messages. --- ChangeLog | 15 +++++++++++++ include/grub/i386/bsd.h | 13 ++++++----- loader/i386/bsd.c | 48 +++++++++++++++++++++++++---------------- 3 files changed, 53 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ffa0d779..675cc6d7f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-08-10 Robert Millan + + * include/grub/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD) + (KERNEL_TYPE_OPENBSD, KERNEL_TYPE_NETBSD): Convert to ... + (bsd_kernel_types): ... this enum. + + * loader/i386/bsd.c (grub_cmd_freebsd_loadenv, grub_cmd_freebsd_module) + (grub_cmd_freebsd_module_elf): Abort with "You need to load the + kernel first." when `kernel_type' is set to KERNEL_TYPE_NONE. + + (grub_bsd_load_aout, grub_bsd_load, grub_cmd_freebsd_loadenv) + (grub_cmd_freebsd_module, grub_cmd_freebsd_module_elf) + (GRUB_MOD_INIT (bsd)): Fix capitalization in a few error + messages. + 2009-08-08 Robert Millan * util/grub-dumpdevtree: Moved from here ... diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index 3130697af..117ed5c68 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -21,10 +21,13 @@ #include -#define KERNEL_TYPE_NONE 0 -#define KERNEL_TYPE_FREEBSD 1 -#define KERNEL_TYPE_OPENBSD 2 -#define KERNEL_TYPE_NETBSD 3 +enum bsd_kernel_types + { + KERNEL_TYPE_NONE, + KERNEL_TYPE_FREEBSD, + KERNEL_TYPE_OPENBSD, + KERNEL_TYPE_NETBSD, + }; #define GRUB_BSD_TEMP_BUFFER 0x68000 diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 468e6d0cf..5badb7932 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -47,7 +47,7 @@ #define MOD_BUF_ALLOC_UNIT 4096 -static int kernel_type; +static int kernel_type = KERNEL_TYPE_NONE; static grub_dl_t my_mod; static grub_addr_t entry, entry_hi, kern_start, kern_end; static grub_uint32_t bootflags; @@ -614,10 +614,10 @@ grub_bsd_load_aout (grub_file_t file) return grub_errno; if (grub_file_read (file, &ah, sizeof (ah)) != sizeof (ah)) - return grub_error (GRUB_ERR_READ_ERROR, "cannot read the a.out header"); + return grub_error (GRUB_ERR_READ_ERROR, "Cannot read the a.out header"); if (grub_aout_get_type (&ah) != AOUT_TYPE_AOUT32) - return grub_error (GRUB_ERR_BAD_OS, "invalid a.out header"); + return grub_error (GRUB_ERR_BAD_OS, "Invalid a.out header"); entry = ah.aout32.a_entry & 0xFFFFFF; @@ -635,7 +635,7 @@ grub_bsd_load_aout (grub_file_t file) } if (load_addr < 0x100000) - return grub_error (GRUB_ERR_BAD_OS, "load address below 1M"); + return grub_error (GRUB_ERR_BAD_OS, "Load address below 1M"); kern_start = load_addr; kern_end = load_addr + ah.aout32.a_text + ah.aout32.a_data; @@ -738,7 +738,7 @@ grub_bsd_load_elf (grub_elf_t elf) return grub_elf64_load (elf, grub_bsd_elf64_hook, 0, 0); } else - return grub_error (GRUB_ERR_BAD_OS, "invalid elf"); + return grub_error (GRUB_ERR_BAD_OS, "Invalid elf"); } static grub_err_t @@ -753,7 +753,7 @@ grub_bsd_load (int argc, char *argv[]) if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no kernel specified"); + grub_error (GRUB_ERR_BAD_ARGUMENT, "No kernel specified"); goto fail; } @@ -914,13 +914,17 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), char *buf = 0, *curr, *next; int len; + if (kernel_type == KERNEL_TYPE_NONE) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "You need to load the kernel first."); + if (kernel_type != KERNEL_TYPE_FREEBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, - "only freebsd support environment"); + "Only FreeBSD support environment"); if (argc == 0) { - grub_error (GRUB_ERR_BAD_ARGUMENT, "no filename"); + grub_error (GRUB_ERR_BAD_ARGUMENT, "No filename"); goto fail; } @@ -1004,13 +1008,17 @@ grub_cmd_freebsd_module (grub_command_t cmd __attribute__ ((unused)), char **modargv; char *type; + if (kernel_type == KERNEL_TYPE_NONE) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "You need to load the kernel first."); + if (kernel_type != KERNEL_TYPE_FREEBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, - "only freebsd support module"); + "Only FreeBSD support module"); if (!is_elf_kernel) return grub_error (GRUB_ERR_BAD_ARGUMENT, - "only elf kernel support module"); + "Only ELF kernel support module"); /* List the current modules if no parameter. */ if (!argc) @@ -1066,13 +1074,17 @@ grub_cmd_freebsd_module_elf (grub_command_t cmd __attribute__ ((unused)), grub_file_t file = 0; grub_err_t err; + if (kernel_type == KERNEL_TYPE_NONE) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "You need to load the kernel first."); + if (kernel_type != KERNEL_TYPE_FREEBSD) return grub_error (GRUB_ERR_BAD_ARGUMENT, - "only freebsd support module"); + "Only FreeBSD support module"); if (! is_elf_kernel) return grub_error (GRUB_ERR_BAD_ARGUMENT, - "only elf kernel support module"); + "Only ELF kernel support module"); /* List the current modules if no parameter. */ if (! argc) @@ -1108,22 +1120,22 @@ GRUB_MOD_INIT (bsd) { cmd_freebsd = grub_register_command ("freebsd", grub_cmd_freebsd, - 0, "load freebsd kernel"); + 0, "load kernel of FreeBSD"); cmd_openbsd = grub_register_command ("openbsd", grub_cmd_openbsd, - 0, "load openbsd kernel"); + 0, "load kernel of OpenBSD"); cmd_netbsd = grub_register_command ("netbsd", grub_cmd_netbsd, - 0, "load netbsd kernel"); + 0, "load kernel of NetBSD"); cmd_freebsd_loadenv = grub_register_command ("freebsd_loadenv", grub_cmd_freebsd_loadenv, - 0, "load freebsd env"); + 0, "load FreeBSD env"); cmd_freebsd_module = grub_register_command ("freebsd_module", grub_cmd_freebsd_module, - 0, "load freebsd module"); + 0, "load FreeBSD kernel module"); cmd_freebsd_module_elf = grub_register_command ("freebsd_module_elf", grub_cmd_freebsd_module_elf, - 0, "load freebsd ELF module"); + 0, "load FreeBSD kernel module (ELF)"); my_mod = mod; } From 1f9e557e393128d47c69679fd797c034ae000c55 Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 13 Aug 2009 05:34:39 +0000 Subject: [PATCH 1025/1707] 2009-08-13 Pavel Roskin * boot/i386/pc/boot.S: Remove all code dependent on APPLE_CC. Use local labels starting with "L_" so that Apple assembler knows they are local. --- ChangeLog | 6 +++ boot/i386/pc/boot.S | 110 +++++++++++++------------------------------- 2 files changed, 38 insertions(+), 78 deletions(-) diff --git a/ChangeLog b/ChangeLog index 675cc6d7f..9e84e542a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-13 Pavel Roskin + + * boot/i386/pc/boot.S: Remove all code dependent on APPLE_CC. + Use local labels starting with "L_" so that Apple assembler + knows they are local. + 2009-08-10 Robert Millan * include/grub/i386/bsd.h (KERNEL_TYPE_NONE, KERNEL_TYPE_FREEBSD) diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 1fb5f7416..8a8f6c7cf 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -30,11 +30,7 @@ #define ABS(x) (x-_start+0x7c00) /* Print message string */ -#ifdef APPLE_CC -#define MSG(x) x ## _abs = ABS(x); movw $x ## _abs, %si; call message -#else -#define MSG(x) movw $ABS(x), %si; call message -#endif +#define MSG(x) movw $ABS(x), %si; call L_message .file "boot.S" @@ -56,7 +52,7 @@ start: * parameter block. */ - jmp after_BPB + jmp L_after_BPB nop /* do I care about this ??? */ /* @@ -104,7 +100,7 @@ boot_drive: .byte 0xff /* the disk to load kernel from */ /* 0xff means use the boot drive */ -after_BPB: +L_after_BPB: /* general setup */ cli /* we're not safe here! */ @@ -129,12 +125,7 @@ boot_drive_check: * ljmp to the next instruction because some bogus BIOSes * jump to 07C0:0000 instead of 0000:7C00. */ -#ifdef APPLE_CC - real_start_abs = ABS(real_start) - ljmp $0, $(real_start_abs) -#else ljmp $0, $ABS(real_start) -#endif real_start: @@ -151,12 +142,7 @@ real_start: /* * Check if we have a forced disk reference here */ -#ifdef APPLE_CC - boot_drive_abs = ABS (boot_drive) - movb boot_drive_abs, %al -#else movb ABS(boot_drive), %al -#endif cmpb $0xff, %al je 1f movb %al, %dl @@ -168,16 +154,11 @@ real_start: MSG(notification_string) /* set %si to the disk address packet */ -#ifdef APPLE_CC - disk_address_packet_abs = ABS (disk_address_packet) - movw $disk_address_packet_abs, %si -#else movw $ABS(disk_address_packet), %si -#endif /* do not probe LBA if the drive is a floppy */ testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl - jz chs_mode + jz L_chs_mode /* check if LBA is supported */ movb $0x41, %ah @@ -192,12 +173,12 @@ real_start: pushw %dx /* use CHS if fails */ - jc chs_mode + jc L_chs_mode cmpw $0xaa55, %bx - jne chs_mode + jne L_chs_mode andw $1, %cx - jz chs_mode + jz L_chs_mode lba_mode: xorw %ax, %ax @@ -214,18 +195,10 @@ lba_mode: movw $0x0010, (%si) /* the absolute address */ -#ifdef APPLE_CC - kernel_sector_abs = ABS (kernel_sector) - movl (kernel_sector_abs), %ebx - movl %ebx, 8(%si) - movl (kernel_sector_abs + 4), %ebx - movl %ebx, 12(%si) -#else movl ABS(kernel_sector), %ebx movl %ebx, 8(%si) movl ABS(kernel_sector + 4), %ebx movl %ebx, 12(%si) -#endif /* the segment of buffer address */ movw $GRUB_BOOT_MACHINE_BUFFER_SEG, 6(%si) @@ -243,30 +216,30 @@ lba_mode: int $0x13 /* LBA read is not supported, so fallback to CHS. */ - jc chs_mode + jc L_chs_mode movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx - jmp copy_buffer + jmp L_copy_buffer -chs_mode: +L_chs_mode: /* * Determine the hard disk geometry from the BIOS! * We do this first, so that LS-120 IDE floppies work correctly. */ movb $8, %ah int $0x13 - jnc final_init + jnc L_final_init /* * The call failed, so maybe use the floppy probe instead. */ testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl - jz floppy_probe + jz L_floppy_probe /* Nope, we definitely have a hard disk, and we're screwed. */ - jmp hd_probe_error + jmp L_hd_probe_error -final_init: +L_final_init: /* set the mode to zero */ movzbl %dh, %eax movb %ah, -1(%si) @@ -292,22 +265,13 @@ final_init: setup_sectors: /* load logical sector start (top half) */ -#ifdef APPLE_CC - kernel_sector_abs = ABS (kernel_sector) - movl (kernel_sector_abs + 4), %eax -#else movl ABS(kernel_sector + 4), %eax -#endif orl %eax, %eax - jnz geometry_error + jnz L_geometry_error /* load logical sector start (bottom half) */ -#ifdef APPLE_CC - movl (kernel_sector_abs), %eax -#else movl ABS(kernel_sector), %eax -#endif /* zero %edx */ xorl %edx, %edx @@ -323,7 +287,7 @@ setup_sectors: /* do we need too many cylinders? */ cmpw 8(%si), %ax - jge geometry_error + jge L_geometry_error /* normalize sector start (1-based) */ incb %cl @@ -365,11 +329,11 @@ setup_sectors: movw $0x0201, %ax /* function 2 */ int $0x13 - jc read_error + jc L_read_error movw %es, %bx -copy_buffer: +L_copy_buffer: /* * We need to save %cx and %si because the startup code in * kernel uses them without initializing them. @@ -392,42 +356,37 @@ copy_buffer: popa /* boot kernel */ -#ifdef APPLE_CC - kernel_address_abs = ABS (kernel_address) - jmp *(kernel_address_abs) -#else jmp *(kernel_address) -#endif /* END OF MAIN LOOP */ /* * BIOS Geometry translation error (past the end of the disk geometry!). */ -geometry_error: +L_geometry_error: MSG(geometry_error_string) - jmp general_error + jmp L_general_error /* * Disk probe failure. */ -hd_probe_error: +L_hd_probe_error: MSG(hd_probe_error_string) - jmp general_error + jmp L_general_error /* * Read error on the disk. */ -read_error: +L_read_error: MSG(read_error_string) -general_error: +L_general_error: MSG(general_error_string) /* go here when you need to stop the machine hard after an error condition */ /* tell the BIOS a boot failure, which may result in no effect */ int $0x18 -stop: jmp stop +L_stop: jmp L_stop notification_string: .asciz "GRUB " geometry_error_string: .asciz "Geom" @@ -450,7 +409,7 @@ general_error_string: .asciz " Error\r\n" movw $0x0001, %bx movb $0xe, %ah int $0x10 /* display a byte */ -message: +L_message: lodsb cmpb $0, %al jne 1b /* if not end of string, jmp to display */ @@ -478,19 +437,14 @@ part_start: probe_values: .byte 36, 18, 15, 9, 0 -floppy_probe: +L_floppy_probe: /* * Perform floppy probe. */ -#ifdef APPLE_CC - probe_values_abs = ABS (probe_values) - movw $(probe_values_abs-1), %si -#else movw $ABS(probe_values-1), %si -#endif -probe_loop: +L_probe_loop: /* reset floppy controller INT 13h AH=0 */ xorw %ax, %ax int $0x13 @@ -506,7 +460,7 @@ probe_loop: * Floppy disk probe failure. */ MSG(fd_probe_error_string) - jmp general_error + jmp L_general_error /* "Floppy" */ fd_probe_error_string: .asciz "Floppy" @@ -519,14 +473,14 @@ fd_probe_error_string: .asciz "Floppy" movb $0, %dh int $0x13 - /* if error, jump to "probe_loop" */ - jc probe_loop + /* if error, jump to "L_probe_loop" */ + jc L_probe_loop /* %cl is already the correct value! */ movb $1, %dh movb $79, %ch - jmp final_init + jmp L_final_init . = _start + GRUB_BOOT_MACHINE_PART_END From 9ca628433162d4328a76806156ce35cb05f8971a Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 13 Aug 2009 05:43:14 +0000 Subject: [PATCH 1026/1707] 2009-08-13 Pavel Roskin * boot/i386/pc/boot.S: Remove ABS macro, it's not required by any modern compilers we support. --- ChangeLog | 3 +++ boot/i386/pc/boot.S | 23 +++++++++-------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9e84e542a..d07648549 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-08-13 Pavel Roskin + * boot/i386/pc/boot.S: Remove ABS macro, it's not required by + any modern compilers we support. + * boot/i386/pc/boot.S: Remove all code dependent on APPLE_CC. Use local labels starting with "L_" so that Apple assembler knows they are local. diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 8a8f6c7cf..77319a71f 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -24,13 +24,8 @@ * defines for the code go here */ - /* Absolute addresses - This makes the assembler generate the address without support - from the linker. (ELF can't relocate 16-bit addresses!) */ -#define ABS(x) (x-_start+0x7c00) - /* Print message string */ -#define MSG(x) movw $ABS(x), %si; call L_message +#define MSG(x) movw $x, %si; call L_message .file "boot.S" @@ -125,7 +120,7 @@ boot_drive_check: * ljmp to the next instruction because some bogus BIOSes * jump to 07C0:0000 instead of 0000:7C00. */ - ljmp $0, $ABS(real_start) + ljmp $0, $real_start real_start: @@ -142,7 +137,7 @@ real_start: /* * Check if we have a forced disk reference here */ - movb ABS(boot_drive), %al + movb boot_drive, %al cmpb $0xff, %al je 1f movb %al, %dl @@ -154,7 +149,7 @@ real_start: MSG(notification_string) /* set %si to the disk address packet */ - movw $ABS(disk_address_packet), %si + movw $disk_address_packet, %si /* do not probe LBA if the drive is a floppy */ testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl @@ -195,9 +190,9 @@ lba_mode: movw $0x0010, (%si) /* the absolute address */ - movl ABS(kernel_sector), %ebx + movl kernel_sector, %ebx movl %ebx, 8(%si) - movl ABS(kernel_sector + 4), %ebx + movl kernel_sector + 4, %ebx movl %ebx, 12(%si) /* the segment of buffer address */ @@ -265,13 +260,13 @@ L_final_init: setup_sectors: /* load logical sector start (top half) */ - movl ABS(kernel_sector + 4), %eax + movl kernel_sector + 4, %eax orl %eax, %eax jnz L_geometry_error /* load logical sector start (bottom half) */ - movl ABS(kernel_sector), %eax + movl kernel_sector, %eax /* zero %edx */ xorl %edx, %edx @@ -442,7 +437,7 @@ L_floppy_probe: * Perform floppy probe. */ - movw $ABS(probe_values-1), %si + movw $probe_values - 1, %si L_probe_loop: /* reset floppy controller INT 13h AH=0 */ From be3c9ca7cb874adb88c364836ae4f9cab83c0e6c Mon Sep 17 00:00:00 2001 From: proski Date: Thu, 13 Aug 2009 06:09:39 +0000 Subject: [PATCH 1027/1707] 2009-08-13 Yves Blusseau * include/grub/symbol.h: Add the LOCAL macro. * boot/i386/pc/boot.S: Use the LOCAL macro for all labels starting with "L_". --- ChangeLog | 6 ++++ boot/i386/pc/boot.S | 66 ++++++++++++++++++++++--------------------- include/grub/symbol.h | 3 ++ 3 files changed, 43 insertions(+), 32 deletions(-) diff --git a/ChangeLog b/ChangeLog index d07648549..4aeacf68a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-13 Yves Blusseau + + * include/grub/symbol.h: Add the LOCAL macro. + * boot/i386/pc/boot.S: Use the LOCAL macro for all labels + starting with "L_". + 2009-08-13 Pavel Roskin * boot/i386/pc/boot.S: Remove ABS macro, it's not required by diff --git a/boot/i386/pc/boot.S b/boot/i386/pc/boot.S index 77319a71f..865326ee2 100644 --- a/boot/i386/pc/boot.S +++ b/boot/i386/pc/boot.S @@ -17,6 +17,7 @@ * along with GRUB. If not, see . */ +#include #include #include @@ -25,7 +26,7 @@ */ /* Print message string */ -#define MSG(x) movw $x, %si; call L_message +#define MSG(x) movw $x, %si; call LOCAL(message) .file "boot.S" @@ -47,7 +48,7 @@ start: * parameter block. */ - jmp L_after_BPB + jmp LOCAL(after_BPB) nop /* do I care about this ??? */ /* @@ -95,7 +96,7 @@ boot_drive: .byte 0xff /* the disk to load kernel from */ /* 0xff means use the boot drive */ -L_after_BPB: +LOCAL(after_BPB): /* general setup */ cli /* we're not safe here! */ @@ -153,7 +154,7 @@ real_start: /* do not probe LBA if the drive is a floppy */ testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl - jz L_chs_mode + jz LOCAL(chs_mode) /* check if LBA is supported */ movb $0x41, %ah @@ -168,12 +169,12 @@ real_start: pushw %dx /* use CHS if fails */ - jc L_chs_mode + jc LOCAL(chs_mode) cmpw $0xaa55, %bx - jne L_chs_mode + jne LOCAL(chs_mode) andw $1, %cx - jz L_chs_mode + jz LOCAL(chs_mode) lba_mode: xorw %ax, %ax @@ -211,30 +212,30 @@ lba_mode: int $0x13 /* LBA read is not supported, so fallback to CHS. */ - jc L_chs_mode + jc LOCAL(chs_mode) movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx - jmp L_copy_buffer + jmp LOCAL(copy_buffer) -L_chs_mode: +LOCAL(chs_mode): /* * Determine the hard disk geometry from the BIOS! * We do this first, so that LS-120 IDE floppies work correctly. */ movb $8, %ah int $0x13 - jnc L_final_init + jnc LOCAL(final_init) /* * The call failed, so maybe use the floppy probe instead. */ testb $GRUB_BOOT_MACHINE_BIOS_HD_FLAG, %dl - jz L_floppy_probe + jz LOCAL(floppy_probe) /* Nope, we definitely have a hard disk, and we're screwed. */ - jmp L_hd_probe_error + jmp LOCAL(hd_probe_error) -L_final_init: +LOCAL(final_init): /* set the mode to zero */ movzbl %dh, %eax movb %ah, -1(%si) @@ -263,7 +264,7 @@ setup_sectors: movl kernel_sector + 4, %eax orl %eax, %eax - jnz L_geometry_error + jnz LOCAL(geometry_error) /* load logical sector start (bottom half) */ movl kernel_sector, %eax @@ -282,7 +283,7 @@ setup_sectors: /* do we need too many cylinders? */ cmpw 8(%si), %ax - jge L_geometry_error + jge LOCAL(geometry_error) /* normalize sector start (1-based) */ incb %cl @@ -324,11 +325,11 @@ setup_sectors: movw $0x0201, %ax /* function 2 */ int $0x13 - jc L_read_error + jc LOCAL(read_error) movw %es, %bx -L_copy_buffer: +LOCAL(copy_buffer): /* * We need to save %cx and %si because the startup code in * kernel uses them without initializing them. @@ -358,30 +359,31 @@ L_copy_buffer: /* * BIOS Geometry translation error (past the end of the disk geometry!). */ -L_geometry_error: +LOCAL(geometry_error): MSG(geometry_error_string) - jmp L_general_error + jmp LOCAL(general_error) /* * Disk probe failure. */ -L_hd_probe_error: +LOCAL(hd_probe_error): MSG(hd_probe_error_string) - jmp L_general_error + jmp LOCAL(general_error) /* * Read error on the disk. */ -L_read_error: +LOCAL(read_error): MSG(read_error_string) -L_general_error: +LOCAL(general_error): MSG(general_error_string) /* go here when you need to stop the machine hard after an error condition */ /* tell the BIOS a boot failure, which may result in no effect */ int $0x18 -L_stop: jmp L_stop +LOCAL(stop): + jmp LOCAL(stop) notification_string: .asciz "GRUB " geometry_error_string: .asciz "Geom" @@ -404,7 +406,7 @@ general_error_string: .asciz " Error\r\n" movw $0x0001, %bx movb $0xe, %ah int $0x10 /* display a byte */ -L_message: +LOCAL(message): lodsb cmpb $0, %al jne 1b /* if not end of string, jmp to display */ @@ -432,14 +434,14 @@ part_start: probe_values: .byte 36, 18, 15, 9, 0 -L_floppy_probe: +LOCAL(floppy_probe): /* * Perform floppy probe. */ movw $probe_values - 1, %si -L_probe_loop: +LOCAL(probe_loop): /* reset floppy controller INT 13h AH=0 */ xorw %ax, %ax int $0x13 @@ -455,7 +457,7 @@ L_probe_loop: * Floppy disk probe failure. */ MSG(fd_probe_error_string) - jmp L_general_error + jmp LOCAL(general_error) /* "Floppy" */ fd_probe_error_string: .asciz "Floppy" @@ -468,14 +470,14 @@ fd_probe_error_string: .asciz "Floppy" movb $0, %dh int $0x13 - /* if error, jump to "L_probe_loop" */ - jc L_probe_loop + /* if error, jump to "LOCAL(probe_loop)" */ + jc LOCAL(probe_loop) /* %cl is already the correct value! */ movb $1, %dh movb $79, %ch - jmp L_final_init + jmp LOCAL(final_init) . = _start + GRUB_BOOT_MACHINE_PART_END diff --git a/include/grub/symbol.h b/include/grub/symbol.h index 68d9f00e9..6bf512d12 100644 --- a/include/grub/symbol.h +++ b/include/grub/symbol.h @@ -21,6 +21,9 @@ #include +/* Apple assembler requires local labels to start with a capital L */ +#define LOCAL(sym) L_ ## sym + /* Add an underscore to a C symbol in assembler code if needed. */ #ifdef HAVE_ASM_USCORE # define EXT_C(sym) _ ## sym From 9a10df160ee55b6f664b3ef2d74c4bb1defe660d Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 13 Aug 2009 20:08:23 +0000 Subject: [PATCH 1028/1707] 2009-08-13 Colin Watson * util/grub-mkconfig.in: Export GRUB_HIDDEN_TIMEOUT. * util/grub.d/00_header.in: Enter interruptible sleep if GRUB_HIDDEN_TIMEOUT is set. --- ChangeLog | 6 ++++++ util/grub-mkconfig.in | 22 ++++++++++++++++++++-- util/grub.d/00_header.in | 18 +++++++++++++++++- 3 files changed, 43 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4aeacf68a..ab51146e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-13 Colin Watson + + * util/grub-mkconfig.in: Export GRUB_HIDDEN_TIMEOUT. + * util/grub.d/00_header.in: Enter interruptible sleep if + GRUB_HIDDEN_TIMEOUT is set. + 2009-08-13 Yves Blusseau * include/grub/symbol.h: Add the LOCAL macro. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index f20c9de69..5865b89ce 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -190,10 +190,28 @@ esac # These are defined in this script, export them here so that user can # override them. -export GRUB_DEVICE GRUB_DEVICE_UUID GRUB_DEVICE_BOOT GRUB_DEVICE_BOOT_UUID GRUB_FS GRUB_FONT_PATH GRUB_PRELOAD_MODULES +export GRUB_DEVICE \ + GRUB_DEVICE_UUID \ + GRUB_DEVICE_BOOT \ + GRUB_DEVICE_BOOT_UUID \ + GRUB_FS \ + GRUB_FONT_PATH \ + GRUB_PRELOAD_MODULES # These are optional, user-defined variables. -export GRUB_DEFAULT GRUB_TIMEOUT GRUB_DISTRIBUTOR GRUB_CMDLINE_LINUX GRUB_CMDLINE_LINUX_DEFAULT GRUB_TERMINAL_INPUT GRUB_TERMINAL_OUTPUT GRUB_SERIAL_COMMAND GRUB_DISABLE_LINUX_UUID GRUB_DISABLE_LINUX_RECOVERY GRUB_GFXMODE +export GRUB_DEFAULT \ + GRUB_HIDDEN_TIMEOUT \ + GRUB_HIDDEN_TIMEOUT_QUIET \ + GRUB_TIMEOUT \ + GRUB_DISTRIBUTOR \ + GRUB_CMDLINE_LINUX \ + GRUB_CMDLINE_LINUX_DEFAULT \ + GRUB_TERMINAL_INPUT \ + GRUB_TERMINAL_OUTPUT \ + GRUB_SERIAL_COMMAND \ + GRUB_DISABLE_LINUX_UUID \ + GRUB_DISABLE_LINUX_RECOVERY \ + GRUB_GFXMODE if test "x${grub_cfg}" != "x"; then rm -f ${grub_cfg}.new diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index a273213f3..98c7c004b 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -37,7 +37,6 @@ if [ "x${GRUB_GFXMODE}" = "x" ] ; then GRUB_GFXMODE=640x480 ; fi cat << EOF set default=${GRUB_DEFAULT} -set timeout=${GRUB_TIMEOUT} EOF case ${GRUB_TERMINAL_INPUT}:${GRUB_TERMINAL_OUTPUT} in @@ -112,3 +111,20 @@ fi EOF ;; esac + +if [ "x${GRUB_HIDDEN_TIMEOUT}" != "x" ] ; then + if [ "x${GRUB_HIDDEN_TIMEOUT_QUIET}" = "xtrue" ] ; then + verbose= + else + verbose=" --verbose" + fi + cat << EOF +if sleep$verbose --interruptible ${GRUB_HIDDEN_TIMEOUT} ; then + set timeout=${GRUB_TIMEOUT} +fi +EOF +else + cat << EOF +set timeout=${GRUB_TIMEOUT} +EOF +fi From d404ee564609f542e2607eebdfdf3873dcfb1966 Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 14 Aug 2009 04:12:22 +0000 Subject: [PATCH 1029/1707] 2009-08-14 Pavel Roskin * boot/i386/pc/cdboot.S: Use LOCAL for local labels. Eliminate ABS and APPLE_CC. * boot/i386/pc/diskboot.S: Likewise. * boot/i386/pc/lnxboot.S: Likewise. Hardcode the number of code sectors allow compilation on MacOSX. * conf/i386-pc.rmk: Enable unconditional compilation of lnxboot.img. --- ChangeLog | 10 ++++ boot/i386/pc/cdboot.S | 33 ++++-------- boot/i386/pc/diskboot.S | 64 +++++++++------------- boot/i386/pc/lnxboot.S | 114 ++++++---------------------------------- conf/i386-pc.rmk | 6 +-- 5 files changed, 63 insertions(+), 164 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab51146e8..a05df9c59 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-08-14 Pavel Roskin + + * boot/i386/pc/cdboot.S: Use LOCAL for local labels. Eliminate + ABS and APPLE_CC. + * boot/i386/pc/diskboot.S: Likewise. + * boot/i386/pc/lnxboot.S: Likewise. Hardcode the number of code + sectors allow compilation on MacOSX. + * conf/i386-pc.rmk: Enable unconditional compilation of + lnxboot.img. + 2009-08-13 Colin Watson * util/grub-mkconfig.in: Export GRUB_HIDDEN_TIMEOUT. diff --git a/boot/i386/pc/cdboot.S b/boot/i386/pc/cdboot.S index efa65f511..ccc9d64de 100644 --- a/boot/i386/pc/cdboot.S +++ b/boot/i386/pc/cdboot.S @@ -17,6 +17,7 @@ * along with GRUB. If not, see . */ +#include #include #include #include @@ -38,9 +39,9 @@ start: _start: - call next + call LOCAL(next) -next: +LOCAL(next): jmp 1f . = start + 8 @@ -67,24 +68,17 @@ bi_reserved: movw %ax, %ds movw %ax, %es -#ifdef APPLE_CC - err_noboot_msg_abs = 0x7C00 + err_noboot_msg - start - movw $err_noboot_msg_abs, %si - bi_length_dif = bi_length - next - movl %cs:bi_length_dif(%bx), %ecx -#else movw $(0x7C00 + err_noboot_msg - start), %si - movl %cs: bi_length - next(%bx), %ecx -#endif + movl %cs: bi_length - LOCAL(next)(%bx), %ecx orl %ecx, %ecx - jz fail + jz LOCAL(fail) addl $((1 << CDSEC_SHIFT) - 1), %ecx shrl $CDSEC_SHIFT, %ecx - movl %cs: bi_file - next(%bx), %esi + movl %cs: bi_file - LOCAL(next)(%bx), %esi - call read_cdrom + call LOCAL(read_cdrom) ljmp $(DATA_ADDR >> 4), $0 @@ -93,7 +87,7 @@ bi_reserved: * esi: start sector * ecx: number of sectors */ -read_cdrom: +LOCAL(read_cdrom): xorl %eax, %eax /* Number of blocks to read. */ @@ -134,7 +128,7 @@ read_cdrom: 2: shrw $1, %di /* Reduce transfer size. */ - jz cdrom_fail + jz LOCAL(cdrom_fail) movw %di, 0x10(%si) movw %di, 2(%si) movb $0x42, %ah @@ -155,15 +149,10 @@ read_cdrom: addw $0x12, %sp ret -cdrom_fail: -#ifdef APPLE_CC - err_cdfail_msg_abs = 0x7C00 + err_cdfail_msg - start - movw $(err_cdfail_msg_abs), %si -#else +LOCAL(cdrom_fail): movw $(0x7C00 + err_cdfail_msg - start), %si -#endif -fail: +LOCAL(fail): movb $0x0e, %ah xorw %bx, %bx 1: diff --git a/boot/i386/pc/diskboot.S b/boot/i386/pc/diskboot.S index 1e817df27..e5e4a4ef3 100644 --- a/boot/i386/pc/diskboot.S +++ b/boot/i386/pc/diskboot.S @@ -16,23 +16,14 @@ * along with GRUB. If not, see . */ +#include #include /* * defines for the code go here */ - /* Absolute addresses - This makes the assembler generate the address without support - from the linker. (ELF can't relocate 16-bit addresses!) */ -#define ABS(x) (x-_start+GRUB_BOOT_MACHINE_KERNEL_ADDR) - - /* Print message string */ -#ifdef APPLE_CC -#define MSG(x) x ## _abs = ABS(x); mov $x ## _abs, %esi; call message -#else -#define MSG(x) movw $ABS(x), %si; call message -#endif +#define MSG(x) movw $x, %si; call LOCAL(message) .file "diskboot.S" @@ -65,33 +56,27 @@ _start: popw %si /* this sets up for the first run through "bootloop" */ -#ifdef APPLE_CC - firstlist_off_abs = ABS (firstlist - GRUB_BOOT_MACHINE_LIST_SIZE) - movl $firstlist_off_abs, %edi -#else - movw $ABS(firstlist - GRUB_BOOT_MACHINE_LIST_SIZE), %di -#endif + movw $(firstlist - GRUB_BOOT_MACHINE_LIST_SIZE), %di /* save the sector number of the second sector in %ebp */ movl (%di), %ebp /* this is the loop for reading the rest of the kernel in */ -bootloop: +LOCAL(bootloop): /* check the number of sectors to read */ cmpw $0, 8(%di) /* if zero, go to the start function */ - je bootit + je LOCAL(bootit) -setup_sectors: +LOCAL(setup_sectors): /* check if we use LBA or CHS */ cmpb $0, -1(%si) - /* jump to chs_mode if zero */ - je chs_mode + /* use CHS if zero, LBA otherwise */ + je LOCAL(chs_mode) -lba_mode: /* load logical sector start */ movl (%di), %ebx movl 4(%di), %ecx @@ -150,16 +135,16 @@ lba_mode: movb $0x42, %ah int $0x13 - jc read_error + jc LOCAL(read_error) movw $GRUB_BOOT_MACHINE_BUFFER_SEG, %bx - jmp copy_buffer + jmp LOCAL(copy_buffer) -chs_mode: +LOCAL(chs_mode): /* load logical sector start (top half) */ movl 4(%di), %eax orl %eax, %eax - jnz geometry_error + jnz LOCAL(geometry_error) /* load logical sector start (bottom half) */ movl (%di), %eax @@ -184,7 +169,7 @@ chs_mode: /* do we need too many cylinders? */ cmpw 8(%si), %ax - jge geometry_error + jge LOCAL(geometry_error) /* determine the maximum sector length of this read */ movw (%si), %ax /* get number of sectors per track/head */ @@ -254,12 +239,12 @@ chs_mode: movb $0x2, %ah /* function 2 */ int $0x13 - jc read_error + jc LOCAL(read_error) /* save source segment */ movw %es, %bx -copy_buffer: +LOCAL(copy_buffer): /* load addresses for copy from disk buffer to destination */ movw 10(%di), %es /* load destination segment */ @@ -299,17 +284,17 @@ copy_buffer: /* check if finished with this dataset */ cmpw $0, 8(%di) - jne setup_sectors + jne LOCAL(setup_sectors) /* update position to load from */ subw $GRUB_BOOT_MACHINE_LIST_SIZE, %di /* jump to bootloop */ - jmp bootloop + jmp LOCAL(bootloop) /* END OF MAIN LOOP */ -bootit: +LOCAL(bootit): /* print a newline */ MSG(notification_done) popw %dx /* this makes sure %dl is our "boot" drive */ @@ -319,21 +304,21 @@ bootit: /* * BIOS Geometry translation error (past the end of the disk geometry!). */ -geometry_error: +LOCAL(geometry_error): MSG(geometry_error_string) - jmp general_error + jmp LOCAL(general_error) /* * Read error on the disk. */ -read_error: +LOCAL(read_error): MSG(read_error_string) -general_error: +LOCAL(general_error): MSG(general_error_string) /* go here when you need to stop the machine hard after an error condition */ -stop: jmp stop +LOCAL(stop): jmp LOCAL(stop) notification_string: .asciz "loading" @@ -361,12 +346,11 @@ general_error_string: .asciz " Error" int $0x10 /* display a byte */ incw %si -message: +LOCAL(message): movb (%si), %al cmpb $0, %al jne 1b /* if not end of string, jmp to display */ ret -lastlist: /* * This area is an empty space between the main body of code below which diff --git a/boot/i386/pc/lnxboot.S b/boot/i386/pc/lnxboot.S index 14bd0415e..c51741d42 100644 --- a/boot/i386/pc/lnxboot.S +++ b/boot/i386/pc/lnxboot.S @@ -18,6 +18,7 @@ */ #include +#include #include #include #include @@ -25,14 +26,8 @@ .file "lnxboot.S" -#ifdef APPLE_CC -#error Building lnxboot.img with Apple's as results in an unusable image -#endif - #define CODE_ADDR 0x6000 -#ifndef APPLE_CC -#define CODE_LENG (code_end - start) -#endif +#define CODE_SECTORS 1 #define DATA_ADDR ((GRUB_BOOT_MACHINE_KERNEL_ADDR) + 0x200) #define BLCK_LENG 0x4000 @@ -45,17 +40,12 @@ data_start: xorl %ebp, %ebp - jmp linux_next + jmp LOCAL(linux_next) . = data_start + 0x1F1 setup_sects: -/* Apple's cc can't fill this value. */ -#ifdef APPLE_CC - .byte 0 -#else - .byte (CODE_LENG >> 9) -#endif + .byte CODE_SECTORS root_flags: .word 0 syssize: @@ -74,7 +64,7 @@ boot_flag: start: _start: - jmp linux_init + jmp LOCAL(linux_init) .ascii "HdrS" /* Header signature. */ .word 0x0203 /* Header version number. */ @@ -132,40 +122,22 @@ reg_edx: data_leng: .long 0 -linux_init: - -#ifdef APPLE_CC - reg_edx_rel = reg_edx - start - code32_start_rel = code32_start - start - movw %cs:(reg_edx_rel), %dx - movl %cs:(code32_start_rel), %ebp -#else +LOCAL(linux_init): movw %cs:(reg_edx - start), %dx movl %cs:(code32_start - start), %ebp -#endif -linux_next: +LOCAL(linux_next): - call normalize + call LOCAL(normalize) -normalize: +LOCAL(normalize): popw %bx -#ifdef APPLE_CC - normalize_rel = normalize - start - subw $(normalize_rel), %bx -#else - subw $(normalize - start), %bx -#endif + subw $(LOCAL(normalize) - start), %bx shrw $4, %bx movw %cs, %ax addw %bx, %ax pushw %ax -#ifdef APPLE_CC - real_code_rel = real_code - start - pushw $(real_code_rel) -#else pushw $(real_code - start) -#endif lret /* Jump to real_code. */ real_code: @@ -191,13 +163,7 @@ real_code: rep movsl - -#ifdef APPLE_CC - real_code_2_rel = real_code_2 - start - ljmp $(CODE_ADDR >> 4), $(real_code_2_rel) -#else ljmp $(CODE_ADDR >> 4), $(real_code_2 - start) -#endif real_code_2: @@ -216,21 +182,14 @@ real_code_2: addl %ecx, %esi movl $DATA_ADDR, %edi - call move_memory + call LOCAL(move_memory) /* Check for multiboot signature. */ cmpl $MULTIBOOT_MAGIC, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_DATA_END) jz 1f -#ifdef APPLE_CC - ramdisk_image_rel = ramdisk_image - start - ramdisk_size_rel = ramdisk_size - start - movl (ramdisk_image_rel), %esi - movl (ramdisk_size_rel), %ecx -#else movl (ramdisk_image - start), %esi movl (ramdisk_size - start), %ecx -#endif movl $(DATA_ADDR - 0x200), %edi jmp 2f @@ -240,17 +199,11 @@ real_code_2: addl $(GRUB_KERNEL_MACHINE_RAW_SIZE - 0x200), %ecx 2: - call move_memory + call LOCAL(move_memory) movsbl %dh, %eax movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_DOS_PART) - -#ifdef APPLE_CC - reg_edx_rel = reg_edx - start - movsbl (reg_edx_rel + 2), %eax -#else movsbl (reg_edx + 2 - start), %eax -#endif movl %eax, %ss:(DATA_ADDR + GRUB_KERNEL_MACHINE_INSTALL_BSD_PART) movb $0xFF, %dh @@ -264,7 +217,7 @@ real_code_2: * ecx: number of bytes */ -move_memory: +LOCAL(move_memory): incl %ecx andb $0xFE, %cl pushw %dx @@ -279,28 +232,6 @@ move_memory: pushl %ecx movl %esi, %eax -#ifdef APPLE_CC - gdt_src1_rel = gdt_src1 - start - gdt_src2_rel = gdt_src2 - start - gdt_dst1_rel = gdt_dst1 - start - gdt_dst2_rel = gdt_dst2 - start - gdt_rel = gdt - start - - movw %si, (gdt_src1_rel) - shrl $16, %eax - movb %al, (gdt_src1_rel + 2) - movb %ah, (gdt_src2_rel) - - movl %edi, %eax - movw %di, (gdt_dst1_rel) - shrl $16, %eax - movb %al, (gdt_dst1_rel + 2) - movb %ah, (gdt_dst2_rel) - - movw $(gdt_rel), %si - movb $0x87, %ah - shrw $1, %cx -#else movw %si, (gdt_src1 - start) shrl $16, %eax movb %al, (gdt_src1 + 2 - start) @@ -315,7 +246,6 @@ move_memory: movw $(gdt - start), %si movb $0x87, %ah shrw $1, %cx -#endif int $0x15 @@ -325,13 +255,8 @@ move_memory: popl %esi jnc 2f -#ifdef APPLE_CC - err_int15_msg_rel = err_int15_msg - start - movw $(err_int15_msg_rel), %si -#else movw $(err_int15_msg - start), %si -#endif - jmp fail + jmp LOCAL(fail) 2: @@ -349,7 +274,7 @@ move_memory: * si: message */ -fail: +LOCAL(fail): movb $0x0e, %ah xorw %bx, %bx 1: @@ -362,11 +287,4 @@ fail: err_int15_msg: .ascii "move memory fails\0" - /* Unsupported feature in Apple's cc. */ -#ifndef APPLE_CC - . = (. & (~0x1FF)) + 0x1FF -#endif - - .byte 0 - -code_end: + . = _start + CODE_SECTORS * 512 diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 798aee231..b61ecaba5 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -10,7 +10,8 @@ COMMON_LDFLAGS = -m32 -nostdlib script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. -pkglib_IMAGES = boot.img diskboot.img kernel.img pxeboot.img cdboot.img +pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \ + pxeboot.img # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S @@ -31,9 +32,6 @@ diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)8000 diskboot_img_FORMAT = binary # For lnxboot.img. -ifeq ($(TARGET_APPLE_CC), 0) -pkglib_IMAGES += lnxboot.img -endif lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)6000 From d3539132cdea9ba20d29cf99b8759232ae6a29f0 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 14 Aug 2009 12:41:58 +0000 Subject: [PATCH 1030/1707] 2009-08-14 Vladimir Serbinenko Framebuffer split. * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video subsystem at the end. * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. (video_fb_mod_SOURCES): New variable. (video_fb_mod_CFLAGS): Likewise. (video_fb_mod_LDFLAGS): Likewise. * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. * video/i386/pc/vbeblit.c: Moved from here ... * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbefill.c: Moved from here ... * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbeutil.c: Moved from here ... * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeblit.h: Moved from here ... * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbefill.h: Moved from here ... * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbeutil.h: Moved from here ... * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/i386/pc/vbe.h: Moved framebuffer part ... * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. (grub_video_adapter): Added 'get_info_and_fini'. (grub_video_get_info_and_fini): New prototype. (grub_video_set_mode): make modestring const char *. * loader/i386/linux.c (grub_linux_setup_video): Use grub_video_get_info_and_fini. (grub_linux_boot): Move modesetting just before booting. * loader/i386/pc/xnu.c (grub_xnu_set_video): Use grub_video_get_info_and_fini. * video/i386/pc/vbe.c: Moved framebuffer part ... * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use grub_video_fbstd_colors and grub_video_fb_set_palette. (grub_video_vbe_init): Clear 'framebuffer' variable and use grub_video_fb_init. (grub_video_vbe_fini): Use grub_video_fb_fini. (grub_video_vbe_setup): Use framebuffer.render_target instead of render_target and use grub_video_fb_set_active_render_target and grub_video_fb_set_palette. (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. (grub_video_vbe_adapter): Use framebuffer. * video/video.c (grub_video_get_info_and_fini): New function. (grub_video_set_mode): Make modestring const char *. (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these values are already initialised. --- ChangeLog | 54 + commands/i386/pc/vbetest.c | 2 + conf/common.rmk | 7 +- conf/i386-pc.rmk | 3 +- include/grub/fbblit.h | 134 ++ include/grub/fbfill.h | 75 ++ include/grub/{i386/pc/vbeutil.h => fbutil.h} | 8 +- include/grub/i386/pc/vbe.h | 54 +- include/grub/i386/pc/vbeblit.h | 134 -- include/grub/i386/pc/vbefill.h | 52 - include/grub/video.h | 19 +- include/grub/video_fb.h | 121 ++ loader/i386/linux.c | 83 +- loader/i386/pc/xnu.c | 13 +- video/{i386/pc/vbeblit.c => fb/fbblit.c} | 194 +-- video/{i386/pc/vbefill.c => fb/fbfill.c} | 46 +- video/{i386/pc/vbeutil.c => fb/fbutil.c} | 8 +- video/fb/video_fb.c | 1156 +++++++++++++++++ video/i386/pc/vbe.c | 1213 ++---------------- video/video.c | 22 +- 20 files changed, 1840 insertions(+), 1558 deletions(-) create mode 100644 include/grub/fbblit.h create mode 100644 include/grub/fbfill.h rename include/grub/{i386/pc/vbeutil.h => fbutil.h} (83%) delete mode 100644 include/grub/i386/pc/vbeblit.h delete mode 100644 include/grub/i386/pc/vbefill.h create mode 100644 include/grub/video_fb.h rename video/{i386/pc/vbeblit.c => fb/fbblit.c} (78%) rename video/{i386/pc/vbefill.c => fb/fbfill.c} (76%) rename video/{i386/pc/vbeutil.c => fb/fbutil.c} (95%) create mode 100644 video/fb/video_fb.c diff --git a/ChangeLog b/ChangeLog index a05df9c59..9ea7886d6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,57 @@ +2009-08-14 Vladimir Serbinenko + + Framebuffer split. + + * commands/i386/pc/vbetest.c (grub_cmd_vbetest): Restore video + subsystem at the end. + * conf/common.rmk (pkglib_MODULES): Add video_fb.mod. + (video_fb_mod_SOURCES): New variable. + (video_fb_mod_CFLAGS): Likewise. + (video_fb_mod_LDFLAGS): Likewise. + * conf/i386-pc.rmk (vbe_mod_SOURCES): Remove video/i386/pc/vbeblit.c, + video/i386/pc/vbefill.c and video/i386/pc/vbeutil.c. + * video/i386/pc/vbeblit.c: Moved from here ... + * video/fb/fbblit.c: ..here. Replaced 'vbe' with 'fb'. + * video/i386/pc/vbefill.c: Moved from here ... + * video/fb/fbfill.c: ..here. Replaced 'vbe' with 'fb'. + * video/i386/pc/vbeutil.c: Moved from here ... + * video/fb/fbutil.c: ..here. Replaced 'vbe' with 'fb'. + * include/grub/i386/pc/vbeblit.h: Moved from here ... + * include/grub/fbblit.h: ... here. Replaced 'vbe' with 'fb'. + * include/grub/i386/pc/vbefill.h: Moved from here ... + * include/grub/fbfill.h: ... here. Replaced 'vbe' with 'fb'. + * include/grub/i386/pc/vbeutil.h: Moved from here ... + * include/grub/fbutil.h: ... here. Replaced 'vbe' with 'fb'. + * include/grub/i386/pc/vbe.h: Moved framebuffer part ... + * include/grub/video_fb.h: ... here. Replaced 'vbe' with 'fb'. + * include/grub/video.h (GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER): Removed. + (GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER): Likewise. + (grub_video_adapter): Added 'get_info_and_fini'. + (grub_video_get_info_and_fini): New prototype. + (grub_video_set_mode): make modestring const char *. + * loader/i386/linux.c (grub_linux_setup_video): Use + grub_video_get_info_and_fini. + (grub_linux_boot): Move modesetting just before booting. + * loader/i386/pc/xnu.c (grub_xnu_set_video): Use + grub_video_get_info_and_fini. + * video/i386/pc/vbe.c: Moved framebuffer part ... + * video/fb/video_fb.c: ... here. Replaced 'vbe' with 'fb'. + * video/i386/pc/vbe.c (grub_vbe_set_video_mode): Use + grub_video_fbstd_colors and grub_video_fb_set_palette. + (grub_video_vbe_init): Clear 'framebuffer' variable and use + grub_video_fb_init. + (grub_video_vbe_fini): Use grub_video_fb_fini. + (grub_video_vbe_setup): Use framebuffer.render_target instead of + render_target and use grub_video_fb_set_active_render_target and + grub_video_fb_set_palette. + (grub_video_vbe_set_palette): Use grub_video_fb_set_palette. + (grub_video_vbe_set_viewport): Use grub_video_fb_set_viewport. + (grub_video_vbe_adapter): Use framebuffer. + * video/video.c (grub_video_get_info_and_fini): New function. + (grub_video_set_mode): Make modestring const char *. + (GRUB_MOD_INIT(video_video)): Don't set variables to 0 since these + values are already initialised. + 2009-08-14 Pavel Roskin * boot/i386/pc/cdboot.S: Use LOCAL for local labels. Eliminate diff --git a/commands/i386/pc/vbetest.c b/commands/i386/pc/vbetest.c index 3cbc3014c..314320d07 100644 --- a/commands/i386/pc/vbetest.c +++ b/commands/i386/pc/vbetest.c @@ -155,6 +155,8 @@ grub_cmd_vbetest (grub_command_t cmd __attribute__ ((unused)), grub_getkey (); + grub_video_restore (); + /* Restore old video mode. */ grub_vbe_set_video_mode (old_mode, 0); diff --git a/conf/common.rmk b/conf/common.rmk index 032517ffb..5e9330237 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -535,13 +535,18 @@ lua_mod_LDFLAGS = $(COMMON_LDFLAGS) # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ - png.mod font.mod gfxterm.mod + png.mod font.mod gfxterm.mod video_fb.mod # For video.mod. video_mod_SOURCES = video/video.c video_mod_CFLAGS = $(COMMON_CFLAGS) video_mod_LDFLAGS = $(COMMON_LDFLAGS) +video_fb_mod_SOURCES = video/fb/video_fb.c video/fb/fbblit.c \ + video/fb/fbfill.c video/fb/fbutil.c +video_fb_mod_CFLAGS = $(COMMON_CFLAGS) +video_fb_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For videotest.mod. videotest_mod_SOURCES = commands/videotest.c videotest_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index b61ecaba5..debb40364 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -271,8 +271,7 @@ multiboot_mod_LDFLAGS = $(COMMON_LDFLAGS) multiboot_mod_ASFLAGS = $(COMMON_ASFLAGS) # For vbe.mod. -vbe_mod_SOURCES = video/i386/pc/vbe.c video/i386/pc/vbeblit.c \ - video/i386/pc/vbefill.c video/i386/pc/vbeutil.c +vbe_mod_SOURCES = video/i386/pc/vbe.c vbe_mod_CFLAGS = $(COMMON_CFLAGS) vbe_mod_LDFLAGS = $(COMMON_LDFLAGS) diff --git a/include/grub/fbblit.h b/include/grub/fbblit.h new file mode 100644 index 000000000..664f508c5 --- /dev/null +++ b/include/grub/fbblit.h @@ -0,0 +1,134 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_FBBLIT_HEADER +#define GRUB_FBBLIT_HEADER 1 + +/* NOTE: This header is private header for fb driver and should not be used + in other parts of the code. */ + +struct grub_video_fbblit_info; + +void +grub_video_fbblit_replace (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +#endif /* ! GRUB_FBBLIT_HEADER */ diff --git a/include/grub/fbfill.h b/include/grub/fbfill.h new file mode 100644 index 000000000..08cd7b887 --- /dev/null +++ b/include/grub/fbfill.h @@ -0,0 +1,75 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_FBFILL_HEADER +#define GRUB_FBFILL_HEADER 1 + +/* NOTE: This header is private header for fb driver and should not be used + in other parts of the code. */ + +struct grub_video_fbblit_info; + +struct grub_video_fbrender_target +{ + /* Copy of the screen's mode info structure, except that width, height and + mode_type has been re-adjusted to requested render target settings. */ + struct grub_video_mode_info mode_info; + + struct + { + unsigned int x; + unsigned int y; + unsigned int width; + unsigned int height; + } viewport; + + /* Indicates whether the data has been allocated by us and must be freed + when render target is destroyed. */ + int is_allocated; + + /* Pointer to data. Can either be in video card memory or in local host's + memory. */ + void *data; +}; + +void +grub_video_fbfill (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +void +grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +void +grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +void +grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +void +grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height); + +#endif /* ! GRUB_FBFILL_HEADER */ diff --git a/include/grub/i386/pc/vbeutil.h b/include/grub/fbutil.h similarity index 83% rename from include/grub/i386/pc/vbeutil.h rename to include/grub/fbutil.h index 9b5be2163..76e1e573c 100644 --- a/include/grub/i386/pc/vbeutil.h +++ b/include/grub/fbutil.h @@ -25,19 +25,19 @@ #include #include -struct grub_video_i386_vbeblit_info +struct grub_video_fbblit_info { struct grub_video_mode_info *mode_info; void *data; }; -grub_uint8_t *get_data_ptr (struct grub_video_i386_vbeblit_info *source, +grub_uint8_t *get_data_ptr (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y); -grub_video_color_t get_pixel (struct grub_video_i386_vbeblit_info *source, +grub_video_color_t get_pixel (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y); -void set_pixel (struct grub_video_i386_vbeblit_info *source, +void set_pixel (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y, grub_video_color_t color); #endif /* ! GRUB_VBEUTIL_MACHINE_HEADER */ diff --git a/include/grub/i386/pc/vbe.h b/include/grub/i386/pc/vbe.h index fad3c6c36..32427679b 100644 --- a/include/grub/i386/pc/vbe.h +++ b/include/grub/i386/pc/vbe.h @@ -19,10 +19,7 @@ #ifndef GRUB_VBE_MACHINE_HEADER #define GRUB_VBE_MACHINE_HEADER 1 -#include -#include -#include -#include +#include /* Default video mode to be used. */ #define GRUB_VBE_DEFAULT_VIDEO_MODE 0x101 @@ -231,54 +228,5 @@ grub_err_t grub_vbe_get_video_mode (grub_uint32_t *mode); grub_err_t grub_vbe_get_video_mode_info (grub_uint32_t mode, struct grub_vbe_mode_info_block *mode_info); -/* VBE module internal prototypes (should not be used from elsewhere). */ -struct grub_video_i386_vbeblit_info; - -struct grub_video_render_target -{ - /* Copy of the screen's mode info structure, except that width, height and - mode_type has been re-adjusted to requested render target settings. */ - struct grub_video_mode_info mode_info; - - struct - { - unsigned int x; - unsigned int y; - unsigned int width; - unsigned int height; - } viewport; - - /* Indicates whether the data has been allocated by us and must be freed - when render target is destroyed. */ - int is_allocated; - - /* Pointer to data. Can either be in video card memory or in local host's - memory. */ - void *data; -}; - -grub_uint8_t * grub_video_vbe_get_video_ptr (struct grub_video_i386_vbeblit_info *source, - grub_uint32_t x, grub_uint32_t y); - -grub_video_color_t grub_video_vbe_map_rgb (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue); - -grub_video_color_t grub_video_vbe_map_rgba (grub_uint8_t red, - grub_uint8_t green, - grub_uint8_t blue, - grub_uint8_t alpha); - -grub_err_t grub_video_vbe_unmap_color (grub_video_color_t color, - grub_uint8_t *red, - grub_uint8_t *green, - grub_uint8_t *blue, - grub_uint8_t *alpha); - -void grub_video_vbe_unmap_color_int (struct grub_video_i386_vbeblit_info *source, - grub_video_color_t color, - grub_uint8_t *red, - grub_uint8_t *green, - grub_uint8_t *blue, - grub_uint8_t *alpha); #endif /* ! GRUB_VBE_MACHINE_HEADER */ diff --git a/include/grub/i386/pc/vbeblit.h b/include/grub/i386/pc/vbeblit.h deleted file mode 100644 index 5a2aa7af0..000000000 --- a/include/grub/i386/pc/vbeblit.h +++ /dev/null @@ -1,134 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_VBEBLIT_MACHINE_HEADER -#define GRUB_VBEBLIT_MACHINE_HEADER 1 - -/* NOTE: This header is private header for vbe driver and should not be used - in other parts of the code. */ - -struct grub_video_i386_vbeblit_info; - -void -grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_directN (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_BGR888_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -void -grub_video_i386_vbeblit_blend_index_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y); - -#endif /* ! GRUB_VBEBLIT_MACHINE_HEADER */ diff --git a/include/grub/i386/pc/vbefill.h b/include/grub/i386/pc/vbefill.h deleted file mode 100644 index efc6378d4..000000000 --- a/include/grub/i386/pc/vbefill.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006,2007,2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_VBEFILL_MACHINE_HEADER -#define GRUB_VBEFILL_MACHINE_HEADER 1 - -/* NOTE: This header is private header for vbe driver and should not be used - in other parts of the code. */ - -struct grub_video_i386_vbeblit_info; - -void -grub_video_i386_vbefill (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - -void -grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - -void -grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - -void -grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - -void -grub_video_i386_vbefill_direct8 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height); - -#endif /* ! GRUB_VBEFILL_MACHINE_HEADER */ diff --git a/include/grub/video.h b/include/grub/video.h index c98731ddf..4145db465 100644 --- a/include/grub/video.h +++ b/include/grub/video.h @@ -48,10 +48,8 @@ struct grub_video_bitmap; #define GRUB_VIDEO_MODE_TYPE_DEPTH_MASK 0x0000ff00 #define GRUB_VIDEO_MODE_TYPE_DEPTH_POS 8 -/* Defined predefined render targets. */ -#define GRUB_VIDEO_RENDER_TARGET_DISPLAY ((struct grub_video_render_target *) 0) -#define GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER ((struct grub_video_render_target *) 0) -#define GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER ((struct grub_video_render_target *) 1) +#define GRUB_VIDEO_RENDER_TARGET_DISPLAY \ + ((struct grub_video_render_target *) 0) /* Defined blitting formats. */ enum grub_video_blit_format @@ -177,6 +175,9 @@ struct grub_video_adapter grub_err_t (*get_info) (struct grub_video_mode_info *mode_info); + grub_err_t (*get_info_and_fini) (struct grub_video_mode_info *mode_info, + void **framebuffer); + grub_err_t (*set_palette) (unsigned int start, unsigned int count, struct grub_video_palette_data *palette_data); @@ -241,6 +242,14 @@ grub_err_t grub_video_restore (void); grub_err_t grub_video_get_info (struct grub_video_mode_info *mode_info); +/* Framebuffer address may change as a part of normal operation + (e.g. double buffering). That's why you need to stop video subsystem to be + sure that framebuffer address doesn't change. To ensure this abstraction + grub_video_get_info_and_fini is the only function supplying framebuffer + address. */ +grub_err_t grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info, + void **framebuffer); + enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info); grub_err_t grub_video_set_palette (unsigned int start, unsigned int count, @@ -297,7 +306,7 @@ grub_err_t grub_video_set_active_render_target (struct grub_video_render_target grub_err_t grub_video_get_active_render_target (struct grub_video_render_target **target); -grub_err_t grub_video_set_mode (char *modestring, +grub_err_t grub_video_set_mode (const char *modestring, int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p, struct grub_video_mode_info *mode_info)); diff --git a/include/grub/video_fb.h b/include/grub/video_fb.h new file mode 100644 index 000000000..03ef38509 --- /dev/null +++ b/include/grub/video_fb.h @@ -0,0 +1,121 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_VIDEO_FB_HEADER +#define GRUB_VIDEO_FB_HEADER 1 + +#include +#include +#include +#include + +/* FB module internal prototype (should not be used from elsewhere). */ + +struct grub_video_fbblit_info; + +struct grub_video_fbrender_target; + +#define GRUB_VIDEO_FBSTD_NUMCOLORS 16 +extern struct grub_video_palette_data grub_video_fbstd_colors[GRUB_VIDEO_FBSTD_NUMCOLORS]; + +grub_uint8_t * grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, + grub_uint32_t x, grub_uint32_t y); + +grub_err_t +grub_video_fb_init (void); + +grub_err_t +grub_video_fb_fini (void); + +grub_err_t +grub_video_fb_get_info (struct grub_video_mode_info *mode_info); + +grub_err_t +grub_video_fb_get_palette (unsigned int start, unsigned int count, + struct grub_video_palette_data *palette_data); +grub_err_t +grub_video_fb_set_palette (unsigned int start, unsigned int count, + struct grub_video_palette_data *palette_data); +grub_err_t +grub_video_fb_set_viewport (unsigned int x, unsigned int y, + unsigned int width, unsigned int height); +grub_err_t +grub_video_fb_get_viewport (unsigned int *x, unsigned int *y, + unsigned int *width, unsigned int *height); + +grub_video_color_t +grub_video_fb_map_color (grub_uint32_t color_name); + +grub_video_color_t +grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green, + grub_uint8_t blue); + +grub_video_color_t +grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green, + grub_uint8_t blue, grub_uint8_t alpha); + +grub_err_t +grub_video_fb_unmap_color (grub_video_color_t color, + grub_uint8_t *red, grub_uint8_t *green, + grub_uint8_t *blue, grub_uint8_t *alpha); + +void +grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source, + grub_video_color_t color, + grub_uint8_t *red, grub_uint8_t *green, + grub_uint8_t *blue, grub_uint8_t *alpha); + +grub_err_t +grub_video_fb_fill_rect (grub_video_color_t color, int x, int y, + unsigned int width, unsigned int height); + +grub_err_t +grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap, + enum grub_video_blit_operators oper, int x, int y, + int offset_x, int offset_y, + unsigned int width, unsigned int height); + +grub_err_t +grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source, + enum grub_video_blit_operators oper, + int x, int y, int offset_x, int offset_y, + unsigned int width, unsigned int height); + +grub_err_t +grub_video_fb_scroll (grub_video_color_t color, int dx, int dy); + +grub_err_t +grub_video_fb_create_render_target (struct grub_video_fbrender_target **result, + unsigned int width, unsigned int height, + unsigned int mode_type __attribute__ ((unused))); + +grub_err_t +grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result, + const struct grub_video_mode_info *mode_info, + void *ptr); + +grub_err_t +grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target); + +grub_err_t +grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target); + +grub_err_t +grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target); + +#endif /* ! GRUB_VIDEO_FB_HEADER */ diff --git a/loader/i386/linux.c b/loader/i386/linux.c index d76e7fbd0..238e4cd8f 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -31,9 +31,7 @@ #include #include #include -/* FIXME: the definition of `struct grub_video_render_target' is - VBE-specific. */ -#include +#include #include #define GRUB_LINUX_CL_OFFSET 0x1000 @@ -403,14 +401,11 @@ static int grub_linux_setup_video (struct linux_kernel_params *params) { struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; + void *framebuffer; int ret; - ret = grub_video_get_info (&mode_info); - if (ret) - return 1; + ret = grub_video_get_info_and_fini (&mode_info, &framebuffer); - ret = grub_video_get_active_render_target (&render_target); if (ret) return 1; @@ -419,7 +414,7 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->lfb_depth = mode_info.bpp; params->lfb_line_len = mode_info.pitch; - params->lfb_base = (grub_size_t) render_target->data; + params->lfb_base = (grub_size_t) framebuffer; params->lfb_size = (params->lfb_line_len * params->lfb_height + 65535) >> 16; params->red_mask_size = mode_info.red_mask_size; @@ -449,41 +444,6 @@ grub_linux_boot (void) params = real_mode_mem; - modevar = grub_env_get ("gfxpayload"); - - /* Now all graphical modes are acceptable. - May change in future if we have modes without framebuffer. */ - if (modevar && *modevar != 0) - { - tmp = grub_malloc (grub_strlen (modevar) - + sizeof (DEFAULT_VIDEO_MODE) + 1); - if (! tmp) - return grub_errno; - grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); - err = grub_video_set_mode (tmp, 0); - grub_free (tmp); - } -#ifndef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT - else - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0); -#endif - - if (err) - { - grub_print_error (); - grub_printf ("Booting however\n"); - grub_errno = GRUB_ERR_NONE; - } - - if (! grub_linux_setup_video (params)) - params->have_vga = GRUB_VIDEO_TYPE_VLFB; - else - { - params->have_vga = GRUB_VIDEO_TYPE_TEXT; - params->video_width = 80; - params->video_height = 25; - } - grub_dprintf ("linux", "code32_start = %x, idt_desc = %lx, gdt_desc = %lx\n", (unsigned) params->code32_start, (unsigned long) &(idt_desc.limit), @@ -534,6 +494,41 @@ grub_linux_boot (void) grub_mmap_iterate (hook); params->mmap_size = e820_num; + modevar = grub_env_get ("gfxpayload"); + + /* Now all graphical modes are acceptable. + May change in future if we have modes without framebuffer. */ + if (modevar && *modevar != 0) + { + tmp = grub_malloc (grub_strlen (modevar) + + sizeof (DEFAULT_VIDEO_MODE) + 1); + if (! tmp) + return grub_errno; + grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); + err = grub_video_set_mode (tmp, 0); + grub_free (tmp); + } +#ifndef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT + else + err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0); +#endif + + if (err) + { + grub_print_error (); + grub_printf ("Booting however\n"); + grub_errno = GRUB_ERR_NONE; + } + + if (! grub_linux_setup_video (params)) + params->have_vga = GRUB_VIDEO_TYPE_VLFB; + else + { + params->have_vga = GRUB_VIDEO_TYPE_TEXT; + params->video_width = 80; + params->video_height = 25; + } + /* Initialize these last, because terminal position could be affected by printfs above. */ if (params->have_vga == GRUB_VIDEO_TYPE_TEXT) { diff --git a/loader/i386/pc/xnu.c b/loader/i386/pc/xnu.c index 037a7134f..69a9405c6 100644 --- a/loader/i386/pc/xnu.c +++ b/loader/i386/pc/xnu.c @@ -21,8 +21,7 @@ #include #include #include -#include -#include +#include #define min(a,b) (((a) < (b)) ? (a) : (b)) #define max(a,b) (((a) > (b)) ? (a) : (b)) @@ -43,10 +42,10 @@ grub_err_t grub_xnu_set_video (struct grub_xnu_boot_params *params) { struct grub_video_mode_info mode_info; - struct grub_video_render_target *render_target; int ret; int x,y; char *tmp, *modevar; + void *framebuffer; grub_err_t err; modevar = grub_env_get ("gfxpayload"); @@ -67,11 +66,7 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) if (err) return err; - ret = grub_video_get_info (&mode_info); - if (ret) - return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); - - ret = grub_video_get_active_render_target (&render_target); + ret = grub_video_get_info_and_fini (&mode_info, &framebuffer); if (ret) return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); @@ -102,7 +97,7 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) params->lfb_depth = mode_info.bpp; params->lfb_line_len = mode_info.pitch; - params->lfb_base = PTR_TO_UINT32 (render_target->data); + params->lfb_base = PTR_TO_UINT32 (framebuffer); params->lfb_mode = grub_xnu_bitmap ? GRUB_XNU_VIDEO_SPLASH : GRUB_XNU_VIDEO_TEXT_IN_VIDEO; diff --git a/video/i386/pc/vbeblit.c b/video/fb/fbblit.c similarity index 78% rename from video/i386/pc/vbeblit.c rename to video/fb/fbblit.c index 4121bfe6c..138eba8c1 100644 --- a/video/i386/pc/vbeblit.c +++ b/video/fb/fbblit.c @@ -27,19 +27,19 @@ - Every function in this code assumes that bounds checking has been done in previous phase and they are opted out in here. */ -#include -#include -#include +#include +#include +#include #include #include #include /* Generic replacing blitter (slow). Works for every supported format. */ void -grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y) { int i; int j; @@ -56,11 +56,11 @@ grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, { src_color = get_pixel (src, i + offset_x, j + offset_y); - grub_video_vbe_unmap_color_int (src, src_color, &src_red, &src_green, - &src_blue, &src_alpha); + grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green, + &src_blue, &src_alpha); - dst_color = grub_video_vbe_map_rgba (src_red, src_green, - src_blue, src_alpha); + dst_color = grub_video_fb_map_rgba (src_red, src_green, + src_blue, src_alpha); set_pixel (dst, x + i, y + j, dst_color); } @@ -69,10 +69,10 @@ grub_video_i386_vbeblit_replace (struct grub_video_i386_vbeblit_info *dst, /* Block copy replacing blitter. Works with modes multiple of 8 bits. */ void -grub_video_i386_vbeblit_replace_directN (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y) { int j; grub_uint32_t *srcptr; @@ -92,11 +92,11 @@ grub_video_i386_vbeblit_replace_directN (struct grub_video_i386_vbeblit_info *ds /* Optimized replacing blitter for RGBX8888 to BGRX8888. */ void -grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { int i; int j; @@ -135,11 +135,11 @@ grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (struct grub_video_i386_vbebli /* Optimized replacing blitter for RGB888 to BGRX8888. */ void -grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { int i; int j; @@ -179,11 +179,11 @@ grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (struct grub_video_i386_vbeblit_ /* Optimized replacing blitter for RGBX8888 to BGR888. */ void -grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t *srcptr; grub_uint8_t *dstptr; @@ -227,11 +227,11 @@ grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (struct grub_video_i386_vbeblit_ /* Optimized replacing blitter for RGB888 to BGR888. */ void -grub_video_i386_vbeblit_replace_BGR888_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { int i; int j; @@ -268,11 +268,11 @@ grub_video_i386_vbeblit_replace_BGR888_RGB888 (struct grub_video_i386_vbeblit_in /* Optimized replacing blitter for RGB888 to RGBX8888. */ void -grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -304,11 +304,11 @@ grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (struct grub_video_i386_vbeblit_ /* Optimized replacing blitter for RGBX8888 to RGB888. */ void -grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -341,11 +341,11 @@ grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (struct grub_video_i386_vbeblit_ /* Optimized replacing blitter for RGBX8888 to indexed color. */ void -grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -369,7 +369,7 @@ grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_i sg = (color >> 8) & 0xFF; sb = (color >> 16) & 0xFF; - color = grub_video_vbe_map_rgb(sr, sg, sb); + color = grub_video_fb_map_rgb(sr, sg, sb); *dstptr++ = color & 0xFF; } } @@ -377,11 +377,11 @@ grub_video_i386_vbeblit_replace_index_RGBX8888 (struct grub_video_i386_vbeblit_i /* Optimized replacing blitter for RGB888 to indexed color. */ void -grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -403,7 +403,7 @@ grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_inf sg = *srcptr++; sb = *srcptr++; - color = grub_video_vbe_map_rgb(sr, sg, sb); + color = grub_video_fb_map_rgb(sr, sg, sb); *dstptr++ = color & 0xFF; } @@ -412,10 +412,10 @@ grub_video_i386_vbeblit_replace_index_RGB888 (struct grub_video_i386_vbeblit_inf /* Generic blending blitter. Works for every supported format. */ void -grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_blend (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, int width, int height, + int offset_x, int offset_y) { int i; int j; @@ -436,24 +436,24 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, grub_video_color_t dst_color; src_color = get_pixel (src, i + offset_x, j + offset_y); - grub_video_vbe_unmap_color_int (src, src_color, &src_red, &src_green, - &src_blue, &src_alpha); + grub_video_fb_unmap_color_int (src, src_color, &src_red, &src_green, + &src_blue, &src_alpha); if (src_alpha == 0) continue; if (src_alpha == 255) { - dst_color = grub_video_vbe_map_rgba (src_red, src_green, - src_blue, src_alpha); + dst_color = grub_video_fb_map_rgba (src_red, src_green, + src_blue, src_alpha); set_pixel (dst, x + i, y + j, dst_color); continue; } dst_color = get_pixel (dst, x + i, y + j); - grub_video_vbe_unmap_color_int (dst, dst_color, &dst_red, - &dst_green, &dst_blue, &dst_alpha); + grub_video_fb_unmap_color_int (dst, dst_color, &dst_red, + &dst_green, &dst_blue, &dst_alpha); dst_red = (((src_red * src_alpha) + (dst_red * (255 - src_alpha))) / 255); @@ -463,8 +463,8 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, + (dst_blue * (255 - src_alpha))) / 255); dst_alpha = src_alpha; - dst_color = grub_video_vbe_map_rgba (dst_red, dst_green, dst_blue, - dst_alpha); + dst_color = grub_video_fb_map_rgba (dst_red, dst_green, dst_blue, + dst_alpha); set_pixel (dst, x + i, y + j, dst_color); } @@ -473,11 +473,11 @@ grub_video_i386_vbeblit_blend (struct grub_video_i386_vbeblit_info *dst, /* Optimized blending blitter for RGBA8888 to BGRA8888. */ void -grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t *srcptr; grub_uint32_t *dstptr; @@ -554,11 +554,11 @@ grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (struct grub_video_i386_vbeblit_ /* Optimized blending blitter for RGBA8888 to BGR888. */ void -grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t *srcptr; grub_uint8_t *dstptr; @@ -635,11 +635,11 @@ grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (struct grub_video_i386_vbeblit_in /* Optimized blending blitter for RGBA888 to RGBA8888. */ void -grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -700,11 +700,11 @@ grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (struct grub_video_i386_vbeblit_ /* Optimized blending blitter for RGBA8888 to RGB888. */ void -grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -766,11 +766,11 @@ grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (struct grub_video_i386_vbeblit_in /* Optimized blending blitter for RGBA8888 to indexed color. */ void -grub_video_i386_vbeblit_blend_index_RGBA8888 (struct grub_video_i386_vbeblit_info *dst, - struct grub_video_i386_vbeblit_info *src, - int x, int y, - int width, int height, - int offset_x, int offset_y) +grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) { grub_uint32_t color; int i; @@ -809,18 +809,18 @@ grub_video_i386_vbeblit_blend_index_RGBA8888 (struct grub_video_i386_vbeblit_inf if (a == 255) { - color = grub_video_vbe_map_rgb(sr, sg, sb); + color = grub_video_fb_map_rgb(sr, sg, sb); *dstptr++ = color & 0xFF; continue; } - grub_video_vbe_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da); + grub_video_fb_unmap_color_int (dst, *dstptr, &dr, &dg, &db, &da); dr = (dr * (255 - a) + sr * a) / 255; dg = (dg * (255 - a) + sg * a) / 255; db = (db * (255 - a) + sb * a) / 255; - color = grub_video_vbe_map_rgb(dr, dg, db); + color = grub_video_fb_map_rgb(dr, dg, db); *dstptr++ = color & 0xFF; } diff --git a/video/i386/pc/vbefill.c b/video/fb/fbfill.c similarity index 76% rename from video/i386/pc/vbefill.c rename to video/fb/fbfill.c index 3a98a715a..a4ca7c2a1 100644 --- a/video/i386/pc/vbefill.c +++ b/video/fb/fbfill.c @@ -27,32 +27,32 @@ - Every function in this code assumes that bounds checking has been done in previous phase and they are opted out in here. */ -#include -#include -#include +#include +#include +#include #include #include /* Generic filler that works for every supported mode. */ void -grub_video_i386_vbefill (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) +grub_video_fbfill (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) { int i; int j; for (j = 0; j < height; j++) for (i = 0; i < width; i++) - set_pixel (dst, x+i, y+j, color); + set_pixel (dst, x + i, y + j, color); } /* Optimized filler for direct color 32 bit modes. It is assumed that color is already mapped to destination format. */ void -grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) +grub_video_fbfill_direct32 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) { int i; int j; @@ -64,7 +64,7 @@ grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst, rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; /* Get the start address. */ - dstptr = (grub_uint32_t *) grub_video_vbe_get_video_ptr (dst, x, y); + dstptr = (grub_uint32_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -79,9 +79,9 @@ grub_video_i386_vbefill_direct32 (struct grub_video_i386_vbeblit_info *dst, /* Optimized filler for direct color 24 bit modes. It is assumed that color is already mapped to destination format. */ void -grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) +grub_video_fbfill_direct24 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) { int i; int j; @@ -96,7 +96,7 @@ grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst, rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; /* Get the start address. */ - dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -115,9 +115,9 @@ grub_video_i386_vbefill_direct24 (struct grub_video_i386_vbeblit_info *dst, /* Optimized filler for direct color 16 bit modes. It is assumed that color is already mapped to destination format. */ void -grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) +grub_video_fbfill_direct16 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) { int i; int j; @@ -131,7 +131,7 @@ grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst, rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; /* Get the start address. */ - dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -149,9 +149,9 @@ grub_video_i386_vbefill_direct16 (struct grub_video_i386_vbeblit_info *dst, /* Optimized filler for index color. It is assumed that color is already mapped to destination format. */ void -grub_video_i386_vbefill_direct8 (struct grub_video_i386_vbeblit_info *dst, - grub_video_color_t color, int x, int y, - int width, int height) +grub_video_fbfill_direct8 (struct grub_video_fbblit_info *dst, + grub_video_color_t color, int x, int y, + int width, int height) { int i; int j; @@ -164,7 +164,7 @@ grub_video_i386_vbefill_direct8 (struct grub_video_i386_vbeblit_info *dst, rowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; /* Get the start address. */ - dstptr = (grub_uint8_t *) grub_video_vbe_get_video_ptr (dst, x, y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { diff --git a/video/i386/pc/vbeutil.c b/video/fb/fbutil.c similarity index 95% rename from video/i386/pc/vbeutil.c rename to video/fb/fbutil.c index 1040dc934..09cbb12f9 100644 --- a/video/i386/pc/vbeutil.c +++ b/video/fb/fbutil.c @@ -16,12 +16,12 @@ * along with GRUB. If not, see . */ -#include +#include #include #include grub_uint8_t * -get_data_ptr (struct grub_video_i386_vbeblit_info *source, +get_data_ptr (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y) { grub_uint8_t *ptr = 0; @@ -64,7 +64,7 @@ get_data_ptr (struct grub_video_i386_vbeblit_info *source, } grub_video_color_t -get_pixel (struct grub_video_i386_vbeblit_info *source, +get_pixel (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y) { grub_video_color_t color = 0; @@ -111,7 +111,7 @@ get_pixel (struct grub_video_i386_vbeblit_info *source, } void -set_pixel (struct grub_video_i386_vbeblit_info *source, +set_pixel (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y, grub_video_color_t color) { switch (source->mode_info->bpp) diff --git a/video/fb/video_fb.c b/video/fb/video_fb.c new file mode 100644 index 000000000..fc943735a --- /dev/null +++ b/video/fb/video_fb.c @@ -0,0 +1,1156 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include +#include + +static struct grub_video_fbrender_target *render_target; +struct grub_video_palette_data *palette; +static unsigned int palette_size; + +/* Specify "standard" VGA palette, some video cards may + need this and this will also be used when using RGB modes. */ +struct grub_video_palette_data grub_video_fbstd_colors[GRUB_VIDEO_FBSTD_NUMCOLORS] = + { + // {R, G, B, A} + {0x00, 0x00, 0x00, 0xFF}, // 0 = black + {0x00, 0x00, 0xA8, 0xFF}, // 1 = blue + {0x00, 0xA8, 0x00, 0xFF}, // 2 = green + {0x00, 0xA8, 0xA8, 0xFF}, // 3 = cyan + {0xA8, 0x00, 0x00, 0xFF}, // 4 = red + {0xA8, 0x00, 0xA8, 0xFF}, // 5 = magenta + {0xA8, 0x54, 0x00, 0xFF}, // 6 = brown + {0xA8, 0xA8, 0xA8, 0xFF}, // 7 = light gray + + {0x54, 0x54, 0x54, 0xFF}, // 8 = dark gray + {0x54, 0x54, 0xFE, 0xFF}, // 9 = bright blue + {0x54, 0xFE, 0x54, 0xFF}, // 10 = bright green + {0x54, 0xFE, 0xFE, 0xFF}, // 11 = bright cyan + {0xFE, 0x54, 0x54, 0xFF}, // 12 = bright red + {0xFE, 0x54, 0xFE, 0xFF}, // 13 = bright magenta + {0xFE, 0xFE, 0x54, 0xFF}, // 14 = yellow + {0xFE, 0xFE, 0xFE, 0xFF} // 15 = white + }; + +grub_err_t +grub_video_fb_init (void) +{ + grub_free (palette); + render_target = 0; + palette = 0; + palette_size = 0; + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_fini (void) +{ + grub_free (palette); + render_target = 0; + palette = 0; + palette_size = 0; + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_get_info (struct grub_video_mode_info *mode_info) +{ + /* Copy mode info from active render target. */ + grub_memcpy (mode_info, &render_target->mode_info, + sizeof (struct grub_video_mode_info)); + + return GRUB_ERR_NONE; +} + + +grub_uint8_t * +grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, + grub_uint32_t x, grub_uint32_t y) +{ + grub_uint8_t *ptr = 0; + + switch (source->mode_info->bpp) + { + case 32: + ptr = (grub_uint8_t *)source->data + + y * source->mode_info->pitch + + x * 4; + break; + + case 24: + ptr = (grub_uint8_t *)source->data + + y * source->mode_info->pitch + + x * 3; + break; + + case 16: + case 15: + ptr = (grub_uint8_t *)source->data + + y * source->mode_info->pitch + + x * 2; + break; + + case 8: + ptr = (grub_uint8_t *)source->data + + y * source->mode_info->pitch + + x; + break; + } + + return ptr; +} + +grub_err_t +grub_video_fb_get_palette (unsigned int start, unsigned int count, + struct grub_video_palette_data *palette_data) +{ + unsigned int i; + + /* Assume that we know everything from index color palette. */ + for (i = 0; (i < count) && ((i + start) < palette_size); i++) + palette_data[i] = palette[start + i]; + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_set_palette (unsigned int start, unsigned int count, + struct grub_video_palette_data *palette_data) +{ + unsigned i; + if (start + count > palette_size) + { + palette_size = start + count; + palette = grub_realloc (palette, sizeof (palette[0]) * palette_size); + if (!palette) + { + grub_video_fb_fini (); + return grub_errno; + } + } + for (i = 0; (i < count) && ((i + start) < palette_size); i++) + palette[start + i] = palette_data[i]; + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_set_viewport (unsigned int x, unsigned int y, + unsigned int width, unsigned int height) +{ + /* Make sure viewport is withing screen dimensions. If viewport was set + to be out of the region, mark its size as zero. */ + if (x > render_target->mode_info.width) + { + x = 0; + width = 0; + } + + if (y > render_target->mode_info.height) + { + y = 0; + height = 0; + } + + if (x + width > render_target->mode_info.width) + width = render_target->mode_info.width - x; + + if (y + height > render_target->mode_info.height) + height = render_target->mode_info.height - y; + + render_target->viewport.x = x; + render_target->viewport.y = y; + render_target->viewport.width = width; + render_target->viewport.height = height; + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_get_viewport (unsigned int *x, unsigned int *y, + unsigned int *width, unsigned int *height) +{ + if (x) *x = render_target->viewport.x; + if (y) *y = render_target->viewport.y; + if (width) *width = render_target->viewport.width; + if (height) *height = render_target->viewport.height; + + return GRUB_ERR_NONE; +} + +/* Maps color name to target optimized color format. */ +grub_video_color_t +grub_video_fb_map_color (grub_uint32_t color_name) +{ + /* TODO: implement color theme mapping code. */ + + if (color_name < palette_size) + { + if ((render_target->mode_info.mode_type + & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + return color_name; + else + { + grub_video_color_t color; + + color = grub_video_fb_map_rgb (palette[color_name].r, + palette[color_name].g, + palette[color_name].b); + + return color; + } + } + + return 0; +} + +/* Maps RGB to target optimized color format. */ +grub_video_color_t +grub_video_fb_map_rgb (grub_uint8_t red, grub_uint8_t green, + grub_uint8_t blue) +{ + if ((render_target->mode_info.mode_type + & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + { + int minindex = 0; + int delta = 0; + int tmp; + int val; + unsigned i; + + /* Find best matching color. */ + for (i = 0; i < palette_size; i++) + { + val = palette[i].r - red; + tmp = val * val; + val = palette[i].g - green; + tmp += val * val; + val = palette[i].b - blue; + tmp += val * val; + + if (i == 0) + delta = tmp; + + if (tmp < delta) + { + delta = tmp; + minindex = i; + if (tmp == 0) + break; + } + } + + return minindex; + } + else if ((render_target->mode_info.mode_type + & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + { + if (red == render_target->mode_info.fg_red + && green == render_target->mode_info.fg_green + && blue == render_target->mode_info.fg_blue) + return 1; + else + return 0; + } + else + { + grub_uint32_t value; + grub_uint8_t alpha = 255; /* Opaque color. */ + + red >>= 8 - render_target->mode_info.red_mask_size; + green >>= 8 - render_target->mode_info.green_mask_size; + blue >>= 8 - render_target->mode_info.blue_mask_size; + alpha >>= 8 - render_target->mode_info.reserved_mask_size; + + value = red << render_target->mode_info.red_field_pos; + value |= green << render_target->mode_info.green_field_pos; + value |= blue << render_target->mode_info.blue_field_pos; + value |= alpha << render_target->mode_info.reserved_field_pos; + + return value; + } + +} + +/* Maps RGBA to target optimized color format. */ +grub_video_color_t +grub_video_fb_map_rgba (grub_uint8_t red, grub_uint8_t green, + grub_uint8_t blue, grub_uint8_t alpha) +{ + if ((render_target->mode_info.mode_type + & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + /* No alpha available in index color modes, just use + same value as in only RGB modes. */ + return grub_video_fb_map_rgb (red, green, blue); + else if ((render_target->mode_info.mode_type + & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + { + if (red == render_target->mode_info.fg_red + && green == render_target->mode_info.fg_green + && blue == render_target->mode_info.fg_blue + && alpha == render_target->mode_info.fg_alpha) + return 1; + else + return 0; + } + else + { + grub_uint32_t value; + + red >>= 8 - render_target->mode_info.red_mask_size; + green >>= 8 - render_target->mode_info.green_mask_size; + blue >>= 8 - render_target->mode_info.blue_mask_size; + alpha >>= 8 - render_target->mode_info.reserved_mask_size; + + value = red << render_target->mode_info.red_field_pos; + value |= green << render_target->mode_info.green_field_pos; + value |= blue << render_target->mode_info.blue_field_pos; + value |= alpha << render_target->mode_info.reserved_field_pos; + + return value; + } +} + +/* Splits target optimized format to components. */ +grub_err_t +grub_video_fb_unmap_color (grub_video_color_t color, + grub_uint8_t *red, grub_uint8_t *green, + grub_uint8_t *blue, grub_uint8_t *alpha) +{ + struct grub_video_fbblit_info target_info; + + target_info.mode_info = &render_target->mode_info; + target_info.data = render_target->data; + + grub_video_fb_unmap_color_int (&target_info, color, red, green, blue, alpha); + + return GRUB_ERR_NONE; +} + +/* Splits color in source format to components. */ +void +grub_video_fb_unmap_color_int (struct grub_video_fbblit_info * source, + grub_video_color_t color, + grub_uint8_t *red, grub_uint8_t *green, + grub_uint8_t *blue, grub_uint8_t *alpha) +{ + struct grub_video_mode_info *mode_info; + mode_info = source->mode_info; + + if ((mode_info->mode_type + & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) + { + /* If we have an out-of-bounds color, return transparent black. */ + if (color > 255) + { + *red = 0; + *green = 0; + *blue = 0; + *alpha = 0; + return; + } + + *red = palette[color].r; + *green = palette[color].g; + *blue = palette[color].b; + *alpha = palette[color].a; + return; + } + else if ((mode_info->mode_type + & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) + { + if (color & 1) + { + *red = mode_info->fg_red; + *green = mode_info->fg_green; + *blue = mode_info->fg_blue; + *alpha = mode_info->fg_alpha; + } + else + { + *red = mode_info->bg_red; + *green = mode_info->bg_green; + *blue = mode_info->bg_blue; + *alpha = mode_info->bg_alpha; + } + } + else + { + grub_uint32_t tmp; + + /* Get red component. */ + tmp = color >> mode_info->red_field_pos; + tmp &= (1 << mode_info->red_mask_size) - 1; + tmp <<= 8 - mode_info->red_mask_size; + tmp |= (1 << (8 - mode_info->red_mask_size)) - 1; + *red = tmp & 0xFF; + + /* Get green component. */ + tmp = color >> mode_info->green_field_pos; + tmp &= (1 << mode_info->green_mask_size) - 1; + tmp <<= 8 - mode_info->green_mask_size; + tmp |= (1 << (8 - mode_info->green_mask_size)) - 1; + *green = tmp & 0xFF; + + /* Get blue component. */ + tmp = color >> mode_info->blue_field_pos; + tmp &= (1 << mode_info->blue_mask_size) - 1; + tmp <<= 8 - mode_info->blue_mask_size; + tmp |= (1 << (8 - mode_info->blue_mask_size)) - 1; + *blue = tmp & 0xFF; + + /* Get alpha component. */ + if (source->mode_info->reserved_mask_size > 0) + { + tmp = color >> mode_info->reserved_field_pos; + tmp &= (1 << mode_info->reserved_mask_size) - 1; + tmp <<= 8 - mode_info->reserved_mask_size; + tmp |= (1 << (8 - mode_info->reserved_mask_size)) - 1; + } + else + /* If there is no alpha component, assume it opaque. */ + tmp = 255; + + *alpha = tmp & 0xFF; + } +} + +grub_err_t +grub_video_fb_fill_rect (grub_video_color_t color, int x, int y, + unsigned int width, unsigned int height) +{ + struct grub_video_fbblit_info target; + + /* Make sure there is something to do. */ + if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) + return GRUB_ERR_NONE; + if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) + return GRUB_ERR_NONE; + + /* Do not allow drawing out of viewport. */ + if (x < 0) + { + width += x; + x = 0; + } + if (y < 0) + { + height += y; + y = 0; + } + + if ((x + width) > render_target->viewport.width) + width = render_target->viewport.width - x; + if ((y + height) > render_target->viewport.height) + height = render_target->viewport.height - y; + + /* Add viewport offset. */ + x += render_target->viewport.x; + y += render_target->viewport.y; + + /* Use fbblit_info to encapsulate rendering. */ + target.mode_info = &render_target->mode_info; + target.data = render_target->data; + + /* Try to figure out more optimized version. Note that color is already + mapped to target format so we can make assumptions based on that. */ + if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_fbfill_direct32 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_fbfill_direct32 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_fbfill_direct24 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_565) + { + grub_video_fbfill_direct16 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_565) + { + grub_video_fbfill_direct16 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_fbfill_direct8 (&target, color, x, y, + width, height); + return GRUB_ERR_NONE; + } + + /* No optimized version found, use default (slow) filler. */ + grub_video_fbfill (&target, color, x, y, width, height); + + return GRUB_ERR_NONE; +} + +/* NOTE: This function assumes that given coordinates are within bounds of + handled data. */ +static void +common_blitter (struct grub_video_fbblit_info *target, + struct grub_video_fbblit_info *source, + enum grub_video_blit_operators oper, int x, int y, + unsigned int width, unsigned int height, + int offset_x, int offset_y) +{ + if (oper == GRUB_VIDEO_BLIT_REPLACE) + { + /* Try to figure out more optimized version for replace operator. */ + if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_fbblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_fbblit_replace_BGRX8888_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_fbblit_replace_BGR888_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_fbblit_replace_RGB888_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_fbblit_replace_index_RGBX8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_fbblit_replace_BGRX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_fbblit_replace_RGBX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_fbblit_replace_BGR888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_fbblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_fbblit_replace_index_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_fbblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_fbblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + + /* No optimized replace operator found, use default (slow) blitter. */ + grub_video_fbblit_replace (target, source, x, y, width, height, + offset_x, offset_y); + } + else + { + /* Try to figure out more optimized blend operator. */ + if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_fbblit_blend_BGRA8888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_fbblit_blend_RGBA8888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_fbblit_blend_BGR888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_fbblit_blend_RGB888_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_fbblit_blend_index_RGBA8888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + /* Note: There is really no alpha information here, so blend is + changed to replace. */ + + if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) + { + grub_video_fbblit_replace_BGRX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_fbblit_replace_RGBX8888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) + { + grub_video_fbblit_replace_BGR888_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_fbblit_replace_directN (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) + { + grub_video_fbblit_replace_index_RGB888 (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } + + /* No optimized blend operation found, use default (slow) blitter. */ + grub_video_fbblit_blend (target, source, x, y, width, height, + offset_x, offset_y); + } +} + +grub_err_t +grub_video_fb_blit_bitmap (struct grub_video_bitmap *bitmap, + enum grub_video_blit_operators oper, int x, int y, + int offset_x, int offset_y, + unsigned int width, unsigned int height) +{ + struct grub_video_fbblit_info source; + struct grub_video_fbblit_info target; + + /* Make sure there is something to do. */ + if ((width == 0) || (height == 0)) + return GRUB_ERR_NONE; + if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) + return GRUB_ERR_NONE; + if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) + return GRUB_ERR_NONE; + if ((x + (int)bitmap->mode_info.width) < 0) + return GRUB_ERR_NONE; + if ((y + (int)bitmap->mode_info.height) < 0) + return GRUB_ERR_NONE; + if ((offset_x >= (int)bitmap->mode_info.width) + || (offset_x + (int)width < 0)) + return GRUB_ERR_NONE; + if ((offset_y >= (int)bitmap->mode_info.height) + || (offset_y + (int)height < 0)) + return GRUB_ERR_NONE; + + /* If we have negative coordinates, optimize drawing to minimum. */ + if (offset_x < 0) + { + width += offset_x; + x -= offset_x; + offset_x = 0; + } + + if (offset_y < 0) + { + height += offset_y; + y -= offset_y; + offset_y = 0; + } + + if (x < 0) + { + width += x; + offset_x -= x; + x = 0; + } + + if (y < 0) + { + height += y; + offset_y -= y; + y = 0; + } + + /* Do not allow drawing out of viewport. */ + if ((x + width) > render_target->viewport.width) + width = render_target->viewport.width - x; + if ((y + height) > render_target->viewport.height) + height = render_target->viewport.height - y; + + if ((offset_x + width) > bitmap->mode_info.width) + width = bitmap->mode_info.width - offset_x; + if ((offset_y + height) > bitmap->mode_info.height) + height = bitmap->mode_info.height - offset_y; + + /* Limit drawing to source render target dimensions. */ + if (width > bitmap->mode_info.width) + width = bitmap->mode_info.width; + + if (height > bitmap->mode_info.height) + height = bitmap->mode_info.height; + + /* Add viewport offset. */ + x += render_target->viewport.x; + y += render_target->viewport.y; + + /* Use fbblit_info to encapsulate rendering. */ + source.mode_info = &bitmap->mode_info; + source.data = bitmap->data; + target.mode_info = &render_target->mode_info; + target.data = render_target->data; + + /* Do actual blitting. */ + common_blitter (&target, &source, oper, x, y, width, height, + offset_x, offset_y); + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_blit_render_target (struct grub_video_fbrender_target *source, + enum grub_video_blit_operators oper, + int x, int y, int offset_x, int offset_y, + unsigned int width, unsigned int height) +{ + struct grub_video_fbblit_info source_info; + struct grub_video_fbblit_info target_info; + + /* Make sure there is something to do. */ + if ((width == 0) || (height == 0)) + return GRUB_ERR_NONE; + if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) + return GRUB_ERR_NONE; + if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) + return GRUB_ERR_NONE; + if ((x + (int)source->mode_info.width) < 0) + return GRUB_ERR_NONE; + if ((y + (int)source->mode_info.height) < 0) + return GRUB_ERR_NONE; + if ((offset_x >= (int)source->mode_info.width) + || (offset_x + (int)width < 0)) + return GRUB_ERR_NONE; + if ((offset_y >= (int)source->mode_info.height) + || (offset_y + (int)height < 0)) + return GRUB_ERR_NONE; + + /* If we have negative coordinates, optimize drawing to minimum. */ + if (offset_x < 0) + { + width += offset_x; + x -= offset_x; + offset_x = 0; + } + + if (offset_y < 0) + { + height += offset_y; + y -= offset_y; + offset_y = 0; + } + + if (x < 0) + { + width += x; + offset_x -= x; + x = 0; + } + + if (y < 0) + { + height += y; + offset_y -= y; + y = 0; + } + + /* Do not allow drawing out of viewport. */ + if ((x + width) > render_target->viewport.width) + width = render_target->viewport.width - x; + if ((y + height) > render_target->viewport.height) + height = render_target->viewport.height - y; + + if ((offset_x + width) > source->mode_info.width) + width = source->mode_info.width - offset_x; + if ((offset_y + height) > source->mode_info.height) + height = source->mode_info.height - offset_y; + + /* Limit drawing to source render target dimensions. */ + if (width > source->mode_info.width) + width = source->mode_info.width; + + if (height > source->mode_info.height) + height = source->mode_info.height; + + /* Add viewport offset. */ + x += render_target->viewport.x; + y += render_target->viewport.y; + + /* Use fbblit_info to encapsulate rendering. */ + source_info.mode_info = &source->mode_info; + source_info.data = source->data; + target_info.mode_info = &render_target->mode_info; + target_info.data = render_target->data; + + /* Do actual blitting. */ + common_blitter (&target_info, &source_info, oper, x, y, width, height, + offset_x, offset_y); + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_scroll (grub_video_color_t color, int dx, int dy) +{ + int width; + int height; + int src_x; + int src_y; + int dst_x; + int dst_y; + + /* 1. Check if we have something to do. */ + if ((dx == 0) && (dy == 0)) + return GRUB_ERR_NONE; + + width = render_target->viewport.width - grub_abs (dx); + height = render_target->viewport.height - grub_abs (dy); + + if (dx < 0) + { + src_x = render_target->viewport.x - dx; + dst_x = render_target->viewport.x; + } + else + { + src_x = render_target->viewport.x; + dst_x = render_target->viewport.x + dx; + } + + if (dy < 0) + { + src_y = render_target->viewport.y - dy; + dst_y = render_target->viewport.y; + } + else + { + src_y = render_target->viewport.y; + dst_y = render_target->viewport.y + dy; + } + + /* 2. Check if there is need to copy data. */ + if ((grub_abs (dx) < render_target->viewport.width) + && (grub_abs (dy) < render_target->viewport.height)) + { + /* 3. Move data in render target. */ + struct grub_video_fbblit_info target; + grub_uint8_t *src; + grub_uint8_t *dst; + int j; + + target.mode_info = &render_target->mode_info; + target.data = render_target->data; + + /* Check vertical direction of the move. */ + if (dy <= 0) + /* 3a. Move data upwards. */ + for (j = 0; j < height; j++) + { + dst = grub_video_fb_get_video_ptr (&target, dst_x, dst_y + j); + src = grub_video_fb_get_video_ptr (&target, src_x, src_y + j); + grub_memmove (dst, src, + width * target.mode_info->bytes_per_pixel); + } + else + /* 3b. Move data downwards. */ + for (j = (height - 1); j >= 0; j--) + { + dst = grub_video_fb_get_video_ptr (&target, dst_x, dst_y + j); + src = grub_video_fb_get_video_ptr (&target, src_x, src_y + j); + grub_memmove (dst, src, + width * target.mode_info->bytes_per_pixel); + } + } + + /* 4. Fill empty space with specified color. In this implementation + there might be colliding areas but at the moment there is no need + to optimize this. */ + + /* 4a. Fill top & bottom parts. */ + if (dy > 0) + grub_video_fb_fill_rect (color, 0, 0, render_target->viewport.width, dy); + else if (dy < 0) + { + if (render_target->viewport.height < grub_abs (dy)) + dy = -render_target->viewport.height; + + grub_video_fb_fill_rect (color, 0, render_target->viewport.height + dy, + render_target->viewport.width, -dy); + } + + /* 4b. Fill left & right parts. */ + if (dx > 0) + grub_video_fb_fill_rect (color, 0, 0, + dx, render_target->viewport.height); + else if (dx < 0) + { + if (render_target->viewport.width < grub_abs (dx)) + dx = -render_target->viewport.width; + + grub_video_fb_fill_rect (color, render_target->viewport.width + dx, 0, + -dx, render_target->viewport.height); + } + + return GRUB_ERR_NONE; +} + + +grub_err_t +grub_video_fb_create_render_target (struct grub_video_fbrender_target **result, + unsigned int width, unsigned int height, + unsigned int mode_type __attribute__ ((unused))) +{ + struct grub_video_fbrender_target *target; + unsigned int size; + + /* Validate arguments. */ + if ((! result) + || (width == 0) + || (height == 0)) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "invalid argument given."); + + /* Allocate memory for render target. */ + target = grub_malloc (sizeof (struct grub_video_fbrender_target)); + if (! target) + return grub_errno; + + /* TODO: Implement other types too. + Currently only 32bit render targets are supported. */ + + /* Mark render target as allocated. */ + target->is_allocated = 1; + + /* Maximize viewport. */ + target->viewport.x = 0; + target->viewport.y = 0; + target->viewport.width = width; + target->viewport.height = height; + + /* Setup render target format. */ + target->mode_info.width = width; + target->mode_info.height = height; + target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB + | GRUB_VIDEO_MODE_TYPE_ALPHA; + target->mode_info.bpp = 32; + target->mode_info.bytes_per_pixel = 4; + target->mode_info.pitch = target->mode_info.bytes_per_pixel * width; + target->mode_info.number_of_colors = palette_size; /* Emulated palette. */ + target->mode_info.red_mask_size = 8; + target->mode_info.red_field_pos = 0; + target->mode_info.green_mask_size = 8; + target->mode_info.green_field_pos = 8; + target->mode_info.blue_mask_size = 8; + target->mode_info.blue_field_pos = 16; + target->mode_info.reserved_mask_size = 8; + target->mode_info.reserved_field_pos = 24; + + target->mode_info.blit_format = grub_video_get_blit_format (&target->mode_info); + + /* Calculate size needed for the data. */ + size = (width * target->mode_info.bytes_per_pixel) * height; + + target->data = grub_malloc (size); + if (! target->data) + { + grub_free (target); + return grub_errno; + } + + /* Clear render target with black and maximum transparency. */ + grub_memset (target->data, 0, size); + + /* TODO: Add render target to render target list. */ + + /* Save result to caller. */ + *result = target; + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_create_render_target_from_pointer (struct grub_video_fbrender_target **result, + const struct grub_video_mode_info *mode_info, + void *ptr) +{ + struct grub_video_fbrender_target *target; + unsigned y; + + /* Allocate memory for render target. */ + target = grub_malloc (sizeof (struct grub_video_fbrender_target)); + if (! target) + return grub_errno; + + /* Mark framebuffer memory as non allocated. */ + target->is_allocated = 0; + target->data = ptr; + + grub_memcpy (&(target->mode_info), mode_info, sizeof (target->mode_info)); + + /* Reset viewport to match new mode. */ + target->viewport.x = 0; + target->viewport.y = 0; + target->viewport.width = mode_info->width; + target->viewport.height = mode_info->height; + + /* Clear render target with black and maximum transparency. */ + for (y = 0; y < mode_info->height; y++) + grub_memset (target->data + mode_info->pitch * y, 0, + mode_info->bytes_per_pixel * mode_info->width); + + /* Save result to caller. */ + *result = target; + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_delete_render_target (struct grub_video_fbrender_target *target) +{ + /* If there is no target, then just return without error. */ + if (! target) + return GRUB_ERR_NONE; + + /* TODO: Delist render target from render target list. */ + + /* If this is software render target, free it's memory. */ + if (target->is_allocated) + grub_free (target->data); + + /* Free render target. */ + grub_free (target); + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_set_active_render_target (struct grub_video_fbrender_target *target) +{ + if (! target->data) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "invalid render target given."); + + render_target = target; + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_video_fb_get_active_render_target (struct grub_video_fbrender_target **target) +{ + *target = render_target; + + return GRUB_ERR_NONE; +} diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index 1670a737d..0244b9016 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -16,43 +16,17 @@ * along with GRUB. If not, see . */ +#define grub_video_render_target grub_video_fbrender_target + #include #include #include #include -#include -#include -#include #include #include #include #include #include -#include - -/* Specify "standard" VGA palette, some video cards may - need this and this will also be used when using RGB modes. */ -static struct grub_vbe_palette_data vga_colors[16] = - { - // {B, G, R, A} - {0x00, 0x00, 0x00, 0x00}, // 0 = black - {0xA8, 0x00, 0x00, 0x00}, // 1 = blue - {0x00, 0xA8, 0x00, 0x00}, // 2 = green - {0xA8, 0xA8, 0x00, 0x00}, // 3 = cyan - {0x00, 0x00, 0xA8, 0x00}, // 4 = red - {0xA8, 0x00, 0xA8, 0x00}, // 5 = magenta - {0x00, 0x54, 0xA8, 0x00}, // 6 = brown - {0xA8, 0xA8, 0xA8, 0x00}, // 7 = light gray - - {0x54, 0x54, 0x54, 0x00}, // 8 = dark gray - {0xFE, 0x54, 0x54, 0x00}, // 9 = bright blue - {0x54, 0xFE, 0x54, 0x00}, // 10 = bright green - {0xFE, 0xFE, 0x54, 0x00}, // 11 = bright cyan - {0x54, 0x54, 0xFE, 0x00}, // 12 = bright red - {0xFE, 0x54, 0xFE, 0x00}, // 13 = bright magenta - {0x54, 0xFE, 0xFE, 0x00}, // 14 = yellow - {0xFE, 0xFE, 0xFE, 0x00} // 15 = white - }; static int vbe_detected = -1; @@ -61,17 +35,16 @@ static struct grub_vbe_mode_info_block active_mode_info; static struct { - struct grub_video_render_target render_target; + struct grub_video_mode_info mode_info; + struct grub_video_render_target *render_target; unsigned int bytes_per_scan_line; unsigned int bytes_per_pixel; grub_uint32_t active_mode; grub_uint8_t *ptr; int index_color_mode; - struct grub_video_palette_data palette[256]; } framebuffer; -static struct grub_video_render_target *render_target; static grub_uint32_t initial_mode; static grub_uint32_t mode_in_use = 0x55aa; static grub_uint16_t *mode_list; @@ -142,6 +115,7 @@ grub_vbe_set_video_mode (grub_uint32_t mode, { grub_vbe_status_t status; grub_uint32_t old_mode; + grub_err_t err; /* Make sure that VBE is supported. */ grub_vbe_probe (0); @@ -239,15 +213,26 @@ grub_vbe_set_video_mode (grub_uint32_t mode, { struct grub_vbe_palette_data *palette = (struct grub_vbe_palette_data *) GRUB_MEMORY_MACHINE_SCRATCH_ADDR; + unsigned i; /* Make sure that the BIOS can reach the palette. */ - grub_memcpy (palette, vga_colors, sizeof (vga_colors)); - status = grub_vbe_bios_set_palette_data (sizeof (vga_colors) - / sizeof (struct grub_vbe_palette_data), - 0, - palette); + for (i = 0; i < GRUB_VIDEO_FBSTD_NUMCOLORS; i++) + { + palette[i].red = grub_video_fbstd_colors[i].r; + palette[i].green = grub_video_fbstd_colors[i].g; + palette[i].blue = grub_video_fbstd_colors[i].b; + palette[i].alignment = 0; + } + + status = grub_vbe_bios_set_palette_data (GRUB_VIDEO_FBSTD_NUMCOLORS, + 0, palette); /* Just ignore the status. */ + err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, + grub_video_fbstd_colors); + if (err) + return err; + } } @@ -326,43 +311,6 @@ grub_vbe_get_video_mode_info (grub_uint32_t mode, return GRUB_ERR_NONE; } -grub_uint8_t * -grub_video_vbe_get_video_ptr (struct grub_video_i386_vbeblit_info *source, - grub_uint32_t x, grub_uint32_t y) -{ - grub_uint8_t *ptr = 0; - - switch (source->mode_info->bpp) - { - case 32: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 4; - break; - - case 24: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 3; - break; - - case 16: - case 15: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 2; - break; - - case 8: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x; - break; - } - - return ptr; -} - static grub_err_t grub_video_vbe_init (void) { @@ -398,16 +346,15 @@ grub_video_vbe_init (void) { /* Free allocated resources. */ grub_free (mode_list); - mode_list = 0; + mode_list = NULL; return grub_errno; } - /* Reset frame buffer and render target variables. */ + /* Reset frame buffer. */ grub_memset (&framebuffer, 0, sizeof(framebuffer)); - render_target = &framebuffer.render_target; - return GRUB_ERR_NONE; + return grub_video_fb_init (); } static grub_err_t @@ -423,12 +370,11 @@ grub_video_vbe_fini (void) /* TODO: Free any resources allocated by driver. */ grub_free (mode_list); - mode_list = 0; + mode_list = NULL; /* TODO: destroy render targets. */ - /* Return success to caller. */ - return GRUB_ERR_NONE; + return grub_video_fb_fini (); } static grub_err_t @@ -440,7 +386,6 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, struct grub_vbe_mode_info_block best_mode_info; grub_uint32_t best_mode = 0; int depth; - unsigned int i; /* Decode depth from mode_type. If it is zero, then autodetect. */ depth = (mode_type & GRUB_VIDEO_MODE_TYPE_DEPTH_MASK) @@ -520,6 +465,7 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, /* Try to initialize best mode found. */ if (best_mode != 0) { + grub_err_t err; /* If this fails, then we have mode selection heuristics problem, or adapter failure. */ grub_vbe_set_video_mode (best_mode, &active_mode_info); @@ -530,78 +476,54 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, in order to fasten later operations. */ mode_in_use = best_mode; - /* Reset render target to framebuffer one. */ - render_target = &framebuffer.render_target; - - /* Fill mode info details in framebuffer's render target. */ - render_target->mode_info.width = active_mode_info.x_resolution; - render_target->mode_info.height = active_mode_info.y_resolution; + /* Fill mode info details. */ + framebuffer.mode_info.width = active_mode_info.x_resolution; + framebuffer.mode_info.height = active_mode_info.y_resolution; if (framebuffer.index_color_mode) - render_target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; + framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; else - render_target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; + framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; - render_target->mode_info.bpp = active_mode_info.bits_per_pixel; - render_target->mode_info.bytes_per_pixel = framebuffer.bytes_per_pixel; - render_target->mode_info.pitch = framebuffer.bytes_per_scan_line; - render_target->mode_info.number_of_colors = 256; /* TODO: fix me. */ - render_target->mode_info.red_mask_size = active_mode_info.red_mask_size; - render_target->mode_info.red_field_pos = active_mode_info.red_field_position; - render_target->mode_info.green_mask_size = active_mode_info.green_mask_size; - render_target->mode_info.green_field_pos = active_mode_info.green_field_position; - render_target->mode_info.blue_mask_size = active_mode_info.blue_mask_size; - render_target->mode_info.blue_field_pos = active_mode_info.blue_field_position; - render_target->mode_info.reserved_mask_size = active_mode_info.rsvd_mask_size; - render_target->mode_info.reserved_field_pos = active_mode_info.rsvd_field_position; + framebuffer.mode_info.bpp = active_mode_info.bits_per_pixel; + framebuffer.mode_info.bytes_per_pixel = framebuffer.bytes_per_pixel; + framebuffer.mode_info.pitch = framebuffer.bytes_per_scan_line; + framebuffer.mode_info.number_of_colors = 256; /* TODO: fix me. */ + framebuffer.mode_info.red_mask_size = active_mode_info.red_mask_size; + framebuffer.mode_info.red_field_pos = active_mode_info.red_field_position; + framebuffer.mode_info.green_mask_size = active_mode_info.green_mask_size; + framebuffer.mode_info.green_field_pos = active_mode_info.green_field_position; + framebuffer.mode_info.blue_mask_size = active_mode_info.blue_mask_size; + framebuffer.mode_info.blue_field_pos = active_mode_info.blue_field_position; + framebuffer.mode_info.reserved_mask_size = active_mode_info.rsvd_mask_size; + framebuffer.mode_info.reserved_field_pos = active_mode_info.rsvd_field_position; - render_target->mode_info.blit_format = grub_video_get_blit_format (&render_target->mode_info); + framebuffer.mode_info.blit_format = grub_video_get_blit_format (&framebuffer.mode_info); - /* Reset viewport to match new mode. */ - render_target->viewport.x = 0; - render_target->viewport.y = 0; - render_target->viewport.width = active_mode_info.x_resolution; - render_target->viewport.height = active_mode_info.y_resolution; + err = grub_video_fb_create_render_target_from_pointer (&framebuffer.render_target, &framebuffer.mode_info, framebuffer.ptr); - /* Set framebuffer pointer and mark it as non allocated. */ - render_target->is_allocated = 0; - render_target->data = framebuffer.ptr; + if (err) + return err; + + err = grub_video_fb_set_active_render_target (framebuffer.render_target); + + if (err) + return err; /* Copy default palette to initialize emulated palette. */ - for (i = 0; - i < (sizeof (vga_colors) - / sizeof (struct grub_vbe_palette_data)); - i++) - { - framebuffer.palette[i].r = vga_colors[i].red; - framebuffer.palette[i].g = vga_colors[i].green; - framebuffer.palette[i].b = vga_colors[i].blue; - framebuffer.palette[i].a = 0xFF; - } - - return GRUB_ERR_NONE; + err = grub_video_fb_set_palette (0, GRUB_VIDEO_FBSTD_NUMCOLORS, + grub_video_fbstd_colors); + return err; } /* Couldn't found matching mode. */ return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching mode found."); } -static grub_err_t -grub_video_vbe_get_info (struct grub_video_mode_info *mode_info) -{ - /* Copy mode info from active render target. */ - grub_memcpy (mode_info, &render_target->mode_info, - sizeof (struct grub_video_mode_info)); - - return GRUB_ERR_NONE; -} - static grub_err_t grub_video_vbe_set_palette (unsigned int start, unsigned int count, struct grub_video_palette_data *palette_data) { - unsigned int i; - if (framebuffer.index_color_mode) { /* TODO: Implement setting indexed color mode palette to hardware. */ @@ -613,874 +535,8 @@ grub_video_vbe_set_palette (unsigned int start, unsigned int count, } /* Then set color to emulated palette. */ - for (i = 0; (i < count) && ((i + start) < 256); i++) - framebuffer.palette[start + i] = palette_data[i]; - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_video_vbe_get_palette (unsigned int start, unsigned int count, - struct grub_video_palette_data *palette_data) -{ - unsigned int i; - - /* Assume that we know everything from index color palette. */ - for (i = 0; (i < count) && ((i + start) < 256); i++) - palette_data[i] = framebuffer.palette[start + i]; - - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_video_vbe_set_viewport (unsigned int x, unsigned int y, - unsigned int width, unsigned int height) -{ - /* Make sure viewport is withing screen dimensions. If viewport was set - to be out of the region, mark its size as zero. */ - if (x > active_mode_info.x_resolution) - { - x = 0; - width = 0; - } - - if (y > active_mode_info.y_resolution) - { - y = 0; - height = 0; - } - - if (x + width > active_mode_info.x_resolution) - width = active_mode_info.x_resolution - x; - - if (y + height > active_mode_info.y_resolution) - height = active_mode_info.y_resolution - y; - - render_target->viewport.x = x; - render_target->viewport.y = y; - render_target->viewport.width = width; - render_target->viewport.height = height; - - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_video_vbe_get_viewport (unsigned int *x, unsigned int *y, - unsigned int *width, unsigned int *height) -{ - if (x) *x = render_target->viewport.x; - if (y) *y = render_target->viewport.y; - if (width) *width = render_target->viewport.width; - if (height) *height = render_target->viewport.height; - - return GRUB_ERR_NONE; -} - -/* Maps color name to target optimized color format. */ -static grub_video_color_t -grub_video_vbe_map_color (grub_uint32_t color_name) -{ - /* TODO: implement color theme mapping code. */ - - if (color_name < 256) - { - if ((render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) - return color_name; - else - { - grub_video_color_t color; - - color = grub_video_vbe_map_rgb (framebuffer.palette[color_name].r, - framebuffer.palette[color_name].g, - framebuffer.palette[color_name].b); - - return color; - } - } - - return 0; -} - -/* Maps RGB to target optimized color format. */ -grub_video_color_t -grub_video_vbe_map_rgb (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue) -{ - if ((render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) - { - int minindex = 0; - int delta = 0; - int tmp; - int val; - int i; - - /* Find best matching color. */ - for (i = 0; i < 256; i++) - { - val = framebuffer.palette[i].r - red; - tmp = val * val; - val = framebuffer.palette[i].g - green; - tmp += val * val; - val = framebuffer.palette[i].b - blue; - tmp += val * val; - - if (i == 0) - delta = tmp; - - if (tmp < delta) - { - delta = tmp; - minindex = i; - if (tmp == 0) - break; - } - } - - return minindex; - } - else if ((render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) - { - if (red == render_target->mode_info.fg_red - && green == render_target->mode_info.fg_green - && blue == render_target->mode_info.fg_blue) - return 1; - else - return 0; - } - else - { - grub_uint32_t value; - grub_uint8_t alpha = 255; /* Opaque color. */ - - red >>= 8 - render_target->mode_info.red_mask_size; - green >>= 8 - render_target->mode_info.green_mask_size; - blue >>= 8 - render_target->mode_info.blue_mask_size; - alpha >>= 8 - render_target->mode_info.reserved_mask_size; - - value = red << render_target->mode_info.red_field_pos; - value |= green << render_target->mode_info.green_field_pos; - value |= blue << render_target->mode_info.blue_field_pos; - value |= alpha << render_target->mode_info.reserved_field_pos; - - return value; - } - -} - -/* Maps RGBA to target optimized color format. */ -grub_video_color_t -grub_video_vbe_map_rgba (grub_uint8_t red, grub_uint8_t green, - grub_uint8_t blue, grub_uint8_t alpha) -{ - if ((render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) - /* No alpha available in index color modes, just use - same value as in only RGB modes. */ - return grub_video_vbe_map_rgb (red, green, blue); - else if ((render_target->mode_info.mode_type - & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) - { - if (red == render_target->mode_info.fg_red - && green == render_target->mode_info.fg_green - && blue == render_target->mode_info.fg_blue - && alpha == render_target->mode_info.fg_alpha) - return 1; - else - return 0; - } - else - { - grub_uint32_t value; - - red >>= 8 - render_target->mode_info.red_mask_size; - green >>= 8 - render_target->mode_info.green_mask_size; - blue >>= 8 - render_target->mode_info.blue_mask_size; - alpha >>= 8 - render_target->mode_info.reserved_mask_size; - - value = red << render_target->mode_info.red_field_pos; - value |= green << render_target->mode_info.green_field_pos; - value |= blue << render_target->mode_info.blue_field_pos; - value |= alpha << render_target->mode_info.reserved_field_pos; - - return value; - } -} - -/* Splits target optimized format to components. */ -grub_err_t grub_video_vbe_unmap_color (grub_video_color_t color, - grub_uint8_t *red, grub_uint8_t *green, - grub_uint8_t *blue, grub_uint8_t *alpha) -{ - struct grub_video_i386_vbeblit_info target_info; - - target_info.mode_info = &render_target->mode_info; - target_info.data = render_target->data; - - grub_video_vbe_unmap_color_int (&target_info, color, red, green, blue, alpha); - - return GRUB_ERR_NONE; -} - -/* Splits color in source format to components. */ -void -grub_video_vbe_unmap_color_int (struct grub_video_i386_vbeblit_info * source, - grub_video_color_t color, - grub_uint8_t *red, grub_uint8_t *green, - grub_uint8_t *blue, grub_uint8_t *alpha) -{ - struct grub_video_mode_info *mode_info; - mode_info = source->mode_info; - - if ((mode_info->mode_type - & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) - { - /* If we have an out-of-bounds color, return transparent black. */ - if (color > 255) - { - *red = 0; - *green = 0; - *blue = 0; - *alpha = 0; - return; - } - - *red = framebuffer.palette[color].r; - *green = framebuffer.palette[color].g; - *blue = framebuffer.palette[color].b; - *alpha = framebuffer.palette[color].a; - return; - } - else if ((mode_info->mode_type - & GRUB_VIDEO_MODE_TYPE_1BIT_BITMAP) != 0) - { - if (color & 1) - { - *red = mode_info->fg_red; - *green = mode_info->fg_green; - *blue = mode_info->fg_blue; - *alpha = mode_info->fg_alpha; - } - else - { - *red = mode_info->bg_red; - *green = mode_info->bg_green; - *blue = mode_info->bg_blue; - *alpha = mode_info->bg_alpha; - } - } - else - { - grub_uint32_t tmp; - - /* Get red component. */ - tmp = color >> mode_info->red_field_pos; - tmp &= (1 << mode_info->red_mask_size) - 1; - tmp <<= 8 - mode_info->red_mask_size; - tmp |= (1 << (8 - mode_info->red_mask_size)) - 1; - *red = tmp & 0xFF; - - /* Get green component. */ - tmp = color >> mode_info->green_field_pos; - tmp &= (1 << mode_info->green_mask_size) - 1; - tmp <<= 8 - mode_info->green_mask_size; - tmp |= (1 << (8 - mode_info->green_mask_size)) - 1; - *green = tmp & 0xFF; - - /* Get blue component. */ - tmp = color >> mode_info->blue_field_pos; - tmp &= (1 << mode_info->blue_mask_size) - 1; - tmp <<= 8 - mode_info->blue_mask_size; - tmp |= (1 << (8 - mode_info->blue_mask_size)) - 1; - *blue = tmp & 0xFF; - - /* Get alpha component. */ - if (source->mode_info->reserved_mask_size > 0) - { - tmp = color >> mode_info->reserved_field_pos; - tmp &= (1 << mode_info->reserved_mask_size) - 1; - tmp <<= 8 - mode_info->reserved_mask_size; - tmp |= (1 << (8 - mode_info->reserved_mask_size)) - 1; - } - else - /* If there is no alpha component, assume it opaque. */ - tmp = 255; - - *alpha = tmp & 0xFF; - } -} - -static grub_err_t -grub_video_vbe_fill_rect (grub_video_color_t color, int x, int y, - unsigned int width, unsigned int height) -{ - struct grub_video_i386_vbeblit_info target; - - /* Make sure there is something to do. */ - if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) - return GRUB_ERR_NONE; - if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) - return GRUB_ERR_NONE; - - /* Do not allow drawing out of viewport. */ - if (x < 0) - { - width += x; - x = 0; - } - if (y < 0) - { - height += y; - y = 0; - } - - if ((x + width) > render_target->viewport.width) - width = render_target->viewport.width - x; - if ((y + height) > render_target->viewport.height) - height = render_target->viewport.height - y; - - /* Add viewport offset. */ - x += render_target->viewport.x; - y += render_target->viewport.y; - - /* Use vbeblit_info to encapsulate rendering. */ - target.mode_info = &render_target->mode_info; - target.data = render_target->data; - - /* Try to figure out more optimized version. Note that color is already - mapped to target format so we can make assumptions based on that. */ - if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) - { - grub_video_i386_vbefill_direct32 (&target, color, x, y, - width, height); - return GRUB_ERR_NONE; - } - else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) - { - grub_video_i386_vbefill_direct32 (&target, color, x, y, - width, height); - return GRUB_ERR_NONE; - } - else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) - { - grub_video_i386_vbefill_direct24 (&target, color, x, y, - width, height); - return GRUB_ERR_NONE; - } - else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_565) - { - grub_video_i386_vbefill_direct16 (&target, color, x, y, - width, height); - return GRUB_ERR_NONE; - } - else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_565) - { - grub_video_i386_vbefill_direct16 (&target, color, x, y, - width, height); - return GRUB_ERR_NONE; - } - else if (target.mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbefill_direct8 (&target, color, x, y, - width, height); - return GRUB_ERR_NONE; - } - - /* No optimized version found, use default (slow) filler. */ - grub_video_i386_vbefill (&target, color, x, y, width, height); - - return GRUB_ERR_NONE; -} - -/* NOTE: This function assumes that given coordinates are within bounds of - handled data. */ -static void -common_blitter (struct grub_video_i386_vbeblit_info *target, - struct grub_video_i386_vbeblit_info *source, - enum grub_video_blit_operators oper, int x, int y, - unsigned int width, unsigned int height, - int offset_x, int offset_y) -{ - if (oper == GRUB_VIDEO_BLIT_REPLACE) - { - /* Try to figure out more optimized version for replace operator. */ - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) - { - grub_video_i386_vbeblit_replace_directN (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) - { - grub_video_i386_vbeblit_replace_BGRX8888_RGBX8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) - { - grub_video_i386_vbeblit_replace_BGR888_RGBX8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) - { - grub_video_i386_vbeblit_replace_RGB888_RGBX8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_replace_index_RGBX8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) - { - grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) - { - grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) - { - grub_video_i386_vbeblit_replace_BGR888_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) - { - grub_video_i386_vbeblit_replace_directN (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_replace_index_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) - { - grub_video_i386_vbeblit_replace_directN (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_replace_directN (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - - /* No optimized replace operator found, use default (slow) blitter. */ - grub_video_i386_vbeblit_replace (target, source, x, y, width, height, - offset_x, offset_y); - } - else - { - /* Try to figure out more optimized blend operator. */ - if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) - { - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) - { - grub_video_i386_vbeblit_blend_BGRA8888_RGBA8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) - { - grub_video_i386_vbeblit_blend_RGBA8888_RGBA8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) - { - grub_video_i386_vbeblit_blend_BGR888_RGBA8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) - { - grub_video_i386_vbeblit_blend_RGB888_RGBA8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_blend_index_RGBA8888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) - { - /* Note: There is really no alpha information here, so blend is - changed to replace. */ - - if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888) - { - grub_video_i386_vbeblit_replace_BGRX8888_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) - { - grub_video_i386_vbeblit_replace_RGBX8888_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_BGR_888) - { - grub_video_i386_vbeblit_replace_BGR888_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_RGB_888) - { - grub_video_i386_vbeblit_replace_directN (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - else if (target->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_INDEXCOLOR) - { - grub_video_i386_vbeblit_replace_index_RGB888 (target, source, - x, y, width, height, - offset_x, offset_y); - return; - } - } - - /* No optimized blend operation found, use default (slow) blitter. */ - grub_video_i386_vbeblit_blend (target, source, x, y, width, height, - offset_x, offset_y); - } -} - -static grub_err_t -grub_video_vbe_blit_bitmap (struct grub_video_bitmap *bitmap, - enum grub_video_blit_operators oper, int x, int y, - int offset_x, int offset_y, - unsigned int width, unsigned int height) -{ - struct grub_video_i386_vbeblit_info source; - struct grub_video_i386_vbeblit_info target; - - /* Make sure there is something to do. */ - if ((width == 0) || (height == 0)) - return GRUB_ERR_NONE; - if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) - return GRUB_ERR_NONE; - if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) - return GRUB_ERR_NONE; - if ((x + (int)bitmap->mode_info.width) < 0) - return GRUB_ERR_NONE; - if ((y + (int)bitmap->mode_info.height) < 0) - return GRUB_ERR_NONE; - if ((offset_x >= (int)bitmap->mode_info.width) - || (offset_x + (int)width < 0)) - return GRUB_ERR_NONE; - if ((offset_y >= (int)bitmap->mode_info.height) - || (offset_y + (int)height < 0)) - return GRUB_ERR_NONE; - - /* If we have negative coordinates, optimize drawing to minimum. */ - if (offset_x < 0) - { - width += offset_x; - x -= offset_x; - offset_x = 0; - } - - if (offset_y < 0) - { - height += offset_y; - y -= offset_y; - offset_y = 0; - } - - if (x < 0) - { - width += x; - offset_x -= x; - x = 0; - } - - if (y < 0) - { - height += y; - offset_y -= y; - y = 0; - } - - /* Do not allow drawing out of viewport. */ - if ((x + width) > render_target->viewport.width) - width = render_target->viewport.width - x; - if ((y + height) > render_target->viewport.height) - height = render_target->viewport.height - y; - - if ((offset_x + width) > bitmap->mode_info.width) - width = bitmap->mode_info.width - offset_x; - if ((offset_y + height) > bitmap->mode_info.height) - height = bitmap->mode_info.height - offset_y; - - /* Limit drawing to source render target dimensions. */ - if (width > bitmap->mode_info.width) - width = bitmap->mode_info.width; - - if (height > bitmap->mode_info.height) - height = bitmap->mode_info.height; - - /* Add viewport offset. */ - x += render_target->viewport.x; - y += render_target->viewport.y; - - /* Use vbeblit_info to encapsulate rendering. */ - source.mode_info = &bitmap->mode_info; - source.data = bitmap->data; - target.mode_info = &render_target->mode_info; - target.data = render_target->data; - - /* Do actual blitting. */ - common_blitter (&target, &source, oper, x, y, width, height, - offset_x, offset_y); - - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_video_vbe_blit_render_target (struct grub_video_render_target *source, - enum grub_video_blit_operators oper, - int x, int y, int offset_x, int offset_y, - unsigned int width, unsigned int height) -{ - struct grub_video_i386_vbeblit_info source_info; - struct grub_video_i386_vbeblit_info target_info; - - /* Make sure there is something to do. */ - if ((width == 0) || (height == 0)) - return GRUB_ERR_NONE; - if ((x >= (int)render_target->viewport.width) || (x + (int)width < 0)) - return GRUB_ERR_NONE; - if ((y >= (int)render_target->viewport.height) || (y + (int)height < 0)) - return GRUB_ERR_NONE; - if ((x + (int)source->mode_info.width) < 0) - return GRUB_ERR_NONE; - if ((y + (int)source->mode_info.height) < 0) - return GRUB_ERR_NONE; - if ((offset_x >= (int)source->mode_info.width) - || (offset_x + (int)width < 0)) - return GRUB_ERR_NONE; - if ((offset_y >= (int)source->mode_info.height) - || (offset_y + (int)height < 0)) - return GRUB_ERR_NONE; - - /* If we have negative coordinates, optimize drawing to minimum. */ - if (offset_x < 0) - { - width += offset_x; - x -= offset_x; - offset_x = 0; - } - - if (offset_y < 0) - { - height += offset_y; - y -= offset_y; - offset_y = 0; - } - - if (x < 0) - { - width += x; - offset_x -= x; - x = 0; - } - - if (y < 0) - { - height += y; - offset_y -= y; - y = 0; - } - - /* Do not allow drawing out of viewport. */ - if ((x + width) > render_target->viewport.width) - width = render_target->viewport.width - x; - if ((y + height) > render_target->viewport.height) - height = render_target->viewport.height - y; - - if ((offset_x + width) > source->mode_info.width) - width = source->mode_info.width - offset_x; - if ((offset_y + height) > source->mode_info.height) - height = source->mode_info.height - offset_y; - - /* Limit drawing to source render target dimensions. */ - if (width > source->mode_info.width) - width = source->mode_info.width; - - if (height > source->mode_info.height) - height = source->mode_info.height; - - /* Add viewport offset. */ - x += render_target->viewport.x; - y += render_target->viewport.y; - - /* Use vbeblit_info to encapsulate rendering. */ - source_info.mode_info = &source->mode_info; - source_info.data = source->data; - target_info.mode_info = &render_target->mode_info; - target_info.data = render_target->data; - - /* Do actual blitting. */ - common_blitter (&target_info, &source_info, oper, x, y, width, height, - offset_x, offset_y); - - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_video_vbe_scroll (grub_video_color_t color, int dx, int dy) -{ - int width; - int height; - int src_x; - int src_y; - int dst_x; - int dst_y; - - /* 1. Check if we have something to do. */ - if ((dx == 0) && (dy == 0)) - return GRUB_ERR_NONE; - - width = render_target->viewport.width - grub_abs (dx); - height = render_target->viewport.height - grub_abs (dy); - - if (dx < 0) - { - src_x = render_target->viewport.x - dx; - dst_x = render_target->viewport.x; - } - else - { - src_x = render_target->viewport.x; - dst_x = render_target->viewport.x + dx; - } - - if (dy < 0) - { - src_y = render_target->viewport.y - dy; - dst_y = render_target->viewport.y; - } - else - { - src_y = render_target->viewport.y; - dst_y = render_target->viewport.y + dy; - } - - /* 2. Check if there is need to copy data. */ - if ((grub_abs (dx) < render_target->viewport.width) - && (grub_abs (dy) < render_target->viewport.height)) - { - /* 3. Move data in render target. */ - struct grub_video_i386_vbeblit_info target; - grub_uint8_t *src; - grub_uint8_t *dst; - int j; - - target.mode_info = &render_target->mode_info; - target.data = render_target->data; - - /* Check vertical direction of the move. */ - if (dy <= 0) - /* 3a. Move data upwards. */ - for (j = 0; j < height; j++) - { - dst = grub_video_vbe_get_video_ptr (&target, dst_x, dst_y + j); - src = grub_video_vbe_get_video_ptr (&target, src_x, src_y + j); - grub_memmove (dst, src, - width * target.mode_info->bytes_per_pixel); - } - else - /* 3b. Move data downwards. */ - for (j = (height - 1); j >= 0; j--) - { - dst = grub_video_vbe_get_video_ptr (&target, dst_x, dst_y + j); - src = grub_video_vbe_get_video_ptr (&target, src_x, src_y + j); - grub_memmove (dst, src, - width * target.mode_info->bytes_per_pixel); - } - } - - /* 4. Fill empty space with specified color. In this implementation - there might be colliding areas but at the moment there is no need - to optimize this. */ - - /* 4a. Fill top & bottom parts. */ - if (dy > 0) - grub_video_vbe_fill_rect (color, 0, 0, render_target->viewport.width, dy); - else if (dy < 0) - { - if (render_target->viewport.height < grub_abs (dy)) - dy = -render_target->viewport.height; - - grub_video_vbe_fill_rect (color, 0, render_target->viewport.height + dy, - render_target->viewport.width, -dy); - } - - /* 4b. Fill left & right parts. */ - if (dx > 0) - grub_video_vbe_fill_rect (color, 0, 0, - dx, render_target->viewport.height); - else if (dx < 0) - { - if (render_target->viewport.width < grub_abs (dx)) - dx = -render_target->viewport.width; - - grub_video_vbe_fill_rect (color, render_target->viewport.width + dx, 0, - -dx, render_target->viewport.height); - } - - return GRUB_ERR_NONE; + return grub_video_fb_set_palette (start, count, palette_data); } static grub_err_t @@ -1490,129 +546,31 @@ grub_video_vbe_swap_buffers (void) return GRUB_ERR_NONE; } -static grub_err_t -grub_video_vbe_create_render_target (struct grub_video_render_target **result, - unsigned int width, unsigned int height, - unsigned int mode_type __attribute__ ((unused))) -{ - struct grub_video_render_target *target; - unsigned int size; - - /* Validate arguments. */ - if ((! result) - || (width == 0) - || (height == 0)) - return grub_error (GRUB_ERR_BAD_ARGUMENT, - "invalid argument given."); - - /* Allocate memory for render target. */ - target = grub_malloc (sizeof (struct grub_video_render_target)); - if (! target) - return grub_errno; - - /* TODO: Implement other types too. - Currently only 32bit render targets are supported. */ - - /* Mark render target as allocated. */ - target->is_allocated = 1; - - /* Maximize viewport. */ - target->viewport.x = 0; - target->viewport.y = 0; - target->viewport.width = width; - target->viewport.height = height; - - /* Setup render target format. */ - target->mode_info.width = width; - target->mode_info.height = height; - target->mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB - | GRUB_VIDEO_MODE_TYPE_ALPHA; - target->mode_info.bpp = 32; - target->mode_info.bytes_per_pixel = 4; - target->mode_info.pitch = target->mode_info.bytes_per_pixel * width; - target->mode_info.number_of_colors = 256; /* Emulated palette. */ - target->mode_info.red_mask_size = 8; - target->mode_info.red_field_pos = 0; - target->mode_info.green_mask_size = 8; - target->mode_info.green_field_pos = 8; - target->mode_info.blue_mask_size = 8; - target->mode_info.blue_field_pos = 16; - target->mode_info.reserved_mask_size = 8; - target->mode_info.reserved_field_pos = 24; - - target->mode_info.blit_format = grub_video_get_blit_format (&target->mode_info); - - /* Calculate size needed for the data. */ - size = (width * target->mode_info.bytes_per_pixel) * height; - - target->data = grub_malloc (size); - if (! target->data) - { - grub_free (target); - return grub_errno; - } - - /* Clear render target with black and maximum transparency. */ - grub_memset (target->data, 0, size); - - /* TODO: Add render target to render target list. */ - - /* Save result to caller. */ - *result = target; - - return GRUB_ERR_NONE; -} - -static grub_err_t -grub_video_vbe_delete_render_target (struct grub_video_render_target *target) -{ - /* If there is no target, then just return without error. */ - if (! target) - return GRUB_ERR_NONE; - - /* TODO: Delist render target from render target list. */ - - /* If this is software render target, free it's memory. */ - if (target->is_allocated) - grub_free (target->data); - - /* Free render target. */ - grub_free (target); - - return GRUB_ERR_NONE; -} - static grub_err_t grub_video_vbe_set_active_render_target (struct grub_video_render_target *target) { - if (target == GRUB_VIDEO_RENDER_TARGET_FRONT_BUFFER) - { - render_target = &framebuffer.render_target; + if (target == GRUB_VIDEO_RENDER_TARGET_DISPLAY) + target = framebuffer.render_target; - return GRUB_ERR_NONE; - } - - if (target == GRUB_VIDEO_RENDER_TARGET_BACK_BUFFER) - return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, - "double buffering not implemented yet."); - - if (! target->data) - return grub_error (GRUB_ERR_BAD_ARGUMENT, - "invalid render target given."); - - render_target = target; - - return GRUB_ERR_NONE; + return grub_video_fb_set_active_render_target (target); } static grub_err_t -grub_video_vbe_get_active_render_target (struct grub_video_render_target **target) +grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info, + void **framebuf) { - *target = render_target; + grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); + *framebuf = (char *) framebuffer.ptr; + + grub_free (mode_list); + mode_list = NULL; + + grub_video_fb_fini (); return GRUB_ERR_NONE; } + static struct grub_video_adapter grub_video_vbe_adapter = { .name = "VESA BIOS Extension Video Driver", @@ -1620,24 +578,25 @@ static struct grub_video_adapter grub_video_vbe_adapter = .init = grub_video_vbe_init, .fini = grub_video_vbe_fini, .setup = grub_video_vbe_setup, - .get_info = grub_video_vbe_get_info, + .get_info = grub_video_fb_get_info, + .get_info_and_fini = grub_video_vbe_get_info_and_fini, .set_palette = grub_video_vbe_set_palette, - .get_palette = grub_video_vbe_get_palette, - .set_viewport = grub_video_vbe_set_viewport, - .get_viewport = grub_video_vbe_get_viewport, - .map_color = grub_video_vbe_map_color, - .map_rgb = grub_video_vbe_map_rgb, - .map_rgba = grub_video_vbe_map_rgba, - .unmap_color = grub_video_vbe_unmap_color, - .fill_rect = grub_video_vbe_fill_rect, - .blit_bitmap = grub_video_vbe_blit_bitmap, - .blit_render_target = grub_video_vbe_blit_render_target, - .scroll = grub_video_vbe_scroll, + .get_palette = grub_video_fb_get_palette, + .set_viewport = grub_video_fb_set_viewport, + .get_viewport = grub_video_fb_get_viewport, + .map_color = grub_video_fb_map_color, + .map_rgb = grub_video_fb_map_rgb, + .map_rgba = grub_video_fb_map_rgba, + .unmap_color = grub_video_fb_unmap_color, + .fill_rect = grub_video_fb_fill_rect, + .blit_bitmap = grub_video_fb_blit_bitmap, + .blit_render_target = grub_video_fb_blit_render_target, + .scroll = grub_video_fb_scroll, .swap_buffers = grub_video_vbe_swap_buffers, - .create_render_target = grub_video_vbe_create_render_target, - .delete_render_target = grub_video_vbe_delete_render_target, + .create_render_target = grub_video_fb_create_render_target, + .delete_render_target = grub_video_fb_delete_render_target, .set_active_render_target = grub_video_vbe_set_active_render_target, - .get_active_render_target = grub_video_vbe_get_active_render_target, + .get_active_render_target = grub_video_fb_get_active_render_target, .next = 0 }; diff --git a/video/video.c b/video/video.c index c22947b63..36ebfd1b8 100644 --- a/video/video.c +++ b/video/video.c @@ -93,6 +93,24 @@ grub_video_get_info (struct grub_video_mode_info *mode_info) return grub_video_adapter_active->get_info (mode_info); } +/* Get information about active video mode. */ +grub_err_t +grub_video_get_info_and_fini (struct grub_video_mode_info *mode_info, + void **framebuffer) +{ + grub_err_t err; + + if (! grub_video_adapter_active) + return grub_error (GRUB_ERR_BAD_DEVICE, "No video mode activated"); + + err = grub_video_adapter_active->get_info_and_fini (mode_info, framebuffer); + if (err) + return err; + + grub_video_adapter_active = 0; + return GRUB_ERR_NONE; +} + /* Determine optimized blitting formation for specified video mode info. */ enum grub_video_blit_format grub_video_get_blit_format (struct grub_video_mode_info *mode_info) @@ -380,7 +398,7 @@ grub_video_get_active_render_target (struct grub_video_render_target **target) } grub_err_t -grub_video_set_mode (char *modestring, +grub_video_set_mode (const char *modestring, int NESTED_FUNC_ATTR (*hook) (grub_video_adapter_t p, struct grub_video_mode_info *mode_info)) { @@ -695,8 +713,6 @@ grub_video_set_mode (char *modestring, /* Initialize Video API module. */ GRUB_MOD_INIT(video_video) { - grub_video_adapter_active = 0; - grub_video_adapter_list = 0; } /* Finalize Video API module. */ From c0d8b5d42a94ac8cb6884ae40997a80bbb427eb3 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 14 Aug 2009 13:31:09 +0000 Subject: [PATCH 1031/1707] 2009-08-14 Vladimir Serbinenko Split ufs.mod into ufs1.mod and ufs2.mod. * conf/common.rmk (grub_probe_SOURCES): Add fs/ufs2.c. (grub_fstest_SOURCES): Likewise. (pkglib_MODULES): Remove ufs.mod. Add ufs1.mod and ufs2.mod. (ufs_mod_SOURCES): Remove. (ufs_mod_CFLAGS): Likewise. (ufs_mod_LDFLAGS): Likewise. (ufs1_mod_SOURCES): New variable. (ufs1_mod_CFLAGS): Likewise. (ufs1_mod_LDFLAGS): Likewise. (ufs2_mod_SOURCES): New variable. (ufs2_mod_CFLAGS): Likewise. (ufs2_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add fs/ufs2.c. * conf/i386-efi.rmk (util/i386/efi/grub-mkimage.c_DEPENDENCIES): Likewise. (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. (grub_setup_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64.rmk (grub_emu_SOURCES): Likewise. (grub_setup_SOURCES): Likewise. * conf/x86_64-efi.rmk (util/i386/efi/grub-mkimage.c_DEPENDENCIES): Likewise. * fs/ufs2.c: New file. * fs/ufs.c: Separate UFS1 from UFS2 by using preprocessor. --- ChangeLog | 31 +++++ conf/common.rmk | 19 ++- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.rmk | 4 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 4 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 4 +- conf/x86_64-efi.rmk | 4 +- fs/ufs.c | 276 +++++++++++++++++++------------------- fs/ufs2.c | 3 + 11 files changed, 192 insertions(+), 159 deletions(-) create mode 100644 fs/ufs2.c diff --git a/ChangeLog b/ChangeLog index 9ea7886d6..a4ec76db9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,34 @@ +2009-08-14 Vladimir Serbinenko + + Split ufs.mod into ufs1.mod and ufs2.mod. + + * conf/common.rmk (grub_probe_SOURCES): Add fs/ufs2.c. + (grub_fstest_SOURCES): Likewise. + (pkglib_MODULES): Remove ufs.mod. Add ufs1.mod and ufs2.mod. + (ufs_mod_SOURCES): Remove. + (ufs_mod_CFLAGS): Likewise. + (ufs_mod_LDFLAGS): Likewise. + (ufs1_mod_SOURCES): New variable. + (ufs1_mod_CFLAGS): Likewise. + (ufs1_mod_LDFLAGS): Likewise. + (ufs1_mod_SOURCES): New variable. + (ufs1_mod_CFLAGS): Likewise. + (ufs1_mod_LDFLAGS): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add fs/ufs2.c. + * conf/i386-efi.rmk (util/i386/efi/grub-mkimage.c_DEPENDENCIES): + Likewise. + (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + (grub_setup_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64.rmk (grub_emu_SOURCES): Likewise. + (grub_setup_SOURCES): Likewise. + * conf/x86_64-efi.rmk (util/i386/efi/grub-mkimage.c_DEPENDENCIES): + Likewise. + * fs/ufs2.c: New file. + * fs/ufs.c: Separate UFS1 from UFS2 by using preprocessor. + 2009-08-14 Vladimir Serbinenko Framebuffer split. diff --git a/conf/common.rmk b/conf/common.rmk index 5e9330237..b0d3785d1 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -17,7 +17,7 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ partmap/pc.c partmap/apple.c partmap/sun.c partmap/gpt.c\ kern/fs.c kern/env.c fs/fshelp.c \ @@ -38,7 +38,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ kern/partition.c partmap/pc.c partmap/apple.c partmap/sun.c \ partmap/gpt.c \ @@ -174,7 +174,7 @@ sbin_SCRIPTS += grub-dumpbios CLEANFILES += grub-dumpbios # Filing systems. -pkglib_MODULES += fshelp.mod fat.mod ufs.mod ext2.mod ntfs.mod \ +pkglib_MODULES += fshelp.mod fat.mod ufs1.mod ufs2.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod tar.mod \ udf.mod afs.mod befs.mod @@ -189,10 +189,15 @@ fat_mod_SOURCES = fs/fat.c fat_mod_CFLAGS = $(COMMON_CFLAGS) fat_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For ufs.mod. -ufs_mod_SOURCES = fs/ufs.c -ufs_mod_CFLAGS = $(COMMON_CFLAGS) -ufs_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For ufs1.mod. +ufs1_mod_SOURCES = fs/ufs.c +ufs1_mod_CFLAGS = $(COMMON_CFLAGS) +ufs1_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For ufs2.mod. +ufs2_mod_SOURCES = fs/ufs2.c +ufs2_mod_CFLAGS = $(COMMON_CFLAGS) +ufs2_mod_LDFLAGS = $(COMMON_LDFLAGS) # For ext2.mod. ext2_mod_SOURCES = fs/ext2.c diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 7ba573795..ce2576b95 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -116,7 +116,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 9177b9d44..6e3cbcf6d 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -24,7 +24,7 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ # fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ -# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ +# fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. @@ -44,7 +44,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 032197906..65d1c6bde 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -71,7 +71,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index debb40364..0ef5e4730 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -102,7 +102,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ partmap/pc.c partmap/gpt.c \ \ @@ -146,7 +146,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index af29d23ad..c30f61a48 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -51,7 +51,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index aabccee5f..b26496d20 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -78,7 +78,7 @@ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ partmap/amiga.c partmap/apple.c partmap/pc.c \ partmap/sun.c partmap/acorn.c \ @@ -108,7 +108,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 21da0e1cf..71a90ce18 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -23,7 +23,7 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ # fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ -# fs/ufs.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ +# fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. @@ -42,7 +42,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/fs/ufs.c b/fs/ufs.c index 336507c6d..75398617d 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -25,9 +25,12 @@ #include #include - +#ifdef MODE_UFS2 +#define GRUB_UFS_MAGIC 0x19540119 +#else #define GRUB_UFS_MAGIC 0x11954 -#define GRUB_UFS2_MAGIC 0x19540119 +#endif + #define GRUB_UFS_INODE 2 #define GRUB_UFS_FILETYPE_DIR 4 #define GRUB_UFS_FILETYPE_LNK 10 @@ -44,20 +47,29 @@ #define GRUB_UFS_VOLNAME_LEN 32 /* Calculate in which group the inode can be found. */ -#define inode_group(inode,sblock) () - #define UFS_BLKSZ(sblock) (grub_le_to_cpu32 (sblock->bsize)) -#define INODE(data,field) (data->ufs_type == UFS1 ? \ - data->inode. field : data->inode2. field) -#define INODE_ENDIAN(data,field,bits1,bits2) (data->ufs_type == UFS1 ? \ - grub_le_to_cpu##bits1 (data->inode.field) : \ - grub_le_to_cpu##bits2 (data->inode2.field)) +#define INODE(data,field) data->inode. field +#ifdef MODE_UFS2 +#define INODE_ENDIAN(data,field,bits1,bits2) grub_le_to_cpu##bits2 (data->inode.field) +#else +#define INODE_ENDIAN(data,field,bits1,bits2) grub_le_to_cpu##bits1 (data->inode.field) +#endif + #define INODE_SIZE(data) INODE_ENDIAN (data,size,32,64) #define INODE_NBLOCKS(data) INODE_ENDIAN (data,nblocks,32,64) #define INODE_MODE(data) INODE_ENDIAN (data,mode,16,16) -#define INODE_BLKSZ(data) (data->ufs_type == UFS1 ? 4 : 8) +#ifdef MODE_UFS2 +#define INODE_BLKSZ 8 +#else +#define INODE_BLKSZ 4 +#endif +#ifdef MODE_UFS2 +#define UFS_INODE_PER_BLOCK 2 +#else +#define UFS_INODE_PER_BLOCK 4 +#endif #define INODE_DIRBLOCKS(data,blk) INODE_ENDIAN \ (data,blocks.dir_blocks[blk],32,64) #define INODE_INDIRBLOCKS(data,blk) INODE_ENDIAN \ @@ -111,35 +123,9 @@ struct grub_ufs_sblock grub_uint32_t magic; }; +#ifdef MODE_UFS2 /* UFS inode. */ struct grub_ufs_inode -{ - grub_uint16_t mode; - grub_uint16_t nlinks; - grub_uint16_t uid; - grub_uint16_t gid; - grub_int64_t size; - grub_uint64_t atime; - grub_uint64_t mtime; - grub_uint64_t ctime; - union - { - struct - { - grub_uint32_t dir_blocks[GRUB_UFS_DIRBLKS]; - grub_uint32_t indir_blocks[GRUB_UFS_INDIRBLKS]; - } blocks; - grub_uint8_t symlink[(GRUB_UFS_DIRBLKS + GRUB_UFS_INDIRBLKS) * 4]; - }; - grub_uint32_t flags; - grub_uint32_t nblocks; - grub_uint32_t gen; - grub_uint32_t unused; - grub_uint8_t pad[12]; -} __attribute__ ((packed)); - -/* UFS inode. */ -struct grub_ufs2_inode { grub_uint16_t mode; grub_uint16_t nlinks; @@ -173,6 +159,34 @@ struct grub_ufs2_inode grub_uint8_t unused[24]; } __attribute__ ((packed)); +#else +/* UFS inode. */ +struct grub_ufs_inode +{ + grub_uint16_t mode; + grub_uint16_t nlinks; + grub_uint16_t uid; + grub_uint16_t gid; + grub_int64_t size; + grub_uint64_t atime; + grub_uint64_t mtime; + grub_uint64_t ctime; + union + { + struct + { + grub_uint32_t dir_blocks[GRUB_UFS_DIRBLKS]; + grub_uint32_t indir_blocks[GRUB_UFS_INDIRBLKS]; + } blocks; + grub_uint8_t symlink[(GRUB_UFS_DIRBLKS + GRUB_UFS_INDIRBLKS) * 4]; + }; + grub_uint32_t flags; + grub_uint32_t nblocks; + grub_uint32_t gen; + grub_uint32_t unused; + grub_uint8_t pad[12]; +} __attribute__ ((packed)); +#endif /* Directory entry. */ struct grub_ufs_dirent @@ -195,17 +209,7 @@ struct grub_ufs_data { struct grub_ufs_sblock sblock; grub_disk_t disk; - union - { - struct grub_ufs_inode inode; - struct grub_ufs2_inode inode2; - }; - enum - { - UFS1, - UFS2, - UNKNOWN - } ufs_type; + struct grub_ufs_inode inode; int ino; int linknest; }; @@ -217,7 +221,7 @@ static grub_err_t grub_ufs_find_file (struct grub_ufs_data *data, const char *path); -static int +static grub_disk_addr_t grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) { struct grub_ufs_sblock *sblock = &data->sblock; @@ -232,32 +236,38 @@ grub_ufs_get_file_block (struct grub_ufs_data *data, unsigned int blk) blk -= GRUB_UFS_DIRBLKS; - indirsz = UFS_BLKSZ (sblock) / INODE_BLKSZ (data); + indirsz = UFS_BLKSZ (sblock) / INODE_BLKSZ; /* Single indirect block. */ if (blk < indirsz) { - grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; +#ifdef MODE_UFS2 + grub_uint64_t indir[UFS_BLKSZ (sblock) / sizeof (grub_uint64_t)]; +#else + grub_uint32_t indir[UFS_BLKSZ (sblock) / sizeof (grub_uint32_t)]; +#endif grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 0) << log2_blksz, 0, sizeof (indir), indir); - return (data->ufs_type == UFS1) ? indir[blk] : indir[blk << 1]; + return indir[blk]; } blk -= indirsz; /* Double indirect block. */ if (blk < indirsz * indirsz) { - grub_uint32_t indir[UFS_BLKSZ (sblock) >> 2]; +#ifdef MODE_UFS2 + grub_uint64_t indir[UFS_BLKSZ (sblock) / sizeof (grub_uint64_t)]; +#else + grub_uint32_t indir[UFS_BLKSZ (sblock) / sizeof (grub_uint32_t)]; +#endif grub_disk_read (data->disk, INODE_INDIRBLOCKS (data, 1) << log2_blksz, 0, sizeof (indir), indir); grub_disk_read (data->disk, - ((data->ufs_type == UFS1) ? - indir[blk / indirsz] : indir [(blk / indirsz) << 1]) + (indir [blk / indirsz]) << log2_blksz, 0, sizeof (indir), indir); - return (data->ufs_type == UFS1) ? - indir[blk % indirsz] : indir[(blk % indirsz) << 1]; + return indir[blk % indirsz]; } @@ -334,7 +344,6 @@ grub_ufs_read_file (struct grub_ufs_data *data, return len; } - /* Read inode INO from the mounted filesystem described by DATA. This inode is used by default now. */ static grub_err_t @@ -351,38 +360,20 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) /* The first block of the group. */ int grpblk = group * (grub_le_to_cpu32 (sblock->frags_per_group)); - if (data->ufs_type == UFS1) + if (!inode) { - if (!inode) - { - inode = (char *) &data->inode; - data->ino = ino; - } - - grub_disk_read (data->disk, - (((grub_le_to_cpu32 (sblock->inoblk_offs) + grpblk) - << grub_le_to_cpu32 (data->sblock.log2_blksz))) - + grpino / 4, - (grpino % 4) * sizeof (struct grub_ufs_inode), - sizeof (struct grub_ufs_inode), - inode); + inode = (char *) &data->inode; + data->ino = ino; } - else - { - if (!inode) - { - inode = (char *) &data->inode2; - data->ino = ino; - } - grub_disk_read (data->disk, - (((grub_le_to_cpu32 (sblock->inoblk_offs) + grpblk) - << grub_le_to_cpu32 (data->sblock.log2_blksz))) - + grpino / 2, - (grpino % 2) * sizeof (struct grub_ufs2_inode), - sizeof (struct grub_ufs2_inode), - inode); - } + grub_disk_read (data->disk, + ((grub_le_to_cpu32 (sblock->inoblk_offs) + grpblk) + << grub_le_to_cpu32 (data->sblock.log2_blksz)) + + grpino / UFS_INODE_PER_BLOCK, + (grpino % UFS_INODE_PER_BLOCK) + * sizeof (struct grub_ufs_inode), + sizeof (struct grub_ufs_inode), + inode); return grub_errno; } @@ -466,9 +457,11 @@ grub_ufs_find_file (struct grub_ufs_data *data, const char *path) (char *) &dirent) < 0) return grub_errno; - namelen = (data->ufs_type == UFS2) - ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen); - +#ifdef MODE_UFS2 + namelen = dirent.namelen_bsd; +#else + namelen = grub_le_to_cpu16 (dirent.namelen); +#endif { char filename[namelen + 1]; @@ -530,8 +523,7 @@ grub_ufs_mount (grub_disk_t disk) if (!data) return 0; - /* Find a UFS1 or UFS2 sblock. */ - data->ufs_type = UNKNOWN; + /* Find a UFS sblock. */ while (*sblklist != -1) { grub_disk_read (disk, *sblklist, 0, sizeof (struct grub_ufs_sblock), @@ -541,31 +533,25 @@ grub_ufs_mount (grub_disk_t disk) if (grub_le_to_cpu32 (data->sblock.magic) == GRUB_UFS_MAGIC) { - data->ufs_type = UFS1; - break; - } - else if (grub_le_to_cpu32 (data->sblock.magic) == GRUB_UFS2_MAGIC) - { - data->ufs_type = UFS2; - break; + data->disk = disk; + data->linknest = 0; + return data; } sblklist++; } - if (data->ufs_type == UNKNOWN) - { - grub_error (GRUB_ERR_BAD_FS, "not an ufs filesystem"); - goto fail; - } - - data->disk = disk; - data->linknest = 0; - return data; fail: - grub_free (data); - if (grub_errno == GRUB_ERR_OUT_OF_RANGE) - grub_error (GRUB_ERR_BAD_FS, "not a ufs filesystem"); + if (grub_errno == GRUB_ERR_NONE || grub_errno == GRUB_ERR_OUT_OF_RANGE) + { +#ifdef MODE_UFS2 + grub_error (GRUB_ERR_BAD_FS, "not an ufs2 filesystem"); +#else + grub_error (GRUB_ERR_BAD_FS, "not an ufs1 filesystem"); +#endif + } + + grub_free (data); return 0; } @@ -615,12 +601,17 @@ grub_ufs_dir (grub_device_t device, const char *path, (char *) &dirent) < 0) break; - namelen = (data->ufs_type == UFS2) - ? dirent.namelen_bsd : grub_le_to_cpu16 (dirent.namelen); +#ifdef MODE_UFS2 + namelen = dirent.namelen_bsd; +#else + namelen = grub_le_to_cpu16 (dirent.namelen); +#endif { char filename[namelen + 1]; struct grub_dirhook_info info; + struct grub_ufs_inode inode; + grub_memset (&info, 0, sizeof (info)); if (grub_ufs_read_file (data, 0, pos + sizeof (dirent), @@ -628,24 +619,12 @@ grub_ufs_dir (grub_device_t device, const char *path, break; filename[namelen] = '\0'; - if (data->ufs_type == UFS1) - { - struct grub_ufs_inode inode; - grub_ufs_read_inode (data, dirent.ino, (char *) &inode); - info.dir = ((grub_le_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE) - == GRUB_UFS_ATTR_DIR); - info.mtime = grub_le_to_cpu64 (inode.mtime); - info.mtimeset = 1; - } - else - { - struct grub_ufs2_inode inode; - grub_ufs_read_inode (data, dirent.ino, (char *) &inode); - info.dir = ((grub_le_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE) - == GRUB_UFS_ATTR_DIR); - info.mtime = grub_le_to_cpu64 (inode.mtime); - info.mtimeset = 1; - } + grub_ufs_read_inode (data, dirent.ino, (char *) &inode); + + info.dir = ((grub_le_to_cpu16 (inode.mode) & GRUB_UFS_ATTR_TYPE) + == GRUB_UFS_ATTR_DIR); + info.mtime = grub_le_to_cpu64 (inode.mtime); + info.mtimeset = 1; if (hook (filename, &info)) break; @@ -716,6 +695,7 @@ grub_ufs_close (grub_file_t file) } +#ifdef MODE_UFS2 static grub_err_t grub_ufs_label (grub_device_t device, char **label) { @@ -727,10 +707,7 @@ grub_ufs_label (grub_device_t device, char **label) data = grub_ufs_mount (device->disk); if (data) - { - if (data->ufs_type == UFS2) - *label = grub_strdup ((char *) data->sblock.volume_name); - } + *label = grub_strdup ((char *) data->sblock.volume_name); grub_dl_unref (my_mod); @@ -738,6 +715,7 @@ grub_ufs_label (grub_device_t device, char **label) return grub_errno; } +#endif static grub_err_t grub_ufs_uuid (grub_device_t device, char **uuid) @@ -748,7 +726,7 @@ grub_ufs_uuid (grub_device_t device, char **uuid) grub_dl_ref (my_mod); data = grub_ufs_mount (disk); - if (data) + if (data && (data->sblock.uuidhi != 0 || data->sblock.uuidlow != 0)) { *uuid = grub_malloc (16 + sizeof ('\0')); grub_sprintf (*uuid, "%08x%08x", @@ -777,10 +755,12 @@ grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) data = grub_ufs_mount (device->disk); if (!data) *tm = 0; - else if (data->ufs_type == UFS1) - *tm = grub_le_to_cpu32 (data->sblock.mtime); else +#ifdef MODE_UFS2 *tm = grub_le_to_cpu64 (data->sblock.mtime2); +#else + *tm = grub_le_to_cpu32 (data->sblock.mtime); +#endif grub_dl_unref (my_mod); @@ -793,24 +773,38 @@ grub_ufs_mtime (grub_device_t device, grub_int32_t *tm) static struct grub_fs grub_ufs_fs = { - .name = "ufs", +#ifdef MODE_UFS2 + .name = "ufs2", +#else + .name = "ufs1", +#endif .dir = grub_ufs_dir, .open = grub_ufs_open, .read = grub_ufs_read, .close = grub_ufs_close, +#ifdef MODE_UFS2 .label = grub_ufs_label, +#endif .uuid = grub_ufs_uuid, .mtime = grub_ufs_mtime, .next = 0 }; -GRUB_MOD_INIT(ufs) +#ifdef MODE_UFS2 +GRUB_MOD_INIT(ufs2) +#else +GRUB_MOD_INIT(ufs1) +#endif { grub_fs_register (&grub_ufs_fs); my_mod = mod; } -GRUB_MOD_FINI(ufs) +#ifdef MODE_UFS2 +GRUB_MOD_FINI(ufs2) +#else +GRUB_MOD_FINI(ufs1) +#endif { grub_fs_unregister (&grub_ufs_fs); } diff --git a/fs/ufs2.c b/fs/ufs2.c new file mode 100644 index 000000000..7f4eb95de --- /dev/null +++ b/fs/ufs2.c @@ -0,0 +1,3 @@ +/* ufs2.c - Unix File System 2 */ +#define MODE_UFS2 1 +#include "ufs.c" From 25fbd77a9d1ca9942932d94e9c32f5c7046c387e Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 14 Aug 2009 13:32:09 +0000 Subject: [PATCH 1032/1707] changelog fix --- ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a4ec76db9..0cae2ec9d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,9 +11,9 @@ (ufs1_mod_SOURCES): New variable. (ufs1_mod_CFLAGS): Likewise. (ufs1_mod_LDFLAGS): Likewise. - (ufs1_mod_SOURCES): New variable. - (ufs1_mod_CFLAGS): Likewise. - (ufs1_mod_LDFLAGS): Likewise. + (ufs2_mod_SOURCES): New variable. + (ufs2_mod_CFLAGS): Likewise. + (ufs2_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add fs/ufs2.c. * conf/i386-efi.rmk (util/i386/efi/grub-mkimage.c_DEPENDENCIES): Likewise. From c60cee8ee16c512ad73370e611a9d226c140c939 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 14 Aug 2009 13:42:03 +0000 Subject: [PATCH 1033/1707] 2009-08-14 Vladimir Serbinenko Handle group offset on UFS1. * fs/ufs.c (grub_ufs_sblock): New field 'cylg_mask'. (grub_ufs_read_inode) [!MODE_UFS2]: handle cylg_offset and cylg_mask. --- ChangeLog | 7 +++++++ fs/ufs.c | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0cae2ec9d..c808913a9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-14 Vladimir Serbinenko + + Handle group offset on UFS1. + + * fs/ufs.c (grub_ufs_sblock): New field 'cylg_mask'. + (grub_ufs_read_inode) [!MODE_UFS2]: handle cylg_offset and cylg_mask. + 2009-08-14 Vladimir Serbinenko Split ufs.mod into ufs1.mod and ufs2.mod. diff --git a/fs/ufs.c b/fs/ufs.c index 75398617d..797a45d13 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -88,7 +88,7 @@ struct grub_ufs_sblock /* The start of the cylinder group. */ grub_uint32_t cylg_offset; - grub_uint8_t unused3[4]; + grub_uint32_t cylg_mask; grub_uint32_t mtime; grub_uint8_t unused4[12]; @@ -360,6 +360,11 @@ grub_ufs_read_inode (struct grub_ufs_data *data, int ino, char *inode) /* The first block of the group. */ int grpblk = group * (grub_le_to_cpu32 (sblock->frags_per_group)); +#ifndef MODE_UFS2 + grpblk += grub_le_to_cpu32 (sblock->cylg_offset) + * (group & (~grub_le_to_cpu32 (sblock->cylg_mask))); +#endif + if (!inode) { inode = (char *) &data->inode; From c166d79e62a381ac7b947c7ed8a093407c34a276 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 14 Aug 2009 15:15:33 +0000 Subject: [PATCH 1034/1707] 2009-08-14 Vladimir Serbinenko * loader/i386/multiboot.c (grub_multiboot_unload): Don't free mbi and mbi->cmdline but free playground. --- ChangeLog | 5 +++++ loader/i386/multiboot.c | 10 +++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index c808913a9..8b76b58ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-14 Vladimir Serbinenko + + * loader/i386/multiboot.c (grub_multiboot_unload): Don't free mbi and + mbi->cmdline but free playground. + 2009-08-14 Vladimir Serbinenko Handle group offset on UFS1. diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 87ffcae8d..642530641 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -53,7 +53,7 @@ extern grub_dl_t my_mod; static struct grub_multiboot_info *mbi, *mbi_dest; static grub_addr_t entry; -static char *playground; +static char *playground = 0; static grub_size_t code_size; static grub_err_t @@ -68,7 +68,7 @@ grub_multiboot_boot (void) static grub_err_t grub_multiboot_unload (void) { - if (mbi) + if (playground) { unsigned int i; for (i = 0; i < mbi->mods_count; i++) @@ -79,11 +79,11 @@ grub_multiboot_unload (void) ((struct grub_mod_list *) mbi->mods_addr)[i].cmdline); } grub_free ((void *) mbi->mods_addr); - grub_free ((void *) mbi->cmdline); - grub_free (mbi); + grub_free (playground); } - mbi = 0; + mbi = NULL; + playground = NULL; grub_dl_unref (my_mod); return GRUB_ERR_NONE; From e1f39873bcd4542cef76d39b1bf194dca10fc8dd Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 14 Aug 2009 15:19:24 +0000 Subject: [PATCH 1035/1707] 2009-08-14 Vladimir Serbinenko * loader/i386/multiboot.c (grub_multiboot): Don't pass filename to payload. (grub_module): Likewise. --- ChangeLog | 6 ++++++ loader/i386/multiboot.c | 42 +++++++++++++++++++++++++++++++---------- 2 files changed, 38 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8b76b58ea..83b575538 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-14 Vladimir Serbinenko + + * loader/i386/multiboot.c (grub_multiboot): Don't pass filename to + payload. + (grub_module): Likewise. + 2009-08-14 Vladimir Serbinenko * loader/i386/multiboot.c (grub_multiboot_unload): Don't free mbi and diff --git a/loader/i386/multiboot.c b/loader/i386/multiboot.c index 642530641..8c3139b57 100644 --- a/loader/i386/multiboot.c +++ b/loader/i386/multiboot.c @@ -201,6 +201,8 @@ grub_multiboot (int argc, char *argv[]) grub_ssize_t len, cmdline_length, boot_loader_name_length; grub_uint32_t mmap_length; int i; + int cmdline_argc; + char **cmdline_argv; grub_loader_unset (); @@ -257,8 +259,15 @@ grub_multiboot (int argc, char *argv[]) mmap_length = grub_get_multiboot_mmap_len (); /* Figure out cmdline length. */ - for (i = 0, cmdline_length = 0; i < argc; i++) - cmdline_length += grub_strlen (argv[i]) + 1; + /* Skip filename. */ + cmdline_argc = argc - 1; + cmdline_argv = argv + 1; + + for (i = 0, cmdline_length = 0; i < cmdline_argc; i++) + cmdline_length += grub_strlen (cmdline_argv[i]) + 1; + + if (cmdline_length == 0) + cmdline_length = 1; boot_loader_name_length = sizeof(PACKAGE_STRING); @@ -351,14 +360,16 @@ grub_multiboot (int argc, char *argv[]) if (! cmdline) goto fail; - for (i = 0; i < argc; i++) + for (i = 0; i < cmdline_argc; i++) { - p = grub_stpcpy (p, argv[i]); + p = grub_stpcpy (p, cmdline_argv[i]); *(p++) = ' '; } /* Remove the space after the last word. */ - *(--p) = '\0'; + if (p != cmdline) + p--; + *p = 0; mbi->flags |= MULTIBOOT_INFO_CMDLINE; mbi->cmdline = (grub_uint32_t) cmdline_addr (grub_multiboot_payload_dest); @@ -393,6 +404,8 @@ grub_module (int argc, char *argv[]) grub_ssize_t size, len = 0; char *module = 0, *cmdline = 0, *p; int i; + int cmdline_argc; + char **cmdline_argv; if (argc == 0) { @@ -422,21 +435,30 @@ grub_module (int argc, char *argv[]) goto fail; } - for (i = 0; i < argc; i++) - len += grub_strlen (argv[i]) + 1; + /* Skip module name. */ + cmdline_argc = argc - 1; + cmdline_argv = argv + 1; + + for (i = 0; i < cmdline_argc; i++) + len += grub_strlen (cmdline_argv[i]) + 1; + + if (len == 0) + len = 1; cmdline = p = grub_malloc (len); if (! cmdline) goto fail; - for (i = 0; i < argc; i++) + for (i = 0; i < cmdline_argc; i++) { - p = grub_stpcpy (p, argv[i]); + p = grub_stpcpy (p, cmdline_argv[i]); *(p++) = ' '; } /* Remove the space after the last word. */ - *(--p) = '\0'; + if (p != cmdline) + p--; + *p = '\0'; if (mbi->flags & MULTIBOOT_INFO_MODS) { From 7cef4f7534e49e693dc044bc4031ffd15cc9cfde Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 15 Aug 2009 14:45:08 +0000 Subject: [PATCH 1036/1707] 2009-08-15 Vladimir Serbinenko * fs/affs.c (grub_affs_read_symlink): Change leftover grub_printf into grub_dprintf. * fs/fat.c (grub_fat_read_data): Likewise. --- ChangeLog | 6 ++++++ fs/affs.c | 2 +- fs/fat.c | 4 ++-- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 83b575538..3d34abf21 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-15 Vladimir Serbinenko + + * fs/affs.c (grub_affs_read_symlink): Change leftover grub_printf into + grub_dprintf. + * fs/fat.c (grub_fat_read_data): Likewise. + 2009-08-14 Vladimir Serbinenko * loader/i386/multiboot.c (grub_multiboot): Don't pass filename to diff --git a/fs/affs.c b/fs/affs.c index 286b99f9a..cfe7d579b 100644 --- a/fs/affs.c +++ b/fs/affs.c @@ -273,7 +273,7 @@ grub_affs_read_symlink (grub_fshelp_node_t node) grub_free (symlink); return 0; } - grub_printf ("Symlink: `%s'\n", symlink); + grub_dprintf ("affs", "Symlink: `%s'\n", symlink); return symlink; } diff --git a/fs/fat.c b/fs/fat.c index cc733362f..024e8c684 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -423,8 +423,8 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, } #if 0 - grub_printf ("%s:%d: fat_size=%d, next_cluster=%u\n", - __FILE__, __LINE__, data->fat_size, next_cluster); + grub_dprintf ("fat", "fat_size=%d, next_cluster=%u\n", + data->fat_size, next_cluster); #endif /* Check the end. */ From 08aa61f0e21719e48d15ee3aa00350a6f5391c83 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 17 Aug 2009 12:44:28 +0000 Subject: [PATCH 1037/1707] 2009-08-17 Robert Millan * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT) (DEFAULT_VIDEO_MODE): Remove macros. (grub_linux_boot): Remove assumption that Linux has FB support, and use "text" as default video mode. --- ChangeLog | 7 +++++++ loader/i386/linux.c | 18 +++--------------- 2 files changed, 10 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3d34abf21..7374c3903 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-17 Robert Millan + + * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT) + (DEFAULT_VIDEO_MODE): Remove macros. + (grub_linux_boot): Remove assumption that Linux has FB support, + and use "text" as default video mode. + 2009-08-15 Vladimir Serbinenko * fs/affs.c (grub_affs_read_symlink): Change leftover grub_printf into diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 238e4cd8f..4144384db 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -37,16 +37,6 @@ #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 -/* This macro is useful for distributors, who can be certain they built FB support - into Linux, and therefore can benefit from seamless mode transition between - GRUB and Linux (saving boot time and visual glitches). Official GRUB, OTOH, - needs to be conservative. */ -#ifdef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT -#define DEFAULT_VIDEO_MODE "keep,1024x768,800x600,640x480" -#else -#define DEFAULT_VIDEO_MODE "text" -#endif - static grub_dl_t my_mod; static grub_size_t linux_mem_size; @@ -501,17 +491,15 @@ grub_linux_boot (void) if (modevar && *modevar != 0) { tmp = grub_malloc (grub_strlen (modevar) - + sizeof (DEFAULT_VIDEO_MODE) + 1); + + sizeof (";text")); if (! tmp) return grub_errno; - grub_sprintf (tmp, "%s;" DEFAULT_VIDEO_MODE, modevar); + grub_sprintf (tmp, "%s;text", modevar); err = grub_video_set_mode (tmp, 0); grub_free (tmp); } -#ifndef GRUB_ASSUME_LINUX_HAS_FB_SUPPORT else - err = grub_video_set_mode (DEFAULT_VIDEO_MODE, 0); -#endif + err = grub_video_set_mode ("text", 0); if (err) { From cc8c6fafe9cf0cf40064428a14539b3e21c452e3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 17 Aug 2009 12:46:58 +0000 Subject: [PATCH 1038/1707] 2009-08-17 Robert Millan * fs/fat.c (grub_fat_read_data): Remove `#if 0' braces around the grub_dprintf() that was just added. --- ChangeLog | 5 +++++ fs/fat.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7374c3903..c0f4c9fdf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-17 Robert Millan + + * fs/fat.c (grub_fat_read_data): Remove `#if 0' braces around the + grub_dprintf() that was just added. + 2009-08-17 Robert Millan * loader/i386/linux.c (GRUB_ASSUME_LINUX_HAS_FB_SUPPORT) diff --git a/fs/fat.c b/fs/fat.c index 024e8c684..8440e43fa 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -422,10 +422,8 @@ grub_fat_read_data (grub_disk_t disk, struct grub_fat_data *data, break; } -#if 0 grub_dprintf ("fat", "fat_size=%d, next_cluster=%u\n", data->fat_size, next_cluster); -#endif /* Check the end. */ if (next_cluster >= data->cluster_eof_mark) From 6025fcd7f914a2c44782e65fd17c322a4396474b Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 17 Aug 2009 13:34:24 +0000 Subject: [PATCH 1039/1707] 2009-08-17 Michal Suchanek Remove duplicate grub_video_fb_get_video_ptr. * include/grub/fbutil.h (get_data_ptr): Rename to ... (grub_video_fb_get_video_ptr): ... this. * include/grub/video_fb.h (grub_video_fb_get_video_ptr): Removed. * video/fb/fbutil.c: Add comment about addressing. (get_data_ptr): Rename to ... (grub_video_fb_get_video_ptr): ... this. All users updated. * video/fb/video_fb.c (grub_video_fb_get_video_ptr): Remove. --- ChangeLog | 12 +++++++++ include/grub/fbutil.h | 2 +- include/grub/video_fb.h | 3 --- video/fb/fbblit.c | 56 ++++++++++++++++++++--------------------- video/fb/fbutil.c | 29 ++++++++++++++------- video/fb/video_fb.c | 38 ---------------------------- 6 files changed, 61 insertions(+), 79 deletions(-) diff --git a/ChangeLog b/ChangeLog index c0f4c9fdf..13e21c890 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-08-17 Michal Suchanek + + Remove duplicate grub_video_fb_get_video_ptr. + + * include/grub/fbutil.h (get_data_ptr): Rename to ... + (grub_video_fb_get_video_ptr): ... this. + * include/grub/video_fb.h (grub_video_fb_get_video_ptr): Removed. + * video/fb/fbutil.c: Add comment about addressing. + (get_data_ptr): Rename to ... + (grub_video_fb_get_video_ptr): ... this. All users updated. + * video/fb/video_fb.c (grub_video_fb_get_video_ptr): Remove. + 2009-08-17 Robert Millan * fs/fat.c (grub_fat_read_data): Remove `#if 0' braces around the diff --git a/include/grub/fbutil.h b/include/grub/fbutil.h index 76e1e573c..cf7ecc0d8 100644 --- a/include/grub/fbutil.h +++ b/include/grub/fbutil.h @@ -31,7 +31,7 @@ struct grub_video_fbblit_info void *data; }; -grub_uint8_t *get_data_ptr (struct grub_video_fbblit_info *source, +grub_uint8_t *grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y); grub_video_color_t get_pixel (struct grub_video_fbblit_info *source, diff --git a/include/grub/video_fb.h b/include/grub/video_fb.h index 03ef38509..17debd69f 100644 --- a/include/grub/video_fb.h +++ b/include/grub/video_fb.h @@ -33,9 +33,6 @@ struct grub_video_fbrender_target; #define GRUB_VIDEO_FBSTD_NUMCOLORS 16 extern struct grub_video_palette_data grub_video_fbstd_colors[GRUB_VIDEO_FBSTD_NUMCOLORS]; -grub_uint8_t * grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, - grub_uint32_t x, grub_uint32_t y); - grub_err_t grub_video_fb_init (void); diff --git a/video/fb/fbblit.c b/video/fb/fbblit.c index 138eba8c1..5b613bc79 100644 --- a/video/fb/fbblit.c +++ b/video/fb/fbblit.c @@ -83,8 +83,8 @@ grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint32_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (dst, x, y + j); grub_memmove (dstptr, srcptr, width * bpp); } @@ -110,8 +110,8 @@ grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = (grub_uint8_t *) get_data_ptr (src, offset_x, offset_y); - dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + srcptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -153,8 +153,8 @@ grub_video_fbblit_replace_BGRX8888_RGB888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = (grub_uint8_t *) get_data_ptr (src, offset_x, offset_y); - dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + srcptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -197,8 +197,8 @@ grub_video_fbblit_replace_BGR888_RGBX8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = (grub_uint32_t *) get_data_ptr (src, offset_x, offset_y); - dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + srcptr = (grub_uint32_t *) grub_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -245,8 +245,8 @@ grub_video_fbblit_replace_BGR888_RGB888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = (grub_uint8_t *) get_data_ptr (src, offset_x, offset_y); - dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + srcptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -285,8 +285,8 @@ grub_video_fbblit_replace_RGBX8888_RGB888 (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint8_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint32_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (dst, x, y + j); for (i = 0; i < width; i++) { @@ -321,8 +321,8 @@ grub_video_fbblit_replace_RGB888_RGBX8888 (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (dst, x, y + j); for (i = 0; i < width; i++) { @@ -358,8 +358,8 @@ grub_video_fbblit_replace_index_RGBX8888 (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (dst, x, y + j); for (i = 0; i < width; i++) { @@ -394,8 +394,8 @@ grub_video_fbblit_replace_index_RGB888 (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint8_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (dst, x, y + j); for (i = 0; i < width; i++) { @@ -491,8 +491,8 @@ grub_video_fbblit_blend_BGRA8888_RGBA8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = (grub_uint32_t *) get_data_ptr (src, offset_x, offset_y); - dstptr = (grub_uint32_t *) get_data_ptr (dst, x, y); + srcptr = (grub_uint32_t *) grub_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = (grub_uint32_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -572,8 +572,8 @@ grub_video_fbblit_blend_BGR888_RGBA8888 (struct grub_video_fbblit_info *dst, srcrowskip = src->mode_info->pitch - src->mode_info->bytes_per_pixel * width; dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; - srcptr = (grub_uint32_t *) get_data_ptr (src, offset_x, offset_y); - dstptr = (grub_uint8_t *) get_data_ptr (dst, x, y); + srcptr = (grub_uint32_t *) grub_video_fb_get_video_ptr (src, offset_x, offset_y); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); for (j = 0; j < height; j++) { @@ -656,8 +656,8 @@ grub_video_fbblit_blend_RGBA8888_RGBA8888 (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint32_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (dst, x, y + j); for (i = 0; i < width; i++) { @@ -721,8 +721,8 @@ grub_video_fbblit_blend_RGB888_RGBA8888 (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (dst, x, y + j); for (i = 0; i < width; i++) { @@ -788,8 +788,8 @@ grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, for (j = 0; j < height; j++) { - srcptr = (grub_uint32_t *)get_data_ptr (src, offset_x, j + offset_y); - dstptr = (grub_uint8_t *)get_data_ptr (dst, x, y + j); + srcptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (src, offset_x, j + offset_y); + dstptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (dst, x, y + j); for (i = 0; i < width; i++) { diff --git a/video/fb/fbutil.c b/video/fb/fbutil.c index 09cbb12f9..1fa48ec59 100644 --- a/video/fb/fbutil.c +++ b/video/fb/fbutil.c @@ -16,12 +16,23 @@ * along with GRUB. If not, see . */ +/* SPECIAL NOTES! + + Please note following when reading the code below: + + - In this driver we assume that every memory can be accessed by same memory + bus. If there are different address spaces do not use this code as a base + code for other archs. + + - Every function in this code assumes that bounds checking has been done in + previous phase and they are opted out in here. */ + #include #include #include grub_uint8_t * -get_data_ptr (struct grub_video_fbblit_info *source, +grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, unsigned int x, unsigned int y) { grub_uint8_t *ptr = 0; @@ -72,24 +83,24 @@ get_pixel (struct grub_video_fbblit_info *source, switch (source->mode_info->bpp) { case 32: - color = *(grub_uint32_t *)get_data_ptr (source, x, y); + color = *(grub_uint32_t *)grub_video_fb_get_video_ptr (source, x, y); break; case 24: { grub_uint8_t *ptr; - ptr = get_data_ptr (source, x, y); + ptr = grub_video_fb_get_video_ptr (source, x, y); color = ptr[0] | (ptr[1] << 8) | (ptr[2] << 16); } break; case 16: case 15: - color = *(grub_uint16_t *)get_data_ptr (source, x, y); + color = *(grub_uint16_t *)grub_video_fb_get_video_ptr (source, x, y); break; case 8: - color = *(grub_uint8_t *)get_data_ptr (source, x, y); + color = *(grub_uint8_t *)grub_video_fb_get_video_ptr (source, x, y); break; case 1: @@ -120,7 +131,7 @@ set_pixel (struct grub_video_fbblit_info *source, { grub_uint32_t *ptr; - ptr = (grub_uint32_t *)get_data_ptr (source, x, y); + ptr = (grub_uint32_t *)grub_video_fb_get_video_ptr (source, x, y); *ptr = color; } @@ -131,7 +142,7 @@ set_pixel (struct grub_video_fbblit_info *source, grub_uint8_t *ptr; grub_uint8_t *colorptr = (grub_uint8_t *)&color; - ptr = get_data_ptr (source, x, y); + ptr = grub_video_fb_get_video_ptr (source, x, y); ptr[0] = colorptr[0]; ptr[1] = colorptr[1]; @@ -144,7 +155,7 @@ set_pixel (struct grub_video_fbblit_info *source, { grub_uint16_t *ptr; - ptr = (grub_uint16_t *)get_data_ptr (source, x, y); + ptr = (grub_uint16_t *)grub_video_fb_get_video_ptr (source, x, y); *ptr = (grub_uint16_t) (color & 0xFFFF); } @@ -154,7 +165,7 @@ set_pixel (struct grub_video_fbblit_info *source, { grub_uint8_t *ptr; - ptr = (grub_uint8_t *)get_data_ptr (source, x, y); + ptr = (grub_uint8_t *)grub_video_fb_get_video_ptr (source, x, y); *ptr = (grub_uint8_t) (color & 0xFF); } diff --git a/video/fb/video_fb.c b/video/fb/video_fb.c index fc943735a..a35dd7a4e 100644 --- a/video/fb/video_fb.c +++ b/video/fb/video_fb.c @@ -83,44 +83,6 @@ grub_video_fb_get_info (struct grub_video_mode_info *mode_info) return GRUB_ERR_NONE; } - -grub_uint8_t * -grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, - grub_uint32_t x, grub_uint32_t y) -{ - grub_uint8_t *ptr = 0; - - switch (source->mode_info->bpp) - { - case 32: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 4; - break; - - case 24: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 3; - break; - - case 16: - case 15: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 2; - break; - - case 8: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x; - break; - } - - return ptr; -} - grub_err_t grub_video_fb_get_palette (unsigned int start, unsigned int count, struct grub_video_palette_data *palette_data) From 2f467aa9ad488933ccdbd434a9f9b1b09272c452 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 17 Aug 2009 13:37:22 +0000 Subject: [PATCH 1040/1707] 2009-08-17 Michal Suchanek Rename variables for clarity. * video/i386/pc/vbe.c (active_mode_info): Renamed to ... (active_vbe_mode_info): ... this. All users updated. (framebuffer): Rename 'active_mode' to 'active_vbe_mode'. All users updated. (initial_mode): Rename to ... (initial_vbe_mode): ... this. All users updated. (mode_in_use): Rename to .. (vbe_mode_in_use): ... this. All users updated. (mode_list): Rename to .. (vbe_mode_list): ... this. All users updated. (grub_vbe_set_video_mode): Rename 'mode' to 'vbe_mode', 'mode_info' to 'vbe_mode_info' and 'old_mode' to 'old_vbe_mode'. (grub_video_vbe_init): Rename 'rm_mode_list' to 'rm_vbe_mode_list' and 'mode_list_size' to 'vbe_mode_list_size'. (grub_video_vbe_setup): Rename 'mode_info' to 'vbe_mode_info', 'best_mode_info' to 'best_vbe_mode_info' and 'best_mode' to 'best_vbe_mode' --- ChangeLog | 22 +++++++ video/i386/pc/vbe.c | 156 ++++++++++++++++++++++---------------------- 2 files changed, 100 insertions(+), 78 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13e21c890..95cd3d0c9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2009-08-17 Michal Suchanek + + Rename variables for clarity. + + * video/i386/pc/vbe.c (active_mode_info): Renamed to ... + (active_vbe_mode_info): ... this. All users updated. + (framebuffer): Rename 'active_mode' to 'active_vbe_mode'. + All users updated. + (initial_mode): Rename to ... + (initial_vbe_mode): ... this. All users updated. + (mode_in_use): Rename to .. + (vbe_mode_in_use): ... this. All users updated. + (mode_list): Rename to .. + (vbe_mode_list): ... this. All users updated. + (grub_vbe_set_video_mode): Rename 'mode' to 'vbe_mode', 'mode_info' to + 'vbe_mode_info' and 'old_mode' to 'old_vbe_mode'. + (grub_video_vbe_init): Rename 'rm_mode_list' to 'rm_vbe_mode_list' and + 'mode_list_size' to 'vbe_mode_list_size'. + (grub_video_vbe_setup): Rename 'mode_info' to 'vbe_mode_info', + 'best_mode_info' to 'best_vbe_mode_info' and + 'best_mode' to 'best_vbe_mode' + 2009-08-17 Michal Suchanek Remove duplicate grub_video_fb_get_video_ptr. diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index 0244b9016..34885d62e 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -31,7 +31,7 @@ static int vbe_detected = -1; static struct grub_vbe_info_block controller_info; -static struct grub_vbe_mode_info_block active_mode_info; +static struct grub_vbe_mode_info_block active_vbe_mode_info; static struct { @@ -40,14 +40,14 @@ static struct unsigned int bytes_per_scan_line; unsigned int bytes_per_pixel; - grub_uint32_t active_mode; + grub_uint32_t active_vbe_mode; grub_uint8_t *ptr; int index_color_mode; } framebuffer; -static grub_uint32_t initial_mode; -static grub_uint32_t mode_in_use = 0x55aa; -static grub_uint16_t *mode_list; +static grub_uint32_t initial_vbe_mode; +static grub_uint32_t vbe_mode_in_use = 0x55aa; +static grub_uint16_t *vbe_mode_list; static void * real2pm (grub_vbe_farptr_t ptr) @@ -110,11 +110,11 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) } grub_err_t -grub_vbe_set_video_mode (grub_uint32_t mode, - struct grub_vbe_mode_info_block *mode_info) +grub_vbe_set_video_mode (grub_uint32_t vbe_mode, + struct grub_vbe_mode_info_block *vbe_mode_info) { grub_vbe_status_t status; - grub_uint32_t old_mode; + grub_uint32_t old_vbe_mode; grub_err_t err; /* Make sure that VBE is supported. */ @@ -123,18 +123,18 @@ grub_vbe_set_video_mode (grub_uint32_t mode, return grub_errno; /* Try to get mode info. */ - grub_vbe_get_video_mode_info (mode, &active_mode_info); + grub_vbe_get_video_mode_info (vbe_mode, &active_vbe_mode_info); if (grub_errno != GRUB_ERR_NONE) return grub_errno; /* For all VESA BIOS modes, force linear frame buffer. */ - if (mode >= 0x100) + if (vbe_mode >= 0x100) { /* We only want linear frame buffer modes. */ - mode |= 1 << 14; + vbe_mode |= 1 << 14; /* Determine frame buffer pixel format. */ - switch (active_mode_info.memory_model) + switch (active_vbe_mode_info.memory_model) { case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL: framebuffer.index_color_mode = 1; @@ -147,24 +147,24 @@ grub_vbe_set_video_mode (grub_uint32_t mode, default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "unsupported pixel format 0x%x", - active_mode_info.memory_model); + active_vbe_mode_info.memory_model); } } /* Get current mode. */ - grub_vbe_get_video_mode (&old_mode); + grub_vbe_get_video_mode (&old_vbe_mode); if (grub_errno != GRUB_ERR_NONE) return grub_errno; /* Try to set video mode. */ - status = grub_vbe_bios_set_mode (mode, 0); + status = grub_vbe_bios_set_mode (vbe_mode, 0); if (status != GRUB_VBE_STATUS_OK) - return grub_error (GRUB_ERR_BAD_DEVICE, "cannot set VBE mode %x", mode); + return grub_error (GRUB_ERR_BAD_DEVICE, "cannot set VBE mode %x", vbe_mode); /* Save information for later usage. */ - framebuffer.active_mode = mode; + framebuffer.active_vbe_mode = vbe_mode; - if (mode < 0x100) + if (vbe_mode < 0x100) { /* If this is not a VESA mode, guess address. */ framebuffer.ptr = (grub_uint8_t *) GRUB_MEMORY_MACHINE_VGA_ADDR; @@ -172,16 +172,16 @@ grub_vbe_set_video_mode (grub_uint32_t mode, } else { - framebuffer.ptr = (grub_uint8_t *) active_mode_info.phys_base_addr; + framebuffer.ptr = (grub_uint8_t *) active_vbe_mode_info.phys_base_addr; if (controller_info.version >= 0x300) - framebuffer.bytes_per_scan_line = active_mode_info.lin_bytes_per_scan_line; + framebuffer.bytes_per_scan_line = active_vbe_mode_info.lin_bytes_per_scan_line; else - framebuffer.bytes_per_scan_line = active_mode_info.bytes_per_scan_line; + framebuffer.bytes_per_scan_line = active_vbe_mode_info.bytes_per_scan_line; } /* Check whether mode is text mode or graphics mode. */ - if (active_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) + if (active_vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) { /* Text mode. */ @@ -193,7 +193,7 @@ grub_vbe_set_video_mode (grub_uint32_t mode, /* Graphics mode. */ /* Calculate bytes_per_pixel value. */ - switch(active_mode_info.bits_per_pixel) + switch(active_vbe_mode_info.bits_per_pixel) { case 32: framebuffer.bytes_per_pixel = 4; break; case 24: framebuffer.bytes_per_pixel = 3; break; @@ -201,10 +201,10 @@ grub_vbe_set_video_mode (grub_uint32_t mode, case 15: framebuffer.bytes_per_pixel = 2; break; case 8: framebuffer.bytes_per_pixel = 1; break; default: - grub_vbe_bios_set_mode (old_mode, 0); + grub_vbe_bios_set_mode (old_vbe_mode, 0); return grub_error (GRUB_ERR_BAD_DEVICE, "cannot set VBE mode %x", - mode); + vbe_mode); break; } @@ -237,8 +237,8 @@ grub_vbe_set_video_mode (grub_uint32_t mode, } /* Copy mode info for caller. */ - if (mode_info) - grub_memcpy (mode_info, &active_mode_info, sizeof (*mode_info)); + if (vbe_mode_info) + grub_memcpy (vbe_mode_info, &active_vbe_mode_info, sizeof (*vbe_mode_info)); return GRUB_ERR_NONE; } @@ -314,9 +314,9 @@ grub_vbe_get_video_mode_info (grub_uint32_t mode, static grub_err_t grub_video_vbe_init (void) { - grub_uint16_t *rm_mode_list; + grub_uint16_t *rm_vbe_mode_list; grub_uint16_t *p; - grub_size_t mode_list_size; + grub_size_t vbe_mode_list_size; struct grub_vbe_info_block info_block; /* Check if there is adapter present. @@ -330,23 +330,23 @@ grub_video_vbe_init (void) return grub_errno; /* Copy modelist to local memory. */ - p = rm_mode_list = real2pm (info_block.video_mode_ptr); + p = rm_vbe_mode_list = real2pm (info_block.video_mode_ptr); while(*p++ != 0xFFFF) ; - mode_list_size = (grub_addr_t) p - (grub_addr_t) rm_mode_list; - mode_list = grub_malloc (mode_list_size); - if (! mode_list) + vbe_mode_list_size = (grub_addr_t) p - (grub_addr_t) rm_vbe_mode_list; + vbe_mode_list = grub_malloc (vbe_mode_list_size); + if (! vbe_mode_list) return grub_errno; - grub_memcpy (mode_list, rm_mode_list, mode_list_size); + grub_memcpy (vbe_mode_list, rm_vbe_mode_list, vbe_mode_list_size); /* Adapter could be found, figure out initial video mode. */ - grub_vbe_get_video_mode (&initial_mode); + grub_vbe_get_video_mode (&initial_vbe_mode); if (grub_errno != GRUB_ERR_NONE) { /* Free allocated resources. */ - grub_free (mode_list); - mode_list = NULL; + grub_free (vbe_mode_list); + vbe_mode_list = NULL; return grub_errno; } @@ -363,14 +363,14 @@ grub_video_vbe_fini (void) grub_vbe_status_t status; /* Restore old video mode. */ - status = grub_vbe_bios_set_mode (initial_mode, 0); + status = grub_vbe_bios_set_mode (initial_vbe_mode, 0); if (status != GRUB_VBE_STATUS_OK) /* TODO: Decide, is this something we want to do. */ return grub_errno; /* TODO: Free any resources allocated by driver. */ - grub_free (mode_list); - mode_list = NULL; + grub_free (vbe_mode_list); + vbe_mode_list = NULL; /* TODO: destroy render targets. */ @@ -382,9 +382,9 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, unsigned int mode_type) { grub_uint16_t *p; - struct grub_vbe_mode_info_block mode_info; - struct grub_vbe_mode_info_block best_mode_info; - grub_uint32_t best_mode = 0; + struct grub_vbe_mode_info_block vbe_mode_info; + struct grub_vbe_mode_info_block best_vbe_mode_info; + grub_uint32_t best_vbe_mode = 0; int depth; /* Decode depth from mode_type. If it is zero, then autodetect. */ @@ -392,11 +392,11 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, >> GRUB_VIDEO_MODE_TYPE_DEPTH_POS; /* Walk thru mode list and try to find matching mode. */ - for (p = mode_list; *p != 0xFFFF; p++) + for (p = vbe_mode_list; *p != 0xFFFF; p++) { - grub_uint32_t mode = *p; + grub_uint32_t vbe_mode = *p; - grub_vbe_get_video_mode_info (mode, &mode_info); + grub_vbe_get_video_mode_info (vbe_mode, &vbe_mode_info); if (grub_errno != GRUB_ERR_NONE) { /* Could not retrieve mode info, retreat. */ @@ -404,33 +404,33 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, break; } - if ((mode_info.mode_attributes & 0x001) == 0) + if ((vbe_mode_info.mode_attributes & 0x001) == 0) /* If not available, skip it. */ continue; - if ((mode_info.mode_attributes & 0x002) == 0) + if ((vbe_mode_info.mode_attributes & 0x002) == 0) /* Not enough information. */ continue; - if ((mode_info.mode_attributes & 0x008) == 0) + if ((vbe_mode_info.mode_attributes & 0x008) == 0) /* Monochrome is unusable. */ continue; - if ((mode_info.mode_attributes & 0x080) == 0) + if ((vbe_mode_info.mode_attributes & 0x080) == 0) /* We support only linear frame buffer modes. */ continue; - if ((mode_info.mode_attributes & 0x010) == 0) + if ((vbe_mode_info.mode_attributes & 0x010) == 0) /* We allow only graphical modes. */ continue; - if ((mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL) - && (mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR)) + if ((vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL) + && (vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR)) /* Not compatible memory model. */ continue; - if ((mode_info.x_resolution != width) - || (mode_info.y_resolution != height)) + if ((vbe_mode_info.x_resolution != width) + || (vbe_mode_info.y_resolution != height)) /* Non matching resolution. */ continue; @@ -438,65 +438,65 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, if ((mode_type & GRUB_VIDEO_MODE_TYPE_COLOR_MASK) != 0) { if (((mode_type & GRUB_VIDEO_MODE_TYPE_INDEX_COLOR) != 0) - && (mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL)) + && (vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL)) /* Requested only index color modes. */ continue; if (((mode_type & GRUB_VIDEO_MODE_TYPE_RGB) != 0) - && (mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR)) + && (vbe_mode_info.memory_model != GRUB_VBE_MEMORY_MODEL_DIRECT_COLOR)) /* Requested only RGB modes. */ continue; } /* If there is a request for specific depth, ignore others. */ - if ((depth != 0) && (mode_info.bits_per_pixel != depth)) + if ((depth != 0) && (vbe_mode_info.bits_per_pixel != depth)) continue; /* Select mode with most number of bits per pixel. */ - if (best_mode != 0) - if (mode_info.bits_per_pixel < best_mode_info.bits_per_pixel) + if (best_vbe_mode != 0) + if (vbe_mode_info.bits_per_pixel < best_vbe_mode_info.bits_per_pixel) continue; /* Save so far best mode information for later use. */ - best_mode = mode; - grub_memcpy (&best_mode_info, &mode_info, sizeof (mode_info)); + best_vbe_mode = vbe_mode; + grub_memcpy (&best_vbe_mode_info, &vbe_mode_info, sizeof (vbe_mode_info)); } /* Try to initialize best mode found. */ - if (best_mode != 0) + if (best_vbe_mode != 0) { grub_err_t err; /* If this fails, then we have mode selection heuristics problem, or adapter failure. */ - grub_vbe_set_video_mode (best_mode, &active_mode_info); + grub_vbe_set_video_mode (best_vbe_mode, &active_vbe_mode_info); if (grub_errno != GRUB_ERR_NONE) return grub_errno; /* Now we are happily in requested video mode. Cache some info in order to fasten later operations. */ - mode_in_use = best_mode; + vbe_mode_in_use = best_vbe_mode; /* Fill mode info details. */ - framebuffer.mode_info.width = active_mode_info.x_resolution; - framebuffer.mode_info.height = active_mode_info.y_resolution; + framebuffer.mode_info.width = active_vbe_mode_info.x_resolution; + framebuffer.mode_info.height = active_vbe_mode_info.y_resolution; if (framebuffer.index_color_mode) framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_INDEX_COLOR; else framebuffer.mode_info.mode_type = GRUB_VIDEO_MODE_TYPE_RGB; - framebuffer.mode_info.bpp = active_mode_info.bits_per_pixel; + framebuffer.mode_info.bpp = active_vbe_mode_info.bits_per_pixel; framebuffer.mode_info.bytes_per_pixel = framebuffer.bytes_per_pixel; framebuffer.mode_info.pitch = framebuffer.bytes_per_scan_line; framebuffer.mode_info.number_of_colors = 256; /* TODO: fix me. */ - framebuffer.mode_info.red_mask_size = active_mode_info.red_mask_size; - framebuffer.mode_info.red_field_pos = active_mode_info.red_field_position; - framebuffer.mode_info.green_mask_size = active_mode_info.green_mask_size; - framebuffer.mode_info.green_field_pos = active_mode_info.green_field_position; - framebuffer.mode_info.blue_mask_size = active_mode_info.blue_mask_size; - framebuffer.mode_info.blue_field_pos = active_mode_info.blue_field_position; - framebuffer.mode_info.reserved_mask_size = active_mode_info.rsvd_mask_size; - framebuffer.mode_info.reserved_field_pos = active_mode_info.rsvd_field_position; + framebuffer.mode_info.red_mask_size = active_vbe_mode_info.red_mask_size; + framebuffer.mode_info.red_field_pos = active_vbe_mode_info.red_field_position; + framebuffer.mode_info.green_mask_size = active_vbe_mode_info.green_mask_size; + framebuffer.mode_info.green_field_pos = active_vbe_mode_info.green_field_position; + framebuffer.mode_info.blue_mask_size = active_vbe_mode_info.blue_mask_size; + framebuffer.mode_info.blue_field_pos = active_vbe_mode_info.blue_field_position; + framebuffer.mode_info.reserved_mask_size = active_vbe_mode_info.rsvd_mask_size; + framebuffer.mode_info.reserved_field_pos = active_vbe_mode_info.rsvd_field_position; framebuffer.mode_info.blit_format = grub_video_get_blit_format (&framebuffer.mode_info); @@ -562,8 +562,8 @@ grub_video_vbe_get_info_and_fini (struct grub_video_mode_info *mode_info, grub_memcpy (mode_info, &(framebuffer.mode_info), sizeof (*mode_info)); *framebuf = (char *) framebuffer.ptr; - grub_free (mode_list); - mode_list = NULL; + grub_free (vbe_mode_list); + vbe_mode_list = NULL; grub_video_fb_fini (); From 19f1b335c38eec9faa292c92b123130a55643e49 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 17 Aug 2009 13:44:07 +0000 Subject: [PATCH 1041/1707] 2009-08-17 Michal Suchanek VBE cleanup. * video/i386/pc/vbe.c (vbe_mode_in_use): Removed (duplicate). (grub_vbe_set_video_mode): Save active mode info only after setting the mode. (grub_video_vbe_setup): Call 'grub_vbe_set_video_mode' with NULL as second argument. --- ChangeLog | 10 ++++++++++ video/i386/pc/vbe.c | 30 ++++++++++++++---------------- 2 files changed, 24 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95cd3d0c9..b76fe3858 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-08-17 Michal Suchanek + + VBE cleanup. + + * video/i386/pc/vbe.c (vbe_mode_in_use): Removed (duplicate). + (grub_vbe_set_video_mode): Save active mode info + only after setting the mode. + (grub_video_vbe_setup): Call 'grub_vbe_set_video_mode' with NULL as + second argument. + 2009-08-17 Michal Suchanek Rename variables for clarity. diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index 34885d62e..b41e22fa2 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -46,7 +46,6 @@ static struct } framebuffer; static grub_uint32_t initial_vbe_mode; -static grub_uint32_t vbe_mode_in_use = 0x55aa; static grub_uint16_t *vbe_mode_list; static void * @@ -111,10 +110,11 @@ grub_vbe_probe (struct grub_vbe_info_block *info_block) grub_err_t grub_vbe_set_video_mode (grub_uint32_t vbe_mode, - struct grub_vbe_mode_info_block *vbe_mode_info) + struct grub_vbe_mode_info_block *vbe_mode_info) { grub_vbe_status_t status; grub_uint32_t old_vbe_mode; + struct grub_vbe_mode_info_block new_vbe_mode_info; grub_err_t err; /* Make sure that VBE is supported. */ @@ -123,7 +123,7 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, return grub_errno; /* Try to get mode info. */ - grub_vbe_get_video_mode_info (vbe_mode, &active_vbe_mode_info); + grub_vbe_get_video_mode_info (vbe_mode, &new_vbe_mode_info); if (grub_errno != GRUB_ERR_NONE) return grub_errno; @@ -134,7 +134,7 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, vbe_mode |= 1 << 14; /* Determine frame buffer pixel format. */ - switch (active_vbe_mode_info.memory_model) + switch (new_vbe_mode_info.memory_model) { case GRUB_VBE_MEMORY_MODEL_PACKED_PIXEL: framebuffer.index_color_mode = 1; @@ -147,7 +147,7 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "unsupported pixel format 0x%x", - active_vbe_mode_info.memory_model); + new_vbe_mode_info.memory_model); } } @@ -163,6 +163,7 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, /* Save information for later usage. */ framebuffer.active_vbe_mode = vbe_mode; + grub_memcpy (&active_vbe_mode_info, &new_vbe_mode_info, sizeof (active_vbe_mode_info)); if (vbe_mode < 0x100) { @@ -172,16 +173,16 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, } else { - framebuffer.ptr = (grub_uint8_t *) active_vbe_mode_info.phys_base_addr; + framebuffer.ptr = (grub_uint8_t *) new_vbe_mode_info.phys_base_addr; if (controller_info.version >= 0x300) - framebuffer.bytes_per_scan_line = active_vbe_mode_info.lin_bytes_per_scan_line; + framebuffer.bytes_per_scan_line = new_vbe_mode_info.lin_bytes_per_scan_line; else - framebuffer.bytes_per_scan_line = active_vbe_mode_info.bytes_per_scan_line; + framebuffer.bytes_per_scan_line = new_vbe_mode_info.bytes_per_scan_line; } /* Check whether mode is text mode or graphics mode. */ - if (active_vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) + if (new_vbe_mode_info.memory_model == GRUB_VBE_MEMORY_MODEL_TEXT) { /* Text mode. */ @@ -193,7 +194,7 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, /* Graphics mode. */ /* Calculate bytes_per_pixel value. */ - switch(active_vbe_mode_info.bits_per_pixel) + switch(new_vbe_mode_info.bits_per_pixel) { case 32: framebuffer.bytes_per_pixel = 4; break; case 24: framebuffer.bytes_per_pixel = 3; break; @@ -238,7 +239,7 @@ grub_vbe_set_video_mode (grub_uint32_t vbe_mode, /* Copy mode info for caller. */ if (vbe_mode_info) - grub_memcpy (vbe_mode_info, &active_vbe_mode_info, sizeof (*vbe_mode_info)); + grub_memcpy (vbe_mode_info, &new_vbe_mode_info, sizeof (*vbe_mode_info)); return GRUB_ERR_NONE; } @@ -468,14 +469,11 @@ grub_video_vbe_setup (unsigned int width, unsigned int height, grub_err_t err; /* If this fails, then we have mode selection heuristics problem, or adapter failure. */ - grub_vbe_set_video_mode (best_vbe_mode, &active_vbe_mode_info); + /* grub_vbe_set_video_mode already sets active_vbe_mode_info. */ + grub_vbe_set_video_mode (best_vbe_mode, NULL); if (grub_errno != GRUB_ERR_NONE) return grub_errno; - /* Now we are happily in requested video mode. Cache some info - in order to fasten later operations. */ - vbe_mode_in_use = best_vbe_mode; - /* Fill mode info details. */ framebuffer.mode_info.width = active_vbe_mode_info.x_resolution; framebuffer.mode_info.height = active_vbe_mode_info.y_resolution; From b7da6babe8eed764a1f6ac7c2bc2c04b1292875c Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 18 Aug 2009 17:26:35 +0000 Subject: [PATCH 1042/1707] 2009-08-18 Pavel Roskin * include/grub/fbfill.h (struct grub_video_fbrender_target): Use grub_uint8_t pointer for data. * include/grub/fbutil.h (struct grub_video_fbblit_info): Likewise. * video/fb/fbutil.c: Remove unnecessary casts. --- ChangeLog | 8 ++++++++ include/grub/fbfill.h | 2 +- include/grub/fbutil.h | 2 +- video/fb/fbutil.c | 22 ++++++---------------- 4 files changed, 16 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index b76fe3858..e132a24f3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-18 Pavel Roskin + + * include/grub/fbfill.h (struct grub_video_fbrender_target): Use + grub_uint8_t pointer for data. + * include/grub/fbutil.h (struct grub_video_fbblit_info): + Likewise. + * video/fb/fbutil.c: Remove unnecessary casts. + 2009-08-17 Michal Suchanek VBE cleanup. diff --git a/include/grub/fbfill.h b/include/grub/fbfill.h index 08cd7b887..c85fa12dd 100644 --- a/include/grub/fbfill.h +++ b/include/grub/fbfill.h @@ -44,7 +44,7 @@ struct grub_video_fbrender_target /* Pointer to data. Can either be in video card memory or in local host's memory. */ - void *data; + grub_uint8_t *data; }; void diff --git a/include/grub/fbutil.h b/include/grub/fbutil.h index cf7ecc0d8..065ccf9e3 100644 --- a/include/grub/fbutil.h +++ b/include/grub/fbutil.h @@ -28,7 +28,7 @@ struct grub_video_fbblit_info { struct grub_video_mode_info *mode_info; - void *data; + grub_uint8_t *data; }; grub_uint8_t *grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, diff --git a/video/fb/fbutil.c b/video/fb/fbutil.c index 1fa48ec59..511beaafc 100644 --- a/video/fb/fbutil.c +++ b/video/fb/fbutil.c @@ -40,28 +40,20 @@ grub_video_fb_get_video_ptr (struct grub_video_fbblit_info *source, switch (source->mode_info->bpp) { case 32: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 4; + ptr = source->data + y * source->mode_info->pitch + x * 4; break; case 24: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 3; + ptr = source->data + y * source->mode_info->pitch + x * 3; break; case 16: case 15: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x * 2; + ptr = source->data + y * source->mode_info->pitch + x * 2; break; case 8: - ptr = (grub_uint8_t *)source->data - + y * source->mode_info->pitch - + x; + ptr = source->data + y * source->mode_info->pitch + x; break; case 1: @@ -107,8 +99,7 @@ get_pixel (struct grub_video_fbblit_info *source, if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) { int bit_index = y * source->mode_info->width + x; - grub_uint8_t *ptr = (grub_uint8_t *)source->data - + bit_index / 8; + grub_uint8_t *ptr = source->data + bit_index / 8; int bit_pos = 7 - bit_index % 8; color = (*ptr >> bit_pos) & 0x01; } @@ -175,8 +166,7 @@ set_pixel (struct grub_video_fbblit_info *source, if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) { int bit_index = y * source->mode_info->width + x; - grub_uint8_t *ptr = (grub_uint8_t *)source->data - + bit_index / 8; + grub_uint8_t *ptr = source->data + bit_index / 8; int bit_pos = 7 - bit_index % 8; *ptr = (*ptr & ~(1 << bit_pos)) | ((color & 0x01) << bit_pos); } From 9aced5446db4ee17a3730c1c89e35a7776ac2d4d Mon Sep 17 00:00:00 2001 From: proski Date: Tue, 18 Aug 2009 17:57:07 +0000 Subject: [PATCH 1043/1707] 2009-08-18 Felix Zielcke * util/grub-mkconfig.in: Don't use gfxterm by default if not explicitly specified by the user. --- ChangeLog | 5 +++++ util/grub-mkconfig.in | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e132a24f3..0b929cf74 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-18 Felix Zielcke + + * util/grub-mkconfig.in: Don't use gfxterm by default if not + explicitly specified by the user. + 2009-08-18 Pavel Roskin * include/grub/fbfill.h (struct grub_video_fbrender_target): Use diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 5865b89ce..93f96525e 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -141,13 +141,7 @@ if [ "x${GRUB_TERMINAL}" != "x" ] ; then fi case x${GRUB_TERMINAL_OUTPUT} in - x) - # If this platform supports gfxterm, try to use it. - if test -e ${grub_prefix}/gfxterm.mod ; then - GRUB_TERMINAL_OUTPUT=gfxterm - fi - ;; - xconsole | xserial | xofconsole | xgfxterm) ;; + x | xconsole | xserial | xofconsole | xgfxterm) ;; *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;; esac From e53cea1182fdaa72e0688bdb074a70e74111d01b Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 18 Aug 2009 19:50:31 +0000 Subject: [PATCH 1044/1707] 2009-08-18 Felix Zielcke * util/powerpc/ieee1275/grub-mkrescue.in (grub_mkimage): Use grub-mkelfimage. --- ChangeLog | 5 +++++ util/powerpc/ieee1275/grub-mkrescue.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0b929cf74..47d64975a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-18 Felix Zielcke + + * util/powerpc/ieee1275/grub-mkrescue.in (grub_mkimage): Use + grub-mkelfimage. + 2009-08-18 Felix Zielcke * util/grub-mkconfig.in: Don't use gfxterm by default if not diff --git a/util/powerpc/ieee1275/grub-mkrescue.in b/util/powerpc/ieee1275/grub-mkrescue.in index 30bdabed5..63bc7d88b 100644 --- a/util/powerpc/ieee1275/grub-mkrescue.in +++ b/util/powerpc/ieee1275/grub-mkrescue.in @@ -30,7 +30,7 @@ target_cpu=@target_cpu@ platform=@platform@ pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` -grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` +grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}` # Usage: usage # Print the usage. From 7a9094e5bc2a98a97786f61e51b1258e264d8a0c Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 21 Aug 2009 21:40:58 +0000 Subject: [PATCH 1045/1707] 2009-08-21 Pavel Roskin * Makefile.in (install-local): Remove all files in $(DESTDIR)$(pkglibdir) before installing new files there. --- ChangeLog | 5 +++++ Makefile.in | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 47d64975a..bcb720151 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-21 Pavel Roskin + + * Makefile.in (install-local): Remove all files in + $(DESTDIR)$(pkglibdir) before installing new files there. + 2009-08-18 Felix Zielcke * util/powerpc/ieee1275/grub-mkrescue.in (grub_mkimage): Use diff --git a/Makefile.in b/Makefile.in index 25acce7b1..3d97c3985 100644 --- a/Makefile.in +++ b/Makefile.in @@ -212,6 +212,7 @@ install: install-local install-local: all $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkglibdir) + rm -f $(DESTDIR)$(pkglibdir)/* @list='$(PKGLIB)'; \ for file in $$list; do \ if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ From 5496c37ebe22262cc7f65fc7dc16f7b8ab446b8d Mon Sep 17 00:00:00 2001 From: proski Date: Fri, 21 Aug 2009 21:42:58 +0000 Subject: [PATCH 1046/1707] 2009-08-21 Pavel Roskin * Makefile.in (install-local): When checking if a file is in the build directory, use "test -e" to detect symlinks. --- ChangeLog | 3 +++ Makefile.in | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bcb720151..e245d2da8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2009-08-21 Pavel Roskin + * Makefile.in (install-local): When checking if a file is in the + build directory, use "test -e" to detect symlinks. + * Makefile.in (install-local): Remove all files in $(DESTDIR)$(pkglibdir) before installing new files there. diff --git a/Makefile.in b/Makefile.in index 3d97c3985..8e2cdc6c4 100644 --- a/Makefile.in +++ b/Makefile.in @@ -222,7 +222,7 @@ install-local: all $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir) @list='$(include_DATA)'; \ for file in $$list; do \ - if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ + if test -e "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ dest="`echo $$file | sed 's,include/,,'`"; \ destdir="`echo $$dest | sed 's,[^/]*$$,,g'`"; \ $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \ From 11d1c7696692d7a6d98c2237dd03204c38baffd1 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 22 Aug 2009 17:47:16 +0000 Subject: [PATCH 1047/1707] 2009-08-22 Vladimir Serbinenko * commands/xnu_uuid.c (transform): Use grub_memcpy instead of memcpy. --- ChangeLog | 4 ++++ commands/xnu_uuid.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e245d2da8..b72d07e88 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-22 Vladimir Serbinenko + + * commands/xnu_uuid.c (transform): Use grub_memcpy instead of memcpy. + 2009-08-21 Pavel Roskin * Makefile.in (install-local): When checking if a file is in the diff --git a/commands/xnu_uuid.c b/commands/xnu_uuid.c index e8e12b072..d5c272d03 100644 --- a/commands/xnu_uuid.c +++ b/commands/xnu_uuid.c @@ -100,7 +100,7 @@ transform ( MD5_CONTEXT *ctx, const unsigned char *data ) correct_words[i] = grub_le_to_cpu32 (p[i]); } #else - memcpy (correct_words, data, 64); + grub_memcpy (correct_words, data, 64); #endif #define OP(a, b, c, d, s, T) \ From c11fded5f22b06e243006081c1c4765d6f1a8bbf Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 23 Aug 2009 11:46:25 +0000 Subject: [PATCH 1048/1707] 2009-08-23 Vladimir Serbinenko * loader/i386/bsd.c (freebsd_opts): Rewritten to use extcmd. (openbsd_opts): Likewise. (netbsd_opts): Likewise. (freebsd_flags): Added 0 terminator. (openbsd_flags): Likewise. (netbsd_flags): Likewise. (grub_bsd_parse_flags): Rewritten to use extcmd. All users updated. (grub_cmd_freebsd): Transformed into extended command. (grub_cmd_openbsd): Likewise. (grub_cmd_netbsd): Likewise. (cmd_freebsd): Changed type to grub_extcmd_t. (cmd_openbsd): Likewise. (cmd_netbsd): Likewise. (GRUB_MOD_INIT (bsd)): Register grub_cmd_freebsd, grub_cmd_netbsd and grub_cmd_openbsd as extended commands. (GRUB_MOD_FINI (bsd)): Use grub_unregister_extcmd for cmd_freebsd, cmd_netbsd and cmd_openbsd --- ChangeLog | 20 ++++++++ loader/i386/bsd.c | 127 +++++++++++++++++++++++++++------------------- 2 files changed, 96 insertions(+), 51 deletions(-) diff --git a/ChangeLog b/ChangeLog index b72d07e88..6cf11a6c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,23 @@ +2009-08-23 Vladimir Serbinenko + + * loader/i386/bsd.c (freebsd_opts): Rewritten to use extcmd. + (openbsd_opts): Likewise. + (netbsd_opts): Likewise. + (freebsd_flags): Added 0 terminator. + (openbsd_flags): Likewise. + (netbsd_flags): Likewise. + (grub_bsd_parse_flags): Rewritten to use extcmd. All users updated. + (grub_cmd_freebsd): Transformed into extended command. + (grub_cmd_openbsd): Likewise. + (grub_cmd_netbsd): Likewise. + (cmd_freebsd): Changed type to grub_extcmd_t. + (cmd_openbsd): Likewise. + (cmd_netbsd): Likewise. + (GRUB_MOD_INIT (bsd)): Register grub_cmd_freebsd, grub_cmd_netbsd and + grub_cmd_openbsd as extended commands. + (GRUB_MOD_FINI (bsd)): Use grub_unregister_extcmd for cmd_freebsd, + cmd_netbsd and cmd_openbsd + 2009-08-22 Vladimir Serbinenko * commands/xnu_uuid.c (transform): Use grub_memcpy instead of memcpy. diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 5badb7932..d5f677a2a 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -33,6 +33,8 @@ #include #include #include +#include + #ifdef GRUB_MACHINE_PCBIOS #include #include @@ -55,30 +57,71 @@ static char *mod_buf; static grub_uint32_t mod_buf_len, mod_buf_max, kern_end_mdofs; static int is_elf_kernel, is_64bit; -static const char freebsd_opts[] = "DhaCcdgmnpqrsv"; +static const struct grub_arg_option freebsd_opts[] = + { + {"dual", 'D', 0, "Display output on all consoles.", 0, 0}, + {"serial", 'h', 0, "Use serial console.", 0, 0}, + {"askname", 'a', 0, "Ask for file name to reboot from.", 0, 0}, + {"cdrom", 'C', 0, "Use cdrom as root.", 0, 0}, + {"config", 'c', 0, "Invoke user configuration routing.", 0, 0}, + {"kdb", 'd', 0, "Enter in KDB on boot.", 0, 0}, + {"gdb", 'g', 0, "Use GDB remote debugger instead of DDB.", 0, 0}, + {"mute", 'm', 0, "Disable all boot output.", 0, 0}, + {"nointr", 'n', 0, "", 0, 0}, + {"pause", 'p', 0, "Wait for keypress after every line of output.", 0, 0}, + {"quiet", 'q', 0, "", 0, 0}, + {"dfltroot", 'r', 0, "Use compiled-in rootdev.", 0, 0}, + {"single", 's', 0, "Boot into single mode.", 0, 0}, + {"verbose", 'v', 0, "Boot with verbose messages.", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + static const grub_uint32_t freebsd_flags[] = { FREEBSD_RB_DUAL, FREEBSD_RB_SERIAL, FREEBSD_RB_ASKNAME, FREEBSD_RB_CDROM, FREEBSD_RB_CONFIG, FREEBSD_RB_KDB, FREEBSD_RB_GDB, FREEBSD_RB_MUTE, FREEBSD_RB_NOINTR, FREEBSD_RB_PAUSE, FREEBSD_RB_QUIET, FREEBSD_RB_DFLTROOT, - FREEBSD_RB_SINGLE, FREEBSD_RB_VERBOSE + FREEBSD_RB_SINGLE, FREEBSD_RB_VERBOSE, 0 }; -static const char openbsd_opts[] = "abcsd"; +static const struct grub_arg_option openbsd_opts[] = + { + {"askname", 'a', 0, "Ask for file name to reboot from.", 0, 0}, + {"halt", 'b', 0, "Don't reboot, just halt.", 0, 0}, + {"config", 'c', 0, "Change configured devices.", 0, 0}, + {"single", 's', 0, "Boot into single mode.", 0, 0}, + {"kdb", 'd', 0, "Enter in KDB on boot.", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + static const grub_uint32_t openbsd_flags[] = { OPENBSD_RB_ASKNAME, OPENBSD_RB_HALT, OPENBSD_RB_CONFIG, - OPENBSD_RB_SINGLE, OPENBSD_RB_KDB + OPENBSD_RB_SINGLE, OPENBSD_RB_KDB, 0 }; -static const char netbsd_opts[] = "abcdmqsvxz"; +static const struct grub_arg_option netbsd_opts[] = + { + {"askname", 'a', 0, "Ask for file name to reboot from.", 0, 0}, + {"halt", 'b', 0, "Don't reboot, just halt.", 0, 0}, + {"config", 'c', 0, "Change configured devices.", 0, 0}, + {"kdb", 'd', 0, "Enter in KDB on boot.", 0, 0}, + {"miniroot", 'm', 0, "", 0, 0}, + {"quiet", 'q', 0, "Don't display boot diagnostic messages.", 0, 0}, + {"single", 's', 0, "Boot into single mode.", 0, 0}, + {"verbose", 'v', 0, "Boot with verbose messages.", 0, 0}, + {"debug", 'x', 0, "Boot with debug messages.", 0, 0}, + {"silent", 'z', 0, "Supress normal output (warnings remain).", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + static const grub_uint32_t netbsd_flags[] = { NETBSD_RB_ASKNAME, NETBSD_RB_HALT, NETBSD_RB_USERCONFIG, NETBSD_RB_KDB, NETBSD_RB_MINIROOT, NETBSD_AB_QUIET, NETBSD_RB_SINGLE, NETBSD_AB_VERBOSE, NETBSD_AB_DEBUG, - NETBSD_AB_SILENT + NETBSD_AB_SILENT, 0 }; static void @@ -785,41 +828,24 @@ fail: } static grub_uint32_t -grub_bsd_parse_flags (char *str, const char *opts, +grub_bsd_parse_flags (const struct grub_arg_list *state, const grub_uint32_t * flags) { grub_uint32_t result = 0; + unsigned i; - while (*str) - { - const char *po; - const grub_uint32_t *pf; - - po = opts; - pf = flags; - while (*po) - { - if (*str == *po) - { - result |= *pf; - break; - } - po++; - pf++; - } - str++; - } + for (i = 0; flags[i]; i++) + if (state[i].set) + result |= flags[i]; return result; } static grub_err_t -grub_cmd_freebsd (grub_command_t cmd __attribute__ ((unused)), - int argc, char *argv[]) +grub_cmd_freebsd (grub_extcmd_t cmd, int argc, char *argv[]) { kernel_type = KERNEL_TYPE_FREEBSD; - bootflags = ((argc <= 1) ? 0 : - grub_bsd_parse_flags (argv[1], freebsd_opts, freebsd_flags)); + bootflags = grub_bsd_parse_flags (cmd->state, freebsd_flags); if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) { @@ -879,12 +905,10 @@ grub_cmd_freebsd (grub_command_t cmd __attribute__ ((unused)), } static grub_err_t -grub_cmd_openbsd (grub_command_t cmd __attribute__ ((unused)), - int argc, char *argv[]) +grub_cmd_openbsd (grub_extcmd_t cmd, int argc, char *argv[]) { kernel_type = KERNEL_TYPE_OPENBSD; - bootflags = ((argc <= 1) ? 0 : - grub_bsd_parse_flags (argv[1], openbsd_opts, openbsd_flags)); + bootflags = grub_bsd_parse_flags (cmd->state, openbsd_flags); if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) grub_loader_set (grub_openbsd_boot, grub_bsd_unload, 1); @@ -893,12 +917,10 @@ grub_cmd_openbsd (grub_command_t cmd __attribute__ ((unused)), } static grub_err_t -grub_cmd_netbsd (grub_command_t cmd __attribute__ ((unused)), - int argc, char *argv[]) +grub_cmd_netbsd (grub_extcmd_t cmd, int argc, char *argv[]) { kernel_type = KERNEL_TYPE_NETBSD; - bootflags = ((argc <= 1) ? 0 : - grub_bsd_parse_flags (argv[1], netbsd_opts, netbsd_flags)); + bootflags = grub_bsd_parse_flags (cmd->state, netbsd_flags); if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) grub_loader_set (grub_netbsd_boot, grub_bsd_unload, 1); @@ -1112,21 +1134,24 @@ grub_cmd_freebsd_module_elf (grub_command_t cmd __attribute__ ((unused)), } -static grub_command_t cmd_freebsd, cmd_openbsd, cmd_netbsd; +static grub_extcmd_t cmd_freebsd, cmd_openbsd, cmd_netbsd; static grub_command_t cmd_freebsd_loadenv, cmd_freebsd_module; static grub_command_t cmd_freebsd_module_elf; GRUB_MOD_INIT (bsd) { - cmd_freebsd = - grub_register_command ("freebsd", grub_cmd_freebsd, - 0, "load kernel of FreeBSD"); - cmd_openbsd = - grub_register_command ("openbsd", grub_cmd_openbsd, - 0, "load kernel of OpenBSD"); - cmd_netbsd = - grub_register_command ("netbsd", grub_cmd_netbsd, - 0, "load kernel of NetBSD"); + cmd_freebsd = grub_register_extcmd ("freebsd", grub_cmd_freebsd, + GRUB_COMMAND_FLAG_BOTH, + "freebsd FILE", "Load kernel of FreeBSD.", + freebsd_opts); + cmd_openbsd = grub_register_extcmd ("openbsd", grub_cmd_openbsd, + GRUB_COMMAND_FLAG_BOTH, + "openbsd FILE", "Load kernel of OpenBSD.", + openbsd_opts); + cmd_netbsd = grub_register_extcmd ("netbsd", grub_cmd_netbsd, + GRUB_COMMAND_FLAG_BOTH, + "netbsd FILE", "Load kernel of NetBSD.", + netbsd_opts); cmd_freebsd_loadenv = grub_register_command ("freebsd_loadenv", grub_cmd_freebsd_loadenv, 0, "load FreeBSD env"); @@ -1142,9 +1167,9 @@ GRUB_MOD_INIT (bsd) GRUB_MOD_FINI (bsd) { - grub_unregister_command (cmd_freebsd); - grub_unregister_command (cmd_openbsd); - grub_unregister_command (cmd_netbsd); + grub_unregister_extcmd (cmd_freebsd); + grub_unregister_extcmd (cmd_openbsd); + grub_unregister_extcmd (cmd_netbsd); grub_unregister_command (cmd_freebsd_loadenv); grub_unregister_command (cmd_freebsd_module); From 71acf5e54bfceef23af245ff8c64979c5efdb4ba Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 23 Aug 2009 12:00:57 +0000 Subject: [PATCH 1049/1707] 2009-08-23 Robert Millan * partmap/pc.c: Rename to ... * partmap/msdos.c: ... this. Update all users. (grub_pc_partition_map): Rename to ... (grub_msdos_partition_map): ... this. Update all users. * parttool/pcpart.c: Rename to ... * parttool/msdospart.c: ... this. Update all users. * include/grub/pc_partition.h: Rename to ... * include/grub/msdos_partition.h: ... this. Update all users. (grub_pc_partition_bsd_entry): Rename to ... (grub_msdos_partition_bsd_entry): ... this. Update all users. (grub_pc_partition_disk_label): Rename to ... (grub_msdos_partition_disk_label): ... this. Update all users. (grub_pc_partition_entry): Rename to ... (grub_msdos_partition_entry): ... this. Update all users. (grub_pc_partition_mbr): Rename to ... (grub_msdos_partition_mbr): ... this. Update all users. (grub_pc_partition): Rename to ... (grub_msdos_partition): ... this. Update all users. (grub_pc_partition_is_empty): Rename to ... (grub_msdos_partition_is_empty): ... this. Update all users. (grub_pc_partition_is_extended): Rename to ... (grub_msdos_partition_is_extended): ... this. Update all users. (grub_pc_partition_is_bsd): Rename to ... (grub_msdos_partition_is_bsd): ... this. Update all users. * conf/common.rmk (amiga_mod_SOURCES, amiga_mod_CFLAGS) (amiga_mod_LDFLAGS, apple_mod_SOURCES, apple_mod_CFLAGS) (apple_mod_LDFLAGS, msdos_mod_SOURCES, msdos_mod_CFLAGS) (msdos_mod_LDFLAGS, sun_mod_SOURCES, sun_mod_CFLAGS) (sun_mod_LDFLAGS, acorn_mod_SOURCES, acorn_mod_CFLAGS) (acorn_mod_LDFLAGS, gpt_mod_SOURCES, gpt_mod_CFLAGS) (gpt_mod_LDFLAGS): Rename to ... (part_amiga_mod_SOURCES, part_amiga_mod_CFLAGS, part_amiga_mod_LDFLAGS) (part_apple_mod_SOURCES, part_apple_mod_CFLAGS, part_apple_mod_LDFLAGS) (part_msdos_mod_SOURCES, part_msdos_mod_CFLAGS, part_msdos_mod_LDFLAGS) (part_sun_mod_SOURCES, part_sun_mod_CFLAGS, part_sun_mod_LDFLAGS) (part_acorn_mod_SOURCES, part_acorn_mod_CFLAGS, part_acorn_mod_LDFLAGS) (part_gpt_mod_SOURCES, part_gpt_mod_CFLAGS) (part_gpt_mod_LDFLAGS): ... this. (pkglib_MODULES): Prefix partition modules with `part_'. Rename `pcpart.mod' to `msdospart.mod'. (pcpart_mod_SOURCES, pcpart_mod_CFLAGS, pcpart_mod_LDFLAGS): Rename to ... (msdospart_mod_SOURCES, msdospart_mod_CFLAGS) (msdospart_mod_LDFLAGS): ... this. --- ChangeLog | 50 +++++++++++++++ commands/gptsync.c | 4 +- conf/common.rmk | 63 +++++++++---------- conf/i386-coreboot.rmk | 8 +-- conf/i386-efi.rmk | 8 +-- conf/i386-ieee1275.rmk | 4 +- conf/i386-pc.rmk | 8 +-- conf/powerpc-ieee1275.rmk | 6 +- conf/sparc64-ieee1275.rmk | 8 +-- conf/x86_64-efi.rmk | 8 +-- .../{pc_partition.h => msdos_partition.h} | 20 +++--- include/grub/partition.h | 4 +- partmap/gpt.c | 4 +- partmap/{pc.c => msdos.c} | 44 ++++++------- parttool/{pcpart.c => msdospart.c} | 14 ++--- util/grub-probe.c | 2 +- util/hostdisk.c | 6 +- util/i386/pc/grub-setup.c | 16 ++--- util/sparc64/ieee1275/grub-setup.c | 2 +- 19 files changed, 164 insertions(+), 115 deletions(-) rename include/grub/{pc_partition.h => msdos_partition.h} (93%) rename partmap/{pc.c => msdos.c} (86%) rename parttool/{pcpart.c => msdospart.c} (91%) diff --git a/ChangeLog b/ChangeLog index 6cf11a6c8..ba1fdfef9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,53 @@ +2009-08-23 Robert Millan + + * partmap/pc.c: Rename to ... + * partmap/msdos.c: ... this. Update all users. + (grub_pc_partition_map): Rename to ... + (grub_msdos_partition_map): ... this. Update all users. + + * parttool/pcpart.c: Rename to ... + * parttool/msdospart.c: ... this. Update all users. + + * include/grub/pc_partition.h: Rename to ... + * include/grub/msdos_partition.h: ... this. Update all users. + (grub_pc_partition_bsd_entry): Rename to ... + (grub_msdos_partition_bsd_entry): ... this. Update all users. + (grub_pc_partition_disk_label): Rename to ... + (grub_msdos_partition_disk_label): ... this. Update all users. + (grub_pc_partition_entry): Rename to ... + (grub_msdos_partition_entry): ... this. Update all users. + (grub_pc_partition_mbr): Rename to ... + (grub_msdos_partition_mbr): ... this. Update all users. + (grub_pc_partition): Rename to ... + (grub_msdos_partition): ... this. Update all users. + (grub_pc_partition_is_empty): Rename to ... + (grub_msdos_partition_is_empty): ... this. Update all users. + (grub_pc_partition_is_extended): Rename to ... + (grub_msdos_partition_is_extended): ... this. Update all users. + (grub_pc_partition_is_bsd): Rename to ... + (grub_msdos_partition_is_bsd): ... this. Update all users. + + * conf/common.rmk (amiga_mod_SOURCES, amiga_mod_CFLAGS) + (amiga_mod_LDFLAGS, apple_mod_SOURCES, apple_mod_CFLAGS) + (apple_mod_LDFLAGS, msdos_mod_SOURCES, msdos_mod_CFLAGS) + (msdos_mod_LDFLAGS, sun_mod_SOURCES, sun_mod_CFLAGS) + (sun_mod_LDFLAGS, acorn_mod_SOURCES, acorn_mod_CFLAGS) + (acorn_mod_LDFLAGS, gpt_mod_SOURCES, gpt_mod_CFLAGS) + (gpt_mod_LDFLAGS): Rename to ... + (part_amiga_mod_SOURCES, part_amiga_mod_CFLAGS, part_amiga_mod_LDFLAGS) + (part_apple_mod_SOURCES, part_apple_mod_CFLAGS, part_apple_mod_LDFLAGS) + (part_msdos_mod_SOURCES, part_msdos_mod_CFLAGS, part_msdos_mod_LDFLAGS) + (part_sun_mod_SOURCES, part_sun_mod_CFLAGS, part_sun_mod_LDFLAGS) + (part_acorn_mod_SOURCES, part_acorn_mod_CFLAGS, part_acorn_mod_LDFLAGS) + (part_gpt_mod_SOURCES, part_gpt_mod_CFLAGS) + (part_gpt_mod_LDFLAGS): ... this. + (pkglib_MODULES): Prefix partition modules with `part_'. Rename + `pcpart.mod' to `msdospart.mod'. + (pcpart_mod_SOURCES, pcpart_mod_CFLAGS, pcpart_mod_LDFLAGS): Rename + to ... + (msdospart_mod_SOURCES, msdospart_mod_CFLAGS) + (msdospart_mod_LDFLAGS): ... this. + 2009-08-23 Vladimir Serbinenko * loader/i386/bsd.c (freebsd_opts): Rewritten to use extcmd. diff --git a/commands/gptsync.c b/commands/gptsync.c index 600309f70..a603746a2 100644 --- a/commands/gptsync.c +++ b/commands/gptsync.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -60,7 +60,7 @@ grub_cmd_gptsync (grub_command_t cmd __attribute__ ((unused)), int argc, char **args) { grub_device_t dev; - struct grub_pc_partition_mbr mbr; + struct grub_msdos_partition_mbr mbr; struct grub_partition *partition; grub_disk_addr_t first_sector; int numactive = 0; diff --git a/conf/common.rmk b/conf/common.rmk index b0d3785d1..c33e8000a 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -19,7 +19,7 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ - partmap/pc.c partmap/apple.c partmap/sun.c partmap/gpt.c\ + partmap/msdos.c partmap/apple.c partmap/sun.c partmap/gpt.c\ kern/fs.c kern/env.c fs/fshelp.c \ disk/raid.c disk/mdraid_linux.c disk/lvm.c grub_probe_init.c @@ -40,7 +40,7 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ - kern/partition.c partmap/pc.c partmap/apple.c partmap/sun.c \ + kern/partition.c partmap/msdos.c partmap/apple.c partmap/sun.c \ partmap/gpt.c \ kern/fs.c kern/env.c fs/fshelp.c disk/raid.c \ disk/raid5_recover.c disk/raid6_recover.c \ @@ -285,37 +285,36 @@ befs_mod_CFLAGS = $(COMMON_CFLAGS) befs_mod_LDFLAGS = $(COMMON_LDFLAGS) # Partition maps. -pkglib_MODULES += amiga.mod apple.mod pc.mod sun.mod acorn.mod gpt.mod -# For amiga.mod -amiga_mod_SOURCES = partmap/amiga.c -amiga_mod_CFLAGS = $(COMMON_CFLAGS) -amiga_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += part_amiga.mod +part_amiga_mod_SOURCES = partmap/amiga.c +part_amiga_mod_CFLAGS = $(COMMON_CFLAGS) +part_amiga_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For apple.mod -apple_mod_SOURCES = partmap/apple.c -apple_mod_CFLAGS = $(COMMON_CFLAGS) -apple_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += part_apple.mod +part_apple_mod_SOURCES = partmap/apple.c +part_apple_mod_CFLAGS = $(COMMON_CFLAGS) +part_apple_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For pc.mod -pc_mod_SOURCES = partmap/pc.c -pc_mod_CFLAGS = $(COMMON_CFLAGS) -pc_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += part_msdos.mod +part_msdos_mod_SOURCES = partmap/msdos.c +part_msdos_mod_CFLAGS = $(COMMON_CFLAGS) +part_msdos_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For sun.mod -sun_mod_SOURCES = partmap/sun.c -sun_mod_CFLAGS = $(COMMON_CFLAGS) -sun_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += part_sun.mod +part_sun_mod_SOURCES = partmap/sun.c +part_sun_mod_CFLAGS = $(COMMON_CFLAGS) +part_sun_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For acorn.mod -acorn_mod_SOURCES = partmap/acorn.c -acorn_mod_CFLAGS = $(COMMON_CFLAGS) -acorn_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += part_acorn.mod +part_acorn_mod_SOURCES = partmap/acorn.c +part_acorn_mod_CFLAGS = $(COMMON_CFLAGS) +part_acorn_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For gpt.mod -gpt_mod_SOURCES = partmap/gpt.c -gpt_mod_CFLAGS = $(COMMON_CFLAGS) -gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) +pkglib_MODULES += part_gpt.mod +part_gpt_mod_SOURCES = partmap/gpt.c +part_gpt_mod_CFLAGS = $(COMMON_CFLAGS) +part_gpt_mod_LDFLAGS = $(COMMON_LDFLAGS) # Special disk structures and generic drivers @@ -363,7 +362,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ fs_file.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - pcpart.mod memrw.mod normal.mod sh.mod lua.mod \ + msdospart.mod memrw.mod normal.mod sh.mod lua.mod \ gptsync.mod true.mod probe.mod # For gptsync.mod. @@ -391,10 +390,10 @@ parttool_mod_SOURCES = commands/parttool.c parttool_mod_CFLAGS = $(COMMON_CFLAGS) parttool_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For pcpart.mod. -pcpart_mod_SOURCES = parttool/pcpart.c -pcpart_mod_CFLAGS = $(COMMON_CFLAGS) -pcpart_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For msdospart.mod. +msdospart_mod_SOURCES = parttool/msdospart.c +msdospart_mod_CFLAGS = $(COMMON_CFLAGS) +msdospart_mod_LDFLAGS = $(COMMON_LDFLAGS) # For handler.mod. handler_mod_SOURCES = commands/handler.c diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index ce2576b95..de3004140 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -32,7 +32,7 @@ kernel_img_SOURCES = kern/i386/coreboot/startup.S \ symlist.c kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) @@ -75,7 +75,7 @@ kernel_img_SOURCES = kern/i386/qemu/startup.S \ symlist.c kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) -DGRUB_BOOT_MACHINE_LINK_ADDR=$(GRUB_BOOT_MACHINE_LINK_ADDR) @@ -134,14 +134,14 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/color.c \ script/sh/main.c script/sh/execute.c script/sh/function.c \ script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ + commands/parttool.c parttool/msdospart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 6e3cbcf6d..372d8fc58 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -23,7 +23,7 @@ util/i386/efi/grub-mkimage.c_DEPENDENCIES = Makefile #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ -# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ +# fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \ # fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ # kern/fs.c kern/env.c fs/fshelp.c @@ -61,14 +61,14 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/color.c \ script/sh/main.c script/sh/execute.c script/sh/function.c \ script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ + commands/parttool.c parttool/msdospart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) @@ -100,7 +100,7 @@ kernel_mod_SOURCES = kern/i386/efi/startup.S kern/main.c kern/device.c \ kern/generic/millisleep.c kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ efi/efi.h efi/time.h efi/disk.h i386/pit.h list.h handler.h command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) kernel_mod_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 65d1c6bde..98aaf5849 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -31,7 +31,7 @@ kernel_img_SOURCES = kern/i386/ieee1275/startup.S \ symlist.c kernel_img_HEADERS = cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ ieee1275/ieee1275.h machine/kernel.h machine/loader.h machine/memory.h \ list.h handler.h command.h kernel_img_CFLAGS = $(COMMON_CFLAGS) @@ -88,7 +88,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/color.c \ script/sh/main.c script/sh/execute.c script/sh/function.c \ script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 0ef5e4730..13aaa2618 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -61,7 +61,7 @@ kernel_img_SOURCES = kern/i386/pc/startup.S \ symlist.c kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ machine/biosdisk.h machine/boot.h machine/console.h machine/init.h \ machine/memory.h machine/loader.h machine/vga.h machine/vbe.h \ machine/kernel.h machine/pxe.h i386/pit.h list.h handler.h command.h @@ -104,7 +104,7 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ - partmap/pc.c partmap/gpt.c \ + partmap/msdos.c partmap/gpt.c \ \ disk/raid.c disk/mdraid_linux.c disk/lvm.c \ util/raid.c util/lvm.c \ @@ -140,7 +140,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/menu_text.c \ script/sh/main.c script/sh/execute.c script/sh/function.c \ script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -153,7 +153,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ + commands/parttool.c parttool/msdospart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index c30f61a48..c1c04e484 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -16,7 +16,7 @@ DEFSYMFILES += kernel_syms.lst kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h misc.h mm.h net.h parser.h reader.h \ symbol.h term.h time.h types.h powerpc/libgcc.h loader.h partition.h \ - pc_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ + msdos_partition.h ieee1275/ieee1275.h machine/kernel.h handler.h list.h \ command.h symlist.c: $(addprefix include/grub/,$(kernel_img_HEADERS)) config.h gensymlist.sh @@ -69,14 +69,14 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/color.c \ script/sh/main.c script/sh/execute.c script/sh/function.c \ script/sh/lexer.c script/sh/script.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ + commands/parttool.c parttool/msdospart.c \ grub_script.tab.c grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index b26496d20..c3ecba28f 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -28,7 +28,7 @@ DEFSYMFILES += kernel_syms.lst kernel_img_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ list.h handler.h command.h \ sparc64/libgcc.h ieee1275/ieee1275.h machine/kernel.h \ sparc64/ieee1275/ieee1275.h @@ -80,7 +80,7 @@ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ \ - partmap/amiga.c partmap/apple.c partmap/pc.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c \ partmap/sun.c partmap/acorn.c \ \ disk/raid.c disk/mdraid_linux.c disk/lvm.c \ @@ -126,14 +126,14 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/color.c \ script/sh/main.c script/sh/execute.c script/sh/function.c \ script/sh/lexer.c script/sh/script.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ partmap/acorn.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ + commands/parttool.c parttool/msdospart.c \ grub_script.tab.c grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 71a90ce18..c914fbf19 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -22,7 +22,7 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ #grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ # util/misc.c util/getroot.c kern/device.c kern/disk.c \ # kern/err.c kern/misc.c fs/fat.c fs/ext2.c fs/xfs.c fs/affs.c \ -# fs/sfs.c kern/parser.c kern/partition.c partmap/pc.c \ +# fs/sfs.c kern/parser.c kern/partition.c partmap/msdos.c \ # fs/ufs.c fs/ufs2.c fs/minix.c fs/hfs.c fs/jfs.c fs/hfsplus.c kern/file.c \ # kern/fs.c kern/env.c fs/fshelp.c @@ -58,14 +58,14 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ normal/color.c \ script/sh/main.c script/sh/execute.c script/sh/function.c \ script/sh/lexer.c script/sh/script.c grub_script.tab.c \ - partmap/amiga.c partmap/apple.c partmap/pc.c partmap/sun.c \ + partmap/amiga.c partmap/apple.c partmap/msdos.c partmap/sun.c \ partmap/acorn.c partmap/gpt.c \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ \ disk/raid.c disk/raid5_recover.c disk/raid6_recover.c \ disk/mdraid_linux.c disk/dmraid_nvidia.c disk/lvm.c \ - commands/parttool.c parttool/pcpart.c \ + commands/parttool.c parttool/msdospart.c \ grub_emu_init.c grub_emu_LDFLAGS = $(LIBCURSES) @@ -97,7 +97,7 @@ kernel_mod_SOURCES = kern/x86_64/efi/startup.S kern/x86_64/efi/callwrap.S \ term/efi/console.c disk/efi/efidisk.c kernel_mod_HEADERS = boot.h cache.h device.h disk.h dl.h elf.h elfload.h \ env.h err.h file.h fs.h kernel.h loader.h misc.h mm.h net.h parser.h \ - partition.h pc_partition.h reader.h symbol.h term.h time.h types.h \ + partition.h msdos_partition.h reader.h symbol.h term.h time.h types.h \ efi/efi.h efi/time.h efi/disk.h machine/loader.h i386/pit.h list.h \ handler.h command.h kernel_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/include/grub/pc_partition.h b/include/grub/msdos_partition.h similarity index 93% rename from include/grub/pc_partition.h rename to include/grub/msdos_partition.h index 67c312e64..273d8c95e 100644 --- a/include/grub/pc_partition.h +++ b/include/grub/msdos_partition.h @@ -99,7 +99,7 @@ #define GRUB_PC_PARTITION_OPENBSD_TYPE_RAID 19 /* The BSD partition entry. */ -struct grub_pc_partition_bsd_entry +struct grub_msdos_partition_bsd_entry { grub_uint32_t size; grub_uint32_t offset; @@ -110,7 +110,7 @@ struct grub_pc_partition_bsd_entry } __attribute__ ((packed)); /* The BSD disk label. Only define members useful for GRUB. */ -struct grub_pc_partition_disk_label +struct grub_msdos_partition_disk_label { grub_uint32_t magic; grub_uint8_t padding[128]; @@ -119,11 +119,11 @@ struct grub_pc_partition_disk_label grub_uint16_t num_partitions; grub_uint32_t boot_size; grub_uint32_t superblock_size; - struct grub_pc_partition_bsd_entry entries[GRUB_PC_PARTITION_BSD_MAX_ENTRIES]; + struct grub_msdos_partition_bsd_entry entries[GRUB_PC_PARTITION_BSD_MAX_ENTRIES]; } __attribute__ ((packed)); /* The partition entry. */ -struct grub_pc_partition_entry +struct grub_msdos_partition_entry { /* If active, 0x80, otherwise, 0x00. */ grub_uint8_t flag; @@ -155,20 +155,20 @@ struct grub_pc_partition_entry } __attribute__ ((packed)); /* The structure of MBR. */ -struct grub_pc_partition_mbr +struct grub_msdos_partition_mbr { /* The code area (actually, including BPB). */ grub_uint8_t code[446]; /* Four partition entries. */ - struct grub_pc_partition_entry entries[4]; + struct grub_msdos_partition_entry entries[4]; /* The signature 0xaa55. */ grub_uint16_t signature; } __attribute__ ((packed)); -struct grub_pc_partition +struct grub_msdos_partition { /* The DOS partition number. */ int dos_part; @@ -187,13 +187,13 @@ struct grub_pc_partition }; static inline int -grub_pc_partition_is_empty (int type) +grub_msdos_partition_is_empty (int type) { return (type == GRUB_PC_PARTITION_TYPE_NONE); } static inline int -grub_pc_partition_is_extended (int type) +grub_msdos_partition_is_extended (int type) { return (type == GRUB_PC_PARTITION_TYPE_EXTENDED || type == GRUB_PC_PARTITION_TYPE_WIN95_EXTENDED @@ -201,7 +201,7 @@ grub_pc_partition_is_extended (int type) } static inline int -grub_pc_partition_is_bsd (int type) +grub_msdos_partition_is_bsd (int type) { return (type == GRUB_PC_PARTITION_TYPE_FREEBSD || type == GRUB_PC_PARTITION_TYPE_OPENBSD diff --git a/include/grub/partition.h b/include/grub/partition.h index 37c5f2403..d35658cdd 100644 --- a/include/grub/partition.h +++ b/include/grub/partition.h @@ -84,8 +84,8 @@ void EXPORT_FUNC(grub_partition_map_register) (grub_partition_map_t partmap); void EXPORT_FUNC(grub_partition_map_unregister) (grub_partition_map_t partmap); #ifdef GRUB_UTIL -void grub_pc_partition_map_init (void); -void grub_pc_partition_map_fini (void); +void grub_msdos_partition_map_init (void); +void grub_msdos_partition_map_fini (void); void grub_amiga_partition_map_init (void); void grub_amiga_partition_map_fini (void); void grub_apple_partition_map_init (void); diff --git a/partmap/gpt.c b/partmap/gpt.c index d646d41b8..e860f35da 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include static grub_uint8_t grub_gpt_magic[8] = @@ -45,7 +45,7 @@ gpt_partition_map_iterate (grub_disk_t disk, struct grub_gpt_header gpt; struct grub_gpt_partentry entry; struct grub_disk raw; - struct grub_pc_partition_mbr mbr; + struct grub_msdos_partition_mbr mbr; grub_uint64_t entries; unsigned int i; int last_offset = 0; diff --git a/partmap/pc.c b/partmap/msdos.c similarity index 86% rename from partmap/pc.c rename to partmap/msdos.c index 6a2efd21e..9fc620df0 100644 --- a/partmap/pc.c +++ b/partmap/msdos.c @@ -18,13 +18,13 @@ */ #include -#include +#include #include #include #include #include -static struct grub_partition_map grub_pc_partition_map; +static struct grub_partition_map grub_msdos_partition_map; /* Parse the partition representation in STR and return a partition. */ @@ -32,7 +32,7 @@ static grub_partition_t grub_partition_parse (const char *str) { grub_partition_t p; - struct grub_pc_partition *pcdata; + struct grub_msdos_partition *pcdata; char *s = (char *) str; @@ -40,12 +40,12 @@ grub_partition_parse (const char *str) if (! p) return 0; - pcdata = (struct grub_pc_partition *) grub_malloc (sizeof (*pcdata)); + pcdata = (struct grub_msdos_partition *) grub_malloc (sizeof (*pcdata)); if (! pcdata) goto fail; p->data = pcdata; - p->partmap = &grub_pc_partition_map; + p->partmap = &grub_msdos_partition_map; /* Initialize some of the fields with invalid values. */ pcdata->bsd_part = pcdata->dos_type = pcdata->bsd_type = p->index = -1; @@ -93,9 +93,9 @@ pc_partition_map_iterate (grub_disk_t disk, const grub_partition_t partition)) { struct grub_partition p; - struct grub_pc_partition pcdata; - struct grub_pc_partition_mbr mbr; - struct grub_pc_partition_disk_label label; + struct grub_msdos_partition pcdata; + struct grub_msdos_partition_mbr mbr; + struct grub_msdos_partition_disk_label label; struct grub_disk raw; /* Enforce raw disk access. */ @@ -106,12 +106,12 @@ pc_partition_map_iterate (grub_disk_t disk, pcdata.ext_offset = 0; pcdata.dos_part = -1; p.data = &pcdata; - p.partmap = &grub_pc_partition_map; + p.partmap = &grub_msdos_partition_map; while (1) { int i; - struct grub_pc_partition_entry *e; + struct grub_msdos_partition_entry *e; /* Read the MBR. */ if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr)) @@ -147,8 +147,8 @@ pc_partition_map_iterate (grub_disk_t disk, return grub_error (GRUB_ERR_BAD_PART_TABLE, "dummy mbr"); /* If this partition is a normal one, call the hook. */ - if (! grub_pc_partition_is_empty (e->type) - && ! grub_pc_partition_is_extended (e->type)) + if (! grub_msdos_partition_is_empty (e->type) + && ! grub_msdos_partition_is_extended (e->type)) { pcdata.dos_part++; @@ -156,7 +156,7 @@ pc_partition_map_iterate (grub_disk_t disk, return 1; /* Check if this is a BSD partition. */ - if (grub_pc_partition_is_bsd (e->type)) + if (grub_msdos_partition_is_bsd (e->type)) { /* Check if the BSD label is within the DOS partition. */ if (p.len <= GRUB_PC_PARTITION_BSD_LABEL_SECTOR) @@ -186,7 +186,7 @@ pc_partition_map_iterate (grub_disk_t disk, pcdata.bsd_part < grub_cpu_to_le16 (label.num_partitions); pcdata.bsd_part++) { - struct grub_pc_partition_bsd_entry *be + struct grub_msdos_partition_bsd_entry *be = label.entries + pcdata.bsd_part; p.start = grub_le_to_cpu32 (be->offset); @@ -210,7 +210,7 @@ pc_partition_map_iterate (grub_disk_t disk, { e = mbr.entries + i; - if (grub_pc_partition_is_extended (e->type)) + if (grub_msdos_partition_is_extended (e->type)) { p.offset = pcdata.ext_offset + grub_le_to_cpu32 (e->start); if (! pcdata.ext_offset) @@ -234,14 +234,14 @@ static grub_partition_t pc_partition_map_probe (grub_disk_t disk, const char *str) { grub_partition_t p; - struct grub_pc_partition *pcdata; + struct grub_msdos_partition *pcdata; auto int find_func (grub_disk_t d, const grub_partition_t partition); int find_func (grub_disk_t d __attribute__ ((unused)), const grub_partition_t partition) { - struct grub_pc_partition *partdata = partition->data; + struct grub_msdos_partition *partdata = partition->data; if ((pcdata->dos_part == partdata->dos_part || pcdata->dos_part == -1) && pcdata->bsd_part == partdata->bsd_part) @@ -283,7 +283,7 @@ static char * pc_partition_map_get_name (const grub_partition_t p) { char *name; - struct grub_pc_partition *pcdata = p->data; + struct grub_msdos_partition *pcdata = p->data; name = grub_malloc (13); if (! name) @@ -301,9 +301,9 @@ pc_partition_map_get_name (const grub_partition_t p) /* Partition map type. */ -static struct grub_partition_map grub_pc_partition_map = +static struct grub_partition_map grub_msdos_partition_map = { - .name = "pc_partition_map", + .name = "msdos_partition_map", .iterate = pc_partition_map_iterate, .probe = pc_partition_map_probe, .get_name = pc_partition_map_get_name @@ -311,10 +311,10 @@ static struct grub_partition_map grub_pc_partition_map = GRUB_MOD_INIT(pc_partition_map) { - grub_partition_map_register (&grub_pc_partition_map); + grub_partition_map_register (&grub_msdos_partition_map); } GRUB_MOD_FINI(pc_partition_map) { - grub_partition_map_unregister (&grub_pc_partition_map); + grub_partition_map_unregister (&grub_msdos_partition_map); } diff --git a/parttool/pcpart.c b/parttool/msdospart.c similarity index 91% rename from parttool/pcpart.c rename to parttool/msdospart.c index 6876d0d58..1bb9cd3e1 100644 --- a/parttool/pcpart.c +++ b/parttool/msdospart.c @@ -22,7 +22,7 @@ #include #include #include -#include +#include #include #include #include @@ -42,7 +42,7 @@ static grub_err_t grub_pcpart_boot (const grub_device_t dev, { int i, index; grub_partition_t part; - struct grub_pc_partition_mbr mbr; + struct grub_msdos_partition_mbr mbr; if (dev->disk->partition->offset) return grub_error (GRUB_ERR_BAD_ARGUMENT, "not a primary partition"); @@ -92,7 +92,7 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, int index; grub_uint8_t type; grub_partition_t part; - struct grub_pc_partition_mbr mbr; + struct grub_msdos_partition_mbr mbr; index = dev->disk->partition->index; part = dev->disk->partition; @@ -119,8 +119,8 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, type &= ~GRUB_PC_PARTITION_TYPE_HIDDEN_FLAG; } - if (grub_pc_partition_is_empty (type) - || grub_pc_partition_is_extended (type)) + if (grub_msdos_partition_is_empty (type) + || grub_msdos_partition_is_extended (type)) { dev->disk->partition = part; return grub_error (GRUB_ERR_BAD_ARGUMENT, "invalid type"); @@ -140,10 +140,10 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, GRUB_MOD_INIT (pcpart) { - activate_table_handle = grub_parttool_register ("pc_partition_map", + activate_table_handle = grub_parttool_register ("msdos_partition_map", grub_pcpart_boot, grub_pcpart_bootargs); - type_table_handle = grub_parttool_register ("pc_partition_map", + type_table_handle = grub_parttool_register ("msdos_partition_map", grub_pcpart_type, grub_pcpart_typeargs); diff --git a/util/grub-probe.c b/util/grub-probe.c index 0088028f5..7c63f64ef 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include diff --git a/util/hostdisk.c b/util/hostdisk.c index fdf35148f..8a3e2ef1f 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -19,7 +19,7 @@ #include #include -#include +#include #include #include #include @@ -947,9 +947,9 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) int find_partition (grub_disk_t disk __attribute__ ((unused)), const grub_partition_t partition) { - struct grub_pc_partition *pcdata = NULL; + struct grub_msdos_partition *pcdata = NULL; - if (strcmp (partition->partmap->name, "pc_partition_map") == 0) + if (strcmp (partition->partmap->name, "msdos_partition_map") == 0) pcdata = partition->data; if (pcdata) diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 92c69ef15..0dc2e2c31 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include @@ -121,14 +121,14 @@ setup (const char *dir, int NESTED_FUNC_ATTR find_usable_region_msdos (grub_disk_t disk __attribute__ ((unused)), const grub_partition_t p) { - struct grub_pc_partition *pcdata = p->data; + struct grub_msdos_partition *pcdata = p->data; /* There's always an embed region, and it starts right after the MBR. */ embed_region.start = 1; /* For its end offset, include as many dummy partitions as we can. */ - if (! grub_pc_partition_is_empty (pcdata->dos_type) - && ! grub_pc_partition_is_bsd (pcdata->dos_type) + if (! grub_msdos_partition_is_empty (pcdata->dos_type) + && ! grub_msdos_partition_is_bsd (pcdata->dos_type) && embed_region.end > p->start) embed_region.end = p->start; @@ -279,9 +279,9 @@ setup (const char *dir, if (root_dev->disk->partition) { if (strcmp (root_dev->disk->partition->partmap->name, - "pc_partition_map") == 0) + "msdos_partition_map") == 0) { - struct grub_pc_partition *pcdata = + struct grub_msdos_partition *pcdata = root_dev->disk->partition->data; dos_part = pcdata->dos_part; bsd_part = pcdata->bsd_part; @@ -338,12 +338,12 @@ setup (const char *dir, goto unable_to_embed; } - grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "pc_partition_map") ? + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "msdos_partition_map") ? find_usable_region_gpt : find_usable_region_msdos)); if (embed_region.end == embed_region.start) { - if (! strcmp (dest_partmap, "pc_partition_map")) + if (! strcmp (dest_partmap, "msdos_partition_map")) grub_util_warn ("This msdos-style partition label has no post-MBR gap; embedding won't be possible!"); else grub_util_warn ("This GPT partition label has no BIOS Boot Partition; embedding won't be possible!"); diff --git a/util/sparc64/ieee1275/grub-setup.c b/util/sparc64/ieee1275/grub-setup.c index 9509eb30b..7008147bf 100644 --- a/util/sparc64/ieee1275/grub-setup.c +++ b/util/sparc64/ieee1275/grub-setup.c @@ -25,7 +25,7 @@ #include #include #include -#include +#include #include #include #include From c8c80635ae021b400a92eaa09f13b74ad2df48c4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 23 Aug 2009 12:59:22 +0000 Subject: [PATCH 1050/1707] 2009-08-23 Colin Watson * util/grub.d/30_os-prober.in: Disable os-prober if `GRUB_DISABLE_OS_PROBER' was set to true. --- ChangeLog | 5 +++++ util/grub.d/30_os-prober.in | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index ba1fdfef9..50c1cd4a8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-23 Colin Watson + + * util/grub.d/30_os-prober.in: Disable os-prober if + `GRUB_DISABLE_OS_PROBER' was set to true. + 2009-08-23 Robert Millan * partmap/pc.c: Rename to ... diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index b36c2a366..ffc46c9d4 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -22,6 +22,10 @@ libdir=@libdir@ . ${libdir}/grub/grub-mkconfig_lib +if [ "x${GRUB_DISABLE_OS_PROBER}" = "xtrue" ]; then + exit 0 +fi + if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev/null`" ] ; then # missing os-prober and/or linux-boot-prober exit 0 From 5174302b557d97cf0e50f92889b09d2fcdc9c70a Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 23 Aug 2009 15:09:05 +0000 Subject: [PATCH 1051/1707] 2009-08-23 Colin Watson * util/grub-mkconfig.in: Export GRUB_DISABLE_OS_PROBER. --- ChangeLog | 4 ++++ util/grub-mkconfig.in | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 50c1cd4a8..a2cc07f9a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-23 Colin Watson + + * util/grub-mkconfig.in: Export GRUB_DISABLE_OS_PROBER. + 2009-08-23 Colin Watson * util/grub.d/30_os-prober.in: Disable os-prober if diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 93f96525e..8e3c3372b 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -205,7 +205,8 @@ export GRUB_DEFAULT \ GRUB_SERIAL_COMMAND \ GRUB_DISABLE_LINUX_UUID \ GRUB_DISABLE_LINUX_RECOVERY \ - GRUB_GFXMODE + GRUB_GFXMODE \ + GRUB_DISABLE_OS_PROBER if test "x${grub_cfg}" != "x"; then rm -f ${grub_cfg}.new From e9a925da69cc89b86f051690a3b8ab2981f7557c Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 23 Aug 2009 15:27:07 +0000 Subject: [PATCH 1052/1707] 2009-08-23 Vladimir Serbinenko * commands/search.c (search_fs): Try searching without autoload first. * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load filesystem module explicitly for faster booting. --- ChangeLog | 6 ++++++ commands/search.c | 18 +++++++++++++++++- util/grub-mkconfig_lib.in | 5 +++++ 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a2cc07f9a..a00842cec 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-23 Vladimir Serbinenko + + * commands/search.c (search_fs): Try searching without autoload first. + * util/grub-mkconfig_lib.in (prepare_grub_to_access_device): Load + filesystem module explicitly for faster booting. + 2009-08-23 Colin Watson * util/grub-mkconfig.in: Export GRUB_DISABLE_OS_PROBER. diff --git a/commands/search.c b/commands/search.c index d10b51abf..0cfd0ebbc 100644 --- a/commands/search.c +++ b/commands/search.c @@ -51,6 +51,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type) { int count = 0; char *buf = NULL; + grub_fs_autoload_hook_t saved_autoload; auto int iterate_device (const char *name); int iterate_device (const char *name) @@ -131,7 +132,22 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type) return (found && var); } - grub_device_iterate (iterate_device); + /* First try without autoloading if we're setting variable. */ + if (var) + { + saved_autoload = grub_fs_autoload_hook; + grub_fs_autoload_hook = 0; + grub_device_iterate (iterate_device); + + /* Restore autoload hook. */ + grub_fs_autoload_hook = saved_autoload; + + /* Retry with autoload if nothing found. */ + if (grub_errno == GRUB_ERR_NONE && count == 0) + grub_device_iterate (iterate_device); + } + else + grub_device_iterate (iterate_device); grub_free (buf); diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 3585a68ef..2385b0878 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -140,6 +140,11 @@ prepare_grub_to_access_device () echo "insmod ${module}" done + fs="`${grub_probe} --device ${device} --target=fs`" + for module in ${fs} ; do + echo "insmod ${module}" + done + # If there's a filesystem UUID that GRUB is capable of identifying, use it; # otherwise set root as per value in device.map. echo "set root=`${grub_probe} --device ${device} --target=drive`" From de74f136b72547b10a50e6e0b73ff384e38261c1 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 23 Aug 2009 15:35:22 +0000 Subject: [PATCH 1053/1707] 2009-08-23 Vladimir Serbinenko * fs/hfsplus.c (grub_hfsplus_mount): Don't ignore grub_hfsplus_read_file errors. (grub_hfsplus_btree_iterate_node): Don't ignore grub_hfsplus_read_file errors. Call grub_error when needed. --- ChangeLog | 7 +++++++ fs/hfsplus.c | 32 ++++++++++++++++---------------- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/ChangeLog b/ChangeLog index a00842cec..bc631b910 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-23 Vladimir Serbinenko + + * fs/hfsplus.c (grub_hfsplus_mount): Don't ignore grub_hfsplus_read_file + errors. + (grub_hfsplus_btree_iterate_node): Don't ignore grub_hfsplus_read_file + errors. Call grub_error when needed. + 2009-08-23 Vladimir Serbinenko * commands/search.c (search_fs): Try searching without autoload first. diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 31bb54014..5e0ab093f 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -469,9 +469,9 @@ grub_hfsplus_mount (grub_disk_t disk) grub_be_to_cpu64 (data->volheader.extents_file.size); /* Read the essential information about the trees. */ - if (! grub_hfsplus_read_file (&data->catalog_tree.file, 0, - sizeof (struct grub_hfsplus_btnode), - sizeof (header), (char *) &header)) + if (grub_hfsplus_read_file (&data->catalog_tree.file, 0, + sizeof (struct grub_hfsplus_btnode), + sizeof (header), (char *) &header) <= 0) goto fail; data->catalog_tree.root = grub_be_to_cpu32 (header.root); @@ -479,15 +479,15 @@ grub_hfsplus_mount (grub_disk_t disk) data->case_sensitive = ((magic == GRUB_HFSPLUSX_MAGIC) && (header.key_compare == GRUB_HFSPLUSX_BINARYCOMPARE)); - if (! grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, - sizeof (struct grub_hfsplus_btnode), - sizeof (header), (char *) &header)) + if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, + sizeof (struct grub_hfsplus_btnode), + sizeof (header), (char *) &header) <= 0) goto fail; data->extoverflow_tree.root = grub_be_to_cpu32 (header.root); - if (! grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, - sizeof (node), (char *) &node)) + if (grub_hfsplus_read_file (&data->extoverflow_tree.file, 0, 0, + sizeof (node), (char *) &node) <= 0) goto fail; data->extoverflow_tree.root = grub_be_to_cpu32 (header.root); @@ -608,10 +608,10 @@ grub_hfsplus_btree_iterate_node (struct grub_hfsplus_btree *btree, if (! first_node->next) break; - if (! grub_hfsplus_read_file (&btree->file, 0, - (grub_be_to_cpu32 (first_node->next) - * btree->nodesize), - btree->nodesize, cnode)) + if (grub_hfsplus_read_file (&btree->file, 0, + (grub_be_to_cpu32 (first_node->next) + * btree->nodesize), + btree->nodesize, cnode) <= 0) return 1; /* Don't skip any record in the next iteration. */ @@ -647,12 +647,12 @@ grub_hfsplus_btree_search (struct grub_hfsplus_btree *btree, int match = 0; /* Read a node. */ - if (! grub_hfsplus_read_file (&btree->file, 0, - (long)currnode * (long)btree->nodesize, - btree->nodesize, (char *) node)) + if (grub_hfsplus_read_file (&btree->file, 0, + (long)currnode * (long)btree->nodesize, + btree->nodesize, (char *) node) <= 0) { grub_free (node); - return grub_errno; + return grub_error (GRUB_ERR_BAD_FS, "Couldn't read i-node."); } nodedesc = (struct grub_hfsplus_btnode *) node; From cb4735645d772caf4765773d9470031093ba491a Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 23 Aug 2009 21:04:44 +0000 Subject: [PATCH 1054/1707] 2009-08-23 Vladimir Serbinenko Fix grub-install. * util/i386/pc/grub-install.in: Add 'part_' to partmap_module. --- ChangeLog | 6 ++++++ util/i386/pc/grub-install.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index bc631b910..5701f9beb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-23 Vladimir Serbinenko + + Fix grub-install. + + * util/i386/pc/grub-install.in: Add 'part_' to partmap_module. + 2009-08-23 Vladimir Serbinenko * fs/hfsplus.c (grub_hfsplus_mount): Don't ignore grub_hfsplus_read_file diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 8ceb811dd..b6ee95772 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -261,7 +261,7 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` +partmap_module=part_`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` From af0f0beafaae4a67dc7e12f3d5330de779a468b7 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 23 Aug 2009 23:24:33 +0000 Subject: [PATCH 1055/1707] 2009-08-23 Vladimir Serbinenko Fix grub-install. * util/i386/efi/grub-install.in: Add 'part_' to partmap_module. * util/sparc64/ieee1275/grub-install.in: Likewise. --- ChangeLog | 2 ++ util/i386/efi/grub-install.in | 2 +- util/sparc64/ieee1275/grub-install.in | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5701f9beb..0af2eb8b3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,8 @@ Fix grub-install. * util/i386/pc/grub-install.in: Add 'part_' to partmap_module. + * util/i386/efi/grub-install.in: Likewise. + * util/sparc64/ieee1275/grub-install.in: Likewise. 2009-08-23 Vladimir Serbinenko diff --git a/util/i386/efi/grub-install.in b/util/i386/efi/grub-install.in index a5f97e346..db459885d 100644 --- a/util/i386/efi/grub-install.in +++ b/util/i386/efi/grub-install.in @@ -188,7 +188,7 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` +partmap_module=part_`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` diff --git a/util/sparc64/ieee1275/grub-install.in b/util/sparc64/ieee1275/grub-install.in index 5cfb858d7..c7c50da71 100644 --- a/util/sparc64/ieee1275/grub-install.in +++ b/util/sparc64/ieee1275/grub-install.in @@ -220,7 +220,7 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` +partmap_module=part_`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` From 0b8e386c0962d40232c09a0ab49d685bb91ca1db Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 23 Aug 2009 23:40:29 +0000 Subject: [PATCH 1056/1707] Revert 2 previous commits. 2009-08-23 Vladimir Serbinenko Fix grub-install. * util/grub-probe.c (probe_partmap): Prefix partmap with 'part_'. --- ChangeLog | 4 +--- util/grub-probe.c | 2 +- util/i386/efi/grub-install.in | 2 +- util/i386/pc/grub-install.in | 2 +- util/sparc64/ieee1275/grub-install.in | 2 +- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0af2eb8b3..80d3f89a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,9 +2,7 @@ Fix grub-install. - * util/i386/pc/grub-install.in: Add 'part_' to partmap_module. - * util/i386/efi/grub-install.in: Likewise. - * util/sparc64/ieee1275/grub-install.in: Likewise. + * util/grub-probe.c (probe_partmap): Prefix partmap with 'part_'. 2009-08-23 Vladimir Serbinenko diff --git a/util/grub-probe.c b/util/grub-probe.c index 7c63f64ef..c8dbc0175 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -97,7 +97,7 @@ probe_partmap (grub_disk_t disk) grub_util_error ("Invalid partition map %s", name); *underscore = '\0'; - printf ("%s\n", name); + printf ("part_%s\n", name); free (name); } diff --git a/util/i386/efi/grub-install.in b/util/i386/efi/grub-install.in index db459885d..a5f97e346 100644 --- a/util/i386/efi/grub-install.in +++ b/util/i386/efi/grub-install.in @@ -188,7 +188,7 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=part_`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` +partmap_module=`$grub_probe --target=partmap --device-map=${device_map} ${grubdir} 2> /dev/null` # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device-map=${device_map} ${grubdir}` diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index b6ee95772..8ceb811dd 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -261,7 +261,7 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=part_`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` +partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` diff --git a/util/sparc64/ieee1275/grub-install.in b/util/sparc64/ieee1275/grub-install.in index c7c50da71..5cfb858d7 100644 --- a/util/sparc64/ieee1275/grub-install.in +++ b/util/sparc64/ieee1275/grub-install.in @@ -220,7 +220,7 @@ fi # Then the partition map module. In order to support partition-less media, # this command is allowed to fail (--target=fs already grants us that the # filesystem will be accessible). -partmap_module=part_`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` +partmap_module=`$grub_probe --target=partmap --device ${grub_device} 2> /dev/null` # Device abstraction module, if any (lvm, raid). devabstraction_module=`$grub_probe --target=abstraction --device ${grub_device}` From f5ae9f745f0255d69675c054e5f77d3a0f799d58 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 12:55:19 +0000 Subject: [PATCH 1057/1707] 2009-08-24 Vladimir Serbinenko Support --no-smp and --no-acpi for NetBSD. * include/grub/i386/bsd.h (NETBSD_AB_NOSMP): New definition. (NETBSD_AB_NOACPI): Likewise. * loader/i386/bsd.c (netbsd_opts): New entries no-smp and no-acpi. (netbsd_flags): Add NETBSD_AB_NOSMP, NETBSD_AB_NOACPI. --- ChangeLog | 9 +++++++++ include/grub/i386/bsd.h | 2 ++ loader/i386/bsd.c | 10 ++++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80d3f89a7..9ec86ede8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-08-24 Vladimir Serbinenko + + Support --no-smp and --no-acpi for NetBSD. + + * include/grub/i386/bsd.h (NETBSD_AB_NOSMP): New definition. + (NETBSD_AB_NOACPI): Likewise. + * loader/i386/bsd.c (netbsd_opts): New entries no-smp and no-acpi. + (netbsd_flags): Add NETBSD_AB_NOSMP, NETBSD_AB_NOACPI. + 2009-08-23 Vladimir Serbinenko Fix grub-install. diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index 117ed5c68..f39fc9d5c 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -189,6 +189,8 @@ struct grub_openbsd_bootargs #define NETBSD_AB_VERBOSE (1 << 17) /* boot verbosely */ #define NETBSD_AB_SILENT (1 << 18) /* boot silently */ #define NETBSD_AB_DEBUG (1 << 19) /* boot with debug messages */ +#define NETBSD_AB_NOSMP (1 << 28) /* Boot without SMP support. */ +#define NETBSD_AB_NOACPI (1 << 29) /* Boot without ACPI support. */ struct grub_netbsd_bootinfo { diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index d5f677a2a..10b92e3c6 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -103,6 +103,8 @@ static const grub_uint32_t openbsd_flags[] = static const struct grub_arg_option netbsd_opts[] = { + {"no-smp", '1', 0, "Disable SMP.", 0, 0}, + {"no-acpi", '2', 0, "Disable ACPI.", 0, 0}, {"askname", 'a', 0, "Ask for file name to reboot from.", 0, 0}, {"halt", 'b', 0, "Don't reboot, just halt.", 0, 0}, {"config", 'c', 0, "Change configured devices.", 0, 0}, @@ -118,10 +120,10 @@ static const struct grub_arg_option netbsd_opts[] = static const grub_uint32_t netbsd_flags[] = { - NETBSD_RB_ASKNAME, NETBSD_RB_HALT, NETBSD_RB_USERCONFIG, - NETBSD_RB_KDB, NETBSD_RB_MINIROOT, NETBSD_AB_QUIET, - NETBSD_RB_SINGLE, NETBSD_AB_VERBOSE, NETBSD_AB_DEBUG, - NETBSD_AB_SILENT, 0 + NETBSD_AB_NOSMP, NETBSD_AB_NOACPI, NETBSD_RB_ASKNAME, + NETBSD_RB_HALT, NETBSD_RB_USERCONFIG, NETBSD_RB_KDB, + NETBSD_RB_MINIROOT, NETBSD_AB_QUIET, NETBSD_RB_SINGLE, + NETBSD_AB_VERBOSE, NETBSD_AB_DEBUG, NETBSD_AB_SILENT, 0 }; static void From adb29902f39d18660c0cb4115c79f2a55dc1ba04 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 12:59:48 +0000 Subject: [PATCH 1058/1707] 2009-08-24 Vladimir Serbinenko Support for 64-bit NetBSD. * loader/i386/bsd.c (grub_bsd_load_elf): Apply correct mask to entry point when booting non-FreeBSD. --- ChangeLog | 7 +++++++ loader/i386/bsd.c | 14 ++++++++++++-- 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9ec86ede8..59b50f04a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-24 Vladimir Serbinenko + + Support for 64-bit NetBSD. + + * loader/i386/bsd.c (grub_bsd_load_elf): Apply correct mask to entry + point when booting non-FreeBSD. + 2009-08-24 Vladimir Serbinenko Support --no-smp and --no-acpi for NetBSD. diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 10b92e3c6..26f98b3a9 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -778,8 +778,18 @@ grub_bsd_load_elf (grub_elf_t elf) else if (grub_elf_is_elf64 (elf)) { is_64bit = 1; - entry = elf->ehdr.ehdr64.e_entry & 0xffffffff; - entry_hi = (elf->ehdr.ehdr64.e_entry >> 32) & 0xffffffff; + + /* FreeBSD has 64-bit entry point. */ + if (kernel_type == KERNEL_TYPE_FREEBSD) + { + entry = elf->ehdr.ehdr64.e_entry & 0xffffffff; + entry_hi = (elf->ehdr.ehdr64.e_entry >> 32) & 0xffffffff; + } + else + { + entry = elf->ehdr.ehdr64.e_entry & 0x0fffffff; + entry_hi = 0; + } return grub_elf64_load (elf, grub_bsd_elf64_hook, 0, 0); } else From 16c84d744cd724d2f6e0efb4af245e74d914d2f5 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 13:10:12 +0000 Subject: [PATCH 1059/1707] 2009-08-24 Vladimir Serbinenko Let user specify NetBSD root device. * loader/i386/bsd.c (netbsd_root): New variable. (netbsd_opts): New option 'root'. (NETBSD_ROOT_ARG): New macro. (grub_netbsd_boot): Use 'netbsd_root'. (grub_bsd_unload): Free 'netbsd_root'. (grub_cmd_netbsd): Fill 'netbsd_root'. --- ChangeLog | 11 +++++++++++ loader/i386/bsd.c | 44 ++++++++++++++++++++++++++++++++++---------- 2 files changed, 45 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 59b50f04a..f26013862 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-08-24 Vladimir Serbinenko + + Let user specify NetBSD root device. + + * loader/i386/bsd.c (netbsd_root): New variable. + (netbsd_opts): New option 'root'. + (NETBSD_ROOT_ARG): New macro. + (grub_netbsd_boot): Use 'netbsd_root'. + (grub_bsd_unload): Free 'netbsd_root'. + (grub_cmd_netbsd): Fill 'netbsd_root'. + 2009-08-24 Vladimir Serbinenko Support for 64-bit NetBSD. diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 26f98b3a9..09e5f5876 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -56,6 +56,7 @@ static grub_uint32_t bootflags; static char *mod_buf; static grub_uint32_t mod_buf_len, mod_buf_max, kern_end_mdofs; static int is_elf_kernel, is_64bit; +static char *netbsd_root = NULL; static const struct grub_arg_option freebsd_opts[] = { @@ -115,6 +116,7 @@ static const struct grub_arg_option netbsd_opts[] = {"verbose", 'v', 0, "Boot with verbose messages.", 0, 0}, {"debug", 'x', 0, "Boot with debug messages.", 0, 0}, {"silent", 'z', 0, "Supress normal output (warnings remain).", 0, 0}, + {"root", 'r', 0, "Set root device.", "DEVICE", ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; @@ -126,6 +128,8 @@ static const grub_uint32_t netbsd_flags[] = NETBSD_AB_VERBOSE, NETBSD_AB_DEBUG, NETBSD_AB_SILENT, 0 }; +#define NETBSD_ROOT_ARG (ARRAY_SIZE (netbsd_flags) - 1) + static void grub_bsd_get_device (grub_uint32_t * biosdev, grub_uint32_t * unit, @@ -607,22 +611,35 @@ grub_openbsd_boot (void) static grub_err_t grub_netbsd_boot (void) { - struct grub_netbsd_btinfo_rootdevice *rootdev; struct grub_netbsd_bootinfo *bootinfo; grub_uint32_t biosdev, unit, slice, part; grub_bsd_get_device (&biosdev, &unit, &slice, &part); - rootdev = (struct grub_netbsd_btinfo_rootdevice *) GRUB_BSD_TEMP_BUFFER; + if (kern_end + sizeof (struct grub_netbsd_btinfo_rootdevice) + + sizeof (struct grub_netbsd_bootinfo) > grub_os_area_addr + + grub_os_area_size) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "No memory fo boot info."); - rootdev->common.len = sizeof (struct grub_netbsd_btinfo_rootdevice); - rootdev->common.type = NETBSD_BTINFO_ROOTDEVICE; - grub_sprintf (rootdev->devname, "%cd%d%c", (biosdev & 0x80) ? 'w' : 'f', - unit, 'a' + part); + if (netbsd_root) + { + struct grub_netbsd_btinfo_rootdevice *rootdev; - bootinfo = (struct grub_netbsd_bootinfo *) (rootdev + 1); - bootinfo->bi_count = 1; - bootinfo->bi_data[0] = rootdev; + rootdev = (struct grub_netbsd_btinfo_rootdevice *) kern_end; + + rootdev->common.len = sizeof (struct grub_netbsd_btinfo_rootdevice); + rootdev->common.type = NETBSD_BTINFO_ROOTDEVICE; + grub_strncpy (rootdev->devname, netbsd_root, sizeof (rootdev->devname)); + + bootinfo = (struct grub_netbsd_bootinfo *) (rootdev + 1); + bootinfo->bi_count = 1; + bootinfo->bi_data[0] = rootdev; + } + else + { + bootinfo = (struct grub_netbsd_bootinfo *) kern_end; + bootinfo->bi_count = 0; + } grub_unix_real_boot (entry, bootflags, 0, bootinfo, 0, grub_mmap_get_upper () >> 10, @@ -645,6 +662,9 @@ grub_bsd_unload (void) kernel_type = KERNEL_TYPE_NONE; grub_dl_unref (my_mod); + grub_free (netbsd_root); + netbsd_root = NULL; + return GRUB_ERR_NONE; } @@ -935,7 +955,11 @@ grub_cmd_netbsd (grub_extcmd_t cmd, int argc, char *argv[]) bootflags = grub_bsd_parse_flags (cmd->state, netbsd_flags); if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) - grub_loader_set (grub_netbsd_boot, grub_bsd_unload, 1); + { + grub_loader_set (grub_netbsd_boot, grub_bsd_unload, 1); + if (cmd->state[NETBSD_ROOT_ARG].set) + netbsd_root = grub_strdup (cmd->state[NETBSD_ROOT_ARG].arg); + } return grub_errno; } From dd103c4e042c00e5b59ccdae701f8a4a90f09b3f Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 13:20:24 +0000 Subject: [PATCH 1060/1707] 2009-08-24 Vladimir Serbinenko Fix OpenBSD and NetBSD support. * include/grub/i386/bsd.h (GRUB_BSD_TEMP_BUFFER): Change to resolve memory address conflict. (OPENBSD_MMAP_ACPI): New definition. (OPENBSD_MMAP_NVS): Likewise. * loader/i386/bsd.c (grub_openbsd_boot): Support OPENBSD_MMAP_ACPI and OPENBSD_MMAP_NVS. Add memory map terminator Explicit cast when calling grub_unix_real_boot. (grub_nebsd_boot): Explicit cast when calling grub_unix_real_boot. --- ChangeLog | 14 ++++++++++++++ include/grub/i386/bsd.h | 4 +++- loader/i386/bsd.c | 22 ++++++++++++++++++---- 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index f26013862..d81560913 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-08-24 Vladimir Serbinenko + + Fix OpenBSD and NetBSD support. + + * include/grub/i386/bsd.h (GRUB_BSD_TEMP_BUFFER): Change to resolve + memory address conflict. + (OPENBSD_MMAP_ACPI): New definition. + (OPENBSD_MMAP_NVS): Likewise. + * loader/i386/bsd.c (grub_openbsd_boot): Support OPENBSD_MMAP_ACPI + and OPENBSD_MMAP_NVS. + Add memory map terminator + Explicit cast when calling grub_unix_real_boot. + (grub_nebsd_boot): Explicit cast when calling grub_unix_real_boot. + 2009-08-24 Vladimir Serbinenko Let user specify NetBSD root device. diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index f39fc9d5c..2939035d2 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -29,7 +29,7 @@ enum bsd_kernel_types KERNEL_TYPE_NETBSD, }; -#define GRUB_BSD_TEMP_BUFFER 0x68000 +#define GRUB_BSD_TEMP_BUFFER 0x80000 #define FREEBSD_RB_ASKNAME (1 << 0) /* ask for file name to reboot from */ #define FREEBSD_RB_SINGLE (1 << 1) /* reboot to single user only */ @@ -157,6 +157,8 @@ struct grub_openbsd_bios_mmap grub_uint64_t len; #define OPENBSD_MMAP_AVAILABLE 1 #define OPENBSD_MMAP_RESERVED 2 +#define OPENBSD_MMAP_ACPI 3 +#define OPENBSD_MMAP_NVS 4 grub_uint32_t type; }; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 09e5f5876..1b6f1902b 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -574,6 +574,14 @@ grub_openbsd_boot (void) pm->type = OPENBSD_MMAP_AVAILABLE; break; + case GRUB_MACHINE_MEMORY_ACPI: + pm->type = OPENBSD_MMAP_ACPI; + break; + + case GRUB_MACHINE_MEMORY_NVS: + pm->type = OPENBSD_MMAP_NVS; + break; + default: pm->type = OPENBSD_MMAP_RESERVED; break; @@ -589,6 +597,12 @@ grub_openbsd_boot (void) pm = (struct grub_openbsd_bios_mmap *) (pa + 1); grub_mmap_iterate (hook); + /* Memory map terminator. */ + pm->addr = 0; + pm->len = 0; + pm->type = 0; + pm++; + pa->ba_size = (char *) pm - (char *) pa; pa->ba_next = (struct grub_openbsd_bootargs *) pm; pa = pa->ba_next; @@ -600,8 +614,8 @@ grub_openbsd_boot (void) (part << OPENBSD_B_PARTSHIFT)); grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER, - 0, grub_mmap_get_upper () >> 10, - grub_mmap_get_lower () >> 10, + 0, (grub_uint32_t) (grub_mmap_get_upper () >> 10), + (grub_uint32_t) (grub_mmap_get_lower () >> 10), (char *) pa - buf, buf); /* Not reached. */ @@ -642,8 +656,8 @@ grub_netbsd_boot (void) } grub_unix_real_boot (entry, bootflags, 0, bootinfo, - 0, grub_mmap_get_upper () >> 10, - grub_mmap_get_lower () >> 10); + 0, (grub_uint32_t) (grub_mmap_get_upper () >> 10), + (grub_uint32_t) (grub_mmap_get_lower () >> 10)); /* Not reached. */ return GRUB_ERR_NONE; From 2d21e3e8e0b20a7b19bc66e8f51c1c153d1dc7df Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 13:34:03 +0000 Subject: [PATCH 1061/1707] 2009-08-24 Vladimir Serbinenko Rename *_partition_map to part_* * partmap/acorn.c (grub_acorn_partition_map): Set name to 'part_acorn'. * partmap/amiga.c (grub_amiga_partition_map): Set name to 'part_amiga'. * partmap/apple.c (grub_apple_partition_map): Set name to 'part_apple'. * partmap/gpt.c (grub_gpt_partition_map): Set name to 'part_gpt'. All users updated. * partmap/msdos.c (grub_msdos_partition_map): Set name to 'part_msdos'. All users updated. * partmap/sun.c (grub_sun_partition_map): Set name to 'part_sun'. * util/grub-probe.c (probe_partmap): Don't transform partition name to get module name. --- ChangeLog | 21 +++++++++++++++------ partmap/acorn.c | 2 +- partmap/amiga.c | 2 +- partmap/apple.c | 2 +- partmap/gpt.c | 2 +- partmap/msdos.c | 2 +- partmap/sun.c | 2 +- parttool/msdospart.c | 4 ++-- util/grub-probe.c | 15 +-------------- util/hostdisk.c | 2 +- util/i386/pc/grub-setup.c | 4 ++-- 11 files changed, 27 insertions(+), 31 deletions(-) diff --git a/ChangeLog b/ChangeLog index d81560913..1efb882bc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-08-24 Vladimir Serbinenko + + Rename *_partition_map to part_* + + * partmap/acorn.c (grub_acorn_partition_map): Set name to 'part_acorn'. + * partmap/amiga.c (grub_amiga_partition_map): Set name to 'part_amiga'. + * partmap/apple.c (grub_apple_partition_map): Set name to 'part_apple'. + * partmap/gpt.c (grub_gpt_partition_map): Set name to 'part_gpt'. + All users updated. + * partmap/msdos.c (grub_msdos_partition_map): Set name to 'part_msdos'. + All users updated. + * partmap/sun.c (grub_sun_partition_map): Set name to 'part_sun'. + * util/grub-probe.c (probe_partmap): Don't transform partition name + to get module name. + 2009-08-24 Vladimir Serbinenko Fix OpenBSD and NetBSD support. @@ -39,12 +54,6 @@ * loader/i386/bsd.c (netbsd_opts): New entries no-smp and no-acpi. (netbsd_flags): Add NETBSD_AB_NOSMP, NETBSD_AB_NOACPI. -2009-08-23 Vladimir Serbinenko - - Fix grub-install. - - * util/grub-probe.c (probe_partmap): Prefix partmap with 'part_'. - 2009-08-23 Vladimir Serbinenko * fs/hfsplus.c (grub_hfsplus_mount): Don't ignore grub_hfsplus_read_file diff --git a/partmap/acorn.c b/partmap/acorn.c index 42fd61f4a..e005975c0 100644 --- a/partmap/acorn.c +++ b/partmap/acorn.c @@ -189,7 +189,7 @@ acorn_partition_map_get_name (const grub_partition_t p) /* Partition map type. */ static struct grub_partition_map grub_acorn_partition_map = { - .name = "Linux/ADFS partition map", + .name = "part_acorn", .iterate = acorn_partition_map_iterate, .probe = acorn_partition_map_probe, .get_name = acorn_partition_map_get_name diff --git a/partmap/amiga.c b/partmap/amiga.c index ffb807f5a..dce9f4f1f 100644 --- a/partmap/amiga.c +++ b/partmap/amiga.c @@ -198,7 +198,7 @@ amiga_partition_map_get_name (const grub_partition_t p) /* Partition map type. */ static struct grub_partition_map grub_amiga_partition_map = { - .name = "amiga_partition_map", + .name = "part_amiga", .iterate = amiga_partition_map_iterate, .probe = amiga_partition_map_probe, .get_name = amiga_partition_map_get_name diff --git a/partmap/apple.c b/partmap/apple.c index 04ccff146..4dea55a32 100644 --- a/partmap/apple.c +++ b/partmap/apple.c @@ -241,7 +241,7 @@ apple_partition_map_get_name (const grub_partition_t p) /* Partition map type. */ static struct grub_partition_map grub_apple_partition_map = { - .name = "apple_partition_map", + .name = "part_apple", .iterate = apple_partition_map_iterate, .probe = apple_partition_map_probe, .get_name = apple_partition_map_get_name diff --git a/partmap/gpt.c b/partmap/gpt.c index e860f35da..4a4957437 100644 --- a/partmap/gpt.c +++ b/partmap/gpt.c @@ -176,7 +176,7 @@ gpt_partition_map_get_name (const grub_partition_t p) /* Partition map type. */ static struct grub_partition_map grub_gpt_partition_map = { - .name = "gpt_partition_map", + .name = "part_gpt", .iterate = gpt_partition_map_iterate, .probe = gpt_partition_map_probe, .get_name = gpt_partition_map_get_name diff --git a/partmap/msdos.c b/partmap/msdos.c index 9fc620df0..d0fc18efe 100644 --- a/partmap/msdos.c +++ b/partmap/msdos.c @@ -303,7 +303,7 @@ pc_partition_map_get_name (const grub_partition_t p) /* Partition map type. */ static struct grub_partition_map grub_msdos_partition_map = { - .name = "msdos_partition_map", + .name = "part_msdos", .iterate = pc_partition_map_iterate, .probe = pc_partition_map_probe, .get_name = pc_partition_map_get_name diff --git a/partmap/sun.c b/partmap/sun.c index ce6d58899..e816ec17a 100644 --- a/partmap/sun.c +++ b/partmap/sun.c @@ -196,7 +196,7 @@ sun_partition_map_get_name (const grub_partition_t p) /* Partition map type. */ static struct grub_partition_map grub_sun_partition_map = { - .name = "sun_partition_map", + .name = "part_sun", .iterate = sun_partition_map_iterate, .probe = sun_partition_map_probe, .get_name = sun_partition_map_get_name diff --git a/parttool/msdospart.c b/parttool/msdospart.c index 1bb9cd3e1..dbb25bc52 100644 --- a/parttool/msdospart.c +++ b/parttool/msdospart.c @@ -140,10 +140,10 @@ static grub_err_t grub_pcpart_type (const grub_device_t dev, GRUB_MOD_INIT (pcpart) { - activate_table_handle = grub_parttool_register ("msdos_partition_map", + activate_table_handle = grub_parttool_register ("part_msdos", grub_pcpart_boot, grub_pcpart_bootargs); - type_table_handle = grub_parttool_register ("msdos_partition_map", + type_table_handle = grub_parttool_register ("part_msdos", grub_pcpart_type, grub_pcpart_typeargs); diff --git a/util/grub-probe.c b/util/grub-probe.c index c8dbc0175..1710ec51b 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -79,26 +79,13 @@ grub_refresh (void) static void probe_partmap (grub_disk_t disk) { - char *name; - char *underscore; - if (disk->partition == NULL) { grub_util_info ("No partition map found for %s", disk->name); return; } - name = strdup (disk->partition->partmap->name); - if (! name) - grub_util_error ("Not enough memory"); - - underscore = strchr (name, '_'); - if (! underscore) - grub_util_error ("Invalid partition map %s", name); - - *underscore = '\0'; - printf ("part_%s\n", name); - free (name); + printf ("%s\n", disk->partition->partmap->name); } static int diff --git a/util/hostdisk.c b/util/hostdisk.c index 8a3e2ef1f..a06ecca2a 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -949,7 +949,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) { struct grub_msdos_partition *pcdata = NULL; - if (strcmp (partition->partmap->name, "msdos_partition_map") == 0) + if (strcmp (partition->partmap->name, "part_msdos") == 0) pcdata = partition->data; if (pcdata) diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 0dc2e2c31..7f38c4293 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -279,7 +279,7 @@ setup (const char *dir, if (root_dev->disk->partition) { if (strcmp (root_dev->disk->partition->partmap->name, - "msdos_partition_map") == 0) + "part_msdos") == 0) { struct grub_msdos_partition *pcdata = root_dev->disk->partition->data; @@ -287,7 +287,7 @@ setup (const char *dir, bsd_part = pcdata->bsd_part; } else if (strcmp (root_dev->disk->partition->partmap->name, - "gpt_partition_map") == 0) + "part_gpt") == 0) { dos_part = root_dev->disk->partition->index; bsd_part = -1; From c385bfc37f47025ba50e9e5549462ca12f2d9df8 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 24 Aug 2009 17:03:24 +0000 Subject: [PATCH 1062/1707] 2009-08-24 Colin Watson * term/usb_keyboard.c (grub_usb_keyboard_getreport): Make `report' grub_uint8_t *. (grub_usb_keyboard_checkkey): Make `data' elements grub_uint8_t. Use a 50-millisecond timeout rather than just repeating grub_usb_keyboard_getreport 50 times. (grub_usb_keyboard_getkey): Make `data' elements grub_uint8_t. --- ChangeLog | 9 +++++++++ term/usb_keyboard.c | 16 ++++++++++------ 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1efb882bc..38e8d4650 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-08-24 Colin Watson + + * term/usb_keyboard.c (grub_usb_keyboard_getreport): Make + `report' grub_uint8_t *. + (grub_usb_keyboard_checkkey): Make `data' elements grub_uint8_t. + Use a 50-millisecond timeout rather than just repeating + grub_usb_keyboard_getreport 50 times. + (grub_usb_keyboard_getkey): Make `data' elements grub_uint8_t. + 2009-08-24 Vladimir Serbinenko Rename *_partition_map to part_* diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index c827955ab..bb62b35ed 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -97,7 +97,7 @@ grub_usb_hid (void) } static grub_err_t -grub_usb_keyboard_getreport (grub_usb_device_t dev, unsigned char *report) +grub_usb_keyboard_getreport (grub_usb_device_t dev, grub_uint8_t *report) { return grub_usb_control_msg (dev, (1 << 7) | (1 << 5) | 1, 0x01, 0, 0, 8, (char *) report); @@ -108,20 +108,24 @@ grub_usb_keyboard_getreport (grub_usb_device_t dev, unsigned char *report) static int grub_usb_keyboard_checkkey (void) { - unsigned char data[8]; + grub_uint8_t data[8]; int key; - int i; grub_err_t err; + grub_uint64_t currtime; + int timeout = 50; data[2] = 0; - for (i = 0; i < 50; i++) + currtime = grub_get_time_ms (); + do { /* Get_Report. */ err = grub_usb_keyboard_getreport (usbdev, data); - if (! err && data[2]) + /* Implement a timeout. */ + if (grub_get_time_ms () > currtime + timeout) break; } + while (err || !data[2]); if (err || !data[2]) return -1; @@ -174,7 +178,7 @@ grub_usb_keyboard_getkey (void) { int key; grub_err_t err; - unsigned char data[8]; + grub_uint8_t data[8]; grub_uint64_t currtime; int timeout; static grub_usb_keyboard_repeat_t repeat = GRUB_HIDBOOT_REPEAT_NONE; From 48e40bff44271bda0c3d7592112ad15b40c63153 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 19:08:11 +0000 Subject: [PATCH 1063/1707] 2009-08-24 Vladimir Serbinenko * script/sh/function.c (grub_script_function_find): Cut error message not to flood terminal. * script/sh/lexer.c (grub_script_yylex): Remove command line length limit. * script/sh/script.c (grub_script_arg_add): Duplicate string. --- ChangeLog | 8 +++++ script/sh/function.c | 2 +- script/sh/lexer.c | 78 +++++++++++++++++++++++++++++++------------- script/sh/script.c | 5 ++- 4 files changed, 69 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 38e8d4650..a8c30d971 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-24 Vladimir Serbinenko + + * script/sh/function.c (grub_script_function_find): Cut error message + not to flood terminal. + * script/sh/lexer.c (grub_script_yylex): Remove command line length + limit. + * script/sh/script.c (grub_script_arg_add): Duplicate string. + 2009-08-24 Colin Watson * term/usb_keyboard.c (grub_usb_keyboard_getreport): Make diff --git a/script/sh/function.c b/script/sh/function.c index 1e49c709f..a3950a8a0 100644 --- a/script/sh/function.c +++ b/script/sh/function.c @@ -99,7 +99,7 @@ grub_script_function_find (char *functionname) break; if (! func) - grub_error (GRUB_ERR_UNKNOWN_COMMAND, "unknown command `%s'", functionname); + grub_error (GRUB_ERR_UNKNOWN_COMMAND, "unknown command `%.20s'", functionname); return func; } diff --git a/script/sh/lexer.c b/script/sh/lexer.c index 44d7da2ad..a30e3c005 100644 --- a/script/sh/lexer.c +++ b/script/sh/lexer.c @@ -134,8 +134,6 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) { grub_parser_state_t newstate; char use; - char *buffer; - char *bp; struct grub_lexer_param *state = parsestate->lexerstate; int firstrun = 1; @@ -212,6 +210,14 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) /* Check if it is a text. */ if (check_textstate (newstate)) { + char *buffer = NULL; + int bufpos = 0; + /* Buffer is initially large enough to hold most commands + but extends automatically when needed. */ + int bufsize = 128; + + buffer = grub_malloc (bufsize); + /* In case the string is not quoted, this can be a one char length symbol. */ if (newstate == GRUB_PARSER_STATE_TEXT) @@ -254,16 +260,12 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) } } if (doexit) - break; + { + grub_free (buffer); + break; + } } - /* XXX: Use a better size. */ - buffer = grub_script_malloc (parsestate, 2048); - if (! buffer) - return 0; - - bp = buffer; - /* Read one token, possible quoted. */ while (*state->script) { @@ -295,32 +297,47 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) } if (breakout) break; - if (use) - *(bp++) = use; } - else if (use) - *(bp++) = use; + + if (use) + { + if (bufsize <= bufpos + 1) + { + bufsize <<= 1; + buffer = grub_realloc (buffer, bufsize); + } + buffer[bufpos++] = use; + } state->state = newstate; nextchar (state); } /* A string of text was read in. */ - *bp = '\0'; + if (bufsize <= bufpos + 1) + { + bufsize <<= 1; + buffer = grub_realloc (buffer, bufsize); + } + + buffer[bufpos++] = 0; + grub_dprintf ("scripting", "token=`%s'\n", buffer); yylval->arg = grub_script_arg_add (parsestate, yylval->arg, GRUB_SCRIPT_ARG_TYPE_STR, buffer); + grub_free (buffer); } else if (newstate == GRUB_PARSER_STATE_VAR || newstate == GRUB_PARSER_STATE_QVAR) { - /* XXX: Use a better size. */ - buffer = grub_script_malloc (parsestate, 2096); - if (! buffer) - return 0; + char *buffer = NULL; + int bufpos = 0; + /* Buffer is initially large enough to hold most commands + but extends automatically when needed. */ + int bufsize = 128; - bp = buffer; + buffer = grub_malloc (bufsize); /* This is a variable, read the variable name. */ while (*state->script) @@ -340,16 +357,33 @@ grub_script_yylex (union YYSTYPE *yylval, struct grub_parser_param *parsestate) } if (use) - *(bp++) = use; + { + if (bufsize <= bufpos + 1) + { + bufsize <<= 1; + buffer = grub_realloc (buffer, bufsize); + } + buffer[bufpos++] = use; + } + nextchar (state); state->state = newstate; } - *bp = '\0'; + if (bufsize <= bufpos + 1) + { + bufsize <<= 1; + buffer = grub_realloc (buffer, bufsize); + } + + buffer[bufpos++] = 0; + state->state = newstate; yylval->arg = grub_script_arg_add (parsestate, yylval->arg, GRUB_SCRIPT_ARG_TYPE_VAR, buffer); grub_dprintf ("scripting", "vartoken=`%s'\n", buffer); + + grub_free (buffer); } else { diff --git a/script/sh/script.c b/script/sh/script.c index cefafe605..c04a44966 100644 --- a/script/sh/script.c +++ b/script/sh/script.c @@ -110,10 +110,13 @@ grub_script_arg_add (struct grub_parser_param *state, struct grub_script_arg *ar { struct grub_script_arg *argpart; struct grub_script_arg *ll; + int len; argpart = (struct grub_script_arg *) grub_script_malloc (state, sizeof (*arg)); argpart->type = type; - argpart->str = str; + len = grub_strlen (str) + 1; + argpart->str = grub_script_malloc (state, len); + grub_memcpy (argpart->str, str, len); argpart->next = 0; if (! arg) From 70f1161d1319da9db44b2fa41bea3615a1ca5584 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 19:40:40 +0000 Subject: [PATCH 1064/1707] 2009-08-24 Vladimir Serbinenko Save space by inlining misc.c functions. * kern/misc.c (grub_iswordseparator): Made static. * kern/misc.c (grub_strcat): Moved from here ... * include/grub/misc.h (grub_strcat): ... here. Inlined. * kern/misc.c (grub_strncat): Moved from here ... * include/grub/misc.h (grub_strncat): ... here. Inlined. * kern/misc.c (grub_strcasecmp): Moved from here ... * include/grub/misc.h (grub_strcasecmp): ... here. Inlined. * kern/misc.c (grub_strncasecmp): Moved from here ... * include/grub/misc.h (grub_strncasecmp): ... here. Inlined. * kern/misc.c (grub_isalpha): Moved from here ... * include/grub/misc.h (grub_isalpha): ... here. Inlined. * kern/misc.c (grub_isdigit): Moved from here ... * include/grub/misc.h (grub_isdigit): ... here. Inlined. * kern/misc.c (grub_isgraph): Moved from here ... * include/grub/misc.h (grub_isgraph): ... here. Inlined. * kern/misc.c (grub_tolower): Moved from here ... * include/grub/misc.h (grub_tolower): ... here. Inlined. --- ChangeLog | 22 +++++++++ include/grub/misc.h | 108 ++++++++++++++++++++++++++++++++++++++++---- kern/misc.c | 108 +++----------------------------------------- 3 files changed, 127 insertions(+), 111 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8c30d971..f9c915016 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,25 @@ +2009-08-24 Vladimir Serbinenko + + Save space by inlining misc.c functions. + + * kern/misc.c (grub_iswordseparator): Made static. + * kern/misc.c (grub_strcat): Moved from here ... + * include/grub/misc.h (grub_strcat): ... here. Inlined. + * kern/misc.c (grub_strncat): Moved from here ... + * include/grub/misc.h (grub_strncat): ... here. Inlined. + * kern/misc.c (grub_strcasecmp): Moved from here ... + * include/grub/misc.h (grub_strcasecmp): ... here. Inlined. + * kern/misc.c (grub_strncasecmp): Moved from here ... + * include/grub/misc.h (grub_strncasecmp): ... here. Inlined. + * kern/misc.c (grub_isalpha): Moved from here ... + * include/grub/misc.h (grub_isalpha): ... here. Inlined. + * kern/misc.c (grub_isdigit): Moved from here ... + * include/grub/misc.h (grub_isdigit): ... here. Inlined. + * kern/misc.c (grub_isgraph): Moved from here ... + * include/grub/misc.h (grub_isgraph): ... here. Inlined. + * kern/misc.c (grub_tolower): Moved from here ... + * include/grub/misc.h (grub_tolower): ... here. Inlined. + 2009-08-24 Vladimir Serbinenko * script/sh/function.c (grub_script_function_find): Cut error message diff --git a/include/grub/misc.h b/include/grub/misc.h index 769ec5cd8..a63a0b442 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -37,8 +37,42 @@ void *EXPORT_FUNC(grub_memmove) (void *dest, const void *src, grub_size_t n); char *EXPORT_FUNC(grub_strcpy) (char *dest, const char *src); char *EXPORT_FUNC(grub_strncpy) (char *dest, const char *src, int c); char *EXPORT_FUNC(grub_stpcpy) (char *dest, const char *src); -char *EXPORT_FUNC(grub_strcat) (char *dest, const char *src); -char *EXPORT_FUNC(grub_strncat) (char *dest, const char *src, int c); + +static inline char * +grub_strcat (char *dest, const char *src) +{ + char *p = dest; + + while (*p) + p++; + + while ((*p = *src) != '\0') + { + p++; + src++; + } + + return dest; +} + +static inline char * +grub_strncat (char *dest, const char *src, int c) +{ + char *p = dest; + + while (*p) + p++; + + while ((*p = *src) != '\0' && c--) + { + p++; + src++; + } + + *p = '\0'; + + return dest; +} /* Prototypes for aliases. */ #if !defined (GRUB_UTIL) || !defined (APPLE_CC) @@ -49,19 +83,41 @@ void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); int EXPORT_FUNC(grub_strcmp) (const char *s1, const char *s2); int EXPORT_FUNC(grub_strncmp) (const char *s1, const char *s2, grub_size_t n); -int EXPORT_FUNC(grub_strcasecmp) (const char *s1, const char *s2); -int EXPORT_FUNC(grub_strncasecmp) (const char *s1, const char *s2, grub_size_t n); + char *EXPORT_FUNC(grub_strchr) (const char *s, int c); char *EXPORT_FUNC(grub_strrchr) (const char *s, int c); int EXPORT_FUNC(grub_strword) (const char *s, const char *w); char *EXPORT_FUNC(grub_strstr) (const char *haystack, const char *needle); -int EXPORT_FUNC(grub_iswordseparator) (int c); int EXPORT_FUNC(grub_isspace) (int c); int EXPORT_FUNC(grub_isprint) (int c); -int EXPORT_FUNC(grub_isalpha) (int c); -int EXPORT_FUNC(grub_isgraph) (int c); -int EXPORT_FUNC(grub_isdigit) (int c); -int EXPORT_FUNC(grub_tolower) (int c); + +static inline int +grub_isalpha (int c) +{ + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); +} + +static inline int +grub_isgraph (int c) +{ + return (c >= '!' && c <= '~'); +} + +static inline int +grub_isdigit (int c) +{ + return (c >= '0' && c <= '9'); +} + +static inline int +grub_tolower (int c) +{ + if (c >= 'A' && c <= 'Z') + return c - 'A' + 'a'; + + return c; +} + static inline int grub_toupper (int c) { @@ -71,6 +127,40 @@ grub_toupper (int c) return c; } +static inline int +grub_strcasecmp (const char *s1, const char *s2) +{ + while (*s1 && *s2) + { + if (grub_tolower (*s1) != grub_tolower (*s2)) + break; + + s1++; + s2++; + } + + return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); +} + +static inline int +grub_strncasecmp (const char *s1, const char *s2, grub_size_t n) +{ + if (n == 0) + return 0; + + while (*s1 && *s2 && --n) + { + if (grub_tolower (*s1) != grub_tolower (*s2)) + break; + + s1++; + s2++; + } + + return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); +} + + unsigned long EXPORT_FUNC(grub_strtoul) (const char *str, char **end, int base); unsigned long long EXPORT_FUNC(grub_strtoull) (const char *str, char **end, int base); char *EXPORT_FUNC(grub_strdup) (const char *s); diff --git a/kern/misc.c b/kern/misc.c index d797f1781..1c38fe661 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -24,6 +24,12 @@ #include #include +static int +grub_iswordseparator (int c) +{ + return (grub_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&'); +} + void * grub_memmove (void *dest, const void *src, grub_size_t n) { @@ -97,42 +103,6 @@ grub_stpcpy (char *dest, const char *src) return d - 1; } -char * -grub_strcat (char *dest, const char *src) -{ - char *p = dest; - - while (*p) - p++; - - while ((*p = *src) != '\0') - { - p++; - src++; - } - - return dest; -} - -char * -grub_strncat (char *dest, const char *src, int c) -{ - char *p = dest; - - while (*p) - p++; - - while ((*p = *src) != '\0' && c--) - { - p++; - src++; - } - - *p = '\0'; - - return dest; -} - int grub_printf (const char *fmt, ...) { @@ -250,39 +220,6 @@ grub_strncmp (const char *s1, const char *s2, grub_size_t n) return (int) *s1 - (int) *s2; } -int -grub_strcasecmp (const char *s1, const char *s2) -{ - while (*s1 && *s2) - { - if (grub_tolower (*s1) != grub_tolower (*s2)) - break; - - s1++; - s2++; - } - - return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); -} - -int -grub_strncasecmp (const char *s1, const char *s2, grub_size_t n) -{ - if (n == 0) - return 0; - - while (*s1 && *s2 && --n) - { - if (grub_tolower (*s1) != grub_tolower (*s2)) - break; - - s1++; - s2++; - } - - return (int) grub_tolower (*s1) - (int) grub_tolower (*s2); -} - char * grub_strchr (const char *s, int c) { @@ -394,12 +331,6 @@ grub_strword (const char *haystack, const char *needle) return 0; } -int -grub_iswordseparator (int c) -{ - return (grub_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&'); -} - int grub_isspace (int c) { @@ -412,33 +343,6 @@ grub_isprint (int c) return (c >= ' ' && c <= '~'); } -int -grub_isalpha (int c) -{ - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z'); -} - -int -grub_isdigit (int c) -{ - return (c >= '0' && c <= '9'); -} - -int -grub_isgraph (int c) -{ - return (c >= '!' && c <= '~'); -} - -int -grub_tolower (int c) -{ - if (c >= 'A' && c <= 'Z') - return c - 'A' + 'a'; - - return c; -} - unsigned long grub_strtoul (const char *str, char **end, int base) From e7e1f93ff62b0ecaaddad9d63649a4ab76591810 Mon Sep 17 00:00:00 2001 From: phcoder Date: Mon, 24 Aug 2009 23:55:06 +0000 Subject: [PATCH 1065/1707] 2009-08-25 Vladimir Serbinenko Authentication support. * commands/password.c: New file. * conf/common.rmk (pkglib_MODULES): Add password.mod. (password_mod_SOURCES): New variable. (password_mod_CFLAGS): Likewise. (password_mod_LDFLAGS): Likewise. (normal_mod_SOURCES): Add normal/auth.c. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add commands/password.c and normal/auth.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * include/grub/auth.h: New file. * include/grub/err.h (grub_err_t): New enum value GRUB_ERR_ACCESS_DENIED. * include/grub/menu.h (grub_menu_entry): New fields 'restricted' and 'users'. * include/grub/normal.h (grub_cmdline_get): New argument 'history'. * normal/cmdline.c (grub_cmdline_get): New argument 'history'. All users updated. * normal/auth.c: New file. * normal/main.c (grub_normal_add_menu_entry): Handle --users option. (grub_cmdline_run): Don't allow to go to command line without authentication. * normal/menu.c (grub_menu_execute_entry): Handle restricted entries. * normal/menu_entry.c (grub_menu_entry_run): Don't allow editing menuentry without superuser rights. * normal/menu_viewer.c (grub_menu_viewer_show_menu): Don't exit if user isn't a superuser. --- ChangeLog | 36 ++++++ commands/password.c | 86 +++++++++++++ conf/common.rmk | 9 +- conf/i386-coreboot.rmk | 3 +- conf/i386-efi.rmk | 3 +- conf/i386-ieee1275.rmk | 3 +- conf/i386-pc.rmk | 3 +- conf/powerpc-ieee1275.rmk | 3 +- conf/sparc64-ieee1275.rmk | 3 +- conf/x86_64-efi.rmk | 4 +- include/grub/auth.h | 45 +++++++ include/grub/err.h | 3 +- include/grub/menu.h | 6 + include/grub/normal.h | 2 +- normal/auth.c | 250 ++++++++++++++++++++++++++++++++++++++ normal/cmdline.c | 15 ++- normal/main.c | 33 ++++- normal/menu.c | 13 ++ normal/menu_entry.c | 11 ++ normal/menu_viewer.c | 20 ++- 20 files changed, 531 insertions(+), 20 deletions(-) create mode 100644 commands/password.c create mode 100644 include/grub/auth.h create mode 100644 normal/auth.c diff --git a/ChangeLog b/ChangeLog index f9c915016..34694a4ea 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,39 @@ +2009-08-25 Vladimir Serbinenko + + Authentication support. + + * commands/password.c: New file. + * conf/common.rmk (pkglib_MODULES): Add password.mod. + (password_mod_SOURCES): New variable. + (password_mod_CFLAGS): Likewise. + (password_mod_LDFLAGS): Likewise. + (normal_mod_SOURCES): Add normal/auth.c. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add commands/password.c and + normal/auth.c. + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * include/grub/auth.h: New file. + * include/grub/err.h (grub_err_t): New enum value + GRUB_ERR_ACCESS_DENIED. + * include/grub/menu.h (grub_menu_entry): New fields 'restricted' and + 'users'. + * include/grub/normal.h (grub_cmdline_get): New argument 'history'. + * normal/cmdline.c (grub_cmdline_get): New argument 'history'. All + users updated. + * normal/auth.c: New file. + * normal/main.c (grub_normal_add_menu_entry): Handle --users option. + (grub_cmdline_run): Don't allow to go to command line without + authentication. + * normal/menu.c (grub_menu_execute_entry): Handle restricted entries. + * normal/menu_entry.c (grub_menu_entry_run): Don't allow editing + menuentry without superuser rights. + * normal/menu_viewer.c (grub_menu_viewer_show_menu): Don't exit if + user isn't a superuser. + 2009-08-24 Vladimir Serbinenko Save space by inlining misc.c functions. diff --git a/commands/password.c b/commands/password.c new file mode 100644 index 000000000..0e048797e --- /dev/null +++ b/commands/password.c @@ -0,0 +1,86 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include +#include + +static grub_dl_t my_mod; + +static grub_err_t +check_password (const char *user, + void *password) +{ + char entered[1024]; + + grub_memset (entered, 0, sizeof (entered)); + + if (!GRUB_GET_PASSWORD (entered, sizeof (entered) - 1)) + return GRUB_ACCESS_DENIED; + + if (grub_auth_strcmp (entered, password) != 0) + return GRUB_ACCESS_DENIED; + + grub_auth_authenticate (user); + + return GRUB_ERR_NONE; +} + +static grub_err_t +grub_cmd_password (grub_command_t cmd __attribute__ ((unused)), + int argc, char **args) +{ + grub_err_t err; + char *pass; + + if (argc != 2) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "Two arguments expected."); + + pass = grub_strdup (args[1]); + if (!pass) + return grub_errno; + + err = grub_auth_register_authentication (args[0], check_password, pass); + if (err) + { + grub_free (pass); + return err; + } + grub_dl_ref (my_mod); + return GRUB_ERR_NONE; +} + +static grub_command_t cmd; + +GRUB_MOD_INIT(password) +{ + my_mod = mod; + cmd = grub_register_command ("password", grub_cmd_password, + "password USER PASSWORD", + "Set user password (plaintext). " + "Unrecommended and insecure."); +} + +GRUB_MOD_FINI(password) +{ + grub_unregister_command (cmd); +} diff --git a/conf/common.rmk b/conf/common.rmk index c33e8000a..6d767460b 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -363,7 +363,12 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ msdospart.mod memrw.mod normal.mod sh.mod lua.mod \ - gptsync.mod true.mod probe.mod + gptsync.mod true.mod probe.mod password.mod + +# For password.mod. +password_mod_SOURCES = commands/password.c +password_mod_CFLAGS = $(COMMON_CFLAGS) +password_mod_LDFLAGS = $(COMMON_LDFLAGS) # For gptsync.mod. gptsync_mod_SOURCES = commands/gptsync.c @@ -507,7 +512,7 @@ probe_mod_LDFLAGS = $(COMMON_LDFLAGS) # For normal.mod. normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \ - normal/autofs.c normal/handler.c \ + normal/auth.c normal/autofs.c normal/handler.c \ normal/color.c normal/completion.c normal/datetime.c normal/menu.c \ normal/menu_entry.c normal/menu_text.c normal/menu_viewer.c \ normal/misc.c diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index de3004140..7e9f853d7 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -110,6 +110,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ + commands/password.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ @@ -127,7 +128,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/partition.c kern/reader.c kern/term.c \ kern/rescue_reader.c kern/rescue_parser.c \ lib/arg.c normal/cmdline.c normal/misc.c \ - normal/handler.c normal/autofs.c \ + normal/handler.c normal/auth.c normal/autofs.c \ normal/completion.c normal/datetime.c normal/main.c \ normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 372d8fc58..f1e5e8fe3 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -39,6 +39,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ + commands/password.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ @@ -54,7 +55,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/partition.c kern/reader.c kern/term.c \ kern/rescue_reader.c kern/rescue_parser.c \ lib/arg.c normal/cmdline.c normal/command.c normal/datetime.c \ - normal/autofs.c \ + normal/auth.c normal/autofs.c \ normal/completion.c normal/context.c normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 98aaf5849..67234ebb6 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -66,6 +66,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ + commands/password.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -82,7 +83,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/partition.c kern/reader.c kern/term.c \ kern/rescue_reader.c kern/rescue_parser.c \ lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \ - normal/handler.c normal/autofs.c \ + normal/handler.c normal/auth.c normal/autofs.c \ normal/completion.c normal/main.c normal/menu_text.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/color.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 13aaa2618..6b177963e 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -123,6 +123,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ + commands/password.c \ disk/host.c disk/loopback.c disk/scsi.c \ fs/fshelp.c \ \ @@ -134,7 +135,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/partition.c kern/reader.c kern/term.c \ kern/rescue_reader.c kern/rescue_parser.c \ lib/arg.c normal/cmdline.c normal/datetime.c normal/misc.c \ - normal/handler.c normal/autofs.c \ + normal/handler.c normal/auth.c normal/autofs.c \ normal/completion.c normal/main.c normal/color.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ normal/menu_text.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index c1c04e484..c9b7e7592 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -46,6 +46,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ + commands/password.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -62,7 +63,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ lib/arg.c normal/cmdline.c normal/datetime.c \ normal/completion.c normal/misc.c \ - normal/handler.c normal/autofs.c normal/main.c \ + normal/handler.c normal/auth.c normal/autofs.c normal/main.c \ normal/menu.c \ normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index c3ecba28f..621621399 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -103,6 +103,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ + commands/password.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -119,7 +120,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/command.c kern/corecmd.c commands/extcmd.c \ lib/arg.c normal/cmdline.c normal/datetime.c \ normal/completion.c normal/misc.c \ - normal/handler.c normal/autofs.c normal/main.c \ + normal/handler.c normal/auth.c normal/autofs.c normal/main.c \ normal/menu.c \ normal/menu_text.c \ normal/menu_entry.c normal/menu_viewer.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index c914fbf19..b4c08b093 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -37,6 +37,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ + commands/password.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ @@ -50,7 +51,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ kern/command.c kern/corecmd.c commands/extcmd.c kern/file.c \ kern/fs.c commands/boot.c kern/main.c kern/misc.c kern/parser.c \ kern/partition.c kern/readerescue.c kern/term.c \ - lib/arg.c normal/cmdline.c normal/misc.c normal/autofs.c \ + lib/arg.c normal/cmdline.c normal/misc.c normal/auth.c \ + normal/autofs.c \ normal/completion.c normal/datetime.c normal/context.c \ normal/main.c \ normal/menu.c normal/menu_entry.c normal/menu_viewer.c \ diff --git a/include/grub/auth.h b/include/grub/auth.h new file mode 100644 index 000000000..da930eeda --- /dev/null +++ b/include/grub/auth.h @@ -0,0 +1,45 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ +#ifndef GRUB_AURH_HEADER +#define GRUB_AUTH_HEADER 1 + +#include + +/* Macros for indistinguishibility. */ +#define GRUB_ACCESS_DENIED grub_error (GRUB_ERR_ACCESS_DENIED, "Access denied.") +#define GRUB_GET_PASSWORD(string, len) grub_cmdline_get ("Enter password: ", \ + string, len, \ + '*', 0, 0) + +/* Like strcmp but untimeable. Accepts NULL as second argument. */ +int grub_auth_strcmp (const char *user_input, const char *template); +/* Like strcmp but untimeable and ignores commas in needle. */ +int grub_auth_strword (const char *haystack, const char *needle); + +typedef grub_err_t (*grub_auth_callback_t) (const char*, void *); + +grub_err_t grub_auth_register_authentication (const char *user, + grub_auth_callback_t callback, + void *arg); +grub_err_t grub_auth_unregister_authentication (const char *user); + +grub_err_t grub_auth_authenticate (const char *user); +grub_err_t grub_auth_deauthenticate (const char *user); +grub_err_t grub_auth_check_authentication (const char *userlist); + +#endif /* ! GRUB_AUTH_HEADER */ diff --git a/include/grub/err.h b/include/grub/err.h index 3435fb769..7a5ce1ae0 100644 --- a/include/grub/err.h +++ b/include/grub/err.h @@ -53,7 +53,8 @@ typedef enum GRUB_ERR_BAD_GZIP_DATA, GRUB_ERR_MENU, GRUB_ERR_TIMEOUT, - GRUB_ERR_IO + GRUB_ERR_IO, + GRUB_ERR_ACCESS_DENIED } grub_err_t; diff --git a/include/grub/menu.h b/include/grub/menu.h index 3bd25e875..c7114a93b 100644 --- a/include/grub/menu.h +++ b/include/grub/menu.h @@ -32,6 +32,12 @@ struct grub_menu_entry /* The title name. */ const char *title; + /* If set means not everybody is allowed to boot this entry. */ + int restricted; + + /* Allowed users. */ + const char *users; + /* The classes associated with the menu entry: used to choose an icon or other style attributes. This is a dummy head node for the linked list, so for an entry E, diff --git a/include/grub/normal.h b/include/grub/normal.h index 7d8122a2b..feebc85b1 100644 --- a/include/grub/normal.h +++ b/include/grub/normal.h @@ -56,7 +56,7 @@ void grub_cmdline_run (int nested); /* Defined in `cmdline.c'. */ int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, - int echo_char, int readline); + int echo_char, int readline, int history); grub_err_t grub_set_history (int newsize); /* Defined in `completion.c'. */ diff --git a/normal/auth.c b/normal/auth.c new file mode 100644 index 000000000..1dc61e898 --- /dev/null +++ b/normal/auth.c @@ -0,0 +1,250 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include +#include +#include + +struct grub_auth_user +{ + struct grub_auth_user *next; + char *name; + grub_auth_callback_t callback; + void *arg; + int authenticated; +}; + +struct grub_auth_user *users = NULL; + +int +grub_auth_strcmp (const char *user_input, const char *template) +{ + int ok = 1; + const char *ptr1, *ptr2; + for (ptr1 = user_input, ptr2 = template; *ptr1; ptr1++) + if (*ptr1 == (ptr2 ? *ptr2 : ptr1[1]) && ok && ptr2 != NULL) + ptr2++; + else + ok = 0; + + return !ok; +} + +int +grub_auth_strword (const char *haystack, const char *needle) +{ + const char *n_pos = needle; + int found = 0; + + while (grub_iswordseparator (*haystack)) + haystack++; + + while (*haystack) + { + int ok = 1; + /* Crawl both the needle and the haystack word we're on. */ + while(*haystack && !grub_iswordseparator (*haystack)) + { + if (*haystack == *n_pos && ok) + n_pos++; + else + ok = 0; + + haystack++; + } + + if (ok) + found = 1; + } + + return found; +} + +grub_err_t +grub_auth_register_authentication (const char *user, + grub_auth_callback_t callback, + void *arg) +{ + struct grub_auth_user *cur; + + cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + if (!cur) + cur = grub_zalloc (sizeof (*cur)); + if (!cur) + return grub_errno; + cur->callback = callback; + cur->arg = arg; + if (! cur->name) + { + cur->name = grub_strdup (user); + if (!cur->name) + { + grub_free (cur); + return grub_errno; + } + grub_list_push (GRUB_AS_LIST_P (&users), GRUB_AS_LIST (cur)); + } + return GRUB_ERR_NONE; +} + +grub_err_t +grub_auth_unregister_authentication (const char *user) +{ + struct grub_auth_user *cur; + cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + if (!cur) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "user '%s' not found", user); + if (!cur->authenticated) + { + grub_free (cur->name); + grub_list_remove (GRUB_AS_LIST_P (&users), GRUB_AS_LIST (cur)); + grub_free (cur); + } + else + { + cur->callback = NULL; + cur->arg = NULL; + } + return GRUB_ERR_NONE; +} + +grub_err_t +grub_auth_authenticate (const char *user) +{ + struct grub_auth_user *cur; + + cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + if (!cur) + cur = grub_zalloc (sizeof (*cur)); + if (!cur) + return grub_errno; + + cur->authenticated = 1; + + if (! cur->name) + { + cur->name = grub_strdup (user); + if (!cur->name) + { + grub_free (cur); + return grub_errno; + } + grub_list_push (GRUB_AS_LIST_P (&users), GRUB_AS_LIST (cur)); + } + + return GRUB_ERR_NONE; +} + +grub_err_t +grub_auth_deauthenticate (const char *user) +{ + struct grub_auth_user *cur; + cur = grub_named_list_find (GRUB_AS_NAMED_LIST (users), user); + if (!cur) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "user '%s' not found", user); + if (!cur->callback) + { + grub_free (cur->name); + grub_list_remove (GRUB_AS_LIST_P (&users), GRUB_AS_LIST (cur)); + grub_free (cur); + } + else + cur->authenticated = 0; + return GRUB_ERR_NONE; +} + +static int +is_authenticated (const char *userlist) +{ + const char *superusers; + + auto int hook (grub_list_t item); + int hook (grub_list_t item) + { + const char *name; + if (!((struct grub_auth_user *) item)->authenticated) + return 0; + name = ((struct grub_auth_user *) item)->name; + + return (userlist && grub_auth_strword (userlist, name)) + || grub_auth_strword (superusers, name); + } + + superusers = grub_env_get ("superusers"); + + if (!superusers) + return 1; + + return grub_list_iterate (GRUB_AS_LIST (users), hook); +} + +grub_err_t +grub_auth_check_authentication (const char *userlist) +{ + char login[1024]; + struct grub_auth_user *cur = NULL; + grub_err_t err; + + auto int hook (grub_list_t item); + int hook (grub_list_t item) + { + if (grub_auth_strcmp (login, ((struct grub_auth_user *) item)->name) == 0) + cur = (struct grub_auth_user *) item; + return 0; + } + + auto int hook_any (grub_list_t item); + int hook_any (grub_list_t item) + { + if (((struct grub_auth_user *) item)->callback) + cur = (struct grub_auth_user *) item; + return 0; + } + + grub_memset (login, 0, sizeof (login)); + + if (is_authenticated (userlist)) + return GRUB_ERR_NONE; + + if (!grub_cmdline_get ("Enter username: ", login, sizeof (login) - 1, + 0, 0, 0)) + return GRUB_ACCESS_DENIED; + + grub_list_iterate (GRUB_AS_LIST (users), hook); + + if (!cur || ! cur->callback) + { + grub_list_iterate (GRUB_AS_LIST (users), hook_any); + + /* No users present at all. */ + if (!cur) + return GRUB_ACCESS_DENIED; + + /* Display any of available authentication schemes. */ + err = cur->callback (login, 0); + + return GRUB_ACCESS_DENIED; + } + err = cur->callback (login, cur->arg); + if (is_authenticated (userlist)) + return GRUB_ERR_NONE; + return GRUB_ACCESS_DENIED; +} diff --git a/normal/cmdline.c b/normal/cmdline.c index 9a07d7d59..56f892121 100644 --- a/normal/cmdline.c +++ b/normal/cmdline.c @@ -181,7 +181,7 @@ print_completion (const char *item, grub_completion_type_t type, int count) /* FIXME: The dumb interface is not supported yet. */ int grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, - int echo_char, int readline) + int echo_char, int readline, int history) { unsigned xpos, ypos, ystart; grub_size_t lpos, llen; @@ -280,7 +280,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, cl_insert (cmdline); - if (hist_used == 0) + if (history && hist_used == 0) grub_history_add (buf); while ((key = GRUB_TERM_ASCII_CHAR (grub_getkey ())) != '\n' && key != '\r') @@ -468,11 +468,14 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, while (buf[lpos] == ' ') lpos++; - histpos = 0; - if (grub_strlen (buf) > 0) + if (history) { - grub_history_replace (histpos, buf); - grub_history_add (""); + histpos = 0; + if (grub_strlen (buf) > 0) + { + grub_history_replace (histpos, buf); + grub_history_add (""); + } } grub_memcpy (cmdline, buf + lpos, llen - lpos + 1); diff --git a/normal/main.c b/normal/main.c index 66d841867..748eef805 100644 --- a/normal/main.c +++ b/normal/main.c @@ -28,6 +28,7 @@ #include #include #include +#include #define GRUB_DEFAULT_HISTORY_SIZE 50 @@ -164,6 +165,7 @@ grub_normal_add_menu_entry (int argc, const char **args, int i; struct grub_menu_entry_class *classes_head; /* Dummy head node for list. */ struct grub_menu_entry_class *classes_tail; + char *users = NULL; /* Allocate dummy head node for class list. */ classes_head = grub_zalloc (sizeof (struct grub_menu_entry_class)); @@ -218,6 +220,18 @@ grub_normal_add_menu_entry (int argc, const char **args, classes_tail = new_class; continue; } + else if (grub_strcmp(arg, "users") == 0) + { + i++; + users = grub_strdup (args[i]); + if (! users) + { + failed = 1; + break; + } + + continue; + } else { /* Handle invalid argument. */ @@ -275,6 +289,9 @@ grub_normal_add_menu_entry (int argc, const char **args, (*last)->title = menutitle; (*last)->classes = classes_head; + if (users) + (*last)->restricted = 1; + (*last)->users = users; (*last)->sourcecode = menusourcecode; menu->size++; @@ -465,7 +482,19 @@ quit: void grub_cmdline_run (int nested) { - grub_reader_t reader = grub_reader_get_current (); + grub_reader_t reader; + grub_err_t err = GRUB_ERR_NONE; + + err = grub_auth_check_authentication (NULL); + + if (err) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + return; + } + + reader = grub_reader_get_current (); reader_nested = nested; if (reader->init) @@ -501,7 +530,7 @@ grub_normal_read_line (char **line, int cont) while (1) { cmdline[0] = 0; - if (grub_cmdline_get (prompt, cmdline, sizeof (cmdline), 0, 1)) + if (grub_cmdline_get (prompt, cmdline, sizeof (cmdline), 0, 1, 1)) break; if ((reader_nested) || (cont)) diff --git a/normal/menu.c b/normal/menu.c index 59ad83fa7..8ee7d1c22 100644 --- a/normal/menu.c +++ b/normal/menu.c @@ -26,6 +26,7 @@ #include #include #include +#include /* Get a menu entry by its index in the entry list. */ grub_menu_entry_t @@ -124,6 +125,18 @@ get_and_remove_first_entry_number (const char *name) void grub_menu_execute_entry(grub_menu_entry_t entry) { + grub_err_t err = GRUB_ERR_NONE; + + if (entry->restricted) + err = grub_auth_check_authentication (entry->users); + + if (err) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + return; + } + grub_parser_execute ((char *) entry->sourcecode); if (grub_errno == GRUB_ERR_NONE && grub_loader_is_loaded ()) diff --git a/normal/menu_entry.c b/normal/menu_entry.c index f7662ff75..75a63779f 100644 --- a/normal/menu_entry.c +++ b/normal/menu_entry.c @@ -23,6 +23,7 @@ #include #include #include +#include enum update_mode { @@ -1026,6 +1027,16 @@ grub_menu_entry_run (grub_menu_entry_t entry) { struct screen *screen; int prev_c; + grub_err_t err = GRUB_ERR_NONE; + + err = grub_auth_check_authentication (NULL); + + if (err) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + return; + } screen = make_screen (entry); if (! screen) diff --git a/normal/menu_viewer.c b/normal/menu_viewer.c index 37d317b0b..1bd271a21 100644 --- a/normal/menu_viewer.c +++ b/normal/menu_viewer.c @@ -21,6 +21,7 @@ #include #include #include +#include /* The list of menu viewers. */ static grub_menu_viewer_t menu_viewer_list; @@ -55,9 +56,26 @@ grub_err_t grub_menu_viewer_show_menu (grub_menu_t menu, int nested) { grub_menu_viewer_t cur = get_current_menu_viewer (); + grub_err_t err1, err2; if (!cur) return grub_error (GRUB_ERR_BAD_ARGUMENT, "No menu viewer available."); - return cur->show_menu (menu, nested); + while (1) + { + err1 = cur->show_menu (menu, nested); + grub_print_error (); + + err2 = grub_auth_check_authentication (NULL); + if (err2) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + continue; + } + + break; + } + + return err1; } From ff747d50c1fcf81e0226d2da1923b1b8113f2b93 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 25 Aug 2009 08:11:50 +0000 Subject: [PATCH 1066/1707] 2009-08-25 Vladimir Serbinenko Fix breakage in normal/auth.c. * normal/auth.c (grub_iswordseparator): New function. --- ChangeLog | 6 ++++++ normal/auth.c | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 34694a4ea..4f8c068dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-08-25 Vladimir Serbinenko + + Fix breakage in normal/auth.c. + + * normal/auth.c (grub_iswordseparator): New function. + 2009-08-25 Vladimir Serbinenko Authentication support. diff --git a/normal/auth.c b/normal/auth.c index 1dc61e898..9029ba1ce 100644 --- a/normal/auth.c +++ b/normal/auth.c @@ -48,6 +48,12 @@ grub_auth_strcmp (const char *user_input, const char *template) return !ok; } +static int +grub_iswordseparator (int c) +{ + return (grub_isspace (c) || c == ',' || c == ';' || c == '|' || c == '&'); +} + int grub_auth_strword (const char *haystack, const char *needle) { From aea664ea288daf09569c9eed2ac7932fd7b1f1af Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 25 Aug 2009 08:28:13 +0000 Subject: [PATCH 1067/1707] 2009-08-25 Vladimir Serbinenko Fix breakage in grub-setup. * util/i386/pc/grub-setup.c (setup): Use "part_msdos" instead of "msdos_partition_map". --- ChangeLog | 7 +++++++ util/i386/pc/grub-setup.c | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4f8c068dd..d30cfd137 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-25 Vladimir Serbinenko + + Fix breakage in grub-setup. + + * util/i386/pc/grub-setup.c (setup): Use "part_msdos" instead of + "msdos_partition_map". + 2009-08-25 Vladimir Serbinenko Fix breakage in normal/auth.c. diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 7f38c4293..ccfbd1d25 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -338,12 +338,12 @@ setup (const char *dir, goto unable_to_embed; } - grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "msdos_partition_map") ? + grub_partition_iterate (dest_dev->disk, (strcmp (dest_partmap, "part_msdos") ? find_usable_region_gpt : find_usable_region_msdos)); if (embed_region.end == embed_region.start) { - if (! strcmp (dest_partmap, "msdos_partition_map")) + if (! strcmp (dest_partmap, "part_msdos")) grub_util_warn ("This msdos-style partition label has no post-MBR gap; embedding won't be possible!"); else grub_util_warn ("This GPT partition label has no BIOS Boot Partition; embedding won't be possible!"); From 3b76e68ba7f132656cd5841acf9c7171c1791b1c Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 25 Aug 2009 19:42:56 +0000 Subject: [PATCH 1068/1707] 2009-08-25 Felix Zielcke * util/grub.d/00_header.in: Move check for the video backend of gfxterm from here ... * util/grub-mkconfig.in: ... to here. Enable gfxterm if there's a suitable video backend. --- ChangeLog | 7 +++++++ util/grub-mkconfig.in | 22 ++++++++++++++++++++-- util/grub.d/00_header.in | 14 +------------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/ChangeLog b/ChangeLog index d30cfd137..2236b61aa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-25 Felix Zielcke + + * util/grub.d/00_header.in: Move check for the video backend of + gfxterm from here ... + * util/grub-mkconfig.in: ... to here. Enable gfxterm if there's + a suitable video backend. + 2009-08-25 Vladimir Serbinenko Fix breakage in grub-setup. diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index 8e3c3372b..d9640e910 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -141,7 +141,24 @@ if [ "x${GRUB_TERMINAL}" != "x" ] ; then fi case x${GRUB_TERMINAL_OUTPUT} in - x | xconsole | xserial | xofconsole | xgfxterm) ;; + x | xgfxterm) + # If this platform supports gfxterm, try to use it. + if test -e ${grub_prefix}/gfxterm.mod ; then + GRUB_VIDEO_BACKEND= + for i in vbe ; do + if test -e ${grub_prefix}/$i.mod ; then + GRUB_VIDEO_BACKEND=$i + break + fi + done + if [ -n "${GRUB_VIDEO_BACKEND}" ] ; then + GRUB_TERMINAL_OUTPUT=gfxterm + elif [ "${GRUB_TERMINAL_OUTPUT}" = "gfxterm" ] ; then + echo "No suitable backend could be found for gfxterm." >&2 ; exit 1 + fi + fi + ;; + xconsole | xserial | xofconsole) ;; *) echo "Invalid output terminal \"${GRUB_TERMINAL_OUTPUT}\"" >&2 ; exit 1 ;; esac @@ -190,7 +207,8 @@ export GRUB_DEVICE \ GRUB_DEVICE_BOOT_UUID \ GRUB_FS \ GRUB_FONT_PATH \ - GRUB_PRELOAD_MODULES + GRUB_PRELOAD_MODULES \ + GRUB_VIDEO_BACKEND # These are optional, user-defined variables. export GRUB_DEFAULT \ diff --git a/util/grub.d/00_header.in b/util/grub.d/00_header.in index 98c7c004b..9f421dc1c 100644 --- a/util/grub.d/00_header.in +++ b/util/grub.d/00_header.in @@ -73,23 +73,11 @@ case x${GRUB_TERMINAL_OUTPUT} in # Make the font accessible prepare_grub_to_access_device `${grub_probe} --target=device ${GRUB_FONT_PATH}` - # Pick a video backend - video_backend= - for i in vbe ; do - if test -e ${grub_prefix}/$i.mod ; then - video_backend=$i - break - fi - done - if ! [ "${video_backend}" ] ; then - echo "No suitable backend could be found for gfxterm." >&2 ; exit 1 - fi - cat << EOF if loadfont `make_system_path_relative_to_its_root ${GRUB_FONT_PATH}` ; then set gfxmode=${GRUB_GFXMODE} insmod gfxterm - insmod ${video_backend} + insmod ${GRUB_VIDEO_BACKEND} if terminal_output gfxterm ; then true ; else # For backward compatibility with versions of terminal.mod that don't # understand terminal_output From beefc59841349272faab093d1a1d3d99130bcd64 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 25 Aug 2009 19:57:18 +0000 Subject: [PATCH 1069/1707] 2009-08-25 Vladimir Serbinenko Cleanup NetBSD root support. * loader/i386/bsd.c (grub_netbsd_boot): Remove call to grub_bsd_get_device. Fix typo. --- ChangeLog | 8 ++++++++ loader/i386/bsd.c | 5 +---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2236b61aa..1de68adf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-25 Vladimir Serbinenko + + Cleanup NetBSD root support. + + * loader/i386/bsd.c (grub_netbsd_boot): Remove call to + grub_bsd_get_device. + Fix typo. + 2009-08-25 Felix Zielcke * util/grub.d/00_header.in: Move check for the video backend of diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 1b6f1902b..0b9a2b471 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -626,14 +626,11 @@ static grub_err_t grub_netbsd_boot (void) { struct grub_netbsd_bootinfo *bootinfo; - grub_uint32_t biosdev, unit, slice, part; - - grub_bsd_get_device (&biosdev, &unit, &slice, &part); if (kern_end + sizeof (struct grub_netbsd_btinfo_rootdevice) + sizeof (struct grub_netbsd_bootinfo) > grub_os_area_addr + grub_os_area_size) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "No memory fo boot info."); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, "No memory for boot info."); if (netbsd_root) { From 1ae2078cd86989d79754d19557b54f9cd9a98350 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 25 Aug 2009 23:18:48 +0000 Subject: [PATCH 1070/1707] 2009-08-25 Vladimir Serbinenko Enable bsd.mod on coreboot. * conf/i386-coreboot.rmk (pkglib_MODULES): Add bsd.mod. (bsd_mod_SOURCES): New variable. (bsd_mod_CFLAGS): Likewise. (bsd_mod_LDFLAGS): Likewise. (bsd_mod_ASFLAGS): Likewise. * loader/i386/bsd.c [!GRUB_MACHINE_PCBIOS]: Fix includes. (grub_bsd_get_device) [!GRUB_MACHINE_PCBIOS]: Set *biosdev to 0xff. --- ChangeLog | 12 ++++++++++++ conf/i386-coreboot.rmk | 7 +++++++ loader/i386/bsd.c | 6 +++++- 3 files changed, 24 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1de68adf1..e5d7ba088 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-08-25 Vladimir Serbinenko + + Enable bsd.mod on coreboot. + + * conf/i386-coreboot.rmk (pkglib_MODULES): Add bsd.mod. + (bsd_mod_SOURCES): New variable. + (bsd_mod_CFLAGS): Likewise. + (bsd_mod_LDFLAGS): Likewise. + (bsd_mod_ASFLAGS): Likewise. + * loader/i386/bsd.c [!GRUB_MACHINE_PCBIOS]: Fix includes. + (grub_bsd_get_device) [!GRUB_MACHINE_PCBIOS]: Set *biosdev to 0xff. + 2009-08-25 Vladimir Serbinenko Cleanup NetBSD root support. diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 7e9f853d7..196abe68b 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -204,6 +204,13 @@ aout_mod_SOURCES = loader/aout.c aout_mod_CFLAGS = $(COMMON_CFLAGS) aout_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For bsd.mod +pkglib_MODULES += bsd.mod +bsd_mod_SOURCES = loader/i386/bsd.c loader/i386/bsd32.c loader/i386/bsd64.c loader/i386/bsd_helper.S loader/i386/bsd_trampoline.S +bsd_mod_CFLAGS = $(COMMON_CFLAGS) +bsd_mod_LDFLAGS = $(COMMON_LDFLAGS) +bsd_mod_ASFLAGS = $(COMMON_ASFLAGS) + # For play.mod. play_mod_SOURCES = commands/i386/pc/play.c play_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 0b9a2b471..0cb3c75f1 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -37,10 +37,10 @@ #ifdef GRUB_MACHINE_PCBIOS #include +#endif #include #include #include -#endif #define ALIGN_DWORD(a) ALIGN_UP (a, 4) #define ALIGN_QWORD(a) ALIGN_UP (a, 8) @@ -138,7 +138,11 @@ grub_bsd_get_device (grub_uint32_t * biosdev, char *p; grub_device_t dev; +#ifdef GRUB_MACHINE_PCBIOS *biosdev = grub_get_root_biosnumber () & 0xff; +#else + *biosdev = 0xff; +#endif *unit = (*biosdev & 0x7f); *slice = 0xff; *part = 0xff; From 552bf6c568e367ed34b60277519c6f4e2cd18bf7 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 26 Aug 2009 00:32:57 +0000 Subject: [PATCH 1071/1707] 2009-08-25 Vladimir Serbinenko NetBSD memory map support. * include/grub/i386/bsd.h (NETBSD_BTINFO_MEMMAP): New definition. (grub_netbsd_btinfo_mmap_header): New structure. (grub_netbsd_btinfo_mmap_entry): Likewise. * loader/i386/bsd.c (grub_netbsd_boot): Pass memory map. --- ChangeLog | 9 ++++++ include/grub/i386/bsd.h | 18 +++++++++++ loader/i386/bsd.c | 71 +++++++++++++++++++++++++++++++++++++---- 3 files changed, 91 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e5d7ba088..54b3e4849 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-08-25 Vladimir Serbinenko + + NetBSD memory map support. + + * include/grub/i386/bsd.h (NETBSD_BTINFO_MEMMAP): New definition. + (grub_netbsd_btinfo_mmap_header): New structure. + (grub_netbsd_btinfo_mmap_entry): Likewise. + * loader/i386/bsd.c (grub_netbsd_boot): Pass memory map. + 2009-08-25 Vladimir Serbinenko Enable bsd.mod on coreboot. diff --git a/include/grub/i386/bsd.h b/include/grub/i386/bsd.h index 2939035d2..8ffaf7d18 100644 --- a/include/grub/i386/bsd.h +++ b/include/grub/i386/bsd.h @@ -203,6 +203,7 @@ struct grub_netbsd_bootinfo #define NETBSD_BTINFO_BOOTPATH 0 #define NETBSD_BTINFO_ROOTDEVICE 1 #define NETBSD_BTINFO_BOOTDISK 3 +#define NETBSD_BTINFO_MEMMAP 9 struct grub_netbsd_btinfo_common { @@ -210,6 +211,23 @@ struct grub_netbsd_btinfo_common int type; }; +struct grub_netbsd_btinfo_mmap_header +{ + struct grub_netbsd_btinfo_common common; + grub_uint32_t count; +}; + +struct grub_netbsd_btinfo_mmap_entry +{ + grub_uint64_t addr; + grub_uint64_t len; +#define NETBSD_MMAP_AVAILABLE 1 +#define NETBSD_MMAP_RESERVED 2 +#define NETBSD_MMAP_ACPI 3 +#define NETBSD_MMAP_NVS 4 + grub_uint32_t type; +}; + struct grub_netbsd_btinfo_bootpath { struct grub_netbsd_btinfo_common common; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 0cb3c75f1..1accfb660 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -630,30 +630,87 @@ static grub_err_t grub_netbsd_boot (void) { struct grub_netbsd_bootinfo *bootinfo; + int count = 0; + struct grub_netbsd_btinfo_mmap_header *mmap; + struct grub_netbsd_btinfo_mmap_entry *pm; + void *curarg; + + auto int NESTED_FUNC_ATTR count_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR count_hook (grub_uint64_t addr __attribute__ ((unused)), + grub_uint64_t size __attribute__ ((unused)), + grub_uint32_t type __attribute__ ((unused))) + { + count++; + return 0; + } + + auto int NESTED_FUNC_ATTR fill_hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); + int NESTED_FUNC_ATTR fill_hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) + { + pm->addr = addr; + pm->len = size; + + switch (type) + { + case GRUB_MACHINE_MEMORY_AVAILABLE: + pm->type = NETBSD_MMAP_AVAILABLE; + break; + + case GRUB_MACHINE_MEMORY_ACPI: + pm->type = NETBSD_MMAP_ACPI; + break; + + case GRUB_MACHINE_MEMORY_NVS: + pm->type = NETBSD_MMAP_NVS; + break; + + default: + pm->type = NETBSD_MMAP_RESERVED; + break; + } + pm++; + + return 0; + } + + grub_mmap_iterate (count_hook); if (kern_end + sizeof (struct grub_netbsd_btinfo_rootdevice) - + sizeof (struct grub_netbsd_bootinfo) > grub_os_area_addr - + grub_os_area_size) + + sizeof (struct grub_netbsd_bootinfo) + + sizeof (struct grub_netbsd_btinfo_mmap_header) + + count * sizeof (struct grub_netbsd_btinfo_mmap_entry) + > grub_os_area_addr + grub_os_area_size) return grub_error (GRUB_ERR_OUT_OF_MEMORY, "No memory for boot info."); + curarg = mmap = (struct grub_netbsd_btinfo_mmap_header *) kern_end; + pm = (struct grub_netbsd_btinfo_mmap_entry *) (mmap + 1); + + grub_mmap_iterate (fill_hook); + mmap->common.type = NETBSD_BTINFO_MEMMAP; + mmap->common.len = (char *) pm - (char *) mmap; + mmap->count = count; + curarg = pm; + if (netbsd_root) { struct grub_netbsd_btinfo_rootdevice *rootdev; - rootdev = (struct grub_netbsd_btinfo_rootdevice *) kern_end; + rootdev = (struct grub_netbsd_btinfo_rootdevice *) curarg; rootdev->common.len = sizeof (struct grub_netbsd_btinfo_rootdevice); rootdev->common.type = NETBSD_BTINFO_ROOTDEVICE; grub_strncpy (rootdev->devname, netbsd_root, sizeof (rootdev->devname)); bootinfo = (struct grub_netbsd_bootinfo *) (rootdev + 1); - bootinfo->bi_count = 1; - bootinfo->bi_data[0] = rootdev; + bootinfo->bi_count = 2; + bootinfo->bi_data[0] = mmap; + bootinfo->bi_data[1] = rootdev; } else { - bootinfo = (struct grub_netbsd_bootinfo *) kern_end; - bootinfo->bi_count = 0; + bootinfo = (struct grub_netbsd_bootinfo *) curarg; + bootinfo->bi_count = 1; + bootinfo->bi_data[0] = mmap; } grub_unix_real_boot (entry, bootflags, 0, bootinfo, From 32a716555daef67288b6b848338684742069f150 Mon Sep 17 00:00:00 2001 From: bean Date: Wed, 26 Aug 2009 14:17:34 +0000 Subject: [PATCH 1072/1707] 2009-08-26 Bean * fs/xfs.c (GRUB_XFS_INO_INOINAG): Replace 1L with 1LL to support 64-bit number. (GRUB_XFS_FSB_TO_BLOCK): Likewise. (grub_xfs_inode_block): Change return type to grub_uint64_t. (grub_xfs_read_inode): Change type of block to grub_uint64_t. --- ChangeLog | 8 ++++++++ fs/xfs.c | 8 ++++---- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 54b3e4849..953cf126e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-08-26 Bean + + * fs/xfs.c (GRUB_XFS_INO_INOINAG): Replace 1L with 1LL to support + 64-bit number. + (GRUB_XFS_FSB_TO_BLOCK): Likewise. + (grub_xfs_inode_block): Change return type to grub_uint64_t. + (grub_xfs_read_inode): Change type of block to grub_uint64_t. + 2009-08-25 Vladimir Serbinenko NetBSD memory map support. diff --git a/fs/xfs.c b/fs/xfs.c index a143b55a0..1b18bef3b 100644 --- a/fs/xfs.c +++ b/fs/xfs.c @@ -160,13 +160,13 @@ static grub_dl_t my_mod; #define GRUB_XFS_INO_AGBITS(data) \ ((data)->sblock.log2_agblk + (data)->sblock.log2_inop) #define GRUB_XFS_INO_INOINAG(data, ino) \ - (grub_be_to_cpu64 (ino) & ((1 << GRUB_XFS_INO_AGBITS (data)) - 1)) + (grub_be_to_cpu64 (ino) & ((1LL << GRUB_XFS_INO_AGBITS (data)) - 1)) #define GRUB_XFS_INO_AG(data,ino) \ (grub_be_to_cpu64 (ino) >> GRUB_XFS_INO_AGBITS (data)) #define GRUB_XFS_FSB_TO_BLOCK(data, fsb) \ (((fsb) >> (data)->sblock.log2_agblk) * (data)->agsize \ - + ((fsb) & ((1 << (data)->sblock.log2_agblk) - 1))) + + ((fsb) & ((1LL << (data)->sblock.log2_agblk) - 1))) #define GRUB_XFS_EXTENT_OFFSET(exts,ex) \ ((grub_be_to_cpu32 (exts[ex][0]) & ~(1 << 31)) << 23 \ @@ -185,7 +185,7 @@ static grub_dl_t my_mod; #define GRUB_XFS_NEXT_DIRENT(pos,len) \ (pos) + GRUB_XFS_ROUND_TO_DIRENT (8 + 1 + len + 2) -static inline int +static inline grub_uint64_t grub_xfs_inode_block (struct grub_xfs_data *data, grub_uint64_t ino) { @@ -213,7 +213,7 @@ static grub_err_t grub_xfs_read_inode (struct grub_xfs_data *data, grub_uint64_t ino, struct grub_xfs_inode *inode) { - int block = grub_xfs_inode_block (data, ino); + grub_uint64_t block = grub_xfs_inode_block (data, ino); int offset = grub_xfs_inode_offset (data, ino); /* Read the inode. */ From 6e2a90859add777ca77b061e8ac57ceb79091277 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 28 Aug 2009 13:01:26 +0000 Subject: [PATCH 1073/1707] 2009-08-28 Vladimir Serbinenko Split befs.mod and afs.mod into *_be.mod and *.mod * conf/common.rmk (grub_probe_SOURCES): Add afs_be.c and befs_be.c. (grub_fstest_SOURCES): Likewise. (pkglib_MODULES): Add afs_be.mod and befs_be.mod. (afs_be_mod_SOURCES): New variable. (afs_be_mod_CFLAGS): Likewise. (afs_be_mod_LDFLAGS): Likewise. (befs_be_mod_SOURCES): Likewise. (befs_be_mod_CFLAGS): Likewise. (befs_be_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add afs_be.c and befs_be.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * fs/afs_be.c: New file. * fs/befs_be.c: New file. * fs/afs.c (GRUB_AFS_FSNAME_SUFFIX): New definition. (GRUB_AFS_FSNAME): Use GRUB_AFS_FSNAME_SUFFIX. (U16): Replaced with ... (grub_afs_to_cpu16): ...this. All users updated. (U32): Replaced with ... (grub_afs_to_cpu32): ...this. All users updated. (U64): Replaced with ... (grub_afs_to_cpu64): ...this. All users updated. (GRUB_AFS_BO_LITTLE_ENDIAN): Remove. (GRUB_AFS_BO_BIG_ENDIAN): Likewise. (grub_afs_validate_sblock): Check only one endiannness. (GRUB_MOD_INIT (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. (GRUB_MOD_INIT (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. (GRUB_MOD_INIT (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. (GRUB_MOD_INIT (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. (GRUB_MOD_FINI (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. (GRUB_MOD_FINI (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. (GRUB_MOD_FINI (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. (GRUB_MOD_FINI (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. --- ChangeLog | 43 ++++++++++ conf/common.rmk | 18 ++++- conf/i386-coreboot.rmk | 3 +- conf/i386-efi.rmk | 3 +- conf/i386-ieee1275.rmk | 3 +- conf/i386-pc.rmk | 6 +- conf/powerpc-ieee1275.rmk | 3 +- conf/sparc64-ieee1275.rmk | 6 +- conf/x86_64-efi.rmk | 2 +- fs/afs.c | 165 +++++++++++++++++--------------------- fs/afs_be.c | 2 + fs/befs_be.c | 4 + 12 files changed, 156 insertions(+), 102 deletions(-) create mode 100644 fs/afs_be.c create mode 100644 fs/befs_be.c diff --git a/ChangeLog b/ChangeLog index 953cf126e..ab542e2e8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,46 @@ +2009-08-28 Vladimir Serbinenko + + Split befs.mod and afs.mod into *_be.mod and *.mod + + * conf/common.rmk (grub_probe_SOURCES): Add afs_be.c and befs_be.c. + (grub_fstest_SOURCES): Likewise. + (pkglib_MODULES): Add afs_be.mod and befs_be.mod. + (afs_be_mod_SOURCES): New variable. + (afs_be_mod_CFLAGS): Likewise. + (afs_be_mod_LDFLAGS): Likewise. + (befs_be_mod_SOURCES): Likewise. + (befs_be_mod_CFLAGS): Likewise. + (befs_be_mod_LDFLAGS): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add afs_be.c and befs_be.c. + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_setup_SOURCES): Likewise. + (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * fs/afs_be.c: New file. + * fs/befs_be.c: New file. + * fs/afs.c (GRUB_AFS_FSNAME_SUFFIX): New definition. + (GRUB_AFS_FSNAME): Use GRUB_AFS_FSNAME_SUFFIX. + (U16): Replaced with ... + (grub_afs_to_cpu16): ...this. All users updated. + (U32): Replaced with ... + (grub_afs_to_cpu32): ...this. All users updated. + (U64): Replaced with ... + (grub_afs_to_cpu64): ...this. All users updated. + (GRUB_AFS_BO_LITTLE_ENDIAN): Remove. + (GRUB_AFS_BO_BIG_ENDIAN): Likewise. + (grub_afs_validate_sblock): Check only one endiannness. + (GRUB_MOD_INIT (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. + (GRUB_MOD_INIT (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. + (GRUB_MOD_INIT (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. + (GRUB_MOD_INIT (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. + (GRUB_MOD_FINI (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. + (GRUB_MOD_FINI (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. + (GRUB_MOD_FINI (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. + (GRUB_MOD_FINI (afs_be)) [MODE_BIGENDIAN && !MODE_BFS]: ... this. + 2009-08-26 Bean * fs/xfs.c (GRUB_XFS_INO_INOINAG): Replace 1L with 1LL to support diff --git a/conf/common.rmk b/conf/common.rmk index 6d767460b..7727f19e8 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -17,7 +17,8 @@ grub_probe_SOURCES = util/grub-probe.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ partmap/msdos.c partmap/apple.c partmap/sun.c partmap/gpt.c\ kern/fs.c kern/env.c fs/fshelp.c \ @@ -38,7 +39,8 @@ grub_fstest_SOURCES = util/grub-fstest.c util/hostfs.c util/misc.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c fs/befs.c \ + fs/befs_be.c fs/tar.c \ \ kern/partition.c partmap/msdos.c partmap/apple.c partmap/sun.c \ partmap/gpt.c \ @@ -177,7 +179,7 @@ CLEANFILES += grub-dumpbios pkglib_MODULES += fshelp.mod fat.mod ufs1.mod ufs2.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ affs.mod sfs.mod hfsplus.mod reiserfs.mod cpio.mod tar.mod \ - udf.mod afs.mod befs.mod + udf.mod afs.mod afs_be.mod befs.mod befs_be.mod # For fshelp.mod. fshelp_mod_SOURCES = fs/fshelp.c @@ -279,11 +281,21 @@ afs_mod_SOURCES = fs/afs.c afs_mod_CFLAGS = $(COMMON_CFLAGS) afs_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For afs_be.mod. +afs_be_mod_SOURCES = fs/afs_be.c +afs_be_mod_CFLAGS = $(COMMON_CFLAGS) +afs_be_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For befs.mod. befs_mod_SOURCES = fs/befs.c befs_mod_CFLAGS = $(COMMON_CFLAGS) befs_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For befs_be.mod. +befs_be_mod_SOURCES = fs/befs_be.c +befs_be_mod_CFLAGS = $(COMMON_CFLAGS) +befs_be_mod_LDFLAGS = $(COMMON_LDFLAGS) + # Partition maps. pkglib_MODULES += part_amiga.mod diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 196abe68b..990ba805d 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -117,7 +117,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index f1e5e8fe3..b470a7687 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -45,7 +45,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 67234ebb6..989f1bc61 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -72,7 +72,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c fs/befs.c \ + fs/befs_be.c fs/tar.c \ \ fs/fshelp.c \ io/gzio.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 6b177963e..d415aed32 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -102,7 +102,8 @@ grub_setup_SOURCES = util/i386/pc/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ partmap/msdos.c partmap/gpt.c \ \ @@ -147,7 +148,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ util/console.c util/hostfs.c util/grub-emu.c util/misc.c \ util/hostdisk.c util/getroot.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index c9b7e7592..0c6650dfd 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -52,7 +52,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 621621399..7851fd64a 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -78,7 +78,8 @@ grub_setup_SOURCES = util/sparc64/ieee1275/grub-setup.c util/hostdisk.c \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ partmap/amiga.c partmap/apple.c partmap/msdos.c \ partmap/sun.c partmap/acorn.c \ @@ -109,7 +110,8 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/befs.c fs/tar.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ + fs/befs.c fs/befs_be.c fs/tar.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index b4c08b093..0defdcd93 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -43,7 +43,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ fs/hfsplus.c fs/iso9660.c fs/udf.c fs/jfs.c fs/minix.c \ fs/ntfs.c fs/ntfscomp.c fs/reiserfs.c fs/sfs.c \ - fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c \ + fs/ufs.c fs/ufs2.c fs/xfs.c fs/afs.c fs/afs_be.c \ \ io/gzio.c \ kern/device.c kern/disk.c kern/dl.c kern/elf.c kern/env.c \ diff --git a/fs/afs.c b/fs/afs.c index 971c8bd2e..cd61f4db9 100644 --- a/fs/afs.c +++ b/fs/afs.c @@ -26,10 +26,16 @@ #include #include -#ifdef MODE_BFS -#define GRUB_AFS_FSNAME "befs" +#ifdef MODE_BIGENDIAN +#define GRUB_AFS_FSNAME_SUFFIX "_be" #else -#define GRUB_AFS_FSNAME "afs" +#define GRUB_AFS_FSNAME_SUFFIX "" +#endif + +#ifdef MODE_BFS +#define GRUB_AFS_FSNAME "befs" GRUB_AFS_FSNAME_SUFFIX +#else +#define GRUB_AFS_FSNAME "afs" GRUB_AFS_FSNAME_SUFFIX #endif #define GRUB_AFS_DIRECT_BLOCK_COUNT 12 @@ -65,14 +71,15 @@ #define GRUB_AFS_NULL_VAL ((grub_afs_bvalue_t)-1) -#define U16(sb, u) (((sb)->byte_order == GRUB_AFS_BO_LITTLE_ENDIAN) ? \ - grub_le_to_cpu16 (u) : grub_be_to_cpu16 (u)) - -#define U32(sb, u) (((sb)->byte_order == GRUB_AFS_BO_LITTLE_ENDIAN) ? \ - grub_le_to_cpu32 (u) : grub_be_to_cpu32 (u)) - -#define U64(sb, u) (((sb)->byte_order == GRUB_AFS_BO_LITTLE_ENDIAN) ? \ - grub_le_to_cpu64 (u) : grub_be_to_cpu64 (u)) +#ifdef MODE_BIGENDIAN +#define grub_afs_to_cpu16(x) grub_be_to_cpu16 (x) +#define grub_afs_to_cpu32(x) grub_be_to_cpu32 (x) +#define grub_afs_to_cpu64(x) grub_be_to_cpu64 (x) +#else +#define grub_afs_to_cpu16(x) grub_le_to_cpu16 (x) +#define grub_afs_to_cpu32(x) grub_le_to_cpu32 (x) +#define grub_afs_to_cpu64(x) grub_le_to_cpu64 (x) +#endif #ifdef MODE_BFS #define B_KEY_INDEX_ALIGN 8 @@ -90,12 +97,6 @@ ((char *) B_KEY_INDEX_OFFSET (node) + \ node->key_count * 2)) -enum -{ - GRUB_AFS_BO_LITTLE_ENDIAN, - GRUB_AFS_BO_BIG_ENDIAN -}; - typedef grub_uint64_t grub_afs_off_t; typedef grub_uint64_t grub_afs_bigtime; typedef grub_uint64_t grub_afs_bvalue_t; @@ -154,6 +155,9 @@ struct grub_afs_btree } __attribute__ ((packed)); #endif +/* Beware that following structure describes AtheFS and if you write code + which uses currently unused fields check it with both AtheFS and BeFS. + */ struct grub_afs_sblock { char name[32]; @@ -227,8 +231,8 @@ static grub_afs_off_t grub_afs_run_to_num (struct grub_afs_sblock *sb, struct grub_afs_blockrun *run) { - return ((grub_afs_off_t) U32 (sb, run->group) * sb->block_per_group + - U16 (sb, run->start)); + return ((grub_afs_off_t) grub_afs_to_cpu32 (run->group) + * sb->block_per_group + grub_afs_to_cpu16 (run->start)); } static grub_err_t @@ -248,25 +252,25 @@ grub_afs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) struct grub_afs_sblock *sb = &node->data->sblock; struct grub_afs_datastream *ds = &node->inode.stream; - if (fileblock < U64 (sb, ds->max_direct_range)) + if (fileblock < grub_afs_to_cpu64 (ds->max_direct_range)) { int i; for (i = 0; i < GRUB_AFS_DIRECT_BLOCK_COUNT; i++) { - if (fileblock < U16 (sb, ds->direct[i].len)) + if (fileblock < grub_afs_to_cpu16 (ds->direct[i].len)) return grub_afs_run_to_num (sb, &ds->direct[i]) + fileblock; - fileblock -= U16 (sb, ds->direct[i].len); + fileblock -= grub_afs_to_cpu16 (ds->direct[i].len); } } - else if (fileblock < U64 (sb, ds->max_indirect_range)) + else if (fileblock < grub_afs_to_cpu64 (ds->max_indirect_range)) { int ptrs_per_blk = sb->block_size / sizeof (struct grub_afs_blockrun); struct grub_afs_blockrun indir[ptrs_per_blk]; grub_afs_off_t blk = grub_afs_run_to_num (sb, &ds->indirect); int i; - fileblock -= U64 (sb, ds->max_direct_range); + fileblock -= grub_afs_to_cpu64 (ds->max_direct_range); for (i = 0; i < ds->indirect.len; i++, blk++) { int j; @@ -279,10 +283,10 @@ grub_afs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) for (j = 0; j < ptrs_per_blk; j++) { - if (fileblock < U16 (sb, indir[j].len)) + if (fileblock < grub_afs_to_cpu16 (indir[j].len)) return grub_afs_run_to_num (sb, &indir[j]) + fileblock; - fileblock -= U16 (sb, indir[j].len); + fileblock -= grub_afs_to_cpu16 (indir[j].len); } } } @@ -292,7 +296,7 @@ grub_afs_read_block (grub_fshelp_node_t node, grub_disk_addr_t fileblock) struct grub_afs_blockrun indir[ptrs_per_blk]; /* ([idblk][idptr]) ([dblk][dptr]) [blk] */ - int cur_pos = fileblock - U64 (sb, ds->max_indirect_range); + int cur_pos = fileblock - grub_afs_to_cpu64 (ds->max_indirect_range); int dptr_size = GRUB_AFS_BLOCKS_PER_DI_RUN; int dblk_size = dptr_size * ptrs_per_blk; @@ -334,8 +338,7 @@ grub_afs_read_file (grub_fshelp_node_t node, { return grub_fshelp_read_file (node->data->disk, node, read_hook, pos, len, buf, grub_afs_read_block, - U64 (&node->data->sblock, - node->inode.stream.size), + grub_afs_to_cpu64 (node->inode.stream.size), node->data->sblock.block_shift - GRUB_DISK_SECTOR_BITS); } @@ -344,8 +347,7 @@ static char * grub_afs_read_symlink (grub_fshelp_node_t node) { char *ret; - struct grub_afs_sblock *sb = &node->data->sblock; - grub_afs_off_t size = U64 (sb, node->inode.stream.size); + grub_afs_off_t size = grub_afs_to_cpu64 (node->inode.stream.size); if (size == 0) { @@ -374,27 +376,27 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, struct grub_afs_btree head; char node_data [GRUB_AFS_BNODE_SIZE]; struct grub_afs_bnode *node = (struct grub_afs_bnode *) node_data; - struct grub_afs_sblock *sb = &dir->data->sblock; int i; if ((dir->inode.stream.size == 0) - || ((U32 (sb, dir->inode.mode) & GRUB_AFS_S_IFMT) != GRUB_AFS_S_IFDIR)) + || ((grub_afs_to_cpu32 (dir->inode.mode) & GRUB_AFS_S_IFMT) + != GRUB_AFS_S_IFDIR)) return 0; grub_afs_read_file (dir, 0, 0, sizeof (head), (char *) &head); if (grub_errno) return 0; - grub_afs_read_file (dir, 0, U64 (sb, head.root), + grub_afs_read_file (dir, 0, grub_afs_to_cpu64 (head.root), GRUB_AFS_BNODE_SIZE, (char *) node); if (grub_errno) return 0; - for (i = 0; i < (int) U32 (sb, head.tree_depth) - 1; i++) + for (i = 0; i < (int) grub_afs_to_cpu32 (head.tree_depth) - 1; i++) { grub_afs_bvalue_t blk; - blk = U64(sb, B_KEY_VALUE_OFFSET (node) [0]); + blk = grub_afs_to_cpu64(B_KEY_VALUE_OFFSET (node) [0]); grub_afs_read_file (dir, 0, blk, GRUB_AFS_BNODE_SIZE, (char *) node); if (grub_errno) return 0; @@ -411,8 +413,9 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, index = B_KEY_INDEX_OFFSET (node); - key_start = U16 (sb, (cur_key > 0) ? index[cur_key - 1] : 0); - key_size = U16 (sb, index[cur_key]) - key_start; + key_start = (cur_key > 0) + ? grub_afs_to_cpu16 (index[cur_key - 1]) : 0; + key_size = grub_afs_to_cpu16 (index[cur_key]) - key_start; if (key_size > 0) { char filename [key_size + 1]; @@ -425,14 +428,15 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, fdiro->data = dir->data; if (grub_afs_read_inode (dir->data, - U64 (sb, B_KEY_VALUE_OFFSET (node) [cur_key]), + grub_afs_to_cpu64 + (B_KEY_VALUE_OFFSET (node) [cur_key]), &fdiro->inode)) return 0; grub_memcpy (filename, &node->key_data[key_start], key_size); filename [key_size] = 0; - mode = (U32 (sb, fdiro->inode.mode) & GRUB_AFS_S_IFMT); + mode = (grub_afs_to_cpu32 (fdiro->inode.mode) & GRUB_AFS_S_IFMT); if (mode == GRUB_AFS_S_IFDIR) type = GRUB_FSHELP_DIR; else if (mode == GRUB_AFS_S_IFREG) @@ -447,12 +451,12 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, } cur_key++; - if (cur_key >= U32 (sb, node->key_count)) + if (cur_key >= grub_afs_to_cpu32 (node->key_count)) { if (node->right == GRUB_AFS_NULL_VAL) break; - grub_afs_read_file (dir, 0, U64 (sb, node->right), + grub_afs_read_file (dir, 0, grub_afs_to_cpu64 (node->right), GRUB_AFS_BNODE_SIZE, (char *) node); if (grub_errno) return 0; @@ -468,47 +472,20 @@ grub_afs_iterate_dir (grub_fshelp_node_t dir, static int grub_afs_validate_sblock (struct grub_afs_sblock *sb) { - if (grub_le_to_cpu32 (sb->magic1) == GRUB_AFS_SBLOCK_MAGIC1) + if (grub_afs_to_cpu32 (sb->magic1) == GRUB_AFS_SBLOCK_MAGIC1) { -#ifndef MODE_BFS - if (grub_le_to_cpu32 (sb->byte_order) != GRUB_AFS_BO_LITTLE_ENDIAN) - return 0; -#endif - - sb->byte_order = GRUB_AFS_BO_LITTLE_ENDIAN; - sb->magic2 = grub_le_to_cpu32 (sb->magic2); - sb->magic3 = grub_le_to_cpu32 (sb->magic3); - sb->block_shift = grub_le_to_cpu32 (sb->block_shift); - sb->block_size = grub_le_to_cpu32 (sb->block_size); - sb->used_blocks = grub_le_to_cpu64 (sb->used_blocks); - sb->num_blocks = grub_le_to_cpu64 (sb->num_blocks); - sb->inode_size = grub_le_to_cpu32 (sb->inode_size); - sb->alloc_group_count = grub_le_to_cpu32 (sb->alloc_group_count); - sb->alloc_group_shift = grub_le_to_cpu32 (sb->alloc_group_shift); - sb->block_per_group = grub_le_to_cpu32 (sb->block_per_group); - sb->alloc_group_count = grub_le_to_cpu32 (sb->alloc_group_count); - sb->log_size = grub_le_to_cpu32 (sb->log_size); - } - else if (grub_be_to_cpu32 (sb->magic1) == GRUB_AFS_SBLOCK_MAGIC1) - { -#ifndef MODE_BFS - if (grub_be_to_cpu32 (sb->byte_order) != GRUB_AFS_BO_BIG_ENDIAN) - return 0; -#endif - - sb->byte_order = GRUB_AFS_BO_BIG_ENDIAN; - sb->magic2 = grub_be_to_cpu32 (sb->magic2); - sb->magic3 = grub_be_to_cpu32 (sb->magic3); - sb->block_shift = grub_be_to_cpu32 (sb->block_shift); - sb->block_size = grub_be_to_cpu32 (sb->block_size); - sb->used_blocks = grub_be_to_cpu64 (sb->used_blocks); - sb->num_blocks = grub_be_to_cpu64 (sb->num_blocks); - sb->inode_size = grub_be_to_cpu32 (sb->inode_size); - sb->alloc_group_count = grub_be_to_cpu32 (sb->alloc_group_count); - sb->alloc_group_shift = grub_be_to_cpu32 (sb->alloc_group_shift); - sb->block_per_group = grub_be_to_cpu32 (sb->block_per_group); - sb->alloc_group_count = grub_be_to_cpu32 (sb->alloc_group_count); - sb->log_size = grub_be_to_cpu32 (sb->log_size); + sb->magic2 = grub_afs_to_cpu32 (sb->magic2); + sb->magic3 = grub_afs_to_cpu32 (sb->magic3); + sb->block_shift = grub_afs_to_cpu32 (sb->block_shift); + sb->block_size = grub_afs_to_cpu32 (sb->block_size); + sb->used_blocks = grub_afs_to_cpu64 (sb->used_blocks); + sb->num_blocks = grub_afs_to_cpu64 (sb->num_blocks); + sb->inode_size = grub_afs_to_cpu32 (sb->inode_size); + sb->alloc_group_count = grub_afs_to_cpu32 (sb->alloc_group_count); + sb->alloc_group_shift = grub_afs_to_cpu32 (sb->alloc_group_shift); + sb->block_per_group = grub_afs_to_cpu32 (sb->block_per_group); + sb->alloc_group_count = grub_afs_to_cpu32 (sb->alloc_group_count); + sb->log_size = grub_afs_to_cpu32 (sb->log_size); } else return 0; @@ -529,8 +506,8 @@ grub_afs_validate_sblock (struct grub_afs_sblock *sb) || ((grub_uint32_t) (1 << sb->alloc_group_shift) != sb->block_per_group * sb->block_size) || (sb->alloc_group_count * sb->block_per_group < sb->num_blocks) - || (U16 (sb, sb->log_block.len) != sb->log_size) - || (U32 (sb, sb->valid_log_blocks) > sb->log_size) + || (grub_afs_to_cpu16 (sb->log_block.len) != sb->log_size) + || (grub_afs_to_cpu32 (sb->valid_log_blocks) > sb->log_size) #endif ) return 0; @@ -594,7 +571,7 @@ grub_afs_open (struct grub_file *file, const char *name) grub_memcpy (data->inode, &fdiro->inode, sizeof (struct grub_afs_inode)); grub_free (fdiro); - file->size = U64 (&data->sblock, data->inode->stream.size); + file->size = grub_afs_to_cpu64 (data->inode->stream.size); file->data = data; file->offset = 0; @@ -648,10 +625,10 @@ grub_afs_dir (grub_device_t device, const char *path, info.dir = ((filetype & GRUB_FSHELP_TYPE_MASK) == GRUB_FSHELP_DIR); info.mtimeset = 1; #ifdef MODE_BFS - info.mtime = U64 (&data->sblock, node->inode.modified_time) >> 16; + info.mtime = grub_afs_to_cpu64 (node->inode.modified_time) >> 16; #else - info.mtime = grub_divmod64 (U64 (&data->sblock, - node->inode.modified_time), 1000000, 0); + info.mtime = grub_divmod64 (grub_afs_to_cpu64 (node->inode.modified_time), + 1000000, 0); #endif grub_free (node); return hook (filename, &info); @@ -713,8 +690,12 @@ static struct grub_fs grub_afs_fs = { .next = 0 }; -#ifdef MODE_BFS +#if defined (MODE_BIGENDIAN) && defined (MODE_BFS) +GRUB_MOD_INIT (befs_be) +#elif defined (MODE_BFS) GRUB_MOD_INIT (befs) +#elif defined (MODE_BIGENDIAN) +GRUB_MOD_INIT (afs_be) #else GRUB_MOD_INIT (afs) #endif @@ -723,8 +704,12 @@ GRUB_MOD_INIT (afs) my_mod = mod; } -#ifdef MODE_BFS +#if defined (MODE_BIGENDIAN) && defined (MODE_BFS) +GRUB_MOD_FINI (befs_be) +#elif defined (MODE_BFS) GRUB_MOD_FINI (befs) +#elif defined (MODE_BIGENDIAN) +GRUB_MOD_FINI (afs_be) #else GRUB_MOD_FINI (afs) #endif diff --git a/fs/afs_be.c b/fs/afs_be.c new file mode 100644 index 000000000..1f1f48fbb --- /dev/null +++ b/fs/afs_be.c @@ -0,0 +1,2 @@ +#define MODE_BIGENDIAN 1 +#include "afs.c" diff --git a/fs/befs_be.c b/fs/befs_be.c new file mode 100644 index 000000000..f6e8179f4 --- /dev/null +++ b/fs/befs_be.c @@ -0,0 +1,4 @@ +/* befs.c - The native BeOS/Haiku file-system. */ +#define MODE_BFS 1 +#define MODE_BIGENDIAN 1 +#include "afs.c" From 4cbe67e509788b3aaa19a57afa2184c8d9f1061c Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 28 Aug 2009 13:20:34 +0000 Subject: [PATCH 1074/1707] 2009-08-28 Colin Watson 2009-08-28 Robert Millan Add `getkeystatus' terminal method. Add a new `keystatus' command to query it. * include/grub/term.h (GRUB_TERM_STATUS_SHIFT, GRUB_TERM_STATUS_CTRL, GRUB_TERM_STATUS_ALT): Definitions for modifier key bitmasks. (struct grub_term_input): Add `getkeystatus' member. (grub_getkeystatus): Add prototype. * kern/term.c (grub_getkeystatus): New function. * include/grub/i386/pc/memory.h (GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR): New macro. (struct grub_machine_bios_data_area): Define necessary parts of BIOS Data Area layout. * term/i386/pc/console.c (grub_console_getkeystatus): New function. (grub_console_term_input): Set `getkeystatus' member. * term/usb_keyboard.c (grub_usb_hid): Macroify HID protocol constants. (grub_usb_keyboard_getreport): Likewise. (grub_usb_keyboard_checkkey): Likewise. (grub_usb_keyboard_getkeystatus): New function. (grub_usb_keyboard_term): Set `getkeystatus' member. * commands/keystatus.c: New file. * conf/common.rmk (pkglib_MODULES): Add keystatus.mod. (keystatus_mod_SOURCES): New variable. (keystatus_mod_CFLAGS): Likewise. (keystatus_mod_LDFLAGS): Likewise. * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add commands/keystatus.c. * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. * DISTLIST: Add commands/keystatus.c. --- ChangeLog | 41 ++++++++++++++++++ commands/keystatus.c | 81 ++++++++++++++++++++++++++++++++++ conf/common.rmk | 8 +++- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- conf/x86_64-efi.rmk | 2 +- include/grub/i386/pc/memory.h | 11 +++++ include/grub/term.h | 12 ++++- kern/term.c | 9 ++++ term/i386/pc/console.c | 27 +++++++++++- term/usb_keyboard.c | 82 ++++++++++++++++++++++++++++++++--- 15 files changed, 270 insertions(+), 15 deletions(-) create mode 100644 commands/keystatus.c diff --git a/ChangeLog b/ChangeLog index ab542e2e8..691273fc6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,44 @@ +2009-08-28 Colin Watson +2009-08-28 Robert Millan + + Add `getkeystatus' terminal method. Add a new `keystatus' command + to query it. + + * include/grub/term.h (GRUB_TERM_STATUS_SHIFT, + GRUB_TERM_STATUS_CTRL, GRUB_TERM_STATUS_ALT): Definitions for + modifier key bitmasks. + (struct grub_term_input): Add `getkeystatus' member. + (grub_getkeystatus): Add prototype. + * kern/term.c (grub_getkeystatus): New function. + + * include/grub/i386/pc/memory.h + (GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR): New macro. + (struct grub_machine_bios_data_area): Define necessary parts of BIOS + Data Area layout. + * term/i386/pc/console.c (grub_console_getkeystatus): New function. + (grub_console_term_input): Set `getkeystatus' member. + * term/usb_keyboard.c (grub_usb_hid): Macroify HID protocol + constants. + (grub_usb_keyboard_getreport): Likewise. + (grub_usb_keyboard_checkkey): Likewise. + (grub_usb_keyboard_getkeystatus): New function. + (grub_usb_keyboard_term): Set `getkeystatus' member. + + * commands/keystatus.c: New file. + * conf/common.rmk (pkglib_MODULES): Add keystatus.mod. + (keystatus_mod_SOURCES): New variable. + (keystatus_mod_CFLAGS): Likewise. + (keystatus_mod_LDFLAGS): Likewise. + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Add + commands/keystatus.c. + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/i386-pc.rmk (grub_emu_SOURCES): Likewise. + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. + * DISTLIST: Add commands/keystatus.c. + 2009-08-28 Vladimir Serbinenko Split befs.mod and afs.mod into *_be.mod and *.mod diff --git a/commands/keystatus.c b/commands/keystatus.c new file mode 100644 index 000000000..cecbba504 --- /dev/null +++ b/commands/keystatus.c @@ -0,0 +1,81 @@ +/* keystatus.c - Command to check key modifier status. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include +#include +#include + +static const struct grub_arg_option options[] = + { + {"shift", 's', 0, "check Shift key", 0, 0}, + {"ctrl", 'c', 0, "check Control key", 0, 0}, + {"alt", 'a', 0, "check Alt key", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + +#define grub_cur_term_input grub_term_get_current_input () + +static grub_err_t +grub_cmd_keystatus (grub_extcmd_t cmd, + int argc __attribute__ ((unused)), + char **args __attribute__ ((unused))) +{ + struct grub_arg_list *state = cmd->state; + int expect_mods = 0; + int mods; + + if (state[0].set) + expect_mods |= GRUB_TERM_STATUS_SHIFT; + if (state[1].set) + expect_mods |= GRUB_TERM_STATUS_CTRL; + if (state[2].set) + expect_mods |= GRUB_TERM_STATUS_ALT; + + /* Without arguments, just check whether getkeystatus is supported at + all. */ + if (!grub_cur_term_input->getkeystatus) + return grub_error (GRUB_ERR_TEST_FAILURE, "false"); + grub_dprintf ("keystatus", "expect_mods: %d\n", expect_mods); + if (!expect_mods) + return 0; + + mods = grub_getkeystatus (); + grub_dprintf ("keystatus", "mods: %d\n", mods); + if (mods >= 0 && (mods & expect_mods) != 0) + return 0; + else + return grub_error (GRUB_ERR_TEST_FAILURE, "false"); +} + +static grub_extcmd_t cmd; + +GRUB_MOD_INIT(keystatus) +{ + cmd = grub_register_extcmd ("keystatus", grub_cmd_keystatus, + GRUB_COMMAND_FLAG_BOTH, + "keystatus [--shift|--ctrl|--alt]", + "Check key modifier status", + options); +} + +GRUB_MOD_FINI(keystatus) +{ + grub_unregister_extcmd (cmd); +} diff --git a/conf/common.rmk b/conf/common.rmk index 7727f19e8..73cf02caa 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -375,7 +375,8 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ msdospart.mod memrw.mod normal.mod sh.mod lua.mod \ - gptsync.mod true.mod probe.mod password.mod + gptsync.mod true.mod probe.mod password.mod \ + keystatus.mod # For password.mod. password_mod_SOURCES = commands/password.c @@ -522,6 +523,11 @@ probe_mod_SOURCES = commands/probe.c probe_mod_CFLAGS = $(COMMON_CFLAGS) probe_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For keystatus.mod. +keystatus_mod_SOURCES = commands/keystatus.c +keystatus_mod_CFLAGS = $(COMMON_CFLAGS) +keystatus_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For normal.mod. normal_mod_SOURCES = normal/main.c normal/cmdline.c normal/dyncmd.c \ normal/auth.c normal/autofs.c normal/handler.c \ diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 990ba805d..4e2d1f1ec 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -110,7 +110,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/password.c \ + commands/password.c commands/keystatus.c \ lib/hexdump.c commands/i386/cpuid.c \ disk/host.c disk/loopback.c \ \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index b470a7687..18a9a636b 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -37,7 +37,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ - commands/halt.c commands/reboot.c \ + commands/halt.c commands/reboot.c commands/keystatus.c \ commands/i386/cpuid.c \ commands/password.c \ disk/loopback.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 989f1bc61..b426bdd80 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -66,7 +66,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ - commands/password.c \ + commands/password.c commands/keystatus.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index d415aed32..8d7d9fca9 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -124,7 +124,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ - commands/password.c \ + commands/password.c commands/keystatus.c \ disk/host.c disk/loopback.c disk/scsi.c \ fs/fshelp.c \ \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 0c6650dfd..b294de917 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -46,7 +46,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/password.c \ + commands/password.c commands/keystatus.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 7851fd64a..c44c6ca78 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -104,7 +104,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ - commands/password.c \ + commands/password.c commands/keystatus.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 0defdcd93..1a4cf89ed 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -37,7 +37,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ - commands/password.c \ + commands/password.c commands/keystatus.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/include/grub/i386/pc/memory.h b/include/grub/i386/pc/memory.h index d7910ab15..815390482 100644 --- a/include/grub/i386/pc/memory.h +++ b/include/grub/i386/pc/memory.h @@ -78,8 +78,19 @@ /* The data segment of the pseudo real mode. */ #define GRUB_MEMORY_MACHINE_PSEUDO_REAL_DSEG 0x20 +#define GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR 0x400 + #ifndef ASM_FILE +/* See http://heim.ifi.uio.no/~stanisls/helppc/bios_data_area.html for a + description of the BIOS Data Area layout. */ +struct grub_machine_bios_data_area +{ + grub_uint8_t unused1[0x17]; + grub_uint8_t keyboard_flag_lower; /* 0x17 */ + grub_uint8_t unused2[0xf0 - 0x18]; +}; + struct grub_machine_mmap_entry { grub_uint32_t size; diff --git a/include/grub/term.h b/include/grub/term.h index 9ce3be7d1..316d75390 100644 --- a/include/grub/term.h +++ b/include/grub/term.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -72,6 +72,12 @@ grub_term_color_state; #define GRUB_TERM_NEED_INIT (1 << 16) +/* Bitmasks for modifier keys returned by grub_getkeystatus. */ +#define GRUB_TERM_STATUS_SHIFT (1 << 0) +#define GRUB_TERM_STATUS_CTRL (1 << 1) +#define GRUB_TERM_STATUS_ALT (1 << 2) + + /* Unicode characters for fancy graphics. */ #define GRUB_TERM_DISP_LEFT 0x2190 #define GRUB_TERM_DISP_UP 0x2191 @@ -157,6 +163,9 @@ struct grub_term_input /* Get a character. */ int (*getkey) (void); + + /* Get keyboard modifier status. */ + int (*getkeystatus) (void); }; typedef struct grub_term_input *grub_term_input_t; @@ -275,6 +284,7 @@ void EXPORT_FUNC(grub_putcode) (grub_uint32_t code); grub_ssize_t EXPORT_FUNC(grub_getcharwidth) (grub_uint32_t code); int EXPORT_FUNC(grub_getkey) (void); int EXPORT_FUNC(grub_checkkey) (void); +int EXPORT_FUNC(grub_getkeystatus) (void); grub_uint16_t EXPORT_FUNC(grub_getwh) (void); grub_uint16_t EXPORT_FUNC(grub_getxy) (void); void EXPORT_FUNC(grub_gotoxy) (grub_uint8_t x, grub_uint8_t y); diff --git a/kern/term.c b/kern/term.c index 3583a301d..03e2ae573 100644 --- a/kern/term.c +++ b/kern/term.c @@ -140,6 +140,15 @@ grub_checkkey (void) return (grub_cur_term_input->checkkey) (); } +int +grub_getkeystatus (void) +{ + if (grub_cur_term_input->getkeystatus) + return (grub_cur_term_input->getkeystatus) (); + else + return 0; +} + grub_uint16_t grub_getxy (void) { diff --git a/term/i386/pc/console.c b/term/i386/pc/console.c index c880595e4..ec1383942 100644 --- a/term/i386/pc/console.c +++ b/term/i386/pc/console.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,15 +16,40 @@ * along with GRUB. If not, see . */ +#include #include #include #include +static const struct grub_machine_bios_data_area *bios_data_area = GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; + +#define KEYBOARD_LEFT_SHIFT (1 << 0) +#define KEYBOARD_RIGHT_SHIFT (1 << 1) +#define KEYBOARD_CTRL (1 << 2) +#define KEYBOARD_ALT (1 << 3) + +static int +grub_console_getkeystatus (void) +{ + grub_uint8_t status = bios_data_area->keyboard_flag_lower; + int mods = 0; + + if (status & (KEYBOARD_LEFT_SHIFT | KEYBOARD_RIGHT_SHIFT)) + mods |= GRUB_TERM_STATUS_SHIFT; + if (status & KEYBOARD_CTRL) + mods |= GRUB_TERM_STATUS_CTRL; + if (status & KEYBOARD_ALT) + mods |= GRUB_TERM_STATUS_ALT; + + return mods; +} + static struct grub_term_input grub_console_term_input = { .name = "console", .checkkey = grub_console_checkkey, .getkey = grub_console_getkey, + .getkeystatus = grub_console_getkeystatus, }; static struct grub_term_output grub_console_term_output = diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index bb62b35ed..7f5e058f7 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -58,6 +58,19 @@ static char keyboard_map_shift[128] = static grub_usb_device_t usbdev; +/* Valid values for bmRequestType. See HID definition version 1.11 section + 7.2. */ +#define USB_HID_HOST_TO_DEVICE 0x21 +#define USB_HID_DEVICE_TO_HOST 0x61 + +/* Valid values for bRequest. See HID definition version 1.11 section 7.2. */ +#define USB_HID_GET_REPORT 0x01 +#define USB_HID_GET_IDLE 0x02 +#define USB_HID_GET_PROTOCOL 0x03 +#define USB_HID_SET_REPORT 0x09 +#define USB_HID_SET_IDLE 0x0A +#define USB_HID_SET_PROTOCOL 0x0B + static void grub_usb_hid (void) { @@ -90,17 +103,19 @@ grub_usb_hid (void) grub_usb_iterate (usb_iterate); /* Place the device in boot mode. */ - grub_usb_control_msg (usbdev, 0x21, 0x0B, 0, 0, 0, 0); + grub_usb_control_msg (usbdev, USB_HID_HOST_TO_DEVICE, USB_HID_SET_PROTOCOL, + 0, 0, 0, 0); /* Reports every time an event occurs and not more often than that. */ - grub_usb_control_msg (usbdev, 0x21, 0x0A, 0<<8, 0, 0, 0); + grub_usb_control_msg (usbdev, USB_HID_HOST_TO_DEVICE, USB_HID_SET_IDLE, + 0<<8, 0, 0, 0); } static grub_err_t grub_usb_keyboard_getreport (grub_usb_device_t dev, grub_uint8_t *report) { - return grub_usb_control_msg (dev, (1 << 7) | (1 << 5) | 1, 0x01, 0, 0, - 8, (char *) report); + return grub_usb_control_msg (dev, USB_HID_DEVICE_TO_HOST, USB_HID_GET_REPORT, + 0, 0, 8, (char *) report); } @@ -151,7 +166,8 @@ grub_usb_keyboard_checkkey (void) /* Wait until the key is released. */ while (!err && data[2]) { - err = grub_usb_control_msg (usbdev, (1 << 7) | (1 << 5) | 1, 0x01, 0, 0, + err = grub_usb_control_msg (usbdev, USB_HID_DEVICE_TO_HOST, + USB_HID_GET_REPORT, 0, 0, sizeof (data), (char *) data); grub_dprintf ("usb_keyboard", "report2: 0x%02x 0x%02x 0x%02x 0x%02x" @@ -238,11 +254,67 @@ grub_usb_keyboard_getkey (void) return key; } +static int +grub_usb_keyboard_getkeystatus (void) +{ + grub_uint8_t data[8]; + int mods = 0; + grub_err_t err; + grub_uint64_t currtime; + int timeout = 50; + + /* Set idle time to the minimum offered by the spec (4 milliseconds) so + that we can find out the current state. */ + grub_usb_control_msg (usbdev, USB_HID_HOST_TO_DEVICE, USB_HID_SET_IDLE, + 0<<8, 0, 0, 0); + + currtime = grub_get_time_ms (); + do + { + /* Get_Report. */ + err = grub_usb_keyboard_getreport (usbdev, data); + + /* Implement a timeout. */ + if (grub_get_time_ms () > currtime + timeout) + break; + } + while (err || !data[0]); + + /* Go back to reporting every time an event occurs and not more often than + that. */ + grub_usb_control_msg (usbdev, USB_HID_HOST_TO_DEVICE, USB_HID_SET_IDLE, + 0<<8, 0, 0, 0); + + /* We allowed a while for modifiers to show up in the report, but it is + not an error if they never did. */ + if (err) + return -1; + + grub_dprintf ("usb_keyboard", + "report: 0x%02x 0x%02x 0x%02x 0x%02x" + " 0x%02x 0x%02x 0x%02x 0x%02x\n", + data[0], data[1], data[2], data[3], + data[4], data[5], data[6], data[7]); + + /* Check Shift, Control, and Alt status. */ + if (data[0] & 0x02 || data[0] & 0x20) + mods |= GRUB_TERM_STATUS_SHIFT; + if (data[0] & 0x01 || data[0] & 0x10) + mods |= GRUB_TERM_STATUS_CTRL; + if (data[0] & 0x04 || data[0] & 0x40) + mods |= GRUB_TERM_STATUS_ALT; + + grub_errno = GRUB_ERR_NONE; + + return mods; +} + static struct grub_term_input grub_usb_keyboard_term = { .name = "usb_keyboard", .checkkey = grub_usb_keyboard_checkkey, .getkey = grub_usb_keyboard_getkey, + .getkeystatus = grub_usb_keyboard_getkeystatus, .next = 0 }; From a57da43f0dda6c27fe208e65dd59bec5ed3907a4 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 28 Aug 2009 13:25:10 +0000 Subject: [PATCH 1075/1707] 2009-08-28 Colin Watson * normal/cmdline.c (grub_cmdline_get): Supply a format string as the first argument to grub_printf. --- ChangeLog | 5 +++++ normal/cmdline.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 691273fc6..b32de1b10 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-28 Colin Watson + + * normal/cmdline.c (grub_cmdline_get): Supply a format string as + the first argument to grub_printf. + 2009-08-28 Colin Watson 2009-08-28 Robert Millan diff --git a/normal/cmdline.c b/normal/cmdline.c index 56f892121..7a5b6ec84 100644 --- a/normal/cmdline.c +++ b/normal/cmdline.c @@ -273,7 +273,7 @@ grub_cmdline_get (const char *prompt, char cmdline[], unsigned max_len, if ((grub_getxy () >> 8) != 0) grub_putchar ('\n'); - grub_printf (prompt); + grub_printf ("%s", prompt); xpos = plen; ystart = ypos = (grub_getxy () & 0xFF); From e7c69859a263c62b5a28c353b415f9bb1526b8e2 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 28 Aug 2009 13:54:20 +0000 Subject: [PATCH 1076/1707] 2009-08-28 Vladimir Serbinenko 1-bit optimised blitters. * include/grub/fbblit.h (grub_video_fbblit_replace_32bit_1bit): New prototype. (grub_video_fbblit_replace_24bit_1bit): Likewise. (grub_video_fbblit_replace_16bit_1bit): Likewise. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit): Likewise. (grub_video_fbblit_blend_XXX565_1bit): Likewise. * video/fb/fbblit.c (grub_video_fbblit_replace_32bit_1bit): New function. (grub_video_fbblit_replace_24bit_1bit): Likewise. (grub_video_fbblit_replace_16bit_1bit): Likewise. (grub_video_fbblit_replace_8bit_1bit): Likewise. (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. (grub_video_fbblit_blend_XXX888_1bit): Likewise. (grub_video_fbblit_blend_XXX565_1bit): Likewise. * video/fb/video_fb.c (common_blitter): Use 1-bit optimised blitters when possible. * video/video.c (grub_video_get_blit_format): Return GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED if bpp = 1. --- ChangeLog | 25 ++ include/grub/fbblit.h | 48 ++++ video/fb/fbblit.c | 587 ++++++++++++++++++++++++++++++++++++++++++ video/fb/video_fb.c | 66 +++++ video/video.c | 2 + 5 files changed, 728 insertions(+) diff --git a/ChangeLog b/ChangeLog index b32de1b10..b43aa72ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,28 @@ +2009-08-28 Vladimir Serbinenko + + 1-bit optimised blitters. + + * include/grub/fbblit.h (grub_video_fbblit_replace_32bit_1bit): New + prototype. + (grub_video_fbblit_replace_24bit_1bit): Likewise. + (grub_video_fbblit_replace_16bit_1bit): Likewise. + (grub_video_fbblit_replace_8bit_1bit): Likewise. + (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. + (grub_video_fbblit_blend_XXX888_1bit): Likewise. + (grub_video_fbblit_blend_XXX565_1bit): Likewise. + * video/fb/fbblit.c (grub_video_fbblit_replace_32bit_1bit): New + function. + (grub_video_fbblit_replace_24bit_1bit): Likewise. + (grub_video_fbblit_replace_16bit_1bit): Likewise. + (grub_video_fbblit_replace_8bit_1bit): Likewise. + (grub_video_fbblit_blend_XXXA8888_1bit): Likewise. + (grub_video_fbblit_blend_XXX888_1bit): Likewise. + (grub_video_fbblit_blend_XXX565_1bit): Likewise. + * video/fb/video_fb.c (common_blitter): Use 1-bit optimised blitters + when possible. + * video/video.c (grub_video_get_blit_format): Return + GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED if bpp = 1. + 2009-08-28 Colin Watson * normal/cmdline.c (grub_cmdline_get): Supply a format string as diff --git a/include/grub/fbblit.h b/include/grub/fbblit.h index 664f508c5..af97dfb97 100644 --- a/include/grub/fbblit.h +++ b/include/grub/fbblit.h @@ -131,4 +131,52 @@ grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, int width, int height, int offset_x, int offset_y); +void +grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); + +void +grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y); #endif /* ! GRUB_FBBLIT_HEADER */ diff --git a/video/fb/fbblit.c b/video/fb/fbblit.c index 5b613bc79..a0f44d268 100644 --- a/video/fb/fbblit.c +++ b/video/fb/fbblit.c @@ -90,6 +90,302 @@ grub_video_fbblit_replace_directN (struct grub_video_fbblit_info *dst, } } +/* Optimized replacing blitter for 1-bit to 32bit. */ +void +grub_video_fbblit_replace_32bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + grub_uint8_t srcmask; + unsigned int dstrowskip; + unsigned int srcrowskipbyte, srcrowskipbit; + grub_uint32_t fgcolor, bgcolor; + int bit_index; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + srcrowskipbyte = (src->mode_info->width - width) >> 3; + srcrowskipbit = (src->mode_info->width - width) & 7; + + bit_index = offset_y * src->mode_info->width + offset_x; + srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcmask = 1 << (~bit_index & 7); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); + + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + src->mode_info->fg_green, + src->mode_info->fg_blue, + src->mode_info->fg_alpha); + + bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + src->mode_info->bg_green, + src->mode_info->bg_blue, + src->mode_info->bg_alpha); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + if (*srcptr & srcmask) + *(grub_uint32_t *) dstptr = fgcolor; + else + *(grub_uint32_t *) dstptr = bgcolor; + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + dstptr += 4; + } + + srcptr += srcrowskipbyte; + if (srcmask >> srcrowskipbit) + srcmask >>= srcrowskipbit; + else + { + srcptr++; + srcmask <<= 8 - srcrowskipbit; + } + dstptr += dstrowskip; + } +} + + +/* Optimized replacing blitter for 1-bit to 24-bit. */ +void +grub_video_fbblit_replace_24bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + grub_uint8_t srcmask; + unsigned int dstrowskip; + unsigned int srcrowskipbyte, srcrowskipbit; + grub_uint32_t fgcolor, bgcolor; + int bit_index; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + srcrowskipbyte = (src->mode_info->width - width) >> 3; + srcrowskipbit = (src->mode_info->width - width) & 7; + + bit_index = offset_y * src->mode_info->width + offset_x; + srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcmask = 1 << (~bit_index & 7); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); + + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + src->mode_info->fg_green, + src->mode_info->fg_blue, + src->mode_info->fg_alpha); + + bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + src->mode_info->bg_green, + src->mode_info->bg_blue, + src->mode_info->bg_alpha); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width - 1; i++) + { + if (*srcptr & srcmask) + *(grub_uint32_t *) dstptr = fgcolor; + else + *(grub_uint32_t *) dstptr = bgcolor; + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + dstptr += 3; + } + + if (*srcptr & srcmask) + { + *dstptr++ = fgcolor & 0xff; + *dstptr++ = (fgcolor & 0xff00) >> 8; + *dstptr++ = (fgcolor & 0xff0000) >> 16; + } + else + { + *dstptr++ = bgcolor & 0xff; + *dstptr++ = (bgcolor & 0xff00) >> 8; + *dstptr++ = (bgcolor & 0xff0000) >> 16; + } + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + srcptr += srcrowskipbyte; + if (srcmask >> srcrowskipbit) + srcmask >>= srcrowskipbit; + else + { + srcptr++; + srcmask <<= 8 - srcrowskipbit; + } + dstptr += dstrowskip; + } +} + +/* Optimized replacing blitter for 1-bit to 16-bit. */ +void +grub_video_fbblit_replace_16bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + grub_uint8_t srcmask; + unsigned int dstrowskip; + unsigned int srcrowskipbyte, srcrowskipbit; + grub_uint16_t fgcolor, bgcolor; + int bit_index; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + srcrowskipbyte = (src->mode_info->width - width) >> 3; + srcrowskipbit = (src->mode_info->width - width) & 7; + + bit_index = offset_y * src->mode_info->width + offset_x; + srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcmask = 1 << (~bit_index & 7); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); + + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + src->mode_info->fg_green, + src->mode_info->fg_blue, + src->mode_info->fg_alpha); + + bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + src->mode_info->bg_green, + src->mode_info->bg_blue, + src->mode_info->bg_alpha); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + if (*srcptr & srcmask) + *(grub_uint16_t *) dstptr = fgcolor; + else + *(grub_uint16_t *) dstptr = bgcolor; + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + dstptr += 2; + } + + srcptr += srcrowskipbyte; + if (srcmask >> srcrowskipbit) + srcmask >>= srcrowskipbit; + else + { + srcptr++; + srcmask <<= 8 - srcrowskipbit; + } + dstptr += dstrowskip; + } +} + +/* Optimized replacing blitter for 1-bit to 8-bit. */ +void +grub_video_fbblit_replace_8bit_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + grub_uint8_t srcmask; + unsigned int dstrowskip; + unsigned int srcrowskipbyte, srcrowskipbit; + grub_uint8_t fgcolor, bgcolor; + int bit_index; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + srcrowskipbyte = (src->mode_info->width - width) >> 3; + srcrowskipbit = (src->mode_info->width - width) & 7; + + bit_index = offset_y * src->mode_info->width + offset_x; + srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcmask = 1 << (~bit_index & 7); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); + + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + src->mode_info->fg_green, + src->mode_info->fg_blue, + src->mode_info->fg_alpha); + + bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + src->mode_info->bg_green, + src->mode_info->bg_blue, + src->mode_info->bg_alpha); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + if (*srcptr & srcmask) + *(grub_uint8_t *) dstptr = fgcolor; + else + *(grub_uint8_t *) dstptr = bgcolor; + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + dstptr++; + } + + srcptr += srcrowskipbyte; + if (srcmask >> srcrowskipbit) + srcmask >>= srcrowskipbit; + else + { + srcptr++; + srcmask <<= 8 - srcrowskipbit; + } + dstptr += dstrowskip; + } +} + /* Optimized replacing blitter for RGBX8888 to BGRX8888. */ void grub_video_fbblit_replace_BGRX8888_RGBX8888 (struct grub_video_fbblit_info *dst, @@ -826,3 +1122,294 @@ grub_video_fbblit_blend_index_RGBA8888 (struct grub_video_fbblit_info *dst, } } } + +/* Optimized blending blitter for 1-bit to XXXA8888. */ +void +grub_video_fbblit_blend_XXXA8888_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + grub_uint8_t srcmask; + unsigned int dstrowskip; + unsigned int srcrowskipbyte, srcrowskipbit; + grub_uint32_t fgcolor, bgcolor; + int bit_index; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + srcrowskipbyte = (src->mode_info->width - width) >> 3; + srcrowskipbit = (src->mode_info->width - width) & 7; + + bit_index = offset_y * src->mode_info->width + offset_x; + srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcmask = 1 << (~bit_index & 7); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); + + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + src->mode_info->fg_green, + src->mode_info->fg_blue, + src->mode_info->fg_alpha); + + bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + src->mode_info->bg_green, + src->mode_info->bg_blue, + src->mode_info->bg_alpha); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + grub_uint32_t color; + grub_uint8_t a; + + if (*srcptr & srcmask) + color = fgcolor; + else + color = bgcolor; + a = (color >> 24) & 0xff; + + if (a == 255) + *(grub_uint32_t *) dstptr = color; + else if (a != 0) + { + grub_uint8_t s1 = (color >> 0) & 0xFF; + grub_uint8_t s2 = (color >> 8) & 0xFF; + grub_uint8_t s3 = (color >> 16) & 0xFF; + + grub_uint8_t d1 = (*(grub_uint32_t *) dstptr >> 0) & 0xFF; + grub_uint8_t d2 = (*(grub_uint32_t *) dstptr >> 8) & 0xFF; + grub_uint8_t d3 = (*(grub_uint32_t *) dstptr >> 16) & 0xFF; + + d1 = (d1 * (255 - a) + s1 * a) / 255; + d2 = (d2 * (255 - a) + s2 * a) / 255; + d3 = (d3 * (255 - a) + s3 * a) / 255; + + *(grub_uint32_t *) dstptr = (a << 24) | (d3 << 16) | (d2 << 8) + | d1; + } + + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + dstptr += 4; + } + + srcptr += srcrowskipbyte; + if (srcmask >> srcrowskipbit) + srcmask >>= srcrowskipbit; + else + { + srcptr++; + srcmask <<= 8 - srcrowskipbit; + } + dstptr += dstrowskip; + } +} + +/* Optimized blending blitter for 1-bit to XXX888. */ +void +grub_video_fbblit_blend_XXX888_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + grub_uint8_t srcmask; + unsigned int dstrowskip; + unsigned int srcrowskipbyte, srcrowskipbit; + grub_uint32_t fgcolor, bgcolor; + int bit_index; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + srcrowskipbyte = (src->mode_info->width - width) >> 3; + srcrowskipbit = (src->mode_info->width - width) & 7; + + bit_index = offset_y * src->mode_info->width + offset_x; + srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcmask = 1 << (~bit_index & 7); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); + + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + src->mode_info->fg_green, + src->mode_info->fg_blue, + src->mode_info->fg_alpha); + + bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + src->mode_info->bg_green, + src->mode_info->bg_blue, + src->mode_info->bg_alpha); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + grub_uint32_t color; + grub_uint8_t a; + if (*srcptr & srcmask) + { + color = fgcolor; + a = src->mode_info->fg_alpha; + } + else + { + color = bgcolor; + a = src->mode_info->bg_alpha; + } + + if (a == 255) + { + ((grub_uint8_t *) dstptr)[0] = color & 0xff; + ((grub_uint8_t *) dstptr)[1] = (color & 0xff00) >> 8; + ((grub_uint8_t *) dstptr)[2] = (color & 0xff0000) >> 16; + } + else if (a != 0) + { + grub_uint8_t s1 = (color >> 0) & 0xFF; + grub_uint8_t s2 = (color >> 8) & 0xFF; + grub_uint8_t s3 = (color >> 16) & 0xFF; + + grub_uint8_t d1 = (*(grub_uint32_t *) dstptr >> 0) & 0xFF; + grub_uint8_t d2 = (*(grub_uint32_t *) dstptr >> 8) & 0xFF; + grub_uint8_t d3 = (*(grub_uint32_t *) dstptr >> 16) & 0xFF; + + ((grub_uint8_t *) dstptr)[0] = (d1 * (255 - a) + s1 * a) / 255; + ((grub_uint8_t *) dstptr)[1] = (d2 * (255 - a) + s2 * a) / 255; + ((grub_uint8_t *) dstptr)[2] = (d3 * (255 - a) + s3 * a) / 255; + } + + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + dstptr += 3; + } + + srcptr += srcrowskipbyte; + if (srcmask >> srcrowskipbit) + srcmask >>= srcrowskipbit; + else + { + srcptr++; + srcmask <<= 8 - srcrowskipbit; + } + dstptr += dstrowskip; + } +} + +/* Optimized blending blitter for 1-bit to XXX888. */ +void +grub_video_fbblit_blend_XXX565_1bit (struct grub_video_fbblit_info *dst, + struct grub_video_fbblit_info *src, + int x, int y, + int width, int height, + int offset_x, int offset_y) +{ + int i; + int j; + grub_uint8_t *srcptr; + grub_uint8_t *dstptr; + grub_uint8_t srcmask; + unsigned int dstrowskip; + unsigned int srcrowskipbyte, srcrowskipbit; + grub_uint16_t fgcolor, bgcolor; + int bit_index; + + /* Calculate the number of bytes to advance from the end of one line + to the beginning of the next line. */ + dstrowskip = dst->mode_info->pitch - dst->mode_info->bytes_per_pixel * width; + srcrowskipbyte = (src->mode_info->width - width) >> 3; + srcrowskipbit = (src->mode_info->width - width) & 7; + + bit_index = offset_y * src->mode_info->width + offset_x; + srcptr = (grub_uint8_t *) src->data + (bit_index >> 3); + srcmask = 1 << (~bit_index & 7); + dstptr = (grub_uint8_t *) grub_video_fb_get_video_ptr (dst, x, y); + + fgcolor = grub_video_fb_map_rgba (src->mode_info->fg_red, + src->mode_info->fg_green, + src->mode_info->fg_blue, + src->mode_info->fg_alpha); + + bgcolor = grub_video_fb_map_rgba (src->mode_info->bg_red, + src->mode_info->bg_green, + src->mode_info->bg_blue, + src->mode_info->bg_alpha); + + for (j = 0; j < height; j++) + { + for (i = 0; i < width; i++) + { + grub_uint32_t color; + grub_uint8_t a; + if (*srcptr & srcmask) + { + color = fgcolor; + a = src->mode_info->fg_alpha; + } + else + { + color = bgcolor; + a = src->mode_info->bg_alpha; + } + + if (a == 255) + *(grub_uint16_t *) dstptr = color; + else if (a != 0) + { + grub_uint8_t s1 = (color >> 0) & 0x1F; + grub_uint8_t s2 = (color >> 5) & 0x3F; + grub_uint8_t s3 = (color >> 11) & 0x1F; + + grub_uint8_t d1 = (*(grub_uint16_t *) dstptr >> 0) & 0x1F; + grub_uint8_t d2 = (*(grub_uint16_t *) dstptr >> 5) & 0x3F; + grub_uint8_t d3 = (*(grub_uint16_t *) dstptr >> 11) & 0x1F; + + d1 = (d1 * (255 - a) + s1 * a) / 255; + d2 = (d2 * (255 - a) + s2 * a) / 255; + d3 = (d3 * (255 - a) + s3 * a) / 255; + + *(grub_uint16_t *) dstptr = (d1 & 0x1f) | ((d2 & 0x3f) << 5) + | ((d3 & 0x1f) << 11); + } + + srcmask >>= 1; + if (!srcmask) + { + srcptr++; + srcmask = 0x80; + } + + dstptr += 2; + } + + srcptr += srcrowskipbyte; + if (srcmask >> srcrowskipbit) + srcmask >>= srcrowskipbit; + else + { + srcptr++; + srcmask <<= 8 - srcrowskipbit; + } + dstptr += dstrowskip; + } +} diff --git a/video/fb/video_fb.c b/video/fb/video_fb.c index a35dd7a4e..5f2917da6 100644 --- a/video/fb/video_fb.c +++ b/video/fb/video_fb.c @@ -587,6 +587,37 @@ common_blitter (struct grub_video_fbblit_info *target, return; } } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) + { + if (target->mode_info->bpp == 32) + { + grub_video_fbblit_replace_32bit_1bit (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->bpp == 24) + { + grub_video_fbblit_replace_24bit_1bit (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->bpp == 16) + { + grub_video_fbblit_replace_16bit_1bit (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->bpp == 8) + { + grub_video_fbblit_replace_8bit_1bit (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + } /* No optimized replace operator found, use default (slow) blitter. */ grub_video_fbblit_replace (target, source, x, y, width, height, @@ -674,6 +705,41 @@ common_blitter (struct grub_video_fbblit_info *target, return; } } + else if (source->mode_info->blit_format == GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED) + { + if (target->mode_info->blit_format + == GRUB_VIDEO_BLIT_FORMAT_BGRA_8888 + || target->mode_info->blit_format + == GRUB_VIDEO_BLIT_FORMAT_RGBA_8888) + { + grub_video_fbblit_blend_XXXA8888_1bit (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format + == GRUB_VIDEO_BLIT_FORMAT_BGR_888 + || target->mode_info->blit_format + == GRUB_VIDEO_BLIT_FORMAT_RGB_888) + { + grub_video_fbblit_blend_XXX888_1bit (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + else if (target->mode_info->blit_format + == GRUB_VIDEO_BLIT_FORMAT_BGR_565 + || target->mode_info->blit_format + == GRUB_VIDEO_BLIT_FORMAT_RGB_565) + { + grub_video_fbblit_blend_XXX565_1bit (target, source, + x, y, width, height, + offset_x, offset_y); + return; + } + + } + /* No optimized blend operation found, use default (slow) blitter. */ grub_video_fbblit_blend (target, source, x, y, width, height, diff --git a/video/video.c b/video/video.c index 36ebfd1b8..c1d66bdd0 100644 --- a/video/video.c +++ b/video/video.c @@ -181,6 +181,8 @@ grub_video_get_blit_format (struct grub_video_mode_info *mode_info) return GRUB_VIDEO_BLIT_FORMAT_RGB_565; } } + else if (mode_info->bpp == 1) + return GRUB_VIDEO_BLIT_FORMAT_1BIT_PACKED; /* Backup route. Unknown format. */ From b4f34077c8a94d66cc1d22d613eba27c49781725 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 28 Aug 2009 14:10:02 +0000 Subject: [PATCH 1077/1707] 2009-08-28 Colin Watson * term/i386/pc/console.c (bios_data_area): Cast GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR explicitly. --- ChangeLog | 5 +++++ term/i386/pc/console.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b43aa72ba..1858a9cbb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-28 Colin Watson + + * term/i386/pc/console.c (bios_data_area): Cast + GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR explicitly. + 2009-08-28 Vladimir Serbinenko 1-bit optimised blitters. diff --git a/term/i386/pc/console.c b/term/i386/pc/console.c index ec1383942..66475d456 100644 --- a/term/i386/pc/console.c +++ b/term/i386/pc/console.c @@ -21,7 +21,8 @@ #include #include -static const struct grub_machine_bios_data_area *bios_data_area = GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; +static const struct grub_machine_bios_data_area *bios_data_area = + (struct grub_machine_bios_data_area *) GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; #define KEYBOARD_LEFT_SHIFT (1 << 0) #define KEYBOARD_RIGHT_SHIFT (1 << 1) From 6f07b921bc5e60fde59fb10cb68896c6124b3335 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 28 Aug 2009 16:29:34 +0000 Subject: [PATCH 1078/1707] 2009-08-28 Vladimir Serbinenko * kern/file.c (grub_file_read): Check offset. * fs/hfs.c (grub_hfs_read_file): Remove unnecessary offset check. * fs/jfs.c (grub_jfs_read_file): Likewise. * fs/ntfs.c (grub_ntfs_read): Likewise. * fs/reiserfs.c (grub_reiserfs_read): Likewise. * fs/minix.c (grub_minix_read_file): Correct offset check. * fs/ufs.c (grub_ufs_read_file): Likewise. --- ChangeLog | 10 ++++++++++ fs/hfs.c | 4 ---- fs/jfs.c | 4 ---- fs/minix.c | 4 ++-- fs/ntfs.c | 9 --------- fs/reiserfs.c | 3 --- fs/ufs.c | 4 ++-- kern/file.c | 7 +++++++ 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1858a9cbb..b657885fe 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-08-28 Vladimir Serbinenko + + * kern/file.c (grub_file_read): Check offset. + * fs/hfs.c (grub_hfs_read_file): Remove unnecessary offset check. + * fs/jfs.c (grub_jfs_read_file): Likewise. + * fs/ntfs.c (grub_ntfs_read): Likewise. + * fs/reiserfs.c (grub_reiserfs_read): Likewise. + * fs/minix.c (grub_minix_read_file): Correct offset check. + * fs/ufs.c (grub_ufs_read_file): Likewise. + 2009-08-28 Colin Watson * term/i386/pc/console.c (bios_data_area): Cast diff --git a/fs/hfs.c b/fs/hfs.c index 2f0702cbb..5062b5f71 100644 --- a/fs/hfs.c +++ b/fs/hfs.c @@ -243,10 +243,6 @@ grub_hfs_read_file (struct grub_hfs_data *data, int i; int blockcnt; - /* Adjust len so it we can't read past the end of the file. */ - if (len > grub_le_to_cpu32 (data->size)) - len = grub_le_to_cpu32 (data->size); - blockcnt = ((len + pos) + data->blksz - 1) / data->blksz; diff --git a/fs/jfs.c b/fs/jfs.c index 51ca91ad0..b73f9bdd4 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -544,10 +544,6 @@ grub_jfs_read_file (struct grub_jfs_data *data, int i; int blockcnt; - /* Adjust len so it we can't read past the end of the file. */ - if (len > data->currinode.size) - len = data->currinode.size; - blockcnt = ((len + pos + grub_le_to_cpu32 (data->sblock.blksz) - 1) / grub_le_to_cpu32 (data->sblock.blksz)); diff --git a/fs/minix.c b/fs/minix.c index 44218fb89..08eb60729 100644 --- a/fs/minix.c +++ b/fs/minix.c @@ -193,8 +193,8 @@ grub_minix_read_file (struct grub_minix_data *data, int blockcnt; /* Adjust len so it we can't read past the end of the file. */ - if (len > GRUB_MINIX_INODE_SIZE (data)) - len = GRUB_MINIX_INODE_SIZE (data); + if (len + pos > GRUB_MINIX_INODE_SIZE (data)) + len = GRUB_MINIX_INODE_SIZE (data) - pos; blockcnt = (len + pos + GRUB_MINIX_BSIZE - 1) / GRUB_MINIX_BSIZE; diff --git a/fs/ntfs.c b/fs/ntfs.c index d03a94016..3ff487c6e 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -970,15 +970,6 @@ grub_ntfs_read (grub_file_t file, char *buf, grub_size_t len) if (file->read_hook) mft->attr.save_pos = 1; - if (file->offset > file->size) - { - grub_error (GRUB_ERR_BAD_FS, "Bad offset"); - return -1; - } - - if (file->offset + len > file->size) - len = file->size - file->offset; - read_attr (&mft->attr, buf, file->offset, len, 1, file->read_hook); return (grub_errno) ? 0 : len; } diff --git a/fs/reiserfs.c b/fs/reiserfs.c index 04d33150f..fb4f1bc59 100644 --- a/fs/reiserfs.c +++ b/fs/reiserfs.c @@ -1077,9 +1077,6 @@ grub_reiserfs_read (grub_file_t file, char *buf, grub_size_t len) grub_disk_addr_t block; grub_off_t offset; - if (file->offset >= file->size) - return 0; - key.directory_id = node->header.key.directory_id; key.object_id = node->header.key.object_id; key.u.v2.offset_type = 0; diff --git a/fs/ufs.c b/fs/ufs.c index 797a45d13..c94ad9922 100644 --- a/fs/ufs.c +++ b/fs/ufs.c @@ -290,8 +290,8 @@ grub_ufs_read_file (struct grub_ufs_data *data, int blockcnt; /* Adjust len so it we can't read past the end of the file. */ - if (len > INODE_SIZE (data)) - len = INODE_SIZE (data); + if (len + pos > INODE_SIZE (data)) + len = INODE_SIZE (data) - pos; blockcnt = (len + pos + UFS_BLKSZ (sblock) - 1) / UFS_BLKSZ (sblock); diff --git a/kern/file.c b/kern/file.c index 9b56b88e4..22f2f6093 100644 --- a/kern/file.c +++ b/kern/file.c @@ -112,6 +112,13 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) { grub_ssize_t res; + if (file->offset > file->size) + { + grub_error (GRUB_ERR_OUT_OF_RANGE, + "Attempt to read pat the end of file."); + return -1; + } + if (len == 0 || len > file->size - file->offset) len = file->size - file->offset; From fd4370fc338ab1d9b2a475b248b3627f17281990 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 28 Aug 2009 20:09:44 +0200 Subject: [PATCH 1079/1707] Move grub_usb_get_string. --- ChangeLog | 7 +++++++ bus/usb/usb.c | 36 ---------------------------------- commands/usbtest.c | 48 +++++++++++++++++++++++++++++++++++++++++++--- include/grub/usb.h | 3 --- 4 files changed, 52 insertions(+), 42 deletions(-) diff --git a/ChangeLog b/ChangeLog index b657885fe..3e8d2533b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-28 Vladimir Serbinenko + + * bus/usb/usb.c (grub_usb_get_string): Move from here ... + * commands/usbtest.c (grub_usb_get_string): ... move here. + (usb_print_str): Fix error handling. + * include/grub/usb.h (grub_usb_get_string): Remove. + 2009-08-28 Vladimir Serbinenko * kern/file.c (grub_file_read): Check offset. diff --git a/bus/usb/usb.c b/bus/usb/usb.c index 310b8cc6a..8289185da 100644 --- a/bus/usb/usb.c +++ b/bus/usb/usb.c @@ -155,42 +155,6 @@ grub_usb_get_endpdescriptor (grub_usb_device_t usbdev, int addr) return NULL; } -grub_usb_err_t -grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, int langid, - char **string) -{ - struct grub_usb_desc_str descstr; - struct grub_usb_desc_str *descstrp; - grub_usb_err_t err; - - /* Only get the length. */ - err = grub_usb_control_msg (dev, 1 << 7, - 0x06, (3 << 8) | index, - langid, 1, (char *) &descstr); - if (err) - return err; - - descstrp = grub_malloc (descstr.length); - if (! descstrp) - return GRUB_USB_ERR_INTERNAL; - err = grub_usb_control_msg (dev, 1 << 7, - 0x06, (3 << 8) | index, - langid, descstr.length, (char *) descstrp); - - *string = grub_malloc (descstr.length / 2); - if (! *string) - { - grub_free (descstrp); - return GRUB_USB_ERR_INTERNAL; - } - - grub_utf16_to_utf8 ((grub_uint8_t *) *string, descstrp->str, descstrp->length / 2 - 1); - (*string)[descstr.length / 2 - 1] = '\0'; - grub_free (descstrp); - - return GRUB_USB_ERR_NONE; -} - grub_usb_err_t grub_usb_device_initialize (grub_usb_device_t dev) { diff --git a/commands/usbtest.c b/commands/usbtest.c index 018c1a25b..1c49d8104 100644 --- a/commands/usbtest.c +++ b/commands/usbtest.c @@ -59,18 +59,60 @@ static const char *usb_devspeed[] = "High" }; +static grub_usb_err_t +grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, int langid, + char **string) +{ + struct grub_usb_desc_str descstr; + struct grub_usb_desc_str *descstrp; + grub_usb_err_t err; + + /* Only get the length. */ + err = grub_usb_control_msg (dev, 1 << 7, + 0x06, (3 << 8) | index, + langid, 1, (char *) &descstr); + if (err) + return err; + + descstrp = grub_malloc (descstr.length); + if (! descstrp) + return GRUB_USB_ERR_INTERNAL; + err = grub_usb_control_msg (dev, 1 << 7, + 0x06, (3 << 8) | index, + langid, descstr.length, (char *) descstrp); + + *string = grub_malloc (descstr.length / 2); + if (! *string) + { + grub_free (descstrp); + return GRUB_USB_ERR_INTERNAL; + } + + grub_utf16_to_utf8 ((grub_uint8_t *) *string, descstrp->str, descstrp->length / 2 - 1); + (*string)[descstr.length / 2 - 1] = '\0'; + grub_free (descstrp); + + return GRUB_USB_ERR_NONE; +} + static void usb_print_str (const char *description, grub_usb_device_t dev, int idx) { char *name; + grub_usb_err_t err; /* XXX: LANGID */ if (! idx) return; - grub_usb_get_string (dev, idx, 0x0409, &name); - grub_printf ("%s: `%s'\n", description, name); - grub_free (name); + err = grub_usb_get_string (dev, idx, 0x0409, &name); + if (err) + grub_printf ("Error %d retrieving %s\n", err, description); + else + { + grub_printf ("%s: `%s'\n", description, name); + grub_free (name); + } } static int diff --git a/include/grub/usb.h b/include/grub/usb.h index 8dd3b6e2e..dc90e7879 100644 --- a/include/grub/usb.h +++ b/include/grub/usb.h @@ -64,9 +64,6 @@ grub_usb_err_t grub_usb_clear_halt (grub_usb_device_t dev, int endpoint); grub_usb_err_t grub_usb_set_configuration (grub_usb_device_t dev, int configuration); -grub_usb_err_t grub_usb_get_string (grub_usb_device_t dev, grub_uint8_t index, - int langid, char **string); - void grub_usb_controller_dev_register (grub_usb_controller_dev_t usb); void grub_usb_controller_dev_unregister (grub_usb_controller_dev_t usb); From b8dae8de40888ec7ef446dc14649f649733db06d Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 28 Aug 2009 20:58:50 +0200 Subject: [PATCH 1080/1707] utf16_to_utf8 --- fs/fat.c | 1 + fs/hfsplus.c | 1 + fs/iso9660.c | 1 + fs/jfs.c | 1 + fs/ntfs.c | 1 + include/grub/charset.h | 84 ++++++++++++++++++++++++++++++++++++++++ include/grub/misc.h | 3 -- kern/efi/efi.c | 1 + kern/misc.c | 62 ----------------------------- loader/efi/chainloader.c | 1 + 10 files changed, 91 insertions(+), 65 deletions(-) create mode 100644 include/grub/charset.h diff --git a/fs/fat.c b/fs/fat.c index 8440e43fa..e4a072952 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -25,6 +25,7 @@ #include #include #include +#include #define GRUB_FAT_DIR_ENTRY_SIZE 32 diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 5e0ab093f..3c2e0c7bd 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -28,6 +28,7 @@ #include #include #include +#include #define GRUB_HFSPLUS_MAGIC 0x482B #define GRUB_HFSPLUSX_MAGIC 0x4858 diff --git a/fs/iso9660.c b/fs/iso9660.c index 9b7ce765b..976222a45 100644 --- a/fs/iso9660.c +++ b/fs/iso9660.c @@ -26,6 +26,7 @@ #include #include #include +#include #define GRUB_ISO9660_FSTYPE_DIR 0040000 #define GRUB_ISO9660_FSTYPE_REG 0100000 diff --git a/fs/jfs.c b/fs/jfs.c index b73f9bdd4..589b6ae5a 100644 --- a/fs/jfs.c +++ b/fs/jfs.c @@ -24,6 +24,7 @@ #include #include #include +#include #define GRUB_JFS_MAX_SYMLNK_CNT 8 #define GRUB_JFS_FILETYPE_MASK 0170000 diff --git a/fs/ntfs.c b/fs/ntfs.c index 3ff487c6e..ab75ccc63 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -24,6 +24,7 @@ #include #include #include +#include static grub_dl_t my_mod; diff --git a/include/grub/charset.h b/include/grub/charset.h new file mode 100644 index 000000000..b1db51f24 --- /dev/null +++ b/include/grub/charset.h @@ -0,0 +1,84 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CHARSET_HEADER +#define GRUB_CHARSET_HEADER 1 + +/* Convert UTF-16 to UTF-8. */ +static inline grub_uint8_t * +grub_utf16_to_utf8 (grub_uint8_t *dest, grub_uint16_t *src, + grub_size_t size) +{ + grub_uint32_t code_high = 0; + + while (size--) + { + grub_uint32_t code = *src++; + + if (code_high) + { + if (code >= 0xDC00 && code <= 0xDFFF) + { + /* Surrogate pair. */ + code = ((code_high - 0xD800) << 12) + (code - 0xDC00) + 0x10000; + + *dest++ = (code >> 18) | 0xF0; + *dest++ = ((code >> 12) & 0x3F) | 0x80; + *dest++ = ((code >> 6) & 0x3F) | 0x80; + *dest++ = (code & 0x3F) | 0x80; + } + else + { + /* Error... */ + *dest++ = '?'; + } + + code_high = 0; + } + else + { + if (code <= 0x007F) + *dest++ = code; + else if (code <= 0x07FF) + { + *dest++ = (code >> 6) | 0xC0; + *dest++ = (code & 0x3F) | 0x80; + } + else if (code >= 0xD800 && code <= 0xDBFF) + { + code_high = code; + continue; + } + else if (code >= 0xDC00 && code <= 0xDFFF) + { + /* Error... */ + *dest++ = '?'; + } + else + { + *dest++ = (code >> 12) | 0xE0; + *dest++ = ((code >> 6) & 0x3F) | 0x80; + *dest++ = (code & 0x3F) | 0x80; + } + } + } + + return dest; +} + +#endif diff --git a/include/grub/misc.h b/include/grub/misc.h index a63a0b442..51a4650c8 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -177,9 +177,6 @@ int EXPORT_FUNC(grub_sprintf) (char *str, const char *fmt, ...) __attribute__ (( int EXPORT_FUNC(grub_vsprintf) (char *str, const char *fmt, va_list args); void EXPORT_FUNC(grub_exit) (void) __attribute__ ((noreturn)); void EXPORT_FUNC(grub_abort) (void) __attribute__ ((noreturn)); -grub_uint8_t *EXPORT_FUNC(grub_utf16_to_utf8) (grub_uint8_t *dest, - grub_uint16_t *src, - grub_size_t size); grub_ssize_t EXPORT_FUNC(grub_utf8_to_ucs4) (grub_uint32_t *dest, grub_size_t destsize, const grub_uint8_t *src, diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 8e09a90c0..7be7882a3 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -18,6 +18,7 @@ */ #include +#include #include #include #include diff --git a/kern/misc.c b/kern/misc.c index 1c38fe661..b5e41d1aa 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -837,68 +837,6 @@ grub_sprintf (char *str, const char *fmt, ...) return ret; } -/* Convert UTF-16 to UTF-8. */ -grub_uint8_t * -grub_utf16_to_utf8 (grub_uint8_t *dest, grub_uint16_t *src, - grub_size_t size) -{ - grub_uint32_t code_high = 0; - - while (size--) - { - grub_uint32_t code = *src++; - - if (code_high) - { - if (code >= 0xDC00 && code <= 0xDFFF) - { - /* Surrogate pair. */ - code = ((code_high - 0xD800) << 12) + (code - 0xDC00) + 0x10000; - - *dest++ = (code >> 18) | 0xF0; - *dest++ = ((code >> 12) & 0x3F) | 0x80; - *dest++ = ((code >> 6) & 0x3F) | 0x80; - *dest++ = (code & 0x3F) | 0x80; - } - else - { - /* Error... */ - *dest++ = '?'; - } - - code_high = 0; - } - else - { - if (code <= 0x007F) - *dest++ = code; - else if (code <= 0x07FF) - { - *dest++ = (code >> 6) | 0xC0; - *dest++ = (code & 0x3F) | 0x80; - } - else if (code >= 0xD800 && code <= 0xDBFF) - { - code_high = code; - continue; - } - else if (code >= 0xDC00 && code <= 0xDFFF) - { - /* Error... */ - *dest++ = '?'; - } - else - { - *dest++ = (code >> 12) | 0xE0; - *dest++ = ((code >> 6) & 0x3F) | 0x80; - *dest++ = (code & 0x3F) | 0x80; - } - } - } - - return dest; -} - /* Convert a (possibly null-terminated) UTF-8 string of at most SRCSIZE bytes (if SRCSIZE is -1, it is ignored) in length to a UCS-4 string. Return the number of characters converted. DEST must be able to hold diff --git a/loader/efi/chainloader.c b/loader/efi/chainloader.c index 01acc4135..9c833e9b9 100644 --- a/loader/efi/chainloader.c +++ b/loader/efi/chainloader.c @@ -25,6 +25,7 @@ #include #include #include +#include #include #include #include From 49ffc6c6273eec1af1b28395ff56b898e1612731 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 28 Aug 2009 20:59:54 +0200 Subject: [PATCH 1081/1707] finished merge --- commands/usbtest.c | 1 + 1 file changed, 1 insertion(+) diff --git a/commands/usbtest.c b/commands/usbtest.c index 1c49d8104..3405c3b4d 100644 --- a/commands/usbtest.c +++ b/commands/usbtest.c @@ -19,6 +19,7 @@ #include #include +#include #include #include #include From 74f391dded3f4d86c5f75192b8049b0c047f5615 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 28 Aug 2009 21:17:23 +0200 Subject: [PATCH 1082/1707] Changelog --- ChangeLog | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 3e8d2533b..6e424b3fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-08-28 Vladimir Serbinenko + + * kern/misc.c (grub_utf16_to_utf8): Move from here ... + * include/grub/charset.h (grub_utf16_to_utf8): ... to here. Inlined. + All users updated. + * include/grub/misc.h (grub_utf16_to_utf8): Removed. + 2009-08-28 Vladimir Serbinenko * bus/usb/usb.c (grub_usb_get_string): Move from here ... From d8888b5cb4f098d2c0758396ca52e99c0984b203 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 29 Aug 2009 00:24:32 +0000 Subject: [PATCH 1083/1707] 2009-08-29 Robert Millan * term/i386/pc/serial.c: Include `'. [GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Macroify initialization value (0x0400 -> GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR). [! GRUB_MACHINE_PCBIOS] (GRUB_SERIAL_PORT_NUM): Calculate using `ARRAY_SIZE' macro. --- ChangeLog | 10 ++++++++++ term/i386/pc/serial.c | 8 ++++---- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b657885fe..66b8371dd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-08-29 Robert Millan + + * term/i386/pc/serial.c: Include `'. + + [GRUB_MACHINE_PCBIOS] (serial_hw_io_addr): Macroify initialization + value (0x0400 -> GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR). + + [! GRUB_MACHINE_PCBIOS] (GRUB_SERIAL_PORT_NUM): Calculate using + `ARRAY_SIZE' macro. + 2009-08-28 Vladimir Serbinenko * kern/file.c (grub_file_read): Check offset. diff --git a/term/i386/pc/serial.c b/term/i386/pc/serial.c index 195f73670..1d74dbbc8 100644 --- a/term/i386/pc/serial.c +++ b/term/i386/pc/serial.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2000,2001,2002,2003,2004,2005,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -17,6 +17,7 @@ */ #include +#include #include #include #include @@ -64,12 +65,11 @@ struct serial_port static struct serial_port serial_settings; #ifdef GRUB_MACHINE_PCBIOS -/* The BIOS data area. */ -static const unsigned short *serial_hw_io_addr = (const unsigned short *) 0x0400; +static const unsigned short *serial_hw_io_addr = (const unsigned short *) GRUB_MEMORY_MACHINE_BIOS_DATA_AREA_ADDR; #define GRUB_SERIAL_PORT_NUM 4 #else static const unsigned short serial_hw_io_addr[] = { 0x3f8, 0x2f8, 0x3e8, 0x2e8 }; -#define GRUB_SERIAL_PORT_NUM (sizeof(serial_hw_io_addr)/sizeof(serial_hw_io_addr[0])) +#define GRUB_SERIAL_PORT_NUM (ARRAY_SIZE(serial_hw_io_addr)) #endif /* Return the port number for the UNITth serial device. */ From c90edae43aba3a15010b8502f403cc6bc9106504 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 29 Aug 2009 00:34:33 +0000 Subject: [PATCH 1084/1707] 2009-08-29 Robert Millan * util/grub.d/10_freebsd.in: Detect `ufs1' and `ufs2' and map them to `ufs' in the vfs.root.mountfrom kernel parameter. --- ChangeLog | 5 +++++ util/grub.d/10_freebsd.in | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66b8371dd..0f4ca8fbd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-29 Robert Millan + + * util/grub.d/10_freebsd.in: Detect `ufs1' and `ufs2' and map them + to `ufs' in the vfs.root.mountfrom kernel parameter. + 2009-08-29 Robert Millan * term/i386/pc/serial.c: Include `'. diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 64d2cc4c0..1e3a0de1f 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -50,8 +50,10 @@ if [ "x$kfreebsd" != "x" ] ; then devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` fi - # For "ufs" it's the same. Do we care about the others? - kfreebsd_fs=${GRUB_FS} + case ${GRUB_FS} in + ufs1 | ufs2) kfreebsd_fs=ufs ;; + *) kfreebsd_fs=${GRUB_FS} ;; + esac cat << EOF menuentry "${OS}" { From 64bf71d0b177d92aa706b8300dee8425baa6d0e9 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sat, 29 Aug 2009 12:57:38 +0000 Subject: [PATCH 1085/1707] 2009-08-28 Vladimir Serbinenko * include/grub/i386/xnu.h: Add license header. include grub/err.h explicitly. --- ChangeLog | 5 +++++ include/grub/i386/xnu.h | 20 ++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 0f4ca8fbd..217a433fa 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-28 Vladimir Serbinenko + + * include/grub/i386/xnu.h: Add license header. + include grub/err.h explicitly. + 2009-08-29 Robert Millan * util/grub.d/10_freebsd.in: Detect `ufs1' and `ufs2' and map them diff --git a/include/grub/i386/xnu.h b/include/grub/i386/xnu.h index ebc38eb61..68674e605 100644 --- a/include/grub/i386/xnu.h +++ b/include/grub/i386/xnu.h @@ -1,6 +1,26 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + #ifndef GRUB_CPU_XNU_H #define GRUB_CPU_XNU_H 1 +#include + #define GRUB_XNU_PAGESIZE 4096 typedef grub_uint32_t grub_xnu_ptr_t; From 965632c10f764c63b70c17bd3f4cd5e8acba5ade Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 30 Aug 2009 14:26:41 +0200 Subject: [PATCH 1086/1707] snow32 support. --- include/grub/i386/xnu.h | 2 +- include/grub/xnu.h | 2 ++ loader/xnu.c | 47 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 50 insertions(+), 1 deletion(-) diff --git a/include/grub/i386/xnu.h b/include/grub/i386/xnu.h index 68674e605..57ba0f0b6 100644 --- a/include/grub/i386/xnu.h +++ b/include/grub/i386/xnu.h @@ -64,7 +64,7 @@ struct grub_xnu_boot_params /* Size of grub_efi_uintn_t in bits. */ grub_uint8_t efi_uintnbits; } __attribute__ ((packed)); -#define GRUB_XNU_BOOTARGS_VERMINOR 4 +#define GRUB_XNU_BOOTARGS_VERMINOR 5 #define GRUB_XNU_BOOTARGS_VERMAJOR 1 extern grub_uint32_t grub_xnu_entry_point; diff --git a/include/grub/xnu.h b/include/grub/xnu.h index c3902e670..67d78d92c 100644 --- a/include/grub/xnu.h +++ b/include/grub/xnu.h @@ -76,6 +76,8 @@ struct grub_xnu_extheader grub_uint32_t infoplistsize; grub_uint32_t binaryaddr; grub_uint32_t binarysize; + grub_uint32_t nameaddr; + grub_uint32_t namesize; } __attribute__ ((packed)); struct grub_xnu_devtree_key *grub_xnu_create_key (struct grub_xnu_devtree_key **parent, diff --git a/loader/xnu.c b/loader/xnu.c index aac4ae372..1f29b69a1 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -494,6 +494,34 @@ grub_xnu_register_memory (char *prefix, int *suffix, return GRUB_ERR_NONE; } +static inline char * +get_name_ptr (char *name) +{ + char *p = name, *p2; + /* Skip Info.plist. */ + p2 = grub_strrchr (p, '/'); + if (!p2) + return name; + if (p2 == name) + return name + 1; + p = p2 - 1; + + p2 = grub_strrchr (p, '/'); + if (!p2) + return name; + if (p2 == name) + return name + 1; + if (grub_memcmp (p2, "/Contents/", sizeof ("/Contents/") - 1) != 0) + return p2 + 1; + + p = p2 - 1; + + p2 = grub_strrchr (p, '/'); + if (!p2) + return name; + return p2 + 1; +} + /* Load .kext. */ static grub_err_t grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) @@ -505,6 +533,18 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) int neededspace = sizeof (*exthead); char *buf; grub_size_t infoplistsize = 0, machosize = 0; + char *name, *nameend; + int namelen; + + name = get_name_ptr (infoplistname); + nameend = grub_strchr (name, '/'); + + if (nameend) + namelen = nameend - name; + else + namelen = grub_strlen (name); + + neededspace += namelen + 1; if (! grub_xnu_heap_size) return grub_error (GRUB_ERR_BAD_OS, "no xnu kernel loaded"); @@ -581,9 +621,16 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) } grub_file_close (infoplist); buf[infoplistsize] = 0; + buf += infoplistsize + 1; } grub_errno = GRUB_ERR_NONE; + exthead->nameaddr = (buf - grub_xnu_heap_start) + grub_xnu_heap_will_be_at; + exthead->namesize = namelen + 1; + grub_memcpy (buf, name, namelen); + buf[namelen] = 0; + buf += namelen + 1; + /* Announce to kernel */ return grub_xnu_register_memory ("Driver-", &driversnum, exthead, neededspace); From 5c90cdd262f71239c93652885897ef2261f19c59 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 30 Aug 2009 15:08:50 +0000 Subject: [PATCH 1087/1707] date fix --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 217a433fa..f953a3e56 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,4 @@ -2009-08-28 Vladimir Serbinenko +2009-08-29 Vladimir Serbinenko * include/grub/i386/xnu.h: Add license header. include grub/err.h explicitly. From cc55302e001c463244e6740c6101f9630143ce1f Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 30 Aug 2009 15:12:48 +0000 Subject: [PATCH 1088/1707] 2009-08-30 Robert Millan * configure.ac: Bump version to 1.97~beta1. * docs/version.texi: Likewise. --- ChangeLog | 5 +++++ configure.ac | 2 +- docs/version.texi | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f953a3e56..66c5711ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-30 Robert Millan + + * configure.ac: Bump version to 1.97~beta1. + * docs/version.texi: Likewise. + 2009-08-29 Vladimir Serbinenko * include/grub/i386/xnu.h: Add license header. diff --git a/configure.ac b/configure.ac index 549b35c9b..cddd9fe2d 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT([GRUB],[1.96],[bug-grub@gnu.org]) +AC_INIT([GRUB],[1.97~beta1],[bug-grub@gnu.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) diff --git a/docs/version.texi b/docs/version.texi index 5a03fa3c9..4528c7b2e 100644 --- a/docs/version.texi +++ b/docs/version.texi @@ -1,4 +1,4 @@ @set UPDATED 7 Ago 2009 @set UPDATED-MONTH Ago 2009 -@set EDITION 1.97~snapshot -@set VERSION 1.97~snapshot +@set EDITION 1.97~beta1 +@set VERSION 1.97~beta1 From fe00f472fc546b54bec742f0eb5b6b1195061335 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 30 Aug 2009 19:28:01 +0000 Subject: [PATCH 1089/1707] 2009-08-30 Vladimir Serbinenko * loader/i386/bsdXX.c (SUFFIX (grub_freebsd_load_elfmodule)): Fix loading of headers in some cases. --- ChangeLog | 5 +++++ loader/i386/bsdXX.c | 12 ++++++------ 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 66c5711ee..d4f1d894e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-08-30 Vladimir Serbinenko + + * loader/i386/bsdXX.c (SUFFIX (grub_freebsd_load_elfmodule)): Fix + loading of headers in some cases. + 2009-08-30 Robert Millan * configure.ac: Bump version to 1.97~beta1. diff --git a/loader/i386/bsdXX.c b/loader/i386/bsdXX.c index 3f15579dd..aedc204b2 100644 --- a/loader/i386/bsdXX.c +++ b/loader/i386/bsdXX.c @@ -197,15 +197,15 @@ SUFFIX (grub_freebsd_load_elfmodule) (grub_file_t file, int argc, char *argv[], if (curload < module + sizeof (e)) curload = module + sizeof (e); - load (file, UINT_TO_PTR (module + e.e_shoff), e.e_shoff, + load (file, UINT_TO_PTR (curload), e.e_shoff, e.e_shnum * e.e_shentsize); - if (curload < module + e.e_shoff + e.e_shnum * e.e_shentsize) - curload = module + e.e_shoff + e.e_shnum * e.e_shentsize; + e.e_shoff = curload - module; + curload += e.e_shnum * e.e_shentsize; - load (file, UINT_TO_PTR (module + e.e_phoff), e.e_phoff, + load (file, UINT_TO_PTR (curload), e.e_phoff, e.e_phnum * e.e_phentsize); - if (curload < module + e.e_phoff + e.e_phnum * e.e_phentsize) - curload = module + e.e_phoff + e.e_phnum * e.e_phentsize; + e.e_phoff = curload - module; + curload += e.e_phnum * e.e_phentsize; *kern_end = curload; From b5e7312c4335b3bb6a0b784171541dcba83664d3 Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 30 Aug 2009 20:19:09 +0000 Subject: [PATCH 1090/1707] 2009-08-30 Vladimir Serbinenko * kern/file.c (grub_file_read): Spelling fix --- ChangeLog | 4 ++++ kern/file.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d4f1d894e..84dd6e4a7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-08-30 Vladimir Serbinenko + + * kern/file.c (grub_file_read): Spelling fix + 2009-08-30 Vladimir Serbinenko * loader/i386/bsdXX.c (SUFFIX (grub_freebsd_load_elfmodule)): Fix diff --git a/kern/file.c b/kern/file.c index 22f2f6093..f713acbca 100644 --- a/kern/file.c +++ b/kern/file.c @@ -115,7 +115,7 @@ grub_file_read (grub_file_t file, void *buf, grub_size_t len) if (file->offset > file->size) { grub_error (GRUB_ERR_OUT_OF_RANGE, - "Attempt to read pat the end of file."); + "Attempt to read past the end of file."); return -1; } From 31aba781b65308f95a6f82f7c32156b748e8be2b Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 1 Sep 2009 15:46:06 +0000 Subject: [PATCH 1091/1707] 2009-01-01 Felix Zielcke * genmk.rb: Add quotes around $(TARGET_OBJ2ELF) to cope with non GNU test. --- ChangeLog | 5 +++++ genmk.rb | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 84dd6e4a7..73e5436a3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-01-01 Felix Zielcke + + * genmk.rb: Add quotes around $(TARGET_OBJ2ELF) to cope with + non GNU test. + 2009-08-30 Vladimir Serbinenko * kern/file.c (grub_file_read): Spelling fix diff --git a/genmk.rb b/genmk.rb index 9574ce98d..4aedb25c4 100644 --- a/genmk.rb +++ b/genmk.rb @@ -126,7 +126,7 @@ ifneq ($(TARGET_APPLE_CC),1) #{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) -rm -f $@ $(TARGET_CC) $(#{prefix}_LDFLAGS) $(TARGET_LDFLAGS) -Wl,-r,-d -o $@ #{pre_obj} #{mod_obj} - if test ! -z $(TARGET_OBJ2ELF); then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi + if test ! -z \"$(TARGET_OBJ2ELF)\"; then ./$(TARGET_OBJ2ELF) $@ || (rm -f $@; exit 1); fi $(STRIP) --strip-unneeded -K grub_mod_init -K grub_mod_fini -K _grub_mod_init -K _grub_mod_fini -R .note -R .comment $@ else #{@name}: #{pre_obj} #{mod_obj} $(TARGET_OBJ2ELF) From c403a1250dce0ea374917122c95e56a1621b2890 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 1 Sep 2009 16:13:29 +0000 Subject: [PATCH 1092/1707] fix wrong date and use \t instead of 8 spaces in previous ChangeLog entry --- ChangeLog | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 73e5436a3..15d059f92 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,7 +1,7 @@ -2009-01-01 Felix Zielcke +2009-09-01 Felix Zielcke * genmk.rb: Add quotes around $(TARGET_OBJ2ELF) to cope with - non GNU test. + non GNU test. 2009-08-30 Vladimir Serbinenko From ecb3166a82e01adf2407c0916cc42d38dad6d014 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Tue, 1 Sep 2009 16:14:11 +0000 Subject: [PATCH 1093/1707] 2009-09-01 Colin Watson * script/lua/grub_lua.h (fputs): Supply a format string as the first argument to grub_printf. --- ChangeLog | 5 +++++ script/lua/grub_lua.h | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 15d059f92..1893f9ee8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-01 Colin Watson + + * script/lua/grub_lua.h (fputs): Supply a format string as the first + argument to grub_printf. + 2009-09-01 Felix Zielcke * genmk.rb: Add quotes around $(TARGET_OBJ2ELF) to cope with diff --git a/script/lua/grub_lua.h b/script/lua/grub_lua.h index d5181f147..78e6546c7 100644 --- a/script/lua/grub_lua.h +++ b/script/lua/grub_lua.h @@ -58,7 +58,7 @@ #define setjmp grub_setjmp #define longjmp grub_longjmp -#define fputs(s,f) grub_printf(s) +#define fputs(s,f) grub_printf("%s", s) #define isdigit grub_isdigit #define isalpha grub_isalpha From 3e81e9369ba19b91b5427acd506df9f778be2dba Mon Sep 17 00:00:00 2001 From: cjwatson Date: Tue, 1 Sep 2009 16:15:38 +0000 Subject: [PATCH 1094/1707] DISTLIST is not in svn; fix my ChangeLog entry --- ChangeLog | 1 - 1 file changed, 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1893f9ee8..3fd3d2ec9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -126,7 +126,6 @@ * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise. * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise. - * DISTLIST: Add commands/keystatus.c. 2009-08-28 Vladimir Serbinenko From aa0f752dfee9b85870e6b589b39b47c9eda767c2 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 1 Sep 2009 19:07:42 +0000 Subject: [PATCH 1095/1707] 2009-09-01 Vladimir Serbinenko * commands/loadenv.c (check_blocklists): Fix off-by-one error. (write_blocklists): Likewise. --- ChangeLog | 5 +++++ commands/loadenv.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 3fd3d2ec9..d8c75dfab 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-01 Vladimir Serbinenko + + * commands/loadenv.c (check_blocklists): Fix off-by-one error. + (write_blocklists): Likewise. + 2009-09-01 Colin Watson * script/lua/grub_lua.h (fputs): Supply a format string as the first diff --git a/commands/loadenv.c b/commands/loadenv.c index 22665f9fe..c60eb835c 100644 --- a/commands/loadenv.c +++ b/commands/loadenv.c @@ -242,7 +242,7 @@ check_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, part_start = 0; buf = grub_envblk_buffer (envblk); - for (p = blocklists, index = 0; p; p = p->next, index += p->length) + for (p = blocklists, index = 0; p; index += p->length, p = p->next) { char blockbuf[GRUB_DISK_SECTOR_SIZE]; @@ -278,7 +278,7 @@ write_blocklists (grub_envblk_t envblk, struct blocklist *blocklists, part_start = 0; index = 0; - for (p = blocklists; p; p = p->next, index += p->length) + for (p = blocklists; p; index += p->length, p = p->next) { if (grub_disk_write (disk, p->sector - part_start, p->offset, p->length, buf + index)) From 72db7c22f3e1a8541517906ff8beef63a34f7ce8 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 2 Sep 2009 02:52:10 +0200 Subject: [PATCH 1096/1707] crashing snow64 --- conf/i386-efi.rmk | 5 +- conf/i386-pc.rmk | 5 +- conf/x86_64-efi.rmk | 5 +- include/grub/i386/macho.h | 35 ++++++ include/grub/macho.h | 17 +++ include/grub/machoload.h | 23 +++- loader/macho.c | 236 +------------------------------------- loader/xnu.c | 145 +++++++++++++++++++++-- 8 files changed, 214 insertions(+), 257 deletions(-) diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 18a9a636b..4eb3853f1 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -196,8 +196,9 @@ fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += xnu.mod -xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\ - loader/macho.c loader/xnu.c loader/i386/xnu_helper.S +xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c \ + loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c \ + loader/i386/xnu_helper.S xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 8d7d9fca9..a617e1b78 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -242,8 +242,9 @@ linux_mod_CFLAGS = $(COMMON_CFLAGS) linux_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += xnu.mod -xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/pc/xnu.c\ - loader/macho.c loader/xnu.c loader/i386/xnu_helper.S +xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/pc/xnu.c \ + loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c \ + loader/i386/xnu_helper.S xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 1a4cf89ed..5087465b4 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -195,8 +195,9 @@ fixvideo_mod_CFLAGS = $(COMMON_CFLAGS) fixvideo_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += xnu.mod -xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c\ - loader/macho.c loader/xnu.c loader/i386/xnu_helper.S +xnu_mod_SOURCES = loader/xnu_resume.c loader/i386/xnu.c loader/i386/efi/xnu.c \ + loader/macho32.c loader/macho64.c loader/macho.c loader/xnu.c \ + loader/i386/xnu_helper.S xnu_mod_CFLAGS = $(COMMON_CFLAGS) xnu_mod_LDFLAGS = $(COMMON_LDFLAGS) xnu_mod_ASFLAGS = $(COMMON_ASFLAGS) diff --git a/include/grub/i386/macho.h b/include/grub/i386/macho.h index 61e72a71b..f22c21190 100644 --- a/include/grub/i386/macho.h +++ b/include/grub/i386/macho.h @@ -1,3 +1,26 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_CPU_MACHO_H +#define GRUB_CPU_MACHO_H 1 + +#include + #define GRUB_MACHO_CPUTYPE_IS_HOST32(x) ((x)==0x00000007) #define GRUB_MACHO_CPUTYPE_IS_HOST64(x) ((x)==0x01000007) @@ -9,3 +32,15 @@ struct grub_macho_thread32 grub_uint32_t entry_point; grub_uint8_t unknown2[20]; } __attribute__ ((packed)); + + +struct grub_macho_thread64 +{ + grub_uint32_t cmd; + grub_uint32_t cmdsize; + grub_uint8_t unknown1[0x88]; + grub_uint64_t entry_point; + grub_uint8_t unknown2[0x20]; +} __attribute__ ((packed)); + +#endif diff --git a/include/grub/macho.h b/include/grub/macho.h index 0604100e9..82145835f 100644 --- a/include/grub/macho.h +++ b/include/grub/macho.h @@ -102,6 +102,23 @@ struct grub_macho_segment32 grub_uint32_t flags; } __attribute__ ((packed)); +/* 64-bit segment command. */ +struct grub_macho_segment64 +{ +#define GRUB_MACHO_CMD_SEGMENT64 0x19 + grub_uint32_t cmd; + grub_uint32_t cmdsize; + grub_uint8_t segname[16]; + grub_uint64_t vmaddr; + grub_uint64_t vmsize; + grub_uint64_t fileoff; + grub_uint64_t filesize; + grub_macho_vmprot_t maxprot; + grub_macho_vmprot_t initprot; + grub_uint32_t nsects; + grub_uint32_t flags; +} __attribute__ ((packed)); + #define GRUB_MACHO_CMD_THREAD 5 #endif diff --git a/include/grub/machoload.h b/include/grub/machoload.h index a80bac68c..8410162fb 100644 --- a/include/grub/machoload.h +++ b/include/grub/machoload.h @@ -46,17 +46,28 @@ grub_macho_t grub_macho_file (grub_file_t); grub_err_t grub_macho_close (grub_macho_t); int grub_macho_contains_macho32 (grub_macho_t); -grub_err_t grub_macho32_size (grub_macho_t macho, grub_addr_t *segments_start, - grub_addr_t *segments_end, int flags); -grub_uint32_t grub_macho32_get_entry_point (grub_macho_t macho); +grub_err_t grub_macho_size32 (grub_macho_t macho, grub_uint32_t *segments_start, + grub_uint32_t *segments_end, int flags); +grub_uint32_t grub_macho_get_entry_point32 (grub_macho_t macho); + +int grub_macho_contains_macho64 (grub_macho_t); +grub_err_t grub_macho_size64 (grub_macho_t macho, grub_uint64_t *segments_start, + grub_uint64_t *segments_end, int flags); +grub_uint64_t grub_macho_get_entry_point64 (grub_macho_t macho); /* Ignore BSS segments when loading. */ #define GRUB_MACHO_NOBSS 0x1 -grub_err_t grub_macho32_load (grub_macho_t macho, char *offset, int flags); +grub_err_t grub_macho_load32 (grub_macho_t macho, char *offset, int flags); +grub_err_t grub_macho_load64 (grub_macho_t macho, char *offset, int flags); /* Like filesize and file_read but take only 32-bit part for current architecture. */ -grub_size_t grub_macho32_filesize (grub_macho_t macho); -grub_err_t grub_macho32_readfile (grub_macho_t macho, void *dest); +grub_size_t grub_macho_filesize32 (grub_macho_t macho); +grub_err_t grub_macho_readfile32 (grub_macho_t macho, void *dest); +grub_size_t grub_macho_filesize64 (grub_macho_t macho); +grub_err_t grub_macho_readfile64 (grub_macho_t macho, void *dest); + +void grub_macho_parse32 (grub_macho_t macho); +void grub_macho_parse64 (grub_macho_t macho); #endif /* ! GRUB_MACHOLOAD_HEADER */ diff --git a/loader/macho.c b/loader/macho.c index bd460b810..a23f5b206 100644 --- a/loader/macho.c +++ b/loader/macho.c @@ -30,239 +30,6 @@ #include #include -#define min(a,b) (((a) < (b)) ? (a) : (b)) - -/* 32-bit. */ - -int -grub_macho_contains_macho32 (grub_macho_t macho) -{ - return macho->offset32 != -1; -} - -static void -grub_macho_parse32 (grub_macho_t macho) -{ - struct grub_macho_header32 head; - - /* Is there any candidate at all? */ - if (macho->offset32 == -1) - return; - - /* Read header and check magic*/ - if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1 - || grub_file_read (macho->file, &head, sizeof (head)) - != sizeof(head)) - { - grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); - macho->offset32 = -1; - return; - } - if (head.magic != GRUB_MACHO_MAGIC32) - { - grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header."); - macho->offset32 = -1; - return; - } - - /* Read commands. */ - macho->ncmds32 = head.ncmds; - macho->cmdsize32 = head.sizeofcmds; - macho->cmds32 = grub_malloc(macho->cmdsize32); - if (! macho->cmds32) - { - grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to read commands"); - return; - } - if (grub_file_read (macho->file, macho->cmds32, - (grub_size_t) macho->cmdsize32) - != (grub_ssize_t) macho->cmdsize32) - { - grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); - macho->offset32 = -1; - } -} - -typedef int NESTED_FUNC_ATTR (*grub_macho_iter_hook_t) -(grub_macho_t , struct grub_macho_cmd *, - void *); - -static grub_err_t -grub_macho32_cmds_iterate (grub_macho_t macho, - grub_macho_iter_hook_t hook, - void *hook_arg) -{ - grub_uint8_t *hdrs = macho->cmds32; - int i; - if (! macho->cmds32) - return grub_error (GRUB_ERR_BAD_OS, "Couldn't find 32-bit Mach-O"); - for (i = 0; i < macho->ncmds32; i++) - { - struct grub_macho_cmd *hdr = (struct grub_macho_cmd *) hdrs; - if (hook (macho, hdr, hook_arg)) - break; - hdrs += hdr->cmdsize; - } - - return grub_errno; -} - -grub_size_t -grub_macho32_filesize (grub_macho_t macho) -{ - if (grub_macho_contains_macho32 (macho)) - return macho->end32 - macho->offset32; - return 0; -} - -grub_err_t -grub_macho32_readfile (grub_macho_t macho, void *dest) -{ - grub_ssize_t read; - if (! grub_macho_contains_macho32 (macho)) - return grub_error (GRUB_ERR_BAD_OS, - "Couldn't read architecture-specific part"); - - if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1) - { - grub_error_push (); - return grub_error (GRUB_ERR_BAD_OS, - "Invalid offset in program header."); - } - - read = grub_file_read (macho->file, dest, - macho->end32 - macho->offset32); - if (read != (grub_ssize_t) (macho->end32 - macho->offset32)) - { - grub_error_push (); - return grub_error (GRUB_ERR_BAD_OS, - "Couldn't read architecture-specific part"); - } - return GRUB_ERR_NONE; -} - -/* Calculate the amount of memory spanned by the segments. */ -grub_err_t -grub_macho32_size (grub_macho_t macho, grub_addr_t *segments_start, - grub_addr_t *segments_end, int flags) -{ - int nr_phdrs = 0; - - /* Run through the program headers to calculate the total memory size we - should claim. */ - auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho, - struct grub_macho_cmd *phdr, void *_arg); - int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho, - struct grub_macho_cmd *hdr0, void UNUSED *_arg) - { - struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0; - if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT32) - return 0; - if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) - return 0; - - nr_phdrs++; - if (hdr->vmaddr < *segments_start) - *segments_start = hdr->vmaddr; - if (hdr->vmaddr + hdr->vmsize > *segments_end) - *segments_end = hdr->vmaddr + hdr->vmsize; - return 0; - } - - *segments_start = (grub_uint32_t) -1; - *segments_end = 0; - - grub_macho32_cmds_iterate (macho, calcsize, 0); - - if (nr_phdrs == 0) - return grub_error (GRUB_ERR_BAD_OS, "No program headers present"); - - if (*segments_end < *segments_start) - /* Very bad addresses. */ - return grub_error (GRUB_ERR_BAD_OS, "Bad program header load addresses"); - - return GRUB_ERR_NONE; -} - -/* Load every loadable segment into memory specified by `_load_hook'. */ -grub_err_t -grub_macho32_load (grub_macho_t macho, char *offset, int flags) -{ - grub_err_t err = 0; - auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, - struct grub_macho_cmd *hdr0, - void UNUSED *_arg); - int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, - struct grub_macho_cmd *hdr0, - void UNUSED *_arg) - { - struct grub_macho_segment32 *hdr = (struct grub_macho_segment32 *) hdr0; - - if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT32) - return 0; - - if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) - return 0; - if (! hdr->vmsize) - return 0; - - if (grub_file_seek (_macho->file, hdr->fileoff - + _macho->offset32) == (grub_off_t) -1) - { - grub_error_push (); - grub_error (GRUB_ERR_BAD_OS, - "Invalid offset in program header."); - return 1; - } - - if (hdr->filesize) - { - grub_ssize_t read; - read = grub_file_read (_macho->file, offset + hdr->vmaddr, - min (hdr->filesize, hdr->vmsize)); - if (read != (grub_ssize_t) min (hdr->filesize, hdr->vmsize)) - { - /* XXX How can we free memory from `load_hook'? */ - grub_error_push (); - err=grub_error (GRUB_ERR_BAD_OS, - "Couldn't read segment from file: " - "wanted 0x%lx bytes; read 0x%lx bytes.", - hdr->filesize, read); - return 1; - } - } - - if (hdr->filesize < hdr->vmsize) - grub_memset (offset + hdr->vmaddr + hdr->filesize, - 0, hdr->vmsize - hdr->filesize); - return 0; - } - - grub_macho32_cmds_iterate (macho, do_load, 0); - - return err; -} - -grub_uint32_t -grub_macho32_get_entry_point (grub_macho_t macho) -{ - grub_uint32_t entry_point = 0; - auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho, - struct grub_macho_cmd *hdr, - void UNUSED *_arg); - int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho, - struct grub_macho_cmd *hdr, - void UNUSED *_arg) - { - if (hdr->cmd == GRUB_MACHO_CMD_THREAD) - entry_point = ((struct grub_macho_thread32 *) hdr)->entry_point; - return 0; - } - grub_macho32_cmds_iterate (macho, hook, 0); - return entry_point; -} - - grub_err_t grub_macho_close (grub_macho_t macho) { @@ -367,8 +134,7 @@ grub_macho_file (grub_file_t file) } grub_macho_parse32 (macho); - /* FIXME: implement 64-bit.*/ - /* grub_macho_parse64 (macho); */ + grub_macho_parse64 (macho); return macho; diff --git a/loader/xnu.c b/loader/xnu.c index 1f29b69a1..271a746e6 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -35,6 +35,7 @@ struct grub_xnu_devtree_key *grub_xnu_devtree_root = 0; static int driverspackagenum = 0; static int driversnum = 0; +static int is_64bit; /* Allocate heap by 32MB-blocks. */ #define GRUB_XNU_HEAP_ALLOC_BLOCK 0x2000000 @@ -352,7 +353,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), { grub_err_t err; grub_macho_t macho; - grub_addr_t startcode, endcode; + grub_uint32_t startcode, endcode; int i; char *ptr, *loadaddr; @@ -368,10 +369,10 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), { grub_macho_close (macho); return grub_error (GRUB_ERR_BAD_OS, - "Kernel doesn't contain suitable architecture"); + "Kernel doesn't contain suitable 32-bit architecture"); } - err = grub_macho32_size (macho, &startcode, &endcode, GRUB_MACHO_NOBSS); + err = grub_macho_size32 (macho, &startcode, &endcode, GRUB_MACHO_NOBSS); if (err) { grub_macho_close (macho); @@ -394,7 +395,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), } /* Load kernel. */ - err = grub_macho32_load (macho, loadaddr - startcode, GRUB_MACHO_NOBSS); + err = grub_macho_load32 (macho, loadaddr - startcode, GRUB_MACHO_NOBSS); if (err) { grub_macho_close (macho); @@ -402,7 +403,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), return err; } - grub_xnu_entry_point = grub_macho32_get_entry_point (macho); + grub_xnu_entry_point = grub_macho_get_entry_point32 (macho); if (! grub_xnu_entry_point) { grub_macho_close (macho); @@ -443,6 +444,113 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); grub_xnu_lock (); + is_64bit = 0; + + return 0; +} + +static grub_err_t +grub_cmd_xnu_kernel64 (grub_command_t cmd __attribute__ ((unused)), + int argc, char *args[]) +{ + grub_err_t err; + grub_macho_t macho; + grub_uint64_t startcode, endcode; + int i; + char *ptr, *loadaddr; + + if (argc < 1) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "file name required"); + + grub_xnu_unload (); + + macho = grub_macho_open (args[0]); + if (! macho) + return grub_errno; + if (! grub_macho_contains_macho64 (macho)) + { + grub_macho_close (macho); + return grub_error (GRUB_ERR_BAD_OS, + "Kernel doesn't contain suitable 64-bit architecture"); + } + + err = grub_macho_size64 (macho, &startcode, &endcode, GRUB_MACHO_NOBSS); + if (err) + { + grub_macho_close (macho); + grub_xnu_unload (); + return err; + } + + startcode &= 0x0fffffff; + endcode &= 0x0fffffff; + + grub_dprintf ("xnu", "endcode = %lx, startcode = %lx\n", + (unsigned long) endcode, (unsigned long) startcode); + + loadaddr = grub_xnu_heap_malloc (endcode - startcode); + grub_xnu_heap_will_be_at = startcode; + + if (! loadaddr) + { + grub_macho_close (macho); + grub_xnu_unload (); + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "not enough memory to load kernel"); + } + + /* Load kernel. */ + err = grub_macho_load64 (macho, loadaddr - startcode, GRUB_MACHO_NOBSS); + if (err) + { + grub_macho_close (macho); + grub_xnu_unload (); + return err; + } + + grub_xnu_entry_point = grub_macho_get_entry_point64 (macho) & 0x0fffffff; + if (! grub_xnu_entry_point) + { + grub_macho_close (macho); + grub_xnu_unload (); + return grub_error (GRUB_ERR_BAD_OS, "couldn't find entry point"); + } + + grub_macho_close (macho); + + err = grub_xnu_align_heap (GRUB_XNU_PAGESIZE); + if (err) + { + grub_xnu_unload (); + return err; + } + + /* Copy parameters to kernel command line. */ + ptr = grub_xnu_cmdline; + for (i = 1; i < argc; i++) + { + if (ptr + grub_strlen (args[i]) + 1 + >= grub_xnu_cmdline + sizeof (grub_xnu_cmdline)) + break; + grub_memcpy (ptr, args[i], grub_strlen (args[i])); + ptr += grub_strlen (args[i]); + *ptr = ' '; + ptr++; + } + + /* Replace last space by '\0'. */ + if (ptr != grub_xnu_cmdline) + *(ptr - 1) = 0; + + err = grub_cpu_xnu_fill_devicetree (); + if (err) + return err; + + grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); + + grub_xnu_lock (); + is_64bit = 1; + return 0; } @@ -560,7 +668,10 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) return grub_error (GRUB_ERR_BAD_OS, "Extension doesn't contain suitable architecture"); } - machosize = grub_macho32_filesize (macho); + if (is_64bit) + machosize = grub_macho_filesize64 (macho); + else + machosize = grub_macho_filesize32 (macho); neededspace += machosize; } else @@ -595,7 +706,11 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) exthead->binaryaddr = (buf - grub_xnu_heap_start) + grub_xnu_heap_will_be_at; exthead->binarysize = machosize; - if ((err = grub_macho32_readfile (macho, buf))) + if (is_64bit) + err = grub_macho_readfile64 (macho, buf); + else + err = grub_macho_readfile32 (macho, buf); + if (err) { grub_macho_close (macho); return err; @@ -695,7 +810,13 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), } for (i = 0; i < narchs; i++) { - if (GRUB_MACHO_CPUTYPE_IS_HOST32 + if (!is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST32 + (grub_be_to_cpu32 (archs[i].cputype))) + { + readoff = grub_be_to_cpu32 (archs[i].offset); + readlen = grub_be_to_cpu32 (archs[i].size); + } + if (is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST64 (grub_be_to_cpu32 (archs[i].cputype))) { readoff = grub_be_to_cpu32 (archs[i].offset); @@ -1363,13 +1484,16 @@ grub_xnu_unlock () locked = 0; } -static grub_command_t cmd_kernel, cmd_mkext, cmd_kext, cmd_kextdir, - cmd_ramdisk, cmd_devtree, cmd_resume, cmd_splash; +static grub_command_t cmd_kernel64, cmd_kernel, cmd_mkext, cmd_kext; +static grub_command_t cmd_kextdir, cmd_ramdisk, cmd_devtree, cmd_resume; +static grub_command_t cmd_splash; GRUB_MOD_INIT(xnu) { cmd_kernel = grub_register_command ("xnu_kernel", grub_cmd_xnu_kernel, 0, "load a xnu kernel"); + cmd_kernel64 = grub_register_command ("xnu_kernel64", grub_cmd_xnu_kernel64, + 0, "load a 64-bit xnu kernel"); cmd_mkext = grub_register_command ("xnu_mkext", grub_cmd_xnu_mkext, 0, "Load XNU extension package."); cmd_kext = grub_register_command ("xnu_kext", grub_cmd_xnu_kext, 0, @@ -1403,5 +1527,6 @@ GRUB_MOD_FINI(xnu) grub_unregister_command (cmd_devtree); grub_unregister_command (cmd_ramdisk); grub_unregister_command (cmd_kernel); + grub_unregister_command (cmd_kernel64); grub_unregister_command (cmd_splash); } From c0bc232b724bd6b339906a42d9ebbb57cd31b755 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Wed, 2 Sep 2009 01:42:06 +0000 Subject: [PATCH 1097/1707] 2009-09-02 Colin Watson * util/grub-probe.c (probe): Test st.st_mode using S_ISREG macro rather than comparing against S_IFREG, which will almost never work. --- ChangeLog | 5 +++++ util/grub-probe.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d8c75dfab..209a9e29c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-02 Colin Watson + + * util/grub-probe.c (probe): Test st.st_mode using S_ISREG macro + rather than comparing against S_IFREG, which will almost never work. + 2009-09-01 Vladimir Serbinenko * commands/loadenv.c (check_blocklists): Fix off-by-one error. diff --git a/util/grub-probe.c b/util/grub-probe.c index 1710ec51b..3c54408c3 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -239,7 +239,7 @@ probe (const char *path, char *device_name) stat (path, &st); - if (st.st_mode == S_IFREG) + if (S_ISREG (st.st_mode)) { /* Regular file. Verify that we can read it properly. */ From f3e8cdfd497bf0ec7c3e22ae137a61dd1b9364e4 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Wed, 2 Sep 2009 09:14:20 +0000 Subject: [PATCH 1098/1707] 2009-09-02 Colin Watson * commands/keystatus.c (GRUB_MOD_INIT (keystatus)): Adjust summary to avoid implying that only one of --shift, --ctrl, or --alt may be used. --- ChangeLog | 6 ++++++ commands/keystatus.c | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 209a9e29c..372028de9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-02 Colin Watson + + * commands/keystatus.c (GRUB_MOD_INIT (keystatus)): Adjust summary + to avoid implying that only one of --shift, --ctrl, or --alt may be + used. + 2009-09-02 Colin Watson * util/grub-probe.c (probe): Test st.st_mode using S_ISREG macro diff --git a/commands/keystatus.c b/commands/keystatus.c index cecbba504..28ceb2d0b 100644 --- a/commands/keystatus.c +++ b/commands/keystatus.c @@ -70,7 +70,7 @@ GRUB_MOD_INIT(keystatus) { cmd = grub_register_extcmd ("keystatus", grub_cmd_keystatus, GRUB_COMMAND_FLAG_BOTH, - "keystatus [--shift|--ctrl|--alt]", + "keystatus [--shift] [--ctrl] [--alt]", "Check key modifier status", options); } From f091064493573f99310d508ba5d4955f80f519b3 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Wed, 2 Sep 2009 09:29:58 +0000 Subject: [PATCH 1099/1707] =?UTF-8?q?2009-09-02=20=C2=A0Colin=20Watson=20?= =?UTF-8?q?=C2=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * docs/grub.texi (Naming convention): Describe one-based partition numbering. (Device syntax): Likewise. (File name syntax): Likewise. (Block list syntax): Likewise. (Making a GRUB bootable CD-ROM): Talk about grub.cfg rather than menu.lst. (File name syntax): Likewise. (Command-line and menu entry commands): Document acpi, blocklist, crc, export, insmod, keystatus, ls, set, and unset commands. --- ChangeLog | 13 +++++ docs/grub.texi | 155 ++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 146 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index 372028de9..543896b9e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-09-02  Colin Watson   + + * docs/grub.texi (Naming convention): Describe one-based partition + numbering. + (Device syntax): Likewise. + (File name syntax): Likewise. + (Block list syntax): Likewise. + (Making a GRUB bootable CD-ROM): Talk about grub.cfg rather than + menu.lst. + (File name syntax): Likewise. + (Command-line and menu entry commands): Document acpi, blocklist, + crc, export, insmod, keystatus, ls, set, and unset commands. + 2009-09-02 Colin Watson * commands/keystatus.c (GRUB_MOD_INIT (keystatus)): Adjust summary diff --git a/docs/grub.texi b/docs/grub.texi index e3f412565..06059df4d 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -20,7 +20,7 @@ This manual is for GNU GRUB (version @value{VERSION}, @value{UPDATED}). -Copyright @copyright{} 1999,2000,2001,2002,2004,2006,2008 Free Software Foundation, Inc. +Copyright @copyright{} 1999,2000,2001,2002,2004,2006,2008,2009 Free Software Foundation, Inc. @quotation Permission is granted to copy, distribute and/or modify this document @@ -356,25 +356,25 @@ disk. The number @samp{0} is the drive number, which is counted from disk. @example -(hd0,1) +(hd0,2) @end example Here, @samp{hd} means it is a hard disk drive. The first integer @samp{0} indicates the drive number, that is, the first hard disk, while the second integer, @samp{1}, indicates the partition number (or the -@sc{pc} slice number in the BSD terminology). Once again, please note -that the partition numbers are counted from @emph{zero}, not from -one. This expression means the second partition of the first hard disk -drive. In this case, GRUB uses one partition of the disk, instead of the -whole disk. +@sc{pc} slice number in the BSD terminology). The partition numbers are +counted from @emph{one}, not from zero (as was the case in previous +versions of GRUB). This expression means the second partition of the +first hard disk drive. In this case, GRUB uses one partition of the +disk, instead of the whole disk. @example -(hd0,4) +(hd0,5) @end example This specifies the first @dfn{extended partition} of the first hard disk drive. Note that the partition numbers for extended partitions are -counted from @samp{4}, regardless of the actual number of primary +counted from @samp{5}, regardless of the actual number of primary partitions on your hard disk. @example @@ -383,13 +383,13 @@ partitions on your hard disk. This means the BSD @samp{a} partition of the second hard disk. If you need to specify which @sc{pc} slice number should be used, use something -like this: @samp{(hd1,0,a)}. If the @sc{pc} slice number is omitted, +like this: @samp{(hd1,1,a)}. If the @sc{pc} slice number is omitted, GRUB searches for the first @sc{pc} slice which has a BSD @samp{a} partition. Of course, to actually access the disks or partitions with GRUB, you need to use the device specification in a command, like @samp{root -(fd0)} or @samp{unhide (hd0,2)}. To help you find out which number +(fd0)} or @samp{unhide (hd0,3)}. To help you find out which number specifies a partition you want, the GRUB command-line (@pxref{Command-line interface}) options have argument completion. This means that, for example, you only need to type @@ -413,7 +413,7 @@ Now the question is, how to specify a file? Again, consider an example: @example -(hd0,0)/vmlinuz +(hd0,1)/vmlinuz @end example This specifies the file named @samp{vmlinuz}, found on the first @@ -550,7 +550,7 @@ which can cause compatibility problems. For booting from a CD-ROM, GRUB uses a special Stage 2 called @file{stage2_eltorito}. The only GRUB files you need to have in your bootable CD-ROM are this @file{stage2_eltorito} and optionally a config file -@file{menu.lst}. You don't need to use @file{stage1} or @file{stage2}, +@file{grub.cfg}. You don't need to use @file{stage1} or @file{stage2}, because El Torito is quite different from the standard boot process. Here is an example of procedures to make a bootable CD-ROM @@ -573,7 +573,7 @@ Copy the file @file{stage2_eltorito}: $ @kbd{cp /usr/lib/grub/i386-pc/stage2_eltorito iso/boot/grub} @end example -If desired, make the config file @file{menu.lst} under @file{iso/boot/grub} +If desired, make the config file @file{grub.cfg} under @file{iso/boot/grub} (@pxref{Configuration}), and copy any files and directories for the disc to the directory @file{iso/}. @@ -786,7 +786,7 @@ which is a BIOS drive number, so the following are equivalent: @end example @var{part-num} represents the partition number of @var{device}, starting -from zero for primary partitions and from four for extended partitions, +from one for primary partitions and from five for extended partitions, and @var{bsd-subpart-letter} represents the BSD disklabel subpartition, such as @samp{a} or @samp{e}. @@ -800,7 +800,7 @@ finds the subpartition @var{bsd-subpart-letter}. Here is an example: @end example The syntax @samp{(hd0)} represents using the entire disk (or the -MBR when installing GRUB), while the syntax @samp{(hd0,0)} +MBR when installing GRUB), while the syntax @samp{(hd0,1)} represents using the first partition of the disk (or the boot sector of the partition when installing GRUB). @@ -820,12 +820,12 @@ There are two ways to specify files, by @dfn{absolute file name} and by An absolute file name resembles a Unix absolute file name, using @samp{/} for the directory separator (not @samp{\} as in DOS). One -example is @samp{(hd0,0)/boot/grub/menu.lst}. This means the file -@file{/boot/grub/menu.lst} in the first partition of the first hard +example is @samp{(hd0,1)/boot/grub/grub.cfg}. This means the file +@file{/boot/grub/grub.cfg} in the first partition of the first hard disk. If you omit the device name in an absolute file name, GRUB uses GRUB's @dfn{root device} implicitly. So if you set the root device to, -say, @samp{(hd1,0)} by the command @command{root} (@pxref{root}), then -@code{/boot/kernel} is the same as @code{(hd1,0)/boot/kernel}. +say, @samp{(hd1,1)} by the command @command{root} (@pxref{root}), then +@code{/boot/kernel} is the same as @code{(hd1,1)/boot/kernel}. @node Block list syntax @@ -846,8 +846,8 @@ the offset is zero. Like the file name syntax (@pxref{File name syntax}), if a blocklist does not contain a device name, then GRUB uses GRUB's @dfn{root -device}. So @code{(hd0,1)+1} is the same as @code{+1} when the root -device is @samp{(hd0,1)}. +device}. So @code{(hd0,2)+1} is the same as @code{+1} when the root +device is @samp{(hd0,2)}. @node Interface @@ -1110,17 +1110,56 @@ you forget a command, you can run the command @command{help} (@pxref{help}). @menu +* acpi:: Load ACPI tables +* blocklist:: Print a block list * boot:: Start up your operating system * cat:: Show the contents of a file * chainloader:: Chain-load another boot loader * cmp:: Compare two files * configfile:: Load a configuration file +* crc:: Calculate CRC32 checksums +* export:: Export an environment variable * halt:: Shut down your computer * help:: Show help messages +* insmod:: Insert a module +* keystatus:: Check key modifier status +* ls:: List devices or files * reboot:: Reboot your computer +* set:: Set an environment variable +* unset:: Unset an environment variable @end menu +@node acpi +@subsection acpi + +@deffn Command acpi [@option{-1}|@option{-2}] @ + [@option{--exclude=table1,@dots{}}|@option{--load-only=table1,@dots{}}] @ + [@option{--oemid=id}] [@option{--oemtable=table}] @ + [@option{--oemtablerev=rev}] [@option{--oemtablecreator=creator}] @ + [@option{--oemtablecreatorrev=rev}] [@option{--no-ebda}] @ + filename @dots{} +Modern BIOS systems normally implement the Advanced Configuration and Power +Interface (ACPI), and define various tables that describe the interface +between an ACPI-compliant operating system and the firmware. In some cases, +the tables provided by default only work well with certain operating +systems, and it may be necessary to replace some of them. + +Normally, this command will replace the Root System Description Pointer +(RSDP) in the Extended BIOS Data Area to point to the new tables. If the +@option{--no-ebda} option is used, the new tables will be known only to +GRUB, but may be used by GRUB's EFI emulation. +@end deffn + + +@node blocklist +@subsection blocklist + +@deffn Command blocklist file +Print a block list (@pxref{Block list syntax}) for @var{file}. +@end deffn + + @node boot @subsection boot @@ -1187,6 +1226,23 @@ Load @var{file} as a configuration file. @end deffn +@node crc +@subsection crc + +@deffn Command crc file +Display the CRC32 checksum of @var{file}. +@end deffn + + +@node export +@subsection export + +@deffn Command export envvar +Export the environment variable @var{envvar}. Exported variables are visible +to subsidiary configuration files loaded using @command{configfile}. +@end deffn + + @node halt @subsection halt @@ -1212,6 +1268,44 @@ about each of the commands which match those @var{patterns}. @end deffn +@node insmod +@subsection insmod + +@deffn Command insmod module +Insert the dynamic GRUB module called @var{module}. +@end deffn + + +@node keystatus +@subsection keystatus + +@deffn Command keystatus [@option{--shift}] [@option{--ctrl}] [@option{--alt}] +Return true if the Shift, Control, or Alt modifier keys are held down, as +requested by options. This is useful in scripting, to allow some user +control over behaviour without having to wait for a keypress. + +Checking key modifier status is only supported on some platforms. If invoked +without any options, the @command{keystatus} command returns true if and +only if checking key modifier status is supported. +@end deffn + + +@node ls +@subsection ls + +@deffn Command ls [arg] +List devices or files. + +With no arguments, print all devices known to GRUB. + +If the argument is a device name enclosed in parentheses (@pxref{Device +syntax}), then list all files at the root directory of that device. + +If the argument is a directory given as an absolute file name (@pxref{File +name syntax}), then list the contents of that directory. +@end deffn + + @node reboot @subsection reboot @@ -1220,6 +1314,23 @@ Reboot the computer. @end deffn +@node set +@subsection set + +@deffn Command set [envvar=value] +Set the environment variable @var{envvar} to @var{value}. If invoked with no +arguments, print all environment variables with their values. +@end deffn + + +@node unset +@subsection unset + +@deffn Command unset envvar +Unset the environment variable @var{envvar}. +@end deffn + + @node Invoking grub-install @chapter Invoking grub-install From 8a10b2c63296e5f5e19511549db2b78ca7998907 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 2 Sep 2009 13:34:40 +0200 Subject: [PATCH 1100/1707] now hangs at maxDec --- efiemu/prepare.c | 55 ++++++++++++++++------- efiemu/runtime/efiemu.c | 7 ++- efiemu/symbols.c | 84 ++++++++++++++++++++++++++++++++++++ include/grub/autoefi.h | 2 + include/grub/efi/efi.h | 4 ++ include/grub/efiemu/efiemu.h | 10 +++++ include/grub/xnu.h | 1 + kern/efi/efi.c | 19 ++++++++ loader/i386/xnu.c | 9 +++- loader/xnu.c | 14 +++--- 10 files changed, 177 insertions(+), 28 deletions(-) diff --git a/efiemu/prepare.c b/efiemu/prepare.c index 9e6d46fa1..620260049 100644 --- a/efiemu/prepare.c +++ b/efiemu/prepare.c @@ -36,7 +36,6 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, int cntconftables = 0; struct SUFFIX (grub_efiemu_configuration_table) *conftables = 0; - struct SUFFIX (grub_efiemu_runtime_services) *runtime_services; int i; int handle; grub_off_t off; @@ -54,6 +53,7 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, /* Switch from phase 1 (counting) to phase 2 (real job) */ grub_efiemu_alloc_syms (); grub_efiemu_mm_do_alloc (); + grub_efiemu_write_sym_markers (); grub_efiemu_system_table32 = 0; grub_efiemu_system_table64 = 0; @@ -81,16 +81,6 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, = (struct SUFFIX (grub_efi_system_table) *) ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); - /* compute CRC32 of runtime_services */ - if ((err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", - &handle, &off))) - return err; - runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *) - ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); - runtime_services->hdr.crc32 = 0; - runtime_services->hdr.crc32 = grub_getcrc32 - (0, runtime_services, runtime_services->hdr.header_size); - /* Put pointer to the list of configuration tables in system table */ grub_efiemu_write_value (&(SUFFIX (grub_efiemu_system_table)->configuration_table), 0, @@ -113,16 +103,51 @@ SUFFIX (grub_efiemu_prepare) (struct grub_efiemu_prepare_hook *prepare_hooks, conftables[i].vendor_table = PTR_TO_UINT64 (cur->data); } + err = SUFFIX (grub_efiemu_crc) (); + if (err) + { + grub_efiemu_unload (); + return err; + } + + grub_dprintf ("efiemu","system_table = %p, conftables = %p (%d entries)\n", + SUFFIX (grub_efiemu_system_table), conftables, cntconftables); + + return GRUB_ERR_NONE; +} + +grub_err_t +SUFFIX (grub_efiemu_crc) (void) +{ + grub_err_t err; + int handle; + grub_off_t off; + struct SUFFIX (grub_efiemu_runtime_services) *runtime_services; + + /* compute CRC32 of runtime_services */ + err = grub_efiemu_resolve_symbol ("efiemu_runtime_services", + &handle, &off); + if (err) + return err; + + runtime_services = (struct SUFFIX (grub_efiemu_runtime_services) *) + ((grub_uint8_t *) grub_efiemu_mm_obtain_request (handle) + off); + runtime_services->hdr.crc32 = 0; + runtime_services->hdr.crc32 = grub_getcrc32 + (0, runtime_services, runtime_services->hdr.header_size); + + err = grub_efiemu_resolve_symbol ("efiemu_system_table", &handle, &off); + if (err) + return err; + /* compute CRC32 of system table */ SUFFIX (grub_efiemu_system_table)->hdr.crc32 = 0; SUFFIX (grub_efiemu_system_table)->hdr.crc32 = grub_getcrc32 (0, SUFFIX (grub_efiemu_system_table), SUFFIX (grub_efiemu_system_table)->hdr.header_size); - grub_dprintf ("efiemu","system_table = %p, runtime_services = %p," - " conftables = %p (%d entries)\n", - SUFFIX (grub_efiemu_system_table), runtime_services, - conftables, cntconftables); + grub_dprintf ("efiemu","system_table = %p, runtime_services = %p\n", + SUFFIX (grub_efiemu_system_table), runtime_services); return GRUB_ERR_NONE; } diff --git a/efiemu/runtime/efiemu.c b/efiemu/runtime/efiemu.c index 085e75d0c..73893414a 100644 --- a/efiemu/runtime/efiemu.c +++ b/efiemu/runtime/efiemu.c @@ -111,9 +111,8 @@ static grub_uint8_t loge[1000] = "EFIEMULOG"; static int logn = 9; #define LOG(x) { if (logn<900) loge[logn++]=x; } -static int ptv_relocated = 0; - /* Interface with grub */ +extern grub_uint8_t efiemu_ptv_relocated; struct grub_efi_runtime_services efiemu_runtime_services; struct grub_efi_system_table efiemu_system_table; extern struct grub_efiemu_ptv_rel efiemu_ptv_relloc[]; @@ -343,9 +342,9 @@ grub_efi_status_t EFI_FUNC LOG ('e'); /* Ensure that we are called only once */ - if (ptv_relocated) + if (efiemu_ptv_relocated) return GRUB_EFI_UNSUPPORTED; - ptv_relocated = 1; + efiemu_ptv_relocated = 1; /* Correct addresses using information supplied by grub */ for (cur_relloc = efiemu_ptv_relloc; cur_relloc->size;cur_relloc++) diff --git a/efiemu/symbols.c b/efiemu/symbols.c index ec508d975..f20761565 100644 --- a/efiemu/symbols.c +++ b/efiemu/symbols.c @@ -26,9 +26,11 @@ static int ptv_written = 0; static int ptv_alloc = 0; static int ptv_handle = 0; +static int relocated_handle = 0; static int ptv_requested = 0; static struct grub_efiemu_sym *efiemu_syms = 0; + struct grub_efiemu_sym { struct grub_efiemu_sym *next; @@ -54,6 +56,8 @@ grub_efiemu_free_syms (void) ptv_requested = 0; grub_efiemu_mm_return_request (ptv_handle); ptv_handle = 0; + grub_efiemu_mm_return_request (relocated_handle); + relocated_handle = 0; } /* Announce that the module will need NUM allocators */ @@ -114,10 +118,26 @@ grub_efiemu_alloc_syms (void) ptv_handle = grub_efiemu_request_memalign (1, (ptv_requested + 1) * sizeof (struct grub_efiemu_ptv_rel), GRUB_EFI_RUNTIME_SERVICES_DATA); + relocated_handle = grub_efiemu_request_memalign + (1, sizeof (grub_uint8_t), GRUB_EFI_RUNTIME_SERVICES_DATA); + + grub_efiemu_register_symbol ("efiemu_ptv_relocated", relocated_handle, 0); grub_efiemu_register_symbol ("efiemu_ptv_relloc", ptv_handle, 0); return grub_errno; } +grub_err_t +grub_efiemu_write_sym_markers (void) +{ + struct grub_efiemu_ptv_rel *ptv_rels + = grub_efiemu_mm_obtain_request (ptv_handle); + grub_uint8_t *relocated = grub_efiemu_mm_obtain_request (relocated_handle); + grub_memset (ptv_rels, 0, (ptv_requested + 1) + * sizeof (struct grub_efiemu_ptv_rel)); + *relocated = 0; + return GRUB_ERR_NONE; +} + /* Write value (pointer to memory PLUS_HANDLE) - (pointer to memory MINUS_HANDLE) + VALUE to ADDR assuming that the size SIZE bytes. If PTV_NEEDED is 1 then announce it to runtime that this @@ -186,3 +206,67 @@ grub_efiemu_write_value (void *addr, grub_uint32_t value, int plus_handle, return GRUB_ERR_NONE; } + +grub_err_t +grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version + __attribute__ ((unused)), + grub_efi_memory_descriptor_t *virtual_map) +{ + grub_uint8_t *ptv_relocated; + struct grub_efiemu_ptv_rel *cur_relloc; + struct grub_efiemu_ptv_rel *ptv_rels; + + ptv_relocated = grub_efiemu_mm_obtain_request (relocated_handle); + ptv_rels = grub_efiemu_mm_obtain_request (ptv_handle); + + /* Ensure that we are called only once */ + if (*ptv_relocated) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "EfiEmu is already relocated."); + *ptv_relocated = 1; + + /* Correct addresses using information supplied by grub */ + for (cur_relloc = ptv_rels; cur_relloc->size; cur_relloc++) + { + grub_int64_t corr = 0; + grub_efi_memory_descriptor_t *descptr; + + /* Compute correction */ + for (descptr = virtual_map; + (grub_size_t) ((grub_uint8_t *) descptr + - (grub_uint8_t *) virtual_map) < memory_map_size; + descptr = (grub_efi_memory_descriptor_t *) + ((grub_uint8_t *) descptr + descriptor_size)) + { + if (descptr->type == cur_relloc->plustype) + corr += descptr->virtual_start - descptr->physical_start; + if (descptr->type == cur_relloc->minustype) + corr -= descptr->virtual_start - descptr->physical_start; + } + + /* Apply correction */ + switch (cur_relloc->size) + { + case 8: + *((grub_uint64_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + case 4: + *((grub_uint32_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + case 2: + *((grub_uint16_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + case 1: + *((grub_uint8_t *) UINT_TO_PTR (cur_relloc->addr)) += corr; + break; + } + } + + /* Recompute crc32 of system table and runtime services */ + + if (grub_efiemu_sizeof_uintn_t () == 4) + return grub_efiemu_crc32 (); + else + return grub_efiemu_crc64 (); +} diff --git a/include/grub/autoefi.h b/include/grub/autoefi.h index 4acd43965..4f5e262f0 100644 --- a/include/grub/autoefi.h +++ b/include/grub/autoefi.h @@ -29,6 +29,7 @@ # define grub_autoefi_finish_boot_services grub_efi_finish_boot_services # define grub_autoefi_system_table grub_efi_system_table # define grub_autoefi_mmap_iterate grub_machine_mmap_iterate +# define grub_autoefi_set_virtual_address_map grub_efi_set_virtual_address_map static inline grub_err_t grub_autoefi_prepare (void) { return GRUB_ERR_NONE; @@ -57,6 +58,7 @@ static inline grub_err_t grub_autoefi_prepare (void) # define grub_autoefi_system_table grub_efiemu_system_table # define grub_autoefi_mmap_iterate grub_efiemu_mmap_iterate # define grub_autoefi_prepare grub_efiemu_prepare +# define grub_autoefi_set_virtual_address_map grub_efiemu_set_virtual_address_map # define GRUB_AUTOEFI_MEMORY_AVAILABLE GRUB_EFIEMU_MEMORY_AVAILABLE # define GRUB_AUTOEFI_MEMORY_RESERVED GRUB_EFIEMU_MEMORY_RESERVED # define GRUB_AUTOEFI_MEMORY_ACPI GRUB_EFIEMU_MEMORY_ACPI diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index 916f9d662..754c4a7cb 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -57,6 +57,10 @@ int EXPORT_FUNC(grub_efi_exit_boot_services) (grub_efi_uintn_t map_key); void EXPORT_FUNC (grub_reboot) (void); void EXPORT_FUNC (grub_halt) (void); int EXPORT_FUNC (grub_efi_finish_boot_services) (void); +grub_err_t EXPORT_FUNC (grub_efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version, + grub_efi_memory_descriptor_t *virtual_map); void grub_efi_mm_init (void); void grub_efi_mm_fini (void); diff --git a/include/grub/efiemu/efiemu.h b/include/grub/efiemu/efiemu.h index 20163dd61..3980d32cd 100644 --- a/include/grub/efiemu/efiemu.h +++ b/include/grub/efiemu/efiemu.h @@ -268,9 +268,19 @@ void grub_efiemu_free_syms (void); grub_err_t grub_efiemu_write_value (void * addr, grub_uint32_t value, int plus_handle, int minus_handle, int ptv_needed, int size); +grub_err_t grub_efiemu_write_sym_markers (void); grub_err_t grub_efiemu_pnvram (void); grub_err_t grub_efiemu_prepare (void); char *grub_efiemu_get_default_core_name (void); void grub_efiemu_pnvram_cmd_unregister (void); grub_err_t grub_efiemu_autocore (void); +grub_err_t grub_efiemu_crc32 (void); +grub_err_t grub_efiemu_crc64 (void); +grub_err_t +grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version + __attribute__ ((unused)), + grub_efi_memory_descriptor_t *virtual_map); + #endif /* ! GRUB_EFI_EMU_HEADER */ diff --git a/include/grub/xnu.h b/include/grub/xnu.h index 67d78d92c..29689479b 100644 --- a/include/grub/xnu.h +++ b/include/grub/xnu.h @@ -106,4 +106,5 @@ extern grub_uint32_t grub_xnu_heap_real_start; extern grub_size_t grub_xnu_heap_size; extern char *grub_xnu_heap_start; extern struct grub_video_bitmap *grub_xnu_bitmap; +extern int grub_xnu_is_64bit; #endif diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 8e09a90c0..630f012b6 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -188,6 +188,25 @@ grub_efi_exit_boot_services (grub_efi_uintn_t map_key) return status == GRUB_EFI_SUCCESS; } +grub_err_t +grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version, + grub_efi_memory_descriptor_t *virtual_map) +{ + grub_efi_runtime_services_t *r; + grub_efi_status_t status; + + r = grub_efi_system_table->runtime_services; + status = efi_call_4 (r->set_virtual_address_map, memory_map_size, + descriptor_size, descriptor_version, virtual_map); + + if (status == GRUB_EFI_SUCCESS) + return GRUB_ERR_NONE; + + return grub_errno (GRUB_ERR_IO, "set_virtual_address_map failed"); +} + grub_uint32_t grub_get_rtc (void) { diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index 06e375c69..2bcedebe2 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -474,13 +474,15 @@ grub_xnu_boot (void) grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) ((char *) memory_map + descriptor_size * i); - /* Some EFI implementations set physical_start to 0 which - causes XNU crash. */ curdesc->virtual_start = curdesc->physical_start; if (curdesc->type == GRUB_EFI_RUNTIME_SERVICES_DATA || curdesc->type == GRUB_EFI_RUNTIME_SERVICES_CODE) { + if (grub_xnu_is_64bit && (SIZEOF_OF_UINTN == 8)) + curdesc->virtual_start |= 0xffffff8000000000ULL; + else + curdesc->virtual_start &= 0x000000007fffffffULL; if (firstruntimeaddr > curdesc->physical_start) firstruntimeaddr = curdesc->physical_start; if (lastruntimeaddr < curdesc->physical_start @@ -572,6 +574,9 @@ grub_xnu_boot (void) if (! grub_autoefi_finish_boot_services ()) return grub_error (GRUB_ERR_IO, "can't exit boot services"); + grub_autoefi_set_virtual_address_map (memory_map_size, descriptor_size, + descriptor_version,memory_map); + grub_xnu_launch (); /* Never reaches here. */ diff --git a/loader/xnu.c b/loader/xnu.c index 271a746e6..2ebca3218 100644 --- a/loader/xnu.c +++ b/loader/xnu.c @@ -35,7 +35,7 @@ struct grub_xnu_devtree_key *grub_xnu_devtree_root = 0; static int driverspackagenum = 0; static int driversnum = 0; -static int is_64bit; +int grub_xnu_is_64bit = 0; /* Allocate heap by 32MB-blocks. */ #define GRUB_XNU_HEAP_ALLOC_BLOCK 0x2000000 @@ -444,7 +444,7 @@ grub_cmd_xnu_kernel (grub_command_t cmd __attribute__ ((unused)), grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); grub_xnu_lock (); - is_64bit = 0; + grub_xnu_is_64bit = 0; return 0; } @@ -549,7 +549,7 @@ grub_cmd_xnu_kernel64 (grub_command_t cmd __attribute__ ((unused)), grub_loader_set (grub_xnu_boot, grub_xnu_unload, 0); grub_xnu_lock (); - is_64bit = 1; + grub_xnu_is_64bit = 1; return 0; } @@ -668,7 +668,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) return grub_error (GRUB_ERR_BAD_OS, "Extension doesn't contain suitable architecture"); } - if (is_64bit) + if (grub_xnu_is_64bit) machosize = grub_macho_filesize64 (macho); else machosize = grub_macho_filesize32 (macho); @@ -706,7 +706,7 @@ grub_xnu_load_driver (char *infoplistname, grub_file_t binaryfile) exthead->binaryaddr = (buf - grub_xnu_heap_start) + grub_xnu_heap_will_be_at; exthead->binarysize = machosize; - if (is_64bit) + if (grub_xnu_is_64bit) err = grub_macho_readfile64 (macho, buf); else err = grub_macho_readfile32 (macho, buf); @@ -810,13 +810,13 @@ grub_cmd_xnu_mkext (grub_command_t cmd __attribute__ ((unused)), } for (i = 0; i < narchs; i++) { - if (!is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST32 + if (!grub_xnu_is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST32 (grub_be_to_cpu32 (archs[i].cputype))) { readoff = grub_be_to_cpu32 (archs[i].offset); readlen = grub_be_to_cpu32 (archs[i].size); } - if (is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST64 + if (grub_xnu_is_64bit && GRUB_MACHO_CPUTYPE_IS_HOST64 (grub_be_to_cpu32 (archs[i].cputype))) { readoff = grub_be_to_cpu32 (archs[i].offset); From cbf978c0f0857c95e0abbe86d525b13a10a54e5d Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 2 Sep 2009 16:16:29 +0000 Subject: [PATCH 1101/1707] 2009-09-02 Vladimir Serbinenko * efiemu/loadcore.c (SUFFIX (grub_efiemu_loadcore_load)): Fix style according to GCS. --- ChangeLog | 7 ++++++- efiemu/loadcore.c | 15 ++++++++++----- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 543896b9e..feb735cb3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,9 @@ -2009-09-02  Colin Watson   +2009-09-02 Vladimir Serbinenko + + * efiemu/loadcore.c (SUFFIX (grub_efiemu_loadcore_load)): Fix style + according to GCS. + +2009-09-02 Colin Watson * docs/grub.texi (Naming convention): Describe one-based partition numbering. diff --git a/efiemu/loadcore.c b/efiemu/loadcore.c index ee4c80649..4bf26ee44 100644 --- a/efiemu/loadcore.c +++ b/efiemu/loadcore.c @@ -352,13 +352,18 @@ SUFFIX (grub_efiemu_loadcore_load) (void *core, grub_efiemu_segment_t segments) { grub_err_t err; - if ((err = grub_efiemu_load_segments (segments, core))) + err = grub_efiemu_load_segments (segments, core); + if (err) return err; - if ((err = grub_efiemu_resolve_symbols (segments, core))) + + err = grub_efiemu_resolve_symbols (segments, core); + if (err) return err; - if ((err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments, - grub_efiemu_elfsyms, - core))) + + err = SUFFIX (grub_arch_efiemu_relocate_symbols) (segments, + grub_efiemu_elfsyms, + core); + if (err) return err; return GRUB_ERR_NONE; From 0355f074044a3667654d680829243cc01c7ce8e9 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 2 Sep 2009 18:18:11 +0200 Subject: [PATCH 1102/1707] relocate runtime --- loader/i386/xnu.c | 66 ++++++++++++++++++++++++++--------------------- 1 file changed, 36 insertions(+), 30 deletions(-) diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index 2bcedebe2..0b110bab6 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -435,6 +435,7 @@ grub_xnu_boot (void) grub_efi_uintn_t descriptor_size = 0; grub_efi_uint32_t descriptor_version = 0; grub_uint64_t firstruntimeaddr, lastruntimeaddr; + grub_uint64_t curruntimeaddr; void *devtree; grub_size_t devtreelen; int i; @@ -467,31 +468,6 @@ grub_xnu_boot (void) mmap_relloc_off = (grub_uint8_t *) memory_map - (grub_uint8_t *) grub_xnu_heap_start; - firstruntimeaddr = (grub_uint64_t) (-1); - lastruntimeaddr = 0; - for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++) - { - grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) - ((char *) memory_map + descriptor_size * i); - - curdesc->virtual_start = curdesc->physical_start; - - if (curdesc->type == GRUB_EFI_RUNTIME_SERVICES_DATA - || curdesc->type == GRUB_EFI_RUNTIME_SERVICES_CODE) - { - if (grub_xnu_is_64bit && (SIZEOF_OF_UINTN == 8)) - curdesc->virtual_start |= 0xffffff8000000000ULL; - else - curdesc->virtual_start &= 0x000000007fffffffULL; - if (firstruntimeaddr > curdesc->physical_start) - firstruntimeaddr = curdesc->physical_start; - if (lastruntimeaddr < curdesc->physical_start - + curdesc->num_pages * 4096) - lastruntimeaddr = curdesc->physical_start - + curdesc->num_pages * 4096; - } - } - /* Relocate the boot parameters to heap. */ bootparams_relloc = grub_xnu_heap_malloc (sizeof (*bootparams_relloc)); if (! bootparams_relloc) @@ -511,22 +487,52 @@ grub_xnu_boot (void) + grub_xnu_heap_will_be_at; bootparams_relloc->devtreelen = devtreelen; - bootparams_relloc->heap_start = grub_xnu_heap_will_be_at; - bootparams_relloc->heap_size = grub_xnu_heap_size; - + bootparams_relloc->efi_system_table + = PTR_TO_UINT32 (grub_autoefi_system_table); bootparams_relloc->efi_mmap = grub_xnu_heap_will_be_at + mmap_relloc_off; bootparams_relloc->efi_mmap_size = memory_map_size; bootparams_relloc->efi_mem_desc_size = descriptor_size; bootparams_relloc->efi_mem_desc_version = descriptor_version; + memory_map = (grub_efi_memory_descriptor_t *) + ((grub_uint8_t *) grub_xnu_heap_start + mmap_relloc_off); + firstruntimeaddr = ALIGN_UP (((grub_addr_t) grub_xnu_heap_start + + grub_xnu_heap_size + 4096), 4096); + curruntimeaddr = firstruntimeaddr; + for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++) + { + grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) + ((char *) memory_map + descriptor_size * i); + + curdesc->virtual_start = curdesc->physical_start; + + if (curdesc->type == GRUB_EFI_RUNTIME_SERVICES_DATA + || curdesc->type == GRUB_EFI_RUNTIME_SERVICES_CODE) + { + curdesc->virtual_start = ALIGN_UP (curruntimeaddr, 4096); + curruntimeaddr += curdesc->num_pages << 12; + if (curdesc->physical_start + <= PTR_TO_UINT64 (grub_autoefi_system_table) + && curdesc->physical_start + (curdesc->num_pages << 12) + > PTR_TO_UINT64 (grub_autoefi_system_table)) + bootparams_relloc->efi_system_table + = PTR_TO_UINT64 (grub_autoefi_system_table) + - curdesc->physical_start + curdesc->virtual_start; + if (SIZEOF_OF_UINTN == 8) + curdesc->virtual_start |= 0xffffff8000000000ULL; + } + } + + lastruntimeaddr = curruntimeaddr; + + bootparams_relloc->heap_start = grub_xnu_heap_will_be_at; + bootparams_relloc->heap_size = grub_xnu_heap_size; bootparams_relloc->efi_runtime_first_page = firstruntimeaddr / GRUB_XNU_PAGESIZE; bootparams_relloc->efi_runtime_npages = ((lastruntimeaddr + GRUB_XNU_PAGESIZE - 1) / GRUB_XNU_PAGESIZE) - (firstruntimeaddr / GRUB_XNU_PAGESIZE); bootparams_relloc->efi_uintnbits = SIZEOF_OF_UINTN * 8; - bootparams_relloc->efi_system_table - = PTR_TO_UINT32 (grub_autoefi_system_table); bootparams_relloc->verminor = GRUB_XNU_BOOTARGS_VERMINOR; bootparams_relloc->vermajor = GRUB_XNU_BOOTARGS_VERMAJOR; From 087c07c4fa73a50c87451e2ad9df89c66b4d6c63 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Thu, 3 Sep 2009 07:53:40 +0000 Subject: [PATCH 1103/1707] 2009-09-03 Colin Watson * kern/i386/pc/startup.S: Fix typo. --- ChangeLog | 4 ++++ kern/i386/pc/startup.S | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index feb735cb3..b0b2cbcf4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-03 Colin Watson + + * kern/i386/pc/startup.S: Fix typo. + 2009-09-02 Vladimir Serbinenko * efiemu/loadcore.c (SUFFIX (grub_efiemu_loadcore_load)): Fix style diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 1a896eda1..529662b93 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -37,7 +37,7 @@ * Note: GRUB is compiled with the options -mrtd and -mregparm=3. * So the first three arguments are passed in %eax, %edx, and %ecx, * respectively, and if a function has a fixed number of arguments - * and the number if greater than three, the function must return + * and the number is greater than three, the function must return * with "ret $N" where N is ((the number of arguments) - 3) * 4. */ From 160034b2bf0b542c510aa3d84ff45340c4723388 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 3 Sep 2009 14:12:27 +0000 Subject: [PATCH 1104/1707] 2009-09-03 Felix Zielcke * INSTALL: Note that GNU Bison 2.3 or later is required. --- ChangeLog | 4 ++++ INSTALL | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b0b2cbcf4..84c051eee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-03 Felix Zielcke + + * INSTALL: Note that GNU Bison 2.3 or later is required. + 2009-09-03 Colin Watson * kern/i386/pc/startup.S: Fix typo. diff --git a/INSTALL b/INSTALL index 6048b1d6e..65993657f 100644 --- a/INSTALL +++ b/INSTALL @@ -13,7 +13,7 @@ configuring the GRUB. * GCC 2.95 or later * GNU Make -* GNU Bison +* GNU Bison 2.3 or later * GNU binutils 2.9.1.0.23 or later * Other standard GNU/Unix tools * Ruby 1.6 or later From 93a81088133d4daea9b6d0935f25d5362f9313de Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 3 Sep 2009 16:32:14 +0000 Subject: [PATCH 1105/1707] 2009-09-03 Magnus Granberg * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler include -fPIE in the default specs. * configure.ac: Check if pie_possible is yes and add -fno-PIE to TARGET_CFLAGS. --- ChangeLog | 7 +++++++ aclocal.m4 | 28 ++++++++++++++++++++++++++++ configure.ac | 8 ++++++++ 3 files changed, 43 insertions(+) diff --git a/ChangeLog b/ChangeLog index 84c051eee..fda47fe51 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-03 Magnus Granberg + + * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler + include -fPIE in the default specs. + * configure.ac: Check if pie_possible is yes and add -fno-PIE + to TARGET_CFLAGS. + 2009-09-03 Felix Zielcke * INSTALL: Note that GNU Bison 2.3 or later is required. diff --git a/aclocal.m4 b/aclocal.m4 index bde935dc9..313b241fa 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -413,3 +413,31 @@ else [fi rm -rf testdir] ]) + +dnl Check if the C compiler supports `-fPIE'. +AC_DEFUN(grub_CHECK_PIE,[ +[# Position independent executable. +pie_possible=yes] +AC_MSG_CHECKING([whether `$CC' has `-fPIE' as default]) +# Is this a reliable test case? +AC_LANG_CONFTEST([[ +#ifdef __PIE__ +int main() { + return 0; +} +#else +#error NO __PIE__ DEFINED +#endif +]]) + +[# `$CC -c -o ...' might not be portable. But, oh, well... Is calling +# `ac_compile' like this correct, after all? +if eval "$ac_compile -S -o conftest.s" 2> /dev/null; then] + AC_MSG_RESULT([yes]) + [# Should we clear up other files as well, having called `AC_LANG_CONFTEST'? + rm -f conftest.s +else + pie_possible=no] + AC_MSG_RESULT([no]) +[fi] +]) diff --git a/configure.ac b/configure.ac index cddd9fe2d..3c4c6dce6 100644 --- a/configure.ac +++ b/configure.ac @@ -346,6 +346,14 @@ fi # Need __enable_execute_stack() for nested function trampolines? grub_CHECK_ENABLE_EXECUTE_STACK +# Position independent executable. +grub_CHECK_PIE +[# Need that, because some distributions ship compilers that include +# `-fPIE' in the default specs. +if [ x"$pie_possible" = xyes ]; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-PIE" +fi] + # Smashing stack protector. grub_CHECK_STACK_PROTECTOR # Need that, because some distributions ship compilers that include From f79572cdd6a05079fde64d4e48ae966da0c6961c Mon Sep 17 00:00:00 2001 From: blusseau Date: Thu, 3 Sep 2009 17:07:08 +0000 Subject: [PATCH 1106/1707] 2009-09-02 Yves BLUSSEAU Embedding loadenv module into grub-emu * conf/i386-pc.rmk (grub_emu_SOURCES): add lib/envblk.c and commands/loadenv.c * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise --- ChangeLog | 13 +++++++++++++ conf/i386-coreboot.rmk | 1 + conf/i386-efi.rmk | 1 + conf/i386-ieee1275.rmk | 1 + conf/i386-pc.rmk | 1 + conf/powerpc-ieee1275.rmk | 1 + conf/sparc64-ieee1275.rmk | 1 + conf/x86_64-efi.rmk | 1 + 8 files changed, 20 insertions(+) diff --git a/ChangeLog b/ChangeLog index fda47fe51..55f059bba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-09-02 Yves BLUSSEAU + + Embedding loadenv module into grub-emu + + * conf/i386-pc.rmk (grub_emu_SOURCES): add lib/envblk.c and + commands/loadenv.c + * conf/i386-coreboot.rmk (grub_emu_SOURCES): Likewise + * conf/i386-efi.rmk (grub_emu_SOURCES): Likewise + * conf/i386-ieee1275.rmk (grub_emu_SOURCES): Likewise + * conf/powerpc-ieee1275.rmk (grub_emu_SOURCES): Likewise + * conf/sparc64-ieee1275.rmk (grub_emu_SOURCES): Likewise + * conf/x86_64-efi.rmk (grub_emu_SOURCES): Likewise + 2009-09-03 Magnus Granberg * aclocal.m4: Add grub_CHECK_PIE. It check if the compiler diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 4e2d1f1ec..09ec7787c 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -112,6 +112,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/password.c commands/keystatus.c \ lib/hexdump.c commands/i386/cpuid.c \ + lib/envblk.c commands/loadenv.c \ disk/host.c disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 18a9a636b..99ab06f64 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -40,6 +40,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/halt.c commands/reboot.c commands/keystatus.c \ commands/i386/cpuid.c \ commands/password.c \ + lib/envblk.c commands/loadenv.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/ext2.c fs/fat.c fs/hfs.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index b426bdd80..4b640de49 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -64,6 +64,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ commands/password.c commands/keystatus.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 8d7d9fca9..bf8fbfb9d 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -122,6 +122,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/handler.c commands/ls.c commands/test.c \ commands/search.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/i386/cpuid.c \ commands/password.c commands/keystatus.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index b294de917..ee7f9ec27 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -45,6 +45,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/password.c commands/keystatus.c \ disk/loopback.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index c44c6ca78..62e951a5e 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -103,6 +103,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/search.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ + lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/password.c commands/keystatus.c \ disk/loopback.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 1a4cf89ed..934cd7284 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -38,6 +38,7 @@ grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ commands/password.c commands/keystatus.c \ + lib/envblk.c commands/loadenv.c \ disk/loopback.c \ \ fs/affs.c fs/cpio.c fs/fat.c fs/ext2.c fs/hfs.c \ From 12d6fc8461b43197a32db6e0efbf56ae4eb95482 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 3 Sep 2009 19:19:59 +0200 Subject: [PATCH 1107/1707] EFI support --- include/grub/autoefi.h | 2 + include/grub/efi/api.h | 1 + include/grub/efi/efi.h | 8 ++-- kern/efi/efi.c | 10 ++--- loader/i386/xnu.c | 100 ++++++++++++++++++++++------------------- 5 files changed, 65 insertions(+), 56 deletions(-) diff --git a/include/grub/autoefi.h b/include/grub/autoefi.h index 4f5e262f0..245bc0802 100644 --- a/include/grub/autoefi.h +++ b/include/grub/autoefi.h @@ -27,6 +27,7 @@ # include # define grub_autoefi_get_memory_map grub_efi_get_memory_map # define grub_autoefi_finish_boot_services grub_efi_finish_boot_services +# define grub_autoefi_exit_boot_services grub_efi_exit_boot_services # define grub_autoefi_system_table grub_efi_system_table # define grub_autoefi_mmap_iterate grub_machine_mmap_iterate # define grub_autoefi_set_virtual_address_map grub_efi_set_virtual_address_map @@ -55,6 +56,7 @@ static inline grub_err_t grub_autoefi_prepare (void) # include # define grub_autoefi_get_memory_map grub_efiemu_get_memory_map # define grub_autoefi_finish_boot_services grub_efiemu_finish_boot_services +# define grub_autoefi_exit_boot_services grub_efiemu_exit_boot_services # define grub_autoefi_system_table grub_efiemu_system_table # define grub_autoefi_mmap_iterate grub_efiemu_mmap_iterate # define grub_autoefi_prepare grub_efiemu_prepare diff --git a/include/grub/efi/api.h b/include/grub/efi/api.h index e870eab41..32904150e 100644 --- a/include/grub/efi/api.h +++ b/include/grub/efi/api.h @@ -21,6 +21,7 @@ #define GRUB_EFI_API_HEADER 1 #include +#include /* For consistency and safety, we name the EFI-defined types differently. All names are transformed into lower case, _t appended, and diff --git a/include/grub/efi/efi.h b/include/grub/efi/efi.h index 754c4a7cb..97051f297 100644 --- a/include/grub/efi/efi.h +++ b/include/grub/efi/efi.h @@ -57,10 +57,10 @@ int EXPORT_FUNC(grub_efi_exit_boot_services) (grub_efi_uintn_t map_key); void EXPORT_FUNC (grub_reboot) (void); void EXPORT_FUNC (grub_halt) (void); int EXPORT_FUNC (grub_efi_finish_boot_services) (void); -grub_err_t EXPORT_FUNC (grub_efiemu_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version, - grub_efi_memory_descriptor_t *virtual_map); +grub_err_t EXPORT_FUNC (grub_efi_set_virtual_address_map) (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version, + grub_efi_memory_descriptor_t *virtual_map); void grub_efi_mm_init (void); void grub_efi_mm_fini (void); diff --git a/kern/efi/efi.c b/kern/efi/efi.c index 630f012b6..279d1d61b 100644 --- a/kern/efi/efi.c +++ b/kern/efi/efi.c @@ -189,10 +189,10 @@ grub_efi_exit_boot_services (grub_efi_uintn_t map_key) } grub_err_t -grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, - grub_efi_uintn_t descriptor_size, - grub_efi_uint32_t descriptor_version, - grub_efi_memory_descriptor_t *virtual_map) +grub_efi_set_virtual_address_map (grub_efi_uintn_t memory_map_size, + grub_efi_uintn_t descriptor_size, + grub_efi_uint32_t descriptor_version, + grub_efi_memory_descriptor_t *virtual_map) { grub_efi_runtime_services_t *r; grub_efi_status_t status; @@ -204,7 +204,7 @@ grub_efiemu_set_virtual_address_map (grub_efi_uintn_t memory_map_size, if (status == GRUB_EFI_SUCCESS) return GRUB_ERR_NONE; - return grub_errno (GRUB_ERR_IO, "set_virtual_address_map failed"); + return grub_error (GRUB_ERR_IO, "set_virtual_address_map failed"); } grub_uint32_t diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index 0b110bab6..59721155a 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -452,21 +452,15 @@ grub_xnu_boot (void) descriptor_size = 0; descriptor_version = 0; - if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, - &map_key, &descriptor_size, - &descriptor_version) < 0) - return grub_errno; + grub_dprintf ("xnu", "eip=%x\n", grub_xnu_entry_point); - memory_map = grub_xnu_heap_malloc (memory_map_size); - if (! memory_map) - return grub_errno; + const char *debug = grub_env_get ("debug"); - if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, - &map_key, &descriptor_size, - &descriptor_version) <= 0) - return grub_errno; - mmap_relloc_off = (grub_uint8_t *) memory_map - - (grub_uint8_t *) grub_xnu_heap_start; + if (debug && (grub_strword (debug, "all") || grub_strword (debug, "xnu"))) + { + grub_printf ("Press any key to launch xnu\n"); + grub_getkey (); + } /* Relocate the boot parameters to heap. */ bootparams_relloc = grub_xnu_heap_malloc (sizeof (*bootparams_relloc)); @@ -474,6 +468,37 @@ grub_xnu_boot (void) return grub_errno; bootparams_relloc_off = (grub_uint8_t *) bootparams_relloc - (grub_uint8_t *) grub_xnu_heap_start; + + /* Set video. */ + err = grub_xnu_set_video (bootparams_relloc); + if (err != GRUB_ERR_NONE) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + grub_printf ("Booting in blind mode\n"); + + bootparams_relloc->lfb_mode = 0; + bootparams_relloc->lfb_width = 0; + bootparams_relloc->lfb_height = 0; + bootparams_relloc->lfb_depth = 0; + bootparams_relloc->lfb_line_len = 0; + bootparams_relloc->lfb_base = 0; + } + + if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, + &map_key, &descriptor_size, + &descriptor_version) < 0) + return grub_errno; + + /* We will do few allocations later. Reserve some space for possible + memory map growth. */ + memory_map_size += 20 * descriptor_size; + memory_map = grub_xnu_heap_malloc (memory_map_size); + if (! memory_map) + return grub_errno; + mmap_relloc_off = (grub_uint8_t *) memory_map + - (grub_uint8_t *) grub_xnu_heap_start; + err = grub_xnu_writetree_toheap (&devtree, &devtreelen); if (err) return err; @@ -487,18 +512,20 @@ grub_xnu_boot (void) + grub_xnu_heap_will_be_at; bootparams_relloc->devtreelen = devtreelen; - bootparams_relloc->efi_system_table - = PTR_TO_UINT32 (grub_autoefi_system_table); - bootparams_relloc->efi_mmap = grub_xnu_heap_will_be_at + mmap_relloc_off; - bootparams_relloc->efi_mmap_size = memory_map_size; - bootparams_relloc->efi_mem_desc_size = descriptor_size; - bootparams_relloc->efi_mem_desc_version = descriptor_version; - memory_map = (grub_efi_memory_descriptor_t *) ((grub_uint8_t *) grub_xnu_heap_start + mmap_relloc_off); firstruntimeaddr = ALIGN_UP (((grub_addr_t) grub_xnu_heap_start + grub_xnu_heap_size + 4096), 4096); curruntimeaddr = firstruntimeaddr; + + if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, + &map_key, &descriptor_size, + &descriptor_version) <= 0) + return grub_errno; + + bootparams_relloc->efi_system_table + = PTR_TO_UINT32 (grub_autoefi_system_table); + for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++) { grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) @@ -525,6 +552,11 @@ grub_xnu_boot (void) lastruntimeaddr = curruntimeaddr; + bootparams_relloc->efi_mmap = grub_xnu_heap_will_be_at + mmap_relloc_off; + bootparams_relloc->efi_mmap_size = memory_map_size; + bootparams_relloc->efi_mem_desc_size = descriptor_size; + bootparams_relloc->efi_mem_desc_version = descriptor_version; + bootparams_relloc->heap_start = grub_xnu_heap_will_be_at; bootparams_relloc->heap_size = grub_xnu_heap_size; bootparams_relloc->efi_runtime_first_page = firstruntimeaddr @@ -545,39 +577,13 @@ grub_xnu_boot (void) grub_xnu_launch = (void (*) (void)) (grub_xnu_heap_start + grub_xnu_heap_size); #endif - grub_dprintf ("xnu", "eip=%x\n", grub_xnu_entry_point); - grub_dprintf ("xnu", "launch=%p\n", grub_xnu_launch); - - const char *debug = grub_env_get ("debug"); - - if (debug && (grub_strword (debug, "all") || grub_strword (debug, "xnu"))) - { - grub_printf ("Press any key to launch xnu\n"); - grub_getkey (); - } - - /* Set video. */ - err = grub_xnu_set_video (bootparams_relloc); - if (err != GRUB_ERR_NONE) - { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - grub_printf ("Booting in blind mode\n"); - - bootparams_relloc->lfb_mode = 0; - bootparams_relloc->lfb_width = 0; - bootparams_relloc->lfb_height = 0; - bootparams_relloc->lfb_depth = 0; - bootparams_relloc->lfb_line_len = 0; - bootparams_relloc->lfb_base = 0; - } grub_memcpy (grub_xnu_heap_start + grub_xnu_heap_size, grub_xnu_launcher_start, grub_xnu_launcher_end - grub_xnu_launcher_start); - if (! grub_autoefi_finish_boot_services ()) + if (! grub_autoefi_exit_boot_services (map_key)) return grub_error (GRUB_ERR_IO, "can't exit boot services"); grub_autoefi_set_virtual_address_map (memory_map_size, descriptor_size, From 77c55a8749fb69a6a2946bfcab7a06c857d05c12 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Thu, 3 Sep 2009 23:00:25 +0000 Subject: [PATCH 1108/1707] 2009-09-03 Colin Watson * configure.ac: By default, GCC 4.4 generates .eh_frame sections containing unwind information in some cases where it previously did not. Use -fno-dwarf2-cfi-asm if available to restore the old behaviour. See http://patchwork.kernel.org/patch/8555/ for related discussion. --- ChangeLog | 8 ++++++++ configure.ac | 17 +++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/ChangeLog b/ChangeLog index 55f059bba..bafb163e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-03 Colin Watson + + * configure.ac: By default, GCC 4.4 generates .eh_frame sections + containing unwind information in some cases where it previously did + not. Use -fno-dwarf2-cfi-asm if available to restore the old + behaviour. See http://patchwork.kernel.org/patch/8555/ for related + discussion. + 2009-09-02 Yves BLUSSEAU Embedding loadenv module into grub-emu diff --git a/configure.ac b/configure.ac index 3c4c6dce6..59e046363 100644 --- a/configure.ac +++ b/configure.ac @@ -246,6 +246,23 @@ if test "x$TARGET_CFLAGS" = x; then TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" fi fi + + # By default, GCC 4.4 generates .eh_frame sections containing unwind + # information in some cases where it previously did not. GRUB doesn't need + # these and they just use up vital space. Restore the old compiler + # behaviour. + AC_CACHE_CHECK([whether -fno-dwarf2-cfi-asm works], [grub_cv_cc_fno_dwarf2_cfi_asm], [ + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -fno-dwarf2-cfi-asm" + AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[]])], + [grub_cv_cc_fno_dwarf2_cfi_asm=yes], + [grub_cv_cc_fno_dwarf2_cfi_asm=no]) + CFLAGS="$SAVE_CFLAGS" + ]) + + if test "x$grub_cv_cc_fno_dwarf2_cfi_asm" = xyes; then + TARGET_CFLAGS="$TARGET_CFLAGS -fno-dwarf2-cfi-asm" + fi fi grub_apple_target_cc From 4ff0d7a4b8e0345ce32fea4407b73bd08a9aa8ef Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 4 Sep 2009 12:08:43 +0000 Subject: [PATCH 1109/1707] 2009-09-04 Robert Millan * configure.ac: Bump version to 1.97~beta2. * docs/version.texi: Likewise. --- ChangeLog | 5 +++++ configure.ac | 2 +- docs/version.texi | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index bafb163e5..a12ef99e3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-04 Robert Millan + + * configure.ac: Bump version to 1.97~beta2. + * docs/version.texi: Likewise. + 2009-09-03 Colin Watson * configure.ac: By default, GCC 4.4 generates .eh_frame sections diff --git a/configure.ac b/configure.ac index 59e046363..551605812 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT([GRUB],[1.97~beta1],[bug-grub@gnu.org]) +AC_INIT([GRUB],[1.97~beta2],[bug-grub@gnu.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) diff --git a/docs/version.texi b/docs/version.texi index 4528c7b2e..04c8473f4 100644 --- a/docs/version.texi +++ b/docs/version.texi @@ -1,4 +1,4 @@ @set UPDATED 7 Ago 2009 @set UPDATED-MONTH Ago 2009 -@set EDITION 1.97~beta1 -@set VERSION 1.97~beta1 +@set EDITION 1.97~beta2 +@set VERSION 1.97~beta2 From 70ba68ce8264b5fbb5441e51863965db9baadb4a Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 4 Sep 2009 12:59:54 +0000 Subject: [PATCH 1110/1707] 2009-09-04 Colin Watson * NEWS: Mention `keystatus' and Unicode fonts. --- ChangeLog | 4 ++++ NEWS | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index a12ef99e3..826bbc2b8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-04 Colin Watson + + * NEWS: Mention `keystatus' and Unicode fonts. + 2009-09-04 Robert Millan * configure.ac: Bump version to 1.97~beta2. diff --git a/NEWS b/NEWS index c54095e9b..03ba6a268 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,9 @@ New in 1.97 - : +* Add `keystatus' command. + +* Unicode fonts are now used by default. + * Add `hdparm' command. * Add support for getting the current date and time from CMOS as variables. From 197f76c741caf9e67ba0f4bdf5a708f80f5cd049 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 4 Sep 2009 13:16:07 +0000 Subject: [PATCH 1111/1707] 2009-09-04 Vladimir Serbinenko * loader/i386/xnu.c (grub_cpu_xnu_fill_devicetree): Remove unnecessary calls to grub_error. --- ChangeLog | 5 +++++ loader/i386/xnu.c | 15 ++++++--------- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/ChangeLog b/ChangeLog index 826bbc2b8..7d4946b6e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-04 Vladimir Serbinenko + + * loader/i386/xnu.c (grub_cpu_xnu_fill_devicetree): Remove + unnecessary calls to grub_error. + 2009-09-04 Colin Watson * NEWS: Mention `keystatus' and Unicode fonts. diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index 06e375c69..39b02c7a3 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -247,7 +247,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = (SYSTEM_TABLE_SIZEOF (firmware_revision)); curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + return grub_errno; grub_memcpy (curval->data, (SYSTEM_TABLE_VAR(firmware_revision)), curval->datasize); @@ -268,7 +268,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = sizeof ("EFI32"); curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + return grub_errno; if (SIZEOF_OF_UINTN == 4) grub_memcpy (curval->data, "EFI32", curval->datasize); else @@ -287,7 +287,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = sizeof (grub_uint64_t); curval->data = grub_malloc (curval->datasize); if (!curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + return grub_errno; /* First see if user supplies the value. */ char *fsbvar = grub_env_get ("fsb"); @@ -373,8 +373,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = SIZEOF_OF_UINTN; curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "couldn't create device tree"); + return grub_errno; if (SIZEOF_OF_UINTN == 4) *((grub_uint32_t *)curval->data) = PTR_TO_UINT32 (ptr); else @@ -392,8 +391,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = grub_strlen (table_aliases[j].name) + 1; curval->data = grub_malloc (curval->datasize); if (!curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "couldn't create device tree"); + return grub_errno; grub_memcpy (curval->data, table_aliases[j].name, curval->datasize); } } @@ -409,8 +407,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = SIZEOF_OF_UINTN; curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "couldn't create device tree"); + return grub_errno; if (SIZEOF_OF_UINTN == 4) *((grub_uint32_t *) curval->data) = PTR_TO_UINT32 (SYSTEM_TABLE_PTR (runtime_services)); From 55fe0517d402539e0aa0d23a276f2e60d1fe3b02 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 4 Sep 2009 15:31:09 +0200 Subject: [PATCH 1112/1707] page-based counting. conditional or ffffff8... --- loader/i386/xnu.c | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index ca971e675..e7590bf1a 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -431,8 +431,8 @@ grub_xnu_boot (void) grub_efi_uintn_t map_key = 0; grub_efi_uintn_t descriptor_size = 0; grub_efi_uint32_t descriptor_version = 0; - grub_uint64_t firstruntimeaddr, lastruntimeaddr; - grub_uint64_t curruntimeaddr; + grub_uint64_t firstruntimepage, lastruntimepage; + grub_uint64_t curruntimepage; void *devtree; grub_size_t devtreelen; int i; @@ -523,6 +523,11 @@ grub_xnu_boot (void) bootparams_relloc->efi_system_table = PTR_TO_UINT32 (grub_autoefi_system_table); + firstruntimepage = (((grub_addr_t) grub_xnu_heap_will_be_at + + grub_xnu_heap_size + GRUB_XNU_PAGESIZE - 1) + / GRUB_XNU_PAGESIZE) + 20; + curruntimepage = firstruntimepage; + for (i = 0; (unsigned) i < memory_map_size / descriptor_size; i++) { grub_efi_memory_descriptor_t *curdesc = (grub_efi_memory_descriptor_t *) @@ -533,8 +538,8 @@ grub_xnu_boot (void) if (curdesc->type == GRUB_EFI_RUNTIME_SERVICES_DATA || curdesc->type == GRUB_EFI_RUNTIME_SERVICES_CODE) { - curdesc->virtual_start = ALIGN_UP (curruntimeaddr, 4096); - curruntimeaddr += curdesc->num_pages << 12; + curdesc->virtual_start = curruntimepage << 12; + curruntimepage += curdesc->num_pages; if (curdesc->physical_start <= PTR_TO_UINT64 (grub_autoefi_system_table) && curdesc->physical_start + (curdesc->num_pages << 12) @@ -542,12 +547,12 @@ grub_xnu_boot (void) bootparams_relloc->efi_system_table = PTR_TO_UINT64 (grub_autoefi_system_table) - curdesc->physical_start + curdesc->virtual_start; - if (SIZEOF_OF_UINTN == 8) + if (SIZEOF_OF_UINTN == 8 && grub_xnu_is_64bit) curdesc->virtual_start |= 0xffffff8000000000ULL; } } - lastruntimeaddr = curruntimeaddr; + lastruntimepage = curruntimepage; bootparams_relloc->efi_mmap = grub_xnu_heap_will_be_at + mmap_relloc_off; bootparams_relloc->efi_mmap_size = memory_map_size; From 975146895ca46b0c9dca1481d366c6a054aed851 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 4 Sep 2009 13:50:32 +0000 Subject: [PATCH 1113/1707] missing part of previous commit --- loader/i386/xnu.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index 39b02c7a3..275b50dbc 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -258,7 +258,7 @@ grub_cpu_xnu_fill_devicetree (void) 2 * (utf16_strlen (SYSTEM_TABLE_PTR (firmware_vendor)) + 1); curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, "couldn't create device tree"); + return grub_errno; grub_memcpy (curval->data, SYSTEM_TABLE_PTR (firmware_vendor), curval->datasize); @@ -362,8 +362,7 @@ grub_cpu_xnu_fill_devicetree (void) curval->datasize = sizeof (guid); curval->data = grub_malloc (curval->datasize); if (! curval->data) - return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "couldn't create device tree"); + return grub_errno; grub_memcpy (curval->data, &guid, curval->datasize); /* The value "table". */ From 3a613259b5d4820c80dfa1009e43052c6c6cddde Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sat, 5 Sep 2009 19:26:11 +0000 Subject: [PATCH 1114/1707] 2009-09-05 Felix Zielcke * gendistlist.sh: Add `grub-dumpdevtree' and `*.lua' to the list find searches for. --- ChangeLog | 5 +++++ gendistlist.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 7d4946b6e..155a19b5a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-05 Felix Zielcke + + * gendistlist.sh: Add `grub-dumpdevtree' and `*.lua' to the list + find searches for. + 2009-09-04 Vladimir Serbinenko * loader/i386/xnu.c (grub_cpu_xnu_fill_devicetree): Remove diff --git a/gendistlist.sh b/gendistlist.sh index 5fe5d186b..3278ed0b3 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -39,6 +39,6 @@ for dir in $DISTDIRS; do find $d -maxdepth 1 -name '*.[chSy]' -o -name '*.mk' -o -name '*.rmk' \ -o -name '*.rb' -o -name '*.in' -o -name '*.tex' -o -name '*.texi' \ -o -name 'grub.cfg' -o -name 'README' -o -name '*.sc' -o -name 'mdate-sh' \ - -o -name '*.sh' | sort + -o -name '*.sh' -o -name 'grub-dumpdevtree' -o -name '*.lua' | sort done done From 7f26d4665b4746980ae2231d17334e7be6dd3d55 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 5 Sep 2009 20:36:49 +0000 Subject: [PATCH 1115/1707] 2009-09-05 Robert Millan * util/grub-probe.c (probe): Comment out buggy codepath, which was unexpectedly enabled by Colin Watson's 2009-09-02 fix. This should be re-enabled after 1.97. --- ChangeLog | 6 ++++++ util/grub-probe.c | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index 155a19b5a..262a25076 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-05 Robert Millan + + * util/grub-probe.c (probe): Comment out buggy codepath, which + was unexpectedly enabled by Colin Watson's 2009-09-02 fix. This + should be re-enabled after 1.97. + 2009-09-05 Felix Zielcke * gendistlist.sh: Add `grub-dumpdevtree' and `*.lua' to the list diff --git a/util/grub-probe.c b/util/grub-probe.c index 3c54408c3..4e3f96451 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -235,6 +235,9 @@ probe (const char *path, char *device_name) if (print == PRINT_FS) { + /* FIXME: `path' can't be used to read a file via GRUB facilities, + because it's not relative to its root. */ +#if 0 struct stat st; stat (path, &st); @@ -258,6 +261,8 @@ probe (const char *path, char *device_name) if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size)) grub_util_error ("files differ"); } +#endif + printf ("%s\n", fs->name); } From 444eea11fc6ef54aa3cfb53904323d27bd0c2e7d Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 6 Sep 2009 00:25:33 +0200 Subject: [PATCH 1116/1707] fix --- loader/i386/xnu.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/loader/i386/xnu.c b/loader/i386/xnu.c index e7590bf1a..856e0148c 100644 --- a/loader/i386/xnu.c +++ b/loader/i386/xnu.c @@ -511,9 +511,6 @@ grub_xnu_boot (void) memory_map = (grub_efi_memory_descriptor_t *) ((grub_uint8_t *) grub_xnu_heap_start + mmap_relloc_off); - firstruntimeaddr = ALIGN_UP (((grub_addr_t) grub_xnu_heap_start - + grub_xnu_heap_size + 4096), 4096); - curruntimeaddr = firstruntimeaddr; if (grub_autoefi_get_memory_map (&memory_map_size, memory_map, &map_key, &descriptor_size, @@ -561,11 +558,9 @@ grub_xnu_boot (void) bootparams_relloc->heap_start = grub_xnu_heap_will_be_at; bootparams_relloc->heap_size = grub_xnu_heap_size; - bootparams_relloc->efi_runtime_first_page = firstruntimeaddr - / GRUB_XNU_PAGESIZE; - bootparams_relloc->efi_runtime_npages - = ((lastruntimeaddr + GRUB_XNU_PAGESIZE - 1) / GRUB_XNU_PAGESIZE) - - (firstruntimeaddr / GRUB_XNU_PAGESIZE); + bootparams_relloc->efi_runtime_first_page = firstruntimepage; + + bootparams_relloc->efi_runtime_npages = lastruntimepage - firstruntimepage; bootparams_relloc->efi_uintnbits = SIZEOF_OF_UINTN * 8; bootparams_relloc->verminor = GRUB_XNU_BOOTARGS_VERMINOR; From 9a86f1ecb90c57fd224fca6985325adef12870e1 Mon Sep 17 00:00:00 2001 From: blusseau Date: Sun, 6 Sep 2009 10:25:19 +0000 Subject: [PATCH 1117/1707] 2009-09-06 Yves Blusseau * Makefile.in (RMKFILES): add i386-qemu.rmk (MAINTAINER_CLEANFILES): add $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in --- ChangeLog | 6 ++++++ Makefile.in | 5 +++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 262a25076..d4967e1ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-06 Yves Blusseau + + * Makefile.in (RMKFILES): add i386-qemu.rmk + (MAINTAINER_CLEANFILES): add $(srcdir)/DISTLIST $(srcdir)/config.h.in + $(srcdir)/stamp-h.in + 2009-09-05 Robert Millan * util/grub-probe.c (probe): Comment out buggy codepath, which diff --git a/Makefile.in b/Makefile.in index 8e2cdc6c4..7c5adbc61 100644 --- a/Makefile.in +++ b/Makefile.in @@ -111,7 +111,7 @@ enable_efiemu = @enable_efiemu@ ### General variables. RMKFILES = $(addprefix conf/,common.rmk i386-coreboot.rmk i386-efi.rmk \ - i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \ + i386-qemu.rmk i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \ sparc64-ieee1275.rmk x86_64-efi.rmk) MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) @@ -128,7 +128,8 @@ MOSTLYCLEANFILES = DISTCLEANFILES = config.status config.cache config.log config.h \ Makefile stamp-h include/grub/cpu include/grub/machine \ gensymlist.sh genkernsyms.sh build_env.mk -MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) +MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) \ + $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in # The default target. all: all-local From e30d87ad5524903d2425fb859e7e8dc87efd60d7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 6 Sep 2009 15:20:33 +0000 Subject: [PATCH 1118/1707] 2009-09-06 Robert Millan * INSTALL: Require GCC 4.1.3 or later. --- ChangeLog | 4 ++++ INSTALL | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d4967e1ed..b2d543687 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-06 Robert Millan + + * INSTALL: Require GCC 4.1.3 or later. + 2009-09-06 Yves Blusseau * Makefile.in (RMKFILES): add i386-qemu.rmk diff --git a/INSTALL b/INSTALL index 65993657f..e751d508f 100644 --- a/INSTALL +++ b/INSTALL @@ -11,7 +11,7 @@ GRUB depends on some software packages installed into your system. If you don't have any of them, please obtain and install them before configuring the GRUB. -* GCC 2.95 or later +* GCC 4.1.3 or later * GNU Make * GNU Bison 2.3 or later * GNU binutils 2.9.1.0.23 or later From 44454e4c2400fccb27dd194e6e85c81d209bbad3 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 8 Sep 2009 15:00:28 +0000 Subject: [PATCH 1119/1707] 2009-09-08 Felix Zielcke * kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try `help' if the command exists. --- ChangeLog | 5 +++++ kern/rescue_parser.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index b2d543687..8ac9309a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-08 Felix Zielcke + + * kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try + `help' if the command exists. + 2009-09-06 Robert Millan * INSTALL: Require GCC 4.1.3 or later. diff --git a/kern/rescue_parser.c b/kern/rescue_parser.c index 79f32b8fd..1e0841e49 100644 --- a/kern/rescue_parser.c +++ b/kern/rescue_parser.c @@ -61,7 +61,8 @@ grub_rescue_parse_line (char *line, grub_reader_getline_t getline) else { grub_printf ("Unknown command `%s'\n", name); - grub_printf ("Try `help' for usage\n"); + if (grub_command_find ("help")) + grub_printf ("Try `help' for usage\n"); } quit: From 99423078e4509200cbf0332116aade1412aed585 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Tue, 8 Sep 2009 19:10:34 +0000 Subject: [PATCH 1120/1707] 2009-09-08 Colin Watson * script/sh/execute.c (grub_script_execute_cmdline): Set "?" in unknown-command case. Fixes bug #27320. --- ChangeLog | 5 +++++ script/sh/execute.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 8ac9309a4..a7aad1f70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-08 Colin Watson + + * script/sh/execute.c (grub_script_execute_cmdline): Set "?" in + unknown-command case. Fixes bug #27320. + 2009-09-08 Felix Zielcke * kern/rescue_parser.c (grub_rescue_parse_line): Only suggest to try diff --git a/script/sh/execute.c b/script/sh/execute.c index e0b7b2ebf..e9064ad2f 100644 --- a/script/sh/execute.c +++ b/script/sh/execute.c @@ -122,6 +122,10 @@ grub_script_execute_cmdline (struct grub_script_cmd *cmd) grub_errno = GRUB_ERR_NONE; } grub_free (assign); + + grub_sprintf (errnobuf, "%d", grub_errno); + grub_env_set ("?", errnobuf); + return 0; } } From 80a608f3879e390442c2c31874b2efc977596288 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 9 Sep 2009 12:53:11 +0000 Subject: [PATCH 1121/1707] 2009-09-09 Felix Zielcke * config.guess: Update to lastest versiom from config git. * config.sub: Likewise. --- ChangeLog | 5 ++++ config.guess | 81 ++++++++++++++++++++-------------------------------- config.sub | 34 ++++++++++++++++------ 3 files changed, 62 insertions(+), 58 deletions(-) diff --git a/ChangeLog b/ChangeLog index a7aad1f70..d72ef31ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-09 Felix Zielcke + + * config.guess: Update to lastest versiom from config git. + * config.sub: Likewise. + 2009-09-08 Colin Watson * script/sh/execute.c (grub_script_execute_cmdline): Set "?" in diff --git a/config.guess b/config.guess index 3f51f4ea9..bb0b03ea1 100644 --- a/config.guess +++ b/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2008-12-19' +timestamp='2009-08-19' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2008-12-19' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -170,7 +170,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -324,6 +324,9 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; @@ -653,7 +656,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -819,6 +822,9 @@ EOF [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -879,40 +885,17 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips - #undef mipsel + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 + CPU=${UNAME_MACHINE} #else CPU= #endif @@ -944,7 +927,7 @@ EOF EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null + objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} exit ;; @@ -998,14 +981,6 @@ EOF elf32-i386) TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; esac # Determine whether the default compiler is a.out or elf eval $set_cc_for_build @@ -1071,7 +1046,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1115,8 +1090,11 @@ EOF pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 @@ -1176,7 +1154,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1350,6 +1328,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/config.sub b/config.sub index d8573e81c..8ca084bf3 100644 --- a/config.sub +++ b/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2009-01-19' +timestamp='2009-08-19' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2009-01-19' # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -149,10 +152,13 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -272,6 +278,7 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ | nios | nios2 \ @@ -336,7 +343,7 @@ case $basic_machine in | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -446,6 +453,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -462,6 +473,10 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; c90) basic_machine=c90-cray os=-unicos @@ -714,6 +729,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -1255,11 +1273,11 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1608,7 +1626,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) From a2094832ae5e6ab14dcf827094e3a7711dfe1481 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 9 Sep 2009 19:46:10 +0000 Subject: [PATCH 1122/1707] fix typos in previous changelog entry --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index d72ef31ae..27046c39c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2009-09-09 Felix Zielcke - * config.guess: Update to lastest versiom from config git. + * config.guess: Update to latest version from config git. * config.sub: Likewise. 2009-09-08 Colin Watson From ad8ea1f4c25082dcb65f14f9971757c3e74af360 Mon Sep 17 00:00:00 2001 From: proski Date: Wed, 9 Sep 2009 21:40:17 +0000 Subject: [PATCH 1123/1707] Typo fixes --- ChangeLog | 8 ++++---- bus/usb/usbtrans.c | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 27046c39c..220bbaaf1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -280,7 +280,7 @@ (grub_afs_to_cpu64): ...this. All users updated. (GRUB_AFS_BO_LITTLE_ENDIAN): Remove. (GRUB_AFS_BO_BIG_ENDIAN): Likewise. - (grub_afs_validate_sblock): Check only one endiannness. + (grub_afs_validate_sblock): Check only one endianness. (GRUB_MOD_INIT (befs)) [MODE_BIGENDIAN && MODE_BFS]: Rename to .. (GRUB_MOD_INIT (befs_be)) [MODE_BIGENDIAN && MODE_BFS]: ... this. (GRUB_MOD_INIT (afs)) [MODE_BIGENDIAN && !MODE_BFS]: Rename to .. @@ -449,7 +449,7 @@ and OPENBSD_MMAP_NVS. Add memory map terminator Explicit cast when calling grub_unix_real_boot. - (grub_nebsd_boot): Explicit cast when calling grub_unix_real_boot. + (grub_netbsd_boot): Explicit cast when calling grub_unix_real_boot. 2009-08-24 Vladimir Serbinenko @@ -1010,7 +1010,7 @@ 2009-07-30 Vladimir Serbinenko * util/i386/pc/grub-setup.c (setup): Check that no partition is in - embeding zone, not only the first one. + embedding zone, not only the first one. 2009-07-29 Joe Auricchio @@ -1083,7 +1083,7 @@ instead of WORDS_BIGENDIAN. Use grub_le_to_cpu32(), so that the case of little endian words becomes just an optimization. Respect const modifier. - (md5_final): Use code that doesn't depend on endianess. + (md5_final): Use code that doesn't depend on endianness. * include/grub/misc.h (ALIGN_UP): Cast align to the type of addr to avoid loss of upper bits if align is unsigned and shorter diff --git a/bus/usb/usbtrans.c b/bus/usb/usbtrans.c index e4beb4550..09e7af83e 100644 --- a/bus/usb/usbtrans.c +++ b/bus/usb/usbtrans.c @@ -74,7 +74,7 @@ grub_usb_control_msg (grub_usb_device_t dev, return grub_errno; } - /* Build a Setup packet. XXX: Endianess. */ + /* Build a Setup packet. XXX: Endianness. */ setupdata.reqtype = reqtype; setupdata.request = request; setupdata.value = value; From c0d343875af4064566652d04de3e9ef3a6637250 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 9 Sep 2009 22:31:51 +0000 Subject: [PATCH 1124/1707] 2009-09-10 Felix Zielcke * docs/grub.cfg: Add an example menu entry for memtest86+. --- ChangeLog | 4 ++++ docs/grub.cfg | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/ChangeLog b/ChangeLog index 220bbaaf1..a744ca43d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-10 Felix Zielcke + + * docs/grub.cfg: Add an example menu entry for memtest86+. + 2009-09-09 Felix Zielcke * config.guess: Update to latest version from config git. diff --git a/docs/grub.cfg b/docs/grub.cfg index 7f02727d0..4d1582a8e 100644 --- a/docs/grub.cfg +++ b/docs/grub.cfg @@ -62,6 +62,12 @@ menuentry "Microsoft Windows" { chainloader +1 } +# For booting Memtest86+ +menuentry "Memtest86+" { + set root=(hd0,1) + linux16 /memtest86+.bin +} + # Change the colors. menuentry "Change the colors" { set menu_color_normal=light-green/brown From 50051d5542f6206ae4e7d9c9e6a04601121ec6f4 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Thu, 10 Sep 2009 12:10:33 +0000 Subject: [PATCH 1125/1707] 2009-09-10 Colin Watson * util/grub.d/40_custom.in: Make it a little clearer how to use this file. --- ChangeLog | 5 +++++ util/grub.d/40_custom.in | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index a744ca43d..48580261c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-10 Colin Watson + + * util/grub.d/40_custom.in: Make it a little clearer how to use this + file. + 2009-09-10 Felix Zielcke * docs/grub.cfg: Add an example menu entry for memtest86+. diff --git a/util/grub.d/40_custom.in b/util/grub.d/40_custom.in index e16d6e3d6..5d967aca9 100644 --- a/util/grub.d/40_custom.in +++ b/util/grub.d/40_custom.in @@ -1,3 +1,5 @@ #!/bin/sh -exec tail -n +3 $0 -# This file is an example on how to add custom entries +# This file provides an easy way to add custom menu entries. Simply type the +# menu entries you want to add after the 'exec tail' line. Be careful not to +# change anything before the 'exec tail' line. +exec tail -n +6 $0 From 3b0521bed212f78c3c6efbf4ba0f86f76ee0209f Mon Sep 17 00:00:00 2001 From: cjwatson Date: Thu, 10 Sep 2009 12:44:24 +0000 Subject: [PATCH 1126/1707] 2009-09-10 Colin Watson * util/grub.d/40_custom.in: Make sure that the explanatory text is visible in grub.cfg. --- ChangeLog | 5 +++++ util/grub.d/40_custom.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 48580261c..a8d86e55d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-10 Colin Watson + + * util/grub.d/40_custom.in: Make sure that the explanatory text is + visible in grub.cfg. + 2009-09-10 Colin Watson * util/grub.d/40_custom.in: Make it a little clearer how to use this diff --git a/util/grub.d/40_custom.in b/util/grub.d/40_custom.in index 5d967aca9..694fc9bc2 100644 --- a/util/grub.d/40_custom.in +++ b/util/grub.d/40_custom.in @@ -1,5 +1,5 @@ #!/bin/sh +exec tail -n +3 $0 # This file provides an easy way to add custom menu entries. Simply type the # menu entries you want to add after the 'exec tail' line. Be careful not to # change anything before the 'exec tail' line. -exec tail -n +6 $0 From 48d9bb0a9378a4639bd44fd0b935bb9974b7b3ed Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 10 Sep 2009 12:53:25 +0000 Subject: [PATCH 1127/1707] 2009-09-10 Robert Millan * util/grub.d/40_custom.in: Ask user to type custom entries below comment, rather than below 'exec tail' line. --- ChangeLog | 5 +++++ util/grub.d/40_custom.in | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index a8d86e55d..63924d917 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-10 Robert Millan + + * util/grub.d/40_custom.in: Ask user to type custom entries below + comment, rather than below 'exec tail' line. + 2009-09-10 Colin Watson * util/grub.d/40_custom.in: Make sure that the explanatory text is diff --git a/util/grub.d/40_custom.in b/util/grub.d/40_custom.in index 694fc9bc2..48068de46 100644 --- a/util/grub.d/40_custom.in +++ b/util/grub.d/40_custom.in @@ -1,5 +1,5 @@ #!/bin/sh exec tail -n +3 $0 -# This file provides an easy way to add custom menu entries. Simply type the -# menu entries you want to add after the 'exec tail' line. Be careful not to -# change anything before the 'exec tail' line. +# This file provides an easy way to add custom menu entries. Simply type the +# menu entries you want to add after this comment. Be careful not to change +# the 'exec tail' line above. From 8aa1541a419efa0cc201308ef5d68918b2567e80 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Thu, 10 Sep 2009 19:04:43 +0000 Subject: [PATCH 1128/1707] 2009-09-10 Felix Zielcke * util/grub-mkconfig.in: Make the created config mode 400 and print a warning if it fails. --- ChangeLog | 5 +++++ util/grub-mkconfig.in | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 63924d917..df1ac0733 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-10 Felix Zielcke + + * util/grub-mkconfig.in: Make the created config mode 400 and + print a warning if it fails. + 2009-09-10 Robert Millan * util/grub.d/40_custom.in: Ask user to type custom entries below diff --git a/util/grub-mkconfig.in b/util/grub-mkconfig.in index d9640e910..a8c267518 100644 --- a/util/grub-mkconfig.in +++ b/util/grub-mkconfig.in @@ -232,7 +232,8 @@ if test "x${grub_cfg}" != "x"; then # Allow this to fail, since /boot/grub/ might need to be fatfs to support some # firmware implementations (e.g. OFW or EFI). - chmod 444 ${grub_cfg}.new || true + chmod 400 ${grub_cfg}.new || grub_warn "Could not make ${grub_cfg}.new readable by only root.\ + This means that if the generated config contains a password it is readable by everyone" fi echo "Generating grub.cfg ..." >&2 From ab6e34cc81c89614502a52b02c9210a8cfc05f86 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 10 Sep 2009 23:54:12 +0200 Subject: [PATCH 1129/1707] missing files --- loader/macho32.c | 18 ++++ loader/macho64.c | 18 ++++ loader/machoXX.c | 234 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 270 insertions(+) create mode 100644 loader/macho32.c create mode 100644 loader/macho64.c create mode 100644 loader/machoXX.c diff --git a/loader/macho32.c b/loader/macho32.c new file mode 100644 index 000000000..0d740eda7 --- /dev/null +++ b/loader/macho32.c @@ -0,0 +1,18 @@ +#include +#include + +#define SUFFIX(x) x ## 32 +typedef struct grub_macho_header32 grub_macho_header_t; +typedef struct grub_macho_segment32 grub_macho_segment_t; +typedef grub_uint32_t grub_macho_addr_t; +typedef struct grub_macho_thread32 grub_macho_thread_t; +#define offsetXX offset32 +#define ncmdsXX ncmds32 +#define cmdsizeXX cmdsize32 +#define cmdsXX cmds32 +#define endXX end32 +#define XX "32" +#define GRUB_MACHO_MAGIC GRUB_MACHO_MAGIC32 +#define GRUB_MACHO_CMD_SEGMENT GRUB_MACHO_CMD_SEGMENT32 +#include "machoXX.c" + diff --git a/loader/macho64.c b/loader/macho64.c new file mode 100644 index 000000000..17a8021e0 --- /dev/null +++ b/loader/macho64.c @@ -0,0 +1,18 @@ +#include +#include + +#define SUFFIX(x) x ## 64 +typedef struct grub_macho_header64 grub_macho_header_t; +typedef struct grub_macho_segment64 grub_macho_segment_t; +typedef grub_uint64_t grub_macho_addr_t; +typedef struct grub_macho_thread64 grub_macho_thread_t; +#define offsetXX offset64 +#define ncmdsXX ncmds64 +#define cmdsizeXX cmdsize64 +#define cmdsXX cmds64 +#define endXX end64 +#define XX "64" +#define GRUB_MACHO_MAGIC GRUB_MACHO_MAGIC64 +#define GRUB_MACHO_CMD_SEGMENT GRUB_MACHO_CMD_SEGMENT64 +#include "machoXX.c" + diff --git a/loader/machoXX.c b/loader/machoXX.c new file mode 100644 index 000000000..b07bab937 --- /dev/null +++ b/loader/machoXX.c @@ -0,0 +1,234 @@ + +#include +#include +#include + +#define min(a,b) (((a) < (b)) ? (a) : (b)) + +int +SUFFIX (grub_macho_contains_macho) (grub_macho_t macho) +{ + return macho->offsetXX != -1; +} + +void +SUFFIX (grub_macho_parse) (grub_macho_t macho) +{ + grub_macho_header_t head; + + /* Is there any candidate at all? */ + if (macho->offsetXX == -1) + return; + + /* Read header and check magic*/ + if (grub_file_seek (macho->file, macho->offsetXX) == (grub_off_t) -1 + || grub_file_read (macho->file, &head, sizeof (head)) + != sizeof(head)) + { + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + macho->offsetXX = -1; + return; + } + if (head.magic != GRUB_MACHO_MAGIC) + { + grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header."); + macho->offsetXX = -1; + return; + } + + /* Read commands. */ + macho->ncmdsXX = head.ncmds; + macho->cmdsizeXX = head.sizeofcmds; + macho->cmdsXX = grub_malloc(macho->cmdsizeXX); + if (! macho->cmdsXX) + { + grub_error (GRUB_ERR_OUT_OF_MEMORY, "not enough memory to read commands"); + return; + } + if (grub_file_read (macho->file, macho->cmdsXX, + (grub_size_t) macho->cmdsizeXX) + != (grub_ssize_t) macho->cmdsizeXX) + { + grub_error (GRUB_ERR_READ_ERROR, "Cannot read Mach-O header."); + macho->offsetXX = -1; + } +} + +typedef int NESTED_FUNC_ATTR (*grub_macho_iter_hook_t) +(grub_macho_t , struct grub_macho_cmd *, + void *); + +static grub_err_t +grub_macho_cmds_iterate (grub_macho_t macho, + grub_macho_iter_hook_t hook, + void *hook_arg) +{ + grub_uint8_t *hdrs = macho->cmdsXX; + int i; + if (! macho->cmdsXX) + return grub_error (GRUB_ERR_BAD_OS, "Couldn't find " XX "-bit Mach-O"); + for (i = 0; i < macho->ncmdsXX; i++) + { + struct grub_macho_cmd *hdr = (struct grub_macho_cmd *) hdrs; + if (hook (macho, hdr, hook_arg)) + break; + hdrs += hdr->cmdsize; + } + + return grub_errno; +} + +grub_size_t +SUFFIX (grub_macho_filesize) (grub_macho_t macho) +{ + if (SUFFIX (grub_macho_contains_macho) (macho)) + return macho->endXX - macho->offsetXX; + return 0; +} + +grub_err_t +SUFFIX (grub_macho_readfile) (grub_macho_t macho, void *dest) +{ + grub_ssize_t read; + if (! SUFFIX (grub_macho_contains_macho) (macho)) + return grub_error (GRUB_ERR_BAD_OS, + "Couldn't read architecture-specific part"); + + if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1) + { + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, + "Invalid offset in program header."); + } + + read = grub_file_read (macho->file, dest, + macho->end32 - macho->offset32); + if (read != (grub_ssize_t) (macho->end32 - macho->offset32)) + { + grub_error_push (); + return grub_error (GRUB_ERR_BAD_OS, + "Couldn't read architecture-specific part"); + } + return GRUB_ERR_NONE; +} + +/* Calculate the amount of memory spanned by the segments. */ +grub_err_t +SUFFIX (grub_macho_size) (grub_macho_t macho, grub_macho_addr_t *segments_start, + grub_macho_addr_t *segments_end, int flags) +{ + int nr_phdrs = 0; + + /* Run through the program headers to calculate the total memory size we + should claim. */ + auto int NESTED_FUNC_ATTR calcsize (grub_macho_t _macho, + struct grub_macho_cmd *phdr, void *_arg); + int NESTED_FUNC_ATTR calcsize (grub_macho_t UNUSED _macho, + struct grub_macho_cmd *hdr0, void UNUSED *_arg) + { + grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0; + if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT) + return 0; + if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) + return 0; + + nr_phdrs++; + if (hdr->vmaddr < *segments_start) + *segments_start = hdr->vmaddr; + if (hdr->vmaddr + hdr->vmsize > *segments_end) + *segments_end = hdr->vmaddr + hdr->vmsize; + return 0; + } + + *segments_start = (grub_macho_addr_t) -1; + *segments_end = 0; + + grub_macho_cmds_iterate (macho, calcsize, 0); + + if (nr_phdrs == 0) + return grub_error (GRUB_ERR_BAD_OS, "No program headers present"); + + if (*segments_end < *segments_start) + /* Very bad addresses. */ + return grub_error (GRUB_ERR_BAD_OS, "Bad program header load addresses"); + + return GRUB_ERR_NONE; +} + +/* Load every loadable segment into memory specified by `_load_hook'. */ +grub_err_t +SUFFIX (grub_macho_load) (grub_macho_t macho, char *offset, int flags) +{ + grub_err_t err = 0; + auto int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, + struct grub_macho_cmd *hdr0, + void UNUSED *_arg); + int NESTED_FUNC_ATTR do_load(grub_macho_t _macho, + struct grub_macho_cmd *hdr0, + void UNUSED *_arg) + { + grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0; + + if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT) + return 0; + + if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) + return 0; + if (! hdr->vmsize) + return 0; + + if (grub_file_seek (_macho->file, hdr->fileoff + + _macho->offsetXX) == (grub_off_t) -1) + { + grub_error_push (); + grub_error (GRUB_ERR_BAD_OS, + "Invalid offset in program header."); + return 1; + } + + if (hdr->filesize) + { + grub_ssize_t read; + read = grub_file_read (_macho->file, offset + hdr->vmaddr, + min (hdr->filesize, hdr->vmsize)); + if (read != (grub_ssize_t) min (hdr->filesize, hdr->vmsize)) + { + /* XXX How can we free memory from `load_hook'? */ + grub_error_push (); + err=grub_error (GRUB_ERR_BAD_OS, + "Couldn't read segment from file: " + "wanted 0x%lx bytes; read 0x%lx bytes.", + hdr->filesize, read); + return 1; + } + } + + if (hdr->filesize < hdr->vmsize) + grub_memset (offset + hdr->vmaddr + hdr->filesize, + 0, hdr->vmsize - hdr->filesize); + return 0; + } + + grub_macho_cmds_iterate (macho, do_load, 0); + + return err; +} + +grub_macho_addr_t +SUFFIX (grub_macho_get_entry_point) (grub_macho_t macho) +{ + grub_macho_addr_t entry_point = 0; + auto int NESTED_FUNC_ATTR hook(grub_macho_t _macho, + struct grub_macho_cmd *hdr, + void UNUSED *_arg); + int NESTED_FUNC_ATTR hook(grub_macho_t UNUSED _macho, + struct grub_macho_cmd *hdr, + void UNUSED *_arg) + { + if (hdr->cmd == GRUB_MACHO_CMD_THREAD) + entry_point = ((grub_macho_thread_t *) hdr)->entry_point; + return 0; + } + grub_macho_cmds_iterate (macho, hook, 0); + return entry_point; +} From 866953751fafe8eea2f1342442c5f42d416bd008 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 11 Sep 2009 14:17:35 +0000 Subject: [PATCH 1130/1707] 2009-09-11 Colin Watson * configure.ac: Don't look for help2man when cross-compiling. Fixes part of bug #27349. --- ChangeLog | 5 +++++ configure.ac | 7 ++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index df1ac0733..4aa111936 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-11 Colin Watson + + * configure.ac: Don't look for help2man when cross-compiling. Fixes + part of bug #27349. + 2009-09-10 Felix Zielcke * util/grub-mkconfig.in: Make the created config mode 400 and diff --git a/configure.ac b/configure.ac index 551605812..b7fa044a5 100644 --- a/configure.ac +++ b/configure.ac @@ -147,7 +147,6 @@ AC_PROG_MAKE_SET # These are not a "must". AC_PATH_PROG(RUBY, ruby) -AC_PATH_PROG(HELP2MAN, help2man) # # Checks for host programs. @@ -171,6 +170,12 @@ if test x$grub_cv_apple_cc = xyes ; then ASFLAGS="$ASFLAGS -DAPPLE_CC=1" fi +if test "x$cross_compiling" = xyes; then + AC_MSG_WARN([cannot generate manual pages while cross compiling]) +else + AC_PATH_PROG(HELP2MAN, help2man) +fi + # Check for functions. AC_CHECK_FUNCS(posix_memalign memalign asprintf) From cda2a409b3d03f41738c33cf3c231b0e2e4a8b01 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 11 Sep 2009 14:26:12 +0000 Subject: [PATCH 1131/1707] 2009-09-11 Colin Watson * include/grub/ntfs.h (struct grub_fshelp_node): Change `size' to grub_uint64_t. * fs/ntfs.c (init_file): Understand 64-bit sizes for non-resident files. --- ChangeLog | 7 +++++++ fs/ntfs.c | 2 +- include/grub/ntfs.h | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4aa111936..64b77d04d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-11 Colin Watson + + * include/grub/ntfs.h (struct grub_fshelp_node): Change `size' + to grub_uint64_t. + * fs/ntfs.c (init_file): Understand 64-bit sizes for + non-resident files. + 2009-09-11 Colin Watson * configure.ac: Don't look for help2man when cross-compiling. Fixes diff --git a/fs/ntfs.c b/fs/ntfs.c index 3ff487c6e..f1d0a374e 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -543,7 +543,7 @@ init_file (struct grub_ntfs_file *mft, grub_uint32_t mftno) if (!pa[8]) mft->size = u32at (pa, 0x10); else - mft->size = u32at (pa, 0x30); + mft->size = u64at (pa, 0x30); if ((mft->attr.flags & AF_ALST) == 0) mft->attr.attr_end = 0; /* Don't jump to attribute list */ diff --git a/include/grub/ntfs.h b/include/grub/ntfs.h index 9b2ae0a0c..6482e964b 100644 --- a/include/grub/ntfs.h +++ b/include/grub/ntfs.h @@ -133,7 +133,7 @@ struct grub_fshelp_node { struct grub_ntfs_data *data; char *buf; - grub_uint32_t size; + grub_uint64_t size; grub_uint32_t ino; int inode_read; struct grub_ntfs_attr attr; From e8f5d6e985b9e73ded8aac7f1cbdfa63605a099a Mon Sep 17 00:00:00 2001 From: blusseau Date: Sat, 12 Sep 2009 07:38:50 +0000 Subject: [PATCH 1132/1707] 2009-09-12 Yves Blusseau Change clean rules to properly remove files * genmk.rb: add new clean rules * Makefile.in (clean): add the new targets (mostlyclean): likewise --- ChangeLog | 8 ++++++++ Makefile.in | 4 ++-- genmk.rb | 55 +++++++++++++++++++++++++++++++++++++++++++++-------- 3 files changed, 57 insertions(+), 10 deletions(-) diff --git a/ChangeLog b/ChangeLog index 64b77d04d..0428aa726 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-12 Yves Blusseau + + Change clean rules to properly remove files + + * genmk.rb: add new clean rules + * Makefile.in (clean): add the new targets + (mostlyclean): likewise + 2009-09-11 Colin Watson * include/grub/ntfs.h (struct grub_fshelp_node): Change `size' diff --git a/Makefile.in b/Makefile.in index 7c5adbc61..ff84afb7b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -326,10 +326,10 @@ uninstall: rm -f $(DESTDIR)$(libdir)/grub/$$dest; \ done -clean: +clean: $(CLEAN_IMAGE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_UTILITY_TARGETS) -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) -mostlyclean: clean +mostlyclean: clean $(MOSTLYCLEAN_IMAGE_TARGETS) $(MOSTLYCLEAN_MODULE_TARGETS) $(MOSTLYCLEAN_UTILITY_TARGETS) -test -z "$(MOSTLYCLEANFILES)" || rm -f $(MOSTLYCLEANFILES) distclean: mostlyclean diff --git a/genmk.rb b/genmk.rb index 4aedb25c4..50bf88fe1 100644 --- a/genmk.rb +++ b/genmk.rb @@ -39,11 +39,13 @@ class Image def initialize(dir, name) @dir = dir @name = name + @rule_count = 0 end attr_reader :dir, :name def rule(sources) prefix = @name.to_var + @rule_count += 1 exe = @name.suffix('exec') objs = sources.collect do |src| raise "unknown source file `#{src}'" if /\.[cS]$/ !~ src @@ -53,8 +55,16 @@ class Image deps = objs.collect {|obj| obj.suffix('d')} deps_str = deps.join(' ') - "CLEANFILES += #{@name} #{exe} #{objs_str} -MOSTLYCLEANFILES += #{deps_str} +" +clean-image-#{@name}.#{@rule_count}: + rm -f #{@name} #{exe} #{objs_str} + +CLEAN_IMAGE_TARGETS += clean-image-#{@name}.#{@rule_count} + +mostlyclean-image-#{@name}.#{@rule_count}: + rm -f #{deps_str} + +MOSTLYCLEAN_IMAGE_TARGETS += mostlyclean-image-#{@name}.#{@rule_count} ifneq ($(TARGET_APPLE_CC),1) #{@name}: #{exe} @@ -94,11 +104,13 @@ class PModule def initialize(dir, name) @dir = dir @name = name + @rule_count = 0 end attr_reader :dir, :name def rule(sources) prefix = @name.to_var + @rule_count += 1 objs = sources.collect do |src| raise "unknown source file `#{src}'" if /\.[cS]$/ !~ src prefix + '-' + src.to_obj @@ -114,12 +126,23 @@ class PModule mod_name = File.basename(@name, '.mod') symbolic_name = mod_name.sub(/\.[^\.]*$/, '') - "CLEANFILES += #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym} +" +clean-module-#{@name}.#{@rule_count}: + rm -f #{@name} #{mod_obj} #{mod_src} #{pre_obj} #{objs_str} #{undsym} + +CLEAN_MODULE_TARGETS += clean-module-#{@name}.#{@rule_count} + ifneq ($(#{prefix}_EXPORTS),no) -CLEANFILES += #{defsym} +clean-module-#{@name}-symbol.#{@rule_count}: + rm -f #{defsym} + +CLEAN_MODULE_TARGETS += clean-module-#{@name}-symbol.#{@rule_count} DEFSYMFILES += #{defsym} endif -MOSTLYCLEANFILES += #{deps_str} +mostlyclean-module-#{@name}.#{@rule_count}: + rm -f #{deps_str} + +MOSTLYCLEAN_MODULE_TARGETS += mostlyclean-module-#{@name}.#{@rule_count} UNDSYMFILES += #{undsym} ifneq ($(TARGET_APPLE_CC),1) @@ -164,6 +187,7 @@ endif " + objs.collect_with_index do |obj, i| src = sources[i] fake_obj = File.basename(src).suffix('o') + extra_target = obj.sub(/\.[^\.]*$/, '') + '-extra' command = 'cmd-' + obj.suffix('lst') fs = 'fs-' + obj.suffix('lst') partmap = 'partmap-' + obj.suffix('lst') @@ -178,7 +202,11 @@ endif $(TARGET_CC) -I#{dir} -I$(srcdir)/#{dir} $(TARGET_CPPFLAGS) #{extra_flags} $(TARGET_#{flag}) $(#{prefix}_#{flag}) -MD -c -o $@ $< -include #{dep} -CLEANFILES += #{command} #{fs} #{partmap} #{handler} #{parttool} +clean-module-#{extra_target}.#{@rule_count}: + rm -f #{command} #{fs} #{partmap} #{handler} #{parttool} + +CLEAN_MODULE_TARGETS += clean-module-#{extra_target}.#{@rule_count} + COMMANDFILES += #{command} FSFILES += #{fs} PARTTOOLFILES += #{parttool} @@ -219,6 +247,7 @@ class Utility def initialize(dir, name) @dir = dir @name = name + @rule_count = 0 end def print_tail() prefix = @name.to_var @@ -231,6 +260,7 @@ class Utility def rule(sources) prefix = @name.to_var + @rule_count += 1 objs = sources.collect do |src| raise "unknown source file `#{src}'" if /\.[cS]$/ !~ src prefix + '-' + src.to_obj @@ -239,8 +269,17 @@ class Utility deps = objs.collect {|obj| obj.suffix('d')} deps_str = deps.join(' '); - "CLEANFILES += #{@name}$(EXEEXT) #{objs_str} -MOSTLYCLEANFILES += #{deps_str} + " +clean-utility-#{@name}.#{@rule_count}: + rm -f #{@name}$(EXEEXT) #{objs_str} + +CLEAN_UTILITY_TARGETS += clean-utility-#{@name}.#{@rule_count} + +mostlyclean-utility-#{@name}.#{@rule_count}: + rm -f #{deps_str} + +MOSTLYCLEAN_UTILITY_TARGETS += mostlyclean-utility-#{@name}.#{@rule_count} + #{prefix}_OBJECTS += #{objs_str} " + objs.collect_with_index do |obj, i| From 5c9f8d8427e57a8e0f8f87cb732e7462384d5655 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 12 Sep 2009 13:05:25 +0000 Subject: [PATCH 1133/1707] 2009-09-12 Robert Millan Fix memory corruption issue (spotted by Colin Watson). * kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette): Fix bug causing returned size to be stored in an incorrect memory location. Fix use of uninitialized value when storing the returned size. --- ChangeLog | 8 ++++++++ kern/i386/pc/startup.S | 6 +++--- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0428aa726..5eea781f7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-12 Robert Millan + + Fix memory corruption issue (spotted by Colin Watson). + + * kern/i386/pc/startup.S (grub_vbe_bios_getset_dac_palette): Fix bug + causing returned size to be stored in an incorrect memory location. + Fix use of uninitialized value when storing the returned size. + 2009-09-12 Yves Blusseau Change clean rules to properly remove files diff --git a/kern/i386/pc/startup.S b/kern/i386/pc/startup.S index 529662b93..da3624c89 100644 --- a/kern/i386/pc/startup.S +++ b/kern/i386/pc/startup.S @@ -1761,18 +1761,18 @@ FUNCTION(grub_vbe_bios_getset_dac_palette_width) movw $0x4f08, %ax int $0x10 - movw %ax, %dx /* real_to_prot destroys %eax. */ + movw %ax, %cx /* real_to_prot destroys %eax. */ DATA32 call real_to_prot .code32 /* Move result back to *dac_mask_size. */ + xorl %eax, %eax movb %bh, %al movl %eax, (%edx) /* Return value in %eax. */ - xorl %eax, %eax - movw %dx, %ax + movw %cx, %ax popl %ebx popl %ebp From 6122955707a57a864667ead62cc05d4386f85e84 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 12 Sep 2009 13:07:27 +0000 Subject: [PATCH 1134/1707] 2009-09-12 Robert Millan * video/i386/pc/vbe.c (grub_vbe_get_video_mode_info): Move packed mode special handling (grub_vbe_bios_set_dac_palette_width() call) from here ... * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] (grub_linux_setup_video): ... to here (with some adjustments). --- ChangeLog | 8 ++++++++ loader/i386/linux.c | 28 ++++++++++++++++++++++++++++ video/i386/pc/vbe.c | 18 ------------------ 3 files changed, 36 insertions(+), 18 deletions(-) diff --git a/ChangeLog b/ChangeLog index 5eea781f7..0d967d550 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-12 Robert Millan + + * video/i386/pc/vbe.c (grub_vbe_get_video_mode_info): Move packed + mode special handling (grub_vbe_bios_set_dac_palette_width() call) + from here ... + * loader/i386/linux.c [GRUB_MACHINE_PCBIOS] + (grub_linux_setup_video): ... to here (with some adjustments). + 2009-09-12 Robert Millan Fix memory corruption issue (spotted by Colin Watson). diff --git a/loader/i386/linux.c b/loader/i386/linux.c index 4144384db..4bdb09b24 100644 --- a/loader/i386/linux.c +++ b/loader/i386/linux.c @@ -33,6 +33,7 @@ #include #include #include +#include #define GRUB_LINUX_CL_OFFSET 0x1000 #define GRUB_LINUX_CL_END_OFFSET 0x2000 @@ -416,6 +417,33 @@ grub_linux_setup_video (struct linux_kernel_params *params) params->reserved_mask_size = mode_info.reserved_mask_size; params->reserved_field_pos = mode_info.reserved_field_pos; + +#ifdef GRUB_MACHINE_PCBIOS + /* VESA packed modes may come with zeroed mask sizes, which need + to be set here according to DAC Palette width. If we don't, + this results in Linux displaying a black screen. */ + if (mode_info.bpp <= 8) + { + struct grub_vbe_info_block controller_info; + int status; + int width = 8; + + status = grub_vbe_bios_get_controller_info (&controller_info); + + if (status == GRUB_VBE_STATUS_OK && + (controller_info.capabilities & GRUB_VBE_CAPABILITY_DACWIDTH)) + status = grub_vbe_bios_set_dac_palette_width (&width); + + if (status != GRUB_VBE_STATUS_OK) + /* 6 is default after mode reset. */ + width = 6; + + params->red_mask_size = params->green_mask_size + = params->blue_mask_size = width; + params->reserved_mask_size = 0; + } +#endif + return 0; } diff --git a/video/i386/pc/vbe.c b/video/i386/pc/vbe.c index b41e22fa2..a285b26ba 100644 --- a/video/i386/pc/vbe.c +++ b/video/i386/pc/vbe.c @@ -286,24 +286,6 @@ grub_vbe_get_video_mode_info (grub_uint32_t mode, /* Make copy of mode info block. */ grub_memcpy (mode_info, mi_tmp, sizeof (*mode_info)); - - /* Packed mode. Query DAC Palette width for color sizes. */ - if (mode_info->bits_per_pixel <= 8) - { - int width = 8; - status = 0; - - if (controller_info.capabilities & GRUB_VBE_CAPABILITY_DACWIDTH) - status = grub_vbe_bios_set_dac_palette_width (& width); - - if (status != GRUB_VBE_STATUS_OK) - /* 6 is default after mode reset. */ - width = 6; - - mode_info->red_mask_size = mode_info->green_mask_size - = mode_info->blue_mask_size = width; - mode_info->rsvd_mask_size = 0; - } } else /* Just clear mode info block if it isn't a VESA mode. */ From 8ef070f50dabd70e43a34e5138f4fc7049ff1773 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 12 Sep 2009 13:08:38 +0000 Subject: [PATCH 1135/1707] 2009-09-12 Robert Millan * configure.ac: Bump version to 1.97~beta3. * docs/version.texi: Likewise. --- ChangeLog | 5 +++++ configure.ac | 2 +- docs/version.texi | 4 ++-- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0d967d550..c421ec633 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-12 Robert Millan + + * configure.ac: Bump version to 1.97~beta3. + * docs/version.texi: Likewise. + 2009-09-12 Robert Millan * video/i386/pc/vbe.c (grub_vbe_get_video_mode_info): Move packed diff --git a/configure.ac b/configure.ac index b7fa044a5..e025b50d6 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT([GRUB],[1.97~beta2],[bug-grub@gnu.org]) +AC_INIT([GRUB],[1.97~beta3],[bug-grub@gnu.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) diff --git a/docs/version.texi b/docs/version.texi index 04c8473f4..65ec1301d 100644 --- a/docs/version.texi +++ b/docs/version.texi @@ -1,4 +1,4 @@ @set UPDATED 7 Ago 2009 @set UPDATED-MONTH Ago 2009 -@set EDITION 1.97~beta2 -@set VERSION 1.97~beta2 +@set EDITION 1.97~beta3 +@set VERSION 1.97~beta3 From 5653217923f5a8eeb161ef7d30e5be7083a89e1f Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 13 Sep 2009 01:30:18 +0000 Subject: [PATCH 1136/1707] 2009-09-13 Robert Millan * configure.ac: Remove --enable-grub-pe2elf. Only build grub-pe2elf when needed by the build system itself. * conf/common.rmk: Remove $(enable_grub_pe2elf) check. --- ChangeLog | 6 ++++++ conf/common.rmk | 13 +++---------- configure.ac | 12 ------------ 3 files changed, 9 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index c421ec633..0ab86b8f8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-13 Robert Millan + + * configure.ac: Remove --enable-grub-pe2elf. Only build + grub-pe2elf when needed by the build system itself. + * conf/common.rmk: Remove $(enable_grub_pe2elf) check. + 2009-09-12 Robert Millan * configure.ac: Bump version to 1.97~beta3. diff --git a/conf/common.rmk b/conf/common.rmk index 73cf02caa..e18dd1052 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -119,21 +119,14 @@ bin_UTILITIES += grub-editenv grub_editenv_SOURCES = util/grub-editenv.c lib/envblk.c util/misc.c kern/misc.c kern/err.c CLEANFILES += grub-editenv -# for grub-pe2elf -ifeq ($(enable_grub_pe2elf), yes) -bin_UTILITIES += grub-pe2elf +# Needed for genmk.rb to work +ifeq (0,1) +bin_UTILITIES += grub-macho2img grub-pe2elf endif grub_pe2elf_SOURCES = util/grub-pe2elf.c util/misc.c CLEANFILES += grub-pe2elf -# grub_macho2img assumes a lot about source file. -# So installing it definitively is useless -# But adding to bin_UTILITIES is needed for -# genmk.rb to work -ifeq (0,1) -bin_UTILITIES += grub-macho2img -endif grub_macho2img_SOURCES = util/grub-macho2img.c CLEANFILES += grub-macho2img diff --git a/configure.ac b/configure.ac index e025b50d6..37ecba759 100644 --- a/configure.ac +++ b/configure.ac @@ -557,11 +557,6 @@ enable_grub_fstest=no fi AC_SUBST([enable_grub_fstest]) -AC_ARG_ENABLE([grub-pe2elf], - [AS_HELP_STRING([--enable-grub-pe2elf], - [build and install the `grub-pe2elf' conversion utility])]) -AC_SUBST([enable_grub_pe2elf]) - AC_ARG_ENABLE([grub-mkfont], [AS_HELP_STRING([--enable-grub-mkfont], [build and install the `grub-mkfont' utility (default=guessed)])]) @@ -626,13 +621,6 @@ echo With memory debugging: Yes else echo With memory debugging: No fi -if [ x"$enable_grub_pe2elf" = xyes ]; then -echo grub-pe2elf will be built and installed -elif [ x$TARGET_OBJ2ELF = xgrub-pe2elf ]; then -echo grub-pe2elf will be built but not installed -else -echo grub-pe2elf will not be built -fi if [ x"$efiemu_excuse" = x ]; then echo efiemu runtime: Yes else From d52109a7a257ffcbc312042d2c9ea8f6331e1bfd Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 14 Sep 2009 11:32:00 +0000 Subject: [PATCH 1137/1707] 2009-09-14 Colin Watson * util/grub.d/30_os-prober.in: Cope with Windows 7 in os-prober output. --- ChangeLog | 5 +++++ util/grub.d/30_os-prober.in | 11 ++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ab86b8f8..69b65bf67 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-14 Colin Watson + + * util/grub.d/30_os-prober.in: Cope with Windows 7 in os-prober + output. + 2009-09-13 Robert Millan * configure.ac: Remove --enable-grub-pe2elf. Only build diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index ffc46c9d4..4a1648881 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -57,11 +57,16 @@ menuentry "${LONGNAME} (on ${DEVICE})" { EOF prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" - if [ "${LONGNAME}" != "Windows Vista (loader)" ] ; then - cat << EOF + case ${LONGNAME} in + Windows\ Vista*|Windows\ 7*) + ;; + *) + cat << EOF drivemap -s (hd0) \${root} EOF - fi + ;; + esac + cat < Date: Mon, 14 Sep 2009 15:38:30 +0000 Subject: [PATCH 1138/1707] =?UTF-8?q?2009-09-14=20=20Jos=C3=A9=20Mart?= =?UTF-8?q?=C3=ADnez=20=20?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * commands/acpi.c (grub_cmd_acpi): Fix loading ACPI tables from file. --- ChangeLog | 4 ++++ commands/acpi.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 69b65bf67..42e141472 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-14 José Martínez + + * commands/acpi.c (grub_cmd_acpi): Fix loading ACPI tables from file. + 2009-09-14 Colin Watson * util/grub.d/30_os-prober.in: Cope with Windows 7 in os-prober diff --git a/commands/acpi.c b/commands/acpi.c index d903d446d..e7cb9e6b4 100644 --- a/commands/acpi.c +++ b/commands/acpi.c @@ -681,6 +681,9 @@ grub_cmd_acpi (struct grub_extcmd *cmd, table->size = size; table->addr = buf; playground_size += table->size; + + table->next = acpi_tables; + acpi_tables = table; } } From 07197f23220355132b3220199d5df232f04ce44a Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 14 Sep 2009 19:57:45 +0000 Subject: [PATCH 1139/1707] 2009-09-14 Colin Watson * commands/test.c (get_fileinfo): Return immediately if grub_fs_probe fails. --- ChangeLog | 5 +++++ commands/test.c | 7 +++++++ 2 files changed, 12 insertions(+) diff --git a/ChangeLog b/ChangeLog index 42e141472..2d1733ac3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-14 Colin Watson + + * commands/test.c (get_fileinfo): Return immediately if + grub_fs_probe fails. + 2009-09-14 José Martínez * commands/acpi.c (grub_cmd_acpi): Fix loading ACPI tables from file. diff --git a/commands/test.c b/commands/test.c index 26df8b5c5..9c813c820 100644 --- a/commands/test.c +++ b/commands/test.c @@ -88,6 +88,13 @@ test_parse (char **args, int *argn, int argc) } fs = grub_fs_probe (dev); + if (! fs) + { + grub_free (device_name); + grub_device_close (dev); + return; + } + pathname = grub_strchr (path, ')'); if (! pathname) pathname = path; From 77c24f1dc58373453e80e77f5d44e65691bc8906 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 15 Sep 2009 10:36:29 +0000 Subject: [PATCH 1140/1707] 2009-09-15 Vladimir Serbinenko * partmap/pc.c (pc_partition_map_iterate): Detect and break loops. --- ChangeLog | 4 ++++ partmap/msdos.c | 14 ++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2d1733ac3..be7715f25 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-15 Vladimir Serbinenko + + * partmap/pc.c (pc_partition_map_iterate): Detect and break loops. + 2009-09-14 Colin Watson * commands/test.c (get_fileinfo): Return immediately if diff --git a/partmap/msdos.c b/partmap/msdos.c index d0fc18efe..a5d55b64d 100644 --- a/partmap/msdos.c +++ b/partmap/msdos.c @@ -97,6 +97,8 @@ pc_partition_map_iterate (grub_disk_t disk, struct grub_msdos_partition_mbr mbr; struct grub_msdos_partition_disk_label label; struct grub_disk raw; + int labeln = 0; + grub_disk_addr_t lastaddr; /* Enforce raw disk access. */ raw = *disk; @@ -117,6 +119,18 @@ pc_partition_map_iterate (grub_disk_t disk, if (grub_disk_read (&raw, p.offset, 0, sizeof (mbr), &mbr)) goto finish; + /* This is our loop-detection algorithm. It works the following way: + It saves last position which was a power of two. Then it compares the + saved value with a current one. This way it's guaranteed that the loop + will be broken by at most third walk. + */ + if (labeln && lastaddr == p.offset) + return grub_error (GRUB_ERR_BAD_PART_TABLE, "loop detected"); + + labeln++; + if ((labeln & (labeln - 1)) == 0) + lastaddr = p.offset; + /* Check if it is valid. */ if (mbr.signature != grub_cpu_to_le16 (GRUB_PC_PARTITION_SIGNATURE)) return grub_error (GRUB_ERR_BAD_PART_TABLE, "no signature"); From 0f0b8c878dec3844e52814eec15fd833d5ac0abe Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 16 Sep 2009 19:01:53 +0000 Subject: [PATCH 1141/1707] fix last changelog entry --- ChangeLog | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index be7715f25..c8f1b9cbf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2009-09-15 Vladimir Serbinenko - * partmap/pc.c (pc_partition_map_iterate): Detect and break loops. + * partmap/msdos.c (pc_partition_map_iterate): Detect and break loops. 2009-09-14 Colin Watson From bbb2a70f51732b63d64e2d927c6a6536b01dd175 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 16 Sep 2009 19:23:33 +0000 Subject: [PATCH 1142/1707] 2009-09-16 Robert Millan * partmap/msdos.c (pc_partition_map_iterate): Fix possible use of uninitialized `lastaddr'. --- ChangeLog | 5 +++++ partmap/msdos.c | 4 ++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index c8f1b9cbf..722f55c3b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-16 Robert Millan + + * partmap/msdos.c (pc_partition_map_iterate): Fix possible use of + uninitialized `lastaddr'. + 2009-09-15 Vladimir Serbinenko * partmap/msdos.c (pc_partition_map_iterate): Detect and break loops. diff --git a/partmap/msdos.c b/partmap/msdos.c index a5d55b64d..6ba7fb927 100644 --- a/partmap/msdos.c +++ b/partmap/msdos.c @@ -110,6 +110,10 @@ pc_partition_map_iterate (grub_disk_t disk, p.data = &pcdata; p.partmap = &grub_msdos_partition_map; + /* Any value different than `p.offset' will satisfy the check during + first loop. */ + lastaddr = !p.offset; + while (1) { int i; From 63f745e8570f3cd8cfdf43dffa4da40877d2a39d Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 16 Sep 2009 19:32:44 +0000 Subject: [PATCH 1143/1707] 2009-09-16 Robert Millan * aclocal.m4 (AC_LANG_PROGRAM): New macro. Overrides stock AC_LANG_PROGRAM from autoconf. (grub_ASM_USCORE, grub_PROG_OBJCOPY_ABSOLUTE): Add missing prototypes (fixes warning). * configure.ac: Add `-Werror' to TARGET_CFLAGS unless `--disable-werror' was used. --- ChangeLog | 10 ++++++++++ aclocal.m4 | 17 +++++++++++++++++ configure.ac | 7 +++++++ 3 files changed, 34 insertions(+) diff --git a/ChangeLog b/ChangeLog index 722f55c3b..efbc7a786 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-09-16 Robert Millan + + * aclocal.m4 (AC_LANG_PROGRAM): New macro. Overrides stock + AC_LANG_PROGRAM from autoconf. + (grub_ASM_USCORE, grub_PROG_OBJCOPY_ABSOLUTE): Add missing + prototypes (fixes warning). + + * configure.ac: Add `-Werror' to TARGET_CFLAGS unless + `--disable-werror' was used. + 2009-09-16 Robert Millan * partmap/msdos.c (pc_partition_map_iterate): Fix possible use of diff --git a/aclocal.m4 b/aclocal.m4 index 313b241fa..899eca409 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,3 +1,18 @@ +dnl Redefine AC_LANG_PROGRAM with a "-Wstrict-prototypes -Werror"-friendly +dnl version. Patch submitted to bug-autoconf in 2009-09-16. +m4_define([AC_LANG_PROGRAM(C)], +[$1 +int +main (void) +{ +dnl Do *not* indent the following line: there may be CPP directives. +dnl Don't move the `;' right after for the same reason. +$2 + ; + return 0; +}]) + + dnl Check whether target compiler is working AC_DEFUN(grub_PROG_TARGET_CC, [AC_MSG_CHECKING([whether target compiler is working]) @@ -26,6 +41,7 @@ AC_DEFUN(grub_ASM_USCORE, AC_MSG_CHECKING([if C symbols get an underscore after compilation]) AC_CACHE_VAL(grub_cv_asm_uscore, [cat > conftest.c <<\EOF +int func (int *); int func (int *list) { @@ -63,6 +79,7 @@ AC_DEFUN(grub_PROG_OBJCOPY_ABSOLUTE, [AC_MSG_CHECKING([whether ${OBJCOPY} works for absolute addresses]) AC_CACHE_VAL(grub_cv_prog_objcopy_absolute, [cat > conftest.c <<\EOF +void cmain (void); void cmain (void) { diff --git a/configure.ac b/configure.ac index 37ecba759..59e8510d3 100644 --- a/configure.ac +++ b/configure.ac @@ -390,6 +390,13 @@ if test x"$sap_possible" = xyes; then TARGET_CFLAGS="$TARGET_CFLAGS -mno-stack-arg-probe" fi +AC_ARG_ENABLE([werror], + [AS_HELP_STRING([--disable-werror], + [do not use -Werror when building GRUB])]) +if test x"$enable_werror" != xno ; then + TARGET_CFLAGS="$TARGET_CFLAGS -Werror" +fi + AC_SUBST(TARGET_CFLAGS) AC_SUBST(TARGET_MODULE_FORMAT) AC_SUBST(OBJCONV) From 29434648114f02b6717e8a78efa6b6b3f24a71c3 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 17 Sep 2009 10:03:12 +0200 Subject: [PATCH 1144/1707] fixed 64-bit loading --- loader/machoXX.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/loader/machoXX.c b/loader/machoXX.c index b07bab937..01e6879ea 100644 --- a/loader/machoXX.c +++ b/loader/machoXX.c @@ -129,6 +129,10 @@ SUFFIX (grub_macho_size) (grub_macho_t macho, grub_macho_addr_t *segments_start, grub_macho_segment_t *hdr = (grub_macho_segment_t *) hdr0; if (hdr->cmd != GRUB_MACHO_CMD_SEGMENT) return 0; + + if (! hdr->vmsize) + return 0; + if (! hdr->filesize && (flags & GRUB_MACHO_NOBSS)) return 0; From be94a509bb4f3c77aca6b5c12403820b3d04b4ab Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 17 Sep 2009 11:38:50 +0000 Subject: [PATCH 1145/1707] 2009-09-16 Vladimir Serbinenko * mmap/mmap.c (grub_cmd_badram): Fix off-by-one error. --- ChangeLog | 4 ++++ mmap/mmap.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index efbc7a786..5d836659c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-16 Vladimir Serbinenko + + * mmap/mmap.c (grub_cmd_badram): Fix off-by-one error. + 2009-09-16 Robert Millan * aclocal.m4 (AC_LANG_PROGRAM): New macro. Overrides stock diff --git a/mmap/mmap.c b/mmap/mmap.c index f2407c0bd..7598cf501 100644 --- a/mmap/mmap.c +++ b/mmap/mmap.c @@ -368,8 +368,8 @@ grub_cmd_badram (grub_command_t cmd __attribute__ ((unused)), iterator++) { grub_dprintf ("badram", "%llx (size %llx) is a badram range\n", - (long long) cur, (long long) (1ULL << tail) - 1); - grub_mmap_register (cur, (1ULL << tail) - 1, GRUB_MACHINE_MEMORY_HOLE); + (unsigned long long) cur, (1ULL << tail)); + grub_mmap_register (cur, (1ULL << tail), GRUB_MACHINE_MEMORY_HOLE); } return 0; } From a83d079b1e9dce118af674007278db97e5f24736 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Sat, 19 Sep 2009 14:15:00 +0000 Subject: [PATCH 1146/1707] 2009-09-19 Colin Watson * util/grub.d/30_os-prober.in: Don't throw away stderr from os-prober. Under normal operation, it does not print anything to stderr; if it does, we need to debug it, and throwing away stderr makes that excessively difficult. --- ChangeLog | 7 +++++++ util/grub.d/30_os-prober.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5d836659c..4144fbe2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-19 Colin Watson + + * util/grub.d/30_os-prober.in: Don't throw away stderr from + os-prober. Under normal operation, it does not print anything to + stderr; if it does, we need to debug it, and throwing away stderr + makes that excessively difficult. + 2009-09-16 Vladimir Serbinenko * mmap/mmap.c (grub_cmd_badram): Fix off-by-one error. diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 4a1648881..84e227ee7 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -31,7 +31,7 @@ if [ -z "`which os-prober 2> /dev/null`" -o -z "`which linux-boot-prober 2> /dev exit 0 fi -OSPROBED="`os-prober 2> /dev/null | tr ' ' '^' | paste -s -d ' '`" +OSPROBED="`os-prober | tr ' ' '^' | paste -s -d ' '`" if [ -z "${OSPROBED}" ] ; then # empty os-prober output, nothing doing exit 0 From 4cbbccec2d9284a92044dab6153519e06432726d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 19 Sep 2009 20:18:03 +0000 Subject: [PATCH 1147/1707] fix last changelog entry --- ChangeLog | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 4144fbe2b..14df06ad8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,9 +1,9 @@ 2009-09-19 Colin Watson * util/grub.d/30_os-prober.in: Don't throw away stderr from - os-prober. Under normal operation, it does not print anything to - stderr; if it does, we need to debug it, and throwing away stderr - makes that excessively difficult. + os-prober. Under normal operation, it does not print anything to + stderr; if it does, we need to debug it, and throwing away stderr + makes that excessively difficult. 2009-09-16 Vladimir Serbinenko From 2cb69d2fee3140dac56f9e0437ea70d30913edad Mon Sep 17 00:00:00 2001 From: phcoder Date: Sun, 20 Sep 2009 15:14:22 +0200 Subject: [PATCH 1148/1707] bugfix --- loader/machoXX.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/loader/machoXX.c b/loader/machoXX.c index 01e6879ea..d42dd8b55 100644 --- a/loader/machoXX.c +++ b/loader/machoXX.c @@ -31,7 +31,7 @@ SUFFIX (grub_macho_parse) (grub_macho_t macho) } if (head.magic != GRUB_MACHO_MAGIC) { - grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O 32-bit header."); + grub_error (GRUB_ERR_BAD_OS, "Invalid Mach-O " XX "-bit header."); macho->offsetXX = -1; return; } @@ -94,7 +94,7 @@ SUFFIX (grub_macho_readfile) (grub_macho_t macho, void *dest) return grub_error (GRUB_ERR_BAD_OS, "Couldn't read architecture-specific part"); - if (grub_file_seek (macho->file, macho->offset32) == (grub_off_t) -1) + if (grub_file_seek (macho->file, macho->offsetXX) == (grub_off_t) -1) { grub_error_push (); return grub_error (GRUB_ERR_BAD_OS, @@ -102,8 +102,8 @@ SUFFIX (grub_macho_readfile) (grub_macho_t macho, void *dest) } read = grub_file_read (macho->file, dest, - macho->end32 - macho->offset32); - if (read != (grub_ssize_t) (macho->end32 - macho->offset32)) + macho->endXX - macho->offsetXX); + if (read != (grub_ssize_t) (macho->endXX - macho->offsetXX)) { grub_error_push (); return grub_error (GRUB_ERR_BAD_OS, From dace7e8a0b84aac3458e64db4b9e034175d4757e Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 20 Sep 2009 16:07:45 +0000 Subject: [PATCH 1149/1707] 2009-09-20 Robert Millan Fix regression introduced in r2539. * term/usb_keyboard.c (USB_HID_DEVICE_TO_HOST): Change from 0x61 to 0xA1. --- ChangeLog | 7 +++++++ term/usb_keyboard.c | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 14df06ad8..094169a46 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-09-20 Robert Millan + + Fix regression introduced in r2539. + + * term/usb_keyboard.c (USB_HID_DEVICE_TO_HOST): Change from 0x61 + to 0xA1. + 2009-09-19 Colin Watson * util/grub.d/30_os-prober.in: Don't throw away stderr from diff --git a/term/usb_keyboard.c b/term/usb_keyboard.c index 7f5e058f7..76b9bc3d4 100644 --- a/term/usb_keyboard.c +++ b/term/usb_keyboard.c @@ -61,7 +61,7 @@ static grub_usb_device_t usbdev; /* Valid values for bmRequestType. See HID definition version 1.11 section 7.2. */ #define USB_HID_HOST_TO_DEVICE 0x21 -#define USB_HID_DEVICE_TO_HOST 0x61 +#define USB_HID_DEVICE_TO_HOST 0xA1 /* Valid values for bRequest. See HID definition version 1.11 section 7.2. */ #define USB_HID_GET_REPORT 0x01 From 5a78865b399f7cc94ac5323544b5ab31611e422b Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 21 Sep 2009 14:03:11 +0000 Subject: [PATCH 1150/1707] 2009-09-21 Felix Zielcke * util/hostdisk.c: Fix a comment. --- ChangeLog | 4 ++++ util/hostdisk.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 094169a46..624f9fcd9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-21 Felix Zielcke + + * util/hostdisk.c: Fix a comment. + 2009-09-20 Robert Millan Fix regression introduced in r2539. diff --git a/util/hostdisk.c b/util/hostdisk.c index a06ecca2a..22b856e29 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -1,4 +1,4 @@ -/* biosdisk.c - emulate biosdisk */ +/* hostdisk.c - emulate biosdisk */ /* * GRUB -- GRand Unified Bootloader * Copyright (C) 1999,2000,2001,2002,2003,2004,2006,2007,2008,2009 Free Software Foundation, Inc. From e0b37bb5b1e83bfcda7a4dbd49e8e49a0cd22997 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Mon, 21 Sep 2009 14:37:04 +0000 Subject: [PATCH 1151/1707] 2009-09-21 Felix Zielcke * kern/term.c: Fix indentation. --- ChangeLog | 4 ++++ kern/term.c | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 624f9fcd9..5f50e0831 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-21 Felix Zielcke + + * kern/term.c: Fix indentation. + 2009-09-21 Felix Zielcke * util/hostdisk.c: Fix a comment. diff --git a/kern/term.c b/kern/term.c index 03e2ae573..94d5a9e1d 100644 --- a/kern/term.c +++ b/kern/term.c @@ -32,12 +32,12 @@ static int grub_more; static int cursor_state = 1; struct grub_handler_class grub_term_input_class = - { + { .name = "terminal_input" }; struct grub_handler_class grub_term_output_class = - { + { .name = "terminal_output" }; From c44c90db277f982a4dc2aa3c04da58b2cf558877 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 21 Sep 2009 18:22:27 +0000 Subject: [PATCH 1152/1707] 2009-09-21 Colin Watson Build info documentation. Some code borrowed from Automake. * configure.ac: Check for makeinfo. * Makefile.in (MAKEINFO, INFOS, info_INFOS): New variables. (MAINTAINER_CLEANFILES): Add $(INFOS), docs/stamp-vti, and docs/version.texi. (MOSTLYCLEANFILES): Add vti.tmp. (docs/version.texi, docs/stamp-vti): Update automatically. (docs/grub.info): Build info documentation. Use --force and ignore errors for now. (all-local): Add $(INFOS). (install-local): Install info files. (uninstall): Uninstall info files. * docs/version.texi: Remove from revision control. This file is automatically generated on build now. * gendistlist.sh: Add `*.info'. --- ChangeLog | 19 +++++++++++++++++ Makefile.in | 54 +++++++++++++++++++++++++++++++++++++++++++++-- configure.ac | 1 + docs/version.texi | 4 ---- gendistlist.sh | 5 +++-- 5 files changed, 75 insertions(+), 8 deletions(-) delete mode 100644 docs/version.texi diff --git a/ChangeLog b/ChangeLog index 5f50e0831..22aeb6feb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,22 @@ +2009-09-21 Colin Watson + + Build info documentation. Some code borrowed from Automake. + + * configure.ac: Check for makeinfo. + * Makefile.in (MAKEINFO, INFOS, info_INFOS): New variables. + (MAINTAINER_CLEANFILES): Add $(INFOS), docs/stamp-vti, and + docs/version.texi. + (MOSTLYCLEANFILES): Add vti.tmp. + (docs/version.texi, docs/stamp-vti): Update automatically. + (docs/grub.info): Build info documentation. Use --force and ignore + errors for now. + (all-local): Add $(INFOS). + (install-local): Install info files. + (uninstall): Uninstall info files. + * docs/version.texi: Remove from revision control. This file is + automatically generated on build now. + * gendistlist.sh: Add `*.info'. + 2009-09-21 Felix Zielcke * kern/term.c: Fix indentation. diff --git a/Makefile.in b/Makefile.in index ff84afb7b..ee4589a78 100644 --- a/Makefile.in +++ b/Makefile.in @@ -86,6 +86,10 @@ OBJCOPY = @OBJCOPY@ STRIP = @STRIP@ NM = @NM@ RUBY = @RUBY@ +MAKEINFO = @MAKEINFO@ +ifeq (, $(MAKEINFO)) +MAKEINFO = true +endif HELP2MAN = @HELP2MAN@ ifeq (, $(HELP2MAN)) HELP2MAN = true @@ -122,6 +126,7 @@ PKGDATA = $(pkgdata_DATA) PROGRAMS = $(bin_UTILITIES) $(sbin_UTILITIES) SCRIPTS = $(bin_SCRIPTS) $(sbin_SCRIPTS) $(grub-mkconfig_SCRIPTS) \ $(lib_SCRIPTS) +INFOS = $(info_INFOS) CLEANFILES = MOSTLYCLEANFILES = @@ -129,7 +134,7 @@ DISTCLEANFILES = config.status config.cache config.log config.h \ Makefile stamp-h include/grub/cpu include/grub/machine \ gensymlist.sh genkernsyms.sh build_env.mk MAINTAINER_CLEANFILES = $(srcdir)/configure $(addprefix $(srcdir)/,$(MKFILES)) \ - $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in + $(srcdir)/DISTLIST $(srcdir)/config.h.in $(srcdir)/stamp-h.in $(INFOS) # The default target. all: all-local @@ -168,6 +173,27 @@ handler.lst: $(HANDLERFILES) parttool.lst: $(PARTTOOLFILES) cat $^ /dev/null | sort | uniq > $@ +info_INFOS += docs/grub.info + +MOSTLYCLEANFILES += vti.tmp +MAINTAINER_CLEANFILES += docs/stamp-vti docs/version.texi +docs/version.texi: docs/stamp-vti +docs/stamp-vti: docs/grub.texi + (set `$(SHELL) $(srcdir)/docs/mdate-sh $<`; \ + echo "@set UPDATED $$1 $$2 $$3"; \ + echo "@set UPDATED-MONTH $$2 $$3"; \ + echo "@set EDITION $(PACKAGE_VERSION)"; \ + echo "@set VERSION $(PACKAGE_VERSION)") > vti.tmp + @cmp -s vti.tmp $(srcdir)/docs/version.texi \ + || (echo "Updating $(srcdir)/docs/version.texi"; \ + cp vti.tmp $(srcdir)/docs/version.texi) + -@rm -f vti.tmp + @cp $(srcdir)/docs/version.texi $@ + +# Use --force until such time as the documentation is cleaned up. +docs/grub.info: docs/grub.texi docs/version.texi docs/fdl.texi + $(MAKEINFO) --no-split --force $< -o $@ || : + ifeq (, $(UNIFONT_BDF)) else @@ -207,7 +233,7 @@ pkglib_BUILDDIR += config.h grub_script.tab.h include_DATA += $(shell find $(srcdir)/include -name \*.h | sed -e "s,^$(srcdir)/,,g") \ include/grub/cpu include/grub/machine -all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(MKFILES) +all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES) install: install-local @@ -285,6 +311,17 @@ install-local: all dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(libdir)/grub/$$dest; \ done + $(SHELL) $(mkinstalldirs) $(DESTDIR)$(infodir) + @list='$(info_INFOS)'; \ + for file in $$list; do \ + if test -f "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ + dest="`echo $$file | sed 's,.*/,,'`"; \ + $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(infodir); \ + if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + install-info --info-dir="$(DESTDIR)$(infodir)" "$(DESTDIR)$(infodir)/$$dest" || :; \ + fi; \ + done install-strip: $(MAKE) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" install @@ -325,6 +362,19 @@ uninstall: echo rm -f $(DESTDIR)$(libdir)/$$dest; \ rm -f $(DESTDIR)$(libdir)/grub/$$dest; \ done + @list='$(info_INFOS)'; \ + for file in $$list; do \ + dest="`echo $$file | sed 's,.*/,,'`"; \ + if (install-info --version && \ + install-info --version 2>&1 | sed 1q | grep -i -v debian) >/dev/null 2>&1; then \ + if install-info --info-dir="$(DESTDIR)$(infodir)" --remove "$(DESTDIR)$(infodir)/$$dest"; then \ + :; \ + else \ + test ! -f "$(DESTDIR)$(infodir)/$$dest" || exit 1; \ + fi; \ + fi; \ + rm -f $(DESTDIR)$(infodir)/$$dest; \ + done clean: $(CLEAN_IMAGE_TARGETS) $(CLEAN_MODULE_TARGETS) $(CLEAN_UTILITY_TARGETS) -test -z "$(CLEANFILES)" || rm -f $(CLEANFILES) diff --git a/configure.ac b/configure.ac index 59e8510d3..e827a32c2 100644 --- a/configure.ac +++ b/configure.ac @@ -147,6 +147,7 @@ AC_PROG_MAKE_SET # These are not a "must". AC_PATH_PROG(RUBY, ruby) +AC_PATH_PROG(MAKEINFO, makeinfo) # # Checks for host programs. diff --git a/docs/version.texi b/docs/version.texi deleted file mode 100644 index 65ec1301d..000000000 --- a/docs/version.texi +++ /dev/null @@ -1,4 +0,0 @@ -@set UPDATED 7 Ago 2009 -@set UPDATED-MONTH Ago 2009 -@set EDITION 1.97~beta3 -@set VERSION 1.97~beta3 diff --git a/gendistlist.sh b/gendistlist.sh index 3278ed0b3..7f6c32a44 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -38,7 +38,8 @@ for dir in $DISTDIRS; do for d in `find $dir -type d | sed '/\/\.svn$/d;\/\.svn\//d' | sort`; do find $d -maxdepth 1 -name '*.[chSy]' -o -name '*.mk' -o -name '*.rmk' \ -o -name '*.rb' -o -name '*.in' -o -name '*.tex' -o -name '*.texi' \ - -o -name 'grub.cfg' -o -name 'README' -o -name '*.sc' -o -name 'mdate-sh' \ - -o -name '*.sh' -o -name 'grub-dumpdevtree' -o -name '*.lua' | sort + -o -name '*.info' -o -name 'grub.cfg' -o -name 'README' \ + -o -name '*.sc' -o -name 'mdate-sh' -o -name '*.sh' \ + -o -name 'grub-dumpdevtree' -o -name '*.lua' | sort done done From 063e925fb0370f2753f5122f8dacb26d67ce7713 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 22 Sep 2009 09:27:59 +0200 Subject: [PATCH 1153/1707] split search --- commands/search.c | 101 ++++++++++++++++---------------------- conf/common.rmk | 20 +++++++- conf/i386-coreboot.rmk | 2 +- conf/i386-efi.rmk | 2 +- conf/i386-ieee1275.rmk | 2 +- conf/i386-pc.rmk | 2 +- conf/powerpc-ieee1275.rmk | 2 +- conf/sparc64-ieee1275.rmk | 2 +- conf/x86_64-efi.rmk | 2 +- 9 files changed, 66 insertions(+), 69 deletions(-) diff --git a/commands/search.c b/commands/search.c index 0cfd0ebbc..60b5bbf04 100644 --- a/commands/search.c +++ b/commands/search.c @@ -27,27 +27,8 @@ #include #include -static const struct grub_arg_option options[] = - { - {"file", 'f', 0, "search devices by a file", 0, 0}, - {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, - {"fs-uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, - {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, - {"no-floppy", 'n', 0, "do not probe any floppy drive", 0, 0}, - {0, 0, 0, 0, 0, 0} - }; - -enum options - { - SEARCH_FILE, - SEARCH_LABEL, - SEARCH_FS_UUID, - SEARCH_SET, - SEARCH_NO_FLOPPY, - }; - -static void -search_fs (const char *key, const char *var, int no_floppy, enum options type) +void +FUNC_NAME (const char *key, const char *var, int no_floppy) { int count = 0; char *buf = NULL; @@ -63,7 +44,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type) name[0] == 'f' && name[1] == 'd' && name[2] >= '0' && name[2] <= '9') return 0; - if (type == SEARCH_FILE) +#ifdef DO_SEARCH_FILE { grub_size_t len; char *p; @@ -84,27 +65,29 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type) grub_file_close (file); } } - else +#else { - /* type is SEARCH_FS_UUID or SEARCH_LABEL */ + /* SEARCH_FS_UUID or SEARCH_LABEL */ grub_device_t dev; grub_fs_t fs; - int (*compare_fn) (const char *, const char *); char *quid; dev = grub_device_open (name); if (dev) { fs = grub_fs_probe (dev); - compare_fn = - (type == SEARCH_FS_UUID) ? grub_strcasecmp : grub_strcmp; - if (fs && ((type == SEARCH_FS_UUID) ? fs->uuid : fs->label)) +#ifdef DO_SEARCH_FS_UUID +#define compare_fn grub_strcasecmp +#define read_fn uuid +#else +#define compare_fn grub_strcmp +#define read_fn label +#endif + + if (fs && fs->read_fn) { - if (type == SEARCH_FS_UUID) - fs->uuid (dev, &quid); - else - fs->label (dev, &quid); + fs->read_fn (dev, &quid); if (grub_errno == GRUB_ERR_NONE && quid) { @@ -118,6 +101,7 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type) grub_device_close (dev); } } +#endif if (found) { @@ -156,45 +140,42 @@ search_fs (const char *key, const char *var, int no_floppy, enum options type) } static grub_err_t -grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) +grub_cmd_do_search (grub_command_t cmd __attribute__ ((unused)), int argc, + char **args) { - struct grub_arg_list *state = cmd->state; - const char *var = 0; - if (argc == 0) - return grub_error (GRUB_ERR_INVALID_COMMAND, "no argument specified"); + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no argument specified"); - if (state[SEARCH_SET].set) - var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root"; - - if (state[SEARCH_LABEL].set) - search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_LABEL); - else if (state[SEARCH_FS_UUID].set) - search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FS_UUID); - else if (state[SEARCH_FILE].set) - search_fs (args[0], var, state[SEARCH_NO_FLOPPY].set, SEARCH_FILE); - else - return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type"); + FUNC_NAME (args[0], argc == 1 ? 0 : args[1], 0); return grub_errno; } -static grub_extcmd_t cmd; +static grub_command_t cmd; -GRUB_MOD_INIT(search) +#ifdef SEARCH_FILE +GRUB_MOD_INIT(search_file) +#elif defined (SEARCH_FS_UUID) +GRUB_MOD_INIT(search_fs_uuid) +#else +GRUB_MOD_INIT(search_fs_label) +#endif { cmd = - grub_register_extcmd ("search", grub_cmd_search, - GRUB_COMMAND_FLAG_BOTH, - "search [-f|-l|-u|-s|-n] NAME", - "Search devices by file, filesystem label or filesystem UUID." - " If --set is specified, the first device found is" - " set to a variable. If no variable name is" - " specified, \"root\" is used.", - options); + grub_register_command (COMMAND_NAME, grub_cmd_do_search, + COMMAND_NAME " NAME [VARIABLE]", + "Search devices by " SEARCH_TARGET "." + " If VARIABLE is specified, the first device found is" + " set to a variable."); } -GRUB_MOD_FINI(search) +#ifdef SEARCH_FILE +GRUB_MOD_FINI(search_file) +#elif defined (SEARCH_FS_UUID) +GRUB_MOD_FINI(search_fs_uuid) +#else +GRUB_MOD_FINI(search_fs_label) +#endif { - grub_unregister_extcmd (cmd); + grub_unregister_command (cmd); } diff --git a/conf/common.rmk b/conf/common.rmk index e18dd1052..9c8ac078d 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -363,7 +363,8 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) # Commands. pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ - ls.mod cmp.mod cat.mod help.mod search.mod loopback.mod \ + ls.mod cmp.mod cat.mod help.mod search_file.mod \ + search_fs_uuid.mod search_fs_label.mod search.mod loopback.mod \ fs_file.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ @@ -437,10 +438,25 @@ help_mod_CFLAGS = $(COMMON_CFLAGS) help_mod_LDFLAGS = $(COMMON_LDFLAGS) # For search.mod. -search_mod_SOURCES = commands/search.c +search_mod_SOURCES = commands/search_wrap.c search_mod_CFLAGS = $(COMMON_CFLAGS) search_mod_LDFLAGS = $(COMMON_LDFLAGS) +# For search.mod. +search_file_mod_SOURCES = commands/search_file.c +search_file_mod_CFLAGS = $(COMMON_CFLAGS) +search_file_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For search.mod. +search_label_mod_SOURCES = commands/search_label.c +search_label_mod_CFLAGS = $(COMMON_CFLAGS) +search_label_mod_LDFLAGS = $(COMMON_LDFLAGS) + +# For search.mod. +search_uuid_mod_SOURCES = commands/search_uuid.c +search_uuid_mod_CFLAGS = $(COMMON_CFLAGS) +search_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS) + # For test.mod. test_mod_SOURCES = commands/test.c test_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 09ec7787c..79c36eec1 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -108,7 +108,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ + commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/blocklist.c commands/hexdump.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ commands/password.c commands/keystatus.c \ lib/hexdump.c commands/i386/cpuid.c \ diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 99ab06f64..c9a412aaf 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -36,7 +36,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c lib/hexdump.c \ + commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c commands/keystatus.c \ commands/i386/cpuid.c \ commands/password.c \ diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 4b640de49..6b15b1473 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -62,7 +62,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ + commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index bf8fbfb9d..87364223c 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -120,7 +120,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/echo.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/blocklist.c commands/hexdump.c \ + commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/i386/pc/halt.c commands/reboot.c \ lib/envblk.c commands/loadenv.c \ commands/gptsync.c commands/probe.c commands/xnu_uuid.c \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index ee7f9ec27..df594cfd0 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -42,7 +42,7 @@ grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/search.c commands/handler.c commands/test.c \ + commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ lib/envblk.c commands/loadenv.c \ diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 62e951a5e..936d4818a 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -100,7 +100,7 @@ grub_ofpathname_SOURCES = util/sparc64/ieee1275/grub-ofpathname.c \ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ - commands/search.c commands/handler.c commands/test.c \ + commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/handler.c commands/test.c \ commands/ls.c commands/blocklist.c commands/hexdump.c \ lib/hexdump.c commands/halt.c commands/reboot.c \ lib/envblk.c commands/loadenv.c \ diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 934cd7284..a17cd5928 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -34,7 +34,7 @@ util/grub-emu.c_DEPENDENCIES = grub_emu_init.h grub_emu_SOURCES = commands/minicmd.c commands/cat.c commands/cmp.c \ commands/configfile.c commands/help.c \ commands/handler.c commands/ls.c commands/test.c \ - commands/search.c commands/hexdump.c lib/hexdump.c \ + commands/search_file.c commands/search_label.c commands/search_uuid.c commands/search_wrap.c commands/hexdump.c lib/hexdump.c \ commands/halt.c commands/reboot.c \ commands/i386/cpuid.c \ commands/password.c commands/keystatus.c \ From dab7cb49133a6a2eac0d39f6403b4eac388d012e Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 22 Sep 2009 09:29:32 +0200 Subject: [PATCH 1154/1707] missed files --- commands/search_file.c | 5 +++ commands/search_label.c | 5 +++ commands/search_uuid.c | 5 +++ commands/search_wrap.c | 81 +++++++++++++++++++++++++++++++++++++++++ 4 files changed, 96 insertions(+) create mode 100644 commands/search_file.c create mode 100644 commands/search_label.c create mode 100644 commands/search_uuid.c create mode 100644 commands/search_wrap.c diff --git a/commands/search_file.c b/commands/search_file.c new file mode 100644 index 000000000..265220001 --- /dev/null +++ b/commands/search_file.c @@ -0,0 +1,5 @@ +#define DO_SEARCH_FILE 1 +#define FUNC_NAME grub_search_fs_file +#define COMMAND_NAME "search.file" +#define SEARCH_TARGET "file" +#include "search.c" diff --git a/commands/search_label.c b/commands/search_label.c new file mode 100644 index 000000000..0047b0e8c --- /dev/null +++ b/commands/search_label.c @@ -0,0 +1,5 @@ +#define DO_SEARCH_FS_LABEL 1 +#define FUNC_NAME grub_search_label +#define COMMAND_NAME "search.fs_label" +#define SEARCH_TARGET "filesystem label" +#include "search.c" diff --git a/commands/search_uuid.c b/commands/search_uuid.c new file mode 100644 index 000000000..9767d6501 --- /dev/null +++ b/commands/search_uuid.c @@ -0,0 +1,5 @@ +#define DO_SEARCH_FS_UUID 1 +#define FUNC_NAME grub_search_fs_uuid +#define COMMAND_NAME "search.fs_uuid" +#define SEARCH_TARGET "filesystem UUID" +#include "search.c" diff --git a/commands/search_wrap.c b/commands/search_wrap.c new file mode 100644 index 000000000..35cce3f5e --- /dev/null +++ b/commands/search_wrap.c @@ -0,0 +1,81 @@ +/* search.c - search devices based on a file or a filesystem label */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2005,2007,2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +static const struct grub_arg_option options[] = + { + {"file", 'f', 0, "search devices by a file", 0, 0}, + {"label", 'l', 0, "search devices by a filesystem label", 0, 0}, + {"fs-uuid", 'u', 0, "search devices by a filesystem UUID", 0, 0}, + {"set", 's', GRUB_ARG_OPTION_OPTIONAL, "set a variable to the first device found", "VAR", ARG_TYPE_STRING}, + {"no-floppy", 'n', 0, "do not probe any floppy drive", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + +enum options + { + SEARCH_FILE, + SEARCH_LABEL, + SEARCH_FS_UUID, + SEARCH_SET, + SEARCH_NO_FLOPPY, + }; + +static grub_err_t +grub_cmd_search (grub_extcmd_t cmd, int argc, char **args) +{ + struct grub_arg_list *state = cmd->state; + const char *var = 0; + + if (argc == 0) + return grub_error (GRUB_ERR_BAD_ARGUMENT, "no argument specified"); + + if (state[SEARCH_SET].set) + var = state[SEARCH_SET].arg ? state[SEARCH_SET].arg : "root"; + + if (state[SEARCH_LABEL].set) + grub_search_label (args[0], var, state[SEARCH_NO_FLOPPY].set); + else if (state[SEARCH_FS_UUID].set) + grub_search_fs_uuid (args[0], var, state[SEARCH_NO_FLOPPY].set); + else if (state[SEARCH_FILE].set) + grub_search_fs_file (args[0], var, state[SEARCH_NO_FLOPPY].set); + else + return grub_error (GRUB_ERR_INVALID_COMMAND, "unspecified search type"); + + return grub_errno; +} + +static grub_extcmd_t cmd; + +GRUB_MOD_INIT(search) +{ + cmd = + grub_register_extcmd ("search", grub_cmd_search, + GRUB_COMMAND_FLAG_BOTH, + "search [-f|-l|-u|-s|-n] NAME", + "Search devices by file, filesystem label or filesystem UUID." + " If --set is specified, the first device found is" + " set to a variable. If no variable name is" + " specified, \"root\" is used.", + options); +} + +GRUB_MOD_FINI(search) +{ + grub_unregister_extcmd (cmd); +} From d6cb87a6351caef982c897523ee8171a1542be60 Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 22 Sep 2009 09:31:18 +0200 Subject: [PATCH 1155/1707] remove fs_*.c --- conf/common.rmk | 12 +--- disk/fs_file.c | 136 ------------------------------------------- disk/fs_uuid.c | 149 ------------------------------------------------ 3 files changed, 1 insertion(+), 296 deletions(-) delete mode 100644 disk/fs_file.c delete mode 100644 disk/fs_uuid.c diff --git a/conf/common.rmk b/conf/common.rmk index 9c8ac078d..1dc13159c 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -365,7 +365,7 @@ scsi_mod_LDFLAGS = $(COMMON_LDFLAGS) pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ ls.mod cmp.mod cat.mod help.mod search_file.mod \ search_fs_uuid.mod search_fs_label.mod search.mod loopback.mod \ - fs_file.mod fs_uuid.mod configfile.mod echo.mod \ + configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ msdospart.mod memrw.mod normal.mod sh.mod lua.mod \ @@ -467,16 +467,6 @@ loopback_mod_SOURCES = disk/loopback.c loopback_mod_CFLAGS = $(COMMON_CFLAGS) loopback_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For fs_file.mod -fs_file_mod_SOURCES = disk/fs_file.c -fs_file_mod_CFLAGS = $(COMMON_CFLAGS) -fs_file_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# For fs_uuid.mod -fs_uuid_mod_SOURCES = disk/fs_uuid.c -fs_uuid_mod_CFLAGS = $(COMMON_CFLAGS) -fs_uuid_mod_LDFLAGS = $(COMMON_LDFLAGS) - # For configfile.mod configfile_mod_SOURCES = commands/configfile.c configfile_mod_CFLAGS = $(COMMON_CFLAGS) diff --git a/disk/fs_file.c b/disk/fs_file.c deleted file mode 100644 index e09568250..000000000 --- a/disk/fs_file.c +++ /dev/null @@ -1,136 +0,0 @@ -/* fs_file.c - Access partition by a file it contains. */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include -#include - -static grub_device_t -search_fs_file (const char *key, unsigned long *count) -{ - char *filename = NULL; - grub_device_t ret = NULL; - *count = 0; - - auto int iterate_device (const char *name); - int iterate_device (const char *name) - { - int len; - grub_file_t file; - - (*count)++; - - len = grub_strlen (name) + 2 + grub_strlen (key) + 1; - filename = grub_realloc (filename, len); - if (! filename) - return 1; - - grub_sprintf (filename, "(%s)%s", name, key); - file = grub_file_open (filename); - if (file) - { - grub_file_close (file); - ret = grub_device_open (name); - return 1; - } - - grub_errno = GRUB_ERR_NONE; - return 0; - } - - grub_device_iterate (iterate_device); - grub_free (filename); - - return ret; -} - -static grub_err_t -grub_fs_file_open (const char *name, grub_disk_t disk) -{ - grub_device_t dev; - - if (grub_strncmp (name, "FILE=", sizeof ("FILE=") - 1)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a FILE virtual volume"); - - dev = search_fs_file (name + sizeof ("FILE=") - 1, &disk->id); - if (! dev) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching file found"); - - disk->total_sectors = dev->disk->total_sectors; - disk->has_partitions = 0; - if (dev->disk->partition) - { - disk->partition = grub_malloc (sizeof (*disk->partition)); - if (disk->partition) - grub_memcpy (disk->partition, dev->disk->partition, - sizeof (*disk->partition)); - } - else - disk->partition = NULL; - - disk->data = dev; - - return GRUB_ERR_NONE; -} - -static void -grub_fs_file_close (grub_disk_t disk) -{ - grub_device_t parent = disk->data; - grub_device_close (parent); -} - -static grub_err_t -grub_fs_file_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) -{ - grub_device_t parent = disk->data; - return parent->disk->dev->read (parent->disk, sector, size, buf); -} - -static grub_err_t -grub_fs_file_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) -{ - grub_device_t parent = disk->data; - return parent->disk->dev->write (parent->disk, sector, size, buf); -} - -static struct grub_disk_dev grub_fs_file_dev = { - .name = "fs_file", - .id = GRUB_DISK_DEVICE_FILE_ID, - .open = grub_fs_file_open, - .close = grub_fs_file_close, - .read = grub_fs_file_read, - .write = grub_fs_file_write, - .next = 0 -}; - -GRUB_MOD_INIT (fs_file) -{ - grub_disk_dev_register (&grub_fs_file_dev); -} - -GRUB_MOD_FINI (fs_file) -{ - grub_disk_dev_unregister (&grub_fs_file_dev); -} diff --git a/disk/fs_uuid.c b/disk/fs_uuid.c deleted file mode 100644 index 6901dbacf..000000000 --- a/disk/fs_uuid.c +++ /dev/null @@ -1,149 +0,0 @@ -/* fs_uuid.c - Access disks by their filesystem UUID. */ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007,2008 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include -#include -#include -#include -#include -#include - -#include -#include - -static grub_device_t -search_fs_uuid (const char *key, unsigned long *count) -{ - *count = 0; - grub_device_t ret = NULL; - - auto int iterate_device (const char *name); - int iterate_device (const char *name) - { - grub_device_t dev; - - dev = grub_device_open (name); - if (dev) - { - grub_fs_t fs; - - fs = grub_fs_probe (dev); - if (fs && fs->uuid) - { - char *uuid; - - (fs->uuid) (dev, &uuid); - if (grub_errno == GRUB_ERR_NONE && uuid) - { - (*count)++; - - if (grub_strcasecmp (uuid, key) == 0) - { - ret = dev; - grub_free (uuid); - return 1; - } - grub_free (uuid); - } - } - - grub_device_close (dev); - } - - grub_errno = GRUB_ERR_NONE; - return 0; - } - - grub_device_iterate (iterate_device); - - return ret; -} - -static grub_err_t -grub_fs_uuid_open (const char *name, grub_disk_t disk) -{ - grub_device_t dev; - - if (grub_strncmp (name, "UUID=", sizeof ("UUID=")-1)) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "not a UUID virtual volume"); - - dev = search_fs_uuid (name + sizeof ("UUID=") - 1, &disk->id); - if (! dev) - return grub_error (GRUB_ERR_UNKNOWN_DEVICE, "no matching UUID found"); - - disk->total_sectors = dev->disk->total_sectors; - disk->has_partitions = 0; - if (dev->disk->partition) - { - disk->partition = grub_malloc (sizeof (*disk->partition)); - if (disk->partition) - grub_memcpy (disk->partition, dev->disk->partition, - sizeof (*disk->partition)); - } - else - disk->partition = NULL; - - disk->data = dev; - - return GRUB_ERR_NONE; -} - -static void -grub_fs_uuid_close (grub_disk_t disk __attribute((unused))) -{ - grub_device_t parent = disk->data; - grub_device_close (parent); -} - -static grub_err_t -grub_fs_uuid_read (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, char *buf) -{ - grub_device_t parent = disk->data; - return parent->disk->dev->read (parent->disk, sector, size, buf); -} - -static grub_err_t -grub_fs_uuid_write (grub_disk_t disk, grub_disk_addr_t sector, - grub_size_t size, const char *buf) -{ - grub_device_t parent = disk->data; - return parent->disk->dev->write (parent->disk, sector, size, buf); -} - -static struct grub_disk_dev grub_fs_uuid_dev = - { - .name = "fs_uuid", - .id = GRUB_DISK_DEVICE_UUID_ID, - .open = grub_fs_uuid_open, - .close = grub_fs_uuid_close, - .read = grub_fs_uuid_read, - .write = grub_fs_uuid_write, - .next = 0 - }; - -GRUB_MOD_INIT(fs_uuid) -{ - grub_disk_dev_register (&grub_fs_uuid_dev); -} - -GRUB_MOD_FINI(fs_uuid) -{ - grub_disk_dev_unregister (&grub_fs_uuid_dev); -} From afba34eb21c649c8874b3ba58cad990a08557fbe Mon Sep 17 00:00:00 2001 From: phcoder Date: Tue, 22 Sep 2009 09:38:12 +0200 Subject: [PATCH 1156/1707] use search_fs_uuid --- util/i386/pc/grub-install.in | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 8ceb811dd..78500766c 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -271,6 +271,7 @@ modules="$modules $disk_module" modules="$modules $fs_module $partmap_module $devabstraction_module" prefix_drive= +config= if [ "x${devabstraction_module}" = "x" ] ; then if echo "${install_device}" | grep -qx "(.*)" ; then install_drive="${install_device}" @@ -289,16 +290,16 @@ if [ "x${devabstraction_module}" = "x" ] ; then echo "UUID needed with ata mod, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 exit 1 fi - prefix_drive="(UUID=${uuid})" - modules="$modules fs_uuid" + config="search_fs_uuid ${uuid} root" + modules="$modules search_fs_uuid" elif [ "x${grub_drive}" != "x${install_drive}" ] ; then uuid="`$grub_probe --target=fs_uuid --device ${grub_device}`" if [ "x${uuid}" = "x" ] ; then echo "You attempted a cross-disk install, but the filesystem containing ${grubdir} does not support UUIDs." 1>&2 exit 1 fi - prefix_drive="(UUID=${uuid})" - modules="$modules fs_uuid" + config="search_fs_uuid ${uuid} root" + modules="$modules search_fs_uuid" fi else prefix_drive=`$grub_probe --target=drive --device ${grub_device}` @@ -309,14 +310,20 @@ if [ "x${relative_grubdir}" = "x" ] ; then relative_grubdir=/ fi +config_opt= +echo $config > ${grubdir}/load.cfg +if [ x$config != x ]; then + config_opt="-c $config " +fi + if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then - $grub_mkimage --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 + $grub_mkimage ${config_opt} --output=${grubdir}/core.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 # Now perform the installation. $grub_setup ${setup_verbose} ${setup_force} --directory=${grubdir} --device-map=${device_map} \ ${install_device} || exit 1 else - $grub_mkimage -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 + $grub_mkimage ${config_opt} -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 fi # Prompt the user to check if the device map is correct. From 9b3f8365713e8636f5ed97bb263c90f47ea0caa6 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 23 Sep 2009 09:26:34 +0000 Subject: [PATCH 1157/1707] 2009-09-23 Felix Zielcke * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Add support for `*.dpkg-new'. --- ChangeLog | 5 +++++ util/grub-mkconfig_lib.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 22aeb6feb..1ac4b4b3f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-23 Felix Zielcke + + * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Add support + for `*.dpkg-new'. + 2009-09-21 Colin Watson Build info documentation. Some code borrowed from Automake. diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index 2385b0878..a4db096f8 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -157,7 +157,7 @@ grub_file_is_not_garbage () { if test -f "$1" ; then case "$1" in - *.dpkg-dist|*.dpkg-old|*.dpkg-tmp) return 1 ;; # debian dpkg + *.dpkg-dist|*.dpkg-old|*.dpkg-tmp|*.dpkg-new) return 1 ;; # debian dpkg esac else return 1 From d96875df6ebec0cb890758ba70c878b016a6e49f Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 23 Sep 2009 09:46:08 +0000 Subject: [PATCH 1158/1707] 2009-09-23 Felix Zielcke * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Cope with `*.dpkg-*' --- ChangeLog | 4 ++++ util/grub-mkconfig_lib.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1ac4b4b3f..bfdbc5a43 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-09-23 Felix Zielcke + + * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Cope with `*.dpkg-*' + 2009-09-23 Felix Zielcke * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Add support diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index a4db096f8..bb30cc475 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -157,7 +157,7 @@ grub_file_is_not_garbage () { if test -f "$1" ; then case "$1" in - *.dpkg-dist|*.dpkg-old|*.dpkg-tmp|*.dpkg-new) return 1 ;; # debian dpkg + *.dpkg-*) return 1 ;; # debian dpkg esac else return 1 From ff4202239622d4cce8dceb67d02401f602b14640 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Wed, 23 Sep 2009 17:18:06 +0000 Subject: [PATCH 1159/1707] 2009-09-23 Colin Watson * configure.ac: Call AC_PROG_MKDIR_P. * Makefile.in (docs/stamp-vti): Create docs directory. Create version.texi in $(builddir) rather than $(srcdir). (docs/grub.info): Create docs directory. Prepend $(builddir)/docs to makeinfo's @include search path. --- ChangeLog | 8 ++++++++ Makefile.in | 13 ++++++++----- configure.ac | 1 + 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index bfdbc5a43..dc343d1d9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-09-23 Colin Watson + + * configure.ac: Call AC_PROG_MKDIR_P. + * Makefile.in (docs/stamp-vti): Create docs directory. Create + version.texi in $(builddir) rather than $(srcdir). + (docs/grub.info): Create docs directory. Prepend $(builddir)/docs + to makeinfo's @include search path. + 2009-09-23 Felix Zielcke * util/grub-mkconfig_lib.in (grub_file_is_not_garbage): Cope with `*.dpkg-*' diff --git a/Makefile.in b/Makefile.in index ee4589a78..363d696f1 100644 --- a/Makefile.in +++ b/Makefile.in @@ -59,6 +59,7 @@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ +MKDIR_P = @MKDIR_P@ mkinstalldirs = $(srcdir)/mkinstalldirs @@ -179,20 +180,22 @@ MOSTLYCLEANFILES += vti.tmp MAINTAINER_CLEANFILES += docs/stamp-vti docs/version.texi docs/version.texi: docs/stamp-vti docs/stamp-vti: docs/grub.texi + $(MKDIR_P) docs (set `$(SHELL) $(srcdir)/docs/mdate-sh $<`; \ echo "@set UPDATED $$1 $$2 $$3"; \ echo "@set UPDATED-MONTH $$2 $$3"; \ echo "@set EDITION $(PACKAGE_VERSION)"; \ echo "@set VERSION $(PACKAGE_VERSION)") > vti.tmp - @cmp -s vti.tmp $(srcdir)/docs/version.texi \ - || (echo "Updating $(srcdir)/docs/version.texi"; \ - cp vti.tmp $(srcdir)/docs/version.texi) + @cmp -s vti.tmp $(builddir)/docs/version.texi \ + || (echo "Updating $(builddir)/docs/version.texi"; \ + cp vti.tmp $(builddir)/docs/version.texi) -@rm -f vti.tmp - @cp $(srcdir)/docs/version.texi $@ + @cp $(builddir)/docs/version.texi $@ # Use --force until such time as the documentation is cleaned up. docs/grub.info: docs/grub.texi docs/version.texi docs/fdl.texi - $(MAKEINFO) --no-split --force $< -o $@ || : + $(MKDIR_P) docs + $(MAKEINFO) -P $(builddir)/docs --no-split --force $< -o $@ || : ifeq (, $(UNIFONT_BDF)) else diff --git a/configure.ac b/configure.ac index e827a32c2..4d221b4d6 100644 --- a/configure.ac +++ b/configure.ac @@ -144,6 +144,7 @@ done AC_PROG_INSTALL AC_PROG_AWK AC_PROG_MAKE_SET +AC_PROG_MKDIR_P # These are not a "must". AC_PATH_PROG(RUBY, ruby) From 74c958b18075e0e4e7c02f1356b45756f3381e08 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 24 Sep 2009 13:15:51 +0000 Subject: [PATCH 1160/1707] 2009-09-24 Robert Millan * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate return value. * term/i386/pc/at_keyboard.c (grub_keyboard_getkey): Negate KEYBOARD_ISREADY check. (grub_at_keyboard_checkkey): Rename to ... (grub_at_keyboard_getkey_noblock): ... this. Update all users. Remove gratuitous cast. --- ChangeLog | 10 ++++++++++ include/grub/i386/at_keyboard.h | 2 +- term/i386/pc/at_keyboard.c | 13 +++++++------ 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index dc343d1d9..b5315fa70 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-09-24 Robert Millan + + * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate + return value. + * term/i386/pc/at_keyboard.c (grub_keyboard_getkey): Negate + KEYBOARD_ISREADY check. + (grub_at_keyboard_checkkey): Rename to ... + (grub_at_keyboard_getkey_noblock): ... this. Update all users. + Remove gratuitous cast. + 2009-09-23 Colin Watson * configure.ac: Call AC_PROG_MKDIR_P. diff --git a/include/grub/i386/at_keyboard.h b/include/grub/i386/at_keyboard.h index 5c15ef344..96b21627f 100644 --- a/include/grub/i386/at_keyboard.h +++ b/include/grub/i386/at_keyboard.h @@ -39,7 +39,7 @@ #define KEYBOARD_SCANCODE_SET1 0x40 #define KEYBOARD_ISMAKE(x) !((x) & 0x80) -#define KEYBOARD_ISREADY(x) (((x) & 0x01) == 0) +#define KEYBOARD_ISREADY(x) ((x) & 0x01) #define KEYBOARD_SCANCODE(x) ((x) & 0x7f) #ifdef GRUB_MACHINE_IEEE1275 diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index 0b2a06d46..1ab41d8fd 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -135,7 +135,7 @@ static int grub_keyboard_getkey (void) { grub_uint8_t key; - if (KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) + if (! KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS))) return -1; key = grub_inb (KEYBOARD_REG_DATA); /* FIXME */ grub_keyboard_isr (key); @@ -146,7 +146,7 @@ grub_keyboard_getkey (void) /* If there is a character pending, return it; otherwise return -1. */ static int -grub_at_keyboard_checkkey (void) +grub_at_keyboard_getkey_noblock (void) { int code, key; code = grub_keyboard_getkey (); @@ -186,7 +186,7 @@ grub_at_keyboard_checkkey (void) key += 'a' - 'A'; } } - return (int) key; + return key; } static int @@ -195,7 +195,7 @@ grub_at_keyboard_getkey (void) int key; do { - key = grub_at_keyboard_checkkey (); + key = grub_at_keyboard_getkey_noblock (); } while (key == -1); return key; } @@ -220,7 +220,8 @@ static struct grub_term_input grub_at_keyboard_term = .name = "at_keyboard", .init = grub_keyboard_controller_init, .fini = grub_keyboard_controller_fini, - .checkkey = grub_at_keyboard_checkkey, + /* FIXME: This routine flushes input buffer, and it shouldn't. */ + .checkkey = grub_at_keyboard_getkey_noblock, .getkey = grub_at_keyboard_getkey, }; From c6dcedf6b2846ea6018b404e098fad1d87d097b7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 24 Sep 2009 13:22:19 +0000 Subject: [PATCH 1161/1707] 2009-09-24 Robert Millan * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific size check within GRUB_MACHINE_PCBIOS section. --- ChangeLog | 5 +++++ util/i386/pc/grub-mkimage.c | 45 ++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index b5315fa70..797b50874 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-24 Robert Millan + + * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific + size check within GRUB_MACHINE_PCBIOS section. + 2009-09-24 Robert Millan * include/grub/i386/at_keyboard.h (KEYBOARD_ISREADY): Negate diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index b81392ce8..c8fe02e13 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -97,7 +97,6 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], size_t kernel_size, boot_size, total_module_size, core_size; size_t memdisk_size = 0, config_size = 0; char *kernel_path, *boot_path; - unsigned num; size_t offset; struct grub_util_path_list *path_list, *p, *next; struct grub_module_info *modinfo; @@ -196,30 +195,30 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], grub_util_info ("the core size is 0x%x", core_size); - num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); - if (num > 0xffff) - grub_util_error ("the core image is too big"); - #if defined(GRUB_MACHINE_PCBIOS) - - boot_path = grub_util_get_path (dir, "diskboot.img"); - boot_size = grub_util_get_image_size (boot_path); - if (boot_size != GRUB_DISK_SECTOR_SIZE) - grub_util_error ("diskboot.img is not one sector size"); - - boot_img = grub_util_read_image (boot_path); - - /* i386 is a little endian architecture. */ - *((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE - - GRUB_BOOT_MACHINE_LIST_SIZE + 8)) - = grub_cpu_to_le16 (num); - - grub_util_write_image (boot_img, boot_size, out); - free (boot_img); - free (boot_path); - + { + unsigned num; + num = ((core_size + GRUB_DISK_SECTOR_SIZE - 1) >> GRUB_DISK_SECTOR_BITS); + if (num > 0xffff) + grub_util_error ("the core image is too big"); + + boot_path = grub_util_get_path (dir, "diskboot.img"); + boot_size = grub_util_get_image_size (boot_path); + if (boot_size != GRUB_DISK_SECTOR_SIZE) + grub_util_error ("diskboot.img is not one sector size"); + + boot_img = grub_util_read_image (boot_path); + + /* i386 is a little endian architecture. */ + *((grub_uint16_t *) (boot_img + GRUB_DISK_SECTOR_SIZE + - GRUB_BOOT_MACHINE_LIST_SIZE + 8)) + = grub_cpu_to_le16 (num); + + grub_util_write_image (boot_img, boot_size, out); + free (boot_img); + free (boot_path); + } #elif defined(GRUB_MACHINE_QEMU) - { char *rom_img; size_t rom_size; From 4e5a02a7baa27d8d36fde17808225322e8170263 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 24 Sep 2009 13:25:07 +0000 Subject: [PATCH 1162/1707] 2009-09-24 Robert Millan Fix "lost keypress" bug in at_keyboard. * term/i386/pc/at_keyboard.c (grub_at_keyboard_checkkey): New function. Checks for readyness of input buffer (without flushing it). (grub_at_keyboard_term): Use grub_at_keyboard_checkkey() rather than grub_at_keyboard_getkey_noblock() for `checkkey' struct member. --- ChangeLog | 9 +++++++++ term/i386/pc/at_keyboard.c | 10 ++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 797b50874..1c29001a4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-09-24 Robert Millan + + Fix "lost keypress" bug in at_keyboard. + + * term/i386/pc/at_keyboard.c (grub_at_keyboard_checkkey): New function. + Checks for readyness of input buffer (without flushing it). + (grub_at_keyboard_term): Use grub_at_keyboard_checkkey() rather + than grub_at_keyboard_getkey_noblock() for `checkkey' struct member. + 2009-09-24 Robert Millan * util/i386/pc/grub-mkimage.c (generate_image): Enclose BIOS-specific diff --git a/term/i386/pc/at_keyboard.c b/term/i386/pc/at_keyboard.c index 1ab41d8fd..cf30e7242 100644 --- a/term/i386/pc/at_keyboard.c +++ b/term/i386/pc/at_keyboard.c @@ -189,6 +189,13 @@ grub_at_keyboard_getkey_noblock (void) return key; } +static int +grub_at_keyboard_checkkey (void) +{ + /* FIXME: this will be triggered by BREAK events. */ + return KEYBOARD_ISREADY (grub_inb (KEYBOARD_REG_STATUS)) ? 1 : -1; +} + static int grub_at_keyboard_getkey (void) { @@ -220,8 +227,7 @@ static struct grub_term_input grub_at_keyboard_term = .name = "at_keyboard", .init = grub_keyboard_controller_init, .fini = grub_keyboard_controller_fini, - /* FIXME: This routine flushes input buffer, and it shouldn't. */ - .checkkey = grub_at_keyboard_getkey_noblock, + .checkkey = grub_at_keyboard_checkkey, .getkey = grub_at_keyboard_getkey, }; From 6b9b6276d441db3d79de53c6f366844f277e71f0 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 24 Sep 2009 13:40:40 +0000 Subject: [PATCH 1163/1707] 2009-09-24 Pavel Roskin * include/grub/kernel.h (struct grub_module_header): Remove `grub_module_header_types'. Make `type' unsigned. Make `size' 32-bit on all platforms. * util/elf/grub-mkimage.c (load_modules): Treat `type' as an 8-bit field. Use grub_host_to_target32() for `size'. * util/i386/efi/grub-mkimage.c (make_mods_section): Likewise. * util/i386/pc/grub-mkimage.c (generate_image): Likewise. * util/sparc64/ieee1275/grub-mkimage.c (generate_image): Likewise. --- ChangeLog | 11 +++++++++++ include/grub/kernel.h | 18 +++++++++--------- util/elf/grub-mkimage.c | 6 +++--- util/i386/efi/grub-mkimage.c | 4 ++-- util/i386/pc/grub-mkimage.c | 12 ++++++------ util/sparc64/ieee1275/grub-mkimage.c | 8 ++++---- 6 files changed, 35 insertions(+), 24 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1c29001a4..fd9865440 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,14 @@ +2009-09-24 Pavel Roskin + + * include/grub/kernel.h (struct grub_module_header): Remove + `grub_module_header_types'. Make `type' unsigned. Make `size' + 32-bit on all platforms. + * util/elf/grub-mkimage.c (load_modules): Treat `type' as an + 8-bit field. Use grub_host_to_target32() for `size'. + * util/i386/efi/grub-mkimage.c (make_mods_section): Likewise. + * util/i386/pc/grub-mkimage.c (generate_image): Likewise. + * util/sparc64/ieee1275/grub-mkimage.c (generate_image): Likewise. + 2009-09-24 Robert Millan Fix "lost keypress" bug in at_keyboard. diff --git a/include/grub/kernel.h b/include/grub/kernel.h index 02bc2765a..75ec77c2a 100644 --- a/include/grub/kernel.h +++ b/include/grub/kernel.h @@ -22,20 +22,20 @@ #include #include +enum +{ + OBJ_TYPE_ELF, + OBJ_TYPE_MEMDISK, + OBJ_TYPE_CONFIG +}; + /* The module header. */ struct grub_module_header { /* The type of object. */ - grub_int8_t type; - enum - { - OBJ_TYPE_ELF, - OBJ_TYPE_MEMDISK, - OBJ_TYPE_CONFIG - } grub_module_header_types; - + grub_uint8_t type; /* The size of object (including this header). */ - grub_target_size_t size; + grub_uint32_t size; }; /* "gmim" (GRUB Module Info Magic). */ diff --git a/util/elf/grub-mkimage.c b/util/elf/grub-mkimage.c index 52bb6397d..535427208 100644 --- a/util/elf/grub-mkimage.c +++ b/util/elf/grub-mkimage.c @@ -144,7 +144,7 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, mod_size = grub_util_get_image_size (p->name); header = (struct grub_module_header *) (module_img + offset); - header->type = grub_host_to_target32 (OBJ_TYPE_ELF); + header->type = OBJ_TYPE_ELF; header->size = grub_host_to_target32 (mod_size + sizeof (*header)); grub_util_load_image (p->name, module_img + offset + sizeof (*header)); @@ -157,8 +157,8 @@ load_modules (grub_addr_t modbase, Elf32_Phdr *phdr, const char *dir, struct grub_module_header *header; header = (struct grub_module_header *) (module_img + offset); - header->type = grub_cpu_to_le32 (OBJ_TYPE_MEMDISK); - header->size = grub_cpu_to_le32 (memdisk_size + sizeof (*header)); + header->type = OBJ_TYPE_MEMDISK; + header->size = grub_host_to_target32 (memdisk_size + sizeof (*header)); offset += sizeof (*header); grub_util_load_image (memdisk_path, module_img + offset); diff --git a/util/i386/efi/grub-mkimage.c b/util/i386/efi/grub-mkimage.c index 466aa9f87..29a823e58 100644 --- a/util/i386/efi/grub-mkimage.c +++ b/util/i386/efi/grub-mkimage.c @@ -683,8 +683,8 @@ make_mods_section (FILE *out, Elf_Addr current_address, grub_util_info ("adding module %s", p->name); mod_size = grub_util_get_image_size (p->name); - header.type = grub_cpu_to_le32 (OBJ_TYPE_ELF); - header.size = grub_cpu_to_le32 (mod_size + sizeof (header)); + header.type = OBJ_TYPE_ELF; + header.size = grub_host_to_target32 (mod_size + sizeof (header)); mod_image = grub_util_read_image (p->name); diff --git a/util/i386/pc/grub-mkimage.c b/util/i386/pc/grub-mkimage.c index c8fe02e13..15168f8fa 100644 --- a/util/i386/pc/grub-mkimage.c +++ b/util/i386/pc/grub-mkimage.c @@ -152,8 +152,8 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], header = (struct grub_module_header *) (kernel_img + offset); memset (header, 0, sizeof (struct grub_module_header)); - header->type = grub_cpu_to_le32 (OBJ_TYPE_ELF); - header->size = grub_cpu_to_le32 (mod_size + sizeof (*header)); + header->type = OBJ_TYPE_ELF; + header->size = grub_host_to_target32 (mod_size + sizeof (*header)); offset += sizeof (*header); grub_util_load_image (p->name, kernel_img + offset); @@ -166,8 +166,8 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], header = (struct grub_module_header *) (kernel_img + offset); memset (header, 0, sizeof (struct grub_module_header)); - header->type = grub_cpu_to_le32 (OBJ_TYPE_MEMDISK); - header->size = grub_cpu_to_le32 (memdisk_size + sizeof (*header)); + header->type = OBJ_TYPE_MEMDISK; + header->size = grub_host_to_target32 (memdisk_size + sizeof (*header)); offset += sizeof (*header); grub_util_load_image (memdisk_path, kernel_img + offset); @@ -180,8 +180,8 @@ generate_image (const char *dir, char *prefix, FILE *out, char *mods[], header = (struct grub_module_header *) (kernel_img + offset); memset (header, 0, sizeof (struct grub_module_header)); - header->type = grub_cpu_to_le32 (OBJ_TYPE_CONFIG); - header->size = grub_cpu_to_le32 (config_size + sizeof (*header)); + header->type = OBJ_TYPE_CONFIG; + header->size = grub_host_to_target32 (config_size + sizeof (*header)); offset += sizeof (*header); grub_util_load_image (config_path, kernel_img + offset); diff --git a/util/sparc64/ieee1275/grub-mkimage.c b/util/sparc64/ieee1275/grub-mkimage.c index 247f13846..0a611da8f 100644 --- a/util/sparc64/ieee1275/grub-mkimage.c +++ b/util/sparc64/ieee1275/grub-mkimage.c @@ -98,8 +98,8 @@ generate_image (const char *dir, const char *prefix, FILE *out, char *mods[], ch mod_size = grub_util_get_image_size (p->name); header = (struct grub_module_header *) (kernel_img + offset); - header->type = grub_cpu_to_be32 (OBJ_TYPE_ELF); - header->size = grub_cpu_to_be32 (mod_size + sizeof (*header)); + header->type = OBJ_TYPE_ELF; + header->size = grub_host_to_target32 (mod_size + sizeof (*header)); offset += sizeof (*header); grub_util_load_image (p->name, kernel_img + offset); @@ -111,8 +111,8 @@ generate_image (const char *dir, const char *prefix, FILE *out, char *mods[], ch struct grub_module_header *header; header = (struct grub_module_header *) (kernel_img + offset); - header->type = grub_cpu_to_be32 (OBJ_TYPE_MEMDISK); - header->size = grub_cpu_to_be32 (memdisk_size + sizeof (*header)); + header->type = OBJ_TYPE_MEMDISK; + header->size = grub_host_to_target32 (memdisk_size + sizeof (*header)); offset += sizeof (*header); grub_util_load_image (memdisk_path, kernel_img + offset); From cb8a2c382e70d3b6924120c86e944297cd8d0dce Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 25 Sep 2009 23:43:46 +0000 Subject: [PATCH 1164/1707] 2009-09-26 Colin Watson * docs/grub.texi (Command-line and menu entry commands): Document date and echo commands. --- ChangeLog | 5 +++++ docs/grub.texi | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 63 insertions(+) diff --git a/ChangeLog b/ChangeLog index fd9865440..fdca53d01 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-09-26 Colin Watson + + * docs/grub.texi (Command-line and menu entry commands): Document + date and echo commands. + 2009-09-24 Pavel Roskin * include/grub/kernel.h (struct grub_module_header): Remove diff --git a/docs/grub.texi b/docs/grub.texi index 06059df4d..4fa44462e 100644 --- a/docs/grub.texi +++ b/docs/grub.texi @@ -1118,6 +1118,8 @@ you forget a command, you can run the command @command{help} * cmp:: Compare two files * configfile:: Load a configuration file * crc:: Calculate CRC32 checksums +* date:: Display or set current date and time +* echo:: Display a line of text * export:: Export an environment variable * halt:: Shut down your computer * help:: Show help messages @@ -1234,6 +1236,62 @@ Display the CRC32 checksum of @var{file}. @end deffn +@node date +@subsection date + +@deffn Command date [[year-]month-day] [hour:minute[:second]] +With no arguments, print the current date and time. + +Otherwise, take the current date and time, change any elements specified as +arguments, and set the result as the new date and time. For example, `date +01-01' will set the current month and day to January 1, but leave the year, +hour, minute, and second unchanged. +@end deffn + + +@node echo +@subsection echo + +@deffn Command echo [@option{-n}] [@option{-e}] string @dots{} +Display the requested text and, unless the @option{-n} option is used, a +trailing new line. If there is more than one string, they are separated by +spaces in the output. As usual in GRUB commands, variables may be +substituted using @samp{$@{var@}}. + +The @option{-e} option enables interpretation of backslash escapes. The +following sequences are recognised: + +@table @code +@item \\ +backslash + +@item \a +alert (BEL) + +@item \c +suppress trailing new line + +@item \f +form feed + +@item \n +new line + +@item \r +carriage return + +@item \t +horizontal tab + +@item \v +vertical tab +@end table + +When interpreting backslash escapes, backslash followed by any other +character will print that character. +@end deffn + + @node export @subsection export From 31299a9556499ac65cc387e293a6d3744ccb622a Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 26 Sep 2009 11:48:55 +0000 Subject: [PATCH 1165/1707] 2009-09-26 Robert Millan * conf/common.rmk (pkglib_MODULES): Remove `lua.mod'. (lua_mod_SOURCES, lua_mod_CFLAGS, lua_mod_LDFLAGS): Remove. * util/osdetect.lua: Remove. * script/lua/lauxlib.c: Likewise. * script/lua/ldebug.c: Likewise. * script/lua/grub_main.c: Likewise. * script/lua/lauxlib.h: Likewise. * script/lua/ldebug.h: Likewise. * script/lua/ltablib.c: Likewise. * script/lua/liolib.c: Likewise. * script/lua/lstrlib.c: Likewise. * script/lua/lualib.h: Likewise. * script/lua/ldo.c: Likewise. * script/lua/ldump.c: Likewise. * script/lua/ldo.h: Likewise. * script/lua/loslib.c: Likewise. * script/lua/lundump.c: Likewise. * script/lua/grub_lib.c: Likewise. * script/lua/ldblib.c: Likewise. * script/lua/lundump.h: Likewise. * script/lua/lmem.c: Likewise. * script/lua/grub_lib.h: Likewise. * script/lua/lmathlib.c: Likewise. * script/lua/lstate.c: Likewise. * script/lua/ltm.c: Likewise. * script/lua/lvm.c: Likewise. * script/lua/lmem.h: Likewise. * script/lua/lstate.h: Likewise. * script/lua/ltm.h: Likewise. * script/lua/ltable.c: Likewise. * script/lua/lvm.h: Likewise. * script/lua/llex.c: Likewise. * script/lua/lgc.c: Likewise. * script/lua/grub_lua.h: Likewise. * script/lua/loadlib.c: Likewise. * script/lua/lfunc.c: Likewise. * script/lua/lopcodes.c: Likewise. * script/lua/lparser.c: Likewise. * script/lua/ltable.h: Likewise. * script/lua/llex.h: Likewise. * script/lua/lgc.h: Likewise. * script/lua/lfunc.h: Likewise. * script/lua/lbaselib.c: Likewise. * script/lua/lopcodes.h: Likewise. * script/lua/lparser.h: Likewise. * script/lua/lzio.c: Likewise. * script/lua/linit.c: Likewise. * script/lua/lobject.c: Likewise. * script/lua/llimits.h: Likewise. * script/lua/lstring.c: Likewise. * script/lua/lzio.h: Likewise. * script/lua/lapi.c: Likewise. * script/lua/lcode.c: Likewise. * script/lua/lua.h: Likewise. * script/lua/lobject.h: Likewise. * script/lua/lstring.h: Likewise. * script/lua/lapi.h: Likewise. * script/lua/lcode.h: Likewise. * script/lua/luaconf.h: Likewise. --- ChangeLog | 63 ++ conf/common.rmk | 19 +- script/lua/grub_lib.c | 438 ------------- script/lua/grub_lib.h | 24 - script/lua/grub_lua.h | 114 ---- script/lua/grub_main.c | 209 ------- script/lua/lapi.c | 1088 -------------------------------- script/lua/lapi.h | 16 - script/lua/lauxlib.c | 668 -------------------- script/lua/lauxlib.h | 175 ------ script/lua/lbaselib.c | 652 ------------------- script/lua/lcode.c | 848 ------------------------- script/lua/lcode.h | 76 --- script/lua/ldblib.c | 398 ------------ script/lua/ldebug.c | 638 ------------------- script/lua/ldebug.h | 33 - script/lua/ldo.c | 519 ---------------- script/lua/ldo.h | 57 -- script/lua/ldump.c | 164 ----- script/lua/lfunc.c | 174 ------ script/lua/lfunc.h | 34 - script/lua/lgc.c | 713 --------------------- script/lua/lgc.h | 110 ---- script/lua/linit.c | 38 -- script/lua/liolib.c | 553 ----------------- script/lua/llex.c | 467 -------------- script/lua/llex.h | 81 --- script/lua/llimits.h | 128 ---- script/lua/lmathlib.c | 263 -------- script/lua/lmem.c | 86 --- script/lua/lmem.h | 50 -- script/lua/loadlib.c | 665 -------------------- script/lua/lobject.c | 216 ------- script/lua/lobject.h | 380 ------------ script/lua/lopcodes.c | 102 --- script/lua/lopcodes.h | 268 -------- script/lua/loslib.c | 243 -------- script/lua/lparser.c | 1340 ---------------------------------------- script/lua/lparser.h | 82 --- script/lua/lstate.c | 213 ------- script/lua/lstate.h | 169 ----- script/lua/lstring.c | 112 ---- script/lua/lstring.h | 31 - script/lua/lstrlib.c | 870 -------------------------- script/lua/ltable.c | 594 ------------------ script/lua/ltable.h | 40 -- script/lua/ltablib.c | 288 --------- script/lua/ltm.c | 76 --- script/lua/ltm.h | 54 -- script/lua/lua.h | 388 ------------ script/lua/luaconf.h | 811 ------------------------ script/lua/lualib.h | 53 -- script/lua/lundump.c | 229 ------- script/lua/lundump.h | 36 -- script/lua/lvm.c | 764 ----------------------- script/lua/lvm.h | 36 -- script/lua/lzio.c | 83 --- script/lua/lzio.h | 67 -- util/osdetect.lua | 111 ---- 59 files changed, 64 insertions(+), 17153 deletions(-) delete mode 100644 script/lua/grub_lib.c delete mode 100644 script/lua/grub_lib.h delete mode 100644 script/lua/grub_lua.h delete mode 100644 script/lua/grub_main.c delete mode 100644 script/lua/lapi.c delete mode 100644 script/lua/lapi.h delete mode 100644 script/lua/lauxlib.c delete mode 100644 script/lua/lauxlib.h delete mode 100644 script/lua/lbaselib.c delete mode 100644 script/lua/lcode.c delete mode 100644 script/lua/lcode.h delete mode 100644 script/lua/ldblib.c delete mode 100644 script/lua/ldebug.c delete mode 100644 script/lua/ldebug.h delete mode 100644 script/lua/ldo.c delete mode 100644 script/lua/ldo.h delete mode 100644 script/lua/ldump.c delete mode 100644 script/lua/lfunc.c delete mode 100644 script/lua/lfunc.h delete mode 100644 script/lua/lgc.c delete mode 100644 script/lua/lgc.h delete mode 100644 script/lua/linit.c delete mode 100644 script/lua/liolib.c delete mode 100644 script/lua/llex.c delete mode 100644 script/lua/llex.h delete mode 100644 script/lua/llimits.h delete mode 100644 script/lua/lmathlib.c delete mode 100644 script/lua/lmem.c delete mode 100644 script/lua/lmem.h delete mode 100644 script/lua/loadlib.c delete mode 100644 script/lua/lobject.c delete mode 100644 script/lua/lobject.h delete mode 100644 script/lua/lopcodes.c delete mode 100644 script/lua/lopcodes.h delete mode 100644 script/lua/loslib.c delete mode 100644 script/lua/lparser.c delete mode 100644 script/lua/lparser.h delete mode 100644 script/lua/lstate.c delete mode 100644 script/lua/lstate.h delete mode 100644 script/lua/lstring.c delete mode 100644 script/lua/lstring.h delete mode 100644 script/lua/lstrlib.c delete mode 100644 script/lua/ltable.c delete mode 100644 script/lua/ltable.h delete mode 100644 script/lua/ltablib.c delete mode 100644 script/lua/ltm.c delete mode 100644 script/lua/ltm.h delete mode 100644 script/lua/lua.h delete mode 100644 script/lua/luaconf.h delete mode 100644 script/lua/lualib.h delete mode 100644 script/lua/lundump.c delete mode 100644 script/lua/lundump.h delete mode 100644 script/lua/lvm.c delete mode 100644 script/lua/lvm.h delete mode 100644 script/lua/lzio.c delete mode 100644 script/lua/lzio.h delete mode 100644 util/osdetect.lua diff --git a/ChangeLog b/ChangeLog index fdca53d01..aca4ef788 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,66 @@ +2009-09-26 Robert Millan + + * conf/common.rmk (pkglib_MODULES): Remove `lua.mod'. + (lua_mod_SOURCES, lua_mod_CFLAGS, lua_mod_LDFLAGS): Remove. + + * util/osdetect.lua: Remove. + * script/lua/lauxlib.c: Likewise. + * script/lua/ldebug.c: Likewise. + * script/lua/grub_main.c: Likewise. + * script/lua/lauxlib.h: Likewise. + * script/lua/ldebug.h: Likewise. + * script/lua/ltablib.c: Likewise. + * script/lua/liolib.c: Likewise. + * script/lua/lstrlib.c: Likewise. + * script/lua/lualib.h: Likewise. + * script/lua/ldo.c: Likewise. + * script/lua/ldump.c: Likewise. + * script/lua/ldo.h: Likewise. + * script/lua/loslib.c: Likewise. + * script/lua/lundump.c: Likewise. + * script/lua/grub_lib.c: Likewise. + * script/lua/ldblib.c: Likewise. + * script/lua/lundump.h: Likewise. + * script/lua/lmem.c: Likewise. + * script/lua/grub_lib.h: Likewise. + * script/lua/lmathlib.c: Likewise. + * script/lua/lstate.c: Likewise. + * script/lua/ltm.c: Likewise. + * script/lua/lvm.c: Likewise. + * script/lua/lmem.h: Likewise. + * script/lua/lstate.h: Likewise. + * script/lua/ltm.h: Likewise. + * script/lua/ltable.c: Likewise. + * script/lua/lvm.h: Likewise. + * script/lua/llex.c: Likewise. + * script/lua/lgc.c: Likewise. + * script/lua/grub_lua.h: Likewise. + * script/lua/loadlib.c: Likewise. + * script/lua/lfunc.c: Likewise. + * script/lua/lopcodes.c: Likewise. + * script/lua/lparser.c: Likewise. + * script/lua/ltable.h: Likewise. + * script/lua/llex.h: Likewise. + * script/lua/lgc.h: Likewise. + * script/lua/lfunc.h: Likewise. + * script/lua/lbaselib.c: Likewise. + * script/lua/lopcodes.h: Likewise. + * script/lua/lparser.h: Likewise. + * script/lua/lzio.c: Likewise. + * script/lua/linit.c: Likewise. + * script/lua/lobject.c: Likewise. + * script/lua/llimits.h: Likewise. + * script/lua/lstring.c: Likewise. + * script/lua/lzio.h: Likewise. + * script/lua/lapi.c: Likewise. + * script/lua/lcode.c: Likewise. + * script/lua/lua.h: Likewise. + * script/lua/lobject.h: Likewise. + * script/lua/lstring.h: Likewise. + * script/lua/lapi.h: Likewise. + * script/lua/lcode.h: Likewise. + * script/lua/luaconf.h: Likewise. + 2009-09-26 Colin Watson * docs/grub.texi (Command-line and menu entry commands): Document diff --git a/conf/common.rmk b/conf/common.rmk index e18dd1052..26407d06b 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -367,7 +367,7 @@ pkglib_MODULES += minicmd.mod extcmd.mod hello.mod handler.mod \ fs_file.mod fs_uuid.mod configfile.mod echo.mod \ terminfo.mod test.mod blocklist.mod hexdump.mod \ read.mod sleep.mod loadenv.mod crc.mod parttool.mod \ - msdospart.mod memrw.mod normal.mod sh.mod lua.mod \ + msdospart.mod memrw.mod normal.mod sh.mod \ gptsync.mod true.mod probe.mod password.mod \ keystatus.mod @@ -536,23 +536,6 @@ sh_mod_SOURCES = script/sh/main.c script/sh/script.c script/sh/execute.c \ sh_mod_CFLAGS = $(COMMON_CFLAGS) sh_mod_LDFLAGS = $(COMMON_LDFLAGS) -# For lua.mod. -lua_mod_SOURCES = script/lua/lapi.c script/lua/lcode.c script/lua/ldebug.c \ - script/lua/ldo.c script/lua/ldump.c script/lua/lfunc.c \ - script/lua/lgc.c script/lua/llex.c script/lua/lmem.c \ - script/lua/lobject.c script/lua/lopcodes.c script/lua/lparser.c \ - script/lua/lstate.c script/lua/lstring.c script/lua/ltable.c \ - script/lua/ltm.c script/lua/lundump.c script/lua/lvm.c \ - script/lua/lzio.c script/lua/lauxlib.c script/lua/lbaselib.c \ - script/lua/linit.c script/lua/ltablib.c script/lua/lstrlib.c \ - script/lua/grub_main.c script/lua/grub_lib.c -lua_mod_CFLAGS = $(COMMON_CFLAGS) -lua_mod_LDFLAGS = $(COMMON_LDFLAGS) - -# Extra libraries for lua -# script/lua/lmathlib.c script/lua/loslib.c script/lua/liolib.c -# script/lua/ldblib.c script/lua/loadlib.c - # Common Video Subsystem specific modules. pkglib_MODULES += video.mod videotest.mod bitmap.mod tga.mod jpeg.mod \ png.mod font.mod gfxterm.mod video_fb.mod diff --git a/script/lua/grub_lib.c b/script/lua/grub_lib.c deleted file mode 100644 index d26f19337..000000000 --- a/script/lua/grub_lib.c +++ /dev/null @@ -1,438 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#include "grub_lib.h" - -#include -#include -#include -#include -#include -#include - -static int -save_errno (lua_State *state) -{ - int saved_errno; - - saved_errno = grub_errno; - grub_errno = 0; - - lua_pushinteger (state, saved_errno); - lua_setfield (state, LUA_GLOBALSINDEX, "grub_errno"); - - if (saved_errno) - lua_pushstring (state, grub_errmsg); - else - lua_pushnil (state); - - lua_setfield (state, LUA_GLOBALSINDEX, "grub_errmsg"); - - return saved_errno; -} - -static int -push_result (lua_State *state) -{ - lua_pushinteger (state, save_errno (state)); - return 1; -} - -static int -grub_lua_run (lua_State *state) -{ - int n; - char **args; - const char *s; - - s = luaL_checkstring (state, 1); - if ((! grub_parser_split_cmdline (s, 0, &n, &args)) - && (n >= 0)) - { - grub_command_t cmd; - - cmd = grub_command_find (args[0]); - if (cmd) - (cmd->func) (cmd, n, &args[1]); - else - grub_error (GRUB_ERR_FILE_NOT_FOUND, "command not found"); - - grub_free (args[0]); - grub_free (args); - } - - return push_result (state); -} - -static int -grub_lua_getenv (lua_State *state) -{ - int n, i; - - n = lua_gettop (state); - for (i = 1; i <= n; i++) - { - const char *name, *value; - - name = luaL_checkstring (state, i); - value = grub_env_get (name); - if (value) - lua_pushstring (state, value); - else - lua_pushnil (state); - } - - return n; -} - -static int -grub_lua_setenv (lua_State *state) -{ - const char *name, *value; - - name = luaL_checkstring (state, 1); - value = luaL_checkstring (state, 2); - - if (name[0]) - grub_env_set (name, value); - - return 0; -} - -static int -grub_lua_enum_device (lua_State *state) -{ - auto int enum_device (const char *name); - int enum_device (const char *name) - { - int result; - grub_device_t dev; - - result = 0; - dev = grub_device_open (name); - if (dev) - { - grub_fs_t fs; - - fs = grub_fs_probe (dev); - if (fs) - { - lua_pushvalue (state, 1); - lua_pushstring (state, name); - lua_pushstring (state, fs->name); - if (! fs->uuid) - lua_pushnil (state); - else - { - int err; - char *uuid; - - err = fs->uuid (dev, &uuid); - if (err) - { - grub_errno = 0; - lua_pushnil (state); - } - else - { - lua_pushstring (state, uuid); - grub_free (uuid); - } - } - - lua_call (state, 3, 1); - result = lua_tointeger (state, -1); - lua_pop (state, 1); - } - else - grub_errno = 0; - grub_device_close (dev); - } - else - grub_errno = 0; - - return result; - } - - luaL_checktype (state, 1, LUA_TFUNCTION); - grub_device_iterate (enum_device); - return push_result (state); -} - -static int -grub_lua_enum_file (lua_State *state) -{ - char *device_name; - const char *arg; - grub_device_t dev; - - auto int enum_file (const char *name, const struct grub_dirhook_info *info); - int enum_file (const char *name, const struct grub_dirhook_info *info) - { - int result; - - lua_pushvalue (state, 1); - lua_pushstring (state, name); - lua_pushinteger (state, info->dir != 0); - lua_call (state, 2, 1); - result = lua_tointeger (state, -1); - lua_pop (state, 1); - - return result; - } - - luaL_checktype (state, 1, LUA_TFUNCTION); - arg = luaL_checkstring (state, 2); - device_name = grub_file_get_device_name (arg); - dev = grub_device_open (device_name); - if (dev) - { - grub_fs_t fs; - const char *path; - - fs = grub_fs_probe (dev); - path = grub_strchr (arg, ')'); - if (! path) - path = arg; - else - path++; - - if (fs) - { - (fs->dir) (dev, path, enum_file); - } - - grub_device_close (dev); - } - - grub_free (device_name); - - return push_result (state); -} - -static int -grub_lua_file_open (lua_State *state) -{ - grub_file_t file; - const char *name; - - name = luaL_checkstring (state, 1); - file = grub_file_open (name); - save_errno (state); - - if (! file) - return 0; - - lua_pushlightuserdata (state, file); - return 1; -} - -static int -grub_lua_file_close (lua_State *state) -{ - grub_file_t file; - - luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); - file = lua_touserdata (state, 1); - grub_file_close (file); - - return push_result (state); -} - -static int -grub_lua_file_seek (lua_State *state) -{ - grub_file_t file; - grub_off_t offset; - - luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); - file = lua_touserdata (state, 1); - offset = luaL_checkinteger (state, 2); - - offset = grub_file_seek (file, offset); - save_errno (state); - - lua_pushinteger (state, offset); - return 1; -} - -static int -grub_lua_file_read (lua_State *state) -{ - grub_file_t file; - luaL_Buffer b; - int n; - - luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); - file = lua_touserdata (state, 1); - n = luaL_checkinteger (state, 2); - - luaL_buffinit (state, &b); - while (n) - { - char *p; - int nr; - - nr = (n > LUAL_BUFFERSIZE) ? LUAL_BUFFERSIZE : n; - p = luaL_prepbuffer (&b); - - nr = grub_file_read (file, p, nr); - if (nr <= 0) - break; - - luaL_addsize (&b, nr); - n -= nr; - } - - save_errno (state); - luaL_pushresult (&b); - return 1; -} - -static int -grub_lua_file_getline (lua_State *state) -{ - grub_file_t file; - char *line; - - luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); - file = lua_touserdata (state, 1); - - line = grub_file_getline (file); - save_errno (state); - - if (! line) - return 0; - - lua_pushstring (state, line); - grub_free (line); - return 1; -} - -static int -grub_lua_file_getsize (lua_State *state) -{ - grub_file_t file; - - luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); - file = lua_touserdata (state, 1); - - lua_pushinteger (state, file->size); - return 1; -} - -static int -grub_lua_file_getpos (lua_State *state) -{ - grub_file_t file; - - luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); - file = lua_touserdata (state, 1); - - lua_pushinteger (state, file->offset); - return 1; -} - -static int -grub_lua_file_eof (lua_State *state) -{ - grub_file_t file; - - luaL_checktype (state, 1, LUA_TLIGHTUSERDATA); - file = lua_touserdata (state, 1); - - lua_pushboolean (state, file->offset >= file->size); - return 1; -} - -static int -grub_lua_file_exist (lua_State *state) -{ - grub_file_t file; - const char *name; - int result; - - result = 0; - name = luaL_checkstring (state, 1); - file = grub_file_open (name); - if (file) - { - result++; - grub_file_close (file); - } - else - grub_errno = 0; - - lua_pushboolean (state, result); - return 1; -} - -static int -grub_lua_add_menu (lua_State *state) -{ - int n; - const char *source; - - source = luaL_checklstring (state, 1, 0); - n = lua_gettop (state) - 1; - if (n > 0) - { - const char *args[sizeof (char *) * n]; - char *p; - int i; - - for (i = 0; i < n; i++) - args[i] = luaL_checkstring (state, 2 + i); - - p = grub_strdup (source); - if (! p) - return push_result (state); - - grub_normal_add_menu_entry (n, args, p); - } - else - { - lua_pushstring (state, "not enough parameter"); - lua_error (state); - } - - return push_result (state); -} - -luaL_Reg grub_lua_lib[] = - { - {"run", grub_lua_run}, - {"getenv", grub_lua_getenv}, - {"setenv", grub_lua_setenv}, - {"enum_device", grub_lua_enum_device}, - {"enum_file", grub_lua_enum_file}, - {"file_open", grub_lua_file_open}, - {"file_close", grub_lua_file_close}, - {"file_seek", grub_lua_file_seek}, - {"file_read", grub_lua_file_read}, - {"file_getline", grub_lua_file_getline}, - {"file_getsize", grub_lua_file_getsize}, - {"file_getpos", grub_lua_file_getpos}, - {"file_eof", grub_lua_file_eof}, - {"file_exist", grub_lua_file_exist}, - {"add_menu", grub_lua_add_menu}, - {0, 0} - }; diff --git a/script/lua/grub_lib.h b/script/lua/grub_lib.h deleted file mode 100644 index 2253a4145..000000000 --- a/script/lua/grub_lib.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_LUA_LIB_HEADER -#define GRUB_LUA_LIB_HEADER 1 - -extern luaL_Reg grub_lua_lib[]; - -#endif diff --git a/script/lua/grub_lua.h b/script/lua/grub_lua.h deleted file mode 100644 index 78e6546c7..000000000 --- a/script/lua/grub_lua.h +++ /dev/null @@ -1,114 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#ifndef GRUB_LUA_HEADER -#define GRUB_LUA_HEADER 1 - -#include -#include -#include -#include -#include - -#define INT_MAX GRUB_LONG_MAX -#define UCHAR_MAX 255 -#define SHRT_MAX 32767 - -#undef UNUSED -#define UNUSED (void) - -#define memcpy grub_memcpy -#define memcmp grub_memcmp -#define strcpy grub_strcpy -#define strstr grub_strstr -#define strchr grub_strchr -#define strlen grub_strlen -#define strtoul grub_strtoul -#define strtod(s,e) grub_strtoul(s,e,0) -#define sprintf grub_sprintf -#define strncpy grub_strncpy -#define strcat grub_strcat -#define strncat grub_strncat -#define strcoll grub_strcmp -#define strcmp grub_strcmp -#define tolower grub_tolower -#define toupper grub_toupper - -#define malloc grub_malloc -#define realloc grub_realloc -#define free grub_free - -#define exit(a) grub_exit() -#define jmp_buf grub_jmp_buf -#define setjmp grub_setjmp -#define longjmp grub_longjmp - -#define fputs(s,f) grub_printf("%s", s) - -#define isdigit grub_isdigit -#define isalpha grub_isalpha -#define isspace grub_isspace - -static inline int -isalnum (int c) -{ - return (isalpha (c) || isdigit (c)); -} - -static inline int -iscntrl (int c) -{ - return ((c <= 0x1f) || (c == 0x7f)); -} - -static inline int -isupper (int c) -{ - return ((c >= 'A') && (c <= 'Z')); -} - -static inline int -islower (int c) -{ - return ((c >= 'a') && (c <= 'z')); -} - -static inline int -ispunct (int c) -{ - return ((! isspace (c)) && (! isalnum (c))); -} - -static inline int -isxdigit (int c) -{ - return (isdigit (c) || ((c >= 'a') && (c <= 'f')) || - ((c >= 'A') && (c <= 'F'))); -} - -static inline int -abs (int c) -{ - return (c >= 0) ? : -c; -} - -int strcspn (const char *s1, const char *s2); -char *strpbrk (const char *s1, const char *s2); -void *memchr (const void *s, int c, size_t n); - -#endif diff --git a/script/lua/grub_main.c b/script/lua/grub_main.c deleted file mode 100644 index b39141f75..000000000 --- a/script/lua/grub_main.c +++ /dev/null @@ -1,209 +0,0 @@ -/* - * GRUB -- GRand Unified Bootloader - * Copyright (C) 2009 Free Software Foundation, Inc. - * - * GRUB is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * GRUB is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with GRUB. If not, see . - */ - -#include "lua.h" -#include "lauxlib.h" -#include "lualib.h" -#include "grub_lib.h" - -#include -#include - -static const char * -scan_str (const char *s1, const char *s2) -{ - while (*s1) - { - const char *p = s2; - - while (*p) - { - if (*s1 == *p) - return s1; - p++; - } - - s1++; - } - - return s1; -} - -int -strcspn (const char *s1, const char *s2) -{ - const char *r; - - r = scan_str (s1, s2); - return r - s1; -} - -char * -strpbrk (const char *s1, const char *s2) -{ - const char *r; - - r = scan_str (s1, s2); - return (*r) ? (char *) r : 0; -} - -void * -memchr (const void *s, int c, size_t n) -{ - const unsigned char *p = s; - - while (n) - { - if (*p == c) - return (void *) p; - - n--; - p++; - } - - return 0; -} - -static lua_State *state; - -/* Call `grub_error' to report a Lua error. The error message string must be - on the top of the Lua stack (at index -1). The error message is popped off - the Lua stack before this function returns. */ -static void -handle_lua_error (const char *error_type) -{ - const char *error_msg; - error_msg = lua_tostring (state, -1); - if (error_msg == NULL) - error_msg = "(error message not a string)"; - grub_error (GRUB_ERR_BAD_ARGUMENT, "%s: %s", error_type, error_msg); - /* Pop the error message. */ - lua_pop (state, 1); -} - -static grub_err_t -grub_lua_parse_line (char *line, grub_reader_getline_t getline) -{ - int r; - char *old_line = 0; - - lua_settop(state, 0); - while (1) - { - r = luaL_loadbuffer (state, line, grub_strlen (line), "=grub"); - if (! r) - { - /* No error: Execute the statement. */ - r = lua_pcall (state, 0, 0, 0); - if (r) - { - handle_lua_error ("Lua"); - break; - } - else - { - grub_free (old_line); - return grub_errno; - } - } - - if (r == LUA_ERRSYNTAX) - { - /* Check whether the syntax error is a result of an incomplete - statement. If it is, then try to complete the statement by - reading more lines. */ - size_t lmsg; - const char *msg = lua_tolstring (state, -1, &lmsg); - const char *tp = msg + lmsg - (sizeof (LUA_QL ("")) - 1); - if (grub_strstr (msg, LUA_QL ("")) == tp) - { - char *n, *t; - int len; - - /* Discard the error message. */ - lua_pop (state, 1); - /* Try to read another line to complete the statement. */ - if ((getline (&n, 1)) || (! n)) - { - grub_error (GRUB_ERR_BAD_ARGUMENT, "incomplete command"); - break; - } - - /* More input was available: Add it to the current statement - contents. */ - len = grub_strlen (line); - t = grub_malloc (len + grub_strlen (n) + 2); - if (! t) - break; - - grub_strcpy (t, line); - t[len] = '\n'; - grub_strcpy (t + len + 1, n); - grub_free (old_line); - line = old_line = t; - /* Try again to execute the statement now that more input has - been appended. */ - continue; - } - /* The syntax error was not the result of an incomplete line. */ - handle_lua_error ("Lua syntax error"); - } - else - { - /* Handle errors other than syntax errors (out of memory, etc.). */ - handle_lua_error ("Lua parser failed"); - } - - break; - } - - grub_free (old_line); - lua_gc (state, LUA_GCCOLLECT, 0); - - return grub_errno; -} - -static struct grub_parser grub_lua_parser = - { - .name = "lua", - .parse_line = grub_lua_parse_line - }; - -GRUB_MOD_INIT(lua) -{ - (void) mod; - - state = lua_open (); - if (state) - { - lua_gc (state, LUA_GCSTOP, 0); - luaL_openlibs (state); - luaL_register (state, "grub", grub_lua_lib); - lua_gc (state, LUA_GCRESTART, 0); - grub_parser_register ("lua", &grub_lua_parser); - } -} - -GRUB_MOD_FINI(lua) -{ - if (state) - { - grub_parser_unregister (&grub_lua_parser); - lua_close (state); - } -} diff --git a/script/lua/lapi.c b/script/lua/lapi.c deleted file mode 100644 index 2eaf45c66..000000000 --- a/script/lua/lapi.c +++ /dev/null @@ -1,1088 +0,0 @@ -/* -** $Id: lapi.c,v 2.55.1.5 2008/07/04 18:41:18 roberto Exp $ -** Lua API -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#include -#endif - -#define lapi_c -#define LUA_CORE - -#include "lua.h" - -#include "lapi.h" -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lgc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" -#include "lundump.h" -#include "lvm.h" - - - -const char lua_ident[] = - "$Lua: " LUA_RELEASE " " LUA_COPYRIGHT " $\n" - "$Authors: " LUA_AUTHORS " $\n" - "$URL: www.lua.org $\n"; - - - -#define api_checknelems(L, n) api_check(L, (n) <= (L->top - L->base)) - -#define api_checkvalidindex(L, i) api_check(L, (i) != luaO_nilobject) - -#define api_incr_top(L) {api_check(L, L->top < L->ci->top); L->top++;} - - - -static TValue *index2adr (lua_State *L, int idx) { - if (idx > 0) { - TValue *o = L->base + (idx - 1); - api_check(L, idx <= L->ci->top - L->base); - if (o >= L->top) return cast(TValue *, luaO_nilobject); - else return o; - } - else if (idx > LUA_REGISTRYINDEX) { - api_check(L, idx != 0 && -idx <= L->top - L->base); - return L->top + idx; - } - else switch (idx) { /* pseudo-indices */ - case LUA_REGISTRYINDEX: return registry(L); - case LUA_ENVIRONINDEX: { - Closure *func = curr_func(L); - sethvalue(L, &L->env, func->c.env); - return &L->env; - } - case LUA_GLOBALSINDEX: return gt(L); - default: { - Closure *func = curr_func(L); - idx = LUA_GLOBALSINDEX - idx; - return (idx <= func->c.nupvalues) - ? &func->c.upvalue[idx-1] - : cast(TValue *, luaO_nilobject); - } - } -} - - -static Table *getcurrenv (lua_State *L) { - if (L->ci == L->base_ci) /* no enclosing function? */ - return hvalue(gt(L)); /* use global table as environment */ - else { - Closure *func = curr_func(L); - return func->c.env; - } -} - - -void luaA_pushobject (lua_State *L, const TValue *o) { - setobj2s(L, L->top, o); - api_incr_top(L); -} - - -LUA_API int lua_checkstack (lua_State *L, int size) { - int res = 1; - lua_lock(L); - if (size > LUAI_MAXCSTACK || (L->top - L->base + size) > LUAI_MAXCSTACK) - res = 0; /* stack overflow */ - else if (size > 0) { - luaD_checkstack(L, size); - if (L->ci->top < L->top + size) - L->ci->top = L->top + size; - } - lua_unlock(L); - return res; -} - - -LUA_API void lua_xmove (lua_State *from, lua_State *to, int n) { - int i; - if (from == to) return; - lua_lock(to); - api_checknelems(from, n); - api_check(from, G(from) == G(to)); - api_check(from, to->ci->top - to->top >= n); - from->top -= n; - for (i = 0; i < n; i++) { - setobj2s(to, to->top++, from->top + i); - } - lua_unlock(to); -} - - -LUA_API void lua_setlevel (lua_State *from, lua_State *to) { - to->nCcalls = from->nCcalls; -} - - -LUA_API lua_CFunction lua_atpanic (lua_State *L, lua_CFunction panicf) { - lua_CFunction old; - lua_lock(L); - old = G(L)->panic; - G(L)->panic = panicf; - lua_unlock(L); - return old; -} - - -LUA_API lua_State *lua_newthread (lua_State *L) { - lua_State *L1; - lua_lock(L); - luaC_checkGC(L); - L1 = luaE_newthread(L); - setthvalue(L, L->top, L1); - api_incr_top(L); - lua_unlock(L); - luai_userstatethread(L, L1); - return L1; -} - - - -/* -** basic stack manipulation -*/ - - -LUA_API int lua_gettop (lua_State *L) { - return cast_int(L->top - L->base); -} - - -LUA_API void lua_settop (lua_State *L, int idx) { - lua_lock(L); - if (idx >= 0) { - api_check(L, idx <= L->stack_last - L->base); - while (L->top < L->base + idx) - setnilvalue(L->top++); - L->top = L->base + idx; - } - else { - api_check(L, -(idx+1) <= (L->top - L->base)); - L->top += idx+1; /* `subtract' index (index is negative) */ - } - lua_unlock(L); -} - - -LUA_API void lua_remove (lua_State *L, int idx) { - StkId p; - lua_lock(L); - p = index2adr(L, idx); - api_checkvalidindex(L, p); - while (++p < L->top) setobjs2s(L, p-1, p); - L->top--; - lua_unlock(L); -} - - -LUA_API void lua_insert (lua_State *L, int idx) { - StkId p; - StkId q; - lua_lock(L); - p = index2adr(L, idx); - api_checkvalidindex(L, p); - for (q = L->top; q>p; q--) setobjs2s(L, q, q-1); - setobjs2s(L, p, L->top); - lua_unlock(L); -} - - -LUA_API void lua_replace (lua_State *L, int idx) { - StkId o; - lua_lock(L); - /* explicit test for incompatible code */ - if (idx == LUA_ENVIRONINDEX && L->ci == L->base_ci) - luaG_runerror(L, "no calling environment"); - api_checknelems(L, 1); - o = index2adr(L, idx); - api_checkvalidindex(L, o); - if (idx == LUA_ENVIRONINDEX) { - Closure *func = curr_func(L); - api_check(L, ttistable(L->top - 1)); - func->c.env = hvalue(L->top - 1); - luaC_barrier(L, func, L->top - 1); - } - else { - setobj(L, o, L->top - 1); - if (idx < LUA_GLOBALSINDEX) /* function upvalue? */ - luaC_barrier(L, curr_func(L), L->top - 1); - } - L->top--; - lua_unlock(L); -} - - -LUA_API void lua_pushvalue (lua_State *L, int idx) { - lua_lock(L); - setobj2s(L, L->top, index2adr(L, idx)); - api_incr_top(L); - lua_unlock(L); -} - - - -/* -** access functions (stack -> C) -*/ - - -LUA_API int lua_type (lua_State *L, int idx) { - StkId o = index2adr(L, idx); - return (o == luaO_nilobject) ? LUA_TNONE : ttype(o); -} - - -LUA_API const char *lua_typename (lua_State *L, int t) { - UNUSED(L); - return (t == LUA_TNONE) ? "no value" : luaT_typenames[t]; -} - - -LUA_API int lua_iscfunction (lua_State *L, int idx) { - StkId o = index2adr(L, idx); - return iscfunction(o); -} - - -LUA_API int lua_isnumber (lua_State *L, int idx) { - TValue n; - const TValue *o = index2adr(L, idx); - return tonumber(o, &n); -} - - -LUA_API int lua_isstring (lua_State *L, int idx) { - int t = lua_type(L, idx); - return (t == LUA_TSTRING || t == LUA_TNUMBER); -} - - -LUA_API int lua_isuserdata (lua_State *L, int idx) { - const TValue *o = index2adr(L, idx); - return (ttisuserdata(o) || ttislightuserdata(o)); -} - - -LUA_API int lua_rawequal (lua_State *L, int index1, int index2) { - StkId o1 = index2adr(L, index1); - StkId o2 = index2adr(L, index2); - return (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 - : luaO_rawequalObj(o1, o2); -} - - -LUA_API int lua_equal (lua_State *L, int index1, int index2) { - StkId o1, o2; - int i; - lua_lock(L); /* may call tag method */ - o1 = index2adr(L, index1); - o2 = index2adr(L, index2); - i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 : equalobj(L, o1, o2); - lua_unlock(L); - return i; -} - - -LUA_API int lua_lessthan (lua_State *L, int index1, int index2) { - StkId o1, o2; - int i; - lua_lock(L); /* may call tag method */ - o1 = index2adr(L, index1); - o2 = index2adr(L, index2); - i = (o1 == luaO_nilobject || o2 == luaO_nilobject) ? 0 - : luaV_lessthan(L, o1, o2); - lua_unlock(L); - return i; -} - - - -LUA_API lua_Number lua_tonumber (lua_State *L, int idx) { - TValue n; - const TValue *o = index2adr(L, idx); - if (tonumber(o, &n)) - return nvalue(o); - else - return 0; -} - - -LUA_API lua_Integer lua_tointeger (lua_State *L, int idx) { - TValue n; - const TValue *o = index2adr(L, idx); - if (tonumber(o, &n)) { - lua_Integer res; - lua_Number num = nvalue(o); - lua_number2integer(res, num); - return res; - } - else - return 0; -} - - -LUA_API int lua_toboolean (lua_State *L, int idx) { - const TValue *o = index2adr(L, idx); - return !l_isfalse(o); -} - - -LUA_API const char *lua_tolstring (lua_State *L, int idx, size_t *len) { - StkId o = index2adr(L, idx); - if (!ttisstring(o)) { - lua_lock(L); /* `luaV_tostring' may create a new string */ - if (!luaV_tostring(L, o)) { /* conversion failed? */ - if (len != NULL) *len = 0; - lua_unlock(L); - return NULL; - } - luaC_checkGC(L); - o = index2adr(L, idx); /* previous call may reallocate the stack */ - lua_unlock(L); - } - if (len != NULL) *len = tsvalue(o)->len; - return svalue(o); -} - - -LUA_API size_t lua_objlen (lua_State *L, int idx) { - StkId o = index2adr(L, idx); - switch (ttype(o)) { - case LUA_TSTRING: return tsvalue(o)->len; - case LUA_TUSERDATA: return uvalue(o)->len; - case LUA_TTABLE: return luaH_getn(hvalue(o)); - case LUA_TNUMBER: { - size_t l; - lua_lock(L); /* `luaV_tostring' may create a new string */ - l = (luaV_tostring(L, o) ? tsvalue(o)->len : 0); - lua_unlock(L); - return l; - } - default: return 0; - } -} - - -LUA_API lua_CFunction lua_tocfunction (lua_State *L, int idx) { - StkId o = index2adr(L, idx); - return (!iscfunction(o)) ? NULL : clvalue(o)->c.f; -} - - -LUA_API void *lua_touserdata (lua_State *L, int idx) { - StkId o = index2adr(L, idx); - switch (ttype(o)) { - case LUA_TUSERDATA: return (rawuvalue(o) + 1); - case LUA_TLIGHTUSERDATA: return pvalue(o); - default: return NULL; - } -} - - -LUA_API lua_State *lua_tothread (lua_State *L, int idx) { - StkId o = index2adr(L, idx); - return (!ttisthread(o)) ? NULL : thvalue(o); -} - - -LUA_API const void *lua_topointer (lua_State *L, int idx) { - StkId o = index2adr(L, idx); - switch (ttype(o)) { - case LUA_TTABLE: return hvalue(o); - case LUA_TFUNCTION: return clvalue(o); - case LUA_TTHREAD: return thvalue(o); - case LUA_TUSERDATA: - case LUA_TLIGHTUSERDATA: - return lua_touserdata(L, idx); - default: return NULL; - } -} - - - -/* -** push functions (C -> stack) -*/ - - -LUA_API void lua_pushnil (lua_State *L) { - lua_lock(L); - setnilvalue(L->top); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_pushnumber (lua_State *L, lua_Number n) { - lua_lock(L); - setnvalue(L->top, n); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_pushinteger (lua_State *L, lua_Integer n) { - lua_lock(L); - setnvalue(L->top, cast_num(n)); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) { - lua_lock(L); - luaC_checkGC(L); - setsvalue2s(L, L->top, luaS_newlstr(L, s, len)); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_pushstring (lua_State *L, const char *s) { - if (s == NULL) - lua_pushnil(L); - else - lua_pushlstring(L, s, strlen(s)); -} - - -LUA_API const char *lua_pushvfstring (lua_State *L, const char *fmt, - va_list argp) { - const char *ret; - lua_lock(L); - luaC_checkGC(L); - ret = luaO_pushvfstring(L, fmt, argp); - lua_unlock(L); - return ret; -} - - -LUA_API const char *lua_pushfstring (lua_State *L, const char *fmt, ...) { - const char *ret; - va_list argp; - lua_lock(L); - luaC_checkGC(L); - va_start(argp, fmt); - ret = luaO_pushvfstring(L, fmt, argp); - va_end(argp); - lua_unlock(L); - return ret; -} - - -LUA_API void lua_pushcclosure (lua_State *L, lua_CFunction fn, int n) { - Closure *cl; - lua_lock(L); - luaC_checkGC(L); - api_checknelems(L, n); - cl = luaF_newCclosure(L, n, getcurrenv(L)); - cl->c.f = fn; - L->top -= n; - while (n--) - setobj2n(L, &cl->c.upvalue[n], L->top+n); - setclvalue(L, L->top, cl); - lua_assert(iswhite(obj2gco(cl))); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_pushboolean (lua_State *L, int b) { - lua_lock(L); - setbvalue(L->top, (b != 0)); /* ensure that true is 1 */ - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_pushlightuserdata (lua_State *L, void *p) { - lua_lock(L); - setpvalue(L->top, p); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API int lua_pushthread (lua_State *L) { - lua_lock(L); - setthvalue(L, L->top, L); - api_incr_top(L); - lua_unlock(L); - return (G(L)->mainthread == L); -} - - - -/* -** get functions (Lua -> stack) -*/ - - -LUA_API void lua_gettable (lua_State *L, int idx) { - StkId t; - lua_lock(L); - t = index2adr(L, idx); - api_checkvalidindex(L, t); - luaV_gettable(L, t, L->top - 1, L->top - 1); - lua_unlock(L); -} - - -LUA_API void lua_getfield (lua_State *L, int idx, const char *k) { - StkId t; - TValue key; - lua_lock(L); - t = index2adr(L, idx); - api_checkvalidindex(L, t); - setsvalue(L, &key, luaS_new(L, k)); - luaV_gettable(L, t, &key, L->top); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_rawget (lua_State *L, int idx) { - StkId t; - lua_lock(L); - t = index2adr(L, idx); - api_check(L, ttistable(t)); - setobj2s(L, L->top - 1, luaH_get(hvalue(t), L->top - 1)); - lua_unlock(L); -} - - -LUA_API void lua_rawgeti (lua_State *L, int idx, int n) { - StkId o; - lua_lock(L); - o = index2adr(L, idx); - api_check(L, ttistable(o)); - setobj2s(L, L->top, luaH_getnum(hvalue(o), n)); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API void lua_createtable (lua_State *L, int narray, int nrec) { - lua_lock(L); - luaC_checkGC(L); - sethvalue(L, L->top, luaH_new(L, narray, nrec)); - api_incr_top(L); - lua_unlock(L); -} - - -LUA_API int lua_getmetatable (lua_State *L, int objindex) { - const TValue *obj; - Table *mt = NULL; - int res; - lua_lock(L); - obj = index2adr(L, objindex); - switch (ttype(obj)) { - case LUA_TTABLE: - mt = hvalue(obj)->metatable; - break; - case LUA_TUSERDATA: - mt = uvalue(obj)->metatable; - break; - default: - mt = G(L)->mt[ttype(obj)]; - break; - } - if (mt == NULL) - res = 0; - else { - sethvalue(L, L->top, mt); - api_incr_top(L); - res = 1; - } - lua_unlock(L); - return res; -} - - -LUA_API void lua_getfenv (lua_State *L, int idx) { - StkId o; - lua_lock(L); - o = index2adr(L, idx); - api_checkvalidindex(L, o); - switch (ttype(o)) { - case LUA_TFUNCTION: - sethvalue(L, L->top, clvalue(o)->c.env); - break; - case LUA_TUSERDATA: - sethvalue(L, L->top, uvalue(o)->env); - break; - case LUA_TTHREAD: - setobj2s(L, L->top, gt(thvalue(o))); - break; - default: - setnilvalue(L->top); - break; - } - api_incr_top(L); - lua_unlock(L); -} - - -/* -** set functions (stack -> Lua) -*/ - - -LUA_API void lua_settable (lua_State *L, int idx) { - StkId t; - lua_lock(L); - api_checknelems(L, 2); - t = index2adr(L, idx); - api_checkvalidindex(L, t); - luaV_settable(L, t, L->top - 2, L->top - 1); - L->top -= 2; /* pop index and value */ - lua_unlock(L); -} - - -LUA_API void lua_setfield (lua_State *L, int idx, const char *k) { - StkId t; - TValue key; - lua_lock(L); - api_checknelems(L, 1); - t = index2adr(L, idx); - api_checkvalidindex(L, t); - setsvalue(L, &key, luaS_new(L, k)); - luaV_settable(L, t, &key, L->top - 1); - L->top--; /* pop value */ - lua_unlock(L); -} - - -LUA_API void lua_rawset (lua_State *L, int idx) { - StkId t; - lua_lock(L); - api_checknelems(L, 2); - t = index2adr(L, idx); - api_check(L, ttistable(t)); - setobj2t(L, luaH_set(L, hvalue(t), L->top-2), L->top-1); - luaC_barriert(L, hvalue(t), L->top-1); - L->top -= 2; - lua_unlock(L); -} - - -LUA_API void lua_rawseti (lua_State *L, int idx, int n) { - StkId o; - lua_lock(L); - api_checknelems(L, 1); - o = index2adr(L, idx); - api_check(L, ttistable(o)); - setobj2t(L, luaH_setnum(L, hvalue(o), n), L->top-1); - luaC_barriert(L, hvalue(o), L->top-1); - L->top--; - lua_unlock(L); -} - - -LUA_API int lua_setmetatable (lua_State *L, int objindex) { - TValue *obj; - Table *mt; - lua_lock(L); - api_checknelems(L, 1); - obj = index2adr(L, objindex); - api_checkvalidindex(L, obj); - if (ttisnil(L->top - 1)) - mt = NULL; - else { - api_check(L, ttistable(L->top - 1)); - mt = hvalue(L->top - 1); - } - switch (ttype(obj)) { - case LUA_TTABLE: { - hvalue(obj)->metatable = mt; - if (mt) - luaC_objbarriert(L, hvalue(obj), mt); - break; - } - case LUA_TUSERDATA: { - uvalue(obj)->metatable = mt; - if (mt) - luaC_objbarrier(L, rawuvalue(obj), mt); - break; - } - default: { - G(L)->mt[ttype(obj)] = mt; - break; - } - } - L->top--; - lua_unlock(L); - return 1; -} - - -LUA_API int lua_setfenv (lua_State *L, int idx) { - StkId o; - int res = 1; - lua_lock(L); - api_checknelems(L, 1); - o = index2adr(L, idx); - api_checkvalidindex(L, o); - api_check(L, ttistable(L->top - 1)); - switch (ttype(o)) { - case LUA_TFUNCTION: - clvalue(o)->c.env = hvalue(L->top - 1); - break; - case LUA_TUSERDATA: - uvalue(o)->env = hvalue(L->top - 1); - break; - case LUA_TTHREAD: - sethvalue(L, gt(thvalue(o)), hvalue(L->top - 1)); - break; - default: - res = 0; - break; - } - if (res) luaC_objbarrier(L, gcvalue(o), hvalue(L->top - 1)); - L->top--; - lua_unlock(L); - return res; -} - - -/* -** `load' and `call' functions (run Lua code) -*/ - - -#define adjustresults(L,nres) \ - { if (nres == LUA_MULTRET && L->top >= L->ci->top) L->ci->top = L->top; } - - -#define checkresults(L,na,nr) \ - api_check(L, (nr) == LUA_MULTRET || (L->ci->top - L->top >= (nr) - (na))) - - -LUA_API void lua_call (lua_State *L, int nargs, int nresults) { - StkId func; - lua_lock(L); - api_checknelems(L, nargs+1); - checkresults(L, nargs, nresults); - func = L->top - (nargs+1); - luaD_call(L, func, nresults); - adjustresults(L, nresults); - lua_unlock(L); -} - - - -/* -** Execute a protected call. -*/ -struct CallS { /* data to `f_call' */ - StkId func; - int nresults; -}; - - -static void f_call (lua_State *L, void *ud) { - struct CallS *c = cast(struct CallS *, ud); - luaD_call(L, c->func, c->nresults); -} - - - -LUA_API int lua_pcall (lua_State *L, int nargs, int nresults, int errfunc) { - struct CallS c; - int status; - ptrdiff_t func; - lua_lock(L); - api_checknelems(L, nargs+1); - checkresults(L, nargs, nresults); - if (errfunc == 0) - func = 0; - else { - StkId o = index2adr(L, errfunc); - api_checkvalidindex(L, o); - func = savestack(L, o); - } - c.func = L->top - (nargs+1); /* function to be called */ - c.nresults = nresults; - status = luaD_pcall(L, f_call, &c, savestack(L, c.func), func); - adjustresults(L, nresults); - lua_unlock(L); - return status; -} - - -/* -** Execute a protected C call. -*/ -struct CCallS { /* data to `f_Ccall' */ - lua_CFunction func; - void *ud; -}; - - -static void f_Ccall (lua_State *L, void *ud) { - struct CCallS *c = cast(struct CCallS *, ud); - Closure *cl; - cl = luaF_newCclosure(L, 0, getcurrenv(L)); - cl->c.f = c->func; - setclvalue(L, L->top, cl); /* push function */ - api_incr_top(L); - setpvalue(L->top, c->ud); /* push only argument */ - api_incr_top(L); - luaD_call(L, L->top - 2, 0); -} - - -LUA_API int lua_cpcall (lua_State *L, lua_CFunction func, void *ud) { - struct CCallS c; - int status; - lua_lock(L); - c.func = func; - c.ud = ud; - status = luaD_pcall(L, f_Ccall, &c, savestack(L, L->top), 0); - lua_unlock(L); - return status; -} - - -LUA_API int lua_load (lua_State *L, lua_Reader reader, void *data, - const char *chunkname) { - ZIO z; - int status; - lua_lock(L); - if (!chunkname) chunkname = "?"; - luaZ_init(L, &z, reader, data); - status = luaD_protectedparser(L, &z, chunkname); - lua_unlock(L); - return status; -} - - -LUA_API int lua_dump (lua_State *L, lua_Writer writer, void *data) { - int status; - TValue *o; - lua_lock(L); - api_checknelems(L, 1); - o = L->top - 1; - if (isLfunction(o)) - status = luaU_dump(L, clvalue(o)->l.p, writer, data, 0); - else - status = 1; - lua_unlock(L); - return status; -} - - -LUA_API int lua_status (lua_State *L) { - return L->status; -} - - -/* -** Garbage-collection function -*/ - -LUA_API int lua_gc (lua_State *L, int what, int data) { - int res = 0; - global_State *g; - lua_lock(L); - g = G(L); - switch (what) { - case LUA_GCSTOP: { - g->GCthreshold = MAX_LUMEM; - break; - } - case LUA_GCRESTART: { - g->GCthreshold = g->totalbytes; - break; - } - case LUA_GCCOLLECT: { - luaC_fullgc(L); - break; - } - case LUA_GCCOUNT: { - /* GC values are expressed in Kbytes: #bytes/2^10 */ - res = cast_int(g->totalbytes >> 10); - break; - } - case LUA_GCCOUNTB: { - res = cast_int(g->totalbytes & 0x3ff); - break; - } - case LUA_GCSTEP: { - lu_mem a = (cast(lu_mem, data) << 10); - if (a <= g->totalbytes) - g->GCthreshold = g->totalbytes - a; - else - g->GCthreshold = 0; - while (g->GCthreshold <= g->totalbytes) { - luaC_step(L); - if (g->gcstate == GCSpause) { /* end of cycle? */ - res = 1; /* signal it */ - break; - } - } - break; - } - case LUA_GCSETPAUSE: { - res = g->gcpause; - g->gcpause = data; - break; - } - case LUA_GCSETSTEPMUL: { - res = g->gcstepmul; - g->gcstepmul = data; - break; - } - default: res = -1; /* invalid option */ - } - lua_unlock(L); - return res; -} - - - -/* -** miscellaneous functions -*/ - - -LUA_API int lua_error (lua_State *L) { - lua_lock(L); - api_checknelems(L, 1); - luaG_errormsg(L); - lua_unlock(L); - return 0; /* to avoid warnings */ -} - - -LUA_API int lua_next (lua_State *L, int idx) { - StkId t; - int more; - lua_lock(L); - t = index2adr(L, idx); - api_check(L, ttistable(t)); - more = luaH_next(L, hvalue(t), L->top - 1); - if (more) { - api_incr_top(L); - } - else /* no more elements */ - L->top -= 1; /* remove key */ - lua_unlock(L); - return more; -} - - -LUA_API void lua_concat (lua_State *L, int n) { - lua_lock(L); - api_checknelems(L, n); - if (n >= 2) { - luaC_checkGC(L); - luaV_concat(L, n, cast_int(L->top - L->base) - 1); - L->top -= (n-1); - } - else if (n == 0) { /* push empty string */ - setsvalue2s(L, L->top, luaS_newlstr(L, "", 0)); - api_incr_top(L); - } - /* else n == 1; nothing to do */ - lua_unlock(L); -} - - -LUA_API lua_Alloc lua_getallocf (lua_State *L, void **ud) { - lua_Alloc f; - lua_lock(L); - if (ud) *ud = G(L)->ud; - f = G(L)->frealloc; - lua_unlock(L); - return f; -} - - -LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud) { - lua_lock(L); - G(L)->ud = ud; - G(L)->frealloc = f; - lua_unlock(L); -} - - -LUA_API void *lua_newuserdata (lua_State *L, size_t size) { - Udata *u; - lua_lock(L); - luaC_checkGC(L); - u = luaS_newudata(L, size, getcurrenv(L)); - setuvalue(L, L->top, u); - api_incr_top(L); - lua_unlock(L); - return u + 1; -} - - - - -static const char *aux_upvalue (StkId fi, int n, TValue **val) { - Closure *f; - if (!ttisfunction(fi)) return NULL; - f = clvalue(fi); - if (f->c.isC) { - if (!(1 <= n && n <= f->c.nupvalues)) return NULL; - *val = &f->c.upvalue[n-1]; - return ""; - } - else { - Proto *p = f->l.p; - if (!(1 <= n && n <= p->sizeupvalues)) return NULL; - *val = f->l.upvals[n-1]->v; - return getstr(p->upvalues[n-1]); - } -} - - -LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n) { - const char *name; - TValue *val; - lua_lock(L); - name = aux_upvalue(index2adr(L, funcindex), n, &val); - if (name) { - setobj2s(L, L->top, val); - api_incr_top(L); - } - lua_unlock(L); - return name; -} - - -LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n) { - const char *name; - TValue *val; - StkId fi; - lua_lock(L); - fi = index2adr(L, funcindex); - api_checknelems(L, 1); - name = aux_upvalue(fi, n, &val); - if (name) { - L->top--; - setobj(L, val, L->top); - luaC_barrier(L, clvalue(fi), L->top); - } - lua_unlock(L); - return name; -} - diff --git a/script/lua/lapi.h b/script/lua/lapi.h deleted file mode 100644 index 2c3fab244..000000000 --- a/script/lua/lapi.h +++ /dev/null @@ -1,16 +0,0 @@ -/* -** $Id: lapi.h,v 2.2.1.1 2007/12/27 13:02:25 roberto Exp $ -** Auxiliary functions from Lua API -** See Copyright Notice in lua.h -*/ - -#ifndef lapi_h -#define lapi_h - - -#include "lobject.h" - - -LUAI_FUNC void luaA_pushobject (lua_State *L, const TValue *o); - -#endif diff --git a/script/lua/lauxlib.c b/script/lua/lauxlib.c deleted file mode 100644 index f61e028d3..000000000 --- a/script/lua/lauxlib.c +++ /dev/null @@ -1,668 +0,0 @@ -/* -** $Id: lauxlib.c,v 1.159.1.3 2008/01/21 13:20:51 roberto Exp $ -** Auxiliary functions for building Lua libraries -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#include -#include -#include -#endif - -/* This file uses only the official API of Lua. -** Any function declared here could be written as an application function. -*/ - -#define lauxlib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" - - -#define FREELIST_REF 0 /* free list of references */ - - -/* convert a stack index to positive */ -#define abs_index(L, i) ((i) > 0 || (i) <= LUA_REGISTRYINDEX ? (i) : \ - lua_gettop(L) + (i) + 1) - - -/* -** {====================================================== -** Error-report functions -** ======================================================= -*/ - - -LUALIB_API int luaL_argerror (lua_State *L, int narg, const char *extramsg) { - lua_Debug ar; - if (!lua_getstack(L, 0, &ar)) /* no stack frame? */ - return luaL_error(L, "bad argument #%d (%s)", narg, extramsg); - lua_getinfo(L, "n", &ar); - if (strcmp(ar.namewhat, "method") == 0) { - narg--; /* do not count `self' */ - if (narg == 0) /* error is in the self argument itself? */ - return luaL_error(L, "calling " LUA_QS " on bad self (%s)", - ar.name, extramsg); - } - if (ar.name == NULL) - ar.name = "?"; - return luaL_error(L, "bad argument #%d to " LUA_QS " (%s)", - narg, ar.name, extramsg); -} - - -LUALIB_API int luaL_typerror (lua_State *L, int narg, const char *tname) { - const char *msg = lua_pushfstring(L, "%s expected, got %s", - tname, luaL_typename(L, narg)); - return luaL_argerror(L, narg, msg); -} - - -static void tag_error (lua_State *L, int narg, int tag) { - luaL_typerror(L, narg, lua_typename(L, tag)); -} - - -LUALIB_API void luaL_where (lua_State *L, int level) { - lua_Debug ar; - if (lua_getstack(L, level, &ar)) { /* check function at level */ - lua_getinfo(L, "Sl", &ar); /* get info about it */ - if (ar.currentline > 0) { /* is there info? */ - lua_pushfstring(L, "%s:%d: ", ar.short_src, ar.currentline); - return; - } - } - lua_pushliteral(L, ""); /* else, no information available... */ -} - - -LUALIB_API int luaL_error (lua_State *L, const char *fmt, ...) { - va_list argp; - va_start(argp, fmt); - luaL_where(L, 1); - lua_pushvfstring(L, fmt, argp); - va_end(argp); - lua_concat(L, 2); - return lua_error(L); -} - -/* }====================================================== */ - - -LUALIB_API int luaL_checkoption (lua_State *L, int narg, const char *def, - const char *const lst[]) { - const char *name = (def) ? luaL_optstring(L, narg, def) : - luaL_checkstring(L, narg); - int i; - for (i=0; lst[i]; i++) - if (strcmp(lst[i], name) == 0) - return i; - return luaL_argerror(L, narg, - lua_pushfstring(L, "invalid option " LUA_QS, name)); -} - - -LUALIB_API int luaL_newmetatable (lua_State *L, const char *tname) { - lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get registry.name */ - if (!lua_isnil(L, -1)) /* name already in use? */ - return 0; /* leave previous value on top, but return 0 */ - lua_pop(L, 1); - lua_newtable(L); /* create metatable */ - lua_pushvalue(L, -1); - lua_setfield(L, LUA_REGISTRYINDEX, tname); /* registry.name = metatable */ - return 1; -} - - -LUALIB_API void *luaL_checkudata (lua_State *L, int ud, const char *tname) { - void *p = lua_touserdata(L, ud); - if (p != NULL) { /* value is a userdata? */ - if (lua_getmetatable(L, ud)) { /* does it have a metatable? */ - lua_getfield(L, LUA_REGISTRYINDEX, tname); /* get correct metatable */ - if (lua_rawequal(L, -1, -2)) { /* does it have the correct mt? */ - lua_pop(L, 2); /* remove both metatables */ - return p; - } - } - } - luaL_typerror(L, ud, tname); /* else error */ - return NULL; /* to avoid warnings */ -} - - -LUALIB_API void luaL_checkstack (lua_State *L, int space, const char *mes) { - if (!lua_checkstack(L, space)) - luaL_error(L, "stack overflow (%s)", mes); -} - - -LUALIB_API void luaL_checktype (lua_State *L, int narg, int t) { - if (lua_type(L, narg) != t) - tag_error(L, narg, t); -} - - -LUALIB_API void luaL_checkany (lua_State *L, int narg) { - if (lua_type(L, narg) == LUA_TNONE) - luaL_argerror(L, narg, "value expected"); -} - - -LUALIB_API const char *luaL_checklstring (lua_State *L, int narg, size_t *len) { - const char *s = lua_tolstring(L, narg, len); - if (!s) tag_error(L, narg, LUA_TSTRING); - return s; -} - - -LUALIB_API const char *luaL_optlstring (lua_State *L, int narg, - const char *def, size_t *len) { - if (lua_isnoneornil(L, narg)) { - if (len) - *len = (def ? strlen(def) : 0); - return def; - } - else return luaL_checklstring(L, narg, len); -} - - -LUALIB_API lua_Number luaL_checknumber (lua_State *L, int narg) { - lua_Number d = lua_tonumber(L, narg); - if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ - tag_error(L, narg, LUA_TNUMBER); - return d; -} - - -LUALIB_API lua_Number luaL_optnumber (lua_State *L, int narg, lua_Number def) { - return luaL_opt(L, luaL_checknumber, narg, def); -} - - -LUALIB_API lua_Integer luaL_checkinteger (lua_State *L, int narg) { - lua_Integer d = lua_tointeger(L, narg); - if (d == 0 && !lua_isnumber(L, narg)) /* avoid extra test when d is not 0 */ - tag_error(L, narg, LUA_TNUMBER); - return d; -} - - -LUALIB_API lua_Integer luaL_optinteger (lua_State *L, int narg, - lua_Integer def) { - return luaL_opt(L, luaL_checkinteger, narg, def); -} - - -LUALIB_API int luaL_getmetafield (lua_State *L, int obj, const char *event) { - if (!lua_getmetatable(L, obj)) /* no metatable? */ - return 0; - lua_pushstring(L, event); - lua_rawget(L, -2); - if (lua_isnil(L, -1)) { - lua_pop(L, 2); /* remove metatable and metafield */ - return 0; - } - else { - lua_remove(L, -2); /* remove only metatable */ - return 1; - } -} - - -LUALIB_API int luaL_callmeta (lua_State *L, int obj, const char *event) { - obj = abs_index(L, obj); - if (!luaL_getmetafield(L, obj, event)) /* no metafield? */ - return 0; - lua_pushvalue(L, obj); - lua_call(L, 1, 1); - return 1; -} - - -LUALIB_API void (luaL_register) (lua_State *L, const char *libname, - const luaL_Reg *l) { - luaI_openlib(L, libname, l, 0); -} - - -static int libsize (const luaL_Reg *l) { - int size = 0; - for (; l->name; l++) size++; - return size; -} - - -LUALIB_API void luaI_openlib (lua_State *L, const char *libname, - const luaL_Reg *l, int nup) { - if (libname) { - int size = libsize(l); - /* check whether lib already exists */ - luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 1); - lua_getfield(L, -1, libname); /* get _LOADED[libname] */ - if (!lua_istable(L, -1)) { /* not found? */ - lua_pop(L, 1); /* remove previous result */ - /* try global variable (and create one if it does not exist) */ - if (luaL_findtable(L, LUA_GLOBALSINDEX, libname, size) != NULL) - luaL_error(L, "name conflict for module " LUA_QS, libname); - lua_pushvalue(L, -1); - lua_setfield(L, -3, libname); /* _LOADED[libname] = new table */ - } - lua_remove(L, -2); /* remove _LOADED table */ - lua_insert(L, -(nup+1)); /* move library table to below upvalues */ - } - for (; l->name; l++) { - int i; - for (i=0; ifunc, nup); - lua_setfield(L, -(nup+2), l->name); - } - lua_pop(L, nup); /* remove upvalues */ -} - - - -/* -** {====================================================== -** getn-setn: size for arrays -** ======================================================= -*/ - -#if defined(LUA_COMPAT_GETN) - -static int checkint (lua_State *L, int topop) { - int n = (lua_type(L, -1) == LUA_TNUMBER) ? lua_tointeger(L, -1) : -1; - lua_pop(L, topop); - return n; -} - - -static void getsizes (lua_State *L) { - lua_getfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); - if (lua_isnil(L, -1)) { /* no `size' table? */ - lua_pop(L, 1); /* remove nil */ - lua_newtable(L); /* create it */ - lua_pushvalue(L, -1); /* `size' will be its own metatable */ - lua_setmetatable(L, -2); - lua_pushliteral(L, "kv"); - lua_setfield(L, -2, "__mode"); /* metatable(N).__mode = "kv" */ - lua_pushvalue(L, -1); - lua_setfield(L, LUA_REGISTRYINDEX, "LUA_SIZES"); /* store in register */ - } -} - - -LUALIB_API void luaL_setn (lua_State *L, int t, int n) { - t = abs_index(L, t); - lua_pushliteral(L, "n"); - lua_rawget(L, t); - if (checkint(L, 1) >= 0) { /* is there a numeric field `n'? */ - lua_pushliteral(L, "n"); /* use it */ - lua_pushinteger(L, n); - lua_rawset(L, t); - } - else { /* use `sizes' */ - getsizes(L); - lua_pushvalue(L, t); - lua_pushinteger(L, n); - lua_rawset(L, -3); /* sizes[t] = n */ - lua_pop(L, 1); /* remove `sizes' */ - } -} - - -LUALIB_API int luaL_getn (lua_State *L, int t) { - int n; - t = abs_index(L, t); - lua_pushliteral(L, "n"); /* try t.n */ - lua_rawget(L, t); - if ((n = checkint(L, 1)) >= 0) return n; - getsizes(L); /* else try sizes[t] */ - lua_pushvalue(L, t); - lua_rawget(L, -2); - if ((n = checkint(L, 2)) >= 0) return n; - return (int)lua_objlen(L, t); -} - -#endif - -/* }====================================================== */ - - - -LUALIB_API const char *luaL_gsub (lua_State *L, const char *s, const char *p, - const char *r) { - const char *wild; - size_t l = strlen(p); - luaL_Buffer b; - luaL_buffinit(L, &b); - while ((wild = strstr(s, p)) != NULL) { - luaL_addlstring(&b, s, wild - s); /* push prefix */ - luaL_addstring(&b, r); /* push replacement in place of pattern */ - s = wild + l; /* continue after `p' */ - } - luaL_addstring(&b, s); /* push last suffix */ - luaL_pushresult(&b); - return lua_tostring(L, -1); -} - - -LUALIB_API const char *luaL_findtable (lua_State *L, int idx, - const char *fname, int szhint) { - const char *e; - lua_pushvalue(L, idx); - do { - e = strchr(fname, '.'); - if (e == NULL) e = fname + strlen(fname); - lua_pushlstring(L, fname, e - fname); - lua_rawget(L, -2); - if (lua_isnil(L, -1)) { /* no such field? */ - lua_pop(L, 1); /* remove this nil */ - lua_createtable(L, 0, (*e == '.' ? 1 : szhint)); /* new table for field */ - lua_pushlstring(L, fname, e - fname); - lua_pushvalue(L, -2); - lua_settable(L, -4); /* set new table into field */ - } - else if (!lua_istable(L, -1)) { /* field has a non-table value? */ - lua_pop(L, 2); /* remove table and value */ - return fname; /* return problematic part of the name */ - } - lua_remove(L, -2); /* remove previous table */ - fname = e + 1; - } while (*e == '.'); - return NULL; -} - - - -/* -** {====================================================== -** Generic Buffer manipulation -** ======================================================= -*/ - - -#define bufflen(B) ((B)->p - (B)->buffer) -#define bufffree(B) ((size_t)(LUAL_BUFFERSIZE - bufflen(B))) - -#define LIMIT (LUA_MINSTACK/2) - - -static int emptybuffer (luaL_Buffer *B) { - size_t l = bufflen(B); - if (l == 0) return 0; /* put nothing on stack */ - else { - lua_pushlstring(B->L, B->buffer, l); - B->p = B->buffer; - B->lvl++; - return 1; - } -} - - -static void adjuststack (luaL_Buffer *B) { - if (B->lvl > 1) { - lua_State *L = B->L; - int toget = 1; /* number of levels to concat */ - size_t toplen = lua_strlen(L, -1); - do { - size_t l = lua_strlen(L, -(toget+1)); - if (B->lvl - toget + 1 >= LIMIT || toplen > l) { - toplen += l; - toget++; - } - else break; - } while (toget < B->lvl); - lua_concat(L, toget); - B->lvl = B->lvl - toget + 1; - } -} - - -LUALIB_API char *luaL_prepbuffer (luaL_Buffer *B) { - if (emptybuffer(B)) - adjuststack(B); - return B->buffer; -} - - -LUALIB_API void luaL_addlstring (luaL_Buffer *B, const char *s, size_t l) { - while (l--) - luaL_addchar(B, *s++); -} - - -LUALIB_API void luaL_addstring (luaL_Buffer *B, const char *s) { - luaL_addlstring(B, s, strlen(s)); -} - - -LUALIB_API void luaL_pushresult (luaL_Buffer *B) { - emptybuffer(B); - lua_concat(B->L, B->lvl); - B->lvl = 1; -} - - -LUALIB_API void luaL_addvalue (luaL_Buffer *B) { - lua_State *L = B->L; - size_t vl; - const char *s = lua_tolstring(L, -1, &vl); - if (vl <= bufffree(B)) { /* fit into buffer? */ - memcpy(B->p, s, vl); /* put it there */ - B->p += vl; - lua_pop(L, 1); /* remove from stack */ - } - else { - if (emptybuffer(B)) - lua_insert(L, -2); /* put buffer before new value */ - B->lvl++; /* add new value into B stack */ - adjuststack(B); - } -} - - -LUALIB_API void luaL_buffinit (lua_State *L, luaL_Buffer *B) { - B->L = L; - B->p = B->buffer; - B->lvl = 0; -} - -/* }====================================================== */ - - -LUALIB_API int luaL_ref (lua_State *L, int t) { - int ref; - t = abs_index(L, t); - if (lua_isnil(L, -1)) { - lua_pop(L, 1); /* remove from stack */ - return LUA_REFNIL; /* `nil' has a unique fixed reference */ - } - lua_rawgeti(L, t, FREELIST_REF); /* get first free element */ - ref = (int)lua_tointeger(L, -1); /* ref = t[FREELIST_REF] */ - lua_pop(L, 1); /* remove it from stack */ - if (ref != 0) { /* any free element? */ - lua_rawgeti(L, t, ref); /* remove it from list */ - lua_rawseti(L, t, FREELIST_REF); /* (t[FREELIST_REF] = t[ref]) */ - } - else { /* no free elements */ - ref = (int)lua_objlen(L, t); - ref++; /* create new reference */ - } - lua_rawseti(L, t, ref); - return ref; -} - - -LUALIB_API void luaL_unref (lua_State *L, int t, int ref) { - if (ref >= 0) { - t = abs_index(L, t); - lua_rawgeti(L, t, FREELIST_REF); - lua_rawseti(L, t, ref); /* t[ref] = t[FREELIST_REF] */ - lua_pushinteger(L, ref); - lua_rawseti(L, t, FREELIST_REF); /* t[FREELIST_REF] = ref */ - } -} - - - -/* -** {====================================================== -** Load functions -** ======================================================= -*/ - -#if 0 - -typedef struct LoadF { - int extraline; - FILE *f; - char buff[LUAL_BUFFERSIZE]; -} LoadF; - - -static const char *getF (lua_State *L, void *ud, size_t *size) { - LoadF *lf = (LoadF *)ud; - (void)L; - if (lf->extraline) { - lf->extraline = 0; - *size = 1; - return "\n"; - } - if (feof(lf->f)) return NULL; - *size = fread(lf->buff, 1, sizeof(lf->buff), lf->f); - return (*size > 0) ? lf->buff : NULL; -} - - -static int errfile (lua_State *L, const char *what, int fnameindex) { - const char *serr = strerror(errno); - const char *filename = lua_tostring(L, fnameindex) + 1; - lua_pushfstring(L, "cannot %s %s: %s", what, filename, serr); - lua_remove(L, fnameindex); - return LUA_ERRFILE; -} - - -LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { - LoadF lf; - int status, readstatus; - int c; - int fnameindex = lua_gettop(L) + 1; /* index of filename on the stack */ - lf.extraline = 0; - if (filename == NULL) { - lua_pushliteral(L, "=stdin"); - lf.f = stdin; - } - else { - lua_pushfstring(L, "@%s", filename); - lf.f = fopen(filename, "r"); - if (lf.f == NULL) return errfile(L, "open", fnameindex); - } - c = getc(lf.f); - if (c == '#') { /* Unix exec. file? */ - lf.extraline = 1; - while ((c = getc(lf.f)) != EOF && c != '\n') ; /* skip first line */ - if (c == '\n') c = getc(lf.f); - } - if (c == LUA_SIGNATURE[0] && filename) { /* binary file? */ - lf.f = freopen(filename, "rb", lf.f); /* reopen in binary mode */ - if (lf.f == NULL) return errfile(L, "reopen", fnameindex); - /* skip eventual `#!...' */ - while ((c = getc(lf.f)) != EOF && c != LUA_SIGNATURE[0]) ; - lf.extraline = 0; - } - ungetc(c, lf.f); - status = lua_load(L, getF, &lf, lua_tostring(L, -1)); - readstatus = ferror(lf.f); - if (filename) fclose(lf.f); /* close file (even in case of errors) */ - if (readstatus) { - lua_settop(L, fnameindex); /* ignore results from `lua_load' */ - return errfile(L, "read", fnameindex); - } - lua_remove(L, fnameindex); - return status; -} - -#else -LUALIB_API int luaL_loadfile (lua_State *L, const char *filename) { - (void) L; - (void) filename; - - return LUA_ERRFILE; -} - -#endif - -typedef struct LoadS { - const char *s; - size_t size; -} LoadS; - - -static const char *getS (lua_State *L, void *ud, size_t *size) { - LoadS *ls = (LoadS *)ud; - (void)L; - if (ls->size == 0) return NULL; - *size = ls->size; - ls->size = 0; - return ls->s; -} - - -LUALIB_API int luaL_loadbuffer (lua_State *L, const char *buff, size_t size, - const char *name) { - LoadS ls; - ls.s = buff; - ls.size = size; - return lua_load(L, getS, &ls, name); -} - - -LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s) { - return luaL_loadbuffer(L, s, strlen(s), s); -} - - - -/* }====================================================== */ - - -static void *l_alloc (void *ud, void *ptr, size_t osize, size_t nsize) { - (void)ud; - (void)osize; - if (nsize == 0) { - free(ptr); - return NULL; - } - else - return realloc(ptr, nsize); -} - - -static int panic (lua_State *L) { - (void)L; /* to avoid warnings */ -#if 0 - fprintf(stderr, "PANIC: unprotected error in call to Lua API (%s)\n", - lua_tostring(L, -1)); -#else - grub_fatal ("PANIC: unprotected error in call to Lua API (%s)\n", - lua_tostring(L, -1)); -#endif - return 0; -} - - -LUALIB_API lua_State *luaL_newstate (void) { - lua_State *L = lua_newstate(l_alloc, NULL); - if (L) lua_atpanic(L, &panic); - return L; -} - diff --git a/script/lua/lauxlib.h b/script/lua/lauxlib.h deleted file mode 100644 index f18864d6c..000000000 --- a/script/lua/lauxlib.h +++ /dev/null @@ -1,175 +0,0 @@ -/* -** $Id: lauxlib.h,v 1.88.1.1 2007/12/27 13:02:25 roberto Exp $ -** Auxiliary functions for building Lua libraries -** See Copyright Notice in lua.h -*/ - - -#ifndef lauxlib_h -#define lauxlib_h - -#if 0 -#include -#include -#endif - -#include "lua.h" - - -#if defined(LUA_COMPAT_GETN) -LUALIB_API int (luaL_getn) (lua_State *L, int t); -LUALIB_API void (luaL_setn) (lua_State *L, int t, int n); -#else -#define luaL_getn(L,i) ((int)lua_objlen(L, i)) -#define luaL_setn(L,i,j) ((void)0) /* no op! */ -#endif - -#if defined(LUA_COMPAT_OPENLIB) -#define luaI_openlib luaL_openlib -#endif - - -/* extra error code for `luaL_load' */ -#define LUA_ERRFILE (LUA_ERRERR+1) - - -typedef struct luaL_Reg { - const char *name; - lua_CFunction func; -} luaL_Reg; - - - -LUALIB_API void (luaI_openlib) (lua_State *L, const char *libname, - const luaL_Reg *l, int nup); -LUALIB_API void (luaL_register) (lua_State *L, const char *libname, - const luaL_Reg *l); -LUALIB_API int (luaL_getmetafield) (lua_State *L, int obj, const char *e); -LUALIB_API int (luaL_callmeta) (lua_State *L, int obj, const char *e); -LUALIB_API int (luaL_typerror) (lua_State *L, int narg, const char *tname); -LUALIB_API int (luaL_argerror) (lua_State *L, int numarg, const char *extramsg); -LUALIB_API const char *(luaL_checklstring) (lua_State *L, int numArg, - size_t *l); -LUALIB_API const char *(luaL_optlstring) (lua_State *L, int numArg, - const char *def, size_t *l); -LUALIB_API lua_Number (luaL_checknumber) (lua_State *L, int numArg); -LUALIB_API lua_Number (luaL_optnumber) (lua_State *L, int nArg, lua_Number def); - -LUALIB_API lua_Integer (luaL_checkinteger) (lua_State *L, int numArg); -LUALIB_API lua_Integer (luaL_optinteger) (lua_State *L, int nArg, - lua_Integer def); - -LUALIB_API void (luaL_checkstack) (lua_State *L, int sz, const char *msg); -LUALIB_API void (luaL_checktype) (lua_State *L, int narg, int t); -LUALIB_API void (luaL_checkany) (lua_State *L, int narg); - -LUALIB_API int (luaL_newmetatable) (lua_State *L, const char *tname); -LUALIB_API void *(luaL_checkudata) (lua_State *L, int ud, const char *tname); - -LUALIB_API void (luaL_where) (lua_State *L, int lvl); -LUALIB_API int (luaL_error) (lua_State *L, const char *fmt, ...); - -LUALIB_API int (luaL_checkoption) (lua_State *L, int narg, const char *def, - const char *const lst[]); - -LUALIB_API int (luaL_ref) (lua_State *L, int t); -LUALIB_API void (luaL_unref) (lua_State *L, int t, int ref); - -LUALIB_API int (luaL_loadfile) (lua_State *L, const char *filename); -LUALIB_API int (luaL_loadbuffer) (lua_State *L, const char *buff, size_t sz, - const char *name); -LUALIB_API int (luaL_loadstring) (lua_State *L, const char *s); - -LUALIB_API lua_State *(luaL_newstate) (void); - - -LUALIB_API const char *(luaL_gsub) (lua_State *L, const char *s, const char *p, - const char *r); - -LUALIB_API const char *(luaL_findtable) (lua_State *L, int idx, - const char *fname, int szhint); - - - - -/* -** =============================================================== -** some useful macros -** =============================================================== -*/ - -#define luaL_argcheck(L, cond,numarg,extramsg) \ - ((void)((cond) || luaL_argerror(L, (numarg), (extramsg)))) -#define luaL_checkstring(L,n) (luaL_checklstring(L, (n), NULL)) -#define luaL_optstring(L,n,d) (luaL_optlstring(L, (n), (d), NULL)) -#define luaL_checkint(L,n) ((int)luaL_checkinteger(L, (n))) -#define luaL_optint(L,n,d) ((int)luaL_optinteger(L, (n), (d))) -#define luaL_checklong(L,n) ((long)luaL_checkinteger(L, (n))) -#define luaL_optlong(L,n,d) ((long)luaL_optinteger(L, (n), (d))) - -#define luaL_typename(L,i) lua_typename(L, lua_type(L,(i))) - -#define luaL_dofile(L, fn) \ - (luaL_loadfile(L, fn) || lua_pcall(L, 0, LUA_MULTRET, 0)) - -#define luaL_dostring(L, s) \ - (luaL_loadstring(L, s) || lua_pcall(L, 0, LUA_MULTRET, 0)) - -#define luaL_getmetatable(L,n) (lua_getfield(L, LUA_REGISTRYINDEX, (n))) - -#define luaL_opt(L,f,n,d) (lua_isnoneornil(L,(n)) ? (d) : f(L,(n))) - -/* -** {====================================================== -** Generic Buffer manipulation -** ======================================================= -*/ - - - -typedef struct luaL_Buffer { - char *p; /* current position in buffer */ - int lvl; /* number of strings in the stack (level) */ - lua_State *L; - char buffer[LUAL_BUFFERSIZE]; -} luaL_Buffer; - -#define luaL_addchar(B,c) \ - ((void)((B)->p < ((B)->buffer+LUAL_BUFFERSIZE) || luaL_prepbuffer(B)), \ - (*(B)->p++ = (char)(c))) - -/* compatibility only */ -#define luaL_putchar(B,c) luaL_addchar(B,c) - -#define luaL_addsize(B,n) ((B)->p += (n)) - -LUALIB_API void (luaL_buffinit) (lua_State *L, luaL_Buffer *B); -LUALIB_API char *(luaL_prepbuffer) (luaL_Buffer *B); -LUALIB_API void (luaL_addlstring) (luaL_Buffer *B, const char *s, size_t l); -LUALIB_API void (luaL_addstring) (luaL_Buffer *B, const char *s); -LUALIB_API void (luaL_addvalue) (luaL_Buffer *B); -LUALIB_API void (luaL_pushresult) (luaL_Buffer *B); - - -/* }====================================================== */ - - -/* compatibility with ref system */ - -/* pre-defined references */ -#define LUA_NOREF (-2) -#define LUA_REFNIL (-1) - -#define lua_ref(L,lock) ((lock) ? luaL_ref(L, LUA_REGISTRYINDEX) : \ - (lua_pushstring(L, "unlocked references are obsolete"), lua_error(L), 0)) - -#define lua_unref(L,ref) luaL_unref(L, LUA_REGISTRYINDEX, (ref)) - -#define lua_getref(L,ref) lua_rawgeti(L, LUA_REGISTRYINDEX, (ref)) - - -#define luaL_reg luaL_Reg - -#endif - - diff --git a/script/lua/lbaselib.c b/script/lua/lbaselib.c deleted file mode 100644 index 1bbb126c9..000000000 --- a/script/lua/lbaselib.c +++ /dev/null @@ -1,652 +0,0 @@ -/* -** $Id: lbaselib.c,v 1.191.1.6 2008/02/14 16:46:22 roberto Exp $ -** Basic library -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#include -#endif - -#define lbaselib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - - - -/* -** If your system does not support `stdout', you can just remove this function. -** If you need, you can define your own `print' function, following this -** model but changing `fputs' to put the strings at a proper place -** (a console window or a log file, for instance). -*/ -static int luaB_print (lua_State *L) { - int n = lua_gettop(L); /* number of arguments */ - int i; - lua_getglobal(L, "tostring"); - for (i=1; i<=n; i++) { - const char *s; - lua_pushvalue(L, -1); /* function to be called */ - lua_pushvalue(L, i); /* value to print */ - lua_call(L, 1, 1); - s = lua_tostring(L, -1); /* get result */ - if (s == NULL) - return luaL_error(L, LUA_QL("tostring") " must return a string to " - LUA_QL("print")); - if (i>1) fputs("\t", stdout); - fputs(s, stdout); - lua_pop(L, 1); /* pop result */ - } - fputs("\n", stdout); - return 0; -} - - -static int luaB_tonumber (lua_State *L) { - int base = luaL_optint(L, 2, 10); - if (base == 10) { /* standard conversion */ - luaL_checkany(L, 1); - if (lua_isnumber(L, 1)) { - lua_pushnumber(L, lua_tonumber(L, 1)); - return 1; - } - } - else { - const char *s1 = luaL_checkstring(L, 1); - char *s2; - unsigned long n; - luaL_argcheck(L, 2 <= base && base <= 36, 2, "base out of range"); - n = strtoul(s1, &s2, base); - if (s1 != s2) { /* at least one valid digit? */ - while (isspace((unsigned char)(*s2))) s2++; /* skip trailing spaces */ - if (*s2 == '\0') { /* no invalid trailing characters? */ - lua_pushnumber(L, (lua_Number)n); - return 1; - } - } - } - lua_pushnil(L); /* else not a number */ - return 1; -} - - -static int luaB_error (lua_State *L) { - int level = luaL_optint(L, 2, 1); - lua_settop(L, 1); - if (lua_isstring(L, 1) && level > 0) { /* add extra information? */ - luaL_where(L, level); - lua_pushvalue(L, 1); - lua_concat(L, 2); - } - return lua_error(L); -} - - -static int luaB_getmetatable (lua_State *L) { - luaL_checkany(L, 1); - if (!lua_getmetatable(L, 1)) { - lua_pushnil(L); - return 1; /* no metatable */ - } - luaL_getmetafield(L, 1, "__metatable"); - return 1; /* returns either __metatable field (if present) or metatable */ -} - - -static int luaB_setmetatable (lua_State *L) { - int t = lua_type(L, 2); - luaL_checktype(L, 1, LUA_TTABLE); - luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, - "nil or table expected"); - if (luaL_getmetafield(L, 1, "__metatable")) - luaL_error(L, "cannot change a protected metatable"); - lua_settop(L, 2); - lua_setmetatable(L, 1); - return 1; -} - - -static void getfunc (lua_State *L, int opt) { - if (lua_isfunction(L, 1)) lua_pushvalue(L, 1); - else { - lua_Debug ar; - int level = opt ? luaL_optint(L, 1, 1) : luaL_checkint(L, 1); - luaL_argcheck(L, level >= 0, 1, "level must be non-negative"); - if (lua_getstack(L, level, &ar) == 0) - luaL_argerror(L, 1, "invalid level"); - lua_getinfo(L, "f", &ar); - if (lua_isnil(L, -1)) - luaL_error(L, "no function environment for tail call at level %d", - level); - } -} - - -static int luaB_getfenv (lua_State *L) { - getfunc(L, 1); - if (lua_iscfunction(L, -1)) /* is a C function? */ - lua_pushvalue(L, LUA_GLOBALSINDEX); /* return the thread's global env. */ - else - lua_getfenv(L, -1); - return 1; -} - - -static int luaB_setfenv (lua_State *L) { - luaL_checktype(L, 2, LUA_TTABLE); - getfunc(L, 0); - lua_pushvalue(L, 2); - if (lua_isnumber(L, 1) && lua_tonumber(L, 1) == 0) { - /* change environment of current thread */ - lua_pushthread(L); - lua_insert(L, -2); - lua_setfenv(L, -2); - return 0; - } - else if (lua_iscfunction(L, -2) || lua_setfenv(L, -2) == 0) - luaL_error(L, - LUA_QL("setfenv") " cannot change environment of given object"); - return 1; -} - - -static int luaB_rawequal (lua_State *L) { - luaL_checkany(L, 1); - luaL_checkany(L, 2); - lua_pushboolean(L, lua_rawequal(L, 1, 2)); - return 1; -} - - -static int luaB_rawget (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); - luaL_checkany(L, 2); - lua_settop(L, 2); - lua_rawget(L, 1); - return 1; -} - -static int luaB_rawset (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); - luaL_checkany(L, 2); - luaL_checkany(L, 3); - lua_settop(L, 3); - lua_rawset(L, 1); - return 1; -} - - -static int luaB_gcinfo (lua_State *L) { - lua_pushinteger(L, lua_getgccount(L)); - return 1; -} - - -static int luaB_collectgarbage (lua_State *L) { - static const char *const opts[] = {"stop", "restart", "collect", - "count", "step", "setpause", "setstepmul", NULL}; - static const int optsnum[] = {LUA_GCSTOP, LUA_GCRESTART, LUA_GCCOLLECT, - LUA_GCCOUNT, LUA_GCSTEP, LUA_GCSETPAUSE, LUA_GCSETSTEPMUL}; - int o = luaL_checkoption(L, 1, "collect", opts); - int ex = luaL_optint(L, 2, 0); - int res = lua_gc(L, optsnum[o], ex); - switch (optsnum[o]) { - case LUA_GCCOUNT: { - int b = lua_gc(L, LUA_GCCOUNTB, 0); - lua_pushnumber(L, res + ((lua_Number)b/1024)); - return 1; - } - case LUA_GCSTEP: { - lua_pushboolean(L, res); - return 1; - } - default: { - lua_pushnumber(L, res); - return 1; - } - } -} - - -static int luaB_type (lua_State *L) { - luaL_checkany(L, 1); - lua_pushstring(L, luaL_typename(L, 1)); - return 1; -} - - -static int luaB_next (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); - lua_settop(L, 2); /* create a 2nd argument if there isn't one */ - if (lua_next(L, 1)) - return 2; - else { - lua_pushnil(L); - return 1; - } -} - - -static int luaB_pairs (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); - lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ - lua_pushvalue(L, 1); /* state, */ - lua_pushnil(L); /* and initial value */ - return 3; -} - - -static int ipairsaux (lua_State *L) { - int i = luaL_checkint(L, 2); - luaL_checktype(L, 1, LUA_TTABLE); - i++; /* next value */ - lua_pushinteger(L, i); - lua_rawgeti(L, 1, i); - return (lua_isnil(L, -1)) ? 0 : 2; -} - - -static int luaB_ipairs (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); - lua_pushvalue(L, lua_upvalueindex(1)); /* return generator, */ - lua_pushvalue(L, 1); /* state, */ - lua_pushinteger(L, 0); /* and initial value */ - return 3; -} - - -static int load_aux (lua_State *L, int status) { - if (status == 0) /* OK? */ - return 1; - else { - lua_pushnil(L); - lua_insert(L, -2); /* put before error message */ - return 2; /* return nil plus error message */ - } -} - - -static int luaB_loadstring (lua_State *L) { - size_t l; - const char *s = luaL_checklstring(L, 1, &l); - const char *chunkname = luaL_optstring(L, 2, s); - return load_aux(L, luaL_loadbuffer(L, s, l, chunkname)); -} - - -static int luaB_loadfile (lua_State *L) { - const char *fname = luaL_optstring(L, 1, NULL); - return load_aux(L, luaL_loadfile(L, fname)); -} - - -/* -** Reader for generic `load' function: `lua_load' uses the -** stack for internal stuff, so the reader cannot change the -** stack top. Instead, it keeps its resulting string in a -** reserved slot inside the stack. -*/ -static const char *generic_reader (lua_State *L, void *ud, size_t *size) { - (void)ud; /* to avoid warnings */ - luaL_checkstack(L, 2, "too many nested functions"); - lua_pushvalue(L, 1); /* get function */ - lua_call(L, 0, 1); /* call it */ - if (lua_isnil(L, -1)) { - *size = 0; - return NULL; - } - else if (lua_isstring(L, -1)) { - lua_replace(L, 3); /* save string in a reserved stack slot */ - return lua_tolstring(L, 3, size); - } - else luaL_error(L, "reader function must return a string"); - return NULL; /* to avoid warnings */ -} - - -static int luaB_load (lua_State *L) { - int status; - const char *cname = luaL_optstring(L, 2, "=(load)"); - luaL_checktype(L, 1, LUA_TFUNCTION); - lua_settop(L, 3); /* function, eventual name, plus one reserved slot */ - status = lua_load(L, generic_reader, NULL, cname); - return load_aux(L, status); -} - - -static int luaB_dofile (lua_State *L) { - const char *fname = luaL_optstring(L, 1, NULL); - int n = lua_gettop(L); - if (luaL_loadfile(L, fname) != 0) lua_error(L); - lua_call(L, 0, LUA_MULTRET); - return lua_gettop(L) - n; -} - - -static int luaB_assert (lua_State *L) { - luaL_checkany(L, 1); - if (!lua_toboolean(L, 1)) - return luaL_error(L, "%s", luaL_optstring(L, 2, "assertion failed!")); - return lua_gettop(L); -} - - -static int luaB_unpack (lua_State *L) { - int i, e, n; - luaL_checktype(L, 1, LUA_TTABLE); - i = luaL_optint(L, 2, 1); - e = luaL_opt(L, luaL_checkint, 3, luaL_getn(L, 1)); - if (i > e) return 0; /* empty range */ - n = e - i + 1; /* number of elements */ - if (n <= 0 || !lua_checkstack(L, n)) /* n <= 0 means arith. overflow */ - return luaL_error(L, "too many results to unpack"); - lua_rawgeti(L, 1, i); /* push arg[i] (avoiding overflow problems) */ - while (i++ < e) /* push arg[i + 1...e] */ - lua_rawgeti(L, 1, i); - return n; -} - - -static int luaB_select (lua_State *L) { - int n = lua_gettop(L); - if (lua_type(L, 1) == LUA_TSTRING && *lua_tostring(L, 1) == '#') { - lua_pushinteger(L, n-1); - return 1; - } - else { - int i = luaL_checkint(L, 1); - if (i < 0) i = n + i; - else if (i > n) i = n; - luaL_argcheck(L, 1 <= i, 1, "index out of range"); - return n - i; - } -} - - -static int luaB_pcall (lua_State *L) { - int status; - luaL_checkany(L, 1); - status = lua_pcall(L, lua_gettop(L) - 1, LUA_MULTRET, 0); - lua_pushboolean(L, (status == 0)); - lua_insert(L, 1); - return lua_gettop(L); /* return status + all results */ -} - - -static int luaB_xpcall (lua_State *L) { - int status; - luaL_checkany(L, 2); - lua_settop(L, 2); - lua_insert(L, 1); /* put error function under function to be called */ - status = lua_pcall(L, 0, LUA_MULTRET, 1); - lua_pushboolean(L, (status == 0)); - lua_replace(L, 1); - return lua_gettop(L); /* return status + all results */ -} - -static int luaB_tostring (lua_State *L) { - luaL_checkany(L, 1); - if (luaL_callmeta(L, 1, "__tostring")) /* is there a metafield? */ - return 1; /* use its value */ - switch (lua_type(L, 1)) { - case LUA_TNUMBER: - lua_pushstring(L, lua_tostring(L, 1)); - break; - case LUA_TSTRING: - lua_pushvalue(L, 1); - break; - case LUA_TBOOLEAN: - lua_pushstring(L, (lua_toboolean(L, 1) ? "true" : "false")); - break; - case LUA_TNIL: - lua_pushliteral(L, "nil"); - break; - default: - lua_pushfstring(L, "%s: %p", luaL_typename(L, 1), lua_topointer(L, 1)); - break; - } - return 1; -} - - -static int luaB_newproxy (lua_State *L) { - lua_settop(L, 1); - lua_newuserdata(L, 0); /* create proxy */ - if (lua_toboolean(L, 1) == 0) - return 1; /* no metatable */ - else if (lua_isboolean(L, 1)) { - lua_newtable(L); /* create a new metatable `m' ... */ - lua_pushvalue(L, -1); /* ... and mark `m' as a valid metatable */ - lua_pushboolean(L, 1); - lua_rawset(L, lua_upvalueindex(1)); /* weaktable[m] = true */ - } - else { - int validproxy = 0; /* to check if weaktable[metatable(u)] == true */ - if (lua_getmetatable(L, 1)) { - lua_rawget(L, lua_upvalueindex(1)); - validproxy = lua_toboolean(L, -1); - lua_pop(L, 1); /* remove value */ - } - luaL_argcheck(L, validproxy, 1, "boolean or proxy expected"); - lua_getmetatable(L, 1); /* metatable is valid; get it */ - } - lua_setmetatable(L, 2); - return 1; -} - - -static const luaL_Reg base_funcs[] = { - {"assert", luaB_assert}, - {"collectgarbage", luaB_collectgarbage}, - {"dofile", luaB_dofile}, - {"error", luaB_error}, - {"gcinfo", luaB_gcinfo}, - {"getfenv", luaB_getfenv}, - {"getmetatable", luaB_getmetatable}, - {"loadfile", luaB_loadfile}, - {"load", luaB_load}, - {"loadstring", luaB_loadstring}, - {"next", luaB_next}, - {"pcall", luaB_pcall}, - {"print", luaB_print}, - {"rawequal", luaB_rawequal}, - {"rawget", luaB_rawget}, - {"rawset", luaB_rawset}, - {"select", luaB_select}, - {"setfenv", luaB_setfenv}, - {"setmetatable", luaB_setmetatable}, - {"tonumber", luaB_tonumber}, - {"tostring", luaB_tostring}, - {"type", luaB_type}, - {"unpack", luaB_unpack}, - {"xpcall", luaB_xpcall}, - {NULL, NULL} -}; - - -/* -** {====================================================== -** Coroutine library -** ======================================================= -*/ - -#define CO_RUN 0 /* running */ -#define CO_SUS 1 /* suspended */ -#define CO_NOR 2 /* 'normal' (it resumed another coroutine) */ -#define CO_DEAD 3 - -static const char *const statnames[] = - {"running", "suspended", "normal", "dead"}; - -static int costatus (lua_State *L, lua_State *co) { - if (L == co) return CO_RUN; - switch (lua_status(co)) { - case LUA_YIELD: - return CO_SUS; - case 0: { - lua_Debug ar; - if (lua_getstack(co, 0, &ar) > 0) /* does it have frames? */ - return CO_NOR; /* it is running */ - else if (lua_gettop(co) == 0) - return CO_DEAD; - else - return CO_SUS; /* initial state */ - } - default: /* some error occured */ - return CO_DEAD; - } -} - - -static int luaB_costatus (lua_State *L) { - lua_State *co = lua_tothread(L, 1); - luaL_argcheck(L, co, 1, "coroutine expected"); - lua_pushstring(L, statnames[costatus(L, co)]); - return 1; -} - - -static int auxresume (lua_State *L, lua_State *co, int narg) { - int status = costatus(L, co); - if (!lua_checkstack(co, narg)) - luaL_error(L, "too many arguments to resume"); - if (status != CO_SUS) { - lua_pushfstring(L, "cannot resume %s coroutine", statnames[status]); - return -1; /* error flag */ - } - lua_xmove(L, co, narg); - lua_setlevel(L, co); - status = lua_resume(co, narg); - if (status == 0 || status == LUA_YIELD) { - int nres = lua_gettop(co); - if (!lua_checkstack(L, nres + 1)) - luaL_error(L, "too many results to resume"); - lua_xmove(co, L, nres); /* move yielded values */ - return nres; - } - else { - lua_xmove(co, L, 1); /* move error message */ - return -1; /* error flag */ - } -} - - -static int luaB_coresume (lua_State *L) { - lua_State *co = lua_tothread(L, 1); - int r; - luaL_argcheck(L, co, 1, "coroutine expected"); - r = auxresume(L, co, lua_gettop(L) - 1); - if (r < 0) { - lua_pushboolean(L, 0); - lua_insert(L, -2); - return 2; /* return false + error message */ - } - else { - lua_pushboolean(L, 1); - lua_insert(L, -(r + 1)); - return r + 1; /* return true + `resume' returns */ - } -} - - -static int luaB_auxwrap (lua_State *L) { - lua_State *co = lua_tothread(L, lua_upvalueindex(1)); - int r = auxresume(L, co, lua_gettop(L)); - if (r < 0) { - if (lua_isstring(L, -1)) { /* error object is a string? */ - luaL_where(L, 1); /* add extra info */ - lua_insert(L, -2); - lua_concat(L, 2); - } - lua_error(L); /* propagate error */ - } - return r; -} - - -static int luaB_cocreate (lua_State *L) { - lua_State *NL = lua_newthread(L); - luaL_argcheck(L, lua_isfunction(L, 1) && !lua_iscfunction(L, 1), 1, - "Lua function expected"); - lua_pushvalue(L, 1); /* move function to top */ - lua_xmove(L, NL, 1); /* move function from L to NL */ - return 1; -} - - -static int luaB_cowrap (lua_State *L) { - luaB_cocreate(L); - lua_pushcclosure(L, luaB_auxwrap, 1); - return 1; -} - - -static int luaB_yield (lua_State *L) { - return lua_yield(L, lua_gettop(L)); -} - - -static int luaB_corunning (lua_State *L) { - if (lua_pushthread(L)) - lua_pushnil(L); /* main thread is not a coroutine */ - return 1; -} - - -static const luaL_Reg co_funcs[] = { - {"create", luaB_cocreate}, - {"resume", luaB_coresume}, - {"running", luaB_corunning}, - {"status", luaB_costatus}, - {"wrap", luaB_cowrap}, - {"yield", luaB_yield}, - {NULL, NULL} -}; - -/* }====================================================== */ - - -static void auxopen (lua_State *L, const char *name, - lua_CFunction f, lua_CFunction u) { - lua_pushcfunction(L, u); - lua_pushcclosure(L, f, 1); - lua_setfield(L, -2, name); -} - - -static void base_open (lua_State *L) { - /* set global _G */ - lua_pushvalue(L, LUA_GLOBALSINDEX); - lua_setglobal(L, "_G"); - /* open lib into global table */ - luaL_register(L, "_G", base_funcs); - lua_pushliteral(L, LUA_VERSION); - lua_setglobal(L, "_VERSION"); /* set global _VERSION */ - /* `ipairs' and `pairs' need auxliliary functions as upvalues */ - auxopen(L, "ipairs", luaB_ipairs, ipairsaux); - auxopen(L, "pairs", luaB_pairs, luaB_next); - /* `newproxy' needs a weaktable as upvalue */ - lua_createtable(L, 0, 1); /* new table `w' */ - lua_pushvalue(L, -1); /* `w' will be its own metatable */ - lua_setmetatable(L, -2); - lua_pushliteral(L, "kv"); - lua_setfield(L, -2, "__mode"); /* metatable(w).__mode = "kv" */ - lua_pushcclosure(L, luaB_newproxy, 1); - lua_setglobal(L, "newproxy"); /* set global `newproxy' */ -} - - -LUALIB_API int luaopen_base (lua_State *L) { - base_open(L); - luaL_register(L, LUA_COLIBNAME, co_funcs); - return 2; -} - diff --git a/script/lua/lcode.c b/script/lua/lcode.c deleted file mode 100644 index 64f726b48..000000000 --- a/script/lua/lcode.c +++ /dev/null @@ -1,848 +0,0 @@ -/* -** $Id: lcode.c,v 2.25.1.3 2007/12/28 15:32:23 roberto Exp $ -** Code generator for Lua -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#endif - -#define lcode_c -#define LUA_CORE - -#include "lua.h" - -#include "lcode.h" -#include "ldebug.h" -#include "ldo.h" -#include "lgc.h" -#include "llex.h" -#include "lmem.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lparser.h" -#include "ltable.h" - - -#define hasjumps(e) ((e)->t != (e)->f) - - -static int isnumeral(expdesc *e) { - return (e->k == VKNUM && e->t == NO_JUMP && e->f == NO_JUMP); -} - - -void luaK_nil (FuncState *fs, int from, int n) { - Instruction *previous; - if (fs->pc > fs->lasttarget) { /* no jumps to current position? */ - if (fs->pc == 0) { /* function start? */ - if (from >= fs->nactvar) - return; /* positions are already clean */ - } - else { - previous = &fs->f->code[fs->pc-1]; - if (GET_OPCODE(*previous) == OP_LOADNIL) { - int pfrom = GETARG_A(*previous); - int pto = GETARG_B(*previous); - if (pfrom <= from && from <= pto+1) { /* can connect both? */ - if (from+n-1 > pto) - SETARG_B(*previous, from+n-1); - return; - } - } - } - } - luaK_codeABC(fs, OP_LOADNIL, from, from+n-1, 0); /* else no optimization */ -} - - -int luaK_jump (FuncState *fs) { - int jpc = fs->jpc; /* save list of jumps to here */ - int j; - fs->jpc = NO_JUMP; - j = luaK_codeAsBx(fs, OP_JMP, 0, NO_JUMP); - luaK_concat(fs, &j, jpc); /* keep them on hold */ - return j; -} - - -void luaK_ret (FuncState *fs, int first, int nret) { - luaK_codeABC(fs, OP_RETURN, first, nret+1, 0); -} - - -static int condjump (FuncState *fs, OpCode op, int A, int B, int C) { - luaK_codeABC(fs, op, A, B, C); - return luaK_jump(fs); -} - - -static void fixjump (FuncState *fs, int pc, int dest) { - Instruction *jmp = &fs->f->code[pc]; - int offset = dest-(pc+1); - lua_assert(dest != NO_JUMP); - if (abs(offset) > MAXARG_sBx) - luaX_syntaxerror(fs->ls, "control structure too long"); - SETARG_sBx(*jmp, offset); -} - - -/* -** returns current `pc' and marks it as a jump target (to avoid wrong -** optimizations with consecutive instructions not in the same basic block). -*/ -int luaK_getlabel (FuncState *fs) { - fs->lasttarget = fs->pc; - return fs->pc; -} - - -static int getjump (FuncState *fs, int pc) { - int offset = GETARG_sBx(fs->f->code[pc]); - if (offset == NO_JUMP) /* point to itself represents end of list */ - return NO_JUMP; /* end of list */ - else - return (pc+1)+offset; /* turn offset into absolute position */ -} - - -static Instruction *getjumpcontrol (FuncState *fs, int pc) { - Instruction *pi = &fs->f->code[pc]; - if (pc >= 1 && testTMode(GET_OPCODE(*(pi-1)))) - return pi-1; - else - return pi; -} - - -/* -** check whether list has any jump that do not produce a value -** (or produce an inverted value) -*/ -static int need_value (FuncState *fs, int list) { - for (; list != NO_JUMP; list = getjump(fs, list)) { - Instruction i = *getjumpcontrol(fs, list); - if (GET_OPCODE(i) != OP_TESTSET) return 1; - } - return 0; /* not found */ -} - - -static int patchtestreg (FuncState *fs, int node, int reg) { - Instruction *i = getjumpcontrol(fs, node); - if (GET_OPCODE(*i) != OP_TESTSET) - return 0; /* cannot patch other instructions */ - if (reg != NO_REG && reg != GETARG_B(*i)) - SETARG_A(*i, reg); - else /* no register to put value or register already has the value */ - *i = CREATE_ABC(OP_TEST, GETARG_B(*i), 0, GETARG_C(*i)); - - return 1; -} - - -static void removevalues (FuncState *fs, int list) { - for (; list != NO_JUMP; list = getjump(fs, list)) - patchtestreg(fs, list, NO_REG); -} - - -static void patchlistaux (FuncState *fs, int list, int vtarget, int reg, - int dtarget) { - while (list != NO_JUMP) { - int next = getjump(fs, list); - if (patchtestreg(fs, list, reg)) - fixjump(fs, list, vtarget); - else - fixjump(fs, list, dtarget); /* jump to default target */ - list = next; - } -} - - -static void dischargejpc (FuncState *fs) { - patchlistaux(fs, fs->jpc, fs->pc, NO_REG, fs->pc); - fs->jpc = NO_JUMP; -} - - -void luaK_patchlist (FuncState *fs, int list, int target) { - if (target == fs->pc) - luaK_patchtohere(fs, list); - else { - lua_assert(target < fs->pc); - patchlistaux(fs, list, target, NO_REG, target); - } -} - - -void luaK_patchtohere (FuncState *fs, int list) { - luaK_getlabel(fs); - luaK_concat(fs, &fs->jpc, list); -} - - -void luaK_concat (FuncState *fs, int *l1, int l2) { - if (l2 == NO_JUMP) return; - else if (*l1 == NO_JUMP) - *l1 = l2; - else { - int list = *l1; - int next; - while ((next = getjump(fs, list)) != NO_JUMP) /* find last element */ - list = next; - fixjump(fs, list, l2); - } -} - - -void luaK_checkstack (FuncState *fs, int n) { - int newstack = fs->freereg + n; - if (newstack > fs->f->maxstacksize) { - if (newstack >= MAXSTACK) - luaX_syntaxerror(fs->ls, "function or expression too complex"); - fs->f->maxstacksize = cast_byte(newstack); - } -} - - -void luaK_reserveregs (FuncState *fs, int n) { - luaK_checkstack(fs, n); - fs->freereg += n; -} - - -static void freereg (FuncState *fs, int reg) { - if (!ISK(reg) && reg >= fs->nactvar) { - fs->freereg--; - lua_assert(reg == fs->freereg); - } -} - - -static void freeexp (FuncState *fs, expdesc *e) { - if (e->k == VNONRELOC) - freereg(fs, e->u.s.info); -} - - -static int addk (FuncState *fs, TValue *k, TValue *v) { - lua_State *L = fs->L; - TValue *idx = luaH_set(L, fs->h, k); - Proto *f = fs->f; - int oldsize = f->sizek; - if (ttisnumber(idx)) { - lua_assert(luaO_rawequalObj(&fs->f->k[cast_int(nvalue(idx))], v)); - return cast_int(nvalue(idx)); - } - else { /* constant not found; create a new entry */ - setnvalue(idx, cast_num(fs->nk)); - luaM_growvector(L, f->k, fs->nk, f->sizek, TValue, - MAXARG_Bx, "constant table overflow"); - while (oldsize < f->sizek) setnilvalue(&f->k[oldsize++]); - setobj(L, &f->k[fs->nk], v); - luaC_barrier(L, f, v); - return fs->nk++; - } -} - - -int luaK_stringK (FuncState *fs, TString *s) { - TValue o; - setsvalue(fs->L, &o, s); - return addk(fs, &o, &o); -} - - -int luaK_numberK (FuncState *fs, lua_Number r) { - TValue o; - setnvalue(&o, r); - return addk(fs, &o, &o); -} - - -static int boolK (FuncState *fs, int b) { - TValue o; - setbvalue(&o, b); - return addk(fs, &o, &o); -} - - -static int nilK (FuncState *fs) { - TValue k, v; - setnilvalue(&v); - /* cannot use nil as key; instead use table itself to represent nil */ - sethvalue(fs->L, &k, fs->h); - return addk(fs, &k, &v); -} - - -void luaK_setreturns (FuncState *fs, expdesc *e, int nresults) { - if (e->k == VCALL) { /* expression is an open function call? */ - SETARG_C(getcode(fs, e), nresults+1); - } - else if (e->k == VVARARG) { - SETARG_B(getcode(fs, e), nresults+1); - SETARG_A(getcode(fs, e), fs->freereg); - luaK_reserveregs(fs, 1); - } -} - - -void luaK_setoneret (FuncState *fs, expdesc *e) { - if (e->k == VCALL) { /* expression is an open function call? */ - e->k = VNONRELOC; - e->u.s.info = GETARG_A(getcode(fs, e)); - } - else if (e->k == VVARARG) { - SETARG_B(getcode(fs, e), 2); - e->k = VRELOCABLE; /* can relocate its simple result */ - } -} - - -void luaK_dischargevars (FuncState *fs, expdesc *e) { - switch (e->k) { - case VLOCAL: { - e->k = VNONRELOC; - break; - } - case VUPVAL: { - e->u.s.info = luaK_codeABC(fs, OP_GETUPVAL, 0, e->u.s.info, 0); - e->k = VRELOCABLE; - break; - } - case VGLOBAL: { - e->u.s.info = luaK_codeABx(fs, OP_GETGLOBAL, 0, e->u.s.info); - e->k = VRELOCABLE; - break; - } - case VINDEXED: { - freereg(fs, e->u.s.aux); - freereg(fs, e->u.s.info); - e->u.s.info = luaK_codeABC(fs, OP_GETTABLE, 0, e->u.s.info, e->u.s.aux); - e->k = VRELOCABLE; - break; - } - case VVARARG: - case VCALL: { - luaK_setoneret(fs, e); - break; - } - default: break; /* there is one value available (somewhere) */ - } -} - - -static int code_label (FuncState *fs, int A, int b, int jump) { - luaK_getlabel(fs); /* those instructions may be jump targets */ - return luaK_codeABC(fs, OP_LOADBOOL, A, b, jump); -} - - -static void discharge2reg (FuncState *fs, expdesc *e, int reg) { - luaK_dischargevars(fs, e); - switch (e->k) { - case VNIL: { - luaK_nil(fs, reg, 1); - break; - } - case VFALSE: case VTRUE: { - luaK_codeABC(fs, OP_LOADBOOL, reg, e->k == VTRUE, 0); - break; - } - case VK: { - luaK_codeABx(fs, OP_LOADK, reg, e->u.s.info); - break; - } - case VKNUM: { - luaK_codeABx(fs, OP_LOADK, reg, luaK_numberK(fs, e->u.nval)); - break; - } - case VRELOCABLE: { - Instruction *pc = &getcode(fs, e); - SETARG_A(*pc, reg); - break; - } - case VNONRELOC: { - if (reg != e->u.s.info) - luaK_codeABC(fs, OP_MOVE, reg, e->u.s.info, 0); - break; - } - default: { - lua_assert(e->k == VVOID || e->k == VJMP); - return; /* nothing to do... */ - } - } - e->u.s.info = reg; - e->k = VNONRELOC; -} - - -static void discharge2anyreg (FuncState *fs, expdesc *e) { - if (e->k != VNONRELOC) { - luaK_reserveregs(fs, 1); - discharge2reg(fs, e, fs->freereg-1); - } -} - - -static void exp2reg (FuncState *fs, expdesc *e, int reg) { - discharge2reg(fs, e, reg); - if (e->k == VJMP) - luaK_concat(fs, &e->t, e->u.s.info); /* put this jump in `t' list */ - if (hasjumps(e)) { - int final; /* position after whole expression */ - int p_f = NO_JUMP; /* position of an eventual LOAD false */ - int p_t = NO_JUMP; /* position of an eventual LOAD true */ - if (need_value(fs, e->t) || need_value(fs, e->f)) { - int fj = (e->k == VJMP) ? NO_JUMP : luaK_jump(fs); - p_f = code_label(fs, reg, 0, 1); - p_t = code_label(fs, reg, 1, 0); - luaK_patchtohere(fs, fj); - } - final = luaK_getlabel(fs); - patchlistaux(fs, e->f, final, reg, p_f); - patchlistaux(fs, e->t, final, reg, p_t); - } - e->f = e->t = NO_JUMP; - e->u.s.info = reg; - e->k = VNONRELOC; -} - - -void luaK_exp2nextreg (FuncState *fs, expdesc *e) { - luaK_dischargevars(fs, e); - freeexp(fs, e); - luaK_reserveregs(fs, 1); - exp2reg(fs, e, fs->freereg - 1); -} - - -int luaK_exp2anyreg (FuncState *fs, expdesc *e) { - luaK_dischargevars(fs, e); - if (e->k == VNONRELOC) { - if (!hasjumps(e)) return e->u.s.info; /* exp is already in a register */ - if (e->u.s.info >= fs->nactvar) { /* reg. is not a local? */ - exp2reg(fs, e, e->u.s.info); /* put value on it */ - return e->u.s.info; - } - } - luaK_exp2nextreg(fs, e); /* default */ - return e->u.s.info; -} - - -void luaK_exp2val (FuncState *fs, expdesc *e) { - if (hasjumps(e)) - luaK_exp2anyreg(fs, e); - else - luaK_dischargevars(fs, e); -} - - -int luaK_exp2RK (FuncState *fs, expdesc *e) { - luaK_exp2val(fs, e); - switch (e->k) { - case VKNUM: - case VTRUE: - case VFALSE: - case VNIL: { - if (fs->nk <= MAXINDEXRK) { /* constant fit in RK operand? */ - e->u.s.info = (e->k == VNIL) ? nilK(fs) : - (e->k == VKNUM) ? luaK_numberK(fs, e->u.nval) : - boolK(fs, (e->k == VTRUE)); - e->k = VK; - return RKASK(e->u.s.info); - } - else break; - } - case VK: { - if (e->u.s.info <= MAXINDEXRK) /* constant fit in argC? */ - return RKASK(e->u.s.info); - else break; - } - default: break; - } - /* not a constant in the right range: put it in a register */ - return luaK_exp2anyreg(fs, e); -} - - -void luaK_storevar (FuncState *fs, expdesc *var, expdesc *ex) { - switch (var->k) { - case VLOCAL: { - freeexp(fs, ex); - exp2reg(fs, ex, var->u.s.info); - return; - } - case VUPVAL: { - int e = luaK_exp2anyreg(fs, ex); - luaK_codeABC(fs, OP_SETUPVAL, e, var->u.s.info, 0); - break; - } - case VGLOBAL: { - int e = luaK_exp2anyreg(fs, ex); - luaK_codeABx(fs, OP_SETGLOBAL, e, var->u.s.info); - break; - } - case VINDEXED: { - int e = luaK_exp2RK(fs, ex); - luaK_codeABC(fs, OP_SETTABLE, var->u.s.info, var->u.s.aux, e); - break; - } - default: { - lua_assert(0); /* invalid var kind to store */ - break; - } - } - freeexp(fs, ex); -} - - -void luaK_self (FuncState *fs, expdesc *e, expdesc *key) { - int func; - luaK_exp2anyreg(fs, e); - freeexp(fs, e); - func = fs->freereg; - luaK_reserveregs(fs, 2); - luaK_codeABC(fs, OP_SELF, func, e->u.s.info, luaK_exp2RK(fs, key)); - freeexp(fs, key); - e->u.s.info = func; - e->k = VNONRELOC; -} - - -static void invertjump (FuncState *fs, expdesc *e) { - Instruction *pc = getjumpcontrol(fs, e->u.s.info); - lua_assert(testTMode(GET_OPCODE(*pc)) && GET_OPCODE(*pc) != OP_TESTSET && - GET_OPCODE(*pc) != OP_TEST); - SETARG_A(*pc, !(GETARG_A(*pc))); -} - - -static int jumponcond (FuncState *fs, expdesc *e, int cond) { - if (e->k == VRELOCABLE) { - Instruction ie = getcode(fs, e); - if (GET_OPCODE(ie) == OP_NOT) { - fs->pc--; /* remove previous OP_NOT */ - return condjump(fs, OP_TEST, GETARG_B(ie), 0, !cond); - } - /* else go through */ - } - discharge2anyreg(fs, e); - freeexp(fs, e); - return condjump(fs, OP_TESTSET, NO_REG, e->u.s.info, cond); -} - - -void luaK_goiftrue (FuncState *fs, expdesc *e) { - int pc; /* pc of last jump */ - luaK_dischargevars(fs, e); - switch (e->k) { - case VK: case VKNUM: case VTRUE: { - pc = NO_JUMP; /* always true; do nothing */ - break; - } - case VFALSE: { - pc = luaK_jump(fs); /* always jump */ - break; - } - case VJMP: { - invertjump(fs, e); - pc = e->u.s.info; - break; - } - default: { - pc = jumponcond(fs, e, 0); - break; - } - } - luaK_concat(fs, &e->f, pc); /* insert last jump in `f' list */ - luaK_patchtohere(fs, e->t); - e->t = NO_JUMP; -} - - -static void luaK_goiffalse (FuncState *fs, expdesc *e) { - int pc; /* pc of last jump */ - luaK_dischargevars(fs, e); - switch (e->k) { - case VNIL: case VFALSE: { - pc = NO_JUMP; /* always false; do nothing */ - break; - } - case VTRUE: { - pc = luaK_jump(fs); /* always jump */ - break; - } - case VJMP: { - pc = e->u.s.info; - break; - } - default: { - pc = jumponcond(fs, e, 1); - break; - } - } - luaK_concat(fs, &e->t, pc); /* insert last jump in `t' list */ - luaK_patchtohere(fs, e->f); - e->f = NO_JUMP; -} - - -static void codenot (FuncState *fs, expdesc *e) { - luaK_dischargevars(fs, e); - switch (e->k) { - case VNIL: case VFALSE: { - e->k = VTRUE; - break; - } - case VK: case VKNUM: case VTRUE: { - e->k = VFALSE; - break; - } - case VJMP: { - invertjump(fs, e); - break; - } - case VRELOCABLE: - case VNONRELOC: { - discharge2anyreg(fs, e); - freeexp(fs, e); - e->u.s.info = luaK_codeABC(fs, OP_NOT, 0, e->u.s.info, 0); - e->k = VRELOCABLE; - break; - } - default: { - lua_assert(0); /* cannot happen */ - break; - } - } - /* interchange true and false lists */ - { int temp = e->f; e->f = e->t; e->t = temp; } - removevalues(fs, e->f); - removevalues(fs, e->t); -} - - -void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k) { - t->u.s.aux = luaK_exp2RK(fs, k); - t->k = VINDEXED; -} - - -static int constfolding (OpCode op, expdesc *e1, expdesc *e2) { - lua_Number v1, v2, r; - if (!isnumeral(e1) || !isnumeral(e2)) return 0; - v1 = e1->u.nval; - v2 = e2->u.nval; - switch (op) { - case OP_ADD: r = luai_numadd(v1, v2); break; - case OP_SUB: r = luai_numsub(v1, v2); break; - case OP_MUL: r = luai_nummul(v1, v2); break; - case OP_DIV: - if (v2 == 0) return 0; /* do not attempt to divide by 0 */ - r = luai_numdiv(v1, v2); break; - case OP_MOD: - if (v2 == 0) return 0; /* do not attempt to divide by 0 */ - r = luai_nummod(v1, v2); break; - case OP_POW: r = luai_numpow(v1, v2); break; - case OP_UNM: r = luai_numunm(v1); break; - case OP_LEN: return 0; /* no constant folding for 'len' */ - default: lua_assert(0); r = 0; break; - } - if (luai_numisnan(r)) return 0; /* do not attempt to produce NaN */ - e1->u.nval = r; - return 1; -} - - -static void codearith (FuncState *fs, OpCode op, expdesc *e1, expdesc *e2) { - if (constfolding(op, e1, e2)) - return; - else { - int o2 = (op != OP_UNM && op != OP_LEN) ? luaK_exp2RK(fs, e2) : 0; - int o1 = luaK_exp2RK(fs, e1); - if (o1 > o2) { - freeexp(fs, e1); - freeexp(fs, e2); - } - else { - freeexp(fs, e2); - freeexp(fs, e1); - } - e1->u.s.info = luaK_codeABC(fs, op, 0, o1, o2); - e1->k = VRELOCABLE; - } -} - - -static void codecomp (FuncState *fs, OpCode op, int cond, expdesc *e1, - expdesc *e2) { - int o1 = luaK_exp2RK(fs, e1); - int o2 = luaK_exp2RK(fs, e2); - freeexp(fs, e2); - freeexp(fs, e1); - if (cond == 0 && op != OP_EQ) { - int temp; /* exchange args to replace by `<' or `<=' */ - temp = o1; o1 = o2; o2 = temp; /* o1 <==> o2 */ - cond = 1; - } - e1->u.s.info = condjump(fs, op, cond, o1, o2); - e1->k = VJMP; -} - - -void luaK_prefix (FuncState *fs, UnOpr op, expdesc *e) { - expdesc e2; - e2.t = e2.f = NO_JUMP; e2.k = VKNUM; e2.u.nval = 0; - switch (op) { - case OPR_MINUS: { - if (!isnumeral(e)) - luaK_exp2anyreg(fs, e); /* cannot operate on non-numeric constants */ - codearith(fs, OP_UNM, e, &e2); - break; - } - case OPR_NOT: codenot(fs, e); break; - case OPR_LEN: { - luaK_exp2anyreg(fs, e); /* cannot operate on constants */ - codearith(fs, OP_LEN, e, &e2); - break; - } - default: lua_assert(0); - } -} - - -void luaK_infix (FuncState *fs, BinOpr op, expdesc *v) { - switch (op) { - case OPR_AND: { - luaK_goiftrue(fs, v); - break; - } - case OPR_OR: { - luaK_goiffalse(fs, v); - break; - } - case OPR_CONCAT: { - luaK_exp2nextreg(fs, v); /* operand must be on the `stack' */ - break; - } - case OPR_ADD: case OPR_SUB: case OPR_MUL: case OPR_DIV: - case OPR_MOD: case OPR_POW: { - if (!isnumeral(v)) luaK_exp2RK(fs, v); - break; - } - default: { - luaK_exp2RK(fs, v); - break; - } - } -} - - -void luaK_posfix (FuncState *fs, BinOpr op, expdesc *e1, expdesc *e2) { - switch (op) { - case OPR_AND: { - lua_assert(e1->t == NO_JUMP); /* list must be closed */ - luaK_dischargevars(fs, e2); - luaK_concat(fs, &e2->f, e1->f); -#if 0 - *e1 = *e2; -#else - memcpy (e1, e2, sizeof (*e1)); -#endif - break; - } - case OPR_OR: { - lua_assert(e1->f == NO_JUMP); /* list must be closed */ - luaK_dischargevars(fs, e2); - luaK_concat(fs, &e2->t, e1->t); -#if 0 - *e1 = *e2; -#else - memcpy (e1, e2, sizeof (*e1)); -#endif - break; - } - case OPR_CONCAT: { - luaK_exp2val(fs, e2); - if (e2->k == VRELOCABLE && GET_OPCODE(getcode(fs, e2)) == OP_CONCAT) { - lua_assert(e1->u.s.info == GETARG_B(getcode(fs, e2))-1); - freeexp(fs, e1); - SETARG_B(getcode(fs, e2), e1->u.s.info); - e1->k = VRELOCABLE; e1->u.s.info = e2->u.s.info; - } - else { - luaK_exp2nextreg(fs, e2); /* operand must be on the 'stack' */ - codearith(fs, OP_CONCAT, e1, e2); - } - break; - } - case OPR_ADD: codearith(fs, OP_ADD, e1, e2); break; - case OPR_SUB: codearith(fs, OP_SUB, e1, e2); break; - case OPR_MUL: codearith(fs, OP_MUL, e1, e2); break; - case OPR_DIV: codearith(fs, OP_DIV, e1, e2); break; - case OPR_MOD: codearith(fs, OP_MOD, e1, e2); break; - case OPR_POW: codearith(fs, OP_POW, e1, e2); break; - case OPR_EQ: codecomp(fs, OP_EQ, 1, e1, e2); break; - case OPR_NE: codecomp(fs, OP_EQ, 0, e1, e2); break; - case OPR_LT: codecomp(fs, OP_LT, 1, e1, e2); break; - case OPR_LE: codecomp(fs, OP_LE, 1, e1, e2); break; - case OPR_GT: codecomp(fs, OP_LT, 0, e1, e2); break; - case OPR_GE: codecomp(fs, OP_LE, 0, e1, e2); break; - default: lua_assert(0); - } -} - - -void luaK_fixline (FuncState *fs, int line) { - fs->f->lineinfo[fs->pc - 1] = line; -} - - -static int luaK_code (FuncState *fs, Instruction i, int line) { - Proto *f = fs->f; - dischargejpc(fs); /* `pc' will change */ - /* put new instruction in code array */ - luaM_growvector(fs->L, f->code, fs->pc, f->sizecode, Instruction, - MAX_INT, "code size overflow"); - f->code[fs->pc] = i; - /* save corresponding line information */ - luaM_growvector(fs->L, f->lineinfo, fs->pc, f->sizelineinfo, int, - MAX_INT, "code size overflow"); - f->lineinfo[fs->pc] = line; - return fs->pc++; -} - - -int luaK_codeABC (FuncState *fs, OpCode o, int a, int b, int c) { - lua_assert(getOpMode(o) == iABC); - lua_assert(getBMode(o) != OpArgN || b == 0); - lua_assert(getCMode(o) != OpArgN || c == 0); - return luaK_code(fs, CREATE_ABC(o, a, b, c), fs->ls->lastline); -} - - -int luaK_codeABx (FuncState *fs, OpCode o, int a, unsigned int bc) { - lua_assert(getOpMode(o) == iABx || getOpMode(o) == iAsBx); - lua_assert(getCMode(o) == OpArgN); - return luaK_code(fs, CREATE_ABx(o, a, bc), fs->ls->lastline); -} - - -void luaK_setlist (FuncState *fs, int base, int nelems, int tostore) { - int c = (nelems - 1)/LFIELDS_PER_FLUSH + 1; - int b = (tostore == LUA_MULTRET) ? 0 : tostore; - lua_assert(tostore != 0); - if (c <= MAXARG_C) - luaK_codeABC(fs, OP_SETLIST, base, b, c); - else { - luaK_codeABC(fs, OP_SETLIST, base, b, 0); - luaK_code(fs, cast(Instruction, c), fs->ls->lastline); - } - fs->freereg = base + 1; /* free registers with list values */ -} - diff --git a/script/lua/lcode.h b/script/lua/lcode.h deleted file mode 100644 index b941c6072..000000000 --- a/script/lua/lcode.h +++ /dev/null @@ -1,76 +0,0 @@ -/* -** $Id: lcode.h,v 1.48.1.1 2007/12/27 13:02:25 roberto Exp $ -** Code generator for Lua -** See Copyright Notice in lua.h -*/ - -#ifndef lcode_h -#define lcode_h - -#include "llex.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lparser.h" - - -/* -** Marks the end of a patch list. It is an invalid value both as an absolute -** address, and as a list link (would link an element to itself). -*/ -#define NO_JUMP (-1) - - -/* -** grep "ORDER OPR" if you change these enums -*/ -typedef enum BinOpr { - OPR_ADD, OPR_SUB, OPR_MUL, OPR_DIV, OPR_MOD, OPR_POW, - OPR_CONCAT, - OPR_NE, OPR_EQ, - OPR_LT, OPR_LE, OPR_GT, OPR_GE, - OPR_AND, OPR_OR, - OPR_NOBINOPR -} BinOpr; - - -typedef enum UnOpr { OPR_MINUS, OPR_NOT, OPR_LEN, OPR_NOUNOPR } UnOpr; - - -#define getcode(fs,e) ((fs)->f->code[(e)->u.s.info]) - -#define luaK_codeAsBx(fs,o,A,sBx) luaK_codeABx(fs,o,A,(sBx)+MAXARG_sBx) - -#define luaK_setmultret(fs,e) luaK_setreturns(fs, e, LUA_MULTRET) - -LUAI_FUNC int luaK_codeABx (FuncState *fs, OpCode o, int A, unsigned int Bx); -LUAI_FUNC int luaK_codeABC (FuncState *fs, OpCode o, int A, int B, int C); -LUAI_FUNC void luaK_fixline (FuncState *fs, int line); -LUAI_FUNC void luaK_nil (FuncState *fs, int from, int n); -LUAI_FUNC void luaK_reserveregs (FuncState *fs, int n); -LUAI_FUNC void luaK_checkstack (FuncState *fs, int n); -LUAI_FUNC int luaK_stringK (FuncState *fs, TString *s); -LUAI_FUNC int luaK_numberK (FuncState *fs, lua_Number r); -LUAI_FUNC void luaK_dischargevars (FuncState *fs, expdesc *e); -LUAI_FUNC int luaK_exp2anyreg (FuncState *fs, expdesc *e); -LUAI_FUNC void luaK_exp2nextreg (FuncState *fs, expdesc *e); -LUAI_FUNC void luaK_exp2val (FuncState *fs, expdesc *e); -LUAI_FUNC int luaK_exp2RK (FuncState *fs, expdesc *e); -LUAI_FUNC void luaK_self (FuncState *fs, expdesc *e, expdesc *key); -LUAI_FUNC void luaK_indexed (FuncState *fs, expdesc *t, expdesc *k); -LUAI_FUNC void luaK_goiftrue (FuncState *fs, expdesc *e); -LUAI_FUNC void luaK_storevar (FuncState *fs, expdesc *var, expdesc *e); -LUAI_FUNC void luaK_setreturns (FuncState *fs, expdesc *e, int nresults); -LUAI_FUNC void luaK_setoneret (FuncState *fs, expdesc *e); -LUAI_FUNC int luaK_jump (FuncState *fs); -LUAI_FUNC void luaK_ret (FuncState *fs, int first, int nret); -LUAI_FUNC void luaK_patchlist (FuncState *fs, int list, int target); -LUAI_FUNC void luaK_patchtohere (FuncState *fs, int list); -LUAI_FUNC void luaK_concat (FuncState *fs, int *l1, int l2); -LUAI_FUNC int luaK_getlabel (FuncState *fs); -LUAI_FUNC void luaK_prefix (FuncState *fs, UnOpr op, expdesc *v); -LUAI_FUNC void luaK_infix (FuncState *fs, BinOpr op, expdesc *v); -LUAI_FUNC void luaK_posfix (FuncState *fs, BinOpr op, expdesc *v1, expdesc *v2); -LUAI_FUNC void luaK_setlist (FuncState *fs, int base, int nelems, int tostore); - - -#endif diff --git a/script/lua/ldblib.c b/script/lua/ldblib.c deleted file mode 100644 index c1c2d89db..000000000 --- a/script/lua/ldblib.c +++ /dev/null @@ -1,398 +0,0 @@ -/* -** $Id: ldblib.c,v 1.104.1.3 2008/01/21 13:11:21 roberto Exp $ -** Interface from Lua to its debug API -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#endif - -#define ldblib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - - -static int db_getregistry (lua_State *L) { - lua_pushvalue(L, LUA_REGISTRYINDEX); - return 1; -} - - -static int db_getmetatable (lua_State *L) { - luaL_checkany(L, 1); - if (!lua_getmetatable(L, 1)) { - lua_pushnil(L); /* no metatable */ - } - return 1; -} - - -static int db_setmetatable (lua_State *L) { - int t = lua_type(L, 2); - luaL_argcheck(L, t == LUA_TNIL || t == LUA_TTABLE, 2, - "nil or table expected"); - lua_settop(L, 2); - lua_pushboolean(L, lua_setmetatable(L, 1)); - return 1; -} - - -static int db_getfenv (lua_State *L) { - lua_getfenv(L, 1); - return 1; -} - - -static int db_setfenv (lua_State *L) { - luaL_checktype(L, 2, LUA_TTABLE); - lua_settop(L, 2); - if (lua_setfenv(L, 1) == 0) - luaL_error(L, LUA_QL("setfenv") - " cannot change environment of given object"); - return 1; -} - - -static void settabss (lua_State *L, const char *i, const char *v) { - lua_pushstring(L, v); - lua_setfield(L, -2, i); -} - - -static void settabsi (lua_State *L, const char *i, int v) { - lua_pushinteger(L, v); - lua_setfield(L, -2, i); -} - - -static lua_State *getthread (lua_State *L, int *arg) { - if (lua_isthread(L, 1)) { - *arg = 1; - return lua_tothread(L, 1); - } - else { - *arg = 0; - return L; - } -} - - -static void treatstackoption (lua_State *L, lua_State *L1, const char *fname) { - if (L == L1) { - lua_pushvalue(L, -2); - lua_remove(L, -3); - } - else - lua_xmove(L1, L, 1); - lua_setfield(L, -2, fname); -} - - -static int db_getinfo (lua_State *L) { - lua_Debug ar; - int arg; - lua_State *L1 = getthread(L, &arg); - const char *options = luaL_optstring(L, arg+2, "flnSu"); - if (lua_isnumber(L, arg+1)) { - if (!lua_getstack(L1, (int)lua_tointeger(L, arg+1), &ar)) { - lua_pushnil(L); /* level out of range */ - return 1; - } - } - else if (lua_isfunction(L, arg+1)) { - lua_pushfstring(L, ">%s", options); - options = lua_tostring(L, -1); - lua_pushvalue(L, arg+1); - lua_xmove(L, L1, 1); - } - else - return luaL_argerror(L, arg+1, "function or level expected"); - if (!lua_getinfo(L1, options, &ar)) - return luaL_argerror(L, arg+2, "invalid option"); - lua_createtable(L, 0, 2); - if (strchr(options, 'S')) { - settabss(L, "source", ar.source); - settabss(L, "short_src", ar.short_src); - settabsi(L, "linedefined", ar.linedefined); - settabsi(L, "lastlinedefined", ar.lastlinedefined); - settabss(L, "what", ar.what); - } - if (strchr(options, 'l')) - settabsi(L, "currentline", ar.currentline); - if (strchr(options, 'u')) - settabsi(L, "nups", ar.nups); - if (strchr(options, 'n')) { - settabss(L, "name", ar.name); - settabss(L, "namewhat", ar.namewhat); - } - if (strchr(options, 'L')) - treatstackoption(L, L1, "activelines"); - if (strchr(options, 'f')) - treatstackoption(L, L1, "func"); - return 1; /* return table */ -} - - -static int db_getlocal (lua_State *L) { - int arg; - lua_State *L1 = getthread(L, &arg); - lua_Debug ar; - const char *name; - if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ - return luaL_argerror(L, arg+1, "level out of range"); - name = lua_getlocal(L1, &ar, luaL_checkint(L, arg+2)); - if (name) { - lua_xmove(L1, L, 1); - lua_pushstring(L, name); - lua_pushvalue(L, -2); - return 2; - } - else { - lua_pushnil(L); - return 1; - } -} - - -static int db_setlocal (lua_State *L) { - int arg; - lua_State *L1 = getthread(L, &arg); - lua_Debug ar; - if (!lua_getstack(L1, luaL_checkint(L, arg+1), &ar)) /* out of range? */ - return luaL_argerror(L, arg+1, "level out of range"); - luaL_checkany(L, arg+3); - lua_settop(L, arg+3); - lua_xmove(L, L1, 1); - lua_pushstring(L, lua_setlocal(L1, &ar, luaL_checkint(L, arg+2))); - return 1; -} - - -static int auxupvalue (lua_State *L, int get) { - const char *name; - int n = luaL_checkint(L, 2); - luaL_checktype(L, 1, LUA_TFUNCTION); - if (lua_iscfunction(L, 1)) return 0; /* cannot touch C upvalues from Lua */ - name = get ? lua_getupvalue(L, 1, n) : lua_setupvalue(L, 1, n); - if (name == NULL) return 0; - lua_pushstring(L, name); - lua_insert(L, -(get+1)); - return get + 1; -} - - -static int db_getupvalue (lua_State *L) { - return auxupvalue(L, 1); -} - - -static int db_setupvalue (lua_State *L) { - luaL_checkany(L, 3); - return auxupvalue(L, 0); -} - - - -static const char KEY_HOOK = 'h'; - - -static void hookf (lua_State *L, lua_Debug *ar) { - static const char *const hooknames[] = - {"call", "return", "line", "count", "tail return"}; - lua_pushlightuserdata(L, (void *)&KEY_HOOK); - lua_rawget(L, LUA_REGISTRYINDEX); - lua_pushlightuserdata(L, L); - lua_rawget(L, -2); - if (lua_isfunction(L, -1)) { - lua_pushstring(L, hooknames[(int)ar->event]); - if (ar->currentline >= 0) - lua_pushinteger(L, ar->currentline); - else lua_pushnil(L); - lua_assert(lua_getinfo(L, "lS", ar)); - lua_call(L, 2, 0); - } -} - - -static int makemask (const char *smask, int count) { - int mask = 0; - if (strchr(smask, 'c')) mask |= LUA_MASKCALL; - if (strchr(smask, 'r')) mask |= LUA_MASKRET; - if (strchr(smask, 'l')) mask |= LUA_MASKLINE; - if (count > 0) mask |= LUA_MASKCOUNT; - return mask; -} - - -static char *unmakemask (int mask, char *smask) { - int i = 0; - if (mask & LUA_MASKCALL) smask[i++] = 'c'; - if (mask & LUA_MASKRET) smask[i++] = 'r'; - if (mask & LUA_MASKLINE) smask[i++] = 'l'; - smask[i] = '\0'; - return smask; -} - - -static void gethooktable (lua_State *L) { - lua_pushlightuserdata(L, (void *)&KEY_HOOK); - lua_rawget(L, LUA_REGISTRYINDEX); - if (!lua_istable(L, -1)) { - lua_pop(L, 1); - lua_createtable(L, 0, 1); - lua_pushlightuserdata(L, (void *)&KEY_HOOK); - lua_pushvalue(L, -2); - lua_rawset(L, LUA_REGISTRYINDEX); - } -} - - -static int db_sethook (lua_State *L) { - int arg, mask, count; - lua_Hook func; - lua_State *L1 = getthread(L, &arg); - if (lua_isnoneornil(L, arg+1)) { - lua_settop(L, arg+1); - func = NULL; mask = 0; count = 0; /* turn off hooks */ - } - else { - const char *smask = luaL_checkstring(L, arg+2); - luaL_checktype(L, arg+1, LUA_TFUNCTION); - count = luaL_optint(L, arg+3, 0); - func = hookf; mask = makemask(smask, count); - } - gethooktable(L); - lua_pushlightuserdata(L, L1); - lua_pushvalue(L, arg+1); - lua_rawset(L, -3); /* set new hook */ - lua_pop(L, 1); /* remove hook table */ - lua_sethook(L1, func, mask, count); /* set hooks */ - return 0; -} - - -static int db_gethook (lua_State *L) { - int arg; - lua_State *L1 = getthread(L, &arg); - char buff[5]; - int mask = lua_gethookmask(L1); - lua_Hook hook = lua_gethook(L1); - if (hook != NULL && hook != hookf) /* external hook? */ - lua_pushliteral(L, "external hook"); - else { - gethooktable(L); - lua_pushlightuserdata(L, L1); - lua_rawget(L, -2); /* get hook */ - lua_remove(L, -2); /* remove hook table */ - } - lua_pushstring(L, unmakemask(mask, buff)); - lua_pushinteger(L, lua_gethookcount(L1)); - return 3; -} - - -static int db_debug (lua_State *L) { - for (;;) { - char buffer[250]; - fputs("lua_debug> ", stderr); - if (fgets(buffer, sizeof(buffer), stdin) == 0 || - strcmp(buffer, "cont\n") == 0) - return 0; - if (luaL_loadbuffer(L, buffer, strlen(buffer), "=(debug command)") || - lua_pcall(L, 0, 0, 0)) { - fputs(lua_tostring(L, -1), stderr); - fputs("\n", stderr); - } - lua_settop(L, 0); /* remove eventual returns */ - } -} - - -#define LEVELS1 12 /* size of the first part of the stack */ -#define LEVELS2 10 /* size of the second part of the stack */ - -static int db_errorfb (lua_State *L) { - int level; - int firstpart = 1; /* still before eventual `...' */ - int arg; - lua_State *L1 = getthread(L, &arg); - lua_Debug ar; - if (lua_isnumber(L, arg+2)) { - level = (int)lua_tointeger(L, arg+2); - lua_pop(L, 1); - } - else - level = (L == L1) ? 1 : 0; /* level 0 may be this own function */ - if (lua_gettop(L) == arg) - lua_pushliteral(L, ""); - else if (!lua_isstring(L, arg+1)) return 1; /* message is not a string */ - else lua_pushliteral(L, "\n"); - lua_pushliteral(L, "stack traceback:"); - while (lua_getstack(L1, level++, &ar)) { - if (level > LEVELS1 && firstpart) { - /* no more than `LEVELS2' more levels? */ - if (!lua_getstack(L1, level+LEVELS2, &ar)) - level--; /* keep going */ - else { - lua_pushliteral(L, "\n\t..."); /* too many levels */ - while (lua_getstack(L1, level+LEVELS2, &ar)) /* find last levels */ - level++; - } - firstpart = 0; - continue; - } - lua_pushliteral(L, "\n\t"); - lua_getinfo(L1, "Snl", &ar); - lua_pushfstring(L, "%s:", ar.short_src); - if (ar.currentline > 0) - lua_pushfstring(L, "%d:", ar.currentline); - if (*ar.namewhat != '\0') /* is there a name? */ - lua_pushfstring(L, " in function " LUA_QS, ar.name); - else { - if (*ar.what == 'm') /* main? */ - lua_pushfstring(L, " in main chunk"); - else if (*ar.what == 'C' || *ar.what == 't') - lua_pushliteral(L, " ?"); /* C function or tail call */ - else - lua_pushfstring(L, " in function <%s:%d>", - ar.short_src, ar.linedefined); - } - lua_concat(L, lua_gettop(L) - arg); - } - lua_concat(L, lua_gettop(L) - arg); - return 1; -} - - -static const luaL_Reg dblib[] = { - {"debug", db_debug}, - {"getfenv", db_getfenv}, - {"gethook", db_gethook}, - {"getinfo", db_getinfo}, - {"getlocal", db_getlocal}, - {"getregistry", db_getregistry}, - {"getmetatable", db_getmetatable}, - {"getupvalue", db_getupvalue}, - {"setfenv", db_setfenv}, - {"sethook", db_sethook}, - {"setlocal", db_setlocal}, - {"setmetatable", db_setmetatable}, - {"setupvalue", db_setupvalue}, - {"traceback", db_errorfb}, - {NULL, NULL} -}; - - -LUALIB_API int luaopen_debug (lua_State *L) { - luaL_register(L, LUA_DBLIBNAME, dblib); - return 1; -} - diff --git a/script/lua/ldebug.c b/script/lua/ldebug.c deleted file mode 100644 index 25e790c4d..000000000 --- a/script/lua/ldebug.c +++ /dev/null @@ -1,638 +0,0 @@ -/* -** $Id: ldebug.c,v 2.29.1.6 2008/05/08 16:56:26 roberto Exp $ -** Debug Interface -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#endif - -#define ldebug_c -#define LUA_CORE - -#include "lua.h" - -#include "lapi.h" -#include "lcode.h" -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" -#include "lvm.h" - - - -static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name); - - -static int currentpc (lua_State *L, CallInfo *ci) { - if (!isLua(ci)) return -1; /* function is not a Lua function? */ - if (ci == L->ci) - ci->savedpc = L->savedpc; - return pcRel(ci->savedpc, ci_func(ci)->l.p); -} - - -static int currentline (lua_State *L, CallInfo *ci) { - int pc = currentpc(L, ci); - if (pc < 0) - return -1; /* only active lua functions have current-line information */ - else - return getline(ci_func(ci)->l.p, pc); -} - - -/* -** this function can be called asynchronous (e.g. during a signal) -*/ -LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count) { - if (func == NULL || mask == 0) { /* turn off hooks? */ - mask = 0; - func = NULL; - } - L->hook = func; - L->basehookcount = count; - resethookcount(L); - L->hookmask = cast_byte(mask); - return 1; -} - - -LUA_API lua_Hook lua_gethook (lua_State *L) { - return L->hook; -} - - -LUA_API int lua_gethookmask (lua_State *L) { - return L->hookmask; -} - - -LUA_API int lua_gethookcount (lua_State *L) { - return L->basehookcount; -} - - -LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar) { - int status; - CallInfo *ci; - lua_lock(L); - for (ci = L->ci; level > 0 && ci > L->base_ci; ci--) { - level--; - if (f_isLua(ci)) /* Lua function? */ - level -= ci->tailcalls; /* skip lost tail calls */ - } - if (level == 0 && ci > L->base_ci) { /* level found? */ - status = 1; - ar->i_ci = cast_int(ci - L->base_ci); - } - else if (level < 0) { /* level is of a lost tail call? */ - status = 1; - ar->i_ci = 0; - } - else status = 0; /* no such level */ - lua_unlock(L); - return status; -} - - -static Proto *getluaproto (CallInfo *ci) { - return (isLua(ci) ? ci_func(ci)->l.p : NULL); -} - - -static const char *findlocal (lua_State *L, CallInfo *ci, int n) { - const char *name; - Proto *fp = getluaproto(ci); - if (fp && (name = luaF_getlocalname(fp, n, currentpc(L, ci))) != NULL) - return name; /* is a local variable in a Lua function */ - else { - StkId limit = (ci == L->ci) ? L->top : (ci+1)->func; - if (limit - ci->base >= n && n > 0) /* is 'n' inside 'ci' stack? */ - return "(*temporary)"; - else - return NULL; - } -} - - -LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n) { - CallInfo *ci = L->base_ci + ar->i_ci; - const char *name = findlocal(L, ci, n); - lua_lock(L); - if (name) - luaA_pushobject(L, ci->base + (n - 1)); - lua_unlock(L); - return name; -} - - -LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n) { - CallInfo *ci = L->base_ci + ar->i_ci; - const char *name = findlocal(L, ci, n); - lua_lock(L); - if (name) - setobjs2s(L, ci->base + (n - 1), L->top - 1); - L->top--; /* pop value */ - lua_unlock(L); - return name; -} - - -static void funcinfo (lua_Debug *ar, Closure *cl) { - if (cl->c.isC) { - ar->source = "=[C]"; - ar->linedefined = -1; - ar->lastlinedefined = -1; - ar->what = "C"; - } - else { - ar->source = getstr(cl->l.p->source); - ar->linedefined = cl->l.p->linedefined; - ar->lastlinedefined = cl->l.p->lastlinedefined; - ar->what = (ar->linedefined == 0) ? "main" : "Lua"; - } - luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); -} - - -static void info_tailcall (lua_Debug *ar) { - ar->name = ar->namewhat = ""; - ar->what = "tail"; - ar->lastlinedefined = ar->linedefined = ar->currentline = -1; - ar->source = "=(tail call)"; - luaO_chunkid(ar->short_src, ar->source, LUA_IDSIZE); - ar->nups = 0; -} - - -static void collectvalidlines (lua_State *L, Closure *f) { - if (f == NULL || f->c.isC) { - setnilvalue(L->top); - } - else { - Table *t = luaH_new(L, 0, 0); - int *lineinfo = f->l.p->lineinfo; - int i; - for (i=0; il.p->sizelineinfo; i++) - setbvalue(luaH_setnum(L, t, lineinfo[i]), 1); - sethvalue(L, L->top, t); - } - incr_top(L); -} - - -static int auxgetinfo (lua_State *L, const char *what, lua_Debug *ar, - Closure *f, CallInfo *ci) { - int status = 1; - if (f == NULL) { - info_tailcall(ar); - return status; - } - for (; *what; what++) { - switch (*what) { - case 'S': { - funcinfo(ar, f); - break; - } - case 'l': { - ar->currentline = (ci) ? currentline(L, ci) : -1; - break; - } - case 'u': { - ar->nups = f->c.nupvalues; - break; - } - case 'n': { - ar->namewhat = (ci) ? getfuncname(L, ci, &ar->name) : NULL; - if (ar->namewhat == NULL) { - ar->namewhat = ""; /* not found */ - ar->name = NULL; - } - break; - } - case 'L': - case 'f': /* handled by lua_getinfo */ - break; - default: status = 0; /* invalid option */ - } - } - return status; -} - - -LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar) { - int status; - Closure *f = NULL; - CallInfo *ci = NULL; - lua_lock(L); - if (*what == '>') { - StkId func = L->top - 1; - luai_apicheck(L, ttisfunction(func)); - what++; /* skip the '>' */ - f = clvalue(func); - L->top--; /* pop function */ - } - else if (ar->i_ci != 0) { /* no tail call? */ - ci = L->base_ci + ar->i_ci; - lua_assert(ttisfunction(ci->func)); - f = clvalue(ci->func); - } - status = auxgetinfo(L, what, ar, f, ci); - if (strchr(what, 'f')) { - if (f == NULL) setnilvalue(L->top); - else setclvalue(L, L->top, f); - incr_top(L); - } - if (strchr(what, 'L')) - collectvalidlines(L, f); - lua_unlock(L); - return status; -} - - -/* -** {====================================================== -** Symbolic Execution and code checker -** ======================================================= -*/ - -#define check(x) if (!(x)) return 0; - -#define checkjump(pt,pc) check(0 <= pc && pc < pt->sizecode) - -#define checkreg(pt,reg) check((reg) < (pt)->maxstacksize) - - - -static int precheck (const Proto *pt) { - check(pt->maxstacksize <= MAXSTACK); - check(pt->numparams+(pt->is_vararg & VARARG_HASARG) <= pt->maxstacksize); - check(!(pt->is_vararg & VARARG_NEEDSARG) || - (pt->is_vararg & VARARG_HASARG)); - check(pt->sizeupvalues <= pt->nups); - check(pt->sizelineinfo == pt->sizecode || pt->sizelineinfo == 0); - check(pt->sizecode > 0 && GET_OPCODE(pt->code[pt->sizecode-1]) == OP_RETURN); - return 1; -} - - -#define checkopenop(pt,pc) luaG_checkopenop((pt)->code[(pc)+1]) - -int luaG_checkopenop (Instruction i) { - switch (GET_OPCODE(i)) { - case OP_CALL: - case OP_TAILCALL: - case OP_RETURN: - case OP_SETLIST: { - check(GETARG_B(i) == 0); - return 1; - } - default: return 0; /* invalid instruction after an open call */ - } -} - - -static int checkArgMode (const Proto *pt, int r, enum OpArgMask mode) { - switch (mode) { - case OpArgN: check(r == 0); break; - case OpArgU: break; - case OpArgR: checkreg(pt, r); break; - case OpArgK: - check(ISK(r) ? INDEXK(r) < pt->sizek : r < pt->maxstacksize); - break; - } - return 1; -} - - -static Instruction symbexec (const Proto *pt, int lastpc, int reg) { - int pc; - int last; /* stores position of last instruction that changed `reg' */ - last = pt->sizecode-1; /* points to final return (a `neutral' instruction) */ - check(precheck(pt)); - for (pc = 0; pc < lastpc; pc++) { - Instruction i = pt->code[pc]; - OpCode op = GET_OPCODE(i); - int a = GETARG_A(i); - int b = 0; - int c = 0; - check(op < NUM_OPCODES); - checkreg(pt, a); - switch (getOpMode(op)) { - case iABC: { - b = GETARG_B(i); - c = GETARG_C(i); - check(checkArgMode(pt, b, getBMode(op))); - check(checkArgMode(pt, c, getCMode(op))); - break; - } - case iABx: { - b = GETARG_Bx(i); - if (getBMode(op) == OpArgK) check(b < pt->sizek); - break; - } - case iAsBx: { - b = GETARG_sBx(i); - if (getBMode(op) == OpArgR) { - int dest = pc+1+b; - check(0 <= dest && dest < pt->sizecode); - if (dest > 0) { - int j; - /* check that it does not jump to a setlist count; this - is tricky, because the count from a previous setlist may - have the same value of an invalid setlist; so, we must - go all the way back to the first of them (if any) */ - for (j = 0; j < dest; j++) { - Instruction d = pt->code[dest-1-j]; - if (!(GET_OPCODE(d) == OP_SETLIST && GETARG_C(d) == 0)) break; - } - /* if 'j' is even, previous value is not a setlist (even if - it looks like one) */ - check((j&1) == 0); - } - } - break; - } - } - if (testAMode(op)) { - if (a == reg) last = pc; /* change register `a' */ - } - if (testTMode(op)) { - check(pc+2 < pt->sizecode); /* check skip */ - check(GET_OPCODE(pt->code[pc+1]) == OP_JMP); - } - switch (op) { - case OP_LOADBOOL: { - if (c == 1) { /* does it jump? */ - check(pc+2 < pt->sizecode); /* check its jump */ - check(GET_OPCODE(pt->code[pc+1]) != OP_SETLIST || - GETARG_C(pt->code[pc+1]) != 0); - } - break; - } - case OP_LOADNIL: { - if (a <= reg && reg <= b) - last = pc; /* set registers from `a' to `b' */ - break; - } - case OP_GETUPVAL: - case OP_SETUPVAL: { - check(b < pt->nups); - break; - } - case OP_GETGLOBAL: - case OP_SETGLOBAL: { - check(ttisstring(&pt->k[b])); - break; - } - case OP_SELF: { - checkreg(pt, a+1); - if (reg == a+1) last = pc; - break; - } - case OP_CONCAT: { - check(b < c); /* at least two operands */ - break; - } - case OP_TFORLOOP: { - check(c >= 1); /* at least one result (control variable) */ - checkreg(pt, a+2+c); /* space for results */ - if (reg >= a+2) last = pc; /* affect all regs above its base */ - break; - } - case OP_FORLOOP: - case OP_FORPREP: - checkreg(pt, a+3); - /* go through */ - case OP_JMP: { - int dest = pc+1+b; - /* not full check and jump is forward and do not skip `lastpc'? */ - if (reg != NO_REG && pc < dest && dest <= lastpc) - pc += b; /* do the jump */ - break; - } - case OP_CALL: - case OP_TAILCALL: { - if (b != 0) { - checkreg(pt, a+b-1); - } - c--; /* c = num. returns */ - if (c == LUA_MULTRET) { - check(checkopenop(pt, pc)); - } - else if (c != 0) - checkreg(pt, a+c-1); - if (reg >= a) last = pc; /* affect all registers above base */ - break; - } - case OP_RETURN: { - b--; /* b = num. returns */ - if (b > 0) checkreg(pt, a+b-1); - break; - } - case OP_SETLIST: { - if (b > 0) checkreg(pt, a + b); - if (c == 0) { - pc++; - check(pc < pt->sizecode - 1); - } - break; - } - case OP_CLOSURE: { - int nup, j; - check(b < pt->sizep); - nup = pt->p[b]->nups; - check(pc + nup < pt->sizecode); - for (j = 1; j <= nup; j++) { - OpCode op1 = GET_OPCODE(pt->code[pc + j]); - check(op1 == OP_GETUPVAL || op1 == OP_MOVE); - } - if (reg != NO_REG) /* tracing? */ - pc += nup; /* do not 'execute' these pseudo-instructions */ - break; - } - case OP_VARARG: { - check((pt->is_vararg & VARARG_ISVARARG) && - !(pt->is_vararg & VARARG_NEEDSARG)); - b--; - if (b == LUA_MULTRET) check(checkopenop(pt, pc)); - checkreg(pt, a+b-1); - break; - } - default: break; - } - } - return pt->code[last]; -} - -#undef check -#undef checkjump -#undef checkreg - -/* }====================================================== */ - - -int luaG_checkcode (const Proto *pt) { - return (symbexec(pt, pt->sizecode, NO_REG) != 0); -} - - -static const char *kname (Proto *p, int c) { - if (ISK(c) && ttisstring(&p->k[INDEXK(c)])) - return svalue(&p->k[INDEXK(c)]); - else - return "?"; -} - - -static const char *getobjname (lua_State *L, CallInfo *ci, int stackpos, - const char **name) { - if (isLua(ci)) { /* a Lua function? */ - Proto *p = ci_func(ci)->l.p; - int pc = currentpc(L, ci); - Instruction i; - *name = luaF_getlocalname(p, stackpos+1, pc); - if (*name) /* is a local? */ - return "local"; - i = symbexec(p, pc, stackpos); /* try symbolic execution */ - lua_assert(pc != -1); - switch (GET_OPCODE(i)) { - case OP_GETGLOBAL: { - int g = GETARG_Bx(i); /* global index */ - lua_assert(ttisstring(&p->k[g])); - *name = svalue(&p->k[g]); - return "global"; - } - case OP_MOVE: { - int a = GETARG_A(i); - int b = GETARG_B(i); /* move from `b' to `a' */ - if (b < a) - return getobjname(L, ci, b, name); /* get name for `b' */ - break; - } - case OP_GETTABLE: { - int k = GETARG_C(i); /* key index */ - *name = kname(p, k); - return "field"; - } - case OP_GETUPVAL: { - int u = GETARG_B(i); /* upvalue index */ - *name = p->upvalues ? getstr(p->upvalues[u]) : "?"; - return "upvalue"; - } - case OP_SELF: { - int k = GETARG_C(i); /* key index */ - *name = kname(p, k); - return "method"; - } - default: break; - } - } - return NULL; /* no useful name found */ -} - - -static const char *getfuncname (lua_State *L, CallInfo *ci, const char **name) { - Instruction i; - if ((isLua(ci) && ci->tailcalls > 0) || !isLua(ci - 1)) - return NULL; /* calling function is not Lua (or is unknown) */ - ci--; /* calling function */ - i = ci_func(ci)->l.p->code[currentpc(L, ci)]; - if (GET_OPCODE(i) == OP_CALL || GET_OPCODE(i) == OP_TAILCALL || - GET_OPCODE(i) == OP_TFORLOOP) - return getobjname(L, ci, GETARG_A(i), name); - else - return NULL; /* no useful name can be found */ -} - - -/* only ANSI way to check whether a pointer points to an array */ -static int isinstack (CallInfo *ci, const TValue *o) { - StkId p; - for (p = ci->base; p < ci->top; p++) - if (o == p) return 1; - return 0; -} - - -void luaG_typeerror (lua_State *L, const TValue *o, const char *op) { - const char *name = NULL; - const char *t = luaT_typenames[ttype(o)]; - const char *kind = (isinstack(L->ci, o)) ? - getobjname(L, L->ci, cast_int(o - L->base), &name) : - NULL; - if (kind) - luaG_runerror(L, "attempt to %s %s " LUA_QS " (a %s value)", - op, kind, name, t); - else - luaG_runerror(L, "attempt to %s a %s value", op, t); -} - - -void luaG_concaterror (lua_State *L, StkId p1, StkId p2) { - if (ttisstring(p1) || ttisnumber(p1)) p1 = p2; - lua_assert(!ttisstring(p1) && !ttisnumber(p1)); - luaG_typeerror(L, p1, "concatenate"); -} - - -void luaG_aritherror (lua_State *L, const TValue *p1, const TValue *p2) { - TValue temp; - if (luaV_tonumber(p1, &temp) == NULL) - p2 = p1; /* first operand is wrong */ - luaG_typeerror(L, p2, "perform arithmetic on"); -} - - -int luaG_ordererror (lua_State *L, const TValue *p1, const TValue *p2) { - const char *t1 = luaT_typenames[ttype(p1)]; - const char *t2 = luaT_typenames[ttype(p2)]; - if (t1[2] == t2[2]) - luaG_runerror(L, "attempt to compare two %s values", t1); - else - luaG_runerror(L, "attempt to compare %s with %s", t1, t2); - return 0; -} - - -static void addinfo (lua_State *L, const char *msg) { - CallInfo *ci = L->ci; - if (isLua(ci)) { /* is Lua code? */ - char buff[LUA_IDSIZE]; /* add file:line information */ - int line = currentline(L, ci); - luaO_chunkid(buff, getstr(getluaproto(ci)->source), LUA_IDSIZE); - luaO_pushfstring(L, "%s:%d: %s", buff, line, msg); - } -} - - -void luaG_errormsg (lua_State *L) { - if (L->errfunc != 0) { /* is there an error handling function? */ - StkId errfunc = restorestack(L, L->errfunc); - if (!ttisfunction(errfunc)) luaD_throw(L, LUA_ERRERR); - setobjs2s(L, L->top, L->top - 1); /* move argument */ - setobjs2s(L, L->top - 1, errfunc); /* push function */ - incr_top(L); - luaD_call(L, L->top - 2, 1); /* call it */ - } - luaD_throw(L, LUA_ERRRUN); -} - - -void luaG_runerror (lua_State *L, const char *fmt, ...) { - va_list argp; - va_start(argp, fmt); - addinfo(L, luaO_pushvfstring(L, fmt, argp)); - va_end(argp); - luaG_errormsg(L); -} - diff --git a/script/lua/ldebug.h b/script/lua/ldebug.h deleted file mode 100644 index ba28a9724..000000000 --- a/script/lua/ldebug.h +++ /dev/null @@ -1,33 +0,0 @@ -/* -** $Id: ldebug.h,v 2.3.1.1 2007/12/27 13:02:25 roberto Exp $ -** Auxiliary functions from Debug Interface module -** See Copyright Notice in lua.h -*/ - -#ifndef ldebug_h -#define ldebug_h - - -#include "lstate.h" - - -#define pcRel(pc, p) (cast(int, (pc) - (p)->code) - 1) - -#define getline(f,pc) (((f)->lineinfo) ? (f)->lineinfo[pc] : 0) - -#define resethookcount(L) (L->hookcount = L->basehookcount) - - -LUAI_FUNC void luaG_typeerror (lua_State *L, const TValue *o, - const char *opname); -LUAI_FUNC void luaG_concaterror (lua_State *L, StkId p1, StkId p2); -LUAI_FUNC void luaG_aritherror (lua_State *L, const TValue *p1, - const TValue *p2); -LUAI_FUNC int luaG_ordererror (lua_State *L, const TValue *p1, - const TValue *p2); -LUAI_FUNC void luaG_runerror (lua_State *L, const char *fmt, ...); -LUAI_FUNC void luaG_errormsg (lua_State *L); -LUAI_FUNC int luaG_checkcode (const Proto *pt); -LUAI_FUNC int luaG_checkopenop (Instruction i); - -#endif diff --git a/script/lua/ldo.c b/script/lua/ldo.c deleted file mode 100644 index a267e7bfe..000000000 --- a/script/lua/ldo.c +++ /dev/null @@ -1,519 +0,0 @@ -/* -** $Id: ldo.c,v 2.38.1.3 2008/01/18 22:31:22 roberto Exp $ -** Stack and Call structure of Lua -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#endif - -#define ldo_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lgc.h" -#include "lmem.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lparser.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" -#include "lundump.h" -#include "lvm.h" -#include "lzio.h" - - - - -/* -** {====================================================== -** Error-recovery functions -** ======================================================= -*/ - - -/* chain list of long jump buffers */ -struct lua_longjmp { - struct lua_longjmp *previous; - luai_jmpbuf b; - volatile int status; /* error code */ -}; - - -void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop) { - switch (errcode) { - case LUA_ERRMEM: { - setsvalue2s(L, oldtop, luaS_newliteral(L, MEMERRMSG)); - break; - } - case LUA_ERRERR: { - setsvalue2s(L, oldtop, luaS_newliteral(L, "error in error handling")); - break; - } - case LUA_ERRSYNTAX: - case LUA_ERRRUN: { - setobjs2s(L, oldtop, L->top - 1); /* error message on current top */ - break; - } - } - L->top = oldtop + 1; -} - - -static void restore_stack_limit (lua_State *L) { - lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); - if (L->size_ci > LUAI_MAXCALLS) { /* there was an overflow? */ - int inuse = cast_int(L->ci - L->base_ci); - if (inuse + 1 < LUAI_MAXCALLS) /* can `undo' overflow? */ - luaD_reallocCI(L, LUAI_MAXCALLS); - } -} - - -static void resetstack (lua_State *L, int status) { - L->ci = L->base_ci; - L->base = L->ci->base; - luaF_close(L, L->base); /* close eventual pending closures */ - luaD_seterrorobj(L, status, L->base); - L->nCcalls = L->baseCcalls; - L->allowhook = 1; - restore_stack_limit(L); - L->errfunc = 0; - L->errorJmp = NULL; -} - - -void luaD_throw (lua_State *L, int errcode) { - if (L->errorJmp) { - L->errorJmp->status = errcode; - LUAI_THROW(L, L->errorJmp); - } - else { - L->status = cast_byte(errcode); - if (G(L)->panic) { - resetstack(L, errcode); - lua_unlock(L); - G(L)->panic(L); - } - exit(EXIT_FAILURE); - } -} - - -int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud) { - struct lua_longjmp lj; - lj.status = 0; - lj.previous = L->errorJmp; /* chain new error handler */ - L->errorJmp = &lj; - LUAI_TRY(L, &lj, - (*f)(L, ud); - ); - L->errorJmp = lj.previous; /* restore old error handler */ - return lj.status; -} - -/* }====================================================== */ - - -static void correctstack (lua_State *L, TValue *oldstack) { - CallInfo *ci; - GCObject *up; - L->top = (L->top - oldstack) + L->stack; - for (up = L->openupval; up != NULL; up = up->gch.next) - gco2uv(up)->v = (gco2uv(up)->v - oldstack) + L->stack; - for (ci = L->base_ci; ci <= L->ci; ci++) { - ci->top = (ci->top - oldstack) + L->stack; - ci->base = (ci->base - oldstack) + L->stack; - ci->func = (ci->func - oldstack) + L->stack; - } - L->base = (L->base - oldstack) + L->stack; -} - - -void luaD_reallocstack (lua_State *L, int newsize) { - TValue *oldstack = L->stack; - int realsize = newsize + 1 + EXTRA_STACK; - lua_assert(L->stack_last - L->stack == L->stacksize - EXTRA_STACK - 1); - luaM_reallocvector(L, L->stack, L->stacksize, realsize, TValue); - L->stacksize = realsize; - L->stack_last = L->stack+newsize; - correctstack(L, oldstack); -} - - -void luaD_reallocCI (lua_State *L, int newsize) { - CallInfo *oldci = L->base_ci; - luaM_reallocvector(L, L->base_ci, L->size_ci, newsize, CallInfo); - L->size_ci = newsize; - L->ci = (L->ci - oldci) + L->base_ci; - L->end_ci = L->base_ci + L->size_ci - 1; -} - - -void luaD_growstack (lua_State *L, int n) { - if (n <= L->stacksize) /* double size is enough? */ - luaD_reallocstack(L, 2*L->stacksize); - else - luaD_reallocstack(L, L->stacksize + n); -} - - -static CallInfo *growCI (lua_State *L) { - if (L->size_ci > LUAI_MAXCALLS) /* overflow while handling overflow? */ - luaD_throw(L, LUA_ERRERR); - else { - luaD_reallocCI(L, 2*L->size_ci); - if (L->size_ci > LUAI_MAXCALLS) - luaG_runerror(L, "stack overflow"); - } - return ++L->ci; -} - - -void luaD_callhook (lua_State *L, int event, int line) { - lua_Hook hook = L->hook; - if (hook && L->allowhook) { - ptrdiff_t top = savestack(L, L->top); - ptrdiff_t ci_top = savestack(L, L->ci->top); - lua_Debug ar; - ar.event = event; - ar.currentline = line; - if (event == LUA_HOOKTAILRET) - ar.i_ci = 0; /* tail call; no debug information about it */ - else - ar.i_ci = cast_int(L->ci - L->base_ci); - luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ - L->ci->top = L->top + LUA_MINSTACK; - lua_assert(L->ci->top <= L->stack_last); - L->allowhook = 0; /* cannot call hooks inside a hook */ - lua_unlock(L); - (*hook)(L, &ar); - lua_lock(L); - lua_assert(!L->allowhook); - L->allowhook = 1; - L->ci->top = restorestack(L, ci_top); - L->top = restorestack(L, top); - } -} - - -static StkId adjust_varargs (lua_State *L, Proto *p, int actual) { - int i; - int nfixargs = p->numparams; - Table *htab = NULL; - StkId base, fixed; - for (; actual < nfixargs; ++actual) - setnilvalue(L->top++); -#if defined(LUA_COMPAT_VARARG) - if (p->is_vararg & VARARG_NEEDSARG) { /* compat. with old-style vararg? */ - int nvar = actual - nfixargs; /* number of extra arguments */ - lua_assert(p->is_vararg & VARARG_HASARG); - luaC_checkGC(L); - htab = luaH_new(L, nvar, 1); /* create `arg' table */ - for (i=0; itop - nvar + i); - /* store counter in field `n' */ - setnvalue(luaH_setstr(L, htab, luaS_newliteral(L, "n")), cast_num(nvar)); - } -#endif - /* move fixed parameters to final position */ - fixed = L->top - actual; /* first fixed argument */ - base = L->top; /* final position of first argument */ - for (i=0; itop++, fixed+i); - setnilvalue(fixed+i); - } - /* add `arg' parameter */ - if (htab) { - sethvalue(L, L->top++, htab); - lua_assert(iswhite(obj2gco(htab))); - } - return base; -} - - -static StkId tryfuncTM (lua_State *L, StkId func) { - const TValue *tm = luaT_gettmbyobj(L, func, TM_CALL); - StkId p; - ptrdiff_t funcr = savestack(L, func); - if (!ttisfunction(tm)) - luaG_typeerror(L, func, "call"); - /* Open a hole inside the stack at `func' */ - for (p = L->top; p > func; p--) setobjs2s(L, p, p-1); - incr_top(L); - func = restorestack(L, funcr); /* previous call may change stack */ - setobj2s(L, func, tm); /* tag method is the new function to be called */ - return func; -} - - - -#define inc_ci(L) \ - ((L->ci == L->end_ci) ? growCI(L) : \ - (condhardstacktests(luaD_reallocCI(L, L->size_ci)), ++L->ci)) - - -int luaD_precall (lua_State *L, StkId func, int nresults) { - LClosure *cl; - ptrdiff_t funcr; - if (!ttisfunction(func)) /* `func' is not a function? */ - func = tryfuncTM(L, func); /* check the `function' tag method */ - funcr = savestack(L, func); - cl = &clvalue(func)->l; - L->ci->savedpc = L->savedpc; - if (!cl->isC) { /* Lua function? prepare its call */ - CallInfo *ci; - StkId st, base; - Proto *p = cl->p; - luaD_checkstack(L, p->maxstacksize); - func = restorestack(L, funcr); - if (!p->is_vararg) { /* no varargs? */ - base = func + 1; - if (L->top > base + p->numparams) - L->top = base + p->numparams; - } - else { /* vararg function */ - int nargs = cast_int(L->top - func) - 1; - base = adjust_varargs(L, p, nargs); - func = restorestack(L, funcr); /* previous call may change the stack */ - } - ci = inc_ci(L); /* now `enter' new function */ - ci->func = func; - L->base = ci->base = base; - ci->top = L->base + p->maxstacksize; - lua_assert(ci->top <= L->stack_last); - L->savedpc = p->code; /* starting point */ - ci->tailcalls = 0; - ci->nresults = nresults; - for (st = L->top; st < ci->top; st++) - setnilvalue(st); - L->top = ci->top; - if (L->hookmask & LUA_MASKCALL) { - L->savedpc++; /* hooks assume 'pc' is already incremented */ - luaD_callhook(L, LUA_HOOKCALL, -1); - L->savedpc--; /* correct 'pc' */ - } - return PCRLUA; - } - else { /* if is a C function, call it */ - CallInfo *ci; - int n; - luaD_checkstack(L, LUA_MINSTACK); /* ensure minimum stack size */ - ci = inc_ci(L); /* now `enter' new function */ - ci->func = restorestack(L, funcr); - L->base = ci->base = ci->func + 1; - ci->top = L->top + LUA_MINSTACK; - lua_assert(ci->top <= L->stack_last); - ci->nresults = nresults; - if (L->hookmask & LUA_MASKCALL) - luaD_callhook(L, LUA_HOOKCALL, -1); - lua_unlock(L); - n = (*curr_func(L)->c.f)(L); /* do the actual call */ - lua_lock(L); - if (n < 0) /* yielding? */ - return PCRYIELD; - else { - luaD_poscall(L, L->top - n); - return PCRC; - } - } -} - - -static StkId callrethooks (lua_State *L, StkId firstResult) { - ptrdiff_t fr = savestack(L, firstResult); /* next call may change stack */ - luaD_callhook(L, LUA_HOOKRET, -1); - if (f_isLua(L->ci)) { /* Lua function? */ - while ((L->hookmask & LUA_MASKRET) && L->ci->tailcalls--) /* tail calls */ - luaD_callhook(L, LUA_HOOKTAILRET, -1); - } - return restorestack(L, fr); -} - - -int luaD_poscall (lua_State *L, StkId firstResult) { - StkId res; - int wanted, i; - CallInfo *ci; - if (L->hookmask & LUA_MASKRET) - firstResult = callrethooks(L, firstResult); - ci = L->ci--; - res = ci->func; /* res == final position of 1st result */ - wanted = ci->nresults; - L->base = (ci - 1)->base; /* restore base */ - L->savedpc = (ci - 1)->savedpc; /* restore savedpc */ - /* move results to correct place */ - for (i = wanted; i != 0 && firstResult < L->top; i--) - setobjs2s(L, res++, firstResult++); - while (i-- > 0) - setnilvalue(res++); - L->top = res; - return (wanted - LUA_MULTRET); /* 0 iff wanted == LUA_MULTRET */ -} - - -/* -** Call a function (C or Lua). The function to be called is at *func. -** The arguments are on the stack, right after the function. -** When returns, all the results are on the stack, starting at the original -** function position. -*/ -void luaD_call (lua_State *L, StkId func, int nResults) { - if (++L->nCcalls >= LUAI_MAXCCALLS) { - if (L->nCcalls == LUAI_MAXCCALLS) - luaG_runerror(L, "C stack overflow"); - else if (L->nCcalls >= (LUAI_MAXCCALLS + (LUAI_MAXCCALLS>>3))) - luaD_throw(L, LUA_ERRERR); /* error while handing stack error */ - } - if (luaD_precall(L, func, nResults) == PCRLUA) /* is a Lua function? */ - luaV_execute(L, 1); /* call it */ - L->nCcalls--; - luaC_checkGC(L); -} - - -static void resume (lua_State *L, void *ud) { - StkId firstArg = cast(StkId, ud); - CallInfo *ci = L->ci; - if (L->status == 0) { /* start coroutine? */ - lua_assert(ci == L->base_ci && firstArg > L->base); - if (luaD_precall(L, firstArg - 1, LUA_MULTRET) != PCRLUA) - return; - } - else { /* resuming from previous yield */ - lua_assert(L->status == LUA_YIELD); - L->status = 0; - if (!f_isLua(ci)) { /* `common' yield? */ - /* finish interrupted execution of `OP_CALL' */ - lua_assert(GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_CALL || - GET_OPCODE(*((ci-1)->savedpc - 1)) == OP_TAILCALL); - if (luaD_poscall(L, firstArg)) /* complete it... */ - L->top = L->ci->top; /* and correct top if not multiple results */ - } - else /* yielded inside a hook: just continue its execution */ - L->base = L->ci->base; - } - luaV_execute(L, cast_int(L->ci - L->base_ci)); -} - - -static int resume_error (lua_State *L, const char *msg) { - L->top = L->ci->base; - setsvalue2s(L, L->top, luaS_new(L, msg)); - incr_top(L); - lua_unlock(L); - return LUA_ERRRUN; -} - - -LUA_API int lua_resume (lua_State *L, int nargs) { - int status; - lua_lock(L); - if (L->status != LUA_YIELD && (L->status != 0 || L->ci != L->base_ci)) - return resume_error(L, "cannot resume non-suspended coroutine"); - if (L->nCcalls >= LUAI_MAXCCALLS) - return resume_error(L, "C stack overflow"); - luai_userstateresume(L, nargs); - lua_assert(L->errfunc == 0); - L->baseCcalls = ++L->nCcalls; - status = luaD_rawrunprotected(L, resume, L->top - nargs); - if (status != 0) { /* error? */ - L->status = cast_byte(status); /* mark thread as `dead' */ - luaD_seterrorobj(L, status, L->top); - L->ci->top = L->top; - } - else { - lua_assert(L->nCcalls == L->baseCcalls); - status = L->status; - } - --L->nCcalls; - lua_unlock(L); - return status; -} - - -LUA_API int lua_yield (lua_State *L, int nresults) { - luai_userstateyield(L, nresults); - lua_lock(L); - if (L->nCcalls > L->baseCcalls) - luaG_runerror(L, "attempt to yield across metamethod/C-call boundary"); - L->base = L->top - nresults; /* protect stack slots below */ - L->status = LUA_YIELD; - lua_unlock(L); - return -1; -} - - -int luaD_pcall (lua_State *L, Pfunc func, void *u, - ptrdiff_t old_top, ptrdiff_t ef) { - int status; - unsigned short oldnCcalls = L->nCcalls; - ptrdiff_t old_ci = saveci(L, L->ci); - lu_byte old_allowhooks = L->allowhook; - ptrdiff_t old_errfunc = L->errfunc; - L->errfunc = ef; - status = luaD_rawrunprotected(L, func, u); - if (status != 0) { /* an error occurred? */ - StkId oldtop = restorestack(L, old_top); - luaF_close(L, oldtop); /* close eventual pending closures */ - luaD_seterrorobj(L, status, oldtop); - L->nCcalls = oldnCcalls; - L->ci = restoreci(L, old_ci); - L->base = L->ci->base; - L->savedpc = L->ci->savedpc; - L->allowhook = old_allowhooks; - restore_stack_limit(L); - } - L->errfunc = old_errfunc; - return status; -} - - - -/* -** Execute a protected parser. -*/ -struct SParser { /* data to `f_parser' */ - ZIO *z; - Mbuffer buff; /* buffer to be used by the scanner */ - const char *name; -}; - -static void f_parser (lua_State *L, void *ud) { - int i; - Proto *tf; - Closure *cl; - struct SParser *p = cast(struct SParser *, ud); - int c = luaZ_lookahead(p->z); - luaC_checkGC(L); - tf = ((c == LUA_SIGNATURE[0]) ? luaU_undump : luaY_parser)(L, p->z, - &p->buff, p->name); - cl = luaF_newLclosure(L, tf->nups, hvalue(gt(L))); - cl->l.p = tf; - for (i = 0; i < tf->nups; i++) /* initialize eventual upvalues */ - cl->l.upvals[i] = luaF_newupval(L); - setclvalue(L, L->top, cl); - incr_top(L); -} - - -int luaD_protectedparser (lua_State *L, ZIO *z, const char *name) { - struct SParser p; - int status; - p.z = z; p.name = name; - luaZ_initbuffer(L, &p.buff); - status = luaD_pcall(L, f_parser, &p, savestack(L, L->top), L->errfunc); - luaZ_freebuffer(L, &p.buff); - return status; -} - - diff --git a/script/lua/ldo.h b/script/lua/ldo.h deleted file mode 100644 index 98fddac59..000000000 --- a/script/lua/ldo.h +++ /dev/null @@ -1,57 +0,0 @@ -/* -** $Id: ldo.h,v 2.7.1.1 2007/12/27 13:02:25 roberto Exp $ -** Stack and Call structure of Lua -** See Copyright Notice in lua.h -*/ - -#ifndef ldo_h -#define ldo_h - - -#include "lobject.h" -#include "lstate.h" -#include "lzio.h" - - -#define luaD_checkstack(L,n) \ - if ((char *)L->stack_last - (char *)L->top <= (n)*(int)sizeof(TValue)) \ - luaD_growstack(L, n); \ - else condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); - - -#define incr_top(L) {luaD_checkstack(L,1); L->top++;} - -#define savestack(L,p) ((char *)(p) - (char *)L->stack) -#define restorestack(L,n) ((TValue *)((char *)L->stack + (n))) - -#define saveci(L,p) ((char *)(p) - (char *)L->base_ci) -#define restoreci(L,n) ((CallInfo *)((char *)L->base_ci + (n))) - - -/* results from luaD_precall */ -#define PCRLUA 0 /* initiated a call to a Lua function */ -#define PCRC 1 /* did a call to a C function */ -#define PCRYIELD 2 /* C funtion yielded */ - - -/* type of protected functions, to be ran by `runprotected' */ -typedef void (*Pfunc) (lua_State *L, void *ud); - -LUAI_FUNC int luaD_protectedparser (lua_State *L, ZIO *z, const char *name); -LUAI_FUNC void luaD_callhook (lua_State *L, int event, int line); -LUAI_FUNC int luaD_precall (lua_State *L, StkId func, int nresults); -LUAI_FUNC void luaD_call (lua_State *L, StkId func, int nResults); -LUAI_FUNC int luaD_pcall (lua_State *L, Pfunc func, void *u, - ptrdiff_t oldtop, ptrdiff_t ef); -LUAI_FUNC int luaD_poscall (lua_State *L, StkId firstResult); -LUAI_FUNC void luaD_reallocCI (lua_State *L, int newsize); -LUAI_FUNC void luaD_reallocstack (lua_State *L, int newsize); -LUAI_FUNC void luaD_growstack (lua_State *L, int n); - -LUAI_FUNC void luaD_throw (lua_State *L, int errcode); -LUAI_FUNC int luaD_rawrunprotected (lua_State *L, Pfunc f, void *ud); - -LUAI_FUNC void luaD_seterrorobj (lua_State *L, int errcode, StkId oldtop); - -#endif - diff --git a/script/lua/ldump.c b/script/lua/ldump.c deleted file mode 100644 index c9d3d4870..000000000 --- a/script/lua/ldump.c +++ /dev/null @@ -1,164 +0,0 @@ -/* -** $Id: ldump.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ -** save precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#include - -#define ldump_c -#define LUA_CORE - -#include "lua.h" - -#include "lobject.h" -#include "lstate.h" -#include "lundump.h" - -typedef struct { - lua_State* L; - lua_Writer writer; - void* data; - int strip; - int status; -} DumpState; - -#define DumpMem(b,n,size,D) DumpBlock(b,(n)*(size),D) -#define DumpVar(x,D) DumpMem(&x,1,sizeof(x),D) - -static void DumpBlock(const void* b, size_t size, DumpState* D) -{ - if (D->status==0) - { - lua_unlock(D->L); - D->status=(*D->writer)(D->L,b,size,D->data); - lua_lock(D->L); - } -} - -static void DumpChar(int y, DumpState* D) -{ - char x=(char)y; - DumpVar(x,D); -} - -static void DumpInt(int x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpNumber(lua_Number x, DumpState* D) -{ - DumpVar(x,D); -} - -static void DumpVector(const void* b, int n, size_t size, DumpState* D) -{ - DumpInt(n,D); - DumpMem(b,n,size,D); -} - -static void DumpString(const TString* s, DumpState* D) -{ - if (s==NULL || getstr(s)==NULL) - { - size_t size=0; - DumpVar(size,D); - } - else - { - size_t size=s->tsv.len+1; /* include trailing '\0' */ - DumpVar(size,D); - DumpBlock(getstr(s),size,D); - } -} - -#define DumpCode(f,D) DumpVector(f->code,f->sizecode,sizeof(Instruction),D) - -static void DumpFunction(const Proto* f, const TString* p, DumpState* D); - -static void DumpConstants(const Proto* f, DumpState* D) -{ - int i,n=f->sizek; - DumpInt(n,D); - for (i=0; ik[i]; - DumpChar(ttype(o),D); - switch (ttype(o)) - { - case LUA_TNIL: - break; - case LUA_TBOOLEAN: - DumpChar(bvalue(o),D); - break; - case LUA_TNUMBER: - DumpNumber(nvalue(o),D); - break; - case LUA_TSTRING: - DumpString(rawtsvalue(o),D); - break; - default: - lua_assert(0); /* cannot happen */ - break; - } - } - n=f->sizep; - DumpInt(n,D); - for (i=0; ip[i],f->source,D); -} - -static void DumpDebug(const Proto* f, DumpState* D) -{ - int i,n; - n= (D->strip) ? 0 : f->sizelineinfo; - DumpVector(f->lineinfo,n,sizeof(int),D); - n= (D->strip) ? 0 : f->sizelocvars; - DumpInt(n,D); - for (i=0; ilocvars[i].varname,D); - DumpInt(f->locvars[i].startpc,D); - DumpInt(f->locvars[i].endpc,D); - } - n= (D->strip) ? 0 : f->sizeupvalues; - DumpInt(n,D); - for (i=0; iupvalues[i],D); -} - -static void DumpFunction(const Proto* f, const TString* p, DumpState* D) -{ - DumpString((f->source==p || D->strip) ? NULL : f->source,D); - DumpInt(f->linedefined,D); - DumpInt(f->lastlinedefined,D); - DumpChar(f->nups,D); - DumpChar(f->numparams,D); - DumpChar(f->is_vararg,D); - DumpChar(f->maxstacksize,D); - DumpCode(f,D); - DumpConstants(f,D); - DumpDebug(f,D); -} - -static void DumpHeader(DumpState* D) -{ - char h[LUAC_HEADERSIZE]; - luaU_header(h); - DumpBlock(h,LUAC_HEADERSIZE,D); -} - -/* -** dump Lua function as precompiled chunk -*/ -int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip) -{ - DumpState D; - D.L=L; - D.writer=w; - D.data=data; - D.strip=strip; - D.status=0; - DumpHeader(&D); - DumpFunction(f,NULL,&D); - return D.status; -} diff --git a/script/lua/lfunc.c b/script/lua/lfunc.c deleted file mode 100644 index 813e88f58..000000000 --- a/script/lua/lfunc.c +++ /dev/null @@ -1,174 +0,0 @@ -/* -** $Id: lfunc.c,v 2.12.1.2 2007/12/28 14:58:43 roberto Exp $ -** Auxiliary functions to manipulate prototypes and closures -** See Copyright Notice in lua.h -*/ - - -#include - -#define lfunc_c -#define LUA_CORE - -#include "lua.h" - -#include "lfunc.h" -#include "lgc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" - - - -Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e) { - Closure *c = cast(Closure *, luaM_malloc(L, sizeCclosure(nelems))); - luaC_link(L, obj2gco(c), LUA_TFUNCTION); - c->c.isC = 1; - c->c.env = e; - c->c.nupvalues = cast_byte(nelems); - return c; -} - - -Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e) { - Closure *c = cast(Closure *, luaM_malloc(L, sizeLclosure(nelems))); - luaC_link(L, obj2gco(c), LUA_TFUNCTION); - c->l.isC = 0; - c->l.env = e; - c->l.nupvalues = cast_byte(nelems); - while (nelems--) c->l.upvals[nelems] = NULL; - return c; -} - - -UpVal *luaF_newupval (lua_State *L) { - UpVal *uv = luaM_new(L, UpVal); - luaC_link(L, obj2gco(uv), LUA_TUPVAL); - uv->v = &uv->u.value; - setnilvalue(uv->v); - return uv; -} - - -UpVal *luaF_findupval (lua_State *L, StkId level) { - global_State *g = G(L); - GCObject **pp = &L->openupval; - UpVal *p; - UpVal *uv; - while (*pp != NULL && (p = ngcotouv(*pp))->v >= level) { - lua_assert(p->v != &p->u.value); - if (p->v == level) { /* found a corresponding upvalue? */ - if (isdead(g, obj2gco(p))) /* is it dead? */ - changewhite(obj2gco(p)); /* ressurect it */ - return p; - } - pp = &p->next; - } - uv = luaM_new(L, UpVal); /* not found: create a new one */ - uv->tt = LUA_TUPVAL; - uv->marked = luaC_white(g); - uv->v = level; /* current value lives in the stack */ - uv->next = *pp; /* chain it in the proper position */ - *pp = obj2gco(uv); - uv->u.l.prev = &g->uvhead; /* double link it in `uvhead' list */ - uv->u.l.next = g->uvhead.u.l.next; - uv->u.l.next->u.l.prev = uv; - g->uvhead.u.l.next = uv; - lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); - return uv; -} - - -static void unlinkupval (UpVal *uv) { - lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); - uv->u.l.next->u.l.prev = uv->u.l.prev; /* remove from `uvhead' list */ - uv->u.l.prev->u.l.next = uv->u.l.next; -} - - -void luaF_freeupval (lua_State *L, UpVal *uv) { - if (uv->v != &uv->u.value) /* is it open? */ - unlinkupval(uv); /* remove from open list */ - luaM_free(L, uv); /* free upvalue */ -} - - -void luaF_close (lua_State *L, StkId level) { - UpVal *uv; - global_State *g = G(L); - while (L->openupval != NULL && (uv = ngcotouv(L->openupval))->v >= level) { - GCObject *o = obj2gco(uv); - lua_assert(!isblack(o) && uv->v != &uv->u.value); - L->openupval = uv->next; /* remove from `open' list */ - if (isdead(g, o)) - luaF_freeupval(L, uv); /* free upvalue */ - else { - unlinkupval(uv); - setobj(L, &uv->u.value, uv->v); - uv->v = &uv->u.value; /* now current value lives here */ - luaC_linkupval(L, uv); /* link upvalue into `gcroot' list */ - } - } -} - - -Proto *luaF_newproto (lua_State *L) { - Proto *f = luaM_new(L, Proto); - luaC_link(L, obj2gco(f), LUA_TPROTO); - f->k = NULL; - f->sizek = 0; - f->p = NULL; - f->sizep = 0; - f->code = NULL; - f->sizecode = 0; - f->sizelineinfo = 0; - f->sizeupvalues = 0; - f->nups = 0; - f->upvalues = NULL; - f->numparams = 0; - f->is_vararg = 0; - f->maxstacksize = 0; - f->lineinfo = NULL; - f->sizelocvars = 0; - f->locvars = NULL; - f->linedefined = 0; - f->lastlinedefined = 0; - f->source = NULL; - return f; -} - - -void luaF_freeproto (lua_State *L, Proto *f) { - luaM_freearray(L, f->code, f->sizecode, Instruction); - luaM_freearray(L, f->p, f->sizep, Proto *); - luaM_freearray(L, f->k, f->sizek, TValue); - luaM_freearray(L, f->lineinfo, f->sizelineinfo, int); - luaM_freearray(L, f->locvars, f->sizelocvars, struct LocVar); - luaM_freearray(L, f->upvalues, f->sizeupvalues, TString *); - luaM_free(L, f); -} - - -void luaF_freeclosure (lua_State *L, Closure *c) { - int size = (c->c.isC) ? sizeCclosure(c->c.nupvalues) : - sizeLclosure(c->l.nupvalues); - luaM_freemem(L, c, size); -} - - -/* -** Look for n-th local variable at line `line' in function `func'. -** Returns NULL if not found. -*/ -const char *luaF_getlocalname (const Proto *f, int local_number, int pc) { - int i; - for (i = 0; isizelocvars && f->locvars[i].startpc <= pc; i++) { - if (pc < f->locvars[i].endpc) { /* is variable active? */ - local_number--; - if (local_number == 0) - return getstr(f->locvars[i].varname); - } - } - return NULL; /* not found */ -} - diff --git a/script/lua/lfunc.h b/script/lua/lfunc.h deleted file mode 100644 index a68cf5151..000000000 --- a/script/lua/lfunc.h +++ /dev/null @@ -1,34 +0,0 @@ -/* -** $Id: lfunc.h,v 2.4.1.1 2007/12/27 13:02:25 roberto Exp $ -** Auxiliary functions to manipulate prototypes and closures -** See Copyright Notice in lua.h -*/ - -#ifndef lfunc_h -#define lfunc_h - - -#include "lobject.h" - - -#define sizeCclosure(n) (cast(int, sizeof(CClosure)) + \ - cast(int, sizeof(TValue)*((n)-1))) - -#define sizeLclosure(n) (cast(int, sizeof(LClosure)) + \ - cast(int, sizeof(TValue *)*((n)-1))) - - -LUAI_FUNC Proto *luaF_newproto (lua_State *L); -LUAI_FUNC Closure *luaF_newCclosure (lua_State *L, int nelems, Table *e); -LUAI_FUNC Closure *luaF_newLclosure (lua_State *L, int nelems, Table *e); -LUAI_FUNC UpVal *luaF_newupval (lua_State *L); -LUAI_FUNC UpVal *luaF_findupval (lua_State *L, StkId level); -LUAI_FUNC void luaF_close (lua_State *L, StkId level); -LUAI_FUNC void luaF_freeproto (lua_State *L, Proto *f); -LUAI_FUNC void luaF_freeclosure (lua_State *L, Closure *c); -LUAI_FUNC void luaF_freeupval (lua_State *L, UpVal *uv); -LUAI_FUNC const char *luaF_getlocalname (const Proto *func, int local_number, - int pc); - - -#endif diff --git a/script/lua/lgc.c b/script/lua/lgc.c deleted file mode 100644 index 1d62975ad..000000000 --- a/script/lua/lgc.c +++ /dev/null @@ -1,713 +0,0 @@ -/* -** $Id: lgc.c,v 2.38.1.1 2007/12/27 13:02:25 roberto Exp $ -** Garbage Collector -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#endif - -#define lgc_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lgc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" - - -#define GCSTEPSIZE 1024u -#define GCSWEEPMAX 40 -#define GCSWEEPCOST 10 -#define GCFINALIZECOST 100 - - -#define maskmarks cast_byte(~(bitmask(BLACKBIT)|WHITEBITS)) - -#define makewhite(g,x) \ - ((x)->gch.marked = cast_byte(((x)->gch.marked & maskmarks) | luaC_white(g))) - -#define white2gray(x) reset2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) -#define black2gray(x) resetbit((x)->gch.marked, BLACKBIT) - -#define stringmark(s) reset2bits((s)->tsv.marked, WHITE0BIT, WHITE1BIT) - - -#define isfinalized(u) testbit((u)->marked, FINALIZEDBIT) -#define markfinalized(u) l_setbit((u)->marked, FINALIZEDBIT) - - -#define KEYWEAK bitmask(KEYWEAKBIT) -#define VALUEWEAK bitmask(VALUEWEAKBIT) - - - -#define markvalue(g,o) { checkconsistency(o); \ - if (iscollectable(o) && iswhite(gcvalue(o))) reallymarkobject(g,gcvalue(o)); } - -#define markobject(g,t) { if (iswhite(obj2gco(t))) \ - reallymarkobject(g, obj2gco(t)); } - - -#define setthreshold(g) (g->GCthreshold = (g->estimate/100) * g->gcpause) - - -static void removeentry (Node *n) { - lua_assert(ttisnil(gval(n))); - if (iscollectable(gkey(n))) - setttype(gkey(n), LUA_TDEADKEY); /* dead key; remove it */ -} - - -static void reallymarkobject (global_State *g, GCObject *o) { - lua_assert(iswhite(o) && !isdead(g, o)); - white2gray(o); - switch (o->gch.tt) { - case LUA_TSTRING: { - return; - } - case LUA_TUSERDATA: { - Table *mt = gco2u(o)->metatable; - gray2black(o); /* udata are never gray */ - if (mt) markobject(g, mt); - markobject(g, gco2u(o)->env); - return; - } - case LUA_TUPVAL: { - UpVal *uv = gco2uv(o); - markvalue(g, uv->v); - if (uv->v == &uv->u.value) /* closed? */ - gray2black(o); /* open upvalues are never black */ - return; - } - case LUA_TFUNCTION: { - gco2cl(o)->c.gclist = g->gray; - g->gray = o; - break; - } - case LUA_TTABLE: { - gco2h(o)->gclist = g->gray; - g->gray = o; - break; - } - case LUA_TTHREAD: { - gco2th(o)->gclist = g->gray; - g->gray = o; - break; - } - case LUA_TPROTO: { - gco2p(o)->gclist = g->gray; - g->gray = o; - break; - } - default: lua_assert(0); - } -} - - -static void marktmu (global_State *g) { - GCObject *u = g->tmudata; - if (u) { - do { - u = u->gch.next; - makewhite(g, u); /* may be marked, if left from previous GC */ - reallymarkobject(g, u); - } while (u != g->tmudata); - } -} - - -/* move `dead' udata that need finalization to list `tmudata' */ -size_t luaC_separateudata (lua_State *L, int all) { - global_State *g = G(L); - size_t deadmem = 0; - GCObject **p = &g->mainthread->next; - GCObject *curr; - while ((curr = *p) != NULL) { - if (!(iswhite(curr) || all) || isfinalized(gco2u(curr))) - p = &curr->gch.next; /* don't bother with them */ - else if (fasttm(L, gco2u(curr)->metatable, TM_GC) == NULL) { - markfinalized(gco2u(curr)); /* don't need finalization */ - p = &curr->gch.next; - } - else { /* must call its gc method */ - deadmem += sizeudata(gco2u(curr)); - markfinalized(gco2u(curr)); - *p = curr->gch.next; - /* link `curr' at the end of `tmudata' list */ - if (g->tmudata == NULL) /* list is empty? */ - g->tmudata = curr->gch.next = curr; /* creates a circular list */ - else { - curr->gch.next = g->tmudata->gch.next; - g->tmudata->gch.next = curr; - g->tmudata = curr; - } - } - } - return deadmem; -} - - -static int traversetable (global_State *g, Table *h) { - int i; - int weakkey = 0; - int weakvalue = 0; - const TValue *mode; - if (h->metatable) - markobject(g, h->metatable); - mode = gfasttm(g, h->metatable, TM_MODE); - if (mode && ttisstring(mode)) { /* is there a weak mode? */ - weakkey = (strchr(svalue(mode), 'k') != NULL); - weakvalue = (strchr(svalue(mode), 'v') != NULL); - if (weakkey || weakvalue) { /* is really weak? */ - h->marked &= ~(KEYWEAK | VALUEWEAK); /* clear bits */ - h->marked |= cast_byte((weakkey << KEYWEAKBIT) | - (weakvalue << VALUEWEAKBIT)); - h->gclist = g->weak; /* must be cleared after GC, ... */ - g->weak = obj2gco(h); /* ... so put in the appropriate list */ - } - } - if (weakkey && weakvalue) return 1; - if (!weakvalue) { - i = h->sizearray; - while (i--) - markvalue(g, &h->array[i]); - } - i = sizenode(h); - while (i--) { - Node *n = gnode(h, i); - lua_assert(ttype(gkey(n)) != LUA_TDEADKEY || ttisnil(gval(n))); - if (ttisnil(gval(n))) - removeentry(n); /* remove empty entries */ - else { - lua_assert(!ttisnil(gkey(n))); - if (!weakkey) markvalue(g, gkey(n)); - if (!weakvalue) markvalue(g, gval(n)); - } - } - return weakkey || weakvalue; -} - - -/* -** All marks are conditional because a GC may happen while the -** prototype is still being created -*/ -static void traverseproto (global_State *g, Proto *f) { - int i; - if (f->source) stringmark(f->source); - for (i=0; isizek; i++) /* mark literals */ - markvalue(g, &f->k[i]); - for (i=0; isizeupvalues; i++) { /* mark upvalue names */ - if (f->upvalues[i]) - stringmark(f->upvalues[i]); - } - for (i=0; isizep; i++) { /* mark nested protos */ - if (f->p[i]) - markobject(g, f->p[i]); - } - for (i=0; isizelocvars; i++) { /* mark local-variable names */ - if (f->locvars[i].varname) - stringmark(f->locvars[i].varname); - } -} - - - -static void traverseclosure (global_State *g, Closure *cl) { - markobject(g, cl->c.env); - if (cl->c.isC) { - int i; - for (i=0; ic.nupvalues; i++) /* mark its upvalues */ - markvalue(g, &cl->c.upvalue[i]); - } - else { - int i; - lua_assert(cl->l.nupvalues == cl->l.p->nups); - markobject(g, cl->l.p); - for (i=0; il.nupvalues; i++) /* mark its upvalues */ - markobject(g, cl->l.upvals[i]); - } -} - - -static void checkstacksizes (lua_State *L, StkId max) { - int ci_used = cast_int(L->ci - L->base_ci); /* number of `ci' in use */ - int s_used = cast_int(max - L->stack); /* part of stack in use */ - if (L->size_ci > LUAI_MAXCALLS) /* handling overflow? */ - return; /* do not touch the stacks */ - if (4*ci_used < L->size_ci && 2*BASIC_CI_SIZE < L->size_ci) - luaD_reallocCI(L, L->size_ci/2); /* still big enough... */ - condhardstacktests(luaD_reallocCI(L, ci_used + 1)); - if (4*s_used < L->stacksize && - 2*(BASIC_STACK_SIZE+EXTRA_STACK) < L->stacksize) - luaD_reallocstack(L, L->stacksize/2); /* still big enough... */ - condhardstacktests(luaD_reallocstack(L, s_used)); -} - - -static void traversestack (global_State *g, lua_State *l) { - StkId o, lim; - CallInfo *ci; - markvalue(g, gt(l)); - lim = l->top; - for (ci = l->base_ci; ci <= l->ci; ci++) { - lua_assert(ci->top <= l->stack_last); - if (lim < ci->top) lim = ci->top; - } - for (o = l->stack; o < l->top; o++) - markvalue(g, o); - for (; o <= lim; o++) - setnilvalue(o); - checkstacksizes(l, lim); -} - - -/* -** traverse one gray object, turning it to black. -** Returns `quantity' traversed. -*/ -static l_mem propagatemark (global_State *g) { - GCObject *o = g->gray; - lua_assert(isgray(o)); - gray2black(o); - switch (o->gch.tt) { - case LUA_TTABLE: { - Table *h = gco2h(o); - g->gray = h->gclist; - if (traversetable(g, h)) /* table is weak? */ - black2gray(o); /* keep it gray */ - return sizeof(Table) + sizeof(TValue) * h->sizearray + - sizeof(Node) * sizenode(h); - } - case LUA_TFUNCTION: { - Closure *cl = gco2cl(o); - g->gray = cl->c.gclist; - traverseclosure(g, cl); - return (cl->c.isC) ? sizeCclosure(cl->c.nupvalues) : - sizeLclosure(cl->l.nupvalues); - } - case LUA_TTHREAD: { - lua_State *th = gco2th(o); - g->gray = th->gclist; - th->gclist = g->grayagain; - g->grayagain = o; - black2gray(o); - traversestack(g, th); - return sizeof(lua_State) + sizeof(TValue) * th->stacksize + - sizeof(CallInfo) * th->size_ci; - } - case LUA_TPROTO: { - Proto *p = gco2p(o); - g->gray = p->gclist; - traverseproto(g, p); - return sizeof(Proto) + sizeof(Instruction) * p->sizecode + - sizeof(Proto *) * p->sizep + - sizeof(TValue) * p->sizek + - sizeof(int) * p->sizelineinfo + - sizeof(LocVar) * p->sizelocvars + - sizeof(TString *) * p->sizeupvalues; - } - default: lua_assert(0); return 0; - } -} - - -static size_t propagateall (global_State *g) { - size_t m = 0; - while (g->gray) m += propagatemark(g); - return m; -} - - -/* -** The next function tells whether a key or value can be cleared from -** a weak table. Non-collectable objects are never removed from weak -** tables. Strings behave as `values', so are never removed too. for -** other objects: if really collected, cannot keep them; for userdata -** being finalized, keep them in keys, but not in values -*/ -static int iscleared (const TValue *o, int iskey) { - if (!iscollectable(o)) return 0; - if (ttisstring(o)) { - stringmark(rawtsvalue(o)); /* strings are `values', so are never weak */ - return 0; - } - return iswhite(gcvalue(o)) || - (ttisuserdata(o) && (!iskey && isfinalized(uvalue(o)))); -} - - -/* -** clear collected entries from weaktables -*/ -static void cleartable (GCObject *l) { - while (l) { - Table *h = gco2h(l); - int i = h->sizearray; - lua_assert(testbit(h->marked, VALUEWEAKBIT) || - testbit(h->marked, KEYWEAKBIT)); - if (testbit(h->marked, VALUEWEAKBIT)) { - while (i--) { - TValue *o = &h->array[i]; - if (iscleared(o, 0)) /* value was collected? */ - setnilvalue(o); /* remove value */ - } - } - i = sizenode(h); - while (i--) { - Node *n = gnode(h, i); - if (!ttisnil(gval(n)) && /* non-empty entry? */ - (iscleared(key2tval(n), 1) || iscleared(gval(n), 0))) { - setnilvalue(gval(n)); /* remove value ... */ - removeentry(n); /* remove entry from table */ - } - } - l = h->gclist; - } -} - - -static void freeobj (lua_State *L, GCObject *o) { - switch (o->gch.tt) { - case LUA_TPROTO: luaF_freeproto(L, gco2p(o)); break; - case LUA_TFUNCTION: luaF_freeclosure(L, gco2cl(o)); break; - case LUA_TUPVAL: luaF_freeupval(L, gco2uv(o)); break; - case LUA_TTABLE: luaH_free(L, gco2h(o)); break; - case LUA_TTHREAD: { - lua_assert(gco2th(o) != L && gco2th(o) != G(L)->mainthread); - luaE_freethread(L, gco2th(o)); - break; - } - case LUA_TSTRING: { - G(L)->strt.nuse--; - luaM_freemem(L, o, sizestring(gco2ts(o))); - break; - } - case LUA_TUSERDATA: { - luaM_freemem(L, o, sizeudata(gco2u(o))); - break; - } - default: lua_assert(0); - } -} - - - -#define sweepwholelist(L,p) sweeplist(L,p,MAX_LUMEM) - - -static GCObject **sweeplist (lua_State *L, GCObject **p, lu_mem count) { - GCObject *curr; - global_State *g = G(L); - int deadmask = otherwhite(g); - while ((curr = *p) != NULL && count-- > 0) { - if (curr->gch.tt == LUA_TTHREAD) /* sweep open upvalues of each thread */ - sweepwholelist(L, &gco2th(curr)->openupval); - if ((curr->gch.marked ^ WHITEBITS) & deadmask) { /* not dead? */ - lua_assert(!isdead(g, curr) || testbit(curr->gch.marked, FIXEDBIT)); - makewhite(g, curr); /* make it white (for next cycle) */ - p = &curr->gch.next; - } - else { /* must erase `curr' */ - lua_assert(isdead(g, curr) || deadmask == bitmask(SFIXEDBIT)); - *p = curr->gch.next; - if (curr == g->rootgc) /* is the first element of the list? */ - g->rootgc = curr->gch.next; /* adjust first */ - freeobj(L, curr); - } - } - return p; -} - - -static void checkSizes (lua_State *L) { - global_State *g = G(L); - /* check size of string hash */ - if (g->strt.nuse < cast(lu_int32, g->strt.size/4) && - g->strt.size > MINSTRTABSIZE*2) - luaS_resize(L, g->strt.size/2); /* table is too big */ - /* check size of buffer */ - if (luaZ_sizebuffer(&g->buff) > LUA_MINBUFFER*2) { /* buffer too big? */ - size_t newsize = luaZ_sizebuffer(&g->buff) / 2; - luaZ_resizebuffer(L, &g->buff, newsize); - } -} - - -static void GCTM (lua_State *L) { - global_State *g = G(L); - GCObject *o = g->tmudata->gch.next; /* get first element */ - Udata *udata = rawgco2u(o); - const TValue *tm; - /* remove udata from `tmudata' */ - if (o == g->tmudata) /* last element? */ - g->tmudata = NULL; - else - g->tmudata->gch.next = udata->uv.next; - udata->uv.next = g->mainthread->next; /* return it to `root' list */ - g->mainthread->next = o; - makewhite(g, o); - tm = fasttm(L, udata->uv.metatable, TM_GC); - if (tm != NULL) { - lu_byte oldah = L->allowhook; - lu_mem oldt = g->GCthreshold; - L->allowhook = 0; /* stop debug hooks during GC tag method */ - g->GCthreshold = 2*g->totalbytes; /* avoid GC steps */ - setobj2s(L, L->top, tm); - setuvalue(L, L->top+1, udata); - L->top += 2; - luaD_call(L, L->top - 2, 0); - L->allowhook = oldah; /* restore hooks */ - g->GCthreshold = oldt; /* restore threshold */ - } -} - - -/* -** Call all GC tag methods -*/ -void luaC_callGCTM (lua_State *L) { - while (G(L)->tmudata) - GCTM(L); -} - - -void luaC_freeall (lua_State *L) { - global_State *g = G(L); - int i; - g->currentwhite = WHITEBITS | bitmask(SFIXEDBIT); /* mask to collect all elements */ - sweepwholelist(L, &g->rootgc); - for (i = 0; i < g->strt.size; i++) /* free all string lists */ - sweepwholelist(L, &g->strt.hash[i]); -} - - -static void markmt (global_State *g) { - int i; - for (i=0; imt[i]) markobject(g, g->mt[i]); -} - - -/* mark root set */ -static void markroot (lua_State *L) { - global_State *g = G(L); - g->gray = NULL; - g->grayagain = NULL; - g->weak = NULL; - markobject(g, g->mainthread); - /* make global table be traversed before main stack */ - markvalue(g, gt(g->mainthread)); - markvalue(g, registry(L)); - markmt(g); - g->gcstate = GCSpropagate; -} - - -static void remarkupvals (global_State *g) { - UpVal *uv; - for (uv = g->uvhead.u.l.next; uv != &g->uvhead; uv = uv->u.l.next) { - lua_assert(uv->u.l.next->u.l.prev == uv && uv->u.l.prev->u.l.next == uv); - if (isgray(obj2gco(uv))) - markvalue(g, uv->v); - } -} - - -static void atomic (lua_State *L) { - global_State *g = G(L); - size_t udsize; /* total size of userdata to be finalized */ - /* remark occasional upvalues of (maybe) dead threads */ - remarkupvals(g); - /* traverse objects cautch by write barrier and by 'remarkupvals' */ - propagateall(g); - /* remark weak tables */ - g->gray = g->weak; - g->weak = NULL; - lua_assert(!iswhite(obj2gco(g->mainthread))); - markobject(g, L); /* mark running thread */ - markmt(g); /* mark basic metatables (again) */ - propagateall(g); - /* remark gray again */ - g->gray = g->grayagain; - g->grayagain = NULL; - propagateall(g); - udsize = luaC_separateudata(L, 0); /* separate userdata to be finalized */ - marktmu(g); /* mark `preserved' userdata */ - udsize += propagateall(g); /* remark, to propagate `preserveness' */ - cleartable(g->weak); /* remove collected objects from weak tables */ - /* flip current white */ - g->currentwhite = cast_byte(otherwhite(g)); - g->sweepstrgc = 0; - g->sweepgc = &g->rootgc; - g->gcstate = GCSsweepstring; - g->estimate = g->totalbytes - udsize; /* first estimate */ -} - - -static l_mem singlestep (lua_State *L) { - global_State *g = G(L); - /*lua_checkmemory(L);*/ - switch (g->gcstate) { - case GCSpause: { - markroot(L); /* start a new collection */ - return 0; - } - case GCSpropagate: { - if (g->gray) - return propagatemark(g); - else { /* no more `gray' objects */ - atomic(L); /* finish mark phase */ - return 0; - } - } - case GCSsweepstring: { - lu_mem old = g->totalbytes; - sweepwholelist(L, &g->strt.hash[g->sweepstrgc++]); - if (g->sweepstrgc >= g->strt.size) /* nothing more to sweep? */ - g->gcstate = GCSsweep; /* end sweep-string phase */ - lua_assert(old >= g->totalbytes); - g->estimate -= old - g->totalbytes; - return GCSWEEPCOST; - } - case GCSsweep: { - lu_mem old = g->totalbytes; - g->sweepgc = sweeplist(L, g->sweepgc, GCSWEEPMAX); - if (*g->sweepgc == NULL) { /* nothing more to sweep? */ - checkSizes(L); - g->gcstate = GCSfinalize; /* end sweep phase */ - } - lua_assert(old >= g->totalbytes); - g->estimate -= old - g->totalbytes; - return GCSWEEPMAX*GCSWEEPCOST; - } - case GCSfinalize: { - if (g->tmudata) { - GCTM(L); - if (g->estimate > GCFINALIZECOST) - g->estimate -= GCFINALIZECOST; - return GCFINALIZECOST; - } - else { - g->gcstate = GCSpause; /* end collection */ - g->gcdept = 0; - return 0; - } - } - default: lua_assert(0); return 0; - } -} - - -void luaC_step (lua_State *L) { - global_State *g = G(L); - l_mem lim = (GCSTEPSIZE/100) * g->gcstepmul; - if (lim == 0) - lim = (MAX_LUMEM-1)/2; /* no limit */ - g->gcdept += g->totalbytes - g->GCthreshold; - do { - lim -= singlestep(L); - if (g->gcstate == GCSpause) - break; - } while (lim > 0); - if (g->gcstate != GCSpause) { - if (g->gcdept < GCSTEPSIZE) - g->GCthreshold = g->totalbytes + GCSTEPSIZE; /* - lim/g->gcstepmul;*/ - else { - g->gcdept -= GCSTEPSIZE; - g->GCthreshold = g->totalbytes; - } - } - else { - lua_assert(g->totalbytes >= g->estimate); - setthreshold(g); - } -} - - -void luaC_fullgc (lua_State *L) { - global_State *g = G(L); - if (g->gcstate <= GCSpropagate) { - /* reset sweep marks to sweep all elements (returning them to white) */ - g->sweepstrgc = 0; - g->sweepgc = &g->rootgc; - /* reset other collector lists */ - g->gray = NULL; - g->grayagain = NULL; - g->weak = NULL; - g->gcstate = GCSsweepstring; - } - lua_assert(g->gcstate != GCSpause && g->gcstate != GCSpropagate); - /* finish any pending sweep phase */ - while (g->gcstate != GCSfinalize) { - lua_assert(g->gcstate == GCSsweepstring || g->gcstate == GCSsweep); - singlestep(L); - } - markroot(L); - while (g->gcstate != GCSpause) { - singlestep(L); - } - setthreshold(g); -} - - -void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v) { - global_State *g = G(L); - lua_assert(isblack(o) && iswhite(v) && !isdead(g, v) && !isdead(g, o)); - lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); - lua_assert(ttype(&o->gch) != LUA_TTABLE); - /* must keep invariant? */ - if (g->gcstate == GCSpropagate) - reallymarkobject(g, v); /* restore invariant */ - else /* don't mind */ - makewhite(g, o); /* mark as white just to avoid other barriers */ -} - - -void luaC_barrierback (lua_State *L, Table *t) { - global_State *g = G(L); - GCObject *o = obj2gco(t); - lua_assert(isblack(o) && !isdead(g, o)); - lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); - black2gray(o); /* make table gray (again) */ - t->gclist = g->grayagain; - g->grayagain = o; -} - - -void luaC_link (lua_State *L, GCObject *o, lu_byte tt) { - global_State *g = G(L); - o->gch.next = g->rootgc; - g->rootgc = o; - o->gch.marked = luaC_white(g); - o->gch.tt = tt; -} - - -void luaC_linkupval (lua_State *L, UpVal *uv) { - global_State *g = G(L); - GCObject *o = obj2gco(uv); - o->gch.next = g->rootgc; /* link upvalue into `rootgc' list */ - g->rootgc = o; - if (isgray(o)) { - if (g->gcstate == GCSpropagate) { - gray2black(o); /* closed upvalues need barrier */ - luaC_barrier(L, uv, uv->v); - } - else { /* sweep phase: sweep it (turning it into white) */ - makewhite(g, o); - lua_assert(g->gcstate != GCSfinalize && g->gcstate != GCSpause); - } - } -} - diff --git a/script/lua/lgc.h b/script/lua/lgc.h deleted file mode 100644 index 5a8dc605b..000000000 --- a/script/lua/lgc.h +++ /dev/null @@ -1,110 +0,0 @@ -/* -** $Id: lgc.h,v 2.15.1.1 2007/12/27 13:02:25 roberto Exp $ -** Garbage Collector -** See Copyright Notice in lua.h -*/ - -#ifndef lgc_h -#define lgc_h - - -#include "lobject.h" - - -/* -** Possible states of the Garbage Collector -*/ -#define GCSpause 0 -#define GCSpropagate 1 -#define GCSsweepstring 2 -#define GCSsweep 3 -#define GCSfinalize 4 - - -/* -** some userful bit tricks -*/ -#define resetbits(x,m) ((x) &= cast(lu_byte, ~(m))) -#define setbits(x,m) ((x) |= (m)) -#define testbits(x,m) ((x) & (m)) -#define bitmask(b) (1<<(b)) -#define bit2mask(b1,b2) (bitmask(b1) | bitmask(b2)) -#define l_setbit(x,b) setbits(x, bitmask(b)) -#define resetbit(x,b) resetbits(x, bitmask(b)) -#define testbit(x,b) testbits(x, bitmask(b)) -#define set2bits(x,b1,b2) setbits(x, (bit2mask(b1, b2))) -#define reset2bits(x,b1,b2) resetbits(x, (bit2mask(b1, b2))) -#define test2bits(x,b1,b2) testbits(x, (bit2mask(b1, b2))) - - - -/* -** Layout for bit use in `marked' field: -** bit 0 - object is white (type 0) -** bit 1 - object is white (type 1) -** bit 2 - object is black -** bit 3 - for userdata: has been finalized -** bit 3 - for tables: has weak keys -** bit 4 - for tables: has weak values -** bit 5 - object is fixed (should not be collected) -** bit 6 - object is "super" fixed (only the main thread) -*/ - - -#define WHITE0BIT 0 -#define WHITE1BIT 1 -#define BLACKBIT 2 -#define FINALIZEDBIT 3 -#define KEYWEAKBIT 3 -#define VALUEWEAKBIT 4 -#define FIXEDBIT 5 -#define SFIXEDBIT 6 -#define WHITEBITS bit2mask(WHITE0BIT, WHITE1BIT) - - -#define iswhite(x) test2bits((x)->gch.marked, WHITE0BIT, WHITE1BIT) -#define isblack(x) testbit((x)->gch.marked, BLACKBIT) -#define isgray(x) (!isblack(x) && !iswhite(x)) - -#define otherwhite(g) (g->currentwhite ^ WHITEBITS) -#define isdead(g,v) ((v)->gch.marked & otherwhite(g) & WHITEBITS) - -#define changewhite(x) ((x)->gch.marked ^= WHITEBITS) -#define gray2black(x) l_setbit((x)->gch.marked, BLACKBIT) - -#define valiswhite(x) (iscollectable(x) && iswhite(gcvalue(x))) - -#define luaC_white(g) cast(lu_byte, (g)->currentwhite & WHITEBITS) - - -#define luaC_checkGC(L) { \ - condhardstacktests(luaD_reallocstack(L, L->stacksize - EXTRA_STACK - 1)); \ - if (G(L)->totalbytes >= G(L)->GCthreshold) \ - luaC_step(L); } - - -#define luaC_barrier(L,p,v) { if (valiswhite(v) && isblack(obj2gco(p))) \ - luaC_barrierf(L,obj2gco(p),gcvalue(v)); } - -#define luaC_barriert(L,t,v) { if (valiswhite(v) && isblack(obj2gco(t))) \ - luaC_barrierback(L,t); } - -#define luaC_objbarrier(L,p,o) \ - { if (iswhite(obj2gco(o)) && isblack(obj2gco(p))) \ - luaC_barrierf(L,obj2gco(p),obj2gco(o)); } - -#define luaC_objbarriert(L,t,o) \ - { if (iswhite(obj2gco(o)) && isblack(obj2gco(t))) luaC_barrierback(L,t); } - -LUAI_FUNC size_t luaC_separateudata (lua_State *L, int all); -LUAI_FUNC void luaC_callGCTM (lua_State *L); -LUAI_FUNC void luaC_freeall (lua_State *L); -LUAI_FUNC void luaC_step (lua_State *L); -LUAI_FUNC void luaC_fullgc (lua_State *L); -LUAI_FUNC void luaC_link (lua_State *L, GCObject *o, lu_byte tt); -LUAI_FUNC void luaC_linkupval (lua_State *L, UpVal *uv); -LUAI_FUNC void luaC_barrierf (lua_State *L, GCObject *o, GCObject *v); -LUAI_FUNC void luaC_barrierback (lua_State *L, Table *t); - - -#endif diff --git a/script/lua/linit.c b/script/lua/linit.c deleted file mode 100644 index f920a0b08..000000000 --- a/script/lua/linit.c +++ /dev/null @@ -1,38 +0,0 @@ -/* -** $Id: linit.c,v 1.14.1.1 2007/12/27 13:02:25 roberto Exp $ -** Initialization of libraries for lua.c -** See Copyright Notice in lua.h -*/ - - -#define linit_c -#define LUA_LIB - -#include "lua.h" - -#include "lualib.h" -#include "lauxlib.h" - - -static const luaL_Reg lualibs[] = { - {"", luaopen_base}, -// {LUA_LOADLIBNAME, luaopen_package}, - {LUA_TABLIBNAME, luaopen_table}, -// {LUA_IOLIBNAME, luaopen_io}, -// {LUA_OSLIBNAME, luaopen_os}, - {LUA_STRLIBNAME, luaopen_string}, -// {LUA_MATHLIBNAME, luaopen_math}, -// {LUA_DBLIBNAME, luaopen_debug}, - {NULL, NULL} -}; - - -LUALIB_API void luaL_openlibs (lua_State *L) { - const luaL_Reg *lib = lualibs; - for (; lib->func; lib++) { - lua_pushcfunction(L, lib->func); - lua_pushstring(L, lib->name); - lua_call(L, 1, 0); - } -} - diff --git a/script/lua/liolib.c b/script/lua/liolib.c deleted file mode 100644 index e79ed1cb2..000000000 --- a/script/lua/liolib.c +++ /dev/null @@ -1,553 +0,0 @@ -/* -** $Id: liolib.c,v 2.73.1.3 2008/01/18 17:47:43 roberto Exp $ -** Standard I/O (and system) library -** See Copyright Notice in lua.h -*/ - - -#include -#include -#include -#include - -#define liolib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - - -#define IO_INPUT 1 -#define IO_OUTPUT 2 - - -static const char *const fnames[] = {"input", "output"}; - - -static int pushresult (lua_State *L, int i, const char *filename) { - int en = errno; /* calls to Lua API may change this value */ - if (i) { - lua_pushboolean(L, 1); - return 1; - } - else { - lua_pushnil(L); - if (filename) - lua_pushfstring(L, "%s: %s", filename, strerror(en)); - else - lua_pushfstring(L, "%s", strerror(en)); - lua_pushinteger(L, en); - return 3; - } -} - - -static void fileerror (lua_State *L, int arg, const char *filename) { - lua_pushfstring(L, "%s: %s", filename, strerror(errno)); - luaL_argerror(L, arg, lua_tostring(L, -1)); -} - - -#define tofilep(L) ((FILE **)luaL_checkudata(L, 1, LUA_FILEHANDLE)) - - -static int io_type (lua_State *L) { - void *ud; - luaL_checkany(L, 1); - ud = lua_touserdata(L, 1); - lua_getfield(L, LUA_REGISTRYINDEX, LUA_FILEHANDLE); - if (ud == NULL || !lua_getmetatable(L, 1) || !lua_rawequal(L, -2, -1)) - lua_pushnil(L); /* not a file */ - else if (*((FILE **)ud) == NULL) - lua_pushliteral(L, "closed file"); - else - lua_pushliteral(L, "file"); - return 1; -} - - -static FILE *tofile (lua_State *L) { - FILE **f = tofilep(L); - if (*f == NULL) - luaL_error(L, "attempt to use a closed file"); - return *f; -} - - - -/* -** When creating file handles, always creates a `closed' file handle -** before opening the actual file; so, if there is a memory error, the -** file is not left opened. -*/ -static FILE **newfile (lua_State *L) { - FILE **pf = (FILE **)lua_newuserdata(L, sizeof(FILE *)); - *pf = NULL; /* file handle is currently `closed' */ - luaL_getmetatable(L, LUA_FILEHANDLE); - lua_setmetatable(L, -2); - return pf; -} - - -/* -** function to (not) close the standard files stdin, stdout, and stderr -*/ -static int io_noclose (lua_State *L) { - lua_pushnil(L); - lua_pushliteral(L, "cannot close standard file"); - return 2; -} - - -/* -** function to close 'popen' files -*/ -static int io_pclose (lua_State *L) { - FILE **p = tofilep(L); - int ok = lua_pclose(L, *p); - *p = NULL; - return pushresult(L, ok, NULL); -} - - -/* -** function to close regular files -*/ -static int io_fclose (lua_State *L) { - FILE **p = tofilep(L); - int ok = (fclose(*p) == 0); - *p = NULL; - return pushresult(L, ok, NULL); -} - - -static int aux_close (lua_State *L) { - lua_getfenv(L, 1); - lua_getfield(L, -1, "__close"); - return (lua_tocfunction(L, -1))(L); -} - - -static int io_close (lua_State *L) { - if (lua_isnone(L, 1)) - lua_rawgeti(L, LUA_ENVIRONINDEX, IO_OUTPUT); - tofile(L); /* make sure argument is a file */ - return aux_close(L); -} - - -static int io_gc (lua_State *L) { - FILE *f = *tofilep(L); - /* ignore closed files */ - if (f != NULL) - aux_close(L); - return 0; -} - - -static int io_tostring (lua_State *L) { - FILE *f = *tofilep(L); - if (f == NULL) - lua_pushliteral(L, "file (closed)"); - else - lua_pushfstring(L, "file (%p)", f); - return 1; -} - - -static int io_open (lua_State *L) { - const char *filename = luaL_checkstring(L, 1); - const char *mode = luaL_optstring(L, 2, "r"); - FILE **pf = newfile(L); - *pf = fopen(filename, mode); - return (*pf == NULL) ? pushresult(L, 0, filename) : 1; -} - - -/* -** this function has a separated environment, which defines the -** correct __close for 'popen' files -*/ -static int io_popen (lua_State *L) { - const char *filename = luaL_checkstring(L, 1); - const char *mode = luaL_optstring(L, 2, "r"); - FILE **pf = newfile(L); - *pf = lua_popen(L, filename, mode); - return (*pf == NULL) ? pushresult(L, 0, filename) : 1; -} - - -static int io_tmpfile (lua_State *L) { - FILE **pf = newfile(L); - *pf = tmpfile(); - return (*pf == NULL) ? pushresult(L, 0, NULL) : 1; -} - - -static FILE *getiofile (lua_State *L, int findex) { - FILE *f; - lua_rawgeti(L, LUA_ENVIRONINDEX, findex); - f = *(FILE **)lua_touserdata(L, -1); - if (f == NULL) - luaL_error(L, "standard %s file is closed", fnames[findex - 1]); - return f; -} - - -static int g_iofile (lua_State *L, int f, const char *mode) { - if (!lua_isnoneornil(L, 1)) { - const char *filename = lua_tostring(L, 1); - if (filename) { - FILE **pf = newfile(L); - *pf = fopen(filename, mode); - if (*pf == NULL) - fileerror(L, 1, filename); - } - else { - tofile(L); /* check that it's a valid file handle */ - lua_pushvalue(L, 1); - } - lua_rawseti(L, LUA_ENVIRONINDEX, f); - } - /* return current value */ - lua_rawgeti(L, LUA_ENVIRONINDEX, f); - return 1; -} - - -static int io_input (lua_State *L) { - return g_iofile(L, IO_INPUT, "r"); -} - - -static int io_output (lua_State *L) { - return g_iofile(L, IO_OUTPUT, "w"); -} - - -static int io_readline (lua_State *L); - - -static void aux_lines (lua_State *L, int idx, int toclose) { - lua_pushvalue(L, idx); - lua_pushboolean(L, toclose); /* close/not close file when finished */ - lua_pushcclosure(L, io_readline, 2); -} - - -static int f_lines (lua_State *L) { - tofile(L); /* check that it's a valid file handle */ - aux_lines(L, 1, 0); - return 1; -} - - -static int io_lines (lua_State *L) { - if (lua_isnoneornil(L, 1)) { /* no arguments? */ - /* will iterate over default input */ - lua_rawgeti(L, LUA_ENVIRONINDEX, IO_INPUT); - return f_lines(L); - } - else { - const char *filename = luaL_checkstring(L, 1); - FILE **pf = newfile(L); - *pf = fopen(filename, "r"); - if (*pf == NULL) - fileerror(L, 1, filename); - aux_lines(L, lua_gettop(L), 1); - return 1; - } -} - - -/* -** {====================================================== -** READ -** ======================================================= -*/ - - -static int read_number (lua_State *L, FILE *f) { - lua_Number d; - if (fscanf(f, LUA_NUMBER_SCAN, &d) == 1) { - lua_pushnumber(L, d); - return 1; - } - else return 0; /* read fails */ -} - - -static int test_eof (lua_State *L, FILE *f) { - int c = getc(f); - ungetc(c, f); - lua_pushlstring(L, NULL, 0); - return (c != EOF); -} - - -static int read_line (lua_State *L, FILE *f) { - luaL_Buffer b; - luaL_buffinit(L, &b); - for (;;) { - size_t l; - char *p = luaL_prepbuffer(&b); - if (fgets(p, LUAL_BUFFERSIZE, f) == NULL) { /* eof? */ - luaL_pushresult(&b); /* close buffer */ - return (lua_objlen(L, -1) > 0); /* check whether read something */ - } - l = strlen(p); - if (l == 0 || p[l-1] != '\n') - luaL_addsize(&b, l); - else { - luaL_addsize(&b, l - 1); /* do not include `eol' */ - luaL_pushresult(&b); /* close buffer */ - return 1; /* read at least an `eol' */ - } - } -} - - -static int read_chars (lua_State *L, FILE *f, size_t n) { - size_t rlen; /* how much to read */ - size_t nr; /* number of chars actually read */ - luaL_Buffer b; - luaL_buffinit(L, &b); - rlen = LUAL_BUFFERSIZE; /* try to read that much each time */ - do { - char *p = luaL_prepbuffer(&b); - if (rlen > n) rlen = n; /* cannot read more than asked */ - nr = fread(p, sizeof(char), rlen, f); - luaL_addsize(&b, nr); - n -= nr; /* still have to read `n' chars */ - } while (n > 0 && nr == rlen); /* until end of count or eof */ - luaL_pushresult(&b); /* close buffer */ - return (n == 0 || lua_objlen(L, -1) > 0); -} - - -static int g_read (lua_State *L, FILE *f, int first) { - int nargs = lua_gettop(L) - 1; - int success; - int n; - clearerr(f); - if (nargs == 0) { /* no arguments? */ - success = read_line(L, f); - n = first+1; /* to return 1 result */ - } - else { /* ensure stack space for all results and for auxlib's buffer */ - luaL_checkstack(L, nargs+LUA_MINSTACK, "too many arguments"); - success = 1; - for (n = first; nargs-- && success; n++) { - if (lua_type(L, n) == LUA_TNUMBER) { - size_t l = (size_t)lua_tointeger(L, n); - success = (l == 0) ? test_eof(L, f) : read_chars(L, f, l); - } - else { - const char *p = lua_tostring(L, n); - luaL_argcheck(L, p && p[0] == '*', n, "invalid option"); - switch (p[1]) { - case 'n': /* number */ - success = read_number(L, f); - break; - case 'l': /* line */ - success = read_line(L, f); - break; - case 'a': /* file */ - read_chars(L, f, ~((size_t)0)); /* read MAX_SIZE_T chars */ - success = 1; /* always success */ - break; - default: - return luaL_argerror(L, n, "invalid format"); - } - } - } - } - if (ferror(f)) - return pushresult(L, 0, NULL); - if (!success) { - lua_pop(L, 1); /* remove last result */ - lua_pushnil(L); /* push nil instead */ - } - return n - first; -} - - -static int io_read (lua_State *L) { - return g_read(L, getiofile(L, IO_INPUT), 1); -} - - -static int f_read (lua_State *L) { - return g_read(L, tofile(L), 2); -} - - -static int io_readline (lua_State *L) { - FILE *f = *(FILE **)lua_touserdata(L, lua_upvalueindex(1)); - int sucess; - if (f == NULL) /* file is already closed? */ - luaL_error(L, "file is already closed"); - sucess = read_line(L, f); - if (ferror(f)) - return luaL_error(L, "%s", strerror(errno)); - if (sucess) return 1; - else { /* EOF */ - if (lua_toboolean(L, lua_upvalueindex(2))) { /* generator created file? */ - lua_settop(L, 0); - lua_pushvalue(L, lua_upvalueindex(1)); - aux_close(L); /* close it */ - } - return 0; - } -} - -/* }====================================================== */ - - -static int g_write (lua_State *L, FILE *f, int arg) { - int nargs = lua_gettop(L) - 1; - int status = 1; - for (; nargs--; arg++) { - if (lua_type(L, arg) == LUA_TNUMBER) { - /* optimization: could be done exactly as for strings */ - status = status && - fprintf(f, LUA_NUMBER_FMT, lua_tonumber(L, arg)) > 0; - } - else { - size_t l; - const char *s = luaL_checklstring(L, arg, &l); - status = status && (fwrite(s, sizeof(char), l, f) == l); - } - } - return pushresult(L, status, NULL); -} - - -static int io_write (lua_State *L) { - return g_write(L, getiofile(L, IO_OUTPUT), 1); -} - - -static int f_write (lua_State *L) { - return g_write(L, tofile(L), 2); -} - - -static int f_seek (lua_State *L) { - static const int mode[] = {SEEK_SET, SEEK_CUR, SEEK_END}; - static const char *const modenames[] = {"set", "cur", "end", NULL}; - FILE *f = tofile(L); - int op = luaL_checkoption(L, 2, "cur", modenames); - long offset = luaL_optlong(L, 3, 0); - op = fseek(f, offset, mode[op]); - if (op) - return pushresult(L, 0, NULL); /* error */ - else { - lua_pushinteger(L, ftell(f)); - return 1; - } -} - - -static int f_setvbuf (lua_State *L) { - static const int mode[] = {_IONBF, _IOFBF, _IOLBF}; - static const char *const modenames[] = {"no", "full", "line", NULL}; - FILE *f = tofile(L); - int op = luaL_checkoption(L, 2, NULL, modenames); - lua_Integer sz = luaL_optinteger(L, 3, LUAL_BUFFERSIZE); - int res = setvbuf(f, NULL, mode[op], sz); - return pushresult(L, res == 0, NULL); -} - - - -static int io_flush (lua_State *L) { - return pushresult(L, fflush(getiofile(L, IO_OUTPUT)) == 0, NULL); -} - - -static int f_flush (lua_State *L) { - return pushresult(L, fflush(tofile(L)) == 0, NULL); -} - - -static const luaL_Reg iolib[] = { - {"close", io_close}, - {"flush", io_flush}, - {"input", io_input}, - {"lines", io_lines}, - {"open", io_open}, - {"output", io_output}, - {"popen", io_popen}, - {"read", io_read}, - {"tmpfile", io_tmpfile}, - {"type", io_type}, - {"write", io_write}, - {NULL, NULL} -}; - - -static const luaL_Reg flib[] = { - {"close", io_close}, - {"flush", f_flush}, - {"lines", f_lines}, - {"read", f_read}, - {"seek", f_seek}, - {"setvbuf", f_setvbuf}, - {"write", f_write}, - {"__gc", io_gc}, - {"__tostring", io_tostring}, - {NULL, NULL} -}; - - -static void createmeta (lua_State *L) { - luaL_newmetatable(L, LUA_FILEHANDLE); /* create metatable for file handles */ - lua_pushvalue(L, -1); /* push metatable */ - lua_setfield(L, -2, "__index"); /* metatable.__index = metatable */ - luaL_register(L, NULL, flib); /* file methods */ -} - - -static void createstdfile (lua_State *L, FILE *f, int k, const char *fname) { - *newfile(L) = f; - if (k > 0) { - lua_pushvalue(L, -1); - lua_rawseti(L, LUA_ENVIRONINDEX, k); - } - lua_pushvalue(L, -2); /* copy environment */ - lua_setfenv(L, -2); /* set it */ - lua_setfield(L, -3, fname); -} - - -static void newfenv (lua_State *L, lua_CFunction cls) { - lua_createtable(L, 0, 1); - lua_pushcfunction(L, cls); - lua_setfield(L, -2, "__close"); -} - - -LUALIB_API int luaopen_io (lua_State *L) { - createmeta(L); - /* create (private) environment (with fields IO_INPUT, IO_OUTPUT, __close) */ - newfenv(L, io_fclose); - lua_replace(L, LUA_ENVIRONINDEX); - /* open library */ - luaL_register(L, LUA_IOLIBNAME, iolib); - /* create (and set) default files */ - newfenv(L, io_noclose); /* close function for default files */ - createstdfile(L, stdin, IO_INPUT, "stdin"); - createstdfile(L, stdout, IO_OUTPUT, "stdout"); - createstdfile(L, stderr, 0, "stderr"); - lua_pop(L, 1); /* pop environment for default files */ - lua_getfield(L, -1, "popen"); - newfenv(L, io_pclose); /* create environment for 'popen' */ - lua_setfenv(L, -2); /* set fenv for 'popen' */ - lua_pop(L, 1); /* pop 'popen' */ - return 1; -} - diff --git a/script/lua/llex.c b/script/lua/llex.c deleted file mode 100644 index cb08e8928..000000000 --- a/script/lua/llex.c +++ /dev/null @@ -1,467 +0,0 @@ -/* -** $Id: llex.c,v 2.20.1.1 2007/12/27 13:02:25 roberto Exp $ -** Lexical Analyzer -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#endif - -#define llex_c -#define LUA_CORE - -#include "lua.h" - -#include "ldo.h" -#include "llex.h" -#include "lobject.h" -#include "lparser.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "lzio.h" - - - -#define next(ls) (ls->current = zgetc(ls->z)) - - - - -#define currIsNewline(ls) (ls->current == '\n' || ls->current == '\r') - - -/* ORDER RESERVED */ -const char *const luaX_tokens [] = { - "and", "break", "do", "else", "elseif", - "end", "false", "for", "function", "if", - "in", "local", "nil", "not", "or", "repeat", - "return", "then", "true", "until", "while", - "..", "...", "==", ">=", "<=", "~=", - "", "", "", "", - NULL -}; - - -#define save_and_next(ls) (save(ls, ls->current), next(ls)) - - -static void save (LexState *ls, int c) { - Mbuffer *b = ls->buff; - if (b->n + 1 > b->buffsize) { - size_t newsize; - if (b->buffsize >= MAX_SIZET/2) - luaX_lexerror(ls, "lexical element too long", 0); - newsize = b->buffsize * 2; - luaZ_resizebuffer(ls->L, b, newsize); - } - b->buffer[b->n++] = cast(char, c); -} - - -void luaX_init (lua_State *L) { - int i; - for (i=0; itsv.reserved = cast_byte(i+1); /* reserved word */ - } -} - - -#define MAXSRC 80 - - -const char *luaX_token2str (LexState *ls, int token) { - if (token < FIRST_RESERVED) { - lua_assert(token == cast(unsigned char, token)); - return (iscntrl(token)) ? luaO_pushfstring(ls->L, "char(%d)", token) : - luaO_pushfstring(ls->L, "%c", token); - } - else - return luaX_tokens[token-FIRST_RESERVED]; -} - - -static const char *txtToken (LexState *ls, int token) { - switch (token) { - case TK_NAME: - case TK_STRING: - case TK_NUMBER: - save(ls, '\0'); - return luaZ_buffer(ls->buff); - default: - return luaX_token2str(ls, token); - } -} - - -void luaX_lexerror (LexState *ls, const char *msg, int token) { - char buff[MAXSRC]; - luaO_chunkid(buff, getstr(ls->source), MAXSRC); - msg = luaO_pushfstring(ls->L, "%s:%d: %s", buff, ls->linenumber, msg); - if (token) - luaO_pushfstring(ls->L, "%s near " LUA_QS, msg, txtToken(ls, token)); - luaD_throw(ls->L, LUA_ERRSYNTAX); -} - - -void luaX_syntaxerror (LexState *ls, const char *msg) { - luaX_lexerror(ls, msg, ls->t.token); -} - - -TString *luaX_newstring (LexState *ls, const char *str, size_t l) { - lua_State *L = ls->L; - TString *ts = luaS_newlstr(L, str, l); - TValue *o = luaH_setstr(L, ls->fs->h, ts); /* entry for `str' */ - if (ttisnil(o)) - setbvalue(o, 1); /* make sure `str' will not be collected */ - return ts; -} - - -static void inclinenumber (LexState *ls) { - int old = ls->current; - lua_assert(currIsNewline(ls)); - next(ls); /* skip `\n' or `\r' */ - if (currIsNewline(ls) && ls->current != old) - next(ls); /* skip `\n\r' or `\r\n' */ - if (++ls->linenumber >= MAX_INT) - luaX_syntaxerror(ls, "chunk has too many lines"); -} - - -void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, TString *source) { - ls->decpoint = '.'; - ls->L = L; - ls->lookahead.token = TK_EOS; /* no look-ahead token */ - ls->z = z; - ls->fs = NULL; - ls->linenumber = 1; - ls->lastline = 1; - ls->source = source; - luaZ_resizebuffer(ls->L, ls->buff, LUA_MINBUFFER); /* initialize buffer */ - next(ls); /* read first char */ -} - - - -/* -** ======================================================= -** LEXICAL ANALYZER -** ======================================================= -*/ - - - -static int check_next (LexState *ls, const char *set) { - if (!strchr(set, ls->current)) - return 0; - save_and_next(ls); - return 1; -} - - -static void buffreplace (LexState *ls, char from, char to) { - size_t n = luaZ_bufflen(ls->buff); - char *p = luaZ_buffer(ls->buff); - while (n--) - if (p[n] == from) p[n] = to; -} - - -static void trydecpoint (LexState *ls, SemInfo *seminfo) { - /* format error: try to update decimal point separator */ -#if 0 - struct lconv *cv = localeconv(); - char old = ls->decpoint; - ls->decpoint = (cv ? cv->decimal_point[0] : '.'); -#else - char old = ls->decpoint; - ls->decpoint = '.'; -#endif - buffreplace(ls, old, ls->decpoint); /* try updated decimal separator */ - if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) { - /* format error with correct decimal point: no more options */ - buffreplace(ls, ls->decpoint, '.'); /* undo change (for error message) */ - luaX_lexerror(ls, "malformed number", TK_NUMBER); - } -} - - -/* LUA_NUMBER */ -static void read_numeral (LexState *ls, SemInfo *seminfo) { - lua_assert(isdigit(ls->current)); - do { - save_and_next(ls); - } while (isdigit(ls->current) || ls->current == '.'); - if (check_next(ls, "Ee")) /* `E'? */ - check_next(ls, "+-"); /* optional exponent sign */ - while (isalnum(ls->current) || ls->current == '_') - save_and_next(ls); - save(ls, '\0'); - buffreplace(ls, '.', ls->decpoint); /* follow locale for decimal point */ - if (!luaO_str2d(luaZ_buffer(ls->buff), &seminfo->r)) /* format error? */ - trydecpoint(ls, seminfo); /* try to update decimal point separator */ -} - - -static int skip_sep (LexState *ls) { - int count = 0; - int s = ls->current; - lua_assert(s == '[' || s == ']'); - save_and_next(ls); - while (ls->current == '=') { - save_and_next(ls); - count++; - } - return (ls->current == s) ? count : (-count) - 1; -} - - -static void read_long_string (LexState *ls, SemInfo *seminfo, int sep) { - int cont = 0; - (void)(cont); /* avoid warnings when `cont' is not used */ - save_and_next(ls); /* skip 2nd `[' */ - if (currIsNewline(ls)) /* string starts with a newline? */ - inclinenumber(ls); /* skip it */ - for (;;) { - switch (ls->current) { - case EOZ: - luaX_lexerror(ls, (seminfo) ? "unfinished long string" : - "unfinished long comment", TK_EOS); - break; /* to avoid warnings */ -#if defined(LUA_COMPAT_LSTR) - case '[': { - if (skip_sep(ls) == sep) { - save_and_next(ls); /* skip 2nd `[' */ - cont++; -#if LUA_COMPAT_LSTR == 1 - if (sep == 0) - luaX_lexerror(ls, "nesting of [[...]] is deprecated", '['); -#endif - } - break; - } -#endif - case ']': { - if (skip_sep(ls) == sep) { - save_and_next(ls); /* skip 2nd `]' */ -#if defined(LUA_COMPAT_LSTR) && LUA_COMPAT_LSTR == 2 - cont--; - if (sep == 0 && cont >= 0) break; -#endif - goto endloop; - } - break; - } - case '\n': - case '\r': { - save(ls, '\n'); - inclinenumber(ls); - if (!seminfo) luaZ_resetbuffer(ls->buff); /* avoid wasting space */ - break; - } - default: { - if (seminfo) save_and_next(ls); - else next(ls); - } - } - } endloop: - if (seminfo) - seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + (2 + sep), - luaZ_bufflen(ls->buff) - 2*(2 + sep)); -} - - -static void read_string (LexState *ls, int del, SemInfo *seminfo) { - save_and_next(ls); - while (ls->current != del) { - switch (ls->current) { - case EOZ: - luaX_lexerror(ls, "unfinished string", TK_EOS); - continue; /* to avoid warnings */ - case '\n': - case '\r': - luaX_lexerror(ls, "unfinished string", TK_STRING); - continue; /* to avoid warnings */ - case '\\': { - int c; - next(ls); /* do not save the `\' */ - switch (ls->current) { - case 'a': c = '\a'; break; - case 'b': c = '\b'; break; - case 'f': c = '\f'; break; - case 'n': c = '\n'; break; - case 'r': c = '\r'; break; - case 't': c = '\t'; break; - case 'v': c = '\v'; break; - case '\n': /* go through */ - case '\r': save(ls, '\n'); inclinenumber(ls); continue; - case EOZ: continue; /* will raise an error next loop */ - default: { - if (!isdigit(ls->current)) - save_and_next(ls); /* handles \\, \", \', and \? */ - else { /* \xxx */ - int i = 0; - c = 0; - do { - c = 10*c + (ls->current-'0'); - next(ls); - } while (++i<3 && isdigit(ls->current)); - if (c > UCHAR_MAX) - luaX_lexerror(ls, "escape sequence too large", TK_STRING); - save(ls, c); - } - continue; - } - } - save(ls, c); - next(ls); - continue; - } - default: - save_and_next(ls); - } - } - save_and_next(ls); /* skip delimiter */ - seminfo->ts = luaX_newstring(ls, luaZ_buffer(ls->buff) + 1, - luaZ_bufflen(ls->buff) - 2); -} - - -static int llex (LexState *ls, SemInfo *seminfo) { - luaZ_resetbuffer(ls->buff); - for (;;) { - switch (ls->current) { - case '\n': - case '\r': { - inclinenumber(ls); - continue; - } - case '-': { - next(ls); - if (ls->current != '-') return '-'; - /* else is a comment */ - next(ls); - if (ls->current == '[') { - int sep = skip_sep(ls); - luaZ_resetbuffer(ls->buff); /* `skip_sep' may dirty the buffer */ - if (sep >= 0) { - read_long_string(ls, NULL, sep); /* long comment */ - luaZ_resetbuffer(ls->buff); - continue; - } - } - /* else short comment */ - while (!currIsNewline(ls) && ls->current != EOZ) - next(ls); - continue; - } - case '[': { - int sep = skip_sep(ls); - if (sep >= 0) { - read_long_string(ls, seminfo, sep); - return TK_STRING; - } - else if (sep == -1) return '['; - else luaX_lexerror(ls, "invalid long string delimiter", TK_STRING); - } - case '=': { - next(ls); - if (ls->current != '=') return '='; - else { next(ls); return TK_EQ; } - } - case '<': { - next(ls); - if (ls->current != '=') return '<'; - else { next(ls); return TK_LE; } - } - case '>': { - next(ls); - if (ls->current != '=') return '>'; - else { next(ls); return TK_GE; } - } - case '~': { - next(ls); - if (ls->current != '=') return '~'; - else { next(ls); return TK_NE; } - } - case '"': - case '\'': { - read_string(ls, ls->current, seminfo); - return TK_STRING; - } - case '.': { - save_and_next(ls); - if (check_next(ls, ".")) { - if (check_next(ls, ".")) - return TK_DOTS; /* ... */ - else return TK_CONCAT; /* .. */ - } - else if (!isdigit(ls->current)) return '.'; - else { - read_numeral(ls, seminfo); - return TK_NUMBER; - } - } - case EOZ: { - return TK_EOS; - } - default: { - if (isspace(ls->current)) { - lua_assert(!currIsNewline(ls)); - next(ls); - continue; - } - else if (isdigit(ls->current)) { - read_numeral(ls, seminfo); - return TK_NUMBER; - } - else if (isalpha(ls->current) || ls->current == '_') { - /* identifier or reserved word */ - TString *ts; - do { - save_and_next(ls); - } while (isalnum(ls->current) || ls->current == '_'); - ts = luaX_newstring(ls, luaZ_buffer(ls->buff), - luaZ_bufflen(ls->buff)); - if (ts->tsv.reserved > 0) /* reserved word? */ - return ts->tsv.reserved - 1 + FIRST_RESERVED; - else { - seminfo->ts = ts; - return TK_NAME; - } - } - else { - int c = ls->current; - next(ls); - return c; /* single-char tokens (+ - / ...) */ - } - } - } - } -} - - -void luaX_next (LexState *ls) { - ls->lastline = ls->linenumber; - if (ls->lookahead.token != TK_EOS) { /* is there a look-ahead token? */ - ls->t = ls->lookahead; /* use this one */ - ls->lookahead.token = TK_EOS; /* and discharge it */ - } - else - ls->t.token = llex(ls, &ls->t.seminfo); /* read next token */ -} - - -void luaX_lookahead (LexState *ls) { - lua_assert(ls->lookahead.token == TK_EOS); - ls->lookahead.token = llex(ls, &ls->lookahead.seminfo); -} - diff --git a/script/lua/llex.h b/script/lua/llex.h deleted file mode 100644 index a9201cee4..000000000 --- a/script/lua/llex.h +++ /dev/null @@ -1,81 +0,0 @@ -/* -** $Id: llex.h,v 1.58.1.1 2007/12/27 13:02:25 roberto Exp $ -** Lexical Analyzer -** See Copyright Notice in lua.h -*/ - -#ifndef llex_h -#define llex_h - -#include "lobject.h" -#include "lzio.h" - - -#define FIRST_RESERVED 257 - -/* maximum length of a reserved word */ -#define TOKEN_LEN (sizeof("function")/sizeof(char)) - - -/* -* WARNING: if you change the order of this enumeration, -* grep "ORDER RESERVED" -*/ -enum RESERVED { - /* terminal symbols denoted by reserved words */ - TK_AND = FIRST_RESERVED, TK_BREAK, - TK_DO, TK_ELSE, TK_ELSEIF, TK_END, TK_FALSE, TK_FOR, TK_FUNCTION, - TK_IF, TK_IN, TK_LOCAL, TK_NIL, TK_NOT, TK_OR, TK_REPEAT, - TK_RETURN, TK_THEN, TK_TRUE, TK_UNTIL, TK_WHILE, - /* other terminal symbols */ - TK_CONCAT, TK_DOTS, TK_EQ, TK_GE, TK_LE, TK_NE, TK_NUMBER, - TK_NAME, TK_STRING, TK_EOS -}; - -/* number of reserved words */ -#define NUM_RESERVED (cast(int, TK_WHILE-FIRST_RESERVED+1)) - - -/* array with token `names' */ -LUAI_DATA const char *const luaX_tokens []; - - -typedef union { - lua_Number r; - TString *ts; -} SemInfo; /* semantics information */ - - -typedef struct Token { - int token; - SemInfo seminfo; -} Token; - - -typedef struct LexState { - int current; /* current character (charint) */ - int linenumber; /* input line counter */ - int lastline; /* line of last token `consumed' */ - Token t; /* current token */ - Token lookahead; /* look ahead token */ - struct FuncState *fs; /* `FuncState' is private to the parser */ - struct lua_State *L; - ZIO *z; /* input stream */ - Mbuffer *buff; /* buffer for tokens */ - TString *source; /* current source name */ - char decpoint; /* locale decimal point */ -} LexState; - - -LUAI_FUNC void luaX_init (lua_State *L); -LUAI_FUNC void luaX_setinput (lua_State *L, LexState *ls, ZIO *z, - TString *source); -LUAI_FUNC TString *luaX_newstring (LexState *ls, const char *str, size_t l); -LUAI_FUNC void luaX_next (LexState *ls); -LUAI_FUNC void luaX_lookahead (LexState *ls); -LUAI_FUNC void luaX_lexerror (LexState *ls, const char *msg, int token); -LUAI_FUNC void luaX_syntaxerror (LexState *ls, const char *s); -LUAI_FUNC const char *luaX_token2str (LexState *ls, int token); - - -#endif diff --git a/script/lua/llimits.h b/script/lua/llimits.h deleted file mode 100644 index 5612e8a42..000000000 --- a/script/lua/llimits.h +++ /dev/null @@ -1,128 +0,0 @@ -/* -** $Id: llimits.h,v 1.69.1.1 2007/12/27 13:02:25 roberto Exp $ -** Limits, basic types, and some other `installation-dependent' definitions -** See Copyright Notice in lua.h -*/ - -#ifndef llimits_h -#define llimits_h - -#if 0 -#include -#include -#endif - -#include "lua.h" - - -typedef LUAI_UINT32 lu_int32; - -typedef LUAI_UMEM lu_mem; - -typedef LUAI_MEM l_mem; - - - -/* chars used as small naturals (so that `char' is reserved for characters) */ -typedef unsigned char lu_byte; - - -#define MAX_SIZET ((size_t)(~(size_t)0)-2) - -#define MAX_LUMEM ((lu_mem)(~(lu_mem)0)-2) - - -#define MAX_INT (int)(INT_MAX-2) /* maximum value of an int (-2 for safety) */ - -/* -** conversion of pointer to integer -** this is for hashing only; there is no problem if the integer -** cannot hold the whole pointer value -*/ -#define IntPoint(p) ((unsigned int)(lu_mem)(p)) - - - -/* type to ensure maximum alignment */ -typedef LUAI_USER_ALIGNMENT_T L_Umaxalign; - - -/* result of a `usual argument conversion' over lua_Number */ -typedef LUAI_UACNUMBER l_uacNumber; - - -/* internal assertions for in-house debugging */ -#ifdef lua_assert - -#define check_exp(c,e) (lua_assert(c), (e)) -#define api_check(l,e) lua_assert(e) - -#else - -#define lua_assert(c) ((void)0) -#define check_exp(c,e) (e) -#define api_check luai_apicheck - -#endif - - -#ifndef UNUSED -#define UNUSED(x) ((void)(x)) /* to avoid warnings */ -#endif - - -#ifndef cast -#define cast(t, exp) ((t)(exp)) -#endif - -#define cast_byte(i) cast(lu_byte, (i)) -#define cast_num(i) cast(lua_Number, (i)) -#define cast_int(i) cast(int, (i)) - - - -/* -** type for virtual-machine instructions -** must be an unsigned with (at least) 4 bytes (see details in lopcodes.h) -*/ -typedef lu_int32 Instruction; - - - -/* maximum stack for a Lua function */ -#define MAXSTACK 250 - - - -/* minimum size for the string table (must be power of 2) */ -#ifndef MINSTRTABSIZE -#define MINSTRTABSIZE 32 -#endif - - -/* minimum size for string buffer */ -#ifndef LUA_MINBUFFER -#define LUA_MINBUFFER 32 -#endif - - -#ifndef lua_lock -#define lua_lock(L) ((void) 0) -#define lua_unlock(L) ((void) 0) -#endif - -#ifndef luai_threadyield -#define luai_threadyield(L) {lua_unlock(L); lua_lock(L);} -#endif - - -/* -** macro to control inclusion of some hard tests on stack reallocation -*/ -#ifndef HARDSTACKTESTS -#define condhardstacktests(x) ((void)0) -#else -#define condhardstacktests(x) x -#endif - -#endif diff --git a/script/lua/lmathlib.c b/script/lua/lmathlib.c deleted file mode 100644 index 441fbf736..000000000 --- a/script/lua/lmathlib.c +++ /dev/null @@ -1,263 +0,0 @@ -/* -** $Id: lmathlib.c,v 1.67.1.1 2007/12/27 13:02:25 roberto Exp $ -** Standard mathematical library -** See Copyright Notice in lua.h -*/ - - -#include -#include - -#define lmathlib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#undef PI -#define PI (3.14159265358979323846) -#define RADIANS_PER_DEGREE (PI/180.0) - - - -static int math_abs (lua_State *L) { - lua_pushnumber(L, fabs(luaL_checknumber(L, 1))); - return 1; -} - -static int math_sin (lua_State *L) { - lua_pushnumber(L, sin(luaL_checknumber(L, 1))); - return 1; -} - -static int math_sinh (lua_State *L) { - lua_pushnumber(L, sinh(luaL_checknumber(L, 1))); - return 1; -} - -static int math_cos (lua_State *L) { - lua_pushnumber(L, cos(luaL_checknumber(L, 1))); - return 1; -} - -static int math_cosh (lua_State *L) { - lua_pushnumber(L, cosh(luaL_checknumber(L, 1))); - return 1; -} - -static int math_tan (lua_State *L) { - lua_pushnumber(L, tan(luaL_checknumber(L, 1))); - return 1; -} - -static int math_tanh (lua_State *L) { - lua_pushnumber(L, tanh(luaL_checknumber(L, 1))); - return 1; -} - -static int math_asin (lua_State *L) { - lua_pushnumber(L, asin(luaL_checknumber(L, 1))); - return 1; -} - -static int math_acos (lua_State *L) { - lua_pushnumber(L, acos(luaL_checknumber(L, 1))); - return 1; -} - -static int math_atan (lua_State *L) { - lua_pushnumber(L, atan(luaL_checknumber(L, 1))); - return 1; -} - -static int math_atan2 (lua_State *L) { - lua_pushnumber(L, atan2(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); - return 1; -} - -static int math_ceil (lua_State *L) { - lua_pushnumber(L, ceil(luaL_checknumber(L, 1))); - return 1; -} - -static int math_floor (lua_State *L) { - lua_pushnumber(L, floor(luaL_checknumber(L, 1))); - return 1; -} - -static int math_fmod (lua_State *L) { - lua_pushnumber(L, fmod(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); - return 1; -} - -static int math_modf (lua_State *L) { - double ip; - double fp = modf(luaL_checknumber(L, 1), &ip); - lua_pushnumber(L, ip); - lua_pushnumber(L, fp); - return 2; -} - -static int math_sqrt (lua_State *L) { - lua_pushnumber(L, sqrt(luaL_checknumber(L, 1))); - return 1; -} - -static int math_pow (lua_State *L) { - lua_pushnumber(L, pow(luaL_checknumber(L, 1), luaL_checknumber(L, 2))); - return 1; -} - -static int math_log (lua_State *L) { - lua_pushnumber(L, log(luaL_checknumber(L, 1))); - return 1; -} - -static int math_log10 (lua_State *L) { - lua_pushnumber(L, log10(luaL_checknumber(L, 1))); - return 1; -} - -static int math_exp (lua_State *L) { - lua_pushnumber(L, exp(luaL_checknumber(L, 1))); - return 1; -} - -static int math_deg (lua_State *L) { - lua_pushnumber(L, luaL_checknumber(L, 1)/RADIANS_PER_DEGREE); - return 1; -} - -static int math_rad (lua_State *L) { - lua_pushnumber(L, luaL_checknumber(L, 1)*RADIANS_PER_DEGREE); - return 1; -} - -static int math_frexp (lua_State *L) { - int e; - lua_pushnumber(L, frexp(luaL_checknumber(L, 1), &e)); - lua_pushinteger(L, e); - return 2; -} - -static int math_ldexp (lua_State *L) { - lua_pushnumber(L, ldexp(luaL_checknumber(L, 1), luaL_checkint(L, 2))); - return 1; -} - - - -static int math_min (lua_State *L) { - int n = lua_gettop(L); /* number of arguments */ - lua_Number dmin = luaL_checknumber(L, 1); - int i; - for (i=2; i<=n; i++) { - lua_Number d = luaL_checknumber(L, i); - if (d < dmin) - dmin = d; - } - lua_pushnumber(L, dmin); - return 1; -} - - -static int math_max (lua_State *L) { - int n = lua_gettop(L); /* number of arguments */ - lua_Number dmax = luaL_checknumber(L, 1); - int i; - for (i=2; i<=n; i++) { - lua_Number d = luaL_checknumber(L, i); - if (d > dmax) - dmax = d; - } - lua_pushnumber(L, dmax); - return 1; -} - - -static int math_random (lua_State *L) { - /* the `%' avoids the (rare) case of r==1, and is needed also because on - some systems (SunOS!) `rand()' may return a value larger than RAND_MAX */ - lua_Number r = (lua_Number)(rand()%RAND_MAX) / (lua_Number)RAND_MAX; - switch (lua_gettop(L)) { /* check number of arguments */ - case 0: { /* no arguments */ - lua_pushnumber(L, r); /* Number between 0 and 1 */ - break; - } - case 1: { /* only upper limit */ - int u = luaL_checkint(L, 1); - luaL_argcheck(L, 1<=u, 1, "interval is empty"); - lua_pushnumber(L, floor(r*u)+1); /* int between 1 and `u' */ - break; - } - case 2: { /* lower and upper limits */ - int l = luaL_checkint(L, 1); - int u = luaL_checkint(L, 2); - luaL_argcheck(L, l<=u, 2, "interval is empty"); - lua_pushnumber(L, floor(r*(u-l+1))+l); /* int between `l' and `u' */ - break; - } - default: return luaL_error(L, "wrong number of arguments"); - } - return 1; -} - - -static int math_randomseed (lua_State *L) { - srand(luaL_checkint(L, 1)); - return 0; -} - - -static const luaL_Reg mathlib[] = { - {"abs", math_abs}, - {"acos", math_acos}, - {"asin", math_asin}, - {"atan2", math_atan2}, - {"atan", math_atan}, - {"ceil", math_ceil}, - {"cosh", math_cosh}, - {"cos", math_cos}, - {"deg", math_deg}, - {"exp", math_exp}, - {"floor", math_floor}, - {"fmod", math_fmod}, - {"frexp", math_frexp}, - {"ldexp", math_ldexp}, - {"log10", math_log10}, - {"log", math_log}, - {"max", math_max}, - {"min", math_min}, - {"modf", math_modf}, - {"pow", math_pow}, - {"rad", math_rad}, - {"random", math_random}, - {"randomseed", math_randomseed}, - {"sinh", math_sinh}, - {"sin", math_sin}, - {"sqrt", math_sqrt}, - {"tanh", math_tanh}, - {"tan", math_tan}, - {NULL, NULL} -}; - - -/* -** Open math library -*/ -LUALIB_API int luaopen_math (lua_State *L) { - luaL_register(L, LUA_MATHLIBNAME, mathlib); - lua_pushnumber(L, PI); - lua_setfield(L, -2, "pi"); - lua_pushnumber(L, HUGE_VAL); - lua_setfield(L, -2, "huge"); -#if defined(LUA_COMPAT_MOD) - lua_getfield(L, -1, "fmod"); - lua_setfield(L, -2, "mod"); -#endif - return 1; -} - diff --git a/script/lua/lmem.c b/script/lua/lmem.c deleted file mode 100644 index ae7d8c965..000000000 --- a/script/lua/lmem.c +++ /dev/null @@ -1,86 +0,0 @@ -/* -** $Id: lmem.c,v 1.70.1.1 2007/12/27 13:02:25 roberto Exp $ -** Interface to Memory Manager -** See Copyright Notice in lua.h -*/ - - -#include - -#define lmem_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" - - - -/* -** About the realloc function: -** void * frealloc (void *ud, void *ptr, size_t osize, size_t nsize); -** (`osize' is the old size, `nsize' is the new size) -** -** Lua ensures that (ptr == NULL) iff (osize == 0). -** -** * frealloc(ud, NULL, 0, x) creates a new block of size `x' -** -** * frealloc(ud, p, x, 0) frees the block `p' -** (in this specific case, frealloc must return NULL). -** particularly, frealloc(ud, NULL, 0, 0) does nothing -** (which is equivalent to free(NULL) in ANSI C) -** -** frealloc returns NULL if it cannot create or reallocate the area -** (any reallocation to an equal or smaller size cannot fail!) -*/ - - - -#define MINSIZEARRAY 4 - - -void *luaM_growaux_ (lua_State *L, void *block, int *size, size_t size_elems, - int limit, const char *errormsg) { - void *newblock; - int newsize; - if (*size >= limit/2) { /* cannot double it? */ - if (*size >= limit) /* cannot grow even a little? */ - luaG_runerror(L, errormsg); - newsize = limit; /* still have at least one free place */ - } - else { - newsize = (*size)*2; - if (newsize < MINSIZEARRAY) - newsize = MINSIZEARRAY; /* minimum size */ - } - newblock = luaM_reallocv(L, block, *size, newsize, size_elems); - *size = newsize; /* update only when everything else is OK */ - return newblock; -} - - -void *luaM_toobig (lua_State *L) { - luaG_runerror(L, "memory allocation error: block too big"); - return NULL; /* to avoid warnings */ -} - - - -/* -** generic allocation routine. -*/ -void *luaM_realloc_ (lua_State *L, void *block, size_t osize, size_t nsize) { - global_State *g = G(L); - lua_assert((osize == 0) == (block == NULL)); - block = (*g->frealloc)(g->ud, block, osize, nsize); - if (block == NULL && nsize > 0) - luaD_throw(L, LUA_ERRMEM); - lua_assert((nsize == 0) == (block == NULL)); - g->totalbytes = (g->totalbytes - osize) + nsize; - return block; -} - diff --git a/script/lua/lmem.h b/script/lua/lmem.h deleted file mode 100644 index d33084d16..000000000 --- a/script/lua/lmem.h +++ /dev/null @@ -1,50 +0,0 @@ -/* -** $Id: lmem.h,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ -** Interface to Memory Manager -** See Copyright Notice in lua.h -*/ - -#ifndef lmem_h -#define lmem_h - -#if 0 -#include -#endif - -#include "llimits.h" -#include "lua.h" - -#define MEMERRMSG "not enough memory" - - -#define luaM_reallocv(L,b,on,n,e) \ - ((cast(size_t, (n)+1) <= MAX_SIZET/(e)) ? /* +1 to avoid warnings */ \ - luaM_realloc_(L, (b), (on)*(e), (n)*(e)) : \ - luaM_toobig(L)) - -#define luaM_freemem(L, b, s) luaM_realloc_(L, (b), (s), 0) -#define luaM_free(L, b) luaM_realloc_(L, (b), sizeof(*(b)), 0) -#define luaM_freearray(L, b, n, t) luaM_reallocv(L, (b), n, 0, sizeof(t)) - -#define luaM_malloc(L,t) luaM_realloc_(L, NULL, 0, (t)) -#define luaM_new(L,t) cast(t *, luaM_malloc(L, sizeof(t))) -#define luaM_newvector(L,n,t) \ - cast(t *, luaM_reallocv(L, NULL, 0, n, sizeof(t))) - -#define luaM_growvector(L,v,nelems,size,t,limit,e) \ - if ((nelems)+1 > (size)) \ - ((v)=cast(t *, luaM_growaux_(L,v,&(size),sizeof(t),limit,e))) - -#define luaM_reallocvector(L, v,oldn,n,t) \ - ((v)=cast(t *, luaM_reallocv(L, v, oldn, n, sizeof(t)))) - - -LUAI_FUNC void *luaM_realloc_ (lua_State *L, void *block, size_t oldsize, - size_t size); -LUAI_FUNC void *luaM_toobig (lua_State *L); -LUAI_FUNC void *luaM_growaux_ (lua_State *L, void *block, int *size, - size_t size_elem, int limit, - const char *errormsg); - -#endif - diff --git a/script/lua/loadlib.c b/script/lua/loadlib.c deleted file mode 100644 index 25e07d1bc..000000000 --- a/script/lua/loadlib.c +++ /dev/null @@ -1,665 +0,0 @@ -/* -** $Id: loadlib.c,v 1.52.1.3 2008/08/06 13:29:28 roberto Exp $ -** Dynamic library loader for Lua -** See Copyright Notice in lua.h -** -** This module contains an implementation of loadlib for Unix systems -** that have dlfcn, an implementation for Darwin (Mac OS X), an -** implementation for Windows, and a stub for other systems. -*/ - - -#include -#include - - -#define loadlib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -/* prefix for open functions in C libraries */ -#define LUA_POF "luaopen_" - -/* separator for open functions in C libraries */ -#define LUA_OFSEP "_" - - -#define LIBPREFIX "LOADLIB: " - -#define POF LUA_POF -#define LIB_FAIL "open" - - -/* error codes for ll_loadfunc */ -#define ERRLIB 1 -#define ERRFUNC 2 - -#define setprogdir(L) ((void)0) - - -static void ll_unloadlib (void *lib); -static void *ll_load (lua_State *L, const char *path); -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym); - - - -#if defined(LUA_DL_DLOPEN) -/* -** {======================================================================== -** This is an implementation of loadlib based on the dlfcn interface. -** The dlfcn interface is available in Linux, SunOS, Solaris, IRIX, FreeBSD, -** NetBSD, AIX 4.2, HPUX 11, and probably most other Unix flavors, at least -** as an emulation layer on top of native functions. -** ========================================================================= -*/ - -#include - -static void ll_unloadlib (void *lib) { - dlclose(lib); -} - - -static void *ll_load (lua_State *L, const char *path) { - void *lib = dlopen(path, RTLD_NOW); - if (lib == NULL) lua_pushstring(L, dlerror()); - return lib; -} - - -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { - lua_CFunction f = (lua_CFunction)dlsym(lib, sym); - if (f == NULL) lua_pushstring(L, dlerror()); - return f; -} - -/* }====================================================== */ - - - -#elif defined(LUA_DL_DLL) -/* -** {====================================================================== -** This is an implementation of loadlib for Windows using native functions. -** ======================================================================= -*/ - -#include - - -#undef setprogdir - -static void setprogdir (lua_State *L) { - char buff[MAX_PATH + 1]; - char *lb; - DWORD nsize = sizeof(buff)/sizeof(char); - DWORD n = GetModuleFileNameA(NULL, buff, nsize); - if (n == 0 || n == nsize || (lb = strrchr(buff, '\\')) == NULL) - luaL_error(L, "unable to get ModuleFileName"); - else { - *lb = '\0'; - luaL_gsub(L, lua_tostring(L, -1), LUA_EXECDIR, buff); - lua_remove(L, -2); /* remove original string */ - } -} - - -static void pusherror (lua_State *L) { - int error = GetLastError(); - char buffer[128]; - if (FormatMessageA(FORMAT_MESSAGE_IGNORE_INSERTS | FORMAT_MESSAGE_FROM_SYSTEM, - NULL, error, 0, buffer, sizeof(buffer), NULL)) - lua_pushstring(L, buffer); - else - lua_pushfstring(L, "system error %d\n", error); -} - -static void ll_unloadlib (void *lib) { - FreeLibrary((HINSTANCE)lib); -} - - -static void *ll_load (lua_State *L, const char *path) { - HINSTANCE lib = LoadLibraryA(path); - if (lib == NULL) pusherror(L); - return lib; -} - - -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { - lua_CFunction f = (lua_CFunction)GetProcAddress((HINSTANCE)lib, sym); - if (f == NULL) pusherror(L); - return f; -} - -/* }====================================================== */ - - - -#elif defined(LUA_DL_DYLD) -/* -** {====================================================================== -** Native Mac OS X / Darwin Implementation -** ======================================================================= -*/ - -#include - - -/* Mac appends a `_' before C function names */ -#undef POF -#define POF "_" LUA_POF - - -static void pusherror (lua_State *L) { - const char *err_str; - const char *err_file; - NSLinkEditErrors err; - int err_num; - NSLinkEditError(&err, &err_num, &err_file, &err_str); - lua_pushstring(L, err_str); -} - - -static const char *errorfromcode (NSObjectFileImageReturnCode ret) { - switch (ret) { - case NSObjectFileImageInappropriateFile: - return "file is not a bundle"; - case NSObjectFileImageArch: - return "library is for wrong CPU type"; - case NSObjectFileImageFormat: - return "bad format"; - case NSObjectFileImageAccess: - return "cannot access file"; - case NSObjectFileImageFailure: - default: - return "unable to load library"; - } -} - - -static void ll_unloadlib (void *lib) { - NSUnLinkModule((NSModule)lib, NSUNLINKMODULE_OPTION_RESET_LAZY_REFERENCES); -} - - -static void *ll_load (lua_State *L, const char *path) { - NSObjectFileImage img; - NSObjectFileImageReturnCode ret; - /* this would be a rare case, but prevents crashing if it happens */ - if(!_dyld_present()) { - lua_pushliteral(L, "dyld not present"); - return NULL; - } - ret = NSCreateObjectFileImageFromFile(path, &img); - if (ret == NSObjectFileImageSuccess) { - NSModule mod = NSLinkModule(img, path, NSLINKMODULE_OPTION_PRIVATE | - NSLINKMODULE_OPTION_RETURN_ON_ERROR); - NSDestroyObjectFileImage(img); - if (mod == NULL) pusherror(L); - return mod; - } - lua_pushstring(L, errorfromcode(ret)); - return NULL; -} - - -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { - NSSymbol nss = NSLookupSymbolInModule((NSModule)lib, sym); - if (nss == NULL) { - lua_pushfstring(L, "symbol " LUA_QS " not found", sym); - return NULL; - } - return (lua_CFunction)NSAddressOfSymbol(nss); -} - -/* }====================================================== */ - - - -#else -/* -** {====================================================== -** Fallback for other systems -** ======================================================= -*/ - -#undef LIB_FAIL -#define LIB_FAIL "absent" - - -#define DLMSG "dynamic libraries not enabled; check your Lua installation" - - -static void ll_unloadlib (void *lib) { - (void)lib; /* to avoid warnings */ -} - - -static void *ll_load (lua_State *L, const char *path) { - (void)path; /* to avoid warnings */ - lua_pushliteral(L, DLMSG); - return NULL; -} - - -static lua_CFunction ll_sym (lua_State *L, void *lib, const char *sym) { - (void)lib; (void)sym; /* to avoid warnings */ - lua_pushliteral(L, DLMSG); - return NULL; -} - -/* }====================================================== */ -#endif - - - -static void **ll_register (lua_State *L, const char *path) { - void **plib; - lua_pushfstring(L, "%s%s", LIBPREFIX, path); - lua_gettable(L, LUA_REGISTRYINDEX); /* check library in registry? */ - if (!lua_isnil(L, -1)) /* is there an entry? */ - plib = (void **)lua_touserdata(L, -1); - else { /* no entry yet; create one */ - lua_pop(L, 1); - plib = (void **)lua_newuserdata(L, sizeof(const void *)); - *plib = NULL; - luaL_getmetatable(L, "_LOADLIB"); - lua_setmetatable(L, -2); - lua_pushfstring(L, "%s%s", LIBPREFIX, path); - lua_pushvalue(L, -2); - lua_settable(L, LUA_REGISTRYINDEX); - } - return plib; -} - - -/* -** __gc tag method: calls library's `ll_unloadlib' function with the lib -** handle -*/ -static int gctm (lua_State *L) { - void **lib = (void **)luaL_checkudata(L, 1, "_LOADLIB"); - if (*lib) ll_unloadlib(*lib); - *lib = NULL; /* mark library as closed */ - return 0; -} - - -static int ll_loadfunc (lua_State *L, const char *path, const char *sym) { - void **reg = ll_register(L, path); - if (*reg == NULL) *reg = ll_load(L, path); - if (*reg == NULL) - return ERRLIB; /* unable to load library */ - else { - lua_CFunction f = ll_sym(L, *reg, sym); - if (f == NULL) - return ERRFUNC; /* unable to find function */ - lua_pushcfunction(L, f); - return 0; /* return function */ - } -} - - -static int ll_loadlib (lua_State *L) { - const char *path = luaL_checkstring(L, 1); - const char *init = luaL_checkstring(L, 2); - int stat = ll_loadfunc(L, path, init); - if (stat == 0) /* no errors? */ - return 1; /* return the loaded function */ - else { /* error; error message is on stack top */ - lua_pushnil(L); - lua_insert(L, -2); - lua_pushstring(L, (stat == ERRLIB) ? LIB_FAIL : "init"); - return 3; /* return nil, error message, and where */ - } -} - - - -/* -** {====================================================== -** 'require' function -** ======================================================= -*/ - - -static int readable (const char *filename) { - FILE *f = fopen(filename, "r"); /* try to open file */ - if (f == NULL) return 0; /* open failed */ - fclose(f); - return 1; -} - - -static const char *pushnexttemplate (lua_State *L, const char *path) { - const char *l; - while (*path == *LUA_PATHSEP) path++; /* skip separators */ - if (*path == '\0') return NULL; /* no more templates */ - l = strchr(path, *LUA_PATHSEP); /* find next separator */ - if (l == NULL) l = path + strlen(path); - lua_pushlstring(L, path, l - path); /* template */ - return l; -} - - -static const char *findfile (lua_State *L, const char *name, - const char *pname) { - const char *path; - name = luaL_gsub(L, name, ".", LUA_DIRSEP); - lua_getfield(L, LUA_ENVIRONINDEX, pname); - path = lua_tostring(L, -1); - if (path == NULL) - luaL_error(L, LUA_QL("package.%s") " must be a string", pname); - lua_pushliteral(L, ""); /* error accumulator */ - while ((path = pushnexttemplate(L, path)) != NULL) { - const char *filename; - filename = luaL_gsub(L, lua_tostring(L, -1), LUA_PATH_MARK, name); - lua_remove(L, -2); /* remove path template */ - if (readable(filename)) /* does file exist and is readable? */ - return filename; /* return that file name */ - lua_pushfstring(L, "\n\tno file " LUA_QS, filename); - lua_remove(L, -2); /* remove file name */ - lua_concat(L, 2); /* add entry to possible error message */ - } - return NULL; /* not found */ -} - - -static void loaderror (lua_State *L, const char *filename) { - luaL_error(L, "error loading module " LUA_QS " from file " LUA_QS ":\n\t%s", - lua_tostring(L, 1), filename, lua_tostring(L, -1)); -} - - -static int loader_Lua (lua_State *L) { - const char *filename; - const char *name = luaL_checkstring(L, 1); - filename = findfile(L, name, "path"); - if (filename == NULL) return 1; /* library not found in this path */ - if (luaL_loadfile(L, filename) != 0) - loaderror(L, filename); - return 1; /* library loaded successfully */ -} - - -static const char *mkfuncname (lua_State *L, const char *modname) { - const char *funcname; - const char *mark = strchr(modname, *LUA_IGMARK); - if (mark) modname = mark + 1; - funcname = luaL_gsub(L, modname, ".", LUA_OFSEP); - funcname = lua_pushfstring(L, POF"%s", funcname); - lua_remove(L, -2); /* remove 'gsub' result */ - return funcname; -} - - -static int loader_C (lua_State *L) { - const char *funcname; - const char *name = luaL_checkstring(L, 1); - const char *filename = findfile(L, name, "cpath"); - if (filename == NULL) return 1; /* library not found in this path */ - funcname = mkfuncname(L, name); - if (ll_loadfunc(L, filename, funcname) != 0) - loaderror(L, filename); - return 1; /* library loaded successfully */ -} - - -static int loader_Croot (lua_State *L) { - const char *funcname; - const char *filename; - const char *name = luaL_checkstring(L, 1); - const char *p = strchr(name, '.'); - int stat; - if (p == NULL) return 0; /* is root */ - lua_pushlstring(L, name, p - name); - filename = findfile(L, lua_tostring(L, -1), "cpath"); - if (filename == NULL) return 1; /* root not found */ - funcname = mkfuncname(L, name); - if ((stat = ll_loadfunc(L, filename, funcname)) != 0) { - if (stat != ERRFUNC) loaderror(L, filename); /* real error */ - lua_pushfstring(L, "\n\tno module " LUA_QS " in file " LUA_QS, - name, filename); - return 1; /* function not found */ - } - return 1; -} - - -static int loader_preload (lua_State *L) { - const char *name = luaL_checkstring(L, 1); - lua_getfield(L, LUA_ENVIRONINDEX, "preload"); - if (!lua_istable(L, -1)) - luaL_error(L, LUA_QL("package.preload") " must be a table"); - lua_getfield(L, -1, name); - if (lua_isnil(L, -1)) /* not found? */ - lua_pushfstring(L, "\n\tno field package.preload['%s']", name); - return 1; -} - - -static const int sentinel_ = 0; -#define sentinel ((void *)&sentinel_) - - -static int ll_require (lua_State *L) { - const char *name = luaL_checkstring(L, 1); - int i; - lua_settop(L, 1); /* _LOADED table will be at index 2 */ - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_getfield(L, 2, name); - if (lua_toboolean(L, -1)) { /* is it there? */ - if (lua_touserdata(L, -1) == sentinel) /* check loops */ - luaL_error(L, "loop or previous error loading module " LUA_QS, name); - return 1; /* package is already loaded */ - } - /* else must load it; iterate over available loaders */ - lua_getfield(L, LUA_ENVIRONINDEX, "loaders"); - if (!lua_istable(L, -1)) - luaL_error(L, LUA_QL("package.loaders") " must be a table"); - lua_pushliteral(L, ""); /* error message accumulator */ - for (i=1; ; i++) { - lua_rawgeti(L, -2, i); /* get a loader */ - if (lua_isnil(L, -1)) - luaL_error(L, "module " LUA_QS " not found:%s", - name, lua_tostring(L, -2)); - lua_pushstring(L, name); - lua_call(L, 1, 1); /* call it */ - if (lua_isfunction(L, -1)) /* did it find module? */ - break; /* module loaded successfully */ - else if (lua_isstring(L, -1)) /* loader returned error message? */ - lua_concat(L, 2); /* accumulate it */ - else - lua_pop(L, 1); - } - lua_pushlightuserdata(L, sentinel); - lua_setfield(L, 2, name); /* _LOADED[name] = sentinel */ - lua_pushstring(L, name); /* pass name as argument to module */ - lua_call(L, 1, 1); /* run loaded module */ - if (!lua_isnil(L, -1)) /* non-nil return? */ - lua_setfield(L, 2, name); /* _LOADED[name] = returned value */ - lua_getfield(L, 2, name); - if (lua_touserdata(L, -1) == sentinel) { /* module did not set a value? */ - lua_pushboolean(L, 1); /* use true as result */ - lua_pushvalue(L, -1); /* extra copy to be returned */ - lua_setfield(L, 2, name); /* _LOADED[name] = true */ - } - return 1; -} - -/* }====================================================== */ - - - -/* -** {====================================================== -** 'module' function -** ======================================================= -*/ - - -static void setfenv (lua_State *L) { - lua_Debug ar; - if (lua_getstack(L, 1, &ar) == 0 || - lua_getinfo(L, "f", &ar) == 0 || /* get calling function */ - lua_iscfunction(L, -1)) - luaL_error(L, LUA_QL("module") " not called from a Lua function"); - lua_pushvalue(L, -2); - lua_setfenv(L, -2); - lua_pop(L, 1); -} - - -static void dooptions (lua_State *L, int n) { - int i; - for (i = 2; i <= n; i++) { - lua_pushvalue(L, i); /* get option (a function) */ - lua_pushvalue(L, -2); /* module */ - lua_call(L, 1, 0); - } -} - - -static void modinit (lua_State *L, const char *modname) { - const char *dot; - lua_pushvalue(L, -1); - lua_setfield(L, -2, "_M"); /* module._M = module */ - lua_pushstring(L, modname); - lua_setfield(L, -2, "_NAME"); - dot = strrchr(modname, '.'); /* look for last dot in module name */ - if (dot == NULL) dot = modname; - else dot++; - /* set _PACKAGE as package name (full module name minus last part) */ - lua_pushlstring(L, modname, dot - modname); - lua_setfield(L, -2, "_PACKAGE"); -} - - -static int ll_module (lua_State *L) { - const char *modname = luaL_checkstring(L, 1); - int loaded = lua_gettop(L) + 1; /* index of _LOADED table */ - lua_getfield(L, LUA_REGISTRYINDEX, "_LOADED"); - lua_getfield(L, loaded, modname); /* get _LOADED[modname] */ - if (!lua_istable(L, -1)) { /* not found? */ - lua_pop(L, 1); /* remove previous result */ - /* try global variable (and create one if it does not exist) */ - if (luaL_findtable(L, LUA_GLOBALSINDEX, modname, 1) != NULL) - return luaL_error(L, "name conflict for module " LUA_QS, modname); - lua_pushvalue(L, -1); - lua_setfield(L, loaded, modname); /* _LOADED[modname] = new table */ - } - /* check whether table already has a _NAME field */ - lua_getfield(L, -1, "_NAME"); - if (!lua_isnil(L, -1)) /* is table an initialized module? */ - lua_pop(L, 1); - else { /* no; initialize it */ - lua_pop(L, 1); - modinit(L, modname); - } - lua_pushvalue(L, -1); - setfenv(L); - dooptions(L, loaded - 1); - return 0; -} - - -static int ll_seeall (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); - if (!lua_getmetatable(L, 1)) { - lua_createtable(L, 0, 1); /* create new metatable */ - lua_pushvalue(L, -1); - lua_setmetatable(L, 1); - } - lua_pushvalue(L, LUA_GLOBALSINDEX); - lua_setfield(L, -2, "__index"); /* mt.__index = _G */ - return 0; -} - - -/* }====================================================== */ - - - -/* auxiliary mark (for internal use) */ -#define AUXMARK "\1" - -static void setpath (lua_State *L, const char *fieldname, const char *envname, - const char *def) { - const char *path = getenv(envname); - if (path == NULL) /* no environment variable? */ - lua_pushstring(L, def); /* use default */ - else { - /* replace ";;" by ";AUXMARK;" and then AUXMARK by default path */ - path = luaL_gsub(L, path, LUA_PATHSEP LUA_PATHSEP, - LUA_PATHSEP AUXMARK LUA_PATHSEP); - luaL_gsub(L, path, AUXMARK, def); - lua_remove(L, -2); - } - setprogdir(L); - lua_setfield(L, -2, fieldname); -} - - -static const luaL_Reg pk_funcs[] = { - {"loadlib", ll_loadlib}, - {"seeall", ll_seeall}, - {NULL, NULL} -}; - - -static const luaL_Reg ll_funcs[] = { - {"module", ll_module}, - {"require", ll_require}, - {NULL, NULL} -}; - - -static const lua_CFunction loaders[] = - {loader_preload, loader_Lua, loader_C, loader_Croot, NULL}; - - -LUALIB_API int luaopen_package (lua_State *L) { - int i; - /* create new type _LOADLIB */ - luaL_newmetatable(L, "_LOADLIB"); - lua_pushcfunction(L, gctm); - lua_setfield(L, -2, "__gc"); - /* create `package' table */ - luaL_register(L, LUA_LOADLIBNAME, pk_funcs); -#if defined(LUA_COMPAT_LOADLIB) - lua_getfield(L, -1, "loadlib"); - lua_setfield(L, LUA_GLOBALSINDEX, "loadlib"); -#endif - lua_pushvalue(L, -1); - lua_replace(L, LUA_ENVIRONINDEX); - /* create `loaders' table */ - lua_createtable(L, 0, sizeof(loaders)/sizeof(loaders[0]) - 1); - /* fill it with pre-defined loaders */ - for (i=0; loaders[i] != NULL; i++) { - lua_pushcfunction(L, loaders[i]); - lua_rawseti(L, -2, i+1); - } - lua_setfield(L, -2, "loaders"); /* put it in field `loaders' */ - setpath(L, "path", LUA_PATH, LUA_PATH_DEFAULT); /* set field `path' */ - setpath(L, "cpath", LUA_CPATH, LUA_CPATH_DEFAULT); /* set field `cpath' */ - /* store config information */ - lua_pushliteral(L, LUA_DIRSEP "\n" LUA_PATHSEP "\n" LUA_PATH_MARK "\n" - LUA_EXECDIR "\n" LUA_IGMARK); - lua_setfield(L, -2, "config"); - /* set field `loaded' */ - luaL_findtable(L, LUA_REGISTRYINDEX, "_LOADED", 2); - lua_setfield(L, -2, "loaded"); - /* set field `preload' */ - lua_newtable(L); - lua_setfield(L, -2, "preload"); - lua_pushvalue(L, LUA_GLOBALSINDEX); - luaL_register(L, NULL, ll_funcs); /* open lib into global table */ - lua_pop(L, 1); - return 1; /* return 'package' table */ -} diff --git a/script/lua/lobject.c b/script/lua/lobject.c deleted file mode 100644 index 1e181d284..000000000 --- a/script/lua/lobject.c +++ /dev/null @@ -1,216 +0,0 @@ -/* -** $Id: lobject.c,v 2.22.1.1 2007/12/27 13:02:25 roberto Exp $ -** Some generic functions over Lua objects -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#include -#include -#endif - -#define lobject_c -#define LUA_CORE - -#include "lua.h" - -#include "ldo.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "lvm.h" - - - -const TValue luaO_nilobject_ = {{NULL}, LUA_TNIL}; - - -/* -** converts an integer to a "floating point byte", represented as -** (eeeeexxx), where the real value is (1xxx) * 2^(eeeee - 1) if -** eeeee != 0 and (xxx) otherwise. -*/ -int luaO_int2fb (unsigned int x) { - int e = 0; /* expoent */ - while (x >= 16) { - x = (x+1) >> 1; - e++; - } - if (x < 8) return x; - else return ((e+1) << 3) | (cast_int(x) - 8); -} - - -/* converts back */ -int luaO_fb2int (int x) { - int e = (x >> 3) & 31; - if (e == 0) return x; - else return ((x & 7)+8) << (e - 1); -} - - -int luaO_log2 (unsigned int x) { - static const lu_byte log_2[256] = { - 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5, - 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8, - 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8 - }; - int l = -1; - while (x >= 256) { l += 8; x >>= 8; } - return l + log_2[x]; - -} - - -int luaO_rawequalObj (const TValue *t1, const TValue *t2) { - if (ttype(t1) != ttype(t2)) return 0; - else switch (ttype(t1)) { - case LUA_TNIL: - return 1; - case LUA_TNUMBER: - return luai_numeq(nvalue(t1), nvalue(t2)); - case LUA_TBOOLEAN: - return bvalue(t1) == bvalue(t2); /* boolean true must be 1 !! */ - case LUA_TLIGHTUSERDATA: - return pvalue(t1) == pvalue(t2); - default: - lua_assert(iscollectable(t1)); - return gcvalue(t1) == gcvalue(t2); - } -} - - -int luaO_str2d (const char *s, lua_Number *result) { - char *endptr; - *result = lua_str2number(s, &endptr); - if (endptr == s) return 0; /* conversion failed */ - if (*endptr == 'x' || *endptr == 'X') /* maybe an hexadecimal constant? */ - *result = cast_num(strtoul(s, &endptr, 16)); - if (*endptr == '\0') return 1; /* most common case */ - while (isspace(cast(unsigned char, *endptr))) endptr++; - if (*endptr != '\0') return 0; /* invalid trailing characters? */ - return 1; -} - - - -static void pushstr (lua_State *L, const char *str) { - setsvalue2s(L, L->top, luaS_new(L, str)); - incr_top(L); -} - - -/* this function handles only `%d', `%c', %f, %p, and `%s' formats */ -const char *luaO_pushvfstring (lua_State *L, const char *fmt, va_list argp) { - int n = 1; - pushstr(L, ""); - for (;;) { - const char *e = strchr(fmt, '%'); - if (e == NULL) break; - setsvalue2s(L, L->top, luaS_newlstr(L, fmt, e-fmt)); - incr_top(L); - switch (*(e+1)) { - case 's': { - const char *s = va_arg(argp, char *); - if (s == NULL) s = "(null)"; - pushstr(L, s); - break; - } - case 'c': { - char buff[2]; - buff[0] = cast(char, va_arg(argp, int)); - buff[1] = '\0'; - pushstr(L, buff); - break; - } - case 'd': { - setnvalue(L->top, cast_num(va_arg(argp, int))); - incr_top(L); - break; - } - case 'f': { - setnvalue(L->top, cast_num(va_arg(argp, l_uacNumber))); - incr_top(L); - break; - } - case 'p': { - char buff[4*sizeof(void *) + 8]; /* should be enough space for a `%p' */ - sprintf(buff, "%p", va_arg(argp, void *)); - pushstr(L, buff); - break; - } - case '%': { - pushstr(L, "%"); - break; - } - default: { - char buff[3]; - buff[0] = '%'; - buff[1] = *(e+1); - buff[2] = '\0'; - pushstr(L, buff); - break; - } - } - n += 2; - fmt = e+2; - } - pushstr(L, fmt); - luaV_concat(L, n+1, cast_int(L->top - L->base) - 1); - L->top -= n; - return svalue(L->top - 1); -} - - -const char *luaO_pushfstring (lua_State *L, const char *fmt, ...) { - const char *msg; - va_list argp; - va_start(argp, fmt); - msg = luaO_pushvfstring(L, fmt, argp); - va_end(argp); - return msg; -} - - -void luaO_chunkid (char *out, const char *source, size_t bufflen) { - if (*source == '=') { - strncpy(out, source+1, bufflen); /* remove first char */ - out[bufflen-1] = '\0'; /* ensures null termination */ - } - else { /* out = "source", or "...source" */ - if (*source == '@') { - size_t l; - source++; /* skip the `@' */ - bufflen -= sizeof(" '...' "); - l = strlen(source); - strcpy(out, ""); - if (l > bufflen) { - source += (l-bufflen); /* get last part of file name */ - strcat(out, "..."); - } - strcat(out, source); - } - else { /* out = [string "string"] */ - size_t len = strcspn(source, "\n\r"); /* stop at first newline */ - bufflen -= sizeof(" [string \"...\"] "); - if (len > bufflen) len = bufflen; - strcpy(out, "[string \""); - if (source[len] != '\0') { /* must truncate? */ - strncat(out, source, len); - strcat(out, "..."); - } - else - strcat(out, source); - strcat(out, "\"]"); - } - } -} diff --git a/script/lua/lobject.h b/script/lua/lobject.h deleted file mode 100644 index 6234d507c..000000000 --- a/script/lua/lobject.h +++ /dev/null @@ -1,380 +0,0 @@ -/* -** $Id: lobject.h,v 2.20.1.2 2008/08/06 13:29:48 roberto Exp $ -** Type definitions for Lua objects -** See Copyright Notice in lua.h -*/ - - -#ifndef lobject_h -#define lobject_h - - -#include - - -#include "llimits.h" -#include "lua.h" - - -/* tags for values visible from Lua */ -#define LAST_TAG LUA_TTHREAD - -#define NUM_TAGS (LAST_TAG+1) - - -/* -** Extra tags for non-values -*/ -#define LUA_TPROTO (LAST_TAG+1) -#define LUA_TUPVAL (LAST_TAG+2) -#define LUA_TDEADKEY (LAST_TAG+3) - - -/* -** Union of all collectable objects -*/ -typedef union GCObject GCObject; - - -/* -** Common Header for all collectable objects (in macro form, to be -** included in other objects) -*/ -#define CommonHeader GCObject *next; lu_byte tt; lu_byte marked - - -/* -** Common header in struct form -*/ -typedef struct GCheader { - CommonHeader; -} GCheader; - - - - -/* -** Union of all Lua values -*/ -typedef union { - GCObject *gc; - void *p; - lua_Number n; - int b; -} Value; - - -/* -** Tagged Values -*/ - -#define TValuefields Value value; int tt - -typedef struct lua_TValue { - TValuefields; -} TValue; - - -/* Macros to test type */ -#define ttisnil(o) (ttype(o) == LUA_TNIL) -#define ttisnumber(o) (ttype(o) == LUA_TNUMBER) -#define ttisstring(o) (ttype(o) == LUA_TSTRING) -#define ttistable(o) (ttype(o) == LUA_TTABLE) -#define ttisfunction(o) (ttype(o) == LUA_TFUNCTION) -#define ttisboolean(o) (ttype(o) == LUA_TBOOLEAN) -#define ttisuserdata(o) (ttype(o) == LUA_TUSERDATA) -#define ttisthread(o) (ttype(o) == LUA_TTHREAD) -#define ttislightuserdata(o) (ttype(o) == LUA_TLIGHTUSERDATA) - -/* Macros to access values */ -#define ttype(o) ((o)->tt) -#define gcvalue(o) check_exp(iscollectable(o), (o)->value.gc) -#define pvalue(o) check_exp(ttislightuserdata(o), (o)->value.p) -#define nvalue(o) check_exp(ttisnumber(o), (o)->value.n) -#define rawtsvalue(o) check_exp(ttisstring(o), &(o)->value.gc->ts) -#define tsvalue(o) (&rawtsvalue(o)->tsv) -#define rawuvalue(o) check_exp(ttisuserdata(o), &(o)->value.gc->u) -#define uvalue(o) (&rawuvalue(o)->uv) -#define clvalue(o) check_exp(ttisfunction(o), &(o)->value.gc->cl) -#define hvalue(o) check_exp(ttistable(o), &(o)->value.gc->h) -#define bvalue(o) check_exp(ttisboolean(o), (o)->value.b) -#define thvalue(o) check_exp(ttisthread(o), &(o)->value.gc->th) - -#define l_isfalse(o) (ttisnil(o) || (ttisboolean(o) && bvalue(o) == 0)) - -/* -** for internal debug only -*/ -#define checkconsistency(obj) \ - lua_assert(!iscollectable(obj) || (ttype(obj) == (obj)->value.gc->gch.tt)) - -#define checkliveness(g,obj) \ - lua_assert(!iscollectable(obj) || \ - ((ttype(obj) == (obj)->value.gc->gch.tt) && !isdead(g, (obj)->value.gc))) - - -/* Macros to set values */ -#define setnilvalue(obj) ((obj)->tt=LUA_TNIL) - -#define setnvalue(obj,x) \ - { TValue *i_o=(obj); i_o->value.n=(x); i_o->tt=LUA_TNUMBER; } - -#define setpvalue(obj,x) \ - { TValue *i_o=(obj); i_o->value.p=(x); i_o->tt=LUA_TLIGHTUSERDATA; } - -#define setbvalue(obj,x) \ - { TValue *i_o=(obj); i_o->value.b=(x); i_o->tt=LUA_TBOOLEAN; } - -#define setsvalue(L,obj,x) \ - { TValue *i_o=(obj); \ - i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TSTRING; \ - checkliveness(G(L),i_o); } - -#define setuvalue(L,obj,x) \ - { TValue *i_o=(obj); \ - i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TUSERDATA; \ - checkliveness(G(L),i_o); } - -#define setthvalue(L,obj,x) \ - { TValue *i_o=(obj); \ - i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTHREAD; \ - checkliveness(G(L),i_o); } - -#define setclvalue(L,obj,x) \ - { TValue *i_o=(obj); \ - i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TFUNCTION; \ - checkliveness(G(L),i_o); } - -#define sethvalue(L,obj,x) \ - { TValue *i_o=(obj); \ - i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TTABLE; \ - checkliveness(G(L),i_o); } - -#define setptvalue(L,obj,x) \ - { TValue *i_o=(obj); \ - i_o->value.gc=cast(GCObject *, (x)); i_o->tt=LUA_TPROTO; \ - checkliveness(G(L),i_o); } - - - - -#define setobj(L,obj1,obj2) \ - { const TValue *o2=(obj2); TValue *o1=(obj1); \ - o1->value = o2->value; o1->tt=o2->tt; \ - checkliveness(G(L),o1); } - - -/* -** different types of sets, according to destination -*/ - -/* from stack to (same) stack */ -#define setobjs2s setobj -/* to stack (not from same stack) */ -#define setobj2s setobj -#define setsvalue2s setsvalue -#define sethvalue2s sethvalue -#define setptvalue2s setptvalue -/* from table to same table */ -#define setobjt2t setobj -/* to table */ -#define setobj2t setobj -/* to new object */ -#define setobj2n setobj -#define setsvalue2n setsvalue - -#define setttype(obj, tt) (ttype(obj) = (tt)) - - -#define iscollectable(o) (ttype(o) >= LUA_TSTRING) - - - -typedef TValue *StkId; /* index to stack elements */ - - -/* -** String headers for string table -*/ -typedef union TString { - L_Umaxalign dummy; /* ensures maximum alignment for strings */ - struct { - CommonHeader; - lu_byte reserved; - unsigned int hash; - size_t len; - } tsv; -} TString; - - -#define getstr(ts) cast(const char *, (ts) + 1) -#define svalue(o) getstr(rawtsvalue(o)) - - - -typedef union Udata { - L_Umaxalign dummy; /* ensures maximum alignment for `local' udata */ - struct { - CommonHeader; - struct Table *metatable; - struct Table *env; - size_t len; - } uv; -} Udata; - - - - -/* -** Function Prototypes -*/ -typedef struct Proto { - CommonHeader; - TValue *k; /* constants used by the function */ - Instruction *code; - struct Proto **p; /* functions defined inside the function */ - int *lineinfo; /* map from opcodes to source lines */ - struct LocVar *locvars; /* information about local variables */ - TString **upvalues; /* upvalue names */ - TString *source; - int sizeupvalues; - int sizek; /* size of `k' */ - int sizecode; - int sizelineinfo; - int sizep; /* size of `p' */ - int sizelocvars; - int linedefined; - int lastlinedefined; - GCObject *gclist; - lu_byte nups; /* number of upvalues */ - lu_byte numparams; - lu_byte is_vararg; - lu_byte maxstacksize; -} Proto; - - -/* masks for new-style vararg */ -#define VARARG_HASARG 1 -#define VARARG_ISVARARG 2 -#define VARARG_NEEDSARG 4 - - -typedef struct LocVar { - TString *varname; - int startpc; /* first point where variable is active */ - int endpc; /* first point where variable is dead */ -} LocVar; - - - -/* -** Upvalues -*/ - -typedef struct UpVal { - CommonHeader; - TValue *v; /* points to stack or to its own value */ - union { - TValue value; /* the value (when closed) */ - struct { /* double linked list (when open) */ - struct UpVal *prev; - struct UpVal *next; - } l; - } u; -} UpVal; - - -/* -** Closures -*/ - -#define ClosureHeader \ - CommonHeader; lu_byte isC; lu_byte nupvalues; GCObject *gclist; \ - struct Table *env - -typedef struct CClosure { - ClosureHeader; - lua_CFunction f; - TValue upvalue[1]; -} CClosure; - - -typedef struct LClosure { - ClosureHeader; - struct Proto *p; - UpVal *upvals[1]; -} LClosure; - - -typedef union Closure { - CClosure c; - LClosure l; -} Closure; - - -#define iscfunction(o) (ttype(o) == LUA_TFUNCTION && clvalue(o)->c.isC) -#define isLfunction(o) (ttype(o) == LUA_TFUNCTION && !clvalue(o)->c.isC) - - -/* -** Tables -*/ - -typedef union TKey { - struct { - TValuefields; - struct Node *next; /* for chaining */ - } nk; - TValue tvk; -} TKey; - - -typedef struct Node { - TValue i_val; - TKey i_key; -} Node; - - -typedef struct Table { - CommonHeader; - lu_byte flags; /* 1<

lsizenode)) - - -#define luaO_nilobject (&luaO_nilobject_) - -LUAI_DATA const TValue luaO_nilobject_; - -#define ceillog2(x) (luaO_log2((x)-1) + 1) - -LUAI_FUNC int luaO_log2 (unsigned int x); -LUAI_FUNC int luaO_int2fb (unsigned int x); -LUAI_FUNC int luaO_fb2int (int x); -LUAI_FUNC int luaO_rawequalObj (const TValue *t1, const TValue *t2); -LUAI_FUNC int luaO_str2d (const char *s, lua_Number *result); -LUAI_FUNC const char *luaO_pushvfstring (lua_State *L, const char *fmt, - va_list argp); -LUAI_FUNC const char *luaO_pushfstring (lua_State *L, const char *fmt, ...); -LUAI_FUNC void luaO_chunkid (char *out, const char *source, size_t len); - - -#endif diff --git a/script/lua/lopcodes.c b/script/lua/lopcodes.c deleted file mode 100644 index 4cc745230..000000000 --- a/script/lua/lopcodes.c +++ /dev/null @@ -1,102 +0,0 @@ -/* -** $Id: lopcodes.c,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ -** See Copyright Notice in lua.h -*/ - - -#define lopcodes_c -#define LUA_CORE - - -#include "lopcodes.h" - - -/* ORDER OP */ - -const char *const luaP_opnames[NUM_OPCODES+1] = { - "MOVE", - "LOADK", - "LOADBOOL", - "LOADNIL", - "GETUPVAL", - "GETGLOBAL", - "GETTABLE", - "SETGLOBAL", - "SETUPVAL", - "SETTABLE", - "NEWTABLE", - "SELF", - "ADD", - "SUB", - "MUL", - "DIV", - "MOD", - "POW", - "UNM", - "NOT", - "LEN", - "CONCAT", - "JMP", - "EQ", - "LT", - "LE", - "TEST", - "TESTSET", - "CALL", - "TAILCALL", - "RETURN", - "FORLOOP", - "FORPREP", - "TFORLOOP", - "SETLIST", - "CLOSE", - "CLOSURE", - "VARARG", - NULL -}; - - -#define opmode(t,a,b,c,m) (((t)<<7) | ((a)<<6) | ((b)<<4) | ((c)<<2) | (m)) - -const lu_byte luaP_opmodes[NUM_OPCODES] = { -/* T A B C mode opcode */ - opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_MOVE */ - ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_LOADK */ - ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_LOADBOOL */ - ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LOADNIL */ - ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_GETUPVAL */ - ,opmode(0, 1, OpArgK, OpArgN, iABx) /* OP_GETGLOBAL */ - ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_GETTABLE */ - ,opmode(0, 0, OpArgK, OpArgN, iABx) /* OP_SETGLOBAL */ - ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_SETUPVAL */ - ,opmode(0, 0, OpArgK, OpArgK, iABC) /* OP_SETTABLE */ - ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_NEWTABLE */ - ,opmode(0, 1, OpArgR, OpArgK, iABC) /* OP_SELF */ - ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_ADD */ - ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_SUB */ - ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MUL */ - ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_DIV */ - ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_MOD */ - ,opmode(0, 1, OpArgK, OpArgK, iABC) /* OP_POW */ - ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_UNM */ - ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_NOT */ - ,opmode(0, 1, OpArgR, OpArgN, iABC) /* OP_LEN */ - ,opmode(0, 1, OpArgR, OpArgR, iABC) /* OP_CONCAT */ - ,opmode(0, 0, OpArgR, OpArgN, iAsBx) /* OP_JMP */ - ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_EQ */ - ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LT */ - ,opmode(1, 0, OpArgK, OpArgK, iABC) /* OP_LE */ - ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TEST */ - ,opmode(1, 1, OpArgR, OpArgU, iABC) /* OP_TESTSET */ - ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_CALL */ - ,opmode(0, 1, OpArgU, OpArgU, iABC) /* OP_TAILCALL */ - ,opmode(0, 0, OpArgU, OpArgN, iABC) /* OP_RETURN */ - ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORLOOP */ - ,opmode(0, 1, OpArgR, OpArgN, iAsBx) /* OP_FORPREP */ - ,opmode(1, 0, OpArgN, OpArgU, iABC) /* OP_TFORLOOP */ - ,opmode(0, 0, OpArgU, OpArgU, iABC) /* OP_SETLIST */ - ,opmode(0, 0, OpArgN, OpArgN, iABC) /* OP_CLOSE */ - ,opmode(0, 1, OpArgU, OpArgN, iABx) /* OP_CLOSURE */ - ,opmode(0, 1, OpArgU, OpArgN, iABC) /* OP_VARARG */ -}; - diff --git a/script/lua/lopcodes.h b/script/lua/lopcodes.h deleted file mode 100644 index ad66eea98..000000000 --- a/script/lua/lopcodes.h +++ /dev/null @@ -1,268 +0,0 @@ -/* -** $Id: lopcodes.h,v 1.125.1.1 2007/12/27 13:02:25 roberto Exp $ -** Opcodes for Lua virtual machine -** See Copyright Notice in lua.h -*/ - -#ifndef lopcodes_h -#define lopcodes_h - -#include "llimits.h" - - -/*=========================================================================== - We assume that instructions are unsigned numbers. - All instructions have an opcode in the first 6 bits. - Instructions can have the following fields: - `A' : 8 bits - `B' : 9 bits - `C' : 9 bits - `Bx' : 18 bits (`B' and `C' together) - `sBx' : signed Bx - - A signed argument is represented in excess K; that is, the number - value is the unsigned value minus K. K is exactly the maximum value - for that argument (so that -max is represented by 0, and +max is - represented by 2*max), which is half the maximum for the corresponding - unsigned argument. -===========================================================================*/ - - -enum OpMode {iABC, iABx, iAsBx}; /* basic instruction format */ - - -/* -** size and position of opcode arguments. -*/ -#define SIZE_C 9 -#define SIZE_B 9 -#define SIZE_Bx (SIZE_C + SIZE_B) -#define SIZE_A 8 - -#define SIZE_OP 6 - -#define POS_OP 0 -#define POS_A (POS_OP + SIZE_OP) -#define POS_C (POS_A + SIZE_A) -#define POS_B (POS_C + SIZE_C) -#define POS_Bx POS_C - - -/* -** limits for opcode arguments. -** we use (signed) int to manipulate most arguments, -** so they must fit in LUAI_BITSINT-1 bits (-1 for sign) -*/ -#if SIZE_Bx < LUAI_BITSINT-1 -#define MAXARG_Bx ((1<>1) /* `sBx' is signed */ -#else -#define MAXARG_Bx MAX_INT -#define MAXARG_sBx MAX_INT -#endif - - -#define MAXARG_A ((1<>POS_OP) & MASK1(SIZE_OP,0))) -#define SET_OPCODE(i,o) ((i) = (((i)&MASK0(SIZE_OP,POS_OP)) | \ - ((cast(Instruction, o)<>POS_A) & MASK1(SIZE_A,0))) -#define SETARG_A(i,u) ((i) = (((i)&MASK0(SIZE_A,POS_A)) | \ - ((cast(Instruction, u)<>POS_B) & MASK1(SIZE_B,0))) -#define SETARG_B(i,b) ((i) = (((i)&MASK0(SIZE_B,POS_B)) | \ - ((cast(Instruction, b)<>POS_C) & MASK1(SIZE_C,0))) -#define SETARG_C(i,b) ((i) = (((i)&MASK0(SIZE_C,POS_C)) | \ - ((cast(Instruction, b)<>POS_Bx) & MASK1(SIZE_Bx,0))) -#define SETARG_Bx(i,b) ((i) = (((i)&MASK0(SIZE_Bx,POS_Bx)) | \ - ((cast(Instruction, b)< C) then pc++ */ -OP_TESTSET,/* A B C if (R(B) <=> C) then R(A) := R(B) else pc++ */ - -OP_CALL,/* A B C R(A), ... ,R(A+C-2) := R(A)(R(A+1), ... ,R(A+B-1)) */ -OP_TAILCALL,/* A B C return R(A)(R(A+1), ... ,R(A+B-1)) */ -OP_RETURN,/* A B return R(A), ... ,R(A+B-2) (see note) */ - -OP_FORLOOP,/* A sBx R(A)+=R(A+2); - if R(A) =) R(A)*/ -OP_CLOSURE,/* A Bx R(A) := closure(KPROTO[Bx], R(A), ... ,R(A+n)) */ - -OP_VARARG/* A B R(A), R(A+1), ..., R(A+B-1) = vararg */ -} OpCode; - - -#define NUM_OPCODES (cast(int, OP_VARARG) + 1) - - - -/*=========================================================================== - Notes: - (*) In OP_CALL, if (B == 0) then B = top. C is the number of returns - 1, - and can be 0: OP_CALL then sets `top' to last_result+1, so - next open instruction (OP_CALL, OP_RETURN, OP_SETLIST) may use `top'. - - (*) In OP_VARARG, if (B == 0) then use actual number of varargs and - set top (like in OP_CALL with C == 0). - - (*) In OP_RETURN, if (B == 0) then return up to `top' - - (*) In OP_SETLIST, if (B == 0) then B = `top'; - if (C == 0) then next `instruction' is real C - - (*) For comparisons, A specifies what condition the test should accept - (true or false). - - (*) All `skips' (pc++) assume that next instruction is a jump -===========================================================================*/ - - -/* -** masks for instruction properties. The format is: -** bits 0-1: op mode -** bits 2-3: C arg mode -** bits 4-5: B arg mode -** bit 6: instruction set register A -** bit 7: operator is a test -*/ - -enum OpArgMask { - OpArgN, /* argument is not used */ - OpArgU, /* argument is used */ - OpArgR, /* argument is a register or a jump offset */ - OpArgK /* argument is a constant or register/constant */ -}; - -LUAI_DATA const lu_byte luaP_opmodes[NUM_OPCODES]; - -#define getOpMode(m) (cast(enum OpMode, luaP_opmodes[m] & 3)) -#define getBMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 4) & 3)) -#define getCMode(m) (cast(enum OpArgMask, (luaP_opmodes[m] >> 2) & 3)) -#define testAMode(m) (luaP_opmodes[m] & (1 << 6)) -#define testTMode(m) (luaP_opmodes[m] & (1 << 7)) - - -LUAI_DATA const char *const luaP_opnames[NUM_OPCODES+1]; /* opcode names */ - - -/* number of list items to accumulate before a SETLIST instruction */ -#define LFIELDS_PER_FLUSH 50 - - -#endif diff --git a/script/lua/loslib.c b/script/lua/loslib.c deleted file mode 100644 index da06a572a..000000000 --- a/script/lua/loslib.c +++ /dev/null @@ -1,243 +0,0 @@ -/* -** $Id: loslib.c,v 1.19.1.3 2008/01/18 16:38:18 roberto Exp $ -** Standard Operating System library -** See Copyright Notice in lua.h -*/ - - -#include -#include -#include -#include -#include - -#define loslib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -static int os_pushresult (lua_State *L, int i, const char *filename) { - int en = errno; /* calls to Lua API may change this value */ - if (i) { - lua_pushboolean(L, 1); - return 1; - } - else { - lua_pushnil(L); - lua_pushfstring(L, "%s: %s", filename, strerror(en)); - lua_pushinteger(L, en); - return 3; - } -} - - -static int os_execute (lua_State *L) { - lua_pushinteger(L, system(luaL_optstring(L, 1, NULL))); - return 1; -} - - -static int os_remove (lua_State *L) { - const char *filename = luaL_checkstring(L, 1); - return os_pushresult(L, remove(filename) == 0, filename); -} - - -static int os_rename (lua_State *L) { - const char *fromname = luaL_checkstring(L, 1); - const char *toname = luaL_checkstring(L, 2); - return os_pushresult(L, rename(fromname, toname) == 0, fromname); -} - - -static int os_tmpname (lua_State *L) { - char buff[LUA_TMPNAMBUFSIZE]; - int err; - lua_tmpnam(buff, err); - if (err) - return luaL_error(L, "unable to generate a unique filename"); - lua_pushstring(L, buff); - return 1; -} - - -static int os_getenv (lua_State *L) { - lua_pushstring(L, getenv(luaL_checkstring(L, 1))); /* if NULL push nil */ - return 1; -} - - -static int os_clock (lua_State *L) { - lua_pushnumber(L, ((lua_Number)clock())/(lua_Number)CLOCKS_PER_SEC); - return 1; -} - - -/* -** {====================================================== -** Time/Date operations -** { year=%Y, month=%m, day=%d, hour=%H, min=%M, sec=%S, -** wday=%w+1, yday=%j, isdst=? } -** ======================================================= -*/ - -static void setfield (lua_State *L, const char *key, int value) { - lua_pushinteger(L, value); - lua_setfield(L, -2, key); -} - -static void setboolfield (lua_State *L, const char *key, int value) { - if (value < 0) /* undefined? */ - return; /* does not set field */ - lua_pushboolean(L, value); - lua_setfield(L, -2, key); -} - -static int getboolfield (lua_State *L, const char *key) { - int res; - lua_getfield(L, -1, key); - res = lua_isnil(L, -1) ? -1 : lua_toboolean(L, -1); - lua_pop(L, 1); - return res; -} - - -static int getfield (lua_State *L, const char *key, int d) { - int res; - lua_getfield(L, -1, key); - if (lua_isnumber(L, -1)) - res = (int)lua_tointeger(L, -1); - else { - if (d < 0) - return luaL_error(L, "field " LUA_QS " missing in date table", key); - res = d; - } - lua_pop(L, 1); - return res; -} - - -static int os_date (lua_State *L) { - const char *s = luaL_optstring(L, 1, "%c"); - time_t t = luaL_opt(L, (time_t)luaL_checknumber, 2, time(NULL)); - struct tm *stm; - if (*s == '!') { /* UTC? */ - stm = gmtime(&t); - s++; /* skip `!' */ - } - else - stm = localtime(&t); - if (stm == NULL) /* invalid date? */ - lua_pushnil(L); - else if (strcmp(s, "*t") == 0) { - lua_createtable(L, 0, 9); /* 9 = number of fields */ - setfield(L, "sec", stm->tm_sec); - setfield(L, "min", stm->tm_min); - setfield(L, "hour", stm->tm_hour); - setfield(L, "day", stm->tm_mday); - setfield(L, "month", stm->tm_mon+1); - setfield(L, "year", stm->tm_year+1900); - setfield(L, "wday", stm->tm_wday+1); - setfield(L, "yday", stm->tm_yday+1); - setboolfield(L, "isdst", stm->tm_isdst); - } - else { - char cc[3]; - luaL_Buffer b; - cc[0] = '%'; cc[2] = '\0'; - luaL_buffinit(L, &b); - for (; *s; s++) { - if (*s != '%' || *(s + 1) == '\0') /* no conversion specifier? */ - luaL_addchar(&b, *s); - else { - size_t reslen; - char buff[200]; /* should be big enough for any conversion result */ - cc[1] = *(++s); - reslen = strftime(buff, sizeof(buff), cc, stm); - luaL_addlstring(&b, buff, reslen); - } - } - luaL_pushresult(&b); - } - return 1; -} - - -static int os_time (lua_State *L) { - time_t t; - if (lua_isnoneornil(L, 1)) /* called without args? */ - t = time(NULL); /* get current time */ - else { - struct tm ts; - luaL_checktype(L, 1, LUA_TTABLE); - lua_settop(L, 1); /* make sure table is at the top */ - ts.tm_sec = getfield(L, "sec", 0); - ts.tm_min = getfield(L, "min", 0); - ts.tm_hour = getfield(L, "hour", 12); - ts.tm_mday = getfield(L, "day", -1); - ts.tm_mon = getfield(L, "month", -1) - 1; - ts.tm_year = getfield(L, "year", -1) - 1900; - ts.tm_isdst = getboolfield(L, "isdst"); - t = mktime(&ts); - } - if (t == (time_t)(-1)) - lua_pushnil(L); - else - lua_pushnumber(L, (lua_Number)t); - return 1; -} - - -static int os_difftime (lua_State *L) { - lua_pushnumber(L, difftime((time_t)(luaL_checknumber(L, 1)), - (time_t)(luaL_optnumber(L, 2, 0)))); - return 1; -} - -/* }====================================================== */ - - -static int os_setlocale (lua_State *L) { - static const int cat[] = {LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, - LC_NUMERIC, LC_TIME}; - static const char *const catnames[] = {"all", "collate", "ctype", "monetary", - "numeric", "time", NULL}; - const char *l = luaL_optstring(L, 1, NULL); - int op = luaL_checkoption(L, 2, "all", catnames); - lua_pushstring(L, setlocale(cat[op], l)); - return 1; -} - - -static int os_exit (lua_State *L) { - exit(luaL_optint(L, 1, EXIT_SUCCESS)); -} - -static const luaL_Reg syslib[] = { - {"clock", os_clock}, - {"date", os_date}, - {"difftime", os_difftime}, - {"execute", os_execute}, - {"exit", os_exit}, - {"getenv", os_getenv}, - {"remove", os_remove}, - {"rename", os_rename}, - {"setlocale", os_setlocale}, - {"time", os_time}, - {"tmpname", os_tmpname}, - {NULL, NULL} -}; - -/* }====================================================== */ - - - -LUALIB_API int luaopen_os (lua_State *L) { - luaL_register(L, LUA_OSLIBNAME, syslib); - return 1; -} - diff --git a/script/lua/lparser.c b/script/lua/lparser.c deleted file mode 100644 index 309f51891..000000000 --- a/script/lua/lparser.c +++ /dev/null @@ -1,1340 +0,0 @@ -/* -** $Id: lparser.c,v 2.42.1.3 2007/12/28 15:32:23 roberto Exp $ -** Lua Parser -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#endif - -#define lparser_c -#define LUA_CORE - -#include "lua.h" - -#include "lcode.h" -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "llex.h" -#include "lmem.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lparser.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" - - - -#define hasmultret(k) ((k) == VCALL || (k) == VVARARG) - -#define getlocvar(fs, i) ((fs)->f->locvars[(fs)->actvar[i]]) - -#define luaY_checklimit(fs,v,l,m) if ((v)>(l)) errorlimit(fs,l,m) - - -/* -** nodes for block list (list of active blocks) -*/ -typedef struct BlockCnt { - struct BlockCnt *previous; /* chain */ - int breaklist; /* list of jumps out of this loop */ - lu_byte nactvar; /* # active locals outside the breakable structure */ - lu_byte upval; /* true if some variable in the block is an upvalue */ - lu_byte isbreakable; /* true if `block' is a loop */ -} BlockCnt; - - - -/* -** prototypes for recursive non-terminal functions -*/ -static void chunk (LexState *ls); -static void expr (LexState *ls, expdesc *v); - - -static void anchor_token (LexState *ls) { - if (ls->t.token == TK_NAME || ls->t.token == TK_STRING) { - TString *ts = ls->t.seminfo.ts; - luaX_newstring(ls, getstr(ts), ts->tsv.len); - } -} - - -static void error_expected (LexState *ls, int token) { - luaX_syntaxerror(ls, - luaO_pushfstring(ls->L, LUA_QS " expected", luaX_token2str(ls, token))); -} - - -static void errorlimit (FuncState *fs, int limit, const char *what) { - const char *msg = (fs->f->linedefined == 0) ? - luaO_pushfstring(fs->L, "main function has more than %d %s", limit, what) : - luaO_pushfstring(fs->L, "function at line %d has more than %d %s", - fs->f->linedefined, limit, what); - luaX_lexerror(fs->ls, msg, 0); -} - - -static int testnext (LexState *ls, int c) { - if (ls->t.token == c) { - luaX_next(ls); - return 1; - } - else return 0; -} - - -static void check (LexState *ls, int c) { - if (ls->t.token != c) - error_expected(ls, c); -} - -static void checknext (LexState *ls, int c) { - check(ls, c); - luaX_next(ls); -} - - -#define check_condition(ls,c,msg) { if (!(c)) luaX_syntaxerror(ls, msg); } - - - -static void check_match (LexState *ls, int what, int who, int where) { - if (!testnext(ls, what)) { - if (where == ls->linenumber) - error_expected(ls, what); - else { - luaX_syntaxerror(ls, luaO_pushfstring(ls->L, - LUA_QS " expected (to close " LUA_QS " at line %d)", - luaX_token2str(ls, what), luaX_token2str(ls, who), where)); - } - } -} - - -static TString *str_checkname (LexState *ls) { - TString *ts; - check(ls, TK_NAME); - ts = ls->t.seminfo.ts; - luaX_next(ls); - return ts; -} - - -static void init_exp (expdesc *e, expkind k, int i) { - e->f = e->t = NO_JUMP; - e->k = k; - e->u.s.info = i; -} - - -static void codestring (LexState *ls, expdesc *e, TString *s) { - init_exp(e, VK, luaK_stringK(ls->fs, s)); -} - - -static void checkname(LexState *ls, expdesc *e) { - codestring(ls, e, str_checkname(ls)); -} - - -static int registerlocalvar (LexState *ls, TString *varname) { - FuncState *fs = ls->fs; - Proto *f = fs->f; - int oldsize = f->sizelocvars; - luaM_growvector(ls->L, f->locvars, fs->nlocvars, f->sizelocvars, - LocVar, SHRT_MAX, "too many local variables"); - while (oldsize < f->sizelocvars) f->locvars[oldsize++].varname = NULL; - f->locvars[fs->nlocvars].varname = varname; - luaC_objbarrier(ls->L, f, varname); - return fs->nlocvars++; -} - - -#define new_localvarliteral(ls,v,n) \ - new_localvar(ls, luaX_newstring(ls, "" v, (sizeof(v)/sizeof(char))-1), n) - - -static void new_localvar (LexState *ls, TString *name, int n) { - FuncState *fs = ls->fs; - luaY_checklimit(fs, fs->nactvar+n+1, LUAI_MAXVARS, "local variables"); - fs->actvar[fs->nactvar+n] = cast(unsigned short, registerlocalvar(ls, name)); -} - - -static void adjustlocalvars (LexState *ls, int nvars) { - FuncState *fs = ls->fs; - fs->nactvar = cast_byte(fs->nactvar + nvars); - for (; nvars; nvars--) { - getlocvar(fs, fs->nactvar - nvars).startpc = fs->pc; - } -} - - -static void removevars (LexState *ls, int tolevel) { - FuncState *fs = ls->fs; - while (fs->nactvar > tolevel) - getlocvar(fs, --fs->nactvar).endpc = fs->pc; -} - - -static int indexupvalue (FuncState *fs, TString *name, expdesc *v) { - int i; - Proto *f = fs->f; - int oldsize = f->sizeupvalues; - for (i=0; inups; i++) { - if (fs->upvalues[i].k == v->k && fs->upvalues[i].info == v->u.s.info) { - lua_assert(f->upvalues[i] == name); - return i; - } - } - /* new one */ - luaY_checklimit(fs, f->nups + 1, LUAI_MAXUPVALUES, "upvalues"); - luaM_growvector(fs->L, f->upvalues, f->nups, f->sizeupvalues, - TString *, MAX_INT, ""); - while (oldsize < f->sizeupvalues) f->upvalues[oldsize++] = NULL; - f->upvalues[f->nups] = name; - luaC_objbarrier(fs->L, f, name); - lua_assert(v->k == VLOCAL || v->k == VUPVAL); - fs->upvalues[f->nups].k = cast_byte(v->k); - fs->upvalues[f->nups].info = cast_byte(v->u.s.info); - return f->nups++; -} - - -static int searchvar (FuncState *fs, TString *n) { - int i; - for (i=fs->nactvar-1; i >= 0; i--) { - if (n == getlocvar(fs, i).varname) - return i; - } - return -1; /* not found */ -} - - -static void markupval (FuncState *fs, int level) { - BlockCnt *bl = fs->bl; - while (bl && bl->nactvar > level) bl = bl->previous; - if (bl) bl->upval = 1; -} - - -static int singlevaraux (FuncState *fs, TString *n, expdesc *var, int base) { - if (fs == NULL) { /* no more levels? */ - init_exp(var, VGLOBAL, NO_REG); /* default is global variable */ - return VGLOBAL; - } - else { - int v = searchvar(fs, n); /* look up at current level */ - if (v >= 0) { - init_exp(var, VLOCAL, v); - if (!base) - markupval(fs, v); /* local will be used as an upval */ - return VLOCAL; - } - else { /* not found at current level; try upper one */ - if (singlevaraux(fs->prev, n, var, 0) == VGLOBAL) - return VGLOBAL; - var->u.s.info = indexupvalue(fs, n, var); /* else was LOCAL or UPVAL */ - var->k = VUPVAL; /* upvalue in this level */ - return VUPVAL; - } - } -} - - -static void singlevar (LexState *ls, expdesc *var) { - TString *varname = str_checkname(ls); - FuncState *fs = ls->fs; - if (singlevaraux(fs, varname, var, 1) == VGLOBAL) - var->u.s.info = luaK_stringK(fs, varname); /* info points to global name */ -} - - -static void adjust_assign (LexState *ls, int nvars, int nexps, expdesc *e) { - FuncState *fs = ls->fs; - int extra = nvars - nexps; - if (hasmultret(e->k)) { - extra++; /* includes call itself */ - if (extra < 0) extra = 0; - luaK_setreturns(fs, e, extra); /* last exp. provides the difference */ - if (extra > 1) luaK_reserveregs(fs, extra-1); - } - else { - if (e->k != VVOID) luaK_exp2nextreg(fs, e); /* close last expression */ - if (extra > 0) { - int reg = fs->freereg; - luaK_reserveregs(fs, extra); - luaK_nil(fs, reg, extra); - } - } -} - - -static void enterlevel (LexState *ls) { - if (++ls->L->nCcalls > LUAI_MAXCCALLS) - luaX_lexerror(ls, "chunk has too many syntax levels", 0); -} - - -#define leavelevel(ls) ((ls)->L->nCcalls--) - - -static void enterblock (FuncState *fs, BlockCnt *bl, lu_byte isbreakable) { - bl->breaklist = NO_JUMP; - bl->isbreakable = isbreakable; - bl->nactvar = fs->nactvar; - bl->upval = 0; - bl->previous = fs->bl; - fs->bl = bl; - lua_assert(fs->freereg == fs->nactvar); -} - - -static void leaveblock (FuncState *fs) { - BlockCnt *bl = fs->bl; - fs->bl = bl->previous; - removevars(fs->ls, bl->nactvar); - if (bl->upval) - luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); - /* a block either controls scope or breaks (never both) */ - lua_assert(!bl->isbreakable || !bl->upval); - lua_assert(bl->nactvar == fs->nactvar); - fs->freereg = fs->nactvar; /* free registers */ - luaK_patchtohere(fs, bl->breaklist); -} - - -static void pushclosure (LexState *ls, FuncState *func, expdesc *v) { - FuncState *fs = ls->fs; - Proto *f = fs->f; - int oldsize = f->sizep; - int i; - luaM_growvector(ls->L, f->p, fs->np, f->sizep, Proto *, - MAXARG_Bx, "constant table overflow"); - while (oldsize < f->sizep) f->p[oldsize++] = NULL; - f->p[fs->np++] = func->f; - luaC_objbarrier(ls->L, f, func->f); - init_exp(v, VRELOCABLE, luaK_codeABx(fs, OP_CLOSURE, 0, fs->np-1)); - for (i=0; if->nups; i++) { - OpCode o = (func->upvalues[i].k == VLOCAL) ? OP_MOVE : OP_GETUPVAL; - luaK_codeABC(fs, o, 0, func->upvalues[i].info, 0); - } -} - - -static void open_func (LexState *ls, FuncState *fs) { - lua_State *L = ls->L; - Proto *f = luaF_newproto(L); - fs->f = f; - fs->prev = ls->fs; /* linked list of funcstates */ - fs->ls = ls; - fs->L = L; - ls->fs = fs; - fs->pc = 0; - fs->lasttarget = -1; - fs->jpc = NO_JUMP; - fs->freereg = 0; - fs->nk = 0; - fs->np = 0; - fs->nlocvars = 0; - fs->nactvar = 0; - fs->bl = NULL; - f->source = ls->source; - f->maxstacksize = 2; /* registers 0/1 are always valid */ - fs->h = luaH_new(L, 0, 0); - /* anchor table of constants and prototype (to avoid being collected) */ - sethvalue2s(L, L->top, fs->h); - incr_top(L); - setptvalue2s(L, L->top, f); - incr_top(L); -} - - -static void close_func (LexState *ls) { - lua_State *L = ls->L; - FuncState *fs = ls->fs; - Proto *f = fs->f; - removevars(ls, 0); - luaK_ret(fs, 0, 0); /* final return */ - luaM_reallocvector(L, f->code, f->sizecode, fs->pc, Instruction); - f->sizecode = fs->pc; - luaM_reallocvector(L, f->lineinfo, f->sizelineinfo, fs->pc, int); - f->sizelineinfo = fs->pc; - luaM_reallocvector(L, f->k, f->sizek, fs->nk, TValue); - f->sizek = fs->nk; - luaM_reallocvector(L, f->p, f->sizep, fs->np, Proto *); - f->sizep = fs->np; - luaM_reallocvector(L, f->locvars, f->sizelocvars, fs->nlocvars, LocVar); - f->sizelocvars = fs->nlocvars; - luaM_reallocvector(L, f->upvalues, f->sizeupvalues, f->nups, TString *); - f->sizeupvalues = f->nups; - lua_assert(luaG_checkcode(f)); - lua_assert(fs->bl == NULL); - ls->fs = fs->prev; - L->top -= 2; /* remove table and prototype from the stack */ - /* last token read was anchored in defunct function; must reanchor it */ - if (fs) anchor_token(ls); -} - - -Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, const char *name) { - struct LexState lexstate; - struct FuncState funcstate; - lexstate.buff = buff; - luaX_setinput(L, &lexstate, z, luaS_new(L, name)); - open_func(&lexstate, &funcstate); - funcstate.f->is_vararg = VARARG_ISVARARG; /* main func. is always vararg */ - luaX_next(&lexstate); /* read first token */ - chunk(&lexstate); - check(&lexstate, TK_EOS); - close_func(&lexstate); - lua_assert(funcstate.prev == NULL); - lua_assert(funcstate.f->nups == 0); - lua_assert(lexstate.fs == NULL); - return funcstate.f; -} - - - -/*============================================================*/ -/* GRAMMAR RULES */ -/*============================================================*/ - - -static void field (LexState *ls, expdesc *v) { - /* field -> ['.' | ':'] NAME */ - FuncState *fs = ls->fs; - expdesc key; - luaK_exp2anyreg(fs, v); - luaX_next(ls); /* skip the dot or colon */ - checkname(ls, &key); - luaK_indexed(fs, v, &key); -} - - -static void yindex (LexState *ls, expdesc *v) { - /* index -> '[' expr ']' */ - luaX_next(ls); /* skip the '[' */ - expr(ls, v); - luaK_exp2val(ls->fs, v); - checknext(ls, ']'); -} - - -/* -** {====================================================================== -** Rules for Constructors -** ======================================================================= -*/ - - -struct ConsControl { - expdesc v; /* last list item read */ - expdesc *t; /* table descriptor */ - int nh; /* total number of `record' elements */ - int na; /* total number of array elements */ - int tostore; /* number of array elements pending to be stored */ -}; - - -static void recfield (LexState *ls, struct ConsControl *cc) { - /* recfield -> (NAME | `['exp1`]') = exp1 */ - FuncState *fs = ls->fs; - int reg = ls->fs->freereg; - expdesc key, val; - int rkkey; - if (ls->t.token == TK_NAME) { - luaY_checklimit(fs, cc->nh, MAX_INT, "items in a constructor"); - checkname(ls, &key); - } - else /* ls->t.token == '[' */ - yindex(ls, &key); - cc->nh++; - checknext(ls, '='); - rkkey = luaK_exp2RK(fs, &key); - expr(ls, &val); - luaK_codeABC(fs, OP_SETTABLE, cc->t->u.s.info, rkkey, luaK_exp2RK(fs, &val)); - fs->freereg = reg; /* free registers */ -} - - -static void closelistfield (FuncState *fs, struct ConsControl *cc) { - if (cc->v.k == VVOID) return; /* there is no list item */ - luaK_exp2nextreg(fs, &cc->v); - cc->v.k = VVOID; - if (cc->tostore == LFIELDS_PER_FLUSH) { - luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); /* flush */ - cc->tostore = 0; /* no more items pending */ - } -} - - -static void lastlistfield (FuncState *fs, struct ConsControl *cc) { - if (cc->tostore == 0) return; - if (hasmultret(cc->v.k)) { - luaK_setmultret(fs, &cc->v); - luaK_setlist(fs, cc->t->u.s.info, cc->na, LUA_MULTRET); - cc->na--; /* do not count last expression (unknown number of elements) */ - } - else { - if (cc->v.k != VVOID) - luaK_exp2nextreg(fs, &cc->v); - luaK_setlist(fs, cc->t->u.s.info, cc->na, cc->tostore); - } -} - - -static void listfield (LexState *ls, struct ConsControl *cc) { - expr(ls, &cc->v); - luaY_checklimit(ls->fs, cc->na, MAX_INT, "items in a constructor"); - cc->na++; - cc->tostore++; -} - - -static void constructor (LexState *ls, expdesc *t) { - /* constructor -> ?? */ - FuncState *fs = ls->fs; - int line = ls->linenumber; - int pc = luaK_codeABC(fs, OP_NEWTABLE, 0, 0, 0); - struct ConsControl cc; - cc.na = cc.nh = cc.tostore = 0; - cc.t = t; - init_exp(t, VRELOCABLE, pc); - init_exp(&cc.v, VVOID, 0); /* no value (yet) */ - luaK_exp2nextreg(ls->fs, t); /* fix it at stack top (for gc) */ - checknext(ls, '{'); - do { - lua_assert(cc.v.k == VVOID || cc.tostore > 0); - if (ls->t.token == '}') break; - closelistfield(fs, &cc); - switch(ls->t.token) { - case TK_NAME: { /* may be listfields or recfields */ - luaX_lookahead(ls); - if (ls->lookahead.token != '=') /* expression? */ - listfield(ls, &cc); - else - recfield(ls, &cc); - break; - } - case '[': { /* constructor_item -> recfield */ - recfield(ls, &cc); - break; - } - default: { /* constructor_part -> listfield */ - listfield(ls, &cc); - break; - } - } - } while (testnext(ls, ',') || testnext(ls, ';')); - check_match(ls, '}', '{', line); - lastlistfield(fs, &cc); - SETARG_B(fs->f->code[pc], luaO_int2fb(cc.na)); /* set initial array size */ - SETARG_C(fs->f->code[pc], luaO_int2fb(cc.nh)); /* set initial table size */ -} - -/* }====================================================================== */ - - - -static void parlist (LexState *ls) { - /* parlist -> [ param { `,' param } ] */ - FuncState *fs = ls->fs; - Proto *f = fs->f; - int nparams = 0; - f->is_vararg = 0; - if (ls->t.token != ')') { /* is `parlist' not empty? */ - do { - switch (ls->t.token) { - case TK_NAME: { /* param -> NAME */ - new_localvar(ls, str_checkname(ls), nparams++); - break; - } - case TK_DOTS: { /* param -> `...' */ - luaX_next(ls); -#if defined(LUA_COMPAT_VARARG) - /* use `arg' as default name */ - new_localvarliteral(ls, "arg", nparams++); - f->is_vararg = VARARG_HASARG | VARARG_NEEDSARG; -#endif - f->is_vararg |= VARARG_ISVARARG; - break; - } - default: luaX_syntaxerror(ls, " or " LUA_QL("...") " expected"); - } - } while (!f->is_vararg && testnext(ls, ',')); - } - adjustlocalvars(ls, nparams); - f->numparams = cast_byte(fs->nactvar - (f->is_vararg & VARARG_HASARG)); - luaK_reserveregs(fs, fs->nactvar); /* reserve register for parameters */ -} - - -static void body (LexState *ls, expdesc *e, int needself, int line) { - /* body -> `(' parlist `)' chunk END */ - FuncState new_fs; - open_func(ls, &new_fs); - new_fs.f->linedefined = line; - checknext(ls, '('); - if (needself) { - new_localvarliteral(ls, "self", 0); - adjustlocalvars(ls, 1); - } - parlist(ls); - checknext(ls, ')'); - chunk(ls); - new_fs.f->lastlinedefined = ls->linenumber; - check_match(ls, TK_END, TK_FUNCTION, line); - close_func(ls); - pushclosure(ls, &new_fs, e); -} - - -static int explist1 (LexState *ls, expdesc *v) { - /* explist1 -> expr { `,' expr } */ - int n = 1; /* at least one expression */ - expr(ls, v); - while (testnext(ls, ',')) { - luaK_exp2nextreg(ls->fs, v); - expr(ls, v); - n++; - } - return n; -} - - -static void funcargs (LexState *ls, expdesc *f) { - FuncState *fs = ls->fs; - expdesc args; - int base, nparams; - int line = ls->linenumber; - switch (ls->t.token) { - case '(': { /* funcargs -> `(' [ explist1 ] `)' */ - if (line != ls->lastline) - luaX_syntaxerror(ls,"ambiguous syntax (function call x new statement)"); - luaX_next(ls); - if (ls->t.token == ')') /* arg list is empty? */ - args.k = VVOID; - else { - explist1(ls, &args); - luaK_setmultret(fs, &args); - } - check_match(ls, ')', '(', line); - break; - } - case '{': { /* funcargs -> constructor */ - constructor(ls, &args); - break; - } - case TK_STRING: { /* funcargs -> STRING */ - codestring(ls, &args, ls->t.seminfo.ts); - luaX_next(ls); /* must use `seminfo' before `next' */ - break; - } - default: { - luaX_syntaxerror(ls, "function arguments expected"); - return; - } - } - lua_assert(f->k == VNONRELOC); - base = f->u.s.info; /* base register for call */ - if (hasmultret(args.k)) - nparams = LUA_MULTRET; /* open call */ - else { - if (args.k != VVOID) - luaK_exp2nextreg(fs, &args); /* close last argument */ - nparams = fs->freereg - (base+1); - } - init_exp(f, VCALL, luaK_codeABC(fs, OP_CALL, base, nparams+1, 2)); - luaK_fixline(fs, line); - fs->freereg = base+1; /* call remove function and arguments and leaves - (unless changed) one result */ -} - - - - -/* -** {====================================================================== -** Expression parsing -** ======================================================================= -*/ - - -static void prefixexp (LexState *ls, expdesc *v) { - /* prefixexp -> NAME | '(' expr ')' */ - switch (ls->t.token) { - case '(': { - int line = ls->linenumber; - luaX_next(ls); - expr(ls, v); - check_match(ls, ')', '(', line); - luaK_dischargevars(ls->fs, v); - return; - } - case TK_NAME: { - singlevar(ls, v); - return; - } - default: { - luaX_syntaxerror(ls, "unexpected symbol"); - return; - } - } -} - - -static void primaryexp (LexState *ls, expdesc *v) { - /* primaryexp -> - prefixexp { `.' NAME | `[' exp `]' | `:' NAME funcargs | funcargs } */ - FuncState *fs = ls->fs; - prefixexp(ls, v); - for (;;) { - switch (ls->t.token) { - case '.': { /* field */ - field(ls, v); - break; - } - case '[': { /* `[' exp1 `]' */ - expdesc key; - luaK_exp2anyreg(fs, v); - yindex(ls, &key); - luaK_indexed(fs, v, &key); - break; - } - case ':': { /* `:' NAME funcargs */ - expdesc key; - luaX_next(ls); - checkname(ls, &key); - luaK_self(fs, v, &key); - funcargs(ls, v); - break; - } - case '(': case TK_STRING: case '{': { /* funcargs */ - luaK_exp2nextreg(fs, v); - funcargs(ls, v); - break; - } - default: return; - } - } -} - - -static void simpleexp (LexState *ls, expdesc *v) { - /* simpleexp -> NUMBER | STRING | NIL | true | false | ... | - constructor | FUNCTION body | primaryexp */ - switch (ls->t.token) { - case TK_NUMBER: { - init_exp(v, VKNUM, 0); - v->u.nval = ls->t.seminfo.r; - break; - } - case TK_STRING: { - codestring(ls, v, ls->t.seminfo.ts); - break; - } - case TK_NIL: { - init_exp(v, VNIL, 0); - break; - } - case TK_TRUE: { - init_exp(v, VTRUE, 0); - break; - } - case TK_FALSE: { - init_exp(v, VFALSE, 0); - break; - } - case TK_DOTS: { /* vararg */ - FuncState *fs = ls->fs; - check_condition(ls, fs->f->is_vararg, - "cannot use " LUA_QL("...") " outside a vararg function"); - fs->f->is_vararg &= ~VARARG_NEEDSARG; /* don't need 'arg' */ - init_exp(v, VVARARG, luaK_codeABC(fs, OP_VARARG, 0, 1, 0)); - break; - } - case '{': { /* constructor */ - constructor(ls, v); - return; - } - case TK_FUNCTION: { - luaX_next(ls); - body(ls, v, 0, ls->linenumber); - return; - } - default: { - primaryexp(ls, v); - return; - } - } - luaX_next(ls); -} - - -static UnOpr getunopr (int op) { - switch (op) { - case TK_NOT: return OPR_NOT; - case '-': return OPR_MINUS; - case '#': return OPR_LEN; - default: return OPR_NOUNOPR; - } -} - - -static BinOpr getbinopr (int op) { - switch (op) { - case '+': return OPR_ADD; - case '-': return OPR_SUB; - case '*': return OPR_MUL; - case '/': return OPR_DIV; - case '%': return OPR_MOD; - case '^': return OPR_POW; - case TK_CONCAT: return OPR_CONCAT; - case TK_NE: return OPR_NE; - case TK_EQ: return OPR_EQ; - case '<': return OPR_LT; - case TK_LE: return OPR_LE; - case '>': return OPR_GT; - case TK_GE: return OPR_GE; - case TK_AND: return OPR_AND; - case TK_OR: return OPR_OR; - default: return OPR_NOBINOPR; - } -} - - -static const struct { - lu_byte left; /* left priority for each binary operator */ - lu_byte right; /* right priority */ -} priority[] = { /* ORDER OPR */ - {6, 6}, {6, 6}, {7, 7}, {7, 7}, {7, 7}, /* `+' `-' `/' `%' */ - {10, 9}, {5, 4}, /* power and concat (right associative) */ - {3, 3}, {3, 3}, /* equality and inequality */ - {3, 3}, {3, 3}, {3, 3}, {3, 3}, /* order */ - {2, 2}, {1, 1} /* logical (and/or) */ -}; - -#define UNARY_PRIORITY 8 /* priority for unary operators */ - - -/* -** subexpr -> (simpleexp | unop subexpr) { binop subexpr } -** where `binop' is any binary operator with a priority higher than `limit' -*/ -static BinOpr subexpr (LexState *ls, expdesc *v, unsigned int limit) { - BinOpr op; - UnOpr uop; - enterlevel(ls); - uop = getunopr(ls->t.token); - if (uop != OPR_NOUNOPR) { - luaX_next(ls); - subexpr(ls, v, UNARY_PRIORITY); - luaK_prefix(ls->fs, uop, v); - } - else simpleexp(ls, v); - /* expand while operators have priorities higher than `limit' */ - op = getbinopr(ls->t.token); - while (op != OPR_NOBINOPR && priority[op].left > limit) { - expdesc v2; - BinOpr nextop; - luaX_next(ls); - luaK_infix(ls->fs, op, v); - /* read sub-expression with higher priority */ - nextop = subexpr(ls, &v2, priority[op].right); - luaK_posfix(ls->fs, op, v, &v2); - op = nextop; - } - leavelevel(ls); - return op; /* return first untreated operator */ -} - - -static void expr (LexState *ls, expdesc *v) { - subexpr(ls, v, 0); -} - -/* }==================================================================== */ - - - -/* -** {====================================================================== -** Rules for Statements -** ======================================================================= -*/ - - -static int block_follow (int token) { - switch (token) { - case TK_ELSE: case TK_ELSEIF: case TK_END: - case TK_UNTIL: case TK_EOS: - return 1; - default: return 0; - } -} - - -static void block (LexState *ls) { - /* block -> chunk */ - FuncState *fs = ls->fs; - BlockCnt bl; - enterblock(fs, &bl, 0); - chunk(ls); - lua_assert(bl.breaklist == NO_JUMP); - leaveblock(fs); -} - - -/* -** structure to chain all variables in the left-hand side of an -** assignment -*/ -struct LHS_assign { - struct LHS_assign *prev; - expdesc v; /* variable (global, local, upvalue, or indexed) */ -}; - - -/* -** check whether, in an assignment to a local variable, the local variable -** is needed in a previous assignment (to a table). If so, save original -** local value in a safe place and use this safe copy in the previous -** assignment. -*/ -static void check_conflict (LexState *ls, struct LHS_assign *lh, expdesc *v) { - FuncState *fs = ls->fs; - int extra = fs->freereg; /* eventual position to save local variable */ - int conflict = 0; - for (; lh; lh = lh->prev) { - if (lh->v.k == VINDEXED) { - if (lh->v.u.s.info == v->u.s.info) { /* conflict? */ - conflict = 1; - lh->v.u.s.info = extra; /* previous assignment will use safe copy */ - } - if (lh->v.u.s.aux == v->u.s.info) { /* conflict? */ - conflict = 1; - lh->v.u.s.aux = extra; /* previous assignment will use safe copy */ - } - } - } - if (conflict) { - luaK_codeABC(fs, OP_MOVE, fs->freereg, v->u.s.info, 0); /* make copy */ - luaK_reserveregs(fs, 1); - } -} - - -static void assignment (LexState *ls, struct LHS_assign *lh, int nvars) { - expdesc e; - check_condition(ls, VLOCAL <= lh->v.k && lh->v.k <= VINDEXED, - "syntax error"); - if (testnext(ls, ',')) { /* assignment -> `,' primaryexp assignment */ - struct LHS_assign nv; - nv.prev = lh; - primaryexp(ls, &nv.v); - if (nv.v.k == VLOCAL) - check_conflict(ls, lh, &nv.v); - luaY_checklimit(ls->fs, nvars, LUAI_MAXCCALLS - ls->L->nCcalls, - "variables in assignment"); - assignment(ls, &nv, nvars+1); - } - else { /* assignment -> `=' explist1 */ - int nexps; - checknext(ls, '='); - nexps = explist1(ls, &e); - if (nexps != nvars) { - adjust_assign(ls, nvars, nexps, &e); - if (nexps > nvars) - ls->fs->freereg -= nexps - nvars; /* remove extra values */ - } - else { - luaK_setoneret(ls->fs, &e); /* close last expression */ - luaK_storevar(ls->fs, &lh->v, &e); - return; /* avoid default */ - } - } - init_exp(&e, VNONRELOC, ls->fs->freereg-1); /* default assignment */ - luaK_storevar(ls->fs, &lh->v, &e); -} - - -static int cond (LexState *ls) { - /* cond -> exp */ - expdesc v; - expr(ls, &v); /* read condition */ - if (v.k == VNIL) v.k = VFALSE; /* `falses' are all equal here */ - luaK_goiftrue(ls->fs, &v); - return v.f; -} - - -static void breakstat (LexState *ls) { - FuncState *fs = ls->fs; - BlockCnt *bl = fs->bl; - int upval = 0; - while (bl && !bl->isbreakable) { - upval |= bl->upval; - bl = bl->previous; - } - if (!bl) - luaX_syntaxerror(ls, "no loop to break"); - if (upval) - luaK_codeABC(fs, OP_CLOSE, bl->nactvar, 0, 0); - luaK_concat(fs, &bl->breaklist, luaK_jump(fs)); -} - - -static void whilestat (LexState *ls, int line) { - /* whilestat -> WHILE cond DO block END */ - FuncState *fs = ls->fs; - int whileinit; - int condexit; - BlockCnt bl; - luaX_next(ls); /* skip WHILE */ - whileinit = luaK_getlabel(fs); - condexit = cond(ls); - enterblock(fs, &bl, 1); - checknext(ls, TK_DO); - block(ls); - luaK_patchlist(fs, luaK_jump(fs), whileinit); - check_match(ls, TK_END, TK_WHILE, line); - leaveblock(fs); - luaK_patchtohere(fs, condexit); /* false conditions finish the loop */ -} - - -static void repeatstat (LexState *ls, int line) { - /* repeatstat -> REPEAT block UNTIL cond */ - int condexit; - FuncState *fs = ls->fs; - int repeat_init = luaK_getlabel(fs); - BlockCnt bl1, bl2; - enterblock(fs, &bl1, 1); /* loop block */ - enterblock(fs, &bl2, 0); /* scope block */ - luaX_next(ls); /* skip REPEAT */ - chunk(ls); - check_match(ls, TK_UNTIL, TK_REPEAT, line); - condexit = cond(ls); /* read condition (inside scope block) */ - if (!bl2.upval) { /* no upvalues? */ - leaveblock(fs); /* finish scope */ - luaK_patchlist(ls->fs, condexit, repeat_init); /* close the loop */ - } - else { /* complete semantics when there are upvalues */ - breakstat(ls); /* if condition then break */ - luaK_patchtohere(ls->fs, condexit); /* else... */ - leaveblock(fs); /* finish scope... */ - luaK_patchlist(ls->fs, luaK_jump(fs), repeat_init); /* and repeat */ - } - leaveblock(fs); /* finish loop */ -} - - -static int exp1 (LexState *ls) { - expdesc e; - int k; - expr(ls, &e); - k = e.k; - luaK_exp2nextreg(ls->fs, &e); - return k; -} - - -static void forbody (LexState *ls, int base, int line, int nvars, int isnum) { - /* forbody -> DO block */ - BlockCnt bl; - FuncState *fs = ls->fs; - int prep, endfor; - adjustlocalvars(ls, 3); /* control variables */ - checknext(ls, TK_DO); - prep = isnum ? luaK_codeAsBx(fs, OP_FORPREP, base, NO_JUMP) : luaK_jump(fs); - enterblock(fs, &bl, 0); /* scope for declared variables */ - adjustlocalvars(ls, nvars); - luaK_reserveregs(fs, nvars); - block(ls); - leaveblock(fs); /* end of scope for declared variables */ - luaK_patchtohere(fs, prep); - endfor = (isnum) ? luaK_codeAsBx(fs, OP_FORLOOP, base, NO_JUMP) : - luaK_codeABC(fs, OP_TFORLOOP, base, 0, nvars); - luaK_fixline(fs, line); /* pretend that `OP_FOR' starts the loop */ - luaK_patchlist(fs, (isnum ? endfor : luaK_jump(fs)), prep + 1); -} - - -static void fornum (LexState *ls, TString *varname, int line) { - /* fornum -> NAME = exp1,exp1[,exp1] forbody */ - FuncState *fs = ls->fs; - int base = fs->freereg; - new_localvarliteral(ls, "(for index)", 0); - new_localvarliteral(ls, "(for limit)", 1); - new_localvarliteral(ls, "(for step)", 2); - new_localvar(ls, varname, 3); - checknext(ls, '='); - exp1(ls); /* initial value */ - checknext(ls, ','); - exp1(ls); /* limit */ - if (testnext(ls, ',')) - exp1(ls); /* optional step */ - else { /* default step = 1 */ - luaK_codeABx(fs, OP_LOADK, fs->freereg, luaK_numberK(fs, 1)); - luaK_reserveregs(fs, 1); - } - forbody(ls, base, line, 1, 1); -} - - -static void forlist (LexState *ls, TString *indexname) { - /* forlist -> NAME {,NAME} IN explist1 forbody */ - FuncState *fs = ls->fs; - expdesc e; - int nvars = 0; - int line; - int base = fs->freereg; - /* create control variables */ - new_localvarliteral(ls, "(for generator)", nvars++); - new_localvarliteral(ls, "(for state)", nvars++); - new_localvarliteral(ls, "(for control)", nvars++); - /* create declared variables */ - new_localvar(ls, indexname, nvars++); - while (testnext(ls, ',')) - new_localvar(ls, str_checkname(ls), nvars++); - checknext(ls, TK_IN); - line = ls->linenumber; - adjust_assign(ls, 3, explist1(ls, &e), &e); - luaK_checkstack(fs, 3); /* extra space to call generator */ - forbody(ls, base, line, nvars - 3, 0); -} - - -static void forstat (LexState *ls, int line) { - /* forstat -> FOR (fornum | forlist) END */ - FuncState *fs = ls->fs; - TString *varname; - BlockCnt bl; - enterblock(fs, &bl, 1); /* scope for loop and control variables */ - luaX_next(ls); /* skip `for' */ - varname = str_checkname(ls); /* first variable name */ - switch (ls->t.token) { - case '=': fornum(ls, varname, line); break; - case ',': case TK_IN: forlist(ls, varname); break; - default: luaX_syntaxerror(ls, LUA_QL("=") " or " LUA_QL("in") " expected"); - } - check_match(ls, TK_END, TK_FOR, line); - leaveblock(fs); /* loop scope (`break' jumps to this point) */ -} - - -static int test_then_block (LexState *ls) { - /* test_then_block -> [IF | ELSEIF] cond THEN block */ - int condexit; - luaX_next(ls); /* skip IF or ELSEIF */ - condexit = cond(ls); - checknext(ls, TK_THEN); - block(ls); /* `then' part */ - return condexit; -} - - -static void ifstat (LexState *ls, int line) { - /* ifstat -> IF cond THEN block {ELSEIF cond THEN block} [ELSE block] END */ - FuncState *fs = ls->fs; - int flist; - int escapelist = NO_JUMP; - flist = test_then_block(ls); /* IF cond THEN block */ - while (ls->t.token == TK_ELSEIF) { - luaK_concat(fs, &escapelist, luaK_jump(fs)); - luaK_patchtohere(fs, flist); - flist = test_then_block(ls); /* ELSEIF cond THEN block */ - } - if (ls->t.token == TK_ELSE) { - luaK_concat(fs, &escapelist, luaK_jump(fs)); - luaK_patchtohere(fs, flist); - luaX_next(ls); /* skip ELSE (after patch, for correct line info) */ - block(ls); /* `else' part */ - } - else - luaK_concat(fs, &escapelist, flist); - luaK_patchtohere(fs, escapelist); - check_match(ls, TK_END, TK_IF, line); -} - - -static void localfunc (LexState *ls) { - expdesc v, b; - FuncState *fs = ls->fs; - new_localvar(ls, str_checkname(ls), 0); - init_exp(&v, VLOCAL, fs->freereg); - luaK_reserveregs(fs, 1); - adjustlocalvars(ls, 1); - body(ls, &b, 0, ls->linenumber); - luaK_storevar(fs, &v, &b); - /* debug information will only see the variable after this point! */ - getlocvar(fs, fs->nactvar - 1).startpc = fs->pc; -} - - -static void localstat (LexState *ls) { - /* stat -> LOCAL NAME {`,' NAME} [`=' explist1] */ - int nvars = 0; - int nexps; - expdesc e; - do { - new_localvar(ls, str_checkname(ls), nvars++); - } while (testnext(ls, ',')); - if (testnext(ls, '=')) - nexps = explist1(ls, &e); - else { - e.k = VVOID; - nexps = 0; - } - adjust_assign(ls, nvars, nexps, &e); - adjustlocalvars(ls, nvars); -} - - -static int funcname (LexState *ls, expdesc *v) { - /* funcname -> NAME {field} [`:' NAME] */ - int needself = 0; - singlevar(ls, v); - while (ls->t.token == '.') - field(ls, v); - if (ls->t.token == ':') { - needself = 1; - field(ls, v); - } - return needself; -} - - -static void funcstat (LexState *ls, int line) { - /* funcstat -> FUNCTION funcname body */ - int needself; - expdesc v, b; - luaX_next(ls); /* skip FUNCTION */ - needself = funcname(ls, &v); - body(ls, &b, needself, line); - luaK_storevar(ls->fs, &v, &b); - luaK_fixline(ls->fs, line); /* definition `happens' in the first line */ -} - - -static void exprstat (LexState *ls) { - /* stat -> func | assignment */ - FuncState *fs = ls->fs; - struct LHS_assign v; - primaryexp(ls, &v.v); - if (v.v.k == VCALL) /* stat -> func */ - SETARG_C(getcode(fs, &v.v), 1); /* call statement uses no results */ - else { /* stat -> assignment */ - v.prev = NULL; - assignment(ls, &v, 1); - } -} - - -static void retstat (LexState *ls) { - /* stat -> RETURN explist */ - FuncState *fs = ls->fs; - expdesc e; - int first, nret; /* registers with returned values */ - luaX_next(ls); /* skip RETURN */ - if (block_follow(ls->t.token) || ls->t.token == ';') - first = nret = 0; /* return no values */ - else { - nret = explist1(ls, &e); /* optional return values */ - if (hasmultret(e.k)) { - luaK_setmultret(fs, &e); - if (e.k == VCALL && nret == 1) { /* tail call? */ - SET_OPCODE(getcode(fs,&e), OP_TAILCALL); - lua_assert(GETARG_A(getcode(fs,&e)) == fs->nactvar); - } - first = fs->nactvar; - nret = LUA_MULTRET; /* return all values */ - } - else { - if (nret == 1) /* only one single value? */ - first = luaK_exp2anyreg(fs, &e); - else { - luaK_exp2nextreg(fs, &e); /* values must go to the `stack' */ - first = fs->nactvar; /* return all `active' values */ - lua_assert(nret == fs->freereg - first); - } - } - } - luaK_ret(fs, first, nret); -} - - -static int statement (LexState *ls) { - int line = ls->linenumber; /* may be needed for error messages */ - switch (ls->t.token) { - case TK_IF: { /* stat -> ifstat */ - ifstat(ls, line); - return 0; - } - case TK_WHILE: { /* stat -> whilestat */ - whilestat(ls, line); - return 0; - } - case TK_DO: { /* stat -> DO block END */ - luaX_next(ls); /* skip DO */ - block(ls); - check_match(ls, TK_END, TK_DO, line); - return 0; - } - case TK_FOR: { /* stat -> forstat */ - forstat(ls, line); - return 0; - } - case TK_REPEAT: { /* stat -> repeatstat */ - repeatstat(ls, line); - return 0; - } - case TK_FUNCTION: { - funcstat(ls, line); /* stat -> funcstat */ - return 0; - } - case TK_LOCAL: { /* stat -> localstat */ - luaX_next(ls); /* skip LOCAL */ - if (testnext(ls, TK_FUNCTION)) /* local function? */ - localfunc(ls); - else - localstat(ls); - return 0; - } - case TK_RETURN: { /* stat -> retstat */ - retstat(ls); - return 1; /* must be last statement */ - } - case TK_BREAK: { /* stat -> breakstat */ - luaX_next(ls); /* skip BREAK */ - breakstat(ls); - return 1; /* must be last statement */ - } - default: { - exprstat(ls); - return 0; /* to avoid warnings */ - } - } -} - - -static void chunk (LexState *ls) { - /* chunk -> { stat [`;'] } */ - int islast = 0; - enterlevel(ls); - while (!islast && !block_follow(ls->t.token)) { - islast = statement(ls); - testnext(ls, ';'); - lua_assert(ls->fs->f->maxstacksize >= ls->fs->freereg && - ls->fs->freereg >= ls->fs->nactvar); - ls->fs->freereg = ls->fs->nactvar; /* free registers */ - } - leavelevel(ls); -} - -/* }====================================================================== */ diff --git a/script/lua/lparser.h b/script/lua/lparser.h deleted file mode 100644 index 18836afd1..000000000 --- a/script/lua/lparser.h +++ /dev/null @@ -1,82 +0,0 @@ -/* -** $Id: lparser.h,v 1.57.1.1 2007/12/27 13:02:25 roberto Exp $ -** Lua Parser -** See Copyright Notice in lua.h -*/ - -#ifndef lparser_h -#define lparser_h - -#include "llimits.h" -#include "lobject.h" -#include "lzio.h" - - -/* -** Expression descriptor -*/ - -typedef enum { - VVOID, /* no value */ - VNIL, - VTRUE, - VFALSE, - VK, /* info = index of constant in `k' */ - VKNUM, /* nval = numerical value */ - VLOCAL, /* info = local register */ - VUPVAL, /* info = index of upvalue in `upvalues' */ - VGLOBAL, /* info = index of table; aux = index of global name in `k' */ - VINDEXED, /* info = table register; aux = index register (or `k') */ - VJMP, /* info = instruction pc */ - VRELOCABLE, /* info = instruction pc */ - VNONRELOC, /* info = result register */ - VCALL, /* info = instruction pc */ - VVARARG /* info = instruction pc */ -} expkind; - -typedef struct expdesc { - expkind k; - union { - struct { int info, aux; } s; - lua_Number nval; - } u; - int t; /* patch list of `exit when true' */ - int f; /* patch list of `exit when false' */ -} expdesc; - - -typedef struct upvaldesc { - lu_byte k; - lu_byte info; -} upvaldesc; - - -struct BlockCnt; /* defined in lparser.c */ - - -/* state needed to generate code for a given function */ -typedef struct FuncState { - Proto *f; /* current function header */ - Table *h; /* table to find (and reuse) elements in `k' */ - struct FuncState *prev; /* enclosing function */ - struct LexState *ls; /* lexical state */ - struct lua_State *L; /* copy of the Lua state */ - struct BlockCnt *bl; /* chain of current blocks */ - int pc; /* next position to code (equivalent to `ncode') */ - int lasttarget; /* `pc' of last `jump target' */ - int jpc; /* list of pending jumps to `pc' */ - int freereg; /* first free register */ - int nk; /* number of elements in `k' */ - int np; /* number of elements in `p' */ - short nlocvars; /* number of elements in `locvars' */ - lu_byte nactvar; /* number of active local variables */ - upvaldesc upvalues[LUAI_MAXUPVALUES]; /* upvalues */ - unsigned short actvar[LUAI_MAXVARS]; /* declared-variable stack */ -} FuncState; - - -LUAI_FUNC Proto *luaY_parser (lua_State *L, ZIO *z, Mbuffer *buff, - const char *name); - - -#endif diff --git a/script/lua/lstate.c b/script/lua/lstate.c deleted file mode 100644 index 0c1b97f19..000000000 --- a/script/lua/lstate.c +++ /dev/null @@ -1,213 +0,0 @@ -/* -** $Id: lstate.c,v 2.36.1.2 2008/01/03 15:20:39 roberto Exp $ -** Global State -** See Copyright Notice in lua.h -*/ - - -#include - -#define lstate_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lgc.h" -#include "llex.h" -#include "lmem.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" - - -#define state_size(x) (sizeof(x) + LUAI_EXTRASPACE) -#define fromstate(l) (cast(lu_byte *, (l)) - LUAI_EXTRASPACE) -#define tostate(l) (cast(lua_State *, cast(lu_byte *, l) + LUAI_EXTRASPACE)) - - -/* -** Main thread combines a thread state and the global state -*/ -typedef struct LG { - lua_State l; - global_State g; -} LG; - - - -static void stack_init (lua_State *L1, lua_State *L) { - /* initialize CallInfo array */ - L1->base_ci = luaM_newvector(L, BASIC_CI_SIZE, CallInfo); - L1->ci = L1->base_ci; - L1->size_ci = BASIC_CI_SIZE; - L1->end_ci = L1->base_ci + L1->size_ci - 1; - /* initialize stack array */ - L1->stack = luaM_newvector(L, BASIC_STACK_SIZE + EXTRA_STACK, TValue); - L1->stacksize = BASIC_STACK_SIZE + EXTRA_STACK; - L1->top = L1->stack; - L1->stack_last = L1->stack+(L1->stacksize - EXTRA_STACK)-1; - /* initialize first ci */ - L1->ci->func = L1->top; - setnilvalue(L1->top++); /* `function' entry for this `ci' */ - L1->base = L1->ci->base = L1->top; - L1->ci->top = L1->top + LUA_MINSTACK; -} - - -static void freestack (lua_State *L, lua_State *L1) { - luaM_freearray(L, L1->base_ci, L1->size_ci, CallInfo); - luaM_freearray(L, L1->stack, L1->stacksize, TValue); -} - - -/* -** open parts that may cause memory-allocation errors -*/ -static void f_luaopen (lua_State *L, void *ud) { - global_State *g = G(L); - UNUSED(ud); - stack_init(L, L); /* init stack */ - sethvalue(L, gt(L), luaH_new(L, 0, 2)); /* table of globals */ - sethvalue(L, registry(L), luaH_new(L, 0, 2)); /* registry */ - luaS_resize(L, MINSTRTABSIZE); /* initial size of string table */ - luaT_init(L); - luaX_init(L); - luaS_fix(luaS_newliteral(L, MEMERRMSG)); - g->GCthreshold = 4*g->totalbytes; -} - - -static void preinit_state (lua_State *L, global_State *g) { - G(L) = g; - L->stack = NULL; - L->stacksize = 0; - L->errorJmp = NULL; - L->hook = NULL; - L->hookmask = 0; - L->basehookcount = 0; - L->allowhook = 1; - resethookcount(L); - L->openupval = NULL; - L->size_ci = 0; - L->nCcalls = L->baseCcalls = 0; - L->status = 0; - L->base_ci = L->ci = NULL; - L->savedpc = NULL; - L->errfunc = 0; - setnilvalue(gt(L)); -} - - -static void close_state (lua_State *L) { - global_State *g = G(L); - luaF_close(L, L->stack); /* close all upvalues for this thread */ - luaC_freeall(L); /* collect all objects */ - lua_assert(g->rootgc == obj2gco(L)); - lua_assert(g->strt.nuse == 0); - luaM_freearray(L, G(L)->strt.hash, G(L)->strt.size, TString *); - luaZ_freebuffer(L, &g->buff); - freestack(L, L); - lua_assert(g->totalbytes == sizeof(LG)); - (*g->frealloc)(g->ud, fromstate(L), state_size(LG), 0); -} - - -lua_State *luaE_newthread (lua_State *L) { - lua_State *L1 = tostate(luaM_malloc(L, state_size(lua_State))); - luaC_link(L, obj2gco(L1), LUA_TTHREAD); - preinit_state(L1, G(L)); - stack_init(L1, L); /* init stack */ - setobj2n(L, gt(L1), gt(L)); /* share table of globals */ - L1->hookmask = L->hookmask; - L1->basehookcount = L->basehookcount; - L1->hook = L->hook; - resethookcount(L1); - lua_assert(iswhite(obj2gco(L1))); - return L1; -} - - -void luaE_freethread (lua_State *L, lua_State *L1) { - luaF_close(L1, L1->stack); /* close all upvalues for this thread */ - lua_assert(L1->openupval == NULL); - luai_userstatefree(L1); - freestack(L, L1); - luaM_freemem(L, fromstate(L1), state_size(lua_State)); -} - - -LUA_API lua_State *lua_newstate (lua_Alloc f, void *ud) { - int i; - lua_State *L; - global_State *g; - void *l = (*f)(ud, NULL, 0, state_size(LG)); - if (l == NULL) return NULL; - L = tostate(l); - g = &((LG *)L)->g; - L->next = NULL; - L->tt = LUA_TTHREAD; - g->currentwhite = bit2mask(WHITE0BIT, FIXEDBIT); - L->marked = luaC_white(g); - set2bits(L->marked, FIXEDBIT, SFIXEDBIT); - preinit_state(L, g); - g->frealloc = f; - g->ud = ud; - g->mainthread = L; - g->uvhead.u.l.prev = &g->uvhead; - g->uvhead.u.l.next = &g->uvhead; - g->GCthreshold = 0; /* mark it as unfinished state */ - g->strt.size = 0; - g->strt.nuse = 0; - g->strt.hash = NULL; - setnilvalue(registry(L)); - luaZ_initbuffer(L, &g->buff); - g->panic = NULL; - g->gcstate = GCSpause; - g->rootgc = obj2gco(L); - g->sweepstrgc = 0; - g->sweepgc = &g->rootgc; - g->gray = NULL; - g->grayagain = NULL; - g->weak = NULL; - g->tmudata = NULL; - g->totalbytes = sizeof(LG); - g->gcpause = LUAI_GCPAUSE; - g->gcstepmul = LUAI_GCMUL; - g->gcdept = 0; - for (i=0; imt[i] = NULL; - if (luaD_rawrunprotected(L, f_luaopen, NULL) != 0) { - /* memory allocation error: free partial state */ - close_state(L); - L = NULL; - } - else - luai_userstateopen(L); - return L; -} - - -static void callallgcTM (lua_State *L, void *ud) { - UNUSED(ud); - luaC_callGCTM(L); /* call GC metamethods for all udata */ -} - - -LUA_API void lua_close (lua_State *L) { - L = G(L)->mainthread; /* only the main thread can be closed */ - lua_lock(L); - luaF_close(L, L->stack); /* close all upvalues for this thread */ - luaC_separateudata(L, 1); /* separate udata that have GC metamethods */ - L->errfunc = 0; /* no error function during GC metamethods */ - do { /* repeat until no more errors */ - L->ci = L->base_ci; - L->base = L->top = L->ci->base; - L->nCcalls = L->baseCcalls = 0; - } while (luaD_rawrunprotected(L, callallgcTM, NULL) != 0); - lua_assert(G(L)->tmudata == NULL); - luai_userstateclose(L); - close_state(L); -} diff --git a/script/lua/lstate.h b/script/lua/lstate.h deleted file mode 100644 index 3bc575b6b..000000000 --- a/script/lua/lstate.h +++ /dev/null @@ -1,169 +0,0 @@ -/* -** $Id: lstate.h,v 2.24.1.2 2008/01/03 15:20:39 roberto Exp $ -** Global State -** See Copyright Notice in lua.h -*/ - -#ifndef lstate_h -#define lstate_h - -#include "lua.h" - -#include "lobject.h" -#include "ltm.h" -#include "lzio.h" - - - -struct lua_longjmp; /* defined in ldo.c */ - - -/* table of globals */ -#define gt(L) (&L->l_gt) - -/* registry */ -#define registry(L) (&G(L)->l_registry) - - -/* extra stack space to handle TM calls and some other extras */ -#define EXTRA_STACK 5 - - -#define BASIC_CI_SIZE 8 - -#define BASIC_STACK_SIZE (2*LUA_MINSTACK) - - - -typedef struct stringtable { - GCObject **hash; - lu_int32 nuse; /* number of elements */ - int size; -} stringtable; - - -/* -** informations about a call -*/ -typedef struct CallInfo { - StkId base; /* base for this function */ - StkId func; /* function index in the stack */ - StkId top; /* top for this function */ - const Instruction *savedpc; - int nresults; /* expected number of results from this function */ - int tailcalls; /* number of tail calls lost under this entry */ -} CallInfo; - - - -#define curr_func(L) (clvalue(L->ci->func)) -#define ci_func(ci) (clvalue((ci)->func)) -#define f_isLua(ci) (!ci_func(ci)->c.isC) -#define isLua(ci) (ttisfunction((ci)->func) && f_isLua(ci)) - - -/* -** `global state', shared by all threads of this state -*/ -typedef struct global_State { - stringtable strt; /* hash table for strings */ - lua_Alloc frealloc; /* function to reallocate memory */ - void *ud; /* auxiliary data to `frealloc' */ - lu_byte currentwhite; - lu_byte gcstate; /* state of garbage collector */ - int sweepstrgc; /* position of sweep in `strt' */ - GCObject *rootgc; /* list of all collectable objects */ - GCObject **sweepgc; /* position of sweep in `rootgc' */ - GCObject *gray; /* list of gray objects */ - GCObject *grayagain; /* list of objects to be traversed atomically */ - GCObject *weak; /* list of weak tables (to be cleared) */ - GCObject *tmudata; /* last element of list of userdata to be GC */ - Mbuffer buff; /* temporary buffer for string concatentation */ - lu_mem GCthreshold; - lu_mem totalbytes; /* number of bytes currently allocated */ - lu_mem estimate; /* an estimate of number of bytes actually in use */ - lu_mem gcdept; /* how much GC is `behind schedule' */ - int gcpause; /* size of pause between successive GCs */ - int gcstepmul; /* GC `granularity' */ - lua_CFunction panic; /* to be called in unprotected errors */ - TValue l_registry; - struct lua_State *mainthread; - UpVal uvhead; /* head of double-linked list of all open upvalues */ - struct Table *mt[NUM_TAGS]; /* metatables for basic types */ - TString *tmname[TM_N]; /* array with tag-method names */ -} global_State; - - -/* -** `per thread' state -*/ -struct lua_State { - CommonHeader; - lu_byte status; - StkId top; /* first free slot in the stack */ - StkId base; /* base of current function */ - global_State *l_G; - CallInfo *ci; /* call info for current function */ - const Instruction *savedpc; /* `savedpc' of current function */ - StkId stack_last; /* last free slot in the stack */ - StkId stack; /* stack base */ - CallInfo *end_ci; /* points after end of ci array*/ - CallInfo *base_ci; /* array of CallInfo's */ - int stacksize; - int size_ci; /* size of array `base_ci' */ - unsigned short nCcalls; /* number of nested C calls */ - unsigned short baseCcalls; /* nested C calls when resuming coroutine */ - lu_byte hookmask; - lu_byte allowhook; - int basehookcount; - int hookcount; - lua_Hook hook; - TValue l_gt; /* table of globals */ - TValue env; /* temporary place for environments */ - GCObject *openupval; /* list of open upvalues in this stack */ - GCObject *gclist; - struct lua_longjmp *errorJmp; /* current error recover point */ - ptrdiff_t errfunc; /* current error handling function (stack index) */ -}; - - -#define G(L) (L->l_G) - - -/* -** Union of all collectable objects -*/ -union GCObject { - GCheader gch; - union TString ts; - union Udata u; - union Closure cl; - struct Table h; - struct Proto p; - struct UpVal uv; - struct lua_State th; /* thread */ -}; - - -/* macros to convert a GCObject into a specific value */ -#define rawgco2ts(o) check_exp((o)->gch.tt == LUA_TSTRING, &((o)->ts)) -#define gco2ts(o) (&rawgco2ts(o)->tsv) -#define rawgco2u(o) check_exp((o)->gch.tt == LUA_TUSERDATA, &((o)->u)) -#define gco2u(o) (&rawgco2u(o)->uv) -#define gco2cl(o) check_exp((o)->gch.tt == LUA_TFUNCTION, &((o)->cl)) -#define gco2h(o) check_exp((o)->gch.tt == LUA_TTABLE, &((o)->h)) -#define gco2p(o) check_exp((o)->gch.tt == LUA_TPROTO, &((o)->p)) -#define gco2uv(o) check_exp((o)->gch.tt == LUA_TUPVAL, &((o)->uv)) -#define ngcotouv(o) \ - check_exp((o) == NULL || (o)->gch.tt == LUA_TUPVAL, &((o)->uv)) -#define gco2th(o) check_exp((o)->gch.tt == LUA_TTHREAD, &((o)->th)) - -/* macro to convert any Lua object into a GCObject */ -#define obj2gco(v) (cast(GCObject *, (v))) - - -LUAI_FUNC lua_State *luaE_newthread (lua_State *L); -LUAI_FUNC void luaE_freethread (lua_State *L, lua_State *L1); - -#endif - diff --git a/script/lua/lstring.c b/script/lua/lstring.c deleted file mode 100644 index bfdf1908a..000000000 --- a/script/lua/lstring.c +++ /dev/null @@ -1,112 +0,0 @@ -/* -** $Id: lstring.c,v 2.8.1.1 2007/12/27 13:02:25 roberto Exp $ -** String table (keeps all strings handled by Lua) -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#endif - -#define lstring_c -#define LUA_CORE - -#include "lua.h" - -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" - - - -void luaS_resize (lua_State *L, int newsize) { - GCObject **newhash; - stringtable *tb; - int i; - if (G(L)->gcstate == GCSsweepstring) - return; /* cannot resize during GC traverse */ - newhash = luaM_newvector(L, newsize, GCObject *); - tb = &G(L)->strt; - for (i=0; isize; i++) { - GCObject *p = tb->hash[i]; - while (p) { /* for each node in the list */ - GCObject *next = p->gch.next; /* save next */ - unsigned int h = gco2ts(p)->hash; - int h1 = lmod(h, newsize); /* new position */ - lua_assert(cast_int(h%newsize) == lmod(h, newsize)); - p->gch.next = newhash[h1]; /* chain it */ - newhash[h1] = p; - p = next; - } - } - luaM_freearray(L, tb->hash, tb->size, TString *); - tb->size = newsize; - tb->hash = newhash; -} - - -static TString *newlstr (lua_State *L, const char *str, size_t l, - unsigned int h) { - TString *ts; - stringtable *tb; - if (l+1 > (MAX_SIZET - sizeof(TString))/sizeof(char)) - luaM_toobig(L); - ts = cast(TString *, luaM_malloc(L, (l+1)*sizeof(char)+sizeof(TString))); - ts->tsv.len = l; - ts->tsv.hash = h; - ts->tsv.marked = luaC_white(G(L)); - ts->tsv.tt = LUA_TSTRING; - ts->tsv.reserved = 0; - memcpy(ts+1, str, l*sizeof(char)); - ((char *)(ts+1))[l] = '\0'; /* ending 0 */ - tb = &G(L)->strt; - h = lmod(h, tb->size); - ts->tsv.next = tb->hash[h]; /* chain new entry */ - tb->hash[h] = obj2gco(ts); - tb->nuse++; - if (tb->nuse > cast(lu_int32, tb->size) && tb->size <= MAX_INT/2) - luaS_resize(L, tb->size*2); /* too crowded */ - return ts; -} - - -TString *luaS_newlstr (lua_State *L, const char *str, size_t l) { - GCObject *o; - unsigned int h = cast(unsigned int, l); /* seed */ - size_t step = (l>>5)+1; /* if string is too long, don't hash all its chars */ - size_t l1; - for (l1=l; l1>=step; l1-=step) /* compute hash */ - h = h ^ ((h<<5)+(h>>2)+cast(unsigned char, str[l1-1])); - for (o = G(L)->strt.hash[lmod(h, G(L)->strt.size)]; - o != NULL; - o = o->gch.next) { - TString *ts = rawgco2ts(o); - if (ts->tsv.len == l && (memcmp(str, getstr(ts), l) == 0)) { - /* string may be dead */ - if (isdead(G(L), o)) changewhite(o); - return ts; - } - } - return newlstr(L, str, l, h); /* not found */ -} - - -Udata *luaS_newudata (lua_State *L, size_t s, Table *e) { - Udata *u; - if (s > MAX_SIZET - sizeof(Udata)) - luaM_toobig(L); - u = cast(Udata *, luaM_malloc(L, s + sizeof(Udata))); - u->uv.marked = luaC_white(G(L)); /* is not finalized */ - u->uv.tt = LUA_TUSERDATA; - u->uv.len = s; - u->uv.metatable = NULL; - u->uv.env = e; - /* chain it on udata list (after main thread) */ - u->uv.next = G(L)->mainthread->next; - G(L)->mainthread->next = obj2gco(u); - return u; -} - diff --git a/script/lua/lstring.h b/script/lua/lstring.h deleted file mode 100644 index 73a2ff8b3..000000000 --- a/script/lua/lstring.h +++ /dev/null @@ -1,31 +0,0 @@ -/* -** $Id: lstring.h,v 1.43.1.1 2007/12/27 13:02:25 roberto Exp $ -** String table (keep all strings handled by Lua) -** See Copyright Notice in lua.h -*/ - -#ifndef lstring_h -#define lstring_h - - -#include "lgc.h" -#include "lobject.h" -#include "lstate.h" - - -#define sizestring(s) (sizeof(union TString)+((s)->len+1)*sizeof(char)) - -#define sizeudata(u) (sizeof(union Udata)+(u)->len) - -#define luaS_new(L, s) (luaS_newlstr(L, s, strlen(s))) -#define luaS_newliteral(L, s) (luaS_newlstr(L, "" s, \ - (sizeof(s)/sizeof(char))-1)) - -#define luaS_fix(s) l_setbit((s)->tsv.marked, FIXEDBIT) - -LUAI_FUNC void luaS_resize (lua_State *L, int newsize); -LUAI_FUNC Udata *luaS_newudata (lua_State *L, size_t s, Table *e); -LUAI_FUNC TString *luaS_newlstr (lua_State *L, const char *str, size_t l); - - -#endif diff --git a/script/lua/lstrlib.c b/script/lua/lstrlib.c deleted file mode 100644 index a9abb493e..000000000 --- a/script/lua/lstrlib.c +++ /dev/null @@ -1,870 +0,0 @@ -/* -** $Id: lstrlib.c,v 1.132.1.4 2008/07/11 17:27:21 roberto Exp $ -** Standard library for string operations and pattern-matching -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#include -#include -#endif - -#define lstrlib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -/* macro to `unsign' a character */ -#define uchar(c) ((unsigned char)(c)) - - - -static int str_len (lua_State *L) { - size_t l; - luaL_checklstring(L, 1, &l); - lua_pushinteger(L, l); - return 1; -} - - -static ptrdiff_t posrelat (ptrdiff_t pos, size_t len) { - /* relative string position: negative means back from end */ - if (pos < 0) pos += (ptrdiff_t)len + 1; - return (pos >= 0) ? pos : 0; -} - - -static int str_sub (lua_State *L) { - size_t l; - const char *s = luaL_checklstring(L, 1, &l); - ptrdiff_t start = posrelat(luaL_checkinteger(L, 2), l); - ptrdiff_t end = posrelat(luaL_optinteger(L, 3, -1), l); - if (start < 1) start = 1; - if (end > (ptrdiff_t)l) end = (ptrdiff_t)l; - if (start <= end) - lua_pushlstring(L, s+start-1, end-start+1); - else lua_pushliteral(L, ""); - return 1; -} - - -static int str_reverse (lua_State *L) { - size_t l; - luaL_Buffer b; - const char *s = luaL_checklstring(L, 1, &l); - luaL_buffinit(L, &b); - while (l--) luaL_addchar(&b, s[l]); - luaL_pushresult(&b); - return 1; -} - - -static int str_lower (lua_State *L) { - size_t l; - size_t i; - luaL_Buffer b; - const char *s = luaL_checklstring(L, 1, &l); - luaL_buffinit(L, &b); - for (i=0; i 0) - luaL_addlstring(&b, s, l); - luaL_pushresult(&b); - return 1; -} - - -static int str_byte (lua_State *L) { - size_t l; - const char *s = luaL_checklstring(L, 1, &l); - ptrdiff_t posi = posrelat(luaL_optinteger(L, 2, 1), l); - ptrdiff_t pose = posrelat(luaL_optinteger(L, 3, posi), l); - int n, i; - if (posi <= 0) posi = 1; - if ((size_t)pose > l) pose = l; - if (posi > pose) return 0; /* empty interval; return no values */ - n = (int)(pose - posi + 1); - if (posi + n <= pose) /* overflow? */ - luaL_error(L, "string slice too long"); - luaL_checkstack(L, n, "string slice too long"); - for (i=0; i= ms->level || ms->capture[l].len == CAP_UNFINISHED) - return luaL_error(ms->L, "invalid capture index"); - return l; -} - - -static int capture_to_close (MatchState *ms) { - int level = ms->level; - for (level--; level>=0; level--) - if (ms->capture[level].len == CAP_UNFINISHED) return level; - return luaL_error(ms->L, "invalid pattern capture"); -} - - -static const char *classend (MatchState *ms, const char *p) { - switch (*p++) { - case L_ESC: { - if (*p == '\0') - luaL_error(ms->L, "malformed pattern (ends with " LUA_QL("%%") ")"); - return p+1; - } - case '[': { - if (*p == '^') p++; - do { /* look for a `]' */ - if (*p == '\0') - luaL_error(ms->L, "malformed pattern (missing " LUA_QL("]") ")"); - if (*(p++) == L_ESC && *p != '\0') - p++; /* skip escapes (e.g. `%]') */ - } while (*p != ']'); - return p+1; - } - default: { - return p; - } - } -} - - -static int match_class (int c, int cl) { - int res; - switch (tolower(cl)) { - case 'a' : res = isalpha(c); break; - case 'c' : res = iscntrl(c); break; - case 'd' : res = isdigit(c); break; - case 'l' : res = islower(c); break; - case 'p' : res = ispunct(c); break; - case 's' : res = isspace(c); break; - case 'u' : res = isupper(c); break; - case 'w' : res = isalnum(c); break; - case 'x' : res = isxdigit(c); break; - case 'z' : res = (c == 0); break; - default: return (cl == c); - } - return (islower(cl) ? res : !res); -} - - -static int matchbracketclass (int c, const char *p, const char *ec) { - int sig = 1; - if (*(p+1) == '^') { - sig = 0; - p++; /* skip the `^' */ - } - while (++p < ec) { - if (*p == L_ESC) { - p++; - if (match_class(c, uchar(*p))) - return sig; - } - else if ((*(p+1) == '-') && (p+2 < ec)) { - p+=2; - if (uchar(*(p-2)) <= c && c <= uchar(*p)) - return sig; - } - else if (uchar(*p) == c) return sig; - } - return !sig; -} - - -static int singlematch (int c, const char *p, const char *ep) { - switch (*p) { - case '.': return 1; /* matches any char */ - case L_ESC: return match_class(c, uchar(*(p+1))); - case '[': return matchbracketclass(c, p, ep-1); - default: return (uchar(*p) == c); - } -} - - -static const char *match (MatchState *ms, const char *s, const char *p); - - -static const char *matchbalance (MatchState *ms, const char *s, - const char *p) { - if (*p == 0 || *(p+1) == 0) - luaL_error(ms->L, "unbalanced pattern"); - if (*s != *p) return NULL; - else { - int b = *p; - int e = *(p+1); - int cont = 1; - while (++s < ms->src_end) { - if (*s == e) { - if (--cont == 0) return s+1; - } - else if (*s == b) cont++; - } - } - return NULL; /* string ends out of balance */ -} - - -static const char *max_expand (MatchState *ms, const char *s, - const char *p, const char *ep) { - ptrdiff_t i = 0; /* counts maximum expand for item */ - while ((s+i)src_end && singlematch(uchar(*(s+i)), p, ep)) - i++; - /* keeps trying to match with the maximum repetitions */ - while (i>=0) { - const char *res = match(ms, (s+i), ep+1); - if (res) return res; - i--; /* else didn't match; reduce 1 repetition to try again */ - } - return NULL; -} - - -static const char *min_expand (MatchState *ms, const char *s, - const char *p, const char *ep) { - for (;;) { - const char *res = match(ms, s, ep+1); - if (res != NULL) - return res; - else if (ssrc_end && singlematch(uchar(*s), p, ep)) - s++; /* try with one more repetition */ - else return NULL; - } -} - - -static const char *start_capture (MatchState *ms, const char *s, - const char *p, int what) { - const char *res; - int level = ms->level; - if (level >= LUA_MAXCAPTURES) luaL_error(ms->L, "too many captures"); - ms->capture[level].init = s; - ms->capture[level].len = what; - ms->level = level+1; - if ((res=match(ms, s, p)) == NULL) /* match failed? */ - ms->level--; /* undo capture */ - return res; -} - - -static const char *end_capture (MatchState *ms, const char *s, - const char *p) { - int l = capture_to_close(ms); - const char *res; - ms->capture[l].len = s - ms->capture[l].init; /* close capture */ - if ((res = match(ms, s, p)) == NULL) /* match failed? */ - ms->capture[l].len = CAP_UNFINISHED; /* undo capture */ - return res; -} - - -static const char *match_capture (MatchState *ms, const char *s, int l) { - size_t len; - l = check_capture(ms, l); - len = ms->capture[l].len; - if ((size_t)(ms->src_end-s) >= len && - memcmp(ms->capture[l].init, s, len) == 0) - return s+len; - else return NULL; -} - - -static const char *match (MatchState *ms, const char *s, const char *p) { - init: /* using goto's to optimize tail recursion */ - switch (*p) { - case '(': { /* start capture */ - if (*(p+1) == ')') /* position capture? */ - return start_capture(ms, s, p+2, CAP_POSITION); - else - return start_capture(ms, s, p+1, CAP_UNFINISHED); - } - case ')': { /* end capture */ - return end_capture(ms, s, p+1); - } - case L_ESC: { - switch (*(p+1)) { - case 'b': { /* balanced string? */ - s = matchbalance(ms, s, p+2); - if (s == NULL) return NULL; - p+=4; goto init; /* else return match(ms, s, p+4); */ - } - case 'f': { /* frontier? */ - const char *ep; char previous; - p += 2; - if (*p != '[') - luaL_error(ms->L, "missing " LUA_QL("[") " after " - LUA_QL("%%f") " in pattern"); - ep = classend(ms, p); /* points to what is next */ - previous = (s == ms->src_init) ? '\0' : *(s-1); - if (matchbracketclass(uchar(previous), p, ep-1) || - !matchbracketclass(uchar(*s), p, ep-1)) return NULL; - p=ep; goto init; /* else return match(ms, s, ep); */ - } - default: { - if (isdigit(uchar(*(p+1)))) { /* capture results (%0-%9)? */ - s = match_capture(ms, s, uchar(*(p+1))); - if (s == NULL) return NULL; - p+=2; goto init; /* else return match(ms, s, p+2) */ - } - goto dflt; /* case default */ - } - } - } - case '\0': { /* end of pattern */ - return s; /* match succeeded */ - } - case '$': { - if (*(p+1) == '\0') /* is the `$' the last char in pattern? */ - return (s == ms->src_end) ? s : NULL; /* check end of string */ - else goto dflt; - } - default: dflt: { /* it is a pattern item */ - const char *ep = classend(ms, p); /* points to what is next */ - int m = ssrc_end && singlematch(uchar(*s), p, ep); - switch (*ep) { - case '?': { /* optional */ - const char *res; - if (m && ((res=match(ms, s+1, ep+1)) != NULL)) - return res; - p=ep+1; goto init; /* else return match(ms, s, ep+1); */ - } - case '*': { /* 0 or more repetitions */ - return max_expand(ms, s, p, ep); - } - case '+': { /* 1 or more repetitions */ - return (m ? max_expand(ms, s+1, p, ep) : NULL); - } - case '-': { /* 0 or more repetitions (minimum) */ - return min_expand(ms, s, p, ep); - } - default: { - if (!m) return NULL; - s++; p=ep; goto init; /* else return match(ms, s+1, ep); */ - } - } - } - } -} - - - -static const char *lmemfind (const char *s1, size_t l1, - const char *s2, size_t l2) { - if (l2 == 0) return s1; /* empty strings are everywhere */ - else if (l2 > l1) return NULL; /* avoids a negative `l1' */ - else { - const char *init; /* to search for a `*s2' inside `s1' */ - l2--; /* 1st char will be checked by `memchr' */ - l1 = l1-l2; /* `s2' cannot be found after that */ - while (l1 > 0 && (init = (const char *)memchr(s1, *s2, l1)) != NULL) { - init++; /* 1st char is already checked */ - if (memcmp(init, s2+1, l2) == 0) - return init-1; - else { /* correct `l1' and `s1' to try again */ - l1 -= init-s1; - s1 = init; - } - } - return NULL; /* not found */ - } -} - - -static void push_onecapture (MatchState *ms, int i, const char *s, - const char *e) { - if (i >= ms->level) { - if (i == 0) /* ms->level == 0, too */ - lua_pushlstring(ms->L, s, e - s); /* add whole match */ - else - luaL_error(ms->L, "invalid capture index"); - } - else { - ptrdiff_t l = ms->capture[i].len; - if (l == CAP_UNFINISHED) luaL_error(ms->L, "unfinished capture"); - if (l == CAP_POSITION) - lua_pushinteger(ms->L, ms->capture[i].init - ms->src_init + 1); - else - lua_pushlstring(ms->L, ms->capture[i].init, l); - } -} - - -static int push_captures (MatchState *ms, const char *s, const char *e) { - int i; - int nlevels = (ms->level == 0 && s) ? 1 : ms->level; - luaL_checkstack(ms->L, nlevels, "too many captures"); - for (i = 0; i < nlevels; i++) - push_onecapture(ms, i, s, e); - return nlevels; /* number of strings pushed */ -} - - -static int str_find_aux (lua_State *L, int find) { - size_t l1, l2; - const char *s = luaL_checklstring(L, 1, &l1); - const char *p = luaL_checklstring(L, 2, &l2); - ptrdiff_t init = posrelat(luaL_optinteger(L, 3, 1), l1) - 1; - if (init < 0) init = 0; - else if ((size_t)(init) > l1) init = (ptrdiff_t)l1; - if (find && (lua_toboolean(L, 4) || /* explicit request? */ - strpbrk(p, SPECIALS) == NULL)) { /* or no special characters? */ - /* do a plain search */ - const char *s2 = lmemfind(s+init, l1-init, p, l2); - if (s2) { - lua_pushinteger(L, s2-s+1); - lua_pushinteger(L, s2-s+l2); - return 2; - } - } - else { - MatchState ms; - int anchor = (*p == '^') ? (p++, 1) : 0; - const char *s1=s+init; - ms.L = L; - ms.src_init = s; - ms.src_end = s+l1; - do { - const char *res; - ms.level = 0; - if ((res=match(&ms, s1, p)) != NULL) { - if (find) { - lua_pushinteger(L, s1-s+1); /* start */ - lua_pushinteger(L, res-s); /* end */ - return push_captures(&ms, NULL, 0) + 2; - } - else - return push_captures(&ms, s1, res); - } - } while (s1++ < ms.src_end && !anchor); - } - lua_pushnil(L); /* not found */ - return 1; -} - - -static int str_find (lua_State *L) { - return str_find_aux(L, 1); -} - - -static int str_match (lua_State *L) { - return str_find_aux(L, 0); -} - - -static int gmatch_aux (lua_State *L) { - MatchState ms; - size_t ls; - const char *s = lua_tolstring(L, lua_upvalueindex(1), &ls); - const char *p = lua_tostring(L, lua_upvalueindex(2)); - const char *src; - ms.L = L; - ms.src_init = s; - ms.src_end = s+ls; - for (src = s + (size_t)lua_tointeger(L, lua_upvalueindex(3)); - src <= ms.src_end; - src++) { - const char *e; - ms.level = 0; - if ((e = match(&ms, src, p)) != NULL) { - lua_Integer newstart = e-s; - if (e == src) newstart++; /* empty match? go at least one position */ - lua_pushinteger(L, newstart); - lua_replace(L, lua_upvalueindex(3)); - return push_captures(&ms, src, e); - } - } - return 0; /* not found */ -} - - -static int gmatch (lua_State *L) { - luaL_checkstring(L, 1); - luaL_checkstring(L, 2); - lua_settop(L, 2); - lua_pushinteger(L, 0); - lua_pushcclosure(L, gmatch_aux, 3); - return 1; -} - - -static int gfind_nodef (lua_State *L) { - return luaL_error(L, LUA_QL("string.gfind") " was renamed to " - LUA_QL("string.gmatch")); -} - - -static void add_s (MatchState *ms, luaL_Buffer *b, const char *s, - const char *e) { - size_t l, i; - const char *news = lua_tolstring(ms->L, 3, &l); - for (i = 0; i < l; i++) { - if (news[i] != L_ESC) - luaL_addchar(b, news[i]); - else { - i++; /* skip ESC */ - if (!isdigit(uchar(news[i]))) - luaL_addchar(b, news[i]); - else if (news[i] == '0') - luaL_addlstring(b, s, e - s); - else { - push_onecapture(ms, news[i] - '1', s, e); - luaL_addvalue(b); /* add capture to accumulated result */ - } - } - } -} - - -static void add_value (MatchState *ms, luaL_Buffer *b, const char *s, - const char *e) { - lua_State *L = ms->L; - switch (lua_type(L, 3)) { - case LUA_TNUMBER: - case LUA_TSTRING: { - add_s(ms, b, s, e); - return; - } - case LUA_TFUNCTION: { - int n; - lua_pushvalue(L, 3); - n = push_captures(ms, s, e); - lua_call(L, n, 1); - break; - } - case LUA_TTABLE: { - push_onecapture(ms, 0, s, e); - lua_gettable(L, 3); - break; - } - } - if (!lua_toboolean(L, -1)) { /* nil or false? */ - lua_pop(L, 1); - lua_pushlstring(L, s, e - s); /* keep original text */ - } - else if (!lua_isstring(L, -1)) - luaL_error(L, "invalid replacement value (a %s)", luaL_typename(L, -1)); - luaL_addvalue(b); /* add result to accumulator */ -} - - -static int str_gsub (lua_State *L) { - size_t srcl; - const char *src = luaL_checklstring(L, 1, &srcl); - const char *p = luaL_checkstring(L, 2); - int tr = lua_type(L, 3); - int max_s = luaL_optint(L, 4, srcl+1); - int anchor = (*p == '^') ? (p++, 1) : 0; - int n = 0; - MatchState ms; - luaL_Buffer b; - luaL_argcheck(L, tr == LUA_TNUMBER || tr == LUA_TSTRING || - tr == LUA_TFUNCTION || tr == LUA_TTABLE, 3, - "string/function/table expected"); - luaL_buffinit(L, &b); - ms.L = L; - ms.src_init = src; - ms.src_end = src+srcl; - while (n < max_s) { - const char *e; - ms.level = 0; - e = match(&ms, src, p); - if (e) { - n++; - add_value(&ms, &b, src, e); - } - if (e && e>src) /* non empty match? */ - src = e; /* skip it */ - else if (src < ms.src_end) - luaL_addchar(&b, *src++); - else break; - if (anchor) break; - } - luaL_addlstring(&b, src, ms.src_end-src); - luaL_pushresult(&b); - lua_pushinteger(L, n); /* number of substitutions */ - return 2; -} - -/* }====================================================== */ - - -/* maximum size of each formatted item (> len(format('%99.99f', -1e308))) */ -#define MAX_ITEM 512 -/* valid flags in a format specification */ -#define FLAGS "-+ #0" -/* -** maximum size of each format specification (such as '%-099.99d') -** (+10 accounts for %99.99x plus margin of error) -*/ -#define MAX_FORMAT (sizeof(FLAGS) + sizeof(LUA_INTFRMLEN) + 10) - - -static void addquoted (lua_State *L, luaL_Buffer *b, int arg) { - size_t l; - const char *s = luaL_checklstring(L, arg, &l); - luaL_addchar(b, '"'); - while (l--) { - switch (*s) { - case '"': case '\\': case '\n': { - luaL_addchar(b, '\\'); - luaL_addchar(b, *s); - break; - } - case '\r': { - luaL_addlstring(b, "\\r", 2); - break; - } - case '\0': { - luaL_addlstring(b, "\\000", 4); - break; - } - default: { - luaL_addchar(b, *s); - break; - } - } - s++; - } - luaL_addchar(b, '"'); -} - -static const char *scanformat (lua_State *L, const char *strfrmt, char *form) { - const char *p = strfrmt; - while (*p != '\0' && strchr(FLAGS, *p) != NULL) p++; /* skip flags */ - if ((size_t)(p - strfrmt) >= sizeof(FLAGS)) - luaL_error(L, "invalid format (repeated flags)"); - if (isdigit(uchar(*p))) p++; /* skip width */ - if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ - if (*p == '.') { - p++; - if (isdigit(uchar(*p))) p++; /* skip precision */ - if (isdigit(uchar(*p))) p++; /* (2 digits at most) */ - } - if (isdigit(uchar(*p))) - luaL_error(L, "invalid format (width or precision too long)"); - *(form++) = '%'; - strncpy(form, strfrmt, p - strfrmt + 1); - form += p - strfrmt + 1; - *form = '\0'; - return p; -} - - -static void addintlen (char *form) { - size_t l = strlen(form); - char spec = form[l - 1]; - strcpy(form + l - 1, LUA_INTFRMLEN); - form[l + sizeof(LUA_INTFRMLEN) - 2] = spec; - form[l + sizeof(LUA_INTFRMLEN) - 1] = '\0'; -} - - -static int str_format (lua_State *L) { - int arg = 1; - size_t sfl; - const char *strfrmt = luaL_checklstring(L, arg, &sfl); - const char *strfrmt_end = strfrmt+sfl; - luaL_Buffer b; - luaL_buffinit(L, &b); - while (strfrmt < strfrmt_end) { - if (*strfrmt != L_ESC) - luaL_addchar(&b, *strfrmt++); - else if (*++strfrmt == L_ESC) - luaL_addchar(&b, *strfrmt++); /* %% */ - else { /* format item */ - char form[MAX_FORMAT]; /* to store the format (`%...') */ - char buff[MAX_ITEM]; /* to store the formatted item */ - arg++; - strfrmt = scanformat(L, strfrmt, form); - switch (*strfrmt++) { - case 'c': { - sprintf(buff, form, (int)luaL_checknumber(L, arg)); - break; - } - case 'd': case 'i': { - addintlen(form); - sprintf(buff, form, (LUA_INTFRM_T)luaL_checknumber(L, arg)); - break; - } - case 'o': case 'u': case 'x': case 'X': { - addintlen(form); - sprintf(buff, form, (unsigned LUA_INTFRM_T)luaL_checknumber(L, arg)); - break; - } - case 'e': case 'E': case 'f': - case 'g': case 'G': { - sprintf(buff, form, (double)luaL_checknumber(L, arg)); - break; - } - case 'q': { - addquoted(L, &b, arg); - continue; /* skip the 'addsize' at the end */ - } - case 's': { - size_t l; - const char *s = luaL_checklstring(L, arg, &l); - if (!strchr(form, '.') && l >= 100) { - /* no precision and string is too long to be formatted; - keep original string */ - lua_pushvalue(L, arg); - luaL_addvalue(&b); - continue; /* skip the `addsize' at the end */ - } - else { - sprintf(buff, form, s); - break; - } - } - default: { /* also treat cases `pnLlh' */ - return luaL_error(L, "invalid option " LUA_QL("%%%c") " to " - LUA_QL("format"), *(strfrmt - 1)); - } - } - luaL_addlstring(&b, buff, strlen(buff)); - } - } - luaL_pushresult(&b); - return 1; -} - - -static const luaL_Reg strlib[] = { - {"byte", str_byte}, - {"char", str_char}, - {"dump", str_dump}, - {"find", str_find}, - {"format", str_format}, - {"gfind", gfind_nodef}, - {"gmatch", gmatch}, - {"gsub", str_gsub}, - {"len", str_len}, - {"lower", str_lower}, - {"match", str_match}, - {"rep", str_rep}, - {"reverse", str_reverse}, - {"sub", str_sub}, - {"upper", str_upper}, - {NULL, NULL} -}; - - -static void createmetatable (lua_State *L) { - lua_createtable(L, 0, 1); /* create metatable for strings */ - lua_pushliteral(L, ""); /* dummy string */ - lua_pushvalue(L, -2); - lua_setmetatable(L, -2); /* set string metatable */ - lua_pop(L, 1); /* pop dummy string */ - lua_pushvalue(L, -2); /* string library... */ - lua_setfield(L, -2, "__index"); /* ...is the __index metamethod */ - lua_pop(L, 1); /* pop metatable */ -} - - -/* -** Open string library -*/ -LUALIB_API int luaopen_string (lua_State *L) { - luaL_register(L, LUA_STRLIBNAME, strlib); -#if defined(LUA_COMPAT_GFIND) - lua_getfield(L, -1, "gmatch"); - lua_setfield(L, -2, "gfind"); -#endif - createmetatable(L); - return 1; -} - diff --git a/script/lua/ltable.c b/script/lua/ltable.c deleted file mode 100644 index f6501f8d5..000000000 --- a/script/lua/ltable.c +++ /dev/null @@ -1,594 +0,0 @@ -/* -** $Id: ltable.c,v 2.32.1.2 2007/12/28 15:32:23 roberto Exp $ -** Lua tables (hash) -** See Copyright Notice in lua.h -*/ - - -/* -** Implementation of tables (aka arrays, objects, or hash tables). -** Tables keep its elements in two parts: an array part and a hash part. -** Non-negative integer keys are all candidates to be kept in the array -** part. The actual size of the array is the largest `n' such that at -** least half the slots between 0 and n are in use. -** Hash uses a mix of chained scatter table with Brent's variation. -** A main invariant of these tables is that, if an element is not -** in its main position (i.e. the `original' position that its hash gives -** to it), then the colliding element is in its own main position. -** Hence even when the load factor reaches 100%, performance remains good. -*/ - -#if 0 -#include -#include -#endif - -#define ltable_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lgc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstate.h" -#include "ltable.h" - - -/* -** max size of array part is 2^MAXBITS -*/ -#if LUAI_BITSINT > 26 -#define MAXBITS 26 -#else -#define MAXBITS (LUAI_BITSINT-2) -#endif - -#define MAXASIZE (1 << MAXBITS) - - -#define hashpow2(t,n) (gnode(t, lmod((n), sizenode(t)))) - -#define hashstr(t,str) hashpow2(t, (str)->tsv.hash) -#define hashboolean(t,p) hashpow2(t, p) - - -/* -** for some types, it is better to avoid modulus by power of 2, as -** they tend to have many 2 factors. -*/ -#define hashmod(t,n) (gnode(t, ((n) % ((sizenode(t)-1)|1)))) - - -#define hashpointer(t,p) hashmod(t, IntPoint(p)) - - -/* -** number of ints inside a lua_Number -*/ -#define numints cast_int(sizeof(lua_Number)/sizeof(int)) - - - -#define dummynode (&dummynode_) - -static const Node dummynode_ = { - {{NULL}, LUA_TNIL}, /* value */ - {{{NULL}, LUA_TNIL, NULL}} /* key */ -}; - - -/* -** hash for lua_Numbers -*/ -static Node *hashnum (const Table *t, lua_Number n) { - unsigned int a[numints]; - int i; - if (luai_numeq(n, 0)) /* avoid problems with -0 */ - return gnode(t, 0); - memcpy(a, &n, sizeof(a)); - for (i = 1; i < numints; i++) a[0] += a[i]; - return hashmod(t, a[0]); -} - - - -/* -** returns the `main' position of an element in a table (that is, the index -** of its hash value) -*/ -static Node *mainposition (const Table *t, const TValue *key) { - switch (ttype(key)) { - case LUA_TNUMBER: - return hashnum(t, nvalue(key)); - case LUA_TSTRING: - return hashstr(t, rawtsvalue(key)); - case LUA_TBOOLEAN: - return hashboolean(t, bvalue(key)); - case LUA_TLIGHTUSERDATA: - return hashpointer(t, pvalue(key)); - default: - return hashpointer(t, gcvalue(key)); - } -} - - -/* -** returns the index for `key' if `key' is an appropriate key to live in -** the array part of the table, -1 otherwise. -*/ -static int arrayindex (const TValue *key) { - if (ttisnumber(key)) { - lua_Number n = nvalue(key); - int k; - lua_number2int(k, n); - if (luai_numeq(cast_num(k), n)) - return k; - } - return -1; /* `key' did not match some condition */ -} - - -/* -** returns the index of a `key' for table traversals. First goes all -** elements in the array part, then elements in the hash part. The -** beginning of a traversal is signalled by -1. -*/ -static int findindex (lua_State *L, Table *t, StkId key) { - int i; - if (ttisnil(key)) return -1; /* first iteration */ - i = arrayindex(key); - if (0 < i && i <= t->sizearray) /* is `key' inside array part? */ - return i-1; /* yes; that's the index (corrected to C) */ - else { - Node *n = mainposition(t, key); - do { /* check whether `key' is somewhere in the chain */ - /* key may be dead already, but it is ok to use it in `next' */ - if (luaO_rawequalObj(key2tval(n), key) || - (ttype(gkey(n)) == LUA_TDEADKEY && iscollectable(key) && - gcvalue(gkey(n)) == gcvalue(key))) { - i = cast_int(n - gnode(t, 0)); /* key index in hash table */ - /* hash elements are numbered after array ones */ - return i + t->sizearray; - } - else n = gnext(n); - } while (n); - luaG_runerror(L, "invalid key to " LUA_QL("next")); /* key not found */ - return 0; /* to avoid warnings */ - } -} - - -int luaH_next (lua_State *L, Table *t, StkId key) { - int i = findindex(L, t, key); /* find original element */ - for (i++; i < t->sizearray; i++) { /* try first array part */ - if (!ttisnil(&t->array[i])) { /* a non-nil value? */ - setnvalue(key, cast_num(i+1)); - setobj2s(L, key+1, &t->array[i]); - return 1; - } - } - for (i -= t->sizearray; i < sizenode(t); i++) { /* then hash part */ - if (!ttisnil(gval(gnode(t, i)))) { /* a non-nil value? */ - setobj2s(L, key, key2tval(gnode(t, i))); - setobj2s(L, key+1, gval(gnode(t, i))); - return 1; - } - } - return 0; /* no more elements */ -} - - -/* -** {============================================================= -** Rehash -** ============================================================== -*/ - - -static int computesizes (int nums[], int *narray) { - int i; - int twotoi; /* 2^i */ - int a = 0; /* number of elements smaller than 2^i */ - int na = 0; /* number of elements to go to array part */ - int n = 0; /* optimal size for array part */ - for (i = 0, twotoi = 1; twotoi/2 < *narray; i++, twotoi *= 2) { - if (nums[i] > 0) { - a += nums[i]; - if (a > twotoi/2) { /* more than half elements present? */ - n = twotoi; /* optimal size (till now) */ - na = a; /* all elements smaller than n will go to array part */ - } - } - if (a == *narray) break; /* all elements already counted */ - } - *narray = n; - lua_assert(*narray/2 <= na && na <= *narray); - return na; -} - - -static int countint (const TValue *key, int *nums) { - int k = arrayindex(key); - if (0 < k && k <= MAXASIZE) { /* is `key' an appropriate array index? */ - nums[ceillog2(k)]++; /* count as such */ - return 1; - } - else - return 0; -} - - -static int numusearray (const Table *t, int *nums) { - int lg; - int ttlg; /* 2^lg */ - int ause = 0; /* summation of `nums' */ - int i = 1; /* count to traverse all array keys */ - for (lg=0, ttlg=1; lg<=MAXBITS; lg++, ttlg*=2) { /* for each slice */ - int lc = 0; /* counter */ - int lim = ttlg; - if (lim > t->sizearray) { - lim = t->sizearray; /* adjust upper limit */ - if (i > lim) - break; /* no more elements to count */ - } - /* count elements in range (2^(lg-1), 2^lg] */ - for (; i <= lim; i++) { - if (!ttisnil(&t->array[i-1])) - lc++; - } - nums[lg] += lc; - ause += lc; - } - return ause; -} - - -static int numusehash (const Table *t, int *nums, int *pnasize) { - int totaluse = 0; /* total number of elements */ - int ause = 0; /* summation of `nums' */ - int i = sizenode(t); - while (i--) { - Node *n = &t->node[i]; - if (!ttisnil(gval(n))) { - ause += countint(key2tval(n), nums); - totaluse++; - } - } - *pnasize += ause; - return totaluse; -} - - -static void setarrayvector (lua_State *L, Table *t, int size) { - int i; - luaM_reallocvector(L, t->array, t->sizearray, size, TValue); - for (i=t->sizearray; iarray[i]); - t->sizearray = size; -} - - -static void setnodevector (lua_State *L, Table *t, int size) { - int lsize; - if (size == 0) { /* no elements to hash part? */ - t->node = cast(Node *, dummynode); /* use common `dummynode' */ - lsize = 0; - } - else { - int i; - lsize = ceillog2(size); - if (lsize > MAXBITS) - luaG_runerror(L, "table overflow"); - size = twoto(lsize); - t->node = luaM_newvector(L, size, Node); - for (i=0; ilsizenode = cast_byte(lsize); - t->lastfree = gnode(t, size); /* all positions are free */ -} - - -static void resize (lua_State *L, Table *t, int nasize, int nhsize) { - int i; - int oldasize = t->sizearray; - int oldhsize = t->lsizenode; - Node *nold = t->node; /* save old hash ... */ - if (nasize > oldasize) /* array part must grow? */ - setarrayvector(L, t, nasize); - /* create new hash part with appropriate size */ - setnodevector(L, t, nhsize); - if (nasize < oldasize) { /* array part must shrink? */ - t->sizearray = nasize; - /* re-insert elements from vanishing slice */ - for (i=nasize; iarray[i])) - setobjt2t(L, luaH_setnum(L, t, i+1), &t->array[i]); - } - /* shrink array */ - luaM_reallocvector(L, t->array, oldasize, nasize, TValue); - } - /* re-insert elements from hash part */ - for (i = twoto(oldhsize) - 1; i >= 0; i--) { - Node *old = nold+i; - if (!ttisnil(gval(old))) - setobjt2t(L, luaH_set(L, t, key2tval(old)), gval(old)); - } - if (nold != dummynode) - luaM_freearray(L, nold, twoto(oldhsize), Node); /* free old array */ -} - - -void luaH_resizearray (lua_State *L, Table *t, int nasize) { - int nsize = (t->node == dummynode) ? 0 : sizenode(t); - resize(L, t, nasize, nsize); -} - - -static void rehash (lua_State *L, Table *t, const TValue *ek) { - int nasize, na; - int nums[MAXBITS+1]; /* nums[i] = number of keys between 2^(i-1) and 2^i */ - int i; - int totaluse; - for (i=0; i<=MAXBITS; i++) nums[i] = 0; /* reset counts */ - nasize = numusearray(t, nums); /* count keys in array part */ - totaluse = nasize; /* all those keys are integer keys */ - totaluse += numusehash(t, nums, &nasize); /* count keys in hash part */ - /* count extra key */ - nasize += countint(ek, nums); - totaluse++; - /* compute new size for array part */ - na = computesizes(nums, &nasize); - /* resize the table to new computed sizes */ - resize(L, t, nasize, totaluse - na); -} - - - -/* -** }============================================================= -*/ - - -Table *luaH_new (lua_State *L, int narray, int nhash) { - Table *t = luaM_new(L, Table); - luaC_link(L, obj2gco(t), LUA_TTABLE); - t->metatable = NULL; - t->flags = cast_byte(~0); - /* temporary values (kept only if some malloc fails) */ - t->array = NULL; - t->sizearray = 0; - t->lsizenode = 0; - t->node = cast(Node *, dummynode); - setarrayvector(L, t, narray); - setnodevector(L, t, nhash); - return t; -} - - -void luaH_free (lua_State *L, Table *t) { - if (t->node != dummynode) - luaM_freearray(L, t->node, sizenode(t), Node); - luaM_freearray(L, t->array, t->sizearray, TValue); - luaM_free(L, t); -} - - -static Node *getfreepos (Table *t) { - while (t->lastfree-- > t->node) { - if (ttisnil(gkey(t->lastfree))) - return t->lastfree; - } - return NULL; /* could not find a free place */ -} - - - -/* -** inserts a new key into a hash table; first, check whether key's main -** position is free. If not, check whether colliding node is in its main -** position or not: if it is not, move colliding node to an empty place and -** put new key in its main position; otherwise (colliding node is in its main -** position), new key goes to an empty position. -*/ -static TValue *newkey (lua_State *L, Table *t, const TValue *key) { - Node *mp = mainposition(t, key); - if (!ttisnil(gval(mp)) || mp == dummynode) { - Node *othern; - Node *n = getfreepos(t); /* get a free place */ - if (n == NULL) { /* cannot find a free place? */ - rehash(L, t, key); /* grow table */ - return luaH_set(L, t, key); /* re-insert key into grown table */ - } - lua_assert(n != dummynode); - othern = mainposition(t, key2tval(mp)); - if (othern != mp) { /* is colliding node out of its main position? */ - /* yes; move colliding node into free position */ - while (gnext(othern) != mp) othern = gnext(othern); /* find previous */ - gnext(othern) = n; /* redo the chain with `n' in place of `mp' */ -#if 0 - *n = *mp; /* copy colliding node into free pos. (mp->next also goes) */ -#else - memcpy (n, mp, sizeof (*n)); -#endif - gnext(mp) = NULL; /* now `mp' is free */ - setnilvalue(gval(mp)); - } - else { /* colliding node is in its own main position */ - /* new node will go into free position */ - gnext(n) = gnext(mp); /* chain new position */ - gnext(mp) = n; - mp = n; - } - } - gkey(mp)->value = key->value; gkey(mp)->tt = key->tt; - luaC_barriert(L, t, key); - lua_assert(ttisnil(gval(mp))); - return gval(mp); -} - - -/* -** search function for integers -*/ -const TValue *luaH_getnum (Table *t, int key) { - /* (1 <= key && key <= t->sizearray) */ - if (cast(unsigned int, key-1) < cast(unsigned int, t->sizearray)) - return &t->array[key-1]; - else { - lua_Number nk = cast_num(key); - Node *n = hashnum(t, nk); - do { /* check whether `key' is somewhere in the chain */ - if (ttisnumber(gkey(n)) && luai_numeq(nvalue(gkey(n)), nk)) - return gval(n); /* that's it */ - else n = gnext(n); - } while (n); - return luaO_nilobject; - } -} - - -/* -** search function for strings -*/ -const TValue *luaH_getstr (Table *t, TString *key) { - Node *n = hashstr(t, key); - do { /* check whether `key' is somewhere in the chain */ - if (ttisstring(gkey(n)) && rawtsvalue(gkey(n)) == key) - return gval(n); /* that's it */ - else n = gnext(n); - } while (n); - return luaO_nilobject; -} - - -/* -** main search function -*/ -const TValue *luaH_get (Table *t, const TValue *key) { - switch (ttype(key)) { - case LUA_TNIL: return luaO_nilobject; - case LUA_TSTRING: return luaH_getstr(t, rawtsvalue(key)); - case LUA_TNUMBER: { - int k; - lua_Number n = nvalue(key); - lua_number2int(k, n); - if (luai_numeq(cast_num(k), nvalue(key))) /* index is int? */ - return luaH_getnum(t, k); /* use specialized version */ - /* else go through */ - } - default: { - Node *n = mainposition(t, key); - do { /* check whether `key' is somewhere in the chain */ - if (luaO_rawequalObj(key2tval(n), key)) - return gval(n); /* that's it */ - else n = gnext(n); - } while (n); - return luaO_nilobject; - } - } -} - - -TValue *luaH_set (lua_State *L, Table *t, const TValue *key) { - const TValue *p = luaH_get(t, key); - t->flags = 0; - if (p != luaO_nilobject) - return cast(TValue *, p); - else { - if (ttisnil(key)) luaG_runerror(L, "table index is nil"); - else if (ttisnumber(key) && luai_numisnan(nvalue(key))) - luaG_runerror(L, "table index is NaN"); - return newkey(L, t, key); - } -} - - -TValue *luaH_setnum (lua_State *L, Table *t, int key) { - const TValue *p = luaH_getnum(t, key); - if (p != luaO_nilobject) - return cast(TValue *, p); - else { - TValue k; - setnvalue(&k, cast_num(key)); - return newkey(L, t, &k); - } -} - - -TValue *luaH_setstr (lua_State *L, Table *t, TString *key) { - const TValue *p = luaH_getstr(t, key); - if (p != luaO_nilobject) - return cast(TValue *, p); - else { - TValue k; - setsvalue(L, &k, key); - return newkey(L, t, &k); - } -} - - -static int unbound_search (Table *t, unsigned int j) { - unsigned int i = j; /* i is zero or a present index */ - j++; - /* find `i' and `j' such that i is present and j is not */ - while (!ttisnil(luaH_getnum(t, j))) { - i = j; - j *= 2; - if (j > cast(unsigned int, MAX_INT)) { /* overflow? */ - /* table was built with bad purposes: resort to linear search */ - i = 1; - while (!ttisnil(luaH_getnum(t, i))) i++; - return i - 1; - } - } - /* now do a binary search between them */ - while (j - i > 1) { - unsigned int m = (i+j)/2; - if (ttisnil(luaH_getnum(t, m))) j = m; - else i = m; - } - return i; -} - - -/* -** Try to find a boundary in table `t'. A `boundary' is an integer index -** such that t[i] is non-nil and t[i+1] is nil (and 0 if t[1] is nil). -*/ -int luaH_getn (Table *t) { - unsigned int j = t->sizearray; - if (j > 0 && ttisnil(&t->array[j - 1])) { - /* there is a boundary in the array part: (binary) search for it */ - unsigned int i = 0; - while (j - i > 1) { - unsigned int m = (i+j)/2; - if (ttisnil(&t->array[m - 1])) j = m; - else i = m; - } - return i; - } - /* else must find a boundary in hash part */ - else if (t->node == dummynode) /* hash part is empty? */ - return j; /* that is easy... */ - else return unbound_search(t, j); -} - - - -#if defined(LUA_DEBUG) - -Node *luaH_mainposition (const Table *t, const TValue *key) { - return mainposition(t, key); -} - -int luaH_isdummy (Node *n) { return n == dummynode; } - -#endif diff --git a/script/lua/ltable.h b/script/lua/ltable.h deleted file mode 100644 index f5b9d5ead..000000000 --- a/script/lua/ltable.h +++ /dev/null @@ -1,40 +0,0 @@ -/* -** $Id: ltable.h,v 2.10.1.1 2007/12/27 13:02:25 roberto Exp $ -** Lua tables (hash) -** See Copyright Notice in lua.h -*/ - -#ifndef ltable_h -#define ltable_h - -#include "lobject.h" - - -#define gnode(t,i) (&(t)->node[i]) -#define gkey(n) (&(n)->i_key.nk) -#define gval(n) (&(n)->i_val) -#define gnext(n) ((n)->i_key.nk.next) - -#define key2tval(n) (&(n)->i_key.tvk) - - -LUAI_FUNC const TValue *luaH_getnum (Table *t, int key); -LUAI_FUNC TValue *luaH_setnum (lua_State *L, Table *t, int key); -LUAI_FUNC const TValue *luaH_getstr (Table *t, TString *key); -LUAI_FUNC TValue *luaH_setstr (lua_State *L, Table *t, TString *key); -LUAI_FUNC const TValue *luaH_get (Table *t, const TValue *key); -LUAI_FUNC TValue *luaH_set (lua_State *L, Table *t, const TValue *key); -LUAI_FUNC Table *luaH_new (lua_State *L, int narray, int lnhash); -LUAI_FUNC void luaH_resizearray (lua_State *L, Table *t, int nasize); -LUAI_FUNC void luaH_free (lua_State *L, Table *t); -LUAI_FUNC int luaH_next (lua_State *L, Table *t, StkId key); -LUAI_FUNC int luaH_getn (Table *t); - - -#if defined(LUA_DEBUG) -LUAI_FUNC Node *luaH_mainposition (const Table *t, const TValue *key); -LUAI_FUNC int luaH_isdummy (Node *n); -#endif - - -#endif diff --git a/script/lua/ltablib.c b/script/lua/ltablib.c deleted file mode 100644 index 34a346744..000000000 --- a/script/lua/ltablib.c +++ /dev/null @@ -1,288 +0,0 @@ -/* -** $Id: ltablib.c,v 1.38.1.3 2008/02/14 16:46:58 roberto Exp $ -** Library for Table Manipulation -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#endif - -#define ltablib_c -#define LUA_LIB - -#include "lua.h" - -#include "lauxlib.h" -#include "lualib.h" - - -#define aux_getn(L,n) (luaL_checktype(L, n, LUA_TTABLE), luaL_getn(L, n)) - - -static int foreachi (lua_State *L) { - int i; - int n = aux_getn(L, 1); - luaL_checktype(L, 2, LUA_TFUNCTION); - for (i=1; i <= n; i++) { - lua_pushvalue(L, 2); /* function */ - lua_pushinteger(L, i); /* 1st argument */ - lua_rawgeti(L, 1, i); /* 2nd argument */ - lua_call(L, 2, 1); - if (!lua_isnil(L, -1)) - return 1; - lua_pop(L, 1); /* remove nil result */ - } - return 0; -} - - -static int foreach (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); - luaL_checktype(L, 2, LUA_TFUNCTION); - lua_pushnil(L); /* first key */ - while (lua_next(L, 1)) { - lua_pushvalue(L, 2); /* function */ - lua_pushvalue(L, -3); /* key */ - lua_pushvalue(L, -3); /* value */ - lua_call(L, 2, 1); - if (!lua_isnil(L, -1)) - return 1; - lua_pop(L, 2); /* remove value and result */ - } - return 0; -} - - -static int maxn (lua_State *L) { - lua_Number max = 0; - luaL_checktype(L, 1, LUA_TTABLE); - lua_pushnil(L); /* first key */ - while (lua_next(L, 1)) { - lua_pop(L, 1); /* remove value */ - if (lua_type(L, -1) == LUA_TNUMBER) { - lua_Number v = lua_tonumber(L, -1); - if (v > max) max = v; - } - } - lua_pushnumber(L, max); - return 1; -} - - -static int getn (lua_State *L) { - lua_pushinteger(L, aux_getn(L, 1)); - return 1; -} - - -static int setn (lua_State *L) { - luaL_checktype(L, 1, LUA_TTABLE); -#ifndef luaL_setn - luaL_setn(L, 1, luaL_checkint(L, 2)); -#else - luaL_error(L, LUA_QL("setn") " is obsolete"); -#endif - lua_pushvalue(L, 1); - return 1; -} - - -static int tinsert (lua_State *L) { - int e = aux_getn(L, 1) + 1; /* first empty element */ - int pos; /* where to insert new element */ - switch (lua_gettop(L)) { - case 2: { /* called with only 2 arguments */ - pos = e; /* insert new element at the end */ - break; - } - case 3: { - int i; - pos = luaL_checkint(L, 2); /* 2nd argument is the position */ - if (pos > e) e = pos; /* `grow' array if necessary */ - for (i = e; i > pos; i--) { /* move up elements */ - lua_rawgeti(L, 1, i-1); - lua_rawseti(L, 1, i); /* t[i] = t[i-1] */ - } - break; - } - default: { - return luaL_error(L, "wrong number of arguments to " LUA_QL("insert")); - } - } - luaL_setn(L, 1, e); /* new size */ - lua_rawseti(L, 1, pos); /* t[pos] = v */ - return 0; -} - - -static int tremove (lua_State *L) { - int e = aux_getn(L, 1); - int pos = luaL_optint(L, 2, e); - if (!(1 <= pos && pos <= e)) /* position is outside bounds? */ - return 0; /* nothing to remove */ - luaL_setn(L, 1, e - 1); /* t.n = n-1 */ - lua_rawgeti(L, 1, pos); /* result = t[pos] */ - for ( ;pos= P */ - while (lua_rawgeti(L, 1, ++i), sort_comp(L, -1, -2)) { - if (i>u) luaL_error(L, "invalid order function for sorting"); - lua_pop(L, 1); /* remove a[i] */ - } - /* repeat --j until a[j] <= P */ - while (lua_rawgeti(L, 1, --j), sort_comp(L, -3, -1)) { - if (j -#endif - -#define ltm_c -#define LUA_CORE - -#include "lua.h" - -#include "lobject.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" - - - -const char *const luaT_typenames[] = { - "nil", "boolean", "userdata", "number", - "string", "table", "function", "userdata", "thread", - "proto", "upval" -}; - - -void luaT_init (lua_State *L) { - static const char *const luaT_eventname[] = { /* ORDER TM */ - "__index", "__newindex", - "__gc", "__mode", "__eq", - "__add", "__sub", "__mul", "__div", "__mod", - "__pow", "__unm", "__len", "__lt", "__le", - "__concat", "__call" - }; - int i; - for (i=0; itmname[i] = luaS_new(L, luaT_eventname[i]); - luaS_fix(G(L)->tmname[i]); /* never collect these names */ - } -} - - -/* -** function to be used with macro "fasttm": optimized for absence of -** tag methods -*/ -const TValue *luaT_gettm (Table *events, TMS event, TString *ename) { - const TValue *tm = luaH_getstr(events, ename); - lua_assert(event <= TM_EQ); - if (ttisnil(tm)) { /* no tag method? */ - events->flags |= cast_byte(1u<metatable; - break; - case LUA_TUSERDATA: - mt = uvalue(o)->metatable; - break; - default: - mt = G(L)->mt[ttype(o)]; - } - return (mt ? luaH_getstr(mt, G(L)->tmname[event]) : luaO_nilobject); -} - diff --git a/script/lua/ltm.h b/script/lua/ltm.h deleted file mode 100644 index 64343b781..000000000 --- a/script/lua/ltm.h +++ /dev/null @@ -1,54 +0,0 @@ -/* -** $Id: ltm.h,v 2.6.1.1 2007/12/27 13:02:25 roberto Exp $ -** Tag methods -** See Copyright Notice in lua.h -*/ - -#ifndef ltm_h -#define ltm_h - - -#include "lobject.h" - - -/* -* WARNING: if you change the order of this enumeration, -* grep "ORDER TM" -*/ -typedef enum { - TM_INDEX, - TM_NEWINDEX, - TM_GC, - TM_MODE, - TM_EQ, /* last tag method with `fast' access */ - TM_ADD, - TM_SUB, - TM_MUL, - TM_DIV, - TM_MOD, - TM_POW, - TM_UNM, - TM_LEN, - TM_LT, - TM_LE, - TM_CONCAT, - TM_CALL, - TM_N /* number of elements in the enum */ -} TMS; - - - -#define gfasttm(g,et,e) ((et) == NULL ? NULL : \ - ((et)->flags & (1u<<(e))) ? NULL : luaT_gettm(et, e, (g)->tmname[e])) - -#define fasttm(l,et,e) gfasttm(G(l), et, e) - -LUAI_DATA const char *const luaT_typenames[]; - - -LUAI_FUNC const TValue *luaT_gettm (Table *events, TMS event, TString *ename); -LUAI_FUNC const TValue *luaT_gettmbyobj (lua_State *L, const TValue *o, - TMS event); -LUAI_FUNC void luaT_init (lua_State *L); - -#endif diff --git a/script/lua/lua.h b/script/lua/lua.h deleted file mode 100644 index 91aa410e8..000000000 --- a/script/lua/lua.h +++ /dev/null @@ -1,388 +0,0 @@ -/* -** $Id: lua.h,v 1.218.1.5 2008/08/06 13:30:12 roberto Exp $ -** Lua - An Extensible Extension Language -** Lua.org, PUC-Rio, Brazil (http://www.lua.org) -** See Copyright Notice at the end of this file -*/ - - -#ifndef lua_h -#define lua_h - -#include -#include - - -#include "luaconf.h" - - -#define LUA_VERSION "Lua 5.1" -#define LUA_RELEASE "Lua 5.1.4" -#define LUA_VERSION_NUM 501 -#define LUA_COPYRIGHT "Copyright (C) 1994-2008 Lua.org, PUC-Rio" -#define LUA_AUTHORS "R. Ierusalimschy, L. H. de Figueiredo & W. Celes" - - -/* mark for precompiled code (`Lua') */ -#define LUA_SIGNATURE "\033Lua" - -/* option for multiple returns in `lua_pcall' and `lua_call' */ -#define LUA_MULTRET (-1) - - -/* -** pseudo-indices -*/ -#define LUA_REGISTRYINDEX (-10000) -#define LUA_ENVIRONINDEX (-10001) -#define LUA_GLOBALSINDEX (-10002) -#define lua_upvalueindex(i) (LUA_GLOBALSINDEX-(i)) - - -/* thread status; 0 is OK */ -#define LUA_YIELD 1 -#define LUA_ERRRUN 2 -#define LUA_ERRSYNTAX 3 -#define LUA_ERRMEM 4 -#define LUA_ERRERR 5 - - -typedef struct lua_State lua_State; - -typedef int (*lua_CFunction) (lua_State *L); - - -/* -** functions that read/write blocks when loading/dumping Lua chunks -*/ -typedef const char * (*lua_Reader) (lua_State *L, void *ud, size_t *sz); - -typedef int (*lua_Writer) (lua_State *L, const void* p, size_t sz, void* ud); - - -/* -** prototype for memory-allocation functions -*/ -typedef void * (*lua_Alloc) (void *ud, void *ptr, size_t osize, size_t nsize); - - -/* -** basic types -*/ -#define LUA_TNONE (-1) - -#define LUA_TNIL 0 -#define LUA_TBOOLEAN 1 -#define LUA_TLIGHTUSERDATA 2 -#define LUA_TNUMBER 3 -#define LUA_TSTRING 4 -#define LUA_TTABLE 5 -#define LUA_TFUNCTION 6 -#define LUA_TUSERDATA 7 -#define LUA_TTHREAD 8 - - - -/* minimum Lua stack available to a C function */ -#define LUA_MINSTACK 20 - - -/* -** generic extra include file -*/ -#if defined(LUA_USER_H) -#include LUA_USER_H -#endif - - -/* type of numbers in Lua */ -typedef LUA_NUMBER lua_Number; - - -/* type for integer functions */ -typedef LUA_INTEGER lua_Integer; - - - -/* -** state manipulation -*/ -LUA_API lua_State *(lua_newstate) (lua_Alloc f, void *ud); -LUA_API void (lua_close) (lua_State *L); -LUA_API lua_State *(lua_newthread) (lua_State *L); - -LUA_API lua_CFunction (lua_atpanic) (lua_State *L, lua_CFunction panicf); - - -/* -** basic stack manipulation -*/ -LUA_API int (lua_gettop) (lua_State *L); -LUA_API void (lua_settop) (lua_State *L, int idx); -LUA_API void (lua_pushvalue) (lua_State *L, int idx); -LUA_API void (lua_remove) (lua_State *L, int idx); -LUA_API void (lua_insert) (lua_State *L, int idx); -LUA_API void (lua_replace) (lua_State *L, int idx); -LUA_API int (lua_checkstack) (lua_State *L, int sz); - -LUA_API void (lua_xmove) (lua_State *from, lua_State *to, int n); - - -/* -** access functions (stack -> C) -*/ - -LUA_API int (lua_isnumber) (lua_State *L, int idx); -LUA_API int (lua_isstring) (lua_State *L, int idx); -LUA_API int (lua_iscfunction) (lua_State *L, int idx); -LUA_API int (lua_isuserdata) (lua_State *L, int idx); -LUA_API int (lua_type) (lua_State *L, int idx); -LUA_API const char *(lua_typename) (lua_State *L, int tp); - -LUA_API int (lua_equal) (lua_State *L, int idx1, int idx2); -LUA_API int (lua_rawequal) (lua_State *L, int idx1, int idx2); -LUA_API int (lua_lessthan) (lua_State *L, int idx1, int idx2); - -LUA_API lua_Number (lua_tonumber) (lua_State *L, int idx); -LUA_API lua_Integer (lua_tointeger) (lua_State *L, int idx); -LUA_API int (lua_toboolean) (lua_State *L, int idx); -LUA_API const char *(lua_tolstring) (lua_State *L, int idx, size_t *len); -LUA_API size_t (lua_objlen) (lua_State *L, int idx); -LUA_API lua_CFunction (lua_tocfunction) (lua_State *L, int idx); -LUA_API void *(lua_touserdata) (lua_State *L, int idx); -LUA_API lua_State *(lua_tothread) (lua_State *L, int idx); -LUA_API const void *(lua_topointer) (lua_State *L, int idx); - - -/* -** push functions (C -> stack) -*/ -LUA_API void (lua_pushnil) (lua_State *L); -LUA_API void (lua_pushnumber) (lua_State *L, lua_Number n); -LUA_API void (lua_pushinteger) (lua_State *L, lua_Integer n); -LUA_API void (lua_pushlstring) (lua_State *L, const char *s, size_t l); -LUA_API void (lua_pushstring) (lua_State *L, const char *s); -LUA_API const char *(lua_pushvfstring) (lua_State *L, const char *fmt, - va_list argp); -LUA_API const char *(lua_pushfstring) (lua_State *L, const char *fmt, ...); -LUA_API void (lua_pushcclosure) (lua_State *L, lua_CFunction fn, int n); -LUA_API void (lua_pushboolean) (lua_State *L, int b); -LUA_API void (lua_pushlightuserdata) (lua_State *L, void *p); -LUA_API int (lua_pushthread) (lua_State *L); - - -/* -** get functions (Lua -> stack) -*/ -LUA_API void (lua_gettable) (lua_State *L, int idx); -LUA_API void (lua_getfield) (lua_State *L, int idx, const char *k); -LUA_API void (lua_rawget) (lua_State *L, int idx); -LUA_API void (lua_rawgeti) (lua_State *L, int idx, int n); -LUA_API void (lua_createtable) (lua_State *L, int narr, int nrec); -LUA_API void *(lua_newuserdata) (lua_State *L, size_t sz); -LUA_API int (lua_getmetatable) (lua_State *L, int objindex); -LUA_API void (lua_getfenv) (lua_State *L, int idx); - - -/* -** set functions (stack -> Lua) -*/ -LUA_API void (lua_settable) (lua_State *L, int idx); -LUA_API void (lua_setfield) (lua_State *L, int idx, const char *k); -LUA_API void (lua_rawset) (lua_State *L, int idx); -LUA_API void (lua_rawseti) (lua_State *L, int idx, int n); -LUA_API int (lua_setmetatable) (lua_State *L, int objindex); -LUA_API int (lua_setfenv) (lua_State *L, int idx); - - -/* -** `load' and `call' functions (load and run Lua code) -*/ -LUA_API void (lua_call) (lua_State *L, int nargs, int nresults); -LUA_API int (lua_pcall) (lua_State *L, int nargs, int nresults, int errfunc); -LUA_API int (lua_cpcall) (lua_State *L, lua_CFunction func, void *ud); -LUA_API int (lua_load) (lua_State *L, lua_Reader reader, void *dt, - const char *chunkname); - -LUA_API int (lua_dump) (lua_State *L, lua_Writer writer, void *data); - - -/* -** coroutine functions -*/ -LUA_API int (lua_yield) (lua_State *L, int nresults); -LUA_API int (lua_resume) (lua_State *L, int narg); -LUA_API int (lua_status) (lua_State *L); - -/* -** garbage-collection function and options -*/ - -#define LUA_GCSTOP 0 -#define LUA_GCRESTART 1 -#define LUA_GCCOLLECT 2 -#define LUA_GCCOUNT 3 -#define LUA_GCCOUNTB 4 -#define LUA_GCSTEP 5 -#define LUA_GCSETPAUSE 6 -#define LUA_GCSETSTEPMUL 7 - -LUA_API int (lua_gc) (lua_State *L, int what, int data); - - -/* -** miscellaneous functions -*/ - -LUA_API int (lua_error) (lua_State *L); - -LUA_API int (lua_next) (lua_State *L, int idx); - -LUA_API void (lua_concat) (lua_State *L, int n); - -LUA_API lua_Alloc (lua_getallocf) (lua_State *L, void **ud); -LUA_API void lua_setallocf (lua_State *L, lua_Alloc f, void *ud); - - - -/* -** =============================================================== -** some useful macros -** =============================================================== -*/ - -#define lua_pop(L,n) lua_settop(L, -(n)-1) - -#define lua_newtable(L) lua_createtable(L, 0, 0) - -#define lua_register(L,n,f) (lua_pushcfunction(L, (f)), lua_setglobal(L, (n))) - -#define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0) - -#define lua_strlen(L,i) lua_objlen(L, (i)) - -#define lua_isfunction(L,n) (lua_type(L, (n)) == LUA_TFUNCTION) -#define lua_istable(L,n) (lua_type(L, (n)) == LUA_TTABLE) -#define lua_islightuserdata(L,n) (lua_type(L, (n)) == LUA_TLIGHTUSERDATA) -#define lua_isnil(L,n) (lua_type(L, (n)) == LUA_TNIL) -#define lua_isboolean(L,n) (lua_type(L, (n)) == LUA_TBOOLEAN) -#define lua_isthread(L,n) (lua_type(L, (n)) == LUA_TTHREAD) -#define lua_isnone(L,n) (lua_type(L, (n)) == LUA_TNONE) -#define lua_isnoneornil(L, n) (lua_type(L, (n)) <= 0) - -#define lua_pushliteral(L, s) \ - lua_pushlstring(L, "" s, (sizeof(s)/sizeof(char))-1) - -#define lua_setglobal(L,s) lua_setfield(L, LUA_GLOBALSINDEX, (s)) -#define lua_getglobal(L,s) lua_getfield(L, LUA_GLOBALSINDEX, (s)) - -#define lua_tostring(L,i) lua_tolstring(L, (i), NULL) - - - -/* -** compatibility macros and functions -*/ - -#define lua_open() luaL_newstate() - -#define lua_getregistry(L) lua_pushvalue(L, LUA_REGISTRYINDEX) - -#define lua_getgccount(L) lua_gc(L, LUA_GCCOUNT, 0) - -#define lua_Chunkreader lua_Reader -#define lua_Chunkwriter lua_Writer - - -/* hack */ -LUA_API void lua_setlevel (lua_State *from, lua_State *to); - - -/* -** {====================================================================== -** Debug API -** ======================================================================= -*/ - - -/* -** Event codes -*/ -#define LUA_HOOKCALL 0 -#define LUA_HOOKRET 1 -#define LUA_HOOKLINE 2 -#define LUA_HOOKCOUNT 3 -#define LUA_HOOKTAILRET 4 - - -/* -** Event masks -*/ -#define LUA_MASKCALL (1 << LUA_HOOKCALL) -#define LUA_MASKRET (1 << LUA_HOOKRET) -#define LUA_MASKLINE (1 << LUA_HOOKLINE) -#define LUA_MASKCOUNT (1 << LUA_HOOKCOUNT) - -typedef struct lua_Debug lua_Debug; /* activation record */ - - -/* Functions to be called by the debuger in specific events */ -typedef void (*lua_Hook) (lua_State *L, lua_Debug *ar); - - -LUA_API int lua_getstack (lua_State *L, int level, lua_Debug *ar); -LUA_API int lua_getinfo (lua_State *L, const char *what, lua_Debug *ar); -LUA_API const char *lua_getlocal (lua_State *L, const lua_Debug *ar, int n); -LUA_API const char *lua_setlocal (lua_State *L, const lua_Debug *ar, int n); -LUA_API const char *lua_getupvalue (lua_State *L, int funcindex, int n); -LUA_API const char *lua_setupvalue (lua_State *L, int funcindex, int n); - -LUA_API int lua_sethook (lua_State *L, lua_Hook func, int mask, int count); -LUA_API lua_Hook lua_gethook (lua_State *L); -LUA_API int lua_gethookmask (lua_State *L); -LUA_API int lua_gethookcount (lua_State *L); - - -struct lua_Debug { - int event; - const char *name; /* (n) */ - const char *namewhat; /* (n) `global', `local', `field', `method' */ - const char *what; /* (S) `Lua', `C', `main', `tail' */ - const char *source; /* (S) */ - int currentline; /* (l) */ - int nups; /* (u) number of upvalues */ - int linedefined; /* (S) */ - int lastlinedefined; /* (S) */ - char short_src[LUA_IDSIZE]; /* (S) */ - /* private part */ - int i_ci; /* active function */ -}; - -/* }====================================================================== */ - - -/****************************************************************************** -* Copyright (C) 1994-2008 Lua.org, PUC-Rio. All rights reserved. -* -* Permission is hereby granted, free of charge, to any person obtaining -* a copy of this software and associated documentation files (the -* "Software"), to deal in the Software without restriction, including -* without limitation the rights to use, copy, modify, merge, publish, -* distribute, sublicense, and/or sell copies of the Software, and to -* permit persons to whom the Software is furnished to do so, subject to -* the following conditions: -* -* The above copyright notice and this permission notice shall be -* included in all copies or substantial portions of the Software. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -* TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -******************************************************************************/ - - -#endif diff --git a/script/lua/luaconf.h b/script/lua/luaconf.h deleted file mode 100644 index c7f73c3c8..000000000 --- a/script/lua/luaconf.h +++ /dev/null @@ -1,811 +0,0 @@ -/* -** $Id: luaconf.h,v 1.82.1.7 2008/02/11 16:25:08 roberto Exp $ -** Configuration file for Lua -** See Copyright Notice in lua.h -*/ - - -#ifndef lconfig_h -#define lconfig_h - -#if 0 -#include -#include -#endif - -#include "grub_lua.h" - -/* -** ================================================================== -** Search for "@@" to find all configurable definitions. -** =================================================================== -*/ - - -/* -@@ LUA_ANSI controls the use of non-ansi features. -** CHANGE it (define it) if you want Lua to avoid the use of any -** non-ansi feature or library. -*/ -#if defined(__STRICT_ANSI__) -#define LUA_ANSI -#endif - - -#if !defined(LUA_ANSI) && defined(_WIN32) -#define LUA_WIN -#endif - -#if defined(LUA_USE_LINUX) -#define LUA_USE_POSIX -#define LUA_USE_DLOPEN /* needs an extra library: -ldl */ -#define LUA_USE_READLINE /* needs some extra libraries */ -#endif - -#if defined(LUA_USE_MACOSX) -#define LUA_USE_POSIX -#define LUA_DL_DYLD /* does not need extra library */ -#endif - - - -/* -@@ LUA_USE_POSIX includes all functionallity listed as X/Open System -@* Interfaces Extension (XSI). -** CHANGE it (define it) if your system is XSI compatible. -*/ -#if 0 -#if defined(LUA_USE_POSIX) -#define LUA_USE_MKSTEMP -#define LUA_USE_ISATTY -#define LUA_USE_POPEN -#define LUA_USE_ULONGJMP -#endif -#endif - -/* -@@ LUA_PATH and LUA_CPATH are the names of the environment variables that -@* Lua check to set its paths. -@@ LUA_INIT is the name of the environment variable that Lua -@* checks for initialization code. -** CHANGE them if you want different names. -*/ -#define LUA_PATH "LUA_PATH" -#define LUA_CPATH "LUA_CPATH" -#define LUA_INIT "LUA_INIT" - - -/* -@@ LUA_PATH_DEFAULT is the default path that Lua uses to look for -@* Lua libraries. -@@ LUA_CPATH_DEFAULT is the default path that Lua uses to look for -@* C libraries. -** CHANGE them if your machine has a non-conventional directory -** hierarchy or if you want to install your libraries in -** non-conventional directories. -*/ -#if defined(_WIN32) -/* -** In Windows, any exclamation mark ('!') in the path is replaced by the -** path of the directory of the executable file of the current process. -*/ -#define LUA_LDIR "!\\lua\\" -#define LUA_CDIR "!\\" -#define LUA_PATH_DEFAULT \ - ".\\?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?\\init.lua;" \ - LUA_CDIR"?.lua;" LUA_CDIR"?\\init.lua" -#define LUA_CPATH_DEFAULT \ - ".\\?.dll;" ".\\?51.dll;" LUA_CDIR"?.dll;" LUA_CDIR"?51.dll;" LUA_CDIR"clibs\\?.dll;" LUA_CDIR"clibs\\?51.dll;" LUA_CDIR"loadall.dll;" LUA_CDIR"clibs\\loadall.dll" - -#else -#define LUA_ROOT "/usr/local/" -#define LUA_LDIR LUA_ROOT "share/lua/5.1/" -#define LUA_CDIR LUA_ROOT "lib/lua/5.1/" -#define LUA_PATH_DEFAULT \ - "./?.lua;" LUA_LDIR"?.lua;" LUA_LDIR"?/init.lua;" \ - LUA_CDIR"?.lua;" LUA_CDIR"?/init.lua" -#define LUA_CPATH_DEFAULT \ - "./?.so;" "./lib?51.so;" LUA_CDIR"?.so;" LUA_CDIR"lib?51.so;" LUA_CDIR"loadall.so" -#endif - - -/* -@@ LUA_DIRSEP is the directory separator (for submodules). -** CHANGE it if your machine does not use "/" as the directory separator -** and is not Windows. (On Windows Lua automatically uses "\".) -*/ -#if defined(_WIN32) -#define LUA_DIRSEP "\\" -#else -#define LUA_DIRSEP "/" -#endif - - -/* -@@ LUA_PATHSEP is the character that separates templates in a path. -@@ LUA_PATH_MARK is the string that marks the substitution points in a -@* template. -@@ LUA_EXECDIR in a Windows path is replaced by the executable's -@* directory. -@@ LUA_IGMARK is a mark to ignore all before it when bulding the -@* luaopen_ function name. -** CHANGE them if for some reason your system cannot use those -** characters. (E.g., if one of those characters is a common character -** in file/directory names.) Probably you do not need to change them. -*/ -#define LUA_PATHSEP ";" -#define LUA_PATH_MARK "?" -#define LUA_EXECDIR "!" -#define LUA_IGMARK "-" - - -/* -@@ LUA_INTEGER is the integral type used by lua_pushinteger/lua_tointeger. -** CHANGE that if ptrdiff_t is not adequate on your machine. (On most -** machines, ptrdiff_t gives a good choice between int or long.) -*/ -#define LUA_INTEGER ptrdiff_t - - -/* -@@ LUA_API is a mark for all core API functions. -@@ LUALIB_API is a mark for all standard library functions. -** CHANGE them if you need to define those functions in some special way. -** For instance, if you want to create one Windows DLL with the core and -** the libraries, you may want to use the following definition (define -** LUA_BUILD_AS_DLL to get it). -*/ -#if defined(LUA_BUILD_AS_DLL) - -#if defined(LUA_CORE) || defined(LUA_LIB) -#define LUA_API __declspec(dllexport) -#else -#define LUA_API __declspec(dllimport) -#endif - -#else - -#define LUA_API extern - -#endif - -/* more often than not the libs go together with the core */ -#define LUALIB_API LUA_API - - -/* -@@ LUAI_FUNC is a mark for all extern functions that are not to be -@* exported to outside modules. -@@ LUAI_DATA is a mark for all extern (const) variables that are not to -@* be exported to outside modules. -** CHANGE them if you need to mark them in some special way. Elf/gcc -** (versions 3.2 and later) mark them as "hidden" to optimize access -** when Lua is compiled as a shared library. -*/ -#if defined(luaall_c) -#define LUAI_FUNC static -#define LUAI_DATA /* empty */ - -#elif defined(__GNUC__) && ((__GNUC__*100 + __GNUC_MINOR__) >= 302) && \ - defined(__ELF__) -#define LUAI_FUNC __attribute__((visibility("hidden"))) extern -#define LUAI_DATA LUAI_FUNC - -#else -#define LUAI_FUNC extern -#define LUAI_DATA extern -#endif - - - -/* -@@ LUA_QL describes how error messages quote program elements. -** CHANGE it if you want a different appearance. -*/ -#define LUA_QL(x) "'" x "'" -#define LUA_QS LUA_QL("%s") - - -/* -@@ LUA_IDSIZE gives the maximum size for the description of the source -@* of a function in debug information. -** CHANGE it if you want a different size. -*/ -#define LUA_IDSIZE 60 - - -/* -** {================================================================== -** Stand-alone configuration -** =================================================================== -*/ - -#if defined(lua_c) || defined(luaall_c) - -/* -@@ lua_stdin_is_tty detects whether the standard input is a 'tty' (that -@* is, whether we're running lua interactively). -** CHANGE it if you have a better definition for non-POSIX/non-Windows -** systems. -*/ -#if defined(LUA_USE_ISATTY) -#include -#define lua_stdin_is_tty() isatty(0) -#elif defined(LUA_WIN) -#include -#include -#define lua_stdin_is_tty() _isatty(_fileno(stdin)) -#else -#define lua_stdin_is_tty() 1 /* assume stdin is a tty */ -#endif - - -/* -@@ LUA_PROMPT is the default prompt used by stand-alone Lua. -@@ LUA_PROMPT2 is the default continuation prompt used by stand-alone Lua. -** CHANGE them if you want different prompts. (You can also change the -** prompts dynamically, assigning to globals _PROMPT/_PROMPT2.) -*/ -#define LUA_PROMPT "> " -#define LUA_PROMPT2 ">> " - - -/* -@@ LUA_PROGNAME is the default name for the stand-alone Lua program. -** CHANGE it if your stand-alone interpreter has a different name and -** your system is not able to detect that name automatically. -*/ -#define LUA_PROGNAME "lua" - - -/* -@@ LUA_MAXINPUT is the maximum length for an input line in the -@* stand-alone interpreter. -** CHANGE it if you need longer lines. -*/ -#define LUA_MAXINPUT 512 - - -/* -@@ lua_readline defines how to show a prompt and then read a line from -@* the standard input. -@@ lua_saveline defines how to "save" a read line in a "history". -@@ lua_freeline defines how to free a line read by lua_readline. -** CHANGE them if you want to improve this functionality (e.g., by using -** GNU readline and history facilities). -*/ -#if defined(LUA_USE_READLINE) -#include -#include -#include -#define lua_readline(L,b,p) ((void)L, ((b)=readline(p)) != NULL) -#define lua_saveline(L,idx) \ - if (lua_strlen(L,idx) > 0) /* non-empty line? */ \ - add_history(lua_tostring(L, idx)); /* add it to history */ -#define lua_freeline(L,b) ((void)L, free(b)) -#else -#define lua_readline(L,b,p) \ - ((void)L, fputs(p, stdout), fflush(stdout), /* show prompt */ \ - fgets(b, LUA_MAXINPUT, stdin) != NULL) /* get line */ -#define lua_saveline(L,idx) { (void)L; (void)idx; } -#define lua_freeline(L,b) { (void)L; (void)b; } -#endif - -#endif - -/* }================================================================== */ - - -/* -@@ LUAI_GCPAUSE defines the default pause between garbage-collector cycles -@* as a percentage. -** CHANGE it if you want the GC to run faster or slower (higher values -** mean larger pauses which mean slower collection.) You can also change -** this value dynamically. -*/ -#define LUAI_GCPAUSE 200 /* 200% (wait memory to double before next GC) */ - - -/* -@@ LUAI_GCMUL defines the default speed of garbage collection relative to -@* memory allocation as a percentage. -** CHANGE it if you want to change the granularity of the garbage -** collection. (Higher values mean coarser collections. 0 represents -** infinity, where each step performs a full collection.) You can also -** change this value dynamically. -*/ -#define LUAI_GCMUL 200 /* GC runs 'twice the speed' of memory allocation */ - - - -/* -@@ LUA_COMPAT_GETN controls compatibility with old getn behavior. -** CHANGE it (define it) if you want exact compatibility with the -** behavior of setn/getn in Lua 5.0. -*/ -#undef LUA_COMPAT_GETN - -/* -@@ LUA_COMPAT_LOADLIB controls compatibility about global loadlib. -** CHANGE it to undefined as soon as you do not need a global 'loadlib' -** function (the function is still available as 'package.loadlib'). -*/ -#undef LUA_COMPAT_LOADLIB - -/* -@@ LUA_COMPAT_VARARG controls compatibility with old vararg feature. -** CHANGE it to undefined as soon as your programs use only '...' to -** access vararg parameters (instead of the old 'arg' table). -*/ -#define LUA_COMPAT_VARARG - -/* -@@ LUA_COMPAT_MOD controls compatibility with old math.mod function. -** CHANGE it to undefined as soon as your programs use 'math.fmod' or -** the new '%' operator instead of 'math.mod'. -*/ -#define LUA_COMPAT_MOD - -/* -@@ LUA_COMPAT_LSTR controls compatibility with old long string nesting -@* facility. -** CHANGE it to 2 if you want the old behaviour, or undefine it to turn -** off the advisory error when nesting [[...]]. -*/ -#define LUA_COMPAT_LSTR 1 - -/* -@@ LUA_COMPAT_GFIND controls compatibility with old 'string.gfind' name. -** CHANGE it to undefined as soon as you rename 'string.gfind' to -** 'string.gmatch'. -*/ -#define LUA_COMPAT_GFIND - -/* -@@ LUA_COMPAT_OPENLIB controls compatibility with old 'luaL_openlib' -@* behavior. -** CHANGE it to undefined as soon as you replace to 'luaL_register' -** your uses of 'luaL_openlib' -*/ -#define LUA_COMPAT_OPENLIB - - - -/* -@@ luai_apicheck is the assert macro used by the Lua-C API. -** CHANGE luai_apicheck if you want Lua to perform some checks in the -** parameters it gets from API calls. This may slow down the interpreter -** a bit, but may be quite useful when debugging C code that interfaces -** with Lua. A useful redefinition is to use assert.h. -*/ -#if defined(LUA_USE_APICHECK) -#include -#define luai_apicheck(L,o) { (void)L; assert(o); } -#else -#define luai_apicheck(L,o) { (void)L; } -#endif - - -/* -@@ LUAI_BITSINT defines the number of bits in an int. -** CHANGE here if Lua cannot automatically detect the number of bits of -** your machine. Probably you do not need to change this. -*/ -/* avoid overflows in comparison */ -#if INT_MAX-20 < 32760 -#define LUAI_BITSINT 16 -#elif INT_MAX > 2147483640L -/* int has at least 32 bits */ -#define LUAI_BITSINT 32 -#else -#error "you must define LUA_BITSINT with number of bits in an integer" -#endif - - -/* -@@ LUAI_UINT32 is an unsigned integer with at least 32 bits. -@@ LUAI_INT32 is an signed integer with at least 32 bits. -@@ LUAI_UMEM is an unsigned integer big enough to count the total -@* memory used by Lua. -@@ LUAI_MEM is a signed integer big enough to count the total memory -@* used by Lua. -** CHANGE here if for some weird reason the default definitions are not -** good enough for your machine. (The definitions in the 'else' -** part always works, but may waste space on machines with 64-bit -** longs.) Probably you do not need to change this. -*/ -#if LUAI_BITSINT >= 32 -#define LUAI_UINT32 unsigned int -#define LUAI_INT32 int -#define LUAI_MAXINT32 INT_MAX -#define LUAI_UMEM size_t -#define LUAI_MEM ptrdiff_t -#else -/* 16-bit ints */ -#define LUAI_UINT32 unsigned long -#define LUAI_INT32 long -#define LUAI_MAXINT32 LONG_MAX -#define LUAI_UMEM unsigned long -#define LUAI_MEM long -#endif - - -/* -@@ LUAI_MAXCALLS limits the number of nested calls. -** CHANGE it if you need really deep recursive calls. This limit is -** arbitrary; its only purpose is to stop infinite recursion before -** exhausting memory. -*/ -#define LUAI_MAXCALLS 20000 - - -/* -@@ LUAI_MAXCSTACK limits the number of Lua stack slots that a C function -@* can use. -** CHANGE it if you need lots of (Lua) stack space for your C -** functions. This limit is arbitrary; its only purpose is to stop C -** functions to consume unlimited stack space. (must be smaller than -** -LUA_REGISTRYINDEX) -*/ -#define LUAI_MAXCSTACK 8000 - - - -/* -** {================================================================== -** CHANGE (to smaller values) the following definitions if your system -** has a small C stack. (Or you may want to change them to larger -** values if your system has a large C stack and these limits are -** too rigid for you.) Some of these constants control the size of -** stack-allocated arrays used by the compiler or the interpreter, while -** others limit the maximum number of recursive calls that the compiler -** or the interpreter can perform. Values too large may cause a C stack -** overflow for some forms of deep constructs. -** =================================================================== -*/ - - -/* -@@ LUAI_MAXCCALLS is the maximum depth for nested C calls (short) and -@* syntactical nested non-terminals in a program. -*/ -#define LUAI_MAXCCALLS 200 - - -/* -@@ LUAI_MAXVARS is the maximum number of local variables per function -@* (must be smaller than 250). -*/ -#define LUAI_MAXVARS 200 - - -/* -@@ LUAI_MAXUPVALUES is the maximum number of upvalues per function -@* (must be smaller than 250). -*/ -#define LUAI_MAXUPVALUES 60 - - -/* -@@ LUAL_BUFFERSIZE is the buffer size used by the lauxlib buffer system. -*/ -#if 0 -#define LUAL_BUFFERSIZE BUFSIZ -#else -#define LUAL_BUFFERSIZE 512 -#endif - -/* }================================================================== */ - - - - -/* -** {================================================================== -@@ LUA_NUMBER is the type of numbers in Lua. -** CHANGE the following definitions only if you want to build Lua -** with a number type different from double. You may also need to -** change lua_number2int & lua_number2integer. -** =================================================================== -*/ - -#if 0 -#define LUA_NUMBER_DOUBLE -#define LUA_NUMBER double - -/* -@@ LUAI_UACNUMBER is the result of an 'usual argument conversion' -@* over a number. -*/ -#define LUAI_UACNUMBER double -#else - -#define LUA_NUMBER int -#define LUAI_UACNUMBER int - -#endif - -/* -@@ LUA_NUMBER_SCAN is the format for reading numbers. -@@ LUA_NUMBER_FMT is the format for writing numbers. -@@ lua_number2str converts a number to a string. -@@ LUAI_MAXNUMBER2STR is maximum size of previous conversion. -@@ lua_str2number converts a string to a number. -*/ -#if 0 -#define LUA_NUMBER_SCAN "%lf" -#define LUA_NUMBER_FMT "%.14g" -#else -#define LUA_NUMBER_SCAN "%d" -#define LUA_NUMBER_FMT "%d" -#endif -#define lua_number2str(s,n) sprintf((s), LUA_NUMBER_FMT, (n)) -#define LUAI_MAXNUMBER2STR 32 /* 16 digits, sign, point, and \0 */ -#define lua_str2number(s,p) strtod((s), (p)) - - -/* -@@ The luai_num* macros define the primitive operations over numbers. -*/ -#if defined(LUA_CORE) -#if 0 -#include -#endif -#define luai_numadd(a,b) ((a)+(b)) -#define luai_numsub(a,b) ((a)-(b)) -#define luai_nummul(a,b) ((a)*(b)) -#define luai_numdiv(a,b) ((a)/(b)) -#if 0 -#define luai_nummod(a,b) ((a) - floor((a)/(b))*(b)) -#define luai_numpow(a,b) (pow(a,b)) -#else - -#define luai_nummod(a,b) ((a) % (b)) - -static inline LUA_NUMBER -luai_numpow (LUA_NUMBER a, LUA_NUMBER b) -{ - LUA_NUMBER c; - - c = 1; - while (b > 0) - { - c *= a; - b--; - } - - return c; -} - -#endif -#define luai_numunm(a) (-(a)) -#define luai_numeq(a,b) ((a)==(b)) -#define luai_numlt(a,b) ((a)<(b)) -#define luai_numle(a,b) ((a)<=(b)) -#define luai_numisnan(a) (!luai_numeq((a), (a))) -#endif - - -/* -@@ lua_number2int is a macro to convert lua_Number to int. -@@ lua_number2integer is a macro to convert lua_Number to lua_Integer. -** CHANGE them if you know a faster way to convert a lua_Number to -** int (with any rounding method and without throwing errors) in your -** system. In Pentium machines, a naive typecast from double to int -** in C is extremely slow, so any alternative is worth trying. -*/ - -#if 0 -/* On a Pentium, resort to a trick */ -#if defined(LUA_NUMBER_DOUBLE) && !defined(LUA_ANSI) && !defined(__SSE2__) && \ - (defined(__i386) || defined (_M_IX86) || defined(__i386__)) - -/* On a Microsoft compiler, use assembler */ -#if defined(_MSC_VER) - -#define lua_number2int(i,d) __asm fld d __asm fistp i -#define lua_number2integer(i,n) lua_number2int(i, n) - -/* the next trick should work on any Pentium, but sometimes clashes - with a DirectX idiosyncrasy */ -#else - -union luai_Cast { double l_d; long l_l; }; -#define lua_number2int(i,d) \ - { volatile union luai_Cast u; u.l_d = (d) + 6755399441055744.0; (i) = u.l_l; } -#define lua_number2integer(i,n) lua_number2int(i, n) - -#endif - - -/* this option always works, but may be slow */ -#else -#define lua_number2int(i,d) ((i)=(int)(d)) -#define lua_number2integer(i,d) ((i)=(lua_Integer)(d)) - -#endif - -#else -#define lua_number2int(i,d) ((i)=(int)(d)) -#define lua_number2integer(i,d) ((i)=(lua_Integer)(d)) -#endif - -/* }================================================================== */ - - -/* -@@ LUAI_USER_ALIGNMENT_T is a type that requires maximum alignment. -** CHANGE it if your system requires alignments larger than double. (For -** instance, if your system supports long doubles and they must be -** aligned in 16-byte boundaries, then you should add long double in the -** union.) Probably you do not need to change this. -*/ -#define LUAI_USER_ALIGNMENT_T union { double u; void *s; long l; } - - -/* -@@ LUAI_THROW/LUAI_TRY define how Lua does exception handling. -** CHANGE them if you prefer to use longjmp/setjmp even with C++ -** or if want/don't to use _longjmp/_setjmp instead of regular -** longjmp/setjmp. By default, Lua handles errors with exceptions when -** compiling as C++ code, with _longjmp/_setjmp when asked to use them, -** and with longjmp/setjmp otherwise. -*/ -#if defined(__cplusplus) -/* C++ exceptions */ -#define LUAI_THROW(L,c) throw(c) -#define LUAI_TRY(L,c,a) try { a } catch(...) \ - { if ((c)->status == 0) (c)->status = -1; } -#define luai_jmpbuf int /* dummy variable */ - -#elif defined(LUA_USE_ULONGJMP) -/* in Unix, try _longjmp/_setjmp (more efficient) */ -#define LUAI_THROW(L,c) _longjmp((c)->b, 1) -#define LUAI_TRY(L,c,a) if (_setjmp((c)->b) == 0) { a } -#define luai_jmpbuf jmp_buf - -#else -/* default handling with long jumps */ -#define LUAI_THROW(L,c) longjmp((c)->b, 1) -#define LUAI_TRY(L,c,a) if (setjmp((c)->b) == 0) { a } -#define luai_jmpbuf jmp_buf - -#endif - - -/* -@@ LUA_MAXCAPTURES is the maximum number of captures that a pattern -@* can do during pattern-matching. -** CHANGE it if you need more captures. This limit is arbitrary. -*/ -#define LUA_MAXCAPTURES 32 - - -/* -@@ lua_tmpnam is the function that the OS library uses to create a -@* temporary name. -@@ LUA_TMPNAMBUFSIZE is the maximum size of a name created by lua_tmpnam. -** CHANGE them if you have an alternative to tmpnam (which is considered -** insecure) or if you want the original tmpnam anyway. By default, Lua -** uses tmpnam except when POSIX is available, where it uses mkstemp. -*/ -#if defined(loslib_c) || defined(luaall_c) - -#if defined(LUA_USE_MKSTEMP) -#include -#define LUA_TMPNAMBUFSIZE 32 -#define lua_tmpnam(b,e) { \ - strcpy(b, "/tmp/lua_XXXXXX"); \ - e = mkstemp(b); \ - if (e != -1) close(e); \ - e = (e == -1); } - -#else -#define LUA_TMPNAMBUFSIZE L_tmpnam -#define lua_tmpnam(b,e) { e = (tmpnam(b) == NULL); } -#endif - -#endif - - -/* -@@ lua_popen spawns a new process connected to the current one through -@* the file streams. -** CHANGE it if you have a way to implement it in your system. -*/ -#if defined(LUA_USE_POPEN) - -#define lua_popen(L,c,m) ((void)L, fflush(NULL), popen(c,m)) -#define lua_pclose(L,file) ((void)L, (pclose(file) != -1)) - -#elif defined(LUA_WIN) - -#define lua_popen(L,c,m) ((void)L, _popen(c,m)) -#define lua_pclose(L,file) ((void)L, (_pclose(file) != -1)) - -#else - -#define lua_popen(L,c,m) ((void)((void)c, m), \ - luaL_error(L, LUA_QL("popen") " not supported"), (FILE*)0) -#define lua_pclose(L,file) ((void)((void)L, file), 0) - -#endif - -/* -@@ LUA_DL_* define which dynamic-library system Lua should use. -** CHANGE here if Lua has problems choosing the appropriate -** dynamic-library system for your platform (either Windows' DLL, Mac's -** dyld, or Unix's dlopen). If your system is some kind of Unix, there -** is a good chance that it has dlopen, so LUA_DL_DLOPEN will work for -** it. To use dlopen you also need to adapt the src/Makefile (probably -** adding -ldl to the linker options), so Lua does not select it -** automatically. (When you change the makefile to add -ldl, you must -** also add -DLUA_USE_DLOPEN.) -** If you do not want any kind of dynamic library, undefine all these -** options. -** By default, _WIN32 gets LUA_DL_DLL and MAC OS X gets LUA_DL_DYLD. -*/ -#if 0 -#if defined(LUA_USE_DLOPEN) -#define LUA_DL_DLOPEN -#endif - -#if defined(LUA_WIN) -#define LUA_DL_DLL -#endif -#endif - -/* -@@ LUAI_EXTRASPACE allows you to add user-specific data in a lua_State -@* (the data goes just *before* the lua_State pointer). -** CHANGE (define) this if you really need that. This value must be -** a multiple of the maximum alignment required for your machine. -*/ -#define LUAI_EXTRASPACE 0 - - -/* -@@ luai_userstate* allow user-specific actions on threads. -** CHANGE them if you defined LUAI_EXTRASPACE and need to do something -** extra when a thread is created/deleted/resumed/yielded. -*/ -#define luai_userstateopen(L) ((void)L) -#define luai_userstateclose(L) ((void)L) -#define luai_userstatethread(L,L1) ((void)L) -#define luai_userstatefree(L) ((void)L) -#define luai_userstateresume(L,n) ((void)L) -#define luai_userstateyield(L,n) ((void)L) - - -/* -@@ LUA_INTFRMLEN is the length modifier for integer conversions -@* in 'string.format'. -@@ LUA_INTFRM_T is the integer type correspoding to the previous length -@* modifier. -** CHANGE them if your system supports long long or does not support long. -*/ - -#if defined(LUA_USELONGLONG) - -#define LUA_INTFRMLEN "ll" -#define LUA_INTFRM_T long long - -#else - -#define LUA_INTFRMLEN "l" -#define LUA_INTFRM_T long - -#endif - - - -/* =================================================================== */ - -/* -** Local configuration. You can use this space to add your redefinitions -** without modifying the main part of the file. -*/ - - - -#endif diff --git a/script/lua/lualib.h b/script/lua/lualib.h deleted file mode 100644 index e9ff9ba97..000000000 --- a/script/lua/lualib.h +++ /dev/null @@ -1,53 +0,0 @@ -/* -** $Id: lualib.h,v 1.36.1.1 2007/12/27 13:02:25 roberto Exp $ -** Lua standard libraries -** See Copyright Notice in lua.h -*/ - - -#ifndef lualib_h -#define lualib_h - -#include "lua.h" - - -/* Key to file-handle type */ -#define LUA_FILEHANDLE "FILE*" - - -#define LUA_COLIBNAME "coroutine" -LUALIB_API int (luaopen_base) (lua_State *L); - -#define LUA_TABLIBNAME "table" -LUALIB_API int (luaopen_table) (lua_State *L); - -#define LUA_IOLIBNAME "io" -LUALIB_API int (luaopen_io) (lua_State *L); - -#define LUA_OSLIBNAME "os" -LUALIB_API int (luaopen_os) (lua_State *L); - -#define LUA_STRLIBNAME "string" -LUALIB_API int (luaopen_string) (lua_State *L); - -#define LUA_MATHLIBNAME "math" -LUALIB_API int (luaopen_math) (lua_State *L); - -#define LUA_DBLIBNAME "debug" -LUALIB_API int (luaopen_debug) (lua_State *L); - -#define LUA_LOADLIBNAME "package" -LUALIB_API int (luaopen_package) (lua_State *L); - - -/* open all previous libraries */ -LUALIB_API void (luaL_openlibs) (lua_State *L); - - - -#ifndef lua_assert -#define lua_assert(x) ((void)0) -#endif - - -#endif diff --git a/script/lua/lundump.c b/script/lua/lundump.c deleted file mode 100644 index 637d84237..000000000 --- a/script/lua/lundump.c +++ /dev/null @@ -1,229 +0,0 @@ -/* -** $Id: lundump.c,v 2.7.1.4 2008/04/04 19:51:41 roberto Exp $ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#endif - -#define lundump_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lmem.h" -#include "lobject.h" -#include "lstring.h" -#include "lundump.h" -#include "lzio.h" - -typedef struct { - lua_State* L; - ZIO* Z; - Mbuffer* b; - const char* name; -} LoadState; - -#ifdef LUAC_TRUST_BINARIES -#define IF(c,s) -#define error(S,s) -#else -#define IF(c,s) if (c) error(S,s) - -static void error(LoadState* S, const char* why) -{ - luaO_pushfstring(S->L,"%s: %s in precompiled chunk",S->name,why); - luaD_throw(S->L,LUA_ERRSYNTAX); -} -#endif - -#define LoadMem(S,b,n,size) LoadBlock(S,b,(n)*(size)) -#define LoadByte(S) (lu_byte)LoadChar(S) -#define LoadVar(S,x) LoadMem(S,&x,1,sizeof(x)) -#define LoadVector(S,b,n,size) LoadMem(S,b,n,size) - -static void LoadBlock(LoadState* S, void* b, size_t size) -{ - size_t r=luaZ_read(S->Z,b,size); - IF (r!=0, "unexpected end"); -} - -static int LoadChar(LoadState* S) -{ - char x; - LoadVar(S,x); - return x; -} - -static int LoadInt(LoadState* S) -{ - int x; - LoadVar(S,x); - IF (x<0, "bad integer"); - return x; -} - -static lua_Number LoadNumber(LoadState* S) -{ - lua_Number x; - LoadVar(S,x); - return x; -} - -static TString* LoadString(LoadState* S) -{ - size_t size; - LoadVar(S,size); - if (size==0) - return NULL; - else - { - char* s=luaZ_openspace(S->L,S->b,size); - LoadBlock(S,s,size); - return luaS_newlstr(S->L,s,size-1); /* remove trailing '\0' */ - } -} - -static void LoadCode(LoadState* S, Proto* f) -{ - int n=LoadInt(S); - f->code=luaM_newvector(S->L,n,Instruction); - f->sizecode=n; - LoadVector(S,f->code,n,sizeof(Instruction)); -} - -static Proto* LoadFunction(LoadState* S, TString* p); - -static void LoadConstants(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->k=luaM_newvector(S->L,n,TValue); - f->sizek=n; - for (i=0; ik[i]); - for (i=0; ik[i]; - int t=LoadChar(S); - switch (t) - { - case LUA_TNIL: - setnilvalue(o); - break; - case LUA_TBOOLEAN: - setbvalue(o,LoadChar(S)!=0); - break; - case LUA_TNUMBER: - setnvalue(o,LoadNumber(S)); - break; - case LUA_TSTRING: - setsvalue2n(S->L,o,LoadString(S)); - break; - default: - error(S,"bad constant"); - break; - } - } - n=LoadInt(S); - f->p=luaM_newvector(S->L,n,Proto*); - f->sizep=n; - for (i=0; ip[i]=NULL; - for (i=0; ip[i]=LoadFunction(S,f->source); -} - -static void LoadDebug(LoadState* S, Proto* f) -{ - int i,n; - n=LoadInt(S); - f->lineinfo=luaM_newvector(S->L,n,int); - f->sizelineinfo=n; - LoadVector(S,f->lineinfo,n,sizeof(int)); - n=LoadInt(S); - f->locvars=luaM_newvector(S->L,n,LocVar); - f->sizelocvars=n; - for (i=0; ilocvars[i].varname=NULL; - for (i=0; ilocvars[i].varname=LoadString(S); - f->locvars[i].startpc=LoadInt(S); - f->locvars[i].endpc=LoadInt(S); - } - n=LoadInt(S); - f->upvalues=luaM_newvector(S->L,n,TString*); - f->sizeupvalues=n; - for (i=0; iupvalues[i]=NULL; - for (i=0; iupvalues[i]=LoadString(S); -} - -static Proto* LoadFunction(LoadState* S, TString* p) -{ - Proto* f; - if (++S->L->nCcalls > LUAI_MAXCCALLS) error(S,"code too deep"); - f=luaF_newproto(S->L); - setptvalue2s(S->L,S->L->top,f); incr_top(S->L); - f->source=LoadString(S); if (f->source==NULL) f->source=p; - f->linedefined=LoadInt(S); - f->lastlinedefined=LoadInt(S); - f->nups=LoadByte(S); - f->numparams=LoadByte(S); - f->is_vararg=LoadByte(S); - f->maxstacksize=LoadByte(S); - LoadCode(S,f); - LoadConstants(S,f); - LoadDebug(S,f); - IF (!luaG_checkcode(f), "bad code"); - S->L->top--; - S->L->nCcalls--; - return f; -} - -static void LoadHeader(LoadState* S) -{ - char h[LUAC_HEADERSIZE]; - char s[LUAC_HEADERSIZE]; - luaU_header(h); - LoadBlock(S,s,LUAC_HEADERSIZE); - IF (memcmp(h,s,LUAC_HEADERSIZE)!=0, "bad header"); -} - -/* -** load precompiled chunk -*/ -Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name) -{ - LoadState S; - if (*name=='@' || *name=='=') - S.name=name+1; - else if (*name==LUA_SIGNATURE[0]) - S.name="binary string"; - else - S.name=name; - S.L=L; - S.Z=Z; - S.b=buff; - LoadHeader(&S); - return LoadFunction(&S,luaS_newliteral(L,"=?")); -} - -/* -* make header -*/ -void luaU_header (char* h) -{ - int x=1; - memcpy(h,LUA_SIGNATURE,sizeof(LUA_SIGNATURE)-1); - h+=sizeof(LUA_SIGNATURE)-1; - *h++=(char)LUAC_VERSION; - *h++=(char)LUAC_FORMAT; - *h++=(char)*(char*)&x; /* endianness */ - *h++=(char)sizeof(int); - *h++=(char)sizeof(size_t); - *h++=(char)sizeof(Instruction); - *h++=(char)sizeof(lua_Number); - *h++=(char)(((lua_Number)0.5)==0); /* is lua_Number integral? */ -} diff --git a/script/lua/lundump.h b/script/lua/lundump.h deleted file mode 100644 index c80189dbf..000000000 --- a/script/lua/lundump.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -** $Id: lundump.h,v 1.37.1.1 2007/12/27 13:02:25 roberto Exp $ -** load precompiled Lua chunks -** See Copyright Notice in lua.h -*/ - -#ifndef lundump_h -#define lundump_h - -#include "lobject.h" -#include "lzio.h" - -/* load one chunk; from lundump.c */ -LUAI_FUNC Proto* luaU_undump (lua_State* L, ZIO* Z, Mbuffer* buff, const char* name); - -/* make header; from lundump.c */ -LUAI_FUNC void luaU_header (char* h); - -/* dump one chunk; from ldump.c */ -LUAI_FUNC int luaU_dump (lua_State* L, const Proto* f, lua_Writer w, void* data, int strip); - -#ifdef luac_c -/* print one chunk; from print.c */ -LUAI_FUNC void luaU_print (const Proto* f, int full); -#endif - -/* for header of binary files -- this is Lua 5.1 */ -#define LUAC_VERSION 0x51 - -/* for header of binary files -- this is the official format */ -#define LUAC_FORMAT 0 - -/* size of header of binary files */ -#define LUAC_HEADERSIZE 12 - -#endif diff --git a/script/lua/lvm.c b/script/lua/lvm.c deleted file mode 100644 index 0ff1fa048..000000000 --- a/script/lua/lvm.c +++ /dev/null @@ -1,764 +0,0 @@ -/* -** $Id: lvm.c,v 2.63.1.3 2007/12/28 15:32:23 roberto Exp $ -** Lua virtual machine -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#include -#include -#endif - -#define lvm_c -#define LUA_CORE - -#include "lua.h" - -#include "ldebug.h" -#include "ldo.h" -#include "lfunc.h" -#include "lgc.h" -#include "lobject.h" -#include "lopcodes.h" -#include "lstate.h" -#include "lstring.h" -#include "ltable.h" -#include "ltm.h" -#include "lvm.h" - - - -/* limit for table tag-method chains (to avoid loops) */ -#define MAXTAGLOOP 100 - - -const TValue *luaV_tonumber (const TValue *obj, TValue *n) { - lua_Number num; - if (ttisnumber(obj)) return obj; - if (ttisstring(obj) && luaO_str2d(svalue(obj), &num)) { - setnvalue(n, num); - return n; - } - else - return NULL; -} - - -int luaV_tostring (lua_State *L, StkId obj) { - if (!ttisnumber(obj)) - return 0; - else { - char s[LUAI_MAXNUMBER2STR]; - lua_Number n = nvalue(obj); - lua_number2str(s, n); - setsvalue2s(L, obj, luaS_new(L, s)); - return 1; - } -} - - -static void traceexec (lua_State *L, const Instruction *pc) { - lu_byte mask = L->hookmask; - const Instruction *oldpc = L->savedpc; - L->savedpc = pc; - if ((mask & LUA_MASKCOUNT) && L->hookcount == 0) { - resethookcount(L); - luaD_callhook(L, LUA_HOOKCOUNT, -1); - } - if (mask & LUA_MASKLINE) { - Proto *p = ci_func(L->ci)->l.p; - int npc = pcRel(pc, p); - int newline = getline(p, npc); - /* call linehook when enter a new function, when jump back (loop), - or when enter a new line */ - if (npc == 0 || pc <= oldpc || newline != getline(p, pcRel(oldpc, p))) - luaD_callhook(L, LUA_HOOKLINE, newline); - } -} - - -static void callTMres (lua_State *L, StkId res, const TValue *f, - const TValue *p1, const TValue *p2) { - ptrdiff_t result = savestack(L, res); - setobj2s(L, L->top, f); /* push function */ - setobj2s(L, L->top+1, p1); /* 1st argument */ - setobj2s(L, L->top+2, p2); /* 2nd argument */ - luaD_checkstack(L, 3); - L->top += 3; - luaD_call(L, L->top - 3, 1); - res = restorestack(L, result); - L->top--; - setobjs2s(L, res, L->top); -} - - - -static void callTM (lua_State *L, const TValue *f, const TValue *p1, - const TValue *p2, const TValue *p3) { - setobj2s(L, L->top, f); /* push function */ - setobj2s(L, L->top+1, p1); /* 1st argument */ - setobj2s(L, L->top+2, p2); /* 2nd argument */ - setobj2s(L, L->top+3, p3); /* 3th argument */ - luaD_checkstack(L, 4); - L->top += 4; - luaD_call(L, L->top - 4, 0); -} - - -void luaV_gettable (lua_State *L, const TValue *t, TValue *key, StkId val) { - int loop; - for (loop = 0; loop < MAXTAGLOOP; loop++) { - const TValue *tm; - if (ttistable(t)) { /* `t' is a table? */ - Table *h = hvalue(t); - const TValue *res = luaH_get(h, key); /* do a primitive get */ - if (!ttisnil(res) || /* result is no nil? */ - (tm = fasttm(L, h->metatable, TM_INDEX)) == NULL) { /* or no TM? */ - setobj2s(L, val, res); - return; - } - /* else will try the tag method */ - } - else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_INDEX))) - luaG_typeerror(L, t, "index"); - if (ttisfunction(tm)) { - callTMres(L, val, tm, t, key); - return; - } - t = tm; /* else repeat with `tm' */ - } - luaG_runerror(L, "loop in gettable"); -} - - -void luaV_settable (lua_State *L, const TValue *t, TValue *key, StkId val) { - int loop; - for (loop = 0; loop < MAXTAGLOOP; loop++) { - const TValue *tm; - if (ttistable(t)) { /* `t' is a table? */ - Table *h = hvalue(t); - TValue *oldval = luaH_set(L, h, key); /* do a primitive set */ - if (!ttisnil(oldval) || /* result is no nil? */ - (tm = fasttm(L, h->metatable, TM_NEWINDEX)) == NULL) { /* or no TM? */ - setobj2t(L, oldval, val); - luaC_barriert(L, h, val); - return; - } - /* else will try the tag method */ - } - else if (ttisnil(tm = luaT_gettmbyobj(L, t, TM_NEWINDEX))) - luaG_typeerror(L, t, "index"); - if (ttisfunction(tm)) { - callTM(L, tm, t, key, val); - return; - } - t = tm; /* else repeat with `tm' */ - } - luaG_runerror(L, "loop in settable"); -} - - -static int call_binTM (lua_State *L, const TValue *p1, const TValue *p2, - StkId res, TMS event) { - const TValue *tm = luaT_gettmbyobj(L, p1, event); /* try first operand */ - if (ttisnil(tm)) - tm = luaT_gettmbyobj(L, p2, event); /* try second operand */ - if (ttisnil(tm)) return 0; - callTMres(L, res, tm, p1, p2); - return 1; -} - - -static const TValue *get_compTM (lua_State *L, Table *mt1, Table *mt2, - TMS event) { - const TValue *tm1 = fasttm(L, mt1, event); - const TValue *tm2; - if (tm1 == NULL) return NULL; /* no metamethod */ - if (mt1 == mt2) return tm1; /* same metatables => same metamethods */ - tm2 = fasttm(L, mt2, event); - if (tm2 == NULL) return NULL; /* no metamethod */ - if (luaO_rawequalObj(tm1, tm2)) /* same metamethods? */ - return tm1; - return NULL; -} - - -static int call_orderTM (lua_State *L, const TValue *p1, const TValue *p2, - TMS event) { - const TValue *tm1 = luaT_gettmbyobj(L, p1, event); - const TValue *tm2; - if (ttisnil(tm1)) return -1; /* no metamethod? */ - tm2 = luaT_gettmbyobj(L, p2, event); - if (!luaO_rawequalObj(tm1, tm2)) /* different metamethods? */ - return -1; - callTMres(L, L->top, tm1, p1, p2); - return !l_isfalse(L->top); -} - - -static int l_strcmp (const TString *ls, const TString *rs) { - const char *l = getstr(ls); - size_t ll = ls->tsv.len; - const char *r = getstr(rs); - size_t lr = rs->tsv.len; - for (;;) { - int temp = strcoll(l, r); - if (temp != 0) return temp; - else { /* strings are equal up to a `\0' */ - size_t len = strlen(l); /* index of first `\0' in both strings */ - if (len == lr) /* r is finished? */ - return (len == ll) ? 0 : 1; - else if (len == ll) /* l is finished? */ - return -1; /* l is smaller than r (because r is not finished) */ - /* both strings longer than `len'; go on comparing (after the `\0') */ - len++; - l += len; ll -= len; r += len; lr -= len; - } - } -} - - -int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r) { - int res; - if (ttype(l) != ttype(r)) - return luaG_ordererror(L, l, r); - else if (ttisnumber(l)) - return luai_numlt(nvalue(l), nvalue(r)); - else if (ttisstring(l)) - return l_strcmp(rawtsvalue(l), rawtsvalue(r)) < 0; - else if ((res = call_orderTM(L, l, r, TM_LT)) != -1) - return res; - return luaG_ordererror(L, l, r); -} - - -static int lessequal (lua_State *L, const TValue *l, const TValue *r) { - int res; - if (ttype(l) != ttype(r)) - return luaG_ordererror(L, l, r); - else if (ttisnumber(l)) - return luai_numle(nvalue(l), nvalue(r)); - else if (ttisstring(l)) - return l_strcmp(rawtsvalue(l), rawtsvalue(r)) <= 0; - else if ((res = call_orderTM(L, l, r, TM_LE)) != -1) /* first try `le' */ - return res; - else if ((res = call_orderTM(L, r, l, TM_LT)) != -1) /* else try `lt' */ - return !res; - return luaG_ordererror(L, l, r); -} - - -int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2) { - const TValue *tm; - lua_assert(ttype(t1) == ttype(t2)); - switch (ttype(t1)) { - case LUA_TNIL: return 1; - case LUA_TNUMBER: return luai_numeq(nvalue(t1), nvalue(t2)); - case LUA_TBOOLEAN: return bvalue(t1) == bvalue(t2); /* true must be 1 !! */ - case LUA_TLIGHTUSERDATA: return pvalue(t1) == pvalue(t2); - case LUA_TUSERDATA: { - if (uvalue(t1) == uvalue(t2)) return 1; - tm = get_compTM(L, uvalue(t1)->metatable, uvalue(t2)->metatable, - TM_EQ); - break; /* will try TM */ - } - case LUA_TTABLE: { - if (hvalue(t1) == hvalue(t2)) return 1; - tm = get_compTM(L, hvalue(t1)->metatable, hvalue(t2)->metatable, TM_EQ); - break; /* will try TM */ - } - default: return gcvalue(t1) == gcvalue(t2); - } - if (tm == NULL) return 0; /* no TM? */ - callTMres(L, L->top, tm, t1, t2); /* call TM */ - return !l_isfalse(L->top); -} - - -void luaV_concat (lua_State *L, int total, int last) { - do { - StkId top = L->base + last + 1; - int n = 2; /* number of elements handled in this pass (at least 2) */ - if (!(ttisstring(top-2) || ttisnumber(top-2)) || !tostring(L, top-1)) { - if (!call_binTM(L, top-2, top-1, top-2, TM_CONCAT)) - luaG_concaterror(L, top-2, top-1); - } else if (tsvalue(top-1)->len == 0) /* second op is empty? */ - (void)tostring(L, top - 2); /* result is first op (as string) */ - else { - /* at least two string values; get as many as possible */ - size_t tl = tsvalue(top-1)->len; - char *buffer; - int i; - /* collect total length */ - for (n = 1; n < total && tostring(L, top-n-1); n++) { - size_t l = tsvalue(top-n-1)->len; - if (l >= MAX_SIZET - tl) luaG_runerror(L, "string length overflow"); - tl += l; - } - buffer = luaZ_openspace(L, &G(L)->buff, tl); - tl = 0; - for (i=n; i>0; i--) { /* concat all strings */ - size_t l = tsvalue(top-i)->len; - memcpy(buffer+tl, svalue(top-i), l); - tl += l; - } - setsvalue2s(L, top-n, luaS_newlstr(L, buffer, tl)); - } - total -= n-1; /* got `n' strings to create 1 new */ - last -= n-1; - } while (total > 1); /* repeat until only 1 result left */ -} - - -static void Arith (lua_State *L, StkId ra, const TValue *rb, - const TValue *rc, TMS op) { - TValue tempb, tempc; - const TValue *b, *c; - if ((b = luaV_tonumber(rb, &tempb)) != NULL && - (c = luaV_tonumber(rc, &tempc)) != NULL) { - lua_Number nb = nvalue(b), nc = nvalue(c); - switch (op) { - case TM_ADD: setnvalue(ra, luai_numadd(nb, nc)); break; - case TM_SUB: setnvalue(ra, luai_numsub(nb, nc)); break; - case TM_MUL: setnvalue(ra, luai_nummul(nb, nc)); break; - case TM_DIV: setnvalue(ra, luai_numdiv(nb, nc)); break; - case TM_MOD: setnvalue(ra, luai_nummod(nb, nc)); break; - case TM_POW: setnvalue(ra, luai_numpow(nb, nc)); break; - case TM_UNM: setnvalue(ra, luai_numunm(nb)); break; - default: lua_assert(0); break; - } - } - else if (!call_binTM(L, rb, rc, ra, op)) - luaG_aritherror(L, rb, rc); -} - - - -/* -** some macros for common tasks in `luaV_execute' -*/ - -#define runtime_check(L, c) { if (!(c)) break; } - -#define RA(i) (base+GETARG_A(i)) -/* to be used after possible stack reallocation */ -#define RB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgR, base+GETARG_B(i)) -#define RC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgR, base+GETARG_C(i)) -#define RKB(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, \ - ISK(GETARG_B(i)) ? k+INDEXK(GETARG_B(i)) : base+GETARG_B(i)) -#define RKC(i) check_exp(getCMode(GET_OPCODE(i)) == OpArgK, \ - ISK(GETARG_C(i)) ? k+INDEXK(GETARG_C(i)) : base+GETARG_C(i)) -#define KBx(i) check_exp(getBMode(GET_OPCODE(i)) == OpArgK, k+GETARG_Bx(i)) - - -#define dojump(L,pc,i) {(pc) += (i); luai_threadyield(L);} - - -#define Protect(x) { L->savedpc = pc; {x;}; base = L->base; } - - -#define arith_op(op,tm) { \ - TValue *rb = RKB(i); \ - TValue *rc = RKC(i); \ - if (ttisnumber(rb) && ttisnumber(rc)) { \ - lua_Number nb = nvalue(rb), nc = nvalue(rc); \ - setnvalue(ra, op(nb, nc)); \ - } \ - else \ - Protect(Arith(L, ra, rb, rc, tm)); \ - } - - - -void luaV_execute (lua_State *L, int nexeccalls) { - LClosure *cl; - StkId base; - TValue *k; - const Instruction *pc; - reentry: /* entry point */ - lua_assert(isLua(L->ci)); - pc = L->savedpc; - cl = &clvalue(L->ci->func)->l; - base = L->base; - k = cl->p->k; - /* main loop of interpreter */ - for (;;) { - const Instruction i = *pc++; - StkId ra; - if ((L->hookmask & (LUA_MASKLINE | LUA_MASKCOUNT)) && - (--L->hookcount == 0 || L->hookmask & LUA_MASKLINE)) { - traceexec(L, pc); - if (L->status == LUA_YIELD) { /* did hook yield? */ - L->savedpc = pc - 1; - return; - } - base = L->base; - } - /* warning!! several calls may realloc the stack and invalidate `ra' */ - ra = RA(i); - lua_assert(base == L->base && L->base == L->ci->base); - lua_assert(base <= L->top && L->top <= L->stack + L->stacksize); - lua_assert(L->top == L->ci->top || luaG_checkopenop(i)); - switch (GET_OPCODE(i)) { - case OP_MOVE: { - setobjs2s(L, ra, RB(i)); - continue; - } - case OP_LOADK: { - setobj2s(L, ra, KBx(i)); - continue; - } - case OP_LOADBOOL: { - setbvalue(ra, GETARG_B(i)); - if (GETARG_C(i)) pc++; /* skip next instruction (if C) */ - continue; - } - case OP_LOADNIL: { - TValue *rb = RB(i); - do { - setnilvalue(rb--); - } while (rb >= ra); - continue; - } - case OP_GETUPVAL: { - int b = GETARG_B(i); - setobj2s(L, ra, cl->upvals[b]->v); - continue; - } - case OP_GETGLOBAL: { - TValue g; - TValue *rb = KBx(i); - sethvalue(L, &g, cl->env); - lua_assert(ttisstring(rb)); - Protect(luaV_gettable(L, &g, rb, ra)); - continue; - } - case OP_GETTABLE: { - Protect(luaV_gettable(L, RB(i), RKC(i), ra)); - continue; - } - case OP_SETGLOBAL: { - TValue g; - sethvalue(L, &g, cl->env); - lua_assert(ttisstring(KBx(i))); - Protect(luaV_settable(L, &g, KBx(i), ra)); - continue; - } - case OP_SETUPVAL: { - UpVal *uv = cl->upvals[GETARG_B(i)]; - setobj(L, uv->v, ra); - luaC_barrier(L, uv, ra); - continue; - } - case OP_SETTABLE: { - Protect(luaV_settable(L, ra, RKB(i), RKC(i))); - continue; - } - case OP_NEWTABLE: { - int b = GETARG_B(i); - int c = GETARG_C(i); - sethvalue(L, ra, luaH_new(L, luaO_fb2int(b), luaO_fb2int(c))); - Protect(luaC_checkGC(L)); - continue; - } - case OP_SELF: { - StkId rb = RB(i); - setobjs2s(L, ra+1, rb); - Protect(luaV_gettable(L, rb, RKC(i), ra)); - continue; - } - case OP_ADD: { - arith_op(luai_numadd, TM_ADD); - continue; - } - case OP_SUB: { - arith_op(luai_numsub, TM_SUB); - continue; - } - case OP_MUL: { - arith_op(luai_nummul, TM_MUL); - continue; - } - case OP_DIV: { - arith_op(luai_numdiv, TM_DIV); - continue; - } - case OP_MOD: { - arith_op(luai_nummod, TM_MOD); - continue; - } - case OP_POW: { - arith_op(luai_numpow, TM_POW); - continue; - } - case OP_UNM: { - TValue *rb = RB(i); - if (ttisnumber(rb)) { - lua_Number nb = nvalue(rb); - setnvalue(ra, luai_numunm(nb)); - } - else { - Protect(Arith(L, ra, rb, rb, TM_UNM)); - } - continue; - } - case OP_NOT: { - int res = l_isfalse(RB(i)); /* next assignment may change this value */ - setbvalue(ra, res); - continue; - } - case OP_LEN: { - const TValue *rb = RB(i); - switch (ttype(rb)) { - case LUA_TTABLE: { - setnvalue(ra, cast_num(luaH_getn(hvalue(rb)))); - break; - } - case LUA_TSTRING: { - setnvalue(ra, cast_num(tsvalue(rb)->len)); - break; - } - default: { /* try metamethod */ - Protect( - if (!call_binTM(L, rb, luaO_nilobject, ra, TM_LEN)) - luaG_typeerror(L, rb, "get length of"); - ) - } - } - continue; - } - case OP_CONCAT: { - int b = GETARG_B(i); - int c = GETARG_C(i); - Protect(luaV_concat(L, c-b+1, c); luaC_checkGC(L)); - setobjs2s(L, RA(i), base+b); - continue; - } - case OP_JMP: { - dojump(L, pc, GETARG_sBx(i)); - continue; - } - case OP_EQ: { - TValue *rb = RKB(i); - TValue *rc = RKC(i); - Protect( - if (equalobj(L, rb, rc) == GETARG_A(i)) - dojump(L, pc, GETARG_sBx(*pc)); - ) - pc++; - continue; - } - case OP_LT: { - Protect( - if (luaV_lessthan(L, RKB(i), RKC(i)) == GETARG_A(i)) - dojump(L, pc, GETARG_sBx(*pc)); - ) - pc++; - continue; - } - case OP_LE: { - Protect( - if (lessequal(L, RKB(i), RKC(i)) == GETARG_A(i)) - dojump(L, pc, GETARG_sBx(*pc)); - ) - pc++; - continue; - } - case OP_TEST: { - if (l_isfalse(ra) != GETARG_C(i)) - dojump(L, pc, GETARG_sBx(*pc)); - pc++; - continue; - } - case OP_TESTSET: { - TValue *rb = RB(i); - if (l_isfalse(rb) != GETARG_C(i)) { - setobjs2s(L, ra, rb); - dojump(L, pc, GETARG_sBx(*pc)); - } - pc++; - continue; - } - case OP_CALL: { - int b = GETARG_B(i); - int nresults = GETARG_C(i) - 1; - if (b != 0) L->top = ra+b; /* else previous instruction set top */ - L->savedpc = pc; - switch (luaD_precall(L, ra, nresults)) { - case PCRLUA: { - nexeccalls++; - goto reentry; /* restart luaV_execute over new Lua function */ - } - case PCRC: { - /* it was a C function (`precall' called it); adjust results */ - if (nresults >= 0) L->top = L->ci->top; - base = L->base; - continue; - } - default: { - return; /* yield */ - } - } - } - case OP_TAILCALL: { - int b = GETARG_B(i); - if (b != 0) L->top = ra+b; /* else previous instruction set top */ - L->savedpc = pc; - lua_assert(GETARG_C(i) - 1 == LUA_MULTRET); - switch (luaD_precall(L, ra, LUA_MULTRET)) { - case PCRLUA: { - /* tail call: put new frame in place of previous one */ - CallInfo *ci = L->ci - 1; /* previous frame */ - int aux; - StkId func = ci->func; - StkId pfunc = (ci+1)->func; /* previous function index */ - if (L->openupval) luaF_close(L, ci->base); - L->base = ci->base = ci->func + ((ci+1)->base - pfunc); - for (aux = 0; pfunc+aux < L->top; aux++) /* move frame down */ - setobjs2s(L, func+aux, pfunc+aux); - ci->top = L->top = func+aux; /* correct top */ - lua_assert(L->top == L->base + clvalue(func)->l.p->maxstacksize); - ci->savedpc = L->savedpc; - ci->tailcalls++; /* one more call lost */ - L->ci--; /* remove new frame */ - goto reentry; - } - case PCRC: { /* it was a C function (`precall' called it) */ - base = L->base; - continue; - } - default: { - return; /* yield */ - } - } - } - case OP_RETURN: { - int b = GETARG_B(i); - if (b != 0) L->top = ra+b-1; - if (L->openupval) luaF_close(L, base); - L->savedpc = pc; - b = luaD_poscall(L, ra); - if (--nexeccalls == 0) /* was previous function running `here'? */ - return; /* no: return */ - else { /* yes: continue its execution */ - if (b) L->top = L->ci->top; - lua_assert(isLua(L->ci)); - lua_assert(GET_OPCODE(*((L->ci)->savedpc - 1)) == OP_CALL); - goto reentry; - } - } - case OP_FORLOOP: { - lua_Number step = nvalue(ra+2); - lua_Number idx = luai_numadd(nvalue(ra), step); /* increment index */ - lua_Number limit = nvalue(ra+1); - if (luai_numlt(0, step) ? luai_numle(idx, limit) - : luai_numle(limit, idx)) { - dojump(L, pc, GETARG_sBx(i)); /* jump back */ - setnvalue(ra, idx); /* update internal index... */ - setnvalue(ra+3, idx); /* ...and external index */ - } - continue; - } - case OP_FORPREP: { - const TValue *init = ra; - const TValue *plimit = ra+1; - const TValue *pstep = ra+2; - L->savedpc = pc; /* next steps may throw errors */ - if (!tonumber(init, ra)) - luaG_runerror(L, LUA_QL("for") " initial value must be a number"); - else if (!tonumber(plimit, ra+1)) - luaG_runerror(L, LUA_QL("for") " limit must be a number"); - else if (!tonumber(pstep, ra+2)) - luaG_runerror(L, LUA_QL("for") " step must be a number"); - setnvalue(ra, luai_numsub(nvalue(ra), nvalue(pstep))); - dojump(L, pc, GETARG_sBx(i)); - continue; - } - case OP_TFORLOOP: { - StkId cb = ra + 3; /* call base */ - setobjs2s(L, cb+2, ra+2); - setobjs2s(L, cb+1, ra+1); - setobjs2s(L, cb, ra); - L->top = cb+3; /* func. + 2 args (state and index) */ - Protect(luaD_call(L, cb, GETARG_C(i))); - L->top = L->ci->top; - cb = RA(i) + 3; /* previous call may change the stack */ - if (!ttisnil(cb)) { /* continue loop? */ - setobjs2s(L, cb-1, cb); /* save control variable */ - dojump(L, pc, GETARG_sBx(*pc)); /* jump back */ - } - pc++; - continue; - } - case OP_SETLIST: { - int n = GETARG_B(i); - int c = GETARG_C(i); - int last; - Table *h; - if (n == 0) { - n = cast_int(L->top - ra) - 1; - L->top = L->ci->top; - } - if (c == 0) c = cast_int(*pc++); - runtime_check(L, ttistable(ra)); - h = hvalue(ra); - last = ((c-1)*LFIELDS_PER_FLUSH) + n; - if (last > h->sizearray) /* needs more space? */ - luaH_resizearray(L, h, last); /* pre-alloc it at once */ - for (; n > 0; n--) { - TValue *val = ra+n; - setobj2t(L, luaH_setnum(L, h, last--), val); - luaC_barriert(L, h, val); - } - continue; - } - case OP_CLOSE: { - luaF_close(L, ra); - continue; - } - case OP_CLOSURE: { - Proto *p; - Closure *ncl; - int nup, j; - p = cl->p->p[GETARG_Bx(i)]; - nup = p->nups; - ncl = luaF_newLclosure(L, nup, cl->env); - ncl->l.p = p; - for (j=0; jl.upvals[j] = cl->upvals[GETARG_B(*pc)]; - else { - lua_assert(GET_OPCODE(*pc) == OP_MOVE); - ncl->l.upvals[j] = luaF_findupval(L, base + GETARG_B(*pc)); - } - } - setclvalue(L, ra, ncl); - Protect(luaC_checkGC(L)); - continue; - } - case OP_VARARG: { - int b = GETARG_B(i) - 1; - int j; - CallInfo *ci = L->ci; - int n = cast_int(ci->base - ci->func) - cl->p->numparams - 1; - if (b == LUA_MULTRET) { - Protect(luaD_checkstack(L, n)); - ra = RA(i); /* previous call may change the stack */ - b = n; - L->top = ra + n; - } - for (j = 0; j < b; j++) { - if (j < n) { - setobjs2s(L, ra + j, ci->base - n + j); - } - else { - setnilvalue(ra + j); - } - } - continue; - } - } - } -} - diff --git a/script/lua/lvm.h b/script/lua/lvm.h deleted file mode 100644 index bfe4f5678..000000000 --- a/script/lua/lvm.h +++ /dev/null @@ -1,36 +0,0 @@ -/* -** $Id: lvm.h,v 2.5.1.1 2007/12/27 13:02:25 roberto Exp $ -** Lua virtual machine -** See Copyright Notice in lua.h -*/ - -#ifndef lvm_h -#define lvm_h - - -#include "ldo.h" -#include "lobject.h" -#include "ltm.h" - - -#define tostring(L,o) ((ttype(o) == LUA_TSTRING) || (luaV_tostring(L, o))) - -#define tonumber(o,n) (ttype(o) == LUA_TNUMBER || \ - (((o) = luaV_tonumber(o,n)) != NULL)) - -#define equalobj(L,o1,o2) \ - (ttype(o1) == ttype(o2) && luaV_equalval(L, o1, o2)) - - -LUAI_FUNC int luaV_lessthan (lua_State *L, const TValue *l, const TValue *r); -LUAI_FUNC int luaV_equalval (lua_State *L, const TValue *t1, const TValue *t2); -LUAI_FUNC const TValue *luaV_tonumber (const TValue *obj, TValue *n); -LUAI_FUNC int luaV_tostring (lua_State *L, StkId obj); -LUAI_FUNC void luaV_gettable (lua_State *L, const TValue *t, TValue *key, - StkId val); -LUAI_FUNC void luaV_settable (lua_State *L, const TValue *t, TValue *key, - StkId val); -LUAI_FUNC void luaV_execute (lua_State *L, int nexeccalls); -LUAI_FUNC void luaV_concat (lua_State *L, int total, int last); - -#endif diff --git a/script/lua/lzio.c b/script/lua/lzio.c deleted file mode 100644 index 3ccba193c..000000000 --- a/script/lua/lzio.c +++ /dev/null @@ -1,83 +0,0 @@ -/* -** $Id: lzio.c,v 1.31.1.1 2007/12/27 13:02:25 roberto Exp $ -** a generic input stream interface -** See Copyright Notice in lua.h -*/ - -#if 0 -#include -#endif - -#define lzio_c -#define LUA_CORE - -#include "lua.h" - -#include "llimits.h" -#include "lmem.h" -#include "lstate.h" -#include "lzio.h" - - -int luaZ_fill (ZIO *z) { - size_t size; - lua_State *L = z->L; - const char *buff; - lua_unlock(L); - buff = z->reader(L, z->data, &size); - lua_lock(L); - if (buff == NULL || size == 0) return EOZ; - z->n = size - 1; - z->p = buff; - return char2int(*(z->p++)); -} - - -int luaZ_lookahead (ZIO *z) { - if (z->n == 0) { - if (luaZ_fill(z) == EOZ) - return EOZ; - else { - z->n++; /* luaZ_fill removed first byte; put back it */ - z->p--; - } - } - return char2int(*z->p); -} - - -void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, void *data) { - z->L = L; - z->reader = reader; - z->data = data; - z->n = 0; - z->p = NULL; -} - - -/* --------------------------------------------------------------- read --- */ -size_t luaZ_read (ZIO *z, void *b, size_t n) { - while (n) { - size_t m; - if (luaZ_lookahead(z) == EOZ) - return n; /* return number of missing bytes */ - m = (n <= z->n) ? n : z->n; /* min. between n and z->n */ - memcpy(b, z->p, m); - z->n -= m; - z->p += m; - b = (char *)b + m; - n -= m; - } - return 0; -} - -/* ------------------------------------------------------------------------ */ -char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n) { - if (n > buff->buffsize) { - if (n < LUA_MINBUFFER) n = LUA_MINBUFFER; - luaZ_resizebuffer(L, buff, n); - } - return buff->buffer; -} - - diff --git a/script/lua/lzio.h b/script/lua/lzio.h deleted file mode 100644 index 51d695d8c..000000000 --- a/script/lua/lzio.h +++ /dev/null @@ -1,67 +0,0 @@ -/* -** $Id: lzio.h,v 1.21.1.1 2007/12/27 13:02:25 roberto Exp $ -** Buffered streams -** See Copyright Notice in lua.h -*/ - - -#ifndef lzio_h -#define lzio_h - -#include "lua.h" - -#include "lmem.h" - - -#define EOZ (-1) /* end of stream */ - -typedef struct Zio ZIO; - -#define char2int(c) cast(int, cast(unsigned char, (c))) - -#define zgetc(z) (((z)->n--)>0 ? char2int(*(z)->p++) : luaZ_fill(z)) - -typedef struct Mbuffer { - char *buffer; - size_t n; - size_t buffsize; -} Mbuffer; - -#define luaZ_initbuffer(L, buff) ((buff)->buffer = NULL, (buff)->buffsize = 0) - -#define luaZ_buffer(buff) ((buff)->buffer) -#define luaZ_sizebuffer(buff) ((buff)->buffsize) -#define luaZ_bufflen(buff) ((buff)->n) - -#define luaZ_resetbuffer(buff) ((buff)->n = 0) - - -#define luaZ_resizebuffer(L, buff, size) \ - (luaM_reallocvector(L, (buff)->buffer, (buff)->buffsize, size, char), \ - (buff)->buffsize = size) - -#define luaZ_freebuffer(L, buff) luaZ_resizebuffer(L, buff, 0) - - -LUAI_FUNC char *luaZ_openspace (lua_State *L, Mbuffer *buff, size_t n); -LUAI_FUNC void luaZ_init (lua_State *L, ZIO *z, lua_Reader reader, - void *data); -LUAI_FUNC size_t luaZ_read (ZIO* z, void* b, size_t n); /* read next n bytes */ -LUAI_FUNC int luaZ_lookahead (ZIO *z); - - - -/* --------- Private Part ------------------ */ - -struct Zio { - size_t n; /* bytes still unread */ - const char *p; /* current position in buffer */ - lua_Reader reader; - void* data; /* additional data */ - lua_State *L; /* Lua state (for reader) */ -}; - - -LUAI_FUNC int luaZ_fill (ZIO *z); - -#endif diff --git a/util/osdetect.lua b/util/osdetect.lua deleted file mode 100644 index 38a90993d..000000000 --- a/util/osdetect.lua +++ /dev/null @@ -1,111 +0,0 @@ -#!lua --- --- Copyright (C) 2009 Free Software Foundation, Inc. --- --- GRUB is free software: you can redistribute it and/or modify --- it under the terms of the GNU General Public License as published by --- the Free Software Foundation, either version 3 of the License, or --- (at your option) any later version. --- --- GRUB is distributed in the hope that it will be useful, --- but WITHOUT ANY WARRANTY; without even the implied warranty of --- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the --- GNU General Public License for more details. --- --- You should have received a copy of the GNU General Public License --- along with GRUB. If not, see . --- - -function enum_device (device, fs, uuid) - local root - local title - local source - local kernels = {} - local kernel_num = 0 - - local function enum_file (name) - local version - - version = string.match (name, "vmlinuz%-(.*)") - if (version ~= nil) then - table.insert (kernels, version) - kernel_num = kernel_num + 1 - end - end - - local function sort_kernel (first, second) - local a1, a2, a3, a4, b1, b2, b3, b4 - - a1, a2, a3, a4 = string.match (first, "(%d+)%.?(%d*).?(%d*)%-?(%d*)") - b1, b2, b3, b4 = string.match (second, "(%d+)%.?(%d*).?(%d*)%-?(%d*)") - return (a1 > b1) or (a2 > b2) or (a3 > b3) or (a4 < b4); - end - - root = "(" .. device .. ")/" - source = "root (" .. device .. ")\nchainloader +1" - title = nil - if (grub.file_exist (root .. "bootmgr") and - grub.file_exist (root .. "boot/bcd")) then - title = "Windows Vista bootmgr" - elseif (grub.file_exist (root .. "ntldr") and - grub.file_exist (root .. "ntdetect.com") and - grub.file_exist (root .. "boot.ini")) then - title = "Windows NT/2000/XP loader" - elseif (grub.file_exist (root .. "windows/win.com")) then - title = "Windows 98/ME" - elseif (grub.file_exist (root .. "io.sys") and - grub.file_exist (root .. "command.com")) then - title = "MS-DOS" - elseif (grub.file_exist (root .. "kernel.sys")) then - title = "FreeDOS" - elseif (grub.file_exist (root .. "boot/loader") and - grub.file_exist (root .. "boot/device.hints")) then - source = "root (" .. device .. ")\nfreebsd /boot/loader" .. - "\nfreebsd_loadenv /boot/device.hints" - title = "FreeBSD" - else - grub.enum_file (enum_file, root .. "boot") - if kernel_num ~= 0 then - table.sort (kernels, sort_kernel) - for i = 1, kernel_num do - local initrd - - title = "Linux " .. kernels[i] - source = "root (" .. device .. - ")\nlinux /boot/vmlinuz-" .. kernels[i] .. - " root=UUID=" .. uuid .. " ro" - - if grub.file_exist (root .. "boot/initrd-" .. - kernels[i] .. ".img") then - initrd = "\ninitrd /boot/initrd-" .. kernels[i] .. ".img" - elseif grub.file_exist (root .. "boot/initrd.img-" .. kernels[i]) then - initrd = "\ninitrd /boot/initrd.img-" .. kernels[i] - elseif grub.file_exist (root .. "boot/initrd-" .. kernels[i]) then - initrd = "\ninitrd /boot/initrd-" .. kernels[i] - else - initrd = "" - end - - grub.add_menu (source .. initrd, title) - grub.add_menu (source .. " single" .. initrd, - title .. " (single-user mode)") - end - return 0 - end - end - - if title == nil then - local partition = string.match (device, ".*,(%d+)") - - if (partition ~= nil) and (tonumber (partition) > 4) then - return 0 - end - - title = "Other OS" - end - - grub.add_menu (source, title) - return 0 -end - -grub.enum_device (enum_device) From 0e51c3a7d4d5b9ae0a7caeea1d71440e2714dfe6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 28 Sep 2009 14:24:43 +0000 Subject: [PATCH 1166/1707] 2009-09-28 Robert Millan Do not automatically install headers. * Makefile.in (include_DATA): Remove. Update all users. --- ChangeLog | 6 ++++++ Makefile.in | 21 --------------------- 2 files changed, 6 insertions(+), 21 deletions(-) diff --git a/ChangeLog b/ChangeLog index aca4ef788..394470abc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-09-28 Robert Millan + + Do not automatically install headers. + + * Makefile.in (include_DATA): Remove. Update all users. + 2009-09-26 Robert Millan * conf/common.rmk (pkglib_MODULES): Remove `lua.mod'. diff --git a/Makefile.in b/Makefile.in index 363d696f1..0c5d0abb3 100644 --- a/Makefile.in +++ b/Makefile.in @@ -233,8 +233,6 @@ build_env.mk: Makefile echo "COMMON_LDFLAGS=$(COMMON_LDFLAGS)"\ ) > $@ pkglib_BUILDDIR += config.h grub_script.tab.h -include_DATA += $(shell find $(srcdir)/include -name \*.h | sed -e "s,^$(srcdir)/,,g") \ - include/grub/cpu include/grub/machine all-local: $(PROGRAMS) $(PKGLIB) $(PKGDATA) $(SCRIPTS) $(INFOS) $(MKFILES) @@ -249,20 +247,6 @@ install-local: all dest="`echo $$file | sed 's,.*/,,'`"; \ $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(pkglibdir)/$$dest; \ done - $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir) - @list='$(include_DATA)'; \ - for file in $$list; do \ - if test -e "$$file"; then dir=; else dir="$(srcdir)/"; fi; \ - dest="`echo $$file | sed 's,include/,,'`"; \ - destdir="`echo $$dest | sed 's,[^/]*$$,,g'`"; \ - $(SHELL) $(mkinstalldirs) $(DESTDIR)$(includedir)/$$destdir; \ - if test -f "$$dir$$file"; then \ - $(INSTALL_DATA) $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ - elif test -L "$$dir$$file"; then \ - rm -rf $(DESTDIR)$(includedir)/$$dest && \ - cp -fR $$dir$$file $(DESTDIR)$(includedir)/$$dest; \ - fi; \ - done $(SHELL) $(mkinstalldirs) $(DESTDIR)$(pkgdatadir) @list='$(PKGDATA)'; \ for file in $$list; do \ @@ -354,11 +338,6 @@ uninstall: dest="`echo $$file | sed 's,.*/,,' | sed '$(transform)'`"; \ rm -f $(DESTDIR)$(sysconfdir)/grub.d/$$dest; \ done - @list='$(include_DATA)'; \ - for file in $$list; do \ - dest="`echo $$file | sed 's,include/,,'`"; \ - rm -f $(DESTDIR)$(includedir)/$$dest; \ - done @list='$(lib_SCRIPTS)'; \ for file in $$list; do \ dest="`echo $$file | sed 's,.*/,,'`"; \ From 50dcabcf9485c83aef80226ccdd1bb8ebb6d0d04 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Thu, 1 Oct 2009 18:22:43 +0000 Subject: [PATCH 1167/1707] 2009-10-01 Colin Watson * util/grub-editenv.c (create_envblk_file): Write new block with a .new suffix and then rename it into place, to ensure atomic creation. --- ChangeLog | 6 ++++++ util/grub-editenv.c | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 394470abc..b2d1a7085 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-01 Colin Watson + + * util/grub-editenv.c (create_envblk_file): Write new block with a + .new suffix and then rename it into place, to ensure atomic + creation. + 2009-09-28 Robert Millan Do not automatically install headers. diff --git a/util/grub-editenv.c b/util/grub-editenv.c index 6d1234050..a8dc137c5 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -95,25 +95,31 @@ create_envblk_file (const char *name) { FILE *fp; char *buf; + char *namenew; buf = malloc (DEFAULT_ENVBLK_SIZE); if (! buf) grub_util_error ("out of memory"); - fp = fopen (name, "wb"); + asprintf (&namenew, "%s.new", name); + fp = fopen (namenew, "wb"); if (! fp) - grub_util_error ("cannot open the file %s", name); + grub_util_error ("cannot open the file %s", namenew); memcpy (buf, GRUB_ENVBLK_SIGNATURE, sizeof (GRUB_ENVBLK_SIGNATURE) - 1); memset (buf + sizeof (GRUB_ENVBLK_SIGNATURE) - 1, '#', DEFAULT_ENVBLK_SIZE - sizeof (GRUB_ENVBLK_SIGNATURE) + 1); if (fwrite (buf, 1, DEFAULT_ENVBLK_SIZE, fp) != DEFAULT_ENVBLK_SIZE) - grub_util_error ("cannot write to the file %s", name); + grub_util_error ("cannot write to the file %s", namenew); fsync (fileno (fp)); free (buf); fclose (fp); + + if (rename (namenew, name) < 0) + grub_util_error ("cannot rename the file %s to %s", namenew, name); + free (namenew); } static grub_envblk_t From e8ee83c046b99c15e9f425be7a37b110ced631fb Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 2 Oct 2009 23:13:38 +0000 Subject: [PATCH 1168/1707] 2009-10-03 Robert Millan Resync grub-mkdevicemap in x86_64-efi. * conf/x86_64-efi.rmk (sbin_UTILITIES): Enable `grub-mkdevicemap'. (grub_mkdevicemap_SOURCES): Add missing `util/deviceiter.c' and `util/devicemap.c'. --- ChangeLog | 8 ++++++++ conf/x86_64-efi.rmk | 5 +++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b2d1a7085..70adb66fb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2009-10-03 Robert Millan + + Resync grub-mkdevicemap in x86_64-efi. + + * conf/x86_64-efi.rmk (sbin_UTILITIES): Enable `grub-mkdevicemap'. + (grub_mkdevicemap_SOURCES): Add missing `util/deviceiter.c' and + `util/devicemap.c'. + 2009-10-01 Colin Watson * util/grub-editenv.c (create_envblk_file): Write new block with a diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 934cd7284..5be1b404f 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -9,7 +9,7 @@ script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage -#sbin_UTILITIES = grub-mkdevicemap +sbin_UTILITIES = grub-mkdevicemap #ifeq ($(enable_grub_emu), yes) #sbin_UTILITIES += grub-emu #endif @@ -27,7 +27,8 @@ grub_mkimage_SOURCES = util/i386/efi/grub-mkimage.c util/misc.c \ # kern/fs.c kern/env.c fs/fshelp.c # For grub-mkdevicemap. -grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/misc.c +grub_mkdevicemap_SOURCES = util/grub-mkdevicemap.c util/deviceiter.c \ + util/devicemap.c util/misc.c # For grub-emu. util/grub-emu.c_DEPENDENCIES = grub_emu_init.h From da25306d46d783810487d6663bcbfcacf1ef5d74 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 5 Oct 2009 17:56:33 +0000 Subject: [PATCH 1169/1707] 2009-10-05 Robert Millan * configure.ac: Bump version to 1.97~beta4. --- ChangeLog | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 70adb66fb..e27246856 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-05 Robert Millan + + * configure.ac: Bump version to 1.97~beta4. + 2009-10-03 Robert Millan Resync grub-mkdevicemap in x86_64-efi. diff --git a/configure.ac b/configure.ac index 4d221b4d6..3e4da66c8 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT([GRUB],[1.97~beta3],[bug-grub@gnu.org]) +AC_INIT([GRUB],[1.97~beta4],[bug-grub@gnu.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) From d244281ce6eb84ff0978c0457624f43ad6cced2e Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 5 Oct 2009 23:33:36 +0000 Subject: [PATCH 1170/1707] 2009-10-06 Colin Watson * util/i386/pc/grub-install.in: Source ${libdir}/grub/grub-mkconfig_lib before option processing, in order that the --grub-probe option will work. * util/sparc64/ieee1275/grub-install.in: Likewise. --- ChangeLog | 7 +++++++ util/i386/pc/grub-install.in | 6 +++--- util/sparc64/ieee1275/grub-install.in | 6 +++--- 3 files changed, 13 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index e27246856..a07270342 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-06 Colin Watson + + * util/i386/pc/grub-install.in: Source + ${libdir}/grub/grub-mkconfig_lib before option processing, in order + that the --grub-probe option will work. + * util/sparc64/ieee1275/grub-install.in: Likewise. + 2009-10-05 Robert Millan * configure.ac: Bump version to 1.97~beta4. diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 8ceb811dd..69028b662 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -31,6 +31,9 @@ target_cpu=@target_cpu@ platform=@platform@ pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` +# for make_system_path_relative_to_its_root() +. ${libdir}/grub/grub-mkconfig_lib + grub_setup=${sbindir}/`echo grub-setup | sed ${transform}` if [ "${target_cpu}-${platform}" = "i386-pc" ] ; then grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` @@ -141,9 +144,6 @@ for option in "$@"; do esac done -# for make_system_path_relative_to_its_root() -. ${libdir}/grub/grub-mkconfig_lib - if test "x$install_device" = x; then echo "install_device not specified." 1>&2 usage diff --git a/util/sparc64/ieee1275/grub-install.in b/util/sparc64/ieee1275/grub-install.in index 5cfb858d7..a03869cb3 100644 --- a/util/sparc64/ieee1275/grub-install.in +++ b/util/sparc64/ieee1275/grub-install.in @@ -31,6 +31,9 @@ target_cpu=@target_cpu@ platform=@platform@ pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` +# for make_system_path_relative_to_its_root() +. ${libdir}/grub/grub-mkconfig_lib + grub_setup=${sbindir}/`echo grub-setup | sed ${transform}` grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` grub_mkdevicemap=${sbindir}/`echo grub-mkdevicemap | sed ${transform}` @@ -117,9 +120,6 @@ for option in "$@"; do esac done -# for make_system_path_relative_to_its_root() -. ${libdir}/grub/grub-mkconfig_lib - if test "x$install_device" = x; then echo "install_device not specified." 1>&2 usage From 83b65c4afb32b41d22155d1410b1e94737b47c99 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 5 Oct 2009 23:55:48 +0000 Subject: [PATCH 1171/1707] 2009-10-06 Colin Watson * Makefile.in: Don't set info_INFOS unless makeinfo was found. Fixes bug #27602. --- ChangeLog | 5 +++++ Makefile.in | 2 ++ 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index a07270342..a829dd77e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-06 Colin Watson + + * Makefile.in: Don't set info_INFOS unless makeinfo was found. + Fixes bug #27602. + 2009-10-06 Colin Watson * util/i386/pc/grub-install.in: Source diff --git a/Makefile.in b/Makefile.in index 0c5d0abb3..304d1c7fd 100644 --- a/Makefile.in +++ b/Makefile.in @@ -174,7 +174,9 @@ handler.lst: $(HANDLERFILES) parttool.lst: $(PARTTOOLFILES) cat $^ /dev/null | sort | uniq > $@ +ifneq (true, $(MAKEINFO)) info_INFOS += docs/grub.info +endif MOSTLYCLEANFILES += vti.tmp MAINTAINER_CLEANFILES += docs/stamp-vti docs/version.texi From 186e7cf23b2b38e469a28149e46172f3904d49d8 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Tue, 6 Oct 2009 00:04:32 +0000 Subject: [PATCH 1172/1707] 2009-10-06 Colin Watson * Makefile.in (docs/stamp-vti): Depend on configure.ac as well, so that version.texi is rebuilt on version number changes. --- ChangeLog | 5 +++++ Makefile.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a829dd77e..c02e3a6e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-06 Colin Watson + + * Makefile.in (docs/stamp-vti): Depend on configure.ac as well, so + that version.texi is rebuilt on version number changes. + 2009-10-06 Colin Watson * Makefile.in: Don't set info_INFOS unless makeinfo was found. diff --git a/Makefile.in b/Makefile.in index 304d1c7fd..e0edbdb04 100644 --- a/Makefile.in +++ b/Makefile.in @@ -181,7 +181,7 @@ endif MOSTLYCLEANFILES += vti.tmp MAINTAINER_CLEANFILES += docs/stamp-vti docs/version.texi docs/version.texi: docs/stamp-vti -docs/stamp-vti: docs/grub.texi +docs/stamp-vti: docs/grub.texi configure.ac $(MKDIR_P) docs (set `$(SHELL) $(srcdir)/docs/mdate-sh $<`; \ echo "@set UPDATED $$1 $$2 $$3"; \ From 5c936493d314daa5721c150b67c1e1e01c9297a7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 9 Oct 2009 17:57:02 +0000 Subject: [PATCH 1173/1707] 2009-10-09 Robert Millan Fail gracefuly when attempting to load 64-bit kFreeBSD on IA32 CPU. * include/grub/i386/cpuid.h: New file. * commands/i386/cpuid.c: Include `'. (has_longmode): Rename to ... (grub_cpuid_has_longmode): ... this. Update all users. Remove `static' attribute. * loader/i386/bsd.c: Include `'. (grub_bsd_load_elf): Fail if load of 64-bit kernel was requested on a CPU that doesn't implement AMD64 instruction set. --- ChangeLog | 13 +++++++++++++ commands/i386/cpuid.c | 11 ++++++----- include/grub/i386/cpuid.h | 19 +++++++++++++++++++ loader/i386/bsd.c | 4 ++++ 4 files changed, 42 insertions(+), 5 deletions(-) create mode 100644 include/grub/i386/cpuid.h diff --git a/ChangeLog b/ChangeLog index c02e3a6e2..6c89eaad6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-10-09 Robert Millan + + Fail gracefuly when attempting to load 64-bit kFreeBSD on IA32 CPU. + + * include/grub/i386/cpuid.h: New file. + * commands/i386/cpuid.c: Include `'. + (has_longmode): Rename to ... + (grub_cpuid_has_longmode): ... this. Update all users. Remove + `static' attribute. + * loader/i386/bsd.c: Include `'. + (grub_bsd_load_elf): Fail if load of 64-bit kernel was requested + on a CPU that doesn't implement AMD64 instruction set. + 2009-10-06 Colin Watson * Makefile.in (docs/stamp-vti): Depend on configure.ac as well, so diff --git a/commands/i386/cpuid.c b/commands/i386/cpuid.c index 71f33efb3..a8bbfe69b 100644 --- a/commands/i386/cpuid.c +++ b/commands/i386/cpuid.c @@ -1,7 +1,7 @@ /* cpuid.c - test for CPU features */ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2006, 2007 Free Software Foundation, Inc. + * Copyright (C) 2006, 2007, 2009 Free Software Foundation, Inc. * Based on gcc/gcc/config/i386/driver-i386.c * * GRUB is free software: you can redistribute it and/or modify @@ -24,6 +24,7 @@ #include #include #include +#include #define cpuid(num,a,b,c,d) \ asm volatile ("xchgl %%ebx, %1; cpuid; xchgl %%ebx, %1" \ @@ -38,14 +39,14 @@ static const struct grub_arg_option options[] = #define bit_LM (1 << 29) -static unsigned char has_longmode = 0; +unsigned char grub_cpuid_has_longmode = 0; static grub_err_t grub_cmd_cpuid (grub_extcmd_t cmd __attribute__ ((unused)), int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { - return has_longmode ? GRUB_ERR_NONE + return grub_cpuid_has_longmode ? GRUB_ERR_NONE : grub_error (GRUB_ERR_TEST_FAILURE, "false"); } @@ -55,7 +56,7 @@ GRUB_MOD_INIT(cpuid) { #ifdef __x86_64__ /* grub-emu */ - has_longmode = 1; + grub_cpuid_has_longmode = 1; #else unsigned int eax, ebx, ecx, edx; unsigned int max_level; @@ -82,7 +83,7 @@ GRUB_MOD_INIT(cpuid) goto done; cpuid (0x80000001, eax, ebx, ecx, edx); - has_longmode = !!(edx & bit_LM); + grub_cpuid_has_longmode = !!(edx & bit_LM); done: #endif diff --git a/include/grub/i386/cpuid.h b/include/grub/i386/cpuid.h new file mode 100644 index 000000000..f6ae20f38 --- /dev/null +++ b/include/grub/i386/cpuid.h @@ -0,0 +1,19 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +extern unsigned char grub_cpuid_has_longmode; diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index 1accfb660..afe1825a5 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -19,6 +19,7 @@ #include #include #include +#include #include #include #include @@ -871,6 +872,9 @@ grub_bsd_load_elf (grub_elf_t elf) { is_64bit = 1; + if (! grub_cpuid_has_longmode) + return grub_error (GRUB_ERR_BAD_OS, "Your CPU does not implement AMD64 architecture."); + /* FreeBSD has 64-bit entry point. */ if (kernel_type == KERNEL_TYPE_FREEBSD) { From 86564c267a823d7dd84e3eb070913e648984f05c Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 9 Oct 2009 18:23:48 +0000 Subject: [PATCH 1174/1707] 2009-10-09 Robert Millan * include/grub/i386/cpuid.h: Add header protection. --- ChangeLog | 4 ++++ include/grub/i386/cpuid.h | 5 +++++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6c89eaad6..8640249ba 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-09 Robert Millan + + * include/grub/i386/cpuid.h: Add header protection. + 2009-10-09 Robert Millan Fail gracefuly when attempting to load 64-bit kFreeBSD on IA32 CPU. diff --git a/include/grub/i386/cpuid.h b/include/grub/i386/cpuid.h index f6ae20f38..09b313bb8 100644 --- a/include/grub/i386/cpuid.h +++ b/include/grub/i386/cpuid.h @@ -16,4 +16,9 @@ * along with GRUB. If not, see . */ +#ifndef GRUB_CPU_CPUID_HEADER +#define GRUB_CPU_CPUID_HEADER 1 + extern unsigned char grub_cpuid_has_longmode; + +#endif From bf7f7a18f45e006fef5cb076b9805f26c5ae22e7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 12 Oct 2009 21:53:15 +0000 Subject: [PATCH 1175/1707] 2009-10-12 Robert Millan * term/tparm.c: Switch to GPLv3. --- ChangeLog | 4 ++++ term/tparm.c | 44 +++++++++++++++++--------------------------- 2 files changed, 21 insertions(+), 27 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8640249ba..bc2a350cf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-12 Robert Millan + + * term/tparm.c: Switch to GPLv3. + 2009-10-09 Robert Millan * include/grub/i386/cpuid.h: Add header protection. diff --git a/term/tparm.c b/term/tparm.c index e76cbe723..fa25bd32c 100644 --- a/term/tparm.c +++ b/term/tparm.c @@ -1,30 +1,20 @@ -/**************************************************************************** - * Copyright (c) 1998-2003,2004,2005 Free Software Foundation, Inc. * - * * - * Permission is hereby granted, free of charge, to any person obtaining a * - * copy of this software and associated documentation files (the * - * "Software"), to deal in the Software without restriction, including * - * without limitation the rights to use, copy, modify, merge, publish, * - * distribute, distribute with modifications, sublicense, and/or sell * - * copies of the Software, and to permit persons to whom the Software is * - * furnished to do so, subject to the following conditions: * - * * - * The above copyright notice and this permission notice shall be included * - * in all copies or substantial portions of the Software. * - * * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * - * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * - * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * - * * - * Except as contained in this notice, the name(s) of the above copyright * - * holders shall not be used in advertising or otherwise to promote the * - * sale, use or other dealings in this Software without prior written * - * authorization. * - ****************************************************************************/ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1998-2003,2004,2005 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ /********************************************************************** * This code is a modification of lib_tparm.c found in ncurses-5.2. The From 3affd0ece8f6af300e6b33eb796da59bd46037a2 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 14 Oct 2009 10:11:59 +0200 Subject: [PATCH 1176/1707] libpci initial stuff --- Makefile.in | 2 ++ bus/pci.c | 23 ++++++++--------- bus/usb/ohci.c | 6 ++--- bus/usb/uhci.c | 6 ++--- commands/lspci.c | 11 +++++--- conf/i386-pc.rmk | 7 ++++- configure.ac | 11 +++++++- disk/ata.c | 11 ++++---- include/grub/i386/pci.h | 5 ++++ include/grub/pci.h | 45 ++++++++++++++++++++++++++------ util/pci.c | 57 +++++++++++++++++++++++++++++++++++++++++ 11 files changed, 147 insertions(+), 37 deletions(-) create mode 100644 util/pci.c diff --git a/Makefile.in b/Makefile.in index e0edbdb04..4e45dc569 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,12 +100,14 @@ endif AWK = @AWK@ LIBCURSES = @LIBCURSES@ LIBUSB = @LIBUSB@ +LIBPCI = @LIBPCI@ YACC = @YACC@ UNIFONT_BDF = @UNIFONT_BDF@ # Options. enable_grub_emu = @enable_grub_emu@ enable_grub_emu_usb = @enable_grub_emu_usb@ +enable_grub_emu_pci = @enable_grub_emu_pci@ enable_grub_fstest = @enable_grub_fstest@ enable_grub_pe2elf = @enable_grub_pe2elf@ enable_grub_mkfont = @enable_grub_mkfont@ diff --git a/bus/pci.c b/bus/pci.c index 2c29c03ab..fe4cad181 100644 --- a/bus/pci.c +++ b/bus/pci.c @@ -21,41 +21,40 @@ #include grub_pci_address_t -grub_pci_make_address (int bus, int device, int function, int reg) +grub_pci_make_address (grub_pci_device_t dev, int reg) { - return (1 << 31) | (bus << 16) | (device << 11) | (function << 8) | (reg << 2); + return (1 << 31) | (dev.bus << 16) | (dev.device << 11) + | (dev.function << 8) | (reg << 2); } void grub_pci_iterate (grub_pci_iteratefunc_t hook) { - int bus; - int dev; - int func; + grub_pci_device_t dev; grub_pci_address_t addr; grub_pci_id_t id; grub_uint32_t hdr; - for (bus = 0; bus < 256; bus++) + for (dev.bus = 0; dev.bus < 256; dev.bus++) { - for (dev = 0; dev < 32; dev++) + for (dev.device = 0; dev.device < 32; dev.device++) { - for (func = 0; func < 8; func++) + for (dev.function = 0; dev.function < 8; dev.function++) { - addr = grub_pci_make_address (bus, dev, func, 0); + addr = grub_pci_make_address (dev, 0); id = grub_pci_read (addr); /* Check if there is a device present. */ if (id >> 16 == 0xFFFF) continue; - if (hook (bus, dev, func, id)) + if (hook (dev, id)) return; /* Probe only func = 0 if the device if not multifunction */ - if (func == 0) + if (dev.function == 0) { - addr = grub_pci_make_address (bus, dev, func, 3); + addr = grub_pci_make_address (dev, 3); hdr = grub_pci_read (addr); if (!(hdr & 0x800000)) break; diff --git a/bus/usb/ohci.c b/bus/usb/ohci.c index 32fb7cf91..5fe9c9507 100644 --- a/bus/usb/ohci.c +++ b/bus/usb/ohci.c @@ -113,7 +113,7 @@ grub_ohci_writereg32 (struct grub_ohci *o, /* Iterate over all PCI devices. Determine if a device is an OHCI controller. If this is the case, initialize it. */ static int NESTED_FUNC_ATTR -grub_ohci_pci_iter (int bus, int device, int func, +grub_ohci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__((unused))) { grub_uint32_t class_code; @@ -126,7 +126,7 @@ grub_ohci_pci_iter (int bus, int device, int func, grub_uint32_t revision; grub_uint32_t frame_interval; - addr = grub_pci_make_address (bus, device, func, 2); + addr = grub_pci_make_address (dev, 2); class_code = grub_pci_read (addr) >> 8; interf = class_code & 0xFF; @@ -138,7 +138,7 @@ grub_ohci_pci_iter (int bus, int device, int func, return 0; /* Determine IO base address. */ - addr = grub_pci_make_address (bus, device, func, 4); + addr = grub_pci_make_address (dev, 4); base = grub_pci_read (addr); #if 0 diff --git a/bus/usb/uhci.c b/bus/usb/uhci.c index 88ff5b3d8..0d3daa5f1 100644 --- a/bus/usb/uhci.c +++ b/bus/usb/uhci.c @@ -138,7 +138,7 @@ grub_uhci_portstatus (grub_usb_controller_t dev, /* Iterate over all PCI devices. Determine if a device is an UHCI controller. If this is the case, initialize it. */ static int NESTED_FUNC_ATTR -grub_uhci_pci_iter (int bus, int device, int func, +grub_uhci_pci_iter (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__((unused))) { grub_uint32_t class_code; @@ -151,7 +151,7 @@ grub_uhci_pci_iter (int bus, int device, int func, struct grub_uhci *u; int i; - addr = grub_pci_make_address (bus, device, func, 2); + addr = grub_pci_make_address (dev, 2); class_code = grub_pci_read (addr) >> 8; interf = class_code & 0xFF; @@ -163,7 +163,7 @@ grub_uhci_pci_iter (int bus, int device, int func, return 0; /* Determine IO base address. */ - addr = grub_pci_make_address (bus, device, func, 8); + addr = grub_pci_make_address (dev, 8); base = grub_pci_read (addr); /* Stop if there is no IO space base address defined. */ if (! (base & 1)) diff --git a/commands/lspci.c b/commands/lspci.c index 5b3360a37..10618c7a9 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -115,15 +115,16 @@ grub_pci_get_class (int class, int subclass) } static int NESTED_FUNC_ATTR -grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) +grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid) { grub_uint32_t class; const char *sclass; grub_pci_address_t addr; - grub_printf ("%02x:%02x.%x %04x:%04x", bus, dev, func, pciid & 0xFFFF, - pciid >> 16); - addr = grub_pci_make_address (bus, dev, func, 2); + grub_printf ("%02x:%02x.%x %04x:%04x", grub_pci_get_bus (dev), + grub_pci_get_device (dev), grub_pci_get_function (dev), + pciid & 0xFFFF, pciid >> 16); + addr = grub_pci_make_address (dev, 2); class = grub_pci_read (addr); /* Lookup the class name, if there isn't a specific one, @@ -142,6 +143,8 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) grub_printf ("\n"); + grub_pci_close (dev); + return 0; } diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index bf8fbfb9d..107ae7a22 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -165,7 +165,12 @@ grub_emu_LDFLAGS = $(LIBCURSES) ifeq ($(enable_grub_emu_usb), yes) grub_emu_SOURCES += disk/usbms.c util/usb.c bus/usb/usb.c \ commands/usbtest.c -grub_emu_LDFLAGS += $(LIBCURSES) $(LIBUSB) +grub_emu_LDFLAGS += $(LIBUSB) +endif + +ifeq ($(enable_grub_emu_pci), yes) +grub_emu_SOURCES += util/pci.c commands/lspci.c +grub_emu_LDFLAGS += $(LIBPCI) endif # Scripts. diff --git a/configure.ac b/configure.ac index 3e4da66c8..5a98e3433 100644 --- a/configure.ac +++ b/configure.ac @@ -499,6 +499,10 @@ AC_ARG_ENABLE([grub-emu], AC_ARG_ENABLE([grub-emu-usb], [AS_HELP_STRING([--enable-grub-emu-usb], [build and install the `grub-emu' debugging utility with USB support (default=guessed)])]) +AC_ARG_ENABLE([grub-emu-pci], + [AS_HELP_STRING([--enable-grub-emu-pci], + [build and install the `grub-emu' debugging utility with PCI support (potentially dangerous) (default=no)])]) + if test x"$enable_grub_emu" = xno ; then grub_emu_excuse="explicitly disabled" fi @@ -541,7 +545,7 @@ AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], AC_CHECK_HEADERS([usb.h], [], [grub_emu_usb_excuse=["need libusb headers"]]) [fi] -if test x"enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then +if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled]) fi if test x"$grub_emu_usb_excuse" = x ; then @@ -550,8 +554,13 @@ else enable_grub_emu_usb=no fi +if test x"$enable_grub_emu_pci" != xyes ; then + enable_grub_emu_pci = no +fi + AC_SUBST([enable_grub_emu]) AC_SUBST([enable_grub_emu_usb]) +AC_SUBST([enable_grub_emu_pci]) AC_ARG_ENABLE([grub-fstest], [AS_HELP_STRING([--enable-grub-fstest], diff --git a/disk/ata.c b/disk/ata.c index 78d396526..ef6b44184 100644 --- a/disk/ata.c +++ b/disk/ata.c @@ -388,7 +388,7 @@ grub_ata_device_initialize (int port, int device, int addr, int addr2) } static int NESTED_FUNC_ATTR -grub_ata_pciinit (int bus, int device, int func, +grub_ata_pciinit (grub_pci_device_t dev, grub_pci_id_t pciid __attribute__((unused))) { static int compat_use[2] = { 0 }; @@ -402,7 +402,7 @@ grub_ata_pciinit (int bus, int device, int func, static int controller = 0; /* Read class. */ - addr = grub_pci_make_address (bus, device, func, 2); + addr = grub_pci_make_address (dev, 2); class = grub_pci_read (addr); /* Check if this class ID matches that of a PCI IDE Controller. */ @@ -429,9 +429,9 @@ grub_ata_pciinit (int bus, int device, int func, { /* Read the BARs, which either contain a mmapped IO address or the IO port address. */ - addr = grub_pci_make_address (bus, device, func, 4 + 2 * i); + addr = grub_pci_make_address (dev, 4 + 2 * i); bar1 = grub_pci_read (addr); - addr = grub_pci_make_address (bus, device, func, 5 + 2 * i); + addr = grub_pci_make_address (dev, 5 + 2 * i); bar2 = grub_pci_read (addr); /* Check if the BARs describe an IO region. */ @@ -444,7 +444,8 @@ grub_ata_pciinit (int bus, int device, int func, grub_dprintf ("ata", "PCI dev (%d,%d,%d) compat=%d rega=0x%x regb=0x%x\n", - bus, device, func, compat, rega, regb); + grub_pci_get_bus (dev), grub_pci_get_device (dev), + grub_pci_get_function (dev), compat, rega, regb); if (rega && regb) { diff --git a/include/grub/i386/pci.h b/include/grub/i386/pci.h index 996f64245..c8de9ff32 100644 --- a/include/grub/i386/pci.h +++ b/include/grub/i386/pci.h @@ -67,4 +67,9 @@ grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3)); } +static inline void +grub_pci_close (grub_pci_device_t dev __attribute__ ((unused))) +{ +} + #endif /* GRUB_CPU_PCI_H */ diff --git a/include/grub/pci.h b/include/grub/pci.h index 7c8b50528..2bea05410 100644 --- a/include/grub/pci.h +++ b/include/grub/pci.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2008 Free Software Foundation, Inc. + * Copyright (C) 2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -36,15 +36,44 @@ #define GRUB_PCI_ADDR_IO_MASK ~0x03 typedef grub_uint32_t grub_pci_id_t; -typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t) - (int bus, int device, int func, grub_pci_id_t pciid); -typedef grub_uint32_t grub_pci_address_t; -grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (int bus, int device, - int function, int reg); +#ifdef GRUB_UTIL +#include +#else +typedef grub_uint32_t grub_pci_address_t; +struct grub_pci_device +{ + int bus; + int device; + int function; +}; +typedef struct grub_pci_device grub_pci_device_t; +static inline int +grub_pci_get_bus (grub_pci_device_t dev) +{ + return dev.bus; +} + +static inline int +grub_pci_get_device (grub_pci_device_t dev) +{ + return dev.device; +} + +static inline int +grub_pci_get_function (grub_pci_device_t dev) +{ + return dev.function; +} +#include +#endif + +typedef int NESTED_FUNC_ATTR (*grub_pci_iteratefunc_t) + (grub_pci_device_t dev, grub_pci_id_t pciid); + +grub_pci_address_t EXPORT_FUNC(grub_pci_make_address) (grub_pci_device_t dev, + int reg); void EXPORT_FUNC(grub_pci_iterate) (grub_pci_iteratefunc_t hook); -#include - #endif /* GRUB_PCI_H */ diff --git a/util/pci.c b/util/pci.c new file mode 100644 index 000000000..99962c31d --- /dev/null +++ b/util/pci.c @@ -0,0 +1,57 @@ +/* pci.c - Generic PCI interfaces. */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +struct pci_access *acc = 0; + +grub_pci_address_t +grub_pci_make_address (grub_pci_device_t dev, int reg) +{ + grub_pci_address_t ret; + ret.dev = dev; + ret.pos = reg << 2; + return ret; +} + +void +grub_pci_close (grub_pci_device_t dev) +{ + pci_free_dev (dev); +} + +void +grub_pci_iterate (grub_pci_iteratefunc_t hook) +{ + grub_pci_device_t cur; + for (cur = acc->devices; cur; cur = cur->next) + hook (cur, cur->vendor_id|(cur->device_id << 16)); +} + +GRUB_MOD_INIT (pci) +{ + acc = pci_alloc (); + pci_init (acc); +} + +GRUB_MOD_FINI (pci) +{ + pci_cleanup (acc); +} From 325c8258e7c31a5acea560cd9e9965a3a9d933c3 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 14 Oct 2009 10:36:37 +0200 Subject: [PATCH 1177/1707] lspci works in grub-emu --- commands/lspci.c | 6 +-- configure.ac | 35 +++++++++++++++- include/grub/i386/pci.h | 5 --- include/grub/pciutils.h | 88 +++++++++++++++++++++++++++++++++++++++++ util/pci.c | 7 +--- 5 files changed, 125 insertions(+), 16 deletions(-) create mode 100644 include/grub/pciutils.h diff --git a/commands/lspci.c b/commands/lspci.c index 10618c7a9..bcaafa4f8 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -143,8 +143,6 @@ grub_lspci_iter (grub_pci_device_t dev, grub_pci_id_t pciid) grub_printf ("\n"); - grub_pci_close (dev); - return 0; } @@ -159,13 +157,13 @@ grub_cmd_lspci (grub_command_t cmd __attribute__ ((unused)), static grub_command_t cmd; -GRUB_MOD_INIT(pci) +GRUB_MOD_INIT(lspci) { cmd = grub_register_command ("lspci", grub_cmd_lspci, 0, "List PCI devices"); } -GRUB_MOD_FINI(pci) +GRUB_MOD_FINI(lspci) { grub_unregister_command (cmd); } diff --git a/configure.ac b/configure.ac index 5a98e3433..ceb81881a 100644 --- a/configure.ac +++ b/configure.ac @@ -531,9 +531,14 @@ else enable_grub_emu=no grub_emu_usb_excuse="grub-emu isn't built" fi +if test x"$enable_grub_emu_pci" = xyes ; then + grub_emu_usb_excuse="conflicts with PCI support" +fi + if test x"$enable_grub_emu_usb" = xno ; then grub_emu_usb_excuse="explicitly disabled" fi + [if [ x"$grub_emu_usb_excuse" = x ]; then # Check for libusb libraries.] AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], @@ -555,7 +560,29 @@ enable_grub_emu_usb=no fi if test x"$enable_grub_emu_pci" != xyes ; then - enable_grub_emu_pci = no + grub_emu_pci_excuse="not enabled" +fi + +if test x"$enable_grub_emu_usb" = xyes ; then + grub_emu_pci_excuse="conflicts with USB support" +fi + +[if [ x"$grub_emu_pci_excuse" = x ]; then + # Check for libpci libraries.] + AC_CHECK_LIB([pci], [pci_alloc], [LIBPCI="-lpci"], + [grub_emu_pci_excuse=["need libpci library"]]) + AC_SUBST([LIBPCI]) +[fi] +[if [ x"$grub_emu_pci_excuse" = x ]; then + # Check for headers.] + AC_CHECK_HEADERS([pci/pci.h], [], + [grub_emu_pci_excuse=["need libpci headers"]]) +[fi] + +if test x"$grub_emu_pci_excuse" = x ; then +enable_grub_emu_pci=yes +else +enable_grub_emu_pci=no fi AC_SUBST([enable_grub_emu]) @@ -634,6 +661,12 @@ echo USB support for grub-emu: Yes else echo USB support for grub-emu: No "($grub_emu_usb_excuse)" fi +if [ x"$grub_emu_pci_excuse" = x ]; then +echo PCI support for grub-emu: Yes +else +echo PCI support for grub-emu: No "($grub_emu_pci_excuse)" +fi + if [ x"$enable_mm_debug" = xyes ]; then echo With memory debugging: Yes else diff --git a/include/grub/i386/pci.h b/include/grub/i386/pci.h index c8de9ff32..996f64245 100644 --- a/include/grub/i386/pci.h +++ b/include/grub/i386/pci.h @@ -67,9 +67,4 @@ grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3)); } -static inline void -grub_pci_close (grub_pci_device_t dev __attribute__ ((unused))) -{ -} - #endif /* GRUB_CPU_PCI_H */ diff --git a/include/grub/pciutils.h b/include/grub/pciutils.h new file mode 100644 index 000000000..5ce612fee --- /dev/null +++ b/include/grub/pciutils.h @@ -0,0 +1,88 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2008,2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_PCIUTILS_H +#define GRUB_PCIUTILS_H 1 + +#include + +typedef struct pci_dev *grub_pci_device_t; + +static inline int +grub_pci_get_bus (grub_pci_device_t dev) +{ + return dev->bus; +} + +static inline int +grub_pci_get_device (grub_pci_device_t dev) +{ + return dev->dev; +} + +static inline int +grub_pci_get_function (grub_pci_device_t dev) +{ + return dev->func; +} + +struct grub_pci_address +{ + grub_pci_device_t dev; + int pos; +}; + +typedef struct grub_pci_address grub_pci_address_t; + +static inline grub_uint32_t +grub_pci_read (grub_pci_address_t addr) +{ + return pci_read_long (addr.dev, addr.pos); +} + +static inline grub_uint16_t +grub_pci_read_word (grub_pci_address_t addr) +{ + return pci_read_word (addr.dev, addr.pos); +} + +static inline grub_uint8_t +grub_pci_read_byte (grub_pci_address_t addr) +{ + return pci_read_byte (addr.dev, addr.pos); +} + +static inline void +grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) +{ + pci_write_long (addr.dev, addr.pos, data); +} + +static inline void +grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) +{ + pci_write_word (addr.dev, addr.pos, data); +} + +static inline void +grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) +{ + pci_write_byte (addr.dev, addr.pos, data); +} + +#endif /* GRUB_PCIUTILS_H */ diff --git a/util/pci.c b/util/pci.c index 99962c31d..e17068149 100644 --- a/util/pci.c +++ b/util/pci.c @@ -31,12 +31,6 @@ grub_pci_make_address (grub_pci_device_t dev, int reg) return ret; } -void -grub_pci_close (grub_pci_device_t dev) -{ - pci_free_dev (dev); -} - void grub_pci_iterate (grub_pci_iteratefunc_t hook) { @@ -49,6 +43,7 @@ GRUB_MOD_INIT (pci) { acc = pci_alloc (); pci_init (acc); + pci_scan_bus (acc); } GRUB_MOD_FINI (pci) From 459fed4b98162b84b93b4e9b77ab2895bae29bf1 Mon Sep 17 00:00:00 2001 From: phcoder Date: Wed, 14 Oct 2009 18:17:18 +0200 Subject: [PATCH 1178/1707] pciaccess --- Makefile.in | 2 +- conf/i386-pc.rmk | 2 +- configure.ac | 8 ++++---- include/grub/i386/pci.h | 16 ++++++++++++++++ include/grub/pciutils.h | 31 ++++++++++++++++++++++-------- util/pci.c | 42 ++++++++++++++++++++++++++++++++--------- 6 files changed, 78 insertions(+), 23 deletions(-) diff --git a/Makefile.in b/Makefile.in index 4e45dc569..1733f1c01 100644 --- a/Makefile.in +++ b/Makefile.in @@ -100,7 +100,7 @@ endif AWK = @AWK@ LIBCURSES = @LIBCURSES@ LIBUSB = @LIBUSB@ -LIBPCI = @LIBPCI@ +LIBPCIACCESS = @LIBPCIACCESS@ YACC = @YACC@ UNIFONT_BDF = @UNIFONT_BDF@ diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 107ae7a22..e4b89a8b9 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -170,7 +170,7 @@ endif ifeq ($(enable_grub_emu_pci), yes) grub_emu_SOURCES += util/pci.c commands/lspci.c -grub_emu_LDFLAGS += $(LIBPCI) +grub_emu_LDFLAGS += $(LIBPCIACCESS) endif # Scripts. diff --git a/configure.ac b/configure.ac index ceb81881a..5473ac3a3 100644 --- a/configure.ac +++ b/configure.ac @@ -569,14 +569,14 @@ fi [if [ x"$grub_emu_pci_excuse" = x ]; then # Check for libpci libraries.] - AC_CHECK_LIB([pci], [pci_alloc], [LIBPCI="-lpci"], - [grub_emu_pci_excuse=["need libpci library"]]) - AC_SUBST([LIBPCI]) + AC_CHECK_LIB([pciaccess], [pci_system_init], [LIBPCIACCESS="-lpciaccess"], + [grub_emu_pci_excuse=["need libpciaccess library"]]) + AC_SUBST([LIBPCIACCESS]) [fi] [if [ x"$grub_emu_pci_excuse" = x ]; then # Check for headers.] AC_CHECK_HEADERS([pci/pci.h], [], - [grub_emu_pci_excuse=["need libpci headers"]]) + [grub_emu_pci_excuse=["need libpciaccess headers"]]) [fi] if test x"$grub_emu_pci_excuse" = x ; then diff --git a/include/grub/i386/pci.h b/include/grub/i386/pci.h index 996f64245..5b5f5f0df 100644 --- a/include/grub/i386/pci.h +++ b/include/grub/i386/pci.h @@ -67,4 +67,20 @@ grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) grub_outb (data, GRUB_PCI_DATA_REG + (addr & 3)); } +static inline void * +grub_pci_device_map_range (grub_pci_device_t dev __attribute__ ((unused)), + grub_addr_t base, + grub_size_t size __attribute__ ((unused))) +{ + return (void *) base; +} + +static inline void +grub_pci_device_unmap_range (grub_pci_device_t dev __attribute__ ((unused)), + void *mem __attribute__ ((unused)), + grub_size_t size __attribute__ ((unused))) +{ +} + + #endif /* GRUB_CPU_PCI_H */ diff --git a/include/grub/pciutils.h b/include/grub/pciutils.h index 5ce612fee..36d47e5c8 100644 --- a/include/grub/pciutils.h +++ b/include/grub/pciutils.h @@ -19,9 +19,9 @@ #ifndef GRUB_PCIUTILS_H #define GRUB_PCIUTILS_H 1 -#include +#include -typedef struct pci_dev *grub_pci_device_t; +typedef struct pci_device *grub_pci_device_t; static inline int grub_pci_get_bus (grub_pci_device_t dev) @@ -52,37 +52,52 @@ typedef struct grub_pci_address grub_pci_address_t; static inline grub_uint32_t grub_pci_read (grub_pci_address_t addr) { - return pci_read_long (addr.dev, addr.pos); + grub_uint32_t ret; + pci_device_cfg_read_u32 (addr.dev, &ret, addr.pos); + return ret; } static inline grub_uint16_t grub_pci_read_word (grub_pci_address_t addr) { - return pci_read_word (addr.dev, addr.pos); + grub_uint16_t ret; + pci_device_cfg_read_u16 (addr.dev, &ret, addr.pos); + return ret; } static inline grub_uint8_t grub_pci_read_byte (grub_pci_address_t addr) { - return pci_read_byte (addr.dev, addr.pos); + grub_uint8_t ret; + pci_device_cfg_read_u8 (addr.dev, &ret, addr.pos); + return ret; } static inline void grub_pci_write (grub_pci_address_t addr, grub_uint32_t data) { - pci_write_long (addr.dev, addr.pos, data); + pci_device_cfg_write_u32 (addr.dev, data, addr.pos); } static inline void grub_pci_write_word (grub_pci_address_t addr, grub_uint16_t data) { - pci_write_word (addr.dev, addr.pos, data); + pci_device_cfg_write_u16 (addr.dev, data, addr.pos); } static inline void grub_pci_write_byte (grub_pci_address_t addr, grub_uint8_t data) { - pci_write_byte (addr.dev, addr.pos, data); + pci_device_cfg_write_u8 (addr.dev, data, addr.pos); } +void * +grub_pci_device_map_range (grub_pci_device_t dev, grub_addr_t base, + grub_size_t size); + +void +grub_pci_device_unmap_range (grub_pci_device_t dev, void *mem, + grub_size_t size); + + #endif /* GRUB_PCIUTILS_H */ diff --git a/util/pci.c b/util/pci.c index e17068149..8915068aa 100644 --- a/util/pci.c +++ b/util/pci.c @@ -19,8 +19,7 @@ #include #include - -struct pci_access *acc = 0; +#include grub_pci_address_t grub_pci_make_address (grub_pci_device_t dev, int reg) @@ -34,19 +33,44 @@ grub_pci_make_address (grub_pci_device_t dev, int reg) void grub_pci_iterate (grub_pci_iteratefunc_t hook) { - grub_pci_device_t cur; - for (cur = acc->devices; cur; cur = cur->next) - hook (cur, cur->vendor_id|(cur->device_id << 16)); + struct pci_device_iterator *iter; + struct pci_slot_match slot; + struct pci_device *dev; + slot.domain = PCI_MATCH_ANY; + slot.bus = PCI_MATCH_ANY; + slot.dev = PCI_MATCH_ANY; + slot.func = PCI_MATCH_ANY; + iter = pci_slot_match_iterator_create (&slot); + while ((dev = pci_device_next (iter))) + hook (dev, dev->vendor_id | (dev->device_id << 16)); + pci_iterator_destroy (iter); +} + +void * +grub_pci_device_map_range (grub_pci_device_t dev, grub_addr_t base, + grub_size_t size) +{ + void *addr; + int err; + err = pci_device_map_range(dev, base, size, PCI_DEV_MAP_FLAG_WRITABLE, &addr); + if (err) + grub_util_error ("mapping 0x%x failed (error %d)\n", base, err); + return addr; +} + +void +grub_pci_device_unmap_range (grub_pci_device_t dev, void *mem, + grub_size_t size) +{ + pci_device_unmap_range (dev, mem, size); } GRUB_MOD_INIT (pci) { - acc = pci_alloc (); - pci_init (acc); - pci_scan_bus (acc); + pci_system_init (); } GRUB_MOD_FINI (pci) { - pci_cleanup (acc); + pci_system_cleanup (); } From 9155bc1796e65baff75c36732e7daf34d7aab2c5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 14 Oct 2009 16:49:22 +0000 Subject: [PATCH 1179/1707] 2009-10-14 Robert Millan Refer to kernel of FreeBSD "kFreeBSD" to avoid confusion between the Operating System (FreeBSD) and its kernel (kernel of FreeBSD). * loader/i386/bsd.c (grub_freebsd_boot): Read kernel environment from "kFreeBSD" namespace (rather than "FreeBSD"). Update all users. (GRUB_MOD_INIT (bsd)): Rename "freebsd" command to "kfreebsd", "openbsd" to "kopenbsd", "netbsd" to "knetbsd", "freebsd_loadenv" to "kfreebsd_loadenv", "freebsd_module" to "kfreebsd_module", and "freebsd_module_elf" to "kfreebsd_module_elf". Update all users. --- ChangeLog | 15 +++++++++++++++ loader/i386/bsd.c | 26 +++++++++++++------------- util/grub.d/10_freebsd.in | 8 ++++---- 3 files changed, 32 insertions(+), 17 deletions(-) diff --git a/ChangeLog b/ChangeLog index bc2a350cf..911aa8c5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,18 @@ +2009-10-14 Robert Millan + + Refer to kernel of FreeBSD "kFreeBSD" to avoid confusion between + the Operating System (FreeBSD) and its kernel (kernel of FreeBSD). + + * loader/i386/bsd.c (grub_freebsd_boot): Read kernel environment + from "kFreeBSD" namespace (rather than "FreeBSD"). Update all + users. + + (GRUB_MOD_INIT (bsd)): Rename "freebsd" command to "kfreebsd", + "openbsd" to "kopenbsd", "netbsd" to "knetbsd", "freebsd_loadenv" + to "kfreebsd_loadenv", "freebsd_module" to "kfreebsd_module", + and "freebsd_module_elf" to "kfreebsd_module_elf". Update all + users. + 2009-10-12 Robert Millan * term/tparm.c: Switch to GPLv3. diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index afe1825a5..fc292444f 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -444,9 +444,9 @@ grub_freebsd_boot (void) auto int iterate_env (struct grub_env_var *var); int iterate_env (struct grub_env_var *var) { - if ((!grub_memcmp (var->name, "FreeBSD.", 8)) && (var->name[8])) + if ((!grub_memcmp (var->name, "kFreeBSD.", sizeof("kFreeBSD.") - 1)) && (var->name[sizeof("kFreeBSD.") - 1])) { - grub_strcpy (p, &var->name[8]); + grub_strcpy (p, &var->name[sizeof("kFreeBSD.") - 1]); p += grub_strlen (p); *(p++) = '='; grub_strcpy (p, var->value); @@ -1112,12 +1112,12 @@ grub_cmd_freebsd_loadenv (grub_command_t cmd __attribute__ ((unused)), if (*curr) { - char name[grub_strlen (curr) + 8 + 1]; + char name[grub_strlen (curr) + sizeof("kFreeBSD.")]; if (*p == '"') p++; - grub_sprintf (name, "FreeBSD.%s", curr); + grub_sprintf (name, "kFreeBSD.%s", curr); if (grub_env_set (name, p)) goto fail; } @@ -1252,26 +1252,26 @@ static grub_command_t cmd_freebsd_module_elf; GRUB_MOD_INIT (bsd) { - cmd_freebsd = grub_register_extcmd ("freebsd", grub_cmd_freebsd, + cmd_freebsd = grub_register_extcmd ("kfreebsd", grub_cmd_freebsd, GRUB_COMMAND_FLAG_BOTH, - "freebsd FILE", "Load kernel of FreeBSD.", + "kfreebsd FILE", "Load kernel of FreeBSD.", freebsd_opts); - cmd_openbsd = grub_register_extcmd ("openbsd", grub_cmd_openbsd, + cmd_openbsd = grub_register_extcmd ("kopenbsd", grub_cmd_openbsd, GRUB_COMMAND_FLAG_BOTH, - "openbsd FILE", "Load kernel of OpenBSD.", + "kopenbsd FILE", "Load kernel of OpenBSD.", openbsd_opts); - cmd_netbsd = grub_register_extcmd ("netbsd", grub_cmd_netbsd, + cmd_netbsd = grub_register_extcmd ("knetbsd", grub_cmd_netbsd, GRUB_COMMAND_FLAG_BOTH, - "netbsd FILE", "Load kernel of NetBSD.", + "knetbsd FILE", "Load kernel of NetBSD.", netbsd_opts); cmd_freebsd_loadenv = - grub_register_command ("freebsd_loadenv", grub_cmd_freebsd_loadenv, + grub_register_command ("kfreebsd_loadenv", grub_cmd_freebsd_loadenv, 0, "load FreeBSD env"); cmd_freebsd_module = - grub_register_command ("freebsd_module", grub_cmd_freebsd_module, + grub_register_command ("kfreebsd_module", grub_cmd_freebsd_module, 0, "load FreeBSD kernel module"); cmd_freebsd_module_elf = - grub_register_command ("freebsd_module_elf", grub_cmd_freebsd_module_elf, + grub_register_command ("kfreebsd_module_elf", grub_cmd_freebsd_module_elf, 0, "load FreeBSD kernel module (ELF)"); my_mod = mod; diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in index 1e3a0de1f..02694d3e7 100644 --- a/util/grub.d/10_freebsd.in +++ b/util/grub.d/10_freebsd.in @@ -60,17 +60,17 @@ menuentry "${OS}" { EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF - freebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} + kfreebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} EOF if [ x"$devices" != "x" ] ; then cat << EOF - freebsd_loadenv ${devices_rel_dirname}/${devices_basename} + kfreebsd_loadenv ${devices_rel_dirname}/${devices_basename} EOF fi cat << EOF - set FreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} - set FreeBSD.vfs.root.mountfrom.options=rw + set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} + set kFreeBSD.vfs.root.mountfrom.options=rw } EOF fi From e9d66f6d6a8f6bf92f3d570747a364b2bd530905 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 14 Oct 2009 18:23:40 +0000 Subject: [PATCH 1180/1707] 2009-10-14 Robert Millan * conf/common.rmk (grub-dumpbios): Remove rule. (sbin_SCRIPTS, CLEANFILES): Remove `grub-dumpbios'. * util/grub-dumpbios.in: Remove file. --- ChangeLog | 6 +++++ conf/common.rmk | 7 ------ util/grub-dumpbios.in | 58 ------------------------------------------- 3 files changed, 6 insertions(+), 65 deletions(-) delete mode 100644 util/grub-dumpbios.in diff --git a/ChangeLog b/ChangeLog index 911aa8c5b..e7fc70728 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-14 Robert Millan + + * conf/common.rmk (grub-dumpbios): Remove rule. + (sbin_SCRIPTS, CLEANFILES): Remove `grub-dumpbios'. + * util/grub-dumpbios.in: Remove file. + 2009-10-14 Robert Millan Refer to kernel of FreeBSD "kFreeBSD" to avoid confusion between diff --git a/conf/common.rmk b/conf/common.rmk index 26407d06b..c1f0bbdcf 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -161,13 +161,6 @@ CLEANFILES += $(grub-mkconfig_SCRIPTS) grub-mkconfig_DATA += util/grub.d/README -# For grub-dumpbios -grub-dumpbios: util/grub-dumpbios.in config.status - ./config.status --file=$@:$< - chmod +x $@ -sbin_SCRIPTS += grub-dumpbios -CLEANFILES += grub-dumpbios - # Filing systems. pkglib_MODULES += fshelp.mod fat.mod ufs1.mod ufs2.mod ext2.mod ntfs.mod \ ntfscomp.mod minix.mod hfs.mod jfs.mod iso9660.mod xfs.mod \ diff --git a/util/grub-dumpbios.in b/util/grub-dumpbios.in deleted file mode 100644 index 396503936..000000000 --- a/util/grub-dumpbios.in +++ /dev/null @@ -1,58 +0,0 @@ -#! /bin/sh -# -# Copyright (C) 2009 Free Software Foundation, Inc. -# -# GRUB is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GRUB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GRUB. If not, see . - -# Usage: usage -# Print the usage. -usage () { - cat <. -EOF -} - -# Check the arguments. -for option in "$@"; do - case "$option" in - -h | --help) - usage - exit 0 ;; - -v | --version) - echo "$0 (GNU GRUB @PACKAGE_VERSION@)" - exit 0 ;; - -o) - shift - output_dir=$1 - ;; - --output=) - output_dir=`echo "$option" | sed 's/--output=//'` - ;; - -*) - echo "Unrecognized option \`$option'" 1>&2 - usage - exit 1 - ;; - esac -done - -dd if=/dev/mem of=${output_dir}vbios.bin bs=65536 skip=12 count=1 -dd if=/dev/mem of=${output_dir}int10.bin bs=4 skip=16 count=1 From 6b5886ba66fa9df9a48a68fb27d0f11ca25e97ee Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 15 Oct 2009 11:55:06 +0000 Subject: [PATCH 1181/1707] 2009-10-15 Vladimir Serbinenko Revert 2009-06-10 Pavel Roskin * configure.ac: Put checks for __bswapsi2 and __bswapdi2. * include/grub/powerpc/libgcc.h: Don't use weak attribute for all exports. * include/grub/sparc64/libgcc.h: Likewise. Use preprocessor conditionals. --- ChangeLog | 10 ++++++++++ configure.ac | 3 +++ include/grub/powerpc/libgcc.h | 12 ++++++------ include/grub/sparc64/libgcc.h | 8 ++++++-- 4 files changed, 25 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7fc70728..f92d8da3a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-10-15 Vladimir Serbinenko + + Revert 2009-06-10 Pavel Roskin + + * configure.ac: Put checks for __bswapsi2 and __bswapdi2. + * include/grub/powerpc/libgcc.h: Don't use weak attribute for all + exports. + * include/grub/sparc64/libgcc.h: Likewise. Use + preprocessor conditionals. + 2009-10-14 Robert Millan * conf/common.rmk (grub-dumpbios): Remove rule. diff --git a/configure.ac b/configure.ac index 3e4da66c8..447f13fcc 100644 --- a/configure.ac +++ b/configure.ac @@ -417,6 +417,9 @@ fi CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" +# Check for target functions. +AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) + # Defined in aclocal.m4. grub_PROG_TARGET_CC if test "x$TARGET_APPLE_CC" != x1 ; then diff --git a/include/grub/powerpc/libgcc.h b/include/grub/powerpc/libgcc.h index ea4b073a0..0ff8964b7 100644 --- a/include/grub/powerpc/libgcc.h +++ b/include/grub/powerpc/libgcc.h @@ -16,9 +16,9 @@ * along with GRUB. If not, see . */ -void EXPORT_FUNC (memset) (void) __attribute__ ((weak)); -void EXPORT_FUNC (__ashldi3) (void) __attribute__ ((weak)); -void EXPORT_FUNC (__ashrdi3) (void) __attribute__ ((weak)); -void EXPORT_FUNC (__lshrdi3) (void) __attribute__ ((weak)); -void EXPORT_FUNC (__trampoline_setup) (void) __attribute__ ((weak)); -void EXPORT_FUNC (__ucmpdi2) (void) __attribute__ ((weak)); +void EXPORT_FUNC (memset) (void); +void EXPORT_FUNC (__ashldi3) (void); +void EXPORT_FUNC (__ashrdi3) (void); +void EXPORT_FUNC (__lshrdi3) (void); +void EXPORT_FUNC (__trampoline_setup) (void); +void EXPORT_FUNC (__ucmpdi2) (void); diff --git a/include/grub/sparc64/libgcc.h b/include/grub/sparc64/libgcc.h index 5d18c5c81..4a6b6194d 100644 --- a/include/grub/sparc64/libgcc.h +++ b/include/grub/sparc64/libgcc.h @@ -20,8 +20,12 @@ void EXPORT_FUNC (memset) (void); +#ifdef HAVE___BSWAPSI2 typedef int SItype __attribute__ ((mode (SI))); -SItype EXPORT_FUNC (__bswapsi2) (SItype) __attribute__ ((weak)); +SItype EXPORT_FUNC (__bswapsi2) (SItype); +#endif +#ifdef HAVE___BSWAPDI2 typedef int DItype __attribute__ ((mode (DI))); -DItype EXPORT_FUNC (__bswapdi2) (DItype) __attribute__ ((weak)); +DItype EXPORT_FUNC (__bswapdi2) (DItype); +#endif From c6f3b249e46b83ce21f941dd9c4e95d84f748e27 Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 15 Oct 2009 12:09:56 +0000 Subject: [PATCH 1182/1707] 2009-10-15 Vladimir Serbinenko * configure.ac: Add missing dollar. --- ChangeLog | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index f92d8da3a..8ad2c0362 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-15 Vladimir Serbinenko + + * configure.ac: Add missing dollar. + 2009-10-15 Vladimir Serbinenko Revert 2009-06-10 Pavel Roskin diff --git a/configure.ac b/configure.ac index 447f13fcc..946179966 100644 --- a/configure.ac +++ b/configure.ac @@ -544,7 +544,7 @@ AC_CHECK_LIB([usb], [usb_claim_interface], [LIBUSB="-lusb"], AC_CHECK_HEADERS([usb.h], [], [grub_emu_usb_excuse=["need libusb headers"]]) [fi] -if test x"enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then +if test x"$enable_grub_emu_usb" = xyes && test x"$grub_emu_usb_excuse" != x ; then AC_MSG_ERROR([USB support for grub-emu was explicitly requested but can't be compiled]) fi if test x"$grub_emu_usb_excuse" = x ; then From cd2851b3dd7d3dcd2a02739ab675d48fc03f527e Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 15 Oct 2009 12:26:30 +0000 Subject: [PATCH 1183/1707] 2009-10-15 Vladimir Serbinenko * commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise operations. --- ChangeLog | 5 +++++ commands/xnu_uuid.c | 2 -- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8ad2c0362..78a02e592 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-15 Vladimir Serbinenko + + * commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise + operations. + 2009-10-15 Vladimir Serbinenko * configure.ac: Add missing dollar. diff --git a/commands/xnu_uuid.c b/commands/xnu_uuid.c index d5c272d03..06e88e560 100644 --- a/commands/xnu_uuid.c +++ b/commands/xnu_uuid.c @@ -349,8 +349,6 @@ grub_cmd_xnu_uuid (grub_command_t cmd __attribute__ ((unused)), grub_memcpy (hashme.prefix, hash_prefix, sizeof (hashme.prefix)); md5 ((char *) &hashme, sizeof (hashme), (char *) xnu_uuid); - xnu_uuid[6] = (xnu_uuid[6] & 0xf) | 0x30; - xnu_uuid[8] = (xnu_uuid[8] & 0x3f) | 0x80; grub_sprintf (uuid_string, "%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x", (unsigned int) xnu_uuid[0], (unsigned int) xnu_uuid[1], From 44998e589332535da3ae656285347ce1427da8eb Mon Sep 17 00:00:00 2001 From: phcoder Date: Thu, 15 Oct 2009 12:40:13 +0000 Subject: [PATCH 1184/1707] 2009-10-15 Vladimir Serbinenko * loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image. --- ChangeLog | 4 ++++ loader/i386/pc/xnu.c | 50 ++++++++++++++++++++++++-------------------- 2 files changed, 31 insertions(+), 23 deletions(-) diff --git a/ChangeLog b/ChangeLog index 78a02e592..b0864a9b9 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-15 Vladimir Serbinenko + + * loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image. + 2009-10-15 Vladimir Serbinenko * commands/xnu_uuid.c (grub_cmd_xnu_uuid): Remove duplicated bitwise diff --git a/loader/i386/pc/xnu.c b/loader/i386/pc/xnu.c index 69a9405c6..ebb176bb4 100644 --- a/loader/i386/pc/xnu.c +++ b/loader/i386/pc/xnu.c @@ -43,7 +43,6 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) { struct grub_video_mode_info mode_info; int ret; - int x,y; char *tmp, *modevar; void *framebuffer; grub_err_t err; @@ -66,32 +65,37 @@ grub_xnu_set_video (struct grub_xnu_boot_params *params) if (err) return err; + if (grub_xnu_bitmap) + { + int x, y; + + x = mode_info.width - grub_xnu_bitmap->mode_info.width; + x /= 2; + y = mode_info.height - grub_xnu_bitmap->mode_info.height; + y /= 2; + err = grub_video_blit_bitmap (grub_xnu_bitmap, + GRUB_VIDEO_BLIT_REPLACE, + x > 0 ? x : 0, + y > 0 ? y : 0, + x < 0 ? -x : 0, + y < 0 ? -y : 0, + min (grub_xnu_bitmap->mode_info.width, + mode_info.width), + min (grub_xnu_bitmap->mode_info.height, + mode_info.height)); + if (err) + { + grub_print_error (); + grub_errno = GRUB_ERR_NONE; + grub_xnu_bitmap = 0; + } + err = GRUB_ERR_NONE; + } + ret = grub_video_get_info_and_fini (&mode_info, &framebuffer); if (ret) return grub_error (GRUB_ERR_IO, "couldn't retrieve video parameters"); - err = GRUB_ERR_NONE; - x = mode_info.width - grub_xnu_bitmap->mode_info.width; - x /= 2; - y = mode_info.height - grub_xnu_bitmap->mode_info.height; - y /= 2; - err = grub_video_blit_bitmap (grub_xnu_bitmap, - GRUB_VIDEO_BLIT_REPLACE, - x > 0 ? x : 0, - y > 0 ? y : 0, - x < 0 ? -x : 0, - y < 0 ? -y : 0, - min (grub_xnu_bitmap->mode_info.width, - mode_info.width), - min (grub_xnu_bitmap->mode_info.height, - mode_info.height)); - if (err) - { - grub_print_error (); - grub_errno = GRUB_ERR_NONE; - grub_xnu_bitmap = 0; - } - params->lfb_width = mode_info.width; params->lfb_height = mode_info.height; params->lfb_depth = mode_info.bpp; From 035f7122046ca8eaad631f5aa6a3006e464c30c7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 15 Oct 2009 20:34:27 +0000 Subject: [PATCH 1185/1707] 2009-10-15 Robert Millan Make entry text a bit more readable. * util/grub.d/10_linux.in: Add `with' before `Linux'. --- ChangeLog | 6 ++++++ util/grub.d/10_linux.in | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b0864a9b9..b90033393 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-15 Robert Millan + + Make entry text a bit more readable. + + * util/grub.d/10_linux.in: Add `with' before `Linux'. + 2009-10-15 Vladimir Serbinenko * loader/i386/pc/xnu.c (grub_xnu_set_video): Fix loading splash image. diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 381a0c3d5..1473a42a2 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -91,10 +91,10 @@ while [ "x$list" != "x" ] ; do linux_root_device_thisversion=${GRUB_DEVICE} fi - linux_entry "${OS}, Linux ${version}" \ + linux_entry "${OS}, with Linux ${version}" \ "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then - linux_entry "${OS}, Linux ${version} (recovery mode)" \ + linux_entry "${OS}, with Linux ${version} (recovery mode)" \ "single ${GRUB_CMDLINE_LINUX}" fi From 6f3cd880e9ea91441f4aa318234a8ad590fed9af Mon Sep 17 00:00:00 2001 From: cjwatson Date: Fri, 16 Oct 2009 15:38:42 +0000 Subject: [PATCH 1186/1707] 2009-10-16 Colin Watson * configure.ac (TARGET_CFLAGS): Add -mno-mmx -mno-sse -mno-sse2 -mno-3dnow on x86 architectures. Some toolchains enable these features by default, but they rely on registers that aren't enabled in GRUB. Thanks to Vladimir Serbinenko for the suggestion. --- ChangeLog | 7 +++++++ configure.ac | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/ChangeLog b/ChangeLog index b90033393..eb874f93e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-16 Colin Watson + + * configure.ac (TARGET_CFLAGS): Add -mno-mmx -mno-sse -mno-sse2 + -mno-3dnow on x86 architectures. Some toolchains enable these + features by default, but they rely on registers that aren't enabled + in GRUB. Thanks to Vladimir Serbinenko for the suggestion. + 2009-10-15 Robert Millan Make entry text a bit more readable. diff --git a/configure.ac b/configure.ac index 946179966..f26b92447 100644 --- a/configure.ac +++ b/configure.ac @@ -252,6 +252,10 @@ if test "x$TARGET_CFLAGS" = x; then else TARGET_CFLAGS="$TARGET_CFLAGS -malign-jumps=1 -malign-loops=1 -malign-functions=1" fi + + # Some toolchains enable these features by default, but they need + # registers that aren't set up properly in GRUB. + TARGET_CFLAGS="$TARGET_CFLAGS -mno-mmx -mno-sse -mno-sse2 -mno-3dnow" fi # By default, GCC 4.4 generates .eh_frame sections containing unwind From f1d29d87ad9ed67346fa78fa12e55f63b875bf7f Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 16 Oct 2009 17:43:26 +0000 Subject: [PATCH 1187/1707] 2009-10-16 Robert Millan * configure.ac: Bump version to 1.97. --- ChangeLog | 4 ++++ configure.ac | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index eb874f93e..5f58ef12f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-16 Robert Millan + + * configure.ac: Bump version to 1.97. + 2009-10-16 Colin Watson * configure.ac (TARGET_CFLAGS): Add -mno-mmx -mno-sse -mno-sse2 diff --git a/configure.ac b/configure.ac index f26b92447..ca837b6e5 100644 --- a/configure.ac +++ b/configure.ac @@ -31,7 +31,7 @@ dnl (such as TARGET_CC, TARGET_CFLAGS, etc.) are used for the target dnl type. -AC_INIT([GRUB],[1.97~beta4],[bug-grub@gnu.org]) +AC_INIT([GRUB],[1.97],[bug-grub@gnu.org]) AC_PREREQ(2.59) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) From 421bd7ac69dd3caee5806b0b7c5fd81581011150 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 16 Oct 2009 18:11:45 +0000 Subject: [PATCH 1188/1707] 2009-10-16 Vladimir Serbinenko * NEWS: Mentioned XNU, ACPI, gptsync, password and parttool. --- ChangeLog | 4 ++++ NEWS | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 5f58ef12f..f4f2914d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-16 Vladimir Serbinenko + + * NEWS: Mentioned XNU, ACPI, gptsync, password and parttool. + 2009-10-16 Robert Millan * configure.ac: Bump version to 1.97. diff --git a/NEWS b/NEWS index 03ba6a268..e4080de94 100644 --- a/NEWS +++ b/NEWS @@ -1,5 +1,15 @@ New in 1.97 - : +* Add support for XNU kernels. + +* ACPI override support. + +* Integrated gptsync. + +* Password protection support. + +* Partition manipulation tool. + * Add `keystatus' command. * Unicode fonts are now used by default. From d2b6b7fc9af3dfd958783cdc51de19b15e858721 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 16 Oct 2009 18:46:51 +0000 Subject: [PATCH 1189/1707] 2009-10-16 Robert Millan * NEWS: Misc adjustments. --- ChangeLog | 4 ++++ NEWS | 12 ++++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index f4f2914d8..8eb911eaf 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-16 Robert Millan + + * NEWS: Misc adjustments. + 2009-10-16 Vladimir Serbinenko * NEWS: Mentioned XNU, ACPI, gptsync, password and parttool. diff --git a/NEWS b/NEWS index e4080de94..7c29cc948 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,6 @@ New in 1.97 - : -* Add support for XNU kernels. +* Add support for loading XNU (MacOS X kernel). * ACPI override support. @@ -22,9 +22,7 @@ New in 1.97 - : * Add support for RAID levels 4,6 and 10. -* Add support for lua scripts. - -* update-grub is renamed to grub-mkconfig. +* update-grub is replaced by grub-mkconfig. * When booting from PXE, PXE can be used to load files. @@ -36,8 +34,6 @@ New in 1.97 - : * Add Cygwin support. -* Add grub-pe2elf to convert PE modules to ELF modules. - * Add x86_64 EFI support. * Use LZMA compression instead of LZO. @@ -57,13 +53,13 @@ New in 1.97 - : * grub-mkconfig supports os-prober to add operating systems to the boot menu. -* The ATA driver supports filesystems bigger than 2TB. +* The ATA driver supports devices bigger than 2 TiB. * Add support for the UDF, AFS and EXT4 filesystems. * The ISO9660 filesystem supports the Joliet extension -* Add aout and BSD kernel loaders. +* Add support for loading kernels of FreeBSD, NetBSD and OpenBSD. * Add new command `sleep'. From 46695a62e6b3ffa53f224cf82de871afe36cf2d9 Mon Sep 17 00:00:00 2001 From: phcoder Date: Fri, 16 Oct 2009 20:21:12 +0000 Subject: [PATCH 1190/1707] 2009-10-16 Vladimir Serbinenko Let user specify OpenBSD root device. * loader/i386/bsd.c (openbsd_root): New variable. (openbsd_opts): New option 'root'. (OPENBSD_ROOT_ARG): New macro. (grub_openbsd_boot): Use 'openbsd_root'. (grub_cmd_openbsd): Fill 'openbsd_root'. --- ChangeLog | 10 ++++++++++ loader/i386/bsd.c | 41 ++++++++++++++++++++++++++++++++++------- 2 files changed, 44 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 8eb911eaf..960fc067e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-10-16 Vladimir Serbinenko + + Let user specify OpenBSD root device. + + * loader/i386/bsd.c (openbsd_root): New variable. + (openbsd_opts): New option 'root'. + (OPENBSD_ROOT_ARG): New macro. + (grub_openbsd_boot): Use 'openbsd_root'. + (grub_cmd_openbsd): Fill 'openbsd_root'. + 2009-10-16 Robert Millan * NEWS: Misc adjustments. diff --git a/loader/i386/bsd.c b/loader/i386/bsd.c index fc292444f..acc653c9e 100644 --- a/loader/i386/bsd.c +++ b/loader/i386/bsd.c @@ -58,6 +58,7 @@ static char *mod_buf; static grub_uint32_t mod_buf_len, mod_buf_max, kern_end_mdofs; static int is_elf_kernel, is_64bit; static char *netbsd_root = NULL; +static grub_uint32_t openbsd_root; static const struct grub_arg_option freebsd_opts[] = { @@ -94,6 +95,7 @@ static const struct grub_arg_option openbsd_opts[] = {"config", 'c', 0, "Change configured devices.", 0, 0}, {"single", 's', 0, "Boot into single mode.", 0, 0}, {"kdb", 'd', 0, "Enter in KDB on boot.", 0, 0}, + {"root", 'r', 0, "Set root device.", "wdXY", ARG_TYPE_STRING}, {0, 0, 0, 0, 0, 0} }; @@ -103,6 +105,8 @@ static const grub_uint32_t openbsd_flags[] = OPENBSD_RB_SINGLE, OPENBSD_RB_KDB, 0 }; +#define OPENBSD_ROOT_ARG (ARRAY_SIZE (openbsd_flags) - 1) + static const struct grub_arg_option netbsd_opts[] = { {"no-smp", '1', 0, "Disable SMP.", 0, 0}, @@ -565,7 +569,6 @@ grub_openbsd_boot (void) char *buf = (char *) GRUB_BSD_TEMP_BUFFER; struct grub_openbsd_bios_mmap *pm; struct grub_openbsd_bootargs *pa; - grub_uint32_t bootdev, biosdev, unit, slice, part; auto int NESTED_FUNC_ATTR hook (grub_uint64_t, grub_uint64_t, grub_uint32_t); int NESTED_FUNC_ATTR hook (grub_uint64_t addr, grub_uint64_t size, grub_uint32_t type) @@ -614,11 +617,7 @@ grub_openbsd_boot (void) pa->ba_type = OPENBSD_BOOTARG_END; pa++; - grub_bsd_get_device (&biosdev, &unit, &slice, &part); - bootdev = (OPENBSD_B_DEVMAGIC + (unit << OPENBSD_B_UNITSHIFT) + - (part << OPENBSD_B_PARTSHIFT)); - - grub_unix_real_boot (entry, bootflags, bootdev, OPENBSD_BOOTARG_APIVER, + grub_unix_real_boot (entry, bootflags, openbsd_root, OPENBSD_BOOTARG_APIVER, 0, (grub_uint32_t) (grub_mmap_get_upper () >> 10), (grub_uint32_t) (grub_mmap_get_lower () >> 10), (char *) pa - buf, buf); @@ -1015,11 +1014,39 @@ grub_cmd_freebsd (grub_extcmd_t cmd, int argc, char *argv[]) static grub_err_t grub_cmd_openbsd (grub_extcmd_t cmd, int argc, char *argv[]) { + grub_uint32_t bootdev; + kernel_type = KERNEL_TYPE_OPENBSD; bootflags = grub_bsd_parse_flags (cmd->state, openbsd_flags); + if (cmd->state[OPENBSD_ROOT_ARG].set) + { + const char *arg = cmd->state[OPENBSD_ROOT_ARG].arg; + int unit, part; + if (*(arg++) != 'w' || *(arg++) != 'd') + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "Only device specifications of form " + "wd are supported."); + + unit = grub_strtoul (arg, (char **) &arg, 10); + if (! (arg && *arg >= 'a' && *arg <= 'z')) + return grub_error (GRUB_ERR_BAD_ARGUMENT, + "Only device specifications of form " + "wd are supported."); + + part = *arg - 'a'; + + bootdev = (OPENBSD_B_DEVMAGIC + (unit << OPENBSD_B_UNITSHIFT) + + (part << OPENBSD_B_PARTSHIFT)); + } + else + bootdev = 0; + if (grub_bsd_load (argc, argv) == GRUB_ERR_NONE) - grub_loader_set (grub_openbsd_boot, grub_bsd_unload, 1); + { + grub_loader_set (grub_openbsd_boot, grub_bsd_unload, 1); + openbsd_root = bootdev; + } return grub_errno; } From 3b2fe8c2857f9753ce072639c8a547d6c41bce61 Mon Sep 17 00:00:00 2001 From: robertmh Date: Tue, 20 Oct 2009 11:30:37 +0000 Subject: [PATCH 1191/1707] 2009-10-20 Robert Millan Fix build on sparc64. * configure.ac: Perform checks for libgcc symbols before adding `-nostdlib' to LDFLAGS. --- ChangeLog | 7 +++++++ configure.ac | 6 +++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 960fc067e..a14da7a14 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-20 Robert Millan + + Fix build on sparc64. + + * configure.ac: Perform checks for libgcc symbols before + adding `-nostdlib' to LDFLAGS. + 2009-10-16 Vladimir Serbinenko Let user specify OpenBSD root device. diff --git a/configure.ac b/configure.ac index ca837b6e5..bf113ba68 100644 --- a/configure.ac +++ b/configure.ac @@ -411,6 +411,9 @@ AC_SUBST(TARGET_ASFLAGS) AC_SUBST(TARGET_CPPFLAGS) AC_SUBST(TARGET_LDFLAGS) +# Check for libgcc symbols (must be performed before we add -nostdlib to LDFLAGS) +AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) + # Set them to their new values for the tests below. CC="$TARGET_CC" if test "x$TARGET_APPLE_CC" = x1 ; then @@ -421,9 +424,6 @@ fi CPPFLAGS="$TARGET_CPPFLAGS" LDFLAGS="$TARGET_LDFLAGS" -# Check for target functions. -AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) - # Defined in aclocal.m4. grub_PROG_TARGET_CC if test "x$TARGET_APPLE_CC" != x1 ; then From 0933cdc0ab2789eda662dbd6418f92f21d05bd39 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 21 Oct 2009 12:22:05 +0000 Subject: [PATCH 1192/1707] 2009-10-21 Felix Zielcke * config.guess: Update to latest version from config git repository. * config.sub: Likewise. --- ChangeLog | 6 +++ config.guess | 111 +++++++++++++++++---------------------------------- config.sub | 9 +++-- 3 files changed, 47 insertions(+), 79 deletions(-) diff --git a/ChangeLog b/ChangeLog index a14da7a14..2dd370aca 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-21 Felix Zielcke + + * config.guess: Update to latest version from config git + repository. + * config.sub: Likewise. + 2009-10-20 Robert Millan Fix build on sparc64. diff --git a/config.guess b/config.guess index bb0b03ea1..e792aac60 100644 --- a/config.guess +++ b/config.guess @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2009-08-19' +timestamp='2009-09-18' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -854,6 +854,20 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ @@ -876,6 +890,9 @@ EOF frv:Linux:*:*) echo frv-unknown-linux-gnu exit ;; + i*86:Linux:*:*) + echo ${UNAME_MACHINE}-pc-linux-gnu + exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; @@ -911,29 +928,12 @@ EOF or32:Linux:*:*) echo or32-unknown-linux-gnu exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep -q ld.so.1 - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} - exit ;; padre:Linux:*:*) echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -942,8 +942,11 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux @@ -966,58 +969,6 @@ EOF xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1247,6 +1198,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} diff --git a/config.sub b/config.sub index 8ca084bf3..5ecc18b6a 100644 --- a/config.sub +++ b/config.sub @@ -4,7 +4,7 @@ # 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009 # Free Software Foundation, Inc. -timestamp='2009-08-19' +timestamp='2009-10-07' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -287,6 +287,7 @@ case $basic_machine in | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ @@ -300,7 +301,7 @@ case $basic_machine in | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -371,7 +372,7 @@ case $basic_machine in | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ + | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ @@ -1296,7 +1297,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) From f66938909063bff27fc2c3cb5e8e6063f6d0175f Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 24 Oct 2009 23:03:02 +0000 Subject: [PATCH 1193/1707] 2009-10-25 Robert Millan Patch from Samuel Thibault * docs/grub.cfg: Compensate for recent change in multiboot loader (since 2009-08-14 it won't pass filename to payload). * util/grub.d/10_hurd.in: Likewise. --- ChangeLog | 7 +++++++ docs/grub.cfg | 4 ++-- util/grub.d/10_hurd.in | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2dd370aca..26a2c8f7c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-25 Robert Millan + + Patch from Samuel Thibault + * docs/grub.cfg: Compensate for recent change in multiboot + loader (since 2009-08-14 it won't pass filename to payload). + * util/grub.d/10_hurd.in: Likewise. + 2009-10-21 Felix Zielcke * config.guess: Update to latest version from config git diff --git a/docs/grub.cfg b/docs/grub.cfg index 4d1582a8e..0a9ab6bc7 100644 --- a/docs/grub.cfg +++ b/docs/grub.cfg @@ -15,13 +15,13 @@ set fallback=1 menuentry "GNU (aka GNU/Hurd)" { set root=(hd0,1) multiboot /boot/gnumach.gz root=device:hd0s1 - module /hurd/ext2fs.static --readonly \ + module /hurd/ext2fs.static ext2fs --readonly \ --multiboot-command-line='${kernel-command-line}' \ --host-priv-port='${host-port}' \ --device-master-port='${device-port}' \ --exec-server-task='${exec-task}' -T typed '${root}' \ '$(task-create)' '$(task-resume)' - module /lib/ld.so.1 /hurd/exec '$(exec-task=task-create)' + module /lib/ld.so.1 exec /hurd/exec '$(exec-task=task-create)' } # For booting GNU/Linux diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index ec78a3532..b52f37498 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -74,12 +74,12 @@ EOF prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" cat << EOF multiboot ${kernel} root=device:${GRUB_DEVICE} - module /hurd/${hurd_fs}.static --readonly \\ + module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\ --multiboot-command-line='\${kernel-command-line}' \\ --host-priv-port='\${host-port}' \\ --device-master-port='\${device-port}' \\ --exec-server-task='\${exec-task}' -T typed '\${root}' \\ '\$(task-create)' '\$(task-resume)' - module /lib/ld.so.1 /hurd/exec '\$(exec-task=task-create)' + module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)' } EOF From fb26abc22bece052526d65508944dffd0405fa02 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 24 Oct 2009 23:15:48 +0000 Subject: [PATCH 1194/1707] 2009-10-25 Robert Millan * fs/cpio.c [MODE_USTAR]: Finish `tar' module instead of `cpio'. [! MODE_USTAR]: Finish `cpio' module instead of `tar'. --- ChangeLog | 6 ++++++ fs/cpio.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 26a2c8f7c..51e76499b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-25 Robert Millan + + * fs/cpio.c [MODE_USTAR]: Finish `tar' module instead of + `cpio'. + [! MODE_USTAR]: Finish `cpio' module instead of `tar'. + 2009-10-25 Robert Millan Patch from Samuel Thibault diff --git a/fs/cpio.c b/fs/cpio.c index 1ec4ebeaf..7c6ada9b3 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -362,9 +362,9 @@ GRUB_MOD_INIT (tar) } #ifdef MODE_USTAR -GRUB_MOD_FINI (cpio) -#else GRUB_MOD_FINI (tar) +#else +GRUB_MOD_FINI (cpio) #endif { grub_fs_unregister (&grub_cpio_fs); From cdb308b0e156f2081c77e30b92bad5ebac4fdf11 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 24 Oct 2009 23:26:42 +0000 Subject: [PATCH 1195/1707] 2009-10-25 Robert Millan * include/grub/powerpc/libgcc.h (memset): Remove function prototype. * include/grub/sparc64/libgcc.h (memset): Likewise. * include/grub/misc.h (memset, memcmp): New function prototypes. --- ChangeLog | 6 ++++++ include/grub/misc.h | 2 ++ include/grub/powerpc/libgcc.h | 1 - include/grub/sparc64/libgcc.h | 2 -- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 51e76499b..9df444755 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-25 Robert Millan + + * include/grub/powerpc/libgcc.h (memset): Remove function prototype. + * include/grub/sparc64/libgcc.h (memset): Likewise. + * include/grub/misc.h (memset, memcmp): New function prototypes. + 2009-10-25 Robert Millan * fs/cpio.c [MODE_USTAR]: Finish `tar' module instead of diff --git a/include/grub/misc.h b/include/grub/misc.h index a63a0b442..c7ff1e2d2 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -76,8 +76,10 @@ grub_strncat (char *dest, const char *src, int c) /* Prototypes for aliases. */ #if !defined (GRUB_UTIL) || !defined (APPLE_CC) +int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); +void EXPORT_FUNC (memset) (void); #endif int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); diff --git a/include/grub/powerpc/libgcc.h b/include/grub/powerpc/libgcc.h index 0ff8964b7..c32fcd87f 100644 --- a/include/grub/powerpc/libgcc.h +++ b/include/grub/powerpc/libgcc.h @@ -16,7 +16,6 @@ * along with GRUB. If not, see . */ -void EXPORT_FUNC (memset) (void); void EXPORT_FUNC (__ashldi3) (void); void EXPORT_FUNC (__ashrdi3) (void); void EXPORT_FUNC (__lshrdi3) (void); diff --git a/include/grub/sparc64/libgcc.h b/include/grub/sparc64/libgcc.h index 4a6b6194d..008821d81 100644 --- a/include/grub/sparc64/libgcc.h +++ b/include/grub/sparc64/libgcc.h @@ -18,8 +18,6 @@ #include -void EXPORT_FUNC (memset) (void); - #ifdef HAVE___BSWAPSI2 typedef int SItype __attribute__ ((mode (SI))); SItype EXPORT_FUNC (__bswapsi2) (SItype); From 346e7fbedb8e728aea4c8400e2d94ba24208ed3b Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 24 Oct 2009 23:26:53 +0000 Subject: [PATCH 1196/1707] 2009-10-25 Robert Millan * configure.ac: Check for `__ashldi3', `__ashrdi3', `__lshrdi3', `__trampoline_setup' and `__ucmpdi2'. * include/grub/powerpc/libgcc.h: Only export symbols for functions that libgcc provides. --- ChangeLog | 7 +++++++ configure.ac | 2 +- include/grub/powerpc/libgcc.h | 14 +++++++++++++- 3 files changed, 21 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 9df444755..ce28aed16 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-25 Robert Millan + + * configure.ac: Check for `__ashldi3', `__ashrdi3', `__lshrdi3', + `__trampoline_setup' and `__ucmpdi2'. + * include/grub/powerpc/libgcc.h: Only export symbols for functions + that libgcc provides. + 2009-10-25 Robert Millan * include/grub/powerpc/libgcc.h (memset): Remove function prototype. diff --git a/configure.ac b/configure.ac index bf113ba68..048333ba5 100644 --- a/configure.ac +++ b/configure.ac @@ -412,7 +412,7 @@ AC_SUBST(TARGET_CPPFLAGS) AC_SUBST(TARGET_LDFLAGS) # Check for libgcc symbols (must be performed before we add -nostdlib to LDFLAGS) -AC_CHECK_FUNCS(__bswapsi2 __bswapdi2) +AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __trampoline_setup __ucmpdi2) # Set them to their new values for the tests below. CC="$TARGET_CC" diff --git a/include/grub/powerpc/libgcc.h b/include/grub/powerpc/libgcc.h index c32fcd87f..452ad4366 100644 --- a/include/grub/powerpc/libgcc.h +++ b/include/grub/powerpc/libgcc.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2004,2007 Free Software Foundation, Inc. + * Copyright (C) 2004,2007,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -16,8 +16,20 @@ * along with GRUB. If not, see . */ +#include + +#ifdef HAVE___ASHLDI3 void EXPORT_FUNC (__ashldi3) (void); +#endif +#ifdef HAVE___ASHRDI3 void EXPORT_FUNC (__ashrdi3) (void); +#endif +#ifdef HAVE___LSHRDI3 void EXPORT_FUNC (__lshrdi3) (void); +#endif +#ifdef HAVE___TRAMPOLINE_SETUP void EXPORT_FUNC (__trampoline_setup) (void); +#endif +#ifdef HAVE___UCMPDI2 void EXPORT_FUNC (__ucmpdi2) (void); +#endif From b240e30c478d5665bba66794e9a1c8ccaefbb222 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 24 Oct 2009 23:31:05 +0000 Subject: [PATCH 1197/1707] 2009-10-25 Robert Millan * fs/cpio.c [MODE_USTAR]: Initialize `tar' module instead of `cpio'. [! MODE_USTAR]: Initialize `cpio' module instead of `tar'. --- ChangeLog | 6 ++++++ fs/cpio.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index ce28aed16..380dacffd 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-25 Robert Millan + + * fs/cpio.c [MODE_USTAR]: Initialize `tar' module instead of + `cpio'. + [! MODE_USTAR]: Initialize `cpio' module instead of `tar'. + 2009-10-25 Robert Millan * configure.ac: Check for `__ashldi3', `__ashrdi3', `__lshrdi3', diff --git a/fs/cpio.c b/fs/cpio.c index 7c6ada9b3..3f3a3d1a0 100644 --- a/fs/cpio.c +++ b/fs/cpio.c @@ -352,9 +352,9 @@ static struct grub_fs grub_cpio_fs = { }; #ifdef MODE_USTAR -GRUB_MOD_INIT (cpio) -#else GRUB_MOD_INIT (tar) +#else +GRUB_MOD_INIT (cpio) #endif { grub_fs_register (&grub_cpio_fs); From 508d42ec11bd3197bd6f3783a27f54ed6796eafd Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 24 Oct 2009 23:36:00 +0000 Subject: [PATCH 1198/1707] 2009-10-25 Robert Millan 2009-10-25 Vasily Averin * fs/ext2.c (grub_ext2_iterate_dir): Avoid infinite loop when `dirent.direntlen == 0'. --- ChangeLog | 6 ++++++ fs/ext2.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/ChangeLog b/ChangeLog index 380dacffd..80c593e4b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-25 Robert Millan +2009-10-25 Vasily Averin + + * fs/ext2.c (grub_ext2_iterate_dir): Avoid infinite loop when + `dirent.direntlen == 0'. + 2009-10-25 Robert Millan * fs/cpio.c [MODE_USTAR]: Initialize `tar' module instead of diff --git a/fs/ext2.c b/fs/ext2.c index 0341680ea..8d8c6939e 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -649,6 +649,9 @@ grub_ext2_iterate_dir (grub_fshelp_node_t dir, if (grub_errno) return 0; + if (dirent.direntlen == 0) + return 0; + if (dirent.namelen != 0) { char filename[dirent.namelen + 1]; From d64448a72c4d5015ab07c2197e7f1f11717e382a Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 25 Oct 2009 15:14:25 +0000 Subject: [PATCH 1199/1707] 2009-10-25 Robert Millan * include/grub/misc.h: Fix wrong evaluation of APPLE_CC. (memset): Fix function prototype. --- ChangeLog | 5 +++++ include/grub/misc.h | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 80c593e4b..daee3ea4c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-25 Robert Millan + + * include/grub/misc.h: Fix wrong evaluation of APPLE_CC. + (memset): Fix function prototype. + 2009-10-25 Robert Millan 2009-10-25 Vasily Averin diff --git a/include/grub/misc.h b/include/grub/misc.h index c7ff1e2d2..7589f43a2 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -75,11 +75,11 @@ grub_strncat (char *dest, const char *src, int c) } /* Prototypes for aliases. */ -#if !defined (GRUB_UTIL) || !defined (APPLE_CC) +#if !defined (GRUB_UTIL) && !defined (APPLE_CC) int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); -void EXPORT_FUNC (memset) (void); +void *EXPORT_FUNC(memset) (void *s, int c, grub_size_t n); #endif int EXPORT_FUNC(grub_memcmp) (const void *s1, const void *s2, grub_size_t n); From 042484d78e5a12999aa956caa4feb55ac54a2a3a Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 25 Oct 2009 15:23:48 +0000 Subject: [PATCH 1200/1707] 2009-10-25 Robert Millan * include/grub/fs.h [GRUB_UTIL] (struct grub_fs): Add `reserved_first_sector' member. * fs/ext2.c [GRUB_UTIL] (grub_ext2_fs): Initialize `reserved_first_sector' to 1. * fs/fat.c [GRUB_UTIL] (grub_fat_fs): Likewise. * fs/ntfs.c [GRUB_UTIL] (grub_ntfs_fs): Likewise. * fs/hfsplus.c [GRUB_UTIL] (grub_hfsplus_fs): Likewise. * util/i386/pc/grub-setup.c (setup): Add safety check that probes for filesystems which begin at first sector. (options): New option --skip-fs-probe. (main): Handle --skip-fs-probe and pass it to setup(). --- ChangeLog | 14 ++++++++++++++ fs/ext2.c | 3 +++ fs/fat.c | 3 +++ fs/hfsplus.c | 3 +++ fs/ntfs.c | 22 +++++++++++++--------- include/grub/fs.h | 5 +++++ util/i386/pc/grub-setup.c | 29 +++++++++++++++++++++++++---- 7 files changed, 66 insertions(+), 13 deletions(-) diff --git a/ChangeLog b/ChangeLog index daee3ea4c..81f3ba601 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,17 @@ +2009-10-25 Robert Millan + + * include/grub/fs.h [GRUB_UTIL] (struct grub_fs): Add + `reserved_first_sector' member. + * fs/ext2.c [GRUB_UTIL] (grub_ext2_fs): Initialize + `reserved_first_sector' to 1. + * fs/fat.c [GRUB_UTIL] (grub_fat_fs): Likewise. + * fs/ntfs.c [GRUB_UTIL] (grub_ntfs_fs): Likewise. + * fs/hfsplus.c [GRUB_UTIL] (grub_hfsplus_fs): Likewise. + * util/i386/pc/grub-setup.c (setup): Add safety check that probes for + filesystems which begin at first sector. + (options): New option --skip-fs-probe. + (main): Handle --skip-fs-probe and pass it to setup(). + 2009-10-25 Robert Millan * include/grub/misc.h: Fix wrong evaluation of APPLE_CC. diff --git a/fs/ext2.c b/fs/ext2.c index 8d8c6939e..e7a20a43b 100644 --- a/fs/ext2.c +++ b/fs/ext2.c @@ -927,6 +927,9 @@ static struct grub_fs grub_ext2_fs = .label = grub_ext2_label, .uuid = grub_ext2_uuid, .mtime = grub_ext2_mtime, +#ifdef GRUB_UTIL + .reserved_first_sector = 1, +#endif .next = 0 }; diff --git a/fs/fat.c b/fs/fat.c index 8440e43fa..e7f01629e 100644 --- a/fs/fat.c +++ b/fs/fat.c @@ -855,6 +855,9 @@ static struct grub_fs grub_fat_fs = .close = grub_fat_close, .label = grub_fat_label, .uuid = grub_fat_uuid, +#ifdef GRUB_UTIL + .reserved_first_sector = 1, +#endif .next = 0 }; diff --git a/fs/hfsplus.c b/fs/hfsplus.c index 5e0ab093f..b306e8d6a 100644 --- a/fs/hfsplus.c +++ b/fs/hfsplus.c @@ -1021,6 +1021,9 @@ static struct grub_fs grub_hfsplus_fs = .label = grub_hfsplus_label, .mtime = grub_hfsplus_mtime, .uuid = grub_hfsplus_uuid, +#ifdef GRUB_UTIL + .reserved_first_sector = 1, +#endif .next = 0 }; diff --git a/fs/ntfs.c b/fs/ntfs.c index f1d0a374e..163f3e0a8 100644 --- a/fs/ntfs.c +++ b/fs/ntfs.c @@ -1081,15 +1081,19 @@ grub_ntfs_uuid (grub_device_t device, char **uuid) return grub_errno; } -static struct grub_fs grub_ntfs_fs = { - .name = "ntfs", - .dir = grub_ntfs_dir, - .open = grub_ntfs_open, - .read = grub_ntfs_read, - .close = grub_ntfs_close, - .label = grub_ntfs_label, - .uuid = grub_ntfs_uuid, - .next = 0 +static struct grub_fs grub_ntfs_fs = + { + .name = "ntfs", + .dir = grub_ntfs_dir, + .open = grub_ntfs_open, + .read = grub_ntfs_read, + .close = grub_ntfs_close, + .label = grub_ntfs_label, + .uuid = grub_ntfs_uuid, +#ifdef GRUB_UTIL + .reserved_first_sector = 1, +#endif + .next = 0 }; GRUB_MOD_INIT (ntfs) diff --git a/include/grub/fs.h b/include/grub/fs.h index 41732e48d..132ab4755 100644 --- a/include/grub/fs.h +++ b/include/grub/fs.h @@ -68,6 +68,11 @@ struct grub_fs /* Get writing time of filesystem. */ grub_err_t (*mtime) (grub_device_t device, grub_int32_t *timebuf); +#ifdef GRUB_UTIL + /* Whether this filesystem reserves first sector for DOS-style boot. */ + int reserved_first_sector; +#endif + /* The next filesystem. */ struct grub_fs *next; }; diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index ccfbd1d25..5a46e9e24 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -86,7 +86,7 @@ grub_refresh (void) static void setup (const char *dir, const char *boot_file, const char *core_file, - const char *root, const char *dest, int must_embed, int force) + const char *root, const char *dest, int must_embed, int force, int fs_probe) { char *boot_path, *core_path, *core_path_dev; char *boot_img, *core_img; @@ -251,6 +251,21 @@ setup (const char *dir, if (grub_disk_read (dest_dev->disk, 0, 0, GRUB_DISK_SECTOR_SIZE, tmp_img)) grub_util_error ("%s", grub_errmsg); + if (dest_dev->disk->partition && fs_probe) + { + grub_fs_t fs; + fs = grub_fs_probe (dest_dev); + if (! fs) + grub_util_error ("Unable to identify a filesystem in %s; safety check can't be performed."); + + if (! fs->reserved_first_sector) + grub_util_error ("%s appears to contain a %s filesystem which isn't known to " + "reserve space for DOS-style boot. Installing GRUB there could " + "result in FILESYSTEM DESTRUCTION if valuable data is overwritten " + "by grub-setup (--skip-fs-probe disables this " + "check, use at your own risk).", dest_dev->disk->name, fs->name); + } + /* Copy the possible DOS BPB. */ memcpy (boot_img + GRUB_BOOT_MACHINE_BPB_START, tmp_img + GRUB_BOOT_MACHINE_BPB_START, @@ -556,6 +571,7 @@ static struct option options[] = {"device-map", required_argument, 0, 'm'}, {"root-device", required_argument, 0, 'r'}, {"force", no_argument, 0, 'f'}, + {"skip-fs-probe", no_argument, 0, 's'}, {"help", no_argument, 0, 'h'}, {"version", no_argument, 0, 'V'}, {"verbose", no_argument, 0, 'v'}, @@ -580,6 +596,7 @@ DEVICE must be a GRUB device (e.g. ``(hd0,1)'').\n\ -m, --device-map=FILE use FILE as the device map [default=%s]\n\ -r, --root-device=DEV use DEV as the root device [default=guessed]\n\ -f, --force install even if problems are detected\n\ + -s, --skip-fs-probe do not probe for filesystems in DEVICE\n\ -h, --help display this message and exit\n\ -V, --version print version information and exit\n\ -v, --verbose print verbose messages\n\ @@ -613,7 +630,7 @@ main (int argc, char *argv[]) char *dev_map = 0; char *root_dev = 0; char *dest_dev; - int must_embed = 0, force = 0; + int must_embed = 0, force = 0, fs_probe = 1; progname = "grub-setup"; @@ -666,6 +683,10 @@ main (int argc, char *argv[]) force = 1; break; + case 's': + fs_probe = 0; + break; + case 'h': usage (0); break; @@ -767,7 +788,7 @@ main (int argc, char *argv[]) setup (dir ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, - root_dev, grub_util_get_grub_dev (devicelist[i]), 1, force); + root_dev, grub_util_get_grub_dev (devicelist[i]), 1, force, fs_probe); } } else @@ -776,7 +797,7 @@ main (int argc, char *argv[]) setup (dir ? : DEFAULT_DIRECTORY, boot_file ? : DEFAULT_BOOT_FILE, core_file ? : DEFAULT_CORE_FILE, - root_dev, dest_dev, must_embed, force); + root_dev, dest_dev, must_embed, force, fs_probe); /* Free resources. */ grub_fini_all (); From 4dea1c6f063c5af8a50a8481c0e2ce713190897d Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 25 Oct 2009 17:49:27 +0000 Subject: [PATCH 1201/1707] 2009-10-25 Robert Millan * util/i386/pc/grub-setup.c (setup): Add missing parameter to grub_util_error() call. --- ChangeLog | 5 +++++ util/i386/pc/grub-setup.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 81f3ba601..123a52cb6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-25 Robert Millan + + * util/i386/pc/grub-setup.c (setup): Add missing parameter to + grub_util_error() call. + 2009-10-25 Robert Millan * include/grub/fs.h [GRUB_UTIL] (struct grub_fs): Add diff --git a/util/i386/pc/grub-setup.c b/util/i386/pc/grub-setup.c index 5a46e9e24..c536be0c4 100644 --- a/util/i386/pc/grub-setup.c +++ b/util/i386/pc/grub-setup.c @@ -256,7 +256,8 @@ setup (const char *dir, grub_fs_t fs; fs = grub_fs_probe (dest_dev); if (! fs) - grub_util_error ("Unable to identify a filesystem in %s; safety check can't be performed."); + grub_util_error ("Unable to identify a filesystem in %s; safety check can't be performed.", + dest_dev->disk->name); if (! fs->reserved_first_sector) grub_util_error ("%s appears to contain a %s filesystem which isn't known to " From ee3756ccb3f14b7a3f7d5a967dea15b4104f97c5 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 00:38:26 +0000 Subject: [PATCH 1202/1707] 2009-10-26 Robert Millan * util/grub.d/10_freebsd.in: Remove. --- ChangeLog | 4 +++ util/grub.d/10_freebsd.in | 76 --------------------------------------- 2 files changed, 4 insertions(+), 76 deletions(-) delete mode 100644 util/grub.d/10_freebsd.in diff --git a/ChangeLog b/ChangeLog index 123a52cb6..597dcafcb 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-26 Robert Millan + + * util/grub.d/10_freebsd.in: Remove. + 2009-10-25 Robert Millan * util/i386/pc/grub-setup.c (setup): Add missing parameter to diff --git a/util/grub.d/10_freebsd.in b/util/grub.d/10_freebsd.in deleted file mode 100644 index 02694d3e7..000000000 --- a/util/grub.d/10_freebsd.in +++ /dev/null @@ -1,76 +0,0 @@ -#! /bin/sh -e - -# grub-mkconfig helper script. -# Copyright (C) 2008,2009 Free Software Foundation, Inc. -# -# GRUB is free software: you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation, either version 3 of the License, or -# (at your option) any later version. -# -# GRUB is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with GRUB. If not, see . - -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -. ${libdir}/grub/grub-mkconfig_lib - -case "${GRUB_DISTRIBUTOR}" in - Debian) OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD" ;; - *) OS="FreeBSD" ;; -esac - -if test -e /boot/device.hints ; then - devices=/boot/device.hints -fi - -if test -e /boot/kernel/kernel ; then - kfreebsd=/boot/kernel/kernel -fi -if test -e /boot/kernel/kernel.gz ; then - kfreebsd=/boot/kernel/kernel.gz -fi - -if [ "x$kfreebsd" != "x" ] ; then - echo "Found kernel of FreeBSD: $kfreebsd" >&2 - - kfreebsd_basename=`basename $kfreebsd` - kfreebsd_dirname=`dirname $kfreebsd` - kfreebsd_rel_dirname=`make_system_path_relative_to_its_root $kfreebsd_dirname` - - if [ x"$devices" != "x" ] ; then - devices_basename=`basename $devices` - devices_dirname=`dirname $devices` - devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` - fi - - case ${GRUB_FS} in - ufs1 | ufs2) kfreebsd_fs=ufs ;; - *) kfreebsd_fs=${GRUB_FS} ;; - esac - - cat << EOF -menuentry "${OS}" { -EOF - prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" - cat << EOF - kfreebsd ${kfreebsd_rel_dirname}/${kfreebsd_basename} -EOF - - if [ x"$devices" != "x" ] ; then - cat << EOF - kfreebsd_loadenv ${devices_rel_dirname}/${devices_basename} -EOF - fi - cat << EOF - set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} - set kFreeBSD.vfs.root.mountfrom.options=rw -} -EOF -fi From 5c35048e23a02f91b7b910645e8b80993b65eab3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 00:38:38 +0000 Subject: [PATCH 1203/1707] 2009-10-26 Robert Millan * docs/grub.cfg: Fix example usage of *BSD loaders. --- ChangeLog | 2 +- docs/grub.cfg | 14 +++++++------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 597dcafcb..8a3c0dcb7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,6 +1,6 @@ 2009-10-26 Robert Millan - * util/grub.d/10_freebsd.in: Remove. + * docs/grub.cfg: Fix example usage of *BSD loaders. 2009-10-25 Robert Millan diff --git a/docs/grub.cfg b/docs/grub.cfg index 0a9ab6bc7..e14cdb776 100644 --- a/docs/grub.cfg +++ b/docs/grub.cfg @@ -34,26 +34,26 @@ menuentry "GNU/Linux" { # For booting FreeBSD menuentry "FreeBSD (or GNU/kFreeBSD), direct boot" { set root=(hd0,1,a) - freebsd /boot/kernel/kernel - freebsd_loadenv /boot/device.hints - freebsd_module /boot/splash.bmp type=splash_image_data - set FreeBSD.vfs.root.mountfrom=ufs:ad0s1a + kfreebsd /boot/kernel/kernel + kfreebsd_loadenv /boot/device.hints + kfreebsd_module /boot/splash.bmp type=splash_image_data + set kFreeBSD.vfs.root.mountfrom=ufs:ad0s1a } menuentry "FreeBSD (or GNU/kFreeBSD), via /boot/loader" { set root=(hd0,1,a) - freebsd /boot/loader + kfreebsd /boot/loader } # For booting NetBSD menuentry "NetBSD" { set root=(hd0,1,a) - netbsd /netbsd + knetbsd /netbsd } # For booting OpenBSD menuentry "OpenBSD" { set root=(hd0,1,a) - openbsd /bsd + kopenbsd /bsd } # For booting Microsoft Windows From 67937d4dca09e70d2d0a4ff72629ae1340355451 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 00:41:54 +0000 Subject: [PATCH 1204/1707] 2009-10-26 Robert Millan * util/grub.d/10_freebsd.in: Remove. * util/grub.d/10_kfreebsd.in: New file (based on 10_linux.in). * configure.ac: Set host_kernel=kfreebsd for FreeBSD and GNU/kFreeBSD. --- ChangeLog | 6 +++ configure.ac | 2 +- util/grub.d/10_kfreebsd.in | 102 +++++++++++++++++++++++++++++++++++++ 3 files changed, 109 insertions(+), 1 deletion(-) create mode 100644 util/grub.d/10_kfreebsd.in diff --git a/ChangeLog b/ChangeLog index 8a3c0dcb7..6ca49a0e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-26 Robert Millan + + * util/grub.d/10_freebsd.in: Remove. + * util/grub.d/10_kfreebsd.in: New file (based on 10_linux.in). + * configure.ac: Set host_kernel=kfreebsd for FreeBSD and GNU/kFreeBSD. + 2009-10-26 Robert Millan * docs/grub.cfg: Fix example usage of *BSD loaders. diff --git a/configure.ac b/configure.ac index 048333ba5..4bd28f2e8 100644 --- a/configure.ac +++ b/configure.ac @@ -107,7 +107,7 @@ esac case "$host_os" in gnu*) host_kernel=hurd ;; linux*) host_kernel=linux ;; - freebsd* | kfreebsd*-gnu) host_kernel=freebsd ;; + freebsd* | kfreebsd*-gnu) host_kernel=kfreebsd ;; cygwin) host_kernel=windows ;; esac diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in new file mode 100644 index 000000000..1473a42a2 --- /dev/null +++ b/util/grub.d/10_kfreebsd.in @@ -0,0 +1,102 @@ +#! /bin/sh -e + +# grub-mkconfig helper script. +# Copyright (C) 2006,2007,2008,2009 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +libdir=@libdir@ +. ${libdir}/grub/grub-mkconfig_lib + +if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then + OS=GNU/Linux +else + OS="${GRUB_DISTRIBUTOR} GNU/Linux" +fi + +# loop-AES arranges things so that /dev/loop/X can be our root device, but +# the initrds that Linux uses don't like that. +case ${GRUB_DEVICE} in + /dev/loop/*|/dev/loop[0-9]) + GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` + ;; +esac + +if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ + || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then + LINUX_ROOT_DEVICE=${GRUB_DEVICE} +else + LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} +fi + +linux_entry () +{ + cat << EOF +menuentry "$1" { +EOF + prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + cat << EOF + linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2 +EOF + if test -n "${initrd}" ; then + cat << EOF + initrd ${rel_dirname}/${initrd} +EOF + fi + cat << EOF +} +EOF +} + +list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do + if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi + done` + +while [ "x$list" != "x" ] ; do + linux=`version_find_latest $list` + echo "Found linux image: $linux" >&2 + basename=`basename $linux` + dirname=`dirname $linux` + rel_dirname=`make_system_path_relative_to_its_root $dirname` + version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` + alt_version=`echo $version | sed -e "s,\.old$,,g"` + linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" + + initrd= + for i in "initrd.img-${version}" "initrd-${version}.img" \ + "initrd-${version}" "initrd.img-${alt_version}" \ + "initrd-${alt_version}.img" "initrd-${alt_version}"; do + if test -e "${dirname}/${i}" ; then + initrd="$i" + break + fi + done + if test -n "${initrd}" ; then + echo "Found initrd image: ${dirname}/${initrd}" >&2 + else + # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. + linux_root_device_thisversion=${GRUB_DEVICE} + fi + + linux_entry "${OS}, with Linux ${version}" \ + "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" + if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then + linux_entry "${OS}, with Linux ${version} (recovery mode)" \ + "single ${GRUB_CMDLINE_LINUX}" + fi + + list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` +done From ba36be41191d89f225a4b981ffcad474955f48e6 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 00:41:58 +0000 Subject: [PATCH 1205/1707] 2009-10-26 Robert Millan * util/grub.d/10_freebsd.in: Remove. * util/grub.d/10_kfreebsd.in: New file (based on 10_linux.in). * configure.ac: Set host_kernel=kfreebsd for FreeBSD and GNU/kFreeBSD. --- util/grub.d/10_kfreebsd.in | 98 +++++++++++++++++++------------------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in index 1473a42a2..4fb704c49 100644 --- a/util/grub.d/10_kfreebsd.in +++ b/util/grub.d/10_kfreebsd.in @@ -21,82 +21,82 @@ exec_prefix=@exec_prefix@ libdir=@libdir@ . ${libdir}/grub/grub-mkconfig_lib -if [ "x${GRUB_DISTRIBUTOR}" = "x" ] ; then - OS=GNU/Linux -else - OS="${GRUB_DISTRIBUTOR} GNU/Linux" -fi - -# loop-AES arranges things so that /dev/loop/X can be our root device, but -# the initrds that Linux uses don't like that. -case ${GRUB_DEVICE} in - /dev/loop/*|/dev/loop[0-9]) - GRUB_DEVICE=`losetup ${GRUB_DEVICE} | sed -e "s/^[^(]*(\([^)]\+\)).*/\1/"` - ;; +case "${GRUB_DISTRIBUTOR}" in + Debian) OS="${GRUB_DISTRIBUTOR} GNU/kFreeBSD" ;; + *) OS="FreeBSD" ;; esac -if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \ - || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" ; then - LINUX_ROOT_DEVICE=${GRUB_DEVICE} -else - LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} -fi - -linux_entry () +kfreebsd_entry () { cat << EOF menuentry "$1" { EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF - linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2 + kfreebsd ${rel_dirname}/${basename} EOF - if test -n "${initrd}" ; then + + if test -n "${devices}" ; then cat << EOF - initrd ${rel_dirname}/${initrd} + kfreebsd_loadenv ${devices_rel_dirname}/${devices_basename} EOF fi + + if test -n "${acpi_ko}" ; then + cat << EOF + kfreebsd_module_elf ${acpi_ko_rel_dirname}/${acpi_ko_basename} +EOF + fi + cat << EOF + set kFreeBSD.vfs.root.mountfrom=${kfreebsd_fs}:${GRUB_DEVICE} + set kFreeBSD.vfs.root.mountfrom.options=rw } EOF } -list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do +list=`for i in /boot/kfreebsd-* /boot/kernel/kernel ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` while [ "x$list" != "x" ] ; do - linux=`version_find_latest $list` - echo "Found linux image: $linux" >&2 - basename=`basename $linux` - dirname=`dirname $linux` + kfreebsd=`version_find_latest $list` + echo "Found kernel of FreeBSD: $kfreebsd" >&2 + basename=`basename $kfreebsd` + dirname=`dirname $kfreebsd` rel_dirname=`make_system_path_relative_to_its_root $dirname` - version=`echo $basename | sed -e "s,^[^0-9]*-,,g"` - alt_version=`echo $version | sed -e "s,\.old$,,g"` - linux_root_device_thisversion="${LINUX_ROOT_DEVICE}" - initrd= - for i in "initrd.img-${version}" "initrd-${version}.img" \ - "initrd-${version}" "initrd.img-${alt_version}" \ - "initrd-${alt_version}.img" "initrd-${alt_version}"; do - if test -e "${dirname}/${i}" ; then - initrd="$i" + if [ -f /boot/device.hints ] ; then + devices=/boot/device.hints + devices_basename=`basename $devices` + devices_dirname=`dirname $devices` + devices_rel_dirname=`make_system_path_relative_to_its_root $devices_dirname` + fi + + case ${GRUB_FS} in + ufs1 | ufs2) kfreebsd_fs=ufs ;; + *) kfreebsd_fs=${GRUB_FS} ;; + esac + + version=`echo $basename | sed -e "s,^[^0-9]*-,,g;s/\.gz$//g"` + alt_version=`echo $version | sed -e "s,\.old$,,g"` + + acpi_ko= + for i in "/lib/modules/${version}/acpi.ko" "/lib/modules/${alt_version}/acpi.ko" \ + "/boot/kernel/acpi.ko"; do + if test -e "$i" ; then + acpi_ko="$i" break fi done - if test -n "${initrd}" ; then - echo "Found initrd image: ${dirname}/${initrd}" >&2 - else - # "UUID=" magic is parsed by initrds. Since there's no initrd, it can't work here. - linux_root_device_thisversion=${GRUB_DEVICE} + if test -n "${acpi_ko}" ; then + echo "Found ACPI module: ${acpi_ko}" >&2 + acpi_ko_basename=`basename ${acpi_ko}` + acpi_ko_dirname=`dirname ${acpi_ko}` + acpi_ko_rel_dirname=`make_system_path_relative_to_its_root $acpi_ko_dirname` fi - linux_entry "${OS}, with Linux ${version}" \ - "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" - if [ "x${GRUB_DISABLE_LINUX_RECOVERY}" != "xtrue" ]; then - linux_entry "${OS}, with Linux ${version} (recovery mode)" \ - "single ${GRUB_CMDLINE_LINUX}" - fi + kfreebsd_entry "${OS}, kFreeBSD ${version}" - list=`echo $list | tr ' ' '\n' | grep -vx $linux | tr '\n' ' '` + list=`echo $list | tr ' ' '\n' | grep -vx $kfreebsd | tr '\n' ' '` done From e4f6809bbc51ceac3eea354a3f264b3cf0c483d3 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 26 Oct 2009 16:28:04 +0000 Subject: [PATCH 1206/1707] 2009-10-26 Colin Watson Improve grub-mkconfig performance when there are several menu entries on a single filesystem. * util/grub.d/10_linux.in (linux_entry): Cache the output of prepare_grub_to_access_device. * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise. * util/grub.d/30_os-prober.in: Likewise. --- ChangeLog | 10 ++++++++++ util/grub.d/10_kfreebsd.in | 6 +++++- util/grub.d/10_linux.in | 6 +++++- util/grub.d/30_os-prober.in | 6 +++++- 4 files changed, 25 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 6ca49a0e2..e7e01fa37 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-10-26 Colin Watson + + Improve grub-mkconfig performance when there are several menu + entries on a single filesystem. + + * util/grub.d/10_linux.in (linux_entry): Cache the output of + prepare_grub_to_access_device. + * util/grub.d/10_kfreebsd.in (kfreebsd_entry): Likewise. + * util/grub.d/30_os-prober.in: Likewise. + 2009-10-26 Robert Millan * util/grub.d/10_freebsd.in: Remove. diff --git a/util/grub.d/10_kfreebsd.in b/util/grub.d/10_kfreebsd.in index 4fb704c49..cd8c186be 100644 --- a/util/grub.d/10_kfreebsd.in +++ b/util/grub.d/10_kfreebsd.in @@ -31,7 +31,10 @@ kfreebsd_entry () cat << EOF menuentry "$1" { EOF - prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" + fi + printf '%s\n' "${prepare_boot_cache}" cat << EOF kfreebsd ${rel_dirname}/${basename} EOF @@ -58,6 +61,7 @@ EOF list=`for i in /boot/kfreebsd-* /boot/kernel/kernel ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` +prepare_boot_cache= while [ "x$list" != "x" ] ; do kfreebsd=`version_find_latest $list` diff --git a/util/grub.d/10_linux.in b/util/grub.d/10_linux.in index 1473a42a2..f17955846 100644 --- a/util/grub.d/10_linux.in +++ b/util/grub.d/10_linux.in @@ -47,7 +47,10 @@ linux_entry () cat << EOF menuentry "$1" { EOF - prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/")" + fi + printf '%s\n' "${prepare_boot_cache}" cat << EOF linux ${rel_dirname}/${basename} root=${linux_root_device_thisversion} ro $2 EOF @@ -64,6 +67,7 @@ EOF list=`for i in /boot/vmlinu[xz]-* /vmlinu[xz]-* ; do if grub_file_is_not_garbage "$i" ; then echo -n "$i " ; fi done` +prepare_boot_cache= while [ "x$list" != "x" ] ; do linux=`version_find_latest $list` diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 84e227ee7..6fd97fc4e 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -74,6 +74,7 @@ EOF ;; linux) LINUXPROBED="`linux-boot-prober ${DEVICE} 2> /dev/null | tr ' ' '^' | paste -s -d ' '`" + prepare_boot_cache= for LINUX in ${LINUXPROBED} ; do LROOT="`echo ${LINUX} | cut -d ':' -f 1`" @@ -90,7 +91,10 @@ EOF cat << EOF menuentry "${LLABEL} (on ${DEVICE})" { EOF - prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + if [ -z "${prepare_boot_cache}" ]; then + prepare_boot_cache="$(prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/")" + fi + printf '%s\n' "${prepare_boot_cache}" cat << EOF linux ${LKERNEL} ${LPARAMS} EOF From 9031b03aaca8c601f60e13ab5cc9f032094cb119 Mon Sep 17 00:00:00 2001 From: cjwatson Date: Mon, 26 Oct 2009 16:33:13 +0000 Subject: [PATCH 1207/1707] 2009-10-26 Colin Watson * util/grub-editenv.c (main): If only a command is given, use DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG as a default file name. (usage): FILENAME is now optional and has a default. --- ChangeLog | 6 ++++++ util/grub-editenv.c | 19 ++++++++++++------- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index e7e01fa37..ab7ccf39c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-26 Colin Watson + + * util/grub-editenv.c (main): If only a command is given, use + DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG as a default file name. + (usage): FILENAME is now optional and has a default. + 2009-10-26 Colin Watson Improve grub-mkconfig performance when there are several menu diff --git a/util/grub-editenv.c b/util/grub-editenv.c index a8dc137c5..5b688d9cb 100644 --- a/util/grub-editenv.c +++ b/util/grub-editenv.c @@ -72,7 +72,7 @@ usage (int status) fprintf (stderr, "Try ``grub-editenv --help'' for more information.\n"); else printf ("\ -Usage: grub-editenv [OPTIONS] FILENAME COMMAND\n\ +Usage: grub-editenv [OPTIONS] [FILENAME] COMMAND\n\ \n\ Tool to edit environment block.\n\ \nCommands:\n\ @@ -85,7 +85,10 @@ Tool to edit environment block.\n\ -V, --version print version information and exit\n\ -v, --verbose print verbose messages\n\ \n\ -Report bugs to <%s>.\n", PACKAGE_BUGREPORT); +If not given explicitly, FILENAME defaults to %s.\n\ +\n\ +Report bugs to <%s>.\n", +DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG, PACKAGE_BUGREPORT); exit (status); } @@ -288,12 +291,14 @@ main (int argc, char *argv[]) if (optind + 1 >= argc) { - fprintf (stderr, "no command specified\n"); - usage (1); + filename = DEFAULT_DIRECTORY "/" GRUB_ENVBLK_DEFCFG; + command = argv[optind]; + } + else + { + filename = argv[optind]; + command = argv[optind + 1]; } - - filename = argv[optind]; - command = argv[optind + 1]; if (strcmp (command, "create") == 0) create_envblk_file (filename); From 94180ff6c7166b80ca18ef30587abc372e0e30fd Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 18:02:19 +0000 Subject: [PATCH 1208/1707] 2009-10-26 Robert Millan * conf/i386-coreboot.rmk (script/sh/lexer.c_DEPENDENCIES): Moved from here ... * conf/common.rmk (script/sh/lexer.c_DEPENDENCIES): ... to here. * conf/i386-efi.rmk (script/sh/lexer.c_DEPENDENCIES): Remove. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. --- ChangeLog | 12 ++++++++++++ conf/common.rmk | 2 ++ conf/i386-coreboot.rmk | 1 - conf/i386-efi.rmk | 1 - conf/i386-ieee1275.rmk | 1 - conf/i386-pc.rmk | 1 - conf/powerpc-ieee1275.rmk | 1 - conf/sparc64-ieee1275.rmk | 1 - conf/x86_64-efi.rmk | 1 - 9 files changed, 14 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ab7ccf39c..5a1a7b35e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2009-10-26 Robert Millan + + * conf/i386-coreboot.rmk (script/sh/lexer.c_DEPENDENCIES): Moved + from here ... + * conf/common.rmk (script/sh/lexer.c_DEPENDENCIES): ... to here. + * conf/i386-efi.rmk (script/sh/lexer.c_DEPENDENCIES): Remove. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-pc.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + 2009-10-26 Colin Watson * util/grub-editenv.c (main): If only a command is given, use diff --git a/conf/common.rmk b/conf/common.rmk index c1f0bbdcf..ce7c33084 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -1,5 +1,7 @@ # -*- makefile -*- +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h + # For grub-mkelfimage. bin_UTILITIES += grub-mkelfimage grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 09ec7787c..3c2061b4e 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -5,7 +5,6 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 99ab06f64..0440359e5 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -5,7 +5,6 @@ COMMON_CFLAGS = -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386 -nostdlib # Used by various components. These rules need to precede them. -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index 4b640de49..c70ecf4dd 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -5,7 +5,6 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib # Used by various components. These rules need to precede them. -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.img diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index bf8fbfb9d..30847dfa7 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -7,7 +7,6 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index ee7f9ec27..9165e4bc0 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -6,7 +6,6 @@ COMMON_CFLAGS = -ffreestanding COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 62e951a5e..1156fe2a9 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -6,7 +6,6 @@ COMMON_CFLAGS = -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -nostdlib -mno-relax # Used by various components. These rules need to precede them. -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 5be1b404f..173227575 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -5,7 +5,6 @@ COMMON_CFLAGS = -fno-builtin -m64 COMMON_LDFLAGS = -melf_x86_64 -nostdlib # Used by various components. These rules need to precede them. -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage From 5947ae32f588d62077cbf341382a78fc9efc2f5b Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 18:02:30 +0000 Subject: [PATCH 1209/1707] 2009-10-26 Robert Millan * Makefile.in (docs/grub.info): Use make syntax to ignore errors in $(MAKEINFO) invocation. This makes it clear in output that errors are being ignored. --- ChangeLog | 6 ++++++ Makefile.in | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5a1a7b35e..2a9c04844 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-26 Robert Millan + + * Makefile.in (docs/grub.info): Use make syntax to ignore errors + in $(MAKEINFO) invocation. This makes it clear in output that + errors are being ignored. + 2009-10-26 Robert Millan * conf/i386-coreboot.rmk (script/sh/lexer.c_DEPENDENCIES): Moved diff --git a/Makefile.in b/Makefile.in index e0edbdb04..80ed07124 100644 --- a/Makefile.in +++ b/Makefile.in @@ -197,7 +197,7 @@ docs/stamp-vti: docs/grub.texi configure.ac # Use --force until such time as the documentation is cleaned up. docs/grub.info: docs/grub.texi docs/version.texi docs/fdl.texi $(MKDIR_P) docs - $(MAKEINFO) -P $(builddir)/docs --no-split --force $< -o $@ || : + -$(MAKEINFO) -P $(builddir)/docs --no-split --force $< -o $@ ifeq (, $(UNIFONT_BDF)) else From 083d16798e9ab51e3b2cd7fb94c7e960bb92f8de Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 18:04:37 +0000 Subject: [PATCH 1210/1707] 2009-10-26 Robert Millan * gensymlist.sh.in (COMPILE_TIME_ASSERT): Copy macro declaration from here ... * include/grub/misc.h (COMPILE_TIME_ASSERT): ... to here. --- ChangeLog | 6 ++++++ include/grub/misc.h | 1 + 2 files changed, 7 insertions(+) diff --git a/ChangeLog b/ChangeLog index 2a9c04844..afe67af2b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-26 Robert Millan + + * gensymlist.sh.in (COMPILE_TIME_ASSERT): Copy macro declaration + from here ... + * include/grub/misc.h (COMPILE_TIME_ASSERT): ... to here. + 2009-10-26 Robert Millan * Makefile.in (docs/grub.info): Use make syntax to ignore errors diff --git a/include/grub/misc.h b/include/grub/misc.h index 7589f43a2..e3a062898 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -28,6 +28,7 @@ #define ALIGN_UP(addr, align) \ ((addr + (typeof (addr)) align - 1) & ~((typeof (addr)) align - 1)) #define ARRAY_SIZE(array) (sizeof (array) / sizeof (array[0])) +#define COMPILE_TIME_ASSERT(cond) switch (0) { case 1: case !(cond): ; } #define grub_dprintf(condition, fmt, args...) grub_real_dprintf(__FILE__, __LINE__, condition, fmt, ## args) /* XXX: If grub_memmove is too slow, we must implement grub_memcpy. */ From 478df40933d8acb1e6cdae9af4b7eb70cb3ee983 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 18:06:23 +0000 Subject: [PATCH 1211/1707] 2009-10-26 Robert Millan * disk/scsi.c: Remove `' (not needed). --- ChangeLog | 4 ++++ disk/scsi.c | 1 - 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index afe67af2b..769e4fb2a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-26 Robert Millan + + * disk/scsi.c: Remove `' (not needed). + 2009-10-26 Robert Millan * gensymlist.sh.in (COMPILE_TIME_ASSERT): Copy macro declaration diff --git a/disk/scsi.c b/disk/scsi.c index 24ebdb6cd..d0e248511 100644 --- a/disk/scsi.c +++ b/disk/scsi.c @@ -23,7 +23,6 @@ #include #include #include -#include #include #include From 0579b753d611588a50604934253c32e4abb33455 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 18:25:02 +0000 Subject: [PATCH 1212/1707] 2009-10-26 Robert Millan * Makefile.in (RMKFILES): Rewrite using $(wildcard). --- ChangeLog | 4 ++++ Makefile.in | 4 +--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index 769e4fb2a..1e05f770e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-26 Robert Millan + + * Makefile.in (RMKFILES): Rewrite using $(wildcard). + 2009-10-26 Robert Millan * disk/scsi.c: Remove `' (not needed). diff --git a/Makefile.in b/Makefile.in index 80ed07124..bde80889b 100644 --- a/Makefile.in +++ b/Makefile.in @@ -115,9 +115,7 @@ enable_efiemu = @enable_efiemu@ ### General variables. -RMKFILES = $(addprefix conf/,common.rmk i386-coreboot.rmk i386-efi.rmk \ - i386-qemu.rmk i386-ieee1275.rmk i386-pc.rmk i386.rmk powerpc-ieee1275.rmk \ - sparc64-ieee1275.rmk x86_64-efi.rmk) +RMKFILES = $(wildcard conf/*.rmk) MKFILES = $(patsubst %.rmk,%.mk,$(RMKFILES)) From ed96ab6d201e50fbeb7833f7d85e0a1182a62f40 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 19:39:35 +0000 Subject: [PATCH 1213/1707] 2009-10-26 Robert Millan * gendistlist.sh: Simplify .svn check. Skip .bzr as well. --- ChangeLog | 4 ++++ gendistlist.sh | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1e05f770e..b59e2d945 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-26 Robert Millan + + * gendistlist.sh: Simplify .svn check. Skip .bzr as well. + 2009-10-26 Robert Millan * Makefile.in (RMKFILES): Rewrite using $(wildcard). diff --git a/gendistlist.sh b/gendistlist.sh index 7f6c32a44..36685a092 100644 --- a/gendistlist.sh +++ b/gendistlist.sh @@ -35,7 +35,7 @@ dir=`dirname $0` cd $dir for dir in $DISTDIRS; do - for d in `find $dir -type d | sed '/\/\.svn$/d;\/\.svn\//d' | sort`; do + for d in `find $dir -type d -not -name .svn -not -name .bzr | sort`; do find $d -maxdepth 1 -name '*.[chSy]' -o -name '*.mk' -o -name '*.rmk' \ -o -name '*.rb' -o -name '*.in' -o -name '*.tex' -o -name '*.texi' \ -o -name '*.info' -o -name 'grub.cfg' -o -name 'README' \ From cefabfe1c4fb58877770034db338d850d2e6f0b9 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 26 Oct 2009 20:04:43 +0000 Subject: [PATCH 1214/1707] 2009-10-26 Robert Millan * autogen.sh: Support addition of external modules via `GRUB_CONTRIB' variable. * Makefile.in: Likewise. --- ChangeLog | 6 ++++++ Makefile.in | 3 +++ autogen.sh | 6 ++++-- 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b59e2d945..56ff263ed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-10-26 Robert Millan + + * autogen.sh: Support addition of external modules via `GRUB_CONTRIB' + variable. + * Makefile.in: Likewise. + 2009-10-26 Robert Millan * gendistlist.sh: Simplify .svn check. Skip .bzr as well. diff --git a/Makefile.in b/Makefile.in index bde80889b..f99bc3c2a 100644 --- a/Makefile.in +++ b/Makefile.in @@ -148,6 +148,9 @@ $(addprefix $(srcdir)/,$(MKFILES)): %.mk: %.rmk genmk.rb include $(srcdir)/conf/$(target_cpu)-$(platform).mk +# For external modules. +-include $(wildcard $(GRUB_CONTRIB)/*/conf/common.mk) + ### General targets. CLEANFILES += $(pkglib_DATA) $(pkgdata_DATA) diff --git a/autogen.sh b/autogen.sh index 6895de221..4fb6bf7db 100644 --- a/autogen.sh +++ b/autogen.sh @@ -5,8 +5,10 @@ set -e autoconf autoheader echo timestamp > stamp-h.in -for rmk in conf/*.rmk; do - ruby genmk.rb < $rmk > `echo $rmk | sed 's/\.rmk$/.mk/'` +for rmk in conf/*.rmk ${GRUB_CONTRIB}/*/conf/*.rmk; do + if test -e $rmk ; then + ruby genmk.rb < $rmk > `echo $rmk | sed 's/\.rmk$/.mk/'` + fi done ./gendistlist.sh > DISTLIST From fdcdde1905d36e3ff8283ae3c9b97ea1d37fde50 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 28 Oct 2009 18:24:10 +0000 Subject: [PATCH 1215/1707] 2009-10-28 Felix Zielcke * commands/acpi.c (grub_cmd_acpi): Fix the out of memory error strings. --- ChangeLog | 5 +++++ commands/acpi.c | 8 ++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 56ff263ed..1a1be5746 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-28 Felix Zielcke + + * commands/acpi.c (grub_cmd_acpi): Fix the out of memory error + strings. + 2009-10-26 Robert Millan * autogen.sh: Support addition of external modules via `GRUB_CONTRIB' diff --git a/commands/acpi.c b/commands/acpi.c index e7cb9e6b4..9cfd8ef10 100644 --- a/commands/acpi.c +++ b/commands/acpi.c @@ -552,7 +552,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, grub_free (exclude); grub_free (load_only); return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "Could allocate table"); + "Couldn't allocate table"); } grub_memcpy (table_dsdt, dsdt, dsdt->length); } @@ -579,7 +579,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, grub_free (exclude); grub_free (load_only); return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "Could allocate table structure"); + "Couldn't allocate table structure"); } table->size = curtable->length; table->addr = grub_malloc (table->size); @@ -588,7 +588,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, { free_tables (); return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "Could allocate table"); + "Couldn't allocate table"); } table->next = acpi_tables; acpi_tables = table; @@ -675,7 +675,7 @@ grub_cmd_acpi (struct grub_extcmd *cmd, { free_tables (); return grub_error (GRUB_ERR_OUT_OF_MEMORY, - "Could allocate table structure"); + "Couldn't allocate table structure"); } table->size = size; From 2ed19dfdeda64c7319fde370b6e4e14f5ee85894 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 28 Oct 2009 22:02:54 +0000 Subject: [PATCH 1216/1707] 2009-10-28 Robert Millan * kern/i386/coreboot/init.c (grub_exit): Reimplement in a way that doesn't cause an infinite call loop. --- ChangeLog | 5 +++++ kern/i386/coreboot/init.c | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 1a1be5746..a792f04e5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-28 Robert Millan + + * kern/i386/coreboot/init.c (grub_exit): Reimplement in a way that + doesn't cause an infinite call loop. + 2009-10-28 Felix Zielcke * commands/acpi.c (grub_cmd_acpi): Fix the out of memory error diff --git a/kern/i386/coreboot/init.c b/kern/i386/coreboot/init.c index 1b9ca3815..0bf4934fb 100644 --- a/kern/i386/coreboot/init.c +++ b/kern/i386/coreboot/init.c @@ -62,7 +62,10 @@ grub_stop_floppy (void) void grub_exit (void) { - grub_fatal ("grub_exit() is not implemented.\n"); + /* We can't use grub_fatal() in this function. This would create an infinite + loop, since grub_fatal() calls grub_abort() which in turn calls grub_exit(). */ + while (1) + grub_cpu_idle (); } void From 95b9239e13de05188c989c1542b936a62b5e8c10 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 28 Oct 2009 22:55:27 +0000 Subject: [PATCH 1217/1707] 2009-10-28 Robert Millan * include/grub/misc.h: Stop checking for APPLE_CC. --- ChangeLog | 4 ++++ include/grub/misc.h | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index a792f04e5..ff7098c58 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-28 Robert Millan + + * include/grub/misc.h: Stop checking for APPLE_CC. + 2009-10-28 Robert Millan * kern/i386/coreboot/init.c (grub_exit): Reimplement in a way that diff --git a/include/grub/misc.h b/include/grub/misc.h index e3a062898..faa2d5c42 100644 --- a/include/grub/misc.h +++ b/include/grub/misc.h @@ -76,7 +76,7 @@ grub_strncat (char *dest, const char *src, int c) } /* Prototypes for aliases. */ -#if !defined (GRUB_UTIL) && !defined (APPLE_CC) +#ifndef GRUB_UTIL int EXPORT_FUNC(memcmp) (const void *s1, const void *s2, grub_size_t n); void *EXPORT_FUNC(memmove) (void *dest, const void *src, grub_size_t n); void *EXPORT_FUNC(memcpy) (void *dest, const void *src, grub_size_t n); From cee15086c312902c4e4bfe26829746b67cdd05d3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Wed, 28 Oct 2009 23:16:32 +0000 Subject: [PATCH 1218/1707] 2009-10-28 Robert Millan * Makefile.in (TARGET_CPPFLAGS): Add `-nostdinc'. --- ChangeLog | 4 ++++ Makefile.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ff7098c58..12e8932e7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-10-28 Robert Millan + + * Makefile.in (TARGET_CPPFLAGS): Add `-nostdinc'. + 2009-10-28 Robert Millan * include/grub/misc.h: Stop checking for APPLE_CC. diff --git a/Makefile.in b/Makefile.in index f99bc3c2a..103d2d3d2 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,7 @@ TARGET_ASFLAGS = @TARGET_ASFLAGS@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_APPLE_CC = @TARGET_APPLE_CC@ OBJCONV = @OBJCONV@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -nostdinc -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ From fa6e945f506c09046acebee1963398daca3b83fe Mon Sep 17 00:00:00 2001 From: robertmh Date: Thu, 29 Oct 2009 10:03:13 +0000 Subject: [PATCH 1219/1707] 2009-10-29 Robert Millan Revert SVN r2660. * conf/common.rmk (script/sh/lexer.c_DEPENDENCIES): Moved from here ... * conf/i386-coreboot.rmk (script/sh/lexer.c_DEPENDENCIES): ... to here. * conf/i386-efi.rmk (script/sh/lexer.c_DEPENDENCIES): ... and here. * conf/i386-ieee1275.rmk: Likewise. * conf/i386-pc.rmk: Likewise. * conf/powerpc-ieee1275.rmk: Likewise. * conf/sparc64-ieee1275.rmk: Likewise. * conf/x86_64-efi.rmk: Likewise. --- ChangeLog | 13 +++++++++++++ conf/common.rmk | 2 -- conf/i386-coreboot.rmk | 1 + conf/i386-efi.rmk | 1 + conf/i386-ieee1275.rmk | 1 + conf/i386-pc.rmk | 1 + conf/powerpc-ieee1275.rmk | 1 + conf/sparc64-ieee1275.rmk | 1 + conf/x86_64-efi.rmk | 1 + 9 files changed, 20 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 12e8932e7..1d504a2cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,16 @@ +2009-10-29 Robert Millan + + Revert SVN r2660. + + * conf/common.rmk (script/sh/lexer.c_DEPENDENCIES): Moved from here ... + * conf/i386-coreboot.rmk (script/sh/lexer.c_DEPENDENCIES): ... to here. + * conf/i386-efi.rmk (script/sh/lexer.c_DEPENDENCIES): ... and here. + * conf/i386-ieee1275.rmk: Likewise. + * conf/i386-pc.rmk: Likewise. + * conf/powerpc-ieee1275.rmk: Likewise. + * conf/sparc64-ieee1275.rmk: Likewise. + * conf/x86_64-efi.rmk: Likewise. + 2009-10-28 Robert Millan * Makefile.in (TARGET_CPPFLAGS): Add `-nostdinc'. diff --git a/conf/common.rmk b/conf/common.rmk index ce7c33084..c1f0bbdcf 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -1,7 +1,5 @@ # -*- makefile -*- -script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h - # For grub-mkelfimage. bin_UTILITIES += grub-mkelfimage grub_mkelfimage_SOURCES = util/elf/grub-mkimage.c util/misc.c \ diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 3c2061b4e..09ec7787c 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -5,6 +5,7 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/i386-efi.rmk b/conf/i386-efi.rmk index 0440359e5..99ab06f64 100644 --- a/conf/i386-efi.rmk +++ b/conf/i386-efi.rmk @@ -5,6 +5,7 @@ COMMON_CFLAGS = -fno-builtin -m32 COMMON_LDFLAGS = -melf_i386 -nostdlib # Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage diff --git a/conf/i386-ieee1275.rmk b/conf/i386-ieee1275.rmk index c70ecf4dd..4b640de49 100644 --- a/conf/i386-ieee1275.rmk +++ b/conf/i386-ieee1275.rmk @@ -5,6 +5,7 @@ COMMON_CFLAGS = -ffreestanding -mrtd -mregparm=3 COMMON_LDFLAGS = -nostdlib # Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_PROGRAMS = kernel.img diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index 30847dfa7..bf8fbfb9d 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -7,6 +7,7 @@ COMMON_CFLAGS = -fno-builtin -mrtd -mregparm=3 -m32 COMMON_LDFLAGS = -m32 -nostdlib # Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \ diff --git a/conf/powerpc-ieee1275.rmk b/conf/powerpc-ieee1275.rmk index 9165e4bc0..ee7f9ec27 100644 --- a/conf/powerpc-ieee1275.rmk +++ b/conf/powerpc-ieee1275.rmk @@ -6,6 +6,7 @@ COMMON_CFLAGS = -ffreestanding COMMON_LDFLAGS += -nostdlib # Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. diff --git a/conf/sparc64-ieee1275.rmk b/conf/sparc64-ieee1275.rmk index 1156fe2a9..62e951a5e 100644 --- a/conf/sparc64-ieee1275.rmk +++ b/conf/sparc64-ieee1275.rmk @@ -6,6 +6,7 @@ COMMON_CFLAGS = -ffreestanding -m64 -mno-app-regs COMMON_LDFLAGS = -melf64_sparc -nostdlib -mno-relax # Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Images. pkglib_IMAGES = boot.img diskboot.img kernel.img diff --git a/conf/x86_64-efi.rmk b/conf/x86_64-efi.rmk index 173227575..5be1b404f 100644 --- a/conf/x86_64-efi.rmk +++ b/conf/x86_64-efi.rmk @@ -5,6 +5,7 @@ COMMON_CFLAGS = -fno-builtin -m64 COMMON_LDFLAGS = -melf_x86_64 -nostdlib # Used by various components. These rules need to precede them. +script/sh/lexer.c_DEPENDENCIES = grub_script.tab.h # Utilities. bin_UTILITIES = grub-mkimage From 805111a4fd4183d134e5da13530b57fd0b3677b3 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 Oct 2009 22:37:38 +0000 Subject: [PATCH 1220/1707] 2009-10-30 Robert Millan * util/i386/pc/grub-install.in: Remove hint that device.map should be checked (grub-install doesn't currently rely on it). --- ChangeLog | 5 +++++ util/i386/pc/grub-install.in | 7 ------- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 1d504a2cc..26de80e89 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-10-30 Robert Millan + + * util/i386/pc/grub-install.in: Remove hint that device.map should be + checked (grub-install doesn't currently rely on it). + 2009-10-29 Robert Millan Revert SVN r2660. diff --git a/util/i386/pc/grub-install.in b/util/i386/pc/grub-install.in index 69028b662..8a06213cb 100644 --- a/util/i386/pc/grub-install.in +++ b/util/i386/pc/grub-install.in @@ -319,14 +319,7 @@ else $grub_mkimage -d ${pkglibdir} --output=/boot/multiboot.img --prefix=${prefix_drive}${relative_grubdir} $modules || exit 1 fi -# Prompt the user to check if the device map is correct. echo "Installation finished. No error reported." -echo "This is the contents of the device map $device_map." -echo "Check if this is correct or not. If any of the lines is incorrect," -echo "fix it and re-run the script \`grub-install'." -echo - -cat $device_map # Bye. exit 0 From d9e2cd701b71fd46a344f1e9b1075c8fe4499658 Mon Sep 17 00:00:00 2001 From: robertmh Date: Fri, 30 Oct 2009 22:51:52 +0000 Subject: [PATCH 1221/1707] 2009-10-30 Robert Millan Fix build problem. * Makefile.in (TARGET_CPPFLAGS): Replace `-nostdinc' with `-isystem=$(srcdir)/include'. --- ChangeLog | 7 +++++++ Makefile.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 26de80e89..25d7b753d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2009-10-30 Robert Millan + + Fix build problem. + + * Makefile.in (TARGET_CPPFLAGS): Replace `-nostdinc' with + `-isystem=$(srcdir)/include'. + 2009-10-30 Robert Millan * util/i386/pc/grub-install.in: Remove hint that device.map should be diff --git a/Makefile.in b/Makefile.in index 103d2d3d2..2776fff17 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,7 @@ TARGET_ASFLAGS = @TARGET_ASFLAGS@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_APPLE_CC = @TARGET_APPLE_CC@ OBJCONV = @OBJCONV@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -nostdinc -I$(builddir) -I$(builddir)/include -I$(srcdir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -isystem=$(srcdir)/include -I$(builddir) -I$(builddir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ From 5b1538672ef1c87b9fb88b43a46fb5c00b210630 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Sun, 1 Nov 2009 18:19:04 +0000 Subject: [PATCH 1222/1707] 2009-11-01 Felix Zielcke * Makefile.in (TARGET_CPPFLAGS): Add `-I$(srcdir)/include'. --- ChangeLog | 4 ++++ Makefile.in | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 25d7b753d..2e5c7484d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-11-01 Felix Zielcke + + * Makefile.in (TARGET_CPPFLAGS): Add `-I$(srcdir)/include'. + 2009-10-30 Robert Millan Fix build problem. diff --git a/Makefile.in b/Makefile.in index 2776fff17..61b966995 100644 --- a/Makefile.in +++ b/Makefile.in @@ -75,7 +75,7 @@ TARGET_ASFLAGS = @TARGET_ASFLAGS@ TARGET_MODULE_FORMAT = @TARGET_MODULE_FORMAT@ TARGET_APPLE_CC = @TARGET_APPLE_CC@ OBJCONV = @OBJCONV@ -TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -isystem=$(srcdir)/include -I$(builddir) -I$(builddir)/include \ +TARGET_CPPFLAGS = @TARGET_CPPFLAGS@ -isystem=$(srcdir)/include -I$(srcdir)/include -I$(builddir) -I$(builddir)/include \ -Wall -W TARGET_LDFLAGS = @TARGET_LDFLAGS@ TARGET_IMG_LDSCRIPT = @TARGET_IMG_LDSCRIPT@ From a50569e135f5be747a5b66f63843c5e5eadf8022 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sun, 1 Nov 2009 23:03:09 +0000 Subject: [PATCH 1223/1707] 2009-11-01 Robert Millan Based on patch from BVK Chaitanya * kern/misc.c (grub_strchr, grub_strrchr): Fix to handle c == '\0' case. --- ChangeLog | 6 ++++++ kern/misc.c | 10 +++++----- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2e5c7484d..5a3f80e05 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-01 Robert Millan + + Based on patch from BVK Chaitanya + * kern/misc.c (grub_strchr, grub_strrchr): Fix to handle c == '\0' + case. + 2009-11-01 Felix Zielcke * Makefile.in (TARGET_CPPFLAGS): Add `-I$(srcdir)/include'. diff --git a/kern/misc.c b/kern/misc.c index 1c38fe661..cacfbc753 100644 --- a/kern/misc.c +++ b/kern/misc.c @@ -223,12 +223,12 @@ grub_strncmp (const char *s1, const char *s2, grub_size_t n) char * grub_strchr (const char *s, int c) { - while (*s) + do { if (*s == c) return (char *) s; - s++; } + while (*s++); return 0; } @@ -236,14 +236,14 @@ grub_strchr (const char *s, int c) char * grub_strrchr (const char *s, int c) { - char *p = 0; + char *p = NULL; - while (*s) + do { if (*s == c) p = (char *) s; - s++; } + while (*s++); return p; } From 61697d9c7017da7b84f760b4171144f167be32f4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 2 Nov 2009 13:55:25 +0000 Subject: [PATCH 1224/1707] 2009-11-02 Samuel Thibault * util/grub.d/10_hurd.in: Call prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} before loading /boot kernel. --- ChangeLog | 5 +++++ util/grub.d/10_hurd.in | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 5a3f80e05..24dbdbf31 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-02 Samuel Thibault + + * util/grub.d/10_hurd.in: Call prepare_grub_to_access_device + ${GRUB_DEVICE_BOOT} before loading /boot kernel. + 2009-11-01 Robert Millan Based on patch from BVK Chaitanya diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index b52f37498..fdfb7acb7 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -71,9 +71,12 @@ fi cat << EOF menuentry "${OS}" { EOF -prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" +prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF multiboot ${kernel} root=device:${GRUB_DEVICE} +EOF +prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" +cat << EOF module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\ --multiboot-command-line='\${kernel-command-line}' \\ --host-priv-port='\${host-port}' \\ From ff1a9bca3a3884a00b4156ffc4ea7f06b053c521 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 2 Nov 2009 19:14:00 +0000 Subject: [PATCH 1225/1707] 2009-11-02 Samuel Thibault * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Subtract 1 from GNU partition number to get internal GRUB partition number. --- ChangeLog | 5 +++++ util/hostdisk.c | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 24dbdbf31..38b9ffed1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-02 Samuel Thibault + + * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Subtract 1 from + GNU partition number to get internal GRUB partition number. + 2009-11-02 Samuel Thibault * util/grub.d/10_hurd.in: Call prepare_grub_to_access_device diff --git a/util/hostdisk.c b/util/hostdisk.c index 22b856e29..e1058a100 100644 --- a/util/hostdisk.c +++ b/util/hostdisk.c @@ -1057,7 +1057,7 @@ grub_util_biosdisk_get_grub_dev (const char *os_dev) n = strtol (p, &q, 10); if (p != q && n != GRUB_LONG_MIN && n != GRUB_LONG_MAX) { - dos_part = (int) n; + dos_part = (int) n - 1; if (*q >= 'a' && *q <= 'g') bsd_part = *q - 'a'; From b82bd5e192aa6776be2214b7d578d662a0a098a7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 2 Nov 2009 19:32:12 +0000 Subject: [PATCH 1226/1707] 2009-11-02 Samuel Thibault * util/grub.d/10_hurd.in: Drop /dev/ prefix from root device path before giving it to GNU Mach. --- ChangeLog | 5 +++++ util/grub.d/10_hurd.in | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 38b9ffed1..e2aacd760 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-02 Samuel Thibault + + * util/grub.d/10_hurd.in: Drop /dev/ prefix from root device path before + giving it to GNU Mach. + 2009-11-02 Samuel Thibault * util/hostdisk.c (grub_util_biosdisk_get_grub_dev): Subtract 1 from diff --git a/util/grub.d/10_hurd.in b/util/grub.d/10_hurd.in index fdfb7acb7..e693c7dfa 100644 --- a/util/grub.d/10_hurd.in +++ b/util/grub.d/10_hurd.in @@ -73,7 +73,7 @@ menuentry "${OS}" { EOF prepare_grub_to_access_device ${GRUB_DEVICE_BOOT} | sed -e "s/^/\t/" cat << EOF - multiboot ${kernel} root=device:${GRUB_DEVICE} + multiboot ${kernel} root=device:${GRUB_DEVICE#/dev/} EOF prepare_grub_to_access_device ${GRUB_DEVICE} | sed -e "s/^/\t/" cat << EOF From 4f9dfb3701f46297395151c1e57b3936f5ae1da7 Mon Sep 17 00:00:00 2001 From: robertmh Date: Mon, 2 Nov 2009 21:01:14 +0000 Subject: [PATCH 1227/1707] 2009-11-02 Samuel Thibault * util/grub.d/30_os-prober.in: Add GNU/Hurd support --- ChangeLog | 4 ++++ util/grub.d/30_os-prober.in | 23 ++++++++++++++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e2aacd760..ea2145770 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2009-11-02 Samuel Thibault + + * util/grub.d/30_os-prober.in: Add GNU/Hurd support + 2009-11-02 Samuel Thibault * util/grub.d/10_hurd.in: Drop /dev/ prefix from root device path before diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index 6fd97fc4e..e14a07316 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -159,7 +159,28 @@ EOF EOF ;; hurd|*) - echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2 + cat << EOF +menuentry "${LONGNAME} (on ${DEVICE})" { +EOF + prepare_grub_to_access_device ${DEVICE} | sed -e "s/^/\t/" + grub_device="`${grub_probe} --device ${DEVICE} --target=drive`" + mach_device="`echo "${grub_device}" | tr -d '()' | tr , s`" + grub_fs="`${grub_probe} --device ${DEVICE} --target=fs`" + case "${grub_fs}" in + *fs) hurd_fs="${grub_fs}" ;; + *) hurd_fs="${grub_fs}fs" ;; + esac + cat << EOF + multiboot /boot/gnumach.gz root=device:${mach_device} + module /hurd/${hurd_fs}.static ${hurd_fs} --readonly \\ + --multiboot-command-line='\${kernel-command-line}' \\ + --host-priv-port='\${host-port}' \\ + --device-master-port='\${device-port}' \\ + --exec-server-task='\${exec-task}' -T typed '\${root}' \\ + '\$(task-create)' '\$(task-resume)' + module /lib/ld.so.1 exec /hurd/exec '\$(exec-task=task-create)' +} +EOF ;; esac done From cdef0f7f52ab4dd98152ab4f8f9136fe148f82a6 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Mon, 2 Nov 2009 23:44:22 +0100 Subject: [PATCH 1228/1707] improved lspci --- commands/lspci.c | 42 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/commands/lspci.c b/commands/lspci.c index 5b3360a37..c5df7bb20 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -84,6 +84,7 @@ static const struct grub_pci_classname grub_pci_classes[] = { 11, 0x30, "MIPS Processor" }, { 11, 0x40, "Co-Processor" }, { 11, 0x80, "Unknown Processor" }, + { 12, 3, "USB Controller" }, { 12, 0x80, "Serial Bus Controller" }, { 13, 0x80, "Wireless Controller" }, { 14, 0, "I2O" }, @@ -120,6 +121,7 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) grub_uint32_t class; const char *sclass; grub_pci_address_t addr; + int i, reg; grub_printf ("%02x:%02x.%x %04x:%04x", bus, dev, func, pciid & 0xFFFF, pciid >> 16); @@ -142,6 +144,46 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) grub_printf ("\n"); + reg = 4; + for (i = 0; i < 6; i++) + { + grub_uint64_t space; + addr = grub_pci_make_address (dev, reg); + space = grub_pci_read (addr); + + reg++; + + if (space == 0) + continue; + + switch (space & GRUB_PCI_ADDR_SPACE_MASK) + { + case GRUB_PCI_ADDR_SPACE_IO: + grub_printf ("IO space %d at 0x%llx\n", i, + (unsigned long long) (space & GRUB_PCI_ADDR_IO_MASK)); + break; + case GRUB_PCI_ADDR_SPACE_MEMORY: + if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK) + == GRUB_PCI_ADDR_MEM_TYPE_64) + { + space |= grub_pci_make_address (dev, reg); + reg++; + grub_printf ("64-bit memory space %d at 0x%16llx [%s]\n", i, + (unsigned long long) (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); + + } + else + grub_printf ("32-bit memory space %d at 0x%16llx [%s]\n", i, + (unsigned long long) (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); + break; + } + } + + return 0; } From 246cd78f70fd3a9a89c2b2c97cc33854b2f86e4c Mon Sep 17 00:00:00 2001 From: fzielcke Date: Tue, 3 Nov 2009 14:25:34 +0000 Subject: [PATCH 1229/1707] 2009-11-03 Samuel Thibault * util/grub.d/30_os-prober.in: Restore default behavior for unsupported OSes. --- ChangeLog | 5 +++++ util/grub.d/30_os-prober.in | 5 ++++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index ea2145770..ffe8911d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-03 Samuel Thibault + + * util/grub.d/30_os-prober.in: Restore default behavior for unsupported + OSes. + 2009-11-02 Samuel Thibault * util/grub.d/30_os-prober.in: Add GNU/Hurd support diff --git a/util/grub.d/30_os-prober.in b/util/grub.d/30_os-prober.in index e14a07316..c5728866c 100644 --- a/util/grub.d/30_os-prober.in +++ b/util/grub.d/30_os-prober.in @@ -158,7 +158,7 @@ EOF } EOF ;; - hurd|*) + hurd) cat << EOF menuentry "${LONGNAME} (on ${DEVICE})" { EOF @@ -182,5 +182,8 @@ EOF } EOF ;; + *) + echo " ${LONGNAME} is not yet supported by grub-mkconfig." >&2 + ;; esac done From 86e5b1dbb75accb880e243344044639055c5fc25 Mon Sep 17 00:00:00 2001 From: fzielcke Date: Wed, 4 Nov 2009 08:20:53 +0000 Subject: [PATCH 1230/1707] 2009-11-04 Felix Zielcke * configure.ac (AC_PREREQ): Bump to 2.59d. * INSTALL: Make it more clear when Autoconf and Ruby are needed and when to run `./autogen.sh'. --- ChangeLog | 6 ++++++ INSTALL | 17 +++++++++++------ configure.ac | 2 +- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index ffe8911d8..c4fecdd40 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-11-04 Felix Zielcke + + * configure.ac (AC_PREREQ): Bump to 2.59d. + * INSTALL: Make it more clear when Autoconf and Ruby are + needed and when to run `./autogen.sh'. + 2009-11-03 Samuel Thibault * util/grub.d/30_os-prober.in: Restore default behavior for unsupported diff --git a/INSTALL b/INSTALL index e751d508f..f9ae8f9d2 100644 --- a/INSTALL +++ b/INSTALL @@ -16,8 +16,12 @@ configuring the GRUB. * GNU Bison 2.3 or later * GNU binutils 2.9.1.0.23 or later * Other standard GNU/Unix tools + +If you use a development snapshot or want to hack on GRUB you may +need the following. + * Ruby 1.6 or later -* Autoconf 2.59 or later +* Autoconf 2.59d or later Configuring the GRUB ==================== @@ -48,11 +52,12 @@ Building the GRUB The simplest way to compile this package is: - 1. `cd' to the directory containing the package's source code and - type `./autogen.sh' and then `./configure' to configure the - package for your system. If you're using `csh' on an old version - of System V, you might need to type `sh ./configure' instead to - prevent `csh' from trying to execute `configure' itself. + 1. `cd' to the directory containing the package's source code. If + you don't use a release tarball you have to type `./autogen.sh'. + Type `./configure' to configure the package for your system. + If you're using `csh' on an old version of System V, you might + need to type `sh ./configure' instead to prevent `csh' from trying + to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. diff --git a/configure.ac b/configure.ac index 4bd28f2e8..0953e0410 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ dnl type. AC_INIT([GRUB],[1.97],[bug-grub@gnu.org]) -AC_PREREQ(2.59) +AC_PREREQ(2.59d) AC_CONFIG_SRCDIR([include/grub/dl.h]) AC_CONFIG_HEADER([config.h]) From 9b0a46a19d4f07030b7b0c2e18bef080cd83663c Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 6 Nov 2009 22:53:07 +0100 Subject: [PATCH 1231/1707] Cleaned up extended lspci --- commands/lspci.c | 88 ++++++++++++++++++++++++++++-------------------- 1 file changed, 51 insertions(+), 37 deletions(-) diff --git a/commands/lspci.c b/commands/lspci.c index c5df7bb20..3d3a9ac0c 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -115,6 +115,14 @@ grub_pci_get_class (int class, int subclass) return 0; } +static const struct grub_arg_option options[] = + { + {"iospace", 'i', 0, "show I/O spaces", 0, 0}, + {0, 0, 0, 0, 0, 0} + }; + +static int iospace; + static int NESTED_FUNC_ATTR grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) { @@ -144,42 +152,47 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) grub_printf ("\n"); - reg = 4; - for (i = 0; i < 6; i++) + if (iospace) { - grub_uint64_t space; - addr = grub_pci_make_address (dev, reg); - space = grub_pci_read (addr); - - reg++; - - if (space == 0) - continue; - - switch (space & GRUB_PCI_ADDR_SPACE_MASK) + reg = 4; + for (i = 0; i < 6; i++) { - case GRUB_PCI_ADDR_SPACE_IO: - grub_printf ("IO space %d at 0x%llx\n", i, - (unsigned long long) (space & GRUB_PCI_ADDR_IO_MASK)); - break; - case GRUB_PCI_ADDR_SPACE_MEMORY: - if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK) - == GRUB_PCI_ADDR_MEM_TYPE_64) - { - space |= grub_pci_make_address (dev, reg); - reg++; - grub_printf ("64-bit memory space %d at 0x%16llx [%s]\n", i, - (unsigned long long) (space & GRUB_PCI_ADDR_MEM_MASK), - space & GRUB_PCI_ADDR_MEM_PREFETCH - ? "prefetchable" : "non-prefetchable"); + grub_uint64_t space; + addr = grub_pci_make_address (dev, reg); + space = grub_pci_read (addr); + reg++; + + if (space == 0) + continue; + + switch (space & GRUB_PCI_ADDR_SPACE_MASK) + { + case GRUB_PCI_ADDR_SPACE_IO: + grub_printf ("\tIO space %d at 0x%llx\n", i, (unsigned long long) + (space & GRUB_PCI_ADDR_IO_MASK)); + break; + case GRUB_PCI_ADDR_SPACE_MEMORY: + if ((space & GRUB_PCI_ADDR_MEM_TYPE_MASK) + == GRUB_PCI_ADDR_MEM_TYPE_64) + { + space |= grub_pci_make_address (dev, reg); + reg++; + grub_printf ("\t64-bit memory space %d at 0x0%16llx [%s]\n", + i, (unsigned long long) + (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); + + } + else + grub_printf ("\t32-bit memory space %d at 0x0%16llx [%s]\n", i, + (unsigned long long) + (space & GRUB_PCI_ADDR_MEM_MASK), + space & GRUB_PCI_ADDR_MEM_PREFETCH + ? "prefetchable" : "non-prefetchable"); + break; } - else - grub_printf ("32-bit memory space %d at 0x%16llx [%s]\n", i, - (unsigned long long) (space & GRUB_PCI_ADDR_MEM_MASK), - space & GRUB_PCI_ADDR_MEM_PREFETCH - ? "prefetchable" : "non-prefetchable"); - break; } } @@ -188,23 +201,24 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) } static grub_err_t -grub_cmd_lspci (grub_command_t cmd __attribute__ ((unused)), +grub_cmd_lspci (grub_extcmd_t cmd, int argc __attribute__ ((unused)), char **args __attribute__ ((unused))) { + iospace = cmd->state[0].set; grub_pci_iterate (grub_lspci_iter); return GRUB_ERR_NONE; } -static grub_command_t cmd; +static grub_extcmd_t cmd; GRUB_MOD_INIT(pci) { - cmd = grub_register_command ("lspci", grub_cmd_lspci, - 0, "List PCI devices"); + cmd = grub_register_extcmd ("lspci", grub_cmd_lspci, GRUB_COMMAND_FLAG_BOTH, + "lspci [-i]", "List PCI devices", options); } GRUB_MOD_FINI(pci) { - grub_unregister_command (cmd); + grub_unregister_extcmd (cmd); } From d65f6db1f7467412fedabc1cd4336bc153871f25 Mon Sep 17 00:00:00 2001 From: Vladimir 'phcoder' Serbinenko Date: Fri, 6 Nov 2009 23:02:08 +0100 Subject: [PATCH 1232/1707] small fixes --- commands/lspci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/commands/lspci.c b/commands/lspci.c index 3d3a9ac0c..fd07ad8d6 100644 --- a/commands/lspci.c +++ b/commands/lspci.c @@ -20,7 +20,7 @@ #include #include #include -#include +#include struct grub_pci_classname { @@ -178,7 +178,7 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) { space |= grub_pci_make_address (dev, reg); reg++; - grub_printf ("\t64-bit memory space %d at 0x0%16llx [%s]\n", + grub_printf ("\t64-bit memory space %d at 0x%016llx [%s]\n", i, (unsigned long long) (space & GRUB_PCI_ADDR_MEM_MASK), space & GRUB_PCI_ADDR_MEM_PREFETCH @@ -186,7 +186,7 @@ grub_lspci_iter (int bus, int dev, int func, grub_pci_id_t pciid) } else - grub_printf ("\t32-bit memory space %d at 0x0%16llx [%s]\n", i, + grub_printf ("\t32-bit memory space %d at 0x%016llx [%s]\n", i, (unsigned long long) (space & GRUB_PCI_ADDR_MEM_MASK), space & GRUB_PCI_ADDR_MEM_PREFETCH From c926e1d58502bff159ebd12aa11684341db5b8a4 Mon Sep 17 00:00:00 2001 From: robertmh Date: Sat, 7 Nov 2009 21:06:30 +0000 Subject: [PATCH 1233/1707] 2009-11-07 Robert Millan Fix build with GNU gold. * conf/i386-pc.rmk (boot_img_LDFLAGS, pxeboot_img_LDFLAGS) (diskboot_img_LDFLAGS, lnxboot_img_LDFLAGS) (cdboot_img_LDFLAGS): Prepend `0x' qualifier to hexadecimal link addresses. * aclocal.m4: Likewise. --- ChangeLog | 10 ++++++++++ aclocal.m4 | 2 +- conf/i386-pc.rmk | 10 +++++----- 3 files changed, 16 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index c4fecdd40..843be6dc5 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-11-07 Robert Millan + + Fix build with GNU gold. + + * conf/i386-pc.rmk (boot_img_LDFLAGS, pxeboot_img_LDFLAGS) + (diskboot_img_LDFLAGS, lnxboot_img_LDFLAGS) + (cdboot_img_LDFLAGS): Prepend `0x' qualifier to hexadecimal + link addresses. + * aclocal.m4: Likewise. + 2009-11-04 Felix Zielcke * configure.ac (AC_PREREQ): Bump to 2.59d. diff --git a/aclocal.m4 b/aclocal.m4 index 899eca409..6f9baf18f 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -92,7 +92,7 @@ else AC_MSG_ERROR([${CC-cc} cannot compile C source code]) fi grub_cv_prog_objcopy_absolute=yes -for link_addr in 2000 8000 7C00; do +for link_addr in 0x2000 0x8000 0x7C00; do if AC_TRY_COMMAND([${CC-cc} ${CFLAGS} -nostdlib ${TARGET_IMG_LDFLAGS_AC} -Wl,-Ttext -Wl,$link_addr conftest.o -o conftest.exec]); then : else AC_MSG_ERROR([${CC-cc} cannot link at address $link_addr]) diff --git a/conf/i386-pc.rmk b/conf/i386-pc.rmk index bf8fbfb9d..373b942cc 100644 --- a/conf/i386-pc.rmk +++ b/conf/i386-pc.rmk @@ -16,31 +16,31 @@ pkglib_IMAGES = boot.img cdboot.img diskboot.img kernel.img lnxboot.img \ # For boot.img. boot_img_SOURCES = boot/i386/pc/boot.S boot_img_ASFLAGS = $(COMMON_ASFLAGS) -boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 +boot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)0x7C00 boot_img_FORMAT = binary # For pxeboot.img pxeboot_img_SOURCES = boot/i386/pc/pxeboot.S pxeboot_img_ASFLAGS = $(COMMON_ASFLAGS) -pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 +pxeboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)0x7C00 pxeboot_img_FORMAT = binary # For diskboot.img. diskboot_img_SOURCES = boot/i386/pc/diskboot.S diskboot_img_ASFLAGS = $(COMMON_ASFLAGS) -diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)8000 +diskboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)0x8000 diskboot_img_FORMAT = binary # For lnxboot.img. lnxboot_img_SOURCES = boot/i386/pc/lnxboot.S lnxboot_img_ASFLAGS = $(COMMON_ASFLAGS) -lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)6000 +lnxboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)0x6000 lnxboot_img_FORMAT = binary # For cdboot.img. cdboot_img_SOURCES = boot/i386/pc/cdboot.S cdboot_img_ASFLAGS = $(COMMON_ASFLAGS) -cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)7C00 +cdboot_img_LDFLAGS = $(COMMON_LDFLAGS) $(TARGET_IMG_LDFLAGS)0x7C00 cdboot_img_FORMAT = binary # For kernel.img. From 50ceeb7cb5fd5477da1bd9f724d936c8852e4ef6 Mon Sep 17 00:00:00 2001 From: Felix Zielcke Date: Sun, 8 Nov 2009 01:49:15 +0100 Subject: [PATCH 1234/1707] 2009-11-04 Felix Zielcke * util//grub-mkconfig_lib.in (bindir): New variable. (grub_mkrelpath): Likewise. Properly set path variable. Use ${grub_mkrelpath} instead of calling it directly. 2009-11-02 Felix Zielcke * util/probe.c (probe): Make the file path relative to its root. Change a info message to use the GRUB path. Enable again the check if we can read the file with GRUB facilities. 2009-11-01 Felix Zielcke * util/grub-mkrelpath.c: New file. * conf/common.rmk (bin_UTILITIES): Add grub-mkrelpath. (grub_mkrelpath_SOURCES): New variable. * include/grub/util/misc.h: New function prototype. * util/misc.c (make_system_path_relative_to_its_root): New function. * util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root): Use grub-mkrelpath. --- ChangeLog.mkrelpath | 23 +++++++++ conf/common.rmk | 4 ++ include/grub/util/misc.h | 5 +- util/grub-mkconfig_lib.in | 46 ++---------------- util/grub-mkrelpath.c | 99 +++++++++++++++++++++++++++++++++++++++ util/grub-probe.c | 11 ++--- util/misc.c | 81 ++++++++++++++++++++++++++++++++ 7 files changed, 219 insertions(+), 50 deletions(-) create mode 100644 ChangeLog.mkrelpath create mode 100644 util/grub-mkrelpath.c diff --git a/ChangeLog.mkrelpath b/ChangeLog.mkrelpath new file mode 100644 index 000000000..e210397ed --- /dev/null +++ b/ChangeLog.mkrelpath @@ -0,0 +1,23 @@ +2009-11-04 Felix Zielcke + + * util//grub-mkconfig_lib.in (bindir): New variable. + (grub_mkrelpath): Likewise. + Properly set path variable. Use ${grub_mkrelpath} instead of + calling it directly. + +2009-11-02 Felix Zielcke + + * util/probe.c (probe): Make the file path relative to its root. + Change a info message to use the GRUB path. Enable again the + check if we can read the file with GRUB facilities. + +2009-11-01 Felix Zielcke + + * util/grub-mkrelpath.c: New file. + * conf/common.rmk (bin_UTILITIES): Add grub-mkrelpath. + (grub_mkrelpath_SOURCES): New variable. + * include/grub/util/misc.h: New function prototype. + * util/misc.c (make_system_path_relative_to_its_root): New function. + + * util/grub-mkconfig_lib.in (make_system_path_relative_to_its_root): + Use grub-mkrelpath. diff --git a/conf/common.rmk b/conf/common.rmk index c1f0bbdcf..175611f62 100644 --- a/conf/common.rmk +++ b/conf/common.rmk @@ -57,6 +57,10 @@ grub_mkfont_CFLAGS = $(freetype_cflags) grub_mkfont_LDFLAGS = $(freetype_libs) endif +# For grub-mkrelpath. +bin_UTILITIES += grub-mkrelpath +grub_mkrelpath_SOURCES = util/grub-mkrelpath.c util/misc.c + # For the parser. grub_script.tab.c grub_script.tab.h: script/sh/parser.y $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/script/sh/parser.y diff --git a/include/grub/util/misc.h b/include/grub/util/misc.h index 6a93ab044..d0184d416 100644 --- a/include/grub/util/misc.h +++ b/include/grub/util/misc.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -76,4 +76,7 @@ grub_int64_t grub_util_get_disk_size (char *name); #endif + +char *make_system_path_relative_to_its_root (const char *path); + #endif /* ! GRUB_UTIL_MISC_HEADER */ diff --git a/util/grub-mkconfig_lib.in b/util/grub-mkconfig_lib.in index bb30cc475..5b5dfd42a 100644 --- a/util/grub-mkconfig_lib.in +++ b/util/grub-mkconfig_lib.in @@ -20,10 +20,12 @@ prefix=@prefix@ exec_prefix=@exec_prefix@ datarootdir=@datarootdir@ datadir=@datadir@ +bindir=@bindir@ sbindir=@sbindir@ pkgdatadir=${datadir}/`echo @PACKAGE_TARNAME@ | sed "${transform}"` grub_probe=${sbindir}/`echo grub-probe | sed ${transform}` +grub_mkrelpath=${bindir}/`echo grub-mkrelpath | sed ${transform}` grub_warn () { @@ -32,49 +34,7 @@ grub_warn () make_system_path_relative_to_its_root () { - path=$1 - # abort if file doesn't exist - if test -e $path ; then : ;else - return 1 - fi - - # canonicalize - if path=`readlink -f $path` ; then : ; else - return 1 - fi - - # if not a directory, climb up to the directory containing it - if test -d $path ; then - dir=$path - else - dir=`echo $path | sed -e "s,/[^/]*$,,g"` - fi - - num=`stat -c %d $dir` - - # this loop sets $dir to the root directory of the filesystem we're inspecting - while : ; do - parent=`readlink -f $dir/..` - if [ "x`stat -c %d $parent`" = "x$num" ] ; then : ; else - # $parent is another filesystem; we found it. - break - fi - if [ "x$dir" = "x/" ] ; then - # / is our root. - break - fi - dir=$parent - done - - # This function never prints trailing slashes (so that its output can be - # appended a slash unconditionally). Each slash in $dir is considered a - # preceding slash, and therefore the root directory is an empty string. - if [ "$dir" = "/" ] ; then - dir="" - fi - - # XXX: This fails if $dir contains ','. - path=`echo "$path" | sed -e "s,^$dir,,g"` || return 1 + path="`${grub_mkrelpath} $1`" case "`uname 2>/dev/null`" in CYGWIN*) diff --git a/util/grub-mkrelpath.c b/util/grub-mkrelpath.c new file mode 100644 index 000000000..3deb4c412 --- /dev/null +++ b/util/grub-mkrelpath.c @@ -0,0 +1,99 @@ +/* grub-mkrelpath.c - make a system path relative to its root */ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2009 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +#include + +static struct option options[] = + { + {"help", no_argument, 0, 'h'}, + {"version", no_argument, 0, 'V'}, + }; + +static void +usage (int status) +{ + if (status) + fprintf (stderr, "Try ``grub-mkrelpath --help'' for more information.\n"); + else + printf ("\ +Usage: grub-mkrelpath [OPTIONS] PATH\n\ +\n\ +Make a system path relative to it's root.\n\ +\n\ +Options:\n\ + -h, --help display this message and exit\n\ + -V, --version print version information and exit\n\ +\n\ +Report bugs to <%s>.\n", PACKAGE_BUGREPORT); + + exit (status); +} + +int +main (int argc, char *argv[]) +{ + char *argument, *relpath; + + progname = "grub-mkrelpath"; + + /* Check for options. */ + while (1) + { + int c = getopt_long (argc, argv, "hV", options, 0); + + if (c == -1) + break; + else + switch (c) + { + case 'h': + usage (0); + break; + + case 'V': + printf ("%s (%s) %s\n", progname, PACKAGE_NAME, PACKAGE_VERSION); + return 0; + + default: + usage (1); + break; + } + } + + if (optind >= argc) + { + fprintf (stderr, "No path is specified.\n"); + usage (1); + } + + if (optind + 1 != argc) + { + fprintf (stderr, "Unknown extra argument `%s'.\n", argv[optind + 1]); + usage (1); + } + + argument = argv[optind]; + + relpath = make_system_path_relative_to_its_root (argument); + printf ("%s\n", relpath); + free (relpath); + + return 0; +} diff --git a/util/grub-probe.c b/util/grub-probe.c index 4e3f96451..051a38c72 100644 --- a/util/grub-probe.c +++ b/util/grub-probe.c @@ -235,9 +235,6 @@ probe (const char *path, char *device_name) if (print == PRINT_FS) { - /* FIXME: `path' can't be used to read a file via GRUB facilities, - because it's not relative to its root. */ -#if 0 struct stat st; stat (path, &st); @@ -247,11 +244,14 @@ probe (const char *path, char *device_name) /* Regular file. Verify that we can read it properly. */ grub_file_t file; + char *rel_path; grub_util_info ("reading %s via OS facilities", path); filebuf_via_sys = grub_util_read_image (path); - grub_util_info ("reading %s via GRUB facilities", path); - asprintf (&grub_path, "(%s)%s", drive_name, path); + rel_path = make_system_path_relative_to_its_root (path); + asprintf (&grub_path, "(%s)%s", drive_name, rel_path); + free (rel_path); + grub_util_info ("reading %s via GRUB facilities", grub_path); file = grub_file_open (grub_path); filebuf_via_grub = xmalloc (file->size); grub_file_read (file, filebuf_via_grub, file->size); @@ -261,7 +261,6 @@ probe (const char *path, char *device_name) if (memcmp (filebuf_via_grub, filebuf_via_sys, file->size)) grub_util_error ("files differ"); } -#endif printf ("%s\n", fs->name); } diff --git a/util/misc.c b/util/misc.c index 37e75311e..e4d68e33f 100644 --- a/util/misc.c +++ b/util/misc.c @@ -18,10 +18,12 @@ #include +#include #include #include #include #include +#include #include #include #include @@ -449,3 +451,82 @@ fail: } #endif /* __MINGW32__ */ + +/* This function never prints trailing slashes (so that its output + can be appended a slash unconditionally). */ +char * +make_system_path_relative_to_its_root (const char *path) +{ + struct stat st; + char *p, *buf, *buf2, *buf3; + uintptr_t offset = 0; + dev_t num; + size_t len; + + /* canonicalize. */ + p = realpath (path, NULL); + + if (p == NULL) + { + if (errno != EINVAL) + grub_util_error ("failed to get realpath of %s", path); + else + grub_util_error ("realpath not supporting (path, NULL)"); + } + len = strlen (p) + 1; + buf = strdup (p); + free (p); + + if (stat (buf, &st) < 0) + grub_util_error ("can not stat %s: %s", buf, strerror (errno)); + + buf2 = strdup (buf); + num = st.st_dev; + + /* This loop sets offset to the number of chars of the root + directory we're inspecting. */ + while (1) + { + p = strrchr (buf, '/'); + if (p == NULL) + /* This should never happen. */ + grub_util_error ("FIXME: no / in buf. (make_system_path_relative_to_its_root)"); + if (p != buf) + *p = 0; + else + *++p = 0; + + if (stat (buf, &st) < 0) + grub_util_error ("can not stat %s: %s", buf, strerror (errno)); + + /* buf is another filesystem; we found it. */ + if (st.st_dev != num) + break; + + offset = p - buf; + /* offset == 1 means root directory. */ + if (offset == 1) + { + free (buf); + len = strlen (buf2); + while (buf2[len - 1] == '/' && len > 1) + { + buf2[len - 1] = '\0'; + len--; + } + return buf2; + } + } + free (buf); + buf3 = strdup (buf2 + offset); + free (buf2); + + len = strlen (buf3); + while (buf2[len - 1] == '/' && len > 1) + { + buf2[len - 1] = '\0'; + len--; + } + + return buf3; +} From e4eb23732d11fa03938ae053449eae66d07a3971 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 16:23:23 +0000 Subject: [PATCH 1235/1707] 2009-11-08 Robert Millan * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve error message for coreboot users. --- ChangeLog | 5 +++++ kern/i386/multiboot_mmap.c | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 843be6dc5..57cb49d95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-08 Robert Millan + + * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve error + message for coreboot users. + 2009-11-07 Robert Millan Fix build with GNU gold. diff --git a/kern/i386/multiboot_mmap.c b/kern/i386/multiboot_mmap.c index 8331bd5df..6578a4834 100644 --- a/kern/i386/multiboot_mmap.c +++ b/kern/i386/multiboot_mmap.c @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2003,2004,2005,2006,2007,2008 Free Software Foundation, Inc. + * Copyright (C) 2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. * * GRUB is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -40,7 +40,7 @@ void grub_machine_mmap_init () { if (! startup_multiboot_info) - grub_fatal ("Must be loaded using Multiboot specification (is this an old version of coreboot?)"); + grub_fatal ("Unable to find Multiboot Information (is CONFIG_MULTIBOOT disabled in coreboot?)"); /* Move MBI to a safe place. */ grub_memmove (&kern_multiboot_info, startup_multiboot_info, sizeof (struct grub_multiboot_info)); From 31bd05ccca276daabd65eb26de6207af13f0f3ab Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 16:40:24 +0000 Subject: [PATCH 1236/1707] Add exec bit. --- autogen.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 autogen.sh diff --git a/autogen.sh b/autogen.sh old mode 100644 new mode 100755 From 0411481297c20dfc8b7913f32538cc738019a887 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 16:43:36 +0000 Subject: [PATCH 1237/1707] 2009-11-08 Robert Millan * autogen.sh: Use `sh gendistlist.sh' to avoid reliing on executable bit. --- ChangeLog | 5 +++++ autogen.sh | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 57cb49d95..525a6d5e0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-08 Robert Millan + + * autogen.sh: Use `sh gendistlist.sh' to avoid reliing on + executable bit. + 2009-11-08 Robert Millan * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve error diff --git a/autogen.sh b/autogen.sh index 4fb6bf7db..6751c8adc 100755 --- a/autogen.sh +++ b/autogen.sh @@ -10,6 +10,6 @@ for rmk in conf/*.rmk ${GRUB_CONTRIB}/*/conf/*.rmk; do ruby genmk.rb < $rmk > `echo $rmk | sed 's/\.rmk$/.mk/'` fi done -./gendistlist.sh > DISTLIST +sh gendistlist.sh > DISTLIST exit 0 From c02a7334960edaf716bd936efa1e7babd67406c6 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 16:57:31 +0000 Subject: [PATCH 1238/1707] Add a few files that were lost during transition from svn. --- include/grub/i386/coreboot/boot.h | 1 + include/grub/i386/coreboot/init.h | 28 ++++++++++++++++++++++++++++ include/grub/i386/coreboot/loader.h | 1 + include/grub/i386/coreboot/serial.h | 1 + include/grub/i386/coreboot/time.h | 1 + 5 files changed, 32 insertions(+) create mode 100644 include/grub/i386/coreboot/boot.h create mode 100644 include/grub/i386/coreboot/init.h create mode 100644 include/grub/i386/coreboot/loader.h create mode 100644 include/grub/i386/coreboot/serial.h create mode 100644 include/grub/i386/coreboot/time.h diff --git a/include/grub/i386/coreboot/boot.h b/include/grub/i386/coreboot/boot.h new file mode 100644 index 000000000..6cd23aa83 --- /dev/null +++ b/include/grub/i386/coreboot/boot.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/coreboot/init.h b/include/grub/i386/coreboot/init.h new file mode 100644 index 000000000..e67007414 --- /dev/null +++ b/include/grub/i386/coreboot/init.h @@ -0,0 +1,28 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2007 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_INIT_I386_LINUXBIOS_HEADER +#define GRUB_INIT_I386_LINUXBIOS_HEADER 1 + +#include +#include + +void EXPORT_FUNC(grub_stop) (void) __attribute__ ((noreturn)); +void EXPORT_FUNC(grub_stop_floppy) (void); + +#endif diff --git a/include/grub/i386/coreboot/loader.h b/include/grub/i386/coreboot/loader.h new file mode 100644 index 000000000..d3f36bba5 --- /dev/null +++ b/include/grub/i386/coreboot/loader.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/coreboot/serial.h b/include/grub/i386/coreboot/serial.h new file mode 100644 index 000000000..2c527f626 --- /dev/null +++ b/include/grub/i386/coreboot/serial.h @@ -0,0 +1 @@ +#include diff --git a/include/grub/i386/coreboot/time.h b/include/grub/i386/coreboot/time.h new file mode 100644 index 000000000..2298ee8f4 --- /dev/null +++ b/include/grub/i386/coreboot/time.h @@ -0,0 +1 @@ +#include From b97b7b914b09a757533119d818332a089b671c8d Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 20:02:16 +0000 Subject: [PATCH 1239/1707] 2009-11-08 Robert Millan * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve error message for excessively large memory map. --- ChangeLog | 5 +++++ kern/i386/multiboot_mmap.c | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 525a6d5e0..ac3950f2e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-08 Robert Millan + + * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve + error message for excessively large memory map. + 2009-11-08 Robert Millan * autogen.sh: Use `sh gendistlist.sh' to avoid reliing on diff --git a/kern/i386/multiboot_mmap.c b/kern/i386/multiboot_mmap.c index 6578a4834..67d824313 100644 --- a/kern/i386/multiboot_mmap.c +++ b/kern/i386/multiboot_mmap.c @@ -51,7 +51,8 @@ grub_machine_mmap_init () /* Move the memory map to a safe place. */ if (kern_multiboot_info.mmap_length > sizeof (mmap_entries)) { - grub_printf ("WARNING: Memory map size exceeds limit; it will be truncated\n"); + grub_printf ("WARNING: Memory map size exceeds limit (0x%x > 0x%x); it will be truncated\n", + kern_multiboot_info.mmap_length, sizeof (mmap_entries)); kern_multiboot_info.mmap_length = sizeof (mmap_entries); } grub_memmove (mmap_entries, (void *) kern_multiboot_info.mmap_addr, kern_multiboot_info.mmap_length); From ef4b915ad982877fbc2e41f9fdb4a4bb57c853d2 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 20:56:32 +0000 Subject: [PATCH 1240/1707] Implement grub-mkrescue for coreboot (needs external grub-mkisofs) --- ChangeLog.branch | 5 + conf/i386-coreboot.rmk | 3 + util/i386/coreboot/grub-mkrescue.in | 144 ++++++++++++++++++++++++++++ 3 files changed, 152 insertions(+) create mode 100644 ChangeLog.branch create mode 100644 util/i386/coreboot/grub-mkrescue.in diff --git a/ChangeLog.branch b/ChangeLog.branch new file mode 100644 index 000000000..4794498ff --- /dev/null +++ b/ChangeLog.branch @@ -0,0 +1,5 @@ +2009-11-08 Robert Millan + + * util/i386/coreboot/grub-mkrescue.in: New file. + * conf/i386-coreboot.rmk (bin_SCRIPTS, grub_mkrescue_SOURCES): New + variables. diff --git a/conf/i386-coreboot.rmk b/conf/i386-coreboot.rmk index 09ec7787c..5645395b8 100644 --- a/conf/i386-coreboot.rmk +++ b/conf/i386-coreboot.rmk @@ -152,6 +152,9 @@ grub_emu_LDFLAGS = $(LIBCURSES) sbin_SCRIPTS += grub-install grub_install_SOURCES = util/i386/pc/grub-install.in +bin_SCRIPTS += grub-mkrescue +grub_mkrescue_SOURCES = util/i386/coreboot/grub-mkrescue.in + # Modules. pkglib_MODULES = linux.mod multiboot.mod \ aout.mod play.mod serial.mod ata.mod \ diff --git a/util/i386/coreboot/grub-mkrescue.in b/util/i386/coreboot/grub-mkrescue.in new file mode 100644 index 000000000..fbfc13841 --- /dev/null +++ b/util/i386/coreboot/grub-mkrescue.in @@ -0,0 +1,144 @@ +#! /bin/sh -e + +# Make GRUB rescue image +# Copyright (C) 1999,2000,2001,2002,2003,2004,2005,2006,2007,2008,2009 Free Software Foundation, Inc. +# +# GRUB is free software: you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation, either version 3 of the License, or +# (at your option) any later version. +# +# GRUB is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with GRUB. If not, see . + +# Initialize some variables. +transform="@program_transform_name@" + +prefix=@prefix@ +exec_prefix=@exec_prefix@ +bindir=@bindir@ +libdir=@libdir@ +PACKAGE_NAME=@PACKAGE_NAME@ +PACKAGE_TARNAME=@PACKAGE_TARNAME@ +PACKAGE_VERSION=@PACKAGE_VERSION@ +target_cpu=@target_cpu@ +platform=@platform@ +pkglibdir=${libdir}/`echo ${PACKAGE_TARNAME}/${target_cpu}-${platform} | sed ${transform}` + +grub_mkimage=${bindir}/`echo grub-mkelfimage | sed ${transform}` + +# Usage: usage +# Print the usage. +usage () { + cat <. +EOF +} + +input_dir=${pkglibdir} + +# Check the arguments. +for option in "$@"; do + case "$option" in + -h | --help) + usage + exit 0 ;; + -v | --version) + echo "grub-mkrescue (GNU GRUB ${PACKAGE_VERSION})" + exit 0 ;; + --modules=*) + modules=`echo "$option" | sed 's/--modules=//'` ;; + --overlay=*) + overlay=${overlay}${overlay:+ }`echo "$option" | sed 's/--overlay=//'` ;; + --pkglibdir=*) + input_dir=`echo "$option" | sed 's/--pkglibdir=//'` ;; + --grub-mkimage=*) + grub_mkimage=`echo "$option" | sed 's/--grub-mkimage=//'` ;; + -*) + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + ;; + *) + if test "x$output_image" != x; then + echo "Unrecognized option \`$option'" 1>&2 + usage + exit 1 + fi + output_image="${option}" ;; + esac +done + +if test "x$output_image" = x; then + usage + exit 1 +fi + +memdisk_dir=`mktemp -d` +iso9660_dir=`mktemp -d` +mkdir -p ${memdisk_dir}/boot/grub ${iso9660_dir}/boot/grub + +for file in ${input_dir}/*.mod ${input_dir}/efiemu??.o \ + ${input_dir}/command.lst ${input_dir}/moddep.lst ${input_dir}/fs.lst \ + ${input_dir}/handler.lst ${input_dir}/parttool.lst; do + if test -f "$file"; then + cp -f "$file" ${iso9660_dir}/boot/grub/ + fi +done + +# obtain date-based UUID +iso_uuid=$(date +%Y-%m-%d-%H-%M-%S-00) + +# first-stage grub.cfg +cat << EOF >> ${memdisk_dir}/boot/grub/grub.cfg +search --fs-uuid --set ${iso_uuid} +set prefix=(\${root})/boot/grub +source /boot/grub/grub.cfg +EOF + +# build memdisk +memdisk_img=`mktemp` +tar -C ${memdisk_dir} -cf ${memdisk_img} boot +rm -rf ${memdisk_dir} + +# build core.img +mkdir -p ${iso9660_dir}/boot/grub +${grub_mkimage} -d ${input_dir}/ -m ${memdisk_img} -o ${iso9660_dir}/boot/multiboot.img \ + at_keyboard memdisk tar ata search iso9660 configfile sh +rm -f ${memdisk_img} + +for d in ${overlay}; do + echo "Overlaying $d" + cp -dpR "${d}"/* "${iso9660_dir}"/ +done + +# second-stage grub.cfg +modules="`cat ${input_dir}/partmap.lst` ${modules}" +for i in ${modules} ; do + echo "insmod $i" +done > ${iso9660_dir}/boot/grub/grub.cfg + +# build iso image +grub-mkisofs \ + --modification-date=$(echo ${iso_uuid} | sed -e s/-//g) \ + -o ${output_image} -r -J ${iso9660_dir} + +exit 0 From 79cb3a568b3f7c7ea1f2fe42d37bc67aba40a6c9 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 21:52:59 +0000 Subject: [PATCH 1241/1707] Fix miss-identification as `grub-mkimage' (and use `$0' when possible). --- util/i386/pc/grub-mkrescue.in | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index da937768b..cc581bffe 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -36,7 +36,7 @@ grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` # Print the usage. usage () { cat <. EOF @@ -67,7 +67,7 @@ for option in "$@"; do usage exit 0 ;; -v | --version) - echo "grub-mkrescue (GNU GRUB ${PACKAGE_VERSION})" + echo "$0 (GNU GRUB ${PACKAGE_VERSION})" exit 0 ;; --modules=*) modules=`echo "$option" | sed 's/--modules=//'` ;; From 3716b12ce271668bb02677dca7175fbea0f5dd86 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 21:55:25 +0000 Subject: [PATCH 1242/1707] 2009-11-08 Robert Millan * util/i386/pc/grub-mkrescue.in: Fix miss-identification as `grub-mkimage' (and use $0 when possible). --- ChangeLog | 5 +++++ util/i386/pc/grub-mkrescue.in | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index ac3950f2e..d6c3b7927 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-11-08 Robert Millan + + * util/i386/pc/grub-mkrescue.in: Fix miss-identification as + `grub-mkimage' (and use $0 when possible). + 2009-11-08 Robert Millan * kern/i386/multiboot_mmap.c (grub_machine_mmap_init): Improve diff --git a/util/i386/pc/grub-mkrescue.in b/util/i386/pc/grub-mkrescue.in index da937768b..cc581bffe 100644 --- a/util/i386/pc/grub-mkrescue.in +++ b/util/i386/pc/grub-mkrescue.in @@ -36,7 +36,7 @@ grub_mkimage=${bindir}/`echo grub-mkimage | sed ${transform}` # Print the usage. usage () { cat <. EOF @@ -67,7 +67,7 @@ for option in "$@"; do usage exit 0 ;; -v | --version) - echo "grub-mkrescue (GNU GRUB ${PACKAGE_VERSION})" + echo "$0 (GNU GRUB ${PACKAGE_VERSION})" exit 0 ;; --modules=*) modules=`echo "$option" | sed 's/--modules=//'` ;; From 4b4c4f64002ab606034c8f7e1d76a74269b92018 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 22:51:08 +0000 Subject: [PATCH 1243/1707] Import http://www.tux.org/pub/people/eric-youngdale/mkisofs/mkisofs-1.11.3.tar.gz --- util/mkisofs/defaults.h | 44 ++ util/mkisofs/eltorito.c | 265 ++++++++ util/mkisofs/exclude.h | 10 + util/mkisofs/fnmatch.c | 226 +++++++ util/mkisofs/hash.c | 226 +++++++ util/mkisofs/iso9660.h | 157 +++++ util/mkisofs/match.c | 56 ++ util/mkisofs/match.h | 14 + util/mkisofs/mkisofs.c | 660 ++++++++++++++++++++ util/mkisofs/mkisofs.h | 339 ++++++++++ util/mkisofs/multi.c | 1018 ++++++++++++++++++++++++++++++ util/mkisofs/name.c | 390 ++++++++++++ util/mkisofs/rock.c | 556 +++++++++++++++++ util/mkisofs/tree.c | 1292 +++++++++++++++++++++++++++++++++++++++ util/mkisofs/write.c | 1142 ++++++++++++++++++++++++++++++++++ 15 files changed, 6395 insertions(+) create mode 100644 util/mkisofs/defaults.h create mode 100644 util/mkisofs/eltorito.c create mode 100644 util/mkisofs/exclude.h create mode 100644 util/mkisofs/fnmatch.c create mode 100644 util/mkisofs/hash.c create mode 100644 util/mkisofs/iso9660.h create mode 100644 util/mkisofs/match.c create mode 100644 util/mkisofs/match.h create mode 100644 util/mkisofs/mkisofs.c create mode 100644 util/mkisofs/mkisofs.h create mode 100644 util/mkisofs/multi.c create mode 100644 util/mkisofs/name.c create mode 100644 util/mkisofs/rock.c create mode 100644 util/mkisofs/tree.c create mode 100644 util/mkisofs/write.c diff --git a/util/mkisofs/defaults.h b/util/mkisofs/defaults.h new file mode 100644 index 000000000..91e678992 --- /dev/null +++ b/util/mkisofs/defaults.h @@ -0,0 +1,44 @@ +/* + * Header file defaults.h - assorted default values for character strings in + * the volume descriptor. + * + * $Id: defaults.h,v 1.4 1997/04/10 03:31:53 eric Rel $ + */ + +#define PREPARER_DEFAULT NULL +#define PUBLISHER_DEFAULT NULL +#define APPID_DEFAULT NULL +#define COPYRIGHT_DEFAULT NULL +#define BIBLIO_DEFAULT NULL +#define ABSTRACT_DEFAULT NULL +#define VOLSET_ID_DEFAULT NULL +#define VOLUME_ID_DEFAULT "CDROM" +#define BOOT_CATALOG_DEFAULT "boot.catalog" +#define BOOT_IMAGE_DEFAULT NULL +#ifdef __QNX__ +#define SYSTEM_ID_DEFAULT "QNX" +#endif + +#ifdef __osf__ +#define SYSTEM_ID_DEFAULT "OSF" +#endif + +#ifdef __sun +#define SYSTEM_ID_DEFAULT "Solaris" +#endif + +#ifdef __hpux +#define SYSTEM_ID_DEFAULT "HP-UX" +#endif + +#ifdef __sgi +#define SYSTEM_ID_DEFAULT "SGI" +#endif + +#ifdef _AIX +#define SYSTEM_ID_DEFAULT "AIX" +#endif + +#ifndef SYSTEM_ID_DEFAULT +#define SYSTEM_ID_DEFAULT "LINUX" +#endif diff --git a/util/mkisofs/eltorito.c b/util/mkisofs/eltorito.c new file mode 100644 index 000000000..0ac5a1290 --- /dev/null +++ b/util/mkisofs/eltorito.c @@ -0,0 +1,265 @@ +/* + * Program eltorito.c - Handle El Torito specific extensions to iso9660. + * + + Written by Michael Fulbright (1996). + + Copyright 1996 RedHat Software, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + + +static char rcsid[] ="$Id: eltorito.c,v 1.7 1997/05/17 15:44:31 eric Exp $"; + +#include +#include +#include +#include +#include +#include + +#include "mkisofs.h" +#include "iso9660.h" + +#undef MIN +#define MIN(a, b) (((a) < (b))? (a): (b)) + +static struct eltorito_validation_entry valid_desc; +static struct eltorito_defaultboot_entry default_desc; + +/* + * Check for presence of boot catalog. If it does not exist then make it + */ +void FDECL1(init_boot_catalog, const char *, path) +{ + + int bcat; + char * bootpath; /* filename of boot catalog */ + char * buf; + struct stat statbuf; + + bootpath = (char *) e_malloc(strlen(boot_catalog)+strlen(path)+2); + strcpy(bootpath, path); + if (bootpath[strlen(bootpath)-1] != '/') + { + strcat(bootpath,"/"); + } + + strcat(bootpath, boot_catalog); + + /* + * check for the file existing + */ +#ifdef DEBUG_TORITO + printf("Looking for boot catalog file %s\n",bootpath); +#endif + + if (!stat_filter(bootpath, &statbuf)) + { + /* + * make sure its big enough to hold what we want + */ + if (statbuf.st_size == 2048) + { + /* + * printf("Boot catalog exists, so we do nothing\n"); + */ + free(bootpath); + return; + } + else + { + fprintf(stderr, "A boot catalog exists and appears corrupted.\n"); + fprintf(stderr, "Please check the following file: %s.\n",bootpath); + fprintf(stderr, "This file must be removed before a bootable CD can be done.\n"); + free(bootpath); + exit(1); + } + } + + /* + * file does not exist, so we create it + * make it one CD sector long + */ + bcat = open(bootpath, O_WRONLY | O_CREAT, S_IROTH | S_IRGRP | S_IRWXU ); + if (bcat == -1) + { + fprintf(stderr, "Error creating boot catalog, exiting...\n"); + perror(""); + exit(1); + } + + buf = (char *) e_malloc( 2048 ); + write(bcat, buf, 2048); + close(bcat); + free(bootpath); +} /* init_boot_catalog(... */ + +void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc) +{ + int bootcat; + int checksum; + unsigned char * checksum_ptr; + struct directory_entry * de; + struct directory_entry * de2; + int i; + int nsectors; + + memset(boot_desc, 0, sizeof(*boot_desc)); + boot_desc->id[0] = 0; + memcpy(boot_desc->id2, ISO_STANDARD_ID, sizeof(ISO_STANDARD_ID)); + boot_desc->version[0] = 1; + + memcpy(boot_desc->system_id, EL_TORITO_ID, sizeof(EL_TORITO_ID)); + + /* + * search from root of iso fs to find boot catalog + */ + de2 = search_tree_file(root, boot_catalog); + if (!de2) + { + fprintf(stderr,"Uh oh, I cant find the boot catalog!\n"); + exit(1); + } + + set_731(boot_desc->bootcat_ptr, + (unsigned int) get_733(de2->isorec.extent)); + + /* + * now adjust boot catalog + * lets find boot image first + */ + de=search_tree_file(root, boot_image); + if (!de) + { + fprintf(stderr,"Uh oh, I cant find the boot image!\n"); + exit(1); + } + + /* + * we have the boot image, so write boot catalog information + * Next we write out the primary descriptor for the disc + */ + memset(&valid_desc, 0, sizeof(valid_desc)); + valid_desc.headerid[0] = 1; + valid_desc.arch[0] = EL_TORITO_ARCH_x86; + + /* + * we'll shove start of publisher id into id field, may get truncated + * but who really reads this stuff! + */ + if (publisher) + memcpy_max(valid_desc.id, publisher, MIN(23, strlen(publisher))); + + valid_desc.key1[0] = 0x55; + valid_desc.key2[0] = 0xAA; + + /* + * compute the checksum + */ + checksum=0; + checksum_ptr = (unsigned char *) &valid_desc; + for (i=0; isize + 511) & ~(511))/512; + printf("\nSize of boot image is %d sectors -> ", nsectors); + + /* + * choose size of emulated floppy based on boot image size + */ + if (nsectors == 2880 ) + { + default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP; + printf("Emulating a 1.44 meg floppy\n"); + } + else if (nsectors == 5760 ) + { + default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP; + printf("Emulating a 2.88 meg floppy\n"); + } + else if (nsectors == 2400 ) + { + default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP; + printf("Emulating a 1.2 meg floppy\n"); + } + else + { + fprintf(stderr,"\nError - boot image is not the an allowable size.\n"); + exit(1); + } + + + /* + * FOR NOW LOAD 1 SECTOR, JUST LIKE FLOPPY BOOT!!! + */ + nsectors = 1; + set_721(default_desc.nsect, (unsigned int) nsectors ); +#ifdef DEBUG_TORITO + printf("Extent of boot images is %d\n",get_733(de->isorec.extent)); +#endif + set_731(default_desc.bootoff, + (unsigned int) get_733(de->isorec.extent)); + + /* + * now write it to disk + */ + bootcat = open(de2->whole_name, O_RDWR); + if (bootcat == -1) + { + fprintf(stderr,"Error opening boot catalog for update.\n"); + perror(""); + exit(1); + } + + /* + * write out + */ + write(bootcat, &valid_desc, 32); + write(bootcat, &default_desc, 32); + close(bootcat); +} /* get_torito_desc(... */ diff --git a/util/mkisofs/exclude.h b/util/mkisofs/exclude.h new file mode 100644 index 000000000..b9581a9e9 --- /dev/null +++ b/util/mkisofs/exclude.h @@ -0,0 +1,10 @@ +/* + * 9-Dec-93 R.-D. Marzusch, marzusch@odiehh.hanse.de: + * added 'exclude' option (-x) to specify pathnames NOT to be included in + * CD image. + * + * $Id: exclude.h,v 1.1 1997/02/23 15:53:19 eric Rel $ + */ + +void exclude(); +int is_excluded(); diff --git a/util/mkisofs/fnmatch.c b/util/mkisofs/fnmatch.c new file mode 100644 index 000000000..cd5c0b27c --- /dev/null +++ b/util/mkisofs/fnmatch.c @@ -0,0 +1,226 @@ +/* Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc. + +NOTE: The canonical source of this file is maintained with the GNU C Library. +Bugs can be reported to bug-glibc@prep.ai.mit.edu. + +This program is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) any +later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: fnmatch.c,v 1.3 1997/03/22 02:53:13 eric Rel $"; + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include + +#ifndef FNM_FILE_NAME +#define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ +#endif + +#ifndef FNM_LEADING_DIR +#define FNM_LEADING_DIR (1 << 3) /* Ignore `/...' after a match. */ +#endif + +#ifndef FNM_CASEFOLD +#define FNM_CASEFOLD (1 << 4) /* Compare without regard to case. */ +#endif + + +#include + +#if defined (STDC_HEADERS) || !defined (isascii) +#define ISASCII(c) 1 +#else +#define ISASCII(c) isascii(c) +#endif + +#define ISUPPER(c) (ISASCII (c) && isupper (c)) + + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + +#if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) +extern int errno; +#endif + +/* Match STRING against the filename pattern PATTERN, returning zero if + it matches, nonzero if not. */ +int +fnmatch (pattern, string, flags) + const char *pattern; + const char *string; + int flags; +{ + register const char *p = pattern, *n = string; + register char c; + +/* Note that this evalutes C many times. */ +#define FOLD(c) ((flags & FNM_CASEFOLD) && ISUPPER (c) ? tolower (c) : (c)) + + while ((c = *p++) != '\0') + { + c = FOLD (c); + + switch (c) + { + case '?': + if (*n == '\0') + return FNM_NOMATCH; + else if ((flags & FNM_FILE_NAME) && *n == '/') + return FNM_NOMATCH; + else if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + break; + + case '\\': + if (!(flags & FNM_NOESCAPE)) + { + c = *p++; + c = FOLD (c); + } + if (FOLD (*n) != c) + return FNM_NOMATCH; + break; + + case '*': + if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + + for (c = *p++; c == '?' || c == '*'; c = *p++, ++n) + if (((flags & FNM_FILE_NAME) && *n == '/') || + (c == '?' && *n == '\0')) + return FNM_NOMATCH; + + if (c == '\0') + return 0; + + { + char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; + c1 = FOLD (c1); + for (--p; *n != '\0'; ++n) + if ((c == '[' || FOLD (*n) == c1) && + fnmatch (p, n, flags & ~FNM_PERIOD) == 0) + return 0; + return FNM_NOMATCH; + } + + case '[': + { + /* Nonzero if the sense of the character class is inverted. */ + register int not; + + if (*n == '\0') + return FNM_NOMATCH; + + if ((flags & FNM_PERIOD) && *n == '.' && + (n == string || ((flags & FNM_FILE_NAME) && n[-1] == '/'))) + return FNM_NOMATCH; + + not = (*p == '!' || *p == '^'); + if (not) + ++p; + + c = *p++; + for (;;) + { + register char cstart = c, cend = c; + + if (!(flags & FNM_NOESCAPE) && c == '\\') + cstart = cend = *p++; + + cstart = cend = FOLD (cstart); + + if (c == '\0') + /* [ (unterminated) loses. */ + return FNM_NOMATCH; + + c = *p++; + c = FOLD (c); + + if ((flags & FNM_FILE_NAME) && c == '/') + /* [/] can never match. */ + return FNM_NOMATCH; + + if (c == '-' && *p != ']') + { + cend = *p++; + if (!(flags & FNM_NOESCAPE) && cend == '\\') + cend = *p++; + if (cend == '\0') + return FNM_NOMATCH; + cend = FOLD (cend); + + c = *p++; + } + + if (FOLD (*n) >= cstart && FOLD (*n) <= cend) + goto matched; + + if (c == ']') + break; + } + if (!not) + return FNM_NOMATCH; + break; + + matched:; + /* Skip the rest of the [...] that already matched. */ + while (c != ']') + { + if (c == '\0') + /* [... (unterminated) loses. */ + return FNM_NOMATCH; + + c = *p++; + if (!(flags & FNM_NOESCAPE) && c == '\\') + /* XXX 1003.2d11 is unclear if this is right. */ + ++p; + } + if (not) + return FNM_NOMATCH; + } + break; + + default: + if (c != FOLD (*n)) + return FNM_NOMATCH; + } + + ++n; + } + + if (*n == '\0') + return 0; + + if ((flags & FNM_LEADING_DIR) && *n == '/') + /* The FNM_LEADING_DIR flag says that "foo*" matches "foobar/frobozz". */ + return 0; + + return FNM_NOMATCH; +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ diff --git a/util/mkisofs/hash.c b/util/mkisofs/hash.c new file mode 100644 index 000000000..67098d580 --- /dev/null +++ b/util/mkisofs/hash.c @@ -0,0 +1,226 @@ +/* + * File hash.c - generate hash tables for iso9660 filesystem. + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: hash.c,v 1.2 1997/02/23 16:11:15 eric Rel $"; + +#include +#include "mkisofs.h" + +#define NR_HASH 1024 + +#define HASH_FN(DEV, INO) ((DEV + INO + (INO >> 2) + (INO << 8)) % NR_HASH) + +static struct file_hash * hash_table[NR_HASH] = {0,}; + +void FDECL1(add_hash, struct directory_entry *, spnt){ + struct file_hash * s_hash; + unsigned int hash_number; + + if(spnt->size == 0 || spnt->starting_block == 0) + if(spnt->size != 0 || spnt->starting_block != 0) { + fprintf(stderr,"Non zero-length file assigned zero extent.\n"); + exit(1); + }; + + if (spnt->dev == (dev_t) UNCACHED_DEVICE || spnt->inode == UNCACHED_INODE) return; + hash_number = HASH_FN((unsigned int) spnt->dev, (unsigned int) spnt->inode); + +#if 0 + if (verbose) fprintf(stderr,"%s ",spnt->name); +#endif + s_hash = (struct file_hash *) e_malloc(sizeof(struct file_hash)); + s_hash->next = hash_table[hash_number]; + s_hash->inode = spnt->inode; + s_hash->dev = spnt->dev; + s_hash->starting_block = spnt->starting_block; + s_hash->size = spnt->size; + hash_table[hash_number] = s_hash; +} + +struct file_hash * FDECL2(find_hash, dev_t, dev, ino_t, inode){ + unsigned int hash_number; + struct file_hash * spnt; + hash_number = HASH_FN((unsigned int) dev, (unsigned int) inode); + if (dev == (dev_t) UNCACHED_DEVICE || inode == UNCACHED_INODE) return NULL; + + spnt = hash_table[hash_number]; + while(spnt){ + if(spnt->inode == inode && spnt->dev == dev) return spnt; + spnt = spnt->next; + }; + return NULL; +} + + +static struct file_hash * directory_hash_table[NR_HASH] = {0,}; + +void FDECL2(add_directory_hash, dev_t, dev, ino_t, inode){ + struct file_hash * s_hash; + unsigned int hash_number; + + if (dev == (dev_t) UNCACHED_DEVICE || inode == UNCACHED_INODE) return; + hash_number = HASH_FN((unsigned int) dev, (unsigned int) inode); + + s_hash = (struct file_hash *) e_malloc(sizeof(struct file_hash)); + s_hash->next = directory_hash_table[hash_number]; + s_hash->inode = inode; + s_hash->dev = dev; + directory_hash_table[hash_number] = s_hash; +} + +struct file_hash * FDECL2(find_directory_hash, dev_t, dev, ino_t, inode){ + unsigned int hash_number; + struct file_hash * spnt; + hash_number = HASH_FN((unsigned int) dev, (unsigned int) inode); + if (dev == (dev_t) UNCACHED_DEVICE || inode == UNCACHED_INODE) return NULL; + + spnt = directory_hash_table[hash_number]; + while(spnt){ + if(spnt->inode == inode && spnt->dev == dev) return spnt; + spnt = spnt->next; + }; + return NULL; +} + +struct name_hash +{ + struct name_hash * next; + struct directory_entry * de; +}; + +#define NR_NAME_HASH 128 + +static struct name_hash * name_hash_table[NR_NAME_HASH] = {0,}; + +/* + * Find the hash bucket for this name. + */ +static unsigned int FDECL1(name_hash, const char *, name) +{ + unsigned int hash = 0; + const char * p; + + p = name; + + while (*p) + { + /* + * Don't hash the iso9660 version number. This way + * we can detect duplicates in cases where we have + * directories (i.e. foo) and non-directories + * (i.e. foo;1). + */ + if( *p == ';' ) + { + break; + } + hash = (hash << 15) + (hash << 3) + (hash >> 3) + *p++; + } + return hash % NR_NAME_HASH; +} + +void FDECL1(add_file_hash, struct directory_entry *, de){ + struct name_hash * new; + int hash; + + new = (struct name_hash *) e_malloc(sizeof(struct name_hash)); + new->de = de; + new->next = NULL; + hash = name_hash(de->isorec.name); + + /* Now insert into the hash table */ + new->next = name_hash_table[hash]; + name_hash_table[hash] = new; +} + +struct directory_entry * FDECL1(find_file_hash, char *, name) +{ + struct name_hash * nh; + char * p1; + char * p2; + + for(nh = name_hash_table[name_hash(name)]; nh; nh = nh->next) + { + p1 = name; + p2 = nh->de->isorec.name; + + /* + * Look for end of string, or a mismatch. + */ + while(1==1) + { + if( (*p1 == '\0' || *p1 == ';') + || (*p2 == '\0' || *p2 == ';') + || (*p1 != *p2) ) + { + break; + } + p1++; + p2++; + } + + /* + * If we are at the end of both strings, then + * we have a match. + */ + if( (*p1 == '\0' || *p1 == ';') + && (*p2 == '\0' || *p2 == ';') ) + { + return nh->de; + } + } + return NULL; +} + +int FDECL1(delete_file_hash, struct directory_entry *, de){ + struct name_hash * nh, *prev; + int hash; + + prev = NULL; + hash = name_hash(de->isorec.name); + for(nh = name_hash_table[hash]; nh; nh = nh->next) { + if(nh->de == de) break; + prev = nh; + } + if(!nh) return 1; + if(!prev) + name_hash_table[hash] = nh->next; + else + prev->next = nh->next; + free(nh); + return 0; +} + +void flush_file_hash(){ + struct name_hash * nh, *nh1; + int i; + + for(i=0; inext; + free(nh); + nh = nh1; + } + name_hash_table[i] = NULL; + + } +} diff --git a/util/mkisofs/iso9660.h b/util/mkisofs/iso9660.h new file mode 100644 index 000000000..a58f96f0d --- /dev/null +++ b/util/mkisofs/iso9660.h @@ -0,0 +1,157 @@ +/* + * Header file iso9660.h - assorted structure definitions and typecasts. + * specific to iso9660 filesystem. + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* + * $Id: iso9660.h,v 1.1 1997/02/23 15:55:25 eric Rel $ + */ + +#ifndef _ISOFS_FS_H +#define _ISOFS_FS_H + +/* + * The isofs filesystem constants/structures + */ + +/* This part borrowed from the bsd386 isofs */ +#define ISODCL(from, to) (to - from + 1) + +struct iso_volume_descriptor { + char type[ISODCL(1,1)]; /* 711 */ + char id[ISODCL(2,6)]; + char version[ISODCL(7,7)]; + char data[ISODCL(8,2048)]; +}; + +/* volume descriptor types */ +#define ISO_VD_PRIMARY 1 +#define ISO_VD_END 255 + +#define ISO_STANDARD_ID "CD001" + +#define EL_TORITO_ID "EL TORITO SPECIFICATION" +#define EL_TORITO_ARCH_x86 0 +#define EL_TORITO_ARCH_PPC 1 +#define EL_TORITO_ARCH_MAC 2 +#define EL_TORITO_BOOTABLE 0x88 +#define EL_TORITO_MEDIA_NOEMUL 0 +#define EL_TORITO_MEDIA_12FLOP 1 +#define EL_TORITO_MEDIA_144FLOP 2 +#define EL_TORITO_MEDIA_288FLOP 3 +#define EL_TORITO_MEDIA_HD 4 + +struct iso_primary_descriptor { + char type [ISODCL ( 1, 1)]; /* 711 */ + char id [ISODCL ( 2, 6)]; + char version [ISODCL ( 7, 7)]; /* 711 */ + char unused1 [ISODCL ( 8, 8)]; + char system_id [ISODCL ( 9, 40)]; /* achars */ + char volume_id [ISODCL ( 41, 72)]; /* dchars */ + char unused2 [ISODCL ( 73, 80)]; + char volume_space_size [ISODCL ( 81, 88)]; /* 733 */ + char unused3 [ISODCL ( 89, 120)]; + char volume_set_size [ISODCL (121, 124)]; /* 723 */ + char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ + char logical_block_size [ISODCL (129, 132)]; /* 723 */ + char path_table_size [ISODCL (133, 140)]; /* 733 */ + char type_l_path_table [ISODCL (141, 144)]; /* 731 */ + char opt_type_l_path_table [ISODCL (145, 148)]; /* 731 */ + char type_m_path_table [ISODCL (149, 152)]; /* 732 */ + char opt_type_m_path_table [ISODCL (153, 156)]; /* 732 */ + char root_directory_record [ISODCL (157, 190)]; /* 9.1 */ + char volume_set_id [ISODCL (191, 318)]; /* dchars */ + char publisher_id [ISODCL (319, 446)]; /* achars */ + char preparer_id [ISODCL (447, 574)]; /* achars */ + char application_id [ISODCL (575, 702)]; /* achars */ + char copyright_file_id [ISODCL (703, 739)]; /* 7.5 dchars */ + char abstract_file_id [ISODCL (740, 776)]; /* 7.5 dchars */ + char bibliographic_file_id [ISODCL (777, 813)]; /* 7.5 dchars */ + char creation_date [ISODCL (814, 830)]; /* 8.4.26.1 */ + char modification_date [ISODCL (831, 847)]; /* 8.4.26.1 */ + char expiration_date [ISODCL (848, 864)]; /* 8.4.26.1 */ + char effective_date [ISODCL (865, 881)]; /* 8.4.26.1 */ + char file_structure_version [ISODCL (882, 882)]; /* 711 */ + char unused4 [ISODCL (883, 883)]; + char application_data [ISODCL (884, 1395)]; + char unused5 [ISODCL (1396, 2048)]; +}; + +/* El Torito Boot Record Volume Descriptor */ +struct eltorito_boot_descriptor { + char id [ISODCL ( 1, 1)]; /* 711 */ + char id2 [ISODCL ( 2, 6)]; + char version [ISODCL ( 7, 7)]; /* 711 */ + char system_id [ISODCL ( 8, 39)]; + char unused2 [ISODCL ( 40, 71)]; + char bootcat_ptr [ISODCL ( 72 , 75)]; + char unused5 [ISODCL ( 76, 2048)]; +}; + +/* Validation entry for El Torito */ +struct eltorito_validation_entry { + char headerid [ISODCL ( 1, 1)]; /* 711 */ + char arch [ISODCL ( 2, 2)]; + char pad1 [ISODCL ( 3, 4)]; /* 711 */ + char id [ISODCL ( 5, 28)]; + char cksum [ISODCL ( 29, 30)]; + char key1 [ISODCL ( 31, 31)]; + char key2 [ISODCL ( 32, 32)]; +}; + +/* El Torito initial/default entry in boot catalog */ +struct eltorito_defaultboot_entry { + char boot_id [ISODCL ( 1, 1)]; /* 711 */ + char boot_media [ISODCL ( 2, 2)]; + char loadseg [ISODCL ( 3, 4)]; /* 711 */ + char arch [ISODCL ( 5, 5)]; + char pad1 [ISODCL ( 6, 6)]; + char nsect [ISODCL ( 7, 8)]; + char bootoff [ISODCL ( 9, 12)]; + char pad2 [ISODCL ( 13, 32)]; +}; + + +/* We use this to help us look up the parent inode numbers. */ + +struct iso_path_table{ + unsigned char name_len[2]; /* 721 */ + char extent[4]; /* 731 */ + char parent[2]; /* 721 */ + char name[1]; +}; + +struct iso_directory_record { + unsigned char length [ISODCL (1, 1)]; /* 711 */ + char ext_attr_length [ISODCL (2, 2)]; /* 711 */ + char extent [ISODCL (3, 10)]; /* 733 */ + char size [ISODCL (11, 18)]; /* 733 */ + char date [ISODCL (19, 25)]; /* 7 by 711 */ + char flags [ISODCL (26, 26)]; + char file_unit_size [ISODCL (27, 27)]; /* 711 */ + char interleave [ISODCL (28, 28)]; /* 711 */ + char volume_sequence_number [ISODCL (29, 32)]; /* 723 */ + unsigned char name_len [ISODCL (33, 33)]; /* 711 */ + char name [34]; /* Not really, but we need something here */ +}; +#endif + + + diff --git a/util/mkisofs/match.c b/util/mkisofs/match.c new file mode 100644 index 000000000..0f5c7d8a7 --- /dev/null +++ b/util/mkisofs/match.c @@ -0,0 +1,56 @@ +/* + * 27-Mar-96: Jan-Piet Mens + * added 'match' option (-m) to specify regular expressions NOT to be included + * in the CD image. + */ + +static char rcsid[] ="$Id: match.c,v 1.2 1997/02/23 16:10:42 eric Rel $"; + +#include +#ifndef VMS +#ifdef HAVE_MALLOC_H +#include +#else +#include +#endif +#endif +#include +#include "match.h" + +#define MAXMATCH 1000 +static char *mat[MAXMATCH]; + +void add_match(fn) +char * fn; +{ + register int i; + + for (i=0; mat[i] && i excluded filenmae */ + } + } + return 0; /* not found -> not excluded */ +} diff --git a/util/mkisofs/match.h b/util/mkisofs/match.h new file mode 100644 index 000000000..90def7c2d --- /dev/null +++ b/util/mkisofs/match.h @@ -0,0 +1,14 @@ +/* + * 27th March 1996. Added by Jan-Piet Mens for matching regular expressions + * in paths. + * + */ + +/* + * $Id: match.h,v 1.1 1997/02/23 15:56:12 eric Rel $ + */ + +#include "fnmatch.h" + +void add_match(); +int matches(); diff --git a/util/mkisofs/mkisofs.c b/util/mkisofs/mkisofs.c new file mode 100644 index 000000000..a2e2d1874 --- /dev/null +++ b/util/mkisofs/mkisofs.c @@ -0,0 +1,660 @@ +/* + * Program mkisofs.c - generate iso9660 filesystem based upon directory + * tree on hard disk. + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: mkisofs.c,v 1.10.1.3 1998/06/02 03:36:16 eric Exp $"; + +/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ + +#include +#include "mkisofs.h" +#include "config.h" + +#ifdef linux +#include +#endif + +#include "iso9660.h" +#include + +#ifndef VMS +#include +#else +#include +#include "vms.h" +#endif + +#include +#include + +#ifndef VMS +#ifdef HAVE_UNISTD_H +#include +#endif +#endif + +#include "exclude.h" + +#ifdef __NetBSD__ +#include +#include +#endif + +struct directory * root = NULL; + +static char version_string[] = "mkisofs v1.11.3"; + +FILE * discimage; +unsigned int next_extent = 0; +unsigned int last_extent = 0; +unsigned int session_start = 0; +unsigned int path_table_size = 0; +unsigned int path_table[4] = {0,}; +unsigned int path_blocks = 0; +struct iso_directory_record root_record; +char * extension_record = NULL; +int extension_record_extent = 0; +static int extension_record_size = 0; + +/* These variables are associated with command line options */ +int use_eltorito = 0; +int use_RockRidge = 0; +int verbose = 0; +int all_files = 0; +int follow_links = 0; +int rationalize = 0; +int generate_tables = 0; +char * preparer = PREPARER_DEFAULT; +char * publisher = PUBLISHER_DEFAULT; +char * appid = APPID_DEFAULT; +char * copyright = COPYRIGHT_DEFAULT; +char * biblio = BIBLIO_DEFAULT; +char * abstract = ABSTRACT_DEFAULT; +char * volset_id = VOLSET_ID_DEFAULT; +char * volume_id = VOLUME_ID_DEFAULT; +char * system_id = SYSTEM_ID_DEFAULT; +char * boot_catalog = BOOT_CATALOG_DEFAULT; +char * boot_image = BOOT_IMAGE_DEFAULT; + +int omit_period = 0; /* Violates iso9660, but these are a pain */ +int transparent_compression = 0; /* So far only works with linux */ +int omit_version_number = 0; /* May violate iso9660, but noone uses vers*/ +int RR_relocation_depth = 6; /* Violates iso9660, but most systems work */ +int full_iso9660_filenames = 0; /* Used with Amiga. Disc will not work with + DOS */ +int allow_leading_dots = 0; /* DOS cannot read names with leading dots */ + +struct rcopts{ + char * tag; + char ** variable; +}; + +struct rcopts rcopt[] = { + {"PREP", &preparer}, + {"PUBL", &publisher}, + {"APPI", &appid}, + {"COPY", ©right}, + {"BIBL", &biblio}, + {"ABST", &abstract}, + {"VOLS", &volset_id}, + {"VOLI", &volume_id}, + {"SYSI", &system_id}, + {NULL, NULL} +}; + +#if defined(ultrix) || defined(_AUX_SOURCE) +char *strdup(s) +char *s;{char *c;if(c=(char *)malloc(strlen(s)+1))strcpy(c,s);return c;} +#endif + +void FDECL1(read_rcfile, char *, appname) +{ + FILE * rcfile; + struct rcopts * rco; + char * pnt, *pnt1; + char linebuffer[256]; + static char rcfn[] = ".mkisofsrc"; + char filename[1000]; + int linum; + + strcpy(filename, rcfn); + rcfile = fopen(filename, "r"); + if (!rcfile && errno != ENOENT) + perror(filename); + + if (!rcfile) + { + pnt = getenv("MKISOFSRC"); + if (pnt && strlen(pnt) <= sizeof(filename)) + { + strcpy(filename, pnt); + rcfile = fopen(filename, "r"); + if (!rcfile && errno != ENOENT) + perror(filename); + } + } + + if (!rcfile) + { + pnt = getenv("HOME"); + if (pnt && strlen(pnt) + strlen(rcfn) + 2 <= sizeof(filename)) + { + strcpy(filename, pnt); + strcat(filename, "/"); + strcat(filename, rcfn); + rcfile = fopen(filename, "r"); + if (!rcfile && errno != ENOENT) + perror(filename); + } + } + if (!rcfile && strlen(appname)+sizeof(rcfn)+2 <= sizeof(filename)) + { + strcpy(filename, appname); + pnt = strrchr(filename, '/'); + if (pnt) + { + strcpy(pnt + 1, rcfn); + rcfile = fopen(filename, "r"); + if (!rcfile && errno != ENOENT) + perror(filename); + } + } + if (!rcfile) + return; + fprintf(stderr, "Using \"%s\"\n", filename); + /* OK, we got it. Now read in the lines and parse them */ + linum = 0; + while (fgets(linebuffer, sizeof(linebuffer), rcfile)) + { + char *name; + char *name_end; + ++linum; + /* skip any leading white space */ + pnt = linebuffer; + while (*pnt == ' ' || *pnt == '\t') + ++pnt; + /* If we are looking at a # character, this line is a comment. */ + if (*pnt == '#') + continue; + /* The name should begin in the left margin. Make sure it is in + upper case. Stop when we see white space or a comment. */ + name = pnt; + while (*pnt && isalpha(*pnt)) + { + if(islower(*pnt)) + *pnt = toupper(*pnt); + pnt++; + } + if (name == pnt) + { + fprintf(stderr, "%s:%d: name required\n", filename, linum); + continue; + } + name_end = pnt; + /* Skip past white space after the name */ + while (*pnt == ' ' || *pnt == '\t') + pnt++; + /* silently ignore errors in the rc file. */ + if (*pnt != '=') + { + fprintf(stderr, "%s:%d: equals sign required\n", filename, linum); + continue; + } + /* Skip pas the = sign, and any white space following it */ + pnt++; /* Skip past '=' sign */ + while (*pnt == ' ' || *pnt == '\t') + pnt++; + + /* now it is safe to NUL terminate the name */ + + *name_end = 0; + + /* Now get rid of trailing newline */ + + pnt1 = pnt; + while (*pnt1) + { + if (*pnt1 == '\n') + { + *pnt1 = 0; + break; + } + pnt1++; + }; + /* OK, now figure out which option we have */ + for(rco = rcopt; rco->tag; rco++) { + if(strcmp(rco->tag, name) == 0) + { + *rco->variable = strdup(pnt); + break; + }; + } + if (rco->tag == NULL) + { + fprintf(stderr, "%s:%d: field name \"%s\" unknown\n", filename, linum, + name); + } + } + if (ferror(rcfile)) + perror(filename); + fclose(rcfile); +} + +char * path_table_l = NULL; +char * path_table_m = NULL; +int goof = 0; + +void usage(){ + fprintf(stderr,"Usage:\n"); + fprintf(stderr, +"mkisofs [-o outfile] [-R] [-V volid] [-v] [-a] \ +[-T]\n [-l] [-d] [-V] [-D] [-L] [-p preparer]" +#ifdef ADD_FILES +"[-i file] \n" +#endif +"[-P publisher] [ -A app_id ] [-z] \n \ +[-b boot_image_name] [-c boot_catalog-name] \ +[-x path -x path ...] path\n"); + exit(1); +} + + +/* + * Fill in date in the iso9660 format + * + * The standards state that the timezone offset is in multiples of 15 + * minutes, and is what you add to GMT to get the localtime. The U.S. + * is always at a negative offset, from -5h to -8h (can vary a little + * with DST, I guess). The Linux iso9660 filesystem has had the sign + * of this wrong for ages (mkisofs had it wrong too for the longest time). + */ +int FDECL2(iso9660_date,char *, result, time_t, ctime){ + struct tm *local; + local = localtime(&ctime); + result[0] = local->tm_year; + result[1] = local->tm_mon + 1; + result[2] = local->tm_mday; + result[3] = local->tm_hour; + result[4] = local->tm_min; + result[5] = local->tm_sec; + + /* + * Must recalculate proper timezone offset each time, + * as some files use daylight savings time and some don't... + */ + result[6] = local->tm_yday; /* save yday 'cause gmtime zaps it */ + local = gmtime(&ctime); + local->tm_year -= result[0]; + local->tm_yday -= result[6]; + local->tm_hour -= result[3]; + local->tm_min -= result[4]; + if (local->tm_year < 0) + { + local->tm_yday = -1; + } + else + { + if (local->tm_year > 0) local->tm_yday = 1; + } + + result[6] = -(local->tm_min + 60*(local->tm_hour + 24*local->tm_yday)) / 15; + + return 0; +} + + +extern char * cdwrite_data; + +int FDECL2(main, int, argc, char **, argv){ + char * outfile; + struct directory_entry de; + unsigned long mem_start; + struct stat statbuf; + char * scan_tree; + char * merge_image = NULL; + struct iso_directory_record * mrootp = NULL; + int c; +#ifdef ADD_FILES + char *add_file_file = NULL; +#endif + + if (argc < 2) + usage(); + + /* Get the defaults from the .mkisofsrc file */ + read_rcfile(argv[0]); + + outfile = NULL; + while ((c = getopt(argc, argv, "i:o:V:RrfvaTp:P:b:c:x:dDlLNzA:M:m:C:")) != EOF) + switch (c) + { + case 'C': + /* + * This is a temporary hack until cdwrite gets the proper hooks in + * it. + */ + cdwrite_data = optarg; + break; + case 'a': + all_files++; + break; + case 'b': + use_eltorito++; + boot_image = optarg; /* pathname of the boot image on cd */ + if (boot_image == NULL) { + fprintf(stderr,"Required boot image pathname missing\n"); + exit(1); + } + break; + case 'c': + use_eltorito++; + boot_catalog = optarg; /* pathname of the boot image on cd */ + if (boot_catalog == NULL) { + fprintf(stderr,"Required boot catalog pathname missing\n"); + exit(1); + } + break; + case 'A': + appid = optarg; + if(strlen(appid) > 128) { + fprintf(stderr,"Application-id string too long\n"); + exit(1); + }; + break; + case 'd': + omit_period++; + break; + case 'D': + RR_relocation_depth = 32767; + break; + case 'f': + follow_links++; + break; + case 'i': +#ifdef ADD_FILES + add_file_file = optarg; + break; +#else + usage(); + exit(1); +#endif + case 'l': + full_iso9660_filenames++; + break; + case 'L': + allow_leading_dots++; + break; + case 'M': + merge_image = optarg; + break; + case 'N': + omit_version_number++; + break; + case 'o': + outfile = optarg; + break; + case 'p': + preparer = optarg; + if(strlen(preparer) > 128) { + fprintf(stderr,"Preparer string too long\n"); + exit(1); + }; + break; + case 'P': + publisher = optarg; + if(strlen(publisher) > 128) { + fprintf(stderr,"Publisher string too long\n"); + exit(1); + }; + break; + case 'R': + use_RockRidge++; + break; + case 'r': + rationalize++; + use_RockRidge++; + break; + case 'T': + generate_tables++; + break; + case 'V': + volume_id = optarg; + break; + case 'v': + verbose++; + break; + case 'z': +#ifdef VMS + fprintf(stderr,"Transparent compression not supported with VMS\n"); + exit(1); +#else + transparent_compression++; +#endif + break; + case 'm': + add_match(optarg); + break; + case 'x': + exclude(optarg); + break; + default: + usage(); + exit(1); + } +#ifdef __NetBSD__ + { + int resource; + struct rlimit rlp; + if (getrlimit(RLIMIT_DATA,&rlp) == -1) + perror("Warning: getrlimit"); + else { + rlp.rlim_cur=33554432; + if (setrlimit(RLIMIT_DATA,&rlp) == -1) + perror("Warning: setrlimit"); + } + } +#endif +#ifdef HAVE_SBRK + mem_start = (unsigned long) sbrk(0); +#endif + + if(verbose) fprintf(stderr,"%s\n", version_string); + + if( (cdwrite_data != NULL && merge_image == NULL) + || (cdwrite_data == NULL && merge_image != NULL) ) + { + fprintf(stderr,"Multisession usage bug - both -C and -M must be specified.\n"); + exit(0); + } + + /* The first step is to scan the directory tree, and take some notes */ + + scan_tree = argv[optind]; + +#ifdef ADD_FILES + if (add_file_file) { + add_file(add_file_file); + } + add_file_list (argc, argv, optind+1); +#endif + + if(!scan_tree){ + usage(); + exit(1); + }; + +#ifndef VMS + if(scan_tree[strlen(scan_tree)-1] != '/') { + scan_tree = (char *) e_malloc(strlen(argv[optind])+2); + strcpy(scan_tree, argv[optind]); + strcat(scan_tree, "/"); + }; +#endif + + if(use_RockRidge){ +#if 1 + extension_record = generate_rr_extension_record("RRIP_1991A", + "THE ROCK RIDGE INTERCHANGE PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS", + "PLEASE CONTACT DISC PUBLISHER FOR SPECIFICATION SOURCE. SEE PUBLISHER IDENTIFIER IN PRIMARY VOLUME DESCRIPTOR FOR CONTACT INFORMATION.", &extension_record_size); +#else + extension_record = generate_rr_extension_record("IEEE_P1282", + "THE IEEE P1282 PROTOCOL PROVIDES SUPPORT FOR POSIX FILE SYSTEM SEMANTICS", + "PLEASE CONTACT THE IEEE STANDARDS DEPARTMENT, PISCATAWAY, NJ, USA FOR THE P1282 SPECIFICATION.", &extension_record_size); +#endif + } + + /* + * See if boot catalog file exists in root directory, if not + * we will create it. + */ + if (use_eltorito) + init_boot_catalog(argv[optind]); + + /* + * Find the device and inode number of the root directory. + * Record this in the hash table so we don't scan it more than + * once. + */ + stat_filter(argv[optind], &statbuf); + add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); + + memset(&de, 0, sizeof(de)); + + de.filedir = root; /* We need this to bootstrap */ + + if( merge_image != NULL ) + { + mrootp = merge_isofs(merge_image); + if( mrootp == NULL ) + { + /* + * Complain and die. + */ + fprintf(stderr,"Unable to open previous session image %s\n", + merge_image); + exit(1); + } + + memcpy(&de.isorec.extent, mrootp->extent, 8); + } + + /* + * Scan the actual directory (and any we find below it) + * for files to write out to the output image. + */ + if (!scan_directory_tree(argv[optind], &de, mrootp)) + { + exit(1); + } + + /* + * Fix a couple of things in the root directory so that everything + * is self consistent. + */ + root->self = root->contents; /* Fix this up so that the path tables get done right */ + + if(reloc_dir) sort_n_finish(reloc_dir); + + if (goof) exit(1); + + /* + * OK, ready to write the file. Open it up, and generate the thing. + */ + if (outfile){ + discimage = fopen(outfile, "w"); + if (!discimage){ + fprintf(stderr,"Unable to open disc image file\n"); + exit(1); + + }; + } else + discimage = stdout; + + /* Now assign addresses on the disc for the path table. */ + + path_blocks = (path_table_size + (SECTOR_SIZE - 1)) >> 11; + if (path_blocks & 1) path_blocks++; + + path_table[0] = session_start + 0x10 + 2 + (use_eltorito ? 1 : 0); + path_table[1] = 0; + path_table[2] = path_table[0] + path_blocks; + path_table[3] = 0; + + last_extent += path_table[2] - session_start + path_blocks; + /* The next free block */ + + /* The next step is to go through the directory tree and assign extent + numbers for all of the directories */ + + assign_directory_addresses(root); + + if(extension_record) { + struct directory_entry * s_entry; + extension_record_extent = last_extent++; + s_entry = root->contents; + set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 24, + extension_record_extent); + set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 8, + extension_record_size); + }; + + if (use_RockRidge && reloc_dir) + finish_cl_pl_entries(); + + /* Now we generate the path tables that are used by DOS to improve directory + access times. */ + generate_path_tables(); + + /* Generate root record for volume descriptor. */ + generate_root_record(); + + if (verbose) + dump_tree(root); + + if( in_image != NULL ) + { + fclose(in_image); + } + + iso_write(discimage); + +#ifdef HAVE_SBRK + fprintf(stderr,"Max brk space used %x\n", + (unsigned int)(((unsigned long)sbrk(0)) - mem_start)); +#endif + fprintf(stderr,"%d extents written (%d Mb)\n", last_extent, last_extent >> 9); +#ifdef VMS + return 1; +#else + return 0; +#endif +} + +void * +FDECL1(e_malloc, size_t, size) +{ +void* pt = 0; + if( (size > 0) && ((pt=malloc(size))==NULL) ) { + fprintf(stderr, "Not enough memory\n"); + exit (1); + } +return pt; +} diff --git a/util/mkisofs/mkisofs.h b/util/mkisofs/mkisofs.h new file mode 100644 index 000000000..bc264d99a --- /dev/null +++ b/util/mkisofs/mkisofs.h @@ -0,0 +1,339 @@ +/* + * Header file mkisofs.h - assorted structure definitions and typecasts. + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +/* + * $Id: mkisofs.h,v 1.5 1997/05/17 15:50:28 eric Exp $ + */ + +/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ + +#include + +/* This symbol is used to indicate that we do not have things like + symlinks, devices, and so forth available. Just files and dirs */ + +#ifdef VMS +#define NON_UNIXFS +#endif + +#ifdef DJGPP +#define NON_UNIXFS +#endif + +#ifdef VMS +#include +#define dirent direct +#else +#include +#endif + +#include +#include +#include + +#ifdef linux +#include +#endif + +#ifdef ultrix +extern char *strdup(); +#endif + +#ifdef __STDC__ +#define DECL(NAME,ARGS) NAME ARGS +#define FDECL1(NAME,TYPE0, ARG0) \ + NAME(TYPE0 ARG0) +#define FDECL2(NAME,TYPE0, ARG0,TYPE1, ARG1) \ + NAME(TYPE0 ARG0, TYPE1 ARG1) +#define FDECL3(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2) \ + NAME(TYPE0 ARG0, TYPE1 ARG1, TYPE2 ARG2) +#define FDECL4(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2, TYPE3, ARG3) \ + NAME(TYPE0 ARG0, TYPE1 ARG1, TYPE2 ARG2, TYPE3 ARG3) +#define FDECL5(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2, TYPE3, ARG3, TYPE4, ARG4) \ + NAME(TYPE0 ARG0, TYPE1 ARG1, TYPE2 ARG2, TYPE3 ARG3, TYPE4 ARG4) +#define FDECL6(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2, TYPE3, ARG3, TYPE4, ARG4, TYPE5, ARG5) \ + NAME(TYPE0 ARG0, TYPE1 ARG1, TYPE2 ARG2, TYPE3 ARG3, TYPE4 ARG4, TYPE5 ARG5) +#else +#define DECL(NAME,ARGS) NAME() +#define FDECL1(NAME,TYPE0, ARG0) NAME(ARG0) TYPE0 ARG0; +#define FDECL2(NAME,TYPE0, ARG0,TYPE1, ARG1) NAME(ARG0, ARG1) TYPE0 ARG0; TYPE1 ARG1; +#define FDECL3(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2) \ + NAME(ARG0, ARG1, ARG2) TYPE0 ARG0; TYPE1 ARG1; TYPE2 ARG2; +#define FDECL4(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2, TYPE3, ARG3) \ + NAME(ARG0, ARG1, ARG2, ARG3, ARG4) TYPE0 ARG0; TYPE1 ARG1; TYPE2 ARG2; TYPE3 ARG3; +#define FDECL5(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2, TYPE3, ARG3, TYPE4, ARG4) \ + NAME(ARG0, ARG1, ARG2, ARG3, ARG4) TYPE0 ARG0; TYPE1 ARG1; TYPE2 ARG2; TYPE3 ARG3; TYPE4 ARG4; +#define FDECL6(NAME,TYPE0, ARG0,TYPE1, ARG1, TYPE2, ARG2, TYPE3, ARG3, TYPE4, ARG4, TYPE5, ARG5) \ + NAME(ARG0, ARG1, ARG2, ARG3, ARG4, ARG5) TYPE0 ARG0; TYPE1 ARG1; TYPE2 ARG2; TYPE3 ARG3; TYPE4 ARG4; TYPE5 ARG5; +#define const +#endif + + +#ifdef __svr4__ +#include +#else +extern int optind; +extern char *optarg; +/* extern int getopt (int __argc, char **__argv, char *__optstring); */ +#endif + +#include "iso9660.h" +#include "defaults.h" + +struct directory_entry{ + struct directory_entry * next; + struct iso_directory_record isorec; + unsigned int starting_block; + unsigned int size; + unsigned int priority; + char * name; + char * table; + char * whole_name; + struct directory * filedir; + struct directory_entry * parent_rec; + unsigned int de_flags; + ino_t inode; /* Used in the hash table */ + dev_t dev; /* Used in the hash table */ + unsigned char * rr_attributes; + unsigned int rr_attr_size; + unsigned int total_rr_attr_size; +}; + +struct file_hash{ + struct file_hash * next; + ino_t inode; /* Used in the hash table */ + dev_t dev; /* Used in the hash table */ + unsigned int starting_block; + unsigned int size; +}; + +/* + * This structure describes one complete directory. It has pointers + * to other directories in the overall tree so that it is clear where + * this directory lives in the tree, and it also must contain pointers + * to the contents of the directory. Note that subdirectories of this + * directory exist twice in this stucture. Once in the subdir chain, + * and again in the contents chain. + */ +struct directory{ + struct directory * next; /* Next directory at same level as this one */ + struct directory * subdir; /* First subdirectory in this directory */ + struct directory * parent; + struct directory_entry * contents; + struct directory_entry * self; + char * whole_name; /* Entire path */ + char * de_name; /* Entire path */ + unsigned int ce_bytes; /* Number of bytes of CE entries reqd for this dir */ + unsigned int depth; + unsigned int size; + unsigned int extent; + unsigned short path_index; +}; + +struct deferred{ + struct deferred * next; + unsigned int starting_block; + char * name; + struct directory * filedir; + unsigned int flags; +}; + +extern int goof; +extern struct directory * root; +extern struct directory * reloc_dir; +extern unsigned int next_extent; +extern unsigned int last_extent; +extern unsigned int last_extent_written; +extern unsigned int session_start; +extern unsigned int path_table_size; +extern unsigned int path_table[4]; +extern unsigned int path_blocks; +extern char * path_table_l; +extern char * path_table_m; +extern struct iso_directory_record root_record; + +extern int use_eltorito; +extern int use_RockRidge; +extern int rationalize; +extern int follow_links; +extern int verbose; +extern int all_files; +extern int generate_tables; +extern int omit_period; +extern int omit_version_number; +extern int transparent_compression; +extern int RR_relocation_depth; +extern int full_iso9660_filenames; + +/* tree.c */ +extern int DECL(stat_filter, (char *, struct stat *)); +extern void DECL(sort_n_finish,(struct directory *)); +extern void finish_cl_pl_entries(); +extern int DECL(scan_directory_tree,(char * path, + struct directory_entry * self, + struct iso_directory_record *)); +extern void DECL(generate_iso9660_directories,(struct directory *, FILE*)); +extern void DECL(dump_tree,(struct directory * node)); +extern struct directory_entry * DECL(search_tree_file, (struct + directory * node,char * filename)); + +/* eltorito.c */ +extern void DECL(init_boot_catalog, (const char * path )); +extern void DECL(get_torito_desc, (struct eltorito_boot_descriptor * path )); + +/* write.c */ +extern void DECL(assign_directory_addresses,(struct directory * root)); +extern int DECL(get_733,(char *)); +extern int DECL(isonum_733,(unsigned char *)); +extern void DECL(set_723,(char *, unsigned int)); +extern void DECL(set_731,(char *, unsigned int)); +extern void DECL(set_721,(char *, unsigned int)); +extern void DECL(set_733,(char *, unsigned int)); +extern void DECL(sort_directory,(struct directory_entry **)); +extern void generate_root_record(); +extern void DECL(generate_one_directory,(struct directory *, FILE*)); +extern void generate_path_tables(); +extern int DECL(iso_write,(FILE * outfile)); +extern void DECL(memcpy_max, (char *, char *, int)); + + +/* multi.c */ + +extern FILE * in_image; +extern struct iso_directory_record * + DECL(merge_isofs,(char * path)); + +extern int DECL(free_mdinfo, (struct directory_entry **, int len)); + +extern struct directory_entry ** + DECL(read_merging_directory,(struct iso_directory_record *, int*)); +extern void + DECL(merge_remaining_entries, (struct directory *, + struct directory_entry **, int)); + +/* match.c */ +extern int DECL(matches, (char *)); +extern void DECL(add_match, (char *)); + +/* files.c */ +struct dirent * DECL(readdir_add_files, (char **, char *, DIR *)); + +/* */ + +extern int DECL(iso9660_file_length,(const char* name, + struct directory_entry * sresult, int flag)); +extern int DECL(iso9660_date,(char *, time_t)); +extern void DECL(add_hash,(struct directory_entry *)); +extern struct file_hash * DECL(find_hash,(dev_t, ino_t)); +extern void DECL(add_directory_hash,(dev_t, ino_t)); +extern struct file_hash * DECL(find_directory_hash,(dev_t, ino_t)); +extern void flush_file_hash(); +extern int DECL(delete_file_hash,(struct directory_entry *)); +extern struct directory_entry * DECL(find_file_hash,(char *)); +extern void DECL(add_file_hash,(struct directory_entry *)); +extern int DECL(generate_rock_ridge_attributes,(char *, char *, + struct directory_entry *, + struct stat *, struct stat *, + int deep_flag)); +extern char * DECL(generate_rr_extension_record,(char * id, char * descriptor, + char * source, int * size)); + +extern int DECL(check_prev_session, (struct directory_entry **, int len, + struct directory_entry *, + struct stat *, + struct stat *, + struct directory_entry **)); + +#ifdef USE_SCG +/* scsi.c */ +extern int readsecs(int startsecno, void *buffer, int sectorcount); +extern int scsidev_open(char *path); +#endif + +extern char * extension_record; +extern int extension_record_extent; +extern int n_data_extents; + +/* These are a few goodies that can be specified on the command line, and are + filled into the root record */ + +extern char * preparer; +extern char * publisher; +extern char * copyright; +extern char * biblio; +extern char * abstract; +extern char * appid; +extern char * volset_id; +extern char * system_id; +extern char * volume_id; +extern char * boot_catalog; +extern char * boot_image; + +extern void * DECL(e_malloc,(size_t)); + + +#define SECTOR_SIZE (2048) +#define ROUND_UP(X) ((X + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1)) + +#define NEED_RE 1 +#define NEED_PL 2 +#define NEED_CL 4 +#define NEED_CE 8 +#define NEED_SP 16 + +#define PREV_SESS_DEV (sizeof(dev_t) >= 4 ? 0x7ffffffd : 0x7ffd) +#define TABLE_INODE (sizeof(ino_t) >= 4 ? 0x7ffffffe : 0x7ffe) +#define UNCACHED_INODE (sizeof(ino_t) >= 4 ? 0x7fffffff : 0x7fff) +#define UNCACHED_DEVICE (sizeof(dev_t) >= 4 ? 0x7fffffff : 0x7fff) + +#ifdef VMS +#define STAT_INODE(X) (X.st_ino[0]) +#define PATH_SEPARATOR ']' +#define SPATH_SEPARATOR "" +#else +#define STAT_INODE(X) (X.st_ino) +#define PATH_SEPARATOR '/' +#define SPATH_SEPARATOR "/" +#endif + +/* + * When using multi-session, indicates that we can reuse the + * TRANS.TBL information for this directory entry. If this flag + * is set for all entries in a directory, it means we can just + * reuse the TRANS.TBL and not generate a new one. + */ +#define SAFE_TO_REUSE_TABLE_ENTRY 1 +/* + * Volume sequence number to use in all of the iso directory records. + */ +#define DEF_VSN 1 + +/* + * Make sure we have a definition for this. If not, take a very conservative + * guess. From what I can tell SunOS is the only one with this trouble. + */ +#ifndef NAME_MAX +#ifdef FILENAME_MAX +#define NAME_MAX FILENAME_MAX +#else +#define NAME_MAX 128 +#endif +#endif diff --git a/util/mkisofs/multi.c b/util/mkisofs/multi.c new file mode 100644 index 000000000..13ba6f6d1 --- /dev/null +++ b/util/mkisofs/multi.c @@ -0,0 +1,1018 @@ +/* + * File multi.c - scan existing iso9660 image and merge into + * iso9660 filesystem. Used for multisession support. + * + * Written by Eric Youngdale (1996). + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +static char rcsid[] ="$Id: multi.c,v 1.6.1.3 1998/06/02 03:00:25 eric Exp $"; + +#include +#include +#include +#include +#include +#include + +#include "config.h" + +#ifndef VMS + +#ifdef HAVE_UNISTD_H +#include +#endif + +#else +#include +#include +#include "vms.h" +extern char * strdup(const char *); +#endif + +#include "mkisofs.h" +#include "iso9660.h" + +#define TF_CREATE 1 +#define TF_MODIFY 2 +#define TF_ACCESS 4 +#define TF_ATTRIBUTES 8 + +static int DECL(get_session_start, (int *)); +static int DECL(merge_old_directory_into_tree, (struct directory_entry *, + struct directory *)); + +static int +isonum_711 (unsigned char * p) +{ + return (*p & 0xff); +} + +int +isonum_721 (unsigned char * p) +{ + return ((p[0] & 0xff) | ((p[1] & 0xff) << 8)); +} + +static int +isonum_723 (unsigned char * p) +{ +#if 0 + if (p[0] != p[3] || p[1] != p[2]) { + fprintf (stderr, "invalid format 7.2.3 number\n"); + exit (1); + } +#endif + return (isonum_721 (p)); +} + +int +isonum_731 (unsigned char * p) +{ + return ((p[0] & 0xff) + | ((p[1] & 0xff) << 8) + | ((p[2] & 0xff) << 16) + | ((p[3] & 0xff) << 24)); +} + +int +isonum_733 (unsigned char * p) +{ + return (isonum_731 (p)); +} + +FILE * in_image = NULL; + +#ifndef USE_SCG +/* + * Don't define readsecs if mkisofs is linked with + * the SCSI library. + * readsecs() will be implemented as SCSI command in this case. + * + * Use global var in_image directly in readsecs() + * the SCSI equivalent will not use a FILE* for I/O. + * + * The main point of this pointless abstraction is that Solaris won't let + * you read 2K sectors from the cdrom driver. The fact that 99.9% of the + * discs out there have a 2K sectorsize doesn't seem to matter that much. + * Anyways, this allows the use of a scsi-generics type of interface on + * Solaris. + */ +static int +readsecs(int startsecno, void *buffer, int sectorcount) +{ + int f = fileno(in_image); + + if (lseek(f, (off_t)startsecno * SECTOR_SIZE, 0) == (off_t)-1) { + fprintf(stderr," Seek error on old image\n"); + exit(10); + } + return (read(f, buffer, sectorcount * SECTOR_SIZE)); +} +#endif + +/* + * Parse the RR attributes so we can find the file name. + */ +static int +FDECL3(parse_rr, unsigned char *, pnt, int, len, struct directory_entry *,dpnt) +{ + int cont_extent, cont_offset, cont_size; + char name_buf[256]; + + cont_extent = cont_offset = cont_size = 0; + + while(len >= 4){ + if(pnt[3] != 1) { + printf("**BAD RRVERSION"); + return -1; + }; + if(strncmp((char *) pnt, "NM", 2) == 0) { + strncpy(name_buf, (char *) pnt+5, pnt[2] - 5); + name_buf[pnt[2] - 5] = 0; + dpnt->name = strdup(name_buf); + return 0; + } + + if(strncmp((char *) pnt, "CE", 2) == 0) { + cont_extent = isonum_733(pnt+4); + cont_offset = isonum_733(pnt+12); + cont_size = isonum_733(pnt+20); + }; + + len -= pnt[2]; + pnt += pnt[2]; + if(len <= 3 && cont_extent) { + unsigned char sector[SECTOR_SIZE]; + readsecs(cont_extent, sector, 1); + parse_rr(§or[cont_offset], cont_size, dpnt); + }; + }; + return 0; +} + + +static int +FDECL4(check_rr_dates, struct directory_entry *, dpnt, + struct directory_entry *, current, + struct stat *, statbuf, + struct stat *,lstatbuf) +{ + int cont_extent, cont_offset, cont_size; + int offset; + unsigned char * pnt; + int len; + int same_file; + int same_file_type; + mode_t mode; + char time_buf[7]; + + + cont_extent = cont_offset = cont_size = 0; + same_file = 1; + same_file_type = 1; + + pnt = dpnt->rr_attributes; + len = dpnt->rr_attr_size; + /* + * We basically need to parse the rr attributes again, and + * dig out the dates and file types. + */ + while(len >= 4){ + if(pnt[3] != 1) { + printf("**BAD RRVERSION"); + return -1; + }; + + /* + * If we have POSIX file modes, make sure that the file type + * is the same. If it isn't, then we must always + * write the new file. + */ + if(strncmp((char *) pnt, "PX", 2) == 0) { + mode = isonum_733(pnt + 4); + if( (lstatbuf->st_mode & S_IFMT) != (mode & S_IFMT) ) + { + same_file_type = 0; + same_file = 0; + } + } + + if(strncmp((char *) pnt, "TF", 2) == 0) { + offset = 5; + if( pnt[4] & TF_CREATE ) + { + iso9660_date((char *) time_buf, lstatbuf->st_ctime); + if(memcmp(time_buf, pnt+offset, 7) == 0) + same_file = 0; + offset += 7; + } + if( pnt[4] & TF_MODIFY ) + { + iso9660_date((char *) time_buf, lstatbuf->st_mtime); + if(memcmp(time_buf, pnt+offset, 7) == 0) + same_file = 0; + offset += 7; + } + } + + if(strncmp((char *) pnt, "CE", 2) == 0) { + cont_extent = isonum_733(pnt+4); + cont_offset = isonum_733(pnt+12); + cont_size = isonum_733(pnt+20); + }; + + len -= pnt[2]; + pnt += pnt[2]; + if(len <= 3 && cont_extent) { + unsigned char sector[SECTOR_SIZE]; + + readsecs(cont_extent, sector, 1); + parse_rr(§or[cont_offset], cont_size, dpnt); + }; + }; + + /* + * If we have the same fundamental file type, then it is clearly + * safe to reuse the TRANS.TBL entry. + */ + if( same_file_type ) + { + current->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; + } + + return same_file; +} + +struct directory_entry ** +FDECL2(read_merging_directory, struct iso_directory_record *, mrootp, + int *, nent) +{ + unsigned char * cpnt; + unsigned char * cpnt1; + char * dirbuff; + int i; + struct iso_directory_record * idr; + int len; + struct directory_entry **pnt; + int rlen; + struct directory_entry **rtn; + int seen_rockridge; + unsigned char * tt_buf; + int tt_extent; + int tt_size; + + /* + * First, allocate a buffer large enough to read in the entire + * directory. + */ + dirbuff = (char *) e_malloc(isonum_733((unsigned char *)mrootp->size)); + + readsecs(isonum_733((unsigned char *)mrootp->extent), dirbuff, + isonum_733((unsigned char *)mrootp->size)/SECTOR_SIZE); + + /* + * Next look over the directory, and count up how many entries we + * have. + */ + len = isonum_733((unsigned char *)mrootp->size); + i = 0; + *nent = 0; + while(i < len ) + { + idr = (struct iso_directory_record *) &dirbuff[i]; + if(idr->length[0] == 0) + { + i = (i + SECTOR_SIZE - 1) & ~(SECTOR_SIZE - 1); + continue; + } + (*nent)++; + i += idr->length[0]; + } + + /* + * Now allocate the buffer which will hold the array we are + * about to return. + */ + rtn = (struct directory_entry **) e_malloc(*nent * sizeof(*rtn)); + + /* + * Finally, scan the directory one last time, and pick out the + * relevant bits of information, and store it in the relevant + * bits of the structure. + */ + i = 0; + pnt = rtn; + tt_extent = 0; + seen_rockridge = 0; + tt_size = 0; + while(i < len ) + { + idr = (struct iso_directory_record *) &dirbuff[i]; + if(idr->length[0] == 0) + { + i = (i + SECTOR_SIZE - 1) & ~(SECTOR_SIZE - 1); + continue; + } + *pnt = (struct directory_entry *) e_malloc(sizeof(**rtn)); + (*pnt)->next = NULL; + (*pnt)->isorec = *idr; + (*pnt)->starting_block = isonum_733((unsigned char *)idr->extent); + (*pnt)->size = isonum_733((unsigned char *)idr->size); + (*pnt)->priority = 0; + (*pnt)->name = NULL; + (*pnt)->table = NULL; + (*pnt)->whole_name = NULL; + (*pnt)->filedir = NULL; + (*pnt)->parent_rec = NULL; + /* + * Set this information so that we correctly cache previous + * session bits of information. + */ + (*pnt)->inode = (*pnt)->starting_block; + (*pnt)->dev = PREV_SESS_DEV; + (*pnt)->rr_attributes = NULL; + (*pnt)->rr_attr_size = 0; + (*pnt)->total_rr_attr_size = 0; + (*pnt)->de_flags = SAFE_TO_REUSE_TABLE_ENTRY; + + /* + * Check for and parse any RR attributes for the file. + * All we are really looking for here is the original name + * of the file. + */ + rlen = idr->length[0] & 0xff; + cpnt = (unsigned char *) idr; + + rlen -= sizeof(struct iso_directory_record); + cpnt += sizeof(struct iso_directory_record); + + rlen += sizeof(idr->name); + cpnt -= sizeof(idr->name); + + rlen -= idr->name_len[0]; + cpnt += idr->name_len[0]; + + if((idr->name_len[0] & 1) == 0){ + cpnt++; + rlen--; + }; + + if( rlen != 0 ) + { + (*pnt)->total_rr_attr_size = (*pnt)->rr_attr_size = rlen; + (*pnt)->rr_attributes = e_malloc(rlen); + memcpy((*pnt)->rr_attributes, cpnt, rlen); + seen_rockridge = 1; + } + + /* + * Now zero out the remainder of the name field. + */ + cpnt = (unsigned char *) &(*pnt)->isorec.name; + cpnt += idr->name_len[0]; + memset(cpnt, 0, sizeof((*pnt)->isorec.name) - idr->name_len[0]); + + parse_rr((*pnt)->rr_attributes, rlen, *pnt); + + if( ((*pnt)->isorec.name_len[0] == 1) + && ( ((*pnt)->isorec.name[0] == 0) + || ((*pnt)->isorec.name[0] == 1)) ) + { + if( (*pnt)->name != NULL ) + { + free((*pnt)->name); + } + if( (*pnt)->whole_name != NULL ) + { + free((*pnt)->whole_name); + } + if( (*pnt)->isorec.name[0] == 0 ) + { + (*pnt)->name = strdup("."); + } + else + { + (*pnt)->name = strdup(".."); + } + } + + if( strncmp(idr->name, "TRANS.TBL", 9) == 0) + { + if( (*pnt)->name != NULL ) + { + free((*pnt)->name); + } + if( (*pnt)->whole_name != NULL ) + { + free((*pnt)->whole_name); + } + (*pnt)->name = strdup(""); + tt_extent = isonum_733((unsigned char *)idr->extent); + tt_size = isonum_733((unsigned char *)idr->size); + } + + pnt++; + i += idr->length[0]; + } + + /* + * If there was a TRANS.TBL;1 entry, then grab it, read it, and use it + * to get the filenames of the files. Also, save the table info, just + * in case we need to use it. + */ + if( tt_extent != 0 && tt_size != 0 ) + { + tt_buf = (unsigned char *) e_malloc(tt_size); + readsecs(tt_extent, tt_buf, tt_size/SECTOR_SIZE); + + /* + * Loop through the file, examine each entry, and attempt to + * attach it to the correct entry. + */ + cpnt = tt_buf; + cpnt1 = tt_buf; + while( cpnt - tt_buf < tt_size ) + { + while(*cpnt1 != '\n' && *cpnt1 != '\0') cpnt1++; + *cpnt1 = '\0'; + + for(pnt = rtn, i = 0; i <*nent; i++, pnt++) + { + rlen = isonum_711((*pnt)->isorec.name_len); + if( strncmp((char *) cpnt + 2, (*pnt)->isorec.name, + rlen) == 0 + && cpnt[2+rlen] == ' ') + { + (*pnt)->table = e_malloc(strlen((char*)cpnt) - 34); + sprintf((*pnt)->table, "%c\t%s\n", + *cpnt, cpnt+37); + if( (*pnt)->name == NULL ) + { + (*pnt)->name = strdup((char *) cpnt+37); + } + break; + } + } + cpnt = cpnt1 + 1; + cpnt1 = cpnt; + } + + free(tt_buf); + } + else if( !seen_rockridge ) + { + /* + * This is a fatal error right now because we must have some mechanism + * for taking the 8.3 names back to the original unix names. + * In principle we could do this the hard way, and try and translate + * the unix names that we have seen forwards, but this would be + * a real pain in the butt. + */ + fprintf(stderr,"Previous session must have either Rock Ridge (-R) or\n"); + fprintf(stderr,"TRANS.TBL (-T) for mkisofs to be able to correctly\n"); + fprintf(stderr,"generate additional sessions.\n"); + exit(3); + } + + if( dirbuff != NULL ) + { + free(dirbuff); + } + + return rtn; +} + +/* + * Free any associated data related to the structures. + */ +int +FDECL2(free_mdinfo, struct directory_entry ** , ptr, int, len ) +{ + int i; + struct directory_entry **p; + + p = ptr; + for(i=0; iname != NULL ) + { + free((*p)->name); + } + + if( (*p)->whole_name != NULL ) + { + free((*p)->whole_name); + } + + if( (*p)->rr_attributes != NULL ) + { + free((*p)->rr_attributes); + } + + if( (*p)->table != NULL ) + { + free((*p)->table); + } + + free(*p); + + } + + free(ptr); + return 0; +} + +/* + * Search the list to see if we have any entries from the previous + * session that match this entry. If so, copy the extent number + * over so we don't bother to write it out to the new session. + */ + +int +FDECL6(check_prev_session, struct directory_entry ** , ptr, int, len, + struct directory_entry *, curr_entry, + struct stat *, statbuf, struct stat *, lstatbuf, + struct directory_entry **, odpnt) +{ + int i; + + for( i=0; i < len; i++ ) + { + if( ptr[i] == NULL ) + { + continue; + } + +#if 0 + if( ptr[i]->name != NULL && ptr[i]->isorec.name_len[0] == 1 + && ptr[i]->name[0] == '\0' ) + { + continue; + } + if( ptr[i]->name != NULL && ptr[i]->isorec.name_len[0] == 1 + && ptr[i]->name[0] == 1) + { + continue; + } +#else + if( ptr[i]->name != NULL && strcmp(ptr[i]->name, ".") == 0 ) + { + continue; + } + if( ptr[i]->name != NULL && strcmp(ptr[i]->name, "..") == 0 ) + { + continue; + } +#endif + + if( ptr[i]->name != NULL + && strcmp(ptr[i]->name, curr_entry->name) != 0 ) + { + continue; + } + + /* + * We know that the files have the same name. If they also have + * the same file type (i.e. file, dir, block, etc), then we + * can safely reuse the TRANS.TBL entry for this file. + * The check_rr_dates function will do this for us. + * + * Verify that the file type and dates are consistent. + * If not, we probably have a different file, and we need + * to write it out again. + */ + if( (ptr[i]->rr_attributes != NULL) + && (check_rr_dates(ptr[i], curr_entry, statbuf, lstatbuf)) ) + { + goto found_it; + } + + + /* + * Verify size and timestamp. If rock ridge is in use, we need + * to compare dates from RR too. Directories are special, we + * calculate their size later. + */ + if( (curr_entry->isorec.flags[0] & 2) == 0 + && ptr[i]->size != curr_entry->size ) + { + goto found_it; + } + + if( memcmp(ptr[i]->isorec.date, curr_entry->isorec.date,7) != 0 ) + { + goto found_it; + } + + /* + * Never ever reuse directory extents. See comments in + * tree.c for an explaination of why this must be the case. + */ + if( (curr_entry->isorec.flags[0] & 2) != 0 ) + { + goto found_it; + } + + memcpy(curr_entry->isorec.extent, ptr[i]->isorec.extent, 8); + curr_entry->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; + goto found_it; + } + return 0; + +found_it: + if( odpnt != NULL ) + { + *odpnt = ptr[i]; + } + else + { + free(ptr[i]); + } + ptr[i] = NULL; + return 0; +} + +/* + * merge_isofs: Scan an existing image, and return a pointer + * to the root directory for this image. + */ +struct iso_directory_record * FDECL1(merge_isofs, char *, path) +{ + char buffer[SECTOR_SIZE]; + int file_addr; + int i; + struct iso_primary_descriptor * pri = NULL; + struct iso_directory_record * rootp; + struct iso_volume_descriptor * vdp; + + /* + * Start by opening up the image and searching for the volume header. + * Ultimately, we need to search for volume headers in multiple places + * because we might be starting with a multisession image. + * FIXME(eric). + */ + +#ifndef USE_SCG + in_image = fopen(path, "rb"); + if( in_image == NULL ) + { + return NULL; + } +#else + if (strchr(path, '/')) { + in_image = fopen(path, "rb"); + if( in_image == NULL ) { + return NULL; + } + } else { + if (scsidev_open(path) < 0) + return NULL; + } +#endif + + get_session_start(&file_addr); + + for(i = 0; i< 100; i++) + { + if (readsecs(file_addr/SECTOR_SIZE, &buffer, + sizeof(buffer)/SECTOR_SIZE) != sizeof(buffer)) + { + fprintf(stderr," Read error on old image %s\n", path); + exit(10); + } + + vdp = (struct iso_volume_descriptor *)buffer; + + if( (strncmp(vdp->id, ISO_STANDARD_ID, sizeof vdp->id) == 0) + && (isonum_711((unsigned char *) vdp->type) == ISO_VD_PRIMARY) ) + { + break; + } + file_addr += SECTOR_SIZE; + } + + if( i == 100 ) + { + return NULL; + } + + pri = (struct iso_primary_descriptor *)vdp; + + /* + * Check the blocksize of the image to make sure it is compatible. + */ + if( (isonum_723 ((unsigned char *) pri->logical_block_size) != SECTOR_SIZE) + || (isonum_723 ((unsigned char *) pri->volume_set_size) != 1) ) + { + return NULL; + } + + /* + * Get the location and size of the root directory. + */ + rootp = (struct iso_directory_record *) + malloc(sizeof(struct iso_directory_record)); + + memcpy(rootp, pri->root_directory_record, sizeof(*rootp)); + + return rootp; +} + +void FDECL3(merge_remaining_entries, struct directory *, this_dir, + struct directory_entry **, pnt, + int, n_orig) +{ + int i; + struct directory_entry * s_entry; + unsigned int ttbl_extent = 0; + unsigned int ttbl_index = 0; + + /* + * Whatever is leftover in the list needs to get merged back + * into the directory. + */ + for( i=0; i < n_orig; i++ ) + { + if( pnt[i] == NULL ) + { + continue; + } + + if( pnt[i]->name != NULL + && strcmp(pnt[i]->name, "") == 0 ) + { + ttbl_extent = isonum_733((unsigned char *) pnt[i]->isorec.extent); + ttbl_index = i; + continue; + } + /* + * Skip directories for now - these need to be treated + * differently. + */ + if( (pnt[i]->isorec.flags[0] & 2) != 0 ) + { + /* + * FIXME - we need to insert this directory into the + * tree, so that the path tables we generate will + * be correct. + */ + if( (strcmp(pnt[i]->name, ".") == 0) + || (strcmp(pnt[i]->name, "..") == 0) ) + { + free(pnt[i]); + pnt[i] = NULL; + continue; + } + else + { + merge_old_directory_into_tree(pnt[i], this_dir); + } + } + pnt[i]->next = this_dir->contents; + pnt[i]->filedir = this_dir; + this_dir->contents = pnt[i]; + pnt[i] = NULL; + } + + + /* + * If we don't have an entry for the translation table, then + * don't bother trying to copy the starting extent over. + * Note that it is possible that if we are copying the entire + * directory, the entry for the translation table will have already + * been inserted into the linked list and removed from the old + * entries list, in which case we want to leave the extent number + * as it was before. + */ + if( ttbl_extent == 0 ) + { + return; + } + + /* + * Finally, check the directory we are creating to see whether + * there are any new entries in it. If there are not, we can + * reuse the same translation table. + */ + for(s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) + { + /* + * Don't care about '.' or '..'. They are never in the table + * anyways. + */ + if( s_entry->name != NULL && strcmp(s_entry->name, ".") == 0 ) + { + continue; + } + if( s_entry->name != NULL && strcmp(s_entry->name, "..") == 0 ) + { + continue; + } + if( strcmp(s_entry->name, "") == 0) + { + continue; + } + if( (s_entry->de_flags & SAFE_TO_REUSE_TABLE_ENTRY) == 0 ) + { + return; + } + } + + /* + * Locate the translation table, and re-use the same extent. + * It isn't clear that there should ever be one in there already + * so for now we try and muddle through the best we can. + */ + for(s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) + { + if( strcmp(s_entry->name, "") == 0) + { + fprintf(stderr,"Should never get here\n"); + set_733(s_entry->isorec.extent, ttbl_extent); + return; + } + } + + pnt[ttbl_index]->next = this_dir->contents; + pnt[ttbl_index]->filedir = this_dir; + this_dir->contents = pnt[ttbl_index]; + pnt[ttbl_index] = NULL; +} + + +/* + * Here we have a case of a directory that has completely disappeared from + * the face of the earth on the tree we are mastering from. Go through and + * merge it into the tree, as well as everything beneath it. + * + * Note that if a directory has been moved for some reason, this will + * incorrectly pick it up and attempt to merge it back into the old + * location. FIXME(eric). + */ +static int +FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt, + struct directory *, parent) +{ + struct directory_entry **contents = NULL; + int i; + int n_orig; + struct directory * this_dir, *next_brother; + char whole_path[1024]; + + this_dir = (struct directory *) e_malloc(sizeof(struct directory)); + this_dir->next = NULL; + this_dir->subdir = NULL; + this_dir->self = dpnt; + this_dir->contents = NULL; + this_dir->size = 0; + this_dir->extent = 0; + this_dir->depth = parent->depth + 1; + this_dir->parent = parent; + if(!parent->subdir) + parent->subdir = this_dir; + else { + next_brother = parent->subdir; + while(next_brother->next) next_brother = next_brother->next; + next_brother->next = this_dir; + } + + /* + * Set the name for this directory. + */ + strcpy(whole_path, parent->de_name); + strcat(whole_path, SPATH_SEPARATOR); + strcat(whole_path, dpnt->name); + this_dir->de_name = strdup(whole_path); + this_dir->whole_name = strdup(whole_path); + + /* + * Now fill this directory using information from the previous + * session. + */ + contents = read_merging_directory(&dpnt->isorec, &n_orig); + /* + * Start by simply copying the '.', '..' and non-directory + * entries to this directory. Technically we could let + * merge_remaining_entries handle this, but it gets rather confused + * by the '.' and '..' entries. + */ + for(i=0; i < n_orig; i ++ ) + { + /* + * We can always reuse the TRANS.TBL in this particular case. + */ + contents[i]->de_flags |= SAFE_TO_REUSE_TABLE_ENTRY; + + if( ((contents[i]->isorec.flags[0] & 2) != 0) + && (i >= 2) ) + { + continue; + } + + /* + * If we have a directory, don't reuse the extent number. + */ + if( (contents[i]->isorec.flags[0] & 2) != 0 ) + { + memset(contents[i]->isorec.extent, 0, 8); + } + + contents[i]->next = this_dir->contents; + contents[i]->filedir = this_dir; + this_dir->contents = contents[i]; + contents[i] = NULL; + } + + /* + * Zero the extent number for ourselves. + */ + memset(dpnt->isorec.extent, 0, 8); + + /* + * Anything that is left are other subdirectories that need to be merged. + */ + merge_remaining_entries(this_dir, contents, n_orig); + free_mdinfo(contents, n_orig); + sort_n_finish(this_dir); + + return 0; +} + + +char * cdwrite_data = NULL; + +static int +FDECL1(get_session_start, int *, file_addr) +{ + char * pnt; + +#ifdef CDWRITE_DETERMINES_FIRST_WRITABLE_ADDRESS + /* + * FIXME(eric). We need to coordinate with cdwrite to obtain + * the parameters. For now, we assume we are writing the 2nd session, + * so we start from the session that starts at 0. + */ + + *file_addr = (16 << 11); + + /* + * We need to coordinate with cdwrite to get the next writable address + * from the device. Here is where we use it. + */ + session_start = last_extent = last_extent_written = cdwrite_result(); + +#else + + if( cdwrite_data == NULL ) + { + fprintf(stderr,"Special parameters for cdwrite not specified with -C\n"); + exit(1); + } + + /* + * Next try and find the ',' in there which delimits the two numbers. + */ + pnt = strchr(cdwrite_data, ','); + if( pnt == NULL ) + { + fprintf(stderr, "Malformed cdwrite parameters\n"); + exit(1); + } + + *pnt = '\0'; + *file_addr = atol(cdwrite_data) * SECTOR_SIZE; + pnt++; + + session_start = last_extent = last_extent_written = atol(pnt); + + pnt--; + *pnt = ','; + +#endif + return 0; +} + diff --git a/util/mkisofs/name.c b/util/mkisofs/name.c new file mode 100644 index 000000000..10475d43e --- /dev/null +++ b/util/mkisofs/name.c @@ -0,0 +1,390 @@ +/* + * File name.c - map full Unix file names to unique 8.3 names that + * would be valid on DOS. + * + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: name.c,v 1.7 1997/11/09 16:42:51 eric Exp $"; + +#include "mkisofs.h" + +#include + +extern int allow_leading_dots; + +/* + * Function: iso9660_file_length + * + * Purpose: Map file name to 8.3 format, return length + * of result. + * + * Arguments: name file name we need to map. + * sresult directory entry structure to contain mapped name. + * dirflag flag indicating whether this is a directory or not. + * + * Notes: This procedure probably needs to be rationalized somehow. + * New options to affect the behavior of this function + * would also be nice to have. + */ +int FDECL3(iso9660_file_length, + const char*, name, + struct directory_entry *, sresult, + int, dirflag) +{ + char * c; + int chars_after_dot = 0; + int chars_before_dot = 0; + int current_length = 0; + int extra = 0; + int ignore = 0; + char * last_dot; + const char * pnt; + int priority = 32767; + char * result; + int seen_dot = 0; + int seen_semic = 0; + int tildes = 0; + + result = sresult->isorec.name; + + /* + * For the '.' entry, generate the correct record, and return + * 1 for the length. + */ + if(strcmp(name,".") == 0) + { + if(result) + { + *result = 0; + } + return 1; + } + + /* + * For the '..' entry, generate the correct record, and return + * 1 for the length. + */ + if(strcmp(name,"..") == 0) + { + if(result) + { + *result++ = 1; + *result++ = 0; + } + return 1; + } + + /* + * Now scan the directory one character at a time, and figure out + * what to do. + */ + pnt = name; + + /* + * Find the '.' that we intend to use for the extension. Usually this + * is the last dot, but if we have . followed by nothing or a ~, we + * would consider this to be unsatisfactory, and we keep searching. + */ + last_dot = strrchr (pnt,'.'); + if( (last_dot != NULL) + && ( (last_dot[1] == '~') + || (last_dot[1] == '\0') + || (last_dot[1] == '\0')) ) + { + c = last_dot; + *c = '\0'; + last_dot = strrchr (pnt,'.'); + *c = '.'; + } + + while(*pnt) + { +#ifdef VMS + if( strcmp(pnt,".DIR;1") == 0 ) + { + break; + } +#endif + + /* + * This character indicates a Unix style of backup file + * generated by some editors. Lower the priority of + * the file. + */ + if(*pnt == '#') + { + priority = 1; + pnt++; + continue; + } + + /* + * This character indicates a Unix style of backup file + * generated by some editors. Lower the priority of + * the file. + */ + if(*pnt == '~') + { + priority = 1; + tildes++; + pnt++; + continue; + } + + /* + * This might come up if we had some joker already try and put + * iso9660 version numbers into the file names. This would be + * a silly thing to do on a Unix box, but we check for it + * anyways. If we see this, then we don't have to add our + * own version number at the end. + */ + if(*pnt == ';') + { + seen_semic = 1; + *result++ = *pnt++; + continue; + } + + /* + * If we have a name with multiple '.' characters, we ignore everything + * after we have gotten the extension. + */ + if(ignore) + { + pnt++; + continue; + } + + /* + * Spin past any iso9660 version number we might have. + */ + if(seen_semic) + { + if(*pnt >= '0' && *pnt <= '9') + { + *result++ = *pnt; + } + extra++; + pnt++; + continue; + } + + /* + * If we have full names, the names we generate will not + * work on a DOS machine, since they are not guaranteed + * to be 8.3. Nonetheless, in many cases this is a useful + * option. We still only allow one '.' character in the + * name, however. + */ + if(full_iso9660_filenames) + { + /* Here we allow a more relaxed syntax. */ + if(*pnt == '.') + { + if (seen_dot) + { + ignore++; + continue; + } + seen_dot++; + } + if(current_length < 30) + { + if( *pnt < 0 ) + { + *result++ = '_'; + } + else + { + *result++ = (islower(*pnt) ? toupper(*pnt) : *pnt); + } + } + } + else + { + /* + * Dos style filenames. We really restrict the + * names here. + */ + /* It would be nice to have .tar.gz transform to .tgz, + * .ps.gz to .psz, ... + */ + if(*pnt == '.') + { + if (!chars_before_dot && !allow_leading_dots) + { + /* DOS can't read files with dot first */ + chars_before_dot++; + if (result) + { + *result++ = '_'; /* Substitute underscore */ + } + } + else if( pnt != last_dot ) + { + /* + * If this isn't the dot that we use for the extension, + * then change the character into a '_' instead. + */ + if(chars_before_dot < 8) + { + chars_before_dot++; + if(result) + { + *result++ = '_'; + } + } + } + else + { + if (seen_dot) + { + ignore++; continue; + } + if(result) + { + *result++ = '.'; + } + seen_dot++; + } + } + else + { + if( (seen_dot && (chars_after_dot < 3) && ++chars_after_dot) + || (!seen_dot && (chars_before_dot < 8) && ++chars_before_dot) ) + { + if(result) + { + switch (*pnt) + { + default: + if( *pnt < 0 ) + { + *result++ = '_'; + } + else + { + *result++ = islower(*pnt) ? toupper(*pnt) : *pnt; + } + break; + + /* + * Descriptions of DOS's 'Parse Filename' + * (function 29H) describes V1 and V2.0+ + * separator and terminator characters. + * These characters in a DOS name make + * the file visible but un-manipulable + * (all useful operations error off. + */ + /* separators */ + case '+': + case '=': + case '%': /* not legal DOS filename */ + case ':': + case ';': /* already handled */ + case '.': /* already handled */ + case ',': /* already handled */ + case '\t': + case ' ': + /* V1 only separators */ + case '/': + case '"': + case '[': + case ']': + /* terminators */ + case '>': + case '<': + case '|': + /* Hmm - what to do here? Skip? + * Win95 looks like it substitutes '_' + */ + *result++ = '_'; + break; + } /* switch (*pnt) */ + } /* if (result) */ + } /* if (chars_{after,before}_dot) ... */ + } /* else *pnt == '.' */ + } /* else DOS file names */ + current_length++; + pnt++; + } /* while (*pnt) */ + + /* + * OK, that wraps up the scan of the name. Now tidy up a few other + * things. + */ + + /* + * Look for emacs style of numbered backups, like foo.c.~3~. If + * we see this, convert the version number into the priority + * number. In case of name conflicts, this is what would end + * up being used as the 'extension'. + */ + if(tildes == 2) + { + int prio1 = 0; + pnt = name; + while (*pnt && *pnt != '~') + { + pnt++; + } + if (*pnt) + { + pnt++; + } + while(*pnt && *pnt != '~') + { + prio1 = 10*prio1 + *pnt - '0'; + pnt++; + } + priority = prio1; + } + + /* + * If this is not a directory, force a '.' in case we haven't + * seen one, and add a version number if we haven't seen one + * of those either. + */ + if (!dirflag) + { + if (!seen_dot && !omit_period) + { + if (result) *result++ = '.'; + extra++; + } + if(!omit_version_number && !seen_semic) + { + if(result) + { + *result++ = ';'; + *result++ = '1'; + }; + extra += 2; + } + } + + if(result) + { + *result++ = 0; + } + sresult->priority = priority; + + return (chars_before_dot + chars_after_dot + seen_dot + extra); +} diff --git a/util/mkisofs/rock.c b/util/mkisofs/rock.c new file mode 100644 index 000000000..47cba5527 --- /dev/null +++ b/util/mkisofs/rock.c @@ -0,0 +1,556 @@ +/* + * File rock.c - generate RRIP records for iso9660 filesystems. + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: rock.c,v 1.3 1997/05/17 15:45:26 eric Exp $"; + +#include + +#include "config.h" + +#ifndef VMS +#if defined(MAJOR_IN_SYSMACROS) +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#endif +#if defined(MAJOR_IN_MKDEV) +#include +#include +#endif + +#include "mkisofs.h" +#include "iso9660.h" +#include + +#ifdef NON_UNIXFS +#define S_ISLNK(m) (0) +#else +#ifndef S_ISLNK +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#endif + +#define SU_VERSION 1 + +#define SL_ROOT 8 +#define SL_PARENT 4 +#define SL_CURRENT 2 +#define SL_CONTINUE 1 + +#define CE_SIZE 28 +#define CL_SIZE 12 +#define ER_SIZE 8 +#define NM_SIZE 5 +#define PL_SIZE 12 +#define PN_SIZE 20 +#define PX_SIZE 36 +#define RE_SIZE 4 +#define SL_SIZE 20 +#define ZZ_SIZE 15 +#ifdef __QNX__ +#define TF_SIZE (5 + 4 * 7) +#else +#define TF_SIZE (5 + 3 * 7) +#endif + +/* If we need to store this number of bytes, make sure we + do not box ourselves in so that we do not have room for + a CE entry for the continuation record */ + +#define MAYBE_ADD_CE_ENTRY(BYTES) \ + (BYTES + CE_SIZE + currlen + (ipnt - recstart) > reclimit ? 1 : 0) + +/* + * Buffer to build RR attributes + */ + +static unsigned char Rock[16384]; +static unsigned char symlink_buff[256]; +static int ipnt = 0; +static int recstart = 0; +static int currlen = 0; +static int mainrec = 0; +static int reclimit; + +static void add_CE_entry(){ + if(recstart) + set_733((char*)Rock + recstart - 8, ipnt + 28 - recstart); + Rock[ipnt++] ='C'; + Rock[ipnt++] ='E'; + Rock[ipnt++] = CE_SIZE; + Rock[ipnt++] = SU_VERSION; + set_733((char*)Rock + ipnt, 0); + ipnt += 8; + set_733((char*)Rock + ipnt, 0); + ipnt += 8; + set_733((char*)Rock + ipnt, 0); + ipnt += 8; + recstart = ipnt; + currlen = 0; + if(!mainrec) mainrec = ipnt; + reclimit = SECTOR_SIZE - 8; /* Limit to one sector */ +} + +#ifdef __STDC__ +int generate_rock_ridge_attributes (char * whole_name, char * name, + struct directory_entry * s_entry, + struct stat * statbuf, + struct stat * lstatbuf, + int deep_opt) +#else +int generate_rock_ridge_attributes (whole_name, name, + s_entry, + statbuf, + lstatbuf, + deep_opt) +char * whole_name; char * name; struct directory_entry * s_entry; +struct stat * statbuf, *lstatbuf; +int deep_opt; +#endif +{ + int flagpos, flagval; + int need_ce; + + statbuf = statbuf; /* this shuts up unreferenced compiler warnings */ + mainrec = recstart = ipnt = 0; + reclimit = 0xf8; + + /* Obtain the amount of space that is currently used for the directory + record. Assume max for name, since name conflicts may cause us + to rename the file later on */ + currlen = sizeof(s_entry->isorec); + + /* Identify that we are using the SUSP protocol */ + if(deep_opt & NEED_SP){ + Rock[ipnt++] ='S'; + Rock[ipnt++] ='P'; + Rock[ipnt++] = 7; + Rock[ipnt++] = SU_VERSION; + Rock[ipnt++] = 0xbe; + Rock[ipnt++] = 0xef; + Rock[ipnt++] = 0; + }; + + /* First build the posix name field */ + Rock[ipnt++] ='R'; + Rock[ipnt++] ='R'; + Rock[ipnt++] = 5; + Rock[ipnt++] = SU_VERSION; + flagpos = ipnt; + flagval = 0; + Rock[ipnt++] = 0; /* We go back and fix this later */ + + if(strcmp(name,".") && strcmp(name,"..")){ + char * npnt; + int remain, use; + + remain = strlen(name); + npnt = name; + + while(remain){ + use = remain; + need_ce = 0; + /* Can we fit this SUSP and a CE entry? */ + if(use + currlen + CE_SIZE + (ipnt - recstart) > reclimit) { + use = reclimit - currlen - CE_SIZE - (ipnt - recstart); + need_ce++; + } + + /* Only room for 256 per SUSP field */ + if(use > 0xf8) use = 0xf8; + + /* First build the posix name field */ + Rock[ipnt++] ='N'; + Rock[ipnt++] ='M'; + Rock[ipnt++] = NM_SIZE + use; + Rock[ipnt++] = SU_VERSION; + Rock[ipnt++] = (remain != use ? 1 : 0); + flagval |= (1<<3); + strncpy((char *)&Rock[ipnt], npnt, use); + npnt += use; + ipnt += use; + remain -= use; + if(remain && need_ce) add_CE_entry(); + }; + }; + + /* + * Add the posix modes + */ + if(MAYBE_ADD_CE_ENTRY(PX_SIZE)) add_CE_entry(); + Rock[ipnt++] ='P'; + Rock[ipnt++] ='X'; + Rock[ipnt++] = PX_SIZE; + Rock[ipnt++] = SU_VERSION; + flagval |= (1<<0); + set_733((char*)Rock + ipnt, lstatbuf->st_mode); + ipnt += 8; + set_733((char*)Rock + ipnt, lstatbuf->st_nlink); + ipnt += 8; + set_733((char*)Rock + ipnt, lstatbuf->st_uid); + ipnt += 8; + set_733((char*)Rock + ipnt, lstatbuf->st_gid); + ipnt += 8; + + /* + * Check for special devices + */ +#ifndef NON_UNIXFS + if (S_ISCHR(lstatbuf->st_mode) || S_ISBLK(lstatbuf->st_mode)) { + if(MAYBE_ADD_CE_ENTRY(PN_SIZE)) add_CE_entry(); + Rock[ipnt++] ='P'; + Rock[ipnt++] ='N'; + Rock[ipnt++] = PN_SIZE; + Rock[ipnt++] = SU_VERSION; + flagval |= (1<<1); +#if !defined(MAJOR_IN_SYSMACROS) && !defined(MAJOR_IN_MKDEV) + set_733((char*)Rock + ipnt, major(lstatbuf->st_rdev )); + ipnt += 8; + set_733((char*)Rock + ipnt, minor(lstatbuf->st_rdev)); + ipnt += 8; +#else + /* + * If we don't have sysmacros.h, then we have to guess as to how + * best to pick apart the device number for major/minor. + * Note: this may very well be wrong for many systems, so + * it is always best to use the major/minor macros if the + * system supports it. + */ + if(sizeof(dev_t) <= 2) { + set_733((char*)Rock + ipnt, (lstatbuf->st_rdev >> 8)); + ipnt += 8; + set_733((char*)Rock + ipnt, lstatbuf->st_rdev & 0xff); + ipnt += 8; + } + else if(sizeof(dev_t) <= 4) { + set_733((char*)Rock + ipnt, (lstatbuf->st_rdev >> 8) >> 8); + ipnt += 8; + set_733((char*)Rock + ipnt, lstatbuf->st_rdev & 0xffff); + ipnt += 8; + } + else { + set_733((char*)Rock + ipnt, (lstatbuf->st_rdev >> 16) >> 16); + ipnt += 8; + set_733((char*)Rock + ipnt, lstatbuf->st_rdev); + ipnt += 8; + } +#endif + }; +#endif + /* + * Check for and symbolic links. VMS does not have these. + */ + if (S_ISLNK(lstatbuf->st_mode)){ + int lenpos, lenval, j0, j1; + int nchar; + unsigned char * cpnt, *cpnt1; + nchar = readlink(whole_name, symlink_buff, sizeof(symlink_buff)); + symlink_buff[nchar < 0 ? 0 : nchar] = 0; + set_733(s_entry->isorec.size, 0); + cpnt = &symlink_buff[0]; + flagval |= (1<<2); + + while(nchar){ + if(MAYBE_ADD_CE_ENTRY(SL_SIZE)) add_CE_entry(); + Rock[ipnt++] ='S'; + Rock[ipnt++] ='L'; + lenpos = ipnt; + Rock[ipnt++] = SL_SIZE; + Rock[ipnt++] = SU_VERSION; + Rock[ipnt++] = 0; /* Flags */ + lenval = 5; + while(*cpnt){ + cpnt1 = (unsigned char *) strchr((char *) cpnt, '/'); + if(cpnt1) { + nchar--; + *cpnt1 = 0; + }; + + /* We treat certain components in a special way. */ + if(cpnt[0] == '.' && cpnt[1] == '.' && cpnt[2] == 0){ + if(MAYBE_ADD_CE_ENTRY(2)) add_CE_entry(); + Rock[ipnt++] = SL_PARENT; + Rock[ipnt++] = 0; /* length is zero */ + lenval += 2; + nchar -= 2; + } else if(cpnt[0] == '.' && cpnt[1] == 0){ + if(MAYBE_ADD_CE_ENTRY(2)) add_CE_entry(); + Rock[ipnt++] = SL_CURRENT; + Rock[ipnt++] = 0; /* length is zero */ + lenval += 2; + nchar -= 1; + } else if(cpnt[0] == 0){ + if(MAYBE_ADD_CE_ENTRY(2)) add_CE_entry(); + Rock[ipnt++] = SL_ROOT; + Rock[ipnt++] = 0; /* length is zero */ + lenval += 2; + } else { + /* If we do not have enough room for a component, start + a new continuations segment now */ + if(MAYBE_ADD_CE_ENTRY(6)) { + add_CE_entry(); + if(cpnt1){ + *cpnt1 = '/'; + nchar++; + cpnt1 = NULL; /* A kluge so that we can restart properly */ + } + break; + } + j0 = strlen((char *) cpnt); + while(j0) { + j1 = j0; + if(j1 > 0xf8) j1 = 0xf8; + need_ce = 0; + if(j1 + currlen + CE_SIZE + (ipnt - recstart) > reclimit) { + j1 = reclimit - currlen - CE_SIZE - (ipnt - recstart); + need_ce++; + } + Rock[ipnt++] = (j1 != j0 ? SL_CONTINUE : 0); + Rock[ipnt++] = j1; + strncpy((char *) Rock + ipnt, (char *) cpnt, j1); + ipnt += j1; + lenval += j1 + 2; + cpnt += j1; + nchar -= j1; /* Number we processed this time */ + j0 -= j1; + if(need_ce) { + add_CE_entry(); + if(cpnt1) { + *cpnt1 = '/'; + nchar++; + cpnt1 = NULL; /* A kluge so that we can restart properly */ + } + break; + } + } + }; + if(cpnt1) { + cpnt = cpnt1 + 1; + } else + break; + } + Rock[lenpos] = lenval; + if(nchar) Rock[lenpos + 2] = SL_CONTINUE; /* We need another SL entry */ + } /* while nchar */ + } /* Is a symbolic link */ + /* + * Add in the Rock Ridge TF time field + */ + if(MAYBE_ADD_CE_ENTRY(TF_SIZE)) add_CE_entry(); + Rock[ipnt++] ='T'; + Rock[ipnt++] ='F'; + Rock[ipnt++] = TF_SIZE; + Rock[ipnt++] = SU_VERSION; +#ifdef __QNX__ + Rock[ipnt++] = 0x0f; +#else + Rock[ipnt++] = 0x0e; +#endif + flagval |= (1<<7); +#ifdef __QNX__ + iso9660_date((char *) &Rock[ipnt], lstatbuf->st_ftime); + ipnt += 7; +#endif + iso9660_date((char *) &Rock[ipnt], lstatbuf->st_mtime); + ipnt += 7; + iso9660_date((char *) &Rock[ipnt], lstatbuf->st_atime); + ipnt += 7; + iso9660_date((char *) &Rock[ipnt], lstatbuf->st_ctime); + ipnt += 7; + + /* + * Add in the Rock Ridge RE time field + */ + if(deep_opt & NEED_RE){ + if(MAYBE_ADD_CE_ENTRY(RE_SIZE)) add_CE_entry(); + Rock[ipnt++] ='R'; + Rock[ipnt++] ='E'; + Rock[ipnt++] = RE_SIZE; + Rock[ipnt++] = SU_VERSION; + flagval |= (1<<6); + }; + /* + * Add in the Rock Ridge PL record, if required. + */ + if(deep_opt & NEED_PL){ + if(MAYBE_ADD_CE_ENTRY(PL_SIZE)) add_CE_entry(); + Rock[ipnt++] ='P'; + Rock[ipnt++] ='L'; + Rock[ipnt++] = PL_SIZE; + Rock[ipnt++] = SU_VERSION; + set_733((char*)Rock + ipnt, 0); + ipnt += 8; + flagval |= (1<<5); + }; + + /* + * Add in the Rock Ridge CL field, if required. + */ + if(deep_opt & NEED_CL){ + if(MAYBE_ADD_CE_ENTRY(CL_SIZE)) add_CE_entry(); + Rock[ipnt++] ='C'; + Rock[ipnt++] ='L'; + Rock[ipnt++] = CL_SIZE; + Rock[ipnt++] = SU_VERSION; + set_733((char*)Rock + ipnt, 0); + ipnt += 8; + flagval |= (1<<4); + }; + +#ifndef VMS + /* If transparent compression was requested, fill in the correct + field for this file */ + if(transparent_compression && + S_ISREG(lstatbuf->st_mode) && + strlen(name) > 3 && + strcmp(name + strlen(name) - 3,".gZ") == 0){ + FILE * zipfile; + char * checkname; + unsigned int file_size; + unsigned char header[8]; + int OK_flag; + + /* First open file and verify that the correct algorithm was used */ + file_size = 0; + OK_flag = 1; + + zipfile = fopen(whole_name, "r"); + fread(header, 1, sizeof(header), zipfile); + + /* Check some magic numbers from gzip. */ + if(header[0] != 0x1f || header[1] != 0x8b || header[2] != 8) OK_flag = 0; + /* Make sure file was blocksized. */ + if(((header[3] & 0x40) == 0)) OK_flag = 0; + /* OK, now go to the end of the file and get some more info */ + if(OK_flag){ + int status; + status = (long)lseek(fileno(zipfile), (off_t)(-8), SEEK_END); + if(status == -1) OK_flag = 0; + } + if(OK_flag){ + if(read(fileno(zipfile), (char*)header, sizeof(header)) != sizeof(header)) + OK_flag = 0; + else { + int blocksize; + blocksize = (header[3] << 8) | header[2]; + file_size = ((unsigned int)header[7] << 24) | + ((unsigned int)header[6] << 16) | + ((unsigned int)header[5] << 8) | header[4]; +#if 0 + fprintf(stderr,"Blocksize = %d %d\n", blocksize, file_size); +#endif + if(blocksize != SECTOR_SIZE) OK_flag = 0; + } + } + fclose(zipfile); + + checkname = strdup(whole_name); + checkname[strlen(whole_name)-3] = 0; + zipfile = fopen(checkname, "r"); + if(zipfile) { + OK_flag = 0; + fprintf(stderr,"Unable to insert transparent compressed file - name conflict\n"); + fclose(zipfile); + } + + free(checkname); + + if(OK_flag){ + if(MAYBE_ADD_CE_ENTRY(ZZ_SIZE)) add_CE_entry(); + Rock[ipnt++] ='Z'; + Rock[ipnt++] ='Z'; + Rock[ipnt++] = ZZ_SIZE; + Rock[ipnt++] = SU_VERSION; + Rock[ipnt++] = 'g'; /* Identify compression technique used */ + Rock[ipnt++] = 'z'; + Rock[ipnt++] = 3; + set_733((char*)Rock + ipnt, file_size); /* Real file size */ + ipnt += 8; + }; + } +#endif + /* + * Add in the Rock Ridge CE field, if required. We use this for the + * extension record that is stored in the root directory. + */ + if(deep_opt & NEED_CE) add_CE_entry(); + /* + * Done filling in all of the fields. Now copy it back to a buffer for the + * file in question. + */ + + /* Now copy this back to the buffer for the file */ + Rock[flagpos] = flagval; + + /* If there was a CE, fill in the size field */ + if(recstart) + set_733((char*)Rock + recstart - 8, ipnt - recstart); + + s_entry->rr_attributes = (unsigned char *) e_malloc(ipnt); + s_entry->total_rr_attr_size = ipnt; + s_entry->rr_attr_size = (mainrec ? mainrec : ipnt); + memcpy(s_entry->rr_attributes, Rock, ipnt); + return ipnt; +} + +/* Guaranteed to return a single sector with the relevant info */ + +char * FDECL4(generate_rr_extension_record, char *, id, char *, descriptor, + char *, source, int *, size){ + int ipnt = 0; + char * pnt; + int len_id, len_des, len_src; + + len_id = strlen(id); + len_des = strlen(descriptor); + len_src = strlen(source); + Rock[ipnt++] ='E'; + Rock[ipnt++] ='R'; + Rock[ipnt++] = ER_SIZE + len_id + len_des + len_src; + Rock[ipnt++] = 1; + Rock[ipnt++] = len_id; + Rock[ipnt++] = len_des; + Rock[ipnt++] = len_src; + Rock[ipnt++] = 1; + + memcpy(Rock + ipnt, id, len_id); + ipnt += len_id; + + memcpy(Rock + ipnt, descriptor, len_des); + ipnt += len_des; + + memcpy(Rock + ipnt, source, len_src); + ipnt += len_src; + + if(ipnt > SECTOR_SIZE) { + fprintf(stderr,"Extension record too long\n"); + exit(1); + }; + pnt = (char *) e_malloc(SECTOR_SIZE); + memset(pnt, 0, SECTOR_SIZE); + memcpy(pnt, Rock, ipnt); + *size = ipnt; + return pnt; +} diff --git a/util/mkisofs/tree.c b/util/mkisofs/tree.c new file mode 100644 index 000000000..7180905df --- /dev/null +++ b/util/mkisofs/tree.c @@ -0,0 +1,1292 @@ +/* + * File tree.c - scan directory tree and build memory structures for iso9660 + * filesystem + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: tree.c,v 1.9.1.2 1998/06/02 03:17:31 eric Exp $"; + +/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ + +#include +#include +#include +#include + +#include "config.h" + +#ifndef VMS +#if defined(MAJOR_IN_SYSMACROS) +#include +#endif + +#ifdef HAVE_UNISTD_H +#include +#endif + +#if defined(MAJOR_IN_MKDEV) +#include +#include +#endif +#else +#include +#include +#include "vms.h" +extern char * strdup(const char *); +#endif + +/* + * Autoconf should be able to figure this one out for us and let us know + * whether the system has memmove or not. + */ +# ifndef HAVE_MEMMOVE +# define memmove(d, s, n) bcopy ((s), (d), (n)) +# endif + +#include "mkisofs.h" +#include "iso9660.h" + +#include + +#include "exclude.h" + +#ifdef NON_UNIXFS +#define S_ISLNK(m) (0) +#define S_ISSOCK(m) (0) +#define S_ISFIFO(m) (0) +#else +#ifndef S_ISLNK +#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +#endif +#ifndef S_ISSOCK +# ifdef S_IFSOCK +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +# else +# define S_ISSOCK(m) (0) +# endif +#endif +#endif + +#ifdef __svr4__ +extern char * strdup(const char *); +#endif + +static unsigned char symlink_buff[256]; + +extern int verbose; + +struct stat fstatbuf = {0,}; /* We use this for the artificial entries we create */ + +struct stat root_statbuf = {0, }; /* Stat buffer for root directory */ + +struct directory * reloc_dir = NULL; + +void +FDECL1(stat_fix, struct stat *, st) +{ + /* Remove the uid and gid, they will only be useful on the author's + system. */ + st->st_uid = 0; + st->st_gid = 0; + + /* + * Make sure the file modes make sense. Turn on all read bits. Turn + * on all exec/search bits if any exec/search bit is set. Turn off + * all write bits, and all special mode bits (on a r/o fs lock bits + * are useless, and with uid+gid 0 don't want set-id bits, either). + */ + st->st_mode |= 0444; + if (st->st_mode & 0111) + st->st_mode |= 0111; + st->st_mode &= ~07222; +} + +int +FDECL2(stat_filter, char *, path, struct stat *, st) +{ + int result = stat(path, st); + if (result >= 0 && rationalize) + stat_fix(st); + return result; +} + +int +FDECL2(lstat_filter, char *, path, struct stat *, st) +{ + int result = lstat(path, st); + if (result >= 0 && rationalize) + stat_fix(st); + return result; +} + +void FDECL1(sort_n_finish, struct directory *, this_dir) +{ + struct directory_entry * s_entry; + struct directory_entry * s_entry1; + time_t current_time; + struct directory_entry * table; + int count; + int d1; + int d2; + int d3; + int new_reclen; + char * c; + int tablesize = 0; + char newname[34]; + char rootname[34]; + + /* Here we can take the opportunity to toss duplicate entries from the + directory. */ + + table = NULL; + + if(fstatbuf.st_ctime == 0) + { + time (¤t_time); + fstatbuf.st_uid = 0; + fstatbuf.st_gid = 0; + fstatbuf.st_ctime = current_time; + fstatbuf.st_mtime = current_time; + fstatbuf.st_atime = current_time; + } + + flush_file_hash(); + s_entry = this_dir->contents; + while(s_entry) + { + + /* + * First assume no conflict, and handle this case + */ + if(!(s_entry1 = find_file_hash(s_entry->isorec.name))) + { + add_file_hash(s_entry); + s_entry = s_entry->next; + continue; + } + + if(s_entry1 == s_entry) + { + fprintf(stderr,"Fatal goof\n"); + exit(1); + } + + /* + * OK, handle the conflicts. Try substitute names until we come + * up with a winner + */ + strcpy(rootname, s_entry->isorec.name); + if(full_iso9660_filenames) + { + if(strlen(rootname) > 27) rootname[27] = 0; + } + + /* + * Strip off the non-significant part of the name so that we are left + * with a sensible root filename. If we don't find a '.', then try + * a ';'. + */ + c = strchr(rootname, '.'); + if (c) + *c = 0; + else + { + c = strchr(rootname, ';'); + if (c) *c = 0; + } + for(d1 = 0; d1 < 36; d1++) + { + for(d2 = 0; d2 < 36; d2++) + { + for(d3 = 0; d3 < 36; d3++) + { + sprintf(newname,"%s.%c%c%c%s", rootname, + (d1 <= 9 ? '0' + d1 : 'A' + d1 - 10), + (d2 <= 9 ? '0' + d2 : 'A' + d2 - 10), + (d3 <= 9 ? '0' + d3 : 'A' + d3 - 10), + (s_entry->isorec.flags[0] == 2 || + omit_version_number ? "" : ";1")); + +#ifdef VMS + /* Sigh. VAXCRTL seems to be broken here */ + { + int ijk = 0; + while(newname[ijk]) + { + if(newname[ijk] == ' ') newname[ijk] = '0'; + ijk++; + } + } +#endif + + if(!find_file_hash(newname)) goto got_valid_name; + } + } + } + + /* + * If we fell off the bottom here, we were in real trouble. + */ + fprintf(stderr,"Unable to generate unique name for file %s\n", s_entry->name); + exit(1); + +got_valid_name: + /* + * OK, now we have a good replacement name. Now decide which one + * of these two beasts should get the name changed + */ + if(s_entry->priority < s_entry1->priority) + { + fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname, this_dir->whole_name, SPATH_SEPARATOR, s_entry->name, s_entry1->name); + s_entry->isorec.name_len[0] = strlen(newname); + new_reclen = sizeof(struct iso_directory_record) - + sizeof(s_entry->isorec.name) + + strlen(newname); + if(use_RockRidge) + { + if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ + new_reclen += s_entry->rr_attr_size; + } + if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ + s_entry->isorec.length[0] = new_reclen; + strcpy(s_entry->isorec.name, newname); + } + else + { + delete_file_hash(s_entry1); + fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname, this_dir->whole_name, SPATH_SEPARATOR, s_entry1->name, s_entry->name); + s_entry1->isorec.name_len[0] = strlen(newname); + new_reclen = sizeof(struct iso_directory_record) - + sizeof(s_entry1->isorec.name) + + strlen(newname); + if(use_RockRidge) + { + if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ + new_reclen += s_entry1->rr_attr_size; + } + if (new_reclen & 1) new_reclen++; /* Pad to an even byte */ + s_entry1->isorec.length[0] = new_reclen; + strcpy(s_entry1->isorec.name, newname); + add_file_hash(s_entry1); + } + add_file_hash(s_entry); + s_entry = s_entry->next; + } + + if(generate_tables + && !find_file_hash("TRANS.TBL") + && (reloc_dir != this_dir) + && (this_dir->extent == 0) ) + { + /* + * First we need to figure out how big this table is + */ + for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) + { + if(strcmp(s_entry->name, ".") == 0 || + strcmp(s_entry->name, "..") == 0) continue; + if(s_entry->table) tablesize += 35 + strlen(s_entry->table); + } + } + + if( tablesize > 0 ) + { + table = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memset(table, 0, sizeof(struct directory_entry)); + table->table = NULL; + table->next = this_dir->contents; + this_dir->contents = table; + + table->filedir = root; + table->isorec.flags[0] = 0; + table->priority = 32768; + iso9660_date(table->isorec.date, fstatbuf.st_mtime); + table->inode = TABLE_INODE; + table->dev = (dev_t) UNCACHED_DEVICE; + set_723(table->isorec.volume_sequence_number, DEF_VSN); + set_733((char *) table->isorec.size, tablesize); + table->size = tablesize; + table->filedir = this_dir; + table->name = strdup(""); + table->table = (char *) e_malloc(ROUND_UP(tablesize)); + memset(table->table, 0, ROUND_UP(tablesize)); + iso9660_file_length ("TRANS.TBL", table, 0); + + if(use_RockRidge) + { + fstatbuf.st_mode = 0444 | S_IFREG; + fstatbuf.st_nlink = 1; + generate_rock_ridge_attributes("", + "TRANS.TBL", table, + &fstatbuf, &fstatbuf, 0); + } + } + + for(s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) + { + new_reclen = strlen(s_entry->isorec.name); + + if(s_entry->isorec.flags[0] == 2) + { + if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..")) + { + path_table_size += new_reclen + sizeof(struct iso_path_table) - 1; + if (new_reclen & 1) path_table_size++; + } + else + { + new_reclen = 1; + if (this_dir == root && strlen(s_entry->name) == 1) + path_table_size += sizeof(struct iso_path_table); + } + } + if(path_table_size & 1) path_table_size++; /* For odd lengths we pad */ + s_entry->isorec.name_len[0] = new_reclen; + + new_reclen += + sizeof(struct iso_directory_record) - + sizeof(s_entry->isorec.name); + + if (new_reclen & 1) + new_reclen++; + + new_reclen += s_entry->rr_attr_size; + + if (new_reclen & 1) new_reclen++; + + if(new_reclen > 0xff) + { + fprintf(stderr,"Fatal error - RR overflow for file %s\n", + s_entry->name); + exit(1); + } + s_entry->isorec.length[0] = new_reclen; + } + + sort_directory(&this_dir->contents); + + if(table) + { + count = 0; + for (s_entry = this_dir->contents; s_entry; s_entry = s_entry->next){ + if(s_entry == table) continue; + if(!s_entry->table) continue; + if(strcmp(s_entry->name, ".") == 0 || + strcmp(s_entry->name, "..") == 0) continue; + + count += sprintf(table->table + count, "%c %-34s%s", + s_entry->table[0], + s_entry->isorec.name, s_entry->table+1); + free(s_entry->table); + s_entry->table = NULL; + } + + if(count != tablesize) + { + fprintf(stderr,"Translation table size mismatch %d %d\n", + count, tablesize); + exit(1); + } + } + + /* + * Now go through the directory and figure out how large this one will be. + * Do not split a directory entry across a sector boundary + */ + s_entry = this_dir->contents; + this_dir->ce_bytes = 0; + while(s_entry) + { + new_reclen = s_entry->isorec.length[0]; + if ((this_dir->size & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE) + this_dir->size = (this_dir->size + (SECTOR_SIZE - 1)) & + ~(SECTOR_SIZE - 1); + this_dir->size += new_reclen; + + /* See if continuation entries were used on disc */ + if(use_RockRidge && + s_entry->rr_attr_size != s_entry->total_rr_attr_size) + { + unsigned char * pnt; + int len; + int nbytes; + + pnt = s_entry->rr_attributes; + len = s_entry->total_rr_attr_size; + + /* + * We make sure that each continuation entry record is not + * split across sectors, but each file could in theory have more + * than one CE, so we scan through and figure out what we need. + */ + while(len > 3) + { + if(pnt[0] == 'C' && pnt[1] == 'E') + { + nbytes = get_733((char *) pnt+20); + + if((this_dir->ce_bytes & (SECTOR_SIZE - 1)) + nbytes >= + SECTOR_SIZE) this_dir->ce_bytes = + ROUND_UP(this_dir->ce_bytes); + /* Now store the block in the ce buffer */ + this_dir->ce_bytes += nbytes; + if(this_dir->ce_bytes & 1) this_dir->ce_bytes++; + } + len -= pnt[2]; + pnt += pnt[2]; + } + } + s_entry = s_entry->next; + } +} + +static void generate_reloc_directory() +{ + int new_reclen; + time_t current_time; + struct directory_entry *s_entry; + + /* Create an entry for our internal tree */ + time (¤t_time); + reloc_dir = (struct directory *) + e_malloc(sizeof(struct directory)); + memset(reloc_dir, 0, sizeof(struct directory)); + reloc_dir->parent = root; + reloc_dir->next = root->subdir; + root->subdir = reloc_dir; + reloc_dir->depth = 1; + reloc_dir->whole_name = strdup("./rr_moved"); + reloc_dir->de_name = strdup("rr_moved"); + reloc_dir->extent = 0; + + new_reclen = strlen(reloc_dir->de_name); + + /* Now create an actual directory entry */ + s_entry = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memset(s_entry, 0, sizeof(struct directory_entry)); + s_entry->next = root->contents; + reloc_dir->self = s_entry; + + root->contents = s_entry; + root->contents->name = strdup(reloc_dir->de_name); + root->contents->filedir = root; + root->contents->isorec.flags[0] = 2; + root->contents->priority = 32768; + iso9660_date(root->contents->isorec.date, current_time); + root->contents->inode = UNCACHED_INODE; + root->contents->dev = (dev_t) UNCACHED_DEVICE; + set_723(root->contents->isorec.volume_sequence_number, DEF_VSN); + iso9660_file_length (reloc_dir->de_name, root->contents, 1); + + if(use_RockRidge){ + fstatbuf.st_mode = 0555 | S_IFDIR; + fstatbuf.st_nlink = 2; + generate_rock_ridge_attributes("", + "rr_moved", s_entry, + &fstatbuf, &fstatbuf, 0); + }; + + /* Now create the . and .. entries in rr_moved */ + /* Now create an actual directory entry */ + s_entry = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memcpy(s_entry, root->contents, + sizeof(struct directory_entry)); + s_entry->name = strdup("."); + iso9660_file_length (".", s_entry, 1); + + s_entry->filedir = reloc_dir; + reloc_dir->contents = s_entry; + + if(use_RockRidge){ + fstatbuf.st_mode = 0555 | S_IFDIR; + fstatbuf.st_nlink = 2; + generate_rock_ridge_attributes("", + ".", s_entry, + &fstatbuf, &fstatbuf, 0); + }; + + s_entry = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memcpy(s_entry, root->contents, + sizeof(struct directory_entry)); + s_entry->name = strdup(".."); + iso9660_file_length ("..", s_entry, 1); + s_entry->filedir = root; + reloc_dir->contents->next = s_entry; + reloc_dir->contents->next->next = NULL; + if(use_RockRidge){ + fstatbuf.st_mode = 0555 | S_IFDIR; + fstatbuf.st_nlink = 2; + generate_rock_ridge_attributes("", + "..", s_entry, + &root_statbuf, &root_statbuf, 0); + }; +} + +static void FDECL1(increment_nlink, struct directory_entry *, s_entry){ + unsigned char * pnt; + int len, nlink; + + pnt = s_entry->rr_attributes; + len = s_entry->total_rr_attr_size; + while(len){ + if(pnt[0] == 'P' && pnt[1] == 'X') { + nlink = get_733((char *) pnt+12); + set_733((char *) pnt+12, nlink+1); + break; + }; + len -= pnt[2]; + pnt += pnt[2]; + }; +} + +void finish_cl_pl_entries(){ + struct directory_entry *s_entry, *s_entry1; + struct directory * d_entry; + + s_entry = reloc_dir->contents; + s_entry = s_entry->next->next; /* Skip past . and .. */ + for(; s_entry; s_entry = s_entry->next){ + d_entry = reloc_dir->subdir; + while(d_entry){ + if(d_entry->self == s_entry) break; + d_entry = d_entry->next; + }; + if(!d_entry){ + fprintf(stderr,"Unable to locate directory parent\n"); + exit(1); + }; + + /* First fix the PL pointer in the directory in the rr_reloc dir */ + s_entry1 = d_entry->contents->next; + set_733((char *) s_entry1->rr_attributes + s_entry1->total_rr_attr_size - 8, + s_entry->filedir->extent); + + /* Now fix the CL pointer */ + s_entry1 = s_entry->parent_rec; + + set_733((char *) s_entry1->rr_attributes + s_entry1->total_rr_attr_size - 8, + d_entry->extent); + + s_entry->filedir = reloc_dir; /* Now we can fix this */ + } + /* Next we need to modify the NLINK terms in the assorted root directory records + to account for the presence of the RR_MOVED directory */ + + increment_nlink(root->self); + increment_nlink(root->self->next); + d_entry = root->subdir; + while(d_entry){ + increment_nlink(d_entry->contents->next); + d_entry = d_entry->next; + }; +} + +/* + * This function scans the directory tree, looking for files, and it makes + * note of everything that is found. We also begin to construct the ISO9660 + * directory entries, so that we can determine how large each directory is. + */ + +int +FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de, + struct iso_directory_record *, mrootp){ + DIR * current_dir; + char whole_path[1024]; + struct dirent * d_entry; + struct directory_entry * s_entry, *s_entry1; + struct directory * this_dir, *next_brother, *parent; + struct stat statbuf, lstatbuf; + int status, dflag; + int lstatus; + int n_orig; + struct directory_entry **orig_contents = NULL; + struct directory_entry * odpnt = NULL; + char * cpnt; + int new_reclen; + int deep_flag; + char * old_path; + + current_dir = opendir(path); + d_entry = NULL; + + /* Apparently NFS sometimes allows you to open the directory, but + then refuses to allow you to read the contents. Allow for this */ + + old_path = path; + + if(current_dir) d_entry = readdir_add_files(&path, old_path, current_dir); + + if(!current_dir || !d_entry) { + fprintf(stderr,"Unable to open directory %s\n", path); + de->isorec.flags[0] &= ~2; /* Mark as not a directory */ + if(current_dir) closedir(current_dir); + return 0; + }; + + parent = de->filedir; + /* Set up the struct for the current directory, and insert it into the + tree */ + +#ifdef VMS + vms_path_fixup(path); +#endif + + this_dir = (struct directory *) e_malloc(sizeof(struct directory)); + this_dir->next = NULL; + new_reclen = 0; + this_dir->subdir = NULL; + this_dir->self = de; + this_dir->contents = NULL; + this_dir->whole_name = strdup(path); + cpnt = strrchr(path, PATH_SEPARATOR); + if(cpnt) + cpnt++; + else + cpnt = path; + this_dir->de_name = strdup(cpnt); + this_dir->size = 0; + this_dir->extent = 0; + + if(!parent || parent == root){ + if (!root) { + root = this_dir; /* First time through for root directory only */ + root->depth = 0; + root->parent = root; + } else { + this_dir->depth = 1; + if(!root->subdir) + root->subdir = this_dir; + else { + next_brother = root->subdir; + while(next_brother->next) next_brother = next_brother->next; + next_brother->next = this_dir; + }; + this_dir->parent = parent; + }; + } else { + /* Come through here for normal traversal of tree */ +#ifdef DEBUG + fprintf(stderr,"%s(%d) ", path, this_dir->depth); +#endif + if(parent->depth > RR_relocation_depth) { + fprintf(stderr,"Directories too deep %s\n", path); + exit(1); + }; + + this_dir->parent = parent; + this_dir->depth = parent->depth + 1; + + if(!parent->subdir) + parent->subdir = this_dir; + else { + next_brother = parent->subdir; + while(next_brother->next) next_brother = next_brother->next; + next_brother->next = this_dir; + } + } + + /* + * Parse the same directory in the image that we are merging + * for multisession stuff. + */ + if( mrootp != NULL ) + { + orig_contents = read_merging_directory(mrootp, &n_orig); + } + +/* Now we scan the directory itself, and look at what is inside of it. */ + + dflag = 0; + while(1==1){ + + /* The first time through, skip this, since we already asked for + the first entry when we opened the directory. */ + if(dflag) d_entry = readdir_add_files(&path, old_path, current_dir); + dflag++; + + if(!d_entry) break; + + /* OK, got a valid entry */ + + /* If we do not want all files, then pitch the backups. */ + if(!all_files){ + if(strchr(d_entry->d_name,'~')) continue; + if(strchr(d_entry->d_name,'#')) continue; + }; + + if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path)){ + fprintf(stderr, "Overflow of stat buffer\n"); + exit(1); + }; + + /* Generate the complete ASCII path for this file */ + strcpy(whole_path, path); +#ifndef VMS + if(whole_path[strlen(whole_path)-1] != '/') + strcat(whole_path, "/"); +#endif + strcat(whole_path, d_entry->d_name); + + /* Should we exclude this file? */ + if (is_excluded(whole_path)) { + if (verbose) { + fprintf(stderr, "Excluded: %s\n",whole_path); + } + continue; + } + /** Should we exclude this file ? */ + if (matches(d_entry->d_name)) { + if (verbose) { + fprintf(stderr, "Excluded by match: %s\n", whole_path); + } + continue; + } + + if( generate_tables + && strcmp(d_entry->d_name, "TRANS.TBL") == 0 ) + { + /* + * Ignore this entry. We are going to be generating new + * versions of these files, and we need to ignore any + * originals that we might have found. + */ + if (verbose) + { + fprintf(stderr, "Excluded: %s\n",whole_path); + } + continue; + } + +#if 0 + if (verbose) fprintf(stderr, "%s\n",whole_path); +#endif + status = stat_filter(whole_path, &statbuf); + + lstatus = lstat_filter(whole_path, &lstatbuf); + + if( (status == -1) && (lstatus == -1) ) + { + /* + * This means that the file doesn't exist, or isn't accessible. + * Sometimes this is because of NFS permissions problems + * or it could mean that the user has attempted to 'add' something + * with the -i option and the directory being added doesn't exist. + */ + fprintf(stderr, "Non-existant or inaccessible: %s\n",whole_path); + continue; + } + + if(this_dir == root && strcmp(d_entry->d_name, ".") == 0) + root_statbuf = statbuf; /* Save this for later on */ + + /* We do this to make sure that the root entries are consistent */ + if(this_dir == root && strcmp(d_entry->d_name, "..") == 0) { + statbuf = root_statbuf; + lstatbuf = root_statbuf; + }; + + if(S_ISLNK(lstatbuf.st_mode)){ + + /* Here we decide how to handle the symbolic links. Here + we handle the general case - if we are not following + links or there is an error, then we must change + something. If RR is in use, it is easy, we let RR + describe the file. If not, then we punt the file. */ + + if((status || !follow_links)){ + if(use_RockRidge){ + status = 0; + statbuf.st_size = 0; + STAT_INODE(statbuf) = UNCACHED_INODE; + statbuf.st_dev = (dev_t) UNCACHED_DEVICE; + statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; + } else { + if(follow_links) fprintf(stderr, + "Unable to stat file %s - ignoring and continuing.\n", + whole_path); + else fprintf(stderr, + "Symlink %s ignored - continuing.\n", + whole_path); + continue; /* Non Rock Ridge discs - ignore all symlinks */ + }; + } + + /* Here we handle a different kind of case. Here we have + a symlink, but we want to follow symlinks. If we run + across a directory loop, then we need to pretend that + we are not following symlinks for this file. If this + is the first time we have seen this, then make this + seem as if there was no symlink there in the first + place */ + + if( follow_links + && S_ISDIR(statbuf.st_mode) ) + { + if( strcmp(d_entry->d_name, ".") + && strcmp(d_entry->d_name, "..") ) + { + if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) + { + if(!use_RockRidge) + { + fprintf(stderr, "Already cached directory seen (%s)\n", + whole_path); + continue; + } + statbuf.st_size = 0; + STAT_INODE(statbuf) = UNCACHED_INODE; + statbuf.st_dev = (dev_t) UNCACHED_DEVICE; + statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; + } else { + lstatbuf = statbuf; + add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); + } + } + } + + /* + * For non-directories, we just copy the stat information over + * so we correctly include this file. + */ + if( follow_links + && !S_ISDIR(statbuf.st_mode) ) + { + lstatbuf = statbuf; + } + } + + /* + * Add directories to the cache so that we don't waste space even + * if we are supposed to be following symlinks. + */ + if( follow_links + && strcmp(d_entry->d_name, ".") + && strcmp(d_entry->d_name, "..") + && S_ISDIR(statbuf.st_mode) ) + { + add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); + } +#ifdef VMS + if(!S_ISDIR(lstatbuf.st_mode) && (statbuf.st_fab_rfm != FAB$C_FIX && + statbuf.st_fab_rfm != FAB$C_STMLF)) { + fprintf(stderr,"Warning - file %s has an unsupported VMS record" + " format (%d)\n", + whole_path, statbuf.st_fab_rfm); + } +#endif + + if(S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK))){ + fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n", + whole_path, errno); + continue; + } + + /* Add this so that we can detect directory loops with hard links. + If we are set up to follow symlinks, then we skip this checking. */ + if( !follow_links + && S_ISDIR(lstatbuf.st_mode) + && strcmp(d_entry->d_name, ".") + && strcmp(d_entry->d_name, "..") ) + { + if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) { + fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n", + whole_path, (unsigned long) statbuf.st_dev, + (unsigned long) STAT_INODE(statbuf)); + exit(1); + }; + add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); + }; + + if (!S_ISCHR(lstatbuf.st_mode) && !S_ISBLK(lstatbuf.st_mode) && + !S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode) + && !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) && + !S_ISDIR(lstatbuf.st_mode)) { + fprintf(stderr,"Unknown file type %s - ignoring and continuing.\n", + whole_path); + continue; + }; + + /* Who knows what trash this is - ignore and continue */ + + if(status) { + fprintf(stderr, + "Unable to stat file %s - ignoring and continuing.\n", + whole_path); + continue; + }; + + s_entry = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + s_entry->next = this_dir->contents; + memset(s_entry->isorec.extent, 0, 8); + this_dir->contents = s_entry; + deep_flag = 0; + s_entry->table = NULL; + + s_entry->name = strdup(d_entry->d_name); + s_entry->whole_name = strdup (whole_path); + + s_entry->de_flags = 0; + s_entry->filedir = this_dir; + s_entry->isorec.flags[0] = 0; + s_entry->isorec.ext_attr_length[0] = 0; + iso9660_date(s_entry->isorec.date, statbuf.st_mtime); + s_entry->isorec.file_unit_size[0] = 0; + s_entry->isorec.interleave[0] = 0; + if(parent && parent == reloc_dir && strcmp(d_entry->d_name, "..") == 0){ + s_entry->inode = UNCACHED_INODE; + s_entry->dev = (dev_t) UNCACHED_DEVICE; + deep_flag = NEED_PL; + } else { + s_entry->inode = STAT_INODE(statbuf); + s_entry->dev = statbuf.st_dev; + }; + set_723(s_entry->isorec.volume_sequence_number, DEF_VSN); + iso9660_file_length(d_entry->d_name, s_entry, S_ISDIR(statbuf.st_mode)); + s_entry->rr_attr_size = 0; + s_entry->total_rr_attr_size = 0; + s_entry->rr_attributes = NULL; + + /* Directories are assigned sizes later on */ + if (!S_ISDIR(statbuf.st_mode)) { + set_733((char *) s_entry->isorec.size, statbuf.st_size); + + if (S_ISCHR(lstatbuf.st_mode) || S_ISBLK(lstatbuf.st_mode) || + S_ISFIFO(lstatbuf.st_mode) || S_ISSOCK(lstatbuf.st_mode) + || S_ISLNK(lstatbuf.st_mode)) + s_entry->size = 0; + else + s_entry->size = statbuf.st_size; + } else + s_entry->isorec.flags[0] = 2; + + /* + * We always should create an entirely new directory tree whenever + * we generate a new session, unless there were *no* changes whatsoever + * to any of the directories, in which case it would be kind of pointless + * to generate a new session. + * + * I believe it is possible to rigorously prove that any change anywhere + * in the filesystem will force the entire tree to be regenerated + * because the modified directory will get a new extent number. Since + * each subdirectory of the changed directory has a '..' entry, all of + * them will need to be rewritten too, and since the parent directory + * of the modified directory will have an extent pointer to the directory + * it too will need to be rewritten. Thus we will never be able to reuse + * any directory information when writing new sessions. + * + * We still check the previous session so we can mark off the equivalent + * entry in the list we got from the original disc, however. + */ + if(S_ISDIR(statbuf.st_mode) && orig_contents != NULL){ + check_prev_session(orig_contents, n_orig, s_entry, + &statbuf, &lstatbuf, &odpnt); + } + + if (strcmp(d_entry->d_name,".") && strcmp(d_entry->d_name,"..") && + S_ISDIR(statbuf.st_mode) && this_dir->depth > RR_relocation_depth){ + if(!reloc_dir) generate_reloc_directory(); + + s_entry1 = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memcpy(s_entry1, this_dir->contents, + sizeof(struct directory_entry)); + s_entry1->table = NULL; + s_entry1->name = strdup(this_dir->contents->name); + s_entry1->whole_name = strdup(this_dir->contents->whole_name); + s_entry1->next = reloc_dir->contents; + reloc_dir->contents = s_entry1; + s_entry1->priority = 32768; + s_entry1->parent_rec = this_dir->contents; + + deep_flag = NEED_RE; + + if(use_RockRidge) { + generate_rock_ridge_attributes(whole_path, + d_entry->d_name, s_entry1, + &statbuf, &lstatbuf, deep_flag); + } + + deep_flag = 0; + + /* We need to set this temporarily so that the parent to this is correctly + determined. */ + s_entry1->filedir = reloc_dir; + if( odpnt != NULL ) + { + scan_directory_tree(whole_path, s_entry1, &odpnt->isorec); + } + else + { + scan_directory_tree(whole_path, s_entry1, NULL); + } + if( odpnt != NULL ) + { + free(odpnt); + odpnt = NULL; + } + s_entry1->filedir = this_dir; + + statbuf.st_size = 0; + statbuf.st_mode &= 0777; + set_733((char *) s_entry->isorec.size, 0); + s_entry->size = 0; + s_entry->isorec.flags[0] = 0; + s_entry->inode = UNCACHED_INODE; + deep_flag = NEED_CL; + }; + + if(generate_tables && strcmp(s_entry->name, ".") && strcmp(s_entry->name, "..")) { + char buffer[2048]; + int nchar; + switch(lstatbuf.st_mode & S_IFMT){ + case S_IFDIR: + sprintf(buffer,"D\t%s\n", + s_entry->name); + break; +#ifndef NON_UNIXFS + case S_IFBLK: + sprintf(buffer,"B\t%s\t%lu %lu\n", + s_entry->name, + (unsigned long) major(statbuf.st_rdev), + (unsigned long) minor(statbuf.st_rdev)); + break; + case S_IFIFO: + sprintf(buffer,"P\t%s\n", + s_entry->name); + break; + case S_IFCHR: + sprintf(buffer,"C\t%s\t%lu %lu\n", + s_entry->name, + (unsigned long) major(statbuf.st_rdev), + (unsigned long) minor(statbuf.st_rdev)); + break; + case S_IFLNK: + nchar = readlink(whole_path, + symlink_buff, + sizeof(symlink_buff)); + symlink_buff[nchar < 0 ? 0 : nchar] = 0; + sprintf(buffer,"L\t%s\t%s\n", + s_entry->name, symlink_buff); + break; +#ifdef S_IFSOCK + case S_IFSOCK: + sprintf(buffer,"S\t%s\n", + s_entry->name); + break; +#endif +#endif /* NON_UNIXFS */ + case S_IFREG: + default: + sprintf(buffer,"F\t%s\n", + s_entry->name); + break; + }; + s_entry->table = strdup(buffer); + }; + + /* + * See if we have an entry for this guy in the previous session. + */ + if( orig_contents != NULL && !S_ISDIR(statbuf.st_mode)) + { + check_prev_session(orig_contents, n_orig, s_entry, + &statbuf, &lstatbuf, NULL); + } + + if(S_ISDIR(statbuf.st_mode)){ + int dflag; + if (strcmp(d_entry->d_name,".") && strcmp(d_entry->d_name,"..")) { + if( odpnt != NULL ) + { + dflag = scan_directory_tree(whole_path, s_entry, + &odpnt->isorec); + } + else + { + dflag = scan_directory_tree(whole_path, s_entry, NULL); + } + /* If unable to scan directory, mark this as a non-directory */ + if(!dflag) + lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; + if( odpnt != NULL ) + { + free(odpnt); + odpnt = NULL; + } + } + } + + if(use_RockRidge && this_dir == root && strcmp(s_entry->name, ".") == 0) + deep_flag |= NEED_CE | NEED_SP; /* For extension record */ + + /* Now figure out how much room this file will take in the directory */ + + if(use_RockRidge) { + generate_rock_ridge_attributes(whole_path, + d_entry->d_name, s_entry, + &statbuf, &lstatbuf, deep_flag); + + } + } + closedir(current_dir); + + if( orig_contents != NULL ) + { + merge_remaining_entries(this_dir, orig_contents, n_orig); + free_mdinfo(orig_contents, n_orig); + } + + if( this_dir->contents == NULL ) + { + /* + * This directory must have been inaccessible. + */ + return 0; + } + sort_n_finish(this_dir); + + return 1; +} + + +void FDECL2(generate_iso9660_directories, struct directory *, node, FILE*, outfile){ + struct directory * dpnt; + + dpnt = node; + + while (dpnt){ + if( dpnt->extent > session_start ) + { + generate_one_directory(dpnt, outfile); + } + if(dpnt->subdir) generate_iso9660_directories(dpnt->subdir, outfile); + dpnt = dpnt->next; + } +} + +void FDECL1(dump_tree, struct directory *, node){ + struct directory * dpnt; + + dpnt = node; + + while (dpnt){ + fprintf(stderr,"%4d %5d %s\n",dpnt->extent, dpnt->size, dpnt->de_name); + if(dpnt->subdir) dump_tree(dpnt->subdir); + dpnt = dpnt->next; + } +} + +/* + * something quick and dirty to locate a file given a path + * recursively walks down path in filename until it finds the + * directory entry for the desired file + */ +struct directory_entry * FDECL2(search_tree_file, struct directory *, + node,char *, filename) +{ + struct directory_entry * depnt; + struct directory * dpnt; + char * p1; + char * rest; + char * subdir; + + /* + * strip off next directory name from filename + */ + subdir = strdup(filename); + + if( (p1=strchr(subdir, '/')) == subdir ) + { + fprintf(stderr,"call to search_tree_file with an absolute path, stripping\n"); + fprintf(stderr,"initial path separator. Hope this was intended...\n"); + memmove(subdir, subdir+1, strlen(subdir)-1); + p1 = strchr(subdir, '/'); + } + + /* + * do we need to find a subdirectory + */ + if (p1) + { + *p1 = '\0'; + +#ifdef DEBUG_TORITO + printf("Looking for subdir called %s\n",p1); +#endif + + rest = p1+1; + +#ifdef DEBUG_TORITO + printf("Remainder of path name is now %s\n", rest); +#endif + + dpnt = node->subdir; + while( dpnt ) + { +#ifdef DEBUG_TORITO + fprintf(stderr,"%4d %5d %s\n", dpnt->extent, dpnt->size, + dpnt->de_name); +#endif + if (!strcmp(subdir, dpnt->de_name)) + { +#ifdef DEBUG_TORITO + printf("Calling next level with filename = %s", rest); +#endif + return(search_tree_file( dpnt, rest )); + } + dpnt = dpnt->next; + } + + /* if we got here means we couldnt find the subdir */ + return (NULL); + } + else + { + /* + * look for a normal file now + */ + depnt = node->contents; + while (depnt) + { +#ifdef DEBUG_TORITO + fprintf(stderr,"%4d %5d %s\n",depnt->isorec.extent, + depnt->size, depnt->name); +#endif + if (!strcmp(filename, depnt->name)) + { +#ifdef DEBUG_TORITO + printf("Found our file %s", filename); +#endif + return(depnt); + } + depnt = depnt->next; + } + /* + * if we got here means we couldnt find the subdir + */ + return (NULL); + } + fprintf(stderr,"We cant get here in search_tree_file :-/ \n"); +} + diff --git a/util/mkisofs/write.c b/util/mkisofs/write.c new file mode 100644 index 000000000..cfc9b763c --- /dev/null +++ b/util/mkisofs/write.c @@ -0,0 +1,1142 @@ +/* + * Program write.c - dump memory structures to file for iso9660 filesystem. + + Written by Eric Youngdale (1993). + + Copyright 1993 Yggdrasil Computing, Incorporated + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: write.c,v 1.6.1.3 1997/11/13 05:07:13 eric Exp $"; + +#include +#include +#include "mkisofs.h" +#include "iso9660.h" +#include +#include + +#include +#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#ifdef __svr4__ +extern char * strdup(const char *); +#endif + +#ifdef VMS +extern char * strdup(const char *); +#endif + + +/* Max number of sectors we will write at one time */ +#define NSECT 16 + +/* Counters for statistics */ + +static int table_size = 0; +static int total_dir_size = 0; +static int rockridge_size = 0; +static struct directory ** pathlist; +static next_path_index = 1; + +/* Used to fill in some of the information in the volume descriptor. */ +static struct tm local; +static struct tm gmt; + +/* Routines to actually write the disc. We write sequentially so that + we could write a tape, or write the disc directly */ + + +#define FILL_SPACE(X) memset(vol_desc.X, ' ', sizeof(vol_desc.X)) + +void FDECL2(set_721, char *, pnt, unsigned int, i) +{ + pnt[0] = i & 0xff; + pnt[1] = (i >> 8) & 0xff; +} + +void FDECL2(set_722, char *, pnt, unsigned int, i) +{ + pnt[0] = (i >> 8) & 0xff; + pnt[1] = i & 0xff; +} + +void FDECL2(set_723, char *, pnt, unsigned int, i) +{ + pnt[3] = pnt[0] = i & 0xff; + pnt[2] = pnt[1] = (i >> 8) & 0xff; +} + +void FDECL2(set_731, char *, pnt, unsigned int, i) +{ + pnt[0] = i & 0xff; + pnt[1] = (i >> 8) & 0xff; + pnt[2] = (i >> 16) & 0xff; + pnt[3] = (i >> 24) & 0xff; +} + +void FDECL2(set_732, char *, pnt, unsigned int, i) +{ + pnt[3] = i & 0xff; + pnt[2] = (i >> 8) & 0xff; + pnt[1] = (i >> 16) & 0xff; + pnt[0] = (i >> 24) & 0xff; +} + +int FDECL1(get_733, char *, p) +{ + return ((p[0] & 0xff) + | ((p[1] & 0xff) << 8) + | ((p[2] & 0xff) << 16) + | ((p[3] & 0xff) << 24)); +} + +void FDECL2(set_733, char *, pnt, unsigned int, i) +{ + pnt[7] = pnt[0] = i & 0xff; + pnt[6] = pnt[1] = (i >> 8) & 0xff; + pnt[5] = pnt[2] = (i >> 16) & 0xff; + pnt[4] = pnt[3] = (i >> 24) & 0xff; +} + +void FDECL4(xfwrite, void *, buffer, int, count, int, size, FILE *, file) +{ + while(count) + { + int got = fwrite(buffer,size,count,file); + + if(got<=0) + { + fprintf(stderr,"cannot fwrite %d*%d\n",size,count); + exit(1); + } + count-=got,*(char**)&buffer+=size*got; + } +} + +struct deferred_write +{ + struct deferred_write * next; + char * table; + unsigned int extent; + unsigned int size; + char * name; +}; + +static struct deferred_write * dw_head = NULL, * dw_tail = NULL; + +static struct directory_entry * sort_dir; +static struct eltorito_boot_descriptor boot_desc; + +unsigned int last_extent_written =0; +static struct iso_primary_descriptor vol_desc; +static path_table_index; +static time_t begun; + +/* We recursively walk through all of the directories and assign extent + numbers to them. We have already assigned extent numbers to everything that + goes in front of them */ + +void FDECL1(assign_directory_addresses, struct directory *, node) +{ + int dir_size; + struct directory * dpnt; + + dpnt = node; + + while (dpnt) + { + /* + * If we already have an extent for this (i.e. it came from + * a multisession disc), then don't reassign a new extent. + */ + dpnt->path_index = next_path_index++; + if( dpnt->extent == 0 ) + { + dpnt->extent = last_extent; + dir_size = (dpnt->size + (SECTOR_SIZE - 1)) >> 11; + + last_extent += dir_size; + + /* + * Leave room for the CE entries for this directory. Keep them + * close to the reference directory so that access will be + * quick. + */ + if(dpnt->ce_bytes) + { + last_extent += ROUND_UP(dpnt->ce_bytes) >> 11; + } + } + + if(dpnt->subdir) + { + assign_directory_addresses(dpnt->subdir); + } + + dpnt = dpnt->next; + } +} + +static void FDECL3(write_one_file, char *, filename, + unsigned int, size, FILE *, outfile) +{ + char buffer[SECTOR_SIZE * NSECT]; + FILE * infile; + int remain; + int use; + + + if ((infile = fopen(filename, "rb")) == NULL) + { +#if defined(sun) || defined(_AUX_SOURCE) + fprintf(stderr, "cannot open %s: (%d)\n", filename, errno); +#else + fprintf(stderr, "cannot open %s: %s\n", filename, strerror(errno)); +#endif + exit(1); + } + remain = size; + + while(remain > 0) + { + use = (remain > SECTOR_SIZE * NSECT - 1 ? NSECT*SECTOR_SIZE : remain); + use = ROUND_UP(use); /* Round up to nearest sector boundary */ + memset(buffer, 0, use); + if (fread(buffer, 1, use, infile) == 0) + { + fprintf(stderr,"cannot read from %s\n",filename); + exit(1); + } + xfwrite(buffer, 1, use, outfile); + last_extent_written += use/SECTOR_SIZE; +#if 0 + if((last_extent_written % 1000) < use/SECTOR_SIZE) + { + fprintf(stderr,"%d..", last_extent_written); + } +#else + if((last_extent_written % 5000) < use/SECTOR_SIZE) + { + time_t now; + time_t the_end; + double frac; + + time(&now); + frac = last_extent_written / (double)last_extent; + the_end = begun + (now - begun) / frac; + fprintf(stderr, "%6.2f%% done, estimate finish %s", + frac * 100., ctime(&the_end)); + } +#endif + remain -= use; + } + fclose(infile); +} /* write_one_file(... */ + +static void FDECL1(write_files, FILE *, outfile) +{ + struct deferred_write * dwpnt, *dwnext; + dwpnt = dw_head; + while(dwpnt) + { + if(dwpnt->table) + { + xfwrite(dwpnt->table, 1, ROUND_UP(dwpnt->size), outfile); + last_extent_written += ROUND_UP(dwpnt->size) / SECTOR_SIZE; + table_size += dwpnt->size; +/* fprintf(stderr,"Size %d ", dwpnt->size); */ + free(dwpnt->table); + } + else + { + +#ifdef VMS + vms_write_one_file(dwpnt->name, dwpnt->size, outfile); +#else + write_one_file(dwpnt->name, dwpnt->size, outfile); +#endif + free(dwpnt->name); + } + + dwnext = dwpnt; + dwpnt = dwpnt->next; + free(dwnext); + } +} /* write_files(... */ + +#if 0 +static void dump_filelist() +{ + struct deferred_write * dwpnt; + dwpnt = dw_head; + while(dwpnt) + { + fprintf(stderr, "File %s\n",dwpnt->name); + dwpnt = dwpnt->next; + } + fprintf(stderr,"\n"); +} +#endif + +int FDECL2(compare_dirs, const void *, rr, const void *, ll) +{ + char * rpnt, *lpnt; + struct directory_entry ** r, **l; + + r = (struct directory_entry **) rr; + l = (struct directory_entry **) ll; + rpnt = (*r)->isorec.name; + lpnt = (*l)->isorec.name; + + /* + * Put the '.' and '..' entries on the head of the sorted list. + * For normal ASCII, this always happens to be the case, but out of + * band characters cause this not to be the case sometimes. + */ + if( strcmp(rpnt, ".") == 0 ) return -1; + if( strcmp(lpnt, ".") == 0 ) return 1; + + if( strcmp(rpnt, "..") == 0 ) return -1; + if( strcmp(lpnt, "..") == 0 ) return 1; + + while(*rpnt && *lpnt) + { + if(*rpnt == ';' && *lpnt != ';') return -1; + if(*rpnt != ';' && *lpnt == ';') return 1; + + if(*rpnt == ';' && *lpnt == ';') return 0; + + if(*rpnt == '.' && *lpnt != '.') return -1; + if(*rpnt != '.' && *lpnt == '.') return 1; + + if((unsigned char)*rpnt < (unsigned char)*lpnt) return -1; + if((unsigned char)*rpnt > (unsigned char)*lpnt) return 1; + rpnt++; lpnt++; + } + if(*rpnt) return 1; + if(*lpnt) return -1; + return 0; +} + +void FDECL1(sort_directory, struct directory_entry **, sort_dir) +{ + int dcount = 0; + int i, len; + struct directory_entry * s_entry; + struct directory_entry ** sortlist; + + s_entry = *sort_dir; + while(s_entry) + { + dcount++; + s_entry = s_entry->next; + } + + /* + * OK, now we know how many there are. Build a vector for sorting. + */ + sortlist = (struct directory_entry **) + e_malloc(sizeof(struct directory_entry *) * dcount); + + dcount = 0; + s_entry = *sort_dir; + while(s_entry) + { + sortlist[dcount] = s_entry; + len = s_entry->isorec.name_len[0]; + s_entry->isorec.name[len] = 0; + dcount++; + s_entry = s_entry->next; + } + + qsort(sortlist, dcount, sizeof(struct directory_entry *), + (int (*)(const void *, const void *))compare_dirs); + + /* + * Now reassemble the linked list in the proper sorted order + */ + for(i=0; inext = sortlist[i+1]; + } + + sortlist[dcount-1]->next = NULL; + *sort_dir = sortlist[0]; + + free(sortlist); + +} + +void generate_root_record() +{ + time_t ctime; + + time (&ctime); + + local = *localtime(&ctime); + gmt = *gmtime(&ctime); + + root_record.length[0] = 1 + sizeof(struct iso_directory_record) + - sizeof(root_record.name); + root_record.ext_attr_length[0] = 0; + set_733((char *) root_record.extent, root->extent); + set_733((char *) root_record.size, ROUND_UP(root->size)); + iso9660_date(root_record.date, ctime); + root_record.flags[0] = 2; + root_record.file_unit_size[0] = 0; + root_record.interleave[0] = 0; + set_723(root_record.volume_sequence_number, DEF_VSN); + root_record.name_len[0] = 1; +} + +static void FDECL1(assign_file_addresses, struct directory *, dpnt) +{ + struct directory * finddir; + struct directory_entry * s_entry; + struct file_hash *s_hash; + struct deferred_write * dwpnt; + char whole_path[1024]; + + while (dpnt) + { + s_entry = dpnt->contents; + for(s_entry = dpnt->contents; s_entry; s_entry = s_entry->next) + { + + /* + * If we already have an extent for this entry, + * then don't assign a new one. It must have come + * from a previous session on the disc. Note that + * we don't end up scheduling the thing for writing + * either. + */ + if( isonum_733((unsigned char *) s_entry->isorec.extent) != 0 ) + { + continue; + } + + /* + * This saves some space if there are symlinks present + */ + s_hash = find_hash(s_entry->dev, s_entry->inode); + if(s_hash) + { + if(verbose) + { + fprintf(stderr, "Cache hit for %s%s%s\n",s_entry->filedir->de_name, + SPATH_SEPARATOR, s_entry->name); + } + set_733((char *) s_entry->isorec.extent, s_hash->starting_block); + set_733((char *) s_entry->isorec.size, s_hash->size); + continue; + } + + /* + * If this is for a directory that is not a . or a .. entry, + * then look up the information for the entry. We have already + * assigned extents for directories, so we just need to + * fill in the blanks here. + */ + if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..") && + s_entry->isorec.flags[0] == 2) + { + finddir = dpnt->subdir; + while(1==1) + { + if(finddir->self == s_entry) break; + finddir = finddir->next; + if(!finddir) + { + fprintf(stderr,"Fatal goof\n"); exit(1); + } + } + set_733((char *) s_entry->isorec.extent, finddir->extent); + s_entry->starting_block = finddir->extent; + s_entry->size = ROUND_UP(finddir->size); + total_dir_size += s_entry->size; + add_hash(s_entry); + set_733((char *) s_entry->isorec.size, ROUND_UP(finddir->size)); + continue; + } + + + /* + * If this is . or .., then look up the relevant info from the + * tables. + */ + if(strcmp(s_entry->name,".") == 0) + { + set_733((char *) s_entry->isorec.extent, dpnt->extent); + + /* + * Set these so that the hash table has the + * correct information + */ + s_entry->starting_block = dpnt->extent; + s_entry->size = ROUND_UP(dpnt->size); + + add_hash(s_entry); + s_entry->starting_block = dpnt->extent; + set_733((char *) s_entry->isorec.size, ROUND_UP(dpnt->size)); + continue; + } + + if(strcmp(s_entry->name,"..") == 0) + { + if(dpnt == root) + { + total_dir_size += root->size; + } + set_733((char *) s_entry->isorec.extent, dpnt->parent->extent); + + /* + * Set these so that the hash table has the + * correct information + */ + s_entry->starting_block = dpnt->parent->extent; + s_entry->size = ROUND_UP(dpnt->parent->size); + + add_hash(s_entry); + s_entry->starting_block = dpnt->parent->extent; + set_733((char *) s_entry->isorec.size, ROUND_UP(dpnt->parent->size)); + continue; + } + + /* + * Some ordinary non-directory file. Just schedule the + * file to be written. This is all quite + * straightforward, just make a list and assign extents + * as we go. Once we get through writing all of the + * directories, we should be ready write out these + * files + */ + if(s_entry->size) + { + dwpnt = (struct deferred_write *) + e_malloc(sizeof(struct deferred_write)); + if(dw_tail) + { + dw_tail->next = dwpnt; + dw_tail = dwpnt; + } + else + { + dw_head = dwpnt; + dw_tail = dwpnt; + } + if(s_entry->inode == TABLE_INODE) + { + dwpnt->table = s_entry->table; + dwpnt->name = NULL; + sprintf(whole_path,"%s%sTRANS.TBL", + s_entry->filedir->whole_name, SPATH_SEPARATOR); + } + else + { + dwpnt->table = NULL; + strcpy(whole_path, s_entry->whole_name); + dwpnt->name = strdup(whole_path); + } + dwpnt->next = NULL; + dwpnt->size = s_entry->size; + dwpnt->extent = last_extent; + set_733((char *) s_entry->isorec.extent, last_extent); + s_entry->starting_block = last_extent; + add_hash(s_entry); + last_extent += ROUND_UP(s_entry->size) >> 11; + if(verbose) + { + fprintf(stderr,"%d %d %s\n", s_entry->starting_block, + last_extent-1, whole_path); + } +#ifdef DBG_ISO + if((ROUND_UP(s_entry->size) >> 11) > 500) + { + fprintf(stderr,"Warning: large file %s\n", whole_path); + fprintf(stderr,"Starting block is %d\n", s_entry->starting_block); + fprintf(stderr,"Reported file size is %d extents\n", s_entry->size); + + } +#endif + if(last_extent > (800000000 >> 11)) + { + /* + * More than 800Mb? Punt + */ + fprintf(stderr,"Extent overflow processing file %s\n", whole_path); + fprintf(stderr,"Starting block is %d\n", s_entry->starting_block); + fprintf(stderr,"Reported file size is %d extents\n", s_entry->size); + exit(1); + } + continue; + } + + /* + * This is for zero-length files. If we leave the extent 0, + * then we get screwed, because many readers simply drop files + * that have an extent of zero. Thus we leave the size 0, + * and just assign the extent number. + */ + set_733((char *) s_entry->isorec.extent, last_extent); + } + if(dpnt->subdir) + { + assign_file_addresses(dpnt->subdir); + } + dpnt = dpnt->next; + } +} /* assign_file_addresses(... */ + +void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile) +{ + unsigned int ce_address = 0; + char * ce_buffer; + unsigned int ce_index = 0; + unsigned int ce_size; + unsigned int dir_index; + char * directory_buffer; + int new_reclen; + struct directory_entry * s_entry; + struct directory_entry * s_entry_d; + unsigned int total_size; + + total_size = (dpnt->size + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1); + directory_buffer = (char *) e_malloc(total_size); + memset(directory_buffer, 0, total_size); + dir_index = 0; + + ce_size = (dpnt->ce_bytes + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1); + ce_buffer = NULL; + + if(ce_size) + { + ce_buffer = (char *) e_malloc(ce_size); + memset(ce_buffer, 0, ce_size); + + ce_index = 0; + + /* + * Absolute byte address of CE entries for this directory + */ + ce_address = last_extent_written + (total_size >> 11); + ce_address = ce_address << 11; + } + + s_entry = dpnt->contents; + while(s_entry) + { + + /* + * We do not allow directory entries to cross sector boundaries. + * Simply pad, and then start the next entry at the next sector + */ + new_reclen = s_entry->isorec.length[0]; + if( (dir_index & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE ) + { + dir_index = (dir_index + (SECTOR_SIZE - 1)) & + ~(SECTOR_SIZE - 1); + } + + memcpy(directory_buffer + dir_index, &s_entry->isorec, + sizeof(struct iso_directory_record) - + sizeof(s_entry->isorec.name) + s_entry->isorec.name_len[0]); + dir_index += sizeof(struct iso_directory_record) - + sizeof (s_entry->isorec.name)+ s_entry->isorec.name_len[0]; + + /* + * Add the Rock Ridge attributes, if present + */ + if(s_entry->rr_attr_size) + { + if(dir_index & 1) + { + directory_buffer[dir_index++] = 0; + } + + /* + * If the RR attributes were too long, then write the + * CE records, as required. + */ + if(s_entry->rr_attr_size != s_entry->total_rr_attr_size) + { + unsigned char * pnt; + int len, nbytes; + + /* + * Go through the entire record and fix up the CE entries + * so that the extent and offset are correct + */ + + pnt = s_entry->rr_attributes; + len = s_entry->total_rr_attr_size; + while(len > 3) + { +#ifdef DEBUG + if (!ce_size) + { + fprintf(stderr,"Warning: ce_index(%d) && ce_address(%d) not initialized\n", + ce_index, ce_address); + } +#endif + + if(pnt[0] == 'C' && pnt[1] == 'E') + { + nbytes = get_733( (char *) pnt+20); + + if((ce_index & (SECTOR_SIZE - 1)) + nbytes >= + SECTOR_SIZE) + { + ce_index = ROUND_UP(ce_index); + } + + set_733( (char *) pnt+4, + (ce_address + ce_index) >> 11); + set_733( (char *) pnt+12, + (ce_address + ce_index) & (SECTOR_SIZE - 1)); + + + /* + * Now store the block in the ce buffer + */ + memcpy(ce_buffer + ce_index, + pnt + pnt[2], nbytes); + ce_index += nbytes; + if(ce_index & 1) + { + ce_index++; + } + } + len -= pnt[2]; + pnt += pnt[2]; + } + + } + + rockridge_size += s_entry->total_rr_attr_size; + memcpy(directory_buffer + dir_index, s_entry->rr_attributes, + s_entry->rr_attr_size); + dir_index += s_entry->rr_attr_size; + } + if(dir_index & 1) + { + directory_buffer[dir_index++] = 0; + } + + s_entry_d = s_entry; + s_entry = s_entry->next; + + if (s_entry_d->rr_attributes) free(s_entry_d->rr_attributes); + if( s_entry_d->name != NULL ) + { + free (s_entry_d->name); + } + if( s_entry_d->whole_name != NULL ) + { + free (s_entry_d->whole_name); + } + free (s_entry_d); + } + sort_dir = NULL; + + if(dpnt->size != dir_index) + { + fprintf(stderr,"Unexpected directory length %d %d %s\n",dpnt->size, + dir_index, dpnt->de_name); + } + + xfwrite(directory_buffer, 1, total_size, outfile); + last_extent_written += total_size >> 11; + free(directory_buffer); + + if(ce_size) + { + if(ce_index != dpnt->ce_bytes) + { + fprintf(stderr,"Continuation entry record length mismatch (%d %d).\n", + ce_index, dpnt->ce_bytes); + } + xfwrite(ce_buffer, 1, ce_size, outfile); + last_extent_written += ce_size >> 11; + free(ce_buffer); + } + +} /* generate_one_directory(... */ + +static +void FDECL1(build_pathlist, struct directory *, node) +{ + struct directory * dpnt; + + dpnt = node; + + while (dpnt) + { + pathlist[dpnt->path_index] = dpnt; + if(dpnt->subdir) build_pathlist(dpnt->subdir); + dpnt = dpnt->next; + } +} /* build_pathlist(... */ + +int FDECL2(compare_paths, void const *, r, void const *, l) +{ + struct directory const *ll = *(struct directory * const *)l; + struct directory const *rr = *(struct directory * const *)r; + + if (rr->parent->path_index < ll->parent->path_index) + { + return -1; + } + + if (rr->parent->path_index > ll->parent->path_index) + { + return 1; + } + + return strcmp(rr->self->isorec.name, ll->self->isorec.name); + +} /* compare_paths(... */ + +void generate_path_tables() +{ + struct directory_entry * de; + struct directory * dpnt; + int fix; + int i; + int j; + int namelen; + char * npnt; + char * npnt1; + int tablesize; + + /* + * First allocate memory for the tables and initialize the memory + */ + tablesize = path_blocks << 11; + path_table_m = (char *) e_malloc(tablesize); + path_table_l = (char *) e_malloc(tablesize); + memset(path_table_l, 0, tablesize); + memset(path_table_m, 0, tablesize); + + /* + * Now start filling in the path tables. Start with root directory + */ + path_table_index = 0; + pathlist = (struct directory **) e_malloc(sizeof(struct directory *) + * next_path_index); + memset(pathlist, 0, sizeof(struct directory *) * next_path_index); + build_pathlist(root); + + do + { + fix = 0; + qsort(&pathlist[1], next_path_index-1, sizeof(struct directory *), + (int (*)(const void *, const void *))compare_paths); + + for(j=1; jpath_index != j) + { + pathlist[j]->path_index = j; + fix++; + } + } + } while(fix); + + for(j=1; jde_name; + + /* + * So the root comes out OK + */ + if( (*npnt == 0) || (dpnt == root) ) + { + npnt = "."; + } + npnt1 = strrchr(npnt, PATH_SEPARATOR); + if(npnt1) + { + npnt = npnt1 + 1; + } + + de = dpnt->self; + if(!de) + { + fprintf(stderr,"Fatal goof\n"); + exit(1); + } + + + namelen = de->isorec.name_len[0]; + + path_table_l[path_table_index] = namelen; + path_table_m[path_table_index] = namelen; + path_table_index += 2; + + set_731(path_table_l + path_table_index, dpnt->extent); + set_732(path_table_m + path_table_index, dpnt->extent); + path_table_index += 4; + + set_721(path_table_l + path_table_index, + dpnt->parent->path_index); + set_722(path_table_m + path_table_index, + dpnt->parent->path_index); + path_table_index += 2; + + for(i =0; iisorec.name[i]; + path_table_m[path_table_index] = de->isorec.name[i]; + path_table_index++; + } + if(path_table_index & 1) + { + path_table_index++; /* For odd lengths we pad */ + } + } + + free(pathlist); + if(path_table_index != path_table_size) + { + fprintf(stderr,"Path table lengths do not match %d %d\n", + path_table_index, + path_table_size); + } +} /* generate_path_tables(... */ + +void +FDECL3(memcpy_max, char *, to, char *, from, int, max) +{ + int n = strlen(from); + if (n > max) + { + n = max; + } + memcpy(to, from, n); + +} /* memcpy_max(... */ + +int FDECL1(iso_write, FILE *, outfile) +{ + char buffer[2048]; + int i; + char iso_time[17]; + int should_write; + + time(&begun); + assign_file_addresses(root); + + memset(buffer, 0, sizeof(buffer)); + + /* + * This will break in the year 2000, I supose, but there is no good way + * to get the top two digits of the year. + */ + sprintf(iso_time, "%4.4d%2.2d%2.2d%2.2d%2.2d%2.2d00", 1900 + local.tm_year, + local.tm_mon+1, local.tm_mday, + local.tm_hour, local.tm_min, local.tm_sec); + + local.tm_min -= gmt.tm_min; + local.tm_hour -= gmt.tm_hour; + local.tm_yday -= gmt.tm_yday; + iso_time[16] = (local.tm_min + 60*(local.tm_hour + 24*local.tm_yday)) / 15; + + /* + * First, we output 16 sectors of all zero + */ + + for(i=0; i<16; i++) + { + xfwrite(buffer, 1, sizeof(buffer), outfile); + } + + last_extent_written += 16; + + /* + * Next we write out the primary descriptor for the disc + */ + memset(&vol_desc, 0, sizeof(vol_desc)); + vol_desc.type[0] = ISO_VD_PRIMARY; + memcpy(vol_desc.id, ISO_STANDARD_ID, sizeof(ISO_STANDARD_ID)); + vol_desc.version[0] = 1; + + memset(vol_desc.system_id, ' ', sizeof(vol_desc.system_id)); + memcpy_max(vol_desc.system_id, system_id, strlen(system_id)); + + memset(vol_desc.volume_id, ' ', sizeof(vol_desc.volume_id)); + memcpy_max(vol_desc.volume_id, volume_id, strlen(volume_id)); + + should_write = last_extent - session_start; + set_733((char *) vol_desc.volume_space_size, should_write); + set_723(vol_desc.volume_set_size, 1); + set_723(vol_desc.volume_sequence_number, DEF_VSN); + set_723(vol_desc.logical_block_size, 2048); + + /* + * The path tables are used by DOS based machines to cache directory + * locations + */ + + set_733((char *) vol_desc.path_table_size, path_table_size); + set_731(vol_desc.type_l_path_table, path_table[0]); + set_731(vol_desc.opt_type_l_path_table, path_table[1]); + set_732(vol_desc.type_m_path_table, path_table[2]); + set_732(vol_desc.opt_type_m_path_table, path_table[3]); + + /* + * Now we copy the actual root directory record + */ + memcpy(vol_desc.root_directory_record, &root_record, + sizeof(struct iso_directory_record) + 1); + + /* + * The rest is just fluff. It looks nice to fill in many of these fields, + * though. + */ + FILL_SPACE(volume_set_id); + if(volset_id) memcpy_max(vol_desc.volume_set_id, volset_id, strlen(volset_id)); + + FILL_SPACE(publisher_id); + if(publisher) memcpy_max(vol_desc.publisher_id, publisher, strlen(publisher)); + + FILL_SPACE(preparer_id); + if(preparer) memcpy_max(vol_desc.preparer_id, preparer, strlen(preparer)); + + FILL_SPACE(application_id); + if(appid) memcpy_max(vol_desc.application_id, appid, strlen(appid)); + + FILL_SPACE(copyright_file_id); + if(copyright) memcpy_max(vol_desc.copyright_file_id, copyright, + strlen(copyright)); + + FILL_SPACE(abstract_file_id); + if(abstract) memcpy_max(vol_desc.abstract_file_id, abstract, + strlen(abstract)); + + FILL_SPACE(bibliographic_file_id); + if(biblio) memcpy_max(vol_desc.bibliographic_file_id, biblio, + strlen(biblio)); + + FILL_SPACE(creation_date); + FILL_SPACE(modification_date); + FILL_SPACE(expiration_date); + FILL_SPACE(effective_date); + vol_desc.file_structure_version[0] = 1; + FILL_SPACE(application_data); + + memcpy(vol_desc.creation_date, iso_time, 17); + memcpy(vol_desc.modification_date, iso_time, 17); + memcpy(vol_desc.expiration_date, "0000000000000000", 17); + memcpy(vol_desc.effective_date, iso_time, 17); + + /* + * if not a bootable cd do it the old way + */ + xfwrite(&vol_desc, 1, 2048, outfile); + last_extent_written++; + if (use_eltorito) + { + /* + * Next we write out the boot volume descriptor for the disc + */ + get_torito_desc(&boot_desc); + xfwrite(&boot_desc, 1, 2048, outfile); + last_extent_written ++; + } + + /* + * Now write the end volume descriptor. Much simpler than the other one + */ + memset(&vol_desc, 0, sizeof(vol_desc)); + vol_desc.type[0] = ISO_VD_END; + memcpy(vol_desc.id, ISO_STANDARD_ID, sizeof(ISO_STANDARD_ID)); + vol_desc.version[0] = 1; + xfwrite(&vol_desc, 1, 2048, outfile); + last_extent_written += 1; + + /* + * Next we write the path tables + */ + xfwrite(path_table_l, 1, path_blocks << 11, outfile); + xfwrite(path_table_m, 1, path_blocks << 11, outfile); + last_extent_written += 2*path_blocks; + free(path_table_l); + free(path_table_m); + path_table_l = NULL; + path_table_m = NULL; + + /* + * OK, all done with that crap. Now write out the directories. + * This is where the fur starts to fly, because we need to keep track of + * each file as we find it and keep track of where we put it. + */ + +#ifdef DBG_ISO + fprintf(stderr,"Total directory extents being written = %d\n", last_extent); +#endif +#if 0 + generate_one_directory(root, outfile); +#endif + generate_iso9660_directories(root, outfile); + + if(extension_record) + { + xfwrite(extension_record, 1, SECTOR_SIZE, outfile); + last_extent_written++; + } + + /* + * Now write all of the files that we need. + */ + fprintf(stderr,"Total extents scheduled to be written = %d\n", + last_extent - session_start); + write_files(outfile); + + fprintf(stderr,"Total extents actually written = %d\n", + last_extent_written - session_start); + /* + * Hard links throw us off here + */ + if(should_write != last_extent - session_start) + { + fprintf(stderr,"Number of extents written not what was predicted. Please fix.\n"); + fprintf(stderr,"Predicted = %d, written = %d\n", should_write, last_extent); + } + + fprintf(stderr,"Total translation table size: %d\n", table_size); + fprintf(stderr,"Total rockridge attributes bytes: %d\n", rockridge_size); + fprintf(stderr,"Total directory bytes: %d\n", total_dir_size); + fprintf(stderr,"Path table size(bytes): %d\n", path_table_size); + +#ifdef DEBUG + fprintf(stderr, "next extent, last_extent, last_extent_written %d %d %d\n", + next_extent, last_extent, last_extent_written); +#endif + + return 0; + +} /* iso_write(... */ From 63eb2d63b134cc5877bab10a6c4cacc2ae738be4 Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 22:51:41 +0000 Subject: [PATCH 1244/1707] Import http://www.tux.org/pub/people/eric-youngdale/mkisofs/mkisofs-1.12b4.tar.gz --- util/mkisofs/defaults.h | 12 +- util/mkisofs/eltorito.c | 42 +- util/mkisofs/getopt.c | 760 +++++++++++++++++++ util/mkisofs/getopt1.c | 190 +++++ util/mkisofs/hash.c | 5 +- util/mkisofs/iso9660.h | 9 +- util/mkisofs/joliet.c | 972 ++++++++++++++++++++++++ util/mkisofs/mkisofs.c | 652 ++++++++++++++-- util/mkisofs/mkisofs.h | 154 +++- util/mkisofs/multi.c | 137 +++- util/mkisofs/name.c | 24 +- util/mkisofs/rock.c | 51 +- util/mkisofs/tree.c | 1571 +++++++++++++++++++++++++-------------- util/mkisofs/write.c | 503 +++++++++---- 14 files changed, 4270 insertions(+), 812 deletions(-) create mode 100644 util/mkisofs/getopt.c create mode 100644 util/mkisofs/getopt1.c create mode 100644 util/mkisofs/joliet.c diff --git a/util/mkisofs/defaults.h b/util/mkisofs/defaults.h index 91e678992..9e8f3331a 100644 --- a/util/mkisofs/defaults.h +++ b/util/mkisofs/defaults.h @@ -2,7 +2,7 @@ * Header file defaults.h - assorted default values for character strings in * the volume descriptor. * - * $Id: defaults.h,v 1.4 1997/04/10 03:31:53 eric Rel $ + * $Id: defaults.h,v 1.6 1998/06/02 02:40:37 eric Exp $ */ #define PREPARER_DEFAULT NULL @@ -24,7 +24,11 @@ #endif #ifdef __sun -#define SYSTEM_ID_DEFAULT "Solaris" +#ifdef __svr4__ +#define SYSTEM_ID_DEFAULT "Solaris" +#else +#define SYSTEM_ID_DEFAULT "SunOS" +#endif #endif #ifdef __hpux @@ -39,6 +43,10 @@ #define SYSTEM_ID_DEFAULT "AIX" #endif +#ifdef _WIN +#define SYSTEM_ID_DEFAULT "Win32" +#endif /* _WIN */ + #ifndef SYSTEM_ID_DEFAULT #define SYSTEM_ID_DEFAULT "LINUX" #endif diff --git a/util/mkisofs/eltorito.c b/util/mkisofs/eltorito.c index 0ac5a1290..3ff50e92e 100644 --- a/util/mkisofs/eltorito.c +++ b/util/mkisofs/eltorito.c @@ -21,7 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: eltorito.c,v 1.7 1997/05/17 15:44:31 eric Exp $"; +static char rcsid[] ="$Id: eltorito.c,v 1.12 1998/06/02 02:40:37 eric Exp $"; #include #include @@ -30,14 +30,22 @@ static char rcsid[] ="$Id: eltorito.c,v 1.7 1997/05/17 15:44:31 eric Exp $"; #include #include +#include "config.h" #include "mkisofs.h" #include "iso9660.h" +/* used by Win32 for opening binary file - not used by Unix */ +#ifndef O_BINARY +#define O_BINARY 0 +#endif /* O_BINARY */ + #undef MIN #define MIN(a, b) (((a) < (b))? (a): (b)) static struct eltorito_validation_entry valid_desc; static struct eltorito_defaultboot_entry default_desc; +static struct eltorito_boot_descriptor boot_desc; + /* * Check for presence of boot catalog. If it does not exist then make it @@ -63,7 +71,7 @@ void FDECL1(init_boot_catalog, const char *, path) * check for the file existing */ #ifdef DEBUG_TORITO - printf("Looking for boot catalog file %s\n",bootpath); + fprintf(stderr,"Looking for boot catalog file %s\n",bootpath); #endif if (!stat_filter(bootpath, &statbuf)) @@ -93,7 +101,7 @@ void FDECL1(init_boot_catalog, const char *, path) * file does not exist, so we create it * make it one CD sector long */ - bcat = open(bootpath, O_WRONLY | O_CREAT, S_IROTH | S_IRGRP | S_IRWXU ); + bcat = open(bootpath, O_WRONLY | O_CREAT | O_BINARY, S_IROTH | S_IRGRP | S_IRWXU ); if (bcat == -1) { fprintf(stderr, "Error creating boot catalog, exiting...\n"); @@ -207,7 +215,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc) * assume 512 bytes/sector on a bootable floppy */ nsectors = ((de->size + 511) & ~(511))/512; - printf("\nSize of boot image is %d sectors -> ", nsectors); + fprintf(stderr, "\nSize of boot image is %d sectors -> ", nsectors); /* * choose size of emulated floppy based on boot image size @@ -215,17 +223,17 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc) if (nsectors == 2880 ) { default_desc.boot_media[0] = EL_TORITO_MEDIA_144FLOP; - printf("Emulating a 1.44 meg floppy\n"); + fprintf(stderr, "Emulating a 1.44 meg floppy\n"); } else if (nsectors == 5760 ) { default_desc.boot_media[0] = EL_TORITO_MEDIA_288FLOP; - printf("Emulating a 2.88 meg floppy\n"); + fprintf(stderr,"Emulating a 2.88 meg floppy\n"); } else if (nsectors == 2400 ) { default_desc.boot_media[0] = EL_TORITO_MEDIA_12FLOP; - printf("Emulating a 1.2 meg floppy\n"); + fprintf(stderr,"Emulating a 1.2 meg floppy\n"); } else { @@ -240,7 +248,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc) nsectors = 1; set_721(default_desc.nsect, (unsigned int) nsectors ); #ifdef DEBUG_TORITO - printf("Extent of boot images is %d\n",get_733(de->isorec.extent)); + fprintf(stderr,"Extent of boot images is %d\n",get_733(de->isorec.extent)); #endif set_731(default_desc.bootoff, (unsigned int) get_733(de->isorec.extent)); @@ -248,7 +256,7 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc) /* * now write it to disk */ - bootcat = open(de2->whole_name, O_RDWR); + bootcat = open(de2->whole_name, O_RDWR | O_BINARY); if (bootcat == -1) { fprintf(stderr,"Error opening boot catalog for update.\n"); @@ -263,3 +271,19 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc) write(bootcat, &default_desc, 32); close(bootcat); } /* get_torito_desc(... */ + +/* + * Function to write the EVD for the disc. + */ +int FDECL1(tvd_write, FILE *, outfile) +{ + /* + * Next we write out the boot volume descriptor for the disc + */ + get_torito_desc(&boot_desc); + xfwrite(&boot_desc, 1, 2048, outfile); + last_extent_written ++; + return 0; +} + +struct output_fragment torito_desc = {NULL, oneblock_size, NULL, tvd_write}; diff --git a/util/mkisofs/getopt.c b/util/mkisofs/getopt.c new file mode 100644 index 000000000..79080aa54 --- /dev/null +++ b/util/mkisofs/getopt.c @@ -0,0 +1,760 @@ +/* Getopt for GNU. + NOTE: getopt is now part of the C library, so if you don't know what + "Keep this file name-space clean" means, talk to roland@gnu.ai.mit.edu + before changing it! + + Copyright (C) 1987, 88, 89, 90, 91, 92, 93, 94, 95 + Free Software Foundation, Inc. + +This file is part of the libiberty library. This library is free +software; you can redistribute it and/or modify it under the +terms of the GNU General Public License as published by the +Free Software Foundation; either version 2, or (at your option) +any later version. + +This library is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU CC; see the file COPYING. If not, write to +the Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +As a special exception, if you link this library with files +compiled with a GNU compiler to produce an executable, this does not cause +the resulting executable to be covered by the GNU General Public License. +This exception does not however invalidate any other reasons why +the executable file might be covered by the GNU General Public License. */ + +/* This tells Alpha OSF/1 not to define a getopt prototype in . + Ditto for AIX 3.2 and . */ +#ifndef _NO_PROTO +#define _NO_PROTO +#endif + +#ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif + +#ifndef __STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ +/* Many versions of the Linux C library include older, broken versions + of these routines, which will break the linker's command-line + parsing. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +/* Don't include stdlib.h for non-GNU C libraries because some of them + contain conflicting prototypes for getopt. */ +#include +#endif /* GNU C library. */ + +/* This version of `getopt' appears to the caller like standard Unix `getopt' + but it behaves differently for the user, since it allows the user + to intersperse the options with the other arguments. + + As `getopt' works, it permutes the elements of ARGV so that, + when it is done, all the options precede everything else. Thus + all application programs are extended to handle flexible argument order. + + Setting the environment variable POSIXLY_CORRECT disables permutation. + Then the behavior is completely standard. + + GNU application programs can use a third alternative mode in which + they can distinguish the relative order of options and other arguments. */ + +#include "getopt.h" + +/* For communication from `getopt' to the caller. + When `getopt' finds an option that takes an argument, + the argument value is returned here. + Also, when `ordering' is RETURN_IN_ORDER, + each non-option ARGV-element is returned here. */ + +char *optarg = NULL; + +/* Index in ARGV of the next element to be scanned. + This is used for communication to and from the caller + and for communication between successive calls to `getopt'. + + On entry to `getopt', zero means this is the first call; initialize. + + When `getopt' returns EOF, this is the index of the first of the + non-option elements that the caller should itself scan. + + Otherwise, `optind' communicates from one call to the next + how much of ARGV has been scanned so far. */ + +/* XXX 1003.2 says this must be 1 before any call. */ +int optind = 0; + +/* The next char to be scanned in the option-element + in which the last option character we returned was found. + This allows us to pick up the scan where we left off. + + If this is zero, or a null string, it means resume the scan + by advancing to the next ARGV-element. */ + +static char *nextchar; + +/* Callers store zero here to inhibit the error message + for unrecognized options. */ + +int opterr = 1; + +/* Set to an option character which was unrecognized. + This must be initialized on some systems to avoid linking in the + system's own getopt implementation. */ + +int optopt = '?'; + +/* Describe how to deal with options that follow non-option ARGV-elements. + + If the caller did not specify anything, + the default is REQUIRE_ORDER if the environment variable + POSIXLY_CORRECT is defined, PERMUTE otherwise. + + REQUIRE_ORDER means don't recognize them as options; + stop option processing when the first non-option is seen. + This is what Unix does. + This mode of operation is selected by either setting the environment + variable POSIXLY_CORRECT, or using `+' as the first character + of the list of option characters. + + PERMUTE is the default. We permute the contents of ARGV as we scan, + so that eventually all the non-options are at the end. This allows options + to be given in any order, even with programs that were not written to + expect this. + + RETURN_IN_ORDER is an option available to programs that were written + to expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. + Using `-' as the first character of the list of option characters + selects this mode of operation. + + The special argument `--' forces an end of option-scanning regardless + of the value of `ordering'. In the case of RETURN_IN_ORDER, only + `--' can cause `getopt' to return EOF with `optind' != ARGC. */ + +static enum +{ + REQUIRE_ORDER, PERMUTE, RETURN_IN_ORDER +} ordering; + +#ifdef __GNU_LIBRARY__ +/* We want to avoid inclusion of string.h with non-GNU libraries + because there are many ways it can cause trouble. + On some systems, it contains special magic macros that don't work + in GCC. */ +#include +#define my_index strchr +#else + +/* Avoid depending on library functions or files + whose names are inconsistent. */ + +char *getenv (); + +static char * +my_index (str, chr) + const char *str; + int chr; +{ + while (*str) + { + if (*str == chr) + return (char *) str; + str++; + } + return 0; +} + +/* If using GCC, we can safely declare strlen this way. + If not using GCC, it is ok not to declare it. */ +#ifdef __GNUC__ +/* Note that Motorola Delta 68k R3V7 comes with GCC but not stddef.h. + That was relevant to code that was here before. */ +#ifndef __STDC__ +/* gcc with -traditional declares the built-in strlen to return int, + and has done so at least since version 2.4.5. -- rms. */ +extern int strlen (const char *); +#endif /* not __STDC__ */ +#endif /* __GNUC__ */ + +#endif /* not __GNU_LIBRARY__ */ + +/* Handle permutation of arguments. */ + +/* Describe the part of ARGV that contains non-options that have + been skipped. `first_nonopt' is the index in ARGV of the first of them; + `last_nonopt' is the index after the last of them. */ + +static int first_nonopt; +static int last_nonopt; + +/* Exchange two adjacent subsequences of ARGV. + One subsequence is elements [first_nonopt,last_nonopt) + which contains all the non-options that have been skipped so far. + The other is elements [last_nonopt,optind), which contains all + the options processed since those non-options were skipped. + + `first_nonopt' and `last_nonopt' are relocated so that they describe + the new indices of the non-options in ARGV after they are moved. */ + +static void +exchange (argv) + char **argv; +{ + int bottom = first_nonopt; + int middle = last_nonopt; + int top = optind; + char *tem; + + /* Exchange the shorter segment with the far end of the longer segment. + That puts the shorter segment into the right place. + It leaves the longer segment in the right place overall, + but it consists of two parts that need to be swapped next. */ + + while (top > middle && middle > bottom) + { + if (top - middle > middle - bottom) + { + /* Bottom segment is the short one. */ + int len = middle - bottom; + register int i; + + /* Swap it with the top part of the top segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[top - (middle - bottom) + i]; + argv[top - (middle - bottom) + i] = tem; + } + /* Exclude the moved bottom segment from further swapping. */ + top -= len; + } + else + { + /* Top segment is the short one. */ + int len = top - middle; + register int i; + + /* Swap it with the bottom part of the bottom segment. */ + for (i = 0; i < len; i++) + { + tem = argv[bottom + i]; + argv[bottom + i] = argv[middle + i]; + argv[middle + i] = tem; + } + /* Exclude the moved top segment from further swapping. */ + bottom += len; + } + } + + /* Update records for the slots the non-options now occupy. */ + + first_nonopt += (optind - last_nonopt); + last_nonopt = optind; +} + +/* Initialize the internal data when the first call is made. */ + +static const char * +_getopt_initialize (optstring) + const char *optstring; +{ + /* Start processing options with ARGV-element 1 (since ARGV-element 0 + is the program name); the sequence of previously skipped + non-option ARGV-elements is empty. */ + + first_nonopt = last_nonopt = optind = 1; + + nextchar = NULL; + + /* Determine how to handle the ordering of options and nonoptions. */ + + if (optstring[0] == '-') + { + ordering = RETURN_IN_ORDER; + ++optstring; + } + else if (optstring[0] == '+') + { + ordering = REQUIRE_ORDER; + ++optstring; + } + else if (getenv ("POSIXLY_CORRECT") != NULL) + ordering = REQUIRE_ORDER; + else + ordering = PERMUTE; + + return optstring; +} + +/* Scan elements of ARGV (whose length is ARGC) for option characters + given in OPTSTRING. + + If an element of ARGV starts with '-', and is not exactly "-" or "--", + then it is an option element. The characters of this element + (aside from the initial '-') are option characters. If `getopt' + is called repeatedly, it returns successively each of the option characters + from each of the option elements. + + If `getopt' finds another option character, it returns that character, + updating `optind' and `nextchar' so that the next call to `getopt' can + resume the scan with the following option character or ARGV-element. + + If there are no more option characters, `getopt' returns `EOF'. + Then `optind' is the index in ARGV of the first ARGV-element + that is not an option. (The ARGV-elements have been permuted + so that those that are not options now come last.) + + OPTSTRING is a string containing the legitimate option characters. + If an option character is seen that is not listed in OPTSTRING, + return '?' after printing an error message. If you set `opterr' to + zero, the error message is suppressed but we still return '?'. + + If a char in OPTSTRING is followed by a colon, that means it wants an arg, + so the following text in the same ARGV-element, or the text of the following + ARGV-element, is returned in `optarg'. Two colons mean an option that + wants an optional arg; if there is text in the current ARGV-element, + it is returned in `optarg', otherwise `optarg' is set to zero. + + If OPTSTRING starts with `-' or `+', it requests different methods of + handling the non-option ARGV-elements. + See the comments about RETURN_IN_ORDER and REQUIRE_ORDER, above. + + Long-named options begin with `--' instead of `-'. + Their names may be abbreviated as long as the abbreviation is unique + or is an exact match for some defined option. If they have an + argument, it follows the option name in the same ARGV-element, separated + from the option name by a `=', or else the in next ARGV-element. + When `getopt' finds a long-named option, it returns 0 if that option's + `flag' field is nonzero, the value of the option's `val' field + if the `flag' field is zero. + + The elements of ARGV aren't really const, because we permute them. + But we pretend they're const in the prototype to be compatible + with other systems. + + LONGOPTS is a vector of `struct option' terminated by an + element containing a name which is zero. + + LONGIND returns the index in LONGOPT of the long-named option found. + It is only valid when a long-named option has been found by the most + recent call. + + If LONG_ONLY is nonzero, '-' as well as '--' can introduce + long-named options. */ + +int +_getopt_internal (argc, argv, optstring, longopts, longind, long_only) + int argc; + char *const *argv; + const char *optstring; + const struct option *longopts; + int *longind; + int long_only; +{ + optarg = NULL; + + if (optind == 0) + optstring = _getopt_initialize (optstring); + + if (argc == 0) + return EOF; + + if (nextchar == NULL || *nextchar == '\0') + { + /* Advance to the next ARGV-element. */ + + if (ordering == PERMUTE) + { + /* If we have just processed some options following some non-options, + exchange them so that the options come first. */ + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (last_nonopt != optind) + first_nonopt = optind; + + /* Skip any additional non-options + and extend the range of non-options previously skipped. */ + + while (optind < argc + && (argv[optind][0] != '-' || argv[optind][1] == '\0')) + optind++; + last_nonopt = optind; + } + + /* The special ARGV-element `--' means premature end of options. + Skip it like a null option, + then exchange with previous non-options as if it were an option, + then skip everything else like a non-option. */ + + if (optind != argc && !strcmp (argv[optind], "--")) + { + optind++; + + if (first_nonopt != last_nonopt && last_nonopt != optind) + exchange ((char **) argv); + else if (first_nonopt == last_nonopt) + first_nonopt = optind; + last_nonopt = argc; + + optind = argc; + } + + /* If we have done all the ARGV-elements, stop the scan + and back over any non-options that we skipped and permuted. */ + + if (optind == argc) + { + /* Set the next-arg-index to point at the non-options + that we previously skipped, so the caller will digest them. */ + if (first_nonopt != last_nonopt) + optind = first_nonopt; + return EOF; + } + + /* If we have come to a non-option and did not permute it, + either stop the scan or describe it to the caller and pass it by. */ + + if ((argv[optind][0] != '-' || argv[optind][1] == '\0')) + { + if (ordering == REQUIRE_ORDER) + return EOF; + optarg = argv[optind++]; + return 1; + } + + /* We have found another option-ARGV-element. + Skip the initial punctuation. */ + + nextchar = (argv[optind] + 1 + + (longopts != NULL && argv[optind][1] == '-')); + } + + /* Decode the current option-ARGV-element. */ + + /* Check whether the ARGV-element is a long option. + + If long_only and the ARGV-element has the form "-f", where f is + a valid short option, don't consider it an abbreviated form of + a long option that starts with f. Otherwise there would be no + way to give the -f short option. + + On the other hand, if there's a long option "fubar" and + the ARGV-element is "-fu", do consider that an abbreviation of + the long option, just like "--fu", and not "-f" with arg "u". + + This distinction seems to be the most useful approach. */ + + if (longopts != NULL + && (argv[optind][1] == '-' + || (long_only && (argv[optind][2] || !my_index (optstring, argv[optind][1]))))) + { + char *nameend; + const struct option *p; + const struct option *pfound = NULL; + int exact = 0; + int ambig = 0; + int indfound; + int option_index; + + for (nameend = nextchar; *nameend && *nameend != '='; nameend++) + /* Do nothing. */ ; + + /* Test all long options for either exact match + or abbreviated matches. */ + for (p = longopts, option_index = 0; p->name; p++, option_index++) + if (!strncmp (p->name, nextchar, nameend - nextchar)) + { + if (nameend - nextchar == strlen (p->name)) + { + /* Exact match found. */ + pfound = p; + indfound = option_index; + exact = 1; + break; + } + else if (pfound == NULL) + { + /* First nonexact match found. */ + pfound = p; + indfound = option_index; + } + else + /* Second or later nonexact match found. */ + ambig = 1; + } + + if (ambig && !exact) + { + if (opterr) + fprintf (stderr, "%s: option `%s' is ambiguous\n", + argv[0], argv[optind]); + nextchar += strlen (nextchar); + optind++; + return '?'; + } + + if (pfound != NULL) + { + option_index = indfound; + optind++; + if (*nameend) + { + /* Don't test has_arg with >, because some C compilers don't + allow it to be used on enums. */ + if (pfound->has_arg) + optarg = nameend + 1; + else + { + if (opterr) + { + if (argv[optind - 1][1] == '-') + /* --option */ + fprintf (stderr, + "%s: option `--%s' doesn't allow an argument\n", + argv[0], pfound->name); + else + /* +option or -option */ + fprintf (stderr, + "%s: option `%c%s' doesn't allow an argument\n", + argv[0], argv[optind - 1][0], pfound->name); + } + nextchar += strlen (nextchar); + return '?'; + } + } + else if (pfound->has_arg == 1) + { + if (optind < argc) + optarg = argv[optind++]; + else + { + if (opterr) + fprintf (stderr, "%s: option `%s' requires an argument\n", + argv[0], argv[optind - 1]); + nextchar += strlen (nextchar); + return optstring[0] == ':' ? ':' : '?'; + } + } + nextchar += strlen (nextchar); + if (longind != NULL) + *longind = option_index; + if (pfound->flag) + { + *(pfound->flag) = pfound->val; + return 0; + } + return pfound->val; + } + + /* Can't find it as a long option. If this is not getopt_long_only, + or the option starts with '--' or is not a valid short + option, then it's an error. + Otherwise interpret it as a short option. */ + if (!long_only || argv[optind][1] == '-' + || my_index (optstring, *nextchar) == NULL) + { + if (opterr) + { + if (argv[optind][1] == '-') + /* --option */ + fprintf (stderr, "%s: unrecognized option `--%s'\n", + argv[0], nextchar); + else + /* +option or -option */ + fprintf (stderr, "%s: unrecognized option `%c%s'\n", + argv[0], argv[optind][0], nextchar); + } + nextchar = (char *) ""; + optind++; + return '?'; + } + } + + /* Look at and handle the next short option-character. */ + + { + char c = *nextchar++; + char *temp = my_index (optstring, c); + + /* Increment `optind' when we start to process its last character. */ + if (*nextchar == '\0') + ++optind; + + if (temp == NULL || c == ':') + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: illegal option -- %c\n", argv[0], c); + } + optopt = c; + return '?'; + } + if (temp[1] == ':') + { + if (temp[2] == ':') + { + /* This is an option that accepts an argument optionally. */ + if (*nextchar != '\0') + { + optarg = nextchar; + optind++; + } + else + optarg = NULL; + nextchar = NULL; + } + else + { + /* This is an option that requires an argument. */ + if (*nextchar != '\0') + { + optarg = nextchar; + /* If we end this ARGV-element by taking the rest as an arg, + we must advance to the next element now. */ + optind++; + } + else if (optind == argc) + { + if (opterr) + { + /* 1003.2 specifies the format of this message. */ + fprintf (stderr, "%s: option requires an argument -- %c\n", + argv[0], c); + } + optopt = c; + if (optstring[0] == ':') + c = ':'; + else + c = '?'; + } + else + /* We already incremented `optind' once; + increment it again when taking next ARGV-elt as argument. */ + optarg = argv[optind++]; + nextchar = NULL; + } + } + return c; + } +} + +int +getopt (argc, argv, optstring) + int argc; + char *const *argv; + const char *optstring; +{ + return _getopt_internal (argc, argv, optstring, + (const struct option *) 0, + (int *) 0, + 0); +} + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +/* Compile with -DTEST to make an executable for use in testing + the above definition of `getopt'. */ + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + + c = getopt (argc, argv, "abc:d:0123456789"); + if (c == EOF) + break; + + switch (c) + { + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/util/mkisofs/getopt1.c b/util/mkisofs/getopt1.c new file mode 100644 index 000000000..c3400e5b6 --- /dev/null +++ b/util/mkisofs/getopt1.c @@ -0,0 +1,190 @@ +/* getopt_long and getopt_long_only entry points for GNU getopt. + Copyright (C) 1987, 88, 89, 90, 91, 92, 1993 + Free Software Foundation, Inc. + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU Library General Public License + as published by the Free Software Foundation; either version 2, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Library General Public License for more details. + + You should have received a copy of the GNU Library General Public License + along with this program; if not, write to the Free Software + Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + +#ifdef HAVE_CONFIG_H +#if defined (emacs) || defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#endif + +#include "getopt.h" + +#ifndef __STDC__ +/* This is a separate conditional since some stdc systems + reject `defined (const)'. */ +#ifndef const +#define const +#endif +#endif + +#include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ +/* Many versions of the Linux C library include older, broken versions + of these routines, which will break the linker's command-line + parsing. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) || defined (__linux__) + + +/* This needs to come after some library #include + to get __GNU_LIBRARY__ defined. */ +#ifdef __GNU_LIBRARY__ +#include +#else +char *getenv (); +#endif + +#ifndef NULL +#define NULL 0 +#endif + +int +getopt_long (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 0); +} + +/* Like getopt_long, but '-' as well as '--' can indicate a long option. + If an option that starts with '-' (not '--') doesn't match a long option, + but does match a short option, it is parsed as a short option + instead. */ + +int +getopt_long_only (argc, argv, options, long_options, opt_index) + int argc; + char *const *argv; + const char *options; + const struct option *long_options; + int *opt_index; +{ + return _getopt_internal (argc, argv, options, long_options, opt_index, 1); +} + + +#endif /* _LIBC or not __GNU_LIBRARY__. */ + +#ifdef TEST + +#include + +int +main (argc, argv) + int argc; + char **argv; +{ + int c; + int digit_optind = 0; + + while (1) + { + int this_option_optind = optind ? optind : 1; + int option_index = 0; + static struct option long_options[] = + { + {"add", 1, 0, 0}, + {"append", 0, 0, 0}, + {"delete", 1, 0, 0}, + {"verbose", 0, 0, 0}, + {"create", 0, 0, 0}, + {"file", 1, 0, 0}, + {0, 0, 0, 0} + }; + + c = getopt_long (argc, argv, "abc:d:0123456789", + long_options, &option_index); + if (c == EOF) + break; + + switch (c) + { + case 0: + printf ("option %s", long_options[option_index].name); + if (optarg) + printf (" with arg %s", optarg); + printf ("\n"); + break; + + case '0': + case '1': + case '2': + case '3': + case '4': + case '5': + case '6': + case '7': + case '8': + case '9': + if (digit_optind != 0 && digit_optind != this_option_optind) + printf ("digits occur in two different argv-elements.\n"); + digit_optind = this_option_optind; + printf ("option %c\n", c); + break; + + case 'a': + printf ("option a\n"); + break; + + case 'b': + printf ("option b\n"); + break; + + case 'c': + printf ("option c with value `%s'\n", optarg); + break; + + case 'd': + printf ("option d with value `%s'\n", optarg); + break; + + case '?': + break; + + default: + printf ("?? getopt returned character code 0%o ??\n", c); + } + } + + if (optind < argc) + { + printf ("non-option ARGV-elements: "); + while (optind < argc) + printf ("%s ", argv[optind++]); + printf ("\n"); + } + + exit (0); +} + +#endif /* TEST */ diff --git a/util/mkisofs/hash.c b/util/mkisofs/hash.c index 67098d580..eb673393e 100644 --- a/util/mkisofs/hash.c +++ b/util/mkisofs/hash.c @@ -19,9 +19,10 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: hash.c,v 1.2 1997/02/23 16:11:15 eric Rel $"; +static char rcsid[] ="$Id: hash.c,v 1.4 1997/12/06 21:05:04 eric Exp $"; #include +#include "config.h" #include "mkisofs.h" #define NR_HASH 1024 @@ -44,7 +45,7 @@ void FDECL1(add_hash, struct directory_entry *, spnt){ hash_number = HASH_FN((unsigned int) spnt->dev, (unsigned int) spnt->inode); #if 0 - if (verbose) fprintf(stderr,"%s ",spnt->name); + if (verbose > 1) fprintf(stderr,"%s ",spnt->name); #endif s_hash = (struct file_hash *) e_malloc(sizeof(struct file_hash)); s_hash->next = hash_table[hash_number]; diff --git a/util/mkisofs/iso9660.h b/util/mkisofs/iso9660.h index a58f96f0d..65320121d 100644 --- a/util/mkisofs/iso9660.h +++ b/util/mkisofs/iso9660.h @@ -21,7 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* - * $Id: iso9660.h,v 1.1 1997/02/23 15:55:25 eric Rel $ + * $Id: iso9660.h,v 1.2 1997/05/17 15:46:44 eric Exp $ */ #ifndef _ISOFS_FS_H @@ -42,8 +42,9 @@ struct iso_volume_descriptor { }; /* volume descriptor types */ -#define ISO_VD_PRIMARY 1 -#define ISO_VD_END 255 +#define ISO_VD_PRIMARY 1 +#define ISO_VD_SUPPLEMENTARY 2 /* Used by Joliet */ +#define ISO_VD_END 255 #define ISO_STANDARD_ID "CD001" @@ -67,7 +68,7 @@ struct iso_primary_descriptor { char volume_id [ISODCL ( 41, 72)]; /* dchars */ char unused2 [ISODCL ( 73, 80)]; char volume_space_size [ISODCL ( 81, 88)]; /* 733 */ - char unused3 [ISODCL ( 89, 120)]; + char escape_sequences [ISODCL ( 89, 120)]; char volume_set_size [ISODCL (121, 124)]; /* 723 */ char volume_sequence_number [ISODCL (125, 128)]; /* 723 */ char logical_block_size [ISODCL (129, 132)]; /* 723 */ diff --git a/util/mkisofs/joliet.c b/util/mkisofs/joliet.c new file mode 100644 index 000000000..d3e8cb0e3 --- /dev/null +++ b/util/mkisofs/joliet.c @@ -0,0 +1,972 @@ +/* + * File joliet.c - handle Win95/WinNT long file/unicode extensions for iso9660. + + Copyright 1997 Eric Youngdale. + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ + +static char rcsid[] ="$Id: joliet.c,v 1.12 1998/06/02 02:40:37 eric Exp $"; + + +/* + * Joliet extensions for ISO9660. These are spottily documented by + * Microsoft. In their infinite stupidity, they completely ignored + * the possibility of using an SUSP record with the long filename + * in it, and instead wrote out a duplicate directory tree with the + * long filenames in it. + * + * I am not sure why they did this. One reason is that they get the path + * tables with the long filenames in them. + * + * There are two basic principles to Joliet, and the non-Unicode variant + * known as Romeo. Long filenames seem to be the main one, and the second + * is that the character set and a few other things is substantially relaxed. + * + * The SVD is identical to the PVD, except: + * + * Id is 2, not 1 (indicates SVD). + * escape_sequences contains UCS-2 indicator (levels 1, 2 or 3). + * The root directory record points to a different extent (with different + * size). + * There are different path tables for the two sets of directory trees. + * + * The following fields are recorded in Unicode: + * system_id + * volume_id + * volume_set_id + * publisher_id + * preparer_id + * application_id + * copyright_file_id + * abstract_file_id + * bibliographic_file_id + * + * Unicode strings are always encoded in big-endian format. + * + * In a directory record, everything is the same as with iso9660, except + * that the name is recorded in unicode. The name length is specified in + * total bytes, not in number of unicode characters. + * + * The character set used for the names is different with UCS - the + * restrictions are that the following are not allowed: + * + * Characters (00)(00) through (00)(1f) (control chars) + * (00)(2a) '*' + * (00)(2f) '/' + * (00)(3a) ':' + * (00)(3b) ';' + * (00)(3f) '?' + * (00)(5c) '\' + */ +#include "config.h" +#include "mkisofs.h" +#include "iso9660.h" + +#include +#include + +static jpath_table_index; +static struct directory ** jpathlist; +static next_jpath_index = 1; +static int sort_goof; + +static int DECL(joliet_sort_directory, (struct directory_entry ** sort_dir)); +static void DECL(assign_joliet_directory_addresses, (struct directory * node)); + +/* + * Function: convert_to_unicode + * + * Purpose: Perform a 1/2 assed unicode conversion on a text + * string. + * + * Notes: + */ +static void FDECL3(convert_to_unicode, unsigned char *, buffer, int, size, char *, source ) +{ + unsigned char * tmpbuf; + int i; + int j; + + /* + * If we get a NULL pointer for the source, it means we have an inplace + * copy, and we need to make a temporary working copy first. + */ + if( source == NULL ) + { + tmpbuf = (u_char *) e_malloc(size); + memcpy( tmpbuf, buffer, size); + } + else + { + tmpbuf = (u_char *)source; + } + + /* + * Now start copying characters. If the size was specified to be 0, then + * assume the input was 0 terminated. + */ + j = 0; + for(i=0; i < size ; i += 2, j++) + { + buffer[i] = 0; + if( tmpbuf[j] < 0x1f && tmpbuf[j] != 0 ) + { + buffer[i+1] = '_'; + } + else + { + switch(tmpbuf[j]) + { + case '*': + case '/': + case ':': + case ';': + case '?': + case '\\': + /* + * Even Joliet has some standards as to what is allowed in a pathname. + * Pretty tame in comparison to what DOS restricts you to. + */ + buffer[i+1] = '_'; + break; + default: + buffer[i+1] = tmpbuf[j]; + break; + } + } + } + + if( source == NULL ) + { + free(tmpbuf); + } +} + +/* + * Function: joliet_strlen + * + * Purpose: Return length in bytes of string after conversion to unicode. + * + * Notes: This is provided mainly as a convenience so that when more intelligent + * Unicode conversion for either Multibyte or 8-bit codes is available that + * we can easily adapt. + */ +static int FDECL1(joliet_strlen, const char *, string) +{ + int rtn; + struct iso_directory_record foobar; + + rtn = strlen(string) << 1; + + /* + * We do clamp the maximum length of a Joliet string to be the + * maximum path size. This helps to ensure that we don't completely + * bolix things up with very long paths. The Joliet specs say + * that the maximum length is 128 bytes, or 64 unicode characters. + */ + if( rtn > 0x80) + { + rtn = 0x80; + } + return rtn; +} + +/* + * Function: get_joliet_vol_desc + * + * Purpose: generate a Joliet compatible volume desc. + * + * Notes: Assume that we have the non-joliet vol desc + * already present in the buffer. Just modifiy the + * appropriate fields. + */ +static void FDECL1(get_joliet_vol_desc, struct iso_primary_descriptor *, vol_desc) +{ + vol_desc->type[0] = ISO_VD_SUPPLEMENTARY; + + /* + * For now, always do Unicode level 3. I don't really know what 1 and 2 + * are - perhaps a more limited Unicode set. + * + * FIXME(eric) - how does Romeo fit in here? + */ + strcpy(vol_desc->escape_sequences, "%/E"); + + /* + * Until we have Unicode path tables, leave these unset. + */ + set_733((char *) vol_desc->path_table_size, jpath_table_size); + set_731(vol_desc->type_l_path_table, jpath_table[0]); + set_731(vol_desc->opt_type_l_path_table, jpath_table[1]); + set_732(vol_desc->type_m_path_table, jpath_table[2]); + set_732(vol_desc->opt_type_m_path_table, jpath_table[3]); + + /* + * Set this one up. + */ + memcpy(vol_desc->root_directory_record, &jroot_record, + sizeof(struct iso_directory_record) + 1); + + /* + * Finally, we have a bunch of strings to convert to Unicode. + * FIXME(eric) - I don't know how to do this in general, so we will + * just be really lazy and do a char -> short conversion. We probably + * will want to filter any characters >= 0x80. + */ + convert_to_unicode((u_char *)vol_desc->system_id, sizeof(vol_desc->system_id), NULL); + convert_to_unicode((u_char *)vol_desc->volume_id, sizeof(vol_desc->volume_id), NULL); + convert_to_unicode((u_char *)vol_desc->volume_set_id, sizeof(vol_desc->volume_set_id), NULL); + convert_to_unicode((u_char *)vol_desc->publisher_id, sizeof(vol_desc->publisher_id), NULL); + convert_to_unicode((u_char *)vol_desc->preparer_id, sizeof(vol_desc->preparer_id), NULL); + convert_to_unicode((u_char *)vol_desc->application_id, sizeof(vol_desc->application_id), NULL); + convert_to_unicode((u_char *)vol_desc->copyright_file_id, sizeof(vol_desc->copyright_file_id), NULL); + convert_to_unicode((u_char *)vol_desc->abstract_file_id, sizeof(vol_desc->abstract_file_id), NULL); + convert_to_unicode((u_char *)vol_desc->bibliographic_file_id, sizeof(vol_desc->bibliographic_file_id), NULL); + + +} + +static void FDECL1(assign_joliet_directory_addresses, struct directory *, node) +{ + int dir_size; + struct directory * dpnt; + + dpnt = node; + + while (dpnt) + { + if( (dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) == 0 ) + { + /* + * If we already have an extent for this (i.e. it came from + * a multisession disc), then don't reassign a new extent. + */ + dpnt->jpath_index = next_jpath_index++; + if( dpnt->jextent == 0 ) + { + dpnt->jextent = last_extent; + dir_size = (dpnt->jsize + (SECTOR_SIZE - 1)) >> 11; + last_extent += dir_size; + } + } + + if(dpnt->subdir) + { + assign_joliet_directory_addresses(dpnt->subdir); + } + dpnt = dpnt->next; + } +} + +static +void FDECL1(build_jpathlist, struct directory *, node) +{ + struct directory * dpnt; + + dpnt = node; + + while (dpnt) + + { + if( (dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) == 0 ) + { + jpathlist[dpnt->jpath_index] = dpnt; + } + if(dpnt->subdir) build_jpathlist(dpnt->subdir); + dpnt = dpnt->next; + } +} /* build_jpathlist(... */ + +static int FDECL2(joliet_compare_paths, void const *, r, void const *, l) +{ + struct directory const *ll = *(struct directory * const *)l; + struct directory const *rr = *(struct directory * const *)r; + int rparent, lparent; + + rparent = rr->parent->jpath_index; + lparent = ll->parent->jpath_index; + if( rr->parent == reloc_dir ) + { + rparent = rr->self->parent_rec->filedir->jpath_index; + } + + if( ll->parent == reloc_dir ) + { + lparent = ll->self->parent_rec->filedir->jpath_index; + } + + if (rparent < lparent) + { + return -1; + } + + if (rparent > lparent) + { + return 1; + } + + return strcmp(rr->self->name, ll->self->name); + +} /* compare_paths(... */ + +static int generate_joliet_path_tables() +{ + struct directory_entry * de; + struct directory * dpnt; + int fix; + int j; + int namelen; + char * npnt; + char * npnt1; + int tablesize; + + /* + * First allocate memory for the tables and initialize the memory + */ + tablesize = jpath_blocks << 11; + jpath_table_m = (char *) e_malloc(tablesize); + jpath_table_l = (char *) e_malloc(tablesize); + memset(jpath_table_l, 0, tablesize); + memset(jpath_table_m, 0, tablesize); + + /* + * Now start filling in the path tables. Start with root directory + */ + jpath_table_index = 0; + jpathlist = (struct directory **) e_malloc(sizeof(struct directory *) + * next_jpath_index); + memset(jpathlist, 0, sizeof(struct directory *) * next_jpath_index); + build_jpathlist(root); + + do + { + fix = 0; + qsort(&jpathlist[1], next_jpath_index-1, sizeof(struct directory *), + (int (*)(const void *, const void *))joliet_compare_paths); + + for(j=1; jjpath_index != j) + { + jpathlist[j]->jpath_index = j; + fix++; + } + } + } while(fix); + + for(j=1; jde_name; + + npnt1 = strrchr(npnt, PATH_SEPARATOR); + if(npnt1) + { + npnt = npnt1 + 1; + } + + de = dpnt->self; + if(!de) + { + fprintf(stderr,"Fatal goof - directory has amnesia\n"); + exit(1); + } + + namelen = joliet_strlen(de->name); + + if( dpnt == root ) + { + jpath_table_l[jpath_table_index] = 1; + jpath_table_m[jpath_table_index] = 1; + } + else + { + jpath_table_l[jpath_table_index] = namelen; + jpath_table_m[jpath_table_index] = namelen; + } + jpath_table_index += 2; + + set_731(jpath_table_l + jpath_table_index, dpnt->jextent); + set_732(jpath_table_m + jpath_table_index, dpnt->jextent); + jpath_table_index += 4; + + if( dpnt->parent != reloc_dir ) + { + set_721(jpath_table_l + jpath_table_index, + dpnt->parent->jpath_index); + set_722(jpath_table_m + jpath_table_index, + dpnt->parent->jpath_index); + } + else + { + set_721(jpath_table_l + jpath_table_index, + dpnt->self->parent_rec->filedir->jpath_index); + set_722(jpath_table_m + jpath_table_index, + dpnt->self->parent_rec->filedir->jpath_index); + } + + jpath_table_index += 2; + + /* + * The root directory is still represented in non-unicode fashion. + */ + if( dpnt == root ) + { + jpath_table_l[jpath_table_index] = 0; + jpath_table_m[jpath_table_index] = 0; + jpath_table_index ++; + } + else + { + convert_to_unicode((u_char *)jpath_table_l + jpath_table_index, + namelen, de->name); + convert_to_unicode((u_char *)jpath_table_m + jpath_table_index, + namelen, de->name); + jpath_table_index += namelen; + } + + if(jpath_table_index & 1) + { + jpath_table_index++; /* For odd lengths we pad */ + } + } + + free(jpathlist); + if(jpath_table_index != jpath_table_size) + { + fprintf(stderr,"Joliet path table lengths do not match %d %d\n", + jpath_table_index, + jpath_table_size); + } + return 0; +} /* generate_path_tables(... */ + +static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE *, outfile) +{ + unsigned int dir_index; + char * directory_buffer; + int new_reclen; + struct directory_entry * s_entry; + struct directory_entry * s_entry1; + struct iso_directory_record jrec; + unsigned int total_size; + int cvt_len; + struct directory * finddir; + + total_size = (dpnt->jsize + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1); + directory_buffer = (char *) e_malloc(total_size); + memset(directory_buffer, 0, total_size); + dir_index = 0; + + s_entry = dpnt->jcontents; + while(s_entry) + { + if( (s_entry->de_flags & INHIBIT_JOLIET_ENTRY) == 0 ) + { + /* + * If this entry was a directory that was relocated, we have a bit + * of trouble here. We need to dig out the real thing and put it + * back here. In the Joliet tree, there is no relocated rock + * ridge, as there are no depth limits to a directory tree. + */ + if( (s_entry->de_flags & RELOCATED_DIRECTORY) != 0 ) + { + for(s_entry1 = reloc_dir->contents; s_entry1; s_entry1 = s_entry1->next) + { + if( s_entry1->parent_rec == s_entry ) + { + break; + } + } + if( s_entry1 == NULL ) + { + /* + * We got trouble. + */ + fprintf(stderr, "Unable to locate relocated directory\n"); + exit(1); + } + } + else + { + s_entry1 = s_entry; + } + + /* + * We do not allow directory entries to cross sector boundaries. + * Simply pad, and then start the next entry at the next sector + */ + new_reclen = s_entry1->jreclen; + if( (dir_index & (SECTOR_SIZE - 1)) + new_reclen >= SECTOR_SIZE ) + { + dir_index = (dir_index + (SECTOR_SIZE - 1)) & + ~(SECTOR_SIZE - 1); + } + + memcpy(&jrec, &s_entry1->isorec, sizeof(struct iso_directory_record) - + sizeof(s_entry1->isorec.name)); + + cvt_len = joliet_strlen(s_entry1->name); + + /* + * Fix the record length - this was the non-Joliet version we + * were seeing. + */ + jrec.name_len[0] = cvt_len; + jrec.length[0] = s_entry1->jreclen; + + /* + * If this is a directory, fix the correct size and extent + * number. + */ + if( (jrec.flags[0] & 2) != 0 ) + { + if(strcmp(s_entry1->name,".") == 0) + { + jrec.name_len[0] = 1; + set_733((char *) jrec.extent, dpnt->jextent); + set_733((char *) jrec.size, ROUND_UP(dpnt->jsize)); + } + else if(strcmp(s_entry1->name,"..") == 0) + { + jrec.name_len[0] = 1; + if( dpnt->parent == reloc_dir ) + { + set_733((char *) jrec.extent, dpnt->self->parent_rec->filedir->jextent); + set_733((char *) jrec.size, ROUND_UP(dpnt->self->parent_rec->filedir->jsize)); + } + else + + { + set_733((char *) jrec.extent, dpnt->parent->jextent); + set_733((char *) jrec.size, ROUND_UP(dpnt->parent->jsize)); + } + } + else + { + if( (s_entry->de_flags & RELOCATED_DIRECTORY) != 0 ) + { + finddir = reloc_dir->subdir; + } + else + { + finddir = dpnt->subdir; + } + while(1==1) + { + if(finddir->self == s_entry1) break; + finddir = finddir->next; + if(!finddir) + { + fprintf(stderr,"Fatal goof - unable to find directory location\n"); exit(1); + } + } + set_733((char *) jrec.extent, finddir->jextent); + set_733((char *) jrec.size, ROUND_UP(finddir->jsize)); + } + } + + memcpy(directory_buffer + dir_index, &jrec, + sizeof(struct iso_directory_record) - + sizeof(s_entry1->isorec.name)); + + + dir_index += sizeof(struct iso_directory_record) - + sizeof (s_entry1->isorec.name); + + /* + * Finally dump the Unicode version of the filename. + * Note - . and .. are the same as with non-Joliet discs. + */ + if( (jrec.flags[0] & 2) != 0 + && strcmp(s_entry1->name, ".") == 0 ) + { + directory_buffer[dir_index++] = 0; + } + else if( (jrec.flags[0] & 2) != 0 + && strcmp(s_entry1->name, "..") == 0 ) + { + directory_buffer[dir_index++] = 1; + } + else + { + convert_to_unicode((u_char *)directory_buffer + dir_index, + cvt_len, + s_entry1->name); + dir_index += cvt_len; + } + + if(dir_index & 1) + { + directory_buffer[dir_index++] = 0; + } + } + s_entry = s_entry->jnext; + } + + if(dpnt->jsize != dir_index) + { + fprintf(stderr,"Unexpected joliet directory length %d %d %s\n",dpnt->jsize, + dir_index, dpnt->de_name); + } + + xfwrite(directory_buffer, 1, total_size, outfile); + last_extent_written += total_size >> 11; + free(directory_buffer); +} /* generate_one_joliet_directory(... */ + +static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir) +{ + struct directory_entry * s_entry; + int status = 0; + + for(s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) + { + if( (s_entry->de_flags & INHIBIT_JOLIET_ENTRY) != 0 ) + { + continue; + } + + /* + * First update the path table sizes for directories. + * + * Finally, set the length of the directory entry if Joliet is used. + * The name is longer, but no Rock Ridge is ever used here, so + * depending upon the options the entry size might turn out to be about + * the same. The Unicode name is always a multiple of 2 bytes, so + * we always add 1 to make it an even number. + */ + if(s_entry->isorec.flags[0] == 2) + { + if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..")) + { + jpath_table_size += joliet_strlen(s_entry->name) + sizeof(struct iso_path_table) - 1; + if (jpath_table_size & 1) + { + jpath_table_size++; + } + } + else + { + if (this_dir == root && strlen(s_entry->name) == 1) + { + jpath_table_size += sizeof(struct iso_path_table); + if (jpath_table_size & 1) jpath_table_size++; + } + } + } + + if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..")) + { + s_entry->jreclen = sizeof(struct iso_directory_record) + - sizeof(s_entry->isorec.name) + + joliet_strlen(s_entry->name) + + 1; + } + else + { + /* + * Special - for '.' and '..' we generate the same records we + * did for non-Joliet discs. + */ + s_entry->jreclen = sizeof(struct iso_directory_record) + - sizeof(s_entry->isorec.name) + + 1; + } + + + } + + if( (this_dir->dir_flags & INHIBIT_JOLIET_ENTRY) != 0 ) + { + return 0; + } + + this_dir->jcontents = this_dir->contents; + status = joliet_sort_directory(&this_dir->jcontents); + + /* + * Now go through the directory and figure out how large this one will be. + * Do not split a directory entry across a sector boundary + */ + s_entry = this_dir->jcontents; + for(s_entry = this_dir->jcontents; s_entry; s_entry = s_entry->jnext) + { + int jreclen; + + if( (s_entry->de_flags & INHIBIT_JOLIET_ENTRY) != 0 ) + { + continue; + } + + jreclen = s_entry->jreclen; + + if ((this_dir->jsize & (SECTOR_SIZE - 1)) + jreclen >= SECTOR_SIZE) + { + this_dir->jsize = (this_dir->jsize + (SECTOR_SIZE - 1)) & + ~(SECTOR_SIZE - 1); + } + this_dir->jsize += jreclen; + } + return status; +} + +/* + * Similar to the iso9660 case, except here we perform a full sort based upon the + * regular name of the file, not the 8.3 version. + */ +static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll) +{ + char * rpnt, *lpnt; + struct directory_entry ** r, **l; + + r = (struct directory_entry **) rr; + l = (struct directory_entry **) ll; + rpnt = (*r)->name; + lpnt = (*l)->name; + + /* + * If the entries are the same, this is an error. + */ + if( strcmp(rpnt, lpnt) == 0 ) + { + sort_goof++; + } + + /* + * Put the '.' and '..' entries on the head of the sorted list. + * For normal ASCII, this always happens to be the case, but out of + * band characters cause this not to be the case sometimes. + */ + if( strcmp(rpnt, ".") == 0 ) return -1; + if( strcmp(lpnt, ".") == 0 ) return 1; + + if( strcmp(rpnt, "..") == 0 ) return -1; + if( strcmp(lpnt, "..") == 0 ) return 1; + + while(*rpnt && *lpnt) + { + if(*rpnt == ';' && *lpnt != ';') return -1; + if(*rpnt != ';' && *lpnt == ';') return 1; + + if(*rpnt == ';' && *lpnt == ';') return 0; + + /* + * Extensions are not special here. Don't treat the dot as something that + * must be bumped to the start of the list. + */ +#if 0 + if(*rpnt == '.' && *lpnt != '.') return -1; + if(*rpnt != '.' && *lpnt == '.') return 1; +#endif + + if(*rpnt < *lpnt) return -1; + if(*rpnt > *lpnt) return 1; + rpnt++; lpnt++; + } + if(*rpnt) return 1; + if(*lpnt) return -1; + return 0; +} + + +/* + * Function: sort_directory + * + * Purpose: Sort the directory in the appropriate ISO9660 + * order. + * + * Notes: Returns 0 if OK, returns > 0 if an error occurred. + */ +static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir) +{ + int dcount = 0; + int i, len; + struct directory_entry * s_entry; + struct directory_entry ** sortlist; + + s_entry = *sort_dir; + while(s_entry) + { + dcount++; + s_entry = s_entry->next; + } + + /* + * OK, now we know how many there are. Build a vector for sorting. + */ + sortlist = (struct directory_entry **) + e_malloc(sizeof(struct directory_entry *) * dcount); + + dcount = 0; + s_entry = *sort_dir; + while(s_entry) + { + sortlist[dcount] = s_entry; + dcount++; + s_entry = s_entry->next; + } + + sort_goof = 0; + qsort(sortlist, dcount, sizeof(struct directory_entry *), + (int (*)(const void *, const void *))joliet_compare_dirs); + + /* + * Now reassemble the linked list in the proper sorted order + */ + for(i=0; ijnext = sortlist[i+1]; + } + + sortlist[dcount-1]->jnext = NULL; + *sort_dir = sortlist[0]; + + free(sortlist); + return sort_goof; +} + +int FDECL1(joliet_sort_tree, struct directory *, node) +{ + struct directory * dpnt; + int goof = 0; + + dpnt = node; + + while (dpnt){ + goof = joliet_sort_n_finish(dpnt); + if( goof ) + { + break; + } + if(dpnt->subdir) goof = joliet_sort_tree(dpnt->subdir); + if( goof ) + { + break; + } + dpnt = dpnt->next; + } + return goof; +} + +static void FDECL2(generate_joliet_directories, struct directory *, node, FILE*, outfile){ + struct directory * dpnt; + + dpnt = node; + + while (dpnt) + { + if( (dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) == 0 ) + { + /* + * In theory we should never reuse a directory, so this doesn't + * make much sense. + */ + if( dpnt->extent > session_start ) + { + generate_one_joliet_directory(dpnt, outfile); + } + } + if(dpnt->subdir) generate_joliet_directories(dpnt->subdir, outfile); + dpnt = dpnt->next; + } +} + + +/* + * Function to write the EVD for the disc. + */ +static int FDECL1(jpathtab_write, FILE *, outfile) +{ + /* + * Next we write the path tables + */ + xfwrite(jpath_table_l, 1, jpath_blocks << 11, outfile); + xfwrite(jpath_table_m, 1, jpath_blocks << 11, outfile); + last_extent_written += 2*jpath_blocks; + free(jpath_table_l); + free(jpath_table_m); + jpath_table_l = NULL; + jpath_table_m = NULL; + return 0; +} + +static int FDECL1(jdirtree_size, int, starting_extent) +{ + assign_joliet_directory_addresses(root); + return 0; +} + +static int jroot_gen() +{ + jroot_record.length[0] = 1 + sizeof(struct iso_directory_record) + - sizeof(jroot_record.name); + jroot_record.ext_attr_length[0] = 0; + set_733((char *) jroot_record.extent, root->jextent); + set_733((char *) jroot_record.size, ROUND_UP(root->jsize)); + iso9660_date(jroot_record.date, root_statbuf.st_mtime); + jroot_record.flags[0] = 2; + jroot_record.file_unit_size[0] = 0; + jroot_record.interleave[0] = 0; + set_723(jroot_record.volume_sequence_number, DEF_VSN); + jroot_record.name_len[0] = 1; + return 0; +} + +static int FDECL1(jdirtree_write, FILE *, outfile) +{ + generate_joliet_directories(root, outfile); + return 0; +} + +/* + * Function to write the EVD for the disc. + */ +static int FDECL1(jvd_write, FILE *, outfile) +{ + struct iso_primary_descriptor jvol_desc; + + /* + * Next we write out the boot volume descriptor for the disc + */ + jvol_desc = vol_desc; + get_joliet_vol_desc(&jvol_desc); + xfwrite(&jvol_desc, 1, 2048, outfile); + last_extent_written ++; + return 0; +} + +/* + * Functions to describe padding block at the start of the disc. + */ +static int FDECL1(jpathtab_size, int, starting_extent) +{ + jpath_table[0] = starting_extent; + jpath_table[1] = 0; + jpath_table[2] = jpath_table[0] + jpath_blocks; + jpath_table[3] = 0; + + last_extent += 2*jpath_blocks; + return 0; +} + +struct output_fragment joliet_desc = {NULL, oneblock_size, jroot_gen,jvd_write}; +struct output_fragment jpathtable_desc= {NULL, jpathtab_size, generate_joliet_path_tables, jpathtab_write}; +struct output_fragment jdirtree_desc = {NULL, jdirtree_size, NULL, jdirtree_write}; diff --git a/util/mkisofs/mkisofs.c b/util/mkisofs/mkisofs.c index a2e2d1874..3344a921a 100644 --- a/util/mkisofs/mkisofs.c +++ b/util/mkisofs/mkisofs.c @@ -20,16 +20,16 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: mkisofs.c,v 1.10.1.3 1998/06/02 03:36:16 eric Exp $"; - -/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ +static char rcsid[] ="$Id: mkisofs.c,v 1.29 1998/06/02 03:43:45 eric Exp $"; #include -#include "mkisofs.h" #include "config.h" +#include "mkisofs.h" #ifdef linux #include +#else +#include "getopt.h" #endif #include "iso9660.h" @@ -60,7 +60,7 @@ static char rcsid[] ="$Id: mkisofs.c,v 1.10.1.3 1998/06/02 03:36:16 eric Exp $"; struct directory * root = NULL; -static char version_string[] = "mkisofs v1.11.3"; +static char version_string[] = "mkisofs 1.12b4"; FILE * discimage; unsigned int next_extent = 0; @@ -69,19 +69,30 @@ unsigned int session_start = 0; unsigned int path_table_size = 0; unsigned int path_table[4] = {0,}; unsigned int path_blocks = 0; + + +unsigned int jpath_table_size = 0; +unsigned int jpath_table[4] = {0,}; +unsigned int jpath_blocks = 0; + struct iso_directory_record root_record; +struct iso_directory_record jroot_record; + char * extension_record = NULL; int extension_record_extent = 0; -static int extension_record_size = 0; +int extension_record_size = 0; /* These variables are associated with command line options */ int use_eltorito = 0; int use_RockRidge = 0; -int verbose = 0; +int use_Joliet = 0; +int verbose = 1; int all_files = 0; int follow_links = 0; int rationalize = 0; int generate_tables = 0; +int print_size = 0; +int split_output = 0; char * preparer = PREPARER_DEFAULT; char * publisher = PUBLISHER_DEFAULT; char * appid = APPID_DEFAULT; @@ -101,6 +112,8 @@ int RR_relocation_depth = 6; /* Violates iso9660, but most systems work */ int full_iso9660_filenames = 0; /* Used with Amiga. Disc will not work with DOS */ int allow_leading_dots = 0; /* DOS cannot read names with leading dots */ +int split_SL_component = 1; /* circumvent a bug in the SunOS driver */ +int split_SL_field = 1; /* circumvent a bug in the SunOS */ struct rcopts{ char * tag; @@ -120,6 +133,110 @@ struct rcopts rcopt[] = { {NULL, NULL} }; +/* + * In case it isn't obvious, the option handling code was ripped off from GNU-ld. + */ +struct ld_option +{ + /* The long option information. */ + struct option opt; + /* The short option with the same meaning ('\0' if none). */ + char shortopt; + /* The name of the argument (NULL if none). */ + const char *arg; + /* The documentation string. If this is NULL, this is a synonym for + the previous option. */ + const char *doc; + enum + { + /* Use one dash before long option name. */ + ONE_DASH, + /* Use two dashes before long option name. */ + TWO_DASHES, + /* Don't mention this option in --help output. */ + NO_HELP + } control; +}; + +/* Codes used for the long options with no short synonyms. 150 isn't + special; it's just an arbitrary non-ASCII char value. */ +#define OPTION_HELP 150 +#define OPTION_QUIET 151 +#define OPTION_NOSPLIT_SL_COMPONENT 152 +#define OPTION_NOSPLIT_SL_FIELD 153 +#define OPTION_PRINT_SIZE 154 +#define OPTION_SPLIT_OUTPUT 155 + +static const struct ld_option ld_options[] = +{ + { {"all-files", no_argument, NULL, 'a'}, + 'a', NULL, "Process all files (don't skip backup files)", ONE_DASH }, + { {"appid", required_argument, NULL, 'A'}, + 'A', "ID", "Set Application ID" , ONE_DASH }, + { {"eltorito-boot", required_argument, NULL, 'b'}, + 'b', "FILE", "Set El Torito boot image name" , ONE_DASH }, + { {"eltorito-catalog", required_argument, NULL, 'c'}, + 'c', "FILE", "Set El Torito boot catalog name" , ONE_DASH }, + { {"cdwrite-params", required_argument, NULL, 'C'}, + 'C', "PARAMS", "Magic paramters from cdwrite" , ONE_DASH }, + { {"omit-period", no_argument, NULL, 'd'}, + 'd', NULL, "Omit trailing periods from filenames", ONE_DASH }, + { {"disable-deep-relocation", no_argument, NULL, 'D'}, + 'D', NULL, "Disable deep directory relocation", ONE_DASH }, + { {"follow-links", no_argument, NULL, 'f'}, + 'f', NULL, "Follow symbolic links", ONE_DASH }, + { {"help", no_argument, NULL, OPTION_HELP}, + '\0', NULL, "Print option help", ONE_DASH }, + { {NULL, required_argument, NULL, 'i'}, + 'i', "ADD_FILES", "No longer supported" , TWO_DASHES }, + { {"joliet", no_argument, NULL, 'J'}, + 'J', NULL, "Generate Joliet directory information", ONE_DASH }, + { {"full-iso9660-filenames", no_argument, NULL, 'l'}, + 'l', NULL, "Allow full 32 character filenames for iso9660 names", ONE_DASH }, + { {"allow-leading-dots", no_argument, NULL, 'L'}, + 'L', NULL, "Allow iso9660 filenames to start with '.'", ONE_DASH }, + { {"exclude", required_argument, NULL, 'm'}, + 'm', "GLOBFILE", "Exclude file name" , ONE_DASH }, + { {"prev-session", required_argument, NULL, 'M'}, + 'M', "FILE", "Set path to previous session to merge" , ONE_DASH }, + { {"omit-version-number", no_argument, NULL, 'N'}, + 'N', NULL, "Omit version number from iso9660 filename", ONE_DASH }, + { {"no-split-symlink-components", no_argument, NULL, 0}, + 0, NULL, "Inhibit splitting symlink components" , ONE_DASH }, + { {"no-split-symlink-fields", no_argument, NULL, 0}, + 0, NULL, "Inhibit splitting symlink fields" , ONE_DASH }, + { {"output", required_argument, NULL, 'o'}, + 'o', "FILE", "Set output file name" , ONE_DASH }, + { {"preparer", required_argument, NULL, 'p'}, + 'p', "PREP", "Set Volume preparer" , ONE_DASH }, + { {"print-size", no_argument, NULL, OPTION_PRINT_SIZE}, + '\0', NULL, "Print estimated filesystem size and exit", ONE_DASH }, + { {"publisher", required_argument, NULL, 'P'}, + 'P', "PUB", "Set Volume publisher" , ONE_DASH }, + { {"quiet", no_argument, NULL, OPTION_QUIET}, + '\0', NULL, "Run quietly", ONE_DASH }, + { {"rational-rock", no_argument, NULL, 'r'}, + 'r', NULL, "Generate rationalized Rock Ridge directory information", ONE_DASH }, + { {"rock", no_argument, NULL, 'R'}, + 'R', NULL, "Generate Rock Ridge directory information", ONE_DASH }, + { {"split-output", no_argument, NULL, OPTION_SPLIT_OUTPUT}, + '\0', NULL, "Split output into files of approx. 1GB size", ONE_DASH }, + { {"translation-table", no_argument, NULL, 'T'}, + 'T', NULL, "Generate translation tables for systems that don't understand long filenames", ONE_DASH }, + { {"verbose", no_argument, NULL, 'v'}, + 'v', NULL, "Verbose", ONE_DASH }, + { {"volid", required_argument, NULL, 'V'}, + 'V', "ID", "Set Volume ID" , ONE_DASH }, + { {"old-exclude", required_argument, NULL, 'x'}, + 'x', "FILE", "Exclude file name(depreciated)" , ONE_DASH } +#ifdef ERIC_neverdef + { {"transparent-compression", no_argument, NULL, 'z'}, + 'z', NULL, "Enable transparent compression of files", ONE_DASH }, +#endif +}; + +#define OPTION_COUNT (sizeof ld_options / sizeof ld_options[0]) + #if defined(ultrix) || defined(_AUX_SOURCE) char *strdup(s) char *s;{char *c;if(c=(char *)malloc(strlen(s)+1))strcpy(c,s);return c;} @@ -179,7 +296,11 @@ void FDECL1(read_rcfile, char *, appname) } if (!rcfile) return; - fprintf(stderr, "Using \"%s\"\n", filename); + if ( verbose > 0 ) + { + fprintf(stderr, "Using \"%s\"\n", filename); + } + /* OK, we got it. Now read in the lines and parse them */ linum = 0; while (fgets(linebuffer, sizeof(linebuffer), rcfile)) @@ -260,20 +381,113 @@ void FDECL1(read_rcfile, char *, appname) char * path_table_l = NULL; char * path_table_m = NULL; + +char * jpath_table_l = NULL; +char * jpath_table_m = NULL; + int goof = 0; +#ifndef TRUE +#define TRUE 1 +#endif + +#ifndef FALSE +#define FALSE 0 +#endif + void usage(){ + const char * program_name = "mkisofs"; +#if 0 fprintf(stderr,"Usage:\n"); fprintf(stderr, "mkisofs [-o outfile] [-R] [-V volid] [-v] [-a] \ [-T]\n [-l] [-d] [-V] [-D] [-L] [-p preparer]" -#ifdef ADD_FILES -"[-i file] \n" -#endif "[-P publisher] [ -A app_id ] [-z] \n \ [-b boot_image_name] [-c boot_catalog-name] \ [-x path -x path ...] path\n"); - exit(1); +#endif + + int i; + const char **targets, **pp; + + fprintf (stderr, "Usage: %s [options] file...\n", program_name); + + fprintf (stderr, "Options:\n"); + for (i = 0; i < OPTION_COUNT; i++) + { + if (ld_options[i].doc != NULL) + { + int comma; + int len; + int j; + + fprintf (stderr, " "); + + comma = FALSE; + len = 2; + + j = i; + do + { + if (ld_options[j].shortopt != '\0' + && ld_options[j].control != NO_HELP) + { + fprintf (stderr, "%s-%c", comma ? ", " : "", ld_options[j].shortopt); + len += (comma ? 2 : 0) + 2; + if (ld_options[j].arg != NULL) + { + if (ld_options[j].opt.has_arg != optional_argument) + { + fprintf (stderr, " "); + ++len; + } + fprintf (stderr, "%s", ld_options[j].arg); + len += strlen (ld_options[j].arg); + } + comma = TRUE; + } + ++j; + } + while (j < OPTION_COUNT && ld_options[j].doc == NULL); + + j = i; + do + { + if (ld_options[j].opt.name != NULL + && ld_options[j].control != NO_HELP) + { + fprintf (stderr, "%s-%s%s", + comma ? ", " : "", + ld_options[j].control == TWO_DASHES ? "-" : "", + ld_options[j].opt.name); + len += ((comma ? 2 : 0) + + 1 + + (ld_options[j].control == TWO_DASHES ? 1 : 0) + + strlen (ld_options[j].opt.name)); + if (ld_options[j].arg != NULL) + { + fprintf (stderr, " %s", ld_options[j].arg); + len += 1 + strlen (ld_options[j].arg); + } + comma = TRUE; + } + ++j; + } + while (j < OPTION_COUNT && ld_options[j].doc == NULL); + + if (len >= 30) + { + fprintf (stderr, "\n"); + len = 0; + } + + for (; len < 30; len++) + fputc (' ', stderr); + + fprintf (stderr, "%s\n", ld_options[i].doc); + } + } + exit(1); } @@ -326,15 +540,18 @@ extern char * cdwrite_data; int FDECL2(main, int, argc, char **, argv){ char * outfile; struct directory_entry de; +#ifdef HAVE_SBRK unsigned long mem_start; +#endif struct stat statbuf; char * scan_tree; char * merge_image = NULL; struct iso_directory_record * mrootp = NULL; + struct output_fragment * opnt; + int longind; + char shortopts[OPTION_COUNT * 3 + 2]; + struct option longopts[OPTION_COUNT + 1]; int c; -#ifdef ADD_FILES - char *add_file_file = NULL; -#endif if (argc < 2) usage(); @@ -343,9 +560,56 @@ int FDECL2(main, int, argc, char **, argv){ read_rcfile(argv[0]); outfile = NULL; - while ((c = getopt(argc, argv, "i:o:V:RrfvaTp:P:b:c:x:dDlLNzA:M:m:C:")) != EOF) + + /* + * Copy long option initialization from GNU-ld. + */ + /* Starting the short option string with '-' is for programs that + expect options and other ARGV-elements in any order and that care about + the ordering of the two. We describe each non-option ARGV-element + as if it were the argument of an option with character code 1. */ + { + int i, is, il; + shortopts[0] = '-'; + is = 1; + il = 0; + for (i = 0; i < OPTION_COUNT; i++) + { + if (ld_options[i].shortopt != '\0') + { + shortopts[is] = ld_options[i].shortopt; + ++is; + if (ld_options[i].opt.has_arg == required_argument + || ld_options[i].opt.has_arg == optional_argument) + { + shortopts[is] = ':'; + ++is; + if (ld_options[i].opt.has_arg == optional_argument) + { + shortopts[is] = ':'; + ++is; + } + } + } + if (ld_options[i].opt.name != NULL) + { + longopts[il] = ld_options[i].opt; + ++il; + } + } + shortopts[is] = '\0'; + longopts[il].name = NULL; + } + + while ((c = getopt_long_only (argc, argv, shortopts, longopts, &longind)) != EOF) switch (c) { + case 1: + /* + * A filename that we take as input. + */ + optind--; + goto parse_input_files; case 'C': /* * This is a temporary hack until cdwrite gets the proper hooks in @@ -353,6 +617,13 @@ int FDECL2(main, int, argc, char **, argv){ */ cdwrite_data = optarg; break; + case 'i': + fprintf(stderr, "-i option no longer supported.\n"); + exit(1); + break; + case 'J': + use_Joliet++; + break; case 'a': all_files++; break; @@ -388,14 +659,6 @@ int FDECL2(main, int, argc, char **, argv){ case 'f': follow_links++; break; - case 'i': -#ifdef ADD_FILES - add_file_file = optarg; - break; -#else - usage(); - exit(1); -#endif case 'l': full_iso9660_filenames++; break; @@ -418,6 +681,9 @@ int FDECL2(main, int, argc, char **, argv){ exit(1); }; break; + case OPTION_PRINT_SIZE: + print_size++; + break; case 'P': publisher = optarg; if(strlen(publisher) > 128) { @@ -425,6 +691,9 @@ int FDECL2(main, int, argc, char **, argv){ exit(1); }; break; + case OPTION_QUIET: + verbose = 0; + break; case 'R': use_RockRidge++; break; @@ -432,6 +701,9 @@ int FDECL2(main, int, argc, char **, argv){ rationalize++; use_RockRidge++; break; + case OPTION_SPLIT_OUTPUT: + split_output++; + break; case 'T': generate_tables++; break; @@ -449,16 +721,32 @@ int FDECL2(main, int, argc, char **, argv){ transparent_compression++; #endif break; + case 'x': case 'm': + /* + * Somehow two options to do basically the same thing got added somewhere along + * the way. The 'match' code supports limited globbing, so this is the one + * that got selected. Unfortunately the 'x' switch is probably more intuitive. + */ add_match(optarg); break; - case 'x': - exclude(optarg); + case OPTION_HELP: + usage (); + exit (0); + break; + case OPTION_NOSPLIT_SL_COMPONENT: + split_SL_component = 0; + break; + case OPTION_NOSPLIT_SL_FIELD: + split_SL_field = 0; break; default: usage(); exit(1); } + +parse_input_files: + #ifdef __NetBSD__ { int resource; @@ -476,7 +764,7 @@ int FDECL2(main, int, argc, char **, argv){ mem_start = (unsigned long) sbrk(0); #endif - if(verbose) fprintf(stderr,"%s\n", version_string); + if(verbose > 1) fprintf(stderr,"%s\n", version_string); if( (cdwrite_data != NULL && merge_image == NULL) || (cdwrite_data == NULL && merge_image != NULL) ) @@ -489,12 +777,6 @@ int FDECL2(main, int, argc, char **, argv){ scan_tree = argv[optind]; -#ifdef ADD_FILES - if (add_file_file) { - add_file(add_file_file); - } - add_file_list (argc, argv, optind+1); -#endif if(!scan_tree){ usage(); @@ -557,28 +839,186 @@ int FDECL2(main, int, argc, char **, argv){ } /* - * Scan the actual directory (and any we find below it) - * for files to write out to the output image. + * Create an empty root directory. If we ever scan it for real, we will fill in the + * contents. */ - if (!scan_directory_tree(argv[optind], &de, mrootp)) + find_or_create_directory(NULL, "", &de, TRUE); + + /* + * Scan the actual directory (and any we find below it) + * for files to write out to the output image. Note - we + * take multiple source directories and keep merging them + * onto the image. + */ + while(optind < argc) { - exit(1); + char * node; + struct directory * graft_dir; + struct stat st; + char * short_name; + int status; + char graft_point[1024]; + + /* + * We would like a syntax like: + * + * /tmp=/usr/tmp/xxx + * + * where the user can specify a place to graft each + * component of the tree. To do this, we may have to create + * directories along the way, of course. + * Secondly, I would like to allow the user to do something + * like: + * + * /home/baz/RMAIL=/u3/users/baz/RMAIL + * + * so that normal files could also be injected into the tree + * at an arbitrary point. + * + * The idea is that the last component of whatever is being + * entered would take the name from the last component of + * whatever the user specifies. + * + * The default will be that the file is injected at the + * root of the image tree. + */ + node = strchr(argv[optind], '='); + short_name = NULL; + + if( node != NULL ) + { + char * pnt; + char * xpnt; + + *node = '\0'; + strcpy(graft_point, argv[optind]); + *node = '='; + node++; + + graft_dir = root; + xpnt = graft_point; + if( *xpnt == PATH_SEPARATOR ) + { + xpnt++; + } + + /* + * Loop down deeper and deeper until we + * find the correct insertion spot. + */ + while(1==1) + { + pnt = strchr(xpnt, PATH_SEPARATOR); + if( pnt == NULL ) + { + if( *xpnt != '\0' ) + { + short_name = xpnt; + } + break; + } + *pnt = '\0'; + graft_dir = find_or_create_directory(graft_dir, + graft_point, + NULL, TRUE); + *pnt = PATH_SEPARATOR; + xpnt = pnt + 1; + } + } + else + { + graft_dir = root; + node = argv[optind]; + } + + /* + * Now see whether the user wants to add a regular file, + * or a directory at this point. + */ + status = stat_filter(node, &st); + if( status != 0 ) + { + /* + * This is a fatal error - the user won't be getting what + * they want if we were to proceed. + */ + fprintf(stderr, "Invalid node - %s\n", node); + exit(1); + } + else + { + if( S_ISDIR(st.st_mode) ) + { + if (!scan_directory_tree(graft_dir, node, &de)) + { + exit(1); + } + } + else + { + if( short_name == NULL ) + { + short_name = strrchr(node, PATH_SEPARATOR); + if( short_name == NULL || short_name < node ) + { + short_name = node; + } + else + { + short_name++; + } + } + if( !insert_file_entry(graft_dir, node, short_name) ) + { + exit(1); + } + } + } + + optind++; + } + + + /* + * Now merge in any previous sessions. This is driven on the source + * side, since we may need to create some additional directories. + */ + if( merge_image != NULL ) + { + merge_previous_session(root, mrootp); } /* - * Fix a couple of things in the root directory so that everything - * is self consistent. + * Sort the directories in the required order (by ISO9660). Also, + * choose the names for the 8.3 filesystem if required, and do + * any other post-scan work. */ - root->self = root->contents; /* Fix this up so that the path tables get done right */ + goof += sort_tree(root); - if(reloc_dir) sort_n_finish(reloc_dir); + if( use_Joliet ) + { + goof += joliet_sort_tree(root); + } if (goof) exit(1); + /* + * Fix a couple of things in the root directory so that everything + * is self consistent. + */ + root->self = root->contents; /* Fix this up so that the path + tables get done right */ + /* * OK, ready to write the file. Open it up, and generate the thing. */ - if (outfile){ + if (print_size){ + discimage = fopen("/dev/null", "w"); + if (!discimage){ + fprintf(stderr,"Unable to open /dev/null\n"); + exit(1); + } + } else if (outfile){ discimage = fopen(outfile, "w"); if (!discimage){ fprintf(stderr,"Unable to open disc image file\n"); @@ -593,54 +1033,120 @@ int FDECL2(main, int, argc, char **, argv){ path_blocks = (path_table_size + (SECTOR_SIZE - 1)) >> 11; if (path_blocks & 1) path_blocks++; - path_table[0] = session_start + 0x10 + 2 + (use_eltorito ? 1 : 0); - path_table[1] = 0; - path_table[2] = path_table[0] + path_blocks; - path_table[3] = 0; + jpath_blocks = (jpath_table_size + (SECTOR_SIZE - 1)) >> 11; + if (jpath_blocks & 1) jpath_blocks++; - last_extent += path_table[2] - session_start + path_blocks; - /* The next free block */ + /* + * Start to set up the linked list that we use to track the + * contents of the disc. + */ + outputlist_insert(&padblock_desc); - /* The next step is to go through the directory tree and assign extent - numbers for all of the directories */ + /* + * PVD for disc. + */ + outputlist_insert(&voldesc_desc); - assign_directory_addresses(root); + /* + * SVD for El Torito. MUST be immediately after the PVD! + */ + if( use_eltorito) + { + outputlist_insert(&torito_desc); + } - if(extension_record) { - struct directory_entry * s_entry; - extension_record_extent = last_extent++; - s_entry = root->contents; - set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 24, - extension_record_extent); - set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 8, - extension_record_size); - }; + /* + * SVD for Joliet. + */ + if( use_Joliet) + { + outputlist_insert(&joliet_desc); + } - if (use_RockRidge && reloc_dir) - finish_cl_pl_entries(); + /* + * Finally the last volume desctiptor. + */ + outputlist_insert(&end_vol); - /* Now we generate the path tables that are used by DOS to improve directory - access times. */ - generate_path_tables(); - /* Generate root record for volume descriptor. */ - generate_root_record(); + outputlist_insert(&pathtable_desc); + if( use_Joliet) + { + outputlist_insert(&jpathtable_desc); + } - if (verbose) - dump_tree(root); + outputlist_insert(&dirtree_desc); + if( use_Joliet) + { + outputlist_insert(&jdirtree_desc); + } + + outputlist_insert(&dirtree_clean); + + if(extension_record) + { + outputlist_insert(&extension_desc); + } + + outputlist_insert(&files_desc); + + /* + * Allow room for the various headers we will be writing. There + * will always be a primary and an end volume descriptor. + */ + last_extent = session_start; + + /* + * Calculate the size of all of the components of the disc, and assign + * extent numbers. + */ + for(opnt = out_list; opnt; opnt = opnt->of_next ) + { + if( opnt->of_size != NULL ) + { + (*opnt->of_size)(last_extent); + } + } + + /* + * Generate the contents of any of the sections that we want to generate. + * Not all of the fragments will do anything here - most will generate the + * data on the fly when we get to the write pass. + */ + for(opnt = out_list; opnt; opnt = opnt->of_next ) + { + if( opnt->of_generate != NULL ) + { + (*opnt->of_generate)(); + } + } if( in_image != NULL ) { fclose(in_image); } - iso_write(discimage); + /* + * Now go through the list of fragments and write the data that corresponds to + * each one. + */ + for(opnt = out_list; opnt; opnt = opnt->of_next ) + { + if( opnt->of_write != NULL ) + { + (*opnt->of_write)(discimage); + } + } + if( verbose > 0 ) + { #ifdef HAVE_SBRK - fprintf(stderr,"Max brk space used %x\n", - (unsigned int)(((unsigned long)sbrk(0)) - mem_start)); + fprintf(stderr,"Max brk space used %x\n", + (unsigned int)(((unsigned long)sbrk(0)) - mem_start)); #endif - fprintf(stderr,"%d extents written (%d Mb)\n", last_extent, last_extent >> 9); + fprintf(stderr,"%d extents written (%d Mb)\n", last_extent, last_extent >> 9); + } + #ifdef VMS return 1; #else diff --git a/util/mkisofs/mkisofs.h b/util/mkisofs/mkisofs.h index bc264d99a..b512a2865 100644 --- a/util/mkisofs/mkisofs.h +++ b/util/mkisofs/mkisofs.h @@ -20,11 +20,9 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ /* - * $Id: mkisofs.h,v 1.5 1997/05/17 15:50:28 eric Exp $ + * $Id: mkisofs.h,v 1.17 1998/06/02 02:40:38 eric Exp $ */ -/* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ - #include /* This symbol is used to indicate that we do not have things like @@ -41,16 +39,39 @@ #ifdef VMS #include #define dirent direct -#else -#include #endif +#ifdef _WIN32 +#define NON_UNIXFS +#endif /* _WIN32 */ + #include #include #include -#ifdef linux -#include +#if defined(HAVE_DIRENT_H) +# include +# define NAMLEN(dirent) strlen((dirent)->d_name) +#else +# define dirent direct +# define NAMLEN(dirent) (dirent)->d_namlen +# if defined(HAVE_SYS_NDIR_H) +# include +# endif +# if defined(HAVE_SYS_DIR_H) +# include +# endif +# if defined(HAVE_NDIR_H) +# include +# endif +#endif + +#if defined(HAVE_STRING_H) +#include +#else +#if defined(HAVE_STRINGS_H) +#include +#endif #endif #ifdef ultrix @@ -100,10 +121,12 @@ extern char *optarg; struct directory_entry{ struct directory_entry * next; + struct directory_entry * jnext; struct iso_directory_record isorec; unsigned int starting_block; unsigned int size; - unsigned int priority; + unsigned short priority; + unsigned char jreclen; /* Joliet record len */ char * name; char * table; char * whole_name; @@ -125,6 +148,52 @@ struct file_hash{ unsigned int size; }; + +/* + * This structure is used to control the output of fragments to the cdrom + * image. Everything that will be written to the output image will eventually + * go through this structure. There are two pieces - first is the sizing where + * we establish extent numbers for everything, and the second is when we actually + * generate the contents and write it to the output image. + * + * This makes it trivial to extend mkisofs to write special things in the image. + * All you need to do is hook an additional structure in the list, and the rest + * works like magic. + * + * The three passes each do the following: + * + * The 'size' pass determines the size of each component and assigns the extent number + * for that component. + * + * The 'generate' pass will adjust the contents and pointers as required now that extent + * numbers are assigned. In some cases, the contents of the record are also generated. + * + * The 'write' pass actually writes the data to the disc. + */ +struct output_fragment +{ + struct output_fragment * of_next; + int (*of_size)(int); + int (*of_generate)(void); + int (*of_write)(FILE *); +}; + +extern struct output_fragment * out_list; +extern struct output_fragment * out_tail; + +extern struct output_fragment padblock_desc; +extern struct output_fragment voldesc_desc; +extern struct output_fragment joliet_desc; +extern struct output_fragment torito_desc; +extern struct output_fragment end_vol; +extern struct output_fragment pathtable_desc; +extern struct output_fragment jpathtable_desc; +extern struct output_fragment dirtree_desc; +extern struct output_fragment dirtree_clean; +extern struct output_fragment jdirtree_desc; +extern struct output_fragment extension_desc; +extern struct output_fragment files_desc; + /* * This structure describes one complete directory. It has pointers * to other directories in the overall tree so that it is clear where @@ -138,6 +207,7 @@ struct directory{ struct directory * subdir; /* First subdirectory in this directory */ struct directory * parent; struct directory_entry * contents; + struct directory_entry * jcontents; struct directory_entry * self; char * whole_name; /* Entire path */ char * de_name; /* Entire path */ @@ -145,7 +215,12 @@ struct directory{ unsigned int depth; unsigned int size; unsigned int extent; + unsigned int jsize; + unsigned int jextent; unsigned short path_index; + unsigned short jpath_index; + unsigned short dir_flags; + unsigned short dir_nlink; }; struct deferred{ @@ -163,57 +238,82 @@ extern unsigned int next_extent; extern unsigned int last_extent; extern unsigned int last_extent_written; extern unsigned int session_start; + extern unsigned int path_table_size; extern unsigned int path_table[4]; extern unsigned int path_blocks; extern char * path_table_l; extern char * path_table_m; + +extern unsigned int jpath_table_size; +extern unsigned int jpath_table[4]; +extern unsigned int jpath_blocks; +extern char * jpath_table_l; +extern char * jpath_table_m; + extern struct iso_directory_record root_record; +extern struct iso_directory_record jroot_record; extern int use_eltorito; extern int use_RockRidge; +extern int use_Joliet; extern int rationalize; extern int follow_links; extern int verbose; extern int all_files; extern int generate_tables; +extern int print_size; +extern int split_output; extern int omit_period; extern int omit_version_number; extern int transparent_compression; extern int RR_relocation_depth; extern int full_iso9660_filenames; +extern int split_SL_component; +extern int split_SL_field; /* tree.c */ extern int DECL(stat_filter, (char *, struct stat *)); -extern void DECL(sort_n_finish,(struct directory *)); -extern void finish_cl_pl_entries(); -extern int DECL(scan_directory_tree,(char * path, - struct directory_entry * self, - struct iso_directory_record *)); +extern int DECL(lstat_filter, (char *, struct stat *)); +extern int DECL(sort_tree,(struct directory *)); +extern struct directory * + DECL(find_or_create_directory,(struct directory *, const char *, + struct directory_entry * self, int)); +extern void DECL (finish_cl_pl_entries, (void)); +extern int DECL(scan_directory_tree,(struct directory * this_dir, + char * path, + struct directory_entry * self)); +extern int DECL(insert_file_entry,(struct directory *, char *, + char *)); + extern void DECL(generate_iso9660_directories,(struct directory *, FILE*)); extern void DECL(dump_tree,(struct directory * node)); extern struct directory_entry * DECL(search_tree_file, (struct directory * node,char * filename)); +extern void DECL(update_nlink_field,(struct directory * node)); +extern void DECL (init_fstatbuf, (void)); +extern struct stat root_statbuf; /* eltorito.c */ extern void DECL(init_boot_catalog, (const char * path )); extern void DECL(get_torito_desc, (struct eltorito_boot_descriptor * path )); /* write.c */ -extern void DECL(assign_directory_addresses,(struct directory * root)); extern int DECL(get_733,(char *)); extern int DECL(isonum_733,(unsigned char *)); extern void DECL(set_723,(char *, unsigned int)); extern void DECL(set_731,(char *, unsigned int)); extern void DECL(set_721,(char *, unsigned int)); extern void DECL(set_733,(char *, unsigned int)); -extern void DECL(sort_directory,(struct directory_entry **)); -extern void generate_root_record(); +extern int DECL(sort_directory,(struct directory_entry **)); extern void DECL(generate_one_directory,(struct directory *, FILE*)); -extern void generate_path_tables(); -extern int DECL(iso_write,(FILE * outfile)); extern void DECL(memcpy_max, (char *, char *, int)); - +extern int DECL(oneblock_size, (int starting_extent)); +extern struct iso_primary_descriptor vol_desc; +extern void DECL(xfwrite, (void * buffer, int count, int size, FILE * file)); +extern void DECL(set_732, (char * pnt, unsigned int i)); +extern void DECL(set_722, (char * pnt, unsigned int i)); +extern void DECL(outputlist_insert, (struct output_fragment * frag)); /* multi.c */ @@ -228,6 +328,12 @@ extern struct directory_entry ** extern void DECL(merge_remaining_entries, (struct directory *, struct directory_entry **, int)); +extern int + DECL(merge_previous_session, (struct directory *, + struct iso_directory_record *)); + +/* joliet.c */ +int DECL(joliet_sort_tree, (struct directory * node)); /* match.c */ extern int DECL(matches, (char *)); @@ -245,7 +351,7 @@ extern void DECL(add_hash,(struct directory_entry *)); extern struct file_hash * DECL(find_hash,(dev_t, ino_t)); extern void DECL(add_directory_hash,(dev_t, ino_t)); extern struct file_hash * DECL(find_directory_hash,(dev_t, ino_t)); -extern void flush_file_hash(); +extern void DECL (flush_file_hash, (void)); extern int DECL(delete_file_hash,(struct directory_entry *)); extern struct directory_entry * DECL(find_file_hash,(char *)); extern void DECL(add_file_hash,(struct directory_entry *)); @@ -320,7 +426,13 @@ extern void * DECL(e_malloc,(size_t)); * is set for all entries in a directory, it means we can just * reuse the TRANS.TBL and not generate a new one. */ -#define SAFE_TO_REUSE_TABLE_ENTRY 1 +#define SAFE_TO_REUSE_TABLE_ENTRY 0x01 +#define DIR_HAS_DOT 0x02 +#define DIR_HAS_DOTDOT 0x04 +#define INHIBIT_JOLIET_ENTRY 0x08 +#define INHIBIT_RR_ENTRY 0x10 +#define RELOCATED_DIRECTORY 0x20 + /* * Volume sequence number to use in all of the iso directory records. */ diff --git a/util/mkisofs/multi.c b/util/mkisofs/multi.c index 13ba6f6d1..e49d1c34e 100644 --- a/util/mkisofs/multi.c +++ b/util/mkisofs/multi.c @@ -19,7 +19,7 @@ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: multi.c,v 1.6.1.3 1998/06/02 03:00:25 eric Exp $"; +static char rcsid[] ="$Id: multi.c,v 1.12 1998/06/02 02:40:38 eric Exp $"; #include #include @@ -137,7 +137,7 @@ FDECL3(parse_rr, unsigned char *, pnt, int, len, struct directory_entry *,dpnt) while(len >= 4){ if(pnt[3] != 1) { - printf("**BAD RRVERSION"); + fprintf(stderr,"**BAD RRVERSION"); return -1; }; if(strncmp((char *) pnt, "NM", 2) == 0) { @@ -193,7 +193,7 @@ FDECL4(check_rr_dates, struct directory_entry *, dpnt, */ while(len >= 4){ if(pnt[3] != 1) { - printf("**BAD RRVERSION"); + fprintf(stderr,"**BAD RRVERSION"); return -1; }; @@ -750,6 +750,7 @@ void FDECL3(merge_remaining_entries, struct directory *, this_dir, struct directory_entry * s_entry; unsigned int ttbl_extent = 0; unsigned int ttbl_index = 0; + char whole_path[1024]; /* * Whatever is leftover in the list needs to get merged back @@ -762,6 +763,18 @@ void FDECL3(merge_remaining_entries, struct directory *, this_dir, continue; } + if( pnt[i]->name != NULL && pnt[i]->whole_name == NULL) + { + /* + * Set the name for this directory. + */ + strcpy(whole_path, this_dir->de_name); + strcat(whole_path, SPATH_SEPARATOR); + strcat(whole_path, pnt[i]->name); + + pnt[i]->whole_name = strdup(whole_path); + } + if( pnt[i]->name != NULL && strcmp(pnt[i]->name, "") == 0 ) { @@ -884,6 +897,7 @@ FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt, char whole_path[1024]; this_dir = (struct directory *) e_malloc(sizeof(struct directory)); + memset(this_dir, 0, sizeof(struct directory)); this_dir->next = NULL; this_dir->subdir = NULL; this_dir->self = dpnt; @@ -939,8 +953,23 @@ FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt, if( (contents[i]->isorec.flags[0] & 2) != 0 ) { memset(contents[i]->isorec.extent, 0, 8); + + if( strcmp(contents[i]->name, ".") == 0 ) + this_dir->dir_flags |= DIR_HAS_DOT; + + if( strcmp(contents[i]->name, "..") == 0 ) + this_dir->dir_flags |= DIR_HAS_DOTDOT; } + /* + * Set the whole name for this file. + */ + strcpy(whole_path, this_dir->whole_name); + strcat(whole_path, SPATH_SEPARATOR); + strcat(whole_path, contents[i]->name); + + contents[i]->whole_name = strdup(whole_path); + contents[i]->next = this_dir->contents; contents[i]->filedir = this_dir; this_dir->contents = contents[i]; @@ -957,7 +986,13 @@ FDECL2(merge_old_directory_into_tree, struct directory_entry *, dpnt, */ merge_remaining_entries(this_dir, contents, n_orig); free_mdinfo(contents, n_orig); +#if 0 + /* + * This is no longer required. The post-scan sort will handle + * all of this for us. + */ sort_n_finish(this_dir); +#endif return 0; } @@ -1016,3 +1051,99 @@ FDECL1(get_session_start, int *, file_addr) return 0; } +/* + * This function scans the directory tree, looking for files, and it makes + * note of everything that is found. We also begin to construct the ISO9660 + * directory entries, so that we can determine how large each directory is. + */ + +int +FDECL2(merge_previous_session,struct directory *, this_dir, + struct iso_directory_record *, mrootp) +{ + struct directory_entry **orig_contents = NULL; + struct directory_entry * odpnt = NULL; + int n_orig; + struct directory_entry * s_entry; + int dflag; + int status, lstatus; + struct stat statbuf, lstatbuf; + + /* + * Parse the same directory in the image that we are merging + * for multisession stuff. + */ + orig_contents = read_merging_directory(mrootp, &n_orig); + if( orig_contents == NULL ) + { + return 0; + } + + +/* Now we scan the directory itself, and look at what is inside of it. */ + + dflag = 0; + for(s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) + { + status = stat_filter(s_entry->whole_name, &statbuf); + lstatus = lstat_filter(s_entry->whole_name, &lstatbuf); + + /* + * We always should create an entirely new directory tree whenever + * we generate a new session, unless there were *no* changes whatsoever + * to any of the directories, in which case it would be kind of pointless + * to generate a new session. + * + * I believe it is possible to rigorously prove that any change anywhere + * in the filesystem will force the entire tree to be regenerated + * because the modified directory will get a new extent number. Since + * each subdirectory of the changed directory has a '..' entry, all of + * them will need to be rewritten too, and since the parent directory + * of the modified directory will have an extent pointer to the directory + * it too will need to be rewritten. Thus we will never be able to reuse + * any directory information when writing new sessions. + * + * We still check the previous session so we can mark off the equivalent + * entry in the list we got from the original disc, however. + */ + + /* + * The check_prev_session function looks for an identical entry in + * the previous session. If we see it, then we copy the extent + * number to s_entry, and cross it off the list. + */ + check_prev_session(orig_contents, n_orig, s_entry, + &statbuf, &lstatbuf, &odpnt); + + if(S_ISDIR(statbuf.st_mode) && odpnt != NULL) + { + int dflag; + + if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..")) + { + struct directory * child; + + child = find_or_create_directory(this_dir, + s_entry->whole_name, + s_entry, 1); + dflag = merge_previous_session(child, + &odpnt->isorec); + /* If unable to scan directory, mark this as a non-directory */ + if(!dflag) + lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; + free(odpnt); + odpnt = NULL; + } + } + } + + /* + * Whatever is left over, are things which are no longer in the tree + * on disk. We need to also merge these into the tree. + */ + merge_remaining_entries(this_dir, orig_contents, n_orig); + free_mdinfo(orig_contents, n_orig); + + return 1; +} + diff --git a/util/mkisofs/name.c b/util/mkisofs/name.c index 10475d43e..fb88fc9d0 100644 --- a/util/mkisofs/name.c +++ b/util/mkisofs/name.c @@ -21,8 +21,9 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: name.c,v 1.7 1997/11/09 16:42:51 eric Exp $"; +static char rcsid[] ="$Id: name.c,v 1.10 1998/06/02 02:40:38 eric Exp $"; +#include "config.h" #include "mkisofs.h" #include @@ -105,8 +106,7 @@ int FDECL3(iso9660_file_length, last_dot = strrchr (pnt,'.'); if( (last_dot != NULL) && ( (last_dot[1] == '~') - || (last_dot[1] == '\0') - || (last_dot[1] == '\0')) ) + || (last_dot[1] == '\0')) ) { c = last_dot; *c = '\0'; @@ -154,13 +154,19 @@ int FDECL3(iso9660_file_length, * a silly thing to do on a Unix box, but we check for it * anyways. If we see this, then we don't have to add our * own version number at the end. + * UNLESS the ';' is part of the filename and no version + * number is following. [VK] */ - if(*pnt == ';') - { - seen_semic = 1; - *result++ = *pnt++; - continue; - } + if(*pnt == ';') + { + /* [VK] */ + if (pnt[1] != '\0' && (pnt[1] < '0' || pnt[1] > '9')) + { + pnt++; + ignore++; + continue; + } + } /* * If we have a name with multiple '.' characters, we ignore everything diff --git a/util/mkisofs/rock.c b/util/mkisofs/rock.c index 47cba5527..d851b96fb 100644 --- a/util/mkisofs/rock.c +++ b/util/mkisofs/rock.c @@ -19,7 +19,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: rock.c,v 1.3 1997/05/17 15:45:26 eric Exp $"; +static char rcsid[] ="$Id: rock.c,v 1.7 1998/02/18 04:48:23 eric Exp $"; #include @@ -225,7 +225,7 @@ int deep_opt; Rock[ipnt++] = PN_SIZE; Rock[ipnt++] = SU_VERSION; flagval |= (1<<1); -#if !defined(MAJOR_IN_SYSMACROS) && !defined(MAJOR_IN_MKDEV) +#if defined(MAJOR_IN_SYSMACROS) || defined(MAJOR_IN_MKDEV) set_733((char*)Rock + ipnt, major(lstatbuf->st_rdev )); ipnt += 8; set_733((char*)Rock + ipnt, minor(lstatbuf->st_rdev)); @@ -268,10 +268,36 @@ int deep_opt; unsigned char * cpnt, *cpnt1; nchar = readlink(whole_name, symlink_buff, sizeof(symlink_buff)); symlink_buff[nchar < 0 ? 0 : nchar] = 0; + nchar = strlen((char *) symlink_buff); set_733(s_entry->isorec.size, 0); cpnt = &symlink_buff[0]; flagval |= (1<<2); + if (! split_SL_field) + { + int sl_bytes = 0; + for (cpnt1 = cpnt; *cpnt1 != '\0'; cpnt1++) + { + if (*cpnt1 == '/') + { + sl_bytes += 4; + } + else + { + sl_bytes += 1; + } + } + if (sl_bytes > 250) + { + /* + * the symbolic link won't fit into one SL System Use Field + * print an error message and continue with splited one + */ + fprintf(stderr,"symbolic link ``%s'' to long for one SL System Use Field, splitting", cpnt); + } + if(MAYBE_ADD_CE_ENTRY(SL_SIZE + sl_bytes)) add_CE_entry(); + } + while(nchar){ if(MAYBE_ADD_CE_ENTRY(SL_SIZE)) add_CE_entry(); Rock[ipnt++] ='S'; @@ -309,15 +335,18 @@ int deep_opt; } else { /* If we do not have enough room for a component, start a new continuations segment now */ - if(MAYBE_ADD_CE_ENTRY(6)) { - add_CE_entry(); - if(cpnt1){ - *cpnt1 = '/'; - nchar++; - cpnt1 = NULL; /* A kluge so that we can restart properly */ - } - break; - } + if(split_SL_component ? MAYBE_ADD_CE_ENTRY(6) : + MAYBE_ADD_CE_ENTRY(6 + strlen ((char *) cpnt))) + { + add_CE_entry(); + if(cpnt1) + { + *cpnt1 = '/'; + nchar++; + cpnt1 = NULL; /* A kluge so that we can restart properly */ + } + break; + } j0 = strlen((char *) cpnt); while(j0) { j1 = j0; diff --git a/util/mkisofs/tree.c b/util/mkisofs/tree.c index 7180905df..e5ddbb365 100644 --- a/util/mkisofs/tree.c +++ b/util/mkisofs/tree.c @@ -20,7 +20,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: tree.c,v 1.9.1.2 1998/06/02 03:17:31 eric Exp $"; +static char rcsid[] ="$Id: tree.c,v 1.26 1998/06/02 03:14:58 eric Exp $"; /* ADD_FILES changes made by Ross Biro biro@yggdrasil.com 2/23/95 */ @@ -88,6 +88,9 @@ extern char * strdup(const char *); #endif static unsigned char symlink_buff[256]; +static void DECL(attach_dot_entries, (struct directory * dirnode, + struct stat * parent_stat)); +static void DECL(delete_directory, (struct directory * parent, struct directory * child)); extern int verbose; @@ -112,7 +115,9 @@ FDECL1(stat_fix, struct stat *, st) * are useless, and with uid+gid 0 don't want set-id bits, either). */ st->st_mode |= 0444; +#ifndef _WIN32 /* make all file "executable" */ if (st->st_mode & 0111) +#endif /* _WIN32 */ st->st_mode |= 0111; st->st_mode &= ~07222; } @@ -135,11 +140,10 @@ FDECL2(lstat_filter, char *, path, struct stat *, st) return result; } -void FDECL1(sort_n_finish, struct directory *, this_dir) +static int FDECL1(sort_n_finish, struct directory *, this_dir) { struct directory_entry * s_entry; struct directory_entry * s_entry1; - time_t current_time; struct directory_entry * table; int count; int d1; @@ -147,6 +151,7 @@ void FDECL1(sort_n_finish, struct directory *, this_dir) int d3; int new_reclen; char * c; + int status = 0; int tablesize = 0; char newname[34]; char rootname[34]; @@ -156,14 +161,17 @@ void FDECL1(sort_n_finish, struct directory *, this_dir) table = NULL; - if(fstatbuf.st_ctime == 0) + init_fstatbuf(); + + /* + * If we had artificially created this directory, then we might be + * missing the required '.' entries. Create these now if we need + * them. + */ + if( (this_dir->dir_flags & (DIR_HAS_DOT | DIR_HAS_DOTDOT)) != + (DIR_HAS_DOT | DIR_HAS_DOTDOT) ) { - time (¤t_time); - fstatbuf.st_uid = 0; - fstatbuf.st_gid = 0; - fstatbuf.st_ctime = current_time; - fstatbuf.st_mtime = current_time; - fstatbuf.st_atime = current_time; + attach_dot_entries(this_dir, &fstatbuf); } flush_file_hash(); @@ -253,7 +261,12 @@ got_valid_name: */ if(s_entry->priority < s_entry1->priority) { - fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname, this_dir->whole_name, SPATH_SEPARATOR, s_entry->name, s_entry1->name); + if( verbose > 0 ) + { + fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname, + this_dir->whole_name, SPATH_SEPARATOR, + s_entry->name, s_entry1->name); + } s_entry->isorec.name_len[0] = strlen(newname); new_reclen = sizeof(struct iso_directory_record) - sizeof(s_entry->isorec.name) + @@ -270,7 +283,12 @@ got_valid_name: else { delete_file_hash(s_entry1); - fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname, this_dir->whole_name, SPATH_SEPARATOR, s_entry1->name, s_entry->name); + if( verbose > 0 ) + { + fprintf(stderr,"Using %s for %s%s%s (%s)\n", newname, + this_dir->whole_name, SPATH_SEPARATOR, + s_entry1->name, s_entry->name); + } s_entry1->isorec.name_len[0] = strlen(newname); new_reclen = sizeof(struct iso_directory_record) - sizeof(s_entry1->isorec.name) + @@ -324,6 +342,9 @@ got_valid_name: set_733((char *) table->isorec.size, tablesize); table->size = tablesize; table->filedir = this_dir; +#ifdef ERIC_neverdef + table->de_flags |= INHIBIT_JOLIET_ENTRY; +#endif table->name = strdup(""); table->table = (char *) e_malloc(ROUND_UP(tablesize)); memset(table->table, 0, ROUND_UP(tablesize)); @@ -339,10 +360,17 @@ got_valid_name: } } + /* + * We have now chosen the 8.3 names and we should now know the length + * of every entry in the directory. + */ for(s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { new_reclen = strlen(s_entry->isorec.name); + /* + * First update the path table sizes for directories. + */ if(s_entry->isorec.flags[0] == 2) { if (strcmp(s_entry->name,".") && strcmp(s_entry->name,"..")) @@ -354,7 +382,9 @@ got_valid_name: { new_reclen = 1; if (this_dir == root && strlen(s_entry->name) == 1) - path_table_size += sizeof(struct iso_path_table); + { + path_table_size += sizeof(struct iso_path_table); + } } } if(path_table_size & 1) path_table_size++; /* For odd lengths we pad */ @@ -380,8 +410,17 @@ got_valid_name: s_entry->isorec.length[0] = new_reclen; } - sort_directory(&this_dir->contents); + status = sort_directory(&this_dir->contents); + if( status > 0 ) + { + fprintf(stderr, "Unable to sort directory %s\n", + this_dir->whole_name); + } + /* + * If we are filling out a TRANS.TBL, generate the entries that will + * go in the thing. + */ if(table) { count = 0; @@ -390,10 +429,15 @@ got_valid_name: if(!s_entry->table) continue; if(strcmp(s_entry->name, ".") == 0 || strcmp(s_entry->name, "..") == 0) continue; - +#if (defined(__sun) && !defined(__svr4__)) + count += strlen(sprintf(table->table + count, "%c %-34s%s", + s_entry->table[0], + s_entry->isorec.name, s_entry->table+1)); +#else count += sprintf(table->table + count, "%c %-34s%s", s_entry->table[0], s_entry->isorec.name, s_entry->table+1); +#endif /* __sun && !__svr4__ */ free(s_entry->table); s_entry->table = NULL; } @@ -419,7 +463,7 @@ got_valid_name: this_dir->size = (this_dir->size + (SECTOR_SIZE - 1)) & ~(SECTOR_SIZE - 1); this_dir->size += new_reclen; - + /* See if continuation entries were used on disc */ if(use_RockRidge && s_entry->rr_attr_size != s_entry->total_rr_attr_size) @@ -455,11 +499,11 @@ got_valid_name: } s_entry = s_entry->next; } + return status; } static void generate_reloc_directory() { - int new_reclen; time_t current_time; struct directory_entry *s_entry; @@ -476,7 +520,6 @@ static void generate_reloc_directory() reloc_dir->de_name = strdup("rr_moved"); reloc_dir->extent = 0; - new_reclen = strlen(reloc_dir->de_name); /* Now create an actual directory entry */ s_entry = (struct directory_entry *) @@ -485,6 +528,12 @@ static void generate_reloc_directory() s_entry->next = root->contents; reloc_dir->self = s_entry; + /* + * The rr_moved entry will not appear in the Joliet tree. + */ + reloc_dir->dir_flags |= INHIBIT_JOLIET_ENTRY; + s_entry->de_flags |= INHIBIT_JOLIET_ENTRY; + root->contents = s_entry; root->contents->name = strdup(reloc_dir->de_name); root->contents->filedir = root; @@ -506,57 +555,134 @@ static void generate_reloc_directory() /* Now create the . and .. entries in rr_moved */ /* Now create an actual directory entry */ - s_entry = (struct directory_entry *) - e_malloc(sizeof (struct directory_entry)); - memcpy(s_entry, root->contents, - sizeof(struct directory_entry)); - s_entry->name = strdup("."); - iso9660_file_length (".", s_entry, 1); - - s_entry->filedir = reloc_dir; - reloc_dir->contents = s_entry; - - if(use_RockRidge){ - fstatbuf.st_mode = 0555 | S_IFDIR; - fstatbuf.st_nlink = 2; - generate_rock_ridge_attributes("", - ".", s_entry, - &fstatbuf, &fstatbuf, 0); - }; - - s_entry = (struct directory_entry *) - e_malloc(sizeof (struct directory_entry)); - memcpy(s_entry, root->contents, - sizeof(struct directory_entry)); - s_entry->name = strdup(".."); - iso9660_file_length ("..", s_entry, 1); - s_entry->filedir = root; - reloc_dir->contents->next = s_entry; - reloc_dir->contents->next->next = NULL; - if(use_RockRidge){ - fstatbuf.st_mode = 0555 | S_IFDIR; - fstatbuf.st_nlink = 2; - generate_rock_ridge_attributes("", - "..", s_entry, - &root_statbuf, &root_statbuf, 0); - }; + attach_dot_entries(reloc_dir, &root_statbuf); } -static void FDECL1(increment_nlink, struct directory_entry *, s_entry){ - unsigned char * pnt; - int len, nlink; +/* + * Function: attach_dot_entries + * + * Purpose: Create . and .. entries for a new directory. + * + * Notes: Only used for artificial directories that + * we are creating. + */ +static void FDECL2(attach_dot_entries, struct directory *, dirnode, + struct stat *, parent_stat) +{ + struct directory_entry *s_entry; + struct directory_entry *orig_contents; + int deep_flag = 0; - pnt = s_entry->rr_attributes; - len = s_entry->total_rr_attr_size; - while(len){ - if(pnt[0] == 'P' && pnt[1] == 'X') { - nlink = get_733((char *) pnt+12); - set_733((char *) pnt+12, nlink+1); - break; - }; - len -= pnt[2]; - pnt += pnt[2]; - }; + init_fstatbuf(); + + orig_contents = dirnode->contents; + + if( (dirnode->dir_flags & DIR_HAS_DOTDOT) == 0 ) + { + s_entry = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memcpy(s_entry, dirnode->self, + sizeof(struct directory_entry)); + s_entry->name = strdup(".."); + s_entry->whole_name = NULL; + s_entry->isorec.name_len[0] = 1; + s_entry->isorec.flags[0] = 2; /* Mark as a directory */ + iso9660_file_length ("..", s_entry, 1); + iso9660_date(s_entry->isorec.date, fstatbuf.st_mtime); + s_entry->filedir = dirnode->parent; + + dirnode->contents = s_entry; + dirnode->contents->next = orig_contents; + orig_contents = s_entry; + + if(use_RockRidge) + { + if( parent_stat == NULL ) + { + parent_stat = &fstatbuf; + } + generate_rock_ridge_attributes("", + "..", s_entry, + parent_stat, + parent_stat, 0); + } + dirnode->dir_flags |= DIR_HAS_DOTDOT; + } + + if( (dirnode->dir_flags & DIR_HAS_DOT) == 0 ) + { + s_entry = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memcpy(s_entry, dirnode->self, + sizeof(struct directory_entry)); + s_entry->name = strdup("."); + s_entry->whole_name = NULL; + s_entry->isorec.name_len[0] = 1; + s_entry->isorec.flags[0] = 2; /* Mark as a directory */ + iso9660_file_length (".", s_entry, 1); + iso9660_date(s_entry->isorec.date, fstatbuf.st_mtime); + s_entry->filedir = dirnode; + + dirnode->contents = s_entry; + dirnode->contents->next = orig_contents; + + if(use_RockRidge) + { + fstatbuf.st_mode = 0555 | S_IFDIR; + fstatbuf.st_nlink = 2; + + if( dirnode == root ) + { + deep_flag |= NEED_CE | NEED_SP; /* For extension record */ + } + + generate_rock_ridge_attributes("", + ".", s_entry, + &fstatbuf, &fstatbuf, deep_flag); + } + + dirnode->dir_flags |= DIR_HAS_DOT; + } + +} + +static void FDECL2(update_nlink, struct directory_entry *, s_entry, int, value) +{ + unsigned char * pnt; + int len; + + pnt = s_entry->rr_attributes; + len = s_entry->total_rr_attr_size; + while(len) + { + if(pnt[0] == 'P' && pnt[1] == 'X') + { + set_733((char *) pnt+12, value); + break; + } + len -= pnt[2]; + pnt += pnt[2]; + } +} + +static void FDECL1(increment_nlink, struct directory_entry *, s_entry) +{ + unsigned char * pnt; + int len, nlink; + + pnt = s_entry->rr_attributes; + len = s_entry->total_rr_attr_size; + while(len) + { + if(pnt[0] == 'P' && pnt[1] == 'X') + { + nlink = get_733((char *) pnt+12); + set_733((char *) pnt+12, nlink+1); + break; + } + len -= pnt[2]; + pnt += pnt[2]; + } } void finish_cl_pl_entries(){ @@ -601,29 +727,25 @@ void finish_cl_pl_entries(){ }; } -/* - * This function scans the directory tree, looking for files, and it makes - * note of everything that is found. We also begin to construct the ISO9660 - * directory entries, so that we can determine how large each directory is. +/* + * Function: scan_directory_tree + * + * Purpose: Walk through a directory on the local machine + * filter those things we don't want to include + * and build our representation of a dir. + * + * Notes: */ - int -FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de, - struct iso_directory_record *, mrootp){ +FDECL3(scan_directory_tree,struct directory *, this_dir, + char *, path, + struct directory_entry *, de) +{ DIR * current_dir; char whole_path[1024]; struct dirent * d_entry; - struct directory_entry * s_entry, *s_entry1; - struct directory * this_dir, *next_brother, *parent; - struct stat statbuf, lstatbuf; - int status, dflag; - int lstatus; - int n_orig; - struct directory_entry **orig_contents = NULL; - struct directory_entry * odpnt = NULL; - char * cpnt; - int new_reclen; - int deep_flag; + struct directory * parent; + int dflag; char * old_path; current_dir = opendir(path); @@ -634,14 +756,15 @@ FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de, old_path = path; - if(current_dir) d_entry = readdir_add_files(&path, old_path, current_dir); + if(current_dir) d_entry = readdir(current_dir); - if(!current_dir || !d_entry) { - fprintf(stderr,"Unable to open directory %s\n", path); - de->isorec.flags[0] &= ~2; /* Mark as not a directory */ - if(current_dir) closedir(current_dir); - return 0; - }; + if(!current_dir || !d_entry) + { + fprintf(stderr,"Unable to open directory %s\n", path); + de->isorec.flags[0] &= ~2; /* Mark as not a directory */ + if(current_dir) closedir(current_dir); + return 0; + } parent = de->filedir; /* Set up the struct for the current directory, and insert it into the @@ -651,77 +774,16 @@ FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de, vms_path_fixup(path); #endif - this_dir = (struct directory *) e_malloc(sizeof(struct directory)); - this_dir->next = NULL; - new_reclen = 0; - this_dir->subdir = NULL; - this_dir->self = de; - this_dir->contents = NULL; - this_dir->whole_name = strdup(path); - cpnt = strrchr(path, PATH_SEPARATOR); - if(cpnt) - cpnt++; - else - cpnt = path; - this_dir->de_name = strdup(cpnt); - this_dir->size = 0; - this_dir->extent = 0; - - if(!parent || parent == root){ - if (!root) { - root = this_dir; /* First time through for root directory only */ - root->depth = 0; - root->parent = root; - } else { - this_dir->depth = 1; - if(!root->subdir) - root->subdir = this_dir; - else { - next_brother = root->subdir; - while(next_brother->next) next_brother = next_brother->next; - next_brother->next = this_dir; - }; - this_dir->parent = parent; - }; - } else { - /* Come through here for normal traversal of tree */ -#ifdef DEBUG - fprintf(stderr,"%s(%d) ", path, this_dir->depth); -#endif - if(parent->depth > RR_relocation_depth) { - fprintf(stderr,"Directories too deep %s\n", path); - exit(1); - }; - - this_dir->parent = parent; - this_dir->depth = parent->depth + 1; - - if(!parent->subdir) - parent->subdir = this_dir; - else { - next_brother = parent->subdir; - while(next_brother->next) next_brother = next_brother->next; - next_brother->next = this_dir; - } - } - - /* - * Parse the same directory in the image that we are merging - * for multisession stuff. + + /* + * Now we scan the directory itself, and look at what is inside of it. */ - if( mrootp != NULL ) - { - orig_contents = read_merging_directory(mrootp, &n_orig); - } - -/* Now we scan the directory itself, and look at what is inside of it. */ - dflag = 0; while(1==1){ /* The first time through, skip this, since we already asked for the first entry when we opened the directory. */ - if(dflag) d_entry = readdir_add_files(&path, old_path, current_dir); + if(dflag) d_entry = readdir(current_dir); dflag++; if(!d_entry) break; @@ -730,9 +792,16 @@ FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de, /* If we do not want all files, then pitch the backups. */ if(!all_files){ - if(strchr(d_entry->d_name,'~')) continue; - if(strchr(d_entry->d_name,'#')) continue; - }; + if( strchr(d_entry->d_name,'~') + || strchr(d_entry->d_name,'#')) + { + if( verbose > 0 ) + { + fprintf(stderr, "Ignoring file %s\n", d_entry->d_name); + } + continue; + } + } if(strlen(path)+strlen(d_entry->d_name) + 2 > sizeof(whole_path)){ fprintf(stderr, "Overflow of stat buffer\n"); @@ -747,16 +816,9 @@ FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de, #endif strcat(whole_path, d_entry->d_name); - /* Should we exclude this file? */ - if (is_excluded(whole_path)) { - if (verbose) { - fprintf(stderr, "Excluded: %s\n",whole_path); - } - continue; - } /** Should we exclude this file ? */ - if (matches(d_entry->d_name)) { - if (verbose) { + if (matches(d_entry->d_name) || matches(whole_path)) { + if (verbose > 1) { fprintf(stderr, "Excluded by match: %s\n", whole_path); } continue; @@ -770,402 +832,498 @@ FDECL3(scan_directory_tree,char *, path, struct directory_entry *, de, * versions of these files, and we need to ignore any * originals that we might have found. */ - if (verbose) + if (verbose > 1) { fprintf(stderr, "Excluded: %s\n",whole_path); } continue; } -#if 0 - if (verbose) fprintf(stderr, "%s\n",whole_path); -#endif - status = stat_filter(whole_path, &statbuf); - - lstatus = lstat_filter(whole_path, &lstatbuf); - - if( (status == -1) && (lstatus == -1) ) + /* + * If we already have a '.' or a '..' entry, then don't + * insert new ones. + */ + if( strcmp(d_entry->d_name, ".") == 0 + && this_dir->dir_flags & DIR_HAS_DOT ) { - /* - * This means that the file doesn't exist, or isn't accessible. - * Sometimes this is because of NFS permissions problems - * or it could mean that the user has attempted to 'add' something - * with the -i option and the directory being added doesn't exist. - */ - fprintf(stderr, "Non-existant or inaccessible: %s\n",whole_path); continue; } - if(this_dir == root && strcmp(d_entry->d_name, ".") == 0) - root_statbuf = statbuf; /* Save this for later on */ - - /* We do this to make sure that the root entries are consistent */ - if(this_dir == root && strcmp(d_entry->d_name, "..") == 0) { - statbuf = root_statbuf; - lstatbuf = root_statbuf; - }; - - if(S_ISLNK(lstatbuf.st_mode)){ - - /* Here we decide how to handle the symbolic links. Here - we handle the general case - if we are not following - links or there is an error, then we must change - something. If RR is in use, it is easy, we let RR - describe the file. If not, then we punt the file. */ - - if((status || !follow_links)){ - if(use_RockRidge){ - status = 0; - statbuf.st_size = 0; - STAT_INODE(statbuf) = UNCACHED_INODE; - statbuf.st_dev = (dev_t) UNCACHED_DEVICE; - statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; - } else { - if(follow_links) fprintf(stderr, - "Unable to stat file %s - ignoring and continuing.\n", - whole_path); - else fprintf(stderr, - "Symlink %s ignored - continuing.\n", - whole_path); - continue; /* Non Rock Ridge discs - ignore all symlinks */ - }; - } - - /* Here we handle a different kind of case. Here we have - a symlink, but we want to follow symlinks. If we run - across a directory loop, then we need to pretend that - we are not following symlinks for this file. If this - is the first time we have seen this, then make this - seem as if there was no symlink there in the first - place */ - - if( follow_links - && S_ISDIR(statbuf.st_mode) ) - { - if( strcmp(d_entry->d_name, ".") - && strcmp(d_entry->d_name, "..") ) - { - if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) - { - if(!use_RockRidge) - { - fprintf(stderr, "Already cached directory seen (%s)\n", - whole_path); - continue; - } - statbuf.st_size = 0; - STAT_INODE(statbuf) = UNCACHED_INODE; - statbuf.st_dev = (dev_t) UNCACHED_DEVICE; - statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; - } else { - lstatbuf = statbuf; - add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); - } - } - } - - /* - * For non-directories, we just copy the stat information over - * so we correctly include this file. - */ - if( follow_links - && !S_ISDIR(statbuf.st_mode) ) - { - lstatbuf = statbuf; - } - } - - /* - * Add directories to the cache so that we don't waste space even - * if we are supposed to be following symlinks. - */ - if( follow_links - && strcmp(d_entry->d_name, ".") - && strcmp(d_entry->d_name, "..") - && S_ISDIR(statbuf.st_mode) ) - { - add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); - } -#ifdef VMS - if(!S_ISDIR(lstatbuf.st_mode) && (statbuf.st_fab_rfm != FAB$C_FIX && - statbuf.st_fab_rfm != FAB$C_STMLF)) { - fprintf(stderr,"Warning - file %s has an unsupported VMS record" - " format (%d)\n", - whole_path, statbuf.st_fab_rfm); - } -#endif - - if(S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK))){ - fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n", - whole_path, errno); - continue; - } - - /* Add this so that we can detect directory loops with hard links. - If we are set up to follow symlinks, then we skip this checking. */ - if( !follow_links - && S_ISDIR(lstatbuf.st_mode) - && strcmp(d_entry->d_name, ".") - && strcmp(d_entry->d_name, "..") ) + if( strcmp(d_entry->d_name, "..") == 0 + && this_dir->dir_flags & DIR_HAS_DOTDOT ) { - if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) { - fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n", - whole_path, (unsigned long) statbuf.st_dev, - (unsigned long) STAT_INODE(statbuf)); - exit(1); - }; - add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); - }; - - if (!S_ISCHR(lstatbuf.st_mode) && !S_ISBLK(lstatbuf.st_mode) && - !S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode) - && !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) && - !S_ISDIR(lstatbuf.st_mode)) { - fprintf(stderr,"Unknown file type %s - ignoring and continuing.\n", - whole_path); - continue; - }; - - /* Who knows what trash this is - ignore and continue */ - - if(status) { - fprintf(stderr, - "Unable to stat file %s - ignoring and continuing.\n", - whole_path); - continue; - }; - - s_entry = (struct directory_entry *) - e_malloc(sizeof (struct directory_entry)); - s_entry->next = this_dir->contents; - memset(s_entry->isorec.extent, 0, 8); - this_dir->contents = s_entry; - deep_flag = 0; - s_entry->table = NULL; - - s_entry->name = strdup(d_entry->d_name); - s_entry->whole_name = strdup (whole_path); - - s_entry->de_flags = 0; - s_entry->filedir = this_dir; - s_entry->isorec.flags[0] = 0; - s_entry->isorec.ext_attr_length[0] = 0; - iso9660_date(s_entry->isorec.date, statbuf.st_mtime); - s_entry->isorec.file_unit_size[0] = 0; - s_entry->isorec.interleave[0] = 0; - if(parent && parent == reloc_dir && strcmp(d_entry->d_name, "..") == 0){ - s_entry->inode = UNCACHED_INODE; - s_entry->dev = (dev_t) UNCACHED_DEVICE; - deep_flag = NEED_PL; - } else { - s_entry->inode = STAT_INODE(statbuf); - s_entry->dev = statbuf.st_dev; - }; - set_723(s_entry->isorec.volume_sequence_number, DEF_VSN); - iso9660_file_length(d_entry->d_name, s_entry, S_ISDIR(statbuf.st_mode)); - s_entry->rr_attr_size = 0; - s_entry->total_rr_attr_size = 0; - s_entry->rr_attributes = NULL; - - /* Directories are assigned sizes later on */ - if (!S_ISDIR(statbuf.st_mode)) { - set_733((char *) s_entry->isorec.size, statbuf.st_size); - - if (S_ISCHR(lstatbuf.st_mode) || S_ISBLK(lstatbuf.st_mode) || - S_ISFIFO(lstatbuf.st_mode) || S_ISSOCK(lstatbuf.st_mode) - || S_ISLNK(lstatbuf.st_mode)) - s_entry->size = 0; - else - s_entry->size = statbuf.st_size; - } else - s_entry->isorec.flags[0] = 2; - - /* - * We always should create an entirely new directory tree whenever - * we generate a new session, unless there were *no* changes whatsoever - * to any of the directories, in which case it would be kind of pointless - * to generate a new session. - * - * I believe it is possible to rigorously prove that any change anywhere - * in the filesystem will force the entire tree to be regenerated - * because the modified directory will get a new extent number. Since - * each subdirectory of the changed directory has a '..' entry, all of - * them will need to be rewritten too, and since the parent directory - * of the modified directory will have an extent pointer to the directory - * it too will need to be rewritten. Thus we will never be able to reuse - * any directory information when writing new sessions. - * - * We still check the previous session so we can mark off the equivalent - * entry in the list we got from the original disc, however. - */ - if(S_ISDIR(statbuf.st_mode) && orig_contents != NULL){ - check_prev_session(orig_contents, n_orig, s_entry, - &statbuf, &lstatbuf, &odpnt); - } - - if (strcmp(d_entry->d_name,".") && strcmp(d_entry->d_name,"..") && - S_ISDIR(statbuf.st_mode) && this_dir->depth > RR_relocation_depth){ - if(!reloc_dir) generate_reloc_directory(); - - s_entry1 = (struct directory_entry *) - e_malloc(sizeof (struct directory_entry)); - memcpy(s_entry1, this_dir->contents, - sizeof(struct directory_entry)); - s_entry1->table = NULL; - s_entry1->name = strdup(this_dir->contents->name); - s_entry1->whole_name = strdup(this_dir->contents->whole_name); - s_entry1->next = reloc_dir->contents; - reloc_dir->contents = s_entry1; - s_entry1->priority = 32768; - s_entry1->parent_rec = this_dir->contents; - - deep_flag = NEED_RE; - - if(use_RockRidge) { - generate_rock_ridge_attributes(whole_path, - d_entry->d_name, s_entry1, - &statbuf, &lstatbuf, deep_flag); - } - - deep_flag = 0; - - /* We need to set this temporarily so that the parent to this is correctly - determined. */ - s_entry1->filedir = reloc_dir; - if( odpnt != NULL ) - { - scan_directory_tree(whole_path, s_entry1, &odpnt->isorec); - } - else - { - scan_directory_tree(whole_path, s_entry1, NULL); - } - if( odpnt != NULL ) - { - free(odpnt); - odpnt = NULL; - } - s_entry1->filedir = this_dir; - - statbuf.st_size = 0; - statbuf.st_mode &= 0777; - set_733((char *) s_entry->isorec.size, 0); - s_entry->size = 0; - s_entry->isorec.flags[0] = 0; - s_entry->inode = UNCACHED_INODE; - deep_flag = NEED_CL; - }; - - if(generate_tables && strcmp(s_entry->name, ".") && strcmp(s_entry->name, "..")) { - char buffer[2048]; - int nchar; - switch(lstatbuf.st_mode & S_IFMT){ - case S_IFDIR: - sprintf(buffer,"D\t%s\n", - s_entry->name); - break; -#ifndef NON_UNIXFS - case S_IFBLK: - sprintf(buffer,"B\t%s\t%lu %lu\n", - s_entry->name, - (unsigned long) major(statbuf.st_rdev), - (unsigned long) minor(statbuf.st_rdev)); - break; - case S_IFIFO: - sprintf(buffer,"P\t%s\n", - s_entry->name); - break; - case S_IFCHR: - sprintf(buffer,"C\t%s\t%lu %lu\n", - s_entry->name, - (unsigned long) major(statbuf.st_rdev), - (unsigned long) minor(statbuf.st_rdev)); - break; - case S_IFLNK: - nchar = readlink(whole_path, - symlink_buff, - sizeof(symlink_buff)); - symlink_buff[nchar < 0 ? 0 : nchar] = 0; - sprintf(buffer,"L\t%s\t%s\n", - s_entry->name, symlink_buff); - break; -#ifdef S_IFSOCK - case S_IFSOCK: - sprintf(buffer,"S\t%s\n", - s_entry->name); - break; -#endif -#endif /* NON_UNIXFS */ - case S_IFREG: - default: - sprintf(buffer,"F\t%s\n", - s_entry->name); - break; - }; - s_entry->table = strdup(buffer); - }; - - /* - * See if we have an entry for this guy in the previous session. - */ - if( orig_contents != NULL && !S_ISDIR(statbuf.st_mode)) - { - check_prev_session(orig_contents, n_orig, s_entry, - &statbuf, &lstatbuf, NULL); + continue; } - if(S_ISDIR(statbuf.st_mode)){ - int dflag; - if (strcmp(d_entry->d_name,".") && strcmp(d_entry->d_name,"..")) { - if( odpnt != NULL ) +#if 0 + if (verbose > 1) fprintf(stderr, "%s\n",whole_path); +#endif + /* + * This actually adds the entry to the directory in question. + */ + insert_file_entry(this_dir, whole_path, d_entry->d_name); + } + closedir(current_dir); + + return 1; +} + + +/* + * Function: insert_file_entry + * + * Purpose: Insert one entry into our directory node. + * + * Note: + * This function inserts a single entry into the directory. It + * is assumed that all filtering and decision making regarding what + * we want to include has already been made, so the purpose of this + * is to insert one entry (file, link, dir, etc), into this directory. + * Note that if the entry is a dir (or if we are following links, + * and the thing it points to is a dir), then we will scan those + * trees before we return. + */ +int +FDECL3(insert_file_entry,struct directory *, this_dir, + char *, whole_path, + char *, short_name) +{ + struct stat statbuf, lstatbuf; + struct directory_entry * s_entry, *s_entry1; + int lstatus; + int status; + int deep_flag; + + status = stat_filter(whole_path, &statbuf); + + lstatus = lstat_filter(whole_path, &lstatbuf); + + if( (status == -1) && (lstatus == -1) ) + { + /* + * This means that the file doesn't exist, or isn't accessible. + * Sometimes this is because of NFS permissions problems. + */ + fprintf(stderr, "Non-existant or inaccessible: %s\n",whole_path); + return 0; + } + + if(this_dir == root && strcmp(short_name, ".") == 0) + root_statbuf = statbuf; /* Save this for later on */ + + /* We do this to make sure that the root entries are consistent */ + if(this_dir == root && strcmp(short_name, "..") == 0) + { + statbuf = root_statbuf; + lstatbuf = root_statbuf; + } + + if(S_ISLNK(lstatbuf.st_mode)) + { + + /* Here we decide how to handle the symbolic links. Here + we handle the general case - if we are not following + links or there is an error, then we must change + something. If RR is in use, it is easy, we let RR + describe the file. If not, then we punt the file. */ + + if((status || !follow_links)) + { + if(use_RockRidge) + { + status = 0; + statbuf.st_size = 0; + STAT_INODE(statbuf) = UNCACHED_INODE; + statbuf.st_dev = (dev_t) UNCACHED_DEVICE; + statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; + } else { + if(follow_links) { - dflag = scan_directory_tree(whole_path, s_entry, - &odpnt->isorec); + fprintf(stderr, + "Unable to stat file %s - ignoring and continuing.\n", + whole_path); } else { - dflag = scan_directory_tree(whole_path, s_entry, NULL); + fprintf(stderr, + "Symlink %s ignored - continuing.\n", + whole_path); + return 0; /* Non Rock Ridge discs - ignore all symlinks */ } - /* If unable to scan directory, mark this as a non-directory */ - if(!dflag) - lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; - if( odpnt != NULL ) - { - free(odpnt); - odpnt = NULL; - } - } - } - - if(use_RockRidge && this_dir == root && strcmp(s_entry->name, ".") == 0) - deep_flag |= NEED_CE | NEED_SP; /* For extension record */ - - /* Now figure out how much room this file will take in the directory */ - - if(use_RockRidge) { - generate_rock_ridge_attributes(whole_path, - d_entry->d_name, s_entry, - &statbuf, &lstatbuf, deep_flag); - - } - } - closedir(current_dir); - - if( orig_contents != NULL ) - { - merge_remaining_entries(this_dir, orig_contents, n_orig); - free_mdinfo(orig_contents, n_orig); - } - - if( this_dir->contents == NULL ) - { + } + } + + /* Here we handle a different kind of case. Here we have + a symlink, but we want to follow symlinks. If we run + across a directory loop, then we need to pretend that + we are not following symlinks for this file. If this + is the first time we have seen this, then make this + seem as if there was no symlink there in the first + place */ + + if( follow_links + && S_ISDIR(statbuf.st_mode) ) + { + if( strcmp(short_name, ".") + && strcmp(short_name, "..") ) + { + if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) + { + if(!use_RockRidge) + { + fprintf(stderr, "Already cached directory seen (%s)\n", + whole_path); + return 0; + } + statbuf.st_size = 0; + STAT_INODE(statbuf) = UNCACHED_INODE; + statbuf.st_dev = (dev_t) UNCACHED_DEVICE; + statbuf.st_mode = (statbuf.st_mode & ~S_IFMT) | S_IFREG; + } + else + { + lstatbuf = statbuf; + add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); + } + } + } + /* - * This directory must have been inaccessible. + * For non-directories, we just copy the stat information over + * so we correctly include this file. */ + if( follow_links + && !S_ISDIR(statbuf.st_mode) ) + { + lstatbuf = statbuf; + } + } + + /* + * Add directories to the cache so that we don't waste space even + * if we are supposed to be following symlinks. + */ + if( follow_links + && strcmp(short_name, ".") + && strcmp(short_name, "..") + && S_ISDIR(statbuf.st_mode) ) + { + add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); + } +#ifdef VMS + if(!S_ISDIR(lstatbuf.st_mode) && (statbuf.st_fab_rfm != FAB$C_FIX && + statbuf.st_fab_rfm != FAB$C_STMLF)) { + fprintf(stderr,"Warning - file %s has an unsupported VMS record" + " format (%d)\n", + whole_path, statbuf.st_fab_rfm); + } +#endif + + if(S_ISREG(lstatbuf.st_mode) && (status = access(whole_path, R_OK))) + { + fprintf(stderr, "File %s is not readable (errno = %d) - ignoring\n", + whole_path, errno); return 0; } - sort_n_finish(this_dir); + + /* Add this so that we can detect directory loops with hard links. + If we are set up to follow symlinks, then we skip this checking. */ + if( !follow_links + && S_ISDIR(lstatbuf.st_mode) + && strcmp(short_name, ".") + && strcmp(short_name, "..") ) + { + if(find_directory_hash(statbuf.st_dev, STAT_INODE(statbuf))) { + fprintf(stderr,"Directory loop - fatal goof (%s %lx %lu).\n", + whole_path, (unsigned long) statbuf.st_dev, + (unsigned long) STAT_INODE(statbuf)); + exit(1); + } + add_directory_hash(statbuf.st_dev, STAT_INODE(statbuf)); + } + + if (!S_ISCHR(lstatbuf.st_mode) && !S_ISBLK(lstatbuf.st_mode) && + !S_ISFIFO(lstatbuf.st_mode) && !S_ISSOCK(lstatbuf.st_mode) + && !S_ISLNK(lstatbuf.st_mode) && !S_ISREG(lstatbuf.st_mode) && + !S_ISDIR(lstatbuf.st_mode)) { + fprintf(stderr,"Unknown file type %s - ignoring and continuing.\n", + whole_path); + return 0; + } + + /* Who knows what trash this is - ignore and continue */ + + if(status) + { + fprintf(stderr, + "Unable to stat file %s - ignoring and continuing.\n", + whole_path); + return 0; + } + + /* + * Check to see if we have already seen this directory node. + * If so, then we don't create a new entry for it, but we do want + * to recurse beneath it and add any new files we do find. + */ + if (S_ISDIR(statbuf.st_mode)) + { + int dflag; + + for( s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) + { + if( strcmp(s_entry->name, short_name) == 0 ) + { + break; + } + } + if ( s_entry != NULL + && strcmp(short_name,".") + && strcmp(short_name,"..")) + { + struct directory * child; + + if ( (s_entry->de_flags & RELOCATED_DIRECTORY) != 0) + { + for( s_entry = reloc_dir->contents; s_entry; s_entry = s_entry->next) + { + if( strcmp(s_entry->name, short_name) == 0 ) + { + break; + } + } + child = find_or_create_directory(reloc_dir, whole_path, + s_entry, 1); + } + else + { + child = find_or_create_directory(this_dir, whole_path, + s_entry, 1); + /* If unable to scan directory, mark this as a non-directory */ + } + dflag = scan_directory_tree(child, whole_path, s_entry); + if(!dflag) + { + lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; + } + return 0; + } + } + + s_entry = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + s_entry->next = this_dir->contents; + memset(s_entry->isorec.extent, 0, 8); + this_dir->contents = s_entry; + deep_flag = 0; + s_entry->table = NULL; + + s_entry->name = strdup(short_name); + s_entry->whole_name = strdup (whole_path); + + s_entry->de_flags = 0; + s_entry->filedir = this_dir; + s_entry->isorec.flags[0] = 0; + s_entry->isorec.ext_attr_length[0] = 0; + iso9660_date(s_entry->isorec.date, statbuf.st_mtime); + s_entry->isorec.file_unit_size[0] = 0; + s_entry->isorec.interleave[0] = 0; + if( strcmp(short_name, ".") == 0) + { + this_dir->dir_flags |= DIR_HAS_DOT; + } + + if( strcmp(short_name, "..") == 0) + { + this_dir->dir_flags |= DIR_HAS_DOTDOT; + } + + if( this_dir->parent + && this_dir->parent == reloc_dir + && strcmp(short_name, "..") == 0) + { + s_entry->inode = UNCACHED_INODE; + s_entry->dev = (dev_t) UNCACHED_DEVICE; + deep_flag = NEED_PL; + } + else + { + s_entry->inode = STAT_INODE(statbuf); + s_entry->dev = statbuf.st_dev; + } + set_723(s_entry->isorec.volume_sequence_number, DEF_VSN); + iso9660_file_length(short_name, s_entry, S_ISDIR(statbuf.st_mode)); + s_entry->rr_attr_size = 0; + s_entry->total_rr_attr_size = 0; + s_entry->rr_attributes = NULL; + + /* Directories are assigned sizes later on */ + if (!S_ISDIR(statbuf.st_mode)) + { + if (S_ISCHR(lstatbuf.st_mode) || S_ISBLK(lstatbuf.st_mode) || + S_ISFIFO(lstatbuf.st_mode) || S_ISSOCK(lstatbuf.st_mode) + || S_ISLNK(lstatbuf.st_mode)) + { + s_entry->size = 0; + statbuf.st_size = 0; + } + else + { + s_entry->size = statbuf.st_size; + } + + set_733((char *) s_entry->isorec.size, statbuf.st_size); + } + else + { + s_entry->isorec.flags[0] = 2; + } + + if (strcmp(short_name,".") && strcmp(short_name,"..") && + S_ISDIR(statbuf.st_mode) && this_dir->depth > RR_relocation_depth) + { + struct directory * child; + + if(!reloc_dir) generate_reloc_directory(); + + /* + * Replicate the entry for this directory. The old one will stay where it + * is, and it will be neutered so that it no longer looks like a directory. + * The new one will look like a directory, and it will be put in the reloc_dir. + */ + s_entry1 = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memcpy(s_entry1, s_entry, sizeof(struct directory_entry)); + s_entry1->table = NULL; + s_entry1->name = strdup(this_dir->contents->name); + s_entry1->whole_name = strdup(this_dir->contents->whole_name); + s_entry1->next = reloc_dir->contents; + reloc_dir->contents = s_entry1; + s_entry1->priority = 32768; + s_entry1->parent_rec = this_dir->contents; + + deep_flag = NEED_RE; + + if(use_RockRidge) + { + generate_rock_ridge_attributes(whole_path, + short_name, s_entry1, + &statbuf, &lstatbuf, deep_flag); + } + + deep_flag = 0; + + /* We need to set this temporarily so that the parent to this + is correctly determined. */ + s_entry1->filedir = reloc_dir; + child = find_or_create_directory(reloc_dir, whole_path, + s_entry1, 0); + scan_directory_tree(child, whole_path, s_entry1); + s_entry1->filedir = this_dir; + + statbuf.st_size = 0; + statbuf.st_mode &= 0777; + set_733((char *) s_entry->isorec.size, 0); + s_entry->size = 0; + s_entry->isorec.flags[0] = 0; + s_entry->inode = UNCACHED_INODE; + s_entry->de_flags |= RELOCATED_DIRECTORY; + deep_flag = NEED_CL; + } + + if(generate_tables + && strcmp(s_entry->name, ".") + && strcmp(s_entry->name, "..")) + { + char buffer[2048]; + int nchar; + switch(lstatbuf.st_mode & S_IFMT) + { + case S_IFDIR: + sprintf(buffer,"D\t%s\n", + s_entry->name); + break; +#ifndef NON_UNIXFS + case S_IFBLK: + sprintf(buffer,"B\t%s\t%lu %lu\n", + s_entry->name, + (unsigned long) major(statbuf.st_rdev), + (unsigned long) minor(statbuf.st_rdev)); + break; + case S_IFIFO: + sprintf(buffer,"P\t%s\n", + s_entry->name); + break; + case S_IFCHR: + sprintf(buffer,"C\t%s\t%lu %lu\n", + s_entry->name, + (unsigned long) major(statbuf.st_rdev), + (unsigned long) minor(statbuf.st_rdev)); + break; + case S_IFLNK: + nchar = readlink(whole_path, + symlink_buff, + sizeof(symlink_buff)); + symlink_buff[nchar < 0 ? 0 : nchar] = 0; + sprintf(buffer,"L\t%s\t%s\n", + s_entry->name, symlink_buff); + break; +#ifdef S_IFSOCK + case S_IFSOCK: + sprintf(buffer,"S\t%s\n", + s_entry->name); + break; +#endif +#endif /* NON_UNIXFS */ + case S_IFREG: + default: + sprintf(buffer,"F\t%s\n", + s_entry->name); + break; + }; + s_entry->table = strdup(buffer); + } + + if(S_ISDIR(statbuf.st_mode)) + { + int dflag; + if (strcmp(short_name,".") && strcmp(short_name,"..")) + { + struct directory * child; + + child = find_or_create_directory(this_dir, whole_path, + s_entry, 1); + dflag = scan_directory_tree(child, whole_path, s_entry); + + if(!dflag) + { + lstatbuf.st_mode = (lstatbuf.st_mode & ~S_IFMT) | S_IFREG; + if( child->contents == NULL ) + { + delete_directory(this_dir, child); + } + } + } + /* If unable to scan directory, mark this as a non-directory */ + } + + if(use_RockRidge && this_dir == root && strcmp(s_entry->name, ".") == 0) + { + deep_flag |= NEED_CE | NEED_SP; /* For extension record */ + } + + /* Now figure out how much room this file will take in the + directory */ + + if(use_RockRidge) + { + generate_rock_ridge_attributes(whole_path, + short_name, s_entry, + &statbuf, &lstatbuf, deep_flag); + + } + return 1; } @@ -1185,6 +1343,254 @@ void FDECL2(generate_iso9660_directories, struct directory *, node, FILE*, outfi } } +/* + * Function: find_or_create_directory + * + * Purpose: Locate a directory entry in the tree, create if needed. + * + * Arguments: + */ +struct directory * FDECL4(find_or_create_directory, struct directory *, parent, + const char *, path, + struct directory_entry *, de, int, flag) +{ + struct directory * dpnt; + struct directory_entry * orig_de; + struct directory * next_brother; + const char * cpnt; + const char * pnt; + + orig_de = de; + + pnt = strrchr(path, PATH_SEPARATOR); + if( pnt == NULL ) + { + pnt = path; + } + else + { + pnt++; + } + + if( parent != NULL ) + { + dpnt = parent->subdir; + + while (dpnt) + { + /* + * Weird hack time - if there are two directories by the + * same name in the reloc_dir, they are not treated as the + * same thing unless the entire path matches completely. + */ + if( flag && strcmp(dpnt->de_name, pnt) == 0 ) + { + return dpnt; + } + dpnt = dpnt->next; + } + } + + /* + * We don't know if we have a valid directory entry for this one + * yet. If not, we need to create one. + */ + if( de == NULL ) + { + de = (struct directory_entry *) + e_malloc(sizeof (struct directory_entry)); + memset(de, 0, sizeof(struct directory_entry)); + de->next = parent->contents; + parent->contents = de; + de->name = strdup(pnt); + de->filedir = parent; + de->isorec.flags[0] = 2; + de->priority = 32768; + de->inode = UNCACHED_INODE; + de->dev = (dev_t) UNCACHED_DEVICE; + set_723(de->isorec.volume_sequence_number, DEF_VSN); + iso9660_file_length (pnt, de, 1); + + init_fstatbuf(); + /* + * It doesn't exist for real, so we cannot add any Rock Ridge. + */ + if(use_RockRidge) + { + fstatbuf.st_mode = 0555 | S_IFDIR; + fstatbuf.st_nlink = 2; + generate_rock_ridge_attributes("", + (char *) pnt, de, + &fstatbuf, + &fstatbuf, 0); + } + iso9660_date(de->isorec.date, fstatbuf.st_mtime); + + } + + /* + * If we don't have a directory for this one yet, then allocate it + * now, and patch it into the tree in the appropriate place. + */ + dpnt = (struct directory *) e_malloc(sizeof(struct directory)); + memset(dpnt, 0, sizeof(struct directory)); + dpnt->next = NULL; + dpnt->subdir = NULL; + dpnt->self = de; + dpnt->contents = NULL; + dpnt->whole_name = strdup(path); + cpnt = strrchr(path, PATH_SEPARATOR); + if(cpnt) + cpnt++; + else + cpnt = path; + dpnt->de_name = strdup(cpnt); + dpnt->size = 0; + dpnt->extent = 0; + dpnt->jextent = 0; + dpnt->jsize = 0; + + if( orig_de == NULL ) + { + struct stat xstatbuf; + int sts; + + /* + * Now add a . and .. entry in the directory itself. + * This is a little tricky - if the real directory + * exists, we need to stat it first. Otherwise, we + * use the fictitious fstatbuf which points to the time + * at which mkisofs was started. + */ + sts = stat_filter(parent->whole_name, &xstatbuf); + if( sts == 0 ) + { + attach_dot_entries(dpnt, &xstatbuf); + } + else + { + attach_dot_entries(dpnt, &fstatbuf); + } + } + + if(!parent || parent == root) + { + if (!root) + { + root = dpnt; /* First time through for root directory only */ + root->depth = 0; + root->parent = root; + } else { + dpnt->depth = 1; + if(!root->subdir) + { + root->subdir = dpnt; + } + else + { + next_brother = root->subdir; + while(next_brother->next) next_brother = next_brother->next; + next_brother->next = dpnt; + } + dpnt->parent = parent; + } + } + else + { + /* Come through here for normal traversal of tree */ +#ifdef DEBUG + fprintf(stderr,"%s(%d) ", path, dpnt->depth); +#endif + if(parent->depth > RR_relocation_depth) + { + fprintf(stderr,"Directories too deep %s\n", path); + exit(1); + } + + dpnt->parent = parent; + dpnt->depth = parent->depth + 1; + + if(!parent->subdir) + { + parent->subdir = dpnt; + } + else + { + next_brother = parent->subdir; + while(next_brother->next) next_brother = next_brother->next; + next_brother->next = dpnt; + } + } + + return dpnt; +} + +/* + * Function: delete_directory + * + * Purpose: Locate a directory entry in the tree, create if needed. + * + * Arguments: + */ +static void FDECL2(delete_directory, struct directory *, parent, struct directory *, child) +{ + struct directory * tdir; + + if( child->contents != NULL ) + { + fprintf(stderr, "Unable to delete non-empty directory\n"); + exit(1); + } + + free(child->whole_name); + child->whole_name = NULL; + + free(child->de_name); + child->de_name = NULL; + + if( parent->subdir == child ) + { + parent->subdir = child->next; + } + else + { + for( tdir = parent->subdir; tdir->next != NULL; tdir = tdir->next ) + { + if( tdir->next == child ) + { + tdir->next = child->next; + break; + } + } + if( tdir == NULL ) + { + fprintf(stderr, "Unable to locate child directory in parent list\n"); + exit(1); + } + } + free(child); + return; +} + +int FDECL1(sort_tree, struct directory *, node){ + struct directory * dpnt; + int goof = 0; + + dpnt = node; + + while (dpnt){ + goof = sort_n_finish(dpnt); + if( goof ) + { + break; + } + + if(dpnt->subdir) sort_tree(dpnt->subdir); + dpnt = dpnt->next; + } + return goof; +} + void FDECL1(dump_tree, struct directory *, node){ struct directory * dpnt; @@ -1197,6 +1603,59 @@ void FDECL1(dump_tree, struct directory *, node){ } } +void FDECL1(update_nlink_field, struct directory *, node) +{ + struct directory * dpnt; + struct directory * xpnt; + struct directory_entry * s_entry; + int i; + + dpnt = node; + + while (dpnt) + { + /* + * First, count up the number of subdirectories this guy has. + */ + for(i=0, xpnt = dpnt->subdir; xpnt; xpnt = xpnt->next, i++) + continue; + + /* + * Next check to see if we have any relocated directories + * in this directory. The nlink field will include these + * as real directories when they are properly relocated. + * + * In the non-rockridge disk, the relocated entries appear + * as zero length files. + */ + for(s_entry = dpnt->contents; s_entry; s_entry = s_entry->next) + { + if( (s_entry->de_flags & RELOCATED_DIRECTORY) != 0 ) + { + i++; + } + } + /* + * Now update the field in the Rock Ridge entry. + */ + update_nlink(dpnt->self, i + 2); + + /* + * Update the '.' entry for this directory. + */ + update_nlink(dpnt->contents, i + 2); + + /* + * Update all of the '..' entries that point to this guy. + */ + for(xpnt = dpnt->subdir; xpnt; xpnt = xpnt->next) + update_nlink(xpnt->contents->next, i + 2); + + if(dpnt->subdir) update_nlink_field(dpnt->subdir); + dpnt = dpnt->next; + } +} + /* * something quick and dirty to locate a file given a path * recursively walks down path in filename until it finds the @@ -1232,13 +1691,13 @@ struct directory_entry * FDECL2(search_tree_file, struct directory *, *p1 = '\0'; #ifdef DEBUG_TORITO - printf("Looking for subdir called %s\n",p1); + fprintf(stderr,"Looking for subdir called %s\n",p1); #endif rest = p1+1; #ifdef DEBUG_TORITO - printf("Remainder of path name is now %s\n", rest); + fprintf(stderr,"Remainder of path name is now %s\n", rest); #endif dpnt = node->subdir; @@ -1251,7 +1710,7 @@ struct directory_entry * FDECL2(search_tree_file, struct directory *, if (!strcmp(subdir, dpnt->de_name)) { #ifdef DEBUG_TORITO - printf("Calling next level with filename = %s", rest); + fprintf(stderr,"Calling next level with filename = %s", rest); #endif return(search_tree_file( dpnt, rest )); } @@ -1276,7 +1735,7 @@ struct directory_entry * FDECL2(search_tree_file, struct directory *, if (!strcmp(filename, depnt->name)) { #ifdef DEBUG_TORITO - printf("Found our file %s", filename); + fprintf(stderr,"Found our file %s", filename); #endif return(depnt); } @@ -1290,3 +1749,25 @@ struct directory_entry * FDECL2(search_tree_file, struct directory *, fprintf(stderr,"We cant get here in search_tree_file :-/ \n"); } +void init_fstatbuf() +{ + time_t current_time; + + if(fstatbuf.st_ctime == 0) + { + time (¤t_time); + if( rationalize ) + { + fstatbuf.st_uid = 0; + fstatbuf.st_gid = 0; + } + else + { + fstatbuf.st_uid = getuid(); + fstatbuf.st_gid = getgid(); + } + fstatbuf.st_ctime = current_time; + fstatbuf.st_mtime = current_time; + fstatbuf.st_atime = current_time; + } +} diff --git a/util/mkisofs/write.c b/util/mkisofs/write.c index cfc9b763c..1976679b4 100644 --- a/util/mkisofs/write.c +++ b/util/mkisofs/write.c @@ -19,10 +19,11 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: write.c,v 1.6.1.3 1997/11/13 05:07:13 eric Exp $"; +static char rcsid[] ="$Id: write.c,v 1.18 1998/06/02 02:40:39 eric Exp $"; #include #include +#include "config.h" #include "mkisofs.h" #include "iso9660.h" #include @@ -50,15 +51,17 @@ extern char * strdup(const char *); /* Counters for statistics */ -static int table_size = 0; -static int total_dir_size = 0; -static int rockridge_size = 0; +static int table_size = 0; +static int total_dir_size = 0; +static int rockridge_size = 0; static struct directory ** pathlist; -static next_path_index = 1; +static next_path_index = 1; +static int sort_goof; -/* Used to fill in some of the information in the volume descriptor. */ -static struct tm local; -static struct tm gmt; +struct output_fragment * out_tail; +struct output_fragment * out_list; + +struct iso_primary_descriptor vol_desc; /* Routines to actually write the disc. We write sequentially so that we could write a tape, or write the disc directly */ @@ -118,8 +121,30 @@ void FDECL2(set_733, char *, pnt, unsigned int, i) void FDECL4(xfwrite, void *, buffer, int, count, int, size, FILE *, file) { - while(count) - { + /* + * This is a hack that could be made better. XXXIs this the only place? + * It is definitely needed on Operating Systems that do not + * allow to write files that are > 2GB. + * If the system is fast enough to be able to feed 1400 KB/s + * writing speed of a DVD-R drive, use stdout. + * If the system cannot do this reliable, you need to use this + * hacky option. + */ + if (split_output != 0 && ftell(file) > (1024 * 1024 * 1024) ) { + static int idx = 0; + char nbuf[128]; + + sprintf(nbuf, "part_%02d", idx++); + file = freopen(nbuf, "w", file); + if (file == NULL) { + fprintf(stderr, "Cannot open '%s'.\n", nbuf); + exit(1); + } + + } + + while(count) + { int got = fwrite(buffer,size,count,file); if(got<=0) @@ -142,11 +167,7 @@ struct deferred_write static struct deferred_write * dw_head = NULL, * dw_tail = NULL; -static struct directory_entry * sort_dir; -static struct eltorito_boot_descriptor boot_desc; - unsigned int last_extent_written =0; -static struct iso_primary_descriptor vol_desc; static path_table_index; static time_t begun; @@ -154,7 +175,7 @@ static time_t begun; numbers to them. We have already assigned extent numbers to everything that goes in front of them */ -void FDECL1(assign_directory_addresses, struct directory *, node) +static int FDECL1(assign_directory_addresses, struct directory *, node) { int dir_size; struct directory * dpnt; @@ -193,6 +214,7 @@ void FDECL1(assign_directory_addresses, struct directory *, node) dpnt = dpnt->next; } + return 0; } static void FDECL3(write_one_file, char *, filename, @@ -222,8 +244,8 @@ static void FDECL3(write_one_file, char *, filename, memset(buffer, 0, use); if (fread(buffer, 1, use, infile) == 0) { - fprintf(stderr,"cannot read from %s\n",filename); - exit(1); + fprintf(stderr,"cannot read from %s\n",filename); + exit(1); } xfwrite(buffer, 1, use, outfile); last_extent_written += use/SECTOR_SIZE; @@ -296,7 +318,7 @@ static void dump_filelist() } #endif -int FDECL2(compare_dirs, const void *, rr, const void *, ll) +static int FDECL2(compare_dirs, const void *, rr, const void *, ll) { char * rpnt, *lpnt; struct directory_entry ** r, **l; @@ -305,11 +327,24 @@ int FDECL2(compare_dirs, const void *, rr, const void *, ll) l = (struct directory_entry **) ll; rpnt = (*r)->isorec.name; lpnt = (*l)->isorec.name; + + /* + * If the entries are the same, this is an error. + */ + if( strcmp(rpnt, lpnt) == 0 ) + { + sort_goof++; + } /* * Put the '.' and '..' entries on the head of the sorted list. * For normal ASCII, this always happens to be the case, but out of * band characters cause this not to be the case sometimes. + * + * FIXME(eric) - these tests seem redundant, in taht the name is + * never assigned these values. It will instead be \000 or \001, + * and thus should always be sorted correctly. I need to figure + * out why I thought I needed this in the first place. */ if( strcmp(rpnt, ".") == 0 ) return -1; if( strcmp(lpnt, ".") == 0 ) return 1; @@ -336,7 +371,15 @@ int FDECL2(compare_dirs, const void *, rr, const void *, ll) return 0; } -void FDECL1(sort_directory, struct directory_entry **, sort_dir) +/* + * Function: sort_directory + * + * Purpose: Sort the directory in the appropriate ISO9660 + * order. + * + * Notes: Returns 0 if OK, returns > 0 if an error occurred. + */ +int FDECL1(sort_directory, struct directory_entry **, sort_dir) { int dcount = 0; int i, len; @@ -350,6 +393,11 @@ void FDECL1(sort_directory, struct directory_entry **, sort_dir) s_entry = s_entry->next; } + if( dcount == 0 ) + { + return 0; + } + /* * OK, now we know how many there are. Build a vector for sorting. */ @@ -367,44 +415,52 @@ void FDECL1(sort_directory, struct directory_entry **, sort_dir) s_entry = s_entry->next; } - qsort(sortlist, dcount, sizeof(struct directory_entry *), - (int (*)(const void *, const void *))compare_dirs); - - /* - * Now reassemble the linked list in the proper sorted order + /* + * Each directory is required to contain at least . and .. */ - for(i=0; inext = sortlist[i+1]; - } + if( dcount < 2 ) + { + sort_goof = 1; + + } + else + { + sort_goof = 0; + qsort(sortlist, dcount, sizeof(struct directory_entry *), + (int (*)(const void *, const void *))compare_dirs); + + /* + * Now reassemble the linked list in the proper sorted order + */ + for(i=0; inext = sortlist[i+1]; + } + + sortlist[dcount-1]->next = NULL; + *sort_dir = sortlist[0]; + } - sortlist[dcount-1]->next = NULL; - *sort_dir = sortlist[0]; - free(sortlist); - + return sort_goof; } -void generate_root_record() +static int root_gen() { - time_t ctime; - - time (&ctime); - - local = *localtime(&ctime); - gmt = *gmtime(&ctime); + init_fstatbuf(); root_record.length[0] = 1 + sizeof(struct iso_directory_record) - sizeof(root_record.name); root_record.ext_attr_length[0] = 0; set_733((char *) root_record.extent, root->extent); set_733((char *) root_record.size, ROUND_UP(root->size)); - iso9660_date(root_record.date, ctime); + iso9660_date(root_record.date, root_statbuf.st_mtime); root_record.flags[0] = 2; root_record.file_unit_size[0] = 0; root_record.interleave[0] = 0; set_723(root_record.volume_sequence_number, DEF_VSN); root_record.name_len[0] = 1; + return 0; } static void FDECL1(assign_file_addresses, struct directory *, dpnt) @@ -439,7 +495,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt) s_hash = find_hash(s_entry->dev, s_entry->inode); if(s_hash) { - if(verbose) + if(verbose > 1) { fprintf(stderr, "Cache hit for %s%s%s\n",s_entry->filedir->de_name, SPATH_SEPARATOR, s_entry->name); @@ -562,7 +618,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt) s_entry->starting_block = last_extent; add_hash(s_entry); last_extent += ROUND_UP(s_entry->size) >> 11; - if(verbose) + if(verbose > 1) { fprintf(stderr,"%d %d %s\n", s_entry->starting_block, last_extent-1, whole_path); @@ -576,6 +632,7 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt) } #endif +#ifdef NOT_NEEDED /* Never use this code if you like to create a DVD */ if(last_extent > (800000000 >> 11)) { /* @@ -583,9 +640,10 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt) */ fprintf(stderr,"Extent overflow processing file %s\n", whole_path); fprintf(stderr,"Starting block is %d\n", s_entry->starting_block); - fprintf(stderr,"Reported file size is %d extents\n", s_entry->size); + fprintf(stderr,"Reported file size is %d bytes\n", s_entry->size); exit(1); } +#endif continue; } @@ -605,6 +663,40 @@ static void FDECL1(assign_file_addresses, struct directory *, dpnt) } } /* assign_file_addresses(... */ +static void FDECL1(free_one_directory, struct directory *, dpnt) +{ + struct directory_entry * s_entry; + struct directory_entry * s_entry_d; + + s_entry = dpnt->contents; + while(s_entry) + { + s_entry_d = s_entry; + s_entry = s_entry->next; + + if( s_entry_d->name != NULL ) + { + free (s_entry_d->name); + } + if( s_entry_d->whole_name != NULL ) + { + free (s_entry_d->whole_name); + } + free (s_entry_d); + } + dpnt->contents = NULL; +} /* free_one_directory(... */ + +static void FDECL1(free_directories, struct directory *, dpnt) +{ + while (dpnt) + { + free_one_directory(dpnt); + if(dpnt->subdir) free_directories(dpnt->subdir); + dpnt = dpnt->next; + } +} + void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile) { unsigned int ce_address = 0; @@ -743,18 +835,15 @@ void FDECL2(generate_one_directory, struct directory *, dpnt, FILE *, outfile) s_entry_d = s_entry; s_entry = s_entry->next; - if (s_entry_d->rr_attributes) free(s_entry_d->rr_attributes); - if( s_entry_d->name != NULL ) + /* + * Joliet doesn't use the Rock Ridge attributes, so we free it here. + */ + if (s_entry_d->rr_attributes) { - free (s_entry_d->name); + free(s_entry_d->rr_attributes); + s_entry_d->rr_attributes = NULL; } - if( s_entry_d->whole_name != NULL ) - { - free (s_entry_d->whole_name); - } - free (s_entry_d); } - sort_dir = NULL; if(dpnt->size != dir_index) { @@ -795,7 +884,7 @@ void FDECL1(build_pathlist, struct directory *, node) } } /* build_pathlist(... */ -int FDECL2(compare_paths, void const *, r, void const *, l) +static int FDECL2(compare_paths, void const *, r, void const *, l) { struct directory const *ll = *(struct directory * const *)l; struct directory const *rr = *(struct directory * const *)r; @@ -814,7 +903,7 @@ int FDECL2(compare_paths, void const *, r, void const *, l) } /* compare_paths(... */ -void generate_path_tables() +static int generate_path_tables() { struct directory_entry * de; struct directory * dpnt; @@ -926,6 +1015,7 @@ void generate_path_tables() path_table_index, path_table_size); } + return 0; } /* generate_path_tables(... */ void @@ -940,17 +1030,102 @@ FDECL3(memcpy_max, char *, to, char *, from, int, max) } /* memcpy_max(... */ -int FDECL1(iso_write, FILE *, outfile) +void FDECL1(outputlist_insert, struct output_fragment *, frag) +{ + if( out_tail == NULL ) + { + out_list = out_tail = frag; + } + else + { + out_tail->of_next = frag; + out_tail = frag; + } +} + +static int FDECL1(file_write, FILE *, outfile) { - char buffer[2048]; - int i; - char iso_time[17]; int should_write; - time(&begun); - assign_file_addresses(root); + /* + * OK, all done with that crap. Now write out the directories. + * This is where the fur starts to fly, because we need to keep track of + * each file as we find it and keep track of where we put it. + */ - memset(buffer, 0, sizeof(buffer)); + should_write = last_extent - session_start; + + if( print_size > 0 ) + { + fprintf(stderr,"Total extents scheduled to be written = %d\n", + last_extent - session_start); + exit(0); + } + + if( verbose > 0 ) + { +#ifdef DBG_ISO + fprintf(stderr,"Total directory extents being written = %d\n", last_extent); +#endif + + fprintf(stderr,"Total extents scheduled to be written = %d\n", + last_extent - session_start); + } + + /* + * Now write all of the files that we need. + */ + write_files(outfile); + + /* + * The rest is just fluff. + */ + if( verbose == 0 ) + { + return 0; + } + + fprintf(stderr,"Total extents actually written = %d\n", + last_extent_written - session_start); + + /* + * Hard links throw us off here + */ + if(should_write != last_extent - session_start) + { + fprintf(stderr,"Number of extents written not what was predicted. Please fix.\n"); + fprintf(stderr,"Predicted = %d, written = %d\n", should_write, last_extent); + } + + fprintf(stderr,"Total translation table size: %d\n", table_size); + fprintf(stderr,"Total rockridge attributes bytes: %d\n", rockridge_size); + fprintf(stderr,"Total directory bytes: %d\n", total_dir_size); + fprintf(stderr,"Path table size(bytes): %d\n", path_table_size); + +#ifdef DEBUG + fprintf(stderr, "next extent, last_extent, last_extent_written %d %d %d\n", + next_extent, last_extent, last_extent_written); +#endif + + return 0; + +} /* iso_write(... */ + +/* + * Function to write the PVD for the disc. + */ +static int FDECL1(pvd_write, FILE *, outfile) +{ + char iso_time[17]; + int should_write; + struct tm local; + struct tm gmt; + + + time(&begun); + + local = *localtime(&begun); + gmt = *gmtime(&begun); /* * This will break in the year 2000, I supose, but there is no good way @@ -965,17 +1140,6 @@ int FDECL1(iso_write, FILE *, outfile) local.tm_yday -= gmt.tm_yday; iso_time[16] = (local.tm_min + 60*(local.tm_hour + 24*local.tm_yday)) / 15; - /* - * First, we output 16 sectors of all zero - */ - - for(i=0; i<16; i++) - { - xfwrite(buffer, 1, sizeof(buffer), outfile); - } - - last_extent_written += 16; - /* * Next we write out the primary descriptor for the disc */ @@ -1011,7 +1175,7 @@ int FDECL1(iso_write, FILE *, outfile) * Now we copy the actual root directory record */ memcpy(vol_desc.root_directory_record, &root_record, - sizeof(struct iso_directory_record) + 1); + sizeof(struct iso_directory_record)); /* * The rest is just fluff. It looks nice to fill in many of these fields, @@ -1058,16 +1222,16 @@ int FDECL1(iso_write, FILE *, outfile) */ xfwrite(&vol_desc, 1, 2048, outfile); last_extent_written++; - if (use_eltorito) - { - /* - * Next we write out the boot volume descriptor for the disc - */ - get_torito_desc(&boot_desc); - xfwrite(&boot_desc, 1, 2048, outfile); - last_extent_written ++; - } - + return 0; +} + +/* + * Function to write the EVD for the disc. + */ +static int FDECL1(evd_write, FILE *, outfile) +{ + struct iso_primary_descriptor vol_desc; + /* * Now write the end volume descriptor. Much simpler than the other one */ @@ -1077,7 +1241,14 @@ int FDECL1(iso_write, FILE *, outfile) vol_desc.version[0] = 1; xfwrite(&vol_desc, 1, 2048, outfile); last_extent_written += 1; + return 0; +} +/* + * Function to write the EVD for the disc. + */ +static int FDECL1(pathtab_write, FILE *, outfile) +{ /* * Next we write the path tables */ @@ -1088,55 +1259,121 @@ int FDECL1(iso_write, FILE *, outfile) free(path_table_m); path_table_l = NULL; path_table_m = NULL; - - /* - * OK, all done with that crap. Now write out the directories. - * This is where the fur starts to fly, because we need to keep track of - * each file as we find it and keep track of where we put it. - */ - -#ifdef DBG_ISO - fprintf(stderr,"Total directory extents being written = %d\n", last_extent); -#endif -#if 0 - generate_one_directory(root, outfile); -#endif - generate_iso9660_directories(root, outfile); - - if(extension_record) - { - xfwrite(extension_record, 1, SECTOR_SIZE, outfile); - last_extent_written++; - } - - /* - * Now write all of the files that we need. - */ - fprintf(stderr,"Total extents scheduled to be written = %d\n", - last_extent - session_start); - write_files(outfile); - - fprintf(stderr,"Total extents actually written = %d\n", - last_extent_written - session_start); - /* - * Hard links throw us off here - */ - if(should_write != last_extent - session_start) - { - fprintf(stderr,"Number of extents written not what was predicted. Please fix.\n"); - fprintf(stderr,"Predicted = %d, written = %d\n", should_write, last_extent); - } - - fprintf(stderr,"Total translation table size: %d\n", table_size); - fprintf(stderr,"Total rockridge attributes bytes: %d\n", rockridge_size); - fprintf(stderr,"Total directory bytes: %d\n", total_dir_size); - fprintf(stderr,"Path table size(bytes): %d\n", path_table_size); - -#ifdef DEBUG - fprintf(stderr, "next extent, last_extent, last_extent_written %d %d %d\n", - next_extent, last_extent, last_extent_written); -#endif - return 0; +} -} /* iso_write(... */ +static int FDECL1(exten_write, FILE *, outfile) +{ + xfwrite(extension_record, 1, SECTOR_SIZE, outfile); + last_extent_written++; + return 0; +} + +/* + * Functions to describe padding block at the start of the disc. + */ +int FDECL1(oneblock_size, int, starting_extent) +{ + last_extent++; + return 0; +} + +/* + * Functions to describe padding block at the start of the disc. + */ +static int FDECL1(pathtab_size, int, starting_extent) +{ + path_table[0] = starting_extent; + + path_table[1] = 0; + path_table[2] = path_table[0] + path_blocks; + path_table[3] = 0; + last_extent += 2*path_blocks; + return 0; +} + +static int FDECL1(padblock_size, int, starting_extent) +{ + last_extent += 16; + return 0; +} + +static int file_gen() +{ + assign_file_addresses(root); + return 0; +} + +static int dirtree_dump() +{ + if (verbose > 1) + dump_tree(root); + return 0; +} + +static int FDECL1(dirtree_fixup, int, starting_extent) +{ + if (use_RockRidge && reloc_dir) + finish_cl_pl_entries(); + + if (use_RockRidge ) + update_nlink_field(root); + return 0; +} + +static int FDECL1(dirtree_size, int, starting_extent) +{ + assign_directory_addresses(root); + return 0; +} + +static int FDECL1(ext_size, int, starting_extent) +{ + extern int extension_record_size; + struct directory_entry * s_entry; + extension_record_extent = starting_extent; + s_entry = root->contents; + set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 24, + extension_record_extent); + set_733((char *) s_entry->rr_attributes + s_entry->rr_attr_size - 8, + extension_record_size); + last_extent++; + return 0; +} + +static int FDECL1(dirtree_write, FILE *, outfile) +{ + generate_iso9660_directories(root, outfile); + return 0; +} + +static int FDECL1(dirtree_cleanup, FILE *, outfile) +{ + free_directories(root); + return 0; +} + +static int FDECL1(padblock_write, FILE *, outfile) +{ + char buffer[2048]; + int i; + + memset(buffer, 0, sizeof(buffer)); + + for(i=0; i<16; i++) + { + xfwrite(buffer, 1, sizeof(buffer), outfile); + } + + last_extent_written += 16; + return 0; +} + +struct output_fragment padblock_desc = {NULL, padblock_size, NULL, padblock_write}; +struct output_fragment voldesc_desc = {NULL, oneblock_size, root_gen, pvd_write}; +struct output_fragment end_vol = {NULL, oneblock_size, NULL, evd_write}; +struct output_fragment pathtable_desc = {NULL, pathtab_size, generate_path_tables, pathtab_write}; +struct output_fragment dirtree_desc = {NULL, dirtree_size, NULL, dirtree_write}; +struct output_fragment dirtree_clean = {NULL, dirtree_fixup, dirtree_dump, dirtree_cleanup}; +struct output_fragment extension_desc = {NULL, ext_size, NULL, exten_write}; +struct output_fragment files_desc = {NULL, NULL, file_gen, file_write}; From 11e9a11511909eb94fbde8451552e1a8143bbe6b Mon Sep 17 00:00:00 2001 From: Robert Millan Date: Sun, 8 Nov 2009 22:52:08 +0000 Subject: [PATCH 1245/1707] Import http://www.tux.org/pub/people/eric-youngdale/mkisofs/mkisofs-1.12b5.tar.gz --- util/mkisofs/defaults.h | 8 +- util/mkisofs/eltorito.c | 11 +- util/mkisofs/exclude.h | 6 +- util/mkisofs/fnmatch.c | 26 ++-- util/mkisofs/include/fctldefs.h | 57 +++++++ util/mkisofs/include/mconfig.h | 268 ++++++++++++++++++++++++++++++++ util/mkisofs/include/prototyp.h | 74 +++++++++ util/mkisofs/include/statdefs.h | 139 +++++++++++++++++ util/mkisofs/joliet.c | 138 ++++++++++------ util/mkisofs/match.c | 93 ++++++++++- util/mkisofs/match.h | 14 +- util/mkisofs/mkisofs.c | 205 +++++++++++++++++++++--- util/mkisofs/mkisofs.h | 22 ++- util/mkisofs/multi.c | 108 ++++++++++--- util/mkisofs/name.c | 6 +- util/mkisofs/rock.c | 56 ++++--- util/mkisofs/tree.c | 173 +++++++++++++++++---- util/mkisofs/write.c | 178 ++++++++++++++------- 18 files changed, 1364 insertions(+), 218 deletions(-) create mode 100644 util/mkisofs/include/fctldefs.h create mode 100644 util/mkisofs/include/mconfig.h create mode 100644 util/mkisofs/include/prototyp.h create mode 100644 util/mkisofs/include/statdefs.h diff --git a/util/mkisofs/defaults.h b/util/mkisofs/defaults.h index 9e8f3331a..dc9ad380c 100644 --- a/util/mkisofs/defaults.h +++ b/util/mkisofs/defaults.h @@ -2,12 +2,14 @@ * Header file defaults.h - assorted default values for character strings in * the volume descriptor. * - * $Id: defaults.h,v 1.6 1998/06/02 02:40:37 eric Exp $ + * $Id: defaults.h,v 1.8 1999/03/02 03:41:25 eric Exp $ */ #define PREPARER_DEFAULT NULL #define PUBLISHER_DEFAULT NULL -#define APPID_DEFAULT NULL +#ifndef APPID_DEFAULT +#define APPID_DEFAULT "MKISOFS ISO 9660 FILESYSTEM BUILDER" +#endif #define COPYRIGHT_DEFAULT NULL #define BIBLIO_DEFAULT NULL #define ABSTRACT_DEFAULT NULL @@ -24,7 +26,7 @@ #endif #ifdef __sun -#ifdef __svr4__ +#ifdef __SVR4 #define SYSTEM_ID_DEFAULT "Solaris" #else #define SYSTEM_ID_DEFAULT "SunOS" diff --git a/util/mkisofs/eltorito.c b/util/mkisofs/eltorito.c index 3ff50e92e..b577c731d 100644 --- a/util/mkisofs/eltorito.c +++ b/util/mkisofs/eltorito.c @@ -21,7 +21,7 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: eltorito.c,v 1.12 1998/06/02 02:40:37 eric Exp $"; +static char rcsid[] ="$Id: eltorito.c,v 1.13 1999/03/02 03:41:25 eric Exp $"; #include #include @@ -44,8 +44,9 @@ static char rcsid[] ="$Id: eltorito.c,v 1.12 1998/06/02 02:40:37 eric Exp $"; static struct eltorito_validation_entry valid_desc; static struct eltorito_defaultboot_entry default_desc; -static struct eltorito_boot_descriptor boot_desc; +static struct eltorito_boot_descriptor gboot_desc; +static int tvd_write __PR((FILE * outfile)); /* * Check for presence of boot catalog. If it does not exist then make it @@ -275,13 +276,13 @@ void FDECL1(get_torito_desc, struct eltorito_boot_descriptor *, boot_desc) /* * Function to write the EVD for the disc. */ -int FDECL1(tvd_write, FILE *, outfile) +static int FDECL1(tvd_write, FILE *, outfile) { /* * Next we write out the boot volume descriptor for the disc */ - get_torito_desc(&boot_desc); - xfwrite(&boot_desc, 1, 2048, outfile); + get_torito_desc(&gboot_desc); + xfwrite(&gboot_desc, 1, 2048, outfile); last_extent_written ++; return 0; } diff --git a/util/mkisofs/exclude.h b/util/mkisofs/exclude.h index b9581a9e9..87cd6948a 100644 --- a/util/mkisofs/exclude.h +++ b/util/mkisofs/exclude.h @@ -3,8 +3,8 @@ * added 'exclude' option (-x) to specify pathnames NOT to be included in * CD image. * - * $Id: exclude.h,v 1.1 1997/02/23 15:53:19 eric Rel $ + * $Id: exclude.h,v 1.2 1999/03/02 03:41:25 eric Exp $ */ -void exclude(); -int is_excluded(); +void exclude __PR((char * fn)); +int is_excluded __PR((char * fn)); diff --git a/util/mkisofs/fnmatch.c b/util/mkisofs/fnmatch.c index cd5c0b27c..44de92e07 100644 --- a/util/mkisofs/fnmatch.c +++ b/util/mkisofs/fnmatch.c @@ -17,7 +17,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: fnmatch.c,v 1.3 1997/03/22 02:53:13 eric Rel $"; +static char rcsid[] ="$Id: fnmatch.c,v 1.4 1999/03/02 03:41:25 eric Exp $"; #ifdef HAVE_CONFIG_H #include @@ -26,6 +26,10 @@ static char rcsid[] ="$Id: fnmatch.c,v 1.3 1997/03/22 02:53:13 eric Rel $"; #include #include +#ifndef __STDC__ +#define const +#endif + #ifndef FNM_FILE_NAME #define FNM_FILE_NAME FNM_PATHNAME /* Preferred GNU name. */ #endif @@ -81,7 +85,7 @@ fnmatch (pattern, string, flags) while ((c = *p++) != '\0') { - c = FOLD (c); + c = FOLD ((unsigned char)c); switch (c) { @@ -99,9 +103,9 @@ fnmatch (pattern, string, flags) if (!(flags & FNM_NOESCAPE)) { c = *p++; - c = FOLD (c); + c = FOLD ((unsigned char )c); } - if (FOLD (*n) != c) + if (FOLD ((unsigned char )*n) != c) return FNM_NOMATCH; break; @@ -120,9 +124,9 @@ fnmatch (pattern, string, flags) { char c1 = (!(flags & FNM_NOESCAPE) && c == '\\') ? *p : c; - c1 = FOLD (c1); + c1 = FOLD ((unsigned char )c1); for (--p; *n != '\0'; ++n) - if ((c == '[' || FOLD (*n) == c1) && + if ((c == '[' || FOLD ((unsigned char )*n) == c1) && fnmatch (p, n, flags & ~FNM_PERIOD) == 0) return 0; return FNM_NOMATCH; @@ -152,14 +156,14 @@ fnmatch (pattern, string, flags) if (!(flags & FNM_NOESCAPE) && c == '\\') cstart = cend = *p++; - cstart = cend = FOLD (cstart); + cstart = cend = FOLD ((unsigned char)cstart); if (c == '\0') /* [ (unterminated) loses. */ return FNM_NOMATCH; c = *p++; - c = FOLD (c); + c = FOLD ((unsigned char)c); if ((flags & FNM_FILE_NAME) && c == '/') /* [/] can never match. */ @@ -172,12 +176,12 @@ fnmatch (pattern, string, flags) cend = *p++; if (cend == '\0') return FNM_NOMATCH; - cend = FOLD (cend); + cend = FOLD ((unsigned char)cend); c = *p++; } - if (FOLD (*n) >= cstart && FOLD (*n) <= cend) + if (FOLD ((unsigned char)*n) >= cstart && FOLD ((unsigned char)*n) <= cend) goto matched; if (c == ']') @@ -206,7 +210,7 @@ fnmatch (pattern, string, flags) break; default: - if (c != FOLD (*n)) + if (c != FOLD ((unsigned char)*n)) return FNM_NOMATCH; } diff --git a/util/mkisofs/include/fctldefs.h b/util/mkisofs/include/fctldefs.h new file mode 100644 index 000000000..de6b6a394 --- /dev/null +++ b/util/mkisofs/include/fctldefs.h @@ -0,0 +1,57 @@ +/* @(#)fctldefs.h 1.2 98/10/08 Copyright 1996 J. Schilling */ +/* + * Generic header for users of open(), creat() and chmod() + * + * Copyright (c) 1996 J. Schilling + */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _FCTLDEFS_H +#define _FCTLDEFS_H + +#ifndef _MCONFIG_H +#include +#endif + +#include +#include + +#ifdef HAVE_FCNTL_H + +# include + +#else /* HAVE_FCNTL_H */ + +# include + +#endif /* HAVE_FCNTL_H */ + +/* + * Do not define more than O_RDONLY / O_WRONLY / O_RDWR + * The values may differ. + */ +#ifndef O_RDONLY +#define O_RDONLY 0 +#endif +#ifndef O_WRONLY +#define O_WRONLY 1 +#endif +#ifndef O_RDWR +#define O_RDWR 2 +#endif + +#endif /* _FCTLDEFS_H */ diff --git a/util/mkisofs/include/mconfig.h b/util/mkisofs/include/mconfig.h new file mode 100644 index 000000000..1725217d3 --- /dev/null +++ b/util/mkisofs/include/mconfig.h @@ -0,0 +1,268 @@ +/* @(#)mconfig.h 1.24 98/12/14 Copyright 1995 J. Schilling */ +/* + * definitions for machine configuration + * + * Copyright (c) 1995 J. Schilling + * + * This file must be included before any other file. + * Use only cpp instructions. + * + * NOTE: SING: (Schily Is Not Gnu) + */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _MCONFIG_H +#define _MCONFIG_H + +/* + * This hack that is needed as long as VMS has no POSIX shell. + */ +#ifdef VMS +# define USE_STATIC_CONF +#endif + +#ifdef VANILLA_AUTOCONF +#include +#else +#ifdef USE_STATIC_CONF +#include /* This is the current static autoconf stuff */ +#else +#include /* This is the current dynamic autoconf stuff */ +#endif +#endif + +#ifdef __cplusplus +extern "C" { +#endif + +#if defined(unix) || defined(__unix) || defined(__unix__) +# define IS_UNIX +#endif + +#ifdef __MSDOS__ +# define IS_MSDOS +#endif + +#if defined(tos) || defined(__tos) +# define IS_TOS +#endif + +#ifdef THINK_C +# define IS_MAC +#endif + +#if defined(sun) || defined(__sun) || defined(__sun__) +# define IS_SUN +#endif + +#if defined(__CYGWIN32__) +# define IS_GCC_WIN32 +#endif + +/*--------------------------------------------------------------------------*/ +/* + * Some magic that cannot (yet) be figured out with autoconf. + */ + +#ifdef sparc +# ifndef HAVE_LDSTUB +# define HAVE_LDSTUB +# endif +# ifndef HAVE_SCANSTACK +# define HAVE_SCANSTACK +# endif +#endif +#if defined(__i386_) || defined(i386) +# ifndef HAVE_XCHG +# define HAVE_XCHG +# endif +# ifndef HAVE_SCANSTACK +# define HAVE_SCANSTACK +# endif +#endif + +#if defined(SOL2) || defined(SOL2) || defined(S5R4) || defined(__S5R4) \ + || defined(SVR4) +# ifndef __SVR4 +# define __SVR4 +# endif +#endif + +#ifdef __SVR4 +# ifndef SVR4 +# define SVR4 +# endif +#endif + +/* + * SunOS 4.x / SunOS 5.x + */ +#if defined(IS_SUN) +# define HAVE_GETAV0 +#endif + +/* + * AIX + */ +#if defined(_IBMR2) || defined(_AIX) +# define IS_UNIX /* ??? really ??? */ +#endif + +/* + * Silicon Graphics (must be before SVR4) + */ +#if defined(sgi) || defined(__sgi) +# define __NOT_SVR4__ /* Not a real SVR4 implementation */ +#endif + +/* + * Data General + */ +#if defined(__DGUX__) +#ifdef XXXXXXX +# undef HAVE_MTGET_DSREG +# undef HAVE_MTGET_RESID +# undef HAVE_MTGET_FILENO +# undef HAVE_MTGET_BLKNO +#endif +# define mt_type mt_model +# define mt_dsreg mt_status1 +# define mt_erreg mt_status2 + /* + * DGUX hides its flock as dg_flock. + */ +# define HAVE_FLOCK +# define flock dg_flock + /* + * Use the BSD style wait on DGUX to get the resource usages of child + * processes. + */ +# define _BSD_WAIT_FLAVOR +#endif + +/* + * Apple Rhapsody + */ +#if defined(__NeXT__) && defined(__TARGET_OSNAME) && __TARGET_OSNAME == rhapsody +# define HAVE_OSDEF /* prevent later definitions to overwrite current */ +#endif + +/* + * NextStep + */ +#if defined(__NeXT__) && !defined(HAVE_OSDEF) +#define NO_PRINT_OVR +#undef HAVE_USG_STDIO /* + * NeXT Step 3.x uses __flsbuf(unsigned char , FILE *) + * instead of __flsbuf(int, FILE *) + */ +#endif + +/* + * NextStep 3.x has a broken linker that does not allow us to override + * these functions. + */ +#ifndef __OPRINTF__ + +#ifdef NO_PRINT_OVR +# define printf Xprintf +# define fprintf Xfprintf +# define sprintf Xsprintf +#endif + +#endif /* __OPRINTF__ */ + +/*--------------------------------------------------------------------------*/ +/* + * If there is no flock defined by the system, use emulation + * through fcntl record locking. + */ +#ifndef HAVE_FLOCK +#define LOCK_SH 1 /* shared lock */ +#define LOCK_EX 2 /* exclusive lock */ +#define LOCK_NB 4 /* don't block when locking */ +#define LOCK_UN 8 /* unlock */ +#endif + +#include + +/* + * gcc 2.x generally implements the long long type. + */ +#ifdef __GNUC__ +# if __GNUC__ > 1 +# ifndef HAVE_LONGLONG +# define HAVE_LONGLONG +# endif +# endif +#endif + +/* + * Convert to GNU name + */ +#ifdef HAVE_STDC_HEADERS +# ifndef STDC_HEADERS +# define STDC_HEADERS +# endif +#endif +/* + * Convert to SCHILY name + */ +#ifdef STDC_HEADERS +# ifndef HAVE_STDC_HEADERS +# define HAVE_STDC_HEADERS +# endif +#endif + +#ifdef IS_UNIX +# define PATH_DELIM '/' +# define PATH_DELIM_STR "/" +# define far +# define near +#endif + +#ifdef IS_GCC_WIN32 +# define PATH_DELIM '/' +# define PATH_DELIM_STR "/" +# define far +# define near +#endif + +#ifdef IS_MSDOS +# define PATH_DELIM '\\' +# define PATH_DELIM_STR "\\" +#endif + +#ifdef IS_TOS +# define PATH_DELIM '\\' +# define PATH_DELIM_STR "\\" +# define far +# define near +#endif + +#ifdef IS_MAC +# define PATH_DELIM ':' +# define PATH_DELIM_STR ":" +# define far +# define near +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* _MCONFIG_H */ diff --git a/util/mkisofs/include/prototyp.h b/util/mkisofs/include/prototyp.h new file mode 100644 index 000000000..c74ae0af8 --- /dev/null +++ b/util/mkisofs/include/prototyp.h @@ -0,0 +1,74 @@ +/* @(#)prototyp.h 1.7 98/10/08 Copyright 1995 J. Schilling */ +/* + * Definitions for dealing with ANSI / KR C-Compilers + * + * Copyright (c) 1995 J. Schilling + */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _PROTOTYP_H +#define _PROTOTYP_H + +#ifndef PROTOTYPES + /* + * If this has already been defined, + * someone else knows better than us... + */ +# ifdef __STDC__ +# if __STDC__ /* ANSI C */ +# define PROTOTYPES +# endif +# if defined(sun) && __STDC__ - 0 == 0 /* Sun C */ +# define PROTOTYPES +# endif +# endif +#endif /* PROTOTYPES */ + +/* + * If we have prototypes, we should have stdlib.h string.h stdarg.h + */ +#ifdef PROTOTYPES +#if !(defined(SABER) && defined(sun)) +# ifndef HAVE_STDARG_H +# define HAVE_STDARG_H +# endif +#endif +# ifndef HAVE_STDLIB_H +# define HAVE_STDLIB_H +# endif +# ifndef HAVE_STRING_H +# define HAVE_STRING_H +# endif +# ifndef HAVE_STDC_HEADERS +# define HAVE_STDC_HEADERS +# endif +# ifndef STDC_HEADERS +# define STDC_HEADERS /* GNU name */ +# endif +#endif + +#ifdef NO_PROTOTYPES /* Force not to use prototypes */ +# undef PROTOTYPES +#endif + +#ifdef PROTOTYPES +# define __PR(a) a +#else +# define __PR(a) () +#endif + +#endif /* _PROTOTYP_H */ diff --git a/util/mkisofs/include/statdefs.h b/util/mkisofs/include/statdefs.h new file mode 100644 index 000000000..0e34805ce --- /dev/null +++ b/util/mkisofs/include/statdefs.h @@ -0,0 +1,139 @@ +/* @(#)statdefs.h 1.1 98/11/22 Copyright 1998 J. Schilling */ +/* + * Definitions for stat() file mode + * + * Copyright (c) 1998 J. Schilling + */ +/* + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2, or (at your option) + * any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; see the file COPYING. If not, write to + * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. + */ + +#ifndef _STATDEFS_H +#define _STATDEFS_H + +#ifndef _MCONFIG_H +#include +#endif + +#ifdef STAT_MACROS_BROKEN +#undef S_ISFIFO /* Named pipe */ +#undef S_ISCHR /* Character special */ +#undef S_ISMPC /* UNUSED multiplexed c */ +#undef S_ISDIR /* Directory */ +#undef S_ISNAM /* Named file (XENIX) */ +#undef S_ISBLK /* Block special */ +#undef S_ISMPB /* UNUSED multiplexed b */ +#undef S_ISREG /* Regular file */ +#undef S_ISCNT /* Contiguous file */ +#undef S_ISLNK /* Symbolic link */ +#undef S_ISSHAD /* Solaris shadow inode */ +#undef S_ISSOCK /* UNIX domain socket */ +#undef S_ISDOOR /* Solaris DOOR */ +#endif + +#ifndef S_ISFIFO /* Named pipe */ +# ifdef S_IFIFO +# define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO) +# else +# define S_ISFIFO(m) (0) +# endif +#endif +#ifndef S_ISCHR /* Character special */ +# ifdef S_IFCHR +# define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR) +# else +# define S_ISCHR(m) (0) +# endif +#endif +#ifndef S_ISMPC /* UNUSED multiplexed c */ +# ifdef S_IFMPC +# define S_ISMPC(m) (((m) & S_IFMT) == S_IFMPC) +# else +# define S_ISMPC(m) (0) +# endif +#endif +#ifndef S_ISDIR /* Directory */ +# ifdef S_IFDIR +# define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +# else +# define S_ISDIR(m) (0) +# endif +#endif +#ifndef S_ISNAM /* Named file (XENIX) */ +# ifdef S_IFNAM +# define S_ISNAM(m) (((m) & S_IFMT) == S_IFNAM) +# else +# define S_ISNAM(m) (0) +# endif +#endif +#ifndef S_ISBLK /* Block special */ +# ifdef S_IFBLK +# define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK) +# else +# define S_ISBLK(m) (0) +# endif +#endif +#ifndef S_ISMPB /* UNUSED multiplexed b */ +# ifdef S_IFMPB +# define S_ISMPB(m) (((m) & S_IFMT) == S_IFMPB) +# else +# define S_ISMPB(m) (0) +# endif +#endif +#ifndef S_ISREG /* Regular file */ +# ifdef S_IFREG +# define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) +# else +# define S_ISREG(m) (0) +# endif +#endif +#ifndef S_ISCNT /* Contiguous file */ +# ifdef S_IFCNT +# define S_ISCNT(m) (((m) & S_IFMT) == S_IFCNT) +# else +# define S_ISCNT(m) (0) +# endif +#endif +#ifndef S_ISLNK /* Symbolic link */ +# ifdef S_IFLNK +# define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK) +# else +# define S_ISLNK(m) (0) +# endif +#endif +#ifndef S_ISSHAD /* Solaris shadow inode */ +# ifdef S_IFSHAD +# define S_ISSHAD(m) (((m) & S_IFMT) == S_IFSHAD) +# else +# define S_ISSHAD(m) (0) +# endif +#endif +#ifndef S_ISSOCK /* UNIX domain socket */ +# ifdef S_IFSOCK +# define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK) +# else +# define S_ISSOCK(m) (0) +# endif +#endif +#ifndef S_ISDOOR /* Solaris DOOR */ +# ifdef S_IFDOOR +# define S_ISDOOR(m) (((m) & S_IFMT) == S_IFDOOR) +# else +# define S_ISDOOR(m) (0) +# endif +#endif + +#endif /* _STATDEFS_H */ + diff --git a/util/mkisofs/joliet.c b/util/mkisofs/joliet.c index d3e8cb0e3..0aa866854 100644 --- a/util/mkisofs/joliet.c +++ b/util/mkisofs/joliet.c @@ -17,7 +17,7 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: joliet.c,v 1.12 1998/06/02 02:40:37 eric Exp $"; +static char rcsid[] ="$Id: joliet.c,v 1.14 1999/03/07 17:41:19 eric Exp $"; /* @@ -77,13 +77,15 @@ static char rcsid[] ="$Id: joliet.c,v 1.12 1998/06/02 02:40:37 eric Exp $"; #include #include -static jpath_table_index; +static int jpath_table_index; static struct directory ** jpathlist; -static next_jpath_index = 1; +static int next_jpath_index = 1; static int sort_goof; +static int generate_joliet_path_tables __PR((void)); static int DECL(joliet_sort_directory, (struct directory_entry ** sort_dir)); static void DECL(assign_joliet_directory_addresses, (struct directory * node)); +static int jroot_gen __PR((void)); /* * Function: convert_to_unicode @@ -121,7 +123,14 @@ static void FDECL3(convert_to_unicode, unsigned char *, buffer, int, size, char for(i=0; i < size ; i += 2, j++) { buffer[i] = 0; - if( tmpbuf[j] < 0x1f && tmpbuf[j] != 0 ) + /* + * JS integrated from: Achim_Kaiser@t-online.de + * + * Let all valid unicode characters pass through (assuming ISO-8859-1). + * Others are set to '_' . + */ + if( tmpbuf[j] != 0 && + (tmpbuf[j] <= 0x1f || (tmpbuf[j] >= 0x7F && tmpbuf[j] <= 0xA0)) ) { buffer[i+1] = '_'; } @@ -166,7 +175,6 @@ static void FDECL3(convert_to_unicode, unsigned char *, buffer, int, size, char static int FDECL1(joliet_strlen, const char *, string) { int rtn; - struct iso_directory_record foobar; rtn = strlen(string) << 1; @@ -192,32 +200,36 @@ static int FDECL1(joliet_strlen, const char *, string) * already present in the buffer. Just modifiy the * appropriate fields. */ -static void FDECL1(get_joliet_vol_desc, struct iso_primary_descriptor *, vol_desc) +static void FDECL1(get_joliet_vol_desc, struct iso_primary_descriptor *, jvol_desc) { - vol_desc->type[0] = ISO_VD_SUPPLEMENTARY; + jvol_desc->type[0] = ISO_VD_SUPPLEMENTARY; /* * For now, always do Unicode level 3. I don't really know what 1 and 2 * are - perhaps a more limited Unicode set. * - * FIXME(eric) - how does Romeo fit in here? + * FIXME(eric) - how does Romeo fit in here? As mkisofs just + * "expands" 8 bit character codes to 16 bits and does nothing + * special with the Unicode characters, therefore shouldn't mkisofs + * really be stating that it's using UCS-2 Level 1, not Level 3 for + * the Joliet directory tree. */ - strcpy(vol_desc->escape_sequences, "%/E"); + strcpy(jvol_desc->escape_sequences, "%/@"); /* * Until we have Unicode path tables, leave these unset. */ - set_733((char *) vol_desc->path_table_size, jpath_table_size); - set_731(vol_desc->type_l_path_table, jpath_table[0]); - set_731(vol_desc->opt_type_l_path_table, jpath_table[1]); - set_732(vol_desc->type_m_path_table, jpath_table[2]); - set_732(vol_desc->opt_type_m_path_table, jpath_table[3]); + set_733((char *) jvol_desc->path_table_size, jpath_table_size); + set_731(jvol_desc->type_l_path_table, jpath_table[0]); + set_731(jvol_desc->opt_type_l_path_table, jpath_table[1]); + set_732(jvol_desc->type_m_path_table, jpath_table[2]); + set_732(jvol_desc->opt_type_m_path_table, jpath_table[3]); /* * Set this one up. */ - memcpy(vol_desc->root_directory_record, &jroot_record, - sizeof(struct iso_directory_record) + 1); + memcpy(jvol_desc->root_directory_record, &jroot_record, + sizeof(struct iso_directory_record)); /* * Finally, we have a bunch of strings to convert to Unicode. @@ -225,15 +237,15 @@ static void FDECL1(get_joliet_vol_desc, struct iso_primary_descriptor *, vol_des * just be really lazy and do a char -> short conversion. We probably * will want to filter any characters >= 0x80. */ - convert_to_unicode((u_char *)vol_desc->system_id, sizeof(vol_desc->system_id), NULL); - convert_to_unicode((u_char *)vol_desc->volume_id, sizeof(vol_desc->volume_id), NULL); - convert_to_unicode((u_char *)vol_desc->volume_set_id, sizeof(vol_desc->volume_set_id), NULL); - convert_to_unicode((u_char *)vol_desc->publisher_id, sizeof(vol_desc->publisher_id), NULL); - convert_to_unicode((u_char *)vol_desc->preparer_id, sizeof(vol_desc->preparer_id), NULL); - convert_to_unicode((u_char *)vol_desc->application_id, sizeof(vol_desc->application_id), NULL); - convert_to_unicode((u_char *)vol_desc->copyright_file_id, sizeof(vol_desc->copyright_file_id), NULL); - convert_to_unicode((u_char *)vol_desc->abstract_file_id, sizeof(vol_desc->abstract_file_id), NULL); - convert_to_unicode((u_char *)vol_desc->bibliographic_file_id, sizeof(vol_desc->bibliographic_file_id), NULL); + convert_to_unicode((u_char *)jvol_desc->system_id, sizeof(jvol_desc->system_id), NULL); + convert_to_unicode((u_char *)jvol_desc->volume_id, sizeof(jvol_desc->volume_id), NULL); + convert_to_unicode((u_char *)jvol_desc->volume_set_id, sizeof(jvol_desc->volume_set_id), NULL); + convert_to_unicode((u_char *)jvol_desc->publisher_id, sizeof(jvol_desc->publisher_id), NULL); + convert_to_unicode((u_char *)jvol_desc->preparer_id, sizeof(jvol_desc->preparer_id), NULL); + convert_to_unicode((u_char *)jvol_desc->application_id, sizeof(jvol_desc->application_id), NULL); + convert_to_unicode((u_char *)jvol_desc->copyright_file_id, sizeof(jvol_desc->copyright_file_id), NULL); + convert_to_unicode((u_char *)jvol_desc->abstract_file_id, sizeof(jvol_desc->abstract_file_id), NULL); + convert_to_unicode((u_char *)jvol_desc->bibliographic_file_id, sizeof(jvol_desc->bibliographic_file_id), NULL); } @@ -261,8 +273,9 @@ static void FDECL1(assign_joliet_directory_addresses, struct directory *, node) last_extent += dir_size; } } - - if(dpnt->subdir) + + /* skip if hidden - but not for the rr_moved dir */ + if(dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir)) { assign_joliet_directory_addresses(dpnt->subdir); } @@ -341,6 +354,12 @@ static int generate_joliet_path_tables() memset(jpath_table_l, 0, tablesize); memset(jpath_table_m, 0, tablesize); + if( next_jpath_index > 0xffff ) + { + fprintf(stderr, "Unable to generate sane path tables - too many directories (%d)\n", + next_jpath_index); + exit(1); + } /* * Now start filling in the path tables. Start with root directory */ @@ -353,8 +372,13 @@ static int generate_joliet_path_tables() do { fix = 0; +#ifdef __STDC__ qsort(&jpathlist[1], next_jpath_index-1, sizeof(struct directory *), (int (*)(const void *, const void *))joliet_compare_paths); +#else + qsort(&jpathlist[1], next_jpath_index-1, sizeof(struct directory *), + joliet_compare_paths); +#endif for(j=1; jjcontents; while(s_entry) { - if( (s_entry->de_flags & INHIBIT_JOLIET_ENTRY) == 0 ) - { + if(s_entry->de_flags & INHIBIT_JOLIET_ENTRY) { + s_entry = s_entry->jnext; + continue; + } + /* * If this entry was a directory that was relocated, we have a bit * of trouble here. We need to dig out the real thing and put it @@ -617,8 +644,8 @@ static void FDECL2(generate_one_joliet_directory, struct directory *, dpnt, FILE { directory_buffer[dir_index++] = 0; } - } - s_entry = s_entry->jnext; + + s_entry = s_entry->jnext; } if(dpnt->jsize != dir_index) @@ -637,8 +664,15 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir) struct directory_entry * s_entry; int status = 0; + /* don't want to skip this directory if it's the reloc_dir at the moment */ + if(this_dir != reloc_dir && this_dir->dir_flags & INHIBIT_JOLIET_ENTRY) + { + return 0; + } + for(s_entry = this_dir->contents; s_entry; s_entry = s_entry->next) { + /* skip hidden entries */ if( (s_entry->de_flags & INHIBIT_JOLIET_ENTRY) != 0 ) { continue; @@ -707,6 +741,10 @@ static int FDECL1(joliet_sort_n_finish, struct directory *, this_dir) * Do not split a directory entry across a sector boundary */ s_entry = this_dir->jcontents; +/* + * XXX Is it ok to comment this out? + */ +/*XXX JS this_dir->ce_bytes = 0;*/ for(s_entry = this_dir->jcontents; s_entry; s_entry = s_entry->jnext) { int jreclen; @@ -798,14 +836,16 @@ static int FDECL2(joliet_compare_dirs, const void *, rr, const void *, ll) static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir) { int dcount = 0; - int i, len; + int i; struct directory_entry * s_entry; struct directory_entry ** sortlist; s_entry = *sort_dir; while(s_entry) { - dcount++; + /* skip hidden entries */ + if (!(s_entry->de_flags & INHIBIT_JOLIET_ENTRY)) + dcount++; s_entry = s_entry->next; } @@ -819,14 +859,22 @@ static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir) s_entry = *sort_dir; while(s_entry) { - sortlist[dcount] = s_entry; - dcount++; + /* skip hidden entries */ + if (!(s_entry->de_flags & INHIBIT_JOLIET_ENTRY)) { + sortlist[dcount] = s_entry; + dcount++; + } s_entry = s_entry->next; } sort_goof = 0; +#ifdef __STDC__ qsort(sortlist, dcount, sizeof(struct directory_entry *), (int (*)(const void *, const void *))joliet_compare_dirs); +#else + qsort(sortlist, dcount, sizeof(struct directory_entry *), + joliet_compare_dirs); +#endif /* * Now reassemble the linked list in the proper sorted order @@ -846,24 +894,24 @@ static int FDECL1(joliet_sort_directory, struct directory_entry **, sort_dir) int FDECL1(joliet_sort_tree, struct directory *, node) { struct directory * dpnt; - int goof = 0; + int ret = 0; dpnt = node; while (dpnt){ - goof = joliet_sort_n_finish(dpnt); - if( goof ) + ret = joliet_sort_n_finish(dpnt); + if( ret ) { break; } - if(dpnt->subdir) goof = joliet_sort_tree(dpnt->subdir); - if( goof ) + if(dpnt->subdir) ret = joliet_sort_tree(dpnt->subdir); + if( ret ) { break; } dpnt = dpnt->next; } - return goof; + return ret; } static void FDECL2(generate_joliet_directories, struct directory *, node, FILE*, outfile){ @@ -879,12 +927,14 @@ static void FDECL2(generate_joliet_directories, struct directory *, node, FILE*, * In theory we should never reuse a directory, so this doesn't * make much sense. */ - if( dpnt->extent > session_start ) + if( dpnt->jextent > session_start ) { generate_one_joliet_directory(dpnt, outfile); } } - if(dpnt->subdir) generate_joliet_directories(dpnt->subdir, outfile); + /* skip if hidden - but not for the rr_moved dir */ + if(dpnt->subdir && (!(dpnt->dir_flags & INHIBIT_JOLIET_ENTRY) || dpnt == reloc_dir)) + generate_joliet_directories(dpnt->subdir, outfile); dpnt = dpnt->next; } } @@ -925,7 +975,7 @@ static int jroot_gen() jroot_record.flags[0] = 2; jroot_record.file_unit_size[0] = 0; jroot_record.interleave[0] = 0; - set_723(jroot_record.volume_sequence_number, DEF_VSN); + set_723(jroot_record.volume_sequence_number, volume_sequence_number); jroot_record.name_len[0] = 1; return 0; } diff --git a/util/mkisofs/match.c b/util/mkisofs/match.c index 0f5c7d8a7..e01314b0b 100644 --- a/util/mkisofs/match.c +++ b/util/mkisofs/match.c @@ -4,8 +4,10 @@ * in the CD image. */ -static char rcsid[] ="$Id: match.c,v 1.2 1997/02/23 16:10:42 eric Rel $"; +static char rcsid[] ="$Id: match.c,v 1.3 1999/03/02 03:41:25 eric Exp $"; +#include "config.h" +#include #include #ifndef VMS #ifdef HAVE_MALLOC_H @@ -54,3 +56,92 @@ char * fn; } return 0; /* not found -> not excluded */ } + +/* ISO9660/RR hide */ + +static char *i_mat[MAXMATCH]; + +void i_add_match(fn) +char * fn; +{ + register int i; + + for (i=0; i_mat[i] && i excluded filenmae */ + } + } + return 0; /* not found -> not excluded */ +} + +int i_ishidden() +{ + return((int)i_mat[0]); +} + +/* Joliet hide */ + +static char *j_mat[MAXMATCH]; + +void j_add_match(fn) +char * fn; +{ + register int i; + + for (i=0; j_mat[i] && i excluded filenmae */ + } + } + return 0; /* not found -> not excluded */ +} + +int j_ishidden() +{ + return((int)j_mat[0]); +} + diff --git a/util/mkisofs/match.h b/util/mkisofs/match.h index 90def7c2d..7367dd211 100644 --- a/util/mkisofs/match.h +++ b/util/mkisofs/match.h @@ -5,10 +5,18 @@ */ /* - * $Id: match.h,v 1.1 1997/02/23 15:56:12 eric Rel $ + * $Id: match.h,v 1.2 1999/03/02 03:41:25 eric Exp $ */ #include "fnmatch.h" -void add_match(); -int matches(); +void add_match __PR((char *fn)); +int matches __PR((char *fn)); + +void i_add_match __PR((char *fn)); +int i_matches __PR((char *fn)); +int i_ishidden __PR((void)); + +void j_add_match __PR((char *fn)); +int j_matches __PR((char *fn)); +int j_ishidden __PR((void)); diff --git a/util/mkisofs/mkisofs.c b/util/mkisofs/mkisofs.c index 3344a921a..11959c0ca 100644 --- a/util/mkisofs/mkisofs.c +++ b/util/mkisofs/mkisofs.c @@ -20,11 +20,12 @@ along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -static char rcsid[] ="$Id: mkisofs.c,v 1.29 1998/06/02 03:43:45 eric Exp $"; +static char rcsid[] ="$Id: mkisofs.c,v 1.32 1999/03/07 21:48:49 eric Exp $"; #include #include "config.h" #include "mkisofs.h" +#include "match.h" #ifdef linux #include @@ -50,6 +51,7 @@ static char rcsid[] ="$Id: mkisofs.c,v 1.29 1998/06/02 03:43:45 eric Exp $"; #include #endif #endif +#include #include "exclude.h" @@ -60,8 +62,9 @@ static char rcsid[] ="$Id: mkisofs.c,v 1.29 1998/06/02 03:43:45 eric Exp $"; struct directory * root = NULL; -static char version_string[] = "mkisofs 1.12b4"; +static char version_string[] = "mkisofs 1.12b5"; +char * outfile; FILE * discimage; unsigned int next_extent = 0; unsigned int last_extent = 0; @@ -104,6 +107,8 @@ char * volume_id = VOLUME_ID_DEFAULT; char * system_id = SYSTEM_ID_DEFAULT; char * boot_catalog = BOOT_CATALOG_DEFAULT; char * boot_image = BOOT_IMAGE_DEFAULT; +int volume_set_size = 1; +int volume_sequence_number = 1; int omit_period = 0; /* Violates iso9660, but these are a pain */ int transparent_compression = 0; /* So far only works with linux */ @@ -166,19 +171,35 @@ struct ld_option #define OPTION_NOSPLIT_SL_FIELD 153 #define OPTION_PRINT_SIZE 154 #define OPTION_SPLIT_OUTPUT 155 +#define OPTION_ABSTRACT 156 +#define OPTION_BIBLIO 157 +#define OPTION_COPYRIGHT 158 +#define OPTION_SYSID 159 +#define OPTION_VOLSET 160 +#define OPTION_VOLSET_SIZE 161 +#define OPTION_VOLSET_SEQ_NUM 162 +#define OPTION_I_HIDE 163 +#define OPTION_J_HIDE 164 +#define OPTION_LOG_FILE 165 static const struct ld_option ld_options[] = { { {"all-files", no_argument, NULL, 'a'}, 'a', NULL, "Process all files (don't skip backup files)", ONE_DASH }, + { {"abstract", required_argument, NULL, OPTION_ABSTRACT}, + '\0', "FILE", "Set Abstract filename" , ONE_DASH }, { {"appid", required_argument, NULL, 'A'}, 'A', "ID", "Set Application ID" , ONE_DASH }, + { {"biblio", required_argument, NULL, OPTION_BIBLIO}, + '\0', "FILE", "Set Bibliographic filename" , ONE_DASH }, + { {"copyright", required_argument, NULL, OPTION_COPYRIGHT}, + '\0', "FILE", "Set Copyright filename" , ONE_DASH }, { {"eltorito-boot", required_argument, NULL, 'b'}, 'b', "FILE", "Set El Torito boot image name" , ONE_DASH }, { {"eltorito-catalog", required_argument, NULL, 'c'}, 'c', "FILE", "Set El Torito boot catalog name" , ONE_DASH }, { {"cdwrite-params", required_argument, NULL, 'C'}, - 'C', "PARAMS", "Magic paramters from cdwrite" , ONE_DASH }, + 'C', "PARAMS", "Magic paramters from cdrecord" , ONE_DASH }, { {"omit-period", no_argument, NULL, 'd'}, 'd', NULL, "Omit trailing periods from filenames", ONE_DASH }, { {"disable-deep-relocation", no_argument, NULL, 'D'}, @@ -187,6 +208,10 @@ static const struct ld_option ld_options[] = 'f', NULL, "Follow symbolic links", ONE_DASH }, { {"help", no_argument, NULL, OPTION_HELP}, '\0', NULL, "Print option help", ONE_DASH }, + { {"hide", required_argument, NULL, OPTION_I_HIDE}, + '\0', "GLOBFILE", "Hide ISO9660/RR file" , ONE_DASH }, + { {"hide-joliet", required_argument, NULL, OPTION_J_HIDE}, + '\0', "GLOBFILE", "Hide Joliet file" , ONE_DASH }, { {NULL, required_argument, NULL, 'i'}, 'i', "ADD_FILES", "No longer supported" , TWO_DASHES }, { {"joliet", no_argument, NULL, 'J'}, @@ -195,6 +220,8 @@ static const struct ld_option ld_options[] = 'l', NULL, "Allow full 32 character filenames for iso9660 names", ONE_DASH }, { {"allow-leading-dots", no_argument, NULL, 'L'}, 'L', NULL, "Allow iso9660 filenames to start with '.'", ONE_DASH }, + { {"log-file", required_argument, NULL, OPTION_LOG_FILE}, + '\0', "LOG_FILE", "Re-direct messages to LOG_FILE", ONE_DASH }, { {"exclude", required_argument, NULL, 'm'}, 'm', "GLOBFILE", "Exclude file name" , ONE_DASH }, { {"prev-session", required_argument, NULL, 'M'}, @@ -221,12 +248,20 @@ static const struct ld_option ld_options[] = 'R', NULL, "Generate Rock Ridge directory information", ONE_DASH }, { {"split-output", no_argument, NULL, OPTION_SPLIT_OUTPUT}, '\0', NULL, "Split output into files of approx. 1GB size", ONE_DASH }, + { {"sysid", required_argument, NULL, OPTION_SYSID}, + '\0', "ID", "Set System ID" , ONE_DASH }, { {"translation-table", no_argument, NULL, 'T'}, 'T', NULL, "Generate translation tables for systems that don't understand long filenames", ONE_DASH }, { {"verbose", no_argument, NULL, 'v'}, 'v', NULL, "Verbose", ONE_DASH }, { {"volid", required_argument, NULL, 'V'}, 'V', "ID", "Set Volume ID" , ONE_DASH }, + { {"volset", required_argument, NULL, OPTION_VOLSET}, + '\0', "ID", "Set Volume set ID" , ONE_DASH }, + { {"volset-size", required_argument, NULL, OPTION_VOLSET_SIZE}, + '\0', "#", "Set Volume set size" , ONE_DASH }, + { {"volset-seqno", required_argument, NULL, OPTION_VOLSET_SEQ_NUM}, + '\0', "#", "Set Volume set sequence number" , ONE_DASH }, { {"old-exclude", required_argument, NULL, 'x'}, 'x', "FILE", "Exclude file name(depreciated)" , ONE_DASH } #ifdef ERIC_neverdef @@ -242,6 +277,10 @@ char *strdup(s) char *s;{char *c;if(c=(char *)malloc(strlen(s)+1))strcpy(c,s);return c;} #endif + void read_rcfile __PR((char * appname)); + void usage __PR((void)); +static void hide_reloc_dir __PR((void)); + void FDECL1(read_rcfile, char *, appname) { FILE * rcfile; @@ -318,10 +357,10 @@ void FDECL1(read_rcfile, char *, appname) /* The name should begin in the left margin. Make sure it is in upper case. Stop when we see white space or a comment. */ name = pnt; - while (*pnt && isalpha(*pnt)) + while (*pnt && isalpha((unsigned char)*pnt)) { - if(islower(*pnt)) - *pnt = toupper(*pnt); + if(islower((unsigned char)*pnt)) + *pnt = toupper((unsigned char)*pnt); pnt++; } if (name == pnt) @@ -408,7 +447,7 @@ void usage(){ #endif int i; - const char **targets, **pp; +/* const char **targets, **pp;*/ fprintf (stderr, "Usage: %s [options] file...\n", program_name); @@ -500,9 +539,9 @@ void usage(){ * with DST, I guess). The Linux iso9660 filesystem has had the sign * of this wrong for ages (mkisofs had it wrong too for the longest time). */ -int FDECL2(iso9660_date,char *, result, time_t, ctime){ +int FDECL2(iso9660_date,char *, result, time_t, crtime){ struct tm *local; - local = localtime(&ctime); + local = localtime(&crtime); result[0] = local->tm_year; result[1] = local->tm_mon + 1; result[2] = local->tm_mday; @@ -515,7 +554,7 @@ int FDECL2(iso9660_date,char *, result, time_t, ctime){ * as some files use daylight savings time and some don't... */ result[6] = local->tm_yday; /* save yday 'cause gmtime zaps it */ - local = gmtime(&ctime); + local = gmtime(&crtime); local->tm_year -= result[0]; local->tm_yday -= result[6]; local->tm_hour -= result[3]; @@ -534,11 +573,28 @@ int FDECL2(iso9660_date,char *, result, time_t, ctime){ return 0; } +/* hide "./rr_moved" if all its contents are hidden */ +static void +hide_reloc_dir() +{ + struct directory_entry * s_entry; + + for (s_entry = reloc_dir->contents; s_entry; s_entry = s_entry->next) { + if(strcmp(s_entry->name,".")==0 || strcmp(s_entry->name,"..")==0) + continue; + + if((s_entry->de_flags & INHIBIT_ISO9660_ENTRY) == 0) + return; + } + + /* all entries are hidden, so hide this directory */ + reloc_dir->dir_flags |= INHIBIT_ISO9660_ENTRY; + reloc_dir->self->de_flags |= INHIBIT_ISO9660_ENTRY; +} extern char * cdwrite_data; int FDECL2(main, int, argc, char **, argv){ - char * outfile; struct directory_entry de; #ifdef HAVE_SBRK unsigned long mem_start; @@ -552,6 +608,7 @@ int FDECL2(main, int, argc, char **, argv){ char shortopts[OPTION_COUNT * 3 + 2]; struct option longopts[OPTION_COUNT + 1]; int c; + char *log_file = 0; if (argc < 2) usage(); @@ -643,6 +700,13 @@ int FDECL2(main, int, argc, char **, argv){ exit(1); } break; + case OPTION_ABSTRACT: + abstract = optarg; + if(strlen(abstract) > 37) { + fprintf(stderr,"Abstract filename string too long\n"); + exit(1); + }; + break; case 'A': appid = optarg; if(strlen(appid) > 128) { @@ -650,6 +714,20 @@ int FDECL2(main, int, argc, char **, argv){ exit(1); }; break; + case OPTION_BIBLIO: + biblio = optarg; + if(strlen(biblio) > 37) { + fprintf(stderr,"Bibliographic filename string too long\n"); + exit(1); + }; + break; + case OPTION_COPYRIGHT: + copyright = optarg; + if(strlen(copyright) > 37) { + fprintf(stderr,"Copyright filename string too long\n"); + exit(1); + }; + break; case 'd': omit_period++; break; @@ -665,6 +743,9 @@ int FDECL2(main, int, argc, char **, argv){ case 'L': allow_leading_dots++; break; + case OPTION_LOG_FILE: + log_file = optarg; + break; case 'M': merge_image = optarg; break; @@ -704,11 +785,39 @@ int FDECL2(main, int, argc, char **, argv){ case OPTION_SPLIT_OUTPUT: split_output++; break; + case OPTION_SYSID: + system_id = optarg; + if(strlen(system_id) > 32) { + fprintf(stderr,"System ID string too long\n"); + exit(1); + }; + break; case 'T': generate_tables++; break; case 'V': volume_id = optarg; + if(strlen(volume_id) > 32) { + fprintf(stderr,"Volume ID string too long\n"); + exit(1); + }; + break; + case OPTION_VOLSET: + volset_id = optarg; + if(strlen(volset_id) > 128) { + fprintf(stderr,"Volume set ID string too long\n"); + exit(1); + }; + break; + case OPTION_VOLSET_SIZE: + volume_set_size = atoi(optarg); + break; + case OPTION_VOLSET_SEQ_NUM: + volume_sequence_number = atoi(optarg); + if (volume_sequence_number > volume_set_size) { + fprintf(stderr,"Volume set sequence number too big\n"); + exit(1); + } break; case 'v': verbose++; @@ -730,6 +839,12 @@ int FDECL2(main, int, argc, char **, argv){ */ add_match(optarg); break; + case OPTION_I_HIDE: + i_add_match(optarg); + break; + case OPTION_J_HIDE: + j_add_match(optarg); + break; case OPTION_HELP: usage (); exit (0); @@ -764,15 +879,23 @@ parse_input_files: mem_start = (unsigned long) sbrk(0); #endif + /* if the -hide-joliet option has been given, set the Joliet option */ + if (!use_Joliet && j_ishidden()) + use_Joliet++; + if(verbose > 1) fprintf(stderr,"%s\n", version_string); - if( (cdwrite_data != NULL && merge_image == NULL) - || (cdwrite_data == NULL && merge_image != NULL) ) + if(cdwrite_data == NULL && merge_image != NULL) { - fprintf(stderr,"Multisession usage bug - both -C and -M must be specified.\n"); + fprintf(stderr,"Multisession usage bug: Must specify -C if -M is used.\n"); exit(0); } + if(cdwrite_data != NULL && merge_image == NULL) + { + fprintf(stderr,"Warning: -C specified without -M: old session data will not be merged.\n"); + } + /* The first step is to scan the directory tree, and take some notes */ scan_tree = argv[optind]; @@ -803,6 +926,34 @@ parse_input_files: #endif } + if (log_file) { + FILE *lfp; + int i; + + /* open log file - test that we can open OK */ + if ((lfp = fopen(log_file, "w")) == NULL) { + fprintf(stderr,"can't open logfile: %s\n", log_file); + exit (1); + } + fclose(lfp); + + /* redirect all stderr message to log_file */ + fprintf(stderr, "re-directing all messages to %s\n", log_file); + fflush(stderr); + + /* associate stderr with the log file */ + if (freopen(log_file, "w", stderr) == NULL) { + fprintf(stderr,"can't open logfile: %s\n", log_file); + exit (1); + } + if(verbose > 1) { + for (i=0;i